@saywright/studio 0.2.0 → 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.
Files changed (42) hide show
  1. package/dist/bridge.js +80 -32
  2. package/dist/cli.mjs +5193 -4848
  3. package/dist/client/assets/CommandPalette-BM1BSUxc.js +1 -0
  4. package/dist/client/assets/CommandPalette-BM1BSUxc.js.br +0 -0
  5. package/dist/client/assets/CommandPalette-BM1BSUxc.js.gz +0 -0
  6. package/dist/client/assets/{HelpDialog-CnCVSSNP.js → HelpDialog-Bc6yjiVi.js} +1 -1
  7. package/dist/client/assets/HelpDialog-Bc6yjiVi.js.br +0 -0
  8. package/dist/client/assets/HelpDialog-Bc6yjiVi.js.gz +0 -0
  9. package/dist/client/assets/{ReportView-BwBy4JIG.js → ReportView-DKcggbSt.js} +1 -1
  10. package/dist/client/assets/{ReportView-BwBy4JIG.js.br → ReportView-DKcggbSt.js.br} +0 -0
  11. package/dist/client/assets/ReportView-DKcggbSt.js.gz +0 -0
  12. package/dist/client/assets/{SettingsDialog-CS5w9CxJ.js → SettingsDialog-CIpvauuY.js} +1 -1
  13. package/dist/client/assets/SettingsDialog-CIpvauuY.js.br +0 -0
  14. package/dist/client/assets/SettingsDialog-CIpvauuY.js.gz +0 -0
  15. package/dist/client/assets/{arrow-left-BpsxETMA.js → arrow-left-5LUh_bW3.js} +1 -1
  16. package/dist/client/assets/brand-BcIB43Uo.js +57 -0
  17. package/dist/client/assets/brand-BcIB43Uo.js.br +0 -0
  18. package/dist/client/assets/brand-BcIB43Uo.js.gz +0 -0
  19. package/dist/client/assets/{footprints-Bc2dzReV.js → footprints-CfMi7MiN.js} +1 -1
  20. package/dist/client/assets/index-D1ooswLS.js +19 -0
  21. package/dist/client/assets/index-D1ooswLS.js.br +0 -0
  22. package/dist/client/assets/index-D1ooswLS.js.gz +0 -0
  23. package/dist/client/assets/{refresh-cw-DocKnJID.js → refresh-cw-BM1RSPTL.js} +1 -1
  24. package/dist/client/index.html +2 -2
  25. package/dist/client/index.html.br +0 -0
  26. package/dist/client/index.html.gz +0 -0
  27. package/dist/sample/package.json +1 -1
  28. package/package.json +1 -1
  29. package/dist/client/assets/CommandPalette-VEQNxJ4K.js +0 -1
  30. package/dist/client/assets/CommandPalette-VEQNxJ4K.js.br +0 -0
  31. package/dist/client/assets/CommandPalette-VEQNxJ4K.js.gz +0 -0
  32. package/dist/client/assets/HelpDialog-CnCVSSNP.js.br +0 -0
  33. package/dist/client/assets/HelpDialog-CnCVSSNP.js.gz +0 -0
  34. package/dist/client/assets/ReportView-BwBy4JIG.js.gz +0 -0
  35. package/dist/client/assets/SettingsDialog-CS5w9CxJ.js.br +0 -0
  36. package/dist/client/assets/SettingsDialog-CS5w9CxJ.js.gz +0 -0
  37. package/dist/client/assets/brand-BSL9G2NW.js +0 -57
  38. package/dist/client/assets/brand-BSL9G2NW.js.br +0 -0
  39. package/dist/client/assets/brand-BSL9G2NW.js.gz +0 -0
  40. package/dist/client/assets/index-C3xqQUPf.js +0 -19
  41. package/dist/client/assets/index-C3xqQUPf.js.br +0 -0
  42. package/dist/client/assets/index-C3xqQUPf.js.gz +0 -0
@@ -1 +1 @@
1
- import{y as e}from"./brand-BSL9G2NW.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};
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};
@@ -14,9 +14,9 @@
14
14
  document.documentElement.classList.toggle('dark', dark);
