@averyyy/pi-coding-agent 0.84.3-piclient.1 → 0.84.4-piclient.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (95) hide show
  1. package/CHANGELOG.md +124 -0
  2. package/README.md +5 -4
  3. package/dist/bundle/chunks/{chunk-GPPBJGBU.js → chunk-2KVJKXS2.js} +1 -1
  4. package/dist/bundle/chunks/{chunk-QI42RBZ4.js → chunk-WJEX5SB4.js} +74 -74
  5. package/dist/bundle/chunks/{google-generative-ai-XDKMGBCJ.js → google-generative-ai-YMUPJBKR.js} +1 -1
  6. package/dist/bundle/chunks/{google-vertex-D5FGEO3Y.js → google-vertex-MPWMV4OF.js} +1 -1
  7. package/dist/bundle/chunks/https-proxy-agent-2VXB7436.js +13 -0
  8. package/dist/bundle/chunks/{mistral-conversations-YK73UAOZ.js → mistral-conversations-Q3AWZJAZ.js} +1 -1
  9. package/dist/bundle/chunks/{openai-completions-JD4WAC3R.js → openai-completions-ERMU2SS7.js} +1 -1
  10. package/dist/bundle/cli.js +1 -1
  11. package/dist/bundle/index.js +1 -1
  12. package/dist/bundle/rpc-entry.js +1 -1
  13. package/dist/cli/startup-ui.d.ts.map +1 -1
  14. package/dist/cli/startup-ui.js +2 -1
  15. package/dist/cli/startup-ui.js.map +1 -1
  16. package/dist/core/agent-session.d.ts +15 -1
  17. package/dist/core/agent-session.d.ts.map +1 -1
  18. package/dist/core/agent-session.js +122 -21
  19. package/dist/core/agent-session.js.map +1 -1
  20. package/dist/core/compaction/branch-summarization.d.ts.map +1 -1
  21. package/dist/core/compaction/branch-summarization.js +8 -1
  22. package/dist/core/compaction/branch-summarization.js.map +1 -1
  23. package/dist/core/compaction/compaction.d.ts +9 -4
  24. package/dist/core/compaction/compaction.d.ts.map +1 -1
  25. package/dist/core/compaction/compaction.js +42 -22
  26. package/dist/core/compaction/compaction.js.map +1 -1
  27. package/dist/core/extensions/index.d.ts +1 -1
  28. package/dist/core/extensions/index.d.ts.map +1 -1
  29. package/dist/core/extensions/index.js.map +1 -1
  30. package/dist/core/extensions/runner.d.ts +5 -0
  31. package/dist/core/extensions/runner.d.ts.map +1 -1
  32. package/dist/core/extensions/runner.js +45 -1
  33. package/dist/core/extensions/runner.js.map +1 -1
  34. package/dist/core/extensions/types.d.ts +18 -1
  35. package/dist/core/extensions/types.d.ts.map +1 -1
  36. package/dist/core/extensions/types.js.map +1 -1
  37. package/dist/core/pi-server-client.d.ts.map +1 -1
  38. package/dist/core/pi-server-client.js +26 -9
  39. package/dist/core/pi-server-client.js.map +1 -1
  40. package/dist/core/session-manager.d.ts.map +1 -1
  41. package/dist/core/session-manager.js +4 -2
  42. package/dist/core/session-manager.js.map +1 -1
  43. package/dist/core/settings-manager.d.ts +8 -1
  44. package/dist/core/settings-manager.d.ts.map +1 -1
  45. package/dist/core/settings-manager.js +17 -0
  46. package/dist/core/settings-manager.js.map +1 -1
  47. package/dist/index.d.ts +2 -1
  48. package/dist/index.d.ts.map +1 -1
  49. package/dist/index.js +1 -0
  50. package/dist/index.js.map +1 -1
  51. package/dist/main.d.ts.map +1 -1
  52. package/dist/main.js +2 -0
  53. package/dist/main.js.map +1 -1
  54. package/dist/modes/interactive/components/settings-selector.d.ts +2 -0
  55. package/dist/modes/interactive/components/settings-selector.d.ts.map +1 -1
  56. package/dist/modes/interactive/components/settings-selector.js +10 -0
  57. package/dist/modes/interactive/components/settings-selector.js.map +1 -1
  58. package/dist/modes/interactive/interactive-mode.d.ts +5 -0
  59. package/dist/modes/interactive/interactive-mode.d.ts.map +1 -1
  60. package/dist/modes/interactive/interactive-mode.js +65 -28
  61. package/dist/modes/interactive/interactive-mode.js.map +1 -1
  62. package/dist/modes/rpc/rpc-client.d.ts +7 -0
  63. package/dist/modes/rpc/rpc-client.d.ts.map +1 -1
  64. package/dist/modes/rpc/rpc-client.js +7 -0
  65. package/dist/modes/rpc/rpc-client.js.map +1 -1
  66. package/dist/modes/rpc/rpc-mode.d.ts.map +1 -1
  67. package/dist/modes/rpc/rpc-mode.js +3 -0
  68. package/dist/modes/rpc/rpc-mode.js.map +1 -1
  69. package/dist/modes/rpc/rpc-types.d.ts +12 -0
  70. package/dist/modes/rpc/rpc-types.d.ts.map +1 -1
  71. package/dist/modes/rpc/rpc-types.js.map +1 -1
  72. package/dist/utils/shell.d.ts.map +1 -1
  73. package/dist/utils/shell.js +6 -4
  74. package/dist/utils/shell.js.map +1 -1
  75. package/docs/compaction.md +2 -0
  76. package/docs/custom-provider.md +7 -7
  77. package/docs/environment-variables.md +3 -0
  78. package/docs/extensions.md +18 -0
  79. package/docs/keybindings.md +1 -1
  80. package/docs/quickstart.md +1 -1
  81. package/docs/rpc.md +23 -0
  82. package/docs/settings.md +12 -4
  83. package/docs/terminal-setup.md +12 -0
  84. package/docs/usage.md +4 -3
  85. package/examples/extensions/custom-provider-anthropic/package-lock.json +2 -2
  86. package/examples/extensions/custom-provider-anthropic/package.json +1 -1
  87. package/examples/extensions/custom-provider-gitlab-duo/package.json +1 -1
  88. package/examples/extensions/gondolin/package-lock.json +2 -2
  89. package/examples/extensions/gondolin/package.json +1 -1
  90. package/examples/extensions/sandbox/package-lock.json +2 -2
  91. package/examples/extensions/sandbox/package.json +1 -1
  92. package/examples/extensions/with-deps/package-lock.json +2 -2
  93. package/examples/extensions/with-deps/package.json +1 -1
  94. package/package.json +6 -6
  95. package/dist/bundle/chunks/dist-RDWOYWHR.js +0 -13
package/CHANGELOG.md CHANGED
@@ -5,6 +5,7 @@
5
5
  ### Added
6
6
 
7
7
  - Added `pi-client` CLI adapter layer for automatic command rewriting when running in `PI_SERVER_MODE`. Extensions spawning `pi` subprocesses now automatically invoke `pi-client` instead, and terminal output displays `pi-client` in command strings and resume prompts.
8
+
8
9
  ### Fixed
9
10
 
10
11
  - Fixed model and thinking default persistence plus PowerShell tool construction after the upstream 0.84.3 update.
@@ -14,6 +15,129 @@
14
15
  - Fixed pi-server provider requests to send only the projected, compaction-aware LLM context instead of synchronizing the full durable session tree.
15
16
  - Fixed pi-server tree recovery to use structured error codes and preserve authoritative tool-call namespaces.
16
17
  - Fixed disconnected pi-server streams to recover the same run before allowing an outer provider retry, preventing duplicate concurrent provider requests.
