diff --git a/README.md b/README.md index 2bcb02f1..680db94d 100644 --- a/README.md +++ b/README.md @@ -1,248 +1,470 @@ -# ๐Ÿง  Claude Memory System (claude-mem) +
-A real-time memory system for Claude Code that captures, compresses, and retrieves conversation context across sessions using semantic search and vector embeddings. + claude-mem logo + claude-mem logo -## โšก๏ธ Quick Start +

+ Memory compression and persistence system for Claude Code conversations +

+ + + +

+ + npm version + + + contributors + + + last update + + + forks + + + stars + + + open issues + + + license + + + node version + + + MCP compatible + + + Claude Code enabled + +

+ +

+ Documentation + ยท + Report Bug + ยท + Request Feature +

+
+ +
+ + +# :notebook_with_decorative_cover: Table of Contents + +- [About the Project](#star2-about-the-project) + * [Tech Stack](#space_invader-tech-stack) + * [Features](#dart-features) +- [Getting Started](#toolbox-getting-started) + * [Prerequisites](#bangbang-prerequisites) + * [Installation](#gear-installation) + * [Running Tests](#test_tube-running-tests) +- [Usage](#eyes-usage) + * [Basic Commands](#basic-commands) + * [Hook System](#hook-system) + * [Memory Operations](#memory-operations) + * [ChromaDB MCP Tools](#chromadb-mcp-tools) + * [Advanced Usage](#advanced-usage) +- [Architecture](#building_construction-architecture) +- [Configuration](#wrench-configuration) +- [Roadmap](#compass-roadmap) +- [Contributing](#wave-contributing) +- [License](#warning-license) +- [Contact](#handshake-contact) +- [Acknowledgements](#gem-acknowledgements) + + + + +## :star2: About the Project + +claude-mem automatically captures, compresses, and retrieves context across Claude Code sessions, enabling true long-term memory through semantic search and intelligent compression. + +Perfect for developers who want their AI assistant to remember project context, past decisions, and conversation history across sessions without manual context management. + + +### :space_invader: Tech Stack + +
+ Core Technologies + +
+ +
+ Storage & Memory + +
+ +
+AI & Integration + +
+ + +### :dart: Features + +- :brain: **Automatic Memory Compression** - Real-time conversation capture and intelligent summarization +- :mag: **Semantic Search** - ChromaDB-powered vector search for intelligent context retrieval +- :package: **Project Isolation** - Memories segregated by project with multi-project support +- :arrows_counterclockwise: **Session Persistence** - Context loads automatically at session start and `/clear` command +- :dart: **MCP Integration** - 15+ ChromaDB tools via Model Context Protocol +- :floppy_disk: **SQLite Storage** - Fast metadata and session tracking with embedded database +- :wastebasket: **Smart Trash** - Safe file deletion with recovery capabilities +- :zap: **Streaming Hooks** - Sub-50ms overhead for real-time event capture +- :robot: **Agent SDK Compression** - Async transcript processing without blocking conversations +- :bar_chart: **Session Overviews** - Automatic session summaries with temporal context + + +## :toolbox: Getting Started + + +### :bangbang: Prerequisites + +This project requires Node.js and works best with Claude Code + +- Node.js >= 18.0.0 +- Claude Code with MCP support +- macOS/Linux (POSIX-compliant system) +- Bun >= 1.0.0 (optional, for development) + + +### :gear: Installation + +Install claude-mem globally via npm ```bash npm install -g claude-mem claude-mem install ``` -Restart Claude Code. Memory capture starts automatically. +The interactive installer will guide you through three installation scopes: -## โœจ What It Does +- **User** - Install for current user (default, recommended) +- **Project** - Install for current project only +- **Local** - Install to custom directory -**Real-Time Memory Capture** -- Captures every conversation turn as it happens via streaming hooks -- User prompts stored immediately in ChromaDB with atomic facts -- Tool responses compressed asynchronously via Agent SDK -- Project-based memory isolation with hierarchical metadata -- Automatic context loading at session start and `/clear` + +### :test_tube: Running Tests -**Semantic Search** -- Vector embeddings for intelligent retrieval via ChromaDB -- Find relevant context from past conversations -- Project-aware memory queries with temporal filtering -- Date-based search using query text (not metadata) -- 15+ MCP tools for memory operations - -**Invisible Operation** -- Zero user configuration required -- Memory compression happens in background via SDK -- SDK transcripts auto-deleted from UI history -- Session overviews generated automatically -- Live memory viewer with SSE streaming - -**Smart Trashโ„ข** -- Safe deletion with easy recovery -- Timestamped trash entries -- One-command restore -- Located at `~/.claude-mem/trash/` - -## ๐ŸŽฏ Core Features - -- **Streaming Hooks**: Real-time capture with minimal overhead (<50ms) -- **Agent SDK Integration**: Async compression without blocking conversation -- **MCP Server**: 15+ ChromaDB tools for memory operations -- **Project Isolation**: Memories segregated by project context -- **Zero Configuration**: Works out of the box after install -- **Embedded Databases**: ChromaDB and SQLite, no external dependencies -- **Invisible UX**: Memory operations don't pollute conversation UI -- **Live Memory Viewer**: Real-time slideshow of memories via SSE - -## ๐Ÿงญ Commands +To run tests, use the following commands ```bash -# Setup & Status -claude-mem install # Install/repair hooks and MCP integration -claude-mem status # Check installation and memory stats -claude-mem doctor # Run environment and pipeline diagnostics -claude-mem uninstall # Remove all hooks +# Run all tests +bun test -# Memory Operations -claude-mem load-context # View current session context -claude-mem logs # View operation logs -claude-mem changelog # Generate CHANGELOG.md from memories +# Run integration tests +npm run test:integration -# Storage Operations (Used by hooks/SDK) -claude-mem store-memory # Store a memory to ChromaDB + SQLite -claude-mem store-overview # Store a session overview - -# Smart Trashโ„ข -claude-mem trash # View trash contents -claude-mem restore # Restore from trash -claude-mem trash-empty # Permanently delete trash - -# ChromaDB Tools (15+ MCP tools available) -claude-mem chroma_* # Direct ChromaDB operations +# Run with coverage +npm run test:coverage ``` -## ๐Ÿ“ Storage Structure + +## :eyes: Usage + +### Basic Commands + +```bash +# Check installation status +claude-mem status + +# View operation logs +claude-mem logs + +# Load context for current project +claude-mem load-context --project my-project + +# View compressed memories (interactive) +claude-mem restore + +# Manage trash bin +claude-mem trash view +claude-mem restore +claude-mem trash empty +``` + +### Hook System + +claude-mem integrates with Claude Code via streaming hooks that capture conversation events: + +- **user-prompt-submit** - Captures user prompts in real-time +- **post-tool-use** - Spawns Agent SDK for async compression +- **stop-streaming** - Generates session overview and cleanup +- **session-start** - Loads relevant context automatically + +Hooks are configured during installation with a 180-second timeout and run transparently in the background. + +### Memory Operations + +#### Manual Compression + +```bash +claude-mem compress +``` + +Compress Claude Code transcripts into searchable memories with semantic embeddings. + +#### Context Loading + +```bash +# Load last 10 memories for current project +claude-mem load-context + +# Load specific number of memories +claude-mem load-context --count 20 + +# Filter by project +claude-mem load-context --project my-app + +# Output raw JSON +claude-mem load-context --raw +``` + +#### Trash Management + +claude-mem includes Smart Trash for safe file operations: + +```bash +# Move files to trash +claude-mem trash file.txt +claude-mem trash -r directory/ + +# View trash contents +claude-mem trash view + +# Restore files interactively +claude-mem restore + +# Empty trash permanently +claude-mem trash empty +``` + +### ChromaDB MCP Tools + +claude-mem exposes 15+ ChromaDB operations via MCP: + +```bash +# List collections +claude-mem chroma-list-collections + +# Create collection +claude-mem chroma-create-collection --collection-name memories + +# Query documents semantically +claude-mem chroma-query-documents \ + --collection-name memories \ + --query-texts '["authentication implementation"]' \ + --n-results 5 + +# Add documents +claude-mem chroma-add-documents \ + --collection-name memories \ + --documents '["content here"]' \ + --ids '["mem-001"]' + +# Get documents by ID +claude-mem chroma-get-documents \ + --collection-name memories \ + --ids '["mem-001"]' + +# Update documents +claude-mem chroma-update-documents \ + --collection-name memories \ + --ids '["mem-001"]' \ + --documents '["updated content"]' + +# Delete documents +claude-mem chroma-delete-documents \ + --collection-name memories \ + --ids '["mem-001"]' +``` + +See all available Chroma MCP commands with `claude-mem --help`. + +### Advanced Usage + +#### Session Title Generation + +```bash +# Generate title and subtitle from prompt +claude-mem generate-title "implemented authentication with OAuth" + +# Output as JSON +claude-mem generate-title "fixed bug in checkout" --json + +# Save to database +claude-mem generate-title "added feature" --session-id abc123 --save +``` + +#### Diagnostics + +```bash +# Run environment diagnostics +claude-mem doctor + +# Output as JSON +claude-mem doctor --json +``` + +#### Changelog Generation + +```bash +# Generate changelog from memories +claude-mem changelog + +# Preview without saving +claude-mem changelog --preview + +# Generate for specific version +claude-mem changelog --generate 3.9.0 + +# Search historical versions +claude-mem changelog --historical 5 +``` + +## :building_construction: Architecture + +### Storage Structure ``` ~/.claude-mem/ +โ”œโ”€โ”€ archives/ # Compressed transcript backups โ”œโ”€โ”€ chroma/ # ChromaDB vector database -โ”œโ”€โ”€ archives/ # Compressed transcript backups -โ”œโ”€โ”€ index/ # Legacy JSONL memory indices -โ”œโ”€โ”€ hooks/ # Hook configuration files -โ”œโ”€โ”€ trash/ # Smart Trashโ„ข with recovery +โ”œโ”€โ”€ trash/ # Smart Trash with recovery +โ”œโ”€โ”€ hooks/ # Hook configurations โ”œโ”€โ”€ logs/ # Operation logs โ””โ”€โ”€ claude-mem.db # SQLite metadata database ``` -## ๐Ÿ—๏ธ Architecture +### Memory System -**Storage Layers** -- **ChromaDB**: Vector database for semantic search with embeddings -- **SQLite**: Metadata index (`~/.claude-mem/claude-mem.db`) with sessions, memories, overviews -- **Archives**: Compressed transcript backups in `~/.claude-mem/archives/` +**Rolling Memory** - Real-time conversation turn capture via hooks with immediate ChromaDB storage -**Hook System** (`hook-templates/`) -- `user-prompt-submit.js`: Captures user prompts immediately, stores in ChromaDB -- `post-tool-use.js`: Spawns Agent SDK for async compression of tool responses -- `stop.js`: Generates session overview, cleans up SDK transcripts from UI -- `session-start.js`: Loads relevant context on startup and `/clear` -- Shared utilities: `hook-helpers.js`, `hook-prompt-renderer.js`, `config-loader.js`, `path-resolver.js` +**TranscriptCompressor** - Intelligent chunking and compression of large conversations -**CLI Commands** (`src/commands/`) -- Installation, status, and diagnostics -- Memory storage and retrieval -- Changelog generation from memories -- Smart Trashโ„ข management -- 15+ dynamic ChromaDB MCP tool wrappers +**MCP Server** - 15+ ChromaDB tools for memory operations and semantic search -**Services** (`src/services/`) -- SQLite stores: Session, Memory, Overview, Diagnostics, TranscriptEvent -- Path discovery for project detection -- Rolling settings and logs +**SQLite Backend** - Session tracking, metadata management, and diagnostics storage -## ๐Ÿ” How Memory Search Works +### Hook Integration -**Semantic Search Best Practices**: -```typescript -// ALWAYS include project name to avoid cross-contamination -mcp__claude-mem__chroma_query_documents({ - collection_name: "claude_memories", - query_texts: ["claude-mem authentication bug"], - n_results: 10 -}) +Hooks communicate via JSON stdin/stdout and run with minimal overhead: -// Include dates for temporal search (dates in query text, not metadata) -mcp__claude-mem__chroma_query_documents({ - collection_name: "claude_memories", - query_texts: ["project-name 2025-10-02 feature implementation"], - n_results: 5 -}) +1. **user-prompt-submit** - Stores user prompt immediately in ChromaDB +2. **post-tool-use** - Spawns Agent SDK subprocess for async compression +3. **stop-streaming** - Generates session overview, deletes SDK transcript +4. **session-start** - Loads project-specific context invisibly -// Intent-based queries work better than keyword matching -mcp__claude-mem__chroma_query_documents({ - collection_name: "claude_memories", - query_texts: ["implementing oauth flow"], - n_results: 10 -}) +### Project Structure + +``` +src/ +โ”œโ”€โ”€ bin/ # CLI entry point +โ”œโ”€โ”€ commands/ # Command implementations +โ”œโ”€โ”€ core/ # Core compression logic +โ”œโ”€โ”€ services/ # SQLite, ChromaDB, path discovery +โ”œโ”€โ”€ shared/ # Configuration and utilities +โ””โ”€โ”€ mcp-server.ts # MCP server implementation + +hook-templates/ # Hook source files +dist/ # Minified production bundle +test/ # Unit and integration tests ``` -**What Doesn't Work** (Avoid These!) -- โŒ Complex `where` filters with `$and`/`$or` - causes errors -- โŒ Timestamp comparisons (`$gte`, `$lt`) - stored as strings -- โŒ Mixing project filters in where clause - causes "Error finding id" +## :wrench: Configuration -**Storage Collection**: `claude_memories` -- Metadata: `project`, `session_id`, `date`, `type`, `concepts`, `files` -- Embeddings: Semantic vectors for similarity search -- Documents: Atomic facts + full narrative with hierarchical structure +### Hook Timeout -## โœ… Requirements - -- Node.js >= 18.0.0 -- Bun >= 1.0.0 (for development) -- Claude Code with MCP support -- macOS/Linux (POSIX-compliant) - -## ๐Ÿ› ๏ธ Development +Default hook timeout is 180 seconds. Configure during installation: ```bash -# Development mode -bun run dev - -# Build production bundle -bun run build - -# Build and update hooks (RECOMMENDED for hook changes) -bun run build && bun link && claude-mem install --force - -# Run tests -bun test # All tests -npm run test:integration # Integration tests -bun run test:unit # Unit tests only - -# Install from source -bun run dev:install - -# Live Memory Viewer -npm run memory-stream:server # Start SSE server on :3001 - -# Code quality -bun run lint -bun run format +claude-mem install --timeout 300000 # 5 minutes ``` -## ๐ŸŽจ Live Memory Viewer +### MCP Server -Real-time slideshow of memories with SSE streaming: - -1. Start the server: `npm run memory-stream:server` -2. Open the viewer at `src/ui/memory-stream/` -3. Auto-connects to `~/.claude-mem/claude-mem.db` -4. New memories appear instantly as they're created - -Features: -- ๐Ÿ“ก Live SSE streaming from SQLite WAL changes -- ๐ŸŽฌ Auto-slideshow (5s intervals) -- โธ๏ธ Pause/Resume with Space bar -- โŒจ๏ธ Keyboard navigation (โ†/โ†’) -- ๐ŸŽจ Cyberpunk neural network aesthetic - -## ๐Ÿ”‘ Key Design Decisions - -**Storage Architecture** -- Direct ChromaDB writes in `store-memory.ts` command (no async syncing) -- Each atomic fact stored as separate document + full narrative document -- Hierarchical metadata: project, session, date, type, concepts, files -- SQLite for fast metadata queries, ChromaDB for semantic search - -**Hook Infrastructure** -- Streaming hooks (<50ms overhead) capture real-time events -- Shared utilities in `hook-templates/shared/` for consistency -- Force overwrite on install to ensure latest hook code deploys -- Milliseconds in `config.json`, seconds in Claude settings - -**Memory Compression** -- Agent SDK spawned asynchronously for tool response compression -- User prompts stored immediately without blocking -- SDK transcripts auto-deleted to keep UI clean -- 100:1 compression ratio maintained - -**Search Strategy** -- Semantic search via query text (dates embedded in queries) -- Avoid complex metadata filters (causes ChromaDB errors) -- Always include project name in queries for isolation -- Multiple query phrasings for better coverage - -## ๐Ÿ†˜ Troubleshooting +Skip MCP server installation if needed: ```bash -claude-mem status # Check installation health -claude-mem doctor # Run full diagnostics -claude-mem install --force # Repair installation -claude-mem logs # View recent operations +claude-mem install --skip-mcp ``` -## ๐Ÿ“„ License +### Force Reinstall -AGPL-3.0 - See LICENSE file for details +```bash +claude-mem install --force +``` + + +## :compass: Roadmap + +* [x] Real-time conversation capture with streaming hooks +* [x] ChromaDB vector storage for semantic search +* [x] SQLite metadata and session tracking +* [x] MCP server with 15+ ChromaDB tools +* [x] Smart Trash for safe file deletion +* [x] Automatic session overviews +* [ ] Web UI for memory visualization +* [ ] Cross-platform Windows support +* [ ] Memory analytics and insights + + +## :wave: Contributing + + + + + +Contributions are always welcome! + +1. Fork the repository +2. Create a feature branch (`git checkout -b feature/AmazingFeature`) +3. Commit your changes (`git commit -m 'Add some AmazingFeature'`) +4. Push to the branch (`git push origin feature/AmazingFeature`) +5. Open a Pull Request + + +## :warning: License + +Distributed under the AGPL-3.0 License. See [LICENSE](LICENSE) for more information. + + +## :handshake: Contact + +Alex Newman - [@thedotmack](https://github.com/thedotmack) + +Project Link: [https://github.com/thedotmack/claude-mem](https://github.com/thedotmack/claude-mem) + +NPM Package: [https://www.npmjs.com/package/claude-mem](https://www.npmjs.com/package/claude-mem) + + +## :gem: Acknowledgements + + - [ChromaDB](https://www.trychroma.com/) - Vector database for AI applications + - [Anthropic](https://www.anthropic.com/) - Claude AI and Agent SDK + - [Model Context Protocol](https://modelcontextprotocol.io) - Standardized AI tool integration + - [better-sqlite3](https://github.com/WiseLibs/better-sqlite3) - Fast SQLite bindings + - [Shields.io](https://shields.io/) - Beautiful README badges + - [Awesome README Template](https://github.com/Louis3797/awesome-readme-template) - Template inspiration --- -**Remember more. Repeat less.** ๐Ÿง โœจ \ No newline at end of file +**Philosophy**: claude-mem follows the **Make It Work First** approach - direct execution over defensive validation, natural failures instead of artificial guards, and memory as a living, evolving system. Context improves with use through semantic search, project isolation, and temporal relevance. + +**Built with TypeScript, ChromaDB, SQLite, and the Anthropic Agent SDK** diff --git a/dist/claude-mem.min.js b/dist/claude-mem.min.js index 4949ee47..b0bc4b64 100755 --- a/dist/claude-mem.min.js +++ b/dist/claude-mem.min.js @@ -25,7 +25,7 @@ Expecting one of '${Q.join("', '")}'`);if(this._lifeCycleHooks[D])this._lifeCycl `),this._exit(0,"commander.version",D)}),this}description(D,F){if(D===void 0&&F===void 0)return this._description;if(this._description=D,F)this._argsDescription=F;return this}summary(D){if(D===void 0)return this._summary;return this._summary=D,this}alias(D){if(D===void 0)return this._aliases[0];let F=this;if(this.commands.length!==0&&this.commands[this.commands.length-1]._executableHandler)F=this.commands[this.commands.length-1];if(D===F._name)throw new Error("Command alias can't be the same as its name");let Q=this.parent?._findCommand(D);if(Q){let B=[Q.name()].concat(Q.aliases()).join("|");throw new Error(`cannot add alias '${D}' to command '${this.name()}' as already have command '${B}'`)}return F._aliases.push(D),this}aliases(D){if(D===void 0)return this._aliases;return D.forEach((F)=>this.alias(F)),this}usage(D){if(D===void 0){if(this._usage)return this._usage;let F=this.registeredArguments.map((Q)=>{return oX(Q)});return[].concat(this.options.length||this._helpOption!==null?"[options]":[],this.commands.length?"[command]":[],this.registeredArguments.length?F:[]).join(" ")}return this._usage=D,this}name(D){if(D===void 0)return this._name;return this._name=D,this}helpGroup(D){if(D===void 0)return this._helpGroupHeading??"";return this._helpGroupHeading=D,this}commandsGroup(D){if(D===void 0)return this._defaultCommandGroup??"";return this._defaultCommandGroup=D,this}optionsGroup(D){if(D===void 0)return this._defaultOptionGroup??"";return this._defaultOptionGroup=D,this}_initOptionGroup(D){if(this._defaultOptionGroup&&!D.helpGroupHeading)D.helpGroup(this._defaultOptionGroup)}_initCommandGroup(D){if(this._defaultCommandGroup&&!D.helpGroup())D.helpGroup(this._defaultCommandGroup)}nameFromFilename(D){return this._name=NF.basename(D,NF.extname(D)),this}executableDir(D){if(D===void 0)return this._executableDir;return this._executableDir=D,this}helpInformation(D){let F=this.createHelp(),Q=this._getOutputContext(D);F.prepareContext({error:Q.error,helpWidth:Q.helpWidth,outputHasColors:Q.hasColors});let B=F.formatHelp(this,F);if(Q.hasColors)return B;return this._outputConfiguration.stripColor(B)}_getOutputContext(D){D=D||{};let F=!!D.error,Q,B,Y;if(F)Q=(X)=>this._outputConfiguration.writeErr(X),B=this._outputConfiguration.getErrHasColors(),Y=this._outputConfiguration.getErrHelpWidth();else Q=(X)=>this._outputConfiguration.writeOut(X),B=this._outputConfiguration.getOutHasColors(),Y=this._outputConfiguration.getOutHelpWidth();return{error:F,write:(X)=>{if(!B)X=this._outputConfiguration.stripColor(X);return Q(X)},hasColors:B,helpWidth:Y}}outputHelp(D){let F;if(typeof D==="function")F=D,D=void 0;let Q=this._getOutputContext(D),B={error:Q.error,write:Q.write,command:this};this._getCommandAndAncestors().reverse().forEach((J)=>J.emit("beforeAllHelp",B)),this.emit("beforeHelp",B);let Y=this.helpInformation({error:Q.error});if(F){if(Y=F(Y),typeof Y!=="string"&&!Buffer.isBuffer(Y))throw new Error("outputHelp callback must return a string or a Buffer")}if(Q.write(Y),this._getHelpOption()?.long)this.emit(this._getHelpOption().long);this.emit("afterHelp",B),this._getCommandAndAncestors().forEach((J)=>J.emit("afterAllHelp",B))}helpOption(D,F){if(typeof D==="boolean"){if(D){if(this._helpOption===null)this._helpOption=void 0;if(this._defaultOptionGroup)this._initOptionGroup(this._getHelpOption())}else this._helpOption=null;return this}if(this._helpOption=this.createOption(D??"-h, --help",F??"display help for command"),D||F)this._initOptionGroup(this._helpOption);return this}_getHelpOption(){if(this._helpOption===void 0)this.helpOption(void 0,void 0);return this._helpOption}addHelpOption(D){return this._helpOption=D,this._initOptionGroup(D),this}help(D){this.outputHelp(D);let F=Number(OD.exitCode??0);if(F===0&&D&&typeof D!=="function"&&D.error)F=1;this._exit(F,"commander.help","(outputHelp)")}addHelpText(D,F){let Q=["beforeAll","before","after","afterAll"];if(!Q.includes(D))throw new Error(`Unexpected value for position to addHelpText. Expecting one of '${Q.join("', '")}'`);let B=`${D}Help`;return this.on(B,(Y)=>{let J;if(typeof F==="function")J=F({error:Y.error,command:Y.command});else J=F;if(J)Y.write(`${J} `)}),this}_outputHelpIfRequested(D){let F=this._getHelpOption();if(F&&D.find((B)=>F.is(B)))this.outputHelp(),this._exit(0,"commander.helpDisplayed","(outputHelp)")}}function m9(D){return D.map((F)=>{if(!F.startsWith("--inspect"))return F;let Q,B="127.0.0.1",Y="9229",J;if((J=F.match(/^(--inspect(-brk)?)$/))!==null)Q=J[1];else if((J=F.match(/^(--inspect(-brk|-port)?)=([^:]+)$/))!==null)if(Q=J[1],/^\d+$/.test(J[3]))Y=J[3];else B=J[3];else if((J=F.match(/^(--inspect(-brk|-port)?)=([^:]+):(\d+)$/))!==null)Q=J[1],B=J[3],Y=J[4];if(Q&&Y!=="0")return`${Q}=${B}:${parseInt(Y)+1}`;return F})}function q1(){if(OD.env.NO_COLOR||OD.env.FORCE_COLOR==="0"||OD.env.FORCE_COLOR==="false")return!1;if(OD.env.FORCE_COLOR||OD.env.CLICOLOR_FORCE!==void 0)return!0;return}DY.Command=H1;DY.useColor=q1});var n9=VD((YY)=>{var{Argument:d9}=l8(),{Command:K1}=l9(),{CommanderError:QY,InvalidArgumentError:c9}=n2(),{Help:XY}=C1(),{Option:p9}=W1();YY.program=new K1;YY.createCommand=(D)=>new K1(D);YY.createOption=(D,F)=>new p9(D,F);YY.createArgument=(D,F)=>new d9(D,F);YY.Command=K1;YY.Option=p9;YY.Argument=d9;YY.Help=XY;YY.CommanderError=QY;YY.InvalidArgumentError=c9;YY.InvalidOptionArgumentError=c9});var E1=VD((ZE,Q3)=>{var U1={to(D,F){if(!F)return`\x1B[${D+1}G`;return`\x1B[${F+1};${D+1}H`},move(D,F){let Q="";if(D<0)Q+=`\x1B[${-D}D`;else if(D>0)Q+=`\x1B[${D}C`;if(F<0)Q+=`\x1B[${-F}A`;else if(F>0)Q+=`\x1B[${F}B`;return Q},up:(D=1)=>`\x1B[${D}A`,down:(D=1)=>`\x1B[${D}B`,forward:(D=1)=>`\x1B[${D}C`,backward:(D=1)=>`\x1B[${D}D`,nextLine:(D=1)=>"\x1B[E".repeat(D),prevLine:(D=1)=>"\x1B[F".repeat(D),left:"\x1B[G",hide:"\x1B[?25l",show:"\x1B[?25h",save:"\x1B7",restore:"\x1B8"},jY={up:(D=1)=>"\x1B[S".repeat(D),down:(D=1)=>"\x1B[T".repeat(D)},RY={screen:"\x1B[2J",up:(D=1)=>"\x1B[1J".repeat(D),down:(D=1)=>"\x1B[J".repeat(D),line:"\x1B[2K",lineEnd:"\x1B[K",lineStart:"\x1B[1K",lines(D){let F="";for(let Q=0;Q{var p8=process||{},X3=p8.argv||[],c8=p8.env||{},_Y=!(!!c8.NO_COLOR||X3.includes("--no-color"))&&(!!c8.FORCE_COLOR||X3.includes("--color")||p8.platform==="win32"||(p8.stdout||{}).isTTY&&c8.TERM!=="dumb"||!!c8.CI),OY=(D,F,Q=D)=>(B)=>{let Y=""+B,J=Y.indexOf(F,D.length);return~J?D+IY(Y,F,Q,J)+F:D+Y+F},IY=(D,F,Q,B)=>{let Y="",J=0;do Y+=D.substring(J,B)+Q,J=B+F.length,B=D.indexOf(F,J);while(~B);return Y+D.substring(J)},Y3=(D=_Y)=>{let F=D?OY:()=>String;return{isColorSupported:D,reset:F("\x1B[0m","\x1B[0m"),bold:F("\x1B[1m","\x1B[22m","\x1B[22m\x1B[1m"),dim:F("\x1B[2m","\x1B[22m","\x1B[22m\x1B[2m"),italic:F("\x1B[3m","\x1B[23m"),underline:F("\x1B[4m","\x1B[24m"),inverse:F("\x1B[7m","\x1B[27m"),hidden:F("\x1B[8m","\x1B[28m"),strikethrough:F("\x1B[9m","\x1B[29m"),black:F("\x1B[30m","\x1B[39m"),red:F("\x1B[31m","\x1B[39m"),green:F("\x1B[32m","\x1B[39m"),yellow:F("\x1B[33m","\x1B[39m"),blue:F("\x1B[34m","\x1B[39m"),magenta:F("\x1B[35m","\x1B[39m"),cyan:F("\x1B[36m","\x1B[39m"),white:F("\x1B[37m","\x1B[39m"),gray:F("\x1B[90m","\x1B[39m"),bgBlack:F("\x1B[40m","\x1B[49m"),bgRed:F("\x1B[41m","\x1B[49m"),bgGreen:F("\x1B[42m","\x1B[49m"),bgYellow:F("\x1B[43m","\x1B[49m"),bgBlue:F("\x1B[44m","\x1B[49m"),bgMagenta:F("\x1B[45m","\x1B[49m"),bgCyan:F("\x1B[46m","\x1B[49m"),bgWhite:F("\x1B[47m","\x1B[49m"),blackBright:F("\x1B[90m","\x1B[39m"),redBright:F("\x1B[91m","\x1B[39m"),greenBright:F("\x1B[92m","\x1B[39m"),yellowBright:F("\x1B[93m","\x1B[39m"),blueBright:F("\x1B[94m","\x1B[39m"),magentaBright:F("\x1B[95m","\x1B[39m"),cyanBright:F("\x1B[96m","\x1B[39m"),whiteBright:F("\x1B[97m","\x1B[39m"),bgBlackBright:F("\x1B[100m","\x1B[49m"),bgRedBright:F("\x1B[101m","\x1B[49m"),bgGreenBright:F("\x1B[102m","\x1B[49m"),bgYellowBright:F("\x1B[103m","\x1B[49m"),bgBlueBright:F("\x1B[104m","\x1B[49m"),bgMagentaBright:F("\x1B[105m","\x1B[49m"),bgCyanBright:F("\x1B[106m","\x1B[49m"),bgWhiteBright:F("\x1B[107m","\x1B[49m")}};A1.exports=Y3();A1.exports.createColors=Y3});var g3=VD((y1,f1)=>{(function(D,F){typeof y1==="object"&&typeof f1!=="undefined"?f1.exports=F():typeof define==="function"&&define.amd?define(F):(D=typeof globalThis!=="undefined"?globalThis:D||self,D.tinycolor=F())})(y1,function(){function D(j){return D=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(_){return typeof _}:function(_){return _&&typeof Symbol=="function"&&_.constructor===Symbol&&_!==Symbol.prototype?"symbol":typeof _},D(j)}var F=/^\s+/,Q=/\s+$/;function B(j,_){if(j=j?j:"",_=_||{},j instanceof B)return j;if(!(this instanceof B))return new B(j,_);var K=Y(j);if(this._originalInput=j,this._r=K.r,this._g=K.g,this._b=K.b,this._a=K.a,this._roundA=Math.round(100*this._a)/100,this._format=_.format||K.format,this._gradientType=_.gradientType,this._r<1)this._r=Math.round(this._r);if(this._g<1)this._g=Math.round(this._g);if(this._b<1)this._b=Math.round(this._b);this._ok=K.ok}B.prototype={isDark:function j(){return this.getBrightness()<128},isLight:function j(){return!this.isDark()},isValid:function j(){return this._ok},getOriginalInput:function j(){return this._originalInput},getFormat:function j(){return this._format},getAlpha:function j(){return this._a},getBrightness:function j(){var _=this.toRgb();return(_.r*299+_.g*587+_.b*114)/1000},getLuminance:function j(){var _=this.toRgb(),K,T,h,c,l,p;if(K=_.r/255,T=_.g/255,h=_.b/255,K<=0.03928)c=K/12.92;else c=Math.pow((K+0.055)/1.055,2.4);if(T<=0.03928)l=T/12.92;else l=Math.pow((T+0.055)/1.055,2.4);if(h<=0.03928)p=h/12.92;else p=Math.pow((h+0.055)/1.055,2.4);return 0.2126*c+0.7152*l+0.0722*p},setAlpha:function j(_){return this._a=w(_),this._roundA=Math.round(100*this._a)/100,this},toHsv:function j(){var _=z(this._r,this._g,this._b);return{h:_.h*360,s:_.s,v:_.v,a:this._a}},toHsvString:function j(){var _=z(this._r,this._g,this._b),K=Math.round(_.h*360),T=Math.round(_.s*100),h=Math.round(_.v*100);return this._a==1?"hsv("+K+", "+T+"%, "+h+"%)":"hsva("+K+", "+T+"%, "+h+"%, "+this._roundA+")"},toHsl:function j(){var _=X(this._r,this._g,this._b);return{h:_.h*360,s:_.s,l:_.l,a:this._a}},toHslString:function j(){var _=X(this._r,this._g,this._b),K=Math.round(_.h*360),T=Math.round(_.s*100),h=Math.round(_.l*100);return this._a==1?"hsl("+K+", "+T+"%, "+h+"%)":"hsla("+K+", "+T+"%, "+h+"%, "+this._roundA+")"},toHex:function j(_){return G(this._r,this._g,this._b,_)},toHexString:function j(_){return"#"+this.toHex(_)},toHex8:function j(_){return q(this._r,this._g,this._b,this._a,_)},toHex8String:function j(_){return"#"+this.toHex8(_)},toRgb:function j(){return{r:Math.round(this._r),g:Math.round(this._g),b:Math.round(this._b),a:this._a}},toRgbString:function j(){return this._a==1?"rgb("+Math.round(this._r)+", "+Math.round(this._g)+", "+Math.round(this._b)+")":"rgba("+Math.round(this._r)+", "+Math.round(this._g)+", "+Math.round(this._b)+", "+this._roundA+")"},toPercentageRgb:function j(){return{r:Math.round(S(this._r,255)*100)+"%",g:Math.round(S(this._g,255)*100)+"%",b:Math.round(S(this._b,255)*100)+"%",a:this._a}},toPercentageRgbString:function j(){return this._a==1?"rgb("+Math.round(S(this._r,255)*100)+"%, "+Math.round(S(this._g,255)*100)+"%, "+Math.round(S(this._b,255)*100)+"%)":"rgba("+Math.round(S(this._r,255)*100)+"%, "+Math.round(S(this._g,255)*100)+"%, "+Math.round(S(this._b,255)*100)+"%, "+this._roundA+")"},toName:function j(){if(this._a===0)return"transparent";if(this._a<1)return!1;return y[G(this._r,this._g,this._b,!0)]||!1},toFilter:function j(_){var K="#"+A(this._r,this._g,this._b,this._a),T=K,h=this._gradientType?"GradientType = 1, ":"";if(_){var c=B(_);T="#"+A(c._r,c._g,c._b,c._a)}return"progid:DXImageTransform.Microsoft.gradient("+h+"startColorstr="+K+",endColorstr="+T+")"},toString:function j(_){var K=!!_;_=_||this._format;var T=!1,h=this._a<1&&this._a>=0,c=!K&&h&&(_==="hex"||_==="hex6"||_==="hex3"||_==="hex4"||_==="hex8"||_==="name");if(c){if(_==="name"&&this._a===0)return this.toName();return this.toRgbString()}if(_==="rgb")T=this.toRgbString();if(_==="prgb")T=this.toPercentageRgbString();if(_==="hex"||_==="hex6")T=this.toHexString();if(_==="hex3")T=this.toHexString(!0);if(_==="hex4")T=this.toHex8String(!0);if(_==="hex8")T=this.toHex8String();if(_==="name")T=this.toName();if(_==="hsl")T=this.toHslString();if(_==="hsv")T=this.toHsvString();return T||this.toHexString()},clone:function j(){return B(this.toString())},_applyModification:function j(_,K){var T=_.apply(null,[this].concat([].slice.call(K)));return this._r=T._r,this._g=T._g,this._b=T._b,this.setAlpha(T._a),this},lighten:function j(){return this._applyModification(V,arguments)},brighten:function j(){return this._applyModification(N,arguments)},darken:function j(){return this._applyModification(L,arguments)},desaturate:function j(){return this._applyModification(U,arguments)},saturate:function j(){return this._applyModification(Z,arguments)},greyscale:function j(){return this._applyModification(H,arguments)},spin:function j(){return this._applyModification(R,arguments)},_applyCombination:function j(_,K){return _.apply(null,[this].concat([].slice.call(K)))},analogous:function j(){return this._applyCombination(u,arguments)},complement:function j(){return this._applyCombination(k,arguments)},monochromatic:function j(){return this._applyCombination(f,arguments)},splitcomplement:function j(){return this._applyCombination(I,arguments)},triad:function j(){return this._applyCombination(b,[3])},tetrad:function j(){return this._applyCombination(b,[4])}},B.fromRatio=function(j,_){if(D(j)=="object"){var K={};for(var T in j)if(j.hasOwnProperty(T))if(T==="a")K[T]=j[T];else K[T]=o(j[T]);j=K}return B(j,_)};function Y(j){var _={r:0,g:0,b:0},K=1,T=null,h=null,c=null,l=!1,p=!1;if(typeof j=="string")j=hD(j);if(D(j)=="object"){if(LD(j.r)&&LD(j.g)&&LD(j.b))_=J(j.r,j.g,j.b),l=!0,p=String(j.r).substr(-1)==="%"?"prgb":"rgb";else if(LD(j.h)&&LD(j.s)&&LD(j.v))T=o(j.s),h=o(j.v),_=W(j.h,T,h),l=!0,p="hsv";else if(LD(j.h)&&LD(j.s)&&LD(j.l))T=o(j.s),c=o(j.l),_=C(j.h,T,c),l=!0,p="hsl";if(j.hasOwnProperty("a"))K=j.a}return K=w(K),{ok:l,format:j.format||p,r:Math.min(255,Math.max(_.r,0)),g:Math.min(255,Math.max(_.g,0)),b:Math.min(255,Math.max(_.b,0)),a:K}}function J(j,_,K){return{r:S(j,255)*255,g:S(_,255)*255,b:S(K,255)*255}}function X(j,_,K){j=S(j,255),_=S(_,255),K=S(K,255);var T=Math.max(j,_,K),h=Math.min(j,_,K),c,l,p=(T+h)/2;if(T==h)c=l=0;else{var BD=T-h;switch(l=p>0.5?BD/(2-T-h):BD/(T+h),T){case j:c=(_-K)/BD+(_1)ZD-=1;if(ZD<0.16666666666666666)return qD+(JD-qD)*6*ZD;if(ZD<0.5)return JD;if(ZD<0.6666666666666666)return qD+(JD-qD)*(0.6666666666666666-ZD)*6;return qD}if(_===0)T=h=c=K;else{var p=K<0.5?K*(1+_):K+_-K*_,BD=2*K-p;T=l(BD,p,j+0.3333333333333333),h=l(BD,p,j),c=l(BD,p,j-0.3333333333333333)}return{r:T*255,g:h*255,b:c*255}}function z(j,_,K){j=S(j,255),_=S(_,255),K=S(K,255);var T=Math.max(j,_,K),h=Math.min(j,_,K),c,l,p=T,BD=T-h;if(l=T===0?0:BD/T,T==h)c=0;else{switch(T){case j:c=(_-K)/BD+(_>1)+720)%360;--_;)T.h=(T.h+h)%360,c.push(B(T));return c}function f(j,_){_=_||6;var K=B(j).toHsv(),T=K.h,h=K.s,c=K.v,l=[],p=1/_;while(_--)l.push(B({h:T,s:h,v:c})),c=(c+p)%1;return l}B.mix=function(j,_,K){K=K===0?0:K||50;var T=B(j).toRgb(),h=B(_).toRgb(),c=K/100,l={r:(h.r-T.r)*c+T.r,g:(h.g-T.g)*c+T.g,b:(h.b-T.b)*c+T.b,a:(h.a-T.a)*c+T.a};return B(l)},B.readability=function(j,_){var K=B(j),T=B(_);return(Math.max(K.getLuminance(),T.getLuminance())+0.05)/(Math.min(K.getLuminance(),T.getLuminance())+0.05)},B.isReadable=function(j,_,K){var T=B.readability(j,_),h,c;switch(c=!1,h=cD(K),h.level+h.size){case"AAsmall":case"AAAlarge":c=T>=4.5;break;case"AAlarge":c=T>=3;break;case"AAAsmall":c=T>=7;break}return c},B.mostReadable=function(j,_,K){var T=null,h=0,c,l,p,BD;K=K||{},l=K.includeFallbackColors,p=K.level,BD=K.size;for(var qD=0;qD<_.length;qD++)if(c=B.readability(j,_[qD]),c>h)h=c,T=B(_[qD]);if(B.isReadable(j,T,{level:p,size:BD})||!l)return T;else return K.includeFallbackColors=!1,B.mostReadable(j,["#fff","#000"],K)};var O=B.names={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"0ff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000",blanchedalmond:"ffebcd",blue:"00f",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",burntsienna:"ea7e5d",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"0ff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkgrey:"a9a9a9",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkslategrey:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dimgrey:"696969",dodgerblue:"1e90ff",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"f0f",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",grey:"808080",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgray:"d3d3d3",lightgreen:"90ee90",lightgrey:"d3d3d3",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslategray:"789",lightslategrey:"789",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"0f0",limegreen:"32cd32",linen:"faf0e6",magenta:"f0f",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370db",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"db7093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",rebeccapurple:"663399",red:"f00",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",slategrey:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",wheat:"f5deb3",white:"fff",whitesmoke:"f5f5f5",yellow:"ff0",yellowgreen:"9acd32"},y=B.hexNames=x(O);function x(j){var _={};for(var K in j)if(j.hasOwnProperty(K))_[j[K]]=K;return _}function w(j){if(j=parseFloat(j),isNaN(j)||j<0||j>1)j=1;return j}function S(j,_){if(n(j))j="100%";var K=a(j);if(j=Math.min(_,Math.max(0,parseFloat(j))),K)j=parseInt(j*_,10)/100;if(Math.abs(j-_)<0.000001)return 1;return j%_/parseFloat(_)}function g(j){return Math.min(1,Math.max(0,j))}function d(j){return parseInt(j,16)}function n(j){return typeof j=="string"&&j.indexOf(".")!=-1&&parseFloat(j)===1}function a(j){return typeof j==="string"&&j.indexOf("%")!=-1}function DD(j){return j.length==1?"0"+j:""+j}function o(j){if(j<=1)j=j*100+"%";return j}function XD(j){return Math.round(parseFloat(j)*255).toString(16)}function YD(j){return d(j)/255}var FD=function(){var j="[-\\+]?\\d+%?",_="[-\\+]?\\d*\\.\\d+%?",K="(?:"+_+")|(?:"+j+")",T="[\\s|\\(]+("+K+")[,|\\s]+("+K+")[,|\\s]+("+K+")\\s*\\)?",h="[\\s|\\(]+("+K+")[,|\\s]+("+K+")[,|\\s]+("+K+")[,|\\s]+("+K+")\\s*\\)?";return{CSS_UNIT:new RegExp(K),rgb:new RegExp("rgb"+T),rgba:new RegExp("rgba"+h),hsl:new RegExp("hsl"+T),hsla:new RegExp("hsla"+h),hsv:new RegExp("hsv"+T),hsva:new RegExp("hsva"+h),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/}}();function LD(j){return!!FD.CSS_UNIT.exec(j)}function hD(j){j=j.replace(F,"").replace(Q,"").toLowerCase();var _=!1;if(O[j])j=O[j],_=!0;else if(j=="transparent")return{r:0,g:0,b:0,a:0,format:"name"};var K;if(K=FD.rgb.exec(j))return{r:K[1],g:K[2],b:K[3]};if(K=FD.rgba.exec(j))return{r:K[1],g:K[2],b:K[3],a:K[4]};if(K=FD.hsl.exec(j))return{h:K[1],s:K[2],l:K[3]};if(K=FD.hsla.exec(j))return{h:K[1],s:K[2],l:K[3],a:K[4]};if(K=FD.hsv.exec(j))return{h:K[1],s:K[2],v:K[3]};if(K=FD.hsva.exec(j))return{h:K[1],s:K[2],v:K[3],a:K[4]};if(K=FD.hex8.exec(j))return{r:d(K[1]),g:d(K[2]),b:d(K[3]),a:YD(K[4]),format:_?"name":"hex8"};if(K=FD.hex6.exec(j))return{r:d(K[1]),g:d(K[2]),b:d(K[3]),format:_?"name":"hex"};if(K=FD.hex4.exec(j))return{r:d(K[1]+""+K[1]),g:d(K[2]+""+K[2]),b:d(K[3]+""+K[3]),a:YD(K[4]+""+K[4]),format:_?"name":"hex8"};if(K=FD.hex3.exec(j))return{r:d(K[1]+""+K[1]),g:d(K[2]+""+K[2]),b:d(K[3]+""+K[3]),format:_?"name":"hex"};return!1}function cD(j){var _,K;if(j=j||{level:"AA",size:"small"},_=(j.level||"AA").toUpperCase(),K=(j.size||"small").toLowerCase(),_!=="AA"&&_!=="AAA")_="AA";if(K!=="small"&&K!=="large")K="small";return{level:_,size:K}}return B})});var p3=VD((DA,c3)=>{var s2=g3(),l3={r:256,g:256,b:256,a:1},d3={h:360,s:1,v:1,a:1};function $1(D,F,Q){let B={};for(let Y in D)if(D.hasOwnProperty(Y))B[Y]=Q===0?0:(F[Y]-D[Y])/Q;return B}function h1(D,F,Q,B){let Y={};for(let J in F)if(F.hasOwnProperty(J))Y[J]=D[J]*Q+F[J],Y[J]=Y[J]<0?Y[J]+B[J]:B[J]!==1?Y[J]%B[J]:Y[J];return Y}function g1(D,F,Q){let B=D.color.toRgb(),Y=F.color.toRgb(),J=$1(B,Y,Q),X=[D.color];for(let C=1;CJ.h&&Y.h-J.h>180;X=B==="long"&&G||B==="short"&&!G}let C=$1(Y,J,Q),z=[D.color],W;if(Y.h<=J.h&&!X||Y.h>=J.h&&X)W=J.h-Y.h;else if(X)W=360-J.h+Y.h;else W=360-Y.h+J.h;C.h=Math.pow(-1,X?1:0)*Math.abs(W)/Q;for(let G=1;G1)throw new Error("Position must be between 0 and 1");let Y,J;for(let z=0,W=D.length;z=D[z].pos&&F{let C=J.pos!==void 0;if(F^C)throw new Error("Cannot mix positionned and not posionned color stops");if(C){let z=J.color!==void 0;if(!z&&(Y||X===0||X===Q-1))throw new Error("Cannot define two consecutive position-only stops");if(Y=!z,J={color:z?s2(J.color):null,colorLess:!z,pos:J.pos},J.pos<0||J.pos>1)throw new Error("Color stops positions must be between 0 and 1");else if(J.pos{D.push({color:Q.color,pos:Q.pos/2})}),this.stops.slice(0,-1).forEach((Q)=>{F.push({color:Q.color,pos:1-Q.pos/2})}),new F6(D.concat(F.reverse()))}rgb(D){let F=h3(this.stops,D),Q=[];this.stops.forEach((B,Y)=>{if(B.colorLess)B.color=g1(this.stops[Y-1],this.stops[Y+1],2)[1]});for(let B=0,Y=this.stops.length;B{if(Y.colorLess)Y.color=$3(this.stops[J-1],this.stops[J+1],2,F)[1]});for(let Y=0,J=this.stops.length;Y{s3.exports=()=>{return/[#*0-9]\uFE0F?\u20E3|[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23ED-\u23EF\u23F1\u23F2\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB\u25FC\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692\u2694-\u2697\u2699\u269B\u269C\u26A0\u26A7\u26AA\u26B0\u26B1\u26BD\u26BE\u26C4\u26C8\u26CF\u26D1\u26E9\u26F0-\u26F5\u26F7\u26F8\u26FA\u2702\u2708\u2709\u270F\u2712\u2714\u2716\u271D\u2721\u2733\u2734\u2744\u2747\u2757\u2763\u27A1\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B55\u3030\u303D\u3297\u3299]\uFE0F?|[\u261D\u270C\u270D](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\u270A\u270B](?:\uD83C[\uDFFB-\uDFFF])?|[\u23E9-\u23EC\u23F0\u23F3\u25FD\u2693\u26A1\u26AB\u26C5\u26CE\u26D4\u26EA\u26FD\u2705\u2728\u274C\u274E\u2753-\u2755\u2795-\u2797\u27B0\u27BF\u2B50]|\u26D3\uFE0F?(?:\u200D\uD83D\uDCA5)?|\u26F9(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\u2764\uFE0F?(?:\u200D(?:\uD83D\uDD25|\uD83E\uDE79))?|\uD83C(?:[\uDC04\uDD70\uDD71\uDD7E\uDD7F\uDE02\uDE37\uDF21\uDF24-\uDF2C\uDF36\uDF7D\uDF96\uDF97\uDF99-\uDF9B\uDF9E\uDF9F\uDFCD\uDFCE\uDFD4-\uDFDF\uDFF5\uDFF7]\uFE0F?|[\uDF85\uDFC2\uDFC7](?:\uD83C[\uDFFB-\uDFFF])?|[\uDFC4\uDFCA](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDFCB\uDFCC](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|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\uFE0F?(?:\u200D\uD83D\uDDE8\uFE0F?)?|\uDC68(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDC68\uDC69]\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFC-\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFC-\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFD-\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFD\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFE])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFE]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?))?|\uDC69(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?[\uDC68\uDC69]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?|\uDC69\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?))|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFC-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFC-\uDFFF]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFD-\uDFFF]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFD\uDFFF]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB-\uDFFE])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFE]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFB-\uDFFE])))?))?|\uDD75(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDE2E(?:\u200D\uD83D\uDCA8)?|\uDE35(?:\u200D\uD83D\uDCAB)?|\uDE36(?:\u200D\uD83C\uDF2B\uFE0F?)?|\uDE42(?:\u200D[\u2194\u2195]\uFE0F?)?|\uDEB6(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?)|\uD83E(?:[\uDD0C\uDD0F\uDD18-\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5\uDEC3-\uDEC5\uDEF0\uDEF2-\uDEF8](?:\uD83C[\uDFFB-\uDFFF])?|[\uDD26\uDD35\uDD37-\uDD39\uDD3C-\uDD3E\uDDB8\uDDB9\uDDCD\uDDCF\uDDD4\uDDD6-\uDDDD](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDDDE\uDDDF](?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD0D\uDD0E\uDD10-\uDD17\uDD20-\uDD25\uDD27-\uDD2F\uDD3A\uDD3F-\uDD45\uDD47-\uDD76\uDD78-\uDDB4\uDDB7\uDDBA\uDDBC-\uDDCC\uDDD0\uDDE0-\uDDFF\uDE70-\uDE7C\uDE80-\uDE8A\uDE8E-\uDEC2\uDEC6\uDEC8\uDECD-\uDEDC\uDEDF-\uDEEA\uDEEF]|\uDDCE(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDDD1(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1|\uDDD1\u200D\uD83E\uDDD2(?:\u200D\uD83E\uDDD2)?|\uDDD2(?:\u200D\uD83E\uDDD2)?))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE])))?))?|\uDEF1(?:\uD83C(?:\uDFFB(?:\u200D\uD83E\uDEF2\uD83C[\uDFFC-\uDFFF])?|\uDFFC(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFD-\uDFFF])?|\uDFFD(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])?|\uDFFE(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFD\uDFFF])?|\uDFFF(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFE])?))?)/g}});var D4=VD((AA,gJ)=>{gJ.exports={single:{topLeft:"โ”Œ",top:"โ”€",topRight:"โ”",right:"โ”‚",bottomRight:"โ”˜",bottom:"โ”€",bottomLeft:"โ””",left:"โ”‚"},double:{topLeft:"โ•”",top:"โ•",topRight:"โ•—",right:"โ•‘",bottomRight:"โ•",bottom:"โ•",bottomLeft:"โ•š",left:"โ•‘"},round:{topLeft:"โ•ญ",top:"โ”€",topRight:"โ•ฎ",right:"โ”‚",bottomRight:"โ•ฏ",bottom:"โ”€",bottomLeft:"โ•ฐ",left:"โ”‚"},bold:{topLeft:"โ”",top:"โ”",topRight:"โ”“",right:"โ”ƒ",bottomRight:"โ”›",bottom:"โ”",bottomLeft:"โ”—",left:"โ”ƒ"},singleDouble:{topLeft:"โ•“",top:"โ”€",topRight:"โ•–",right:"โ•‘",bottomRight:"โ•œ",bottom:"โ”€",bottomLeft:"โ•™",left:"โ•‘"},doubleSingle:{topLeft:"โ•’",top:"โ•",topRight:"โ••",right:"โ”‚",bottomRight:"โ•›",bottom:"โ•",bottomLeft:"โ•˜",left:"โ”‚"},classic:{topLeft:"+",top:"-",topRight:"+",right:"|",bottomRight:"+",bottom:"-",bottomLeft:"+",left:"|"},arrow:{topLeft:"โ†˜",top:"โ†“",topRight:"โ†™",right:"โ†",bottomRight:"โ†–",bottom:"โ†‘",bottomLeft:"โ†—",left:"โ†’"}}});var i1=VD((ZA,n1)=>{var F4=D4();n1.exports=F4;n1.exports.default=F4});var C4=VD((LA,J4)=>{J4.exports=({onlyFirst:D=!1}={})=>{let F=["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)","(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-ntqry=><~]))"].join("|");return new RegExp(F,D?void 0:"g")}});var z4=VD((MA,W4)=>{var pJ=C4();W4.exports=(D)=>typeof D==="string"?D.replace(pJ(),""):D});var q4=VD((NA,o1)=>{var G4=(D)=>{if(Number.isNaN(D))return!1;if(D>=4352&&(D<=4447||D===9001||D===9002||11904<=D&&D<=12871&&D!==12351||12880<=D&&D<=19903||19968<=D&&D<=42182||43360<=D&&D<=43388||44032<=D&&D<=55203||63744<=D&&D<=64255||65040<=D&&D<=65049||65072<=D&&D<=65131||65281<=D&&D<=65376||65504<=D&&D<=65510||110592<=D&&D<=110593||127488<=D&&D<=127569||131072<=D&&D<=262141))return!0;return!1};o1.exports=G4;o1.exports.default=G4});var K4=VD((jA,H4)=>{H4.exports=function(){return/\uD83C\uDFF4\uDB40\uDC67\uDB40\uDC62(?:\uDB40\uDC65\uDB40\uDC6E\uDB40\uDC67|\uDB40\uDC73\uDB40\uDC63\uDB40\uDC74|\uDB40\uDC77\uDB40\uDC6C\uDB40\uDC73)\uDB40\uDC7F|\uD83D\uDC68(?:\uD83C\uDFFC\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68\uD83C\uDFFB|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFE])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFD])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFC])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83D\uDC68|(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D[\uDC66\uDC67])|[\u2695\u2696\u2708]\uFE0F|\uD83D[\uDC66\uDC67]|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|(?:\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708])\uFE0F|\uD83C\uDFFB\u200D(?:\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C[\uDFFB-\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFB\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFC\u200D\uD83E\uDD1D\u200D\uD83D\uDC69)\uD83C\uDFFB|\uD83E\uDDD1(?:\uD83C\uDFFF\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1(?:\uD83C[\uDFFB-\uDFFF])|\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1)|(?:\uD83E\uDDD1\uD83C\uDFFE\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFF\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB-\uDFFE])|(?:\uD83E\uDDD1\uD83C\uDFFC\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFD\u200D\uD83E\uDD1D\u200D\uD83D\uDC69)(?:\uD83C[\uDFFB\uDFFC])|\uD83D\uDC69(?:\uD83C\uDFFE\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFB\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFC-\uDFFF])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|(?:\uD83E\uDDD1\uD83C\uDFFD\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFE\u200D\uD83E\uDD1D\u200D\uD83D\uDC69)(?:\uD83C[\uDFFB-\uDFFD])|\uD83D\uDC69\u200D\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D[\uDC66\uDC67])|(?:\uD83D\uDC41\uFE0F\u200D\uD83D\uDDE8|\uD83D\uDC69(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|(?:(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)\uFE0F|\uD83D\uDC6F|\uD83E[\uDD3C\uDDDE\uDDDF])\u200D[\u2640\u2642]|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uD83C[\uDFFB-\uDFFF])\u200D[\u2640\u2642]|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD6-\uDDDD])(?:(?:\uD83C[\uDFFB-\uDFFF])\u200D[\u2640\u2642]|\u200D[\u2640\u2642])|\uD83C\uDFF4\u200D\u2620)\uFE0F|\uD83D\uDC69\u200D\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|\uD83C\uDFF3\uFE0F\u200D\uD83C\uDF08|\uD83D\uDC15\u200D\uD83E\uDDBA|\uD83D\uDC69\u200D\uD83D\uDC66|\uD83D\uDC69\u200D\uD83D\uDC67|\uD83C\uDDFD\uD83C\uDDF0|\uD83C\uDDF4\uD83C\uDDF2|\uD83C\uDDF6\uD83C\uDDE6|[#\*0-9]\uFE0F\u20E3|\uD83C\uDDE7(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF])|\uD83C\uDDF9(?:\uD83C[\uDDE6\uDDE8\u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uDFFF])|(?:[\u231A\u231B\u23E9-\u23EC\u23F0\u23F3\u25FD\u25FE\u2614\u2615\u2648-\u2653\u267F\u2693\u26A1\u26AA\u26AB\u26BD\u26BE\u26C4\u26C5\u26CE\u26D4\u26EA\u26F2\u26F3\u26F5\u26FA\u26FD\u2705\u270A\u270B\u2728\u274C\u274E\u2753-\u2755\u2757\u2795-\u2797\u27B0\u27BF\u2B1B\u2B1C\u2B50\u2B55]|\uD83C[\uDC04\uDCCF\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF7C\uDF7E-\uDF93\uDFA0-\uDFCA\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF4\uDFF8-\uDFFF]|\uD83D[\uDC00-\uDC3E\uDC40\uDC42-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDD7A\uDD95\uDD96\uDDA4\uDDFB-\uDE4F\uDE80-\uDEC5\uDECC\uDED0-\uDED2\uDED5\uDEEB\uDEEC\uDEF4-\uDEFA\uDFE0-\uDFEB]|\uD83E[\uDD0D-\uDD3A\uDD3C-\uDD45\uDD47-\uDD71\uDD73-\uDD76\uDD7A-\uDDA2\uDDA5-\uDDAA\uDDAE-\uDDCA\uDDCD-\uDDFF\uDE70-\uDE73\uDE78-\uDE7A\uDE80-\uDE82\uDE90-\uDE95])|(?:[#\*0-9\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23E9-\u23F3\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB-\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u261D\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692-\u2697\u2699\u269B\u269C\u26A0\u26A1\u26AA\u26AB\u26B0\u26B1\u26BD\u26BE\u26C4\u26C5\u26C8\u26CE\u26CF\u26D1\u26D3\u26D4\u26E9\u26EA\u26F0-\u26F5\u26F7-\u26FA\u26FD\u2702\u2705\u2708-\u270D\u270F\u2712\u2714\u2716\u271D\u2721\u2728\u2733\u2734\u2744\u2747\u274C\u274E\u2753-\u2755\u2757\u2763\u2764\u2795-\u2797\u27A1\u27B0\u27BF\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B50\u2B55\u3030\u303D\u3297\u3299]|\uD83C[\uDC04\uDCCF\uDD70\uDD71\uDD7E\uDD7F\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE02\uDE1A\uDE2F\uDE32-\uDE3A\uDE50\uDE51\uDF00-\uDF21\uDF24-\uDF93\uDF96\uDF97\uDF99-\uDF9B\uDF9E-\uDFF0\uDFF3-\uDFF5\uDFF7-\uDFFF]|\uD83D[\uDC00-\uDCFD\uDCFF-\uDD3D\uDD49-\uDD4E\uDD50-\uDD67\uDD6F\uDD70\uDD73-\uDD7A\uDD87\uDD8A-\uDD8D\uDD90\uDD95\uDD96\uDDA4\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA-\uDE4F\uDE80-\uDEC5\uDECB-\uDED2\uDED5\uDEE0-\uDEE5\uDEE9\uDEEB\uDEEC\uDEF0\uDEF3-\uDEFA\uDFE0-\uDFEB]|\uD83E[\uDD0D-\uDD3A\uDD3C-\uDD45\uDD47-\uDD71\uDD73-\uDD76\uDD7A-\uDDA2\uDDA5-\uDDAA\uDDAE-\uDDCA\uDDCD-\uDDFF\uDE70-\uDE73\uDE78-\uDE7A\uDE80-\uDE82\uDE90-\uDE95])\uFE0F|(?:[\u261D\u26F9\u270A-\u270D]|\uD83C[\uDF85\uDFC2-\uDFC4\uDFC7\uDFCA-\uDFCC]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66-\uDC78\uDC7C\uDC81-\uDC83\uDC85-\uDC87\uDC8F\uDC91\uDCAA\uDD74\uDD75\uDD7A\uDD90\uDD95\uDD96\uDE45-\uDE47\uDE4B-\uDE4F\uDEA3\uDEB4-\uDEB6\uDEC0\uDECC]|\uD83E[\uDD0F\uDD18-\uDD1F\uDD26\uDD30-\uDD39\uDD3C-\uDD3E\uDDB5\uDDB6\uDDB8\uDDB9\uDDBB\uDDCD-\uDDCF\uDDD1-\uDDDD])/g}});var E4=VD((RA,s1)=>{var nJ=z4(),iJ=q4(),aJ=K4(),U4=(D)=>{if(typeof D!=="string"||D.length===0)return 0;if(D=nJ(D),D.length===0)return 0;D=D.replace(aJ()," ");let F=0;for(let Q=0;Q=127&&B<=159)continue;if(B>=768&&B<=879)continue;if(B>65535)Q++;F+=iJ(B)?2:1}return F};s1.exports=U4;s1.exports.default=U4});var Z4=VD((_A,A4)=>{var rJ=E4();function lF(D,F){if(!D)return D;F=F||{};let Q=F.align||"center";if(Q==="left")return D;let B=F.split||` -`,Y=F.pad||" ",J=Q!=="right"?oJ:sJ,X=!1;if(!Array.isArray(D))X=!0,D=String(D).split(B);let C,z=0;return D=D.map(function(W){return W=String(W),C=rJ(W),z=Math.max(C,z),{str:W,width:C}}).map(function(W){return new Array(J(z,W.width)+1).join(Y)+W.str}),X?D.join(B):D}lF.left=function D(F){return lF(F,{align:"left"})};lF.center=function D(F){return lF(F,{align:"center"})};lF.right=function D(F){return lF(F,{align:"right"})};A4.exports=lF;function oJ(D,F){return Math.floor((D-F)/2)}function sJ(D,F){return D-F}});var k4={};MF(k4,{version:()=>VC,type:()=>MC,scripts:()=>RC,repository:()=>wC,publishConfig:()=>SC,name:()=>ZC,main:()=>NC,license:()=>IC,keywords:()=>_C,homepage:()=>TC,files:()=>uC,exports:()=>jC,engines:()=>vC,devDependencies:()=>bC,description:()=>LC,dependencies:()=>kC,default:()=>yC,bugs:()=>PC,bin:()=>xC,author:()=>OC});var ZC="claude-mem",VC="3.9.12",LC="Memory compression system for Claude Code - persist context across sessions",MC="module",NC="dist/claude-mem.min.js",jC,RC,_C,OC="Alex Newman",IC="SEE LICENSE IN LICENSE",wC,TC="https://github.com/thedotmack/claude-mem#readme",PC,SC,kC,bC,vC,xC,uC,yC;var b4=zF(()=>{jC={".":"./dist/claude-mem.min.js"},RC={dev:"tsx src/bin/cli.ts","dev:install":"node dist/claude-mem.min.js install --force","dev:status":"node dist/claude-mem.min.js status","dev:compress":"node dist/claude-mem.min.js compress","dev:load":"node dist/claude-mem.min.js load-context","dev:uninstall":"node dist/claude-mem.min.js uninstall","memory-stream:server":"node src/ui/memory-stream/server.js",build:"./scripts/build-minified.sh",test:"bun test test/unit/ test/basic.test.ts && npm run test:integration","test:unit":"bun test test/unit/","test:integration":"vitest run","test:integration:watch":"vitest watch","test:integration:ui":"vitest --ui","test:e2e":"bun test test/e2e/","test:performance":"bun test test/performance/ --benchmark","test:coverage":"bun test --coverage","test:watch":"bun test --watch",lint:"eslint 'src/**/*.ts' 'hook-templates/**/*.ts' 'test/**/*.ts'","lint:fix":"npm run lint -- --fix",format:"prettier --write 'src/**/*.ts' 'hook-templates/**/*.ts' 'test/**/*.ts'","build:npm":"./scripts/npm-publish.sh",publish:"./scripts/publish-with-changelog.sh","publish:latest":"./scripts/publish-latest.sh","publish:with-changelog":"./scripts/publish-with-changelog.sh bump","publish:github":"./scripts/github-publish.sh"},_C=["claude","claude-agent-sdk","mcp","memory","compression","knowledge-graph","transcript","cli","typescript","bun"],wC={type:"git",url:"https://github.com/thedotmack/claude-mem.git"},PC={url:"https://github.com/thedotmack/claude-mem/issues"},SC={access:"public",registry:"https://registry.npmjs.org/"},kC={"@anthropic-ai/claude-agent-sdk":"^0.1.0","@clack/prompts":"^0.11.0","better-sqlite3":"^11.8.0",boxen:"^8.0.1",chalk:"^5.6.0",commander:"^14.0.0",glob:"^11.0.3","gradient-string":"^3.0.0",handlebars:"^4.7.8"},bC={"@types/handlebars":"^4.0.40","@types/node":"^20.0.0","@typescript-eslint/eslint-plugin":"^6.0.0","@typescript-eslint/parser":"^6.0.0","@vitest/ui":"^3.2.4",eslint:"^8.0.0",prettier:"^3.0.0",tsx:"^4.20.5",typescript:"^5.0.0",vitest:"^3.2.4"},vC={node:">=18.0.0",bun:">=1.0.0"},xC={"claude-mem":"dist/claude-mem.min.js"},uC=["dist","hook-templates","commands","docs","src","CHANGELOG.md"],yC={name:ZC,version:VC,description:LC,type:MC,main:NC,exports:jC,scripts:RC,keywords:_C,author:OC,license:IC,repository:wC,homepage:TC,bugs:PC,publishConfig:SC,dependencies:kC,devDependencies:bC,engines:vC,bin:xC,files:uC}});import{join as nD,dirname as W6,sep as fC}from"path";import{homedir as X7}from"os";import{existsSync as D8,statSync as gC}from"fs";import{execSync as v4}from"child_process";import{fileURLToPath as $C}from"url";class CD{static instance=null;_dataDirectory=null;_packageRoot=null;_claudeConfigDirectory=null;static getInstance(){if(!CD.instance)CD.instance=new CD;return CD.instance}getDataDirectory(){if(this._dataDirectory)return this._dataDirectory;return this._dataDirectory=process.env.CLAUDE_MEM_DATA_DIR||nD(X7(),".claude-mem"),this._dataDirectory}getArchivesDirectory(){return nD(this.getDataDirectory(),"archives")}getHooksDirectory(){return nD(this.getDataDirectory(),"hooks")}getLogsDirectory(){return nD(this.getDataDirectory(),"logs")}getIndexDirectory(){return this.getDataDirectory()}getIndexPath(){return nD(this.getIndexDirectory(),"claude-mem-index.jsonl")}getTrashDirectory(){return nD(this.getDataDirectory(),"trash")}getBackupsDirectory(){return nD(this.getDataDirectory(),"backups")}getChromaDirectory(){return nD(this.getDataDirectory(),"chroma")}getProjectArchiveDirectory(D){return nD(this.getArchivesDirectory(),D)}getUserSettingsPath(){return nD(this.getDataDirectory(),"settings.json")}getClaudeConfigDirectory(){if(this._claudeConfigDirectory)return this._claudeConfigDirectory;return this._claudeConfigDirectory=process.env.CLAUDE_CONFIG_DIR||nD(X7(),".claude"),this._claudeConfigDirectory}getClaudeSettingsPath(){return nD(this.getClaudeConfigDirectory(),"settings.json")}getClaudeCommandsDirectory(){return nD(this.getClaudeConfigDirectory(),"commands")}getClaudeMdPath(){return nD(this.getClaudeConfigDirectory(),"CLAUDE.md")}getMcpConfigPath(){return nD(X7(),".claude.json")}getProjectMcpConfigPath(){return nD(process.cwd(),".mcp.json")}getPackageRoot(){if(this._packageRoot)return this._packageRoot;try{let Q=gD.resolve("/Users/alexnewman/Scripts/claude-mem-source__ui/package.json");return this._packageRoot=W6(Q),this._packageRoot}catch{}let D=$C(import.meta.url),F=W6(D);for(let Q=0;Q<10;Q++){let B=nD(F,"package.json");if(D8(B)){if(gD(B).name==="claude-mem")return this._packageRoot=F,this._packageRoot}let Y=W6(F);if(Y===F)break;F=Y}try{let Q=v4("npm list -g claude-mem --json 2>/dev/null || npm list claude-mem --json 2>/dev/null",{encoding:"utf8"}),B=JSON.parse(Q);if(B.dependencies?.["claude-mem"]?.resolved)return this._packageRoot=W6(B.dependencies["claude-mem"].resolved),this._packageRoot}catch{}throw new Error("Cannot locate claude-mem package root. Ensure claude-mem is properly installed.")}findPackageHookTemplatesDirectory(){let D=this.getPackageRoot(),F=nD(D,"hook-templates"),Q=["session-start.js","stop.js","user-prompt-submit.js","post-tool-use.js"];for(let B of Q)if(!D8(nD(F,B)))throw new Error(`Package hook-templates directory missing required template file: ${B}`);return F}findPackageCommandsDirectory(){let D=this.getPackageRoot(),F=nD(D,"commands"),Q=["save.md"];for(let B of Q)if(!D8(nD(F,B)))throw new Error(`Package commands directory missing required file: ${B}`);return F}ensureDirectory(D){if(!D8(D))gD("fs").mkdirSync(D,{recursive:!0})}ensureDirectories(D){D.forEach((F)=>this.ensureDirectory(F))}ensureAllDataDirectories(){this.ensureDirectories([this.getDataDirectory(),this.getArchivesDirectory(),this.getHooksDirectory(),this.getLogsDirectory(),this.getTrashDirectory(),this.getBackupsDirectory(),this.getChromaDirectory()])}ensureAllClaudeDirectories(){this.ensureDirectories([this.getClaudeConfigDirectory(),this.getClaudeCommandsDirectory()])}static extractProjectName(D){let F=D.split(fC),Q=["src","lib","app","project","workspace"];for(let B=F.length-1;B>=0;B--)if(Q.includes(F[B])&&B>0)return F[B-1];if(F.length>1)return F[F.length-2];return"unknown-project"}static getCurrentProjectName(){try{let D=v4("git rev-parse --show-toplevel",{cwd:process.cwd(),encoding:"utf8",stdio:["pipe","pipe","ignore"]}).trim();return gD("path").basename(D)}catch{return gD("path").basename(process.cwd())}}static createBackupFilename(D){let F=new Date().toISOString().replace(/[:.]/g,"-").replace("T","_").slice(0,19);return`${D}.backup.${F}`}static isPathAccessible(D){return D8(D)&&gC(D).isDirectory()}}var E0=()=>{};var GF=VD((CW)=>{CW.getBooleanOption=(D,F)=>{let Q=!1;if(F in D&&typeof(Q=D[F])!=="boolean")throw new TypeError(`Expected the "${F}" option to be a boolean`);return Q};CW.cppdb=Symbol();CW.inspect=Symbol.for("nodejs.util.inspect.custom")});var q7=VD((VZ,m4)=>{var G7={value:"SqliteError",writable:!0,enumerable:!1,configurable:!0};function cF(D,F){if(new.target!==cF)return new cF(D,F);if(typeof F!=="string")throw new TypeError("Expected second argument to be a string");Error.call(this,D),G7.value=""+D,Object.defineProperty(this,"message",G7),Error.captureStackTrace(this,cF),this.code=F}Object.setPrototypeOf(cF,Error);Object.setPrototypeOf(cF.prototype,Error.prototype);Object.defineProperty(cF.prototype,"name",G7);m4.exports=cF});var d4=VD((LZ,l4)=>{var H6=gD("path").sep||"/";l4.exports=qW;function qW(D){if(typeof D!="string"||D.length<=7||D.substring(0,7)!="file://")throw new TypeError("must pass in a file:// URI to convert to a file path");var F=decodeURI(D.substring(7)),Q=F.indexOf("/"),B=F.substring(0,Q),Y=F.substring(Q+1);if(B=="localhost")B="";if(B)B=H6+H6+B;if(Y=Y.replace(/^(.+)\|/,"$1:"),H6=="\\")Y=Y.replace(/\//g,"\\");if(/^.+\:/.test(Y));else Y=H6+Y;return B+Y}});var i4=VD((E6,n4)=>{var __filename="/Users/alexnewman/Scripts/claude-mem-source__ui/node_modules/bindings/bindings.js",H7=gD("fs"),U6=gD("path"),HW=d4(),K6=U6.join,KW=U6.dirname,c4=H7.accessSync&&function(D){try{H7.accessSync(D)}catch(F){return!1}return!0}||H7.existsSync||U6.existsSync,p4={arrow:process.env.NODE_BINDINGS_ARROW||" โ†’ ",compiled:process.env.NODE_BINDINGS_COMPILED_DIR||"compiled",platform:process.platform,arch:process.arch,nodePreGyp:"node-v"+process.versions.modules+"-"+process.platform+"-"+process.arch,version:process.versions.node,bindings:"bindings.node",try:[["module_root","build","bindings"],["module_root","build","Debug","bindings"],["module_root","build","Release","bindings"],["module_root","out","Debug","bindings"],["module_root","Debug","bindings"],["module_root","out","Release","bindings"],["module_root","Release","bindings"],["module_root","build","default","bindings"],["module_root","compiled","version","platform","arch","bindings"],["module_root","addon-build","release","install-root","bindings"],["module_root","addon-build","debug","install-root","bindings"],["module_root","addon-build","default","install-root","bindings"],["module_root","lib","binding","nodePreGyp","bindings"]]};function UW(D){if(typeof D=="string")D={bindings:D};else if(!D)D={};if(Object.keys(p4).map(function(z){if(!(z in D))D[z]=p4[z]}),!D.module_root)D.module_root=E6.getRoot(E6.getFileName());if(U6.extname(D.bindings)!=".node")D.bindings+=".node";var F=typeof __webpack_require__==="function"?__non_webpack_require__:gD,Q=[],B=0,Y=D.try.length,J,X,C;for(;BVC,type:()=>MC,scripts:()=>RC,repository:()=>wC,publishConfig:()=>SC,name:()=>ZC,main:()=>NC,license:()=>IC,keywords:()=>_C,homepage:()=>TC,files:()=>uC,exports:()=>jC,engines:()=>vC,devDependencies:()=>bC,description:()=>LC,dependencies:()=>kC,default:()=>yC,bugs:()=>PC,bin:()=>xC,author:()=>OC});var ZC="claude-mem",VC="3.9.13",LC="Memory compression system for Claude Code - persist context across sessions",MC="module",NC="dist/claude-mem.min.js",jC,RC,_C,OC="Alex Newman",IC="SEE LICENSE IN LICENSE",wC,TC="https://github.com/thedotmack/claude-mem#readme",PC,SC,kC,bC,vC,xC,uC,yC;var b4=zF(()=>{jC={".":"./dist/claude-mem.min.js"},RC={dev:"tsx src/bin/cli.ts","dev:install":"node dist/claude-mem.min.js install --force","dev:status":"node dist/claude-mem.min.js status","dev:compress":"node dist/claude-mem.min.js compress","dev:load":"node dist/claude-mem.min.js load-context","dev:uninstall":"node dist/claude-mem.min.js uninstall","memory-stream:server":"node src/ui/memory-stream/server.js",build:"./scripts/build-minified.sh",test:"bun test test/unit/ test/basic.test.ts && npm run test:integration","test:unit":"bun test test/unit/","test:integration":"vitest run","test:integration:watch":"vitest watch","test:integration:ui":"vitest --ui","test:e2e":"bun test test/e2e/","test:performance":"bun test test/performance/ --benchmark","test:coverage":"bun test --coverage","test:watch":"bun test --watch",lint:"eslint 'src/**/*.ts' 'hook-templates/**/*.ts' 'test/**/*.ts'","lint:fix":"npm run lint -- --fix",format:"prettier --write 'src/**/*.ts' 'hook-templates/**/*.ts' 'test/**/*.ts'","build:npm":"./scripts/npm-publish.sh",publish:"./scripts/publish-with-changelog.sh","publish:latest":"./scripts/publish-latest.sh","publish:with-changelog":"./scripts/publish-with-changelog.sh bump","publish:github":"./scripts/github-publish.sh"},_C=["claude","claude-agent-sdk","mcp","memory","compression","knowledge-graph","transcript","cli","typescript","bun"],wC={type:"git",url:"https://github.com/thedotmack/claude-mem.git"},PC={url:"https://github.com/thedotmack/claude-mem/issues"},SC={access:"public",registry:"https://registry.npmjs.org/"},kC={"@anthropic-ai/claude-agent-sdk":"^0.1.0","@clack/prompts":"^0.11.0","better-sqlite3":"^11.8.0",boxen:"^8.0.1",chalk:"^5.6.0",commander:"^14.0.0",glob:"^11.0.3","gradient-string":"^3.0.0",handlebars:"^4.7.8"},bC={"@types/handlebars":"^4.0.40","@types/node":"^20.0.0","@typescript-eslint/eslint-plugin":"^6.0.0","@typescript-eslint/parser":"^6.0.0","@vitest/ui":"^3.2.4",eslint:"^8.0.0",prettier:"^3.0.0",tsx:"^4.20.5",typescript:"^5.0.0",vitest:"^3.2.4"},vC={node:">=18.0.0",bun:">=1.0.0"},xC={"claude-mem":"dist/claude-mem.min.js"},uC=["dist","hook-templates","commands","docs","src","CHANGELOG.md"],yC={name:ZC,version:VC,description:LC,type:MC,main:NC,exports:jC,scripts:RC,keywords:_C,author:OC,license:IC,repository:wC,homepage:TC,bugs:PC,publishConfig:SC,dependencies:kC,devDependencies:bC,engines:vC,bin:xC,files:uC}});import{join as nD,dirname as W6,sep as fC}from"path";import{homedir as X7}from"os";import{existsSync as D8,statSync as gC}from"fs";import{execSync as v4}from"child_process";import{fileURLToPath as $C}from"url";class CD{static instance=null;_dataDirectory=null;_packageRoot=null;_claudeConfigDirectory=null;static getInstance(){if(!CD.instance)CD.instance=new CD;return CD.instance}getDataDirectory(){if(this._dataDirectory)return this._dataDirectory;return this._dataDirectory=process.env.CLAUDE_MEM_DATA_DIR||nD(X7(),".claude-mem"),this._dataDirectory}getArchivesDirectory(){return nD(this.getDataDirectory(),"archives")}getHooksDirectory(){return nD(this.getDataDirectory(),"hooks")}getLogsDirectory(){return nD(this.getDataDirectory(),"logs")}getIndexDirectory(){return this.getDataDirectory()}getIndexPath(){return nD(this.getIndexDirectory(),"claude-mem-index.jsonl")}getTrashDirectory(){return nD(this.getDataDirectory(),"trash")}getBackupsDirectory(){return nD(this.getDataDirectory(),"backups")}getChromaDirectory(){return nD(this.getDataDirectory(),"chroma")}getProjectArchiveDirectory(D){return nD(this.getArchivesDirectory(),D)}getUserSettingsPath(){return nD(this.getDataDirectory(),"settings.json")}getClaudeConfigDirectory(){if(this._claudeConfigDirectory)return this._claudeConfigDirectory;return this._claudeConfigDirectory=process.env.CLAUDE_CONFIG_DIR||nD(X7(),".claude"),this._claudeConfigDirectory}getClaudeSettingsPath(){return nD(this.getClaudeConfigDirectory(),"settings.json")}getClaudeCommandsDirectory(){return nD(this.getClaudeConfigDirectory(),"commands")}getClaudeMdPath(){return nD(this.getClaudeConfigDirectory(),"CLAUDE.md")}getMcpConfigPath(){return nD(X7(),".claude.json")}getProjectMcpConfigPath(){return nD(process.cwd(),".mcp.json")}getPackageRoot(){if(this._packageRoot)return this._packageRoot;try{let Q=gD.resolve("/Users/alexnewman/Scripts/claude-mem-source__ui/package.json");return this._packageRoot=W6(Q),this._packageRoot}catch{}let D=$C(import.meta.url),F=W6(D);for(let Q=0;Q<10;Q++){let B=nD(F,"package.json");if(D8(B)){if(gD(B).name==="claude-mem")return this._packageRoot=F,this._packageRoot}let Y=W6(F);if(Y===F)break;F=Y}try{let Q=v4("npm list -g claude-mem --json 2>/dev/null || npm list claude-mem --json 2>/dev/null",{encoding:"utf8"}),B=JSON.parse(Q);if(B.dependencies?.["claude-mem"]?.resolved)return this._packageRoot=W6(B.dependencies["claude-mem"].resolved),this._packageRoot}catch{}throw new Error("Cannot locate claude-mem package root. Ensure claude-mem is properly installed.")}findPackageHookTemplatesDirectory(){let D=this.getPackageRoot(),F=nD(D,"hook-templates"),Q=["session-start.js","stop.js","user-prompt-submit.js","post-tool-use.js"];for(let B of Q)if(!D8(nD(F,B)))throw new Error(`Package hook-templates directory missing required template file: ${B}`);return F}findPackageCommandsDirectory(){let D=this.getPackageRoot(),F=nD(D,"commands"),Q=["save.md"];for(let B of Q)if(!D8(nD(F,B)))throw new Error(`Package commands directory missing required file: ${B}`);return F}ensureDirectory(D){if(!D8(D))gD("fs").mkdirSync(D,{recursive:!0})}ensureDirectories(D){D.forEach((F)=>this.ensureDirectory(F))}ensureAllDataDirectories(){this.ensureDirectories([this.getDataDirectory(),this.getArchivesDirectory(),this.getHooksDirectory(),this.getLogsDirectory(),this.getTrashDirectory(),this.getBackupsDirectory(),this.getChromaDirectory()])}ensureAllClaudeDirectories(){this.ensureDirectories([this.getClaudeConfigDirectory(),this.getClaudeCommandsDirectory()])}static extractProjectName(D){let F=D.split(fC),Q=["src","lib","app","project","workspace"];for(let B=F.length-1;B>=0;B--)if(Q.includes(F[B])&&B>0)return F[B-1];if(F.length>1)return F[F.length-2];return"unknown-project"}static getCurrentProjectName(){try{let D=v4("git rev-parse --show-toplevel",{cwd:process.cwd(),encoding:"utf8",stdio:["pipe","pipe","ignore"]}).trim();return gD("path").basename(D)}catch{return gD("path").basename(process.cwd())}}static createBackupFilename(D){let F=new Date().toISOString().replace(/[:.]/g,"-").replace("T","_").slice(0,19);return`${D}.backup.${F}`}static isPathAccessible(D){return D8(D)&&gC(D).isDirectory()}}var E0=()=>{};var GF=VD((CW)=>{CW.getBooleanOption=(D,F)=>{let Q=!1;if(F in D&&typeof(Q=D[F])!=="boolean")throw new TypeError(`Expected the "${F}" option to be a boolean`);return Q};CW.cppdb=Symbol();CW.inspect=Symbol.for("nodejs.util.inspect.custom")});var q7=VD((VZ,m4)=>{var G7={value:"SqliteError",writable:!0,enumerable:!1,configurable:!0};function cF(D,F){if(new.target!==cF)return new cF(D,F);if(typeof F!=="string")throw new TypeError("Expected second argument to be a string");Error.call(this,D),G7.value=""+D,Object.defineProperty(this,"message",G7),Error.captureStackTrace(this,cF),this.code=F}Object.setPrototypeOf(cF,Error);Object.setPrototypeOf(cF.prototype,Error.prototype);Object.defineProperty(cF.prototype,"name",G7);m4.exports=cF});var d4=VD((LZ,l4)=>{var H6=gD("path").sep||"/";l4.exports=qW;function qW(D){if(typeof D!="string"||D.length<=7||D.substring(0,7)!="file://")throw new TypeError("must pass in a file:// URI to convert to a file path");var F=decodeURI(D.substring(7)),Q=F.indexOf("/"),B=F.substring(0,Q),Y=F.substring(Q+1);if(B=="localhost")B="";if(B)B=H6+H6+B;if(Y=Y.replace(/^(.+)\|/,"$1:"),H6=="\\")Y=Y.replace(/\//g,"\\");if(/^.+\:/.test(Y));else Y=H6+Y;return B+Y}});var i4=VD((E6,n4)=>{var __filename="/Users/alexnewman/Scripts/claude-mem-source__ui/node_modules/bindings/bindings.js",H7=gD("fs"),U6=gD("path"),HW=d4(),K6=U6.join,KW=U6.dirname,c4=H7.accessSync&&function(D){try{H7.accessSync(D)}catch(F){return!1}return!0}||H7.existsSync||U6.existsSync,p4={arrow:process.env.NODE_BINDINGS_ARROW||" โ†’ ",compiled:process.env.NODE_BINDINGS_COMPILED_DIR||"compiled",platform:process.platform,arch:process.arch,nodePreGyp:"node-v"+process.versions.modules+"-"+process.platform+"-"+process.arch,version:process.versions.node,bindings:"bindings.node",try:[["module_root","build","bindings"],["module_root","build","Debug","bindings"],["module_root","build","Release","bindings"],["module_root","out","Debug","bindings"],["module_root","Debug","bindings"],["module_root","out","Release","bindings"],["module_root","Release","bindings"],["module_root","build","default","bindings"],["module_root","compiled","version","platform","arch","bindings"],["module_root","addon-build","release","install-root","bindings"],["module_root","addon-build","debug","install-root","bindings"],["module_root","addon-build","default","install-root","bindings"],["module_root","lib","binding","nodePreGyp","bindings"]]};function UW(D){if(typeof D=="string")D={bindings:D};else if(!D)D={};if(Object.keys(p4).map(function(z){if(!(z in D))D[z]=p4[z]}),!D.module_root)D.module_root=E6.getRoot(E6.getFileName());if(U6.extname(D.bindings)!=".node")D.bindings+=".node";var F=typeof __webpack_require__==="function"?__non_webpack_require__:gD,Q=[],B=0,Y=D.try.length,J,X,C;for(;B{var{cppdb:s0}=GF();EW.prepare=function D(F){return this[s0].prepare(F,this,!1)};EW.exec=function D(F){return this[s0].exec(F),this};EW.close=function D(){return this[s0].close(),this};EW.loadExtension=function D(...F){return this[s0].loadExtension(...F),this};EW.defaultSafeIntegers=function D(...F){return this[s0].defaultSafeIntegers(...F),this};EW.unsafeMode=function D(...F){return this[s0].unsafeMode(...F),this};EW.getters={name:{get:function D(){return this[s0].name},enumerable:!0},open:{get:function D(){return this[s0].open},enumerable:!0},inTransaction:{get:function D(){return this[s0].inTransaction},enumerable:!0},readonly:{get:function D(){return this[s0].readonly},enumerable:!0},memory:{get:function D(){return this[s0].memory},enumerable:!0}}});var s4=VD((_Z,o4)=>{var{cppdb:RW}=GF(),r4=new WeakMap;o4.exports=function D(F){if(typeof F!=="function")throw new TypeError("Expected first argument to be a function");let Q=this[RW],B=_W(Q,this),{apply:Y}=Function.prototype,J={default:{value:A6(Y,F,Q,B.default)},deferred:{value:A6(Y,F,Q,B.deferred)},immediate:{value:A6(Y,F,Q,B.immediate)},exclusive:{value:A6(Y,F,Q,B.exclusive)},database:{value:this,enumerable:!0}};return Object.defineProperties(J.default.value,J),Object.defineProperties(J.deferred.value,J),Object.defineProperties(J.immediate.value,J),Object.defineProperties(J.exclusive.value,J),J.default.value};var _W=(D,F)=>{let Q=r4.get(D);if(!Q){let B={commit:D.prepare("COMMIT",F,!1),rollback:D.prepare("ROLLBACK",F,!1),savepoint:D.prepare("SAVEPOINT `\t_bs3. `",F,!1),release:D.prepare("RELEASE `\t_bs3. `",F,!1),rollbackTo:D.prepare("ROLLBACK TO `\t_bs3. `",F,!1)};r4.set(D,Q={default:Object.assign({begin:D.prepare("BEGIN",F,!1)},B),deferred:Object.assign({begin:D.prepare("BEGIN DEFERRED",F,!1)},B),immediate:Object.assign({begin:D.prepare("BEGIN IMMEDIATE",F,!1)},B),exclusive:Object.assign({begin:D.prepare("BEGIN EXCLUSIVE",F,!1)},B)})}return Q},A6=(D,F,Q,{begin:B,commit:Y,rollback:J,savepoint:X,release:C,rollbackTo:z})=>function W(){let G,q,A;if(Q.inTransaction)G=X,q=C,A=z;else G=B,q=Y,A=J;G.run();try{let U=D.call(F,this,arguments);if(U&&typeof U.then==="function")throw new TypeError("Transaction function cannot return a promise");return q.run(),U}catch(U){if(Q.inTransaction){if(A.run(),A!==J)q.run()}throw U}}});var e4=VD((OZ,t4)=>{var{getBooleanOption:OW,cppdb:IW}=GF();t4.exports=function D(F,Q){if(Q==null)Q={};if(typeof F!=="string")throw new TypeError("Expected first argument to be a string");if(typeof Q!=="object")throw new TypeError("Expected second argument to be an options object");let B=OW(Q,"simple"),Y=this[IW].prepare(`PRAGMA ${F}`,this,!0);return B?Y.pluck().get():Y.all()}});var B5=VD((IZ,F5)=>{var wW=gD("fs"),TW=gD("path"),{promisify:PW}=gD("util"),{cppdb:SW}=GF(),D5=PW(wW.access);F5.exports=async function D(F,Q){if(Q==null)Q={};if(typeof F!=="string")throw new TypeError("Expected first argument to be a string");if(typeof Q!=="object")throw new TypeError("Expected second argument to be an options object");F=F.trim();let B="attached"in Q?Q.attached:"main",Y="progress"in Q?Q.progress:null;if(!F)throw new TypeError("Backup filename cannot be an empty string");if(F===":memory:")throw new TypeError('Invalid backup filename ":memory:"');if(typeof B!=="string")throw new TypeError('Expected the "attached" option to be a string');if(!B)throw new TypeError('The "attached" option cannot be an empty string');if(Y!=null&&typeof Y!=="function")throw new TypeError('Expected the "progress" option to be a function');await D5(TW.dirname(F)).catch(()=>{throw new TypeError("Cannot save backup because the directory does not exist")});let J=await D5(F).then(()=>!1,()=>!0);return kW(this[SW].backup(this,B,F,J),Y||null)};var kW=(D,F)=>{let Q=0,B=!0;return new Promise((Y,J)=>{setImmediate(function X(){try{let C=D.transfer(Q);if(!C.remainingPages){D.close(),Y(C);return}if(B)B=!1,Q=100;if(F){let z=F(C);if(z!==void 0)if(typeof z==="number"&&z===z)Q=Math.max(0,Math.min(2147483647,Math.round(z)));else throw new TypeError("Expected progress callback to return a number or undefined")}setImmediate(X)}catch(C){D.close(),J(C)}})})}});var X5=VD((wZ,Q5)=>{var{cppdb:bW}=GF();Q5.exports=function D(F){if(F==null)F={};if(typeof F!=="object")throw new TypeError("Expected first argument to be an options object");let Q="attached"in F?F.attached:"main";if(typeof Q!=="string")throw new TypeError('Expected the "attached" option to be a string');if(!Q)throw new TypeError('The "attached" option cannot be an empty string');return this[bW].serialize(Q)}});var J5=VD((TZ,Y5)=>{var{getBooleanOption:Z6,cppdb:vW}=GF();Y5.exports=function D(F,Q,B){if(Q==null)Q={};if(typeof Q==="function")B=Q,Q={};if(typeof F!=="string")throw new TypeError("Expected first argument to be a string");if(typeof B!=="function")throw new TypeError("Expected last argument to be a function");if(typeof Q!=="object")throw new TypeError("Expected second argument to be an options object");if(!F)throw new TypeError("User-defined function name cannot be an empty string");let Y="safeIntegers"in Q?+Z6(Q,"safeIntegers"):2,J=Z6(Q,"deterministic"),X=Z6(Q,"directOnly"),C=Z6(Q,"varargs"),z=-1;if(!C){if(z=B.length,!Number.isInteger(z)||z<0)throw new TypeError("Expected function.length to be a positive integer");if(z>100)throw new RangeError("User-defined functions cannot have more than 100 arguments")}return this[vW].function(B,F,z,Y,J,X),this}});var z5=VD((PZ,W5)=>{var{getBooleanOption:V6,cppdb:xW}=GF();W5.exports=function D(F,Q){if(typeof F!=="string")throw new TypeError("Expected first argument to be a string");if(typeof Q!=="object"||Q===null)throw new TypeError("Expected second argument to be an options object");if(!F)throw new TypeError("User-defined function name cannot be an empty string");let B="start"in Q?Q.start:null,Y=K7(Q,"step",!0),J=K7(Q,"inverse",!1),X=K7(Q,"result",!1),C="safeIntegers"in Q?+V6(Q,"safeIntegers"):2,z=V6(Q,"deterministic"),W=V6(Q,"directOnly"),G=V6(Q,"varargs"),q=-1;if(!G){if(q=Math.max(C5(Y),J?C5(J):0),q>0)q-=1;if(q>100)throw new RangeError("User-defined functions cannot have more than 100 arguments")}return this[xW].aggregate(B,Y,J,X,F,q,C,z,W),this};var K7=(D,F,Q)=>{let B=F in D?D[F]:null;if(typeof B==="function")return B;if(B!=null)throw new TypeError(`Expected the "${F}" option to be a function`);if(Q)throw new TypeError(`Missing required option "${F}"`);return null},C5=({length:D})=>{if(Number.isInteger(D)&&D>=0)return D;throw new TypeError("Expected function.length to be a positive integer")}});var K5=VD((SZ,H5)=>{var{cppdb:uW}=GF();H5.exports=function D(F,Q){if(typeof F!=="string")throw new TypeError("Expected first argument to be a string");if(!F)throw new TypeError("Virtual table module name cannot be an empty string");let B=!1;if(typeof Q==="object"&&Q!==null)B=!0,Q=dW(q5(Q,"used",F));else{if(typeof Q!=="function")throw new TypeError("Expected second argument to be a function or a table definition object");Q=yW(Q)}return this[uW].table(Q,F,B),this};function yW(D){return function F(Q,B,Y,...J){let X={module:Q,database:B,table:Y},C=mW.call(D,X,J);if(typeof C!=="object"||C===null)throw new TypeError(`Virtual table module "${Q}" did not return a table definition object`);return q5(C,"returned",Q)}}function q5(D,F,Q){if(!X8.call(D,"rows"))throw new TypeError(`Virtual table module "${Q}" ${F} a table definition without a "rows" property`);if(!X8.call(D,"columns"))throw new TypeError(`Virtual table module "${Q}" ${F} a table definition without a "columns" property`);let B=D.rows;if(typeof B!=="function"||Object.getPrototypeOf(B)!==lW)throw new TypeError(`Virtual table module "${Q}" ${F} a table definition with an invalid "rows" property (should be a generator function)`);let Y=D.columns;if(!Array.isArray(Y)||!(Y=[...Y]).every((W)=>typeof W==="string"))throw new TypeError(`Virtual table module "${Q}" ${F} a table definition with an invalid "columns" property (should be an array of strings)`);if(Y.length!==new Set(Y).size)throw new TypeError(`Virtual table module "${Q}" ${F} a table definition with duplicate column names`);if(!Y.length)throw new RangeError(`Virtual table module "${Q}" ${F} a table definition with zero columns`);let J;if(X8.call(D,"parameters")){if(J=D.parameters,!Array.isArray(J)||!(J=[...J]).every((W)=>typeof W==="string"))throw new TypeError(`Virtual table module "${Q}" ${F} a table definition with an invalid "parameters" property (should be an array of strings)`)}else J=hW(B);if(J.length!==new Set(J).size)throw new TypeError(`Virtual table module "${Q}" ${F} a table definition with duplicate parameter names`);if(J.length>32)throw new RangeError(`Virtual table module "${Q}" ${F} a table definition with more than the maximum number of 32 parameters`);for(let W of J)if(Y.includes(W))throw new TypeError(`Virtual table module "${Q}" ${F} a table definition with column "${W}" which was ambiguously defined as both a column and parameter`);let X=2;if(X8.call(D,"safeIntegers")){let W=D.safeIntegers;if(typeof W!=="boolean")throw new TypeError(`Virtual table module "${Q}" ${F} a table definition with an invalid "safeIntegers" property (should be a boolean)`);X=+W}let C=!1;if(X8.call(D,"directOnly")){if(C=D.directOnly,typeof C!=="boolean")throw new TypeError(`Virtual table module "${Q}" ${F} a table definition with an invalid "directOnly" property (should be a boolean)`)}return[`CREATE TABLE x(${[...J.map(G5).map((W)=>`${W} HIDDEN`),...Y.map(G5)].join(", ")});`,fW(B,new Map(Y.map((W,G)=>[W,J.length+G])),Q),J,X,C]}function fW(D,F,Q){return function*B(...Y){let J=Y.map((X)=>Buffer.isBuffer(X)?Buffer.from(X):X);for(let X=0;X`"${D.replace(/"/g,'""')}"`,dW=(D)=>()=>D});var E5=VD((kZ,U5)=>{var cW=function D(){};U5.exports=function D(F,Q){return Object.assign(new cW,this)}});var L5=VD((bZ,V5)=>{var pW=gD("fs"),A5=gD("path"),L6=GF(),nW=q7(),Z5;function W0(D,F){if(new.target==null)return new W0(D,F);let Q;if(Buffer.isBuffer(D))Q=D,D=":memory:";if(D==null)D="";if(F==null)F={};if(typeof D!=="string")throw new TypeError("Expected first argument to be a string");if(typeof F!=="object")throw new TypeError("Expected second argument to be an options object");if("readOnly"in F)throw new TypeError('Misspelled option "readOnly" should be "readonly"');if("memory"in F)throw new TypeError('Option "memory" was removed in v7.0.0 (use ":memory:" filename instead)');let B=D.trim(),Y=B===""||B===":memory:",J=L6.getBooleanOption(F,"readonly"),X=L6.getBooleanOption(F,"fileMustExist"),C="timeout"in F?F.timeout:5000,z="verbose"in F?F.verbose:null,W="nativeBinding"in F?F.nativeBinding:null;if(J&&Y&&!Q)throw new TypeError("In-memory/temporary databases cannot be readonly");if(!Number.isInteger(C)||C<0)throw new TypeError('Expected the "timeout" option to be a positive integer');if(C>2147483647)throw new RangeError('Option "timeout" cannot be greater than 2147483647');if(z!=null&&typeof z!=="function")throw new TypeError('Expected the "verbose" option to be a function');if(W!=null&&typeof W!=="string"&&typeof W!=="object")throw new TypeError('Expected the "nativeBinding" option to be a string or addon object');let G;if(W==null)G=Z5||(Z5=i4()("better_sqlite3.node"));else if(typeof W==="string")G=(typeof __non_webpack_require__==="function"?__non_webpack_require__:gD)(A5.resolve(W).replace(/(\.node)?$/,".node"));else G=W;if(!G.isInitialized)G.setErrorConstructor(nW),G.isInitialized=!0;if(!Y&&!pW.existsSync(A5.dirname(B)))throw new TypeError("Cannot open database because the directory does not exist");Object.defineProperties(this,{[L6.cppdb]:{value:new G.Database(B,D,Y,J,X,C,z||null,Q||null)},...pF.getters})}var pF=a4();W0.prototype.prepare=pF.prepare;W0.prototype.transaction=s4();W0.prototype.pragma=e4();W0.prototype.backup=B5();W0.prototype.serialize=X5();W0.prototype.function=J5();W0.prototype.aggregate=z5();W0.prototype.table=K5();W0.prototype.loadExtension=pF.loadExtension;W0.prototype.exec=pF.exec;W0.prototype.close=pF.close;W0.prototype.defaultSafeIntegers=pF.defaultSafeIntegers;W0.prototype.unsafeMode=pF.unsafeMode;W0.prototype[L6.inspect]=E5();V5.exports=W0});var M5=VD((xZ,U7)=>{U7.exports=L5();U7.exports.SqliteError=q7()});var N5={};MF(N5,{initializeDatabase:()=>A7,getDatabase:()=>A0,DatabaseManager:()=>S0,Database:()=>E7.default});import iW from"path";import aW from"fs";class S0{static instance;db=null;migrations=[];static getInstance(){if(!S0.instance)S0.instance=new S0;return S0.instance}registerMigration(D){this.migrations.push(D),this.migrations.sort((F,Q)=>F.version-Q.version)}async initialize(){if(this.db)return this.db;let D=CD.getInstance().getDataDirectory();aW.mkdirSync(D,{recursive:!0});let F=iW.join(D,"claude-mem.db");return this.db=new E7.default(F),this.db.pragma("journal_mode = WAL"),this.db.pragma("synchronous = NORMAL"),this.db.pragma("foreign_keys = ON"),this.db.pragma("temp_store = memory"),this.db.pragma("mmap_size = 268435456"),this.db.pragma("cache_size = 10000"),this.initializeSchemaVersions(),await this.runMigrations(),M6=this.db,this.db}getConnection(){if(!this.db)throw new Error("Database not initialized. Call initialize() first.");return this.db}withTransaction(D){let F=this.getConnection();return F.transaction(D)(F)}close(){if(this.db)this.db.close(),this.db=null,M6=null}initializeSchemaVersions(){if(!this.db)return;this.db.exec(` CREATE TABLE IF NOT EXISTS schema_versions ( @@ -326,7 +326,7 @@ Expecting one of '${Q.join("', '")}'`);let B=`${D}Help`;return this.on(B,(Y)=>{l CREATE INDEX IF NOT EXISTS idx_streaming_sessions_started ON streaming_sessions(started_at_epoch DESC); `),console.log("โœ… Created streaming_sessions table for real-time session tracking")},down:(D)=>{D.exec(` DROP TABLE IF EXISTS streaming_sessions; - `)}},W8=[x5,u5,y5]});var i9=a0(n9(),1),{program:BE,createCommand:QE,createArgument:XE,createOption:YE,CommanderError:JE,InvalidArgumentError:CE,InvalidOptionArgumentError:WE,Command:a9,Argument:zE,Option:GE,Help:qE}=i9.default;import{readFileSync as ZY,existsSync as VY}from"fs";import{join as LY,dirname as MY}from"path";import{fileURLToPath as NY}from"url";var r9="claude-mem",o9="3.9.12",s9="Memory compression system for Claude Code - persist context across sessions",t9=r9,e9=o9,D3=s9;try{let D=NY(import.meta.url),F=MY(D),Q=LY(F,"..","..","package.json");if(VY(Q)){let B=JSON.parse(ZY(Q,"utf-8"));t9=B.name||r9,e9=B.version||o9,D3=B.description||s9}}catch{}var W2=t9,F3=e9,B3=D3;import{readFileSync as G6,writeFileSync as SF,existsSync as g0,mkdirSync as Q8,copyFileSync as W7,statSync as dC,readdirSync as cC}from"fs";import{join as tD,dirname as z7}from"path";import{homedir as u4}from"os";import{execSync as C7}from"child_process";var J0=a0(E1(),1),A3=a0(Z1(),1);import{stdin as U3,stdout as E3}from"node:process";import*as wF from"node:readline";import J3 from"node:readline";import{Writable as wY}from"node:stream";function TY({onlyFirst:D=!1}={}){let F=["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?(?:\\u0007|\\u001B\\u005C|\\u009C))","(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-nq-uy=><~]))"].join("|");return new RegExp(F,D?void 0:"g")}var PY=TY();function Z3(D){if(typeof D!="string")throw new TypeError(`Expected a \`string\`, got \`${typeof D}\``);return D.replace(PY,"")}function V3(D){return D&&D.__esModule&&Object.prototype.hasOwnProperty.call(D,"default")?D.default:D}var L3={exports:{}};(function(D){var F={};D.exports=F,F.eastAsianWidth=function(B){var Y=B.charCodeAt(0),J=B.length==2?B.charCodeAt(1):0,X=Y;return 55296<=Y&&Y<=56319&&56320<=J&&J<=57343&&(Y&=1023,J&=1023,X=Y<<10|J,X+=65536),X==12288||65281<=X&&X<=65376||65504<=X&&X<=65510?"F":X==8361||65377<=X&&X<=65470||65474<=X&&X<=65479||65482<=X&&X<=65487||65490<=X&&X<=65495||65498<=X&&X<=65500||65512<=X&&X<=65518?"H":4352<=X&&X<=4447||4515<=X&&X<=4519||4602<=X&&X<=4607||9001<=X&&X<=9002||11904<=X&&X<=11929||11931<=X&&X<=12019||12032<=X&&X<=12245||12272<=X&&X<=12283||12289<=X&&X<=12350||12353<=X&&X<=12438||12441<=X&&X<=12543||12549<=X&&X<=12589||12593<=X&&X<=12686||12688<=X&&X<=12730||12736<=X&&X<=12771||12784<=X&&X<=12830||12832<=X&&X<=12871||12880<=X&&X<=13054||13056<=X&&X<=19903||19968<=X&&X<=42124||42128<=X&&X<=42182||43360<=X&&X<=43388||44032<=X&&X<=55203||55216<=X&&X<=55238||55243<=X&&X<=55291||63744<=X&&X<=64255||65040<=X&&X<=65049||65072<=X&&X<=65106||65108<=X&&X<=65126||65128<=X&&X<=65131||110592<=X&&X<=110593||127488<=X&&X<=127490||127504<=X&&X<=127546||127552<=X&&X<=127560||127568<=X&&X<=127569||131072<=X&&X<=194367||177984<=X&&X<=196605||196608<=X&&X<=262141?"W":32<=X&&X<=126||162<=X&&X<=163||165<=X&&X<=166||X==172||X==175||10214<=X&&X<=10221||10629<=X&&X<=10630?"Na":X==161||X==164||167<=X&&X<=168||X==170||173<=X&&X<=174||176<=X&&X<=180||182<=X&&X<=186||188<=X&&X<=191||X==198||X==208||215<=X&&X<=216||222<=X&&X<=225||X==230||232<=X&&X<=234||236<=X&&X<=237||X==240||242<=X&&X<=243||247<=X&&X<=250||X==252||X==254||X==257||X==273||X==275||X==283||294<=X&&X<=295||X==299||305<=X&&X<=307||X==312||319<=X&&X<=322||X==324||328<=X&&X<=331||X==333||338<=X&&X<=339||358<=X&&X<=359||X==363||X==462||X==464||X==466||X==468||X==470||X==472||X==474||X==476||X==593||X==609||X==708||X==711||713<=X&&X<=715||X==717||X==720||728<=X&&X<=731||X==733||X==735||768<=X&&X<=879||913<=X&&X<=929||931<=X&&X<=937||945<=X&&X<=961||963<=X&&X<=969||X==1025||1040<=X&&X<=1103||X==1105||X==8208||8211<=X&&X<=8214||8216<=X&&X<=8217||8220<=X&&X<=8221||8224<=X&&X<=8226||8228<=X&&X<=8231||X==8240||8242<=X&&X<=8243||X==8245||X==8251||X==8254||X==8308||X==8319||8321<=X&&X<=8324||X==8364||X==8451||X==8453||X==8457||X==8467||X==8470||8481<=X&&X<=8482||X==8486||X==8491||8531<=X&&X<=8532||8539<=X&&X<=8542||8544<=X&&X<=8555||8560<=X&&X<=8569||X==8585||8592<=X&&X<=8601||8632<=X&&X<=8633||X==8658||X==8660||X==8679||X==8704||8706<=X&&X<=8707||8711<=X&&X<=8712||X==8715||X==8719||X==8721||X==8725||X==8730||8733<=X&&X<=8736||X==8739||X==8741||8743<=X&&X<=8748||X==8750||8756<=X&&X<=8759||8764<=X&&X<=8765||X==8776||X==8780||X==8786||8800<=X&&X<=8801||8804<=X&&X<=8807||8810<=X&&X<=8811||8814<=X&&X<=8815||8834<=X&&X<=8835||8838<=X&&X<=8839||X==8853||X==8857||X==8869||X==8895||X==8978||9312<=X&&X<=9449||9451<=X&&X<=9547||9552<=X&&X<=9587||9600<=X&&X<=9615||9618<=X&&X<=9621||9632<=X&&X<=9633||9635<=X&&X<=9641||9650<=X&&X<=9651||9654<=X&&X<=9655||9660<=X&&X<=9661||9664<=X&&X<=9665||9670<=X&&X<=9672||X==9675||9678<=X&&X<=9681||9698<=X&&X<=9701||X==9711||9733<=X&&X<=9734||X==9737||9742<=X&&X<=9743||9748<=X&&X<=9749||X==9756||X==9758||X==9792||X==9794||9824<=X&&X<=9825||9827<=X&&X<=9829||9831<=X&&X<=9834||9836<=X&&X<=9837||X==9839||9886<=X&&X<=9887||9918<=X&&X<=9919||9924<=X&&X<=9933||9935<=X&&X<=9953||X==9955||9960<=X&&X<=9983||X==10045||X==10071||10102<=X&&X<=10111||11093<=X&&X<=11097||12872<=X&&X<=12879||57344<=X&&X<=63743||65024<=X&&X<=65039||X==65533||127232<=X&&X<=127242||127248<=X&&X<=127277||127280<=X&&X<=127337||127344<=X&&X<=127386||917760<=X&&X<=917999||983040<=X&&X<=1048573||1048576<=X&&X<=1114109?"A":"N"},F.characterLength=function(B){var Y=this.eastAsianWidth(B);return Y=="F"||Y=="W"||Y=="A"?2:1};function Q(B){return B.match(/[\uD800-\uDBFF][\uDC00-\uDFFF]|[^\uD800-\uDFFF]/g)||[]}F.length=function(B){for(var Y=Q(B),J=0,X=0;X=Y-(q==2?1:0))if(C+q<=J)X+=G;else break;C+=q}return X}})(L3);var SY=L3.exports,kY=V3(SY),bY=function(){return/\uD83C\uDFF4\uDB40\uDC67\uDB40\uDC62(?:\uDB40\uDC77\uDB40\uDC6C\uDB40\uDC73|\uDB40\uDC73\uDB40\uDC63\uDB40\uDC74|\uDB40\uDC65\uDB40\uDC6E\uDB40\uDC67)\uDB40\uDC7F|(?:\uD83E\uDDD1\uD83C\uDFFF\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFF\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB-\uDFFE])|(?:\uD83E\uDDD1\uD83C\uDFFE\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFE\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB-\uDFFD\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFD\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFD\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFC\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFC\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB\uDFFD-\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFB\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFB\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFC-\uDFFF])|\uD83D\uDC68(?:\uD83C\uDFFB(?:\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF]))|\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFC-\uDFFF])|[\u2695\u2696\u2708]\uFE0F|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))?|(?:\uD83C[\uDFFC-\uDFFF])\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF]))|\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83D\uDC68|(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFE])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])\uFE0F|\u200D(?:(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D[\uDC66\uDC67])|\uD83D[\uDC66\uDC67])|\uD83C\uDFFF|\uD83C\uDFFE|\uD83C\uDFFD|\uD83C\uDFFC)?|(?:\uD83D\uDC69(?:\uD83C\uDFFB\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69])|(?:\uD83C[\uDFFC-\uDFFF])\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69]))|\uD83E\uDDD1(?:\uD83C[\uDFFB-\uDFFF])\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1)(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|\uD83D\uDC69(?:\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCB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84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFB\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))|\uD83D\uDC69\u200D\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D[\uDC66\uDC67])|\uD83D\uDC69\u200D\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|(?:\uD83D\uDC41\uFE0F\u200D\uD83D\uDDE8|\uD83E\uDDD1(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|\uD83D\uDC69(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|\uD83D\uDE36\u200D\uD83C\uDF2B|\uD83C\uDFF3\uFE0F\u200D\u26A7|\uD83D\uDC3B\u200D\u2744|(?:(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD])(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC6F|\uD83E[\uDD3C\uDDDE\uDDDF])\u200D[\u2640\u2642]|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])\u200D[\u2640\u2642]|\uD83C\uDFF4\u200D\u2620|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD])\u200D[\u2640\u2642]|[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u2328\u23CF\u23ED-\u23EF\u23F1\u23F2\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB\u25FC\u2600-\u2604\u260E\u2611\u2618\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u2692\u2694-\u2697\u2699\u269B\u269C\u26A0\u26A7\u26B0\u26B1\u26C8\u26CF\u26D1\u26D3\u26E9\u26F0\u26F1\u26F4\u26F7\u26F8\u2702\u2708\u2709\u270F\u2712\u2714\u2716\u271D\u2721\u2733\u2734\u2744\u2747\u2763\u27A1\u2934\u2935\u2B05-\u2B07\u3030\u303D\u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uD83D[\uDD74\uDD90])(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])|[\u270A\u270B]|\uD83C[\uDF85\uDFC2\uDFC7]|\uD83D[\uDC08\uDC15\uDC3B\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE2E\uDE35\uDE36\uDE4C\uDE4F\uDEC0\uDECC]|\uD83E[\uDD0C\uDD0F\uDD18-\uDD1C\uDD1E\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5]|\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD]|\uD83D\uDC6F|\uD83E[\uDD3C\uDDDE\uDDDF]|[\u231A\u231B\u23E9-\u23EC\u23F0\u23F3\u25FD\u25FE\u2614\u2615\u2648-\u2653\u267F\u2693\u26A1\u26AA\u26AB\u26BD\u26BE\u26C4\u26C5\u26CE\u26D4\u26EA\u26F2\u26F3\u26F5\u26FA\u26FD\u2705\u2728\u274C\u274E\u2753-\u2755\u2757\u2795-\u2797\u27B0\u27BF\u2B1B\u2B1C\u2B50\u2B55]|\uD83C[\uDC04\uDCCF\uDD8E\uDD91-\uDD9A\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF7C\uDF7E-\uDF84\uDF86-\uDF93\uDFA0-\uDFC1\uDFC5\uDFC6\uDFC8\uDFC9\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF8-\uDFFF]|\uD83D[\uDC00-\uDC07\uDC09-\uDC14\uDC16-\uDC3A\uDC3C-\uDC3E\uDC40\uDC44\uDC45\uDC51-\uDC65\uDC6A\uDC79-\uDC7B\uDC7D-\uDC80\uDC84\uDC88-\uDC8E\uDC90\uDC92-\uDCA9\uDCAB-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDDA4\uDDFB-\uDE2D\uDE2F-\uDE34\uDE37-\uDE44\uDE48-\uDE4A\uDE80-\uDEA2\uDEA4-\uDEB3\uDEB7-\uDEBF\uDEC1-\uDEC5\uDED0-\uDED2\uDED5-\uDED7\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD0D\uDD0E\uDD10-\uDD17\uDD1D\uDD20-\uDD25\uDD27-\uDD2F\uDD3A\uDD3F-\uDD45\uDD47-\uDD76\uDD78\uDD7A-\uDDB4\uDDB7\uDDBA\uDDBC-\uDDCB\uDDD0\uDDE0-\uDDFF\uDE70-\uDE74\uDE78-\uDE7A\uDE80-\uDE86\uDE90-\uDEA8\uDEB0-\uDEB6\uDEC0-\uDEC2\uDED0-\uDED6]|(?:[\u231A\u231B\u23E9-\u23EC\u23F0\u23F3\u25FD\u25FE\u2614\u2615\u2648-\u2653\u267F\u2693\u26A1\u26AA\u26AB\u26BD\u26BE\u26C4\u26C5\u26CE\u26D4\u26EA\u26F2\u26F3\u26F5\u26FA\u26FD\u2705\u270A\u270B\u2728\u274C\u274E\u2753-\u2755\u2757\u2795-\u2797\u27B0\u27BF\u2B1B\u2B1C\u2B50\u2B55]|\uD83C[\uDC04\uDCCF\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF7C\uDF7E-\uDF93\uDFA0-\uDFCA\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF4\uDFF8-\uDFFF]|\uD83D[\uDC00-\uDC3E\uDC40\uDC42-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDD7A\uDD95\uDD96\uDDA4\uDDFB-\uDE4F\uDE80-\uDEC5\uDECC\uDED0-\uDED2\uDED5-\uDED7\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD0C-\uDD3A\uDD3C-\uDD45\uDD47-\uDD78\uDD7A-\uDDCB\uDDCD-\uDDFF\uDE70-\uDE74\uDE78-\uDE7A\uDE80-\uDE86\uDE90-\uDEA8\uDEB0-\uDEB6\uDEC0-\uDEC2\uDED0-\uDED6])|(?:[#\*0-9\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23E9-\u23F3\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB-\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u261D\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692-\u2697\u2699\u269B\u269C\u26A0\u26A1\u26A7\u26AA\u26AB\u26B0\u26B1\u26BD\u26BE\u26C4\u26C5\u26C8\u26CE\u26CF\u26D1\u26D3\u26D4\u26E9\u26EA\u26F0-\u26F5\u26F7-\u26FA\u26FD\u2702\u2705\u2708-\u270D\u270F\u2712\u2714\u2716\u271D\u2721\u2728\u2733\u2734\u2744\u2747\u274C\u274E\u2753-\u2755\u2757\u2763\u2764\u2795-\u2797\u27A1\u27B0\u27BF\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B50\u2B55\u3030\u303D\u3297\u3299]|\uD83C[\uDC04\uDCCF\uDD70\uDD71\uDD7E\uDD7F\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE02\uDE1A\uDE2F\uDE32-\uDE3A\uDE50\uDE51\uDF00-\uDF21\uDF24-\uDF93\uDF96\uDF97\uDF99-\uDF9B\uDF9E-\uDFF0\uDFF3-\uDFF5\uDFF7-\uDFFF]|\uD83D[\uDC00-\uDCFD\uDCFF-\uDD3D\uDD49-\uDD4E\uDD50-\uDD67\uDD6F\uDD70\uDD73-\uDD7A\uDD87\uDD8A-\uDD8D\uDD90\uDD95\uDD96\uDDA4\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA-\uDE4F\uDE80-\uDEC5\uDECB-\uDED2\uDED5-\uDED7\uDEE0-\uDEE5\uDEE9\uDEEB\uDEEC\uDEF0\uDEF3-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD0C-\uDD3A\uDD3C-\uDD45\uDD47-\uDD78\uDD7A-\uDDCB\uDDCD-\uDDFF\uDE70-\uDE74\uDE78-\uDE7A\uDE80-\uDE86\uDE90-\uDEA8\uDEB0-\uDEB6\uDEC0-\uDEC2\uDED0-\uDED6])\uFE0F|(?:[\u261D\u26F9\u270A-\u270D]|\uD83C[\uDF85\uDFC2-\uDFC4\uDFC7\uDFCA-\uDFCC]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66-\uDC78\uDC7C\uDC81-\uDC83\uDC85-\uDC87\uDC8F\uDC91\uDCAA\uDD74\uDD75\uDD7A\uDD90\uDD95\uDD96\uDE45-\uDE47\uDE4B-\uDE4F\uDEA3\uDEB4-\uDEB6\uDEC0\uDECC]|\uD83E[\uDD0C\uDD0F\uDD18-\uDD1F\uDD26\uDD30-\uDD39\uDD3C-\uDD3E\uDD77\uDDB5\uDDB6\uDDB8\uDDB9\uDDBB\uDDCD-\uDDCF\uDDD1-\uDDDD])/g},vY=V3(bY);function i2(D,F={}){if(typeof D!="string"||D.length===0||(F={ambiguousIsNarrow:!0,...F},D=Z3(D),D.length===0))return 0;D=D.replace(vY()," ");let Q=F.ambiguousIsNarrow?1:2,B=0;for(let Y of D){let J=Y.codePointAt(0);if(J<=31||J>=127&&J<=159||J>=768&&J<=879)continue;switch(kY.eastAsianWidth(Y)){case"F":case"W":B+=2;break;case"A":B+=Q;break;default:B+=1}}return B}var V1=10,C3=(D=0)=>(F)=>`\x1B[${F+D}m`,W3=(D=0)=>(F)=>`\x1B[${38+D};5;${F}m`,z3=(D=0)=>(F,Q,B)=>`\x1B[${38+D};2;${F};${Q};${B}m`,bD={modifier:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],overline:[53,55],inverse:[7,27],hidden:[8,28],strikethrough:[9,29]},color:{black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],blackBright:[90,39],gray:[90,39],grey:[90,39],redBright:[91,39],greenBright:[92,39],yellowBright:[93,39],blueBright:[94,39],magentaBright:[95,39],cyanBright:[96,39],whiteBright:[97,39]},bgColor:{bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgBlackBright:[100,49],bgGray:[100,49],bgGrey:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]}};Object.keys(bD.modifier);var xY=Object.keys(bD.color),uY=Object.keys(bD.bgColor);[...xY];function yY(){let D=new Map;for(let[F,Q]of Object.entries(bD)){for(let[B,Y]of Object.entries(Q))bD[B]={open:`\x1B[${Y[0]}m`,close:`\x1B[${Y[1]}m`},Q[B]=bD[B],D.set(Y[0],Y[1]);Object.defineProperty(bD,F,{value:Q,enumerable:!1})}return Object.defineProperty(bD,"codes",{value:D,enumerable:!1}),bD.color.close="\x1B[39m",bD.bgColor.close="\x1B[49m",bD.color.ansi=C3(),bD.color.ansi256=W3(),bD.color.ansi16m=z3(),bD.bgColor.ansi=C3(V1),bD.bgColor.ansi256=W3(V1),bD.bgColor.ansi16m=z3(V1),Object.defineProperties(bD,{rgbToAnsi256:{value:(F,Q,B)=>F===Q&&Q===B?F<8?16:F>248?231:Math.round((F-8)/247*24)+232:16+36*Math.round(F/255*5)+6*Math.round(Q/255*5)+Math.round(B/255*5),enumerable:!1},hexToRgb:{value:(F)=>{let Q=/[a-f\d]{6}|[a-f\d]{3}/i.exec(F.toString(16));if(!Q)return[0,0,0];let[B]=Q;B.length===3&&(B=[...B].map((J)=>J+J).join(""));let Y=Number.parseInt(B,16);return[Y>>16&255,Y>>8&255,Y&255]},enumerable:!1},hexToAnsi256:{value:(F)=>bD.rgbToAnsi256(...bD.hexToRgb(F)),enumerable:!1},ansi256ToAnsi:{value:(F)=>{if(F<8)return 30+F;if(F<16)return 90+(F-8);let Q,B,Y;if(F>=232)Q=((F-232)*10+8)/255,B=Q,Y=Q;else{F-=16;let C=F%36;Q=Math.floor(F/36)/5,B=Math.floor(C/6)/5,Y=C%6/5}let J=Math.max(Q,B,Y)*2;if(J===0)return 30;let X=30+(Math.round(Y)<<2|Math.round(B)<<1|Math.round(Q));return J===2&&(X+=60),X},enumerable:!1},rgbToAnsi:{value:(F,Q,B)=>bD.ansi256ToAnsi(bD.rgbToAnsi256(F,Q,B)),enumerable:!1},hexToAnsi:{value:(F)=>bD.ansi256ToAnsi(bD.hexToAnsi256(F)),enumerable:!1}}),bD}var fY=yY(),a8=new Set(["\x1B","ย›"]),gY=39,N1="\x07",M3="[",$Y="]",N3="m",j1=`${$Y}8;;`,G3=(D)=>`${a8.values().next().value}${M3}${D}${N3}`,q3=(D)=>`${a8.values().next().value}${j1}${D}${N1}`,hY=(D)=>D.split(" ").map((F)=>i2(F)),L1=(D,F,Q)=>{let B=[...F],Y=!1,J=!1,X=i2(Z3(D[D.length-1]));for(let[C,z]of B.entries()){let W=i2(z);if(X+W<=Q?D[D.length-1]+=z:(D.push(z),X=0),a8.has(z)&&(Y=!0,J=B.slice(C+1).join("").startsWith(j1)),Y){J?z===N1&&(Y=!1,J=!1):z===N3&&(Y=!1);continue}X+=W,X===Q&&C0&&D.length>1&&(D[D.length-2]+=D.pop())},mY=(D)=>{let F=D.split(" "),Q=F.length;for(;Q>0&&!(i2(F[Q-1])>0);)Q--;return Q===F.length?D:F.slice(0,Q).join(" ")+F.slice(Q).join("")},lY=(D,F,Q={})=>{if(Q.trim!==!1&&D.trim()==="")return"";let B="",Y,J,X=hY(D),C=[""];for(let[W,G]of D.split(" ").entries()){Q.trim!==!1&&(C[C.length-1]=C[C.length-1].trimStart());let q=i2(C[C.length-1]);if(W!==0&&(q>=F&&(Q.wordWrap===!1||Q.trim===!1)&&(C.push(""),q=0),(q>0||Q.trim===!1)&&(C[C.length-1]+=" ",q++)),Q.hard&&X[W]>F){let A=F-q,U=1+Math.floor((X[W]-A-1)/F);Math.floor((X[W]-1)/F)F&&q>0&&X[W]>0){if(Q.wordWrap===!1&&qF&&Q.wordWrap===!1){L1(C,G,F);continue}C[C.length-1]+=G}Q.trim!==!1&&(C=C.map((W)=>mY(W)));let z=[...C.join(` + `)}},W8=[x5,u5,y5]});var i9=a0(n9(),1),{program:BE,createCommand:QE,createArgument:XE,createOption:YE,CommanderError:JE,InvalidArgumentError:CE,InvalidOptionArgumentError:WE,Command:a9,Argument:zE,Option:GE,Help:qE}=i9.default;import{readFileSync as ZY,existsSync as VY}from"fs";import{join as LY,dirname as MY}from"path";import{fileURLToPath as NY}from"url";var r9="claude-mem",o9="3.9.13",s9="Memory compression system for Claude Code - persist context across sessions",t9=r9,e9=o9,D3=s9;try{let D=NY(import.meta.url),F=MY(D),Q=LY(F,"..","..","package.json");if(VY(Q)){let B=JSON.parse(ZY(Q,"utf-8"));t9=B.name||r9,e9=B.version||o9,D3=B.description||s9}}catch{}var W2=t9,F3=e9,B3=D3;import{readFileSync as G6,writeFileSync as SF,existsSync as g0,mkdirSync as Q8,copyFileSync as W7,statSync as dC,readdirSync as cC}from"fs";import{join as tD,dirname as z7}from"path";import{homedir as u4}from"os";import{execSync as C7}from"child_process";var J0=a0(E1(),1),A3=a0(Z1(),1);import{stdin as U3,stdout as E3}from"node:process";import*as wF from"node:readline";import J3 from"node:readline";import{Writable as wY}from"node:stream";function TY({onlyFirst:D=!1}={}){let F=["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?(?:\\u0007|\\u001B\\u005C|\\u009C))","(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-nq-uy=><~]))"].join("|");return new RegExp(F,D?void 0:"g")}var PY=TY();function Z3(D){if(typeof D!="string")throw new TypeError(`Expected a \`string\`, got \`${typeof D}\``);return D.replace(PY,"")}function V3(D){return D&&D.__esModule&&Object.prototype.hasOwnProperty.call(D,"default")?D.default:D}var L3={exports:{}};(function(D){var F={};D.exports=F,F.eastAsianWidth=function(B){var Y=B.charCodeAt(0),J=B.length==2?B.charCodeAt(1):0,X=Y;return 55296<=Y&&Y<=56319&&56320<=J&&J<=57343&&(Y&=1023,J&=1023,X=Y<<10|J,X+=65536),X==12288||65281<=X&&X<=65376||65504<=X&&X<=65510?"F":X==8361||65377<=X&&X<=65470||65474<=X&&X<=65479||65482<=X&&X<=65487||65490<=X&&X<=65495||65498<=X&&X<=65500||65512<=X&&X<=65518?"H":4352<=X&&X<=4447||4515<=X&&X<=4519||4602<=X&&X<=4607||9001<=X&&X<=9002||11904<=X&&X<=11929||11931<=X&&X<=12019||12032<=X&&X<=12245||12272<=X&&X<=12283||12289<=X&&X<=12350||12353<=X&&X<=12438||12441<=X&&X<=12543||12549<=X&&X<=12589||12593<=X&&X<=12686||12688<=X&&X<=12730||12736<=X&&X<=12771||12784<=X&&X<=12830||12832<=X&&X<=12871||12880<=X&&X<=13054||13056<=X&&X<=19903||19968<=X&&X<=42124||42128<=X&&X<=42182||43360<=X&&X<=43388||44032<=X&&X<=55203||55216<=X&&X<=55238||55243<=X&&X<=55291||63744<=X&&X<=64255||65040<=X&&X<=65049||65072<=X&&X<=65106||65108<=X&&X<=65126||65128<=X&&X<=65131||110592<=X&&X<=110593||127488<=X&&X<=127490||127504<=X&&X<=127546||127552<=X&&X<=127560||127568<=X&&X<=127569||131072<=X&&X<=194367||177984<=X&&X<=196605||196608<=X&&X<=262141?"W":32<=X&&X<=126||162<=X&&X<=163||165<=X&&X<=166||X==172||X==175||10214<=X&&X<=10221||10629<=X&&X<=10630?"Na":X==161||X==164||167<=X&&X<=168||X==170||173<=X&&X<=174||176<=X&&X<=180||182<=X&&X<=186||188<=X&&X<=191||X==198||X==208||215<=X&&X<=216||222<=X&&X<=225||X==230||232<=X&&X<=234||236<=X&&X<=237||X==240||242<=X&&X<=243||247<=X&&X<=250||X==252||X==254||X==257||X==273||X==275||X==283||294<=X&&X<=295||X==299||305<=X&&X<=307||X==312||319<=X&&X<=322||X==324||328<=X&&X<=331||X==333||338<=X&&X<=339||358<=X&&X<=359||X==363||X==462||X==464||X==466||X==468||X==470||X==472||X==474||X==476||X==593||X==609||X==708||X==711||713<=X&&X<=715||X==717||X==720||728<=X&&X<=731||X==733||X==735||768<=X&&X<=879||913<=X&&X<=929||931<=X&&X<=937||945<=X&&X<=961||963<=X&&X<=969||X==1025||1040<=X&&X<=1103||X==1105||X==8208||8211<=X&&X<=8214||8216<=X&&X<=8217||8220<=X&&X<=8221||8224<=X&&X<=8226||8228<=X&&X<=8231||X==8240||8242<=X&&X<=8243||X==8245||X==8251||X==8254||X==8308||X==8319||8321<=X&&X<=8324||X==8364||X==8451||X==8453||X==8457||X==8467||X==8470||8481<=X&&X<=8482||X==8486||X==8491||8531<=X&&X<=8532||8539<=X&&X<=8542||8544<=X&&X<=8555||8560<=X&&X<=8569||X==8585||8592<=X&&X<=8601||8632<=X&&X<=8633||X==8658||X==8660||X==8679||X==8704||8706<=X&&X<=8707||8711<=X&&X<=8712||X==8715||X==8719||X==8721||X==8725||X==8730||8733<=X&&X<=8736||X==8739||X==8741||8743<=X&&X<=8748||X==8750||8756<=X&&X<=8759||8764<=X&&X<=8765||X==8776||X==8780||X==8786||8800<=X&&X<=8801||8804<=X&&X<=8807||8810<=X&&X<=8811||8814<=X&&X<=8815||8834<=X&&X<=8835||8838<=X&&X<=8839||X==8853||X==8857||X==8869||X==8895||X==8978||9312<=X&&X<=9449||9451<=X&&X<=9547||9552<=X&&X<=9587||9600<=X&&X<=9615||9618<=X&&X<=9621||9632<=X&&X<=9633||9635<=X&&X<=9641||9650<=X&&X<=9651||9654<=X&&X<=9655||9660<=X&&X<=9661||9664<=X&&X<=9665||9670<=X&&X<=9672||X==9675||9678<=X&&X<=9681||9698<=X&&X<=9701||X==9711||9733<=X&&X<=9734||X==9737||9742<=X&&X<=9743||9748<=X&&X<=9749||X==9756||X==9758||X==9792||X==9794||9824<=X&&X<=9825||9827<=X&&X<=9829||9831<=X&&X<=9834||9836<=X&&X<=9837||X==9839||9886<=X&&X<=9887||9918<=X&&X<=9919||9924<=X&&X<=9933||9935<=X&&X<=9953||X==9955||9960<=X&&X<=9983||X==10045||X==10071||10102<=X&&X<=10111||11093<=X&&X<=11097||12872<=X&&X<=12879||57344<=X&&X<=63743||65024<=X&&X<=65039||X==65533||127232<=X&&X<=127242||127248<=X&&X<=127277||127280<=X&&X<=127337||127344<=X&&X<=127386||917760<=X&&X<=917999||983040<=X&&X<=1048573||1048576<=X&&X<=1114109?"A":"N"},F.characterLength=function(B){var Y=this.eastAsianWidth(B);return Y=="F"||Y=="W"||Y=="A"?2:1};function Q(B){return B.match(/[\uD800-\uDBFF][\uDC00-\uDFFF]|[^\uD800-\uDFFF]/g)||[]}F.length=function(B){for(var Y=Q(B),J=0,X=0;X=Y-(q==2?1:0))if(C+q<=J)X+=G;else break;C+=q}return X}})(L3);var SY=L3.exports,kY=V3(SY),bY=function(){return/\uD83C\uDFF4\uDB40\uDC67\uDB40\uDC62(?:\uDB40\uDC77\uDB40\uDC6C\uDB40\uDC73|\uDB40\uDC73\uDB40\uDC63\uDB40\uDC74|\uDB40\uDC65\uDB40\uDC6E\uDB40\uDC67)\uDB40\uDC7F|(?:\uD83E\uDDD1\uD83C\uDFFF\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFF\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB-\uDFFE])|(?:\uD83E\uDDD1\uD83C\uDFFE\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFE\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB-\uDFFD\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFD\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFD\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFC\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFC\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB\uDFFD-\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFB\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFB\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFC-\uDFFF])|\uD83D\uDC68(?:\uD83C\uDFFB(?:\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF]))|\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFC-\uDFFF])|[\u2695\u2696\u2708]\uFE0F|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))?|(?:\uD83C[\uDFFC-\uDFFF])\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF]))|\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83D\uDC68|(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFE])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])\uFE0F|\u200D(?:(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D[\uDC66\uDC67])|\uD83D[\uDC66\uDC67])|\uD83C\uDFFF|\uD83C\uDFFE|\uD83C\uDFFD|\uD83C\uDFFC)?|(?:\uD83D\uDC69(?:\uD83C\uDFFB\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69])|(?:\uD83C[\uDFFC-\uDFFF])\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69]))|\uD83E\uDDD1(?:\uD83C[\uDFFB-\uDFFF])\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1)(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|\uD83D\uDC69(?:\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFB\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))|\uD83E\uDDD1(?:\u200D(?:\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFB\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))|\uD83D\uDC69\u200D\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D[\uDC66\uDC67])|\uD83D\uDC69\u200D\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|(?:\uD83D\uDC41\uFE0F\u200D\uD83D\uDDE8|\uD83E\uDDD1(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|\uD83D\uDC69(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|\uD83D\uDE36\u200D\uD83C\uDF2B|\uD83C\uDFF3\uFE0F\u200D\u26A7|\uD83D\uDC3B\u200D\u2744|(?:(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD])(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC6F|\uD83E[\uDD3C\uDDDE\uDDDF])\u200D[\u2640\u2642]|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])\u200D[\u2640\u2642]|\uD83C\uDFF4\u200D\u2620|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD])\u200D[\u2640\u2642]|[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u2328\u23CF\u23ED-\u23EF\u23F1\u23F2\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB\u25FC\u2600-\u2604\u260E\u2611\u2618\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u2692\u2694-\u2697\u2699\u269B\u269C\u26A0\u26A7\u26B0\u26B1\u26C8\u26CF\u26D1\u26D3\u26E9\u26F0\u26F1\u26F4\u26F7\u26F8\u2702\u2708\u2709\u270F\u2712\u2714\u2716\u271D\u2721\u2733\u2734\u2744\u2747\u2763\u27A1\u2934\u2935\u2B05-\u2B07\u3030\u303D\u3297\u3299]|\uD83C[\uDD70\uDD71\uDD7E\uDD7F\uDE02\uDE37\uDF21\uDF24-\uDF2C\uDF36\uDF7D\uDF96\uDF97\uDF99-\uDF9B\uDF9E\uDF9F\uDFCD\uDFCE\uDFD4-\uDFDF\uDFF5\uDFF7]|\uD83D[\uDC3F\uDCFD\uDD49\uDD4A\uDD6F\uDD70\uDD73\uDD76-\uDD79\uDD87\uDD8A-\uDD8D\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA\uDECB\uDECD-\uDECF\uDEE0-\uDEE5\uDEE9\uDEF0\uDEF3])\uFE0F|\uD83C\uDFF3\uFE0F\u200D\uD83C\uDF08|\uD83D\uDC69\u200D\uD83D\uDC67|\uD83D\uDC69\u200D\uD83D\uDC66|\u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E47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD])(?:\uD83C[\uDFFB-\uDFFF])|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])|\uD83C\uDFF4|(?:[\u270A\u270B]|\uD83C[\uDF85\uDFC2\uDFC7]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC]|\uD83E[\uDD0C\uDD0F\uDD18-\uDD1C\uDD1E\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5])(?:\uD83C[\uDFFB-\uDFFF])|(?:[\u261D\u270C\u270D]|\uD83D[\uDD74\uDD90])(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])|[\u270A\u270B]|\uD83C[\uDF85\uDFC2\uDFC7]|\uD83D[\uDC08\uDC15\uDC3B\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE2E\uDE35\uDE36\uDE4C\uDE4F\uDEC0\uDECC]|\uD83E[\uDD0C\uDD0F\uDD18-\uDD1C\uDD1E\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5]|\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD]|\uD83D\uDC6F|\uD83E[\uDD3C\uDDDE\uDDDF]|[\u231A\u231B\u23E9-\u23EC\u23F0\u23F3\u25FD\u25FE\u2614\u2615\u2648-\u2653\u267F\u2693\u26A1\u26AA\u26AB\u26BD\u26BE\u26C4\u26C5\u26CE\u26D4\u26EA\u26F2\u26F3\u26F5\u26FA\u26FD\u2705\u2728\u274C\u274E\u2753-\u2755\u2757\u2795-\u2797\u27B0\u27BF\u2B1B\u2B1C\u2B50\u2B55]|\uD83C[\uDC04\uDCCF\uDD8E\uDD91-\uDD9A\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF7C\uDF7E-\uDF84\uDF86-\uDF93\uDFA0-\uDFC1\uDFC5\uDFC6\uDFC8\uDFC9\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF8-\uDFFF]|\uD83D[\uDC00-\uDC07\uDC09-\uDC14\uDC16-\uDC3A\uDC3C-\uDC3E\uDC40\uDC44\uDC45\uDC51-\uDC65\uDC6A\uDC79-\uDC7B\uDC7D-\uDC80\uDC84\uDC88-\uDC8E\uDC90\uDC92-\uDCA9\uDCAB-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDDA4\uDDFB-\uDE2D\uDE2F-\uDE34\uDE37-\uDE44\uDE48-\uDE4A\uDE80-\uDEA2\uDEA4-\uDEB3\uDEB7-\uDEBF\uDEC1-\uDEC5\uDED0-\uDED2\uDED5-\uDED7\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD0D\uDD0E\uDD10-\uDD17\uDD1D\uDD20-\uDD25\uDD27-\uDD2F\uDD3A\uDD3F-\uDD45\uDD47-\uDD76\uDD78\uDD7A-\uDDB4\uDDB7\uDDBA\uDDBC-\uDDCB\uDDD0\uDDE0-\uDDFF\uDE70-\uDE74\uDE78-\uDE7A\uDE80-\uDE86\uDE90-\uDEA8\uDEB0-\uDEB6\uDEC0-\uDEC2\uDED0-\uDED6]|(?:[\u231A\u231B\u23E9-\u23EC\u23F0\u23F3\u25FD\u25FE\u2614\u2615\u2648-\u2653\u267F\u2693\u26A1\u26AA\u26AB\u26BD\u26BE\u26C4\u26C5\u26CE\u26D4\u26EA\u26F2\u26F3\u26F5\u26FA\u26FD\u2705\u270A\u270B\u2728\u274C\u274E\u2753-\u2755\u2757\u2795-\u2797\u27B0\u27BF\u2B1B\u2B1C\u2B50\u2B55]|\uD83C[\uDC04\uDCCF\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF7C\uDF7E-\uDF93\uDFA0-\uDFCA\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF4\uDFF8-\uDFFF]|\uD83D[\uDC00-\uDC3E\uDC40\uDC42-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDD7A\uDD95\uDD96\uDDA4\uDDFB-\uDE4F\uDE80-\uDEC5\uDECC\uDED0-\uDED2\uDED5-\uDED7\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD0C-\uDD3A\uDD3C-\uDD45\uDD47-\uDD78\uDD7A-\uDDCB\uDDCD-\uDDFF\uDE70-\uDE74\uDE78-\uDE7A\uDE80-\uDE86\uDE90-\uDEA8\uDEB0-\uDEB6\uDEC0-\uDEC2\uDED0-\uDED6])|(?:[#\*0-9\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23E9-\u23F3\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB-\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u261D\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692-\u2697\u2699\u269B\u269C\u26A0\u26A1\u26A7\u26AA\u26AB\u26B0\u26B1\u26BD\u26BE\u26C4\u26C5\u26C8\u26CE\u26CF\u26D1\u26D3\u26D4\u26E9\u26EA\u26F0-\u26F5\u26F7-\u26FA\u26FD\u2702\u2705\u2708-\u270D\u270F\u2712\u2714\u2716\u271D\u2721\u2728\u2733\u2734\u2744\u2747\u274C\u274E\u2753-\u2755\u2757\u2763\u2764\u2795-\u2797\u27A1\u27B0\u27BF\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B50\u2B55\u3030\u303D\u3297\u3299]|\uD83C[\uDC04\uDCCF\uDD70\uDD71\uDD7E\uDD7F\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE02\uDE1A\uDE2F\uDE32-\uDE3A\uDE50\uDE51\uDF00-\uDF21\uDF24-\uDF93\uDF96\uDF97\uDF99-\uDF9B\uDF9E-\uDFF0\uDFF3-\uDFF5\uDFF7-\uDFFF]|\uD83D[\uDC00-\uDCFD\uDCFF-\uDD3D\uDD49-\uDD4E\uDD50-\uDD67\uDD6F\uDD70\uDD73-\uDD7A\uDD87\uDD8A-\uDD8D\uDD90\uDD95\uDD96\uDDA4\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA-\uDE4F\uDE80-\uDEC5\uDECB-\uDED2\uDED5-\uDED7\uDEE0-\uDEE5\uDEE9\uDEEB\uDEEC\uDEF0\uDEF3-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD0C-\uDD3A\uDD3C-\uDD45\uDD47-\uDD78\uDD7A-\uDDCB\uDDCD-\uDDFF\uDE70-\uDE74\uDE78-\uDE7A\uDE80-\uDE86\uDE90-\uDEA8\uDEB0-\uDEB6\uDEC0-\uDEC2\uDED0-\uDED6])\uFE0F|(?:[\u261D\u26F9\u270A-\u270D]|\uD83C[\uDF85\uDFC2-\uDFC4\uDFC7\uDFCA-\uDFCC]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66-\uDC78\uDC7C\uDC81-\uDC83\uDC85-\uDC87\uDC8F\uDC91\uDCAA\uDD74\uDD75\uDD7A\uDD90\uDD95\uDD96\uDE45-\uDE47\uDE4B-\uDE4F\uDEA3\uDEB4-\uDEB6\uDEC0\uDECC]|\uD83E[\uDD0C\uDD0F\uDD18-\uDD1F\uDD26\uDD30-\uDD39\uDD3C-\uDD3E\uDD77\uDDB5\uDDB6\uDDB8\uDDB9\uDDBB\uDDCD-\uDDCF\uDDD1-\uDDDD])/g},vY=V3(bY);function i2(D,F={}){if(typeof D!="string"||D.length===0||(F={ambiguousIsNarrow:!0,...F},D=Z3(D),D.length===0))return 0;D=D.replace(vY()," ");let Q=F.ambiguousIsNarrow?1:2,B=0;for(let Y of D){let J=Y.codePointAt(0);if(J<=31||J>=127&&J<=159||J>=768&&J<=879)continue;switch(kY.eastAsianWidth(Y)){case"F":case"W":B+=2;break;case"A":B+=Q;break;default:B+=1}}return B}var V1=10,C3=(D=0)=>(F)=>`\x1B[${F+D}m`,W3=(D=0)=>(F)=>`\x1B[${38+D};5;${F}m`,z3=(D=0)=>(F,Q,B)=>`\x1B[${38+D};2;${F};${Q};${B}m`,bD={modifier:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],overline:[53,55],inverse:[7,27],hidden:[8,28],strikethrough:[9,29]},color:{black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],blackBright:[90,39],gray:[90,39],grey:[90,39],redBright:[91,39],greenBright:[92,39],yellowBright:[93,39],blueBright:[94,39],magentaBright:[95,39],cyanBright:[96,39],whiteBright:[97,39]},bgColor:{bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgBlackBright:[100,49],bgGray:[100,49],bgGrey:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]}};Object.keys(bD.modifier);var xY=Object.keys(bD.color),uY=Object.keys(bD.bgColor);[...xY];function yY(){let D=new Map;for(let[F,Q]of Object.entries(bD)){for(let[B,Y]of Object.entries(Q))bD[B]={open:`\x1B[${Y[0]}m`,close:`\x1B[${Y[1]}m`},Q[B]=bD[B],D.set(Y[0],Y[1]);Object.defineProperty(bD,F,{value:Q,enumerable:!1})}return Object.defineProperty(bD,"codes",{value:D,enumerable:!1}),bD.color.close="\x1B[39m",bD.bgColor.close="\x1B[49m",bD.color.ansi=C3(),bD.color.ansi256=W3(),bD.color.ansi16m=z3(),bD.bgColor.ansi=C3(V1),bD.bgColor.ansi256=W3(V1),bD.bgColor.ansi16m=z3(V1),Object.defineProperties(bD,{rgbToAnsi256:{value:(F,Q,B)=>F===Q&&Q===B?F<8?16:F>248?231:Math.round((F-8)/247*24)+232:16+36*Math.round(F/255*5)+6*Math.round(Q/255*5)+Math.round(B/255*5),enumerable:!1},hexToRgb:{value:(F)=>{let Q=/[a-f\d]{6}|[a-f\d]{3}/i.exec(F.toString(16));if(!Q)return[0,0,0];let[B]=Q;B.length===3&&(B=[...B].map((J)=>J+J).join(""));let Y=Number.parseInt(B,16);return[Y>>16&255,Y>>8&255,Y&255]},enumerable:!1},hexToAnsi256:{value:(F)=>bD.rgbToAnsi256(...bD.hexToRgb(F)),enumerable:!1},ansi256ToAnsi:{value:(F)=>{if(F<8)return 30+F;if(F<16)return 90+(F-8);let Q,B,Y;if(F>=232)Q=((F-232)*10+8)/255,B=Q,Y=Q;else{F-=16;let C=F%36;Q=Math.floor(F/36)/5,B=Math.floor(C/6)/5,Y=C%6/5}let J=Math.max(Q,B,Y)*2;if(J===0)return 30;let X=30+(Math.round(Y)<<2|Math.round(B)<<1|Math.round(Q));return J===2&&(X+=60),X},enumerable:!1},rgbToAnsi:{value:(F,Q,B)=>bD.ansi256ToAnsi(bD.rgbToAnsi256(F,Q,B)),enumerable:!1},hexToAnsi:{value:(F)=>bD.ansi256ToAnsi(bD.hexToAnsi256(F)),enumerable:!1}}),bD}var fY=yY(),a8=new Set(["\x1B","ย›"]),gY=39,N1="\x07",M3="[",$Y="]",N3="m",j1=`${$Y}8;;`,G3=(D)=>`${a8.values().next().value}${M3}${D}${N3}`,q3=(D)=>`${a8.values().next().value}${j1}${D}${N1}`,hY=(D)=>D.split(" ").map((F)=>i2(F)),L1=(D,F,Q)=>{let B=[...F],Y=!1,J=!1,X=i2(Z3(D[D.length-1]));for(let[C,z]of B.entries()){let W=i2(z);if(X+W<=Q?D[D.length-1]+=z:(D.push(z),X=0),a8.has(z)&&(Y=!0,J=B.slice(C+1).join("").startsWith(j1)),Y){J?z===N1&&(Y=!1,J=!1):z===N3&&(Y=!1);continue}X+=W,X===Q&&C0&&D.length>1&&(D[D.length-2]+=D.pop())},mY=(D)=>{let F=D.split(" "),Q=F.length;for(;Q>0&&!(i2(F[Q-1])>0);)Q--;return Q===F.length?D:F.slice(0,Q).join(" ")+F.slice(Q).join("")},lY=(D,F,Q={})=>{if(Q.trim!==!1&&D.trim()==="")return"";let B="",Y,J,X=hY(D),C=[""];for(let[W,G]of D.split(" ").entries()){Q.trim!==!1&&(C[C.length-1]=C[C.length-1].trimStart());let q=i2(C[C.length-1]);if(W!==0&&(q>=F&&(Q.wordWrap===!1||Q.trim===!1)&&(C.push(""),q=0),(q>0||Q.trim===!1)&&(C[C.length-1]+=" ",q++)),Q.hard&&X[W]>F){let A=F-q,U=1+Math.floor((X[W]-A-1)/F);Math.floor((X[W]-1)/F)F&&q>0&&X[W]>0){if(Q.wordWrap===!1&&qF&&Q.wordWrap===!1){L1(C,G,F);continue}C[C.length-1]+=G}Q.trim!==!1&&(C=C.map((W)=>mY(W)));let z=[...C.join(` `)];for(let[W,G]of z.entries()){if(B+=G,a8.has(G)){let{groups:A}=new RegExp(`(?:\\${M3}(?\\d+)m|\\${j1}(?.*)${N1})`).exec(z.slice(W).join(""))||{groups:{}};if(A.code!==void 0){let U=Number.parseFloat(A.code);Y=U===gY?void 0:U}else A.uri!==void 0&&(J=A.uri.length===0?void 0:A.uri)}let q=fY.codes.get(Number(Y));z[W+1]===` `?(J&&(B+=q3("")),Y&&q&&(B+=G3(q))):G===` `&&(Y&&q&&(B+=G3(Y)),J&&(B+=q3(J)))}return B};function H3(D,F,Q){return String(D).normalize().replace(/\r\n/g,` diff --git a/package.json b/package.json index f02f7511..5846b125 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "claude-mem", - "version": "3.9.12", + "version": "3.9.13", "description": "Memory compression system for Claude Code - persist context across sessions", "keywords": [ "claude",