diff --git a/plugins/gold-price-check/.gitignore b/plugins/gold-price-check/.gitignore new file mode 100644 index 00000000..3c031a9f --- /dev/null +++ b/plugins/gold-price-check/.gitignore @@ -0,0 +1,28 @@ +# Dependencies +node_modules/ + +# Build output +dist/ + +# IDE +.vscode/ +.idea/ +*.swp +*.swo +*~ + +# OS +.DS_Store +Thumbs.db + +# Env +.env +.env.local +.env.*.local + +# Logs +*.log +npm-debug.log* + +# WorkBuddy +.workbuddy/ diff --git a/plugins/gold-price-check/README.md b/plugins/gold-price-check/README.md new file mode 100644 index 00000000..56bb684c --- /dev/null +++ b/plugins/gold-price-check/README.md @@ -0,0 +1,72 @@ +# 每日金价 · ZTools 插件 + +实时查看每日金价、品牌金店饰品价、银行金条价、黄金回收价,以及日内/月度/年度价格波动走势。 + +## 功能 + +| Tab | 内容 | +|-----|------| +| **今日金价** | 品牌金店饰品价、银行投资金条价、黄金回收参考价,实时更新 | +| **日内波动** | 当日 OHLC(开/高/低/收)+ 24小时分时走势图 | +| **月度走势** | 近30天日线图 + 指定月份明细查询 | +| **年度走势** | 12个月月均线图,支持切换年份 | + +## 触发指令 + +在 ZTools 中输入以下命令: + +`金价` / `每日金价` / `黄金价格` / `gold` / `实时金价` / `今日金价` / `金条价格` / `回收金价` / `金价走势` + +## 数据源 + +| 数据 | 来源 | 更新频率 | +|------|------|----------| +| 品牌金店/银行/回收价 (CNY) | Tmini API | 5分钟 | +| 实时金价 (USD) | gold-api.com | 5分钟 | +| 历史金价 (USD) | FreeGoldAPI | 24小时 | +| 本地快照累积 | 浏览器本地存储 | 每小时/每天/每月 | + +## 技术栈 + +- React 19 + TypeScript 5.3 +- Vite 6 +- recharts(图表) + +## 快速开始 + +```bash +npm install +npm run dev # 开发模式 http://localhost:5173 +npm run build # 构建产物 → dist/ +``` + +## 项目结构 + +``` +. +├── public/ +│ ├── logo.png # 插件图标 +│ ├── plugin.json # 插件配置 +│ └── preload/ # Preload 脚本 +├── src/ +│ ├── main.tsx +│ ├── App.tsx # 路由入口 +│ ├── env.d.ts # 类型声明 +│ └── GoldPrice/ +│ ├── index.tsx # 主组件(4个Tab) +│ ├── index.css # 全局样式 +│ ├── services/ +│ │ └── goldApi.ts # 数据层(API + 缓存 + 快照累积) +│ └── components/ +│ ├── PriceCard.tsx # 实时价格卡片 +│ ├── FluctuationChart.tsx # 波动图表 +│ └── BrandTable.tsx # 品牌价格表格 +├── index.html +├── vite.config.js +├── tsconfig.json +└── package.json +``` + +## License + +MIT diff --git a/plugins/gold-price-check/index.html b/plugins/gold-price-check/index.html new file mode 100644 index 00000000..84b7eb68 --- /dev/null +++ b/plugins/gold-price-check/index.html @@ -0,0 +1,11 @@ + + + + + + + +
+ + + diff --git a/plugins/gold-price-check/package-lock.json b/plugins/gold-price-check/package-lock.json new file mode 100644 index 00000000..7a67acb1 --- /dev/null +++ b/plugins/gold-price-check/package-lock.json @@ -0,0 +1,2228 @@ +{ + "name": "gold-price-check", + "version": "1.0.0", + "lockfileVersion": 3, + "requires": true, + "packages": { + "": { + "name": "gold-price-check", + "version": "1.0.0", + "dependencies": { + "react": "^19.0.0", + "react-dom": "^19.0.0", + "recharts": "^3.9.1" + }, + "devDependencies": { + "@types/react": "^19.0.8", + "@types/react-dom": "^19.0.3", + "@vitejs/plugin-react": "^4.3.1", + "@ztools-center/ztools-api-types": "^1.0.1", + "typescript": "^5.3.0", + "vite": "^6.0.11" + } + }, + "node_modules/@babel/code-frame": { + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.29.7.tgz", + "integrity": "sha512-Aup7aUOfpbAUg2ROOJN6Iw5f9DMBlzu0mIkm/malLQFN/YQgO48wCj0Kxa3sEHJvPVFg7siR+qRInwXd2qhQKw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-validator-identifier": "^7.29.7", + "js-tokens": "^4.0.0", + "picocolors": "^1.1.1" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/compat-data": { + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.29.7.tgz", + "integrity": "sha512-locTkQyKvwIEgBzVrn8693ebc97F2U8ZHjbXwDXJ5Fn2TCpNwTlKcaKLkdHop5c/icOFE7qt7Q9JC5hnKNa6Gg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/core": { + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.29.7.tgz", + "integrity": "sha512-RgHBCvtjbOK2gXSNBNIkNoEc9qoVEtau3hj8gEqKQuL3HZAibKarWFEI3Lfm6EYKkLalOh8eSrj9b+ch9H/VBA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/code-frame": "^7.29.7", + "@babel/generator": "^7.29.7", + "@babel/helper-compilation-targets": "^7.29.7", + "@babel/helper-module-transforms": "^7.29.7", + "@babel/helpers": "^7.29.7", + "@babel/parser": "^7.29.7", + "@babel/template": "^7.29.7", + "@babel/traverse": "^7.29.7", + "@babel/types": "^7.29.7", + "@jridgewell/remapping": "^2.3.5", + "convert-source-map": "^2.0.0", + "debug": "^4.1.0", + "gensync": "^1.0.0-beta.2", + "json5": "^2.2.3", + "semver": "^6.3.1" + }, + "engines": { + "node": ">=6.9.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/babel" + } + }, + "node_modules/@babel/generator": { + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.29.7.tgz", + "integrity": "sha512-DkXD5OJQaAQIdZ1bt3UZdEnHAn9Imd3IVBdX03UFe+ony9Ojw5pzr9YVKGDY1jt+Gcn/FnGkNf8r+Vj5NOJWtQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/parser": "^7.29.7", + "@babel/types": "^7.29.7", + "@jridgewell/gen-mapping": "^0.3.12", + "@jridgewell/trace-mapping": "^0.3.28", + "jsesc": "^3.0.2" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-compilation-targets": { + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/helper-compilation-targets/-/helper-compilation-targets-7.29.7.tgz", + "integrity": "sha512-wem6WaBj4NaVYVdNhLPPVacES6ZJ+KBBfSkTMD3YZxbP3rm3Di85tJU5ljaUNhaOynt+Aj0xruhYuzQBt8n71g==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/compat-data": "^7.29.7", + "@babel/helper-validator-option": "^7.29.7", + "browserslist": "^4.24.0", + "lru-cache": "^5.1.1", + "semver": "^6.3.1" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-globals": { + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/helper-globals/-/helper-globals-7.29.7.tgz", + "integrity": "sha512-3nQVUAtvkKH9zahfWgw96Jc/uFOmjACE1kQz82E2lqWmHBgjzbNlsC22nuQTfahmWeQtTq5nQ/4Nnd2A1wj4zA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-module-imports": { + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.29.7.tgz", + "integrity": "sha512-ejHwrQQYcm9xnTivShn2IDOlIzInN34AXskvq9QicvCtEzq1Vzclu/tKF8Jq1Cg8JG2GL6/EmjgsCT7lXepE3g==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/traverse": "^7.29.7", + "@babel/types": "^7.29.7" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-module-transforms": { + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.29.7.tgz", + "integrity": "sha512-UPUVSyXbOh627KiCIGQSgwWzGeBKLkaJ9PJEdrngIwMSzxLR4jS4+f1f1jb7VzBbg8nFLaYotvVPFCTqdrmTAg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-module-imports": "^7.29.7", + "@babel/helper-validator-identifier": "^7.29.7", + "@babel/traverse": "^7.29.7" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0" + } + }, + "node_modules/@babel/helper-plugin-utils": { + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.29.7.tgz", + "integrity": "sha512-G7sHYigPY17oO5SYWnfD/0MTBwVR781S/JI643e/JhUYgVgWE/61SoW3NH9KWUKyKq5LVh3npif99Wkt6j86Jw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-string-parser": { + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-7.29.7.tgz", + "integrity": "sha512-Pb5ijPrZ89GDH8223L4UP8i6QApWxs04RbPQJTeWDV0/keR2E36MeKnyr6LYmUUvqRRI+Iv87SuF1W6ErINzYw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-validator-identifier": { + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.29.7.tgz", + "integrity": "sha512-qehxGkRj55h/ff8EMaJ+cYhyaKlHIxqYDn682wQD7RNp9UujOQsHog2uS0r2vzr4pW+sXf90NeeayjcNaX3fFg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-validator-option": { + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-option/-/helper-validator-option-7.29.7.tgz", + "integrity": "sha512-N9ZErrD+yW5geCDtBqnOoxmR8+tNKiGuxKlDpuJxfsqpa2dFcexaziGAE/qoHLiDDreVNMupxGmSoNlyvsA3gw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helpers": { + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.29.7.tgz", + "integrity": "sha512-1k2lAGRMfHTcwuNYcCNUmaUffmQv8KWMfh2iJUUeRlwlwH4FdNG7mfPI10NPfLHJFThE4Tyr4mv7kTNZOiPuBg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/template": "^7.29.7", + "@babel/types": "^7.29.7" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/parser": { + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.29.7.tgz", + "integrity": "sha512-hnORnjP/1P/zFEndoeX+n+t1RwWRJiJpM/jO7FW32Kn9r5+sJB2JWOdYo4L6k78j15eCwY3Gm/7364B1EMwtNg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/types": "^7.29.7" + }, + "bin": { + "parser": "bin/babel-parser.js" + }, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@babel/plugin-transform-react-jsx-self": { + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-react-jsx-self/-/plugin-transform-react-jsx-self-7.29.7.tgz", + "integrity": "sha512-TL0hMc9xzy86VD31nUiwzd5otRAcyEPcsegCxolO0PvcXuH1v0kECe/UIznYFihpkvU5wg/jk4v0TTEFfm53fw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.29.7" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-react-jsx-source": { + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-react-jsx-source/-/plugin-transform-react-jsx-source-7.29.7.tgz", + "integrity": "sha512-06IyK09H3wi4cGbhDBwp5gUGo0IKtnYa8tyTiephirPCK6fbobVGiXMMI5zLQ4aKEYP3wZ3ArU44o+8KMrSG/Q==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.29.7" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/template": { + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.29.7.tgz", + "integrity": "sha512-puq+Gf35oI24FeN11LkoUQFqv9uwNeWpxXZi/Ji3rRIoKAzKnxRaZ+Gkj0vKS9ZCiTESfng1N9LyOyXvo+m+Gg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/code-frame": "^7.29.7", + "@babel/parser": "^7.29.7", + "@babel/types": "^7.29.7" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/traverse": { + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.29.7.tgz", + "integrity": "sha512-EhlfNQtZ+NK22w5BM61ciuiq1m58ed33Wr1Xan//ZRTy6hgjnwyCffRYwzsGXdASJSUJ1guZILsErh1eQcl+zw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/code-frame": "^7.29.7", + "@babel/generator": "^7.29.7", + "@babel/helper-globals": "^7.29.7", + "@babel/parser": "^7.29.7", + "@babel/template": "^7.29.7", + "@babel/types": "^7.29.7", + "debug": "^4.3.1" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/types": { + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.29.7.tgz", + "integrity": "sha512-4zBIxpPzowiZpusoFkyGVwakdRJUyuH5PxQ/PrqghfdFWWasvnCdPfQXHrenDai+gyLARulZjZowCOj6fjT4pA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-string-parser": "^7.29.7", + "@babel/helper-validator-identifier": "^7.29.7" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@esbuild/aix-ppc64": { + "version": "0.25.12", + "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.25.12.tgz", + "integrity": "sha512-Hhmwd6CInZ3dwpuGTF8fJG6yoWmsToE+vYgD4nytZVxcu1ulHpUQRAB1UJ8+N1Am3Mz4+xOByoQoSZf4D+CpkA==", + "cpu": [ + "ppc64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "aix" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/android-arm": { + "version": "0.25.12", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.25.12.tgz", + "integrity": "sha512-VJ+sKvNA/GE7Ccacc9Cha7bpS8nyzVv0jdVgwNDaR4gDMC/2TTRc33Ip8qrNYUcpkOHUT5OZ0bUcNNVZQ9RLlg==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/android-arm64": { + "version": "0.25.12", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.25.12.tgz", + "integrity": "sha512-6AAmLG7zwD1Z159jCKPvAxZd4y/VTO0VkprYy+3N2FtJ8+BQWFXU+OxARIwA46c5tdD9SsKGZ/1ocqBS/gAKHg==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/android-x64": { + "version": "0.25.12", + "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.25.12.tgz", + "integrity": "sha512-5jbb+2hhDHx5phYR2By8GTWEzn6I9UqR11Kwf22iKbNpYrsmRB18aX/9ivc5cabcUiAT/wM+YIZ6SG9QO6a8kg==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/darwin-arm64": { + "version": "0.25.12", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.25.12.tgz", + "integrity": "sha512-N3zl+lxHCifgIlcMUP5016ESkeQjLj/959RxxNYIthIg+CQHInujFuXeWbWMgnTo4cp5XVHqFPmpyu9J65C1Yg==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/darwin-x64": { + "version": "0.25.12", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.25.12.tgz", + "integrity": "sha512-HQ9ka4Kx21qHXwtlTUVbKJOAnmG1ipXhdWTmNXiPzPfWKpXqASVcWdnf2bnL73wgjNrFXAa3yYvBSd9pzfEIpA==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/freebsd-arm64": { + "version": "0.25.12", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.25.12.tgz", + "integrity": "sha512-gA0Bx759+7Jve03K1S0vkOu5Lg/85dou3EseOGUes8flVOGxbhDDh/iZaoek11Y8mtyKPGF3vP8XhnkDEAmzeg==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/freebsd-x64": { + "version": "0.25.12", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.25.12.tgz", + "integrity": "sha512-TGbO26Yw2xsHzxtbVFGEXBFH0FRAP7gtcPE7P5yP7wGy7cXK2oO7RyOhL5NLiqTlBh47XhmIUXuGciXEqYFfBQ==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-arm": { + "version": "0.25.12", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.25.12.tgz", + "integrity": "sha512-lPDGyC1JPDou8kGcywY0YILzWlhhnRjdof3UlcoqYmS9El818LLfJJc3PXXgZHrHCAKs/Z2SeZtDJr5MrkxtOw==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-arm64": { + "version": "0.25.12", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.25.12.tgz", + "integrity": "sha512-8bwX7a8FghIgrupcxb4aUmYDLp8pX06rGh5HqDT7bB+8Rdells6mHvrFHHW2JAOPZUbnjUpKTLg6ECyzvas2AQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-ia32": { + "version": "0.25.12", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.25.12.tgz", + "integrity": "sha512-0y9KrdVnbMM2/vG8KfU0byhUN+EFCny9+8g202gYqSSVMonbsCfLjUO+rCci7pM0WBEtz+oK/PIwHkzxkyharA==", + "cpu": [ + "ia32" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-loong64": { + "version": "0.25.12", + "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.25.12.tgz", + "integrity": "sha512-h///Lr5a9rib/v1GGqXVGzjL4TMvVTv+s1DPoxQdz7l/AYv6LDSxdIwzxkrPW438oUXiDtwM10o9PmwS/6Z0Ng==", + "cpu": [ + "loong64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-mips64el": { + "version": "0.25.12", + "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.25.12.tgz", + "integrity": "sha512-iyRrM1Pzy9GFMDLsXn1iHUm18nhKnNMWscjmp4+hpafcZjrr2WbT//d20xaGljXDBYHqRcl8HnxbX6uaA/eGVw==", + "cpu": [ + "mips64el" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-ppc64": { + "version": "0.25.12", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.25.12.tgz", + "integrity": "sha512-9meM/lRXxMi5PSUqEXRCtVjEZBGwB7P/D4yT8UG/mwIdze2aV4Vo6U5gD3+RsoHXKkHCfSxZKzmDssVlRj1QQA==", + "cpu": [ + "ppc64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-riscv64": { + "version": "0.25.12", + "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.25.12.tgz", + "integrity": "sha512-Zr7KR4hgKUpWAwb1f3o5ygT04MzqVrGEGXGLnj15YQDJErYu/BGg+wmFlIDOdJp0PmB0lLvxFIOXZgFRrdjR0w==", + "cpu": [ + "riscv64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-s390x": { + "version": "0.25.12", + "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.25.12.tgz", + "integrity": "sha512-MsKncOcgTNvdtiISc/jZs/Zf8d0cl/t3gYWX8J9ubBnVOwlk65UIEEvgBORTiljloIWnBzLs4qhzPkJcitIzIg==", + "cpu": [ + "s390x" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-x64": { + "version": "0.25.12", + "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.25.12.tgz", + "integrity": "sha512-uqZMTLr/zR/ed4jIGnwSLkaHmPjOjJvnm6TVVitAa08SLS9Z0VM8wIRx7gWbJB5/J54YuIMInDquWyYvQLZkgw==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/netbsd-arm64": { + "version": "0.25.12", + "resolved": "https://registry.npmjs.org/@esbuild/netbsd-arm64/-/netbsd-arm64-0.25.12.tgz", + "integrity": "sha512-xXwcTq4GhRM7J9A8Gv5boanHhRa/Q9KLVmcyXHCTaM4wKfIpWkdXiMog/KsnxzJ0A1+nD+zoecuzqPmCRyBGjg==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "netbsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/netbsd-x64": { + "version": "0.25.12", + "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.25.12.tgz", + "integrity": "sha512-Ld5pTlzPy3YwGec4OuHh1aCVCRvOXdH8DgRjfDy/oumVovmuSzWfnSJg+VtakB9Cm0gxNO9BzWkj6mtO1FMXkQ==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "netbsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/openbsd-arm64": { + "version": "0.25.12", + "resolved": "https://registry.npmjs.org/@esbuild/openbsd-arm64/-/openbsd-arm64-0.25.12.tgz", + "integrity": "sha512-fF96T6KsBo/pkQI950FARU9apGNTSlZGsv1jZBAlcLL1MLjLNIWPBkj5NlSz8aAzYKg+eNqknrUJ24QBybeR5A==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "openbsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/openbsd-x64": { + "version": "0.25.12", + "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.25.12.tgz", + "integrity": "sha512-MZyXUkZHjQxUvzK7rN8DJ3SRmrVrke8ZyRusHlP+kuwqTcfWLyqMOE3sScPPyeIXN/mDJIfGXvcMqCgYKekoQw==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "openbsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/openharmony-arm64": { + "version": "0.25.12", + "resolved": "https://registry.npmjs.org/@esbuild/openharmony-arm64/-/openharmony-arm64-0.25.12.tgz", + "integrity": "sha512-rm0YWsqUSRrjncSXGA7Zv78Nbnw4XL6/dzr20cyrQf7ZmRcsovpcRBdhD43Nuk3y7XIoW2OxMVvwuRvk9XdASg==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "openharmony" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/sunos-x64": { + "version": "0.25.12", + "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.25.12.tgz", + "integrity": "sha512-3wGSCDyuTHQUzt0nV7bocDy72r2lI33QL3gkDNGkod22EsYl04sMf0qLb8luNKTOmgF/eDEDP5BFNwoBKH441w==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "sunos" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/win32-arm64": { + "version": "0.25.12", + "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.25.12.tgz", + "integrity": "sha512-rMmLrur64A7+DKlnSuwqUdRKyd3UE7oPJZmnljqEptesKM8wx9J8gx5u0+9Pq0fQQW8vqeKebwNXdfOyP+8Bsg==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/win32-ia32": { + "version": "0.25.12", + "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.25.12.tgz", + "integrity": "sha512-HkqnmmBoCbCwxUKKNPBixiWDGCpQGVsrQfJoVGYLPT41XWF8lHuE5N6WhVia2n4o5QK5M4tYr21827fNhi4byQ==", + "cpu": [ + "ia32" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/win32-x64": { + "version": "0.25.12", + "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.25.12.tgz", + "integrity": "sha512-alJC0uCZpTFrSL0CCDjcgleBXPnCrEAhTBILpeAp7M/OFgoqtAetfBzX0xM00MUsVVPpVjlPuMbREqnZCXaTnA==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@jridgewell/gen-mapping": { + "version": "0.3.13", + "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.13.tgz", + "integrity": "sha512-2kkt/7niJ6MgEPxF0bYdQ6etZaA+fQvDcLKckhy1yIQOzaoKjBBjSj63/aLVjYE3qhRt5dvM+uUyfCg6UKCBbA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jridgewell/sourcemap-codec": "^1.5.0", + "@jridgewell/trace-mapping": "^0.3.24" + } + }, + "node_modules/@jridgewell/remapping": { + "version": "2.3.5", + "resolved": "https://registry.npmjs.org/@jridgewell/remapping/-/remapping-2.3.5.tgz", + "integrity": "sha512-LI9u/+laYG4Ds1TDKSJW2YPrIlcVYOwi2fUC6xB43lueCjgxV4lffOCZCtYFiH6TNOX+tQKXx97T4IKHbhyHEQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jridgewell/gen-mapping": "^0.3.5", + "@jridgewell/trace-mapping": "^0.3.24" + } + }, + "node_modules/@jridgewell/resolve-uri": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.2.tgz", + "integrity": "sha512-bRISgCIjP20/tbWSPWMEi54QVPRZExkuD9lJL+UIxUKtwVJA8wW1Trb1jMs1RFXo1CBTNZ/5hpC9QvmKWdopKw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@jridgewell/sourcemap-codec": { + "version": "1.5.5", + "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.5.5.tgz", + "integrity": "sha512-cYQ9310grqxueWbl+WuIUIaiUaDcj7WOq5fVhEljNVgRfOUhY9fy2zTvfoqWsnebh8Sl70VScFbICvJnLKB0Og==", + "dev": true, + "license": "MIT" + }, + "node_modules/@jridgewell/trace-mapping": { + "version": "0.3.31", + "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.31.tgz", + "integrity": "sha512-zzNR+SdQSDJzc8joaeP8QQoCQr8NuYx2dIIytl1QeBEZHJ9uW6hebsrYgbz8hJwUQao3TWCMtmfV8Nu1twOLAw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jridgewell/resolve-uri": "^3.1.0", + "@jridgewell/sourcemap-codec": "^1.4.14" + } + }, + "node_modules/@reduxjs/toolkit": { + "version": "2.12.0", + "resolved": "https://registry.npmjs.org/@reduxjs/toolkit/-/toolkit-2.12.0.tgz", + "integrity": "sha512-KiT+RzZbp6mQET+Mg+h2c97+9j1sNflUxQkIHI7Yuzf6Peu+OYpmkn6nbHWmLLWj+1ZODUJFwGZ7gx3L9R9EOw==", + "license": "MIT", + "dependencies": { + "@standard-schema/spec": "^1.0.0", + "@standard-schema/utils": "^0.3.0", + "immer": "^11.0.0", + "redux": "^5.0.1", + "redux-thunk": "^3.1.0", + "reselect": "^5.1.0" + }, + "peerDependencies": { + "react": "^16.9.0 || ^17.0.0 || ^18 || ^19", + "react-redux": "^7.2.1 || ^8.1.3 || ^9.0.0" + }, + "peerDependenciesMeta": { + "react": { + "optional": true + }, + "react-redux": { + "optional": true + } + } + }, + "node_modules/@rolldown/pluginutils": { + "version": "1.0.0-beta.27", + "resolved": "https://registry.npmjs.org/@rolldown/pluginutils/-/pluginutils-1.0.0-beta.27.tgz", + "integrity": "sha512-+d0F4MKMCbeVUJwG96uQ4SgAznZNSq93I3V+9NHA4OpvqG8mRCpGdKmK8l/dl02h2CCDHwW2FqilnTyDcAnqjA==", + "dev": true, + "license": "MIT" + }, + "node_modules/@rollup/rollup-android-arm-eabi": { + "version": "4.62.2", + "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.62.2.tgz", + "integrity": "sha512-6o7ZLZK+BeenkZCFNDXqpbjw9bD6nuWonvS/lwQJp7NoVVxm6p3qE7qQ5jGuBjiFsgvqjD8mZAU5oWxTmbOeOg==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ] + }, + "node_modules/@rollup/rollup-android-arm64": { + "version": "4.62.2", + "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm64/-/rollup-android-arm64-4.62.2.tgz", + "integrity": "sha512-BaH7BllCACHoH1LguOU56UItGfUWjujlO65kS9LAodViaN4bwIKd7oeW/ZHJ/4ljr/7MIiENnNy3HJ0zXv8Zkw==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ] + }, + "node_modules/@rollup/rollup-darwin-arm64": { + "version": "4.62.2", + "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-arm64/-/rollup-darwin-arm64-4.62.2.tgz", + "integrity": "sha512-v39RCCvj4He82I9sFmk+M1VZ0PLM9sfsLVikjfx2hYBNALhrrOR2D3JjQA6AhlaSOgcR+RzrKY7e1+bT6SUO/A==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ] + }, + "node_modules/@rollup/rollup-darwin-x64": { + "version": "4.62.2", + "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-x64/-/rollup-darwin-x64-4.62.2.tgz", + "integrity": "sha512-yl0y2vq3S3lHeuXhEdss6TWfKW8vkujImO12tn4ZkG/4oghr09LvdYm2RElVjokTQiUvDUGXLGsYeLqUMCKpGA==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ] + }, + "node_modules/@rollup/rollup-freebsd-arm64": { + "version": "4.62.2", + "resolved": "https://registry.npmjs.org/@rollup/rollup-freebsd-arm64/-/rollup-freebsd-arm64-4.62.2.tgz", + "integrity": "sha512-tT4pvt4qXD+vEoezupCWi+a1F0vvDiksiHc+PxRlYTOH1I6/X4id9jPxTP+Fg+545euaFT1jJVs4CEdHZAU1vw==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "freebsd" + ] + }, + "node_modules/@rollup/rollup-freebsd-x64": { + "version": "4.62.2", + "resolved": "https://registry.npmjs.org/@rollup/rollup-freebsd-x64/-/rollup-freebsd-x64-4.62.2.tgz", + "integrity": "sha512-6nU5F2wCW+qvCBhTn1pdIU3bzsIoF7EUwsCDRxilWGprQR6yd508YnH9+OKFCwpfS8pjZqDUmnCAr7exax0XCg==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "freebsd" + ] + }, + "node_modules/@rollup/rollup-linux-arm-gnueabihf": { + "version": "4.62.2", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-gnueabihf/-/rollup-linux-arm-gnueabihf-4.62.2.tgz", + "integrity": "sha512-n1GJHPOvpIfhi3TmrCeh6S6URt9BFCt0KQE3qvexyGCTAKpR4Lg+eWvNZEqu7epxwus/8ElT3hacYEucm49SZg==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-arm-musleabihf": { + "version": "4.62.2", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-musleabihf/-/rollup-linux-arm-musleabihf-4.62.2.tgz", + "integrity": "sha512-JqgflS8wEB+UXV/vS1RpRbifGBeN4D5lz8D8oOFbFZw4vedvdOgCFAjfBmIMdW3yL10XpQQ0Ambepw6MXrhOnA==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-arm64-gnu": { + "version": "4.62.2", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-gnu/-/rollup-linux-arm64-gnu-4.62.2.tgz", + "integrity": "sha512-wnFJkogWvN4jm/hQRF2UBaeUmk20j5+DmHvoyWii2b8HJDyvz1MF2OU/6ynXt2KR63rbZLWkFpoytpdc/yBuSA==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-arm64-musl": { + "version": "4.62.2", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-musl/-/rollup-linux-arm64-musl-4.62.2.tgz", + "integrity": "sha512-HVu2bp0zhvJ8xHEV9+UUs7S90VadmBSY3LcIMvozbPo4AuMGDWlz3ymHLHZPX4hR67TKTt8Qp5PJ5RBg/i+RMQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-loong64-gnu": { + "version": "4.62.2", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-loong64-gnu/-/rollup-linux-loong64-gnu-4.62.2.tgz", + "integrity": "sha512-mQqqAV8QaoSgr9I2fKDLY2BAVvmKjWoGiu/cSYQonsLvtqwEn1E4QYfnCOcp5zoEqNhsDYin1s6jx/VJmrxlZg==", + "cpu": [ + "loong64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-loong64-musl": { + "version": "4.62.2", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-loong64-musl/-/rollup-linux-loong64-musl-4.62.2.tgz", + "integrity": "sha512-IxKLoxCQ2IWi6bT2akyDUBGsOImDKB+sPp4EsTmwFQ/fMwpCKm8uLSSgP/Kx/QYUgKis6SEZ5/Nlhup0DIA0PQ==", + "cpu": [ + "loong64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-ppc64-gnu": { + "version": "4.62.2", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-ppc64-gnu/-/rollup-linux-ppc64-gnu-4.62.2.tgz", + "integrity": "sha512-Mk5ha2RQSgyFfmYYLkBpPnUk8D8FriBxesO1u9O75X0mHgXL1UQcH5Itl2lurWL2tj0RxV9b9tJgipac0hRY9A==", + "cpu": [ + "ppc64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-ppc64-musl": { + "version": "4.62.2", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-ppc64-musl/-/rollup-linux-ppc64-musl-4.62.2.tgz", + "integrity": "sha512-CjvEnqJL/0/TQ3TXX3OPIJ/kmBellrWd4heXUmHeJlTnmwjKpSJzoehLaL6Xk0ZnMHBu9dZuFADNOrtjF4v+2w==", + "cpu": [ + "ppc64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-riscv64-gnu": { + "version": "4.62.2", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-gnu/-/rollup-linux-riscv64-gnu-4.62.2.tgz", + "integrity": "sha512-1SiZbzwdkaDURsew/tSOrooKiYy7EQGT6m8ufavAi9NEyQb/6VuIxFXAL1fqa4iZe3g4NbNk4P7J32z2tw5Mgg==", + "cpu": [ + "riscv64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-riscv64-musl": { + "version": "4.62.2", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-musl/-/rollup-linux-riscv64-musl-4.62.2.tgz", + "integrity": "sha512-nQts12zJ3NQRoE6uYljOH89v7szzLDvG2JD/vsX+vGXU8w/At1GowTZ5/7qeFQ8m7L55rpR8Okugnuo5bgjy2Q==", + "cpu": [ + "riscv64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-s390x-gnu": { + "version": "4.62.2", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-s390x-gnu/-/rollup-linux-s390x-gnu-4.62.2.tgz", + "integrity": "sha512-E9/ll019jhPIJgpzfZoIkBGhcz+kKNgVWYRY0zr9srBdPPFVpvOKW8VaJKUbeK+eZXyQF9ltME+Kk6affeaPgg==", + "cpu": [ + "s390x" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-x64-gnu": { + "version": "4.62.2", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.62.2.tgz", + "integrity": "sha512-5BqxR/pshjey51iliyzTD5Xi3EN0aLmQ2lZ3lvefVV9c82BvrLo2/6OT55iifpWBufs6kdwWbuOKS841DrmK9A==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-x64-musl": { + "version": "4.62.2", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-musl/-/rollup-linux-x64-musl-4.62.2.tgz", + "integrity": "sha512-uNN83XxQrRAh/w0/pmAfibcwyb6YWt4gP+dpnQKPVJshAloQ785ii8CT8ZCIxkGg9opVsvAlGhFitSm6D1Jjpg==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-openbsd-x64": { + "version": "4.62.2", + "resolved": "https://registry.npmjs.org/@rollup/rollup-openbsd-x64/-/rollup-openbsd-x64-4.62.2.tgz", + "integrity": "sha512-srjEIxSH3LRnJN6THczDHWQplqEMFiAJrTab0msUryh9kwNpkICf3Ea6q6MN/2cZwRFUNx5w+h6Hpi4QuHS6Zg==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "openbsd" + ] + }, + "node_modules/@rollup/rollup-openharmony-arm64": { + "version": "4.62.2", + "resolved": "https://registry.npmjs.org/@rollup/rollup-openharmony-arm64/-/rollup-openharmony-arm64-4.62.2.tgz", + "integrity": "sha512-8hOJnxgbyObnCm5AlRA3A931xX19xq80RjVTKgJOvEKWqJruP/Uf12IbAOaDjjEXYRewwHLfmF0YRIdK3OwKWA==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "openharmony" + ] + }, + "node_modules/@rollup/rollup-win32-arm64-msvc": { + "version": "4.62.2", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-arm64-msvc/-/rollup-win32-arm64-msvc-4.62.2.tgz", + "integrity": "sha512-mmF4AY1i0hG/bLWUctUq59gtmgaSIRa3cu/A3JFRp/sCNEme2bgDEiDS22P9FbnJB8NJNF4jPJiSP5RHQpUTDg==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ] + }, + "node_modules/@rollup/rollup-win32-ia32-msvc": { + "version": "4.62.2", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-ia32-msvc/-/rollup-win32-ia32-msvc-4.62.2.tgz", + "integrity": "sha512-DZgkknc6jhHrk46V25vbAM0zZkyP0nSDkJB8/dRkLTxv470dOmWDqGoEJl/9A0dFfS7yE3REOwNDxpHwSLSt0Q==", + "cpu": [ + "ia32" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ] + }, + "node_modules/@rollup/rollup-win32-x64-gnu": { + "version": "4.62.2", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-gnu/-/rollup-win32-x64-gnu-4.62.2.tgz", + "integrity": "sha512-T6xr6ucWSFto+VGajA8YH26LdpHRuP4YLHEKAtCWvJDOlnmWcDZVCI2Jmjr+IFHDlt2zRaTAKE4tfjTaWLgJBg==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ] + }, + "node_modules/@rollup/rollup-win32-x64-msvc": { + "version": "4.62.2", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-msvc/-/rollup-win32-x64-msvc-4.62.2.tgz", + "integrity": "sha512-BfzEnDJOt9T8M989/lA37EcJgat01wLRnoi5dQf3QzOH7jzpqTAzdDbVfRljVr5r+jzKqpbHeyOfAaXxAd0PAA==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ] + }, + "node_modules/@standard-schema/spec": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@standard-schema/spec/-/spec-1.1.0.tgz", + "integrity": "sha512-l2aFy5jALhniG5HgqrD6jXLi/rUWrKvqN/qJx6yoJsgKhblVd+iqqU4RCXavm/jPityDo5TCvKMnpjKnOriy0w==", + "license": "MIT" + }, + "node_modules/@standard-schema/utils": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/@standard-schema/utils/-/utils-0.3.0.tgz", + "integrity": "sha512-e7Mew686owMaPJVNNLs55PUvgz371nKgwsc4vxE49zsODpJEnxgxRo2y/OKrqueavXgZNMDVj3DdHFlaSAeU8g==", + "license": "MIT" + }, + "node_modules/@types/babel__core": { + "version": "7.20.5", + "resolved": "https://registry.npmjs.org/@types/babel__core/-/babel__core-7.20.5.tgz", + "integrity": "sha512-qoQprZvz5wQFJwMDqeseRXWv3rqMvhgpbXFfVyWhbx9X47POIA6i/+dXefEmZKoAgOaTdaIgNSMqMIU61yRyzA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/parser": "^7.20.7", + "@babel/types": "^7.20.7", + "@types/babel__generator": "*", + "@types/babel__template": "*", + "@types/babel__traverse": "*" + } + }, + "node_modules/@types/babel__generator": { + "version": "7.27.0", + "resolved": "https://registry.npmjs.org/@types/babel__generator/-/babel__generator-7.27.0.tgz", + "integrity": "sha512-ufFd2Xi92OAVPYsy+P4n7/U7e68fex0+Ee8gSG9KX7eo084CWiQ4sdxktvdl0bOPupXtVJPY19zk6EwWqUQ8lg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/types": "^7.0.0" + } + }, + "node_modules/@types/babel__template": { + "version": "7.4.4", + "resolved": "https://registry.npmjs.org/@types/babel__template/-/babel__template-7.4.4.tgz", + "integrity": "sha512-h/NUaSyG5EyxBIp8YRxo4RMe2/qQgvyowRwVMzhYhBCONbW8PUsg4lkFMrhgZhUe5z3L3MiLDuvyJ/CaPa2A8A==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/parser": "^7.1.0", + "@babel/types": "^7.0.0" + } + }, + "node_modules/@types/babel__traverse": { + "version": "7.28.0", + "resolved": "https://registry.npmjs.org/@types/babel__traverse/-/babel__traverse-7.28.0.tgz", + "integrity": "sha512-8PvcXf70gTDZBgt9ptxJ8elBeBjcLOAcOtoO/mPJjtji1+CdGbHgm77om1GrsPxsiE+uXIpNSK64UYaIwQXd4Q==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/types": "^7.28.2" + } + }, + "node_modules/@types/d3-array": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/@types/d3-array/-/d3-array-3.2.2.tgz", + "integrity": "sha512-hOLWVbm7uRza0BYXpIIW5pxfrKe0W+D5lrFiAEYR+pb6w3N2SwSMaJbXdUfSEv+dT4MfHBLtn5js0LAWaO6otw==", + "license": "MIT" + }, + "node_modules/@types/d3-color": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/@types/d3-color/-/d3-color-3.1.3.tgz", + "integrity": "sha512-iO90scth9WAbmgv7ogoq57O9YpKmFBbmoEoCHDB2xMBY0+/KVrqAaCDyCE16dUspeOvIxFFRI+0sEtqDqy2b4A==", + "license": "MIT" + }, + "node_modules/@types/d3-ease": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/@types/d3-ease/-/d3-ease-3.0.2.tgz", + "integrity": "sha512-NcV1JjO5oDzoK26oMzbILE6HW7uVXOHLQvHshBUW4UMdZGfiY6v5BeQwh9a9tCzv+CeefZQHJt5SRgK154RtiA==", + "license": "MIT" + }, + "node_modules/@types/d3-interpolate": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/@types/d3-interpolate/-/d3-interpolate-3.0.4.tgz", + "integrity": "sha512-mgLPETlrpVV1YRJIglr4Ez47g7Yxjl1lj7YKsiMCb27VJH9W8NVM6Bb9d8kkpG/uAQS5AmbA48q2IAolKKo1MA==", + "license": "MIT", + "dependencies": { + "@types/d3-color": "*" + } + }, + "node_modules/@types/d3-path": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/@types/d3-path/-/d3-path-3.1.1.tgz", + "integrity": "sha512-VMZBYyQvbGmWyWVea0EHs/BwLgxc+MKi1zLDCONksozI4YJMcTt8ZEuIR4Sb1MMTE8MMW49v0IwI5+b7RmfWlg==", + "license": "MIT" + }, + "node_modules/@types/d3-scale": { + "version": "4.0.9", + "resolved": "https://registry.npmjs.org/@types/d3-scale/-/d3-scale-4.0.9.tgz", + "integrity": "sha512-dLmtwB8zkAeO/juAMfnV+sItKjlsw2lKdZVVy6LRr0cBmegxSABiLEpGVmSJJ8O08i4+sGR6qQtb6WtuwJdvVw==", + "license": "MIT", + "dependencies": { + "@types/d3-time": "*" + } + }, + "node_modules/@types/d3-shape": { + "version": "3.1.8", + "resolved": "https://registry.npmjs.org/@types/d3-shape/-/d3-shape-3.1.8.tgz", + "integrity": "sha512-lae0iWfcDeR7qt7rA88BNiqdvPS5pFVPpo5OfjElwNaT2yyekbM0C9vK+yqBqEmHr6lDkRnYNoTBYlAgJa7a4w==", + "license": "MIT", + "dependencies": { + "@types/d3-path": "*" + } + }, + "node_modules/@types/d3-time": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/@types/d3-time/-/d3-time-3.0.4.tgz", + "integrity": "sha512-yuzZug1nkAAaBlBBikKZTgzCeA+k1uy4ZFwWANOfKw5z5LRhV0gNA7gNkKm7HoK+HRN0wX3EkxGk0fpbWhmB7g==", + "license": "MIT" + }, + "node_modules/@types/d3-timer": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/@types/d3-timer/-/d3-timer-3.0.2.tgz", + "integrity": "sha512-Ps3T8E8dZDam6fUyNiMkekK3XUsaUEik+idO9/YjPtfj2qruF8tFBXS7XhtE4iIXBLxhmLjP3SXpLhVf21I9Lw==", + "license": "MIT" + }, + "node_modules/@types/estree": { + "version": "1.0.9", + "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.9.tgz", + "integrity": "sha512-GhdPgy1el4/ImP05X05Uw4cw2/M93BCUmnEvWZNStlCzEKME4Fkk+YpoA5OiHNQmoS7Cafb8Xa3Pya8m1Qrzeg==", + "dev": true, + "license": "MIT" + }, + "node_modules/@types/react": { + "version": "19.2.17", + "resolved": "https://registry.npmjs.org/@types/react/-/react-19.2.17.tgz", + "integrity": "sha512-MXfmqaVPEVgkBT/aY0aGCkRWWtByiYQXo3xdQ8r5RzuFrPiRn8Gar2tQdXSUQ2GKV3bkXckek89V8wQBY2Q/Aw==", + "devOptional": true, + "license": "MIT", + "dependencies": { + "csstype": "^3.2.2" + } + }, + "node_modules/@types/react-dom": { + "version": "19.2.3", + "resolved": "https://registry.npmjs.org/@types/react-dom/-/react-dom-19.2.3.tgz", + "integrity": "sha512-jp2L/eY6fn+KgVVQAOqYItbF0VY/YApe5Mz2F0aykSO8gx31bYCZyvSeYxCHKvzHG5eZjc+zyaS5BrBWya2+kQ==", + "dev": true, + "license": "MIT", + "peerDependencies": { + "@types/react": "^19.2.0" + } + }, + "node_modules/@types/use-sync-external-store": { + "version": "0.0.6", + "resolved": "https://registry.npmjs.org/@types/use-sync-external-store/-/use-sync-external-store-0.0.6.tgz", + "integrity": "sha512-zFDAD+tlpf2r4asuHEj0XH6pY6i0g5NeAHPn+15wk3BV6JA69eERFXC1gyGThDkVa1zCyKr5jox1+2LbV/AMLg==", + "license": "MIT" + }, + "node_modules/@vitejs/plugin-react": { + "version": "4.7.0", + "resolved": "https://registry.npmjs.org/@vitejs/plugin-react/-/plugin-react-4.7.0.tgz", + "integrity": "sha512-gUu9hwfWvvEDBBmgtAowQCojwZmJ5mcLn3aufeCsitijs3+f2NsrPtlAWIR6OPiqljl96GVCUbLe0HyqIpVaoA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/core": "^7.28.0", + "@babel/plugin-transform-react-jsx-self": "^7.27.1", + "@babel/plugin-transform-react-jsx-source": "^7.27.1", + "@rolldown/pluginutils": "1.0.0-beta.27", + "@types/babel__core": "^7.20.5", + "react-refresh": "^0.17.0" + }, + "engines": { + "node": "^14.18.0 || >=16.0.0" + }, + "peerDependencies": { + "vite": "^4.2.0 || ^5.0.0 || ^6.0.0 || ^7.0.0" + } + }, + "node_modules/@ztools-center/ztools-api-types": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/@ztools-center/ztools-api-types/-/ztools-api-types-1.0.3.tgz", + "integrity": "sha512-dv1eOAIasAupqKaQL/gESk1i2+RebdM/1gvZhrvH2D/bo3enCUsAGJ8nrHnlCLBSOGB81eC/SU0IH8BNsUlmvA==", + "dev": true, + "license": "MIT" + }, + "node_modules/baseline-browser-mapping": { + "version": "2.10.40", + "resolved": "https://registry.npmjs.org/baseline-browser-mapping/-/baseline-browser-mapping-2.10.40.tgz", + "integrity": "sha512-BSSLZ9/Cjjv7Gtj5B68ZzXcXUg8iOf3fme+FCuh8rC/Go+Kmh8cox7M3A8dolou16s64QjLPOSdngh7GxXvkSw==", + "dev": true, + "license": "Apache-2.0", + "bin": { + "baseline-browser-mapping": "dist/cli.cjs" + }, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/browserslist": { + "version": "4.28.4", + "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.28.4.tgz", + "integrity": "sha512-MTc8i/x9jBQd1iMw2CFGS+rwMa07eYjLR0CCTLDACl9xhxy+nIs3KeML/biicXtk9JrZ6dnnTatmc7ErPXIxqw==", + "dev": true, + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/browserslist" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/browserslist" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "license": "MIT", + "dependencies": { + "baseline-browser-mapping": "^2.10.38", + "caniuse-lite": "^1.0.30001799", + "electron-to-chromium": "^1.5.376", + "node-releases": "^2.0.48", + "update-browserslist-db": "^1.2.3" + }, + "bin": { + "browserslist": "cli.js" + }, + "engines": { + "node": "^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7" + } + }, + "node_modules/caniuse-lite": { + "version": "1.0.30001800", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001800.tgz", + "integrity": "sha512-MMHtuAz9Ys840zAY5F4k6fV5GaivZ9sPk+nz0mY+GYVzRBnYkN0mpqkSR92oWRQ19yQWo4HvBV/FnC16AJX8MA==", + "dev": true, + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/browserslist" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/caniuse-lite" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "license": "CC-BY-4.0" + }, + "node_modules/clsx": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/clsx/-/clsx-2.1.1.tgz", + "integrity": "sha512-eYm0QWBtUrBWZWG0d386OGAw16Z995PiOVo2B7bjWSbHedGl5e0ZWaq65kOGgUSNesEIDkB9ISbTg/JK9dhCZA==", + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/convert-source-map": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-2.0.0.tgz", + "integrity": "sha512-Kvp459HrV2FEJ1CAsi1Ku+MY3kasH19TFykTz2xWmMeq6bk2NU3XXvfJ+Q61m0xktWwt+1HSYf3JZsTms3aRJg==", + "dev": true, + "license": "MIT" + }, + "node_modules/csstype": { + "version": "3.2.3", + "resolved": "https://registry.npmjs.org/csstype/-/csstype-3.2.3.tgz", + "integrity": "sha512-z1HGKcYy2xA8AGQfwrn0PAy+PB7X/GSj3UVJW9qKyn43xWa+gl5nXmU4qqLMRzWVLFC8KusUX8T/0kCiOYpAIQ==", + "devOptional": true, + "license": "MIT" + }, + "node_modules/d3-array": { + "version": "3.2.4", + "resolved": "https://registry.npmjs.org/d3-array/-/d3-array-3.2.4.tgz", + "integrity": "sha512-tdQAmyA18i4J7wprpYq8ClcxZy3SC31QMeByyCFyRt7BVHdREQZ5lpzoe5mFEYZUWe+oq8HBvk9JjpibyEV4Jg==", + "license": "ISC", + "dependencies": { + "internmap": "1 - 2" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/d3-color": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/d3-color/-/d3-color-3.1.0.tgz", + "integrity": "sha512-zg/chbXyeBtMQ1LbD/WSoW2DpC3I0mpmPdW+ynRTj/x2DAWYrIY7qeZIHidozwV24m4iavr15lNwIwLxRmOxhA==", + "license": "ISC", + "engines": { + "node": ">=12" + } + }, + "node_modules/d3-ease": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/d3-ease/-/d3-ease-3.0.1.tgz", + "integrity": "sha512-wR/XK3D3XcLIZwpbvQwQ5fK+8Ykds1ip7A2Txe0yxncXSdq1L9skcG7blcedkOX+ZcgxGAmLX1FrRGbADwzi0w==", + "license": "BSD-3-Clause", + "engines": { + "node": ">=12" + } + }, + "node_modules/d3-format": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/d3-format/-/d3-format-3.1.2.tgz", + "integrity": "sha512-AJDdYOdnyRDV5b6ArilzCPPwc1ejkHcoyFarqlPqT7zRYjhavcT3uSrqcMvsgh2CgoPbK3RCwyHaVyxYcP2Arg==", + "license": "ISC", + "engines": { + "node": ">=12" + } + }, + "node_modules/d3-interpolate": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/d3-interpolate/-/d3-interpolate-3.0.1.tgz", + "integrity": "sha512-3bYs1rOD33uo8aqJfKP3JWPAibgw8Zm2+L9vBKEHJ2Rg+viTR7o5Mmv5mZcieN+FRYaAOWX5SJATX6k1PWz72g==", + "license": "ISC", + "dependencies": { + "d3-color": "1 - 3" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/d3-path": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/d3-path/-/d3-path-3.1.0.tgz", + "integrity": "sha512-p3KP5HCf/bvjBSSKuXid6Zqijx7wIfNW+J/maPs+iwR35at5JCbLUT0LzF1cnjbCHWhqzQTIN2Jpe8pRebIEFQ==", + "license": "ISC", + "engines": { + "node": ">=12" + } + }, + "node_modules/d3-scale": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/d3-scale/-/d3-scale-4.0.2.tgz", + "integrity": "sha512-GZW464g1SH7ag3Y7hXjf8RoUuAFIqklOAq3MRl4OaWabTFJY9PN/E1YklhXLh+OQ3fM9yS2nOkCoS+WLZ6kvxQ==", + "license": "ISC", + "dependencies": { + "d3-array": "2.10.0 - 3", + "d3-format": "1 - 3", + "d3-interpolate": "1.2.0 - 3", + "d3-time": "2.1.1 - 3", + "d3-time-format": "2 - 4" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/d3-shape": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/d3-shape/-/d3-shape-3.2.0.tgz", + "integrity": "sha512-SaLBuwGm3MOViRq2ABk3eLoxwZELpH6zhl3FbAoJ7Vm1gofKx6El1Ib5z23NUEhF9AsGl7y+dzLe5Cw2AArGTA==", + "license": "ISC", + "dependencies": { + "d3-path": "^3.1.0" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/d3-time": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/d3-time/-/d3-time-3.1.0.tgz", + "integrity": "sha512-VqKjzBLejbSMT4IgbmVgDjpkYrNWUYJnbCGo874u7MMKIWsILRX+OpX/gTk8MqjpT1A/c6HY2dCA77ZN0lkQ2Q==", + "license": "ISC", + "dependencies": { + "d3-array": "2 - 3" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/d3-time-format": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/d3-time-format/-/d3-time-format-4.1.0.tgz", + "integrity": "sha512-dJxPBlzC7NugB2PDLwo9Q8JiTR3M3e4/XANkreKSUxF8vvXKqm1Yfq4Q5dl8budlunRVlUUaDUgFt7eA8D6NLg==", + "license": "ISC", + "dependencies": { + "d3-time": "1 - 3" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/d3-timer": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/d3-timer/-/d3-timer-3.0.1.tgz", + "integrity": "sha512-ndfJ/JxxMd3nw31uyKoY2naivF+r29V+Lc0svZxe1JvvIRmi8hUsrMvdOwgS1o6uBHmiz91geQ0ylPP0aj1VUA==", + "license": "ISC", + "engines": { + "node": ">=12" + } + }, + "node_modules/debug": { + "version": "4.4.3", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.3.tgz", + "integrity": "sha512-RGwwWnwQvkVfavKVt22FGLw+xYSdzARwm0ru6DhTVA3umU5hZc28V3kO4stgYryrTlLpuvgI9GiijltAjNbcqA==", + "dev": true, + "license": "MIT", + "dependencies": { + "ms": "^2.1.3" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/decimal.js-light": { + "version": "2.5.1", + "resolved": "https://registry.npmjs.org/decimal.js-light/-/decimal.js-light-2.5.1.tgz", + "integrity": "sha512-qIMFpTMZmny+MMIitAB6D7iVPEorVw6YQRWkvarTkT4tBeSLLiHzcwj6q0MmYSFCiVpiqPJTJEYIrpcPzVEIvg==", + "license": "MIT" + }, + "node_modules/electron-to-chromium": { + "version": "1.5.383", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.383.tgz", + "integrity": "sha512-I2484/KkAvl8lm9VyjH2JnbOIV0d/UCqT7gbzs6l+o6Vmn9wgB66uVcKX+Vk6HrXtY6fbWTOEXuv8waDTuFNCw==", + "dev": true, + "license": "ISC" + }, + "node_modules/es-toolkit": { + "version": "1.49.0", + "resolved": "https://registry.npmjs.org/es-toolkit/-/es-toolkit-1.49.0.tgz", + "integrity": "sha512-G5iZ6Pc/FNRY/soKZHC+TxGDD83rHUDXxzaWhGCX44vAv/tMs56WMusnm/KMNK+luUPsgA9U28cGr4RDlSzL2g==", + "license": "MIT", + "workspaces": [ + "docs", + "benchmarks" + ] + }, + "node_modules/esbuild": { + "version": "0.25.12", + "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.25.12.tgz", + "integrity": "sha512-bbPBYYrtZbkt6Os6FiTLCTFxvq4tt3JKall1vRwshA3fdVztsLAatFaZobhkBC8/BrPetoa0oksYoKXoG4ryJg==", + "dev": true, + "hasInstallScript": true, + "license": "MIT", + "bin": { + "esbuild": "bin/esbuild" + }, + "engines": { + "node": ">=18" + }, + "optionalDependencies": { + "@esbuild/aix-ppc64": "0.25.12", + "@esbuild/android-arm": "0.25.12", + "@esbuild/android-arm64": "0.25.12", + "@esbuild/android-x64": "0.25.12", + "@esbuild/darwin-arm64": "0.25.12", + "@esbuild/darwin-x64": "0.25.12", + "@esbuild/freebsd-arm64": "0.25.12", + "@esbuild/freebsd-x64": "0.25.12", + "@esbuild/linux-arm": "0.25.12", + "@esbuild/linux-arm64": "0.25.12", + "@esbuild/linux-ia32": "0.25.12", + "@esbuild/linux-loong64": "0.25.12", + "@esbuild/linux-mips64el": "0.25.12", + "@esbuild/linux-ppc64": "0.25.12", + "@esbuild/linux-riscv64": "0.25.12", + "@esbuild/linux-s390x": "0.25.12", + "@esbuild/linux-x64": "0.25.12", + "@esbuild/netbsd-arm64": "0.25.12", + "@esbuild/netbsd-x64": "0.25.12", + "@esbuild/openbsd-arm64": "0.25.12", + "@esbuild/openbsd-x64": "0.25.12", + "@esbuild/openharmony-arm64": "0.25.12", + "@esbuild/sunos-x64": "0.25.12", + "@esbuild/win32-arm64": "0.25.12", + "@esbuild/win32-ia32": "0.25.12", + "@esbuild/win32-x64": "0.25.12" + } + }, + "node_modules/escalade": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.2.0.tgz", + "integrity": "sha512-WUj2qlxaQtO4g6Pq5c29GTcWGDyd8itL8zTlipgECz3JesAiiOKotd8JU6otB3PACgG6xkJUyVhboMS+bje/jA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/eventemitter3": { + "version": "5.0.4", + "resolved": "https://registry.npmjs.org/eventemitter3/-/eventemitter3-5.0.4.tgz", + "integrity": "sha512-mlsTRyGaPBjPedk6Bvw+aqbsXDtoAyAzm5MO7JgU+yVRyMQ5O8bD4Kcci7BS85f93veegeCPkL8R4GLClnjLFw==", + "license": "MIT" + }, + "node_modules/fdir": { + "version": "6.5.0", + "resolved": "https://registry.npmjs.org/fdir/-/fdir-6.5.0.tgz", + "integrity": "sha512-tIbYtZbucOs0BRGqPJkshJUYdL+SDH7dVM8gjy+ERp3WAUjLEFJE+02kanyHtwjWOnwrKYBiwAmM0p4kLJAnXg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=12.0.0" + }, + "peerDependencies": { + "picomatch": "^3 || ^4" + }, + "peerDependenciesMeta": { + "picomatch": { + "optional": true + } + } + }, + "node_modules/fsevents": { + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz", + "integrity": "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==", + "dev": true, + "hasInstallScript": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": "^8.16.0 || ^10.6.0 || >=11.0.0" + } + }, + "node_modules/gensync": { + "version": "1.0.0-beta.2", + "resolved": "https://registry.npmjs.org/gensync/-/gensync-1.0.0-beta.2.tgz", + "integrity": "sha512-3hN7NaskYvMDLQY55gnW3NQ+mesEAepTqlg+VEbj7zzqEMBVNhzcGYYeqFo/TlYz6eQiFcp1HcsCZO+nGgS8zg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/immer": { + "version": "11.1.8", + "resolved": "https://registry.npmjs.org/immer/-/immer-11.1.8.tgz", + "integrity": "sha512-/tbkHMW7y10Lx6i1crLjD4/OhNkRG+Fo7byZHtah0547nIeXYcpIXaUh0IAQY6gO5459qpGGYapcEOHtFXkIuA==", + "license": "MIT", + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/immer" + } + }, + "node_modules/internmap": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/internmap/-/internmap-2.0.3.tgz", + "integrity": "sha512-5Hh7Y1wQbvY5ooGgPbDaL5iYLAPzMTUrjMulskHLH6wnv/A+1q5rgEaiuqEjB+oxGXIVZs1FF+R/KPN3ZSQYYg==", + "license": "ISC", + "engines": { + "node": ">=12" + } + }, + "node_modules/js-tokens": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", + "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/jsesc": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-3.1.0.tgz", + "integrity": "sha512-/sM3dO2FOzXjKQhJuo0Q173wf2KOo8t4I8vHy6lF9poUp7bKT0/NHE8fPX23PwfhnykfqnC2xRxOnVw5XuGIaA==", + "dev": true, + "license": "MIT", + "bin": { + "jsesc": "bin/jsesc" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/json5": { + "version": "2.2.3", + "resolved": "https://registry.npmjs.org/json5/-/json5-2.2.3.tgz", + "integrity": "sha512-XmOWe7eyHYH14cLdVPoyg+GOH3rYX++KpzrylJwSW98t3Nk+U8XOl8FWKOgwtzdb8lXGf6zYwDUzeHMWfxasyg==", + "dev": true, + "license": "MIT", + "bin": { + "json5": "lib/cli.js" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/lru-cache": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-5.1.1.tgz", + "integrity": "sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w==", + "dev": true, + "license": "ISC", + "dependencies": { + "yallist": "^3.0.2" + } + }, + "node_modules/ms": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", + "dev": true, + "license": "MIT" + }, + "node_modules/nanoid": { + "version": "3.3.15", + "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.15.tgz", + "integrity": "sha512-y7Wygv/7mEOvxTuEQDB8StXdMRBWf1kR/tlhAzBRUFkB2jfcLOAxO/SHmOO2zgz1pVgK29/kyupn059/bCHdjA==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "license": "MIT", + "bin": { + "nanoid": "bin/nanoid.cjs" + }, + "engines": { + "node": "^10 || ^12 || ^13.7 || ^14 || >=15.0.1" + } + }, + "node_modules/node-releases": { + "version": "2.0.50", + "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.50.tgz", + "integrity": "sha512-J6l92tKHX6w8Jy5nO1Vuc01NoIiRGi/d6qBKVxh+IQ8Cr3b6HbVNfKiF8ZpFKufTwpwxMmce2W3iQZ861ZRyTg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=18" + } + }, + "node_modules/picocolors": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.1.1.tgz", + "integrity": "sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA==", + "dev": true, + "license": "ISC" + }, + "node_modules/picomatch": { + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-4.0.4.tgz", + "integrity": "sha512-QP88BAKvMam/3NxH6vj2o21R6MjxZUAd6nlwAS/pnGvN9IVLocLHxGYIzFhg6fUQ+5th6P4dv4eW9jX3DSIj7A==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/jonschlinkert" + } + }, + "node_modules/postcss": { + "version": "8.5.16", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.5.16.tgz", + "integrity": "sha512-vuwillviilfKZsg0VGj5R/YwwcHx4SLsIOI/7K6mQkWx+l5cUHTjj5g0AasTBcyXsbfTgrwsUNmVUb5xVwyPwg==", + "dev": true, + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/postcss/" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/postcss" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "license": "MIT", + "dependencies": { + "nanoid": "^3.3.12", + "picocolors": "^1.1.1", + "source-map-js": "^1.2.1" + }, + "engines": { + "node": "^10 || ^12 || >=14" + } + }, + "node_modules/react": { + "version": "19.2.7", + "resolved": "https://registry.npmjs.org/react/-/react-19.2.7.tgz", + "integrity": "sha512-HNe9WslTbXmFK8o8cmwgAeJFSBvt1bPdHCVKtaaV+WlAN36mpT4hcRpwbf3fY56ar2oIXzsBpOAiIRHAdY0OlQ==", + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/react-dom": { + "version": "19.2.7", + "resolved": "https://registry.npmjs.org/react-dom/-/react-dom-19.2.7.tgz", + "integrity": "sha512-t0BRVXvbiE/o20Hfw669rLbMCDWtYZLvmJigy2f0MxsXF+71pxhR3xOkspmsO8h3ZlNzyibAmtCa3l4lYKk6gQ==", + "license": "MIT", + "dependencies": { + "scheduler": "^0.27.0" + }, + "peerDependencies": { + "react": "^19.2.7" + } + }, + "node_modules/react-is": { + "version": "19.2.7", + "resolved": "https://registry.npmjs.org/react-is/-/react-is-19.2.7.tgz", + "integrity": "sha512-kZFnouyVv7eP/Phmrlo9FK+zcAdriZJvzxXHF1Sl1P377WSGe2G/JxVolhTrB/jeV47lKImhNUsijjHAAbcl/A==", + "license": "MIT", + "peer": true + }, + "node_modules/react-redux": { + "version": "9.3.0", + "resolved": "https://registry.npmjs.org/react-redux/-/react-redux-9.3.0.tgz", + "integrity": "sha512-KQopgqFo/p/fgmAs5qz6p5RWaNAzq40WAu7fJIXnQpYxFPbJYtsJPWvGeF2rOBaY/kEuV77AVsX8TsQzKm+A/g==", + "license": "MIT", + "dependencies": { + "@types/use-sync-external-store": "^0.0.6", + "use-sync-external-store": "^1.4.0" + }, + "peerDependencies": { + "@types/react": "^18.2.25 || ^19", + "react": "^18.0 || ^19", + "redux": "^5.0.0" + }, + "peerDependenciesMeta": { + "@types/react": { + "optional": true + }, + "redux": { + "optional": true + } + } + }, + "node_modules/react-refresh": { + "version": "0.17.0", + "resolved": "https://registry.npmjs.org/react-refresh/-/react-refresh-0.17.0.tgz", + "integrity": "sha512-z6F7K9bV85EfseRCp2bzrpyQ0Gkw1uLoCel9XBVWPg/TjRj94SkJzUTGfOa4bs7iJvBWtQG0Wq7wnI0syw3EBQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/recharts": { + "version": "3.9.1", + "resolved": "https://registry.npmjs.org/recharts/-/recharts-3.9.1.tgz", + "integrity": "sha512-WMcwlXcB7l+BbxiEdyClkG+1sxrMHNZpzT577LEvU4+rXPd8oTAy1wXk72hnk2KOOmxuLvw3z5DtXT7HEAydtg==", + "license": "MIT", + "workspaces": [ + "www" + ], + "dependencies": { + "@reduxjs/toolkit": "^1.9.0 || 2.x.x", + "clsx": "^2.1.1", + "decimal.js-light": "^2.5.1", + "es-toolkit": "^1.39.3", + "eventemitter3": "^5.0.1", + "immer": "^11.1.8", + "react-redux": "8.x.x || 9.x.x", + "reselect": "5.2.0", + "tiny-invariant": "^1.3.3", + "use-sync-external-store": "^1.2.2", + "victory-vendor": "^37.0.2" + }, + "engines": { + "node": ">=18" + }, + "peerDependencies": { + "react": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0", + "react-dom": "^16.0.0 || ^17.0.0 || ^18.0.0 || ^19.0.0", + "react-is": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0" + } + }, + "node_modules/redux": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/redux/-/redux-5.0.1.tgz", + "integrity": "sha512-M9/ELqF6fy8FwmkpnF0S3YKOqMyoWJ4+CS5Efg2ct3oY9daQvd/Pc71FpGZsVsbl3Cpb+IIcjBDUnnyBdQbq4w==", + "license": "MIT" + }, + "node_modules/redux-thunk": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/redux-thunk/-/redux-thunk-3.1.0.tgz", + "integrity": "sha512-NW2r5T6ksUKXCabzhL9z+h206HQw/NJkcLm1GPImRQ8IzfXwRGqjVhKJGauHirT0DAuyy6hjdnMZaRoAcy0Klw==", + "license": "MIT", + "peerDependencies": { + "redux": "^5.0.0" + } + }, + "node_modules/reselect": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/reselect/-/reselect-5.2.0.tgz", + "integrity": "sha512-AgZ3UOZm3YndfrJ4OYjgrT7bmCm/1iqkjvEfH/oYjzh6PD2qw4QuT3jjnXIrpdt4MTpMXclMT3lXbmRY+XRakw==", + "license": "MIT" + }, + "node_modules/rollup": { + "version": "4.62.2", + "resolved": "https://registry.npmjs.org/rollup/-/rollup-4.62.2.tgz", + "integrity": "sha512-RFnrW4lhXA3s3eqHDZvN654g8OTjzRfqpIRJYczCGB6HzphckVAi/Qh4tbPUbRuDi7s1Llv8g/NspLkttY3gTA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/estree": "1.0.9" + }, + "bin": { + "rollup": "dist/bin/rollup" + }, + "engines": { + "node": ">=18.0.0", + "npm": ">=8.0.0" + }, + "optionalDependencies": { + "@rollup/rollup-android-arm-eabi": "4.62.2", + "@rollup/rollup-android-arm64": "4.62.2", + "@rollup/rollup-darwin-arm64": "4.62.2", + "@rollup/rollup-darwin-x64": "4.62.2", + "@rollup/rollup-freebsd-arm64": "4.62.2", + "@rollup/rollup-freebsd-x64": "4.62.2", + "@rollup/rollup-linux-arm-gnueabihf": "4.62.2", + "@rollup/rollup-linux-arm-musleabihf": "4.62.2", + "@rollup/rollup-linux-arm64-gnu": "4.62.2", + "@rollup/rollup-linux-arm64-musl": "4.62.2", + "@rollup/rollup-linux-loong64-gnu": "4.62.2", + "@rollup/rollup-linux-loong64-musl": "4.62.2", + "@rollup/rollup-linux-ppc64-gnu": "4.62.2", + "@rollup/rollup-linux-ppc64-musl": "4.62.2", + "@rollup/rollup-linux-riscv64-gnu": "4.62.2", + "@rollup/rollup-linux-riscv64-musl": "4.62.2", + "@rollup/rollup-linux-s390x-gnu": "4.62.2", + "@rollup/rollup-linux-x64-gnu": "4.62.2", + "@rollup/rollup-linux-x64-musl": "4.62.2", + "@rollup/rollup-openbsd-x64": "4.62.2", + "@rollup/rollup-openharmony-arm64": "4.62.2", + "@rollup/rollup-win32-arm64-msvc": "4.62.2", + "@rollup/rollup-win32-ia32-msvc": "4.62.2", + "@rollup/rollup-win32-x64-gnu": "4.62.2", + "@rollup/rollup-win32-x64-msvc": "4.62.2", + "fsevents": "~2.3.2" + } + }, + "node_modules/scheduler": { + "version": "0.27.0", + "resolved": "https://registry.npmjs.org/scheduler/-/scheduler-0.27.0.tgz", + "integrity": "sha512-eNv+WrVbKu1f3vbYJT/xtiF5syA5HPIMtf9IgY/nKg0sWqzAUEvqY/xm7OcZc/qafLx/iO9FgOmeSAp4v5ti/Q==", + "license": "MIT" + }, + "node_modules/semver": { + "version": "6.3.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", + "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", + "dev": true, + "license": "ISC", + "bin": { + "semver": "bin/semver.js" + } + }, + "node_modules/source-map-js": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.2.1.tgz", + "integrity": "sha512-UXWMKhLOwVKb728IUtQPXxfYU+usdybtUrK/8uGE8CQMvrhOpwvzDBwj0QhSL7MQc7vIsISBG8VQ8+IDQxpfQA==", + "dev": true, + "license": "BSD-3-Clause", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/tiny-invariant": { + "version": "1.3.3", + "resolved": "https://registry.npmjs.org/tiny-invariant/-/tiny-invariant-1.3.3.tgz", + "integrity": "sha512-+FbBPE1o9QAYvviau/qC5SE3caw21q3xkvWKBtja5vgqOWIHHJ3ioaq1VPfn/Szqctz2bU/oYeKd9/z5BL+PVg==", + "license": "MIT" + }, + "node_modules/tinyglobby": { + "version": "0.2.17", + "resolved": "https://registry.npmjs.org/tinyglobby/-/tinyglobby-0.2.17.tgz", + "integrity": "sha512-wXR/dYpcqKmfWpEdZjiKJOwCNFndD0DMnrW/cYjVGttEkBfVgcLFHoNrlj47mjOVic9yyNu65alsgF4NQyTa2g==", + "dev": true, + "license": "MIT", + "dependencies": { + "fdir": "^6.5.0", + "picomatch": "^4.0.4" + }, + "engines": { + "node": ">=12.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/SuperchupuDev" + } + }, + "node_modules/typescript": { + "version": "5.9.3", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.9.3.tgz", + "integrity": "sha512-jl1vZzPDinLr9eUt3J/t7V6FgNEw9QjvBPdysz9KfQDD41fQrC2Y4vKQdiaUpFT4bXlb1RHhLpp8wtm6M5TgSw==", + "dev": true, + "license": "Apache-2.0", + "bin": { + "tsc": "bin/tsc", + "tsserver": "bin/tsserver" + }, + "engines": { + "node": ">=14.17" + } + }, + "node_modules/update-browserslist-db": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.2.3.tgz", + "integrity": "sha512-Js0m9cx+qOgDxo0eMiFGEueWztz+d4+M3rGlmKPT+T4IS/jP4ylw3Nwpu6cpTTP8R1MAC1kF4VbdLt3ARf209w==", + "dev": true, + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/browserslist" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/browserslist" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "license": "MIT", + "dependencies": { + "escalade": "^3.2.0", + "picocolors": "^1.1.1" + }, + "bin": { + "update-browserslist-db": "cli.js" + }, + "peerDependencies": { + "browserslist": ">= 4.21.0" + } + }, + "node_modules/use-sync-external-store": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/use-sync-external-store/-/use-sync-external-store-1.6.0.tgz", + "integrity": "sha512-Pp6GSwGP/NrPIrxVFAIkOQeyw8lFenOHijQWkUTrDvrF4ALqylP2C/KCkeS9dpUM3KvYRQhna5vt7IL95+ZQ9w==", + "license": "MIT", + "peerDependencies": { + "react": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0" + } + }, + "node_modules/victory-vendor": { + "version": "37.3.6", + "resolved": "https://registry.npmjs.org/victory-vendor/-/victory-vendor-37.3.6.tgz", + "integrity": "sha512-SbPDPdDBYp+5MJHhBCAyI7wKM3d5ivekigc2Dk2s7pgbZ9wIgIBYGVw4zGHBml/qTFbexrofXW6Gu4noGxrOwQ==", + "license": "MIT AND ISC", + "dependencies": { + "@types/d3-array": "^3.0.3", + "@types/d3-ease": "^3.0.0", + "@types/d3-interpolate": "^3.0.1", + "@types/d3-scale": "^4.0.2", + "@types/d3-shape": "^3.1.0", + "@types/d3-time": "^3.0.0", + "@types/d3-timer": "^3.0.0", + "d3-array": "^3.1.6", + "d3-ease": "^3.0.1", + "d3-interpolate": "^3.0.1", + "d3-scale": "^4.0.2", + "d3-shape": "^3.1.0", + "d3-time": "^3.0.0", + "d3-timer": "^3.0.1" + } + }, + "node_modules/vite": { + "version": "6.4.3", + "resolved": "https://registry.npmjs.org/vite/-/vite-6.4.3.tgz", + "integrity": "sha512-NTKlcQjlAK7MlQoyb6LgaqHc8sso/pVyUJYWMws3jg21uTJw/LddqIFPcPqP6PzpgbIcZyKI85sFE4HBrQDA8A==", + "dev": true, + "license": "MIT", + "dependencies": { + "esbuild": "^0.25.0", + "fdir": "^6.4.4", + "picomatch": "^4.0.2", + "postcss": "^8.5.3", + "rollup": "^4.34.9", + "tinyglobby": "^0.2.13" + }, + "bin": { + "vite": "bin/vite.js" + }, + "engines": { + "node": "^18.0.0 || ^20.0.0 || >=22.0.0" + }, + "funding": { + "url": "https://github.com/vitejs/vite?sponsor=1" + }, + "optionalDependencies": { + "fsevents": "~2.3.3" + }, + "peerDependencies": { + "@types/node": "^18.0.0 || ^20.0.0 || >=22.0.0", + "jiti": ">=1.21.0", + "less": "*", + "lightningcss": "^1.21.0", + "sass": "*", + "sass-embedded": "*", + "stylus": "*", + "sugarss": "*", + "terser": "^5.16.0", + "tsx": "^4.8.1", + "yaml": "^2.4.2" + }, + "peerDependenciesMeta": { + "@types/node": { + "optional": true + }, + "jiti": { + "optional": true + }, + "less": { + "optional": true + }, + "lightningcss": { + "optional": true + }, + "sass": { + "optional": true + }, + "sass-embedded": { + "optional": true + }, + "stylus": { + "optional": true + }, + "sugarss": { + "optional": true + }, + "terser": { + "optional": true + }, + "tsx": { + "optional": true + }, + "yaml": { + "optional": true + } + } + }, + "node_modules/yallist": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-3.1.1.tgz", + "integrity": "sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g==", + "dev": true, + "license": "ISC" + } + } +} diff --git a/plugins/gold-price-check/package.json b/plugins/gold-price-check/package.json new file mode 100644 index 00000000..9d28a359 --- /dev/null +++ b/plugins/gold-price-check/package.json @@ -0,0 +1,23 @@ +{ + "name": "gold-price-check", + "version": "1.0.0", + "description": "A ZTools plugin", + "type": "module", + "scripts": { + "dev": "vite", + "build": "tsc && vite build" + }, + "dependencies": { + "react": "^19.0.0", + "react-dom": "^19.0.0", + "recharts": "^3.9.1" + }, + "devDependencies": { + "@types/react": "^19.0.8", + "@types/react-dom": "^19.0.3", + "@vitejs/plugin-react": "^4.3.1", + "@ztools-center/ztools-api-types": "^1.0.1", + "typescript": "^5.3.0", + "vite": "^6.0.11" + } +} diff --git a/plugins/gold-price-check/public/logo.png b/plugins/gold-price-check/public/logo.png new file mode 100644 index 00000000..47448898 Binary files /dev/null and b/plugins/gold-price-check/public/logo.png differ diff --git a/plugins/gold-price-check/public/plugin.json b/plugins/gold-price-check/public/plugin.json new file mode 100644 index 00000000..9236accb --- /dev/null +++ b/plugins/gold-price-check/public/plugin.json @@ -0,0 +1,37 @@ +{ + "$schema": "node_modules/@ztools-center/ztools-api-types/resource/ztools.schema.json", + "name": "gold-price-check", + "title": "金价动态", + "description": "实时查看每日金价、品牌金店价格、银行金条价格、黄金回收价格,以及日内/月度/年度价格波动走势", + "author": "fantasyke", + "version": "1.0.0", + "main": "index.html", + "preload": "preload/services.js", + "logo": "logo.png", + "development": { + "main": "http://localhost:5173" + }, + "features": [ + { + "code": "gold", + "explain": "查看每日金价、品牌金店价格、银行金条价格、黄金回收价格,以及日内/月度/年度价格波动走势", + "icon": "logo.png", + "cmds": [ + "金价", + "每日金价", + "黄金价格", + "gold", + "实时金价", + "今日金价", + "金条价格", + "回收金价", + "金价走势" + ] + } + ], + "platform": [ + "linux", + "win32", + "darwin" + ] +} \ No newline at end of file diff --git a/plugins/gold-price-check/public/preload/package.json b/plugins/gold-price-check/public/preload/package.json new file mode 100644 index 00000000..5bbefffb --- /dev/null +++ b/plugins/gold-price-check/public/preload/package.json @@ -0,0 +1,3 @@ +{ + "type": "commonjs" +} diff --git a/plugins/gold-price-check/public/preload/services.js b/plugins/gold-price-check/public/preload/services.js new file mode 100644 index 00000000..83c3ef1f --- /dev/null +++ b/plugins/gold-price-check/public/preload/services.js @@ -0,0 +1,27 @@ +const fs = require('node:fs') +const path = require('node:path') + +// 通过 window 对象向渲染进程注入 nodejs 能力 +window.services = { + // 读文件 + readFile(file) { + return fs.readFileSync(file, { encoding: 'utf-8' }) + }, + // 文本写入到下载目录 + writeTextFile(text) { + const filePath = path.join(window.ztools.getPath('downloads'), Date.now().toString() + '.txt') + fs.writeFileSync(filePath, text, { encoding: 'utf-8' }) + return filePath + }, + // 图片写入到下载目录 + writeImageFile(base64Url) { + const matchs = /^data:image\/([a-z]{1,20});base64,/i.exec(base64Url) + if (!matchs) return + const filePath = path.join( + window.ztools.getPath('downloads'), + Date.now().toString() + '.' + matchs[1] + ) + fs.writeFileSync(filePath, base64Url.substring(matchs[0].length), { encoding: 'base64' }) + return filePath + } +} diff --git a/plugins/gold-price-check/src/App.tsx b/plugins/gold-price-check/src/App.tsx new file mode 100644 index 00000000..225b4e85 --- /dev/null +++ b/plugins/gold-price-check/src/App.tsx @@ -0,0 +1,42 @@ +import { useEffect, useState } from 'react' +import GoldPrice from './GoldPrice' + +export default function App() { + const [ready, setReady] = useState(false) + + useEffect(() => { + const zt = (window as any).ztools + if (!zt) { + // 非 ZTools 环境(浏览器开发模式),直接显示 + setReady(true) + return + } + // ZTools 环境:注册插件生命周期并监听路由 + zt.onPluginEnter((action: any) => { + // 收到 enter 事件后渲染页面 + setReady(true) + }) + zt.onPluginOut(() => { + setReady(false) + }) + }, []) + + // 未收到 enter 事件前显示 loading,避免空白闪烁 + if (!ready) { + return ( +
+ 加载中... +
+ ) + } + + return +} \ No newline at end of file diff --git a/plugins/gold-price-check/src/GoldPrice/components/BrandTable.tsx b/plugins/gold-price-check/src/GoldPrice/components/BrandTable.tsx new file mode 100644 index 00000000..093c1398 --- /dev/null +++ b/plugins/gold-price-check/src/GoldPrice/components/BrandTable.tsx @@ -0,0 +1,35 @@ +import React from 'react'; + +interface BrandTableProps { + columns: string[]; + data: string[][]; +} + +export default function BrandTable({ columns, data }: BrandTableProps) { + if (data.length === 0) { + return

暂无数据

; + } + + return ( +
+ + + + {columns.map((col, i) => ( + + ))} + + + + {data.map((row, i) => ( + + {row.map((cell, j) => ( + + ))} + + ))} + +
{col}
{cell}
+
+ ); +} \ No newline at end of file diff --git a/plugins/gold-price-check/src/GoldPrice/components/FluctuationChart.tsx b/plugins/gold-price-check/src/GoldPrice/components/FluctuationChart.tsx new file mode 100644 index 00000000..68d7df0a --- /dev/null +++ b/plugins/gold-price-check/src/GoldPrice/components/FluctuationChart.tsx @@ -0,0 +1,137 @@ +import React, { useMemo } from 'react'; +import { + ResponsiveContainer, + LineChart, + Line, + XAxis, + YAxis, + CartesianGrid, + Tooltip, + Area, + AreaChart, + ReferenceLine, +} from 'recharts'; + +interface FluctuationChartProps { + // eslint-disable-next-line @typescript-eslint/no-explicit-any + data: any[]; + dataKey: string; + xKey: string; + color: string; + unit: string; + height: number; + isMonthly?: boolean; +} + +export default function FluctuationChart({ + data, + dataKey, + xKey, + color, + unit, + height, + isMonthly = false, +}: FluctuationChartProps) { + // 计算均值作为参考线 + const avgValue = useMemo(() => { + if (data.length === 0) return 0; + const sum = data.reduce((acc, d) => acc + (Number(d[dataKey]) || 0), 0); + return sum / data.length; + }, [data, dataKey]); + + // 格式化 X 轴标签 + const formatXLabel = (value: string) => { + if (isMonthly) { + // 月度显示 "1月" "2月" 等 + const parts = value.split('-'); + if (parts.length >= 2) { + return `${parseInt(parts[1], 10)}月`; + } + return value; + } + // 日度显示 "MM-DD" + const parts = value.split('-'); + if (parts.length >= 3) { + return `${parts[1]}-${parts[2]}`; + } + return value; + }; + + // 自定义 Tooltip + const CustomTooltip = ({ active, payload, label }: any) => { + if (!active || !payload || !payload.length) return null; + const displayLabel = isMonthly + ? (() => { + const parts = label.split('-'); + return parts.length >= 2 ? `${parts[0]}年${parseInt(parts[1], 10)}月` : label; + })() + : label; + + return ( +
+

{displayLabel}

+

+ {unit}: {Number(payload[0].value).toFixed(2)} +

+
+ ); + }; + + // 计算价格范围 + const prices = data.map((d) => Number(d[dataKey]) || 0); + const minPrice = prices.length > 0 ? Math.min(...prices) : 0; + const maxPrice = prices.length > 0 ? Math.max(...prices) : 100; + const padding = (maxPrice - minPrice) * 0.1 || 10; + + return ( + + + + + + + + + + + v.toFixed(0)} + width={50} + /> + } /> + + + + + ); +} \ No newline at end of file diff --git a/plugins/gold-price-check/src/GoldPrice/components/PriceCard.tsx b/plugins/gold-price-check/src/GoldPrice/components/PriceCard.tsx new file mode 100644 index 00000000..a1dbefe2 --- /dev/null +++ b/plugins/gold-price-check/src/GoldPrice/components/PriceCard.tsx @@ -0,0 +1,61 @@ +import React from 'react'; +import type { GoldPriceSnapshot } from '../services/goldApi'; + +interface PriceCardProps { + snapshot: GoldPriceSnapshot; + spotUSD?: number | null; +} + +export default function PriceCard({ snapshot, spotUSD }: PriceCardProps) { + const isUp = snapshot.changeAmount >= 0; + const currencySymbol = snapshot.unit === '元/克' ? '¥' : '$'; + + return ( +
+
+
+ {snapshot.name} + + {isUp ? '▲' : '▼'} {isUp ? '涨' : '跌'} + +
+
+ {currencySymbol} + {snapshot.currentPrice.toFixed(2)} + /{snapshot.unit.replace('元/', '')} +
+ {spotUSD != null && ( +
+ ≈ $ {spotUSD.toFixed(2)} USD/盎司 +
+ )} +
+ + {isUp ? '+' : ''}{snapshot.changeAmount.toFixed(2)} + + + {isUp ? '+' : ''}{snapshot.changePercent.toFixed(2)}% + +
+
+
+
+ 今日开盘 + {currencySymbol}{snapshot.openPrice.toFixed(2)} +
+
+ 今日最高 + {currencySymbol}{snapshot.highPrice.toFixed(2)} +
+
+ 今日最低 + {currencySymbol}{snapshot.lowPrice.toFixed(2)} +
+
+ 更新时间 + {snapshot.updatedAt} +
+
+
+ ); +} diff --git a/plugins/gold-price-check/src/GoldPrice/index.css b/plugins/gold-price-check/src/GoldPrice/index.css new file mode 100644 index 00000000..3eb15aae --- /dev/null +++ b/plugins/gold-price-check/src/GoldPrice/index.css @@ -0,0 +1,757 @@ +/* ===== 全局变量 ===== */ +:root { + --gold-bg: #f8f9fb; + --gold-card-bg: #ffffff; + --gold-text: #1a1d28; + --gold-text-secondary: #6b7280; + --gold-text-muted: #9ca3af; + --gold-accent: #b8860b; /* 暗金色/琥珀 */ + --gold-accent-light: #fef3c7; + --gold-up: #dc2626; + --gold-down: #16a34a; + --gold-border: #e5e7eb; + --gold-border-light: #f3f4f6; + --gold-shadow: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04); + --gold-radius: 10px; + --gold-radius-sm: 6px; + --gold-primary: #3b82f6; + --gold-primary-light: #eff6ff; + --gold-separator: #e5e7eb; +} + +/* ===== 容器 ===== */ +.gold-price-container { + font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif; + color: var(--gold-text); + background: var(--gold-bg); + height: 100%; + display: flex; + flex-direction: column; + overflow: hidden; +} + +/* ===== 头部 ===== */ +.gold-header { + display: flex; + justify-content: space-between; + align-items: center; + padding: 14px 18px; + background: #fff; + border-bottom: 1px solid var(--gold-border); +} + +.gold-header-left { + display: flex; + align-items: center; + gap: 10px; +} + +.gold-title { + font-size: 16px; + font-weight: 700; + color: var(--gold-text); + margin: 0; + letter-spacing: -0.3px; +} + +.gold-update-time { + font-size: 12px; + color: var(--gold-text-muted); + display: flex; + align-items: center; + gap: 5px; +} + +.gold-live-dot { + width: 6px; + height: 6px; + border-radius: 50%; + background: #22c55e; + animation: pulse 2s infinite; +} + +@keyframes pulse { + 0%, 100% { opacity: 1; transform: scale(1); } + 50% { opacity: 0.4; transform: scale(0.8); } +} + +.gold-refresh-btn { + background: var(--gold-primary-light); + border: 1px solid #bfdbfe; + color: var(--gold-primary); + padding: 5px 14px; + border-radius: 20px; + cursor: pointer; + font-size: 12px; + font-weight: 600; + transition: all 0.2s; + display: flex; + align-items: center; + gap: 4px; +} + +.gold-refresh-btn:hover:not(:disabled) { + background: var(--gold-primary); + color: #fff; + border-color: var(--gold-primary); +} + +.gold-refresh-btn:disabled { + opacity: 0.5; + cursor: not-allowed; +} + +/* ===== 错误/警告提示 ===== */ +.gold-error { + margin: 10px 16px; + padding: 8px 14px; + background: #fef2f2; + border: 1px solid #fecaca; + border-radius: var(--gold-radius-sm); + color: #dc2626; + font-size: 12px; +} + +.gold-warning { + background: #fffbeb; + border-color: #fde68a; + color: #b45309; +} + +/* ===== Tab 导航 ===== */ +.gold-tabs { + display: flex; + background: #fff; + border-bottom: 1px solid var(--gold-border); + padding: 0 4px; +} + +.gold-tab { + flex: 1; + display: flex; + flex-direction: column; + align-items: center; + gap: 2px; + padding: 10px 6px; + border: none; + background: none; + cursor: pointer; + color: var(--gold-text-muted); + font-size: 12px; + border-bottom: 2px solid transparent; + transition: all 0.2s; + white-space: nowrap; + position: relative; +} + +.gold-tab:hover { + color: var(--gold-text-secondary); + background: #f9fafb; +} + +.gold-tab.active { + color: var(--gold-accent); + border-bottom-color: var(--gold-accent); +} + +.gold-tab-icon { + font-size: 16px; +} + +.gold-tab-label { + font-weight: 500; +} + +/* ===== 内容区 ===== */ +.gold-content { + flex: 1; + overflow-y: auto; + padding: 14px; +} + +/* ===== 加载状态 ===== */ +.gold-loading { + display: flex; + flex-direction: column; + align-items: center; + justify-content: center; + padding: 60px 20px; + color: var(--gold-text-muted); + font-size: 13px; +} + +.gold-spinner { + width: 32px; + height: 32px; + border: 3px solid #e5e7eb; + border-top-color: var(--gold-accent); + border-radius: 50%; + animation: spin 0.7s linear infinite; + margin-bottom: 10px; +} + +@keyframes spin { + to { transform: rotate(360deg); } +} + +/* ===== 价格卡片 (今日) ===== */ +.gold-price-card { + background: #fff; + border: 1px solid var(--gold-border); + border-radius: var(--gold-radius); + padding: 18px; + box-shadow: var(--gold-shadow); + margin-bottom: 14px; +} + +.gold-price-main { + text-align: center; + padding-bottom: 14px; + border-bottom: 1px solid var(--gold-border-light); +} + +.gold-price-header-row { + display: flex; + justify-content: space-between; + align-items: center; + margin-bottom: 10px; +} + +.gold-price-name { + font-size: 13px; + color: var(--gold-text-secondary); + font-weight: 600; +} + +.gold-price-trend { + font-size: 11px; + padding: 2px 10px; + border-radius: 10px; + font-weight: 600; +} + +.gold-price-trend.up { + color: var(--gold-up); + background: #fef2f2; +} + +.gold-price-trend.down { + color: var(--gold-down); + background: #f0fdf4; +} + +.gold-price-current { + margin: 6px 0; +} + +.gold-price-symbol { + font-size: 18px; + color: var(--gold-text); + font-weight: 700; + vertical-align: super; + margin-right: 2px; +} + +.gold-price-value { + font-size: 44px; + font-weight: 800; + color: var(--gold-text); + line-height: 1; + letter-spacing: -1px; +} + +.gold-price-unit { + font-size: 13px; + color: var(--gold-text-secondary); + margin-left: 4px; +} + +.gold-usd-row { + font-size: 12px; + color: var(--gold-text-muted); + text-align: center; + margin: 2px 0 4px; +} + +.gold-price-change { + display: flex; + justify-content: center; + gap: 12px; + font-size: 13px; + font-weight: 600; +} + +.gold-price-change.up { + color: var(--gold-up); +} + +.gold-price-change.down { + color: var(--gold-down); +} + +.gold-price-details { + display: grid; + grid-template-columns: 1fr 1fr; + gap: 8px; + padding-top: 14px; +} + +.gold-detail-item { + display: flex; + justify-content: space-between; + align-items: center; + padding: 5px 0; +} + +.gold-detail-label { + font-size: 12px; + color: var(--gold-text-muted); +} + +.gold-detail-value { + font-size: 13px; + color: var(--gold-text); + font-weight: 600; +} + +.highlight-high { + color: var(--gold-up) !important; +} + +.highlight-low { + color: var(--gold-down) !important; +} + +.highlight-current { + color: var(--gold-accent) !important; +} + +/* ===== 区块通用 ===== */ +.gold-section { + margin-bottom: 14px; +} + +.gold-section-title { + font-size: 13px; + font-weight: 700; + color: var(--gold-text); + margin: 0 0 10px 0; + padding-left: 10px; + border-left: 3px solid var(--gold-accent); + display: flex; + align-items: center; +} + +.gold-chart-subtitle { + font-size: 11px; + color: var(--gold-text-muted); + font-weight: 400; + margin-left: 8px; +} + +/* ===== 月份/年份选择器 ===== */ +.gold-period-selector { + display: flex; + align-items: center; + gap: 8px; + margin-left: auto; +} + +.gold-select { + appearance: none; + -webkit-appearance: none; + padding: 4px 24px 4px 10px; + font-size: 12px; + font-weight: 500; + color: var(--gold-text); + background: #f9fafb; + border: 1px solid var(--gold-border); + border-radius: var(--gold-radius-sm); + cursor: pointer; + background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e"); + background-repeat: no-repeat; + background-position: right 4px center; + background-size: 16px; + transition: border-color 0.2s; +} + +.gold-select:hover { + border-color: var(--gold-accent); +} + +.gold-select:focus { + outline: none; + border-color: var(--gold-accent); + box-shadow: 0 0 0 2px rgba(184, 134, 11, 0.15); +} + +/* ===== 表格 ===== */ +.gold-table-wrapper { + overflow-x: auto; + border-radius: var(--gold-radius); + border: 1px solid var(--gold-border); + background: #fff; + box-shadow: var(--gold-shadow); +} + +.gold-table { + width: 100%; + border-collapse: collapse; + font-size: 12px; +} + +.gold-table th { + background: #f9fafb; + color: var(--gold-text-secondary); + font-weight: 600; + padding: 9px 12px; + text-align: left; + white-space: nowrap; + border-bottom: 1px solid var(--gold-border); + font-size: 12px; +} + +.gold-table td { + padding: 8px 12px; + border-bottom: 1px solid var(--gold-border-light); + color: var(--gold-text); + white-space: nowrap; + font-size: 12px; +} + +.gold-table tr:last-child td { + border-bottom: none; +} + +.gold-table tr:hover td { + background: #fafbfc; +} + +/* ===== 图表区 ===== */ +.gold-chart-panel { + display: flex; + flex-direction: column; + gap: 14px; +} + +.gold-chart-section { + background: #fff; + border-radius: var(--gold-radius); + border: 1px solid var(--gold-border); + padding: 16px; + box-shadow: var(--gold-shadow); +} + +.gold-chart-container { + margin-top: 10px; +} + +.gold-chart-tooltip { + background: #fff; + border: 1px solid var(--gold-border); + border-radius: var(--gold-radius-sm); + padding: 8px 12px; + box-shadow: 0 4px 12px rgba(0,0,0,0.1); + font-size: 12px; +} + +.gold-tooltip-label { + margin: 0 0 4px 0; + font-size: 11px; + color: var(--gold-text-muted); +} + +.gold-tooltip-value { + margin: 0; + font-size: 13px; + font-weight: 700; + color: var(--gold-text); +} + +/* ===== OHLC 面板 (日内波动) ===== */ +.gold-ohlc { + background: #fff; + border-radius: var(--gold-radius); + border: 1px solid var(--gold-border); + padding: 16px; + box-shadow: var(--gold-shadow); +} + +.gold-ohlc-title { + font-size: 13px; + font-weight: 700; + color: var(--gold-text); + margin-bottom: 14px; + display: flex; + justify-content: space-between; + align-items: center; +} + +.gold-ohlc-unit { + font-size: 11px; + color: var(--gold-text-muted); + font-weight: 400; +} + +.gold-ohlc-grid { + display: grid; + grid-template-columns: repeat(4, 1fr); + gap: 8px; + margin-bottom: 16px; +} + +.gold-ohlc-item { + display: flex; + flex-direction: column; + align-items: center; + gap: 4px; + padding: 10px 4px; + background: #f9fafb; + border-radius: var(--gold-radius-sm); + border: 1px solid var(--gold-border-light); +} + +.gold-ohlc-label { + font-size: 11px; + color: var(--gold-text-muted); +} + +.gold-ohlc-value { + font-size: 15px; + font-weight: 700; + color: var(--gold-text); +} + +.gold-ohlc-value.up { + color: var(--gold-up); +} + +.gold-ohlc-value.down { + color: var(--gold-down); +} + +.gold-range-wrap { + display: flex; + align-items: center; + gap: 8px; + margin-bottom: 10px; +} + +.gold-range-bound { + font-size: 11px; + color: var(--gold-text-muted); + font-variant-numeric: tabular-nums; + min-width: 56px; +} + +.gold-range-track { + flex: 1; + height: 8px; + background: #e5e7eb; + border-radius: 4px; + overflow: hidden; + position: relative; +} + +.gold-range-fill { + height: 100%; + background: linear-gradient(90deg, #16a34a 0%, #facc15 50%, #dc2626 100%); + border-radius: 4px; + transition: width 0.5s ease; + min-width: 4px; +} + +.gold-ohlc-meta { + display: flex; + justify-content: space-around; + font-size: 12px; + color: var(--gold-text-secondary); + padding-top: 10px; + border-top: 1px solid var(--gold-border-light); +} + +.gold-ohlc-meta b { + color: var(--gold-text); +} + +/* ===== 提示条 ===== */ +.gold-hint { + font-size: 11px; + color: var(--gold-text-muted); + background: #fffbeb; + border: 1px solid #fde68a; + border-radius: var(--gold-radius-sm); + padding: 6px 10px; + margin-bottom: 10px; + text-align: center; +} + +.gold-hint-box { + background: #f0f9ff; + border: 1px solid #bae6fd; + border-radius: var(--gold-radius-sm); + padding: 12px 14px; + margin-top: 12px; + font-size: 12px; + color: var(--gold-text-secondary); +} + +.gold-hint-box p { + margin: 0 0 6px 0; + font-weight: 600; + color: var(--gold-text); +} + +.gold-hint-box ul { + margin: 0; + padding-left: 16px; +} + +.gold-hint-box li { + margin-bottom: 2px; +} + +/* ===== 统计面板 (月度/年度) ===== */ +.gold-stats { + display: grid; + grid-template-columns: repeat(4, 1fr); + gap: 10px; + margin-bottom: 14px; +} + +.gold-stat-item { + display: flex; + flex-direction: column; + align-items: center; + gap: 6px; + padding: 14px 8px; + background: #fff; + border-radius: var(--gold-radius); + border: 1px solid var(--gold-border); + box-shadow: var(--gold-shadow); +} + +.gold-stat-label { + font-size: 11px; + color: var(--gold-text-muted); + font-weight: 500; +} + +.gold-stat-value { + font-size: 16px; + font-weight: 800; + color: var(--gold-text); + letter-spacing: -0.3px; +} + +.gold-stat-value.up { + color: var(--gold-up); +} + +.gold-stat-value.down { + color: var(--gold-down); +} + +/* ===== 无数据 ===== */ +.gold-no-data { + text-align: center; + padding: 36px 20px; + color: var(--gold-text-muted); + font-size: 13px; +} + +/* ===== 历年均价对比 ===== */ +.gold-yearly-compare { + display: flex; + flex-direction: column; + gap: 6px; + padding: 8px 0; +} + +.gold-yearly-row { + display: flex; + align-items: center; + gap: 8px; +} + +.gold-yearly-year { + width: 40px; + font-size: 11px; + font-weight: 600; + color: var(--gold-text); + text-align: right; + flex-shrink: 0; +} + +.gold-yearly-bar-wrap { + flex: 1; + height: 18px; + background: #f3f4f6; + border-radius: 3px; + overflow: hidden; + position: relative; +} + +.gold-yearly-bar { + height: 100%; + background: linear-gradient(90deg, #d4a84b, #c9a84c, #b8860b); + border-radius: 3px; + min-width: 2px; + transition: width 0.5s ease; +} + +.gold-yearly-value { + width: 56px; + font-size: 12px; + font-weight: 600; + color: var(--gold-text); + text-align: right; + flex-shrink: 0; +} + +/* ===== 底部 ===== */ +.gold-footer { + display: flex; + justify-content: center; + align-items: center; + gap: 6px; + padding: 10px; + background: #fff; + border-top: 1px solid var(--gold-border); + font-size: 11px; + color: var(--gold-text-muted); + flex-shrink: 0; +} + +.gold-footer-dot { + color: #d1d5db; +} + +/* ===== 滚动条 ===== */ +.gold-content::-webkit-scrollbar { + width: 4px; +} + +.gold-content::-webkit-scrollbar-thumb { + background: #d1d5db; + border-radius: 2px; +} + +.gold-content::-webkit-scrollbar-track { + background: transparent; +} + +/* ===== 响应式 ===== */ +@media (max-width: 420px) { + .gold-ohlc-grid { + grid-template-columns: repeat(2, 1fr); + } + + .gold-stats { + grid-template-columns: repeat(2, 1fr); + } + + .gold-price-value { + font-size: 36px; + } +} \ No newline at end of file diff --git a/plugins/gold-price-check/src/GoldPrice/index.tsx b/plugins/gold-price-check/src/GoldPrice/index.tsx new file mode 100644 index 00000000..bbacb95e --- /dev/null +++ b/plugins/gold-price-check/src/GoldPrice/index.tsx @@ -0,0 +1,593 @@ +import React, { useEffect, useState, useCallback, useMemo } from 'react'; +import { + fetchRealtimeGoldPrice, + fetchCurrentGoldUSD, + fetchLegacyHistoricalData, + extractGoldSnapshot, + getDailySnapshots, + appendHourlySnapshot, + appendDailySnapshot, + updateMonthlySnapshot, + getIntradayData, + getMonthlySnapshots, + filterMonthData, + getRecentDailyData, + buildYearlyData, + getAvailableMonths, + getAvailableYears, + getMonthlyPricesForYear, + getYearlyStats, + getYearlyComparison, + getRecentMonthlyData, + getMonthAvgFromCsv, + clearCache, + type GoldPriceSnapshot, + type HistoricalPrice, + type HourlySnapshot, + type MonthlySnapshot, + type LegacyHistoricalData, + type StorePrice, + type BankPrice, + type RecyclePrice, +} from './services/goldApi'; +import PriceCard from './components/PriceCard'; +import FluctuationChart from './components/FluctuationChart'; +import BrandTable from './components/BrandTable'; +import './index.css'; + +const REFRESH_INTERVAL = 5 * 60 * 1000; // 5 分钟自动刷新 + +const isZTools = typeof window !== 'undefined' && Boolean((window as any).ztools); + +type TabKey = 'today' | 'intraday' | 'month' | 'year'; + +const monthNames = ['1月','2月','3月','4月','5月','6月','7月','8月','9月','10月','11月','12月']; + +const TABS: { key: TabKey; label: string; icon: string }[] = [ + { key: 'today', label: '今日金价', icon: '💰' }, + { key: 'intraday', label: '日内波动', icon: '📈' }, + { key: 'month', label: '月度走势', icon: '📅' }, + { key: 'year', label: '年度走势', icon: '📆' }, +]; + +export default function GoldPrice() { + const [activeTab, setActiveTab] = useState('today'); + const [loading, setLoading] = useState(true); + const [error, setError] = useState(null); + const [lastUpdate, setLastUpdate] = useState(''); + + // 核心数据 + const [snapshot, setSnapshot] = useState(null); + const [spotUSD, setSpotUSD] = useState(null); + const [stores, setStores] = useState([]); + const [banks, setBanks] = useState([]); + const [recycle, setRecycle] = useState([]); + const [historical, setHistorical] = useState([]); + + // 遗留历史数据 (datasets/gold-prices) + const [legacyData, setLegacyData] = useState(null); + + // 月份/年份选择 + const now = new Date(); + const [selectedYear, setSelectedYear] = useState(now.getFullYear()); + const [selectedMonth, setSelectedMonth] = useState(now.getMonth() + 1); + const [selectedYear2, setSelectedYear2] = useState(now.getFullYear()); + + // 可用选项 (基于 monthly CSV + 本地每日快照) + const monthlyLegacy = legacyData?.monthly ?? []; + const availableYears = useMemo( + () => getAvailableYears(monthlyLegacy, historical), + [monthlyLegacy, historical], + ); + const availableMonths = useMemo( + () => getAvailableMonths(monthlyLegacy, historical, selectedYear), + [monthlyLegacy, historical, selectedYear], + ); + + // 自动修正选中月份 + useEffect(() => { + if (availableMonths.length > 0 && !availableMonths.includes(selectedMonth)) { + setSelectedMonth(availableMonths[0]); + } + }, [availableMonths, selectedMonth]); + + // ====== 加载数据 ====== + const loadData = useCallback(async (forceRefresh = false) => { + if (forceRefresh) clearCache(); + setError(null); + + try { + // 并行请求: Tmini(RMB) + 实时USD + 遗留月/年历史(每个独立容错) + const [tminiData, usdSpot, legacy] = await Promise.all([ + fetchRealtimeGoldPrice().catch((err) => { + console.error('获取RMB金价失败:', err); + return null; + }), + fetchCurrentGoldUSD().catch((err) => { + console.error('获取USD金价失败:', err); + return null; + }), + fetchLegacyHistoricalData().catch((err) => { + console.error('获取遗留历史数据失败:', err); + return null; + }), + ]); + + if (!tminiData && !usdSpot) { + throw new Error('金价数据获取失败,请检查网络连接'); + } + + // 实时 RMB 数据 + if (tminiData) { + const snap = extractGoldSnapshot(tminiData); + setSnapshot(snap); + setStores(tminiData.stores || []); + setBanks(tminiData.banks || []); + setRecycle(tminiData.recycle || []); + } + + // 实时 USD 数据 + if (usdSpot) { + setSpotUSD(usdSpot.price); + + // 追加本地快照(用USD价格) + const usdPrice = usdSpot.price; + appendHourlySnapshot(usdPrice); + appendDailySnapshot(usdPrice); + updateMonthlySnapshot(usdPrice); + } + + // 遗留月/年历史 + if (legacy) { + setLegacyData(legacy); + } + + // 本地每日快照 (不再依赖外部API) + const daily = getDailySnapshots(); + setHistorical(daily); + + setLastUpdate(new Date().toLocaleTimeString('zh-CN')); + setLoading(false); + + console.log( + `[金价] USD ${usdSpot ? `$${usdSpot.price.toFixed(2)}` : 'N/A'} | ` + + `本地日快照 ${daily.length} 条 (${daily[0]?.date ?? 'N/A'}~${daily[daily.length - 1]?.date ?? 'N/A'}) | ` + + `遗留 ${legacy?.monthly.length ?? 0} 月 / ${legacy?.annual.length ?? 0} 年` + ); + } catch (err) { + const msg = err instanceof Error ? err.message : '加载失败'; + console.error('[金价]', msg); + setError(msg); + setLoading(false); + } + }, []); + + // 首次加载 + useEffect(() => { loadData(); }, [loadData]); + + // 5分钟自动刷新 + useEffect(() => { + const t = setInterval(() => loadData(), REFRESH_INTERVAL); + return () => clearInterval(t); + }, [loadData]); + + // ZTools 高度 + useEffect(() => { + if (isZTools) (window as any).ztools.setExpendHeight?.(620); + }, []); + + // ====== 派生数据 ====== + + /** 日内:近24小时小时快照 */ + const intradayData: HourlySnapshot[] = useMemo( + () => getIntradayData(), + // eslint-disable-next-line react-hooks/exhaustive-deps + [lastUpdate], // 每次刷新重算 + ); + + /** 月度:近30天每日数据,CSV月均价兜底 */ + const last30Days = useMemo(() => { + const daily = getRecentDailyData(historical, 30); + if (daily.length >= 2) return daily; + // 本地日快照不足,用 monthly CSV 最近30个月兜底 + return getRecentMonthlyData(monthlyLegacy, 30); + }, [historical, monthlyLegacy]); + + /** 月度面板:选中月每日走势,CSV月均价兜底 */ + const monthData = useMemo(() => { + const daily = filterMonthData(historical, selectedYear, selectedMonth); + if (daily.length > 0) return daily; + // 本地无日快照,用 monthly CSV 该月均价兜底 + const csvPrice = getMonthAvgFromCsv(monthlyLegacy, selectedYear, selectedMonth); + return csvPrice !== null + ? [{ date: `${selectedYear}-${String(selectedMonth).padStart(2, '0')}`, price: csvPrice }] + : []; + }, [historical, monthlyLegacy, selectedYear, selectedMonth]); + + /** 年度:指定年份12个月数据 (monthly CSV + 本地快照) */ + const yearData: MonthlySnapshot[] = useMemo( + () => buildYearlyData(selectedYear2, monthlyLegacy, historical), + [monthlyLegacy, historical, selectedYear2, lastUpdate], + ); + + /** 历年对比 (最近10年) */ + const yearlyCompare = useMemo( + () => legacyData ? getYearlyComparison(legacyData.annual, 10) : [], + [legacyData], + ); + + // ====== 面板渲染 ====== + + const renderTodayPanel = () => ( +
+ {snapshot && } + {stores.length > 0 && ( +
+

品牌金店饰品

+ [s.brand, s.product || '黄金饰品', s.formatted || `${s.price}${s.unit}`])} + /> +
+ )} + {banks.length > 0 && ( +
+

银行投资金条

+ [b.bank, b.product, b.formatted || `${b.price}${b.unit}`, b.time || '--'])} + /> +
+ )} + {recycle.length > 0 && ( +
+

黄金回收参考价

+ [r.type, r.purity, r.formatted || `${r.price}${r.unit}`])} + /> +
+ )} +
+ ); + + const renderIntradayPanel = () => { + // 日内图数据: 优先用小时快照,没有则用 snapshot OHLC 构造简单4点 + const chartData = intradayData.length >= 2 + ? intradayData.map(x => ({ + time: x.time.slice(11, 16), // HH:MM + price: x.price, + })) + : snapshot + ? [ + { time: '开盘', price: snapshot.openPrice }, + { time: '最低', price: snapshot.lowPrice }, + { time: '最高', price: snapshot.highPrice }, + { time: '当前', price: snapshot.currentPrice }, + ].filter(x => x.price > 0) + : []; + + const hasHourly = intradayData.length >= 2; + + return ( +
+ {/* OHLC 概览卡片 */} + {snapshot && ( +
+
+ 当日 OHLC + {snapshot.unit && 单位: {snapshot.unit}} +
+
+ {[ + { label: '开盘', value: snapshot.openPrice, cls: '' }, + { label: '最高', value: snapshot.highPrice, cls: 'up' }, + { label: '最低', value: snapshot.lowPrice, cls: 'down' }, + { label: '现价', value: snapshot.currentPrice, cls: snapshot.changeAmount >= 0 ? 'up' : 'down' }, + ].map(item => ( +
+ {item.label} + + {item.value > 0 ? item.value.toFixed(2) : '--'} + +
+ ))} +
+ {/* 价格区间条 */} + {snapshot.highPrice > snapshot.lowPrice && ( +
+ {snapshot.lowPrice.toFixed(2)} +
+
+
+ {snapshot.highPrice.toFixed(2)} +
+ )} +
+ 波动幅度 {(snapshot.highPrice - snapshot.lowPrice).toFixed(2)} + 波动率 {(((snapshot.highPrice - snapshot.lowPrice) / (snapshot.lowPrice || 1)) * 100).toFixed(2)}% +
+
+ )} + + {/* 24小时价格走势图 */} + {chartData.length >= 2 && ( +
+

+ {hasHourly ? '近24小时价格走势' : '当日价格区间'} + USD/盎司 +

+ {!hasHourly && ( +

⏳ 数据累积中,每小时记录一个价格点,明天可看完整24小时曲线

+ )} +
+ +
+
+ )} + + {chartData.length < 2 && !snapshot && ( +

暂无日内数据,请稍后刷新

+ )} +
+ ); + }; + + const renderMonthPanel = () => { + // 近30天 vs 当月数据: 用近30天作主图 + const displayData = last30Days.length > 0 ? last30Days : monthData; + + return ( +
+
+

+ 近30天价格走势 + USD/盎司 +

+ {displayData.length > 0 ? ( +
+ +
+ ) : ( +

⏳ 数据累积中,每日记录一个价格点

+ )} +
+ + {/* 统计卡片 */} + {displayData.length > 0 && (() => { + const prices = displayData.map(d => d.price); + const high = Math.max(...prices); + const low = Math.min(...prices); + return ( +
+ {[ + { label: '30日最高', value: high, cls: 'up' }, + { label: '30日最低', value: low, cls: 'down' }, + { label: '30日均价', value: prices.reduce((a, b) => a + b, 0) / prices.length, cls: '' }, + { label: '最大波动', value: high - low, cls: '' }, + ].map(item => ( +
+ {item.label} + ${item.value.toFixed(0)} +
+ ))} +
+ ); + })()} + + {/* 指定月份明细 */} +
+

+ 查看指定月份日线 +
+ + +
+

+ {monthData.length > 0 ? ( +
+ +
+ ) : ( +

该月暂无日线数据

+ )} +
+
+ ); + }; + + const renderYearPanel = () => { + // 优先用 buildYearlyData,没有则提示 + const displayData = yearData; + + return ( +
+
+

+ 年度月线走势 + USD/盎司 (月均) +
+ +
+

+ {displayData.length > 0 ? ( +
+ +
+ ) : ( +

+ {selectedYear2 >= new Date().getFullYear() + ? '⏳ 数据累积中,每月记录一次均价' + : '该年度暂无数据'} +

+ )} +
+ + {/* 年度统计 */} + {displayData.length > 0 && (() => { + const highs = displayData.map(d => d.highPrice); + const lows = displayData.map(d => d.lowPrice); + const avgs = displayData.map(d => d.avgPrice); + return ( +
+ {[ + { label: '年内最高', value: Math.max(...highs), cls: 'up' }, + { label: '年内最低', value: Math.min(...lows), cls: 'down' }, + { label: '年均价格', value: avgs.reduce((a, b) => a + b, 0) / avgs.length, cls: '' }, + { label: '年度波幅', value: Math.max(...highs) - Math.min(...lows), cls: '' }, + ].map(item => ( +
+ {item.label} + ${item.value.toFixed(0)} +
+ ))} +
+ ); + })()} + + {/* + 历年均价对比 + */} + {yearlyCompare.length > 1 && ( +
+

+ 历年均价对比 (最近{yearlyCompare.length}年) + USD/盎司 +

+
+ {yearlyCompare.map(item => { + const maxPrice = Math.max(...yearlyCompare.map(i => i.price)); + const pct = (item.price / maxPrice) * 100; + return ( +
+ {item.year} +
+
+
+ ${item.price.toFixed(0)} +
+ ); + })} +
+
+ )} +
+ ); + }; + + const renderContent = () => { + if (loading && !snapshot) { + return ( +
+
+

加载金价数据...

+
+ ); + } + switch (activeTab) { + case 'today': return renderTodayPanel(); + case 'intraday': return renderIntradayPanel(); + case 'month': return renderMonthPanel(); + case 'year': return renderYearPanel(); + default: return null; + } + }; + + return ( +
+ {/* 顶栏 */} +
+
+

每日金价

+ {lastUpdate && ( + + 更新于 {lastUpdate} + + + )} +
+ +
+ + {error && ( +
+ ⚠️ {error} +
+ )} + + {/* Tab 导航 */} +
+ {TABS.map(tab => ( + + ))} +
+ + {/* 内容区 */} +
+ {renderContent()} +
+ + {/* 底栏 */} +
+ 5分钟自动刷新 +
+
+ ); +} diff --git a/plugins/gold-price-check/src/GoldPrice/services/goldApi.ts b/plugins/gold-price-check/src/GoldPrice/services/goldApi.ts new file mode 100644 index 00000000..f54476a3 --- /dev/null +++ b/plugins/gold-price-check/src/GoldPrice/services/goldApi.ts @@ -0,0 +1,612 @@ +/** + * 金价数据服务层 v5 + * + * 数据源: + * - api.gold-api.com : 实时金价 USD (免费, 无需Key) + * - Tmini API : 实时金价 RMB + 品牌/银行/回收价 (国内) + * - datasets/gold-prices : 月度/年度均价 CSV (2000年起, 6h缓存) + * + * 本地快照机制 (累积真实使用数据): + * - hourlySnapshots : 每小时一条, 最多保留 48 条 → 日内24h走势 + * - dailySnapshots : 每天一条, 最多保留 400 条 → 近30天/月度走势 + * - monthlySnapshots : 每月一条, 最多保留 60 条 → 年度12月走势 + * + * 缓存 TTL: + * - 实时金价 : 5 分钟 + * - 历史 CSV : 6 小时 (源每日更新) + */ + +// ---- 类型定义 ---- + +export interface MetalPrice { + name: string; + sell_price: string; + today_price: string; + high_price: string; + low_price: string; + unit: string; + updated: string; + updated_at: number; +} + +export interface StorePrice { + brand: string; + product: string; + price: string; + unit: string; + formatted: string; + updated: string; + updated_at: number; +} + +export interface BankPrice { + bank: string; + product: string; + price: string; + unit: string; + formatted: string; + time: string; + updated: string; + updated_at: number; +} + +export interface RecyclePrice { + type: string; + price: string; + unit: string; + formatted: string; + purity: string; + updated: string; + updated_at: number; +} + +export interface TminiResponse { + date: string; + metals: MetalPrice[]; + stores: StorePrice[]; + banks: BankPrice[]; + recycle: RecyclePrice[]; +} + +/** 历史每日价格点 (USD/盎司) */ +export interface HistoricalPrice { + date: string; // YYYY-MM-DD + price: number; + source?: string; +} + +/** datasets/gold-prices 月度均价记录 */ +export interface MonthlyGoldRecord { + date: string; // YYYY-MM + price: number; // 月均价 USD +} + +/** datasets/gold-prices 年度均价记录 */ +export interface AnnualGoldRecord { + year: number; + price: number; // 年均价 USD +} + +/** 遗留历史数据 (datasets/gold-prices CSV解析结果) */ +export interface LegacyHistoricalData { + monthly: MonthlyGoldRecord[]; // 1833起月均价, 过滤到2000+ + annual: AnnualGoldRecord[]; // 1833起年均价, 过滤到2000+ +} + +/** 小时级价格快照 (日内波动用) */ +export interface HourlySnapshot { + time: string; // YYYY-MM-DDTHH:00 + price: number; +} + +/** 月度价格快照 (年度波动用) */ +export interface MonthlySnapshot { + month: string; // YYYY-MM + avgPrice: number; + highPrice: number; + lowPrice: number; + count?: number; // 该月累计记录次数,用于正确计算运行均值 +} + +/** 实时金价快照 */ +export interface GoldPriceSnapshot { + currentPrice: number; + openPrice: number; + highPrice: number; + lowPrice: number; + changeAmount: number; + changePercent: number; + name: string; + unit: string; + updatedAt: string; + date: string; +} + +// ---- 缓存 Key ---- +const KEY_TMINI = 'gpc_tmini_v5'; +const KEY_REALTIME = 'gpc_realtime_v5'; +const KEY_LEGACY = 'gpc_legacy_v5'; // datasets/gold-prices CSV +const KEY_HOURLY = 'gpc_hourly_v5'; // 小时快照 +const KEY_DAILY = 'gpc_daily_v5'; // 每日快照 +const KEY_MONTHLY = 'gpc_monthly_v5'; // 月度快照 + +const TTL_REALTIME = 5 * 60 * 1000; // 5 分钟 +const TTL_LEGACY = 6 * 60 * 60 * 1000; // 6 小时 + +// 历史数据起始年份 +const LEGACY_START_YEAR = 2000; + +// ---- API 端点 ---- +const TMINI_API = 'https://tmini.net/api/gold-price?type=json'; +const GOLD_API_SPOT = 'https://api.gold-api.com/price/XAU'; + +// datasets/gold-prices monthly & annual CSV (raw GitHub) +const DATASETS_MONTHLY_URL = 'https://raw.githubusercontent.com/datasets/gold-prices/main/data/monthly.csv'; +const DATASETS_ANNUAL_URL = 'https://raw.githubusercontent.com/datasets/gold-prices/main/data/annual.csv'; + +// ---- 内存缓存 (非 ZTools 环境) ---- +const mem = new Map(); + +const isZTools = typeof window !== 'undefined' && Boolean((window as any).ztools); + +function db() { + return (window as any).ztools?.dbStorage; +} + +// ---- 通用缓存工具 ---- + +function isCacheValid(key: string, ttl: number): boolean { + try { + if (isZTools) { + const ts = db()?.getItem(`${key}_ts`); + return ts ? Date.now() - Number(ts) < ttl : false; + } + const ts = mem.get(`${key}_ts`) as number; + return ts ? Date.now() - ts < ttl : false; + } catch { return false; } +} + +function setCache(key: string, value: unknown): void { + try { + if (isZTools) { + db()?.setItem(key, JSON.stringify(value)); + db()?.setItem(`${key}_ts`, Date.now()); + } else { + mem.set(key, value); + mem.set(`${key}_ts`, Date.now()); + } + } catch { /* ignore */ } +} + +function getCache(key: string): T | null { + try { + if (isZTools) { + const raw = db()?.getItem(key); + return raw ? JSON.parse(raw) as T : null; + } + return (mem.get(key) as T) ?? null; + } catch { return null; } +} + +/** 直接持久化(不依赖TTL,用于快照数组的长期存储)*/ +function persist(key: string, value: unknown): void { + try { + if (isZTools) { + db()?.setItem(key, JSON.stringify(value)); + } else { + mem.set(key, value); + } + } catch { /* ignore */ } +} + +function load(key: string, fallback: T): T { + try { + if (isZTools) { + const raw = db()?.getItem(key); + return raw ? JSON.parse(raw) as T : fallback; + } + return (mem.get(key) as T) ?? fallback; + } catch { return fallback; } +} + +// ---- CSV 解析 ---- + +/** 解析 monthly.csv: Date,Price */ +function parseMonthlyCsv(csv: string): MonthlyGoldRecord[] { + const lines = csv.trim().split('\n'); + const records: MonthlyGoldRecord[] = []; + for (let i = 1; i < lines.length; i++) { + const row = lines[i].split(','); + if (row.length >= 2) { + const date = row[0].trim(); + const price = parseFloat(row[1].trim()); + if (date && !isNaN(price)) { + records.push({ date, price }); + } + } + } + return records + .filter(r => { + const y = parseInt(r.date.substring(0, 4), 10); + return !isNaN(y) && y >= LEGACY_START_YEAR; + }) + .sort((a, b) => a.date.localeCompare(b.date)); +} + +/** 解析 annual.csv: Date,Price */ +function parseAnnualCsv(csv: string): AnnualGoldRecord[] { + const lines = csv.trim().split('\n'); + const records: AnnualGoldRecord[] = []; + for (let i = 1; i < lines.length; i++) { + const row = lines[i].split(','); + if (row.length >= 2) { + const year = parseInt(row[0].trim(), 10); + const price = parseFloat(row[1].trim()); + if (!isNaN(year) && !isNaN(price)) { + records.push({ year, price }); + } + } + } + return records + .filter(r => r.year >= LEGACY_START_YEAR) + .sort((a, b) => a.year - b.year); +} + +/** 从 datasets/gold-prices 获取月度+年度历史数据 (6h缓存) */ +export async function fetchLegacyHistoricalData(): Promise { + if (isCacheValid(KEY_LEGACY, TTL_LEGACY)) { + const c = getCache(KEY_LEGACY); + if (c && c.monthly.length > 0) return c; + } + + const [monthlyResp, annualResp] = await Promise.all([ + fetch(DATASETS_MONTHLY_URL), + fetch(DATASETS_ANNUAL_URL), + ]); + + const [monthlyCsv, annualCsv] = await Promise.all([ + monthlyResp.ok ? monthlyResp.text() : Promise.reject(new Error(`monthly.csv ${monthlyResp.status}`)), + annualResp.ok ? annualResp.text() : Promise.reject(new Error(`annual.csv ${annualResp.status}`)), + ]); + + const data: LegacyHistoricalData = { + monthly: parseMonthlyCsv(monthlyCsv), + annual: parseAnnualCsv(annualCsv), + }; + + setCache(KEY_LEGACY, data); + console.log(`[金价] 遗留历史: ${data.monthly.length}个月 (${data.monthly[0]?.date ?? 'N/A'}~${data.monthly[data.monthly.length - 1]?.date ?? 'N/A'}), ${data.annual.length}年`); + return data; +} + +/** 获取实时金价 USD (gold-api.com, 免费无key) */ +export async function fetchCurrentGoldUSD(): Promise<{ price: number; updatedAt: string }> { + if (isCacheValid(KEY_REALTIME, TTL_REALTIME)) { + const c = getCache<{ price: number; updatedAt: string }>(KEY_REALTIME); + if (c) return c; + } + const resp = await fetch(GOLD_API_SPOT); + if (!resp.ok) throw new Error(`金价API失败: ${resp.status}`); + const data = await resp.json(); + const result = { price: Number(data.price), updatedAt: data.updatedAt ?? new Date().toISOString() }; + setCache(KEY_REALTIME, result); + return result; +} + +/** 获取 Tmini 实时数据 (RMB + 品牌/银行/回收) */ +export async function fetchRealtimeGoldPrice(): Promise { + if (isCacheValid(KEY_TMINI, TTL_REALTIME)) { + const c = getCache(KEY_TMINI); + if (c) return c; + } + const resp = await fetch(TMINI_API); + if (!resp.ok) throw new Error(`Tmini失败: ${resp.status}`); + const data: TminiResponse = await resp.json(); + setCache(KEY_TMINI, data); + return data; +} + +// ---- 快照管理 ---- + +/** 追加小时快照 (日内波动用) — 每小时调用一次 */ +export function appendHourlySnapshot(price: number): void { + const now = new Date(); + // 取整到小时: 2026-07-01T14:00 + const hour = `${now.toISOString().slice(0, 13)}:00`; + + const list = load(KEY_HOURLY, []); + // 去重: 同一小时已有记录则更新 + const idx = list.findIndex(x => x.time === hour); + if (idx >= 0) { + list[idx].price = price; + } else { + list.push({ time: hour, price }); + } + // 保留近 48 小时 + const trimmed = list.slice(-48); + persist(KEY_HOURLY, trimmed); +} + +/** 追加每日快照 (月度/年度波动用) — 每天调用一次 */ +export function appendDailySnapshot(price: number): void { + const today = new Date().toISOString().slice(0, 10); + const list = load(KEY_DAILY, []); + const idx = list.findIndex(x => x.date === today); + if (idx >= 0) { + list[idx].price = price; + } else { + list.push({ date: today, price, source: 'local-daily' }); + } + const trimmed = list.slice(-400); + persist(KEY_DAILY, trimmed); +} + +/** 更新月度快照 — 每次加载时刷新当月数据 */ +export function updateMonthlySnapshot(price: number): void { + const now = new Date(); + const month = now.toISOString().slice(0, 7); // YYYY-MM + + const list = load(KEY_MONTHLY, []); + const idx = list.findIndex(x => x.month === month); + + if (idx >= 0) { + // 用新价格更新当月高低均 + const snap = list[idx]; + const count = snap.count || 1; + snap.highPrice = Math.max(snap.highPrice, price); + snap.lowPrice = Math.min(snap.lowPrice, price); + // 正确的运行均值: (旧均值 × 次数 + 新值) / (次数 + 1) + snap.avgPrice = (snap.avgPrice * count + price) / (count + 1); + snap.count = count + 1; + } else { + list.push({ month, avgPrice: price, highPrice: price, lowPrice: price, count: 1 }); + } + const trimmed = list.slice(-60); + persist(KEY_MONTHLY, trimmed); +} + +// ---- 读取快照 ---- + +/** 获取近24小时价格点(日内波动) */ +export function getIntradayData(): HourlySnapshot[] { + const list = load(KEY_HOURLY, []); + // 只取近24小时 + const cutoff = new Date(Date.now() - 24 * 60 * 60 * 1000).toISOString().slice(0, 13); + return list + .filter(x => x.time.slice(0, 13) >= cutoff) + .sort((a, b) => a.time.localeCompare(b.time)); +} + +/** 读取本地每日快照 (不再依赖FreeGoldAPI) */ +export function getDailySnapshots(): HistoricalPrice[] { + return load(KEY_DAILY, []) + .sort((a, b) => a.date.localeCompare(b.date)); +} + +/** 获取月度快照 (年度波动用) */ +export function getMonthlySnapshots(): MonthlySnapshot[] { + return load(KEY_MONTHLY, []); +} + +// ---- 数据处理工具 ---- + +/** 从 Tmini 数据提取金价快照 */ +export function extractGoldSnapshot(data: TminiResponse): GoldPriceSnapshot | null { + if (!data || !Array.isArray(data.metals)) return null; + let metal = data.metals.find(m => m.name === '今日金价' || m.name === '黄金价格'); + if (!metal) metal = data.metals.find(m => m.name.includes('伦敦金') || m.name.includes('现货')); + if (!metal && data.metals.length > 0) metal = data.metals[0]; + if (!metal) return null; + + const cur = parseFloat(metal.sell_price) || 0; + const open = parseFloat(metal.today_price) || 0; + const high = parseFloat(metal.high_price) || 0; + const low = parseFloat(metal.low_price) || 0; + const change = cur - open; + + return { + currentPrice: cur, + openPrice: open, + highPrice: high, + lowPrice: low, + changeAmount: change, + changePercent: open !== 0 ? (change / open) * 100 : 0, + name: metal.name, + unit: metal.unit, + updatedAt: metal.updated, + date: data.date, + }; +} + +/** 筛选指定月份的日线数据 */ +export function filterMonthData(data: HistoricalPrice[], year: number, month: number) { + const prefix = `${year}-${String(month).padStart(2, '0')}`; + return data + .filter(d => d && d.date && d.date.startsWith(prefix)) + .map(d => ({ date: d.date, price: d.price })) + .sort((a, b) => a.date.localeCompare(b.date)); +} + +/** 获取最近N天的日线数据 */ +export function getRecentDailyData(data: HistoricalPrice[], days: number) { + const validData = data.filter(d => d && d.date); + const sorted = [...validData].sort((a, b) => a.date.localeCompare(b.date)); + return sorted.slice(-days).map(d => ({ date: d.date, price: d.price })); +} + +/** + * 构建年度月线数据: + * 1. 优先用本地 MonthlySnapshot (本年月度高/低更精确) + * 2. 从 monthly CSV 月均价补充历史月份 + * 3. 降级: 从 historicalData (本地每日快照) 聚合 + */ +export function buildYearlyData( + year: number, + monthlyData: MonthlyGoldRecord[], + dailyData: HistoricalPrice[], +): MonthlySnapshot[] { + const localMonthly = getMonthlySnapshots(); + const result: MonthlySnapshot[] = []; + + for (let m = 1; m <= 12; m++) { + const month = `${year}-${String(m).padStart(2, '0')}`; + // 先找本地快照 (有 high/low) + const localSnap = localMonthly.find(x => x.month === month); + if (localSnap) { + result.push(localSnap); + continue; + } + // 从 monthly CSV 获取月均价 + const csvRecord = monthlyData.find(x => x.date === month); + if (csvRecord) { + result.push({ + month, + avgPrice: csvRecord.price, + highPrice: csvRecord.price, + lowPrice: csvRecord.price, + }); + continue; + } + // 降级: 从本地每日快照聚合 + const prefix = `${month}-`; + const monthPrices = dailyData + .filter(d => d && d.date && d.date.startsWith(prefix)) + .map(d => d.price); + if (monthPrices.length > 0) { + result.push({ + month, + avgPrice: monthPrices.reduce((a, b) => a + b, 0) / monthPrices.length, + highPrice: Math.max(...monthPrices), + lowPrice: Math.min(...monthPrices), + }); + } + } + return result; +} + +/** 获取可用年份列表 (monthly CSV + 本地快照) */ +export function getAvailableYears( + monthlyData: MonthlyGoldRecord[], + dailyData: HistoricalPrice[], +): number[] { + const years = new Set(); + // 从 monthly CSV + for (const item of monthlyData) { + if (item && item.date) { + const y = parseInt(item.date.substring(0, 4), 10); + if (!isNaN(y)) years.add(y); + } + } + // 从本地每日快照 + for (const item of dailyData) { + if (item && item.date) { + const y = parseInt(item.date.substring(0, 4), 10); + if (!isNaN(y)) years.add(y); + } + } + // 保证今年始终存在 + years.add(new Date().getFullYear()); + return Array.from(years).sort((a, b) => b - a); +} + +/** 获取指定年份的可用月份 */ +export function getAvailableMonths( + monthlyData: MonthlyGoldRecord[], + dailyData: HistoricalPrice[], + year: number, +): number[] { + const months = new Set(); + const prefix = `${year}-`; + // 从 monthly CSV + for (const item of monthlyData) { + if (item && item.date && item.date.startsWith(prefix)) { + months.add(parseInt(item.date.substring(5, 7), 10)); + } + } + // 从本地每日快照 + for (const item of dailyData) { + if (item && item.date && item.date.startsWith(prefix)) { + months.add(parseInt(item.date.substring(5, 7), 10)); + } + } + if (months.size === 0) months.add(new Date().getMonth() + 1); + return Array.from(months).sort((a, b) => b - a); +} + +// ---- 遗留数据处理工具 ---- + +/** 提取指定年份的月均价列表 (用于年度走势图) */ +export function getMonthlyPricesForYear( + monthlyData: MonthlyGoldRecord[], + year: number, +): { month: string; price: number }[] { + const prefix = `${year}-`; + return monthlyData + .filter(r => r.date.startsWith(prefix)) + .map(r => ({ month: r.date, price: r.price })); +} + +/** 计算年度统计 (从 monthly CSV) */ +export function getYearlyStats(monthlyData: MonthlyGoldRecord[], year: number) { + const prices = monthlyData + .filter(r => r.date.startsWith(`${year}-`)) + .map(r => r.price); + if (prices.length === 0) return null; + return { + year, + avgPrice: prices.reduce((a, b) => a + b, 0) / prices.length, + highPrice: Math.max(...prices), + lowPrice: Math.min(...prices), + months: prices.length, + }; +} + +/** 最近N年对比 (年表均值) */ +export function getYearlyComparison(annualData: AnnualGoldRecord[], n: number) { + return annualData.slice(-n); +} + +/** 从 monthly CSV 获取最近N个月的均价 (用于日线数据不足时兜底) */ +export function getRecentMonthlyData( + monthlyData: MonthlyGoldRecord[], + months: number, +): { date: string; price: number }[] { + return monthlyData + .slice(-months) + .map(r => ({ date: r.date, price: r.price })); +} + +/** 从 monthly CSV 获取指定月份的均价 */ +export function getMonthAvgFromCsv( + monthlyData: MonthlyGoldRecord[], + year: number, + month: number, +): number | null { + const target = `${year}-${String(month).padStart(2, '0')}`; + const record = monthlyData.find(r => r.date === target); + return record ? record.price : null; +} + +// ---- 清除缓存 ---- +export function clearCache(): void { + const keys = [KEY_TMINI, KEY_REALTIME, KEY_LEGACY]; + if (isZTools) { + for (const k of keys) { + try { db()?.removeItem(k); db()?.removeItem(`${k}_ts`); } catch { /* */ } + } + } else { + for (const k of keys) { mem.delete(k); mem.delete(`${k}_ts`); } + } +} + +/** 清除所有快照(调试用)*/ +export function clearAllSnapshots(): void { + const keys = [KEY_HOURLY, KEY_DAILY, KEY_MONTHLY]; + if (isZTools) { + for (const k of keys) { + try { db()?.removeItem(k); } catch { /* */ } + } + } else { + for (const k of keys) mem.delete(k); + } +} diff --git a/plugins/gold-price-check/src/env.d.ts b/plugins/gold-price-check/src/env.d.ts new file mode 100644 index 00000000..1dfca5a3 --- /dev/null +++ b/plugins/gold-price-check/src/env.d.ts @@ -0,0 +1,17 @@ +/// +/// + +// Preload services 类型声明(对应 public/preload/services.js) +interface Services { + readFile: (file: string) => string + writeTextFile: (text: string) => string + writeImageFile: (base64Url: string) => string | undefined +} + +declare global { + interface Window { + services: Services + } +} + +export {} diff --git a/plugins/gold-price-check/src/main.css b/plugins/gold-price-check/src/main.css new file mode 100644 index 00000000..7d5c4ef7 --- /dev/null +++ b/plugins/gold-price-check/src/main.css @@ -0,0 +1,65 @@ +:root { + --blue: rgb(88, 164, 246); + --light: #fff; +} + +html, +body, +#root { + margin: 0; + padding: 0; + height: 100%; +} + +html { + overflow: hidden; +} + +button { + border: none; + background: none var(--blue); + color: var(--light); + line-height: 2.5; + cursor: pointer; + transition: opacity 0.2s; +} + +button:disabled { + filter: grayscale(1); + cursor: not-allowed; +} + +button:not(:disabled):active { + opacity: 0.6; +} + +textarea { + display: block; + margin: 0; +} + +@media (prefers-color-scheme: light) { + body { + background-color: #f4f4f4; + } + ::-webkit-scrollbar-track-piece { + background-color: #f4f4f4; + } + ::-webkit-scrollbar-thumb { + border-color: #f4f4f4; + } +} + +@media (prefers-color-scheme: dark) { + &::-webkit-scrollbar-track-piece { + background-color: #303133; + } + &::-webkit-scrollbar-thumb { + background-color: #666; + border-color: #303133; + } + body { + background-color: #303133; + color: #fff; + } +} diff --git a/plugins/gold-price-check/src/main.tsx b/plugins/gold-price-check/src/main.tsx new file mode 100644 index 00000000..73fb2013 --- /dev/null +++ b/plugins/gold-price-check/src/main.tsx @@ -0,0 +1,6 @@ +import React from 'react' +import ReactDOM from 'react-dom/client' +import './main.css' +import App from './App' + +ReactDOM.createRoot(document.getElementById('root')!).render() diff --git a/plugins/gold-price-check/tsconfig.json b/plugins/gold-price-check/tsconfig.json new file mode 100644 index 00000000..a7cbd05d --- /dev/null +++ b/plugins/gold-price-check/tsconfig.json @@ -0,0 +1,18 @@ +{ + "compilerOptions": { + "target": "ES2020", + "useDefineForClassFields": true, + "lib": ["ES2020", "DOM", "DOM.Iterable"], + "module": "ESNext", + "skipLibCheck": true, + "moduleResolution": "bundler", + "allowImportingTsExtensions": true, + "resolveJsonModule": true, + "isolatedModules": true, + "noEmit": true, + "jsx": "react-jsx", + "strict": true, + "types": ["@ztools-center/ztools-api-types"] + }, + "include": ["src"] +} diff --git a/plugins/gold-price-check/vite.config.js b/plugins/gold-price-check/vite.config.js new file mode 100644 index 00000000..4bef7730 --- /dev/null +++ b/plugins/gold-price-check/vite.config.js @@ -0,0 +1,19 @@ +import react from '@vitejs/plugin-react' +import { defineConfig } from 'vite' + +// https://vitejs.dev/config/ +export default defineConfig({ + plugins: [react()], + base: './', + build: { + rollupOptions: { + output: { + manualChunks(id) { + if (id.includes('node_modules/recharts')) { + return 'recharts'; + } + }, + }, + }, + }, +})