zen-code 3.0.1 → 3.0.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.
@@ -1,651 +0,0 @@
1
- import { b as Y, a as m, p as Z, n as G, c as J, F as X, R as y, T as D, j as b, u as k, B as O } from "./use-input-1eSjZocJ.mjs";
2
- import T from "chalk";
3
- import { g as ee } from "./_commonjsHelpers-ByX85dGu.mjs";
4
- import ne from "openai";
5
- import re from "@anthropic-ai/sdk";
6
- const se = (n, r = {}) => {
7
- const { stdin: c, setRawMode: t, internal_exitOnCtrlC: s, internal_eventEmitter: u } = Y();
8
- m.useEffect(() => {
9
- if (r.isActive !== !1)
10
- return t(!0), () => {
11
- t(!1);
12
- };
13
- }, [r.isActive, t]), m.useEffect(() => {
14
- if (r.isActive === !1)
15
- return;
16
- const h = (I) => {
17
- const a = Z(I), p = {
18
- upArrow: a.name === "up",
19
- downArrow: a.name === "down",
20
- leftArrow: a.name === "left",
21
- rightArrow: a.name === "right",
22
- pageDown: a.name === "pagedown",
23
- pageUp: a.name === "pageup",
24
- home: a.name === "home",
25
- end: a.name === "end",
26
- return: a.name === "return",
27
- escape: a.name === "escape",
28
- ctrl: a.ctrl,
29
- shift: a.shift,
30
- tab: a.name === "tab",
31
- backspace: a.name === "backspace",
32
- delete: a.name === "delete",
33
- // `parseKeypress` parses \u001B\u001B[A (meta + up arrow) as meta = false
34
- // but with option = true, so we need to take this into account here
35
- // to avoid breaking changes in Ink.
36
- // TODO(vadimdemedes): consider removing this in the next major version.
37
- meta: a.meta || a.name === "escape" || a.option
38
- };
39
- let v = a.ctrl ? a.name : a.sequence;
40
- G.includes(a.name) && (v = ""), v.startsWith("\x1B") && (v = v.slice(1)), v.length === 1 && typeof v[0] == "string" && /[A-Z]/.test(v[0]) && (p.shift = !0), (!(v === "c" && p.ctrl) || !s) && J.batchedUpdates(() => {
41
- n(v, p);
42
- });
43
- };
44
- return u?.on("input", h), () => {
45
- u?.removeListener("input", h);
46
- };
47
- }, [r.isActive, c, s, n]);
48
- }, Q = ({ isActive: n = !0, autoFocus: r = !1, id: c } = {}) => {
49
- const { isRawModeSupported: t, setRawMode: s } = Y(), { activeId: u, add: h, remove: I, activate: a, deactivate: p, focus: v } = m.useContext(X), w = m.useMemo(() => c ?? Math.random().toString().slice(2, 7), [c]);
50
- return m.useEffect(() => (h(w, { autoFocus: r }), () => {
51
- I(w);
52
- }), [w, r]), m.useEffect(() => {
53
- n ? a(w) : p(w);
54
- }, [n, w]), m.useEffect(() => {
55
- if (!(!t || !n))
56
- return s(!0), () => {
57
- s(!1);
58
- };
59
- }, [n]), {
60
- isFocused: !!w && u === w,
61
- focus: v
62
- };
63
- }, te = { interval: 80, frames: ["⠋", "⠙", "⠹", "⠸", "⠼", "⠴", "⠦", "⠧", "⠇", "⠏"] }, ie = { interval: 80, frames: ["⣾", "⣽", "⣻", "⢿", "⡿", "⣟", "⣯", "⣷"] }, oe = { interval: 80, frames: ["⠋", "⠙", "⠚", "⠞", "⠖", "⠦", "⠴", "⠲", "⠳", "⠓"] }, le = { interval: 80, frames: ["⠄", "⠆", "⠇", "⠋", "⠙", "⠸", "⠰", "⠠", "⠰", "⠸", "⠙", "⠋", "⠇", "⠆"] }, ce = { interval: 80, frames: ["⠋", "⠙", "⠚", "⠒", "⠂", "⠂", "⠒", "⠲", "⠴", "⠦", "⠖", "⠒", "⠐", "⠐", "⠒", "⠓", "⠋"] }, ae = { interval: 80, frames: ["⠁", "⠉", "⠙", "⠚", "⠒", "⠂", "⠂", "⠒", "⠲", "⠴", "⠤", "⠄", "⠄", "⠤", "⠴", "⠲", "⠒", "⠂", "⠂", "⠒", "⠚", "⠙", "⠉", "⠁"] }, ue = { interval: 80, frames: ["⠈", "⠉", "⠋", "⠓", "⠒", "⠐", "⠐", "⠒", "⠖", "⠦", "⠤", "⠠", "⠠", "⠤", "⠦", "⠖", "⠒", "⠐", "⠐", "⠒", "⠓", "⠋", "⠉", "⠈"] }, _e = { interval: 80, frames: ["⠁", "⠁", "⠉", "⠙", "⠚", "⠒", "⠂", "⠂", "⠒", "⠲", "⠴", "⠤", "⠄", "⠄", "⠤", "⠠", "⠠", "⠤", "⠦", "⠖", "⠒", "⠐", "⠐", "⠒", "⠓", "⠋", "⠉", "⠈", "⠈"] }, fe = { interval: 80, frames: ["⢹", "⢺", "⢼", "⣸", "⣇", "⡧", "⡗", "⡏"] }, me = { interval: 80, frames: ["⢄", "⢂", "⢁", "⡁", "⡈", "⡐", "⡠"] }, de = { interval: 100, frames: ["⠁", "⠂", "⠄", "⡀", "⢀", "⠠", "⠐", "⠈"] }, ve = { interval: 80, frames: ["⢀⠀", "⡀⠀", "⠄⠀", "⢂⠀", "⡂⠀", "⠅⠀", "⢃⠀", "⡃⠀", "⠍⠀", "⢋⠀", "⡋⠀", "⠍⠁", "⢋⠁", "⡋⠁", "⠍⠉", "⠋⠉", "⠋⠉", "⠉⠙", "⠉⠙", "⠉⠩", "⠈⢙", "⠈⡙", "⢈⠩", "⡀⢙", "⠄⡙", "⢂⠩", "⡂⢘", "⠅⡘", "⢃⠨", "⡃⢐", "⠍⡐", "⢋⠠", "⡋⢀", "⠍⡁", "⢋⠁", "⡋⠁", "⠍⠉", "⠋⠉", "⠋⠉", "⠉⠙", "⠉⠙", "⠉⠩", "⠈⢙", "⠈⡙", "⠈⠩", "⠀⢙", "⠀⡙", "⠀⠩", "⠀⢘", "⠀⡘", "⠀⠨", "⠀⢐", "⠀⡐", "⠀⠠", "⠀⢀", "⠀⡀"] }, Le = { interval: 80, frames: ["⣼", "⣹", "⢻", "⠿", "⡟", "⣏", "⣧", "⣶"] }, he = { interval: 80, frames: ["⠀", "⠁", "⠂", "⠃", "⠄", "⠅", "⠆", "⠇", "⡀", "⡁", "⡂", "⡃", "⡄", "⡅", "⡆", "⡇", "⠈", "⠉", "⠊", "⠋", "⠌", "⠍", "⠎", "⠏", "⡈", "⡉", "⡊", "⡋", "⡌", "⡍", "⡎", "⡏", "⠐", "⠑", "⠒", "⠓", "⠔", "⠕", "⠖", "⠗", "⡐", "⡑", "⡒", "⡓", "⡔", "⡕", "⡖", "⡗", "⠘", "⠙", "⠚", "⠛", "⠜", "⠝", "⠞", "⠟", "⡘", "⡙", "⡚", "⡛", "⡜", "⡝", "⡞", "⡟", "⠠", "⠡", "⠢", "⠣", "⠤", "⠥", "⠦", "⠧", "⡠", "⡡", "⡢", "⡣", "⡤", "⡥", "⡦", "⡧", "⠨", "⠩", "⠪", "⠫", "⠬", "⠭", "⠮", "⠯", "⡨", "⡩", "⡪", "⡫", "⡬", "⡭", "⡮", "⡯", "⠰", "⠱", "⠲", "⠳", "⠴", "⠵", "⠶", "⠷", "⡰", "⡱", "⡲", "⡳", "⡴", "⡵", "⡶", "⡷", "⠸", "⠹", "⠺", "⠻", "⠼", "⠽", "⠾", "⠿", "⡸", "⡹", "⡺", "⡻", "⡼", "⡽", "⡾", "⡿", "⢀", "⢁", "⢂", "⢃", "⢄", "⢅", "⢆", "⢇", "⣀", "⣁", "⣂", "⣃", "⣄", "⣅", "⣆", "⣇", "⢈", "⢉", "⢊", "⢋", "⢌", "⢍", "⢎", "⢏", "⣈", "⣉", "⣊", "⣋", "⣌", "⣍", "⣎", "⣏", "⢐", "⢑", "⢒", "⢓", "⢔", "⢕", "⢖", "⢗", "⣐", "⣑", "⣒", "⣓", "⣔", "⣕", "⣖", "⣗", "⢘", "⢙", "⢚", "⢛", "⢜", "⢝", "⢞", "⢟", "⣘", "⣙", "⣚", "⣛", "⣜", "⣝", "⣞", "⣟", "⢠", "⢡", "⢢", "⢣", "⢤", "⢥", "⢦", "⢧", "⣠", "⣡", "⣢", "⣣", "⣤", "⣥", "⣦", "⣧", "⢨", "⢩", "⢪", "⢫", "⢬", "⢭", "⢮", "⢯", "⣨", "⣩", "⣪", "⣫", "⣬", "⣭", "⣮", "⣯", "⢰", "⢱", "⢲", "⢳", "⢴", "⢵", "⢶", "⢷", "⣰", "⣱", "⣲", "⣳", "⣴", "⣵", "⣶", "⣷", "⢸", "⢹", "⢺", "⢻", "⢼", "⢽", "⢾", "⢿", "⣸", "⣹", "⣺", "⣻", "⣼", "⣽", "⣾", "⣿"] }, ge = { interval: 80, frames: ["⠁", "⠂", "⠄", "⡀", "⡈", "⡐", "⡠", "⣀", "⣁", "⣂", "⣄", "⣌", "⣔", "⣤", "⣥", "⣦", "⣮", "⣶", "⣷", "⣿", "⡿", "⠿", "⢟", "⠟", "⡛", "⠛", "⠫", "⢋", "⠋", "⠍", "⡉", "⠉", "⠑", "⠡", "⢁"] }, pe = { interval: 130, frames: ["-", "\\", "|", "/"] }, we = { interval: 100, frames: ["⠂", "-", "–", "—", "–", "-"] }, Ce = { interval: 100, frames: ["┤", "┘", "┴", "└", "├", "┌", "┬", "┐"] }, be = { interval: 400, frames: [". ", ".. ", "...", " "] }, xe = { interval: 200, frames: [". ", ".. ", "...", " ..", " .", " "] }, Me = { interval: 70, frames: ["✶", "✸", "✹", "✺", "✹", "✷"] }, Ie = { interval: 80, frames: ["+", "x", "*"] }, je = { interval: 70, frames: ["_", "_", "_", "-", "`", "`", "'", "´", "-", "_", "_", "_"] }, Ae = { interval: 100, frames: ["☱", "☲", "☴"] }, Ee = { interval: 120, frames: ["▁", "▃", "▄", "▅", "▆", "▇", "▆", "▅", "▄", "▃"] }, Ve = { interval: 120, frames: ["▏", "▎", "▍", "▌", "▋", "▊", "▉", "▊", "▋", "▌", "▍", "▎"] }, Se = { interval: 140, frames: [" ", ".", "o", "O", "@", "*", " "] }, Fe = { interval: 120, frames: [".", "o", "O", "°", "O", "o", "."] }, Re = { interval: 100, frames: ["▓", "▒", "░"] }, Be = { interval: 120, frames: ["⠁", "⠂", "⠄", "⠂"] }, De = { interval: 120, frames: ["▖", "▘", "▝", "▗"] }, Oe = { interval: 100, frames: ["▌", "▀", "▐", "▄"] }, Pe = { interval: 50, frames: ["◢", "◣", "◤", "◥"] }, qe = { interval: 80, frames: ["010010", "001100", "100101", "111010", "111101", "010111", "101011", "111000", "110011", "110101"] }, Ne = { interval: 100, frames: ["◜", "◠", "◝", "◞", "◡", "◟"] }, Te = { interval: 120, frames: ["◡", "⊙", "◠"] }, He = { interval: 180, frames: ["◰", "◳", "◲", "◱"] }, Ue = { interval: 120, frames: ["◴", "◷", "◶", "◵"] }, We = { interval: 50, frames: ["◐", "◓", "◑", "◒"] }, $e = { interval: 100, frames: ["╫", "╪"] }, Ke = { interval: 250, frames: ["⊶", "⊷"] }, ze = { interval: 80, frames: ["▫", "▪"] }, Ye = { interval: 120, frames: ["□", "■"] }, Qe = { interval: 100, frames: ["■", "□", "▪", "▫"] }, Ze = { interval: 100, frames: ["▮", "▯"] }, Ge = { interval: 300, frames: ["ဝ", "၀"] }, Je = { interval: 80, frames: ["⦾", "⦿"] }, Xe = { interval: 100, frames: ["◍", "◌"] }, ye = { interval: 100, frames: ["◉", "◎"] }, ke = { interval: 100, frames: ["㊂", "㊀", "㊁"] }, en = { interval: 50, frames: ["⧇", "⧆"] }, nn = { interval: 120, frames: ["☗", "☖"] }, rn = { interval: 80, frames: ["=", "*", "-"] }, sn = { interval: 100, frames: ["←", "↖", "↑", "↗", "→", "↘", "↓", "↙"] }, tn = { interval: 80, frames: ["⬆️ ", "↗️ ", "➡️ ", "↘️ ", "⬇️ ", "↙️ ", "⬅️ ", "↖️ "] }, on = { interval: 120, frames: ["▹▹▹▹▹", "▸▹▹▹▹", "▹▸▹▹▹", "▹▹▸▹▹", "▹▹▹▸▹", "▹▹▹▹▸"] }, ln = { interval: 80, frames: ["[ ]", "[= ]", "[== ]", "[=== ]", "[====]", "[ ===]", "[ ==]", "[ =]", "[ ]", "[ =]", "[ ==]", "[ ===]", "[====]", "[=== ]", "[== ]", "[= ]"] }, cn = { interval: 80, frames: ["( ● )", "( ● )", "( ● )", "( ● )", "( ●)", "( ● )", "( ● )", "( ● )", "( ● )", "(● )"] }, an = { interval: 200, frames: ["😄 ", "😝 "] }, un = { interval: 300, frames: ["🙈 ", "🙈 ", "🙉 ", "🙊 "] }, _n = { interval: 100, frames: ["💛 ", "💙 ", "💜 ", "💚 ", "❤️ "] }, fn = { interval: 100, frames: ["🕛 ", "🕐 ", "🕑 ", "🕒 ", "🕓 ", "🕔 ", "🕕 ", "🕖 ", "🕗 ", "🕘 ", "🕙 ", "🕚 "] }, mn = { interval: 180, frames: ["🌍 ", "🌎 ", "🌏 "] }, dn = { interval: 17, frames: ["█▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁", "██▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁", "███▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁", "████▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁", "██████▁▁▁▁▁▁▁▁▁▁▁▁▁▁", "██████▁▁▁▁▁▁▁▁▁▁▁▁▁▁", "███████▁▁▁▁▁▁▁▁▁▁▁▁▁", "████████▁▁▁▁▁▁▁▁▁▁▁▁", "█████████▁▁▁▁▁▁▁▁▁▁▁", "█████████▁▁▁▁▁▁▁▁▁▁▁", "██████████▁▁▁▁▁▁▁▁▁▁", "███████████▁▁▁▁▁▁▁▁▁", "█████████████▁▁▁▁▁▁▁", "██████████████▁▁▁▁▁▁", "██████████████▁▁▁▁▁▁", "▁██████████████▁▁▁▁▁", "▁██████████████▁▁▁▁▁", "▁██████████████▁▁▁▁▁", "▁▁██████████████▁▁▁▁", "▁▁▁██████████████▁▁▁", "▁▁▁▁█████████████▁▁▁", "▁▁▁▁██████████████▁▁", "▁▁▁▁██████████████▁▁", "▁▁▁▁▁██████████████▁", "▁▁▁▁▁██████████████▁", "▁▁▁▁▁██████████████▁", "▁▁▁▁▁▁██████████████", "▁▁▁▁▁▁██████████████", "▁▁▁▁▁▁▁█████████████", "▁▁▁▁▁▁▁█████████████", "▁▁▁▁▁▁▁▁████████████", "▁▁▁▁▁▁▁▁████████████", "▁▁▁▁▁▁▁▁▁███████████", "▁▁▁▁▁▁▁▁▁███████████", "▁▁▁▁▁▁▁▁▁▁██████████", "▁▁▁▁▁▁▁▁▁▁██████████", "▁▁▁▁▁▁▁▁▁▁▁▁████████", "▁▁▁▁▁▁▁▁▁▁▁▁▁███████", "▁▁▁▁▁▁▁▁▁▁▁▁▁▁██████", "▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁█████", "▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁█████", "█▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁████", "██▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁███", "██▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁███", "███▁▁▁▁▁▁▁▁▁▁▁▁▁▁███", "████▁▁▁▁▁▁▁▁▁▁▁▁▁▁██", "█████▁▁▁▁▁▁▁▁▁▁▁▁▁▁█", "█████▁▁▁▁▁▁▁▁▁▁▁▁▁▁█", "██████▁▁▁▁▁▁▁▁▁▁▁▁▁█", "████████▁▁▁▁▁▁▁▁▁▁▁▁", "█████████▁▁▁▁▁▁▁▁▁▁▁", "█████████▁▁▁▁▁▁▁▁▁▁▁", "█████████▁▁▁▁▁▁▁▁▁▁▁", "█████████▁▁▁▁▁▁▁▁▁▁▁", "███████████▁▁▁▁▁▁▁▁▁", "████████████▁▁▁▁▁▁▁▁", "████████████▁▁▁▁▁▁▁▁", "██████████████▁▁▁▁▁▁", "██████████████▁▁▁▁▁▁", "▁██████████████▁▁▁▁▁", "▁██████████████▁▁▁▁▁", "▁▁▁█████████████▁▁▁▁", "▁▁▁▁▁████████████▁▁▁", "▁▁▁▁▁████████████▁▁▁", "▁▁▁▁▁▁███████████▁▁▁", "▁▁▁▁▁▁▁▁█████████▁▁▁", "▁▁▁▁▁▁▁▁█████████▁▁▁", "▁▁▁▁▁▁▁▁▁█████████▁▁", "▁▁▁▁▁▁▁▁▁█████████▁▁", "▁▁▁▁▁▁▁▁▁▁█████████▁", "▁▁▁▁▁▁▁▁▁▁▁████████▁", "▁▁▁▁▁▁▁▁▁▁▁████████▁", "▁▁▁▁▁▁▁▁▁▁▁▁███████▁", "▁▁▁▁▁▁▁▁▁▁▁▁███████▁", "▁▁▁▁▁▁▁▁▁▁▁▁▁███████", "▁▁▁▁▁▁▁▁▁▁▁▁▁███████", "▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁█████", "▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁████", "▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁████", "▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁████", "▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁███", "▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁███", "▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁██", "▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁██", "▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁██", "▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁█", "▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁█", "▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁█", "▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁", "▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁", "▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁", "▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁"] }, vn = { interval: 80, frames: ["🌑 ", "🌒 ", "🌓 ", "🌔 ", "🌕 ", "🌖 ", "🌗 ", "🌘 "] }, Ln = { interval: 140, frames: ["🚶 ", "🏃 "] }, hn = { interval: 80, frames: ["▐⠂ ▌", "▐⠈ ▌", "▐ ⠂ ▌", "▐ ⠠ ▌", "▐ ⡀ ▌", "▐ ⠠ ▌", "▐ ⠂ ▌", "▐ ⠈ ▌", "▐ ⠂ ▌", "▐ ⠠ ▌", "▐ ⡀ ▌", "▐ ⠠ ▌", "▐ ⠂ ▌", "▐ ⠈ ▌", "▐ ⠂▌", "▐ ⠠▌", "▐ ⡀▌", "▐ ⠠ ▌", "▐ ⠂ ▌", "▐ ⠈ ▌", "▐ ⠂ ▌", "▐ ⠠ ▌", "▐ ⡀ ▌", "▐ ⠠ ▌", "▐ ⠂ ▌", "▐ ⠈ ▌", "▐ ⠂ ▌", "▐ ⠠ ▌", "▐ ⡀ ▌", "▐⠠ ▌"] }, gn = { interval: 120, frames: ["▐|\\____________▌", "▐_|\\___________▌", "▐__|\\__________▌", "▐___|\\_________▌", "▐____|\\________▌", "▐_____|\\_______▌", "▐______|\\______▌", "▐_______|\\_____▌", "▐________|\\____▌", "▐_________|\\___▌", "▐__________|\\__▌", "▐___________|\\_▌", "▐____________|\\▌", "▐____________/|▌", "▐___________/|_▌", "▐__________/|__▌", "▐_________/|___▌", "▐________/|____▌", "▐_______/|_____▌", "▐______/|______▌", "▐_____/|_______▌", "▐____/|________▌", "▐___/|_________▌", "▐__/|__________▌", "▐_/|___________▌", "▐/|____________▌"] }, pn = { interval: 100, frames: ["d", "q", "p", "b"] }, wn = { interval: 100, frames: ["☀️ ", "☀️ ", "☀️ ", "🌤 ", "⛅️ ", "🌥 ", "☁️ ", "🌧 ", "🌨 ", "🌧 ", "🌨 ", "🌧 ", "🌨 ", "⛈ ", "🌨 ", "🌧 ", "🌨 ", "☁️ ", "🌥 ", "⛅️ ", "🌤 ", "☀️ ", "☀️ "] }, Cn = { interval: 400, frames: ["🌲", "🎄"] }, bn = { interval: 80, frames: ["، ", "′ ", " ´ ", " ‾ ", " ⸌", " ⸊", " |", " ⁎", " ⁕", " ෴ ", " ⁓", " ", " ", " "] }, xn = { interval: 125, frames: ["∙∙∙", "●∙∙", "∙●∙", "∙∙●", "∙∙∙"] }, Mn = { interval: 150, frames: ["-", "=", "≡"] }, In = { interval: 80, frames: ["ρββββββ", "βρβββββ", "ββρββββ", "βββρβββ", "ββββρββ", "βββββρβ", "ββββββρ"] }, jn = { interval: 160, frames: ["🤘 ", "🤟 ", "🖖 ", "✋ ", "🤚 ", "👆 "] }, An = { interval: 80, frames: ["🤜    🤛 ", "🤜    🤛 ", "🤜    🤛 ", " 🤜  🤛  ", "  🤜🤛   ", " 🤜✨🤛   ", "🤜 ✨ 🤛  "] }, En = { interval: 80, frames: [" 🧑⚽️ 🧑 ", "🧑 ⚽️ 🧑 ", "🧑 ⚽️ 🧑 ", "🧑 ⚽️ 🧑 ", "🧑 ⚽️ 🧑 ", "🧑 ⚽️ 🧑 ", "🧑 ⚽️🧑 ", "🧑 ⚽️ 🧑 ", "🧑 ⚽️ 🧑 ", "🧑 ⚽️ 🧑 ", "🧑 ⚽️ 🧑 ", "🧑 ⚽️ 🧑 "] }, Vn = { interval: 160, frames: ["😐 ", "😐 ", "😮 ", "😮 ", "😦 ", "😦 ", "😧 ", "😧 ", "🤯 ", "💥 ", "✨ ", "  ", "  ", "  "] }, Sn = { interval: 160, frames: ["🔈 ", "🔉 ", "🔊 ", "🔉 "] }, Fn = { interval: 100, frames: ["🔸 ", "🔶 ", "🟠 ", "🟠 ", "🔶 "] }, Rn = { interval: 100, frames: ["🔹 ", "🔷 ", "🔵 ", "🔵 ", "🔷 "] }, Bn = { interval: 100, frames: ["🔸 ", "🔶 ", "🟠 ", "🟠 ", "🔶 ", "🔹 ", "🔷 ", "🔵 ", "🔵 ", "🔷 "] }, Dn = { interval: 100, frames: ["🕛 ", "🕚 ", "🕙 ", "🕘 ", "🕗 ", "🕖 ", "🕕 ", "🕔 ", "🕓 ", "🕒 ", "🕑 ", "🕐 "] }, On = { interval: 80, frames: ["▰▱▱▱▱▱▱", "▰▰▱▱▱▱▱", "▰▰▰▱▱▱▱", "▰▰▰▰▱▱▱", "▰▰▰▰▰▱▱", "▰▰▰▰▰▰▱", "▰▰▰▰▰▰▰", "▰▱▱▱▱▱▱"] }, Pn = { interval: 80, frames: [" ██████£££ ", "☺██████£££ ", "☺██████£££ ", "☺▓█████£££ ", "☺▓█████£££ ", "☺▒█████£££ ", "☺▒█████£££ ", "☺░█████£££ ", "☺░█████£££ ", "☺ █████£££ ", " ☺█████£££ ", " ☺█████£££ ", " ☺▓████£££ ", " ☺▓████£££ ", " ☺▒████£££ ", " ☺▒████£££ ", " ☺░████£££ ", " ☺░████£££ ", " ☺ ████£££ ", " ☺████£££ ", " ☺████£££ ", " ☺▓███£££ ", " ☺▓███£££ ", " ☺▒███£££ ", " ☺▒███£££ ", " ☺░███£££ ", " ☺░███£££ ", " ☺ ███£££ ", " ☺███£££ ", " ☺███£££ ", " ☺▓██£££ ", " ☺▓██£££ ", " ☺▒██£££ ", " ☺▒██£££ ", " ☺░██£££ ", " ☺░██£££ ", " ☺ ██£££ ", " ☺██£££ ", " ☺██£££ ", " ☺▓█£££ ", " ☺▓█£££ ", " ☺▒█£££ ", " ☺▒█£££ ", " ☺░█£££ ", " ☺░█£££ ", " ☺ █£££ ", " ☺█£££ ", " ☺█£££ ", " ☺▓£££ ", " ☺▓£££ ", " ☺▒£££ ", " ☺▒£££ ", " ☺░£££ ", " ☺░£££ ", " ☺ £££ ", " ☺£££ ", " ☺£££ ", " ☺▓££ ", " ☺▓££ ", " ☺▒££ ", " ☺▒££ ", " ☺░££ ", " ☺░££ ", " ☺ ££ ", " ☺££ ", " ☺££ ", " ☺▓£ ", " ☺▓£ ", " ☺▒£ ", " ☺▒£ ", " ☺░£ ", " ☺░£ ", " ☺ £ ", " ☺£ ", " ☺£ ", " ☺▓ ", " ☺▓ ", " ☺▒ ", " ☺▒ ", " ☺░ ", " ☺░ ", " ☺ ", " ☺ &", " ☺ ☼&", " ☺ ☼ &", " ☺☼ &", " ☺☼ & ", " ‼ & ", " ☺ & ", " ‼ & ", " ☺ & ", " ‼ & ", " ☺ & ", "‼ & ", " & ", " & ", " & ░ ", " & ▒ ", " & ▓ ", " & £ ", " & ░£ ", " & ▒£ ", " & ▓£ ", " & ££ ", " & ░££ ", " & ▒££ ", "& ▓££ ", "& £££ ", " ░£££ ", " ▒£££ ", " ▓£££ ", " █£££ ", " ░█£££ ", " ▒█£££ ", " ▓█£££ ", " ██£££ ", " ░██£££ ", " ▒██£££ ", " ▓██£££ ", " ███£££ ", " ░███£££ ", " ▒███£££ ", " ▓███£££ ", " ████£££ ", " ░████£££ ", " ▒████£££ ", " ▓████£££ ", " █████£££ ", " ░█████£££ ", " ▒█████£££ ", " ▓█████£££ ", " ██████£££ ", " ██████£££ "] }, qn = {
64
- dots: te,
65
- dots2: ie,
66
- dots3: oe,
67
- dots4: le,
68
- dots5: ce,
69
- dots6: ae,
70
- dots7: ue,
71
- dots8: _e,
72
- dots9: fe,
73
- dots10: me,
74
- dots11: de,
75
- dots12: ve,
76
- dots13: Le,
77
- dots8Bit: he,
78
- sand: ge,
79
- line: pe,
80
- line2: we,
81
- pipe: Ce,
82
- simpleDots: be,
83
- simpleDotsScrolling: xe,
84
- star: Me,
85
- star2: Ie,
86
- flip: je,
87
- hamburger: Ae,
88
- growVertical: Ee,
89
- growHorizontal: Ve,
90
- balloon: Se,
91
- balloon2: Fe,
92
- noise: Re,
93
- bounce: Be,
94
- boxBounce: De,
95
- boxBounce2: Oe,
96
- triangle: Pe,
97
- binary: qe,
98
- arc: Ne,
99
- circle: Te,
100
- squareCorners: He,
101
- circleQuarters: Ue,
102
- circleHalves: We,
103
- squish: $e,
104
- toggle: Ke,
105
- toggle2: ze,
106
- toggle3: Ye,
107
- toggle4: Qe,
108
- toggle5: Ze,
109
- toggle6: Ge,
110
- toggle7: Je,
111
- toggle8: Xe,
112
- toggle9: ye,
113
- toggle10: ke,
114
- toggle11: en,
115
- toggle12: nn,
116
- toggle13: rn,
117
- arrow: sn,
118
- arrow2: tn,
119
- arrow3: on,
120
- bouncingBar: ln,
121
- bouncingBall: cn,
122
- smiley: an,
123
- monkey: un,
124
- hearts: _n,
125
- clock: fn,
126
- earth: mn,
127
- material: dn,
128
- moon: vn,
129
- runner: Ln,
130
- pong: hn,
131
- shark: gn,
132
- dqpb: pn,
133
- weather: wn,
134
- christmas: Cn,
135
- grenade: bn,
136
- point: xn,
137
- layer: Mn,
138
- betaWave: In,
139
- fingerDance: jn,
140
- fistBump: An,
141
- soccerHeader: En,
142
- mindblown: Vn,
143
- speaker: Sn,
144
- orangePulse: Fn,
145
- bluePulse: Rn,
146
- orangeBluePulse: Bn,
147
- timeTravel: Dn,
148
- aesthetic: On,
149
- dwarfFortress: Pn
150
- };
151
- var W, z;
152
- function Nn() {
153
- if (z) return W;
154
- z = 1;
155
- const n = Object.assign({}, qn), r = Object.keys(n);
156
- return Object.defineProperty(n, "random", {
157
- get() {
158
- const c = Math.floor(Math.random() * r.length), t = r[c];
159
- return n[t];
160
- }
161
- }), W = n, W;
162
- }
163
- var Tn = Nn();
164
- const Hn = /* @__PURE__ */ ee(Tn);
165
- function er({ type: n = "dots" }) {
166
- const [r, c] = m.useState(0), t = Hn[n];
167
- return m.useEffect(() => {
168
- const s = setInterval(() => {
169
- c((u) => u === t.frames.length - 1 ? 0 : u + 1);
170
- }, t.interval);
171
- return () => {
172
- clearInterval(s);
173
- };
174
- }, [t]), y.createElement(D, null, t.frames[r]);
175
- }
176
- function $(n) {
177
- if (n.length === 0)
178
- return [""];
179
- const r = n.replace(/\r\n/g, `
180
- `).replace(/\r/g, `
181
- `), c = r.split(`
182
- `);
183
- return r.endsWith(`
184
- `) && c.push(""), c;
185
- }
186
- function B(n) {
187
- return n.join(`
188
- `);
189
- }
190
- function Un(n, r, c) {
191
- const t = Math.max(0, r), s = Math.min(n, t + c);
192
- return { start: t, end: s };
193
- }
194
- function N(n, r, c, t) {
195
- if (n < r)
196
- return n;
197
- const s = r + c - 1;
198
- return n > s ? Math.max(0, n - c + 1) : r;
199
- }
200
- function K(n, r, c) {
201
- const t = Math.max(0, Math.min(r, n.length - 1)), s = Math.max(
202
- 0,
203
- Math.min(c, n[t].length)
204
- );
205
- return {
206
- line: t,
207
- column: s
208
- };
209
- }
210
- function U(n, r, c) {
211
- const t = n.length;
212
- if (c === -1) {
213
- if (r === 0) return 0;
214
- let s = r - 1;
215
- for (; s > 0 && /\s/.test(n[s]); )
216
- s--;
217
- for (; s > 0 && !/\s/.test(n[s]); )
218
- s--;
219
- return s > 0 || s === 0 && !/\s/.test(n[0]) ? s : 0;
220
- } else {
221
- if (r >= t) return t;
222
- let s = r;
223
- for (; s < t && !/\s/.test(n[s]); )
224
- s++;
225
- for (; s < t && /\s/.test(n[s]); )
226
- s++;
227
- return s;
228
- }
229
- }
230
- const Wn = m.memo(function({
231
- content: r,
232
- lineNumber: c,
233
- showCursor: t,
234
- cursorColumn: s,
235
- isFocused: u
236
- }) {
237
- const h = m.useMemo(() => {
238
- if (!t || !u)
239
- return r;
240
- const I = Array.from(r);
241
- let a = "", p = 0;
242
- for (const v of I)
243
- p === s ? a += T.inverse(v || " ") : a += v, p++;
244
- return s >= I.length && (a += T.inverse(" ")), a;
245
- }, [r, t, s, u]);
246
- return /* @__PURE__ */ b.jsx(D, { children: h });
247
- });
248
- function nr({
249
- id: n,
250
- placeholder: r = "",
251
- autoFocus: c = !0,
252
- showCursor: t = !0,
253
- value: s,
254
- onChange: u,
255
- onSubmit: h,
256
- onHotKey: I,
257
- disabled: a = !1,
258
- maxVisibleLines: p,
259
- enableVirtualScroll: v = !0
260
- }) {
261
- const { isFocused: w } = Q({ autoFocus: c, id: n }), j = m.useRef(!1), x = m.useRef(s), [e, g] = m.useState(() => {
262
- const _ = $(s);
263
- return {
264
- lines: _,
265
- cursorLine: _.length - 1,
266
- cursorColumn: _[_.length - 1].length,
267
- firstVisibleLine: 0
268
- };
269
- });
270
- m.useEffect(() => {
271
- if (j.current) {
272
- j.current = !1, x.current = s;
273
- return;
274
- }
275
- s !== x.current && (g((_) => {
276
- const l = $(s), o = B(l), f = B(_.lines);
277
- if (o === f)
278
- return _;
279
- const i = K(l, _.cursorLine, _.cursorColumn);
280
- return {
281
- ..._,
282
- lines: l,
283
- ...i
284
- };
285
- }), x.current = s);
286
- }, [s]);
287
- const E = m.useMemo(() => p || Math.min(10, e.lines.length), [p, e.lines.length]), { start: P, end: H } = m.useMemo(
288
- () => Un(e.lines.length, e.firstVisibleLine, E),
289
- [e.lines.length, e.firstVisibleLine, E]
290
- ), A = m.useCallback(
291
- (_, l) => {
292
- const o = K(e.lines, _, l), f = N(
293
- o.line,
294
- e.firstVisibleLine,
295
- E,
296
- e.lines.length
297
- );
298
- g({
299
- ...e,
300
- cursorLine: o.line,
301
- cursorColumn: o.column,
302
- firstVisibleLine: f
303
- });
304
- },
305
- [e, E]
306
- ), d = m.useCallback(
307
- (_) => {
308
- const l = B(_);
309
- j.current = !0, u?.(l);
310
- },
311
- [u]
312
- );
313
- k((_, l) => {
314
- if (!(a || !w) && !(I && !I(_, l)) && !(l.ctrl && _ === "c" || l.tab || l.shift && l.tab)) {
315
- if (l.return) {
316
- if (!l.ctrl && !l.alt) {
317
- h?.(B(e.lines));
318
- return;
319
- }
320
- const o = e.lines[e.cursorLine], f = o.slice(0, e.cursorColumn), i = o.slice(e.cursorColumn), L = [...e.lines];
321
- L[e.cursorLine] = f, L.splice(e.cursorLine + 1, 0, i), g({
322
- lines: L,
323
- cursorLine: e.cursorLine + 1,
324
- cursorColumn: 0,
325
- firstVisibleLine: N(
326
- e.cursorLine + 1,
327
- e.firstVisibleLine,
328
- E,
329
- L.length
330
- )
331
- }), d(L);
332
- return;
333
- }
334
- if (l.leftArrow) {
335
- if (!t) return;
336
- if (l.ctrl || l.alt) {
337
- const o = e.lines[e.cursorLine], f = U(o, e.cursorColumn, -1);
338
- A(e.cursorLine, f);
339
- } else if (e.cursorColumn > 0)
340
- A(e.cursorLine, e.cursorColumn - 1);
341
- else if (e.cursorLine > 0) {
342
- const o = e.lines[e.cursorLine - 1].length;
343
- A(e.cursorLine - 1, o);
344
- }
345
- return;
346
- }
347
- if (l.rightArrow) {
348
- if (!t) return;
349
- if (l.ctrl || l.alt) {
350
- const o = e.lines[e.cursorLine], f = U(o, e.cursorColumn, 1);
351
- A(e.cursorLine, f);
352
- } else e.cursorColumn < e.lines[e.cursorLine].length ? A(e.cursorLine, e.cursorColumn + 1) : e.cursorLine < e.lines.length - 1 && A(e.cursorLine + 1, 0);
353
- return;
354
- }
355
- if (l.upArrow) {
356
- if (!t) return;
357
- l.alt || l.ctrl ? A(e.cursorLine, 0) : A(e.cursorLine - 1, e.cursorColumn);
358
- return;
359
- }
360
- if (l.downArrow) {
361
- if (!t) return;
362
- l.alt || l.ctrl ? A(e.cursorLine, e.lines[e.cursorLine].length) : A(e.cursorLine + 1, e.cursorColumn);
363
- return;
364
- }
365
- if (l.ctrl && _ === "a" || l.alt && l.leftArrow) {
366
- if (!t) return;
367
- A(e.cursorLine, 0);
368
- return;
369
- }
370
- if (l.ctrl && _ === "e" || l.alt && l.rightArrow) {
371
- if (!t) return;
372
- A(e.cursorLine, e.lines[e.cursorLine].length);
373
- return;
374
- }
375
- if (l.backspace) {
376
- const o = K(e.lines, e.cursorLine, e.cursorColumn), f = o.column !== e.cursorColumn || o.line !== e.cursorLine, i = o.line, L = o.column;
377
- if (l.ctrl || l.alt) {
378
- const M = e.lines[i];
379
- if (L > 0) {
380
- const S = U(M, L, -1);
381
- if (S < L) {
382
- const C = M.slice(0, S) + M.slice(L), F = [...e.lines];
383
- F[i] = C;
384
- const q = B(F);
385
- g({
386
- ...e,
387
- lines: F,
388
- cursorLine: f ? i : e.cursorLine,
389
- cursorColumn: S
390
- }), j.current = !0, u?.(q);
391
- }
392
- } else if (i > 0) {
393
- const S = e.lines[i - 1], C = [...e.lines];
394
- C[i - 1] = S + M, C.splice(i, 1);
395
- const F = B(C);
396
- g({
397
- lines: C,
398
- cursorLine: i - 1,
399
- cursorColumn: S.length,
400
- firstVisibleLine: N(
401
- i - 1,
402
- e.firstVisibleLine,
403
- E,
404
- C.length
405
- )
406
- }), j.current = !0, u?.(F);
407
- }
408
- } else if (L > 0) {
409
- const M = e.lines[i], S = M.slice(0, L - 1) + M.slice(L), C = [...e.lines];
410
- C[i] = S;
411
- const F = B(C);
412
- g({
413
- ...e,
414
- lines: C,
415
- cursorLine: f ? i : e.cursorLine,
416
- cursorColumn: L - 1
417
- }), j.current = !0, u?.(F);
418
- } else if (i > 0) {
419
- const M = e.lines[i - 1], S = e.lines[i], C = [...e.lines];
420
- C[i - 1] = M + S, C.splice(i, 1);
421
- const F = N(
422
- i - 1,
423
- e.firstVisibleLine,
424
- E,
425
- C.length
426
- ), q = B(C);
427
- g({
428
- lines: C,
429
- cursorLine: i - 1,
430
- cursorColumn: M.length,
431
- firstVisibleLine: F
432
- }), j.current = !0, u?.(q);
433
- }
434
- return;
435
- }
436
- if (l.delete) {
437
- const o = e.lines[e.cursorLine];
438
- if (l.ctrl || l.alt) {
439
- if (e.cursorColumn < o.length) {
440
- const f = U(o, e.cursorColumn, 1);
441
- if (f > e.cursorColumn) {
442
- const i = o.slice(0, e.cursorColumn) + o.slice(f), L = [...e.lines];
443
- L[e.cursorLine] = i, g({
444
- ...e,
445
- lines: L
446
- }), d(L);
447
- }
448
- } else if (e.cursorLine < e.lines.length - 1) {
449
- const f = e.lines[e.cursorLine + 1], i = [...e.lines];
450
- i[e.cursorLine] = o + f, i.splice(e.cursorLine + 1, 1), g({
451
- ...e,
452
- lines: i
453
- }), d(i);
454
- }
455
- } else if (e.cursorColumn < o.length) {
456
- const f = o.slice(0, e.cursorColumn) + o.slice(e.cursorColumn + 1), i = [...e.lines];
457
- i[e.cursorLine] = f, g({
458
- ...e,
459
- lines: i
460
- }), d(i);
461
- } else if (e.cursorLine < e.lines.length - 1) {
462
- const f = e.lines[e.cursorLine + 1], i = [...e.lines];
463
- i[e.cursorLine] = o + f, i.splice(e.cursorLine + 1, 1), g({
464
- ...e,
465
- lines: i
466
- }), d(i);
467
- }
468
- return;
469
- }
470
- if (_)
471
- if (_.includes(`
472
- `)) {
473
- const o = $(_);
474
- if (o.length === 1) {
475
- const f = e.lines[e.cursorLine], i = f.slice(0, e.cursorColumn) + _ + f.slice(e.cursorColumn), L = [...e.lines];
476
- L[e.cursorLine] = i, g({
477
- ...e,
478
- lines: L,
479
- cursorColumn: e.cursorColumn + _.length
480
- }), d(L);
481
- } else {
482
- const f = e.lines[e.cursorLine], i = f.slice(0, e.cursorColumn), L = f.slice(e.cursorColumn), M = [...e.lines];
483
- M[e.cursorLine] = i + o[0];
484
- const S = o.slice(1, -1);
485
- M.splice(e.cursorLine + 1, 0, ...S);
486
- const C = o[o.length - 1] + L;
487
- M.splice(e.cursorLine + S.length + 1, 0, C);
488
- const F = e.cursorLine + o.length - 1, q = o[o.length - 1].length;
489
- g({
490
- lines: M,
491
- cursorLine: F,
492
- cursorColumn: q,
493
- firstVisibleLine: N(
494
- F,
495
- e.firstVisibleLine,
496
- E,
497
- M.length
498
- )
499
- }), d(M);
500
- }
501
- } else {
502
- const o = e.lines[e.cursorLine], f = (o?.slice(0, e.cursorColumn) || "") + _ + (o?.slice(e.cursorColumn) || ""), i = [...e.lines];
503
- i[e.cursorLine] = f, g({
504
- ...e,
505
- lines: i,
506
- cursorColumn: e.cursorColumn + _.length
507
- }), d(i);
508
- }
509
- }
510
- });
511
- const V = m.useMemo(() => e.lines.slice(P, H), [e.lines, P, H]);
512
- return e.lines.length === 0 || e.lines.every((_) => _.length === 0) ? !w || !t ? /* @__PURE__ */ b.jsx(D, { children: T.grey(r) }) : /* @__PURE__ */ b.jsx(D, { children: T.inverse(r[0] || " ") + T.grey(r.slice(1)) }) : /* @__PURE__ */ b.jsx(O, { flexDirection: "column", children: V.map((_, l) => {
513
- const o = P + l;
514
- return /* @__PURE__ */ b.jsx(
515
- Wn,
516
- {
517
- content: _,
518
- lineNumber: o,
519
- showCursor: t && o === e.cursorLine,
520
- cursorColumn: e.cursorColumn,
521
- isFocused: w
522
- },
523
- o
524
- );
525
- }) });
526
- }
527
- const $n = (n, r, c) => {
528
- const t = parseInt(n.slice(1, 3), 16), s = parseInt(n.slice(3, 5), 16), u = parseInt(n.slice(5, 7), 16), h = parseInt(r.slice(1, 3), 16), I = parseInt(r.slice(3, 5), 16), a = parseInt(r.slice(5, 7), 16), p = Math.round(t + c * (h - t)), v = Math.round(s + c * (I - s)), w = Math.round(u + c * (a - u));
529
- return `#${((1 << 24) + (p << 16) + (v << 8) + w).toString(16).slice(1).toUpperCase()}`;
530
- }, rr = ({
531
- text: n,
532
- highlightColor: r = "#00FFFF",
533
- // Cyan
534
- baseColor: c = "#003333",
535
- // Dark Cyan
536
- interval: t = 20,
537
- spread: s = 32,
538
- globalIndex: u
539
- }) => {
540
- const [h, I] = m.useState(0), a = u !== void 0 ? u : h;
541
- return m.useEffect(() => {
542
- if (u !== void 0) return;
543
- const p = setInterval(() => {
544
- I((v) => (v + 1) % (n.length + s * 2));
545
- }, t);
546
- return () => clearInterval(p);
547
- }, [n.length, s, t, u]), /* @__PURE__ */ b.jsx(D, { children: n.split("").map((p, v) => {
548
- const w = a - s, j = Math.abs(v - w);
549
- let x = c, e = !1;
550
- if (j < s) {
551
- const g = Math.cos(j / s * (Math.PI / 2)), E = Math.pow(g, 2);
552
- x = $n(c, r, E), e = j < 1;
553
- }
554
- return /* @__PURE__ */ b.jsx(D, { color: x, bold: e, children: p }, v);
555
- }) });
556
- }, Kn = ({ option: n, isSelected: r, isHighlighted: c, isFocused: t, isComponentDisabled: s }) => {
557
- const u = !t || s;
558
- let h = "white";
559
- return n.disabled ? h = "gray" : r ? h = t ? "green" : "gray" : c && t ? h = "cyan" : u && (h = "gray"), /* @__PURE__ */ b.jsx(O, { children: /* @__PURE__ */ b.jsxs(D, { color: h, children: [
560
- r ? "◉ " : "○ ",
561
- n.label
562
- ] }) });
563
- }, zn = ({ isSelected: n }) => /* @__PURE__ */ b.jsx(D, { color: n ? "green" : "gray", children: n ? "◉" : "○" }), Yn = ({ values: n }) => /* @__PURE__ */ b.jsx(b.Fragment, {}), sr = ({
564
- options: n,
565
- values: r,
566
- defaultValues: c = [],
567
- onChange: t,
568
- onSubmit: s,
569
- disabled: u = !1,
570
- highlightText: h,
571
- itemComponent: I = Kn,
572
- indicatorComponent: a = zn,
573
- statusComponent: p = Yn,
574
- autoFocus: v = !0,
575
- singleSelect: w = !1
576
- }) => {
577
- const { isFocused: j } = Q({ autoFocus: v }), [x, e] = m.useState(r || c), [g, E] = m.useState(0);
578
- m.useEffect(() => {
579
- r !== void 0 && e(r);
580
- }, [r]);
581
- const P = m.useCallback(
582
- (d) => {
583
- if (u || n[d].disabled) return;
584
- const V = n[d];
585
- let R;
586
- w ? R = x.includes(V.value) ? [] : [V.value] : R = x.includes(V.value) ? x.filter((_) => _ !== V.value) : [...x, V.value], e(R), t?.(R);
587
- },
588
- [x, n, u, t, w]
589
- ), H = m.useCallback(() => {
590
- if (!u) {
591
- if (x.length === 0 && n.length > 0) {
592
- const d = n[g];
593
- if (d && !d.disabled) {
594
- t?.([d.value]), s?.([d.value]);
595
- return;
596
- }
597
- }
598
- s?.(x);
599
- }
600
- }, [x, u, s, n, g]);
601
- se((d, V) => {
602
- !j || u || (V.upArrow ? E((R) => Math.max(0, R - 1)) : V.downArrow ? E((R) => Math.min(n.length - 1, R + 1)) : V.return ? H() : d === " " && P(g));
603
- });
604
- const A = h ? n.filter(
605
- (d) => d.label.toLowerCase().includes(h.toLowerCase()) || d.value.toLowerCase().includes(h.toLowerCase())
606
- ) : n;
607
- return /* @__PURE__ */ b.jsxs(O, { flexDirection: "column", children: [
608
- /* @__PURE__ */ b.jsx(O, { marginBottom: 1, children: /* @__PURE__ */ b.jsx(p, { values: x }) }),
609
- /* @__PURE__ */ b.jsx(O, { flexDirection: "column", children: A.map((d, V) => {
610
- const R = x.includes(d.value), _ = V === g;
611
- return /* @__PURE__ */ b.jsx(O, { children: /* @__PURE__ */ b.jsx(
612
- I,
613
- {
614
- option: d,
615
- isSelected: R,
616
- isHighlighted: _,
617
- isFocused: j,
618
- isComponentDisabled: u
619
- }
620
- ) }, d.value);
621
- }) })
622
- ] });
623
- }, Qn = async () => {
624
- if (!process.env.ANTHROPIC_API_KEY) return [];
625
- let n = [];
626
- for await (const r of new re().beta.models.list())
627
- n.push({
628
- id: r.id,
629
- name: r.display_name,
630
- provider: "anthropic"
631
- });
632
- return n;
633
- }, Zn = async () => process.env.OPENAI_API_KEY ? new ne().models.list().then(
634
- (n) => n.data.map((r) => ({
635
- id: r.id,
636
- name: r.id,
637
- provider: "openai"
638
- })).sort((r, c) => r.id.localeCompare(c.id))
639
- ) : [], tr = async () => Promise.all([
640
- Qn().catch((n) => (console.log(n), [])),
641
- Zn().catch((n) => (console.log(n), []))
642
- ]).then((n) => n.flat());
643
- export {
644
- sr as M,
645
- rr as S,
646
- nr as a,
647
- er as b,
648
- Q as c,
649
- tr as g,
650
- se as u
651
- };