Compare commits

...
10 Commits
Author SHA1 Message Date
yunyingk f64f2b8385 Merge pull request #34 from yunyingk/codex/release-v0.10.7
🧪 CI / 🧪 Test, Type-Check & Build Validation (push) Has been cancelled
🚀 Release / 🚀 Build & Publish GitHub Release (push) Has been cancelled
🚀 Release / 📦 Sync Gitea Mirror (push) Has been cancelled
Release v0.10.7: Local rules workspace, daemon HTTP server, and global stop
2026-09-04 18:09:49 +08:00
gitea cba3098654 docs: document global stop command and shutdown route in changelog 2026-09-04 18:08:13 +08:00
gitea f9b8b06647 Add global seal-use stop command and shutdown HTTP route 2026-09-04 17:58:30 +08:00
gitea 37580dac44 Release v0.10.7: Local rules workspace and daemon HTTP server 2026-09-04 17:54:47 +08:00
gitea f183cc8294 Add persistent HTTP server to background service daemon 2026-09-04 17:53:40 +08:00
gitea 13ed555bbb Add local approval rules workspace and offline linting 2026-09-04 17:45:46 +08:00
yunyingk 39bbf4d7c0 Merge pull request #33 from yunyingk/codex/release-v0.10.6
🧪 CI / 🧪 Test, Type-Check & Build Validation (push) Has been cancelled
🚀 Release / 🚀 Build & Publish GitHub Release (push) Has been cancelled
🚀 Release / 📦 Sync Gitea Mirror (push) Has been cancelled
Release v0.10.6: Webhook material pack import
2026-09-03 15:32:08 +08:00
gitea 64819d86cb Release v0.10.6: Webhook material pack import 2026-09-03 15:30:43 +08:00
yunyingk 4b1833409e Merge pull request #32 from yunyingk/codex/issue-27-webhook-material-pack
Add Webhook material pack import
2026-09-03 15:27:44 +08:00
gitea 77ae7d4dca Add Webhook material pack import 2026-09-03 15:26:43 +08:00
31 changed files with 1853 additions and 157 deletions

No files matched your search

+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "seal-use",
"version": "0.10.5",
"version": "0.10.7",
"description": "Seal Use tenant operations: approval-run diagnosis, minimal rule remediation, delegation links, Hose/合思 authorization, users, rules, billing, and search.",
"author": {
"name": "yingqing"
+21
View File
@@ -5,6 +5,27 @@ All notable changes to `seal-use` will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
## [0.10.7] - 2026-09-04
### Added & Enhanced
- **Local Approval Rules Workspace & Offline Linting**:
- Added `seal-use rules pull` (`seal_approval_rules_pull`) to export remote draft or published version rules to a local JSON file (defaults to `./rules.local.json`), eliminating unwanted mutations to remote drafts.
- Added `seal-use rules lint --file <path>` to execute rule quality and execution checks completely offline with zero network requests and zero dirty version records in the remote backend. Supports quality score gates (`--min-score`) and operates seamlessly even without configured enterprise credentials.
- Added `seal-use rules push` (`seal_approval_rules_push`) to apply refined local rules to the remote draft with preview (`--dry-run`), confirmation (`--yes`), and optional single-step formal release publishing (`--publish`).
- **Persistent HTTP Companion Daemon in Background Service**:
- Embedded the HTTP API server into `seal-use service run`, allowing `seal-use service start` to run as a detached background daemon with persistent HTTP service (serving `/docs`, `/openapi.json`, and `POST /api/cli`).
- Added `seal-use service logs` (`--lines <N>`) to easily inspect service background activity.
- Enhanced `seal-use service status` to track active host, port, and URL via daemon metadata state.
- Optimized `parseJsonBody` and CLI runner concurrency with standing command bypasses to prevent process queue blocks.
- Added top-level `seal-use stop` command, intuitive service aliases (`seal-use service kill|down|shutdown`), and `POST /shutdown` HTTP endpoint to gracefully terminate the background daemon from any terminal or script.
## [0.10.6] - 2026-09-03
### Added & Enhanced
- **Inbound Webhook Material Pack Import (Issue #27)**: Added local preview and push workflows for SealAI material packs, including strict ZIP/XLSX validation, normalized approval-document parsing, attachment upload, and HMAC-signed Webhook delivery.
- **CLI and MCP Support**: Added `seal-use webhook material-pack preview|push` and the `seal_webhook_material_pack` tool, while keeping the existing simulation `material_pack` flow separate.
- **Test-Enterprise Verification**: Verified the new push path against the configured test enterprise with official sample materials; customer enterprise data was not used.
## [0.10.5] - 2026-09-03
### Added & Enhanced
+198 -1
View File
@@ -5,11 +5,16 @@
"": {
"dependencies": {
"@modelcontextprotocol/sdk": "^1.29.0",
"exceljs": "^4.4.0",
"iconv-lite": "^0.7.3",
"ky": "^2.0.2",
"pinyin-pro": "^3.29.3",
"yauzl": "^3.4.0",
"zod": "^4.4.3",
},
"devDependencies": {
"@types/bun": "^1.3.14",
"@types/yauzl": "^3.4.0",
"bun-types": "^1.3.14",
"typescript": "^5.9.3",
"yaml": "^2.9.0",
@@ -17,6 +22,10 @@
},
},
"packages": {
"@fast-csv/format": ["@fast-csv/format@4.3.5", "", { "dependencies": { "@types/node": "^14.0.1", "lodash.escaperegexp": "^4.1.2", "lodash.isboolean": "^3.0.3", "lodash.isequal": "^4.5.0", "lodash.isfunction": "^3.0.9", "lodash.isnil": "^4.0.0" } }, "sha512-8iRn6QF3I8Ak78lNAa+Gdl5MJJBM5vRHivFtMRUWINdevNo00K7OXxS2PshawLKTejVwieIlPmK5YlLu6w4u8A=="],
"@fast-csv/parse": ["@fast-csv/parse@4.3.6", "", { "dependencies": { "@types/node": "^14.0.1", "lodash.escaperegexp": "^4.1.2", "lodash.groupby": "^4.6.0", "lodash.isfunction": "^3.0.9", "lodash.isnil": "^4.0.0", "lodash.isundefined": "^3.0.1", "lodash.uniq": "^4.5.0" } }, "sha512-uRsLYksqpbDmWaSmzvJcuApSEe38+6NQZBUsuAyMZKqHxH0g1wcJgsKUvN3WC8tewaqFjBMMGrkHmC+T7k8LvA=="],
"@hono/node-server": ["@hono/node-server@1.19.14", "", { "peerDependencies": { "hono": "^4" } }, "sha512-GwtvgtXxnWsucXvbQXkRgqksiH2Qed37H9xHZocE5sA3N8O8O8/8FA3uclQXxXVzc9XBZuEOMK7+r02FmSpHtw=="],
"@modelcontextprotocol/sdk": ["@modelcontextprotocol/sdk@1.29.0", "", { "dependencies": { "@hono/node-server": "^1.19.9", "ajv": "^8.17.1", "ajv-formats": "^3.0.1", "content-type": "^1.0.5", "cors": "^2.8.5", "cross-spawn": "^7.0.5", "eventsource": "^3.0.2", "eventsource-parser": "^3.0.0", "express": "^5.2.1", "express-rate-limit": "^8.2.1", "hono": "^4.11.4", "jose": "^6.1.3", "json-schema-typed": "^8.0.2", "pkce-challenge": "^5.0.0", "raw-body": "^3.0.0", "zod": "^3.25 || ^4.0", "zod-to-json-schema": "^3.25.1" }, "peerDependencies": { "@cfworker/json-schema": "^4.1.1" }, "optionalPeers": ["@cfworker/json-schema"] }, "sha512-zo37mZA9hJWpULgkRpowewez1y6ML5GsXJPY8FI0tBBCd77HEvza4jDqRKOXgHNn867PVGCyTdzqpz0izu5ZjQ=="],
@@ -25,14 +34,44 @@
"@types/node": ["@types/node@25.9.1", "", { "dependencies": { "undici-types": ">=7.24.0 <7.24.7" } }, "sha512-xfrlY7UD5rMJk3ZVJP8BNzS28J36YJg+xp+LPXV1TdWxr8uMH5A860QNxYDGQe/ylDSgjxE52Q9VnO7p75tJxg=="],
"@types/yauzl": ["@types/yauzl@3.4.0", "", { "dependencies": { "@types/node": "*" } }, "sha512-NRPn5w6h8dhcnmx3YIRQcqMywY/+nND/uOkJessedcrowO3C0AssHp3tMJpxKAwOhFOo0OV1y9VtsC5hbKKBAw=="],
"accepts": ["accepts@2.0.0", "", { "dependencies": { "mime-types": "^3.0.0", "negotiator": "^1.0.0" } }, "sha512-5cvg6CtKwfgdmVqY1WIiXKc3Q1bkRqGLi+2W/6ao+6Y7gu/RCwRuAhGEzh5B4KlszSuTLgZYuqFqo5bImjNKng=="],
"ajv": ["ajv@8.20.0", "", { "dependencies": { "fast-deep-equal": "^3.1.3", "fast-uri": "^3.0.1", "json-schema-traverse": "^1.0.0", "require-from-string": "^2.0.2" } }, "sha512-Thbli+OlOj+iMPYFBVBfJ3OmCAnaSyNn4M1vz9T6Gka5Jt9ba/HIR56joy65tY6kx/FCF5VXNB819Y7/GUrBGA=="],
"ajv-formats": ["ajv-formats@3.0.1", "", { "dependencies": { "ajv": "^8.0.0" } }, "sha512-8iUql50EUR+uUcdRQ3HDqa6EVyo3docL8g5WJ3FNcWmu62IbkGUue/pEyLBW8VGKKucTPgqeks4fIU1DA4yowQ=="],
"archiver": ["archiver@5.3.2", "", { "dependencies": { "archiver-utils": "^2.1.0", "async": "^3.2.4", "buffer-crc32": "^0.2.1", "readable-stream": "^3.6.0", "readdir-glob": "^1.1.2", "tar-stream": "^2.2.0", "zip-stream": "^4.1.0" } }, "sha512-+25nxyyznAXF7Nef3y0EbBeqmGZgeN/BxHX29Rs39djAfaFalmQ89SE6CWyDCHzGL0yt/ycBtNOmGTW0FyGWNw=="],
"archiver-utils": ["archiver-utils@2.1.0", "", { "dependencies": { "glob": "^7.1.4", "graceful-fs": "^4.2.0", "lazystream": "^1.0.0", "lodash.defaults": "^4.2.0", "lodash.difference": "^4.5.0", "lodash.flatten": "^4.4.0", "lodash.isplainobject": "^4.0.6", "lodash.union": "^4.6.0", "normalize-path": "^3.0.0", "readable-stream": "^2.0.0" } }, "sha512-bEL/yUb/fNNiNTuUz979Z0Yg5L+LzLxGJz8x79lYmR54fmTIb6ob/hNQgkQnIUDWIFjZVQwl9Xs356I6BAMHfw=="],
"async": ["async@3.2.6", "", {}, "sha512-htCUDlxyyCLMgaM3xXg0C0LW2xqfuQ6p05pCEIsXuyQ+a1koYKTuBMzRNwmybfLgvJDMd0r1LTn4+E0Ti6C2AA=="],
"balanced-match": ["balanced-match@1.0.2", "", {}, "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw=="],
"base64-js": ["base64-js@1.5.1", "", {}, "sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA=="],
"big-integer": ["big-integer@1.6.52", "", {}, "sha512-QxD8cf2eVqJOOz63z6JIN9BzvVs/dlySa5HGSBH5xtR8dPteIRQnBxxKqkNTiT6jbDTF6jAfrd4oMcND9RGbQg=="],
"binary": ["binary@0.3.0", "", { "dependencies": { "buffers": "~0.1.1", "chainsaw": "~0.1.0" } }, "sha512-D4H1y5KYwpJgK8wk1Cue5LLPgmwHKYSChkbspQg5JtVuR5ulGckxfR62H3AE9UDkdMC8yyXlqYihuz3Aqg2XZg=="],
"bl": ["bl@4.1.0", "", { "dependencies": { "buffer": "^5.5.0", "inherits": "^2.0.4", "readable-stream": "^3.4.0" } }, "sha512-1W07cM9gS6DcLperZfFSj+bWLtaPGSOHWhPiGzXmvVJbRLdG82sH/Kn8EtW1VqWVA54AKf2h5k5BbnIbwF3h6w=="],
"bluebird": ["bluebird@3.4.7", "", {}, "sha512-iD3898SR7sWVRHbiQv+sHUtHnMvC1o3nW5rAcqnq3uOn07DSAppZYUkIGslDz6gXC7HfunPe7YVBgoEJASPcHA=="],
"body-parser": ["body-parser@2.2.2", "", { "dependencies": { "bytes": "^3.1.2", "content-type": "^1.0.5", "debug": "^4.4.3", "http-errors": "^2.0.0", "iconv-lite": "^0.7.0", "on-finished": "^2.4.1", "qs": "^6.14.1", "raw-body": "^3.0.1", "type-is": "^2.0.1" } }, "sha512-oP5VkATKlNwcgvxi0vM0p/D3n2C3EReYVX+DNYs5TjZFn/oQt2j+4sVJtSMr18pdRr8wjTcBl6LoV+FUwzPmNA=="],
"brace-expansion": ["brace-expansion@2.1.4", "", { "dependencies": { "balanced-match": "^1.0.0" } }, "sha512-hGfVzPxthbf3+2yjg/RBs60cB0FhqBS/zvdV/4wn4/BmN0bNMMHPc4V/BbFieqf1TKAGGAHnY4eSjajCl0f2Xg=="],
"buffer": ["buffer@5.7.1", "", { "dependencies": { "base64-js": "^1.3.1", "ieee754": "^1.1.13" } }, "sha512-EHcyIPBQ4BSGlvjB16k5KgAJ27CIsHY/2JBmCRReo48y9rQ3MaUzWX3KVlBa4U7MyX02HdVj0K7C3WaB3ju7FQ=="],
"buffer-crc32": ["buffer-crc32@0.2.13", "", {}, "sha512-VO9Ht/+p3SN7SKWqcrgEzjGbRSJYTx+Q1pTQC0wrWqHx0vpJraQ6GtHx8tvcg1rlK1byhU5gccxgOgj7B0TDkQ=="],
"buffer-indexof-polyfill": ["buffer-indexof-polyfill@1.0.2", "", {}, "sha512-I7wzHwA3t1/lwXQh+A5PbNvJxgfo5r3xulgpYDB5zckTu/Z9oUK9biouBKQUjEqzaz3HnAT6TYoovmE+GqSf7A=="],
"buffers": ["buffers@0.1.1", "", {}, "sha512-9q/rDEGSb/Qsvv2qvzIzdluL5k7AaJOTrw23z9reQthrbF7is4CtlT0DXyO1oei2DCp4uojjzQ7igaSHp1kAEQ=="],
"bun-types": ["bun-types@1.3.14", "", { "dependencies": { "@types/node": "*" } }, "sha512-4N0ig0fEomHt5R0KCFWjovxow98rIoRwKolrYdCcknNwMekCXRnWEUvgu5soYV8QXtVsrUD8B95MBOZGPvr6KQ=="],
"bytes": ["bytes@3.1.2", "", {}, "sha512-/Nf7TyzTx6S3yRJObOAV7956r8cr2+Oj8AC5dt8wSP3BQAoeX58NoHyCU8P8zGkNXStjTSi6fzO6F0pBdcYbEg=="],
@@ -41,6 +80,12 @@
"call-bound": ["call-bound@1.0.4", "", { "dependencies": { "call-bind-apply-helpers": "^1.0.2", "get-intrinsic": "^1.3.0" } }, "sha512-+ys997U96po4Kx/ABpBCqhA9EuxJaQWDQg7295H4hBphv3IZg0boBKuwYpt4YXp6MZ5AmZQnU/tyMTlRpaSejg=="],
"chainsaw": ["chainsaw@0.1.0", "", { "dependencies": { "traverse": ">=0.3.0 <0.4" } }, "sha512-75kWfWt6MEKNC8xYXIdRpDehRYY/tNSgwKaJq+dbbDcxORuVrrQ+SEHoWsniVn9XPYfP4gmdWIeDk/4YNp1rNQ=="],
"compress-commons": ["compress-commons@4.1.2", "", { "dependencies": { "buffer-crc32": "^0.2.13", "crc32-stream": "^4.0.2", "normalize-path": "^3.0.0", "readable-stream": "^3.6.0" } }, "sha512-D3uMHtGc/fcO1Gt1/L7i1e33VOvD4A9hfQLP+6ewd+BvG/gQ84Yh4oftEhAdjSMgBgwGL+jsppT7JYNpo6MHHg=="],
"concat-map": ["concat-map@0.0.1", "", {}, "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg=="],
"content-disposition": ["content-disposition@1.1.0", "", {}, "sha512-5jRCH9Z/+DRP7rkvY83B+yGIGX96OYdJmzngqnw2SBSxqCFPd0w2km3s5iawpGX8krnwSGmF0FW5Nhr0Hfai3g=="],
"content-type": ["content-type@1.0.5", "", {}, "sha512-nTjqfcBFEipKdXCv4YDQWCfmcLZKm81ldF0pAopTvyrFGVbcR6P/VAAd5G7N+0tTr8QqiU0tFadD6FK4NtJwOA=="],
@@ -49,20 +94,32 @@
"cookie-signature": ["cookie-signature@1.2.2", "", {}, "sha512-D76uU73ulSXrD1UXF4KE2TMxVVwhsnCgfAyTg9k8P6KGZjlXKrOLe4dJQKI3Bxi5wjesZoFXJWElNWBjPZMbhg=="],
"core-util-is": ["core-util-is@1.0.3", "", {}, "sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ=="],
"cors": ["cors@2.8.6", "", { "dependencies": { "object-assign": "^4", "vary": "^1" } }, "sha512-tJtZBBHA6vjIAaF6EnIaq6laBBP9aq/Y3ouVJjEfoHbRBcHBAHYcMh/w8LDrk2PvIMMq8gmopa5D4V8RmbrxGw=="],
"crc-32": ["crc-32@1.2.2", "", { "bin": { "crc32": "bin/crc32.njs" } }, "sha512-ROmzCKrTnOwybPcJApAA6WBWij23HVfGVNKqqrZpuyZOHqK2CwHSvpGuyt/UNNvaIjEd8X5IFGp4Mh+Ie1IHJQ=="],
"crc32-stream": ["crc32-stream@4.0.3", "", { "dependencies": { "crc-32": "^1.2.0", "readable-stream": "^3.4.0" } }, "sha512-NT7w2JVU7DFroFdYkeq8cywxrgjPHWkdX1wjpRQXPX5Asews3tA+Ght6lddQO5Mkumffp3X7GEqku3epj2toIw=="],
"cross-spawn": ["cross-spawn@7.0.6", "", { "dependencies": { "path-key": "^3.1.0", "shebang-command": "^2.0.0", "which": "^2.0.1" } }, "sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA=="],
"dayjs": ["dayjs@1.11.23", "", {}, "sha512-QDTCU0M0MxR3hQfnlDJfwekQiaanm1ubOD231u73WBckQ/fsamwRLiE2GBz6D3a/xF1NgfiDLJjXBa1hYOYTtQ=="],
"debug": ["debug@4.4.3", "", { "dependencies": { "ms": "^2.1.3" } }, "sha512-RGwwWnwQvkVfavKVt22FGLw+xYSdzARwm0ru6DhTVA3umU5hZc28V3kO4stgYryrTlLpuvgI9GiijltAjNbcqA=="],
"depd": ["depd@2.0.0", "", {}, "sha512-g7nH6P6dyDioJogAAGprGpCtVImJhpPk/roCzdb3fIh61/s/nPsfR6onyMwkCAR/OlC3yBC0lESvUoQEAssIrw=="],
"dunder-proto": ["dunder-proto@1.0.1", "", { "dependencies": { "call-bind-apply-helpers": "^1.0.1", "es-errors": "^1.3.0", "gopd": "^1.2.0" } }, "sha512-KIN/nDJBQRcXw0MLVhZE9iQHmG68qAVIBg9CqmUYjmQIhgij9U5MFvrqkUL5FbtyyzZuOeOt0zdeRe4UY7ct+A=="],
"duplexer2": ["duplexer2@0.1.4", "", { "dependencies": { "readable-stream": "^2.0.2" } }, "sha512-asLFVfWWtJ90ZyOUHMqk7/S2w2guQKxUI2itj3d92ADHhxUSbCMGi1f1cBcJ7xM1To+pE/Khbwo1yuNbMEPKeA=="],
"ee-first": ["ee-first@1.1.1", "", {}, "sha512-WMwm9LhRUo+WUaRN+vRuETqG89IgZphVSNkdFgeb6sS/E4OrDIN7t48CAewSHXc6C8lefD8KKfr5vY61brQlow=="],
"encodeurl": ["encodeurl@2.0.0", "", {}, "sha512-Q0n9HRi4m6JuGIV1eFlmvJB7ZEVxu93IrMyiMsGC0lrMJMWzRgx6WGquyfQgZVb31vhGgXnfmPNNXmxnOkRBrg=="],
"end-of-stream": ["end-of-stream@1.4.5", "", { "dependencies": { "once": "^1.4.0" } }, "sha512-ooEGc6HP26xXq/N+GCGOT0JKCLDGrq2bQUZrQ7gyrJiZANJ/8YDTxTpQBXGMn+WbIQXNVpyWymm7KYVICQnyOg=="],
"es-define-property": ["es-define-property@1.0.1", "", {}, "sha512-e3nRfgfUZ4rNGL232gUgX06QNyyez04KdjFrF+LTRoOXmrOgFKDg4BCdsjW8EnT69eqdYGmRpJwiPVYNrCaW3g=="],
"es-errors": ["es-errors@1.3.0", "", {}, "sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw=="],
@@ -77,10 +134,14 @@
"eventsource-parser": ["eventsource-parser@3.1.0", "", {}, "sha512-kJezFj9YFAMLeORyi7aCLxLbD5/qWMQnoMVlVPyHIll7lgRJCc3JVln9Vgl9nwQi0YkMnhdGTMNn7CkRRAptMg=="],
"exceljs": ["exceljs@4.4.0", "", { "dependencies": { "archiver": "^5.0.0", "dayjs": "^1.8.34", "fast-csv": "^4.3.1", "jszip": "^3.10.1", "readable-stream": "^3.6.0", "saxes": "^5.0.1", "tmp": "^0.2.0", "unzipper": "^0.10.11", "uuid": "^8.3.0" } }, "sha512-XctvKaEMaj1Ii9oDOqbW/6e1gXknSY4g/aLCDicOXqBE4M0nRWkUu0PTp++UPNzoFY12BNHMfs/VadKIS6llvg=="],
"express": ["express@5.2.1", "", { "dependencies": { "accepts": "^2.0.0", "body-parser": "^2.2.1", "content-disposition": "^1.0.0", "content-type": "^1.0.5", "cookie": "^0.7.1", "cookie-signature": "^1.2.1", "debug": "^4.4.0", "depd": "^2.0.0", "encodeurl": "^2.0.0", "escape-html": "^1.0.3", "etag": "^1.8.1", "finalhandler": "^2.1.0", "fresh": "^2.0.0", "http-errors": "^2.0.0", "merge-descriptors": "^2.0.0", "mime-types": "^3.0.0", "on-finished": "^2.4.1", "once": "^1.4.0", "parseurl": "^1.3.3", "proxy-addr": "^2.0.7", "qs": "^6.14.0", "range-parser": "^1.2.1", "router": "^2.2.0", "send": "^1.1.0", "serve-static": "^2.2.0", "statuses": "^2.0.1", "type-is": "^2.0.1", "vary": "^1.1.2" } }, "sha512-hIS4idWWai69NezIdRt2xFVofaF4j+6INOpJlVOLDO8zXGpUVEVzIYk12UUi2JzjEzWL3IOAxcTubgz9Po0yXw=="],
"express-rate-limit": ["express-rate-limit@8.5.2", "", { "dependencies": { "ip-address": "^10.2.0" }, "peerDependencies": { "express": ">= 4.11" } }, "sha512-5Kb34ipNX694DH48vN9irak1Qx30nb0PLYHXfJgw4YEjiC3ZEmZJhwOp+VfiCYwFzvFTdB9QkArYS5kXa2cx2A=="],
"fast-csv": ["fast-csv@4.3.6", "", { "dependencies": { "@fast-csv/format": "4.3.5", "@fast-csv/parse": "4.3.6" } }, "sha512-2RNSpuwwsJGP0frGsOmTb9oUF+VkFSM4SyLTDgwf2ciHWTarN0lQTC+F2f/t5J9QjW+c65VFIAAu85GsvMIusw=="],
"fast-deep-equal": ["fast-deep-equal@3.1.3", "", {}, "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q=="],
"fast-uri": ["fast-uri@3.1.2", "", {}, "sha512-rVjf7ArG3LTk+FS6Yw81V1DLuZl1bRbNrev6Tmd/9RaroeeRRJhAt7jg/6YFxbvAQXUCavSoZhPPj6oOx+5KjQ=="],
@@ -91,14 +152,24 @@
"fresh": ["fresh@2.0.0", "", {}, "sha512-Rx/WycZ60HOaqLKAi6cHRKKI7zxWbJ31MhntmtwMoaTeF7XFH9hhBp8vITaMidfljRQ6eYWCKkaTK+ykVJHP2A=="],
"fs-constants": ["fs-constants@1.0.0", "", {}, "sha512-y6OAwoSIf7FyjMIv94u+b5rdheZEjzR63GTyZJm5qh4Bi+2YgwLCcI/fPFZkL5PSixOt6ZNKm+w+Hfp/Bciwow=="],
"fs.realpath": ["fs.realpath@1.0.0", "", {}, "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw=="],
"fstream": ["fstream@1.0.12", "", { "dependencies": { "graceful-fs": "^4.1.2", "inherits": "~2.0.0", "mkdirp": ">=0.5 0", "rimraf": "2" } }, "sha512-WvJ193OHa0GHPEL+AycEJgxvBEwyfRkN1vhjca23OaPVMCaLCXTd5qAu82AjTcgP1UJmytkOKb63Ypde7raDIg=="],
"function-bind": ["function-bind@1.1.2", "", {}, "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA=="],
"get-intrinsic": ["get-intrinsic@1.3.0", "", { "dependencies": { "call-bind-apply-helpers": "^1.0.2", "es-define-property": "^1.0.1", "es-errors": "^1.3.0", "es-object-atoms": "^1.1.1", "function-bind": "^1.1.2", "get-proto": "^1.0.1", "gopd": "^1.2.0", "has-symbols": "^1.1.0", "hasown": "^2.0.2", "math-intrinsics": "^1.1.0" } }, "sha512-9fSjSaos/fRIVIp+xSJlE6lfwhES7LNtKaCBIamHsjr2na1BiABJPo0mOjjz8GJDURarmCPGqaiVg5mfjb98CQ=="],
"get-proto": ["get-proto@1.0.1", "", { "dependencies": { "dunder-proto": "^1.0.1", "es-object-atoms": "^1.0.0" } }, "sha512-sTSfBjoXBp89JvIKIefqw7U2CCebsc74kiY6awiGogKtoSGbgjYE/G/+l9sF3MWFPNc9IcoOC4ODfKHfxFmp0g=="],
"glob": ["glob@7.2.3", "", { "dependencies": { "fs.realpath": "^1.0.0", "inflight": "^1.0.4", "inherits": "2", "minimatch": "^3.1.1", "once": "^1.3.0", "path-is-absolute": "^1.0.0" } }, "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q=="],
"gopd": ["gopd@1.2.0", "", {}, "sha512-ZUKRh6/kUFoAiTAtTYPZJ3hw9wNxx+BIBOijnlG9PnrJsCcSjs1wyyD6vJpaYtgnzDrKYRSqf3OO6Rfa93xsRg=="],
"graceful-fs": ["graceful-fs@4.2.11", "", {}, "sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ=="],
"has-symbols": ["has-symbols@1.1.0", "", {}, "sha512-1cDNdwJ2Jaohmb3sg4OmKaMBwuC48sYni5HUw2DvsC8LjGTLK9h+eb1X6RyuOHe4hT0ULCW68iomhjUoKUqlPQ=="],
"hasown": ["hasown@2.0.4", "", { "dependencies": { "function-bind": "^1.1.2" } }, "sha512-T2UbfbBEF32wiepXIsMlTW9+dDYC6wMh/t/vYA4tuOMKqWz/n3vr1NFSxQiyP+zk2mXsoMA/i/7qV6LKut1t1A=="],
@@ -107,7 +178,13 @@
"http-errors": ["http-errors@2.0.1", "", { "dependencies": { "depd": "~2.0.0", "inherits": "~2.0.4", "setprototypeof": "~1.2.0", "statuses": "~2.0.2", "toidentifier": "~1.0.1" } }, "sha512-4FbRdAX+bSdmo4AUFuS0WNiPz8NgFt+r8ThgNWmlrjQjt1Q7ZR9+zTlce2859x4KSXrwIsaeTqDoKQmtP8pLmQ=="],
"iconv-lite": ["iconv-lite@0.7.2", "", { "dependencies": { "safer-buffer": ">= 2.1.2 < 3.0.0" } }, "sha512-im9DjEDQ55s9fL4EYzOAv0yMqmMBSZp6G0VvFyTMPKWxiSBHUj9NW/qqLmXUwXrrM7AvqSlTCfvqRb0cM8yYqw=="],
"iconv-lite": ["iconv-lite@0.7.3", "", { "dependencies": { "safer-buffer": ">= 2.1.2 < 3.0.0" } }, "sha512-IKXpvIzjnC9XTAUbVBcMfGS0EPaIXtW6v+zr+RRp+hqULEpo0owZax6wyRwPOJbWbzjYspQwusTsfVr0ifh4uQ=="],
"ieee754": ["ieee754@1.2.1", "", {}, "sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA=="],
"immediate": ["immediate@3.0.6", "", {}, "sha512-XXOFtyqDjNDAQxVfYxuF7g9Il/IbWmmlQg2MYKOH8ExIT1qg6xc4zyS3HaEEATgs1btfzxq15ciUiY7gjSXRGQ=="],
"inflight": ["inflight@1.0.6", "", { "dependencies": { "once": "^1.3.0", "wrappy": "1" } }, "sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA=="],
"inherits": ["inherits@2.0.4", "", {}, "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ=="],
@@ -117,6 +194,8 @@
"is-promise": ["is-promise@4.0.0", "", {}, "sha512-hvpoI6korhJMnej285dSg6nu1+e6uxs7zG3BYAm5byqDsgJNWwxzM6z6iZiAgQR4TJ30JmBTOwqZUw3WlyH3AQ=="],
"isarray": ["isarray@1.0.0", "", {}, "sha512-VLghIWNM6ELQzo7zwmcg0NmTVyWKYjvIeM83yjp0wRDTmUnrM678fQbcKBo6n2CJEF0szoG//ytg+TKla89ALQ=="],
"isexe": ["isexe@2.0.0", "", {}, "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw=="],
"jose": ["jose@6.2.3", "", {}, "sha512-YYVDInQKFJfR/xa3ojUTl8c2KoTwiL1R5Wg9YCydwH0x0B9grbzlg5HC7mMjCtUJjbQ/YnGEZIhI5tCgfTb4Hw=="],
@@ -125,8 +204,42 @@
"json-schema-typed": ["json-schema-typed@8.0.2", "", {}, "sha512-fQhoXdcvc3V28x7C7BMs4P5+kNlgUURe2jmUT1T//oBRMDrqy1QPelJimwZGo7Hg9VPV3EQV5Bnq4hbFy2vetA=="],
"jszip": ["jszip@3.10.1", "", { "dependencies": { "lie": "~3.3.0", "pako": "~1.0.2", "readable-stream": "~2.3.6", "setimmediate": "^1.0.5" } }, "sha512-xXDvecyTpGLrqFrvkrUSoxxfJI5AH7U8zxxtVclpsUtMCq4JQ290LY8AW5c7Ggnr/Y/oK+bQMbqK2qmtk3pN4g=="],
"ky": ["ky@2.0.2", "", {}, "sha512-/GmXpo9F9W+f8n4Ivr2iH+7h7wL7jLbLKWkMlpflcCRb6kGjBfTlASEXaZ9qUgNTn4VgS0P2pwxxzQ4EM6Ulgg=="],
"lazystream": ["lazystream@1.0.1", "", { "dependencies": { "readable-stream": "^2.0.5" } }, "sha512-b94GiNHQNy6JNTrt5w6zNyffMrNkXZb3KTkCZJb2V1xaEGCk093vkZ2jk3tpaeP33/OiXC+WvK9AxUebnf5nbw=="],
"lie": ["lie@3.3.0", "", { "dependencies": { "immediate": "~3.0.5" } }, "sha512-UaiMJzeWRlEujzAuw5LokY1L5ecNQYZKfmyZ9L7wDHb/p5etKaxXhohBcrw0EYby+G/NA52vRSN4N39dxHAIwQ=="],
"listenercount": ["listenercount@1.0.1", "", {}, "sha512-3mk/Zag0+IJxeDrxSgaDPy4zZ3w05PRZeJNnlWhzFz5OkX49J4krc+A8X2d2M69vGMBEX0uyl8M+W+8gH+kBqQ=="],
"lodash.defaults": ["lodash.defaults@4.2.0", "", {}, "sha512-qjxPLHd3r5DnsdGacqOMU6pb/avJzdh9tFX2ymgoZE27BmjXrNy/y4LoaiTeAb+O3gL8AfpJGtqfX/ae2leYYQ=="],
"lodash.difference": ["lodash.difference@4.5.0", "", {}, "sha512-dS2j+W26TQ7taQBGN8Lbbq04ssV3emRw4NY58WErlTO29pIqS0HmoT5aJ9+TUQ1N3G+JOZSji4eugsWwGp9yPA=="],
"lodash.escaperegexp": ["lodash.escaperegexp@4.1.2", "", {}, "sha512-TM9YBvyC84ZxE3rgfefxUWiQKLilstD6k7PTGt6wfbtXF8ixIJLOL3VYyV/z+ZiPLsVxAsKAFVwWlWeb2Y8Yyw=="],
"lodash.flatten": ["lodash.flatten@4.4.0", "", {}, "sha512-C5N2Z3DgnnKr0LOpv/hKCgKdb7ZZwafIrsesve6lmzvZIRZRGaZ/l6Q8+2W7NaT+ZwO3fFlSCzCzrDCFdJfZ4g=="],
"lodash.groupby": ["lodash.groupby@4.6.0", "", {}, "sha512-5dcWxm23+VAoz+awKmBaiBvzox8+RqMgFhi7UvX9DHZr2HdxHXM/Wrf8cfKpsW37RNrvtPn6hSwNqurSILbmJw=="],
"lodash.isboolean": ["lodash.isboolean@3.0.3", "", {}, "sha512-Bz5mupy2SVbPHURB98VAcw+aHh4vRV5IPNhILUCsOzRmsTmSQ17jIuqopAentWoehktxGd9e/hbIXq980/1QJg=="],
"lodash.isequal": ["lodash.isequal@4.5.0", "", {}, "sha512-pDo3lu8Jhfjqls6GkMgpahsF9kCyayhgykjyLMNFTKWrpVdAQtYyB4muAMWozBB4ig/dtWAmsMxLEI8wuz+DYQ=="],
"lodash.isfunction": ["lodash.isfunction@3.0.9", "", {}, "sha512-AirXNj15uRIMMPihnkInB4i3NHeb4iBtNg9WRWuK2o31S+ePwwNmDPaTL3o7dTJ+VXNZim7rFs4rxN4YU1oUJw=="],
"lodash.isnil": ["lodash.isnil@4.0.0", "", {}, "sha512-up2Mzq3545mwVnMhTDMdfoG1OurpA/s5t88JmQX809eH3C8491iu2sfKhTfhQtKY78oPNhiaHJUpT/dUDAAtng=="],
"lodash.isplainobject": ["lodash.isplainobject@4.0.6", "", {}, "sha512-oSXzaWypCMHkPC3NvBEaPHf0KsA5mvPrOPgQWDsbg8n7orZ290M0BmC/jgRZ4vcJ6DTAhjrsSYgdsW/F+MFOBA=="],
"lodash.isundefined": ["lodash.isundefined@3.0.1", "", {}, "sha512-MXB1is3s899/cD8jheYYE2V9qTHwKvt+npCwpD+1Sxm3Q3cECXCiYHjeHWXNwr6Q0SOBPrYUDxendrO6goVTEA=="],
"lodash.union": ["lodash.union@4.6.0", "", {}, "sha512-c4pB2CdGrGdjMKYLA+XiRDO7Y0PRQbm/Gzg8qMj+QH+pFVAoTp5sBpO0odL3FjoPCGjK96p6qsP+yQoiLoOBcw=="],
"lodash.uniq": ["lodash.uniq@4.5.0", "", {}, "sha512-xfBaXQd9ryd9dlSDvnvI0lvxfLJlYAZzXomUYzLKtUeOQvOP5piqAWuGtrhWeqaXK9hhoM/iyJc5AV+XfsX3HQ=="],
"math-intrinsics": ["math-intrinsics@1.1.0", "", {}, "sha512-/IXtbwEk5HTPyEwyKX6hGkYXxM9nbj64B+ilVJnC/R6B0pH5G4V3b0pVbL7DBj4tkhBAppbQUlf6F6Xl9LHu1g=="],
"media-typer": ["media-typer@1.1.0", "", {}, "sha512-aisnrDP4GNe06UcKFnV5bfMNPBUw4jsLGaWwWfnH3v02GnBuXX2MCVn5RbrWo0j3pczUilYblq7fQ7Nw2t5XKw=="],
@@ -137,10 +250,16 @@
"mime-types": ["mime-types@3.0.2", "", { "dependencies": { "mime-db": "^1.54.0" } }, "sha512-Lbgzdk0h4juoQ9fCKXW4by0UJqj+nOOrI9MJ1sSj4nI8aI2eo1qmvQEie4VD1glsS250n15LsWsYtCugiStS5A=="],
"minimatch": ["minimatch@5.1.9", "", { "dependencies": { "brace-expansion": "^2.0.1" } }, "sha512-7o1wEA2RyMP7Iu7GNba9vc0RWWGACJOCZBJX2GJWip0ikV+wcOsgVuY9uE8CPiyQhkGFSlhuSkZPavN7u1c2Fw=="],
"mkdirp": ["mkdirp@3.0.1", "", { "bin": { "mkdirp": "dist/cjs/src/bin.js" } }, "sha512-+NsyUUAZDmo6YVHzL/stxSu3t9YS1iljliy3BSDrXJ/dkn1KYdmtZODGGjLcc9XLgVVpH4KshHB8XmZgMhaBXg=="],
"ms": ["ms@2.1.3", "", {}, "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA=="],
"negotiator": ["negotiator@1.0.0", "", {}, "sha512-8Ofs/AUQh8MaEcrlq5xOX0CQ9ypTF5dl78mjlMNfOK08fzpgTHQRQPBxcPlEtIw0yRpws+Zo/3r+5WRby7u3Gg=="],
"normalize-path": ["normalize-path@3.0.0", "", {}, "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA=="],
"object-assign": ["object-assign@4.1.1", "", {}, "sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg=="],
"object-inspect": ["object-inspect@1.13.4", "", {}, "sha512-W67iLl4J2EXEGTbfeHCffrjDfitvLANg0UlX3wFUUSTx92KXRFegMHUVgSqE+wvhAbi4WqjGg9czysTV2Epbew=="],
@@ -149,14 +268,24 @@
"once": ["once@1.4.0", "", { "dependencies": { "wrappy": "1" } }, "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w=="],
"pako": ["pako@1.0.11", "", {}, "sha512-4hLB8Py4zZce5s4yd9XzopqwVv/yGNhV1Bl8NTmCq1763HeK2+EwVTv+leGeL13Dnh2wfbqowVPXCIO0z4taYw=="],
"parseurl": ["parseurl@1.3.3", "", {}, "sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ=="],
"path-is-absolute": ["path-is-absolute@1.0.1", "", {}, "sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg=="],
"path-key": ["path-key@3.1.1", "", {}, "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q=="],
"path-to-regexp": ["path-to-regexp@8.4.2", "", {}, "sha512-qRcuIdP69NPm4qbACK+aDogI5CBDMi1jKe0ry5rSQJz8JVLsC7jV8XpiJjGRLLol3N+R5ihGYcrPLTno6pAdBA=="],
"pend": ["pend@1.2.0", "", {}, "sha512-F3asv42UuXchdzt+xXqfW1OGlVBe+mxa2mqI0pg5yAHZPvFmY3Y6drSf/GQ1A86WgWEN9Kzh/WrgKa6iGcHXLg=="],
"pinyin-pro": ["pinyin-pro@3.29.3", "", {}, "sha512-+UU9bx6vfDw8amOJGHm0TE0rdQl8VPylsDWviQ5OOQ3e+on1xRP4OqDbiDuMT5OISgvfl/Y6ez1BBRaIP80GLQ=="],
"pkce-challenge": ["pkce-challenge@5.0.1", "", {}, "sha512-wQ0b/W4Fr01qtpHlqSqspcj3EhBvimsdh0KlHhH8HRZnMsEa0ea2fTULOXOS9ccQr3om+GcGRk4e+isrZWV8qQ=="],
"process-nextick-args": ["process-nextick-args@2.0.1", "", {}, "sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag=="],
"proxy-addr": ["proxy-addr@2.0.7", "", { "dependencies": { "forwarded": "0.2.0", "ipaddr.js": "1.9.1" } }, "sha512-llQsMLSUDUPT44jdrU/O37qlnifitDP+ZwrmmZcoSKyLKvtZxpyV0n2/bD/N4tBAAZ/gJEdZU7KMraoK1+XYAg=="],
"qs": ["qs@6.15.2", "", { "dependencies": { "side-channel": "^1.1.0" } }, "sha512-Rzq0KEyX/w/tEybncDgdkZrJgVUsUMk3xjh3t5bv3S1HTAtg+uOYt72+ZfwiQwKdysThkTBdL/rTi6HDmX9Ddw=="],
@@ -165,16 +294,28 @@
"raw-body": ["raw-body@3.0.2", "", { "dependencies": { "bytes": "~3.1.2", "http-errors": "~2.0.1", "iconv-lite": "~0.7.0", "unpipe": "~1.0.0" } }, "sha512-K5zQjDllxWkf7Z5xJdV0/B0WTNqx6vxG70zJE4N0kBs4LovmEYWJzQGxC9bS9RAKu3bgM40lrd5zoLJ12MQ5BA=="],
"readable-stream": ["readable-stream@3.6.2", "", { "dependencies": { "inherits": "^2.0.3", "string_decoder": "^1.1.1", "util-deprecate": "^1.0.1" } }, "sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA=="],
"readdir-glob": ["readdir-glob@1.1.3", "", { "dependencies": { "minimatch": "^5.1.0" } }, "sha512-v05I2k7xN8zXvPD9N+z/uhXPaj0sUFCe2rcWZIpBsqxfP7xXFQ0tipAd/wjj1YxWyWtUS5IDJpOG82JKt2EAVA=="],
"require-from-string": ["require-from-string@2.0.2", "", {}, "sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw=="],
"rimraf": ["rimraf@2.7.1", "", { "dependencies": { "glob": "^7.1.3" }, "bin": { "rimraf": "./bin.js" } }, "sha512-uWjbaKIK3T1OSVptzX7Nl6PvQ3qAGtKEtVRjRuazjfL3Bx5eI409VZSqgND+4UNnmzLVdPj9FqFJNPqBZFve4w=="],
"router": ["router@2.2.0", "", { "dependencies": { "debug": "^4.4.0", "depd": "^2.0.0", "is-promise": "^4.0.0", "parseurl": "^1.3.3", "path-to-regexp": "^8.0.0" } }, "sha512-nLTrUKm2UyiL7rlhapu/Zl45FwNgkZGaCpZbIHajDYgwlJCOzLSk+cIPAnsEqV955GjILJnKbdQC1nVPz+gAYQ=="],
"safe-buffer": ["safe-buffer@5.1.2", "", {}, "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g=="],
"safer-buffer": ["safer-buffer@2.1.2", "", {}, "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg=="],
"saxes": ["saxes@5.0.1", "", { "dependencies": { "xmlchars": "^2.2.0" } }, "sha512-5LBh1Tls8c9xgGjw3QrMwETmTMVk0oFgvrFSvWx62llR2hcEInrKNZ2GZCCuuy2lvWrdl5jhbpeqc5hRYKFOcw=="],
"send": ["send@1.2.1", "", { "dependencies": { "debug": "^4.4.3", "encodeurl": "^2.0.0", "escape-html": "^1.0.3", "etag": "^1.8.1", "fresh": "^2.0.0", "http-errors": "^2.0.1", "mime-types": "^3.0.2", "ms": "^2.1.3", "on-finished": "^2.4.1", "range-parser": "^1.2.1", "statuses": "^2.0.2" } }, "sha512-1gnZf7DFcoIcajTjTwjwuDjzuz4PPcY2StKPlsGAQ1+YH20IRVrBaXSWmdjowTJ6u8Rc01PoYOGHXfP1mYcZNQ=="],
"serve-static": ["serve-static@2.2.1", "", { "dependencies": { "encodeurl": "^2.0.0", "escape-html": "^1.0.3", "parseurl": "^1.3.3", "send": "^1.2.0" } }, "sha512-xRXBn0pPqQTVQiC8wyQrKs2MOlX24zQ0POGaj0kultvoOCstBQM5yvOhAVSUwOMjQtTvsPWoNCHfPGwaaQJhTw=="],
"setimmediate": ["setimmediate@1.0.5", "", {}, "sha512-MATJdZp8sLqDl/68LfQmbP8zKPLQNV6BIZoIgrscFDQ+RsvK/BxeDQOgyxKKoh0y/8h3BqVFnCqQ/gd+reiIXA=="],
"setprototypeof": ["setprototypeof@1.2.0", "", {}, "sha512-E5LDX7Wrp85Kil5bhZv46j8jOeboKq5JMmYM3gVGdGH8xFpPWXUMsNrlODCrkoxMEeNi/XZIwuRvY4XNwYMJpw=="],
"shebang-command": ["shebang-command@2.0.0", "", { "dependencies": { "shebang-regex": "^3.0.0" } }, "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA=="],
@@ -191,8 +332,16 @@
"statuses": ["statuses@2.0.2", "", {}, "sha512-DvEy55V3DB7uknRo+4iOGT5fP1slR8wQohVdknigZPMpMstaKJQWhwiYBACJE3Ul2pTnATihhBYnRhZQHGBiRw=="],
"string_decoder": ["string_decoder@1.3.0", "", { "dependencies": { "safe-buffer": "~5.2.0" } }, "sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA=="],
"tar-stream": ["tar-stream@2.2.0", "", { "dependencies": { "bl": "^4.0.3", "end-of-stream": "^1.4.1", "fs-constants": "^1.0.0", "inherits": "^2.0.3", "readable-stream": "^3.1.1" } }, "sha512-ujeqbceABgwMZxEJnk2HDY2DlnUZ+9oEcb1KzTVfYHio0UE6dG71n60d8D2I4qNvleWrrXpmjpt7vZeF1LnMZQ=="],
"tmp": ["tmp@0.2.7", "", {}, "sha512-e0votIpp4Uo2AJYSzVHV6xCcawuiez3DzqDAbrTc3YxBkplN6e+dM13ZeIcZnDg/QpSuU2zfZ3rzwY8ukEnaXw=="],
"toidentifier": ["toidentifier@1.0.1", "", {}, "sha512-o5sSPKEkg/DIQNmH43V0/uerLrpzVedkUh8tGNvaeXpfpuwjKenlSox/2O/BTlZUtEe+JG7s5YhEz608PlAHRA=="],
"traverse": ["traverse@0.3.9", "", {}, "sha512-iawgk0hLP3SxGKDfnDJf8wTz4p2qImnyihM5Hh/sGvQ3K37dPi/w8sRhdNIxYA1TwFwc5mDhIJq+O0RsvXBKdQ=="],
"type-is": ["type-is@2.1.0", "", { "dependencies": { "content-type": "^2.0.0", "media-typer": "^1.1.0", "mime-types": "^3.0.0" } }, "sha512-faYHw0anBbc/kWF3zFTEnxSFOAGUX9GFbOBthvDdLsIlEoWOFOtS0zgCiQYwIskL9iGXZL3kAXD8OoZ4GmMATA=="],
"typescript": ["typescript@5.9.3", "", { "bin": { "tsc": "bin/tsc", "tsserver": "bin/tsserver" } }, "sha512-jl1vZzPDinLr9eUt3J/t7V6FgNEw9QjvBPdysz9KfQDD41fQrC2Y4vKQdiaUpFT4bXlb1RHhLpp8wtm6M5TgSw=="],
@@ -201,18 +350,66 @@
"unpipe": ["unpipe@1.0.0", "", {}, "sha512-pjy2bYhSsufwWlKwPc+l3cN7+wuJlK6uz0YdJEOlQDbl6jo/YlPi4mb8agUkVC8BF7V8NuzeyPNqRksA3hztKQ=="],
"unzipper": ["unzipper@0.10.14", "", { "dependencies": { "big-integer": "^1.6.17", "binary": "~0.3.0", "bluebird": "~3.4.1", "buffer-indexof-polyfill": "~1.0.0", "duplexer2": "~0.1.4", "fstream": "^1.0.12", "graceful-fs": "^4.2.2", "listenercount": "~1.0.1", "readable-stream": "~2.3.6", "setimmediate": "~1.0.4" } }, "sha512-ti4wZj+0bQTiX2KmKWuwj7lhV+2n//uXEotUmGuQqrbVZSEGFMbI68+c6JCQ8aAmUWYvtHEz2A8K6wXvueR/6g=="],
"util-deprecate": ["util-deprecate@1.0.2", "", {}, "sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw=="],
"uuid": ["uuid@8.3.2", "", { "bin": { "uuid": "dist/bin/uuid" } }, "sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg=="],
"vary": ["vary@1.1.2", "", {}, "sha512-BNGbWLfd0eUPabhkXUVm0j8uuvREyTh5ovRa/dyow/BqAbZJyC+5fU+IzQOzmAKzYqYRAISoRhdQr3eIZ/PXqg=="],
"which": ["which@2.0.2", "", { "dependencies": { "isexe": "^2.0.0" }, "bin": { "node-which": "./bin/node-which" } }, "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA=="],
"wrappy": ["wrappy@1.0.2", "", {}, "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ=="],
"xmlchars": ["xmlchars@2.2.0", "", {}, "sha512-JZnDKK8B0RCDw84FNdDAIpZK+JuJw+s7Lz8nksI7SIuU3UXJJslUthsi+uWBUYOwPFwW7W7PRLRfUKpxjtjFCw=="],
"yaml": ["yaml@2.9.0", "", { "bin": { "yaml": "bin.mjs" } }, "sha512-2AvhNX3mb8zd6Zy7INTtSpl1F15HW6Wnqj0srWlkKLcpYl/gMIMJiyuGq2KeI2YFxUPjdlB+3Lc10seMLtL4cA=="],
"yauzl": ["yauzl@3.4.0", "", { "dependencies": { "pend": "~1.2.0" } }, "sha512-jIH9yLR9wqr0wOS0TpBvo/g/2UgZH5qePVbjgRliiF0BYvOZyaBknKsF+x9Iht0O6sqgnB93rCICdOZFecJuDw=="],
"zip-stream": ["zip-stream@4.1.1", "", { "dependencies": { "archiver-utils": "^3.0.4", "compress-commons": "^4.1.2", "readable-stream": "^3.6.0" } }, "sha512-9qv4rlDiopXg4E69k+vMHjNN63YFMe9sZMrdlvKnCjlCRWeCBswPPMPUfx+ipsAWq1LXHe70RcbaHdJJpS6hyQ=="],
"zod": ["zod@4.4.3", "", {}, "sha512-ytENFjIJFl2UwYglde2jchW2Hwm4GJFLDiSXWdTrJQBIN9Fcyp7n4DhxJEiWNAJMV1/BqWfW/kkg71UDcHJyTQ=="],
"zod-to-json-schema": ["zod-to-json-schema@3.25.2", "", { "peerDependencies": { "zod": "^3.25.28 || ^4" } }, "sha512-O/PgfnpT1xKSDeQYSCfRI5Gy3hPf91mKVDuYLUHZJMiDFptvP41MSnWofm8dnCm0256ZNfZIM7DSzuSMAFnjHA=="],
"@fast-csv/format/@types/node": ["@types/node@14.18.63", "", {}, "sha512-fAtCfv4jJg+ExtXhvCkCqUKZ+4ok/JQk01qDKhL5BDDoS3AxKXhV5/MAVUZyQnSEd2GT92fkgZl0pz0Q0AzcIQ=="],
"@fast-csv/parse/@types/node": ["@types/node@14.18.63", "", {}, "sha512-fAtCfv4jJg+ExtXhvCkCqUKZ+4ok/JQk01qDKhL5BDDoS3AxKXhV5/MAVUZyQnSEd2GT92fkgZl0pz0Q0AzcIQ=="],
"archiver-utils/readable-stream": ["readable-stream@2.3.8", "", { "dependencies": { "core-util-is": "~1.0.0", "inherits": "~2.0.3", "isarray": "~1.0.0", "process-nextick-args": "~2.0.0", "safe-buffer": "~5.1.1", "string_decoder": "~1.1.1", "util-deprecate": "~1.0.1" } }, "sha512-8p0AUk4XODgIewSi0l8Epjs+EVnWiK7NoDIEGU0HhE7+ZyY8D1IMY7odu5lRrFXGg71L15KG8QrPmum45RTtdA=="],
"body-parser/iconv-lite": ["iconv-lite@0.7.2", "", { "dependencies": { "safer-buffer": ">= 2.1.2 < 3.0.0" } }, "sha512-im9DjEDQ55s9fL4EYzOAv0yMqmMBSZp6G0VvFyTMPKWxiSBHUj9NW/qqLmXUwXrrM7AvqSlTCfvqRb0cM8yYqw=="],
"duplexer2/readable-stream": ["readable-stream@2.3.8", "", { "dependencies": { "core-util-is": "~1.0.0", "inherits": "~2.0.3", "isarray": "~1.0.0", "process-nextick-args": "~2.0.0", "safe-buffer": "~5.1.1", "string_decoder": "~1.1.1", "util-deprecate": "~1.0.1" } }, "sha512-8p0AUk4XODgIewSi0l8Epjs+EVnWiK7NoDIEGU0HhE7+ZyY8D1IMY7odu5lRrFXGg71L15KG8QrPmum45RTtdA=="],
"glob/minimatch": ["minimatch@3.1.5", "", { "dependencies": { "brace-expansion": "^1.1.7" } }, "sha512-VgjWUsnnT6n+NUk6eZq77zeFdpW2LWDzP6zFGrCbHXiYNul5Dzqk2HHQ5uFH2DNW5Xbp8+jVzaeNt94ssEEl4w=="],
"jszip/readable-stream": ["readable-stream@2.3.8", "", { "dependencies": { "core-util-is": "~1.0.0", "inherits": "~2.0.3", "isarray": "~1.0.0", "process-nextick-args": "~2.0.0", "safe-buffer": "~5.1.1", "string_decoder": "~1.1.1", "util-deprecate": "~1.0.1" } }, "sha512-8p0AUk4XODgIewSi0l8Epjs+EVnWiK7NoDIEGU0HhE7+ZyY8D1IMY7odu5lRrFXGg71L15KG8QrPmum45RTtdA=="],
"lazystream/readable-stream": ["readable-stream@2.3.8", "", { "dependencies": { "core-util-is": "~1.0.0", "inherits": "~2.0.3", "isarray": "~1.0.0", "process-nextick-args": "~2.0.0", "safe-buffer": "~5.1.1", "string_decoder": "~1.1.1", "util-deprecate": "~1.0.1" } }, "sha512-8p0AUk4XODgIewSi0l8Epjs+EVnWiK7NoDIEGU0HhE7+ZyY8D1IMY7odu5lRrFXGg71L15KG8QrPmum45RTtdA=="],
"raw-body/iconv-lite": ["iconv-lite@0.7.2", "", { "dependencies": { "safer-buffer": ">= 2.1.2 < 3.0.0" } }, "sha512-im9DjEDQ55s9fL4EYzOAv0yMqmMBSZp6G0VvFyTMPKWxiSBHUj9NW/qqLmXUwXrrM7AvqSlTCfvqRb0cM8yYqw=="],
"string_decoder/safe-buffer": ["safe-buffer@5.2.1", "", {}, "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ=="],
"type-is/content-type": ["content-type@2.0.0", "", {}, "sha512-j/O/d7GcZCyNl7/hwZAb606rzqkyvaDctLmckbxLzHvFBzTJHuGEdodATcP3yIRoDrLHkIATJuvzbFlp/ki2cQ=="],
"unzipper/readable-stream": ["readable-stream@2.3.8", "", { "dependencies": { "core-util-is": "~1.0.0", "inherits": "~2.0.3", "isarray": "~1.0.0", "process-nextick-args": "~2.0.0", "safe-buffer": "~5.1.1", "string_decoder": "~1.1.1", "util-deprecate": "~1.0.1" } }, "sha512-8p0AUk4XODgIewSi0l8Epjs+EVnWiK7NoDIEGU0HhE7+ZyY8D1IMY7odu5lRrFXGg71L15KG8QrPmum45RTtdA=="],
"zip-stream/archiver-utils": ["archiver-utils@3.0.4", "", { "dependencies": { "glob": "^7.2.3", "graceful-fs": "^4.2.0", "lazystream": "^1.0.0", "lodash.defaults": "^4.2.0", "lodash.difference": "^4.5.0", "lodash.flatten": "^4.4.0", "lodash.isplainobject": "^4.0.6", "lodash.union": "^4.6.0", "normalize-path": "^3.0.0", "readable-stream": "^3.6.0" } }, "sha512-KVgf4XQVrTjhyWmx6cte4RxonPLR9onExufI1jhvw/MQ4BB6IsZD5gT8Lq+u/+pRkWna/6JoHpiQioaqFP5Rzw=="],
"archiver-utils/readable-stream/string_decoder": ["string_decoder@1.1.1", "", { "dependencies": { "safe-buffer": "~5.1.0" } }, "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg=="],
"duplexer2/readable-stream/string_decoder": ["string_decoder@1.1.1", "", { "dependencies": { "safe-buffer": "~5.1.0" } }, "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg=="],
"glob/minimatch/brace-expansion": ["brace-expansion@1.1.18", "", { "dependencies": { "balanced-match": "^1.0.0", "concat-map": "0.0.1" } }, "sha512-Edep/X9fGqVNmzKBVsDYIOtD+z1tuezV70LBjdCst9Tqu76lsnvRiZ6oTic1n+/BIwX6QDGAO94PN4N2SADvtw=="],
"jszip/readable-stream/string_decoder": ["string_decoder@1.1.1", "", { "dependencies": { "safe-buffer": "~5.1.0" } }, "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg=="],
"lazystream/readable-stream/string_decoder": ["string_decoder@1.1.1", "", { "dependencies": { "safe-buffer": "~5.1.0" } }, "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg=="],
"unzipper/readable-stream/string_decoder": ["string_decoder@1.1.1", "", { "dependencies": { "safe-buffer": "~5.1.0" } }, "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg=="],
}
}
+328 -87
View File
@@ -1,82 +1,319 @@
import{createRequire as sN}from"node:module";var ZN=Object.create;var{getPrototypeOf:MN,defineProperty:O$,getOwnPropertyNames:zN}=Object;var CN=Object.prototype.hasOwnProperty;function RN(n){return this[n]}var hN,mN,$4=(n,i,r)=>{var o=n!=null&&typeof n==="object";if(o){var t=i?hN??=new WeakMap:mN??=new WeakMap,u=t.get(n);if(u)return u}r=n!=null?ZN(MN(n)):{};let e=i||!n||!n.__esModule?O$(r,"default",{value:n,enumerable:!0}):r;for(let l of zN(n))if(!CN.call(e,l))O$(e,l,{get:RN.bind(n,l),enumerable:!0});if(o)t.set(n,e);return e};var H=(n,i)=>()=>(i||n((i={exports:{}}).exports,i),i.exports);var xN=(n)=>n;function aN(n,i){this[n]=xN.bind(null,i)}var Fi=(n,i)=>{for(var r in i)O$(n,r,{get:i[r],enumerable:!0,configurable:!0,set:aN.bind(i,r)})};var I4=sN(import.meta.url);var ru=H((ED)=>{Object.defineProperty(ED,"__esModule",{value:!0});ED.regexpCode=ED.getEsmExportName=ED.getProperty=ED.safeStringify=ED.stringify=ED.strConcat=ED.addCodeArg=ED.str=ED._=ED.nil=ED._Code=ED.Name=ED.IDENTIFIER=ED._CodeOrName=void 0;class Zl{}ED._CodeOrName=Zl;ED.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;class Jr extends Zl{constructor(n){super();if(!ED.IDENTIFIER.test(n))throw Error("CodeGen: name must be a valid identifier");this.str=n}toString(){return this.str}emptyStr(){return!1}get names(){return{[this.str]:1}}}ED.Name=Jr;class wi extends Zl{constructor(n){super();this._items=typeof n==="string"?[n]:n}toString(){return this.str}emptyStr(){if(this._items.length>1)return!1;let n=this._items[0];return n===""||n==='""'}get str(){var n;return(n=this._str)!==null&&n!==void 0?n:this._str=this._items.reduce((i,r)=>`${i}${r}`,"")}get names(){var n;return(n=this._names)!==null&&n!==void 0?n:this._names=this._items.reduce((i,r)=>{if(r instanceof Jr)i[r.str]=(i[r.str]||0)+1;return i},{})}}ED._Code=wi;ED.nil=new wi("");function PD(n,...i){let r=[n[0]],o=0;while(o<i.length)Kc(r,i[o]),r.push(n[++o]);return new wi(r)}ED._=PD;var Fc=new wi("+");function BD(n,...i){let r=[tu(n[0])],o=0;while(o<i.length)r.push(Fc),Kc(r,i[o]),r.push(Fc,tu(n[++o]));return dJ(r),new wi(r)}ED.str=BD;function Kc(n,i){if(i instanceof wi)n.push(...i._items);else if(i instanceof Jr)n.push(i);else n.push(yJ(i))}ED.addCodeArg=Kc;function dJ(n){let i=1;while(i<n.length-1){if(n[i]===Fc){let r=kJ(n[i-1],n[i+1]);if(r!==void 0){n.splice(i-1,3,r);continue}n[i++]="+"}i++}}function kJ(n,i){if(i==='""')return n;if(n==='""')return i;if(typeof n=="string"){if(i instanceof Jr||n[n.length-1]!=='"')return;if(typeof i!="string")return`${n.slice(0,-1)}${i}"`;if(i[0]==='"')return n.slice(0,-1)+i.slice(1);return}if(typeof i=="string"&&i[0]==='"'&&!(n instanceof Jr))return`"${n}${i.slice(1)}`;return}function OJ(n,i){return i.emptyStr()?n:n.emptyStr()?i:BD`${n}${i}`}ED.strConcat=OJ;function yJ(n){return typeof n=="number"||typeof n=="boolean"||n===null?n:tu(Array.isArray(n)?n.join(","):n)}function LJ(n){return new wi(tu(n))}ED.stringify=LJ;function tu(n){return JSON.stringify(n).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}ED.safeStringify=tu;function NJ(n){return typeof n=="string"&&ED.IDENTIFIER.test(n)?new wi(`.${n}`):PD`[${n}]`}ED.getProperty=NJ;function GJ(n){if(typeof n=="string"&&ED.IDENTIFIER.test(n))return new wi(`${n}`);throw Error(`CodeGen: invalid export name: ${n}, use explicit $id name mapping`)}ED.getEsmExportName=GJ;function WJ(n){return new wi(n.toString())}ED.regexpCode=WJ});var Tc=H((qD)=>{Object.defineProperty(qD,"__esModule",{value:!0});qD.ValueScope=qD.ValueScopeName=qD.Scope=qD.varKinds=qD.UsedValueState=void 0;var sn=ru();class VD extends Error{constructor(n){super(`CodeGen: "code" for ${n} not defined`);this.value=n.value}}var zl;(function(n){n[n.Started=0]="Started",n[n.Completed=1]="Completed"})(zl||(qD.UsedValueState=zl={}));qD.varKinds={const:new sn.Name("const"),let:new sn.Name("let"),var:new sn.Name("var")};class Bc{constructor({prefixes:n,parent:i}={}){this._names={},this._prefixes=n,this._parent=i}toName(n){return n instanceof sn.Name?n:this.name(n)}name(n){return new sn.Name(this._newName(n))}_newName(n){let i=this._names[n]||this._nameGroup(n);return`${n}${i.index++}`}_nameGroup(n){var i,r;if(((r=(i=this._parent)===null||i===void 0?void 0:i._prefixes)===null||r===void 0?void 0:r.has(n))||this._prefixes&&!this._prefixes.has(n))throw Error(`CodeGen: prefix "${n}" is not allowed in this scope`);return this._names[n]={prefix:n,index:0}}}qD.Scope=Bc;class Ec extends sn.Name{constructor(n,i){super(i);this.prefix=n}setValue(n,{property:i,itemIndex:r}){this.value=n,this.scopePath=sn._`.${new sn.Name(i)}[${r}]`}}qD.ValueScopeName=Ec;var TJ=sn._`\n`;class _D extends Bc{constructor(n){super(n);this._values={},this._scope=n.scope,this.opts={...n,_n:n.lines?TJ:sn.nil}}get(){return this._scope}name(n){return new Ec(n,this._newName(n))}value(n,i){var r;if(i.ref===void 0)throw Error("CodeGen: ref must be passed in value");let o=this.toName(n),{prefix:t}=o,u=(r=i.key)!==null&&r!==void 0?r:i.ref,e=this._values[t];if(e){let I=e.get(u);if(I)return I}else e=this._values[t]=newLine truncated
`:""},this._extScope=n,this._scope=new ci.Scope({parent:n}),this._nodes=[new xD]}toString(){return this._root.render(this.opts)}name(n){return this._scope.name(n)}scopeName(n){return this._extScope.name(n)}scopeValue(n,i){let r=this._extScope.value(n,i);return(this._values[r.prefix]||(this._values[r.prefix]=new Set)).add(r),r}getScopeValue(n,i){return this._extScope.getValue(n,i)}scopeRefs(n){return this._extScope.scopeRefs(n,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def(n,i,r,o){let t=this._scope.toName(i);if(r!==void 0&&o)this._constants[t.str]=r;return this._leafNode(new MD(n,t,r)),t}const(n,i,r){return this._def(ci.varKinds.const,n,i,r)}let(n,i,r){return this._def(ci.varKinds.let,n,i,r)}var(n,i,r){return this._def(ci.varKinds.var,n,i,r)}assign(n,i,r){return this._leafNode(new qc(n,i,r))}add(n,i){return this._leafNode(new zD(n,ni.operators.ADD,i))}code(n){if(typeof n=="function")n();else if(n!==s.nil)this._leafNode(new mD(n));return this}object(...n){let i=["{"];for(let[r,o]of n){if(i.length>1)i.push(",");if(i.push(r),r!==o||this.opts.es5)i.push(":"),(0,s.addCodeArg)(i,o)}return i.push("}"),new s._Code(i)}if(n,i,r){if(this._blockNode(new Ti(n)),i&&r)this.code(i).else().code(r).endIf();else if(i)this.code(i).endIf();else if(r)throw Error('CodeGen: "else" body without "then" body');return this}elseIf(n){return this._elseNode(new Ti(n))}else(){return this._elseNode(new ou)}endIf(){return this._endBlockNode(Ti,ou)}_for(n,i){if(this._blockNode(n),i)this.code(i).endFor();return this}for(n,i){return this._for(new aD(n),i)}forRange(n,i,r,o,t=this.opts.es5?ci.varKinds.var:ci.varKinds.let){let u=this._scope.toName(n);return this._for(new sD(t,u,i,r),()=>o(u))}forOf(n,i,r,o=ci.varKinds.const){let t=this._scope.toName(n);if(this.opts.es5){let u=i instanceof s.Name?i:this.var("_arr",i);return this.forRange("_i",0,s._`${u}.length`,(e)=>{this.var(t,s._`${u}[${e}]`),r(t)})}return this._for(new Vc("of",o,t,i),()=>r(t))}forIn(n,i,r,o=this.opts.es5?ci.varKinds.var:ci.varKinds.const){if(this.opts.ownProperties)return this.forOf(n,s._`Object.keys(${i})`,r);let t=this._scope.toName(n);return this._for(new Vc("in",o,t,i),()=>r(t))}endFor(){return this._endBlockNode(Xr)}label(n){return this._leafNode(new CD(n))}break(n){return this._leafNode(new RD(n))}return(n){let i=new Rl;if(this._blockNode(i),this.code(n),i.nodes.length!==1)throw Error('CodeGen: "return" should have one node');return this._endBlockNode(Rl)}try(n,i,r){if(!i&&!r)throw Error('CodeGen: "try" without "catch" and "finally"');let o=new n1;if(this._blockNode(o),this.code(n),i){let t=this.name("e");this._currNode=o.catch=new hl(t),i(t)}if(r)this._currNode=o.finally=new ml,this.code(r);return this._endBlockNode(hl,ml)}throw(n){return this._leafNode(new hD(n))}block(n,i){if(this._blockStarts.push(this._nodes.length),n)this.code(n).endBlock(i);return this}endBlock(n){let i=this._blockStarts.pop();if(i===void 0)throw Error("CodeGen: not in self-balancing block");let r=this._nodes.length-i;if(r<0||n!==void 0&&r!==n)throw Error(`CodeGen: wrong number of nodes: ${r} vs ${n} expected`);return this._nodes.length=i,this}func(n,i=s.nil,r,o){if(this._blockNode(new Cl(n,i,r)),o)this.code(o).endFunc();return this}endFunc(){return this._endBlockNode(Cl)}optimize(n=1){while(n-- >0)this._root.optimizeNodes(),this._root.optimizeNames(this._root.names,this._constants)}_leafNode(n){return this._currNode.nodes.push(n),this}_blockNode(n){this._currNode.nodes.push(n),this._nodes.push(n)}_endBlockNode(n,i){let r=this._currNode;if(r instanceof n||i&&r instanceof i)return this._nodes.pop(),this;throw Error(`CodeGen: not in block "${i?`${n.kind}/${i.kind}`:n.kind}"`)}_elseNode(n){let i=this._currNode;if(!(i instanceof Ti))throw Error('CodeGen: "else" without "if"');return this._currNode=i.else=n,this}get _root(){return this._nodes[0]}get _currNode(){let n=this._nodes;return n[n.length-1]}set _currNode(n){let i=this._nodes;i[i.length-1]=n}}ni.CodeGen=i1;function Yt(n,i){for(let r in i)n[r]=(n[r]||0)+(i[r]||0);return n}function xl(n,i){return i instanceof s._CodeOrName?Yt(n,i.names):n}function Hr(n,i,r){if(n instanceof s.Name)return o(n);if(!t(n))return n;return new s._Code(n._items.reduce((u,e)=>{if(e instanceof s.Name)e=o(e);if(e instanceof s._Code)u.push(...e._items);else u.push(e);return u},[]));function o(u){let e=r[u.str];if(e===void 0||i[u.str]!==1)return u;return delete i[u.str],e}function t(u){return u instanceof s._Code&&u._items.some((e)=>e instanceof s.Name&&i[e.str]===1&&r[e.str]!==void 0)}}function ZJ(n,i){for(let r in i)n[r]=(n[r]||0)-(i[r]||0)}function t1(n){return typeof n=="boolean"||typeof n=="number"||n===null?!n:s._`!${_c(n)}`}ni.not=t1;var MJ=r1(ni.operators.AND);function zJ(...n){return n.reduce(MJ)}ni.and=zJ;var CJ=r1(ni.operators.OR);function RJ(...n){return n.reduce(CJ)}ni.or=RJ;function r1(n){return(i,r)=>i===s.nil?r:r===s.nil?i:s._`${_c(i)} ${n} ${_c(r)}`}function _c(n){return n instanceof s.Name?n:s._`(${n})`}});var tn=H((b1)=>{Object Line truncated
|| (${e} == "string" && ${t} && ${t} == +${t})`).assign(l,C._`+${t}`);return;case"integer":o.elseIf(C._`${e} === "boolean" || ${t} === null
|| (${e} === "string" && ${t} && ${t} == +${t} && !(${t} % 1))`).assign(l,C._`+${t}`);return;case"boolean":o.elseIf(C._`${t} === "false" || ${t} === 0 || ${t} === null`).assign(l,!1).elseIf(C._`${t} === "true" || ${t} === 1`).assign(l,!0);return;case"null":o.elseIf(C._`${t} === "" || ${t} === 0 || ${t} === false`),o.assign(l,null);return;case"array":o.elseIf(C._`${e} === "string" || ${e} === "number"
|| ${e} === "boolean" || ${t} === null`).assign(l,C._`[${t}]`)}}}function l8({gen:n,parentData:i,parentDataProperty:r},o){n.if(C._`${i} !== undefined`,()=>n.assign(C._`${i}[${r}]`,o))}function mc(n,i,r,o=Yr.Correct){let t=o===Yr.Correct?C.operators.EQ:C.operators.NEQ,u;switch(n){case"null":return C._`${i} ${t} null`;case"array":u=C._`Array.isArray(${i})`;break;case"object":u=C._`${i} && typeof ${i} == "object" && !Array.isArray(${i})`;break;case"integer":u=e(C._`!(${i} % 1) && !isNaN(${i})`);break;case"number":u=e();break;default:return C._`typeof ${i} ${t} ${n}`}return o===Yr.Correct?u:(0,C.not)(u);function e(l=C.nil){return(0,C.and)(C._`typeof ${i} == "number"`,l,r?C._`isFinite(${i})`:C.nil)}}Y1.checkDataType=mc;function xc(n,i,r,o){if(n.length===1)return mc(n[0],i,r,o);let t,u=(0,J1.toHash)(n);if(u.array&&u.object){let e=C._`typeof ${i} != "object"`;t=u.null?e:C._`!${i} || ${e}`,delete u.null,delete u.array,delete u.object}else t=C.nil;if(u.number)delete u.integer;for(let e in u)t=(0,C.and)(t,mc(e,i,r,o));return t}Y1.checkDataTypes=xc;var v8={message:({schema:n})=>`must be ${n}`,params:({schema:n,schemaValue:i})=>typeof n=="string"?C._`{type: ${n}}`:C._`{type: ${i}}`};function ac(n){let i=$8(n);(0,t8.reportError)(i,v8)}Y1.reportTypeError=ac;function $8(n){let{gen:i,data:r,schema:o}=n,t=(0,J1.schemaRefOrVal)(n,o,"type");return{gen:i,keyword:"type",data:r,schema:o.type,schemaCode:t,schemaValue:t,parentSchema:o,params:{},it:n}}});var B1=H((K1)=>{Object.defineProperty(K1,"__esModule",{value:!0});K1.assignDefaults=void 0;var Qr=R(),U8=tn();function D8(n,i){let{properties:r,items:o}=n.schema;if(i==="object"&&r)for(let t in r)F1(n,t,r[t].default);else if(i==="array"&&Array.isArray(o))o.forEach((t,u)=>F1(n,u,t.default))}K1.assignDefaults=D8;function F1(n,i,r){let{gen:o,compositeRule:t,data:u,opts:e}=n;if(r===void 0)return;let l=Qr._`${u}${(0,Qr.getProperty)(i)}`;if(t){(0,U8.checkStrictMode)(n,`default is ignored for: ${l}`);return}let $=Qr._`${l} === undefined`;if(e.useDefaults==="empty")$=Qr._`${$} || ${l} === null || ${l} === ""`;o.if($,Qr._`${l} = ${(0,Qr.stringify)(r)}`)}});var gi=H((V1)=>{Object.defineProperty(V1,"__esModule",{value:!0});V1.validateUnion=V1.validateArray=V1.usePattern=V1.callValidateCode=V1.schemaProperties=V1.allSchemaProperties=V1.noPropertyInData=V1.propertyInData=V1.isOwnProperty=V1.hasPropFunc=V1.reportMissingProp=V1.checkMissingProp=V1.checkReportMissingProp=void 0;var Dn=R(),sc=tn(),gt=Vi(),S8=tn();function A8(n,i){let{gen:r,data:o,it:t}=n;r.if(i6(r,o,i,t.opts.ownProperties),()=>{n.setParams({missingProperty:Dn._`${i}`},!0),n.error()})}V1.checkReportMissingProp=A8;function d8({gen:n,data:i,it:{opts:r}},o,t){return(0,Dn.or)(...o.map((u)=>(0,Dn.and)(i6(n,i,u,r.ownProperties),Dn._`${t} = ${u}`)))}V1.checkMissingProp=d8;function k8(n,i){n.setParams({missingProperty:i},!0),n.error()}V1.reportMissingProp=k8;function E1(n){return n.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:Dn._`Object.prototype.hasOwnProperty`})}V1.hasPropFunc=E1;function n6(n,i,r){return Dn._`${E1(n)}.call(${i}, ${r})`}V1.isOwnProperty=n6;function O8(n,i,r,o){let t=Dn._`${i}${(0,Dn.getProperty)(r)} !== undefined`;return o?Dn._`${t} && ${n6(n,i,r)}`:t}V1.propertyInData=O8;function i6(n,i,r,o){let t=Dn._`${i}${(0,Dn.getProperty)(r)} === undefined`;return o?(0,Dn.or)(t,(0,Dn.not)(n6(n,i,r))):t}V1.noPropertyInData=i6;function T1(n){return n?Object.keys(n).filter((i)=>i!=="__proto__"):[]}V1.allSchemaProperties=T1;function y8(n,i){return T1(i).filter((r)=>!(0,sc.alwaysValidSchema)(n,i[r]))}V1.schemaProperties=y8;function L8({schemaCode:n,data:i,it:{gen:r,topSchemaRef:o,schemaPath:t,errorPath:u},it:e},l,$,I){let g=I?Dn._`${n}, ${i}, ${o}${t}`:i,b=[[gt.default.instancePath,(0,Dn.strConcat)(gt.default.instancePath,u)],[gt.default.parentData,e.parentData],[gt.default.parentDataProperty,e.parentDataProperty],[gt.default.rootData,gt.default.rootData]];if(e.opts.dynamicRef)b.push([gt.default.dynamicAnchors,gt.default.dynamicAnchors]);let f=Dn._`${g}, ${r.object(...b)}`;return $!==Dn.nil?Dn._`${l}.call(${$}, ${f})`:Dn._`${l}(${f})`}V1.callValidateCode=L8;var N8=Dn._`new RegExp`;function G8({gen:n,it:{opts:i}},r){let o=i.unicodeRegExp?"u":"",{regExp:t}=i.code,u=t(r,o);return n.scopeValue("pattern",{key:u.toString(),ref:u,code:Dn._`${t.code==="new RegExp"?N8:(0,S8.useFunc)(n,t)}(${r}, ${o})`})}V1.usePattern=G8;function W8(n){let{gen:i,data:r,keyword:o,it:t}=n,u=i.name("valid");if(t.allErrors){let l=i.let("valid",!0);return e(()=>i.assign(l,!1)),l}return i.var(u,!0),e(()=>i.break()),u;function e(l){let $=i.const("len",Dn._`${r}.length`);i.forRange("i",0,$,(I)=>{n.subschema({keyword:o,dataProp:I,dataPropType:sc.Type.Num},u),i.if((0,Dn.not)(u),l)})}}V1.validateArray=W8;function p8(n){let{gen:i,schema:r,keyword:o,it:t}=n;if(!Array.isArray(r))throw Error("ajv implementation error");if(r.some(($)=>(0,sc.alwaysValidSchema)(t,$))&&!t.opts.unevaluated)return;let e=i.let("valid",!1),l=i.name("_valid");i.block(()=>r. Line truncated
missingProperty: ${o},
depsCount: ${i},
deps: ${r}}`};var C5={keyword:"dependencies",type:"object",schemaType:"object",error:od.error,code(n){let[i,r]=R5(n);td(n,i),rd(n,r)}};function R5({schema:n}){let i={},r={};for(let o in n){if(o==="__proto__")continue;let t=Array.isArray(n[o])?i:r;t[o]=n[o]}return[i,r]}function td(n,i=n.schema){let{gen:r,data:o,it:t}=n;if(Object.keys(i).length===0)return;let u=r.let("missing");for(let e in i){let l=i[e];if(l.length===0)continue;let $=(0,Ou.propertyInData)(r,o,e,t.opts.ownProperties);if(n.setParams({property:e,depsCount:l.length,deps:l.join(", ")}),t.allErrors)r.if($,()=>{for(let I of l)(0,Ou.checkReportMissingProp)(n,I)});else r.if(L6._`${$} && (${(0,Ou.checkMissingProp)(n,l,u)})`),(0,Ou.reportMissingProp)(n,u),r.else()}}od.validatePropertyDeps=td;function rd(n,i=n.schema){let{gen:r,data:o,keyword:t,it:u}=n,e=r.name("valid");for(let l in i){if((0,z5.alwaysValidSchema)(u,i[l]))continue;r.if((0,Ou.propertyInData)(r,o,l,u.opts.ownProperties),()=>{let $=n.subschema({keyword:t,schemaProp:l},e);n.mergeValidEvaluated($,e)},()=>r.var(e,!0)),n.ok(e)}}od.validateSchemaDeps=rd;od.default=C5});var Id=H(($d)=>{Object.defineProperty($d,"__esModule",{value:!0});var vd=R(),x5=tn(),a5={message:"property name must be valid",params:({params:n})=>vd._`{propertyName: ${n.propertyName}}`},s5={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:a5,code(n){let{gen:i,schema:r,data:o,it:t}=n;if((0,x5.alwaysValidSchema)(t,r))return;let u=i.name("valid");i.forIn("key",o,(e)=>{n.setParams({propertyName:e}),n.subschema({keyword:"propertyNames",data:e,dataTypes:["string"],propertyName:e,compositeRule:!0},u),i.if((0,vd.not)(u),()=>{if(n.error(!0),!t.allErrors)i.break()})}),n.ok(u)}};$d.default=s5});var N6=H((gd)=>{Object.defineProperty(gd,"__esModule",{value:!0});var Av=gi(),Si=R(),i7=Vi(),dv=tn(),t7={message:"must NOT have additional properties",params:({params:n})=>Si._`{additionalProperty: ${n.additionalProperty}}`},r7={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:t7,code(n){let{gen:i,schema:r,parentSchema:o,data:t,errsCount:u,it:e}=n;if(!u)throw Error("ajv implementation error");let{allErrors:l,opts:$}=e;if(e.props=!0,$.removeAdditional!=="all"&&(0,dv.alwaysValidSchema)(e,r))return;let I=(0,Av.allSchemaProperties)(o.properties),g=(0,Av.allSchemaProperties)(o.patternProperties);b(),n.ok(Si._`${u} === ${i7.default.errors}`);function b(){i.forIn("key",t,(k)=>{if(!I.length&&!g.length)c(k);else i.if(f(k),()=>c(k))})}function f(k){let O;if(I.length>8){let F=(0,dv.schemaRefOrVal)(e,o.properties,"properties");O=(0,Av.isOwnProperty)(i,F,k)}else if(I.length)O=(0,Si.or)(...I.map((F)=>Si._`${k} === ${F}`));else O=Si.nil;if(g.length)O=(0,Si.or)(O,...g.map((F)=>Si._`${(0,Av.usePattern)(n,F)}.test(${k})`));return(0,Si.not)(O)}function w(k){i.code(Si._`delete ${t}[${k}]`)}function c(k){if($.removeAdditional==="all"||$.removeAdditional&&r===!1){w(k);return}if(r===!1){if(n.setParams({additionalProperty:k}),n.error(),!l)i.break();return}if(typeof r=="object"&&!(0,dv.alwaysValidSchema)(e,r)){let O=i.name("valid");if($.removeAdditional==="failing")S(k,O,!1),i.if((0,Si.not)(O),()=>{n.reset(),w(k)});else if(S(k,O),!l)i.if((0,Si.not)(O),()=>i.break())}}function S(k,O,F){let Q={keyword:"additionalProperties",dataProp:k,dataPropType:dv.Type.Str};if(F===!1)Object.assign(Q,{compositeRule:!0,createErrors:!1,allErrors:!1});n.subschema(Q,O)}}};gd.default=r7});var cd=H((wd)=>{Object.defineProperty(wd,"__esModule",{value:!0});var u7=Iu(),bd=gi(),G6=tn(),fd=N6(),e7={keyword:"properties",type:"object",schemaType:"object",code(n){let{gen:i,schema:r,parentSchema:o,data:t,it:u}=n;if(u.opts.removeAdditional==="all"&&o.additionalProperties===void 0)fd.default.code(new u7.KeywordCxt(u,fd.default,"additionalProperties"));let e=(0,bd.allSchemaProperties)(r);for(let b of e)u.definedProperties.add(b);if(u.opts.unevaluated&&e.length&&u.props!==!0)u.props=G6.mergeEvaluated.props(i,(0,G6.toHash)(e),u.props);let l=e.filter((b)=>!(0,G6.alwaysValidSchema)(u,r[b]));if(l.length===0)return;let $=i.name("valid");for(let b of l){if(I(b))g(b);else{if(i.if((0,bd.propertyInData)(i,t,b,u.opts.ownProperties)),g(b),!u.allErrors)i.else().var($,!0);i.endIf()}n.it.definedProperties.add(b),n.ok($)}function I(b){return u.opts.useDefaults&&!u.compositeRule&&r[b].default!==void 0}function g(b){n.subschema({keyword:"properties",schemaProp:b,dataProp:b},$)}}};wd.default=e7});var dd=H((Ad)=>{Object.defineProperty(Ad,"__esModule",{value:!0});var Ud=gi(),kv=R(),Dd=tn(),Sd=tn(),v7={keyword:"patternProperties",type:"object",schemaType:"object",code(n){let{gen:i,schema:r,data:o,parentSchema:t,it:u}=n,{opts:e}=u,l=(0,Ud.allSchemaProperties)(r),$=l.filter((S)=>(0,Dd.alwaysValidSchema)(u,r[S]));if(l.length===0||$.length===l.length&&(!u.opts.unevaluated||u.props===!0))return;let I=e.strictSchema&&!e.allowMatchingProperties&&t.properties,g=i.name("valid");if(u.props!==!0&&!(u.props instanceof kv.Name))u.props=(0,Sd. Line truncated
`)}var mt=(n)=>(i,r,o,t)=>{let u=o?{...o,async:!1}:{async:!1},e=i._zod.run({value:r,issues:[]},u);if(e instanceof Promise)throw new Li;if(e.issues.length){let l=new(t?.Err??n)(e.issues.map(($)=>Zn($,u,On())));throw ie(l,t?.callee),l}return e.value},fo=mt(xn),xt=(n)=>async(i,r,o,t)=>{let u=o?{...o,async:!0}:{async:!0},e=i._zod.run({value:r,issues:[]},u);if(e instanceof Promise)e=await e;if(e.issues.length){let l=new(t?.Err??n)(e.issues.map(($)=>Zn($,u,On())));throw ie(l,t?.callee),l}return e.value},wo=xt(xn),at=(n)=>(i,r,o)=>{let t=o?{...o,async:!1}:{async:!1},u=i._zod.run({value:r,issues:[]},t);if(u instanceof Promise)throw new Li;return u.issues.length?{success:!1,error:new(n??Io)(u.issues.map((e)=>Zn(e,t,On())))}:{success:!0,data:u.value}},st=at(xn),nr=(n)=>async(i,r,o)=>{let t=o?{...o,async:!0}:{async:!0},u=i._zod.run({value:r,issues:[]},t);if(u instanceof Promise)u=await u;return u.issues.length?{success:!1,error:new n(u.issues.map((e)=>Zn(e,t,On())))}:{success:!0,data:u.value}},co=nr(xn),te=(n)=>(i,r,o)=>{let t=o?{...o,direction:"backward"}:{direction:"backward"};return mt(n)(i,r,t)},S4=te(xn),re=(n)=>(i,r,o)=>{return mt(n)(i,r,o)},A4=re(xn),oe=(n)=>async(i,r,o)=>{let t=o?{...o,direction:"backward"}:{direction:"backward"};return xt(n)(i,r,t)},d4=oe(xn),ue=(n)=>async(i,r,o)=>{return xt(n)(i,r,o)},k4=ue(xn),ee=(n)=>(i,r,o)=>{let t=o?{...o,direction:"backward"}:{direction:"backward"};return at(n)(i,r,t)},O4=ee(xn),le=(n)=>(i,r,o)=>{return at(n)(i,r,o)},y4=le(xn),ve=(n)=>async(i,r,o)=>{let t=o?{...o,direction:"backward"}:{direction:"backward"};return nr(n)(i,r,t)},L4=ve(xn),$e=(n)=>async(i,r,o)=>{return nr(n)(i,r,o)},N4=$e(xn);var ui={};Fi(ui,{xid:()=>T$,uuid7:()=>jG,uuid6:()=>pG,uuid4:()=>WG,uuid:()=>Wt,uppercase:()=>gI,unicodeEmail:()=>G4,undefined:()=>$I,ulid:()=>E$,time:()=>tI,string:()=>oI,sha512_hex:()=>mG,sha512_base64url:()=>aG,sha512_base64:()=>xG,sha384_hex:()=>CG,sha384_base64url:()=>hG,sha384_base64:()=>RG,sha256_hex:()=>ZG,sha256_base64url:()=>zG,sha256_base64:()=>MG,sha1_hex:()=>VG,sha1_base64url:()=>qG,sha1_base64:()=>_G,rfc5322Email:()=>XG,number:()=>Uo,null:()=>vI,nanoid:()=>_$,md5_hex:()=>BG,md5_base64url:()=>TG,md5_base64:()=>EG,mac:()=>h$,lowercase:()=>II,ksuid:()=>V$,ipv6:()=>R$,ipv4:()=>C$,integer:()=>eI,idnEmail:()=>HG,httpProtocol:()=>s$,html5Email:()=>JG,hostname:()=>FG,hex:()=>PG,guid:()=>Z$,extendedDuration:()=>GG,emoji:()=>z$,email:()=>M$,e164:()=>nI,duration:()=>q$,domain:()=>KG,datetime:()=>rI,date:()=>iI,cuid2:()=>B$,cuid:()=>P$,cidrv6:()=>x$,cidrv4:()=>m$,browserEmail:()=>YG,boolean:()=>lI,bigint:()=>uI,base64url:()=>Ie,base64:()=>a$});var P$=/^[cC][0-9a-z]{6,}$/,B$=/^[0-9a-z]+$/,E$=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,T$=/^[0-9a-vA-V]{20}$/,V$=/^[A-Za-z0-9]{27}$/,_$=/^[a-zA-Z0-9_-]{21}$/,q$=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,GG=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,Z$=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,Wt=(n)=>{if(!n)return/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/;return new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${n}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`)},WG=Wt(4),pG=Wt(6),jG=Wt(7),M$=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,JG=/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,XG=/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/,G4=/^[^\s@"]{1,64}@[^\s@]{1,255}$/u,HG=G4,YG=/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,QG="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function z$(){return new RegExp(QG,"u")}var C$=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,R$=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,h$=(n)=>{let i=vi(n??":");return new RegExp(`^(?:[0-9A-F]{2}${i}){5}[0-9A-F]{2}$|^(?:[0-9a-f]{2}${i}){5}[0-9a-f]{2}$`)},m$=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-Line truncated
`).filter((u)=>u),o=Math.min(...r.map((u)=>u.length-u.trimStart().length)),t=r.map((u)=>u.slice(o)).map((u)=>" ".repeat(this.indent*2)+u);for(let u of t)this.content.push(u)}compile(){let n=Function,i=this?.args,o=[...(this?.content??[""]).map((t)=>` ${t}`)];return new n(...i,o.join(`
`))}}var JI={major:4,minor:4,patch:3};var T=D("$ZodType",(n,i)=>{var r;n??(n={}),n._zod.def=i,n._zod.bag=n._zod.bag||{},n._zod.version=JI;let o=[...n._zod.def.checks??[]];if(n._zod.traits.has("$ZodCheck"))o.unshift(n);for(let t of o)for(let u of t._zod.onattach)u(n);if(o.length===0)(r=n._zod).deferred??(r.deferred=[]),n._zod.deferred?.push(()=>{n._zod.run=n._zod.parse});else{let t=(e,l,$)=>{let I=ai(e),g;for(let b of l){if(b._zod.def.when){if(Q$(e))continue;if(!b._zod.def.when(e))continue}else if(I)continue;let f=e.issues.length,w=b._zod.check(e);if(w instanceof Promise&&$?.async===!1)throw new Li;if(g||w instanceof Promise)g=(g??Promise.resolve()).then(async()=>{if(await w,e.issues.length===f)return;if(!I)I=ai(e,f)});else{if(e.issues.length===f)continue;if(!I)I=ai(e,f)}}if(g)return g.then(()=>{return e});return e},u=(e,l,$)=>{if(ai(e))return e.aborted=!0,e;let I=t(l,o,$);if(I instanceof Promise){if($.async===!1)throw new Li;return I.then((g)=>n._zod.parse(g,$))}return n._zod.parse(I,$)};n._zod.run=(e,l)=>{if(l.skipChecks)return n._zod.parse(e,l);if(l.direction==="backward"){let I=n._zod.parse({value:e.value,issues:[]},{...l,skipChecks:!0});if(I instanceof Promise)return I.then((g)=>{return u(g,e,l)});return u(I,e,l)}let $=n._zod.parse(e,l);if($ instanceof Promise){if(l.async===!1)throw new Li;return $.then((I)=>t(I,o,l))}return t($,o,l)}}h(n,"~standard",()=>({validate:(t)=>{try{let u=st(n,t);return u.success?{value:u.data}:{issues:u.error?.issues}}catch(u){return co(n,t).then((e)=>e.success?{value:e.data}:{issues:e.error?.issues})}},vendor:"zod",version:1}))}),pt=D("$ZodString",(n,i)=>{T.init(n,i),n._zod.pattern=[...n?._zod.bag?.patterns??[]].pop()??oI(n._zod.bag),n._zod.parse=(r,o)=>{if(i.coerce)try{r.value=String(r.value)}catch(t){}if(typeof r.value==="string")return r;return r.issues.push({expected:"string",code:"invalid_type",input:r.value,inst:n}),r}}),$n=D("$ZodStringFormat",(n,i)=>{ir.init(n,i),pt.init(n,i)}),HI=D("$ZodGUID",(n,i)=>{i.pattern??(i.pattern=Z$),$n.init(n,i)}),YI=D("$ZodUUID",(n,i)=>{if(i.version){let o={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[i.version];if(o===void 0)throw Error(`Invalid UUID version: "${i.version}"`);i.pattern??(i.pattern=Wt(o))}else i.pattern??(i.pattern=Wt());$n.init(n,i)}),QI=D("$ZodEmail",(n,i)=>{i.pattern??(i.pattern=M$),$n.init(n,i)}),FI=D("$ZodURL",(n,i)=>{$n.init(n,i),n._zod.check=(r)=>{try{let o=r.value.trim();if(!i.normalize&&i.protocol?.source===s$.source){if(!/^https?:\/\//i.test(o)){r.issues.push({code:"invalid_format",format:"url",note:"Invalid URL format",input:r.value,inst:n,continue:!i.abort});return}}let t=new URL(o);if(i.hostname){if(i.hostname.lastIndex=0,!i.hostname.test(t.hostname))r.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:i.hostname.source,input:r.value,inst:n,continue:!i.abort})}if(i.protocol){if(i.protocol.lastIndex=0,!i.protocol.test(t.protocol.endsWith(":")?t.protocol.slice(0,-1):t.protocol))r.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:i.protocol.source,input:r.value,inst:n,continue:!i.abort})}if(i.normalize)r.value=t.href;else r.value=o;return}catch(o){r.issues.push({code:"invalid_format",format:"url",input:r.value,inst:n,continue:!i.abort})}}}),KI=D("$ZodEmoji",(n,i)=>{i.pattern??(i.pattern=z$()),$n.init(n,i)}),PI=D("$ZodNanoID",(n,i)=>{i.pattern??(i.pattern=_$),$n.init(n,i)}),BI=D("$ZodCUID",(n,i)=>{i.pattern??(i.pattern=P$),$n.init(n,i)}),EI=D("$ZodCUID2",(n,i)=>{i.pattern??(i.pattern=B$),$n.init(n,i)}),TI=D("$ZodULID",(n,i)=>{i.pattern??(i.pattern=E$),$n.init(n,i)}),VI=D("$ZodXID",(n,i)=>{i.pattern??(i.pattern=T$),$n.init(n,i)}),_I=D("$ZodKSUID",(n,i)=>{i.pattern??(i.pattern=V$),$n.init(n,i)}),qI=D("$ZodISODateTime",(n,i)=>{i.pattern??(i.pattern=rI(i)),$n.init(n,i)}),ZI=D("$ZodISODate",(n,i)=>{i.pattern??(i.pattern=iI),$n.init(n,i)}),MI=D("$ZodISOTime",(n,i)=>{i.pattern??(i.pattern=tI(i)),$n.init(n,i)}),zI=D("$ZodISODuration",(n,i)=>{i.pattern??(i.pattern=q$),$n.init(n,i)}),CI=D("$ZodIPv4",(n,i)=>{i.pattern??(i.pattern=C$),$n.init(n,i),n._zod.bag.format="ipv4"}),RI=D("$ZodIPv6",(n,i)=>{i.pattern??(i.pattern=R$),$n.init(n,i),n._zod.bag.format="ipv6",n._zod.check=(r)=>{try{new URL(`http://[${r.value}]`)}catch{r.issues.push({code:"invalid_format",format:"ipv6",input:r.value,inst:n,continue:!i.abort})}}}),hI=D("$ZodMAC",(n,i)=>{i.pattern??(i.pattern=h$(i.delimiter)),$n.init(n,i),n._zod.bag.format="mac"}),mI=D("$ZodCIDRv4",(n,i)=>{i.pattern??(i.pattern=m$),$n.init(n,i)}),xI=D("$ZodCIDRv6",(n,i)=>{i.pattern??(i.pattern=x$),$n.init(n,i),n._zod.check=(r)=>{let o=r.value.split("/");try{if(o.length!==2)throw Error();let[t,u]=o;if(!u)throw Error();let e=Number(u);if(`${e}`!==u)throw Error();if(e<0||e>128)throw Error();new URL(`http://[${t}]`)}catch{r.issues.push({code:"invalid_format",format:"cidrv6",input:r.value,inst:n,continue:!i.abort})}}});function aI(n){if(n==="")return!0;if(/\s/.test(n))return!1;if(n.length%4!==0)return!1;try{return atob(n),!0}catch{return!1}}var Line truncated
if (${W}.issues.length) {
if (${y} in input) {
payload.issues = payload.issues.concat(${W}.issues.map(iss => ({
import{createRequire as HD0}from"node:module";var qD0=Object.create;var{getPrototypeOf:UD0,defineProperty:CO,getOwnPropertyNames:YD0}=Object;var JD0=Object.prototype.hasOwnProperty;function QD0($){return this[$]}var KD0,zD0,RY=($,I,q)=>{var U=$!=null&&typeof $==="object";if(U){var Y=I?KD0??=new WeakMap:zD0??=new WeakMap,J=Y.get($);if(J)return J}q=$!=null?qD0(UD0($)):{};let Q=I||!$||!$.__esModule?CO(q,"default",{value:$,enumerable:!0}):q;for(let K of YD0($))if(!JD0.call(Q,K))CO(Q,K,{get:QD0.bind($,K),enumerable:!0});if(U)Y.set($,Q);return Q};var L=($,I)=>()=>(I||$((I={exports:{}}).exports,I),I.exports);var wD0=($)=>$;function GD0($,I){this[$]=wD0.bind(null,I)}var d8=($,I)=>{for(var q in I)CO($,q,{get:I[q],enumerable:!0,configurable:!0,set:GD0.bind(I,q)})};var o=HD0(import.meta.url);var vJ=L((nf)=>{Object.defineProperty(nf,"__esModule",{value:!0});nf.regexpCode=nf.getEsmExportName=nf.getProperty=nf.safeStringify=nf.stringify=nf.strConcat=nf.addCodeArg=nf.str=nf._=nf.nil=nf._Code=nf.Name=nf.IDENTIFIER=nf._CodeOrName=void 0;class _G{}nf._CodeOrName=_G;nf.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;class pI extends _G{constructor($){super();if(!nf.IDENTIFIER.test($))throw Error("CodeGen: name must be a valid identifier");this.str=$}toString(){return this.str}emptyStr(){return!1}get names(){return{[this.str]:1}}}nf.Name=pI;class y$ extends _G{constructor($){super();this._items=typeof $==="string"?[$]:$}toString(){return this.str}emptyStr(){if(this._items.length>1)return!1;let $=this._items[0];return $===""||$==='""'}get str(){var $;return($=this._str)!==null&&$!==void 0?$:this._str=this._items.reduce((I,q)=>`${I}${q}`,"")}get names(){var $;return($=this._names)!==null&&$!==void 0?$:this._names=this._items.reduce((I,q)=>{if(q instanceof pI)I[q.str]=(I[q.str]||0)+1;return I},{})}}nf._Code=y$;nf.nil=new y$("");function kf($,...I){let q=[$[0]],U=0;while(U<I.length)cg(q,I[U]),q.push($[++U]);return new y$(q)}nf._=kf;var pg=new y$("+");function ff($,...I){let q=[BJ($[0])],U=0;while(U<I.length)q.push(pg),cg(q,I[U]),q.push(pg,BJ($[++U]));return _F0(q),new y$(q)}nf.str=ff;function cg($,I){if(I instanceof y$)$.push(...I._items);else if(I instanceof pI)$.push(I);else $.push(yF0(I))}nf.addCodeArg=cg;function _F0($){let I=1;while(I<$.length-1){if($[I]===pg){let q=hF0($[I-1],$[I+1]);if(q!==void 0){$.splice(I-1,3,q);continue}$[I++]="+"}I++}}function hF0($,I){if(I==='""')return $;if($==='""')return I;if(typeof $=="string"){if(I instanceof pI||$[$.length-1]!=='"')return;if(typeof I!="string")return`${$.slice(0,-1)}${I}"`;if(I[0]==='"')return $.slice(0,-1)+I.slice(1);return}if(typeof I=="string"&&I[0]==='"'&&!($ instanceof pI))return`"${$}${I.slice(1)}`;return}function SF0($,I){return I.emptyStr()?$:$.emptyStr()?I:ff`${$}${I}`}nf.strConcat=SF0;function yF0($){return typeof $=="number"||typeof $=="boolean"||$===null?$:BJ(Array.isArray($)?$.join(","):$)}function uF0($){return new y$(BJ($))}nf.stringify=uF0;function BJ($){return JSON.stringify($).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}nf.safeStringify=BJ;function xF0($){return typeof $=="string"&&nf.IDENTIFIER.test($)?new y$(`.${$}`):kf`[${$}]`}nf.getProperty=xF0;function kF0($){if(typeof $=="string"&&nf.IDENTIFIER.test($))return new y$(`${$}`);throw Error(`CodeGen: invalid export name: ${$}, use explicit $id name mapping`)}nf.getEsmExportName=kF0;function fF0($){return new y$($.toString())}nf.regexpCode=fF0});var og=L((df)=>{Object.defineProperty(df,"__esModule",{value:!0});df.ValueScope=df.ValueScopeName=df.Scope=df.varKinds=df.UsedValueState=void 0;var u6=vJ();class pf extends Error{constructor($){super(`CodeGen: "code" for ${$} not defined`);this.value=$.value}}var SG;(function($){$[$.Started=0]="Started",$[$.Completed=1]="Completed"})(SG||(df.UsedValueState=SG={}));df.varKinds={const:new u6.Name("const"),let:new u6.Name("let"),var:new u6.Name("var")};class lg{constructor({prefixes:$,parent:I}={}){this._names={},this._prefixes=$,this._parent=I}toName($){return $ instanceof u6.Name?$:this.name($)}name($){return new u6.Name(this._newName($))}_newName($){let I=this._names[$]||this._nameGroup($);return`${$}${I.index++}`}_nameGroup($){var I,q;if(((q=(I=this._parent)===null||I===void 0?void 0:I._prefixes)===null||q===void 0?void 0:q.has($))||this._prefixes&&!this._prefixes.has($))throw Error(`CodeGen: prefix "${$}" is not allowed in this scope`);return this._names[$]={prefix:$,index:0}}}df.Scope=lg;class mg extends u6.Name{constructor($,I){super(I);this.prefix=$}setValue($,{property:I,itemIndex:q}){this.value=$,this.scopePath=u6._`.${new u6.Name(I)}[${q}]`}}df.ValueScopeName=mg;var sF0=u6._`\n`;class cf extends lg{constructor($){super($);this._values={},this._scope=$.scope,this.opts={...$,_n:$.lines?sF0:u6.nil}}get(){return this._scope}name($){return new mg($,this._newName($))}value($,I){var q;if(I.ref===void 0)throw Error("CodeGen: ref must be passed in value");let U=this.toName($),{prefix:Y}=U,J=(q=I.key)!==null&&q!==void 0?q:I.ref,Q=this._values[Y];if(Q){let w=Q.get(J);if(Line truncated
`:""},this._extScope=$,this._scope=new u$.Scope({parent:$}),this._nodes=[new ef]}toString(){return this._root.render(this.opts)}name($){return this._scope.name($)}scopeName($){return this._extScope.name($)}scopeValue($,I){let q=this._extScope.value($,I);return(this._values[q.prefix]||(this._values[q.prefix]=new Set)).add(q),q}getScopeValue($,I){return this._extScope.getValue($,I)}scopeRefs($){return this._extScope.scopeRefs($,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def($,I,q,U){let Y=this._scope.toName(I);if(q!==void 0&&U)this._constants[Y.str]=q;return this._leafNode(new mf($,Y,q)),Y}const($,I,q){return this._def(u$.varKinds.const,$,I,q)}let($,I,q){return this._def(u$.varKinds.let,$,I,q)}var($,I,q){return this._def(u$.varKinds.var,$,I,q)}assign($,I,q){return this._leafNode(new ag($,I,q))}add($,I){return this._leafNode(new of($,x6.operators.ADD,I))}code($){if(typeof $=="function")$();else if($!==Y1.nil)this._leafNode(new sf($));return this}object(...$){let I=["{"];for(let[q,U]of $){if(I.length>1)I.push(",");if(I.push(q),q!==U||this.opts.es5)I.push(":"),(0,Y1.addCodeArg)(I,U)}return I.push("}"),new Y1._Code(I)}if($,I,q){if(this._blockNode(new t8($)),I&&q)this.code(I).else().code(q).endIf();else if(I)this.code(I).endIf();else if(q)throw Error('CodeGen: "else" body without "then" body');return this}elseIf($){return this._elseNode(new t8($))}else(){return this._elseNode(new RJ)}endIf(){return this._endBlockNode(t8,RJ)}_for($,I){if(this._blockNode($),I)this.code(I).endFor();return this}for($,I){return this._for(new $n($),I)}forRange($,I,q,U,Y=this.opts.es5?u$.varKinds.var:u$.varKinds.let){let J=this._scope.toName($);return this._for(new In(Y,J,I,q),()=>U(J))}forOf($,I,q,U=u$.varKinds.const){let Y=this._scope.toName($);if(this.opts.es5){let J=I instanceof Y1.Name?I:this.var("_arr",I);return this.forRange("_i",0,Y1._`${J}.length`,(Q)=>{this.var(Y,Y1._`${J}[${Q}]`),q(Y)})}return this._for(new rg("of",U,Y,I),()=>q(Y))}forIn($,I,q,U=this.opts.es5?u$.varKinds.var:u$.varKinds.const){if(this.opts.ownProperties)return this.forOf($,Y1._`Object.keys(${I})`,q);let Y=this._scope.toName($);return this._for(new rg("in",U,Y,I),()=>q(Y))}endFor(){return this._endBlockNode(cI)}label($){return this._leafNode(new rf($))}break($){return this._leafNode(new tf($))}return($){let I=new uG;if(this._blockNode(I),this.code($),I.nodes.length!==1)throw Error('CodeGen: "return" should have one node');return this._endBlockNode(uG)}try($,I,q){if(!I&&!q)throw Error('CodeGen: "try" without "catch" and "finally"');let U=new qn;if(this._blockNode(U),this.code($),I){let Y=this.name("e");this._currNode=U.catch=new xG(Y),I(Y)}if(q)this._currNode=U.finally=new kG,this.code(q);return this._endBlockNode(xG,kG)}throw($){return this._leafNode(new af($))}block($,I){if(this._blockStarts.push(this._nodes.length),$)this.code($).endBlock(I);return this}endBlock($){let I=this._blockStarts.pop();if(I===void 0)throw Error("CodeGen: not in self-balancing block");let q=this._nodes.length-I;if(q<0||$!==void 0&&q!==$)throw Error(`CodeGen: wrong number of nodes: ${q} vs ${$} expected`);return this._nodes.length=I,this}func($,I=Y1.nil,q,U){if(this._blockNode(new yG($,I,q)),U)this.code(U).endFunc();return this}endFunc(){return this._endBlockNode(yG)}optimize($=1){while($-- >0)this._root.optimizeNodes(),this._root.optimizeNames(this._root.names,this._constants)}_leafNode($){return this._currNode.nodes.push($),this}_blockNode($){this._currNode.nodes.push($),this._nodes.push($)}_endBlockNode($,I){let q=this._currNode;if(q instanceof $||I&&q instanceof I)return this._nodes.pop(),this;throw Error(`CodeGen: not in block "${I?`${$.kind}/${I.kind}`:$.kind}"`)}_elseNode($){let I=this._currNode;if(!(I instanceof t8))throw Error('CodeGen: "else" without "if"');return this._currNode=I.else=$,this}get _root(){return this._nodes[0]}get _currNode(){let $=this._nodes;return $[$.length-1]}set _currNode($){let I=this._nodes;I[I.length-1]=$}}x6.CodeGen=Un;function B7($,I){for(let q in I)$[q]=($[q]||0)+(I[q]||0);return $}function fG($,I){return I instanceof Y1._CodeOrName?B7($,I.names):$}function dI($,I,q){if($ instanceof Y1.Name)return U($);if(!Y($))return $;return new Y1._Code($._items.reduce((J,Q)=>{if(Q instanceof Y1.Name)Q=U(Q);if(Q instanceof Y1._Code)J.push(...Q._items);else J.push(Q);return J},[]));function U(J){let Q=q[J.str];if(Q===void 0||I[J.str]!==1)return J;return delete I[J.str],Q}function Y(J){return J instanceof Y1._Code&&J._items.some((Q)=>Q instanceof Y1.Name&&I[Q.str]===1&&q[Q.str]!==void 0)}}function qM0($,I){for(let q in I)$[q]=($[q]||0)-(I[q]||0)}function Yn($){return typeof $=="boolean"||typeof $=="number"||$===null?!$:Y1._`!${tg($)}`}x6.not=Yn;var UM0=Jn(x6.operators.AND);function YM0(...$){return $.reduce(UM0)}x6.and=YM0;var JM0=Jn(x6.operators.OR);function QM0(...$){return $.reduce(JM0)}x6.or=QM0;function Jn($){return(I,q)=>I===Y1.nil?q:q===Y1.nil?I:Y1._`${tg(I)} ${$} ${tg(q)}`}function tg($){return $ instanceof Y1.Name?$:Y1._`(${Line truncated
|| (${Q} == "string" && ${Y} && ${Y} == +${Y})`).assign(K,l0._`+${Y}`);return;case"integer":U.elseIf(l0._`${Q} === "boolean" || ${Y} === null
|| (${Q} === "string" && ${Y} && ${Y} == +${Y} && !(${Y} % 1))`).assign(K,l0._`+${Y}`);return;case"boolean":U.elseIf(l0._`${Y} === "false" || ${Y} === 0 || ${Y} === null`).assign(K,!1).elseIf(l0._`${Y} === "true" || ${Y} === 1`).assign(K,!0);return;case"null":U.elseIf(l0._`${Y} === "" || ${Y} === 0 || ${Y} === false`),U.assign(K,null);return;case"array":U.elseIf(l0._`${Q} === "string" || ${Q} === "number"
|| ${Q} === "boolean" || ${Y} === null`).assign(K,l0._`[${Y}]`)}}}function NA0({gen:$,parentData:I,parentDataProperty:q},U){$.if(l0._`${I} !== undefined`,()=>$.assign(l0._`${I}[${q}]`,U))}function YP($,I,q,U=lI.Correct){let Y=U===lI.Correct?l0.operators.EQ:l0.operators.NEQ,J;switch($){case"null":return l0._`${I} ${Y} null`;case"array":J=l0._`Array.isArray(${I})`;break;case"object":J=l0._`${I} && typeof ${I} == "object" && !Array.isArray(${I})`;break;case"integer":J=Q(l0._`!(${I} % 1) && !isNaN(${I})`);break;case"number":J=Q();break;default:return l0._`typeof ${I} ${Y} ${$}`}return U===lI.Correct?J:(0,l0.not)(J);function Q(K=l0.nil){return(0,l0.and)(l0._`typeof ${I} == "number"`,K,q?l0._`isFinite(${I})`:l0.nil)}}yn.checkDataType=YP;function JP($,I,q,U){if($.length===1)return YP($[0],I,q,U);let Y,J=(0,_n.toHash)($);if(J.array&&J.object){let Q=l0._`typeof ${I} != "object"`;Y=J.null?Q:l0._`!${I} || ${Q}`,delete J.null,delete J.array,delete J.object}else Y=l0.nil;if(J.number)delete J.integer;for(let Q in J)Y=(0,l0.and)(Y,YP(Q,I,q,U));return Y}yn.checkDataTypes=JP;var FA0={message:({schema:$})=>`must be ${$}`,params:({schema:$,schemaValue:I})=>typeof $=="string"?l0._`{type: ${$}}`:l0._`{type: ${I}}`};function QP($){let I=MA0($);(0,ZA0.reportError)(I,FA0)}yn.reportTypeError=QP;function MA0($){let{gen:I,data:q,schema:U}=$,Y=(0,_n.schemaRefOrVal)($,U,"type");return{gen:I,keyword:"type",data:q,schema:U.type,schemaCode:Y,schemaValue:Y,parentSchema:U,params:{},it:$}}});var nn=L((kn)=>{Object.defineProperty(kn,"__esModule",{value:!0});kn.assignDefaults=void 0;var mI=o0(),BA0=w1();function vA0($,I){let{properties:q,items:U}=$.schema;if(I==="object"&&q)for(let Y in q)xn($,Y,q[Y].default);else if(I==="array"&&Array.isArray(U))U.forEach((Y,J)=>xn($,J,Y.default))}kn.assignDefaults=vA0;function xn($,I,q){let{gen:U,compositeRule:Y,data:J,opts:Q}=$;if(q===void 0)return;let K=mI._`${J}${(0,mI.getProperty)(I)}`;if(Y){(0,BA0.checkStrictMode)($,`default is ignored for: ${K}`);return}let z=mI._`${K} === undefined`;if(Q.useDefaults==="empty")z=mI._`${z} || ${K} === null || ${K} === ""`;U.if(z,mI._`${K} = ${(0,mI.stringify)(q)}`)}});var D$=L((cn)=>{Object.defineProperty(cn,"__esModule",{value:!0});cn.validateUnion=cn.validateArray=cn.usePattern=cn.callValidateCode=cn.schemaProperties=cn.allSchemaProperties=cn.noPropertyInData=cn.propertyInData=cn.isOwnProperty=cn.hasPropFunc=cn.reportMissingProp=cn.checkMissingProp=cn.checkReportMissingProp=void 0;var l1=o0(),KP=w1(),K9=a8(),RA0=w1();function CA0($,I){let{gen:q,data:U,it:Y}=$;q.if(wP(q,U,I,Y.opts.ownProperties),()=>{$.setParams({missingProperty:l1._`${I}`},!0),$.error()})}cn.checkReportMissingProp=CA0;function _A0({gen:$,data:I,it:{opts:q}},U,Y){return(0,l1.or)(...U.map((J)=>(0,l1.and)(wP($,I,J,q.ownProperties),l1._`${Y} = ${J}`)))}cn.checkMissingProp=_A0;function hA0($,I){$.setParams({missingProperty:I},!0),$.error()}cn.reportMissingProp=hA0;function bn($){return $.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:l1._`Object.prototype.hasOwnProperty`})}cn.hasPropFunc=bn;function zP($,I,q){return l1._`${bn($)}.call(${I}, ${q})`}cn.isOwnProperty=zP;function SA0($,I,q,U){let Y=l1._`${I}${(0,l1.getProperty)(q)} !== undefined`;return U?l1._`${Y} && ${zP($,I,q)}`:Y}cn.propertyInData=SA0;function wP($,I,q,U){let Y=l1._`${I}${(0,l1.getProperty)(q)} === undefined`;return U?(0,l1.or)(Y,(0,l1.not)(zP($,I,q))):Y}cn.noPropertyInData=wP;function pn($){return $?Object.keys($).filter((I)=>I!=="__proto__"):[]}cn.allSchemaProperties=pn;function yA0($,I){return pn(I).filter((q)=>!(0,KP.alwaysValidSchema)($,I[q]))}cn.schemaProperties=yA0;function uA0({schemaCode:$,data:I,it:{gen:q,topSchemaRef:U,schemaPath:Y,errorPath:J},it:Q},K,z,w){let G=w?l1._`${$}, ${I}, ${U}${Y}`:I,H=[[K9.default.instancePath,(0,l1.strConcat)(K9.default.instancePath,J)],[K9.default.parentData,Q.parentData],[K9.default.parentDataProperty,Q.parentDataProperty],[K9.default.rootData,K9.default.rootData]];if(Q.opts.dynamicRef)H.push([K9.default.dynamicAnchors,K9.default.dynamicAnchors]);let W=l1._`${G}, ${q.object(...H)}`;return z!==l1.nil?l1._`${K}.call(${z}, ${W})`:l1._`${K}(${W})`}cn.callValidateCode=uA0;var xA0=l1._`new RegExp`;function kA0({gen:$,it:{opts:I}},q){let U=I.unicodeRegExp?"u":"",{regExp:Y}=I.code,J=Y(q,U);return $.scopeValue("pattern",{key:J.toString(),ref:J,code:l1._`${Y.code==="new RegExp"?xA0:(0,RA0.useFunc)($,Y)}(${q}, ${U})`})}cn.usePattern=kA0;function fA0($){let{gen:I,data:q,keyword:U,it:Y}=$,J=I.name("valid");if(Y.allErrors){let K=I.let("valid",!0);return Q(()=>I.assign(K,!1)),K}return I.var(J,!0),Q(()=>I.break()),J;function Q(K){let z=I.const("len",l1._`${q}.length`);I.forRange("i",0,z,(w)=>{$.subschema({keyword:U,dataProp:w,dataPropType:KP.Type.Num},J),I.if((0,l1.not)(J),K)})}}cn.validateArray=fA0;function nA0($){let{gen:I,schema:q,keyword:U,it:Y}=$;if(!Array.isArray(q))throw Error("ajv implementation error");if(q.some((z)=>(0,KP.alwaysValidSchema)(Y,z))&&!Y.opts.unevaluated)return;le Line truncated
missingProperty: ${U},
depsCount: ${I},
deps: ${q}}`};var JE0={keyword:"dependencies",type:"object",schemaType:"object",error:Kp.error,code($){let[I,q]=QE0($);Jp($,I),Qp($,q)}};function QE0({schema:$}){let I={},q={};for(let U in $){if(U==="__proto__")continue;let Y=Array.isArray($[U])?I:q;Y[U]=$[U]}return[I,q]}function Jp($,I=$.schema){let{gen:q,data:U,it:Y}=$;if(Object.keys(I).length===0)return;let J=q.let("missing");for(let Q in I){let K=I[Q];if(K.length===0)continue;let z=(0,oJ.propertyInData)(q,U,Q,Y.opts.ownProperties);if($.setParams({property:Q,depsCount:K.length,deps:K.join(", ")}),Y.allErrors)q.if(z,()=>{for(let w of K)(0,oJ.checkReportMissingProp)($,w)});else q.if(_P._`${z} && (${(0,oJ.checkMissingProp)($,K,J)})`),(0,oJ.reportMissingProp)($,J),q.else()}}Kp.validatePropertyDeps=Jp;function Qp($,I=$.schema){let{gen:q,data:U,keyword:Y,it:J}=$,Q=q.name("valid");for(let K in I){if((0,YE0.alwaysValidSchema)(J,I[K]))continue;q.if((0,oJ.propertyInData)(q,U,K,J.opts.ownProperties),()=>{let z=$.subschema({keyword:Y,schemaProp:K},Q);$.mergeValidEvaluated(z,Q)},()=>q.var(Q,!0)),$.ok(Q)}}Kp.validateSchemaDeps=Qp;Kp.default=JE0});var Wp=L((Vp)=>{Object.defineProperty(Vp,"__esModule",{value:!0});var Hp=o0(),wE0=w1(),GE0={message:"property name must be valid",params:({params:$})=>Hp._`{propertyName: ${$.propertyName}}`},HE0={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:GE0,code($){let{gen:I,schema:q,data:U,it:Y}=$;if((0,wE0.alwaysValidSchema)(Y,q))return;let J=I.name("valid");I.forIn("key",U,(Q)=>{$.setParams({propertyName:Q}),$.subschema({keyword:"propertyNames",data:Q,dataTypes:["string"],propertyName:Q,compositeRule:!0},J),I.if((0,Hp.not)(J),()=>{if($.error(!0),!Y.allErrors)I.break()})}),$.ok(J)}};Vp.default=HE0});var hP=L((Zp)=>{Object.defineProperty(Zp,"__esModule",{value:!0});var KH=D$(),f$=o0(),WE0=a8(),zH=w1(),ZE0={message:"must NOT have additional properties",params:({params:$})=>f$._`{additionalProperty: ${$.additionalProperty}}`},XE0={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:ZE0,code($){let{gen:I,schema:q,parentSchema:U,data:Y,errsCount:J,it:Q}=$;if(!J)throw Error("ajv implementation error");let{allErrors:K,opts:z}=Q;if(Q.props=!0,z.removeAdditional!=="all"&&(0,zH.alwaysValidSchema)(Q,q))return;let w=(0,KH.allSchemaProperties)(U.properties),G=(0,KH.allSchemaProperties)(U.patternProperties);H(),$.ok(f$._`${J} === ${WE0.default.errors}`);function H(){I.forIn("key",Y,(O)=>{if(!w.length&&!G.length)X(O);else I.if(W(O),()=>X(O))})}function W(O){let N;if(w.length>8){let T=(0,zH.schemaRefOrVal)(Q,U.properties,"properties");N=(0,KH.isOwnProperty)(I,T,O)}else if(w.length)N=(0,f$.or)(...w.map((T)=>f$._`${O} === ${T}`));else N=f$.nil;if(G.length)N=(0,f$.or)(N,...G.map((T)=>f$._`${(0,KH.usePattern)($,T)}.test(${O})`));return(0,f$.not)(N)}function V(O){I.code(f$._`delete ${Y}[${O}]`)}function X(O){if(z.removeAdditional==="all"||z.removeAdditional&&q===!1){V(O);return}if(q===!1){if($.setParams({additionalProperty:O}),$.error(),!K)I.break();return}if(typeof q=="object"&&!(0,zH.alwaysValidSchema)(Q,q)){let N=I.name("valid");if(z.removeAdditional==="failing")D(O,N,!1),I.if((0,f$.not)(N),()=>{$.reset(),V(O)});else if(D(O,N),!K)I.if((0,f$.not)(N),()=>I.break())}}function D(O,N,T){let P={keyword:"additionalProperties",dataProp:O,dataPropType:zH.Type.Str};if(T===!1)Object.assign(P,{compositeRule:!0,createErrors:!1,allErrors:!1});$.subschema(P,N)}}};Zp.default=XE0});var Lp=L((Op)=>{Object.defineProperty(Op,"__esModule",{value:!0});var OE0=uJ(),Xp=D$(),SP=w1(),Dp=hP(),LE0={keyword:"properties",type:"object",schemaType:"object",code($){let{gen:I,schema:q,parentSchema:U,data:Y,it:J}=$;if(J.opts.removeAdditional==="all"&&U.additionalProperties===void 0)Dp.default.code(new OE0.KeywordCxt(J,Dp.default,"additionalProperties"));let Q=(0,Xp.allSchemaProperties)(q);for(let H of Q)J.definedProperties.add(H);if(J.opts.unevaluated&&Q.length&&J.props!==!0)J.props=SP.mergeEvaluated.props(I,(0,SP.toHash)(Q),J.props);let K=Q.filter((H)=>!(0,SP.alwaysValidSchema)(J,q[H]));if(K.length===0)return;let z=I.name("valid");for(let H of K){if(w(H))G(H);else{if(I.if((0,Xp.propertyInData)(I,Y,H,J.opts.ownProperties)),G(H),!J.allErrors)I.else().var(z,!0);I.endIf()}$.it.definedProperties.add(H),$.ok(z)}function w(H){return J.opts.useDefaults&&!J.compositeRule&&q[H].default!==void 0}function G(H){$.subschema({keyword:"properties",schemaProp:H,dataProp:H},z)}}};Op.default=LE0});var gp=L((Ap)=>{Object.defineProperty(Ap,"__esModule",{value:!0});var Np=D$(),wH=o0(),Fp=w1(),Mp=w1(),FE0={keyword:"patternProperties",type:"object",schemaType:"object",code($){let{gen:I,schema:q,data:U,parentSchema:Y,it:J}=$,{opts:Q}=J,K=(0,Np.allSchemaProperties)(q),z=K.filter((D)=>(0,Fp.alwaysValidSchema)(J,q[D]));if(K.length===0||z.length===K.length&&(!J.opts.unevaluated||J.props===!0))return;let w=Q.strictSchema&&!Q.allowMatchingProperties&&Y.properties,G=I.name("valid");if(J.props!==!0&&!(J.props instanceo Line truncated
\v\f\r\x0E\x0F\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1A\x1B\x1C\x1D\x1E\x1F !"#$٪&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_\`abcdefghijklmnopqrstuvwxyz{|}~°·∙√▒─│┼┤┬├┴┐┌└┘β∞φ±½¼≈«»ﻷﻸ��ﻻﻼ� ­ﺂ£¤ﺄ��ﺎﺏﺕﺙ،ﺝﺡﺥ٠١٢٣٤٥٦٧٨٩ﻑ؛ﺱﺵﺹ؟¢ﺀﺁﺃﺅﻊﺋﺍﺑﺓﺗﺛﺟﺣﺧﺩﺫﺭﺯﺳﺷﺻﺿﻁﻅﻋﻏ¦¬÷×ﻉـﻓﻗﻛﻟﻣﻧﻫﻭﻯﻳﺽﻌﻎﻍﻡﹽّﻥﻩﻬﻰﻲﻐﻕﻵﻶﻝﻙﻱ■�`},ibm864:"cp864",csibm864:"cp864",cp865:{type:"_sbcs",chars:"ÇüéâäàåçêëèïîìÄÅÉæÆôöòûùÿÖÜø£Ø₧ƒáíóúñѪº¿⌐¬½¼¡«¤░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ "},ibm865:"cp865",csibm865:"cp865",cp866:{type:"_sbcs",chars:"АБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмноп░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀рстуфхцчшщъыьэюяЁёЄєЇїЎў°∙·√№¤■ "},ibm866:"cp866",csibm866:"cp866",cp869:{type:"_sbcs",chars:"������Ά�·¬¦‘’Έ―ΉΊΪΌ��ΎΫ©Ώ²³ά£έήίϊΐόύΑΒΓΔΕΖΗ½ΘΙ«»░▒▓│┤ΚΛΜΝ╣║╗╝ΞΟ┐└┴┬├─┼ΠΡ╚╔╩╦╠═╬ΣΤΥΦΧΨΩαβγ┘┌█▄δε▀ζηθικλμνξοπρσςτ΄­±υφχ§ψ΅°¨ωϋΰώ■ "},ibm869:"cp869",csibm869:"cp869",cp922:{type:"_sbcs",chars:"€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£¤¥¦§¨©ª«¬­®‾°±²³´µ·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏŠÑÒÓÔÕÖרÙÚÛÜÝŽßàáâãäåæçèéêëìíîïšñòóôõö÷øùúûüýžÿ"},ibm922:"cp922",csibm922:"cp922",cp1046:{type:"_sbcs",chars:"ﺈ×÷ﹱˆ■│─┐┌└┘ﹹﹻﹽﹿﹷﺊﻰﻳﻲﻎﻏﻐﻶﻸﻺﻼ ¤ﺋﺑﺗﺛﺟﺣ،­ﺧﺳ٠١٢٣٤٥٦٧٨٩ﺷ؛ﺻﺿﻊ؟ﻋءآأؤإئابةتثجحخدذرزسشصضطﻇعغﻌﺂﺄﺎﻓـفقكلمنهوىيًٌٍَُِّْﻗﻛﻟﻵﻷﻹﻻﻣﻧﻬﻩ�"},ibm1046:"cp1046",csibm1046:"cp1046",cp1124:{type:"_sbcs",chars:"€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ЁЂҐЄЅІЇЈЉЊЋЌ­ЎЏАБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмнопрстуфхцчшщъыьэюя№ёђґєѕіїјљњћќ§ўџ"},ibm1124:"cp1124",csibm1124:"cp1124",cp1125:{type:"_sbcs",chars:"АБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмноп░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀рстуфхцчшщъыьэюяЁёҐґЄєІіЇї·√№¤■ "},ibm1125:"cp1125",csibm1125:"cp1125",cp1129:{type:"_sbcs",chars:"€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£¤¥¦§œ©ª«¬­®¯°±²³Ÿµ·Œ¹º»¼½¾¿ÀÁÂĂÄÅÆÇÈÉÊË̀ÍÎÏĐÑ̉ÓÔƠÖרÙÚÛÜỮßàáâăäåæçèéêë́íîïđṇ̃óôơö÷øùúûüư₫ÿ"},ibm1129:"cp1129",csibm1129:"cp1129",cp1133:{type:"_sbcs",chars:"€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ກຂຄງຈສຊຍດຕຖທນບປຜຝພຟມຢຣລວຫອຮ���ຯະາຳິີຶືຸູຼັົຽ���ເແໂໃໄ່້໊໋໌ໍໆ�ໜໝ₭����������������໐໑໒໓໔໕໖໗໘໙��¢¬¦�"},ibm1133:"cp1133",csibm1133:"cp1133",cp1161:{type:"_sbcs",chars:"��������������������������������่กขฃคฅฆงจฉชซฌญฎฏฐฑฒณดตถทธนบปผฝพฟภมยรฤลฦวศษสหฬอฮฯะัาำิีึืฺุู้๊๋€฿เแโใไๅๆ็่้๊๋์ํ๎๏๐๑๒๓๔๕๖๗๘๙๚๛¢¬¦ "},ibm1161:"cp1161",csibm1161:"cp1161",cp1162:{type:"_sbcs",chars:"€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ กขฃคฅฆงจฉชซฌญฎฏฐฑฒณดตถทธนบปผฝพฟภมยรฤลฦวศษสหฬอฮฯะัาำิีึืฺุู����฿เแโใไๅๆ็่้๊๋์ํ๎๏๐๑๒๓๔๕๖๗๘๙๚๛����"},ibm1162:"cp1162",csibm1162:"cp1162",cp1163:{type:"_sbcs",chars:"€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£€¥¦§œ©ª«¬­®¯°±²³Ÿµ·Œ¹º»¼½¾¿ÀÁÂĂÄÅÆÇÈÉÊË̀ÍÎÏĐÑ̉ÓÔƠÖרÙÚÛÜỮßàáâăäåæçèéêë́íîïđṇ̃óôơö÷øùúûüư₫ÿ"},ibm1163:"cp1163",csiLine truncated
\v\f\r\x0E\x0F\x10ỨỰỲỶỸÝỴ\x18\x19\x1A\x1B\x1C\x1D\x1E\x1F !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_\`abcdefghijklmnopqrstuvwxyz{|}~ÀẢÃÁẠẶẬÈẺẼÉẸỆÌỈĨÍỊÒỎÕÓỌỘỜỞỠỚỢÙỦŨ ĂÂÊÔƠƯĐăâêôơưđẶ̀̀̉̃́àảãáạẲằẳẵắẴẮẦẨẪẤỀặầẩẫấậèỂẻẽéẹềểễếệìỉỄẾỒĩíịòỔỏõóọồổỗốộờởỡớợùỖủũúụừửữứựỳỷỹýỵỐ`},georgianacademy:{type:"_sbcs",chars:"€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ·¸¹º»¼½¾¿აბგდევზთიკლმნოპჟრსტუფქღყშჩცძწჭხჯჰჱჲჳჴჵჶçèéêëìíîïðñòóôõö÷øùúûüýþÿ"},georgianps:{type:"_sbcs",chars:"€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ·¸¹º»¼½¾¿აბგდევზჱთიკლმნჲოპჟრსტჳუფქღყშჩცძწჭხჴჯჰჵæçèéêëìíîïðñòóôõö÷øùúûüýþÿ"},pt154:{type:"_sbcs",chars:"ҖҒӮғ„…ҶҮҲүҠӢҢҚҺҸҗ‘’“”•–—ҳҷҡӣңқһҹ ЎўЈӨҘҰ§Ё©Ә«¬ӯ®Ҝ°ұІіҙө·ё№ә»јҪҫҝАБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмнопрстуфхцчшщъыьэюя"},viscii:{type:"_sbcs",chars:`\x00\x01Ẳ\x03\x04ẴẪ\x07\b
\v\f\r\x0E\x0F\x10\x11\x12\x13Ỷ\x15\x16\x17\x18Ỹ\x1A\x1B\x1C\x1DỴ\x1F !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_\`abcdefghijklmnopqrstuvwxyz{|}~ẠẮẰẶẤẦẨẬẼẸẾỀỂỄỆỐỒỔỖỘỢỚỜỞỊỎỌỈỦŨỤỲÕắằặấầẩậẽẹếềểễệốồổỗỠƠộờởịỰỨỪỬơớƯÀÁÂÃẢĂẳẵÈÉÊẺÌÍĨỳĐứÒÓÔạỷừửÙÚỹỵÝỡưàáâãảăữẫèéêẻìíĩỉđựòóôõỏọụùúũủýợỮ`},iso646cn:{type:"_sbcs",chars:`\x00\x01\x02\x03\x04\x05\x06\x07\b
\v\f\r\x0E\x0F\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1A\x1B\x1C\x1D\x1E\x1F !"#¥%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_\`abcdefghijklmnopqrstuvwxyz{|}‾��������������������������������������������������������������������������������������������������������������������������������`},iso646jp:{type:"_sbcs",chars:`\x00\x01\x02\x03\x04\x05\x06\x07\b
\v\f\r\x0E\x0F\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1A\x1B\x1C\x1D\x1E\x1F !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[¥]^_\`abcdefghijklmnopqrstuvwxyz{|}‾��������������������������������������������������������������������������������������������������������������������������������`},hproman8:{type:"_sbcs",chars:"€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ÀÂÈÊËÎÏ´ˋˆ¨˜ÙÛ₤¯Ýý°ÇçÑñ¡¿¤£¥§ƒ¢âêôûáéóúàèòùäëöüÅîØÆåíøæÄìÖÜÉïßÔÁÃãÐðÍÌÓÒÕõŠšÚŸÿÞþ·µ¾—¼½ªº«■»±�"},macintosh:{type:"_sbcs",chars:"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•ß®©™´¨≠ÆØ∞±≤≥¥µ∂∑∏π∫ªºΩæø¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸ⁄¤‹›fifl‡·‚„‰ÂÊÁËÈÍÎÏÌÓÔ�ÒÚÛÙıˆ˜¯˘˙˚¸˝˛ˇ"},ascii:{type:"_sbcs",chars:"��������������������������������������������������������������������������������������������������������������������������������"},tis620:{type:"_sbcs",chars:"���������������������������������กขฃคฅฆงจฉชซฌญฎฏฐฑฒณดตถทธนบปผฝพฟภมยรฤลฦวศษสหฬอฮฯะัาำิีึืฺุู����฿เแโใไๅๆ็่้๊๋์ํ๎๏๐๑๒๓๔๕๖๗๘๙๚๛����"}}});var Rm=L(($_0)=>{var Tj=Y5().Buffer;$_0._dbcs=Q5;var t4=-1,vm=-2,F$=-10,j6=-1000,Aq=Array(256),DQ=-1;for(XQ=0;XQ<256;XQ++)Aq[XQ]=t4;var XQ;function Q5($,I){if(this.encodingName=$.encodingName,!$)throw Error("DBCS codec is called without the data.");if(!$.table)throw Error("Encoding '"+this.encodingName+"' has no data.");var q=$.table();this.decodeTables=[],this.decodeTables[0]=Aq.slice(0),this.decodeTableSeq=[];for(var U=0;U<q.length;U++)this._addDecodeChunk(q[U]);if(typeof $.gb18030==="function"){this.gb18030=$.gb18030();var Y=this.decodeTables.length;this.decodeTables.push(Aq.slice(0));var J=this.decodeTables.length;this.decodeTables.push(Aq.slice(0));var Q=this.decodeTables[0];for(var U=129;U<=254;U++){var K=this.decodeTables[j6-Q[U]];for(var z=48;z<=57;z++){if(K[z]===t4)K[z]=j6-Y;else if(K[z]>j6)throw Error("gb18030 decode tables conflict at byte 2");var w=this.decodeTables[j6-K[z]];for(var G=129;G<=254;G++){if(w[G]===t4)w[G]=j6-J;else if(w[G]===j6-J)continue;else if(w[G]>j6)throw Error("gb18030 decode tables conflict at byte 3");var H=this.decodeTables[j6-w[G]];for(var W=48;W<=57;W++)if(H[W]===t4)H[W]=vm}}}}this.defaultCharUnicode=I.defaultCharUnicode,this.encodeTable=[],this.encodeTableSeq=[];var V={};if($.encodeSkipVals)for(var U=0;U<$.encodeSkipVals.length;U++){var X=$.encodeSkipVals[U];if(typeof X==="number")V[X]=!0;else for(var z=X.from;z<=X.to;z++)V[z]=!0}if(this._fillEncodeTable(0,0,V),$.encodeAdd){for(var D in $.encodeAdd)if(Object.prototype.hasOwnProperty.call($.encodeAdd,D))this._setEncodeChar(D.charCodeAt(0),$.encodeAdd[D])}if(this.defCharSB=this.encodeTable[0][I.defaultCharSingleByte.charCodeAt(0)],this.defCharSB===t4)this.defCharSB=this.encodeTable[0]["?"];if(this.defCharSB===t4)this.defCharSB=63}Q5.prototype.encoder=UV;Q5.prototype.decoder=jj;Q5.prototype._getDecodeTrieNode=function($){var I=[];for(;$>0;$>>>=8)I.push($&255);if(I.length==0)I.push(0);var q=this.decodeTables[0];for(var U=I.length-1;U>0;U--){var Y=q[I[U]];if(Y==t4)q[I[U]]=j6-this.decodeTables.length,this.decodeTables.push(q=Aq.slice(0));else if(Y<=j6)q=this.decodeTables[j6-Y];else throw Error("Overwrite byte in "+this.encodingName+", addr: "+$.toString(16))}return q};Q5.prototype._addDecodeChunk=function($){var I=parseInt($[0],16),q=this._getDecodeTrieNode(I);I=I&255;for(var U=1;U<$.length;U++){var Y=$[U];if(typeof Y==="string")for(var J=0;J<Y.length;){var Q=Y.charCodeAt(J++);if(Q>=55296&&Q<56320){var K=Y.charCodeAt(J++);if(K>=56320&&K<57344)q[I++]=65536+(Q-55296)*1024+(K-56320);else throw Error("Incorrect surrogate pair in "+this.encodingName+" at chunk "+$[0])}else if(Q>4080&&Q<=4095){var z=4095-Q+2,w=[];for(var G=0;G<z;G++)w.push(Y.charCodeAt(J++));q[I++]=F$-this.decodeTableSeq.length,this.decodeTableSeq.push(w)}else q[I++]=Q}else if(typeof Y==="number"){var H=q[I-1]+1;for(var J=0;J<Y;J++)q[I++]=H++}else throw Error("Incorrect type '"+typeof Y+"' given in "+this.encodingName+" at chunk "+$[0])}if(I>255)throw Error("Incorrect chunk in "+this.encodinLine truncated
\x00`,p+=p1(n,2),p+=K.magic,p+=p1(O,2),p+=p1(N,2),p+=p1(h.crc32,4),p+=p1(h.compressedSize,4),p+=p1(h.uncompressedSize,4),p+=p1(w.length,2),p+=p1(T.length,2);var C=UW.LOCAL_FILE_HEADER+p+w+T,f=UW.CENTRAL_FILE_HEADER+p1(t,2)+p+p1(W.length,2)+"\x00\x00\x00\x00"+p1(S,4)+p1(U,4)+w+T+W;return{fileRecord:C,dirRecord:f}},Qf0=function($,I,q,U,Y){var J="",Q=cq.transformTo("string",Y(U));return J=UW.CENTRAL_DIRECTORY_END+"\x00\x00\x00\x00"+p1($,2)+p1($,2)+p1(I,4)+p1(q,4)+p1(Q.length,2)+Q,J},Kf0=function($){var I="";return I=UW.DATA_DESCRIPTOR+p1($.crc32,4)+p1($.compressedSize,4)+p1($.uncompressedSize,4),I};function m$($,I,q,U){dq.call(this,"ZipFileWorker"),this.bytesWritten=0,this.zipComment=I,this.zipPlatform=q,this.encodeFileName=U,this.streamFiles=$,this.accumulate=!1,this.contentBuffer=[],this.dirRecords=[],this.currentSourceOffset=0,this.entriesCount=0,this.currentFile=null,this._sources=[]}cq.inherits(m$,dq);m$.prototype.push=function($){var I=$.meta.percent||0,q=this.entriesCount,U=this._sources.length;if(this.accumulate)this.contentBuffer.push($);else this.bytesWritten+=$.data.length,dq.prototype.push.call(this,{data:$.data,meta:{currentFile:this.currentFile,percent:q?(I+100*(q-U-1))/q:100}})};m$.prototype.openedSource=function($){this.currentSourceOffset=this.bytesWritten,this.currentFile=$.file.name;var I=this.streamFiles&&!$.file.dir;if(I){var q=js($,I,!1,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);this.push({data:q.fileRecord,meta:{percent:0}})}else this.accumulate=!0};m$.prototype.closedSource=function($){this.accumulate=!1;var I=this.streamFiles&&!$.file.dir,q=js($,I,!0,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);if(this.dirRecords.push(q.dirRecord),I)this.push({data:Kf0($),meta:{percent:100}});else{this.push({data:q.fileRecord,meta:{percent:0}});while(this.contentBuffer.length)this.push(this.contentBuffer.shift())}this.currentFile=null};m$.prototype.flush=function(){var $=this.bytesWritten;for(var I=0;I<this.dirRecords.length;I++)this.push({data:this.dirRecords[I],meta:{percent:100}});var q=this.bytesWritten-$,U=Qf0(this.dirRecords.length,q,$,this.zipComment,this.encodeFileName);this.push({data:U,meta:{percent:100}})};m$.prototype.prepareNextSource=function(){if(this.previous=this._sources.shift(),this.openedSource(this.previous.streamInfo),this.isPaused)this.previous.pause();else this.previous.resume()};m$.prototype.registerPrevious=function($){this._sources.push($);var I=this;return $.on("data",function(q){I.processChunk(q)}),$.on("end",function(){if(I.closedSource(I.previous.streamInfo),I._sources.length)I.prepareNextSource();else I.end()}),$.on("error",function(q){I.error(q)}),this};m$.prototype.resume=function(){if(!dq.prototype.resume.call(this))return!1;if(!this.previous&&this._sources.length)return this.prepareNextSource(),!0;if(!this.previous&&!this._sources.length&&!this.generatedError)return this.end(),!0};m$.prototype.error=function($){var I=this._sources;if(!dq.prototype.error.call(this,$))return!1;for(var q=0;q<I.length;q++)try{I[q].error($)}catch(U){}return!0};m$.prototype.lock=function(){dq.prototype.lock.call(this);var $=this._sources;for(var I=0;I<$.length;I++)$[I].lock()};Es.exports=m$});var vs=L((Hf0)=>{var zf0=ZB(),wf0=Bs(),Gf0=function($,I){var q=$||I,U=zf0[q];if(!U)throw Error(q+" is not a valid compression method !");return U};Hf0.generateWorker=function($,I,q){var U=new wf0(I.streamFiles,q,I.platform,I.encodeFileName),Y=0;try{$.forEach(function(J,Q){Y++;var K=Gf0(Q.options.compression,I.compression),z=Q.options.compressionOptions||I.compressionOptions||{},w=Q.dir,G=Q.date;Q._compressWorker(K,z).withStreamInfo("file",{name:J,dir:w,date:G,comment:Q.comment||"",unixPermissions:Q.unixPermissions,dosPermissions:Q.dosPermissions}).pipe(U)}),U.entriesCount=Y}catch(J){U.error(J)}return U}});var Cs=L((ug1,Rs)=>{var Wf0=z4(),YW=I$();function q2($,I){YW.call(this,"Nodejs stream input adapter for "+$),this._upstreamEnded=!1,this._bindStream(I)}Wf0.inherits(q2,YW);q2.prototype._bindStream=function($){var I=this;this._stream=$,$.pause(),$.on("data",function(q){I.push({data:q,meta:{percent:0}})}).on("error",function(q){if(I.isPaused)this.generatedError=q;else I.error(q)}).on("end",function(){if(I.isPaused)I._upstreamEnded=!0;else I.end()})};q2.prototype.pause=function(){if(!YW.prototype.pause.call(this))return!1;return this._stream.pause(),!0};q2.prototype.resume=function(){if(!YW.prototype.resume.call(this))return!1;if(this._upstreamEnded)this.end();else this._stream.resume();return!0};Rs.exports=q2});var bs=L((xg1,ns)=>{var Zf0=Sq(),U2=z4(),ys=I$(),Xf0=FE(),us=ME(),_s=fV(),Df0=ht(),Of0=vs(),hs=yQ(),Lf0=Cs(),xs=function($,I,q){var U=U2.getTypeOf(I),Y,J=U2.extend(q||{},us);if(J.date=J.date||new Date,J.compression!==null)J.compression=J.compression.toUpperCase();if(typeof J.unixPermissions==="string")J.unixPermissions=parseInt(J.unixPermissions,8);if(J.unixPermissions&&J.unixPermissions&16384)J.dir=!0;if(J.dosPermissions&&J.dosPermissions&16)J.dir=!0;if(J. Line truncated
`)}openNode($,I){let q=this.tos,U=this._xml;if(q&&this.open)U.push(">");this._stack.push($),U.push("<"),U.push($),sB(U,I),this.leaf=!0,this.open=!0}addAttribute($,I){if(!this.open)throw Error("Cannot write attributes to node if it is not open");if(I!==void 0)C00(this._xml,$,I)}addAttributes($){if(!this.open)throw Error("Cannot write attributes to node if it is not open");sB(this._xml,$)}writeText($){let I=this._xml;if(this.open)I.push(">"),this.open=!1;this.leaf=!1,I.push(R00.xmlEncode($.toString()))}writeXml($){if(this.open)this._xml.push(">"),this.open=!1;this.leaf=!1,this._xml.push($)}closeNode(){let $=this._stack.pop(),I=this._xml;if(this.leaf)I.push("/>");else I.push("</"),I.push($),I.push(">");this.open=!1,this.leaf=!1}leafNode($,I,q){if(this.openNode($,I),q!==void 0)this.writeText(q);this.closeNode()}closeAll(){while(this._stack.length)this.closeNode()}addRollback(){return this._rollbacks.push({xml:this._xml.length,stack:this._stack.length,leaf:this.leaf,open:this.open}),this.cursor}commit(){this._rollbacks.pop()}rollback(){let $=this._rollbacks.pop();if(this._xml.length>$.xml)this._xml.splice($.xml,this._xml.length-$.xml);if(this._stack.length>$.stack)this._stack.splice($.stack,this._stack.length-$.stack);this.leaf=$.leaf,this.open=$.open}get xml(){return this.closeAll(),this._xml.join("")}}eB.StdDocAttributes={version:"1.0",encoding:"UTF-8",standalone:"yes"};_00.exports=eB});var $v=L((wi0)=>{var h00=typeof TextDecoder>"u"?null:new TextDecoder("utf-8");function zi0($){if(typeof $==="string")return $;if(h00)return h00.decode($);return $.toString()}wi0.bufferToString=zi0});var k00=L((y00)=>{Object.defineProperty(y00,"__esModule",{value:!0});y00.CHAR=`
\r -퟿-�\uD800\uDC00-\uDBFF\uDFFF`;y00.S=` \r
`;y00.NAME_START_CHAR=":A-Z_a-zÀ-ÖØ-öø-˿Ͱ-ͽͿ-῿‌‍⁰-↏Ⰰ-⿯、-퟿豈-﷏ﷰ-�\uD800\uDC00-\uDB7F\uDFFF";y00.NAME_CHAR="-"+y00.NAME_START_CHAR+".0-9·̀-ͯ‿-⁀";y00.CHAR_RE=new RegExp("^["+y00.CHAR+"]$","u");y00.S_RE=new RegExp("^["+y00.S+"]+$","u");y00.NAME_START_CHAR_RE=new RegExp("^["+y00.NAME_START_CHAR+"]$","u");y00.NAME_CHAR_RE=new RegExp("^["+y00.NAME_CHAR+"]$","u");y00.NAME_RE=new RegExp("^["+y00.NAME_START_CHAR+"]["+y00.NAME_CHAR+"]*$","u");y00.NMTOKEN_RE=new RegExp("^["+y00.NAME_CHAR+"]+$","u");var Iv=9,qv=10,Uv=13,Yv=32;y00.S_LIST=[Yv,qv,Uv,Iv];function Hi0($){return $>=Yv&&$<=55295||$===qv||$===Uv||$===Iv||$>=57344&&$<=65533||$>=65536&&$<=1114111}y00.isChar=Hi0;function Vi0($){return $===Yv||$===qv||$===Uv||$===Iv}y00.isS=Vi0;function S00($){return $>=65&&$<=90||$>=97&&$<=122||$===58||$===95||$===8204||$===8205||$>=192&&$<=214||$>=216&&$<=246||$>=248&&$<=767||$>=880&&$<=893||$>=895&&$<=8191||$>=8304&&$<=8591||$>=11264&&$<=12271||$>=12289&&$<=55295||$>=63744&&$<=64975||$>=65008&&$<=65533||$>=65536&&$<=983039}y00.isNameStartChar=S00;function Wi0($){return S00($)||$>=48&&$<=57||$===45||$===46||$===183||$>=768&&$<=879||$>=8255&&$<=8256}y00.isNameChar=Wi0});var o00=L((c00)=>{Object.defineProperty(c00,"__esModule",{value:!0});c00.CHAR="\x01-퟿-�\uD800\uDC00-\uDBFF\uDFFF";c00.RESTRICTED_CHAR="\x01-\b\v\f\x0E-\x1F-„†-Ÿ";c00.S=` \r
`;c00.NAME_START_CHAR=":A-Z_a-zÀ-ÖØ-öø-˿Ͱ-ͽͿ-῿‌‍⁰-↏Ⰰ-⿯、-퟿豈-﷏ﷰ-�\uD800\uDC00-\uDB7F\uDFFF";c00.NAME_CHAR="-"+c00.NAME_START_CHAR+".0-9·̀-ͯ‿-⁀";c00.CHAR_RE=new RegExp("^["+c00.CHAR+"]$","u");c00.RESTRICTED_CHAR_RE=new RegExp("^["+c00.RESTRICTED_CHAR+"]$","u");c00.S_RE=new RegExp("^["+c00.S+"]+$","u");c00.NAME_START_CHAR_RE=new RegExp("^["+c00.NAME_START_CHAR+"]$","u");c00.NAME_CHAR_RE=new RegExp("^["+c00.NAME_CHAR+"]$","u");c00.NAME_RE=new RegExp("^["+c00.NAME_START_CHAR+"]["+c00.NAME_CHAR+"]*$","u");c00.NMTOKEN_RE=new RegExp("^["+c00.NAME_CHAR+"]+$","u");var f00=9,n00=10,b00=13,i00=32;c00.S_LIST=[i00,n00,b00,f00];function Ti0($){return $>=1&&$<=55295||$>=57344&&$<=65533||$>=65536&&$<=1114111}c00.isChar=Ti0;function ji0($){return $>=1&&$<=8||$===11||$===12||$>=14&&$<=31||$>=127&&$<=132||$>=134&&$<=159}c00.isRestrictedChar=ji0;function Ei0($){return $===9||$===10||$===13||$>31&&$<127||$===133||$>159&&$<=55295||$>=57344&&$<=65533||$>=65536&&$<=1114111}c00.isCharAndNotRestricted=Ei0;function Bi0($){return $===i00||$===n00||$===b00||$===f00}c00.isS=Bi0;function p00($){return $>=65&&$<=90||$>=97&&$<=122||$===58||$===95||$===8204||$===8205||$>=192&&$<=214||$>=216&&$<=246||$>=248&&$<=767||$>=880&&$<=893||$>=895&&$<=8191||$>=8304&&$<=8591||$>=11264&&$<=12271||$>=12289&&$<=55295||$>=63744&&$<=64975||$>=65008&&$<=65533||$>=65536&&$<=983039}c00.isNameStartChar=p00;function vi0($){return p00($)||$>=48&&$<=57||$===45||$===46||$===183||$>=768&&$<=879||$>=8255&&$<=8256}c00.isNameChar=vi0});var a00=L((t00)=>{Object.defineProperty(t00,"__esModule",{value:!0});t00.NC_NAME_START_CHAR="A-Z_a-zÀ-ÖØ-öø-˿Ͱ-ͽͿ-῿‌-‍⁰-↏Ⰰ-⿯、-퟿豈-﷏ﷰ-�\uD800\uDC00-\uDB7F\uDFFF";t00.NC_NAME_CHAR="-"+t00.NC_NAME_START_CHAR+".0-9·̀-ͯ‿-⁀";t00.NC_NAME_START_CHAR_RE=new RegExp("^["+t00.NC_NAME_START_CHAR+"]$","u");t00.NC_NAME_CHAR_RE=new RegExp("^["+t00.NC_NAME_CHAR+"]$","u");t00.NC_NAME_RE=new RegExp("^["+t00.NC_NAME_START_CHAR+"]["+t00.NC_NAME_CHAR+"]*$","u");function r00($){return $>=65&&$<=90||$===95||$>=97&&$<=122||$>=192&&$<=214||$>=216&&$<=246||$>=248&&$<=767||$>=880&&$<=893||$>=895&&$<=8191||$>=8204&&$<=8205||$>=8304&&$<=8591||$>=11264&&$<=12271||$>=12289&&$<=55295||$>=63744&&$<=64975||$>=65008&&$<=65533||$>=65536&&$<=983039}t00.isNCNameStartChar=r00;function ci0($){return r00($)||($===45||$===46||$>=48&&$<=57||$===183||$>=768&&$<=879||$>=8255&&$<=8256)}t00.isNCNameChar=ci0});var N10=L((L10)=>{Object.defineProperty(L10,"__esModule",{value:!0});var qU=k00(),ti0=o00(),Lv=a00(),p6=qU.isS,ai0=qU.isChar,D2=qU.isNameStartChar,s00=qU.isNameChar,V10=qU.S_LIST,si0=qU.NAME_RE,ei0=ti0.isChar,$p0=Lv.isNCNameStartChar,Ip0=Lv.isNCNameChar,qp0=Lv.NC_NAME_RE,hW="http://www.w3.org/XML/1998/namespace",IU="http://www.w3.org/2000/xmlns/",Up0={__proto__:null,xml:hW,xmlns:IU},Yp0={__proto__:null,amp:"&",gt:">",lt:"<",quot:'"',apos:"'"},U4=-1,v8=-2,e00=0,Jp0=1,Qv=2,Qp0=3,sq=4,Kp0=5,zp0=6,wp0=7,Kv=8,Gp0=9,Hp0=10,Vp0=11,Wp0=12,B6=13,BW=14,zv=15,Zp0=16,wv=17,Xp0=18,Dp0=19,Gv=20,Op0=21,Lp0=22,Np0=23,$10=24,Hv=25,vW=26,I10=27,Fp0=28,Mp0=29,q10=30,Ap0=31,gp0=32,Q3=33,Pp0=34,Vv=35,O2=36,Wv=37,Tp0=38,U10=39,Y10=40,jp0=41,J10=42,Ep0=43,Bp0=44,Zv=9,r$=10,Xv=13,Q10=32,K10=33,W10=34,L2=38,Z10=39,RW=45,CW=47,vp0=59,C9=60,eq=61,_4=62,$6=63,X10=91,$U=93,z10=133,w10=8232,_W=($)=>$===W10||$===Z10,D10=[W10,Z10],Rp0=[...D10,X10,_4],Cp0=[...D10,C9,$U],_p0=[eq,$6,...V10],hp0=[...V10,_4,L2,C9];function Ov($,I,q){switch(I){case"xml":if(q!==hW)$.fail(`xml prefix must be bound to ${hW}.`);break;case"xmlns":if(q!==IU)$.fail(`xmlns prefix must be bound to ${IU}.`);break;default:}switch(q){case IU:$.fail(I===""?`the default namespace may not be set to ${q}.`:`may not assign a prefix (even "xmlns") to the URI ${IU}.`);break;case hW:switch(I){case"xml":break;case"":$.fail(`the default namespace may not be set to ${q}.`);break;default:$.fail("may not assign the xml namespace to another prefix.")}break;default:}}function Sp0($,I){for(let q of Object.keys(I))Ov($,q,I[q])}var yp0=($)=>qp0.test($),up0=($)=>si0.test($),K3=0,G10=1,Dv=2;L10.EVENTS=["xmldecl","text","processinginstruction","doctype","comment","opentagstart","attribute","opentag","closetag","cdata","error","end","ready"];var H10={xmldecl:"xmldeclHandler",text:"textHandler",processinginstruction:"piHandler",doctype:"doctypeHandler",comment:"commentHandler",opentagstart:"openTagStartHandler",attribute:"attributeHandler",opentag:"openTagHandler",closetag:"closeTagHandler",cdata:"cdataHandler",error:"errorHandler",end:"endHandler",ready:"readyHandler"};class O10{constructor($){this.opt=$!==null&&$!==void 0?$:{},this.fragmentOpt=!!this.opt.fragment;let I=this.xmlnsOpt=!!this.opt.xmlns;if(this.trackPosition=this.opt.position!==!1,this.fileName=this.opt.fileName,I){this.nameStartCheck=$p0,this.nameCheck=Ip0,this.isName=yp0,this.processAttribs=this.processAttribsNS,this.pushAttrib=this.pushAttribNS,this.ns=Object.assign({__proto__:null},Up0);let q=this.opt.additionalNamesp Line truncated
`,I=this.i}}captureToChar($){let{i:I}=this,{chunk:q}=this;while(!0){let U=this.getCode();switch(U){case v8:this.text+=`${q.slice(I,this.prevI)}
`,I=this.i,U=r$;break;case U4:return this.text+=q.slice(I),!1;default:}if(U===$)return this.text+=q.slice(I,this.prevI),!0}}captureNameChars(){let{chunk:$,i:I}=this;while(!0){let q=this.getCode();if(q===U4)return this.name+=$.slice(I),U4;if(!s00(q))return this.name+=$.slice(I,this.prevI),q===v8?r$:q}}skipSpaces(){while(!0){let $=this.getCodeNorm();if($===U4||!p6($))return $}}setXMLVersion($){if(this.currentXMLVersion=$,$==="1.0")this.isChar=ai0,this.getCode=this.getCode10;else this.isChar=ei0,this.getCode=this.getCode11}sBegin(){if(this.chunk.charCodeAt(0)===65279)this.i++,this.column++;this.state=Jp0}sBeginWhitespace(){let $=this.i,I=this.skipSpaces();if(this.prevI!==$)this.xmlDeclPossible=!1;switch(I){case C9:if(this.state=zv,this.text.length!==0)throw Error("no-empty text at start");break;case U4:break;default:this.unget(),this.state=B6,this.xmlDeclPossible=!1}}sDoctype(){var $;let I=this.captureTo(Rp0);switch(I){case _4:{($=this.doctypeHandler)===null||$===void 0||$.call(this,this.text),this.text="",this.state=B6,this.doctype=!0;break}case U4:break;default:if(this.text+=String.fromCodePoint(I),I===X10)this.state=sq;else if(_W(I))this.state=Qp0,this.q=I}}sDoctypeQuote(){let $=this.q;if(this.captureToChar($))this.text+=String.fromCodePoint($),this.q=null,this.state=Qv}sDTD(){let $=this.captureTo(Cp0);if($===U4)return;if(this.text+=String.fromCodePoint($),$===$U)this.state=Qv;else if($===C9)this.state=zp0;else if(_W($))this.state=Kp0,this.q=$}sDTDQuoted(){let $=this.q;if(this.captureToChar($))this.text+=String.fromCodePoint($),this.state=sq,this.q=null}sDTDOpenWaka(){let $=this.getCodeNorm();switch(this.text+=String.fromCodePoint($),$){case K10:this.state=wp0,this.openWakaBang="";break;case $6:this.state=Vp0;break;default:this.state=sq}}sDTDOpenWakaBang(){let $=String.fromCodePoint(this.getCodeNorm()),I=this.openWakaBang+=$;if(this.text+=$,I!=="-")this.state=I==="--"?Kv:sq,this.openWakaBang=""}sDTDComment(){if(this.captureToChar(RW))this.text+="-",this.state=Gp0}sDTDCommentEnding(){let $=this.getCodeNorm();this.text+=String.fromCodePoint($),this.state=$===RW?Hp0:Kv}sDTDCommentEnded(){let $=this.getCodeNorm();if(this.text+=String.fromCodePoint($),$===_4)this.state=sq;else this.fail("malformed comment."),this.state=Kv}sDTDPI(){if(this.captureToChar($6))this.text+="?",this.state=Wp0}sDTDPIEnding(){let $=this.getCodeNorm();if(this.text+=String.fromCodePoint($),$===_4)this.state=sq}sText(){if(this.tags.length!==0)this.handleTextInRoot();else this.handleTextOutsideRoot()}sEntity(){let{i:$}=this,{chunk:I}=this;$:while(!0)switch(this.getCode()){case v8:this.entity+=`${I.slice($,this.prevI)}
`,$=this.i;break;case vp0:{let{entityReturnState:q}=this,U=this.entity+I.slice($,this.prevI);this.state=q;let Y;if(U==="")this.fail("empty entity name."),Y="&;";else Y=this.parseEntity(U),this.entity="";if(q!==B6||this.textHandler!==void 0)this.text+=Y;break $}case U4:this.entity+=I.slice($);break $;default:}}sOpenWaka(){let $=this.getCode();if(D2($))this.state=Pp0,this.unget(),this.xmlDeclPossible=!1;else switch($){case CW:this.state=Ep0,this.xmlDeclPossible=!1;break;case K10:this.state=Zp0,this.openWakaBang="",this.xmlDeclPossible=!1;break;case $6:this.state=Np0;break;default:this.fail("disallowed character in tag name"),this.state=B6,this.xmlDeclPossible=!1}}sOpenWakaBang(){switch(this.openWakaBang+=String.fromCodePoint(this.getCodeNorm()),this.openWakaBang){case"[CDATA[":if(!this.sawRoot&&!this.reportedTextBeforeRoot)this.fail("text data outside of root node."),this.reportedTextBeforeRoot=!0;if(this.closedRoot&&!this.reportedTextAfterRoot)this.fail("text data outside of root node."),this.reportedTextAfterRoot=!0;this.state=Gv,this.openWakaBang="";break;case"--":this.state=wv,this.openWakaBang="";break;case"DOCTYPE":if(this.state=Qv,this.doctype||this.sawRoot)this.fail("inappropriately located doctype declaration.");this.openWakaBang="";break;default:if(this.openWakaBang.length>=7)this.fail("incorrect syntax.")}}sComment(){if(this.captureToChar(RW))this.state=Xp0}sCommentEnding(){var $;let I=this.getCodeNorm();if(I===RW)this.state=Dp0,($=this.commentHandler)===null||$===void 0||$.call(this,this.text),this.text="";else this.text+=`-${String.fromCodePoint(I)}`,this.state=wv}sCommentEnded(){let $=this.getCodeNorm();if($!==_4)this.fail("malformed comment."),this.text+=`--${String.fromCodePoint($)}`,this.state=wv;else this.state=B6}sCData(){if(this.captureToChar($U))this.state=Op0}sCDataEnding(){let $=this.getCodeNorm();if($===$U)this.state=Lp0;else this.text+=`]${String.fromCodePoint($)}`,this.state=Gv}sCDataEnding2(){var $;let I=this.getCodeNorm();switch(I){case _4:{($=this.cdataHandler)===null||$===void 0||$.call(this,this.text),this.text="",this.state=B6;break}case $U:this.text+="]";break;default:this.text+=`]]${String.fromCodePoint(I)}`,this.state=Gv}}sPIFirstChar(){let $=this.getCodeNorm();if(this.nameStartCheck($))this.piTarget+=String.fromCodePoint($),this.state=$10;else if($===$6||p6($))this.fail("processing instruction without a target."),this.state=$===$6?vW:Hv;else this.fail("disallowed character in processing instruction name."),this.piTarget+=String.fromCodePoint($),this.state=$10}sPIRest(){let{chunk:$,i:I}=this;while(!0){let q=this.getCodeNorm();if(q===U4){this.piTarget+=$.slice(I);return}if(!this.nameCheck(q)){this.piTarget+=$.slice(I,this.prevI);let U=q===$6;if(U||p6(q))if(this.piTarget==="xml"){if(!this.xmlDeclPossible)this.fail("an XML declaration must be at the start of the document.");this.state=U?Q3:I10}else this.state=U?vW:Hv;else this.fail("disallowed character in processing instruction name."),this.piTarget+=String.fromCodePoint(q);break}}}sPIBody(){if(this.text.length===0){let $=this.getCodeNorm();if($===$6)this.state=vW;else if(!p6($))this.text=String.fromCodePoint($)}else if(this.captureToChar($6))this.state=vW}sPIEnding(){var $;let I=this.getCodeNorm();if(I===_4){let{piTarget:q}=this;if(q.toLowerCase()==="xml")this.fail("the XML declaration must appear at the start of the document.");($=this.piHandler)===null||$===void 0||$.call(this,{target:q,body:this.text}),this.piTarget=this.text="",this.state=B6}else if(I===$6)this.text+="?";else this.text+=`?${String.fromCodePoint(I)}`,this.state=Hv;this.xmlDeclPossible=!1}sXMLDeclNameStart(){let $=this.skipSpaces();if($===$6){this.state=Q3;return}if($!==U4)this.state=Fp0,this.name=String.fromCodePoint($)}sXMLDeclName(){let $=this.captureTo(_p0);if($===$6){this.state=Q3,this.name+=this.text,this.text="",this.fail("XML declaration is incomplete.");return}if(!(p6($)||$===eq))return;if(this.name+=this.text,this.text="",!this.xmlDeclExpects.includes(this.name))switch(this.name.length){case 0:this.fail("did not expect any more name/value pairs.");break;case 1:this.fail(`expected the name ${this.xmlDeclExpects[0]}.`);break;default:this.fail(`expected one of ${this.xmlDeclExpects.join(", ")}`)}this.state=$===eq?q10:Mp0}sXMLDeclEq(){let $=this.getCodeNorm();if($===$6){this.state=Q3,this.fail("XML declaration is incomplete.");return}if(p6($))return;if($!==eq)this.fail("value required.");this.state=q10}sXMLDeclValueStart(){let $=this.getCodeNorm();if($===$6){this.state=Q3,this.fail("XML declaration is incomplete.");return}if(p6($))return;if(!_W($))this.fail("value must be quoted."),this.q=Q10;else this.q=$;this.state=Ap0}sXMLDeclValue(){let $=this.captureTo([this.q,$6]);if($===$6){this.state=Q3,this.text="",this.fail("XML declaration is incomplete.");return}if($===U4)return;let I=this.text;switch(this.text="",this.name){case"version":{this.xmlDeclExpects=["encoding","standalone"];let q=I;if(this.xmlDecl.version=q,!/^1\.[0-9]+$/.test(q))this.fail("ver Line truncated
`;$=this.i,I=K3;break;case U4:if(U!==void 0)this.text+=q.slice($);break $;default:I=K3}this.forbiddenState=I}handleTextOutsideRoot(){let{i:$}=this,{chunk:I,textHandler:q}=this,U=!1;$:while(!0){let Y=this.getCode();switch(Y){case C9:{if(this.state=zv,q!==void 0){let{text:J}=this,Q=I.slice($,this.prevI);if(J.length!==0)q(J+Q),this.text="";else if(Q.length!==0)q(Q)}break $}case L2:if(this.state=BW,this.entityReturnState=B6,q!==void 0)this.text+=I.slice($,this.prevI);U=!0;break $;case v8:if(q!==void 0)this.text+=`${I.slice($,this.prevI)}
`;$=this.i;break;case U4:if(q!==void 0)this.text+=I.slice($);break $;default:if(!p6(Y))U=!0}}if(!U)return;if(!this.sawRoot&&!this.reportedTextBeforeRoot)this.fail("text data outside of root node."),this.reportedTextBeforeRoot=!0;if(this.closedRoot&&!this.reportedTextAfterRoot)this.fail("text data outside of root node."),this.reportedTextAfterRoot=!0}pushAttribNS($,I){var q;let{prefix:U,local:Y}=this.qname($),J={name:$,prefix:U,local:Y,value:I};if(this.attribList.push(J),(q=this.attributeHandler)===null||q===void 0||q.call(this,J),U==="xmlns"){let Q=I.trim();if(this.currentXMLVersion==="1.0"&&Q==="")this.fail("invalid attempt to undefine prefix in XML 1.0");this.topNS[Y]=Q,Ov(this,Y,Q)}else if($==="xmlns"){let Q=I.trim();this.topNS[""]=Q,Ov(this,"",Q)}}pushAttribPlain($,I){var q;let U={name:$,value:I};this.attribList.push(U),(q=this.attributeHandler)===null||q===void 0||q.call(this,U)}end(){var $,I;if(!this.sawRoot)this.fail("document must contain a root element.");let{tags:q}=this;while(q.length>0){let Y=q.pop();this.fail(`unclosed tag: ${Y.name}`)}if(this.state!==e00&&this.state!==B6)this.fail("unexpected end.");let{text:U}=this;if(U.length!==0)($=this.textHandler)===null||$===void 0||$.call(this,U),this.text="";return this._closed=!0,(I=this.endHandler)===null||I===void 0||I.call(this),this._init(),this}resolve($){var I,q;let U=this.topNS[$];if(U!==void 0)return U;let{tags:Y}=this;for(let J=Y.length-1;J>=0;J--)if(U=Y[J].ns[$],U!==void 0)return U;if(U=this.ns[$],U!==void 0)return U;return(q=(I=this.opt).resolvePrefix)===null||q===void 0?void 0:q.call(I,$)}qname($){let I=$.indexOf(":");if(I===-1)return{prefix:"",local:$};let q=$.slice(I+1),U=$.slice(0,I);if(U===""||q===""||q.includes(":"))this.fail(`malformed name: ${$}.`);return{prefix:U,local:q}}processAttribsNS(){var $;let{attribList:I}=this,q=this.tag;{let{prefix:J,local:Q}=this.qname(q.name);q.prefix=J,q.local=Q;let K=q.uri=($=this.resolve(J))!==null&&$!==void 0?$:"";if(J!==""){if(J==="xmlns")this.fail('tags may not have "xmlns" as prefix.');if(K==="")this.fail(`unbound namespace prefix: ${JSON.stringify(J)}.`),q.uri=J}}if(I.length===0)return;let{attributes:U}=q,Y=new Set;for(let J of I){let{name:Q,prefix:K,local:z}=J,w,G;if(K==="")w=Q==="xmlns"?IU:"",G=Q;else{if(w=this.resolve(K),w===void 0)this.fail(`unbound namespace prefix: ${JSON.stringify(K)}.`),w=K;G=`{${w}}${z}`}if(Y.has(G))this.fail(`duplicate attribute: ${G}.`);Y.add(G),J.uri=w,U[Q]=J}this.attribList=[]}processAttribsPlain(){let{attribList:$}=this,I=this.tag.attributes;for(let{name:q,value:U}of $){if(I[q]!==void 0)this.fail(`duplicate attribute: ${q}.`);I[q]=U}this.attribList=[]}openTag(){var $;this.processAttribs();let{tags:I}=this,q=this.tag;q.isSelfClosing=!1,($=this.openTagHandler)===null||$===void 0||$.call(this,q),I.push(q),this.state=B6,this.name=""}openSelfClosingTag(){var $,I,q;this.processAttribs();let{tags:U}=this,Y=this.tag;if(Y.isSelfClosing=!0,($=this.openTagHandler)===null||$===void 0||$.call(this,Y),(I=this.closeTagHandler)===null||I===void 0||I.call(this,Y),(this.tag=(q=U[U.length-1])!==null&&q!==void 0?q:null)===null)this.closedRoot=!0;this.state=B6,this.name=""}closeTag(){let{tags:$,name:I}=this;if(this.state=B6,this.name="",I===""){this.fail("weird empty close tag."),this.text+="</>";return}let q=this.closeTagHandler,U=$.length;while(U-- >0){let Y=this.tag=$.pop();if(this.topNS=Y.ns,q===null||q===void 0||q(Y),Y.name===I)break;this.fail("unexpected close tag.")}if(U===0)this.closedRoot=!0;else if(U<0)this.fail(`unmatched closing tag: ${I}.`),this.text+=`</${I}>`}parseEntity($){if($[0]!=="#"){let q=this.ENTITIES[$];if(q!==void 0)return q;return this.fail(this.isName($)?"undefined entity.":"disallowed character in entity name."),`&${$};`}let I=NaN;if($[1]==="x"&&/^#x[0-9a-f]+$/i.test($))I=parseInt($.slice(2),16);else if(/^#[0-9]+$/.test($))I=parseInt($.slice(1),10);if(!this.isChar(I))return this.fail("malformed character entity."),`&${$};`;return String.fromCodePoint(I)}}L10.SaxesParser=O10});var N2=L((FP1,F10)=>{var{SaxesParser:fp0}=N10(),{PassThrough:np0}=W6(),{bufferToString:bp0}=$v();F10.exports=async function*($){if($.pipe&&!$[Symbol.asyncIterator])$=$.pipe(new np0);let I=new fp0,q;I.on("error",(Y)=>{q=Y});let U=[];I.on("opentag",(Y)=>U.push({eventType:"opentag",value:Y})),I.on("text",(Y)=>U.push({eventType:"text",value:Y})),I.on("closetag",(Y)=>U.push({eventType:"closetag",value:Y}));for await(let Y of $){if(I.write(bp0(Y)),q)throw q;yield U,U=[]}}});var Z0=L((MP1,M10)=>{var ip0=N2(),pp0=e4();class UU{prepare(){}render(){}parseOpen($){}parseText($){}parseClose($){}reconcile($,I){}reset(){if(this.model=null,this.map)Object.values(this.map).forEach(($)=>{if($ instanceof UU)$.reset();else if($.xform)$.xform.reset()})}mergeModel($){this.model=Object.assign(this.model||{},$)}async parse($){for await(let I of $)for(let{eventType:q,value:U}of I)if(q==="opentag")this.parseOpen(U);else if(q==="text")this.parseText(U);else if(q==="closetag"){if(!this.parseClose(U.name))return thLine truncated
<a:theme xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main" name="Office Theme"> <a:themeElements> <a:clrScheme name="Office"> <a:dk1> <a:sysClr val="windowText" lastClr="000000"/> </a:dk1> <a:lt1> <a:sysClr val="window" lastClr="FFFFFF"/> </a:lt1> <a:dk2> <a:srgbClr val="1F497D"/> </a:dk2> <a:lt2> <a:srgbClr val="EEECE1"/> </a:lt2> <a:accent1> <a:srgbClr val="4F81BD"/> </a:accent1> <a:accent2> <a:srgbClr val="C0504D"/> </a:accent2> <a:accent3> <a:srgbClr val="9BBB59"/> </a:accent3> <a:accent4> <a:srgbClr val="8064A2"/> </a:accent4> <a:accent5> <a:srgbClr val="4BACC6"/> </a:accent5> <a:accent6> <a:srgbClr val="F79646"/> </a:accent6> <a:hlink> <a:srgbClr val="0000FF"/> </a:hlink> <a:folHlink> <a:srgbClr val="800080"/> </a:folHlink> </a:clrScheme> <a:fontScheme name="Office"> <a:majorFont> <a:latin typeface="Cambria"/> <a:ea typeface=""/> <a:cs typeface=""/> <a:font script="Jpan" typeface="MS Pゴシック"/> <a:font script="Hang" typeface="맑은 고딕"/> <a:font script="Hans" typeface="宋体"/> <a:font script="Hant" typeface="新細明體"/> <a:font script="Arab" typeface="Times New Roman"/> <a:font script="Hebr" typeface="Times New Roman"/> <a:font script="Thai" typeface="Tahoma"/> <a:font script="Ethi" typeface="Nyala"/> <a:font script="Beng" typeface="Vrinda"/> <a:font script="Gujr" typeface="Shruti"/> <a:font script="Khmr" typeface="MoolBoran"/> <a:font script="Knda" typeface="Tunga"/> <a:font script="Guru" typeface="Raavi"/> <a:font script="Cans" typeface="Euphemia"/> <a:font script="Cher" typeface="Plantagenet Cherokee"/> <a:font script="Yiii" typeface="Microsoft Yi Baiti"/> <a:font script="Tibt" typeface="Microsoft Himalaya"/> <a:font script="Thaa" typeface="MV Boli"/> <a:font script="Deva" typeface="Mangal"/> <a:font script="Telu" typeface="Gautami"/> <a:font script="Taml" typeface="Latha"/> <a:font script="Syrc" typeface="Estrangelo Edessa"/> <a:font script="Orya" typeface="Kalinga"/> <a:font script="Mlym" typeface="Kartika"/> <a:font script="Laoo" typeface="DokChampa"/> <a:font script="Sinh" typeface="Iskoola Pota"/> <a:font script="Mong" typeface="Mongolian Baiti"/> <a:font script="Viet" typeface="Times New Roman"/> <a:font script="Uigh" typeface="Microsoft Uighur"/> <a:font script="Geor" typeface="Sylfaen"/> </a:majorFont> <a:minorFont> <a:latin typeface="Calibri"/> <a:ea typeface=""/> <a:cs typeface=""/> <a:font script="Jpan" typeface="MS Pゴシック"/> <a:font script="Hang" typeface="맑은 고딕"/> <a:font script="Hans" typeface="宋体"/> <a:font script="Hant" typeface="新細明體"/> <a:font script="Arab" typeface="Arial"/> <a:font script="Hebr" typeface="Arial"/> <a:font script="Thai" typeface="Tahoma"/> <a:font script="Ethi" typeface="Nyala"/> <a:font script="Beng" typeface="Vrinda"/> <a:font script="Gujr" typeface="Shruti"/> <a:font script="Khmr" typeface="DaunPenh"/> <a:font script="Knda" typeface="Tunga"/> <a:font script="Guru" typeface="Raavi"/> <a:font script="Cans" typeface="Euphemia"/> <a:font script="Cher" typeface="Plantagenet Cherokee"/> <a:font script="Yiii" typeface="Microsoft Yi Baiti"/> <a:font script="Tibt" typeface="Microsoft Himalaya"/> <a:font script="Thaa" typeface="MV Boli"/> <a:font script="Deva" typeface="Mangal"/> <a:font script="Telu" typeface="Gautami"/> <a:font script="Taml" typeface="Latha"/> <a:font script="Syrc" typeface="Estrangelo Edessa"/> <a:font script="Orya" typeface="Kalinga"/> <a:font script="Mlym" typeface="Kartika"/> <a:font script="Laoo" typeface="DokChampa"/> <a:font script="Sinh" typeface="Iskoola Pota"/> <a:font script="Mong" typeface="Mongolian Baiti"/> <a:font script="Viet" typeface="Arial"/> <a:font script="Uigh" typeface="Microsoft Uighur"/> <a:font script="Geor" typeface="Sylfaen"/> </a:minorFont> </a:fontScheme> <a:fmtScheme name="Office"> <a:fillStyleLst> <a:solidFill> <a:schemeClr val="phClr"/> </a:solidFill> <a:gradFill rotWithShape="1"> <a:gsLst> <a:gs pos="0"> <a:schemeClr val="phClr"> <a:tint val="50000"/> <a:satMod val="300000"/> </a:schemeClr> </a:gs> <a:gs pos="35000"> <a:schemeClr val="phClr"> <a:tint val="37000"/> <a:satMod val="300000"/> </a:schemeClr> </a:gs> <a:gs pos="100000"> <a:schemeClr val="phClr"> <a:tint val="15000"/> <a:satMod val="350000"/> </a:schemeClr> </a:gs> </a:gsLst> <a:lin ang="16200000" scaled="1"/> </a:gradFill> <a:gradFill rotWithShape="1"> <a:gsLst> <a:gs pos="0"> <a:schemeClr val="phClr"> <a:tint val="100000"/> <a:shade val="100000"/> <a:satMod val="130000"/> </a:schemeClr> </a:gs> <a:gs pos="100000"> <a:schemeClr val="phClr"> <a:tint val="50000"/> <a:shade val="100000"/> <a:satMod val="350000"/> </a:schemeClr> </a:gs> </a:gsLst> <a:lin ang="16200000" scaled="0"/> </a:gradFill> </a:fillStyleLst> <a:lnStyleLst> <a:ln w="9525" cap="flat" cmpd="sng" algn="ctr"> <a:solidFill> <a:schemeClr val="phClr"> <a:shade val="95000"/> <a:satMod val="105000"/> </a:schemeClr> </a:solidFill> <a:prstDash val="solid"/> </a:ln> <a:ln w="25400" cap="flat" cmpd="sng" algn="ctr"> <a:solidFill> <a:Line truncated
`,this.quote='"',this.escape=this.quote,this.quoteColumns=!1,this.quoteHeaders=this.quoteColumns,this.headers=null,this.includeEndRowDelimiter=!1,this.writeBOM=!1,this.BOM="\uFEFF",this.alwaysWriteHeaders=!1,Object.assign(this,$||{}),typeof($===null||$===void 0?void 0:$.quoteHeaders)>"u")this.quoteHeaders=this.quoteColumns;if(($===null||$===void 0?void 0:$.quote)===!0)this.quote='"';else if(($===null||$===void 0?void 0:$.quote)===!1)this.quote="";if(typeof($===null||$===void 0?void 0:$.escape)!=="string")this.escape=this.quote;this.shouldWriteHeaders=!!this.headers&&((I=$.writeHeaders)!==null&&I!==void 0?I:!0),this.headers=Array.isArray(this.headers)?this.headers:null,this.escapedQuote=`${this.escape}${this.quote}`}}a90.FormatterOptions=t90});var VZ=L((lj1,q70)=>{var er0="[object AsyncFunction]",$t0="[object Function]",It0="[object GeneratorFunction]",qt0="[object Null]",Ut0="[object Proxy]",Yt0="[object Undefined]",Jt0=typeof global=="object"&&global&&global.Object===Object&&global,Qt0=typeof self=="object"&&self&&self.Object===Object&&self,Kt0=Jt0||Qt0||Function("return this")(),$70=Object.prototype,zt0=$70.hasOwnProperty,I70=$70.toString,e90=Kt0.Symbol,Z3=e90?e90.toStringTag:void 0;function wt0($){if($==null)return $===void 0?Yt0:qt0;return Z3&&Z3 in Object($)?Gt0($):Ht0($)}function Gt0($){var I=zt0.call($,Z3),q=$[Z3];try{$[Z3]=void 0;var U=!0}catch(J){}var Y=I70.call($);if(U)if(I)$[Z3]=q;else delete $[Z3];return Y}function Ht0($){return I70.call($)}function Vt0($){if(!Wt0($))return!1;var I=wt0($);return I==$t0||I==It0||I==er0||I==Ut0}function Wt0($){var I=typeof $;return $!=null&&(I=="object"||I=="function")}q70.exports=Vt0});var x70=L((WZ,WU)=>{var Zt0=200,bR="__lodash_hash_undefined__",MZ=1,Z70=2,X70=9007199254740991,ZZ="[object Arguments]",SR="[object Array]",Xt0="[object AsyncFunction]",D70="[object Boolean]",O70="[object Date]",L70="[object Error]",N70="[object Function]",Dt0="[object GeneratorFunction]",XZ="[object Map]",F70="[object Number]",Ot0="[object Null]",VU="[object Object]",U70="[object Promise]",Lt0="[object Proxy]",M70="[object RegExp]",DZ="[object Set]",A70="[object String]",Nt0="[object Symbol]",Ft0="[object Undefined]",yR="[object WeakMap]",g70="[object ArrayBuffer]",OZ="[object DataView]",Mt0="[object Float32Array]",At0="[object Float64Array]",gt0="[object Int8Array]",Pt0="[object Int16Array]",Tt0="[object Int32Array]",jt0="[object Uint8Array]",Et0="[object Uint8ClampedArray]",Bt0="[object Uint16Array]",vt0="[object Uint32Array]",Rt0=/[\\^$.*+?()[\]{}|]/g,Ct0=/^\[object .+?Constructor\]$/,_t0=/^(?:0|[1-9]\d*)$/,o1={};o1[Mt0]=o1[At0]=o1[gt0]=o1[Pt0]=o1[Tt0]=o1[jt0]=o1[Et0]=o1[Bt0]=o1[vt0]=!0;o1[ZZ]=o1[SR]=o1[g70]=o1[D70]=o1[OZ]=o1[O70]=o1[L70]=o1[N70]=o1[XZ]=o1[F70]=o1[VU]=o1[M70]=o1[DZ]=o1[A70]=o1[yR]=!1;var P70=typeof global=="object"&&global&&global.Object===Object&&global,ht0=typeof self=="object"&&self&&self.Object===Object&&self,F5=P70||ht0||Function("return this")(),T70=typeof WZ=="object"&&WZ&&!WZ.nodeType&&WZ,Y70=T70&&typeof WU=="object"&&WU&&!WU.nodeType&&WU,j70=Y70&&Y70.exports===T70,CR=j70&&P70.process,J70=function(){try{return CR&&CR.binding&&CR.binding("util")}catch($){}}(),Q70=J70&&J70.isTypedArray;function St0($,I){var q=-1,U=$==null?0:$.length,Y=0,J=[];while(++q<U){var Q=$[q];if(I(Q,q,$))J[Y++]=Q}return J}function yt0($,I){var q=-1,U=I.length,Y=$.length;while(++q<U)$[Y+q]=I[q];return $}function ut0($,I){var q=-1,U=$==null?0:$.length;while(++q<U)if(I($[q],q,$))return!0;return!1}function xt0($,I){var q=-1,U=Array($);while(++q<$)U[q]=I(q);return U}function kt0($){return function(I){return $(I)}}function ft0($,I){return $.has(I)}function nt0($,I){return $==null?void 0:$[I]}function bt0($){var I=-1,q=Array($.size);return $.forEach(function(U,Y){q[++I]=[Y,U]}),q}function it0($,I){return function(q){return $(I(q))}}function pt0($){var I=-1,q=Array($.size);return $.forEach(function(U){q[++I]=U}),q}var ct0=Array.prototype,dt0=Function.prototype,AZ=Object.prototype,_R=F5["__core-js_shared__"],E70=dt0.toString,C8=AZ.hasOwnProperty,K70=function(){var $=/[^.]+$/.exec(_R&&_R.keys&&_R.keys.IE_PROTO||"");return $?"Symbol(src)_1."+$:""}(),B70=AZ.toString,lt0=RegExp("^"+E70.call(C8).replace(Rt0,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),z70=j70?F5.Buffer:void 0,LZ=F5.Symbol,w70=F5.Uint8Array,v70=AZ.propertyIsEnumerable,mt0=ct0.splice,X3=LZ?LZ.toStringTag:void 0,G70=Object.getOwnPropertySymbols,ot0=z70?z70.isBuffer:void 0,rt0=it0(Object.keys,Object),uR=ZU(F5,"DataView"),j2=ZU(F5,"Map"),xR=ZU(F5,"Promise"),kR=ZU(F5,"Set"),fR=ZU(F5,"WeakMap"),E2=ZU(Object,"create"),tt0=L3(uR),at0=L3(j2),st0=L3(xR),et0=L3(kR),$a0=L3(fR),H70=LZ?LZ.prototype:void 0,hR=H70?H70.valueOf:void 0;function D3($){var I=-1,q=$==null?0:$.length;this.clear();while(++I<q){var U=$[I];this.set(U[0],U[1])}}function Ia0(){this.__data__=E2?E2(null):{},this.size=0}function qa0($){var I=this.has($)&&delete this.__data__[$];return this.size-=I?1:0,I}function Ua0($){var I=this.__data Line truncated
]`;this.ESCAPE_REGEXP=new RegExp(I)}set headers($){this._headers=$}shouldQuote($,I){let q=I?this.formatterOptions.quoteHeaders:this.formatterOptions.quoteColumns;if(ws0.default(q))return q;if(Array.isArray(q))return q[$];if(this._headers!==null)return q[this._headers[$]];return!1}format($,I,q){let U=`${Gs0.default($)?"":$}`.replace(/\0/g,""),{formatterOptions:Y}=this;if(Y.quote!==""){if(U.indexOf(Y.quote)!==-1)return this.quoteField(U.replace(this.REPLACE_REGEXP,Y.escapedQuote))}if(U.search(this.ESCAPE_REGEXP)!==-1||this.shouldQuote(I,q))return this.quoteField(U);return U}quoteField($){let{quote:I}=this.formatterOptions;return`${I}${$}${I}`}}XU.FieldFormatter=l70});var lR=L((m70)=>{Object.defineProperty(m70,"__esModule",{value:!0});m70.isSyncTransform=void 0;m70.isSyncTransform=($)=>$.length===1});var t70=L((DU)=>{var r70=DU&&DU.__importDefault||function($){return $&&$.__esModule?$:{default:$}};Object.defineProperty(DU,"__esModule",{value:!0});DU.RowFormatter=void 0;var Vs0=r70(VZ()),Ws0=r70(x70()),Zs0=dR(),Xs0=lR();class N3{constructor($){if(this.rowCount=0,this.formatterOptions=$,this.fieldFormatter=new Zs0.FieldFormatter($),this.headers=$.headers,this.shouldWriteHeaders=$.shouldWriteHeaders,this.hasWrittenHeaders=!1,this.headers!==null)this.fieldFormatter.headers=this.headers;if($.transform)this.rowTransform=$.transform}static isRowHashArray($){if(Array.isArray($))return Array.isArray($[0])&&$[0].length===2;return!1}static isRowArray($){return Array.isArray($)&&!this.isRowHashArray($)}static gatherHeaders($){if(N3.isRowHashArray($))return $.map((I)=>I[0]);if(Array.isArray($))return $;return Object.keys($)}static createTransform($){if(Xs0.isSyncTransform($))return(I,q)=>{let U=null;try{U=$(I)}catch(Y){return q(Y)}return q(null,U)};return(I,q)=>{$(I,q)}}set rowTransform($){if(!Vs0.default($))throw TypeError("The transform should be a function");this._rowTransform=N3.createTransform($)}format($,I){this.callTransformer($,(q,U)=>{if(q)return I(q);if(!$)return I(null);let Y=[];if(U){let{shouldFormatColumns:J,headers:Q}=this.checkHeaders(U);if(this.shouldWriteHeaders&&Q&&!this.hasWrittenHeaders)Y.push(this.formatColumns(Q,!0)),this.hasWrittenHeaders=!0;if(J){let K=this.gatherColumns(U);Y.push(this.formatColumns(K,!1))}}return I(null,Y)})}finish($){let I=[];if(this.formatterOptions.alwaysWriteHeaders&&this.rowCount===0){if(!this.headers)return $(Error("`alwaysWriteHeaders` option is set to true but `headers` option not provided."));I.push(this.formatColumns(this.headers,!0))}if(this.formatterOptions.includeEndRowDelimiter)I.push(this.formatterOptions.rowDelimiter);return $(null,I)}checkHeaders($){if(this.headers)return{shouldFormatColumns:!0,headers:this.headers};let I=N3.gatherHeaders($);if(this.headers=I,this.fieldFormatter.headers=I,!this.shouldWriteHeaders)return{shouldFormatColumns:!0,headers:null};return{shouldFormatColumns:!Ws0.default(I,$),headers:I}}gatherColumns($){if(this.headers===null)throw Error("Headers is currently null");if(!Array.isArray($))return this.headers.map((I)=>$[I]);if(N3.isRowHashArray($))return this.headers.map((I,q)=>{let U=$[q];if(U)return U[1];return""});if(N3.isRowArray($)&&!this.shouldWriteHeaders)return $;return this.headers.map((I,q)=>$[q])}callTransformer($,I){if(!this._rowTransform)return I(null,$);return this._rowTransform($,I)}formatColumns($,I){let q=$.map((Y,J)=>this.fieldFormatter.format(Y,J,I)).join(this.formatterOptions.delimiter),{rowCount:U}=this;if(this.rowCount+=1,U)return[this.formatterOptions.rowDelimiter,q].join("");return q}}DU.RowFormatter=N3});var a70=L((TZ)=>{Object.defineProperty(TZ,"__esModule",{value:!0});TZ.FieldFormatter=TZ.RowFormatter=void 0;var Ds0=t70();Object.defineProperty(TZ,"RowFormatter",{enumerable:!0,get:function(){return Ds0.RowFormatter}});var Os0=dR();Object.defineProperty(TZ,"FieldFormatter",{enumerable:!0,get:function(){return Os0.FieldFormatter}})});var mR=L((e70)=>{Object.defineProperty(e70,"__esModule",{value:!0});e70.CsvFormatterStream=void 0;var Ns0=o("stream"),Fs0=a70();class s70 extends Ns0.Transform{constructor($){super({writableObjectMode:$.objectMode});this.hasWrittenBOM=!1,this.formatterOptions=$,this.rowFormatter=new Fs0.RowFormatter($),this.hasWrittenBOM=!$.writeBOM}transform($){return this.rowFormatter.rowTransform=$,this}_transform($,I,q){let U=!1;try{if(!this.hasWrittenBOM)this.push(this.formatterOptions.BOM),this.hasWrittenBOM=!0;this.rowFormatter.format($,(Y,J)=>{if(Y)return U=!0,q(Y);if(J)J.forEach((Q)=>{this.push(Buffer.from(Q,"utf8"))});return U=!0,q()})}catch(Y){if(U)throw Y;q(Y)}}_flush($){this.rowFormatter.finish((I,q)=>{if(I)return $(I);if(q)q.forEach((U)=>{this.push(Buffer.from(U,"utf8"))});return $()})}}e70.CsvFormatterStream=s70});var q30=L((O1)=>{var I30=O1&&O1.__createBinding||(Object.create?function($,I,q,U){if(U===void 0)U=q;Object.defineProperty($,U,{enumerable:!0,get:function(){return I[q]}})}:function($,I,q,U){if(U===void 0)U=q;$[U]=I[q]}),Ms0=O1&&O1.__setModuleDefault||(Object.create?function($,I){Ob Line truncated
`||I===`\r
`}static isTokenCarriageReturn($,I){return $.token===I.carriageReturn}static isTokenComment($,I){return I.supportsComments&&!!$&&$.token===I.comment}static isTokenEscapeCharacter($,I){return $.token===I.escapeChar}static isTokenQuote($,I){return $.token===I.quote}static isTokenDelimiter($,I){return $.token===I.delimiter}}UI0.Token=qI0});var OC=L((KI0)=>{Object.defineProperty(KI0,"__esModule",{value:!0});KI0.Scanner=void 0;var JI0=i9(),v11=/((?:\r\n)|\n|\r)/;class QI0{constructor($){this.cursor=0,this.line=$.line,this.lineLength=this.line.length,this.parserOptions=$.parserOptions,this.hasMoreData=$.hasMoreData,this.cursor=$.cursor||0}get hasMoreCharacters(){return this.lineLength>this.cursor}get nextNonSpaceToken(){let{lineFromCursor:$}=this,I=this.parserOptions.NEXT_TOKEN_REGEXP;if($.search(I)===-1)return null;let q=I.exec($);if(q==null)return null;let U=q[1],Y=this.cursor+(q.index||0);return new JI0.Token({token:U,startCursor:Y,endCursor:Y+U.length-1})}get nextCharacterToken(){let{cursor:$,lineLength:I}=this;if(I<=$)return null;return new JI0.Token({token:this.line[$],startCursor:$,endCursor:$})}get lineFromCursor(){return this.line.substr(this.cursor)}advancePastLine(){let $=v11.exec(this.lineFromCursor);if(!$){if(this.hasMoreData)return null;return this.cursor=this.lineLength,this}return this.cursor+=($.index||0)+$[0].length,this}advanceTo($){return this.cursor=$,this}advanceToToken($){return this.cursor=$.startCursor,this}advancePastToken($){return this.cursor=$.endCursor+1,this}truncateToCursor(){return this.line=this.lineFromCursor,this.lineLength=this.line.length,this.cursor=0,this}}KI0.Scanner=QI0});var oZ=L((GI0)=>{Object.defineProperty(GI0,"__esModule",{value:!0});GI0.ColumnFormatter=void 0;class wI0{constructor($){if($.trim)this.format=(I)=>I.trim();else if($.ltrim)this.format=(I)=>I.trimLeft();else if($.rtrim)this.format=(I)=>I.trimRight();else this.format=(I)=>I}}GI0.ColumnFormatter=wI0});var LC=L((ZI0)=>{Object.defineProperty(ZI0,"__esModule",{value:!0});ZI0.NonQuotedColumnParser=void 0;var R11=oZ(),VI0=i9();class WI0{constructor($){this.parserOptions=$,this.columnFormatter=new R11.ColumnFormatter($)}parse($){if(!$.hasMoreCharacters)return null;let{parserOptions:I}=this,q=[],U=$.nextCharacterToken;for(;U;U=$.nextCharacterToken){if(VI0.Token.isTokenDelimiter(U,I)||VI0.Token.isTokenRowDelimiter(U))break;q.push(U.token),$.advancePastToken(U)}return this.columnFormatter.format(q.join(""))}}ZI0.NonQuotedColumnParser=WI0});var NC=L((OI0)=>{Object.defineProperty(OI0,"__esModule",{value:!0});OI0.QuotedColumnParser=void 0;var C11=oZ(),EU=i9();class DI0{constructor($){this.parserOptions=$,this.columnFormatter=new C11.ColumnFormatter($)}parse($){if(!$.hasMoreCharacters)return null;let I=$.cursor,{foundClosingQuote:q,col:U}=this.gatherDataBetweenQuotes($);if(!q){if($.advanceTo(I),!$.hasMoreData)throw Error(`Parse Error: missing closing: '${this.parserOptions.quote||""}' in line: at '${$.lineFromCursor.replace(/[\r\n]/g,"\\n'")}'`);return null}return this.checkForMalformedColumn($),U}gatherDataBetweenQuotes($){let{parserOptions:I}=this,q=!1,U=!1,Y=[],J=$.nextCharacterToken;for(;!U&&J!==null;J=$.nextCharacterToken){let Q=EU.Token.isTokenQuote(J,I);if(!q&&Q)q=!0;else if(q)if(EU.Token.isTokenEscapeCharacter(J,I)){$.advancePastToken(J);let K=$.nextCharacterToken;if(K!==null&&(EU.Token.isTokenQuote(K,I)||EU.Token.isTokenEscapeCharacter(K,I)))Y.push(K.token),J=K;else if(Q)U=!0;else Y.push(J.token)}else if(Q)U=!0;else Y.push(J.token);$.advancePastToken(J)}return{col:this.columnFormatter.format(Y.join("")),foundClosingQuote:U}}checkForMalformedColumn($){let{parserOptions:I}=this,{nextNonSpaceToken:q}=$;if(q){let U=EU.Token.isTokenDelimiter(q,I),Y=EU.Token.isTokenRowDelimiter(q);if(!(U||Y)){let J=$.lineFromCursor.substr(0,10).replace(/[\r\n]/g,"\\n'");throw Error(`Parse Error: expected: '${I.escapedDelimiter}' OR new line got: '${q.token}'. at '${J}`)}$.advanceToToken(q)}else if(!$.hasMoreData)$.advancePastLine()}}OI0.QuotedColumnParser=DI0});var AI0=L((FI0)=>{Object.defineProperty(FI0,"__esModule",{value:!0});FI0.ColumnParser=void 0;var _11=LC(),h11=NC(),S11=i9();class NI0{constructor($){this.parserOptions=$,this.quotedColumnParser=new h11.QuotedColumnParser($),this.nonQuotedColumnParser=new _11.NonQuotedColumnParser($)}parse($){let{nextNonSpaceToken:I}=$;if(I!==null&&S11.Token.isTokenQuote(I,this.parserOptions))return $.advanceToToken(I),this.quotedColumnParser.parse($);return this.nonQuotedColumnParser.parse($)}}FI0.ColumnParser=NI0});var FC=L((BU)=>{Object.defineProperty(BU,"__esModule",{value:!0});BU.ColumnFormatter=BU.QuotedColumnParser=BU.NonQuotedColumnParser=BU.ColumnParser=void 0;var y11=AI0();Object.defineProperty(BU,"ColumnParser",{enumerable:!0,get:function(){return y11.ColumnParser}});var u11=LC();Object.defineProperty(BU,"NonQuotedColumnParser",{enumerable:!0,get:function(){return u11.NonQuotedColumnParser}});var x11=NC();Object.defineProperty(BU,"QuotedColumnParser",{enumerable:!0,get:function(){re Line truncated
%s`,k,k,V,U);let h=V.type==="*"?uC:V.type==="?"?fC:"\\"+V.type;Y=!0,U=U.slice(0,V.reStart)+h+"\\("+k}if(P(),J)U+="\\\\";let g=B41[U.charAt(0)];for(let k=K.length-1;k>-1;k--){let h=K[k],n=U.slice(0,h.reStart),S=U.slice(h.reStart,h.reEnd-8),t=U.slice(h.reEnd),p=U.slice(h.reEnd-8,h.reEnd)+t,C=n.split(")").length,f=n.split("(").length-C,b=t;for(let j=0;j<f;j++)b=b.replace(/\)[+*?]?/,"");t=b;let J0=t===""&&I!==xC?"(?:$|\\/)":"";U=n+S+t+J0+p}if(U!==""&&Y)U="(?=.)"+U;if(g)U=N()+U;if(I===xC)return[U,Y];if(q.nocase&&!Y)Y=$.toUpperCase()!==$.toLowerCase();if(!Y)return R41($);let B=q.nocase?"i":"";try{return Object.assign(new RegExp("^"+U+"$",B),{_glob:$,_src:U})}catch(k){return new RegExp("$.")}}makeRe(){if(this.regexp||this.regexp===!1)return this.regexp;let $=this.set;if(!$.length)return this.regexp=!1,this.regexp;let I=this.options,q=I.noglobstar?uC:I.dot?j41:E41,U=I.nocase?"i":"",Y=$.map((J)=>{return J=J.map((Q)=>typeof Q==="string"?_41(Q):Q===v6?v6:Q._src).reduce((Q,K)=>{if(!(Q[Q.length-1]===v6&&K===v6))Q.push(K);return Q},[]),J.forEach((Q,K)=>{if(Q!==v6||J[K-1]===v6)return;if(K===0)if(J.length>1)J[K+1]="(?:\\/|"+q+"\\/)?"+J[K+1];else J[K]=q;else if(K===J.length-1)J[K-1]+="(?:\\/|"+q+")?";else J[K-1]+="(?:\\/|\\/"+q+"\\/)"+J[K+1],J[K+1]=v6}),J.filter((Q)=>Q!==v6).join("/")}).join("|");if(Y="^(?:"+Y+")$",this.negate)Y="^(?!"+Y+").*$";try{this.regexp=new RegExp(Y,U)}catch(J){this.regexp=!1}return this.regexp}match($,I=this.partial){if(this.debug("match",$,this.pattern),this.comment)return!1;if(this.empty)return $==="";if($==="/"&&I)return!0;let q=this.options;if(kC.sep!=="/")$=$.split(kC.sep).join("/");$=$.split(Zq0),this.debug(this.pattern,"split",$);let U=this.set;this.debug(this.pattern,"set",U);let Y;for(let J=$.length-1;J>=0;J--)if(Y=$[J],Y)break;for(let J=0;J<U.length;J++){let Q=U[J],K=$;if(q.matchBase&&Q.length===1)K=[Y];if(this.matchOne(K,Q,I)){if(q.flipNegate)return!0;return!this.negate}}if(q.flipNegate)return!1;return this.negate}static defaults($){return Y$.defaults($).Minimatch}}Y$.Minimatch=y2});var Aq0=L((IB1,Mq0)=>{Mq0.exports=Fq0;var iC=o("fs"),{EventEmitter:S41}=o("events"),{Minimatch:bC}=Oq0(),{resolve:y41}=o("path");function u41($,I){return new Promise((q,U)=>{iC.readdir($,{withFileTypes:!0},(Y,J)=>{if(Y)switch(Y.code){case"ENOTDIR":if(I)U(Y);else q([]);break;case"ENOTSUP":case"ENOENT":case"ENAMETOOLONG":case"UNKNOWN":q([]);break;case"ELOOP":default:U(Y);break}else q(J)})})}function Lq0($,I){return new Promise((q,U)=>{(I?iC.stat:iC.lstat)($,(J,Q)=>{if(J)switch(J.code){case"ENOENT":if(I)q(Lq0($,!1));else q(null);break;default:q(null);break}else q(Q)})})}async function*Nq0($,I,q,U,Y,J){let Q=await u41(I+$,J);for(let K of Q){let z=K.name;if(z===void 0)z=K,U=!0;let w=$+"/"+z,G=w.slice(1),H=I+"/"+G,W=null;if(U||q)W=await Lq0(H,q);if(!W&&K.name!==void 0)W=K;if(W===null)W={isDirectory:()=>!1};if(W.isDirectory()){if(!Y(G))yield{relative:G,absolute:H,stats:W},yield*Nq0(w,I,q,U,Y,!1)}else yield{relative:G,absolute:H,stats:W}}}async function*x41($,I,q,U){yield*Nq0("",$,I,q,U,!0)}function k41($){return{pattern:$.pattern,dot:!!$.dot,noglobstar:!!$.noglobstar,matchBase:!!$.matchBase,nocase:!!$.nocase,ignore:$.ignore,skip:$.skip,follow:!!$.follow,stat:!!$.stat,nodir:!!$.nodir,mark:!!$.mark,silent:!!$.silent,absolute:!!$.absolute}}class pC extends S41{constructor($,I,q){super();if(typeof I==="function")q=I,I=null;if(this.options=k41(I||{}),this.matchers=[],this.options.pattern){let U=Array.isArray(this.options.pattern)?this.options.pattern:[this.options.pattern];this.matchers=U.map((Y)=>new bC(Y,{dot:this.options.dot,noglobstar:this.options.noglobstar,matchBase:this.options.matchBase,nocase:this.options.nocase}))}if(this.ignoreMatchers=[],this.options.ignore){let U=Array.isArray(this.options.ignore)?this.options.ignore:[this.options.ignore];this.ignoreMatchers=U.map((Y)=>new bC(Y,{dot:!0}))}if(this.skipMatchers=[],this.options.skip){let U=Array.isArray(this.options.skip)?this.options.skip:[this.options.skip];this.skipMatchers=U.map((Y)=>new bC(Y,{dot:!0}))}if(this.iterator=x41(y41($||"."),this.options.follow,this.options.stat,this._shouldSkipDirectory.bind(this)),this.paused=!1,this.inactive=!1,this.aborted=!1,q)this._matches=[],this.on("match",(U)=>this._matches.push(this.options.absolute?U.absolute:U.relative)),this.on("error",(U)=>q(U)),this.on("end",()=>q(null,this._matches));setTimeout(()=>this._next(),0)}_shouldSkipDirectory($){return this.skipMatchers.some((I)=>I.match($))}_fileMatches($,I){let q=$+(I?"/":"");return(this.matchers.length===0||this.matchers.some((U)=>U.match(q)))&&!this.ignoreMatchers.some((U)=>U.match(q))&&(!this.options.nodir||!I)}_next(){if(!this.paused&&!this.aborted)this.iterator.next().then(($)=>{if(!$.done){let I=$.value.stats.isDirectory();if(this._fileMatches($.value.relative,I)){let q=$.value.relative,U=$.value.absolute;if(this.options.mark&&I)q+="/",U+="/";if(this.options.stat)this.emit("match",{relative:q,absolute:U,stat:$.value.stats});else this.emit("match",{relative:q,ab Line truncated
`,R);R=$0===-1?A.length:$0}else if(i!==-1&&A[R]==="/"&&A[R+1]==="*"){let $0=A.indexOf("*/",R);if($0!==-1)R=$0+2,i=A.indexOf("*/",R);else E+=A[R],R++}else E+=A[R],R++;return E}function c8(A){let E=G$(A.toString()),R=E.match(w$);if(!R)R=E.match(_$);if(!R)throw Error(`could not parse args in autoInject
Source:
`+E);let[,i]=R;return i.replace(/\s/g,"").split(p8).map(($0)=>$0.replace(h$,"").trim())}function t6(A,E){var R={};return Object.keys(A).forEach((i)=>{var $0=A[i],q0,Q0=V($0),z0=!Q0&&$0.length===1||Q0&&$0.length===0;if(Array.isArray($0))q0=[...$0],$0=q0.pop(),R[i]=q0.concat(q0.length>0?V0:$0);else if(z0)R[i]=$0;else{if(q0=c8($0),$0.length===0&&!Q0&&q0.length===0)throw Error("autoInject task functions require explicit parameters.");if(!Q0)q0.pop();R[i]=q0.concat(V0)}function V0(j0,U1){var W1=q0.map((K1)=>j0[K1]);W1.push(U1),O($0)(...W1)}}),v4(R,E)}class D7{constructor(){this.head=this.tail=null,this.length=0}removeLink(A){if(A.prev)A.prev.next=A.next;else this.head=A.next;if(A.next)A.next.prev=A.prev;else this.tail=A.prev;return A.prev=A.next=null,this.length-=1,A}empty(){while(this.head)this.shift();return this}insertAfter(A,E){if(E.prev=A,E.next=A.next,A.next)A.next.prev=E;else this.tail=E;A.next=E,this.length+=1}insertBefore(A,E){if(E.prev=A.prev,E.next=A,A.prev)A.prev.next=E;else this.head=E;A.prev=E,this.length+=1}unshift(A){if(this.head)this.insertBefore(this.head,A);else a6(this,A)}push(A){if(this.tail)this.insertAfter(this.tail,A);else a6(this,A)}shift(){return this.head&&this.removeLink(this.head)}pop(){return this.tail&&this.removeLink(this.tail)}toArray(){return[...this]}*[Symbol.iterator](){var A=this.head;while(A)yield A.data,A=A.next}remove(A){var E=this.head;while(E){var{next:R}=E;if(A(E))this.removeLink(E);E=R}return this}}function a6(A,E){A.length=1,A.head=A.tail=E}function p5(A,E,R){if(E==null)E=1;else if(E===0)throw RangeError("Concurrency must not be zero");var i=O(A),$0=0,q0=[];let Q0={error:[],drain:[],saturated:[],unsaturated:[],empty:[]};function z0(_0,P0){Q0[_0].push(P0)}function V0(_0,P0){let h0=(...z1)=>{j0(_0,h0),P0(...z1)};Q0[_0].push(h0)}function j0(_0,P0){if(!_0)return Object.keys(Q0).forEach((h0)=>Q0[h0]=[]);if(!P0)return Q0[_0]=[];Q0[_0]=Q0[_0].filter((h0)=>h0!==P0)}function U1(_0,...P0){Q0[_0].forEach((h0)=>h0(...P0))}var W1=!1;function K1(_0,P0,h0,z1){if(z1!=null&&typeof z1!=="function")throw Error("task callback must be a function");Z1.started=!0;var $4,x4;function V$(L7,...vY){if(L7)return h0?x4(L7):$4();if(vY.length<=1)return $4(vY[0]);$4(vY)}var JI=Z1._createTaskItem(_0,h0?V$:z1||V$);if(P0)Z1._tasks.unshift(JI);else Z1._tasks.push(JI);if(!W1)W1=!0,w(()=>{W1=!1,Z1.process()});if(h0||!z1)return new Promise((L7,vY)=>{$4=L7,x4=vY})}function H$(_0){return function(P0,...h0){$0-=1;for(var z1=0,$4=_0.length;z1<$4;z1++){var x4=_0[z1],V$=q0.indexOf(x4);if(V$===0)q0.shift();else if(V$>0)q0.splice(V$,1);if(x4.callback(P0,...h0),P0!=null)U1("error",P0,x4.data)}if($0<=Z1.concurrency-Z1.buffer)U1("unsaturated");if(Z1.idle())U1("drain");Z1.process()}}function YI(_0){if(_0.length===0&&Z1.idle())return w(()=>U1("drain")),!0;return!1}let O7=(_0)=>(P0)=>{if(!P0)return new Promise((h0,z1)=>{V0(_0,($4,x4)=>{if($4)return z1($4);h0(x4)})});j0(_0),z0(_0,P0)};var BY=!1,Z1={_tasks:new D7,_createTaskItem(_0,P0){return{data:_0,callback:P0}},*[Symbol.iterator](){yield*Z1._tasks[Symbol.iterator]()},concurrency:E,payload:R,buffer:E/4,started:!1,paused:!1,push(_0,P0){if(Array.isArray(_0)){if(YI(_0))return;return _0.map((h0)=>K1(h0,!1,!1,P0))}return K1(_0,!1,!1,P0)},pushAsync(_0,P0){if(Array.isArray(_0)){if(YI(_0))return;return _0.map((h0)=>K1(h0,!1,!0,P0))}return K1(_0,!1,!0,P0)},kill(){j0(),Z1._tasks.empty()},unshift(_0,P0){if(Array.isArray(_0)){if(YI(_0))return;return _0.map((h0)=>K1(h0,!0,!1,P0))}return K1(_0,!0,!1,P0)},unshiftAsync(_0,P0){if(Array.isArray(_0)){if(YI(_0))return;return _0.map((h0)=>K1(h0,!0,!0,P0))}return K1(_0,!0,!0,P0)},remove(_0){Z1._tasks.remove(_0)},process(){if(BY)return;BY=!0;while(!Z1.paused&&$0<Z1.concurrency&&Z1._tasks.length){var _0=[],P0=[],h0=Z1._tasks.length;if(Z1.payload)h0=Math.min(h0,Z1.payload);for(var z1=0;z1<h0;z1++){var $4=Z1._tasks.shift();_0.push($4),q0.push($4),P0.push($4.data)}if($0+=1,Z1._tasks.length===0)U1("empty");if($0===Z1.concurrency)U1("saturated");var x4=C(H$(_0));i(P0,x4)}BY=!1},length(){return Z1._tasks.length},running(){return $0},workersList(){return q0},idle(){return Z1._tasks.length+$0===0},pause(){Z1.paused=!0},resume(){if(Z1.paused===!1)return;Z1.paused=!1,w(Z1.process)}};return Object.defineProperties(Z1,{saturated:{writable:!1,value:O7("saturated")},unsaturated:{writable:!1,value:O7("unsaturated")},empty:{writable:!1,value:O7("empty")},drain:{writable:!1,value:O7("drain")},error:{writable:!1,value:O7("error")}}),Z1}function g0(A,E){return p5(A,1,E)}function r(A,E,R){return p5(A,E,R)}function F(A,E,R,i){i=k(i);var $0=O(R);return m0(A,(q0,Q0,z0)=>{$0(E,q0,(V0,j0)=>{E=j0,z0(V0)})},(q0)=>i(q0,E))}var M=N(F,4);function v(...A){var E=A.map(O);return function(...R){var i=this,$0=R[R.length-1];if(typeof $0=="function")R.pop();else $0=Y4();return M(E,R,(q0,Q0,z0)=>{Q0.apply(i,q0.concat((V0,...j0)=>{z0(V0,j0)}))},(q0,Q0)=>$0(q0,...Q0)),$0[C1]}}function y(...A){return v(...A.reverse())}function s(A,E,R,i){return P(b(E),A,R,i)}var c=N(s,4);function e( Line truncated
GFS4: `),console.error($)};if(!G4[q6]){if(cC=global[q6]||[],hq0(G4,cC),G4.close=function($){function I(q,U){return $.call(G4,q,function(Y){if(!Y)_q0();if(typeof U==="function")U.apply(this,arguments)})}return Object.defineProperty(I,YX,{value:$}),I}(G4.close),G4.closeSync=function($){function I(q){$.apply(G4,arguments),_q0()}return Object.defineProperty(I,YX,{value:$}),I}(G4.closeSync),/\bgfs4\b/i.test(process.env.NODE_DEBUG||""))process.on("exit",function(){g3(G4[q6]),o("assert").equal(G4[q6].length,0)})}var cC;if(!global[q6])hq0(global,G4[q6]);mC.exports=dC(m41(G4));if(process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH&&!G4.__patched)mC.exports=dC(G4),G4.__patched=!0;function dC($){d41($),$.gracefulify=dC,$.createReadStream=B,$.createWriteStream=k;var I=$.readFile;$.readFile=q;function q(S,t,p){if(typeof t==="function")p=t,t=null;return C(S,t,p);function C(f,b,J0,j){return I(f,b,function(u){if(u&&(u.code==="EMFILE"||u.code==="ENFILE"))CU([C,[f,b,J0],u,j||Date.now(),Date.now()]);else if(typeof J0==="function")J0.apply(this,arguments)})}}var U=$.writeFile;$.writeFile=Y;function Y(S,t,p,C){if(typeof p==="function")C=p,p=null;return f(S,t,p,C);function f(b,J0,j,u,d){return U(b,J0,j,function(a){if(a&&(a.code==="EMFILE"||a.code==="ENFILE"))CU([f,[b,J0,j,u],a,d||Date.now(),Date.now()]);else if(typeof u==="function")u.apply(this,arguments)})}}var J=$.appendFile;if(J)$.appendFile=Q;function Q(S,t,p,C){if(typeof p==="function")C=p,p=null;return f(S,t,p,C);function f(b,J0,j,u,d){return J(b,J0,j,function(a){if(a&&(a.code==="EMFILE"||a.code==="ENFILE"))CU([f,[b,J0,j,u],a,d||Date.now(),Date.now()]);else if(typeof u==="function")u.apply(this,arguments)})}}var K=$.copyFile;if(K)$.copyFile=z;function z(S,t,p,C){if(typeof p==="function")C=p,p=0;return f(S,t,p,C);function f(b,J0,j,u,d){return K(b,J0,j,function(a){if(a&&(a.code==="EMFILE"||a.code==="ENFILE"))CU([f,[b,J0,j,u],a,d||Date.now(),Date.now()]);else if(typeof u==="function")u.apply(this,arguments)})}}var w=$.readdir;$.readdir=H;var G=/^v[0-5]\./;function H(S,t,p){if(typeof t==="function")p=t,t=null;var C=G.test(process.version)?function(J0,j,u,d){return w(J0,f(J0,j,u,d))}:function(J0,j,u,d){return w(J0,j,f(J0,j,u,d))};return C(S,t,p);function f(b,J0,j,u){return function(d,a){if(d&&(d.code==="EMFILE"||d.code==="ENFILE"))CU([C,[b,J0,j],d,u||Date.now(),Date.now()]);else{if(a&&a.sort)a.sort();if(typeof j==="function")j.call(this,d,a)}}}}if(process.version.substr(0,4)==="v0.8"){var W=l41($);N=W.ReadStream,P=W.WriteStream}var V=$.ReadStream;if(V)N.prototype=Object.create(V.prototype),N.prototype.open=T;var X=$.WriteStream;if(X)P.prototype=Object.create(X.prototype),P.prototype.open=g;Object.defineProperty($,"ReadStream",{get:function(){return N},set:function(S){N=S},enumerable:!0,configurable:!0}),Object.defineProperty($,"WriteStream",{get:function(){return P},set:function(S){P=S},enumerable:!0,configurable:!0});var D=N;Object.defineProperty($,"FileReadStream",{get:function(){return D},set:function(S){D=S},enumerable:!0,configurable:!0});var O=P;Object.defineProperty($,"FileWriteStream",{get:function(){return O},set:function(S){O=S},enumerable:!0,configurable:!0});function N(S,t){if(this instanceof N)return V.apply(this,arguments),this;else return N.apply(Object.create(N.prototype),arguments)}function T(){var S=this;n(S.path,S.flags,S.mode,function(t,p){if(t){if(S.autoClose)S.destroy();S.emit("error",t)}else S.fd=p,S.emit("open",p),S.read()})}function P(S,t){if(this instanceof P)return X.apply(this,arguments),this;else return P.apply(Object.create(P.prototype),arguments)}function g(){var S=this;n(S.path,S.flags,S.mode,function(t,p){if(t)S.destroy(),S.emit("error",t);else S.fd=p,S.emit("open",p)})}function B(S,t){return new $.ReadStream(S,t)}function k(S,t){return new $.WriteStream(S,t)}var h=$.open;$.open=n;function n(S,t,p,C){if(typeof p==="function")C=p,p=null;return f(S,t,p,C);function f(b,J0,j,u,d){return h(b,J0,j,function(a,K0){if(a&&(a.code==="EMFILE"||a.code==="ENFILE"))CU([f,[b,J0,j,u],a,d||Date.now(),Date.now()]);else if(typeof u==="function")u.apply(this,arguments)})}}return $}function CU($){g3("ENQUEUE",$[0].name,$[1]),G4[q6].push($),lC()}var UX;function _q0(){var $=Date.now();for(var I=0;I<G4[q6].length;++I)if(G4[q6][I].length>2)G4[q6][I][3]=$,G4[q6][I][4]=$;lC()}function lC(){if(clearTimeout(UX),UX=void 0,G4[q6].length===0)return;var $=G4[q6].shift(),I=$[0],q=$[1],U=$[2],Y=$[3],J=$[4];if(Y===void 0)g3("RETRY",I.name,q),I.apply(null,q);else if(Date.now()-Y>=60000){g3("TIMEOUT",I.name,q);var Q=q.pop();if(typeof Q==="function")Q.call(null,U)}else{var K=Date.now()-J,z=Math.max(J-Y,1),w=Math.min(z*1.2,100);if(K>=w)g3("RETRY",I.name,q),I.apply(null,q.concat([Y]));else G4[q6].push($)}if(UX===void 0)UX=setTimeout(lC,0)}});var yq0=L((QB1,oC)=>{function r41($,I){if(!($ instanceof I))throw TypeError("Cannot call a class as a function")}var Sq0=F4().Buffer,u2=o("util");function t41($,I,q){$.copy(I,q)}oC.exports=function(){function $(){r41(this,$),this.head=null,this.tail=null,th Line truncated
* normalize-path <https://github.com/jonschlinkert/normalize-path>
*
* Copyright (c) 2014-2018, Jon Schlinkert.
* Released under the MIT License.
*/MU0.exports=function($,I){if(typeof $!=="string")throw TypeError("expected path to be a string");if($==="\\"||$==="/")return"/";var q=$.length;if(q<=1)return $;var U="";if(q>4&&$[3]==="\\"){var Y=$[2];if((Y==="?"||Y===".")&&$.slice(0,2)==="\\\\")$=$.slice(2),U="//"}var J=$.split(/[/\\]+/);if(I!==!1&&J[J.length-1]==="")J.pop();return U+J.join("/")}});var Z_=L((LB1,BU0)=>{var gU0=9007199254740991,q$1="[object Arguments]",U$1="[object Function]",Y$1="[object GeneratorFunction]",J$1=/^(?:0|[1-9]\d*)$/;function PU0($,I,q){switch(q.length){case 0:return $.call(I);case 1:return $.call(I,q[0]);case 2:return $.call(I,q[0],q[1]);case 3:return $.call(I,q[0],q[1],q[2])}return $.apply(I,q)}function Q$1($,I){var q=-1,U=Array($);while(++q<$)U[q]=I(q);return U}var d2=Object.prototype,l2=d2.hasOwnProperty,TU0=d2.toString,K$1=d2.propertyIsEnumerable,AU0=Math.max;function z$1($,I){var q=L$1($)||O$1($)?Q$1($.length,String):[],U=q.length,Y=!!U;for(var J in $)if((I||l2.call($,J))&&!(Y&&(J=="length"||EU0(J,U))))q.push(J);return q}function w$1($,I,q,U){if($===void 0||H_($,d2[q])&&!l2.call(U,q))return I;return $}function G$1($,I,q){var U=$[I];if(!(l2.call($,I)&&H_(U,q))||q===void 0&&!(I in $))$[I]=q}function H$1($){if(!W_($))return D$1($);var I=X$1($),q=[];for(var U in $)if(!(U=="constructor"&&(I||!l2.call($,U))))q.push(U);return q}function jU0($,I){return I=AU0(I===void 0?$.length-1:I,0),function(){var q=arguments,U=-1,Y=AU0(q.length-I,0),J=Array(Y);while(++U<Y)J[U]=q[I+U];U=-1;var Q=Array(I+1);while(++U<I)Q[U]=q[U];return Q[I]=J,PU0($,this,Q)}}function V$1($,I,q,U){q||(q={});var Y=-1,J=I.length;while(++Y<J){var Q=I[Y],K=U?U(q[Q],$[Q],Q,q,$):void 0;G$1(q,Q,K===void 0?$[Q]:K)}return q}function W$1($){return jU0(function(I,q){var U=-1,Y=q.length,J=Y>1?q[Y-1]:void 0,Q=Y>2?q[2]:void 0;if(J=$.length>3&&typeof J=="function"?(Y--,J):void 0,Q&&Z$1(q[0],q[1],Q))J=Y<3?void 0:J,Y=1;I=Object(I);while(++U<Y){var K=q[U];if(K)$(I,K,U,J)}return I})}function EU0($,I){return I=I==null?gU0:I,!!I&&(typeof $=="number"||J$1.test($))&&($>-1&&$%1==0&&$<I)}function Z$1($,I,q){if(!W_(q))return!1;var U=typeof I;if(U=="number"?V_(q)&&EU0(I,q.length):U=="string"&&(I in q))return H_(q[I],$);return!1}function X$1($){var I=$&&$.constructor,q=typeof I=="function"&&I.prototype||d2;return $===q}function D$1($){var I=[];if($!=null)for(var q in Object($))I.push(q);return I}function H_($,I){return $===I||$!==$&&I!==I}function O$1($){return N$1($)&&l2.call($,"callee")&&(!K$1.call($,"callee")||TU0.call($)==q$1)}var L$1=Array.isArray;function V_($){return $!=null&&M$1($.length)&&!F$1($)}function N$1($){return A$1($)&&V_($)}function F$1($){var I=W_($)?TU0.call($):"";return I==U$1||I==Y$1}function M$1($){return typeof $=="number"&&$>-1&&$%1==0&&$<=gU0}function W_($){var I=typeof $;return!!$&&(I=="object"||I=="function")}function A$1($){return!!$&&typeof $=="object"}var g$1=W$1(function($,I,q,U){V$1(I,T$1(I),$,U)}),P$1=jU0(function($){return $.push(void 0,w$1),PU0(g$1,void 0,$)});function T$1($){return V_($)?z$1($,!0):H$1($)}BU0.exports=P$1});var RU0=L((NB1,X_)=>{function j$1($,I){if(!($ instanceof I))throw TypeError("Cannot call a class as a function")}var vU0=F4().Buffer,m2=o("util");function E$1($,I,q){$.copy(I,q)}X_.exports=function(){function $(){j$1(this,$),this.head=null,this.tail=null,this.length=0}return $.prototype.push=function(q){var U={data:q,next:null};if(this.length>0)this.tail.next=U;else this.head=U;this.tail=U,++this.length},$.prototype.unshift=function(q){var U={data:q,next:this.head};if(this.length===0)this.tail=U;this.head=U,++this.length},$.prototype.shift=function(){if(this.length===0)return;var q=this.head.data;if(this.length===1)this.head=this.tail=null;else this.head=this.head.next;return--this.length,q},$.prototype.clear=function(){this.head=this.tail=null,this.length=0},$.prototype.join=function(q){if(this.length===0)return"";var U=this.head,Y=""+U.data;while(U=U.next)Y+=q+U.data;return Y},$.prototype.concat=function(q){if(this.length===0)return vU0.alloc(0);var U=vU0.allocUnsafe(q>>>0),Y=this.head,J=0;while(Y)E$1(Y.data,U,J),J+=Y.data.length,Y=Y.next;return U},$}();if(m2&&m2.inspect&&m2.inspect.custom)X_.exports.prototype[m2.inspect.custom]=function(){var $=m2.inspect({length:this.length});return this.constructor.name+" "+$}});var D_=L((FB1,CU0)=>{var OX=N4();function B$1($,I){var q=this,U=this._readableState&&this._readableState.destroyed,Y=this._writableState&&this._writableState.destroyed;if(U||Y){if(I)I($);else if($){if(!this._writableState)OX.nextTick(LX,this,$);else if(!this._writableState.errorEmitted)this._writableState.errorEmitted=!0,OX.nextTick(LX,this,$)}return this}if(this._readableState)this._readableState.destroyed=!0;if(this._writableState)this._writableState.destroyed=!0;return this._destroy($||null,function(J){if(!I&&J){if(!q._writableState)OX.nextTick(LX,q,J);else if(!q._writableState.errorEmitted)q._writableState.errorEmitted=!0,OX.nextTick(LX,q,J)}else if(I)I(J)}),this}function v$1(){if(this._readableState)this._readable Line truncated
%s`,B,B,T,U);var k=T.type==="*"?$h:T.type==="?"?e_:"\\"+T.type;Y=!0,U=U.slice(0,T.reStart)+k+"\\("+B}if(X(),J)U+="\\\\";var h=!1;switch(U.charAt(0)){case"[":case".":case"(":h=!0}for(var n=K.length-1;n>-1;n--){var S=K[n],t=U.slice(0,S.reStart),p=U.slice(S.reStart,S.reEnd-8),C=U.slice(S.reEnd-8,S.reEnd),f=U.slice(S.reEnd);C+=f;var b=t.split("(").length-1,J0=f;for(D=0;D<b;D++)J0=J0.replace(/\)[+*?]?/,"");f=J0;var j="";if(f===""&&I!==SX)j="$";var u=t+p+f+j+C;U=u}if(U!==""&&Y)U="(?=.)"+U;if(h)U=W+U;if(I===SX)return[U,Y];if(!Y)return o71($);var d=q.nocase?"i":"";try{var a=new RegExp("^"+U+"$",d)}catch(K0){return new RegExp("$.")}return a._glob=$,a._src=U,a}J$.makeRe=function($,I){return new T4($,I||{}).makeRe()};T4.prototype.makeRe=m71;function m71(){if(this.regexp||this.regexp===!1)return this.regexp;var $=this.set;if(!$.length)return this.regexp=!1,this.regexp;var I=this.options,q=I.noglobstar?$h:I.dot?f71:n71,U=I.nocase?"i":"",Y=$.map(function(J){return J.map(function(Q){return Q===C3?q:typeof Q==="string"?r71(Q):Q._src}).join("\\/")}).join("|");if(Y="^(?:"+Y+")$",this.negate)Y="^(?!"+Y+").*$";try{this.regexp=new RegExp(Y,U)}catch(J){this.regexp=!1}return this.regexp}J$.match=function($,I,q){q=q||{};var U=new T4(I,q);if($=$.filter(function(Y){return U.match(Y)}),U.options.nonull&&!$.length)$.push(I);return $};T4.prototype.match=function(I,q){if(typeof q>"u")q=this.partial;if(this.debug("match",I,this.pattern),this.comment)return!1;if(this.empty)return I==="";if(I==="/"&&q)return!0;var U=this.options;if(JK.sep!=="/")I=I.split(JK.sep).join("/");I=I.split(JJ0),this.debug(this.pattern,"split",I);var Y=this.set;this.debug(this.pattern,"set",Y);var J,Q;for(Q=I.length-1;Q>=0;Q--)if(J=I[Q],J)break;for(Q=0;Q<Y.length;Q++){var K=Y[Q],z=I;if(U.matchBase&&K.length===1)z=[J];var w=this.matchOne(z,K,q);if(w){if(U.flipNegate)return!0;return!this.negate}}if(U.flipNegate)return!1;return this.negate};T4.prototype.matchOne=function($,I,q){if(I.indexOf(C3)!==-1)return this._matchGlobstar($,I,q,0,0);return this._matchOne($,I,q,0,0)};T4.prototype._matchGlobstar=function($,I,q,U,Y){var J,Q=-1;for(J=Y;J<I.length;J++)if(I[J]===C3){Q=J;break}var K=-1;for(J=I.length-1;J>=0;J--)if(I[J]===C3){K=J;break}var z=I.slice(Y,Q),w=q?I.slice(Q+1):I.slice(Q+1,K),G=q?[]:I.slice(K+1);if(z.length){var H=$.slice(U,U+z.length);if(!this._matchOne(H,z,q,0,0))return!1;U+=z.length}var W=0;if(G.length){if(G.length+U>$.length)return!1;var V=$.length-G.length;if(this._matchOne($,G,q,V,0))W=G.length;else{if($[$.length-1]!==""||U+G.length===$.length)return!1;if(V--,!this._matchOne($,G,q,V,0))return!1;W=G.length+1}}if(!w.length){var X=!!W;for(J=U;J<$.length-W;J++){var D=String($[J]);if(X=!0,D==="."||D===".."||!this.options.dot&&D.charAt(0)===".")return!1}return q||X}var O=[[[],0]],N=O[0],T=0,P=[0];for(var g=0;g<w.length;g++){var B=w[g];if(B===C3)P.push(T),N=[[],0],O.push(N);else N[0].push(B),T++}var k=O.length-1,h=$.length-W;for(var n=0;n<O.length;n++)O[n][1]=h-(P[k--]+O[n][0].length);return!!this._matchGlobStarBodySections($,O,U,0,q,0,!!W)};T4.prototype._matchGlobStarBodySections=function($,I,q,U,Y,J,Q){var K=I[U];if(!K){for(var z=q;z<$.length;z++){Q=!0;var w=$[z];if(w==="."||w===".."||!this.options.dot&&w.charAt(0)===".")return!1}return Q}var G=K[0],H=K[1];while(q<=H){var W=this._matchOne($.slice(0,q+G.length),G,Y,q,0);if(W&&J<this.maxGlobstarRecursion){var V=this._matchGlobStarBodySections($,I,q+G.length,U+1,Y,J+1,Q);if(V!==!1)return V}var w=$[q];if(w==="."||w===".."||!this.options.dot&&w.charAt(0)===".")return!1;q++}return Y||null};T4.prototype._matchOne=function($,I,q,U,Y){var J,Q,K,z;for(J=U,Q=Y,K=$.length,z=I.length;J<K&&Q<z;J++,Q++){this.debug("matchOne loop");var w=I[Q],G=$[J];if(this.debug(I,w,G),w===!1||w===C3)return!1;var H;if(typeof w==="string")H=G===w,this.debug("string match",w,G,H);else H=G.match(w),this.debug("pattern match",w,G,H);if(!H)return!1}if(J===K&&Q===z)return!0;else if(J===K)return q;else if(Q===z)return J===K-1&&$[J]==="";throw Error("wtf?")};function o71($){return $.replace(/\\(.)/g,"$1")}function r71($){return $.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&")}});var kX=L((fB1,xX)=>{function zJ0($){return $.charAt(0)==="/"}function wJ0($){var I=/^([a-zA-Z]:|[\\\/]{2}[^\\\/]+[\\\/]+[^\\\/]+)?([\\\/])?([\s\S]*?)$/,q=I.exec($),U=q[1]||"",Y=Boolean(U&&U.charAt(1)!==":");return Boolean(q[2]||Y)}xX.exports=process.platform==="win32"?wJ0:zJ0;xX.exports.posix=zJ0;xX.exports.win32=wJ0});var qh=L((J31)=>{J31.setopts=I31;J31.ownProp=GJ0;J31.makeAbs=QK;J31.finish=q31;J31.mark=U31;J31.isIgnored=VJ0;J31.childrenIgnored=Y31;function GJ0($,I){return Object.prototype.hasOwnProperty.call($,I)}var t71=o("fs"),cU=o("path"),a71=uX(),HJ0=kX(),Ih=a71.Minimatch;function s71($,I){return $.localeCompare(I,"en")}function e71($,I){if($.ignore=I.ignore||[],!Array.isArray($.ignore))$.ignore=[$.ignore];if($.ignore.length)$.ignore=$.ignore.map($31)}function $31($){var I=null;if($.slice(-3)==="/**"){var q=$.replace(/(\/\*\*)+$/,"");I=new Ih(q,{dot:!0})}return{matcher Line truncated
See: https://github.com/isaacs/node-glob/issues/167`);return new h4($,I).found}function h4($,I){if(!$)throw Error("must provide pattern");if(typeof I==="function"||arguments.length===3)throw TypeError(`callback provided to sync glob
See: https://github.com/isaacs/node-glob/issues/167`);if(!(this instanceof h4))return new h4($,I);if(Z31(this,$,I),this.noprocess)return this;var q=this.minimatch.set.length;this.matches=Array(q);for(var U=0;U<q;U++)this._process(this.minimatch.set[U],U,!1);this._finish()}h4.prototype._finish=function(){if(ZJ0.ok(this instanceof h4),this.realpath){var $=this;this.matches.forEach(function(I,q){var U=$.matches[q]=Object.create(null);for(var Y in I)try{Y=$._makeAbs(Y);var J=W31.realpathSync(Y,$.realpathCache);U[J]=!0}catch(Q){if(Q.syscall==="stat")U[$._makeAbs(Y)]=!0;else throw Q}})}_3.finish(this)};h4.prototype._process=function($,I,q){ZJ0.ok(this instanceof h4);var U=0;while(typeof $[U]==="string")U++;var Y;switch(U){case $.length:this._processSimple($.join("/"),I);return;case 0:Y=null;break;default:Y=$.slice(0,U).join("/");break}var J=$.slice(U),Q;if(Y===null)Q=".";else if(fX(Y)||fX($.map(function(w){return typeof w==="string"?w:"[*]"}).join("/"))){if(!Y||!fX(Y))Y="/"+Y;Q=Y}else Q=Y;var K=this._makeAbs(Q);if(X31(this,Q))return;var z=J[0]===WJ0.GLOBSTAR;if(z)this._processGlobStar(Y,Q,K,J,I,q);else this._processReaddir(Y,Q,K,J,I,q)};h4.prototype._processReaddir=function($,I,q,U,Y,J){var Q=this._readdir(q,J);if(!Q)return;var K=U[0],z=!!this.minimatch.negate,w=K._glob,G=this.dot||w.charAt(0)===".",H=[];for(var W=0;W<Q.length;W++){var V=Q[W];if(V.charAt(0)!=="."||G){var X;if(z&&!$)X=!V.match(K);else X=V.match(K);if(X)H.push(V)}}var D=H.length;if(D===0)return;if(U.length===1&&!this.mark&&!this.stat){if(!this.matches[Y])this.matches[Y]=Object.create(null);for(var W=0;W<D;W++){var V=H[W];if($)if($.slice(-1)!=="/")V=$+"/"+V;else V=$+V;if(V.charAt(0)==="/"&&!this.nomount)V=Uh.join(this.root,V);this._emitMatch(Y,V)}return}U.shift();for(var W=0;W<D;W++){var V=H[W],O;if($)O=[$,V];else O=[V];this._process(O.concat(U),Y,J)}};h4.prototype._emitMatch=function($,I){if(D31(this,I))return;var q=this._makeAbs(I);if(this.mark)I=this._mark(I);if(this.absolute)I=q;if(this.matches[$][I])return;if(this.nodir){var U=this.cache[q];if(U==="DIR"||Array.isArray(U))return}if(this.matches[$][I]=!0,this.stat)this._stat(I)};h4.prototype._readdirInGlobStar=function($){if(this.follow)return this._readdir($,!1);var I,q,U;try{q=this.fs.lstatSync($)}catch(J){if(J.code==="ENOENT")return null}var Y=q&&q.isSymbolicLink();if(this.symlinks[$]=Y,!Y&&q&&!q.isDirectory())this.cache[$]="FILE";else I=this._readdir($,!1);return I};h4.prototype._readdir=function($,I){var q;if(I&&!Yh(this.symlinks,$))return this._readdirInGlobStar($);if(Yh(this.cache,$)){var U=this.cache[$];if(!U||U==="FILE")return null;if(Array.isArray(U))return U}try{return this._readdirEntries($,this.fs.readdirSync($))}catch(Y){return this._readdirError($,Y),null}};h4.prototype._readdirEntries=function($,I){if(!this.mark&&!this.stat)for(var q=0;q<I.length;q++){var U=I[q];if($==="/")U=$+U;else U=$+"/"+U;this.cache[U]=!0}return this.cache[$]=I,I};h4.prototype._readdirError=function($,I){switch(I.code){case"ENOTSUP":case"ENOTDIR":var q=this._makeAbs($);if(this.cache[q]="FILE",q===this.cwdAbs){var U=Error(I.code+" invalid cwd "+this.cwd);throw U.path=this.cwd,U.code=I.code,U}break;case"ENOENT":case"ELOOP":case"ENAMETOOLONG":case"UNKNOWN":this.cache[this._makeAbs($)]=!1;break;default:if(this.cache[this._makeAbs($)]=!1,this.strict)throw I;if(!this.silent)console.error("glob error",I);break}};h4.prototype._processGlobStar=function($,I,q,U,Y,J){var Q=this._readdir(q,J);if(!Q)return;var K=U.slice(1),z=$?[$]:[],w=z.concat(K);this._process(w,Y,!1);var G=Q.length,H=this.symlinks[q];if(H&&J)return;for(var W=0;W<G;W++){var V=Q[W];if(V.charAt(0)==="."&&!this.dot)continue;var X=z.concat(Q[W],K);this._process(X,Y,!0);var D=z.concat(Q[W],U);this._process(D,Y,!0)}};h4.prototype._processSimple=function($,I){var q=this._stat($);if(!this.matches[I])this.matches[I]=Object.create(null);if(!q)return;if($&&fX($)&&!this.nomount){var U=/[\/\\]$/.test($);if($.charAt(0)==="/")$=Uh.join(this.root,$);else if($=Uh.resolve(this.root,$),U)$+="/"}if(process.platform==="win32")$=$.replace(/\\/g,"/");this._emitMatch(I,$)};h4.prototype._stat=function($){var I=this._makeAbs($),q=$.slice(-1)==="/";if($.length>this.maxLength)return!1;if(!this.stat&&Yh(this.cache,I)){var Q=this.cache[I];if(Array.isArray(Q))Q="DIR";if(!q||Q==="DIR")return Q;if(q&&Q==="FILE")return!1}var U,Y=this.statCache[I];if(!Y){var J;try{J=this.fs.lstatSync(I)}catch(K){if(K&&(K.code==="ENOENT"||K.code==="ENOTDIR"))return this.statCache[I]=!1,!1}if(J&&J.isSymbolicLink())try{Y=this.fs.statSync(I)}catch(K){Y=J}else Y=J}this.statCache[I]=Y;var Q=!0;if(Y)Q=Y.isDirectory()?"DIR":"FILE";if(this.cache[I]=this.cache[I]||Q,q&&Q==="FILE")return!1;return Q};h4.prototype._mark=function($){return _3.mark(this,$)};h4.prototype._makeAbs=function($){return _3.makeAbs(this,$)}});var Jh=L((dB1,NJ0)=>{NJ0.exports=LJ0;function LJ0($,I){if($&&I)return LJ0($)(I);if(typeof $!=="function")throw TypeError("need wrapper function");return Object.keys($).forEach(function(U){q[U]=$[U]}),q;f Line truncated
`);if($.linkname)I+=xh(" linkpath="+$.linkname+`
`);var q=$.pax;if(q)for(var U in q)I+=xh(" "+U+"="+q[U]+`
`);return Buffer.from(I)};_I1.decodePax=function($){var I={};while($.length){var q=0;while(q<$.length&&$[q]!==32)q++;var U=parseInt($.slice(0,q).toString(),10);if(!U)return I;var Y=$.slice(q+1,U-1).toString(),J=Y.indexOf("=");if(J===-1)return I;I[Y.slice(0,J)]=Y.slice(J+1),$=$.slice(U)}return I};_I1.encode=function($){var I=MI1(512),q=$.name,U="";if($.typeflag===5&&q[q.length-1]!=="/")q+="/";if(Buffer.byteLength(q)!==q.length)return null;while(Buffer.byteLength(q)>100){var Y=q.indexOf("/");if(Y===-1)return null;U+=U?"/"+q.slice(0,Y):q.slice(0,Y),q=q.slice(Y+1)}if(Buffer.byteLength(q)>100||Buffer.byteLength(U)>155)return null;if($.linkname&&Buffer.byteLength($.linkname)>100)return null;if(I.write(q),I.write(s9($.mode&EI1,6),100),I.write(s9($.uid,6),108),I.write(s9($.gid,6),116),I.write(s9($.size,11),124),I.write(s9($.mtime.getTime()/1000|0,11),136),I[156]=xQ0+RI1($.type),$.linkname)I.write($.linkname,157);if(kQ0.copy(I,VK),PI1.copy(I,kh),$.uname)I.write($.uname,265);if($.gname)I.write($.gname,297);if(I.write(s9($.devmajor||0,6),329),I.write(s9($.devminor||0,6),337),U)I.write(U,345);return I.write(s9(nQ0(I),6),148),I};_I1.decode=function($,I,q){var U=$[156]===0?0:$[156]-xQ0,Y=oU($,0,100,I),J=e9($,100,8),Q=e9($,108,8),K=e9($,116,8),z=e9($,124,12),w=e9($,136,12),G=vI1(U),H=$[157]===0?null:oU($,157,100,I),W=oU($,265,32),V=oU($,297,32),X=e9($,329,8),D=e9($,337,8),O=nQ0($);if(O===256)return null;if(O!==e9($,148,8))throw Error("Invalid tar header. Maybe the tar is corrupted or it needs to be gunzipped?");if(kQ0.compare($,VK,VK+6)===0){if($[345])Y=oU($,345,155,I)+"/"+Y}else if(TI1.compare($,VK,VK+6)===0&&jI1.compare($,kh,kh+2)===0);else if(!q)throw Error("Invalid tar header: unknown format.");if(U===0&&Y&&Y[Y.length-1]==="/")U=5;return{name:Y,mode:J,uid:Q,gid:K,size:z,mtime:new Date(1000*w),type:G,linkname:H,uname:W,gname:V,devmajor:X,devminor:D}}});var mQ0=L((jv1,lQ0)=>{var iQ0=o("util"),kI1=uQ0(),WK=fh(),pQ0=W6().Writable,cQ0=W6().PassThrough,dQ0=function(){},bQ0=function($){return $&=511,$&&512-$},fI1=function($,I){var q=new lX($,I);return q.end(),q},nI1=function($,I){if(I.path)$.name=I.path;if(I.linkpath)$.linkname=I.linkpath;if(I.size)$.size=parseInt(I.size,10);return $.pax=I,$},lX=function($,I){this._parent=$,this.offset=I,cQ0.call(this,{autoDestroy:!1})};iQ0.inherits(lX,cQ0);lX.prototype.destroy=function($){this._parent.destroy($)};var R5=function($){if(!(this instanceof R5))return new R5($);pQ0.call(this,$),$=$||{},this._offset=0,this._buffer=kI1(),this._missing=0,this._partial=!1,this._onparse=dQ0,this._header=null,this._stream=null,this._overflow=null,this._cb=null,this._locked=!1,this._destroyed=!1,this._pax=null,this._paxGlobal=null,this._gnuLongPath=null,this._gnuLongLinkPath=null;var I=this,q=I._buffer,U=function(){I._continue()},Y=function(W){if(I._locked=!1,W)return I.destroy(W);if(!I._stream)U()},J=function(){I._stream=null;var W=bQ0(I._header.size);if(W)I._parse(W,Q);else I._parse(512,H);if(!I._locked)U()},Q=function(){I._buffer.consume(bQ0(I._header.size)),I._parse(512,H),U()},K=function(){var W=I._header.size;I._paxGlobal=WK.decodePax(q.slice(0,W)),q.consume(W),J()},z=function(){var W=I._header.size;if(I._pax=WK.decodePax(q.slice(0,W)),I._paxGlobal)I._pax=Object.assign({},I._paxGlobal,I._pax);q.consume(W),J()},w=function(){var W=I._header.size;this._gnuLongPath=WK.decodeLongPath(q.slice(0,W),$.filenameEncoding),q.consume(W),J()},G=function(){var W=I._header.size;this._gnuLongLinkPath=WK.decodeLongPath(q.slice(0,W),$.filenameEncoding),q.consume(W),J()},H=function(){var W=I._offset,V;try{V=I._header=WK.decode(q.slice(0,512),$.filenameEncoding,$.allowUnknownFormat)}catch(X){I.emit("error",X)}if(q.consume(512),!V){I._parse(512,H),U();return}if(V.type==="gnu-long-path"){I._parse(V.size,w),U();return}if(V.type==="gnu-long-link-path"){I._parse(V.size,G),U();return}if(V.type==="pax-global-header"){I._parse(V.size,K),U();return}if(V.type==="pax-header"){I._parse(V.size,z),U();return}if(I._gnuLongPath)V.name=I._gnuLongPath,I._gnuLongPath=null;if(I._gnuLongLinkPath)V.linkname=I._gnuLongLinkPath,I._gnuLongLinkPath=null;if(I._pax)I._header=V=nI1(V,I._pax),I._pax=null;if(I._locked=!0,!V.size||V.type==="directory"){I._parse(512,H),I.emit("entry",V,fI1(I,W),Y);return}I._stream=new lX(I,W),I.emit("entry",V,I._stream,Y),I._parse(V.size,J),U()};this._onheader=H,this._parse(512,H)};iQ0.inherits(R5,pQ0);R5.prototype.destroy=function($){if(this._destroyed)return;if(this._destroyed=!0,$)this.emit("error",$);if(this.emit("close"),this._stream)this._stream.emit("close")};R5.prototype._parse=function($,I){if(this._destroyed)return;if(this._offset+=$,this._missing=$,I===this._onheader)this._partial=!1;this._onparse=I};R5.prototype._continue=function(){if(this._destroyed)return;var $=this._cb;if(this._cb=dQ0,this._overflow)this._write(this._overflow,void 0,$);else $()};R5.prototype._write=function($,I,q){if(this._destroyed)return;var U=this._stream,Y=this._buffer,J=this._missing;if($.length)this._partial=!0;if($.length<J){ Line truncated
<Relationships xmlns="http://schemas.openxmlformats.org/package/2006/relationships">`)}_writeRelationship($){if(!this.count)this._writeOpen();let I=`rId${++this.count}`;if($.TargetMode)this.stream.write(`<Relationship Id="${I}" Type="${$.Type}" Target="${Jq1.xmlEncode($.Target)}" TargetMode="${$.TargetMode}"/>`);else this.stream.write(`<Relationship Id="${I}" Type="${$.Type}" Target="${$.Target}"/>`);return I}_writeClose(){this.stream.write("</Relationships>")}}N20.exports=L20});var T20=L((uv1,P20)=>{var M20=e4(),A20=y9(),Kq1=K4(),zq1=LR(),wq1=FR();class g20{constructor($,I,q){this.id=q.id,this.count=0,this._worksheet=$,this._workbook=q.workbook,this._sheetRelsWriter=I}get commentsStream(){if(!this._commentsStream)this._commentsStream=this._workbook._openStream(`/xl/comments${this.id}.xml`);return this._commentsStream}get vmlStream(){if(!this._vmlStream)this._vmlStream=this._workbook._openStream(`xl/drawings/vmlDrawing${this.id}.vml`);return this._vmlStream}_addRelationships(){let $={Type:A20.Comments,Target:`../comments${this.id}.xml`};this._sheetRelsWriter.addRelationship($);let I={Type:A20.VmlDrawing,Target:`../drawings/vmlDrawing${this.id}.vml`};this.vmlRelId=this._sheetRelsWriter.addRelationship(I)}_addCommentRefs(){this._workbook.commentRefs.push({commentName:`comments${this.id}`,vmlDrawing:`vmlDrawing${this.id}`})}_writeOpen(){this.commentsStream.write('<?xml version="1.0" encoding="UTF-8" standalone="yes"?><comments xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main"><authors><author>Author</author></authors><commentList>'),this.vmlStream.write('<?xml version="1.0" encoding="UTF-8"?><xml xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:v="urn:schemas-microsoft-com:vml" xmlns:x="urn:schemas-microsoft-com:office:excel"><o:shapelayout v:ext="edit"><o:idmap v:ext="edit" data="1" /></o:shapelayout><v:shapetype id="_x0000_t202" coordsize="21600,21600" o:spt="202" path="m,l,21600r21600,l21600,xe"><v:stroke joinstyle="miter" /><v:path gradientshapeok="t" o:connecttype="rect" /></v:shapetype>')}_writeComment($,I){let q=new zq1,U=new M20;q.render(U,$),this.commentsStream.write(U.xml);let Y=new wq1,J=new M20;Y.render(J,$,I),this.vmlStream.write(J.xml)}_writeClose(){this.commentsStream.write("</commentList></comments>"),this.vmlStream.write("</xml>")}addComments($){if($&&$.length){if(!this.startedData)this._worksheet.comments=[],this._writeOpen(),this._addRelationships(),this._addCommentRefs(),this.startedData=!0;$.forEach((I)=>{I.refAddress=Kq1.decodeAddress(I.ref)}),$.forEach((I)=>{this._writeComment(I,this.count),this.count+=1})}}commit(){if(this.count)this._writeClose(),this.commentsStream.end(),this.vmlStream.end()}}P20.exports=g20});var C20=L((xv1,R20)=>{var Gq1=W4(),Hq1=y9(),ih=K4(),j20=uj(),E20=z5(),Vq1=aB(),B20=GV(),ph=VV(),Wq1=F20(),Zq1=T20(),Xq1=Sj(),f4=new Vq1,ch=_9(),Dq1=lv(),Oq1=mv(),Lq1=ov(),Nq1=iv(),Fq1=nv(),Mq1=pv(),Aq1=rv(),gq1=tv(),Pq1=av(),Tq1=sv(),jq1=ev(),Eq1=$R(),Bq1=JR(),vq1=qR(),Rq1=IR(),n4={dataValidations:new Dq1,sheetProperties:new Oq1,sheetFormatProperties:new Lq1,columns:new ch({tag:"cols",length:!1,childXform:new Nq1}),row:new Fq1,hyperlinks:new ch({tag:"hyperlinks",length:!1,childXform:new Mq1}),sheetViews:new ch({tag:"sheetViews",length:!1,childXform:new Aq1}),sheetProtection:new gq1,pageMargins:new Pq1,pageSeteup:new Tq1,autoFilter:new jq1,picture:new Eq1,conditionalFormattings:new Bq1,headerFooter:new vq1,rowBreaks:new Rq1};class v20{constructor($){this.id=$.id,this.name=$.name||`Sheet${this.id}`,this.state=$.state||"visible",this._rows=[],this._columns=null,this._keys={},this._merges=[],this._merges.add=function(){},this._sheetRelsWriter=new Wq1($),this._sheetCommentsWriter=new Zq1(this,this._sheetRelsWriter,$),this._dimensions=new E20,this._rowZero=1,this.committed=!1,this.dataValidations=new Xq1,this._formulae={},this._siFormulae=0,this.conditionalFormatting=[],this.rowBreaks=[],this.properties=Object.assign({},{defaultRowHeight:15,dyDescent:55,outlineLevelCol:0,outlineLevelRow:0},$.properties),this.headerFooter=Object.assign({},{differentFirst:!1,differentOddEven:!1,oddHeader:null,oddFooter:null,evenHeader:null,evenFooter:null,firstHeader:null,firstFooter:null},$.headerFooter),this.pageSetup=Object.assign({},{margins:{left:0.7,right:0.7,top:0.75,bottom:0.75,header:0.3,footer:0.3},orientation:"portrait",horizontalDpi:4294967295,verticalDpi:4294967295,fitToPage:!!($.pageSetup&&($.pageSetup.fitToWidth||$.pageSetup.fitToHeight)&&!$.pageSetup.scale),pageOrder:"downThenOver",blackAndWhite:!1,draft:!1,cellComments:"None",errors:"displayed",scale:100,fitToWidth:1,fitToHeight:1,paperSize:void 0,showRowColHeaders:!1,showGridLines:!1,horizontalCentered:!1,verticalCentered:!1,rowBreaks:null,colBreaks:null},$.pageSetup),this.useSharedStrings=$.useSharedStrings||!1,this._workbook=$.workbook,this.hasComments=!1,this._views=$.views||[],this.autoFilter=$.autoFilter||null,this._media=[],this.sheetProtection=null,this._writeOpenWorksheet(),this.startedData=!1}get Line truncated
See http://goo.gl/MqrFmX
`)},zS=wS.getNativePromise();if(wS.isNode&&typeof MutationObserver>"u")GS=global.setImmediate,HS=process.nextTick,n3=wS.isRecentNode?function($){GS.call(global,$)}:function($){HS.call(process,$)};else if(typeof zS==="function"&&typeof zS.resolve==="function")VS=zS.resolve(),n3=function($){VS.then($)};else if(typeof MutationObserver<"u"&&!(typeof window<"u"&&window.navigator&&(window.navigator.standalone||window.cordova)))n3=function(){var $=document.createElement("div"),I={attributes:!0},q=!1,U=document.createElement("div"),Y=new MutationObserver(function(){$.classList.toggle("foo"),q=!1});Y.observe(U,I);var J=function(){if(q)return;q=!0,U.classList.toggle("foo")};return function(K){var z=new MutationObserver(function(){z.disconnect(),K()});z.observe($,I),J()}}();else if(typeof setImmediate<"u")n3=function($){setImmediate($)};else if(typeof setTimeout<"u")n3=function($){setTimeout($,0)};else n3=MU1;var GS,HS,VS;GK0.exports=n3});var WK0=L((rv1,VK0)=>{function AU1($,I,q,U,Y){for(var J=0;J<Y;++J)q[J+U]=$[J+I],$[J+I]=void 0}function q7($){this._capacity=$,this._length=0,this._front=0}q7.prototype._willBeOverCapacity=function($){return this._capacity<$};q7.prototype._pushOne=function($){var I=this.length();this._checkCapacity(I+1);var q=this._front+I&this._capacity-1;this[q]=$,this._length=I+1};q7.prototype.push=function($,I,q){var U=this.length()+3;if(this._willBeOverCapacity(U)){this._pushOne($),this._pushOne(I),this._pushOne(q);return}var Y=this._front+U-3;this._checkCapacity(U);var J=this._capacity-1;this[Y+0&J]=$,this[Y+1&J]=I,this[Y+2&J]=q,this._length=U};q7.prototype.shift=function(){var $=this._front,I=this[$];return this[$]=void 0,this._front=$+1&this._capacity-1,this._length--,I};q7.prototype.length=function(){return this._length};q7.prototype._checkCapacity=function($){if(this._capacity<$)this._resizeTo(this._capacity<<1)};q7.prototype._resizeTo=function($){var I=this._capacity;this._capacity=$;var q=this._front,U=this._length,Y=q+U&I-1;AU1(this,0,this,I,Y)};VK0.exports=q7});var FK0=L((tv1,WS)=>{var LK0;try{throw Error()}catch($){LK0=$}var gU1=HK0(),ZK0=WK0(),NK0=n1();function b4(){this._customScheduler=!1,this._isTickUsed=!1,this._lateQueue=new ZK0(16),this._normalQueue=new ZK0(16),this._haveDrainedQueues=!1,this._trampolineEnabled=!0;var $=this;this.drainQueues=function(){$._drainQueues()},this._schedule=gU1}b4.prototype.setScheduler=function($){var I=this._schedule;return this._schedule=$,this._customScheduler=!0,I};b4.prototype.hasCustomScheduler=function(){return this._customScheduler};b4.prototype.enableTrampoline=function(){this._trampolineEnabled=!0};b4.prototype.disableTrampolineIfNecessary=function(){if(NK0.hasDevTools)this._trampolineEnabled=!1};b4.prototype.haveItemsQueued=function(){return this._isTickUsed||this._haveDrainedQueues};b4.prototype.fatalError=function($,I){if(I)process.stderr.write("Fatal "+($ instanceof Error?$.stack:$)+`
`),process.exit(2);else this.throwLater($)};b4.prototype.throwLater=function($,I){if(arguments.length===1)I=$,$=function(){throw I};if(typeof setTimeout<"u")setTimeout(function(){$(I)},0);else try{this._schedule(function(){$(I)})}catch(q){throw Error(`No async scheduler available
See http://goo.gl/MqrFmX
`)}};function XK0($,I,q){this._lateQueue.push($,I,q),this._queueTick()}function DK0($,I,q){this._normalQueue.push($,I,q),this._queueTick()}function OK0($){this._normalQueue._pushOne($),this._queueTick()}if(!NK0.hasDevTools)b4.prototype.invokeLater=XK0,b4.prototype.invoke=DK0,b4.prototype.settlePromises=OK0;else b4.prototype.invokeLater=function($,I,q){if(this._trampolineEnabled)XK0.call(this,$,I,q);else this._schedule(function(){setTimeout(function(){$.call(I,q)},100)})},b4.prototype.invoke=function($,I,q){if(this._trampolineEnabled)DK0.call(this,$,I,q);else this._schedule(function(){$.call(I,q)})},b4.prototype.settlePromises=function($){if(this._trampolineEnabled)OK0.call(this,$);else this._schedule(function(){$._settlePromises()})};b4.prototype._drainQueue=function($){while($.length()>0){var I=$.shift();if(typeof I!=="function"){I._settlePromises();continue}var q=$.shift(),U=$.shift();I.call(q,U)}};b4.prototype._drainQueues=function(){this._drainQueue(this._normalQueue),this._reset(),this._haveDrainedQueues=!0,this._drainQueue(this._lateQueue)};b4.prototype._queueTick=function(){if(!this._isTickUsed)this._isTickUsed=!0,this._schedule(this.drainQueues)};b4.prototype._reset=function(){this._isTickUsed=!1};WS.exports=b4;WS.exports.firstLineError=LK0});var _5=L((av1,gK0)=>{var DS=f3(),PU1=DS.freeze,MK0=n1(),AK0=MK0.inherits,eU=MK0.notEnumerableProp;function $Y($,I){function q(U){if(!(this instanceof q))return new q(U);if(eU(this,"message",typeof U==="string"?U:I),eU(this,"name",$),Error.captureStackTrace)Error.captureStackTrace(this,this.constructor);else Error.call(this)}return AK0(q,Error),q}var ZS,XS,TU1=$Y("Warning","warning"),jU1=$Y("CancellationError","cancellation error"),EU1=$Y("TimeoutError","timeout error"),NK=$Y("AggregateError","aggregate error");try{ZS=TypeError,XS=RangeError}catch($){ZS=$Y("TypeError","type error"),XS=$Y("RangeError","range error")}var ID="join pop push shift unshift slice filter forEach some every map indexOf lastIndexOf reduce reduceRight sort reverse".split(" ");for(b3=0;b3<ID.length;++b3)if(typeof Array.prototype[ID[b3]]==="function")NK.prototype[ID[b3]]=Array.prototype[ID[b3]];var b3;DS.defineProperty(NK.prototype,"length",{value:0,configurable:!1,writable:!0,enumerable:!0});NK.prototype.isOperational=!0;var qD=0;NK.prototype.toString=function(){var $=Array(qD*4+1).join(" "),I=`
`+$+`AggregateError of:
`;qD++,$=Array(qD*4+1).join(" ");for(var q=0;q<this.length;++q){var U=this[q]===this?"[Circular AggregateError]":this[q]+"",Y=U.split(`
`);for(var J=0;J<Y.length;++J)Y[J]=$+Y[J];U=Y.join(`
`),I+=U+`
`}return qD--,I};function LK($){if(!(this instanceof LK))return new LK($);if(eU(this,"name","OperationalError"),eU(this,"message",$),this.cause=$,this.isOperational=!0,$ instanceof Error)eU(this,"message",$.message),eU(this,"stack",$.stack);else if(Error.captureStackTrace)Error.captureStackTrace(this,this.constructor)}AK0(LK,Error);var i3=Error.__BluebirdErrorTypes__;if(!i3)i3=PU1({CancellationError:jU1,TimeoutError:EU1,OperationalError:LK,RejectionError:LK,AggregateError:NK}),DS.defineProperty(Error,"__BluebirdErrorTypes__",{value:i3,writable:!1,enumerable:!1,configurable:!1});gK0.exports={Error,TypeError:ZS,RangeError:XS,CancellationError:i3.CancellationError,OperationalError:i3.OperationalError,TimeoutError:i3.TimeoutError,AggregateError:i3.AggregateError,Warning:TU1}});var TK0=L((sv1,PK0)=>{PK0.exports=function($,I){var q=n1(),U=q.errorObj,Y=q.isObject;function J(H,W){if(Y(H)){if(H instanceof $)return H;var V=K(H);if(V===U){if(W)W._pushContext();var X=$.reject(V.e);if(W)W._popContext();return X}else if(typeof V==="function"){if(w(H)){var X=new $(I);return H._then(X._fulfill,X._reject,void 0,X,null),X}return G(H,V,W)}}return H}function Q(H){return H.then}function K(H){try{return Q(H)}catch(W){return U.e=W,U}}var z={}.hasOwnProperty;function w(H){try{return z.call(H,"_promise0")}catch(W){return!1}}function G(H,W,V){var X=new $(I),D=X;if(V)V._pushContext();if(X._captureStackTrace(),V)V._popContext();var O=!0,N=q.tryCatch(W).call(H,T,P);if(O=!1,X&&N===U)X._rejectCallback(N.e,!0,!0),X=null;function T(g){if(!X)return;X._resolveCallback(g),X=null}function P(g){if(!X)return;X._rejectCallback(g,O,!0),X=null}return D}return J}});var EK0=L((ev1,jK0)=>{jK0.exports=function($,I,q,U,Y){var J=n1(),Q=J.isArray;function K(w){switch(w){case-2:return[];case-3:return{}}}function z(w){var G=this._promise=new $(I);if(w instanceof $)G._propagateFrom(w,3);G._setOnCancel(this),this._values=w,this._length=0,this._totalResolved=0,this._init(void 0,-2)}return J.inherits(z,Y),z.prototype.length=function(){return this._length},z.prototype.promise=function(){return this._promise},z.prototype._init=function w(G,H){var W=q(this._values,this._promise);if(W instanceof $){W=W._target();var V=W._bitField;if(this._values=W,(V&50397184)===0)return this._promise._setAsyncGuaranteed(),W._then(w,this._reject,void 0,this,H);else if((V&33554432)!==0)W=W._value();else if((V&16777216)!==0)return this._reject(W._reason());else return this._cancel()}if(W=J.asArray(W),W===null){var X=U("expecting an array or an iterable object but got "+J.classString(W)).reason();this._promise._rejectCallback(X,!1);return}if(W.length===0){if(H===-5)this._resolveEmptyArray();else this._resolve(K(H));return}this._iterate(W)},z.prototype._iterate=function(w){var G=this.getActualLength(w.length);this._length=G,this._values=this.shouldCopyValues()?Array(G):this._values;var H=this._promise,W=!1,V=null;for(var X=0;X<G;++X){var D=q(w[X],H);if(D instanceof $)D=D._target(),V=D._bitField;else V=null;if(W){if(V!==null)D.suppressUnhandledRejections()}else if(V!==null)if((V&50397184)===0)D._proxy(this,X),this._values[X]=D;else if((V&33554432)!==0)W=this._promiseFulfilled(D._value(),X);else if((V&16777216)!==0)W=this._promiseRejected(D._reason(),X);else W=this._promiseCancelled(X);else W=this._promiseFulfilled(D,X)}if(!W)H._setAsyncGuaranteed()},z.prototype._isResolved=function(){return this._values===null},z.prototype._resolve=function(w){this._values=null,this._promise._fulfill(w)},z.prototype._cancel=function(){if(this._isResolved()||!this._promise._isCancellable())return;this._values=null,this._promise._cancel()},z.prototype._reject=function(w){this._values=null,this._promise._rejectCallback(w,!1)},z.prototype._promiseFulfilled=function(w,G){this._values[G]=w;var H=++this._totalResolved;if(H>=this._length)return this._resolve(this._values),!0;return!1},z.prototype._promiseCancelled=function(){return this._cancel(),!0},z.prototype._promiseRejected=function(w){return this._totalResolved++,this._reject(w),!0},z.prototype._resultCancelled=function(){if(this._isResolved())return;var w=this._values;if(this._cancel(),w instanceof $)w.cancel();else for(var G=0;G<w.length;++G)if(w[G]instanceof $)w[G].cancel()},z.prototype.shouldCopyValues=function(){return!0},z.prototype.getActualLength=function(w){return w},z}});var vK0=L(($R1,BK0)=>{BK0.exports=function($){var I=!1,q=[];$.prototype._promiseCreated=function(){},$.prototype._pushContext=function(){},$.prototype._popContext=function(){return null},$._peekContext=$.prototype._peekContext=function(){};function U(){this._trace=new U.CapturedTrace(J())}U.prototype._pushContext=function(){if(this._trace!==void 0)this._trace._promiseCreated=null,q.push(this._trace)},U.prototype._popContext=function(){if(this._trace!==void 0){var Q=q.pop(),K=Q._promiseCreated;return Q._promiseCreated=null,K}return null};function Y(){if(I)return new U}function J(){var Q=q.length-1;if(Q>=0)return q[Q];return}return U.CapturedTrace=null,U.create=Y,U.deactivateLong Line truncated
See http://goo.gl/MqrFmX
`);if(!g0.longStackTraces&&h$()){var r=$.prototype._captureStackTrace,F=$.prototype._attachExtraTrace;g0.longStackTraces=!0,g=function(){if(U.haveItemsQueued()&&!g0.longStackTraces)throw Error(`cannot enable long stack traces after promises have been created
See http://goo.gl/MqrFmX
`);$.prototype._captureStackTrace=r,$.prototype._attachExtraTrace=F,I.deactivateLongStackTraces(),U.enableTrampoline(),g0.longStackTraces=!1},$.prototype._captureStackTrace=K0,$.prototype._attachExtraTrace=G0,I.activateLongStackTraces(),U.disableTrampolineIfNecessary()}},$.hasLongStackTraces=function(){return g0.longStackTraces&&h$()};var B=function(){try{if(typeof CustomEvent==="function"){var r=new CustomEvent("CustomEvent");return J.global.dispatchEvent(r),function(F,M){var v=new CustomEvent(F.toLowerCase(),{detail:M,cancelable:!0});return!J.global.dispatchEvent(v)}}else if(typeof Event==="function"){var r=new Event("CustomEvent");return J.global.dispatchEvent(r),function(M,v){var y=new Event(M.toLowerCase(),{cancelable:!0});return y.detail=v,!J.global.dispatchEvent(y)}}else{var r=document.createEvent("CustomEvent");return r.initCustomEvent("testingtheevent",!1,!0,{}),J.global.dispatchEvent(r),function(M,v){var y=document.createEvent("CustomEvent");return y.initCustomEvent(M.toLowerCase(),!1,!0,v),!J.global.dispatchEvent(y)}}}catch(F){}return function(){return!1}}(),k=function(){if(J.isNode)return function(){return process.emit.apply(process,arguments)};else{if(!J.global)return function(){return!1};return function(r){var F="on"+r.toLowerCase(),M=J.global[F];if(!M)return!1;return M.apply(J.global,[].slice.call(arguments,1)),!0}}}();function h(r,F){return{promise:F}}var n={promiseCreated:h,promiseFulfilled:h,promiseRejected:h,promiseResolved:h,promiseCancelled:h,promiseChained:function(r,F,M){return{promise:F,child:M}},warning:function(r,F){return{warning:F}},unhandledRejection:function(r,F,M){return{reason:F,promise:M}},rejectionHandled:h},S=function(r){var F=!1;try{F=k.apply(null,arguments)}catch(v){U.throwLater(v),F=!0}var M=!1;try{M=B(r,n[r].apply(null,arguments))}catch(v){U.throwLater(v),M=!0}return M||F};$.config=function(r){if(r=Object(r),"longStackTraces"in r){if(r.longStackTraces)$.longStackTraces();else if(!r.longStackTraces&&$.hasLongStackTraces())g()}if("warnings"in r){var F=r.warnings;if(g0.warnings=!!F,P=g0.warnings,J.isObject(F)){if("wForgottenReturn"in F)P=!!F.wForgottenReturn}}if("cancellation"in r&&r.cancellation&&!g0.cancellation){if(U.haveItemsQueued())throw Error("cannot enable cancellation after promises are in use");$.prototype._clearCancellationData=J0,$.prototype._propagateFrom=j,$.prototype._onCancel=f,$.prototype._setOnCancel=b,$.prototype._attachCancellationCallback=C,$.prototype._execute=p,d=j,g0.cancellation=!0}if("monitoring"in r){if(r.monitoring&&!g0.monitoring)g0.monitoring=!0,$.prototype._fireEvent=S;else if(!r.monitoring&&g0.monitoring)g0.monitoring=!1,$.prototype._fireEvent=t}return $};function t(){return!1}$.prototype._fireEvent=t,$.prototype._execute=function(r,F,M){try{r(F,M)}catch(v){return v}},$.prototype._onCancel=function(){},$.prototype._setOnCancel=function(r){},$.prototype._attachCancellationCallback=function(r){},$.prototype._captureStackTrace=function(){},$.prototype._attachExtraTrace=function(){},$.prototype._clearCancellationData=function(){},$.prototype._propagateFrom=function(r,F){};function p(r,F,M){var v=this;try{r(F,M,function(y){if(typeof y!=="function")throw TypeError("onCancel must be a function, got: "+J.toString(y));v._attachCancellationCallback(y)})}catch(y){return y}}function C(r){if(!this._isCancellable())return this;var F=this._onCancel();if(F!==void 0)if(J.isArray(F))F.push(r);else this._setOnCancel([F,r]);else this._setOnCancel(r)}function f(){return this._onCancelField}function b(r){this._onCancelField=r}function J0(){this._cancellationParent=void 0,this._onCancelField=void 0}function j(r,F){if((F&1)!==0){this._cancellationParent=r;var M=r._branchesRemainingToCancel;if(M===void 0)M=0;r._branchesRemainingToCancel=M+1}if((F&2)!==0&&r._isBound())this._setBoundTo(r._boundTo)}function u(r,F){if((F&2)!==0&&r._isBound())this._setBoundTo(r._boundTo)}var d=u;function a(){var r=this._boundTo;if(r!==void 0){if(r instanceof $)if(r.isFulfilled())return r.value();else return}return r}function K0(){this._trace=new a6(this._peekContext())}function G0(r,F){if(Q(r)){var M=this._trace;if(M!==void 0){if(F)M=M._parent}if(M!==void 0)M.attachExtraTrace(r);else if(!r.__stackCleaned__){var v=Y4(r);J.notEnumerableProp(r,"stack",v.message+`
`+v.stack.join(`
`)),J.notEnumerableProp(r,"__stackCleaned__",!0)}}}function M0(r,F,M,v,y){if(r===void 0&&F!==null&&P){if(y!==void 0&&y._returnedNonUndefined())return;if((v._bitField&65535)===0)return;if(M)M=M+" ";var s="",c="";if(F._trace){var e=F._trace.stack.split(`
`),U0=Q1(e);for(var w0=U0.length-1;w0>=0;--w0){var T0=U0[w0];if(!G.test(T0)){var x0=T0.match(H);if(x0)s="at "+x0[1]+":"+x0[2]+":"+x0[3]+" ";break}}if(U0.length>0){var y0=U0[0];for(var w0=0;w0<e.length;++w0)if(e[w0]===y0){if(w0>0)c=`
`+e[w0-1];break}}}var q1="a promise was created in a "+M+"handler "+s+"but was not returned from it, see http://goo.gl/rRqMUw"+c;v._warn(q1,!0,F)}}function v0(r,F){var M=r+" is deprecated and will be removed in a future version.";if(F)M+=" Use "+F+" instead.";return v1(M)}function v1(r,F,M){if(!g0.warnings)return;var v=new Y(r),y;if(F)M._attachExtraTrace(v);else if(g0.longStackTraces&&(y=$._peekContext()))y.attachExtraTrace(v);else{var s=Y4(v);v.stack=s.message+`
`+s.stack.join(`
`)}if(!S("warning",v))v4(v,"",!0)}function m0(r,F){for(var M=0;M<F.length-1;++M)F[M].push("From previous event:"),F[M]=F[M].join(`
`);if(M<F.length)F[M]=F[M].join(`
`);return r+`
`+F.join(`
`)}function N1(r){for(var F=0;F<r.length;++F)if(r[F].length===0||F+1<r.length&&r[F][0]===r[F+1][0])r.splice(F,1),F--}function F1(r){var F=r[0];for(var M=1;M<r.length;++M){var v=r[M],y=F.length-1,s=F[y],c=-1;for(var e=v.length-1;e>=0;--e)if(v[e]===s){c=e;break}for(var e=c;e>=0;--e){var U0=v[e];if(F[y]===U0)F.pop(),y--;else break}F=v}}function Q1(r){var F=[];for(var M=0;M<r.length;++M){var v=r[M],y=v===" (No stack trace)"||W.test(v),s=y&&G$(v);if(y&&!s){if(X&&v.charAt(0)!==" ")v=" "+v;F.push(v)}}return F}function C1(r){var F=r.stack.replace(/\s+$/g,"").split(`
`);for(var M=0;M<F.length;++M){var v=F[M];if(v===" (No stack trace)"||W.test(v))break}if(M>0&&r.name!="SyntaxError")F=F.slice(M);return F}function Y4(r){var F=r.stack,M=r.toString();return F=typeof F==="string"&&F.length>0?C1(r):[" (No stack trace)"],{message:M,stack:r.name=="SyntaxError"?F:Q1(F)}}function v4(r,F,M){if(typeof console<"u"){var v;if(J.isObject(r)){var y=r.stack;v=F+V(y,r)}else v=F+String(r);if(typeof D==="function")D(v,M);else if(typeof console.log==="function"||typeof console.log==="object")console.log(v)}}function w$(r,F,M,v){var y=!1;try{if(typeof F==="function")if(y=!0,r==="rejectionHandled")F(v);else F(M,v)}catch(s){U.throwLater(s)}if(r==="unhandledRejection"){if(!S(r,M,v)&&!y)v4(M,"Unhandled rejection ")}else S(r,v)}function _$(r){var F;if(typeof r==="function")F="[function "+(r.name||"anonymous")+"]";else{F=r&&typeof r.toString==="function"?r.toString():J.toString(r);var M=/\[object [a-zA-Z0-9$_]+\]/;if(M.test(F))try{var v=JSON.stringify(r);F=v}catch(y){}if(F.length===0)F="(empty array)"}return"(<"+p8(F)+">, no stack trace)"}function p8(r){var F=41;if(r.length<F)return r;return r.substr(0,F-3)+"..."}function h$(){return typeof p5==="function"}var G$=function(){return!1},c8=/[\/<\(]([^:\/]+):(\d+):(?:\d+)\)?\s*$/;function t6(r){var F=r.match(c8);if(F)return{fileName:F[1],line:parseInt(F[2],10)}}function D7(r,F){if(!h$())return;var M=r.stack.split(`
`),v=F.stack.split(`
`),y=-1,s=-1,c,e;for(var U0=0;U0<M.length;++U0){var w0=t6(M[U0]);if(w0){c=w0.fileName,y=w0.line;break}}for(var U0=0;U0<v.length;++U0){var w0=t6(v[U0]);if(w0){e=w0.fileName,s=w0.line;break}}if(y<0||s<0||!c||!e||c!==e||y>=s)return;G$=function(T0){if(w.test(T0))return!0;var x0=t6(T0);if(x0){if(x0.fileName===c&&(y<=x0.line&&x0.line<=s))return!0}return!1}}function a6(r){this._parent=r,this._promisesCreated=0;var F=this._length=1+(r===void 0?0:r._length);if(p5(this,a6),F>32)this.uncycle()}J.inherits(a6,Error),I.CapturedTrace=a6,a6.prototype.uncycle=function(){var r=this._length;if(r<2)return;var F=[],M={};for(var v=0,y=this;y!==void 0;++v)F.push(y),y=y._parent;r=this._length=v;for(var v=r-1;v>=0;--v){var s=F[v].stack;if(M[s]===void 0)M[s]=v}for(var v=0;v<r;++v){var c=F[v].stack,e=M[c];if(e!==void 0&&e!==v){if(e>0)F[e-1]._parent=void 0,F[e-1]._length=1;F[v]._parent=void 0,F[v]._length=1;var U0=v>0?F[v-1]:this;if(e<r-1)U0._parent=F[e+1],U0._parent.uncycle(),U0._length=U0._parent._length+1;else U0._parent=void 0,U0._length=1;var w0=U0._length+1;for(var T0=v-2;T0>=0;--T0)F[T0]._length=w0,w0++;return}}},a6.prototype.attachExtraTrace=function(r){if(r.__stackCleaned__)return;this.uncycle();var F=Y4(r),M=F.message,v=[F.stack],y=this;while(y!==void 0)v.push(Q1(y.stack.split(`
`))),y=y._parent;F1(v),N1(v),J.notEnumerableProp(r,"stack",m0(M,v)),J.notEnumerableProp(r,"__stackCleaned__",!0)};var p5=function(){var F=/^\s*at\s*/,M=function(c,e){if(typeof c==="string")return c;if(e.name!==void 0&&e.message!==void 0)return e.toString();return _$(e)};if(typeof Error.stackTraceLimit==="number"&&typeof Error.captureStackTrace==="function"){Error.stackTraceLimit+=6,W=F,V=M;var v=Error.captureStackTrace;return G$=function(c){return w.test(c)},function(c,e){Error.stackTraceLimit+=6,v(c,e),Error.stackTraceLimit-=6}}var y=Error();if(typeof y.stack==="string"&&y.stack.split(`
`)[0].indexOf("stackDetection@")>=0)return W=/@/,V=M,X=!0,function(e){e.stack=Error().stack};var s;try{throw Error()}catch(c){s="stack"in c}if(!("stack"in y)&&s&&typeof Error.stackTraceLimit==="number")return W=F,V=M,function(e){Error.stackTraceLimit+=6;try{throw Error()}catch(U0){e.stack=U0.stack}Error.stackTraceLimit-=6};return V=function(c,e){if(typeof c==="string")return c;if((typeof e==="object"||typeof e==="function")&&e.name!==void 0&&e.message!==void 0)return e.toString();return _$(e)},null}([]);if(typeof console<"u"&&typeof console.warn<"u"){if(D=function(r){console.warn(r)},J.isNode&&process.stderr.isTTY)D=function(r,F){var M=F?"\x1B[33m":"\x1B[31m";console.warn(M+r+`\x1B[0m
`)};else if(!J.isNode&&typeof Error().stack==="string")D=function(r,F){console.warn("%c"+r,F?"color: darkorange":"color: red")}}var g0={warnings:N,longStackTraces:!1,cancellation:!1,monitoring:!1};if(T)$.longStackTraces();return{longStackTraces:function(){return g0.longStackTraces},warnings:function(){return g0.warnings},cancellation:function(){return g0.cancellation},monitoring:function(){return g0.monitoring},propagateFromFunction:function(){return d},boundValueFunction:function(){return a},checkForgottenReturns:M0,setBounds:D7,warn:v1,deprecated:v0,CapturedTrace:a6,fireDomEvent:B,fireGlobalEvent:k}}});var hK0=L((qR1,_K0)=>{_K0.exports=function($,I){var q=n1(),U=$.CancellationError,Y=q.errorObj;function J(H,W,V){this.promise=H,this.type=W,this.handler=V,this.called=!1,this.cancelPromise=null}J.prototype.isFinallyHandler=function(){return this.type===0};function Q(H){this.finallyHandler=H}Q.prototype._resultCancelled=function(){K(this.finallyHandler)};function K(H,W){if(H.cancelPromise!=null){if(arguments.length>1)H.cancelPromise._reject(W);else H.cancelPromise._cancel();return H.cancelPromise=null,!0}return!1}function z(){return G.call(this,this.promise._target()._settledValue())}function w(H){if(K(this,H))return;return Y.e=H,Y}function G(H){var W=this.promise,V=this.handler;if(!this.called){this.called=!0;var X=this.isFinallyHandler()?V.call(W._boundValue()):V.call(W._boundValue(),H);if(X!==void 0){W._setReturnedNonUndefined();var D=I(X,W);if(D instanceof $){if(this.cancelPromise!=null){if(D._isCancelled()){var O=new U("late cancellation observer");return W._attachExtraTrace(O),Y.e=O,Y}else if(D.isPending())D._attachCancellationCallback(new Q(this))}return D._then(z,w,void 0,this,void 0)}}}if(W.isRejected())return K(this),Y.e=H,Y;else return K(this),H}return $.prototype._passThrough=function(H,W,V,X){if(typeof H!=="function")return this.then();return this._then(V,X,void 0,new J(this,W,H),void 0)},$.prototype.lastly=$.prototype.finally=function(H){return this._passThrough(H,0,G,G)},$.prototype.tap=function(H){return this._passThrough(H,1,G)},J}});var yK0=L((UR1,SK0)=>{SK0.exports=function($){var I=n1(),q=f3().keys,U=I.tryCatch,Y=I.errorObj;function J(Q,K,z){return function(w){var G=z._boundValue();$:for(var H=0;H<Q.length;++H){var W=Q[H];if(W===Error||W!=null&&W.prototype instanceof Error){if(w instanceof W)return U(K).call(G,w)}else if(typeof W==="function"){var V=U(W).call(G,w);if(V===Y)return V;else if(V)return U(K).call(G,w)}else if(I.isObject(w)){var X=q(W);for(var D=0;D<X.length;++D){var O=X[D];if(W[O]!=w[O])continue $}return U(K).call(G,w)}}return $}}return J}});var OS=L((YR1,kK0)=>{var uK0=n1(),BU1=uK0.maybeWrapAsError,vU1=_5(),RU1=vU1.OperationalError,xK0=f3();function CU1($){return $ instanceof Error&&xK0.getPrototypeOf($)===Error.prototype}var _U1=/^(?:name|message|stack|cause)$/;function hU1($){var I;if(CU1($)){I=new RU1($),I.name=$.name,I.message=$.message,I.stack=$.stack;var q=xK0.keys($);for(var U=0;U<q.length;++U){var Y=q[U];if(!_U1.test(Y))I[Y]=$[Y]}return I}return uK0.markAsOriginatingFromRejection($),$}function SU1($,I){return function(q,U){if($===null)return;if(q){var Y=hU1(BU1(q));$._attachExtraTrace(Y),$._reject(Y)}else if(!I)$._fulfill(U);else{var J=arguments.length,Q=Array(Math.max(J-1,0));for(var K=1;K<J;++K)Q[K-1]=arguments[K];$._fulfill(Q)}$=null}}kK0.exports=SU1});var nK0=L((JR1,fK0)=>{fK0.exports=function($,I,q,U,Y){var J=n1(),Q=J.tryCatch;$.method=function(K){if(typeof K!=="function")throw new $.TypeError("expecting a function but got "+J.classString(K));return function(){var z=new $(I);z._captureStackTrace(),z._pushContext();var w=Q(K).apply(this,arguments),G=z._popContext();return Y.checkForgottenReturns(w,G,"Promise.method",z),z._resolveFromSyncValue(w),z}},$.attempt=$.try=function(K){if(typeof K!=="function")return U("expecting a function but got "+J.classString(K));var z=new $(I);z._captureStackTrace(),z._pushContext();var w;if(arguments.length>1){Y.deprecated("calling Promise.try with more than 1 argument");var G=arguments[1],H=arguments[2];w=J.isArray(G)?Q(K).apply(H,G):Q(K).call(H,G)}else w=Q(K)();var W=z._popContext();return Y.checkForgottenReturns(w,W,"Promise.try",z),z._resolveFromSyncValue(w),z},$.prototype._resolveFromSyncValue=function(K){if(K===J.errorObj)this._rejectCallback(K.e,!1);else this._resolveCallback(K,!0)}}});var iK0=L((QR1,bK0)=>{bK0.exports=function($,I,q,U){var Y=!1,J=function(w,G){this._reject(G)},Q=function(w,G){G.promiseRejectionQueued=!0,G.bindingPromise._then(J,J,null,this,w)},K=function(w,G){if((this._bitField&50397184)===0)this._resolveCallback(G.target)},z=function(w,G){if(!G.promiseRejectionQueued)this._reject(w)};$.prototype.bind=function(w){if(!Y)Y=!0,$.prototype._propagateFrom=U.propagateFromFunction(),$.prototype._boundValue=U.boundValueFunction();var G=q(w),H=new $(I);H._propagateFrom(this,1);var W=this._target();if(H._setBoundTo(G),G instanceof $){var V={promiseRejectionQueued:!1,promise:H,target:W,bindingPromise:G};W._then(I,Q,voi Line truncated
See http://goo.gl/MqrFmX
`);return this._settledValue()},U=I.prototype.error=I.prototype.reason=function(){if(!this.isRejected())throw TypeError(`cannot get rejection reason of a non-rejected promise
See http://goo.gl/MqrFmX
`);return this._settledValue()},Y=I.prototype.isFulfilled=function(){return(this._bitField&33554432)!==0},J=I.prototype.isRejected=function(){return(this._bitField&16777216)!==0},Q=I.prototype.isPending=function(){return(this._bitField&50397184)===0},K=I.prototype.isResolved=function(){return(this._bitField&50331648)!==0};I.prototype.isCancelled=function(){return(this._bitField&8454144)!==0},$.prototype.__isCancelled=function(){return(this._bitField&65536)===65536},$.prototype._isCancelled=function(){return this._target().__isCancelled()},$.prototype.isCancelled=function(){return(this._target()._bitField&8454144)!==0},$.prototype.isPending=function(){return Q.call(this._target())},$.prototype.isRejected=function(){return J.call(this._target())},$.prototype.isFulfilled=function(){return Y.call(this._target())},$.prototype.isResolved=function(){return K.call(this._target())},$.prototype.value=function(){return q.call(this._target())},$.prototype.reason=function(){var z=this._target();return z._unsetRejectionIsUnhandled(),U.call(z)},$.prototype._value=function(){return this._settledValue()},$.prototype._reason=function(){return this._unsetRejectionIsUnhandled(),this._settledValue()},$.PromiseInspection=I}});var tK0=L((GR1,rK0)=>{rK0.exports=function($,I,q,U,Y,J){var Q=n1(),K=Q.canEvaluate,z=Q.tryCatch,w=Q.errorObj,G;if(K){var H=function(T){return Function("value","holder",`
'use strict';
holder.pIndex = value;
holder.checkFulfillment(this);
`.replace(/Index/g,T))},W=function(T){return Function("promise","holder",`
'use strict';
holder.pIndex = promise;
`.replace(/Index/g,T))},V=function(T){var P=Array(T);for(var g=0;g<P.length;++g)P[g]="this.p"+(g+1);var B=P.join(" = ")+" = null;",k=`var promise;
`+P.map(function(t){return`
promise = `+t+`;
if (promise instanceof Promise) {
promise.cancel();
}
`}).join(`
`),h=P.join(", "),n="Holder$"+T,S=`return function(tryCatch, errorObj, Promise, async) {
'use strict';
function [TheName](fn) {
[TheProperties]
this.fn = fn;
this.asyncNeeded = true;
this.now = 0;
}
[TheName].prototype._callFunction = function(promise) {
promise._pushContext();
var ret = tryCatch(this.fn)([ThePassedArguments]);
promise._popContext();
if (ret === errorObj) {
promise._rejectCallback(ret.e, false);
} else {
promise._resolveCallback(ret);
}
};
[TheName].prototype.checkFulfillment = function(promise) {
var now = ++this.now;
if (now === [TheTotal]) {
if (this.asyncNeeded) {
async.invoke(this._callFunction, this, promise);
} else {
this._callFunction(promise);
}
}
};
[TheName].prototype._resultCancelled = function() {
[CancellationCode]
};
return [TheName];
}(tryCatch, errorObj, Promise, async);
`;return S=S.replace(/\[TheName\]/g,n).replace(/\[TheTotal\]/g,T).replace(/\[ThePassedArguments\]/g,h).replace(/\[TheProperties\]/g,B).replace(/\[CancellationCode\]/g,k),Function("tryCatch","errorObj","Promise","async",S)(z,w,$,Y)},X=[],D=[],O=[];for(var N=0;N<8;++N)X.push(V(N+1)),D.push(H(N+1)),O.push(W(N+1));G=function(T){this._reject(T)}}$.join=function(){var T=arguments.length-1,P;if(T>0&&typeof arguments[T]==="function"){if(P=arguments[T],T<=8&&K){var b=new $(U);b._captureStackTrace();var g=X[T-1],B=new g(P),k=D;for(var h=0;h<T;++h){var n=q(arguments[h],b);if(n instanceof $){n=n._target();var S=n._bitField;if((S&50397184)===0)n._then(k[h],G,void 0,b,B),O[h](n,B),B.asyncNeeded=!1;else if((S&33554432)!==0)k[h].call(b,n._value(),B);else if((S&16777216)!==0)b._reject(n._reason());else b._cancel()}else k[h].call(b,n,B)}if(!b._isFateSealed()){if(B.asyncNeeded){var t=J();if(t!==null)B.fn=Q.domainBind(t,B.fn)}b._setAsyncGuaranteed(),b._setOnCancel(B)}return b}}var p=arguments.length,C=Array(p);for(var f=0;f<p;++f)C[f]=arguments[f];if(P)C.pop();var b=new I(C).promise();return P!==void 0?b.spread(P):b}}});var sK0=L((HR1,aK0)=>{aK0.exports=function($,I,q,U,Y,J){var Q=$._getDomain,K=n1(),z=K.tryCatch,w=K.errorObj,G=$._async;function H(V,X,D,O){this.constructor$(V),this._promise._captureStackTrace();var N=Q();this._callback=N===null?X:K.domainBind(N,X),this._preservedValues=O===Y?Array(this.length()):null,this._limit=D,this._inFlight=0,this._queue=[],G.invoke(this._asyncInit,this,void 0)}K.inherits(H,I),H.prototype._asyncInit=function(){this._init$(void 0,-2)},H.prototype._init=function(){},H.prototype._promiseFulfilled=function(V,X){var D=this._values,O=this.length(),N=this._preservedValues,T=this._limit;if(X<0){if(X=X*-1-1,D[X]=V,T>=1){if(this._inFlight--,this._drainQueue(),this._isResolved())return!0}}else{if(T>=1&&this._inFlight>=T)return D[X]=V,this._queue.push(X),!1;if(N!==null)N[X]=V;var P=this._promise,g=this._callback,B=P._boundValue();P._pushContext();var k=z(g).call(B,V,X,O),h=P._popContext();if(J.checkForgottenReturns(k,h,N!==null?"Promise.filter":"Promise.map",P),k===w)return this._reject(k.e),!0;var n=U(k,this._promise);if(n instanceof $){n=n._target();var S=n._bitField;if((S&50397184)===0){if(T>=1)this._inFlight++;return D[X]=n,n._proxy(this,(X+1)*-1),!1}else if((S&33554432)!==0)k=n._value();else if((S&16777216)!==0)return this._reject(n._reason()),!0;else return this._cancel(),!0}D[X]=k}var t=++this._totalResolved;if(t>=O){if(N!==null)this._filter(D,N);else this._resolve(D);return!0}return!1},H.prototype._drainQueue=function(){var V=this._queue,X=this._limit,D=this._values;while(V.length>0&&this._inFlight<X){if(this._isResolved())return;var O=V.pop();this._promiseFulfilled(D[O],O)}},H.prototype._filter=function(V,X){var D=X.length,O=Array(D),N=0;for(var T=0;T<D;++T)if(V[T])O[N++]=X[T];O.length=N,this._resolve(O)},H.prototype.preservedValues=function(){return this._preservedValues};function W(V,X,D,O){if(typeof X!=="function")return q("expecting a function but got "+K.classString(X));var N=0;if(D!==void 0)if(typeof D==="object"&&D!==null){if(typeof D.concurrency!=="number")return $.reject(TypeError("'concurrency' must be a number but it is "+K.classString(D.concurrency)));N=D.concurrency}else return $.reject(TypeError("options argument must be an object but it is "+K.classString(D)));return N=typeof N==="number"&&isFinite(N)&&N>=1?N:0,new H(V,X,N,O).promise()}$.prototype.map=function(V,X){return W(this,V,X,null)},$.map=function(V,X,D,O){return W(V,X,D,O)}}});var $z0=L((VR1,eK0)=>{var LS=Object.create;if(LS)UD=LS(null),YD=LS(null),UD[" size"]=YD[" size"]=0;var UD,YD;eK0.exports=function($){var I=n1(),q=I.canEvaluate,U=I.isIdentifier,Y,J,Q=function(V){return Function("ensureMethod",`
return function(obj) {
'use strict'
var len = this.length;
ensureMethod(obj, 'methodName');
switch(len) {
case 1: return obj.methodName(this[0]);
case 2: return obj.methodName(this[0], this[1]);
case 3: return obj.methodName(this[0], this[1], this[2]);
case 0: return obj.methodName();
default:
return obj.methodName.apply(obj, this);
}
};
`.replace(/methodName/g,V))(w)},K=function(V){return Function("obj",`
'use strict';
return obj.propertyName;
`.replace("propertyName",V))},z=function(V,X,D){var O=D[V];if(typeof O!=="function"){if(!U(V))return null;if(O=X(V),D[V]=O,D[" size"]++,D[" size"]>512){var N=Object.keys(D);for(var T=0;T<256;++T)delete D[N[T]];D[" size"]=N.length-256}}return O};Y=function(V){return z(V,Q,UD)},J=function(V){return z(V,K,YD)};function w(V,X){var D;if(V!=null)D=V[X];if(typeof D!=="function"){var O="Object "+I.classString(V)+" has no method '"+I.toString(X)+"'";throw new $.TypeError(O)}return D}function G(V){var X=this.pop(),D=w(V,X);return D.apply(V,this)}$.prototype.call=function(V){var X=arguments.length,D=Array(Math.max(X-1,0));for(var O=1;O<X;++O)D[O-1]=arguments[O];if(q){var N=Y(V);if(N!==null)return this._then(N,void 0,void 0,D,void 0)}return D.push(V),this._then(G,void 0,void 0,D,void 0)};function H(V){return V[this]}function W(V){var X=+this;if(X<0)X=Math.max(0,X+V.length);return V[X]}$.prototype.get=function(V){var X=typeof V==="number",D;if(!X)if(q){var O=J(V);D=O!==null?O:H}else D=H;else D=W;return this._then(D,void 0,void 0,V,void 0)}}});var qz0=L((WR1,Iz0)=>{Iz0.exports=function($,I,q,U,Y,J){var Q=n1(),K=_5().TypeError,z=n1().inherits,w=Q.errorObj,G=Q.tryCatch,H={};function W(P){setTimeout(function(){throw P},0)}function V(P){var g=q(P);if(g!==P&&typeof P._isDisposable==="function"&&typeof P._getDisposer==="function"&&P._isDisposable())g._setDisposable(P._getDisposer());return g}function X(P,g){var B=0,k=P.length,h=new $(Y);function n(){if(B>=k)return h._fulfill();var S=V(P[B++]);if(S instanceof $&&S._isDisposable()){try{S=q(S._getDisposer().tryDispose(g),P.promise)}catch(t){return W(t)}if(S instanceof $)return S._then(n,W,null,null,null)}n()}return n(),h}function D(P,g,B){this._data=P,this._promise=g,this._context=B}D.prototype.data=function(){return this._data},D.prototype.promise=function(){return this._promise},D.prototype.resource=function(){if(this.promise().isFulfilled())return this.promise().value();return H},D.prototype.tryDispose=function(P){var g=this.resource(),B=this._context;if(B!==void 0)B._pushContext();var k=g!==H?this.doDispose(g,P):null;if(B!==void 0)B._popContext();return this._promise._unsetDisposable(),this._data=null,k},D.isDisposer=function(P){return P!=null&&typeof P.resource==="function"&&typeof P.tryDispose==="function"};function O(P,g,B){this.constructor$(P,g,B)}z(O,D),O.prototype.doDispose=function(P,g){var B=this.data();return B.call(P,P,g)};function N(P){if(D.isDisposer(P))return this.resources[this.index]._setDisposable(P),P.promise();return P}function T(P){this.length=P,this.promise=null,this[P-1]=null}T.prototype._resultCancelled=function(){var P=this.length;for(var g=0;g<P;++g){var B=this[g];if(B instanceof $)B.cancel()}},$.using=function(){var P=arguments.length;if(P<2)return I("you must pass at least 2 arguments to Promise.using");var g=arguments[P-1];if(typeof g!=="function")return I("expecting a function but got "+Q.classString(g));var B,k=!0;if(P===2&&Array.isArray(arguments[0]))B=arguments[0],P=B.length,k=!1;else B=arguments,P--;var h=new T(P);for(var n=0;n<P;++n){var S=B[n];if(D.isDisposer(S)){var t=S;S=S.promise(),S._setDisposable(t)}else{var p=q(S);if(p instanceof $)S=p._then(N,null,null,{resources:h,index:n},void 0)}h[n]=S}var C=Array(h.length);for(var n=0;n<C.length;++n)C[n]=$.resolve(h[n]).reflect();var f=$.all(C).then(function(J0){for(var j=0;j<J0.length;++j){var u=J0[j];if(u.isRejected())return w.e=u.error(),w;else if(!u.isFulfilled()){f.cancel();return}J0[j]=u.value()}b._pushContext(),g=G(g);var d=k?g.apply(void 0,J0):g(J0),a=b._popContext();return J.checkForgottenReturns(d,a,"Promise.using",b),d}),b=f.lastly(function(){var J0=new $.PromiseInspection(f);return X(h,J0)});return h.promise=b,b._setOnCancel(h),b},$.prototype._setDisposable=function(P){this._bitField=this._bitField|131072,this._disposer=P},$.prototype._isDisposable=function(){return(this._bitField&131072)>0},$.prototype._getDisposer=function(){return this._disposer},$.prototype._unsetDisposable=function(){this._bitField=this._bitField&-131073,this._disposer=void 0},$.prototype.disposer=function(P){if(typeof P==="function")return new O(P,this,U());throw new K}}});var Yz0=L((ZR1,Uz0)=>{Uz0.exports=function($,I,q){var U=n1(),Y=$.TimeoutError;function J(H){this.handle=H}J.prototype._resultCancelled=function(){clearTimeout(this.handle)};var Q=function(H){return K(+this).thenReturn(H)},K=$.delay=function(H,W){var V,X;if(W!==void 0){if(V=$.resolve(W)._then(Q,null,null,H,void 0),q.cancellation()&&W instanceof $)V._setOnCancel(W)}else{if(V=new $(I),X=setTimeout(function(){V._fulfill()},+H),q.cancellation())V._setOnCancel(new J(X));V._captureStackTrace()}return V._setAsyncGuaranteed(),V};$.prototype.delay=function(H){return K(H,this)};var z=function(H,W,V){var X;if(typeof W!=="string")if(W instanceof Error)X=W;else X=new Y("operation timed out");else X=new Y(W);if(U.markAsOriginatingFromRejection(X),H._attachExtraTrace(X),H._reject(X),V!=null)V.cancel()};function w(H){return clearTimeout(this.handle),H}f Line truncated
See http://goo.gl/MqrFmX
`.replace("%s",O)+`From coroutine:
`+this._stack.split(`
`).slice(1,-7).join(`
`)));return}}N=N._target();var T=N._bitField;if((T&50397184)===0)this._yieldedPromise=N,N._proxy(this,null);else if((T&33554432)!==0)$._async.invoke(this._promiseFulfilled,this,N._value());else if((T&16777216)!==0)$._async.invoke(this._promiseRejected,this,N._reason());else this._promiseCancelled()}},$.coroutine=function(X,D){if(typeof X!=="function")throw new K(`generatorFunction must be a function
See http://goo.gl/MqrFmX
`);var O=Object(D).yieldHandler,N=V,T=Error().stack;return function(){var P=X.apply(this,arguments),g=new N(void 0,void 0,O,T),B=g.promise();return g._generator=P,g._promiseFulfilled(void 0),B}},$.coroutine.addYieldHandler=function(X){if(typeof X!=="function")throw new K("expecting a function but got "+z.classString(X));H.push(X)},$.spawn=function(X){if(J.deprecated("Promise.spawn()","Promise.coroutine()"),typeof X!=="function")return I(`generatorFunction must be a function
See http://goo.gl/MqrFmX
`);var D=new V(X,this),O=D.promise();return D._run($.spawn),O}}});var zz0=L((DR1,Kz0)=>{Kz0.exports=function($){var I=n1(),q=$._async,U=I.tryCatch,Y=I.errorObj;function J(z,w){var G=this;if(!I.isArray(z))return Q.call(G,z,w);var H=U(w).apply(G._boundValue(),[null].concat(z));if(H===Y)q.throwLater(H.e)}function Q(z,w){var G=this,H=G._boundValue(),W=z===void 0?U(w).call(H,null):U(w).call(H,null,z);if(W===Y)q.throwLater(W.e)}function K(z,w){var G=this;if(!z){var H=Error(z+"");H.cause=z,z=H}var W=U(w).call(G._boundValue(),z);if(W===Y)q.throwLater(W.e)}$.prototype.asCallback=$.prototype.nodeify=function(z,w){if(typeof z=="function"){var G=Q;if(w!==void 0&&Object(w).spread)G=J;this._then(G,K,void 0,this,z)}return this}}});var Gz0=L((OR1,wz0)=>{wz0.exports=function($,I){var q={},U=n1(),Y=OS(),J=U.withAppended,Q=U.maybeWrapAsError,K=U.canEvaluate,z=_5().TypeError,w="Async",G={__isPromisified__:!0},H=["arity","length","name","arguments","caller","callee","prototype","__isPromisified__"],W=new RegExp("^(?:"+H.join("|")+")$"),V=function(f){return U.isIdentifier(f)&&f.charAt(0)!=="_"&&f!=="constructor"};function X(f){return!W.test(f)}function D(f){try{return f.__isPromisified__===!0}catch(b){return!1}}function O(f,b,J0){var j=U.getDataPropertyOrDefault(f,b+J0,G);return j?D(j):!1}function N(f,b,J0){for(var j=0;j<f.length;j+=2){var u=f[j];if(J0.test(u)){var d=u.replace(J0,"");for(var a=0;a<f.length;a+=2)if(f[a]===d)throw new z(`Cannot promisify an API that has normal methods with '%s'-suffix
See http://goo.gl/MqrFmX
`.replace("%s",b))}}}function T(f,b,J0,j){var u=U.inheritedDataKeys(f),d=[];for(var a=0;a<u.length;++a){var K0=u[a],G0=f[K0],M0=j===V?!0:V(K0,G0,f);if(typeof G0==="function"&&!D(G0)&&!O(f,K0,b)&&j(K0,G0,f,M0))d.push(K0,G0)}return N(d,b,J0),d}var P=function(f){return f.replace(/([$])/,"\\$")},g,B=function(f){var b=[f],J0=Math.max(0,f-1-3);for(var j=f-1;j>=J0;--j)b.push(j);for(var j=f+1;j<=3;++j)b.push(j);return b},k=function(f){return U.filledRange(f,"_arg","")},h=function(f){return U.filledRange(Math.max(f,3),"_arg","")},n=function(f){if(typeof f.length==="number")return Math.max(Math.min(f.length,1024),0);return 0};g=function(f,b,J0,j,u,d){var a=Math.max(0,n(j)-1),K0=B(a),G0=typeof f==="string"||b===q;function M0(N1){var F1=k(N1).join(", "),Q1=N1>0?", ":"",C1;if(G0)C1=`ret = callback.call(this, {{args}}, nodeback); break;
`;else C1=b===void 0?`ret = callback({{args}}, nodeback); break;
`:`ret = callback.call(receiver, {{args}}, nodeback); break;
`;return C1.replace("{{args}}",F1).replace(", ",Q1)}function v0(){var N1="";for(var F1=0;F1<K0.length;++F1)N1+="case "+K0[F1]+":"+M0(K0[F1]);return N1+=`
default:
var args = new Array(len + 1);
var i = 0;
for (var i = 0; i < len; ++i) {
args[i] = arguments[i];
}
args[i] = nodeback;
[CodeForCall]
break;
`.replace("[CodeForCall]",G0?`ret = callback.apply(this, args);
`:`ret = callback.apply(receiver, args);
`),N1}var v1=typeof f==="string"?"this != null ? this['"+f+"'] : fn":"fn",m0=`'use strict';
var ret = function (Parameters) {
'use strict';
var len = arguments.length;
var promise = new Promise(INTERNAL);
promise._captureStackTrace();
var nodeback = nodebackForPromise(promise, `+d+`);
var ret;
var callback = tryCatch([GetFunctionCode]);
switch(len) {
[CodeForSwitchCase]
}
if (ret === errorObj) {
promise._rejectCallback(maybeWrapAsError(ret.e), true, true);
}
if (!promise._isFateSealed()) promise._setAsyncGuaranteed();
return promise;
};
notEnumerableProp(ret, '__isPromisified__', true);
return ret;
`.replace("[CodeForSwitchCase]",v0()).replace("[GetFunctionCode]",v1);return m0=m0.replace("Parameters",h(a)),Function("Promise","fn","receiver","withAppended","maybeWrapAsError","nodebackForPromise","tryCatch","errorObj","notEnumerableProp","INTERNAL",m0)($,j,b,J,Q,Y,U.tryCatch,U.errorObj,U.notEnumerableProp,I)};function S(f,b,J0,j,u,d){var a=function(){return this}(),K0=f;if(typeof K0==="string")f=j;function G0(){var M0=b;if(b===q)M0=this;var v0=new $(I);v0._captureStackTrace();var v1=typeof K0==="string"&&this!==a?this[K0]:f,m0=Y(v0,d);try{v1.apply(M0,J(arguments,m0))}catch(N1){v0._rejectCallback(Q(N1),!0,!0)}if(!v0._isFateSealed())v0._setAsyncGuaranteed();return v0}return U.notEnumerableProp(G0,"__isPromisified__",!0),G0}var t=K?g:S;function p(f,b,J0,j,u){var d=new RegExp(P(b)+"$"),a=T(f,b,d,J0);for(var K0=0,G0=a.length;K0<G0;K0+=2){var M0=a[K0],v0=a[K0+1],v1=M0+b;if(j===t)f[v1]=t(M0,q,M0,v0,b,u);else{var m0=j(v0,function(){return t(M0,q,M0,v0,b,u)});U.notEnumerableProp(m0,"__isPromisified__",!0),f[v1]=m0}}return U.toFastProperties(f),f}function C(f,b,J0){return t(f,b,void 0,f,null,J0)}$.promisify=function(f,b){if(typeof f!=="function")throw new z("expecting a function but got "+U.classString(f));if(D(f))return f;b=Object(b);var J0=b.context===void 0?q:b.context,j=!!b.multiArgs,u=C(f,J0,j);return U.copyDescriptors(f,u,X),u},$.promisifyAll=function(f,b){if(typeof f!=="function"&&typeof f!=="object")throw new z(`the target of promisifyAll must be an object or a function
See http://goo.gl/MqrFmX
`);b=Object(b);var J0=!!b.multiArgs,j=b.suffix;if(typeof j!=="string")j=w;var u=b.filter;if(typeof u!=="function")u=V;var d=b.promisifier;if(typeof d!=="function")d=t;if(!U.isIdentifier(j))throw RangeError(`suffix must be a valid identifier
See http://goo.gl/MqrFmX
`);var a=U.inheritedDataKeys(f);for(var K0=0;K0<a.length;++K0){var G0=f[a[K0]];if(a[K0]!=="constructor"&&U.isClass(G0))p(G0.prototype,j,u,d,J0),p(G0,j,u,d,J0)}return p(f,j,u,d,J0)}}});var Vz0=L((LR1,Hz0)=>{Hz0.exports=function($,I,q,U){var Y=n1(),J=Y.isObject,Q=f3(),K;if(typeof Map==="function")K=Map;var z=function(){var W=0,V=0;function X(D,O){this[W]=D,this[W+V]=O,W++}return function(O){V=O.size,W=0;var N=Array(O.size*2);return O.forEach(X,N),N}}(),w=function(W){var V=new K,X=W.length/2|0;for(var D=0;D<X;++D){var O=W[X+D],N=W[D];V.set(O,N)}return V};function G(W){var V=!1,X;if(K!==void 0&&W instanceof K)X=z(W),V=!0;else{var D=Q.keys(W),O=D.length;X=Array(O*2);for(var N=0;N<O;++N){var T=D[N];X[N]=W[T],X[N+O]=T}}this.constructor$(X),this._isMap=V,this._init$(void 0,-3)}Y.inherits(G,I),G.prototype._init=function(){},G.prototype._promiseFulfilled=function(W,V){this._values[V]=W;var X=++this._totalResolved;if(X>=this._length){var D;if(this._isMap)D=w(this._values);else{D={};var O=this.length();for(var N=0,T=this.length();N<T;++N)D[this._values[N+O]]=this._values[N]}return this._resolve(D),!0}return!1},G.prototype.shouldCopyValues=function(){return!1},G.prototype.getActualLength=function(W){return W>>1};function H(W){var V,X=q(W);if(!J(X))return U(`cannot await properties of a non-object
See http://goo.gl/MqrFmX
`);else if(X instanceof $)V=X._then($.props,void 0,void 0,void 0,void 0);else V=new G(X).promise();if(X instanceof $)V._propagateFrom(X,2);return V}$.prototype.props=function(){return H(this)},$.props=function(W){return H(W)}}});var Zz0=L((NR1,Wz0)=>{Wz0.exports=function($,I,q,U){var Y=n1(),J=function(K){return K.then(function(z){return Q(z,K)})};function Q(K,z){var w=q(K);if(w instanceof $)return J(w);else if(K=Y.asArray(K),K===null)return U("expecting an array or an iterable object but got "+Y.classString(K));var G=new $(I);if(z!==void 0)G._propagateFrom(z,3);var{_fulfill:H,_reject:W}=G;for(var V=0,X=K.length;V<X;++V){var D=K[V];if(D===void 0&&!(V in K))continue;$.cast(D)._then(H,W,void 0,G,null)}return G}$.race=function(K){return Q(K,void 0)},$.prototype.race=function(){return Q(this,void 0)}}});var Dz0=L((FR1,Xz0)=>{Xz0.exports=function($,I,q,U,Y,J){var Q=$._getDomain,K=n1(),z=K.tryCatch;function w(X,D,O,N){this.constructor$(X);var T=Q();if(this._fn=T===null?D:K.domainBind(T,D),O!==void 0)O=$.resolve(O),O._attachCancellationCallback(this);if(this._initialValue=O,this._currentCancellable=null,N===Y)this._eachValues=Array(this._length);else if(N===0)this._eachValues=null;else this._eachValues=void 0;this._promise._captureStackTrace(),this._init$(void 0,-5)}K.inherits(w,I),w.prototype._gotAccum=function(X){if(this._eachValues!==void 0&&this._eachValues!==null&&X!==Y)this._eachValues.push(X)},w.prototype._eachComplete=function(X){if(this._eachValues!==null)this._eachValues.push(X);return this._eachValues},w.prototype._init=function(){},w.prototype._resolveEmptyArray=function(){this._resolve(this._eachValues!==void 0?this._eachValues:this._initialValue)},w.prototype.shouldCopyValues=function(){return!1},w.prototype._resolve=function(X){this._promise._resolveCallback(X),this._values=null},w.prototype._resultCancelled=function(X){if(X===this._initialValue)return this._cancel();if(this._isResolved())return;if(this._resultCancelled$(),this._currentCancellable instanceof $)this._currentCancellable.cancel();if(this._initialValue instanceof $)this._initialValue.cancel()},w.prototype._iterate=function(X){this._values=X;var D,O,N=X.length;if(this._initialValue!==void 0)D=this._initialValue,O=0;else D=$.resolve(X[0]),O=1;if(this._currentCancellable=D,!D.isRejected())for(;O<N;++O){var T={accum:null,value:X[O],index:O,length:N,array:this};D=D._then(W,void 0,void 0,T,void 0)}if(this._eachValues!==void 0)D=D._then(this._eachComplete,void 0,void 0,this,void 0);D._then(G,G,void 0,D,this)},$.prototype.reduce=function(X,D){return H(this,X,D,null)},$.reduce=function(X,D,O,N){return H(X,D,O,N)};function G(X,D){if(this.isFulfilled())D._resolve(X);else D._reject(X)}function H(X,D,O,N){if(typeof D!=="function")return q("expecting a function but got "+K.classString(D));var T=new w(X,D,O,N);return T.promise()}function W(X){this.accum=X,this.array._gotAccum(X);var D=U(this.value,this.array._promise);if(D instanceof $)return this.array._currentCancellable=D,D._then(V,void 0,void 0,this,void 0);else return V.call(this,D)}function V(X){var D=this.array,O=D._promise,N=z(D._fn);O._pushContext();var T;if(D._eachValues!==void 0)T=N.call(O._boundValue(),X,this.index,this.length);else T=N.call(O._boundValue(),this.accum,X,this.index,this.length);if(T instanceof $)D._currentCancellable=T;var P=O._popContext();return J.checkForgottenReturns(T,P,D._eachValues!==void 0?"Promise.each":"Promise.reduce",O),T}}});var Lz0=L((MR1,Oz0)=>{Oz0.exports=function($,I,q){var U=$.PromiseInspection,Y=n1();function J(Q){this.constructor$(Q)}Y.inherits(J,I),J.prototype._promiseResolved=function(Q,K){this._values[Q]=K;var z=++this._totalResolved;if(z>=this._length)return this._resolve(this._values),!0;return!1},J.prototype._promiseFulfilled=function(Q,K){var z=new U;return z._bitField=33554432,z._settledValueField=Q,this._promiseResolved(K,z)},J.prototype._promiseRejected=function(Q,K){var z=new U;return z._bitField=16777216,z._settledValueField=Q,this._promiseResolved(K,z)},$.settle=function(Q){return q.deprecated(".settle()",".reflect()"),new J(Q).promise()},$.prototype.settle=function(){return $.settle(this)}}});var Fz0=L((AR1,Nz0)=>{Nz0.exports=function($,I,q){var U=n1(),Y=_5().RangeError,J=_5().AggregateError,Q=U.isArray,K={};function z(G){this.constructor$(G),this._howMany=0,this._unwrap=!1,this._initialized=!1}U.inherits(z,I),z.prototype._init=function(){if(!this._initialized)return;if(this._howMany===0){this._resolve([]);return}this._init$(void 0,-5);var G=Q(this._values);if(!this._isResolved()&&G&&this._howMany>this._canPossiblyFulfill())this._reject(this._getRangeError(this.length()))},z.prototype.init=function(){this._initialized=!0,this._init()},z.prototype.setUnwrap=function(){this._unwrap=!0},z.prototype.howMany=function(){return this._howMany},z.prototype.setHowMany=function(G){this._howMany=G},z.prototype._promiseFulfilled=function(G){if(this._addFulfilled(G),this._fulfilled()===this.howMany()){if(this._values.length=this.howMany(),this.howMany()= Line truncated
See http://goo.gl/MqrFmX
`);var W=new z(G),V=W.promise();return W.setHowMany(H),W.init(),V}$.some=function(G,H){return w(G,H)},$.prototype.some=function(G){return w(this,G)},$._SomePromiseArray=z}});var Az0=L((gR1,Mz0)=>{Mz0.exports=function($,I){var q=$.map;$.prototype.filter=function(U,Y){return q(this,U,Y,I)},$.filter=function(U,Y,J){return q(U,Y,J,I)}}});var Pz0=L((PR1,gz0)=>{gz0.exports=function($,I){var{reduce:q,all:U}=$;function Y(){return U(this)}function J(Q,K){return q(Q,K,I,I)}$.prototype.each=function(Q){return q(this,Q,I,0)._then(Y,void 0,void 0,this,void 0)},$.prototype.mapSeries=function(Q){return q(this,Q,I,I)},$.each=function(Q,K){return q(Q,K,I,0)._then(Y,void 0,void 0,Q,void 0)},$.mapSeries=J}});var jz0=L((TR1,Tz0)=>{Tz0.exports=function($){var I=$._SomePromiseArray;function q(U){var Y=new I(U),J=Y.promise();return Y.setHowMany(1),Y.setUnwrap(),Y.init(),J}$.any=function(U){return q(U)},$.prototype.any=function(){return q(this)}}});var Ez0=L((jR1,NS)=>{NS.exports=function(){var $=function(){return new H(`circular promise resolution chain
See http://goo.gl/MqrFmX
`)},I=function(){return new C.PromiseInspection(this._target())},q=function(j){return C.reject(new H(j))};function U(){}var Y={},J=n1(),Q;if(J.isNode)Q=function(){var j=process.domain;if(j===void 0)j=null;return j};else Q=function(){return null};J.notEnumerableProp(C,"_getDomain",Q);var K=f3(),z=FK0(),w=new z;K.defineProperty(C,"_async",{value:w});var G=_5(),H=C.TypeError=G.TypeError;C.RangeError=G.RangeError;var W=C.CancellationError=G.CancellationError;C.TimeoutError=G.TimeoutError,C.OperationalError=G.OperationalError,C.RejectionError=G.OperationalError,C.AggregateError=G.AggregateError;var V=function(){},X={},D={},O=TK0()(C,V),N=EK0()(C,V,O,q,U),T=vK0()(C),P=T.create,g=CK0()(C,T),B=g.CapturedTrace,k=hK0()(C,O),h=yK0()(D),n=OS(),S=J.errorObj,t=J.tryCatch;function p(j,u){if(typeof u!=="function")throw new H("expecting a function but got "+J.classString(u));if(j.constructor!==C)throw new H(`the promise constructor cannot be invoked directly
See http://goo.gl/MqrFmX
`)}function C(j){if(this._bitField=0,this._fulfillmentHandler0=void 0,this._rejectionHandler0=void 0,this._promise0=void 0,this._receiver0=void 0,j!==V)p(this,j),this._resolveFromExecutor(j);this._promiseCreated(),this._fireEvent("promiseCreated",this)}C.prototype.toString=function(){return"[object Promise]"},C.prototype.caught=C.prototype.catch=function(j){var u=arguments.length;if(u>1){var d=Array(u-1),a=0,K0;for(K0=0;K0<u-1;++K0){var G0=arguments[K0];if(J.isObject(G0))d[a++]=G0;else return q("expecting an object but got A catch statement predicate "+J.classString(G0))}return d.length=a,j=arguments[K0],this.then(void 0,h(d,j,this))}return this.then(void 0,j)},C.prototype.reflect=function(){return this._then(I,I,void 0,this,void 0)},C.prototype.then=function(j,u){if(g.warnings()&&arguments.length>0&&typeof j!=="function"&&typeof u!=="function"){var d=".then() only accepts functions but was passed: "+J.classString(j);if(arguments.length>1)d+=", "+J.classString(u);this._warn(d)}return this._then(j,u,void 0,void 0,void 0)},C.prototype.done=function(j,u){var d=this._then(j,u,void 0,void 0,void 0);d._setIsFinal()},C.prototype.spread=function(j){if(typeof j!=="function")return q("expecting a function but got "+J.classString(j));return this.all()._then(j,void 0,void 0,X,void 0)},C.prototype.toJSON=function(){var j={isFulfilled:!1,isRejected:!1,fulfillmentValue:void 0,rejectionReason:void 0};if(this.isFulfilled())j.fulfillmentValue=this.value(),j.isFulfilled=!0;else if(this.isRejected())j.rejectionReason=this.reason(),j.isRejected=!0;return j},C.prototype.all=function(){if(arguments.length>0)this._warn(".all() was passed arguments but it does not take any");return new N(this).promise()},C.prototype.error=function(j){return this.caught(J.originatesFromRejection,j)},C.getNewLibraryCopy=NS.exports,C.is=function(j){return j instanceof C},C.fromNode=C.fromCallback=function(j){var u=new C(V);u._captureStackTrace();var d=arguments.length>1?!!Object(arguments[1]).multiArgs:!1,a=t(j)(n(u,d));if(a===S)u._rejectCallback(a.e,!0);if(!u._isFateSealed())u._setAsyncGuaranteed();return u},C.all=function(j){return new N(j).promise()},C.cast=function(j){var u=O(j);if(!(u instanceof C))u=new C(V),u._captureStackTrace(),u._setFulfilled(),u._rejectionHandler0=j;return u},C.resolve=C.fulfilled=C.cast,C.reject=C.rejected=function(j){var u=new C(V);return u._captureStackTrace(),u._rejectCallback(j,!0),u},C.setScheduler=function(j){if(typeof j!=="function")throw new H("expecting a function but got "+J.classString(j));return w.setScheduler(j)},C.prototype._then=function(j,u,d,a,K0){var G0=K0!==void 0,M0=G0?K0:new C(V),v0=this._target(),v1=v0._bitField;if(!G0){if(M0._propagateFrom(this,3),M0._captureStackTrace(),a===void 0&&(this._bitField&2097152)!==0)if((v1&50397184)!==0)a=this._boundValue();else a=v0===this?void 0:this._boundTo;this._fireEvent("promiseChained",this,M0)}var m0=Q();if((v1&50397184)!==0){var N1,F1,Q1=v0._settlePromiseCtx;if((v1&33554432)!==0)F1=v0._rejectionHandler0,N1=j;else if((v1&16777216)!==0)F1=v0._fulfillmentHandler0,N1=u,v0._unsetRejectionIsUnhandled();else Q1=v0._settlePromiseLateCancellationObserver,F1=new W("late cancellation observer"),v0._attachExtraTrace(F1),N1=u;w.invoke(Q1,v0,{handler:m0===null?N1:typeof N1==="function"&&J.domainBind(m0,N1),promise:M0,receiver:a,value:F1})}else v0._addCallbacks(j,u,M0,a,m0);return M0},C.prototype._length=function(){return this._bitField&65535},C.prototype._isFateSealed=function(){return(this._bitField&117506048)!==0},C.prototype._isFollowing=function(){return(this._bitField&67108864)===67108864},C.prototype._setLength=function(j){this._bitField=this._bitField&-65536|j&65535},C.prototype._setFulfilled=function(){this._bitField=this._bitField|33554432,this._fireEvent("promiseFulfilled",this)},C.prototype._setRejected=function(){this._bitField=this._bitField|16777216,this._fireEvent("promiseRejected",this)},C.prototype._setFollowing=function(){this._bitField=this._bitField|67108864,this._fireEvent("promiseResolved",this)},C.prototype._setIsFinal=function(){this._bitField=this._bitField|4194304},C.prototype._isFinal=function(){return(this._bitField&4194304)>0},C.prototype._unsetCancelled=function(){this._bitField=this._bitField&-65537},C.prototype._setCancelled=function(){this._bitField=this._bitField|65536,this._fireEvent("promiseCancelled",this)},C.prototype._setWillBeCancelled=function(){this._bitField=this._bitField|8388608},C.prototype._setAsyncGuaranteed=function(){if(w.hasCustomScheduler())return;this._bitField=this._bitField|134217728},C.prototype._receiverAt=function(j){var u=j===0?this._receiver0:this[j*4-4+3];if(u===Y)return;else if(u===void 0&&this._isBound())return this._boundValue();return u},C.prototype._promiseAt=function(j){return this[j*4-4+2]},C.prototype._fulfillmentHandlerAt=function(j){return this[j*4-4+0]},C.prototype._rejectionHandlerAt=function(j){return this[j*4-4+1]},C.prototype._boundValue=function(){},C.prototype._migrateCallback0=function(j){var{_bit Line truncated
path = %s
syscall = %s
fstream_type = %s
fstream_path = %s
fstream_unc_path = %s
fstream_class = %s
fstream_stack =
%s
`,I||"UNKNOWN",U.stack,U.path,U.syscall,U.fstream_type,U.fstream_path,U.fstream_unc_path,U.fstream_class,U.fstream_stack.join(`
`));else q.emit("warn",U)};J7.prototype.info=function($,I){this.emit("info",$,I)};J7.prototype.error=function($,I,q){var U=QG0($,I,this);if(q)throw U;else this.emit("error",U)};function QG0($,I,q){if(!($ instanceof Error))$=Error($);if($.code=$.code||I,$.path=$.path||q.path,$.fstream_type=$.fstream_type||q.type,$.fstream_path=$.fstream_path||q.path,q._path!==q.path)$.fstream_unc_path=$.fstream_unc_path||q._path;if(q.linkpath)$.fstream_linkpath=$.fstream_linkpath||q.linkpath;return $.fstream_class=$.fstream_class||q.constructor.name,$.fstream_stack=$.fstream_stack||Error().stack.split(/\n/).slice(3).map(function(U){return U.replace(/^ {4}at /,"")}),$}});var iK=L((qC1,zG0)=>{zG0.exports=WQ1;function WQ1($){var I=["Directory","File","SymbolicLink","Link","BlockDevice","CharacterDevice","FIFO","Socket"],q;if($.type&&I.indexOf($.type)!==-1)return $[$.type]=!0,$.type;for(var U=0,Y=I.length;U<Y;U++){q=I[U];var J=$[q]||$["is"+q];if(typeof J==="function")J=J.call($);if(J)return $[q]=!0,$.type=q,q}return null}});var Jy=L((UC1,wG0)=>{wG0.exports=pK;var ZQ1=l6(),XQ1=n0(),Yy=o3();XQ1(pK,Yy);function pK($){var I=this;if(!(I instanceof pK))throw Error("LinkReader must be called as constructor.");if(!($.type==="Link"&&$.Link||$.type==="SymbolicLink"&&$.SymbolicLink))throw Error("Non-link type "+$.type);Yy.call(I,$)}pK.prototype._stat=function($){var I=this;ZQ1.readlink(I._path,function(q,U){if(q)return I.error(q);I.linkpath=I.props.linkpath=U,I.emit("linkpath",U),Yy.prototype._stat.call(I,$)})};pK.prototype._read=function(){var $=this;if($._paused)return;if(!$._ended)$.emit("end"),$.emit("close"),$._ended=!0}});var Ky=L((YC1,VG0)=>{VG0.exports=n8;var HG0=l6(),DQ1=n0(),cK=o("path"),Qy=o3(),GG0=o("assert").ok;DQ1(n8,Qy);function n8($){var I=this;if(!(I instanceof n8))throw Error("DirReader must be called as constructor.");if($.type!=="Directory"||!$.Directory)throw Error("Non-directory type "+$.type);if(I.entries=null,I._index=-1,I._paused=!1,I._length=-1,$.sort)this.sort=$.sort;Qy.call(this,$)}n8.prototype._getEntries=function(){var $=this;if($._gotEntries)return;$._gotEntries=!0,HG0.readdir($._path,function(I,q){if(I)return $.error(I);if($.entries=q,$.emit("entries",q),$._paused)$.once("resume",U);else U();function U(){if($._length=$.entries.length,typeof $.sort==="function")$.entries=$.entries.sort($.sort.bind($));$._read()}})};n8.prototype._read=function(){var $=this;if(!$.entries)return $._getEntries();if($._paused||$._currentEntry||$._aborted)return;if($._index++,$._index>=$.entries.length){if(!$._ended)$._ended=!0,$.emit("end"),$.emit("close");return}var I=cK.resolve($._path,$.entries[$._index]);GG0(I!==$._path),GG0($.entries[$._index]),$._currentEntry=I,HG0[$.props.follow?"stat":"lstat"](I,function(q,U){if(q)return $.error(q);var Y=$._proxy||$;U.path=I,U.basename=cK.basename(I),U.dirname=cK.dirname(I);var J=$.getChildProps.call(Y,U);J.path=I,J.basename=cK.basename(I),J.dirname=cK.dirname(I);var Q=Qy(J,U);$._currentEntry=Q,Q.on("pause",function(w){if(!$._paused&&!Q._disowned)$.pause(w)}),Q.on("resume",function(w){if($._paused&&!Q._disowned)$.resume(w)}),Q.on("stat",function(w){if($.emit("_entryStat",Q,w),Q._aborted)return;if(Q._paused)Q.once("resume",function(){$.emit("entryStat",Q,w)});else $.emit("entryStat",Q,w)}),Q.on("ready",function w(){if($._paused)return Q.pause($),$.once("resume",w);if(Q.type==="Socket")$.emit("socket",Q);else $.emitEntry(Q)});var K=!1;Q.on("close",z),Q.on("disown",z);function z(){if(K)return;if(K=!0,$.emit("childEnd",Q),$.emit("entryEnd",Q),$._currentEntry=null,!$._paused)$._read()}Q.on("error",function(w){if(Q._swallowErrors)$.warn(w),Q.emit("end"),Q.emit("close");else $.emit("error",w)}),["child","childEnd","warn"].forEach(function(w){Q.on(w,$.emit.bind($,w))})})};n8.prototype.disown=function($){if($.emit("beforeDisown"),$._disowned=!0,$.parent=$.root=null,$===this._currentEntry)this._currentEntry=null;$.emit("disown")};n8.prototype.getChildProps=function(){return{depth:this.depth+1,root:this.root||this,parent:this,follow:this.follow,filter:this.filter,sort:this.props.sort,hardlinks:this.props.hardlinks}};n8.prototype.pause=function($){var I=this;if(I._paused)return;if($=$||I,I._paused=!0,I._currentEntry&&I._currentEntry.pause)I._currentEntry.pause($);I.emit("pause",$)};n8.prototype.resume=function($){var I=this;if(!I._paused)return;if($=$||I,I._paused=!1,I.emit("resume",$),I._paused)return;if(I._currentEntry){if(I._currentEntry.resume)I._currentEntry.resume($)}else I._read()};n8.prototype.emitEntry=function($){this.emit("entry",$),this.emit("child",$)}});var zy=L((JC1,DG0)=>{DG0.exports=r3;var OQ1=l6(),LQ1=n0(),WG0=o3(),ZG0={EOF:!0},XG0={CLOSE:!0};LQ1(r3,WG0);function r3($){var I=this;if(!(I instanceof r3))throw Error("FileReader must be called as constructor.");if(!($.type==="Link"&&$.Link||$.type==="File"&&$.File))throw Error("Non-file type "+$.type);I._buffer=[],I._bytesEmitted=0,WG0.call(I,$)}r3.prototype._getStream=function(){var $=this,I=$._stream=OQ1.createReadStream($._path,$.pro Line truncated
expect: `+$.props.size+`
actual: `+$._bytesEmitted)}),I.on("close",function(){if($._paused||$._buffer.length)$._buffer.push(XG0),$._read();else $.emit("close")}),I.on("error",function(q){$.emit("error",q)}),$._read()};r3.prototype._read=function(){var $=this;if($._paused)return;if(!$._stream)return $._getStream();if($._buffer.length){var I=$._buffer;for(var q=0,U=I.length;q<U;q++){var Y=I[q];if(Y===ZG0)$.emit("end");else if(Y===XG0)$.emit("close");else $.emit("data",Y);if($._paused){$._buffer=I.slice(q);return}}$._buffer.length=0}};r3.prototype.pause=function($){var I=this;if(I._paused)return;if($=$||I,I._paused=!0,I._stream)I._stream.pause();I.emit("pause",$)};r3.prototype.resume=function($){var I=this;if(!I._paused)return;if($=$||I,I.emit("resume",$),I._paused=!1,I._stream)I._stream.resume();I._read()}});var NG0=L((QC1,LG0)=>{LG0.exports=RD;var NQ1=n0(),OG0=o3();NQ1(RD,OG0);function RD($){var I=this;if(!(I instanceof RD))throw Error("SocketReader must be called as constructor.");if(!($.type==="Socket"&&$.Socket))throw Error("Non-socket type "+$.type);OG0.call(I,$)}RD.prototype._read=function(){var $=this;if($._paused)return;if(!$._ended)$.emit("end"),$.emit("close"),$._ended=!0}});var Gy=L((KC1,FG0)=>{FG0.exports=t3;var wy=o3(),FQ1=iK(),MQ1=n0(),AQ1=l6();MQ1(t3,wy);function t3($){var I=this;if(!(I instanceof t3))throw Error("ProxyReader must be called as constructor.");I.props=$,I._buffer=[],I.ready=!1,wy.call(I,$)}t3.prototype._stat=function(){var $=this,I=$.props,q=I.follow?"stat":"lstat";AQ1[q](I.path,function(U,Y){var J;if(U||!Y)J="File";else J=FQ1(Y);I[J]=!0,I.type=$.type=J,$._old=Y,$._addProxy(wy(I,Y))})};t3.prototype._addProxy=function($){var I=this;if(I._proxyTarget)return I.error("proxy already set");I._proxyTarget=$,$._proxy=I,["error","data","end","close","linkpath","entry","entryEnd","child","childEnd","warn","stat"].forEach(function(U){$.on(U,I.emit.bind(I,U))}),I.emit("proxy",$),$.on("ready",function(){I.ready=!0,I.emit("ready")});var q=I._buffer;I._buffer.length=0,q.forEach(function(U){$[U[0]].apply($,U[1])})};t3.prototype.pause=function(){return this._proxyTarget?this._proxyTarget.pause():!1};t3.prototype.resume=function(){return this._proxyTarget?this._proxyTarget.resume():!1}});var o3=L((zC1,gG0)=>{gG0.exports=I8;var gQ1=l6(),PQ1=o("stream").Stream,TQ1=n0(),Hy=o("path"),Vy=iK(),CD=I8.hardLinks={},MG0=vD();TQ1(I8,MG0);var AG0=Jy();function I8($,I){var q=this;if(!(q instanceof I8))return new I8($,I);if(typeof $==="string")$={path:$};var U,Y;if($.type&&typeof $.type==="function")U=$.type,Y=U;else U=Vy($),Y=I8;if(I&&!U)U=Vy(I),$[U]=!0,$.type=U;switch(U){case"Directory":Y=Ky();break;case"Link":case"File":Y=zy();break;case"SymbolicLink":Y=AG0;break;case"Socket":Y=NG0();break;case null:Y=Gy();break}if(!(q instanceof Y))return new Y($);if(MG0.call(q),!$.path)q.error("Must provide a path",null,!0);if(q.readable=!0,q.writable=!1,q.type=U,q.props=$,q.depth=$.depth=$.depth||0,q.parent=$.parent||null,q.root=$.root||$.parent&&$.parent.root||q,q._path=q.path=Hy.resolve($.path),process.platform==="win32"){if(q.path=q._path=q.path.replace(/\?/g,"_"),q._path.length>=260)q._swallowErrors=!0,q._path="\\\\?\\"+q.path.replace(/\//g,"\\")}if(q.basename=$.basename=Hy.basename(q.path),q.dirname=$.dirname=Hy.dirname(q.path),$.parent=$.root=null,q.size=$.size,q.filter=typeof $.filter==="function"?$.filter:null,$.sort==="alpha")$.sort=jQ1;q._stat(I)}function jQ1($,I){return $===I?0:$.toLowerCase()>I.toLowerCase()?1:$.toLowerCase()<I.toLowerCase()?-1:$>I?1:-1}I8.prototype._stat=function($){var I=this,q=I.props,U=q.follow?"stat":"lstat";if($)process.nextTick(Y.bind(null,null,$));else gQ1[U](I._path,Y);function Y(J,Q){if(J)return I.error(J);if(Object.keys(Q).forEach(function(V){q[V]=Q[V]}),I.size!==void 0&&q.size!==I.size)return I.error("incorrect size");I.size=q.size;var K=Vy(q),z=q.hardlinks!==!1;if(z&&K!=="Directory"&&q.nlink&&q.nlink>1){var w=q.dev+":"+q.ino;if(CD[w]===I._path||!CD[w])CD[w]=I._path;else K=I.type=I.props.type="Link",I.Link=I.props.Link=!0,I.linkpath=I.props.linkpath=CD[w],I._stat=I._read=AG0.prototype._read}if(I.type&&I.type!==K)I.error("Unexpected type: "+K);if(I.filter){var G=I._proxy||I;if(!I.filter.call(G,G,q)){if(!I._disowned)I.abort(),I.emit("end"),I.emit("close");return}}var H=["_stat","stat","ready"],W=0;(function V(){if(I._aborted){I.emit("end"),I.emit("close");return}if(I._paused&&I.type!=="Directory"){I.once("resume",V);return}var X=H[W++];if(!X)return I._read();I.emit(X,q),V()})()}};I8.prototype.pipe=function($){var I=this;if(typeof $.add==="function")I.on("entry",function(q){var U=$.add(q);if(U===!1)I.pause()});return PQ1.prototype.pipe.apply(this,arguments)};I8.prototype.pause=function($){if(this._paused=!0,$=$||this,this.emit("pause",$),this._stream)this._stream.pause($)};I8.prototype.resume=function($){if(this._paused=!1,$=$||this,this.emit("resume",$),this._stream)this._stream.resume($);this._read()};I8.prototype._read=function(){this.error("Cannot read unknown type: "+this.type)}});var Dy=L((wC1,CG0)=>{C Line truncated
expect: `+$.size+`
actual: `+$._bytesWritten);iD.prototype._finish.call($)}});var Ey=L((EC1,FH0)=>{FH0.exports=G7;var jy=VY(),eQ1=iK(),$21=n0(),I21=nD(),q21=o("fs");$21(G7,jy);function G7($){var I=this;if(!(I instanceof G7))throw Error("ProxyWriter must be called as constructor.");I.props=$,I._needDrain=!1,jy.call(I,$)}G7.prototype._stat=function(){var $=this,I=$.props,q=I.follow?"stat":"lstat";q21[q](I.path,function(U,Y){var J;if(U||!Y)J="File";else J=eQ1(Y);I[J]=!0,I.type=$.type=J,$._old=Y,$._addProxy(jy(I,Y))})};G7.prototype._addProxy=function($){var I=this;if(I._proxy)return I.error("proxy already set");I._proxy=$,["ready","error","close","pipe","drain","warn"].forEach(function(U){$.on(U,I.emit.bind(I,U))}),I.emit("proxy",$);var q=I._buffer;if(q.forEach(function(U){$[U[0]].apply($,U[1])}),I._buffer.length=0,I._needsDrain)I.emit("drain")};G7.prototype.add=function($){if(I21($),!this._proxy)return this._buffer.push(["add",[$]]),this._needDrain=!0,!1;return this._proxy.add($)};G7.prototype.write=function($){if(!this._proxy)return this._buffer.push(["write",[$]]),this._needDrain=!0,!1;return this._proxy.write($)};G7.prototype.end=function($){if(!this._proxy)return this._buffer.push(["end",[$]]),!1;return this._proxy.end($)}});var VY=L((BC1,vH0)=>{vH0.exports=C$;var R$=l6(),U21=n0(),Y21=Dy(),J21=My(),oK=o("path"),AH0=process.platform==="win32"?0:process.umask(),gH0=iK(),PH0=vD();U21(C$,PH0);C$.dirmode=parseInt("0777",8)&~AH0;C$.filemode=parseInt("0666",8)&~AH0;var Q21=gy(),K21=Py(),z21=Ty(),w21=Ey();function C$($,I){var q=this;if(typeof $==="string")$={path:$};var U=gH0($),Y=C$;switch(U){case"Directory":Y=Q21;break;case"File":Y=z21;break;case"Link":case"SymbolicLink":Y=K21;break;case null:default:Y=w21;break}if(!(q instanceof Y))return new Y($);if(PH0.call(q),!$.path)q.error("Must provide a path",null,!0);if(q.type=$.type,q.props=$,q.depth=$.depth||0,q.clobber=$.clobber===!1?$.clobber:!0,q.parent=$.parent||null,q.root=$.root||$.parent&&$.parent.root||q,q._path=q.path=oK.resolve($.path),process.platform==="win32"){if(q.path=q._path=q.path.replace(/\?/g,"_"),q._path.length>=260)q._swallowErrors=!0,q._path="\\\\?\\"+q.path.replace(/\//g,"\\")}if(q.basename=oK.basename($.path),q.dirname=oK.dirname($.path),q.linkpath=$.linkpath||null,$.parent=$.root=null,q.size=$.size,typeof $.mode==="string")$.mode=parseInt($.mode,8);q.readable=!1,q.writable=!0,q._buffer=[],q.ready=!1,q.filter=typeof $.filter==="function"?$.filter:null,q._stat(I)}C$.prototype._create=function(){var $=this;R$[$.props.follow?"stat":"lstat"]($._path,function(I){if(I)return $.warn("Cannot create "+$._path+`
Unsupported type: `+$.type,"ENOTSUP");$._finish()})};C$.prototype._stat=function($){var I=this,q=I.props,U=q.follow?"stat":"lstat",Y=I._proxy||I;if($)J(null,$);else R$[U](I._path,J);function J(Q,K){if(I.filter&&!I.filter.call(Y,Y,K)){I._aborted=!0,I.emit("end"),I.emit("close");return}if(Q||!K)return By(I);I._old=K;var z=gH0(K);if(z!==I.type||I.type==="File"&&K.nlink>1)return Y21(I._path,function(w){if(w)return I.error(w);I._old=null,By(I)});By(I)}};function By($){J21(oK.dirname($._path),C$.dirmode,function(I,q){if(I)return $.error(I);return $._madeDir=q,$._create()})}function TH0($,I,q,U,Y){var J=I.mode,Q=I.follow||$.type!=="SymbolicLink"?"chmod":"lchmod";if(!R$[Q])return Y();if(typeof J!=="number")return Y();var K=q.mode&parseInt("0777",8);if(J=J&parseInt("0777",8),J===K)return Y();R$[Q](U,J,Y)}function jH0($,I,q,U,Y){if(process.platform==="win32")return Y();if(!process.getuid||process.getuid()!==0)return Y();if(typeof I.uid!=="number"&&typeof I.gid!=="number")return Y();if(q.uid===I.uid&&q.gid===I.gid)return Y();var J=$.props.follow||$.type!=="SymbolicLink"?"chown":"lchown";if(!R$[J])return Y();if(typeof I.uid!=="number")I.uid=q.uid;if(typeof I.gid!=="number")I.gid=q.gid;R$[J](U,I.uid,I.gid,Y)}function EH0($,I,q,U,Y){if(!R$.utimes||process.platform==="win32")return Y();var J=I.follow||$.type!=="SymbolicLink"?"utimes":"lutimes";if(J==="lutimes"&&!R$[J])J="utimes";if(!R$[J])return Y();var{atime:Q,mtime:K}=q,z=I.atime,w=I.mtime;if(z===void 0)z=Q;if(w===void 0)w=K;if(!MH0(z))z=new Date(z);if(!MH0(w))z=new Date(w);if(z.getTime()===Q.getTime()&&w.getTime()===K.getTime())return Y();R$[J](U,z,w,Y)}C$.prototype._finish=function(){var $=this;if($._finishing)return;$._finishing=!0;var I=0,q=null,U=!1;if($._old)$._old.atime=new Date(0),$._old.mtime=new Date(0),J($._old);else{var Y=$.props.follow?"stat":"lstat";R$[Y]($._path,function(K,z){if(K)if(K.code==="ENOENT"&&($.type==="Link"||$.type==="SymbolicLink")&&process.platform==="win32"){$.ready=!0,$.emit("ready"),$.emit("end"),$.emit("close"),$.end=$._finish=function(){};return}else return $.error(K);J($._old=z)})}return;function J(K){I+=3,TH0($,$.props,K,$._path,Q("chmod")),jH0($,$.props,K,$._path,Q("chown")),EH0($,$.props,K,$._path,Q("utimes"))}function Q(K){return function(z){if(q)return;if(z)return z.fstream_finish_call=K,$.error(q=z);if(--I>0)return;if(U)return;if(U=!0,!$._madeDir)return w();else BH0($,$._path,w);function w(G){if(G)return G.fstream_finish_call="setupMadeDir",$.error(G);$.emit("end"),$.emit("close")}}}};function BH0($,I,q){var U=$._madeDir,Y=oK.dirname(I);G21($,Y,function(J){if(J)return q(J);if(Y===U)return q();BH0($,Y,q)})}function G21($,I,q){var U={};Object.keys($.props).forEach(function(K){if(U[K]=$.props[K],K==="mode"&&$.type!=="Directory")U[K]=U[K]|parseInt("0111",8)});var Y=3,J=null;R$.stat(I,function(K,z){if(K)return q(J=K);TH0($,U,z,I,Q),jH0($,U,z,I,Q),EH0($,U,z,I,Q)});function Q(K){if(J)return;if(K)return q(J=K);if(--Y===0)return q()}}C$.prototype.pipe=function(){this.error("Can't pipe from writable stream")};C$.prototype.add=function(){this.error("Can't add to non-Directory type")};C$.prototype.write=function(){return!0};function H21($){return Object.prototype.toString.call($)}function MH0($){return typeof $==="object"&&H21($)==="[object Date]"}});var hy=L((V21)=>{V21.Abstract=vD();V21.Reader=o3();V21.Writer=VY();V21.File={Reader:zy(),Writer:Ty()};V21.Dir={Reader:Ky(),Writer:gy()};V21.Link={Reader:Jy(),Writer:Py()};V21.Proxy={Reader:Gy(),Writer:Ey()};V21.Reader.Dir=V21.DirReader=V21.Dir.Reader;V21.Reader.File=V21.FileReader=V21.File.Reader;V21.Reader.Link=V21.LinkReader=V21.Link.Reader;V21.Reader.Proxy=V21.ProxyReader=V21.Proxy.Reader;V21.Writer.Dir=V21.DirWriter=V21.Dir.Writer;V21.Writer.File=V21.FileWriter=V21.File.Writer;V21.Writer.Link=V21.LinkWriter=V21.Link.Writer;V21.Writer.Proxy=V21.ProxyWriter=V21.Proxy.Writer;V21.collect=nD()});var CH0=L((kC1,RH0)=>{RH0.exports=F21;var X21=FD(),D21=hy().Writer,Sy=o("path"),O21=o("stream"),L21=qy(),N21=U7();function F21($){$.path=Sy.resolve(Sy.normalize($.path));var I=new X21($),q=new O21.Writable({objectMode:!0});q._write=function(Y,J,Q){if(Y.type=="Directory")return Q();var K=Sy.join($.path,Y.path);if(K.indexOf($.path)!=0)return Q();let z=$.getWriter?$.getWriter({path:K}):D21({path:K});Y.pipe(z).on("error",Q).on("close",Q)};var U=L21(I,q);return I.once("crx-header",function(Y){U.crxHeader=Y}),I.pipe(q).on("finish",function(){U.emit("close")}),U.promise=function(){return new N21(function(Y,J){U.on("close",Y),U.on("error",J)})},U}});var _H0=L((fC1,pD)=>{var S4=function($){var I=1e7,q=7,U=9007199254740992,Y=W(U),J="0123456789abcdefghijklmnopqrstuvwxyz",Q=typeof BigInt==="function";function K(F,M,v,y){if(typeof F>"u")return K[0];if(typeof M<"u")return+M===10&&!v?g0(F):h$(F,M,v,y);return g0(F)}function z(F,M){this.value=F,this.sign=M,this.isSmall=!1}z.prototype=Object.create(K.prototype);function w(F){this.value=F,this.sign=F<0,this.isSmall=!0}w.prototype=Object.create(K.prototype);function G(F){th Line truncated
* Tmp
*
* Copyright (c) 2011-2017 KARASZI Istvan <github@spam.raszi.hu>
*
* MIT Licensed
*/var u1=o("fs"),rD=o("os"),y4=o("path"),dH0=o("crypto"),b8={fs:u1.constants,os:rD.constants},rH0=/XXXXXX/,tH0=(b8.O_CREAT||b8.fs.O_CREAT)|(b8.O_EXCL||b8.fs.O_EXCL)|(b8.O_RDWR||b8.fs.O_RDWR),c21=rD.platform()==="win32",d21=b8.EBADF||b8.os.errno.EBADF,l21=b8.ENOENT||b8.os.errno.ENOENT,ZY=[],aH0=u1.rmdirSync.bind(u1),sH0=!1;function m21($,I){return u1.rm($,{recursive:!0},I)}function eH0($){return u1.rmSync($,{recursive:!0})}function fy($,I){let q=XY($,I),U=q[0],Y=q[1];UK1(U,function(J,Q){if(J)return Y(J);let K=Q.tries;(function z(){try{let w=IV0(Q);u1.stat(w,function(G){if(!G){if(K-- >0)return z();return Y(Error("Could not get a unique tmp filename, max tries reached "+w))}Y(null,w)})}catch(w){Y(w)}})()})}function ny($){let I=XY($),q=I[0],U=YK1(q),Y=U.tries;do{let J=IV0(U);try{u1.statSync(J)}catch(Q){return J}}while(Y-- >0);throw Error("Could not get a unique tmp filename, max tries reached")}function o21($,I){let q=XY($,I),U=q[0],Y=q[1];fy(U,function(Q,K){if(Q)return Y(Q);u1.open(K,tH0,U.mode||384,function(w,G){if(w)return Y(w);if(U.discardDescriptor)return u1.close(G,function(W){return Y(W,K,void 0,xy(K,-1,U,!1))});else{let H=U.discardDescriptor||U.detachDescriptor;Y(null,K,G,xy(K,H?-1:G,U,!1))}})})}function r21($){let I=XY($),q=I[0],U=q.discardDescriptor||q.detachDescriptor,Y=ny(q),J=u1.openSync(Y,tH0,q.mode||384);if(q.discardDescriptor)u1.closeSync(J),J=void 0;return{name:Y,fd:J,removeCallback:xy(Y,U?-1:J,q,!0)}}function t21($,I){let q=XY($,I),U=q[0],Y=q[1];fy(U,function(Q,K){if(Q)return Y(Q);u1.mkdir(K,U.mode||448,function(w){if(w)return Y(w);Y(null,K,$V0(K,U,!1))})})}function a21($){let I=XY($),q=I[0],U=ny(q);return u1.mkdirSync(U,q.mode||448),{name:U,removeCallback:$V0(U,q,!0)}}function s21($,I){let q=function(U){if(U&&!ky(U))return I(U);I()};if(0<=$[0])u1.close($[0],function(){u1.unlink($[1],q)});else u1.unlink($[1],q)}function e21($){let I=null;try{if(0<=$[0])u1.closeSync($[0])}catch(q){if(!JK1(q)&&!ky(q))throw q}finally{try{u1.unlinkSync($[1])}catch(q){if(!ky(q))I=q}}if(I!==null)throw I}function xy($,I,q,U){let Y=oD(e21,[I,$],U),J=oD(s21,[I,$],U,Y);if(!q.keep)ZY.unshift(Y);return U?Y:J}function $V0($,I,q){let U=I.unsafeCleanup?m21:u1.rmdir.bind(u1),Y=I.unsafeCleanup?eH0:aH0,J=oD(Y,$,q),Q=oD(U,$,q,J);if(!I.keep)ZY.unshift(J);return q?J:Q}function oD($,I,q,U){let Y=!1;return function J(Q){if(!Y){let K=U||J,z=ZY.indexOf(K);if(z>=0)ZY.splice(z,1);if(Y=!0,q||$===aH0||$===eH0)return $(I);else return $(I,Q||function(){})}}}function $K1(){if(!sH0)return;while(ZY.length)try{ZY[0]()}catch($){}}function lH0($){let I=[],q=null;try{q=dH0.randomBytes($)}catch(U){q=dH0.pseudoRandomBytes($)}for(let U=0;U<$;U++)I.push("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"[q[U]%62]);return I.join("")}function o6($){return typeof $>"u"}function XY($,I){if(typeof $==="function")return[{},$];if(o6($))return[{},I];let q={};for(let U of Object.getOwnPropertyNames($))q[U]=$[U];return[q,I]}function IK1($,I,q){let U=y4.isAbsolute($)?$:y4.join(I,$);u1.stat(U,function(Y){if(Y)u1.realpath(y4.dirname(U),function(J,Q){if(J)return q(J);q(null,y4.join(Q,y4.basename(U)))});else u1.realpath(U,q)})}function qK1($,I){let q=y4.isAbsolute($)?$:y4.join(I,$);try{return u1.statSync(q),u1.realpathSync(q)}catch(U){let Y=u1.realpathSync(y4.dirname(q));return y4.join(Y,y4.basename(q))}}function IV0($){let I=$.tmpdir;if(!o6($.name))return y4.join(I,$.dir,$.name);if(!o6($.template))return y4.join(I,$.dir,$.template).replace(rH0,lH0(6));let q=[$.prefix?$.prefix:"tmp","-",process.pid,"-",lH0(12),$.postfix?"-"+$.postfix:""].join("");return y4.join(I,$.dir,q)}function uy($,I){if(typeof I!=="string")throw Error(`${$} option must be a string, got "${typeof I}".`);if(I.includes(".."))throw Error("Relative value not allowed");return I}function qV0($){if(!o6($.name)){let I=$.name;if(y4.isAbsolute(I))throw Error(`name option must not contain an absolute path, found "${I}".`);let q=y4.basename(I);if(q===".."||q==="."||q!==I)throw Error(`name option must not contain a path, found "${I}".`)}if(!o6($.template)){if(typeof $.template!=="string")throw Error(`template option must be a string, got "${typeof $.template}".`);if(!$.template.match(rH0))throw Error(`Invalid template, found "${$.template}".`)}if(!o6($.tries)&&isNaN($.tries)||$.tries<0)throw Error(`Invalid tries, found "${$.tries}".`);$.tries=o6($.name)?$.tries||3:1,$.keep=!!$.keep,$.detachDescriptor=!!$.detachDescriptor,$.discardDescriptor=!!$.discardDescriptor,$.unsafeCleanup=!!$.unsafeCleanup,$.prefix=o6($.prefix)?"":uy("prefix",$.prefix),$.postfix=o6($.postfix)?"":uy("postfix",$.postfix),$.template=o6($.template)?void 0:uy("template",$.template)}function mH0($,I,q,U){if(o6(I))return U(null);IK1(I,q,function(Y,J){if(Y)return U(Y);let Q=y4.relative(q,J);if(Q.startsWith("..")||y4.isAbsolute(Q))return U(Error(`${$} option must be relative to "${q}", found "${Q}".`));U(null,Q)})}function oH0($,I,q){if(o6(I))return;let U=qK1(I,q),Y=y4.relative(q,U);if(Y.startsWith("..")||y4.isAbsolute(Y))throw ELine truncated
`)}var wI=($)=>(I,q,U,Y)=>{let J=U?{...U,async:!1}:{async:!1},Q=I._zod.run({value:q,issues:[]},J);if(Q instanceof Promise)throw new U8;if(Q.issues.length){let K=new(Y?.Err??$)(Q.issues.map((z)=>M6(z,J,V4())));throw pz(K,Y?.callee),K}return Q.value},nY=wI(S6),GI=($)=>async(I,q,U,Y)=>{let J=U?{...U,async:!0}:{async:!0},Q=I._zod.run({value:q,issues:[]},J);if(Q instanceof Promise)Q=await Q;if(Q.issues.length){let K=new(Y?.Err??$)(Q.issues.map((z)=>M6(z,J,V4())));throw pz(K,Y?.callee),K}return Q.value},bY=GI(S6),HI=($)=>(I,q,U)=>{let Y=U?{...U,async:!1}:{async:!1},J=I._zod.run({value:q,issues:[]},Y);if(J instanceof Promise)throw new U8;return J.issues.length?{success:!1,error:new($??xY)(J.issues.map((Q)=>M6(Q,Y,V4())))}:{success:!0,data:J.value}},VI=HI(S6),WI=($)=>async(I,q,U)=>{let Y=U?{...U,async:!0}:{async:!0},J=I._zod.run({value:q,issues:[]},Y);if(J instanceof Promise)J=await J;return J.issues.length?{success:!1,error:new $(J.issues.map((Q)=>M6(Q,Y,V4())))}:{success:!0,data:J.value}},iY=WI(S6),cz=($)=>(I,q,U)=>{let Y=U?{...U,direction:"backward"}:{direction:"backward"};return wI($)(I,q,Y)},Nx=cz(S6),dz=($)=>(I,q,U)=>{return wI($)(I,q,U)},Fx=dz(S6),lz=($)=>async(I,q,U)=>{let Y=U?{...U,direction:"backward"}:{direction:"backward"};return GI($)(I,q,Y)},Mx=lz(S6),mz=($)=>async(I,q,U)=>{return GI($)(I,q,U)},Ax=mz(S6),oz=($)=>(I,q,U)=>{let Y=U?{...U,direction:"backward"}:{direction:"backward"};return HI($)(I,q,Y)},gx=oz(S6),rz=($)=>(I,q,U)=>{return HI($)(I,q,U)},Px=rz(S6),tz=($)=>async(I,q,U)=>{let Y=U?{...U,direction:"backward"}:{direction:"backward"};return WI($)(I,q,Y)},Tx=tz(S6),az=($)=>async(I,q,U)=>{return WI($)(I,q,U)},jx=az(S6);var s6={};d8(s6,{xid:()=>rO,uuid7:()=>bD0,uuid6:()=>nD0,uuid4:()=>fD0,uuid:()=>A7,uppercase:()=>FL,unicodeEmail:()=>Ex,undefined:()=>LL,ulid:()=>oO,time:()=>HL,string:()=>WL,sha512_hex:()=>zO0,sha512_base64url:()=>GO0,sha512_base64:()=>wO0,sha384_hex:()=>JO0,sha384_base64url:()=>KO0,sha384_base64:()=>QO0,sha256_hex:()=>qO0,sha256_base64url:()=>YO0,sha256_base64:()=>UO0,sha1_hex:()=>eD0,sha1_base64url:()=>IO0,sha1_base64:()=>$O0,rfc5322Email:()=>pD0,number:()=>pY,null:()=>OL,nanoid:()=>aO,md5_hex:()=>tD0,md5_base64url:()=>sD0,md5_base64:()=>aD0,mac:()=>YL,lowercase:()=>NL,ksuid:()=>tO,ipv6:()=>UL,ipv4:()=>qL,integer:()=>XL,idnEmail:()=>cD0,httpProtocol:()=>zL,html5Email:()=>iD0,hostname:()=>mD0,hex:()=>rD0,guid:()=>eO,extendedDuration:()=>kD0,emoji:()=>IL,email:()=>$L,e164:()=>wL,duration:()=>sO,domain:()=>oD0,datetime:()=>VL,date:()=>GL,cuid2:()=>mO,cuid:()=>lO,cidrv6:()=>QL,cidrv4:()=>JL,browserEmail:()=>dD0,boolean:()=>DL,bigint:()=>ZL,base64url:()=>sz,base64:()=>KL});var lO=/^[cC][0-9a-z]{6,}$/,mO=/^[0-9a-z]+$/,oO=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,rO=/^[0-9a-vA-V]{20}$/,tO=/^[A-Za-z0-9]{27}$/,aO=/^[a-zA-Z0-9_-]{21}$/,sO=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,kD0=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,eO=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,A7=($)=>{if(!$)return/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/;return new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${$}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`)},fD0=A7(4),nD0=A7(6),bD0=A7(7),$L=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,iD0=/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,pD0=/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/,Ex=/^[^\s@"]{1,64}@[^\s@]{1,255}$/u,cD0=Ex,dD0=/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,lD0="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function IL(){return new RegExp(lD0,"u")}var qL=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,UL=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,YL=($)=>{let I=W$($??":");return new RegExp(`^(?:[0-9A-F]{2}${I}){5}[0-9A-F]{2}$|^(?:[0-9a-f]{2}${I}){5}[0-9a-f]{2}$`)},JL=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0Line truncated
`).filter((J)=>J),U=Math.min(...q.map((J)=>J.length-J.trimStart().length)),Y=q.map((J)=>J.slice(U)).map((J)=>" ".repeat(this.indent*2)+J);for(let J of Y)this.content.push(J)}compile(){let $=Function,I=this?.args,U=[...(this?.content??[""]).map((Y)=>` ${Y}`)];return new $(...I,U.join(`
`))}}var fL={major:4,minor:4,patch:3};var k0=m("$ZodType",($,I)=>{var q;$??($={}),$._zod.def=I,$._zod.bag=$._zod.bag||{},$._zod.version=fL;let U=[...$._zod.def.checks??[]];if($._zod.traits.has("$ZodCheck"))U.unshift($);for(let Y of U)for(let J of Y._zod.onattach)J($);if(U.length===0)(q=$._zod).deferred??(q.deferred=[]),$._zod.deferred?.push(()=>{$._zod.run=$._zod.parse});else{let Y=(Q,K,z)=>{let w=o5(Q),G;for(let H of K){if(H._zod.def.when){if(pO(Q))continue;if(!H._zod.def.when(Q))continue}else if(w)continue;let W=Q.issues.length,V=H._zod.check(Q);if(V instanceof Promise&&z?.async===!1)throw new U8;if(G||V instanceof Promise)G=(G??Promise.resolve()).then(async()=>{if(await V,Q.issues.length===W)return;if(!w)w=o5(Q,W)});else{if(Q.issues.length===W)continue;if(!w)w=o5(Q,W)}}if(G)return G.then(()=>{return Q});return Q},J=(Q,K,z)=>{if(o5(Q))return Q.aborted=!0,Q;let w=Y(K,U,z);if(w instanceof Promise){if(z.async===!1)throw new U8;return w.then((G)=>$._zod.parse(G,z))}return $._zod.parse(w,z)};$._zod.run=(Q,K)=>{if(K.skipChecks)return $._zod.parse(Q,K);if(K.direction==="backward"){let w=$._zod.parse({value:Q.value,issues:[]},{...K,skipChecks:!0});if(w instanceof Promise)return w.then((G)=>{return J(G,Q,K)});return J(w,Q,K)}let z=$._zod.parse(Q,K);if(z instanceof Promise){if(K.async===!1)throw new U8;return z.then((w)=>Y(w,U,K))}return Y(z,U,K)}}r0($,"~standard",()=>({validate:(Y)=>{try{let J=VI($,Y);return J.success?{value:J.data}:{issues:J.error?.issues}}catch(J){return iY($,Y).then((Q)=>Q.success?{value:Q.data}:{issues:Q.error?.issues})}},vendor:"zod",version:1}))}),g7=m("$ZodString",($,I)=>{k0.init($,I),$._zod.pattern=[...$?._zod.bag?.patterns??[]].pop()??WL($._zod.bag),$._zod.parse=(q,U)=>{if(I.coerce)try{q.value=String(q.value)}catch(Y){}if(typeof q.value==="string")return q;return q.issues.push({expected:"string",code:"invalid_type",input:q.value,inst:$}),q}}),_1=m("$ZodStringFormat",($,I)=>{ZI.init($,I),g7.init($,I)}),bL=m("$ZodGUID",($,I)=>{I.pattern??(I.pattern=eO),_1.init($,I)}),iL=m("$ZodUUID",($,I)=>{if(I.version){let U={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[I.version];if(U===void 0)throw Error(`Invalid UUID version: "${I.version}"`);I.pattern??(I.pattern=A7(U))}else I.pattern??(I.pattern=A7());_1.init($,I)}),pL=m("$ZodEmail",($,I)=>{I.pattern??(I.pattern=$L),_1.init($,I)}),cL=m("$ZodURL",($,I)=>{_1.init($,I),$._zod.check=(q)=>{try{let U=q.value.trim();if(!I.normalize&&I.protocol?.source===zL.source){if(!/^https?:\/\//i.test(U)){q.issues.push({code:"invalid_format",format:"url",note:"Invalid URL format",input:q.value,inst:$,continue:!I.abort});return}}let Y=new URL(U);if(I.hostname){if(I.hostname.lastIndex=0,!I.hostname.test(Y.hostname))q.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:I.hostname.source,input:q.value,inst:$,continue:!I.abort})}if(I.protocol){if(I.protocol.lastIndex=0,!I.protocol.test(Y.protocol.endsWith(":")?Y.protocol.slice(0,-1):Y.protocol))q.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:I.protocol.source,input:q.value,inst:$,continue:!I.abort})}if(I.normalize)q.value=Y.href;else q.value=U;return}catch(U){q.issues.push({code:"invalid_format",format:"url",input:q.value,inst:$,continue:!I.abort})}}}),dL=m("$ZodEmoji",($,I)=>{I.pattern??(I.pattern=IL()),_1.init($,I)}),lL=m("$ZodNanoID",($,I)=>{I.pattern??(I.pattern=aO),_1.init($,I)}),mL=m("$ZodCUID",($,I)=>{I.pattern??(I.pattern=lO),_1.init($,I)}),oL=m("$ZodCUID2",($,I)=>{I.pattern??(I.pattern=mO),_1.init($,I)}),rL=m("$ZodULID",($,I)=>{I.pattern??(I.pattern=oO),_1.init($,I)}),tL=m("$ZodXID",($,I)=>{I.pattern??(I.pattern=rO),_1.init($,I)}),aL=m("$ZodKSUID",($,I)=>{I.pattern??(I.pattern=tO),_1.init($,I)}),sL=m("$ZodISODateTime",($,I)=>{I.pattern??(I.pattern=VL(I)),_1.init($,I)}),eL=m("$ZodISODate",($,I)=>{I.pattern??(I.pattern=GL),_1.init($,I)}),$N=m("$ZodISOTime",($,I)=>{I.pattern??(I.pattern=HL(I)),_1.init($,I)}),IN=m("$ZodISODuration",($,I)=>{I.pattern??(I.pattern=sO),_1.init($,I)}),qN=m("$ZodIPv4",($,I)=>{I.pattern??(I.pattern=qL),_1.init($,I),$._zod.bag.format="ipv4"}),UN=m("$ZodIPv6",($,I)=>{I.pattern??(I.pattern=UL),_1.init($,I),$._zod.bag.format="ipv6",$._zod.check=(q)=>{try{new URL(`http://[${q.value}]`)}catch{q.issues.push({code:"invalid_format",format:"ipv6",input:q.value,inst:$,continue:!I.abort})}}}),YN=m("$ZodMAC",($,I)=>{I.pattern??(I.pattern=YL(I.delimiter)),_1.init($,I),$._zod.bag.format="mac"}),JN=m("$ZodCIDRv4",($,I)=>{I.pattern??(I.pattern=JL),_1.init($,I)}),QN=m("$ZodCIDRv6",($,I)=>{I.pattern??(I.pattern=QL),_1.init($,I),$._zod.check=(q)=>{let U=q.value.split("/");try{if(U.length!==2)throw Error();let[Y,J]=U;if(!J)throw Error();let Q=Number(J);if(`${Q}`!==J)throw Error();if(Q<0||Q>128)throw Error();new URL(`http://[${Y}]`)}catch{q.issues.push({code:"invalid_format",format:"cidrv6",input:q.value,inst:$,continue:!I.abort})}}});function KN($){if($==="")return!0;if(/\s/.test($))return!1;if($.length%4!==0)return!1;try{return atob($),!0}catch{return!1}} Line truncated
if (${g}.issues.length) {
if (${B} in input) {
payload.issues = payload.issues.concat(${g}.issues.map(iss => ({
...iss,
path: iss.path ? [${y}, ...iss.path] : [${y}]
path: iss.path ? [${B}, ...iss.path] : [${B}]
})));
}
}
if (${W}.value === undefined) {
if (${y} in input) {
newResult[${y}] = undefined;
if (${g}.value === undefined) {
if (${B} in input) {
newResult[${B}] = undefined;
}
} else {
newResult[${y}] = ${W}.value;
newResult[${B}] = ${g}.value;
}
`);else if(!q)w.write(`
const ${W}_present = ${y} in input;
if (${W}.issues.length) {
payload.issues = payload.issues.concat(${W}.issues.map(iss => ({
`);else if(!h)V.write(`
const ${g}_present = ${B} in input;
if (${g}.issues.length) {
payload.issues = payload.issues.concat(${g}.issues.map(iss => ({
...iss,
path: iss.path ? [${y}, ...iss.path] : [${y}]
path: iss.path ? [${B}, ...iss.path] : [${B}]
})));
}
if (!${W}_present && !${W}.issues.length) {
if (!${g}_present && !${g}.issues.length) {
payload.issues.push({
code: "invalid_type",
expected: "nonoptional",
input: undefined,
path: [${y}]
path: [${B}]
});
}
if (${W}_present) {
if (${W}.value === undefined) {
newResult[${y}] = undefined;
if (${g}_present) {
if (${g}.value === undefined) {
newResult[${B}] = undefined;
} else {
newResult[${y}] = ${W}.value;
newResult[${B}] = ${g}.value;
}
}
`);else w.write(`
if (${W}.issues.length) {
payload.issues = payload.issues.concat(${W}.issues.map(iss => ({
`);else V.write(`
if (${g}.issues.length) {
payload.issues = payload.issues.concat(${g}.issues.map(iss => ({
...iss,
path: iss.path ? [${y}, ...iss.path] : [${y}]
path: iss.path ? [${B}, ...iss.path] : [${B}]
})));
}
if (${W}.value === undefined) {
if (${y} in input) {
newResult[${y}] = undefined;
if (${g}.value === undefined) {
if (${B} in input) {
newResult[${B}] = undefined;
}
} else {
newResult[${y}] = ${W}.value;
newResult[${B}] = ${g}.value;
}
`)}w.write("payload.value = newResult;"),w.write("return payload;");let F=w.compile();return(Q,W)=>F(f,Q,W)},u,e=Gt,l=!Lt.jitless,I=l&&p$.value,g=i.catchall,b;n._zod.parse=(f,w)=>{b??(b=o.value);let c=f.value;if(!e(c))return f.issues.push({expected:"object",code:"invalid_type",input:c,inst:n}),f;if(l&&I&&w?.async===!1&&w.jitless!==!0){if(!u)u=t(i.shape);if(f=u(f,w),!g)return f;return h4([],c,f,w,b,n)}return r(f,w)}});function Y4(n,i,r,o){for(let u of n)if(u.issues.length===0)return i.value=u.value,i;let t=n.filter((u)=>!ai(u));if(t.length===1)return i.value=t[0].value,t[0];return i.issues.push({code:"invalid_union",input:i.value,inst:r,errors:n.map((u)=>u.issues.map((e)=>Zn(e,o,On())))}),i}var ko=D("$ZodUnion",(n,i)=>{T.init(n,i),h(n._zod,"optin",()=>i.options.some((o)=>o._zod.optin==="optional")?"optional":void 0),h(n._zod,"optout",()=>i.options.some((o)=>o._zod.optout==="optional")?"optional":void 0),h(n._zod,"values",()=>{if(i.options.every((o)=>o._zod.values))return new Set(i.options.flatMap((o)=>Array.from(o._zod.values)));return}),h(n._zod,"pattern",()=>{if(i.options.every((o)=>o._zod.pattern)){let o=i.options.map((t)=>t._zod.pattern);return new RegExp(`^(${o.map((t)=>eo(t.source)).join("|")})$`)}return});let r=i.options.length===1?i.options[0]._zod.run:null;n._zod.parse=(o,t)=>{if(r)return r(o,t);let u=!1,e=[];for(let l of i.options){let $=l._zod.run({value:o.value,issues:[]},t);if($ instanceof Promise)e.push($),u=!0;else{if($.issues.length===0)return $;e.push($)}}if(!u)return Y4(e,o,n,t);return Promise.all(e).then((l)=>{return Y4(l,o,n,t)})}});function Q4(n,i,r,o){let t=n.filter((u)=>u.issues.length===0);if(t.length===1)return i.value=t[0].value,i;if(t.length===0)i.issues.push({code:"invalid_union",input:i.value,inst:r,errors:n.map((u)=>u.issues.map((e)=>Zn(e,o,On())))});else i.issues.push({code:"invalid_union",input:i.value,inst:r,errors:[],inclusive:!1});return i}var Ug=D("$ZodXor",(n,i)=>{ko.init(n,i),i.inclusive=!1;let r=i.options.length===1?i.options[0]._zod.run:null;n._zod.parse=(o,t)=>{if(r)return r(o,t);let u=!1,e=[];for(let l of i.options){let $=l._zod.run({value:o.value,issues:[]},t);if($ instanceof Promise)e.push($),u=!0;else e.push($)}if(!u)return Q4(e,o,n,t);return Promise.all(e).then((l)=>{return Q4(l,o,n,t)})}}),Dg=D("$ZodDiscriminatedUnion",(n,i)=>{i.inclusive=!1,ko.init(n,i);let r=n._zod.parse;h(n._zod,"propValues",()=>{let t={};for(let u of i.options){let e=u._zod.propValues;if(!e||Object.keys(e).length===0)throw Error(`Invalid discriminated union option at index "${i.options.indexOf(u)}"`);for(let[l,$]of Object.entries(e)){if(!t[l])t[l]=new Set;for(let I of $)t[l].add(I)}}return t});let o=Rt(()=>{let t=i.options,u=new Map;for(let e of t){let l=e._zod.propValues?.[i.discriminator];if(!l||l.size===0)throw Error(`Invalid discriminated union option at index "${i.options.indexOf(e)}"`);for(let $ of l){if(u.has($))throw Error(`Duplicate discriminator value "${String($)}"`);u.set($,e)}}return u});n._zod.parse=(t,u)=>{let e=t.value;if(!Gt(e))return t.issues.push({code:"invalid_type",expected:"object",input:e,inst:n}),t;let l=o.value.get(e?.[i.discriminator]);if(l)return l._zod.run(t,u);if(i.unionFallback||u.direction==="backward")return r(t,u);return t.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:i.discriminator,options:Array.from(o.value.keys()),input:e,path:[i.discriminator],inst:n}),t}}),Sg=D("$ZodIntersection",(n,i)=>{T.init(n,i),n._zod.parse=(r,o)=>{let t=r.value,u=i.left._zod.run({value:t,issues:[]},o),e=i.right._zod.run({value:t,issues:[]},o);if(u instanceof Promise||e instanceof Promise)return Promise.all([u,e]).then(([$,I])=>{return F4(r,$,I)});return F4(r,u,e)}});function XI(n,i){if(n===i)return{valid:!0,data:n};if(n instanceof Date&&i instanceof Date&&+n===+i)return{valid:!0,data:n};if(xi(n)&&xi(i)){let r=Object.keys(i),o=Object.keys(n).filter((u)=>r.indexOf(u)!==-1),t={...n,...i};for(let u of o){let e=XI(n[u],i[u]);if(!e.valid)return{valid:!1,mergeErrorPath:[u,...e.mergeErrorPath]};t[u]=e.data}return{valid:!0,data:t}}if(Array.isArray(n)&&Array.isArray(i)){if(n.length!==i.length)return{valid:!1,mergeErrorPath:[]};let r=[];for(let o=0;o<n.length;o++){let t=n[o],u=i[o],e=XI(t,u);if(!e.valid)return{valid:!1,mergeErrorPath:[o,...e.mergeErrorPath]};r.push(e.data)}return{valid:!0,data:r}}return{valid:!1,mergeErrorPath:[]}}function F4(n,i,r){let o=new Map,t;for(let l of i.issues)if(l.code==="unrecognized_keys"){t??(t=l);for(let $ of l.keys){if(!o.has($))o.set($,{});o.get($).l=!0}}else n.issues.push(l);for(let l of r.issues)if(l.code==="unrecognized_keys")for(let $ of l.keys){if(!o.has($))o.set($,{});o.get($).r=!0}else n.issues.push(l);let u=[...o].filter(([,l])=>l.l&&l.r).map(([l])=>l);if(u.length&&t)n.issues.push({...t,keys:u});if(ai(n))return n;let e=XI(i.value,r.value);if(!e.valid)throw Error(`Unmergable intersection. Error path: ${JSON.stringify(e.mergeErrorPath)}`);return n.value=e.data,n}var de=D("$ZodTuple",(n,i)=>{T.init(n,i Line truncated
`)}V.write("payload.value = newResult;"),V.write("return payload;");let T=V.compile();return(P,g)=>T(W,P,g)},J,Q=M7,K=!N7.jitless,w=K&&xO.value,G=I.catchall,H;$._zod.parse=(W,V)=>{H??(H=U.value);let X=W.value;if(!Q(X))return W.issues.push({expected:"object",code:"invalid_type",input:X,inst:$}),W;if(K&&w&&V?.async===!1&&V.jitless!==!0){if(!J)J=Y(I.shape);if(W=J(W,V),!G)return W;return tx([],X,W,V,H,$)}return q(W,V)}});function Sx($,I,q,U){for(let J of $)if(J.issues.length===0)return I.value=J.value,I;let Y=$.filter((J)=>!o5(J));if(Y.length===1)return I.value=Y[0].value,Y[0];return I.issues.push({code:"invalid_union",input:I.value,inst:q,errors:$.map((J)=>J.issues.map((Q)=>M6(Q,U,V4())))}),I}var mY=m("$ZodUnion",($,I)=>{k0.init($,I),r0($._zod,"optin",()=>I.options.some((U)=>U._zod.optin==="optional")?"optional":void 0),r0($._zod,"optout",()=>I.options.some((U)=>U._zod.optout==="optional")?"optional":void 0),r0($._zod,"values",()=>{if(I.options.every((U)=>U._zod.values))return new Set(I.options.flatMap((U)=>Array.from(U._zod.values)));return}),r0($._zod,"pattern",()=>{if(I.options.every((U)=>U._zod.pattern)){let U=I.options.map((Y)=>Y._zod.pattern);return new RegExp(`^(${U.map((Y)=>hY(Y.source)).join("|")})$`)}return});let q=I.options.length===1?I.options[0]._zod.run:null;$._zod.parse=(U,Y)=>{if(q)return q(U,Y);let J=!1,Q=[];for(let K of I.options){let z=K._zod.run({value:U.value,issues:[]},Y);if(z instanceof Promise)Q.push(z),J=!0;else{if(z.issues.length===0)return z;Q.push(z)}}if(!J)return Sx(Q,U,$,Y);return Promise.all(Q).then((K)=>{return Sx(K,U,$,Y)})}});function yx($,I,q,U){let Y=$.filter((J)=>J.issues.length===0);if(Y.length===1)return I.value=Y[0].value,I;if(Y.length===0)I.issues.push({code:"invalid_union",input:I.value,inst:q,errors:$.map((J)=>J.issues.map((Q)=>M6(Q,U,V4())))});else I.issues.push({code:"invalid_union",input:I.value,inst:q,errors:[],inclusive:!1});return I}var TN=m("$ZodXor",($,I)=>{mY.init($,I),I.inclusive=!1;let q=I.options.length===1?I.options[0]._zod.run:null;$._zod.parse=(U,Y)=>{if(q)return q(U,Y);let J=!1,Q=[];for(let K of I.options){let z=K._zod.run({value:U.value,issues:[]},Y);if(z instanceof Promise)Q.push(z),J=!0;else Q.push(z)}if(!J)return yx(Q,U,$,Y);return Promise.all(Q).then((K)=>{return yx(K,U,$,Y)})}}),jN=m("$ZodDiscriminatedUnion",($,I)=>{I.inclusive=!1,mY.init($,I);let q=$._zod.parse;r0($._zod,"propValues",()=>{let Y={};for(let J of I.options){let Q=J._zod.propValues;if(!Q||Object.keys(Q).length===0)throw Error(`Invalid discriminated union option at index "${I.options.indexOf(J)}"`);for(let[K,z]of Object.entries(Q)){if(!Y[K])Y[K]=new Set;for(let w of z)Y[K].add(w)}}return Y});let U=KI(()=>{let Y=I.options,J=new Map;for(let Q of Y){let K=Q._zod.propValues?.[I.discriminator];if(!K||K.size===0)throw Error(`Invalid discriminated union option at index "${I.options.indexOf(Q)}"`);for(let z of K){if(J.has(z))throw Error(`Duplicate discriminator value "${String(z)}"`);J.set(z,Q)}}return J});$._zod.parse=(Y,J)=>{let Q=Y.value;if(!M7(Q))return Y.issues.push({code:"invalid_type",expected:"object",input:Q,inst:$}),Y;let K=U.value.get(Q?.[I.discriminator]);if(K)return K._zod.run(Y,J);if(I.unionFallback||J.direction==="backward")return q(Y,J);return Y.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:I.discriminator,options:Array.from(U.value.keys()),input:Q,path:[I.discriminator],inst:$}),Y}}),EN=m("$ZodIntersection",($,I)=>{k0.init($,I),$._zod.parse=(q,U)=>{let Y=q.value,J=I.left._zod.run({value:Y,issues:[]},U),Q=I.right._zod.run({value:Y,issues:[]},U);if(J instanceof Promise||Q instanceof Promise)return Promise.all([J,Q]).then(([z,w])=>{return ux(q,z,w)});return ux(q,J,Q)}});function nL($,I){if($===I)return{valid:!0,data:$};if($ instanceof Date&&I instanceof Date&&+$===+I)return{valid:!0,data:$};if(m5($)&&m5(I)){let q=Object.keys(I),U=Object.keys($).filter((J)=>q.indexOf(J)!==-1),Y={...$,...I};for(let J of U){let Q=nL($[J],I[J]);if(!Q.valid)return{valid:!1,mergeErrorPath:[J,...Q.mergeErrorPath]};Y[J]=Q.data}return{valid:!0,data:Y}}if(Array.isArray($)&&Array.isArray(I)){if($.length!==I.length)return{valid:!1,mergeErrorPath:[]};let q=[];for(let U=0;U<$.length;U++){let Y=$[U],J=I[U],Q=nL(Y,J);if(!Q.valid)return{valid:!1,mergeErrorPath:[U,...Q.mergeErrorPath]};q.push(Q.data)}return{valid:!0,data:q}}return{valid:!1,mergeErrorPath:[]}}function ux($,I,q){let U=new Map,Y;for(let K of I.issues)if(K.code==="unrecognized_keys"){Y??(Y=K);for(let z of K.keys){if(!U.has(z))U.set(z,{});U.get(z).l=!0}}else $.issues.push(K);for(let K of q.issues)if(K.code==="unrecognized_keys")for(let z of K.keys){if(!U.has(z))U.set(z,{});U.get(z).r=!0}else $.issues.push(K);let J=[...U].filter(([,K])=>K.l&&K.r).map(([K])=>K);if(J.length&&Y)$.issues.push({...Y,keys:J});if(o5($))return $;let Q=nL(I.value,q.value);if(!Q.valid)throw Error(`Unmergable intersection. Error path: ${JSON.stringify(Q.mergeErrorPath)}`);return $.value=Q.data,$}var zw=m("$ZodTuple",($,I)=>{k0. Line truncated
Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let e of n.seen.entries()){let l=e[1];if(i===e[0]){u(e);continue}if(n.external){let I=n.external.registry.get(e[0])?.id;if(i!==e[0]&&I){u(e);continue}}if(n.metadataRegistry.get(e[0])?.id){u(e);continue}if(l.cycle){u(e);continue}if(l.count>1){if(n.reused==="ref"){u(e);continue}}}}function rt(n,i){let r=n.seen.get(i);if(!r)throw Error("Unprocessed schema. This is a bug in Zod.");let o=(l)=>{let $=n.seen.get(l);if($.ref===null)return;let I=$.def??$.schema,g={...I},b=$.ref;if($.ref=null,b){o(b);let w=n.seen.get(b),c=w.schema;if(c.$ref&&(n.target==="draft-07"||n.target==="draft-04"||n.target==="openapi-3.0"))I.allOf=I.allOf??[],I.allOf.push(c);else Object.assign(I,c);if(Object.assign(I,g),l._zod.parent===b)for(let k in I){if(k==="$ref"||k==="allOf")continue;if(!(k in g))delete I[k]}if(c.$ref&&w.def)for(let k in I){if(k==="$ref"||k==="allOf")continue;if(k in w.def&&JSON.stringify(I[k])===JSON.stringify(w.def[k]))delete I[k]}}let f=l._zod.parent;if(f&&f!==b){o(f);let w=n.seen.get(f);if(w?.schema.$ref){if(I.$ref=w.schema.$ref,w.def)for(let c in I){if(c==="$ref"||c==="allOf")continue;if(c in w.def&&JSON.stringify(I[c])===JSON.stringify(w.def[c]))delete I[c]}}}n.override({zodSchema:l,jsonSchema:I,path:$.path??[]})};for(let l of[...n.seen.entries()].reverse())o(l[0]);let t={};if(n.target==="draft-2020-12")t.$schema="https://json-schema.org/draft/2020-12/schema";else if(n.target==="draft-07")t.$schema="http://json-schema.org/draft-07/schema#";else if(n.target==="draft-04")t.$schema="http://json-schema.org/draft-04/schema#";else if(n.target==="openapi-3.0");if(n.external?.uri){let l=n.external.registry.get(i)?.id;if(!l)throw Error("Schema is missing an `id` property");t.$id=n.external.uri(l)}Object.assign(t,r.def??r.schema);let u=n.metadataRegistry.get(i)?.id;if(u!==void 0&&t.id===u)delete t.id;let e=n.external?.defs??{};for(let l of n.seen.entries()){let $=l[1];if($.def&&$.defId){if($.def.id===$.defId)delete $.def.id;e[$.defId]=$.def}}if(n.external);else if(Object.keys(e).length>0)if(n.target==="draft-2020-12")t.$defs=e;else t.definitions=e;try{let l=JSON.parse(JSON.stringify(t));return Object.defineProperty(l,"~standard",{value:{...i["~standard"],jsonSchema:{input:Ur(i,"input",n.processors),output:Ur(i,"output",n.processors)}},enumerable:!1,writable:!1}),l}catch(l){throw Error("Error converting schema to JSON.")}}function zn(n,i){let r=i??{seen:new Set};if(r.seen.has(n))return!1;r.seen.add(n);let o=n._zod.def;if(o.type==="transform")return!0;if(o.type==="array")return zn(o.element,r);if(o.type==="set")return zn(o.valueType,r);if(o.type==="lazy")return zn(o.getter(),r);if(o.type==="promise"||o.type==="optional"||o.type==="nonoptional"||o.type==="nullable"||o.type==="readonly"||o.type==="default"||o.type==="prefault")return zn(o.innerType,r);if(o.type==="intersection")return zn(o.left,r)||zn(o.right,r);if(o.type==="record"||o.type==="map")return zn(o.keyType,r)||zn(o.valueType,r);if(o.type==="pipe"){if(n._zod.traits.has("$ZodCodec"))return!0;return zn(o.in,r)||zn(o.out,r)}if(o.type==="object"){for(let t in o.shape)if(zn(o.shape[t],r))return!0;return!1}if(o.type==="union"){for(let t of o.options)if(zn(t,r))return!0;return!1}if(o.type==="tuple"){for(let t of o.items)if(zn(t,r))return!0;if(o.rest&&zn(o.rest,r))return!0;return!1}return!1}var Nf=(n,i={})=>(r)=>{let o=it({...r,processors:i});return ln(n,o),tt(o,n),rt(o,n)},Ur=(n,i,r={})=>(o)=>{let{libraryOptions:t,target:u}=o??{},e=it({...t??{},target:u,io:i,processors:r});return ln(n,e),tt(e,n),rt(e,n)};var dp={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},Gf=(n,i,r,o)=>{let t=r;t.type="string";let{minimum:u,maximum:e,format:l,patterns:$,contentEncoding:I}=n._zod.bag;if(typeof u==="number")t.minLength=u;if(typeof e==="number")t.maxLength=e;if(l){if(t.format=dp[l]??l,t.format==="")delete t.format;if(l==="time")delete t.format}if(I)t.contentEncoding=I;if($&&$.size>0){let g=[...$];if(g.length===1)t.pattern=g[0].source;else if(g.length>1)t.allOf=[...g.map((b)=>({...i.target==="draft-07"||i.target==="draft-04"||i.target==="openapi-3.0"?{type:"string"}:{},pattern:b.source}))]}},Wf=(n,i,r,o)=>{let t=r,{minimum:u,maximum:e,format:l,multipleOf:$,exclusiveMaximum:I,exclusiveMinimum:g}=n._zod.bag;if(typeof l==="string"&&l.includes("int"))t.type="integer";else t.type="number";let b=typeof g==="number"&&g>=(u??Number.NEGATIVE_INFINITY),f=typeof I==="number"&&I<=(e??Number.POSITIVE_INFINITY),w=i.target==="draft-04"||i.target==="openapi-3.0";if(b)if(w)t.minimum=g,t.exclusiveMinimum=!0;else t.exclusiveMinimum=g;else if(typeof u==="number")t.minimum=u;if(f)if(w)t.maximum=I,t.exclusiveMaximum=!0;else t.exclusiveMaximum=I;else if(typeof e==="number")t.maximum=e;if(typeof $==="number")t.multipleOf=$},pf=(n,i,r,o)=>{r.type="boolean"},jf=(n,i,r,o)=>{if(i.unrepresentable==="throw")throw Error("BigInt cannot be represented in JSON Schema")},Jf=(n,i,r,o)=>{if(i.unrepresentable==="Line truncated
`);if(n===-1)return null;let i=this._buffer.toString("utf8",0,n).replace(/\r$/,"");return this._buffer=this._buffer.subarray(n+1),_Q(i)}clear(){this._buffer=void 0}}function _Q(n){return GD.parse(JSON.parse(n))}function Ok(n){return JSON.stringify(n)+`
`}class q6{constructor(n=yk.stdin,i=yk.stdout){this._stdin=n,this._stdout=i,this._readBuffer=new _6,this._started=!1,this._ondata=(r)=>{this._readBuffer.append(r),this.processReadBuffer()},this._onerror=(r)=>{this.onerror?.(r)}}async start(){if(this._started)throw Error("StdioServerTransport already started! If using Server class, note that connect() calls start() automatically.");this._started=!0,this._stdin.on("data",this._ondata),this._stdin.on("error",this._onerror)}processReadBuffer(){while(!0)try{let n=this._readBuffer.readMessage();if(n===null)break;this.onmessage?.(n)}catch(n){this.onerror?.(n)}}async close(){if(this._stdin.off("data",this._ondata),this._stdin.off("error",this._onerror),this._stdin.listenerCount("data")===0)this._stdin.pause();this._readBuffer.clear(),this.onclose?.()}send(n){return new Promise((i)=>{let r=Ok(n);if(this._stdout.write(r))i();else this._stdout.once("drain",i)})}}import{dirname as e4,join as IB}from"node:path";import{fileURLToPath as gB}from"node:url";class Zi extends Error{name="KyError";get isKyError(){return!0}}class ri extends Zi{name="HTTPError";response;request;options;data;constructor(n,i,r){let o=n.status||n.status===0?n.status:"",t=n.statusText??"",u=`${o} ${t}`.trim(),e=u?`status code ${u}`:"an unknown error";super(`Request failed with ${e}: ${i.method} ${i.url}`);this.response=n,this.request=i,this.options=r}}class Nu extends Zi{name="NetworkError";request;constructor(n,i){super(`Request failed due to a network error: ${n.method} ${n.url}`,i);this.request=n}}class Gu extends Error{name="NonError";value;constructor(n){let i="Non-error value was thrown";try{if(typeof n==="string")i=n;else if(n&&typeof n==="object"&&"message"in n&&typeof n.message==="string")i=n.message}catch{}super(i);this.value=n}}class qr extends Zi{name="ForceRetryError";customDelay;code;customRequest;constructor(n){let i=n?.cause?n.cause instanceof Error?n.cause:new Gu(n.cause):void 0;super(n?.code?`Forced retry: ${n.code}`:"Forced retry",i?{cause:i}:void 0);this.customDelay=n?.delay,this.code=n?.code,this.customRequest=n?.request}}class Z6 extends Error{name="SchemaValidationError";issues;constructor(n){super("Response schema validation failed");this.issues=n}}class di extends Zi{name="TimeoutError";request;constructor(n){super(`Request timed out: ${n.method} ${n.url}`);this.request=n}}var M6=(()=>{let n=!1,i=!1,r=typeof globalThis.ReadableStream==="function",o=typeof globalThis.Request==="function";if(r&&o)try{i=new globalThis.Request("https://empty.invalid",{body:new globalThis.ReadableStream,method:"POST",get duplex(){return n=!0,"half"}}).headers.has("Content-Type")}catch(t){if(t instanceof Error&&t.message==="unsupported BodyInit type")return!1;throw t}return n&&!i})(),Lk=typeof globalThis.AbortController==="function",Gv=typeof globalThis.AbortSignal==="function"&&typeof globalThis.AbortSignal.any==="function",Nk=typeof globalThis.ReadableStream==="function",Gk=typeof globalThis.FormData==="function",Wv=["get","post","put","patch","head","delete"],qQ=()=>{return};qQ();var Wk={json:"application/json",text:"text/*",formData:"multipart/form-data",arrayBuffer:"*/*",blob:"*/*",bytes:"*/*"},Zr=2147483647,pk=40,pv=Symbol("stop");class jv{options;constructor(n){this.options=n}}var jk=(n)=>new jv(n),Jk={json:!0,parseJson:!0,stringifyJson:!0,searchParams:!0,baseUrl:!0,prefix:!0,retry:!0,timeout:!0,totalTimeout:!0,hooks:!0,throwHttpErrors:!0,onDownloadProgress:!0,onUploadProgress:!0,fetch:!0,context:!0},Xk={method:!0,headers:!0,body:!0,mode:!0,credentials:!0,cache:!0,redirect:!0,referrer:!0,referrerPolicy:!0,integrity:!0,keepalive:!0,signal:!0,window:!0,duplex:!0};var Jv=new TextEncoder,ZQ=(n)=>{if(!n)return 0;if(n instanceof FormData){let i=0;for(let[r,o]of n)i+=pk,i+=Jv.encode(`Content-Disposition: form-data; name="${r}"`).byteLength,i+=typeof o==="string"?Jv.encode(o).byteLength:o.size;return i}if(n instanceof Blob)return n.size;if(n instanceof ArrayBuffer||ArrayBuffer.isView(n))return n.byteLength;if(typeof n==="string")return Jv.encode(n).byteLength;if(n instanceof URLSearchParams)return Jv.encode(n.toString()).byteLength;return 0},Hk=(n,i,r)=>{let o,t=0;return n.pipeThrough(new TransformStream({transform(u,e){if(e.enqueue(u),o){t+=o.byteLength;let l=i===0?0:t/i;if(l>=1)l=1-Number.EPSILON;r?.({percent:l,totalBytes:Math.max(i,t),transferredBytes:t},o)}o=u},flush(){if(o)t+=o.byteLength,r?.({percent:1,totalBytes:Math.max(i,t),transferredBytes:t},o)}}))},Yk=(n,i)=>{if(!n.body)return n;let r={status:n.status,statusText:n.statusText,headers:n.headers};if(n.status===204)return new Response(null,r);let o=Math.max(0,Number(n.headers.get("content-length"))||0);return new Response(Hk(n.body,o,i),r)},Qk=(n,i,r)=>{if(!n.body)return n;let o=ZQ(r??n.body);return new Request(n,{duplex:"half",body:Hk(n.body,o,i)})};var Xi=(n)=>n!==null&&typeof n==="object";var MQ=Symbol("replaceOption"),z6=(n)=>Xi(n)&&n[MQ]===!0?{isReplace:!0,value:n.value}:{isReplace:!1,value:n};var pu=(...n)=>{for(let i of n)if((!Xi(i)| Line truncated
`,{mode:384}),i}function xr(n,i,r=[]){let o=i.corpId?.trim()||void 0,t=i.stateful?i.defaultCorpId?.trim()||void 0:void 0,u=o??t;if(u){let l=n.find(($)=>$.id===u);if(l)return l;throw Error(`No enterprise config found for ${u}`)}if(!i.stateful)throw Error("Stateless mode is enabled. Every enterprise command requires --corp <corpId>. Use `seal-home config mode stateful` to enable a default enterprise.");let e=n[0];if(e)return e;throw Error("No enterprise config found. Add a non-example JSON file under one of: "+(r.length?r.join(", "):"the configured enterprise directories"))}import{readFileSync as JK}from"node:fs";import{randomBytes as XK}from"node:crypto";import{randomBytes as CO}from"node:crypto";var TF=v.object({staffId:v.string(),name:v.string().optional(),code:v.string().default(""),bindTime:v.number().optional()}),VF=v.object({id:v.string(),tenantId:v.string(),name:v.string(),isAdmin:v.boolean().default(!1),permissions:v.array(v.string()).default([]),providerUserId:v.string().optional(),hosecloudStaff:TF.optional()}),_F=v.object({apiKey:v.string().optional(),corporationId:v.string().optional(),corporationName:v.string().optional()}),qF=v.object({id:v.string(),name:v.string(),tenantSlug:v.string().optional(),isDemo:v.boolean().default(!1),logoUrl:v.string().nullable().optional(),hoseCorpConfig:_F.optional()}),NO=v.object({user:VF,tenant:qF}),ZF=v.object({id:v.string(),name:v.string(),email:v.string().nullable().optional(),emailVerified:v.boolean().optional(),image:v.string().nullable().optional(),tenantId:v.string().optional(),provider:v.string().optional(),providerUserId:v.string().optional(),mobile:v.string().nullable().optional(),status:v.string().optional(),permissions:v.array(v.string()).default([]),isAdmin:v.boolean().default(!1),hosecloudStaff:v.unknown().optional()}).passthrough(),MF=v.object({id:v.string(),token:v.string().optional(),expiresAt:v.string(),createdAt:v.string().optional(),updatedAt:v.string().optional(),ipAddress:v.string().optional(),userAgent:v.string().optional(),userId:v.string(),delegationId:v.string().nullable().optional()}).passthrough(),GO=v.object({user:ZF,session:MF}),zv=v.object({id:v.string(),tenantId:v.string().optional(),code:v.number().optional(),description:v.string(),scope:v.string(),strictness:v.string(),status:v.string().optional(),createdAt:v.number().optional(),updatedAt:v.number().optional()}),WO=v.object({rules:v.array(zv),hasPendingDeletes:v.boolean().default(!1)}),zF=v.object({code:v.string().optional(),description:v.string(),scope:v.string(),strictness:v.string()}),Cv=v.object({id:v.string(),tenantId:v.string().optional(),versionNumber:v.number(),versionName:v.string().nullable().optional(),publishedBy:v.string().nullable().optional(),publishedByName:v.string().nullable().optional(),rules:v.array(zF).default([]),publishedAt:v.number().optional(),createdAt:v.number().optional()}),pO=v.object({version:Cv,rulesCount:v.number()}),Ku=v.object({id:v.string(),tenantId:v.string().optional(),title:v.string(),purpose:v.string().default(""),contentType:v.string().default("policy"),content:v.string(),status:v.string().default("published"),enabled:v.boolean().default(!0),scenarios:v.array(v.string()).default([]),tags:v.array(v.string()).default([]),category:v.string().nullable().optional(),categoryTags:v.array(v.string()).default([]),createdBy:v.string().nullable().optional(),createdByName:v.string().nullable().optional(),createdAt:v.number().optional(),updatedAt:v.number().optional(),updatedBy:v.string().nullable().optional(),updatedByName:v.string().nullable().optional(),isDeleted:v.boolean().default(!1)}),jO=v.object({articles:v.array(Ku),total:v.number().optional()}),CF=v.object({explicitApprove:v.string().default(""),explicitReject:v.string().default(""),exemptApprove:v.string().default(""),review:v.string().default("")}).passthrough(),RF=v.object({type:v.string(),signKey:v.string().optional(),outboundName:v.string().optional(),mode:v.string().optional(),autoApprovalRate:v.number().optional(),apiKey:v.string().optional(),apiSecret:v.string().optional(),apiOrigin:v.string().optional(),corporationId:v.string().optional(),ebotSignKey:v.string().optional(),completionSignKey:v.string().optional(),outboundMessageId:v.string().optional(),completionMessageId:v.string().optional()}).passthrough(),hF=v.enum(["assisted","semi_automatic","fully_automatic"]),LO=v.object({id:v.string(),url:v.string().url()}).passthrough(),Pu=v.object({type:v.literal("webhook"),id:v.string(),name:v.string(),mode:hF,incomingDocumentWebhook:LO,outgoingResultWebhook:v.string().url(),incomingManualResultWebhook:LO,secret:v.string().min(1),autoApprovalRate:v.number().int().min(0).max(100).optional()}).passthrough(),I0=v.object({id:v.string().optional(),tenantId:v.string().optional(),tone:v.string().optional(),language:v.string().optional(),detailLevel:v.string().optional(),outputFormat:v.string().optional(),examples:v.array(v.string()).default([]),prohibitedPhrases:v.array(v.string()).default([]),cus Line truncated
`);return{recordId:n.id,sourceDocumentSN:n.sourceDocumentSN,sourceDocumentId:n.sourceDocumentId,document:dt({id:i?.id,sn:i?.sn??i?.sourceDocumentSN??n.sourceDocumentSN,title:i?.title??i?.name,template:r$(i,["template.name","templateName","form.name","formName","formTitle"]),amount:i$(r,["金额","报销金额","付款金额","合计","价税合计"])??r$(i,["amount","totalAmount","expenseAmount"]),expenseType:i$(r,["费用类型","费用类别","报销类型"]),costCompany:i$(r,["费用承担公司","承担公司","成本中心","费用归属"]),payee:i$(r,["收款方","收款账户","收款信息","开户名","银行账号"]),keyFields:r.slice(0,30)}),invoices:hK(n),attachments:rL(n,{summary:!0}).attachments,aiResult:u$(n),manualResult:Zt(n)?.value,hints:dt({amountMentions:My(o,["金额","合计","税率"],8),partyMentions:My(o,["买方","卖方","甲方","乙方","收款"],8)})}}function rL(n,i={}){let r=[["document",n.document],["result",n.result],["pipelineData",n.pipelineData],["sourceExtendData",n.sourceExtendData]],o=[],t=new Set;for(let[u,e]of r)Y0(e,u,o,t);return{recordId:n.id,sourceDocumentSN:n.sourceDocumentSN,sourceDocumentId:n.sourceDocumentId,count:o.length,attachments:i.summary?o.map((u)=>dt({path:u.path,kind:u.kind,fileName:u.fileName,mimeType:u.mimeType,fileId:u.fileId,sourceField:u.sourceField})):o}}function qK(n){let i=[["result.citedRules",zi(n,"result.citedRules")],["result.matchedRules",zi(n,"result.matchedRules")],["result.ruleResults",zi(n,"result.ruleResults")],["result.rules",zi(n,"result.rules")],["pipelineData.citedRules",zi(n,"pipelineData.citedRules")],["pipelineData.matchedRules",zi(n,"pipelineData.matchedRules")]],r=[],o=new Set;for(let[t,u]of i)(Array.isArray(u)?u:u&&typeof u==="object"?Object.values(u):[]).forEach((l,$)=>{let I=sr(l);if(!I)return;let g=_(I.runtimeRuleId)??_(I.runtimeId)??_(I.id)??_(I.ruleId),b=_(I.ruleCode)??_(I.code)??(g?aK(g):void 0),f=dt({runtimeRuleId:g,ruleCode:b,versionNumber:CK(I.versionNumber)??n.ruleSetVersionNumber,scope:_(I.scope),strictness:_(I.strictness),appliedAnalysis:I.appliedAnalysis??I.analysis??I.reasoning,checkResult:I.checkResult??I.result??I.decision,findings:I.findings??I.riskPoints??I.evidence,sourcePath:`${t}.${$}`}),w=JSON.stringify(f);if(!o.has(w))o.add(w),r.push(f)});return{recordId:n.id,sourceDocumentSN:n.sourceDocumentSN,sourceDocumentId:n.sourceDocumentId,ruleSetVersionNumber:n.ruleSetVersionNumber,count:r.length,rules:r}}function Y0(n,i,r,o){if(Array.isArray(n)){n.forEach((u,e)=>Y0(u,`${i}.${e}`,r,o));return}let t=sr(n);if(!t)return;if(ZK(t,i)){let u=dt({path:i,fieldPath:i,kind:MK(i,t),fileName:_(t.fileName)??_(t.filename)??_(t.name)??_(t.originalName),mimeType:_(t.mimeType)??_(t.mimetype)??_(t.contentType),fileId:_(t.fileId)??_(t.id)??_(t.attachmentId),ossPath:_(t.ossPath)??_(t.ossKey)??_(t.key),url:_(t.url)??_(t.signedUrl)??_(t.downloadUrl)??_(t.previewUrl),invoiceId:_(t.invoiceId),sourceField:_(t.fieldName)??_(t.label)}),e=JSON.stringify(u);if(!o.has(e))o.add(e),r.push(u)}for(let[u,e]of Object.entries(t))Y0(e,`${i}.${u}`,r,o)}function ZK(n,i){let r=Object.keys(n).map((u)=>u.toLowerCase());return/(attachment|attachments|invoice|receipt|file|files|附件|发票)/i.test(i)&&["filename","fileName","mimeType","mimetype","contentType","fileId","ossPath","signedUrl","downloadUrl","previewUrl","attachmentId"].some((u)=>r.includes(u.toLowerCase()))}function MK(n,i){let r=`${n} ${_(i.type)??""}`.toLowerCase();if(r.includes("invoice")||r.includes("发票"))return"invoice";if(r.includes("receipt"))return"receipt";return"attachment"}function r$(n,i){if(!n)return;for(let r of i){let o=zi(n,r);if(o!==void 0)return o}return}function Zy(n,i){if(!n)return 0;for(let r of i){let o=zi(n,r);if(Array.isArray(o))return o.length;if(o&&typeof o==="object")return Object.keys(o).length;if(typeof o==="number")return o}return 0}function zi(n,i){return i.split(".").reduce((r,o)=>{if(r===void 0||r===null)return;if(Array.isArray(r)){let t=Number(o);return Number.isInteger(t)?r[t]:void 0}if(typeof r==="object")return r[o];return},n)}function zK(n,i,r){let o=i.split("."),t=n;for(let u of o.slice(0,-1)){let e=t[u];if(!e||typeof e!=="object"||Array.isArray(e))t[u]={};t=t[u]}t[o[o.length-1]??i]=r}function dt(n){return Object.fromEntries(Object.entries(n).filter(([,i])=>i!==void 0))}function sr(n){return n&&typeof n==="object"&&!Array.isArray(n)?n:void 0}function CK(n){return typeof n==="number"&&Number.isFinite(n)?n:void 0}function RK(n){let i=[];return Q0(n,"document",i),i}function Q0(n,i,r){if(Array.isArray(n)){n.forEach((e,l)=>Q0(e,`${i}.${l}`,r));return}let o=sr(n);if(!o)return;let t=_(o.label)??_(o.name)??_(o.title)??_(o.fieldName),u=o.value??o.displayValue??o.text??o.content;if(t&&u!==void 0&&typeof u!=="object")r.push(dt({path:i,label:t,value:u,type:_(o.type)??_(o.fieldType)}));for(let[e,l]of Object.entries(o)){if(e==="attachments")continue;Q0(l,`${i}.${e}`,r)}}function i$(n,i){return n.find((o)=>{let t=_(o.label)??"";return i.some((u)=>t.includes(u)) Line truncated
Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let Q of $.seen.entries()){let K=Q[1];if(I===Q[0]){J(Q);continue}if($.external){let w=$.external.registry.get(Q[0])?.id;if(I!==Q[0]&&w){J(Q);continue}}if($.metadataRegistry.get(Q[0])?.id){J(Q);continue}if(K.cycle){J(Q);continue}if(K.count>1){if($.reused==="ref"){J(Q);continue}}}}function e5($,I){let q=$.seen.get(I);if(!q)throw Error("Unprocessed schema. This is a bug in Zod.");let U=(K)=>{let z=$.seen.get(K);if(z.ref===null)return;let w=z.def??z.schema,G={...w},H=z.ref;if(z.ref=null,H){U(H);let V=$.seen.get(H),X=V.schema;if(X.$ref&&($.target==="draft-07"||$.target==="draft-04"||$.target==="openapi-3.0"))w.allOf=w.allOf??[],w.allOf.push(X);else Object.assign(w,X);if(Object.assign(w,G),K._zod.parent===H)for(let O in w){if(O==="$ref"||O==="allOf")continue;if(!(O in G))delete w[O]}if(X.$ref&&V.def)for(let O in w){if(O==="$ref"||O==="allOf")continue;if(O in V.def&&JSON.stringify(w[O])===JSON.stringify(V.def[O]))delete w[O]}}let W=K._zod.parent;if(W&&W!==H){U(W);let V=$.seen.get(W);if(V?.schema.$ref){if(w.$ref=V.schema.$ref,V.def)for(let X in w){if(X==="$ref"||X==="allOf")continue;if(X in V.def&&JSON.stringify(w[X])===JSON.stringify(V.def[X]))delete w[X]}}}$.override({zodSchema:K,jsonSchema:w,path:z.path??[]})};for(let K of[...$.seen.entries()].reverse())U(K[0]);let Y={};if($.target==="draft-2020-12")Y.$schema="https://json-schema.org/draft/2020-12/schema";else if($.target==="draft-07")Y.$schema="http://json-schema.org/draft-07/schema#";else if($.target==="draft-04")Y.$schema="http://json-schema.org/draft-04/schema#";else if($.target==="openapi-3.0");if($.external?.uri){let K=$.external.registry.get(I)?.id;if(!K)throw Error("Schema is missing an `id` property");Y.$id=$.external.uri(K)}Object.assign(Y,q.def??q.schema);let J=$.metadataRegistry.get(I)?.id;if(J!==void 0&&Y.id===J)delete Y.id;let Q=$.external?.defs??{};for(let K of $.seen.entries()){let z=K[1];if(z.def&&z.defId){if(z.def.id===z.defId)delete z.def.id;Q[z.defId]=z.def}}if($.external);else if(Object.keys(Q).length>0)if($.target==="draft-2020-12")Y.$defs=Q;else Y.definitions=Q;try{let K=JSON.parse(JSON.stringify(Y));return Object.defineProperty(K,"~standard",{value:{...I["~standard"],jsonSchema:{input:vI(I,"input",$.processors),output:vI(I,"output",$.processors)}},enumerable:!1,writable:!1}),K}catch(K){throw Error("Error converting schema to JSON.")}}function g6($,I){let q=I??{seen:new Set};if(q.seen.has($))return!1;q.seen.add($);let U=$._zod.def;if(U.type==="transform")return!0;if(U.type==="array")return g6(U.element,q);if(U.type==="set")return g6(U.valueType,q);if(U.type==="lazy")return g6(U.getter(),q);if(U.type==="promise"||U.type==="optional"||U.type==="nonoptional"||U.type==="nullable"||U.type==="readonly"||U.type==="default"||U.type==="prefault")return g6(U.innerType,q);if(U.type==="intersection")return g6(U.left,q)||g6(U.right,q);if(U.type==="record"||U.type==="map")return g6(U.keyType,q)||g6(U.valueType,q);if(U.type==="pipe"){if($._zod.traits.has("$ZodCodec"))return!0;return g6(U.in,q)||g6(U.out,q)}if(U.type==="object"){for(let Y in U.shape)if(g6(U.shape[Y],q))return!0;return!1}if(U.type==="union"){for(let Y of U.options)if(g6(Y,q))return!0;return!1}if(U.type==="tuple"){for(let Y of U.items)if(g6(Y,q))return!0;if(U.rest&&g6(U.rest,q))return!0;return!1}return!1}var hM=($,I={})=>(q)=>{let U=a5({...q,processors:I});return E1($,U),s5(U,$),e5(U,$)},vI=($,I,q={})=>(U)=>{let{libraryOptions:Y,target:J}=U??{},Q=a5({...Y??{},target:J,io:I,processors:q});return E1($,Q),s5(Q,$),e5(Q,$)};var _L0={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},SM=($,I,q,U)=>{let Y=q;Y.type="string";let{minimum:J,maximum:Q,format:K,patterns:z,contentEncoding:w}=$._zod.bag;if(typeof J==="number")Y.minLength=J;if(typeof Q==="number")Y.maxLength=Q;if(K){if(Y.format=_L0[K]??K,Y.format==="")delete Y.format;if(K==="time")delete Y.format}if(w)Y.contentEncoding=w;if(z&&z.size>0){let G=[...z];if(G.length===1)Y.pattern=G[0].source;else if(G.length>1)Y.allOf=[...G.map((H)=>({...I.target==="draft-07"||I.target==="draft-04"||I.target==="openapi-3.0"?{type:"string"}:{},pattern:H.source}))]}},yM=($,I,q,U)=>{let Y=q,{minimum:J,maximum:Q,format:K,multipleOf:z,exclusiveMaximum:w,exclusiveMinimum:G}=$._zod.bag;if(typeof K==="string"&&K.includes("int"))Y.type="integer";else Y.type="number";let H=typeof G==="number"&&G>=(J??Number.NEGATIVE_INFINITY),W=typeof w==="number"&&w<=(Q??Number.POSITIVE_INFINITY),V=I.target==="draft-04"||I.target==="openapi-3.0";if(H)if(V)Y.minimum=G,Y.exclusiveMinimum=!0;else Y.exclusiveMinimum=G;else if(typeof J==="number")Y.minimum=J;if(W)if(V)Y.maximum=w,Y.exclusiveMaximum=!0;else Y.exclusiveMaximum=w;else if(typeof Q==="number")Y.maximum=Q;if(typeof z==="number")Y.multipleOf=z},uM=($,I,q,U)=>{q.type="boolean"},xM=($,I,q,U)=>{if(I.unrepresentable==="throw")throw Error("BigInt cannot be represented in JSON Schema")},kM=($,I,q,U)=>{if(I.unrepresentable==Line truncated
`);if($===-1)return null;let I=this._buffer.toString("utf8",0,$).replace(/\r$/,"");return this._buffer=this._buffer.subarray($+1),$v0(I)}clear(){this._buffer=void 0}}function $v0($){return Ef.parse(JSON.parse($))}function Tc($){return JSON.stringify($)+`
`}class aP{constructor($=jc.stdin,I=jc.stdout){this._stdin=$,this._stdout=I,this._readBuffer=new tP,this._started=!1,this._ondata=(q)=>{this._readBuffer.append(q),this.processReadBuffer()},this._onerror=(q)=>{this.onerror?.(q)}}async start(){if(this._started)throw Error("StdioServerTransport already started! If using Server class, note that connect() calls start() automatically.");this._started=!0,this._stdin.on("data",this._ondata),this._stdin.on("error",this._onerror)}processReadBuffer(){while(!0)try{let $=this._readBuffer.readMessage();if($===null)break;this.onmessage?.($)}catch($){this.onerror?.($)}}async close(){if(this._stdin.off("data",this._ondata),this._stdin.off("error",this._onerror),this._stdin.listenerCount("data")===0)this._stdin.pause();this._readBuffer.clear(),this.onclose?.()}send($){return new Promise((I)=>{let q=Tc($);if(this._stdout.write(q))I();else this._stdout.once("drain",I)})}}import{dirname as vu,join as yw1}from"node:path";import{fileURLToPath as uw1}from"node:url";class $5 extends Error{name="KyError";get isKyError(){return!0}}class n6 extends $5{name="HTTPError";response;request;options;data;constructor($,I,q){let U=$.status||$.status===0?$.status:"",Y=$.statusText??"",J=`${U} ${Y}`.trim(),Q=J?`status code ${J}`:"an unknown error";super(`Request failed with ${Q}: ${I.method} ${I.url}`);this.response=$,this.request=I,this.options=q}}class aJ extends $5{name="NetworkError";request;constructor($,I){super(`Request failed due to a network error: ${$.method} ${$.url}`,I);this.request=$}}class sJ extends Error{name="NonError";value;constructor($){let I="Non-error value was thrown";try{if(typeof $==="string")I=$;else if($&&typeof $==="object"&&"message"in $&&typeof $.message==="string")I=$.message}catch{}super(I);this.value=$}}class qq extends $5{name="ForceRetryError";customDelay;code;customRequest;constructor($){let I=$?.cause?$.cause instanceof Error?$.cause:new sJ($.cause):void 0;super($?.code?`Forced retry: ${$.code}`:"Forced retry",I?{cause:I}:void 0);this.customDelay=$?.delay,this.code=$?.code,this.customRequest=$?.request}}class sP extends Error{name="SchemaValidationError";issues;constructor($){super("Response schema validation failed");this.issues=$}}class b$ extends $5{name="TimeoutError";request;constructor($){super(`Request timed out: ${$.method} ${$.url}`);this.request=$}}var eP=(()=>{let $=!1,I=!1,q=typeof globalThis.ReadableStream==="function",U=typeof globalThis.Request==="function";if(q&&U)try{I=new globalThis.Request("https://empty.invalid",{body:new globalThis.ReadableStream,method:"POST",get duplex(){return $=!0,"half"}}).headers.has("Content-Type")}catch(Y){if(Y instanceof Error&&Y.message==="unsupported BodyInit type")return!1;throw Y}return $&&!I})(),Ec=typeof globalThis.AbortController==="function",ZH=typeof globalThis.AbortSignal==="function"&&typeof globalThis.AbortSignal.any==="function",Bc=typeof globalThis.ReadableStream==="function",vc=typeof globalThis.FormData==="function",XH=["get","post","put","patch","head","delete"],Iv0=()=>{return};Iv0();var Rc={json:"application/json",text:"text/*",formData:"multipart/form-data",arrayBuffer:"*/*",blob:"*/*",bytes:"*/*"},Uq=2147483647,Cc=40,DH=Symbol("stop");class OH{options;constructor($){this.options=$}}var _c=($)=>new OH($),hc={json:!0,parseJson:!0,stringifyJson:!0,searchParams:!0,baseUrl:!0,prefix:!0,retry:!0,timeout:!0,totalTimeout:!0,hooks:!0,throwHttpErrors:!0,onDownloadProgress:!0,onUploadProgress:!0,fetch:!0,context:!0},Sc={method:!0,headers:!0,body:!0,mode:!0,credentials:!0,cache:!0,redirect:!0,referrer:!0,referrerPolicy:!0,integrity:!0,keepalive:!0,signal:!0,window:!0,duplex:!0};var LH=new TextEncoder,qv0=($)=>{if(!$)return 0;if($ instanceof FormData){let I=0;for(let[q,U]of $)I+=Cc,I+=LH.encode(`Content-Disposition: form-data; name="${q}"`).byteLength,I+=typeof U==="string"?LH.encode(U).byteLength:U.size;return I}if($ instanceof Blob)return $.size;if($ instanceof ArrayBuffer||ArrayBuffer.isView($))return $.byteLength;if(typeof $==="string")return LH.encode($).byteLength;if($ instanceof URLSearchParams)return LH.encode($.toString()).byteLength;return 0},yc=($,I,q)=>{let U,Y=0;return $.pipeThrough(new TransformStream({transform(J,Q){if(Q.enqueue(J),U){Y+=U.byteLength;let K=I===0?0:Y/I;if(K>=1)K=1-Number.EPSILON;q?.({percent:K,totalBytes:Math.max(I,Y),transferredBytes:Y},U)}U=J},flush(){if(U)Y+=U.byteLength,q?.({percent:1,totalBytes:Math.max(I,Y),transferredBytes:Y},U)}}))},uc=($,I)=>{if(!$.body)return $;let q={status:$.status,statusText:$.statusText,headers:$.headers};if($.status===204)return new Response(null,q);let U=Math.max(0,Number($.headers.get("content-length"))||0);return new Response(yc($.body,U,I),q)},xc=($,I,q)=>{if(!$.body)return $;let U=qv0(q??$.body);return new Request($,{duplex:"half",body:yc($.body,U,I)})};var G8=($)=>$!==null&&typeof $==="object";var Uv0=Symbol("replaceOption"),$T=($)=>G8($)&&$[Uv0]===!0?{isReplace:!0,value:$.value}:{isReplace:!1,value:$};var $Q=(...$)=>{for(let I of $)if( Line truncated
`,{mode:384}),I}function Gq($,I,q=[]){let U=I.corpId?.trim()||void 0,Y=I.stateful?I.defaultCorpId?.trim()||void 0:void 0,J=U??Y;if(J){let K=$.find((z)=>z.id===J);if(K)return K;throw Error(`No enterprise config found for ${J}`)}if(!I.stateful)throw Error("Stateless mode is enabled. Every enterprise command requires --corp <corpId>. Use `seal-home config mode stateful` to enable a default enterprise.");let Q=$[0];if(Q)return Q;throw Error("No enterprise config found. Add a non-example JSON file under one of: "+(q.length?q.join(", "):"the configured enterprise directories"))}import{readFileSync as qz1}from"node:fs";import{randomBytes as Uz1}from"node:crypto";import{randomBytes as td}from"node:crypto";var sv0=Z.object({staffId:Z.string(),name:Z.string().optional(),code:Z.string().default(""),bindTime:Z.number().optional()}),ev0=Z.object({id:Z.string(),tenantId:Z.string(),name:Z.string(),isAdmin:Z.boolean().default(!1),permissions:Z.array(Z.string()).default([]),providerUserId:Z.string().optional(),hosecloudStaff:sv0.optional()}),$R0=Z.object({apiKey:Z.string().optional(),corporationId:Z.string().optional(),corporationName:Z.string().optional()}),IR0=Z.object({id:Z.string(),name:Z.string(),tenantSlug:Z.string().optional(),isDemo:Z.boolean().default(!1),logoUrl:Z.string().nullable().optional(),hoseCorpConfig:$R0.optional()}),Bd=Z.object({user:ev0,tenant:IR0}),qR0=Z.object({id:Z.string(),name:Z.string(),email:Z.string().nullable().optional(),emailVerified:Z.boolean().optional(),image:Z.string().nullable().optional(),tenantId:Z.string().optional(),provider:Z.string().optional(),providerUserId:Z.string().optional(),mobile:Z.string().nullable().optional(),status:Z.string().optional(),permissions:Z.array(Z.string()).default([]),isAdmin:Z.boolean().default(!1),hosecloudStaff:Z.unknown().optional()}).passthrough(),UR0=Z.object({id:Z.string(),token:Z.string().optional(),expiresAt:Z.string(),createdAt:Z.string().optional(),updatedAt:Z.string().optional(),ipAddress:Z.string().optional(),userAgent:Z.string().optional(),userId:Z.string(),delegationId:Z.string().nullable().optional()}).passthrough(),vd=Z.object({user:qR0,session:UR0}),SH=Z.object({id:Z.string(),tenantId:Z.string().optional(),code:Z.number().optional(),description:Z.string(),scope:Z.string(),strictness:Z.string(),status:Z.string().optional(),createdAt:Z.number().optional(),updatedAt:Z.number().optional()}),Rd=Z.object({rules:Z.array(SH),hasPendingDeletes:Z.boolean().default(!1)}),YR0=Z.object({code:Z.string().optional(),description:Z.string(),scope:Z.string(),strictness:Z.string()}),yH=Z.object({id:Z.string(),tenantId:Z.string().optional(),versionNumber:Z.number(),versionName:Z.string().nullable().optional(),publishedBy:Z.string().nullable().optional(),publishedByName:Z.string().nullable().optional(),rules:Z.array(YR0).default([]),publishedAt:Z.number().optional(),createdAt:Z.number().optional()}),Cd=Z.object({version:yH,rulesCount:Z.number()}),zQ=Z.object({id:Z.string(),tenantId:Z.string().optional(),title:Z.string(),purpose:Z.string().default(""),contentType:Z.string().default("policy"),content:Z.string(),status:Z.string().default("published"),enabled:Z.boolean().default(!0),scenarios:Z.array(Z.string()).default([]),tags:Z.array(Z.string()).default([]),category:Z.string().nullable().optional(),categoryTags:Z.array(Z.string()).default([]),createdBy:Z.string().nullable().optional(),createdByName:Z.string().nullable().optional(),createdAt:Z.number().optional(),updatedAt:Z.number().optional(),updatedBy:Z.string().nullable().optional(),updatedByName:Z.string().nullable().optional(),isDeleted:Z.boolean().default(!1)}),_d=Z.object({articles:Z.array(zQ),total:Z.number().optional()}),JR0=Z.object({explicitApprove:Z.string().default(""),explicitReject:Z.string().default(""),exemptApprove:Z.string().default(""),review:Z.string().default("")}).passthrough(),QR0=Z.object({type:Z.string(),signKey:Z.string().optional(),outboundName:Z.string().optional(),mode:Z.string().optional(),autoApprovalRate:Z.number().optional(),apiKey:Z.string().optional(),apiSecret:Z.string().optional(),apiOrigin:Z.string().optional(),corporationId:Z.string().optional(),ebotSignKey:Z.string().optional(),completionSignKey:Z.string().optional(),outboundMessageId:Z.string().optional(),completionMessageId:Z.string().optional()}).passthrough(),KR0=Z.enum(["assisted","semi_automatic","fully_automatic"]),Ed=Z.object({id:Z.string(),url:Z.string().url()}).passthrough(),wQ=Z.object({type:Z.literal("webhook"),id:Z.string(),name:Z.string(),mode:KR0,incomingDocumentWebhook:Ed,outgoingResultWebhook:Z.string().url(),incomingManualResultWebhook:Ed,secret:Z.string().min(1),autoApprovalRate:Z.number().int().min(0).max(100).optional()}).passthrough(),LT=Z.object({id:Z.string().optional(),tenantId:Z.string().optional(),tone:Z.string().optional(),language:Z.string().optional(),detailLevel:Z.string().optional(),outputFormat:Z.string().optional(),examples:Z.array(Z.string()).default([]),prohibitedPhrases:Z.array(Z.strin Line truncated
`,"utf8"),q}function pl($){return $.map((I,q)=>{let U;if(typeof I.code==="number")U=`#${String(I.code).padStart(4,"0")}`;else if(typeof I.code==="string")U=I.code.startsWith("#")?I.code:`#${I.code}`;else U=`#${String(q+1).padStart(4,"0")}`;return{id:I.id,code:U,name:I.name,description:I.description,scope:I.scope,strictness:I.strictness}})}class k7 extends Error{errors;warnings;constructor($,I=[]){super(`材料包校验失败:${$.length} 个错误`);this.errors=$;this.warnings=I;this.name="MaterialPackValidationError"}}import{createHmac as oR0,randomBytes as rR0}from"node:crypto";function tR0($,I,q,U){return oR0("sha256",U).update(`${$}.${I}.${JSON.stringify(q)}`).digest("hex")}function bT($,I){let q=Math.floor(Date.now()/1000),U=rR0(16).toString("hex");return{Authorization:`Bearer ${I}`,"x-webhook-signature":tR0(q,U,$,I),"x-webhook-timestamp":String(q),"x-webhook-nonce":U}}var Cj=RY(wm(),1),sm=RY(am(),1);var KV={maxEntries:1000,maxTotalSize:524288000,maxCompressionRatio:150};async function em($){return new Promise((I,q)=>{Cj.default.fromBuffer(Buffer.from($),{lazyEntries:!0,autoClose:!0},(U,Y)=>{if(U||!Y)return q(U??Error("无法打开 ZIP"));let J=[];Y.readEntry(),Y.on("entry",(Q)=>{let K=$o(Q);if(!K.endsWith("/")&&!T_0(K))J.push({fileName:K,uncompressedSize:Q.uncompressedSize,compressedSize:Q.compressedSize,raw:Q});Y.readEntry()}),Y.on("end",()=>I(J)),Y.on("error",q)})})}function $o($){if($.fileNameUTF8||$.generalPurposeBitFlag&2048)return $.fileNameUTF8??$.fileName;let I=Buffer.from(String($.fileName),"binary"),q=I.toString("utf8");if(q.includes("�")||/[\u0080-\u00FF]/.test(q)){let U=sm.default.decode(I,"gbk");if(!U.includes("�"))return U}return q}function T_0($){let I=$.split("/").pop()??"";return $.split("/").includes("__MACOSX")||I===".DS_Store"||I.startsWith("._")||I.startsWith(".~")||I.startsWith("~$")}function Io($){let I=[];if($.length>KV.maxEntries)I.push(`文件数超过 ${KV.maxEntries}`);if($.reduce((Y,J)=>Y+J.uncompressedSize,0)>KV.maxTotalSize)I.push("解压后总大小超过 500MB");for(let Y of $){if(Y.fileName.startsWith("/")||Y.fileName.split("/").includes(".."))I.push(`存在不安全路径: ${Y.fileName}`);if(Y.compressedSize>0&&Y.uncompressedSize/Y.compressedSize>KV.maxCompressionRatio)I.push(`压缩比超过 150: ${Y.fileName}`)}if(!$.find((Y)=>Y.fileName==="信息表.xlsx"))I.push("ZIP 根目录缺少精确名为「信息表.xlsx」的文件");if($.some((Y)=>Y.fileName.toLowerCase().endsWith(".zip")))I.push("不允许嵌套 ZIP");if(I.length)throw new k7(I)}function _j($,I){return new Promise((q,U)=>{Cj.default.fromBuffer(Buffer.from($),{lazyEntries:!0,autoClose:!0},(Y,J)=>{if(Y||!J)return U(Y??Error("无法打开 ZIP"));J.readEntry(),J.on("entry",(Q)=>{if($o(Q)!==I.fileName)return J.readEntry();J.openReadStream(Q,(K,z)=>{if(K||!z)return U(K??Error(`无法读取 ${I.fileName}`));let w=[];z.on("data",(G)=>w.push(G)),z.on("end",()=>q(Buffer.concat(w))),z.on("error",U)})}),J.on("error",U)})})}var jV0=RY(PV0(),1);function aD($,I,q,U){return{key:$,label:I,type:q,value:U}}function EV0($,I,q){return aD($,I,"TEXT",q==null?"":String(q))}function BV0($,I,q){return aD($,I,"AMOUNT",typeof q==="number"?{amount:q,currency:"CNY"}:null)}function vV0($){if($ instanceof Date)return $.toISOString();if(typeof $==="string"&&$.trim())return $.trim();return null}function uK1($){if($ instanceof Date)return Math.floor($.getTime()/1000);if(typeof $==="string"&&$.trim()){let I=Date.parse($.trim().replace(" ","T"));if(Number.isFinite(I))return Math.floor(I/1000)}return null}function DY($){let I=new Map;return $.getRow(1).eachCell((q,U)=>I.set(String(q.value??"").trim(),U)),I}function OY($,I,q){let U=I.get(q);return U?$.getCell(U).value:void 0}function xK1($,I){return[["会议编号","meeting_id","TEXT"],["会议名称","meeting_name","TEXT"],["状态","status","TEXT"],["总金额","total_amount","AMOUNT"],["税前劳务总额","pretax_labor_total","AMOUNT"],["报销事由","reimbursement_reason","TEXT"],["po码","po_code","TEXT"],["快递单号","tracking_number","TEXT"],["申请日期","application_date","DATE"],["更新日期","updated_date","DATE"]].flatMap(([U,Y,J])=>{let Q=OY($,I,U);if(Q==null||Q==="")return[];return[J==="TEXT"?EV0(Y,U,Q):J==="AMOUNT"?BV0(Y,U,Q):aD(Y,U,J,vV0(Q))]})}function TV0($,I,q){return q.flatMap(([U,Y,J])=>{let Q=OY($,I,U);if(Q==null||Q==="")return[];return[J==="TEXT"?EV0(Y,U,Q):J==="AMOUNT"?BV0(Y,U,Q):aD(Y,U,J,vV0(Q))]})}var kK1=[["姓名","name","TEXT"],["身份证号码","id_number","TEXT"],["手机号","phone","TEXT"],["劳务费用","labor_fee","AMOUNT"],["税前费用","pretax_fee","AMOUNT"],["开户行","bank","TEXT"],["支行名称","branch_name","TEXT"],["联行号","bank_code","TEXT"],["银行卡号","bank_card_number","TEXT"]],fK1=[["报销金额","reimbursement_amount","AMOUNT"],["费用类型","expense_type","TEXT"],["发生时间","occurrence_time","DATE"],["收款人","payee","TEXT"],["开户行","bank","TEXT"],["支行名称","branch_name","TEXT"],["支行行 Line truncated
`);return{recordId:$.id,sourceDocumentSN:$.sourceDocumentSN,sourceDocumentId:$.sourceDocumentId,document:W7({id:I?.id,sn:I?.sn??I?.sourceDocumentSN??$.sourceDocumentSN,title:I?.title??I?.name,template:KO(I,["template.name","templateName","form.name","formName","formTitle"]),amount:JO(q,["金额","报销金额","付款金额","合计","价税合计"])??KO(I,["amount","totalAmount","expenseAmount"]),expenseType:JO(q,["费用类型","费用类别","报销类型"]),costCompany:JO(q,["费用承担公司","承担公司","成本中心","费用归属"]),payee:JO(q,["收款方","收款账户","收款信息","开户名","银行账号"]),keyFields:q.slice(0,30)}),invoices:Mz1($),attachments:pW0($,{summary:!0}).attachments,aiResult:wO($),manualResult:$I($)?.value,hints:W7({amountMentions:CW0(U,["金额","合计","税率"],8),partyMentions:CW0(U,["买方","卖方","甲方","乙方","收款"],8)})}}function pW0($,I={}){let q=[["document",$.document],["result",$.result],["pipelineData",$.pipelineData],["sourceExtendData",$.sourceExtendData]],U=[],Y=new Set;for(let[J,Q]of q)ey(Q,J,U,Y);return{recordId:$.id,sourceDocumentSN:$.sourceDocumentSN,sourceDocumentId:$.sourceDocumentId,count:U.length,attachments:I.summary?U.map((J)=>W7({path:J.path,kind:J.kind,fileName:J.fileName,mimeType:J.mimeType,fileId:J.fileId,sourceField:J.sourceField})):U}}function Xz1($){let I=[["result.citedRules",n5($,"result.citedRules")],["result.matchedRules",n5($,"result.matchedRules")],["result.ruleResults",n5($,"result.ruleResults")],["result.rules",n5($,"result.rules")],["pipelineData.citedRules",n5($,"pipelineData.citedRules")],["pipelineData.matchedRules",n5($,"pipelineData.matchedRules")]],q=[],U=new Set;for(let[Y,J]of I)(Array.isArray(J)?J:J&&typeof J==="object"?Object.values(J):[]).forEach((K,z)=>{let w=NY(K);if(!w)return;let G=b0(w.runtimeRuleId)??b0(w.runtimeId)??b0(w.id)??b0(w.ruleId),H=b0(w.ruleCode)??b0(w.code)??(G?Pz1(G):void 0),W=W7({runtimeRuleId:G,ruleCode:H,versionNumber:Nz1(w.versionNumber)??$.ruleSetVersionNumber,scope:b0(w.scope),strictness:b0(w.strictness),appliedAnalysis:w.appliedAnalysis??w.analysis??w.reasoning,checkResult:w.checkResult??w.result??w.decision,findings:w.findings??w.riskPoints??w.evidence,sourcePath:`${Y}.${z}`}),V=JSON.stringify(W);if(!U.has(V))U.add(V),q.push(W)});return{recordId:$.id,sourceDocumentSN:$.sourceDocumentSN,sourceDocumentId:$.sourceDocumentId,ruleSetVersionNumber:$.ruleSetVersionNumber,count:q.length,rules:q}}function ey($,I,q,U){if(Array.isArray($)){$.forEach((J,Q)=>ey(J,`${I}.${Q}`,q,U));return}let Y=NY($);if(!Y)return;if(Dz1(Y,I)){let J=W7({path:I,fieldPath:I,kind:Oz1(I,Y),fileName:b0(Y.fileName)??b0(Y.filename)??b0(Y.name)??b0(Y.originalName),mimeType:b0(Y.mimeType)??b0(Y.mimetype)??b0(Y.contentType),fileId:b0(Y.fileId)??b0(Y.id)??b0(Y.attachmentId),ossPath:b0(Y.ossPath)??b0(Y.ossKey)??b0(Y.key),url:b0(Y.url)??b0(Y.signedUrl)??b0(Y.downloadUrl)??b0(Y.previewUrl),invoiceId:b0(Y.invoiceId),sourceField:b0(Y.fieldName)??b0(Y.label)}),Q=JSON.stringify(J);if(!U.has(Q))U.add(Q),q.push(J)}for(let[J,Q]of Object.entries(Y))ey(Q,`${I}.${J}`,q,U)}function Dz1($,I){let q=Object.keys($).map((J)=>J.toLowerCase());return/(attachment|attachments|invoice|receipt|file|files|附件|发票)/i.test(I)&&["filename","fileName","mimeType","mimetype","contentType","fileId","ossPath","signedUrl","downloadUrl","previewUrl","attachmentId"].some((J)=>q.includes(J.toLowerCase()))}function Oz1($,I){let q=`${$} ${b0(I.type)??""}`.toLowerCase();if(q.includes("invoice")||q.includes("发票"))return"invoice";if(q.includes("receipt"))return"receipt";return"attachment"}function KO($,I){if(!$)return;for(let q of I){let U=n5($,q);if(U!==void 0)return U}return}function RW0($,I){if(!$)return 0;for(let q of I){let U=n5($,q);if(Array.isArray(U))return U.length;if(U&&typeof U==="object")return Object.keys(U).length;if(typeof U==="number")return U}return 0}function n5($,I){return I.split(".").reduce((q,U)=>{if(q===void 0||q===null)return;if(Array.isArray(q)){let Y=Number(U);return Number.isInteger(Y)?q[Y]:void 0}if(typeof q==="object")return q[U];return},$)}function Lz1($,I,q){let U=I.split("."),Y=$;for(let J of U.slice(0,-1)){let Q=Y[J];if(!Q||typeof Q!=="object"||Array.isArray(Q))Y[J]={};Y=Y[J]}Y[U[U.length-1]??I]=q}function W7($){return Object.fromEntries(Object.entries($).filter(([,I])=>I!==void 0))}function NY($){return $&&typeof $==="object"&&!Array.isArray($)?$:void 0}function Nz1($){return typeof $==="number"&&Number.isFinite($)?$:void 0}function Fz1($){let I=[];return $u($,"document",I),I}function $u($,I,q){if(Array.isArray($)){$.forEach((Q,K)=>$u(Q,`${I}.${K}`,q));return}let U=NY($);if(!U)return;let Y=b0(U.label)??b0(U.name)??b0(U.title)??b0(U.fieldName),J=U.value??U.displayValue??U.text??U.content;if(Y&&J!==void 0&&typeof J!=="object")q.push(W7({path:I,label:Y,value:J,type:b0(U.type)??b0(U.fieldType)}));for(let[Q,K]of Object.entries(U)){if(Q==="attachments")continue;$u(K,`${I}.${Q}`,q)}}function JO($,I){return $.find((U)=>{let Line truncated
`)}
`}function zu(n){return n.replace(/([?&](?:accessToken|token|returnToken)=)[^&\s]+/gi,"$1<redacted>").replace(/(Bearer\s+)[A-Za-z0-9._~+/=-]+/gi,"$1<redacted>")}function B(n,i={}){gP(n,i);let r=`${JSON.stringify(n,null,2)}
`;if(i.outputFile){lP(i.outputFile,r),console.log(JSON.stringify({outputFile:i.outputFile,bytes:Buffer.byteLength(r,"utf-8")},null,2));return}console.log(r.trimEnd())}function gP(n,i={}){if(i.allowFull||i.outputFile)return;let r=Buffer.byteLength(JSON.stringify(n),"utf-8");if(r>IP)throw Error(`Output is large (${r} bytes). Use --summary, --fields, --count, or --output-file; pass --full only when you really need the full response.`)}function UL(n,i){if(i)return;let r=n&&typeof n==="object"?n:{},o=typeof r.count==="number"?r.count:void 0,t=Array.isArray(r.rules)?r.rules.length:void 0,u=Buffer.byteLength(JSON.stringify(n),"utf-8"),e=o??t??0;if(e>vP||u>$P)throw Error(`Rule list is large (${e} rules, ${u} bytes). Use "seal-use rules list --summary" or "seal-use rules count"; pass --full only when you really need full descriptions.`)}function j(n){return{allowFull:E(n.full)===!0,outputFile:U(n.outputFile)??U(n["output-file"])}}function DL(){console.log(`seal-use CLI
`}function Wz($){return $.replace(/([?&](?:accessToken|token|returnToken)=)[^&\s]+/gi,"$1<redacted>").replace(/(Bearer\s+)[A-Za-z0-9._~+/=-]+/gi,"$1<redacted>")}function R0($,I={}){xz1($,I);let q=`${JSON.stringify($,null,2)}
`;if(I.outputFile){hz1(I.outputFile,q),console.log(JSON.stringify({outputFile:I.outputFile,bytes:Buffer.byteLength(q,"utf-8")},null,2));return}console.log(q.trimEnd())}function xz1($,I={}){if(I.allowFull||I.outputFile)return;let q=Buffer.byteLength(JSON.stringify($),"utf-8");if(q>uz1)throw Error(`Output is large (${q} bytes). Use --summary, --fields, --count, or --output-file; pass --full only when you really need the full response.`)}function qZ0($,I){if(I)return;let q=$&&typeof $==="object"?$:{},U=typeof q.count==="number"?q.count:void 0,Y=Array.isArray(q.rules)?q.rules.length:void 0,J=Buffer.byteLength(JSON.stringify($),"utf-8"),Q=U??Y??0;if(Q>Sz1||J>yz1)throw Error(`Rule list is large (${Q} rules, ${J} bytes). Use "seal-use rules list --summary" or "seal-use rules count"; pass --full only when you really need full descriptions.`)}function O0($){return{allowFull:S0($.full)===!0,outputFile:x($.outputFile)??x($["output-file"])}}function UZ0(){console.log(`seal-use CLI
Usage:
seal-use version
@@ -127,6 +364,8 @@ Usage:
seal-use webhook add --name <name> --result-url <url> [--mode assisted|semi_automatic|fully_automatic] [--auto-approval-rate 60] [--secret <secret>] [--corp <corpId>]
seal-use webhook update <idOrName> [--name <name>] [--result-url <url>] [--mode assisted|semi_automatic|fully_automatic] [--auto-approval-rate 60] [--secret <secret>|--rotate-secret] [--corp <corpId>]
seal-use webhook delete <idOrName> --yes [--corp <corpId>]
seal-use webhook material-pack preview <材料包.zip|信息表.xlsx> [--corp <corpId>]
seal-use webhook material-pack push <材料包.zip|信息表.xlsx> --webhook <idOrName> [--corp <corpId>]
seal-use deploy hosecloud requirements [--corp <corpId>]
seal-use deploy hosecloud list [--corp <corpId>]
seal-use deploy hosecloud get <sign-key> [--corp <corpId>]
@@ -176,12 +415,12 @@ Usage:
seal-use simulation templates [--corp <corpId>]
seal-use simulation integrations [--corp <corpId>]
seal-use simulation package-upload <材料包.zip> [--corp <corpId>]
`)}function Nn(n){let i=Hi(),r=Vn();return xr(i,{stateful:r.stateful,defaultCorpId:r.defaultCorpId,corpId:n},Tt())}function Cu(n=Vn()){return{mode:n.stateful?"stateful":"stateless",stateful:n.stateful,...n.stateful&&n.defaultCorpId?{defaultCorpId:n.defaultCorpId}:{},lint:n.lint,configFile:mr()}}async function J(n,i,r,o,t={}){B(await no(n,i,r,o),t)}async function no(n,i,r,o){let t=qu.find((l)=>l.name===n);if(!t)throw Error(`Unknown Seal tool: ${n}`);let u=Object.fromEntries(Object.entries(o).filter(([,l])=>l!==void 0)),e=t.handler;return e(i,u,{corp:r})}async function SL(n,i,r,o,t){if(n==="summary"){let u=await no("seal_approval_runs_summary",r,o,{date:U(t.options.date),timezone:U(t.options.timezone),limit:en(t.options.limit),startDate:U(t.options.startDate),endDate:U(t.options.endDate),status:U(t.options.status),taskMode:U(t.options.taskMode),manualApprovalStatus:U(t.options.manualApprovalStatus),sourceDocumentSN:U(t.options.sourceDocumentSN),sourceDocumentId:U(t.options.sourceDocumentId),humanResult:U(t.options.humanResult),query:U(t.options.query)});if(u?.matched===0&&u?.total>0)console.error(`提示:在 ${u.date} 未匹配到记录(该企业共有 ${u.total} 条历史记录)。可使用 --date YYYY-MM-DD 指定日期,或运行 seal-use approval-runs list --limit 10 查看最近记录。`);B(u,j(t.options));return}if(n==="stats"){await J("seal_approval_runs_stats",r,o,{since:U(t.options.since),dedupeBy:U(t.options.dedupeBy)??U(t.options["dedupe-by"]),status:U(t.options.status),sourceSystem:U(t.options.sourceSystem)??U(t.options["source-system"]),taskMode:U(t.options.taskMode)??U(t.options["task-mode"])},j(t.options));return}if(n==="count"){await J("seal_approval_runs_count",r,o,{status:U(t.options.status),sourceSystem:U(t.options.sourceSystem)??U(t.options["source-system"]),taskMode:U(t.options.taskMode)??U(t.options["task-mode"]),search:U(t.options.search)??U(t.options.query)},j(t.options));return}if(n==="search"||n==="list"){await J("seal_approval_runs_search",r,o,{limit:en(t.options.limit),offset:en(t.options.offset),startDate:U(t.options.startDate),endDate:U(t.options.endDate),status:U(t.options.status),taskMode:U(t.options.taskMode),manualApprovalStatus:U(t.options.manualApprovalStatus),sourceDocumentSN:U(t.options.sourceDocumentSN),sourceDocumentId:U(t.options.sourceDocumentId),humanResult:U(t.options.humanResult),query:U(t.options.query),includeBridge:E(t.options.includeBridge)},j(t.options));return}if(n==="bridge"){await J("seal_approval_run_langfuse_bridge_get",r,o,{recordId:U(t.options.recordId),sourceDocumentSN:U(t.options.sourceDocumentSN),sourceDocumentId:U(t.options.sourceDocumentId),simulationBatchId:U(t.options.simulationBatchId),limit:en(t.options.limit)},j(t.options));return}if(n==="pick"){let u=i??U(t.options.query)??U(t.options.sn);if(!u)throw Error("Usage: seal-use approval-runs pick --sn <documentSN>");await J("seal_approval_run_pick",r,o,{query:u,sn:U(t.options.sn),batchId:U(t.options.batch)??U(t.options.batchId),latest:E(t.options.latest),fields:U(t.options.fields),limit:en(t.options.limit),includeBridge:E(t.options.includeBridge)},j(t.options));return}if(n==="get"){let u=t.command[2];if(!u)throw Error("Missing approval run recordId");await J("seal_approval_run_get",r,o,{recordId:u,fields:U(t.options.fields),summary:E(t.options.summary)},j(t.options));return}if(n==="cited-rules"){let u=t.command[2];if(!u)throw Error("Usage: seal-use approval-runs cited-rules <recordId>");await J("seal_approval_run_cited_rules_get",r,o,{recordId:u},j(t.options));return}if(n==="document-summary"){let u=t.command[2];if(!u)throw Error("Usage: seal-use approval-runs document-summary <recordId>");await J("seal_approval_run_document_summary_get",r,o,{recordId:u},j(t.options));return}if(n==="attachments"){let u=t.command[2];if(!u)throw Error("Usage: seal-use approval-runs attachments <recordId>");await J("seal_approval_run_attachments_get",r,o,{recordId:u,summary:E(t.options.summary)},j(t.options));return}if(n==="result"){let u=t.command[2];if(!u)throw Error("Usage: seal-use approval-runs result <recordId> [--summary]");await J("seal_approval_run_result_get",r,o,{recordId:u,summary:E(t.options.summary)},j(t.options));return}if(n==="url"){await J("seal_approval_run_url_get",r,o,{recordId:i,sourceDocumentSN:U(t.options.sourceDocumentSN),sourceDocumentId:U(t.options.sourceDocumentId)},j(t.options));return}throw Error(`Unknown approval-runs command: ${n??""}. Run 'seal-use help' for available commands.`)}async function kL(n,i,r){if(n==="diagnose"){B(await bP(i));return}if(n==="hose-link"){let o=en(r.options.expire)??7200;B(await vO(i,o));return}throw Error(`Unknown auth command: ${n??""}. Run 'seal-use help' for available commands.`)}async function bP(n){if(n.source.type!=="hose"){let c=await dn(n),S=await Qi(c);return{corp:{id:n.id,name:n.name,sourceType:n.source.type},ok:!0,stages:[{name:"seal.whoami",ok:!0,user:S.user,tenant:S.tenant}]}}Fv(n.id);let i=n.source,r=i.appKey??i.key,o=i.appSecurity??i.p Line truncated
- `);throw Error(`Missing required parameter: staffId. Found ${Wn.length} candidate administrators:
- ${pn}
Please specify 'staffId', 'staffName', or 'staffPhone' to explicitly select an account (or pass force:true to bypass).`)}}}if(!S)if(!g&&u)S=u;else throw Error("Missing required parameter: staffId (or proxyStaffBizId). Run 'seal-use corps hose-staffs' to discover available administrators.");let k=Un(n,"id")??f,O=w??f,F=Un(n,"sealUrl")??`https://${f.toLowerCase()}.sealai.cc`,Q={id:k,name:O,seal:{url:F,endpoints:{approvalStylePreferences:"api/v1/agent/ai-approval/config"}},source:{type:"hose",domain:b,appKey:r,appSecurity:o,corpId:f,staffId:S},auth:{refreshTtl:300}};if(g)Fv(k),await io(Q);let W=$0();pL(W,{recursive:!0,mode:448});let y=JL(W,`${V0(k)}.json`);if(WL(y)&&n.overwrite!==!0)throw Error(`Enterprise config already exists: ${y}. Pass "overwrite": true to replace it.`);jL(y,`${JSON.stringify(Q,null,2)}
`,{mode:384}),B({id:k,name:O,corpId:f,domain:b,staffId:S,verified:g,path:y})}async function SP(n){let i=kt(n,"token"),r=(Un(n,"sealUrl")??Un(n,"url")??"").replace(/\/+$/,"");if(!r)throw Error("Missing required JSON field: sealUrl");let o=IL(n,"expiresIn")??2592000,t=n.force===!0||n.verify===!1?!1:!0,u=t?await dP(r,i):void 0;HL(n,{token:i,sealUrl:r,expiresIn:o,verify:t,remote:u})}async function AP(n,i,r){let o=await Kv(n),t=Yu(o.sealUrl,o.token),u=await Qi(t),e={user:u.user,tenant:u.tenant};Pv(o.corpId,e.tenant),HL({id:o.corpId,corpId:o.corpId,name:i,provider:"hosecloud",overwrite:r},{token:o.token,sealUrl:o.sealUrl,expiresIn:o.expiresIn,verify:!0,remote:e})}function HL(n,i){let{token:r,sealUrl:o,expiresIn:t,verify:u,remote:e}=i,l=e?.user,$=e?.tenant,I=Un(n,"tenantSlug")??Ot($?.tenantSlug),g=Un(n,"tenantId")??Ot($?.id),b=Un(n,"tenantName")??Ot($?.name),f=Un(n,"id")??I??g;if(!f)throw Error("Missing required JSON field: id. Seal whoami did not return tenantSlug or tenantId.");let w=Un(n,"staffId")??Ot(l?.providerUserId)??Ot(l?.id)??"seal",c=Un(n,"provider")??Ot(l?.provider)??Ot($?.providerConfig?.provider),S=Un(n,"corpId")??I??g??f,k={id:f,name:Un(n,"name")??b??f,seal:{url:o,tenantSlug:I,endpoints:{approvalStylePreferences:"api/v1/agent/ai-approval/config"}},source:{type:"seal",token:r,sealUrl:o,expiresIn:t,staffId:w,corpId:S,tenantId:g,tenantSlug:I,tenantName:b,providerUserId:Ot(l?.providerUserId),provider:c},auth:{refreshTtl:300}},O=$0();pL(O,{recursive:!0,mode:448});let F=JL(O,`${V0(f)}.json`);if(WL(F)&&n.overwrite!==!0)throw Error(`Enterprise config already exists: ${F}. Pass "overwrite": true to replace it.`);jL(F,`${JSON.stringify(k,null,2)}
`,{mode:384}),B({id:f,name:k.name,tenantId:g,tenantSlug:I,verified:u,path:F})}async function dP(n,i){let r=await kP(`${n}/api/v1/auth/me`,{authorization:`Bearer ${i}`}),o=l$(r.data);return{user:l$(o.user??r.user),tenant:l$(o.tenant??r.tenant)}}async function kP(n,i={}){let r=await fetch(n,{headers:i}),o=await r.text();if(!r.ok)throw Error(`${r.status} ${o}`);let t=JSON.parse(o);return l$(t)}function l$(n){return n&&typeof n==="object"&&!Array.isArray(n)?n:{}}function Ot(n){return typeof n==="string"&&n?n:void 0}async function YL(n,i){let r=await Kv(n),o=Yu(r.sealUrl,r.token),t=await Qi(o);Pv(r.corpId,t.tenant);let u=await ar(o,{note:i});B({tenant:{id:t.tenant.id,name:t.tenant.name,tenantSlug:t.tenant.tenantSlug,corpId:r.corpId},user:{id:t.user.id,name:t.user.name,providerUserId:t.user.providerUserId,isAdmin:t.user.isAdmin},delegation:u,expiresIn:r.expiresIn})}async function QL(n,i,r,o,t){if(n==="list"){await J("seal_delegation_list",r,o,{},j(t.options));return}if(n==="create"){let u=U(t.options.note)??(i?[i,...t.command.slice(2)].join(" "):void 0);await J("seal_delegation_create",r,o,{note:u},j(t.options));return}if(n==="revoke"){let u=i??U(t.options.tokenId);if(!u)throw Error("Usage: seal-use delegation revoke <tokenId>");await J("seal_delegation_revoke",r,o,{tokenId:u},j(t.options));return}throw Error(`Unknown delegation command: ${n??""}. Run 'seal-use help' for available commands.`)}import{readFileSync as OP}from"node:fs";async function FL(n,i,r,o,t,u){if(!n||n==="help")throw Error(`Usage: seal-use deploy <system> <action> [options]
`)}function D4($){let I=H8(),q=H6();return Gq(I,{stateful:q.stateful,defaultCorpId:q.defaultCorpId,corpId:$},y7())}function Zz($=H6()){return{mode:$.stateful?"stateful":"stateless",stateful:$.stateful,...$.stateful&&$.defaultCorpId?{defaultCorpId:$.defaultCorpId}:{},lint:$.lint,configFile:wq()}}async function L0($,I,q,U,Y={}){R0(await II($,I,q,U),Y)}async function II($,I,q,U){let Y=Gz.find((K)=>K.name===$);if(!Y)throw Error(`Unknown Seal tool: ${$}`);let J=Object.fromEntries(Object.entries(U).filter(([,K])=>K!==void 0)),Q=Y.handler;return Q(I,J,{corp:q})}async function YZ0($,I,q,U,Y){if($==="summary"){let J=await II("seal_approval_runs_summary",q,U,{date:x(Y.options.date),timezone:x(Y.options.timezone),limit:$1(Y.options.limit),startDate:x(Y.options.startDate),endDate:x(Y.options.endDate),status:x(Y.options.status),taskMode:x(Y.options.taskMode),manualApprovalStatus:x(Y.options.manualApprovalStatus),sourceDocumentSN:x(Y.options.sourceDocumentSN),sourceDocumentId:x(Y.options.sourceDocumentId),humanResult:x(Y.options.humanResult),query:x(Y.options.query)});if(J?.matched===0&&J?.total>0)console.error(`提示:在 ${J.date} 未匹配到记录(该企业共有 ${J.total} 条历史记录)。可使用 --date YYYY-MM-DD 指定日期,或运行 seal-use approval-runs list --limit 10 查看最近记录。`);R0(J,O0(Y.options));return}if($==="stats"){await L0("seal_approval_runs_stats",q,U,{since:x(Y.options.since),dedupeBy:x(Y.options.dedupeBy)??x(Y.options["dedupe-by"]),status:x(Y.options.status),sourceSystem:x(Y.options.sourceSystem)??x(Y.options["source-system"]),taskMode:x(Y.options.taskMode)??x(Y.options["task-mode"])},O0(Y.options));return}if($==="count"){await L0("seal_approval_runs_count",q,U,{status:x(Y.options.status),sourceSystem:x(Y.options.sourceSystem)??x(Y.options["source-system"]),taskMode:x(Y.options.taskMode)??x(Y.options["task-mode"]),search:x(Y.options.search)??x(Y.options.query)},O0(Y.options));return}if($==="search"||$==="list"){await L0("seal_approval_runs_search",q,U,{limit:$1(Y.options.limit),offset:$1(Y.options.offset),startDate:x(Y.options.startDate),endDate:x(Y.options.endDate),status:x(Y.options.status),taskMode:x(Y.options.taskMode),manualApprovalStatus:x(Y.options.manualApprovalStatus),sourceDocumentSN:x(Y.options.sourceDocumentSN),sourceDocumentId:x(Y.options.sourceDocumentId),humanResult:x(Y.options.humanResult),query:x(Y.options.query),includeBridge:S0(Y.options.includeBridge)},O0(Y.options));return}if($==="bridge"){await L0("seal_approval_run_langfuse_bridge_get",q,U,{recordId:x(Y.options.recordId),sourceDocumentSN:x(Y.options.sourceDocumentSN),sourceDocumentId:x(Y.options.sourceDocumentId),simulationBatchId:x(Y.options.simulationBatchId),limit:$1(Y.options.limit)},O0(Y.options));return}if($==="pick"){let J=I??x(Y.options.query)??x(Y.options.sn);if(!J)throw Error("Usage: seal-use approval-runs pick --sn <documentSN>");await L0("seal_approval_run_pick",q,U,{query:J,sn:x(Y.options.sn),batchId:x(Y.options.batch)??x(Y.options.batchId),latest:S0(Y.options.latest),fields:x(Y.options.fields),limit:$1(Y.options.limit),includeBridge:S0(Y.options.includeBridge)},O0(Y.options));return}if($==="get"){let J=Y.command[2];if(!J)throw Error("Missing approval run recordId");await L0("seal_approval_run_get",q,U,{recordId:J,fields:x(Y.options.fields),summary:S0(Y.options.summary)},O0(Y.options));return}if($==="cited-rules"){let J=Y.command[2];if(!J)throw Error("Usage: seal-use approval-runs cited-rules <recordId>");await L0("seal_approval_run_cited_rules_get",q,U,{recordId:J},O0(Y.options));return}if($==="document-summary"){let J=Y.command[2];if(!J)throw Error("Usage: seal-use approval-runs document-summary <recordId>");await L0("seal_approval_run_document_summary_get",q,U,{recordId:J},O0(Y.options));return}if($==="attachments"){let J=Y.command[2];if(!J)throw Error("Usage: seal-use approval-runs attachments <recordId>");await L0("seal_approval_run_attachments_get",q,U,{recordId:J,summary:S0(Y.options.summary)},O0(Y.options));return}if($==="result"){let J=Y.command[2];if(!J)throw Error("Usage: seal-use approval-runs result <recordId> [--summary]");await L0("seal_approval_run_result_get",q,U,{recordId:J,summary:S0(Y.options.summary)},O0(Y.options));return}if($==="url"){await L0("seal_approval_run_url_get",q,U,{recordId:I,sourceDocumentSN:x(Y.options.sourceDocumentSN),sourceDocumentId:x(Y.options.sourceDocumentId)},O0(Y.options));return}throw Error(`Unknown approval-runs command: ${$??""}. Run 'seal-use help' for available commands.`)}async function KZ0($,I,q){if($==="diagnose"){R0(await kz1(I));return}if($==="hose-link"){let U=$1(q.options.expire)??7200;R0(await Hd(I,U));return}throw Error(`Unknown auth command: ${$??""}. Run 'seal-use help' for available commands.`)}async function kz1($){if($.source.type!=="hose"){let X=await I4($),D=await W8(X);return{corp:{id:$.id,name:$.name,sourceType:$.source.type},ok:!0,stages:[{name:"seal.whoami",ok:!0,user:D.user,tenant:D.tenant}]}}gH($.id);let I=$.source, Line truncated
- `);throw Error(`Missing required parameter: staffId. Found ${S.length} candidate administrators:
- ${t}
Please specify 'staffId', 'staffName', or 'staffPhone' to explicitly select an account (or pass force:true to bypass).`)}}}if(!D)if(!G&&J)D=J;else throw Error("Missing required parameter: staffId (or proxyStaffBizId). Run 'seal-use corps hose-staffs' to discover available administrators.");let O=b1($,"id")??W,N=V??W,T=b1($,"sealUrl")??`https://${W.toLowerCase()}.sealai.cc`,P={id:O,name:N,seal:{url:T,endpoints:{approvalStylePreferences:"api/v1/agent/ai-approval/config"}},source:{type:"hose",domain:H,appKey:q,appSecurity:U,corpId:W,staffId:D},auth:{refreshTtl:300}};if(G)gH(O),await FY(P);let g=OT();ZZ0(g,{recursive:!0,mode:448});let B=DZ0(g,`${Ku(O)}.json`);if(WZ0(B)&&$.overwrite!==!0)throw Error(`Enterprise config already exists: ${B}. Pass "overwrite": true to replace it.`);XZ0(B,`${JSON.stringify(P,null,2)}
`,{mode:384}),R0({id:O,name:N,corpId:W,domain:H,staffId:D,verified:G,path:B})}async function cz1($){let I=Z7($,"token"),q=(b1($,"sealUrl")??b1($,"url")??"").replace(/\/+$/,"");if(!q)throw Error("Missing required JSON field: sealUrl");let U=tW0($,"expiresIn")??2592000,Y=$.force===!0||$.verify===!1?!1:!0,J=Y?await lz1(q,I):void 0;LZ0($,{token:I,sealUrl:q,expiresIn:U,verify:Y,remote:J})}async function dz1($,I,q){let U=await PH($),Y=JQ(U.sealUrl,U.token),J=await W8(Y),Q={user:J.user,tenant:J.tenant};TH(U.corpId,Q.tenant),LZ0({id:U.corpId,corpId:U.corpId,name:I,provider:"hosecloud",overwrite:q},{token:U.token,sealUrl:U.sealUrl,expiresIn:U.expiresIn,verify:!0,remote:Q})}function LZ0($,I){let{token:q,sealUrl:U,expiresIn:Y,verify:J,remote:Q}=I,K=Q?.user,z=Q?.tenant,w=b1($,"tenantSlug")??X7(z?.tenantSlug),G=b1($,"tenantId")??X7(z?.id),H=b1($,"tenantName")??X7(z?.name),W=b1($,"id")??w??G;if(!W)throw Error("Missing required JSON field: id. Seal whoami did not return tenantSlug or tenantId.");let V=b1($,"staffId")??X7(K?.providerUserId)??X7(K?.id)??"seal",X=b1($,"provider")??X7(K?.provider)??X7(z?.providerConfig?.provider),D=b1($,"corpId")??w??G??W,O={id:W,name:b1($,"name")??H??W,seal:{url:U,tenantSlug:w,endpoints:{approvalStylePreferences:"api/v1/agent/ai-approval/config"}},source:{type:"seal",token:q,sealUrl:U,expiresIn:Y,staffId:V,corpId:D,tenantId:G,tenantSlug:w,tenantName:H,providerUserId:X7(K?.providerUserId),provider:X},auth:{refreshTtl:300}},N=OT();ZZ0(N,{recursive:!0,mode:448});let T=DZ0(N,`${Ku(W)}.json`);if(WZ0(T)&&$.overwrite!==!0)throw Error(`Enterprise config already exists: ${T}. Pass "overwrite": true to replace it.`);XZ0(T,`${JSON.stringify(O,null,2)}
`,{mode:384}),R0({id:W,name:O.name,tenantId:G,tenantSlug:w,verified:J,path:T})}async function lz1($,I){let q=await mz1(`${$}/api/v1/auth/me`,{authorization:`Bearer ${I}`}),U=HO(q.data);return{user:HO(U.user??q.user),tenant:HO(U.tenant??q.tenant)}}async function mz1($,I={}){let q=await fetch($,{headers:I}),U=await q.text();if(!q.ok)throw Error(`${q.status} ${U}`);let Y=JSON.parse(U);return HO(Y)}function HO($){return $&&typeof $==="object"&&!Array.isArray($)?$:{}}function X7($){return typeof $==="string"&&$?$:void 0}async function NZ0($,I){let q=await PH($),U=JQ(q.sealUrl,q.token),Y=await W8(U);TH(q.corpId,Y.tenant);let J=await Hq(U,{note:I});R0({tenant:{id:Y.tenant.id,name:Y.tenant.name,tenantSlug:Y.tenant.tenantSlug,corpId:q.corpId},user:{id:Y.user.id,name:Y.user.name,providerUserId:Y.user.providerUserId,isAdmin:Y.user.isAdmin},delegation:J,expiresIn:q.expiresIn})}async function FZ0($,I,q,U,Y){if($==="list"){await L0("seal_delegation_list",q,U,{},O0(Y.options));return}if($==="create"){let J=x(Y.options.note)??(I?[I,...Y.command.slice(2)].join(" "):void 0);await L0("seal_delegation_create",q,U,{note:J},O0(Y.options));return}if($==="revoke"){let J=I??x(Y.options.tokenId);if(!J)throw Error("Usage: seal-use delegation revoke <tokenId>");await L0("seal_delegation_revoke",q,U,{tokenId:J},O0(Y.options));return}throw Error(`Unknown delegation command: ${$??""}. Run 'seal-use help' for available commands.`)}import{readFileSync as oz1}from"node:fs";async function MZ0($,I,q,U,Y,J){if(!$||$==="help")throw Error(`Usage: seal-use deploy <system> <action> [options]
`+`支持的审批系统与发布目标:
`+` • hosecloud (合思费控): seal-use deploy hosecloud <requirements|list|get|status|configure|sync> --corp <corpId>
@@ -189,25 +428,25 @@ Please specify 'staffId', 'staffName', or 'staffPhone' to explicitly select an a
`+` • feishu (飞书审批): 建议使用 Webhook 模式对接
`+` • weaver (泛微 OA): 建议使用 Webhook 模式对接
`+` • helios (汇联易): 建议使用 Webhook 模式对接
`+" • maycur (每刻报销): 建议使用 Webhook 模式对接");if(n==="webhook"||n==="webhooks")throw Error("Webhook 审批流发布请直接使用专有命令:seal-use webhook <list|get|add|update|delete> --corp <corpId>");if(n==="feishu"||n==="lark")throw Error("飞书审批发布:建议使用 Webhook 通用发布模式对接。命令:seal-use webhook add --name '飞书审批' --result-url <url> --corp <corpId>");if(n==="weaver")throw Error("泛微 OA 发布:建议使用 Webhook 通用发布模式对接。命令:seal-use webhook add --name '泛微OA' --result-url <url> --corp <corpId>");if(n==="maycur"||n==="helios"){let I=n==="maycur"?"每刻报销":"汇联易";throw Error(`${I}发布:目前可通过 Webhook 模式接入。命令:seal-use webhook add --name '${I}' --result-url <url> --corp <corpId>`)}let e=n==="hosecloud",l=n==="hosecloud"?i:n,$=n==="hosecloud"?r:i;if(!e)throw Error(`未知的发布目标系统: ${n}。当前支持: hosecloud (合思费控) 与 webhook (通用回调)。`);if(l==="requirements"){await J("seal_deploy_hosecloud_requirements",o,t,{},j(u.options));return}if(l==="list"){await J("seal_deploy_hosecloud_list",o,t,{},j(u.options));return}if(l==="get"){let I=$??U(u.options.signKey)??U(u.options["sign-key"]);if(!I){let b=((await kn(o)).integrations??[]).filter((f)=>f.type==="hosecloud");if(b.length===0)throw Error(`当前企业 (${t.name}) 尚未添加合思发布配置。
`+`\uD83D\uDC49 请先运行配置命令:seal-use deploy hosecloud configure --json '{...}' --corp ${t.id}`);console.error(`Usage: seal-use deploy hosecloud get <sign-key> [--corp ${t.id}]
`),console.error("ℹ️ 当前企业发现以下可用的合思配置卡片:");for(let f of b){let w=f.outboundName??"SealAI 审批",c=f.signKey,S=f.apiOrigin??"production";console.error(` • "${w}" (signKey: ${c}, 环境: ${S})`),console.error(` \uD83D\uDC49 查看命令: seal-use deploy hosecloud get ${c} --corp ${t.id}
`)}throw Error("缺少必需参数 <sign-key>。请从上述候选列表中选择并指定 signKey。")}await J("seal_deploy_hosecloud_get",o,t,{signKey:I},j(u.options));return}if(l==="status"){await J("seal_deploy_hosecloud_status",o,t,{},j(u.options));return}if(l==="configure"){let I=U(u.options.input),g=I?JSON.parse(OP(I,"utf8")):oi(u.json);if(!g||Object.keys(g).length===0)throw Error("Usage: seal-use deploy hosecloud configure --json '{...}' or --input <file>");await J("seal_deploy_hosecloud_configure",o,t,g,j(u.options));return}if(l==="sync"){let I=$??U(u.options.signKey)??U(u.options["sign-key"]),g=E(u.options.auto)??E(u.options.yes);if(!I){let f=((await kn(o)).integrations??[]).filter((w)=>w.type==="hosecloud");if(f.length===0)throw Error(`当前企业 (${t.name}) 尚未添加合思发布配置。
`+`\uD83D\uDC49 请先运行配置命令:seal-use deploy hosecloud configure --json '{...}' --corp ${t.id}`);if(f.length===1&&g){let w=f[0].signKey;console.error(`ℹ️ [auto] 检测到企业仅有 1 个合思配置,已自动选择 (signKey: ${w})`),await J("seal_deploy_hosecloud_sync",o,t,{signKey:w},j(u.options));return}console.error(`Usage: seal-use deploy hosecloud sync <sign-key> [--corp ${t.id}]
`),console.error("ℹ️ 当前企业发现以下可用的合思配置卡片:");for(let w of f){let c=w.outboundName??"SealAI 审批",S=w.signKey,k=w.apiOrigin??"production";console.error(` • "${c}" (signKey: ${S}, 环境: ${k})`),console.error(` \uD83D\uDC49 同步命令: seal-use deploy hosecloud sync ${S} --corp ${t.id}
`)}if(f.length===1)console.error(`\uD83D\uDCA1 提示:若希望单配置自动同步,可附加 --auto 参数:seal-use deploy hosecloud sync --auto --corp ${t.id}
`);throw Error("缺少必需参数 <sign-key>。请从上述候选列表中选择并指定 signKey 执行同步。")}await J("seal_deploy_hosecloud_sync",o,t,{signKey:I},j(u.options));return}throw Error(`Unknown deploy hosecloud action: ${l??""}. Available: requirements, list, get, status, configure, sync.`)}import{createServer as WP}from"node:http";import{URL as LP}from"node:url";var KL={openapi:"3.1.0",info:{title:"seal-use Wrapped API",version:"0.10.5",description:`Planned HTTP contract for the seal-use wrapped backend API.
`+" • maycur (每刻报销): 建议使用 Webhook 模式对接");if($==="webhook"||$==="webhooks")throw Error("Webhook 审批流发布请直接使用专有命令:seal-use webhook <list|get|add|update|delete> --corp <corpId>");if($==="feishu"||$==="lark")throw Error("飞书审批发布:建议使用 Webhook 通用发布模式对接。命令:seal-use webhook add --name '飞书审批' --result-url <url> --corp <corpId>");if($==="weaver")throw Error("泛微 OA 发布:建议使用 Webhook 通用发布模式对接。命令:seal-use webhook add --name '泛微OA' --result-url <url> --corp <corpId>");if($==="maycur"||$==="helios"){let w=$==="maycur"?"每刻报销":"汇联易";throw Error(`${w}发布:目前可通过 Webhook 模式接入。命令:seal-use webhook add --name '${w}' --result-url <url> --corp <corpId>`)}let Q=$==="hosecloud",K=$==="hosecloud"?I:$,z=$==="hosecloud"?q:I;if(!Q)throw Error(`未知的发布目标系统: ${$}。当前支持: hosecloud (合思费控) 与 webhook (通用回调)。`);if(K==="requirements"){await L0("seal_deploy_hosecloud_requirements",U,Y,{},O0(J.options));return}if(K==="list"){await L0("seal_deploy_hosecloud_list",U,Y,{},O0(J.options));return}if(K==="get"){let w=z??x(J.options.signKey)??x(J.options["sign-key"]);if(!w){let H=((await Q4(U)).integrations??[]).filter((W)=>W.type==="hosecloud");if(H.length===0)throw Error(`当前企业 (${Y.name}) 尚未添加合思发布配置。
`+`\uD83D\uDC49 请先运行配置命令:seal-use deploy hosecloud configure --json '{...}' --corp ${Y.id}`);console.error(`Usage: seal-use deploy hosecloud get <sign-key> [--corp ${Y.id}]
`),console.error("ℹ️ 当前企业发现以下可用的合思配置卡片:");for(let W of H){let V=W.outboundName??"SealAI 审批",X=W.signKey,D=W.apiOrigin??"production";console.error(` • "${V}" (signKey: ${X}, 环境: ${D})`),console.error(` \uD83D\uDC49 查看命令: seal-use deploy hosecloud get ${X} --corp ${Y.id}
`)}throw Error("缺少必需参数 <sign-key>。请从上述候选列表中选择并指定 signKey。")}await L0("seal_deploy_hosecloud_get",U,Y,{signKey:w},O0(J.options));return}if(K==="status"){await L0("seal_deploy_hosecloud_status",U,Y,{},O0(J.options));return}if(K==="configure"){let w=x(J.options.input),G=w?JSON.parse(oz1(w,"utf8")):r6(J.json);if(!G||Object.keys(G).length===0)throw Error("Usage: seal-use deploy hosecloud configure --json '{...}' or --input <file>");await L0("seal_deploy_hosecloud_configure",U,Y,G,O0(J.options));return}if(K==="sync"){let w=z??x(J.options.signKey)??x(J.options["sign-key"]),G=S0(J.options.auto)??S0(J.options.yes);if(!w){let W=((await Q4(U)).integrations??[]).filter((X)=>X.type==="hosecloud");if(W.length===0)throw Error(`当前企业 (${Y.name}) 尚未添加合思发布配置。
`+`\uD83D\uDC49 请先运行配置命令:seal-use deploy hosecloud configure --json '{...}' --corp ${Y.id}`);let V=W[0];if(V&&W.length===1&&G){let X=V.signKey;console.error(`ℹ️ [auto] 检测到企业仅有 1 个合思配置,已自动选择 (signKey: ${X})`),await L0("seal_deploy_hosecloud_sync",U,Y,{signKey:X},O0(J.options));return}console.error(`Usage: seal-use deploy hosecloud sync <sign-key> [--corp ${Y.id}]
`),console.error("ℹ️ 当前企业发现以下可用的合思配置卡片:");for(let X of W){let D=X.outboundName??"SealAI 审批",O=X.signKey,N=X.apiOrigin??"production";console.error(` • "${D}" (signKey: ${O}, 环境: ${N})`),console.error(` \uD83D\uDC49 同步命令: seal-use deploy hosecloud sync ${O} --corp ${Y.id}
`)}if(W.length===1)console.error(`\uD83D\uDCA1 提示:若希望单配置自动同步,可附加 --auto 参数:seal-use deploy hosecloud sync --auto --corp ${Y.id}
`);throw Error("缺少必需参数 <sign-key>。请从上述候选列表中选择并指定 signKey 执行同步。")}await L0("seal_deploy_hosecloud_sync",U,Y,{signKey:w},O0(J.options));return}throw Error(`Unknown deploy hosecloud action: ${K??""}. Available: requirements, list, get, status, configure, sync.`)}import{createServer as ez1}from"node:http";import{URL as tz1}from"node:url";var AZ0={openapi:"3.1.0",info:{title:"seal-use Wrapped API",version:"0.10.7",description:`Planned HTTP contract for the seal-use wrapped backend API.
These endpoints describe the intended stable API for frontend developers and agents once
the HTTP adapter is implemented.
They are not the raw downstream Seal endpoints. seal-use is responsible for enterprise
selection, source authentication, response compaction, and diagnostics-friendly fields.
`},servers:[{url:"http://localhost:8787",description:"Reserved for a future local HTTP adapter; the current service uses MCP stdio."}],security:[{localSession:[]}],tags:[{name:"Corps",description:"Local enterprise configuration selection."},{name:"Source",description:"Source-derived Seal enterprise configuration."},{name:"Auth",description:"Wrapped authentication diagnostics and current identity."},{name:"Approval Runs",description:"Wrapped approval run history, summaries, document URLs, and trace bridge helpers."},{name:"Approval Knowledge",description:"Wrapped approval rules, documents, preferences, and search."},{name:"Simulation",description:"Wrapped simulation batch record access."}],paths:{"/v1/corps":{get:{tags:["Corps"],operationId:"listCorps",summary:"List configured enterprises",responses:{"200":{description:"Configured enterprises.",content:{"application/json":{schema:{type:"array",items:{type:"object",required:["id","name","sourceType","current"],properties:{id:{type:"string"},name:{type:"string"},sourceType:{type:"string",enum:["hose","direct","seal"]},current:{type:"boolean"}}}}}}}}}},"/v1/corps/current":{get:{tags:["Corps"],operationId:"getCurrentCorp",summary:"Get current enterprise",description:"Returns the configured default enterprise in stateful mode. Stateless mode has no current enterprise and requires an explicit corpId for enterprise operations.",responses:{"200":{description:"Current enterprise.",content:{"application/json":{schema:{type:"object",required:["id","name","sourceType","current"],properties:{id:{type:"string"},name:{type:"string"},sourceType:{type:"string",enum:["hose","direct","seal"]},current:{type:"boolean"}}}}}}}}},"/v1/corps/current/switch":{post:{tags:["Corps"],operationId:"switchCurrentCorp",summary:"Switch current enterprise",requestBody:{required:!0,content:{"application/json":{schema:{type:"object",required:["corpId"],properties:{corpId:{type:"string"}}}}}},responses:{"200":{description:"Switched enterprise.",content:{"application/json":{schema:{type:"object",required:["current","id","name"],properties:{current:{type:"boolean"},id:{type:"string"},name:{type:"string"}}}}}},"404":{description:"Requested resource was not found.",content:{"application/json":{schema:{type:"object",additionalProperties:!0,required:["error"],properties:{error:{type:"string"},message:{type:"string"},details:{}}}}}}}}},"/v1/source/config":{get:{tags:["Source"],operationId:"getSourceConfig",summary:"Resolve source-derived Seal enterprise config",parameters:[{name:"corpId",in:"query",schema:{type:"string"},description:"Local enterprise config ID. Required when global selection mode is stateless; optional in stateful mode, where the configured default enterprise is used."}],responses:{"200":{description:"Redacted Seal enterprise config.",content:{"application/json":{schema:{type:"object",additionalProperties:!0,description:"Redacted Seal enterprise config resolved from the configured source."}}}},"401":{description:"Local service authentication failed or downstream Seal auth failed.",content:{"application/json":{schema:{type:"object",additionalProperties:!0,required:["error"],properties:{error:{type:"string"},message:{type:"string"},details:{}}}}}}}}},"/v1/auth/diagnose":{get:{tags:["Auth"],operationId:"diagnoseAuth",summary:"Diagnose wrapped source-to-Seal authentication",parameters:[{name:"corpId",in:"query",schema:{type:"string"},description:"Local enterprise config ID. Required when global selection mode is stateless; optional in stateful mode, where the configured default enterprise is used."}],responses:{"200":{description:"Authentication stage diagnosis.",content:{"application/json":{schema:{type:"object",required:["stages"],properties:{stages:{type:"array",items:{$ref:"#/components/schemas/AuthStage"}}}}}}}}}},"/v1/whoami":{get:{tags:["Auth"],operationId:"whoami",summary:"Get current wrapped Seal identity",parameters:[{name:"corpId",in:"query",schema:{type:"string"},description:"Local enterprise config ID. Required when global selection mode is stateless; optional in stateful mode, where the configured default enterprise is used."}],responses:{"200":{description:"Current Seal user and tenant.",content:{"application/json":{schema:{type:"object",required:["user","tenant"],properties:{user:{$ref:"#/components/schemas/SealUser"},tenant:{$ref:"#/components/schemas/SealTenant"}}}}}},"401":{description:"Local service authentication failed or downstream Seal auth failed.",content:{"application/json":{schema:{type:"object",additionalProperties:!0,required:["error"],properties:{error:{type:"string"},message:{type:"string"},details:{}}}}}}}}},"/v1/session":{get:{tags:["Auth"],operationId:"getSession",summary:"Get current wrapped Seal session metadata",parameters:[{name:"corpId",in:"query",schema:{type:"string"},description:"Local enterprise config ID. Required when global selection mode is stateless; optional in stateful mode, where the configured default enterprise is used."}],responses:{"2 Line truncated
`},servers:[{url:"http://localhost:8787",description:"Reserved for a future local HTTP adapter; the current service uses MCP stdio."}],security:[{localSession:[]}],tags:[{name:"Corps",description:"Local enterprise configuration selection."},{name:"Source",description:"Source-derived Seal enterprise configuration."},{name:"Auth",description:"Wrapped authentication diagnostics and current identity."},{name:"Approval Runs",description:"Wrapped approval run history, summaries, document URLs, and trace bridge helpers."},{name:"Approval Knowledge",description:"Wrapped approval rules, documents, preferences, and search."},{name:"Simulation",description:"Wrapped simulation batch record access."}],paths:{"/v1/corps":{get:{tags:["Corps"],operationId:"listCorps",summary:"List configured enterprises",responses:{"200":{description:"Configured enterprises.",content:{"application/json":{schema:{type:"array",items:{type:"object",required:["id","name","sourceType","current"],properties:{id:{type:"string"},name:{type:"string"},sourceType:{type:"string",enum:["hose","direct","seal"]},current:{type:"boolean"}}}}}}}}}},"/v1/corps/current":{get:{tags:["Corps"],operationId:"getCurrentCorp",summary:"Get current enterprise",description:"Returns the configured default enterprise in stateful mode. Stateless mode has no current enterprise and requires an explicit corpId for enterprise operations.",responses:{"200":{description:"Current enterprise.",content:{"application/json":{schema:{type:"object",required:["id","name","sourceType","current"],properties:{id:{type:"string"},name:{type:"string"},sourceType:{type:"string",enum:["hose","direct","seal"]},current:{type:"boolean"}}}}}}}}},"/v1/corps/current/switch":{post:{tags:["Corps"],operationId:"switchCurrentCorp",summary:"Switch current enterprise",requestBody:{required:!0,content:{"application/json":{schema:{type:"object",required:["corpId"],properties:{corpId:{type:"string"}}}}}},responses:{"200":{description:"Switched enterprise.",content:{"application/json":{schema:{type:"object",required:["current","id","name"],properties:{current:{type:"boolean"},id:{type:"string"},name:{type:"string"}}}}}},"404":{description:"Requested resource was not found.",content:{"application/json":{schema:{type:"object",additionalProperties:!0,required:["error"],properties:{error:{type:"string"},message:{type:"string"},details:{}}}}}}}}},"/v1/source/config":{get:{tags:["Source"],operationId:"getSourceConfig",summary:"Resolve source-derived Seal enterprise config",parameters:[{name:"corpId",in:"query",schema:{type:"string"},description:"Local enterprise config ID. Required when global selection mode is stateless; optional in stateful mode, where the configured default enterprise is used."}],responses:{"200":{description:"Redacted Seal enterprise config.",content:{"application/json":{schema:{type:"object",additionalProperties:!0,description:"Redacted Seal enterprise config resolved from the configured source."}}}},"401":{description:"Local service authentication failed or downstream Seal auth failed.",content:{"application/json":{schema:{type:"object",additionalProperties:!0,required:["error"],properties:{error:{type:"string"},message:{type:"string"},details:{}}}}}}}}},"/v1/auth/diagnose":{get:{tags:["Auth"],operationId:"diagnoseAuth",summary:"Diagnose wrapped source-to-Seal authentication",parameters:[{name:"corpId",in:"query",schema:{type:"string"},description:"Local enterprise config ID. Required when global selection mode is stateless; optional in stateful mode, where the configured default enterprise is used."}],responses:{"200":{description:"Authentication stage diagnosis.",content:{"application/json":{schema:{type:"object",required:["stages"],properties:{stages:{type:"array",items:{$ref:"#/components/schemas/AuthStage"}}}}}}}}}},"/v1/whoami":{get:{tags:["Auth"],operationId:"whoami",summary:"Get current wrapped Seal identity",parameters:[{name:"corpId",in:"query",schema:{type:"string"},description:"Local enterprise config ID. Required when global selection mode is stateless; optional in stateful mode, where the configured default enterprise is used."}],responses:{"200":{description:"Current Seal user and tenant.",content:{"application/json":{schema:{type:"object",required:["user","tenant"],properties:{user:{$ref:"#/components/schemas/SealUser"},tenant:{$ref:"#/components/schemas/SealTenant"}}}}}},"401":{description:"Local service authentication failed or downstream Seal auth failed.",content:{"application/json":{schema:{type:"object",additionalProperties:!0,required:["error"],properties:{error:{type:"string"},message:{type:"string"},details:{}}}}}}}}},"/v1/session":{get:{tags:["Auth"],operationId:"getSession",summary:"Get current wrapped Seal session metadata",parameters:[{name:"corpId",in:"query",schema:{type:"string"},description:"Local enterprise config ID. Required when global selection mode is stateless; optional in stateful mode, where the configured default enterprise is used."}],responses:{"2 Line truncated
<html lang="zh-CN">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no" />
<title>Seal Home API Docs (v${x})</title>
<title>Seal Home API Docs (v${a0})</title>
<link rel="icon" type="image/svg+xml" href="data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'><text y='.9em' font-size='90'>\uD83E\uDDAD</text></svg>" />
<style>
body {
@@ -226,20 +465,21 @@ selection, source authentication, response compaction, and diagnostics-friendly
src="https://cdn.jsdelivr.net/npm/@scalar/api-reference@1.25.101/dist/browser/standalone.js"
></script>
</body>
</html>`}async function Jn(n,i,r,o){let t=n.handler;return t(i,r,{corp:o})}async function BL(n,i){if(i.setHeader("Access-Control-Allow-Origin","*"),i.setHeader("Access-Control-Allow-Methods","GET, POST, PUT, DELETE, OPTIONS, PATCH"),i.setHeader("Access-Control-Allow-Headers","Content-Type, Authorization, X-Seal-Corp, X-Seal-Home-Session"),n.method==="OPTIONS"){i.writeHead(204),i.end();return}let r=n.headers.host||"localhost",o=n.headers["x-forwarded-proto"]||"http",t=new LP(n.url||"/",`${o}://${r}`),u=t.pathname.replace(/\/+$/,"")||"/",e=(n.method||"GET").toUpperCase();try{if(e==="GET"&&u==="/"){Sn(i,200,{name:"seal-use",version:x,description:"Seal tenant operations and approval automation HTTP API",docs:"/docs",openapi:"/openapi.json",health:"/health",endpoints:{cli:"POST /api/cli",tools:"GET /api/tools",toolInvoke:"POST /api/tool/:name",restV1:"GET/POST /v1/*"}});return}if(e==="GET"&&u==="/docs"){GP(i,200,PL());return}if(e==="GET"&&u==="/openapi.json"){Sn(i,200,v$());return}if(e==="GET"&&u==="/health"){Sn(i,200,{status:"ok",version:x,name:"seal-use",timestamp:new Date().toISOString()});return}if(e==="POST"&&u==="/api/cli"){let l=await I$(n),$=(typeof l?.command==="string"?l.command:"").trim();if(!$){$$(i,400,"Missing 'command' property in request body");return}let I=C0($),g=I[0]==="seal-use"||I[0]==="seal-home"||I[0]?.endsWith("/seal-use")||I[0]?.endsWith("/seal-home")?I.slice(1):I,b=await hu(g),f=void 0;try{if(b.stdout.trim().startsWith("{")||b.stdout.trim().startsWith("["))f=JSON.parse(b.stdout)}catch{}Sn(i,b.isError?400:200,{success:!b.isError,stdout:b.stdout,stderr:b.stderr,exitCode:b.exitCode,data:f});return}if(e==="POST"&&u.startsWith("/api/tool/")){let l=u.slice(10).trim(),$=Gn(l,{includeMcpAliases:!0});if(!$){$$(i,404,`Tool not found: '${l}'`);return}let I=await I$(n)||{},g=hn(n,t,I),b=Nn(g),f=await dn(b),w={...I};delete w.corp;let c=await Jn($,f,w,b);Sn(i,200,c);return}if(u.startsWith("/v1/")){if(await NP(n,i,e,u,t))return}$$(i,404,`Cannot ${e} ${u}. Visit /docs for available endpoints.`)}catch(l){let $=l instanceof Error?l.message:String(l);$$(i,500,$)}}async function NP(n,i,r,o,t){let u=Object.fromEntries(t.searchParams.entries());if(r==="GET"&&o==="/v1/corps"){let e=Hi(),l=Vn();return Sn(i,200,{count:e.length,mode:l.stateful?"stateful":"stateless",defaultCorpId:l.defaultCorpId,corps:e.map(($)=>({id:$.id,name:$.name,sourceType:$.source.type,sealUrl:$.seal?.url}))}),!0}if(r==="GET"&&o==="/v1/whoami"){let e=hn(n,t,u),l=Nn(e),$=await dn(l),I=Gn("seal_whoami"),g=await Jn(I,$,{},l);return Sn(i,200,g),!0}if(r==="GET"&&o==="/v1/session"){let e=hn(n,t,u),l=Nn(e),$=await dn(l),I=Gn("seal_session_get"),g=await Jn(I,$,{},l);return Sn(i,200,g),!0}if(r==="GET"&&o==="/v1/approval-runs/summary"){let e=hn(n,t,u),l=Nn(e),$=await dn(l),I=Gn("seal_approval_runs_summary"),g=await Jn(I,$,u,l);return Sn(i,200,g),!0}if(r==="GET"&&o==="/v1/approval-runs/stats"){let e=hn(n,t,u),l=Nn(e),$=await dn(l),I=Gn("seal_approval_runs_stats"),g=await Jn(I,$,u,l);return Sn(i,200,g),!0}if(r==="GET"&&o==="/v1/approval-runs/pick"){let e=hn(n,t,u),l=Nn(e),$=await dn(l),I=Gn("seal_approval_run_pick"),g=await Jn(I,$,u,l);return Sn(i,200,g),!0}if(r==="GET"&&o==="/v1/approval-runs/url"){let e=hn(n,t,u),l=Nn(e),$=await dn(l),I=Gn("seal_approval_run_url_get"),g=await Jn(I,$,u,l);return Sn(i,200,g),!0}if(o.startsWith("/v1/approval-runs/")){let e=o.slice(18).split("/"),l=e[0],$=e[1];if(l&&!["summary","pick","stats","url","bridge"].includes(l)){let I=hn(n,t,u),g=Nn(I),b=await dn(g);if(!$){let f=Gn("seal_approval_run_get"),w=await Jn(f,b,{recordId:l,...u},g);return Sn(i,200,w),!0}if($==="attachments"){let f=Gn("seal_approval_run_attachments_get"),w=await Jn(f,b,{recordId:l,...u},g);return Sn(i,200,w),!0}if($==="cited-rules"){let f=Gn("seal_approval_run_cited_rules_get"),w=await Jn(f,b,{recordId:l,...u},g);return Sn(i,200,w),!0}if($==="document-summary"){let f=Gn("seal_approval_run_document_summary_get"),w=await Jn(f,b,{recordId:l,...u},g);return Sn(i,200,w),!0}if($==="result"){let f=Gn("seal_approval_run_result_get"),w=await Jn(f,b,{recordId:l,...u},g);return Sn(i,200,w),!0}}}if(r==="GET"&&o==="/v1/approval-runs"){let e=hn(n,t,u),l=Nn(e),$=await dn(l),I=Gn("seal_approval_runs_search"),g=await Jn(I,$,{...u,limit:u.limit?Number(u.limit):void 0,offset:u.offset?Number(u.offset):void 0,includeBridge:u.includeBridge==="true"},l);return Sn(i,200,g),!0}if(r==="GET"&&o==="/v1/approval/rules"){let e=hn(n,t,u),l=Nn(e),$=await dn(l),I=Gn("seal_approval_rules_list"),g=await Jn(I,$,u,l);return Sn(i,200,g),!0}if(r==="GET"&&o==="/v1/simulation/batches"){let e=hn(n,t,u),l=Nn(e),$=await dn(l),I=Gn("seal_simulation_batches_list"),g=await Jn(I,$,u,l);return Sn(i,200,g),!0}if(r==="POST"&&o==="/v1/simulation/create-batch"){let e=await I$(n)||{},l=hn(n,t,e),$=Nn(l),I=await dn($),g=Gn("seal_simulation_batch_create"),b=await Jn(g,I,e,$);return Sn(i,200,b),!0}if(r==="GET"&&o.startsWith("/v1/simulation/batch/")){let l=o.slice(21).split("/")[0];if(l){let $=hn(n,t,u),I=NnLine truncated
\uD83D\uDE80 seal-use HTTP Server (v${x}) started`),console.error(` URL: http://${r}:${i}`),console.error(` Docs: http://${r}:${i}/docs`),console.error(` OpenAPI: http://${r}:${i}/openapi.json`),console.error(` CLI Exec: POST http://${r}:${i}/api/cli`),console.error(` REST API: http://${r}:${i}/v1/...
`);t(o)})})}async function TL(n){let i=en(n.options.port)??en(n.options.p),r=U(n.options.host)??U(n.options.h),o=await EL({port:i,host:r}),t=()=>{o.close(()=>{process.exit(0)})};process.on("SIGINT",t),process.on("SIGTERM",t),await new Promise(()=>{})}async function VL(n,i,r,o){if(n==="config"||n==="get"){await J("seal_llm_config_get",i,r,{},j(o.options));return}if(n==="providers"||n==="list"){await J("seal_llm_providers_list",i,r,{},j(o.options));return}throw Error(`Unknown llm command: ${n??""}. Run 'seal-use help' for available commands.`)}async function _L(n,i){if(n==="config"||n==="json"){R0();return}await h0()}function R0(){B({mcpServers:{"seal-use":{type:"stdio",command:"seal-use",args:["mcp"],env:{SEAL_USE_MCP_ENABLED:"true"}}}})}function qL(n){let i=v$();B(i,{...j(n.options),allowFull:!0})}async function ZL(n,i,r,o){if(n==="available"){await J("seal_permissions_available_list",i,r,{},j(o.options));return}if(n==="configs"||n==="list"){await J("seal_permissions_configs_list",i,r,{},j(o.options));return}throw Error(`Unknown permissions command: ${n??""}. Run 'seal-use help' for available commands.`)}import{readFileSync as ML}from"node:fs";async function zL(n,i,r,o,t,u,e){if(!n||n==="get"){await J("seal_preference_get",t,u,{},j(e.options));return}if(n==="decision"){if(i==="update"||!i){let l=U(e.options.input),$=l?JSON.parse(ML(l,"utf8")):oi(e.json);if(!$||Object.keys($).length===0)throw Error(`Usage: seal-use preference decision update --json '{"explicitApprove":"..."}'`);await J("seal_preference_decision_update",t,u,$,j(e.options));return}}if(n==="thinking-depth"||n==="thinkingDepth"){if(i==="set"){let l=U(e.options.default)??U(e.options.level)??o;if(l!=="medium"&&l!=="high")throw Error("Usage: seal-use preference thinking-depth set --default <medium|high>");await J("seal_preference_thinking_depth_set",t,u,{defaultLevel:l},j(e.options));return}if(i==="policies"){if(r==="list"||!r){await J("seal_preference_thinking_depth_policies_list",t,u,{},j(e.options));return}if(r==="upsert"){let l=U(e.options.input),$=l?JSON.parse(ML(l,"utf8")):oi(e.json);if(!$||!$.id||!$.name)throw Error(`Usage: seal-use preference thinking-depth policies upsert --json '{"id":"...","name":"...","level":"high"}'`);await J("seal_preference_thinking_depth_policies_upsert",t,u,$,j(e.options));return}if(r==="remove"||r==="delete"){let l=o??U(e.options.id)??U(e.options.policyId);if(!l)throw Error("Usage: seal-use preference thinking-depth policies remove <policyId>");await J("seal_preference_thinking_depth_policies_remove",t,u,{policyId:l},j(e.options));return}}}throw Error(`Unknown preference action: ${n??""}. Available: get, decision update, thinking-depth set, thinking-depth policies list/upsert/remove.`)}async function CL(n={}){let i=Hi(),r=Vn(),o=xr(i,{stateful:r.stateful,defaultCorpId:r.defaultCorpId,corpId:n.corpId},Tt());console.log(`[probe] corp=${o.id} source=${o.source.type}`);let t=await io(o);console.log("[probe] seal enterprise"),console.log(JSON.stringify(t,null,2));let u=await dn(o),e=await av(u,{documentLimit:20,stylePreferencesEndpoint:o.seal.endpoints.approvalStylePreferences});console.log("[probe] approval context summary"),console.log(JSON.stringify({rules:e.rules.rules.length,hasPendingRuleDeletes:e.rules.hasPendingDeletes,documents:e.documents.articles.length,documentsTotal:e.documents.total,stylePreferences:e.stylePreferences.ok?"ok":`error: ${e.stylePreferences.error}`},null,2))}async function RL(n,i,r){let o=i??U(r.options.corp)??(n&&n!=="--corp"?n:void 0);await CL({corpId:o})}async function hL(n,i,r,o,t){if(n==="count"){await J("seal_approval_rules_list",r,o,{countOnly:!0},j(t.options));return}if(n==="list"){if(E(t.options.count)){await J("seal_approval_rules_list",r,o,{countOnly:!0},j(t.options));return}let u=en(t.options.limit),e=en(t.options.offset);if(E(t.options.summary)){await J("seal_approval_rules_list",r,o,{fields:cL,limit:u,offset:e},j(t.options));return}let l=await no("seal_approval_rules_list",r,o,{limit:u,offset:e});UL(l,E(t.options.full)===!0),B(l);return}if(n==="clear"){let u=E(t.options.yes)===!0,e=E(t.options.dryRun)??E(t.options["dry-run"])??!u;if(!u&&!e)throw Error("Refusing to clear rules without --yes. Use --dry-run to preview.");let l=await no("seal_approval_rules_clear",r,o,{dryRun:e,recode:E(t.options.recode)});if(!u&&e&&l&&typeof l==="object"){B({...l,nextCommand:`seal-use rules clear --corp ${o.id} --yes`},j(t.options));return}B(l,j(t.options));return}if(n==="versions"){await J("seal_approval_rule_versions_list",r,o,{},j(t.options));return}if(n==="version"){let u=i??U(t.options.version);if(!u)throw Error("Usage: seal-use rules version <versionId|versionNumber|latest>");await J("seal_approval_rule_version_get",r,o,Zu(u),j(t.options));return}if(n==="get"){await J("seal_approval_rule_get",r,o,{...wL(U(t.options.version)),code:U(t.options.code),runtimeId:U(t.options.runtimeId)??U(t.options["runtime-id"]),recordId:U(t.options.recordId)??U(t.options["record-id"])},j(t.options));return}if( Line truncated
`,{mode:384}),b$(r,`running pid=${process.pid}`);let o=()=>{if(x0(i)===process.pid)g$(i,{force:!0});b$(r,`stopped pid=${process.pid}`)};await new Promise((t)=>{let u=!1,e=setInterval(()=>{},60000),l=()=>{if(u)return;u=!0,o(),clearInterval(e),process.off("SIGTERM",l),process.off("SIGINT",l),t()};process.once("SIGTERM",l),process.once("SIGINT",l)})}function mL(n){nN(n.stateDir);let i=to(n);if(i.running)return i;let r=n.launcher??{command:process.execPath,args:[n.entryFile]},o=pP(r.command,[...r.args??[],"service","run"],{cwd:n.appRoot,detached:!0,stdio:["ignore","ignore","ignore"],env:process.env});o.unref();let t=f$(n);return m0(t,`${o.pid}
`,{mode:384}),b$(w$(n),`started pid=${o.pid}`),{started:!0,...to(n)}}function xL(n,i={}){let r=f$(n),o=x0(r);if(!o||!sL(o,n.appRoot))return g$(r,{force:!0}),i.quiet?void 0:{stopped:!1,reason:"not running"};return process.kill(o,"SIGTERM"),g$(r,{force:!0}),b$(w$(n),`stop requested pid=${o}`),i.quiet?void 0:{stopped:!0,pid:o}}function sL(n,i){if(!QP(n))return!1;try{let r=jP("ps",["-p",String(n),"-o","command="],{encoding:"utf8"});return(r.includes(i)||r.includes("seal-use")||r.includes("src/cli.ts"))&&r.includes("service")&&r.includes("run")}catch{return!1}}function QP(n){try{return process.kill(n,0),!0}catch{return!1}}function f$(n){return aL(n.stateDir,"service.pid")}function w$(n){return aL(n.stateDir,"service.log")}function x0(n){if(!JP(n))return;let i=Number(HP(n,"utf8").trim());return Number.isInteger(i)&&i>0?i:void 0}function nN(n){XP(n,{recursive:!0,mode:448})}function b$(n,i){m0(n,`${new Date().toISOString()} ${i}
`,{flag:"a",mode:384})}var a0=KP(FP(),".config","seal-use");async function iN(n,i){let r=await Mt(n,{appRoot:i.appRoot,entryFile:i.entryFile,stateDir:a0,version:x,launcher:i.launcher});if(r!==void 0)B(r)}import{existsSync as PP,readFileSync as tN}from"node:fs";async function rN(n,i,r,o,t){if(n==="batch-records"||n==="records"){let u=i??U(t.options.batchId)??U(t.options["batch-id"]);if(!u)throw Error("Usage: seal-use simulation batch-records <batchId>");await J("seal_simulation_batch_records_get",r,o,{batchId:u,query:U(t.options.query)},j(t.options));return}if(n==="create"||n==="run"){let u=U(t.options.mode)??U(t.options.sourceSystem)??U(t.options["source-system"])??"hosecloud",e=u==="material-pack"?"material_pack":u,l=U(t.options.schemaConfig)??U(t.options["schema-config"]),$=l?JSON.parse(tN(l,"utf8")):void 0,I=U(t.options.input),g=I?JSON.parse(tN(I,"utf8")):oi(t.json),b=U(t.options.packageId)??U(t.options["package-id"]),f=_n(t.options.packageIds)??_n(t.options["package-ids"])??(b?[b]:void 0),w=_n(t.options.flowIds)??_n(t.options["flow-ids"])??_n(t.options.documentSn)??_n(t.options["document-sn"]),c=U(t.options.signKey)??U(t.options["sign-key"])??U(t.options.integration);await J("seal_simulation_batch_create",r,o,{mode:e,sourceSystem:e,flowIds:w,documentSn:w,rejectNodeName:U(t.options.rejectNode)??U(t.options["reject-node"])??null,thinkingDepthOverride:U(t.options.thinkingDepth)??U(t.options["thinking-depth"]),skipInvoiceGeneration:E(t.options.skipInvoiceGeneration)??E(t.options["skip-invoice-generation"]),skipExpenseExtraction:E(t.options.skipExpenseExtraction)??E(t.options["skip-expense-extraction"]),disableAttachmentCache:E(t.options.disableAttachmentCache)??E(t.options["disable-attachment-cache"]),signKey:c,packageIds:f,packageId:b,templateId:U(t.options.templateId)??U(t.options["template-id"]),schemaConfig:$,requestIds:_n(t.options.requestIds)??_n(t.options["request-ids"]),workflowTypeId:U(t.options.workflowTypeId)??U(t.options["workflow-type-id"]),flowStatusList:_n(t.options.flowStatusList)?.map(Number)??_n(t.options["flow-status-list"])?.map(Number),businessCodes:_n(t.options.businessCodes)??_n(t.options["business-codes"]),documentType:U(t.options.documentType)??U(t.options["document-type"]),startTime:en(t.options.startTime)??en(t.options["start-time"]),endTime:en(t.options.endTime)??en(t.options["end-time"]),status:_n(t.options.status),limit:en(t.options.limit),rawParams:g},j(t.options));return}if(n==="wait"){let u=i??U(t.options.batchId)??U(t.options["batch-id"]);if(!u)throw Error("Usage: seal-use simulation wait <batchId> [--timeout 10m] [--poll-interval 2s]");await J("seal_simulation_batch_wait",r,o,{batchId:u,timeout:U(t.options.timeout),pollInterval:U(t.options.pollInterval)??U(t.options["poll-interval"])},j(t.options));return}if(n==="clean"||n==="delete"){let u=i??U(t.options.batchId)??U(t.options["batch-id"]);if(!u)throw Error("Usage: seal-use simulation clean <batchId>");await J("seal_simulation_batch_clean",r,o,{batchId:u},j(t.options));return}if(n==="specifications"){let u=i??U(t.options.integration)??U(t.options.signKey)??U(t.options["sign-key"]);await J("seal_simulation_specifications_list",r,o,{signKey:u},j(t.options));return}if(n==="list"){await J("seal_simulation_batches_list",r,o,{limit:en(t.options.limit)},j(t.options));return}if(n==="get"){let u=i??U(t.options.batchId)??U(t.options["batch-id"]);if(!u)throw Error("Usage: seal-use simulation get <batchId>");await J("seal_simulation_batch_get",r,o,{batchId:u},j(t.options));return}if(n==="templates"){await J("seal_simulation_templates_get",r,o,{},j(t.options));return}if(n==="integrations"){await J("seal_simulation_integrations_get",r,o,{},j(t.options));return}if(n==="package-upload"){let u=i??U(t.options.file);if(!u)throw Error("Usage: seal-use simulation package-upload <材料包.zip>");if(!PP(u))throw Error(`File not found: ${u}`);await J("seal_simulation_material_package_upload",r,o,{filePath:u},j(t.options));return}throw Error(`Unknown simulation command: ${n??""}. Run 'seal-use help' for available commands.`)}import{existsSync as kN}from"node:fs";import{join as c$}from"node:path";import{existsSync as s0,mkdirSync as cN,rmSync as hP,writeFileSync as mP}from"node:fs";import{homedir as UN}from"node:os";import{dirname as xP,join as n4}from"node:path";var oN=`---
</html>`}async function u4($,I,q,U){let Y=$.handler;return Y(I,q,{corp:U})}async function PZ0($,I){if(I.setHeader("Access-Control-Allow-Origin","*"),I.setHeader("Access-Control-Allow-Methods","GET, POST, PUT, DELETE, OPTIONS, PATCH"),I.setHeader("Access-Control-Allow-Headers","Content-Type, Authorization, X-Seal-Corp, X-Seal-Home-Session"),$.method==="OPTIONS"){I.writeHead(204),I.end();return}let q=$.headers.host||"localhost",U=$.headers["x-forwarded-proto"]||"http",Y=new tz1($.url||"/",`${U}://${q}`),J=Y.pathname.replace(/\/+$/,"")||"/",Q=($.method||"GET").toUpperCase();try{if(Q==="GET"&&J==="/"){d1(I,200,{name:"seal-use",version:a0,description:"Seal tenant operations and approval automation HTTP API",docs:"/docs",openapi:"/openapi.json",health:"/health",endpoints:{cli:"POST /api/cli",tools:"GET /api/tools",toolInvoke:"POST /api/tool/:name",restV1:"GET/POST /v1/*"}});return}if(Q==="GET"&&J==="/docs"){sz1(I,200,gZ0());return}if(Q==="GET"&&J==="/openapi.json"){d1(I,200,VO());return}if(Q==="GET"&&J==="/health"){d1(I,200,{status:"ok",version:a0,name:"seal-use",timestamp:new Date().toISOString()});return}if(Q==="POST"&&(J==="/shutdown"||J==="/api/shutdown")){d1(I,200,{success:!0,message:"Shutting down seal-use background daemon",pid:process.pid}),setTimeout(()=>{process.kill(process.pid,"SIGTERM")},50);return}if(Q==="POST"&&J==="/api/cli"){let K=await ZO($),z=(typeof K?.command==="string"?K.command:"").trim();if(!z){WO(I,400,"Missing 'command' property in request body");return}let w=Wu(z),G=w[0]==="seal-use"||w[0]==="seal-home"||w[0]?.endsWith("/seal-use")||w[0]?.endsWith("/seal-home")?w.slice(1):w,H=await Dz(G),W=void 0;try{if(H.stdout.trim().startsWith("{")||H.stdout.trim().startsWith("["))W=JSON.parse(H.stdout)}catch{}d1(I,H.isError?400:200,{success:!H.isError,stdout:H.stdout,stderr:H.stderr,exitCode:H.exitCode,data:W});return}if(Q==="POST"&&J.startsWith("/api/tool/")){let K=J.slice(10).trim(),z=B4(K,{includeMcpAliases:!0});if(!z){WO(I,404,`Tool not found: '${K}'`);return}let w=await ZO($)||{},G=_6($,Y,w),H=D4(G),W=await I4(H),V={...w};delete V.corp;let X=await u4(z,W,V,H);d1(I,200,X);return}if(J.startsWith("/v1/")){if(await az1($,I,Q,J,Y))return}WO(I,404,`Cannot ${Q} ${J}. Visit /docs for available endpoints.`)}catch(K){let z=K instanceof Error?K.message:String(K);WO(I,500,z)}}async function az1($,I,q,U,Y){let J=Object.fromEntries(Y.searchParams.entries());if(q==="GET"&&U==="/v1/corps"){let Q=H8(),K=H6();return d1(I,200,{count:Q.length,mode:K.stateful?"stateful":"stateless",defaultCorpId:K.defaultCorpId,corps:Q.map((z)=>({id:z.id,name:z.name,sourceType:z.source.type,sealUrl:z.seal?.url}))}),!0}if(q==="GET"&&U==="/v1/whoami"){let Q=_6($,Y,J),K=D4(Q),z=await I4(K),w=B4("seal_whoami"),G=await u4(w,z,{},K);return d1(I,200,G),!0}if(q==="GET"&&U==="/v1/session"){let Q=_6($,Y,J),K=D4(Q),z=await I4(K),w=B4("seal_session_get"),G=await u4(w,z,{},K);return d1(I,200,G),!0}if(q==="GET"&&U==="/v1/approval-runs/summary"){let Q=_6($,Y,J),K=D4(Q),z=await I4(K),w=B4("seal_approval_runs_summary"),G=await u4(w,z,J,K);return d1(I,200,G),!0}if(q==="GET"&&U==="/v1/approval-runs/stats"){let Q=_6($,Y,J),K=D4(Q),z=await I4(K),w=B4("seal_approval_runs_stats"),G=await u4(w,z,J,K);return d1(I,200,G),!0}if(q==="GET"&&U==="/v1/approval-runs/pick"){let Q=_6($,Y,J),K=D4(Q),z=await I4(K),w=B4("seal_approval_run_pick"),G=await u4(w,z,J,K);return d1(I,200,G),!0}if(q==="GET"&&U==="/v1/approval-runs/url"){let Q=_6($,Y,J),K=D4(Q),z=await I4(K),w=B4("seal_approval_run_url_get"),G=await u4(w,z,J,K);return d1(I,200,G),!0}if(U.startsWith("/v1/approval-runs/")){let Q=U.slice(18).split("/"),K=Q[0],z=Q[1];if(K&&!["summary","pick","stats","url","bridge"].includes(K)){let w=_6($,Y,J),G=D4(w),H=await I4(G);if(!z){let W=B4("seal_approval_run_get"),V=await u4(W,H,{recordId:K,...J},G);return d1(I,200,V),!0}if(z==="attachments"){let W=B4("seal_approval_run_attachments_get"),V=await u4(W,H,{recordId:K,...J},G);return d1(I,200,V),!0}if(z==="cited-rules"){let W=B4("seal_approval_run_cited_rules_get"),V=await u4(W,H,{recordId:K,...J},G);return d1(I,200,V),!0}if(z==="document-summary"){let W=B4("seal_approval_run_document_summary_get"),V=await u4(W,H,{recordId:K,...J},G);return d1(I,200,V),!0}if(z==="result"){let W=B4("seal_approval_run_result_get"),V=await u4(W,H,{recordId:K,...J},G);return d1(I,200,V),!0}}}if(q==="GET"&&U==="/v1/approval-runs"){let Q=_6($,Y,J),K=D4(Q),z=await I4(K),w=B4("seal_approval_runs_search"),G=await u4(w,z,{...J,limit:J.limit?Number(J.limit):void 0,offset:J.offset?Number(J.offset):void 0,includeBridge:J.includeBridge==="true"},K);return d1(I,200,G),!0}if(q==="GET"&&U==="/v1/approval/rules"){let Q=_6($,Y,J),K=D4(Q),z=await I4(K),w=B4("seal_approval_rules_list"),G=await u4(w,z,J,K);return d1(I,200,G),!0}if(q==="GET"&&U==="/v1/simulation/batches"){let Q=_6($,Y,J),K=D4(Q),z=await I4(K),w=B4("seal_simulation_batches_list"),G=await u4(w,z,J,K);return d1(I,200,G),!0}if(q==="POST"&&U==="/v1/simulation/create-batch"){let Q=await ZO($)||{},K=_6($,Line truncated
\uD83D\uDE80 seal-use HTTP Server (v${a0}) started`),console.error(` URL: http://${q}:${I}`),console.error(` Docs: http://${q}:${I}/docs`),console.error(` OpenAPI: http://${q}:${I}/openapi.json`),console.error(` CLI Exec: POST http://${q}:${I}/api/cli`),console.error(` REST API: http://${q}:${I}/v1/...
`);Y(U)})})}async function TZ0($){let I=$1($.options.port)??$1($.options.p),q=x($.options.host)??x($.options.h),U=await OO({port:I,host:q}),Y=()=>{U.close(()=>{process.exit(0)})};process.on("SIGINT",Y),process.on("SIGTERM",Y),await new Promise(()=>{})}async function jZ0($,I,q,U){if($==="config"||$==="get"){await L0("seal_llm_config_get",I,q,{},O0(U.options));return}if($==="providers"||$==="list"){await L0("seal_llm_providers_list",I,q,{},O0(U.options));return}throw Error(`Unknown llm command: ${$??""}. Run 'seal-use help' for available commands.`)}async function EZ0($,I){if($==="config"||$==="json"){Zu();return}await Xu()}function Zu(){R0({mcpServers:{"seal-use":{type:"stdio",command:"seal-use",args:["mcp"],env:{SEAL_USE_MCP_ENABLED:"true"}}}})}function BZ0($){let I=VO();R0(I,{...O0($.options),allowFull:!0})}async function vZ0($,I,q,U){if($==="available"){await L0("seal_permissions_available_list",I,q,{},O0(U.options));return}if($==="configs"||$==="list"){await L0("seal_permissions_configs_list",I,q,{},O0(U.options));return}throw Error(`Unknown permissions command: ${$??""}. Run 'seal-use help' for available commands.`)}import{readFileSync as RZ0}from"node:fs";async function CZ0($,I,q,U,Y,J,Q){if(!$||$==="get"){await L0("seal_preference_get",Y,J,{},O0(Q.options));return}if($==="decision"){if(I==="update"||!I){let K=x(Q.options.input),z=K?JSON.parse(RZ0(K,"utf8")):r6(Q.json);if(!z||Object.keys(z).length===0)throw Error(`Usage: seal-use preference decision update --json '{"explicitApprove":"..."}'`);await L0("seal_preference_decision_update",Y,J,z,O0(Q.options));return}}if($==="thinking-depth"||$==="thinkingDepth"){if(I==="set"){let K=x(Q.options.default)??x(Q.options.level)??U;if(K!=="medium"&&K!=="high")throw Error("Usage: seal-use preference thinking-depth set --default <medium|high>");await L0("seal_preference_thinking_depth_set",Y,J,{defaultLevel:K},O0(Q.options));return}if(I==="policies"){if(q==="list"||!q){await L0("seal_preference_thinking_depth_policies_list",Y,J,{},O0(Q.options));return}if(q==="upsert"){let K=x(Q.options.input),z=K?JSON.parse(RZ0(K,"utf8")):r6(Q.json);if(!z||!z.id||!z.name)throw Error(`Usage: seal-use preference thinking-depth policies upsert --json '{"id":"...","name":"...","level":"high"}'`);await L0("seal_preference_thinking_depth_policies_upsert",Y,J,z,O0(Q.options));return}if(q==="remove"||q==="delete"){let K=U??x(Q.options.id)??x(Q.options.policyId);if(!K)throw Error("Usage: seal-use preference thinking-depth policies remove <policyId>");await L0("seal_preference_thinking_depth_policies_remove",Y,J,{policyId:K},O0(Q.options));return}}}throw Error(`Unknown preference action: ${$??""}. Available: get, decision update, thinking-depth set, thinking-depth policies list/upsert/remove.`)}async function _Z0($={}){let I=H8(),q=H6(),U=Gq(I,{stateful:q.stateful,defaultCorpId:q.defaultCorpId,corpId:$.corpId},y7());console.log(`[probe] corp=${U.id} source=${U.source.type}`);let Y=await FY(U);console.log("[probe] seal enterprise"),console.log(JSON.stringify(Y,null,2));let J=await I4(U),Q=await bH(J,{documentLimit:20,stylePreferencesEndpoint:U.seal.endpoints.approvalStylePreferences});console.log("[probe] approval context summary"),console.log(JSON.stringify({rules:Q.rules.rules.length,hasPendingRuleDeletes:Q.rules.hasPendingDeletes,documents:Q.documents.articles.length,documentsTotal:Q.documents.total,stylePreferences:Q.stylePreferences.ok?"ok":`error: ${Q.stylePreferences.error}`},null,2))}async function hZ0($,I,q){let U=I??x(q.options.corp)??($&&$!=="--corp"?$:void 0);await _Z0({corpId:U})}async function Du($,I,q,U,Y){if($==="count"){await L0("seal_approval_rules_list",q,U,{countOnly:!0},O0(Y.options));return}if($==="list"){if(S0(Y.options.count)){await L0("seal_approval_rules_list",q,U,{countOnly:!0},O0(Y.options));return}let J=$1(Y.options.limit),Q=$1(Y.options.offset);if(S0(Y.options.summary)){await L0("seal_approval_rules_list",q,U,{fields:IZ0,limit:J,offset:Q},O0(Y.options));return}let K=await II("seal_approval_rules_list",q,U,{limit:J,offset:Q});qZ0(K,S0(Y.options.full)===!0),R0(K);return}if($==="clear"){let J=S0(Y.options.yes)===!0,Q=S0(Y.options.dryRun)??S0(Y.options["dry-run"])??!J;if(!J&&!Q)throw Error("Refusing to clear rules without --yes. Use --dry-run to preview.");let K=await II("seal_approval_rules_clear",q,U,{dryRun:Q,recode:S0(Y.options.recode)});if(!J&&Q&&K&&typeof K==="object"){R0({...K,nextCommand:`seal-use rules clear --corp ${U.id} --yes`},O0(Y.options));return}R0(K,O0(Y.options));return}if($==="versions"){await L0("seal_approval_rule_versions_list",q,U,{},O0(Y.options));return}if($==="version"){let J=I??x(Y.options.version);if(!J)throw Error("Usage: seal-use rules version <versionId|versionNumber|latest>");await L0("seal_approval_rule_version_get",q,U,Hz(J),O0(Y.options));return}if($==="get"){await L0("seal_approval_rule_get",q,U,{...$Z0(x(Y.options.version)),code:x(Y.options.code),runtimeId:x(Y.options.runtimeId)??x(Y.options["runtime-id"]),recordId:x(Y.options.r Line truncated
`).filter(Boolean),J=Y.slice(-I);return{logFile:q,lines:J,totalLines:Y.length}}async function Yw1($){let I=MO($),q=Nu($),U=Oz($);xZ0($.stateDir);let Y=$.port??(process.env.PORT?Number.parseInt(process.env.PORT,10):XO),J=$.host??(process.env.HOST?process.env.HOST:DO);NO(I,`${process.pid}
`,{mode:384}),NO(q,JSON.stringify({pid:process.pid,port:Y,host:J,version:$.version,startedAt:new Date().toISOString()},null,2),{mode:384}),MY(U,`service starting on http://${J}:${Y} pid=${process.pid}`);let Q=null;try{Q=await OO({port:Y,host:J,silent:!0}),MY(U,`service listening pid=${process.pid}`)}catch(z){if(MY(U,`service failed to bind port ${Y}: ${z instanceof Error?z.message:String(z)}`),FO(I)===process.pid)i8(I,{force:!0}),i8(q,{force:!0});throw z}let K=()=>{if(Q)Q.close(),Q=null;if(FO(I)===process.pid)i8(I,{force:!0}),i8(q,{force:!0});MY(U,`stopped pid=${process.pid}`)};await new Promise((z)=>{let w=!1,G=()=>{if(w)return;w=!0,K(),process.off("SIGTERM",G),process.off("SIGINT",G),z()};process.once("SIGTERM",G),process.once("SIGINT",G)})}function SZ0($){xZ0($.stateDir);let I=AY($);if(I.running)return I;let q=$.launcher??{command:process.execPath,args:[$.entryFile]},U=[...q.args??[],"service","run"];if($.port)U.push("--port",String($.port));if($.host)U.push("--host",String($.host));let Y=$w1(q.command,U,{cwd:$.appRoot,detached:!0,stdio:["ignore","ignore","ignore"],env:process.env});Y.unref();let J=MO($);return NO(J,`${Y.pid}
`,{mode:384}),MY(Oz($),`started pid=${Y.pid}`),{started:!0,...AY($)}}function yZ0($,I={}){let q=MO($),U=Nu($),Y=FO(q);if(!Y||!uZ0(Y,$.appRoot))return i8(q,{force:!0}),i8(U,{force:!0}),I.quiet?void 0:{stopped:!1,reason:"not running"};return process.kill(Y,"SIGTERM"),i8(q,{force:!0}),i8(U,{force:!0}),MY(Oz($),`stop requested pid=${Y}`),I.quiet?void 0:{stopped:!0,pid:Y}}function uZ0($,I){if(!Jw1($))return!1;try{let q=Iw1("ps",["-p",String($),"-o","command="],{encoding:"utf8"});return(q.includes(I)||q.includes("seal-use")||q.includes("src/cli.ts"))&&q.includes("service")&&q.includes("run")}catch{return!1}}function Jw1($){try{return process.kill($,0),!0}catch{return!1}}function MO($){return Lu($.stateDir,"service.pid")}function Nu($){return Lu($.stateDir,"service.json")}function Oz($){return Lu($.stateDir,"service.log")}function FO($){if(!LO($))return;let I=Number(Ou($,"utf8").trim());return Number.isInteger(I)&&I>0?I:void 0}function xZ0($){qw1($,{recursive:!0,mode:448})}function MY($,I){NO($,`${new Date().toISOString()} ${I}
`,{flag:"a",mode:384})}var Fu=Kw1(Qw1(),".config","seal-use");async function Mu($,I,q){let U=q?$1(q.options.port)??$1(q.options.p):void 0,Y=q?x(q.options.host)??x(q.options.h):void 0,J=q?$1(q.options.lines)??$1(q.options.n):void 0,Q=await qI($,{appRoot:I.appRoot,entryFile:I.entryFile,stateDir:Fu,version:a0,launcher:I.launcher,port:U,host:Y},{maxLines:J});if(Q!==void 0)R0(Q)}import{existsSync as zw1,readFileSync as kZ0}from"node:fs";async function fZ0($,I,q,U,Y){if($==="batch-records"||$==="records"){let J=I??x(Y.options.batchId)??x(Y.options["batch-id"]);if(!J)throw Error("Usage: seal-use simulation batch-records <batchId>");await L0("seal_simulation_batch_records_get",q,U,{batchId:J,query:x(Y.options.query)},O0(Y.options));return}if($==="create"||$==="run"){let J=x(Y.options.mode)??x(Y.options.sourceSystem)??x(Y.options["source-system"])??"hosecloud",Q=J==="material-pack"?"material_pack":J,K=x(Y.options.schemaConfig)??x(Y.options["schema-config"]),z=K?JSON.parse(kZ0(K,"utf8")):void 0,w=x(Y.options.input),G=w?JSON.parse(kZ0(w,"utf8")):r6(Y.json),H=x(Y.options.packageId)??x(Y.options["package-id"]),W=N6(Y.options.packageIds)??N6(Y.options["package-ids"])??(H?[H]:void 0),V=N6(Y.options.flowIds)??N6(Y.options["flow-ids"])??N6(Y.options.documentSn)??N6(Y.options["document-sn"]),X=x(Y.options.signKey)??x(Y.options["sign-key"])??x(Y.options.integration);await L0("seal_simulation_batch_create",q,U,{mode:Q,sourceSystem:Q,flowIds:V,documentSn:V,rejectNodeName:x(Y.options.rejectNode)??x(Y.options["reject-node"])??null,thinkingDepthOverride:x(Y.options.thinkingDepth)??x(Y.options["thinking-depth"]),skipInvoiceGeneration:S0(Y.options.skipInvoiceGeneration)??S0(Y.options["skip-invoice-generation"]),skipExpenseExtraction:S0(Y.options.skipExpenseExtraction)??S0(Y.options["skip-expense-extraction"]),disableAttachmentCache:S0(Y.options.disableAttachmentCache)??S0(Y.options["disable-attachment-cache"]),signKey:X,packageIds:W,packageId:H,templateId:x(Y.options.templateId)??x(Y.options["template-id"]),schemaConfig:z,requestIds:N6(Y.options.requestIds)??N6(Y.options["request-ids"]),workflowTypeId:x(Y.options.workflowTypeId)??x(Y.options["workflow-type-id"]),flowStatusList:N6(Y.options.flowStatusList)?.map(Number)??N6(Y.options["flow-status-list"])?.map(Number),businessCodes:N6(Y.options.businessCodes)??N6(Y.options["business-codes"]),documentType:x(Y.options.documentType)??x(Y.options["document-type"]),startTime:$1(Y.options.startTime)??$1(Y.options["start-time"]),endTime:$1(Y.options.endTime)??$1(Y.options["end-time"]),status:N6(Y.options.status),limit:$1(Y.options.limit),rawParams:G},O0(Y.options));return}if($==="wait"){let J=I??x(Y.options.batchId)??x(Y.options["batch-id"]);if(!J)throw Error("Usage: seal-use simulation wait <batchId> [--timeout 10m] [--poll-interval 2s]");await L0("seal_simulation_batch_wait",q,U,{batchId:J,timeout:x(Y.options.timeout),pollInterval:x(Y.options.pollInterval)??x(Y.options["poll-interval"])},O0(Y.options));return}if($==="clean"||$==="delete"){let J=I??x(Y.options.batchId)??x(Y.options["batch-id"]);if(!J)throw Error("Usage: seal-use simulation clean <batchId>");await L0("seal_simulation_batch_clean",q,U,{batchId:J},O0(Y.options));return}if($==="specifications"){let J=I??x(Y.options.integration)??x(Y.options.signKey)??x(Y.options["sign-key"]);await L0("seal_simulation_specifications_list",q,U,{signKey:J},O0(Y.options));return}if($==="list"){await L0("seal_simulation_batches_list",q,U,{limit:$1(Y.options.limit)},O0(Y.options));return}if($==="get"){let J=I??x(Y.options.batchId)??x(Y.options["batch-id"]);if(!J)throw Error("Usage: seal-use simulation get <batchId>");await L0("seal_simulation_batch_get",q,U,{batchId:J},O0(Y.options));return}if($==="templates"){await L0("seal_simulation_templates_get",q,U,{},O0(Y.options));return}if($==="integrations"){await L0("seal_simulation_integrations_get",q,U,{},O0(Y.options));return}if($==="package-upload"){let J=I??x(Y.options.file);if(!J)throw Error("Usage: seal-use simulation package-upload <材料包.zip>");if(!zw1(J))throw Error(`File not found: ${J}`);await L0("seal_simulation_material_package_upload",q,U,{filePath:J},O0(Y.options));return}throw Error(`Unknown simulation command: ${$??""}. Run 'seal-use help' for available commands.`)}import{existsSync as UX0}from"node:fs";import{join as AO}from"node:path";import{existsSync as Au,mkdirSync as aZ0,rmSync as Fw1,writeFileSync as Mw1}from"node:fs";import{homedir as sZ0}from"node:os";import{dirname as Aw1,join as gu}from"node:path";var nZ0=`---
name: seal-use
description: "v0.10.5: Use for Seal Use first-time enterprise onboarding, Hose/合思 or Seal-native authentication, assistance links and browser cURL intake, plus tenant approval operations, diagnosis, simulation, rules, users, configuration, and search."
description: "v0.10.7: Use for Seal Use first-time enterprise onboarding, Hose/合思 or Seal-native authentication, assistance links and browser cURL intake, plus tenant approval operations, diagnosis, simulation, rules, users, configuration, and search."
metadata:
version: 0.10.5
short-description: Seal tenant and Hose approval automation (v0.10.5)
version: 0.10.7
short-description: Seal tenant and Hose approval automation (v0.10.7)
---
# Seal Use (v0.10.5)
# Seal Use (v0.10.7)
Use the \`seal_cli\` MCP tool when it is available; pass the command string as its \`command\` argument. If MCP is unavailable, fall back to the global \`seal-use\` CLI. This skill is a routing layer for agents: keep this file short, choose the right command, and read a focused reference only when the task needs detail.
@@ -299,6 +539,7 @@ seal-use corps list
- System Permissions Config: \`seal-use permissions available --corp <corpId>\`, \`seal-use permissions configs --corp <corpId>\`.
- Billing & Feature Quotas: \`seal-use billing status --corp <corpId>\`, \`seal-use billing plans --corp <corpId>\`, \`seal-use billing features --corp <corpId>\`.
- Webhook 审批回调管理: \`seal-use webhook <list|get|add|update|delete> --corp <corpId>\`.
- Webhook 材料包导入: \`seal-use webhook material-pack preview <材料包.zip> --corp <corpId>\` 只做本地校验和解析;\`... push <材料包.zip> --webhook <idOrName> --corp <corpId>\` 上传附件并通过入站 Webhook 触发 AI 审批。它与 \`simulation material_pack\` 的官方服务端导入流程相互独立。
- HTTP REST API & Docs Server: \`seal-use http [--port 8787] [--host 127.0.0.1]\` (提供 \`/docs\` 交互文档、\`/openapi.json\`、\`POST /api/cli\` 与 \`/v1/*\` REST API)。
- 审批规则质量校验 (Linter): \`seal-use rules lint [--linter <name|path>] [--version <num>] [--code <code>] [--min-score <score>] [--summary] --corp <corpId>\`; read \`references/rule-lint.md\`. 全局配置默认关闭 (\`config lint <enable|disable>\`)。
- Full CLI inventory: read \`references/cli.md\`.
@@ -358,11 +599,11 @@ seal-use tool seal_approval_search --corp <corpId> --json '{"keywords":["差旅"
## Safety
Rule, document, style preference, and publish actions mutate Seal configuration. Make the target enterprise explicit, show the intended payload, and verify after the write. Never send real \`enterprises/*.json\` files, tokens, signed URLs, or full raw documents to GitHub, tickets, logs, or chat unless the user explicitly requests a safe export.
`;var uN=`interface:
`;var bZ0=`interface:
display_name: "Seal Use"
short_description: "Diagnose approval feedback and publish minimal rule fixes"
default_prompt: "Use $seal-use to resolve a customer feedback package to the correct tenant, diagnose the approval run, propose a minimal rule diff, and publish only after explicit confirmation."
`;var eN=`# Rule Lightweight Queries
`;var iZ0=`# Rule Lightweight Queries
Use this reference when the user wants rule counts, compact rule lists, one rule from a historical version, or approval knowledge search without dumping hundreds of rule descriptions.
@@ -467,7 +708,7 @@ Use current search only when the question is about current draft/current knowled
## Output Discipline
If a rule command would return many descriptions or more than about 20 rules, use \`rules count\`, \`rules list --summary\`, \`fields\`, \`snippetOnly\`, or \`--output-file\`. Use \`--full\` only for deliberate exports.
`;var lN=`# Approval Bad Case Catalog
`;var pZ0=`# Approval Bad Case Catalog
Use this file only as a comparison catalog after inspecting the current trace. Do not treat any case below as a default diagnosis.
@@ -517,7 +758,7 @@ Important nuance:
- This is a bad-case pattern, not a general rule that every amount-total dispute is caused by \`pre_analysis\`.
- Use it when the current trace shows recognized amounts being excluded downstream or duplicate attachments producing inconsistent conclusions.
`;var vN="# Seal Use CLI Reference\n\nRun from any directory after installing the global CLI:\n\n```bash\nseal-use <command>\n```\n\nEnterprise config lookup:\n\n- If `SEAL_USE_ENTERPRISES_DIR` is set, only that directory is loaded.\n- Otherwise `./enterprises` and `~/.config/seal-use/enterprises` are merged.\n- User-level configs override same-ID local configs.\n\nEnterprise selection is stateless by default. Commands that access an enterprise require\n`--corp <corpId>` unless stateful mode is explicitly enabled:\n\n```bash\nseal-use config mode stateful --corp <corpId>\nseal-use corps switch <corpId>\nseal-use config mode stateless\n```\n\nThe global mode is stored in `~/.config/seal-use/config.json`; set `SEAL_USE_CONFIG_FILE` to\noverride that path. The legacy `current-corp` file is not read.\n\n## Stream & Exit Code Contract\n\n- **`stdout`**: Pure, deterministic JSON for machine/Agent parsing.\n- **`stderr`**: Diagnostics, probing logs, and **Next-Step Command Suggestions** (e.g. `👉 Next action: ...`).\n- **`Exit Code`**: `0` on success, non-zero (e.g. `1`) on failure to trigger Agent error self-remediation.\n\n## Top-Level Commands\n\n```bash\nseal-use version\nseal-use config paths\nseal-use config get\nseal-use config mode <stateful|stateless> [--corp <corpId>]\nseal-use config lint <enable|disable|status> [--linter <name>] [--min-score <score>]\nseal-use rules lint [--corp <corpId>] [--linter <name|path>] [--version <num>] [--code <code>] [--min-score <score>] [--summary]\nseal-use service <start|stop|restart|status>\nseal-use http [--port 8787] [--host 127.0.0.1]\nseal-use serve [--port 8787]\nseal-use update\nseal-use tools list\nseal-use corps list [--corp <corpId>]\nseal-use corps current [--corp <corpId>]\nseal-use corps switch <corpId>\nseal-use corps add-hose --json '{\"name\":\"企业名称\",\"domain\":\"https://app.ekuaibao.com\",\"appKey\":\"...\",\"appSecurity\":\"...\",\"proxyStaffBizId\":\"corpId:staffId\"}'\nseal-use corps add-seal --json '{\"sealUrl\":\"https://tenant.sealai.cc\",\"token\":\"seal-bearer-token\"}'\nseal-use corps add-link <https://.../web/thirdparty.html?...> [--name <customName>] [--overwrite]\nseal-use auth diagnose [--corp <corpId>]\nseal-use auth hose-link [--corp <corpId>] [--expire 7200]\nseal-use delegation list [--corp <corpId>]\nseal-use delegation create [--note <note>] [--from-link <url>] [--corp <corpId>]\nseal-use delegation revoke <tokenId> [--corp <corpId>]\nseal-use users create --name <name> --phone <phone> [--dept <deptId>] [--corp <corpId>]\nseal-use users reset-password <userId> [--corp <corpId>]\nseal-use users get <userId> [--corp <corpId>]\nseal-use users delete <userId> [--corp <corpId>]\nseal-use llm config [--corp <corpId>]\nseal-use llm providers [--corp <corpId>]\nseal-use permissions available [--corp <corpId>]\nseal-use permissions configs [--corp <corpId>]\nseal-use billing status [--corp <corpId>]\nseal-use billing plans [--corp <corpId>]\nseal-use billing features [--corp <corpId>]\nseal-use webhook list [--query <text>] [--show-secret] [--corp <corpId>]\nseal-use webhook get|find <idOrName> [--show-secret] [--corp <corpId>]\nseal-use webhook add --name <name> --result-url <url> [--mode assisted|semi_automatic|fully_automatic] [--auto-approval-rate 60] [--secret <secret>] [--corp <corpId>]\nseal-use webhook update <idOrName> [--name <name>] [--result-url <url>] [--mode assisted|semi_automatic|fully_automatic] [--auto-approval-rate 60] [--secret <secret>|--rotate-secret] [--corp <corpId>]\nseal-use webhook delete <idOrName> --yes [--corp <corpId>]\nseal-use deploy hosecloud requirements [--corp <corpId>]\nseal-use deploy hosecloud list [--corp <corpId>]\nseal-use deploy hosecloud get [<sign-key>] [--corp <corpId>]\nseal-use deploy hosecloud status [--corp <corpId>]\nseal-use deploy hosecloud configure --json '{...}' [--corp <corpId>]\nseal-use deploy hosecloud sync [<sign-key>] [--auto] [--corp <corpId>]\nseal-use preference get [--corp <corpId>]\nseal-use preference decision update --json '{\"explicitApprove\":\"...\"}' [--corp <corpId>]\nseal-use preference thinking-depth set --default <medium|high> [--corp <corpId>]\nseal-use preference thinking-depth policies list [--corp <corpId>]\nseal-use preference thinking-depth policies upsert --json '{...}' [--corp <corpId>]\nseal-use preference thinking-depth policies remove <policyId> [--corp <corpId>]\nseal-use source config [--corp <corpId>]\nseal-use tool <toolName> [--corp <corpId>] [--json '{\"key\":\"value\"}']\nseal-use approval-runs summary --corp <corpId> [--date YYYY-MM-DD] [--timezone Asia/Shanghai]\nseal-use approval-runs stats --corp <corpId> [--since 3months] [--dedupe-by sourceDocumentSN|sourceDocumentId|id]\nseal-use approval-runs count --corp <corpId> [--status APPROVED]\nseal-use approval-runs search --corp <corpId> [--query text] [--limit 20] [--includeBridge true]\nseal-use approval-runs get <recordId> --corp <corpId> [--fields metadata|document.fields,result.summaLine truncated
`;var cZ0="# Seal Use CLI Reference\n\nRun from any directory after installing the global CLI:\n\n```bash\nseal-use <command>\n```\n\nEnterprise config lookup:\n\n- If `SEAL_USE_ENTERPRISES_DIR` is set, only that directory is loaded.\n- Otherwise `./enterprises` and `~/.config/seal-use/enterprises` are merged.\n- User-level configs override same-ID local configs.\n\nEnterprise selection is stateless by default. Commands that access an enterprise require\n`--corp <corpId>` unless stateful mode is explicitly enabled:\n\n```bash\nseal-use config mode stateful --corp <corpId>\nseal-use corps switch <corpId>\nseal-use config mode stateless\n```\n\nThe global mode is stored in `~/.config/seal-use/config.json`; set `SEAL_USE_CONFIG_FILE` to\noverride that path. The legacy `current-corp` file is not read.\n\n## Stream & Exit Code Contract\n\n- **`stdout`**: Pure, deterministic JSON for machine/Agent parsing.\n- **`stderr`**: Diagnostics, probing logs, and **Next-Step Command Suggestions** (e.g. `👉 Next action: ...`).\n- **`Exit Code`**: `0` on success, non-zero (e.g. `1`) on failure to trigger Agent error self-remediation.\n\n## Top-Level Commands\n\n```bash\nseal-use version\nseal-use config paths\nseal-use config get\nseal-use config mode <stateful|stateless> [--corp <corpId>]\nseal-use config lint <enable|disable|status> [--linter <name>] [--min-score <score>]\nseal-use rules pull [--corp <corpId>] [--version <id|num|latest>] [--out <file>]\nseal-use rules lint [--file <path>] [--corp <corpId>] [--linter <name|path>] [--version <num>] [--code <code>] [--min-score <score>] [--summary]\nseal-use rules push [--file <path>] [--corp <corpId>] [--publish] [--version-name <name>] [--dry-run|--yes]\nseal-use service <start|stop|restart|status|logs> [--port 8787] [--host 127.0.0.1] [--lines 50]\nseal-use http [--port 8787] [--host 127.0.0.1]\nseal-use serve [--port 8787]\nseal-use update\nseal-use tools list\nseal-use corps list [--corp <corpId>]\nseal-use corps current [--corp <corpId>]\nseal-use corps switch <corpId>\nseal-use corps add-hose --json '{\"name\":\"企业名称\",\"domain\":\"https://app.ekuaibao.com\",\"appKey\":\"...\",\"appSecurity\":\"...\",\"proxyStaffBizId\":\"corpId:staffId\"}'\nseal-use corps add-seal --json '{\"sealUrl\":\"https://tenant.sealai.cc\",\"token\":\"seal-bearer-token\"}'\nseal-use corps add-link <https://.../web/thirdparty.html?...> [--name <customName>] [--overwrite]\nseal-use auth diagnose [--corp <corpId>]\nseal-use auth hose-link [--corp <corpId>] [--expire 7200]\nseal-use delegation list [--corp <corpId>]\nseal-use delegation create [--note <note>] [--from-link <url>] [--corp <corpId>]\nseal-use delegation revoke <tokenId> [--corp <corpId>]\nseal-use users create --name <name> --phone <phone> [--dept <deptId>] [--corp <corpId>]\nseal-use users reset-password <userId> [--corp <corpId>]\nseal-use users get <userId> [--corp <corpId>]\nseal-use users delete <userId> [--corp <corpId>]\nseal-use llm config [--corp <corpId>]\nseal-use llm providers [--corp <corpId>]\nseal-use permissions available [--corp <corpId>]\nseal-use permissions configs [--corp <corpId>]\nseal-use billing status [--corp <corpId>]\nseal-use billing plans [--corp <corpId>]\nseal-use billing features [--corp <corpId>]\nseal-use webhook list [--query <text>] [--show-secret] [--corp <corpId>]\nseal-use webhook get|find <idOrName> [--show-secret] [--corp <corpId>]\nseal-use webhook add --name <name> --result-url <url> [--mode assisted|semi_automatic|fully_automatic] [--auto-approval-rate 60] [--secret <secret>] [--corp <corpId>]\nseal-use webhook update <idOrName> [--name <name>] [--result-url <url>] [--mode assisted|semi_automatic|fully_automatic] [--auto-approval-rate 60] [--secret <secret>|--rotate-secret] [--corp <corpId>]\nseal-use webhook delete <idOrName> --yes [--corp <corpId>]\nseal-use deploy hosecloud requirements [--corp <corpId>]\nseal-use deploy hosecloud list [--corp <corpId>]\nseal-use deploy hosecloud get [<sign-key>] [--corp <corpId>]\nseal-use deploy hosecloud status [--corp <corpId>]\nseal-use deploy hosecloud configure --json '{...}' [--corp <corpId>]\nseal-use deploy hosecloud sync [<sign-key>] [--auto] [--corp <corpId>]\nseal-use preference get [--corp <corpId>]\nseal-use preference decision update --json '{\"explicitApprove\":\"...\"}' [--corp <corpId>]\nseal-use preference thinking-depth set --default <medium|high> [--corp <corpId>]\nseal-use preference thinking-depth policies list [--corp <corpId>]\nseal-use preference thinking-depth policies upsert --json '{...}' [--corp <corpId>]\nseal-use preference thinking-depth policies remove <policyId> [--corp <corpId>]\nseal-use source config [--corp <corpId>]\nseal-use tool <toolName> [--corp <corpId>] [--json '{\"key\":\"value\"}']\nseal-use approval-runs summary --corp <corpId> [--date YYYY-MM-DD] [--timezone Asia/Shanghai]\nseal-use approval-runs stats --corp <corpId> [--since 3months] [--dedupe-by sourceDocumentSN|sourceDocumentId|id]\nseal-uLine truncated
Use this workflow when a customer disputes an AI approval finding about an attachment, invoice, receipt, OCR result, or a UI-highlighted audit result.
@@ -738,7 +979,7 @@ Manual image check:
- The customer's objection that they were receipts rather than invoices was reasonable.
However, the final rejection also had an independent rule-37 reason: payment screenshots totaled 699.48 while reimbursement was 700.00.
`;var gN=`# Customer Feedback Rule Remediation
`;var mZ0=`# Customer Feedback Rule Remediation
Use this low-freedom workflow when the user provides packaged customer feedback from WeChat, screenshots, rejection notifications, a document number, or expected business behavior and wants diagnosis or an approval-rule change.
@@ -902,7 +1143,7 @@ Return a compact report containing:
- New version number and version name, if published
- Verification result
- Whether a regression rerun was performed
`;var bN="# Enterprise Onboarding\n\nRead this reference for first installation, zero configured enterprises, incoming credentials or assistance links, and browser-copied cURL. The goal is to identify the enterprise with the least user effort while keeping authentication material confidential.\n\n## Start With Discovery\n\nRun this before asking for setup parameters (if `seal-use` is not installed, first run `curl -fsSL https://git.ying-qing.cn/gitea/seal-use/raw/branch/main/scripts/install.sh | bash`):\n\n```bash\nseal-use version\nseal-use corps list\n```\n\n- If `seal-use` is not installed on the system, run the curl install script above to install it.\n- If the target enterprise is listed, match the user's human enterprise name to its returned `id` and use that value as `--corp` on every command. Do not ask the user for `corpId`.\n- If multiple configured enterprises plausibly match, show their human names and let the user choose. Keep their IDs as implementation details.\n- If none are configured, ask one plain-language question: “你现在手上有哪一种接入材料:合思开放平台 appKey/appSecurity、合思授权/协助链接、Seal 协助链接,还是从已登录的合思或 Seal 网页复制的 cURL?”\n\nDo not open with a JSON template or a list of internal fields.\n\nAll command examples in this reference are for the Agent to run. Do not hand them to the user as setup instructions. Communicate with the user in natural language and translate their answer into CLI/MCP parameters yourself.\n\n## Keep Two Concepts Separate\n\nClassify both the enterprise identity origin and how the current credential was acquired:\n\n| Enterprise identity origin | Credential material the user may have | Meaning |\n| --- | --- | --- |\n| Hose/合思-sourced Seal tenant | Hose `appKey` + `appSecurity` | Stable, refreshable standard integration |\n| Hose/合思-sourced Seal tenant | Hose authorization/assistance link | Temporary Hose authorization that can lead into the Seal SSO session |\n| Hose/合思-sourced Seal tenant | cURL copied from an authenticated Hose or Seal page | Snapshot of a signed-in browser session; it may expire |\n| Seal-native tenant | Seal assistance/delegation link | Temporary delegated access to a Seal tenant |\n| Seal-native tenant | cURL copied from an authenticated Seal page | Snapshot containing the Seal host and session authentication |\n\nCredential shape alone does not define identity origin. In particular, a Hose-sourced user eventually receives a Seal Bearer session after SSO. When `whoami` returns provider metadata, preserve it and use it to describe the tenant accurately.\n\n## Parameter Ownership\n\nAsk the user only for information that cannot be discovered safely:\n\n| Field | Owner and behavior |\n| --- | --- |\n| `appKey`, `appSecurity` | User supplies these for standard Hose OpenAPI onboarding. Explain that they come from the enterprise's 合思开放平台 application credentials. Treat both as secrets. |\n| `domain` | Probe the standard Hose SaaS domains automatically. Ask only when probing fails and the enterprise uses a private or dedicated deployment. |\n| Enterprise name and `corpId` | Discover from the credential response or Seal `whoami`. Do not ask the user to invent or locate them first. |\n| Administrator and `staffId` | Discover administrator candidates. If more than one is eligible, present name and masked phone for the user to choose; pass the selected ID internally. |\n| Seal URL, tenant ID, tenant slug | Discover from the assistance link, cURL host, and Seal `whoami`. |\n| Bearer token, cookies, signed query tokens | Extract only from user-supplied authentication material. Never print them back or include them in summaries. |\n\n## Route 1: Standard Hose Credentials\n\nThis is the preferred durable route for a Hose-sourced tenant. Read `hose-enterprise-init.md`, then use:\n\n```bash\nseal-use corps add-hose --json '{\"appKey\":\"...\",\"appSecurity\":\"...\"}'\n```\n\nThe CLI probes the standard domains, discovers the corporation, and discovers administrator candidates. If it returns multiple candidates, show only useful identifying information and ask which person should be used; retry with `staffName`, `staffPhone`, or the selected `staffId` internally. After creation, run:\n\n```bash\nseal-use auth diagnose --corp <discovered-id>\n```\n\nDo not ask for `domain`, `corpId`, or `proxyStaffBizId` up front. For a dedicated/private Hose deployment, add `domain` only after standard probing reports that it cannot find the enterprise.\n\n## Route 2: Incoming Assistance Link\n\nFirst distinguish the link by its host and purpose:\n\n- A Hose authorization/provisional link opens a Hose session and may continue through Seal SSO. It is not a Seal delegation link.\n- A Seal assistance/delegation link grants temporary delegated access on a Seal tenant. It is not a Hose OpenAPI credential.\n- `seal-use auth hose-link` and `seal-use delegation create` generate Line truncated
`;var oZ0="# Enterprise Onboarding\n\nRead this reference for first installation, zero configured enterprises, incoming credentials or assistance links, and browser-copied cURL. The goal is to identify the enterprise with the least user effort while keeping authentication material confidential.\n\n## Start With Discovery\n\nRun this before asking for setup parameters (if `seal-use` is not installed, first run `curl -fsSL https://git.ying-qing.cn/gitea/seal-use/raw/branch/main/scripts/install.sh | bash`):\n\n```bash\nseal-use version\nseal-use corps list\n```\n\n- If `seal-use` is not installed on the system, run the curl install script above to install it.\n- If the target enterprise is listed, match the user's human enterprise name to its returned `id` and use that value as `--corp` on every command. Do not ask the user for `corpId`.\n- If multiple configured enterprises plausibly match, show their human names and let the user choose. Keep their IDs as implementation details.\n- If none are configured, ask one plain-language question: “你现在手上有哪一种接入材料:合思开放平台 appKey/appSecurity、合思授权/协助链接、Seal 协助链接,还是从已登录的合思或 Seal 网页复制的 cURL?”\n\nDo not open with a JSON template or a list of internal fields.\n\nAll command examples in this reference are for the Agent to run. Do not hand them to the user as setup instructions. Communicate with the user in natural language and translate their answer into CLI/MCP parameters yourself.\n\n## Keep Two Concepts Separate\n\nClassify both the enterprise identity origin and how the current credential was acquired:\n\n| Enterprise identity origin | Credential material the user may have | Meaning |\n| --- | --- | --- |\n| Hose/合思-sourced Seal tenant | Hose `appKey` + `appSecurity` | Stable, refreshable standard integration |\n| Hose/合思-sourced Seal tenant | Hose authorization/assistance link | Temporary Hose authorization that can lead into the Seal SSO session |\n| Hose/合思-sourced Seal tenant | cURL copied from an authenticated Hose or Seal page | Snapshot of a signed-in browser session; it may expire |\n| Seal-native tenant | Seal assistance/delegation link | Temporary delegated access to a Seal tenant |\n| Seal-native tenant | cURL copied from an authenticated Seal page | Snapshot containing the Seal host and session authentication |\n\nCredential shape alone does not define identity origin. In particular, a Hose-sourced user eventually receives a Seal Bearer session after SSO. When `whoami` returns provider metadata, preserve it and use it to describe the tenant accurately.\n\n## Parameter Ownership\n\nAsk the user only for information that cannot be discovered safely:\n\n| Field | Owner and behavior |\n| --- | --- |\n| `appKey`, `appSecurity` | User supplies these for standard Hose OpenAPI onboarding. Explain that they come from the enterprise's 合思开放平台 application credentials. Treat both as secrets. |\n| `domain` | Probe the standard Hose SaaS domains automatically. Ask only when probing fails and the enterprise uses a private or dedicated deployment. |\n| Enterprise name and `corpId` | Discover from the credential response or Seal `whoami`. Do not ask the user to invent or locate them first. |\n| Administrator and `staffId` | Discover administrator candidates. If more than one is eligible, present name and masked phone for the user to choose; pass the selected ID internally. |\n| Seal URL, tenant ID, tenant slug | Discover from the assistance link, cURL host, and Seal `whoami`. |\n| Bearer token, cookies, signed query tokens | Extract only from user-supplied authentication material. Never print them back or include them in summaries. |\n\n## Route 1: Standard Hose Credentials\n\nThis is the preferred durable route for a Hose-sourced tenant. Read `hose-enterprise-init.md`, then use:\n\n```bash\nseal-use corps add-hose --json '{\"appKey\":\"...\",\"appSecurity\":\"...\"}'\n```\n\nThe CLI probes the standard domains, discovers the corporation, and discovers administrator candidates. If it returns multiple candidates, show only useful identifying information and ask which person should be used; retry with `staffName`, `staffPhone`, or the selected `staffId` internally. After creation, run:\n\n```bash\nseal-use auth diagnose --corp <discovered-id>\n```\n\nDo not ask for `domain`, `corpId`, or `proxyStaffBizId` up front. For a dedicated/private Hose deployment, add `domain` only after standard probing reports that it cannot find the enterprise.\n\n## Route 2: Incoming Assistance Link\n\nFirst distinguish the link by its host and purpose:\n\n- A Hose authorization/provisional link opens a Hose session and may continue through Seal SSO. It is not a Seal delegation link.\n- A Seal assistance/delegation link grants temporary delegated access on a Seal tenant. It is not a Hose OpenAPI credential.\n- `seal-use auth hose-link` and `seal-use delegation create` generat Line truncated
Use this reference for Hose/合思 enterprise configuration and user-facing Hose authorization links.
@@ -967,7 +1208,7 @@ Important:
- \`seal-use auth diagnose\` proves this stage works but redacts the token, so it is not enough when the user needs the actual clickable Hose link.
- **Formatting Requirement**: When returning a Hose authorization link to the user, ALWAYS provide BOTH a code block (\` \`\`\`text ... \`\`\` \`) for easy copying without accidental default browser redirection, AND a clickable hyperlink.
- If the CLI later provides a dedicated command for this, prefer that command.
`;var wN=`# Hose Enterprise Initialization & Automated Discovery
`;var tZ0=`# Hose Enterprise Initialization & Automated Discovery
Use this reference for automated Hose/合思 enterprise onboarding, multi-domain probing (including dedicated private cloud domains like 美年大健康), OpenAPI role and staff discovery, and non-TUI safe administrator selection.
@@ -1073,12 +1314,12 @@ seal-use corps hose-staffs --json '{
}'
\`\`\`
* 直接使用指定 ID 完成接入并进行连通性验证。
`;var DN={"SKILL.md":oN,"agents/openai.yaml":uN,"references/rule-lightweight.md":eN,"references/approval-bad-cases.md":lN,"references/cli.md":vN,"references/approval-run-lightweight.md":$N,"references/approval-attachment-trace.md":IN,"references/customer-feedback-rule-remediation.md":gN,"references/enterprise-onboarding.md":bN,"references/hose-enterprise-auth.md":fN,"references/hose-enterprise-init.md":wN};function SN(){return DN["SKILL.md"]||""}function mu(){return n4(UN(),".agents","skills","seal-use")}function AN(){return n4(UN(),".agents","skills","seal-home")}function dN(){let n=AN();if(s0(n))try{return hP(n,{recursive:!0,force:!0}),!0}catch{return!1}return!1}function i4(n=mu()){dN(),cN(n,{recursive:!0});let i=[];for(let[r,o]of Object.entries(DN)){let t=n4(n,r);cN(xP(t),{recursive:!0}),mP(t,o,"utf8"),i.push(r)}return{targetDir:n,files:i}}function t4(){let n=AN(),i=mu(),r=s0(n),o=s0(i);if(r||o)return dN(),i4(i),{synced:!0,targetDir:i};return{synced:!1}}function ON(n,i,r){if(n==="dump"||n==="cat"||n==="show"){process.stdout.write(`${SN()}
`);return}if(n==="install"||n==="init"||n==="sync"){let o=E(r.options.local)||E(r.options.workspace),t=U(r.options.dir)??U(r.options.target)??i,u=t?t:o?c$(process.cwd(),".agents","skills","seal-use"):mu(),e=i4(u);B({installed:!0,targetDir:e.targetDir,fileCount:e.files.length,files:e.files});return}if(n==="status"||n==="get"||!n){let o=mu(),t=c$(process.cwd(),".agents","skills","seal-use");B({global:{dir:o,installed:kN(c$(o,"SKILL.md"))},local:{dir:t,installed:kN(c$(t,"SKILL.md"))}});return}throw Error(`Unknown skill command: ${n}. Run 'seal-use help' for available commands.`)}async function yN(n,i){if(n==="config"){B(await io(i));return}throw Error(`Unknown source command: ${n??""}. Run 'seal-use help' for available commands.`)}async function LN(n,i,r,o){if(!n)throw Error("Usage: seal-use tool <toolName> [--json '{...}']");await J(n,i,r,oi(o.json),j(o.options))}function NN(){B(qu.map((n)=>({name:n.name,description:n.description})))}import{chmodSync as aP,mkdirSync as sP,renameSync as r4,rmSync as nB,unlinkSync as JN,writeFileSync as GN}from"node:fs";import{dirname as iB,join as WN}from"node:path";import{spawnSync as zt}from"node:child_process";function U$(n=process.execPath,i=import.meta.url){if(i.includes("/$bunfs/")||i.includes("\\$bunfs\\"))return!0;let r=n.toLowerCase().replace(/\\/g,"/");return!r.endsWith("/bun")&&!r.endsWith("/bun.exe")&&!r.endsWith("/node")&&!r.endsWith("/node.exe")}var XN="yunyingk/seal-use",au="yunyingk/seal-home";var tB="SEAL_USE_GITHUB_REPO",rB="SEAL_HOME_GITHUB_REPO";async function HN(n,i={}){let r={appRoot:n.appRoot,entryFile:n.entryFile,stateDir:a0,version:x,launcher:n.launcher},o=i.repo||process.env[tB]?.trim()||process.env[rB]?.trim()||XN,t=i.targetVersion?.trim(),u=t&&t.toLowerCase()!=="latest"?t:void 0;if(u){let W=u.replace(/^v/,""),y=YN(W,x);if(y<0){B({updated:!1,currentVersion:x,targetVersion:W,mode:U$()?"binary":"source",message:`Cannot downgrade seal-use from v${x} to older version v${W}. Updates must be forward-only.`});return}if(y===0&&!i.force){B({updated:!1,currentVersion:x,targetVersion:W,mode:U$()?"binary":"source",message:`seal-use is already at version v${x}. Use --force to reinstall.`});return}}if(i.changelogOnly){let W=await o4(o,i.limit??10);B({currentVersion:x,totalQueried:W.length,releases:W.map((y)=>({version:y.version,tagName:y.tagName,publishedAt:y.publishedAt,author:y.author,releaseNotes:y.notes,releaseUrl:y.htmlUrl,isCurrent:y.version===x,isNewer:xu(y.version,x)}))});return}if(!U$()){if(i.checkOnly){let y=await o4(o,30),M=y[0],q=M?.version??x,An=y.find((nn)=>nn.version===x),Wn=xu(q,x),pn=y.filter((nn)=>xu(nn.version,x));B({updated:!1,updateAvailable:Wn,currentVersion:x,currentVersionPublishedAt:An?.publishedAt,latestVersion:q,latestVersionPublishedAt:M?.publishedAt,behindCount:pn.length,pendingReleases:pn.map((nn)=>({version:nn.version,tagName:nn.tagName,publishedAt:nn.publishedAt,author:nn.author,releaseNotes:nn.notes,releaseUrl:nn.htmlUrl})),releaseNotes:M?.notes??"",releaseUrl:M?.htmlUrl??"",mode:"source",message:"Running in source development mode. Run 'seal-use update' to git pull & bun install."});return}let W=to(r).running;if(W)await Mt("stop",r);try{jN("git",["-C",n.appRoot,"pull","--ff-only"])}catch(y){console.error(`git pull skipped: ${y instanceof Error?y.message:String(y)}`)}if(jN("bun",["install"],{cwd:n.appRoot}),W)await Mt("start",r);B({updated:!0,serviceRestarted:W,version:x,mode:"source"});return}let e=oB(),l=uB(),$=await o4(o,30),I=u?$.find((W)=>W.version===u||W.tagName===u||W.tagName===`v${u}`)??await pN(o,u):$[0]??await pN(o);if(!I){B({updated:!1,currentVersion:x,mode:"binary",message:`Failed to query releases from repository '${o}'`});return}let g=I.version,b=$.find((W)=>W.version===x),f=xu(g,x),w=f||Boolean(i.force),c=$.filter((W)=>xu(W.version,x));if(i.checkOnly){B({updated:!1,updateAvailable:f,currentVersion:x,currentVersionPublishedAt:b?.publishedAt,latestVersion:g,latestVersionPublishedAt:I.publishedAt,behindCount:c.length,pendingReleases:c.map((W)=>({version:W.version,tagName:W.tagName,publishedAt:W.publishedAt,author:W.author,releaseNotes:W.notes,releaseUrl:W.htmlUrl})),releaseNotes:I.notes,releaseUrl:I.htmlUrl,mode:"binary"});return}if(!w){B({updated:!1,currentVersion:x,currentVersionPublishedAt:b?.publishedAt,latestVersion:g,latestVersionPublishedAt:I.publishedAt,mode:"binary",message:`seal-use is already up to date (v${x})`});return}let S=eB(I.assets,e,l);if(!S)throw Error(`No compatible binary found for ${e}-${l} in release v${g}. Available assets: ${I.assets.map((W)=>W.name).join(", ")}`);let k=to(r).running;if(k)await Mt("stop",r);let O=process.execPath,F=iB(O),Q=WN(F,`.tmp-update-${Date.now()}`);sP(Q,{recursive:!0});try{let W=WN(Q,S.name);await lB(S.downloadUrl,W,I.tagName,S.name);let y=W;if(S.name.endsWith(".tar.gz")||S.name.endsWith(".tgz"))y=vB(W,Q,e);else if(S.name.endsWith(".zip"))y=$B(W,Q,e);if(aP(y,493),process.platform==="darwin")try{zt("/usr/bin/codesign",["--remove-signature",y],{stdio:"ignore"}),zt("/usr/ Line truncated
`)}catch{}}async function lB(n,i,r,o){let t=u4(),u=[],e=r?r.startsWith("v")?r:`v${r}`:void 0,l=o||n.split("/").pop()||"";if(t!=="github"){if(e&&l)u.push(`https://git.ying-qing.cn/gitea/seal-use/releases/download/${e}/${l}`,`https://git.ying-qing.cn/gitea/seal-home/releases/download/${e}/${l}`);if(n.startsWith("https://git.ying-qing.cn"))u.push(n)}if(t!=="gitea")if(e&&l){let S=`https://github.com/${XN}/releases/download/${e}/${l}`;if(!process.env.CI)u.push(`https://ghfast.top/${S}`,`https://gh.ddlc.top/${S}`);u.push(S)}else if(n.includes("github.com")){if(!process.env.CI)u.push(`https://ghfast.top/${n}`,`https://gh.ddlc.top/${n}`);u.push(n)}else u.push(n);let $=Array.from(new Set(u)),I,g=6000,b=6000,f=307200,w=1e4,c=180000;for(let S=0;S<$.length;S++){let k=$[S],O=new AbortController,F="",Q=(q)=>{F=q;try{O.abort()}catch{}},W=setTimeout(()=>{Q("Connection timed out (no response headers within 6s)")},g),y,M;try{D$(`==> [${S+1}/${$.length}] Downloading via: ${k}`);let q=await fetch(k,{signal:O.signal});if(W)clearTimeout(W),W=void 0;if(!q.ok)throw Error(`HTTP ${q.status} ${q.statusText}`);y=setTimeout(()=>{Q("Overall download time exceeded 3 minutes")},c);let An=Number(q.headers.get("content-length"))||0,Wn=q.body?.getReader();if(!Wn){let yi=Buffer.from(await q.arrayBuffer());if(yi.length<1000)throw Error(`Downloaded content is suspiciously small (${yi.length} bytes)`);GN(i,yi),D$(`✓ Download succeeded (${(yi.length/1024/1024).toFixed(1)} MB)`);return}let pn=[],nn=0,ro=0;M=setTimeout(()=>{if(nn<f){let yi=(nn/1024).toFixed(1);Q(`Initial transfer too slow (${yi} KB < 300 KB in 6s), switching mirror...`)}},b);while(!0){let yi=Wn.read(),S$,TN=new Promise((d$,k$)=>{S$=setTimeout(()=>{k$(Error("Data transfer stalled (no chunk received for 10s)"))},w)}),v4;try{v4=await Promise.race([yi,TN])}finally{if(S$)clearTimeout(S$)}let{done:VN,value:A$}=v4;if(VN)break;if(A$){if(pn.push(A$),nn+=A$.length,M&&nn>=f)clearTimeout(M),M=void 0;let d$=Date.now();if(d$-ro>200){ro=d$;let k$=An?Math.round(nn/An*100):0,_N=(nn/1048576).toFixed(1),qN=An?(An/1048576).toFixed(1):"?";try{process.stderr.write(`\r ↳ Progress: ${k$}% (${_N} / ${qN} MB)...`)}catch{}}}}try{process.stderr.write(`
`)}catch{}let yt=Buffer.concat(pn);if(yt.length<1000)throw Error(`Downloaded content is suspiciously small (${yt.length} bytes)`);GN(i,yt),D$(`✓ Download completed successfully (${(yt.length/1024/1024).toFixed(1)} MB)`);return}catch(q){if(W)clearTimeout(W);if(M)clearTimeout(M);if(y)clearTimeout(y);let An=F||(q instanceof Error?q.message:String(q));I=Error(An),D$(`
↳ Mirror failed: ${I.message}`)}finally{if(W)clearTimeout(W);if(M)clearTimeout(M);if(y)clearTimeout(y)}}throw Error(`Failed to download asset from all mirrors: ${I?.message}`)}function vB(n,i,r){let o=zt("tar",["-xzf",n,"-C",i],{stdio:"pipe"});if(o.status!==0)throw Error(`Failed to extract tar archive: ${o.stderr.toString()}`);JN(n);let t=r==="windows"?"seal-use.exe":"seal-use",u=zt("find",[i,"-type","f"],{encoding:"utf8"}).stdout.trim().split(`
`).filter(Boolean),e=u.find((l)=>l.endsWith(`/${t}`)||l.endsWith(t));if(e)return e;return u[0]||n}function $B(n,i,r){let o=zt("unzip",["-q","-o",n,"-d",i],{stdio:"pipe"});if(o.status!==0)throw Error(`Failed to extract zip archive: ${o.stderr.toString()}`);JN(n);let t=r==="windows"?"seal-use.exe":"seal-use",u=zt("find",[i,"-type","f"],{encoding:"utf8"}).stdout.trim().split(`
`).filter(Boolean),e=u.find((l)=>l.endsWith(`/${t}`)||l.endsWith(t));if(e)return e;return u[0]||n}function YN(n,i){let r=n.replace(/^v/,"").split(".").map((t)=>Number.parseInt(t,10)||0),o=i.replace(/^v/,"").split(".").map((t)=>Number.parseInt(t,10)||0);for(let t=0;t<Math.max(r.length,o.length);t++){let u=r[t]??0,e=o[t]??0;if(u>e)return 1;if(u<e)return-1}return 0}function xu(n,i){return YN(n,i)>0}function jN(n,i,r={}){let o=zt(n,i,{cwd:r.cwd,encoding:"utf8",stdio:["ignore","pipe","pipe"]});if(o.stdout)console.error(o.stdout.trimEnd());if(o.stderr)console.error(o.stderr.trimEnd());if(o.status!==0)throw Error(`${n} ${i.join(" ")} failed with status ${o.status}`)}async function QN(n,i,r,o,t){if(n==="create"){let u=U(t.options.name)??i,e=U(t.options.phone);if(!u||!e)throw Error("Usage: seal-use users create --name <name> --phone <phone> [--dept <deptId>]");let l=U(t.options.dept)??U(t.options.departmentId);await J("seal_user_create",r,o,{name:u,phone:e,departmentIds:l?[l]:void 0},j(t.options));return}if(n==="reset-password"){let u=i??U(t.options.userId);if(!u)throw Error("Usage: seal-use users reset-password <userId>");await J("seal_user_reset_password",r,o,{userId:u},j(t.options));return}if(n==="search"||n==="list"){let u=i??U(t.options.keyword)??U(t.options.query)??"";await J("seal_user_search",r,o,{keyword:u},j(t.options));return}if(n==="get"){let u=i??U(t.options.userId);if(!u)throw Error("Usage: seal-use users get <userId>");await J("seal_user_get",r,o,{userId:u},j(t.options));return}if(n==="delete"){let u=i??U(t.options.userId);if(!u)throw Error("Usage: seal-use users delete <userId>");await J("seal_user_delete",r,o,{userId:u},j(t.options));return}if(n==="activate"){let u=i??U(t.options.userId);if(!u)throw Error("Usage: seal-use users activate <userId>");await J("seal_user_activate",r,o,{userId:u},j(t.options));return}if(n==="delegation"||n==="impersonate"){let u=i??U(t.options.userId)??U(t.options.phone);if(!u)throw Error("Usage: seal-use users delegation <userIdOrPhone> [--note <note>]");let e=U(t.options.note);await J("seal_user_delegation_create",r,o,{userIdOrPhone:u,note:e},j(t.options));return}throw Error(`Unknown users command: ${n??""}. Run 'seal-use help' for available commands.`)}async function FN(n,i,r,o,t){if(n==="list"){await J("seal_webhook_list",r,o,{query:U(t.options.query)??U(t.options.keyword),includeSecret:Z0(t.options)},j(t.options));return}if(n==="get"||n==="find"){let u=i??U(t.options.selector)??U(t.options.id);if(!u)throw Error("Usage: seal-use webhook get <idOrName> [--show-secret]");await J("seal_webhook_get",r,o,{selector:u,includeSecret:Z0(t.options)},j(t.options));return}if(n==="add"||n==="create"){let u=U(t.options.name)??i,e=U(t.options.resultUrl)??U(t.options["result-url"])??U(t.options.outgoingResultWebhook)??U(t.options["outgoing-result-webhook"]);if(!u||!e)throw Error("Usage: seal-use webhook add --name <name> --result-url <url> [--mode assisted|semi_automatic|fully_automatic]");let l=q0(t.options);await J("seal_webhook_add",r,o,{name:u,mode:_0(U(t.options.mode)),outgoingResultWebhook:e,autoApprovalRate:l,secret:U(t.options.secret)},j(t.options));return}if(n==="update"){let u=i??U(t.options.selector)??U(t.options.id);if(!u)throw Error("Usage: seal-use webhook update <idOrName> [options]");let e=U(t.options.secret),l=E(t.options.rotateSecret)??E(t.options["rotate-secret"]);if(e!==void 0&&l)throw Error("Use either --secret or --rotate-secret, not both");let $=U(t.options.name),I=_0(U(t.options.mode)),g=U(t.options.resultUrl)??U(t.options["result-url"])??U(t.options.outgoingResultWebhook)??U(t.options["outgoing-result-webhook"]),b=q0(t.options);if($===void 0&&I===void 0&&g===void 0&&b===void 0&&e===void 0&&!l)throw Error("Webhook update requires at least one field option");await J("seal_webhook_update",r,o,{selector:u,name:$,mode:I,outgoingResultWebhook:g,autoApprovalRate:b,secret:e,rotateSecret:l},j(t.options));return}if(n==="delete"){let u=i??U(t.options.selector)??U(t.options.id);if(!u)throw Error("Usage: seal-use webhook delete <idOrName> --yes");if(E(t.options.yes)!==!0)throw Error("Refusing to delete Webhook integration without --yes");await J("seal_webhook_delete",r,o,{selector:u,confirm:!0},j(t.options));return}throw Error(`Unknown webhook command: ${n??""}. Run 'seal-use help' for available commands.`)}var KN=e4(e4(e4(gB(import.meta.url)))),bB=new Set(["config","service","http","serve","update","tools","corps","tool","source","auth","delegation","users","llm","permissions","billing","webhook","webhooks","context","rules","approval-runs","simulation","deploy","preference","preferences","mcp","server","mcp-config","skill","openapi","probe","changelog"]),PN=Promise.resolve();function hu(n,i={}){let r=PN.then(()=>fB(n,i));return PN=r.then(()=>{return},()=>{return}),r}async function fB(n,i){let r=[],o=[],t=console.log,u=console.error,e={appRoot:i.appRoot??KN,entryFile:i.entryFile??IB(i.appRoot??KN,"src","cli.ts"),launcher:i.launcher};console.log=(...l)=>{r.push(M0(l))},c Line truncated
`;var eZ0={"SKILL.md":nZ0,"agents/openai.yaml":bZ0,"references/rule-lightweight.md":iZ0,"references/approval-bad-cases.md":pZ0,"references/cli.md":cZ0,"references/approval-run-lightweight.md":dZ0,"references/approval-attachment-trace.md":lZ0,"references/customer-feedback-rule-remediation.md":mZ0,"references/enterprise-onboarding.md":oZ0,"references/hose-enterprise-auth.md":rZ0,"references/hose-enterprise-init.md":tZ0};function $X0(){return eZ0["SKILL.md"]||""}function Lz(){return gu(sZ0(),".agents","skills","seal-use")}function IX0(){return gu(sZ0(),".agents","skills","seal-home")}function qX0(){let $=IX0();if(Au($))try{return Fw1($,{recursive:!0,force:!0}),!0}catch{return!1}return!1}function Pu($=Lz()){qX0(),aZ0($,{recursive:!0});let I=[];for(let[q,U]of Object.entries(eZ0)){let Y=gu($,q);aZ0(Aw1(Y),{recursive:!0}),Mw1(Y,U,"utf8"),I.push(q)}return{targetDir:$,files:I}}function Tu(){let $=IX0(),I=Lz(),q=Au($),U=Au(I);if(q||U)return qX0(),Pu(I),{synced:!0,targetDir:I};return{synced:!1}}function YX0($,I,q){if($==="dump"||$==="cat"||$==="show"){process.stdout.write(`${$X0()}
`);return}if($==="install"||$==="init"||$==="sync"){let U=S0(q.options.local)||S0(q.options.workspace),Y=x(q.options.dir)??x(q.options.target)??I,J=Y?Y:U?AO(process.cwd(),".agents","skills","seal-use"):Lz(),Q=Pu(J);R0({installed:!0,targetDir:Q.targetDir,fileCount:Q.files.length,files:Q.files});return}if($==="status"||$==="get"||!$){let U=Lz(),Y=AO(process.cwd(),".agents","skills","seal-use");R0({global:{dir:U,installed:UX0(AO(U,"SKILL.md"))},local:{dir:Y,installed:UX0(AO(Y,"SKILL.md"))}});return}throw Error(`Unknown skill command: ${$}. Run 'seal-use help' for available commands.`)}async function JX0($,I){if($==="config"){R0(await FY(I));return}throw Error(`Unknown source command: ${$??""}. Run 'seal-use help' for available commands.`)}async function QX0($,I,q,U){if(!$)throw Error("Usage: seal-use tool <toolName> [--json '{...}']");await L0($,I,q,r6(U.json),O0(U.options))}function KX0(){R0(Gz.map(($)=>({name:$.name,description:$.description})))}import{chmodSync as gw1,mkdirSync as Pw1,renameSync as ju,rmSync as Tw1,unlinkSync as VX0,writeFileSync as zX0}from"node:fs";import{dirname as jw1,join as wX0}from"node:path";import{spawnSync as UI}from"node:child_process";function gO($=process.execPath,I=import.meta.url){if(I.includes("/$bunfs/")||I.includes("\\$bunfs\\"))return!0;let q=$.toLowerCase().replace(/\\/g,"/");return!q.endsWith("/bun")&&!q.endsWith("/bun.exe")&&!q.endsWith("/node")&&!q.endsWith("/node.exe")}var WX0="yunyingk/seal-use",Fz="yunyingk/seal-home";var Ew1="SEAL_USE_GITHUB_REPO",Bw1="SEAL_HOME_GITHUB_REPO";async function ZX0($,I={}){let q={appRoot:$.appRoot,entryFile:$.entryFile,stateDir:Fu,version:a0,launcher:$.launcher},U=I.repo||process.env[Ew1]?.trim()||process.env[Bw1]?.trim()||WX0,Y=I.targetVersion?.trim(),J=Y&&Y.toLowerCase()!=="latest"?Y:void 0;if(J){let g=J.replace(/^v/,""),B=XX0(g,a0);if(B<0){R0({updated:!1,currentVersion:a0,targetVersion:g,mode:gO()?"binary":"source",message:`Cannot downgrade seal-use from v${a0} to older version v${g}. Updates must be forward-only.`});return}if(B===0&&!I.force){R0({updated:!1,currentVersion:a0,targetVersion:g,mode:gO()?"binary":"source",message:`seal-use is already at version v${a0}. Use --force to reinstall.`});return}}if(I.changelogOnly){let g=await Eu(U,I.limit??10);R0({currentVersion:a0,totalQueried:g.length,releases:g.map((B)=>({version:B.version,tagName:B.tagName,publishedAt:B.publishedAt,author:B.author,releaseNotes:B.notes,releaseUrl:B.htmlUrl,isCurrent:B.version===a0,isNewer:Nz(B.version,a0)}))});return}if(!gO()){if(I.checkOnly){let B=await Eu(U,30),k=B[0],h=k?.version??a0,n=B.find((p)=>p.version===a0),S=Nz(h,a0),t=B.filter((p)=>Nz(p.version,a0));R0({updated:!1,updateAvailable:S,currentVersion:a0,currentVersionPublishedAt:n?.publishedAt,latestVersion:h,latestVersionPublishedAt:k?.publishedAt,behindCount:t.length,pendingReleases:t.map((p)=>({version:p.version,tagName:p.tagName,publishedAt:p.publishedAt,author:p.author,releaseNotes:p.notes,releaseUrl:p.htmlUrl})),releaseNotes:k?.notes??"",releaseUrl:k?.htmlUrl??"",mode:"source",message:"Running in source development mode. Run 'seal-use update' to git pull & bun install."});return}let g=AY(q).running;if(g)await qI("stop",q);try{HX0("git",["-C",$.appRoot,"pull","--ff-only"])}catch(B){console.error(`git pull skipped: ${B instanceof Error?B.message:String(B)}`)}if(HX0("bun",["install"],{cwd:$.appRoot}),g)await qI("start",q);R0({updated:!0,serviceRestarted:g,version:a0,mode:"source"});return}let Q=vw1(),K=Rw1(),z=await Eu(U,30),w=J?z.find((g)=>g.version===J||g.tagName===J||g.tagName===`v${J}`)??await GX0(U,J):z[0]??await GX0(U);if(!w){R0({updated:!1,currentVersion:a0,mode:"binary",message:`Failed to query releases from repository '${U}'`});return}let G=w.version,H=z.find((g)=>g.version===a0),W=Nz(G,a0),V=W||Boolean(I.force),X=z.filter((g)=>Nz(g.version,a0));if(I.checkOnly){R0({updated:!1,updateAvailable:W,currentVersion:a0,currentVersionPublishedAt:H?.publishedAt,latestVersion:G,latestVersionPublishedAt:w.publishedAt,behindCount:X.length,pendingReleases:X.map((g)=>({version:g.version,tagName:g.tagName,publishedAt:g.publishedAt,author:g.author,releaseNotes:g.notes,releaseUrl:g.htmlUrl})),releaseNotes:w.notes,releaseUrl:w.htmlUrl,mode:"binary"});return}if(!V){R0({updated:!1,currentVersion:a0,currentVersionPublishedAt:H?.publishedAt,latestVersion:G,latestVersionPublishedAt:w.publishedAt,mode:"binary",message:`seal-use is already up to date (v${a0})`});return}let D=Cw1(w.assets,Q,K);if(!D)throw Error(`No compatible binary found for ${Q}-${K} in release v${G}. Available assets: ${w.assets.map((g)=>g.name).join(", ")}`);let O=AY(q).running;if(O)await qI("stop",q);let N=process.execPath,T=jw1(N),P=wX0(T,`.tmp-update-${Date.now()}`);Pw1(P,{recursive:!0});try{let g=wX0(P,D.name);await _w1(D.downloadUrl,g,w.tagName,D.name);let B=g;if(D.name.endsWith(".tar.gz")||D.name.endsWith(".tgz"))B=hw1(g,P,Q);else if(D.name.endsWith(".zip"))B=Sw1(g,P,Q);if(gw1(B,493),process.platform==="darwin")try{UI("/usr/bin/codesig Line truncated
`)}catch{}}async function _w1($,I,q,U){let Y=Bu(),J=[],Q=q?q.startsWith("v")?q:`v${q}`:void 0,K=U||$.split("/").pop()||"";if(Y!=="github"){if(Q&&K)J.push(`https://git.ying-qing.cn/gitea/seal-use/releases/download/${Q}/${K}`,`https://git.ying-qing.cn/gitea/seal-home/releases/download/${Q}/${K}`);if($.startsWith("https://git.ying-qing.cn"))J.push($)}if(Y!=="gitea")if(Q&&K){let D=`https://github.com/${WX0}/releases/download/${Q}/${K}`;if(!process.env.CI)J.push(`https://ghfast.top/${D}`,`https://gh.ddlc.top/${D}`);J.push(D)}else if($.includes("github.com")){if(!process.env.CI)J.push(`https://ghfast.top/${$}`,`https://gh.ddlc.top/${$}`);J.push($)}else J.push($);let z=Array.from(new Set(J)),w,G=6000,H=6000,W=307200,V=1e4,X=180000;for(let D=0;D<z.length;D++){let O=z[D],N=new AbortController,T="",P=(h)=>{T=h;try{N.abort()}catch{}},g=setTimeout(()=>{P("Connection timed out (no response headers within 6s)")},G),B,k;try{PO(`==> [${D+1}/${z.length}] Downloading via: ${O}`);let h=await fetch(O,{signal:N.signal});if(g)clearTimeout(g),g=void 0;if(!h.ok)throw Error(`HTTP ${h.status} ${h.statusText}`);B=setTimeout(()=>{P("Overall download time exceeded 3 minutes")},X);let n=Number(h.headers.get("content-length"))||0,S=h.body?.getReader();if(!S){let b=Buffer.from(await h.arrayBuffer());if(b.length<1000)throw Error(`Downloaded content is suspiciously small (${b.length} bytes)`);zX0(I,b),PO(`✓ Download succeeded (${(b.length/1024/1024).toFixed(1)} MB)`);return}let t=[],p=0,C=0;k=setTimeout(()=>{if(p<W){let b=(p/1024).toFixed(1);P(`Initial transfer too slow (${b} KB < 300 KB in 6s), switching mirror...`)}},H);while(!0){let b=S.read(),J0,j=new Promise((K0,G0)=>{J0=setTimeout(()=>{G0(Error("Data transfer stalled (no chunk received for 10s)"))},V)}),u;try{u=await Promise.race([b,j])}finally{if(J0)clearTimeout(J0)}let{done:d,value:a}=u;if(d)break;if(a){if(t.push(a),p+=a.length,k&&p>=W)clearTimeout(k),k=void 0;let K0=Date.now();if(K0-C>200){C=K0;let G0=n?Math.round(p/n*100):0,M0=(p/1048576).toFixed(1),v0=n?(n/1048576).toFixed(1):"?";try{process.stderr.write(`\r ↳ Progress: ${G0}% (${M0} / ${v0} MB)...`)}catch{}}}}try{process.stderr.write(`
`)}catch{}let f=Buffer.concat(t);if(f.length<1000)throw Error(`Downloaded content is suspiciously small (${f.length} bytes)`);zX0(I,f),PO(`✓ Download completed successfully (${(f.length/1024/1024).toFixed(1)} MB)`);return}catch(h){if(g)clearTimeout(g);if(k)clearTimeout(k);if(B)clearTimeout(B);let n=T||(h instanceof Error?h.message:String(h));w=Error(n),PO(`
↳ Mirror failed: ${w.message}`)}finally{if(g)clearTimeout(g);if(k)clearTimeout(k);if(B)clearTimeout(B)}}throw Error(`Failed to download asset from all mirrors: ${w?.message}`)}function hw1($,I,q){let U=UI("tar",["-xzf",$,"-C",I],{stdio:"pipe"});if(U.status!==0)throw Error(`Failed to extract tar archive: ${U.stderr.toString()}`);VX0($);let Y=q==="windows"?"seal-use.exe":"seal-use",J=UI("find",[I,"-type","f"],{encoding:"utf8"}).stdout.trim().split(`
`).filter(Boolean),Q=J.find((K)=>K.endsWith(`/${Y}`)||K.endsWith(Y));if(Q)return Q;return J[0]||$}function Sw1($,I,q){let U=UI("unzip",["-q","-o",$,"-d",I],{stdio:"pipe"});if(U.status!==0)throw Error(`Failed to extract zip archive: ${U.stderr.toString()}`);VX0($);let Y=q==="windows"?"seal-use.exe":"seal-use",J=UI("find",[I,"-type","f"],{encoding:"utf8"}).stdout.trim().split(`
`).filter(Boolean),Q=J.find((K)=>K.endsWith(`/${Y}`)||K.endsWith(Y));if(Q)return Q;return J[0]||$}function XX0($,I){let q=$.replace(/^v/,"").split(".").map((Y)=>Number.parseInt(Y,10)||0),U=I.replace(/^v/,"").split(".").map((Y)=>Number.parseInt(Y,10)||0);for(let Y=0;Y<Math.max(q.length,U.length);Y++){let J=q[Y]??0,Q=U[Y]??0;if(J>Q)return 1;if(J<Q)return-1}return 0}function Nz($,I){return XX0($,I)>0}function HX0($,I,q={}){let U=UI($,I,{cwd:q.cwd,encoding:"utf8",stdio:["ignore","pipe","pipe"]});if(U.stdout)console.error(U.stdout.trimEnd());if(U.stderr)console.error(U.stderr.trimEnd());if(U.status!==0)throw Error(`${$} ${I.join(" ")} failed with status ${U.status}`)}async function DX0($,I,q,U,Y){if($==="create"){let J=x(Y.options.name)??I,Q=x(Y.options.phone);if(!J||!Q)throw Error("Usage: seal-use users create --name <name> --phone <phone> [--dept <deptId>]");let K=x(Y.options.dept)??x(Y.options.departmentId);await L0("seal_user_create",q,U,{name:J,phone:Q,departmentIds:K?[K]:void 0},O0(Y.options));return}if($==="reset-password"){let J=I??x(Y.options.userId);if(!J)throw Error("Usage: seal-use users reset-password <userId>");await L0("seal_user_reset_password",q,U,{userId:J},O0(Y.options));return}if($==="search"||$==="list"){let J=I??x(Y.options.keyword)??x(Y.options.query)??"";await L0("seal_user_search",q,U,{keyword:J},O0(Y.options));return}if($==="get"){let J=I??x(Y.options.userId);if(!J)throw Error("Usage: seal-use users get <userId>");await L0("seal_user_get",q,U,{userId:J},O0(Y.options));return}if($==="delete"){let J=I??x(Y.options.userId);if(!J)throw Error("Usage: seal-use users delete <userId>");await L0("seal_user_delete",q,U,{userId:J},O0(Y.options));return}if($==="activate"){let J=I??x(Y.options.userId);if(!J)throw Error("Usage: seal-use users activate <userId>");await L0("seal_user_activate",q,U,{userId:J},O0(Y.options));return}if($==="delegation"||$==="impersonate"){let J=I??x(Y.options.userId)??x(Y.options.phone);if(!J)throw Error("Usage: seal-use users delegation <userIdOrPhone> [--note <note>]");let Q=x(Y.options.note);await L0("seal_user_delegation_create",q,U,{userIdOrPhone:J,note:Q},O0(Y.options));return}throw Error(`Unknown users command: ${$??""}. Run 'seal-use help' for available commands.`)}import{existsSync as OX0}from"node:fs";async function LX0($){if(!OX0($))throw Error(`File not found: ${$}`);let I=Kz($);console.log(JSON.stringify(await Qz(I.fileBuffer,I.fileName),null,2))}async function NX0($,I,q,U,Y){if($==="material-pack"||$==="material-pack-push"){let J=$==="material-pack-push"?"push":I,Q=$==="material-pack-push"?x(Y.options.file)??x(Y.options.input):Y.command[3]??x(Y.options.file)??x(Y.options.input);if(!Q)throw Error("Usage: seal-use webhook material-pack <preview|push> <材料包.zip>");if(!OX0(Q))throw Error(`File not found: ${Q}`);let K=Kz(Q);if(J==="preview"){console.log(JSON.stringify(await Qz(K.fileBuffer,K.fileName),null,2));return}if(J!=="push")throw Error("Usage: seal-use webhook material-pack <preview|push> <材料包.zip>");let z=x(Y.options.webhook)??x(Y.options.selector);if(!z)throw Error("Push requires --webhook <idOrName>");let w=Wq(await Vq(q),z),G=await UO(K.fileBuffer,K.fileName,{webhookUrl:w.incomingDocumentWebhook.url,secret:w.secret});console.log(JSON.stringify(G,null,2));return}if($==="list"){await L0("seal_webhook_list",q,U,{query:x(Y.options.query)??x(Y.options.keyword),includeSecret:Gu(Y.options)},O0(Y.options));return}if($==="get"||$==="find"){let J=I??x(Y.options.selector)??x(Y.options.id);if(!J)throw Error("Usage: seal-use webhook get <idOrName> [--show-secret]");await L0("seal_webhook_get",q,U,{selector:J,includeSecret:Gu(Y.options)},O0(Y.options));return}if($==="add"||$==="create"){let J=x(Y.options.name)??I,Q=x(Y.options.resultUrl)??x(Y.options["result-url"])??x(Y.options.outgoingResultWebhook)??x(Y.options["outgoing-result-webhook"]);if(!J||!Q)throw Error("Usage: seal-use webhook add --name <name> --result-url <url> [--mode assisted|semi_automatic|fully_automatic]");let K=wu(Y.options);await L0("seal_webhook_add",q,U,{name:J,mode:zu(x(Y.options.mode)),outgoingResultWebhook:Q,autoApprovalRate:K,secret:x(Y.options.secret)},O0(Y.options));return}if($==="update"){let J=I??x(Y.options.selector)??x(Y.options.id);if(!J)throw Error("Usage: seal-use webhook update <idOrName> [options]");let Q=x(Y.options.secret),K=S0(Y.options.rotateSecret)??S0(Y.options["rotate-secret"]);if(Q!==void 0&&K)throw Error("Use either --secret or --rotate-secret, not both");let z=x(Y.options.name),w=zu(x(Y.options.mode)),G=x(Y.options.resultUrl)??x(Y.options["result-url"])??x(Y.options.outgoingResultWebhook)??x(Y.options["outgoing-result-webhook"]),H=wu(Y.options);if(z===void 0&&w===void 0&&G===void 0&&H===void 0&&Q===void 0&&!K)throw Error("Webhook update requires at least one field option");await L0("seal_webhook_update",q,U,{selector:J,name:z,mode:w,outgoingResultWebhook:G,autoApprovalRate:H,secret:Q,rotateSecret:K},O0(Y.options));return}if($==="delete"){let J=I??x(Y.options. Line truncated
`)?"":`
`}`);process.exitCode=n.exitCode}var yB=Boolean(I4.main==I4.module||!import.meta.url.includes("$bunfs")&&process.argv[1]&&BN(process.argv[1])===BN(Ri));if(yB)if(process.argv[2]==="--seal-use-cli"||process.argv[2]==="--seal-home-cli")await OB();else h0().catch((n)=>{console.error(n),process.exitCode=1});export{C0 as tokenizeCommand,h0 as startServer,AB as resolveMcpEnabled,dB as createServer,DB as SEAL_MCP_ENABLED_ENV,UB as SEAL_CLI_TOOL_NAME,SB as LEGACY_SEAL_MCP_ENABLED_ENV};
`}`);process.exitCode=$.exitCode}var rw1=Boolean(o.main==o.module||!import.meta.url.includes("$bunfs")&&process.argv[1]&&gX0(process.argv[1])===gX0(i5));if(rw1)if(process.argv[2]==="--seal-use-cli"||process.argv[2]==="--seal-home-cli")await ow1();else Xu().catch(($)=>{console.error($),process.exitCode=1});export{Wu as tokenizeCommand,Xu as startServer,dw1 as resolveMcpEnabled,lw1 as createServer,pw1 as SEAL_MCP_ENABLED_ENV,iw1 as SEAL_CLI_TOOL_NAME,cw1 as LEGACY_SEAL_MCP_ENABLED_ENV};
+1 -1
View File
@@ -2,7 +2,7 @@
"openapi": "3.1.0",
"info": {
"title": "seal-use Wrapped API",
"version": "0.10.5",
"version": "0.10.7",
"description": "Planned HTTP contract for the seal-use wrapped backend API.\n\nThese endpoints describe the intended stable API for frontend developers and agents once\nthe HTTP adapter is implemented.\nThey are not the raw downstream Seal endpoints. seal-use is responsible for enterprise\nselection, source authentication, response compaction, and diagnostics-friendly fields.\n"
},
"servers": [
+1 -1
View File
@@ -1,7 +1,7 @@
openapi: 3.1.0
info:
title: seal-use Wrapped API
version: 0.10.5
version: 0.10.7
description: |
Planned HTTP contract for the seal-use wrapped backend API.
+6 -1
View File
@@ -1,6 +1,6 @@
{
"name": "seal-use",
"version": "0.10.5",
"version": "0.10.7",
"type": "module",
"module": "src/server.ts",
"bin": {
@@ -22,11 +22,16 @@
},
"dependencies": {
"@modelcontextprotocol/sdk": "^1.29.0",
"exceljs": "^4.4.0",
"iconv-lite": "^0.7.3",
"ky": "^2.0.2",
"pinyin-pro": "^3.29.3",
"yauzl": "^3.4.0",
"zod": "^4.4.3"
},
"devDependencies": {
"@types/bun": "^1.3.14",
"@types/yauzl": "^3.4.0",
"bun-types": "^1.3.14",
"typescript": "^5.9.3",
"yaml": "^2.9.0"
+5 -4
View File
@@ -1,12 +1,12 @@
---
name: seal-use
description: "v0.10.5: Use for Seal Use first-time enterprise onboarding, Hose/合思 or Seal-native authentication, assistance links and browser cURL intake, plus tenant approval operations, diagnosis, simulation, rules, users, configuration, and search."
description: "v0.10.7: Use for Seal Use first-time enterprise onboarding, Hose/合思 or Seal-native authentication, assistance links and browser cURL intake, plus tenant approval operations, diagnosis, simulation, rules, users, configuration, and search."
metadata:
version: 0.10.5
short-description: Seal tenant and Hose approval automation (v0.10.5)
version: 0.10.7
short-description: Seal tenant and Hose approval automation (v0.10.7)
---
# Seal Use (v0.10.5)
# Seal Use (v0.10.7)
Use the `seal_cli` MCP tool when it is available; pass the command string as its `command` argument. If MCP is unavailable, fall back to the global `seal-use` CLI. This skill is a routing layer for agents: keep this file short, choose the right command, and read a focused reference only when the task needs detail.
@@ -66,6 +66,7 @@ seal-use corps list
- System Permissions Config: `seal-use permissions available --corp <corpId>`, `seal-use permissions configs --corp <corpId>`.
- Billing & Feature Quotas: `seal-use billing status --corp <corpId>`, `seal-use billing plans --corp <corpId>`, `seal-use billing features --corp <corpId>`.
- Webhook 审批回调管理: `seal-use webhook <list|get|add|update|delete> --corp <corpId>`.
- Webhook 材料包导入: `seal-use webhook material-pack preview <材料包.zip> --corp <corpId>` 只做本地校验和解析;`... push <材料包.zip> --webhook <idOrName> --corp <corpId>` 上传附件并通过入站 Webhook 触发 AI 审批。它与 `simulation material_pack` 的官方服务端导入流程相互独立。
- HTTP REST API & Docs Server: `seal-use http [--port 8787] [--host 127.0.0.1]` (提供 `/docs` 交互文档、`/openapi.json`、`POST /api/cli` 与 `/v1/*` REST API)。
- 审批规则质量校验 (Linter): `seal-use rules lint [--linter <name|path>] [--version <num>] [--code <code>] [--min-score <score>] [--summary] --corp <corpId>`; read `references/rule-lint.md`. 全局配置默认关闭 (`config lint <enable|disable>`)。
- Full CLI inventory: read `references/cli.md`.
+12 -4
View File
@@ -38,8 +38,10 @@ seal-use config paths
seal-use config get
seal-use config mode <stateful|stateless> [--corp <corpId>]
seal-use config lint <enable|disable|status> [--linter <name>] [--min-score <score>]
seal-use rules lint [--corp <corpId>] [--linter <name|path>] [--version <num>] [--code <code>] [--min-score <score>] [--summary]
seal-use service <start|stop|restart|status>
seal-use rules pull [--corp <corpId>] [--version <id|num|latest>] [--out <file>]
seal-use rules lint [--file <path>] [--corp <corpId>] [--linter <name|path>] [--version <num>] [--code <code>] [--min-score <score>] [--summary]
seal-use rules push [--file <path>] [--corp <corpId>] [--publish] [--version-name <name>] [--dry-run|--yes]
seal-use service <start|stop|restart|status|logs> [--port 8787] [--host 127.0.0.1] [--lines 50]
seal-use http [--port 8787] [--host 127.0.0.1]
seal-use serve [--port 8787]
seal-use update
@@ -121,7 +123,7 @@ seal-use simulation package-upload <材料包.zip> --corp <corpId>
}
```
`seal-use service status` returns the PID, version, state directory, PID file, and log file for the optional local background process.
`seal-use service <start|stop|restart|status|logs>` manages the persistent background service daemon with embedded HTTP server (serving `/docs`, `/openapi.json`, and `POST /api/cli`). `status` returns the PID, version, host, port, active HTTP URL, state directory, PID file, and log file.
`seal-use update` updates the git checkout, runs `bun install`, and restarts the local service if it was running.
@@ -135,9 +137,13 @@ Approval rule maintenance:
- `seal-use rules count [--corp <corpId>]`
- `seal-use rules list --summary [--corp <corpId>]`
- `seal-use rules lint [--corp <corpId>] [--linter <name|path>] [--version <num>] [--code <code>] [--min-score <score>] [--summary]`
- `seal-use rules pull [--corp <corpId>] [--version <id|num|latest>] [--out <file>]`
- `seal-use rules lint [--file <path>] [--corp <corpId>] [--linter <name|path>] [--version <num>] [--code <code>] [--min-score <score>] [--summary]`
- `seal-use rules push [--file <path>] [--corp <corpId>] [--publish] [--version-name <name>] [--dry-run|--yes]`
- `seal-use rules clear [--corp <corpId>] [--dry-run|--yes]`
- `seal_approval_rules_list`
- `seal_approval_rules_pull`
- `seal_approval_rules_push`
- `seal_approval_rules_lint`
- `seal_approval_rules_clear`
- `seal_approval_rule_create`
@@ -189,6 +195,8 @@ Webhook integrations:
- `seal-use webhook add --name <name> --result-url <url> [--mode assisted|semi_automatic|fully_automatic] [--auto-approval-rate 60] [--secret <secret>] [--corp <corpId>]`
- `seal-use webhook update <idOrName> [--name <name>] [--result-url <url>] [--mode assisted|semi_automatic|fully_automatic] [--auto-approval-rate 60] [--secret <secret>|--rotate-secret] [--corp <corpId>]`
- `seal-use webhook delete <idOrName> --yes [--corp <corpId>]`
- `seal-use webhook material-pack preview <材料包.zip|信息表.xlsx> --corp <corpId>`
- `seal-use webhook material-pack push <材料包.zip|信息表.xlsx> --webhook <idOrName> --corp <corpId>`
- `seal_webhook_list`
- `seal_webhook_get`
- `seal_webhook_add`
+52 -1
View File
@@ -140,12 +140,63 @@ export async function handleRulesCommand(
return;
}
if (action === "pull") {
const version = stringOption(args.options.version) ?? maybeName;
const out = stringOption(args.options.out) ?? stringOption(args.options.file) ?? stringOption(args.options.f);
await runTool(
"seal_approval_rules_pull",
client,
corp,
{
version,
out
},
outputOptions(args.options)
);
return;
}
if (action === "push") {
const file = stringOption(args.options.file) ?? stringOption(args.options.f) ?? maybeName;
const confirmed = booleanOption(args.options.yes) === true;
const dryRun = booleanOption(args.options.dryRun) ?? booleanOption(args.options["dry-run"]) ?? !confirmed;
const publish = booleanOption(args.options.publish);
const versionName = stringOption(args.options.versionName) ?? stringOption(args.options["version-name"]);
const result = await runToolResult(
"seal_approval_rules_push",
client,
corp,
{
file,
dryRun,
confirm: confirmed,
publish,
versionName
}
);
if (!confirmed && dryRun && result && typeof result === "object") {
printJson(
{
...result,
nextCommand: `seal-use rules push --file ${file ?? "./rules.local.json"} --corp ${corp.id} --yes${publish ? " --publish" : ""}`
},
outputOptions(args.options)
);
return;
}
printJson(result, outputOptions(args.options));
return;
}
if (action === "lint") {
await runTool(
"seal_approval_rules_lint",
client,
corp,
{
file: stringOption(args.options.file) ?? stringOption(args.options.f),
linter: stringOption(args.options.linter),
version: stringOption(args.options.version),
code: stringOption(args.options.code),
@@ -159,5 +210,5 @@ export async function handleRulesCommand(
return;
}
throw new Error(`Unknown rules command: ${action ?? ""}. Available: count, list, clear, versions, version, get, search, lint. Run 'seal-use help' for available commands.`);
throw new Error(`Unknown rules command: ${action ?? ""}. Available: count, list, clear, versions, version, get, search, lint, pull, push. Run 'seal-use help' for available commands.`);
}
+24 -9
View File
@@ -3,17 +3,32 @@ import { join } from "node:path";
import { VERSION } from "../../version.js";
import { runServiceCommand } from "../service.js";
import { printJson } from "../printer.js";
import type { CliRuntime } from "../types.js";
import { numberOption, stringOption } from "../parser.js";
import type { CliRuntime, ParsedArgs } from "../types.js";
export const STATE_DIR = join(homedir(), ".config", "seal-use");
export async function handleServiceCommand(action: string | undefined, runtime: CliRuntime) {
const result = await runServiceCommand(action, {
appRoot: runtime.appRoot,
entryFile: runtime.entryFile,
stateDir: STATE_DIR,
version: VERSION,
launcher: runtime.launcher
});
export async function handleServiceCommand(
action: string | undefined,
runtime: CliRuntime,
args?: ParsedArgs
) {
const port = args ? numberOption(args.options.port) ?? numberOption(args.options.p) : undefined;
const host = args ? stringOption(args.options.host) ?? stringOption(args.options.h) : undefined;
const maxLines = args ? numberOption(args.options.lines) ?? numberOption(args.options.n) : undefined;
const result = await runServiceCommand(
action,
{
appRoot: runtime.appRoot,
entryFile: runtime.entryFile,
stateDir: STATE_DIR,
version: VERSION,
launcher: runtime.launcher,
port,
host
},
{ maxLines }
);
if (result !== undefined) printJson(result);
}
+33
View File
@@ -1,6 +1,10 @@
import type { CorpConfig } from "../../core/config/types.js";
import type { createSealClient } from "../../core/http/factory.js";
import { existsSync } from "node:fs";
import { runTool } from "../helpers.js";
import * as api from "../../domains/seal/api.js";
import { findWebhookIntegration } from "../../domains/seal/api.js";
import { previewMaterialPack, pushMaterialPack, readMaterialPackFile } from "../../domains/seal/material-pack/index.js";
import {
booleanOption,
parseWebhookMode,
@@ -11,6 +15,12 @@ import {
import { outputOptions } from "../printer.js";
import type { ParsedArgs } from "../types.js";
export async function handleWebhookMaterialPackPreview(filePath: string) {
if (!existsSync(filePath)) throw new Error(`File not found: ${filePath}`);
const input = readMaterialPackFile(filePath);
console.log(JSON.stringify(await previewMaterialPack(input.fileBuffer, input.fileName), null, 2));
}
export async function handleWebhookCommand(
action: string | undefined,
maybeName: string | undefined,
@@ -18,6 +28,29 @@ export async function handleWebhookCommand(
corp: CorpConfig,
args: ParsedArgs
) {
if (action === "material-pack" || action === "material-pack-push") {
const operation = action === "material-pack-push" ? "push" : maybeName;
const filePath = action === "material-pack-push"
? stringOption(args.options.file) ?? stringOption(args.options.input)
: args.command[3] ?? stringOption(args.options.file) ?? stringOption(args.options.input);
if (!filePath) throw new Error("Usage: seal-use webhook material-pack <preview|push> <材料包.zip>");
if (!existsSync(filePath)) throw new Error(`File not found: ${filePath}`);
const input = readMaterialPackFile(filePath);
if (operation === "preview") {
console.log(JSON.stringify(await previewMaterialPack(input.fileBuffer, input.fileName), null, 2));
return;
}
if (operation !== "push") throw new Error("Usage: seal-use webhook material-pack <preview|push> <材料包.zip>");
const selector = stringOption(args.options.webhook) ?? stringOption(args.options.selector);
if (!selector) throw new Error("Push requires --webhook <idOrName>");
const integration = findWebhookIntegration(await api.listWebhookIntegrations(client), selector);
const result = await pushMaterialPack(input.fileBuffer, input.fileName, {
webhookUrl: integration.incomingDocumentWebhook.url,
secret: integration.secret
});
console.log(JSON.stringify(result, null, 2));
return;
}
if (action === "list") {
await runTool(
"seal_webhook_list",
+10 -3
View File
@@ -19,12 +19,19 @@ export function parseArgs(argv: string[]): ParsedArgs {
}
if (arg.startsWith("-")) {
const key = arg.replace(/^-+/, "");
const raw = arg.replace(/^-+/, "");
if (raw.includes("=")) {
const eqIdx = raw.indexOf("=");
const key = raw.slice(0, eqIdx);
const val = raw.slice(eqIdx + 1);
options[key] = val;
continue;
}
const next = argv[index + 1];
if (!next || next.startsWith("-")) {
options[key] = true;
options[raw] = true;
} else {
options[key] = next;
options[raw] = next;
index += 1;
}
continue;
+2
View File
@@ -121,6 +121,8 @@ Usage:
seal-use webhook add --name <name> --result-url <url> [--mode assisted|semi_automatic|fully_automatic] [--auto-approval-rate 60] [--secret <secret>] [--corp <corpId>]
seal-use webhook update <idOrName> [--name <name>] [--result-url <url>] [--mode assisted|semi_automatic|fully_automatic] [--auto-approval-rate 60] [--secret <secret>|--rotate-secret] [--corp <corpId>]
seal-use webhook delete <idOrName> --yes [--corp <corpId>]
seal-use webhook material-pack preview <材料包.zip|信息表.xlsx> [--corp <corpId>]
seal-use webhook material-pack push <材料包.zip|信息表.xlsx> --webhook <idOrName> [--corp <corpId>]
seal-use deploy hosecloud requirements [--corp <corpId>]
seal-use deploy hosecloud list [--corp <corpId>]
seal-use deploy hosecloud get <sign-key> [--corp <corpId>]
+45 -2
View File
@@ -3,6 +3,7 @@
import { dirname, join } from "node:path";
import { fileURLToPath } from "node:url";
import { createSealClient } from "../core/http/factory.js";
import type { CorpConfig } from "../core/config/types.js";
import { VERSION } from "../version.js";
import { handleApprovalRunsCommand } from "./commands/approval-runs.js";
import { handleAuthCommand } from "./commands/auth.js";
@@ -28,7 +29,7 @@ import { handleToolCommand } from "./commands/tool.js";
import { handleToolsListCommand } from "./commands/tools.js";
import { handleUpdateCommand } from "./commands/update.js";
import { handleUsersCommand } from "./commands/users.js";
import { handleWebhookCommand } from "./commands/webhook.js";
import { handleWebhookCommand, handleWebhookMaterialPackPreview } from "./commands/webhook.js";
import { selectCorp } from "./helpers.js";
import { booleanOption, numberOption, parseArgs, stringOption } from "./parser.js";
import {
@@ -44,6 +45,7 @@ const DEFAULT_APP_ROOT = dirname(dirname(dirname(fileURLToPath(import.meta.url))
const KNOWN_AREAS = new Set([
"config",
"service",
"stop",
"http",
"serve",
"update",
@@ -77,9 +79,23 @@ const KNOWN_AREAS = new Set([
export type { CliResult, CliRunOptions } from "./types.js";
const STANDING_COMMANDS = new Set(["http", "server", "web", "mcp"]);
function isStandingCommand(argv: string[]): boolean {
if (!argv.length) return false;
const first = argv[0]?.toLowerCase();
const second = argv[1]?.toLowerCase();
if (first && STANDING_COMMANDS.has(first)) return true;
if ((first === "service" || first === "daemon") && second === "run") return true;
return false;
}
let runQueue = Promise.resolve();
export function runCli(argv: string[], options: CliRunOptions = {}): Promise<CliResult> {
if (isStandingCommand(argv)) {
return runCliOnce(argv, options);
}
const run = runQueue.then(() => runCliOnce(argv, options));
runQueue = run.then(
() => undefined,
@@ -155,6 +171,13 @@ async function dispatch(argv: string[], runtime: CliRuntime) {
throw new Error(`Unknown command: ${args.command.join(" ")}. Run 'seal-use help' for available commands.`);
}
if (area === "webhook" && action === "material-pack" && maybeName === "preview") {
const filePath = args.command[3] ?? stringOption(args.options.file) ?? stringOption(args.options.input);
if (!filePath) throw new Error("Usage: seal-use webhook material-pack preview <材料包.zip>");
await handleWebhookMaterialPackPreview(filePath);
return;
}
if (area === "openapi") {
handleOpenApiCommand(args);
return;
@@ -186,7 +209,12 @@ async function dispatch(argv: string[], runtime: CliRuntime) {
}
if (area === "service") {
await handleServiceCommand(action, runtime);
await handleServiceCommand(action, runtime, args);
return;
}
if (area === "stop") {
await handleServiceCommand("stop", runtime, args);
return;
}
@@ -241,6 +269,21 @@ async function dispatch(argv: string[], runtime: CliRuntime) {
return;
}
if (area === "rules" && action === "lint" && ("file" in args.options || "f" in args.options)) {
let corp: CorpConfig;
try {
corp = selectCorp(stringOption(args.options.corp));
} catch {
corp = {
id: "local",
name: "Local Workspace",
source: { type: "native" }
} as any;
}
await handleRulesCommand(action, maybeName, null as any, corp, args);
return;
}
const corp = selectCorp(stringOption(args.options.corp));
if (area === "source") {
+67 -1
View File
@@ -2,7 +2,7 @@ import { afterEach, describe, expect, test } from "bun:test";
import { mkdtempSync, rmSync, writeFileSync } from "node:fs";
import { tmpdir } from "node:os";
import { join } from "node:path";
import { serviceStatus } from "./service.js";
import { serviceStatus, readServiceLogs, runServiceCommand } from "./service.js";
const tempDirs: string[] = [];
@@ -27,5 +27,71 @@ describe("service lifecycle state", () => {
expect(status.running).toBe(false);
expect(status.pid).toBeUndefined();
expect(status.port).toBe(8787);
expect(status.host).toBe("127.0.0.1");
expect(status.url).toBeUndefined();
});
test("respects custom port and host configuration", () => {
const stateDir = mkdtempSync(join(tmpdir(), "seal-use-service-"));
tempDirs.push(stateDir);
const status = serviceStatus({
appRoot: "/tmp/seal-use",
entryFile: "/tmp/seal-use/src/cli.ts",
stateDir,
version: "0.10.7",
port: 9090,
host: "0.0.0.0"
});
expect(status.port).toBe(9090);
expect(status.host).toBe("0.0.0.0");
});
test("reads service log file lines safely", () => {
const stateDir = mkdtempSync(join(tmpdir(), "seal-use-service-"));
tempDirs.push(stateDir);
const emptyLogs = readServiceLogs({
appRoot: "/tmp/seal-use",
entryFile: "/tmp/seal-use/src/cli.ts",
stateDir
});
expect(emptyLogs.lines).toEqual([]);
expect(emptyLogs.totalLines).toBe(0);
const logFile = join(stateDir, "service.log");
writeFileSync(logFile, "line 1\nline 2\nline 3\nline 4\nline 5\n");
const logs = readServiceLogs(
{
appRoot: "/tmp/seal-use",
entryFile: "/tmp/seal-use/src/cli.ts",
stateDir
},
3
);
expect(logs.totalLines).toBe(5);
expect(logs.lines).toEqual(["line 3", "line 4", "line 5"]);
});
test("runServiceCommand handles logs and status actions", async () => {
const stateDir = mkdtempSync(join(tmpdir(), "seal-use-service-"));
tempDirs.push(stateDir);
const status = await runServiceCommand("status", {
appRoot: "/tmp/seal-use",
entryFile: "/tmp/seal-use/src/cli.ts",
stateDir
});
expect(status).toHaveProperty("running");
const logs = await runServiceCommand("logs", {
appRoot: "/tmp/seal-use",
entryFile: "/tmp/seal-use/src/cli.ts",
stateDir
});
expect(logs).toHaveProperty("lines");
});
});
+106 -12
View File
@@ -1,6 +1,7 @@
import { spawn, execFileSync } from "node:child_process";
import { existsSync, mkdirSync, readFileSync, rmSync, writeFileSync } from "node:fs";
import { join } from "node:path";
import { startHttpServer, DEFAULT_HTTP_PORT, DEFAULT_HTTP_HOST } from "../http/server.js";
export type ServiceConfig = {
appRoot: string;
@@ -11,12 +12,14 @@ export type ServiceConfig = {
command: string;
args?: string[];
};
port?: number;
host?: string;
};
export async function runServiceCommand(
action: string | undefined,
config: ServiceConfig,
options: { quiet?: boolean } = {}
options: { quiet?: boolean; maxLines?: number } = {}
) {
switch (action) {
case "run":
@@ -25,31 +28,55 @@ export async function runServiceCommand(
case "start":
return startService(config);
case "stop":
case "kill":
case "down":
case "shutdown":
return stopService(config, options);
case "restart":
stopService(config, { quiet: true });
return startService(config);
case "logs":
case "log":
return readServiceLogs(config, options.maxLines);
case "status":
case undefined:
return serviceStatus(config);
default:
throw new Error("Usage: seal-use service <start|stop|restart|status>");
throw new Error("Usage: seal-use service <start|stop|restart|status|logs>");
}
}
export function serviceStatus(config: ServiceConfig) {
const pidFile = getPidFile(config);
const metaFile = getMetaFile(config);
const pid = readServicePid(pidFile);
const running = pid ? isSealHomeProcess(pid, config.appRoot) : false;
if (pid && !running) {
rmSync(pidFile, { force: true });
if (!running) {
if (pid) rmSync(pidFile, { force: true });
if (existsSync(metaFile)) rmSync(metaFile, { force: true });
}
let storedMeta: { port?: number; host?: string; version?: string } | undefined;
if (running && existsSync(metaFile)) {
try {
storedMeta = JSON.parse(readFileSync(metaFile, "utf8"));
} catch {
// ignore
}
}
const port = config.port ?? storedMeta?.port ?? (process.env.PORT ? Number.parseInt(process.env.PORT, 10) : DEFAULT_HTTP_PORT);
const host = config.host ?? storedMeta?.host ?? (process.env.HOST ? process.env.HOST : DEFAULT_HTTP_HOST);
const version = config.version ?? storedMeta?.version;
return {
running,
pid: running ? pid : undefined,
version: config.version,
version,
port,
host,
url: running ? `http://${host}:${port}` : undefined,
appRoot: config.appRoot,
stateDir: config.stateDir,
pidFile,
@@ -57,28 +84,84 @@ export function serviceStatus(config: ServiceConfig) {
};
}
export function readServiceLogs(config: ServiceConfig, maxLines = 50) {
const logFile = getLogFile(config);
if (!existsSync(logFile)) {
return {
logFile,
lines: [],
totalLines: 0
};
}
const content = readFileSync(logFile, "utf8");
const allLines = content.split("\n").filter(Boolean);
const lines = allLines.slice(-maxLines);
return {
logFile,
lines,
totalLines: allLines.length
};
}
async function runService(config: ServiceConfig) {
const pidFile = getPidFile(config);
const metaFile = getMetaFile(config);
const logFile = getLogFile(config);
ensureStateDir(config.stateDir);
writeFileSync(pidFile, `${process.pid}\n`, { mode: 0o600 });
appendLog(logFile, `running pid=${process.pid}`);
const cleanup = () => {
const port = config.port ?? (process.env.PORT ? Number.parseInt(process.env.PORT, 10) : DEFAULT_HTTP_PORT);
const host = config.host ?? (process.env.HOST ? process.env.HOST : DEFAULT_HTTP_HOST);
writeFileSync(pidFile, `${process.pid}\n`, { mode: 0o600 });
writeFileSync(
metaFile,
JSON.stringify(
{
pid: process.pid,
port,
host,
version: config.version,
startedAt: new Date().toISOString()
},
null,
2
),
{ mode: 0o600 }
);
appendLog(logFile, `service starting on http://${host}:${port} pid=${process.pid}`);
let server: Awaited<ReturnType<typeof startHttpServer>> | null = null;
try {
server = await startHttpServer({ port, host, silent: true });
appendLog(logFile, `service listening pid=${process.pid}`);
} catch (err: unknown) {
appendLog(logFile, `service failed to bind port ${port}: ${err instanceof Error ? err.message : String(err)}`);
if (readServicePid(pidFile) === process.pid) {
rmSync(pidFile, { force: true });
rmSync(metaFile, { force: true });
}
throw err;
}
const cleanup = () => {
if (server) {
server.close();
server = null;
}
if (readServicePid(pidFile) === process.pid) {
rmSync(pidFile, { force: true });
rmSync(metaFile, { force: true });
}
appendLog(logFile, `stopped pid=${process.pid}`);
};
await new Promise<void>((resolve) => {
let stopped = false;
const heartbeat = setInterval(() => {}, 60_000);
const stop = () => {
if (stopped) return;
stopped = true;
cleanup();
clearInterval(heartbeat);
process.off("SIGTERM", stop);
process.off("SIGINT", stop);
resolve();
@@ -96,11 +179,15 @@ function startService(config: ServiceConfig) {
}
const launcher = config.launcher ?? { command: process.execPath, args: [config.entryFile] };
const child = spawn(launcher.command, [
const serviceArgs = [
...(launcher.args ?? []),
"service",
"run"
], {
];
if (config.port) serviceArgs.push("--port", String(config.port));
if (config.host) serviceArgs.push("--host", String(config.host));
const child = spawn(launcher.command, serviceArgs, {
cwd: config.appRoot,
detached: true,
stdio: ["ignore", "ignore", "ignore"],
@@ -116,14 +203,17 @@ function startService(config: ServiceConfig) {
function stopService(config: ServiceConfig, options: { quiet?: boolean } = {}) {
const pidFile = getPidFile(config);
const metaFile = getMetaFile(config);
const pid = readServicePid(pidFile);
if (!pid || !isSealHomeProcess(pid, config.appRoot)) {
rmSync(pidFile, { force: true });
rmSync(metaFile, { force: true });
return options.quiet ? undefined : { stopped: false, reason: "not running" };
}
process.kill(pid, "SIGTERM");
rmSync(pidFile, { force: true });
rmSync(metaFile, { force: true });
appendLog(getLogFile(config), `stop requested pid=${pid}`);
return options.quiet ? undefined : { stopped: true, pid };
}
@@ -156,6 +246,10 @@ function getPidFile(config: ServiceConfig) {
return join(config.stateDir, "service.pid");
}
function getMetaFile(config: ServiceConfig) {
return join(config.stateDir, "service.json");
}
function getLogFile(config: ServiceConfig) {
return join(config.stateDir, "service.log");
}
@@ -0,0 +1,51 @@
import { pinyin } from "pinyin-pro";
import type { MaterialAttachmentPlan, MaterialDocument, MaterialField } from "./types.js";
import type { ZipEntry } from "./validate.js";
function keyFromLabel(value: string): string {
const label = value.replace(/^\d+[\s.\-_—]*/, "").trim();
const parts = pinyin(label, { toneType: "none", type: "all", nonZh: "consecutive" })
.map((item: any) => item.pinyin ? item.pinyin : String(item.origin).toLowerCase().replace(/[^a-z0-9]+/g, ""))
.filter(Boolean);
return parts.join("") || "attachments";
}
export function buildAttachmentPlans(entries: ZipEntry[], documents: Array<{ document: MaterialDocument; laborNames: string[] }>): MaterialAttachmentPlan[] {
return documents.map(({ document, laborNames }) => {
const plan: MaterialAttachmentPlan = { documentId: document.documentId, categoryFields: [], personAttachments: {} };
for (const entry of entries) {
if (entry.fileName === "信息表.xlsx") continue;
const segments = entry.fileName.split("/");
if (segments[0] !== document.documentId || segments.length < 2) continue;
const add = (list: Array<{ key: string; label: string; entries: any[] }>, label: string) => {
const clean = label.replace(/^\d+[\s.\-_—]*/, "");
const item = list.find((value) => value.label === clean) ?? { key: clean === "附件" ? "attachments" : keyFromLabel(clean), label: clean, entries: [] };
if (!list.includes(item)) list.push(item);
item.entries.push({ fileName: entry.fileName, path: entry.fileName, size: entry.uncompressedSize });
};
if (segments.length === 2) add(plan.categoryFields, "附件");
else if (laborNames.includes(segments[1]!)) {
const list = plan.personAttachments[segments[1]!] ?? (plan.personAttachments[segments[1]!] = []);
add(list, segments.length === 3 ? "附件" : segments[2]!);
} else add(plan.categoryFields, segments[1]!);
}
return plan;
});
}
export function injectAttachmentPlan(document: MaterialDocument, plan: MaterialAttachmentPlan, uploaded: Map<string, unknown[]>): MaterialDocument {
const clone = structuredClone(document);
const lookup = (path: string) => uploaded.get(path) ?? [];
for (const category of plan.categoryFields) {
const value = category.entries.flatMap((entry) => lookup(entry.path));
clone.fields.push({ key: category.key, label: category.label, type: "ATTACHMENT", value });
}
const list = clone.fields.find((item) => item.key === "daoshi_list" && item.type === "LIST");
if (list && Array.isArray(list.value)) {
for (const row of list.value as MaterialField[][]) {
const name = row.find((item) => item.key === "name")?.value;
for (const category of plan.personAttachments[String(name)] ?? []) row.push({ key: category.key, label: category.label, type: "ATTACHMENT", value: category.entries.flatMap((entry) => lookup(entry.path)) });
}
}
return clone;
}
+6
View File
@@ -0,0 +1,6 @@
export * from "./types.js";
export * from "./signature.js";
export * from "./validate.js";
export * from "./parse.js";
export * from "./attachments.js";
export * from "./service.js";
@@ -0,0 +1,29 @@
import ExcelJS from "exceljs";
import { describe, expect, test } from "bun:test";
import { previewMaterialPack } from "./service.js";
import { signWebhookPayload } from "./signature.js";
async function workbookBuffer() {
const workbook = new ExcelJS.Workbook();
const main = workbook.addWorksheet("会议");
main.addRow(["会议编号", "会议名称", "总金额", "申请日期"]);
main.addRow(["DOC-001", "测试单据", 100, "2026-09-03 12:00:00"]);
const labor = workbook.addWorksheet("劳务明细");
labor.addRow(["会议编号", "姓名", "劳务费用"]);
labor.addRow(["DOC-001", "张三", 100]);
return Buffer.from(await workbook.xlsx.writeBuffer());
}
describe("Webhook material pack", () => {
test("previews official workbook shape without network access", async () => {
const result = await previewMaterialPack(await workbookBuffer(), "材料包.xlsx");
expect(result.documents).toHaveLength(1);
expect(result.documents[0]).toMatchObject({ documentId: "DOC-001", documentSN: "DOC-001" });
expect(result.documents[0]?.fields).toContainEqual(expect.objectContaining({ key: "daoshi_list", type: "LIST" }));
});
test("uses the confirmed timestamp.nonce.payload HMAC contract", () => {
expect(signWebhookPayload(1700000000, "nonce", { webhookId: "wh-1", value: 1 }, "secret"))
.toBe("d65d858afb6adc33dc640ebc6b259861c2b73ef0e6f0995ff822b41465fbfdf1");
});
});
+99
View File
@@ -0,0 +1,99 @@
import ExcelJS from "exceljs";
import { MaterialPackValidationError, type MaterialDocument, type MaterialField } from "./types.js";
type Parsed = { document: MaterialDocument; laborNames: string[] };
function field(key: string, label: string, type: string, value: unknown): MaterialField {
return { key, label, type, value };
}
function text(key: string, label: string, value: unknown) {
return field(key, label, "TEXT", value == null ? "" : String(value));
}
function amount(key: string, label: string, value: unknown) {
return field(key, label, "AMOUNT", typeof value === "number" ? { amount: value, currency: "CNY" } : null);
}
function dateValue(value: unknown): string | null {
if (value instanceof Date) return value.toISOString();
if (typeof value === "string" && value.trim()) return value.trim();
return null;
}
function startTimeValue(value: unknown): number | null {
if (value instanceof Date) return Math.floor(value.getTime() / 1000);
if (typeof value === "string" && value.trim()) {
const timestamp = Date.parse(value.trim().replace(" ", "T"));
if (Number.isFinite(timestamp)) return Math.floor(timestamp / 1000);
}
return null;
}
function headerMap(sheet: ExcelJS.Worksheet): Map<string, number> {
const map = new Map<string, number>();
sheet.getRow(1).eachCell((cell, index) => map.set(String(cell.value ?? "").trim(), index));
return map;
}
function cell(row: ExcelJS.Row, map: Map<string, number>, name: string): unknown {
const index = map.get(name);
return index ? row.getCell(index).value : undefined;
}
function buildMainFields(row: ExcelJS.Row, map: Map<string, number>): MaterialField[] {
const specs: Array<[string, string, string]> = [
["会议编号", "meeting_id", "TEXT"], ["会议名称", "meeting_name", "TEXT"], ["状态", "status", "TEXT"],
["总金额", "total_amount", "AMOUNT"], ["税前劳务总额", "pretax_labor_total", "AMOUNT"],
["报销事由", "reimbursement_reason", "TEXT"], ["po码", "po_code", "TEXT"], ["快递单号", "tracking_number", "TEXT"],
["申请日期", "application_date", "DATE"], ["更新日期", "updated_date", "DATE"]
];
return specs.flatMap(([label, key, type]) => {
const value = cell(row, map, label);
if (value == null || value === "") return [];
return [type === "TEXT" ? text(key, label, value) : type === "AMOUNT" ? amount(key, label, value) : field(key, label, type, dateValue(value))];
});
}
function buildDetailFields(row: ExcelJS.Row, map: Map<string, number>, specs: Array<[string, string, string]>): MaterialField[] {
return specs.flatMap(([label, key, type]) => {
const value = cell(row, map, label);
if (value == null || value === "") return [];
return [type === "TEXT" ? text(key, label, value) : type === "AMOUNT" ? amount(key, label, value) : field(key, label, type, dateValue(value))];
});
}
const laborSpecs: Array<[string, string, string]> = [["姓名", "name", "TEXT"], ["身份证号码", "id_number", "TEXT"], ["手机号", "phone", "TEXT"], ["劳务费用", "labor_fee", "AMOUNT"], ["税前费用", "pretax_fee", "AMOUNT"], ["开户行", "bank", "TEXT"], ["支行名称", "branch_name", "TEXT"], ["联行号", "bank_code", "TEXT"], ["银行卡号", "bank_card_number", "TEXT"]];
const expenseSpecs: Array<[string, string, string]> = [["报销金额", "reimbursement_amount", "AMOUNT"], ["费用类型", "expense_type", "TEXT"], ["发生时间", "occurrence_time", "DATE"], ["收款人", "payee", "TEXT"], ["开户行", "bank", "TEXT"], ["支行名称", "branch_name", "TEXT"], ["支行行号", "branch_code", "TEXT"], ["银行卡号", "bank_card_number", "TEXT"], ["费用说明", "expense_description", "TEXT"]];
export async function parseMaterialWorkbook(buffer: Uint8Array): Promise<Parsed[]> {
const workbook = new ExcelJS.Workbook();
await workbook.xlsx.load(Buffer.from(buffer) as any);
if (!workbook.worksheets.length) throw new MaterialPackValidationError(["信息表没有任何 Sheet"]);
const sheets = workbook.worksheets;
const mainSheet = sheets[0]!;
const maps = sheets.map(headerMap);
const mainMap = maps[0]!;
const idColumn = mainMap.get("会议编号") ?? 1;
const mainRows = (mainSheet.getRows(2, mainSheet.rowCount) ?? []).filter((row) => row.getCell(idColumn).value != null && row.getCell(idColumn).value !== "");
const ids = new Set<string>();
const parsed: Parsed[] = mainRows.map((row) => {
const id = String(row.getCell(idColumn).value).trim();
if (!id) throw new MaterialPackValidationError(["主表会议编号不能为空"]);
if (ids.has(id)) throw new MaterialPackValidationError([`主表会议编号重复: ${id}`]);
ids.add(id);
const apply = cell(row, mainMap, "申请日期");
const laborSheet = sheets.find((sheet, index) => index > 0 && headerMap(sheet).has("姓名"));
const expenseSheet = sheets.find((sheet, index) => index > 0 && headerMap(sheet).has("报销金额"));
const laborMap = laborSheet ? headerMap(laborSheet) : undefined;
const expenseMap = expenseSheet ? headerMap(expenseSheet) : undefined;
const laborRows = (laborSheet?.getRows(2, laborSheet.rowCount) ?? []).filter((r) => String(cell(r, laborMap!, "会议编号") ?? "").trim() === id);
const expenseRows = (expenseSheet?.getRows(2, expenseSheet.rowCount) ?? []).filter((r) => String(cell(r, expenseMap!, "会议编号") ?? "").trim() === id);
const laborNames = laborRows.map((r) => String(cell(r, headerMap(laborSheet!), "姓名") ?? "").trim()).filter(Boolean);
const fields = buildMainFields(row, mainMap);
if (laborRows.length) fields.push({ key: "daoshi_list", label: "导师列表", type: "LIST", value: laborRows.map((r) => buildDetailFields(r, laborMap!, laborSpecs)) });
if (expenseRows.length) fields.push({ key: "mingxi_list", label: "明细列表", type: "LIST", value: expenseRows.map((r) => buildDetailFields(r, expenseMap!, expenseSpecs)) });
return { laborNames, document: { type: "document", documentId: id, documentSN: id, startTime: startTimeValue(apply), fields } };
});
return parsed;
}
+71
View File
@@ -0,0 +1,71 @@
import { readFileSync } from "node:fs";
import { webhookHeaders } from "./signature.js";
import { buildAttachmentPlans, injectAttachmentPlan } from "./attachments.js";
import { parseMaterialWorkbook } from "./parse.js";
import { extractZipEntry, readZipEntries, validatePackEntries, type ZipEntry } from "./validate.js";
import type { MaterialPackPreview, MaterialPackPushResult } from "./types.js";
function webhookInfo(url: string): { baseUrl: string; webhookId: string } {
const parsed = new URL(url);
const match = parsed.pathname.match(/\/webhook\/([^/]+)/);
if (!match) throw new Error("Webhook URL 必须包含 /webhook/{webhookId}/document");
return { baseUrl: `${parsed.protocol}//${parsed.host}`, webhookId: match[1]! };
}
function isZip(buffer: Uint8Array, fileName: string): boolean {
return fileName.toLowerCase().endsWith(".zip") || (buffer[0] === 0x50 && buffer[1] === 0x4b && !fileName.toLowerCase().endsWith(".xlsx"));
}
async function prepare(fileBuffer: Uint8Array, fileName: string) {
let entries: ZipEntry[] = [];
let workbook = fileBuffer;
if (isZip(fileBuffer, fileName)) {
entries = await readZipEntries(fileBuffer);
validatePackEntries(entries);
const info = entries.find((entry) => entry.fileName === "信息表.xlsx");
if (!info) throw new Error("ZIP 根目录缺少信息表.xlsx");
workbook = await extractZipEntry(fileBuffer, info);
}
const parsed = await parseMaterialWorkbook(workbook);
const plans = buildAttachmentPlans(entries, parsed);
const documents = parsed.map((item) => item.document);
return { entries, parsed, plans, documents, fileBuffer };
}
export async function previewMaterialPack(fileBuffer: Uint8Array, fileName: string): Promise<MaterialPackPreview> {
const prepared = await prepare(fileBuffer, fileName);
return { warnings: [], documents: prepared.documents, attachmentPlan: prepared.plans };
}
export async function pushMaterialPack(fileBuffer: Uint8Array, fileName: string, config: { webhookUrl: string; secret: string }): Promise<MaterialPackPushResult> {
const prepared = await prepare(fileBuffer, fileName);
const { baseUrl, webhookId } = webhookInfo(config.webhookUrl);
const results: MaterialPackPushResult["results"] = [];
for (let index = 0; index < prepared.parsed.length; index += 1) {
const item = prepared.parsed[index]!;
const plan = prepared.plans[index]!;
const uploaded = new Map<string, unknown[]>();
for (const category of [...plan.categoryFields, ...Object.values(plan.personAttachments).flat()]) {
for (const entry of category.entries) {
const zipEntry = prepared.entries.find((candidate) => candidate.fileName === entry.path);
if (!zipEntry) continue;
const body = new FormData();
const attachment = await extractZipEntry(prepared.fileBuffer, zipEntry);
body.append("files", new File([new Uint8Array(attachment)], entry.fileName));
const response = await fetch(`${baseUrl}/api/v1/integrations/webhook/${encodeURIComponent(webhookId)}/attachments`, { method: "POST", headers: webhookHeaders({}, config.secret), body });
if (!response.ok) throw new Error(`附件上传失败 ${response.status}: ${await response.text()}`);
const json = await response.json() as { data?: unknown; attachments?: Array<{ data: unknown }> };
uploaded.set(entry.path, json.attachments?.map((value) => value.data) ?? (json.data === undefined ? [] : [json.data]));
}
}
const document = injectAttachmentPlan(item.document, plan, uploaded);
const response = await fetch(`${baseUrl}/api/v1/integrations/webhook/${encodeURIComponent(webhookId)}/document`, { method: "POST", headers: { "Content-Type": "application/json", ...webhookHeaders({ webhookId, ...document }, config.secret) }, body: JSON.stringify(document) });
if (!response.ok) throw new Error(`Webhook 单据推送失败 ${response.status}: ${await response.text()}`);
results.push({ documentId: document.documentId, document, pushResult: await response.json() });
}
return { warnings: [], results };
}
export function readMaterialPackFile(filePath: string): { fileBuffer: Buffer; fileName: string } {
return { fileBuffer: readFileSync(filePath), fileName: filePath.split(/[\\/]/).pop() ?? "material-pack.zip" };
}
@@ -0,0 +1,18 @@
import { createHmac, randomBytes } from "node:crypto";
export function signWebhookPayload(timestamp: number, nonce: string, payload: unknown, secret: string): string {
return createHmac("sha256", secret)
.update(`${timestamp}.${nonce}.${JSON.stringify(payload)}`)
.digest("hex");
}
export function webhookHeaders(payload: unknown, secret: string): Record<string, string> {
const timestamp = Math.floor(Date.now() / 1000);
const nonce = randomBytes(16).toString("hex");
return {
Authorization: `Bearer ${secret}`,
"x-webhook-signature": signWebhookPayload(timestamp, nonce, payload, secret),
"x-webhook-timestamp": String(timestamp),
"x-webhook-nonce": nonce
};
}
+44
View File
@@ -0,0 +1,44 @@
export type MaterialField = {
key: string;
label: string;
type: string;
value: unknown;
};
export type MaterialDocument = {
type: "document";
documentId: string;
documentSN: string;
startTime: number | null;
fields: MaterialField[];
};
export type MaterialAttachmentEntry = {
fileName: string;
size: number;
path: string;
};
export type MaterialAttachmentPlan = {
documentId: string;
categoryFields: Array<{ key: string; label: string; entries: MaterialAttachmentEntry[] }>;
personAttachments: Record<string, Array<{ key: string; label: string; entries: MaterialAttachmentEntry[] }>>;
};
export type MaterialPackPreview = {
warnings: string[];
documents: MaterialDocument[];
attachmentPlan: MaterialAttachmentPlan[];
};
export type MaterialPackPushResult = {
warnings: string[];
results: Array<{ documentId: string; document: MaterialDocument; pushResult: unknown }>;
};
export class MaterialPackValidationError extends Error {
constructor(public readonly errors: string[], public readonly warnings: string[] = []) {
super(`材料包校验失败:${errors.length} 个错误`);
this.name = "MaterialPackValidationError";
}
}
@@ -0,0 +1,77 @@
import yauzl from "yauzl";
import iconv from "iconv-lite";
import { MaterialPackValidationError } from "./types.js";
export const MATERIAL_PACK_LIMITS = { maxEntries: 1000, maxTotalSize: 500 * 1024 * 1024, maxCompressionRatio: 150 };
export type ZipEntry = { fileName: string; uncompressedSize: number; compressedSize: number; raw: unknown };
export async function readZipEntries(buffer: Uint8Array): Promise<ZipEntry[]> {
return new Promise((resolve, reject) => {
yauzl.fromBuffer(Buffer.from(buffer), { lazyEntries: true, autoClose: true }, (openError: Error | null, zipFile: any) => {
if (openError || !zipFile) return reject(openError ?? new Error("无法打开 ZIP"));
const entries: ZipEntry[] = [];
zipFile.readEntry();
zipFile.on("entry", (entry: any) => {
const fileName = decodeZipEntryName(entry);
if (!fileName.endsWith("/") && !isJunk(fileName)) {
entries.push({ fileName, uncompressedSize: entry.uncompressedSize, compressedSize: entry.compressedSize, raw: entry });
}
zipFile.readEntry();
});
zipFile.on("end", () => resolve(entries));
zipFile.on("error", reject);
});
});
}
function decodeZipEntryName(entry: any): string {
if (entry.fileNameUTF8 || (entry.generalPurposeBitFlag & 0x800)) return entry.fileNameUTF8 ?? entry.fileName;
const raw = Buffer.from(String(entry.fileName), "binary");
const utf8 = raw.toString("utf8");
if (utf8.includes("\uFFFD") || /[\u0080-\u00FF]/.test(utf8)) {
const gbk = iconv.decode(raw, "gbk");
if (!gbk.includes("\uFFFD")) return gbk;
}
return utf8;
}
export function isJunk(name: string): boolean {
const base = name.split("/").pop() ?? "";
return name.split("/").includes("__MACOSX") || base === ".DS_Store" || base.startsWith("._") || base.startsWith(".~") || base.startsWith("~$");
}
export function validatePackEntries(entries: ZipEntry[]): void {
const errors: string[] = [];
if (entries.length > MATERIAL_PACK_LIMITS.maxEntries) errors.push(`文件数超过 ${MATERIAL_PACK_LIMITS.maxEntries}`);
const total = entries.reduce((sum, entry) => sum + entry.uncompressedSize, 0);
if (total > MATERIAL_PACK_LIMITS.maxTotalSize) errors.push("解压后总大小超过 500MB");
for (const entry of entries) {
if (entry.fileName.startsWith("/") || entry.fileName.split("/").includes("..")) errors.push(`存在不安全路径: ${entry.fileName}`);
if (entry.compressedSize > 0 && entry.uncompressedSize / entry.compressedSize > MATERIAL_PACK_LIMITS.maxCompressionRatio) errors.push(`压缩比超过 150: ${entry.fileName}`);
}
const info = entries.find((entry) => entry.fileName === "信息表.xlsx");
if (!info) errors.push("ZIP 根目录缺少精确名为「信息表.xlsx」的文件");
if (entries.some((entry) => entry.fileName.toLowerCase().endsWith(".zip"))) errors.push("不允许嵌套 ZIP");
if (errors.length) throw new MaterialPackValidationError(errors);
}
export function extractZipEntry(buffer: Uint8Array, target: ZipEntry): Promise<Buffer> {
return new Promise((resolve, reject) => {
yauzl.fromBuffer(Buffer.from(buffer), { lazyEntries: true, autoClose: true }, (openError: Error | null, zipFile: any) => {
if (openError || !zipFile) return reject(openError ?? new Error("无法打开 ZIP"));
zipFile.readEntry();
zipFile.on("entry", (entry: any) => {
if (decodeZipEntryName(entry) !== target.fileName) return zipFile.readEntry();
zipFile.openReadStream(entry, (error: Error | null, stream: any) => {
if (error || !stream) return reject(error ?? new Error(`无法读取 ${target.fileName}`));
const chunks: Buffer[] = [];
stream.on("data", (chunk: Buffer) => chunks.push(chunk));
stream.on("end", () => resolve(Buffer.concat(chunks)));
stream.on("error", reject);
});
});
zipFile.on("error", reject);
});
});
}
+163
View File
@@ -0,0 +1,163 @@
import { describe, expect, test, afterEach } from "bun:test";
import { mkdtempSync, rmSync } from "node:fs";
import { tmpdir } from "node:os";
import { join } from "node:path";
import {
parseLocalRulesContent,
loadLocalRulesFile,
saveLocalRulesFile,
localRulesToLintTargets
} from "./rules-local.js";
import { findSealTool } from "./tools.js";
const tempDirs: string[] = [];
afterEach(() => {
for (const dir of tempDirs.splice(0)) {
rmSync(dir, { recursive: true, force: true });
}
});
describe("rules-local workspace", () => {
test("parses wrapped rules object", () => {
const raw = JSON.stringify({
corpId: "corp-1",
source: "draft",
rules: [
{ code: 1, description: "餐饮发票必须提供水单", scope: "MEAL", strictness: "MUST_FOLLOW" },
{ code: 2, description: "单张发票金额不得超标", scope: "ALL" }
]
});
const parsed = parseLocalRulesContent(raw);
expect(parsed.rules.length).toBe(2);
expect(parsed.meta.corpId).toBe("corp-1");
expect(parsed.meta.source).toBe("draft");
expect(parsed.rules[0]!.description).toBe("餐饮发票必须提供水单");
expect(parsed.rules[0]!.strictness).toBe("MUST_FOLLOW");
expect(parsed.rules[1]!.strictness).toBe("MUST_FOLLOW"); // default
});
test("parses raw rules array", () => {
const raw = JSON.stringify([
{ description: "打车必须备注起止地点", scope: "TAXI" }
]);
const parsed = parseLocalRulesContent(raw);
expect(parsed.rules.length).toBe(1);
expect(parsed.rules[0]!.description).toBe("打车必须备注起止地点");
expect(parsed.rules[0]!.code).toBe(1);
});
test("rejects invalid format or empty description", () => {
expect(() => parseLocalRulesContent("not-json")).toThrow("JSON 解析失败");
expect(() => parseLocalRulesContent(JSON.stringify({ other: 123 }))).toThrow("本地规则文件格式错误");
expect(() => parseLocalRulesContent(JSON.stringify([{ code: 1 }]))).toThrow("缺少有效的 'description'");
});
test("saves and loads local rules file accurately", () => {
const dir = mkdtempSync(join(tmpdir(), "seal-rules-test-"));
tempDirs.push(dir);
const filePath = join(dir, "sub", "rules.json");
const savedPath = saveLocalRulesFile(filePath, {
corpId: "test-corp",
source: "version:5",
rules: [
{ code: 10, description: "酒店住宿必须提供明细清单", scope: "HOTEL", strictness: "MUST_FOLLOW" }
]
});
expect(savedPath).toBe(filePath);
const loaded = loadLocalRulesFile(filePath);
expect(loaded.rules.length).toBe(1);
expect(loaded.meta.corpId).toBe("test-corp");
expect(loaded.rules[0]!.code).toBe(10);
expect(loaded.rules[0]!.description).toBe("酒店住宿必须提供明细清单");
});
test("converts local rules to lint targets", () => {
const targets = localRulesToLintTargets([
{ code: 1, description: "规则一", name: "R1" },
{ code: "0002", description: "规则二" },
{ description: "规则三" }
]);
expect(targets[0]!.code).toBe("#0001");
expect(targets[0]!.name).toBe("R1");
expect(targets[1]!.code).toBe("#0002");
expect(targets[2]!.code).toBe("#0003");
});
});
describe("rules-local offline lint tool integration", () => {
test("lints local file directly with 0 network calls and high score", async () => {
const dir = mkdtempSync(join(tmpdir(), "seal-lint-test-"));
tempDirs.push(dir);
const filePath = join(dir, "clean-rules.json");
saveLocalRulesFile(filePath, {
corpId: "test-corp",
rules: [
{
code: 1,
description: "单张发票金额超过500元时,必须提供经办人签字的费用明细水单与消费清单。",
scope: "MEAL",
strictness: "MUST_FOLLOW"
}
]
});
const lintTool = findSealTool("seal_approval_rules_lint")!;
expect(lintTool).toBeDefined();
const result = await lintTool.handler(
null as any,
{ file: filePath } as any,
{ corp: { id: "test-corp" } } as any
) as any;
expect(result.totalRules).toBe(1);
expect(result.passed).toBe(true);
expect(result.overallScore).toBe(100);
});
test("detects vague wording in local rules file and enforces minScore gate", async () => {
const dir = mkdtempSync(join(tmpdir(), "seal-lint-test-"));
tempDirs.push(dir);
const filePath = join(dir, "vague-rules.json");
saveLocalRulesFile(filePath, {
corpId: "test-corp",
rules: [
{
code: 1,
description: "金额适当即可,视情况而定。",
scope: "ALL"
}
]
});
const lintTool = findSealTool("seal_approval_rules_lint")!;
const result = await lintTool.handler(
null as any,
{ file: filePath } as any,
{ corp: { id: "test-corp" } } as any
) as any;
expect(result.totalRules).toBe(1);
expect(result.overallScore).toBeLessThan(100);
expect(result.issues[0].issues.some((i: any) => i.code === "VAGUE_WORD")).toBe(true);
// minScore enforcement
await expect(
lintTool.handler(
null as any,
{ file: filePath, minScore: 95 } as any,
{ corp: { id: "test-corp" } } as any
)
).rejects.toThrow("Linter 质量门禁未通过");
});
});
+153
View File
@@ -0,0 +1,153 @@
import { existsSync, readFileSync, writeFileSync, mkdirSync } from "node:fs";
import { dirname, resolve } from "node:path";
import type { RuleLintTarget } from "./linter/types.js";
export interface LocalRuleItem {
id?: string;
code?: number | string;
name?: string;
description: string;
scope?: string;
strictness?: string;
status?: string;
[key: string]: unknown;
}
export interface LocalRulesPayload {
corpId?: string;
source?: string;
versionNumber?: number;
exportedAt?: string;
rulesCount?: number;
rules: LocalRuleItem[];
}
/**
* Parses raw local rule content (JSON array or object with `rules` array)
* and normalizes them into a consistent structure.
*/
export function parseLocalRulesContent(rawText: string): {
rules: LocalRuleItem[];
meta: Omit<LocalRulesPayload, "rules">;
} {
let parsed: unknown;
try {
parsed = JSON.parse(rawText);
} catch (err) {
throw new Error(`本地规则文件 JSON 解析失败: ${err instanceof Error ? err.message : String(err)}`);
}
if (Array.isArray(parsed)) {
return {
rules: normalizeRuleItems(parsed),
meta: {
rulesCount: parsed.length
}
};
}
if (parsed && typeof parsed === "object") {
const obj = parsed as Record<string, unknown>;
const rawRules = Array.isArray(obj.rules) ? obj.rules : undefined;
if (!rawRules) {
throw new Error("本地规则文件格式错误: 顶层必须为规则数组或包含 'rules' 数组的对象");
}
return {
rules: normalizeRuleItems(rawRules),
meta: {
corpId: typeof obj.corpId === "string" ? obj.corpId : undefined,
source: typeof obj.source === "string" ? obj.source : undefined,
versionNumber: typeof obj.versionNumber === "number" ? obj.versionNumber : undefined,
exportedAt: typeof obj.exportedAt === "string" ? obj.exportedAt : undefined,
rulesCount: rawRules.length
}
};
}
throw new Error("本地规则文件格式错误: 顶层必须为规则数组或包含 'rules' 数组的对象");
}
function normalizeRuleItems(items: unknown[]): LocalRuleItem[] {
return items.map((item, idx) => {
if (!item || typeof item !== "object") {
throw new Error(`第 ${idx + 1} 条规则格式错误: 必须为对象`);
}
const r = item as Record<string, unknown>;
const description = typeof r.description === "string" ? r.description.trim() : "";
if (!description) {
throw new Error(`第 ${idx + 1} 条规则缺少有效的 'description' (规则描述) 字段`);
}
const code =
typeof r.code === "number" || typeof r.code === "string"
? r.code
: idx + 1;
return {
...r,
code,
description,
scope: typeof r.scope === "string" ? r.scope : "ALL",
strictness: typeof r.strictness === "string" ? r.strictness : "MUST_FOLLOW"
};
});
}
/**
* Loads a local rules file from path.
*/
export function loadLocalRulesFile(filePath: string): {
rules: LocalRuleItem[];
meta: Omit<LocalRulesPayload, "rules">;
resolvedPath: string;
} {
const resolved = resolve(filePath);
if (!existsSync(resolved)) {
throw new Error(`未找到本地规则文件: ${filePath} (${resolved})`);
}
const content = readFileSync(resolved, "utf8");
const parsed = parseLocalRulesContent(content);
return {
...parsed,
resolvedPath: resolved
};
}
/**
* Saves rules to a formatted JSON file.
*/
export function saveLocalRulesFile(
filePath: string,
data: LocalRulesPayload
): string {
const resolved = resolve(filePath);
mkdirSync(dirname(resolved), { recursive: true });
writeFileSync(resolved, `${JSON.stringify(data, null, 2)}\n`, "utf8");
return resolved;
}
/**
* Converts local rule items to linter targets.
*/
export function localRulesToLintTargets(rules: LocalRuleItem[]): RuleLintTarget[] {
return rules.map((r, idx) => {
let codeStr: string | undefined;
if (typeof r.code === "number") {
codeStr = `#${String(r.code).padStart(4, "0")}`;
} else if (typeof r.code === "string") {
codeStr = r.code.startsWith("#") ? r.code : `#${r.code}`;
} else {
codeStr = `#${String(idx + 1).padStart(4, "0")}`;
}
return {
id: r.id,
code: codeStr,
name: r.name,
description: r.description,
scope: r.scope,
strictness: r.strictness
};
});
}
+1 -1
View File
@@ -235,6 +235,7 @@ describe("sealTools", () => {
"seal_whoami",
"seal_approval_search",
"seal_approval_context_get",
"seal_webhook_material_pack",
"seal_runs_search",
"seal_action"
]);
@@ -1034,4 +1035,3 @@ function fakeDeployClient(): KyInstance {
}
} as unknown as KyInstance;
}
+199 -4
View File
@@ -9,6 +9,13 @@ import { loadGlobalConfig } from "../../core/config/loader.js";
import { createSealClientForToken } from "../../core/http/factory.js";
import { searchApprovalContent } from "./search.js";
import { loadRuleLinter, lintRuleBatch, lintSingleRule, type RuleLintTarget } from "./linter/index.js";
import {
loadLocalRulesFile,
saveLocalRulesFile,
localRulesToLintTargets,
type LocalRuleItem
} from "./rules-local.js";
import { previewMaterialPack, pushMaterialPack, readMaterialPackFile } from "./material-pack/index.js";
import {
ThinkingPolicySchema,
type ApprovalRule,
@@ -439,8 +446,9 @@ export const sealTools = [
},
{
name: "seal_approval_rules_lint",
description: "对 Seal 草稿审批规则或指定发布版本规则进行质量与可执行性检查(模糊词、悬空例外检测)",
description: "对 Seal 本地规则文件、草稿审批规则或指定发布版本规则进行质量与可执行性检查(模糊词、悬空例外检测)",
parameters: z.object({
file: z.string().optional().describe("指定本地规则文件路径进行离线质检(支持 .json),0网络请求、不污染远端草稿"),
linter: z.string().optional().describe("指定使用的校验器名称或脚本路径(如 builtin、strict、./my-linter.ts)"),
version: z.string().optional().describe("指定要质检的历史发布版本号或 ID(如 16 或 latest),不传默认质检当前草稿"),
code: z.string().optional().describe("按规则展示编号过滤(如 #0038)"),
@@ -452,6 +460,7 @@ export const sealTools = [
handler: async (
client: KyInstance,
params: {
file?: string;
linter?: string;
version?: string;
code?: string;
@@ -465,7 +474,11 @@ export const sealTools = [
let targets: RuleLintTarget[] = [];
let versionNumber: number | undefined;
if (params.version) {
if (params.file) {
const local = loadLocalRulesFile(params.file);
targets = localRulesToLintTargets(local.rules);
versionNumber = local.meta.versionNumber;
} else if (params.version) {
const versions = await api.listApprovalRuleVersions(client);
const versionNumberParsed = Number(params.version);
const version = isNaN(versionNumberParsed)
@@ -514,7 +527,7 @@ export const sealTools = [
const batchResult = await lintRuleBatch(
targets,
loadedLinter,
{ corpId: context.corp.id, versionNumber, allRules: targets },
{ corpId: context?.corp?.id, versionNumber, allRules: targets },
{ minScore: params.minScore, level: params.level, summary: params.summary }
);
@@ -527,6 +540,164 @@ export const sealTools = [
return batchResult;
}
},
{
name: "seal_approval_rules_pull",
description: "从 Seal 远端拉取草稿或指定版本规则,保存至本地规则文件(支持离线编辑与本地 Lint,绝不污染远端草稿)",
parameters: z.object({
version: z.string().optional().describe("指定拉取的历史发布版本号或 ID(如 16 或 latest),不传默认拉取当前草稿规则"),
out: z.string().optional().describe("保存的目标本地文件路径,默认为 ./rules.local.json")
}),
handler: async (
client: KyInstance,
params: {
version?: string;
out?: string;
},
context: ToolContext
) => {
const outPath = params.out ?? "./rules.local.json";
let rules: LocalRuleItem[] = [];
let source = "draft";
let versionNumber: number | undefined;
if (params.version) {
const versions = await api.listApprovalRuleVersions(client);
const versionNumberParsed = Number(params.version);
const targetVersion = isNaN(versionNumberParsed)
? params.version === "latest"
? versions[0]
: versions.find((v) => v.id === params.version)
: versions.find((v) => v.versionNumber === versionNumberParsed);
if (!targetVersion) {
throw new Error(`未找到指定的规则版本: ${params.version}`);
}
versionNumber = targetVersion.versionNumber;
source = `version:${versionNumber}`;
rules = (targetVersion.rules ?? []).map((r, idx) => ({
code: (r as any).code ? Number(String((r as any).code).replace(/^#/, "")) || idx + 1 : idx + 1,
name: (r as any).name ?? (r as any).title,
description: r.description ?? "",
scope: (r as any).scope ?? "ALL",
strictness: (r as any).strictness ?? "MUST_FOLLOW"
}));
} else {
const draftData = await api.listApprovalRules(client);
rules = (draftData.rules ?? []).map((r, idx) => ({
id: r.id,
code: r.code ?? idx + 1,
name: (r as any).name ?? (r as any).title,
description: r.description ?? "",
scope: r.scope ?? "ALL",
strictness: r.strictness ?? "MUST_FOLLOW",
status: r.status
}));
}
const savedPath = saveLocalRulesFile(outPath, {
corpId: context.corp.id,
source,
versionNumber,
exportedAt: new Date().toISOString(),
rulesCount: rules.length,
rules
});
return {
saved: true,
path: savedPath,
rulesCount: rules.length,
corpId: context.corp.id,
source,
versionNumber
};
}
},
{
name: "seal_approval_rules_push",
description: "将本地规则文件推送到远端草稿(本地调优通过后一键应用,支持直接发布为正式版本)",
parameters: z.object({
file: z.string().optional().describe("要推送的本地规则文件路径,默认为 ./rules.local.json"),
dryRun: z.boolean().optional().describe("是否仅预览变更而不实际写入远端(默认 true,传 --yes 或 confirm: true 执行写入)"),
confirm: z.boolean().optional().describe("确认覆盖写入远端草稿"),
publish: z.boolean().optional().describe("写入草稿后是否直接发布为一个正式版本"),
versionName: z.string().optional().describe("发布版本的名称(仅在 publish=true 时有效)")
}),
handler: async (
client: KyInstance,
params: {
file?: string;
dryRun?: boolean;
confirm?: boolean;
publish?: boolean;
versionName?: string;
},
context: ToolContext
) => {
const filePath = params.file ?? "./rules.local.json";
const local = loadLocalRulesFile(filePath);
const isConfirmed = params.confirm === true;
const isDryRun = params.dryRun ?? !isConfirmed;
const before = await api.listApprovalRules(client);
if (isDryRun) {
return {
corpId: context.corp.id,
dryRun: true,
localFile: local.resolvedPath,
localRulesCount: local.rules.length,
remoteDraftCount: before.rules.length,
willPublish: Boolean(params.publish),
message: "Preview mode. Use --yes or confirm=true to apply local rules to remote draft."
};
}
// Step 1: Clear existing draft rules
let deleted = 0;
for (const rule of before.rules) {
await api.deleteApprovalRule(client, rule.id);
deleted += 1;
}
// Step 2: Create new rules from local
const created: Array<{ id: string; description: string; code?: number }> = [];
for (const rule of local.rules) {
const strictness = rule.strictness?.toUpperCase()?.includes("SHOULD")
? "SHOULD_FOLLOW"
: rule.strictness?.toUpperCase()?.includes("SUGGEST")
? "SUGGESTION"
: "MUST_FOLLOW";
const newRule = await api.createApprovalRule(client, {
description: rule.description,
scope: rule.scope ?? "ALL",
strictness
});
created.push({ id: newRule.id, description: newRule.description, code: newRule.code });
}
// Step 3: Recode
await api.recodeApprovalRules(client);
// Step 4: Optional publish
let publishedVersion: unknown = undefined;
if (params.publish) {
const dateStr = new Date().toISOString().slice(0, 10).replace(/-/g, "");
const name = params.versionName || `v-local-${dateStr}-${Date.now().toString().slice(-4)}`;
publishedVersion = await api.publishApprovalRuleVersion(client, name);
}
return {
corpId: context.corp.id,
dryRun: false,
localFile: local.resolvedPath,
clearedDraftRules: deleted,
createdRules: created.length,
published: publishedVersion ?? false
};
}
},
{
name: "seal_approval_documents_list",
description: "列出 Seal 审批知识文档",
@@ -1361,6 +1532,25 @@ export const sealTools = [
};
}
},
{
name: "seal_webhook_material_pack",
description: "将官方材料包格式本地校验、解析并通过 Seal 入站 Webhook 触发 AI 审批;preview 模式不联网",
parameters: z.object({
filePath: z.string().describe("材料包 ZIP 或 信息表.xlsx 文件路径"),
mode: z.enum(["preview", "push"]).default("preview"),
webhook: z.string().optional().describe("Webhook ID 或名称,push 模式必填")
}),
handler: async (client: KyInstance, params: { filePath: string; mode?: "preview" | "push"; webhook?: string }) => {
const input = readMaterialPackFile(params.filePath);
if (params.mode !== "push") return previewMaterialPack(input.fileBuffer, input.fileName);
if (!params.webhook) throw new Error("push 模式需要 webhook");
const integration = api.findWebhookIntegration(await api.listWebhookIntegrations(client), params.webhook);
return pushMaterialPack(input.fileBuffer, input.fileName, {
webhookUrl: integration.incomingDocumentWebhook.url,
secret: integration.secret
});
}
},
{
name: "seal_approval_run_langfuse_bridge_get",
description: "从 Seal approval run 中抽取 Langfuse 定位信息;优先返回 _langfuseTraceId,没有时给出 hosecloud-{sourceDocumentSN} session 回退",
@@ -1842,7 +2032,8 @@ const sealToolByName = new Map<string, SealTool>(
const mcpDirectToolNames = [
"seal_whoami",
"seal_approval_search",
"seal_approval_context_get"
"seal_approval_context_get",
"seal_webhook_material_pack"
] as const;
const sealActionNames = [
@@ -1856,6 +2047,8 @@ const sealActionNames = [
"seal_approval_rule_version_get",
"seal_approval_rule_get",
"seal_approval_rules_lint",
"seal_approval_rules_pull",
"seal_approval_rules_push",
"seal_approval_rule_version_publish",
"seal_approval_documents_list",
"seal_approval_document_get",
@@ -1914,6 +2107,8 @@ const sealActionAliases: Record<string, (typeof sealActionNames)[number]> = {
"rule.version.get": "seal_approval_rule_version_get",
"rule.get": "seal_approval_rule_get",
"rule.lint": "seal_approval_rules_lint",
"rule.pull": "seal_approval_rules_pull",
"rule.push": "seal_approval_rules_push",
"rule.publish": "seal_approval_rule_version_publish",
"doc.list": "seal_approval_documents_list",
"doc.get": "seal_approval_document_get",
+25 -22
View File
@@ -75,6 +75,18 @@ export async function handleHttpRequest(req: IncomingMessage, res: ServerRespons
return;
}
if (method === "POST" && (pathname === "/shutdown" || pathname === "/api/shutdown")) {
sendJson(res, 200, {
success: true,
message: "Shutting down seal-use background daemon",
pid: process.pid
});
setTimeout(() => {
process.kill(process.pid, "SIGTERM");
}, 50);
return;
}
// 3. Command Execution Endpoint: POST /api/cli
if (method === "POST" && pathname === "/api/cli") {
const body = await parseJsonBody(req);
@@ -393,28 +405,19 @@ export function extractCorpId(
}
export async function parseJsonBody(req: IncomingMessage): Promise<Record<string, unknown>> {
return new Promise((resolve, reject) => {
let raw = "";
req.on("data", (chunk) => {
raw += chunk;
if (raw.length > 20 * 1024 * 1024) {
// 20MB limit
reject(new Error("Payload too large"));
}
});
req.on("end", () => {
if (!raw.trim()) {
resolve({});
return;
}
try {
resolve(JSON.parse(raw));
} catch (err) {
reject(new Error(`Invalid JSON body: ${err instanceof Error ? err.message : String(err)}`));
}
});
req.on("error", reject);
});
let raw = "";
for await (const chunk of req) {
raw += chunk;
if (raw.length > 20 * 1024 * 1024) {
throw new Error("Payload too large");
}
}
if (!raw.trim()) return {};
try {
return JSON.parse(raw);
} catch (err) {
throw new Error(`Invalid JSON body: ${err instanceof Error ? err.message : String(err)}`);
}
}
export function sendJson(res: ServerResponse, statusCode: number, data: unknown) {
+5 -2
View File
@@ -8,9 +8,12 @@ export type HttpServerOptions = {
silent?: boolean;
};
export const DEFAULT_HTTP_PORT = 8787;
export const DEFAULT_HTTP_HOST = "127.0.0.1";
export async function startHttpServer(options: HttpServerOptions = {}): Promise<Server> {
const port = options.port ?? (process.env.PORT ? Number.parseInt(process.env.PORT, 10) : 8787);
const host = options.host ?? (process.env.HOST ? process.env.HOST : "127.0.0.1");
const port = options.port ?? (process.env.PORT ? Number.parseInt(process.env.PORT, 10) : DEFAULT_HTTP_PORT);
const host = options.host ?? (process.env.HOST ? process.env.HOST : DEFAULT_HTTP_HOST);
const server = createServer(async (req, res) => {
try {