wizards 0.2.12 → 0.2.13

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 (86) hide show
  1. package/apps/runtime/dist/authoring/guide.js +8 -2
  2. package/apps/runtime/dist/db/migrations/tenant/0007_space_data.sql +43 -0
  3. package/apps/runtime/dist/db/migrations/tenant/meta/0007_snapshot.json +2012 -0
  4. package/apps/runtime/dist/db/migrations/tenant/meta/_journal.json +7 -0
  5. package/apps/runtime/dist/db/schema.js +55 -0
  6. package/apps/runtime/dist/engine/runner.js +1 -1
  7. package/apps/runtime/dist/routes/api.js +14 -1
  8. package/apps/runtime/dist/routes/runs.js +13 -7
  9. package/apps/runtime/dist/routes/studio.js +89 -1
  10. package/apps/runtime/dist/services/cloud.js +62 -2
  11. package/apps/runtime/dist/services/runs.js +69 -1
  12. package/apps/runtime/dist/services/space-data.js +361 -0
  13. package/apps/runtime/dist/services/spaces.js +95 -1
  14. package/apps/runtime/dist/store/errors.js +3 -0
  15. package/apps/runtime/dist/store/index.js +19 -5
  16. package/apps/runtime/dist/store/shared-lists.js +124 -0
  17. package/apps/runtime/dist/tools/index.js +4 -0
  18. package/apps/runtime/dist/tools/pages.js +51 -0
  19. package/apps/runtime/dist/tools/store.js +3 -3
  20. package/apps/web/dist/assets/Account-ulB5WeOT.js +1 -0
  21. package/apps/web/dist/assets/ChangelogDialog-BVR5814e.js +1 -0
  22. package/apps/web/dist/assets/ChatPanel-C7uql4_d.js +1 -0
  23. package/apps/web/dist/assets/{CreditsDialog-DSjsgLoo.js → CreditsDialog-o9h0Nrui.js} +1 -1
  24. package/apps/web/dist/assets/EditorPage-CskikVRK.js +2 -0
  25. package/apps/web/dist/assets/FlowPreview-YaqUirty.js +1 -0
  26. package/apps/web/dist/assets/{Harness-DEGZ-_YL.js → Harness-ut5xGR_o.js} +2 -2
  27. package/apps/web/dist/assets/HomePage-Drys3BPU.js +1 -0
  28. package/apps/web/dist/assets/{ImportWizard-pZCs65kL.js → ImportWizard-BGqkJFeZ.js} +1 -1
  29. package/apps/web/dist/assets/LocalRuntime-DwPJjv3H.js +1 -0
  30. package/apps/web/dist/assets/NewWizardPage-CrBSpeIw.js +2 -0
  31. package/apps/web/dist/assets/ProjectPage-CAdSHd0Y.js +4 -0
  32. package/apps/web/dist/assets/PublicRunner-JleX2stQ.js +1 -0
  33. package/apps/web/dist/assets/RunnerView-BWG4Odbt.js +70 -0
  34. package/apps/web/dist/assets/SettingsPage-CYOdJ5FL.js +1 -0
  35. package/apps/web/dist/assets/SetupPage-CMVwnLQm.js +1 -0
  36. package/apps/web/dist/assets/SharePage-CKppWAtr.js +1 -0
  37. package/apps/web/dist/assets/{api-u3nydnnp.js → api-DTLkC0ge.js} +2 -2
  38. package/apps/web/dist/assets/changelog-dI1t4l0T.js +1 -0
  39. package/apps/web/dist/assets/circle-alert-D2SCwFT-.js +1 -0
  40. package/apps/web/dist/assets/{definition-Co2Mg1qo.js → definition-Dp0DR2D6.js} +1 -1
  41. package/apps/web/dist/assets/{esm-CvV3man4.js → esm-B6hLaDRL.js} +1 -1
  42. package/apps/web/dist/assets/index-BWxUOTc4.js +10 -0
  43. package/apps/web/dist/assets/index-DMwk_afK.css +1 -0
  44. package/apps/web/dist/assets/lock-DZL2N67v.js +1 -0
  45. package/apps/web/dist/assets/meta-CZWUthoQ.js +1 -0
  46. package/apps/web/dist/assets/refresh-cw-BNtHis1x.js +1 -0
  47. package/apps/web/dist/assets/settings-menu-Iz6kyoDe.js +1 -0
  48. package/apps/web/dist/assets/{type-BqbppSsp.js → table-2-BdDuBcF2.js} +1 -1
  49. package/apps/web/dist/assets/ui-CHX2gEQl.js +1 -0
  50. package/apps/web/dist/assets/video-9fDPRPCv.js +1 -0
  51. package/apps/web/dist/index.html +4 -4
  52. package/apps/web/dist/mcp/flow.html +5 -5
  53. package/node_modules/@engenty-wizards/plugin-sdk/dist/studio.d.ts +12 -4
  54. package/node_modules/@engenty-wizards/shared/dist/definition.d.ts +6 -1
  55. package/node_modules/@engenty-wizards/shared/dist/definition.js +36 -2
  56. package/node_modules/@engenty-wizards/shared/dist/space-data.d.ts +69 -0
  57. package/node_modules/@engenty-wizards/shared/dist/space-data.js +46 -0
  58. package/node_modules/@engenty-wizards/shared/dist/store.d.ts +2 -0
  59. package/package.json +1 -1
  60. package/apps/web/dist/assets/Account-BK8Q-U-8.js +0 -1
  61. package/apps/web/dist/assets/ChangelogDialog-BZ8s1isE.js +0 -1
  62. package/apps/web/dist/assets/ChatPanel-CMf1PS2N.js +0 -1
  63. package/apps/web/dist/assets/EditorPage-Bpgiq7aR.js +0 -2
  64. package/apps/web/dist/assets/FlowPreview-B5HrjouC.js +0 -1
  65. package/apps/web/dist/assets/HomePage-DIDJ8Jw1.js +0 -1
  66. package/apps/web/dist/assets/LocalRuntime-DQW6CLg-.js +0 -1
  67. package/apps/web/dist/assets/NewWizardPage-uhIbKcwn.js +0 -2
  68. package/apps/web/dist/assets/ProjectPage-CAMddxGu.js +0 -2
  69. package/apps/web/dist/assets/PublicRunner-jOAbZd2P.js +0 -1
  70. package/apps/web/dist/assets/ReadOnly-B0-ReU_0.js +0 -1
  71. package/apps/web/dist/assets/RunnerView-BThdhY7S.js +0 -2
  72. package/apps/web/dist/assets/SettingsPage-D_6hzTLJ.js +0 -1
  73. package/apps/web/dist/assets/SetupPage-Cvpg9Jyh.js +0 -1
  74. package/apps/web/dist/assets/SharePage-CRSnOm0Z.js +0 -1
  75. package/apps/web/dist/assets/arrow-left-hTN1VoH1.js +0 -1
  76. package/apps/web/dist/assets/changelog-BJqo0vwQ.js +0 -1
  77. package/apps/web/dist/assets/circle-alert-B76z9TWZ.js +0 -1
  78. package/apps/web/dist/assets/index-CQQD8QNR.css +0 -1
  79. package/apps/web/dist/assets/index-CTM5iDwf.js +0 -10
  80. package/apps/web/dist/assets/lock-CzNXAYdi.js +0 -1
  81. package/apps/web/dist/assets/meta-CzzuBWbK.js +0 -1
  82. package/apps/web/dist/assets/mic-Bvz4mA2j.js +0 -1
  83. package/apps/web/dist/assets/outputs-CYynzGBS.js +0 -69
  84. package/apps/web/dist/assets/refresh-cw-Cmk7VCe0.js +0 -1
  85. package/apps/web/dist/assets/ui-gGAdXx-P.js +0 -1
  86. package/apps/web/dist/assets/video-DBmwF1Jm.js +0 -1
