SLOPSHOPPER

codemode

One tool that runs a JavaScript program over Claude Code's own tools and returns only its final value.

newrowsguardtoolmodel
v0.1.0MITupdated 2026-10-15brianjmeier/claude-codemode
A shopper browsing a rack in a slop shop
README

codemode for Claude Code

A Claude Code mod that gives the model one tool, mcp__codemode__run: it writes a JavaScript program, the program calls Claude Code's own tools (Read, Bash, Edit, MCP tools — anything the session has), and only the program's return value comes back into the conversation.

One codemode program reads every station README, asks haiku for a one-line summary of each in parallel, writes a Claude Doc, and starts an Explore subagent

It ships with a codemode skill that tells the model when a program beats direct calls and how to write one.

Install

/plugin marketplace add brianjmeier/claude-codemode
/plugin install codemode@claude-codemode

Or for one session: claude --plugin-dir <this folder>.

What a program can do

In the programWhat it doesShows in the row as
await tool(name, args)Calls any tool the session has: built-in (Read, Edit, Bash, Glob, WebFetch…) or MCP (mcp__server__tool), with the tool's usual arguments. Resolves { text, result, isError }.✓ Read src/a.ts 12ms
await tools.Name(args)The same, for names that are valid identifiers.
await Promise.all([...])Runs calls in parallel; each keeps its own line and time.one line per call
await ask({ model, prompt })One question to a model (haiku, sonnet, …) with no tools; resolves its answer as text. Hand it the text it needs.✓ ask haiku summarize… 1.2s
await agent({ type, prompt })Starts a real subagent (Explore, Plan, a plugin's agent) and resolves { agentId } at once. Its answer reaches Claude as a normal subagent hand-back, not the program.↗ Explore … started, reports to Claude
await canCall(name, args)What the permission check would decide ("allow", "ask", "deny") without running anything.
await cwd()The session's working directory, for absolute paths.
await listTools()[{ name, description }] of everything callable.
log(...values)A line in the output Claude reads.
ToolDeniedWhat a refused call or spawn throws (error.tool, error.reason).✗ Bash jj log denied

return a string to get it back verbatim, anything else as JSON; only that, the log lines and a count of the calls reach the conversation. The row types the program out while Claude writes it, then fills in each call as it runs.

Not offered, and why

MissingWhy
Waiting for a subagent's answerA mod's tool call gets 10 s of its own time, and the plugin API has no call that waits for a subagent to finish; agent() therefore hands off, and ask() covers answers the program needs.
tool("Agent", …)Claude Code refuses the Agent tool from a mod and requires $.agent.spawn, which is what agent() uses.
Its own filesystem, network, processes, env, eval, importsEach would let a program act without the permission check. The same work goes through Read, Write, Bash, WebFetch… as tool calls.
Interrupting a synchronous infinite loopThe interpreter cannot be preempted; keep loops bounded by the data they walk.

Permissions and containment

  • Every nested call is a real tool call. It goes through $.tool.call, the same path as the model's own calls: your allow/deny rules, auto mode, PreToolUse hooks and the permission dialog all apply, per call, with that call's own arguments.
  • The program has nothing else. It runs in sval, a JavaScript interpreter written in JavaScript, inside the mod's own hooks runtime — which has no Node, no filesystem, no network, no process, and refuses eval, Function and WebAssembly. The interpreter is needed exactly because that runtime will not compile code from text. The program cannot reach the engine's $, and cannot start another program.
  • One limit beyond the table above: the program shares the runtime's built-in prototypes, so it can monkey-patch Array.prototype for this mod's runtime (not the session, not the filesystem).

Develop

claude plugin validate .
claude plugin test .

hooks/vendor/sval.js is sval 0.6.12 (MIT), vendored with one fix: untagged template literals process their escapes (upstream returns the raw text).

Source 6 files
hooks/register.tsx 128 lines
1import { atom, memberOf, read } from 'claude-code'
2import type { EngineInterface, Register, ToolCallArgs } from 'claude-code'
3import type { Run } from '../types'
4import { report, runScript, type ToolHost } from './script'
5import { codeSoFar } from './typing'
6import { drawRun, type Program } from './view'
7
8declare module 'claude-code' {
9  interface McpToolInputs {
10    mcp__codemode__run: { code: string }
11  }
12}
13
14export const TOOL = 'mcp__codemode__run'
15
16const DESCRIPTION = `Run one JavaScript program that calls Claude Code's own tools and returns only its final value.
17
18Use it to loop, branch, filter and aggregate over many tool calls without each raw result entering the conversation.
19
20The program is the body of an async function:
21- \`await tool("Read", { file_path: "README.md" })\` calls any tool you can call, by name, with its usual arguments.
22- \`await tools.Grep({ pattern: "TODO" })\` is the same call for names that are valid property names.
23- Each call resolves \`{ text, result, isError }\`: \`text\` is what you would have read, \`result\` the tool's structured record (Read: \`result.file.content\`; Bash: \`result.stdout\`, \`result.stderr\`). A tool that fails resolves with \`isError: true\`.
24- A call the permission check refuses throws \`ToolDenied\` (\`e.tool\`, \`e.reason\`).
25- \`await ask({ model: "haiku", prompt: "..." })\` asks a model one question with no tools and resolves its answer as text; hand it the text it needs. Several can run at once with \`Promise.all\`. Start each prompt with what differs (\`prs: summarize…\`): the person sees the first words of every call.
26- \`await agent({ type: "Explore", prompt: "..." })\` starts a subagent and resolves \`{ agentId }\` at once; its answer reaches you as a normal subagent hand-back, not the program.
27- \`await listTools()\` returns \`[{ name, description }]\`.
28- \`await canCall(name, args)\` returns \`"allow"\`, \`"ask"\` or \`"deny"\`: what the permission check would decide, without running anything.
29- \`await cwd()\` returns the session's working directory, for absolute paths.
30- \`log(...values)\` adds a line to the output.
31- \`return\` the value you want back; objects come back as JSON.
32
33Every call goes through the same permission check, hooks and dialog as if you had made it directly. The program has no filesystem, network, process, imports or eval of its own: side effects happen only through tools.`
34
35const runs = atom({ plugin: 'codemode', key: 'runs' } as const, {
36  calls: [],
37  logs: [],
38  outcome: { kind: 'running' },
39  elapsedMs: null,
40} as Run)
41
42const typed = atom({ plugin: 'codemode', key: 'typed' } as const, '')
43
44const hostOf = ($: EngineInterface, requestId: string): ToolHost => ({
45  call: async (tool, args) => {
46    if (tool === TOOL) return { kind: 'denied', reason: 'a program cannot start another program' }
47    const answer = await $.tool.call({ ...args, tool } as ToolCallArgs)
48    if (answer.deny !== undefined) return { kind: 'denied', reason: answer.deny }
49    return { kind: 'answered', text: answer.text ?? '', result: answer.result, isError: answer.isError === true }
50  },
51  agent: async ({ type, prompt }) => {
52    const spawned = await $.agent.spawn({ prompt, subagentType: type, description: prompt.slice(0, 40) })
53    if (spawned.deny !== undefined) return { kind: 'denied', reason: spawned.deny }
54    if (spawned.agentId === undefined) return { kind: 'denied', reason: `the ${type} subagent did not start` }
55    return { kind: 'started', agentId: spawned.agentId }
56  },
57  ask: async ({ model, prompt }) => {
58    const answer = await $.model.complete({ model, prompt })
59    if (answer.isAnswered) return { kind: 'answered', text: answer.text, result: answer.text, isError: false }
60    return { kind: 'answered', text: answer.reason, result: answer.reason, isError: true }
61  },
62  list: async () =>
63    (await $.tool.list())
64      .filter(info => info.name !== TOOL)
65      .map(({ name, description }) => ({ name, description })),
66  check: async (tool, args) => (await $.tool.check({ tool, input: args })).decision,
67  cwd: () => $.session.cwd(),
68  now: () => $.clock.now(),
69  publish: async run => {
70    await $.state.set({ plugin: 'codemode', key: 'runs', id: requestId }, run)
71  },
72})
73
74export const register: Register = on => {
75  on('session.start', async ($, e, next) => {
76    await $.tool.register({
77      name: 'run',
78      description: DESCRIPTION,
79      inputSchema: {
80        type: 'object',
81        properties: { code: { type: 'string', description: 'The body of an async function. `return` the final value.' } },
82        required: ['code'],
83        additionalProperties: false,
84      },
85      isDeferred: false,
86    })
87    return next(e)
88  })
89
90  on('tool.call', { tool: TOOL }, async ($, e) => {
91    const run = await runScript(e.code, hostOf($, e.tool_use_id))
92    return run.outcome.kind === 'failed' ? { deny: report(run) } : { result: report(run) }
93  }).catch(($, e, next) => ({
94    deny: `codemode: the program runner itself failed (${next.error.message ?? next.error.kind}); nothing more ran.`,
95  }))
96
97  on('turn.step', async function* ($, e, next) {
98    const ours = new Map<number, { id: string; json: string; code: string }>()
99    for await (const chunk of next(e)) {
100      if (chunk.kind === 'tool' && chunk.name === TOOL) ours.set(chunk.index, { id: chunk.id, json: '', code: '' })
101      const call = chunk.kind === 'input' ? ours.get(chunk.index) : undefined
102      if (call !== undefined && chunk.kind === 'input') {
103        call.json += chunk.json
104        const code = codeSoFar(call.json)
105        if (code !== call.code) {
106          call.code = code
107          await $.state.set({ plugin: 'codemode', key: 'typed', id: call.id }, code)
108        }
109      }
110      yield chunk
111    }
112  })
113
114  on('ui.render', { component: 'ToolUse' }, async ($, e, next) => {
115    if (e.props.tool !== TOOL) return next(e)
116    const { code } = e.props.input as Partial<{ code: string }>
117    const program: Program =
118      code === undefined ? { kind: 'typing', code: await read($, memberOf(typed, e)) } : { kind: 'written', code }
119    return drawRun($, e, program, await read($, memberOf(runs, e)))
120  })
121
122  on('ui.render', { component: 'ToolResult' }, async ($, e, next) => {
123    if (e.props.tool !== TOOL) return next(e)
124    const { Box } = $.ui.resolve(e)
125    return <Box />
126  })
127}
128
hooks/script.ts 141 lines
1import Sval from './vendor/sval.js'
2import type { NestedCall, Run } from '../types'
3
4type ToolAnswer = { text: string; result: unknown; isError: boolean }
5
6export type HostAnswer =
7  | { kind: 'denied'; reason: string }
8  | { kind: 'started'; agentId: string }
9  | ({ kind: 'answered' } & ToolAnswer)
10
11export type AgentAsk = { type: string; prompt: string }
12
13export type ModelAsk = { model: string; prompt: string }
14
15export type ToolHost = {
16  call: (tool: string, args: Record<string, unknown>) => Promise<HostAnswer>
17  agent: (ask: AgentAsk) => Promise<HostAnswer>
18  ask: (ask: ModelAsk) => Promise<HostAnswer>
19  list: () => Promise<readonly { name: string; description: string }[]>
20  check: (tool: string, args: Record<string, unknown>) => Promise<'allow' | 'ask' | 'deny'>
21  cwd: () => Promise<string>
22  now: () => Promise<number>
23  publish: (run: Run) => Promise<void>
24}
25
26export class ToolDenied extends Error {
27  constructor(
28    readonly tool: string,
29    readonly reason: string,
30  ) {
31    super(`${tool} was denied: ${reason}`)
32    this.name = 'ToolDenied'
33  }
34}
35
36const SUMMARY_KEYS = ['command', 'file_path', 'pattern', 'path', 'url', 'query', 'description']
37const SUMMARY_LENGTH = 120
38
39const oneLine = (text: string): string => text.replace(/\s+/g, ' ').trim().slice(0, SUMMARY_LENGTH)
40
41const summaryOf = (args: Record<string, unknown>, root: string): string => {
42  const key = SUMMARY_KEYS.find(name => typeof args[name] === 'string')
43  return oneLine((key === undefined ? JSON.stringify(args) : String(args[key])).replaceAll(`${root}/`, ''))
44}
45
46const describe = (value: unknown): string =>
47  typeof value === 'string' ? value : (JSON.stringify(value) ?? String(value))
48
49const counted = (calls: readonly NestedCall[]): string => {
50  const counts = new Map<string, number>()
51  for (const { tool } of calls) counts.set(tool, (counts.get(tool) ?? 0) + 1)
52  return [...counts].map(([name, n]) => (n === 1 ? name : `${name} ×${n}`)).join(', ')
53}
54
55const headOf = (run: Run): string => {
56  if (run.outcome.kind === 'returned') return run.outcome.text
57  if (run.outcome.kind === 'failed') return `The program failed: ${run.outcome.reason}`
58  return '(still running)'
59}
60
61export const report = (run: Run): string =>
62  [
63    headOf(run),
64    run.logs.length === 0 ? '' : `log:\n${run.logs.join('\n')}`,
65    run.calls.length === 0 ? '' : `tool calls: ${counted(run.calls)}`,
66  ]
67    .filter(part => part !== '')
68    .join('\n\n')
69
70export async function runScript(code: string, host: ToolHost): Promise<Run> {
71  const startedAt = await host.now()
72  const root = await host.cwd()
73  let run: Run = { calls: [], logs: [], outcome: { kind: 'running' }, elapsedMs: null }
74  const change = (next: Run) => {
75    run = next
76    return host.publish(run)
77  }
78  const settle = (index: number, call: NestedCall) =>
79    change({ ...run, calls: run.calls.map((one, i) => (i === index ? call : one)) })
80
81  const record = async (name: string, summary: string, answerOf: () => Promise<HostAnswer>) => {
82    const callStartedAt = await host.now()
83    const index = run.calls.length
84    await change({ ...run, calls: [...run.calls, { tool: name, summary, status: 'running' }] })
85    const answer = await answerOf()
86    if (answer.kind === 'denied') {
87      await settle(index, { tool: name, summary, status: 'denied' })
88      throw new ToolDenied(name, answer.reason)
89    }
90    if (answer.kind === 'started') {
91      await settle(index, { tool: name, summary, status: 'started' })
92      return answer
93    }
94    const ms = (await host.now()) - callStartedAt
95    await settle(index, { tool: name, summary, status: answer.isError ? 'failed' : 'done', ms })
96    return answer
97  }
98
99  const tool = async (name: string, args: Record<string, unknown>) => {
100    const answer = await record(name, summaryOf(args, root), () => host.call(name, args))
101    return answer.kind === 'answered' ? { text: answer.text, result: answer.result, isError: answer.isError } : answer
102  }
103  const agent = async (ask: AgentAsk) => {
104    const answer = await record(ask.type, oneLine(ask.prompt), () => host.agent(ask))
105    return answer.kind === 'started' ? { agentId: answer.agentId } : answer
106  }
107  const ask = async (question: ModelAsk) => {
108    const answer = await record(`ask ${question.model}`, oneLine(question.prompt), () => host.ask(question))
109    if (answer.kind === 'answered' && answer.isError) throw new Error(`ask ${question.model} failed: ${answer.text}`)
110    return answer.kind === 'answered' ? answer.text : ''
111  }
112  const tools = new Proxy(
113    {},
114    { get: (_, name) => (args: Record<string, unknown>) => tool(String(name), args) },
115  )
116
117  const interpreter = new Sval({ ecmaVer: 'latest', sandBox: true })
118  interpreter.import({
119    tool,
120    tools,
121    agent,
122    ask,
123    listTools: host.list,
124    canCall: host.check,
125    cwd: host.cwd,
126    log: (...parts: unknown[]) => void change({ ...run, logs: [...run.logs, parts.map(describe).join(' ')] }),
127    ToolDenied,
128  })
129
130  let outcome: Run['outcome']
131  try {
132    interpreter.run(`exports.run = (async () => {\n${code}\n})()`)
133    const value: unknown = await (interpreter.exports as { run: Promise<unknown> }).run
134    outcome = { kind: 'returned', text: value === undefined ? '(no value returned)' : describe(value) }
135  } catch (error) {
136    outcome = { kind: 'failed', reason: error instanceof Error ? `${error.name}: ${error.message}` : describe(error) }
137  }
138  await change({ ...run, outcome, elapsedMs: (await host.now()) - startedAt })
139  return run
140}
141
hooks/typing.ts 33 lines
1const ESCAPES: Record<string, string> = { '"': '"', '\\': '\\', '/': '/', b: '\b', f: '\f', n: '\n', r: '\r', t: '\t' }
2
3const KEY = /"code"\s*:\s*"/
4
5const decodeFrom = (json: string, from: number): string => {
6  let code = ''
7  let at = from
8  while (at < json.length && json[at] !== '"') {
9    const char = json[at] as string
10    const escaped = json[at + 1]
11    if (char !== '\\') {
12      code += char
13      at += 1
14    } else if (escaped === undefined) {
15      return code
16    } else if (escaped === 'u') {
17      const hex = json.slice(at + 2, at + 6)
18      if (hex.length < 4) return code
19      code += String.fromCharCode(parseInt(hex, 16))
20      at += 6
21    } else {
22      code += ESCAPES[escaped] ?? escaped
23      at += 2
24    }
25  }
26  return code
27}
28
29export function codeSoFar(json: string): string {
30  const key = KEY.exec(json)
31  return key === null ? '' : decodeFrom(json, key.index + key[0].length)
32}
33
hooks/view.tsx 108 lines
1import type { EngineInterface, RenderInput } from 'claude-code'
2import type { NestedCall, Outcome, Run } from '../types'
3
4const CODE_LINES = 6
5const RESULT_LINES = 4
6
7const MARK = {
8  running: { glyph: '…', color: 'inactive' },
9  done: { glyph: '✓', color: 'success' },
10  failed: { glyph: '✗', color: 'error' },
11  started: { glyph: '↗', color: 'suggestion' },
12} as const
13
14const DOT = { running: 'inactive', returned: 'success', failed: 'error' } as const
15
16const duration = (ms: number): string => (ms < 1000 ? `${ms}ms` : `${(ms / 1000).toFixed(1)}s`)
17
18const plural = (n: number, word: string): string => `${n} ${word}${n === 1 ? '' : 's'}`
19
20const head = (text: string, count: number) => {
21  const lines = text.split('\n')
22  return { shown: lines.slice(0, count), hidden: Math.max(0, lines.length - count) }
23}
24
25const tail = (text: string, count: number) => {
26  const lines = text.split('\n')
27  return { shown: lines.slice(-count), hidden: Math.max(0, lines.length - count) }
28}
29
30const MCP_NAME = /^mcp__(.+)__(.+)$/
31const SERVER_PREFIX = /^(claude_ai_|plugin_[a-z0-9-]+_)/
32
33const labelOf = (tool: string): string => {
34  const mcp = MCP_NAME.exec(tool)
35  if (mcp === null) return tool
36  const [, server = '', name = ''] = mcp
37  return `${server.replace(SERVER_PREFIX, '').replaceAll('_', ' ')} › ${name}`
38}
39
40const markOf = (call: NestedCall) => (call.status === 'denied' ? MARK.failed : MARK[call.status])
41
42const settledAs = (call: NestedCall): string => {
43  if (call.status === 'done' || call.status === 'failed') return ` ${duration(call.ms)}`
44  if (call.status === 'started') return ' started, reports to Claude'
45  return call.status === 'denied' ? ' denied' : ''
46}
47
48const answerOf = (outcome: Outcome) => {
49  if (outcome.kind === 'returned') return head(outcome.text, RESULT_LINES)
50  if (outcome.kind === 'failed') return head(outcome.reason, RESULT_LINES)
51  return null
52}
53
54const outcomeOf = (props: RenderInput<'ToolUse'>['props'], run: Run): Outcome => {
55  if (props.isRunning || run.outcome.kind !== 'running' || props.output === undefined) return run.outcome
56  const text = typeof props.output === 'string' ? props.output : JSON.stringify(props.output)
57  return props.isErrored ? { kind: 'failed', reason: text } : { kind: 'returned', text }
58}
59
60export type Program = { kind: 'typing' | 'written'; code: string }
61
62export function drawRun($: EngineInterface, e: RenderInput<'ToolUse'>, source: Program, run: Run) {
63  const { Box, Text, Code } = $.ui.resolve(e)
64  const outcome = outcomeOf(e.props, run)
65  const isTyping = source.kind === 'typing'
66  const program = isTyping ? tail(source.code, CODE_LINES) : head(source.code.trim(), CODE_LINES)
67  const answer = answerOf(outcome)
68
69  return (
70    <Box flexDirection="column">
71      <Text>
72        <Text color={DOT[outcome.kind]}>⏺ </Text>
73        <Text weight="bold">codemode</Text>
74        {run.calls.length > 0 && <Text dimColor>{` · ${plural(run.calls.length, 'call')}`}</Text>}
75        {run.elapsedMs !== null && <Text dimColor>{` · ${duration(run.elapsedMs)}`}</Text>}
76      </Text>
77      <Box flexDirection="column" paddingLeft={2}>
78        {isTyping && program.hidden > 0 && <Text dimColor>… {plural(program.hidden, 'line')} above</Text>}
79        <Code source={`${program.shown.join('\n')}${isTyping ? '▌' : ''}`} language="javascript" wrap="truncate-end" />
80        {!isTyping && program.hidden > 0 && <Text dimColor>… {plural(program.hidden, 'more line')}</Text>}
81      </Box>
82      {run.calls.length > 0 && (
83        <Box flexDirection="column" marginTop={1} paddingLeft={2}>
84          {run.calls.map(call => (
85            <Text wrap="truncate-end">
86              <Text color={markOf(call).color}>{markOf(call).glyph} </Text>
87              <Text weight="bold">{labelOf(call.tool)}</Text>
88              <Text>{` ${call.summary}`}</Text>
89              <Text dimColor>{settledAs(call)}</Text>
90            </Text>
91          ))}
92        </Box>
93      )}
94      {answer !== null && (
95        <Box flexDirection="column" marginTop={1} paddingLeft={2}>
96          {answer.shown.map(line => (
97            <Text wrap="truncate-end" color={outcome.kind === 'failed' ? 'error' : 'text'}>
98              {line}
99            </Text>
100          ))}
101          {answer.hidden > 0 && <Text dimColor>… {plural(answer.hidden, 'more line')}</Text>}
102        </Box>
103      )}
104    </Box>
105  )
106}
107
108
hooks/vendor/sval.js 6089 lines
1// sval 0.6.12 (MIT, https://github.com/Siubaak/sval), vendored from dist/sval.js with one fix:
2// an untagged template literal's pieces evaluate to their cooked value, not their raw text.
3// @ts-nocheck
4const Er = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
5  __proto__: null,
6  get BlockStatement() {
7    return ce;
8  },
9  get BreakStatement() {
10    return ea;
11  },
12  get CatchClause() {
13    return Gi;
14  },
15  get ContinueStatement() {
16    return ta;
17  },
18  get DebuggerStatement() {
19    return Ys;
20  },
21  get DoWhileStatement() {
22    return Ki;
23  },
24  get EmptyStatement() {
25    return Xs;
26  },
27  get ExpressionStatement() {
28    return Zs;
29  },
30  get ForInStatement() {
31    return Zi;
32  },
33  get ForOfStatement() {
34    return Xi;
35  },
36  get ForStatement() {
37    return Qi;
38  },
39  get IfStatement() {
40    return qi;
41  },
42  get LabeledStatement() {
43    return ia;
44  },
45  get ReturnStatement() {
46    return Js;
47  },
48  get SwitchCase() {
49    return kt;
50  },
51  get SwitchStatement() {
52    return Wi;
53  },
54  get ThrowStatement() {
55    return ra;
56  },
57  get TryStatement() {
58    return zi;
59  },
60  get WhileStatement() {
61    return Hi;
62  },
63  get WithStatement() {
64    return $i;
65  }
66}, Symbol.toStringTag, { value: "Module" })), Cr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
67  __proto__: null,
68  get ClassBody() {
69    return Ji;
70  },
71  get ClassDeclaration() {
72    return aa;
73  },
74  get ExportAllDeclaration() {
75    return la;
76  },
77  get ExportDefaultDeclaration() {
78    return oa;
79  },
80  get ExportNamedDeclaration() {
81    return ua;
82  },
83  get FunctionDeclaration() {
84    return sa;
85  },
86  get ImportDeclaration() {
87    return na;
88  },
89  get MethodDefinition() {
90    return er;
91  },
92  get PropertyDefinition() {
93    return Ot;
94  },
95  get StaticBlock() {
96    return tr;
97  },
98  get VariableDeclaration() {
99    return Se;
100  },
101  get VariableDeclarator() {
102    return Yi;
103  }
104}, Symbol.toStringTag, { value: "Module" })), _r = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
105  __proto__: null,
106  get BlockStatement() {
107    return fe;
108  },
109  get BreakStatement() {
110    return ja;
111  },
112  get CatchClause() {
113    return hr;
114  },
115  get ContinueStatement() {
116    return Ua;
117  },
118  get DebuggerStatement() {
119    return Fa;
120  },
121  get DoWhileStatement() {
122    return dr;
123  },
124  get EmptyStatement() {
125    return Da;
126  },
127  get ExpressionStatement() {
128    return Oa;
129  },
130  get ForInStatement() {
131    return mr;
132  },
133  get ForOfStatement() {
134    return gr;
135  },
136  get ForStatement() {
137    return yr;
138  },
139  get IfStatement() {
140    return lr;
141  },
142  get LabeledStatement() {
143    return $a;
144  },
145  get ReturnStatement() {
146    return Ma;
147  },
148  get SwitchCase() {
149    return Ct;
150  },
151  get SwitchStatement() {
152    return cr;
153  },
154  get ThrowStatement() {
155    return qa;
156  },
157  get TryStatement() {
158    return fr;
159  },
160  get WhileStatement() {
161    return pr;
162  },
163  get WithStatement() {
164    return ur;
165  }
166}, Symbol.toStringTag, { value: "Module" })), Ir = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
167  __proto__: null,
168  get ClassBody() {
169    return br;
170  },
171  get ClassDeclaration() {
172    return za;
173  },
174  get ExportAllDeclaration() {
175    return Qa;
176  },
177  get ExportDefaultDeclaration() {
178    return Ha;
179  },
180  get ExportNamedDeclaration() {
181    return Ka;
182  },
183  get FunctionDeclaration() {
184    return Wa;
185  },
186  get ImportDeclaration() {
187    return Ga;
188  },
189  get MethodDefinition() {
190    return vr;
191  },
192  get PropertyDefinition() {
193    return Dt;
194  },
195  get StaticBlock() {
196    return Sr;
197  },
198  get VariableDeclaration() {
199    return we;
200  },
201  get VariableDeclarator() {
202    return xr;
203  }
204}, Symbol.toStringTag, { value: "Module" })), Qe = Object.freeze, w = Object.defineProperty, de = Object.getOwnPropertyDescriptor, Ar = Object.prototype.hasOwnProperty;
205function It(e, t) {
206  return Ar.call(e, t);
207}
208const At = Object.getOwnPropertyNames, Ut = Object.setPrototypeOf;
209function Pr(e, t) {
210  Ut ? Ut(e, t) : e.__proto__ = t;
211}
212const $t = Object.getPrototypeOf;
213function Qt(e) {
214  return $t ? $t(e) : e.__proto__;
215}
216const Lr = Object.getOwnPropertyDescriptor;
217function Zt(e, t, r) {
218  for (; t; ) {
219    const i = Lr(t, r), s = typeof i < "u" && typeof i.writable > "u" && typeof i[e] == "function" && i[e];
220    if (s)
221      return s;
222    t = Qt(t);
223  }
224}
225function Xt(e, t) {
226  return Zt("get", e, t);
227}
228function Yt(e, t) {
229  return Zt("set", e, t);
230}
231const Ce = Object.create;
232function Jt(e, t) {
233  Pr(e, t), e.prototype = Ce(t.prototype, {
234    constructor: {
235      value: e,
236      writable: !0
237    }
238  });
239}
240function tt(e, t, r = []) {
241  let i = !1;
242  try {
243    i = !Boolean.prototype.valueOf.call(
244      Reflect.construct(Boolean, [], function() {
245      })
246    );
247  } catch {
248  }
249  return i ? Reflect.construct(t, r, Qt(e).constructor) : t.apply(e, r);
250}
251function Tr(e) {
252  for (let t = 1; t < arguments.length; ++t) {
253    const r = arguments[t];
254    for (const i in r)
255      It(r, i) && (e[i] = r[i]);
256  }
257  return e;
258}
259const z = Object.assign || Tr;
260let Ze = [], h = Ce(null);
261const He = (e) => {
262  if (!e.Object) throw 0;
263  Ze = At(h = e).filter((t) => ["webkitStorageInfo", "GLOBAL", "root"].indexOf(t) === -1);
264};
265try {
266  He(window);
267} catch {
268  try {
269    He(self);
270  } catch {
271    try {
272      He(global);
273    } catch {
274      try {
275        He(globalThis);
276      } catch {
277        try {
278          h.Object = Object;
279        } catch {
280        }
281        try {
282          h.Function = Function;
283        } catch {
284        }
285        try {
286          h.Array = Array;
287        } catch {
288        }
289        try {
290          h.Number = Number;
291        } catch {
292        }
293        try {
294          h.parseFloat = parseFloat;
295        } catch {
296        }
297        try {
298          h.parseInt = parseInt;
299        } catch {
300        }
301        try {
302          h.Infinity = 1 / 0;
303        } catch {
304        }
305        try {
306          h.NaN = NaN;
307        } catch {
308        }
309        try {
310          h.undefined = void 0;
311        } catch {
312        }
313        try {
314          h.Boolean = Boolean;
315        } catch {
316        }
317        try {
318          h.String = String;
319        } catch {
320        }
321        try {
322          h.Symbol = Symbol;
323        } catch {
324        }
325        try {
326          h.Date = Date;
327        } catch {
328        }
329        try {
330          h.Promise = Promise;
331        } catch {
332        }
333        try {
334          h.RegExp = RegExp;
335        } catch {
336        }
337        try {
338          h.Error = Error;
339        } catch {
340        }
341        try {
342          h.EvalError = EvalError;
343        } catch {
344        }
345        try {
346          h.RangeError = RangeError;
347        } catch {
348        }
349        try {
350          h.ReferenceError = ReferenceError;
351        } catch {
352        }
353        try {
354          h.SyntaxError = SyntaxError;
355        } catch {
356        }
357        try {
358          h.TypeError = TypeError;
359        } catch {
360        }
361        try {
362          h.URIError = URIError;
363        } catch {
364        }
365        try {
366          h.JSON = JSON;
367        } catch {
368        }
369        try {
370          h.Math = Math;
371        } catch {
372        }
373        try {
374          h.console = console;
375        } catch {
376        }
377        try {
378          h.Intl = Intl;
379        } catch {
380        }
381        try {
382          h.ArrayBuffer = ArrayBuffer;
383        } catch {
384        }
385        try {
386          h.Uint8Array = Uint8Array;
387        } catch {
388        }
389        try {
390          h.Int8Array = Int8Array;
391        } catch {
392        }
393        try {
394          h.Uint16Array = Uint16Array;
395        } catch {
396        }
397        try {
398          h.Int16Array = Int16Array;
399        } catch {
400        }
401        try {
402          h.Uint32Array = Uint32Array;
403        } catch {
404        }
405        try {
406          h.Int32Array = Int32Array;
407        } catch {
408        }
409        try {
410          h.Float32Array = Float32Array;
411        } catch {
412        }
413        try {
414          h.Float64Array = Float64Array;
415        } catch {
416        }
417        try {
418          h.Uint8ClampedArray = Uint8ClampedArray;
419        } catch {
420        }
421        try {
422          h.DataView = DataView;
423        } catch {
424        }
425        try {
426          h.Map = Map;
427        } catch {
428        }
429        try {
430          h.Set = Set;
431        } catch {
432        }
433        try {
434          h.WeakMap = WeakMap;
435        } catch {
436        }
437        try {
438          h.WeakSet = WeakSet;
439        } catch {
440        }
441        try {
442          h.Proxy = Proxy;
443        } catch {
444        }
445        try {
446          h.Reflect = Reflect;
447        } catch {
448        }
449        try {
450          h.BigInt = BigInt;
451        } catch {
452        }
453        try {
454          h.decodeURI = decodeURI;
455        } catch {
456        }
457        try {
458          h.decodeURIComponent = decodeURIComponent;
459        } catch {
460        }
461        try {
462          h.encodeURI = encodeURI;
463        } catch {
464        }
465        try {
466          h.encodeURIComponent = encodeURIComponent;
467        } catch {
468        }
469        try {
470          h.escape = escape;
471        } catch {
472        }
473        try {
474          h.unescape = unescape;
475        } catch {
476        }
477        try {
478          h.eval = eval;
479        } catch {
480        }
481        try {
482          h.isFinite = isFinite;
483        } catch {
484        }
485        try {
486          h.isNaN = isNaN;
487        } catch {
488        }
489        try {
490          h.SharedArrayBuffer = SharedArrayBuffer;
491        } catch {
492        }
493        try {
494          h.Atomics = Atomics;
495        } catch {
496        }
497        try {
498          h.WebAssembly = WebAssembly;
499        } catch {
500        }
501        try {
502          h.clearInterval = clearInterval;
503        } catch {
504        }
505        try {
506          h.clearTimeout = clearTimeout;
507        } catch {
508        }
509        try {
510          h.setInterval = setInterval;
511        } catch {
512        }
513        try {
514          h.setTimeout = setTimeout;
515        } catch {
516        }
517        try {
518          h.crypto = crypto;
519        } catch {
520        }
521        try {
522          h.URL = URL;
523        } catch {
524        }
525        Ze = At(h);
526      }
527    }
528  }
529}
530h.Symbol && (!h.Symbol.iterator && (h.Symbol.iterator = B("iterator")), !h.Symbol.asyncIterator && (h.Symbol.asyncIterator = B("asynciterator")));
531const ei = Ce({});
532for (let e = 0; e < Ze.length; e++) {
533  const t = Ze[e];
534  try {
535    ei[t] = h[t];
536  } catch {
537  }
538}
539const Oe = B("window");
540function Vr() {
541  return z(Ce({ [Oe]: h }), ei);
542}
543function B(e) {
544  return e + Math.random().toString(36).substring(2);
545}
546function Nr(e) {
547  let t;
548  if (typeof Symbol == "function" && (t = e[Symbol.asyncIterator], !t && (t = e[Symbol.iterator])), t)
549    return t.call(e);
550  if (typeof e.next == "function")
551    return e;
552  {
553    let r = 0;
554    return {
555      next() {
556        return e && r >= e.length && (e = void 0), { value: e && e[r++], done: !e };
557      }
558    };
559  }
560}
561var Rr = [509, 0, 227, 0, 150, 4, 294, 9, 1368, 2, 2, 1, 6, 3, 41, 2, 5, 0, 166, 1, 574, 3, 9, 9, 7, 9, 32, 4, 318, 1, 80, 3, 71, 10, 50, 3, 123, 2, 54, 14, 32, 10, 3, 1, 11, 3, 46, 10, 8, 0, 46, 9, 7, 2, 37, 13, 2, 9, 6, 1, 45, 0, 13, 2, 49, 13, 9, 3, 2, 11, 83, 11, 7, 0, 3, 0, 158, 11, 6, 9, 7, 3, 56, 1, 2, 6, 3, 1, 3, 2, 10, 0, 11, 1, 3, 6, 4, 4, 68, 8, 2, 0, 3, 0, 2, 3, 2, 4, 2, 0, 15, 1, 83, 17, 10, 9, 5, 0, 82, 19, 13, 9, 214, 6, 3, 8, 28, 1, 83, 16, 16, 9, 82, 12, 9, 9, 7, 19, 58, 14, 5, 9, 243, 14, 166, 9, 71, 5, 2, 1, 3, 3, 2, 0, 2, 1, 13, 9, 120, 6, 3, 6, 4, 0, 29, 9, 41, 6, 2, 3, 9, 0, 10, 10, 47, 15, 343, 9, 54, 7, 2, 7, 17, 9, 57, 21, 2, 13, 123, 5, 4, 0, 2, 1, 2, 6, 2, 0, 9, 9, 49, 4, 2, 1, 2, 4, 9, 9, 330, 3, 10, 1, 2, 0, 49, 6, 4, 4, 14, 10, 5350, 0, 7, 14, 11465, 27, 2343, 9, 87, 9, 39, 4, 60, 6, 26, 9, 535, 9, 470, 0, 2, 54, 8, 3, 82, 0, 12, 1, 19628, 1, 4178, 9, 519, 45, 3, 22, 543, 4, 4, 5, 9, 7, 3, 6, 31, 3, 149, 2, 1418, 49, 513, 54, 5, 49, 9, 0, 15, 0, 23, 4, 2, 14, 1361, 6, 2, 16, 3, 6, 2, 1, 2, 4, 101, 0, 161, 6, 10, 9, 357, 0, 62, 13, 499, 13, 245, 1, 2, 9, 726, 6, 110, 6, 6, 9, 4759, 9, 787719, 239], ti = [0, 11, 2, 25, 2, 18, 2, 1, 2, 14, 3, 13, 35, 122, 70, 52, 268, 28, 4, 48, 48, 31, 14, 29, 6, 37, 11, 29, 3, 35, 5, 7, 2, 4, 43, 157, 19, 35, 5, 35, 5, 39, 9, 51, 13, 10, 2, 14, 2, 6, 2, 1, 2, 10, 2, 14, 2, 6, 2, 1, 4, 51, 13, 310, 10, 21, 11, 7, 25, 5, 2, 41, 2, 8, 70, 5, 3, 0, 2, 43, 2, 1, 4, 0, 3, 22, 11, 22, 10, 30, 66, 18, 2, 1, 11, 21, 11, 25, 71, 55, 7, 1, 65, 0, 16, 3, 2, 2, 2, 28, 43, 28, 4, 28, 36, 7, 2, 27, 28, 53, 11, 21, 11, 18, 14, 17, 111, 72, 56, 50, 14, 50, 14, 35, 39, 27, 10, 22, 251, 41, 7, 1, 17, 2, 60, 28, 11, 0, 9, 21, 43, 17, 47, 20, 28, 22, 13, 52, 58, 1, 3, 0, 14, 44, 33, 24, 27, 35, 30, 0, 3, 0, 9, 34, 4, 0, 13, 47, 15, 3, 22, 0, 2, 0, 36, 17, 2, 24, 20, 1, 64, 6, 2, 0, 2, 3, 2, 14, 2, 9, 8, 46, 39, 7, 3, 1, 3, 21, 2, 6, 2, 1, 2, 4, 4, 0, 19, 0, 13, 4, 31, 9, 2, 0, 3, 0, 2, 37, 2, 0, 26, 0, 2, 0, 45, 52, 19, 3, 21, 2, 31, 47, 21, 1, 2, 0, 185, 46, 42, 3, 37, 47, 21, 0, 60, 42, 14, 0, 72, 26, 38, 6, 186, 43, 117, 63, 32, 7, 3, 0, 3, 7, 2, 1, 2, 23, 16, 0, 2, 0, 95, 7, 3, 38, 17, 0, 2, 0, 29, 0, 11, 39, 8, 0, 22, 0, 12, 45, 20, 0, 19, 72, 200, 32, 32, 8, 2, 36, 18, 0, 50, 29, 113, 6, 2, 1, 2, 37, 22, 0, 26, 5, 2, 1, 2, 31, 15, 0, 328, 18, 16, 0, 2, 12, 2, 33, 125, 0, 80, 921, 103, 110, 18, 195, 2637, 96, 16, 1071, 18, 5, 26, 3994, 6, 582, 6842, 29, 1763, 568, 8, 30, 18, 78, 18, 29, 19, 47, 17, 3, 32, 20, 6, 18, 433, 44, 212, 63, 129, 74, 6, 0, 67, 12, 65, 1, 2, 0, 29, 6135, 9, 1237, 42, 9, 8936, 3, 2, 6, 2, 1, 2, 290, 16, 0, 30, 2, 3, 0, 15, 3, 9, 395, 2309, 106, 6, 12, 4, 8, 8, 9, 5991, 84, 2, 70, 2, 1, 3, 0, 3, 1, 3, 3, 2, 11, 2, 0, 2, 6, 2, 64, 2, 3, 3, 7, 2, 6, 2, 27, 2, 3, 2, 4, 2, 0, 4, 6, 2, 339, 3, 24, 2, 24, 2, 30, 2, 24, 2, 30, 2, 24, 2, 30, 2, 24, 2, 30, 2, 24, 2, 7, 1845, 30, 7, 5, 262, 61, 147, 44, 11, 6, 17, 0, 322, 29, 19, 43, 485, 27, 229, 29, 3, 0, 496, 6, 2, 3, 2, 1, 2, 14, 2, 196, 60, 67, 8, 0, 1205, 3, 2, 26, 2, 1, 2, 0, 3, 0, 2, 9, 2, 3, 2, 0, 2, 0, 7, 0, 5, 0, 2, 0, 2, 0, 2, 2, 2, 1, 2, 0, 3, 0, 2, 0, 2, 0, 2, 0, 2, 0, 2, 1, 2, 0, 3, 3, 2, 6, 2, 3, 2, 3, 2, 0, 2, 9, 2, 16, 6, 2, 2, 4, 2, 16, 4421, 42719, 33, 4153, 7, 221, 3, 5761, 15, 7472, 16, 621, 2467, 541, 1507, 4938, 6, 4191], Br = "‌‍·̀-ͯ·҃-֑҇-ׇֽֿׁׂׅׄؐ-ًؚ-٩ٰۖ-ۜ۟-۪ۤۧۨ-ۭ۰-۹ܑܰ-݊ަ-ް߀-߉߫-߽߳ࠖ-࠙ࠛ-ࠣࠥ-ࠧࠩ-࡙࠭-࡛ࢗ-࢟࣊-ࣣ࣡-ःऺ-़ा-ॏ॑-ॗॢॣ०-९ঁ-ঃ়া-ৄেৈো-্ৗৢৣ০-৯৾ਁ-ਃ਼ਾ-ੂੇੈੋ-੍ੑ੦-ੱੵઁ-ઃ઼ા-ૅે-ૉો-્ૢૣ૦-૯ૺ-૿ଁ-ଃ଼ା-ୄେୈୋ-୍୕-ୗୢୣ୦-୯ஂா-ூெ-ைொ-்ௗ௦-௯ఀ-ఄ఼ా-ౄె-ైొ-్ౕౖౢౣ౦-౯ಁ-ಃ಼ಾ-ೄೆ-ೈೊ-್ೕೖೢೣ೦-೯ೳഀ-ഃ഻഼ാ-ൄെ-ൈൊ-്ൗൢൣ൦-൯ඁ-ඃ්ා-ුූෘ-ෟ෦-෯ෲෳัิ-ฺ็-๎๐-๙ັິ-ຼ່-໎໐-໙༘༙༠-༩༹༵༷༾༿ཱ-྄྆྇ྍ-ྗྙ-ྼ࿆ါ-ှ၀-၉ၖ-ၙၞ-ၠၢ-ၤၧ-ၭၱ-ၴႂ-ႍႏ-ႝ፝-፟፩-፱ᜒ-᜕ᜲ-᜴ᝒᝓᝲᝳ឴-៓៝០-៩᠋-᠍᠏-᠙ᢩᤠ-ᤫᤰ-᤻᥆-᥏᧐-᧚ᨗ-ᨛᩕ-ᩞ᩠-᩿᩼-᪉᪐-᪙᪰-᪽ᪿ-ᫎᬀ-ᬄ᬴-᭄᭐-᭙᭫-᭳ᮀ-ᮂᮡ-ᮭ᮰-᮹᯦-᯳ᰤ-᰷᱀-᱉᱐-᱙᳐-᳔᳒-᳨᳭᳴᳷-᳹᷀-᷿‌‍‿⁀⁔⃐-⃥⃜⃡-⃰⳯-⵿⳱ⷠ-〪ⷿ-゙゚〯・꘠-꘩꙯ꙴ-꙽ꚞꚟ꛰꛱ꠂ꠆ꠋꠣ-ꠧ꠬ꢀꢁꢴ-ꣅ꣐-꣙꣠-꣱ꣿ-꤉ꤦ-꤭ꥇ-꥓ꦀ-ꦃ꦳-꧀꧐-꧙ꧥ꧰-꧹ꨩ-ꨶꩃꩌꩍ꩐-꩙ꩻ-ꩽꪰꪲ-ꪴꪷꪸꪾ꪿꫁ꫫ-ꫯꫵ꫶ꯣ-ꯪ꯬꯭꯰-꯹ﬞ︀-️︠-︯︳︴﹍-﹏0-9_・", ii = "ªµºÀ-ÖØ-öø-ˁˆ-ˑˠ-ˤˬˮͰ-ʹͶͷͺ-ͽͿΆΈ-ΊΌΎ-ΡΣ-ϵϷ-ҁҊ-ԯԱ-Ֆՙՠ-ֈא-תׯ-ײؠ-يٮٯٱ-ۓەۥۦۮۯۺ-ۼۿܐܒ-ܯݍ-ޥޱߊ-ߪߴߵߺࠀ-ࠕࠚࠤࠨࡀ-ࡘࡠ-ࡪࡰ-ࢇࢉ-ࢎࢠ-ࣉऄ-हऽॐक़-ॡॱ-ঀঅ-ঌএঐও-নপ-রলশ-হঽৎড়ঢ়য়-ৡৰৱৼਅ-ਊਏਐਓ-ਨਪ-ਰਲਲ਼ਵਸ਼ਸਹਖ਼-ੜਫ਼ੲ-ੴઅ-ઍએ-ઑઓ-નપ-રલળવ-હઽૐૠૡૹଅ-ଌଏଐଓ-ନପ-ରଲଳଵ-ହଽଡ଼ଢ଼ୟ-ୡୱஃஅ-ஊஎ-ஐஒ-கஙசஜஞடணதந-பம-ஹௐఅ-ఌఎ-ఐఒ-నప-హఽౘ-ౚౝౠౡಀಅ-ಌಎ-ಐಒ-ನಪ-ಳವ-ಹಽೝೞೠೡೱೲഄ-ഌഎ-ഐഒ-ഺഽൎൔ-ൖൟ-ൡൺ-ൿඅ-ඖක-නඳ-රලව-ෆก-ะาำเ-ๆກຂຄຆ-ຊຌ-ຣລວ-ະາຳຽເ-ໄໆໜ-ໟༀཀ-ཇཉ-ཬྈ-ྌက-ဪဿၐ-ၕၚ-ၝၡၥၦၮ-ၰၵ-ႁႎႠ-ჅჇჍა-ჺჼ-ቈቊ-ቍቐ-ቖቘቚ-ቝበ-ኈኊ-ኍነ-ኰኲ-ኵኸ-ኾዀዂ-ዅወ-ዖዘ-ጐጒ-ጕጘ-ፚᎀ-ᎏᎠ-Ᏽᏸ-ᏽᐁ-ᙬᙯ-ᙿᚁ-ᚚᚠ-ᛪᛮ-ᛸᜀ-ᜑᜟ-ᜱᝀ-ᝑᝠ-ᝬᝮ-ᝰក-ឳៗៜᠠ-ᡸᢀ-ᢨᢪᢰ-ᣵᤀ-ᤞᥐ-ᥭᥰ-ᥴᦀ-ᦫᦰ-ᧉᨀ-ᨖᨠ-ᩔᪧᬅ-ᬳᭅ-ᭌᮃ-ᮠᮮᮯᮺ-ᯥᰀ-ᰣᱍ-ᱏᱚ-ᱽᲀ-ᲊᲐ-ᲺᲽ-Ჿᳩ-ᳬᳮ-ᳳᳵᳶᳺᴀ-ᶿḀ-ἕἘ-Ἕἠ-ὅὈ-Ὅὐ-ὗὙὛὝὟ-ώᾀ-ᾴᾶ-ᾼιῂ-ῄῆ-ῌῐ-ΐῖ-Ίῠ-Ῥῲ-ῴῶ-ῼⁱⁿₐ-ₜℂℇℊ-ℓℕ℘-ℝℤΩℨK-ℹℼ-ℿⅅ-ⅉⅎⅠ-ↈⰀ-ⳤⳫ-ⳮⳲⳳⴀ-ⴥⴧⴭⴰ-ⵧⵯⶀ-ⶖⶠ-ⶦⶨ-ⶮⶰ-ⶶⶸ-ⶾⷀ-ⷆⷈ-ⷎⷐ-ⷖⷘ-ⷞ々-〇〡-〩〱-〵〸-〼ぁ-ゖ゛-ゟァ-ヺー-ヿㄅ-ㄯㄱ-ㆎㆠ-ㆿㇰ-ㇿ㐀-䶿一-ꒌꓐ-ꓽꔀ-ꘌꘐ-ꘟꘪꘫꙀ-ꙮꙿ-ꚝꚠ-ꛯꜗ-ꜟꜢ-ꞈꞋ-ꟍꟐꟑꟓꟕ-Ƛꟲ-ꠁꠃ-ꠅꠇ-ꠊꠌ-ꠢꡀ-ꡳꢂ-ꢳꣲ-ꣷꣻꣽꣾꤊ-ꤥꤰ-ꥆꥠ-ꥼꦄ-ꦲꧏꧠ-ꧤꧦ-ꧯꧺ-ꧾꨀ-ꨨꩀ-ꩂꩄ-ꩋꩠ-ꩶꩺꩾ-ꪯꪱꪵꪶꪹ-ꪽꫀꫂꫛ-ꫝꫠ-ꫪꫲ-ꫴꬁ-ꬆꬉ-ꬎꬑ-ꬖꬠ-ꬦꬨ-ꬮꬰ-ꭚꭜ-ꭩꭰ-ꯢ가-힣ힰ-ퟆퟋ-ퟻ豈-舘並-龎ff-stﬓ-ﬗיִײַ-ﬨשׁ-זּטּ-לּמּנּסּףּפּצּ-ﮱﯓ-ﴽﵐ-ﶏﶒ-ﷇﷰ-ﷻﹰ-ﹴﹶ-ﻼA-Za-zヲ-하-ᅦᅧ-ᅬᅭ-ᅲᅳ-ᅵ", ht = {
562  3: "abstract boolean byte char class double enum export extends final float goto implements import int interface long native package private protected public short static super synchronized throws transient volatile",
563  5: "class enum extends super const export import",
564  6: "enum",
565  strict: "implements interface let package private protected public static yield",
566  strictBind: "eval arguments"
567}, pt = "break case catch continue debugger default do else finally for function if return switch throw try var while with null true false instanceof typeof void delete new in this", Or = {
568  5: pt,
569  "5module": pt + " export import",
570  6: pt + " const class extends export import super"
571}, Dr = /^in(stanceof)?$/, Fr = new RegExp("[" + ii + "]"), Mr = new RegExp("[" + ii + Br + "]");
572function gt(e, t) {
573  for (var r = 65536, i = 0; i < t.length; i += 2) {
574    if (r += t[i], r > e)
575      return !1;
576    if (r += t[i + 1], r >= e)
577      return !0;
578  }
579  return !1;
580}
581function oe(e, t) {
582  return e < 65 ? e === 36 : e < 91 ? !0 : e < 97 ? e === 95 : e < 123 ? !0 : e <= 65535 ? e >= 170 && Fr.test(String.fromCharCode(e)) : t === !1 ? !1 : gt(e, ti);
583}
584function _e(e, t) {
585  return e < 48 ? e === 36 : e < 58 ? !0 : e < 65 ? !1 : e < 91 ? !0 : e < 97 ? e === 95 : e < 123 ? !0 : e <= 65535 ? e >= 170 && Mr.test(String.fromCharCode(e)) : t === !1 ? !1 : gt(e, ti) || gt(e, Rr);
586}
587var E = function(t, r) {
588  r === void 0 && (r = {}), this.label = t, this.keyword = r.keyword, this.beforeExpr = !!r.beforeExpr, this.startsExpr = !!r.startsExpr, this.isLoop = !!r.isLoop, this.isAssign = !!r.isAssign, this.prefix = !!r.prefix, this.postfix = !!r.postfix, this.binop = r.binop || null, this.updateContext = null;
589};
590function K(e, t) {
591  return new E(e, { beforeExpr: !0, binop: t });
592}
593var Q = { beforeExpr: !0 }, U = { startsExpr: !0 }, Pt = {};
594function S(e, t) {
595  return t === void 0 && (t = {}), t.keyword = e, Pt[e] = new E(e, t);
596}
597var o = {
598  num: new E("num", U),
599  regexp: new E("regexp", U),
600  string: new E("string", U),
601  name: new E("name", U),
602  privateId: new E("privateId", U),
603  eof: new E("eof"),
604  // Punctuation token types.
605  bracketL: new E("[", { beforeExpr: !0, startsExpr: !0 }),
606  bracketR: new E("]"),
607  braceL: new E("{", { beforeExpr: !0, startsExpr: !0 }),
608  braceR: new E("}"),
609  parenL: new E("(", { beforeExpr: !0, startsExpr: !0 }),
610  parenR: new E(")"),
611  comma: new E(",", Q),
612  semi: new E(";", Q),
613  colon: new E(":", Q),
614  dot: new E("."),
615  question: new E("?", Q),
616  questionDot: new E("?."),
617  arrow: new E("=>", Q),
618  template: new E("template"),
619  invalidTemplate: new E("invalidTemplate"),
620  ellipsis: new E("...", Q),
621  backQuote: new E("`", U),
622  dollarBraceL: new E("${", { beforeExpr: !0, startsExpr: !0 }),
623  // Operators. These carry several kinds of properties to help the
624  // parser use them properly (the presence of these properties is
625  // what categorizes them as operators).
626  //
627  // `binop`, when present, specifies that this operator is a binary
628  // operator, and will refer to its precedence.
629  //
630  // `prefix` and `postfix` mark the operator as a prefix or postfix
631  // unary operator.
632  //
633  // `isAssign` marks all of `=`, `+=`, `-=` etcetera, which act as
634  // binary operators with a very low precedence, that should result
635  // in AssignmentExpression nodes.
636  eq: new E("=", { beforeExpr: !0, isAssign: !0 }),
637  assign: new E("_=", { beforeExpr: !0, isAssign: !0 }),
638  incDec: new E("++/--", { prefix: !0, postfix: !0, startsExpr: !0 }),
639  prefix: new E("!/~", { beforeExpr: !0, prefix: !0, startsExpr: !0 }),
640  logicalOR: K("||", 1),
641  logicalAND: K("&&", 2),
642  bitwiseOR: K("|", 3),
643  bitwiseXOR: K("^", 4),
644  bitwiseAND: K("&", 5),
645  equality: K("==/!=/===/!==", 6),
646  relational: K("</>/<=/>=", 7),
647  bitShift: K("<</>>/>>>", 8),
648  plusMin: new E("+/-", { beforeExpr: !0, binop: 9, prefix: !0, startsExpr: !0 }),
649  modulo: K("%", 10),
650  star: K("*", 10),
651  slash: K("/", 10),
652  starstar: new E("**", { beforeExpr: !0 }),
653  coalesce: K("??", 1),
654  // Keyword token types.
655  _break: S("break"),
656  _case: S("case", Q),
657  _catch: S("catch"),
658  _continue: S("continue"),
659  _debugger: S("debugger"),
660  _default: S("default", Q),
661  _do: S("do", { isLoop: !0, beforeExpr: !0 }),
662  _else: S("else", Q),
663  _finally: S("finally"),
664  _for: S("for", { isLoop: !0 }),
665  _function: S("function", U),
666  _if: S("if"),
667  _return: S("return", Q),
668  _switch: S("switch"),
669  _throw: S("throw", Q),
670  _try: S("try"),
671  _var: S("var"),
672  _const: S("const"),
673  _while: S("while", { isLoop: !0 }),
674  _with: S("with"),
675  _new: S("new", { beforeExpr: !0, startsExpr: !0 }),
676  _this: S("this", U),
677  _super: S("super", U),
678  _class: S("class", U),
679  _extends: S("extends", Q),
680  _export: S("export"),
681  _import: S("import", U),
682  _null: S("null", U),
683  _true: S("true", U),
684  _false: S("false", U),
685  _in: S("in", { beforeExpr: !0, binop: 7 }),
686  _instanceof: S("instanceof", { beforeExpr: !0, binop: 7 }),
687  _typeof: S("typeof", { beforeExpr: !0, prefix: !0, startsExpr: !0 }),
688  _void: S("void", { beforeExpr: !0, prefix: !0, startsExpr: !0 }),
689  _delete: S("delete", { beforeExpr: !0, prefix: !0, startsExpr: !0 })
690}, Y = /\r\n?|\n|\u2028|\u2029/, jr = new RegExp(Y.source, "g");
691function Le(e) {
692  return e === 10 || e === 13 || e === 8232 || e === 8233;
693}
694function ri(e, t, r) {
695  r === void 0 && (r = e.length);
696  for (var i = t; i < r; i++) {
697    var s = e.charCodeAt(i);
698    if (Le(s))
699      return i < r - 1 && s === 13 && e.charCodeAt(i + 1) === 10 ? i + 2 : i + 1;
700  }
701  return -1;
702}
703var si = /[\u1680\u2000-\u200a\u202f\u205f\u3000\ufeff]/, Z = /(?:\s|\/\/.*|\/\*[^]*?\*\/)*/g, ai = Object.prototype, Ur = ai.hasOwnProperty, $r = ai.toString, Te = Object.hasOwn || function(e, t) {
704  return Ur.call(e, t);
705}, qt = Array.isArray || function(e) {
706  return $r.call(e) === "[object Array]";
707}, Wt = /* @__PURE__ */ Object.create(null);
708function pe(e) {
709  return Wt[e] || (Wt[e] = new RegExp("^(?:" + e.replace(/ /g, "|") + ")$"));
710}
711function ue(e) {
712  return e <= 65535 ? String.fromCharCode(e) : (e -= 65536, String.fromCharCode((e >> 10) + 55296, (e & 1023) + 56320));
713}
714var qr = /(?:[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])/, De = function(t, r) {
715  this.line = t, this.column = r;
716};
717De.prototype.offset = function(t) {
718  return new De(this.line, this.column + t);
719};
720var it = function(t, r, i) {
721  this.start = r, this.end = i, t.sourceFile !== null && (this.source = t.sourceFile);
722};
723function ni(e, t) {
724  for (var r = 1, i = 0; ; ) {
725    var s = ri(e, i, t);
726    if (s < 0)
727      return new De(r, t - i);
728    ++r, i = s;
729  }
730}
731var xt = {
732  // `ecmaVersion` indicates the ECMAScript version to parse. Must be
733  // either 3, 5, 6 (or 2015), 7 (2016), 8 (2017), 9 (2018), 10
734  // (2019), 11 (2020), 12 (2021), 13 (2022), 14 (2023), or `"latest"`
735  // (the latest version the library supports). This influences
736  // support for strict mode, the set of reserved words, and support
737  // for new syntax features.
738  ecmaVersion: null,
739  // `sourceType` indicates the mode the code should be parsed in.
740  // Can be either `"script"` or `"module"`. This influences global
741  // strict mode and parsing of `import` and `export` declarations.
742  sourceType: "script",
743  // `onInsertedSemicolon` can be a callback that will be called when
744  // a semicolon is automatically inserted. It will be passed the
745  // position of the inserted semicolon as an offset, and if
746  // `locations` is enabled, it is given the location as a `{line,
747  // column}` object as second argument.
748  onInsertedSemicolon: null,
749  // `onTrailingComma` is similar to `onInsertedSemicolon`, but for
750  // trailing commas.
751  onTrailingComma: null,
752  // By default, reserved words are only enforced if ecmaVersion >= 5.
753  // Set `allowReserved` to a boolean value to explicitly turn this on
754  // an off. When this option has the value "never", reserved words
755  // and keywords can also not be used as property names.
756  allowReserved: null,
757  // When enabled, a return at the top level is not considered an
758  // error.
759  allowReturnOutsideFunction: !1,
760  // When enabled, import/export statements are not constrained to
761  // appearing at the top of the program, and an import.meta expression
762  // in a script isn't considered an error.
763  allowImportExportEverywhere: !1,
764  // By default, await identifiers are allowed to appear at the top-level scope only if ecmaVersion >= 2022.
765  // When enabled, await identifiers are allowed to appear at the top-level scope,
766  // but they are still not allowed in non-async functions.
767  allowAwaitOutsideFunction: null,
768  // When enabled, super identifiers are not constrained to
769  // appearing in methods and do not raise an error when they appear elsewhere.
770  allowSuperOutsideMethod: null,
771  // When enabled, hashbang directive in the beginning of file is
772  // allowed and treated as a line comment. Enabled by default when
773  // `ecmaVersion` >= 2023.
774  allowHashBang: !1,
775  // By default, the parser will verify that private properties are
776  // only used in places where they are valid and have been declared.
777  // Set this to false to turn such checks off.
778  checkPrivateFields: !0,
779  // When `locations` is on, `loc` properties holding objects with
780  // `start` and `end` properties in `{line, column}` form (with
781  // line being 1-based and column 0-based) will be attached to the
782  // nodes.
783  locations: !1,
784  // A function can be passed as `onToken` option, which will
785  // cause Acorn to call that function with object in the same
786  // format as tokens returned from `tokenizer().getToken()`. Note
787  // that you are not allowed to call the parser from the
788  // callback—that will corrupt its internal state.
789  onToken: null,
790  // A function can be passed as `onComment` option, which will
791  // cause Acorn to call that function with `(block, text, start,
792  // end)` parameters whenever a comment is skipped. `block` is a
793  // boolean indicating whether this is a block (`/* */`) comment,
794  // `text` is the content of the comment, and `start` and `end` are
795  // character offsets that denote the start and end of the comment.
796  // When the `locations` option is on, two more parameters are
797  // passed, the full `{line, column}` locations of the start and
798  // end of the comments. Note that you are not allowed to call the
799  // parser from the callback—that will corrupt its internal state.
800  // When this option has an array as value, objects representing the
801  // comments are pushed to it.
802  onComment: null,
803  // Nodes have their start and end characters offsets recorded in
804  // `start` and `end` properties (directly on the node, rather than
805  // the `loc` object, which holds line/column data. To also add a
806  // [semi-standardized][range] `range` property holding a `[start,
807  // end]` array with the same numbers, set the `ranges` option to
808  // `true`.
809  //
810  // [range]: https://bugzilla.mozilla.org/show_bug.cgi?id=745678
811  ranges: !1,
812  // It is possible to parse multiple files into a single AST by
813  // passing the tree produced by parsing the first file as
814  // `program` option in subsequent parses. This will add the
815  // toplevel forms of the parsed file to the `Program` (top) node
816  // of an existing parse tree.
817  program: null,
818  // When `locations` is on, you can pass this to record the source
819  // file in every node's `loc` object.
820  sourceFile: null,
821  // This value, if given, is stored in every node, whether
822  // `locations` is on or off.
823  directSourceFile: null,
824  // When enabled, parenthesized expressions are represented by
825  // (non-standard) ParenthesizedExpression nodes
826  preserveParens: !1
827}, zt = !1;
828function Wr(e) {
829  var t = {};
830  for (var r in xt)
831    t[r] = e && Te(e, r) ? e[r] : xt[r];
832  if (t.ecmaVersion === "latest" ? t.ecmaVersion = 1e8 : t.ecmaVersion == null ? (!zt && typeof console == "object" && console.warn && (zt = !0, console.warn(`Since Acorn 8.0.0, options.ecmaVersion is required.
833Defaulting to 2020, but this will stop working in the future.`)), t.ecmaVersion = 11) : t.ecmaVersion >= 2015 && (t.ecmaVersion -= 2009), t.allowReserved == null && (t.allowReserved = t.ecmaVersion < 5), (!e || e.allowHashBang == null) && (t.allowHashBang = t.ecmaVersion >= 14), qt(t.onToken)) {
834    var i = t.onToken;
835    t.onToken = function(s) {
836      return i.push(s);
837    };
838  }
839  return qt(t.onComment) && (t.onComment = zr(t, t.onComment)), t;
840}
841function zr(e, t) {
842  return function(r, i, s, a, n, u) {
843    var l = {
844      type: r ? "Block" : "Line",
845      value: i,
846      start: s,
847      end: a
848    };
849    e.locations && (l.loc = new it(this, n, u)), e.ranges && (l.range = [s, a]), t.push(l);
850  };
851}
852var Fe = 1, Ve = 2, Lt = 4, oi = 8, Tt = 16, ui = 32, rt = 64, li = 128, ke = 256, Ue = 512, st = Fe | Ve | ke;
853function Vt(e, t) {
854  return Ve | (e ? Lt : 0) | (t ? oi : 0);
855}
856var Xe = 0, Nt = 1, he = 2, ci = 3, fi = 4, hi = 5, N = function(t, r, i) {
857  this.options = t = Wr(t), this.sourceFile = t.sourceFile, this.keywords = pe(Or[t.ecmaVersion >= 6 ? 6 : t.sourceType === "module" ? "5module" : 5]);
858  var s = "";
859  t.allowReserved !== !0 && (s = ht[t.ecmaVersion >= 6 ? 6 : t.ecmaVersion === 5 ? 5 : 3], t.sourceType === "module" && (s += " await")), this.reservedWords = pe(s);
860  var a = (s ? s + " " : "") + ht.strict;
861  this.reservedWordsStrict = pe(a), this.reservedWordsStrictBind = pe(a + " " + ht.strictBind), this.input = String(r), this.containsEsc = !1, i ? (this.pos = i, this.lineStart = this.input.lastIndexOf(`
862`, i - 1) + 1, this.curLine = this.input.slice(0, this.lineStart).split(Y).length) : (this.pos = this.lineStart = 0, this.curLine = 1), this.type = o.eof, this.value = null, this.start = this.end = this.pos, this.startLoc = this.endLoc = this.curPosition(), this.lastTokEndLoc = this.lastTokStartLoc = null, this.lastTokStart = this.lastTokEnd = this.pos, this.context = this.initialContext(), this.exprAllowed = !0, this.inModule = t.sourceType === "module", this.strict = this.inModule || this.strictDirective(this.pos), this.potentialArrowAt = -1, this.potentialArrowInForAwait = !1, this.yieldPos = this.awaitPos = this.awaitIdentPos = 0, this.labels = [], this.undefinedExports = /* @__PURE__ */ Object.create(null), this.pos === 0 && t.allowHashBang && this.input.slice(0, 2) === "#!" && this.skipLineComment(2), this.scopeStack = [], this.enterScope(Fe), this.regexpState = null, this.privateNameStack = [];
863}, re = { inFunction: { configurable: !0 }, inGenerator: { configurable: !0 }, inAsync: { configurable: !0 }, canAwait: { configurable: !0 }, allowSuper: { configurable: !0 }, allowDirectSuper: { configurable: !0 }, treatFunctionsAsVar: { configurable: !0 }, allowNewDotTarget: { configurable: !0 }, inClassStaticBlock: { configurable: !0 } };
864N.prototype.parse = function() {
865  var t = this.options.program || this.startNode();
866  return this.nextToken(), this.parseTopLevel(t);
867};
868re.inFunction.get = function() {
869  return (this.currentVarScope().flags & Ve) > 0;
870};
871re.inGenerator.get = function() {
872  return (this.currentVarScope().flags & oi) > 0;
873};
874re.inAsync.get = function() {
875  return (this.currentVarScope().flags & Lt) > 0;
876};
877re.canAwait.get = function() {
878  for (var e = this.scopeStack.length - 1; e >= 0; e--) {
879    var t = this.scopeStack[e], r = t.flags;
880    if (r & (ke | Ue))
881      return !1;
882    if (r & Ve)
883      return (r & Lt) > 0;
884  }
885  return this.inModule && this.options.ecmaVersion >= 13 || this.options.allowAwaitOutsideFunction;
886};
887re.allowSuper.get = function() {
888  var e = this.currentThisScope(), t = e.flags;
889  return (t & rt) > 0 || this.options.allowSuperOutsideMethod;
890};
891re.allowDirectSuper.get = function() {
892  return (this.currentThisScope().flags & li) > 0;
893};
894re.treatFunctionsAsVar.get = function() {
895  return this.treatFunctionsAsVarInScope(this.currentScope());
896};
897re.allowNewDotTarget.get = function() {
898  for (var e = this.scopeStack.length - 1; e >= 0; e--) {
899    var t = this.scopeStack[e], r = t.flags;
900    if (r & (ke | Ue) || r & Ve && !(r & Tt))
901      return !0;
902  }
903  return !1;
904};
905re.inClassStaticBlock.get = function() {
906  return (this.currentVarScope().flags & ke) > 0;
907};
908N.extend = function() {
909  for (var t = [], r = arguments.length; r--; ) t[r] = arguments[r];
910  for (var i = this, s = 0; s < t.length; s++)
911    i = t[s](i);
912  return i;
913};
914N.parse = function(t, r) {
915  return new this(r, t).parse();
916};
917N.parseExpressionAt = function(t, r, i) {
918  var s = new this(i, t, r);
919  return s.nextToken(), s.parseExpression();
920};
921N.tokenizer = function(t, r) {
922  return new this(r, t);
923};
924Object.defineProperties(N.prototype, re);
925var M = N.prototype, Gr = /^(?:'((?:\\[^]|[^'\\])*?)'|"((?:\\[^]|[^"\\])*?)")/;
926M.strictDirective = function(e) {
927  if (this.options.ecmaVersion < 5)
928    return !1;
929  for (; ; ) {
930    Z.lastIndex = e, e += Z.exec(this.input)[0].length;
931    var t = Gr.exec(this.input.slice(e));
932    if (!t)
933      return !1;
934    if ((t[1] || t[2]) === "use strict") {
935      Z.lastIndex = e + t[0].length;
936      var r = Z.exec(this.input), i = r.index + r[0].length, s = this.input.charAt(i);
937      return s === ";" || s === "}" || Y.test(r[0]) && !(/[(`.[+\-/*%<>=,?^&]/.test(s) || s === "!" && this.input.charAt(i + 1) === "=");
938    }
939    e += t[0].length, Z.lastIndex = e, e += Z.exec(this.input)[0].length, this.input[e] === ";" && e++;
940  }
941};
942M.eat = function(e) {
943  return this.type === e ? (this.next(), !0) : !1;
944};
945M.isContextual = function(e) {
946  return this.type === o.name && this.value === e && !this.containsEsc;
947};
948M.eatContextual = function(e) {
949  return this.isContextual(e) ? (this.next(), !0) : !1;
950};
951M.expectContextual = function(e) {
952  this.eatContextual(e) || this.unexpected();
953};
954M.canInsertSemicolon = function() {
955  return this.type === o.eof || this.type === o.braceR || Y.test(this.input.slice(this.lastTokEnd, this.start));
956};
957M.insertSemicolon = function() {
958  if (this.canInsertSemicolon())
959    return this.options.onInsertedSemicolon && this.options.onInsertedSemicolon(this.lastTokEnd, this.lastTokEndLoc), !0;
960};
961M.semicolon = function() {
962  !this.eat(o.semi) && !this.insertSemicolon() && this.unexpected();
963};
964M.afterTrailingComma = function(e, t) {
965  if (this.type === e)
966    return this.options.onTrailingComma && this.options.onTrailingComma(this.lastTokStart, this.lastTokStartLoc), t || this.next(), !0;
967};
968M.expect = function(e) {
969  this.eat(e) || this.unexpected();
970};
971M.unexpected = function(e) {
972  this.raise(e ?? this.start, "Unexpected token");
973};
974var at = function() {
975  this.shorthandAssign = this.trailingComma = this.parenthesizedAssign = this.parenthesizedBind = this.doubleProto = -1;
976};
977M.checkPatternErrors = function(e, t) {
978  if (e) {
979    e.trailingComma > -1 && this.raiseRecoverable(e.trailingComma, "Comma is not permitted after the rest element");
980    var r = t ? e.parenthesizedAssign : e.parenthesizedBind;
981    r > -1 && this.raiseRecoverable(r, t ? "Assigning to rvalue" : "Parenthesized pattern");
982  }
983};
984M.checkExpressionErrors = function(e, t) {
985  if (!e)
986    return !1;
987  var r = e.shorthandAssign, i = e.doubleProto;
988  if (!t)
989    return r >= 0 || i >= 0;
990  r >= 0 && this.raise(r, "Shorthand property assignments are valid only in destructuring patterns"), i >= 0 && this.raiseRecoverable(i, "Redefinition of __proto__ property");
991};
992M.checkYieldAwaitInDefaultParams = function() {
993  this.yieldPos && (!this.awaitPos || this.yieldPos < this.awaitPos) && this.raise(this.yieldPos, "Yield expression cannot be a default value"), this.awaitPos && this.raise(this.awaitPos, "Await expression cannot be a default value");
994};
995M.isSimpleAssignTarget = function(e) {
996  return e.type === "ParenthesizedExpression" ? this.isSimpleAssignTarget(e.expression) : e.type === "Identifier" || e.type === "MemberExpression";
997};
998var m = N.prototype;
999m.parseTopLevel = function(e) {
1000  var t = /* @__PURE__ */ Object.create(null);
1001  for (e.body || (e.body = []); this.type !== o.eof; ) {
1002    var r = this.parseStatement(null, !0, t);
1003    e.body.push(r);
1004  }
1005  if (this.inModule)
1006    for (var i = 0, s = Object.keys(this.undefinedExports); i < s.length; i += 1) {
1007      var a = s[i];
1008      this.raiseRecoverable(this.undefinedExports[a].start, "Export '" + a + "' is not defined");
1009    }
1010  return this.adaptDirectivePrologue(e.body), this.next(), e.sourceType = this.options.sourceType, this.finishNode(e, "Program");
1011};
1012var Rt = { kind: "loop" }, Hr = { kind: "switch" };
1013m.isLet = function(e) {
1014  if (this.options.ecmaVersion < 6 || !this.isContextual("let"))
1015    return !1;
1016  Z.lastIndex = this.pos;
1017  var t = Z.exec(this.input), r = this.pos + t[0].length, i = this.input.charCodeAt(r);
1018  if (i === 91 || i === 92)
1019    return !0;
1020  if (e)
1021    return !1;
1022  if (i === 123 || i > 55295 && i < 56320)
1023    return !0;
1024  if (oe(i, !0)) {
1025    for (var s = r + 1; _e(i = this.input.charCodeAt(s), !0); )
1026      ++s;
1027    if (i === 92 || i > 55295 && i < 56320)
1028      return !0;
1029    var a = this.input.slice(r, s);
1030    if (!Dr.test(a))
1031      return !0;
1032  }
1033  return !1;
1034};
1035m.isAsyncFunction = function() {
1036  if (this.options.ecmaVersion < 8 || !this.isContextual("async"))
1037    return !1;
1038  Z.lastIndex = this.pos;
1039  var e = Z.exec(this.input), t = this.pos + e[0].length, r;
1040  return !Y.test(this.input.slice(this.pos, t)) && this.input.slice(t, t + 8) === "function" && (t + 8 === this.input.length || !(_e(r = this.input.charCodeAt(t + 8)) || r > 55295 && r < 56320));
1041};
1042m.parseStatement = function(e, t, r) {
1043  var i = this.type, s = this.startNode(), a;
1044  switch (this.isLet(e) && (i = o._var, a = "let"), i) {
1045    case o._break:
1046    case o._continue:
1047      return this.parseBreakContinueStatement(s, i.keyword);
1048    case o._debugger:
1049      return this.parseDebuggerStatement(s);
1050    case o._do:
1051      return this.parseDoStatement(s);
1052    case o._for:
1053      return this.parseForStatement(s);
1054    case o._function:
1055      return e && (this.strict || e !== "if" && e !== "label") && this.options.ecmaVersion >= 6 && this.unexpected(), this.parseFunctionStatement(s, !1, !e);
1056    case o._class:
1057      return e && this.unexpected(), this.parseClass(s, !0);
1058    case o._if:
1059      return this.parseIfStatement(s);
1060    case o._return:
1061      return this.parseReturnStatement(s);
1062    case o._switch:
1063      return this.parseSwitchStatement(s);
1064    case o._throw:
1065      return this.parseThrowStatement(s);
1066    case o._try:
1067      return this.parseTryStatement(s);
1068    case o._const:
1069    case o._var:
1070      return a = a || this.value, e && a !== "var" && this.unexpected(), this.parseVarStatement(s, a);
1071    case o._while:
1072      return this.parseWhileStatement(s);
1073    case o._with:
1074      return this.parseWithStatement(s);
1075    case o.braceL:
1076      return this.parseBlock(!0, s);
1077    case o.semi:
1078      return this.parseEmptyStatement(s);
1079    case o._export:
1080    case o._import:
1081      if (this.options.ecmaVersion > 10 && i === o._import) {
1082        Z.lastIndex = this.pos;
1083        var n = Z.exec(this.input), u = this.pos + n[0].length, l = this.input.charCodeAt(u);
1084        if (l === 40 || l === 46)
1085          return this.parseExpressionStatement(s, this.parseExpression());
1086      }
1087      return this.options.allowImportExportEverywhere || (t || this.raise(this.start, "'import' and 'export' may only appear at the top level"), this.inModule || this.raise(this.start, "'import' and 'export' may appear only with 'sourceType: module'")), i === o._import ? this.parseImport(s) : this.parseExport(s, r);
1088    // If the statement does not start with a statement keyword or a
1089    // brace, it's an ExpressionStatement or LabeledStatement. We
1090    // simply start parsing an expression, and afterwards, if the
1091    // next token is a colon and the expression was a simple
1092    // Identifier node, we switch to interpreting it as a label.
1093    default:
1094      if (this.isAsyncFunction())
1095        return e && this.unexpected(), this.next(), this.parseFunctionStatement(s, !0, !e);
1096      var c = this.value, f = this.parseExpression();
1097      return i === o.name && f.type === "Identifier" && this.eat(o.colon) ? this.parseLabeledStatement(s, c, f, e) : this.parseExpressionStatement(s, f);
1098  }
1099};
1100m.parseBreakContinueStatement = function(e, t) {
1101  var r = t === "break";
1102  this.next(), this.eat(o.semi) || this.insertSemicolon() ? e.label = null : this.type !== o.name ? this.unexpected() : (e.label = this.parseIdent(), this.semicolon());
1103  for (var i = 0; i < this.labels.length; ++i) {
1104    var s = this.labels[i];
1105    if ((e.label == null || s.name === e.label.name) && (s.kind != null && (r || s.kind === "loop") || e.label && r))
1106      break;
1107  }
1108  return i === this.labels.length && this.raise(e.start, "Unsyntactic " + t), this.finishNode(e, r ? "BreakStatement" : "ContinueStatement");
1109};
1110m.parseDebuggerStatement = function(e) {
1111  return this.next(), this.semicolon(), this.finishNode(e, "DebuggerStatement");
1112};
1113m.parseDoStatement = function(e) {
1114  return this.next(), this.labels.push(Rt), e.body = this.parseStatement("do"), this.labels.pop(), this.expect(o._while), e.test = this.parseParenExpression(), this.options.ecmaVersion >= 6 ? this.eat(o.semi) : this.semicolon(), this.finishNode(e, "DoWhileStatement");
1115};
1116m.parseForStatement = function(e) {
1117  this.next();
1118  var t = this.options.ecmaVersion >= 9 && this.canAwait && this.eatContextual("await") ? this.lastTokStart : -1;
1119  if (this.labels.push(Rt), this.enterScope(0), this.expect(o.parenL), this.type === o.semi)
1120    return t > -1 && this.unexpected(t), this.parseFor(e, null);
1121  var r = this.isLet();
1122  if (this.type === o._var || this.type === o._const || r) {
1123    var i = this.startNode(), s = r ? "let" : this.value;
1124    return this.next(), this.parseVar(i, !0, s), this.finishNode(i, "VariableDeclaration"), (this.type === o._in || this.options.ecmaVersion >= 6 && this.isContextual("of")) && i.declarations.length === 1 ? (this.options.ecmaVersion >= 9 && (this.type === o._in ? t > -1 && this.unexpected(t) : e.await = t > -1), this.parseForIn(e, i)) : (t > -1 && this.unexpected(t), this.parseFor(e, i));
1125  }
1126  var a = this.isContextual("let"), n = !1, u = this.containsEsc, l = new at(), c = this.start, f = t > -1 ? this.parseExprSubscripts(l, "await") : this.parseExpression(!0, l);
1127  return this.type === o._in || (n = this.options.ecmaVersion >= 6 && this.isContextual("of")) ? (t > -1 ? (this.type === o._in && this.unexpected(t), e.await = !0) : n && this.options.ecmaVersion >= 8 && (f.start === c && !u && f.type === "Identifier" && f.name === "async" ? this.unexpected() : this.options.ecmaVersion >= 9 && (e.await = !1)), a && n && this.raise(f.start, "The left-hand side of a for-of loop may not start with 'let'."), this.toAssignable(f, !1, l), this.checkLValPattern(f), this.parseForIn(e, f)) : (this.checkExpressionErrors(l, !0), t > -1 && this.unexpected(t), this.parseFor(e, f));
1128};
1129m.parseFunctionStatement = function(e, t, r) {
1130  return this.next(), this.parseFunction(e, Be | (r ? 0 : bt), !1, t);
1131};
1132m.parseIfStatement = function(e) {
1133  return this.next(), e.test = this.parseParenExpression(), e.consequent = this.parseStatement("if"), e.alternate = this.eat(o._else) ? this.parseStatement("if") : null, this.finishNode(e, "IfStatement");
1134};
1135m.parseReturnStatement = function(e) {
1136  return !this.inFunction && !this.options.allowReturnOutsideFunction && this.raise(this.start, "'return' outside of function"), this.next(), this.eat(o.semi) || this.insertSemicolon() ? e.argument = null : (e.argument = this.parseExpression(), this.semicolon()), this.finishNode(e, "ReturnStatement");
1137};
1138m.parseSwitchStatement = function(e) {
1139  this.next(), e.discriminant = this.parseParenExpression(), e.cases = [], this.expect(o.braceL), this.labels.push(Hr), this.enterScope(0);
1140  for (var t, r = !1; this.type !== o.braceR; )
1141    if (this.type === o._case || this.type === o._default) {
1142      var i = this.type === o._case;
1143      t && this.finishNode(t, "SwitchCase"), e.cases.push(t = this.startNode()), t.consequent = [], this.next(), i ? t.test = this.parseExpression() : (r && this.raiseRecoverable(this.lastTokStart, "Multiple default clauses"), r = !0, t.test = null), this.expect(o.colon);
1144    } else
1145      t || this.unexpected(), t.consequent.push(this.parseStatement(null));
1146  return this.exitScope(), t && this.finishNode(t, "SwitchCase"), this.next(), this.labels.pop(), this.finishNode(e, "SwitchStatement");
1147};
1148m.parseThrowStatement = function(e) {
1149  return this.next(), Y.test(this.input.slice(this.lastTokEnd, this.start)) && this.raise(this.lastTokEnd, "Illegal newline after throw"), e.argument = this.parseExpression(), this.semicolon(), this.finishNode(e, "ThrowStatement");
1150};
1151var Kr = [];
1152m.parseCatchClauseParam = function() {
1153  var e = this.parseBindingAtom(), t = e.type === "Identifier";
1154  return this.enterScope(t ? ui : 0), this.checkLValPattern(e, t ? fi : he), this.expect(o.parenR), e;
1155};
1156m.parseTryStatement = function(e) {
1157  if (this.next(), e.block = this.parseBlock(), e.handler = null, this.type === o._catch) {
1158    var t = this.startNode();
1159    this.next(), this.eat(o.parenL) ? t.param = this.parseCatchClauseParam() : (this.options.ecmaVersion < 10 && this.unexpected(), t.param = null, this.enterScope(0)), t.body = this.parseBlock(!1), this.exitScope(), e.handler = this.finishNode(t, "CatchClause");
1160  }
1161  return e.finalizer = this.eat(o._finally) ? this.parseBlock() : null, !e.handler && !e.finalizer && this.raise(e.start, "Missing catch or finally clause"), this.finishNode(e, "TryStatement");
1162};
1163m.parseVarStatement = function(e, t, r) {
1164  return this.next(), this.parseVar(e, !1, t, r), this.semicolon(), this.finishNode(e, "VariableDeclaration");
1165};
1166m.parseWhileStatement = function(e) {
1167  return this.next(), e.test = this.parseParenExpression(), this.labels.push(Rt), e.body = this.parseStatement("while"), this.labels.pop(), this.finishNode(e, "WhileStatement");
1168};
1169m.parseWithStatement = function(e) {
1170  return this.strict && this.raise(this.start, "'with' in strict mode"), this.next(), e.object = this.parseParenExpression(), e.body = this.parseStatement("with"), this.finishNode(e, "WithStatement");
1171};
1172m.parseEmptyStatement = function(e) {
1173  return this.next(), this.finishNode(e, "EmptyStatement");
1174};
1175m.parseLabeledStatement = function(e, t, r, i) {
1176  for (var s = 0, a = this.labels; s < a.length; s += 1) {
1177    var n = a[s];
1178    n.name === t && this.raise(r.start, "Label '" + t + "' is already declared");
1179  }
1180  for (var u = this.type.isLoop ? "loop" : this.type === o._switch ? "switch" : null, l = this.labels.length - 1; l >= 0; l--) {
1181    var c = this.labels[l];
1182    if (c.statementStart === e.start)
1183      c.statementStart = this.start, c.kind = u;
1184    else
1185      break;
1186  }
1187  return this.labels.push({ name: t, kind: u, statementStart: this.start }), e.body = this.parseStatement(i ? i.indexOf("label") === -1 ? i + "label" : i : "label"), this.labels.pop(), e.label = r, this.finishNode(e, "LabeledStatement");
1188};
1189m.parseExpressionStatement = function(e, t) {
1190  return e.expression = t, this.semicolon(), this.finishNode(e, "ExpressionStatement");
1191};
1192m.parseBlock = function(e, t, r) {
1193  for (e === void 0 && (e = !0), t === void 0 && (t = this.startNode()), t.body = [], this.expect(o.braceL), e && this.enterScope(0); this.type !== o.braceR; ) {
1194    var i = this.parseStatement(null);
1195    t.body.push(i);
1196  }
1197  return r && (this.strict = !1), this.next(), e && this.exitScope(), this.finishNode(t, "BlockStatement");
1198};
1199m.parseFor = function(e, t) {
1200  return e.init = t, this.expect(o.semi), e.test = this.type === o.semi ? null : this.parseExpression(), this.expect(o.semi), e.update = this.type === o.parenR ? null : this.parseExpression(), this.expect(o.parenR), e.body = this.parseStatement("for"), this.exitScope(), this.labels.pop(), this.finishNode(e, "ForStatement");
types/index.d.ts 19 lines
1export type NestedCall =
2  | { tool: string; summary: string; status: 'running' | 'denied' | 'started' }
3  | { tool: string; summary: string; status: 'done' | 'failed'; ms: number }
4
5export type Outcome = { kind: 'running' } | { kind: 'returned'; text: string } | { kind: 'failed'; reason: string }
6
7export type Run = {
8  calls: readonly NestedCall[]
9  logs: readonly string[]
10  outcome: Outcome
11  elapsedMs: number | null
12}
13
14declare module 'claude-code' {
15  interface PluginState {
16    codemode: { runs: StateFamily<Run>; typed: StateFamily<string> }
17  }
18}
19