@saywright/studio 0.1.1 → 0.2.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/dist/THIRD_PARTY_NOTICES.md +0 -6
- package/dist/bridge.js +1188 -210
- package/dist/cli.mjs +9464 -7528
- package/dist/client/assets/CommandPalette-BM1BSUxc.js +1 -0
- package/dist/client/assets/CommandPalette-BM1BSUxc.js.br +0 -0
- package/dist/client/assets/CommandPalette-BM1BSUxc.js.gz +0 -0
- package/dist/client/assets/HelpDialog-Bc6yjiVi.js +1 -0
- package/dist/client/assets/HelpDialog-Bc6yjiVi.js.br +0 -0
- package/dist/client/assets/HelpDialog-Bc6yjiVi.js.gz +0 -0
- package/dist/client/assets/ReportView-DKcggbSt.js +4 -0
- package/dist/client/assets/ReportView-DKcggbSt.js.br +0 -0
- package/dist/client/assets/ReportView-DKcggbSt.js.gz +0 -0
- package/dist/client/assets/SettingsDialog-CIpvauuY.js +1 -0
- package/dist/client/assets/SettingsDialog-CIpvauuY.js.br +0 -0
- package/dist/client/assets/SettingsDialog-CIpvauuY.js.gz +0 -0
- package/dist/client/assets/arrow-left-5LUh_bW3.js +1 -0
- package/dist/client/assets/brand-BcIB43Uo.js +57 -0
- package/dist/client/assets/brand-BcIB43Uo.js.br +0 -0
- package/dist/client/assets/brand-BcIB43Uo.js.gz +0 -0
- package/dist/client/assets/footprints-CfMi7MiN.js +1 -0
- package/dist/client/assets/index-BrM0s_jp.css +2 -0
- package/dist/client/assets/index-BrM0s_jp.css.br +0 -0
- package/dist/client/assets/index-BrM0s_jp.css.gz +0 -0
- package/dist/client/assets/index-D1ooswLS.js +19 -0
- package/dist/client/assets/index-D1ooswLS.js.br +0 -0
- package/dist/client/assets/index-D1ooswLS.js.gz +0 -0
- package/dist/client/assets/refresh-cw-BM1RSPTL.js +1 -0
- package/dist/client/index.html +3 -5
- package/dist/client/index.html.br +0 -0
- package/dist/client/index.html.gz +0 -0
- package/dist/sample/package.json +1 -1
- package/dist/sample/src/App.tsx +3 -2
- package/dist/sample/src/lib/route.ts +3 -2
- package/dist/sample/src/pages/Account.tsx +88 -0
- package/dist/sample/src/styles.css +5 -0
- package/package.json +1 -2
- package/dist/client/assets/Calibration-xY4YDLzU.js +0 -1
- package/dist/client/assets/Calibration-xY4YDLzU.js.br +0 -0
- package/dist/client/assets/Calibration-xY4YDLzU.js.gz +0 -0
- package/dist/client/assets/CommandPalette-BA3akF-p.js +0 -1
- package/dist/client/assets/CommandPalette-BA3akF-p.js.br +0 -0
- package/dist/client/assets/CommandPalette-BA3akF-p.js.gz +0 -0
- package/dist/client/assets/HelpDialog-C6qmdEwi.js +0 -1
- package/dist/client/assets/HelpDialog-C6qmdEwi.js.br +0 -0
- package/dist/client/assets/HelpDialog-C6qmdEwi.js.gz +0 -0
- package/dist/client/assets/ReportView-Bj9xxLCi.js +0 -4
- package/dist/client/assets/ReportView-Bj9xxLCi.js.br +0 -0
- package/dist/client/assets/ReportView-Bj9xxLCi.js.gz +0 -0
- package/dist/client/assets/SettingsDialog-VrACcdUX.js +0 -1
- package/dist/client/assets/SettingsDialog-VrACcdUX.js.br +0 -0
- package/dist/client/assets/SettingsDialog-VrACcdUX.js.gz +0 -0
- package/dist/client/assets/button-B2NFEpCs.js +0 -18
- package/dist/client/assets/button-B2NFEpCs.js.br +0 -0
- package/dist/client/assets/button-B2NFEpCs.js.gz +0 -0
- package/dist/client/assets/camera-BD9K1f5I.js +0 -1
- package/dist/client/assets/confirm-D1U-bFIL.js +0 -41
- package/dist/client/assets/confirm-D1U-bFIL.js.br +0 -0
- package/dist/client/assets/confirm-D1U-bFIL.js.gz +0 -0
- package/dist/client/assets/footprints-DiYtIryA.js +0 -1
- package/dist/client/assets/index-BakNwOFF.css +0 -2
- package/dist/client/assets/index-BakNwOFF.css.br +0 -0
- package/dist/client/assets/index-BakNwOFF.css.gz +0 -0
- package/dist/client/assets/index-DUAtV_Av.js +0 -18
- package/dist/client/assets/index-DUAtV_Av.js.br +0 -0
- package/dist/client/assets/index-DUAtV_Av.js.gz +0 -0
- package/dist/client/assets/preload-helper-BLdHbfdN.js +0 -1
- package/dist/client/assets/preload-helper-BLdHbfdN.js.br +0 -0
- package/dist/client/assets/preload-helper-BLdHbfdN.js.gz +0 -0
- package/dist/client/assets/refresh-cw-Dobx2YmO.js +0 -1
- package/dist/client/assets/tracker.worker-DWwj76VA.js +0 -41
- package/dist/client/assets/tracker.worker-DWwj76VA.js.br +0 -0
- package/dist/client/assets/tracker.worker-DWwj76VA.js.gz +0 -0
- package/dist/client/assets/vision_bundle-ByYCzljp.js +0 -41
- package/dist/client/assets/vision_bundle-ByYCzljp.js.br +0 -0
- package/dist/client/assets/vision_bundle-ByYCzljp.js.gz +0 -0
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{y as e}from"./brand-BcIB43Uo.js";var t={name:`eye-off`,size:24,node:[[`path`,{d:`M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49`,key:`ct8e1f`}],[`path`,{d:`M14.084 14.158a3 3 0 0 1-4.242-4.242`,key:`151rxh`}],[`path`,{d:`M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143`,key:`13bj9a`}],[`path`,{d:`m2 2 20 20`,key:`1ooewy`}]]};t.node;var n=e(t),r={name:`eye`,size:24,node:[[`path`,{d:`M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0`,key:`1nclc0`}],[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}]]};r.node;var i=e(r),a={name:`refresh-cw`,size:24,node:[[`path`,{d:`M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8`,key:`v9h5vc`}],[`path`,{d:`M21 3v5h-5`,key:`1q7to0`}],[`path`,{d:`M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16`,key:`3uifl3`}],[`path`,{d:`M8 16H3v5`,key:`1cv678`}]]};a.node;var o=e(a);export{i as n,n as r,o as t};
|
package/dist/client/index.html
CHANGED
|
@@ -14,12 +14,10 @@
|
|
|
14
14
|
document.documentElement.classList.toggle('dark', dark);
|
|
15
15
|
} catch {}
|
|
16
16
|
</script>
|
|
17
|
-
<script type="module" crossorigin src="/assets/index-
|
|
17
|
+
<script type="module" crossorigin src="/assets/index-D1ooswLS.js"></script>
|
|
18
18
|
<link rel="modulepreload" crossorigin href="/assets/cn-Wq33h1G4.js">
|
|
19
|
-
<link rel="modulepreload" crossorigin href="/assets/
|
|
20
|
-
<link rel="
|
|
21
|
-
<link rel="modulepreload" crossorigin href="/assets/confirm-D1U-bFIL.js">
|
|
22
|
-
<link rel="stylesheet" crossorigin href="/assets/index-BakNwOFF.css">
|
|
19
|
+
<link rel="modulepreload" crossorigin href="/assets/brand-BcIB43Uo.js">
|
|
20
|
+
<link rel="stylesheet" crossorigin href="/assets/index-BrM0s_jp.css">
|
|
23
21
|
</head>
|
|
24
22
|
<body>
|
|
25
23
|
<div id="root"></div>
|
|
Binary file
|
|
Binary file
|
package/dist/sample/package.json
CHANGED
package/dist/sample/src/App.tsx
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { useEffect, useState } from 'react';
|
|
2
2
|
import { Header } from './components/Header';
|
|
3
3
|
import { useRoute } from './lib/route';
|
|
4
|
+
import { Account } from './pages/Account';
|
|
4
5
|
import { Checkout } from './pages/Checkout';
|
|
5
6
|
import { Shop } from './pages/Shop';
|
|
6
7
|
|
|
@@ -15,13 +16,13 @@ export function App() {
|
|
|
15
16
|
}, [toast]);
|
|
16
17
|
|
|
17
18
|
useEffect(() => {
|
|
18
|
-
document.title = route === 'shop' ? 'Tidewell · Ceramics' : 'Tidewell · Checkout';
|
|
19
|
+
document.title = route === 'shop' ? 'Tidewell · Ceramics' : route === 'account' ? 'Tidewell · Account' : 'Tidewell · Checkout';
|
|
19
20
|
}, [route]);
|
|
20
21
|
|
|
21
22
|
return (
|
|
22
23
|
<div className="shell">
|
|
23
24
|
<Header route={route} />
|
|
24
|
-
{route === 'shop' ? <Shop onToast={setToast} /> : <Checkout onToast={setToast} />}
|
|
25
|
+
{route === 'shop' ? <Shop onToast={setToast} /> : route === 'account' ? <Account /> : <Checkout onToast={setToast} />}
|
|
25
26
|
{toast && (
|
|
26
27
|
<div className="toast" role="status">
|
|
27
28
|
{toast}
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { useEffect, useState } from 'react';
|
|
2
2
|
|
|
3
|
-
export type Route = 'checkout' | 'shop';
|
|
3
|
+
export type Route = 'checkout' | 'shop' | 'account';
|
|
4
4
|
|
|
5
5
|
function read(): Route {
|
|
6
|
-
|
|
6
|
+
const hash = window.location.hash;
|
|
7
|
+
return hash.startsWith('#/shop') ? 'shop' : hash.startsWith('#/account') ? 'account' : 'checkout';
|
|
7
8
|
}
|
|
8
9
|
|
|
9
10
|
export function useRoute(): Route {
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
import { useState } from 'react';
|
|
2
|
+
import { Button, Card, Heading, TextField } from '../ds';
|
|
3
|
+
|
|
4
|
+
/** The password the sample's sign-in takes (it is a sample: there is no account behind it). */
|
|
5
|
+
const SAMPLE_PASSWORD = 'tidewell-2026';
|
|
6
|
+
|
|
7
|
+
export function Account() {
|
|
8
|
+
const [email, setEmail] = useState('');
|
|
9
|
+
const [password, setPassword] = useState('');
|
|
10
|
+
const [show, setShow] = useState(false);
|
|
11
|
+
const [signedIn, setSignedIn] = useState<string | null>(null);
|
|
12
|
+
const [wrong, setWrong] = useState(false);
|
|
13
|
+
const [apiKey, setApiKey] = useState('');
|
|
14
|
+
const [delivery, setDelivery] = useState('standard');
|
|
15
|
+
const [interests, setInterests] = useState<string[]>([]);
|
|
16
|
+
const [saved, setSaved] = useState<string | null>(null);
|
|
17
|
+
|
|
18
|
+
return (
|
|
19
|
+
<main className="page">
|
|
20
|
+
<div className="page-head">
|
|
21
|
+
<Heading size="lg">Your account</Heading>
|
|
22
|
+
</div>
|
|
23
|
+
<div className="stack account">
|
|
24
|
+
<Card title="Sign in" padding="md">
|
|
25
|
+
{signedIn ? (
|
|
26
|
+
<p role="status" data-testid="signed-in">
|
|
27
|
+
Signed in as {signedIn}
|
|
28
|
+
</p>
|
|
29
|
+
) : (
|
|
30
|
+
<form
|
|
31
|
+
className="stack"
|
|
32
|
+
aria-label="Sign in"
|
|
33
|
+
onSubmit={(e) => {
|
|
34
|
+
e.preventDefault();
|
|
35
|
+
const ok = password === SAMPLE_PASSWORD;
|
|
36
|
+
setWrong(!ok);
|
|
37
|
+
if (ok) setSignedIn(email || 'you');
|
|
38
|
+
}}
|
|
39
|
+
>
|
|
40
|
+
<TextField label="Email" type="email" autoComplete="email" value={email} onChange={setEmail} />
|
|
41
|
+
<TextField label="Password" type={show ? 'text' : 'password'} autoComplete="current-password" value={password} onChange={setPassword} error={wrong ? 'That password isn’t right.' : undefined} />
|
|
42
|
+
<label className="check">
|
|
43
|
+
<input type="checkbox" checked={show} onChange={(e) => setShow(e.target.checked)} /> Show password
|
|
44
|
+
</label>
|
|
45
|
+
<Button type="submit">Sign in</Button>
|
|
46
|
+
</form>
|
|
47
|
+
)}
|
|
48
|
+
</Card>
|
|
49
|
+
<Card title="Preferences" padding="md">
|
|
50
|
+
<form
|
|
51
|
+
className="stack"
|
|
52
|
+
aria-label="Preferences"
|
|
53
|
+
onSubmit={(e) => {
|
|
54
|
+
e.preventDefault();
|
|
55
|
+
setSaved(`Saved: ${delivery === 'express' ? 'Express' : delivery === 'pickup' ? 'Pick up in store' : 'Standard'}${interests.length ? ` · ${interests.join(', ')}` : ''}`);
|
|
56
|
+
}}
|
|
57
|
+
>
|
|
58
|
+
<div className="ds-field">
|
|
59
|
+
<label htmlFor="delivery">Delivery</label>
|
|
60
|
+
<select id="delivery" className="ds-input" value={delivery} onChange={(e) => setDelivery(e.target.value)}>
|
|
61
|
+
<option value="standard">Standard</option>
|
|
62
|
+
<option value="express">Express</option>
|
|
63
|
+
<option value="pickup">Pick up in store</option>
|
|
64
|
+
</select>
|
|
65
|
+
</div>
|
|
66
|
+
<div className="ds-field">
|
|
67
|
+
<label htmlFor="interests">Interests</label>
|
|
68
|
+
<select id="interests" className="ds-input" multiple value={interests} onChange={(e) => setInterests(Array.from(e.target.selectedOptions, (o) => o.value))}>
|
|
69
|
+
<option value="Ceramics">Ceramics</option>
|
|
70
|
+
<option value="Linen">Linen</option>
|
|
71
|
+
<option value="Candles">Candles</option>
|
|
72
|
+
</select>
|
|
73
|
+
</div>
|
|
74
|
+
<TextField label="API key" value={apiKey} onChange={setApiKey} hint="For the wholesale catalogue." />
|
|
75
|
+
<Button type="submit" variant="secondary">
|
|
76
|
+
Save preferences
|
|
77
|
+
</Button>
|
|
78
|
+
{saved && (
|
|
79
|
+
<p role="status" data-testid="preferences-saved">
|
|
80
|
+
{saved}
|
|
81
|
+
</p>
|
|
82
|
+
)}
|
|
83
|
+
</form>
|
|
84
|
+
</Card>
|
|
85
|
+
</div>
|
|
86
|
+
</main>
|
|
87
|
+
);
|
|
88
|
+
}
|
|
@@ -153,3 +153,8 @@ button, input { font: inherit; color: inherit; }
|
|
|
153
153
|
.product-meta span { color: var(--ink-2); font-variant-numeric: tabular-nums; }
|
|
154
154
|
.product small { color: var(--ink-3); }
|
|
155
155
|
.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 999px; font-size: 14px; box-shadow: var(--shadow-md); }
|
|
156
|
+
|
|
157
|
+
/* Account: sign-in and preferences, one column. */
|
|
158
|
+
.account { max-width: 520px; }
|
|
159
|
+
.check { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ink-2); }
|
|
160
|
+
select.ds-input[multiple] { height: auto; padding: 6px 8px; }
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@saywright/studio",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.2.1",
|
|
4
4
|
"description": "Point at your running web app and say what to change. A studio on your computer for any web app: edits traced to the exact source line, Playwright tests from plain words, session reports, AI testing and accessibility reviews, with the AI you already have.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"developer-tools",
|
|
@@ -69,7 +69,6 @@
|
|
|
69
69
|
"@babel/parser": "^8.0.7",
|
|
70
70
|
"@fontsource-variable/geist": "^5.3.0",
|
|
71
71
|
"@fontsource-variable/geist-mono": "^5.3.0",
|
|
72
|
-
"@mediapipe/tasks-vision": "^1.1.0",
|
|
73
72
|
"@saywright/vite": "*",
|
|
74
73
|
"@tailwindcss/vite": "^4.3.3",
|
|
75
74
|
"@types/cross-spawn": "^6.0.6",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{i as e,o as t,r as n,t as r}from"./cn-Wq33h1G4.js";import{$ as i,K as a,Q as o,Z as s,i as c,o as l,r as u,rt as d,s as f,t as p}from"./button-B2NFEpCs.js";import{o as m,y as h}from"./index-DUAtV_Av.js";var g=t(e(),1),_=n(),v=.07,y=[{x:v,y:v,label:`top left`},{x:.9299999999999999,y:v,label:`top right`},{x:.9299999999999999,y:.9299999999999999,label:`bottom right`},{x:v,y:.9299999999999999,label:`bottom left`}],b=750,x=.014,S=.05;function C(e){if(e.length!==4)return null;let t=(e[0].x+e[3].x)/2,n=(e[1].x+e[2].x)/2,r=(e[0].y+e[1].y)/2,i=(e[2].y+e[3].y)/2,a=(n-t)/(1-2*v),o=(i-r)/(1-2*v);return a<.1||o<.08||a>1.4||o>1.4?null:{x0:t-v*a,x1:n+v*a,y0:r-v*o,y1:i+v*o}}function w(){let e=i(e=>e.overlay===`calibrate`),t=i(e=>e.camera.status),n=i(e=>e.hand.present),[v,w]=(0,g.useState)(0),[E,D]=(0,g.useState)(0),[O,k]=(0,g.useState)(null),A=(0,g.useRef)([]),j=(0,g.useRef)([]),M=(0,g.useRef)(!1),N=v>=4;(0,g.useEffect)(()=>{if(e)return a.calibrating=!0,w(0),D(0),k(null),A.current=[],j.current=[],t!==`on`&&a.startCamera(),()=>{a.calibrating=!1}},[e]),(0,g.useEffect)(()=>{if(!e||N)return;let t=e=>{let t=a.engine.state.landmarks;if(!a.engine.state.present||!t){j.current=[],D(0);return}let n={t:e.t,x:1-t[8].x,y:t[8].y},r=A.current[A.current.length-1];if(r&&Math.hypot(n.x-r.x,n.y-r.y)<S){j.current=[],D(0);return}for(j.current.push(n);j.current.length>1&&j.current[1].t<=e.t-b;)j.current.shift();let i=j.current.length,o=j.current.reduce((e,t)=>e+t.x,0)/i,s=j.current.reduce((e,t)=>e+t.y,0)/i,c=Math.max(...j.current.map(e=>Math.hypot(e.x-o,e.y-s))),l=j.current[i-1].t-j.current[0].t,u=a.engine.state.pinching,d=u&&!M.current;if(M.current=u,c>x){if(j.current=[n],D(0),!d)return}else D(Math.min(1,l/b));(d||c<=x&&l>=b)&&(A.current.push(d?{x:n.x,y:n.y}:{x:o,y:s}),j.current=[],D(0),w(e=>e+1))};return a.frameListeners.add(t),()=>void a.frameListeners.delete(t)},[e,N]),(0,g.useEffect)(()=>{if(!e||!N)return;let t=C(A.current);t?d.getState().setEngine({box:t}):k(`Those points were too close together. Point at each target with your whole arm, and try again.`)},[e,N]);let P=()=>{let e=s().calibrateReturn;o({overlay:e,calibrateReturn:null,...e===`onboarding`?{onboardingStep:s().onboardingStep+1}:{}})},F=()=>{A.current=[],j.current=[],k(null),D(0),w(0)};return(0,g.useEffect)(()=>{if(!e)return;let t=e=>{e.key===`Escape`&&o({overlay:s().calibrateReturn,calibrateReturn:null})};return window.addEventListener(`keydown`,t),()=>window.removeEventListener(`keydown`,t)},[e]),(0,_.jsx)(f,{children:e&&(0,_.jsxs)(l.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},className:`fixed inset-0 z-[90] bg-[#07080a]/92 backdrop-blur-md`,role:`dialog`,"aria-label":`Calibrate reach`,children:[y.map((e,t)=>(0,_.jsx)(T,{x:e.x,y:e.y,state:t<v?`done`:t===v&&!N?`active`:`idle`,progress:t===v?E:0},t)),(0,_.jsxs)(`div`,{className:`absolute left-1/2 top-1/2 w-[400px] -translate-x-1/2 -translate-y-1/2 text-center`,children:[(0,_.jsx)(`div`,{className:`mb-4 flex justify-center gap-1.5`,children:y.map((e,t)=>(0,_.jsx)(`span`,{className:r(`h-1 w-8 rounded-full transition-colors`,t<v?`bg-human`:`bg-white/15`)},t))}),O?(0,_.jsxs)(_.Fragment,{children:[(0,_.jsx)(`h2`,{className:`text-[18px] font-semibold text-white`,children:`Let’s try that again`}),(0,_.jsx)(`p`,{className:`mt-2 text-[13px] leading-relaxed text-white/65`,children:O}),(0,_.jsxs)(`div`,{className:`mt-5 flex justify-center gap-2`,children:[(0,_.jsx)(p,{variant:`ghost`,className:`text-white/70 hover:text-white`,onClick:P,children:`Cancel`}),(0,_.jsx)(p,{variant:`human`,onClick:F,children:`Try again`})]})]}):N?(0,_.jsxs)(_.Fragment,{children:[(0,_.jsx)(`div`,{className:`mx-auto mb-3 flex size-10 items-center justify-center rounded-full bg-human text-[#1b1203]`,children:(0,_.jsx)(c,{className:`size-5`})}),(0,_.jsx)(`h2`,{className:`text-[18px] font-semibold text-white`,children:`Reach calibrated`}),(0,_.jsx)(`p`,{className:`mt-2 text-[13px] leading-relaxed text-white/65`,children:`Your comfortable pointing area now covers the whole screen.`}),(0,_.jsxs)(`div`,{className:`mt-5 flex justify-center gap-2`,children:[(0,_.jsx)(p,{variant:`ghost`,className:`text-white/70 hover:text-white`,onClick:F,children:`Redo`}),(0,_.jsx)(p,{variant:`human`,onClick:P,children:`Continue`})]})]}):(0,_.jsxs)(_.Fragment,{children:[(0,_.jsxs)(`h2`,{className:`text-[18px] font-semibold text-white`,children:[`Point at the `,y[v].label,` target`]}),(0,_.jsx)(`p`,{className:`mt-2 text-[13px] leading-relaxed text-white/65`,children:t===`on`?n?`Aim where it feels natural, then hold still for a moment, or pinch.`:`Raise one hand so the camera can see it.`:`Starting the camera…`}),(0,_.jsx)(m,{className:`mx-auto mt-5 h-[120px] w-[160px] rounded-[12px] ring-1 ring-white/10`,box:!1}),(0,_.jsxs)(`p`,{className:`mt-5 text-[12px] text-white/40`,children:[(0,_.jsx)(h,{tone:`onDark`,children:`Esc`}),` to cancel`]})]})]}),(0,_.jsx)(`button`,{"data-hand":!0,onClick:()=>o({overlay:s().calibrateReturn,calibrateReturn:null}),className:`absolute right-5 top-5 rounded-[8px] p-2 text-white/50 hover:bg-white/10 hover:text-white`,"aria-label":`Close`,children:(0,_.jsx)(u,{className:`size-4`})})]},`calibrate`)})}function T({x:e,y:t,state:n,progress:r}){let i=2*Math.PI*26;return(0,_.jsx)(`div`,{className:`absolute -translate-x-1/2 -translate-y-1/2`,style:{left:`${e*100}%`,top:`${t*100}%`},children:(0,_.jsxs)(l.svg,{width:`76`,height:`76`,viewBox:`0 0 76 76`,animate:{scale:n===`active`?1:.8,opacity:n===`idle`?.35:1},transition:{type:`spring`,stiffness:400,damping:28},children:[(0,_.jsx)(`circle`,{cx:`38`,cy:`38`,r:26,fill:`none`,stroke:n===`done`?`#3dd68c`:`rgba(255,255,255,.25)`,strokeWidth:`2`}),n===`active`&&(0,_.jsx)(`circle`,{cx:`38`,cy:`38`,r:26,fill:`none`,stroke:`#ffb224`,strokeWidth:`4`,strokeLinecap:`round`,strokeDasharray:i,strokeDashoffset:i*(1-r),transform:`rotate(-90 38 38)`}),n===`done`?(0,_.jsx)(`path`,{d:`M30 38.5l5.5 5.5 11-12`,fill:`none`,stroke:`#3dd68c`,strokeWidth:`3`,strokeLinecap:`round`,strokeLinejoin:`round`}):(0,_.jsxs)(_.Fragment,{children:[(0,_.jsx)(`circle`,{cx:`38`,cy:`38`,r:`4`,fill:n===`active`?`#ffb224`:`rgba(255,255,255,.5)`}),n===`active`&&(0,_.jsx)(`circle`,{cx:`38`,cy:`38`,r:`12`,fill:`none`,stroke:`#ffb224`,strokeOpacity:`.5`,strokeWidth:`1.5`,className:`origin-center animate-ping`})]})]})})}export{w as Calibration};
|
|
Binary file
|
|
Binary file
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{i as e,o as t,r as n}from"./cn-Wq33h1G4.js";import{C as r,E as i,G as a,R as o,T as s,Y as c,d as l,f as u,p as d,r as f,w as p}from"./confirm-D1U-bFIL.js";import{$ as m,At as h,K as g,Ot as _,Q as v,a as y,at as b,i as ee,it as x,jt as S,nt as C,q as w,rt as T}from"./button-B2NFEpCs.js";import{n as te,t as E}from"./camera-BD9K1f5I.js";import{t as D}from"./footprints-DiYtIryA.js";import{$ as O,A as ne,C as k,F as A,G as j,I as M,L as re,N as ie,O as ae,R as N,S as oe,V as se,Z as ce,at as le,b as ue,ct as de,i as P,j as fe,k as pe,nt as me,ot as he,r as ge,st as _e,t as ve,tt as ye,y as F,z as be}from"./index-DUAtV_Av.js";var I={name:`eraser`,size:24,node:[[`path`,{d:`M21 21H8a2 2 0 0 1-1.42-.587l-3.994-3.999a2 2 0 0 1 0-2.828l10-10a2 2 0 0 1 2.829 0l5.999 6a2 2 0 0 1 0 2.828L12.834 21`,key:`g5wo59`}],[`path`,{d:`m5.082 11.09 8.828 8.828`,key:`1wx5vj`}]]};I.node;var xe=y(I),L={name:`moon`,size:24,node:[[`path`,{d:`M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401`,key:`kfwtm`}]]};L.node;var Se=y(L),R={name:`rotate-ccw-clock`,size:24,node:[[`path`,{d:`M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8`,key:`1357e3`}],[`path`,{d:`M3 3v5h5`,key:`1xhq8a`}],[`path`,{d:`M12 7v5l4 2`,key:`1fdv2h`}]],aliases:[`history`]};R.node;var Ce=y(R),z={name:`send-horizontal`,size:24,node:[[`path`,{d:`M3.714 3.048a.498.498 0 0 0-.683.627l2.843 7.627a2 2 0 0 1 0 1.396l-2.842 7.627a.498.498 0 0 0 .682.627l18-8.5a.5.5 0 0 0 0-.904z`,key:`117uat`}],[`path`,{d:`M6 12h16`,key:`s4cdu5`}]],aliases:[`send-horizonal`]};z.node;var we=y(z),B={name:`sun`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`4`,key:`4exip2`}],[`path`,{d:`M12 2v2`,key:`tus03m`}],[`path`,{d:`M12 20v2`,key:`1lh1kg`}],[`path`,{d:`m4.93 4.93 1.41 1.41`,key:`149t6j`}],[`path`,{d:`m17.66 17.66 1.41 1.41`,key:`ptbguv`}],[`path`,{d:`M2 12h2`,key:`1t8f8n`}],[`path`,{d:`M20 12h2`,key:`1q8mjw`}],[`path`,{d:`m6.34 17.66-1.41 1.41`,key:`1m8zz5`}],[`path`,{d:`m19.07 4.93-1.41 1.41`,key:`1shlcs`}]]};B.node;var Te=y(B),V=1,Ee=.9,De=.8,Oe=.17,ke=.1,Ae=.999,je=.9999,Me=.99,Ne=/[\\\/_+.#"@\[\(\{&]/,Pe=/[\\\/_+.#"@\[\(\{&]/g,Fe=/[\s-]/,Ie=/[\s-]/g;function Le(e,t,n,r,i,a,o){if(a===t.length)return i===e.length?V:Me;var s=`${i},${a}`;if(o[s]!==void 0)return o[s];for(var c=r.charAt(a),l=n.indexOf(c,i),u=0,d,f,p,m;l>=0;)d=Le(e,t,n,r,l+1,a+1,o),d>u&&(l===i?d*=V:Ne.test(e.charAt(l-1))?(d*=De,p=e.slice(i,l-1).match(Pe),p&&i>0&&(d*=Ae**+p.length)):Fe.test(e.charAt(l-1))?(d*=Ee,m=e.slice(i,l-1).match(Ie),m&&i>0&&(d*=Ae**+m.length)):(d*=Oe,i>0&&(d*=Ae**+(l-i))),e.charAt(l)!==t.charAt(a)&&(d*=je)),(d<ke&&n.charAt(l-1)===r.charAt(a+1)||r.charAt(a+1)===r.charAt(a)&&n.charAt(l-1)!==r.charAt(a))&&(f=Le(e,t,n,r,l+1,a+2,o),f*ke>d&&(d=f*ke)),d>u&&(u=d),l=n.indexOf(c,l+1);return o[s]=u,u}function Re(e){return e.toLowerCase().replace(Ie,` `)}function ze(e,t,n){return e=n&&n.length>0?`${e+` `+n.join(` `)}`:e,Le(e,t,Re(e),Re(t),0,0,{})}var H=t(e(),1),U=`[cmdk-group=""]`,Be=`[cmdk-group-items=""]`,Ve=`[cmdk-group-heading=""]`,He=`[cmdk-item=""]`,Ue=`${He}:not([aria-disabled="true"])`,We=`cmdk-item-select`,W=`data-value`,Ge=(e,t,n)=>ze(e,t,n),Ke=H.createContext(void 0),G=()=>H.useContext(Ke),qe=H.createContext(void 0),Je=()=>H.useContext(qe),Ye=H.createContext(void 0),Xe=H.forwardRef((e,t)=>{let n=J(()=>({search:``,value:e.value??e.defaultValue??``,selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}})),r=J(()=>new Set),i=J(()=>new Map),s=J(()=>new Map),c=J(()=>new Set),l=st(e),{label:u,children:d,value:f,onValueChange:p,filter:m,shouldFilter:h,loop:g,disablePointerSelection:_=!1,vimBindings:v=!0,...y}=e,b=o(),ee=o(),x=o(),S=H.useRef(null),C=lt();q(()=>{if(f!==void 0){let e=f.trim();n.current.value=e,w.emit()}},[f]),q(()=>{C(6,ne)},[]);let w=H.useMemo(()=>({subscribe:e=>(c.current.add(e),()=>c.current.delete(e)),snapshot:()=>n.current,setState:(e,t,r)=>{var i,a,o;if(!Object.is(n.current[e],t)){if(n.current[e]=t,e===`search`)O(),E(),C(1,D);else if(e===`value`){if(document.activeElement.hasAttribute(`cmdk-input`)||document.activeElement.hasAttribute(`cmdk-root`)){let e=document.getElementById(x);e?e.focus():(i=document.getElementById(b))==null||i.focus()}if(C(7,()=>{n.current.selectedItemId=k()?.id,w.emit()}),r||C(5,ne),l.current?.value!==void 0){let e=t??``;(o=(a=l.current).onValueChange)==null||o.call(a,e);return}}w.emit()}},emit:()=>{c.current.forEach(e=>e())}}),[]),T=H.useMemo(()=>({value:(e,t,r)=>{t!==s.current.get(e)?.value&&(s.current.set(e,{value:t,keywords:r}),n.current.filtered.items.set(e,te(t,r)),C(2,()=>{E(),w.emit()}))},item:(e,t)=>(r.current.add(e),t&&(i.current.has(t)?i.current.get(t).add(e):i.current.set(t,new Set([e]))),C(3,()=>{O(),E(),n.current.value||D(),w.emit()}),()=>{s.current.delete(e),r.current.delete(e),n.current.filtered.items.delete(e);let t=k();C(4,()=>{O(),t?.getAttribute(`id`)===e&&D(),w.emit()})}),group:e=>(i.current.has(e)||i.current.set(e,new Set),()=>{s.current.delete(e),i.current.delete(e)}),filter:()=>l.current.shouldFilter,label:u||e[`aria-label`],getDisablePointerSelection:()=>l.current.disablePointerSelection,listId:b,inputId:x,labelId:ee,listInnerRef:S}),[]);function te(e,t){let r=l.current?.filter??Ge;return e?r(e,n.current.search,t):0}function E(){if(!n.current.search||l.current.shouldFilter===!1)return;let e=n.current.filtered.items,t=[];n.current.filtered.groups.forEach(n=>{let r=i.current.get(n),a=0;r.forEach(t=>{let n=e.get(t);a=Math.max(n,a)}),t.push([n,a])});let r=S.current;A().sort((t,n)=>{let r=t.getAttribute(`id`),i=n.getAttribute(`id`);return(e.get(i)??0)-(e.get(r)??0)}).forEach(e=>{let t=e.closest(Be);t?t.appendChild(e.parentElement===t?e:e.closest(`${Be} > *`)):r.appendChild(e.parentElement===r?e:e.closest(`${Be} > *`))}),t.sort((e,t)=>t[1]-e[1]).forEach(e=>{let t=S.current?.querySelector(`${U}[${W}="${encodeURIComponent(e[0])}"]`);t?.parentElement.appendChild(t)})}function D(){let e=A().find(e=>e.getAttribute(`aria-disabled`)!==`true`)?.getAttribute(W);w.setState(`value`,e||void 0)}function O(){if(!n.current.search||l.current.shouldFilter===!1){n.current.filtered.count=r.current.size;return}n.current.filtered.groups=new Set;let e=0;for(let t of r.current){let r=te(s.current.get(t)?.value??``,s.current.get(t)?.keywords??[]);n.current.filtered.items.set(t,r),r>0&&e++}for(let[e,t]of i.current)for(let r of t)if(n.current.filtered.items.get(r)>0){n.current.filtered.groups.add(e);break}n.current.filtered.count=e}function ne(){var e;let t=k();t&&(t.parentElement?.firstChild===t&&((e=t.closest(U)?.querySelector(Ve))==null||e.scrollIntoView({block:`nearest`})),t.scrollIntoView({block:`nearest`}))}function k(){return S.current?.querySelector(`${He}[aria-selected="true"]`)}function A(){return Array.from(S.current?.querySelectorAll(Ue)||[])}function j(e){let t=A()[e];t&&w.setState(`value`,t.getAttribute(W))}function M(e){var t;let n=k(),r=A(),i=r.findIndex(e=>e===n),a=r[i+e];(t=l.current)!=null&&t.loop&&(a=i+e<0?r[r.length-1]:i+e===r.length?r[0]:r[i+e]),a&&w.setState(`value`,a.getAttribute(W))}function re(e){let t=k()?.closest(U),n;for(;t&&!n;)t=e>0?at(t,U):ot(t,U),n=t?.querySelector(Ue);n?w.setState(`value`,n.getAttribute(W)):M(e)}let ie=()=>j(A().length-1),ae=e=>{e.preventDefault(),e.metaKey?ie():e.altKey?re(1):M(1)},N=e=>{e.preventDefault(),e.metaKey?j(0):e.altKey?re(-1):M(-1)};return H.createElement(a.div,{ref:t,tabIndex:-1,...y,"cmdk-root":``,onKeyDown:e=>{var t;(t=y.onKeyDown)==null||t.call(y,e);let n=e.nativeEvent.isComposing||e.keyCode===229;if(!(e.defaultPrevented||n))switch(e.key){case`n`:case`j`:v&&e.ctrlKey&&ae(e);break;case`ArrowDown`:ae(e);break;case`p`:case`k`:v&&e.ctrlKey&&N(e);break;case`ArrowUp`:N(e);break;case`Home`:e.preventDefault(),j(0);break;case`End`:e.preventDefault(),ie();break;case`Enter`:{e.preventDefault();let t=k();if(t){let e=new Event(We);t.dispatchEvent(e)}}}}},H.createElement(`label`,{"cmdk-label":``,htmlFor:T.inputId,id:T.labelId,style:dt},u),X(e,e=>H.createElement(qe.Provider,{value:w},H.createElement(Ke.Provider,{value:T},e))))}),Ze=H.forwardRef((e,t)=>{let n=o(),r=H.useRef(null),i=H.useContext(Ye),s=G(),l=st(e),u=l.current?.forceMount??i?.forceMount;q(()=>{if(!u)return s.item(n,i?.id)},[u]);let d=ct(n,r,[e.value,e.children,r],e.keywords),f=Je(),p=Y(e=>e.value&&e.value===d.current),m=Y(e=>u||s.filter()===!1?!0:!e.search||e.filtered.items.get(n)>0);H.useEffect(()=>{let t=r.current;if(t&&!e.disabled)return t.addEventListener(We,h),()=>t.removeEventListener(We,h)},[m,e.onSelect,e.disabled]);function h(){var e,t;g(),(t=(e=l.current).onSelect)==null||t.call(e,d.current)}function g(){f.setState(`value`,d.current,!0)}if(!m)return null;let{disabled:_,value:v,onSelect:y,forceMount:b,keywords:ee,...x}=e;return H.createElement(a.div,{ref:c(r,t),...x,id:n,"cmdk-item":``,role:`option`,"aria-disabled":!!_,"aria-selected":!!p,"data-disabled":!!_,"data-selected":!!p,onPointerMove:_||s.getDisablePointerSelection()?void 0:g,onClick:_?void 0:h},e.children)}),Qe=H.forwardRef((e,t)=>{let{heading:n,children:r,forceMount:i,...s}=e,l=o(),u=H.useRef(null),d=H.useRef(null),f=o(),p=G(),m=Y(e=>i||p.filter()===!1?!0:!e.search||e.filtered.groups.has(l));q(()=>p.group(l),[]),ct(l,u,[e.value,e.heading,d]);let h=H.useMemo(()=>({id:l,forceMount:i}),[i]);return H.createElement(a.div,{ref:c(u,t),...s,"cmdk-group":``,role:`presentation`,hidden:!m||void 0},n&&H.createElement(`div`,{ref:d,"cmdk-group-heading":``,"aria-hidden":!0,id:f},n),X(e,e=>H.createElement(`div`,{"cmdk-group-items":``,role:`group`,"aria-labelledby":n?f:void 0},H.createElement(Ye.Provider,{value:h},e))))}),$e=H.forwardRef((e,t)=>{let{alwaysRender:n,...r}=e,i=H.useRef(null),o=Y(e=>!e.search);return!n&&!o?null:H.createElement(a.div,{ref:c(i,t),...r,"cmdk-separator":``,role:`separator`})}),et=H.forwardRef((e,t)=>{let{onValueChange:n,...r}=e,i=e.value!=null,o=Je(),s=Y(e=>e.search),c=Y(e=>e.selectedItemId),l=G();return H.useEffect(()=>{e.value!=null&&o.setState(`search`,e.value)},[e.value]),H.createElement(a.input,{ref:t,...r,"cmdk-input":``,autoComplete:`off`,autoCorrect:`off`,spellCheck:!1,"aria-autocomplete":`list`,role:`combobox`,"aria-expanded":!0,"aria-controls":l.listId,"aria-labelledby":l.labelId,"aria-activedescendant":c,id:l.inputId,type:`text`,value:i?e.value:s,onChange:e=>{i||o.setState(`search`,e.target.value),n?.(e.target.value)}})}),tt=H.forwardRef((e,t)=>{let{children:n,label:r=`Suggestions`,...i}=e,o=H.useRef(null),s=H.useRef(null),l=Y(e=>e.selectedItemId),u=G();return H.useEffect(()=>{if(s.current&&o.current){let e=s.current,t=o.current,n,r=new ResizeObserver(()=>{n=requestAnimationFrame(()=>{let n=e.offsetHeight;t.style.setProperty(`--cmdk-list-height`,n.toFixed(1)+`px`)})});return r.observe(e),()=>{cancelAnimationFrame(n),r.unobserve(e)}}},[]),H.createElement(a.div,{ref:c(o,t),...i,"cmdk-list":``,role:`listbox`,tabIndex:-1,"aria-activedescendant":l,"aria-label":r,id:u.listId},X(e,e=>H.createElement(`div`,{ref:c(s,u.listInnerRef),"cmdk-list-sizer":``},e)))}),nt=H.forwardRef((e,t)=>{let{open:n,onOpenChange:a,overlayClassName:o,contentClassName:c,container:l,...u}=e;return H.createElement(r,{open:n,onOpenChange:a},H.createElement(i,{container:l},H.createElement(s,{"cmdk-overlay":``,className:o}),H.createElement(p,{"aria-label":e.label,"cmdk-dialog":``,className:c},H.createElement(Xe,{ref:t,...u}))))}),rt=H.forwardRef((e,t)=>Y(e=>e.filtered.count===0)?H.createElement(a.div,{ref:t,...e,"cmdk-empty":``,role:`presentation`}):null),it=H.forwardRef((e,t)=>{let{progress:n,children:r,label:i=`Loading...`,...o}=e;return H.createElement(a.div,{ref:t,...o,"cmdk-loading":``,role:`progressbar`,"aria-valuenow":n,"aria-valuemin":0,"aria-valuemax":100,"aria-label":i},X(e,e=>H.createElement(`div`,{"aria-hidden":!0},e)))}),K=Object.assign(Xe,{List:tt,Item:Ze,Input:et,Group:Qe,Separator:$e,Dialog:nt,Empty:rt,Loading:it});function at(e,t){let n=e.nextElementSibling;for(;n;){if(n.matches(t))return n;n=n.nextElementSibling}}function ot(e,t){let n=e.previousElementSibling;for(;n;){if(n.matches(t))return n;n=n.previousElementSibling}}function st(e){let t=H.useRef(e);return q(()=>{t.current=e}),t}var q=typeof window>`u`?H.useEffect:H.useLayoutEffect;function J(e){let t=H.useRef();return t.current===void 0&&(t.current=e()),t}function Y(e){let t=Je(),n=()=>e(t.snapshot());return H.useSyncExternalStore(t.subscribe,n,n)}function ct(e,t,n,r=[]){let i=H.useRef(),a=G();return q(()=>{var o;let s=(()=>{for(let e of n){if(typeof e==`string`)return e.trim();if(typeof e==`object`&&`current`in e)return e.current?e.current.textContent?.trim():i.current}})(),c=r.map(e=>e.trim());a.value(e,s,c),(o=t.current)==null||o.setAttribute(W,s),i.current=s}),i}var lt=()=>{let[e,t]=H.useState(),n=J(()=>new Map);return q(()=>{n.current.forEach(e=>e()),n.current=new Map},[e]),(e,r)=>{n.current.set(e,r),t({})}};function ut(e){let t=e.type;return typeof t==`function`?t(e.props):`render`in t?t.render(e.props):e}function X({asChild:e,children:t},n){return e&&H.isValidElement(t)?H.cloneElement(ut(t),{ref:t.ref},n(t.props.children)):n(t)}var dt={position:`absolute`,width:`1px`,height:`1px`,padding:`0`,margin:`-1px`,overflow:`hidden`,clip:`rect(0, 0, 0, 0)`,whiteSpace:`nowrap`,borderWidth:`0`},Z=n();function Q({icon:e,children:t,onSelect:n,kbd:r,value:i,keywords:a}){return(0,Z.jsxs)(K.Item,{value:i,keywords:a,onSelect:n,"data-hand":!0,className:`flex h-9 cursor-default items-center gap-3 rounded-[8px] px-2.5 text-[13px] text-fg-2 data-[selected=true]:bg-hover data-[selected=true]:text-fg [&_svg]:size-[15px] [&_svg]:text-fg-3`,children:[e,(0,Z.jsx)(`span`,{className:`flex-1 truncate`,children:t}),r&&(0,Z.jsx)(F,{children:r})]})}function $({heading:e,children:t}){return(0,Z.jsx)(K.Group,{heading:e,className:`px-1.5 pb-1 [&_[cmdk-group-heading]]:px-2.5 [&_[cmdk-group-heading]]:pb-1 [&_[cmdk-group-heading]]:pt-2.5 [&_[cmdk-group-heading]]:text-[11.5px] [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-fg-3`,children:t})}var ft=e=>T.getState().setUi({panelOpen:!0,panelTab:e}),pt=(e,t,n)=>{let r=Ge(e,t,n);return r<.2?0:r};function mt(){let e=m(e=>e.overlay===`palette`),t=m(e=>e.changes.some(e=>e.status===`preview`)),n=m(e=>!!e.selection),r=m(e=>!!e.status?.app),i=m(e=>e.status?.app?.id??null),a=m(e=>e.camera.status),o=C(),s=m(e=>e.recorder),c=b(e=>e.live.status===`recording`),p=S(e=>e.apps),y=T(e=>e.theme),I=w(),[L,R]=(0,H.useState)(``),z=()=>{v({overlay:null}),R(``)},B=e=>()=>{z(),setTimeout(e,0)},V=L.trim(),Ee=B(()=>void g.handleUtterance(V,null,`typed`));return(0,Z.jsx)(f,{open:e,onOpenChange:e=>e?v({overlay:`palette`}):z(),title:`Command palette`,position:`top`,focusFirst:!0,className:`w-[min(600px,calc(100vw-32px))]`,children:(0,Z.jsxs)(K,{loop:!0,filter:pt,className:`flex min-h-0 flex-col`,onKeyDown:e=>{e.key===`Enter`&&(e.metaKey||e.ctrlKey)&&(e.preventDefault(),V&&Ee())},children:[(0,Z.jsxs)(`div`,{className:`flex items-center gap-2.5 border-b border-line px-3.5`,children:[(0,Z.jsx)(fe,{className:`size-4 text-fg-3`}),(0,Z.jsx)(K.Input,{value:L,onValueChange:R,autoFocus:!0,placeholder:`Search commands…`,className:`h-12 flex-1 bg-transparent text-[14px] text-fg outline-none placeholder:text-fg-3`}),(0,Z.jsx)(F,{children:`Esc`})]}),(0,Z.jsxs)(K.List,{className:`max-h-[380px] overflow-y-auto py-1`,children:[(0,Z.jsxs)(K.Empty,{className:`px-4 py-6 text-center text-[12.5px] text-fg-3`,children:[`No command matches “`,V,`”.`]}),t&&(0,Z.jsxs)($,{heading:`Preview`,children:[(0,Z.jsx)(Q,{icon:(0,Z.jsx)(ee,{}),kbd:`↵`,onSelect:B(()=>void g.keep(`palette`)),keywords:[`keep`,`accept`],children:`Keep the preview`}),(0,Z.jsx)(Q,{icon:(0,Z.jsx)(k,{}),kbd:_(`mod+z`),onSelect:B(()=>void g.undo(`palette`)),keywords:[`undo`,`revert`],children:`Undo the preview`})]}),r&&(0,Z.jsxs)($,{heading:`Modes`,children:[(0,Z.jsxs)(Q,{icon:(0,Z.jsx)(pe,{}),kbd:`E`,onSelect:B(()=>g.setMode(`edit`)),children:[P.edit,`: point and change`]}),(0,Z.jsxs)(Q,{icon:(0,Z.jsx)(re,{}),kbd:`U`,onSelect:B(()=>g.setMode(`use`)),children:[P.use,`: click through the app`]}),(0,Z.jsxs)(Q,{icon:(0,Z.jsx)(d,{}),kbd:`R`,onSelect:B(()=>g.setMode(`record`)),keywords:[`record a bug`,`playwright`,`check`],children:[P.record,`: narrate a bug, get a Playwright test`]})]}),r&&(0,Z.jsxs)($,{heading:`Test and review`,children:[c?(0,Z.jsx)(Q,{icon:(0,Z.jsx)(ae,{}),onSelect:B(()=>void x.stop()),keywords:[`record session`,`test session`],children:`Stop recording and write the report`}):(0,Z.jsx)(Q,{icon:(0,Z.jsx)(me,{}),onSelect:B(()=>b.setState({setup:!0})),keywords:[`test session`,`report`,`recording`],children:`Record session: use the app, get a report`}),(0,Z.jsx)(Q,{icon:(0,Z.jsx)(l,{}),onSelect:B(()=>(ft(`experts`),void ue.run())),keywords:[`experts`,`audit`,`accessibility`,`seo`,`ux`,`content`],children:`Review this page with the Experts`}),(0,Z.jsx)(Q,{icon:(0,Z.jsx)(oe,{}),onSelect:B(()=>(ft(`sessions`),setTimeout(()=>document.querySelector(`[data-autopilot-goal]`)?.focus(),250))),keywords:[`autopilot`,`explore`,`ai tester`],children:`Autopilot: let the AI test your app…`}),(0,Z.jsx)(Q,{icon:(0,Z.jsx)(Ce,{}),onSelect:B(()=>ft(`sessions`)),keywords:[`reports`,`recordings`],children:`Sessions and their reports`}),(s.expectations.length>0||s.spec)&&(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(Q,{icon:(0,Z.jsx)(oe,{}),onSelect:B(()=>void g.generateTest()),children:`Generate test`}),(0,Z.jsx)(Q,{icon:(0,Z.jsx)(A,{}),onSelect:B(()=>void g.runTest()),children:`Run test`}),s.run?.status===`failed`&&(0,Z.jsxs)(Q,{icon:(0,Z.jsx)(l,{}),onSelect:B(()=>void g.fix()),children:[`Fix with `,I]})]})]}),n&&(0,Z.jsxs)($,{heading:`Selection`,children:[(0,Z.jsx)(Q,{icon:(0,Z.jsx)(le,{}),kbd:`↑`,onSelect:B(()=>void g.step(`parent`)),children:`Select what contains it`}),(0,Z.jsx)(Q,{icon:(0,Z.jsx)(_e,{}),kbd:`↓`,onSelect:B(()=>void g.step(`child`)),children:`Select inside it`}),(0,Z.jsx)(Q,{icon:(0,Z.jsx)(he,{}),kbd:`→`,onSelect:B(()=>void g.step(`next`)),children:`Select the next one`}),(0,Z.jsx)(Q,{icon:(0,Z.jsx)(te,{}),kbd:`←`,onSelect:B(()=>void g.step(`prev`)),children:`Select the previous one`}),(0,Z.jsx)(Q,{icon:(0,Z.jsx)(O,{}),kbd:`O`,onSelect:B(()=>void g.openInEditor()),children:`Open in editor`}),(0,Z.jsx)(Q,{icon:(0,Z.jsx)(xe,{}),kbd:`Esc`,onSelect:B(()=>g.clearTargets()),children:`Clear the selection`})]}),(0,Z.jsxs)($,{heading:o?`Hand and voice`:`Voice`,children:[o&&(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(Q,{icon:(0,Z.jsx)(E,{}),kbd:`C`,onSelect:B(()=>g.toggleCamera()),children:a===`on`?`Turn off hand control`:`Turn on hand control`}),(0,Z.jsx)(Q,{icon:(0,Z.jsx)(ce,{}),onSelect:B(()=>v({overlay:`calibrate`,calibrateReturn:null})),children:`Calibrate reach`})]}),(0,Z.jsx)(Q,{icon:(0,Z.jsx)(be,{}),kbd:`Space`,onSelect:B(()=>g.startTalk(`toggle`)),children:`Start talking (hands-free)`})]}),(0,Z.jsxs)($,{heading:`Apps`,children:[r&&(0,Z.jsx)(Q,{icon:(0,Z.jsx)(ie,{}),onSelect:B(()=>g.reloadApp()),children:`Reload the app`}),p.filter(e=>e.id!==i).map(e=>(0,Z.jsxs)(Q,{value:`switch ${e.id} ${e.name}`,icon:(0,Z.jsx)(de,{}),onSelect:B(()=>void h.open(e.id)),keywords:[`switch`,`open`,e.name],children:[`Switch to `,e.name]},e.id)),(0,Z.jsx)(Q,{icon:(0,Z.jsx)(u,{}),onSelect:B(()=>h.show(`folder`)),keywords:[`add`,`folder`,`address`,`github`],children:`Link an app…`}),(0,Z.jsx)(Q,{icon:(0,Z.jsx)(se,{}),onSelect:B(()=>h.show()),children:`All apps`}),r&&Object.keys(ge).map(e=>(0,Z.jsxs)(Q,{icon:(0,Z.jsx)(N,{}),onSelect:B(()=>T.getState().setUi({device:e})),children:[`Viewport: `,ge[e].label]},e))]}),(0,Z.jsxs)($,{heading:`Studio`,children:[(0,Z.jsx)(Q,{icon:(0,Z.jsx)(M,{}),kbd:`\\`,onSelect:B(()=>T.getState().setUi({panelOpen:!T.getState().ui.panelOpen})),children:`Toggle panel`}),(0,Z.jsx)(Q,{icon:y===`light`?(0,Z.jsx)(Se,{}):(0,Z.jsx)(Te,{}),onSelect:B(()=>T.getState().set({theme:y===`light`?`dark`:`light`})),children:y===`light`?`Dark theme`:`Light theme`}),(0,Z.jsx)(Q,{icon:(0,Z.jsx)(ne,{}),onSelect:B(()=>v({overlay:`settings`,settingsTab:`general`})),keywords:[`preferences`,`options`],children:`Settings`}),(0,Z.jsx)(Q,{icon:(0,Z.jsx)(l,{}),onSelect:B(()=>v({overlay:`settings`,settingsTab:`ai`})),keywords:[`connect`,`api key`,`model`,`claude`,`chatgpt`,`gemini`],children:`Settings: connect an AI`}),(0,Z.jsx)(Q,{icon:(0,Z.jsx)(j,{}),onSelect:B(()=>v({overlay:`settings`,settingsTab:`usage`})),keywords:[`cost`,`budget`,`spend`,`money`],children:`Settings: usage and budget`}),(0,Z.jsx)(Q,{icon:(0,Z.jsx)(ye,{}),kbd:`?`,onSelect:B(()=>v({overlay:`help`})),keywords:[`help`,`keys`],children:o?`Gestures, phrases and shortcuts`:`Phrases and shortcuts`}),(0,Z.jsx)(Q,{icon:(0,Z.jsx)(D,{}),onSelect:B(()=>ve.start()),keywords:[`tour`,`intro`,`getting started`,`onboarding`,`learn`],children:`Take the quick-start tour`})]})]}),V&&(0,Z.jsxs)(`button`,{"data-hand":!0,onClick:Ee,className:`flex h-11 shrink-0 items-center gap-3 border-t border-line px-4 text-start text-[13px] text-fg-2 hover:bg-hover hover:text-fg [&_svg]:size-[15px]`,"data-send-request":!0,children:[(0,Z.jsx)(we,{className:`shrink-0 text-ai-fg`}),(0,Z.jsxs)(`span`,{className:`min-w-0 flex-1 truncate`,children:[`Send as a request: “`,V,`” `,(0,Z.jsxs)(`span`,{className:`text-fg-3`,children:[`· a quick edit, or `,I===`AI`?`the AI`:I]})]}),(0,Z.jsx)(F,{children:_(`mod+enter`)})]})]})})}export{mt as CommandPalette};
|
|
Binary file
|
|
Binary file
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as e,t}from"./cn-Wq33h1G4.js";import{r as n}from"./confirm-D1U-bFIL.js";import{$ as r,Q as i,n as a,nt as o,r as s,t as c}from"./button-B2NFEpCs.js";import{t as l}from"./footprints-DiYtIryA.js";import{D as u,E as d,H as f,U as p,W as m,c as h,l as g,s as _,t as v,y}from"./index-DUAtV_Av.js";import{shortcutsFor as b}from"./SettingsDialog-VrACcdUX.js";var x=e(),S=[[(0,x.jsx)(g,{}),`Point`,`Move the cursor with your index finger.`],[(0,x.jsx)(h,{}),`Pinch`,`Edit mode: select what is highlighted; pinch it again to deselect; pinch empty space to clear. Use and Write test: click.`],[(0,x.jsx)(h,{}),`Pinch and hold`,`Add what is highlighted to the selection (or take it out), for “make this look like that”.`],[(0,x.jsx)(p,{}),`Pinch and move`,`Scroll the app like a touch screen. The selection stays as it was.`],[(0,x.jsx)(_,{}),`Peace sign`,`Start talking. Pause to send.`],[(0,x.jsx)(d,{}),`Thumb up`,`Keep the preview.`],[(0,x.jsx)(u,{}),`Thumb down`,`Undo the preview.`],[(0,x.jsx)(f,{}),`Open palm, held`,`Stop: cancel listening or a request, clear the selection.`],[(0,x.jsx)(m,{}),`Fist`,`Freeze the cursor while you reposition your hand.`]],C=[[`make this bigger`,`Steps the size or padding prop up.`],[`make this look like that`,`Copies the look of a second element. Point at each as you say it.`],[`rename this to Pay now`,`Changes the text.`],[`move this above that`,`Reorders elements.`],[`remove this`,`Deletes the element (it is a preview, so you can undo).`],[`why is the total wrong?`,`The AI answers with file and line references.`],[`the card · the button inside`,`Selects the nearest one around or inside what is selected.`],[`go up · go inside · next · previous`,`Moves the selection. Also ↑ ↓ ← →.`],[`add this · deselect`,`Adds what you point at to the selection; clears it.`],[`keep it · undo · cancel`,`Decide on the preview.`],[`this should show $80.80`,`In Write test mode: adds a check to the test.`],[`generate test · run test · fix it`,`Turn the narration into a Playwright test, then fix the bug.`],[`mark this`,`While recording a session: marks the moment for the report.`]];function w(){let e=r(e=>e.overlay===`help`),u=r(e=>!!e.status?.app),d=o(),f=b(d);return(0,x.jsxs)(n,{open:e,onOpenChange:e=>i({overlay:e?`help`:null}),title:d?`Gestures, phrases and shortcuts`:`Phrases and shortcuts`,className:d?`w-[min(980px,calc(100vw-32px))]`:`w-[min(720px,calc(100vw-32px))]`,children:[(0,x.jsxs)(`div`,{className:`flex items-center justify-between border-b border-line px-5 py-3.5`,children:[(0,x.jsxs)(`div`,{children:[(0,x.jsx)(`h2`,{className:`text-[15px] font-semibold text-fg`,children:`Point, speak, build`}),(0,x.jsx)(`p`,{className:`text-[12.5px] text-fg-3`,children:`“This” and “that” mean whatever you point at while you say them.`})]}),(0,x.jsxs)(`div`,{className:`flex items-center gap-2`,children:[!u&&(0,x.jsx)(`span`,{className:`text-[12px] text-fg-3`,children:`Starts once an app is open`}),(0,x.jsx)(c,{icon:(0,x.jsx)(l,{}),onClick:()=>{i({overlay:null}),v.start()},"data-take-tour":!0,children:`Take the tour`}),(0,x.jsx)(a,{onClick:()=>i({overlay:null}),"aria-label":`Close`,children:(0,x.jsx)(s,{})})]})]}),(0,x.jsxs)(`div`,{className:t(`grid min-h-0 flex-1 grid-cols-1 gap-6 overflow-y-auto p-5`,d?`md:grid-cols-3`:`md:grid-cols-2`),children:[d&&(0,x.jsxs)(`section`,{children:[(0,x.jsx)(`h3`,{className:`mb-2.5 text-[12px] font-medium text-fg-3`,children:`Hand`}),(0,x.jsx)(`ul`,{className:`space-y-2.5`,children:S.map(([e,t,n])=>(0,x.jsxs)(`li`,{className:`flex gap-3`,children:[(0,x.jsx)(`span`,{className:`flex size-8 shrink-0 items-center justify-center rounded-[8px] bg-human-soft text-human-fg [&_svg]:size-[17px]`,children:e}),(0,x.jsxs)(`span`,{children:[(0,x.jsx)(`span`,{className:`block text-[12.5px] font-medium text-fg`,children:t}),(0,x.jsx)(`span`,{className:`block text-[12px] leading-snug text-fg-3`,children:n})]})]},t))})]}),(0,x.jsxs)(`section`,{children:[(0,x.jsx)(`h3`,{className:`mb-2.5 text-[12px] font-medium text-fg-3`,children:`Say`}),(0,x.jsx)(`ul`,{className:`space-y-2.5`,children:C.map(([e,t])=>(0,x.jsxs)(`li`,{children:[(0,x.jsxs)(`span`,{className:`block text-[12.5px] font-medium text-human-fg`,children:[`“`,e,`”`]}),(0,x.jsx)(`span`,{className:`block text-[12px] leading-snug text-fg-3`,children:t})]},e))})]}),(0,x.jsxs)(`section`,{children:[(0,x.jsx)(`h3`,{className:`mb-2.5 text-[12px] font-medium text-fg-3`,children:`Keyboard`}),(0,x.jsx)(`ul`,{className:`space-y-1.5`,children:f.map(([e,t])=>(0,x.jsxs)(`li`,{className:`flex items-center justify-between gap-3`,children:[(0,x.jsx)(`span`,{className:`text-[12px] text-fg-2`,children:e}),(0,x.jsx)(`span`,{className:`flex shrink-0 gap-1`,children:t.map((e,t)=>e===`–`?(0,x.jsx)(`span`,{className:`text-fg-3`,children:`–`},t):(0,x.jsx)(y,{children:e},t))})]},e))})]})]})]})}export{w as HelpDialog};
|
|
Binary file
|
|
Binary file
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import{i as e,o as t,r as n,t as r}from"./cn-Wq33h1G4.js";import{d as i,f as a,i as o,l as s,m as c,n as l,p as u,u as d}from"./confirm-D1U-bFIL.js";import{$ as f,Dt as p,K as m,Tt as h,Y as g,a as _,at as v,gt as y,i as b,it as x,n as S,o as ee,q as C,r as w,rt as T,s as te,t as E}from"./button-B2NFEpCs.js";import{n as D,t as O}from"./camera-BD9K1f5I.js";import{n as k,t as A}from"./refresh-cw-Dobx2YmO.js";import{$ as ne,B as re,E as ie,F as j,K as ae,L as oe,M as se,P as ce,S as le,St as ue,T as de,X as fe,Y as pe,_t as me,bt as he,d as ge,dt as _e,et as ve,f as ye,ft as be,gt as xe,h as Se,ht as Ce,it as we,lt as Te,m as Ee,mt as De,p as Oe,q as ke,rt as Ae,tt as je,u as Me,ut as M,vt as Ne,w as N,x as Pe,xt as Fe,yt as Ie}from"./index-DUAtV_Av.js";var Le={name:`bug`,size:24,node:[[`path`,{d:`M12 20v-9`,key:`1qisl0`}],[`path`,{d:`M14 7a4 4 0 0 1 4 4v3a6 6 0 0 1-12 0v-3a4 4 0 0 1 4-4z`,key:`uouzyp`}],[`path`,{d:`M14.12 3.88 16 2`,key:`qol33r`}],[`path`,{d:`M21 21a4 4 0 0 0-3.81-4`,key:`1b0z45`}],[`path`,{d:`M21 5a4 4 0 0 1-3.55 3.97`,key:`5cxbf6`}],[`path`,{d:`M22 13h-4`,key:`1jl80f`}],[`path`,{d:`M3 21a4 4 0 0 1 3.81-4`,key:`1fjd4g`}],[`path`,{d:`M3 5a4 4 0 0 0 3.55 3.97`,key:`1d7oge`}],[`path`,{d:`M6 13H2`,key:`82j7cp`}],[`path`,{d:`m8 2 1.88 1.88`,key:`fmnt4t`}],[`path`,{d:`M9 7.13V6a3 3 0 1 1 6 0v1.13`,key:`1vgav8`}]]};Le.node;var Re=_(Le),ze={name:`chevron-left`,size:24,node:[[`path`,{d:`m15 18-6-6 6-6`,key:`1wnfg3`}]]};ze.node;var Be=_(ze),Ve={name:`clipboard-copy`,size:24,node:[[`rect`,{width:`8`,height:`4`,x:`8`,y:`2`,rx:`1`,ry:`1`,key:`tgr4d6`}],[`path`,{d:`M8 4H6a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-2`,key:`4jdomd`}],[`path`,{d:`M16 4h2a2 2 0 0 1 2 2v4`,key:`3hqy98`}],[`path`,{d:`M21 14H11`,key:`1bme5i`}],[`path`,{d:`m15 10-4 4 4 4`,key:`5dvupr`}]]};Ve.node;var He=_(Ve),Ue={name:`earth`,size:24,node:[[`path`,{d:`M21.54 15H17a2 2 0 0 0-2 2v4.54`,key:`1djwo0`}],[`path`,{d:`M7 3.34V5a3 3 0 0 0 3 3a2 2 0 0 1 2 2c0 1.1.9 2 2 2a2 2 0 0 0 2-2c0-1.1.9-2 2-2h3.17`,key:`1tzkfa`}],[`path`,{d:`M11 21.95V18a2 2 0 0 0-2-2a2 2 0 0 1-2-2v-1a2 2 0 0 0-2-2H2.05`,key:`14pb5j`}],[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}]],aliases:[`globe-2`]};Ue.node;var We=_(Ue),P={name:`file-headphone`,size:24,node:[[`path`,{d:`M4 6.835V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.706.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2h-.343`,key:`1vfytu`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M2 19a2 2 0 0 1 4 0v1a2 2 0 0 1-4 0v-4a6 6 0 0 1 12 0v4a2 2 0 0 1-4 0v-1a2 2 0 0 1 4 0`,key:`1etmh7`}]],aliases:[`file-audio`,`file-audio-2`]};P.node;var Ge=_(P),F={name:`image-off`,size:24,node:[[`line`,{x1:`2`,x2:`22`,y1:`2`,y2:`22`,key:`a6p6uj`}],[`path`,{d:`M10.41 10.41a2 2 0 1 1-2.83-2.83`,key:`1bzlo9`}],[`line`,{x1:`13.5`,x2:`6`,y1:`13.5`,y2:`21`,key:`1q0aeu`}],[`line`,{x1:`18`,x2:`21`,y1:`12`,y2:`15`,key:`5mozeu`}],[`path`,{d:`M3.59 3.59A1.99 1.99 0 0 0 3 5v14a2 2 0 0 0 2 2h14c.55 0 1.052-.22 1.41-.59`,key:`mmje98`}],[`path`,{d:`M21 15V5a2 2 0 0 0-2-2H9`,key:`43el77`}]]};F.node;var Ke=_(F),I={name:`languages`,size:24,node:[[`path`,{d:`m5 8 6 6`,key:`1wu5hv`}],[`path`,{d:`m4 14 6-6 2-3`,key:`1k1g8d`}],[`path`,{d:`M2 5h12`,key:`or177f`}],[`path`,{d:`M7 2h1`,key:`1t2jsx`}],[`path`,{d:`m22 22-5-10-5 10`,key:`don7ne`}],[`path`,{d:`M14 18h6`,key:`1m8k6r`}]]};I.node;var L=_(I),R={name:`lightbulb`,size:24,node:[[`path`,{d:`M15 14c.2-1 .7-1.7 1.5-2.5 1-.9 1.5-2.2 1.5-3.5A6 6 0 0 0 6 8c0 1 .2 2.2 1.5 3.5.7.7 1.3 1.5 1.5 2.5`,key:`1gvzjb`}],[`path`,{d:`M9 18h6`,key:`x1upvd`}],[`path`,{d:`M10 22h4`,key:`ceow96`}]]};R.node;var z=_(R),B={name:`list-checks`,size:24,node:[[`path`,{d:`M13 5h8`,key:`a7qcls`}],[`path`,{d:`M13 12h8`,key:`h98zly`}],[`path`,{d:`M13 19h8`,key:`c3s6r1`}],[`path`,{d:`m3 17 2 2 4-4`,key:`1jhpwq`}],[`path`,{d:`m3 7 2 2 4-4`,key:`1obspn`}]]};B.node;var V=_(B),H={name:`list-restart`,size:24,node:[[`path`,{d:`M21 5H3`,key:`1fi0y6`}],[`path`,{d:`M7 12H3`,key:`13ou7f`}],[`path`,{d:`M7 19H3`,key:`wbqt3n`}],[`path`,{d:`M12 18a5 5 0 0 0 9-3 4.5 4.5 0 0 0-4.5-4.5c-1.33 0-2.54.54-3.41 1.41L11 14`,key:`qth677`}],[`path`,{d:`M11 10v4h4`,key:`172dkj`}]]};H.node;var U=_(H),W={name:`navigation`,size:24,node:[[`polygon`,{points:`3 11 22 2 13 21 11 13 3 11`,key:`1ltx0t`}]]};W.node;var qe=_(W),Je={name:`pencil`,size:24,node:[[`path`,{d:`M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z`,key:`1a8usu`}],[`path`,{d:`m15 5 4 4`,key:`1mk7zo`}]]};Je.node;var Ye=_(Je),Xe={name:`quote`,size:24,node:[[`path`,{d:`M16 3a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2 1 1 0 0 1 1 1v1a2 2 0 0 1-2 2 1 1 0 0 0-1 1v2a1 1 0 0 0 1 1 6 6 0 0 0 6-6V5a2 2 0 0 0-2-2z`,key:`rib7q0`}],[`path`,{d:`M5 3a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2 1 1 0 0 1 1 1v1a2 2 0 0 1-2 2 1 1 0 0 0-1 1v2a1 1 0 0 0 1 1 6 6 0 0 0 6-6V5a2 2 0 0 0-2-2z`,key:`1ymkrd`}]]};Xe.node;var Ze=_(Xe),Qe={name:`shield-check`,size:24,node:[[`path`,{d:`M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z`,key:`oel41y`}],[`path`,{d:`m9 12 2 2 4-4`,key:`dzmm74`}]]};Qe.node;var $e=_(Qe),et={name:`terminal`,size:24,node:[[`path`,{d:`M12 19h8`,key:`baeox8`}],[`path`,{d:`m4 17 6-6-6-6`,key:`1yngyt`}]]};et.node;var tt=_(et),G=t(e(),1),K=n(),q={critical:{bar:`bg-bad`,chip:`bg-bad text-inverse`},high:{bar:`bg-[#f76b15]`,chip:`bg-[#f76b15]/15 text-[#a94405] dark:text-[#ff8a3d]`},medium:{bar:`bg-warn/70`,chip:`bg-warn-soft text-warn`},low:{bar:`bg-fg-3/50`,chip:`bg-active text-fg-2`}},J={fixed:{chip:`bg-ok-soft text-ok`,bar:`bg-ok`,icon:Ae},still:{chip:`bg-bad-soft text-bad`,bar:`bg-bad`,icon:ve},unknown:{chip:`bg-active text-fg-2`,bar:`bg-fg-3/40`,icon:je}};function nt({r:e,t,lang:n}){let i=J[e.verdict],a=i.icon;return(0,K.jsxs)(`span`,{className:r(`inline-flex items-center gap-1 rounded-[5px] px-1.5 py-px text-[10.5px] font-semibold`,i.chip),title:n===`ar`?e.whyAr:e.why,"data-verdict":e.verdict,children:[(0,K.jsx)(a,{className:`size-3`}),t.verdicts[e.verdict]]})}function rt(e,t,n){let r=n.find(e=>e.shot)?.shot;if(r)return r;let i=t.issues.find(t=>e.evidence.includes(t.id)||t.evidence.some(t=>e.evidence.includes(t)));if(i?.shot)return i.shot;let a=n[0]?.t;if(a==null||!t.shots.length)return null;let o=t.shots[0];for(let e of t.shots)Math.abs(e.t-a-500)<Math.abs(o.t-a-500)&&(o=e);return Math.abs(o.t-a)<1e4?o.name:null}function it(e,t,n){let r=n.find(e=>e.kind===`speech`),i=e=>e.replace(/[^\p{L}\p{N}]+/gu,` `).trim().toLowerCase();if(e.quote){let n=i(e.quote).slice(0,40),r=t.transcript.find(e=>i(e.text).includes(n)||n.includes(i(e.text).slice(0,30)));if(r)return r}return r?t.transcript.find(e=>e.start===r.t)??null:null}function at(e){let t=e.split(`
|
|
2
|
-
`),n=e=>/^\s*at\s/.test(e);return{prose:t.filter(e=>!n(e)).join(` `).trim(),frames:t.filter(n).map(e=>e.trim())}}function ot({text:e}){let{prose:t,frames:n}=at(e);return(0,K.jsxs)(K.Fragment,{children:[t&&(0,K.jsx)(`p`,{className:`text-fg`,children:t}),n.length>0&&(0,K.jsx)(`pre`,{tabIndex:0,role:`region`,"aria-label":`Stack trace`,className:`overflow-x-auto rounded-[8px] bg-sunken px-3 py-2 font-mono text-[11.5px] leading-relaxed text-fg-2 ring-1 ring-inset ring-line`,dir:`ltr`,children:n.join(`
|
|
3
|
-
`)})]})}function st({f:e,a:t,t:n,act:a,index:o,start:s,verdict:l,lang:d}){let[f,p]=(0,G.useState)(o<3),m=C(),h=y(e,t),g=rt(e,t,h),_=it(e,t,h),v=h[0]?.t,b=q[e.severity];return(0,K.jsxs)(`article`,{className:`group relative overflow-hidden rounded-[14px] bg-raised ring-1 ring-inset ring-line transition-shadow hover:ring-line-strong`,"data-finding":e.id,"data-verdict":l?.verdict,children:[(0,K.jsx)(`span`,{className:r(`absolute inset-y-0 start-0 w-[3px]`,b.bar)}),(0,K.jsxs)(`button`,{"data-hand":!0,onClick:()=>p(!f),className:`flex w-full items-start gap-3 px-4 pb-3 pt-3.5 text-start`,children:[(0,K.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,K.jsxs)(`div`,{className:`flex flex-wrap items-center gap-1.5`,children:[l&&(0,K.jsx)(nt,{r:l,t:n,lang:d}),(0,K.jsx)(`span`,{className:r(`rounded-[5px] px-1.5 py-px text-[10.5px] font-semibold uppercase tracking-[0.04em]`,b.chip),children:n.severity[e.severity]}),(0,K.jsx)(`span`,{className:`rounded-[5px] px-1.5 py-px text-[10.5px] font-medium text-fg-3 ring-1 ring-inset ring-line`,children:n.category[e.category]}),v!=null&&(0,K.jsx)(`span`,{className:`tabular text-[11px] text-fg-3`,children:Y(v-s)}),e.confidence!==`high`&&(0,K.jsxs)(`span`,{className:`text-[11px] text-fg-3`,children:[`· `,e.confidence,` `,n.confidence]})]}),(0,K.jsx)(`h3`,{className:`mt-1.5 text-[14.5px] font-semibold leading-snug tracking-[-0.01em] text-fg`,children:e.title}),!f&&(0,K.jsx)(`p`,{className:`mt-1 line-clamp-1 text-[12.5px] text-fg-3`,children:at(e.what).prose})]}),g&&!f&&(0,K.jsx)(`img`,{src:a.shotUrl(g),alt:``,className:`h-12 w-20 shrink-0 rounded-[6px] object-cover object-top ring-1 ring-line`,loading:`lazy`}),(0,K.jsx)(c,{className:r(`mt-1 size-4 shrink-0 text-fg-3 transition-transform`,f&&`rotate-180`)})]}),f&&(0,K.jsxs)(`div`,{className:`grid gap-4 px-4 pb-4 md:grid-cols-[1fr_auto]`,children:[(0,K.jsxs)(`div`,{className:`min-w-0 space-y-3 text-[13px] leading-relaxed text-fg-2`,children:[l&&(0,K.jsxs)(`p`,{className:r(`rounded-[8px] px-2.5 py-1.5 text-[12.5px]`,J[l.verdict].chip),"data-verdict-why":!0,children:[(0,K.jsxs)(`span`,{className:`font-semibold`,children:[n.verdicts[l.verdict],`: `]}),d===`ar`?l.whyAr:l.why]}),(0,K.jsx)(ot,{text:e.what}),e.quote&&(0,K.jsxs)(`figure`,{className:`flex items-start gap-2 rounded-[10px] bg-human-soft px-3 py-2`,children:[(0,K.jsx)(Ze,{className:`mt-0.5 size-3.5 shrink-0 text-human-fg`}),(0,K.jsx)(`blockquote`,{dir:`auto`,className:`min-w-0 flex-1 text-[13px] font-medium text-fg`,children:e.quote}),_&&(0,K.jsx)(`button`,{"data-hand":!0,title:n.play,onClick:()=>a.play(_),className:`inline-flex size-6 shrink-0 items-center justify-center rounded-full bg-human text-[#1b1203] hover:brightness-105`,children:(0,K.jsx)(j,{className:`size-3 fill-current`})})]}),e.expected&&(0,K.jsxs)(`p`,{children:[(0,K.jsxs)(`span`,{className:`font-medium text-fg`,children:[n.expected,`: `]}),e.expected]}),(0,K.jsxs)(`div`,{className:`rounded-[10px] bg-ai-soft/60 px-3 py-2 ring-1 ring-inset ring-ai-line/25`,children:[(0,K.jsxs)(`div`,{className:`mb-1 flex items-center gap-1.5 text-[11.5px] font-semibold text-ai-fg`,children:[(0,K.jsx)(le,{className:`size-3.5`}),n.howToFix]}),(0,K.jsx)(`p`,{className:`text-fg`,children:e.fix}),e.location&&(0,K.jsxs)(`div`,{className:`mt-2 inline-flex items-center gap-1.5 rounded-[6px] bg-raised px-2 py-0.5 font-mono text-[11.5px] text-fg-2 ring-1 ring-inset ring-line`,dir:`ltr`,title:n.where,children:[(0,K.jsx)(ne,{className:`size-3`}),e.location]}),e.shown&&e.shown!==e.location&&(0,K.jsxs)(`p`,{className:`mt-1.5 text-[11.5px] text-fg-3`,"data-shown":!0,children:[n.shownAt,`:`,` `,(0,K.jsx)(`span`,{className:`font-mono`,dir:`ltr`,children:e.shown})]})]}),e.steps.length>0&&(0,K.jsxs)(`details`,{className:`group/steps`,children:[(0,K.jsxs)(`summary`,{className:`cursor-default list-none text-[12px] font-medium text-fg-3 hover:text-fg-2`,children:[(0,K.jsx)(c,{className:`me-1 inline size-3 transition-transform group-open/steps:rotate-180`}),n.steps,` (`,e.steps.length,`)`]}),(0,K.jsx)(`ol`,{className:`mt-1.5 list-decimal space-y-0.5 ps-6 text-[12.5px]`,children:e.steps.map((e,t)=>(0,K.jsx)(`li`,{children:e},t))})]}),(0,K.jsxs)(`div`,{className:`flex flex-wrap items-center gap-1.5 pt-1`,children:[(0,K.jsx)(E,{size:`sm`,variant:`ai`,icon:(0,K.jsx)(i,{}),onClick:()=>a.fix(e),children:n.fixWith(m)}),(0,K.jsx)(E,{size:`sm`,icon:(0,K.jsx)(u,{}),onClick:()=>a.test(e),children:n.createTest}),v!=null&&(0,K.jsx)(E,{size:`sm`,variant:`ghost`,icon:(0,K.jsx)(ke,{}),onClick:()=>a.show(v),children:n.showMoment}),(0,K.jsx)(E,{size:`sm`,variant:`ghost`,icon:(0,K.jsx)(k,{}),onClick:()=>a.skip(e),"data-skip":!0,children:n.skip}),e.evidence.length>0&&(0,K.jsxs)(`span`,{className:`ms-auto text-[11px] text-fg-3`,dir:`ltr`,children:[n.evidence,`: `,e.evidence.slice(0,6).join(` `)]})]})]}),g&&(0,K.jsx)(`button`,{"data-hand":!0,onClick:()=>a.zoom(g),className:`block self-start overflow-hidden rounded-[10px] ring-1 ring-line transition hover:ring-line-strong md:w-[260px]`,children:(0,K.jsx)(`img`,{src:a.shotUrl(g),alt:`Screenshot at this moment`,className:`w-full object-cover object-top`,loading:`lazy`})})]})]})}function Y(e){let t=Math.max(0,Math.round(e/1e3));return`${Math.floor(t/60)}:${String(t%60).padStart(2,`0`)}`}function ct({findings:e,skipped:t,analysis:n,t:a,act:o,start:s,verdicts:l,lang:u}){let[d,f]=(0,G.useState)(`all`),[p,m]=(0,G.useState)(!1),h=C(),g=e.filter(e=>!t.has(e.id)),_=e.filter(e=>t.has(e.id)),v=g.reduce((e,t)=>(e[t.severity]=(e[t.severity]??0)+1,e),{}),y=d===`all`?g:g.filter(e=>e.severity===d),b=l?g.filter(e=>l[e.id]?.verdict!==`fixed`):g;return(0,K.jsxs)(`section`,{className:`space-y-3`,"data-findings":!0,children:[(0,K.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,K.jsxs)(`h2`,{className:`flex items-center gap-2 text-[15px] font-semibold text-fg`,children:[(0,K.jsx)(Re,{className:`size-4 text-fg-3`}),a.findings,(0,K.jsx)(`span`,{className:`tabular text-fg-3`,children:g.length})]}),b.length>1&&(0,K.jsx)(E,{size:`sm`,variant:`ai`,icon:(0,K.jsx)(i,{}),onClick:()=>o.fixAll(b),title:a.fixAllHint,"data-fix-all":!0,children:a.fixAll(b.length,h)}),(0,K.jsx)(`div`,{className:`ms-auto flex flex-wrap gap-1`,children:[`all`,`critical`,`high`,`medium`,`low`].map(e=>e===`all`||v[e]?(0,K.jsxs)(`button`,{"data-hand":!0,onClick:()=>f(e),className:r(`h-6 rounded-full px-2.5 text-[11.5px] font-medium ring-1 ring-inset ring-line`,d===e?`bg-fg text-inverse ring-fg`:`text-fg-2 hover:bg-hover`),children:[e===`all`?a.all:a.severity[e],` `,e!==`all`&&(0,K.jsx)(`span`,{className:`tabular opacity-70`,children:v[e]})]},e):null)})]}),!g.length&&(0,K.jsx)(`p`,{className:`rounded-[14px] bg-ok-soft px-4 py-3 text-[13px] text-ok`,children:a.noFindings}),(0,K.jsx)(`div`,{className:`space-y-2.5`,children:y.map((e,t)=>(0,K.jsx)(st,{f:e,a:n,t:a,act:o,index:t,start:s,verdict:l?.[e.id],lang:u},e.id))}),_.length>0&&(0,K.jsxs)(`div`,{className:`rounded-[14px] ring-1 ring-inset ring-line`,"data-skipped":!0,children:[(0,K.jsxs)(`button`,{"data-hand":!0,onClick:()=>m(!p),className:`flex w-full items-center gap-2 px-4 py-2.5 text-start text-[12.5px] font-medium text-fg-3 hover:text-fg-2`,children:[(0,K.jsx)(k,{className:`size-3.5`}),a.skippedTitle(_.length),(0,K.jsx)(c,{className:r(`ms-auto size-3.5 transition-transform`,p&&`rotate-180`)})]}),p&&(0,K.jsxs)(`div`,{className:`space-y-1 border-t border-line px-2 py-2`,children:[(0,K.jsx)(`p`,{className:`px-2 pb-1 text-[11.5px] text-fg-3`,children:a.skippedHint}),_.map(e=>(0,K.jsxs)(`div`,{className:`flex items-center gap-2 rounded-[8px] px-2 py-1.5 hover:bg-hover`,children:[(0,K.jsx)(`span`,{className:r(`rounded-[5px] px-1.5 py-px text-[10px] font-semibold uppercase`,q[e.severity].chip),children:a.severity[e.severity]}),(0,K.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-[12.5px] text-fg-3 line-through decoration-fg-3/40`,children:e.title}),(0,K.jsx)(E,{size:`xs`,variant:`ghost`,icon:(0,K.jsx)(ce,{}),onClick:()=>o.restore(e),children:a.restore})]},e.id))]})]})]})}function X({value:e,children:t}){return(0,K.jsx)(be,{value:e,"data-hand":!0,className:`relative h-8 px-1 text-[12.5px] font-medium text-fg-3 transition-colors hover:text-fg-2 data-[state=active]:text-fg data-[state=active]:after:absolute data-[state=active]:after:inset-x-0 data-[state=active]:after:-bottom-px data-[state=active]:after:h-0.5 data-[state=active]:after:bg-fg`,children:t})}var Z=50;function lt(e,t){let[n,r]=(0,G.useState)(Z),i=e.length-n,a=i>0?(0,K.jsx)(`button`,{"data-hand":!0,onClick:()=>r(n+Z),className:`block w-full rounded-[8px] px-2.5 py-2 text-center text-[12px] font-medium text-fg-2 hover:bg-hover`,"data-show-more":!0,children:t.showMore(Math.min(Z,i))}):null;return{shown:e.slice(0,n),more:a}}function ut({analysis:e,start:t,onPick:n,lang:i,t:a}){let o=e.issues.filter(e=>e.kind===`error`||e.kind===`console`),s=lt(o,a),c=lt(e.pages,a),l=(e.more?.issues.error??0)+(e.more?.issues.console??0);return(0,K.jsxs)(`section`,{className:`rounded-[14px] bg-raised ring-1 ring-inset ring-line`,children:[(0,K.jsxs)(Te,{defaultValue:`errors`,children:[(0,K.jsxs)(_e,{className:`flex gap-5 border-b border-line px-4`,children:[(0,K.jsxs)(X,{value:`errors`,children:[a.tabs.errors,` (`,o.length,`)`]}),(0,K.jsxs)(X,{value:`network`,children:[a.tabs.network,` (`,e.network.total,`)`]}),(0,K.jsx)(X,{value:`perf`,children:a.tabs.speed}),(0,K.jsxs)(X,{value:`pages`,children:[a.tabs.pages,` (`,e.pages.length,`)`]})]}),(0,K.jsxs)(M,{value:`errors`,className:`max-h-[420px] space-y-2 overflow-y-auto p-3 outline-none`,children:[!o.length&&(0,K.jsx)(`p`,{className:`p-4 text-center text-[12.5px] text-fg-3`,children:a.noErrors}),s.shown.map(e=>(0,K.jsxs)(`button`,{"data-hand":!0,onClick:()=>n(e.t),className:`block w-full rounded-[10px] bg-sunken p-3 text-start ring-1 ring-inset ring-line hover:ring-line-strong`,children:[(0,K.jsxs)(`div`,{className:`flex items-center gap-2 text-[12.5px] font-medium text-bad`,children:[i===`ar`?e.titleAr??e.title:e.title,e.count>1&&(0,K.jsxs)(`span`,{className:`rounded-[4px] bg-bad-soft px-1 text-[10.5px]`,children:[`×`,e.count]})]}),e.src&&(0,K.jsx)(`div`,{className:`mt-1 font-mono text-[11px] text-fg-2`,children:e.src}),e.detail&&(0,K.jsx)(`pre`,{className:`mt-2 max-h-28 overflow-hidden whitespace-pre-wrap text-[11px] leading-relaxed text-fg-3`,dir:`ltr`,children:e.detail})]},e.id)),s.more,l>0&&(0,K.jsx)(`p`,{className:`px-2 py-1 text-center text-[11.5px] text-fg-3`,children:a.notListed(l)})]}),(0,K.jsxs)(M,{value:`network`,className:`max-h-[420px] overflow-y-auto p-2 outline-none`,children:[(0,K.jsxs)(`table`,{className:`w-full text-[12px]`,children:[(0,K.jsx)(`thead`,{children:(0,K.jsxs)(`tr`,{className:`text-start text-[11px] text-fg-3`,children:[(0,K.jsx)(`th`,{className:`px-2 py-1.5 text-start font-medium`,children:a.cols.request}),(0,K.jsx)(`th`,{className:`px-2 py-1.5 text-start font-medium`,children:a.cols.calls}),(0,K.jsx)(`th`,{className:`px-2 py-1.5 text-start font-medium`,children:a.cols.avg}),(0,K.jsx)(`th`,{className:`px-2 py-1.5 text-start font-medium`,children:a.cols.status})]})}),(0,K.jsx)(`tbody`,{children:e.network.endpoints.map(e=>(0,K.jsxs)(`tr`,{className:`border-t border-line`,children:[(0,K.jsxs)(`td`,{className:`max-w-[340px] truncate px-2 py-1.5 font-mono text-[11.5px] text-fg`,dir:`ltr`,children:[(0,K.jsx)(`span`,{className:`text-fg-3`,children:e.method}),` `,e.url]}),(0,K.jsx)(`td`,{className:`tabular px-2 py-1.5 text-fg-2`,children:e.count}),(0,K.jsx)(`td`,{className:r(`tabular px-2 py-1.5`,e.avgMs>1500?`text-warn`:`text-fg-2`),children:h(e.avgMs)}),(0,K.jsx)(`td`,{className:`px-2 py-1.5`,children:e.statuses.map(e=>(0,K.jsx)(`span`,{className:r(`me-1 rounded-[4px] px-1 font-mono text-[10.5px]`,e===0||e>=400?`bg-bad-soft text-bad`:`bg-ok-soft text-ok`),children:e||`ERR`},e))})]},`${e.method} ${e.url}`))})]}),!e.network.endpoints.length&&(0,K.jsx)(`p`,{className:`p-4 text-center text-[12.5px] text-fg-3`,children:a.noRequests})]}),(0,K.jsx)(M,{value:`perf`,className:`grid grid-cols-2 gap-2 p-3 outline-none md:grid-cols-3`,children:[[i===`ar`?`أول رسم`:`First paint`,h(e.perf.fcp),e.perf.fcp!=null&&e.perf.fcp>1800],[i===`ar`?`المحتوى الرئيسي`:`Main content`,h(e.perf.lcp),e.perf.lcp!=null&&e.perf.lcp>2500],[i===`ar`?`إزاحة التخطيط`:`Layout shift`,e.perf.cls.toFixed(3),e.perf.cls>.1],[i===`ar`?`أبطأ تفاعل`:`Slowest interaction`,h(e.perf.slowestInteraction),(e.perf.slowestInteraction??0)>200],[i===`ar`?`عمل التطبيق الطويل`:`App busy (long tasks)`,`${e.perf.longTasks} · ${h(e.perf.longTaskMs)}`,e.perf.longTaskMs>2e3],[i===`ar`?`طلبات بطيئة`:`Slow requests`,String(e.network.slow),e.network.slow>0]].map(([e,t,n])=>(0,K.jsxs)(`div`,{className:`rounded-[10px] bg-sunken p-3 ring-1 ring-inset ring-line`,children:[(0,K.jsx)(`div`,{className:`text-[11.5px] text-fg-3`,children:e}),(0,K.jsx)(`div`,{className:r(`tabular mt-1 text-[17px] font-semibold`,n?`text-warn`:`text-fg`),children:t})]},String(e)))}),(0,K.jsxs)(M,{value:`pages`,className:`max-h-[420px] overflow-y-auto p-2 outline-none`,children:[c.shown.map((e,r)=>(0,K.jsxs)(`button`,{"data-hand":!0,onClick:()=>n(e.t),className:`flex w-full items-center gap-3 rounded-[8px] px-2.5 py-2 text-start hover:bg-hover`,children:[(0,K.jsx)(`span`,{className:`tabular w-10 text-[11.5px] text-fg-3`,children:Y(e.t-t)}),(0,K.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-[12.5px] text-fg`,children:e.title||e.url}),(0,K.jsx)(`span`,{className:`truncate font-mono text-[11px] text-fg-3`,dir:`ltr`,children:e.url}),(0,K.jsx)(`span`,{className:`tabular text-[11.5px] text-fg-2`,children:h(e.ms)})]},r)),c.more]})]}),(!!e.summarised||!!e.dropped)&&(0,K.jsx)(`p`,{className:`border-t border-line px-4 py-2 text-[11.5px] text-fg-3`,children:[e.summarised?a.summarised(e.summarised):``,e.dropped?a.dropped(e.dropped):``].filter(Boolean).join(` `)})]})}var Q={en:{back:`Back to the studio`,overall:`Overall`,stability:`Stability`,usability:`Ease of use`,performance:`Speed`,accessibility:`Accessibility`,vsPrevious:`vs previous`,findings:`Findings`,noFindings:`No errors, failed requests or friction were recorded.`,suggestions:`Suggestions`,fix:`Fix`,improve:`Improve`,add:`Add`,journey:`What the tester did`,positives:`What worked`,nextSteps:`Next steps`,expected:`Expected`,where:`Where to fix`,shownAt:`Where it showed`,howToFix:`How to fix`,steps:`Steps to reproduce`,evidence:`Evidence`,confidence:`confidence`,fixWith:e=>`Fix with ${e}`,createTest:`Create test`,showMoment:`Show moment`,play:`Play what was said`,verdict:{ship:`No serious problems found`,"fix-first":`Fix first`,blocked:`Blocked`},clean:`No technical problems found`,scope:`Saywright looks for errors, failed requests, slow responses and signs of frustration. It can’t tell whether the values on screen are right.`,addCheck:`Add a check`,addCheckHint:`Point at a value that must be right, like a total, and say what it should show: it becomes a test.`,tryAutopilot:`Let Autopilot try the main flows`,severity:{critical:`Critical`,high:`High`,medium:`Medium`,low:`Low`},category:{bug:`Bug`,usability:`Usability`,performance:`Performance`,accessibility:`Accessibility`,content:`Content`,reliability:`Reliability`},effort:{small:`small`,medium:`medium`,large:`large`},effortIs:e=>`Effort: ${e}`,writtenBy:(e,t)=>`Written by ${e}${t?` in ${t} s`:``}, from the evidence below.`,writtenLocally:`Written on this computer from what was recorded. Connect an AI in Settings → AI for root causes and fixes.`,all:`All`,tone:{good:`good`,fair:`fair`,poor:`poor`},skip:`Skip`,restore:`Restore`,skippedTitle:e=>`Skipped (${e})`,skippedHint:`Set aside: not counted and not fixed. Rewriting the report won’t raise them again.`,fixAll:(e,t)=>`Fix all with ${t} (${e})`,fixAllHint:`Every finding you didn’t skip, in one request, with its evidence.`,implementSelected:e=>`Implement selected (${e})`,selectAll:`Select all`,selectNone:`Clear`,pickHint:e=>`Tick the ones to implement, then send them to ${e} together.`,timeline:`Timeline`,transcript:`Transcript`,correct:`Correct`,save:`Save`,cancel:`Cancel`,corrected:`corrected`,heard:e=>`Heard: “${e}”`,correctHint:`Click a sentence to correct a word or spelling. The recording stays as it was.`,notInReport:e=>`${e} corrected sentence${e===1?` isn’t`:`s aren’t`} in this report yet.`,rewrite:`Rewrite the report`,noNarration:`No narration in this session.`,pointingAt:e=>`pointing at ${e}`,translating:`Translating…`,translate:`Translate`,translatedFrom:(e,t)=>`Translated by ${t??`AI`} from the ${e===`ar`?`Arabic`:`English`} report.`,notTranslated:`Not translated yet.`,tabs:{errors:`Errors`,network:`Network`,speed:`Speed`,pages:`Pages`},chips:{all:`All`,speech:`Said`,issues:`Issues`,actions:`Actions`,network:`Network`},noErrors:`No JavaScript errors or console errors.`,noRequests:`The app made no requests.`,summarised:e=>`${e.toLocaleString(`en`)} similar event${e===1?` was`:`s were`} summarised: each one is in the counts.`,dropped:e=>`${e.toLocaleString(`en`)} event${e===1?` wasn’t`:`s weren’t`} recorded: the app’s page couldn’t keep them while the studio wasn’t answering.`,nothingHere:`Nothing here.`,cols:{request:`Request`,calls:`Calls`,avg:`Avg`,status:`Status`},verify:`Verify fixes`,verifyHint:`Play this session’s steps again in your app, now, and check whether each finding still happens.`,verifying:`Comparing the replay with the session…`,verdicts:{fixed:`Fixed`,still:`Still happens`,unknown:`Couldn’t check`},replayed:(e,t)=>`Replayed ${e} of ${t} step${t===1?``:`s`}`,verifySummary:(e,t,n)=>[e&&`${e} fixed`,t&&`${t} still happen${t===1?`s`:``}`,n&&`${n} couldn’t be checked`].filter(Boolean).join(` · `),stoppedAt:(e,t)=>`Stopped at “${e}” (${t}).`,fresh:`New in the replay`,verifiedAgo:e=>`Checked ${e}`,againBtn:`Replay again`,verifyTitle:`Checked by a replay`,noSteps:`This session has no clicks or typing to replay.`,showMore:e=>`Show ${e} more`,notListed:e=>`${e.toLocaleString(`en-US`)} more like these aren’t listed.`,momentsNotListed:e=>`${e.toLocaleString(`en-US`)} repeated or routine moments aren’t listed.`},ar:{back:`العودة إلى الاستوديو`,overall:`التقييم العام`,stability:`الاستقرار`,usability:`سهولة الاستخدام`,performance:`السرعة`,accessibility:`إمكانية الوصول`,vsPrevious:`مقارنة بالسابقة`,findings:`الملاحظات`,noFindings:`لم تُسجَّل أخطاء ولا طلبات فاشلة ولا صعوبات.`,suggestions:`الاقتراحات`,fix:`إصلاح`,improve:`تحسين`,add:`إضافة`,journey:`ما قام به المختبِر`,positives:`ما نجح`,nextSteps:`الخطوات التالية`,expected:`المتوقع`,where:`مكان الإصلاح`,shownAt:`مكان ظهورها`,howToFix:`طريقة الإصلاح`,steps:`خطوات إعادة المشكلة`,evidence:`الأدلة`,confidence:`الثقة`,fixWith:e=>`أصلحها مع ${e===`AI`?`الذكاء الاصطناعي`:e}`,createTest:`أنشئ اختبارًا`,showMoment:`اعرض اللحظة`,play:`شغّل ما قيل`,verdict:{ship:`لا مشكلات خطيرة`,"fix-first":`يحتاج إصلاحًا أولًا`,blocked:`متوقف`},clean:`لم تُرصد مشكلات تقنية`,scope:`يبحث Saywright عن الأخطاء والطلبات الفاشلة والاستجابات البطيئة وعلامات التعثّر، لكنه لا يستطيع أن يعرف إن كانت القيم المعروضة صحيحة.`,addCheck:`أضف فحصًا`,addCheckHint:`أشر إلى قيمة يجب أن تكون صحيحة، كالإجمالي، وقل ما يجب أن تعرضه: تصبح اختبارًا.`,tryAutopilot:`دع Autopilot يجرّب المسارات الرئيسية`,severity:{critical:`حرج`,high:`مرتفع`,medium:`متوسط`,low:`منخفض`},category:{bug:`خلل`,usability:`سهولة الاستخدام`,performance:`الأداء`,accessibility:`إمكانية الوصول`,content:`المحتوى`,reliability:`الاعتمادية`},effort:{small:`صغير`,medium:`متوسط`,large:`كبير`},effortIs:e=>`الجهد: ${e}`,writtenBy:(e,t)=>`كتبه ${e}${t?` في ${t} ثانية`:``} اعتمادًا على الأدلة أدناه.`,writtenLocally:`كُتب على هذا الجهاز مما سُجّل. اربط ذكاءً اصطناعيًا في الإعدادات ← الذكاء الاصطناعي للحصول على الأسباب الجذرية وطرق الإصلاح.`,all:`الكل`,tone:{good:`جيد`,fair:`مقبول`,poor:`ضعيف`},skip:`تجاهل`,restore:`استعادة`,skippedTitle:e=>`المتجاهَلة (${e})`,skippedHint:`جُنّبت: لا تُحسب ولا تُصلَح، ولن يطرحها التقرير مجددًا عند إعادة كتابته.`,fixAll:(e,t)=>`أصلح الكل مع ${t===`AI`?`الذكاء الاصطناعي`:t} (${e})`,fixAllHint:`كل ملاحظة لم تتجاهلها، في طلب واحد، مع أدلتها.`,implementSelected:e=>`نفّذ المحدَّد (${e})`,selectAll:`تحديد الكل`,selectNone:`إلغاء التحديد`,pickHint:e=>`حدّد ما تريد تنفيذه، ثم أرسله إلى ${e===`AI`?`الذكاء الاصطناعي`:e} دفعة واحدة.`,timeline:`الخط الزمني`,transcript:`نص الكلام`,correct:`صحّح`,save:`حفظ`,cancel:`إلغاء`,corrected:`مُصحَّحة`,heard:e=>`سُمِع: «${e}»`,correctHint:`انقر جملة لتصحيح كلمة أو إملاء. يبقى التسجيل كما هو.`,notInReport:e=>e===1?`جملة مصحَّحة لم تدخل هذا التقرير بعد.`:e===2?`جملتان مصحَّحتان لم تدخلا هذا التقرير بعد.`:`${e} ${e<=10?`جمل مصحَّحة`:`جملة مصحَّحة`} لم تدخل هذا التقرير بعد.`,rewrite:`أعد كتابة التقرير`,noNarration:`لا كلام مسجَّل في هذه الجلسة.`,pointingAt:e=>`أثناء الإشارة إلى ${e}`,translating:`جارٍ الترجمة…`,translate:`ترجم`,translatedFrom:(e,t)=>`ترجمه ${t??`الذكاء الاصطناعي`} من التقرير ${e===`ar`?`العربي`:`الإنجليزي`}.`,notTranslated:`لم يُترجم بعد.`,tabs:{errors:`الأخطاء`,network:`الشبكة`,speed:`السرعة`,pages:`الصفحات`},chips:{all:`الكل`,speech:`ما قيل`,issues:`المشكلات`,actions:`الإجراءات`,network:`الشبكة`},noErrors:`لا أخطاء JavaScript ولا أخطاء في وحدة التحكم.`,noRequests:`لم يرسل التطبيق أي طلبات.`,summarised:e=>`لُخّصت أحداث متشابهة (${e}): كلٌّ منها محسوب في الأعداد.`,dropped:e=>`لم تُسجَّل بعض الأحداث (${e}): لم تستطع صفحة التطبيق الاحتفاظ بها بينما لم يكن الاستوديو يستجيب.`,nothingHere:`لا شيء هنا.`,cols:{request:`الطلب`,calls:`المرات`,avg:`المتوسط`,status:`الحالة`},verify:`تحقّق من الإصلاحات`,verifyHint:`أعد خطوات هذه الجلسة في تطبيقك الآن، وتحقّق هل ما زالت كل ملاحظة تحدث.`,verifying:`تجري مقارنة الإعادة بالجلسة…`,verdicts:{fixed:`أُصلحت`,still:`ما زالت تحدث`,unknown:`تعذّر التحقّق`},replayed:(e,t)=>`أُعيدت ${e} من ${t} خطوة`,verifySummary:(e,t,n)=>[e&&`${e} أُصلحت`,t&&`${t} ما زالت تحدث`,n&&`${n} تعذّر التحقّق منها`].filter(Boolean).join(` · `),stoppedAt:(e,t)=>`توقّفت عند «${e}» (${t}).`,fresh:`جديد في الإعادة`,verifiedAgo:e=>`آخر تحقّق ${e}`,againBtn:`أعد مرة أخرى`,verifyTitle:`التحقّق بإعادة الخطوات`,noSteps:`لا نقرات ولا كتابة في هذه الجلسة لإعادتها.`,showMore:e=>`اعرض ${e} أخرى`,notListed:e=>`${ge(e,Me.issue)} أخرى مشابهة غير مدرجة.`,momentsNotListed:e=>`${ge(e,[`لحظة واحدة`,`لحظتان`,`لحظات`,`لحظة`])} متكررة أو روتينية غير مدرجة.`}};function dt(e){return e?e.parts?.length?e.parts:[{startedAt:e.startedAt,bytes:e.bytes,file:`video.webm`}]:[]}var ft=(0,G.forwardRef)(function({id:e,video:t,shots:n,start:r,current:i,onTime:a,onZoom:o,lang:s=`en`},c){let l=(0,G.useRef)(null),u=(0,G.useRef)(!1),d=dt(t),[f,p]=(0,G.useState)(0),m=(0,G.useRef)(null),h=d[Math.min(f,d.length-1)];if((0,G.useImperativeHandle)(c,()=>({seek:e=>{if(!d.length)return;let t=0;for(let n=0;n<d.length;n++)d[n].startedAt<=e&&(t=n);let n=Math.max(0,(e-d[t].startedAt)/1e3-.5),r=l.current;t!==f||!r?(m.current={at:n,play:!1},p(t)):u.current?r.currentTime=n:m.current={at:n,play:!1}}})),(0,G.useEffect)(()=>{let e=l.current;if(!e)return;u.current=!1;let t=()=>{u.current=!0;let t=m.current;m.current=null,t&&(e.currentTime=t.at,t.play&&e.play().catch(()=>void 0))},n=()=>{e.duration===1/0||Number.isNaN(e.duration)?(e.currentTime=1e7,e.addEventListener(`timeupdate`,()=>{e.currentTime=0,t()},{once:!0})):t()};return e.addEventListener(`loadedmetadata`,n),()=>e.removeEventListener(`loadedmetadata`,n)},[t,f]),h){let t=d.indexOf(h);return(0,K.jsxs)(`div`,{className:`space-y-2`,children:[(0,K.jsx)(`div`,{className:`overflow-hidden rounded-[12px] bg-black ring-1 ring-line`,children:(0,K.jsx)(`video`,{ref:l,src:t===0?`/api/sessions/${e}/video.webm`:`/api/sessions/${e}/video/${t+1}`,controls:!0,preload:`auto`,className:`aspect-video w-full bg-black object-contain`,onTimeUpdate:e=>u.current&&a(h.startedAt+e.currentTarget.currentTime*1e3),onEnded:()=>{t+1>=d.length||(m.current={at:0,play:!0},p(t+1))}},t)}),d.length>1&&(0,K.jsx)(`div`,{role:`tablist`,"aria-label":`Screen recordings`,className:`flex flex-wrap gap-1`,children:d.map((e,n)=>(0,K.jsxs)(`button`,{role:`tab`,"aria-selected":n===t,"data-hand":!0,onClick:()=>{m.current={at:0,play:!1},p(n)},className:`tabular rounded-[6px] px-2 py-1 text-[11px] ring-1 ring-inset ${n===t?`bg-ai-soft text-ai-fg ring-ai-line/40`:`text-fg-3 ring-line hover:text-fg`}`,children:[`Recording `,n+1,` · `,Y(e.startedAt-r),e.ms?`–${Y(e.startedAt-r+e.ms)}`:``]},e.file))})]})}if(!n.length)return(0,K.jsxs)(`div`,{className:`flex aspect-video flex-col items-center justify-center gap-2 rounded-[12px] bg-sunken text-[12px] text-fg-3 ring-1 ring-inset ring-line`,children:[(0,K.jsx)(Ke,{className:`size-5`}),s===`ar`?`لا تسجيل للشاشة في هذه الجلسة`:`No screen recording for this session`]});let g=i??n[0].t,_=0;for(let e=0;e<n.length;e++)n[e].t<=g+1500&&(_=e);let v=n[_],y=e=>a(n[Math.max(0,Math.min(n.length-1,e))].t);return(0,K.jsxs)(`div`,{className:`space-y-2`,children:[(0,K.jsxs)(`button`,{"data-hand":!0,onClick:()=>o(v.name),className:`relative block w-full overflow-hidden rounded-[12px] bg-sunken ring-1 ring-line`,children:[(0,K.jsx)(`img`,{src:`/api/sessions/${e}/shots/${v.name}`,alt:`Screen at ${Y(v.t-r)}`,className:`aspect-video w-full object-contain`}),(0,K.jsxs)(`span`,{className:`tabular absolute bottom-2 start-2 rounded-[6px] bg-black/60 px-1.5 py-0.5 text-[11px] text-white`,children:[Y(v.t-r),` · `,v.reason]})]}),(0,K.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,K.jsx)(S,{size:`sm`,onClick:()=>y(_-1),disabled:_===0,"aria-label":`Previous screenshot`,children:(0,K.jsx)(Be,{})}),(0,K.jsx)(`div`,{className:`flex min-w-0 flex-1 gap-1 overflow-x-auto py-0.5`,children:n.map((t,n)=>(0,K.jsx)(`button`,{"data-hand":!0,onClick:()=>a(t.t),className:`h-9 w-14 shrink-0 overflow-hidden rounded-[5px] ring-1 ${n===_?`ring-2 ring-ai`:`ring-line opacity-70 hover:opacity-100`}`,children:(0,K.jsx)(`img`,{src:`/api/sessions/${e}/shots/${t.name}`,alt:``,loading:`lazy`,className:`h-full w-full object-cover object-top`})},t.name))}),(0,K.jsx)(S,{size:`sm`,onClick:()=>y(_+1),disabled:_===n.length-1,"aria-label":`Next screenshot`,children:(0,K.jsx)(we,{})})]})]})});function pt(e,t){let n=0,r=e.length-2;for(;n<r;){let i=n+r>>1;e[i+1]<=t?n=i+1:r=i}return Math.max(0,n)}function mt({items:e,keyOf:t,estimate:n,render:r,className:i,reveal:a,overscan:o=500,empty:s}){let c=(0,G.useRef)(null),l=(0,G.useRef)(null),u=(0,G.useRef)(new Map),[d,f]=(0,G.useState)(0),[p,m]=(0,G.useState)({top:0,height:900}),h=(0,G.useRef)(0),g=(0,G.useMemo)(()=>{let r=Array(e.length+1);r[0]=0;for(let i=0;i<e.length;i++)r[i+1]=r[i]+(u.current.get(t(e[i]))??n(e[i]));return r},[e,d]),_=e.length?pt(g,p.top-o):0,v=_;for(;v<e.length-1&&g[v+1]<p.top+p.height+o;)v++;let y=e.slice(_,v+1);return(0,G.useLayoutEffect)(()=>{let e=l.current?.children;if(!e)return;let n=!1;for(let r=0;r<e.length;r++){let i=e[r];if(i.dataset.vkey==null)continue;let a=y[r];if(!a)continue;let o=i.offsetHeight,s=t(a);o&&u.current.get(s)!==o&&(u.current.set(s,o),n=!0)}n&&f(e=>e+1)}),(0,G.useLayoutEffect)(()=>{let e=c.current;if(!e)return;let t=()=>m({top:e.scrollTop,height:e.clientHeight||900});t();let n=new ResizeObserver(t);return n.observe(e),()=>{n.disconnect(),cancelAnimationFrame(h.current)}},[]),(0,G.useLayoutEffect)(()=>{if(a==null)return;let n=c.current,r=e.findIndex(e=>t(e)===a);if(!n||r<0)return;let i=g[r],o=g[r+1];i<n.scrollTop?n.scrollTop=Math.max(0,i-8):o>n.scrollTop+n.clientHeight&&(n.scrollTop=o-n.clientHeight+8)},[a]),(0,K.jsx)(`div`,{ref:c,className:i,onScroll:()=>{cancelAnimationFrame(h.current),h.current=requestAnimationFrame(()=>{let e=c.current;e&&m({top:e.scrollTop,height:e.clientHeight||900})})},children:e.length?(0,K.jsx)(`div`,{style:{position:`relative`,height:g[e.length]},children:(0,K.jsx)(`div`,{ref:l,style:{position:`absolute`,top:g[_],left:0,right:0},children:y.map(e=>{let n=t(e);return(0,K.jsx)(`div`,{"data-vkey":n,children:r(e)},n)})})}):s})}var ht={action:(0,K.jsx)(oe,{}),navigation:(0,K.jsx)(qe,{}),speech:(0,K.jsx)(re,{}),error:(0,K.jsx)(N,{}),network:(0,K.jsx)(We,{}),frustration:(0,K.jsx)(Pe,{}),performance:(0,K.jsx)(de,{}),mark:(0,K.jsx)(ae,{}),shot:(0,K.jsx)(O,{}),command:(0,K.jsx)(le,{}),console:(0,K.jsx)(tt,{})},gt={speech:`text-human-fg`,error:`text-bad`,frustration:`text-bad`,network:`text-warn`,performance:`text-warn`,mark:`text-ai-fg`,console:`text-warn`};function _t({items:e,omitted:t=0,start:n,current:i,onPick:a,lang:o,t:s}){let c=e=>o===`ar`?e.textAr??e.text:e.text,l=e=>o===`ar`?e.detailAr??e.detail:e.detail,[u,d]=(0,G.useState)(`all`),f=(0,G.useMemo)(()=>e.filter(e=>e.kind===`shot`?!1:u===`all`?!0:u===`speech`?e.kind===`speech`||e.kind===`mark`:u===`issues`?!!e.issue||e.kind===`error`||e.kind===`frustration`:u===`network`?e.kind===`network`:e.kind===`action`||e.kind===`navigation`||e.kind===`command`),[e,u]),p=i==null?null:f.reduce((e,t)=>t.t<=i+300?t:e,null),m={speech:e.filter(e=>e.kind===`speech`).length,issues:e.filter(e=>e.issue).length},h=[{id:`all`,label:s.chips.all},{id:`speech`,label:`${s.chips.speech} ${m.speech}`},{id:`issues`,label:`${s.chips.issues} ${m.issues}`},{id:`actions`,label:s.chips.actions},{id:`network`,label:s.chips.network}];return(0,K.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col`,children:[(0,K.jsx)(`div`,{className:`flex flex-wrap gap-1 px-3 pb-2`,children:h.map(e=>(0,K.jsx)(`button`,{"data-hand":!0,onClick:()=>d(e.id),className:r(`h-6 rounded-full px-2.5 text-[11.5px] font-medium ring-1 ring-inset ring-line`,u===e.id?`bg-fg text-inverse ring-fg`:`text-fg-2 hover:bg-hover`),children:e.label},e.id))}),t>0&&(0,K.jsx)(`p`,{className:`px-3.5 pb-2 text-[11px] text-fg-3`,children:s.momentsNotListed(t)}),(0,K.jsx)(mt,{className:`min-h-0 flex-1 overflow-y-auto px-1.5 pb-3`,items:f,keyOf:e=>e.id,estimate:e=>e.kind===`speech`?56:e.src?48:32,reveal:p?.id??null,render:e=>(0,K.jsx)(vt,{x:e,start:n,active:p?.id===e.id,text:e.kind===`speech`?`“${e.text}”`:c(e),detail:e.kind===`speech`&&e.detail?l(e):void 0,onPick:a}),empty:(0,K.jsx)(`p`,{className:`px-3 py-6 text-center text-[12px] text-fg-3`,children:s.nothingHere})})]})}var vt=(0,G.memo)(function({x:e,start:t,active:n,text:i,detail:a,onPick:o}){return(0,K.jsxs)(`button`,{"data-tl":e.id,"data-hand":!0,onClick:()=>o(e),className:r(`flex w-full items-start gap-2 rounded-[8px] px-2 py-1.5 text-start transition-colors hover:bg-hover`,n&&`bg-active`,e.kind===`speech`&&`py-2`),children:[(0,K.jsx)(`span`,{className:`tabular w-9 shrink-0 pt-px text-[11px] text-fg-3`,children:Y(e.t-t)}),(0,K.jsx)(`span`,{className:r(`pt-[3px] text-fg-3 [&_svg]:size-[13px]`,gt[e.kind]),children:ht[e.kind]}),(0,K.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[(0,K.jsx)(`span`,{dir:e.kind===`speech`?`auto`:void 0,className:r(`block text-[12.5px] leading-snug`,e.kind===`speech`?`font-medium text-fg`:`text-fg-2`,(e.kind===`error`||e.kind===`frustration`)&&`text-bad`),children:i}),a||e.src?(0,K.jsxs)(`span`,{className:`mt-0.5 flex flex-wrap items-center gap-1.5 text-[11px] text-fg-3`,children:[a&&(0,K.jsx)(`span`,{children:a}),e.src&&(0,K.jsx)(`span`,{className:`truncate font-mono`,dir:`ltr`,children:e.src})]}):null]}),e.issue&&(0,K.jsx)(`span`,{className:`mt-0.5 shrink-0 rounded-[4px] bg-bad-soft px-1 text-[10px] font-semibold text-bad`,children:e.issue})]})});function yt(e){if(e.description)return e.description;let t=e.label||e.text;return t?`the “${t.slice(0,40)}” ${e.role??e.name}`:e.name}function bt(e){let{meta:t,analysis:n,report:r}=e;if(!n||!r)return``;let i=Q[r.lang],a=new Set(e.decisions?.skipped??[]),o=new Set((e.report??r).findings.filter(e=>a.has(e.title)).map(e=>e.id)),s=r.findings.filter(e=>!o.has(e.id)),c=[],l=n.scores;c.push(`## ${r.title}`,``),c.push(`**${t.name}** · ${new Date(t.startedAt).toLocaleString()} · ${Y(n.durationMs)} · ${t.appUrl}${t.git?` · \`${t.git.branch}@${t.git.commit}\``:``}`,``),c.push(r.summary,``),c.push(`| ${i.overall} | ${i.stability} | ${i.usability} | ${i.performance} | ${i.accessibility} |`,`|---|---|---|---|---|`,`| **${l.overall}** | ${l.stability.score} | ${l.usability.score} | ${l.performance.score} | ${l.accessibility.score} |`,``);let u=e.verification,d=u?s.map(e=>u.findings[e.id]).filter(Boolean):[];if(u&&d.length){let e=e=>d.filter(t=>t.verdict===e).length,t=u.steps.failed;c.push(`**${i.verifyTitle}:** ${i.verifySummary(e(`fixed`),e(`still`),e(`unknown`))}. ${i.replayed(u.steps.done,u.steps.total)}.${t?` ${i.stoppedAt(r.lang===`ar`?t.descriptionAr??t.description:t.description,Oe(t.reason,r.lang))}`:``}`,``)}if(s.length&&(c.push(`### ${i.findings}`,``),s.forEach((e,t)=>{let n=u?.findings[e.id];c.push(`${t+1}. **[${i.severity[e.severity]}] ${e.title}**${n?` · ${n.verdict===`fixed`?`✅`:n.verdict===`still`?`❌`:`❔`} ${i.verdicts[n.verdict]}: ${r.lang===`ar`?n.whyAr:n.why}`:``}`),c.push(` ${e.what}`),e.quote&&c.push(` > “${e.quote}”`),e.expected&&c.push(` ${i.expected}: ${e.expected}`),e.location&&c.push(` ${i.where}: \`${e.location}\``),c.push(` ${i.howToFix}: ${e.fix}`),e.steps.length&&c.push(` ${i.steps}: ${e.steps.join(` → `)}`),c.push(``)})),r.suggestions.length){c.push(`### ${i.suggestions}`,``);for(let e of r.suggestions)c.push(`- **${i[e.kind]}** (${i.effort[e.effort]}): ${e.title}. ${e.why}`);c.push(``)}return r.nextSteps.length&&(c.push(`### ${i.nextSteps}`,``),r.nextSteps.forEach((e,t)=>c.push(`${t+1}. ${e}`)),c.push(``)),c.push(`_Recorded with ${Ee.name}${r.source===`local`?``:`; report by ${g(r.model)}`}._`),c.join(`
|
|
4
|
-
`)}function xt({segments:e,start:t,current:n,t:r,reportAt:i,onPlay:a,onCorrect:o,onRewrite:s}){let[c,l]=(0,G.useState)(null),u=i==null?0:e.filter(e=>e.editedAt&&e.editedAt>i).length,d=(0,G.useRef)(null),f=n==null?null:e.reduce((e,t)=>t.start<=n+300?t:e,null);return(0,G.useEffect)(()=>{f&&c==null&&d.current?.querySelector(`[data-seg="${f.id}"]`)?.scrollIntoView({block:`nearest`,behavior:`smooth`})},[f?.id]),(0,K.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col`,children:[u>0&&(0,K.jsxs)(`div`,{className:`mx-3 mb-2 flex items-center gap-2 rounded-[10px] bg-ai-soft px-3 py-2 ring-1 ring-inset ring-ai-line/30`,"data-rewrite":!0,children:[(0,K.jsx)(`p`,{className:`min-w-0 flex-1 text-[12px] leading-snug text-ai-fg`,children:r.notInReport(u)}),(0,K.jsx)(E,{size:`xs`,variant:`ai`,icon:(0,K.jsx)(A,{}),onClick:s,children:r.rewrite})]}),e.length>0&&(0,K.jsx)(`p`,{className:`px-3.5 pb-2 text-[11.5px] leading-snug text-fg-3`,children:r.correctHint}),(0,K.jsxs)(`div`,{ref:d,className:`min-h-0 flex-1 overflow-y-auto px-2 pb-2`,"data-transcript":!0,children:[!e.length&&(0,K.jsx)(`p`,{className:`px-3 py-6 text-center text-[12px] text-fg-3`,children:r.noNarration}),e.map(e=>(0,K.jsx)(St,{s:e,start:t,t:r,active:f?.id===e.id,editing:c===e.id,onEdit:t=>l(t?e.id:null),onPlay:()=>a(e),onCorrect:t=>o(e,t)},e.id))]})]})}function St({s:e,start:t,t:n,active:i,editing:a,onEdit:o,onPlay:s,onCorrect:c}){let[l,u]=(0,G.useState)(e.text),[d,f]=(0,G.useState)(!1);(0,G.useEffect)(()=>u(e.text),[e.text,a]);let p=async()=>{let t=l.replace(/\s+/g,` `).trim();if(!t||t===e.text)return o(!1);f(!0);try{await c(t),o(!1)}finally{f(!1)}};return(0,K.jsxs)(`div`,{"data-seg":e.id,className:r(`group flex gap-2.5 rounded-[9px] px-2 py-2`,i&&!a?`bg-human-soft`:`hover:bg-hover`),children:[(0,K.jsxs)(`button`,{"data-hand":!0,onClick:s,title:`Play`,className:`mt-px flex shrink-0 flex-col items-center gap-1 text-fg-3 hover:text-fg`,children:[(0,K.jsx)(`span`,{className:`tabular text-[11px]`,children:Y(e.start-t)}),(0,K.jsx)(j,{className:`size-3 fill-current opacity-60 group-hover:opacity-100`})]}),(0,K.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[a?(0,K.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,K.jsx)(`textarea`,{autoFocus:!0,dir:`auto`,value:l,onChange:e=>u(e.target.value),onKeyDown:e=>{e.key===`Enter`&&!e.shiftKey?(e.preventDefault(),p()):e.key===`Escape`&&(e.stopPropagation(),o(!1))},rows:Math.min(5,Math.max(2,Math.ceil(l.length/48))),className:`w-full resize-none rounded-[8px] bg-sunken px-2 py-1.5 text-[13px] leading-relaxed text-fg outline-none ring-1 ring-ai-line`,"aria-label":n.correct}),(0,K.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,K.jsx)(E,{size:`xs`,variant:`ai`,icon:(0,K.jsx)(b,{}),onClick:()=>void p(),disabled:d,children:n.save}),(0,K.jsx)(E,{size:`xs`,variant:`ghost`,onClick:()=>o(!1),children:n.cancel}),e.original&&(0,K.jsx)(`span`,{className:`min-w-0 truncate text-[11px] text-fg-3`,dir:`auto`,children:n.heard(e.original)})]})]}):(0,K.jsx)(`button`,{"data-hand":!0,onClick:()=>o(!0),className:`block w-full text-start`,title:n.correct,children:(0,K.jsxs)(`span`,{dir:`auto`,className:`block text-[13px] leading-relaxed text-fg`,children:[e.text,(0,K.jsx)(Ye,{className:`ms-1.5 inline size-3 text-fg-3 opacity-0 group-hover:opacity-100`})]})}),(0,K.jsxs)(`div`,{className:`mt-0.5 flex flex-wrap items-center gap-x-2 gap-y-0.5 text-[11px] text-fg-3`,children:[(0,K.jsx)(`span`,{className:`rounded-[4px] bg-active px-1 text-[10px] uppercase`,children:e.lang}),e.original&&!a&&(0,K.jsx)(`span`,{className:`rounded-[4px] bg-ai-soft px-1 text-[10px] text-ai-fg`,title:n.heard(e.original),"data-corrected":!0,children:n.corrected}),e.el&&(0,K.jsx)(`span`,{className:`truncate`,children:n.pointingAt(yt(e.el))})]})]})]})}function Ct(e,t){let n=new Intl.RelativeTimeFormat(t,{numeric:`auto`}),r=Math.round((e-Date.now())/1e3);if(Math.abs(r)<45)return t===`ar`?`الآن`:`just now`;let i=Math.round(r/60);if(Math.abs(i)<60)return n.format(i,`minute`);let a=Math.round(i/60);return Math.abs(a)<24?n.format(a,`hour`):n.format(Math.round(a/24),`day`)}function wt({verification:e,verifying:t,findings:n,t:i,lang:a,canReplay:o,onReplay:c}){if(t)return(0,K.jsxs)(`section`,{className:`flex items-center gap-3 rounded-[14px] bg-raised px-4 py-3.5 ring-1 ring-inset ring-ai-line/40`,"data-verification":`pending`,children:[(0,K.jsx)(s,{className:`size-4 text-ai`}),(0,K.jsx)(`span`,{className:`shimmer-text text-[13px] font-medium`,children:i.verifying})]});if(!e)return null;let l=n.map(t=>e.findings[t.id]).filter(Boolean),u={fixed:0,still:0,unknown:0};for(let e of l)u[e.verdict]++;let d=e.steps.failed;return(0,K.jsxs)(`section`,{className:`rounded-[14px] bg-raised p-4 ring-1 ring-inset ring-line`,"data-verification":`done`,children:[(0,K.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-2 gap-y-1`,children:[(0,K.jsxs)(`h2`,{className:`flex items-center gap-2 text-[15px] font-semibold text-fg`,children:[(0,K.jsx)($e,{className:`size-4 text-ai`}),i.verifyTitle]}),(0,K.jsx)(`span`,{className:`text-[11.5px] text-fg-3`,children:i.verifiedAgo(Ct(e.at,a))}),(0,K.jsx)(E,{size:`sm`,variant:`ghost`,className:`ms-auto`,icon:(0,K.jsx)(U,{}),onClick:c,disabled:!o,"data-verify-again":!0,children:i.againBtn})]}),l.length>0&&(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(`div`,{className:`mt-3 flex h-1.5 gap-0.5 overflow-hidden rounded-full bg-sunken`,"aria-hidden":!0,children:[`fixed`,`still`,`unknown`].map(e=>u[e]?(0,K.jsx)(`span`,{className:r(`h-full`,J[e].bar),style:{width:`${u[e]/l.length*100}%`}},e):null)}),(0,K.jsx)(`p`,{className:`mt-2 text-[13px] font-medium text-fg`,"data-verify-summary":!0,children:i.verifySummary(u.fixed,u.still,u.unknown)})]}),(0,K.jsxs)(`p`,{className:`mt-1 text-[12px] text-fg-3`,"data-verify-steps":!0,children:[i.replayed(e.steps.done,e.steps.total),d&&(0,K.jsxs)(K.Fragment,{children:[` · `,(0,K.jsx)(`span`,{className:`text-warn`,children:i.stoppedAt(a===`ar`?d.descriptionAr??d.description:d.description,Oe(d.reason,a))})]})]}),e.fresh.length>0&&(0,K.jsxs)(`div`,{className:`mt-3 rounded-[10px] bg-warn-soft px-3 py-2`,"data-verify-fresh":!0,children:[(0,K.jsxs)(`div`,{className:`mb-1 flex items-center gap-1.5 text-[12px] font-semibold text-warn`,children:[(0,K.jsx)(N,{className:`size-3.5`}),i.fresh,` (`,e.fresh.length,`)`]}),(0,K.jsx)(`ul`,{className:`space-y-1 text-[12.5px] text-fg-2`,children:e.fresh.slice(0,8).map((e,t)=>(0,K.jsxs)(`li`,{className:`flex items-center gap-2`,children:[(0,K.jsx)(`span`,{className:r(`shrink-0 rounded-[4px] px-1 text-[10px] font-semibold uppercase`,q[e.severity].chip),children:i.severity[e.severity]}),(0,K.jsx)(`span`,{className:`min-w-0 truncate`,dir:`auto`,children:a===`ar`?e.titleAr??e.title:e.title})]},t))})]})]})}function Tt(){let e=v(e=>e.open),t=v(e=>e.detail),n=v(e=>e.detailError),r=o(!!e,{onEscape:()=>!document.querySelector(`[data-lightbox]`)&&x.closeReport()});return(0,K.jsx)(te,{children:e&&(0,K.jsx)(ee.div,{ref:r,tabIndex:-1,initial:{opacity:0,y:8},animate:{opacity:1,y:0},exit:{opacity:0,y:8},transition:{duration:.18},className:`fixed inset-0 z-40 flex flex-col bg-bg outline-none`,role:`dialog`,"aria-modal":`true`,"aria-label":`Session report`,children:t&&t.meta.id===e?(0,K.jsx)(Ot,{detail:t}):(0,K.jsx)(Et,{error:n})},`report`)})}function Et({error:e}){return(0,K.jsxs)(`div`,{className:`flex flex-1 flex-col items-center justify-center gap-3 text-[13px] text-fg-3`,children:[e?(0,K.jsx)(`span`,{className:`text-bad`,children:e}):(0,K.jsx)(s,{}),(0,K.jsx)(E,{size:`sm`,onClick:()=>x.closeReport(),children:`Back to the studio`})]})}function Dt(e,t){let n=e.report;return n?(t??n.lang)===n.lang?n:e.translation??n:null}function Ot({detail:e}){let{meta:t,analysis:n,decisions:r}=e,i=Dt(e,v(e=>e.reportLang)),a=i?.lang??`en`,o=Q[a],[s,c]=(0,G.useState)(null),[l,u]=(0,G.useState)(null),[d,f]=(0,G.useState)(`timeline`),p=(0,G.useRef)(null),h=(0,G.useRef)(null),g=t.startedAt,_=t.status===`processing`||t.status===`recording`,b=kt(e),C=e=>{c(e),p.current?.seek(e)},T=e=>{C(e.start);let t=h.current;if(!t||e.audioAt==null)return;t.currentTime=Math.max(0,e.audioAt-.2),t.play();let n=e.audioAt+(e.end-e.start)/1e3+.4,r=()=>{t.currentTime>=n?t.pause():t.paused||requestAnimationFrame(r)};requestAnimationFrame(r)},E=e=>{if(e.kind===`speech`){let t=n?.transcript.find(t=>t.start===e.t);if(t)return T(t)}C(e.t)},D=t=>e.report?.findings.find(e=>e.id===t)?.title,O=new Set((e.report?.findings??[]).filter(e=>r.skipped.includes(e.title)).map(e=>e.id)),k={show:C,play:T,shotUrl:e=>`/api/sessions/${t.id}/shots/${e}`,zoom:u,fix:e=>{n&&(x.closeReport(),m.fixFromReport(e,y(e,n),n))},fixAll:e=>{n&&(x.closeReport(),m.fixFindings(e.map(e=>({f:e,items:y(e,n)})),n))},test:e=>{n&&(x.closeReport(),m.testFromReport(e,y(e,n),n,t.appUrl))},skip:e=>{let n=D(e.id);n&&x.setSkipped(t.id,[...r.skipped,n])},restore:e=>{let n=D(e.id);x.setSkipped(t.id,r.skipped.filter(e=>e!==n))}};return(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(Mt,{detail:e,report:i,t:o,replay:b}),(0,K.jsx)(`div`,{className:`min-h-0 flex-1 overflow-y-auto`,children:(0,K.jsxs)(`div`,{className:`mx-auto grid max-w-[1480px] gap-6 px-5 py-6 xl:grid-cols-[minmax(0,1fr)_440px]`,dir:a===`ar`?`rtl`:`ltr`,children:[(0,K.jsxs)(`main`,{className:`min-w-0 space-y-6`,children:[(0,K.jsx)(Nt,{detail:e,report:i,t:o,busy:_,open:i?i.findings.filter(e=>!O.has(e.id)).length:0}),i&&(0,K.jsx)(wt,{verification:e.verification,verifying:e.verifying,findings:i.findings.filter(e=>!O.has(e.id)),t:o,lang:a,canReplay:b.can,onReplay:b.run}),n&&(0,K.jsx)(Se,{scores:n.scores,previous:e.previous?.scores??null,report:i,t:o}),i&&n&&(0,K.jsx)(ct,{findings:i.findings,skipped:O,analysis:n,t:o,act:k,start:g,verdicts:e.verification?.findings??null,lang:a}),i&&(0,K.jsx)(Ft,{report:i,t:o}),i&&(0,K.jsx)(It,{report:i,t:o}),n&&(0,K.jsx)(ut,{analysis:n,start:g,onPick:C,lang:a,t:o})]}),(0,K.jsx)(`aside`,{className:`min-w-0`,children:(0,K.jsxs)(`div`,{className:`space-y-3 xl:sticky xl:top-0 xl:flex xl:max-h-[calc(100vh-120px)] xl:flex-col`,children:[(0,K.jsx)(ft,{ref:p,id:t.id,video:t.video,shots:n?.shots??[],start:g,current:s,onTime:c,onZoom:u,lang:a}),t.audioSeconds>0&&(0,K.jsxs)(`div`,{className:`flex items-center gap-2 rounded-[10px] bg-raised px-2.5 py-1.5 ring-1 ring-inset ring-line`,children:[(0,K.jsx)(Ge,{className:`size-4 shrink-0 text-fg-3`}),(0,K.jsx)(`audio`,{ref:h,src:`/api/sessions/${t.id}/audio.wav`,controls:!0,preload:`metadata`,className:`h-8 w-full`})]}),n&&(0,K.jsxs)(`div`,{className:`flex min-h-[320px] flex-col rounded-[14px] bg-raised pt-2.5 ring-1 ring-inset ring-line xl:min-h-0 xl:flex-1`,children:[(0,K.jsxs)(`div`,{className:`flex items-center gap-4 px-3.5 pb-2`,role:`tablist`,children:[(0,K.jsx)(At,{on:d===`timeline`,onClick:()=>f(`timeline`),children:o.timeline}),(0,K.jsxs)(At,{on:d===`transcript`,onClick:()=>f(`transcript`),children:[o.transcript,` `,(0,K.jsx)(`span`,{className:`tabular text-fg-3`,children:n.transcript.length})]}),(0,K.jsx)(`span`,{className:`tabular ms-auto text-[11.5px] text-fg-3`,children:Y(n.durationMs)})]}),d===`timeline`?(0,K.jsx)(_t,{items:n.timeline,omitted:n.more?.timeline,start:g,current:s,onPick:E,lang:a,t:o}):(0,K.jsx)(xt,{segments:n.transcript,start:g,current:s,t:o,reportAt:e.report?.at??null,onPlay:T,onCorrect:(e,n)=>x.correctSentence(t.id,e.id,n),onRewrite:()=>void x.regenerate(t.id,!0)})]})]})})]})}),(0,K.jsx)(te,{children:l&&(0,K.jsxs)(ee.div,{"data-lightbox":!0,initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},className:`fixed inset-0 z-50 flex items-center justify-center bg-black/80 p-6`,onClick:()=>u(null),children:[(0,K.jsx)(`img`,{src:k.shotUrl(l),alt:``,className:`max-h-full max-w-full rounded-[10px] shadow-pop`}),(0,K.jsx)(S,{className:`absolute end-4 top-4 text-white hover:bg-white/10`,onClick:()=>u(null),"aria-label":`Close`,children:(0,K.jsx)(w,{})})]})})]})}function kt(e){let t=f(e=>!!e.replay),n=e.analysis?.steps.filter(e=>e.kind!==`navigate`&&e.locator).length??0;return{can:n>0&&e.meta.status===`ready`&&e.meta.source!==`replay`&&!e.verifying&&!t,steps:n,run:()=>void m.verifySession(e)}}function At({on:e,onClick:t,children:n}){return(0,K.jsx)(`button`,{"data-hand":!0,role:`tab`,"aria-selected":e,onClick:t,className:r(`relative h-7 text-[13px] font-semibold transition-colors`,e?`text-fg after:absolute after:inset-x-0 after:-bottom-[1px] after:h-0.5 after:bg-fg`:`text-fg-3 hover:text-fg-2`),children:n})}function jt({detail:e,report:t}){let n=e.report;if(!n)return null;let i=n.lang===`ar`?`en`:`ar`,a=!e.translation&&e.translating;return(0,K.jsxs)(`div`,{className:`flex items-center gap-1.5`,"data-report-lang":t?.lang,children:[(0,K.jsx)(`div`,{className:`flex rounded-[8px] bg-sunken p-0.5 ring-1 ring-inset ring-line`,role:`radiogroup`,"aria-label":`Report language`,children:[`en`,`ar`].map(e=>(0,K.jsx)(`button`,{"data-hand":!0,role:`radio`,"aria-checked":t?.lang===e,onClick:()=>x.setReportLang(e),className:r(`h-6 rounded-[6px] px-2 text-[12px] font-medium transition-colors`,t?.lang===e?`bg-raised text-fg shadow-sm`:`text-fg-3 hover:text-fg-2`),children:e===`en`?`English`:`العربية`},e))}),a&&(0,K.jsxs)(`span`,{className:`flex items-center gap-1 text-[11.5px] text-fg-3`,children:[(0,K.jsx)(s,{className:`size-3`}),(0,K.jsx)(`bdi`,{lang:i,children:Q[i].translating})]}),!e.translation&&!e.translating&&n.source!==`local`&&(0,K.jsx)(E,{size:`xs`,variant:`ghost`,icon:(0,K.jsx)(L,{}),onClick:()=>void x.retranslate(e.meta.id),children:(0,K.jsx)(`bdi`,{lang:i,children:Q[i].translate})})]})}function Mt({detail:e,report:t,t:n,replay:a}){let{meta:o}=e,[s,c]=(0,G.useState)(!1),[u,f]=(0,G.useState)(o.name),[m,h]=(0,G.useState)(!1);(0,G.useEffect)(()=>f(o.name),[o.name]);let g=o.endedAt?ye(o.endedAt-o.startedAt):null,_=o.audioSeconds>0||!!e.analysis?.transcript.length,v=async()=>{e.analysis&&t&&(await navigator.clipboard.writeText(bt({...e,report:t})),c(!0),setTimeout(()=>c(!1),1600))};return(0,K.jsxs)(`header`,{className:`flex h-[54px] shrink-0 items-center gap-3 border-b border-line bg-panel px-3`,children:[(0,K.jsx)(S,{onClick:()=>x.closeReport(),"aria-label":n.back,children:(0,K.jsx)(D,{})}),(0,K.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[m?(0,K.jsx)(`input`,{autoFocus:!0,value:u,onChange:e=>f(e.target.value),onBlur:()=>{h(!1),u.trim()&&u!==o.name&&x.rename(o.id,u.trim())},onKeyDown:e=>e.key===`Enter`&&e.target.blur(),className:`h-6 w-full max-w-[420px] rounded-[6px] bg-sunken px-1.5 text-[13.5px] font-semibold text-fg outline-none ring-1 ring-ai-line`}):(0,K.jsx)(`button`,{"data-hand":!0,onClick:()=>h(!0),className:`max-w-full truncate text-start text-[13.5px] font-semibold text-fg hover:underline hover:decoration-line-strong`,children:o.name}),(0,K.jsxs)(`div`,{className:`flex items-center gap-1.5 truncate text-[11.5px] text-fg-3`,children:[(0,K.jsx)(`span`,{children:new Date(o.startedAt).toLocaleString(void 0,{dateStyle:`medium`,timeStyle:`short`})}),g&&(0,K.jsxs)(`span`,{children:[`· `,g]}),(0,K.jsxs)(`span`,{className:`truncate font-mono`,children:[`· `,p(o.appUrl)]}),o.git&&(0,K.jsxs)(`span`,{className:`font-mono`,children:[`· `,o.git.branch,`@`,o.git.commit,o.git.dirty?`*`:``]}),_&&(0,K.jsxs)(`span`,{children:[`· `,o.lang===`ar`?`العربية`:o.lang===`en`?`English`:`Arabic + English`]})]})]}),(0,K.jsxs)(`div`,{className:`flex items-center gap-1`,children:[o.source!==`replay`&&(0,K.jsx)(E,{size:`sm`,variant:`ai`,icon:(0,K.jsx)(U,{}),disabled:!a.can,title:a.steps?n.verifyHint:n.noSteps,onClick:a.run,"data-verify":!0,children:n.verify}),(0,K.jsx)(`span`,{className:`mx-1 h-5 w-px bg-line`}),(0,K.jsx)(jt,{detail:e,report:t}),(0,K.jsx)(`span`,{className:`mx-1 h-5 w-px bg-line`}),(0,K.jsx)(E,{size:`sm`,icon:s?(0,K.jsx)(b,{}):(0,K.jsx)(He,{}),onClick:()=>void v(),disabled:!t,children:s?`Copied`:`Copy as Markdown`}),(0,K.jsxs)(`a`,{href:`/api/sessions/${o.id}/export.html?download=1&lang=${t?.lang??``}`,download:!0,"data-hand":!0,"aria-disabled":!t||void 0,className:r(`inline-flex h-7 shrink-0 select-none items-center gap-1.5 whitespace-nowrap rounded-[7px] bg-raised px-2.5 text-[12.5px] font-medium text-fg ring-1 ring-inset ring-line-strong transition-colors hover:bg-hover [&_svg]:size-[14px]`,!t&&`pointer-events-none opacity-45`),children:[(0,K.jsx)(fe,{}),`Export HTML`]}),(0,K.jsxs)(De,{children:[(0,K.jsx)(ue,{asChild:!0,children:(0,K.jsx)(S,{"aria-label":`More`,children:(0,K.jsx)(pe,{})})}),(0,K.jsx)(me,{children:(0,K.jsxs)(Ce,{align:`end`,sideOffset:6,className:`z-[60] min-w-[230px] rounded-[10px] bg-raised p-1 shadow-pop`,children:[(0,K.jsx)($,{icon:(0,K.jsx)(i,{}),onSelect:()=>void x.regenerate(o.id,!0),children:`Rewrite the report`}),o.audioSeconds>0&&(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)($,{icon:(0,K.jsx)(A,{}),onSelect:()=>void x.retranscribe(o.id),children:`Transcribe the narration again`}),(0,K.jsxs)(Ie,{children:[(0,K.jsxs)(Fe,{className:`flex h-8 cursor-default items-center gap-2 rounded-[7px] px-2 text-[12.5px] text-fg outline-none data-[highlighted]:bg-hover [&_svg]:size-[14px] [&_svg]:text-fg-3`,children:[(0,K.jsx)(L,{}),`Transcribe as…`]}),(0,K.jsx)(me,{children:(0,K.jsxs)(he,{className:`z-[61] min-w-[160px] rounded-[10px] bg-raised p-1 shadow-pop`,children:[(0,K.jsx)($,{onSelect:()=>void x.retranscribe(o.id,`en`),children:`English`}),(0,K.jsx)($,{onSelect:()=>void x.retranscribe(o.id,`ar`),children:`العربية`}),(0,K.jsx)($,{onSelect:()=>void x.retranscribe(o.id,`auto`),children:`Arabic + English`})]})})]})]}),(0,K.jsx)(`a`,{href:`/api/sessions/${o.id}/export.html?lang=${t?.lang??``}`,target:`_blank`,rel:`noreferrer`,children:(0,K.jsx)($,{icon:(0,K.jsx)(V,{}),children:`Open the printable report`})}),(0,K.jsx)(Ne,{className:`my-1 h-px bg-line`}),(0,K.jsx)($,{icon:(0,K.jsx)(d,{}),danger:!0,onSelect:async()=>{await l({title:`Delete this session?`,body:`Its recordings, screenshots and report are deleted from this computer.`,action:`Delete session`,danger:!0})&&x.remove(o.id)},children:`Delete session`})]})})]})]})]})}function $({icon:e,children:t,onSelect:n,danger:i}){return(0,K.jsxs)(xe,{onSelect:n,className:r(`flex h-8 cursor-default items-center gap-2 rounded-[7px] px-2 text-[12.5px] text-fg outline-none data-[highlighted]:bg-hover [&_svg]:size-[14px] [&_svg]:text-fg-3`,i&&`text-bad [&_svg]:text-bad`),children:[e,t]})}function Nt({detail:e,report:t,t:n,busy:a,open:o}){let{meta:c}=e;if(c.source===`replay`&&c.replayOf&&!a){let e=c.replayOf;return(0,K.jsxs)(`section`,{className:`flex items-center gap-3 rounded-[16px] bg-raised p-6 ring-1 ring-inset ring-line`,children:[(0,K.jsx)(U,{className:`size-5 text-ai`}),(0,K.jsx)(`div`,{className:`text-[13.5px] text-fg-2`,children:`A replay of another session’s steps, to check its fixes. Its results are in that session’s report.`}),(0,K.jsx)(E,{size:`sm`,className:`ms-auto`,onClick:()=>x.openReport(e),children:`Open that report`})]})}if(a||!t)return(0,K.jsx)(`section`,{className:`rounded-[16px] bg-raised p-6 ring-1 ring-inset ring-line`,children:(0,K.jsxs)(`div`,{className:`flex items-center gap-3`,children:[c.status===`failed`?(0,K.jsx)(w,{className:`size-5 text-bad`}):(0,K.jsx)(s,{className:`size-5 text-ai`}),(0,K.jsxs)(`div`,{children:[(0,K.jsx)(`div`,{className:`text-[15px] font-semibold text-fg`,children:c.status===`failed`?`The report couldn’t be finished`:c.status===`recording`?`Still recording…`:`Preparing the report`}),(0,K.jsx)(`div`,{className:r(`mt-0.5 text-[12.5px]`,c.status===`failed`?`text-bad`:`shimmer-text`),children:c.status===`failed`?c.error:c.stage||`Working`})]}),c.status===`failed`&&(0,K.jsx)(E,{size:`sm`,className:`ms-auto`,icon:(0,K.jsx)(A,{}),onClick:()=>void x.regenerate(c.id,!0),children:`Try again`})]})});let l={ship:`bg-ok-soft text-ok`,"fix-first":`bg-warn-soft text-warn`,blocked:`bg-bad-soft text-bad`}[t.verdict],u=t.ms?Math.round(t.ms/1e3):null;return(0,K.jsxs)(`section`,{className:`relative overflow-hidden rounded-[16px] bg-raised p-6 ring-1 ring-inset ring-line`,children:[(0,K.jsx)(`div`,{className:`pointer-events-none absolute -end-24 -top-24 size-72 rounded-full bg-ai-soft blur-3xl`}),(0,K.jsxs)(`div`,{className:`relative`,children:[(0,K.jsx)(`span`,{className:r(`inline-flex h-6 items-center rounded-full px-2.5 text-[12px] font-semibold`,l),"data-verdict-badge":!0,children:t.verdict===`ship`&&!o?n.clean:n.verdict[t.verdict]}),(0,K.jsx)(`h1`,{className:`mt-3 text-[24px] font-semibold leading-tight tracking-[-0.02em] text-fg`,children:t.title}),(0,K.jsx)(`p`,{className:`mt-2 max-w-[78ch] text-[14px] leading-relaxed text-fg-2`,children:t.summary}),t.verdict===`ship`&&(0,K.jsx)(Pt,{detail:e,t:n}),(0,K.jsxs)(`p`,{className:`mt-3 flex items-center gap-1.5 text-[11.5px] text-fg-3`,children:[t.source===`local`?(0,K.jsx)(z,{className:`size-3.5`}):(0,K.jsx)(i,{className:`size-3.5 text-ai`}),t.source===`local`?n.writtenLocally:n.writtenBy(g(t.model),u),t.translatedFrom&&(0,K.jsxs)(`span`,{children:[`· `,n.translatedFrom(t.translatedFrom,t.translatedBy&&g(t.translatedBy))]})]})]})]})}function Pt({detail:e,t}){let n=e.analysis;return(0,K.jsxs)(`div`,{className:`mt-4 max-w-[78ch] rounded-[12px] bg-sunken px-3.5 py-3 ring-1 ring-inset ring-line`,"data-scope":!0,children:[(0,K.jsx)(`p`,{className:`text-[12.5px] leading-relaxed text-fg-2`,children:t.scope}),(0,K.jsxs)(`div`,{className:`mt-2.5 flex flex-wrap items-center gap-1.5`,children:[n&&(0,K.jsx)(E,{size:`sm`,icon:(0,K.jsx)(a,{}),title:t.addCheckHint,onClick:()=>(x.closeReport(),m.checkSession(n,e.meta.appUrl)),"data-add-check":!0,children:t.addCheck}),e.meta.source!==`autopilot`&&(0,K.jsx)(E,{size:`sm`,variant:`ghost`,icon:(0,K.jsx)(se,{}),onClick:()=>{x.closeReport(),T.getState().setUi({panelOpen:!0,panelTab:`sessions`}),setTimeout(()=>document.querySelector(`[data-autopilot-goal]`)?.focus(),250)},"data-try-autopilot":!0,children:t.tryAutopilot})]})]})}function Ft({report:e,t}){let[n,a]=(0,G.useState)(new Set),o=C();if(!e.suggestions.length)return null;let s=[`fix`,`improve`,`add`].map(t=>({k:t,items:e.suggestions.map((e,t)=>({s:e,i:t})).filter(({s:e})=>e.kind===t)})).filter(e=>e.items.length),c=e=>{let t=new Set(n);t.has(e)?t.delete(e):t.add(e),a(t)},l=()=>{let t=e.suggestions.filter((e,t)=>n.has(t));x.closeReport(),m.implementSuggestions(t,e)},u=n.size===e.suggestions.length;return(0,K.jsxs)(`section`,{className:`space-y-3`,"data-suggestions":!0,children:[(0,K.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,K.jsxs)(`h2`,{className:`flex items-center gap-2 text-[15px] font-semibold text-fg`,children:[(0,K.jsx)(z,{className:`size-4 text-fg-3`}),t.suggestions]}),(0,K.jsx)(`span`,{className:`text-[11.5px] text-fg-3`,children:t.pickHint(o)}),(0,K.jsxs)(`div`,{className:`ms-auto flex items-center gap-1.5`,children:[(0,K.jsx)(E,{size:`sm`,variant:`ghost`,onClick:()=>a(u?new Set:new Set(e.suggestions.map((e,t)=>t))),children:u?t.selectNone:t.selectAll}),(0,K.jsx)(E,{size:`sm`,variant:`ai`,icon:(0,K.jsx)(i,{}),disabled:!n.size,onClick:l,"data-implement":!0,children:t.implementSelected(n.size)})]})]}),(0,K.jsx)(`div`,{className:`grid gap-3 md:grid-cols-3`,children:s.map(e=>(0,K.jsxs)(`div`,{className:`space-y-2`,children:[(0,K.jsx)(`div`,{className:`text-[11.5px] font-semibold uppercase tracking-[0.06em] text-fg-3`,children:t[e.k]}),e.items.map(({s:e,i})=>(0,K.jsxs)(`label`,{"data-hand":!0,className:r(`flex cursor-default gap-2.5 rounded-[12px] bg-raised p-3 ring-1 ring-inset transition-shadow`,n.has(i)?`ring-ai-line`:`ring-line hover:ring-line-strong`),children:[(0,K.jsx)(`input`,{type:`checkbox`,checked:n.has(i),onChange:()=>c(i),className:`mt-0.5 size-3.5 shrink-0 accent-[var(--ai)]`}),(0,K.jsxs)(`span`,{className:`min-w-0`,children:[(0,K.jsx)(`span`,{className:`block text-[13px] font-medium leading-snug text-fg`,children:e.title}),(0,K.jsx)(`span`,{className:`mt-1 block text-[12px] leading-relaxed text-fg-3`,children:e.why}),(0,K.jsx)(`span`,{className:`mt-2 inline-block rounded-[5px] bg-active px-1.5 text-[10.5px] text-fg-2`,children:t.effortIs(t.effort[e.effort])})]})]},i))]},e.k))})]})}function It({report:e,t}){let n=[{title:t.journey,items:e.journey,icon:(0,K.jsx)(V,{className:`size-4 text-fg-3`}),ordered:!0},{title:t.positives,items:e.positives,icon:(0,K.jsx)(ie,{className:`size-4 text-ok`}),ordered:!1},{title:t.nextSteps,items:e.nextSteps,icon:(0,K.jsx)(b,{className:`size-4 text-ai`}),ordered:!0}].filter(e=>e.items.length);return n.length?(0,K.jsx)(`section`,{className:`grid gap-3 md:grid-cols-3`,children:n.map(e=>(0,K.jsxs)(`div`,{className:`rounded-[14px] bg-raised p-4 ring-1 ring-inset ring-line`,children:[(0,K.jsxs)(`h3`,{className:`mb-2 flex items-center gap-2 text-[13px] font-semibold text-fg`,children:[e.icon,e.title]}),(0,K.jsx)(`ol`,{className:r(`space-y-1.5 text-[12.5px] leading-relaxed text-fg-2`,e.ordered?`list-decimal ps-4`:`list-disc ps-4`),children:e.items.map((e,t)=>(0,K.jsx)(`li`,{children:e},t))})]},e.title))}):null}export{Tt as ReportView};
|
|
Binary file
|
|
Binary file
|