@ahmetilhn/hanui 5.3.2 → 5.4.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/README.md +19 -3
- package/build/chat.cjs +3 -2
- package/build/chat.cjs.map +1 -1
- package/build/chat.css +1 -1
- package/build/chat.js +859 -446
- package/build/chat.js.map +1 -1
- package/build/index.cjs.map +1 -1
- package/build/index.js.map +1 -1
- package/build/types/chat/CodeBlock/format.d.ts +7 -0
- package/build/types/chat/CodeBlock/grammars.d.ts +44 -0
- package/build/types/chat/CodeBlock/highlight.d.ts +22 -0
- package/build/types/chat/CodeBlock/index.d.ts +11 -5
- package/build/types/theme/palette.d.ts +16 -0
- package/build/types/theme/tokens.d.ts +17 -0
- package/package.json +1 -1
package/build/chat.js
CHANGED
|
@@ -1,389 +1,802 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsxs as
|
|
3
|
-
import { memo as
|
|
4
|
-
import { ArrowDown as
|
|
5
|
-
import { useHanui as
|
|
6
|
-
const
|
|
7
|
-
let
|
|
8
|
-
for (const
|
|
9
|
-
|
|
10
|
-
return
|
|
11
|
-
},
|
|
12
|
-
for (const
|
|
13
|
-
return process.env.NODE_ENV !== "production" && !
|
|
2
|
+
import { jsxs as h, jsx as a, Fragment as Ye } from "react/jsx-runtime";
|
|
3
|
+
import { memo as g, useRef as L, useEffect as U, forwardRef as We, useState as ce, useMemo as he, Fragment as Xe, Children as Je, isValidElement as Qe, cloneElement as Ve } from "react";
|
|
4
|
+
import { ArrowDown as et, StopFill as tt, ArrowUp as nt, CheckLg as st, ClipboardFill as at } from "react-bootstrap-icons";
|
|
5
|
+
import { useHanui as C, useAnnounce as Pe, useStickToBottom as Ke, IconButton as te, Textarea as it, hasOpenSurface as rt, Disclosure as Be, Spinner as ot, ScrollArea as ct, StatusDot as lt } from "@ahmetilhn/hanui";
|
|
6
|
+
const m = (...e) => {
|
|
7
|
+
let n = "";
|
|
8
|
+
for (const t of e)
|
|
9
|
+
t && (n = n === "" ? t : `${n} ${t}`);
|
|
10
|
+
return n;
|
|
11
|
+
}, k = (e, n) => Object.assign(e, { displayName: n }), pe = /* @__PURE__ */ new Set(), x = (e, ...n) => {
|
|
12
|
+
for (const t of n) if (t !== void 0) return t;
|
|
13
|
+
return process.env.NODE_ENV !== "production" && !pe.has(e) && (pe.add(e), console.error(
|
|
14
14
|
`[hanui] Eksik metin: ${e}. Prop olarak geçin ya da <HanuiProvider labels={…}> içinde bir kez tanımlayın. Metinsiz bırakılan öğe ekran okuyucuda adsız kalır.`
|
|
15
15
|
)), "";
|
|
16
|
-
},
|
|
17
|
-
thread:
|
|
18
|
-
thread__scroll:
|
|
19
|
-
thread__column:
|
|
20
|
-
thread__dock:
|
|
21
|
-
thread__latest:
|
|
22
|
-
},
|
|
23
|
-
var
|
|
24
|
-
const { labels: s } =
|
|
25
|
-
return
|
|
26
|
-
var
|
|
27
|
-
|
|
28
|
-
}, [
|
|
29
|
-
/* @__PURE__ */
|
|
16
|
+
}, Fe = (e, n, ...t) => n ? n(...t) : x(e), dt = "hanui-thread-R1LCJ", _t = "hanui-thread__scroll-37EaI", ut = "hanui-thread__column-57FQh", mt = "hanui-thread__dock-y0Tt9", ht = "hanui-thread__latest-ZNmqY", D = {
|
|
17
|
+
thread: dt,
|
|
18
|
+
thread__scroll: _t,
|
|
19
|
+
thread__column: ut,
|
|
20
|
+
thread__dock: mt,
|
|
21
|
+
thread__latest: ht
|
|
22
|
+
}, pt = ({ children: e, dock: n, isStreaming: t, label: i, className: r, testId: o }) => {
|
|
23
|
+
var f, b, y;
|
|
24
|
+
const { labels: s } = C(), l = Pe(), c = L(null), { isAtEnd: _, scrollToEnd: d } = Ke(c), u = L(t);
|
|
25
|
+
return U(() => {
|
|
26
|
+
var v;
|
|
27
|
+
u.current && !t && l(x("ChatThread.replyReady", (v = s == null ? void 0 : s.chat) == null ? void 0 : v.replyReady)), u.current = t;
|
|
28
|
+
}, [l, t, (f = s == null ? void 0 : s.chat) == null ? void 0 : f.replyReady]), /* @__PURE__ */ h("div", { className: m(D.thread, r), "data-testid": o, children: [
|
|
29
|
+
/* @__PURE__ */ a(
|
|
30
30
|
"div",
|
|
31
31
|
{
|
|
32
32
|
ref: c,
|
|
33
|
-
className:
|
|
33
|
+
className: D.thread__scroll,
|
|
34
34
|
role: "region",
|
|
35
|
-
"aria-label": x("ChatThread.label", i, (
|
|
35
|
+
"aria-label": x("ChatThread.label", i, (b = s == null ? void 0 : s.chat) == null ? void 0 : b.thread),
|
|
36
36
|
tabIndex: 0,
|
|
37
|
-
children: /* @__PURE__ */
|
|
37
|
+
children: /* @__PURE__ */ a("div", { className: D.thread__column, children: e })
|
|
38
38
|
}
|
|
39
39
|
),
|
|
40
|
-
/* @__PURE__ */
|
|
41
|
-
!_ && /* @__PURE__ */
|
|
42
|
-
|
|
40
|
+
/* @__PURE__ */ h("div", { className: D.thread__dock, children: [
|
|
41
|
+
!_ && /* @__PURE__ */ a(
|
|
42
|
+
te,
|
|
43
43
|
{
|
|
44
|
-
className:
|
|
45
|
-
icon: /* @__PURE__ */
|
|
46
|
-
label: x("ChatThread.scrollToLatest", (
|
|
44
|
+
className: D.thread__latest,
|
|
45
|
+
icon: /* @__PURE__ */ a(et, { "aria-hidden": !0 }),
|
|
46
|
+
label: x("ChatThread.scrollToLatest", (y = s == null ? void 0 : s.chat) == null ? void 0 : y.scrollToLatest),
|
|
47
47
|
variant: "outline",
|
|
48
48
|
shape: "round",
|
|
49
49
|
size: "sm",
|
|
50
|
-
onClick:
|
|
50
|
+
onClick: d
|
|
51
51
|
}
|
|
52
52
|
),
|
|
53
|
-
|
|
53
|
+
n !== void 0 && /* @__PURE__ */ a("div", { className: D.thread__column, children: n })
|
|
54
54
|
] })
|
|
55
55
|
] });
|
|
56
|
-
},
|
|
57
|
-
/* @__PURE__ */
|
|
58
|
-
),
|
|
59
|
-
message:
|
|
56
|
+
}, Xs = /* @__PURE__ */ g(
|
|
57
|
+
/* @__PURE__ */ k(pt, "ChatThread")
|
|
58
|
+
), bt = "hanui-message-z5uVx", ft = "hanui-message__avatar-QzWck", yt = "hanui-message__main-1rh-A", gt = "hanui-message__body-Ngiqq", kt = "hanui-message__actions-dQ0Fn", M = {
|
|
59
|
+
message: bt,
|
|
60
60
|
"message--user": "hanui-message--user-Mq6gb",
|
|
61
|
-
message__avatar:
|
|
62
|
-
message__main:
|
|
61
|
+
message__avatar: ft,
|
|
62
|
+
message__main: yt,
|
|
63
63
|
"message--assistant": "hanui-message--assistant-ndkmH",
|
|
64
|
-
message__body:
|
|
65
|
-
message__actions:
|
|
66
|
-
},
|
|
64
|
+
message__body: gt,
|
|
65
|
+
message__actions: kt
|
|
66
|
+
}, wt = ({
|
|
67
67
|
author: e,
|
|
68
|
-
children:
|
|
69
|
-
avatar:
|
|
68
|
+
children: n,
|
|
69
|
+
avatar: t,
|
|
70
70
|
actions: i,
|
|
71
|
-
isStreaming:
|
|
72
|
-
className:
|
|
71
|
+
isStreaming: r,
|
|
72
|
+
className: o,
|
|
73
73
|
testId: s
|
|
74
|
-
}) => /* @__PURE__ */
|
|
74
|
+
}) => /* @__PURE__ */ h(
|
|
75
75
|
"article",
|
|
76
76
|
{
|
|
77
|
-
className:
|
|
78
|
-
"aria-busy":
|
|
77
|
+
className: m(M.message, M[`message--${e}`], o),
|
|
78
|
+
"aria-busy": r || void 0,
|
|
79
79
|
"data-testid": s,
|
|
80
80
|
children: [
|
|
81
|
-
e === "assistant" &&
|
|
82
|
-
/* @__PURE__ */
|
|
83
|
-
/* @__PURE__ */
|
|
84
|
-
i !== void 0 && /* @__PURE__ */
|
|
81
|
+
e === "assistant" && t !== void 0 && /* @__PURE__ */ a("div", { className: M.message__avatar, children: t }),
|
|
82
|
+
/* @__PURE__ */ h("div", { className: M.message__main, children: [
|
|
83
|
+
/* @__PURE__ */ a("div", { className: M.message__body, children: n }),
|
|
84
|
+
i !== void 0 && /* @__PURE__ */ a("div", { className: M.message__actions, children: i })
|
|
85
85
|
] })
|
|
86
86
|
]
|
|
87
87
|
}
|
|
88
|
-
),
|
|
89
|
-
/* @__PURE__ */
|
|
90
|
-
),
|
|
91
|
-
prompt:
|
|
92
|
-
prompt__box:
|
|
88
|
+
), Js = /* @__PURE__ */ g(
|
|
89
|
+
/* @__PURE__ */ k(wt, "ChatMessage")
|
|
90
|
+
), vt = "hanui-prompt-qHV1e", Nt = "hanui-prompt__box-sUQDu", St = "hanui-prompt__field-EmvTZ", xt = "hanui-prompt__start-2tqre", At = "hanui-prompt__end-Zp7fi", Tt = "hanui-prompt__hint-4TpeC", R = {
|
|
91
|
+
prompt: vt,
|
|
92
|
+
prompt__box: Nt,
|
|
93
93
|
"prompt__box--disabled": "hanui-prompt__box--disabled-xu-Yk",
|
|
94
|
-
prompt__field:
|
|
95
|
-
prompt__start:
|
|
96
|
-
prompt__end:
|
|
97
|
-
prompt__hint:
|
|
98
|
-
},
|
|
94
|
+
prompt__field: St,
|
|
95
|
+
prompt__start: xt,
|
|
96
|
+
prompt__end: At,
|
|
97
|
+
prompt__hint: Tt
|
|
98
|
+
}, Ct = /* @__PURE__ */ We(
|
|
99
99
|
({
|
|
100
100
|
value: e,
|
|
101
|
-
onChange:
|
|
102
|
-
onSubmit:
|
|
101
|
+
onChange: n,
|
|
102
|
+
onSubmit: t,
|
|
103
103
|
onStop: i,
|
|
104
|
-
isBusy:
|
|
105
|
-
isDisabled:
|
|
104
|
+
isBusy: r,
|
|
105
|
+
isDisabled: o,
|
|
106
106
|
isSubmitDisabled: s,
|
|
107
|
-
placeholder:
|
|
107
|
+
placeholder: l,
|
|
108
108
|
label: c,
|
|
109
109
|
maxRows: _ = 8,
|
|
110
|
-
hint:
|
|
111
|
-
start:
|
|
112
|
-
end:
|
|
113
|
-
className:
|
|
114
|
-
testId:
|
|
115
|
-
},
|
|
116
|
-
var
|
|
117
|
-
const { labels:
|
|
118
|
-
|
|
119
|
-
if (!
|
|
120
|
-
const
|
|
121
|
-
|
|
110
|
+
hint: d,
|
|
111
|
+
start: u,
|
|
112
|
+
end: f,
|
|
113
|
+
className: b,
|
|
114
|
+
testId: y
|
|
115
|
+
}, v) => {
|
|
116
|
+
var _e, ue;
|
|
117
|
+
const { labels: w } = C(), K = e.trim() === "";
|
|
118
|
+
U(() => {
|
|
119
|
+
if (!r || !i) return;
|
|
120
|
+
const A = (me) => {
|
|
121
|
+
me.key !== "Escape" || me.defaultPrevented || rt() || i();
|
|
122
122
|
};
|
|
123
|
-
return document.addEventListener("keydown",
|
|
124
|
-
}, [
|
|
125
|
-
const
|
|
126
|
-
|
|
123
|
+
return document.addEventListener("keydown", A), () => document.removeEventListener("keydown", A);
|
|
124
|
+
}, [r, i]);
|
|
125
|
+
const qe = (A) => {
|
|
126
|
+
A.key !== "Enter" || A.shiftKey || A.nativeEvent.isComposing || (A.preventDefault(), !K && !r && !o && !s && t());
|
|
127
127
|
};
|
|
128
|
-
return /* @__PURE__ */
|
|
129
|
-
/* @__PURE__ */
|
|
130
|
-
|
|
131
|
-
/* @__PURE__ */
|
|
132
|
-
|
|
128
|
+
return /* @__PURE__ */ h("div", { className: m(R.prompt, b), "data-testid": y, children: [
|
|
129
|
+
/* @__PURE__ */ h("div", { className: m(R.prompt__box, o && R["prompt__box--disabled"]), children: [
|
|
130
|
+
u !== void 0 && /* @__PURE__ */ a("div", { className: R.prompt__start, children: u }),
|
|
131
|
+
/* @__PURE__ */ a(
|
|
132
|
+
it,
|
|
133
133
|
{
|
|
134
|
-
ref:
|
|
135
|
-
className:
|
|
134
|
+
ref: v,
|
|
135
|
+
className: R.prompt__field,
|
|
136
136
|
variant: "bare",
|
|
137
137
|
rows: 1,
|
|
138
138
|
isAutoSize: !0,
|
|
139
139
|
maxRows: _,
|
|
140
140
|
value: e,
|
|
141
|
-
placeholder:
|
|
142
|
-
"aria-label": c ??
|
|
143
|
-
disabled:
|
|
144
|
-
onChange: (
|
|
145
|
-
onKeyDown:
|
|
141
|
+
placeholder: l,
|
|
142
|
+
"aria-label": c ?? l,
|
|
143
|
+
disabled: o,
|
|
144
|
+
onChange: (A) => n(A.target.value),
|
|
145
|
+
onKeyDown: qe
|
|
146
146
|
}
|
|
147
147
|
),
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
148
|
+
f !== void 0 && /* @__PURE__ */ a("div", { className: R.prompt__end, children: f }),
|
|
149
|
+
r ? /* @__PURE__ */ a(
|
|
150
|
+
te,
|
|
151
151
|
{
|
|
152
|
-
icon: /* @__PURE__ */
|
|
153
|
-
label: x("PromptInput.stop", (
|
|
152
|
+
icon: /* @__PURE__ */ a(tt, { "aria-hidden": !0 }),
|
|
153
|
+
label: x("PromptInput.stop", (_e = w == null ? void 0 : w.chat) == null ? void 0 : _e.stop),
|
|
154
154
|
variant: "outline",
|
|
155
155
|
shape: "round",
|
|
156
156
|
onClick: i,
|
|
157
157
|
disabled: !i
|
|
158
158
|
}
|
|
159
|
-
) : /* @__PURE__ */
|
|
160
|
-
|
|
159
|
+
) : /* @__PURE__ */ a(
|
|
160
|
+
te,
|
|
161
161
|
{
|
|
162
|
-
icon: /* @__PURE__ */
|
|
163
|
-
label: x("PromptInput.send", (
|
|
162
|
+
icon: /* @__PURE__ */ a(nt, { "aria-hidden": !0 }),
|
|
163
|
+
label: x("PromptInput.send", (ue = w == null ? void 0 : w.chat) == null ? void 0 : ue.send),
|
|
164
164
|
variant: "solid",
|
|
165
165
|
shape: "round",
|
|
166
|
-
onClick:
|
|
167
|
-
disabled:
|
|
166
|
+
onClick: t,
|
|
167
|
+
disabled: K || o || s
|
|
168
168
|
}
|
|
169
169
|
)
|
|
170
170
|
] }),
|
|
171
|
-
|
|
171
|
+
d !== void 0 && /* @__PURE__ */ a("div", { className: R.prompt__hint, children: d })
|
|
172
172
|
] });
|
|
173
173
|
}
|
|
174
|
-
),
|
|
175
|
-
/* @__PURE__ */
|
|
176
|
-
),
|
|
177
|
-
grid:
|
|
178
|
-
card:
|
|
179
|
-
card__label:
|
|
180
|
-
card__description:
|
|
181
|
-
},
|
|
182
|
-
/* @__PURE__ */
|
|
183
|
-
|
|
184
|
-
] },
|
|
185
|
-
/* @__PURE__ */
|
|
186
|
-
),
|
|
187
|
-
prose:
|
|
188
|
-
},
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
174
|
+
), Qs = /* @__PURE__ */ g(
|
|
175
|
+
/* @__PURE__ */ k(Ct, "PromptInput")
|
|
176
|
+
), Et = "hanui-grid-4EfQ-", $t = "hanui-card-KTt0-", Rt = "hanui-card__label-LNLTF", Ot = "hanui-card__description-eIx-0", q = {
|
|
177
|
+
grid: Et,
|
|
178
|
+
card: $t,
|
|
179
|
+
card__label: Rt,
|
|
180
|
+
card__description: Ot
|
|
181
|
+
}, Lt = ({ label: e, items: n, onPick: t, className: i, testId: r }) => /* @__PURE__ */ a("div", { role: "group", "aria-label": e, className: m(q.grid, i), "data-testid": r, children: n.map((o) => /* @__PURE__ */ h("button", { type: "button", className: q.card, onClick: () => t(o), children: [
|
|
182
|
+
/* @__PURE__ */ a("span", { className: q.card__label, children: o.label }),
|
|
183
|
+
o.description && /* @__PURE__ */ a("span", { className: q.card__description, children: o.description })
|
|
184
|
+
] }, o.id)) }), Vs = /* @__PURE__ */ g(
|
|
185
|
+
/* @__PURE__ */ k(Lt, "PromptSuggestions")
|
|
186
|
+
), zt = "hanui-prose-kAp6f", It = {
|
|
187
|
+
prose: zt
|
|
188
|
+
}, Dt = ({ className: e, testId: n, ...t }) => /* @__PURE__ */ a("div", { className: m(It.prose, e), "data-testid": n, ...t }), ea = /* @__PURE__ */ g(/* @__PURE__ */ k(Dt, "Prose")), Mt = /^(?:[ \t]*\r?\n)+/, Pt = " ", Kt = (e) => (e == null ? void 0 : e.trim().toLowerCase()) === "json", Bt = (e, n) => {
|
|
189
|
+
let t = n + 1;
|
|
190
|
+
for (; t < e.length && e[t] !== '"'; ) t += e[t] === "\\" ? 2 : 1;
|
|
191
|
+
return t + 1;
|
|
192
|
+
}, Ft = (e, n) => {
|
|
193
|
+
let t = n;
|
|
194
|
+
for (; t < e.length && /\s/.test(e[t]); ) t++;
|
|
195
|
+
return t;
|
|
196
|
+
}, jt = (e) => {
|
|
197
|
+
try {
|
|
198
|
+
JSON.parse(e);
|
|
199
|
+
} catch {
|
|
200
|
+
return e;
|
|
201
|
+
}
|
|
202
|
+
let n = "", t = 0;
|
|
203
|
+
const i = () => `
|
|
204
|
+
${Pt.repeat(t)}`;
|
|
205
|
+
for (let r = 0; r < e.length; r++) {
|
|
206
|
+
const o = e[r];
|
|
207
|
+
if (o === '"') {
|
|
208
|
+
const s = Bt(e, r);
|
|
209
|
+
n += e.slice(r, s), r = s - 1;
|
|
210
|
+
} else if (o === "{" || o === "[") {
|
|
211
|
+
const s = Ft(e, r + 1);
|
|
212
|
+
e[s] === (o === "{" ? "}" : "]") ? (n += o + e[s], r = s) : (t++, n += o + i());
|
|
213
|
+
} else o === "}" || o === "]" ? (t--, n += i() + o) : o === "," ? n += `,${i()}` : o === ":" ? n += ": " : /\s/.test(o) || (n += o);
|
|
214
|
+
}
|
|
215
|
+
return n;
|
|
216
|
+
}, Zt = (e, n) => {
|
|
217
|
+
const t = e.replace(Mt, "").trimEnd();
|
|
218
|
+
return Kt(n) ? jt(t) : t;
|
|
219
|
+
}, p = (e) => new Set(e.split(" ")), $ = /"(?:[^"\\\n]|\\.)*"?/, H = /'(?:[^'\\\n]|\\.)*'?/, je = /`(?:[^`\\]|\\[\s\S])*`?/, le = /"""[\s\S]*?(?:"""|(?![\s\S]))/, Ut = /'''[\s\S]*?(?:'''|(?![\s\S]))/, Ht = /'(?:\\[^\n]{1,8}?|[^'\\\n])'/, ne = /\/\/.*/, G = /\/\*[\s\S]*?(?:\*\/|(?![\s\S]))/, z = /#.*/, P = /\b(?:0[xX][\dA-Fa-f_]+|0[bB][01_]+|0[oO][0-7_]+|\d[\d_]*(?:\.\d[\d_]*)?(?:[eE][+-]?\d+)?)[A-Za-z]*\b/, I = /[A-Za-z_]\w*/, se = /[{}[\]();,.:]/, de = /@[A-Za-z_][\w.]*/, Gt = /[\w$)\]]/, be = /\S/, fe = "break case catch class const continue debugger default delete do else export extends finally for function if import in instanceof let new return super switch this throw try typeof var void while with yield async await of static get set as from", qt = "type interface enum implements namespace declare abstract private protected public readonly keyof infer is satisfies override module asserts unique", Yt = "true false null undefined NaN Infinity", Wt = "string number boolean any unknown never object symbol bigint", Xt = "int long short char float double bool boolean byte void unsigned signed string str usize isize u8 u16 u32 u64 u128 i8 i16 i32 i64 i128 f32 f64 rune uint uint8 uint16 uint32 uint64 int8 int16 int32 int64 float32 float64 error any decimal size_t", Jt = "true false null nil nullptr NULL", Ze = "auto break case const continue default do else enum extern for goto if inline register restrict return sizeof static struct switch typedef union volatile while", Qt = `${Ze} alignas alignof catch class constexpr consteval const_cast decltype delete dynamic_cast explicit export friend mutable namespace new noexcept operator private protected public reinterpret_cast static_assert static_cast template this thread_local throw try typeid typename using virtual override final concept requires co_await co_return co_yield`, Vt = "abstract as async await base break case catch checked class const continue default delegate do dynamic else enum event explicit extern finally fixed for foreach get goto if implicit in init interface internal is lock namespace new operator out override params partial private protected public readonly record ref return sealed set sizeof stackalloc static struct switch this throw try typeof unchecked unsafe using var virtual volatile when where while yield", en = "abstract assert break case catch class const continue default do else enum extends final finally for goto if implements import instanceof interface native new package permits private protected public record return sealed static strictfp super switch synchronized this throw throws transient try var volatile while yield", tn = "abstract annotation as break by catch class companion const constructor continue crossinline data do else enum external final finally for fun get if import in infix init inline inner interface internal is lateinit noinline object open operator out override package private protected public reified return sealed set super suspend this throw try typealias val var vararg when where while", nn = "actor as associatedtype async await break case catch class continue default defer deinit do else enum extension fallthrough fileprivate final for func guard if import in init inout internal is lazy let mutating open operator override private protocol public repeat rethrows return self Self some static struct subscript super switch throw throws try typealias var weak where while", sn = "break case chan const continue default defer else fallthrough for func go goto if import interface map package range return select struct switch type var", an = "as async await break const continue crate dyn else enum extern fn for if impl in let loop match mod move mut pub ref return self Self static struct super trait type unsafe use where while", rn = "abstract and array as break callable case catch class clone const continue declare default do echo else elseif empty extends final finally fn for foreach function global goto if implements include include_once instanceof insteadof interface isset list match namespace new or print private protected public readonly require require_once return static switch throw trait try unset use var while xor yield", on = "if then else elif fi for while until do done case esac in function return local export select time break continue declare readonly unset shift source alias exit", cn = "FROM AS RUN CMD LABEL EXPOSE ENV ADD COPY ENTRYPOINT VOLUME USER WORKDIR ARG ONBUILD STOPSIGNAL HEALTHCHECK SHELL MAINTAINER", ae = (e, n) => ({
|
|
220
|
+
rules: [
|
|
221
|
+
["comment", ne],
|
|
222
|
+
["comment", G],
|
|
223
|
+
["string", $],
|
|
224
|
+
["string", H],
|
|
225
|
+
["string", je],
|
|
226
|
+
/*
|
|
227
|
+
* Düzenli ifade. Tamamı (kapanış `/` ve bayraklar) önce gelir; alternatifler AYRIK olduğu
|
|
228
|
+
* için geri dönüş doğrusaldır.
|
|
229
|
+
* ⚠ Karakter sınıfının kapanışı bu kuralda ZORUNLU. `\]?` dıştaki tekrar ve sondaki `/` ile
|
|
230
|
+
* birkaç bin `[`de üstel geri dönüş yapıp sayfayı kilitliyordu.
|
|
231
|
+
* Kapanmamış ifade alttaki kural: sonda aranan bir `/` yok, bu yüzden başarısız olup geri
|
|
232
|
+
* dönmez; gövde satır sonuna kadar boyanır.
|
|
233
|
+
*/
|
|
234
|
+
["regex", /\/(?![*/])(?:\\.|\[(?:\\.|[^\]\\\n])*\]|[^/\\\n[])+\/[dgimsuvy]*/],
|
|
235
|
+
["regex", /\/(?![*/])(?:\\.|\[(?:\\.|[^\]\\\n])*\]?|[^/\\\n[])*/],
|
|
236
|
+
/*
|
|
237
|
+
* Bileşen etiketi yalnızca JSX'te; TS'te `<` bir tür parametresi ya da karşılaştırma. Açılış
|
|
238
|
+
* etiketi addan sonra gelemez (`useState<string>`); kapanış gelebilir (`Kaydet</Button>`).
|
|
239
|
+
*/
|
|
240
|
+
...n ? [
|
|
241
|
+
["tag", /<\/[A-Za-z][\w.:-]*/],
|
|
242
|
+
["tag", /<[A-Za-z][\w.:-]*/, Gt]
|
|
243
|
+
] : [],
|
|
244
|
+
["name", de],
|
|
245
|
+
["number", P],
|
|
246
|
+
["word", /[A-Za-z_$][\w$]*/],
|
|
247
|
+
["punctuation", se]
|
|
248
|
+
],
|
|
249
|
+
keywords: p(e ? `${fe} ${qt}` : fe),
|
|
250
|
+
literals: p(Yt),
|
|
251
|
+
types: e ? p(Wt) : void 0,
|
|
252
|
+
hasCapitalTypes: !0
|
|
253
|
+
}), T = (e, n = []) => ({
|
|
254
|
+
rules: [
|
|
255
|
+
...n,
|
|
256
|
+
["comment", ne],
|
|
257
|
+
["comment", G],
|
|
258
|
+
/* Önişlemci (`#include`) ve Rust özniteliği (`#[derive(Debug)]`). */
|
|
259
|
+
["keyword", /^[ \t]*#[ \t]*[a-z]+|#!?\[[^\]\n]*\]/],
|
|
260
|
+
["string", le],
|
|
261
|
+
["string", $],
|
|
262
|
+
["string", Ht],
|
|
263
|
+
/* Go'nun ham dizesi. */
|
|
264
|
+
["string", je],
|
|
265
|
+
["name", de],
|
|
266
|
+
["number", P],
|
|
267
|
+
["word", I],
|
|
268
|
+
["punctuation", se]
|
|
269
|
+
],
|
|
270
|
+
keywords: p(e),
|
|
271
|
+
literals: p(Jt),
|
|
272
|
+
types: p(Xt),
|
|
273
|
+
hasCapitalTypes: !0
|
|
274
|
+
}), ye = () => ({
|
|
275
|
+
rules: [
|
|
276
|
+
["comment", z],
|
|
277
|
+
[
|
|
278
|
+
"string",
|
|
279
|
+
/(?:\b[rRbBuUfF]{1,2})?(?:"""[\s\S]*?(?:"""|(?![\s\S]))|'''[\s\S]*?(?:'''|(?![\s\S])))/
|
|
280
|
+
],
|
|
281
|
+
["string", /(?:\b[rRbBuUfF]{1,2})?(?:"(?:[^"\\\n]|\\.)*"?|'(?:[^'\\\n]|\\.)*'?)/],
|
|
282
|
+
["name", de],
|
|
283
|
+
["number", P],
|
|
284
|
+
["word", I],
|
|
285
|
+
["punctuation", se]
|
|
286
|
+
],
|
|
287
|
+
keywords: p(
|
|
288
|
+
"and as assert async await break class continue def del elif else except finally for from global if import in is lambda nonlocal not or pass raise return try while with yield match case"
|
|
289
|
+
),
|
|
290
|
+
literals: p("True False None"),
|
|
291
|
+
types: p("int float str bool list dict set tuple bytes object"),
|
|
292
|
+
hasCapitalTypes: !0
|
|
293
|
+
}), ge = () => ({
|
|
294
|
+
rules: [
|
|
295
|
+
["comment", z],
|
|
296
|
+
["string", $],
|
|
297
|
+
["string", H],
|
|
298
|
+
/* Sembol (`:ad`) sabittir; `Foo::Bar` içindeki `:Bar` değil. */
|
|
299
|
+
["number", /:[A-Za-z_]\w*[?!]?/, /[\w:]/],
|
|
300
|
+
["name", /@{1,2}[A-Za-z_]\w*/],
|
|
301
|
+
["number", P],
|
|
302
|
+
["word", /[A-Za-z_]\w*[?!]?/],
|
|
303
|
+
["punctuation", se]
|
|
304
|
+
],
|
|
305
|
+
keywords: p(
|
|
306
|
+
"alias and begin break case class def defined? do else elsif end ensure for if in module next not or redo rescue retry return self super then undef unless until when while yield require require_relative attr_accessor attr_reader attr_writer private protected public raise"
|
|
307
|
+
),
|
|
308
|
+
literals: p("true false nil"),
|
|
309
|
+
hasCapitalTypes: !0
|
|
310
|
+
}), Ue = (e) => ({
|
|
311
|
+
rules: [
|
|
312
|
+
/* `#` yorum açar yalnızca kelime başında: `$#`, `a#b` yorum değil. */
|
|
313
|
+
["comment", z, /[^\s;|&(]/],
|
|
314
|
+
/* Kabukta çift tırnak satır aşar, tek tırnak kaçış tanımaz. */
|
|
315
|
+
["string", /"(?:[^"\\]|\\[\s\S])*"?/],
|
|
316
|
+
["string", /'[^']*'?/],
|
|
317
|
+
["name", /\$(?:\{[^}\n]*\}?|[A-Za-z_]\w*|[@#?$!*\d-])/],
|
|
318
|
+
["number", /\b\d+\b/],
|
|
319
|
+
["word", /[A-Za-z_][\w-]*/],
|
|
320
|
+
["punctuation", /[{}[\]();|&]/]
|
|
321
|
+
],
|
|
322
|
+
keywords: p(e)
|
|
323
|
+
}), ke = () => ({
|
|
324
|
+
rules: [
|
|
325
|
+
["comment", ne],
|
|
326
|
+
["comment", G],
|
|
327
|
+
/* Anahtar: ardından `:` gelen dize. */
|
|
328
|
+
["name", /"(?:[^"\\\n]|\\.)*"(?=\s*:)/],
|
|
329
|
+
["string", $],
|
|
330
|
+
["number", /-?\b\d+(?:\.\d+)?(?:[eE][+-]?\d+)?\b/],
|
|
331
|
+
["word", I],
|
|
332
|
+
["punctuation", /[{}[\],:]/]
|
|
333
|
+
],
|
|
334
|
+
literals: p("true false null")
|
|
335
|
+
}), we = () => ({
|
|
336
|
+
rules: [
|
|
337
|
+
["comment", z, be],
|
|
338
|
+
/* Anahtar; ilk karakteri `-` olamaz (`- ad:` bir liste öğesi). */
|
|
339
|
+
[
|
|
340
|
+
"name",
|
|
341
|
+
/(?:"(?:[^"\\\n]|\\.)*"|'[^'\n]*'|[\w$./][\w$./-]*(?:[ \t]+[\w$./-]+)*)(?=[ \t]*:(?:[ \t]|$))/
|
|
342
|
+
],
|
|
343
|
+
["string", $],
|
|
344
|
+
["string", H],
|
|
345
|
+
/* Çapa (`&ad`), takma ad (`*ad`), etiket (`!!str`). */
|
|
346
|
+
["type", /[&*][\w-]+|!!?[\w-]+/, be],
|
|
347
|
+
["punctuation", /^[ \t]*-(?=[ \t]|$)|[{}[\],]|[|>][-+]?(?=[ \t]*$)/],
|
|
348
|
+
["number", /[-+]?\b\d[\d_]*(?:\.\d+)?(?:[eE][+-]?\d+)?\b/],
|
|
349
|
+
["word", I]
|
|
350
|
+
],
|
|
351
|
+
literals: p("true false null True False Null TRUE FALSE NULL")
|
|
352
|
+
}), ln = () => ({
|
|
353
|
+
rules: [
|
|
354
|
+
["comment", z],
|
|
355
|
+
["type", /^[ \t]*\[\[?[^\]\n]*\]\]?/],
|
|
356
|
+
["name", /(?:"[^"\n]*"|[\w.-]+)(?=[ \t]*=)/],
|
|
357
|
+
["string", le],
|
|
358
|
+
["string", Ut],
|
|
359
|
+
["string", $],
|
|
360
|
+
["string", /'[^'\n]*'?/],
|
|
361
|
+
[
|
|
362
|
+
"number",
|
|
363
|
+
/\b\d{4}-\d{2}-\d{2}(?:[T ]\d{2}:\d{2}:\d{2}(?:\.\d+)?(?:Z|[+-]\d{2}:\d{2})?)?\b|[-+]?\b\d[\d_]*(?:\.\d+)?(?:[eE][+-]?\d+)?\b/
|
|
364
|
+
],
|
|
365
|
+
["word", I],
|
|
366
|
+
["punctuation", /[{}[\],=]/]
|
|
367
|
+
],
|
|
368
|
+
literals: p("true false inf nan")
|
|
369
|
+
}), ie = () => ({
|
|
370
|
+
rules: [
|
|
371
|
+
["comment", G],
|
|
372
|
+
/* SCSS/Less satır yorumu; `url(http://…)` içindeki `//` değil. */
|
|
373
|
+
["comment", ne, /:/],
|
|
374
|
+
["string", $],
|
|
375
|
+
["string", H],
|
|
376
|
+
["keyword", /@[\w-]+|!important\b/],
|
|
377
|
+
/*
|
|
378
|
+
* Özellik adı: ardındaki `:` bir bildirimi açıyorsa (`;` ya da `}` `{`dan önce geliyorsa).
|
|
379
|
+
* `a:hover {` bir seçici — ardından önce `{` geliyor.
|
|
380
|
+
*/
|
|
381
|
+
["name", /-{0,2}[A-Za-z][\w-]*(?=\s*:[^;{}]*[;}])/],
|
|
382
|
+
["name", /\$[\w-]+/],
|
|
383
|
+
["number", /#[\dA-Fa-f]{3,8}\b|-?(?:\b\d+(?:\.\d+)?|\.\d+)(?:%|[A-Za-z]+\b)?/],
|
|
384
|
+
["word", /-?[A-Za-z_][\w-]*/],
|
|
385
|
+
["punctuation", /[{}();:,]/]
|
|
386
|
+
]
|
|
387
|
+
}), Y = () => ({
|
|
388
|
+
rules: [
|
|
389
|
+
["comment", /<!--[\s\S]*?(?:-->|(?![\s\S]))/],
|
|
390
|
+
["keyword", /<![A-Za-z][^>]*>?|<\?[\s\S]*?(?:\?>|(?![\s\S]))/],
|
|
391
|
+
["markup", /<\/?[A-Za-z][\w:.-]*(?:"[^"]*"?|'[^']*'?|[^'">])*>?/],
|
|
392
|
+
/* Karakter başvurusu (`&`). */
|
|
393
|
+
["number", /&#?\w+;/]
|
|
394
|
+
]
|
|
395
|
+
}), ve = () => ({
|
|
396
|
+
rules: [
|
|
397
|
+
[
|
|
398
|
+
"string",
|
|
399
|
+
/^[ \t]*```[\s\S]*?(?:^[ \t]*```|(?![\s\S]))|^[ \t]*~~~[\s\S]*?(?:^[ \t]*~~~|(?![\s\S]))/
|
|
400
|
+
],
|
|
401
|
+
["keyword", /^#{1,6}[ \t].*/],
|
|
402
|
+
["punctuation", /^[ \t]*(?:[-*+]|\d+[.)])(?=[ \t])|^[ \t]*>/],
|
|
403
|
+
["string", /`[^`\n]+`/],
|
|
404
|
+
["name", /!?\[[^\]\n]*\]\([^)\n]*\)/]
|
|
405
|
+
]
|
|
406
|
+
}), dn = () => ({
|
|
407
|
+
rules: [
|
|
408
|
+
["comment", /--.*/],
|
|
409
|
+
["comment", G],
|
|
410
|
+
["string", /'(?:[^']|'')*'?/],
|
|
411
|
+
["name", /"[^"\n]*"?|`[^`\n]*`?/],
|
|
412
|
+
["number", P],
|
|
413
|
+
["word", I],
|
|
414
|
+
["punctuation", /[(),;.]/]
|
|
415
|
+
],
|
|
416
|
+
keywords: p(
|
|
417
|
+
"select from where and or not insert into values update set delete create table alter drop index view join inner left right full outer cross on as group by order having limit offset union all distinct case when then else end is in exists between like ilike primary key foreign references default unique constraint returning with asc desc begin commit rollback transaction if replace check cascade grant revoke add column database schema trigger procedure function declare"
|
|
418
|
+
),
|
|
419
|
+
literals: p("null true false"),
|
|
420
|
+
types: p(
|
|
421
|
+
"int integer bigint smallint serial bigserial text varchar char boolean bool date time timestamp timestamptz interval numeric decimal real float double json jsonb uuid bytea"
|
|
422
|
+
),
|
|
423
|
+
isCaseInsensitive: !0
|
|
424
|
+
}), Ne = () => ({
|
|
425
|
+
rules: [
|
|
426
|
+
["keyword", /^(?:diff|index|\+\+\+|---)(?: .*|$)/],
|
|
427
|
+
["name", /^@@.*/],
|
|
428
|
+
["inserted", /^\+.*/],
|
|
429
|
+
["deleted", /^-.*/]
|
|
430
|
+
]
|
|
431
|
+
}), Se = () => ({
|
|
432
|
+
rules: [
|
|
433
|
+
["comment", z],
|
|
434
|
+
["string", le],
|
|
435
|
+
["string", $],
|
|
436
|
+
["name", /\$\w+/],
|
|
437
|
+
["name", /@\w+/],
|
|
438
|
+
["number", P],
|
|
439
|
+
["word", I],
|
|
440
|
+
["punctuation", /[{}[\]():,!=|]/]
|
|
441
|
+
],
|
|
442
|
+
keywords: p(
|
|
443
|
+
"query mutation subscription fragment on type input enum interface union scalar schema extend directive implements"
|
|
444
|
+
),
|
|
445
|
+
literals: p("true false null"),
|
|
446
|
+
/* `ID` tamamı büyük harf ama sabit değil, yerleşik tip. */
|
|
447
|
+
types: p("ID"),
|
|
448
|
+
hasCapitalTypes: !0
|
|
449
|
+
}), _n = () => ({
|
|
450
|
+
rules: [
|
|
451
|
+
["tag", /<\/?[A-Za-z][\w:.-]*/],
|
|
452
|
+
["string", /"[^"]*"?|'[^']*'?/],
|
|
453
|
+
["name", /[^\s"'<>/=]+/],
|
|
454
|
+
["punctuation", /\/?>|=/]
|
|
455
|
+
]
|
|
456
|
+
}), W = () => ae(!1, !1), un = () => ae(!1, !0), X = () => ae(!0, !1), mn = () => ae(!0, !0), B = () => Ue(on), xe = () => Ue(cn), Ae = () => T(Ze), re = () => T(Qt), Te = () => T(Vt), Ce = () => T(tn), Ee = () => T(sn), $e = () => T(an), hn = () => T(rn, [
|
|
457
|
+
["comment", z],
|
|
458
|
+
["name", /\$[A-Za-z_]\w*/],
|
|
459
|
+
["string", H]
|
|
460
|
+
]), Re = {
|
|
461
|
+
javascript: W,
|
|
462
|
+
js: W,
|
|
463
|
+
mjs: W,
|
|
464
|
+
cjs: W,
|
|
465
|
+
jsx: un,
|
|
466
|
+
typescript: X,
|
|
467
|
+
ts: X,
|
|
468
|
+
mts: X,
|
|
469
|
+
cts: X,
|
|
470
|
+
tsx: mn,
|
|
471
|
+
json: ke,
|
|
472
|
+
jsonc: ke,
|
|
473
|
+
bash: B,
|
|
474
|
+
sh: B,
|
|
475
|
+
shell: B,
|
|
476
|
+
zsh: B,
|
|
477
|
+
console: B,
|
|
478
|
+
dockerfile: xe,
|
|
479
|
+
docker: xe,
|
|
480
|
+
python: ye,
|
|
481
|
+
py: ye,
|
|
482
|
+
ruby: ge,
|
|
483
|
+
rb: ge,
|
|
484
|
+
yaml: we,
|
|
485
|
+
yml: we,
|
|
486
|
+
toml: ln,
|
|
487
|
+
css: ie,
|
|
488
|
+
scss: ie,
|
|
489
|
+
less: ie,
|
|
490
|
+
html: Y,
|
|
491
|
+
xml: Y,
|
|
492
|
+
svg: Y,
|
|
493
|
+
vue: Y,
|
|
494
|
+
markdown: ve,
|
|
495
|
+
md: ve,
|
|
496
|
+
sql: dn,
|
|
497
|
+
diff: Ne,
|
|
498
|
+
patch: Ne,
|
|
499
|
+
graphql: Se,
|
|
500
|
+
gql: Se,
|
|
501
|
+
c: Ae,
|
|
502
|
+
h: Ae,
|
|
503
|
+
cpp: re,
|
|
504
|
+
"c++": re,
|
|
505
|
+
hpp: re,
|
|
506
|
+
csharp: Te,
|
|
507
|
+
cs: Te,
|
|
508
|
+
java: () => T(en),
|
|
509
|
+
kotlin: Ce,
|
|
510
|
+
kt: Ce,
|
|
511
|
+
swift: () => T(nn),
|
|
512
|
+
go: Ee,
|
|
513
|
+
golang: Ee,
|
|
514
|
+
rust: $e,
|
|
515
|
+
rs: $e,
|
|
516
|
+
php: hn
|
|
517
|
+
}, pn = 2e4, Oe = /!?[ \t]*\(/y, bn = /^[A-Z][A-Z\d_]+$/, fn = /[(,=:[!&|?{};~+\-*%<>^]/, yn = /* @__PURE__ */ new Set([
|
|
518
|
+
"return",
|
|
519
|
+
"typeof",
|
|
520
|
+
"case",
|
|
521
|
+
"do",
|
|
522
|
+
"else",
|
|
523
|
+
"in",
|
|
524
|
+
"of",
|
|
525
|
+
"new",
|
|
526
|
+
"delete",
|
|
527
|
+
"void",
|
|
528
|
+
"throw",
|
|
529
|
+
"yield",
|
|
530
|
+
"await"
|
|
531
|
+
]), Le = /* @__PURE__ */ new Map(), He = (e) => {
|
|
532
|
+
const n = Le.get(e);
|
|
533
|
+
if (n) return n;
|
|
534
|
+
const t = e(), r = { pattern: new RegExp(t.rules.map(([, o]) => `(${o.source})`).join("|"), "gm"), grammar: t };
|
|
535
|
+
return Le.set(e, r), r;
|
|
536
|
+
}, gn = (e) => {
|
|
537
|
+
const n = e == null ? void 0 : e.trim().toLowerCase();
|
|
538
|
+
return n && Object.hasOwn(Re, n) ? Re[n] : void 0;
|
|
539
|
+
}, kn = (e, n) => {
|
|
540
|
+
let t = n - 1;
|
|
541
|
+
for (; t >= 0 && /\s/.test(e[t]); ) t--;
|
|
542
|
+
if (t < 0 || fn.test(e[t])) return !0;
|
|
543
|
+
const i = t + 1;
|
|
544
|
+
for (; t >= 0 && /[\w$]/.test(e[t]); ) t--;
|
|
545
|
+
return yn.has(e.slice(t + 1, i));
|
|
546
|
+
}, wn = (e, n, t, i, r) => {
|
|
547
|
+
var l, c, _;
|
|
548
|
+
Oe.lastIndex = r;
|
|
549
|
+
const o = Oe.test(t);
|
|
550
|
+
if (t[i - 1] === ".") return o ? "name" : void 0;
|
|
551
|
+
const s = e.isCaseInsensitive ? n.toLowerCase() : n;
|
|
552
|
+
if ((l = e.keywords) != null && l.has(s)) return "keyword";
|
|
553
|
+
if ((c = e.literals) != null && c.has(s)) return "number";
|
|
554
|
+
if ((_ = e.types) != null && _.has(s)) return "type";
|
|
555
|
+
if (o) return "name";
|
|
556
|
+
if (e.hasCapitalTypes && /^[A-Z]/.test(n))
|
|
557
|
+
return bn.test(n) ? "number" : "type";
|
|
558
|
+
}, Ge = ({ pattern: e, grammar: n }, t) => {
|
|
559
|
+
const i = [], r = (s, l) => {
|
|
560
|
+
if (!s) return;
|
|
561
|
+
const c = i.at(-1);
|
|
562
|
+
c && c.type === l ? c.text += s : i.push({ text: s, type: l });
|
|
563
|
+
};
|
|
564
|
+
let o = 0;
|
|
565
|
+
e.lastIndex = 0;
|
|
566
|
+
for (let s = e.exec(t); s; s = e.exec(t)) {
|
|
567
|
+
const [l] = s, { index: c } = s, _ = c + l.length;
|
|
568
|
+
if (_ === c) {
|
|
569
|
+
e.lastIndex = c + 1;
|
|
570
|
+
continue;
|
|
571
|
+
}
|
|
572
|
+
const [d, , u] = n.rules[s.indexOf(l, 1) - 1];
|
|
573
|
+
if (u !== void 0 && c > 0 && u.test(t[c - 1]) || d === "regex" && !kn(t, c)) {
|
|
574
|
+
e.lastIndex = c + 1;
|
|
575
|
+
continue;
|
|
576
|
+
}
|
|
577
|
+
if (r(t.slice(o, c)), o = _, d === "word") r(l, wn(n, l, t, c, _));
|
|
578
|
+
else if (d === "regex") r(l, "string");
|
|
579
|
+
else if (d === "tag") {
|
|
580
|
+
const b = l[1] === "/" ? 2 : 1, y = l.slice(b);
|
|
581
|
+
r(l.slice(0, b), "punctuation"), r(y, /^[A-Z]/.test(y) || y.includes(".") ? "type" : "keyword");
|
|
582
|
+
} else if (d === "markup")
|
|
583
|
+
for (const b of Ge(He(_n), l)) r(b.text, b.type);
|
|
584
|
+
else r(l, d);
|
|
585
|
+
}
|
|
586
|
+
return r(t.slice(o)), i;
|
|
587
|
+
}, vn = (e, n) => {
|
|
588
|
+
const t = gn(n);
|
|
589
|
+
return t && e.length <= pn ? Ge(He(t), e) : [{ text: e }];
|
|
590
|
+
}, Nn = "hanui-block-M1yL9", Sn = "hanui-block__header-F2iBP", xn = "hanui-block__language-lmdS9", An = "hanui-block__body-wDCJ2", Tn = "hanui-block__pre--EERi", Cn = "hanui-block__highlighted-JK1Yj", O = {
|
|
591
|
+
block: Nn,
|
|
592
|
+
block__header: Sn,
|
|
593
|
+
block__language: xn,
|
|
594
|
+
block__body: An,
|
|
595
|
+
block__pre: Tn,
|
|
596
|
+
block__highlighted: Cn,
|
|
597
|
+
"block__token--comment": "hanui-block__token--comment-eFTyh",
|
|
598
|
+
"block__token--keyword": "hanui-block__token--keyword-qQpj9",
|
|
599
|
+
"block__token--string": "hanui-block__token--string-4onwX",
|
|
600
|
+
"block__token--number": "hanui-block__token--number-DThtL",
|
|
601
|
+
"block__token--name": "hanui-block__token--name-283C9",
|
|
602
|
+
"block__token--type": "hanui-block__token--type-cNUbM",
|
|
603
|
+
"block__token--punctuation": "hanui-block__token--punctuation-Te2u8",
|
|
604
|
+
"block__token--inserted": "hanui-block__token--inserted-sUKnQ",
|
|
605
|
+
"block__token--deleted": "hanui-block__token--deleted-s74a-"
|
|
606
|
+
}, En = 1600, $n = ({ code: e, language: n, html: t, maxHeight: i, className: r, testId: o }) => {
|
|
607
|
+
var v;
|
|
608
|
+
const { labels: s } = C(), l = Pe(), [c, _] = ce(!1), d = L(void 0), u = he(() => t ? e : Zt(e, n), [e, t, n]), f = he(() => t ? [] : vn(u, n), [u, t, n]);
|
|
609
|
+
U(() => () => window.clearTimeout(d.current), []);
|
|
610
|
+
const b = async () => {
|
|
611
|
+
var w;
|
|
201
612
|
try {
|
|
202
|
-
await navigator.clipboard.writeText(
|
|
613
|
+
await navigator.clipboard.writeText(u);
|
|
203
614
|
} catch {
|
|
204
615
|
return;
|
|
205
616
|
}
|
|
206
|
-
_(!0),
|
|
207
|
-
},
|
|
208
|
-
return /* @__PURE__ */
|
|
209
|
-
/* @__PURE__ */
|
|
210
|
-
/* @__PURE__ */
|
|
211
|
-
/* @__PURE__ */
|
|
212
|
-
|
|
617
|
+
_(!0), l(x("CodeBlock.copied", (w = s == null ? void 0 : s.chat) == null ? void 0 : w.codeCopied)), window.clearTimeout(d.current), d.current = window.setTimeout(() => _(!1), En);
|
|
618
|
+
}, y = n ?? "";
|
|
619
|
+
return /* @__PURE__ */ h("figure", { className: m(O.block, r), "data-testid": o, children: [
|
|
620
|
+
/* @__PURE__ */ h("figcaption", { className: O.block__header, children: [
|
|
621
|
+
/* @__PURE__ */ a("span", { className: O.block__language, children: y }),
|
|
622
|
+
/* @__PURE__ */ a(
|
|
623
|
+
te,
|
|
213
624
|
{
|
|
214
|
-
icon: c ? /* @__PURE__ */
|
|
215
|
-
label:
|
|
625
|
+
icon: c ? /* @__PURE__ */ a(st, { "aria-hidden": !0 }) : /* @__PURE__ */ a(at, { "aria-hidden": !0 }),
|
|
626
|
+
label: Fe("CodeBlock.copy", (v = s == null ? void 0 : s.chat) == null ? void 0 : v.codeCopy, y),
|
|
216
627
|
size: "sm",
|
|
217
|
-
onClick:
|
|
628
|
+
onClick: b
|
|
218
629
|
}
|
|
219
630
|
)
|
|
220
631
|
] }),
|
|
221
|
-
/* @__PURE__ */
|
|
632
|
+
/* @__PURE__ */ a(
|
|
222
633
|
"div",
|
|
223
634
|
{
|
|
224
|
-
className:
|
|
635
|
+
className: O.block__body,
|
|
225
636
|
style: i === void 0 ? void 0 : { maxBlockSize: i },
|
|
226
637
|
tabIndex: 0,
|
|
227
|
-
role:
|
|
228
|
-
"aria-label":
|
|
229
|
-
children:
|
|
638
|
+
role: y ? "region" : void 0,
|
|
639
|
+
"aria-label": y || void 0,
|
|
640
|
+
children: t ? /* @__PURE__ */ a("div", { className: O.block__highlighted, dangerouslySetInnerHTML: { __html: t } }) : /* @__PURE__ */ a("pre", { className: O.block__pre, children: /* @__PURE__ */ a("code", { children: f.map(
|
|
641
|
+
(w, K) => w.type ? /* @__PURE__ */ a("span", { className: O[`block__token--${w.type}`], children: w.text }, K) : /* @__PURE__ */ a(Xe, { children: w.text }, K)
|
|
642
|
+
) }) })
|
|
230
643
|
}
|
|
231
644
|
)
|
|
232
645
|
] });
|
|
233
|
-
},
|
|
234
|
-
block:
|
|
235
|
-
block__summary:
|
|
236
|
-
block__indicator:
|
|
237
|
-
block__body:
|
|
238
|
-
},
|
|
646
|
+
}, ta = /* @__PURE__ */ g(/* @__PURE__ */ k($n, "CodeBlock")), Rn = "hanui-block-zqPjp", On = "hanui-block__summary-Kkp-X", Ln = "hanui-block__indicator-GuJMa", zn = "hanui-block__body-mDvrV", J = {
|
|
647
|
+
block: Rn,
|
|
648
|
+
block__summary: On,
|
|
649
|
+
block__indicator: Ln,
|
|
650
|
+
block__body: zn
|
|
651
|
+
}, In = ({
|
|
239
652
|
summary: e,
|
|
240
|
-
isRunning:
|
|
241
|
-
indicator:
|
|
653
|
+
isRunning: n = !1,
|
|
654
|
+
indicator: t,
|
|
242
655
|
isDefaultOpen: i = !1,
|
|
243
|
-
children:
|
|
244
|
-
className:
|
|
656
|
+
children: r,
|
|
657
|
+
className: o,
|
|
245
658
|
testId: s
|
|
246
659
|
}) => {
|
|
247
|
-
const [
|
|
248
|
-
return
|
|
249
|
-
_.current || c(
|
|
250
|
-
}, [
|
|
251
|
-
|
|
660
|
+
const [l, c] = ce(n || i), _ = L(!1);
|
|
661
|
+
return U(() => {
|
|
662
|
+
_.current || c(n || i);
|
|
663
|
+
}, [n, i]), /* @__PURE__ */ a(
|
|
664
|
+
Be,
|
|
252
665
|
{
|
|
253
666
|
variant: "plain",
|
|
254
|
-
className:
|
|
255
|
-
summary: /* @__PURE__ */
|
|
256
|
-
|
|
667
|
+
className: m(J.block, o),
|
|
668
|
+
summary: /* @__PURE__ */ h("span", { className: J.block__summary, children: [
|
|
669
|
+
n && /* @__PURE__ */ a("span", { className: J.block__indicator, children: t ?? /* @__PURE__ */ a(ot, { size: "sm" }) }),
|
|
257
670
|
e
|
|
258
671
|
] }),
|
|
259
|
-
isOpen:
|
|
260
|
-
onOpenChange: (
|
|
261
|
-
_.current = !0, c(
|
|
672
|
+
isOpen: l,
|
|
673
|
+
onOpenChange: (d) => {
|
|
674
|
+
_.current = !0, c(d);
|
|
262
675
|
},
|
|
263
676
|
testId: s,
|
|
264
|
-
children: /* @__PURE__ */
|
|
677
|
+
children: /* @__PURE__ */ a("div", { className: J.block__body, children: r })
|
|
265
678
|
}
|
|
266
679
|
);
|
|
267
|
-
},
|
|
268
|
-
/* @__PURE__ */
|
|
269
|
-
),
|
|
270
|
-
text:
|
|
271
|
-
text__body:
|
|
272
|
-
},
|
|
273
|
-
|
|
680
|
+
}, na = /* @__PURE__ */ g(
|
|
681
|
+
/* @__PURE__ */ k(In, "ReasoningBlock")
|
|
682
|
+
), Dn = "hanui-text-WKVxU", Mn = "hanui-text__body--uP0k", ze = {
|
|
683
|
+
text: Dn,
|
|
684
|
+
text__body: Mn
|
|
685
|
+
}, Pn = ({ text: e, label: n, maxHeight: t = 180, className: i, testId: r }) => /* @__PURE__ */ a(
|
|
686
|
+
ct,
|
|
274
687
|
{
|
|
275
|
-
className:
|
|
276
|
-
label:
|
|
277
|
-
maxHeight:
|
|
688
|
+
className: m(ze.text, i),
|
|
689
|
+
label: n,
|
|
690
|
+
maxHeight: t,
|
|
278
691
|
hasFade: !0,
|
|
279
692
|
isFollowingEnd: !0,
|
|
280
|
-
testId:
|
|
281
|
-
children: /* @__PURE__ */
|
|
693
|
+
testId: r,
|
|
694
|
+
children: /* @__PURE__ */ a("p", { className: ze.text__body, children: e })
|
|
282
695
|
}
|
|
283
|
-
),
|
|
284
|
-
/* @__PURE__ */
|
|
285
|
-
),
|
|
286
|
-
call:
|
|
696
|
+
), sa = /* @__PURE__ */ g(
|
|
697
|
+
/* @__PURE__ */ k(Pn, "ReasoningText")
|
|
698
|
+
), Kn = "hanui-call-tV2P8", Bn = "hanui-call__header-8Tw7m", Fn = "hanui-call__icon-TLzwf", jn = "hanui-call__name-EHz6G", Zn = "hanui-call__summary-M4sLU", Un = "hanui-call__meta-bvpp7", Hn = "hanui-call__body-nFK-C", Gn = "hanui-section-TjSGF", qn = "hanui-section__label-UrgqM", Yn = "hanui-section__body-Dy1PX", N = {
|
|
699
|
+
call: Kn,
|
|
287
700
|
"call--static": "hanui-call--static-Nldru",
|
|
288
|
-
call__header:
|
|
289
|
-
call__icon:
|
|
701
|
+
call__header: Bn,
|
|
702
|
+
call__icon: Fn,
|
|
290
703
|
"call__icon--running": "hanui-call__icon--running-Mx1XK",
|
|
291
|
-
call__name:
|
|
292
|
-
call__summary:
|
|
293
|
-
call__meta:
|
|
294
|
-
call__body:
|
|
295
|
-
section:
|
|
296
|
-
section__label:
|
|
297
|
-
section__body:
|
|
298
|
-
},
|
|
704
|
+
call__name: jn,
|
|
705
|
+
call__summary: Zn,
|
|
706
|
+
call__meta: Un,
|
|
707
|
+
call__body: Hn,
|
|
708
|
+
section: Gn,
|
|
709
|
+
section__label: qn,
|
|
710
|
+
section__body: Yn
|
|
711
|
+
}, Wn = {
|
|
299
712
|
running: "neutral",
|
|
300
713
|
ok: "success",
|
|
301
714
|
error: "danger",
|
|
302
715
|
aborted: "warning",
|
|
303
716
|
interrupted: "danger"
|
|
304
|
-
},
|
|
717
|
+
}, Xn = ({
|
|
305
718
|
icon: e,
|
|
306
|
-
name:
|
|
307
|
-
summary:
|
|
719
|
+
name: n,
|
|
720
|
+
summary: t,
|
|
308
721
|
status: i,
|
|
309
|
-
meta:
|
|
310
|
-
isDefaultOpen:
|
|
722
|
+
meta: r,
|
|
723
|
+
isDefaultOpen: o,
|
|
311
724
|
isOpen: s,
|
|
312
|
-
onOpenChange:
|
|
725
|
+
onOpenChange: l,
|
|
313
726
|
children: c,
|
|
314
727
|
className: _,
|
|
315
|
-
testId:
|
|
728
|
+
testId: d
|
|
316
729
|
}) => {
|
|
317
|
-
var
|
|
318
|
-
const { labels:
|
|
319
|
-
e !== void 0 && /* @__PURE__ */
|
|
730
|
+
var y, v;
|
|
731
|
+
const { labels: u } = C(), f = x(`ToolCall.status.${i}`, (v = (y = u == null ? void 0 : u.chat) == null ? void 0 : y.toolStatus) == null ? void 0 : v[i]), b = /* @__PURE__ */ h("span", { className: N.call__header, children: [
|
|
732
|
+
e !== void 0 && /* @__PURE__ */ a(
|
|
320
733
|
"span",
|
|
321
734
|
{
|
|
322
|
-
className:
|
|
735
|
+
className: m(N.call__icon, i === "running" && N["call__icon--running"]),
|
|
323
736
|
"aria-hidden": !0,
|
|
324
737
|
children: e
|
|
325
738
|
}
|
|
326
739
|
),
|
|
327
|
-
/* @__PURE__ */
|
|
328
|
-
|
|
329
|
-
/* @__PURE__ */
|
|
740
|
+
/* @__PURE__ */ a("span", { className: N.call__name, children: n }),
|
|
741
|
+
t !== void 0 && /* @__PURE__ */ a("span", { className: N.call__summary, children: t }),
|
|
742
|
+
/* @__PURE__ */ a(lt, { tone: Wn[i], label: f, isPulsing: i === "running" })
|
|
330
743
|
] });
|
|
331
|
-
return c === void 0 ? /* @__PURE__ */
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
] }) : /* @__PURE__ */
|
|
335
|
-
|
|
744
|
+
return c === void 0 ? /* @__PURE__ */ h("div", { className: m(N.call, N["call--static"], _), "data-testid": d, children: [
|
|
745
|
+
b,
|
|
746
|
+
r !== void 0 && /* @__PURE__ */ a("span", { className: N.call__meta, children: r })
|
|
747
|
+
] }) : /* @__PURE__ */ a(
|
|
748
|
+
Be,
|
|
336
749
|
{
|
|
337
|
-
className:
|
|
338
|
-
summary:
|
|
339
|
-
meta:
|
|
340
|
-
isDefaultOpen:
|
|
750
|
+
className: m(N.call, _),
|
|
751
|
+
summary: b,
|
|
752
|
+
meta: r,
|
|
753
|
+
isDefaultOpen: o,
|
|
341
754
|
isOpen: s,
|
|
342
|
-
onOpenChange:
|
|
343
|
-
testId:
|
|
344
|
-
children: /* @__PURE__ */
|
|
755
|
+
onOpenChange: l,
|
|
756
|
+
testId: d,
|
|
757
|
+
children: /* @__PURE__ */ a("div", { className: N.call__body, children: c })
|
|
345
758
|
}
|
|
346
759
|
);
|
|
347
|
-
},
|
|
760
|
+
}, aa = ({ label: e, children: n, className: t }) => (
|
|
348
761
|
/*
|
|
349
762
|
* Başlık bir HEADING değil: sohbet akışında başlık düzeyi tüketicinin sayfasına bağlı ve sabit bir
|
|
350
763
|
* `h4` hiyerarşiyi bozuyordu. Bölüm de bir landmark değil (her araç kartında bir "bölge" gürültü).
|
|
351
764
|
*/
|
|
352
|
-
/* @__PURE__ */
|
|
353
|
-
/* @__PURE__ */
|
|
354
|
-
/* @__PURE__ */
|
|
765
|
+
/* @__PURE__ */ h("div", { className: m(N.section, t), children: [
|
|
766
|
+
/* @__PURE__ */ a("span", { className: N.section__label, children: e }),
|
|
767
|
+
/* @__PURE__ */ a("div", { className: N.section__body, children: n })
|
|
355
768
|
] })
|
|
356
|
-
),
|
|
357
|
-
terminal:
|
|
358
|
-
terminal__command:
|
|
359
|
-
terminal__prompt:
|
|
360
|
-
terminal__stderr:
|
|
361
|
-
terminal__srOnly:
|
|
362
|
-
},
|
|
769
|
+
), ia = /* @__PURE__ */ g(/* @__PURE__ */ k(Xn, "ToolCall")), Jn = "hanui-terminal-D4Bz8", Qn = "hanui-terminal__command-A7PG2", Vn = "hanui-terminal__prompt-9N1g2", es = "hanui-terminal__stderr-qCNFe", ts = "hanui-terminal__srOnly-2pmQA", F = {
|
|
770
|
+
terminal: Jn,
|
|
771
|
+
terminal__command: Qn,
|
|
772
|
+
terminal__prompt: Vn,
|
|
773
|
+
terminal__stderr: es,
|
|
774
|
+
terminal__srOnly: ts
|
|
775
|
+
}, ns = ({
|
|
363
776
|
command: e,
|
|
364
|
-
chunks:
|
|
365
|
-
label:
|
|
777
|
+
chunks: n,
|
|
778
|
+
label: t,
|
|
366
779
|
maxHeight: i = 300,
|
|
367
|
-
className:
|
|
368
|
-
testId:
|
|
780
|
+
className: r,
|
|
781
|
+
testId: o
|
|
369
782
|
}) => {
|
|
370
783
|
var _;
|
|
371
|
-
const { labels: s } =
|
|
372
|
-
|
|
784
|
+
const { labels: s } = C(), l = L(null);
|
|
785
|
+
Ke(l);
|
|
373
786
|
const c = x("TerminalOutput.stderr", (_ = s == null ? void 0 : s.chat) == null ? void 0 : _.stderr);
|
|
374
|
-
return /* @__PURE__ */
|
|
787
|
+
return /* @__PURE__ */ h(
|
|
375
788
|
"pre",
|
|
376
789
|
{
|
|
377
|
-
ref:
|
|
378
|
-
className:
|
|
790
|
+
ref: l,
|
|
791
|
+
className: m(F.terminal, r),
|
|
379
792
|
style: { maxBlockSize: i },
|
|
380
793
|
tabIndex: 0,
|
|
381
794
|
role: "region",
|
|
382
|
-
"aria-label":
|
|
383
|
-
"data-testid":
|
|
795
|
+
"aria-label": t,
|
|
796
|
+
"data-testid": o,
|
|
384
797
|
children: [
|
|
385
|
-
e !== void 0 && /* @__PURE__ */
|
|
386
|
-
/* @__PURE__ */
|
|
798
|
+
e !== void 0 && /* @__PURE__ */ h("span", { className: F.terminal__command, children: [
|
|
799
|
+
/* @__PURE__ */ h("span", { className: F.terminal__prompt, "aria-hidden": !0, children: [
|
|
387
800
|
"$",
|
|
388
801
|
" "
|
|
389
802
|
] }),
|
|
@@ -391,172 +804,172 @@ const h = (...e) => {
|
|
|
391
804
|
`
|
|
392
805
|
`
|
|
393
806
|
] }),
|
|
394
|
-
|
|
395
|
-
(
|
|
396
|
-
/* @__PURE__ */
|
|
397
|
-
|
|
398
|
-
] },
|
|
807
|
+
n.map(
|
|
808
|
+
(d, u) => d.stream === "stderr" ? /* @__PURE__ */ h("span", { className: F.terminal__stderr, children: [
|
|
809
|
+
/* @__PURE__ */ a("span", { className: F.terminal__srOnly, children: `${c}: ` }),
|
|
810
|
+
d.text
|
|
811
|
+
] }, u) : /* @__PURE__ */ a("span", { children: d.text }, u)
|
|
399
812
|
)
|
|
400
813
|
]
|
|
401
814
|
}
|
|
402
815
|
);
|
|
403
|
-
},
|
|
404
|
-
/* @__PURE__ */
|
|
405
|
-
),
|
|
406
|
-
list:
|
|
407
|
-
list__item:
|
|
408
|
-
list__index:
|
|
409
|
-
list__text:
|
|
410
|
-
list__title:
|
|
411
|
-
list__plain:
|
|
412
|
-
list__domain:
|
|
413
|
-
},
|
|
414
|
-
var
|
|
415
|
-
const { labels:
|
|
416
|
-
return /* @__PURE__ */
|
|
816
|
+
}, ra = /* @__PURE__ */ g(
|
|
817
|
+
/* @__PURE__ */ k(ns, "TerminalOutput")
|
|
818
|
+
), ss = "hanui-list-GC4NK", as = "hanui-list__item-N8DAn", is = "hanui-list__index-VrSMs", rs = "hanui-list__text-4tll-", os = "hanui-list__title-seHfJ", cs = "hanui-list__plain-ZcCvx", ls = "hanui-list__domain-sJLI7", E = {
|
|
819
|
+
list: ss,
|
|
820
|
+
list__item: as,
|
|
821
|
+
list__index: is,
|
|
822
|
+
list__text: rs,
|
|
823
|
+
list__title: os,
|
|
824
|
+
list__plain: cs,
|
|
825
|
+
list__domain: ls
|
|
826
|
+
}, ds = ({ items: e, label: n, className: t, testId: i }) => {
|
|
827
|
+
var o;
|
|
828
|
+
const { labels: r } = C();
|
|
829
|
+
return /* @__PURE__ */ a(
|
|
417
830
|
"ol",
|
|
418
831
|
{
|
|
419
|
-
className:
|
|
420
|
-
"aria-label": x("SourceList.label",
|
|
832
|
+
className: m(E.list, t),
|
|
833
|
+
"aria-label": x("SourceList.label", n, (o = r == null ? void 0 : r.chat) == null ? void 0 : o.sources),
|
|
421
834
|
"data-testid": i,
|
|
422
|
-
children: e.map((s,
|
|
423
|
-
/* @__PURE__ */
|
|
424
|
-
/* @__PURE__ */
|
|
425
|
-
s.url ? /* @__PURE__ */
|
|
835
|
+
children: e.map((s, l) => /* @__PURE__ */ h("li", { className: E.list__item, children: [
|
|
836
|
+
/* @__PURE__ */ a("span", { className: E.list__index, "aria-hidden": !0, children: l + 1 }),
|
|
837
|
+
/* @__PURE__ */ h("span", { className: E.list__text, children: [
|
|
838
|
+
s.url ? /* @__PURE__ */ a(
|
|
426
839
|
"a",
|
|
427
840
|
{
|
|
428
|
-
className:
|
|
841
|
+
className: E.list__title,
|
|
429
842
|
href: s.url,
|
|
430
843
|
target: "_blank",
|
|
431
844
|
rel: "noopener noreferrer",
|
|
432
845
|
children: s.title
|
|
433
846
|
}
|
|
434
|
-
) : s.onSelect ? /* @__PURE__ */
|
|
435
|
-
s.domain && /* @__PURE__ */
|
|
847
|
+
) : s.onSelect ? /* @__PURE__ */ a("button", { type: "button", className: E.list__title, onClick: s.onSelect, children: s.title }) : /* @__PURE__ */ a("span", { className: E.list__plain, children: s.title }),
|
|
848
|
+
s.domain && /* @__PURE__ */ a("span", { className: E.list__domain, children: s.domain })
|
|
436
849
|
] })
|
|
437
850
|
] }, s.id))
|
|
438
851
|
}
|
|
439
852
|
);
|
|
440
|
-
},
|
|
441
|
-
/* @__PURE__ */
|
|
442
|
-
),
|
|
443
|
-
citation:
|
|
444
|
-
citation__srOnly:
|
|
853
|
+
}, oa = /* @__PURE__ */ g(
|
|
854
|
+
/* @__PURE__ */ k(ds, "SourceList")
|
|
855
|
+
), _s = "hanui-citation-XrGMb", us = "hanui-citation__srOnly-GnMQp", j = {
|
|
856
|
+
citation: _s,
|
|
857
|
+
citation__srOnly: us,
|
|
445
858
|
"citation--static": "hanui-citation--static-8gXHs"
|
|
446
|
-
},
|
|
859
|
+
}, ms = ({ index: e, href: n, onClick: t, className: i }) => {
|
|
447
860
|
var s;
|
|
448
|
-
const { labels:
|
|
449
|
-
return
|
|
861
|
+
const { labels: r } = C(), o = Fe("Citation.label", (s = r == null ? void 0 : r.chat) == null ? void 0 : s.citation, e);
|
|
862
|
+
return n ? /* @__PURE__ */ a("a", { className: m(j.citation, i), href: n, "aria-label": o, children: e }) : t ? /* @__PURE__ */ a(
|
|
450
863
|
"button",
|
|
451
864
|
{
|
|
452
865
|
type: "button",
|
|
453
|
-
className:
|
|
454
|
-
onClick:
|
|
455
|
-
"aria-label":
|
|
866
|
+
className: m(j.citation, i),
|
|
867
|
+
onClick: t,
|
|
868
|
+
"aria-label": o,
|
|
456
869
|
children: e
|
|
457
870
|
}
|
|
458
|
-
) : /* @__PURE__ */
|
|
459
|
-
/* @__PURE__ */
|
|
460
|
-
/* @__PURE__ */
|
|
871
|
+
) : /* @__PURE__ */ h("span", { className: m(j.citation, j["citation--static"], i), children: [
|
|
872
|
+
/* @__PURE__ */ a("span", { "aria-hidden": !0, children: e }),
|
|
873
|
+
/* @__PURE__ */ a("span", { className: j.citation__srOnly, children: o })
|
|
461
874
|
] });
|
|
462
|
-
},
|
|
463
|
-
actions:
|
|
464
|
-
actions__meta:
|
|
465
|
-
},
|
|
875
|
+
}, ca = /* @__PURE__ */ g(/* @__PURE__ */ k(ms, "Citation")), hs = "hanui-actions-c8XlJ", ps = "hanui-actions__meta-j-X3I", Ie = {
|
|
876
|
+
actions: hs,
|
|
877
|
+
actions__meta: ps
|
|
878
|
+
}, bs = "button:not(:disabled), a[href]", fs = ({ children: e, meta: n, label: t, className: i, testId: r }) => {
|
|
466
879
|
var c;
|
|
467
|
-
const { labels:
|
|
468
|
-
var
|
|
469
|
-
const
|
|
470
|
-
if (
|
|
471
|
-
const
|
|
472
|
-
|
|
880
|
+
const { labels: o } = C(), s = L(null), l = (_) => {
|
|
881
|
+
var w;
|
|
882
|
+
const d = [...((w = s.current) == null ? void 0 : w.querySelectorAll(bs)) ?? []], u = d.indexOf(document.activeElement);
|
|
883
|
+
if (u < 0 || d.length === 0) return;
|
|
884
|
+
const f = getComputedStyle(_.currentTarget).direction === "rtl", b = f ? "ArrowLeft" : "ArrowRight", y = f ? "ArrowRight" : "ArrowLeft", v = _.key === b ? d[(u + 1) % d.length] : _.key === y ? d[(u - 1 + d.length) % d.length] : _.key === "Home" ? d[0] : _.key === "End" ? d[d.length - 1] : null;
|
|
885
|
+
v && (_.preventDefault(), v.focus());
|
|
473
886
|
};
|
|
474
|
-
return /* @__PURE__ */
|
|
887
|
+
return /* @__PURE__ */ h(
|
|
475
888
|
"div",
|
|
476
889
|
{
|
|
477
890
|
ref: s,
|
|
478
891
|
role: "toolbar",
|
|
479
|
-
"aria-label": x("MessageActions.label",
|
|
480
|
-
className:
|
|
481
|
-
onKeyDown:
|
|
482
|
-
"data-testid":
|
|
892
|
+
"aria-label": x("MessageActions.label", t, (c = o == null ? void 0 : o.chat) == null ? void 0 : c.messageActions),
|
|
893
|
+
className: m(Ie.actions, i),
|
|
894
|
+
onKeyDown: l,
|
|
895
|
+
"data-testid": r,
|
|
483
896
|
children: [
|
|
484
897
|
e,
|
|
485
|
-
|
|
898
|
+
n !== void 0 && /* @__PURE__ */ a("span", { className: Ie.actions__meta, children: n })
|
|
486
899
|
]
|
|
487
900
|
}
|
|
488
901
|
);
|
|
489
|
-
},
|
|
490
|
-
/* @__PURE__ */
|
|
491
|
-
),
|
|
492
|
-
bar:
|
|
493
|
-
bar__brand:
|
|
494
|
-
bar__start:
|
|
495
|
-
bar__end:
|
|
496
|
-
},
|
|
497
|
-
const
|
|
498
|
-
return
|
|
499
|
-
const s =
|
|
902
|
+
}, la = /* @__PURE__ */ g(
|
|
903
|
+
/* @__PURE__ */ k(fs, "MessageActions")
|
|
904
|
+
), ys = "hanui-bar-UJGDL", gs = "hanui-bar__brand-ZUcIw", ks = "hanui-bar__start-nvmHH", ws = "hanui-bar__end-NNQve", Q = {
|
|
905
|
+
bar: ys,
|
|
906
|
+
bar__brand: gs,
|
|
907
|
+
bar__start: ks,
|
|
908
|
+
bar__end: ws
|
|
909
|
+
}, De = "--hanui-header-height", vs = ({ brand: e, start: n, end: t, className: i, testId: r }) => {
|
|
910
|
+
const o = L(null);
|
|
911
|
+
return U(() => {
|
|
912
|
+
const s = o.current;
|
|
500
913
|
if (!s || typeof ResizeObserver > "u") return;
|
|
501
|
-
const
|
|
914
|
+
const l = document.documentElement, c = new ResizeObserver(
|
|
502
915
|
([_]) => {
|
|
503
|
-
var
|
|
504
|
-
return
|
|
505
|
-
|
|
506
|
-
`${Math.round(((
|
|
916
|
+
var d, u;
|
|
917
|
+
return l.style.setProperty(
|
|
918
|
+
De,
|
|
919
|
+
`${Math.round(((u = (d = _.borderBoxSize) == null ? void 0 : d[0]) == null ? void 0 : u.blockSize) ?? s.offsetHeight)}px`
|
|
507
920
|
);
|
|
508
921
|
}
|
|
509
922
|
);
|
|
510
923
|
return c.observe(s), () => {
|
|
511
|
-
c.disconnect(),
|
|
924
|
+
c.disconnect(), l.style.removeProperty(De);
|
|
512
925
|
};
|
|
513
|
-
}, []), /* @__PURE__ */
|
|
514
|
-
/* @__PURE__ */
|
|
515
|
-
|
|
516
|
-
|
|
926
|
+
}, []), /* @__PURE__ */ h("header", { ref: o, className: m(Q.bar, i), "data-testid": r, children: [
|
|
927
|
+
/* @__PURE__ */ a("div", { className: Q.bar__brand, children: e }),
|
|
928
|
+
n !== void 0 && /* @__PURE__ */ a("div", { className: Q.bar__start, children: n }),
|
|
929
|
+
t !== void 0 && /* @__PURE__ */ a("div", { className: Q.bar__end, children: t })
|
|
517
930
|
] });
|
|
518
|
-
},
|
|
519
|
-
list:
|
|
931
|
+
}, da = /* @__PURE__ */ g(/* @__PURE__ */ k(vs, "AppBar")), Ns = "hanui-list-e54gu", Ss = "hanui-list__window-ESrZX", xs = "hanui-list__slot-DxSnX", As = "hanui-item-DKEGh", Ts = "hanui-item__start-Yb3xf", Cs = "hanui-item__body-kD4Qk", Es = "hanui-item__end-3SCT-", S = {
|
|
932
|
+
list: Ns,
|
|
520
933
|
"list--virtual": "hanui-list--virtual-zxqy5",
|
|
521
|
-
list__window:
|
|
522
|
-
list__slot:
|
|
523
|
-
item:
|
|
934
|
+
list__window: Ss,
|
|
935
|
+
list__slot: xs,
|
|
936
|
+
item: As,
|
|
524
937
|
"item--selected": "hanui-item--selected-AMl3I",
|
|
525
938
|
"item--muted": "hanui-item--muted-XBeA3",
|
|
526
|
-
item__start:
|
|
527
|
-
item__body:
|
|
528
|
-
item__end:
|
|
529
|
-
},
|
|
939
|
+
item__start: Ts,
|
|
940
|
+
item__body: Cs,
|
|
941
|
+
item__end: Es
|
|
942
|
+
}, Me = 6, $s = ({
|
|
530
943
|
label: e,
|
|
531
|
-
children:
|
|
532
|
-
rowHeight:
|
|
944
|
+
children: n,
|
|
945
|
+
rowHeight: t,
|
|
533
946
|
maxHeight: i = 320,
|
|
534
|
-
className:
|
|
535
|
-
testId:
|
|
947
|
+
className: r,
|
|
948
|
+
testId: o
|
|
536
949
|
}) => {
|
|
537
|
-
const s =
|
|
538
|
-
if (!
|
|
539
|
-
return /* @__PURE__ */
|
|
540
|
-
const _ = Math.max(0, Math.floor(
|
|
541
|
-
return /* @__PURE__ */
|
|
950
|
+
const s = Je.toArray(n).filter(Qe), [l, c] = ce(0);
|
|
951
|
+
if (!t)
|
|
952
|
+
return /* @__PURE__ */ a("ul", { className: m(S.list, r), "aria-label": e, "data-testid": o, children: s });
|
|
953
|
+
const _ = Math.max(0, Math.floor(l / t) - Me), d = Math.min(s.length, Math.ceil((l + i) / t) + Me);
|
|
954
|
+
return /* @__PURE__ */ a(
|
|
542
955
|
"div",
|
|
543
956
|
{
|
|
544
|
-
className:
|
|
545
|
-
style: { maxBlockSize: i, "--hanui-row-height": `${
|
|
546
|
-
onScroll: (
|
|
547
|
-
"data-testid":
|
|
548
|
-
children: /* @__PURE__ */
|
|
957
|
+
className: m(S.list, S["list--virtual"], r),
|
|
958
|
+
style: { maxBlockSize: i, "--hanui-row-height": `${t}px` },
|
|
959
|
+
onScroll: (u) => c(u.currentTarget.scrollTop),
|
|
960
|
+
"data-testid": o,
|
|
961
|
+
children: /* @__PURE__ */ a(
|
|
549
962
|
"ul",
|
|
550
963
|
{
|
|
551
964
|
"aria-label": e,
|
|
552
|
-
className:
|
|
965
|
+
className: S.list__window,
|
|
553
966
|
style: {
|
|
554
|
-
blockSize: s.length *
|
|
555
|
-
paddingBlockStart: _ *
|
|
967
|
+
blockSize: s.length * t,
|
|
968
|
+
paddingBlockStart: _ * t
|
|
556
969
|
},
|
|
557
|
-
children: s.slice(_,
|
|
558
|
-
(
|
|
559
|
-
"aria-posinset": _ +
|
|
970
|
+
children: s.slice(_, d).map(
|
|
971
|
+
(u, f) => Ve(u, {
|
|
972
|
+
"aria-posinset": _ + f + 1,
|
|
560
973
|
"aria-setsize": s.length
|
|
561
974
|
})
|
|
562
975
|
)
|
|
@@ -564,144 +977,144 @@ const h = (...e) => {
|
|
|
564
977
|
)
|
|
565
978
|
}
|
|
566
979
|
);
|
|
567
|
-
},
|
|
980
|
+
}, _a = ({
|
|
568
981
|
children: e,
|
|
569
|
-
start:
|
|
570
|
-
end:
|
|
982
|
+
start: n,
|
|
983
|
+
end: t,
|
|
571
984
|
onClick: i,
|
|
572
|
-
href:
|
|
573
|
-
isSelected:
|
|
985
|
+
href: r,
|
|
986
|
+
isSelected: o,
|
|
574
987
|
isMuted: s,
|
|
575
|
-
testId:
|
|
988
|
+
testId: l,
|
|
576
989
|
"aria-posinset": c,
|
|
577
990
|
"aria-setsize": _
|
|
578
991
|
}) => {
|
|
579
|
-
const { linkComponent:
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
s &&
|
|
583
|
-
),
|
|
584
|
-
|
|
585
|
-
/* @__PURE__ */
|
|
586
|
-
|
|
587
|
-
] }),
|
|
588
|
-
return /* @__PURE__ */
|
|
992
|
+
const { linkComponent: d } = C(), u = m(
|
|
993
|
+
S.item,
|
|
994
|
+
o && S["item--selected"],
|
|
995
|
+
s && S["item--muted"]
|
|
996
|
+
), f = /* @__PURE__ */ h(Ye, { children: [
|
|
997
|
+
n !== void 0 && /* @__PURE__ */ a("span", { className: S.item__start, children: n }),
|
|
998
|
+
/* @__PURE__ */ a("span", { className: S.item__body, children: e }),
|
|
999
|
+
t !== void 0 && /* @__PURE__ */ a("span", { className: S.item__end, children: t })
|
|
1000
|
+
] }), b = d ?? "a";
|
|
1001
|
+
return /* @__PURE__ */ a("li", { className: S.list__slot, "aria-posinset": c, "aria-setsize": _, children: r ? /* @__PURE__ */ a(b, { href: r, className: u, "data-testid": l, children: f }) : /* @__PURE__ */ a(
|
|
589
1002
|
"button",
|
|
590
1003
|
{
|
|
591
1004
|
type: "button",
|
|
592
|
-
className:
|
|
1005
|
+
className: u,
|
|
593
1006
|
onClick: i,
|
|
594
|
-
"aria-pressed":
|
|
595
|
-
"data-testid":
|
|
596
|
-
children:
|
|
1007
|
+
"aria-pressed": o,
|
|
1008
|
+
"data-testid": l,
|
|
1009
|
+
children: f
|
|
597
1010
|
}
|
|
598
1011
|
) });
|
|
599
|
-
},
|
|
600
|
-
/* @__PURE__ */
|
|
601
|
-
),
|
|
602
|
-
bar:
|
|
603
|
-
bar__segment:
|
|
604
|
-
bar__marker:
|
|
1012
|
+
}, ua = /* @__PURE__ */ g(
|
|
1013
|
+
/* @__PURE__ */ k($s, "ActionList")
|
|
1014
|
+
), Rs = "hanui-bar-OZjXz", Os = "hanui-bar__segment-hexbp", Ls = "hanui-bar__marker-E0FeF", V = {
|
|
1015
|
+
bar: Rs,
|
|
1016
|
+
bar__segment: Os,
|
|
1017
|
+
bar__marker: Ls,
|
|
605
1018
|
"bar__marker--danger": "hanui-bar__marker--danger-245FK"
|
|
606
|
-
},
|
|
1019
|
+
}, ee = (e, n) => n <= 0 ? 0 : Math.min(100, Math.max(0, e / n * 100)), zs = (e) => e === "muted" ? "var(--hanui-text-3)" : `var(--hanui-${e})`, Is = ({ label: e, max: n, segments: t, markers: i = [], className: r, testId: o }) => {
|
|
607
1020
|
const s = [
|
|
608
|
-
...
|
|
1021
|
+
...t.map((c) => c.label),
|
|
609
1022
|
...i.map((c) => c.label)
|
|
610
1023
|
];
|
|
611
|
-
let
|
|
612
|
-
return /* @__PURE__ */
|
|
1024
|
+
let l = 0;
|
|
1025
|
+
return /* @__PURE__ */ h(
|
|
613
1026
|
"div",
|
|
614
1027
|
{
|
|
615
1028
|
role: "img",
|
|
616
1029
|
"aria-label": `${e}: ${s.join(", ")}`,
|
|
617
|
-
className:
|
|
618
|
-
"data-testid":
|
|
1030
|
+
className: m(V.bar, r),
|
|
1031
|
+
"data-testid": o,
|
|
619
1032
|
children: [
|
|
620
|
-
|
|
621
|
-
const _ = c.from ??
|
|
622
|
-
return
|
|
1033
|
+
t.map((c) => {
|
|
1034
|
+
const _ = c.from ?? l, d = c.to ?? _ + (c.value ?? 0);
|
|
1035
|
+
return l = d, /* @__PURE__ */ a(
|
|
623
1036
|
"span",
|
|
624
1037
|
{
|
|
625
|
-
className:
|
|
1038
|
+
className: V.bar__segment,
|
|
626
1039
|
title: c.label,
|
|
627
1040
|
style: {
|
|
628
|
-
insetInlineStart: `${
|
|
629
|
-
inlineSize: `${
|
|
630
|
-
backgroundColor:
|
|
1041
|
+
insetInlineStart: `${ee(_, n)}%`,
|
|
1042
|
+
inlineSize: `${ee(d, n) - ee(_, n)}%`,
|
|
1043
|
+
backgroundColor: zs(c.tone)
|
|
631
1044
|
}
|
|
632
1045
|
},
|
|
633
1046
|
c.id
|
|
634
1047
|
);
|
|
635
1048
|
}),
|
|
636
|
-
i.map((c) => /* @__PURE__ */
|
|
1049
|
+
i.map((c) => /* @__PURE__ */ a(
|
|
637
1050
|
"span",
|
|
638
1051
|
{
|
|
639
|
-
className:
|
|
640
|
-
|
|
641
|
-
c.tone === "danger" &&
|
|
1052
|
+
className: m(
|
|
1053
|
+
V.bar__marker,
|
|
1054
|
+
c.tone === "danger" && V["bar__marker--danger"]
|
|
642
1055
|
),
|
|
643
1056
|
title: c.label,
|
|
644
|
-
style: { insetInlineStart: `${
|
|
1057
|
+
style: { insetInlineStart: `${ee(c.at, n)}%` }
|
|
645
1058
|
},
|
|
646
1059
|
c.id
|
|
647
1060
|
))
|
|
648
1061
|
]
|
|
649
1062
|
}
|
|
650
1063
|
);
|
|
651
|
-
},
|
|
652
|
-
/* @__PURE__ */
|
|
653
|
-
),
|
|
654
|
-
legend:
|
|
655
|
-
legend__item:
|
|
656
|
-
legend__swatch:
|
|
657
|
-
},
|
|
658
|
-
/* @__PURE__ */
|
|
1064
|
+
}, ma = /* @__PURE__ */ g(
|
|
1065
|
+
/* @__PURE__ */ k(Is, "SegmentBar")
|
|
1066
|
+
), Ds = "hanui-legend-zryov", Ms = "hanui-legend__item-GGrR-", Ps = "hanui-legend__swatch-2MkAR", oe = {
|
|
1067
|
+
legend: Ds,
|
|
1068
|
+
legend__item: Ms,
|
|
1069
|
+
legend__swatch: Ps
|
|
1070
|
+
}, Ks = (e) => e === "muted" ? "var(--hanui-text-3)" : `var(--hanui-${e})`, Bs = ({ items: e, className: n, testId: t }) => /* @__PURE__ */ a("ul", { className: m(oe.legend, n), "data-testid": t, children: e.map((i) => /* @__PURE__ */ h("li", { className: oe.legend__item, children: [
|
|
1071
|
+
/* @__PURE__ */ a(
|
|
659
1072
|
"span",
|
|
660
1073
|
{
|
|
661
1074
|
"aria-hidden": !0,
|
|
662
|
-
className:
|
|
663
|
-
style: { backgroundColor:
|
|
1075
|
+
className: oe.legend__swatch,
|
|
1076
|
+
style: { backgroundColor: Ks(i.tone) }
|
|
664
1077
|
}
|
|
665
1078
|
),
|
|
666
1079
|
i.label
|
|
667
|
-
] }, i.id)) }),
|
|
668
|
-
list:
|
|
669
|
-
list__row:
|
|
670
|
-
list__term:
|
|
671
|
-
list__value:
|
|
1080
|
+
] }, i.id)) }), ha = /* @__PURE__ */ g(/* @__PURE__ */ k(Bs, "Legend")), Fs = "hanui-list-KSLu5", js = "hanui-list__row-k7aHp", Zs = "hanui-list__term-vsD5B", Us = "hanui-list__value-6GY6z", Z = {
|
|
1081
|
+
list: Fs,
|
|
1082
|
+
list__row: js,
|
|
1083
|
+
list__term: Zs,
|
|
1084
|
+
list__value: Us,
|
|
672
1085
|
"list__value--technical": "hanui-list__value--technical-I-UYE"
|
|
673
|
-
},
|
|
674
|
-
/* @__PURE__ */
|
|
675
|
-
/* @__PURE__ */
|
|
1086
|
+
}, Hs = ({ items: e, className: n, testId: t }) => /* @__PURE__ */ a("dl", { className: m(Z.list, n), "data-testid": t, children: e.map((i, r) => /* @__PURE__ */ h("div", { className: Z.list__row, children: [
|
|
1087
|
+
/* @__PURE__ */ a("dt", { className: Z.list__term, children: i.term }),
|
|
1088
|
+
/* @__PURE__ */ a(
|
|
676
1089
|
"dd",
|
|
677
1090
|
{
|
|
678
|
-
className:
|
|
1091
|
+
className: m(Z.list__value, i.isTechnical && Z["list__value--technical"]),
|
|
679
1092
|
children: i.description
|
|
680
1093
|
}
|
|
681
1094
|
)
|
|
682
|
-
] },
|
|
683
|
-
/* @__PURE__ */
|
|
1095
|
+
] }, r)) }), pa = /* @__PURE__ */ g(
|
|
1096
|
+
/* @__PURE__ */ k(Hs, "DescriptionList")
|
|
684
1097
|
);
|
|
685
1098
|
export {
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
1099
|
+
ua as ActionList,
|
|
1100
|
+
_a as ActionListItem,
|
|
1101
|
+
da as AppBar,
|
|
1102
|
+
Js as ChatMessage,
|
|
1103
|
+
Xs as ChatThread,
|
|
1104
|
+
ca as Citation,
|
|
1105
|
+
ta as CodeBlock,
|
|
1106
|
+
pa as DescriptionList,
|
|
1107
|
+
ha as Legend,
|
|
1108
|
+
la as MessageActions,
|
|
1109
|
+
Qs as PromptInput,
|
|
1110
|
+
Vs as PromptSuggestions,
|
|
1111
|
+
ea as Prose,
|
|
1112
|
+
na as ReasoningBlock,
|
|
1113
|
+
sa as ReasoningText,
|
|
1114
|
+
ma as SegmentBar,
|
|
1115
|
+
oa as SourceList,
|
|
1116
|
+
ra as TerminalOutput,
|
|
1117
|
+
ia as ToolCall,
|
|
1118
|
+
aa as ToolCallSection
|
|
706
1119
|
};
|
|
707
1120
|
//# sourceMappingURL=chat.js.map
|