@@ -1,2 +0,0 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/qr-scanner.min-C_UI0gH-.js","assets/preload-helper-CNEI7N0N.js"])))=>i.map(i=>d[i]);
2
- import{a as e,n as t,t as n}from"./jsx-runtime-D3jfb0Ew.js";import{c as r,d as i,n as a,t as o}from"./api-u3nydnnp.js";import{t as s}from"./preload-helper-CNEI7N0N.js";import{t as c}from"./createLucideIcon-q3MZMmnf.js";import{t as l}from"./arrow-left-hTN1VoH1.js";import{t as u}from"./arrow-right-6FyN3e7D.js";import{C as d,S as f,T as p,a as m,b as h,c as g,d as _,f as v,g as y,h as b,i as x,l as S,o as C,p as w,s as T,t as E,u as D,w as O,x as k,y as A}from"./outputs-CYynzGBS.js";import{t as j}from"./check-CUpby_J9.js";import{n as M,t as N}from"./plus-Du-Jx8aI.js";import{t as P}from"./external-link-MAL7vJYj.js";import{n as F,t as I}from"./mic-Bvz4mA2j.js";import{n as L,t as R}from"./trash-0IafyhZB.js";import{t as ee}from"./pen-line-NK46C_nG.js";import{t as te}from"./refresh-cw-Cmk7VCe0.js";import{t as ne}from"./video-DBmwF1Jm.js";import{_ as z,c as B,d as V,f as re,h as H,i as ie,l as ae,m as oe,n as se,o as U,p as ce,s as W,t as G,u as le,y as K}from"./ui-gGAdXx-P.js";import{E as q}from"./index-CTM5iDwf.js";import{d as ue,f as de,u as fe}from"./definition-Co2Mg1qo.js";var pe={name:`arrow-down`,size:24,node:[[`path`,{d:`M12 5v14`,key:`s699le`}],[`path`,{d:`m19 12-7 7-7-7`,key:`1idqje`}]]};pe.node;var me=c(pe),he={name:`bell-ring`,size:24,node:[[`path`,{d:`M10.268 21a2 2 0 0 0 3.464 0`,key:`vwvbt9`}],[`path`,{d:`M22 8c0-2.3-.8-4.3-2-6`,key:`5bb3ad`}],[`path`,{d:`M3.262 15.326A1 1 0 0 0 4 17h16a1 1 0 0 0 .74-1.673C19.41 13.956 18 12.499 18 8A6 6 0 0 0 6 8c0 4.499-1.411 5.956-2.738 7.326`,key:`11g9vi`}],[`path`,{d:`M4 2C2.8 3.7 2 5.7 2 8`,key:`tap9e0`}]]};he.node;var ge=c(he),_e={name:`bell`,size:24,node:[[`path`,{d:`M10.268 21a2 2 0 0 0 3.464 0`,key:`vwvbt9`}],[`path`,{d:`M3.262 15.326A1 1 0 0 0 4 17h16a1 1 0 0 0 .74-1.673C19.41 13.956 18 12.499 18 8A6 6 0 0 0 6 8c0 4.499-1.411 5.956-2.738 7.326`,key:`11g9vi`}]]};_e.node;var ve=c(_e),ye={name:`camera`,size:24,node:[[`path`,{d:`M13.997 4a2 2 0 0 1 1.76 1.05l.486.9A2 2 0 0 0 18.003 7H20a2 2 0 0 1 2 2v9a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V9a2 2 0 0 1 2-2h1.997a2 2 0 0 0 1.759-1.048l.489-.904A2 2 0 0 1 10.004 4z`,key:`18u6gg`}],[`circle`,{cx:`12`,cy:`13`,r:`3`,key:`1vg3eu`}]]};ye.node;var be=c(ye),xe={name:`corner-down-left`,size:24,node:[[`path`,{d:`M20 4v7a4 4 0 0 1-4 4H4`,key:`6o5b7l`}],[`path`,{d:`m9 10-5 5 5 5`,key:`1kshq7`}]]};xe.node;var Se=c(xe),Ce={name:`database`,size:24,node:[[`ellipse`,{cx:`12`,cy:`5`,rx:`9`,ry:`3`,key:`msslwz`}],[`path`,{d:`M3 5V19A9 3 0 0 0 21 19V5`,key:`1wlel7`}],[`path`,{d:`M3 12A9 3 0 0 0 21 12`,key:`mv7ke4`}]]};Ce.node;var we=c(Ce),Te={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`}]]};Te.node;var Ee=c(Te),De={name:`file-headphone`,size:24,node:[[`path`,{d:`M4 6.835V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.706.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2h-.343`,key:`1vfytu`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M2 19a2 2 0 0 1 4 0v1a2 2 0 0 1-4 0v-4a6 6 0 0 1 12 0v4a2 2 0 0 1-4 0v-1a2 2 0 0 1 4 0`,key:`1etmh7`}]],aliases:[`file-audio`,`file-audio-2`]};De.node;var Oe=c(De),ke={name:`flashlight-off`,size:24,node:[[`path`,{d:`M11.652 6H18`,key:`voqkpr`}],[`path`,{d:`M12 13v1`,key:`176q98`}],[`path`,{d:`M16 16v4a2 2 0 0 1-2 2h-4a2 2 0 0 1-2-2v-8a4 4 0 0 0-.8-2.4l-.6-.8A3 3 0 0 1 6 7V6`,key:`dzyf92`}],[`path`,{d:`m2 2 20 20`,key:`1ooewy`}],[`path`,{d:`M7.649 2H17a1 1 0 0 1 1 1v4a3 3 0 0 1-.6 1.8l-.6.8a4 4 0 0 0-.55 1.007`,key:`1hvcfn`}]]};ke.node;var Ae=c(ke),je={name:`flashlight`,size:24,node:[[`path`,{d:`M12 13v1`,key:`176q98`}],[`path`,{d:`M17 2a1 1 0 0 1 1 1v4a3 3 0 0 1-.6 1.8l-.6.8A4 4 0 0 0 16 12v8a2 2 0 0 1-2 2H10a2 2 0 0 1-2-2v-8a4 4 0 0 0-.8-2.4l-.6-.8A3 3 0 0 1 6 7V3a1 1 0 0 1 1-1z`,key:`17vh7j`}],[`path`,{d:`M6 6h12`,key:`n6hhss`}]]};je.node;var Me=c(je),Ne={name:`grip-vertical`,size:24,node:[[`circle`,{cx:`9`,cy:`12`,r:`1`,key:`1vctgf`}],[`circle`,{cx:`9`,cy:`5`,r:`1`,key:`hp0tcf`}],[`circle`,{cx:`9`,cy:`19`,r:`1`,key:`fkjjf6`}],[`circle`,{cx:`15`,cy:`12`,r:`1`,key:`1tmaij`}],[`circle`,{cx:`15`,cy:`5`,r:`1`,key:`19l28e`}],[`circle`,{cx:`15`,cy:`19`,r:`1`,key:`f4zoj3`}]]};Ne.node;var Pe=c(Ne),Fe={name:`image-plus`,size:24,node:[[`path`,{d:`M16 5h6`,key:`1vod17`}],[`path`,{d:`M19 2v6`,key:`4bpg5p`}],[`path`,{d:`M21 11.5V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h7.5`,key:`1ue2ih`}],[`path`,{d:`m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21`,key:`1xmnt7`}],[`circle`,{cx:`9`,cy:`9`,r:`2`,key:`af1f0g`}]]};Fe.node;var Ie=c(Fe),Le={name:`image-up`,size:24,node:[[`path`,{d:`M10.3 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2v10l-3.1-3.1a2 2 0 0 0-2.814.014L6 21`,key:`9csbqa`}],[`path`,{d:`m14 19.5 3-3 3 3`,key:`9vmjn0`}],[`path`,{d:`M17 22v-5.5`,key:`1aa6fl`}],[`circle`,{cx:`9`,cy:`9`,r:`2`,key:`af1f0g`}]]};Le.node;var Re=c(Le),ze={name:`locate-fixed`,size:24,node:[[`line`,{x1:`2`,x2:`5`,y1:`12`,y2:`12`,key:`bvdh0s`}],[`line`,{x1:`19`,x2:`22`,y1:`12`,y2:`12`,key:`1tbv5k`}],[`line`,{x1:`12`,x2:`12`,y1:`2`,y2:`5`,key:`11lu5j`}],[`line`,{x1:`12`,x2:`12`,y1:`19`,y2:`22`,key:`x3vr5v`}],[`circle`,{cx:`12`,cy:`12`,r:`7`,key:`fim9np`}],[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}]]};ze.node;var Be=c(ze),Ve={name:`lock-keyhole`,size:24,node:[[`circle`,{cx:`12`,cy:`16`,r:`1`,key:`1au0dj`}],[`rect`,{x:`3`,y:`10`,width:`18`,height:`12`,rx:`2`,key:`6s8ecr`}],[`path`,{d:`M7 10V7a5 5 0 0 1 10 0v3`,key:`1pqi11`}]]};Ve.node;var He=c(Ve),Ue={name:`map-pin`,size:24,node:[[`path`,{d:`M20 10c0 4.993-5.539 10.193-7.399 11.799a1 1 0 0 1-1.202 0C9.539 20.193 4 14.993 4 10a8 8 0 0 1 16 0`,key:`1r0f0z`}],[`circle`,{cx:`12`,cy:`10`,r:`3`,key:`ilqhr7`}]]};Ue.node;var We=c(Ue),Ge={name:`pencil-line`,size:24,node:[[`path`,{d:`M13 21h8`,key:`1jsn5i`}],[`path`,{d:`m15 5 4 4`,key:`1mk7zo`}],[`path`,{d:`M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z`,key:`1a8usu`}]]};Ge.node;var Ke=c(Ge),qe={name:`rotate-ccw`,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`}]]};qe.node;var Je=c(qe),Ye={name:`scan-line`,size:24,node:[[`path`,{d:`M3 7V5a2 2 0 0 1 2-2h2`,key:`aa7l1z`}],[`path`,{d:`M17 3h2a2 2 0 0 1 2 2v2`,key:`4qcy5o`}],[`path`,{d:`M21 17v2a2 2 0 0 1-2 2h-2`,key:`6vwrx8`}],[`path`,{d:`M7 21H5a2 2 0 0 1-2-2v-2`,key:`ioqczr`}],[`path`,{d:`M7 12h10`,key:`b7w52i`}]]};Ye.node;var Xe=c(Ye),Ze={name:`share-2`,size:24,node:[[`circle`,{cx:`18`,cy:`5`,r:`3`,key:`gq8acd`}],[`circle`,{cx:`6`,cy:`12`,r:`3`,key:`w7nqdw`}],[`circle`,{cx:`18`,cy:`19`,r:`3`,key:`1xt0gg`}],[`line`,{x1:`8.59`,x2:`15.42`,y1:`13.51`,y2:`17.49`,key:`47mynk`}],[`line`,{x1:`15.41`,x2:`8.59`,y1:`6.51`,y2:`10.49`,key:`1n3mei`}]]};Ze.node;var Qe=c(Ze),$e={name:`shield-check`,size:24,node:[[`path`,{d:`M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z`,key:`oel41y`}],[`path`,{d:`m9 12 2 2 4-4`,key:`dzmm74`}]]};$e.node;var et=c($e),tt={name:`switch-camera`,size:24,node:[[`path`,{d:`M11 19H4a2 2 0 0 1-2-2V7a2 2 0 0 1 2-2h5`,key:`mtk2lu`}],[`path`,{d:`M13 5h7a2 2 0 0 1 2 2v10a2 2 0 0 1-2 2h-5`,key:`120jsl`}],[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}],[`path`,{d:`m18 22-3-3 3-3`,key:`kgdoj7`}],[`path`,{d:`m6 2 3 3-3 3`,key:`1fnbkv`}]]};tt.node;var nt=c(tt),rt={name:`triangle-alert`,size:24,node:[[`path`,{d:`m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3`,key:`wmoenq`}],[`path`,{d:`M12 9v4`,key:`juzpu7`}],[`path`,{d:`M12 17h.01`,key:`p32p05`}]],aliases:[`alert-triangle`]};rt.node;var it=c(rt),at={name:`unplug`,size:24,node:[[`path`,{d:`m19 5 3-3`,key:`yk6iyv`}],[`path`,{d:`m2 22 3-3`,key:`19mgm9`}],[`path`,{d:`M6.3 20.3a2.4 2.4 0 0 0 3.4 0L12 18l-6-6-2.3 2.3a2.4 2.4 0 0 0 0 3.4Z`,key:`goz73y`}],[`path`,{d:`M7.5 13.5 10 11`,key:`7xgeeb`}],[`path`,{d:`M10.5 16.5 13 14`,key:`10btkg`}],[`path`,{d:`m12 6 6 6 2.3-2.3a2.4 2.4 0 0 0 0-3.4l-2.6-2.6a2.4 2.4 0 0 0-3.4 0Z`,key:`1snsnr`}]]};at.node;var ot=c(at),J=e(t(),1),Y=e(n(),1);function st(e,t){let n=encodeURIComponent(e),r=encodeURIComponent(t);return[{id:`mail`,label:K(`shareRun.email`),href:`mailto:?subject=${r}&body=${r}%0A%0A${n}`},{id:`x`,label:`X`,href:`https://x.com/intent/post?text=${r}&url=${n}`},{id:`linkedin`,label:`LinkedIn`,href:`https://www.linkedin.com/sharing/share-offsite/?url=${n}`},{id:`whatsapp`,label:`WhatsApp`,href:`https://wa.me/?text=${r}%20${n}`},{id:`facebook`,label:`Facebook`,href:`https://www.facebook.com/sharer/sharer.php?u=${n}`}]}var ct={x:`𝕏`,linkedin:`in`,whatsapp:`WA`,facebook:`f`};function lt({runId:e,title:t,initial:n}){let[r,i]=(0,J.useState)(!1),[o,s]=(0,J.useState)(n),[c,l]=(0,J.useState)(!1),[u,f]=(0,J.useState)(!1),[p,m]=(0,J.useState)(null),h=async()=>{if(i(!0),!o){l(!0),m(null);try{s(await a.post(`/api/runs/${e}/share`))}catch(e){m(e.message)}finally{l(!1)}}},g=async()=>{await a.del(`/api/runs/${e}/share`),s(null),i(!1)},_=()=>{o&&(navigator.clipboard.writeText(o.url),f(!0),setTimeout(()=>f(!1),1500))},v=y(`share`)||typeof navigator<`u`&&`share`in navigator,x=o?.expiresAt?new Intl.DateTimeFormat(z,{dateStyle:`long`}).format(new Date(o.expiresAt)):null;return(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsxs)(G,{variant:`secondary`,onClick:()=>void h(),children:[(0,Y.jsx)(Qe,{className:`size-4`}),` `,K(`shareRun.button`)]}),(0,Y.jsx)(ie,{open:r,onClose:()=>i(!1),title:K(`shareRun.title`),children:c?(0,Y.jsx)(`div`,{className:`flex justify-center py-8 text-ink-4`,children:(0,Y.jsx)(V,{})}):p?(0,Y.jsx)(`p`,{className:`rounded-lg bg-rose-tint px-3 py-2 text-[14px] text-rose`,children:p}):o?(0,Y.jsxs)(`div`,{className:`flex flex-col gap-5`,children:[(0,Y.jsxs)(`div`,{className:`flex items-center gap-2 rounded-xl bg-paper-2 p-1.5 pl-3`,children:[(0,Y.jsx)(L,{className:`size-4 shrink-0 text-ink-3`}),(0,Y.jsx)(`input`,{readOnly:!0,value:o.url,onFocus:e=>e.target.select(),"aria-label":K(`share.link`),className:`min-w-0 flex-1 bg-transparent text-[14px] outline-none coarse:h-11`}),(0,Y.jsxs)(G,{size:`sm`,onClick:_,children:[u?(0,Y.jsx)(j,{className:`size-3.5`}):(0,Y.jsx)(M,{className:`size-3.5`}),K(u?`share.copied`:`share.copy`)]})]}),(0,Y.jsxs)(`div`,{className:`grid grid-cols-3 gap-3 sm:grid-cols-6`,children:[st(o.url,t).map(e=>(0,Y.jsxs)(`a`,{href:e.href,target:`_blank`,rel:`noreferrer`,className:`flex flex-col items-center gap-1.5 text-[12px] text-ink-2 hover:text-ink`,children:[(0,Y.jsx)(`span`,{className:`inline-flex size-12 items-center justify-center rounded-full bg-paper-2 font-semibold text-[15px] transition hover:bg-paper-3`,children:e.id===`mail`?(0,Y.jsx)(d,{className:`size-5`}):ct[e.id]}),e.label]},e.id)),v?(0,Y.jsxs)(`button`,{type:`button`,onClick:()=>void(y(`share`)?b(`share`,{link:o.url,title:t}):navigator.share({title:t,url:o.url})).catch(()=>void 0),className:`flex flex-col items-center gap-1.5 text-[12px] text-ink-2 hover:text-ink`,children:[(0,Y.jsx)(`span`,{className:`inline-flex size-12 items-center justify-center rounded-full bg-paper-2 transition hover:bg-paper-3`,children:(0,Y.jsx)(Qe,{className:`size-5`})}),K(`shareRun.more`)]}):null]}),(0,Y.jsxs)(`div`,{className:`flex items-center justify-between gap-3 text-[13px] text-ink-3`,children:[(0,Y.jsx)(`span`,{children:x?K(`shareRun.until`,{date:x}):K(`shareRun.kept`)}),(0,Y.jsx)(`button`,{type:`button`,onClick:()=>void g(),className:`shrink-0 hover:text-rose coarse:min-h-11`,children:K(`shareRun.withdraw`)})]})]}):null})]})}function ut({runId:e,ask:t}){return t.kind===`confirm`?(0,Y.jsx)(dt,{runId:e,ask:t}):(0,Y.jsx)(ft,{runId:e,ask:t})}function dt({runId:e,ask:t}){let[n,r]=(0,J.useState)(!1),[i,o]=(0,J.useState)(!1),[s,c]=(0,J.useState)(null),l=async n=>{o(!0),c(null);try{await a.post(`/api/runs/${e}/ask/${t.id}`,n)}catch(e){c(e.message),o(!1)}},u=t.action.destructive?it:Ke;return(0,Y.jsxs)(`div`,{className:`animate-rise`,children:[(0,Y.jsxs)(`div`,{className:`mb-5 flex items-start gap-3`,children:[(0,Y.jsx)(`div`,{className:H(`flex size-10 shrink-0 items-center justify-center rounded-full`,t.action.destructive?`bg-rose-tint text-rose`:`bg-ember-tint text-ember-strong`),children:(0,Y.jsx)(u,{className:`size-5`})}),(0,Y.jsxs)(`div`,{className:`min-w-0`,children:[(0,Y.jsx)(`p`,{className:`text-[13px] text-ink-3`,children:K(`ask.wants`,{service:t.service})}),(0,Y.jsx)(`h2`,{className:`font-display font-semibold text-[20px] leading-snug tracking-tight`,children:t.reason})]})]}),(0,Y.jsx)(`pre`,{className:`max-h-72 overflow-auto whitespace-pre-wrap break-words rounded-xl bg-paper-2 p-4 text-[13px] leading-relaxed ring-1 ring-border-soft`,children:t.input}),(0,Y.jsxs)(`div`,{className:`mt-5 flex items-center gap-4`,children:[(0,Y.jsx)(ce,{checked:n,onChange:r,label:K(`ask.allowRest`)}),(0,Y.jsx)(`span`,{className:`flex-1 text-[13px] text-ink-2`,children:K(`ask.allowRest`)})]}),s?(0,Y.jsx)(`div`,{className:`mt-3 rounded-lg bg-rose-tint px-4 py-3 text-[14px] text-rose`,children:s}):null,(0,Y.jsxs)(`div`,{className:`action-bar mt-6 flex items-center justify-between gap-3`,children:[(0,Y.jsx)(G,{variant:`ghost`,disabled:i,onClick:()=>void l({type:`skip`}),children:K(`ask.deny`)}),(0,Y.jsx)(G,{busy:i,onClick:()=>void l({type:`done`,remember:n}),children:K(`ask.allow`)})]})]})}function ft({runId:e,ask:t}){let[n,i]=(0,J.useState)({}),[o,s]=(0,J.useState)(!1),[c,l]=(0,J.useState)(!1),[u,d]=(0,J.useState)(null),[f,m]=(0,J.useState)(0),[h,g]=(0,J.useState)(``),[_,v]=(0,J.useState)(!1),y=(0,J.useRef)(null),b=(0,J.useCallback)(()=>m(e=>e+1),[]);(0,J.useEffect)(()=>{let e=setInterval(b,2500);return()=>clearInterval(e)},[b]);let x=async n=>{l(!0),d(null);try{await a.post(`/api/runs/${e}/ask/${t.id}`,n)}catch(e){d(e.message),l(!1)}},S=async t=>{d(null);try{await a.post(`/api/runs/${e}/browser/act`,t)}catch(e){d(e.message)}b()},C=e=>{let t=y.current;if(!t?.naturalWidth)return;let n=t.getBoundingClientRect();S({type:`click`,x:Math.round((e.clientX-n.left)/n.width*t.naturalWidth),y:Math.round((e.clientY-n.top)/n.height*t.naturalHeight)})},w=t.fields.some(e=>n[e.id]);return(0,Y.jsxs)(`div`,{className:`animate-rise`,children:[(0,Y.jsxs)(`div`,{className:`mb-5 flex items-start gap-3`,children:[(0,Y.jsx)(`div`,{className:`flex size-10 shrink-0 items-center justify-center rounded-full bg-ember-tint text-ember-strong`,children:(0,Y.jsx)(He,{className:`size-5`})}),(0,Y.jsxs)(`div`,{className:`min-w-0`,children:[(0,Y.jsx)(`h2`,{className:`font-display font-semibold text-[20px] leading-snug tracking-tight`,children:t.reason}),(0,Y.jsxs)(`p`,{className:`mt-0.5 truncate text-[13px] text-ink-3`,children:[t.site.host,t.site.title?` · ${t.site.title}`:``]})]})]}),(0,Y.jsxs)(`div`,{className:`overflow-hidden rounded-xl bg-paper-2 ring-1 ring-border-soft`,children:[(0,Y.jsx)(`img`,{ref:y,src:r(`/api/runs/${e}/browser/screen?t=${f}`),alt:t.site.host,onClick:C,className:`block w-full cursor-pointer`}),(0,Y.jsxs)(`div`,{className:`flex flex-wrap items-center gap-1.5 border-border-soft border-t bg-card p-2`,children:[(0,Y.jsx)(W,{type:_?`password`:`text`,autoComplete:`off`,value:h,placeholder:K(`ask.typeInto`),onChange:e=>g(e.target.value),onKeyDown:e=>{e.key===`Enter`&&(e.preventDefault(),S({type:`type`,text:h}).then(()=>g(``)))},autoCapitalize:`off`,autoCorrect:`off`,spellCheck:!1,enterKeyHint:`send`,className:`h-9 min-w-[9rem] flex-1 basis-full text-[13px] sm:basis-0 coarse:h-11`}),(0,Y.jsx)(`button`,{type:`button`,onClick:()=>v(e=>!e),className:H(`h-9 shrink-0 rounded-md px-2.5 text-[12px] coarse:h-11 coarse:px-3.5`,_?`bg-ember-veil text-ink`:`text-ink-3 hover:bg-paper-2`),children:K(`ask.hide`)}),(0,Y.jsx)(pt,{label:`Enter`,onClick:()=>void S({type:`key`,key:`Enter`}),children:(0,Y.jsx)(Se,{className:`size-4`})}),(0,Y.jsx)(pt,{label:K(`ask.up`),onClick:()=>void S({type:`scroll`,dy:-500}),children:(0,Y.jsx)(p,{className:`size-4`})}),(0,Y.jsx)(pt,{label:K(`ask.down`),onClick:()=>void S({type:`scroll`,dy:500}),children:(0,Y.jsx)(me,{className:`size-4`})})]})]}),(0,Y.jsx)(`p`,{className:`mt-2 text-[12px] text-ink-4`,children:K(`ask.pictureHint`)}),t.fields.length?(0,Y.jsxs)(`form`,{className:`mt-5 flex flex-col gap-4`,onSubmit:e=>{e.preventDefault(),x({type:`fill`,values:n,remember:o})},children:[t.fields.map((e,r)=>(0,Y.jsxs)(`div`,{children:[(0,Y.jsx)(B,{children:e.label}),(0,Y.jsx)(W,{autoFocus:r===0,type:e.secret?`password`:`text`,autoComplete:`off`,autoCapitalize:`off`,autoCorrect:`off`,spellCheck:!1,enterKeyHint:r===t.fields.length-1?`go`:`next`,value:n[e.id]??``,onChange:t=>i(n=>({...n,[e.id]:t.target.value}))})]},e.id)),(0,Y.jsx)(`button`,{type:`submit`,hidden:!0})]}):null,(0,Y.jsxs)(`div`,{className:`mt-5 flex items-center justify-between gap-4`,children:[(0,Y.jsx)(ce,{checked:o,onChange:s,label:K(`ask.remember`)}),(0,Y.jsx)(`span`,{className:`flex-1 text-[13px] text-ink-2`,children:K(`ask.remember`)})]}),(0,Y.jsxs)(`p`,{className:`mt-3 flex items-start gap-2 text-[13px] text-ink-3`,children:[(0,Y.jsx)(et,{className:`mt-0.5 size-4 shrink-0 text-moss`}),` `,K(`ask.private`)]}),u?(0,Y.jsx)(`div`,{className:`mt-3 rounded-lg bg-rose-tint px-4 py-3 text-[14px] text-rose`,children:u}):null,(0,Y.jsxs)(`div`,{className:`action-bar mt-6 flex flex-wrap items-center justify-between gap-3`,children:[(0,Y.jsx)(G,{variant:`ghost`,disabled:c,onClick:()=>void x({type:`skip`}),children:K(`ask.skip`)}),(0,Y.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[t.fields.length?(0,Y.jsx)(G,{variant:`secondary`,disabled:c,onClick:()=>void x({type:`done`,remember:o}),children:K(`ask.done`)}):null,t.fields.length?(0,Y.jsx)(G,{busy:c,disabled:!w,onClick:()=>void x({type:`fill`,values:n,remember:o}),children:K(`ask.signIn`)}):(0,Y.jsx)(G,{busy:c,onClick:()=>void x({type:`done`,remember:o}),children:K(`ask.done`)})]})]})]})}function pt({label:e,onClick:t,children:n}){return(0,Y.jsx)(`button`,{type:`button`,"aria-label":e,title:e,onClick:t,className:`flex size-9 shrink-0 items-center justify-center rounded-md text-ink-3 hover:bg-paper-2 hover:text-ink coarse:size-11`,children:n})}var X=36e5,Z=6e4,mt=1e3;function ht(e){return e.fractionDigits===void 0?e.style===`integer`?0:2:e.fractionDigits}function gt(e,t,n=`en`){if(typeof e!=`number`||!Number.isFinite(e))return``;let r=ht(t),i=t.grouping!==!1;return t.style===`percent`?new Intl.NumberFormat(n,{maximumFractionDigits:r,minimumFractionDigits:r,style:`percent`,useGrouping:i}).format(e):t.style===`currency`&&t.currency?new Intl.NumberFormat(n,{currency:t.currency,maximumFractionDigits:r,minimumFractionDigits:r,style:`currency`,useGrouping:i}).format(e):new Intl.NumberFormat(n,{maximumFractionDigits:r,minimumFractionDigits:r,useGrouping:i}).format(e)}function _t(e,t,n=`en`){if(typeof e!=`string`||e.length===0)return``;if(t.kind===`time`)return vt(e,t.timePrecision??`minutes`);if(t.dateStyle===`iso`)return t.kind===`date`?e.slice(0,10):e;let r=t.kind===`date`?new Date(`${e}T00:00:00`):new Date(e);if(Number.isNaN(r.getTime()))return e;let i=t.dateStyle??`medium`;if(t.kind===`date`)return new Intl.DateTimeFormat(n,{dateStyle:i}).format(r);let a=t.timePrecision??`minutes`;return new Intl.DateTimeFormat(n,{dateStyle:i,timeStyle:a===`hours`?`short`:`medium`}).format(r)}function vt(e,t){let[n=`0`,r=`00`,i=`00`]=e.split(`:`);return t===`hours`?`${n.padStart(2,`0`)}:00`:t===`minutes`?`${n.padStart(2,`0`)}:${r.padStart(2,`0`)}`:`${n.padStart(2,`0`)}:${r.padStart(2,`0`)}:${i.padStart(2,`0`)}`}function yt(e,t){if(typeof e!=`number`||!Number.isFinite(e))return``;let n=Math.max(0,Math.round(e));if(t.display===`iso`)return bt(n);if(t.display===`minutes`)return`${Math.round(n/Z)} min`;if(t.display===`hours`)return`${(n/X).toFixed(2)} h`;if(t.display===`decimal-hours`)return(n/X).toFixed(2);let r=Math.floor(n/X),i=Math.floor(n%X/Z),a=Math.floor(n%Z/mt);return`${r}:${String(i).padStart(2,`0`)}:${String(a).padStart(2,`0`)}`}function bt(e){let t=Math.floor(e/X),n=Math.floor(e%X/Z),r=Math.floor(e%Z/mt);return`${t>=24?`P${Math.floor(t/24)}D`:`P`}T${t%24}H${n}M${r}S`}function xt(e,t,n=`en`){if(t==null)return``;switch(e.type){case`number`:return gt(t,e.format,n);case`date`:return _t(t,e.format,n);case`duration`:return yt(t,e.format);case`boolean`:return t===!0?`true`:t===!1?`false`:``;case`select`:return St(e,t);default:return String(t)}}function St(e,t){let n=Array.isArray(t)?t:[t],r=e.format.options.reduce((e,t)=>(e[t.id]=t.label,e),{});return n.filter(e=>typeof e==`string`&&e.length>0).map(e=>r[e]??e).join(`, `)}async function Ct(e,t=2400){if(!/^image\/(jpeg|png|webp)$/.test(e.type)||e.size<12e5)return e;try{let n=await createImageBitmap(e),r=Math.min(1,t/Math.max(n.width,n.height)),i=document.createElement(`canvas`);i.width=Math.round(n.width*r),i.height=Math.round(n.height*r),i.getContext(`2d`)?.drawImage(n,0,0,i.width,i.height);let a=await new Promise(e=>i.toBlob(e,`image/jpeg`,.86));return a&&a.size<e.size?new File([a],`${e.name.replace(/\.[^.]+$/,``)}.jpg`,{type:`image/jpeg`}):e}catch{return e}}function wt(){return new Date().toISOString().slice(0,19).replace(/[:T]/g,`-`)}function Tt(e){let t=e?.name;return t===`NotFoundError`||t===`OverconstrainedError`?`missing`:t===`NotReadableError`||t===`AbortError`?`busy`:`denied`}function Et(e){return!!e?.getCapabilities?.()?.torch}function Dt(e,t,n=!1){let r=(0,J.useRef)(null),[i,a]=(0,J.useState)(null),[o,s]=(0,J.useState)(null),[c,l]=(0,J.useState)(1),[u,d]=(0,J.useState)(!1),[f,p]=(0,J.useState)(!1);return(0,J.useEffect)(()=>{if(!e)return;let r=null,i=!1;s(null),a(null),d(!1),p(!1);let o={facingMode:{ideal:t},width:{ideal:2560},height:{ideal:1440}};return(async()=>{if(!navigator.mediaDevices?.getUserMedia)throw new DOMException(`no camera api`,`NotAllowedError`);try{r=await navigator.mediaDevices.getUserMedia({video:o,audio:n})}catch(e){if(!n)throw e;r=await navigator.mediaDevices.getUserMedia({video:o})}if(i){for(let e of r.getTracks())e.stop();return}a(r);let e=r.getVideoTracks()[0],t=()=>!i&&d(Et(e));t(),setTimeout(t,600);let s=await navigator.mediaDevices.enumerateDevices().catch(()=>[]);i||l(s.filter(e=>e.kind===`videoinput`).length)})().catch(e=>!i&&s(Tt(e))),()=>{i=!0;for(let e of r?.getTracks()??[])e.stop()}},[e,t,n]),(0,J.useEffect)(()=>{r.current&&i&&(r.current.srcObject=i)},[i]),{video:r,stream:i,error:o,cameras:c,torchable:u,torch:f,setTorch:async e=>{let t=i?.getVideoTracks()[0];try{await t?.applyConstraints({advanced:[{torch:e}]}),p(e)}catch{d(!1)}},mirrored:i?.getVideoTracks()[0]?.getSettings().facingMode===`user`}}function Ot({open:e,onClose:t,label:n,children:r}){let i=(0,J.useRef)(null);return(0,J.useEffect)(()=>{let t=i.current;t&&(e&&!t.open?t.showModal():!e&&t.open&&t.close())},[e]),(0,Y.jsx)(`dialog`,{ref:i,onClose:t,"aria-label":n,className:`media-sheet`,children:e?(0,Y.jsx)(`div`,{className:`flex h-full flex-col`,children:r}):null})}function kt({label:e,onClick:t,active:n,children:r}){return(0,Y.jsx)(`button`,{type:`button`,"aria-label":e,title:e,"aria-pressed":n,onClick:t,className:H(`flex size-11 shrink-0 items-center justify-center rounded-full transition`,n?`bg-white text-black`:`bg-white/12 text-white hover:bg-white/20`),children:r})}function At({title:e,onClose:t,camera:n,onFlip:r}){return(0,Y.jsx)(`div`,{className:`safe-top`,children:(0,Y.jsxs)(`div`,{className:`flex items-center gap-2 px-3 py-2`,children:[(0,Y.jsx)(kt,{label:K(`common.close`),onClick:t,children:(0,Y.jsx)(q,{className:`size-5`})}),(0,Y.jsx)(`div`,{className:`min-w-0 flex-1 truncate text-center font-medium text-[15px]`,children:e}),n.torchable?(0,Y.jsx)(kt,{label:K(`camera.torch`),active:n.torch,onClick:()=>void n.setTorch(!n.torch),children:n.torch?(0,Y.jsx)(Me,{className:`size-5`}):(0,Y.jsx)(Ae,{className:`size-5`})}):null,n.stream&&(n.cameras>1||g)?(0,Y.jsx)(kt,{label:K(`camera.flip`),onClick:r,children:(0,Y.jsx)(nt,{className:`size-5`})}):(0,Y.jsx)(`span`,{className:`size-11`})]})})}function jt({camera:e,asking:t,children:n,actions:r}){return(0,Y.jsxs)(`div`,{className:`relative min-h-0 flex-1 overflow-hidden`,children:[(0,Y.jsx)(`video`,{ref:e.video,autoPlay:!0,playsInline:!0,muted:!0,className:H(`absolute inset-0 size-full object-contain`,e.mirrored&&`-scale-x-100`)}),e.error?(0,Y.jsxs)(`div`,{className:`absolute inset-0 flex flex-col items-center justify-center gap-5 bg-black px-8 text-center`,children:[(0,Y.jsx)(`p`,{className:`max-w-sm text-[15px] text-white/85 leading-relaxed`,children:K(`camera.${e.error}`)}),r]}):e.stream?n:(0,Y.jsxs)(`div`,{className:`absolute inset-0 flex flex-col items-center justify-center gap-4 px-8 text-center text-white/75`,children:[(0,Y.jsx)(V,{}),(0,Y.jsx)(`p`,{className:`max-w-xs text-[14px] leading-relaxed`,children:t})]})]})}var Mt=30;function Nt(){if(typeof MediaRecorder<`u`)return[`video/mp4;codecs=avc1.42E01E,mp4a.40.2`,`video/mp4`,`video/webm;codecs=vp9,opus`,`video/webm;codecs=vp8,opus`,`video/webm`].find(e=>MediaRecorder.isTypeSupported(e))}var Pt=!!Nt();function Ft({open:e,multiple:t,video:n,onClose:r,onCapture:i,onNative:a}){let[o,s]=(0,J.useState)(`environment`),[c,l]=(0,J.useState)(`photo`),[u,d]=(0,J.useState)(0),[f,p]=(0,J.useState)(!1),[m,h]=(0,J.useState)(null),_=(0,J.useRef)(null),v=Dt(e,o,c===`video`);(0,J.useEffect)(()=>{e&&(d(0),l(`photo`),h(null))},[e]);let y=async e=>{p(!0);try{await i(e),d(e=>e+1),t||r()}finally{p(!1)}},b=async()=>{let e=v.video.current;if(!e?.videoWidth)return;let t=document.createElement(`canvas`);t.width=e.videoWidth,t.height=e.videoHeight,t.getContext(`2d`)?.drawImage(e,0,0);let n=await new Promise(e=>t.toBlob(e,`image/jpeg`,.9));n&&await y(new File([n],`foto-${wt()}.jpg`,{type:`image/jpeg`}))},x=()=>{_.current?.state===`recording`&&_.current.stop()},S=()=>{let e=Nt();if(!v.stream||!e)return;let t=[],n=new MediaRecorder(v.stream,{mimeType:e,videoBitsPerSecond:25e5,audioBitsPerSecond:96e3});n.ondataavailable=e=>e.data.size&&t.push(e.data),n.onstop=()=>{h(null),_.current=null;let n=e.split(`;`)[0];if(t.length){let e=n===`video/mp4`?`mp4`:`webm`;y(new File(t,`video-${wt()}.${e}`,{type:n}))}},_.current=n,n.start(1e3),h(0)};(0,J.useEffect)(()=>{if(m===null)return;if(m>=Mt){_.current?.state===`recording`&&_.current.stop();return}let e=setTimeout(()=>h(e=>e===null?null:e+1),1e3);return()=>clearTimeout(e)},[m]),(0,J.useEffect)(()=>{!e&&_.current&&(_.current.onstop=null,_.current.stop(),_.current=null)},[e]);let C=e=>`0:${String(e).padStart(2,`0`)}`;return(0,Y.jsxs)(Ot,{open:e,onClose:r,label:K(`camera.title`),children:[(0,Y.jsx)(At,{title:m===null?u?K(`camera.taken`,{n:u}):K(`camera.title`):`${C(m)} / ${C(Mt)}`,onClose:r,camera:v,onFlip:()=>s(e=>e===`environment`?`user`:`environment`)}),(0,Y.jsx)(jt,{camera:v,asking:K(`camera.asking`),actions:(0,Y.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[a?(0,Y.jsxs)(Q,{onClick:()=>{r(),a()},children:[(0,Y.jsx)(be,{className:`size-4`}),` `,K(g?`camera.native`:`camera.pick`)]}):null,(0,Y.jsx)(Q,{quiet:!0,onClick:r,children:K(`common.close`)})]})}),(0,Y.jsxs)(`div`,{className:H(`safe-bottom px-4 pt-3`,v.error&&`invisible`),children:[n&&Pt&&m===null?(0,Y.jsx)(`div`,{className:`mb-3 flex justify-center gap-1 text-[13px]`,children:[`photo`,`video`].map(e=>(0,Y.jsx)(`button`,{type:`button`,"aria-pressed":c===e,onClick:()=>l(e),className:H(`h-9 rounded-full px-4 font-medium transition`,c===e?`bg-white text-black`:`text-white/70 hover:text-white`),children:K(e===`photo`?`camera.photo`:`camera.video`)},e))}):null,(0,Y.jsxs)(`div`,{className:`grid grid-cols-[1fr_auto_1fr] items-center gap-3`,children:[(0,Y.jsx)(`span`,{className:`text-[13px] text-white/70 leading-snug`,children:m===null?c===`video`?K(`camera.clipHint`,{s:Mt}):K(t?`camera.hintMany`:`camera.hint`):K(`camera.recording`)}),(0,Y.jsx)(`button`,{type:`button`,"aria-label":K(c===`photo`?`camera.shoot`:m===null?`camera.record`:`camera.stop`),disabled:!v.stream||f,onClick:()=>c===`photo`?void b():m===null?S():x(),className:`flex size-[72px] items-center justify-center rounded-full border-4 border-white transition active:scale-95 disabled:opacity-40`,children:f?(0,Y.jsx)(V,{className:`text-white`}):c===`photo`?(0,Y.jsx)(`span`,{className:`size-[54px] rounded-full bg-white`}):m===null?(0,Y.jsx)(`span`,{className:`flex size-[54px] items-center justify-center rounded-full bg-[#e5484d]`,children:(0,Y.jsx)(ne,{className:`size-6 text-white`})}):(0,Y.jsx)(`span`,{className:`size-7 rounded-md bg-[#e5484d]`})}),(0,Y.jsx)(`div`,{className:`flex justify-end`,children:t&&u&&m===null?(0,Y.jsxs)(Q,{onClick:r,children:[(0,Y.jsx)(j,{className:`size-4`}),` `,K(`camera.done`)]}):null})]})]})]})}function Q({onClick:e,quiet:t,children:n}){return(0,Y.jsx)(`button`,{type:`button`,onClick:e,className:H(`inline-flex h-11 items-center justify-center gap-2 rounded-full px-5 font-medium text-[14px] transition`,t?`text-white/75 hover:text-white`:`bg-white text-black hover:bg-white/90`),children:n})}var It=25,Lt=9e3;function Rt(e){return e.code===e.PERMISSION_DENIED?`denied`:e.code===e.TIMEOUT?`timeout`:`unavailable`}function zt({value:e,runId:t,placeholder:n,onChange:r,onBusy:i}){let o=ue(e)?e:null,[s,c]=(0,J.useState)(!1),[l,u]=(0,J.useState)(null),d=(0,J.useRef)(null),f=(0,J.useRef)(!!o?.label),p=(0,J.useRef)(o);p.current=o;let m=o?.lat!==void 0&&o.lng!==void 0,h=typeof navigator<`u`&&`geolocation`in navigator,g=()=>{d.current!==null&&(navigator.geolocation.clearWatch(d.current),d.current=null),c(!1),i?.(!1)};(0,J.useEffect)(()=>()=>{d.current!==null&&navigator.geolocation.clearWatch(d.current)},[]);let _=async(e,n)=>{try{let{label:i}=await a.post(`/api/runs/${t}/geocode`,{lat:e,lng:n,language:z}),o=p.current;i&&!f.current&&o?.lat===e&&o.lng===n&&r({...o,label:i})}catch{}},v=()=>{u(null),c(!0),i?.(!0);let e=Date.now(),t=1/0;d.current=navigator.geolocation.watchPosition(n=>{let{latitude:i,longitude:a,accuracy:o}=n.coords;if(o<t){t=o;let e=Math.round(i*1e6)/1e6,n=Math.round(a*1e6)/1e6,s=f.current?p.current?.label:void 0,c={lat:e,lng:n,accuracy:Math.round(o),...s?{label:s}:{}};p.current=c,r(c)}if(t<=It||Date.now()-e>Lt){g();let e=p.current;e?.lat!==void 0&&e.lng!==void 0&&_(e.lat,e.lng)}},e=>{g(),t===1/0&&u(Rt(e))},{enableHighAccuracy:!0,timeout:15e3,maximumAge:1e4})},y=e=>{f.current=e.trim().length>0;let t={...m?o:{},label:e};r(m||e.trim()?t:void 0)};return(0,Y.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[m?(0,Y.jsxs)(`div`,{className:`flex items-center gap-3 rounded-xl bg-card p-3 ring-1 ring-input`,children:[(0,Y.jsx)(`div`,{className:`flex size-10 shrink-0 items-center justify-center rounded-full bg-moss-tint text-moss`,children:(0,Y.jsx)(We,{className:`size-5`})}),(0,Y.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,Y.jsxs)(`div`,{className:`truncate font-medium text-[15px] tabular-nums`,children:[o.lat?.toFixed(5),`, `,o.lng?.toFixed(5)]}),(0,Y.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-3 text-[13px] text-ink-3`,children:[(0,Y.jsx)(`span`,{children:s?K(`location.refining`):o.accuracy?K(`location.accuracy`,{m:o.accuracy}):null}),(0,Y.jsxs)(`a`,{href:`https://www.openstreetmap.org/?mlat=${o.lat}&mlon=${o.lng}#map=17/${o.lat}/${o.lng}`,target:`_blank`,rel:`noreferrer`,className:`inline-flex items-center gap-1 underline-offset-2 hover:text-ink hover:underline coarse:-my-3 coarse:min-h-11 coarse:min-w-11`,children:[K(`location.map`),` `,(0,Y.jsx)(P,{className:`size-3`})]})]})]}),(0,Y.jsx)(U,{label:K(`location.remove`),onClick:()=>{g(),f.current=!1,r(void 0)},children:(0,Y.jsx)(q,{className:`size-4`})})]}):h?(0,Y.jsxs)(`div`,{children:[(0,Y.jsxs)(G,{variant:`secondary`,size:`lg`,busy:s,onClick:v,className:`w-full sm:w-auto`,children:[s?null:(0,Y.jsx)(Be,{className:`size-4`}),K(s?`location.locating`:`location.use`)]}),l?(0,Y.jsx)(`p`,{className:`mt-2 rounded-lg bg-amber-tint px-3 py-2 text-[13px] text-ink-2 leading-relaxed`,children:K(`location.${l}`)}):(0,Y.jsx)(`p`,{className:`mt-2 text-[13px] text-ink-3 leading-relaxed`,children:K(`location.why`)})]}):null,(0,Y.jsx)(W,{value:o?.label??``,placeholder:n??K(m?`location.label`:`location.manual`),autoComplete:`street-address`,enterKeyHint:`done`,"aria-label":K(`location.manual`),onChange:e=>y(e.target.value)})]})}var Bt=null;function Vt(){return Bt??=(async()=>{let e=window.BarcodeDetector;if(e)try{let t=await e.getSupportedFormats();if(t.includes(`qr_code`)){let n=new e({formats:t});return{qrOnly:!1,detect:async e=>(await n.detect(e))[0]?.rawValue||null}}}catch{}let{default:t}=await s(async()=>{let{default:e}=await import(`./qr-scanner.min-C_UI0gH-.js`);return{default:e}},__vite__mapDeps([0,1])),n=t.createQrEngine();return{qrOnly:!0,detect:async e=>{try{return(await t.scanImage(e,{qrEngine:n,returnDetailedScanResult:!0})).data||null}catch{return null}}}})(),Bt}function Ht({open:e,onClose:t,onResult:n}){let r=(0,J.useRef)(n);r.current=n;let i=(0,J.useRef)(t);return i.current=t,(0,J.useEffect)(()=>{e&&b(`scan`).then(e=>{e&&r.current(e)}).catch(()=>void 0).finally(()=>i.current())},[e]),null}function Ut(e){return y(`scan`)?(0,Y.jsx)(Ht,{...e}):(0,Y.jsx)(Wt,{...e})}function Wt({open:e,onClose:t,onResult:n}){let[r,i]=(0,J.useState)(`environment`),[a,o]=(0,J.useState)(!1),[s,c]=(0,J.useState)(!1),l=(0,J.useRef)(null),u=Dt(e,r),d=(0,J.useRef)(n);d.current=n;let f=(0,J.useRef)(t);f.current=t,(0,J.useEffect)(()=>{e&&(c(!1),Vt().then(e=>o(e.qrOnly)))},[e]),(0,J.useEffect)(()=>{if(!e||!u.stream)return;let t=!1,n,r=async()=>{let e=u.video.current;if(!t&&e&&e.readyState>=2&&e.videoWidth){let n=await(await Vt()).detect(e).catch(()=>null);if(n&&!t){navigator.vibrate?.(60),d.current(n),f.current();return}}t||(n=setTimeout(r,200))};return r(),()=>{t=!0,clearTimeout(n)}},[e,u.stream,u.video]);let p=async e=>{if(!e)return;c(!1);let r=await createImageBitmap(e).catch(()=>null),i=r?await(await Vt()).detect(r).catch(()=>null):null;i?(n(i),t()):c(!0)};return(0,Y.jsxs)(Ot,{open:e,onClose:t,label:K(`scan.title`),children:[(0,Y.jsx)(At,{title:K(`scan.title`),onClose:t,camera:u,onFlip:()=>i(e=>e===`environment`?`user`:`environment`)}),(0,Y.jsx)(jt,{camera:u,asking:K(`scan.asking`),actions:(0,Y.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,Y.jsxs)(Q,{onClick:()=>l.current?.click(),children:[(0,Y.jsx)(Re,{className:`size-4`}),` `,K(`scan.fromPhoto`)]}),(0,Y.jsx)(Q,{quiet:!0,onClick:t,children:K(`scan.typeInstead`)})]}),children:(0,Y.jsx)(`div`,{className:`pointer-events-none absolute inset-0 flex items-center justify-center`,children:(0,Y.jsx)(`div`,{className:`aspect-square w-[min(68%,320px)] rounded-3xl border-2 border-white/90 shadow-[0_0_0_100vmax_rgb(0_0_0/0.35)]`})})}),(0,Y.jsxs)(`div`,{className:`safe-bottom flex flex-col items-center gap-3 px-5 pt-3 text-center`,children:[(0,Y.jsx)(`p`,{className:`text-[13px] text-white/75 leading-snug`,children:K(s?`scan.miss`:a?`scan.hintQr`:`scan.hint`)}),u.stream?(0,Y.jsxs)(Q,{quiet:!0,onClick:()=>l.current?.click(),children:[(0,Y.jsx)(Re,{className:`size-4`}),` `,K(`scan.fromPhoto`)]}):null]}),(0,Y.jsx)(`input`,{ref:l,type:`file`,hidden:!0,accept:`image/*`,onChange:e=>{p(e.target.files?.[0]),e.target.value=``}})]})}var Gt=`#1d1a17`,Kt={width:1200,height:480};function qt(e,t,n,r,i){e.lineCap=`round`,e.lineJoin=`round`,e.strokeStyle=Gt,e.fillStyle=Gt,e.lineWidth=i;for(let a of t){if(a.length===1){e.beginPath(),e.arc(a[0].x*n,a[0].y*r,i/2,0,Math.PI*2),e.fill();continue}e.beginPath(),e.moveTo(a[0].x*n,a[0].y*r);for(let t=1;t<a.length-1;t++){let i=a[t],o=a[t+1];e.quadraticCurveTo(i.x*n,i.y*r,(i.x+o.x)/2*n,(i.y+o.y)/2*r)}let t=a[a.length-1];e.lineTo(t.x*n,t.y*r),e.stroke()}}function Jt({strokes:e,onStrokes:t}){let n=(0,J.useRef)(null),r=(0,J.useRef)(null),i=(0,J.useRef)(e);i.current=e;let a=()=>{let e=n.current,t=e?.getContext(`2d`);if(!e||!t)return;let a=window.devicePixelRatio||1,o=Math.round(e.clientWidth*a),s=Math.round(e.clientHeight*a);(e.width!==o||e.height!==s)&&(e.width=o,e.height=s),t.clearRect(0,0,o,s),qt(t,r.current?[...i.current,r.current]:i.current,o,s,2.4*a)};(0,J.useEffect)(()=>{a();let e=n.current;if(!e)return;let t=new ResizeObserver(a);return t.observe(e),()=>t.disconnect()},[e]);let o=e=>{let t=e.currentTarget.getBoundingClientRect();return{x:Math.min(1,Math.max(0,(e.clientX-t.left)/t.width)),y:Math.min(1,Math.max(0,(e.clientY-t.top)/t.height))}};return(0,Y.jsxs)(`div`,{className:`relative overflow-hidden rounded-xl bg-white ring-1 ring-input`,children:[(0,Y.jsx)(`canvas`,{ref:n,"aria-label":K(`sign.pad`),className:`block aspect-[5/2] w-full cursor-crosshair touch-none select-none`,onPointerDown:e=>{e.currentTarget.setPointerCapture(e.pointerId),r.current=[o(e)],a()},onPointerMove:e=>{r.current&&(r.current.push(o(e)),a())},onPointerUp:()=>{if(r.current){let e=r.current;r.current=null,t([...i.current,e])}},onPointerCancel:()=>{r.current=null,a()}}),(0,Y.jsx)(`div`,{className:`pointer-events-none absolute inset-x-6 bottom-[22%] border-[#1d1a17]/25 border-b`}),e.length?null:(0,Y.jsx)(`div`,{className:`pointer-events-none absolute inset-0 flex items-center justify-center text-[#1d1a17]/40 text-[14px]`,children:K(`sign.hint`)})]})}async function Yt(e){let t=document.createElement(`canvas`);t.width=Kt.width,t.height=Kt.height;let n=t.getContext(`2d`);if(!n)return null;qt(n,e,Kt.width,Kt.height,7);let r=await new Promise(e=>t.toBlob(e,`image/png`));return r?new File([r],`unterschrift.png`,{type:`image/png`}):null}function Xt({label:e,value:t,runId:n,onChange:i}){let[o,s]=(0,J.useState)(!1),[c,l]=(0,J.useState)([]),[u,d]=(0,J.useState)(!1),[f,p]=(0,J.useState)(null),m=typeof t==`string`&&t?t:null,h=async()=>{d(!0),p(null);try{let e=await Yt(c);if(!e)return;i((await a.upload(`/api/runs/${n}/uploads`,e)).id),s(!1)}catch(e){p(e.message)}finally{d(!1)}};return(0,Y.jsxs)(`div`,{children:[m?(0,Y.jsxs)(`div`,{className:`flex items-center gap-3 rounded-xl bg-card p-2 ring-1 ring-input`,children:[(0,Y.jsx)(`button`,{type:`button`,onClick:()=>{l([]),s(!0)},className:`min-w-0 flex-1 rounded-lg bg-white px-3`,"aria-label":K(`sign.again`),children:(0,Y.jsx)(`img`,{src:r(`/api/runs/${n}/assets/${m}`),alt:e,className:`mx-auto h-20 object-contain`})}),(0,Y.jsx)(U,{label:K(`sign.remove`),onClick:()=>i(void 0),children:(0,Y.jsx)(q,{className:`size-4`})})]}):(0,Y.jsxs)(`button`,{type:`button`,onClick:()=>{l([]),s(!0)},className:`flex w-full flex-col items-center justify-center gap-2 rounded-xl border border-input border-dashed bg-card px-4 py-7 text-[14px] text-ink-3 transition hover:border-ember hover:text-ink`,children:[(0,Y.jsx)(ee,{className:`size-6`}),K(`sign.open`)]}),(0,Y.jsxs)(ie,{open:o,onClose:()=>s(!1),title:e,wide:!0,children:[(0,Y.jsx)(Jt,{strokes:c,onStrokes:l}),f?(0,Y.jsx)(`p`,{className:`mt-2 text-[13px] text-rose`,children:f}):null,(0,Y.jsxs)(`div`,{className:`mt-5 flex items-center justify-between gap-3`,children:[(0,Y.jsxs)(G,{variant:`ghost`,disabled:!c.length||u,onClick:()=>l([]),children:[(0,Y.jsx)(Ee,{className:`size-4`}),` `,K(`sign.clear`)]}),(0,Y.jsx)(G,{busy:u,disabled:!c.length,onClick:()=>void h(),children:K(`sign.accept`)})]})]})]})}function Zt({runId:e,connectionId:t,connector:n,onCancel:r}){let[i,o]=(0,J.useState)({}),[s,c]=(0,J.useState)(!1),[l,u]=(0,J.useState)(null),d=async()=>{c(!0),u(null);try{await a.post(`/api/runs/${e}/connections/${t}/credentials/${n.id}`,{values:i})}catch(e){u(e.message)}finally{c(!1)}};return(0,Y.jsxs)(`div`,{className:`flex flex-col gap-3 rounded-xl bg-card p-4 ring-1 ring-input`,children:[(n.fields??[]).map(e=>(0,Y.jsxs)(`div`,{children:[(0,Y.jsx)(B,{children:e.label}),(0,Y.jsx)(W,{type:e.secret?`password`:`text`,autoComplete:`off`,value:i[e.key]??``,placeholder:e.placeholder,onChange:t=>o(n=>({...n,[e.key]:t.target.value})),onKeyDown:e=>{e.key===`Enter`&&(e.preventDefault(),d())}})]},e.key)),n.hint?(0,Y.jsx)(`p`,{className:`text-[13px] text-ink-3`,children:n.hint}):null,l?(0,Y.jsx)(`p`,{className:`text-[13px] text-rose`,children:l}):null,(0,Y.jsxs)(`div`,{className:`flex justify-end gap-2`,children:[(0,Y.jsx)(G,{variant:`ghost`,size:`sm`,onClick:r,children:K(`common.cancel`)}),(0,Y.jsx)(G,{size:`sm`,busy:s,onClick:()=>void d(),children:K(`connect.go`)})]})]})}function Qt({runId:e,connection:t}){let[n,r]=(0,J.useState)(null),[i,o]=(0,J.useState)(null),[s,c]=(0,J.useState)(null);if(!t)return null;if(t.account){let n=t.connectors.find(e=>e.id===t.account?.connector)?.name??``;return(0,Y.jsxs)(`div`,{className:`flex items-center gap-3 rounded-xl bg-card p-3 ring-1 ring-input`,children:[(0,Y.jsx)(`div`,{className:`flex size-10 items-center justify-center rounded-full bg-moss-tint text-moss`,children:(0,Y.jsx)(j,{className:`size-5`})}),(0,Y.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,Y.jsx)(`div`,{className:`truncate font-medium text-[15px]`,children:t.account.label}),(0,Y.jsx)(`div`,{className:`text-[13px] text-ink-3`,children:K(`connect.connected`,{name:n})})]}),(0,Y.jsx)(U,{label:K(`connect.disconnect`),onClick:()=>void a.del(`/api/runs/${e}/connections/${t.id}`),children:(0,Y.jsx)(ot,{className:`size-4`})})]})}let l=async n=>{if(c(null),o(null),y(`signIn`)){try{let{url:r}=await a.post(`/api/runs/${e}/connections/${t.id}/oauth/${n.id}`);await b(`signIn`,{url:r})}catch(e){c(e.message)}return}let r=window.open(`about:blank`,`wizard-connect`,`width=540,height=700`);try{let{url:i}=await a.post(`/api/runs/${e}/connections/${t.id}/oauth/${n.id}`);r?r.location.replace(i):o(i)}catch(e){r?.close(),c(e.message)}},u=t.connectors.find(e=>e.id===n);return t.connectors.length?(0,Y.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(0,Y.jsx)(`div`,{className:`flex flex-wrap gap-2`,children:t.connectors.map(e=>(0,Y.jsxs)(`button`,{type:`button`,onClick:()=>e.auth===`oauth2`?void l(e):r(n===e.id?null:e.id),className:H(`inline-flex h-11 items-center gap-2 rounded-full px-4 font-medium text-[14px] ring-1 transition`,n===e.id?`bg-ember-veil text-ink ring-ember`:`bg-card text-ink-2 ring-input hover:text-ink hover:ring-ember`),children:[(0,Y.jsx)(L,{className:`size-4`}),` `,e.name]},e.id))}),u?(0,Y.jsx)(Zt,{runId:e,connectionId:t.id,connector:u,onCancel:()=>r(null)}):null,i?(0,Y.jsx)(`a`,{href:i,target:`_blank`,rel:`noreferrer`,className:`text-[14px] text-ember underline`,children:K(`connect.openLink`)}):null,s?(0,Y.jsx)(`p`,{className:`text-[13px] text-rose`,children:s}):null]}):(0,Y.jsx)(`p`,{className:`text-[14px] text-ink-3`,children:K(`connect.none`)})}function $t(e){return e==null?``:Array.isArray(e)?e.join(`, `):String(e)}function en(e,t){if(t.trim()===``)return null;if(e.type===`number`){let e=Number(t.replace(/\s/g,``).replace(`,`,`.`));return Number.isFinite(e)?e:t}return e.type===`boolean`?t===`true`:t}function $({column:e,value:t,boxed:n,onCommit:r}){let[i,a]=(0,J.useState)($t(t));(0,J.useEffect)(()=>a($t(t)),[t]);let o=H(`w-full min-w-0 rounded-md border border-transparent px-2 text-[13px] outline-none focus:border-ember focus:bg-card`,n?`h-11 bg-paper-2`:`h-9 bg-transparent hover:bg-paper-2 coarse:h-11`);return e.type===`boolean`?(0,Y.jsx)(`label`,{className:`flex size-9 cursor-pointer items-center justify-center coarse:size-11`,children:(0,Y.jsx)(`input`,{type:`checkbox`,"aria-label":e.name,checked:t===!0,onChange:e=>r(e.target.checked),className:`size-4 accent-[var(--ember)] coarse:size-6`})}):e.type===`select`&&!e.format.multiple&&!e.format.allowCustom?(0,Y.jsxs)(`select`,{value:i,onChange:e=>r(e.target.value||null),className:o,children:[(0,Y.jsx)(`option`,{value:``}),e.format.options.map(e=>(0,Y.jsx)(`option`,{value:e.id,children:e.label},e.id))]}):(0,Y.jsx)(`input`,{"aria-label":e.name,type:e.type===`date`&&e.format.kind===`date`?`date`:`text`,inputMode:e.type===`number`?`decimal`:void 0,enterKeyHint:`done`,autoComplete:`off`,value:i,onChange:e=>a(e.target.value),onBlur:()=>{i!==$t(t)&&r(en(e,i))},onKeyDown:e=>{e.key===`Enter`&&(e.preventDefault(),e.target.blur())},className:H(o,e.type===`number`&&`text-right tabular-nums`)})}function tn({runId:e,list:t,editable:n}){let{def:r,rows:i}=t,[s,c]=(0,J.useState)(null),[l,u]=(0,J.useState)({}),d=`/api/runs/${e}/lists/${r.id}/rows`,f=async e=>{c(null);try{await e()}catch(e){c(e instanceof o?e.message:String(e))}},p=()=>f(async()=>{await a.post(d,{cells:l}),u({})}),m=Object.values(l).some(e=>e!=null&&e!==``);if(!i.length&&!n)return(0,Y.jsx)(`p`,{className:`text-[14px] text-ink-3`,children:K(`list.empty`)});let h=(e,t)=>t===0||e.type===`text`&&e.format?.style===`multiline`,g=(e,t,n)=>void f(()=>a.patch(`${d}/${e}`,{cells:{[t]:n}}));return(0,Y.jsxs)(`div`,{children:[(0,Y.jsxs)(`div`,{className:`flex flex-col gap-2 sm:hidden`,children:[i.map(e=>(0,Y.jsxs)(`div`,{className:`rounded-lg bg-paper p-2 ring-1 ring-border-soft`,children:[(0,Y.jsx)(`div`,{className:`grid grid-cols-2 gap-x-2 gap-y-1.5`,children:r.columns.map((t,r)=>(0,Y.jsxs)(`div`,{className:H(`min-w-0`,h(t,r)&&`col-span-2`),children:[(0,Y.jsx)(`div`,{className:`px-1 pb-0.5 text-[11px] text-ink-3`,children:t.name}),n?(0,Y.jsx)($,{boxed:!0,column:t,value:e.cells[t.id],onCommit:n=>g(e.id,t.id,n)}):(0,Y.jsx)(`div`,{className:H(`break-words px-1 text-[14px]`,t.type===`number`&&`tabular-nums`),children:xt(t,e.cells[t.id],z)||`—`})]},t.id))}),n?(0,Y.jsx)(`div`,{className:`mt-1 flex justify-end`,children:(0,Y.jsx)(U,{label:K(`list.delete`),onClick:()=>void f(()=>a.del(`${d}/${e.id}`)),children:(0,Y.jsx)(R,{className:`size-4`})})}):null]},e.id)),n?(0,Y.jsxs)(`div`,{className:`rounded-lg border border-input border-dashed p-2`,children:[(0,Y.jsx)(`div`,{className:`grid grid-cols-2 gap-x-2 gap-y-1.5`,children:r.columns.map((e,t)=>(0,Y.jsxs)(`div`,{className:H(`min-w-0`,h(e,t)&&`col-span-2`),children:[(0,Y.jsx)(`div`,{className:`px-1 pb-0.5 text-[11px] text-ink-3`,children:e.name}),(0,Y.jsx)($,{boxed:!0,column:e,value:l[e.id],onCommit:t=>u(n=>({...n,[e.id]:t}))})]},e.id))}),(0,Y.jsx)(`div`,{className:`mt-2 flex justify-end`,children:(0,Y.jsxs)(G,{variant:`secondary`,size:`sm`,onClick:()=>m?void p():void 0,children:[(0,Y.jsx)(N,{className:`size-4`}),` `,K(`run.addRow`)]})})]}):null]}),(0,Y.jsx)(`div`,{className:`hidden overflow-x-auto rounded-lg ring-1 ring-border-soft sm:block`,children:(0,Y.jsxs)(`table`,{className:`w-full text-[13px]`,children:[(0,Y.jsx)(`thead`,{className:`bg-paper-2 text-ink-2`,children:(0,Y.jsxs)(`tr`,{children:[r.columns.map(e=>(0,Y.jsx)(`th`,{className:`whitespace-nowrap px-3 py-2 text-left font-medium`,children:e.name},e.id)),n?(0,Y.jsx)(`th`,{className:`w-10`}):null]})}),(0,Y.jsxs)(`tbody`,{children:[i.map(e=>(0,Y.jsxs)(`tr`,{className:`border-border-soft border-t align-top`,children:[r.columns.map(t=>(0,Y.jsx)(`td`,{className:H(`min-w-[7.5rem]`,n?`px-1 py-0.5`:`px-3 py-2`),children:n?(0,Y.jsx)($,{column:t,value:e.cells[t.id],onCommit:n=>g(e.id,t.id,n)}):(0,Y.jsx)(`span`,{className:H(t.type===`number`&&`tabular-nums`),children:xt(t,e.cells[t.id],z)})},t.id)),n?(0,Y.jsx)(`td`,{className:`px-1 py-0.5`,children:(0,Y.jsx)(U,{label:K(`list.delete`),className:`size-9`,onClick:()=>void f(()=>a.del(`${d}/${e.id}`)),children:(0,Y.jsx)(R,{className:`size-3.5`})})}):null]},e.id)),n?(0,Y.jsxs)(`tr`,{className:`border-border-soft border-t bg-paper`,children:[r.columns.map(e=>(0,Y.jsx)(`td`,{className:`px-1 py-0.5`,children:(0,Y.jsx)($,{column:e,value:l[e.id],onCommit:t=>u(n=>({...n,[e.id]:t}))})},e.id)),(0,Y.jsx)(`td`,{className:`px-1 py-0.5`,children:(0,Y.jsx)(U,{label:K(`run.addRow`),className:`size-9`,onClick:()=>m?void p():void 0,children:(0,Y.jsx)(N,{className:`size-4`})})})]}):null]})]})}),s?(0,Y.jsx)(`p`,{className:`mt-2 text-[13px] text-rose`,children:s}):null]})}function nn(e,t,n){let i=t.split(`/`).map(encodeURIComponent).join(`/`);return r(`/api/runs/${e}/store/files/${i}${n?`?inline=1`:``}`)}var rn=[`bg-paper-3 text-ink-3`,`bg-moss-tint text-moss`,`bg-rose-tint text-rose`,`bg-ember-tint text-ember-strong`];function an({runId:e,list:t}){let{def:n,rows:r}=t,i=n.columns.find(e=>e.id===n.check?.file),s=n.columns.find(e=>e.id===n.check?.status),c=s?.type===`select`?s.format.options:[],l=c[0]?.id,u=e=>s?String(e.cells[s.id]??l??``):``,d=e=>!s||u(e)===l,[f,p]=(0,J.useState)(()=>(r.find(d)??r[0])?.id??null),[m,h]=(0,J.useState)(!1),[g,_]=(0,J.useState)(null),v=`/api/runs/${e}/lists/${n.id}/rows`,y=r.find(e=>e.id===f)??r[0],b=m?r.filter(e=>d(e)||e.id===y?.id):r,x=r.filter(e=>!d(e)).length,S=n.columns.filter(e=>e!==i&&e!==s),C=S.filter(e=>e.id!==n.key),w=C.find(e=>e.type===`text`)??C[0],T=C.filter(e=>e!==w),E=async(e,t)=>{_(null);try{await a.patch(`${v}/${e}`,{cells:t})}catch(e){_(e instanceof o?e.message:String(e))}},D=e=>{let t=b.findIndex(e=>e.id===y?.id),n=b[Math.min(b.length-1,Math.max(0,t+e))];n&&p(n.id)},O=async e=>{if(!y||!s)return;let t=r.findIndex(e=>e.id===y.id),n=[...r.slice(t+1),...r.slice(0,t)].find(d);await E(y.id,{[s.id]:e}),n&&e!==l&&p(n.id)},k=e=>{e.target.closest(`input, textarea, select`)||(e.key===`ArrowDown`||e.key===`ArrowUp`?(e.preventDefault(),D(e.key===`ArrowDown`?1:-1)):/^[1-9]$/.test(e.key)&&c[Number(e.key)]&&(e.preventDefault(),O(c[Number(e.key)].id)))};if(!r.length)return(0,Y.jsx)(`p`,{className:`text-[14px] text-ink-3`,children:K(`list.empty`)});let A=i&&y?String(y.cells[i.id]??``).trim():``,M=A.split(`.`).pop()?.toLowerCase()??``,N=e=>rn[Math.min(Math.max(0,c.findIndex(t=>t.id===u(e))),3)];return(0,Y.jsxs)(`div`,{className:`grid gap-4 lg:grid-cols-[minmax(280px,360px)_minmax(0,1fr)]`,onKeyDown:k,children:[(0,Y.jsxs)(`div`,{className:`flex min-h-0 flex-col`,children:[(0,Y.jsxs)(`div`,{className:`mb-2 flex items-center justify-between gap-2`,children:[(0,Y.jsx)(`span`,{className:`text-[13px] text-ink-3 tabular-nums`,children:K(`check.progress`,{done:x,total:r.length})}),s?(0,Y.jsx)(`button`,{type:`button`,"aria-pressed":m,onClick:()=>h(e=>!e),className:H(`inline-flex h-8 items-center rounded-full px-3 text-[13px] ring-1 transition coarse:h-11`,m?`bg-ember-tint text-ink ring-ember`:`bg-card text-ink-2 ring-input hover:text-ink`),children:K(`check.onlyOpen`)}):null]}),(0,Y.jsx)(`ul`,{className:`flex max-h-[38vh] flex-col gap-1.5 overflow-y-auto p-0.5 pr-1 lg:max-h-[calc(100vh-15rem)]`,children:b.map(e=>(0,Y.jsx)(`li`,{children:(0,Y.jsxs)(`button`,{type:`button`,onClick:()=>p(e.id),"aria-current":e.id===y?.id,className:H(`flex w-full items-center gap-3 rounded-lg px-3 py-2.5 text-left ring-1 transition`,e.id===y?.id?`bg-card shadow-soft ring-ember`:`bg-paper ring-border-soft hover:bg-card`),children:[(0,Y.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[(0,Y.jsx)(`span`,{className:`block truncate font-medium text-[14px]`,children:w&&xt(w,e.cells[w.id],z)||`—`}),(0,Y.jsx)(`span`,{className:`block truncate text-[12px] text-ink-3 tabular-nums`,children:T.slice(0,2).map(t=>xt(t,e.cells[t.id],z)).filter(Boolean).join(` · `)})]}),s?(0,Y.jsx)(`span`,{className:H(`shrink-0 rounded-full px-2 py-0.5 font-medium text-[11px]`,N(e)),children:c.find(t=>t.id===u(e))?.label??u(e)}):null]})},e.id))})]}),y?(0,Y.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-3`,children:[c.length>1?(0,Y.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[c.slice(1).map((e,t)=>(0,Y.jsxs)(G,{size:`md`,variant:u(y)===e.id?`primary`:`secondary`,onClick:()=>void O(e.id),children:[u(y)===e.id?(0,Y.jsx)(j,{className:`size-4`}):null,e.label,(0,Y.jsx)(`kbd`,{className:`ml-1 hidden rounded bg-black/10 px-1.5 text-[11px] lg:inline`,children:t+1})]},e.id)),u(y)===l?null:(0,Y.jsx)(G,{size:`md`,variant:`ghost`,onClick:()=>void O(l??``),children:K(`check.reopen`)})]}):null,(0,Y.jsx)(`div`,{className:`overflow-hidden rounded-lg bg-paper-2 ring-1 ring-border-soft`,children:A?(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsxs)(`div`,{className:`flex items-center gap-2 border-border-soft border-b bg-card px-3 py-2 text-[13px]`,children:[(0,Y.jsx)(F,{className:`size-3.5 shrink-0 text-ink-3`}),(0,Y.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:A.split(`/`).pop()}),(0,Y.jsx)(`a`,{href:nn(e,A,M===`pdf`),target:`_blank`,rel:`noreferrer`,className:`shrink-0 text-ink-2 underline-offset-2 hover:text-ink hover:underline`,children:K(`run.openFull`)})]}),M===`pdf`?(0,Y.jsx)(`iframe`,{title:A,src:`${nn(e,A,!0)}#toolbar=0&navpanes=0&view=FitH`,className:`h-[46vh] w-full border-0 bg-white lg:h-[calc(100vh-27rem)] lg:min-h-[360px]`},A):[`png`,`jpg`,`jpeg`,`webp`].includes(M)?(0,Y.jsx)(`div`,{className:`flex max-h-[46vh] justify-center overflow-auto bg-white lg:max-h-[calc(100vh-27rem)]`,children:(0,Y.jsx)(`img`,{src:nn(e,A,!0),alt:A,className:`max-w-full object-contain`},A)}):(0,Y.jsx)(`p`,{className:`px-4 py-10 text-center text-[14px] text-ink-3`,children:K(`check.noPreview`)})]}):(0,Y.jsx)(`p`,{className:`px-4 py-14 text-center text-[14px] text-ink-3`,children:K(`check.noFile`)})}),(0,Y.jsx)(`div`,{className:`grid grid-cols-2 gap-x-3 gap-y-2 sm:grid-cols-3`,children:S.map(e=>(0,Y.jsxs)(`div`,{className:H(`min-w-0`,e.type===`text`&&e.format?.style===`multiline`&&`col-span-full`),children:[(0,Y.jsx)(`div`,{className:`px-1 pb-0.5 text-[11px] text-ink-3`,children:e.name}),(0,Y.jsx)($,{boxed:!0,column:e,value:y.cells[e.id],onCommit:t=>void E(y.id,{[e.id]:t})})]},e.id))}),g?(0,Y.jsx)(`p`,{className:`text-[13px] text-rose`,children:g}):null]}):null]})}var on={xlsx:`Excel`,csv:`CSV`,json:`JSON`,md:`Markdown`,zip:`ZIP`};function sn({runId:e,list:t}){return(0,Y.jsx)(`div`,{className:`flex flex-wrap gap-2`,children:t.formats.map(n=>(0,Y.jsx)(`a`,{href:r(`/api/runs/${e}/lists/${t.def.id}/download?format=${n}`),className:`inline-flex h-9 items-center rounded-full bg-paper-2 px-3.5 font-medium text-[13px] text-ink-2 transition hover:bg-paper-3 hover:text-ink coarse:h-11 coarse:px-4`,children:on[n]??n},n))})}function cn(e){return e>1e6?`${(e/1e6).toFixed(1)} MB`:`${Math.max(1,Math.round(e/1e3))} KB`}function ln({runId:e}){let[t,n]=(0,J.useState)(!1),[i,o]=(0,J.useState)(null),[s,c]=(0,J.useState)(!1);(0,J.useEffect)(()=>{t&&(c(!1),a.get(`/api/runs/${e}/store`).then(o))},[t,e]);let l=i&&!i.files.length&&!i.connections.length&&!i.keepsSignIns&&i.lists.every(e=>!e.rows);return(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsxs)(`button`,{type:`button`,onClick:()=>n(!0),className:`inline-flex items-center gap-1.5 text-[13px] text-ink-4 transition hover:text-ink-2 coarse:min-h-11`,children:[(0,Y.jsx)(we,{className:`size-3.5`}),` `,K(`store.open`)]}),(0,Y.jsx)(ie,{open:t,onClose:()=>n(!1),title:K(`store.title`),wide:!0,children:i?(0,Y.jsxs)(`div`,{className:`flex flex-col gap-5 text-[14px]`,children:[(0,Y.jsx)(`p`,{className:`text-ink-3`,children:K(`store.explain`)}),l?(0,Y.jsx)(`p`,{className:`text-ink-2`,children:K(`store.empty`)}):null,i.lists.some(e=>e.rows)?(0,Y.jsx)(`ul`,{className:`flex flex-col gap-1`,children:i.lists.filter(e=>e.rows).map(e=>(0,Y.jsxs)(`li`,{className:`flex justify-between gap-3`,children:[(0,Y.jsx)(`span`,{children:e.title}),(0,Y.jsx)(`span`,{className:`text-ink-3 tabular-nums`,children:K(`store.rows`,{n:e.rows})})]},e.id))}):null,i.connections.map(e=>(0,Y.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,Y.jsx)(L,{className:`size-4 text-ink-3`}),` `,e.account?.label]},e.id)),i.keepsSignIns?(0,Y.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,Y.jsx)(j,{className:`size-4 text-ink-3`}),` `,K(`store.signIns`)]}):null,i.files.length?(0,Y.jsxs)(`div`,{children:[(0,Y.jsx)(`div`,{className:`mb-1 text-ink-3`,children:K(`store.files`,{n:i.files.length,size:cn(i.files.reduce((e,t)=>e+t.size,0))})}),(0,Y.jsx)(`ul`,{className:`max-h-56 overflow-y-auto rounded-lg ring-1 ring-border-soft`,children:i.files.map(t=>(0,Y.jsx)(`li`,{className:`border-border-soft border-b last:border-0`,children:(0,Y.jsxs)(`a`,{href:r(`/api/runs/${e}/store/files/${t.path}`),className:`flex items-center gap-2 px-3 py-2 text-[13px] hover:bg-paper-2 coarse:min-h-11`,title:t.source??void 0,children:[(0,Y.jsx)(F,{className:`size-3.5 shrink-0 text-ink-3`}),(0,Y.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:t.path}),(0,Y.jsx)(`span`,{className:`text-ink-4 tabular-nums`,children:cn(t.size)})]})},t.path))})]}):null,(0,Y.jsxs)(`div`,{className:`flex items-center justify-between gap-3 pt-1`,children:[l?(0,Y.jsx)(`span`,{}):s?(0,Y.jsxs)(G,{variant:`secondary`,onClick:async()=>{await a.del(`/api/runs/${e}/store`),o(await a.get(`/api/runs/${e}/store`)),c(!1)},children:[(0,Y.jsx)(R,{className:`size-4`}),` `,K(`store.confirmDelete`)]}):(0,Y.jsxs)(G,{variant:`ghost`,onClick:()=>c(!0),children:[(0,Y.jsx)(R,{className:`size-4`}),` `,K(`store.delete`)]}),(0,Y.jsx)(G,{onClick:()=>n(!1),children:K(`common.close`)})]})]}):(0,Y.jsx)(`div`,{className:`flex justify-center py-8 text-ink-4`,children:(0,Y.jsx)(V,{})})})]})}var un=300;function dn(){if(typeof MediaRecorder<`u`)return[`audio/webm;codecs=opus`,`audio/mp4`,`audio/webm`,`audio/ogg;codecs=opus`].find(e=>MediaRecorder.isTypeSupported(e))}function fn(e){return`${Math.floor(e/60)}:${String(Math.floor(e%60)).padStart(2,`0`)}`}function pn({value:e,runId:t,onChange:n,onBusy:r}){let i=fe(e)?e:null,[o,s]=(0,J.useState)(null),[c,l]=(0,J.useState)(0),[u,d]=(0,J.useState)(!1),[f,p]=(0,J.useState)(null),[h,g]=(0,J.useState)(!1),[_,v]=(0,J.useState)(null),y=(0,J.useRef)(null),b=(0,J.useRef)(null),x=dn(),S=m&&!!x;(0,J.useEffect)(()=>()=>{y.current&&(y.current.recorder.onstop=null,y.current.stop())},[]),(0,J.useEffect)(()=>()=>{_&&URL.revokeObjectURL(_.url)},[_]);let C=async(e,i)=>{d(!0),r?.(!0),p(null);try{let r=await a.upload(`/api/runs/${t}/uploads`,e);v({asset:r.id,url:URL.createObjectURL(e)}),n({asset:r.id,...i===void 0?{}:{seconds:i}})}catch(e){p(e.message)}finally{d(!1),r?.(!1)}},w=async()=>{p(null),g(!1);let e;try{e=await navigator.mediaDevices.getUserMedia({audio:{echoCancellation:!0,noiseSuppression:!0}})}catch{g(!0);return}let t=[],n=new MediaRecorder(e,{mimeType:x,audioBitsPerSecond:48e3}),i=Date.now(),a=new AudioContext,o=a.createAnalyser();o.fftSize=256,a.createMediaStreamSource(e).connect(o);let c=new Uint8Array(o.fftSize),u=0,d=()=>{o.getByteTimeDomainData(c);let e=0;for(let t of c)e=Math.max(e,Math.abs(t-128));if(l(Math.min(1,e/64)),s((Date.now()-i)/1e3),(Date.now()-i)/1e3>=un){f();return}u=requestAnimationFrame(d)},f=()=>{cancelAnimationFrame(u),n.state!==`inactive`&&n.stop();for(let t of e.getTracks())t.stop();a.close().catch(()=>void 0),y.current=null,s(null),l(0)};n.ondataavailable=e=>e.data.size&&t.push(e.data),n.onstop=()=>{let e=(n.mimeType||x||`audio/webm`).split(`;`)[0],r=e===`audio/mp4`?`m4a`:e===`audio/ogg`?`ogg`:`webm`,a=Math.max(1,Math.round((Date.now()-i)/1e3));C(new File(t,`sprachnotiz-${wt()}.${r}`,{type:e}),a)},y.current={recorder:n,stop:f},r?.(!0),n.start(1e3),u=requestAnimationFrame(d)},T=o!==null,E=(0,Y.jsxs)(G,{variant:`secondary`,onClick:()=>b.current?.click(),children:[(0,Y.jsx)(Oe,{className:`size-4`}),` `,K(`voice.pick`)]});return(0,Y.jsxs)(`div`,{children:[T?(0,Y.jsxs)(`div`,{className:`flex items-center gap-3 rounded-xl bg-card p-3 ring-1 ring-ember`,children:[(0,Y.jsxs)(`span`,{className:`relative flex size-11 shrink-0 items-center justify-center`,children:[(0,Y.jsx)(`span`,{className:`absolute inset-0 rounded-full bg-rose-tint transition-transform duration-75`,style:{transform:`scale(${.7+c*.5})`}}),(0,Y.jsx)(`span`,{className:`relative size-3.5 animate-pulse-dot rounded-full bg-rose`})]}),(0,Y.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,Y.jsx)(`div`,{className:`font-medium text-[15px] tabular-nums`,children:fn(o)}),(0,Y.jsx)(`div`,{className:`text-[13px] text-ink-3`,children:o>270?K(`voice.left`,{s:Math.ceil(un-o)}):K(`voice.recording`)})]}),(0,Y.jsxs)(G,{onClick:()=>y.current?.stop(),children:[(0,Y.jsx)(A,{className:`size-3.5 fill-current`}),` `,K(`voice.stop`)]})]}):u?(0,Y.jsxs)(`div`,{className:`flex items-center gap-3 rounded-xl bg-card p-4 text-[14px] text-ink-3 ring-1 ring-input`,children:[(0,Y.jsx)(V,{className:`size-4`}),` `,K(`run.uploading`)]}):i?(0,Y.jsxs)(`div`,{className:`rounded-xl bg-card p-3 ring-1 ring-input`,children:[(0,Y.jsx)(`audio`,{controls:!0,preload:`metadata`,src:_?.asset===i.asset?_.url:`/api/runs/${t}/assets/${i.asset}`,className:`h-11 w-full`}),i.transcript?(0,Y.jsx)(`p`,{className:`mt-2 whitespace-pre-wrap px-1 text-[14px] text-ink-2 leading-relaxed`,children:i.transcript}):null,(0,Y.jsxs)(`div`,{className:`mt-2 flex flex-wrap items-center justify-between gap-2`,children:[(0,Y.jsx)(`span`,{className:`px-1 text-[13px] text-ink-3`,children:i.seconds?fn(i.seconds):null}),(0,Y.jsxs)(`div`,{className:`flex gap-1`,children:[S?(0,Y.jsxs)(G,{variant:`ghost`,size:`sm`,onClick:()=>void w(),children:[(0,Y.jsx)(Je,{className:`size-3.5`}),` `,K(`voice.again`)]}):null,(0,Y.jsx)(G,{variant:`ghost`,size:`sm`,onClick:()=>n(void 0),children:K(`voice.remove`)})]})]})]}):(0,Y.jsxs)(`div`,{children:[(0,Y.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[S?(0,Y.jsxs)(G,{variant:`secondary`,size:`lg`,onClick:()=>void w(),className:`w-full sm:w-auto`,children:[(0,Y.jsx)(I,{className:`size-4`}),` `,K(`voice.start`)]}):E,S&&h?E:null]}),h?(0,Y.jsx)(`p`,{className:`mt-2 rounded-lg bg-amber-tint px-3 py-2 text-[13px] text-ink-2 leading-relaxed`,children:K(`voice.denied`)}):(0,Y.jsx)(`p`,{className:`mt-2 text-[13px] text-ink-3 leading-relaxed`,children:K(S?`voice.why`:`voice.noRecorder`)})]}),(0,Y.jsx)(`input`,{ref:b,type:`file`,hidden:!0,accept:`audio/*`,capture:!0,onChange:e=>{let t=e.target.files?.[0];e.target.value=``,t&&C(t,void 0)}}),f?(0,Y.jsx)(`div`,{className:`mt-2 text-[13px] text-rose`,children:f}):null]})}function mn(e,t){try{return new Intl.NumberFormat(void 0,{style:`currency`,currency:t}).format(e)}catch{return`${e.toFixed(2)} ${t}`}}function hn({field:e,value:t,values:n,onChange:r}){let i=e.columns??[],a=Array.isArray(t)&&t.length?t:[{}],o=de(e,a,n),s=(e,t,n)=>{r(a.map((r,i)=>i===e?{...r,[t]:n}:r))},c=i.map(e=>e.kind===`text`&&e===i[0]?`minmax(0,3fr)`:`minmax(0,1fr)`).join(` `);return(0,Y.jsxs)(`div`,{className:`rounded-xl bg-card p-2 ring-1 ring-input`,children:[(0,Y.jsx)(`div`,{className:`hidden gap-2 px-2 pt-1 pb-2 text-[12px] text-ink-3 sm:grid`,style:{gridTemplateColumns:`${c} 36px`},children:i.map(e=>(0,Y.jsx)(`div`,{className:e.kind===`text`?``:`text-right`,children:e.label},e.id))}),(0,Y.jsx)(`div`,{className:`flex flex-col gap-2`,children:a.map((e,t)=>(0,Y.jsxs)(`div`,{className:`grid grid-cols-6 gap-2 rounded-lg bg-paper p-2 sm:bg-transparent sm:p-0 sm:[grid-template-columns:var(--cols)]`,style:{"--cols":`${c} 36px`},children:[i.map((n,r)=>(0,Y.jsxs)(`label`,{className:H(`flex min-w-0 flex-col gap-1 sm:col-span-1`,r===0?`col-span-5`:i.length-1<=2?`col-span-3`:`col-span-2`),children:[(0,Y.jsx)(`span`,{className:`px-0.5 text-[11px] text-ink-3 sm:hidden`,children:n.label}),(0,Y.jsx)(`input`,{"aria-label":n.label,placeholder:n.label,inputMode:n.kind===`text`?`text`:`decimal`,autoComplete:`off`,value:String(e[n.id]??``),onChange:e=>s(t,n.id,e.target.value),className:H(`h-11 w-full min-w-0 rounded-md border border-transparent bg-paper-2 px-2.5 text-[14px] outline-none placeholder:text-transparent focus:border-focus focus:bg-card sm:placeholder:text-ink-4`,n.kind!==`text`&&`text-right tabular-nums`)})]},n.id)),(0,Y.jsx)(U,{label:K(`list.delete`),onClick:()=>r(a.filter((e,n)=>n!==t)),className:`order-first col-start-6 row-start-1 size-11 justify-self-end self-end sm:order-none sm:col-start-auto sm:row-start-auto`,children:(0,Y.jsx)(R,{className:`size-4`})})]},t))}),(0,Y.jsxs)(`div`,{className:`mt-2 flex flex-wrap items-end justify-between gap-3 px-2 pb-1`,children:[(0,Y.jsxs)(`button`,{type:`button`,onClick:()=>r([...a,{}]),className:`inline-flex h-9 items-center gap-1.5 rounded-full px-3 text-[13px] text-ink-2 hover:bg-accent coarse:h-11`,children:[(0,Y.jsx)(N,{className:`size-4`}),` `,K(`run.addRow`)]}),(0,Y.jsxs)(`div`,{className:`text-right text-[13px] tabular-nums`,children:[(0,Y.jsxs)(`div`,{className:`text-ink-3`,children:[K(`run.net`),` `,mn(o.net,o.currency)]}),o.vatRate?(0,Y.jsxs)(`div`,{className:`text-ink-3`,children:[K(`run.vat`,{r:o.vatRate}),` `,mn(o.vat,o.currency)]}):null,(0,Y.jsxs)(`div`,{className:`font-semibold text-[15px] text-ink`,children:[K(`run.total`),` `,mn(o.gross,o.currency)]})]})]})]})}function gn(e){return!!e?.closest(`input, textarea, [contenteditable='true']`)}function _n({field:e,value:t,runId:n,onChange:i,onBusy:o}){let s=(0,J.useRef)(null),c=(0,J.useRef)(null),l=(0,J.useRef)(null),u=(0,J.useRef)(null),[d,p]=(0,J.useState)(!1),[h,_]=(0,J.useState)({}),[v,y]=(0,J.useState)(null),[b,x]=(0,J.useState)(!1),[S,C]=(0,J.useState)(!1),[w,T]=(0,J.useState)(null),E=(0,J.useRef)(null),D=e=>{E.current=e,T(e)},k=e.kind===`image`,A=!!e.multiple,j=A?e.max??30:1,M=k||!!e.camera||!!e.video,N=!k&&!!e.video,P=Array.isArray(t)?t:typeof t==`string`&&t?[t]:[],F=(0,J.useRef)(P);F.current=P;let I=P.length<j,L=async e=>{let t=(k?e.filter(e=>e.type.startsWith(`image/`)):e).sort((e,t)=>e.name.localeCompare(t.name,void 0,{numeric:!0}));if(!t.length)return;let r=j-(A?F.current.length:0);p(!0),o?.(!0),y(t.length>r&&A?K(`run.maxFiles`,{n:j}):null);try{for(let e of t.slice(0,Math.max(0,r))){let t=await Ct(e),r=await a.upload(`/api/runs/${n}/uploads`,t);_(e=>({...e,[r.id]:{name:r.name,mime:r.mime}}));let o=A?[...F.current,r.id]:r.id;F.current=A?o:[r.id],i(o)}}catch(e){y(e.message)}finally{p(!1),o?.(!1)}},R=(0,J.useRef)(L);R.current=L;let ee=e=>{let t=P.filter(t=>t!==e);i(A?t:void 0)},te=(e,t)=>{let n=F.current.indexOf(e),r=Math.min(F.current.length-1,Math.max(0,t));if(n<0||n===r)return;let a=F.current.filter(t=>t!==e);a.splice(r,0,e),F.current=a,i(a)},z=A&&P.length>1;(0,J.useEffect)(()=>{if(!I)return;let e=e=>{let t=Array.from(e.clipboardData?.files??[]),n=s.current;if(!t.length||!n||gn(document.activeElement))return;let r=document.querySelectorAll(`[data-upload-field]`);(n.matches(`:hover`)||n.contains(document.activeElement)||r.length===1)&&(e.preventDefault(),R.current(t))};return document.addEventListener(`paste`,e),()=>document.removeEventListener(`paste`,e)},[I]);let B=H(`flex flex-col items-center justify-center gap-2 rounded-xl border border-input border-dashed bg-card px-3 text-[14px] text-ink-3 transition hover:border-ember hover:text-ink`,P.length?`py-4`:`py-8`);return(0,Y.jsxs)(`div`,{ref:s,"data-upload-field":``,onDragOver:e=>{I&&(e.preventDefault(),C(!0))},onDragLeave:()=>C(!1),onDrop:e=>{C(!1),I&&(e.preventDefault(),L(Array.from(e.dataTransfer.files)))},children:[P.length?(0,Y.jsx)(`div`,{className:`mb-2 flex flex-col gap-2`,children:P.map((e,t)=>{let i=h[e],a=i?.mime??(k?`image/`:``);return(0,Y.jsxs)(`div`,{"data-file-id":e,className:H(`flex items-center gap-3 rounded-xl bg-card p-2 ring-1 ring-input transition-shadow`,w===e&&`relative z-10 shadow-elevated ring-2 ring-ember`),children:[z?(0,Y.jsxs)(`button`,{type:`button`,"aria-label":K(`run.moveFile`,{n:t+1}),title:K(`run.moveFileHint`),className:H(`-mr-1 flex h-14 w-9 shrink-0 touch-none flex-col items-center justify-center gap-0.5 rounded-lg text-ink-3 hover:bg-paper-2 hover:text-ink`,w===e?`cursor-grabbing`:`cursor-grab`),onPointerDown:t=>{try{t.currentTarget.setPointerCapture(t.pointerId)}catch{}D(e)},onPointerMove:t=>{if(E.current!==e)return;let n=document.elementFromPoint(t.clientX,t.clientY)?.closest(`[data-file-id]`),r=n?.getAttribute(`data-file-id`);r&&r!==e&&s.current?.contains(n??null)&&te(e,F.current.indexOf(r))},onPointerUp:()=>D(null),onPointerCancel:()=>D(null),onKeyDown:n=>{(n.key===`ArrowUp`||n.key===`ArrowDown`)&&(n.preventDefault(),te(e,t+(n.key===`ArrowUp`?-1:1)))},children:[(0,Y.jsx)(`span`,{className:`font-medium text-[12px] tabular-nums`,children:t+1}),(0,Y.jsx)(Pe,{className:`size-4`})]}):null,a.startsWith(`image/`)?(0,Y.jsx)(`img`,{src:r(`/api/runs/${n}/assets/${e}`),alt:``,className:`size-14 rounded-lg object-cover`}):(0,Y.jsx)(`div`,{className:`flex size-12 shrink-0 items-center justify-center rounded-lg bg-paper-2`,children:a.startsWith(`video/`)?(0,Y.jsx)(O,{className:`size-5 text-ink-3`}):(0,Y.jsx)(f,{className:`size-5 text-ink-3`})}),(0,Y.jsx)(`div`,{className:`min-w-0 flex-1 truncate text-[14px]`,children:i?.name??`✓`}),(0,Y.jsx)(U,{label:K(`run.removeFile`),onClick:()=>ee(e),children:(0,Y.jsx)(q,{className:`size-4`})})]},e)})}):null,I?(0,Y.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[(0,Y.jsxs)(`button`,{type:`button`,onClick:()=>c.current?.click(),className:H(B,`min-w-[9rem] flex-1 px-4`,S&&`border-ember text-ink`),children:[k?(0,Y.jsx)(Ie,{className:`size-6`}):(0,Y.jsx)(f,{className:`size-6`}),d?K(`run.uploading`):P.length?K(`run.uploadMore`):K(g?`run.uploadTouch`:`run.upload`)]}),M?(0,Y.jsxs)(`button`,{type:`button`,onClick:()=>m?x(!0):l.current?.click(),className:H(B,`w-28`),children:[(0,Y.jsx)(be,{className:`size-6`}),K(`run.camera`)]}):null,N&&!(m&&Pt)?(0,Y.jsxs)(`button`,{type:`button`,onClick:()=>u.current?.click(),className:H(B,`w-28`),children:[(0,Y.jsx)(ne,{className:`size-6`}),K(`camera.video`)]}):null]}):null,(0,Y.jsx)(`input`,{ref:c,type:`file`,hidden:!0,multiple:A,accept:k?`image/*`:void 0,onChange:e=>{L(Array.from(e.target.files??[])),e.target.value=``}}),(0,Y.jsx)(`input`,{ref:l,type:`file`,hidden:!0,accept:`image/*`,capture:`environment`,onChange:e=>{L(Array.from(e.target.files??[])),e.target.value=``}}),N?(0,Y.jsx)(`input`,{ref:u,type:`file`,hidden:!0,accept:`video/*`,capture:`environment`,onChange:e=>{L(Array.from(e.target.files??[])),e.target.value=``}}):null,(0,Y.jsx)(Ft,{open:b,multiple:A,video:N,onClose:()=>x(!1),onCapture:e=>L([e]),onNative:()=>l.current?.click()}),A&&(e.min||e.max)?(0,Y.jsx)(`div`,{className:`mt-2 text-[13px] text-ink-3 tabular-nums`,children:e.min&&P.length<e.min?K(`run.filesMin`,{n:P.length,min:e.min}):e.max?K(`run.filesOf`,{n:P.length,max:e.max}):null}):null,v?(0,Y.jsx)(`div`,{className:`mt-2 text-[13px] text-rose`,children:v}):null]})}function vn(e){let t=`${e.id} ${e.label}`.toLowerCase();return/telefon|phone|handy|mobil(?!it)|\btel\b|rückruf/.test(t)?{type:`tel`,inputMode:`tel`,autoComplete:`tel`}:/\bplz\b|postleitzahl|postal|zip/.test(t)?{inputMode:`numeric`,autoComplete:`postal-code`}:/iban/.test(t)?{autoCapitalize:`characters`,autoCorrect:`off`,spellCheck:!1}:/vorname|first.?name/.test(t)?{autoComplete:`given-name`,autoCapitalize:`words`}:/nachname|last.?name|surname/.test(t)?{autoComplete:`family-name`,autoCapitalize:`words`}:/firma|unternehmen|company|organi[sz]ation/.test(t)?{autoComplete:`organization`,autoCapitalize:`words`}:/straße|strasse|street|anschrift|adresse|address/.test(t)?{autoComplete:`street-address`,autoCapitalize:`words`}:/\b(ort|stadt|city|town)\b/.test(t)?{autoComplete:`address-level2`,autoCapitalize:`words`}:/\bname\b|ansprechp/.test(t)?{autoComplete:`name`,autoCapitalize:`words`}:{autoCapitalize:`sentences`}}function yn({field:e,value:t,onChange:n}){let[r,i]=(0,J.useState)(!1);return(0,Y.jsxs)(`div`,{className:`flex gap-2`,children:[(0,Y.jsx)(W,{value:t,placeholder:e.placeholder,autoCapitalize:`off`,autoCorrect:`off`,spellCheck:!1,onChange:e=>n(e.target.value)}),(0,Y.jsxs)(`button`,{type:`button`,onClick:()=>i(!0),className:`inline-flex h-11 shrink-0 items-center gap-2 rounded-lg border border-input bg-card px-3.5 font-medium text-[14px] text-ink-2 transition hover:border-ember hover:text-ink`,children:[(0,Y.jsx)(Xe,{className:`size-4`}),` `,K(`scan.button`)]}),(0,Y.jsx)(Ut,{open:r,onClose:()=>i(!1),onResult:n})]})}function bn({field:e,value:t,values:n,runId:r,view:i,onChange:a,onBusy:o,error:s}){let c=t==null?``:String(t),l;switch(e.kind){case`textarea`:l=(0,Y.jsx)(oe,{value:c,placeholder:e.placeholder,autoCapitalize:`sentences`,enterKeyHint:`enter`,onChange:e=>a(e.target.value)});break;case`number`:l=(0,Y.jsx)(W,{inputMode:`decimal`,autoComplete:`off`,value:c,placeholder:e.placeholder,onChange:e=>a(e.target.value)});break;case`select`:{let t=e.options??[];l=t.length<=5&&t.every(e=>e.length<=28)?(0,Y.jsx)(ae,{value:c,options:t,onChange:a}):(0,Y.jsx)(le,{value:c,placeholder:`—`,onChange:a,options:t.map(e=>({value:e,label:e}))});break}case`multiselect`:l=(0,Y.jsx)(ae,{multi:!0,value:Array.isArray(t)?t:[],options:e.options??[],onChange:a});break;case`date`:l=(0,Y.jsx)(W,{type:`date`,value:c,onChange:e=>a(e.target.value),className:`w-full sm:w-56`});break;case`email`:l=(0,Y.jsx)(W,{type:`email`,inputMode:`email`,autoComplete:`email`,autoCapitalize:`off`,autoCorrect:`off`,spellCheck:!1,value:c,placeholder:e.placeholder,onChange:e=>a(e.target.value)});break;case`url`:l=(0,Y.jsx)(W,{type:`url`,inputMode:`url`,autoComplete:`url`,autoCapitalize:`off`,autoCorrect:`off`,spellCheck:!1,value:c,placeholder:e.placeholder??`https://`,onChange:e=>a(e.target.value)});break;case`toggle`:l=(0,Y.jsx)(ce,{checked:t===!0,onChange:a,label:e.label});break;case`color`:l=(0,Y.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,Y.jsx)(re,{value:c||`#e0531b`,onChange:e=>a(e.target.value)}),(0,Y.jsx)(W,{value:c,placeholder:`#e0531b`,autoCapitalize:`off`,autoCorrect:`off`,spellCheck:!1,onChange:e=>a(e.target.value),className:`w-36`})]});break;case`image`:case`file`:l=(0,Y.jsx)(_n,{field:e,value:t,runId:r,onChange:a,onBusy:o});break;case`items`:l=(0,Y.jsx)(hn,{field:e,value:t,values:n,onChange:a});break;case`connection`:l=(0,Y.jsx)(Qt,{runId:r,connection:i?.connections.find(t=>t.id===e.connection)});break;case`list`:{let t=i?.lists.find(t=>t.def.id===e.list);l=t?(0,Y.jsx)(tn,{runId:r,list:t,editable:!0}):null;break}case`location`:l=(0,Y.jsx)(zt,{value:t,runId:r,placeholder:e.placeholder,onChange:a,onBusy:o});break;case`audio`:l=(0,Y.jsx)(pn,{value:t,runId:r,onChange:a,onBusy:o});break;case`signature`:l=(0,Y.jsx)(Xt,{label:e.label,value:t,runId:r,onChange:a});break;default:l=e.scan?(0,Y.jsx)(yn,{field:e,value:c,onChange:a}):(0,Y.jsx)(W,{...vn(e),value:c,placeholder:e.placeholder,onChange:e=>a(e.target.value)})}return(0,Y.jsxs)(`div`,{children:[e.kind===`toggle`?(0,Y.jsxs)(`div`,{className:`flex items-start justify-between gap-6`,children:[(0,Y.jsx)(B,{hint:e.help,children:e.label}),l]}):(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(B,{hint:e.help,required:e.required,children:e.label}),l]}),s?(0,Y.jsx)(`div`,{className:`mt-1.5 text-[13px] text-rose`,children:s}):null]})}var xn=45e3;function Sn(e){let[t,n]=(0,J.useState)(null),[i,s]=(0,J.useState)(null),[c,l]=(0,J.useState)(!1),[u,d]=(0,J.useState)(!1),[f,p]=(0,J.useState)({});(0,J.useEffect)(()=>{if(n(null),l(!1),!e)return;let t=!1,i=0,s,c=null,u=Date.now(),d=()=>{t=!0,c?.close(),l(!0)},f=async()=>{try{let r=await a.get(`/api/runs/${e}`);t||n(r)}catch(e){e instanceof o&&e.status===404&&d()}},p=()=>{if(clearTimeout(s),c?.close(),t)return;let a=new EventSource(r(`/api/runs/${e}/stream`),{withCredentials:!0});c=a,u=Date.now(),a.addEventListener(`view`,e=>{i=0,u=Date.now(),n(JSON.parse(e.data))}),a.addEventListener(`ping`,()=>{u=Date.now()}),a.onerror=()=>{a.close(),!(t||c!==a)&&(c=null,f(),i=Math.min(i+1,6),s=setTimeout(p,500*2**i))}},m=()=>{t||document.visibilityState!==`visible`||(!c||c.readyState===EventSource.CLOSED||Date.now()-u>xn?(i=0,p()):f())},h=setInterval(()=>{!t&&c&&Date.now()-u>xn&&(i=0,p())},15e3);return p(),document.addEventListener(`visibilitychange`,m),window.addEventListener(`pageshow`,m),window.addEventListener(`online`,m),()=>{t=!0,clearTimeout(s),clearInterval(h),document.removeEventListener(`visibilitychange`,m),window.removeEventListener(`pageshow`,m),window.removeEventListener(`online`,m),c?.close()}},[e]);let m=(0,J.useCallback)(async(t,n)=>{if(!e)return!1;d(!0),s(null),p({});try{return await a.post(`/api/runs/${e}/${t}`,n),!0}catch(e){return e instanceof o&&e.status===422&&Array.isArray(e.body?.fields)&&p(Object.fromEntries(e.body.fields.map(e=>[e.field,e.message]))),s(e.message),!1}finally{d(!1)}},[e]);return{view:t,notFound:c,error:i,busy:u,fieldErrors:f,submitPage:(e,t)=>m(`pages/${e}`,{values:t}),accept:(e,t)=>m(`reviews/${e}`,{type:`accept`,edits:t}),regenerate:(e,t,n,r)=>m(`reviews/${e}`,{type:`regenerate`,target:t,note:n,items:r?.length?r:void 0}),back:()=>m(`back`),retry:()=>m(`retry`)}}function Cn({view:e}){let t=Math.round(Math.min(e.progress.done,e.progress.total)/Math.max(1,e.progress.total)*100);return(0,Y.jsx)(`div`,{className:`h-[3px] w-full bg-paper-2`,children:(0,Y.jsx)(`div`,{className:`h-full bg-ember transition-[width] duration-700 ease-out`,style:{width:`${t}%`}})})}function wn({title:e,description:t,kicker:n}){return(0,Y.jsxs)(`div`,{className:`mb-8`,children:[n?(0,Y.jsx)(`p`,{className:`mb-4 text-[15px] text-ink-2 leading-relaxed`,children:n}):null,(0,Y.jsx)(`h1`,{className:`font-display font-semibold text-[28px] leading-[1.15] tracking-tight sm:text-[32px]`,children:e}),t?(0,Y.jsx)(`p`,{className:`mt-2 text-[15px] text-ink-3 leading-relaxed`,children:t}):null]})}function Tn(e,t){let n={};for(let r of e.fields)n[r.id]=t.values[r.id]??t.prefill?.[r.id]??r.default??(r.kind===`multiselect`?[]:void 0);return n}function En(e){return Array.from(e.querySelectorAll(`input:not([type="hidden"], [type="file"], [type="checkbox"], [type="color"], [type="range"], [disabled]), textarea:not([disabled])`)).filter(e=>!e.closest(`dialog`)&&e.offsetParent!==null)}function Dn({view:e,run:t,step:n}){let[r,i]=(0,J.useState)(()=>Tn(n,e)),[a,o]=(0,J.useState)(new Set),s=(0,J.useRef)(null),c=e.progress.done===0,l=()=>void t.submitPage(n.id,r);return(0,J.useEffect)(()=>{if(!s.current)return;let e=En(s.current).filter(e=>e instanceof HTMLInputElement);for(let[t,n]of e.entries())(n.dataset.hint||!n.hasAttribute(`enterkeyhint`))&&(n.dataset.hint=`1`,n.setAttribute(`enterkeyhint`,t===e.length-1?`go`:`next`))}),(0,Y.jsxs)(`form`,{ref:s,className:`animate-rise`,onSubmit:e=>{e.preventDefault(),a.size||l()},onKeyDown:e=>{let t=e.target;if(e.key!==`Enter`||e.defaultPrevented||e.nativeEvent.isComposing||!(t instanceof HTMLInputElement)||t.closest(`dialog`))return;let n=En(e.currentTarget),r=n[n.indexOf(t)+1];r&&(e.preventDefault(),r.focus())},children:[(0,Y.jsx)(wn,{title:n.title,description:n.description,kicker:c?e.wizard.intro:null}),(0,Y.jsx)(`div`,{className:`flex flex-col gap-7`,children:n.fields.map(n=>(0,Y.jsx)(bn,{field:n,value:r[n.id],values:r,runId:e.id,view:e,error:t.fieldErrors[n.id],onChange:e=>i(t=>({...t,[n.id]:e})),onBusy:e=>o(t=>{if(t.has(n.id)===e)return t;let r=new Set(t);return e?r.add(n.id):r.delete(n.id),r})},n.id))}),(0,Y.jsx)(On,{view:e,run:t,sticky:!0,children:(0,Y.jsxs)(G,{type:`submit`,size:`lg`,busy:t.busy,disabled:a.size>0,children:[n.cta||K(`run.next`),` `,(0,Y.jsx)(u,{className:`size-4`})]})})]})}function On({view:e,run:t,sticky:n,children:r}){return(0,Y.jsxs)(`div`,{className:H(`mt-10 flex items-center justify-between gap-3`,n&&`action-bar`),children:[e.canBack?(0,Y.jsxs)(G,{variant:`ghost`,onClick:()=>void t.back(),disabled:t.busy,children:[(0,Y.jsx)(l,{className:`size-4`}),` `,K(`run.back`)]}):(0,Y.jsx)(`span`,{}),r]})}function kn(){let e=v(),[t,n]=(0,J.useState)(!1),r=e!==`off`;return(0,Y.jsxs)(`div`,{className:`mt-6 flex flex-col items-center gap-2`,children:[(0,Y.jsxs)(`button`,{type:`button`,"aria-pressed":r,disabled:t,onClick:async()=>{if(r){C();return}n(!0),await T(),n(!1)},className:H(`inline-flex h-11 items-center gap-2 rounded-full px-4 font-medium text-[14px] ring-1 transition`,r?`bg-ember-tint text-ink ring-ember`:`bg-card text-ink-2 ring-input hover:text-ink hover:ring-ink-4`),children:[r?(0,Y.jsx)(ge,{className:`size-4 text-ember-strong`}):(0,Y.jsx)(ve,{className:`size-4`}),K(r?`notify.on`:`notify.ask`)]}),(0,Y.jsx)(`p`,{className:`max-w-xs text-[12px] text-ink-4 leading-relaxed`,children:K(e===`off`?`notify.why`:e===`on`?`notify.onHint`:S()?`notify.blocked`:`notify.quiet`)})]})}function An({view:e,compact:t,awake:n}){let a=(0,J.useMemo)(()=>{let t=[...e.events].reverse().find(t=>t.type===`step_started`&&t.stepId===e.step?.id);return t?new Date(t.at).getTime():Date.now()},[e.events,e.step?.id]),[o,s]=(0,J.useState)(Date.now());(0,J.useEffect)(()=>{let e=setInterval(()=>s(Date.now()),1e3);return()=>clearInterval(e)},[]);let c=[...e.events].reverse().find(t=>t.type===`step_started`&&t.stepId===e.step?.id)?.message??e.step?.title??K(`run.working`),l=e.events.filter(e=>(e.type===`tool`||e.type===`info`)&&new Date(e.at).getTime()>=a-500),u=l.slice(-4),d=[...new Set(l.map(e=>e.asset).filter(e=>!!e))],f=[...l].reverse().find(e=>e.asset)?.asset;return(0,Y.jsxs)(`div`,{className:`flex animate-rise flex-col items-center pt-6 text-center`,children:[(0,Y.jsx)(i,{kind:e.wizard.avatar,size:t?130:170,fluffy:!0}),(0,Y.jsx)(`h2`,{className:`mt-4 font-display font-semibold text-[22px] tracking-tight`,children:c}),(0,Y.jsx)(`div`,{className:`mt-1 text-[13px] text-ink-4 tabular-nums`,children:K(`run.elapsed`,{s:Math.max(0,Math.round((o-a)/1e3))})}),d.length?(0,Y.jsx)(`div`,{className:`mt-5 flex max-w-full flex-wrap justify-center gap-2`,children:d.slice(-8).map(t=>(0,Y.jsx)(`img`,{src:r(`/api/runs/${e.id}/assets/${t}`),alt:``,className:H(`size-16 animate-rise rounded-lg bg-paper-2 object-cover ring-1 ring-border-soft transition sm:size-20`,t===f?`ring-2 ring-ember`:`opacity-70`)},t))}):null,(0,Y.jsx)(`div`,{className:`mt-6 flex min-h-[7rem] w-full max-w-sm flex-col gap-1.5`,children:u.map((e,t)=>(0,Y.jsxs)(`div`,{className:H(`flex items-center justify-center gap-2 text-[13px] transition-opacity`,t===u.length-1?`text-ink-2`:`text-ink-4`),children:[t===u.length-1?(0,Y.jsx)(h,{className:`size-3.5 animate-breathe text-ember`}):null,(0,Y.jsx)(`span`,{className:`truncate`,children:e.message})]},e.id))}),t?null:(0,Y.jsx)(kn,{}),n?(0,Y.jsx)(`p`,{className:`mt-3 text-[12px] text-ink-4`,children:K(`run.awake`)}):null]})}function jn(e){let t=(0,J.useRef)({running:!1,since:0,ask:null});(0,J.useEffect)(()=>{if(!e)return;let n=t.current,r=e.status===`running`,i=r?n.running?n.since:Date.now():0,a=t=>{document.visibilityState!==`visible`&&!document.title.startsWith(`● `)&&(document.title=`● ${document.title}`),D({title:e.wizard.title,body:t,tag:e.id})};r&&e.ask&&e.ask.id!==n.ask?a(K(`notify.needsYou`)):!r&&n.running&&Date.now()-n.since>8e3&&a(e.status===`failed`?K(`run.failed`):e.status===`done`?K(`notify.done`):K(`notify.next`)),t.current={running:r,since:i,ask:e.ask?.id??null}},[e]),(0,J.useEffect)(()=>{let e=()=>{document.visibilityState===`visible`&&document.title.startsWith(`● `)&&(document.title=document.title.slice(2))};return document.addEventListener(`visibilitychange`,e),()=>document.removeEventListener(`visibilitychange`,e)},[])}function Mn({view:e,run:t,step:n}){let[r,i]=(0,J.useState)({}),[a,o]=(0,J.useState)({}),[s,c]=(0,J.useState)(``),l=e.shown.filter(e=>e.output),[d,f]=(0,J.useState)(l.length===1?l[0].step.id:null),[p,m]=(0,J.useState)({}),h=(0,J.useRef)(null),g=l.find(e=>e.step.id===d),_=g?.step.type===`generate`&&(g.output?.assets?.length??0)>1,v=()=>{g&&s.trim()&&t.regenerate(n.id,g.step.id,s.trim(),p[g.step.id])};return(0,Y.jsxs)(`div`,{className:`animate-rise`,children:[(0,Y.jsx)(wn,{title:n.title,description:n.description}),(0,Y.jsxs)(`div`,{className:`flex flex-col gap-6`,children:[e.shown.map(({step:t,output:s})=>{let c=!!n.edit&&t.type===`agent`&&t.output.format!==`json`;return(0,Y.jsxs)(`section`,{children:[(0,Y.jsxs)(`div`,{className:`mb-2 flex items-center justify-between gap-3`,children:[(0,Y.jsx)(`h3`,{className:`font-medium text-[13px] text-ink-3 uppercase tracking-[0.06em]`,children:t.title}),(0,Y.jsx)(`div`,{className:`flex items-center`,children:c&&!a[t.id]?(0,Y.jsxs)(`button`,{type:`button`,onClick:()=>o(e=>({...e,[t.id]:!0})),className:`inline-flex h-8 items-center gap-1.5 rounded-full px-3 text-[13px] text-ink-2 hover:bg-accent hover:text-ink coarse:h-11`,children:[(0,Y.jsx)(k,{className:`size-3.5`}),` `,K(`run.edit`)]}):null})]}),(0,Y.jsx)(x,{base:`/api/runs/${e.id}`,step:t,output:s,editable:c&&a[t.id],draft:r[t.id],onDraft:e=>i(n=>({...n,[t.id]:e})),picked:p[t.id],onPick:n.regenerate?e=>{f(t.id),m(n=>{let r=n[t.id]??[];return{...n,[t.id]:r.includes(e)?r.filter(t=>t!==e):[...r,e]}}),h.current?.focus()}:void 0})]},t.id)}),e.lists.map(t=>(0,Y.jsxs)(`section`,{children:[(0,Y.jsx)(`h3`,{className:`mb-2 font-medium text-[13px] text-ink-3 uppercase tracking-[0.06em]`,children:t.def.title}),t.def.check?(0,Y.jsx)(an,{runId:e.id,list:t}):(0,Y.jsx)(tn,{runId:e.id,list:t,editable:!0})]},t.def.id)),n.regenerate&&l.length?(0,Y.jsxs)(se,{className:`p-3`,children:[l.length>1?(0,Y.jsxs)(`div`,{className:`flex flex-wrap items-center gap-1.5 px-1 pb-2`,children:[(0,Y.jsx)(`span`,{className:`mr-1 text-[13px] text-ink-3`,children:K(`run.feedbackTarget`)}),l.map(({step:e})=>(0,Y.jsx)(`button`,{type:`button`,"aria-pressed":d===e.id,onClick:()=>{f(e.id),h.current?.focus()},className:H(`inline-flex h-8 items-center rounded-full px-3 text-[13px] ring-1 transition coarse:h-11`,d===e.id?`bg-ember-tint text-ink ring-ember`:`bg-card text-ink-2 ring-input hover:text-ink`),children:e.title},e.id))]}):null,(0,Y.jsx)(oe,{ref:h,minRows:2,maxRows:8,value:s,placeholder:K(`run.feedbackPlaceholder`),onChange:e=>c(e.target.value),onKeyDown:e=>{e.key===`Enter`&&(e.metaKey||e.ctrlKey)&&(e.preventDefault(),v())},className:`border-0 bg-transparent shadow-none focus:ring-0`}),(0,Y.jsxs)(`div`,{className:`flex items-center justify-between gap-3 px-1 pt-1`,children:[(0,Y.jsx)(`span`,{className:`min-w-0 text-[12px] text-ink-3`,children:_?p[g.step.id]?.length?K(`run.regeneratePicked`,{n:[...p[g.step.id]].sort((e,t)=>e-t).map(e=>e+1).join(`, `)}):K(`run.regenerateAll`):!g&&s.trim()?K(`run.feedbackPick`):null}),(0,Y.jsxs)(G,{size:`sm`,variant:`secondary`,busy:t.busy,disabled:!s.trim()||!g,onClick:v,children:[(0,Y.jsx)(te,{className:`size-3.5`}),` `,K(`run.regenerateGo`)]})]})]}):null]}),(0,Y.jsx)(On,{view:e,run:t,sticky:!0,children:(0,Y.jsxs)(G,{size:`lg`,busy:t.busy,onClick:()=>void t.accept(n.id,Object.keys(r).length?r:void 0),children:[K(`run.accept`),` `,(0,Y.jsx)(u,{className:`size-4`})]})})]})}function Nn({view:e,run:t,step:n,onRestart:r}){let a=e.shown.filter(e=>e.output);return(0,Y.jsxs)(`div`,{className:`animate-rise`,children:[(0,Y.jsxs)(`div`,{className:`mb-8 flex flex-wrap items-center gap-x-4 gap-y-5`,children:[(0,Y.jsx)(i,{kind:e.wizard.avatar,size:64}),(0,Y.jsxs)(`div`,{className:`min-w-0 flex-1 basis-[12rem]`,children:[(0,Y.jsx)(`h1`,{className:`text-balance font-display font-semibold text-[28px] leading-tight tracking-tight sm:text-[32px]`,children:n.title}),n.message?(0,Y.jsx)(`p`,{className:`mt-1 text-[15px] text-ink-3`,children:n.message}):null]}),e.shown.some(e=>e.output)?(0,Y.jsx)(`div`,{className:`max-sm:basis-full`,children:(0,Y.jsx)(lt,{runId:e.id,title:`${n.title} · ${e.wizard.title}`,initial:e.shareUrl?{url:e.shareUrl,expiresAt:e.expiresAt}:null})}):null]}),(0,Y.jsxs)(`div`,{className:`flex flex-col gap-6`,children:[a.map(({step:t,output:n,formats:r,label:i})=>(0,Y.jsxs)(se,{className:`p-4 sm:p-5`,children:[(0,Y.jsxs)(`div`,{className:`mb-3 flex flex-wrap items-center justify-between gap-3`,children:[(0,Y.jsx)(`h3`,{className:`font-display font-semibold text-[17px]`,children:i??t.title}),(0,Y.jsx)(E,{base:`/api/runs/${e.id}`,stepId:t.id,formats:r,title:i??t.title})]}),(0,Y.jsx)(x,{base:`/api/runs/${e.id}`,step:t,output:n}),n?.assets?.some(e=>e.ai)?(0,Y.jsx)(`p`,{className:`mt-3 text-[12px] text-ink-3 leading-relaxed`,children:K(`ai.publish`)}):null]},t.id)),e.lists.map(t=>(0,Y.jsxs)(se,{className:`p-4 sm:p-5`,children:[(0,Y.jsxs)(`div`,{className:`mb-3 flex flex-wrap items-center justify-between gap-3`,children:[(0,Y.jsx)(`h3`,{className:`font-display font-semibold text-[17px]`,children:t.label??t.def.title}),(0,Y.jsx)(sn,{runId:e.id,list:t})]}),(0,Y.jsx)(tn,{runId:e.id,list:t,editable:!0})]},t.def.id))]}),(0,Y.jsx)(On,{view:e,run:t,children:r?(0,Y.jsxs)(G,{variant:`secondary`,onClick:r,children:[(0,Y.jsx)(Je,{className:`size-4`}),` `,K(`run.again`)]}):(0,Y.jsx)(`span`,{})})]})}function Pn({view:e,run:t}){return(0,Y.jsxs)(`div`,{className:`flex animate-rise flex-col items-center pt-8 text-center`,children:[(0,Y.jsx)(i,{kind:e.wizard.avatar,size:90}),(0,Y.jsx)(`h2`,{className:`mt-4 font-display font-semibold text-[22px]`,children:K(`run.failed`)}),(0,Y.jsx)(`p`,{className:`mt-2 max-w-md text-[15px] text-ink-3`,children:e.error}),(0,Y.jsxs)(`div`,{className:`mt-8 flex gap-3`,children:[e.canBack?(0,Y.jsxs)(G,{variant:`ghost`,onClick:()=>void t.back(),children:[(0,Y.jsx)(l,{className:`size-4`}),` `,K(`run.back`)]}):null,(0,Y.jsxs)(G,{onClick:()=>void t.retry(),busy:t.busy,children:[(0,Y.jsx)(Je,{className:`size-4`}),` `,K(`run.retry`)]})]})]})}function Fn({runId:e,compact:t,onRestart:n,onView:r,stickyProgress:i}){let a=Sn(e),{view:o}=a;(0,J.useEffect)(()=>{r?.(o)},[o,r]),_();let s=w(o?.status===`running`&&!o.ask);if(jn(o),a.notFound)return(0,Y.jsx)(`div`,{className:`py-24 text-center text-ink-3`,children:K(`run.notFound`)});if(!o)return(0,Y.jsx)(`div`,{className:`flex justify-center py-24 text-ink-4`,children:(0,Y.jsx)(V,{})});let c=o.step,l=null;if(o.status===`running`&&o.ask)l=(0,Y.jsx)(ut,{runId:o.id,ask:o.ask},o.ask.id);else if(o.status===`running`)l=(0,Y.jsx)(An,{view:o,compact:t,awake:s});else if(o.status===`failed`)l=(0,Y.jsx)(Pn,{view:o,run:a});else if(o.status===`cancelled`)l=(0,Y.jsx)(`div`,{className:`py-24 text-center text-ink-3`,children:K(`run.cancelled`)});else if(c?.type===`page`)l=(0,Y.jsx)(Dn,{view:o,run:a,step:c},c.id);else if(c?.type===`review`){let e=o.shown.map(e=>e.output?.at??``).join(`|`);l=(0,Y.jsx)(Mn,{view:o,run:a,step:c},`${c.id}:${e}`)}else c?.type===`result`&&(l=(0,Y.jsx)(Nn,{view:o,run:a,step:c,onRestart:n}));let u=c?.type===`review`&&o.status===`waiting_input`&&o.lists.some(e=>e.def.check);return(0,Y.jsxs)(`div`,{className:`flex min-h-full flex-col`,children:[i?(0,Y.jsx)(`div`,{className:`sticky top-0 z-10`,children:(0,Y.jsx)(Cn,{view:o})}):(0,Y.jsx)(Cn,{view:o}),(0,Y.jsxs)(`div`,{className:H(`safe-x mx-auto w-full flex-1`,u?`max-w-[1240px] py-8`:t?`max-w-[620px] py-8`:`max-w-[640px] py-8 sm:py-16`),children:[l,a.error&&o.status!==`failed`?(0,Y.jsx)(`div`,{className:`mt-4 rounded-lg bg-rose-tint px-4 py-3 text-[14px] text-rose`,children:a.error}):null,o.keeps&&o.status!==`running`?(0,Y.jsx)(`div`,{className:`mt-10 flex justify-center`,children:(0,Y.jsx)(ln,{runId:o.id})}):null]})]})}export{Qe as n,me as r,Fn as t};
@@ -1 +0,0 @@
1
- import{a as e,n as t,t as n}from"./jsx-runtime-D3jfb0Ew.js";import{A as r,O as i,S as a,j as o,k as s,n as c,nt as l,w as u}from"./api-u3nydnnp.js";import{t as d}from"./createLucideIcon-q3MZMmnf.js";import{t as f}from"./arrow-left-hTN1VoH1.js";import{t as p}from"./arrow-right-6FyN3e7D.js";import{n as m}from"./HomePage-DIDJ8Jw1.js";import{t as h}from"./check-CUpby_J9.js";import{t as g}from"./chevron-down-DymW-2BP.js";import{n as _,r as v,t as y}from"./circle-alert-B76z9TWZ.js";import{n as ee,r as b,t as x}from"./volume-2-Bp2tyaKE.js";import{n as S,r as C}from"./upload-DNRENWzQ.js";import{n as w,t as T}from"./plus-Du-Jx8aI.js";import{t as te}from"./external-link-MAL7vJYj.js";import{c as ne,t as re}from"./Account-BK8Q-U-8.js";import{t as ie}from"./image-BShbErBm.js";import{n as ae,t as oe}from"./trash-0IafyhZB.js";import{t as se}from"./pen-line-NK46C_nG.js";import{t as ce}from"./refresh-cw-Cmk7VCe0.js";import{_ as le,a as ue,d as de,h as E,n as D,o as O,p as fe,r as pe,s as k,t as A,u as me,y as j}from"./ui-gGAdXx-P.js";import{D as he,F as ge,I as M,P as _e,S as ve,d as ye,g as be,h as xe,i as Se,k as Ce,m as we,p as Te,r as Ee,w as De,x as Oe}from"./index-CTM5iDwf.js";import{o as ke}from"./definition-Co2Mg1qo.js";import{n as Ae}from"./LocalRuntime-DQW6CLg-.js";import{n as je,t as Me}from"./ReadOnly-B0-ReU_0.js";import{t as Ne}from"./Harness-DEGZ-_YL.js";var Pe={name:`ear`,size:24,node:[[`path`,{d:`M6 8.5a6.5 6.5 0 1 1 13 0c0 6-6 6-6 10a3.5 3.5 0 1 1-7 0`,key:`1dfaln`}],[`path`,{d:`M15 8.5a2.5 2.5 0 0 0-5 0v1a2 2 0 1 1 0 4`,key:`1qnva7`}]]};Pe.node;var Fe=d(Pe),Ie={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`}]]};Ie.node;var N=d(Ie),Le={name:`monitor`,size:24,node:[[`rect`,{width:`20`,height:`14`,x:`2`,y:`3`,rx:`2`,key:`48i651`}],[`line`,{x1:`8`,x2:`16`,y1:`21`,y2:`21`,key:`1svkeh`}],[`line`,{x1:`12`,x2:`12`,y1:`17`,y2:`21`,key:`vw1qmm`}]]};Le.node;var Re=d(Le),ze={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`}]]};ze.node;var Be=d(ze),Ve={name:`wrench`,size:24,node:[[`path`,{d:`M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.106-3.105c.32-.322.863-.22.983.218a6 6 0 0 1-8.259 7.057l-7.91 7.91a1 1 0 0 1-2.999-3l7.91-7.91a6 6 0 0 1 7.057-8.259c.438.12.54.662.219.984z`,key:`1ngwbx`}]]};Ve.node;var He=d(Ve),P=e(t(),1),F=e(n(),1);function Ue(){let e=be(),[t,n]=(0,P.useState)(null),[r,i]=(0,P.useState)(null),a=async e=>{n(e??`*`),i(null);try{await xe(e)}catch(e){i(e.message)}finally{n(null)}};return(0,F.jsxs)(ne,{title:j(`plugins.title`),hint:e.canReload?j(`plugins.hint`):j(`plugins.hintManaged`),action:e.canReload?(0,F.jsx)(A,{variant:`secondary`,busy:t===`*`,onClick:()=>void a(),children:j(`plugins.rescan`)}):null,children:[(0,F.jsxs)(`ul`,{className:`divide-y divide-border-soft`,children:[e.plugins.map(n=>{let r=e.failed[n.id];return(0,F.jsxs)(`li`,{className:`flex items-start gap-4 py-4 first:pt-0 last:pb-0`,children:[(0,F.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,F.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-2.5 gap-y-1`,children:[(0,F.jsx)(`span`,{className:`font-medium text-[15px]`,children:n.name}),n.name===n.id?null:(0,F.jsxs)(`span`,{className:`font-mono text-[12px] text-ink-4`,children:[n.id,` · `,n.version]})]}),n.description?(0,F.jsx)(`p`,{className:`mt-0.5 text-[14px] text-ink-3`,children:n.description}):null,n.tools.length?(0,F.jsxs)(`div`,{className:`mt-2 flex flex-wrap items-center gap-1.5 text-[12px] text-ink-3`,children:[j(`plugins.tools`),n.tools.map(e=>(0,F.jsx)(pe,{children:e.id},e.id))]}):null,n.error?(0,F.jsx)(`p`,{className:`mt-2 text-[13px] text-rose`,children:j(`plugins.serverFailed`,{error:n.error})}):null,r?(0,F.jsx)(`p`,{className:`mt-2 text-[13px] text-rose`,children:j(`plugins.studioFailed`,{error:r})}):null]}),e.canReload?(0,F.jsx)(O,{label:j(`plugins.reload`),disabled:t!==null,onClick:()=>void a(n.id),children:(0,F.jsx)(Be,{className:t===n.id?`size-4 animate-spin`:`size-4`})}):null]},n.id)}),e.problems.map(e=>(0,F.jsxs)(`li`,{className:`py-4 first:pt-0 last:pb-0`,children:[(0,F.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-2.5 gap-y-1`,children:[(0,F.jsx)(pe,{tone:`warn`,children:j(`plugins.problems`)}),(0,F.jsx)(`span`,{className:`break-all font-mono text-[12px] text-ink-3`,children:e.path})]}),(0,F.jsx)(`p`,{className:`mt-1.5 text-[13px] text-ink-3`,children:e.message})]},e.path))]}),r?(0,F.jsx)(`p`,{className:`mt-4 text-[13px] text-rose`,children:r}):null]})}function We({connector:e}){let[t,n]=(0,P.useState)(!1);return(0,F.jsxs)(`div`,{className:`rounded-lg bg-paper ring-1 ring-border-soft`,children:[(0,F.jsxs)(`button`,{type:`button`,onClick:()=>n(e=>!e),className:`flex w-full items-center gap-3 px-3 py-2 text-left`,children:[(0,F.jsx)(`span`,{className:E(`size-2 shrink-0 rounded-full`,e.usable?`bg-moss`:`bg-ink-4`)}),(0,F.jsxs)(`span`,{className:`min-w-0 flex-1 truncate text-[13px]`,children:[e.name,` `,(0,F.jsx)(`span`,{className:`font-mono text-[11px] text-ink-4`,children:e.id})]}),(0,F.jsx)(`span`,{className:`shrink-0 text-[12px] text-ink-3`,children:e.usable?j(`connectors.actions`,{n:e.actions.length,r:e.actions.filter(e=>e.group===`read`).length}):j(`connectors.notSetUp`)})]}),t?(0,F.jsxs)(`div`,{className:`border-border-soft border-t px-3 py-2 text-[12px]`,children:[e.missingSetup?(0,F.jsxs)(`p`,{className:`mb-1 text-ink-3`,children:[j(`connectors.setup`),` `,(0,F.jsx)(`span`,{className:`font-mono text-ink-2`,children:e.missingSetup})]}):null,(0,F.jsx)(`p`,{className:`text-ink-4`,children:e.actions.map(e=>e.group===`read`?e.id:`${e.id} (${j(`connectors.group.${e.group}`)})`).join(` · `)})]}):null]})}var Ge={none:`connectors.authNone`,oauth2:`connectors.authOauth`,api_key:`connectors.authKey`};function Ke({projectId:e,connector:t,readOnly:n}){let r=l(),[i,a]=(0,P.useState)(!1),o=()=>r.invalidateQueries({queryKey:[`connectors`,e]}),s=`/api/studio/projects/${e}/connectors/${t.id}`,u=M({mutationFn:()=>c.post(`${s}/refresh`),onSuccess:o}),d=M({mutationFn:()=>c.del(s),onSuccess:o}),f=t.actions.filter(e=>e.group===`read`).length;return(0,F.jsxs)(`div`,{className:`rounded-lg bg-paper ring-1 ring-border-soft`,children:[(0,F.jsxs)(`div`,{className:`flex items-center gap-3 p-3`,children:[(0,F.jsx)(`div`,{className:`flex size-9 shrink-0 items-center justify-center rounded-lg bg-paper-2 text-ink-2`,children:(0,F.jsx)(he,{className:`size-4`})}),(0,F.jsxs)(`button`,{type:`button`,onClick:()=>a(e=>!e),className:`min-w-0 flex-1 text-left`,children:[(0,F.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,F.jsx)(`span`,{className:`truncate font-medium text-[14px]`,children:t.name}),(0,F.jsx)(`span`,{className:`font-mono text-[11px] text-ink-4`,children:t.id})]}),(0,F.jsxs)(`div`,{className:`truncate text-[12px] text-ink-3`,children:[t.domain,` · `,t.sourceKind===`mcp`?`MCP`:`OpenAPI`,` ·`,` `,j(Ge[t.auth]),` ·`,` `,t.toolsPending?j(`connectors.pending`):j(`connectors.actions`,{n:t.actions.length,r:f})]})]}),n?null:(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(O,{label:j(`connectors.refresh`),onClick:()=>u.mutate(),children:u.isPending?(0,F.jsx)(de,{className:`size-4`}):(0,F.jsx)(ce,{className:`size-4`})}),(0,F.jsx)(O,{label:j(`connectors.remove`),className:`hover:text-rose`,onClick:()=>confirm(`${t.name}: ${j(`connectors.remove`)}?`)&&d.mutate(),children:(0,F.jsx)(oe,{className:`size-4`})})]})]}),t.needsOAuthClient?(0,F.jsx)(`p`,{className:`border-border-soft border-t px-3 py-2 text-[12px] text-rose`,children:j(`connectors.needsClient`)}):null,u.error??d.error?(0,F.jsx)(`p`,{className:`border-border-soft border-t px-3 py-2 text-[12px] text-rose`,children:(u.error??d.error).message}):null,i&&t.actions.length?(0,F.jsx)(`ul`,{className:`max-h-64 overflow-y-auto border-border-soft border-t px-3 py-2`,children:t.actions.map(e=>(0,F.jsxs)(`li`,{className:`flex items-baseline gap-2 py-1 text-[12px]`,children:[(0,F.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:j(`connectors.group.${e.group}`)}),(0,F.jsx)(`span`,{className:`shrink-0 font-mono text-ink-2`,children:e.id}),(0,F.jsx)(`span`,{className:`min-w-0 truncate text-ink-4`,children:e.summary})]},e.id))}):null]})}function qe({projectId:e,domain:t,source:n,taken:r,onDone:i}){let a=l(),[o,s]=(0,P.useState)({id:``,secret:``}),[u,d]=(0,P.useState)(!1),f=r.includes(n.suggestedId),p=M({mutationFn:()=>c.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,F.jsxs)(`div`,{className:`rounded-lg bg-card p-3 ring-1 ring-border-soft`,children:[(0,F.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,F.jsx)(pe,{tone:n.sourceKind===`mcp`?`ember`:`neutral`,children:n.sourceKind===`mcp`?`MCP`:`OpenAPI`}),(0,F.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,F.jsx)(`div`,{className:`truncate text-[13px]`,children:n.name??n.suggestedId}),(0,F.jsx)(`div`,{className:`truncate font-mono text-[11px] text-ink-4`,children:n.sourceUrl})]}),n.blocked||f?null:(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(`button`,{type:`button`,onClick:()=>d(e=>!e),className:`text-[12px] text-ink-3 hover:text-ink`,children:j(`connectors.ownClient`)}),(0,F.jsx)(A,{size:`sm`,busy:p.isPending,onClick:()=>p.mutate(),children:j(`connectors.import`)})]})]}),n.blocked?(0,F.jsx)(`p`,{className:`mt-2 text-[12px] text-ink-3`,children:n.blocked}):null,f?(0,F.jsx)(`p`,{className:`mt-2 text-[12px] text-ink-3`,children:j(`connectors.exists`)}):null,u?(0,F.jsxs)(`div`,{className:`mt-3 grid gap-2 sm:grid-cols-2`,children:[(0,F.jsx)(k,{placeholder:`OAuth Client-ID`,value:o.id,onChange:e=>s(t=>({...t,id:e.target.value}))}),(0,F.jsx)(k,{type:`password`,autoComplete:`off`,placeholder:`OAuth Client-Secret`,value:o.secret,onChange:e=>s(t=>({...t,secret:e.target.value}))})]}):null,p.error?(0,F.jsx)(`p`,{className:`mt-2 text-[12px] text-rose`,children:p.error.message}):null]})}function Je({projectId:e,readOnly:t}){let[n,r]=(0,P.useState)(``),[i,a]=(0,P.useState)(null),[s,l]=(0,P.useState)(null),[u,d]=(0,P.useState)([]),f=o({queryKey:[`connectors`,e],queryFn:()=>c.get(`/api/studio/projects/${e}/connectors`)}),p=M({mutationFn:()=>c.post(`/api/studio/connectors/search`,{query:n}),onSuccess:e=>{a(e),l(null),d([])}}),m=M({mutationFn:e=>c.get(`/api/studio/connectors/registry/${encodeURIComponent(e)}`),onSuccess:l}),h=f.data??[],_=h.filter(e=>e.sourceKind===`builtin`&&(Te.unsetConnectors||e.usable)),v=h.filter(e=>e.sourceKind!==`builtin`);return(0,F.jsxs)(D,{className:`p-6`,children:[(0,F.jsx)(`h2`,{className:`font-display font-semibold text-lg`,children:j(`connectors.title`)}),(0,F.jsx)(`p`,{className:`mt-1 mb-5 text-[14px] text-ink-3`,children:j(`connectors.hint`)}),_.length?(0,F.jsx)(`div`,{className:`mb-5 grid gap-1.5 sm:grid-cols-2`,children:_.map(e=>(0,F.jsx)(We,{connector:e},e.id))}):null,(0,F.jsx)(`h3`,{className:`mb-2 font-medium text-[12px] text-ink-3 uppercase tracking-[0.07em]`,children:j(`connectors.imported`)}),v.length?(0,F.jsx)(`div`,{className:`mb-4 flex flex-col gap-2`,children:v.map(n=>(0,F.jsx)(Ke,{projectId:e,connector:n,readOnly:t},n.id))}):null,t?v.length?null:(0,F.jsx)(`p`,{className:`text-[13px] text-ink-3`,children:j(`connectors.noneImported`)}):(0,F.jsxs)(`form`,{className:`flex gap-2`,onSubmit:e=>{e.preventDefault(),n.trim()&&p.mutate()},children:[(0,F.jsx)(k,{value:n,placeholder:j(`connectors.search`),onChange:e=>r(e.target.value)}),(0,F.jsxs)(A,{type:`submit`,variant:`secondary`,busy:p.isPending,children:[(0,F.jsx)(S,{className:`size-4`}),` `,j(`connectors.find`)]})]}),p.error?(0,F.jsx)(`p`,{className:`mt-3 text-[13px] text-rose`,children:p.error.message}):null,i&&!s?(0,F.jsxs)(`div`,{className:`mt-3 flex flex-col gap-1`,children:[i.length?null:(0,F.jsx)(`p`,{className:`text-[13px] text-ink-3`,children:j(`connectors.none`)}),i.map(e=>(0,F.jsxs)(`button`,{type:`button`,disabled:!e.kinds.length,onClick:()=>m.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,F.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,F.jsx)(`div`,{className:`truncate text-[14px]`,children:e.domain}),(0,F.jsx)(`div`,{className:`truncate text-[12px] text-ink-3`,children:e.description})]}),(0,F.jsx)(`span`,{className:`text-[11px] text-ink-4 uppercase`,children:e.kinds.join(` · `)}),(0,F.jsx)(g,{className:`-rotate-90 size-4 text-ink-4`})]},e.domain)),m.isPending?(0,F.jsx)(de,{className:`mx-auto mt-2 size-4 text-ink-4`}):null,m.error?(0,F.jsx)(`p`,{className:`text-[13px] text-rose`,children:m.error.message}):null]}):null,s?(0,F.jsxs)(`div`,{className:`mt-4 flex flex-col gap-2`,children:[(0,F.jsxs)(`div`,{className:`flex items-baseline justify-between gap-3`,children:[(0,F.jsx)(`div`,{className:`font-medium text-[14px]`,children:s.domain}),(0,F.jsx)(`button`,{type:`button`,onClick:()=>l(null),className:`text-[12px] text-ink-3 hover:text-ink`,children:j(`run.back`)})]}),s.summary?(0,F.jsx)(`p`,{className:`text-[13px] text-ink-3`,children:s.summary}):null,s.sources.map(t=>(0,F.jsx)(qe,{projectId:e,domain:s.domain,source:t,taken:h.map(e=>e.id),onDone:d},`${t.sourceKind}:${t.sourceUrl}`)),s.credentials.filter(e=>e.setup||e.url).map(e=>(0,F.jsxs)(`p`,{className:`text-[12px] text-ink-3`,children:[(0,F.jsxs)(`span`,{className:`text-ink-2`,children:[e.label,`:`]}),` `,e.setup,` `,e.url?(0,F.jsx)(`a`,{href:e.url,target:`_blank`,rel:`noreferrer`,className:`text-ember underline`,children:e.url}):null]},e.label)),u.map(e=>(0,F.jsx)(`p`,{className:`text-[12px] text-ink-3`,children:e},e))]}):null]})}var Ye=ge(),Xe=(0,P.createContext)({slot:null,narrow:!1,setDetail:()=>void 0});function I(){return(0,P.useContext)(Xe)}function Ze({children:e}){let{slot:t}=I();return t?(0,Ye.createPortal)(e,t):null}function Qe(e){let{setDetail:t}=I();(0,P.useEffect)(()=>(t(e),()=>t(null)),[e,t])}var $e=`(max-width: 767px)`;function et(e){let t=window.matchMedia($e);return t.addEventListener(`change`,e),()=>t.removeEventListener(`change`,e)}function tt(){return(0,P.useSyncExternalStore)(et,()=>window.matchMedia($e).matches)}function nt(e){return e===`deeper`?`animate-step-deeper`:e===`back`&&`animate-step-back`}function rt({label:e,onBack:t}){return(0,F.jsxs)(`button`,{type:`button`,onClick:t,className:`-ml-1 flex items-center gap-1 rounded-lg py-1.5 pr-3 pl-1 text-[13px] text-ink-3 transition hover:text-ink`,children:[(0,F.jsx)(v,{className:`size-4`}),e]})}function it(e){let t=(0,P.useRef)({level:e,direction:null});return e!==t.current.level&&(t.current={level:e,direction:e>t.current.level?`deeper`:`back`}),t.current.direction}function L({label:e,collapsible:t,open:n=!0,count:r,children:i}){let[a,o]=(0,P.useState)(n),s=`font-medium text-[11px] text-ink-4 uppercase tracking-[0.12em]`;return(0,F.jsxs)(`div`,{className:`mt-5 first:mt-0`,children:[t?(0,F.jsxs)(`button`,{type:`button`,onClick:()=>o(!a),"aria-expanded":a,className:E(`mb-1 flex w-full items-center gap-1 px-2 text-left hover:text-ink-2`,s),children:[(0,F.jsx)(`span`,{className:`flex-1`,children:e}),a?null:(0,F.jsx)(`span`,{className:`tabular-nums tracking-normal`,children:r}),(0,F.jsx)(g,{className:E(`size-3.5 transition-transform`,a?null:`-rotate-90`)})]}):(0,F.jsx)(`p`,{className:E(`mb-1 px-2`,s),children:e}),a?(0,F.jsx)(`ul`,{className:`flex flex-col gap-0.5`,children:i}):null]})}function R({icon:e,label:t,badge:n,tone:r,toneLabel:i,selected:a,disabled:o,onPick:s}){return(0,F.jsx)(`li`,{children:(0,F.jsxs)(`button`,{type:`button`,onClick:s,disabled:o,"aria-current":a?`page`:void 0,className:E(`group flex w-full items-center gap-2 rounded-lg px-2 py-1 text-left text-[14px] transition max-md:py-2`,a?`bg-paper-2 font-medium text-ink`:`text-ink-2 hover:bg-accent hover:text-ink`,o&&`cursor-default opacity-50 hover:bg-transparent hover:text-ink-2`),children:[(0,F.jsx)(`span`,{className:`grid size-7 shrink-0 place-items-center`,children:(0,F.jsx)(e,{className:E(`size-4 transition-transform duration-200 ease-out`,!o&&`group-hover:scale-110`,a?`text-ember-strong`:`text-ink-3`)})}),(0,F.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:t}),n,r?(0,F.jsx)(`span`,{role:`img`,title:i,"aria-label":i,className:E(`size-2 shrink-0 rounded-full`,r===`done`&&`bg-moss`,r===`credits`&&`bg-amber`,r===`on`&&`bg-ember`,r===`off`&&`ring-1 ring-ink-4 ring-inset`)}):null,o?null:(0,F.jsx)(_,{className:`size-4 shrink-0 text-ink-4 md:hidden`})]})})}var z=`engenty-wizards`,at=`ENGENTY_WIZARDS_KEY`,ot=[{id:`claude-desktop`,name:`Claude Desktop`,widgets:!0},{id:`claude-code`,name:`Claude Code`,widgets:!1},{id:`codex`,name:`Codex · ChatGPT app`,widgets:!1},{id:`cursor`,name:`Cursor`,widgets:!0},{id:`vscode`,name:`VS Code (Copilot)`,widgets:!0},{id:`windsurf`,name:`Windsurf`,widgets:!1},{id:`gemini`,name:`Gemini CLI`,widgets:!1},{id:`goose`,name:`Goose`,widgets:!0},{id:`openclaw`,name:`OpenClaw`,widgets:!1},{id:`lm-studio`,name:`LM Studio`,widgets:!1},{id:`claude-ai`,name:`claude.ai`,widgets:!0,oauth:!0},{id:`chatgpt`,name:`ChatGPT`,widgets:!0,oauth:!0}];function B({text:e}){let[t,n]=(0,P.useState)(!1);return(0,F.jsxs)(`div`,{className:`flex items-start gap-2 rounded-lg bg-paper-2 p-3`,children:[(0,F.jsx)(`code`,{className:`min-w-0 flex-1 whitespace-pre-wrap break-all font-mono text-[12px] leading-relaxed`,children:e}),(0,F.jsx)(O,{label:j(t?`settings.copied`:`settings.copy`),onClick:async()=>{await navigator.clipboard.writeText(e),n(!0),setTimeout(()=>n(!1),1500)},children:t?(0,F.jsx)(h,{className:`size-4`}):(0,F.jsx)(w,{className:`size-4`})})]})}function st(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 V({children:e}){return(0,F.jsx)(`p`,{className:`text-[14px] text-ink-3`,children:e})}function H({title:e,children:t}){return(0,F.jsxs)(`section`,{className:`flex flex-col gap-2.5 border-border-soft border-t pt-5 first:border-t-0 first:pt-0`,children:[(0,F.jsx)(`h3`,{className:`font-medium text-[15px]`,children:e}),t]})}function U(e,t){return JSON.stringify({[e]:{[z]:t}},null,2)}function ct({id:e,url:t,apiKey:n}){let r=n?`Authorization: Bearer ${n}`:null,i=n?{headers:{Authorization:`Bearer ${n}`}}:{};switch(e){case`claude-code`:{let e=t.replace(/\/api\/mcp$/,`/api/claude-plugin`);return(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(V,{children:j(`mcp.terminal`)}),(0,F.jsx)(B,{text:`claude mcp add --transport http --scope user ${z} ${t}${r?` --header "${r}"`:``}`}),!n&&st(t)?(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(V,{children:j(`mcp.ccPlugin`)}),(0,F.jsx)(B,{text:`claude plugin marketplace add ${e}/marketplace.json`}),(0,F.jsx)(B,{text:`claude plugin install ${z}@engenty`})]}):null]})}case`codex`:return n?(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(V,{children:j(`mcp.codexKey`)}),(0,F.jsx)(B,{text:`echo 'export ${at}=${n}' >> ~/.zshrc && source ~/.zshrc`}),(0,F.jsx)(B,{text:`codex mcp add ${z} --url ${t} --bearer-token-env-var ${at}`})]}):(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(V,{children:j(`mcp.terminal`)}),(0,F.jsx)(B,{text:`codex mcp add ${z} --url ${t}`}),(0,F.jsx)(B,{text:`codex mcp login ${z}`})]});case`gemini`:return(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(V,{children:j(`mcp.terminal`)}),(0,F.jsx)(B,{text:`gemini mcp add --scope user --transport http ${z} ${t}${r?` -H "${r}"`:``}`})]});case`cursor`:return(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(V,{children:j(`integrate.file`,{file:`~/.cursor/mcp.json`})}),(0,F.jsx)(B,{text:U(`mcpServers`,{url:t,...i})})]});case`vscode`:return(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(V,{children:j(`integrate.vscode`)}),(0,F.jsx)(B,{text:U(`servers`,{type:`http`,url:t,...i})})]});case`windsurf`:return(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(V,{children:j(`integrate.file`,{file:`~/.codeium/windsurf/mcp_config.json`})}),(0,F.jsx)(B,{text:U(`mcpServers`,{serverUrl:t,...i})})]});case`lm-studio`:return(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(V,{children:j(`integrate.file`,{file:`~/.lmstudio/mcp.json`})}),(0,F.jsx)(B,{text:U(`mcpServers`,{url:t,...i})})]});case`claude-desktop`:case`claude-ai`:return(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(V,{children:j(`mcp.claudeAi`)}),(0,F.jsx)(B,{text:t})]});case`chatgpt`:return(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(V,{children:j(`integrate.chatgpt`)}),(0,F.jsx)(B,{text:t})]});default:return(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(V,{children:j(`integrate.generic`)}),(0,F.jsx)(B,{text:t}),r?(0,F.jsx)(B,{text:r}):null]})}}function lt(){let e=l(),t=o({queryKey:[`api-keys`],queryFn:()=>c.get(`/api/studio/api-keys`)}),n=M({mutationFn:e=>c.del(`/api/studio/api-keys/${e}`),onSuccess:()=>e.invalidateQueries({queryKey:[`api-keys`]})});return t.data?.length?(0,F.jsxs)(`section`,{children:[(0,F.jsx)(`h2`,{className:`font-display font-semibold text-lg`,children:j(`mcp.keys`)}),(0,F.jsx)(`p`,{className:`mt-1 mb-4 text-[14px] text-ink-3`,children:j(`mcp.keysHint`)}),(0,F.jsx)(D,{className:`flex flex-col gap-2 p-3`,children:t.data.map(e=>(0,F.jsxs)(`div`,{className:`flex items-center gap-3 rounded-lg px-3 py-2`,children:[(0,F.jsx)(N,{className:`size-4 shrink-0 text-ink-4`}),(0,F.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,F.jsx)(`div`,{className:`truncate text-[14px]`,children:e.name}),(0,F.jsxs)(`div`,{className:`font-mono text-[11px] text-ink-4`,children:[e.start,`… ·`,` `,e.lastRequest?j(`settings.lastUsed`,{when:new Date(e.lastRequest).toLocaleString()}):j(`settings.neverUsed`)]})]}),(0,F.jsx)(O,{label:j(`settings.revoke`),onClick:()=>n.mutate(e.id),className:`hover:text-rose`,children:(0,F.jsx)(oe,{className:`size-4`})})]},e.id))})]}):null}function ut({state:e,title:t,children:n}){return(0,F.jsxs)(`li`,{className:`grid grid-cols-[22px_minmax(0,1fr)] gap-x-3`,children:[(0,F.jsx)(`span`,{className:E(`mt-0.5 grid size-[22px] place-items-center rounded-full`,e===`done`&&`bg-moss text-white`,e===`now`&&`bg-amber-tint text-ink-2`,e===`later`&&`bg-paper-2 ring-1 ring-border-soft`),children:e===`done`?(0,F.jsx)(h,{className:`size-3.5`,strokeWidth:3}):e===`now`?(0,F.jsx)(de,{className:`size-3`}):null}),(0,F.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-2 pb-4`,children:[(0,F.jsx)(`span`,{className:E(`text-[14px]`,e===`later`?`text-ink-3`:`font-medium`),children:t}),e===`now`?n:null]})]})}function dt({widgets:e}){return(0,F.jsxs)(`p`,{className:`mt-1 flex flex-wrap items-center gap-x-4 gap-y-1 text-[13px] text-ink-3`,children:[(0,F.jsxs)(`span`,{className:`inline-flex items-center gap-1.5`,title:j(`integrate.kindMcp`),children:[(0,F.jsx)(He,{className:`size-3.5 text-ember-strong`}),(0,F.jsx)(`span`,{className:`font-medium text-ink-2`,children:`MCP`}),` `,j(`integrate.kindMcpShort`)]}),(0,F.jsxs)(`span`,{className:E(`inline-flex items-center gap-1.5`,e?null:`opacity-60`),title:j(e?`integrate.kindApp`:`integrate.kindAppNo`),children:[(0,F.jsx)(_e,{className:E(`size-3.5`,e?`text-ember-strong`:`text-ink-4`)}),(0,F.jsx)(`span`,{className:`font-medium text-ink-2`,children:`MCP App`}),` `,j(e?`integrate.kindAppShort`:`integrate.kindAppNoShort`)]})]})}function ft({at:e,done:t}){let n=[j(`setup.stage.connect`),j(`setup.stage.test`),j(`setup.stage.done`)];return(0,F.jsx)(`ol`,{className:`flex flex-wrap items-center gap-x-3 gap-y-1 font-medium text-[11px] uppercase tracking-[0.14em]`,children:n.map((n,r)=>{let i=t||r<e;return(0,F.jsxs)(`li`,{"aria-current":!i&&r===e?`step`:void 0,className:E(`flex items-center gap-1`,i?`text-moss`:r===e?`text-ember-strong`:`text-ink-4`),children:[i?(0,F.jsx)(h,{className:`size-3`,strokeWidth:3}):null,n]},n)})})}function pt({client:e,local:t,seen:n,managed:r,url:i}){let a=l(),o=st(i),s=!r&&!!t&&!e.oauth,[u,d]=(0,P.useState)(s&&t?.installed!==!1?`here`:`address`),[f,p]=(0,P.useState)(null),[m,g]=(0,P.useState)(),_=M({mutationFn:t=>c.post(`/api/studio/local/apps/${e.id}`,{connect:t}),onSuccess:e=>p(e),onError:e=>p({ok:!1,message:e.message}),onSettled:()=>a.invalidateQueries({queryKey:[`local-apps`]})}),v=M({mutationFn:()=>c.post(`/api/studio/api-keys`,{name:e.name.slice(0,32)}),onSuccess:async e=>{g(e.key),await a.invalidateQueries({queryKey:[`api-keys`]})}}),y=e.oauth===!0||e.id===`claude-desktop`,b=u===`address`&&y&&!(r&&o),x=u===`here`?!!t?.connected:r||!!m,S=!!n?.toolAt,C=S?2:x||n?1:0,w=e=>(0,F.jsx)(B,{text:e});return(0,F.jsxs)(`div`,{className:`flex flex-col gap-5`,children:[(0,F.jsxs)(`div`,{className:`flex flex-wrap items-start gap-x-4 gap-y-2`,children:[(0,F.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,F.jsx)(`h2`,{className:`font-display font-semibold text-[22px] leading-tight tracking-tight`,children:e.name}),(0,F.jsx)(dt,{widgets:e.widgets})]}),(0,F.jsx)(ft,{at:C,done:S})]}),(0,F.jsxs)(D,{className:`flex flex-col gap-6 p-5 sm:p-6`,children:[s||!e.oauth?(0,F.jsx)(`fieldset`,{"aria-label":j(`integrate.where`),className:`min-w-0`,children:(0,F.jsx)(`div`,{className:`grid gap-2 sm:grid-cols-2`,children:[`here`,`address`].map(e=>{let t=e===`here`&&!s;return(0,F.jsxs)(`button`,{type:`button`,disabled:t,onClick:()=>d(e),"aria-pressed":u===e,className:E(`flex items-start gap-3 rounded-xl px-3.5 py-2.5 text-left ring-1 transition`,u===e?`bg-ember-tint/50 ring-ember-strong/40`:`ring-border-soft hover:bg-accent`,t&&`cursor-not-allowed opacity-50 hover:bg-transparent`),children:[e===`here`?(0,F.jsx)(Re,{className:`mt-0.5 size-4 shrink-0 text-ink-3`}):(0,F.jsx)(ee,{className:`mt-0.5 size-4 shrink-0 text-ink-3`}),(0,F.jsxs)(`span`,{className:`min-w-0`,children:[(0,F.jsx)(`span`,{className:`block font-medium text-[14px]`,children:j(e===`here`?`integrate.here`:`integrate.address`)}),(0,F.jsx)(`span`,{className:`block text-[12px] text-ink-3`,children:j(e===`here`?r?`integrate.hereManaged`:`integrate.hereHint`:`integrate.addressHint`)})]})]},e)})})}):null,b?(0,F.jsx)(H,{title:j(`mcp.notHere`),children:(0,F.jsx)(V,{children:j(r?`mcp.needsPublic`:`integrate.oauthLocal`)})}):u===`here`?(0,F.jsxs)(H,{title:j(`integrate.connectTitle`),children:[t?.installed===!1&&!t.connected?(0,F.jsx)(V,{children:j(`integrate.notInstalled`,{app:e.name})}):null,t?.connected?(0,F.jsxs)(`div`,{className:`flex flex-wrap items-center gap-3`,children:[(0,F.jsxs)(`span`,{className:`flex items-center gap-2 text-[14px] text-ink-2`,children:[(0,F.jsx)(h,{className:`size-4 text-moss`}),j(`integrate.connected`,{app:e.name})]}),(0,F.jsx)(A,{size:`sm`,variant:`ghost`,busy:_.isPending&&_.variables===!1,onClick:()=>_.mutate(!1),children:j(`mcp.appsDisconnect`)})]}):(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(V,{children:j(`integrate.connectHint`,{app:e.name})}),(0,F.jsx)(`div`,{children:(0,F.jsxs)(A,{busy:_.isPending,onClick:()=>_.mutate(!0),children:[(0,F.jsx)(T,{className:`size-4`}),` `,j(`integrate.connect`,{app:e.name})]})})]}),f&&!f.ok?(0,F.jsx)(`p`,{className:`text-[13px] text-rose`,children:f.message}):null,f?.snippet?(0,F.jsx)(B,{text:f.snippet}):null,t?.where?(0,F.jsx)(`p`,{className:`font-mono text-[11px] text-ink-4`,children:t.where}):null]}):(0,F.jsxs)(F.Fragment,{children:[r||y?null:(0,F.jsx)(H,{title:j(`mcp.keyTitle`),children:m?(0,F.jsxs)(`p`,{className:`flex items-center gap-2 text-[14px] text-ink-2`,children:[(0,F.jsx)(h,{className:`size-4 text-moss`}),` `,j(`mcp.keyReady`)]}):(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(V,{children:j(`mcp.keyHint`)}),(0,F.jsx)(`div`,{children:(0,F.jsxs)(A,{variant:`secondary`,busy:v.isPending,onClick:()=>v.mutate(),children:[(0,F.jsx)(T,{className:`size-4`}),` `,j(`mcp.keyCreate`,{client:e.name})]})})]})}),(0,F.jsxs)(H,{title:j(`mcp.add`),children:[r||m||y?(0,F.jsx)(ct,{id:e.id,url:i,apiKey:m}):(0,F.jsx)(V,{children:j(`mcp.keyFirst`)}),r?(0,F.jsx)(V,{children:j(`mcp.oauth`)}):null,(0,F.jsx)(`p`,{className:`text-[12px] text-ink-4`,children:j(o?`mcp.addressPublic`:`mcp.addressLocal`)})]})]}),b?null:(0,F.jsxs)(H,{title:j(`integrate.test`),children:[(0,F.jsxs)(`ol`,{className:`flex flex-col`,children:[(0,F.jsx)(ut,{state:n?`done`:x?`now`:`later`,title:j(`integrate.seen`,{app:e.name}),children:(0,F.jsx)(V,{children:j(u===`here`?`integrate.restart`:`integrate.reload`,{app:e.name})})}),(0,F.jsxs)(ut,{state:n?.toolAt?`done`:n?`now`:`later`,title:j(`integrate.tool`),children:[(0,F.jsx)(V,{children:j(`integrate.askHint`,{app:e.name})}),w(j(`integrate.askTool`))]}),e.widgets?(0,F.jsxs)(ut,{state:n?.widgetAt?`done`:n?.toolAt?`now`:`later`,title:j(`integrate.widget`),children:[(0,F.jsx)(V,{children:j(`integrate.widgetHint`)}),w(j(`integrate.askWidget`))]}):null]}),S?(0,F.jsxs)(`p`,{className:`flex items-center gap-2 font-medium text-[14px] text-moss`,children:[(0,F.jsx)(h,{className:`size-4`,strokeWidth:3}),j(`integrate.works`,{app:e.name})]}):null]})]})]})}function mt(){let e=De(),t=e.data?.mode===`managed`,n=o({queryKey:[`local-apps`],queryFn:()=>c.get(`/api/studio/local/apps`),enabled:e.data?.mode===`local`}),i=o({queryKey:[`integrations-seen`],queryFn:()=>c.get(`/api/studio/integrations/seen`),refetchInterval:2500}),[a,s]=r(),{narrow:l}=I(),u=a.get(`show`),d=e=>n.data?.find(t=>t.id===e),f=e=>i.data?.[e],p=e=>{let t=d(e);return t?.installed||t?.connected?0:1},m=[...ot].sort((e,t)=>p(e.id)-p(t.id)),h=m.find(e=>e.id===u)??m[0];if(Qe(u||!l?h.name:null),!e.data||!t&&!n.data)return null;let g=e.data.mcpUrl??``,_=e=>{let t=d(e);return f(e)?.toolAt?{tone:`done`,toneLabel:j(`integrate.stateWorks`)}:t?.connected?{tone:`on`,toneLabel:j(`integrate.stateConnected`)}:t?.installed?{tone:`off`,toneLabel:j(`integrate.stateInstalled`)}:{}},v=e=>!(!u&&l)&&e===h.id;return(0,F.jsxs)(`div`,{className:`flex flex-col gap-10`,children:[(0,F.jsxs)(Ze,{children:[(0,F.jsx)(L,{label:j(`integrate.groupApps`),children:m.map(e=>(0,F.jsx)(R,{icon:e.widgets?_e:He,label:e.name,..._(e.id),selected:v(e.id),onPick:()=>s({show:e.id},{replace:!l})},e.id))}),(0,F.jsxs)(L,{label:j(`integrate.groupShare`),children:[(0,F.jsx)(R,{icon:ae,label:j(`integrate.shareLink`),badge:(0,F.jsx)(`span`,{className:`text-[11px] text-ink-4`,children:j(`integrate.soon`)}),selected:!1,disabled:!0}),(0,F.jsx)(R,{icon:ee,label:j(`integrate.shareSite`),badge:(0,F.jsx)(`span`,{className:`text-[11px] text-ink-4`,children:j(`integrate.soon`)}),selected:!1,disabled:!0})]})]}),(0,F.jsx)(pt,{client:h,local:d(h.id),seen:f(h.id),managed:t,url:g},h.id),t?null:(0,F.jsx)(lt,{}),(0,F.jsxs)(`p`,{className:`flex items-start gap-2 text-[13px] text-ink-3`,children:[(0,F.jsx)(ae,{className:`mt-0.5 size-3.5 shrink-0`}),j(`mcp.notReverse`)]})]})}var ht=[`text`,`image`,`video`,`speech`,`listening`],gt={text:[`classifier`,`standard`,`high`,`highest`],image:[`image`],video:[`video`],speech:[`speech`],listening:[`audio`]},_t=`credits`,vt=`${_t}:`;function yt(e){return e===`credits`||!!e?.startsWith(vt)}function bt(e){return e?.startsWith(vt)&&e.slice(vt.length)||null}function xt(e){return e?`${vt}${e}`:_t}function St(e){return e===`transcription`?`listening`:e}var Ct=[`openai`,`anthropic`,`google`,`fal`,`elevenlabs`,`replicate`,`gateway`],W=(e,t)=>({de:e,en:t}),G=[{id:`openai`,name:`OpenAI`,about:W(`GPT-Modelle, GPT Image und Stimmen.`,`GPT models, GPT Image and voices.`),keyUrl:`https://platform.openai.com/api-keys`,keyPlaceholder:`sk-…`,text:{classifier:`openai:gpt-5.4-mini`,standard:`openai:gpt-5.4-mini`,high:`openai:gpt-5.5`,highest:`openai:gpt-5.5`},models:{text:[{ref:`openai:gpt-5.4-mini`,label:`GPT-5.4 mini`,note:W(`schnell`,`fast`)},{ref:`openai:gpt-5.5`,label:`GPT-5.5`,note:W(`gründlich`,`thorough`)}],image:[{ref:`openai:gpt-image-2`,label:`GPT Image 2`,note:W(`vielseitig`,`versatile`)},{ref:`openai:gpt-image-1-mini`,label:`GPT Image 1 mini`,note:W(`günstig`,`low cost`)}],speech:[{ref:`openai:gpt-4o-mini-tts`,label:`GPT-4o mini TTS`,note:W(`günstig`,`low cost`)}],listening:[{ref:`openai:gpt-4o-mini-transcribe`,label:`GPT-4o mini Transcribe`,note:W(`schnell, günstig`,`fast, low cost`)},{ref:`openai:whisper-1`,label:`Whisper`}]}},{id:`anthropic`,name:`Anthropic`,about:W(`Die Claude-Modelle.`,`The Claude models.`),keyUrl:`https://console.anthropic.com/settings/keys`,keyPlaceholder:`sk-ant-…`,text:{classifier:`anthropic:claude-haiku-4-5`,standard:`anthropic:claude-haiku-4-5`,high:`anthropic:claude-sonnet-5-5`,highest:`anthropic:claude-opus-5-5`},models:{text:[{ref:`anthropic:claude-haiku-4-5`,label:`Claude Haiku 4.5`,note:W(`schnell`,`fast`)},{ref:`anthropic:claude-sonnet-5-5`,label:`Claude Sonnet 5.5`},{ref:`anthropic:claude-opus-5-5`,label:`Claude Opus 5.5`,note:W(`am stärksten`,`strongest`)}]}},{id:`google`,name:`Google Gemini`,about:W(`Gemini, Veo für Videos und Stimmen – ein Key aus dem AI Studio.`,`Gemini, Veo for video and voices – one key from AI Studio.`),keyUrl:`https://aistudio.google.com/apikey`,keyPlaceholder:`AIza…`,text:{classifier:`google:gemini-flash-lite-latest`,standard:`google:gemini-flash-latest`,high:`google:gemini-pro-latest`,highest:`google:gemini-pro-latest`},models:{text:[{ref:`google:gemini-flash-lite-latest`,label:`Gemini Flash-Lite`,note:W(`günstig`,`low cost`)},{ref:`google:gemini-flash-latest`,label:`Gemini Flash`},{ref:`google:gemini-pro-latest`,label:`Gemini Pro`,note:W(`gründlich`,`thorough`)}],image:[{ref:`google:gemini-3.1-flash-image-preview`,label:`Gemini 3.1 Flash Image`,note:W(`schnell, bearbeitet Fotos`,`fast, edits photos`)},{ref:`google:gemini-3-pro-image-preview`,label:`Gemini 3 Pro Image`,note:W(`beste Qualität`,`best quality`)}],video:[{ref:`google:veo-3.1-fast-generate-preview`,label:`Veo 3.1 Fast`,note:W(`mit Ton`,`with sound`)},{ref:`google:veo-3.1-generate-preview`,label:`Veo 3.1`,note:W(`beste Qualität`,`best quality`)}],speech:[{ref:`google:gemini-3.8-flash-tts`,label:`Gemini Flash TTS`}],listening:[{ref:`google:gemini-flash-lite-latest`,label:`Gemini Flash-Lite`}]}},{id:`fal`,name:`fal.ai`,about:W(`Hunderte Bild-, Video- und Audio-Modelle mit einem Key: FLUX, Recraft, Veo, Luma, MiniMax.`,`Hundreds of image, video and audio models with one key: FLUX, Recraft, Veo, Luma, MiniMax.`),keyUrl:`https://fal.ai/dashboard/keys`,keyPlaceholder:`xxxxxxxx-…:…`,models:{image:[{ref:`fal:fal-ai/flux/schnell`,label:`FLUX.1 schnell`,note:W(`schnell, günstig`,`fast, low cost`)},{ref:`fal:fal-ai/flux-pro/v1.1`,label:`FLUX 1.1 pro`,note:W(`hohe Qualität`,`high quality`)},{ref:`fal:fal-ai/recraft/v3/text-to-image`,label:`Recraft V3`,note:W(`Grafiken, Logos, Text im Bild`,`graphics, logos, text in images`)},{ref:`fal:fal-ai/imagen4/preview`,label:`Imagen 4`,note:W(`fotorealistisch`,`photorealistic`)}],video:[{ref:`fal:veo3/fast`,label:`Veo 3 Fast`,note:W(`mit Ton`,`with sound`)},{ref:`fal:luma-ray-2-flash`,label:`Luma Ray 2 Flash`,note:W(`schnell`,`fast`)},{ref:`fal:minimax-video`,label:`MiniMax Hailuo`}],speech:[{ref:`fal:fal-ai/minimax/speech-02-turbo`,label:`MiniMax Speech-02 Turbo`,note:W(`schnell`,`fast`)},{ref:`fal:fal-ai/minimax/speech-02-hd`,label:`MiniMax Speech-02 HD`}],listening:[{ref:`fal:wizper`,label:`Wizper`,note:W(`schnell`,`fast`)},{ref:`fal:whisper`,label:`Whisper`}]}},{id:`elevenlabs`,name:`ElevenLabs`,about:W(`Natürliche Stimmen in vielen Sprachen und genaue Transkripte.`,`Natural voices in many languages and accurate transcripts.`),keyUrl:`https://elevenlabs.io/app/settings/api-keys`,keyPlaceholder:`sk_…`,models:{speech:[{ref:`elevenlabs:eleven_multilingual_v2`,label:`Multilingual v2`,note:W(`natürlich, viele Sprachen`,`natural, many languages`)},{ref:`elevenlabs:eleven_flash_v2_5`,label:`Flash v2.5`,note:W(`schnell, günstig`,`fast, low cost`)},{ref:`elevenlabs:eleven_v3`,label:`Eleven v3`,note:W(`ausdrucksstark`,`expressive`)}],listening:[{ref:`elevenlabs:scribe_v2`,label:`Scribe v2`,note:W(`sehr genau`,`very accurate`)}]}},{id:`replicate`,name:`Replicate`,about:W(`Offene Bild- und Video-Modelle, abgerechnet pro Lauf.`,`Open image and video models, billed per run.`),keyUrl:`https://replicate.com/account/api-tokens`,keyPlaceholder:`r8_…`,models:{image:[{ref:`replicate:black-forest-labs/flux-schnell`,label:`FLUX.1 schnell`,note:W(`schnell, günstig`,`fast, low cost`)},{ref:`replicate:black-forest-labs/flux-1.1-pro`,label:`FLUX 1.1 pro`},{ref:`replicate:recraft-ai/recraft-v3`,label:`Recraft V3`}],video:[{ref:`replicate:minimax/video-01`,label:`MiniMax Video-01`}]}},{id:`gateway`,name:`Vercel AI Gateway`,about:W(`Ein Key für die Modelle vieler Anbieter, abgerechnet bei Vercel.`,`One key for many providers' models, billed by Vercel.`),keyUrl:`https://vercel.com/d?to=%2F%5Bteam%5D%2F%7E%2Fai-gateway%2Fapi-keys`,keyPlaceholder:`vck_…`,text:{classifier:`anthropic/claude-haiku-4.5`,standard:`anthropic/claude-haiku-4.5`,high:`anthropic/claude-sonnet-5.5`,highest:`anthropic/claude-sonnet-5.5`},models:{text:[{ref:`anthropic/claude-haiku-4.5`,label:`Claude Haiku 4.5`,note:W(`schnell`,`fast`)},{ref:`anthropic/claude-sonnet-5.5`,label:`Claude Sonnet 5.5`},{ref:`openai/gpt-5.5`,label:`GPT-5.5`},{ref:`google/gemini-3.5-flash`,label:`Gemini 3.5 Flash`}],image:[{ref:`google/gemini-3.1-flash-image`,label:`Gemini 3.1 Flash Image`}],video:[{ref:`google/veo-3.1-fast-generate-001`,label:`Veo 3.1 Fast`,note:W(`mit Ton`,`with sound`)}],speech:[{ref:`google/gemini-3.8-flash-tts`,label:`Gemini Flash TTS`}],listening:[{ref:`google/gemini-3.5-flash-lite`,label:`Gemini 3.5 Flash-Lite`}]}}];function K(e){return G.find(t=>t.id===e)??null}function wt(e){if(yt(e))return null;let t=/^([a-z]+):/.exec(e)?.[1];return t?Ct.includes(t)?t:null:e?.includes(`/`)?`gateway`:null}function q(e){for(let t of G)for(let n of Object.values(t.models)){let t=n?.find(t=>t.ref===e);if(t)return t.label}return e.replace(/^[a-z]+:/,``)}function Tt(e,t){let n=t===`auto`?e.mode===`managed`:t===`cloud`,r=t===`auto`||t===`linked`?e.account??(t===`linked`?{name:e.user.name,email:e.user.email,credits:1250,expiring:[],url:``,cloudUrl:``,signedIn:!0}:null):null;return{cloud:n,account:n?null:r,credits:n||!!r?.signedIn,balance:n?e.credits??(t===`cloud`?1250:null):r?.credits??null,topUp:Ee(e),harnesses:n?[]:e.harnesses,canEdit:!n||e.tenant.role!==`member`}}var J={text:se,image:ie,video:b,speech:x,listening:Fe},Y={text:`standard`,image:`image`,video:`video`,speech:`speech`,listening:`audio`},X=e=>e===`text`,Et=(e,t)=>e?.[t]??``;function Dt(e,t){return JSON.stringify(e)===JSON.stringify(t)}function Ot(e,t,n){let r=Y[t];if(X(t)&&!n.cloud){if(e.source===`account`)return{kind:`credits`};if(e.source!==`own`)return{kind:`client`,id:e.source}}let i=e.bindings[r];if(yt(i))return{kind:`credits`};if(i?.startsWith(`ollama:`))return{kind:`local`};let a=i?wt(i):null;if(a)return{kind:`key`,provider:a};if(i&&/^(claude|codex|gemini|cursor)\//.test(i))return{kind:`client`,id:i.split(`/`)[0]};let o=e.ways[r];switch(o.kind){case`client`:return{kind:`client`,id:o.by};case`key`:return K(o.by??``)?{kind:`key`,provider:o.by}:null;case`local`:return{kind:`local`};case`credits`:return{kind:`credits`};default:return null}}function kt(e,t,n){if(X(t)&&e.text)return e.text;let r=Y[t],i=n.bindings[r],a=i&&wt(i)===e.id?i:e.models[t]?.[0]?.ref;return a?{[r]:a}:{}}function At(e){return e.version===null?{note:j(`models.noteMissing`),noteTone:`warn`}:e.auth===`none`?{note:j(`models.noteSignedOut`),noteTone:`warn`}:e.auth===`api_key`?{note:j(`models.noteShellKey`)}:{note:j(`models.noteIncluded`),noteTone:`done`}}function jt(e,t){switch(e.kind){case`client`:return{text:t.harnesses.find(t=>t.id===e.by)?.name??e.by??``,tone:`done`};case`key`:return{text:K(e.by??``)?.name??e.by??``,tone:`done`};case`local`:return{text:j(`models.way.local`),tone:`done`};case`credits`:return{text:t.cloud?j(`models.way.creditsTeam`):j(`models.way.credits`),tone:`ok`};default:return{text:j(`models.way.none`),tone:`warn`}}}function Mt(){return o({queryKey:[`models`],queryFn:()=>c.get(`/api/studio/models`)})}function Z(){let e=l();return M({mutationFn:e=>c.put(`/api/studio/models`,e),onSuccess:async t=>{e.setQueryData([`models`],t),await e.invalidateQueries({queryKey:[`me`]})}})}function Q({title:e,aside:t,children:n}){return(0,F.jsxs)(`section`,{className:`flex flex-col gap-3 border-border-soft border-t pt-5 first:border-t-0 first:pt-0`,children:[(0,F.jsxs)(`div`,{className:`flex items-baseline justify-between gap-3`,children:[(0,F.jsx)(`h3`,{className:`font-medium text-[14px]`,children:e}),t]}),n]})}function $({children:e}){return(0,F.jsx)(`p`,{className:`text-[13px] text-ink-3`,children:e})}function Nt({text:e,tone:t}){return(0,F.jsxs)(`span`,{className:E(`inline-flex h-7 shrink-0 items-center gap-1.5 rounded-full px-3 font-medium text-[12px]`,t===`done`&&`bg-moss-tint text-moss`,t===`ok`&&`bg-amber-tint text-ink-2`,t===`warn`&&`bg-paper-2 text-ink-3`),children:[t===`done`?(0,F.jsx)(h,{className:`size-3.5`,strokeWidth:3}):null,t===`ok`?(0,F.jsx)(C,{className:`size-3.5`}):null,t===`warn`?(0,F.jsx)(y,{className:`size-3.5`}):null,e]})}function Pt({icon:e,title:t,lead:n,status:r}){return(0,F.jsxs)(`div`,{className:`flex items-start gap-3 sm:gap-4`,children:[(0,F.jsx)(`span`,{className:`grid size-10 shrink-0 place-items-center rounded-xl bg-ember-tint text-ember-strong`,children:(0,F.jsx)(e,{className:`size-5`})}),(0,F.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,F.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-3 gap-y-1`,children:[(0,F.jsx)(`h2`,{className:`font-display font-semibold text-[22px] leading-tight tracking-tight`,children:t}),r]}),(0,F.jsx)(`p`,{className:`mt-0.5 text-[14px] text-ink-3`,children:n})]})]})}function Ft({label:e,children:t}){return(0,F.jsxs)(`div`,{className:`grid items-start gap-x-4 gap-y-1.5 sm:grid-cols-[7.5rem_minmax(0,1fr)]`,children:[(0,F.jsx)(`span`,{className:`pt-2 text-[12px] text-ink-3`,children:e}),(0,F.jsx)(`div`,{className:`flex flex-wrap gap-2`,children:t})]})}function It({selected:e,title:t,note:n,noteTone:r,disabled:i,onPick:a}){return(0,F.jsxs)(`button`,{type:`button`,onClick:a,disabled:i,"aria-pressed":e,title:n,className:E(`inline-flex h-9 items-center gap-1.5 rounded-full border px-3.5 text-[13px] transition coarse:h-11`,e?`border-ember bg-ember-tint font-medium text-ink`:r===`done`?`border-input bg-card text-ink hover:border-ink-4`:`border-border-soft border-dashed text-ink-3 hover:border-ink-4 hover:text-ink`,i&&`cursor-not-allowed opacity-50`),children:[r===`done`?(0,F.jsx)(h,{className:`size-3.5 text-moss`,strokeWidth:3}):null,t,(0,F.jsxs)(`span`,{className:`sr-only`,children:[`: `,n]})]})}function Lt({provider:e,stored:t,place:n}){let r=Z(),[i,a]=(0,P.useState)(``),[o,s]=(0,P.useState)(!1),[l,u]=(0,P.useState)(null),d=M({mutationFn:t=>c.post(`/api/studio/models/keys/${e.id}/check`,t?{key:t}:{})}),f=async()=>{u(null);let t=await d.mutateAsync(i.trim());if(!t.ok){u({ok:!1,message:t.message??j(`models.keyBad`)});return}await r.mutateAsync({keys:{[e.id]:i.trim()}}),a(``),s(!1),u({ok:!0,message:j(`models.keyOk`)})};return(0,F.jsxs)(`div`,{className:`flex flex-col gap-2.5`,children:[!t||o?(0,F.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,F.jsx)(k,{type:`password`,autoComplete:`off`,className:`min-w-0 flex-1 font-mono text-[13px]`,placeholder:e.keyPlaceholder,value:i,disabled:!n.canEdit,onChange:e=>a(e.target.value),onKeyDown:e=>{e.key===`Enter`&&i.trim()&&f()}}),(0,F.jsx)(A,{busy:d.isPending||r.isPending,disabled:!i.trim()||!n.canEdit,onClick:()=>void f(),children:j(`models.keySave`)}),o?(0,F.jsx)(A,{variant:`ghost`,onClick:()=>s(!1),children:j(`common.cancel`)}):null]}):(0,F.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-3 gap-y-2`,children:[(0,F.jsxs)(`span`,{className:`flex items-center gap-2 text-[14px] text-ink-2`,children:[(0,F.jsx)(N,{className:`size-4 text-moss`}),` `,j(`models.keyStored`)]}),(0,F.jsx)(A,{size:`sm`,variant:`ghost`,busy:d.isPending,onClick:async()=>{let e=await d.mutateAsync(void 0);u(e.ok?{ok:!0,message:j(`models.keyOk`)}:{ok:!1,message:e.message??j(`models.keyBad`)})},children:j(`models.keyCheck`)}),n.canEdit?(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(A,{size:`sm`,variant:`ghost`,onClick:()=>s(!0),children:j(`models.keyReplace`)}),(0,F.jsx)(A,{size:`sm`,variant:`danger`,busy:r.isPending,onClick:()=>{u(null),r.mutate({keys:{[e.id]:``}})},children:j(`models.keyRemove`)})]}):null]}),l?(0,F.jsxs)(`p`,{className:E(`flex items-center gap-1.5 text-[13px]`,l.ok?`text-moss`:`text-rose`),children:[l.ok?(0,F.jsx)(h,{className:`size-3.5`,strokeWidth:3}):null,l.message]}):null,(0,F.jsxs)(`p`,{className:`flex flex-wrap items-center gap-x-3 gap-y-1 text-[12px] text-ink-4`,children:[(0,F.jsxs)(`button`,{type:`button`,onClick:()=>Ae(e.keyUrl),className:`inline-flex items-center gap-1 font-medium text-ember-strong hover:underline`,children:[j(`models.keyGet`,{name:e.name}),` `,(0,F.jsx)(te,{className:`size-3`})]}),(0,F.jsx)(`span`,{children:n.cloud?j(`models.keyWhereCloud`):j(`models.keyWhereLocal`)})]})]})}var Rt=`__custom__`;function zt({provider:e,cap:t,value:n,onPick:r,disabled:i}){let a=le,o=e.models[t]??[],s=o.some(e=>e.ref===n),[c,l]=(0,P.useState)(!s&&!!n),[u,d]=(0,P.useState)(s?``:n.replace(/^[a-z]+:/,``)),f=e.id===`gateway`?``:`${e.id}:`;return(0,F.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,F.jsx)(me,{value:c?Rt:n,onChange:e=>{if(e===Rt){l(!0);return}l(!1),r(e)},options:[...o.map(e=>({value:e.ref,label:e.note?`${e.label} – ${Et(e.note,a)}`:e.label})),{value:Rt,label:j(`models.modelCustom`)}]}),c?(0,F.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,F.jsx)(k,{className:`min-w-0 flex-1 font-mono text-[13px]`,value:u,disabled:i,placeholder:o[0]?.ref.replace(/^[a-z]+:/,``)??``,onChange:e=>d(e.target.value)}),(0,F.jsx)(A,{variant:`secondary`,disabled:!u.trim()||i,onClick:()=>r(`${f}${u.trim()}`),children:j(`settings.save`)})]}):null]})}function Bt({provider:e,state:t}){let n=n=>q(t.bindings[n]??e.text?.[n]??``);return(0,F.jsxs)(`dl`,{className:`grid grid-cols-[auto_minmax(0,1fr)] gap-x-4 gap-y-1 text-[14px]`,children:[(0,F.jsx)(`dt`,{className:`text-ink-3`,children:j(`models.textSimple`)}),(0,F.jsx)(`dd`,{className:`truncate font-medium`,children:n(`standard`)}),(0,F.jsx)(`dt`,{className:`text-ink-3`,children:j(`models.textDemanding`)}),(0,F.jsx)(`dd`,{className:`truncate font-medium`,children:n(`high`)})]})}function Vt({provider:e,state:t,onPick:n,disabled:r}){return(0,F.jsxs)(`details`,{className:`group rounded-lg ring-1 ring-border-soft`,children:[(0,F.jsx)(`summary`,{className:`cursor-pointer list-none px-3 py-2.5 text-[13px] text-ink-2 hover:text-ink`,children:(0,F.jsxs)(`span`,{className:`inline-flex items-center gap-1.5`,children:[(0,F.jsx)(p,{className:`size-3.5 transition group-open:rotate-90`}),j(`models.perClass`)]})}),(0,F.jsx)(`div`,{className:`flex flex-col gap-3 px-3 pt-1 pb-3`,children:ke.map(i=>(0,F.jsxs)(`div`,{className:`grid items-center gap-2 sm:grid-cols-[9rem_minmax(0,1fr)]`,children:[(0,F.jsxs)(`div`,{children:[(0,F.jsx)(`div`,{className:`text-[13px] text-ink-2`,children:j(`class.${i}`)}),(0,F.jsx)(`div`,{className:`text-[11px] text-ink-4 leading-snug`,children:j(`class.${i}.hint`)})]}),(0,F.jsx)(zt,{provider:e,cap:`text`,value:t.bindings[i]??e.text?.[i]??``,disabled:r,onPick:e=>n(i,e)})]},i))})]})}function Ht({cap:e,disabled:t}){let n=Y[e],r=M({mutationFn:()=>c.post(`/api/studio/models/test`,{cls:n,lang:le})}),i=r.data;return(0,F.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(0,F.jsxs)(`div`,{className:`flex flex-wrap items-center gap-3`,children:[(0,F.jsx)(A,{variant:`secondary`,busy:r.isPending,disabled:t,onClick:()=>r.mutate(),children:j(`models.try.${e}`)}),(0,F.jsx)(`span`,{className:`text-[12px] text-ink-4`,children:e===`video`?j(`models.tryCostVideo`):X(e)?null:j(`models.tryCost`)})]}),r.isPending&&e!==`text`?(0,F.jsxs)(`p`,{className:`flex items-center gap-2 text-[13px] text-ink-3`,children:[(0,F.jsx)(de,{className:`size-3.5`}),` `,j(e===`video`?`models.tryWaitVideo`:`models.tryWait`)]}):null,i?.ok?(0,F.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[i.media&&e===`image`?(0,F.jsx)(`img`,{src:i.media,alt:``,className:`size-48 rounded-lg object-cover ring-1 ring-border-soft`}):null,i.media&&e===`speech`?(0,F.jsx)(`audio`,{src:i.media,controls:!0,autoPlay:!0,className:`w-full max-w-sm`}):null,i.media&&e===`video`?(0,F.jsx)(`video`,{src:i.media,controls:!0,autoPlay:!0,muted:!0,className:`w-full max-w-md rounded-lg`}):null,(0,F.jsxs)(`p`,{className:`flex items-start gap-2 text-[13px] text-ink-2`,children:[(0,F.jsx)(h,{className:`mt-0.5 size-3.5 shrink-0 text-moss`,strokeWidth:3}),(0,F.jsx)(`span`,{children:e===`listening`?i.reply?j(`models.tryHeard`,{text:i.reply}):j(`models.tryHeardNothing`):X(e)?j(`local.testOk`,{s:(i.ms/1e3).toFixed(1),ref:q(i.ref??``),reply:i.reply??``}):j(`models.tryOk`,{s:(i.ms/1e3).toFixed(1),model:q(i.ref??``)})})]})]}):null,i&&!i.ok?(0,F.jsx)(`p`,{className:`text-[13px] text-rose`,children:j(`models.tryFailed`,{error:i.error??``})}):null,r.isError?(0,F.jsx)(`p`,{className:`text-[13px] text-rose`,children:j(`models.tryFailed`,{error:r.error.message})}):null]})}function Ut(e){let t=e=>(e<10?Math.round(e*10)/10:Math.ceil(e)).toLocaleString();return e?.creditsPerImage?j(`models.notePerImage`,{n:t(e.creditsPerImage)}):e?.creditsPerSecond?j(`models.notePerSecond`,{n:t(e.creditsPerSecond)}):e?.creditsPer1kCharacters?j(`models.notePer1k`,{n:t(e.creditsPer1kCharacters)}):e?.creditsPerMinute?j(`models.notePerMinute`,{n:t(e.creditsPerMinute)}):j(`models.noteUsage`)}function Wt(e,t){let n=bt(t.bindings[Y[e]]);return Ut((n?t.creditModels.find(e=>e.id===n):null)??t.prices?.[Y[e]])}function Gt(e,t,n){return e.creditModels.filter(e=>St(e.kind)===t&&(!n||e.source===n||e.provider===n))}function Kt({cap:e,state:t,disabled:n}){let r=Z(),i=Y[e],a=bt(t.bindings[i]),o=Gt(t,e),s=t.prices?.[i]?.model,c=e=>e.source===`ai-gateway`?K(e.provider)?.name??e.provider:K(e.source)?.name??e.source;return(0,F.jsx)(me,{value:a??``,onChange:e=>r.mutate({bindings:{[i]:xt(e||null)}}),options:[{value:``,label:s?j(`models.creditsAuto`,{model:q(s)}):j(`models.creditsAutoNone`)},...o.map(e=>({value:e.id,label:`${e.name} · ${c(e)} – ${Ut(e)}`,disabled:n}))]})}function qt({models:e,state:t,place:n}){let r=Z();return(0,F.jsx)(`ul`,{className:`flex flex-col divide-y divide-border-soft`,children:e.map(e=>{let i=St(e.kind),a=Y[i],o=t.bindings[a]===xt(e.id);return(0,F.jsxs)(`li`,{className:`flex flex-wrap items-center gap-3 py-2.5`,children:[(0,F.jsx)(C,{className:`size-4 shrink-0 text-ink-3`}),(0,F.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[(0,F.jsx)(`span`,{className:`block font-medium text-[14px]`,children:e.name}),(0,F.jsxs)(`span`,{className:`block text-[12px] text-ink-3`,children:[j(`models.cap.${i}`),` · `,Ut(e)]})]}),o?(0,F.jsxs)(`span`,{className:`flex items-center gap-1 font-medium text-[12px] text-moss`,children:[(0,F.jsx)(h,{className:`size-3.5`,strokeWidth:3}),` `,j(`models.inUse`)]}):(0,F.jsx)(A,{size:`sm`,variant:`secondary`,disabled:!n.canEdit||!n.credits,busy:r.isPending&&r.variables?.bindings?.[a]===xt(e.id),onClick:()=>r.mutate({bindings:{[a]:xt(e.id)}}),children:j(`models.useFor`)})]},e.id)})})}function Jt({cap:e,state:t,place:n,me:r,onOpen:i}){let a=Z(),o=Y[e],s=t.ways[o],c=Ot(t,e,n),[l,u]=(0,P.useState)(!1),d=jt(s,n),f=n.harnesses.filter(t=>(X(e)||e===`image`&&t.images)&&(t.version!==null||c?.kind===`client`&&c.id===t.id)),p=G.filter(t=>t.models[e]?.length),m=r=>{if(u(!1),r.kind===`credits`&&!n.credits){u(!0);return}if(Dt(r,c))return;let i=gt[e],s=e=>Object.fromEntries(i.map(t=>[t,e]));switch(r.kind){case`client`:a.mutate(X(e)?{source:r.id}:{bindings:{[o]:`${r.id}/image`}});return;case`key`:{let i=K(r.provider);a.mutate({...X(e)&&!n.cloud?{source:`own`}:{},bindings:kt(i,e,t)});return}case`local`:a.mutate({source:`own`,bindings:s(`ollama:qwen3`)});return;case`credits`:a.mutate(X(e)&&!n.cloud?{source:`account`}:{bindings:s(_t)});return}},h=c?.kind===`key`?K(c.provider):null,g=h?!t.keys[h.id]:!1,_=c?.kind===`client`?n.harnesses.find(e=>e.id===c.id):null,v=s.kind!==`none`;return(0,F.jsxs)(`div`,{className:`flex flex-col gap-5`,children:[(0,F.jsx)(Pt,{icon:J[e],title:j(`models.cap.${e}`),lead:j(`models.cap.${e}.hint`),status:(0,F.jsx)(Nt,{...d})}),(0,F.jsxs)(D,{className:`flex flex-col gap-6 p-5 sm:p-6`,children:[(0,F.jsxs)(Q,{title:j(`models.who`),children:[(0,F.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[f.length?(0,F.jsx)(Ft,{label:j(`models.optSubscription`),children:f.map(e=>(0,F.jsx)(It,{title:e.name,...At(e),selected:c?.kind===`client`&&c.id===e.id,disabled:!n.canEdit,onPick:()=>m({kind:`client`,id:e.id})},e.id))}):null,(0,F.jsx)(Ft,{label:j(`models.optKey`),children:p.map(e=>(0,F.jsx)(It,{title:e.name,note:t.keys[e.id]?j(`models.noteKey`):j(`models.noteNoKey`),noteTone:t.keys[e.id]?`done`:void 0,selected:c?.kind===`key`&&c.provider===e.id,disabled:!n.canEdit,onPick:()=>m({kind:`key`,provider:e.id})},e.id))}),(0,F.jsxs)(Ft,{label:X(e)&&!n.cloud?j(`models.optOther`):j(`models.optCreditsGroup`),children:[X(e)&&!n.cloud?(0,F.jsx)(It,{title:j(`models.optLocal`),note:j(`models.optLocalNote`),selected:c?.kind===`local`,disabled:!n.canEdit,onPick:()=>m({kind:`local`})}):null,(0,F.jsx)(It,{title:n.cloud?j(`models.creditsTeam`):j(`models.creditsName`),note:n.credits?Wt(e,t):j(`models.noteNeedsAccount`),noteTone:n.credits?`done`:void 0,selected:c?.kind===`credits`,disabled:!n.canEdit,onPick:()=>m({kind:`credits`})})]})]}),l?(0,F.jsxs)(`p`,{className:`text-[13px] text-ink-2`,children:[j(`local.sourceNeedsAccount`),` `,(0,F.jsx)($t,{})]}):null,a.isError?(0,F.jsx)(`p`,{className:`text-[13px] text-rose`,children:a.error.message}):null]}),h?(0,F.jsxs)(F.Fragment,{children:[g?(0,F.jsxs)(Q,{title:j(`models.keyFor`,{name:h.name}),children:[(0,F.jsx)(Lt,{provider:h,stored:!1,place:n}),n.credits?(0,F.jsxs)($,{children:[(0,F.jsx)(C,{className:`mr-1 inline size-3.5 align-[-2px]`}),j(`models.keyFallback`)]}):null]}):null,g&&n.credits&&Gt(t,e,h.id).length?(0,F.jsx)(Q,{title:j(`models.viaCredits`,{name:h.name}),children:(0,F.jsx)(qt,{models:Gt(t,e,h.id),state:t,place:n})}):null,(0,F.jsx)(Q,{title:j(`models.model`),aside:g?null:(0,F.jsx)(`button`,{type:`button`,onClick:()=>i({type:`provider`,id:h.id}),className:`text-[12px] text-ink-3 hover:text-ink`,children:j(`models.manageKey`,{name:h.name})}),children:X(e)&&h.text?(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(Bt,{provider:h,state:t}),(0,F.jsx)(Vt,{provider:h,state:t,disabled:!n.canEdit,onPick:(e,t)=>a.mutate({bindings:{[e]:t}})})]}):(0,F.jsx)(zt,{provider:h,cap:e,value:t.bindings[o]??h.models[e]?.[0]?.ref??``,disabled:!n.canEdit,onPick:e=>a.mutate({bindings:{[o]:e}})},`${h.id}:${t.bindings[o]??``}`)})]}):null,c?.kind===`client`&&_?X(e)?(0,F.jsx)(Q,{title:_.name,children:(0,F.jsx)(Ne,{me:r,id:_.id})}):(0,F.jsx)(Q,{title:_.name,children:(0,F.jsx)($,{children:j(`models.clientImages`,{name:_.name,sub:j(`harness.sub.${_.id}`)})})}):null,c?.kind===`local`?(0,F.jsx)(Yt,{state:t,disabled:!n.canEdit}):null,c?.kind===`credits`&&n.credits?X(e)?(0,F.jsx)(Q,{title:j(`models.creditsName`),children:(0,F.jsxs)($,{children:[j(`models.creditsPicks`),s.kind===`credits`&&s.ref?` ${j(`models.creditsModel`,{model:q(s.ref)})}`:``]})}):(0,F.jsxs)(Q,{title:j(`models.model`),children:[(0,F.jsx)(Kt,{cap:e,state:t,disabled:!n.canEdit}),(0,F.jsx)($,{children:j(`models.creditsPickHint`)})]}):null,s.kind===`none`&&s.problem?(0,F.jsxs)(`p`,{className:`flex items-start gap-2 rounded-lg bg-paper-2 px-3 py-2.5 text-[13px] text-ink-2`,children:[(0,F.jsx)(y,{className:`mt-0.5 size-3.5 shrink-0 text-ink-3`}),s.problem]}):null,c?.kind===`client`&&X(e)?null:(0,F.jsx)(Q,{title:j(`models.try`),children:(0,F.jsx)(Ht,{cap:e,disabled:!v||!n.canEdit},`${e}:${s.ref}`)}),X(e)&&r.subscriptions.includes(`claude`)&&!n.cloud?(0,F.jsx)(Xt,{me:r}):null]})]})}function Yt({state:e,disabled:t}){let n=Z(),[r,i]=(0,P.useState)(e.ollamaUrl),[a,o]=(0,P.useState)((e.bindings.standard??`ollama:qwen3`).replace(/^ollama:/,``));return(0,F.jsxs)(Q,{title:j(`models.optLocal`),children:[(0,F.jsx)($,{children:j(`models.ollamaHint`)}),(0,F.jsxs)(`div`,{className:`grid gap-2 sm:grid-cols-[minmax(0,1fr)_12rem_auto]`,children:[(0,F.jsx)(k,{className:`font-mono text-[13px]`,value:r,disabled:t,onChange:e=>i(e.target.value)}),(0,F.jsx)(k,{className:`font-mono text-[13px]`,value:a,disabled:t,onChange:e=>o(e.target.value)}),(0,F.jsx)(A,{variant:`secondary`,busy:n.isPending,disabled:t||!a.trim(),onClick:()=>n.mutate({ollamaUrl:r,bindings:Object.fromEntries(ke.map(e=>[e,`ollama:${a.trim()}`]))}),children:j(`settings.save`)})]})]})}function Xt({me:e}){let t=l(),n=M({mutationFn:e=>c.put(`/api/studio/local/chat`,{engine:e}),onSuccess:()=>t.invalidateQueries({queryKey:[`me`]})});return(0,F.jsxs)(Q,{title:j(`local.chat`),children:[(0,F.jsx)(`div`,{className:`flex flex-wrap gap-2`,children:[`models`,`claude`].map(t=>(0,F.jsx)(`button`,{type:`button`,"aria-pressed":e.chatEngine===t,onClick:()=>n.mutate(t),className:E(`h-9 rounded-full border px-3.5 text-[13px] transition`,e.chatEngine===t?`border-ember bg-ember-tint text-ink`:`border-input bg-card text-ink-2 hover:text-ink`),children:j(t===`claude`?`local.chatClaude`:`local.chatModels`)},t))}),(0,F.jsx)($,{children:j(`local.subscription`)})]})}function Zt({provider:e,state:t,place:n,onOpen:r}){let i=Z(),a=ht.filter(t=>e.models[t]?.length),o=t.keys[e.id],s=e.id===`gateway`?[]:t.creditModels.filter(t=>t.source===e.id||t.provider===e.id);return(0,F.jsxs)(`div`,{className:`flex flex-col gap-5`,children:[(0,F.jsx)(Pt,{icon:N,title:e.name,lead:Et(e.about,le),status:(0,F.jsx)(Nt,{text:j(o?`models.keyStored`:`models.keyNone`),tone:o?`done`:`warn`})}),(0,F.jsxs)(D,{className:`flex flex-col gap-6 p-5 sm:p-6`,children:[(0,F.jsx)(Q,{title:j(`models.key`),children:(0,F.jsx)(Lt,{provider:e,stored:o,place:n})}),(0,F.jsx)(Q,{title:j(`models.uses`),children:(0,F.jsx)(`ul`,{className:`flex flex-col divide-y divide-border-soft`,children:a.map(a=>{let o=J[a],s=Ot(t,a,n),c=s?.kind===`key`&&s.provider===e.id;return(0,F.jsxs)(`li`,{className:`flex flex-wrap items-center gap-3 py-2.5`,children:[(0,F.jsx)(o,{className:`size-4 shrink-0 text-ink-3`}),(0,F.jsxs)(`button`,{type:`button`,onClick:()=>r({type:`cap`,id:a}),className:`min-w-0 flex-1 text-left`,children:[(0,F.jsx)(`span`,{className:`block font-medium text-[14px]`,children:j(`models.cap.${a}`)}),(0,F.jsx)(`span`,{className:`block truncate text-[12px] text-ink-3`,children:(e.models[a]??[]).map(e=>e.label).join(` · `)})]}),c?(0,F.jsxs)(`span`,{className:`flex items-center gap-1 font-medium text-[12px] text-moss`,children:[(0,F.jsx)(h,{className:`size-3.5`,strokeWidth:3}),` `,j(`models.inUse`)]}):(0,F.jsx)(A,{size:`sm`,variant:`secondary`,disabled:!n.canEdit,busy:i.isPending&&i.variables?.bindings!==void 0,onClick:()=>i.mutate({...X(a)&&!n.cloud?{source:`own`}:{},bindings:kt(e,a,t)}),children:j(`models.useFor`)})]},a)})})}),s.length?(0,F.jsxs)(Q,{title:j(`models.viaCredits`,{name:e.name}),children:[(0,F.jsx)($,{children:n.credits?j(`models.viaCreditsHint`):j(`models.viaCreditsNeedsAccount`)}),(0,F.jsx)(qt,{models:s,state:t,place:n})]}):null]})]})}function Qt({me:e,id:t,state:n,place:r}){let i=Z(),a=r.harnesses.find(e=>e.id===t);if(!a)return null;let o=n.source===t,s=a.version!==null&&a.auth!==`none`;return(0,F.jsxs)(`div`,{className:`flex flex-col gap-5`,children:[(0,F.jsx)(Pt,{icon:Ce,title:a.name,lead:j(`harness.desc.${t}`),status:(0,F.jsx)(Nt,{text:At(a).note,tone:s?`done`:`warn`})}),(0,F.jsxs)(D,{className:`flex flex-col gap-6 p-5 sm:p-6`,children:[(0,F.jsx)(Q,{title:j(`models.clientSignIn`),children:(0,F.jsx)(Ne,{me:e,id:t})}),(0,F.jsxs)(Q,{title:j(`models.uses`),children:[(0,F.jsx)(`ul`,{className:`flex flex-col divide-y divide-border-soft`,children:[`text`,...a.images?[`image`]:[]].map(e=>{let a=J[e],o=Ot(n,e,r),s=o?.kind===`client`&&o.id===t;return(0,F.jsxs)(`li`,{className:`flex items-center gap-3 py-2.5`,children:[(0,F.jsx)(a,{className:`size-4 shrink-0 text-ink-3`}),(0,F.jsx)(`span`,{className:`min-w-0 flex-1 font-medium text-[14px]`,children:j(`models.cap.${e}`)}),s?(0,F.jsxs)(`span`,{className:`flex items-center gap-1 font-medium text-[12px] text-moss`,children:[(0,F.jsx)(h,{className:`size-3.5`,strokeWidth:3}),` `,j(`models.inUse`)]}):(0,F.jsx)(A,{size:`sm`,variant:`secondary`,busy:i.isPending,onClick:()=>i.mutate(e===`text`?{source:t}:{bindings:{image:`${t}/image`}}),children:j(`models.useFor`)})]},e)})}),o?null:(0,F.jsx)($,{children:j(`models.clientNotChosen`,{name:a.name})})]})]})]})}function $t(){return(0,F.jsx)(a,{to:`/settings/account`,className:`font-medium text-ember-strong underline-offset-2 hover:underline`,children:j(`local.toAccount`)})}function en({state:e,place:t,onOpen:n}){let r=Z(),i=ht.filter(t=>e.ways[Y[t]].kind===`credits`),o=t.cloud?j(`models.creditsTeam`):j(`models.creditsName`);return(0,F.jsxs)(`div`,{className:`flex flex-col gap-5`,children:[(0,F.jsx)(Pt,{icon:C,title:o,lead:t.cloud?j(`models.creditsCloudHint`):j(`models.creditsLocalLead`),status:t.balance===null?void 0:(0,F.jsx)(`span`,{className:`font-display font-semibold text-[20px] tabular-nums`,children:j(`nav.credits`,{n:Math.floor(t.balance).toLocaleString()})})}),(0,F.jsxs)(D,{className:`flex flex-col gap-6 p-5 sm:p-6`,children:[!t.cloud&&!t.account?(0,F.jsxs)(Q,{title:j(`models.creditsConnectTitle`),children:[(0,F.jsx)($,{children:j(`models.creditsLocalHint`)}),(0,F.jsx)(`div`,{children:(0,F.jsx)(a,{to:`/settings/account`,children:(0,F.jsx)(A,{children:j(`models.creditsConnect`)})})})]}):null,t.account&&!t.account.signedIn?(0,F.jsxs)(`p`,{className:`text-[13px] text-rose`,children:[j(`local.accountExpired`),` `,(0,F.jsx)($t,{})]}):null,t.account?(0,F.jsx)(Q,{title:j(`models.creditsFallback`),children:(0,F.jsxs)(`div`,{className:`flex items-start gap-3`,children:[(0,F.jsx)(fe,{checked:e.creditFallback,disabled:!t.canEdit,onChange:e=>r.mutate({creditFallback:e}),label:j(`models.creditsFallback`)}),(0,F.jsx)($,{children:e.creditFallback?j(`models.creditsFallbackOn`):j(`models.creditsFallbackOff`)})]})}):null,t.credits?(0,F.jsx)(Q,{title:j(`models.creditsOn`),aside:t.topUp?(0,F.jsxs)(`a`,{href:t.topUp,target:`_blank`,rel:`noreferrer`,className:`inline-flex items-center gap-1 font-medium text-[13px] text-ember-strong hover:underline`,children:[j(`models.creditsTopUp`),` `,(0,F.jsx)(te,{className:`size-3`})]}):null,children:i.length?(0,F.jsx)(`ul`,{className:`flex flex-col divide-y divide-border-soft`,children:i.map(t=>{let r=J[t],i=e.ways[Y[t]];return(0,F.jsx)(`li`,{children:(0,F.jsxs)(`button`,{type:`button`,onClick:()=>n({type:`cap`,id:t}),className:`flex w-full items-center gap-3 py-2.5 text-left`,children:[(0,F.jsx)(r,{className:`size-4 shrink-0 text-ink-3`}),(0,F.jsx)(`span`,{className:`min-w-0 flex-1 font-medium text-[14px]`,children:j(`models.cap.${t}`)}),(0,F.jsxs)(`span`,{className:`truncate text-[12px] text-ink-3`,children:[i.ref?q(i.ref):``,` · `,Wt(t,e)]})]})},t)})}):(0,F.jsx)($,{children:j(`models.creditsNone`)})}):null]})]})}function tn(e){return e?e===`credits`?{type:`credits`}:ht.includes(e)?{type:`cap`,id:e}:K(e)?{type:`provider`,id:e}:{type:`client`,id:e}:{type:`cap`,id:`text`}}var nn=e=>e.type===`credits`?`credits`:e.id;function rn({view:e,onView:t}){return null}function an(e){return e.kind===`none`?`off`:e.kind===`credits`?`credits`:`done`}function on(e,t){switch(e.type){case`cap`:return j(`models.cap.${e.id}`);case`provider`:return K(e.id)?.name??e.id;case`client`:return t?.harnesses.find(t=>t.id===e.id)?.name??e.id;default:return t?.mode===`managed`?j(`models.creditsTeam`):j(`models.creditsName`)}}function sn(){let e=De(),t=Mt(),[n,i]=r(),[a,o]=(0,P.useState)(`auto`),{narrow:s}=I(),c=n.get(`show`),l=tn(c);if(Qe(c||!s?on(l,e.data):null),!e.data||!t.data)return t.isError?(0,F.jsx)(`p`,{className:`text-[14px] text-rose`,children:t.error.message}):null;let u=t.data,d=Tt(e.data,a),f=e=>i({show:nn(e)},{replace:!s}),p=e=>!(!c&&s)&&nn(e)===nn(l),m=d.harnesses.filter(e=>e.version!==null||u.source===e.id),h=G.filter(e=>u.keys[e.id]),g=G.filter(e=>!u.keys[e.id]);return(0,F.jsxs)(F.Fragment,{children:[(0,F.jsxs)(Ze,{children:[(0,F.jsx)(L,{label:j(`models.groupCaps`),children:ht.map(e=>{let t=u.ways[Y[e]];return(0,F.jsx)(R,{icon:J[e],label:j(`models.cap.${e}`),tone:an(t),toneLabel:jt(t,d).text,selected:p({type:`cap`,id:e}),onPick:()=>f({type:`cap`,id:e})},e)})}),(0,F.jsxs)(L,{label:j(`models.groupAccess`),children:[(0,F.jsx)(R,{icon:C,label:d.cloud?j(`models.creditsTeam`):j(`models.creditsName`),badge:d.balance===null?null:(0,F.jsx)(`span`,{className:`text-[12px] text-ink-3 tabular-nums`,children:Math.floor(d.balance).toLocaleString()}),tone:d.credits?void 0:`off`,toneLabel:d.credits?void 0:j(`models.noteNeedsAccount`),selected:p({type:`credits`}),onPick:()=>f({type:`credits`})}),m.map(e=>(0,F.jsx)(R,{icon:Ce,label:e.name,tone:e.version!==null&&e.auth===`subscription`?`done`:e.auth===`api_key`?`on`:`off`,toneLabel:At(e).note,selected:p({type:`client`,id:e.id}),onPick:()=>f({type:`client`,id:e.id})},e.id)),h.map(e=>(0,F.jsx)(R,{icon:N,label:e.name,tone:`done`,toneLabel:j(`models.noteKey`),selected:p({type:`provider`,id:e.id}),onPick:()=>f({type:`provider`,id:e.id})},e.id))]}),g.length?(0,F.jsx)(L,{label:j(`models.groupMore`),collapsible:!0,open:g.some(e=>p({type:`provider`,id:e.id})),count:g.length,children:g.map(e=>(0,F.jsx)(R,{icon:N,label:e.name,selected:p({type:`provider`,id:e.id}),onPick:()=>f({type:`provider`,id:e.id})},e.id))}):null,(0,F.jsx)(rn,{view:a,onView:o})]}),d.canEdit?null:(0,F.jsx)(`p`,{className:`mb-4 rounded-lg bg-paper-2 px-3 py-2 text-[13px] text-ink-2`,children:j(`models.readOnly`)}),l.type===`cap`?(0,F.jsx)(Jt,{cap:l.id,state:u,place:d,me:e.data,onOpen:f},l.id):l.type===`provider`&&K(l.id)?(0,F.jsx)(Zt,{provider:K(l.id),state:u,place:d,onOpen:f},l.id):l.type===`client`?(0,F.jsx)(Qt,{me:e.data,id:l.id,state:u,place:d},l.id):(0,F.jsx)(en,{state:u,place:d,onOpen:f})]})}function cn(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 ln({project:e}){let t=l(),[n,r]=(0,P.useState)(e.mcpServers.map(e=>({...e,auth:e.headers?.Authorization??e.headers?.authorization??``}))),[i,a]=(0,P.useState)(!1),o=e.readOnly,s=M({mutationFn:()=>c.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,F.jsxs)(D,{className:`p-6`,children:[(0,F.jsx)(`h2`,{className:`font-display font-semibold text-lg`,children:j(`settings.mcp`)}),(0,F.jsx)(`p`,{className:`mt-1 mb-5 text-[14px] text-ink-3`,children:j(`settings.mcpHint`)}),(0,F.jsxs)(`fieldset`,{disabled:o,className:`flex min-w-0 flex-col gap-3`,children:[n.map((e,t)=>(0,F.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,F.jsx)(k,{placeholder:j(`settings.serverName`),value:e.name,onChange:e=>r(n=>n.map((r,i)=>i===t?{...r,name:e.target.value,id:r.id||cn(e.target.value,n.map(e=>e.id))}:r))}),(0,F.jsx)(k,{placeholder:`${j(`settings.serverUrl`)} (https://…/mcp)`,value:e.url,onChange:e=>r(n=>n.map((n,r)=>r===t?{...n,url:e.target.value}:n))}),o?(0,F.jsx)(`span`,{}):(0,F.jsx)(O,{label:`Entfernen`,onClick:()=>r(e=>e.filter((e,n)=>n!==t)),className:`hover:text-rose`,children:(0,F.jsx)(oe,{className:`size-4`})}),(0,F.jsx)(k,{className:`sm:col-span-2`,placeholder:j(`settings.serverHeader`),value:e.auth??``,onChange:e=>r(n=>n.map((n,r)=>r===t?{...n,auth:e.target.value}:n))}),e.id?(0,F.jsx)(`span`,{className:`self-center font-mono text-[11px] text-ink-4`,children:e.id}):null]},t)),o?null:(0,F.jsxs)(A,{variant:`secondary`,className:`self-start`,onClick:()=>r(e=>[...e,{id:``,name:``,url:``,auth:``}]),children:[(0,F.jsx)(T,{className:`size-4`}),` `,j(`settings.addServer`)]})]}),o?null:(0,F.jsxs)(`div`,{className:`mt-5 flex items-center justify-end gap-3`,children:[s.error?(0,F.jsx)(`p`,{className:`text-[14px] text-rose`,children:s.error.message}):null,(0,F.jsx)(A,{busy:s.isPending,onClick:()=>s.mutate(),children:j(i?`settings.saved`:`settings.save`)})]})]})}var un=new Set([`models`,`integrate`]);function dn({section:e,onBack:t}){return(0,F.jsxs)(`div`,{className:`mb-2 flex h-9 min-w-0 items-center px-1`,children:[(0,F.jsx)(`div`,{className:E(`shrink-0 overflow-hidden transition-[width,margin,opacity] duration-200 ease-out`,e?`-ml-1.5 mr-0.5 w-8 opacity-100`:`w-0 opacity-0`),children:(0,F.jsx)(`button`,{type:`button`,onClick:t,"aria-hidden":!e,tabIndex:e?void 0:-1,"aria-label":j(`settings.title`),className:`grid size-8 place-items-center rounded-lg text-ink-3 transition hover:bg-accent hover:text-ink`,children:(0,F.jsx)(f,{className:`size-4`})})}),e?(0,F.jsxs)(`span`,{className:`flex min-w-0 items-center gap-2 font-medium text-[14px]`,children:[(0,F.jsx)(e.icon,{className:`size-4 shrink-0 text-ember-strong`}),(0,F.jsx)(`span`,{className:`truncate`,children:e.label})]}):(0,F.jsx)(`span`,{className:`font-medium text-[14px]`,children:j(`settings.title`)})]})}function fn({sections:e,current:t,onPick:n}){return(0,F.jsx)(`ul`,{className:`flex flex-col gap-0.5`,children:e.map(e=>(0,F.jsx)(`li`,{children:(0,F.jsxs)(a,{to:`/settings/${e.id}`,onClick:r=>{e.id===t?.id&&(r.preventDefault(),n(e))},"aria-current":e.id===t?.id?`page`:void 0,className:E(`group flex items-center gap-2 rounded-lg px-2 py-1 text-[14px] transition max-md:py-2`,e.id===t?.id?`bg-paper-2 font-medium text-ink`:`text-ink-2 hover:bg-accent hover:text-ink`),children:[(0,F.jsx)(`span`,{className:`grid size-7 shrink-0 place-items-center`,children:(0,F.jsx)(e.icon,{className:`size-4 transition-transform duration-200 ease-out group-hover:scale-110`})}),(0,F.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:e.label}),(0,F.jsx)(_,{className:`size-4 text-ink-4 md:hidden`})]})},e.id))})}function pn(){let{section:e}=s(),[t]=r(),n=i(),a=De(),{project:o,loading:c}=Oe(),l=ve(),[d,f]=(0,P.useState)(o?.id);(0,P.useEffect)(()=>f(o?.id),[o?.id]);let p=be(),h=tt(),[g,_]=(0,P.useState)(null),[v,y]=(0,P.useState)(null),[ee,b]=(0,P.useState)(null),x=ye(a.data,p),S=x.find(t=>t.id===e),C=S?un.has(S.id):!1,w=S?C&&!t.get(`show`)?1:2:0,T=h?Math.min(w,1):C&&ee!==e?1:0,te=it(T),ne=it(w),ie=(0,P.useMemo)(()=>({slot:g,narrow:h,setDetail:y}),[g,h]);if(Se([{label:j(`settings.title`),to:`/settings`},...S?[{label:S.label,to:`/settings/${S.id}`}]:[],...S&&v?[{label:v}]:[]]),!S){if(e===`build`)return(0,F.jsx)(u,{to:`/settings/integrate`,replace:!0});if(e===`project`)return(0,F.jsx)(u,{to:`/space`,replace:!0});if(e!==void 0||!h)return p.status===`ready`||e===void 0?(0,F.jsx)(u,{to:`/settings/account`,replace:!0}):null}let ae=S?.id===`connectors`&&l;return(0,F.jsx)(Xe.Provider,{value:ie,children:(0,F.jsx)(`div`,{className:`animate-rise`,children:(0,F.jsxs)(`div`,{className:`grid gap-6 md:grid-cols-[13.5rem_minmax(0,1fr)] md:gap-8 lg:grid-cols-[15rem_minmax(0,1fr)] lg:gap-10`,children:[(0,F.jsxs)(`aside`,{className:E(`min-w-0 md:sticky md:top-20 md:self-start`,h&&w===2&&`hidden`,h&&ne===`back`&&nt(`back`)),children:[(0,F.jsx)(dn,{section:T===1?S??null:null,onBack:()=>h?n(`/settings`):b(e??null)}),(0,F.jsx)(`div`,{className:E(nt(te)),children:T===0?(0,F.jsx)(fn,{sections:x,current:h?void 0:S,onPick:()=>b(null)}):(0,F.jsx)(`div`,{ref:_})},T)]}),S?(0,F.jsxs)(`div`,{className:E(`min-w-0`,![`integrate`,`models`].includes(S.id)&&`max-w-2xl`,h&&w<2&&`hidden`,h&&ne===`deeper`&&nt(`deeper`)),children:[h?(0,F.jsx)(`div`,{className:`mb-3`,children:(0,F.jsx)(rt,{label:C?S.label:j(`settings.title`),onBack:()=>n(C?`/settings/${S.id}`:`/settings`)})}):null,ae?(0,F.jsx)(`div`,{className:`mb-6`,children:(0,F.jsx)(m,{})}):null,S.id===`connectors`&&o?(0,F.jsxs)(`div`,{className:`flex flex-col gap-6`,children:[o.readOnly?(0,F.jsx)(Me,{children:je(o)}):null,(0,F.jsx)(Je,{projectId:o.id,readOnly:o.readOnly},d),(0,F.jsx)(ln,{project:o},d)]}):null,S.id===`connectors`&&!o&&!c?(0,F.jsx)(ue,{children:j(`settings.noProject`)}):null,S.id===`models`?(0,F.jsx)(sn,{}):null,S.id===`integrate`?(0,F.jsx)(mt,{}):null,S.id===`account`&&a.data?(0,F.jsx)(re,{me:a.data}):null,S.id===`plugins`?(0,F.jsx)(Ue,{}):null,S.plugin?(0,F.jsx)(we,{of:S.plugin,children:(0,F.jsx)(S.plugin.component,{})}):null]}):null]})})})}export{pn as SettingsPage};
@@ -1 +0,0 @@
1
- import{a as e,n as t,t as n}from"./jsx-runtime-D3jfb0Ew.js";import{O as r,_ as i,d as a,j as o,m as s,n as c,nt as l}from"./api-u3nydnnp.js";import{t as ee}from"./arrow-left-hTN1VoH1.js";import{t as u}from"./arrow-right-6FyN3e7D.js";import{t as d}from"./check-CUpby_J9.js";import{t as te}from"./refresh-cw-Cmk7VCe0.js";import{h as f,t as ne,y as p}from"./ui-gGAdXx-P.js";import{I as m,f as h,p as g,w as _}from"./index-CTM5iDwf.js";import{n as v,t as y}from"./LocalRuntime-DQW6CLg-.js";import{n as re,t as ie}from"./Harness-DEGZ-_YL.js";var b=e(t(),1),x=e(n(),1),S=`oklch(50% 0.2 262)`,C=`oklch(32% 0.15 262)`,w=`oklch(90% 0.1 80)`,T=`oklch(88% 0.17 150)`,E=`oklch(88% 0.14 80)`,D=`rgb(255 255 255 / 0.38)`,ae={"--ink-2":`oklch(96% 0.02 262)`,"--ink-3":`oklch(90% 0.035 262)`,"--ink-4":`oklch(82% 0.05 262)`,"--moss":`oklch(90% 0.14 150)`,"--rose":`oklch(89% 0.09 45)`},O=`ease-[cubic-bezier(0.3,0.7,0.2,1)]`,oe=220,se={codex:`dome`,claude:`oval`,gemini:`wedge`,cursor:`sprout`,own:`bean`,account:`drop`},k=`oklch(27% 0.09 150)`,A=`relative w-fit max-w-full transition-[left,translate] duration-700 ease-[cubic-bezier(0.3,0.7,0.2,1)] motion-reduce:transition-none`,j=`left-1/2 -translate-x-1/2 text-center`,M=`max-lg:left-1/2 max-lg:-translate-x-1/2 max-lg:text-center lg:left-0 lg:translate-x-0 lg:text-left`;function N(){window.matchMedia(`(max-width: 1023px)`).matches&&window.scrollTo({top:0})}var P=`wizards.setup.own`;function F(){try{return sessionStorage.getItem(P)===`1`}catch{return!1}}function I(e){try{e?sessionStorage.setItem(P,`1`):sessionStorage.removeItem(P)}catch{}}function L(){return(0,x.jsxs)(`span`,{className:`inline-flex items-center gap-2.5`,children:[(0,x.jsx)(i,{size:28}),(0,x.jsxs)(`span`,{className:`font-display font-semibold text-[17px] tracking-tight`,children:[`engenty`,(0,x.jsx)(`span`,{className:`mr-[0.09em] ml-[0.06em]`,style:{color:w},children:`.`}),(0,x.jsx)(`span`,{className:`font-normal text-white/70`,children:`wizards`})]})]})}function R({selected:e,title:t,description:n,badge:r,note:i,onPick:a}){return(0,x.jsxs)(`button`,{type:`button`,onClick:a,"aria-pressed":e,className:f(`group relative flex w-full items-center gap-3 rounded-2xl px-4 py-3 text-left transition-[background-color,color,box-shadow] duration-300`,e?`bg-white shadow-elevated`:`bg-white/10 ring-1 ring-white/15 hover:bg-white/15`),style:e?{color:C}:void 0,children:[r?(0,x.jsx)(`span`,{className:`absolute -top-2.5 right-4 rounded-full px-2.5 py-[3px] font-semibold text-[11px] leading-none tracking-wide shadow-[0_2px_8px_oklch(0%_0_0/0.22)]`,style:{background:w,color:C},children:r}):null,(0,x.jsx)(`span`,{className:f(`flex size-5 shrink-0 items-center justify-center rounded-full border transition-colors duration-300`,e?`border-transparent`:`border-white/40`),style:e?{background:C}:void 0,children:e?(0,x.jsx)(d,{className:`size-3.5 text-white`}):null}),(0,x.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[(0,x.jsx)(`span`,{className:`block font-medium text-[15px]`,children:t}),(0,x.jsx)(`span`,{className:f(`mt-0.5 block truncate text-[13px]`,e?`opacity-70`:`text-white/65`),children:n})]}),i?(0,x.jsx)(`span`,{className:f(`shrink-0 text-[12px]`,e?`opacity-70`:`text-white/65`),children:i}):null,(0,x.jsx)(u,{className:f(`size-4 shrink-0 transition`,e?`opacity-70`:`text-white/40 group-hover:translate-x-0.5 group-hover:text-white/80`)})]})}function z({name:e,at:t,done:n}){let r=[p(`setup.stage.connect`),p(`setup.stage.test`),p(`setup.stage.done`)],i=n?r.length:t+1;return(0,x.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-4 gap-y-2 font-medium text-[12px] uppercase tracking-[0.14em]`,children:[(0,x.jsx)(`span`,{className:`text-white/70`,children:e}),(0,x.jsx)(`ol`,{className:`flex flex-wrap items-center gap-x-3 gap-y-2`,children:r.map((e,r)=>{let i=n||r<t;return(0,x.jsxs)(`li`,{"aria-current":!i&&r===t?`step`:void 0,className:`flex items-center gap-1 transition-colors duration-500`,style:{color:i?T:r===t?E:D},children:[i?(0,x.jsx)(d,{className:`size-3.5`,strokeWidth:3}):null,e]},e)})}),(0,x.jsx)(`span`,{"aria-hidden":`true`,className:`flex gap-1.5`,children:r.map((e,t)=>(0,x.jsx)(`span`,{className:`h-[3px] w-5 rounded-full transition-colors duration-500`,style:{background:t<i?n?T:E:`rgb(255 255 255 / 0.22)`}},e))})]})}function B({href:e,children:t}){return(0,x.jsx)(`a`,{href:e,target:`_blank`,rel:`noreferrer`,className:`transition hover:text-white`,onClick:t=>{t.preventDefault(),v(e)},children:t})}function V(){s(S);let e=_(),t=l(),n=r(),i=o({queryKey:[`config`],queryFn:()=>c.get(`/api/config`)}),[u,v]=(0,b.useState)(F),[E,D]=(0,b.useState)(!1),P=m({mutationFn:e=>c.put(`/api/studio/local/models`,{source:e}),onSuccess:async(e,n)=>{await t.invalidateQueries({queryKey:[`me`]}),v(!0),D(!1),N(),I(n===`own`)}}),V=m({mutationFn:()=>Promise.all((e.data?.harnesses??[]).map(e=>c.post(`/api/studio/local/harness/${e.id}/detect`))),onSuccess:()=>t.invalidateQueries({queryKey:[`me`]})});if(!e.data?.models)return null;let H=e.data.models,U=e=>(e.version===null?2:0)+ +!e.app,W=[...e.data.harnesses].sort((e,t)=>U(e)-U(t)),G=W.filter(e=>e.version!==null),K=u||e.data.setupDone||H.source!==`own`?H.source:null,q=e.data.harnesses.find(e=>e.id===K),J=e.data.setupDone,Y=Object.values(H.keys).some(Boolean),ce=J?2:q?q.auth===`none`?0:1:+!!Y,X=J?p(`setup.h.done`):q?q.version===null?p(`setup.h.install`,{name:q.name}):q.auth===`none`?p(`setup.h.signIn`,{name:q.name}):p(`setup.h.test`):p(Y?`setup.h.test`:`setup.h.keys`),Z=g.site?i.data?.site:null,Q=K!==null&&!E,$=P.isPending?P.variables??K:K;return(0,x.jsxs)(`div`,{className:`flex min-h-dvh flex-col px-6 text-white sm:px-10`,style:ae,children:[(0,x.jsxs)(`header`,{className:`flex items-center justify-between pt-6 sm:pt-8`,children:[(0,x.jsx)(L,{}),(0,x.jsx)(h,{ink:C})]}),(0,x.jsxs)(`main`,{className:`relative mx-auto flex w-full max-w-6xl flex-1 flex-col pt-6 pb-10 lg:pt-[6vh]`,children:[(0,x.jsx)(`div`,{"aria-hidden":`true`,className:f(`absolute top-6 left-1/2 z-10 origin-top -translate-x-1/2 transition-[opacity,scale,left] duration-500 motion-reduce:transition-none lg:top-[calc(6vh+5.25rem)] lg:origin-center lg:translate-x-0`,O,K?`lg:pointer-events-none lg:left-[calc(50%-560px)] lg:scale-75 lg:opacity-0`:`lg:left-[calc(50%-508px)] lg:scale-100 lg:opacity-100`,Q?`max-lg:pointer-events-none max-lg:scale-[0.4] max-lg:opacity-0`:`max-lg:scale-[0.6] max-lg:opacity-100`),children:(0,x.jsx)(`div`,{className:`animate-rise`,children:(0,x.jsx)(a,{kind:`drop`,size:oe,fluffy:!0,coat:`fur`})})}),(0,x.jsx)(`div`,{"aria-hidden":`true`,className:f(`shrink-0 transition-[height] duration-500 motion-reduce:transition-none lg:h-0`,O,Q?`max-lg:h-0`:`max-lg:h-[148px]`)}),(0,x.jsxs)(`div`,{className:`flex flex-col gap-10 lg:flex-row lg:items-start lg:gap-14`,children:[(0,x.jsxs)(`section`,{className:f(`flex w-full shrink-0 animate-rise flex-col lg:w-[32rem] lg:transition-[margin] lg:duration-700 motion-reduce:transition-none`,O,K?`lg:ml-0`:`lg:ml-[calc(50%-16rem)]`,Q?`max-lg:hidden`:``),children:[(0,x.jsxs)(`div`,{className:`flex flex-col lg:min-h-[6.5rem]`,children:[(0,x.jsx)(`p`,{className:f(A,`font-medium text-[12px] text-white/70 uppercase tracking-[0.16em]`,K?M:j),children:p(`setup.title`)}),(0,x.jsx)(`h1`,{className:f(A,`mt-2 font-display font-semibold text-[26px] leading-[1.08] tracking-[-0.02em] sm:text-[28px]`,K?M:j),children:p(`setup.source`)}),(0,x.jsx)(`p`,{className:f(A,`mt-2.5 text-[15px] text-white/75 leading-relaxed`,K?M:j),children:p(`setup.sub`)})]}),(0,x.jsxs)(`div`,{className:`mt-5 flex flex-col gap-2.5`,children:[W.map((e,t)=>(0,x.jsx)(R,{selected:$===e.id,title:e.name,description:p(`harness.desc.${e.id}`),badge:t===0?p(`setup.recommended`):void 0,note:e.version===null?p(`harness.notInstalled`):e.auth===`subscription`?p(`harness.ready`):void 0,onPick:()=>P.mutate(e.id)},e.id)),(0,x.jsx)(R,{selected:$===`own`,title:p(`local.sourceOwn`),description:p(`setup.ownDesc`),onPick:()=>P.mutate(`own`)})]}),(0,x.jsxs)(`div`,{className:`mt-3 flex flex-wrap items-center justify-center gap-x-2 gap-y-1 text-[13px] text-white/60`,children:[(0,x.jsx)(`span`,{children:G.length?null:p(`setup.noHarness`)}),(0,x.jsxs)(ne,{variant:`ghost`,size:`sm`,busy:V.isPending,onClick:()=>V.mutate(),children:[(0,x.jsx)(te,{className:`size-3.5`}),` `,p(`local.recheck`)]})]})]}),K?(0,x.jsxs)(`section`,{className:f(`min-w-0 flex-1 animate-settle`,E?`max-lg:hidden`:``),children:[(0,x.jsxs)(`button`,{type:`button`,onClick:()=>{D(!0),N()},className:`-ml-1.5 mb-5 inline-flex items-center gap-1.5 rounded-full px-1.5 py-1 text-[14px] text-white/80 transition hover:text-white lg:hidden`,children:[(0,x.jsx)(ee,{className:`size-4`}),` `,p(`run.back`)]}),(0,x.jsxs)(`div`,{className:`relative`,children:[(0,x.jsx)(`div`,{"aria-hidden":`true`,className:`absolute top-6 right-2 z-10`,children:(0,x.jsx)(a,{kind:se[K],size:120,fluffy:!0,coat:`fur`})}),(0,x.jsxs)(`div`,{className:`min-h-[6.5rem]`,children:[(0,x.jsx)(z,{name:q?.name??p(`local.sourceOwn`),at:ce,done:J}),(0,x.jsx)(`h2`,{className:`mt-2 animate-rise pr-32 font-display font-semibold text-[clamp(28px,3vw,40px)] leading-[1.06] tracking-[-0.03em]`,children:X},X)]}),(0,x.jsx)(`div`,{className:`mt-5 rounded-2xl bg-white/[0.07] p-5 ring-1 ring-white/12 sm:p-6`,children:q?(0,x.jsx)(ie,{me:e.data,id:q.id,autoTest:!J}):(0,x.jsxs)(`div`,{className:`flex flex-col gap-5`,children:[(0,x.jsx)(y,{models:H}),(0,x.jsx)(re,{})]})}),(0,x.jsxs)(`div`,{className:`mt-9`,children:[J?(0,x.jsxs)(`p`,{className:`mb-3 flex animate-rise items-center gap-2 font-medium text-[15px]`,style:{color:T},children:[(0,x.jsx)(d,{className:`size-4`,strokeWidth:3}),p(`setup.ready`)]}):null,(0,x.jsxs)(`div`,{className:`flex flex-wrap items-center gap-4`,children:[(0,x.jsxs)(`button`,{type:`button`,disabled:!J,onClick:()=>n(`/`,{replace:!0}),className:f(`group inline-flex h-12 items-center gap-2.5 rounded-full px-6 font-semibold text-[16px] transition-[background-color,color,box-shadow,filter] duration-300`,J?`shadow-[0_6px_24px_oklch(88%_0.17_150/0.35)] hover:brightness-105`:`cursor-not-allowed bg-white/20 text-white/65`),style:J?{background:T,color:k}:void 0,children:[p(`setup.done`),(0,x.jsx)(`span`,{"aria-hidden":`true`,className:`transition-transform group-enabled:group-hover:translate-x-0.5`,children:`→`})]}),J?null:(0,x.jsx)(`span`,{className:`text-[13px] text-white/65`,children:p(`setup.untilWorks`)})]})]})]})]},K):null]})]}),(0,x.jsxs)(`footer`,{className:`mx-auto flex w-full max-w-6xl items-center justify-between gap-4 pb-6 text-[12px] text-white/55 sm:pb-8`,children:[(0,x.jsxs)(`span`,{children:[`© `,new Date().getFullYear(),` engenty · `,p(`setup.local`)]}),(0,x.jsxs)(`span`,{className:`flex items-center gap-5`,children:[Z?(0,x.jsx)(B,{href:Z,children:new URL(Z).host}):null,(0,x.jsx)(`span`,{"aria-hidden":`true`,className:`size-[3px]`,style:{background:w}})]})]})]})}export{V as SetupPage};
@@ -1 +0,0 @@
1
- import{a as e,n as t,t as n}from"./jsx-runtime-D3jfb0Ew.js";import{a as r,d as i,h as a,j as o,k as s,l as c,n as l,r as u}from"./api-u3nydnnp.js";import{t as d}from"./arrow-right-6FyN3e7D.js";import{i as f,t as p}from"./outputs-CYynzGBS.js";import{_ as m,d as h,n as g,t as _,y as v}from"./ui-gGAdXx-P.js";import{BrandHeader as y,useBrandAccent as b}from"./PublicRunner-jOAbZd2P.js";var x=e(t(),1),S=e(n(),1);function C(){let{token:e}=s(),t=o({queryKey:[`share`,e],queryFn:()=>l.get(`/api/shares/${e}`),retry:(e,t)=>u(t)&&e<3});if(b(t.data?.brand.accent),a(t.data?.wizard.avatar),(0,x.useEffect)(()=>{t.data&&(document.title=`${t.data.title} · ${t.data.wizard.title}`)},[t.data]),t.isLoading)return(0,S.jsx)(`div`,{className:`flex min-h-dvh items-center justify-center text-ink-4`,children:(0,S.jsx)(h,{})});let n=t.data;if(!n)return(0,S.jsxs)(`div`,{className:`flex min-h-dvh flex-col items-center justify-center gap-4 px-6 text-center`,children:[(0,S.jsx)(i,{kind:`pebble`,size:80}),(0,S.jsx)(`p`,{className:`max-w-sm text-ink-3`,children:v(u(t.error)?`common.offline`:`sharePage.gone`)}),u(t.error)?(0,S.jsx)(_,{variant:`secondary`,onClick:()=>void t.refetch(),children:v(`common.retry`)}):null]});let C=`/api/shares/${n.token}`,w=e=>new Intl.DateTimeFormat(m,{dateStyle:`long`}).format(new Date(e));return(0,S.jsxs)(`div`,{className:`flex min-h-dvh flex-col`,children:[(0,S.jsx)(y,{brand:n.brand}),(0,S.jsxs)(`main`,{className:`mx-auto w-full max-w-3xl flex-1 animate-rise px-4 pt-6 pb-12 sm:px-6`,children:[(0,S.jsxs)(`div`,{className:`mb-8 flex flex-wrap items-center gap-4`,children:[(0,S.jsx)(i,{kind:n.wizard.avatar,size:64}),(0,S.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,S.jsx)(`p`,{className:`text-[13px] text-ink-4`,children:n.expiresAt?v(`sharePage.until`,{date:w(n.expiresAt)}):v(`sharePage.shared`,{date:w(n.createdAt)})}),(0,S.jsx)(`h1`,{className:`font-display font-semibold text-[28px] leading-tight tracking-tight sm:text-[32px]`,children:n.title}),n.message?(0,S.jsx)(`p`,{className:`mt-1 text-[15px] text-ink-3`,children:n.message}):null]})]}),(0,S.jsx)(`div`,{className:`flex flex-col gap-6`,children:n.shown.map(({step:e,output:t,formats:n,label:r})=>(0,S.jsxs)(g,{className:`p-4 sm:p-5`,children:[(0,S.jsxs)(`div`,{className:`mb-3 flex flex-wrap items-center justify-between gap-3`,children:[(0,S.jsx)(`h2`,{className:`font-display font-semibold text-[17px]`,children:r??e.title}),(0,S.jsx)(p,{base:C,stepId:e.id,formats:n,title:r??e.title})]}),(0,S.jsx)(f,{base:C,step:e,output:t})]},e.id))}),n.wizardUrl?(0,S.jsxs)(`a`,{href:n.wizardUrl,className:`mt-10 flex items-center gap-4 rounded-2xl bg-card p-5 shadow-soft ring-1 ring-border-soft transition hover:shadow-elevated`,children:[(0,S.jsx)(i,{kind:n.wizard.avatar,size:44,interactive:!1}),(0,S.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,S.jsx)(`div`,{className:`font-display font-semibold text-[16px]`,children:n.wizard.title}),n.wizard.description?(0,S.jsx)(`div`,{className:`truncate text-[14px] text-ink-3`,children:n.wizard.description}):null]}),(0,S.jsxs)(`span`,{className:`inline-flex items-center gap-1.5 font-medium text-[14px] text-ember-strong`,children:[v(`sharePage.own`),` `,(0,S.jsx)(d,{className:`size-4`})]})]}):null]}),(0,S.jsx)(`footer`,{className:`safe-bottom pt-6 text-center text-[12px] text-ink-4`,children:(0,S.jsx)(`a`,{href:`${r}/`,className:`inline-block py-3.5 hover:text-ink-2`,children:v(`run.madeWith`).replace(`engenty wizards`,c.name)})})]})}export{C as SharePage};
@@ -1 +0,0 @@
1
- import{t as e}from"./createLucideIcon-q3MZMmnf.js";var t={name:`arrow-left`,size:24,node:[[`path`,{d:`m12 19-7-7 7-7`,key:`1l729n`}],[`path`,{d:`M19 12H5`,key:`x3x0zl`}]]};t.node;var n=e(t);export{n as t};
@@ -1 +0,0 @@
1
- var e=JSON.parse(`[{"version":"v0.2.12","timestamp":1791289470,"commits":[{"id":"3aaf939","message":"the documentation deploys like the cloud runtime: its image is built on GitHub's runners beside the checks of a release tag and pushed to GHCR, and the server only pulls it (deploy/Dockerfile.docs, built with --pull); the docs Dockerfile keeps its install cached across releases; a change of the docs image no longer redeploys the runtime","group":"Fixed","scope":null,"breaking":false}]},{"version":"v0.2.11","timestamp":1791287681,"commits":[{"id":"50041f3","message":"the cloud runtime deploys in minutes: its two images are built on GitHub's runners beside the checks of a release tag, with their layers cached in the registry, and pushed to GHCR; once both are green they become latest and the server pulls them instead of building for up to an hour; the runtime's Dockerfile keeps both dependency installs cached across releases (the root version blanked out, the production install in its own stage) and puts what changes every release last; IMAGE_TAG on the server pins a release","group":"Fixed","scope":null,"breaking":false}]},{"version":"v0.2.10","timestamp":1791286327,"commits":[{"id":"c5c99b0","message":"signing in from the studio returns to the studio page that asked for it, not to the host's root, which is the landing page since the studio moved to /studio","group":"Fixed","scope":null,"breaking":false}]},{"version":"v0.2.9","timestamp":1791284806,"commits":[{"id":"fff4ab3","message":"plugins add to the space: sections of the space page under the plugin's name in its menu, tools of the space assistant whose results the plugin draws as cards in its chat, a block and tools for every AI step of the space, texts in the space's search index that project_search finds beside its documents, events when a space is made, changed or deleted and when a file is read or removed, jobs that run on a schedule, public routes under an address of their own, and the runtime's web reader and document parser; the run-log example shows a space's last runs on the space page; the plugin docs describe the space","group":"Added","scope":null,"breaking":false}]},{"version":"v0.2.8","timestamp":1791284267,"commits":[{"id":"040a292","message":"Settings → Models says what the wizards can do (text, images, videos, voice, voice notes) and who does each: an AI subscription on this computer, an own API key (OpenAI, Anthropic, Google, fal.ai, ElevenLabs, Replicate, AI Gateway), a local model, or the credits, which step in where nothing of one's own is set up (a switch, on with a linked account) and may name a model of the gateway (credits:<model>: fal, ElevenLabs, Veo …); each provider's key is checked with the provider before it is kept, and a try makes a text, an image, a voice or a short clip to look at; in the cloud the page is the team's, its keys sealed per tenant and changed by its admins; voice notes run on transcription models (Scribe, Whisper) where one is bound, also on the credits; the settings show their name in the top bar's trail instead of a heading, and one container on the left slides one level down to the menu of Models and Integrate and back; on a phone the sections, a section's menu and the page take turns with a way back; Integrate puts the app's name, what it gets and its steps on one line","group":"Added","scope":null,"breaking":false}]},{"version":"v0.2.7","timestamp":1791281338,"commits":[{"id":"cc15aad","message":"the space is a page of its own: the top bar opens it beside the gear, and a menu at its left jumps to Basis, Logos, Farben, Assets, Dokumente and Fakten and marks the one in view (a picker on a phone); the studio, its assistant and the docs call a project a space (German „Space“), the address is /space and /settings/project leads there; the settings keep Konto, Connectors, Modelle and Einbinden, and the gear opens Konto; the assistant's input is one line until the text needs more, in its card and docked at the bottom","group":"Added","scope":null,"breaking":false}]},{"version":"v0.2.6","timestamp":1791280942,"commits":[{"id":"198e23c","message":"a wizard's link installs and bookmarks with the wizard's own icon: its engenty in its own colour on a pale ground of that colour with its name in small capitals below, drawn by the runtime for the manifest, the iPhone's home screen and phones that cut icons to their own shape; the page's favicon is the engenty alone, so a bookmark or tab shows it too; the name keeps the whole words that fit and never ends on a short word like \\"aus\\"; the studio's icon stands in where the runtime cannot draw; on a computer the start page offers a bookmark (⌘ D or Strg + D) instead of an install, phones keep \\"Zum Startbildschirm hinzufügen\\"","group":"Added","scope":null,"breaking":false}]},{"version":"v0.2.5","timestamp":1791272370,"commits":[{"id":"fc58644","message":"a local install says where each wizard runs and which link others can open: the cards and the editor's top bar show Live with a cloud when engenty.ai runs the version, Lokal when it runs only on this computer, Wird gesendet or Nicht in der Cloud when it did not arrive; a card's Link copies the cloud's address; the share dialog leads with that one link, says on top where the wizard runs and what the cloud lacks, folds website, QR code and the settings away, and creates a new link in the cloud too; the avatar and its menu show whether an account is connected, with its credits; Settings → Konto puts engenty.ai first and takes name and e-mail from the account; without an account the share dialog, a card's Link and the note about missing models say what an account would add","group":"Added","scope":null,"breaking":false}]},{"version":"v0.2.4","timestamp":1791242529,"commits":[{"id":"fbcfbc3","message":"a wizard a local install sends arrives whole or not at all, and the install sends again by itself: the cloud runtime keeps the files' bytes first and writes the project, the wizard, its workspace, the version and the logo in one transaction, so an object store that fails in the middle leaves nothing half done; the install plans another try after a minute, then twice as long each time up to an hour, when the cloud was out of reach or answered with an error of its own, and the share dialog says when; refusals stay with the person; a first sync that stops at an unreachable cloud marks the remaining wizards for the retry too; the public link is set on every sync; the runtime asks GitHub for a newer release once an hour instead of every six","group":"Fixed","scope":null,"breaking":false}]},{"version":"v0.2.3","timestamp":1791238483,"commits":[{"id":"38d161b","message":"the mobile app's data folder (apps/mobile/src/data) is in the repository: the ignore rule for the runtime's data folder hid every folder of that name, so main neither typechecked nor passed the mobile app's tests; the rule now names the runtime's two data folders","group":"Fixed","scope":null,"breaking":false},{"id":"251d6f4","message":"with an account signed in, what a local install publishes also runs in the cloud: the published version and its files go to the account's cloud runtime under the ids they have here, which shows the project without editing and makes the link; Settings → Konto signs in or creates an account with an invitation code and shows the credits and when they end; the share dialog says what a wizard lacks in the cloud; a team without building rights changes nothing on the server, and what visitors send is capped in size","group":"Added","scope":null,"breaking":false},{"id":"d80eb4e","message":"inside the mobile app the runner reads in the system's font, like the app's own screens; headings keep the brand's","group":"Added","scope":null,"breaking":false},{"id":"4604875","message":"the mobile app looks native: the system font, Liquid Glass (a blur before iOS 26) on the floating tab bar and the nav buttons, inset grouped lists with hairlines, Add as a form sheet with eight ID boxes, swipe to share or delete a result, files listed as the Files app does, settings rows with icon tiles","group":"Added","scope":null,"breaking":false},{"id":"d9edbe4","message":"the mobile app runs on Android: no iOS-only WebView prop that crashed the Run screen, plain http only for a runtime on this computer, result rows in the wizard's colour","group":"Fixed","scope":null,"breaking":false},{"id":"34a4588","message":"the mobile app (apps/mobile, Expo): wizards added by QR code, ID or link, runs in the runtime's runner with the app's scanner, share sheet, downloads, notifications and sign-in sheet, results kept on the phone and shared from there; engenty.ai's /w/ and /s/ links and engenty-wizards:// open in it","group":"Added","scope":null,"breaking":false},{"id":"2c19636","message":"a run tells the mobile app's device when it is done, failed or waits for the person: the app gives the run its device (POST /api/runs/:id/notify), the runtime asks the Manage-App to push (POST /v1/push in the contract); the app's own requests name the visitor in an x-wizards-visitor header, since iOS merges a Cookie header with its cookie store","group":"Added","scope":null,"breaking":false},{"id":"767e170","message":"the runner works inside the mobile app: ?app=1 drops the web's header, footer and install hint, and window.engentyApp takes over the scanner, share sheet, downloads, wake lock, notifications and account sign-in; a wizard gets an 8-character ID (GET /api/public/codes/:code) and the studio's share dialog shows it with a QR code to download as PNG or SVG; the runtime serves apple-app-site-association and assetlinks.json for the app","group":"Added","scope":null,"breaking":false},{"id":"d8f3712","message":"plan for the mobile app that runs wizards on iOS and Android","group":"Docs","scope":null,"breaking":false}]},{"version":"v0.2.2","timestamp":1791237386,"commits":[{"id":"a6c55de","message":"server.generate asks a model of the current tenant (a class, a prompt, optionally a zod schema for an object), on the models its studio is set up with and paid like any other call; without a model it throws with status 503 and the code no_model, which a route passes on","group":"Added","scope":"plugins","breaking":false},{"id":"e895e50","message":"the documentation deploys to engenty.ai/docs: an image of its own (apps/docs/Dockerfile, a standalone Next.js server on port 8896), and a release tag moves the branch deploy/docs when the site or its pages changed","group":"Deploy","scope":null,"breaking":false},{"id":"4d8b773","message":"a documentation site with a user guide and the developer docs for plugins, built like the engenty repo's: Next.js and Fumadocs in apps/docs, the pages in docs/content, in the app's light and dark colours; docs/plugins.md became its pages, and the product's build, image, package and credits leave the site out","group":"Docs","scope":null,"breaking":false}]},{"version":"v0.2.1","timestamp":1791223500,"commits":[{"id":"9c16b47","message":"the AI apps start the MCP server as the wizards command, after the rename from engenty-wizards","group":"Fixed","scope":null,"breaking":false},{"id":"f118703","message":"the wizards run in the person's own AI apps — connect writes the MCP server into Claude Desktop, Cursor, Codex and others, a run shows the wizard itself as an MCP App widget, and Settings → Einbinden adds an app with one click and tests it until it works","group":"Added","scope":null,"breaking":false}]},{"version":"v0.2.0","timestamp":1791223087,"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};
@@ -1 +0,0 @@
1
- import{t as e}from"./createLucideIcon-q3MZMmnf.js";var t={name:`chevron-left`,size:24,node:[[`path`,{d:`m15 18-6-6 6-6`,key:`1wnfg3`}]]};t.node;var n=e(t),r={name:`chevron-right`,size:24,node:[[`path`,{d:`m9 18 6-6-6-6`,key:`mthhwq`}]]};r.node;var i=e(r),a={name:`circle-alert`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`line`,{x1:`12`,x2:`12`,y1:`8`,y2:`12`,key:`1pkeuh`}],[`line`,{x1:`12`,x2:`12.01`,y1:`16`,y2:`16`,key:`4dfq90`}]],aliases:[`alert-circle`]};a.node;var o=e(a);export{i as n,n as r,o as t};