wizards 0.2.0 → 0.2.2

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 (64) hide show
  1. package/README.md +4 -1
  2. package/apps/runtime/dist/app.js +36 -4
  3. package/apps/runtime/dist/auth/local-ticket.js +8 -5
  4. package/apps/runtime/dist/cli/connect.js +531 -0
  5. package/apps/runtime/dist/cli/environment.js +3 -1
  6. package/apps/runtime/dist/cli/main.js +17 -0
  7. package/apps/runtime/dist/cli/mcp.js +175 -0
  8. package/apps/runtime/dist/cli/setup.js +49 -0
  9. package/apps/runtime/dist/env.js +1 -1
  10. package/apps/runtime/dist/mcp/auth.js +26 -0
  11. package/apps/runtime/dist/mcp/flow-app.js +94 -0
  12. package/apps/runtime/dist/mcp/handler.js +15 -5
  13. package/apps/runtime/dist/mcp/seen.js +65 -0
  14. package/apps/runtime/dist/mcp/tools.js +156 -4
  15. package/apps/runtime/dist/plugins/loader.js +23 -1
  16. package/apps/runtime/dist/routes/runs.js +7 -3
  17. package/apps/runtime/dist/routes/studio.js +20 -0
  18. package/apps/runtime/dist/secrets/signing.js +21 -3
  19. package/apps/runtime/dist/services/runs.js +190 -28
  20. package/apps/runtime/dist/services/wizards.js +1 -1
  21. package/apps/web/dist/assets/{ChangelogDialog-COqPzrKT.js → ChangelogDialog-4HCt88rf.js} +1 -1
  22. package/apps/web/dist/assets/ChatPanel-B91fTrzg.js +1 -0
  23. package/apps/web/dist/assets/{CreditsDialog-pRbTW7Xh.js → CreditsDialog-D3fZRqXH.js} +1 -1
  24. package/apps/web/dist/assets/EditorPage-ZZjb9mGV.js +2 -0
  25. package/apps/web/dist/assets/{FlowPreview-CDmcN1oX.js → FlowPreview-CjUK5046.js} +1 -1
  26. package/apps/web/dist/assets/{HomePage-DUAiS9pg.js → HomePage-Cn5TCZk7.js} +1 -1
  27. package/apps/web/dist/assets/{ImportWizard-pzljVvcr.js → ImportWizard-DiV62Uno.js} +1 -1
  28. package/apps/web/dist/assets/{LocalRuntime-DPJMJlWc.js → LocalRuntime-DupxjXff.js} +1 -1
  29. package/apps/web/dist/assets/NewWizardPage-Bz3PIQGp.js +2 -0
  30. package/apps/web/dist/assets/{PublicRunner-DoZdJuyW.js → PublicRunner-Axs1zwqe.js} +1 -1
  31. package/apps/web/dist/assets/{RunnerView-XKosfgO-.js → RunnerView-Bhv6RNME.js} +1 -1
  32. package/apps/web/dist/assets/SettingsPage-in_RmI8i.js +2 -0
  33. package/apps/web/dist/assets/{SetupPage-BFQ0V__v.js → SetupPage-xiqJMR0J.js} +1 -1
  34. package/apps/web/dist/assets/{SharePage-C1yg5bc2.js → SharePage-C8B9BUSU.js} +1 -1
  35. package/apps/web/dist/assets/{api-DijQGkp-.js → api-KMi35npD.js} +1 -1
  36. package/apps/web/dist/assets/changelog-C2LDEzLQ.js +1 -0
  37. package/apps/web/dist/assets/index-2Ktgo6f1.js +10 -0
  38. package/apps/web/dist/assets/index-B9YVjvVY.css +1 -0
  39. package/apps/web/dist/assets/meta-4R1Lnr25.js +1 -0
  40. package/apps/web/dist/assets/oss-credits-roB62QJu.js +1 -0
  41. package/apps/web/dist/assets/{outputs-37WFkpRS.js → outputs-Dhqtf-SA.js} +1 -1
  42. package/apps/web/dist/assets/plug-CLjyCoHB.js +1 -0
  43. package/apps/web/dist/assets/{session-BerOchdC.js → session-B6-6VomQ.js} +1 -1
  44. package/apps/web/dist/assets/type-Bj9H3eOK.js +1 -0
  45. package/apps/web/dist/assets/ui-Cs6lpsmj.js +1 -0
  46. package/apps/web/dist/index.html +6 -5
  47. package/apps/web/dist/mcp/flow.html +748 -0
  48. package/modules/README.md +1 -1
  49. package/node_modules/@engenty-wizards/plugin-sdk/dist/index.d.ts +24 -1
  50. package/node_modules/@engenty-wizards/plugin-sdk/dist/studio.d.ts +1 -1
  51. package/package.json +2 -1
  52. package/plugin/.claude-plugin/plugin.json +1 -1
  53. package/plugin/skills/use-wizard/SKILL.md +18 -0
  54. package/apps/web/dist/assets/ChatPanel-aQP8iz10.js +0 -1
  55. package/apps/web/dist/assets/EditorPage-xkq6pvw-.js +0 -2
  56. package/apps/web/dist/assets/NewWizardPage-TwYgdbKl.js +0 -2
  57. package/apps/web/dist/assets/SettingsPage-C0_peJuV.js +0 -2
  58. package/apps/web/dist/assets/changelog-sa4SXBrg.js +0 -1
  59. package/apps/web/dist/assets/index-BAObuqzs.js +0 -10
  60. package/apps/web/dist/assets/index-BOl3401k.css +0 -1
  61. package/apps/web/dist/assets/meta-ijlGGCOr.js +0 -1
  62. package/apps/web/dist/assets/oss-credits-ClwxOPrf.js +0 -1
  63. package/apps/web/dist/assets/type-c_dt5Ne8.js +0 -1
  64. package/apps/web/dist/assets/ui-DKc92qJ1.js +0 -1