18
+ - Fixed pi-client skipping auto-retry on pi-server HTTP 502/proxy failures. Same-run recovery now runs only after an event-stream has started, so a down proxy no longer reclassifies the original stream error as non-retryable.
19
+
20
+ ## [0.84.4] - 2026-08-28
21
+
22
+ ### New Features
23
+
24
+ - **Terminal capability overrides** — Override detected terminal hyperlink, image, and truecolor support. See [Capability Overrides](docs/terminal-setup.md#capability-overrides).
25
+ - **Extension UI prompt events** — Integrations can distinguish active agent work from time spent waiting for `ctx.ui` prompts. See [Extension UI prompt events](docs/extensions.md#ui_prompt_start--ui_prompt_end).
26
+ - **RPC queue clearing** — Retrieve and clear queued steering and follow-up messages with `clear_queue`. See [RPC `clear_queue`](docs/rpc.md#clear_queue).
27
+ - **Fullscreen selection copy controls** — Disable automatic selection copying in fullscreen mode and use Ctrl+X to copy the active selection. See [UI & Display](docs/settings.md#ui--display).
28
+ - **DeepSeek V4 Flash Vision (experimental)** — Use the vision-capable model through the built-in DeepSeek provider. See [API Keys](docs/providers.md#api-keys).
29
+
30
+ ### Added
31
+
32
+ - Added `ui_prompt_start` and `ui_prompt_end` extension events so host integrations can distinguish active agent work from waiting on user-facing `ctx.ui` prompts ([#8355](https://github.com/earendil-works/pi/pull/8355) by [@cristinaponcela](https://github.com/cristinaponcela)).
33
+ - Added `detectSupportedImageMimeTypeFromFile()` to the public library exports ([#8600](https://github.com/earendil-works/pi/pull/8600) by [@xl0](https://github.com/xl0)).
34
+ - Added inherited experimental vision-capable `deepseek-v4-flash-vision-exp` model support.
35
+ - Added transcript usage notices for compaction and branch summaries when cache miss notices are enabled.
36
+ - Added RPC `clear_queue` to retrieve and remove queued steering and follow-up messages ([#8432](https://github.com/earendil-works/pi/issues/8432)).
37
+ - Added environment variables and advanced settings for overriding auto-detected terminal hyperlink, image, and truecolor capabilities ([#8665](https://github.com/earendil-works/pi/issues/8665)).
38
+ - Added `fullscreenCopyOnSelect` to disable automatic fullscreen selection copy; when disabled, `Ctrl+X` copies the active text selection before falling back to the last assistant message, while `/tree` still copies the selected message ([#7720](https://github.com/earendil-works/pi/issues/7720)).
39
+
40
+ ### Fixed
41
+
42
+ - Fixed toggling thinking visibility clearing partial output from running Bash tools ([#8611](https://github.com/earendil-works/pi/issues/8611)).
43
+ - Fixed Windows shell aborts crashing Pi when `taskkill.exe` is unavailable on `PATH` ([#6596](https://github.com/earendil-works/pi/issues/6596)).
44
+ - Fixed resumed sessions corrupting the next appended entry when their JSONL file lacks a trailing newline ([#8345](https://github.com/earendil-works/pi/issues/8345)).
45
+ - Fixed extension messages sent with `triggerTurn: false` while the agent is running being inserted between a tool call and its result, which made providers that validate message order reject the replayed history. They are now appended once the turn's tool results are in ([#8537](https://github.com/earendil-works/pi/issues/8537)).
46
+ - Fixed compaction and branch summaries forcing `toolChoice: "none"` ([#8649](https://github.com/earendil-works/pi/issues/8649), [#8638](https://github.com/earendil-works/pi/issues/8638)).
47
+ - Fixed large tool results crossing the auto-compaction threshold being sent to the provider before compaction. Pi now compacts between tool execution and the next assistant response in the same run, and restores interactive progress when that run resumes ([#6879](https://github.com/earendil-works/pi/issues/6879)).
48
+ - Fixed Google Vertex requests failing with `HttpsProxyAgent is not a constructor` when the bundled Node.js runtime uses an HTTP(S) proxy ([#8610](https://github.com/earendil-works/pi/issues/8610)).
49
+ - Fixed saving a default model from a non-empty model scope so it remains available in that scope.
50
+ - Fixed inherited `@` file autocomplete ranking to prefer direct and shallower matches over similarly ranked nested paths ([#8669](https://github.com/earendil-works/pi/pull/8669)).
51
+ - Fixed inherited OpenAI-compatible streams serializing thinking signatures repeatedly during streaming ([#8671](https://github.com/earendil-works/pi/pull/8671)).
52
+ - Fixed inherited main-screen rendering crashing when image-heavy output exceeded V8's string length limit ([#8028](https://github.com/earendil-works/pi/issues/8028)).
53
+ - Fixed inherited fullscreen double-click word selection splitting paths and kebab-case tokens on `/` and `-` ([#8676](https://github.com/earendil-works/pi/pull/8676)).
54
+ - Fixed inherited Cloudflare AI Gateway catalogs omitting supported `workers-ai/*` passthrough models.
55
+ - Fixed inherited OpenAI-compatible reasoning replay to merge consecutive streamed text and summary `reasoning_details` deltas.
56
+ - Fixed inherited OpenRouter reasoning controls so reasoning-mandatory models do not receive `effort: "none"` ([#8614](https://github.com/earendil-works/pi/pull/8614) by [@davidbrai](https://github.com/davidbrai)).
57
+ - Fixed inherited OpenAI-compatible Chat Completions ignoring an explicitly requested `toolChoice` when no tools are defined.
58
+ - Fixed inherited fragmented Mistral tool calls splitting when continuation chunks omit the tool-call ID ([#8387](https://github.com/earendil-works/pi/issues/8387)).
59
+
60
+ ### Added
61
+
62
+ ## [0.84.3] - 2026-08-24
63
+
64
+ ### New Features
65
+
66
+ - **PowerShell tool** — Use optional native PowerShell command execution on Windows. See [PowerShell Tool](docs/windows.md#powershell-tool).
67
+ - **Safer managed updates** — Stage, verify, and atomically activate updates for installer-managed installations. See [Install and Manage](docs/packages.md#install-and-manage).
68
+ - **Model and thinking controls** — Select thinking levels with `/thinking`, search defaults, keep selections session-scoped, and persist them explicitly with Ctrl+S. See [Models and Thinking](docs/keybindings.md#models-and-thinking).
69
+
70
+ ### Breaking Changes
71
+
72
+ - Renamed the inherited `GoogleThinkingLevel` type to `GoogleApiThinkingLevel` and added `ResolvedGoogleThinkingLevel` for normalized adapter levels.
73
+
74
+ ### Added
75
+ - Added an optional `powershell` tool for Windows, configurable through `defaultTools` and the SDK. See [PowerShell Tool](docs/windows.md#powershell-tool).
76
+ - Added a `/thinking` selector and searchable default choices to the model and thinking selectors; Ctrl+S saves the selected model as the global default. See [Models and Thinking](docs/keybindings.md#models-and-thinking).
77
+ - Added optional routing session IDs to exported compaction summary helpers so callers can preserve provider routing without enabling prompt cache writes.
78
+ - Added usage notices for compaction and branch summaries when cache miss notices are enabled.
79
+ - Added `session_compact_failed` extension events so compaction failures and aborts expose their reason, retry state, source, and error message to handlers ([#8175](https://github.com/earendil-works/pi/issues/8175)).
80
+ - Added inherited provider-neutral `toolChoice` support to simple stream requests.
81
+ - Added inherited automatic Anthropic server-side refusal fallback for supported first-party models, including returned-model usage pricing ([#8017](https://github.com/earendil-works/pi/issues/8017)).
82
+ - Added inherited configurable OpenAI-compatible thinking-token budget fields for vLLM, Qwen/SGLang, and llama.cpp servers. See [OpenAI Compatibility](docs/models.md#openai-compatibility) ([#8275](https://github.com/earendil-works/pi/pull/8275) by [@bnsd55](https://github.com/bnsd55)).
83
+ - Added inherited China-specific ZAI Coding Plan models, including GLM-4.6V vision support and API-equivalent usage cost estimates ([#8220](https://github.com/earendil-works/pi/issues/8220)).
84
+ - Added inherited `deepseek-v4-pro-0813` support to the Qwen Token Plan Individual catalog ([#8194](https://github.com/earendil-works/pi/issues/8194)).
85
+
86
+ ### Changed
87
+
88
+ - Changed experimental installer-managed installations so `pi update` stages, verifies, and atomically activates the selected release in place. See [Install and Manage](docs/packages.md#install-and-manage).
89
+ - Changed inherited built-in xAI models to use the Responses API with encrypted reasoning replay and made Grok 4.6 the default xAI model ([#8124](https://github.com/earendil-works/pi/pull/8124) by [@Jaaneek](https://github.com/Jaaneek)).
90
+ - Changed inherited Anthropic, Azure OpenAI, Google, Mistral, and OpenAI adapters to send Pi's default `User-Agent` unless overridden ([#8305](https://github.com/earendil-works/pi/issues/8305)).
91
+ - Changed Windows and WSL keybinding defaults to avoid terminal-reserved shortcuts for image paste, model cycling, editor undo, fullscreen transcript navigation and search, and message queueing ([#8372](https://github.com/earendil-works/pi/issues/8372)).
92
+ - Changed Bun release archives to ship the native clipboard binary only inside the wrapper package, removing a duplicate platform package from each archive.
93
+ - Changed package resource glob expansion to use Node.js's built-in implementation with deterministic visible-path matching, reducing the installed runtime dependency tree.
94
+ - Changed the bundled Node.js runtime to load jiti only when importing an extension and Babel only when uncached source needs transformation, reducing CLI startup time and bundle size.
95
+ - Changed syntax highlighting to initialize only twenty common languages eagerly and defer the remaining grammars until after the initial TUI render, reducing CLI startup time.
96
+ - Changed the Node.js CLI and RPC entrypoints to load a bundled runtime, reducing startup filesystem reads while keeping the public library and legacy module paths on the modular runtime for normal dependency identity.
97
+ - Changed session sharing to render clickable terminal links, display only the canonical Radius artifact URL, and include the current system prompt and active tool definitions in Radius session shares.
98
+
99
+ ### Fixed
100
+
101
+ - Fixed failed extension factories leaving event subscriptions, provider registrations, and default flag state active ([#8424](https://github.com/earendil-works/pi/pull/8424) by [@acmerfight](https://github.com/acmerfight)).
102
+ - Fixed `models.json` typings omitting the documented OpenAI-compatible `compat.supportsFinishReason` provider and model override ([#8487](https://github.com/earendil-works/pi/pull/8487) by [@petrroll](https://github.com/petrroll)).
103
+ - Fixed `/model` and `/thinking` selections being persisted globally unless explicitly saved with Ctrl+S ([#5263](https://github.com/earendil-works/pi/issues/5263)).
104
+ - Fixed JSON and RPC `toolcall_start` events omitting the tool call id and name ([#7953](https://github.com/earendil-works/pi/pull/7953) by [@christianklotz](https://github.com/christianklotz)).
105
+ - Fixed extensions failing to load when the Node.js CLI runs as a single-executable application ([#8237](https://github.com/earendil-works/pi/issues/8237)).
106
+ - Fixed nested Markdown skills inside `.agents/skills/` grouping directories not being discovered.
107
+ - Fixed compaction and branch summarization requests exposing tools to providers.
108
+ - Fixed single-object `edit` tool inputs failing validation by accepting them as one-edit arrays in both coding-agent and harness edit tools ([#7835](https://github.com/earendil-works/pi/issues/7835)).
109
+ - Fixed root Markdown files such as `README.md` and `AGENTS.md` in skill directories being reported as broken skills unless they declare valid skill frontmatter ([#7805](https://github.com/earendil-works/pi/issues/7805)).
110
+ - Fixed the default Cerebras model referencing an unavailable Z.AI model.
111
+ - Fixed inherited OpenAI-compatible Chat Completions reasoning replay to preserve and resend assistant-level `reasoning_details` verbatim and in order ([#7994](https://github.com/earendil-works/pi/issues/7994)).
112
+ - Fixed inherited Anthropic server-side fallback responses being priced with the requested model instead of the returned fallback model ([#8285](https://github.com/earendil-works/pi/issues/8285)).
113
+ - Fixed inherited GitHub Copilot login triggering model-policy rate limits by limiting policy updates, retrying model discovery once, and honoring server retry delays ([#7850](https://github.com/earendil-works/pi/issues/7850)).
114
+ - Fixed inherited Amazon Bedrock dropping and failing to replay opaque redacted reasoning from non-Anthropic models ([#8314](https://github.com/earendil-works/pi/pull/8314) by [@seiji](https://github.com/seiji)).
115
+ - Fixed inherited Z.AI Coding Plan models deriving incomplete reasoning-effort metadata, including missing GLM-5.3 low, high, and max levels ([#8336](https://github.com/earendil-works/pi/issues/8336)).
116
+ - Fixed inherited DeepSeek V4 Flash on OpenCode and OpenCode Go omitting its supported low thinking level ([#8181](https://github.com/earendil-works/pi/pull/8181) by [@tianshuang](https://github.com/tianshuang)).
117
+ - Fixed inherited Azure OpenAI Responses ignoring `toolChoice` in provider-specific stream requests.
118
+ - Fixed inherited Amazon Bedrock response hooks receiving only a synthesized request id instead of the raw response headers ([#8234](https://github.com/earendil-works/pi/issues/8234)).
119
+ - Fixed inherited Kimi usage reporting so top-level `cached_tokens` count as cache reads instead of normal input tokens ([#8075](https://github.com/earendil-works/pi/issues/8075)).
120
+ - Fixed inherited Google custom models ignoring `thinkingLevelMap`, which dropped extended thinking controls ([#8135](https://github.com/earendil-works/pi/issues/8135)).
121
+ - Fixed writes to `auth.json` and `models-store.json` overriding administrator-managed file permissions and ACLs ([#7779](https://github.com/earendil-works/pi/issues/7779)).
122
+ - Fixed UTF-8 BOM markers preventing frontmatter and user configuration files from loading ([#8337](https://github.com/earendil-works/pi/issues/8337)).
123
+ - Fixed invalid settings files being easy to miss during interactive startup by rendering warnings with the file path inside the TUI ([#7829](https://github.com/earendil-works/pi/issues/7829)).
124
+ - Fixed the subagent example repeatedly prompting before running project-local agents in trusted repositories ([#8261](https://github.com/earendil-works/pi/issues/8261)).
125
+ - Added `session_compact_failed` extension events so compaction failures and aborts expose their reason, retry state, source, and error message to handlers ([#8175](https://github.com/earendil-works/pi/issues/8175)).
126
+ - Fixed truncated compaction and branch summaries being persisted when generation reaches its output token limit ([#7048](https://github.com/earendil-works/pi/issues/7048)).
127
+ - Fixed npm package update checks treating older registry versions as available updates, preventing `pi update` from downgrading already-newer installed packages ([#8226](https://github.com/earendil-works/pi/issues/8226)).
128
+ - Fixed built-in llama.cpp models disappearing from `/model` when `/llama` refreshed a configured server under `PI_OFFLINE`, and included idle-slept `sleeping` router models plus autoloadable unloaded presets in the selectable catalog ([#8558](https://github.com/earendil-works/pi/pull/8558) by [@cristinaponcela](https://github.com/cristinaponcela)).
129
+ - Fixed `pi.registerFlag()` accepting default values that do not match the declared flag type ([#8064](https://github.com/earendil-works/pi/issues/8064)).
130
+ - Fixed Z.AI Coding Plan defaults referencing the removed GLM-5.1 model ([#8096](https://github.com/earendil-works/pi/issues/8096)).
131
+ - Fixed repeated ambiguous truncated-response recovery being mislabeled as context overflow ([#8130](https://github.com/earendil-works/pi/issues/8130)).
132
+ - Fixed duplicate fullscreen right-click paste in VS Code-based terminals on Windows ([#8186](https://github.com/earendil-works/pi/issues/8186)).
133
+ - Fixed inherited padded text exceeding narrow terminal widths ([#8252](https://github.com/earendil-works/pi/issues/8252)).
134
+ - Fixed inherited wrapped Markdown table links leaking color into borders and neighboring cells, including tables inside blockquotes ([#8335](https://github.com/earendil-works/pi/issues/8335)).
135
+ - Fixed llama.cpp login guidance to direct users to `/llama` before `/model` when no local models are loaded ([#8203](https://github.com/earendil-works/pi/issues/8203)).
136
+ - Fixed hung pi.dev model catalog requests consuming the entire refresh deadline without retrying ([#8198](https://github.com/earendil-works/pi/issues/8198)).
137
+ - Fixed inherited Xiaomi model catalogs listing shut-down MiMo V2 models in `/model` and `--list-models` ([#8187](https://github.com/earendil-works/pi/issues/8187)).
138
+ - Fixed branch summary entries recording the navigation destination in `fromId` instead of the pre-navigation source leaf.
139
+ - Fixed threshold auto-compaction being skipped when providers omit streaming usage data ([#8328](https://github.com/earendil-works/pi/issues/8328)).
140
+ - Fixed dash-prefixed prompts being parsed as options by supporting `--` as an end-of-options delimiter ([#7269](https://github.com/earendil-works/pi/issues/7269)).
17
141
 
18
142
  ## [0.84.2] - 2026-08-14
19
143
 
package/README.md CHANGED
@@ -96,7 +96,7 @@ Then just talk to pi. By default, pi gives the model four tools: `read`, `write`
96
96
 
97
97
  ## Providers & Models
98
98
 
99
- For each built-in provider, pi maintains a list of tool-capable models. Configured provider catalogs refresh automatically; run `pi update --models` to force an immediate refresh. Authenticate via subscription (`/login`) or API key, then select any model from that provider via `/model` (or Ctrl+L).
99
+ For each built-in provider, pi maintains a list of tool-capable models. Configured provider catalogs refresh automatically; run `pi update --models` to force an immediate refresh. Authenticate via subscription (`/login`) or API key, then select any model from that provider via `/model` (or Ctrl+L). Press Ctrl+S in the model picker to save the highlighted model as the startup default.
100
100
 
101
101
  **Subscriptions:**
102
102
  - Anthropic Claude Pro/Max
@@ -178,9 +178,10 @@ Type `/` in the editor to trigger commands. [Extensions](#extensions) can regist
178
178
  |---------|-------------|
179
179
  | `/login`, `/logout` | Manage provider credentials |
180
180
  | [`/llama`](docs/llama-cpp.md) | Download, load, and unload llama.cpp router models |
181
- | `/model` | Switch models |
181
+ | `/model` | Switch models; Ctrl+S in the picker saves the startup default |
182
+ | `/thinking` | Switch thinking level; Ctrl+S in the picker saves the startup default |
182
183
  | `/scoped-models` | Enable/disable models for Ctrl+P cycling |
183
- | `/settings` | Thinking level, theme, message delivery, transport |
184
+ | `/settings` | Theme, message delivery, transport, and other preferences |
184
185
  | `/resume` | Pick from previous sessions |
185
186
  | `/new` | Start a new session |
186
187
  | `/name <name>` | Set session display name |
@@ -216,7 +217,7 @@ See `/hotkeys` for the full list. Customize via `~/.pi/agent/keybindings.json`.
216
217
  | Shift+Tab | Cycle thinking level |
217
218
  | Ctrl+O | Collapse/expand tool output |
218
219
  | Ctrl+T | Collapse/expand thinking blocks |
219
- | Ctrl+X | Copy the last assistant message |
220
+ | Ctrl+X | Copy the last assistant message; with fullscreen copy-on-select disabled, copy the active text selection |
220
221
 
221
222
  ### Message Queue
222
223
 
@@ -4,7 +4,7 @@ import{getJsonSchemaToolParameters,resolveJsonSchemaStrictSampling,transformMess
4
4
  Content-Type: ${partContentType}\r
5
5
  \r
6
6
  `,typeof currentPart.content=="string"?yield currentPart.content:yield*currentPart.content,yield`\r
7
- `}yield finale}static#proxyAgent;static#fetch;static async#getProxyAgent(){return this.#proxyAgent||=(await import("./dist-RDWOYWHR.js")).HttpsProxyAgent,this.#proxyAgent}static async#getFetch(){let hasWindow=typeof window<"u"&&!!window;return this.#fetch||=hasWindow?window.fetch:(await import("./src-UK77SYZE.js")).default,this.#fetch}static mergeHeaders(base,...append){base=base instanceof Headers?base:new Headers(base);for(let headers of append)(headers instanceof Headers?headers:new Headers(headers)).forEach((value,key)=>{key==="set-cookie"?base.append(key,value):base.set(key,value)});return base}};exports.Gaxios=Gaxios;_a2=Gaxios}});var require_src=__commonJS({"node_modules/gaxios/build/cjs/src/index.js"(exports){"use strict";var __createBinding=exports&&exports.__createBinding||(Object.create?(function(o,m,k,k2){k2===void 0&&(k2=k);var desc=Object.getOwnPropertyDescriptor(m,k);(!desc||("get"in desc?!m.__esModule:desc.writable||desc.configurable))&&(desc={enumerable:!0,get:function(){return m[k]}}),Object.defineProperty(o,k2,desc)}):(function(o,m,k,k2){k2===void 0&&(k2=k),o[k2]=m[k]})),__exportStar=exports&&exports.__exportStar||function(m,exports2){for(var p in m)p!=="default"&&!Object.prototype.hasOwnProperty.call(exports2,p)&&__createBinding(exports2,m,p)};Object.defineProperty(exports,"__esModule",{value:!0});exports.instance=exports.Gaxios=exports.GaxiosError=void 0;exports.request=request;var gaxios_js_1=require_gaxios();Object.defineProperty(exports,"Gaxios",{enumerable:!0,get:function(){return gaxios_js_1.Gaxios}});var common_js_1=require_common();Object.defineProperty(exports,"GaxiosError",{enumerable:!0,get:function(){return common_js_1.GaxiosError}});__exportStar(require_interceptor(),exports);exports.instance=new gaxios_js_1.Gaxios;async function request(opts){return exports.instance.request(opts)}}});var require_bignumber=__commonJS({"node_modules/bignumber.js/bignumber.js"(exports,module){(function(globalObject){"use strict";var BigNumber,isNumeric=/^-?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?$/i,mathceil=Math.ceil,mathfloor=Math.floor,bignumberError="[BigNumber Error] ",tooManyDigits=bignumberError+"Number primitive has more than 15 significant digits: ",BASE=1e14,LOG_BASE=14,MAX_SAFE_INTEGER=9007199254740991,POWS_TEN=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8,1e9,1e10,1e11,1e12,1e13],SQRT_BASE=1e7,MAX=1e9;function clone(configObject){var div,convertBase,parseNumeric,P=BigNumber2.prototype={constructor:BigNumber2,toString:null,valueOf:null},ONE=new BigNumber2(1),DECIMAL_PLACES=20,ROUNDING_MODE=4,TO_EXP_NEG=-7,TO_EXP_POS=21,MIN_EXP=-1e7,MAX_EXP=1e7,CRYPTO=!1,MODULO_MODE=1,POW_PRECISION=0,FORMAT={prefix:"",groupSize:3,secondaryGroupSize:0,groupSeparator:",",decimalSeparator:".",fractionGroupSize:0,fractionGroupSeparator:"\xA0",suffix:""},ALPHABET="0123456789abcdefghijklmnopqrstuvwxyz",alphabetHasNormalDecimalDigits=!0;function BigNumber2(v,b){var alphabet,c,caseChanged,e,i,isNum,len,str,x=this;if(!(x instanceof BigNumber2))return new BigNumber2(v,b);if(b==null){if(v&&v._isBigNumber===!0){x.s=v.s,!v.c||v.e>MAX_EXP?x.c=x.e=null:v.e<MIN_EXP?x.c=[x.e=0]:(x.e=v.e,x.c=v.c.slice());return}if((isNum=typeof v=="number")&&v*0==0){if(x.s=1/v<0?(v=-v,-1):1,v===~~v){for(e=0,i=v;i>=10;i/=10,e++);e>MAX_EXP?x.c=x.e=null:(x.e=e,x.c=[v]);return}str=String(v)}else{if(!isNumeric.test(str=String(v)))return parseNumeric(x,str,isNum);x.s=str.charCodeAt(0)==45?(str=str.slice(1),-1):1}(e=str.indexOf("."))>-1&&(str=str.replace(".","")),(i=str.search(/e/i))>0?(e<0&&(e=i),e+=+str.slice(i+1),str=str.substring(0,i)):e<0&&(e=str.length)}else{if(intCheck(b,2,ALPHABET.length,"Base"),b==10&&alphabetHasNormalDecimalDigits)return x=new BigNumber2(v),round(x,DECIMAL_PLACES+x.e+1,ROUNDING_MODE);if(str=String(v),isNum=typeof v=="number"){if(v*0!=0)return parseNumeric(x,str,isNum,b);if(x.s=1/v<0?(str=str.slice(1),-1):1,BigNumber2.DEBUG&&str.replace(/^0\.0*|\./,"").length>15)throw Error(tooManyDigits+v)}else x.s=str.charCodeAt(0)===45?(str=str.slice(1),-1):1;for(alphabet=ALPHABET.slice(0,b),e=i=0,len=str.length;i<len;i++)if(alphabet.indexOf(c=str.charAt(i))<0){if(c=="."){if(i>e){e=len;continue}}else if(!caseChanged&&(str==str.toUpperCase()&&(str=str.toLowerCase())||str==str.toLowerCase()&&(str=str.toUpperCase()))){caseChanged=!0,i=-1,e=0;continue}return parseNumeric(x,String(v),isNum,b)}isNum=!1,str=convertBase(str,b,10,x.s),(e=str.indexOf("."))>-1?str=str.replace(".",""):e=str.length}for(i=0;str.charCodeAt(i)===48;i++);for(len=str.length;str.charCodeAt(--len)===48;);if(str=str.slice(i,++len)){if(len-=i,isNum&&BigNumber2.DEBUG&&len>15&&(v>MAX_SAFE_INTEGER||v!==mathfloor(v)))throw Error(tooManyDigits+x.s*v);if((e=e-i-1)>MAX_EXP)x.c=x.e=null;else if(e<MIN_EXP)x.c=[x.e=0];else{if(x.e=e,x.c=[],i=(e+1)%LOG_BASE,e<0&&(i+=LOG_BASE),i<len){for(i&&x.c.push(+str.slice(0,i)),len-=LOG_BASE;i<len;)x.c.push(+str.slice(i,i+=LOG_BASE));i=LOG_BASE-(str=str.slice(i)).length}else i-=len;for(;i--;str+="0");x.c.push(+str)}}else x.c=[x.e=0]}BigNumber2.clone=clone,BigNumber2.ROUND_UP=0,BigNumber2.ROUND_DOWN=1,BigNumber2.ROUND_CEIL=2,BigNumber2.ROUND_FLOOR=3,BigNumber2.ROUND_HALF_UP=4,BigNumber2.ROUND_HALF_DOWN=5,BigNumber2.ROUND_HALF_EVEN=6,BigNumber2.ROUND_HALF_CEIL=7,BigNumber2.ROUND_HALF_FLOOR=8,BigNumber2.EUCLID=9,BigNumber2.config=BigNumber2.set=function(obj){var p,v;if(obj!=null)if(typeof obj=="object"){if(obj.hasOwnProperty(p="DECIMAL_PLACES")&&(v=obj[p],intCheck(v,0,MAX,p),DECIMAL_PLACES=v),obj.hasOwnProperty(p="ROUNDING_MODE")&&(v=obj[p],intCheck(v,0,8,p),ROUNDING_MODE=v),obj.hasOwnProperty(p="EXPONENTIAL_AT")&&(v=obj[p],v&&v.pop?(intCheck(v[0],-MAX,0,p),intCheck(v[1],0,MAX,p),TO_EXP_NEG=v[0],TO_EXP_POS=v[1]):(intCheck(v,-MAX,MAX,p),TO_EXP_NEG=-(TO_EXP_POS=v<0?-v:v))),obj.hasOwnProperty(p="RANGE"))if(v=obj[p],v&&v.pop)intCheck(v[0],-MAX,-1,p),intCheck(v[1],1,MAX,p),MIN_EXP=v[0],MAX_EXP=v[1];else if(intCheck(v,-MAX,MAX,p),v)MIN_EXP=-(MAX_EXP=v<0?-v:v);else throw Error(bignumberError+p+" cannot be zero: "+v);if(obj.hasOwnProperty(p="CRYPTO"))if(v=obj[p],v===!!v)if(v)if(typeof crypto<"u"&&crypto&&(crypto.getRandomValues||crypto.randomBytes))CRYPTO=v;else throw CRYPTO=!v,Error(bignumberError+"crypto unavailable");else CRYPTO=v;else throw Error(bignumberError+p+" not true or false: "+v);if(obj.hasOwnProperty(p="MODULO_MODE")&&(v=obj[p],intCheck(v,0,9,p),MODULO_MODE=v),obj.hasOwnProperty(p="POW_PRECISION")&&(v=obj[p],intCheck(v,0,MAX,p),POW_PRECISION=v),obj.hasOwnProperty(p="FORMAT"))if(v=obj[p],typeof v=="object")FORMAT=v;else throw Error(bignumberError+p+" not an object: "+v);if(obj.hasOwnProperty(p="ALPHABET"))if(v=obj[p],typeof v=="string"&&!/^.?$|[+\-.\s]|(.).*\1/.test(v))alphabetHasNormalDecimalDigits=v.slice(0,10)=="0123456789",ALPHABET=v;else throw Error(bignumberError+p+" invalid: "+v)}else throw Error(bignumberError+"Object expected: "+obj);return{DECIMAL_PLACES,ROUNDING_MODE,EXPONENTIAL_AT:[TO_EXP_NEG,TO_EXP_POS],RANGE:[MIN_EXP,MAX_EXP],CRYPTO,MODULO_MODE,POW_PRECISION,FORMAT,ALPHABET}},BigNumber2.isBigNumber=function(v){if(!v||v._isBigNumber!==!0)return!1;if(!BigNumber2.DEBUG)return!0;var i,n,c=v.c,e=v.e,s=v.s;out:if({}.toString.call(c)=="[object Array]"){if((s===1||s===-1)&&e>=-MAX&&e<=MAX&&e===mathfloor(e)){if(c[0]===0){if(e===0&&c.length===1)return!0;break out}if(i=(e+1)%LOG_BASE,i<1&&(i+=LOG_BASE),String(c[0]).length==i){for(i=0;i<c.length;i++)if(n=c[i],n<0||n>=BASE||n!==mathfloor(n))break out;if(n!==0)return!0}}}else if(c===null&&e===null&&(s===null||s===1||s===-1))return!0;throw Error(bignumberError+"Invalid BigNumber: "+v)},BigNumber2.maximum=BigNumber2.max=function(){return maxOrMin(arguments,-1)},BigNumber2.minimum=BigNumber2.min=function(){return maxOrMin(arguments,1)},BigNumber2.random=(function(){var pow2_53=9007199254740992,random53bitInt=Math.random()*pow2_53&2097151?function(){return mathfloor(Math.random()*pow2_53)}:function(){return(Math.random()*1073741824|0)*8388608+(Math.random()*8388608|0)};return function(dp){var a,b,e,k,v,i=0,c=[],rand=new BigNumber2(ONE);if(dp==null?dp=DECIMAL_PLACES:intCheck(dp,0,MAX),k=mathceil(dp/LOG_BASE),CRYPTO)if(crypto.getRandomValues){for(a=crypto.getRandomValues(new Uint32Array(k*=2));i<k;)v=a[i]*131072+(a[i+1]>>>11),v>=9e15?(b=crypto.getRandomValues(new Uint32Array(2)),a[i]=b[0],a[i+1]=b[1]):(c.push(v%1e14),i+=2);i=k/2}else if(crypto.randomBytes){for(a=crypto.randomBytes(k*=7);i<k;)v=(a[i]&31)*281474976710656+a[i+1]*1099511627776+a[i+2]*4294967296+a[i+3]*16777216+(a[i+4]<<16)+(a[i+5]<<8)+a[i+6],v>=9e15?crypto.randomBytes(7).copy(a,i):(c.push(v%1e14),i+=7);i=k/7}else throw CRYPTO=!1,Error(bignumberError+"crypto unavailable");if(!CRYPTO)for(;i<k;)v=random53bitInt(),v<9e15&&(c[i++]=v%1e14);for(k=c[--i],dp%=LOG_BASE,k&&dp&&(v=POWS_TEN[LOG_BASE-dp],c[i]=mathfloor(k/v)*v);c[i]===0;c.pop(),i--);if(i<0)c=[e=0];else{for(e=-1;c[0]===0;c.splice(0,1),e-=LOG_BASE);for(i=1,v=c[0];v>=10;v/=10,i++);i<LOG_BASE&&(e-=LOG_BASE-i)}return rand.e=e,rand.c=c,rand}})(),BigNumber2.sum=function(){for(var i=1,args=arguments,sum=new BigNumber2(args[0]);i<args.length;)sum=sum.plus(args[i++]);return sum},convertBase=(function(){var decimal="0123456789";function toBaseOut(str,baseIn,baseOut,alphabet){for(var j,arr=[0],arrL,i=0,len=str.length;i<len;){for(arrL=arr.length;arrL--;arr[arrL]*=baseIn);for(arr[0]+=alphabet.indexOf(str.charAt(i++)),j=0;j<arr.length;j++)arr[j]>baseOut-1&&(arr[j+1]==null&&(arr[j+1]=0),arr[j+1]+=arr[j]/baseOut|0,arr[j]%=baseOut)}return arr.reverse()}return function(str,baseIn,baseOut,sign,callerIsToString){var alphabet,d,e,k,r,x,xc,y,i=str.indexOf("."),dp=DECIMAL_PLACES,rm=ROUNDING_MODE;for(i>=0&&(k=POW_PRECISION,POW_PRECISION=0,str=str.replace(".",""),y=new BigNumber2(baseIn),x=y.pow(str.length-i),POW_PRECISION=k,y.c=toBaseOut(toFixedPoint(coeffToString(x.c),x.e,"0"),10,baseOut,decimal),y.e=y.c.length),xc=toBaseOut(str,baseIn,baseOut,callerIsToString?(alphabet=ALPHABET,decimal):(alphabet=decimal,ALPHABET)),e=k=xc.length;xc[--k]==0;xc.pop());if(!xc[0])return alphabet.charAt(0);if(i<0?--e:(x.c=xc,x.e=e,x.s=sign,x=div(x,y,dp,rm,baseOut),xc=x.c,r=x.r,e=x.e),d=e+dp+1,i=xc[d],k=baseOut/2,r=r||d<0||xc[d+1]!=null,r=rm<4?(i!=null||r)&&(rm==0||rm==(x.s<0?3:2)):i>k||i==k&&(rm==4||r||rm==6&&xc[d-1]&1||rm==(x.s<0?8:7)),d<1||!xc[0])str=r?toFixedPoint(alphabet.charAt(1),-dp,alphabet.charAt(0)):alphabet.charAt(0);else{if(xc.length=d,r)for(--baseOut;++xc[--d]>baseOut;)xc[d]=0,d||(++e,xc=[1].concat(xc));for(k=xc.length;!xc[--k];);for(i=0,str="";i<=k;str+=alphabet.charAt(xc[i++]));str=toFixedPoint(str,e,alphabet.charAt(0))}return str}})(),div=(function(){function multiply(x,k,base){var m,temp,xlo,xhi,carry=0,i=x.length,klo=k%SQRT_BASE,khi=k/SQRT_BASE|0;for(x=x.slice();i--;)xlo=x[i]%SQRT_BASE,xhi=x[i]/SQRT_BASE|0,m=khi*xlo+xhi*klo,temp=klo*xlo+m%SQRT_BASE*SQRT_BASE+carry,carry=(temp/base|0)+(m/SQRT_BASE|0)+khi*xhi,x[i]=temp%base;return carry&&(x=[carry].concat(x)),x}function compare2(a,b,aL,bL){var i,cmp;if(aL!=bL)cmp=aL>bL?1:-1;else for(i=cmp=0;i<aL;i++)if(a[i]!=b[i]){cmp=a[i]>b[i]?1:-1;break}return cmp}function subtract(a,b,aL,base){for(var i=0;aL--;)a[aL]-=i,i=a[aL]<b[aL]?1:0,a[aL]=i*base+a[aL]-b[aL];for(;!a[0]&&a.length>1;a.splice(0,1));}return function(x,y,dp,rm,base){var cmp,e,i,more,n,prod,prodL,q,qc,rem,remL,rem0,xi,xL,yc0,yL,yz,s=x.s==y.s?1:-1,xc=x.c,yc=y.c;if(!xc||!xc[0]||!yc||!yc[0])return new BigNumber2(!x.s||!y.s||(xc?yc&&xc[0]==yc[0]:!yc)?NaN:xc&&xc[0]==0||!yc?s*0:s/0);for(q=new BigNumber2(s),qc=q.c=[],e=x.e-y.e,s=dp+e+1,base||(base=BASE,e=bitFloor(x.e/LOG_BASE)-bitFloor(y.e/LOG_BASE),s=s/LOG_BASE|0),i=0;yc[i]==(xc[i]||0);i++);if(yc[i]>(xc[i]||0)&&e--,s<0)qc.push(1),more=!0;else{for(xL=xc.length,yL=yc.length,i=0,s+=2,n=mathfloor(base/(yc[0]+1)),n>1&&(yc=multiply(yc,n,base),xc=multiply(xc,n,base),yL=yc.length,xL=xc.length),xi=yL,rem=xc.slice(0,yL),remL=rem.length;remL<yL;rem[remL++]=0);yz=yc.slice(),yz=[0].concat(yz),yc0=yc[0],yc[1]>=base/2&&yc0++;do{if(n=0,cmp=compare2(yc,rem,yL,remL),cmp<0){if(rem0=rem[0],yL!=remL&&(rem0=rem0*base+(rem[1]||0)),n=mathfloor(rem0/yc0),n>1)for(n>=base&&(n=base-1),prod=multiply(yc,n,base),prodL=prod.length,remL=rem.length;compare2(prod,rem,prodL,remL)==1;)n--,subtract(prod,yL<prodL?yz:yc,prodL,base),prodL=prod.length,cmp=1;else n==0&&(cmp=n=1),prod=yc.slice(),prodL=prod.length;if(prodL<remL&&(prod=[0].concat(prod)),subtract(rem,prod,remL,base),remL=rem.length,cmp==-1)for(;compare2(yc,rem,yL,remL)<1;)n++,subtract(rem,yL<remL?yz:yc,remL,base),remL=rem.length}else cmp===0&&(n++,rem=[0]);qc[i++]=n,rem[0]?rem[remL++]=xc[xi]||0:(rem=[xc[xi]],remL=1)}while((xi++<xL||rem[0]!=null)&&s--);more=rem[0]!=null,qc[0]||qc.splice(0,1)}if(base==BASE){for(i=1,s=qc[0];s>=10;s/=10,i++);round(q,dp+(q.e=i+e*LOG_BASE-1)+1,rm,more)}else q.e=e,q.r=+more;return q}})();function format(n,i,rm,id){var c0,e,ne,len,str;if(rm==null?rm=ROUNDING_MODE:intCheck(rm,0,8),!n.c)return n.toString();if(c0=n.c[0],ne=n.e,i==null)str=coeffToString(n.c),str=id==1||id==2&&(ne<=TO_EXP_NEG||ne>=TO_EXP_POS)?toExponential(str,ne):toFixedPoint(str,ne,"0");else if(n=round(new BigNumber2(n),i,rm),e=n.e,str=coeffToString(n.c),len=str.length,id==1||id==2&&(i<=e||e<=TO_EXP_NEG)){for(;len<i;str+="0",len++);str=toExponential(str,e)}else if(i-=ne+(id===2&&e>ne),str=toFixedPoint(str,e,"0"),e+1>len){if(--i>0)for(str+=".";i--;str+="0");}else if(i+=e-len,i>0)for(e+1==len&&(str+=".");i--;str+="0");return n.s<0&&c0?"-"+str:str}function maxOrMin(args,n){for(var k,y,i=1,x=new BigNumber2(args[0]);i<args.length;i++)y=new BigNumber2(args[i]),(!y.s||(k=compare(x,y))===n||k===0&&x.s===n)&&(x=y);return x}function normalise(n,c,e){for(var i=1,j=c.length;!c[--j];c.pop());for(j=c[0];j>=10;j/=10,i++);return(e=i+e*LOG_BASE-1)>MAX_EXP?n.c=n.e=null:e<MIN_EXP?n.c=[n.e=0]:(n.e=e,n.c=c),n}parseNumeric=(function(){var basePrefix=/^(-?)0([xbo])(?=\w[\w.]*$)/i,dotAfter=/^([^.]+)\.$/,dotBefore=/^\.([^.]+)$/,isInfinityOrNaN=/^-?(Infinity|NaN)$/,whitespaceOrPlus=/^\s*\+(?=[\w.])|^\s+|\s+$/g;return function(x,str,isNum,b){var base,s=isNum?str:str.replace(whitespaceOrPlus,"");if(isInfinityOrNaN.test(s))x.s=isNaN(s)?null:s<0?-1:1;else{if(!isNum&&(s=s.replace(basePrefix,function(m,p1,p2){return base=(p2=p2.toLowerCase())=="x"?16:p2=="b"?2:8,!b||b==base?p1:m}),b&&(base=b,s=s.replace(dotAfter,"$1").replace(dotBefore,"0.$1")),str!=s))return new BigNumber2(s,base);if(BigNumber2.DEBUG)throw Error(bignumberError+"Not a"+(b?" base "+b:"")+" number: "+str);x.s=null}x.c=x.e=null}})();function round(x,sd,rm,r){var d,i,j,k,n,ni,rd,xc=x.c,pows10=POWS_TEN;if(xc){out:{for(d=1,k=xc[0];k>=10;k/=10,d++);if(i=sd-d,i<0)i+=LOG_BASE,j=sd,n=xc[ni=0],rd=mathfloor(n/pows10[d-j-1]%10);else if(ni=mathceil((i+1)/LOG_BASE),ni>=xc.length)if(r){for(;xc.length<=ni;xc.push(0));n=rd=0,d=1,i%=LOG_BASE,j=i-LOG_BASE+1}else break out;else{for(n=k=xc[ni],d=1;k>=10;k/=10,d++);i%=LOG_BASE,j=i-LOG_BASE+d,rd=j<0?0:mathfloor(n/pows10[d-j-1]%10)}if(r=r||sd<0||xc[ni+1]!=null||(j<0?n:n%pows10[d-j-1]),r=rm<4?(rd||r)&&(rm==0||rm==(x.s<0?3:2)):rd>5||rd==5&&(rm==4||r||rm==6&&(i>0?j>0?n/pows10[d-j]:0:xc[ni-1])%10&1||rm==(x.s<0?8:7)),sd<1||!xc[0])return xc.length=0,r?(sd-=x.e+1,xc[0]=pows10[(LOG_BASE-sd%LOG_BASE)%LOG_BASE],x.e=-sd||0):xc[0]=x.e=0,x;if(i==0?(xc.length=ni,k=1,ni--):(xc.length=ni+1,k=pows10[LOG_BASE-i],xc[ni]=j>0?mathfloor(n/pows10[d-j]%pows10[j])*k:0),r)for(;;)if(ni==0){for(i=1,j=xc[0];j>=10;j/=10,i++);for(j=xc[0]+=k,k=1;j>=10;j/=10,k++);i!=k&&(x.e++,xc[0]==BASE&&(xc[0]=1));break}else{if(xc[ni]+=k,xc[ni]!=BASE)break;xc[ni--]=0,k=1}for(i=xc.length;xc[--i]===0;xc.pop());}x.e>MAX_EXP?x.c=x.e=null:x.e<MIN_EXP&&(x.c=[x.e=0])}return x}function valueOf(n){var str,e=n.e;return e===null?n.toString():(str=coeffToString(n.c),str=e<=TO_EXP_NEG||e>=TO_EXP_POS?toExponential(str,e):toFixedPoint(str,e,"0"),n.s<0?"-"+str:str)}return P.absoluteValue=P.abs=function(){var x=new BigNumber2(this);return x.s<0&&(x.s=1),x},P.comparedTo=function(y,b){return compare(this,new BigNumber2(y,b))},P.decimalPlaces=P.dp=function(dp,rm){var c,n,v,x=this;if(dp!=null)return intCheck(dp,0,MAX),rm==null?rm=ROUNDING_MODE:intCheck(rm,0,8),round(new BigNumber2(x),dp+x.e+1,rm);if(!(c=x.c))return null;if(n=((v=c.length-1)-bitFloor(this.e/LOG_BASE))*LOG_BASE,v=c[v])for(;v%10==0;v/=10,n--);return n<0&&(n=0),n},P.dividedBy=P.div=function(y,b){return div(this,new BigNumber2(y,b),DECIMAL_PLACES,ROUNDING_MODE)},P.dividedToIntegerBy=P.idiv=function(y,b){return div(this,new BigNumber2(y,b),0,1)},P.exponentiatedBy=P.pow=function(n,m){var half,isModExp,i,k,more,nIsBig,nIsNeg,nIsOdd,y,x=this;if(n=new BigNumber2(n),n.c&&!n.isInteger())throw Error(bignumberError+"Exponent not an integer: "+valueOf(n));if(m!=null&&(m=new BigNumber2(m)),nIsBig=n.e>14,!x.c||!x.c[0]||x.c[0]==1&&!x.e&&x.c.length==1||!n.c||!n.c[0])return y=new BigNumber2(Math.pow(+valueOf(x),nIsBig?n.s*(2-isOdd(n)):+valueOf(n))),m?y.mod(m):y;if(nIsNeg=n.s<0,m){if(m.c?!m.c[0]:!m.s)return new BigNumber2(NaN);isModExp=!nIsNeg&&x.isInteger()&&m.isInteger(),isModExp&&(x=x.mod(m))}else{if(n.e>9&&(x.e>0||x.e<-1||(x.e==0?x.c[0]>1||nIsBig&&x.c[1]>=24e7:x.c[0]<8e13||nIsBig&&x.c[0]<=9999975e7)))return k=x.s<0&&isOdd(n)?-0:0,x.e>-1&&(k=1/k),new BigNumber2(nIsNeg?1/k:k);POW_PRECISION&&(k=mathceil(POW_PRECISION/LOG_BASE+2))}for(nIsBig?(half=new BigNumber2(.5),nIsNeg&&(n.s=1),nIsOdd=isOdd(n)):(i=Math.abs(+valueOf(n)),nIsOdd=i%2),y=new BigNumber2(ONE);;){if(nIsOdd){if(y=y.times(x),!y.c)break;k?y.c.length>k&&(y.c.length=k):isModExp&&(y=y.mod(m))}if(i){if(i=mathfloor(i/2),i===0)break;nIsOdd=i%2}else if(n=n.times(half),round(n,n.e+1,1),n.e>14)nIsOdd=isOdd(n);else{if(i=+valueOf(n),i===0)break;nIsOdd=i%2}x=x.times(x),k?x.c&&x.c.length>k&&(x.c.length=k):isModExp&&(x=x.mod(m))}return isModExp?y:(nIsNeg&&(y=ONE.div(y)),m?y.mod(m):k?round(y,POW_PRECISION,ROUNDING_MODE,more):y)},P.integerValue=function(rm){var n=new BigNumber2(this);return rm==null?rm=ROUNDING_MODE:intCheck(rm,0,8),round(n,n.e+1,rm)},P.isEqualTo=P.eq=function(y,b){return compare(this,new BigNumber2(y,b))===0},P.isFinite=function(){return!!this.c},P.isGreaterThan=P.gt=function(y,b){return compare(this,new BigNumber2(y,b))>0},P.isGreaterThanOrEqualTo=P.gte=function(y,b){return(b=compare(this,new BigNumber2(y,b)))===1||b===0},P.isInteger=function(){return!!this.c&&bitFloor(this.e/LOG_BASE)>this.c.length-2},P.isLessThan=P.lt=function(y,b){return compare(this,new BigNumber2(y,b))<0},P.isLessThanOrEqualTo=P.lte=function(y,b){return(b=compare(this,new BigNumber2(y,b)))===-1||b===0},P.isNaN=function(){return!this.s},P.isNegative=function(){return this.s<0},P.isPositive=function(){return this.s>0},P.isZero=function(){return!!this.c&&this.c[0]==0},P.minus=function(y,b){var i,j,t,xLTy,x=this,a=x.s;if(y=new BigNumber2(y,b),b=y.s,!a||!b)return new BigNumber2(NaN);if(a!=b)return y.s=-b,x.plus(y);var xe=x.e/LOG_BASE,ye=y.e/LOG_BASE,xc=x.c,yc=y.c;if(!xe||!ye){if(!xc||!yc)return xc?(y.s=-b,y):new BigNumber2(yc?x:NaN);if(!xc[0]||!yc[0])return yc[0]?(y.s=-b,y):new BigNumber2(xc[0]?x:ROUNDING_MODE==3?-0:0)}if(xe=bitFloor(xe),ye=bitFloor(ye),xc=xc.slice(),a=xe-ye){for((xLTy=a<0)?(a=-a,t=xc):(ye=xe,t=yc),t.reverse(),b=a;b--;t.push(0));t.reverse()}else for(j=(xLTy=(a=xc.length)<(b=yc.length))?a:b,a=b=0;b<j;b++)if(xc[b]!=yc[b]){xLTy=xc[b]<yc[b];break}if(xLTy&&(t=xc,xc=yc,yc=t,y.s=-y.s),b=(j=yc.length)-(i=xc.length),b>0)for(;b--;xc[i++]=0);for(b=BASE-1;j>a;){if(xc[--j]<yc[j]){for(i=j;i&&!xc[--i];xc[i]=b);--xc[i],xc[j]+=BASE}xc[j]-=yc[j]}for(;xc[0]==0;xc.splice(0,1),--ye);return xc[0]?normalise(y,xc,ye):(y.s=ROUNDING_MODE==3?-1:1,y.c=[y.e=0],y)},P.modulo=P.mod=function(y,b){var q,s,x=this;return y=new BigNumber2(y,b),!x.c||!y.s||y.c&&!y.c[0]?new BigNumber2(NaN):!y.c||x.c&&!x.c[0]?new BigNumber2(x):(MODULO_MODE==9?(s=y.s,y.s=1,q=div(x,y,0,3),y.s=s,q.s*=s):q=div(x,y,0,MODULO_MODE),y=x.minus(q.times(y)),!y.c[0]&&MODULO_MODE==1&&(y.s=x.s),y)},P.multipliedBy=P.times=function(y,b){var c,e,i,j,k,m,xcL,xlo,xhi,ycL,ylo,yhi,zc,base,sqrtBase,x=this,xc=x.c,yc=(y=new BigNumber2(y,b)).c;if(!xc||!yc||!xc[0]||!yc[0])return!x.s||!y.s||xc&&!xc[0]&&!yc||yc&&!yc[0]&&!xc?y.c=y.e=y.s=null:(y.s*=x.s,!xc||!yc?y.c=y.e=null:(y.c=[0],y.e=0)),y;for(e=bitFloor(x.e/LOG_BASE)+bitFloor(y.e/LOG_BASE),y.s*=x.s,xcL=xc.length,ycL=yc.length,xcL<ycL&&(zc=xc,xc=yc,yc=zc,i=xcL,xcL=ycL,ycL=i),i=xcL+ycL,zc=[];i--;zc.push(0));for(base=BASE,sqrtBase=SQRT_BASE,i=ycL;--i>=0;){for(c=0,ylo=yc[i]%sqrtBase,yhi=yc[i]/sqrtBase|0,k=xcL,j=i+k;j>i;)xlo=xc[--k]%sqrtBase,xhi=xc[k]/sqrtBase|0,m=yhi*xlo+xhi*ylo,xlo=ylo*xlo+m%sqrtBase*sqrtBase+zc[j]+c,c=(xlo/base|0)+(m/sqrtBase|0)+yhi*xhi,zc[j--]=xlo%base;zc[j]=c}return c?++e:zc.splice(0,1),normalise(y,zc,e)},P.negated=function(){var x=new BigNumber2(this);return x.s=-x.s||null,x},P.plus=function(y,b){var t,x=this,a=x.s;if(y=new BigNumber2(y,b),b=y.s,!a||!b)return new BigNumber2(NaN);if(a!=b)return y.s=-b,x.minus(y);var xe=x.e/LOG_BASE,ye=y.e/LOG_BASE,xc=x.c,yc=y.c;if(!xe||!ye){if(!xc||!yc)return new BigNumber2(a/0);if(!xc[0]||!yc[0])return yc[0]?y:new BigNumber2(xc[0]?x:a*0)}if(xe=bitFloor(xe),ye=bitFloor(ye),xc=xc.slice(),a=xe-ye){for(a>0?(ye=xe,t=yc):(a=-a,t=xc),t.reverse();a--;t.push(0));t.reverse()}for(a=xc.length,b=yc.length,a-b<0&&(t=yc,yc=xc,xc=t,b=a),a=0;b;)a=(xc[--b]=xc[b]+yc[b]+a)/BASE|0,xc[b]=BASE===xc[b]?0:xc[b]%BASE;return a&&(xc=[a].concat(xc),++ye),normalise(y,xc,ye)},P.precision=P.sd=function(sd,rm){var c,n,v,x=this;if(sd!=null&&sd!==!!sd)return intCheck(sd,1,MAX),rm==null?rm=ROUNDING_MODE:intCheck(rm,0,8),round(new BigNumber2(x),sd,rm);if(!(c=x.c))return null;if(v=c.length-1,n=v*LOG_BASE+1,v=c[v]){for(;v%10==0;v/=10,n--);for(v=c[0];v>=10;v/=10,n++);}return sd&&x.e+1>n&&(n=x.e+1),n},P.shiftedBy=function(k){return intCheck(k,-MAX_SAFE_INTEGER,MAX_SAFE_INTEGER),this.times("1e"+k)},P.squareRoot=P.sqrt=function(){var m,n,r,rep,t,x=this,c=x.c,s=x.s,e=x.e,dp=DECIMAL_PLACES+4,half=new BigNumber2("0.5");if(s!==1||!c||!c[0])return new BigNumber2(!s||s<0&&(!c||c[0])?NaN:c?x:1/0);if(s=Math.sqrt(+valueOf(x)),s==0||s==1/0?(n=coeffToString(c),(n.length+e)%2==0&&(n+="0"),s=Math.sqrt(+n),e=bitFloor((e+1)/2)-(e<0||e%2),s==1/0?n="5e"+e:(n=s.toExponential(),n=n.slice(0,n.indexOf("e")+1)+e),r=new BigNumber2(n)):r=new BigNumber2(s+""),r.c[0]){for(e=r.e,s=e+dp,s<3&&(s=0);;)if(t=r,r=half.times(t.plus(div(x,t,dp,1))),coeffToString(t.c).slice(0,s)===(n=coeffToString(r.c)).slice(0,s))if(r.e<e&&--s,n=n.slice(s-3,s+1),n=="9999"||!rep&&n=="4999"){if(!rep&&(round(t,t.e+DECIMAL_PLACES+2,0),t.times(t).eq(x))){r=t;break}dp+=4,s+=4,rep=1}else{(!+n||!+n.slice(1)&&n.charAt(0)=="5")&&(round(r,r.e+DECIMAL_PLACES+2,1),m=!r.times(r).eq(x));break}}return round(r,r.e+DECIMAL_PLACES+1,ROUNDING_MODE,m)},P.toExponential=function(dp,rm){return dp!=null&&(intCheck(dp,0,MAX),dp++),format(this,dp,rm,1)},P.toFixed=function(dp,rm){return dp!=null&&(intCheck(dp,0,MAX),dp=dp+this.e+1),format(this,dp,rm)},P.toFormat=function(dp,rm,format2){var str,x=this;if(format2==null)dp!=null&&rm&&typeof rm=="object"?(format2=rm,rm=null):dp&&typeof dp=="object"?(format2=dp,dp=rm=null):format2=FORMAT;else if(typeof format2!="object")throw Error(bignumberError+"Argument not an object: "+format2);if(str=x.toFixed(dp,rm),x.c){var i,arr=str.split("."),g1=+format2.groupSize,g2=+format2.secondaryGroupSize,groupSeparator=format2.groupSeparator||"",intPart=arr[0],fractionPart=arr[1],isNeg=x.s<0,intDigits=isNeg?intPart.slice(1):intPart,len=intDigits.length;if(g2&&(i=g1,g1=g2,g2=i,len-=i),g1>0&&len>0){for(i=len%g1||g1,intPart=intDigits.substr(0,i);i<len;i+=g1)intPart+=groupSeparator+intDigits.substr(i,g1);g2>0&&(intPart+=groupSeparator+intDigits.slice(i)),isNeg&&(intPart="-"+intPart)}str=fractionPart?intPart+(format2.decimalSeparator||"")+((g2=+format2.fractionGroupSize)?fractionPart.replace(new RegExp("\\d{"+g2+"}\\B","g"),"$&"+(format2.fractionGroupSeparator||"")):fractionPart):intPart}return(format2.prefix||"")+str+(format2.suffix||"")},P.toFraction=function(md){var d,d0,d1,d2,e,exp,n,n0,n1,q,r,s,x=this,xc=x.c;if(md!=null&&(n=new BigNumber2(md),!n.isInteger()&&(n.c||n.s!==1)||n.lt(ONE)))throw Error(bignumberError+"Argument "+(n.isInteger()?"out of range: ":"not an integer: ")+valueOf(n));if(!xc)return new BigNumber2(x);for(d=new BigNumber2(ONE),n1=d0=new BigNumber2(ONE),d1=n0=new BigNumber2(ONE),s=coeffToString(xc),e=d.e=s.length-x.e-1,d.c[0]=POWS_TEN[(exp=e%LOG_BASE)<0?LOG_BASE+exp:exp],md=!md||n.comparedTo(d)>0?e>0?d:n1:n,exp=MAX_EXP,MAX_EXP=1/0,n=new BigNumber2(s),n0.c[0]=0;q=div(n,d,0,1),d2=d0.plus(q.times(d1)),d2.comparedTo(md)!=1;)d0=d1,d1=d2,n1=n0.plus(q.times(d2=n1)),n0=d2,d=n.minus(q.times(d2=d)),n=d2;return d2=div(md.minus(d0),d1,0,1),n0=n0.plus(d2.times(n1)),d0=d0.plus(d2.times(d1)),n0.s=n1.s=x.s,e=e*2,r=div(n1,d1,e,ROUNDING_MODE).minus(x).abs().comparedTo(div(n0,d0,e,ROUNDING_MODE).minus(x).abs())<1?[n1,d1]:[n0,d0],MAX_EXP=exp,r},P.toNumber=function(){return+valueOf(this)},P.toPrecision=function(sd,rm){return sd!=null&&intCheck(sd,1,MAX),format(this,sd,rm,2)},P.toString=function(b){var str,n=this,s=n.s,e=n.e;return e===null?s?(str="Infinity",s<0&&(str="-"+str)):str="NaN":(b==null?str=e<=TO_EXP_NEG||e>=TO_EXP_POS?toExponential(coeffToString(n.c),e):toFixedPoint(coeffToString(n.c),e,"0"):b===10&&alphabetHasNormalDecimalDigits?(n=round(new BigNumber2(n),DECIMAL_PLACES+e+1,ROUNDING_MODE),str=toFixedPoint(coeffToString(n.c),n.e,"0")):(intCheck(b,2,ALPHABET.length,"Base"),str=convertBase(toFixedPoint(coeffToString(n.c),e,"0"),10,b,s,!0)),s<0&&n.c[0]&&(str="-"+str)),str},P.valueOf=P.toJSON=function(){return valueOf(this)},P._isBigNumber=!0,configObject!=null&&BigNumber2.set(configObject),BigNumber2}function bitFloor(n){var i=n|0;return n>0||n===i?i:i-1}function coeffToString(a){for(var s,z,i=1,j=a.length,r=a[0]+"";i<j;){for(s=a[i++]+"",z=LOG_BASE-s.length;z--;s="0"+s);r+=s}for(j=r.length;r.charCodeAt(--j)===48;);return r.slice(0,j+1||1)}function compare(x,y){var a,b,xc=x.c,yc=y.c,i=x.s,j=y.s,k=x.e,l=y.e;if(!i||!j)return null;if(a=xc&&!xc[0],b=yc&&!yc[0],a||b)return a?b?0:-j:i;if(i!=j)return i;if(a=i<0,b=k==l,!xc||!yc)return b?0:!xc^a?1:-1;if(!b)return k>l^a?1:-1;for(j=(k=xc.length)<(l=yc.length)?k:l,i=0;i<j;i++)if(xc[i]!=yc[i])return xc[i]>yc[i]^a?1:-1;return k==l?0:k>l^a?1:-1}function intCheck(n,min,max,name){if(n<min||n>max||n!==mathfloor(n))throw Error(bignumberError+(name||"Argument")+(typeof n=="number"?n<min||n>max?" out of range: ":" not an integer: ":" not a primitive number: ")+String(n))}function isOdd(n){var k=n.c.length-1;return bitFloor(n.e/LOG_BASE)==k&&n.c[k]%2!=0}function toExponential(str,e){return(str.length>1?str.charAt(0)+"."+str.slice(1):str)+(e<0?"e":"e+")+e}function toFixedPoint(str,e,z){var len,zs;if(e<0){for(zs=z+".";++e;zs+=z);str=zs+str}else if(len=str.length,++e>len){for(zs=z,e-=len;--e;zs+=z);str+=zs}else e<len&&(str=str.slice(0,e)+"."+str.slice(e));return str}BigNumber=clone(),BigNumber.default=BigNumber.BigNumber=BigNumber,typeof define=="function"&&define.amd?define(function(){return BigNumber}):typeof module<"u"&&module.exports?module.exports=BigNumber:(globalObject||(globalObject=typeof self<"u"&&self?self:window),globalObject.BigNumber=BigNumber)})(exports)}});var require_stringify=__commonJS({"node_modules/json-bigint/lib/stringify.js"(exports,module){var BigNumber=require_bignumber(),JSON2=module.exports;(function(){"use strict";function f(n){return n<10?"0"+n:n}var cx=/[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,escapable=/[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,gap,indent,meta={"\b":"\\b"," ":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"},rep;function quote(string){return escapable.lastIndex=0,escapable.test(string)?'"'+string.replace(escapable,function(a){var c=meta[a];return typeof c=="string"?c:"\\u"+("0000"+a.charCodeAt(0).toString(16)).slice(-4)})+'"':'"'+string+'"'}function str(key,holder){var i,k,v,length,mind=gap,partial,value=holder[key],isBigNumber=value!=null&&(value instanceof BigNumber||BigNumber.isBigNumber(value));switch(value&&typeof value=="object"&&typeof value.toJSON=="function"&&(value=value.toJSON(key)),typeof rep=="function"&&(value=rep.call(holder,key,value)),typeof value){case"string":return isBigNumber?value:quote(value);case"number":return isFinite(value)?String(value):"null";case"boolean":case"null":case"bigint":return String(value);case"object":if(!value)return"null";if(gap+=indent,partial=[],Object.prototype.toString.apply(value)==="[object Array]"){for(length=value.length,i=0;i<length;i+=1)partial[i]=str(i,value)||"null";return v=partial.length===0?"[]":gap?`[
7
+ `}yield finale}static#proxyAgent;static#fetch;static async#getProxyAgent(){return this.#proxyAgent||=(await import("./https-proxy-agent-2VXB7436.js")).HttpsProxyAgent,this.#proxyAgent}static async#getFetch(){let hasWindow=typeof window<"u"&&!!window;return this.#fetch||=hasWindow?window.fetch:(await import("./src-UK77SYZE.js")).default,this.#fetch}static mergeHeaders(base,...append){base=base instanceof Headers?base:new Headers(base);for(let headers of append)(headers instanceof Headers?headers:new Headers(headers)).forEach((value,key)=>{key==="set-cookie"?base.append(key,value):base.set(key,value)});return base}};exports.Gaxios=Gaxios;_a2=Gaxios}});var require_src=__commonJS({"node_modules/gaxios/build/cjs/src/index.js"(exports){"use strict";var __createBinding=exports&&exports.__createBinding||(Object.create?(function(o,m,k,k2){k2===void 0&&(k2=k);var desc=Object.getOwnPropertyDescriptor(m,k);(!desc||("get"in desc?!m.__esModule:desc.writable||desc.configurable))&&(desc={enumerable:!0,get:function(){return m[k]}}),Object.defineProperty(o,k2,desc)}):(function(o,m,k,k2){k2===void 0&&(k2=k),o[k2]=m[k]})),__exportStar=exports&&exports.__exportStar||function(m,exports2){for(var p in m)p!=="default"&&!Object.prototype.hasOwnProperty.call(exports2,p)&&__createBinding(exports2,m,p)};Object.defineProperty(exports,"__esModule",{value:!0});exports.instance=exports.Gaxios=exports.GaxiosError=void 0;exports.request=request;var gaxios_js_1=require_gaxios();Object.defineProperty(exports,"Gaxios",{enumerable:!0,get:function(){return gaxios_js_1.Gaxios}});var common_js_1=require_common();Object.defineProperty(exports,"GaxiosError",{enumerable:!0,get:function(){return common_js_1.GaxiosError}});__exportStar(require_interceptor(),exports);exports.instance=new gaxios_js_1.Gaxios;async function request(opts){return exports.instance.request(opts)}}});var require_bignumber=__commonJS({"node_modules/bignumber.js/bignumber.js"(exports,module){(function(globalObject){"use strict";var BigNumber,isNumeric=/^-?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?$/i,mathceil=Math.ceil,mathfloor=Math.floor,bignumberError="[BigNumber Error] ",tooManyDigits=bignumberError+"Number primitive has more than 15 significant digits: ",BASE=1e14,LOG_BASE=14,MAX_SAFE_INTEGER=9007199254740991,POWS_TEN=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8,1e9,1e10,1e11,1e12,1e13],SQRT_BASE=1e7,MAX=1e9;function clone(configObject){var div,convertBase,parseNumeric,P=BigNumber2.prototype={constructor:BigNumber2,toString:null,valueOf:null},ONE=new BigNumber2(1),DECIMAL_PLACES=20,ROUNDING_MODE=4,TO_EXP_NEG=-7,TO_EXP_POS=21,MIN_EXP=-1e7,MAX_EXP=1e7,CRYPTO=!1,MODULO_MODE=1,POW_PRECISION=0,FORMAT={prefix:"",groupSize:3,secondaryGroupSize:0,groupSeparator:",",decimalSeparator:".",fractionGroupSize:0,fractionGroupSeparator:"\xA0",suffix:""},ALPHABET="0123456789abcdefghijklmnopqrstuvwxyz",alphabetHasNormalDecimalDigits=!0;function BigNumber2(v,b){var alphabet,c,caseChanged,e,i,isNum,len,str,x=this;if(!(x instanceof BigNumber2))return new BigNumber2(v,b);if(b==null){if(v&&v._isBigNumber===!0){x.s=v.s,!v.c||v.e>MAX_EXP?x.c=x.e=null:v.e<MIN_EXP?x.c=[x.e=0]:(x.e=v.e,x.c=v.c.slice());return}if((isNum=typeof v=="number")&&v*0==0){if(x.s=1/v<0?(v=-v,-1):1,v===~~v){for(e=0,i=v;i>=10;i/=10,e++);e>MAX_EXP?x.c=x.e=null:(x.e=e,x.c=[v]);return}str=String(v)}else{if(!isNumeric.test(str=String(v)))return parseNumeric(x,str,isNum);x.s=str.charCodeAt(0)==45?(str=str.slice(1),-1):1}(e=str.indexOf("."))>-1&&(str=str.replace(".","")),(i=str.search(/e/i))>0?(e<0&&(e=i),e+=+str.slice(i+1),str=str.substring(0,i)):e<0&&(e=str.length)}else{if(intCheck(b,2,ALPHABET.length,"Base"),b==10&&alphabetHasNormalDecimalDigits)return x=new BigNumber2(v),round(x,DECIMAL_PLACES+x.e+1,ROUNDING_MODE);if(str=String(v),isNum=typeof v=="number"){if(v*0!=0)return parseNumeric(x,str,isNum,b);if(x.s=1/v<0?(str=str.slice(1),-1):1,BigNumber2.DEBUG&&str.replace(/^0\.0*|\./,"").length>15)throw Error(tooManyDigits+v)}else x.s=str.charCodeAt(0)===45?(str=str.slice(1),-1):1;for(alphabet=ALPHABET.slice(0,b),e=i=0,len=str.length;i<len;i++)if(alphabet.indexOf(c=str.charAt(i))<0){if(c=="."){if(i>e){e=len;continue}}else if(!caseChanged&&(str==str.toUpperCase()&&(str=str.toLowerCase())||str==str.toLowerCase()&&(str=str.toUpperCase()))){caseChanged=!0,i=-1,e=0;continue}return parseNumeric(x,String(v),isNum,b)}isNum=!1,str=convertBase(str,b,10,x.s),(e=str.indexOf("."))>-1?str=str.replace(".",""):e=str.length}for(i=0;str.charCodeAt(i)===48;i++);for(len=str.length;str.charCodeAt(--len)===48;);if(str=str.slice(i,++len)){if(len-=i,isNum&&BigNumber2.DEBUG&&len>15&&(v>MAX_SAFE_INTEGER||v!==mathfloor(v)))throw Error(tooManyDigits+x.s*v);if((e=e-i-1)>MAX_EXP)x.c=x.e=null;else if(e<MIN_EXP)x.c=[x.e=0];else{if(x.e=e,x.c=[],i=(e+1)%LOG_BASE,e<0&&(i+=LOG_BASE),i<len){for(i&&x.c.push(+str.slice(0,i)),len-=LOG_BASE;i<len;)x.c.push(+str.slice(i,i+=LOG_BASE));i=LOG_BASE-(str=str.slice(i)).length}else i-=len;for(;i--;str+="0");x.c.push(+str)}}else x.c=[x.e=0]}BigNumber2.clone=clone,BigNumber2.ROUND_UP=0,BigNumber2.ROUND_DOWN=1,BigNumber2.ROUND_CEIL=2,BigNumber2.ROUND_FLOOR=3,BigNumber2.ROUND_HALF_UP=4,BigNumber2.ROUND_HALF_DOWN=5,BigNumber2.ROUND_HALF_EVEN=6,BigNumber2.ROUND_HALF_CEIL=7,BigNumber2.ROUND_HALF_FLOOR=8,BigNumber2.EUCLID=9,BigNumber2.config=BigNumber2.set=function(obj){var p,v;if(obj!=null)if(typeof obj=="object"){if(obj.hasOwnProperty(p="DECIMAL_PLACES")&&(v=obj[p],intCheck(v,0,MAX,p),DECIMAL_PLACES=v),obj.hasOwnProperty(p="ROUNDING_MODE")&&(v=obj[p],intCheck(v,0,8,p),ROUNDING_MODE=v),obj.hasOwnProperty(p="EXPONENTIAL_AT")&&(v=obj[p],v&&v.pop?(intCheck(v[0],-MAX,0,p),intCheck(v[1],0,MAX,p),TO_EXP_NEG=v[0],TO_EXP_POS=v[1]):(intCheck(v,-MAX,MAX,p),TO_EXP_NEG=-(TO_EXP_POS=v<0?-v:v))),obj.hasOwnProperty(p="RANGE"))if(v=obj[p],v&&v.pop)intCheck(v[0],-MAX,-1,p),intCheck(v[1],1,MAX,p),MIN_EXP=v[0],MAX_EXP=v[1];else if(intCheck(v,-MAX,MAX,p),v)MIN_EXP=-(MAX_EXP=v<0?-v:v);else throw Error(bignumberError+p+" cannot be zero: "+v);if(obj.hasOwnProperty(p="CRYPTO"))if(v=obj[p],v===!!v)if(v)if(typeof crypto<"u"&&crypto&&(crypto.getRandomValues||crypto.randomBytes))CRYPTO=v;else throw CRYPTO=!v,Error(bignumberError+"crypto unavailable");else CRYPTO=v;else throw Error(bignumberError+p+" not true or false: "+v);if(obj.hasOwnProperty(p="MODULO_MODE")&&(v=obj[p],intCheck(v,0,9,p),MODULO_MODE=v),obj.hasOwnProperty(p="POW_PRECISION")&&(v=obj[p],intCheck(v,0,MAX,p),POW_PRECISION=v),obj.hasOwnProperty(p="FORMAT"))if(v=obj[p],typeof v=="object")FORMAT=v;else throw Error(bignumberError+p+" not an object: "+v);if(obj.hasOwnProperty(p="ALPHABET"))if(v=obj[p],typeof v=="string"&&!/^.?$|[+\-.\s]|(.).*\1/.test(v))alphabetHasNormalDecimalDigits=v.slice(0,10)=="0123456789",ALPHABET=v;else throw Error(bignumberError+p+" invalid: "+v)}else throw Error(bignumberError+"Object expected: "+obj);return{DECIMAL_PLACES,ROUNDING_MODE,EXPONENTIAL_AT:[TO_EXP_NEG,TO_EXP_POS],RANGE:[MIN_EXP,MAX_EXP],CRYPTO,MODULO_MODE,POW_PRECISION,FORMAT,ALPHABET}},BigNumber2.isBigNumber=function(v){if(!v||v._isBigNumber!==!0)return!1;if(!BigNumber2.DEBUG)return!0;var i,n,c=v.c,e=v.e,s=v.s;out:if({}.toString.call(c)=="[object Array]"){if((s===1||s===-1)&&e>=-MAX&&e<=MAX&&e===mathfloor(e)){if(c[0]===0){if(e===0&&c.length===1)return!0;break out}if(i=(e+1)%LOG_BASE,i<1&&(i+=LOG_BASE),String(c[0]).length==i){for(i=0;i<c.length;i++)if(n=c[i],n<0||n>=BASE||n!==mathfloor(n))break out;if(n!==0)return!0}}}else if(c===null&&e===null&&(s===null||s===1||s===-1))return!0;throw Error(bignumberError+"Invalid BigNumber: "+v)},BigNumber2.maximum=BigNumber2.max=function(){return maxOrMin(arguments,-1)},BigNumber2.minimum=BigNumber2.min=function(){return maxOrMin(arguments,1)},BigNumber2.random=(function(){var pow2_53=9007199254740992,random53bitInt=Math.random()*pow2_53&2097151?function(){return mathfloor(Math.random()*pow2_53)}:function(){return(Math.random()*1073741824|0)*8388608+(Math.random()*8388608|0)};return function(dp){var a,b,e,k,v,i=0,c=[],rand=new BigNumber2(ONE);if(dp==null?dp=DECIMAL_PLACES:intCheck(dp,0,MAX),k=mathceil(dp/LOG_BASE),CRYPTO)if(crypto.getRandomValues){for(a=crypto.getRandomValues(new Uint32Array(k*=2));i<k;)v=a[i]*131072+(a[i+1]>>>11),v>=9e15?(b=crypto.getRandomValues(new Uint32Array(2)),a[i]=b[0],a[i+1]=b[1]):(c.push(v%1e14),i+=2);i=k/2}else if(crypto.randomBytes){for(a=crypto.randomBytes(k*=7);i<k;)v=(a[i]&31)*281474976710656+a[i+1]*1099511627776+a[i+2]*4294967296+a[i+3]*16777216+(a[i+4]<<16)+(a[i+5]<<8)+a[i+6],v>=9e15?crypto.randomBytes(7).copy(a,i):(c.push(v%1e14),i+=7);i=k/7}else throw CRYPTO=!1,Error(bignumberError+"crypto unavailable");if(!CRYPTO)for(;i<k;)v=random53bitInt(),v<9e15&&(c[i++]=v%1e14);for(k=c[--i],dp%=LOG_BASE,k&&dp&&(v=POWS_TEN[LOG_BASE-dp],c[i]=mathfloor(k/v)*v);c[i]===0;c.pop(),i--);if(i<0)c=[e=0];else{for(e=-1;c[0]===0;c.splice(0,1),e-=LOG_BASE);for(i=1,v=c[0];v>=10;v/=10,i++);i<LOG_BASE&&(e-=LOG_BASE-i)}return rand.e=e,rand.c=c,rand}})(),BigNumber2.sum=function(){for(var i=1,args=arguments,sum=new BigNumber2(args[0]);i<args.length;)sum=sum.plus(args[i++]);return sum},convertBase=(function(){var decimal="0123456789";function toBaseOut(str,baseIn,baseOut,alphabet){for(var j,arr=[0],arrL,i=0,len=str.length;i<len;){for(arrL=arr.length;arrL--;arr[arrL]*=baseIn);for(arr[0]+=alphabet.indexOf(str.charAt(i++)),j=0;j<arr.length;j++)arr[j]>baseOut-1&&(arr[j+1]==null&&(arr[j+1]=0),arr[j+1]+=arr[j]/baseOut|0,arr[j]%=baseOut)}return arr.reverse()}return function(str,baseIn,baseOut,sign,callerIsToString){var alphabet,d,e,k,r,x,xc,y,i=str.indexOf("."),dp=DECIMAL_PLACES,rm=ROUNDING_MODE;for(i>=0&&(k=POW_PRECISION,POW_PRECISION=0,str=str.replace(".",""),y=new BigNumber2(baseIn),x=y.pow(str.length-i),POW_PRECISION=k,y.c=toBaseOut(toFixedPoint(coeffToString(x.c),x.e,"0"),10,baseOut,decimal),y.e=y.c.length),xc=toBaseOut(str,baseIn,baseOut,callerIsToString?(alphabet=ALPHABET,decimal):(alphabet=decimal,ALPHABET)),e=k=xc.length;xc[--k]==0;xc.pop());if(!xc[0])return alphabet.charAt(0);if(i<0?--e:(x.c=xc,x.e=e,x.s=sign,x=div(x,y,dp,rm,baseOut),xc=x.c,r=x.r,e=x.e),d=e+dp+1,i=xc[d],k=baseOut/2,r=r||d<0||xc[d+1]!=null,r=rm<4?(i!=null||r)&&(rm==0||rm==(x.s<0?3:2)):i>k||i==k&&(rm==4||r||rm==6&&xc[d-1]&1||rm==(x.s<0?8:7)),d<1||!xc[0])str=r?toFixedPoint(alphabet.charAt(1),-dp,alphabet.charAt(0)):alphabet.charAt(0);else{if(xc.length=d,r)for(--baseOut;++xc[--d]>baseOut;)xc[d]=0,d||(++e,xc=[1].concat(xc));for(k=xc.length;!xc[--k];);for(i=0,str="";i<=k;str+=alphabet.charAt(xc[i++]));str=toFixedPoint(str,e,alphabet.charAt(0))}return str}})(),div=(function(){function multiply(x,k,base){var m,temp,xlo,xhi,carry=0,i=x.length,klo=k%SQRT_BASE,khi=k/SQRT_BASE|0;for(x=x.slice();i--;)xlo=x[i]%SQRT_BASE,xhi=x[i]/SQRT_BASE|0,m=khi*xlo+xhi*klo,temp=klo*xlo+m%SQRT_BASE*SQRT_BASE+carry,carry=(temp/base|0)+(m/SQRT_BASE|0)+khi*xhi,x[i]=temp%base;return carry&&(x=[carry].concat(x)),x}function compare2(a,b,aL,bL){var i,cmp;if(aL!=bL)cmp=aL>bL?1:-1;else for(i=cmp=0;i<aL;i++)if(a[i]!=b[i]){cmp=a[i]>b[i]?1:-1;break}return cmp}function subtract(a,b,aL,base){for(var i=0;aL--;)a[aL]-=i,i=a[aL]<b[aL]?1:0,a[aL]=i*base+a[aL]-b[aL];for(;!a[0]&&a.length>1;a.splice(0,1));}return function(x,y,dp,rm,base){var cmp,e,i,more,n,prod,prodL,q,qc,rem,remL,rem0,xi,xL,yc0,yL,yz,s=x.s==y.s?1:-1,xc=x.c,yc=y.c;if(!xc||!xc[0]||!yc||!yc[0])return new BigNumber2(!x.s||!y.s||(xc?yc&&xc[0]==yc[0]:!yc)?NaN:xc&&xc[0]==0||!yc?s*0:s/0);for(q=new BigNumber2(s),qc=q.c=[],e=x.e-y.e,s=dp+e+1,base||(base=BASE,e=bitFloor(x.e/LOG_BASE)-bitFloor(y.e/LOG_BASE),s=s/LOG_BASE|0),i=0;yc[i]==(xc[i]||0);i++);if(yc[i]>(xc[i]||0)&&e--,s<0)qc.push(1),more=!0;else{for(xL=xc.length,yL=yc.length,i=0,s+=2,n=mathfloor(base/(yc[0]+1)),n>1&&(yc=multiply(yc,n,base),xc=multiply(xc,n,base),yL=yc.length,xL=xc.length),xi=yL,rem=xc.slice(0,yL),remL=rem.length;remL<yL;rem[remL++]=0);yz=yc.slice(),yz=[0].concat(yz),yc0=yc[0],yc[1]>=base/2&&yc0++;do{if(n=0,cmp=compare2(yc,rem,yL,remL),cmp<0){if(rem0=rem[0],yL!=remL&&(rem0=rem0*base+(rem[1]||0)),n=mathfloor(rem0/yc0),n>1)for(n>=base&&(n=base-1),prod=multiply(yc,n,base),prodL=prod.length,remL=rem.length;compare2(prod,rem,prodL,remL)==1;)n--,subtract(prod,yL<prodL?yz:yc,prodL,base),prodL=prod.length,cmp=1;else n==0&&(cmp=n=1),prod=yc.slice(),prodL=prod.length;if(prodL<remL&&(prod=[0].concat(prod)),subtract(rem,prod,remL,base),remL=rem.length,cmp==-1)for(;compare2(yc,rem,yL,remL)<1;)n++,subtract(rem,yL<remL?yz:yc,remL,base),remL=rem.length}else cmp===0&&(n++,rem=[0]);qc[i++]=n,rem[0]?rem[remL++]=xc[xi]||0:(rem=[xc[xi]],remL=1)}while((xi++<xL||rem[0]!=null)&&s--);more=rem[0]!=null,qc[0]||qc.splice(0,1)}if(base==BASE){for(i=1,s=qc[0];s>=10;s/=10,i++);round(q,dp+(q.e=i+e*LOG_BASE-1)+1,rm,more)}else q.e=e,q.r=+more;return q}})();function format(n,i,rm,id){var c0,e,ne,len,str;if(rm==null?rm=ROUNDING_MODE:intCheck(rm,0,8),!n.c)return n.toString();if(c0=n.c[0],ne=n.e,i==null)str=coeffToString(n.c),str=id==1||id==2&&(ne<=TO_EXP_NEG||ne>=TO_EXP_POS)?toExponential(str,ne):toFixedPoint(str,ne,"0");else if(n=round(new BigNumber2(n),i,rm),e=n.e,str=coeffToString(n.c),len=str.length,id==1||id==2&&(i<=e||e<=TO_EXP_NEG)){for(;len<i;str+="0",len++);str=toExponential(str,e)}else if(i-=ne+(id===2&&e>ne),str=toFixedPoint(str,e,"0"),e+1>len){if(--i>0)for(str+=".";i--;str+="0");}else if(i+=e-len,i>0)for(e+1==len&&(str+=".");i--;str+="0");return n.s<0&&c0?"-"+str:str}function maxOrMin(args,n){for(var k,y,i=1,x=new BigNumber2(args[0]);i<args.length;i++)y=new BigNumber2(args[i]),(!y.s||(k=compare(x,y))===n||k===0&&x.s===n)&&(x=y);return x}function normalise(n,c,e){for(var i=1,j=c.length;!c[--j];c.pop());for(j=c[0];j>=10;j/=10,i++);return(e=i+e*LOG_BASE-1)>MAX_EXP?n.c=n.e=null:e<MIN_EXP?n.c=[n.e=0]:(n.e=e,n.c=c),n}parseNumeric=(function(){var basePrefix=/^(-?)0([xbo])(?=\w[\w.]*$)/i,dotAfter=/^([^.]+)\.$/,dotBefore=/^\.([^.]+)$/,isInfinityOrNaN=/^-?(Infinity|NaN)$/,whitespaceOrPlus=/^\s*\+(?=[\w.])|^\s+|\s+$/g;return function(x,str,isNum,b){var base,s=isNum?str:str.replace(whitespaceOrPlus,"");if(isInfinityOrNaN.test(s))x.s=isNaN(s)?null:s<0?-1:1;else{if(!isNum&&(s=s.replace(basePrefix,function(m,p1,p2){return base=(p2=p2.toLowerCase())=="x"?16:p2=="b"?2:8,!b||b==base?p1:m}),b&&(base=b,s=s.replace(dotAfter,"$1").replace(dotBefore,"0.$1")),str!=s))return new BigNumber2(s,base);if(BigNumber2.DEBUG)throw Error(bignumberError+"Not a"+(b?" base "+b:"")+" number: "+str);x.s=null}x.c=x.e=null}})();function round(x,sd,rm,r){var d,i,j,k,n,ni,rd,xc=x.c,pows10=POWS_TEN;if(xc){out:{for(d=1,k=xc[0];k>=10;k/=10,d++);if(i=sd-d,i<0)i+=LOG_BASE,j=sd,n=xc[ni=0],rd=mathfloor(n/pows10[d-j-1]%10);else if(ni=mathceil((i+1)/LOG_BASE),ni>=xc.length)if(r){for(;xc.length<=ni;xc.push(0));n=rd=0,d=1,i%=LOG_BASE,j=i-LOG_BASE+1}else break out;else{for(n=k=xc[ni],d=1;k>=10;k/=10,d++);i%=LOG_BASE,j=i-LOG_BASE+d,rd=j<0?0:mathfloor(n/pows10[d-j-1]%10)}if(r=r||sd<0||xc[ni+1]!=null||(j<0?n:n%pows10[d-j-1]),r=rm<4?(rd||r)&&(rm==0||rm==(x.s<0?3:2)):rd>5||rd==5&&(rm==4||r||rm==6&&(i>0?j>0?n/pows10[d-j]:0:xc[ni-1])%10&1||rm==(x.s<0?8:7)),sd<1||!xc[0])return xc.length=0,r?(sd-=x.e+1,xc[0]=pows10[(LOG_BASE-sd%LOG_BASE)%LOG_BASE],x.e=-sd||0):xc[0]=x.e=0,x;if(i==0?(xc.length=ni,k=1,ni--):(xc.length=ni+1,k=pows10[LOG_BASE-i],xc[ni]=j>0?mathfloor(n/pows10[d-j]%pows10[j])*k:0),r)for(;;)if(ni==0){for(i=1,j=xc[0];j>=10;j/=10,i++);for(j=xc[0]+=k,k=1;j>=10;j/=10,k++);i!=k&&(x.e++,xc[0]==BASE&&(xc[0]=1));break}else{if(xc[ni]+=k,xc[ni]!=BASE)break;xc[ni--]=0,k=1}for(i=xc.length;xc[--i]===0;xc.pop());}x.e>MAX_EXP?x.c=x.e=null:x.e<MIN_EXP&&(x.c=[x.e=0])}return x}function valueOf(n){var str,e=n.e;return e===null?n.toString():(str=coeffToString(n.c),str=e<=TO_EXP_NEG||e>=TO_EXP_POS?toExponential(str,e):toFixedPoint(str,e,"0"),n.s<0?"-"+str:str)}return P.absoluteValue=P.abs=function(){var x=new BigNumber2(this);return x.s<0&&(x.s=1),x},P.comparedTo=function(y,b){return compare(this,new BigNumber2(y,b))},P.decimalPlaces=P.dp=function(dp,rm){var c,n,v,x=this;if(dp!=null)return intCheck(dp,0,MAX),rm==null?rm=ROUNDING_MODE:intCheck(rm,0,8),round(new BigNumber2(x),dp+x.e+1,rm);if(!(c=x.c))return null;if(n=((v=c.length-1)-bitFloor(this.e/LOG_BASE))*LOG_BASE,v=c[v])for(;v%10==0;v/=10,n--);return n<0&&(n=0),n},P.dividedBy=P.div=function(y,b){return div(this,new BigNumber2(y,b),DECIMAL_PLACES,ROUNDING_MODE)},P.dividedToIntegerBy=P.idiv=function(y,b){return div(this,new BigNumber2(y,b),0,1)},P.exponentiatedBy=P.pow=function(n,m){var half,isModExp,i,k,more,nIsBig,nIsNeg,nIsOdd,y,x=this;if(n=new BigNumber2(n),n.c&&!n.isInteger())throw Error(bignumberError+"Exponent not an integer: "+valueOf(n));if(m!=null&&(m=new BigNumber2(m)),nIsBig=n.e>14,!x.c||!x.c[0]||x.c[0]==1&&!x.e&&x.c.length==1||!n.c||!n.c[0])return y=new BigNumber2(Math.pow(+valueOf(x),nIsBig?n.s*(2-isOdd(n)):+valueOf(n))),m?y.mod(m):y;if(nIsNeg=n.s<0,m){if(m.c?!m.c[0]:!m.s)return new BigNumber2(NaN);isModExp=!nIsNeg&&x.isInteger()&&m.isInteger(),isModExp&&(x=x.mod(m))}else{if(n.e>9&&(x.e>0||x.e<-1||(x.e==0?x.c[0]>1||nIsBig&&x.c[1]>=24e7:x.c[0]<8e13||nIsBig&&x.c[0]<=9999975e7)))return k=x.s<0&&isOdd(n)?-0:0,x.e>-1&&(k=1/k),new BigNumber2(nIsNeg?1/k:k);POW_PRECISION&&(k=mathceil(POW_PRECISION/LOG_BASE+2))}for(nIsBig?(half=new BigNumber2(.5),nIsNeg&&(n.s=1),nIsOdd=isOdd(n)):(i=Math.abs(+valueOf(n)),nIsOdd=i%2),y=new BigNumber2(ONE);;){if(nIsOdd){if(y=y.times(x),!y.c)break;k?y.c.length>k&&(y.c.length=k):isModExp&&(y=y.mod(m))}if(i){if(i=mathfloor(i/2),i===0)break;nIsOdd=i%2}else if(n=n.times(half),round(n,n.e+1,1),n.e>14)nIsOdd=isOdd(n);else{if(i=+valueOf(n),i===0)break;nIsOdd=i%2}x=x.times(x),k?x.c&&x.c.length>k&&(x.c.length=k):isModExp&&(x=x.mod(m))}return isModExp?y:(nIsNeg&&(y=ONE.div(y)),m?y.mod(m):k?round(y,POW_PRECISION,ROUNDING_MODE,more):y)},P.integerValue=function(rm){var n=new BigNumber2(this);return rm==null?rm=ROUNDING_MODE:intCheck(rm,0,8),round(n,n.e+1,rm)},P.isEqualTo=P.eq=function(y,b){return compare(this,new BigNumber2(y,b))===0},P.isFinite=function(){return!!this.c},P.isGreaterThan=P.gt=function(y,b){return compare(this,new BigNumber2(y,b))>0},P.isGreaterThanOrEqualTo=P.gte=function(y,b){return(b=compare(this,new BigNumber2(y,b)))===1||b===0},P.isInteger=function(){return!!this.c&&bitFloor(this.e/LOG_BASE)>this.c.length-2},P.isLessThan=P.lt=function(y,b){return compare(this,new BigNumber2(y,b))<0},P.isLessThanOrEqualTo=P.lte=function(y,b){return(b=compare(this,new BigNumber2(y,b)))===-1||b===0},P.isNaN=function(){return!this.s},P.isNegative=function(){return this.s<0},P.isPositive=function(){return this.s>0},P.isZero=function(){return!!this.c&&this.c[0]==0},P.minus=function(y,b){var i,j,t,xLTy,x=this,a=x.s;if(y=new BigNumber2(y,b),b=y.s,!a||!b)return new BigNumber2(NaN);if(a!=b)return y.s=-b,x.plus(y);var xe=x.e/LOG_BASE,ye=y.e/LOG_BASE,xc=x.c,yc=y.c;if(!xe||!ye){if(!xc||!yc)return xc?(y.s=-b,y):new BigNumber2(yc?x:NaN);if(!xc[0]||!yc[0])return yc[0]?(y.s=-b,y):new BigNumber2(xc[0]?x:ROUNDING_MODE==3?-0:0)}if(xe=bitFloor(xe),ye=bitFloor(ye),xc=xc.slice(),a=xe-ye){for((xLTy=a<0)?(a=-a,t=xc):(ye=xe,t=yc),t.reverse(),b=a;b--;t.push(0));t.reverse()}else for(j=(xLTy=(a=xc.length)<(b=yc.length))?a:b,a=b=0;b<j;b++)if(xc[b]!=yc[b]){xLTy=xc[b]<yc[b];break}if(xLTy&&(t=xc,xc=yc,yc=t,y.s=-y.s),b=(j=yc.length)-(i=xc.length),b>0)for(;b--;xc[i++]=0);for(b=BASE-1;j>a;){if(xc[--j]<yc[j]){for(i=j;i&&!xc[--i];xc[i]=b);--xc[i],xc[j]+=BASE}xc[j]-=yc[j]}for(;xc[0]==0;xc.splice(0,1),--ye);return xc[0]?normalise(y,xc,ye):(y.s=ROUNDING_MODE==3?-1:1,y.c=[y.e=0],y)},P.modulo=P.mod=function(y,b){var q,s,x=this;return y=new BigNumber2(y,b),!x.c||!y.s||y.c&&!y.c[0]?new BigNumber2(NaN):!y.c||x.c&&!x.c[0]?new BigNumber2(x):(MODULO_MODE==9?(s=y.s,y.s=1,q=div(x,y,0,3),y.s=s,q.s*=s):q=div(x,y,0,MODULO_MODE),y=x.minus(q.times(y)),!y.c[0]&&MODULO_MODE==1&&(y.s=x.s),y)},P.multipliedBy=P.times=function(y,b){var c,e,i,j,k,m,xcL,xlo,xhi,ycL,ylo,yhi,zc,base,sqrtBase,x=this,xc=x.c,yc=(y=new BigNumber2(y,b)).c;if(!xc||!yc||!xc[0]||!yc[0])return!x.s||!y.s||xc&&!xc[0]&&!yc||yc&&!yc[0]&&!xc?y.c=y.e=y.s=null:(y.s*=x.s,!xc||!yc?y.c=y.e=null:(y.c=[0],y.e=0)),y;for(e=bitFloor(x.e/LOG_BASE)+bitFloor(y.e/LOG_BASE),y.s*=x.s,xcL=xc.length,ycL=yc.length,xcL<ycL&&(zc=xc,xc=yc,yc=zc,i=xcL,xcL=ycL,ycL=i),i=xcL+ycL,zc=[];i--;zc.push(0));for(base=BASE,sqrtBase=SQRT_BASE,i=ycL;--i>=0;){for(c=0,ylo=yc[i]%sqrtBase,yhi=yc[i]/sqrtBase|0,k=xcL,j=i+k;j>i;)xlo=xc[--k]%sqrtBase,xhi=xc[k]/sqrtBase|0,m=yhi*xlo+xhi*ylo,xlo=ylo*xlo+m%sqrtBase*sqrtBase+zc[j]+c,c=(xlo/base|0)+(m/sqrtBase|0)+yhi*xhi,zc[j--]=xlo%base;zc[j]=c}return c?++e:zc.splice(0,1),normalise(y,zc,e)},P.negated=function(){var x=new BigNumber2(this);return x.s=-x.s||null,x},P.plus=function(y,b){var t,x=this,a=x.s;if(y=new BigNumber2(y,b),b=y.s,!a||!b)return new BigNumber2(NaN);if(a!=b)return y.s=-b,x.minus(y);var xe=x.e/LOG_BASE,ye=y.e/LOG_BASE,xc=x.c,yc=y.c;if(!xe||!ye){if(!xc||!yc)return new BigNumber2(a/0);if(!xc[0]||!yc[0])return yc[0]?y:new BigNumber2(xc[0]?x:a*0)}if(xe=bitFloor(xe),ye=bitFloor(ye),xc=xc.slice(),a=xe-ye){for(a>0?(ye=xe,t=yc):(a=-a,t=xc),t.reverse();a--;t.push(0));t.reverse()}for(a=xc.length,b=yc.length,a-b<0&&(t=yc,yc=xc,xc=t,b=a),a=0;b;)a=(xc[--b]=xc[b]+yc[b]+a)/BASE|0,xc[b]=BASE===xc[b]?0:xc[b]%BASE;return a&&(xc=[a].concat(xc),++ye),normalise(y,xc,ye)},P.precision=P.sd=function(sd,rm){var c,n,v,x=this;if(sd!=null&&sd!==!!sd)return intCheck(sd,1,MAX),rm==null?rm=ROUNDING_MODE:intCheck(rm,0,8),round(new BigNumber2(x),sd,rm);if(!(c=x.c))return null;if(v=c.length-1,n=v*LOG_BASE+1,v=c[v]){for(;v%10==0;v/=10,n--);for(v=c[0];v>=10;v/=10,n++);}return sd&&x.e+1>n&&(n=x.e+1),n},P.shiftedBy=function(k){return intCheck(k,-MAX_SAFE_INTEGER,MAX_SAFE_INTEGER),this.times("1e"+k)},P.squareRoot=P.sqrt=function(){var m,n,r,rep,t,x=this,c=x.c,s=x.s,e=x.e,dp=DECIMAL_PLACES+4,half=new BigNumber2("0.5");if(s!==1||!c||!c[0])return new BigNumber2(!s||s<0&&(!c||c[0])?NaN:c?x:1/0);if(s=Math.sqrt(+valueOf(x)),s==0||s==1/0?(n=coeffToString(c),(n.length+e)%2==0&&(n+="0"),s=Math.sqrt(+n),e=bitFloor((e+1)/2)-(e<0||e%2),s==1/0?n="5e"+e:(n=s.toExponential(),n=n.slice(0,n.indexOf("e")+1)+e),r=new BigNumber2(n)):r=new BigNumber2(s+""),r.c[0]){for(e=r.e,s=e+dp,s<3&&(s=0);;)if(t=r,r=half.times(t.plus(div(x,t,dp,1))),coeffToString(t.c).slice(0,s)===(n=coeffToString(r.c)).slice(0,s))if(r.e<e&&--s,n=n.slice(s-3,s+1),n=="9999"||!rep&&n=="4999"){if(!rep&&(round(t,t.e+DECIMAL_PLACES+2,0),t.times(t).eq(x))){r=t;break}dp+=4,s+=4,rep=1}else{(!+n||!+n.slice(1)&&n.charAt(0)=="5")&&(round(r,r.e+DECIMAL_PLACES+2,1),m=!r.times(r).eq(x));break}}return round(r,r.e+DECIMAL_PLACES+1,ROUNDING_MODE,m)},P.toExponential=function(dp,rm){return dp!=null&&(intCheck(dp,0,MAX),dp++),format(this,dp,rm,1)},P.toFixed=function(dp,rm){return dp!=null&&(intCheck(dp,0,MAX),dp=dp+this.e+1),format(this,dp,rm)},P.toFormat=function(dp,rm,format2){var str,x=this;if(format2==null)dp!=null&&rm&&typeof rm=="object"?(format2=rm,rm=null):dp&&typeof dp=="object"?(format2=dp,dp=rm=null):format2=FORMAT;else if(typeof format2!="object")throw Error(bignumberError+"Argument not an object: "+format2);if(str=x.toFixed(dp,rm),x.c){var i,arr=str.split("."),g1=+format2.groupSize,g2=+format2.secondaryGroupSize,groupSeparator=format2.groupSeparator||"",intPart=arr[0],fractionPart=arr[1],isNeg=x.s<0,intDigits=isNeg?intPart.slice(1):intPart,len=intDigits.length;if(g2&&(i=g1,g1=g2,g2=i,len-=i),g1>0&&len>0){for(i=len%g1||g1,intPart=intDigits.substr(0,i);i<len;i+=g1)intPart+=groupSeparator+intDigits.substr(i,g1);g2>0&&(intPart+=groupSeparator+intDigits.slice(i)),isNeg&&(intPart="-"+intPart)}str=fractionPart?intPart+(format2.decimalSeparator||"")+((g2=+format2.fractionGroupSize)?fractionPart.replace(new RegExp("\\d{"+g2+"}\\B","g"),"$&"+(format2.fractionGroupSeparator||"")):fractionPart):intPart}return(format2.prefix||"")+str+(format2.suffix||"")},P.toFraction=function(md){var d,d0,d1,d2,e,exp,n,n0,n1,q,r,s,x=this,xc=x.c;if(md!=null&&(n=new BigNumber2(md),!n.isInteger()&&(n.c||n.s!==1)||n.lt(ONE)))throw Error(bignumberError+"Argument "+(n.isInteger()?"out of range: ":"not an integer: ")+valueOf(n));if(!xc)return new BigNumber2(x);for(d=new BigNumber2(ONE),n1=d0=new BigNumber2(ONE),d1=n0=new BigNumber2(ONE),s=coeffToString(xc),e=d.e=s.length-x.e-1,d.c[0]=POWS_TEN[(exp=e%LOG_BASE)<0?LOG_BASE+exp:exp],md=!md||n.comparedTo(d)>0?e>0?d:n1:n,exp=MAX_EXP,MAX_EXP=1/0,n=new BigNumber2(s),n0.c[0]=0;q=div(n,d,0,1),d2=d0.plus(q.times(d1)),d2.comparedTo(md)!=1;)d0=d1,d1=d2,n1=n0.plus(q.times(d2=n1)),n0=d2,d=n.minus(q.times(d2=d)),n=d2;return d2=div(md.minus(d0),d1,0,1),n0=n0.plus(d2.times(n1)),d0=d0.plus(d2.times(d1)),n0.s=n1.s=x.s,e=e*2,r=div(n1,d1,e,ROUNDING_MODE).minus(x).abs().comparedTo(div(n0,d0,e,ROUNDING_MODE).minus(x).abs())<1?[n1,d1]:[n0,d0],MAX_EXP=exp,r},P.toNumber=function(){return+valueOf(this)},P.toPrecision=function(sd,rm){return sd!=null&&intCheck(sd,1,MAX),format(this,sd,rm,2)},P.toString=function(b){var str,n=this,s=n.s,e=n.e;return e===null?s?(str="Infinity",s<0&&(str="-"+str)):str="NaN":(b==null?str=e<=TO_EXP_NEG||e>=TO_EXP_POS?toExponential(coeffToString(n.c),e):toFixedPoint(coeffToString(n.c),e,"0"):b===10&&alphabetHasNormalDecimalDigits?(n=round(new BigNumber2(n),DECIMAL_PLACES+e+1,ROUNDING_MODE),str=toFixedPoint(coeffToString(n.c),n.e,"0")):(intCheck(b,2,ALPHABET.length,"Base"),str=convertBase(toFixedPoint(coeffToString(n.c),e,"0"),10,b,s,!0)),s<0&&n.c[0]&&(str="-"+str)),str},P.valueOf=P.toJSON=function(){return valueOf(this)},P._isBigNumber=!0,configObject!=null&&BigNumber2.set(configObject),BigNumber2}function bitFloor(n){var i=n|0;return n>0||n===i?i:i-1}function coeffToString(a){for(var s,z,i=1,j=a.length,r=a[0]+"";i<j;){for(s=a[i++]+"",z=LOG_BASE-s.length;z--;s="0"+s);r+=s}for(j=r.length;r.charCodeAt(--j)===48;);return r.slice(0,j+1||1)}function compare(x,y){var a,b,xc=x.c,yc=y.c,i=x.s,j=y.s,k=x.e,l=y.e;if(!i||!j)return null;if(a=xc&&!xc[0],b=yc&&!yc[0],a||b)return a?b?0:-j:i;if(i!=j)return i;if(a=i<0,b=k==l,!xc||!yc)return b?0:!xc^a?1:-1;if(!b)return k>l^a?1:-1;for(j=(k=xc.length)<(l=yc.length)?k:l,i=0;i<j;i++)if(xc[i]!=yc[i])return xc[i]>yc[i]^a?1:-1;return k==l?0:k>l^a?1:-1}function intCheck(n,min,max,name){if(n<min||n>max||n!==mathfloor(n))throw Error(bignumberError+(name||"Argument")+(typeof n=="number"?n<min||n>max?" out of range: ":" not an integer: ":" not a primitive number: ")+String(n))}function isOdd(n){var k=n.c.length-1;return bitFloor(n.e/LOG_BASE)==k&&n.c[k]%2!=0}function toExponential(str,e){return(str.length>1?str.charAt(0)+"."+str.slice(1):str)+(e<0?"e":"e+")+e}function toFixedPoint(str,e,z){var len,zs;if(e<0){for(zs=z+".";++e;zs+=z);str=zs+str}else if(len=str.length,++e>len){for(zs=z,e-=len;--e;zs+=z);str+=zs}else e<len&&(str=str.slice(0,e)+"."+str.slice(e));return str}BigNumber=clone(),BigNumber.default=BigNumber.BigNumber=BigNumber,typeof define=="function"&&define.amd?define(function(){return BigNumber}):typeof module<"u"&&module.exports?module.exports=BigNumber:(globalObject||(globalObject=typeof self<"u"&&self?self:window),globalObject.BigNumber=BigNumber)})(exports)}});var require_stringify=__commonJS({"node_modules/json-bigint/lib/stringify.js"(exports,module){var BigNumber=require_bignumber(),JSON2=module.exports;(function(){"use strict";function f(n){return n<10?"0"+n:n}var cx=/[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,escapable=/[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,gap,indent,meta={"\b":"\\b"," ":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"},rep;function quote(string){return escapable.lastIndex=0,escapable.test(string)?'"'+string.replace(escapable,function(a){var c=meta[a];return typeof c=="string"?c:"\\u"+("0000"+a.charCodeAt(0).toString(16)).slice(-4)})+'"':'"'+string+'"'}function str(key,holder){var i,k,v,length,mind=gap,partial,value=holder[key],isBigNumber=value!=null&&(value instanceof BigNumber||BigNumber.isBigNumber(value));switch(value&&typeof value=="object"&&typeof value.toJSON=="function"&&(value=value.toJSON(key)),typeof rep=="function"&&(value=rep.call(holder,key,value)),typeof value){case"string":return isBigNumber?value:quote(value);case"number":return isFinite(value)?String(value):"null";case"boolean":case"null":case"bigint":return String(value);case"object":if(!value)return"null";if(gap+=indent,partial=[],Object.prototype.toString.apply(value)==="[object Array]"){for(length=value.length,i=0;i<length;i+=1)partial[i]=str(i,value)||"null";return v=partial.length===0?"[]":gap?`[
8
8
  `+gap+partial.join(`,
9
9
  `+gap)+`
10
10
  `+mind+"]":"["+partial.join(",")+"]",gap=mind,v}if(rep&&typeof rep=="object")for(length=rep.length,i=0;i<length;i+=1)typeof rep[i]=="string"&&(k=rep[i],v=str(k,value),v&&partial.push(quote(k)+(gap?": ":":")+v));else Object.keys(value).forEach(function(k2){var v2=str(k2,value);v2&&partial.push(quote(k2)+(gap?": ":":")+v2)});return v=partial.length===0?"{}":gap?`{