inline-chat-kit 0.55.0 → 0.55.1
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/CHANGELOG.md +17 -0
- package/dist/{ChatExperience-CRtVStGQ.js → ChatExperience-C2UXwrrI.js} +11 -6
- package/dist/ChatExperience-C2UXwrrI.js.map +1 -0
- package/dist/demo.js +168 -166
- package/dist/demo.js.map +1 -1
- package/dist/inline-chat-kit.js +3 -3
- package/dist/theme/useThemeAttribute.d.ts +16 -0
- package/package.json +1 -1
- package/dist/ChatExperience-CRtVStGQ.js.map +0 -1
package/dist/demo.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import {
|
|
3
|
-
import { useCallback as
|
|
4
|
-
import { jsx as
|
|
5
|
-
import { AnimatePresence as
|
|
6
|
-
var
|
|
2
|
+
import { Q as e, n as t, t as n } from "./ChatExperience-C2UXwrrI.js";
|
|
3
|
+
import { useCallback as r, useRef as i, useState as a } from "react";
|
|
4
|
+
import { jsx as o, jsxs as s } from "react/jsx-runtime";
|
|
5
|
+
import { AnimatePresence as c, motion as l } from "motion/react";
|
|
6
|
+
var u = {
|
|
7
7
|
banner: "ick-banner-qe2q",
|
|
8
8
|
header: "ick-header-v41q",
|
|
9
9
|
headerIcon: "ick-headerIcon-hWUJ",
|
|
@@ -19,62 +19,62 @@ var l = {
|
|
|
19
19
|
};
|
|
20
20
|
//#endregion
|
|
21
21
|
//#region src/demo/InlineChatBanner.tsx
|
|
22
|
-
function
|
|
23
|
-
return /* @__PURE__ */
|
|
24
|
-
className:
|
|
25
|
-
children: [/* @__PURE__ */
|
|
26
|
-
className:
|
|
27
|
-
children: [/* @__PURE__ */
|
|
22
|
+
function d({ status: e }) {
|
|
23
|
+
return /* @__PURE__ */ s("div", {
|
|
24
|
+
className: u.banner,
|
|
25
|
+
children: [/* @__PURE__ */ s("div", {
|
|
26
|
+
className: u.header,
|
|
27
|
+
children: [/* @__PURE__ */ s("svg", {
|
|
28
28
|
width: "16",
|
|
29
29
|
height: "16",
|
|
30
30
|
viewBox: "0 0 16 16",
|
|
31
31
|
fill: "none",
|
|
32
32
|
xmlns: "http://www.w3.org/2000/svg",
|
|
33
|
-
className:
|
|
33
|
+
className: u.headerIcon,
|
|
34
34
|
"aria-hidden": !0,
|
|
35
35
|
children: [
|
|
36
|
-
/* @__PURE__ */
|
|
36
|
+
/* @__PURE__ */ o("circle", {
|
|
37
37
|
cx: "8",
|
|
38
38
|
cy: "8",
|
|
39
39
|
r: "7",
|
|
40
40
|
stroke: "currentColor",
|
|
41
41
|
strokeWidth: "1.2"
|
|
42
42
|
}),
|
|
43
|
-
/* @__PURE__ */
|
|
43
|
+
/* @__PURE__ */ o("path", {
|
|
44
44
|
d: "M8 7v4",
|
|
45
45
|
stroke: "currentColor",
|
|
46
46
|
strokeWidth: "1.2",
|
|
47
47
|
strokeLinecap: "round"
|
|
48
48
|
}),
|
|
49
|
-
/* @__PURE__ */
|
|
49
|
+
/* @__PURE__ */ o("circle", {
|
|
50
50
|
cx: "8",
|
|
51
51
|
cy: "5",
|
|
52
52
|
r: "0.8",
|
|
53
53
|
fill: "currentColor"
|
|
54
54
|
})
|
|
55
55
|
]
|
|
56
|
-
}), /* @__PURE__ */
|
|
57
|
-
className:
|
|
58
|
-
children: [/* @__PURE__ */
|
|
59
|
-
className:
|
|
56
|
+
}), /* @__PURE__ */ s("div", {
|
|
57
|
+
className: u.headerText,
|
|
58
|
+
children: [/* @__PURE__ */ o("span", {
|
|
59
|
+
className: u.title,
|
|
60
60
|
children: "Quick heads up"
|
|
61
|
-
}), /* @__PURE__ */
|
|
62
|
-
className:
|
|
61
|
+
}), /* @__PURE__ */ o("span", {
|
|
62
|
+
className: u.body,
|
|
63
63
|
children: "The answers are scripted — there is no model behind this page. Everything else is the real component, so the list below is what you can actually try."
|
|
64
64
|
})]
|
|
65
65
|
})]
|
|
66
|
-
}), /* @__PURE__ */
|
|
67
|
-
className:
|
|
66
|
+
}), /* @__PURE__ */ s("div", {
|
|
67
|
+
className: u.columns,
|
|
68
68
|
children: [
|
|
69
|
-
/* @__PURE__ */
|
|
69
|
+
/* @__PURE__ */ o(f, {
|
|
70
70
|
label: "Works",
|
|
71
71
|
items: e.works
|
|
72
72
|
}),
|
|
73
|
-
/* @__PURE__ */
|
|
73
|
+
/* @__PURE__ */ o(f, {
|
|
74
74
|
label: "Not working",
|
|
75
75
|
items: e.notWorking
|
|
76
76
|
}),
|
|
77
|
-
/* @__PURE__ */
|
|
77
|
+
/* @__PURE__ */ o(f, {
|
|
78
78
|
label: "Soon",
|
|
79
79
|
items: e.soon
|
|
80
80
|
})
|
|
@@ -82,16 +82,16 @@ function u({ status: e }) {
|
|
|
82
82
|
})]
|
|
83
83
|
});
|
|
84
84
|
}
|
|
85
|
-
function
|
|
86
|
-
return /* @__PURE__ */
|
|
87
|
-
className:
|
|
88
|
-
children: [/* @__PURE__ */
|
|
89
|
-
className:
|
|
85
|
+
function f({ label: e, items: t }) {
|
|
86
|
+
return /* @__PURE__ */ s("div", {
|
|
87
|
+
className: u.column,
|
|
88
|
+
children: [/* @__PURE__ */ o("span", {
|
|
89
|
+
className: u.columnLabel,
|
|
90
90
|
children: e
|
|
91
|
-
}), /* @__PURE__ */
|
|
92
|
-
className:
|
|
93
|
-
children: t.map((e) => /* @__PURE__ */
|
|
94
|
-
className:
|
|
91
|
+
}), /* @__PURE__ */ o("div", {
|
|
92
|
+
className: u.items,
|
|
93
|
+
children: t.map((e) => /* @__PURE__ */ o("span", {
|
|
94
|
+
className: u.item,
|
|
95
95
|
children: e
|
|
96
96
|
}, e))
|
|
97
97
|
})]
|
|
@@ -99,7 +99,7 @@ function d({ label: e, items: t }) {
|
|
|
99
99
|
}
|
|
100
100
|
//#endregion
|
|
101
101
|
//#region src/demo/featureStatus.ts
|
|
102
|
-
var
|
|
102
|
+
var p = {
|
|
103
103
|
works: [
|
|
104
104
|
"Send, stop, edit",
|
|
105
105
|
"Multiline input",
|
|
@@ -124,7 +124,7 @@ var f = {
|
|
|
124
124
|
"Queue a message",
|
|
125
125
|
"Saved conversations"
|
|
126
126
|
]
|
|
127
|
-
},
|
|
127
|
+
}, m = {
|
|
128
128
|
page: "ick-page-FfCm",
|
|
129
129
|
container: "ick-container-o-mL",
|
|
130
130
|
infoContainer: "ick-infoContainer-6g-x",
|
|
@@ -139,7 +139,7 @@ var f = {
|
|
|
139
139
|
bannerWrapper: "ick-bannerWrapper-URah",
|
|
140
140
|
buttonWrapper: "ick-buttonWrapper-3eYt",
|
|
141
141
|
fyi: "ick-fyi-9rqo"
|
|
142
|
-
},
|
|
142
|
+
}, h = {
|
|
143
143
|
staggerIn: .07,
|
|
144
144
|
stiffness: 100,
|
|
145
145
|
damping: 36,
|
|
@@ -150,9 +150,9 @@ var f = {
|
|
|
150
150
|
offsetOut: -10,
|
|
151
151
|
blurOut: 10
|
|
152
152
|
};
|
|
153
|
-
function
|
|
153
|
+
function g({ logo: t, back: n, onStart: r, welcome: i = "Welcome", title: a = "This is inline chat experience", version: c = "v1.0.0", description: u = "Exploration of having the input be the same as response. Or better said input morphing into chat bubble and maintains the continuous experience.", status: f = p, motionConfig: g }) {
|
|
154
154
|
let _ = {
|
|
155
|
-
...
|
|
155
|
+
...h,
|
|
156
156
|
...g
|
|
157
157
|
}, v = {
|
|
158
158
|
hidden: {},
|
|
@@ -192,67 +192,67 @@ function h({ logo: t, back: n, onStart: r, welcome: i = "Welcome", title: s = "T
|
|
|
192
192
|
}
|
|
193
193
|
}
|
|
194
194
|
};
|
|
195
|
-
return /* @__PURE__ */
|
|
196
|
-
className:
|
|
195
|
+
return /* @__PURE__ */ o(l.div, {
|
|
196
|
+
className: m.page,
|
|
197
197
|
variants: v,
|
|
198
198
|
initial: "hidden",
|
|
199
199
|
animate: "visible",
|
|
200
200
|
exit: "exit",
|
|
201
|
-
children: /* @__PURE__ */
|
|
202
|
-
className:
|
|
201
|
+
children: /* @__PURE__ */ s("div", {
|
|
202
|
+
className: m.container,
|
|
203
203
|
children: [
|
|
204
|
-
/* @__PURE__ */
|
|
205
|
-
className:
|
|
206
|
-
children: [t && /* @__PURE__ */
|
|
204
|
+
/* @__PURE__ */ s("div", {
|
|
205
|
+
className: m.infoContainer,
|
|
206
|
+
children: [t && /* @__PURE__ */ o(l.div, {
|
|
207
207
|
variants: y,
|
|
208
208
|
children: t
|
|
209
|
-
}), /* @__PURE__ */
|
|
210
|
-
className:
|
|
211
|
-
children: [/* @__PURE__ */
|
|
212
|
-
className:
|
|
213
|
-
children: [/* @__PURE__ */
|
|
214
|
-
className:
|
|
209
|
+
}), /* @__PURE__ */ s("div", {
|
|
210
|
+
className: m.content,
|
|
211
|
+
children: [/* @__PURE__ */ s("div", {
|
|
212
|
+
className: m.introContent,
|
|
213
|
+
children: [/* @__PURE__ */ s(l.div, {
|
|
214
|
+
className: m.nameContent,
|
|
215
215
|
variants: y,
|
|
216
|
-
children: [/* @__PURE__ */
|
|
217
|
-
className:
|
|
216
|
+
children: [/* @__PURE__ */ o("span", {
|
|
217
|
+
className: m.welcome,
|
|
218
218
|
children: i
|
|
219
|
-
}), /* @__PURE__ */
|
|
220
|
-
className:
|
|
221
|
-
children:
|
|
219
|
+
}), /* @__PURE__ */ o("span", {
|
|
220
|
+
className: m.title,
|
|
221
|
+
children: a
|
|
222
222
|
})]
|
|
223
|
-
}), /* @__PURE__ */
|
|
224
|
-
className:
|
|
223
|
+
}), /* @__PURE__ */ o(l.span, {
|
|
224
|
+
className: m.version,
|
|
225
225
|
variants: y,
|
|
226
|
-
children:
|
|
226
|
+
children: c
|
|
227
227
|
})]
|
|
228
|
-
}), /* @__PURE__ */
|
|
229
|
-
className:
|
|
228
|
+
}), /* @__PURE__ */ o(l.p, {
|
|
229
|
+
className: m.description,
|
|
230
230
|
variants: y,
|
|
231
|
-
children:
|
|
231
|
+
children: u
|
|
232
232
|
})]
|
|
233
233
|
})]
|
|
234
234
|
}),
|
|
235
|
-
/* @__PURE__ */
|
|
235
|
+
/* @__PURE__ */ o(l.div, {
|
|
236
236
|
variants: y,
|
|
237
|
-
className:
|
|
238
|
-
children: /* @__PURE__ */
|
|
237
|
+
className: m.bannerWrapper,
|
|
238
|
+
children: /* @__PURE__ */ o(d, { status: f })
|
|
239
239
|
}),
|
|
240
|
-
/* @__PURE__ */
|
|
240
|
+
/* @__PURE__ */ o(l.div, {
|
|
241
241
|
variants: y,
|
|
242
242
|
style: { display: "none" }
|
|
243
243
|
}),
|
|
244
|
-
/* @__PURE__ */
|
|
244
|
+
/* @__PURE__ */ o(l.div, {
|
|
245
245
|
variants: y,
|
|
246
246
|
style: { display: "none" }
|
|
247
247
|
}),
|
|
248
|
-
/* @__PURE__ */
|
|
248
|
+
/* @__PURE__ */ o(l.div, {
|
|
249
249
|
variants: y,
|
|
250
250
|
style: { display: "none" }
|
|
251
251
|
}),
|
|
252
|
-
/* @__PURE__ */
|
|
252
|
+
/* @__PURE__ */ s(l.div, {
|
|
253
253
|
variants: y,
|
|
254
|
-
className:
|
|
255
|
-
children: [/* @__PURE__ */
|
|
254
|
+
className: m.buttonWrapper,
|
|
255
|
+
children: [/* @__PURE__ */ o(e, {
|
|
256
256
|
variant: "glass",
|
|
257
257
|
size: "m",
|
|
258
258
|
onClick: r,
|
|
@@ -265,20 +265,20 @@ function h({ logo: t, back: n, onStart: r, welcome: i = "Welcome", title: s = "T
|
|
|
265
265
|
}
|
|
266
266
|
//#endregion
|
|
267
267
|
//#region src/demo/scriptedApi.ts
|
|
268
|
-
var
|
|
268
|
+
var _ = /* @__PURE__ */ new Map(), v = [
|
|
269
269
|
"Particle physics studies the most fundamental constituents of matter and the forces that act between them.",
|
|
270
270
|
"The **Standard Model** organises them into three families:",
|
|
271
271
|
"- twelve fermions — six quarks and six leptons\n- the force-carrying bosons\n- the Higgs, which gives the rest their mass",
|
|
272
272
|
"The Higgs boson, found at CERN in 2012, completes the picture by giving elementary particles their mass through interaction with the Higgs field."
|
|
273
|
-
],
|
|
273
|
+
], y = [
|
|
274
274
|
"The Higgs boson is a *point particle* — it has no measurable spatial extent at any scale we can currently probe.",
|
|
275
275
|
"| property | value |\n| --- | --- |\n| mass | ~125 GeV/c² |\n| charge | 0 |\n| spin | 0 |",
|
|
276
276
|
"So 'how big is it' has only one honest answer: it has no size, only `mass` and quantum numbers."
|
|
277
|
-
],
|
|
277
|
+
], b = ["Here is what I would do, in order. The first two are cheap and tell us whether the rest is worth doing."], x = [
|
|
278
278
|
"The current combined figure is **125.25 GeV/c²**[^1], from ATLAS and CMS together — separately, neither experiment gets there.",
|
|
279
279
|
"It is known to about a fifth of a percent[^2], which for a particle discovered in 2012 is a remarkably tight number.",
|
|
280
280
|
"The uncertainty is now dominated by systematics rather than statistics[^3] — more collisions alone will not sharpen it much further."
|
|
281
|
-
],
|
|
281
|
+
], S = [
|
|
282
282
|
{
|
|
283
283
|
id: "atlas-cms",
|
|
284
284
|
title: "Combined measurement of the Higgs boson mass",
|
|
@@ -298,7 +298,7 @@ var g = /* @__PURE__ */ new Map(), _ = [
|
|
|
298
298
|
origin: "cms.cern",
|
|
299
299
|
url: "https://example.com/systematics"
|
|
300
300
|
}
|
|
301
|
-
],
|
|
301
|
+
], C = [
|
|
302
302
|
{
|
|
303
303
|
id: "read",
|
|
304
304
|
label: "Read what is being asked",
|
|
@@ -314,7 +314,7 @@ var g = /* @__PURE__ */ new Map(), _ = [
|
|
|
314
314
|
label: "Check which is the limiting one now",
|
|
315
315
|
body: "Statistics used to dominate. It is systematics now, and that changes what more data would buy."
|
|
316
316
|
}
|
|
317
|
-
],
|
|
317
|
+
], w = [
|
|
318
318
|
{
|
|
319
319
|
id: "setup",
|
|
320
320
|
type: "inputs",
|
|
@@ -387,28 +387,28 @@ var g = /* @__PURE__ */ new Map(), _ = [
|
|
|
387
387
|
}
|
|
388
388
|
]
|
|
389
389
|
}
|
|
390
|
-
],
|
|
391
|
-
async function*
|
|
392
|
-
for (let t of e.join("\n\n").split(/(\s+)/)) await
|
|
390
|
+
], T = (e) => new Promise((t) => setTimeout(t, e));
|
|
391
|
+
async function* E(e) {
|
|
392
|
+
for (let t of e.join("\n\n").split(/(\s+)/)) await T(24), yield t;
|
|
393
393
|
}
|
|
394
|
-
async function*
|
|
394
|
+
async function* D(e, t) {
|
|
395
395
|
let n = "";
|
|
396
396
|
for (let r of t) n += (n ? "\n\n" : "") + r, yield {
|
|
397
397
|
kind: "reasoning",
|
|
398
398
|
id: e,
|
|
399
399
|
text: n,
|
|
400
400
|
state: "thinking"
|
|
401
|
-
}, await
|
|
401
|
+
}, await T(420);
|
|
402
402
|
yield {
|
|
403
403
|
kind: "reasoning",
|
|
404
404
|
id: e,
|
|
405
405
|
state: "done"
|
|
406
406
|
};
|
|
407
407
|
}
|
|
408
|
-
var
|
|
408
|
+
var O = {
|
|
409
409
|
query: "higgs boson mass measurement",
|
|
410
410
|
limit: 3
|
|
411
|
-
},
|
|
411
|
+
}, k = {
|
|
412
412
|
results: [{
|
|
413
413
|
title: "ATLAS and CMS combined measurement",
|
|
414
414
|
url: "https://example.com/atlas-cms",
|
|
@@ -420,25 +420,25 @@ var D = {
|
|
|
420
420
|
}],
|
|
421
421
|
took_ms: 412
|
|
422
422
|
};
|
|
423
|
-
async function*
|
|
423
|
+
async function* A(e) {
|
|
424
424
|
yield {
|
|
425
425
|
kind: "tool",
|
|
426
426
|
id: e,
|
|
427
427
|
name: "search_web",
|
|
428
428
|
state: "running",
|
|
429
429
|
summary: "Searching the web",
|
|
430
|
-
input:
|
|
431
|
-
}, await
|
|
430
|
+
input: O
|
|
431
|
+
}, await T(900), yield {
|
|
432
432
|
kind: "tool",
|
|
433
433
|
id: e,
|
|
434
434
|
name: "search_web",
|
|
435
435
|
state: "done",
|
|
436
436
|
summary: "2 results",
|
|
437
|
-
output:
|
|
437
|
+
output: k,
|
|
438
438
|
duration: 412
|
|
439
439
|
};
|
|
440
440
|
}
|
|
441
|
-
var
|
|
441
|
+
var j = [
|
|
442
442
|
{
|
|
443
443
|
id: "read",
|
|
444
444
|
label: "Read the care plan"
|
|
@@ -456,42 +456,42 @@ var A = [
|
|
|
456
456
|
label: "Draft the questions for the family"
|
|
457
457
|
}
|
|
458
458
|
];
|
|
459
|
-
async function*
|
|
460
|
-
for (let t = 0; t <=
|
|
459
|
+
async function* M(e) {
|
|
460
|
+
for (let t = 0; t <= j.length; t++) yield {
|
|
461
461
|
kind: "tasks",
|
|
462
462
|
id: e,
|
|
463
463
|
title: "Plan",
|
|
464
464
|
collapsible: !0,
|
|
465
|
-
tasks:
|
|
465
|
+
tasks: j.map((e, n) => ({
|
|
466
466
|
...e,
|
|
467
467
|
state: n < t ? "done" : n === t ? "running" : "pending"
|
|
468
468
|
}))
|
|
469
|
-
}, await
|
|
469
|
+
}, await T(800);
|
|
470
470
|
}
|
|
471
|
-
async function*
|
|
472
|
-
for (let t = 0; t <
|
|
471
|
+
async function* N(e) {
|
|
472
|
+
for (let t = 0; t < C.length; t++) yield {
|
|
473
473
|
kind: "chain",
|
|
474
474
|
id: e,
|
|
475
475
|
state: "thinking",
|
|
476
|
-
steps:
|
|
476
|
+
steps: C.slice(0, t + 1).map((e, n) => ({
|
|
477
477
|
...e,
|
|
478
478
|
state: n < t ? "done" : "running"
|
|
479
479
|
}))
|
|
480
|
-
}, await
|
|
480
|
+
}, await T(700);
|
|
481
481
|
yield {
|
|
482
482
|
kind: "chain",
|
|
483
483
|
id: e,
|
|
484
484
|
state: "done",
|
|
485
|
-
steps:
|
|
485
|
+
steps: C.map((e) => ({
|
|
486
486
|
...e,
|
|
487
487
|
state: "done"
|
|
488
488
|
}))
|
|
489
489
|
};
|
|
490
490
|
}
|
|
491
|
-
var
|
|
491
|
+
var P = (e, ...t) => {
|
|
492
492
|
let n = e.toLowerCase();
|
|
493
493
|
return t.some((e) => n.includes(e));
|
|
494
|
-
},
|
|
494
|
+
}, F = ["I can see it. Whatever you send along with a message arrives here the same way the text does — one `attachments` array on the turn, and the composer that held it is the same one that shows it afterwards.", "This demo does not read the picture; there is no model behind it. A real one would get the file and the sentence in the same request."], I = [[
|
|
495
495
|
"Another way to put it: particle physics is the study of what is left when you stop dividing.",
|
|
496
496
|
"Everything in the Standard Model is there because dividing it further stopped producing anything smaller — twelve fermions, the bosons that carry the forces between them, and the Higgs.",
|
|
497
497
|
"The interesting part is not the list. It is that the list is *short*, and that nothing found since 1973 has needed adding to it."
|
|
@@ -499,41 +499,41 @@ var N = (e, ...t) => {
|
|
|
499
499
|
"Once more, from the other end. Start with the four forces and ask what carries each one.",
|
|
500
500
|
"Electromagnetism has the photon. The strong force has gluons. The weak force has the W and Z. Gravity has no entry here at all — which is the honest shape of the field's biggest open problem.",
|
|
501
501
|
"Matter is what those forces act on: quarks, which feel the strong force, and leptons, which do not."
|
|
502
|
-
]],
|
|
503
|
-
async function*
|
|
502
|
+
]], L = "Week 1 — base\nMon rest\nTue 4 km easy, conversational pace\nWed cross-train, 30 min\nThu 5 × 400 m at 5k effort, 90 s jog between\nFri rest\nSat 6 km easy\nSun 20 min walk\n\nWeek 2 — base\nMon rest\nTue 5 km easy\nWed cross-train, 35 min\nThu 6 × 400 m, 90 s jog between\nFri rest\nSat 7 km easy, last kilometre at pace\nSun 20 min walk\n\nWeek 3 — build\nMon rest\nTue 5 km easy\nWed cross-train, 35 min\nThu 4 × 800 m at 5k effort, 2 min jog between\nFri rest\nSat 8 km easy\nSun 20 min walk\n\nWeek 4 — cut back\nMon rest\nTue 4 km easy\nWed cross-train, 30 min\nThu 5 × 400 m, 90 s jog between\nFri rest\nSat 5 km easy\nSun rest\n\nWeek 5 — build\nMon rest\nTue 6 km easy\nWed cross-train, 40 min\nThu 5 × 800 m, 2 min jog between\nFri rest\nSat 9 km easy\nSun 20 min walk\n\nWeek 6 — sharpen\nMon rest\nTue 6 km with 3 km at target pace\nWed cross-train, 30 min\nThu 8 × 400 m, 60 s jog between\nFri rest\nSat 8 km easy\nSun 20 min walk\n\nWeek 7 — sharpen\nMon rest\nTue 5 km with 4 km at target pace\nWed cross-train, 30 min\nThu 6 × 400 m, 60 s jog between\nFri rest\nSat 6 km easy\nSun rest\n\nWeek 8 — taper and race\nMon rest\nTue 4 km easy with 4 × 100 m strides\nWed rest\nThu 3 km easy\nFri rest\nSat race, 5 km\nSun 20 min walk\n\nNotes\nEasy means you can hold a conversation. If you cannot, it is not easy.\nEvery hard day is followed by a rest day; that is where the fitness is made.\nMiss a week and repeat it rather than skipping ahead to catch up.";
|
|
503
|
+
async function* R(e, { attachments: t, turnId: n }) {
|
|
504
504
|
if (t.length > 0) {
|
|
505
|
-
yield*
|
|
505
|
+
yield* D("r", [`${t.length === 1 ? "A file" : `${t.length} files`} came with this.`, "Say what arrived, and be honest that nothing here is looking at it."]), yield* E(F);
|
|
506
506
|
return;
|
|
507
507
|
}
|
|
508
|
-
if (
|
|
509
|
-
yield*
|
|
508
|
+
if (P(e, "plan", "training", "5k", "run ", "running", "trening", "trčanj", "trcanj")) {
|
|
509
|
+
yield* D("r", ["Eight weeks is the shortest honest 5k build for somebody starting from a base.", "The plan is long. Put it behind a card rather than into the answer — an answer nobody can read past is not an answer."]), yield {
|
|
510
510
|
kind: "artifact",
|
|
511
511
|
id: "plan",
|
|
512
512
|
title: "5k training plan",
|
|
513
513
|
state: "writing"
|
|
514
|
-
}, yield "Here is an eight-week plan. Four sessions a week, one of them hard, and a cut-back week in the middle so the fourth week does not become the one you quit in.", await
|
|
514
|
+
}, yield "Here is an eight-week plan. Four sessions a week, one of them hard, and a cut-back week in the middle so the fourth week does not become the one you quit in.", await T(900), yield {
|
|
515
515
|
kind: "artifact",
|
|
516
516
|
id: "plan",
|
|
517
517
|
meta: "8 weeks · 4 sessions a week",
|
|
518
518
|
preview: "text",
|
|
519
|
-
content:
|
|
519
|
+
content: L,
|
|
520
520
|
state: "done"
|
|
521
521
|
}, yield " Open it to see the weeks.";
|
|
522
522
|
return;
|
|
523
523
|
}
|
|
524
|
-
if (
|
|
525
|
-
yield*
|
|
524
|
+
if (P(e, "question", "ask me", "set up", "double-slit", "experiment", "pitanj")) {
|
|
525
|
+
yield* D("r", ["They want to be asked rather than to specify the whole thing up front.", "Three is the most anybody answers in one sitting: the geometry, then where the detector goes — which is the only choice that changes the physics — then what to plot."]), yield {
|
|
526
526
|
kind: "question",
|
|
527
527
|
id: "q",
|
|
528
528
|
title: "Setting up the run",
|
|
529
|
-
questions:
|
|
529
|
+
questions: w,
|
|
530
530
|
answers: {},
|
|
531
531
|
activeIndex: 0
|
|
532
532
|
};
|
|
533
533
|
return;
|
|
534
534
|
}
|
|
535
|
-
if (
|
|
536
|
-
yield*
|
|
535
|
+
if (P(e, "delete", "run ", "send an email", "permission", "approve")) {
|
|
536
|
+
yield* D("r", ["This one changes something outside the conversation, so it is not mine to decide.", "Show what it would run, and wait."]), yield {
|
|
537
537
|
kind: "approval",
|
|
538
538
|
id: "ask",
|
|
539
539
|
title: "Run a command in your shell",
|
|
@@ -548,69 +548,71 @@ async function* L(e, { attachments: t, turnId: n }) {
|
|
|
548
548
|
};
|
|
549
549
|
return;
|
|
550
550
|
}
|
|
551
|
-
if (
|
|
552
|
-
yield*
|
|
551
|
+
if (P(e, "plan", "todo", "steps", "what would you do")) {
|
|
552
|
+
yield* D("r", ["This is a sequence, not a single answer, so the plan is the answer.", "Order it so the cheap checks come first — if the medication list already matches, the rest is much smaller."]), yield* M("p"), yield* E(b);
|
|
553
553
|
return;
|
|
554
554
|
}
|
|
555
|
-
if (
|
|
556
|
-
yield*
|
|
555
|
+
if (P(e, "sources", "cite", "how do you know", "izvor")) {
|
|
556
|
+
yield* N("c"), yield {
|
|
557
557
|
kind: "sources",
|
|
558
558
|
id: "s",
|
|
559
|
-
sources:
|
|
559
|
+
sources: S,
|
|
560
560
|
title: "Sources",
|
|
561
561
|
collapsible: !0
|
|
562
|
-
}, yield*
|
|
562
|
+
}, yield* E(x);
|
|
563
563
|
return;
|
|
564
564
|
}
|
|
565
|
-
if (
|
|
566
|
-
yield*
|
|
565
|
+
if (P(e, "how big", "mass", "size", "weigh")) {
|
|
566
|
+
yield* D("r", ["The question is about the Higgs boson's size, and the honest answer is that it does not have one.", "Better to give the mass instead, and say why size is the wrong question — but check the current figure first."]), yield* A("t"), yield* E(y);
|
|
567
567
|
return;
|
|
568
568
|
}
|
|
569
|
-
let r = (
|
|
570
|
-
if (
|
|
571
|
-
yield*
|
|
569
|
+
let r = (_.get(n) ?? 0) % (I.length + 1);
|
|
570
|
+
if (_.set(n, r + 1), r > 0) {
|
|
571
|
+
yield* D("r", ["Asked again, so the first answer did not land.", "Same physics, different way in — repeating it in other words is not answering it again."]), yield* E(I[r - 1]);
|
|
572
572
|
return;
|
|
573
573
|
}
|
|
574
|
-
yield*
|
|
574
|
+
yield* D("r", ["A general question, so the answer should start from what the field is for rather than from a definition.", "Three families is the useful shape: fermions, bosons, and the Higgs."]), yield* E(v);
|
|
575
575
|
}
|
|
576
|
-
async function*
|
|
577
|
-
yield*
|
|
576
|
+
async function* z() {
|
|
577
|
+
yield* E(["Marking a passage and asking about it keeps the question attached to what it is about — so the answer can be short.", "That is the whole of the thread: the quote, one question, one answer."]);
|
|
578
578
|
}
|
|
579
|
-
async function*
|
|
579
|
+
async function* B(e, { signal: t }) {
|
|
580
580
|
let n = `this is a scripted transcript standing in for about ${Math.max(1, Math.round(e.size / 12e3))} seconds of speech`.split(" ");
|
|
581
581
|
for (let e of n) {
|
|
582
582
|
if (await new Promise((e) => setTimeout(e, 90)), t.aborted) return;
|
|
583
583
|
yield `${e} `;
|
|
584
584
|
}
|
|
585
585
|
}
|
|
586
|
-
var
|
|
587
|
-
function
|
|
588
|
-
let [
|
|
586
|
+
var V = { plan: "ick-plan-nXLe" }, H = 8e3, U = 900;
|
|
587
|
+
function W({ logo: e, back: s, backHref: l = "/", backLabel: u = "Back to home", skipIntro: d = !1, theme: f, onThemeChange: p, cursor: m = !1, animationConfig: h, foldMotion: _, feedDelay: v, introMotion: y }) {
|
|
588
|
+
let [b, x] = a(d);
|
|
589
|
+
t(f === void 0 ? void 0 : f);
|
|
590
|
+
let S = i({}), C = r((e, t, n, r, i) => {
|
|
589
591
|
let a = {
|
|
590
|
-
...
|
|
592
|
+
...S.current[n] ?? {},
|
|
591
593
|
[r]: i
|
|
592
594
|
};
|
|
593
|
-
|
|
594
|
-
let o =
|
|
595
|
+
S.current[n] = a;
|
|
596
|
+
let o = w.findIndex((e) => e.id === r) + 1, s = o >= w.length;
|
|
595
597
|
e(t, {
|
|
596
598
|
kind: "question",
|
|
597
599
|
id: n,
|
|
598
600
|
title: "Setting up the run",
|
|
599
|
-
questions:
|
|
601
|
+
questions: w,
|
|
600
602
|
answers: a,
|
|
601
603
|
activeIndex: s ? null : o,
|
|
602
604
|
collapsible: s
|
|
603
605
|
});
|
|
604
|
-
}, []),
|
|
606
|
+
}, []), T = r((e, t, n, r) => {
|
|
605
607
|
e(t, {
|
|
606
608
|
kind: "question",
|
|
607
609
|
id: n,
|
|
608
|
-
questions:
|
|
609
|
-
answers:
|
|
610
|
+
questions: w,
|
|
611
|
+
answers: S.current[n] ?? {},
|
|
610
612
|
activeIndex: r,
|
|
611
613
|
collapsible: !1
|
|
612
614
|
});
|
|
613
|
-
}, []),
|
|
615
|
+
}, []), E = r((e, t, n, r) => {
|
|
614
616
|
e(t, {
|
|
615
617
|
kind: "approval",
|
|
616
618
|
id: n,
|
|
@@ -634,15 +636,15 @@ function U({ logo: e, back: o, backHref: c = "/", backLabel: l = "Back to home",
|
|
|
634
636
|
});
|
|
635
637
|
}, 1100));
|
|
636
638
|
}, []);
|
|
637
|
-
return /* @__PURE__ */
|
|
639
|
+
return /* @__PURE__ */ o(c, {
|
|
638
640
|
mode: "wait",
|
|
639
|
-
children:
|
|
640
|
-
onSend:
|
|
641
|
-
onTranscribe:
|
|
642
|
-
onThreadReply:
|
|
641
|
+
children: b ? /* @__PURE__ */ o(n, {
|
|
642
|
+
onSend: R,
|
|
643
|
+
onTranscribe: B,
|
|
644
|
+
onThreadReply: z,
|
|
643
645
|
title: "inline chat experience",
|
|
644
|
-
backHref:
|
|
645
|
-
backLabel:
|
|
646
|
+
backHref: l,
|
|
647
|
+
backLabel: u,
|
|
646
648
|
placeholder: "Ask me about particle physics…",
|
|
647
649
|
empty: {
|
|
648
650
|
title: "Ask me about particle physics",
|
|
@@ -657,35 +659,35 @@ function U({ logo: e, back: o, backHref: c = "/", backLabel: l = "Back to home",
|
|
|
657
659
|
"Delete the screenshots"
|
|
658
660
|
]
|
|
659
661
|
},
|
|
660
|
-
contextTotal:
|
|
661
|
-
contextBase:
|
|
662
|
+
contextTotal: H,
|
|
663
|
+
contextBase: U,
|
|
662
664
|
artifact: () => ({
|
|
663
665
|
title: "5k training plan",
|
|
664
666
|
meta: "8 weeks · 4 sessions a week",
|
|
665
|
-
children: /* @__PURE__ */
|
|
666
|
-
className:
|
|
667
|
-
children:
|
|
667
|
+
children: /* @__PURE__ */ o("pre", {
|
|
668
|
+
className: V.plan,
|
|
669
|
+
children: L
|
|
668
670
|
})
|
|
669
671
|
}),
|
|
670
|
-
theme:
|
|
671
|
-
onThemeChange:
|
|
672
|
-
cursor:
|
|
672
|
+
theme: f,
|
|
673
|
+
onThemeChange: p,
|
|
674
|
+
cursor: m,
|
|
673
675
|
selectionToggle: !0,
|
|
674
|
-
animationConfig:
|
|
675
|
-
foldMotion:
|
|
676
|
-
feedDelay:
|
|
677
|
-
onAnswerQuestion:
|
|
678
|
-
onEditQuestion:
|
|
679
|
-
onDecideApproval:
|
|
680
|
-
}, "chat") : /* @__PURE__ */
|
|
676
|
+
animationConfig: h,
|
|
677
|
+
foldMotion: _,
|
|
678
|
+
feedDelay: v,
|
|
679
|
+
onAnswerQuestion: C,
|
|
680
|
+
onEditQuestion: T,
|
|
681
|
+
onDecideApproval: E
|
|
682
|
+
}, "chat") : /* @__PURE__ */ o(g, {
|
|
681
683
|
logo: e,
|
|
682
|
-
back:
|
|
683
|
-
onStart: () =>
|
|
684
|
-
motionConfig:
|
|
684
|
+
back: s,
|
|
685
|
+
onStart: () => x(!0),
|
|
686
|
+
motionConfig: y
|
|
685
687
|
}, "intro")
|
|
686
688
|
});
|
|
687
689
|
}
|
|
688
690
|
//#endregion
|
|
689
|
-
export {
|
|
691
|
+
export { W as ChatExperienceDemo, p as INLINE_CHAT_FEATURE_STATUS, d as InlineChatBanner, g as IntroLanding, w as QUESTIONS, L as RUNNING_PLAN, R as scriptedApi, B as scriptedTranscript, z as threadReply };
|
|
690
692
|
|
|
691
693
|
//# sourceMappingURL=demo.js.map
|