@ocai/app-sdk-ui 0.4.0 → 0.5.0

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.
package/dist/index.js CHANGED
@@ -1,84 +1,338 @@
1
1
  "use client";
2
- import { createMathPlugin as e } from "@streamdown/math";
3
- import { Streamdown as t } from "streamdown";
4
- import { clsx as n } from "clsx";
5
- import { twMerge as r } from "tailwind-merge";
6
- import { Fragment as i, jsx as a, jsxs as o } from "react/jsx-runtime";
7
- import { CheckIcon as s, ChevronDownIcon as c, CircleCheckIcon as l, ClockIcon as u, GlobeIcon as d, Loader2Icon as f, WrenchIcon as p, XIcon as m } from "lucide-react";
8
- import { createContext as h, isValidElement as g, memo as _, useContext as v, useEffect as y, useId as ee, useRef as b, useState as x } from "react";
9
- import { Collapsible as S, Slot as C, Tooltip as w } from "radix-ui";
10
- import { cva as T } from "class-variance-authority";
2
+ import { createCodePlugin as e } from "@streamdown/code";
3
+ import { createMathPlugin as t } from "@streamdown/math";
4
+ import { Streamdown as n } from "streamdown";
5
+ import { clsx as r } from "clsx";
6
+ import { twMerge as i } from "tailwind-merge";
7
+ import { Fragment as a, jsx as o, jsxs as s } from "react/jsx-runtime";
8
+ import { CheckIcon as c, ChevronDownIcon as l, CircleCheckIcon as u, ClockIcon as d, GlobeIcon as f, Loader2Icon as p, WrenchIcon as m, XIcon as h } from "lucide-react";
9
+ import { createContext as g, isValidElement as _, memo as v, useContext as ee, useEffect as y, useId as b, useRef as x, useState as S } from "react";
10
+ import { Collapsible as C, Slot as w, Tooltip as T } from "radix-ui";
11
+ import { cva as E } from "class-variance-authority";
11
12
  //#region src/lib/cn.ts