15
15
  } catch {}
16
16
  </script>
17
- <script type="module" crossorigin src="/assets/index-C3xqQUPf.js"></script>
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/brand-BSL9G2NW.js">
19
+ <link rel="modulepreload" crossorigin href="/assets/brand-BcIB43Uo.js">
20
20
  <link rel="stylesheet" crossorigin href="/assets/index-BrM0s_jp.css">
21
21
  </head>
22
22
  <body>
Binary file
Binary file
@@ -13,7 +13,7 @@
13
13
  "react-dom": "^19.3.0"
14
14
  },
15
15
  "devDependencies": {
16
- "@saywright/vite": "^0.2.0",
16
+ "@saywright/vite": "^0.2.1",
17
17
  "@playwright/test": "^1.64.0",
18
18
  "@types/react": "^19.3.0",
19
19
  "@types/react-dom": "^19.3.0",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@saywright/studio",
3
- "version": "0.2.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",
@@ -1 +0,0 @@
1
- import{i as e,o as t,r as n}from"./cn-Wq33h1G4.js";import{A as r,Nt as i,O as a,Pt as o,U as s,X as c,at as l,dt as u,et as d,ft as f,g as p,h as m,i as h,it as g,j as _,jt as v,k as y,mt as b,pt as ee,ut as x,v as S,y as C}from"./brand-BSL9G2NW.js";import{t as w}from"./arrow-left-BpsxETMA.js";import{t as T}from"./footprints-Bc2dzReV.js";import{A as te,C as E,D,F as O,G as k,I as A,K as j,O as M,P as N,Q as ne,S as re,T as ie,U as ae,X as oe,Y as se,Z as ce,_ as le,b as ue,g as de,j as fe,k as pe,m as me,n as he,p as ge,r as _e,t as ve,x as ye}from"./index-C3xqQUPf.js";var P={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`}]]};P.node;var be=C(P),F={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`}]]};F.node;var xe=C(F),I={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`]};I.node;var Se=C(I),L={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`]};L.node;var Ce=C(L),R={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`}]]};R.node;var we=C(R),Te=1,Ee=.9,De=.8,Oe=.17,z=.1,B=.999,ke=.9999,Ae=.99,je=/[\\\/_+.#"@\[\(\{&]/,Me=/[\\\/_+.#"@\[\(\{&]/g,Ne=/[\s-]/,Pe=/[\s-]/g;function V(e,t,n,r,i,a,o){if(a===t.length)return i===e.length?Te:Ae;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=V(e,t,n,r,l+1,a+1,o),d>u&&(l===i?d*=Te:je.test(e.charAt(l-1))?(d*=De,p=e.slice(i,l-1).match(Me),p&&i>0&&(d*=B**+p.length)):Ne.test(e.charAt(l-1))?(d*=Ee,m=e.slice(i,l-1).match(Pe),m&&i>0&&(d*=B**+m.length)):(d*=Oe,i>0&&(d*=B**+(l-i))),e.charAt(l)!==t.charAt(a)&&(d*=ke)),(d<z&&n.charAt(l-1)===r.charAt(a+1)||r.charAt(a+1)===r.charAt(a)&&n.charAt(l-1)!==r.charAt(a))&&(f=V(e,t,n,r,l+1,a+2,o),f*z>d&&(d=f*z)),d>u&&(u=d),l=n.indexOf(c,l+1);return o[s]=u,u}function Fe(e){return e.toLowerCase().replace(Pe,` `)}function Ie(e,t,n){return e=n&&n.length>0?`${e+` `+n.join(` `)}`:e,V(e,t,Fe(e),Fe(t),0,0,{})}var H=t(e(),1),U=`[cmdk-group=""]`,Le=`[cmdk-group-items=""]`,Re=`[cmdk-group-heading=""]`,ze=`[cmdk-item=""]`,Be=`${ze}:not([aria-disabled="true"])`,Ve=`cmdk-item-select`,W=`data-value`,He=(e,t,n)=>Ie(e,t,n),Ue=H.createContext(void 0),G=()=>H.useContext(Ue),We=H.createContext(void 0),Ge=()=>H.useContext(We),Ke=H.createContext(void 0),qe=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),a=J(()=>new Map),o=J(()=>new Set),l=it(e),{label:u,children:d,value:f,onValueChange:p,filter:m,shouldFilter:h,loop:g,disablePointerSelection:_=!1,vimBindings:v=!0,...y}=e,b=s(),ee=s(),x=s(),S=H.useRef(null),C=ot();q(()=>{if(f!==void 0){let e=f.trim();n.current.value=e,w.emit()}},[f]),q(()=>{C(6,k)},[]);let w=H.useMemo(()=>({subscribe:e=>(o.current.add(e),()=>o.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=A()?.id,w.emit()}),r||C(5,k),l.current?.value!==void 0){let e=t??``;(o=(a=l.current).onValueChange)==null||o.call(a,e);return}}w.emit()}},emit:()=>{o.current.forEach(e=>e())}}),[]),T=H.useMemo(()=>({value:(e,t,r)=>{t!==a.current.get(e)?.value&&(a.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()}),()=>{a.current.delete(e),r.current.delete(e),n.current.filtered.items.delete(e);let t=A();C(4,()=>{O(),t?.getAttribute(`id`)===e&&D(),w.emit()})}),group:e=>(i.current.has(e)||i.current.set(e,new Set),()=>{a.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??He;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;j().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(Le);t?t.appendChild(e.parentElement===t?e:e.closest(`${Le} > *`)):r.appendChild(e.parentElement===r?e:e.closest(`${Le} > *`))}),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=j().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(a.current.get(t)?.value??``,a.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 k(){var e;let t=A();t&&(t.parentElement?.firstChild===t&&((e=t.closest(U)?.querySelector(Re))==null||e.scrollIntoView({block:`nearest`})),t.scrollIntoView({block:`nearest`}))}function A(){return S.current?.querySelector(`${ze}[aria-selected="true"]`)}function j(){return Array.from(S.current?.querySelectorAll(Be)||[])}function M(e){let t=j()[e];t&&w.setState(`value`,t.getAttribute(W))}function N(e){var t;let n=A(),r=j(),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 ne(e){let t=A()?.closest(U),n;for(;t&&!n;)t=e>0?nt(t,U):rt(t,U),n=t?.querySelector(Be);n?w.setState(`value`,n.getAttribute(W)):N(e)}let re=()=>M(j().length-1),ie=e=>{e.preventDefault(),e.metaKey?re():e.altKey?ne(1):N(1)},ae=e=>{e.preventDefault(),e.metaKey?M(0):e.altKey?ne(-1):N(-1)};return H.createElement(c.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&&ie(e);break;case`ArrowDown`:ie(e);break;case`p`:case`k`:v&&e.ctrlKey&&ae(e);break;case`ArrowUp`:ae(e);break;case`Home`:e.preventDefault(),M(0);break;case`End`:e.preventDefault(),re();break;case`Enter`:{e.preventDefault();let t=A();if(t){let e=new Event(Ve);t.dispatchEvent(e)}}}}},H.createElement(`label`,{"cmdk-label":``,htmlFor:T.inputId,id:T.labelId,style:ct},u),X(e,e=>H.createElement(We.Provider,{value:w},H.createElement(Ue.Provider,{value:T},e))))}),Je=H.forwardRef((e,t)=>{let n=s(),r=H.useRef(null),i=H.useContext(Ke),a=G(),o=it(e),l=o.current?.forceMount??i?.forceMount;q(()=>{if(!l)return a.item(n,i?.id)},[l]);let u=at(n,r,[e.value,e.children,r],e.keywords),f=Ge(),p=Y(e=>e.value&&e.value===u.current),m=Y(e=>l||a.filter()===!1?!0:!e.search||e.filtered.items.get(n)>0);H.useEffect(()=>{let t=r.current;if(t&&!e.disabled)return t.addEventListener(Ve,h),()=>t.removeEventListener(Ve,h)},[m,e.onSelect,e.disabled]);function h(){var e,t;g(),(t=(e=o.current).onSelect)==null||t.call(e,u.current)}function g(){f.setState(`value`,u.current,!0)}if(!m)return null;let{disabled:_,value:v,onSelect:y,forceMount:b,keywords:ee,...x}=e;return H.createElement(c.div,{ref:d(r,t),...x,id:n,"cmdk-item":``,role:`option`,"aria-disabled":!!_,"aria-selected":!!p,"data-disabled":!!_,"data-selected":!!p,onPointerMove:_||a.getDisablePointerSelection()?void 0:g,onClick:_?void 0:h},e.children)}),Ye=H.forwardRef((e,t)=>{let{heading:n,children:r,forceMount:i,...a}=e,o=s(),l=H.useRef(null),u=H.useRef(null),f=s(),p=G(),m=Y(e=>i||p.filter()===!1?!0:!e.search||e.filtered.groups.has(o));q(()=>p.group(o),[]),at(o,l,[e.value,e.heading,u]);let h=H.useMemo(()=>({id:o,forceMount:i}),[i]);return H.createElement(c.div,{ref:d(l,t),...a,"cmdk-group":``,role:`presentation`,hidden:!m||void 0},n&&H.createElement(`div`,{ref:u,"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(Ke.Provider,{value:h},e))))}),Xe=H.forwardRef((e,t)=>{let{alwaysRender:n,...r}=e,i=H.useRef(null),a=Y(e=>!e.search);return!n&&!a?null:H.createElement(c.div,{ref:d(i,t),...r,"cmdk-separator":``,role:`separator`})}),Ze=H.forwardRef((e,t)=>{let{onValueChange:n,...r}=e,i=e.value!=null,a=Ge(),o=Y(e=>e.search),s=Y(e=>e.selectedItemId),l=G();return H.useEffect(()=>{e.value!=null&&a.setState(`search`,e.value)},[e.value]),H.createElement(c.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":s,id:l.inputId,type:`text`,value:i?e.value:o,onChange:e=>{i||a.setState(`search`,e.target.value),n?.(e.target.value)}})}),Qe=H.forwardRef((e,t)=>{let{children:n,label:r=`Suggestions`,...i}=e,a=H.useRef(null),o=H.useRef(null),s=Y(e=>e.selectedItemId),l=G();return H.useEffect(()=>{if(o.current&&a.current){let e=o.current,t=a.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(c.div,{ref:d(a,t),...i,"cmdk-list":``,role:`listbox`,tabIndex:-1,"aria-activedescendant":s,"aria-label":r,id:l.listId},X(e,e=>H.createElement(`div`,{ref:d(o,l.listInnerRef),"cmdk-list-sizer":``},e)))}),$e=H.forwardRef((e,t)=>{let{open:n,onOpenChange:i,overlayClassName:o,contentClassName:s,container:c,...l}=e;return H.createElement(a,{open:n,onOpenChange:i},H.createElement(_,{container:c},H.createElement(r,{"cmdk-overlay":``,className:o}),H.createElement(y,{"aria-label":e.label,"cmdk-dialog":``,className:s},H.createElement(qe,{ref:t,...l}))))}),et=H.forwardRef((e,t)=>Y(e=>e.filtered.count===0)?H.createElement(c.div,{ref:t,...e,"cmdk-empty":``,role:`presentation`}):null),tt=H.forwardRef((e,t)=>{let{progress:n,children:r,label:i=`Loading...`,...a}=e;return H.createElement(c.div,{ref:t,...a,"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(qe,{List:Qe,Item:Je,Input:Ze,Group:Ye,Separator:Xe,Dialog:$e,Empty:et,Loading:tt});function nt(e,t){let n=e.nextElementSibling;for(;n;){if(n.matches(t))return n;n=n.nextElementSibling}}function rt(e,t){let n=e.previousElementSibling;for(;n;){if(n.matches(t))return n;n=n.previousElementSibling}}function it(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=Ge(),n=()=>e(t.snapshot());return H.useSyncExternalStore(t.subscribe,n,n)}function at(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 ot=()=>{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 st(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(st(t),{ref:t.ref},n(t.props.children)):n(t)}var ct={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,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)(ge,{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 lt=e=>f.getState().setUi({panelOpen:!0,panelTab:e}),ut=(e,t,n)=>{let r=He(e,t,n);return r<.2?0:r};function dt(){let e=u(e=>e.overlay===`palette`),t=u(e=>e.changes.some(e=>e.status===`preview`)),n=u(e=>!!e.selection),r=u(e=>!!e.status?.app),a=u(e=>e.status?.app?.id??null),s=u(e=>e.recorder),c=b(e=>e.live.status===`recording`),d=o(e=>e.apps),_=f(e=>e.theme),y=l(),[C,P]=(0,H.useState)(``),F=()=>{x({overlay:null}),P(``)},I=e=>()=>{F(),setTimeout(e,0)},L=C.trim(),R=I(()=>void g.handleUtterance(L,null,`typed`));return(0,Z.jsx)(h,{open:e,onOpenChange:e=>e?x({overlay:`palette`}):F(),title:`Command palette`,position:`top`,focusFirst:!0,className:`w-[min(600px,calc(100vw-32px))]`,children:(0,Z.jsxs)(K,{loop:!0,filter:ut,className:`flex min-h-0 flex-col`,onKeyDown:e=>{e.key===`Enter`&&(e.metaKey||e.ctrlKey)&&(e.preventDefault(),L&&R())},children:[(0,Z.jsxs)(`div`,{className:`flex items-center gap-2.5 border-b border-line px-3.5`,children:[(0,Z.jsx)(E,{className:`size-4 text-fg-3`}),(0,Z.jsx)(K.Input,{value:C,onValueChange:P,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)(ge,{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 “`,L,`”.`]}),t&&(0,Z.jsxs)($,{heading:`Preview`,children:[(0,Z.jsx)(Q,{icon:(0,Z.jsx)(S,{}),kbd:`↵`,onSelect:I(()=>void g.keep(`palette`)),keywords:[`keep`,`accept`],children:`Keep the preview`}),(0,Z.jsx)(Q,{icon:(0,Z.jsx)(le,{}),kbd:v(`mod+z`),onSelect:I(()=>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)(ye,{}),kbd:`E`,onSelect:I(()=>g.setMode(`edit`)),children:[_e.edit,`: point and change`]}),(0,Z.jsxs)(Q,{icon:(0,Z.jsx)(pe,{}),kbd:`U`,onSelect:I(()=>g.setMode(`use`)),children:[_e.use,`: click through the app`]}),(0,Z.jsxs)(Q,{icon:(0,Z.jsx)(A,{}),kbd:`R`,onSelect:I(()=>g.setMode(`record`)),keywords:[`record a bug`,`playwright`,`check`],children:[_e.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)(ue,{}),onSelect:I(()=>void ee.stop()),keywords:[`record session`,`test session`],children:`Stop recording and write the report`}):(0,Z.jsx)(Q,{icon:(0,Z.jsx)(j,{}),onSelect:I(()=>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)(m,{}),onSelect:I(()=>(lt(`experts`),void me.run())),keywords:[`experts`,`audit`,`accessibility`,`seo`,`ux`,`content`],children:`Review this page with the Experts`}),(0,Z.jsx)(Q,{icon:(0,Z.jsx)(de,{}),onSelect:I(()=>(lt(`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)(Se,{}),onSelect:I(()=>lt(`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)(de,{}),onSelect:I(()=>void g.generateTest()),children:`Generate test`}),(0,Z.jsx)(Q,{icon:(0,Z.jsx)(D,{}),onSelect:I(()=>void g.runTest()),children:`Run test`}),s.run?.status===`failed`&&(0,Z.jsxs)(Q,{icon:(0,Z.jsx)(m,{}),onSelect:I(()=>void g.fix()),children:[`Fix with `,y]})]})]}),n&&(0,Z.jsxs)($,{heading:`Selection`,children:[(0,Z.jsx)(Q,{icon:(0,Z.jsx)(se,{}),kbd:`↑`,onSelect:I(()=>void g.step(`parent`)),children:`Select what contains it`}),(0,Z.jsx)(Q,{icon:(0,Z.jsx)(ce,{}),kbd:`↓`,onSelect:I(()=>void g.step(`child`)),children:`Select inside it`}),(0,Z.jsx)(Q,{icon:(0,Z.jsx)(oe,{}),kbd:`→`,onSelect:I(()=>void g.step(`next`)),children:`Select the next one`}),(0,Z.jsx)(Q,{icon:(0,Z.jsx)(w,{}),kbd:`←`,onSelect:I(()=>void g.step(`prev`)),children:`Select the previous one`}),(0,Z.jsx)(Q,{icon:(0,Z.jsx)(ae,{}),kbd:`O`,onSelect:I(()=>void g.openInEditor()),children:`Open in editor`}),(0,Z.jsx)(Q,{icon:(0,Z.jsx)(be,{}),kbd:`Esc`,onSelect:I(()=>g.clearTargets()),children:`Clear the selection`})]}),(0,Z.jsx)($,{heading:`Voice`,children:(0,Z.jsx)(Q,{icon:(0,Z.jsx)(fe,{}),kbd:`Space`,onSelect:I(()=>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:I(()=>g.reloadApp()),children:`Reload the app`}),d.filter(e=>e.id!==a).map(e=>(0,Z.jsxs)(Q,{value:`switch ${e.id} ${e.name}`,icon:(0,Z.jsx)(ne,{}),onSelect:I(()=>void i.open(e.id)),keywords:[`switch`,`open`,e.name],children:[`Switch to `,e.name]},e.id)),(0,Z.jsx)(Q,{icon:(0,Z.jsx)(p,{}),onSelect:I(()=>i.show(`folder`)),keywords:[`add`,`folder`,`address`,`github`],children:`Link an app…`}),(0,Z.jsx)(Q,{icon:(0,Z.jsx)(N,{}),onSelect:I(()=>i.show()),children:`All apps`}),r&&Object.keys(he).map(e=>(0,Z.jsxs)(Q,{icon:(0,Z.jsx)(te,{}),onSelect:I(()=>f.getState().setUi({device:e})),children:[`Viewport: `,he[e].label]},e))]}),(0,Z.jsxs)($,{heading:`Studio`,children:[(0,Z.jsx)(Q,{icon:(0,Z.jsx)(M,{}),kbd:`\\`,onSelect:I(()=>f.getState().setUi({panelOpen:!f.getState().ui.panelOpen})),children:`Toggle panel`}),(0,Z.jsx)(Q,{icon:_===`light`?(0,Z.jsx)(xe,{}):(0,Z.jsx)(we,{}),onSelect:I(()=>f.getState().set({theme:_===`light`?`dark`:`light`})),children:_===`light`?`Dark theme`:`Light theme`}),(0,Z.jsx)(Q,{icon:(0,Z.jsx)(re,{}),onSelect:I(()=>x({overlay:`settings`,settingsTab:`general`})),keywords:[`preferences`,`options`],children:`Settings`}),(0,Z.jsx)(Q,{icon:(0,Z.jsx)(m,{}),onSelect:I(()=>x({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)(O,{}),onSelect:I(()=>x({overlay:`settings`,settingsTab:`usage`})),keywords:[`cost`,`budget`,`spend`,`money`],children:`Settings: usage and budget`}),(0,Z.jsx)(Q,{icon:(0,Z.jsx)(k,{}),kbd:`?`,onSelect:I(()=>x({overlay:`help`})),keywords:[`help`,`keys`],children:`Phrases and shortcuts`}),(0,Z.jsx)(Q,{icon:(0,Z.jsx)(T,{}),onSelect:I(()=>ve.start()),keywords:[`tour`,`intro`,`getting started`,`onboarding`,`learn`],children:`Take the quick-start tour`})]})]}),L&&(0,Z.jsxs)(`button`,{onClick:R,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)(Ce,{className:`shrink-0 text-ai-fg`}),(0,Z.jsxs)(`span`,{className:`min-w-0 flex-1 truncate`,children:[`Send as a request: “`,L,`” `,(0,Z.jsxs)(`span`,{className:`text-fg-3`,children:[`· a quick edit, or `,y===`AI`?`the AI`:y]})]}),(0,Z.jsx)(ge,{children:v(`mod+enter`)})]})]})})}export{dt as CommandPalette};