@@ -1,2 +0,0 @@
1
- import{a as e,n as t,t as n}from"./jsx-runtime-D3jfb0Ew.js";import{O as r,S as i,c as a,d as o,i as s,j as c,k as l,n as u,nt as d,w as f}from"./api-DijQGkp-.js";import{a as p,c as m,o as h,s as g,t as _}from"./session-BerOchdC.js";import{t as v}from"./createLucideIcon-q3MZMmnf.js";import{t as ee}from"./arrow-right-6FyN3e7D.js";import{S as te,_ as ne,b as re,g as ie,m as y,r as ae,x as oe,y as se}from"./outputs-37WFkpRS.js";import{t as b}from"./check-CUpby_J9.js";import{n as x,r as ce,t as le}from"./wand-sparkles-CKxArWPY.js";import{r as ue,t as de}from"./ChatPanel-aQP8iz10.js";import{n as fe,t as S}from"./plus-Du-Jx8aI.js";import{t as C}from"./external-link-MAL7vJYj.js";import{n as pe}from"./mic-Bvz4mA2j.js";import{p as me}from"./definition-DndaH5Ow.js";import{n as he,r as ge,t as _e}from"./type-c_dt5Ne8.js";import{t as ve}from"./upload--J5bZhEM.js";import{_ as ye,c as w,d as T,f as be,h as E,i as D,l as xe,m as O,n as k,o as A,p as Se,r as j,s as M,t as N,u as Ce,y as P}from"./ui-DKc92qJ1.js";import{a as we,c as Te,i as Ee,o as De,r as Oe,s as ke,u as Ae}from"./index-BAObuqzs.js";import{o as je,r as Me,t as Ne}from"./LocalRuntime-DPJMJlWc.js";import{ProjectSwitcher as Pe}from"./HomePage-DUAiS9pg.js";var Fe={name:`calendar`,size:24,node:[[`path`,{d:`M8 2v3`,key:`1ioesn`}],[`path`,{d:`M16 2v3`,key:`otl347`}],[`rect`,{x:`3`,y:`3`,width:`18`,height:`18`,rx:`2`,key:`h1oib`}],[`path`,{d:`M3 9h18`,key:`1pudct`}]]};Fe.node;var Ie=v(Fe),Le={name:`file-spreadsheet`,size:24,node:[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M8 13h2`,key:`yr2amv`}],[`path`,{d:`M14 13h2`,key:`un5t4a`}],[`path`,{d:`M8 17h2`,key:`2yhykz`}],[`path`,{d:`M14 17h2`,key:`10kma7`}]]};Le.node;var Re=v(Le),ze={name:`hard-drive`,size:24,node:[[`path`,{d:`M10 16h.01`,key:`1bzywj`}],[`path`,{d:`M2.212 11.577a2 2 0 0 0-.212.896V18a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-5.527a2 2 0 0 0-.212-.896L18.55 5.11A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z`,key:`18tbho`}],[`path`,{d:`M21.946 12.013H2.054`,key:`zqlbp7`}],[`path`,{d:`M6 16h.01`,key:`1pmjb7`}]]};ze.node;var Be=v(ze),Ve={name:`hash`,size:24,node:[[`line`,{x1:`4`,x2:`20`,y1:`9`,y2:`9`,key:`4lhtct`}],[`line`,{x1:`4`,x2:`20`,y1:`15`,y2:`15`,key:`vyu0kd`}],[`line`,{x1:`10`,x2:`8`,y1:`3`,y2:`21`,key:`1ggp8o`}],[`line`,{x1:`16`,x2:`14`,y1:`3`,y2:`21`,key:`weycgp`}]]};Ve.node;var He=v(Ve),Ue={name:`key-round`,size:24,node:[[`path`,{d:`M2.586 17.414A2 2 0 0 0 2 18.828V21a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h1a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h.172a2 2 0 0 0 1.414-.586l.814-.814a6.5 6.5 0 1 0-4-4z`,key:`1s6t7t`}],[`circle`,{cx:`16.5`,cy:`7.5`,r:`.5`,fill:`currentColor`,key:`w0ekpg`}]]};Ue.node;var We=v(Ue),Ge={name:`layout-grid`,size:24,node:[[`rect`,{width:`7`,height:`7`,x:`3`,y:`3`,rx:`1`,key:`1g98yp`}],[`rect`,{width:`7`,height:`7`,x:`14`,y:`3`,rx:`1`,key:`6d4xhi`}],[`rect`,{width:`7`,height:`7`,x:`14`,y:`14`,rx:`1`,key:`nxv5o0`}],[`rect`,{width:`7`,height:`7`,x:`3`,y:`14`,rx:`1`,key:`1bb6yr`}]]};Ge.node;var Ke=v(Ge),qe={name:`list`,size:24,node:[[`path`,{d:`M3 5h.01`,key:`18ugdj`}],[`path`,{d:`M3 12h.01`,key:`nlz23k`}],[`path`,{d:`M3 19h.01`,key:`noohij`}],[`path`,{d:`M8 5h13`,key:`1pao27`}],[`path`,{d:`M8 12h13`,key:`1za7za`}],[`path`,{d:`M8 19h13`,key:`m83p4d`}]]};qe.node;var Je=v(qe),Ye={name:`music`,size:24,node:[[`path`,{d:`M9 18V5l12-2v13`,key:`1jmyc2`}],[`circle`,{cx:`6`,cy:`18`,r:`3`,key:`fqmcym`}],[`circle`,{cx:`18`,cy:`16`,r:`3`,key:`1hluhg`}]]};Ye.node;var Xe=v(Ye),Ze={name:`phone`,size:24,node:[[`path`,{d:`M13.832 16.568a1 1 0 0 0 1.213-.303l.355-.465A2 2 0 0 1 17 15h3a2 2 0 0 1 2 2v3a2 2 0 0 1-2 2A18 18 0 0 1 2 4a2 2 0 0 1 2-2h3a2 2 0 0 1 2 2v3a2 2 0 0 1-.8 1.6l-.468.351a1 1 0 0 0-.292 1.233 14 14 0 0 0 6.392 6.384`,key:`9njp5v`}]]};Ze.node;var Qe=v(Ze),F={name:`rotate-cw`,size:24,node:[[`path`,{d:`M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8`,key:`1p45f6`}],[`path`,{d:`M21 3v5h-5`,key:`1q7to0`}]]};F.node;var $e=v(F),et={name:`text-align-start`,size:24,node:[[`path`,{d:`M21 5H3`,key:`1fi0y6`}],[`path`,{d:`M15 12H3`,key:`6jk70r`}],[`path`,{d:`M17 19H3`,key:`z6ezky`}]],aliases:[`text`,`align-left`]};et.node;var tt=v(et),nt={name:`toggle-left`,size:24,node:[[`circle`,{cx:`9`,cy:`12`,r:`3`,key:`u3jwor`}],[`rect`,{width:`20`,height:`14`,x:`2`,y:`5`,rx:`7`,key:`g7kal2`}]]};nt.node;var rt=v(nt),I=e(t(),1),L=e(n(),1);function R({title:e,hint:t,save:n,action:r,children:i}){return(0,L.jsxs)(`section`,{className:`flex flex-col gap-2.5`,children:[(0,L.jsxs)(`div`,{className:`flex items-start justify-between gap-4 px-1`,children:[(0,L.jsxs)(`div`,{className:`min-w-0`,children:[(0,L.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,L.jsx)(`h2`,{className:`font-display font-semibold text-lg leading-tight`,children:e}),n?.state===`saving`?(0,L.jsxs)(`span`,{className:`inline-flex items-center gap-1.5 text-[12px] text-ink-3`,children:[(0,L.jsx)(T,{className:`size-3`}),` `,P(`project.saving`)]}):n?.state===`saved`?(0,L.jsxs)(`span`,{className:`inline-flex items-center gap-1 text-[12px] text-moss`,children:[(0,L.jsx)(b,{className:`size-3.5`}),` `,P(`settings.saved`)]}):null]}),t?(0,L.jsx)(`p`,{className:`mt-1 text-[14px] text-ink-3 leading-snug`,children:t}):null]}),r?(0,L.jsx)(`div`,{className:`shrink-0`,children:r}):null]}),(0,L.jsxs)(k,{className:`p-5`,children:[i,n?.state===`error`&&n.error?(0,L.jsx)(`p`,{className:`mt-4 text-[14px] text-rose`,children:n.error}):null]})]})}function it({children:e,layout:t,onToggle:n}){return(0,L.jsxs)(`div`,{className:`mb-3 flex items-start gap-2`,children:[(0,L.jsx)(`div`,{className:`min-w-0 flex-1`,children:(0,L.jsx)(`div`,{className:`w-56 max-w-full transition-[width] duration-200 focus-within:w-full has-[input:not(:placeholder-shown)]:w-full`,children:e})}),(0,L.jsx)(A,{label:P(t===`list`?`project.viewCards`:`project.viewList`),onClick:n,children:t===`list`?(0,L.jsx)(Ke,{className:`size-4`}):(0,L.jsx)(Je,{className:`size-4`})})]})}function at({value:e,onChange:t,onEnter:n,placeholder:r,busy:i}){return(0,L.jsxs)(`div`,{className:`relative`,children:[(0,L.jsx)(ge,{className:`-translate-y-1/2 pointer-events-none absolute top-1/2 left-3 size-4 text-ink-4`}),(0,L.jsx)(`input`,{type:`search`,value:e,placeholder:r,onChange:e=>t(e.target.value),onKeyDown:e=>e.key===`Enter`&&n?.(),className:`h-9 w-full rounded-lg border border-input bg-card pr-3 pl-9 text-[14px] text-ink outline-none transition placeholder:text-ink-4 focus:border-focus focus:ring-4 focus:ring-focus-glow`}),i?(0,L.jsx)(T,{className:`-translate-y-1/2 absolute top-1/2 right-3 size-4 text-ink-3`}):null]})}function z({onFiles:e,accept:t,multiple:n=!0,className:r,children:i}){return(0,L.jsxs)(`label`,{onDragOver:e=>{e.preventDefault(),e.currentTarget.dataset.over=`1`},onDragLeave:e=>{delete e.currentTarget.dataset.over},onDrop:t=>{t.preventDefault(),delete t.currentTarget.dataset.over;let r=Array.from(t.dataTransfer.files);r.length&&e(n?r:r.slice(0,1))},className:E(`flex cursor-pointer items-center justify-center gap-2 rounded-lg border border-input border-dashed text-[14px] text-ink-3 transition focus-within:border-focus focus-within:ring-4 focus-within:ring-focus-glow hover:border-ink-4 hover:text-ink data-[over]:border-focus data-[over]:bg-paper-2 data-[over]:text-ink`,r),children:[i,(0,L.jsx)(`input`,{className:`sr-only`,type:`file`,accept:t,multiple:n,onChange:t=>{let n=Array.from(t.target.files??[]);t.target.value=``,n.length&&e(n)}})]})}function ot(){let e=Te(),[t,n]=(0,I.useState)(null),[r,i]=(0,I.useState)(null),a=async e=>{n(e??`*`),i(null);try{await ke(e)}catch(e){i(e.message)}finally{n(null)}};return(0,L.jsxs)(R,{title:P(`plugins.title`),hint:e.canReload?P(`plugins.hint`):P(`plugins.hintManaged`),action:e.canReload?(0,L.jsx)(N,{variant:`secondary`,busy:t===`*`,onClick:()=>void a(),children:P(`plugins.rescan`)}):null,children:[(0,L.jsxs)(`ul`,{className:`divide-y divide-border-soft`,children:[e.plugins.map(n=>{let r=e.failed[n.id];return(0,L.jsxs)(`li`,{className:`flex items-start gap-4 py-4 first:pt-0 last:pb-0`,children:[(0,L.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,L.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-2.5 gap-y-1`,children:[(0,L.jsx)(`span`,{className:`font-medium text-[15px]`,children:n.name}),n.name===n.id?null:(0,L.jsxs)(`span`,{className:`font-mono text-[12px] text-ink-4`,children:[n.id,` · `,n.version]})]}),n.description?(0,L.jsx)(`p`,{className:`mt-0.5 text-[14px] text-ink-3`,children:n.description}):null,n.tools.length?(0,L.jsxs)(`div`,{className:`mt-2 flex flex-wrap items-center gap-1.5 text-[12px] text-ink-3`,children:[P(`plugins.tools`),n.tools.map(e=>(0,L.jsx)(j,{children:e.id},e.id))]}):null,n.error?(0,L.jsx)(`p`,{className:`mt-2 text-[13px] text-rose`,children:P(`plugins.serverFailed`,{error:n.error})}):null,r?(0,L.jsx)(`p`,{className:`mt-2 text-[13px] text-rose`,children:P(`plugins.studioFailed`,{error:r})}):null]}),e.canReload?(0,L.jsx)(A,{label:P(`plugins.reload`),disabled:t!==null,onClick:()=>void a(n.id),children:(0,L.jsx)($e,{className:t===n.id?`size-4 animate-spin`:`size-4`})}):null]},n.id)}),e.problems.map(e=>(0,L.jsxs)(`li`,{className:`py-4 first:pt-0 last:pb-0`,children:[(0,L.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-2.5 gap-y-1`,children:[(0,L.jsx)(j,{tone:`warn`,children:P(`plugins.problems`)}),(0,L.jsx)(`span`,{className:`break-all font-mono text-[12px] text-ink-3`,children:e.path})]}),(0,L.jsx)(`p`,{className:`mt-1.5 text-[13px] text-ink-3`,children:e.message})]},e.path))]}),r?(0,L.jsx)(`p`,{className:`mt-4 text-[13px] text-rose`,children:r}):null]})}var st=e=>[`project-files`,e];function ct(e){return c({queryKey:st(e),queryFn:()=>u.get(`/api/studio/projects/${e}/files`),refetchInterval:e=>e.state.data?.files.some(e=>e.status===`pending`)?2e3:!1})}function B(e,t){return a(`/api/studio/projects/${e}/files/${t}/content`)}function V(e){let t=d(),[n,r]=(0,I.useState)(!1),[i,a]=(0,I.useState)(null),o=()=>t.invalidateQueries({queryKey:st(e)}),s=async e=>{a(null);try{await e()}catch(e){a(e.message)}finally{await o()}};return{busy:n,error:i,upload:async(t,n)=>{r(!0),await s(async()=>{for(let r of n)await u.upload(`/api/studio/projects/${e}/files?kind=${t}`,r),await o()}),r(!1)},describe:(t,n)=>s(()=>u.patch(`/api/studio/projects/${e}/files/${t}`,{description:n})),remove:t=>s(()=>u.del(`/api/studio/projects/${e}/files/${t}`)),reindex:t=>s(()=>u.post(`/api/studio/projects/${e}/files/${t}/reindex`)),order:(t,n)=>s(()=>u.put(`/api/studio/projects/${e}/files/order`,{kind:t,ids:n}))}}function lt(e,t){let n=`wz.layout.${e}`,[r,i]=(0,I.useState)(()=>{try{let e=localStorage.getItem(n);return e===`list`||e===`cards`?e:t}catch{return t}});return[r,()=>i(e=>{let t=e===`list`?`cards`:`list`;try{localStorage.setItem(n,t)}catch{}return t})]}function H(e,t,n=700){let[r,i]=(0,I.useState)(`idle`),[a,o]=(0,I.useState)(null),s=JSON.stringify(e),c=(0,I.useRef)(s),l=(0,I.useRef)({value:e,json:s,save:t});l.current={value:e,json:s,save:t};let u=(0,I.useRef)(Promise.resolve()),d=(0,I.useCallback)(()=>{let e=l.current;e.json!==c.current&&(c.current=e.json,i(`saving`),u.current=u.current.then(async()=>{try{await e.save(e.value),o(null),i(`saved`)}catch(e){c.current=``,o(e.message),i(`error`)}}))},[]);return(0,I.useEffect)(()=>{if(s===c.current)return;let e=setTimeout(d,n);return()=>clearTimeout(e)},[s,n,d]),(0,I.useEffect)(()=>d,[d]),{state:r,error:a}}function ut(e){return e<1e6?`${Math.max(1,Math.round(e/1e3))} KB`:`${(e/1e6).toFixed(1)} MB`}var dt=`mt-1.5 text-[13px] text-ink-3`;function ft({me:e}){let t=d(),n=e.mode===`managed`,[r,i]=(0,I.useState)(e.profile),a=e=>i(t=>({...t,...e})),o=H(r,async e=>{await u.put(`/api/studio/profile`,e),await t.invalidateQueries({queryKey:[`me`]})}),s=e.manageUrl?`${e.manageUrl}/account`:e.account?.url??null;return(0,L.jsxs)(`div`,{className:`flex flex-col gap-9`,children:[(0,L.jsx)(R,{title:P(`account.title`),hint:P(`account.hint`),save:o,children:(0,L.jsxs)(`div`,{className:`flex flex-col gap-6 sm:flex-row sm:gap-8`,children:[(0,L.jsxs)(`div`,{className:`flex shrink-0 flex-col items-center gap-2 sm:w-32`,children:[(0,L.jsx)(`div`,{className:`flex size-20 items-center justify-center overflow-hidden rounded-full bg-ember-tint font-semibold text-[28px] text-ember-strong ring-1 ring-border-soft`,children:e.user.image?(0,L.jsx)(`img`,{src:e.user.image,alt:``,className:`size-full object-cover`}):_(r.name)||`?`}),(0,L.jsx)(`p`,{className:`text-center text-[12px] text-ink-3 leading-snug`,children:P(`account.initials`)})]}),(0,L.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col gap-5`,children:[(0,L.jsxs)(`div`,{children:[(0,L.jsx)(w,{children:P(`account.name`)}),(0,L.jsx)(M,{value:r.name,maxLength:80,disabled:n,onChange:e=>a({name:e.target.value})}),(0,L.jsx)(`p`,{className:dt,children:P(n?`account.fromAccount`:`account.nameHint`)})]}),(0,L.jsxs)(`div`,{children:[(0,L.jsx)(w,{children:P(`account.about`)}),(0,L.jsx)(O,{minRows:3,maxLength:2e3,value:r.about,onChange:e=>a({about:e.target.value})}),(0,L.jsx)(`p`,{className:dt,children:P(`account.aboutHint`)})]}),(0,L.jsxs)(`div`,{className:`grid gap-5 sm:grid-cols-2`,children:[(0,L.jsxs)(`div`,{children:[(0,L.jsx)(w,{children:P(`account.email`)}),(0,L.jsx)(M,{type:`email`,value:r.email,maxLength:200,disabled:n,onChange:e=>a({email:e.target.value})})]}),(0,L.jsxs)(`div`,{children:[(0,L.jsx)(w,{children:P(`account.phone`)}),(0,L.jsx)(M,{type:`tel`,value:r.phone,maxLength:40,onChange:e=>a({phone:e.target.value})})]})]})]})]})}),(0,L.jsx)(R,{title:P(`account.connection`),hint:P(`account.connectionHint`),children:e.mode===`local`&&!e.account?(0,L.jsxs)(`div`,{className:`flex items-start gap-4`,children:[(0,L.jsx)(`div`,{className:`flex size-11 shrink-0 items-center justify-center rounded-full bg-paper-2 text-ink-2`,children:(0,L.jsx)(Be,{className:`size-5`})}),(0,L.jsxs)(`div`,{className:`min-w-0`,children:[(0,L.jsx)(`div`,{className:`font-medium text-[15px]`,children:P(`account.local`)}),(0,L.jsx)(`p`,{className:`mt-1 text-[14px] text-ink-3 leading-relaxed`,children:P(`account.localText`)})]})]}):(0,L.jsxs)(`div`,{className:`flex flex-wrap items-center gap-4`,children:[(0,L.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,L.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,L.jsx)(`span`,{className:`truncate font-medium text-[15px]`,children:e.account?.name??e.user.name}),(0,L.jsx)(j,{tone:`live`,children:P(`account.linked`)})]}),(0,L.jsx)(`div`,{className:`truncate text-[14px] text-ink-3`,children:e.account?.email??e.user.email})]}),s?(0,L.jsxs)(`button`,{type:`button`,onClick:()=>Me(s),className:`inline-flex h-10 items-center gap-2 rounded-full border border-border bg-card px-4 font-medium text-sm transition hover:bg-paper-2`,children:[P(`setup.openAccount`),` `,(0,L.jsx)(C,{className:`size-4`})]}):null]})}),(0,L.jsx)(R,{title:P(`account.look`),hint:P(`account.lookHint`),children:(0,L.jsxs)(`div`,{className:`flex flex-col divide-y divide-border-soft`,children:[(0,L.jsxs)(`div`,{className:`flex items-center justify-between gap-4 pb-4`,children:[(0,L.jsx)(`span`,{className:`font-medium text-[14px]`,children:P(`nav.language`)}),(0,L.jsx)(we,{tone:`surface`})]}),(0,L.jsxs)(`div`,{className:`flex items-center justify-between gap-4 pt-4`,children:[(0,L.jsx)(`span`,{className:`font-medium text-[14px]`,children:P(`nav.theme`)}),(0,L.jsx)(Oe,{})]})]})})]})}function pt({connector:e}){let[t,n]=(0,I.useState)(!1);return(0,L.jsxs)(`div`,{className:`rounded-lg bg-paper ring-1 ring-border-soft`,children:[(0,L.jsxs)(`button`,{type:`button`,onClick:()=>n(e=>!e),className:`flex w-full items-center gap-3 px-3 py-2 text-left`,children:[(0,L.jsx)(`span`,{className:E(`size-2 shrink-0 rounded-full`,e.usable?`bg-moss`:`bg-ink-4`)}),(0,L.jsxs)(`span`,{className:`min-w-0 flex-1 truncate text-[13px]`,children:[e.name,` `,(0,L.jsx)(`span`,{className:`font-mono text-[11px] text-ink-4`,children:e.id})]}),(0,L.jsx)(`span`,{className:`shrink-0 text-[12px] text-ink-3`,children:e.usable?P(`connectors.actions`,{n:e.actions.length,r:e.actions.filter(e=>e.group===`read`).length}):P(`connectors.notSetUp`)})]}),t?(0,L.jsxs)(`div`,{className:`border-border-soft border-t px-3 py-2 text-[12px]`,children:[e.missingSetup?(0,L.jsxs)(`p`,{className:`mb-1 text-ink-3`,children:[P(`connectors.setup`),` `,(0,L.jsx)(`span`,{className:`font-mono text-ink-2`,children:e.missingSetup})]}):null,(0,L.jsx)(`p`,{className:`text-ink-4`,children:e.actions.map(e=>e.group===`read`?e.id:`${e.id} (${P(`connectors.group.${e.group}`)})`).join(` · `)})]}):null]})}var mt={none:`connectors.authNone`,oauth2:`connectors.authOauth`,api_key:`connectors.authKey`};function ht({projectId:e,connector:t}){let n=d(),[r,i]=(0,I.useState)(!1),a=()=>n.invalidateQueries({queryKey:[`connectors`,e]}),o=`/api/studio/projects/${e}/connectors/${t.id}`,s=m({mutationFn:()=>u.post(`${o}/refresh`),onSuccess:a}),c=m({mutationFn:()=>u.del(o),onSuccess:a}),l=t.actions.filter(e=>e.group===`read`).length;return(0,L.jsxs)(`div`,{className:`rounded-lg bg-paper ring-1 ring-border-soft`,children:[(0,L.jsxs)(`div`,{className:`flex items-center gap-3 p-3`,children:[(0,L.jsx)(`div`,{className:`flex size-9 shrink-0 items-center justify-center rounded-lg bg-paper-2 text-ink-2`,children:(0,L.jsx)(Ae,{className:`size-4`})}),(0,L.jsxs)(`button`,{type:`button`,onClick:()=>i(e=>!e),className:`min-w-0 flex-1 text-left`,children:[(0,L.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,L.jsx)(`span`,{className:`truncate font-medium text-[14px]`,children:t.name}),(0,L.jsx)(`span`,{className:`font-mono text-[11px] text-ink-4`,children:t.id})]}),(0,L.jsxs)(`div`,{className:`truncate text-[12px] text-ink-3`,children:[t.domain,` · `,t.sourceKind===`mcp`?`MCP`:`OpenAPI`,` ·`,` `,P(mt[t.auth]),` ·`,` `,t.toolsPending?P(`connectors.pending`):P(`connectors.actions`,{n:t.actions.length,r:l})]})]}),(0,L.jsx)(A,{label:P(`connectors.refresh`),onClick:()=>s.mutate(),children:s.isPending?(0,L.jsx)(T,{className:`size-4`}):(0,L.jsx)(me,{className:`size-4`})}),(0,L.jsx)(A,{label:P(`connectors.remove`),className:`hover:text-rose`,onClick:()=>confirm(`${t.name}: ${P(`connectors.remove`)}?`)&&c.mutate(),children:(0,L.jsx)(y,{className:`size-4`})})]}),t.needsOAuthClient?(0,L.jsx)(`p`,{className:`border-border-soft border-t px-3 py-2 text-[12px] text-rose`,children:P(`connectors.needsClient`)}):null,s.error?(0,L.jsx)(`p`,{className:`border-border-soft border-t px-3 py-2 text-[12px] text-rose`,children:s.error.message}):null,r&&t.actions.length?(0,L.jsx)(`ul`,{className:`max-h-64 overflow-y-auto border-border-soft border-t px-3 py-2`,children:t.actions.map(e=>(0,L.jsxs)(`li`,{className:`flex items-baseline gap-2 py-1 text-[12px]`,children:[(0,L.jsx)(`span`,{className:E(`w-14 shrink-0 text-[11px] uppercase tracking-wide`,e.group===`read`?`text-moss`:e.group===`write`?`text-ink-3`:`text-rose`),children:P(`connectors.group.${e.group}`)}),(0,L.jsx)(`span`,{className:`shrink-0 font-mono text-ink-2`,children:e.id}),(0,L.jsx)(`span`,{className:`min-w-0 truncate text-ink-4`,children:e.summary})]},e.id))}):null]})}function gt({projectId:e,domain:t,source:n,taken:r,onDone:i}){let a=d(),[o,s]=(0,I.useState)({id:``,secret:``}),[c,l]=(0,I.useState)(!1),f=r.includes(n.suggestedId),p=m({mutationFn:()=>u.post(`/api/studio/projects/${e}/connectors`,{domain:t,sourceKind:n.sourceKind,sourceUrl:n.sourceUrl,id:n.suggestedId,toolPrefix:n.suggestedToolPrefix,...n.name?{name:n.name}:{},...o.id&&o.secret?{oauthClientId:o.id,oauthClientSecret:o.secret}:{}}),onSuccess:async t=>{await a.invalidateQueries({queryKey:[`connectors`,e]}),i(t.warnings)}});return(0,L.jsxs)(`div`,{className:`rounded-lg bg-card p-3 ring-1 ring-border-soft`,children:[(0,L.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,L.jsx)(j,{tone:n.sourceKind===`mcp`?`ember`:`neutral`,children:n.sourceKind===`mcp`?`MCP`:`OpenAPI`}),(0,L.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,L.jsx)(`div`,{className:`truncate text-[13px]`,children:n.name??n.suggestedId}),(0,L.jsx)(`div`,{className:`truncate font-mono text-[11px] text-ink-4`,children:n.sourceUrl})]}),n.blocked||f?null:(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(`button`,{type:`button`,onClick:()=>l(e=>!e),className:`text-[12px] text-ink-3 hover:text-ink`,children:P(`connectors.ownClient`)}),(0,L.jsx)(N,{size:`sm`,busy:p.isPending,onClick:()=>p.mutate(),children:P(`connectors.import`)})]})]}),n.blocked?(0,L.jsx)(`p`,{className:`mt-2 text-[12px] text-ink-3`,children:n.blocked}):null,f?(0,L.jsx)(`p`,{className:`mt-2 text-[12px] text-ink-3`,children:P(`connectors.exists`)}):null,c?(0,L.jsxs)(`div`,{className:`mt-3 grid gap-2 sm:grid-cols-2`,children:[(0,L.jsx)(M,{placeholder:`OAuth Client-ID`,value:o.id,onChange:e=>s(t=>({...t,id:e.target.value}))}),(0,L.jsx)(M,{type:`password`,autoComplete:`off`,placeholder:`OAuth Client-Secret`,value:o.secret,onChange:e=>s(t=>({...t,secret:e.target.value}))})]}):null,p.error?(0,L.jsx)(`p`,{className:`mt-2 text-[12px] text-rose`,children:p.error.message}):null]})}function _t({projectId:e}){let[t,n]=(0,I.useState)(``),[r,i]=(0,I.useState)(null),[a,o]=(0,I.useState)(null),[s,l]=(0,I.useState)([]),d=c({queryKey:[`connectors`,e],queryFn:()=>u.get(`/api/studio/projects/${e}/connectors`)}),f=m({mutationFn:()=>u.post(`/api/studio/connectors/search`,{query:t}),onSuccess:e=>{i(e),o(null),l([])}}),p=m({mutationFn:e=>u.get(`/api/studio/connectors/registry/${encodeURIComponent(e)}`),onSuccess:o}),h=d.data??[],g=h.filter(e=>e.sourceKind===`builtin`&&(je.unsetConnectors||e.usable)),_=h.filter(e=>e.sourceKind!==`builtin`);return(0,L.jsxs)(k,{className:`p-6`,children:[(0,L.jsx)(`h2`,{className:`font-display font-semibold text-lg`,children:P(`connectors.title`)}),(0,L.jsx)(`p`,{className:`mt-1 mb-5 text-[14px] text-ink-3`,children:P(`connectors.hint`)}),g.length?(0,L.jsx)(`div`,{className:`mb-5 grid gap-1.5 sm:grid-cols-2`,children:g.map(e=>(0,L.jsx)(pt,{connector:e},e.id))}):null,(0,L.jsx)(`h3`,{className:`mb-2 font-medium text-[12px] text-ink-3 uppercase tracking-[0.07em]`,children:P(`connectors.imported`)}),_.length?(0,L.jsx)(`div`,{className:`mb-4 flex flex-col gap-2`,children:_.map(t=>(0,L.jsx)(ht,{projectId:e,connector:t},t.id))}):null,(0,L.jsxs)(`form`,{className:`flex gap-2`,onSubmit:e=>{e.preventDefault(),t.trim()&&f.mutate()},children:[(0,L.jsx)(M,{value:t,placeholder:P(`connectors.search`),onChange:e=>n(e.target.value)}),(0,L.jsxs)(N,{type:`submit`,variant:`secondary`,busy:f.isPending,children:[(0,L.jsx)(ge,{className:`size-4`}),` `,P(`connectors.find`)]})]}),f.error?(0,L.jsx)(`p`,{className:`mt-3 text-[13px] text-rose`,children:f.error.message}):null,r&&!a?(0,L.jsxs)(`div`,{className:`mt-3 flex flex-col gap-1`,children:[r.length?null:(0,L.jsx)(`p`,{className:`text-[13px] text-ink-3`,children:P(`connectors.none`)}),r.map(e=>(0,L.jsxs)(`button`,{type:`button`,disabled:!e.kinds.length,onClick:()=>p.mutate(e.domain),className:`flex items-center gap-3 rounded-lg px-3 py-2 text-left transition hover:bg-paper-2 disabled:opacity-50`,children:[(0,L.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,L.jsx)(`div`,{className:`truncate text-[14px]`,children:e.domain}),(0,L.jsx)(`div`,{className:`truncate text-[12px] text-ink-3`,children:e.description})]}),(0,L.jsx)(`span`,{className:`text-[11px] text-ink-4 uppercase`,children:e.kinds.join(` · `)}),(0,L.jsx)(ce,{className:`-rotate-90 size-4 text-ink-4`})]},e.domain)),p.isPending?(0,L.jsx)(T,{className:`mx-auto mt-2 size-4 text-ink-4`}):null,p.error?(0,L.jsx)(`p`,{className:`text-[13px] text-rose`,children:p.error.message}):null]}):null,a?(0,L.jsxs)(`div`,{className:`mt-4 flex flex-col gap-2`,children:[(0,L.jsxs)(`div`,{className:`flex items-baseline justify-between gap-3`,children:[(0,L.jsx)(`div`,{className:`font-medium text-[14px]`,children:a.domain}),(0,L.jsx)(`button`,{type:`button`,onClick:()=>o(null),className:`text-[12px] text-ink-3 hover:text-ink`,children:P(`run.back`)})]}),a.summary?(0,L.jsx)(`p`,{className:`text-[13px] text-ink-3`,children:a.summary}):null,a.sources.map(t=>(0,L.jsx)(gt,{projectId:e,domain:a.domain,source:t,taken:h.map(e=>e.id),onDone:l},`${t.sourceKind}:${t.sourceUrl}`)),a.credentials.filter(e=>e.setup||e.url).map(e=>(0,L.jsxs)(`p`,{className:`text-[12px] text-ink-3`,children:[(0,L.jsxs)(`span`,{className:`text-ink-2`,children:[e.label,`:`]}),` `,e.setup,` `,e.url?(0,L.jsx)(`a`,{href:e.url,target:`_blank`,rel:`noreferrer`,className:`text-ember underline`,children:e.url}):null]},e.label)),s.map(e=>(0,L.jsx)(`p`,{className:`text-[12px] text-ink-3`,children:e},e))]}):null]})}var vt=[`Claude Code`,`Codex`,`Cursor`,`Gemini CLI`,`claude.ai`],U=`engenty-wizards`,yt=`ENGENTY_WIZARDS_KEY`;function W({text:e}){let[t,n]=(0,I.useState)(!1);return(0,L.jsxs)(`div`,{className:`flex items-start gap-2 rounded-lg bg-paper-2 p-3`,children:[(0,L.jsx)(`code`,{className:`min-w-0 flex-1 whitespace-pre-wrap break-all font-mono text-[12px] leading-relaxed`,children:e}),(0,L.jsx)(A,{label:P(t?`settings.copied`:`settings.copy`),onClick:async()=>{await navigator.clipboard.writeText(e),n(!0),setTimeout(()=>n(!1),1500)},children:t?(0,L.jsx)(b,{className:`size-4`}):(0,L.jsx)(fe,{className:`size-4`})})]})}function bt(e){try{let t=new URL(e);return t.protocol===`https:`&&!/(^|\.)localhost$/.test(t.hostname)&&!/^(127\.|10\.|192\.168\.|\[::1\])/.test(t.hostname)}catch{return!1}}function G({n:e,title:t,children:n}){return(0,L.jsxs)(`li`,{className:`grid grid-cols-[28px_minmax(0,1fr)] gap-x-3`,children:[(0,L.jsx)(`span`,{className:`grid size-7 place-items-center rounded-full bg-paper-2 font-semibold text-[13px] text-ink-2 ring-1 ring-border-soft`,children:e}),(0,L.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-2.5 pt-0.5 pb-7`,children:[(0,L.jsx)(`h3`,{className:`font-medium text-[15px]`,children:t}),n]})]})}function K({children:e}){return(0,L.jsx)(`p`,{className:`text-[14px] text-ink-3`,children:e})}function xt({client:e,url:t,apiKey:n}){let r=n?`Authorization: Bearer ${n}`:null;switch(e){case`Claude Code`:{let e=t.replace(/\/api\/mcp$/,`/api/claude-plugin`);return(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(K,{children:P(`mcp.terminal`)}),(0,L.jsx)(W,{text:`claude mcp add --transport http --scope user ${U} ${t}${r?` --header "${r}"`:``}`}),!n&&bt(t)?(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(K,{children:P(`mcp.ccPlugin`)}),(0,L.jsx)(W,{text:`claude plugin marketplace add ${e}/marketplace.json`}),(0,L.jsx)(W,{text:`claude plugin install ${U}@engenty`})]}):null]})}case`Codex`:return n?(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(K,{children:P(`mcp.codexKey`)}),(0,L.jsx)(W,{text:`echo 'export ${yt}=${n}' >> ~/.zshrc && source ~/.zshrc`}),(0,L.jsx)(W,{text:`codex mcp add ${U} --url ${t} --bearer-token-env-var ${yt}`})]}):(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(K,{children:P(`mcp.terminal`)}),(0,L.jsx)(W,{text:`codex mcp add ${U} --url ${t}`}),(0,L.jsx)(W,{text:`codex mcp login ${U}`})]});case`Cursor`:return(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(K,{children:P(`mcp.cursor`)}),(0,L.jsx)(W,{text:JSON.stringify({mcpServers:{[U]:n?{url:t,headers:{Authorization:`Bearer ${n}`}}:{url:t}}},null,2)})]});case`Gemini CLI`:return(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(K,{children:P(`mcp.terminal`)}),(0,L.jsx)(W,{text:`gemini mcp add --scope user --transport http ${U} ${t}${r?` -H "${r}"`:``}`})]});case`claude.ai`:return(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(K,{children:P(`mcp.claudeAi`)}),(0,L.jsx)(W,{text:t})]})}}function St(){let e=d(),t=c({queryKey:[`api-keys`],queryFn:()=>u.get(`/api/studio/api-keys`)}),n=m({mutationFn:e=>u.del(`/api/studio/api-keys/${e}`),onSuccess:()=>e.invalidateQueries({queryKey:[`api-keys`]})});return t.data?.length?(0,L.jsxs)(k,{className:`p-6`,children:[(0,L.jsx)(`h2`,{className:`font-display font-semibold text-lg`,children:P(`mcp.keys`)}),(0,L.jsx)(`p`,{className:`mt-1 mb-5 text-[14px] text-ink-3`,children:P(`mcp.keysHint`)}),(0,L.jsx)(`div`,{className:`flex flex-col gap-2`,children:t.data.map(e=>(0,L.jsxs)(`div`,{className:`flex items-center gap-3 rounded-lg bg-paper px-3 py-2 ring-1 ring-border-soft`,children:[(0,L.jsx)(We,{className:`size-4 shrink-0 text-ink-4`}),(0,L.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,L.jsx)(`div`,{className:`truncate text-[14px]`,children:e.name}),(0,L.jsxs)(`div`,{className:`font-mono text-[11px] text-ink-4`,children:[e.start,`… ·`,` `,e.lastRequest?P(`settings.lastUsed`,{when:new Date(e.lastRequest).toLocaleString()}):P(`settings.neverUsed`)]})]}),(0,L.jsx)(A,{label:P(`settings.revoke`),onClick:()=>n.mutate(e.id),className:`hover:text-rose`,children:(0,L.jsx)(y,{className:`size-4`})})]},e.id))})]}):null}function Ct(){let e=g(),t=d(),[n,r]=(0,I.useState)(`Claude Code`),[i,a]=(0,I.useState)({}),o=m({mutationFn:e=>u.post(`/api/studio/api-keys`,{name:e}),onSuccess:async e=>{a(t=>({...t,[n]:e.key})),await t.invalidateQueries({queryKey:[`api-keys`]})}});if(!e.data)return null;let s=e.data.mode===`managed`,c=e.data.mcpUrl??``,l=bt(c),f=i[n],p=n===`claude.ai`&&!(s&&l),h=1;return(0,L.jsxs)(`div`,{className:`flex flex-col gap-6`,children:[(0,L.jsxs)(k,{className:`p-6`,children:[(0,L.jsx)(`h2`,{className:`font-display font-semibold text-lg`,children:P(`mcp.title`)}),(0,L.jsx)(`p`,{className:`mt-1 text-[14px] text-ink-2`,children:P(`mcp.lead`)}),(0,L.jsxs)(`div`,{className:`my-6 flex flex-wrap items-center gap-3 text-[14px]`,children:[(0,L.jsx)(`span`,{className:`rounded-full bg-paper-2 px-3.5 py-1.5 ring-1 ring-border-soft`,children:P(`mcp.yourClient`)}),(0,L.jsxs)(`span`,{className:`flex items-center gap-1.5 font-mono text-[12px] text-ink-3`,children:[`MCP `,(0,L.jsx)(ee,{className:`size-4`})]}),(0,L.jsx)(`span`,{className:`rounded-full bg-ember-tint px-3.5 py-1.5 font-medium text-ember-strong`,children:`engenty wizards`})]}),(0,L.jsx)(`h3`,{className:`font-medium text-[14px]`,children:P(`mcp.canTitle`)}),(0,L.jsxs)(`ul`,{className:`mt-2 flex list-disc flex-col gap-1 pl-5 text-[14px] text-ink-2`,children:[(0,L.jsx)(`li`,{children:P(`mcp.can1`)}),(0,L.jsx)(`li`,{children:P(`mcp.can2`)}),(0,L.jsx)(`li`,{children:P(`mcp.can3`)}),(0,L.jsx)(`li`,{children:P(`mcp.can4`)})]}),(0,L.jsx)(`p`,{className:`mt-5 text-[13px] text-ink-3`,children:P(`mcp.notReverse`)})]}),(0,L.jsxs)(k,{className:`p-6`,children:[(0,L.jsx)(`h2`,{className:`mb-6 font-display font-semibold text-lg`,children:P(`mcp.setup`)}),(0,L.jsxs)(`ol`,{className:`flex flex-col`,children:[(0,L.jsx)(G,{n:h++,title:P(`mcp.pick`),children:(0,L.jsx)(`div`,{className:`overflow-x-auto`,children:(0,L.jsx)(xe,{value:n,onChange:r,options:[...vt]})})}),p?(0,L.jsx)(G,{n:h++,title:P(`mcp.notHere`),children:(0,L.jsx)(K,{children:P(s?`mcp.needsPublic`:`mcp.claudeAiLocal`)})}):(0,L.jsxs)(L.Fragment,{children:[s?null:(0,L.jsx)(G,{n:h++,title:P(`mcp.keyTitle`),children:f?(0,L.jsxs)(`p`,{className:`flex items-center gap-2 text-[14px] text-ink-2`,children:[(0,L.jsx)(b,{className:`size-4 text-moss`}),` `,P(`mcp.keyReady`)]}):(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(K,{children:P(`mcp.keyHint`)}),(0,L.jsx)(`div`,{children:(0,L.jsxs)(N,{variant:`secondary`,busy:o.isPending,onClick:()=>o.mutate(n),children:[(0,L.jsx)(S,{className:`size-4`}),` `,P(`mcp.keyCreate`,{client:n})]})})]})}),(0,L.jsxs)(G,{n:h++,title:P(`mcp.add`),children:[s||f?(0,L.jsx)(xt,{client:n,url:c,apiKey:f}):(0,L.jsx)(K,{children:P(`mcp.keyFirst`)}),s?(0,L.jsx)(K,{children:P(`mcp.oauth`)}):null]}),(0,L.jsxs)(G,{n:h++,title:P(`mcp.try`),children:[(0,L.jsx)(K,{children:P(`mcp.tryHint`)}),(0,L.jsx)(W,{text:P(`mcp.tryPrompt`)})]})]})]}),(0,L.jsxs)(`div`,{className:`border-border-soft border-t pt-5`,children:[(0,L.jsx)(`h3`,{className:`font-medium text-[14px]`,children:P(`mcp.address`)}),(0,L.jsx)(`div`,{className:`mt-2`,children:(0,L.jsx)(W,{text:c})}),(0,L.jsx)(`p`,{className:`mt-2 text-[13px] text-ink-3`,children:P(l?`mcp.addressPublic`:`mcp.addressLocal`)})]})]}),s?(0,L.jsxs)(k,{className:`p-6`,children:[(0,L.jsx)(`h2`,{className:`font-display font-semibold text-lg`,children:P(`mcp.keys`)}),(0,L.jsx)(`p`,{className:`mt-1 mb-4 text-[14px] text-ink-3`,children:P(`setup.keysInAccount`)}),(0,L.jsx)(`div`,{children:(0,L.jsx)(N,{variant:`secondary`,onClick:()=>window.open(`${e.data?.manageUrl}/account`,`_blank`,`noopener`),children:P(`setup.openAccount`)})})]}):(0,L.jsx)(St,{})]})}function wt(e){return e.type.startsWith(`image/`)&&/logo/i.test(e.name)?`logo`:/^(image|video|audio)\//.test(e.type)?`asset`:`document`}function Tt(e,t){let n=d(),[r,i]=(0,I.useState)([]),[a,o]=(0,I.useState)(`idle`),[c,l]=(0,I.useState)(null),[f,p]=(0,I.useState)(null),[m,h]=(0,I.useState)(null),g=(0,I.useRef)(null),_=()=>(g.current??=(async()=>{await Promise.all([n.invalidateQueries({queryKey:[`projects`]}),n.invalidateQueries({queryKey:[`project-files`,e]})]),t(),g.current=null})(),g.current);return{messages:r,phase:a,activity:f,startedAt:m,error:c,send:async(t,c=[])=>{if(!(t.trim()||c.length)||a!==`idle`)return!1;if(l(null),o(`thinking`),h(Date.now()),c.length){try{for(let t of c)await u.upload(`/api/studio/projects/${e}/files?kind=${wt(t)}`,t)}catch(e){return l(e.message),o(`idle`),h(null),await _(),!1}await _();let n=`${P(`editor.attached`)}: ${c.map(e=>e.name).join(`, `)}`;t=t.trim()?`${t}\n\n${n}`:n}let d=r.map(({role:e,content:t})=>({role:e,content:t})).slice(-12),f=`p-${Date.now()}`;i(e=>[...e,{id:`u-${Date.now()}`,role:`user`,content:t,previews:ue(c)},{id:f,role:`assistant`,content:``,pending:!0}]),p(null);let m=!1;try{await s(`/api/studio/projects/${e}/assist`,{message:t,history:d},(e,t)=>{if(e===`text`){let e=JSON.parse(t);i(t=>t.map(t=>t.id===f?{...t,content:t.content+e}:t))}else if(e===`activity`)p(JSON.parse(t));else if(e===`changed`)o(`building`),_();else if(e===`done`){m=!0;let e=JSON.parse(t);i(t=>t.map(t=>t.id===f?{...t,content:e.reply,changed:e.changed,pending:!1}:t))}else e===`error`&&(m=!0,l(JSON.parse(t).message))}),m||l(P(`editor.chatBroken`))}catch(e){l(e.message)}finally{p(null),h(null),i(e=>e.filter(e=>!(e.id===f&&!e.content)).map(e=>({...e,pending:!1}))),o(`idle`),await g.current,await _(),await n.invalidateQueries({queryKey:[`me`]})}return!0}}}function Et(){return(0,L.jsxs)(`div`,{className:`sm:pr-36`,children:[(0,L.jsx)(`h2`,{className:`font-display font-semibold text-[20px] leading-tight tracking-tight`,children:P(`project.assistantTitle`)}),(0,L.jsx)(`p`,{className:`mt-1.5 max-w-2xl text-[15px] text-ink-2 leading-relaxed`,children:P(`project.assistantHello`)})]})}var Dt=72,Ot=720;function kt({projectId:e,onChanged:t}){let n=Tt(e,t),r=(0,I.useRef)(null),[i,a]=(0,I.useState)(null);return(0,I.useEffect)(()=>{let e=()=>{let e=r.current?.getBoundingClientRect();e&&a(t=>{if(e.bottom>=Dt)return null;let n=Math.min(e.width,Ot),r=e.left+(e.width-n)/2;return t&&t.left===r&&t.width===n?t:{left:r,width:n,height:t?.height??e.height}})};return e(),window.addEventListener(`scroll`,e,{passive:!0}),window.addEventListener(`resize`,e),()=>{window.removeEventListener(`scroll`,e),window.removeEventListener(`resize`,e)}},[]),(0,L.jsxs)(`div`,{ref:r,style:i?{minHeight:i.height}:void 0,children:[(0,L.jsxs)(`div`,{className:`mb-2 flex items-center gap-1.5 px-1 font-medium text-[12px] text-ember-strong uppercase tracking-[0.07em]`,children:[(0,L.jsx)(ie,{className:`size-3.5`}),` `,P(`project.assistant`)]}),(0,L.jsxs)(`div`,{className:`relative`,children:[!i&&n.messages.length===0?(0,L.jsx)(`div`,{className:`absolute -top-14 right-10 z-10 max-sm:hidden`,children:(0,L.jsx)(o,{kind:`round`,size:104})}):null,(0,L.jsx)(`div`,{className:E(`flex flex-col overflow-hidden bg-card`,i?`fixed bottom-4 z-30 max-h-[70dvh] animate-dock rounded-2xl shadow-overlay ring-1 ring-border`:`max-h-[520px] rounded-xl bg-linear-to-br from-ember-tint via-card to-card shadow-soft ring-1 ring-ember-veil`),style:i?{left:i.left,width:i.width}:void 0,children:(0,L.jsx)(de,{chat:n,avatar:`round`,compact:!!i,intro:(0,L.jsx)(Et,{}),placeholder:P(`project.assistantComposer`),changedLabel:P(`project.assistantChanged`)})})]})]})}var At=[`text`,`longtext`,`number`,`date`,`url`,`email`,`phone`,`boolean`],jt=/^(\d{4}-\d{2}-\d{2}|\d{1,2}\.\s?\d{1,2}\.\s?\d{4})$/,Mt=/^[+-]?\d{1,3}([.,\s']?\d{3})*([.,]\d+)?$/,Nt=/^[^\s@]+@[^\s@]+\.[^\s@]{2,}$/,Pt=/^(https?:\/\/|www\.)\S+$/i,Ft=/^\+?[\d\s()/.-]{7,20}$/,It=/^(ja|nein|yes|no|true|false)$/i;function Lt(e){let t=e.trim();return t?t.includes(`
2
- `)||t.length>140?`longtext`:It.test(t)?`boolean`:Nt.test(t)?`email`:Pt.test(t)?`url`:jt.test(t)?`date`:Mt.test(t)&&!/^(\+|0\d)/.test(t)?`number`:Ft.test(t)&&t.replace(/\D/g,``).length>=7?`phone`:`text`:`text`}function Rt(e,t=[]){let n=e.toLowerCase().replace(/ä/g,`ae`).replace(/ö/g,`oe`).replace(/ü/g,`ue`).replace(/ß/g,`ss`).normalize(`NFD`).replace(/[^a-z0-9]+/g,`_`).replace(/^_+|_+$/g,``).slice(0,40)||`fakt`,r=n;for(let e=2;t.includes(r);e++)r=`${n}_${e}`;return r}var zt=[{key:`adresse`,de:`Adresse`,en:`Address`},{key:`plz`,de:`PLZ`,en:`Postcode`},{key:`ort`,de:`Ort`,en:`City`},{key:`uid`,de:`UID`,en:`VAT id`},{key:`telefon`,de:`Telefon`,en:`Phone`},{key:`e_mail`,de:`E-Mail`,en:`Email`},{key:`website`,de:`Website`,en:`Website`},{key:`iban`,de:`IBAN`,en:`IBAN`}],q={facts:100,colors:12,files:{logo:8,asset:100,document:50},bytes:{logo:5e6,asset:15e6,video:8e7,document:3e7}},J=/^#[0-9a-fA-F]{6}$/;function Bt({onAdd:e,onClose:t}){let[n,r]=(0,I.useState)(`#e0531b`),[i,a]=(0,I.useState)(``),o=J.test(n);return(0,L.jsx)(D,{open:!0,onClose:t,title:P(`project.colorAddTitle`),children:(0,L.jsxs)(`form`,{onSubmit:r=>{r.preventDefault(),o&&(e({name:i.trim(),value:n.toLowerCase()}),t())},className:`flex flex-col gap-5`,children:[(0,L.jsxs)(`div`,{children:[(0,L.jsx)(w,{children:P(`project.colorValue`)}),(0,L.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,L.jsx)(be,{value:o?n:`#888888`,onChange:e=>r(e.target.value)}),(0,L.jsx)(M,{value:n,placeholder:`#e0531b`,spellCheck:!1,onChange:e=>r(e.target.value.trim()),className:`font-mono text-[14px]`})]})]}),(0,L.jsxs)(`div`,{children:[(0,L.jsx)(w,{children:P(`project.colorUseLabel`)}),(0,L.jsx)(M,{autoFocus:!0,value:i,maxLength:120,placeholder:P(`project.colorName`),onChange:e=>a(e.target.value)}),(0,L.jsx)(`p`,{className:`mt-1.5 text-[13px] text-ink-3`,children:P(`project.colorUse`)})]}),(0,L.jsxs)(`div`,{className:`flex justify-end gap-2`,children:[(0,L.jsx)(N,{variant:`ghost`,onClick:t,children:P(`common.cancel`)}),(0,L.jsx)(N,{type:`submit`,disabled:!o,children:P(`project.add`)})]})]})})}function Vt({colors:e,save:t}){let n=(0,I.useRef)(0),[r,i]=(0,I.useState)(()=>e.map(e=>({...e,id:`c${n.current++}`}))),[a,o]=(0,I.useState)(!1),s=H(r.filter(e=>J.test(e.value)).map(({name:e,value:t})=>({name:e.trim(),value:t})),t),c=(e,t)=>i(n=>n.map(n=>n.id===e?{...n,...t}:n));return(0,L.jsxs)(R,{title:P(`project.colors`),hint:P(`project.colorsHint`),save:s,children:[(0,L.jsx)(`div`,{className:`flex flex-col gap-2`,children:r.map((e,t)=>(0,L.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,L.jsx)(be,{value:J.test(e.value)?e.value:`#888888`,onChange:t=>c(e.id,{value:t.target.value})}),(0,L.jsx)(M,{value:e.name,placeholder:P(`project.colorName`),maxLength:120,onChange:t=>c(e.id,{name:t.target.value}),className:`min-w-0 flex-1`}),(0,L.jsx)(M,{value:e.value,placeholder:`#e0531b`,spellCheck:!1,onChange:t=>c(e.id,{value:t.target.value.trim()}),className:`w-28 font-mono text-[13px]`}),(0,L.jsxs)(`div`,{className:`flex w-24 shrink-0 items-center justify-end max-sm:w-auto`,children:[t===0?(0,L.jsx)(`span`,{className:`mr-1 max-sm:hidden`,children:(0,L.jsx)(j,{tone:`ember`,children:P(`project.colorAccent`)})}):(0,L.jsx)(A,{label:P(`project.colorFirst`),onClick:()=>i(t=>[e,...t.filter(t=>t.id!==e.id)]),children:(0,L.jsx)(te,{className:`size-4`})}),(0,L.jsx)(A,{label:P(`project.remove`),onClick:()=>i(t=>t.filter(t=>t.id!==e.id)),className:`hover:text-rose`,children:(0,L.jsx)(y,{className:`size-4`})})]})]},e.id))}),r.length?(0,L.jsx)(`p`,{className:`mt-1.5 text-[13px] text-ink-3`,children:P(`project.colorUse`)}):null,r.length<q.colors?(0,L.jsxs)(N,{variant:`secondary`,size:`sm`,className:r.length?`mt-3`:void 0,onClick:()=>o(!0),children:[(0,L.jsx)(S,{className:`size-4`}),` `,P(`project.colorAdd`)]}):null,a?(0,L.jsx)(Bt,{onClose:()=>o(!1),onAdd:e=>i(t=>[...t,{...e,id:`c${n.current++}`}])}):null]})}var Ht={backgroundImage:`repeating-conic-gradient(#c9c9c9 0% 25%, #dedede 0% 50%)`,backgroundSize:`16px 16px`};function Y({file:e,actions:t}){let[n,r]=(0,I.useState)(e.description),i=(0,I.useRef)(e.description),a=(0,I.useRef)(null);(0,I.useEffect)(()=>{e.description!==i.current&&(r(t=>t===i.current?e.description:t),i.current=e.description)},[e.description]),(0,I.useLayoutEffect)(()=>{let e=a.current;e&&(e.style.height=`auto`,e.style.height=`${e.scrollHeight}px`)},[n]);let o=e.status===`pending`&&!n;return(0,L.jsx)(`textarea`,{ref:a,rows:1,value:n,maxLength:600,placeholder:P(o?`project.describing`:`project.description`),onChange:e=>r(e.target.value),onBlur:()=>{n.trim()!==e.description&&(i.current=n.trim(),t.describe(e.id,n.trim()))},className:`-mx-1 block w-[calc(100%+0.5rem)] resize-none overflow-hidden rounded-md bg-transparent px-1 py-0.5 text-[13px] text-ink-2 leading-snug outline-none transition placeholder:text-ink-4 hover:bg-paper-2 focus:bg-card focus:text-ink focus:ring-1 focus:ring-border`})}function X(e,t){confirm(P(`project.removeConfirm`,{name:e.name}))&&t.remove(e.id)}function Z({projectId:e,file:t,small:n}){let r=B(e,t.id);return t.mime.startsWith(`image/`)?(0,L.jsx)(`img`,{src:r,alt:``,loading:`lazy`,className:E(`size-full`,t.kind===`logo`?`object-contain p-3`:`object-cover`)}):t.mime.startsWith(`video/`)?(0,L.jsx)(`video`,{src:`${r}#t=0.1`,preload:`metadata`,controls:!n,className:`size-full object-cover`}):(0,L.jsx)(`div`,{className:`flex size-full items-center justify-center text-ink-3`,children:t.mime.startsWith(`audio/`)?(0,L.jsx)(Xe,{className:n?`size-5`:`size-7`}):(0,L.jsx)(oe,{className:n?`size-5`:`size-7`})})}function Ut({projectId:e,kind:t,files:n,actions:r,accept:i,addLabel:a,onPreview:o}){return(0,L.jsxs)(`div`,{className:`grid grid-cols-[repeat(auto-fill,minmax(184px,1fr))] gap-3`,children:[n.map((i,a)=>(0,L.jsxs)(`div`,{className:`group relative flex flex-col gap-1.5 rounded-lg bg-paper p-2 pb-2.5 ring-1 ring-border-soft`,children:[t===`logo`&&a===0?(0,L.jsx)(`span`,{className:`absolute -top-3 left-3 z-10 rounded-full ring-2 ring-card`,children:(0,L.jsx)(j,{tone:`ember`,children:P(`project.logoMain`)})}):null,(0,L.jsxs)(`div`,{className:`relative h-28 overflow-hidden rounded-md bg-paper-2`,style:t===`logo`?Ht:void 0,children:[o&&i.mime.startsWith(`image/`)?(0,L.jsx)(`button`,{type:`button`,"aria-label":`${P(`project.preview`)}: ${i.name}`,onClick:()=>o(i),className:`block size-full cursor-zoom-in`,children:(0,L.jsx)(Z,{projectId:e,file:i})}):(0,L.jsx)(Z,{projectId:e,file:i}),(0,L.jsxs)(`div`,{className:`absolute top-1 right-1 flex gap-1 opacity-0 transition focus-within:opacity-100 group-hover:opacity-100 coarse:opacity-100`,children:[o?(0,L.jsx)(A,{label:P(`project.preview`),onClick:()=>o(i),className:`size-8 bg-card shadow-soft`,children:(0,L.jsx)(x,{className:`size-4`})}):null,t===`logo`&&a>0?(0,L.jsx)(A,{label:P(`project.logoMakeMain`),onClick:()=>r.order(`logo`,[i.id,...n.filter(e=>e.id!==i.id).map(e=>e.id)]),className:`size-8 bg-card shadow-soft`,children:(0,L.jsx)(he,{className:`size-4`})}):null,(0,L.jsx)(A,{label:P(`project.remove`),onClick:()=>X(i,r),className:`size-8 bg-card shadow-soft hover:text-rose`,children:(0,L.jsx)(y,{className:`size-4`})})]})]}),t===`asset`?(0,L.jsx)(`div`,{className:`truncate px-0.5 text-[12px] text-ink-3`,title:i.name,children:i.name}):null,(0,L.jsx)(Y,{file:i,actions:r})]},i.id)),a?(0,L.jsxs)(z,{accept:i,multiple:!1,onFiles:e=>r.upload(t,e),className:`min-h-28 flex-col p-3`,children:[r.busy?(0,L.jsx)(T,{className:`size-5`}):(0,L.jsx)(S,{className:`size-5`}),a]}):null]})}function Wt({projectId:e,data:t}){let n=V(e);return(0,L.jsxs)(R,{title:P(`project.logos`),hint:P(`project.logosHint`),children:[(0,L.jsx)(Ut,{projectId:e,kind:`logo`,files:t.files.filter(e=>e.kind===`logo`),actions:n,accept:`image/*`,addLabel:P(`project.logoAdd`)}),n.error?(0,L.jsx)(`p`,{className:`mt-3 text-[14px] text-rose`,children:n.error}):null]})}var Gt=e=>[(e.name.includes(`.`)?e.name.split(`.`).pop():e.mime.split(`/`).pop())?.toUpperCase().slice(0,5),ut(e.size)].filter(Boolean).join(` · `);function Kt({projectId:e,file:t,actions:n,onClose:r}){let i=B(e,t.id);return(0,L.jsxs)(D,{open:!0,onClose:r,wide:`page`,title:t.name,children:[(0,L.jsxs)(`div`,{className:`-mt-2 mb-4 flex items-center justify-between gap-3`,children:[(0,L.jsx)(`span`,{className:`text-[13px] text-ink-3`,children:Gt(t)}),(0,L.jsx)(`a`,{href:i,target:`_blank`,rel:`noreferrer`,"aria-label":P(`project.openOriginal`),title:P(`project.openOriginal`),className:`inline-flex size-9 items-center justify-center rounded-full text-ink-3 transition hover:bg-accent hover:text-ink`,children:(0,L.jsx)(C,{className:`size-4`})})]}),t.mime.startsWith(`image/`)?(0,L.jsx)(`div`,{className:`overflow-hidden rounded-lg`,style:Ht,children:(0,L.jsx)(`img`,{src:i,alt:``,className:`mx-auto max-h-[68dvh] object-contain`})}):t.mime.startsWith(`video/`)?(0,L.jsx)(`video`,{src:i,controls:!0,className:`max-h-[68dvh] w-full rounded-lg bg-black`}):(0,L.jsx)(`audio`,{src:i,controls:!0,className:`w-full`}),(0,L.jsx)(`div`,{className:`mt-4`,children:(0,L.jsx)(Y,{file:t,actions:n})})]})}function qt({projectId:e,file:t,actions:n,onPreview:r}){return(0,L.jsxs)(`li`,{className:`flex items-start gap-3 rounded-lg bg-paper p-2 ring-1 ring-border-soft`,children:[(0,L.jsx)(`button`,{type:`button`,"aria-label":`${P(`project.preview`)}: ${t.name}`,onClick:r,className:`size-14 shrink-0 cursor-zoom-in overflow-hidden rounded-md bg-paper-2`,children:(0,L.jsx)(Z,{projectId:e,file:t,small:!0})}),(0,L.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col gap-1 py-0.5`,children:[(0,L.jsxs)(`div`,{className:`flex flex-wrap items-baseline gap-x-3`,children:[(0,L.jsx)(`button`,{type:`button`,onClick:r,title:t.name,className:`min-w-0 truncate font-medium text-[14px] hover:underline`,children:t.name}),(0,L.jsx)(`span`,{className:`text-[12px] text-ink-3`,children:Gt(t)})]}),(0,L.jsx)(Y,{file:t,actions:n})]}),(0,L.jsxs)(`div`,{className:`flex shrink-0 items-start`,children:[(0,L.jsx)(A,{label:P(`project.preview`),onClick:r,children:(0,L.jsx)(x,{className:`size-4`})}),(0,L.jsx)(A,{label:P(`project.remove`),onClick:()=>X(t,n),className:`hover:text-rose`,children:(0,L.jsx)(y,{className:`size-4`})})]})]})}function Jt({projectId:e,data:t}){let n=V(e),[r,i]=lt(`assets`,`cards`),[a,o]=(0,I.useState)(``),[s,c]=(0,I.useState)(null),l=t.files.filter(e=>e.kind===`asset`),u=l.find(e=>e.id===s),d=a.trim().toLowerCase(),f=d?l.filter(e=>`${e.name} ${e.description}`.toLowerCase().includes(d)):l;return(0,L.jsxs)(R,{title:P(`project.assets`),hint:P(`project.assetsHint`),children:[l.length?(0,L.jsx)(it,{layout:r,onToggle:i,children:(0,L.jsx)(at,{value:a,onChange:o,placeholder:P(`project.assetSearch`)})}):null,f.length?(0,L.jsx)(`div`,{className:`mb-3`,children:r===`cards`?(0,L.jsx)(Ut,{projectId:e,kind:`asset`,files:f,actions:n,onPreview:e=>c(e.id)}):(0,L.jsx)(`ul`,{className:`flex flex-col gap-2`,children:f.map(t=>(0,L.jsx)(qt,{projectId:e,file:t,actions:n,onPreview:()=>c(t.id)},t.id))})}):null,(0,L.jsxs)(z,{accept:`image/*,video/*,audio/*`,onFiles:e=>n.upload(`asset`,e),className:`h-16 w-full`,children:[n.busy?(0,L.jsx)(T,{className:`size-4`}):(0,L.jsx)(ve,{className:`size-4`}),P(`project.drop`),` `,(0,L.jsx)(`span`,{className:`underline`,children:P(`project.assetAdd`)})]}),n.error?(0,L.jsx)(`p`,{className:`mt-3 text-[14px] text-rose`,children:n.error}):null,u?(0,L.jsx)(Kt,{projectId:e,file:u,actions:n,onClose:()=>c(null)}):null]})}function Yt(e,t,n){return c({queryKey:[`project-file-text`,t.id,t.chars,n],queryFn:()=>u.get(`/api/studio/projects/${e}/files/${t.id}/text?limit=${n}`),enabled:t.status===`ready`,staleTime:6e4})}function Xt(e){return((e.name.includes(`.`)?e.name.split(`.`).pop():``)||e.mime.split(`/`).pop()||``).toUpperCase().slice(0,5)}var Q=e=>[Xt(e),e.pages?P(`project.pages`,{n:e.pages}):null,ut(e.size)].filter(Boolean).join(` · `);function $({file:e}){return e.status===`pending`?(0,L.jsxs)(`span`,{className:`inline-flex items-center gap-1.5 text-[12px] text-ink-3`,children:[(0,L.jsx)(T,{className:`size-3`}),` `,P(`project.reading`)]}):e.status===`failed`?(0,L.jsx)(`span`,{className:`text-[12px] text-rose`,children:e.error}):e.indexed?(0,L.jsx)(j,{tone:`live`,children:e.indexed===`embeddings`?P(`project.indexed`):P(`project.indexedKeywords`)}):(0,L.jsx)(j,{tone:`warn`,children:P(`project.notIndexed`)})}function Zt({file:e,actions:t,onPreview:n}){return(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(A,{label:P(`project.preview`),onClick:n,children:(0,L.jsx)(x,{className:`size-4`})}),e.status===`pending`?null:(0,L.jsx)(A,{label:P(`project.reindex`),onClick:()=>t.reindex(e.id),children:(0,L.jsx)(me,{className:`size-4`})}),(0,L.jsx)(A,{label:P(`project.remove`),onClick:()=>X(e,t),className:`hover:text-rose`,children:(0,L.jsx)(y,{className:`size-4`})})]})}function Qt({file:e,actions:t,onPreview:n}){let r=/sheet|csv|excel/.test(e.mime);return(0,L.jsxs)(`li`,{className:`flex gap-3 rounded-lg bg-paper p-3 ring-1 ring-border-soft`,children:[(0,L.jsx)(`div`,{className:`mt-0.5 text-ink-3`,children:r?(0,L.jsx)(Re,{className:`size-5`}):(0,L.jsx)(pe,{className:`size-5`})}),(0,L.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col gap-1.5`,children:[(0,L.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-3 gap-y-1`,children:[(0,L.jsx)(`button`,{type:`button`,onClick:n,title:e.name,className:`min-w-0 truncate font-medium text-[14px] hover:underline`,children:e.name}),(0,L.jsx)(`span`,{className:`text-[12px] text-ink-3`,children:Q(e)}),(0,L.jsx)($,{file:e})]}),(0,L.jsx)(Y,{file:e,actions:t})]}),(0,L.jsx)(`div`,{className:`-my-1 flex shrink-0 items-start`,children:(0,L.jsx)(Zt,{file:e,actions:t,onPreview:n})})]})}function $t({projectId:e,file:t}){let n=Yt(e,t,1500);return t.mime.startsWith(`image/`)?(0,L.jsx)(`img`,{src:B(e,t.id),alt:``,className:`size-full object-cover`}):t.status===`pending`||n.isLoading?(0,L.jsx)(`div`,{className:`flex size-full items-center justify-center text-ink-4`,children:(0,L.jsx)(T,{className:`size-5`})}):(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(`div`,{className:`w-[222%] origin-top-left scale-[0.45] p-6`,children:(0,L.jsx)(ae,{text:n.data?.text??``})}),(0,L.jsx)(`div`,{className:`absolute inset-x-0 bottom-0 h-12 bg-linear-to-t from-card to-transparent`})]})}function en({projectId:e,file:t,actions:n,onPreview:r}){return(0,L.jsxs)(`li`,{className:`group flex flex-col gap-1.5 rounded-lg bg-paper p-2 pb-2.5 ring-1 ring-border-soft`,children:[(0,L.jsxs)(`div`,{className:`relative`,children:[(0,L.jsx)(`button`,{type:`button`,onClick:r,"aria-label":`${P(`project.preview`)}: ${t.name}`,className:`relative block h-44 w-full overflow-hidden rounded-md bg-card text-left ring-1 ring-border-soft transition hover:ring-border`,children:(0,L.jsx)($t,{projectId:e,file:t})}),(0,L.jsx)(`div`,{className:`absolute top-1 right-1 flex gap-1 opacity-0 transition focus-within:opacity-100 group-hover:opacity-100 coarse:opacity-100 [&>button]:size-8 [&>button]:bg-card [&>button]:shadow-soft`,children:(0,L.jsx)(Zt,{file:t,actions:n,onPreview:r})})]}),(0,L.jsxs)(`div`,{className:`mt-1 flex flex-col gap-1 px-0.5`,children:[(0,L.jsx)(`div`,{className:`truncate font-medium text-[13px]`,title:t.name,children:t.name}),(0,L.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-2 gap-y-1`,children:[(0,L.jsx)(`span`,{className:`text-[12px] text-ink-3`,children:Q(t)}),(0,L.jsx)($,{file:t})]})]}),(0,L.jsx)(Y,{file:t,actions:n})]})}var tn=2e5;function nn({projectId:e,file:t,onClose:n}){let r=t.mime===`application/pdf`||t.mime.startsWith(`image/`),[i,a]=(0,I.useState)(r?`original`:`text`),o=Yt(e,t,tn),s=B(e,t.id),c=(e,t)=>(0,L.jsx)(`button`,{type:`button`,"aria-pressed":i===e,onClick:()=>a(e),className:E(`h-8 rounded-full px-3 text-[13px] transition`,i===e?`bg-paper-2 font-medium text-ink`:`text-ink-3 hover:text-ink`),children:t});return(0,L.jsxs)(D,{open:!0,onClose:n,wide:`page`,title:t.name,children:[(0,L.jsxs)(`div`,{className:`-mt-2 mb-4 flex flex-wrap items-center gap-x-3 gap-y-2`,children:[(0,L.jsx)(`span`,{className:`text-[13px] text-ink-3`,children:Q(t)}),(0,L.jsx)($,{file:t}),(0,L.jsxs)(`div`,{className:`ml-auto flex items-center gap-1`,children:[r?(0,L.jsxs)(L.Fragment,{children:[c(`original`,P(`project.original`)),c(`text`,P(`project.readText`))]}):null,(0,L.jsx)(`a`,{href:s,target:`_blank`,rel:`noreferrer`,"aria-label":P(`project.openOriginal`),title:P(`project.openOriginal`),className:`inline-flex size-9 items-center justify-center rounded-full text-ink-3 transition hover:bg-accent hover:text-ink`,children:(0,L.jsx)(C,{className:`size-4`})})]})]}),i===`original`?t.mime===`application/pdf`?(0,L.jsx)(`iframe`,{src:s,title:t.name,className:`h-[70dvh] w-full rounded-lg bg-paper-2 ring-1 ring-border-soft`}):(0,L.jsx)(`img`,{src:s,alt:``,className:`mx-auto max-h-[70dvh] rounded-lg object-contain`}):o.isLoading?(0,L.jsx)(`div`,{className:`flex h-40 items-center justify-center text-ink-3`,children:(0,L.jsx)(T,{})}):o.data?.text?(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(`div`,{className:`overflow-x-auto rounded-lg bg-paper p-5 ring-1 ring-border-soft`,children:(0,L.jsx)(ae,{text:o.data.text,className:`text-[14px]`})}),o.data.chars>o.data.text.length?(0,L.jsx)(`p`,{className:`mt-3 text-[13px] text-ink-3`,children:P(`project.textCut`,{shown:o.data.text.length.toLocaleString(),total:o.data.chars.toLocaleString()})}):null]}):(0,L.jsx)(`p`,{className:`py-8 text-center text-[14px] text-ink-3`,children:P(`project.noText`)})]})}function rn({projectId:e}){let[t,n]=(0,I.useState)(``),[r,i]=(0,I.useState)(null),[a,o]=(0,I.useState)(!1),s=async()=>{if(!t.trim()){i(null);return}o(!0);try{let n=await u.post(`/api/studio/projects/${e}/search`,{query:t});i(n.hits)}catch{i([])}finally{o(!1)}};return(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(at,{value:t,placeholder:P(`project.searchTest`),busy:a,onEnter:()=>void s(),onChange:e=>{n(e),e.trim()||i(null)}}),r?r.length?(0,L.jsx)(`ul`,{className:`mt-2 flex flex-col gap-2`,children:r.map((e,t)=>(0,L.jsxs)(`li`,{className:`rounded-lg bg-paper-2 px-3 py-2 text-[13px]`,children:[(0,L.jsx)(`div`,{className:`mb-0.5 font-medium text-[12px] text-ink-3`,children:e.name}),(0,L.jsx)(`p`,{className:`line-clamp-3 whitespace-pre-line text-ink-2`,children:e.text})]},t))}):(0,L.jsx)(`p`,{className:`mt-2 text-[13px] text-ink-3`,children:P(`project.searchNone`)}):null]})}function an({projectId:e,data:t}){let n=V(e),[r,i]=lt(`documents`,`list`),[a,o]=(0,I.useState)(null),s=t.files.filter(e=>e.kind===`document`),c=s.find(e=>e.id===a),l=r===`cards`?en:Qt;return(0,L.jsxs)(R,{title:P(`project.documents`),hint:P(`project.documentsHint`),children:[s.length?(0,L.jsx)(it,{layout:r,onToggle:i,children:(0,L.jsx)(rn,{projectId:e})}):null,s.length?(0,L.jsx)(`ul`,{className:E(`mb-3`,r===`cards`?`grid grid-cols-[repeat(auto-fill,minmax(220px,1fr))] gap-3`:`flex flex-col gap-2`),children:s.map(t=>(0,L.jsx)(l,{projectId:e,file:t,actions:n,onPreview:()=>o(t.id)},t.id))}):null,(0,L.jsxs)(z,{accept:`.pdf,.docx,.doc,.xlsx,.csv,.tsv,.txt,.md,.json,.html,.eml,image/*`,onFiles:e=>n.upload(`document`,e),className:`h-16 w-full`,children:[n.busy?(0,L.jsx)(T,{className:`size-4`}):(0,L.jsx)(ve,{className:`size-4`}),P(`project.drop`),` `,(0,L.jsx)(`span`,{className:`underline`,children:P(`project.documentAdd`)})]}),n.error?(0,L.jsx)(`p`,{className:`mt-3 text-[14px] text-rose`,children:n.error}):null,s.length&&!t.embeddings?(0,L.jsx)(`p`,{className:`mt-3 text-[13px] text-ink-3`,children:P(`project.keywordsOnly`)}):null,c?(0,L.jsx)(nn,{projectId:e,file:c,onClose:()=>o(null)}):null]})}var on=e=>/^(ja|yes|true)$/i.test(e.trim()),sn={text:_e,longtext:tt,number:He,date:Ie,url:re,email:se,phone:Qe,boolean:rt};function cn({type:e,detected:t,onChange:n}){let[r,i]=(0,I.useState)(!1),[a,o]=(0,I.useState)(!1),s=(0,I.useRef)(null);(0,I.useEffect)(()=>{if(!r)return;let e=e=>{s.current?.contains(e.target)||i(!1)},t=e=>e.key===`Escape`&&i(!1);return document.addEventListener(`mousedown`,e),document.addEventListener(`keydown`,t),()=>{document.removeEventListener(`mousedown`,e),document.removeEventListener(`keydown`,t)}},[r]);let c=sn[e??t],l=`${P(`project.factType`)}: ${P(`project.type.${e??t}`)}`,u=`flex w-full items-center gap-3 rounded-lg px-3 py-2 text-left text-[14px] text-ink-2 hover:bg-accent hover:text-ink`,d=e=>{n(e),i(!1)};return(0,L.jsxs)(`div`,{className:`relative`,ref:s,children:[(0,L.jsx)(`button`,{type:`button`,"aria-label":l,title:l,"aria-haspopup":`menu`,"aria-expanded":r,onClick:e=>{o(window.innerHeight-e.currentTarget.getBoundingClientRect().bottom<400),i(e=>!e)},className:E(`inline-flex size-11 items-center justify-center rounded-lg transition hover:bg-accent hover:text-ink`,r?`bg-accent text-ink`:e?`text-ink-2`:`text-ink-4`),children:(0,L.jsx)(c,{className:`size-4`})}),r?(0,L.jsxs)(`div`,{role:`menu`,className:E(`absolute right-0 z-50 w-56 animate-rise rounded-xl bg-card p-1.5 shadow-overlay ring-1 ring-border-soft`,a?`bottom-12`:`top-12`),children:[(0,L.jsxs)(`button`,{type:`button`,role:`menuitemradio`,"aria-checked":!e,className:u,onClick:()=>d(void 0),children:[(0,L.jsx)(le,{className:`size-4 shrink-0`}),(0,L.jsx)(`span`,{className:`flex-1`,children:P(`project.factAuto`)}),(0,L.jsx)(`span`,{className:`text-[12px] text-ink-4`,children:P(`project.type.${t}`)}),(0,L.jsx)(b,{className:E(`size-4 shrink-0`,e&&`invisible`)})]}),(0,L.jsx)(`div`,{className:`mx-2 my-1 h-px bg-border-soft`}),At.map(t=>{let n=sn[t];return(0,L.jsxs)(`button`,{type:`button`,role:`menuitemradio`,"aria-checked":e===t,className:u,onClick:()=>d(t),children:[(0,L.jsx)(n,{className:`size-4 shrink-0`}),(0,L.jsx)(`span`,{className:`flex-1`,children:P(`project.type.${t}`)}),(0,L.jsx)(b,{className:E(`size-4 shrink-0`,e!==t&&`invisible`)})]},t)})]}):null]})}function ln({facts:e,save:t}){let n=(0,I.useRef)(0),r=(0,I.useRef)(null),[i,a]=(0,I.useState)(()=>e.map(e=>({...e,id:`f${n.current++}`}))),o=H(i.filter(e=>e.key&&e.label.trim()).map(({key:e,label:t,value:n,type:r})=>({key:e,label:t.trim(),value:n,...r?{type:r}:{}})),t),s=(e,t)=>a(n=>n.map(n=>n.id===e?{...n,...t}:n)),c=(e,t,i=!1)=>{let o=`f${n.current++}`;r.current=`${o}:${t}`;let s={id:o,key:``,label:``,value:``,...e};a(e=>i?[s,...e]:[...e,s])},l=e=>t=>{t&&r.current===e&&(r.current=null,t.focus())},u=zt.filter(e=>!i.some(t=>t.key===e.key));return(0,L.jsxs)(R,{title:P(`project.facts`),hint:P(`project.factsHint`),save:o,action:i.length<q.facts?(0,L.jsxs)(N,{variant:`secondary`,size:`sm`,onClick:()=>c({},`label`,!0),children:[(0,L.jsx)(S,{className:`size-4`}),` `,P(`project.factAdd`)]}):null,children:[(0,L.jsx)(`div`,{className:`flex flex-col gap-2`,children:i.map(e=>{let t=Lt(e.value),n=e.type??t;return(0,L.jsxs)(`div`,{className:`grid grid-cols-[minmax(0,1fr)_auto_auto] items-start gap-x-1 gap-y-2 sm:grid-cols-[minmax(0,2fr)_minmax(0,3fr)_auto_auto]`,children:[(0,L.jsx)(M,{ref:l(`${e.id}:label`),value:e.label,placeholder:P(`project.factLabel`),title:e.key?`{{facts.${e.key}}}`:void 0,onChange:t=>s(e.id,{label:t.target.value}),onBlur:()=>{!e.key&&e.label.trim()&&s(e.id,{key:Rt(e.label,i.map(e=>e.key))})},className:`max-sm:col-span-3 max-sm:font-medium sm:mr-1`}),e.type===`boolean`?(0,L.jsxs)(`div`,{className:`flex h-11 items-center gap-3`,children:[(0,L.jsx)(Se,{checked:on(e.value),label:e.label,onChange:t=>s(e.id,{value:P(t?`project.yes`:`project.no`)})}),(0,L.jsx)(`span`,{className:`text-[14px] text-ink-2`,children:on(e.value)?P(`project.yes`):P(`project.no`)})]}):(0,L.jsx)(O,{ref:l(`${e.id}:value`),rows:1,minRows:n===`longtext`?2:1,maxRows:10,value:e.value,placeholder:P(`project.factValue`),onChange:t=>s(e.id,{value:t.target.value}),className:`min-h-11`}),(0,L.jsx)(cn,{type:e.type,detected:t,onChange:t=>s(e.id,{type:t})}),(0,L.jsx)(A,{label:P(`project.remove`),onClick:()=>a(t=>t.filter(t=>t.id!==e.id)),className:`size-11 rounded-lg hover:text-rose`,children:(0,L.jsx)(y,{className:`size-4`})})]},e.id)})}),i.length<q.facts?(0,L.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2 ${i.length?`mt-4`:``}`,children:[(0,L.jsxs)(N,{variant:`secondary`,size:`sm`,onClick:()=>c({},`label`),children:[(0,L.jsx)(S,{className:`size-4`}),` `,P(`project.factAdd`)]}),u.map(e=>(0,L.jsxs)(`button`,{type:`button`,onClick:()=>c({key:e.key,label:ye===`en`?e.en:e.de},`value`),className:`inline-flex h-8 items-center gap-1 rounded-full bg-paper-2 px-3 text-[13px] text-ink-2 transition hover:bg-paper-3 hover:text-ink`,children:[(0,L.jsx)(S,{className:`size-3.5`}),` `,ye===`en`?e.en:e.de]},e.key))]}):null]})}function un({project:e,save:t}){let[n,r]=(0,I.useState)(e.brand.name??``),[i,a]=(0,I.useState)(e.brand.about??``),o=H({name:n.trim(),about:i.trim()},e=>t({brand:e}));return(0,L.jsx)(R,{title:P(`project.base`),hint:P(`project.baseHint`),save:o,children:(0,L.jsxs)(`div`,{className:`flex flex-col gap-5`,children:[(0,L.jsxs)(`div`,{children:[(0,L.jsx)(w,{children:P(`project.title`)}),(0,L.jsx)(M,{value:n,maxLength:120,onChange:e=>r(e.target.value)}),(0,L.jsx)(`p`,{className:`mt-1.5 text-[13px] text-ink-3`,children:P(`project.titleHint`)})]}),(0,L.jsxs)(`div`,{children:[(0,L.jsx)(w,{children:P(`project.about`)}),(0,L.jsx)(O,{minRows:4,value:i,onChange:e=>a(e.target.value)}),(0,L.jsx)(`p`,{className:`mt-1.5 text-[13px] text-ink-3`,children:P(`project.aboutHint`)})]})]})})}function dn({project:e,save:t}){let[n,r]=(0,I.useState)(!1),[i,a]=(0,I.useState)(e.name),o=m({mutationFn:()=>t({name:i.trim()}),onSuccess:()=>r(!1)});return(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(A,{label:P(`project.rename`),onClick:()=>{a(e.name),r(!0)},children:(0,L.jsx)(ne,{className:`size-4`})}),(0,L.jsx)(D,{open:n,onClose:()=>r(!1),title:P(`project.rename`),children:(0,L.jsxs)(`form`,{onSubmit:e=>{e.preventDefault(),i.trim()&&o.mutate()},children:[(0,L.jsx)(M,{autoFocus:!0,value:i,maxLength:80,onChange:e=>a(e.target.value)}),o.error?(0,L.jsx)(`p`,{className:`mt-3 text-[14px] text-rose`,children:o.error.message}):null,(0,L.jsxs)(`div`,{className:`mt-5 flex justify-end gap-2`,children:[(0,L.jsx)(N,{variant:`ghost`,onClick:()=>r(!1),children:P(`common.cancel`)}),(0,L.jsx)(N,{type:`submit`,busy:o.isPending,disabled:!i.trim(),children:P(`settings.save`)})]})]})})]})}function fn({project:e}){let t=d(),n=ct(e.id),[r,i]=(0,I.useState)(0),a=async n=>{await u.patch(`/api/studio/projects/${e.id}`,n),await t.invalidateQueries({queryKey:[`projects`]})},o=m({mutationFn:()=>u.del(`/api/studio/projects/${e.id}`),onSuccess:()=>t.invalidateQueries({queryKey:[`projects`]})}),s=h(),c=n.data??{files:[],embeddings:!0},l=`${e.id}:${r}`;return(0,L.jsxs)(`div`,{className:`flex flex-col gap-9 pb-20`,children:[s?(0,L.jsxs)(`div`,{className:`-mb-3 flex items-center gap-1`,children:[(0,L.jsx)(Pe,{}),(0,L.jsx)(dn,{project:e,save:a})]}):null,(0,L.jsx)(kt,{projectId:e.id,onChanged:()=>i(e=>e+1)},e.id),(0,L.jsx)(un,{project:e,save:a},`base:${l}`),(0,L.jsx)(Wt,{projectId:e.id,data:c}),(0,L.jsx)(Vt,{colors:e.brand.colors??[],save:e=>a({brand:{colors:e}})},`colors:${l}`),(0,L.jsx)(Jt,{projectId:e.id,data:c}),(0,L.jsx)(an,{projectId:e.id,data:c}),(0,L.jsx)(ln,{facts:e.facts,save:e=>a({facts:e})},`facts:${l}`),s?(0,L.jsxs)(`div`,{children:[(0,L.jsx)(N,{variant:`danger`,busy:o.isPending,onClick:()=>confirm(`${P(`settings.delete`)}?`)&&o.mutate(),children:P(`settings.delete`)}),o.error?(0,L.jsx)(`p`,{className:`mt-2 text-[14px] text-rose`,children:o.error.message}):null]}):null]})}function pn(e,t){let n=e.toLowerCase().replace(/[^a-z0-9]+/g,`_`).replace(/^_+|_+$/g,``).replace(/^[^a-z]+/,``).slice(0,24)||`system`,r=n,i=2;for(;t.includes(r);)r=`${n}_${i++}`;return r}function mn({project:e}){let t=d(),[n,r]=(0,I.useState)(e.mcpServers.map(e=>({...e,auth:e.headers?.Authorization??e.headers?.authorization??``}))),[i,a]=(0,I.useState)(!1),o=m({mutationFn:()=>u.patch(`/api/studio/projects/${e.id}`,{mcpServers:n.filter(e=>e.name&&e.url).map(({auth:e,headers:t,...n})=>({...n,headers:e?{...t,Authorization:e}:void 0}))}),onSuccess:async()=>{await t.invalidateQueries({queryKey:[`projects`]}),a(!0),setTimeout(()=>a(!1),1800)}});return(0,L.jsxs)(k,{className:`p-6`,children:[(0,L.jsx)(`h2`,{className:`font-display font-semibold text-lg`,children:P(`settings.mcp`)}),(0,L.jsx)(`p`,{className:`mt-1 mb-5 text-[14px] text-ink-3`,children:P(`settings.mcpHint`)}),(0,L.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[n.map((e,t)=>(0,L.jsxs)(`div`,{className:`grid gap-2 rounded-lg bg-paper p-3 ring-1 ring-border-soft sm:grid-cols-[1fr_2fr_auto]`,children:[(0,L.jsx)(M,{placeholder:P(`settings.serverName`),value:e.name,onChange:e=>r(n=>n.map((r,i)=>i===t?{...r,name:e.target.value,id:r.id||pn(e.target.value,n.map(e=>e.id))}:r))}),(0,L.jsx)(M,{placeholder:`${P(`settings.serverUrl`)} (https://…/mcp)`,value:e.url,onChange:e=>r(n=>n.map((n,r)=>r===t?{...n,url:e.target.value}:n))}),(0,L.jsx)(A,{label:`Entfernen`,onClick:()=>r(e=>e.filter((e,n)=>n!==t)),className:`hover:text-rose`,children:(0,L.jsx)(y,{className:`size-4`})}),(0,L.jsx)(M,{className:`sm:col-span-2`,placeholder:P(`settings.serverHeader`),value:e.auth??``,onChange:e=>r(n=>n.map((n,r)=>r===t?{...n,auth:e.target.value}:n))}),e.id?(0,L.jsx)(`span`,{className:`self-center font-mono text-[11px] text-ink-4`,children:e.id}):null]},t)),(0,L.jsxs)(N,{variant:`secondary`,className:`self-start`,onClick:()=>r(e=>[...e,{id:``,name:``,url:``,auth:``}]),children:[(0,L.jsx)(S,{className:`size-4`}),` `,P(`settings.addServer`)]})]}),(0,L.jsxs)(`div`,{className:`mt-5 flex items-center justify-end gap-3`,children:[o.error?(0,L.jsx)(`p`,{className:`text-[14px] text-rose`,children:o.error.message}):null,(0,L.jsx)(N,{busy:o.isPending,onClick:()=>o.mutate(),children:P(i?`settings.saved`:`settings.save`)})]})]})}function hn(){let{section:e}=l(),t=r(),n=g(),{project:a}=p(),o=h(),[s,c]=(0,I.useState)(a?.id);(0,I.useEffect)(()=>c(a?.id),[a?.id]);let u=Te(),d=Ee(n.data,u),m=d.find(t=>t.id===e);if(!m)return u.status===`ready`?(0,L.jsx)(f,{to:`/settings/project`,replace:!0}):null;let _=m.id===`connectors`&&o;return(0,L.jsxs)(`div`,{className:`animate-rise`,children:[(0,L.jsx)(`h1`,{className:`font-display font-semibold text-[28px] tracking-tight`,children:P(`settings.title`)}),(0,L.jsxs)(`div`,{className:`mt-6 grid gap-6 md:mt-8 md:grid-cols-[200px_minmax(0,1fr)] md:gap-10`,children:[(0,L.jsx)(`nav`,{className:`max-md:hidden`,children:(0,L.jsx)(`ul`,{className:`sticky top-24 flex flex-col gap-0.5`,children:d.map(e=>(0,L.jsx)(`li`,{children:(0,L.jsx)(i,{to:`/settings/${e.id}`,"aria-current":e.id===m.id?`page`:void 0,className:E(`block rounded-lg px-3 py-2 text-[14px] transition`,e.id===m.id?`bg-paper-2 font-medium text-ink`:`text-ink-3 hover:bg-accent hover:text-ink`),children:e.label})},e.id))})}),(0,L.jsx)(Ce,{className:`md:hidden`,value:m.id,onChange:e=>t(`/settings/${e}`),options:d.map(e=>({value:e.id,label:e.label}))}),(0,L.jsxs)(`div`,{className:E(`min-w-0`,m.id!==`project`&&`max-w-2xl`),children:[_?(0,L.jsx)(`div`,{className:`mb-6`,children:(0,L.jsx)(Pe,{})}):null,m.id===`project`&&a?(0,L.jsx)(fn,{project:a},s):null,m.id===`connectors`&&a?(0,L.jsxs)(`div`,{className:`flex flex-col gap-6`,children:[(0,L.jsx)(_t,{projectId:a.id},s),(0,L.jsx)(mn,{project:a},s)]}):null,m.id===`models`?(0,L.jsx)(Ne,{}):null,m.id===`build`?(0,L.jsx)(Ct,{}):null,m.id===`account`&&n.data?(0,L.jsx)(ft,{me:n.data}):null,m.id===`plugins`?(0,L.jsx)(ot,{}):null,m.plugin?(0,L.jsx)(De,{of:m.plugin,children:(0,L.jsx)(m.plugin.component,{})}):null]})]})]})}export{hn as SettingsPage};
@@ -1 +0,0 @@
1
- var e=JSON.parse(`[{"version":"v0.2.0","timestamp":1791223084,"commits":[{"id":"4404371","message":"a runtime takes plugins: tools for agent steps, routes with tables of their own, listeners on runs that end, and pages, top bar icons and settings sections in the studio; they load from modules/ and PLUGINS_DIR at start and again while it runs","group":"Added","scope":null,"breaking":false}]},{"version":"v0.1.11","timestamp":1791208594,"commits":[{"id":"85facbd","message":"the package is on npm as wizards, and the README's studio picture shows the branches with their conditions","group":"Docs","scope":null,"breaking":false},{"id":"6ca5cfc","message":"a branch that skips steps runs beside them in the editor, with its condition readable on the line; it ran behind the step with the condition hidden","group":"Fixed","scope":null,"breaking":false}]},{"version":"v0.1.10","timestamp":1791206923,"commits":[{"id":"8f35bf0","message":"the README shows the studio with a branched flow and a wizard in use, from its first page to the result","group":"Docs","scope":null,"breaking":false},{"id":"7abf9df","message":"the editor's review notes, tool names and branch labels follow the language; they were German in the English studio","group":"Fixed","scope":null,"breaking":false}]},{"version":"v0.1.9","timestamp":1791203125,"commits":[{"id":"5182fec","message":"the installer is engenty.ai/install.sh (was wizards.sh), and the command and the npm package are wizards (were engenty-wizards); the installer renames an install made under the old names","group":"Changed","scope":null,"breaking":false},{"id":"c6500f9","message":"the proxy sends the runtime /w/ and /s/ with the slash","group":"Docs","scope":null,"breaking":false}]},{"version":"v0.1.8","timestamp":1791196160,"commits":[{"id":"a965d36","message":"the marketplace's pages are written by the site at engenty.ai, at /wizards/<slug> and /de/wizards/<slug>","group":"Docs","scope":null,"breaking":false}]},{"version":"v0.1.7","timestamp":1791194770,"commits":[{"id":"66e9109","message":"a banner in the studio says when a newer release is out; the update installs from there, the runtime restarts into the new version and the page reloads","group":"Added","scope":null,"breaking":false},{"id":"5e27bf6","message":"the studio chat counts the seconds of a turn and says what the architect is doing and thinking; pasted pictures show in the thread and the architect sees them","group":"Added","scope":null,"breaking":false}]},{"version":"v0.1.6","timestamp":1791167380,"commits":[{"id":"481807b","message":"video models render at 720p, or 480p when a step asks; a larger clip is scaled down, and the price follows the resolution","group":"Added","scope":null,"breaking":false},{"id":"bb20f2b","message":"the settings say Codex makes images on the sign-in too; only video and audio still need a key","group":"Fixed","scope":null,"breaking":false}]},{"version":"v0.1.5","timestamp":1791151312,"commits":[{"id":"f4b7e43","message":"plan for a setup by capability","group":"Docs","scope":null,"breaking":false},{"id":"8ddaab7","message":"a wizard says which models it lacks before it runs, and only refuses to start when every path needs one; templates can be filtered by capability, and those this install cannot run are greyed out","group":"Added","scope":null,"breaking":false},{"id":"2689c74","message":"Codex makes images on the ChatGPT plan, and runs each model class on its own model (Luna, Sol, Astra); image, video and voice stay empty without a gateway key instead of naming models nothing can reach","group":"Added","scope":null,"breaking":false}]},{"version":"v0.1.4","timestamp":1791144283,"commits":[{"id":"071e6ca","message":"the changelog's groups read NEW, FIXED, DOCS in every language, like the entries they stand before","group":"Fixed","scope":null,"breaking":false}]},{"version":"v0.1.3","timestamp":1791142528,"commits":[{"id":"32d1698","message":"the publish job fetches the package artifact by name; with one artifact left it no longer lands in its own folder","group":"Fixed","scope":"release","breaking":false}]},{"version":"v0.1.2","timestamp":1791140122,"commits":[{"id":"4bc37b9","message":"a marketplace entry opens in the local studio at localhost:24368 instead of the Mac app's engenty-wizards:// link","group":"Added","scope":null,"breaking":false},{"id":"e09e748","message":"the Mac app is no longer built or offered; the studio offers to install itself as a Chrome app in a banner, starting at login on a Mac is a LaunchAgent that runs the command, and the setup, README and docs point there","group":"Added","scope":null,"breaking":false},{"id":"ab10b49","message":"engenty wizards starts at login — the Mac app opens in the menu bar without its window (\\"Open at Login\\" in its menus), on Linux a systemd user service; the setup asks, \`engenty-wizards autostart on|off\` switches it, and the Mac app's server takes port 24368 too","group":"Added","scope":null,"breaking":false},{"id":"239e338","message":"the setup page installs a missing AI client in its own terminal, and both setups suggest the client whose app is on the Mac — its subscription is most likely already paid for","group":"Added","scope":null,"breaking":false},{"id":"b479df7","message":"an inline terminal's stream sends its last lines and its end before it closes; a page that opens it afterwards gets them all","group":"Fixed","scope":null,"breaking":false}]},{"version":"v0.1.1","timestamp":1791138130,"commits":[{"id":"21f70df","message":"the German tagline on the sign-in page follows the new one","group":"Docs","scope":null,"breaking":false},{"id":"765ae7c","message":"the studio says when a newer release is out and, on an install made by wizards.sh, updates it from the footer","group":"Added","scope":null,"breaking":false},{"id":"825da6c","message":"the tagline is \\"Make a wish. Get your wizard.\\" In the README, the npm package description and the banner of wizards.sh.","group":"Docs","scope":null,"breaking":false},{"id":"05e2e5c","message":"the local runtime listens on 24368, AGENT on a phone keypad; the Docker image stays on 8891","group":"Added","scope":null,"breaking":false},{"id":"71bb778","message":"Ctrl-C stops engenty-wizards again — the login shell that reads the person's variables runs in a session of its own and no longer keeps the terminal","group":"Fixed","scope":null,"breaking":false},{"id":"ee20646","message":"wizards.sh opens with the tall engenty — one eye; it wakes up, looks around, hops and blinks","group":"Added","scope":null,"breaking":false},{"id":"81d4f21","message":"the studio moves to /studio; the root of a host is free for a landing page","group":"Added","scope":null,"breaking":false},{"id":"f6058fd","message":"the marketplace is an app of its own; the runtime searches it live and keeps its starters and the starred entries for offline use","group":"Added","scope":null,"breaking":false},{"id":"e6fdeab","message":"engenty-wizards://new?starter=<id> opens a marketplace template in the desktop app","group":"Added","scope":null,"breaking":false}]},{"version":"v0.1.0","timestamp":1791100948,"commits":[{"id":"71cc075","message":"install with wizards.sh; the local install and how its pieces share it","group":"Docs","scope":null,"breaking":false},{"id":"6ae641d","message":"the desktop app is a window on the local install and brings no runtime along","group":"Added","scope":null,"breaking":false},{"id":"9c9dbb8","message":"an installer, wizards.sh, that every runtime serves","group":"Added","scope":null,"breaking":false},{"id":"34d0a1a","message":"an engenty-wizards command for a local install in ~/.engenty/wizards","group":"Added","scope":null,"breaking":false},{"id":"4ac6329","message":"the search skips filler words with umlauts too","group":"Fixed","scope":null,"breaking":false},{"id":"3bda9a6","message":"the gallery's footer stays without version, changelog and open-source links","group":"Fixed","scope":null,"breaking":false},{"id":"9e65725","message":"a changelog and open-source credits in the studio's footer; pnpm release cuts a release from the commits","group":"Added","scope":null,"breaking":false},{"id":"45d2906","message":"an entry's search terms are scored one by one, not as one long text","group":"Fixed","scope":null,"breaking":false},{"id":"648819c","message":"marketplace entries carry the words people ask for, so a search by words finds them","group":"Added","scope":null,"breaking":false},{"id":"0838373","message":"one project unless the limit says more; an account page; previews and layouts in the project settings","group":"Added","scope":null,"breaking":false},{"id":"8da2aaf","message":"a project holds base infos, logos, colours, assets, documents and facts for all its wizards","group":"Added","scope":null,"breaking":false},{"id":"8679ae2","message":"the gallery has the studio's footer line","group":"Fixed","scope":null,"breaking":false},{"id":"d5086f3","message":"the gallery's field is narrower","group":"Fixed","scope":null,"breaking":false},{"id":"4a82b26","message":"the gallery invites to start a wizard from a template","group":"Other","scope":null,"breaking":false},{"id":"07d2def","message":"a template's header is the dialog's own colour under a spotlight; in the light a tinted grey","group":"Fixed","scope":null,"breaking":false},{"id":"d10be9f","message":"a template opens with its flow as a diagram; the gallery's field is narrower, its chips centred","group":"Added","scope":null,"breaking":false},{"id":"fbee998","message":"the gallery says what it is, compact and from the left; its search is a two-line field to write into","group":"Added","scope":null,"breaking":false},{"id":"478f271","message":"the gallery opens with one question and the search field; quieter filter chips","group":"Added","scope":null,"breaking":false},{"id":"15d7f94","message":"the marketplace search asks the model for the signed-in tenant; a sentence without a model keeps only close finds","group":"Fixed","scope":null,"breaking":false},{"id":"c254357","message":"a marketplace of wizards to start from, with a gallery, admin, translation and search","group":"Added","scope":null,"breaking":false},{"id":"4d6e270","message":"AI media is marked in its file and labelled with the EU icons (AI Act, Art. 50)","group":"Added","scope":null,"breaking":false},{"id":"f86f070","message":"two writers of the same blob no longer share a temporary file","group":"Fixed","scope":null,"breaking":false},{"id":"c6a06cc","message":"plan for definition versions and importing older packages","group":"Docs","scope":null,"breaking":false},{"id":"a37e826","message":"wizard packages carry their own extension, .wizard","group":"Added","scope":null,"breaking":false},{"id":"e104574","message":"wizards export as a package (.wizard.zip) and import into a project","group":"Added","scope":null,"breaking":false},{"id":"b389539","message":"the editor pane's resize handle is a short, thick pill","group":"Added","scope":null,"breaking":false},{"id":"670c3ce","message":"chat composer takes files (+) and dictation","group":"Added","scope":null,"breaking":false},{"id":"766f6fd","message":"editor side pane resizable; Steps tab steps with ← / →, header and strip spacing fixed","group":"Added","scope":null,"breaking":false},{"id":"8205c88","message":"the arrow on a live wizard's card opens it in a new tab","group":"Added","scope":null,"breaking":false},{"id":"2696a50","message":"the AI clients page says it is an MCP server and sets a client up step by step","group":"Added","scope":null,"breaking":false},{"id":"6004a7d","message":"settings in sub-pages with a nav on the left (a dropdown on phones); MCP servers under Connectors","group":"Added","scope":null,"breaking":false},{"id":"49054fa","message":"settings button in the top bar; the user menu closes on Einstellungen","group":"Added","scope":null,"breaking":false},{"id":"65c9867","message":"at most 5 projects per tenant","group":"Added","scope":null,"breaking":false},{"id":"7ecca24","message":"the project switcher switches the wizard list","group":"Fixed","scope":null,"breaking":false},{"id":"c037604","message":"light / dark in the user menu, in place of the top bar's toggle","group":"Added","scope":null,"breaking":false},{"id":"ef464ab","message":"upload limits and sorting, pictures while a step works, faster photo steps, a feedback box on reviews","group":"Added","scope":null,"breaking":false},{"id":"1cbc02f","message":"starters for receipts, video ad, property film, window offer, menu plan and ten website helpers","group":"Added","scope":null,"breaking":false},{"id":"8069115","message":"photos reach an installed AI client, and a photo without text is described","group":"Fixed","scope":null,"breaking":false},{"id":"013f7df","message":"embed a wizard in a website, inline or behind a button that opens it in a window","group":"Added","scope":null,"breaking":false},{"id":"78c2a2a","message":"the editor at /edit/<id>, signed-out visitors of the start page go to SIGNED_OUT_URL","group":"Fixed","scope":null,"breaking":false},{"id":"deb4942","message":"wizards at /w/<token>, the app at the root of https://engenty.ai","group":"Added","scope":null,"breaking":false},{"id":"b811b4c","message":"serve the app under a path (https://engenty.ai/w)","group":"Added","scope":null,"breaking":false},{"id":"4821fb1","message":"the hosted addresses (engenty.ai) as defaults, no private repo names in the public sources","group":"Fixed","scope":null,"breaking":false},{"id":"ca2207e","message":"the drop engenty as app icon, tray icon and favicon","group":"Added","scope":null,"breaking":false},{"id":"90fcbce","message":"a README for people who install it, developer notes in docs/development.md","group":"Docs","scope":null,"breaking":false},{"id":"4b0c54a","message":"a built runtime links to its own port, the sandbox falls back to agentOS","group":"Fixed","scope":null,"breaking":false},{"id":"7071edf","message":"no links to the clients' pages, a placeholder dot in the footer","group":"Fixed","scope":"setup","breaking":false},{"id":"14171bf","message":"installed AI clients as the model of a local runtime, first-start setup as a wizard","group":"Added","scope":null,"breaking":false},{"id":"ca3f3a7","message":"align vertical head turn with pointer gaze","group":"Fixed","scope":"engenty","breaking":false},{"id":"e1f04ff","message":"add furry and jelly renderers with an interactive builder","group":"Added","scope":"engenty","breaking":false},{"id":"99207af","message":"whole credits in the top bar, a footer line with the account's places","group":"Added","scope":null,"breaking":false},{"id":"e498ab1","message":"decision steps — yes/no and choice output fields, branches on step outputs","group":"Added","scope":null,"breaking":false},{"id":"e83a433","message":"pnpm workspace with apps/ and packages/","group":"Changed","scope":null,"breaking":false},{"id":"281e3a3","message":"desktop app — Tauri shell with the runtime as a Node sidecar","group":"Added","scope":null,"breaking":false},{"id":"9296521","message":"a database per tenant, model classes, sign-in at the Manage-App, phone inputs","group":"Added","scope":null,"breaking":false},{"id":"63b1693","message":"engenty's built-in connectors — Gmail, Drive, Calendar, Contacts, Outlook, OneDrive, Slack, GitHub, HubSpot, S3","group":"Added","scope":null,"breaking":false},{"id":"cd431c9","message":"connectors from the integrations registry, asked-first changes in connected accounts","group":"Added","scope":null,"breaking":false},{"id":"8dbe30d","message":"harden browser and file downloads, step navigation in the inspector, store and mailbox docs","group":"Added","scope":null,"breaking":false},{"id":"54370e8","message":"light/dark mode with engenty-coloured dark pages, jelly and fur coats, quiet focus rings","group":"Added","scope":null,"breaking":false},{"id":"371b033","message":"lists and connections kept between runs, mail and browser tools, camera and ask panel","group":"Added","scope":null,"breaking":false},{"id":"07df228","message":"setup per AI client and a self-served plugin with /wizard","group":"Added","scope":null,"breaking":false},{"id":"de27ae8","message":"interactive widgets with a workspace per wizard, shareable results","group":"Added","scope":null,"breaking":false},{"id":"12854e1","message":"live studio — MCP and other edits show up without a reload","group":"Added","scope":null,"breaking":false},{"id":"7f72420","message":"OAuth sign-in for MCP clients, connected apps in settings","group":"Added","scope":null,"breaking":false},{"id":"3014699","message":"MCP endpoint for authoring wizards with personal API keys","group":"Added","scope":null,"breaking":false},{"id":"985e612","message":"engenty wizards — prompt-built AI wizards with shareable links","group":"Added","scope":null,"breaking":false}]}]`);export{e as default};