12
- function E(...e) {
13
- return r(n(e));
13
+ function D(...e) {
14
+ return i(r(e));
14
15
  }
15
- //#endregion
16
- //#region src/chat/response.tsx
17
- var te = e({ singleDollarTextMath: !0 });
18
- function ne({ className: e, ...n }) {
19
- return /* @__PURE__ */ a(t, {
20
- className: E("ocui-md size-full text-base font-normal leading-6 [&>*:first-child]:mt-0 [&>*:last-child]:mb-0 [&_code]:whitespace-pre-wrap [&_code]:wrap-break-word [&_pre]:max-w-full [&_pre]:overflow-x-auto", e),
21
- plugins: { math: te },
16
+ var O = [{
17
+ name: "codex-light",
18
+ type: "light",
19
+ fg: "#383a42",
20
+ bg: "transparent",
21
+ tokenColors: [
22
+ {
23
+ scope: /* @__PURE__ */ "customrule(keyword.control.as.js(keyword.control.as.jsx(keyword.control.as.ts(keyword.control.as.tsx(keyword.operator(markup.heading.setext(markup.raw.block.markdown(meta.array-binding-pattern-variable.js(meta.array-binding-pattern-variable.ts(meta.array-binding-pattern-variable.tsx(meta.brace.round.js(meta.brace.round.ts(meta.brace.round.tsx(meta.brace.square.js(meta.brace.square.ts(meta.brace.square.tsx(meta.class.body(meta.class.js,meta.class.ts,meta.class.jsx,meta.class.tsx(meta.class.php(meta.definition.property.js variable(meta.definition.property.jsx variable(meta.definition.property.ts variable(meta.definition.property.tsx variable(meta.method(meta.method-call(meta.property-list.scss punctuation.separator.key-value.scss(meta.separator(meta.tag(meta.tag.js punctuation.section.embedded(meta.tag.jsx punctuation.section.embedded(meta.tag.ts punctuation.section.embedded(meta.tag.tsx punctuation.section.embedded(meta.type.parameters.js support.type(meta.type.parameters.jsx support.type(meta.type.parameters.ts support.type(meta.type.parameters.tsx support.type(ng.attribute-with-value string.begin(ng.attribute-with-value string.end(ng.interpolation bracket(ng.operator(ng.pipe(none(punctuation.definition.array(punctuation.definition.function-parameters(punctuation.definition.metadata.markdown(punctuation.definition.method-parameters(punctuation.definition.parameters(punctuation.definition.separator(punctuation.definition.seperator(punctuation.definition.string.begin.markdown(punctuation.definition.string.end.markdown(punctuation.section.class(punctuation.section.inner-class(punctuation.section.method(punctuation.separator.annotation.python(punctuation.separator.parameter.js(punctuation.separator.parameter.ts(punctuation.separator.parameter.tsx (punctuation.separator.parameters.python(punctuation.terminator.statement.js(punctuation.terminator.statement.ts(punctuation.terminator.statement.tsx(source.cs keyword.operator(source.css property-name.support(source.css property-value.support(source.elixir source.embedded.source(source.java-properties meta.key-pair > punctuation(source.js meta.import-equals.external.js keyword.operator(source.js meta.tag.js keyword.operator(source.js punctuation.accessor(source.js punctuation.definition.block(source.js punctuation.definition.typeparameters(source.js punctuation.separator.comma(source.jsx meta.import-equals.external.jsx keyword.operator(source.jsx meta.tag.jsx keyword.operator(source.php class.bracket(source.python constant.other(source.ts meta.import-equals.external.ts keyword.operator(source.ts meta.tag.ts keyword.operator(source.ts punctuation.accessor(source.ts punctuation.definition.block(source.ts punctuation.definition.typeparameters(source.ts punctuation.separator.comma(source.tsx meta.import-equals.external.tsx keyword.operator(source.tsx meta.tag.tsx keyword.operator(source.tsx punctuation.accessor(source.tsx punctuation.definition.block(source.tsx punctuation.definition.typeparameters(source.tsx punctuation.separator.comma(storage.modifier.import(storage.modifier.lifetime.rust(storage.modifier.package(string > source(string embedded(support.constant.property-value.css(support.type.property-name(variable.other.object.cs(variable.other.object.js(variable.other.object.property.cs(variable.other.object.ts(variable.other.readwrite.cs(variable.other.readwrite.js(variable.other.readwrite.ts(variable.other.readwrite.tsx(variable.parameter".split("("),
24
+ settings: { foreground: "#383A42" }
25
+ },
26
+ {
27
+ scope: /* @__PURE__ */ "beginning.punctuation.definition.list.markdown,constant.language.import-export-all.js,constant.language.import-export-all.ts,entity.name.section.markdown,entity.name.tag,entity.name.variable.field.cs,keyword.control.default.js,keyword.control.default.ts,keyword.control.default.tsx,markup.deleted,markup.heading,meta.definition.variable,meta.export.default.js variable.other.readwrite.js,meta.export.default.ts variable.other.readwrite.ts,meta.object-literal.key.js,meta.object-literal.key.ts,ng.interpolation,ng.interpolation function,punctuation.definition.heading.markdown,punctuation.definition.variable.php,punctuation.definition.variable.shell,punctuation.separator.key-value.scss,punctuation.separator.variable.ruby,source.elixir embedded.section,source.elixir embedded.source.empty,source.elixir keyword.special-method,source.elixir readwrite.module punctuation,source.ini keyword.other.definition.ini,source.java-properties meta.key-pair,source.js support.variable,source.json meta.structure.dictionary.json > string.quoted.json,source.json meta.structure.dictionary.json > string.quoted.json > punctuation.string,source.ts support.variable,source.tsx support.variable,string.other.link,support.type.object.module.js,support.type.object.module.jsx,support.type.object.module.ts,support.type.object.module.tsx,support.type.property-name.json,support.type.property-name.json punctuation,support.variable.dom.js,support.variable.dom.ts,support.variable.magic.python,support.variable.property.dom.js,support.variable.property.dom.ts,support.variable.property.js,support.variable.property.ts,support.variable.property.tsx,variable,variable.other.readwrite.alias.js,variable.other.readwrite.alias.jsx,variable.other.readwrite.alias.ts,variable.other.readwrite.alias.tsx".split(","),
28
+ settings: { foreground: "#E45649" }
29
+ },
30
+ {
31
+ scope: /* @__PURE__ */ "keyword,keyword.control,keyword.operator.expression.in.js,keyword.operator.expression.in.jsx,keyword.operator.expression.in.ts,keyword.operator.expression.in.tsx,keyword.operator.expression.instanceof.js,keyword.operator.expression.instanceof.ts,keyword.operator.expression.instanceof.tsx,keyword.operator.expression.of.js,keyword.operator.expression.of.ts,keyword.operator.expression.of.tsx,keyword.operator.new.j,keyword.operator.new.ts,keyword.operator.new.tsx,keyword.other.unsafe.rust,markup.changed,markup.underline.link.image.markdown,markup.underline.link.markdown,meta.selector,ng.attribute-with-value string,punctuation.definition.metadata.markdown,source.c keyword.operator,source.cpp keyword.operator,source.cs keyword.operator,source.elixir variable.anonymous,source.elixir variable.definition,source.go storage.type.string,source.java keyword.operator.instanceof,source.js keyword.operator.delete,source.js keyword.operator.in,source.js keyword.operator.instanceof,source.js keyword.operator.new,source.js keyword.operator.of,source.js keyword.operator.typeof,source.js keyword.operator.void,source.python keyword.operator.logical.python,storage,storage.type.annotation,storage.type.primitive".split(","),
32
+ settings: { foreground: "#A626A4" }
33
+ },
34
+ {
35
+ scope: /* @__PURE__ */ "constant,constant.character.format.placeholder.other.python storage,constant.numeric,constant.variable,entity.name.lifetime.rust,entity.other.attribute-name,keyword.other.unit,markup.quote,meta.array-binding-pattern-variable.js variable.other.readwrite.js,meta.array-binding-pattern-variable.ts variable.other.readwrite.ts,meta.array-binding-pattern-variable.tsx variable.other.readwrite.tsx,meta.attribute.rust,meta.function.parameters.python,meta.link,ng.interpolation bool,punctuation.definition.bold.markdown,punctuation.definition.constant.css,punctuation.definition.constant.scss,source.elixir keyword.operator,source.elixir separator,source.python constant,source.python variable.parameter,support.constant,variable.other.constant.js,variable.other.constant.jsx,variable.other.constant.object.js,variable.other.constant.object.jsx,variable.other.constant.object.ts,variable.other.constant.object.tsx,variable.other.constant.property.js,variable.other.constant.property.ts,variable.other.constant.property.tsx,variable.other.constant.ruby,variable.other.constant.ts,variable.other.constant.tsx".split(","),
36
+ settings: { foreground: "#986801" }
37
+ },
38
+ {
39
+ scope: /* @__PURE__ */ "constant.character.escape,constant.language.import-export-all.jsx,constant.language.import-export-all.tsx,constant.language.json,constant.other.color,constant.other.symbol,entity.name.type.rust,markup.link,ng.tag,punctuation.separator.key-value.js,punctuation.separator.key-value.ts,punctuation.separator.key-value.tsx,source.flow keyword.operator,source.js keyword.operator,source.js.embedded.html keyword.operator,source.json meta.structure.array.json > constant.language.json,source.json meta.structure.dictionary.json > constant.language.json,source.ts keyword.operator,source.ts.embedded.html keyword.operator,source.tsx keyword.operator,storage.class.std.rust,storage.type.core.rust,storage.type.property.js,storage.type.property.jsx,storage.type.property.ts,storage.type.property.tsx,string.regexp,support.function,support.type".split(","),
40
+ settings: { foreground: "#0184BC" }
41
+ },
42
+ {
43
+ scope: [
44
+ "entity.name.type.module.js,entity.name.type.module.ts,entity.name.type.module.jsx,entity.name.type.module.tsx",
45
+ "keyword.operator.other.ruby",
46
+ "markup.inline.raw.markdown",
47
+ "markup.inserted",
48
+ "markup.raw",
49
+ "meta.template.expression.js string.quoted punctuation.definition",
50
+ "meta.template.expression.js string.template punctuation.definition.string.template",
51
+ "meta.template.expression.jsx string.quoted punctuation.definition",
52
+ "meta.template.expression.jsx string.template punctuation.definition.string.template",
53
+ "meta.template.expression.ts string.quoted punctuation.definition",
54
+ "meta.template.expression.ts string.template punctuation.definition.string.template",
55
+ "meta.template.expression.tsx string.quoted punctuation.definition",
56
+ "meta.template.expression.tsx string.template punctuation.definition.string.template",
57
+ "source.elixir quoted",
58
+ "source.js meta.template.expression.js punctuation.accessor",
59
+ "source.json meta.structure.array.json > value.json > string.quoted.json",
60
+ "source.json meta.structure.array.json > value.json > string.quoted.json > punctuation",
61
+ "source.json meta.structure.dictionary.json > value.json > string.quoted.json",
62
+ "source.json meta.structure.dictionary.json > value.json > string.quoted.json > punctuation",
63
+ "source.ts meta.template.expression.ts punctuation.accessor",
64
+ "source.tsx meta.template.expression.tsx punctuation.accessor",
65
+ "string",
66
+ "string.quoted.double punctuation"
67
+ ],
68
+ settings: { foreground: "#50A14F" }
69
+ },
70
+ {
71
+ scope: [
72
+ "entity.name.function",
73
+ "entity.name.section",
74
+ "entity.name.variable.property.cs",
75
+ "entity.other.attribute-name.id",
76
+ "keyword.other.special-method",
77
+ "markup.heading punctuation.definition.heading",
78
+ "meta.require",
79
+ "ng.interpolation function.begin",
80
+ "ng.interpolation function.end",
81
+ "ng.interpolation.begin",
82
+ "ng.interpolation.end",
83
+ "punctuation.definition.heading",
84
+ "punctuation.definition.identity",
85
+ "source.elixir constant.definition",
86
+ "source.elixir constant.language",
87
+ "source.elixir constant.numeric",
88
+ "source.gfm link entity",
89
+ "string.other.link.description.markdown",
90
+ "string.other.link.title.markdown",
91
+ "support.function.any-method"
92
+ ],
93
+ settings: { foreground: "#4078F2" }
94
+ },
95
+ {
96
+ scope: [
97
+ "entity.name.class",
98
+ "entity.name.type",
99
+ "entity.name.type.class",
100
+ "entity.other.inherited-class",
101
+ "meta.array.literal.js variable",
102
+ "meta.array.literal.jsx variable",
103
+ "meta.array.literal.ts variable",
104
+ "meta.array.literal.tsx variable",
105
+ "meta.class",
106
+ "ng.attribute-with-value attribute-name",
107
+ "source.elixir variable.constant",
108
+ "source.java storage.modifier.import",
109
+ "source.java storage.type",
110
+ "storage.type.cs",
111
+ "storage.type.primitive.array.java",
112
+ "string.regexp source.ruby.embedded",
113
+ "support.class"
114
+ ],
115
+ settings: { foreground: "#C18401" }
116
+ },
117
+ {
118
+ scope: [
119
+ "meta.template.expression.js punctuation.definition",
120
+ "meta.template.expression.ts punctuation.definition",
121
+ "punctuation.section.embedded",
122
+ "source.elixir regexp.section",
123
+ "source.elixir regexp.string",
124
+ "variable.interpolation"
125
+ ],
126
+ settings: { foreground: "#CA1243" }
127
+ },
128
+ {
129
+ scope: [
130
+ "source.css property-name",
131
+ "source.css property-value",
132
+ "source.elixir array",
133
+ "source.elixir scope",
134
+ "source.elixir section"
135
+ ],
136
+ settings: { foreground: "#696C77" }
137
+ },
138
+ {
139
+ scope: ["comment", "markup.quote.markdown"],
140
+ settings: {
141
+ foreground: "#A0A1A7",
142
+ fontStyle: "italic"
143
+ }
144
+ },
145
+ {
146
+ scope: ["comment markup.link", "punctuation.definition.comment"],
147
+ settings: { foreground: "#A0A1A7" }
148
+ },
149
+ {
150
+ scope: ["markup.italic", "punctuation.definition.italic"],
151
+ settings: {
152
+ foreground: "#A626A4",
153
+ fontStyle: "italic"
154
+ }
155
+ },
156
+ {
157
+ scope: ["punctuation.definition.bold"],
158
+ settings: {
159
+ foreground: "#C18401",
160
+ fontStyle: "bold"
161
+ }
162
+ },
163
+ {
164
+ scope: ["invalid.deprecated"],
165
+ settings: {
166
+ foreground: "#000000",
167
+ background: "#F2A60D"
168
+ }
169
+ },
170
+ {
171
+ scope: ["invalid.illegal"],
172
+ settings: {
173
+ foreground: "#50A14F",
174
+ background: "#FF1414"
175
+ }
176
+ },
177
+ {
178
+ scope: ["markup.bold"],
179
+ settings: {
180
+ foreground: "#986801",
181
+ fontStyle: "bold"
182
+ }
183
+ },
184
+ {
185
+ scope: ["source.elixir parameter.variable.function"],
186
+ settings: {
187
+ foreground: "#986801",
188
+ fontStyle: "italic"
189
+ }
190
+ },
191
+ {
192
+ scope: ["source.ruby constant.other.symbol > punctuation"],
193
+ settings: { foreground: "inherit" }
194
+ }
195
+ ]
196
+ }, {
197
+ name: "codex-dark",
198
+ type: "dark",
199
+ fg: "#ffffff",
200
+ bg: "transparent",
201
+ tokenColors: [
202
+ {
203
+ scope: /* @__PURE__ */ "beginning.punctuation.definition.list.markdown(constant(constant.character.character-class.regexp.xi(constant.character.entity(constant.character.format.placeholder.other.python(constant.numeric(constant.other.character-class.regexp(control.elements, keyword.operator.less(entity.global.clojure(entity.name.class(entity.name.class.identifier.namespace.type(entity.name.function.xi(entity.name.label(entity.name.label.cs(entity.name.lifetime.rust(entity.name.namespace(entity.name.package.go(entity.name.scope-resolution.function.call(entity.name.scope-resolution.function.definition(entity.name.section.markdown(entity.name.tag(entity.name.type(entity.name.type.module(entity.name.type.namespace(entity.name.variable.field.cs(entity.name.variable.local.cs(entity.name.variable.parameter.cs(entity.other.attribute-name(entity.other.attribute-name.class.css(entity.other.inherited-class(import.storage.java(inline-color-decoration rgb-value(invalid.deprecated.entity.other.attribute-name.html(invalid.illegal.unrecognized-tag.html(keyword.operator.assignment.go(keyword.operator.quantifier.regexp(keyword.other.unit(less rgb-value(log.error(log.warning(markup.bold,todo.bold(markup.changed.diff(markup.deleted(markup.deleted.diff(markup.heading(markup.heading.setext.1.markdown(markup.heading.setext.2.markdown(markup.list.asciidoc(meta.arguments.coffee(meta.definition.variable.name.groovy(meta.definition.variable.name.java(meta.function.c,meta.function.cpp(meta.property.object(meta.scope.prerequisites.makefile(meta.symbol.clojure(punctuation.definition.asciidoc(punctuation.definition.bold(punctuation.definition.bold.markdown(punctuation.definition.constant(punctuation.definition.delayed.unison,punctuation.definition.list.begin.unison,punctuation.definition.list.end.unison,punctuation.definition.ability.begin.unison,punctuation.definition.ability.end.unison,punctuation.operator.assignment.as.unison,punctuation.separator.pipe.unison,punctuation.separator.delimiter.unison,punctuation.definition.hash.unison(punctuation.definition.heading.markdown(punctuation.definition.list.begin.markdown(punctuation.definition.list.markdown(punctuation.definition.metadata.markdown(punctuation.definition.raw.markdown(punctuation.definition.string.begin.markdown(punctuation.definition.string.end.markdown(punctuation.section.embedded, variable.interpolation(selector.sass(source.java(source.json meta.structure.dictionary.json > string.quoted.json(source.json meta.structure.dictionary.json > string.quoted.json > punctuation.string(source.makefile(storage.modifier.import.groovy(storage.modifier.import.java,storage.type.java,storage.type.generic.java(storage.type.annotation.java(storage.type.cs(storage.type.haskell(storage.type.object.array.java(storage.type.php,meta.other.type.phpdoc.php,keyword.other.type.php,keyword.other.array.phpdoc.php(string.regexp(support.class, entity.name.type.class(support.constant.color.w3c-standard-color-name.css(support.constant.color.w3c-standard-color-name.css,support.constant.color.w3c-standard-color-name.scss(support.constant.core.rust(support.constant.elm(support.constant.ext.php,support.constant.std.php,support.constant.core.php,support.constant.parser-token.php(support.constant.font-name(support.constant.json(support.constant.math(support.constant.property-value.scss,support.constant.property-value.css(support.constant.property.math(support.module.node,support.type.object.module,support.module.node(support.other.namespace.use.php,support.other.namespace.use-as.php,entity.other.alias.php,meta.interface.php(support.other.parenthesis.regexp(support.type.object.console(support.type.primitive(support.type.primitive.ts,support.type.builtin.ts,support.type.primitive.tsx,support.type.builtin.tsx(support.type.property-name.json(support.type.property-name.json punctuation(support.type.property-name.toml, support.type.property-name.table.toml, support.type.property-name.array.toml(support.type.swift(support.type.vb.asp(support.variable.dom,support.variable.property.dom(support.variable.magic.python(support.variable.property.process(support.variable.semantic.hlsl(text.bracketed(text.variable(token.storage.type.java(token.warn-token(variable(variable.language(variable.language.rust(variable.other.class.js(variable.other.class.php(variable.other.class.ts(variable.other.constant(variable.other.constant.property(variable.other.object(variable.other.readwrite,meta.object-literal.key,support.variable.property,support.variable.object.process,support.variable.object.node(variable.other.readwrite.c(variable.parameter.function.coffee(variable.parameter.function.js(variable.parameter.function.language.python(variable.parameter.function.language.special.cls.python(variable.parameter.function.language.special.self.python(variable.parameter.function.latex(variable.parameter.function.python(wikiword.xi".split("("),
204
+ settings: { foreground: "#df3079" }
205
+ },
206
+ {
207
+ scope: /* @__PURE__ */ "constant.character.escape(constant.keyword.clojure(constant.language.symbol.double-quoted.elixir(constant.language.symbol.elixir(constant.language.symbol.hashkey.ruby(constant.language.symbol.ruby(constant.numeric.decimal.asm.x86_64(constant.other.symbol(constant.regexp.xi(emphasis md(entity.name.class.xi(entity.other.attribute-name.pseudo-class(entity.other.attribute-name.pseudo-element(keyword(keyword.control(keyword.control.xi(keyword.operator.address.go(keyword.operator.arithmetic,keyword.operator.comparison,keyword.operator.decrement,keyword.operator.increment,keyword.operator.relational(keyword.operator.arithmetic.c(keyword.operator.arithmetic.cpp(keyword.operator.arithmetic.go(keyword.operator.assignment(keyword.operator.assignment.c,keyword.operator.comparison.c,keyword.operator.c,keyword.operator.increment.c,keyword.operator.decrement.c,keyword.operator.bitwise.shift.c,keyword.operator.assignment.cpp,keyword.operator.comparison.cpp,keyword.operator.cpp,keyword.operator.increment.cpp,keyword.operator.decrement.cpp,keyword.operator.bitwise.shift.cpp(keyword.operator.assignment.compound(keyword.operator.assignment.compound.js,keyword.operator.assignment.compound.ts(keyword.operator.bitwise(keyword.operator.channel(keyword.operator.comparison.php(keyword.operator.css,keyword.operator.scss,keyword.operator.less(keyword.operator.delete(keyword.operator.error-control.php(keyword.operator.expression.delete,keyword.operator.expression.in,keyword.operator.expression.of,keyword.operator.expression.instanceof,keyword.operator.new,keyword.operator.expression.typeof,keyword.operator.expression.void(keyword.operator.expression.instanceof(keyword.operator.expression.is(keyword.operator.expression.keyof(keyword.operator.heredoc.php,keyword.operator.nowdoc.php(keyword.operator.instanceof.java(keyword.operator.logical(keyword.operator.logical.php,keyword.operator.bitwise.php,keyword.operator.arithmetic.php(keyword.operator.logical.python(keyword.operator.module(keyword.operator.new(keyword.operator.optional(keyword.operator.regexp.php(keyword.operator.sigil.rust(keyword.operator.sizeof.c,keyword.operator.sizeof.cpp(keyword.operator.ternary(keyword.operator.type.php(keyword.operator.word(markup.italic, punctuation.definition.italic,todo.emphasis(markup.link.asciidoc,markup.other.url.asciidoc(markup.underline.link.markdown,markup.underline.link.image.markdown(meta.selector(punctuation.definition.template-expression.begin(punctuation.definition.template-expression.end(punctuation.quasi.element(punctuation.section.embedded(punctuation.section.embedded.begin,punctuation.section.embedded.end(punctuation.separator.c,punctuation.separator.cpp(rgb-value(source.json meta.structure.dictionary.json > constant.language.json,source.json meta.structure.array.json > constant.language.json(storage(string.regexp(support.constant.edge(support.function(support.token.decorator.python,meta.function.decorator.identifier.python(support.type.fx.hlsl(support.type.object.dom(support.type.object.hlsl(support.type.object.rw.hlsl(support.type.posix-reserved.c,support.type.posix-reserved.cpp(support.type.prelude.elm(support.type.python(support.type.sampler.hlsl(support.type.texture.hlsl(support.type.vendored.property-name.css(text.html.laravel-blade source.php.embedded.line.html entity.name.tag.laravel-blade(text.html.laravel-blade source.php.embedded.line.html support.constant.laravel-blade(token.debug-token(token.package.keyword(token.storage(variable.other.generic-type.haskell".split("("),
208
+ settings: { foreground: "#2e95d3" }
209
+ },
210
+ {
211
+ scope: /* @__PURE__ */ " meta.brace.square(block.scope.end,block.scope.begin(entity.name.variable.parameter.php,punctuation.separator.colon.php,constant.other.php(function.brace(function.parameter(function.parameter.ruby, function.parameter.cs(invalid.illegal.bad-ampersand.html(invalid.xi(keyword.operator(keyword.operator.misc.rust(markup.heading.setext(meta.embedded(meta.tag(meta.template.expression(punctuation.definition.arguments.begin.python,punctuation.definition.arguments.end.python,punctuation.separator.arguments.python,punctuation.definition.list.begin.python,punctuation.definition.list.end.python(punctuation.definition.block.sequence.item.yaml(punctuation.definition.parameters.begin.bracket.round.php,punctuation.definition.parameters.end.bracket.round.php,punctuation.separator.delimiter.php,punctuation.section.scope.begin.php,punctuation.section.scope.end.php,punctuation.terminator.expression.php,punctuation.definition.arguments.begin.bracket.round.php,punctuation.definition.arguments.end.bracket.round.php,punctuation.definition.storage-type.begin.bracket.round.php,punctuation.definition.storage-type.end.bracket.round.php,punctuation.definition.array.begin.bracket.round.php,punctuation.definition.array.end.bracket.round.php,punctuation.definition.begin.bracket.round.php,punctuation.definition.end.bracket.round.php,punctuation.definition.begin.bracket.curly.php,punctuation.definition.end.bracket.curly.php,punctuation.definition.section.switch-block.end.bracket.curly.php,punctuation.definition.section.switch-block.start.bracket.curly.php,punctuation.definition.section.switch-block.begin.bracket.curly.php,punctuation.definition.section.switch-block.end.bracket.curly.php(punctuation.section.array.begin.php(punctuation.section.array.end.php(punctuation.section.block.begin.bracket.curly.cpp,punctuation.section.block.end.bracket.curly.cpp,punctuation.terminator.statement.c,punctuation.section.block.begin.bracket.curly.c,punctuation.section.block.end.bracket.curly.c,punctuation.section.parens.begin.bracket.round.c,punctuation.section.parens.end.bracket.round.c,punctuation.section.parameters.begin.bracket.round.c,punctuation.section.parameters.end.bracket.round.c(punctuation.section.block.begin.java,punctuation.section.block.end.java,punctuation.definition.method-parameters.begin.java,punctuation.definition.method-parameters.end.java,meta.method.identifier.java,punctuation.section.method.begin.java,punctuation.section.method.end.java,punctuation.terminator.java,punctuation.section.class.begin.java,punctuation.section.class.end.java,punctuation.section.inner-class.begin.java,punctuation.section.inner-class.end.java,meta.method-call.java,punctuation.section.class.begin.bracket.curly.java,punctuation.section.class.end.bracket.curly.java,punctuation.section.method.begin.bracket.curly.java,punctuation.section.method.end.bracket.curly.java,punctuation.separator.period.java,punctuation.bracket.angle.java,punctuation.definition.annotation.java,meta.method.body.java(punctuation.section.embedded.begin.php(punctuation.section.embedded.end.php(punctuation.separator.delimiter(punctuation.separator.key-value(punctuation.separator.list.comma.css(punctuation.separator.period.python,punctuation.separator.element.python,punctuation.parenthesis.begin.python,punctuation.parenthesis.end.python(storage.modifier.lifetime.rust(support.constant.property-value(support.other.namespace.php(support.type.property-name(token.package(token.variable.parameter.java(variable.c(variable.parameter.function".split("("),
212
+ settings: { foreground: "#ffffff" }
213
+ },
214
+ {
215
+ scope: /* @__PURE__ */ "accent.xi(constant.character.xi(constant.other.color.rgb-value.xi(constant.other.general.math.tex(entity.name.function(entity.name.function,support.function.console(entity.name.goto-label.php,support.other.php(entity.other.attribute-name.id(invalid.broken(invalid.deprecated(invalid.illegal(invalid.illegal.non-null-typehinted.php(invalid.unimplemented(keyword.operator.expression.import(keyword.other.special-method(markup.heading punctuation.definition.heading, entity.name.section(meta.diff.header.from-file,meta.diff.header.to-file,punctuation.definition.from-file.diff,punctuation.definition.to-file.diff(meta.function-call.generic.python(meta.function-call.php,meta.function-call.object.php,meta.function-call.static.php(meta.function.decorator.python(meta.method.groovy(meta.method.java(meta.require(string.other.link.title.markdown,string.other.link.description.markdown(string.unquoted.asciidoc,markup.other.url.asciidoc(support.class.math.block.environment.latex(support.function.any-method(support.function.std.rust(support.type.type.flowtype(token.error-token(token.info-token(variable.function".split("("),
216
+ settings: { foreground: "#f22c3d" }
217
+ },
218
+ {
219
+ scope: [
220
+ "beginning.punctuation.definition.quote.markdown.xi",
221
+ "constant.character.math.tex",
222
+ "keyword.other.substitution.begin",
223
+ "keyword.other.substitution.end",
224
+ "keyword.other.template.begin",
225
+ "keyword.other.template.end",
226
+ "log.info",
227
+ "markup.inline.raw.markdown",
228
+ "markup.inline.raw.string.markdown",
229
+ "markup.inserted",
230
+ "markup.inserted.diff",
231
+ "markup.raw.monospace.asciidoc",
232
+ "meta.definition.class.inherited.classes.groovy",
233
+ "source.ini",
234
+ "source.json meta.structure.dictionary.json > value.json > string.quoted.json,source.json meta.structure.array.json > value.json > string.quoted.json,source.json meta.structure.dictionary.json > value.json > string.quoted.json > punctuation,source.json meta.structure.array.json > value.json > string.quoted.json > punctuation",
235
+ "string"
236
+ ],
237
+ settings: { foreground: "#00a67d" }
238
+ },
239
+ {
240
+ scope: [
241
+ "beginning.punctuation.definition.list.markdown.xi",
242
+ "comment markup.link",
243
+ "markup.quote.markdown",
244
+ "punctuation.definition.tag.xi"
245
+ ],
246
+ settings: { foreground: "#ffffff80" }
247
+ },
248
+ {
249
+ scope: ["comment, punctuation.definition.comment"],
250
+ settings: {
251
+ foreground: "#ffffff80",
252
+ fontStyle: "italic"
253
+ }
254
+ },
255
+ {
256
+ scope: [
257
+ "meta.tag",
258
+ "punctuation.definition.tag",
259
+ "punctuation.definition.tag.begin",
260
+ "punctuation.definition.tag.end",
261
+ "keyword.other.shebang",
262
+ "meta.preprocessor"
263
+ ],
264
+ settings: { foreground: "#ffffff99" }
265
+ }
266
+ ]
267
+ }], k = t({ singleDollarTextMath: !0 }), A = e({ themes: O });
268
+ function j({ className: e, ...t }) {
269
+ return /* @__PURE__ */ o(n, {
270
+ className: D("ocui-md size-full text-base font-normal leading-6 [&>*:first-child]:mt-0 [&>*:last-child]:mb-0 [&_code]:whitespace-pre-wrap [&_code]:wrap-break-word [&_pre]:max-w-full [&_pre]:overflow-x-auto", e),
271
+ plugins: {
272
+ math: k,
273
+ code: A
274
+ },
22
275
  controls: {
23
276
  table: !1,
24
277
  code: { download: !1 }
25
278
  },
26
- ...n
279
+ ...t
27
280
  });
28
281
  }
29
282
  //#endregion
30
283
  //#region src/chat/message.tsx
31
- var D = {
284
+ var te = {
32
285
  user: "w-fit wrap-break-word rounded-md bg-card px-3 py-1.5 text-primary",
33
286
  assistant: "bg-transparent px-0 py-0 text-left text-foreground"
34
- }, O = ({ children: e, className: t, variant: n = "user", ...r }) => /* @__PURE__ */ a("div", {
35
- className: E("flex flex-col gap-2 overflow-hidden text-base font-normal leading-6", D[n], t),
287
+ }, ne = ({ children: e, className: t, variant: n = "user", ...r }) => /* @__PURE__ */ o("div", {
288
+ className: D("flex flex-col gap-2 overflow-hidden text-base font-normal leading-6", te[n], t),
36
289
  ...r,
37
290
  children: e
38
291
  });
39
292
  //#endregion
40
293
  //#region src/internal/collapsible.tsx
41
- function k({ ...e }) {
42
- return /* @__PURE__ */ a(S.Root, {
294
+ function M({ ...e }) {
295
+ return /* @__PURE__ */ o(C.Root, {
43
296
  "data-slot": "collapsible",
44
297
  ...e
45
298
  });
46
299
  }
47
- function A({ ...e }) {
48
- return /* @__PURE__ */ a(S.CollapsibleTrigger, {
300
+ function N({ ...e }) {
301
+ return /* @__PURE__ */ o(C.CollapsibleTrigger, {
49
302
  "data-slot": "collapsible-trigger",
50
303
  ...e
51
304
  });
52
305
  }
53
- function j({ ...e }) {
54
- return /* @__PURE__ */ a(S.CollapsibleContent, {
306
+ function P({ ...e }) {
307
+ return /* @__PURE__ */ o(C.CollapsibleContent, {
55
308
  "data-slot": "collapsible-content",
56
309
  ...e
57
310
  });
58
311
  }
312
+ var re = "overflow-hidden outline-hidden transition-opacity data-[state=closed]:opacity-0 data-[state=open]:animate-collapsible-down data-[state=closed]:animate-collapsible-up";
59
313
  //#endregion
60
314
  //#region src/chat/reasoning.tsx
61
- function re({ prop: e, defaultProp: t, onChange: n }) {
62
- let [r, i] = x(t), a = e !== void 0;
315
+ function ie({ prop: e, defaultProp: t, onChange: n }) {
316
+ let [r, i] = S(t), a = e !== void 0;
63
317
  return [a ? e : r, (e) => {
64
318
  a || i(e), n?.(e);
65
319
  }];
66
320
  }
67
- var M = h(null), ie = () => {
68
- let e = v(M);
321
+ var F = g(null), ae = () => {
322
+ let e = ee(F);
69
323
  if (!e) throw Error("Reasoning components must be used within Reasoning");
70
324
  return e;
71
- }, ae = 500, N = _(({ className: e, isStreaming: t = !1, duration: n = 0, open: r, defaultOpen: i = !0, onOpenChange: o, children: s, ...c }) => {
72
- let [l, u] = re({
325
+ }, oe = 500, I = v(({ className: e, isStreaming: t = !1, duration: n = 0, open: r, defaultOpen: i = !0, onOpenChange: a, children: s, ...c }) => {
326
+ let [l, u] = ie({
73
327
  prop: r,
74
328
  defaultProp: i,
75
- onChange: o
76
- }), [d, f] = x(!1), p = b(u);
329
+ onChange: a
330
+ }), [d, f] = S(!1), p = x(u);
77
331
  return p.current = u, y(() => {
78
332
  if (i && !t && l && !d) {
79
333
  let e = setTimeout(() => {
80
334
  p.current(!1), f(!0);
81
- }, ae);
335
+ }, oe);
82
336
  return () => clearTimeout(e);
83
337
  }
84
338
  }, [
@@ -86,15 +340,15 @@ var M = h(null), ie = () => {
86
340
  l,
87
341
  i,
88
342
  d
89
- ]), /* @__PURE__ */ a(M.Provider, {
343
+ ]), /* @__PURE__ */ o(F.Provider, {
90
344
  value: {
91
345
  isStreaming: t,
92
346
  isOpen: l,
93
347
  setIsOpen: u,
94
348
  duration: n
95
349
  },
96
- children: /* @__PURE__ */ a(k, {
97
- className: E("not-prose", e),
350
+ children: /* @__PURE__ */ o(M, {
351
+ className: D("not-prose", e),
98
352
  onOpenChange: u,
99
353
  open: l,
100
354
  ...c,
@@ -102,106 +356,106 @@ var M = h(null), ie = () => {
102
356
  })
103
357
  });
104
358
  });
105
- function oe({ variant: e, isStreaming: t, duration: n }) {
359
+ function se({ variant: e, isStreaming: t, duration: n }) {
106
360
  let r = e === "tools";
107
361
  return t ? r ? "Working…" : "Thinking…" : n > 0 ? r ? `Worked for ${n}s` : `Thought for ${n}s` : r ? "Worked" : "Thought";
108
362
  }
109
- var P = _(({ className: e, children: t, variant: n = "reasoning", label: r, ...s }) => {
110
- let { isStreaming: l, isOpen: u, duration: d } = ie(), f = r ?? oe({
363
+ var L = v(({ className: e, children: t, variant: n = "reasoning", label: r, ...i }) => {
364
+ let { isStreaming: c, isOpen: u, duration: d } = ae(), f = r ?? se({
111
365
  variant: n,
112
- isStreaming: l,
366
+ isStreaming: c,
113
367
  duration: d
114
368
  });
115
- return /* @__PURE__ */ a(A, {
116
- className: E("flex items-center gap-1 rounded-md px-1.5 py-0.5 text-sm text-muted-foreground transition-colors hover:bg-muted hover:text-foreground", e),
117
- ...s,
118
- children: t ?? /* @__PURE__ */ o(i, { children: [
119
- n === "tools" && /* @__PURE__ */ a(p, { className: "size-3" }),
120
- /* @__PURE__ */ a("span", {
121
- className: E(l && "ocui-shimmer"),
369
+ return /* @__PURE__ */ o(N, {
370
+ className: D("flex items-center gap-1 rounded-md px-1.5 py-0.5 text-sm text-muted-foreground transition-colors hover:bg-muted hover:text-foreground", e),
371
+ ...i,
372
+ children: t ?? /* @__PURE__ */ s(a, { children: [
373
+ n === "tools" && /* @__PURE__ */ o(m, { className: "size-3" }),
374
+ /* @__PURE__ */ o("span", {
375
+ className: D(c && "ocui-shimmer"),
122
376
  children: f
123
377
  }),
124
- /* @__PURE__ */ a(c, { className: E("size-2.5 transition-transform", u ? "rotate-180" : "rotate-0") })
378
+ /* @__PURE__ */ o(l, { className: D("size-2.5 transition-transform", u ? "rotate-180" : "rotate-0") })
125
379
  ] })
126
380
  });
127
- }), F = "grid gap-1 text-sm text-muted-foreground/80 **:text-sm [&_code]:bg-transparent [&_code]:p-0 [&_code]:font-semibold [&_code]:text-foreground [&_li]:my-0 [&_ol]:my-1 [&_p]:my-0 [&_ul]:my-1", I = _(({ className: e, ...t }) => /* @__PURE__ */ a(j, {
128
- className: E(F, "mt-1.5", e),
381
+ }), R = "grid gap-1 text-sm text-muted-foreground/80 **:text-sm [&_code]:bg-transparent [&_code]:p-0 [&_code]:font-semibold [&_code]:text-foreground [&_li]:my-0 [&_ol]:my-1 [&_p]:my-0 [&_ul]:my-1", z = v(({ className: e, ...t }) => /* @__PURE__ */ o(P, {
382
+ className: D(R, "mt-1.5", e),
129
383
  ...t
130
384
  }));
131
- N.displayName = "Reasoning", P.displayName = "ReasoningTrigger", I.displayName = "ReasoningContent";
385
+ I.displayName = "Reasoning", L.displayName = "ReasoningTrigger", z.displayName = "ReasoningContent";
132
386
  //#endregion
133
387
  //#region src/chat/tool-value.tsx
134
- var se = 8, L = 240, ce = 2e4, R = (e) => e === null || typeof e != "object" && typeof e != "function", z = (e) => {
388
+ var ce = 8, B = 240, le = 2e4, V = (e) => e === null || typeof e != "object" && typeof e != "function", H = (e) => {
135
389
  if (typeof e != "object" || !e) return !1;
136
390
  let t = Object.getPrototypeOf(e);
137
391
  return t === Object.prototype || t === null;
138
- }, B = (e) => Array.isArray(e) && e.every(R), le = (e) => {
139
- if (!z(e)) return !1;
392
+ }, U = (e) => Array.isArray(e) && e.every(V), ue = (e) => {
393
+ if (!H(e)) return !1;
140
394
  let t = Object.keys(e);
141
- return t.length === 0 || t.length > se ? !1 : t.every((t) => R(e[t]) || B(e[t]));
142
- }, V = (e) => g(e) ? !0 : e == null ? !1 : typeof e == "string" ? e.trim().length > 0 : R(e) ? !0 : Array.isArray(e) ? e.length > 0 : z(e) ? Object.keys(e).length > 0 : !0, H = (e, t = ce) => e.length > t ? `${e.slice(0, t)}\n… (truncated)` : e, ue = (e) => {
395
+ return t.length === 0 || t.length > ce ? !1 : t.every((t) => V(e[t]) || U(e[t]));
396
+ }, W = (e) => _(e) ? !0 : e == null ? !1 : typeof e == "string" ? e.trim().length > 0 : V(e) ? !0 : Array.isArray(e) ? e.length > 0 : H(e) ? Object.keys(e).length > 0 : !0, G = (e, t = le) => e.length > t ? `${e.slice(0, t)}\n… (truncated)` : e, de = (e) => {
143
397
  try {
144
398
  let t = JSON.stringify(e, null, 2);
145
- return t === void 0 ? String(e) : H(t);
399
+ return t === void 0 ? String(e) : G(t);
146
400
  } catch {
147
401
  return String(e);
148
402
  }
149
- }, U = ({ value: e }) => {
150
- if (e == null) return /* @__PURE__ */ a("span", {
403
+ }, K = ({ value: e }) => {
404
+ if (e == null) return /* @__PURE__ */ o("span", {
151
405
  className: "font-mono text-muted-foreground",
152
406
  children: "null"
153
407
  });
154
- if (typeof e != "string") return /* @__PURE__ */ a("span", {
408
+ if (typeof e != "string") return /* @__PURE__ */ o("span", {
155
409
  className: "font-mono text-foreground",
156
410
  children: String(e)
157
411
  });
158
- if (e === "") return /* @__PURE__ */ a("span", {
412
+ if (e === "") return /* @__PURE__ */ o("span", {
159
413
  className: "text-muted-foreground italic",
160
414
  children: "empty"
161
415
  });
162
- let t = e.length > L;
163
- return /* @__PURE__ */ a("span", {
416
+ let t = e.length > B;
417
+ return /* @__PURE__ */ o("span", {
164
418
  className: "text-foreground",
165
419
  title: t ? e : void 0,
166
- children: t ? `${e.slice(0, L)}…` : e
420
+ children: t ? `${e.slice(0, B)}…` : e
167
421
  });
168
- }, W = ({ value: e }) => e.length === 0 ? /* @__PURE__ */ a("span", {
422
+ }, q = ({ value: e }) => e.length === 0 ? /* @__PURE__ */ o("span", {
169
423
  className: "text-muted-foreground italic",
170
424
  children: "none"
171
- }) : /* @__PURE__ */ a("span", {
425
+ }) : /* @__PURE__ */ o("span", {
172
426
  className: "text-foreground",
173
- children: e.map((e, t) => /* @__PURE__ */ o("span", { children: [t > 0 && /* @__PURE__ */ a("span", {
427
+ children: e.map((e, t) => /* @__PURE__ */ s("span", { children: [t > 0 && /* @__PURE__ */ o("span", {
174
428
  className: "px-1 text-muted-foreground/70",
175
429
  children: "·"
176
- }), /* @__PURE__ */ a(U, { value: e })] }, t))
177
- }), de = ({ data: e }) => /* @__PURE__ */ a("ul", {
430
+ }), /* @__PURE__ */ o(K, { value: e })] }, t))
431
+ }), fe = ({ data: e }) => /* @__PURE__ */ o("ul", {
178
432
  className: "ocui-tool-kv grid min-w-0 grid-cols-[auto_minmax(0,1fr)] gap-x-3 gap-y-1 text-xs",
179
- children: Object.entries(e).map(([e, t]) => /* @__PURE__ */ o("li", {
433
+ children: Object.entries(e).map(([e, t]) => /* @__PURE__ */ s("li", {
180
434
  className: "contents",
181
- children: [/* @__PURE__ */ a("span", {
435
+ children: [/* @__PURE__ */ o("span", {
182
436
  className: "break-words text-muted-foreground",
183
437
  children: e
184
- }), /* @__PURE__ */ a("span", {
438
+ }), /* @__PURE__ */ o("span", {
185
439
  className: "min-w-0 break-words whitespace-pre-wrap",
186
- children: B(t) ? /* @__PURE__ */ a(W, { value: t }) : /* @__PURE__ */ a(U, { value: t })
440
+ children: U(t) ? /* @__PURE__ */ o(q, { value: t }) : /* @__PURE__ */ o(K, { value: t })
187
441
  })]
188
442
  }, e))
189
- }), fe = ({ value: e }) => /* @__PURE__ */ a("pre", {
443
+ }), pe = ({ value: e }) => /* @__PURE__ */ o("pre", {
190
444
  className: "ocui-tool-json overflow-x-auto rounded-md bg-muted/40 px-2.5 py-2 font-mono text-xs text-muted-foreground",
191
- children: ue(e)
192
- }), G = ({ value: e }) => g(e) ? /* @__PURE__ */ a(i, { children: e }) : e == null ? null : typeof e == "string" ? e.trim() === "" ? null : /* @__PURE__ */ a("div", {
445
+ children: de(e)
446
+ }), J = ({ value: e }) => _(e) ? /* @__PURE__ */ o(a, { children: e }) : e == null ? null : typeof e == "string" ? e.trim() === "" ? null : /* @__PURE__ */ o("div", {
193
447
  className: "whitespace-pre-wrap break-words font-mono text-xs leading-relaxed text-muted-foreground",
194
- children: H(e)
195
- }) : R(e) ? /* @__PURE__ */ a("div", {
448
+ children: G(e)
449
+ }) : V(e) ? /* @__PURE__ */ o("div", {
196
450
  className: "font-mono text-xs text-foreground",
197
451
  children: String(e)
198
- }) : le(e) ? /* @__PURE__ */ a(de, { data: e }) : B(e) ? /* @__PURE__ */ a("div", {
452
+ }) : ue(e) ? /* @__PURE__ */ o(fe, { data: e }) : U(e) ? /* @__PURE__ */ o("div", {
199
453
  className: "text-xs",
200
- children: /* @__PURE__ */ a(W, { value: e })
201
- }) : /* @__PURE__ */ a(fe, { value: e }), pe = ({ className: e, ...t }) => /* @__PURE__ */ a(k, {
202
- className: E("not-prose w-full rounded-md border border-border", e),
454
+ children: /* @__PURE__ */ o(q, { value: e })
455
+ }) : /* @__PURE__ */ o(pe, { value: e }), me = ({ className: e, ...t }) => /* @__PURE__ */ o(M, {
456
+ className: D("not-prose w-full rounded-md border border-border", e),
203
457
  ...t
204
- }), me = {
458
+ }), he = {
205
459
  "input-streaming": "Pending",
206
460
  "input-available": "Running",
207
461
  "approval-requested": "Pending",
@@ -209,54 +463,54 @@ var se = 8, L = 240, ce = 2e4, R = (e) => e === null || typeof e != "object" &&
209
463
  "output-available": "Completed",
210
464
  "output-error": "Error",
211
465
  "output-denied": "Denied"
212
- }, he = {
213
- "input-streaming": /* @__PURE__ */ a(f, { className: "size-3.5 animate-spin motion-reduce:animate-none" }),
214
- "input-available": /* @__PURE__ */ a(f, { className: "size-3.5 animate-spin motion-reduce:animate-none" }),
215
- "approval-requested": /* @__PURE__ */ a(u, { className: "size-3.5" }),
216
- "approval-responded": /* @__PURE__ */ a(s, { className: "size-3.5" }),
217
- "output-available": /* @__PURE__ */ a(s, { className: "size-3.5" }),
218
- "output-error": /* @__PURE__ */ a(m, { className: "size-3.5 text-destructive" }),
219
- "output-denied": /* @__PURE__ */ a(m, { className: "size-3.5 text-destructive" })
220
- }, ge = ({ state: e }) => /* @__PURE__ */ o("span", {
466
+ }, ge = {
467
+ "input-streaming": /* @__PURE__ */ o(p, { className: "size-3.5 animate-spin motion-reduce:animate-none" }),
468
+ "input-available": /* @__PURE__ */ o(p, { className: "size-3.5 animate-spin motion-reduce:animate-none" }),
469
+ "approval-requested": /* @__PURE__ */ o(d, { className: "size-3.5" }),
470
+ "approval-responded": /* @__PURE__ */ o(c, { className: "size-3.5" }),
471
+ "output-available": /* @__PURE__ */ o(c, { className: "size-3.5" }),
472
+ "output-error": /* @__PURE__ */ o(h, { className: "size-3.5 text-destructive" }),
473
+ "output-denied": /* @__PURE__ */ o(h, { className: "size-3.5 text-destructive" })
474
+ }, _e = ({ state: e }) => /* @__PURE__ */ s("span", {
221
475
  className: "flex shrink-0 items-center gap-1 text-xs text-muted-foreground",
222
- children: [he[e], me[e]]
223
- }), _e = ({ className: e, type: t, state: n, title: r, ...i }) => /* @__PURE__ */ o(A, {
224
- className: E("group flex w-full min-w-0 items-center justify-between gap-2 rounded-md p-2.5 transition-colors hover:bg-muted/50", e),
476
+ children: [ge[e], he[e]]
477
+ }), ve = ({ className: e, type: t, state: n, title: r, ...i }) => /* @__PURE__ */ s(N, {
478
+ className: D("group flex w-full min-w-0 items-center justify-between gap-2 rounded-md p-2.5 transition-colors hover:bg-muted/50", e),
225
479
  ...i,
226
- children: [/* @__PURE__ */ o("div", {
480
+ children: [/* @__PURE__ */ s("div", {
227
481
  className: "flex min-w-0 flex-1 items-center gap-2",
228
- children: [/* @__PURE__ */ a(p, { className: "size-3.5 shrink-0 text-muted-foreground" }), /* @__PURE__ */ a("span", {
482
+ children: [/* @__PURE__ */ o(m, { className: "size-3.5 shrink-0 text-muted-foreground" }), /* @__PURE__ */ o("span", {
229
483
  className: "truncate text-sm font-medium",
230
484
  children: r ?? t
231
485
  })]
232
- }), /* @__PURE__ */ o("div", {
486
+ }), /* @__PURE__ */ s("div", {
233
487
  className: "flex shrink-0 items-center gap-2",
234
- children: [/* @__PURE__ */ a(ge, { state: n }), /* @__PURE__ */ a(c, { className: "size-3.5 text-muted-foreground transition-transform group-data-[state=open]:rotate-180" })]
488
+ children: [/* @__PURE__ */ o(_e, { state: n }), /* @__PURE__ */ o(l, { className: "size-3.5 text-muted-foreground transition-transform group-data-[state=open]:rotate-180" })]
235
489
  })]
236
- }), ve = ({ className: e, ...t }) => /* @__PURE__ */ a(j, {
237
- className: E("data-[state=closed]:fade-out-0 data-[state=closed]:slide-out-to-top-2 data-[state=open]:slide-in-from-top-2 text-popover-foreground outline-hidden data-[state=closed]:animate-out data-[state=open]:animate-in", e),
490
+ }), ye = ({ className: e, ...t }) => /* @__PURE__ */ o(P, {
491
+ className: D("data-[state=closed]:fade-out-0 data-[state=closed]:slide-out-to-top-2 data-[state=open]:slide-in-from-top-2 text-popover-foreground outline-hidden data-[state=closed]:animate-out data-[state=open]:animate-in", e),
238
492
  ...t
239
- }), ye = ({ className: e, input: t, ...n }) => V(t) ? /* @__PURE__ */ o("div", {
240
- className: E("space-y-1.5 overflow-hidden px-2.5 pb-2.5", e),
493
+ }), be = ({ className: e, input: t, ...n }) => W(t) ? /* @__PURE__ */ s("div", {
494
+ className: D("space-y-1.5 overflow-hidden px-2.5 pb-2.5", e),
241
495
  ...n,
242
- children: [/* @__PURE__ */ a("h4", {
496
+ children: [/* @__PURE__ */ o("h4", {
243
497
  className: "text-xs font-medium tracking-wide text-muted-foreground uppercase",
244
498
  children: "Parameters"
245
- }), /* @__PURE__ */ a(G, { value: t })]
246
- }) : null, be = ({ className: e, output: t, errorText: n, ...r }) => V(t) || n ? /* @__PURE__ */ o("div", {
247
- className: E("space-y-1.5 px-2.5 pb-2.5", e),
499
+ }), /* @__PURE__ */ o(J, { value: t })]
500
+ }) : null, xe = ({ className: e, output: t, errorText: n, ...r }) => W(t) || n ? /* @__PURE__ */ s("div", {
501
+ className: D("space-y-1.5 px-2.5 pb-2.5", e),
248
502
  ...r,
249
- children: [/* @__PURE__ */ a("h4", {
503
+ children: [/* @__PURE__ */ o("h4", {
250
504
  className: "text-xs font-medium tracking-wide text-muted-foreground uppercase",
251
505
  children: n ? "Error" : "Result"
252
- }), n ? /* @__PURE__ */ a("div", {
506
+ }), n ? /* @__PURE__ */ o("div", {
253
507
  className: "whitespace-pre-wrap break-words rounded-md bg-destructive/10 px-2.5 py-2 text-xs text-destructive",
254
508
  children: n
255
- }) : /* @__PURE__ */ a("div", {
509
+ }) : /* @__PURE__ */ o("div", {
256
510
  className: "text-xs [&_table]:w-full",
257
- children: /* @__PURE__ */ a(G, { value: t })
511
+ children: /* @__PURE__ */ o(J, { value: t })
258
512
  })]
259
- }) : null, xe = T("group/button inline-flex shrink-0 items-center justify-center rounded-lg border border-transparent bg-clip-padding text-sm font-medium whitespace-nowrap transition-colors outline-none select-none focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4", {
513
+ }) : null, Se = E("group/button inline-flex shrink-0 items-center justify-center rounded-lg border border-transparent bg-clip-padding text-sm font-medium whitespace-nowrap transition-colors outline-none select-none focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4", {
260
514
  variants: {
261
515
  variant: {
262
516
  default: "bg-primary text-primary-foreground hover:bg-primary/90",
@@ -282,12 +536,12 @@ var se = 8, L = 240, ce = 2e4, R = (e) => e === null || typeof e != "object" &&
282
536
  size: "default"
283
537
  }
284
538
  });
285
- function K({ className: e, variant: t = "default", size: n = "default", asChild: r = !1, ...i }) {
286
- return /* @__PURE__ */ a(r ? C.Root : "button", {
539
+ function Ce({ className: e, variant: t = "default", size: n = "default", asChild: r = !1, ...i }) {
540
+ return /* @__PURE__ */ o(r ? w.Root : "button", {
287
541
  "data-slot": "button",
288
542
  "data-variant": t,
289
543
  "data-size": n,
290
- className: E(xe({
544
+ className: D(Se({
291
545
  variant: t,
292
546
  size: n,
293
547
  className: e
@@ -297,69 +551,69 @@ function K({ className: e, variant: t = "default", size: n = "default", asChild:
297
551
  }
298
552
  //#endregion
299
553
  //#region src/internal/tooltip.tsx
300
- function q({ delayDuration: e = 0, ...t }) {
301
- return /* @__PURE__ */ a(w.Provider, {
554
+ function Y({ delayDuration: e = 0, ...t }) {
555
+ return /* @__PURE__ */ o(T.Provider, {
302
556
  "data-slot": "tooltip-provider",
303
557
  delayDuration: e,
304
558
  ...t
305
559
  });
306
560
  }
307
- function J({ ...e }) {
308
- return /* @__PURE__ */ a(w.Root, {
561
+ function X({ ...e }) {
562
+ return /* @__PURE__ */ o(T.Root, {
309
563
  "data-slot": "tooltip",
310
564
  ...e
311
565
  });
312
566
  }
313
- function Y({ ...e }) {
314
- return /* @__PURE__ */ a(w.Trigger, {
567
+ function Z({ ...e }) {
568
+ return /* @__PURE__ */ o(T.Trigger, {
315
569
  "data-slot": "tooltip-trigger",
316
570
  ...e
317
571
  });
318
572
  }
319
- function X({ className: e, sideOffset: t = 0, children: n, ...r }) {
320
- return /* @__PURE__ */ a(w.Portal, { children: /* @__PURE__ */ o(w.Content, {
573
+ function we({ className: e, sideOffset: t = 0, children: n, ...r }) {
574
+ return /* @__PURE__ */ o(T.Portal, { children: /* @__PURE__ */ s(T.Content, {
321
575
  "data-slot": "tooltip-content",
322
576
  sideOffset: t,
323
- className: E("z-50 inline-flex w-fit max-w-xs origin-(--radix-tooltip-content-transform-origin) items-center gap-1.5 rounded-md border border-border bg-popover px-3 py-1.5 text-xs text-popover-foreground shadow-md data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-[state=delayed-open]:animate-in data-[state=delayed-open]:fade-in-0 data-[state=delayed-open]:zoom-in-95 data-[state=instant-open]:animate-in data-[state=instant-open]:fade-in-0 data-[state=instant-open]:zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95", e),
577
+ className: D("z-50 inline-flex w-fit max-w-xs origin-(--radix-tooltip-content-transform-origin) items-center gap-1.5 rounded-md border border-border bg-popover px-3 py-1.5 text-xs text-popover-foreground shadow-md data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-[state=delayed-open]:animate-in data-[state=delayed-open]:fade-in-0 data-[state=delayed-open]:zoom-in-95 data-[state=instant-open]:animate-in data-[state=instant-open]:fade-in-0 data-[state=instant-open]:zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95", e),
324
578
  ...r,
325
- children: [n, /* @__PURE__ */ a(w.Arrow, { className: "z-50 size-2.5 translate-y-[calc(-50%-2px)] rotate-45 rounded-[2px] border-r border-b border-border bg-popover fill-popover" })]
579
+ children: [n, /* @__PURE__ */ o(T.Arrow, { className: "z-50 size-2.5 translate-y-[calc(-50%-2px)] rotate-45 rounded-[2px] border-r border-b border-border bg-popover fill-popover" })]
326
580
  }) });
327
581
  }
328
582
  //#endregion
329
583
  //#region src/chat/actions.tsx
330
- var Se = ({ className: e, children: t, ...n }) => /* @__PURE__ */ a("div", {
331
- className: E("-ml-1.5 flex items-center", e),
584
+ var Te = ({ className: e, children: t, ...n }) => /* @__PURE__ */ o("div", {
585
+ className: D("-ml-1.5 flex items-center", e),
332
586
  ...n,
333
587
  children: t
334
- }), Ce = ({ tooltip: e, children: t, label: n, className: r, variant: i = "ghost", size: s = "icon", ...c }) => {
335
- let l = /* @__PURE__ */ o(K, {
336
- className: E("relative", r),
337
- size: s,
588
+ }), Ee = ({ tooltip: e, children: t, label: n, className: r, variant: i = "ghost", size: a = "icon", ...c }) => {
589
+ let l = /* @__PURE__ */ s(Ce, {
590
+ className: D("relative", r),
591
+ size: a,
338
592
  type: "button",
339
593
  variant: i,
340
594
  ...c,
341
- children: [t, /* @__PURE__ */ a("span", {
595
+ children: [t, /* @__PURE__ */ o("span", {
342
596
  className: "sr-only",
343
597
  children: n || e
344
598
  })]
345
599
  });
346
- return e ? /* @__PURE__ */ a(q, {
600
+ return e ? /* @__PURE__ */ o(Y, {
347
601
  delayDuration: 500,
348
- children: /* @__PURE__ */ o(J, { children: [/* @__PURE__ */ a(Y, {
602
+ children: /* @__PURE__ */ s(X, { children: [/* @__PURE__ */ o(Z, {
349
603
  asChild: !0,
350
604
  children: l
351
- }), /* @__PURE__ */ a(X, { children: /* @__PURE__ */ a("p", { children: e }) })] })
605
+ }), /* @__PURE__ */ o(we, { children: /* @__PURE__ */ o("p", { children: e }) })] })
352
606
  }) : l;
353
607
  };
354
608
  //#endregion
355
609
  //#region src/chat/segments.ts
356
- function we(e, t) {
610
+ function De(e, t) {
357
611
  return e.startsWith("tool-") && !t(e);
358
612
  }
359
- function Te(e, t) {
613
+ function Oe(e, t) {
360
614
  let n = t?.isPresentationalTool ?? (() => !1), r = -1;
361
615
  e.forEach((e, t) => {
362
- (e.type === "reasoning" || we(e.type, n)) && (r = t);
616
+ (e.type === "reasoning" || De(e.type, n)) && (r = t);
363
617
  });
364
618
  let i = [], a = null, o = null, s = (e) => {
365
619
  o = null, a || (a = {
@@ -372,7 +626,7 @@ function Te(e, t) {
372
626
  let t = String(e.text ?? ""), n = e.state === "streaming";
373
627
  if (!(t.trim() || n)) return;
374
628
  s(e);
375
- } else we(e.type, n) ? s(e) : e.type === "text" && t <= r ? String(e.text ?? "").trim() && s(e) : e.type === "file" ? (a = null, o || (o = {
629
+ } else De(e.type, n) ? s(e) : e.type === "text" && t <= r ? String(e.text ?? "").trim() && s(e) : e.type === "file" ? (a = null, o || (o = {
376
630
  kind: "images",
377
631
  parts: [],
378
632
  index: t
@@ -383,7 +637,7 @@ function Te(e, t) {
383
637
  }));
384
638
  }), i;
385
639
  }
386
- function Ee(e, t) {
640
+ function ke(e, t) {
387
641
  return e.some((e) => {
388
642
  let n = e.state;
389
643
  return typeof n == "string" ? e.type === "reasoning" || e.type === "text" ? n === "streaming" : n === "input-streaming" || n === "input-available" : t;
@@ -391,15 +645,15 @@ function Ee(e, t) {
391
645
  }
392
646
  //#endregion
393
647
  //#region src/chat/web-search.ts
394
- function De(e) {
648
+ function Ae(e) {
395
649
  return typeof e == "object" && !!e && "error" in e && typeof e.error == "string";
396
650
  }
397
- var Oe = /\(\s*(\[[^\]\n]*\]\((?:[^()\n]|\([^()\n]*\))*\))\s*\)/g;
398
- function ke(e) {
399
- return e.replace(Oe, "$1");
651
+ var je = /\(\s*(\[[^\]\n]*\]\((?:[^()\n]|\([^()\n]*\))*\))\s*\)/g;
652
+ function Me(e) {
653
+ return e.replace(je, "$1");
400
654
  }
401
- var Ae = "tool-webSearch";
402
- function je(e) {
655
+ var Ne = "tool-webSearch";
656
+ function Pe(e) {
403
657
  try {
404
658
  let t = new URL(e);
405
659
  return `${t.hostname.toLowerCase()}${t.pathname.replace(/\/$/, "")}${t.search}`;
@@ -407,14 +661,14 @@ function je(e) {
407
661
  return e.replace(/#.*$/, "").replace(/\/$/, "");
408
662
  }
409
663
  }
410
- function Me(e, t) {
411
- let n = t?.toolType ?? Ae, r = /* @__PURE__ */ new Set(), i = [];
664
+ function Fe(e, t) {
665
+ let n = t?.toolType ?? Ne, r = /* @__PURE__ */ new Set(), i = [];
412
666
  for (let t of e) {
413
- if (t.type !== n || t.state !== "output-available" || De(t.output)) continue;
667
+ if (t.type !== n || t.state !== "output-available" || Ae(t.output)) continue;
414
668
  let e = t.output?.results;
415
669
  if (Array.isArray(e)) for (let t of e) {
416
670
  if (typeof t?.url != "string") continue;
417
- let e = je(t.url);
671
+ let e = Pe(t.url);
418
672
  r.has(e) || (r.add(e), i.push({
419
673
  url: t.url,
420
674
  title: typeof t.title == "string" ? t.title : void 0
@@ -425,14 +679,14 @@ function Me(e, t) {
425
679
  }
426
680
  //#endregion
427
681
  //#region src/chat/turn-view.ts
428
- function Ne(e, t) {
429
- let n = t?.isSearchTool ?? (() => !1), r = t?.messageLoading, i = Te(e, { isPresentationalTool: t?.isPresentationalTool }), a = i.flatMap((e) => e.kind === "trace" ? e.parts : []), o = i.filter((e) => e.kind === "part" && e.part.type === "text"), s = o.some((e) => String(e.part.text ?? "").trim() !== ""), c = s && o.some((e) => e.part.state === "streaming"), l = a.some((e) => e.type === "reasoning" && String(e.text ?? "").trim() !== ""), u = a.some((e) => e.type.startsWith("tool-")), d = i.length > 0, f = a.some((e) => e.type === "reasoning" && e.state === "streaming"), p;
682
+ function Ie(e, t) {
683
+ let n = t?.isSearchTool ?? (() => !1), r = t?.messageLoading, i = Oe(e, { isPresentationalTool: t?.isPresentationalTool }), a = i.flatMap((e) => e.kind === "trace" ? e.parts : []), o = i.filter((e) => e.kind === "part" && e.part.type === "text"), s = o.some((e) => String(e.part.text ?? "").trim() !== ""), c = s && o.some((e) => e.part.state === "streaming"), l = a.some((e) => e.type === "reasoning" && String(e.text ?? "").trim() !== ""), u = a.some((e) => e.type.startsWith("tool-")), d = i.length > 0, f = a.some((e) => e.type === "reasoning" && e.state === "streaming"), p;
430
684
  for (let e of a) {
431
685
  if (!e.type.startsWith("tool-")) continue;
432
686
  let t = String(e.state ?? "");
433
687
  t === "output-available" || t === "output-error" || t === "output-denied" || (p = e.type);
434
688
  }
435
- let m = a.length > 0 && Ee(a, r ?? !1), h = (r ?? !0) && !s, g = a.length > 0 ? {
689
+ let m = a.length > 0 && ke(a, r ?? !1), h = (r ?? !0) && !s, g = a.length > 0 ? {
436
690
  parts: a,
437
691
  isLoading: h
438
692
  } : null, _;
@@ -442,14 +696,14 @@ function Ne(e, t) {
442
696
  phase: _,
443
697
  segments: i,
444
698
  trace: g,
445
- sources: Me(e),
699
+ sources: Fe(e),
446
700
  activityKind: v,
447
701
  hasFinalAnswer: s
448
702
  };
449
703
  }
450
704
  //#endregion
451
705
  //#region src/chat/activity-labels.ts
452
- var Pe = [
706
+ var Le = [
453
707
  {
454
708
  active: "Thinking",
455
709
  done: "Thought"
@@ -498,19 +752,19 @@ var Pe = [
498
752
  active: "Crunching",
499
753
  done: "Crunched"
500
754
  }
501
- ], Fe = {
502
- waiting: Pe,
503
- reasoning: Pe,
755
+ ], Re = {
756
+ waiting: Le,
757
+ reasoning: Le,
504
758
  tools: [{
505
759
  active: "Working",
506
760
  done: "Worked"
507
761
  }]
508
762
  };
509
- function Z({ kind: e, active: t, seed: n, elapsedSeconds: r, verb: i }) {
763
+ function Q({ kind: e, active: t, seed: n, elapsedSeconds: r, verb: i }) {
510
764
  let a;
511
765
  if (i !== void 0) a = i;
512
766
  else {
513
- let r = Fe[e], i = r[Math.abs(n) % r.length];
767
+ let r = Re[e], i = r[Math.abs(n) % r.length];
514
768
  a = t ? i.active : i.done;
515
769
  }
516
770
  return {
@@ -518,36 +772,36 @@ function Z({ kind: e, active: t, seed: n, elapsedSeconds: r, verb: i }) {
518
772
  elapsedSeconds: r > 0 ? r : 0
519
773
  };
520
774
  }
521
- function Ie(e) {
522
- let { verb: t, elapsedSeconds: n } = Z(e);
775
+ function ze(e) {
776
+ let { verb: t, elapsedSeconds: n } = Q(e);
523
777
  return n <= 0 ? t : `${t} for ${n}s`;
524
778
  }
525
- function Le(e, t) {
779
+ function Be(e, t) {
526
780
  let n = Infinity, r = -Infinity, i = !1;
527
781
  for (let t of e) Number.isFinite(t.startedAtMs) && (n = Math.min(n, t.startedAtMs), Number.isFinite(t.completedAtMs) ? r = Math.max(r, t.completedAtMs) : i = !0);
528
782
  if (n === Infinity) return 0;
529
783
  let a = i && Number.isFinite(t) ? t : r;
530
784
  return a === -Infinity ? 0 : Math.max(0, Math.floor((a - n) / 1e3));
531
785
  }
532
- function Re(e) {
786
+ function Ve(e) {
533
787
  let t = 0;
534
788
  for (let n = 0; n < e.length; n += 1) t = t * 31 + e.charCodeAt(n) | 0;
535
789
  return t;
536
790
  }
537
791
  //#endregion
538
792
  //#region src/chat/message-trace.tsx
539
- function Q(e) {
793
+ function $(e) {
540
794
  let t = e.replace(/^tool-/, "").replace(/[_-]+/g, " ").replace(/([a-z0-9])([A-Z])/g, "$1 $2").trim();
541
795
  return t.charAt(0).toUpperCase() + t.slice(1);
542
796
  }
543
- var ze = _(({ parts: e, isLoading: t, messageId: n, activity: r, getToolLabel: i, getToolIcon: s, getActivityOverride: c, renderStepDetail: l, defaultOpen: u = !1, className: d }) => {
797
+ var He = v(({ parts: e, isLoading: t, messageId: n, activity: r, getToolLabel: i, getToolIcon: a, getActivityOverride: c, renderStepDetail: l, defaultOpen: u = !1, className: d }) => {
544
798
  let f = e.filter((e) => e.type === "reasoning").map((e) => String(e.text ?? "")).filter((e) => e.trim()).join("\n\n"), p = f.trim().length > 0, m = [], h = !1, g;
545
799
  for (let t of e) if (t.type.startsWith("tool-")) {
546
800
  h = !0;
547
801
  let e = String(t.state ?? "");
548
802
  e === "output-available" || e === "output-error" || e === "output-denied" || (g = t.type), m.push({
549
803
  kind: "tool",
550
- label: i?.(t.type) ?? Q(t.type),
804
+ label: i?.(t.type) ?? $(t.type),
551
805
  state: e,
552
806
  toolType: t.type,
553
807
  part: t
@@ -557,118 +811,128 @@ var ze = _(({ parts: e, isLoading: t, messageId: n, activity: r, getToolLabel: i
557
811
  text: String(t.text)
558
812
  });
559
813
  h && !t && m.push({ kind: "done" });
560
- let _ = e.some((e) => Number.isFinite(e.startedAtMs)) ? Le(e, r?.nowMs) : r?.elapsedSeconds ?? 0, v = r?.seed ?? Re(n), y = t ? _ : 0, b = t ? c?.(g) : void 0, S = {
814
+ let _ = e.some((e) => Number.isFinite(e.startedAtMs)) ? Be(e, r?.nowMs) : r?.elapsedSeconds ?? 0, v = r?.seed ?? Ve(n), ee = t ? _ : 0, y = t ? c?.(g) : void 0, x = {
561
815
  kind: p ? "reasoning" : "tools",
562
816
  active: t,
563
817
  seed: v,
564
- elapsedSeconds: y,
565
- verb: b
566
- }, C = Ie(S), { elapsedSeconds: w } = Z(S), T = p || m.length > 0, te = T && t && w === 0, [D, O] = x(u), k = ee();
567
- return /* @__PURE__ */ o("div", {
568
- className: E("not-prose flex flex-col", d),
569
- children: [/* @__PURE__ */ a("button", {
818
+ elapsedSeconds: ee,
819
+ verb: y
820
+ }, C = ze(x), { elapsedSeconds: w } = Q(x), T = p || m.length > 0, E = T && t && w === 0, [O, k] = S(u), A = b();
821
+ return /* @__PURE__ */ s(M, {
822
+ open: O,
823
+ onOpenChange: k,
824
+ className: D("not-prose flex flex-col", d),
825
+ children: [/* @__PURE__ */ o("button", {
570
826
  type: "button",
571
827
  "data-testid": "message-reasoning",
572
- onClick: () => O((e) => !e),
573
- "aria-expanded": D,
574
- "aria-controls": T ? k : void 0,
828
+ onClick: () => k((e) => !e),
829
+ "aria-expanded": O,
830
+ "aria-controls": T ? A : void 0,
575
831
  className: "flex items-center gap-1 self-start text-[13px] leading-5 text-muted-foreground transition-colors hover:text-foreground",
576
- children: /* @__PURE__ */ o("span", {
577
- className: E(t && "ocui-shimmer"),
578
- children: [C, te ? "..." : ""]
832
+ children: /* @__PURE__ */ s("span", {
833
+ className: D(t && "ocui-shimmer"),
834
+ children: [C, E ? "..." : ""]
835
+ })
836
+ }), T && /* @__PURE__ */ o(P, {
837
+ id: A,
838
+ className: "overflow-hidden outline-hidden transition-opacity data-[state=closed]:opacity-0 data-[state=open]:animate-collapsible-down data-[state=closed]:animate-collapsible-up",
839
+ children: /* @__PURE__ */ s("div", {
840
+ className: "flex flex-col gap-2 pt-2",
841
+ children: [p && /* @__PURE__ */ o(j, {
842
+ className: "grid gap-1 text-sm text-muted-foreground/80 **:text-sm [&_code]:bg-transparent [&_code]:p-0 [&_code]:font-semibold [&_code]:text-foreground [&_li]:my-0 [&_ol]:my-1 [&_p]:my-0 [&_ul]:my-1",
843
+ children: f
844
+ }), m.length > 0 && /* @__PURE__ */ o("div", {
845
+ className: "flex flex-col",
846
+ children: m.map((e, t) => /* @__PURE__ */ o(Ue, {
847
+ node: e,
848
+ isFirst: t === 0,
849
+ isLast: t === m.length - 1,
850
+ getToolIcon: a,
851
+ renderStepDetail: l
852
+ }, `step-${t}`))
853
+ })]
579
854
  })
580
- }), D && T && /* @__PURE__ */ o("div", {
581
- id: k,
582
- className: "mt-2 flex flex-col gap-2",
583
- children: [p && /* @__PURE__ */ a(ne, {
584
- className: "grid gap-1 text-sm text-muted-foreground/80 **:text-sm [&_code]:bg-transparent [&_code]:p-0 [&_code]:font-semibold [&_code]:text-foreground [&_li]:my-0 [&_ol]:my-1 [&_p]:my-0 [&_ul]:my-1",
585
- children: f
586
- }), m.length > 0 && /* @__PURE__ */ a("div", {
587
- className: "flex flex-col",
588
- children: m.map((e, t) => /* @__PURE__ */ a(Be, {
589
- node: e,
590
- isFirst: t === 0,
591
- isLast: t === m.length - 1,
592
- getToolIcon: s,
593
- renderStepDetail: l
594
- }, `step-${t}`))
595
- })]
596
855
  })]
597
856
  });
598
857
  });
599
- ze.displayName = "MessageTrace";
600
- function Be({ node: e, isFirst: t, isLast: n, getToolIcon: r, renderStepDetail: i }) {
601
- let s = e.kind === "tool" && i ? i(e.part) : null, l = s != null, [u, d] = x(!1), f = ee();
602
- return /* @__PURE__ */ o("div", {
858
+ He.displayName = "MessageTrace";
859
+ function Ue({ node: e, isFirst: t, isLast: n, getToolIcon: r, renderStepDetail: i }) {
860
+ let a = e.kind === "tool" && i ? i(e.part) : null, c = a != null, [u, d] = S(!1), f = b();
861
+ return /* @__PURE__ */ s(M, {
862
+ open: u,
863
+ onOpenChange: d,
603
864
  className: "flex flex-col",
604
- children: [/* @__PURE__ */ o("div", {
865
+ children: [/* @__PURE__ */ s("div", {
605
866
  className: "flex items-stretch gap-2.5",
606
- children: [/* @__PURE__ */ o("div", {
867
+ children: [/* @__PURE__ */ s("div", {
607
868
  className: "flex w-4 flex-col items-center",
608
869
  children: [
609
- /* @__PURE__ */ a("div", { className: E("w-px flex-1", t ? "bg-transparent" : "bg-border") }),
610
- /* @__PURE__ */ a(Ve, {
870
+ /* @__PURE__ */ o("div", { className: D("w-px flex-1", t ? "bg-transparent" : "bg-border") }),
871
+ /* @__PURE__ */ o(We, {
611
872
  node: e,
612
873
  getToolIcon: r
613
874
  }),
614
- /* @__PURE__ */ a("div", { className: E("w-px flex-1", n ? "bg-transparent" : "bg-border") })
875
+ /* @__PURE__ */ o("div", { className: D("w-px flex-1", n ? "bg-transparent" : "bg-border") })
615
876
  ]
616
- }), /* @__PURE__ */ a("div", {
877
+ }), /* @__PURE__ */ o("div", {
617
878
  className: "min-w-0 py-1 text-sm leading-5",
618
- children: e.kind === "tool" ? l ? /* @__PURE__ */ o("button", {
879
+ children: e.kind === "tool" ? c ? /* @__PURE__ */ s("button", {
619
880
  type: "button",
620
881
  onClick: () => d((e) => !e),
621
882
  "aria-expanded": u,
622
883
  "aria-controls": f,
623
884
  className: "group inline-flex items-center gap-1 text-sm text-muted-foreground transition-colors hover:text-foreground",
624
- children: [/* @__PURE__ */ a("span", { children: e.label }), /* @__PURE__ */ a(c, { className: E("size-2.5 transition-[transform,opacity]", u ? "rotate-180 opacity-100" : "opacity-0 group-hover:opacity-100 group-focus-visible:opacity-100") })]
625
- }) : /* @__PURE__ */ a("span", {
885
+ children: [/* @__PURE__ */ o("span", { children: e.label }), /* @__PURE__ */ o(l, { className: D("size-2.5 transition-[transform,opacity]", u ? "rotate-180 opacity-100" : "opacity-0 group-hover:opacity-100 group-focus-visible:opacity-100") })]
886
+ }) : /* @__PURE__ */ o("span", {
626
887
  className: "text-muted-foreground",
627
888
  children: e.label
628
- }) : e.kind === "note" ? /* @__PURE__ */ a("span", {
889
+ }) : e.kind === "note" ? /* @__PURE__ */ o("span", {
629
890
  className: "text-muted-foreground/80",
630
891
  children: e.text
631
- }) : /* @__PURE__ */ a("span", {
892
+ }) : /* @__PURE__ */ o("span", {
632
893
  className: "text-muted-foreground",
633
894
  children: "Done"
634
895
  })
635
896
  })]
636
- }), l && u && /* @__PURE__ */ o("div", {
637
- className: "flex items-stretch gap-2.5",
638
- children: [/* @__PURE__ */ a("div", {
639
- className: "flex w-4 flex-col items-center",
640
- children: /* @__PURE__ */ a("div", { className: E("w-px flex-1", n ? "bg-transparent" : "bg-border") })
641
- }), /* @__PURE__ */ a("div", {
642
- id: f,
643
- className: "min-w-0 flex-1 pb-1",
644
- children: s
645
- })]
897
+ }), c && /* @__PURE__ */ o(P, {
898
+ id: f,
899
+ className: "overflow-hidden outline-hidden transition-opacity data-[state=closed]:opacity-0 data-[state=open]:animate-collapsible-down data-[state=closed]:animate-collapsible-up",
900
+ children: /* @__PURE__ */ s("div", {
901
+ className: "flex items-stretch gap-2.5",
902
+ children: [/* @__PURE__ */ o("div", {
903
+ className: "flex w-4 flex-col items-center",
904
+ children: /* @__PURE__ */ o("div", { className: D("w-px flex-1", n ? "bg-transparent" : "bg-border") })
905
+ }), /* @__PURE__ */ o("div", {
906
+ className: "min-w-0 flex-1 pb-1",
907
+ children: a
908
+ })]
909
+ })
646
910
  })]
647
911
  });
648
912
  }
649
- function Ve({ node: e, getToolIcon: t }) {
913
+ function We({ node: e, getToolIcon: t }) {
650
914
  let n = "flex items-center justify-center bg-background py-0.5";
651
- return e.kind === "note" ? /* @__PURE__ */ a("div", {
915
+ return e.kind === "note" ? /* @__PURE__ */ o("div", {
652
916
  className: n,
653
- children: /* @__PURE__ */ a("div", { className: "size-1 rounded-full bg-muted-foreground/60" })
654
- }) : e.kind === "tool" ? e.state === "output-error" || e.state === "output-denied" ? /* @__PURE__ */ a("div", {
917
+ children: /* @__PURE__ */ o("div", { className: "size-1 rounded-full bg-muted-foreground/60" })
918
+ }) : e.kind === "tool" ? e.state === "output-error" || e.state === "output-denied" ? /* @__PURE__ */ o("div", {
655
919
  className: n,
656
- children: /* @__PURE__ */ a(m, { className: "size-3.5 text-destructive" })
657
- }) : e.state === "output-available" ? /* @__PURE__ */ a("div", {
920
+ children: /* @__PURE__ */ o(h, { className: "size-3.5 text-destructive" })
921
+ }) : e.state === "output-available" ? /* @__PURE__ */ o("div", {
658
922
  className: n,
659
- children: /* @__PURE__ */ a(t?.(e.toolType) ?? s, { className: "size-3.5 text-muted-foreground" })
660
- }) : /* @__PURE__ */ a("div", {
923
+ children: /* @__PURE__ */ o(t?.(e.toolType) ?? c, { className: "size-3.5 text-muted-foreground" })
924
+ }) : /* @__PURE__ */ o("div", {
661
925
  className: n,
662
- children: /* @__PURE__ */ a(f, { className: "size-3.5 animate-spin text-muted-foreground motion-reduce:animate-none" })
663
- }) : /* @__PURE__ */ a("div", {
926
+ children: /* @__PURE__ */ o(p, { className: "size-3.5 animate-spin text-muted-foreground motion-reduce:animate-none" })
927
+ }) : /* @__PURE__ */ o("div", {
664
928
  className: n,
665
- children: /* @__PURE__ */ a(l, { className: "size-4 text-muted-foreground" })
929
+ children: /* @__PURE__ */ o(u, { className: "size-4 text-muted-foreground" })
666
930
  });
667
931
  }
668
932
  //#endregion
669
933
  //#region src/chat/use-activity-clock.ts
670
- function He(e, t) {
671
- let n = b(null), [r, i] = x(() => ({
934
+ function Ge(e, t) {
935
+ let n = x(null), [r, i] = S(() => ({
672
936
  seed: t,
673
937
  elapsedSeconds: 0,
674
938
  nowMs: Date.now()
@@ -709,87 +973,88 @@ function He(e, t) {
709
973
  }
710
974
  //#endregion
711
975
  //#region src/chat/sources.tsx
712
- function Ue(e) {
976
+ function Ke(e) {
713
977
  return `Searched ${e} source${e === 1 ? "" : "s"}`;
714
978
  }
715
- function We(e) {
979
+ function qe(e) {
716
980
  try {
717
981
  return new URL(e).hostname;
718
982
  } catch {
719
983
  return e;
720
984
  }
721
985
  }
722
- function Ge(e) {
723
- return `https://www.google.com/s2/favicons?domain=${We(e)}&sz=32`;
986
+ function Je(e) {
987
+ return `https://www.google.com/s2/favicons?domain=${qe(e)}&sz=32`;
724
988
  }
725
- function Ke({ url: e, getFaviconUrl: t }) {
726
- let n = t(e), [r, i] = x(!1);
727
- return !n || r ? /* @__PURE__ */ a(d, { className: "size-3.5 shrink-0 text-muted-foreground" }) : /* @__PURE__ */ a("img", {
989
+ function Ye({ url: e, getFaviconUrl: t }) {
990
+ let n = t(e), [r, i] = S(!1);
991
+ return !n || r ? /* @__PURE__ */ o(f, { className: "size-3.5 shrink-0 text-muted-foreground" }) : /* @__PURE__ */ o("img", {
728
992
  src: n,
729
993
  alt: "",
730
994
  className: "size-3.5 shrink-0 rounded-xs",
731
995
  onError: () => i(!0)
732
996
  });
733
997
  }
734
- var $ = ({ sources: e, getFaviconUrl: t = Ge, className: n }) => e.length === 0 ? null : /* @__PURE__ */ a("div", {
735
- className: E("flex flex-col gap-0.5", n),
998
+ var Xe = ({ sources: e, getFaviconUrl: t = Je, className: n }) => e.length === 0 ? null : /* @__PURE__ */ o("div", {
999
+ className: D("flex flex-col gap-0.5", n),
736
1000
  children: e.map((e, n) => {
737
- let r = We(e.url), i = e.title || r;
738
- return /* @__PURE__ */ o("a", {
1001
+ let r = qe(e.url), i = e.title || r;
1002
+ return /* @__PURE__ */ s("a", {
739
1003
  href: e.url,
740
1004
  target: "_blank",
741
1005
  rel: "noreferrer",
742
1006
  className: "flex min-w-0 items-center gap-1.5 rounded-md px-1.5 py-1 text-sm text-muted-foreground transition-colors hover:bg-muted hover:text-foreground",
743
1007
  children: [
744
- /* @__PURE__ */ a(Ke, {
1008
+ /* @__PURE__ */ o(Ye, {
745
1009
  getFaviconUrl: t,
746
1010
  url: e.url
747
1011
  }),
748
- /* @__PURE__ */ a("span", {
1012
+ /* @__PURE__ */ o("span", {
749
1013
  className: "truncate",
750
1014
  children: i
751
1015
  }),
752
- i !== r && /* @__PURE__ */ a("span", {
1016
+ i !== r && /* @__PURE__ */ o("span", {
753
1017
  className: "shrink-0 truncate text-xs text-muted-foreground/70",
754
1018
  children: r
755
1019
  })
756
1020
  ]
757
1021
  }, `${e.url}-${n}`);
758
1022
  })
759
- }), qe = ({ sources: e, getLabel: t = Ue, getFaviconUrl: n = Ge, className: r, ...i }) => e.length === 0 ? null : /* @__PURE__ */ o(k, {
760
- className: E("not-prose", r),
1023
+ }), Ze = ({ sources: e, getLabel: t = Ke, getFaviconUrl: n = Je, className: r, ...i }) => e.length === 0 ? null : /* @__PURE__ */ s(M, {
1024
+ className: D("not-prose", r),
761
1025
  ...i,
762
- children: [/* @__PURE__ */ o(A, {
1026
+ children: [/* @__PURE__ */ s(N, {
763
1027
  className: "group flex items-center gap-1 self-start text-[13px] leading-5 text-muted-foreground transition-colors hover:text-foreground",
764
- children: [/* @__PURE__ */ a("span", { children: t(e.length) }), /* @__PURE__ */ a(c, { className: "size-2.5 transition-transform group-data-[state=open]:rotate-180" })]
765
- }), /* @__PURE__ */ a(j, {
766
- className: "mt-1 data-[state=closed]:fade-out-0 data-[state=closed]:slide-out-to-top-2 data-[state=open]:slide-in-from-top-2 data-[state=closed]:animate-out data-[state=open]:animate-in",
767
- children: /* @__PURE__ */ a($, {
1028
+ children: [/* @__PURE__ */ o("span", { children: t(e.length) }), /* @__PURE__ */ o(l, { className: "size-2.5 transition-transform group-data-[state=open]:rotate-180" })]
1029
+ }), /* @__PURE__ */ o(P, {
1030
+ className: re,
1031
+ children: /* @__PURE__ */ o(Xe, {
768
1032
  sources: e,
769
- getFaviconUrl: n
1033
+ getFaviconUrl: n,
1034
+ className: "pt-1"
770
1035
  })
771
1036
  })]
772
- }), Je = "ocui-cite", Ye = ({ pressed: e, onPressedChange: t, label: n = "Search the web", tooltip: r, className: i, variant: s, size: c = "icon", onClick: l, ...u }) => {
773
- let f = s ?? (e ? "default" : "ghost"), p = /* @__PURE__ */ a(K, {
1037
+ }), Qe = "ocui-cite", $e = ({ pressed: e, onPressedChange: t, label: n = "Search the web", tooltip: r, className: i, variant: a, size: c = "icon", onClick: l, ...u }) => {
1038
+ let d = a ?? (e ? "default" : "ghost"), p = /* @__PURE__ */ o(Ce, {
774
1039
  ...u,
775
1040
  "aria-label": n,
776
1041
  "aria-pressed": e,
777
- className: E(i),
1042
+ className: D(i),
778
1043
  size: c,
779
1044
  type: "button",
780
- variant: f,
1045
+ variant: d,
781
1046
  onClick: (n) => {
782
1047
  l?.(n), t(!e);
783
1048
  },
784
- children: /* @__PURE__ */ a(d, {})
1049
+ children: /* @__PURE__ */ o(f, {})
785
1050
  });
786
- return r ? /* @__PURE__ */ a(q, {
1051
+ return r ? /* @__PURE__ */ o(Y, {
787
1052
  delayDuration: 300,
788
- children: /* @__PURE__ */ o(J, { children: [/* @__PURE__ */ a(Y, {
1053
+ children: /* @__PURE__ */ s(X, { children: [/* @__PURE__ */ o(Z, {
789
1054
  asChild: !0,
790
1055
  children: p
791
- }), /* @__PURE__ */ a(X, { children: /* @__PURE__ */ a("p", { children: r }) })] })
1056
+ }), /* @__PURE__ */ o(we, { children: /* @__PURE__ */ o("p", { children: r }) })] })
792
1057
  }) : p;
793
1058
  };
794
1059
  //#endregion
795
- export { Ce as Action, Se as Actions, O as MessageContent, ze as MessageTrace, N as Reasoning, I as ReasoningContent, P as ReasoningTrigger, ne as Response, $ as SourceList, qe as Sources, pe as Tool, ve as ToolContent, _e as ToolHeader, ye as ToolInput, be as ToolOutput, Ye as WebSearchToggle, Te as buildSegments, Je as citationClassName, Ne as deriveTurnView, Me as extractWebSearchSources, Ie as getAiActivityLabel, Z as getAiActivityLabelParts, Q as humanizeToolName, De as isWebSearchError, Re as labelSeedFromString, F as reasoningTextClassName, ke as stripCitationParens, Le as traceElapsedSeconds, Ee as traceIsLoading, He as useActivityClock };
1060
+ export { Ee as Action, Te as Actions, ne as MessageContent, He as MessageTrace, I as Reasoning, z as ReasoningContent, L as ReasoningTrigger, j as Response, Xe as SourceList, Ze as Sources, me as Tool, ye as ToolContent, ve as ToolHeader, be as ToolInput, xe as ToolOutput, $e as WebSearchToggle, Oe as buildSegments, Qe as citationClassName, Ie as deriveTurnView, Fe as extractWebSearchSources, ze as getAiActivityLabel, Q as getAiActivityLabelParts, $ as humanizeToolName, Ae as isWebSearchError, Ve as labelSeedFromString, R as reasoningTextClassName, Me as stripCitationParens, Be as traceElapsedSeconds, ke as traceIsLoading, Ge as useActivityClock };