bazilion 0.26.0 → 0.27.0

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 (61) hide show
  1. package/dist/cli.js +5 -5
  2. package/dist/cli.js.map +1 -1
  3. package/dist/daemon.js +636 -234
  4. package/dist/daemon.js.map +1 -1
  5. package/dist/web/client/assets/{ChatPane-BgW59Bvn.js → ChatPane-DOV_HJg-.js} +1 -1
  6. package/dist/web/client/assets/{ConfigPage-BcjKer-E.js → ConfigPage-Dfu9DzFX.js} +1 -1
  7. package/dist/web/client/assets/{ConfirmDialog-B5BLql5H.js → ConfirmDialog-536ziJ5P.js} +1 -1
  8. package/dist/web/client/assets/{FieldRow-Dr1dDiQ6.js → FieldRow-z1JqCdqn.js} +1 -1
  9. package/dist/web/client/assets/{ResultCard-CDLhGze2.js → ResultCard-X4nTbjYY.js} +1 -1
  10. package/dist/web/client/assets/{SkillFindings-BPmVzjOa.js → SkillFindings-8LX6bYf_.js} +1 -1
  11. package/dist/web/client/assets/{SpawnDialog-CWvaYWBr.js → SpawnDialog-DoZl-yes.js} +1 -1
  12. package/dist/web/client/assets/{SpawnTeamModal-DxU7QH0e.js → SpawnTeamModal-C638hEoN.js} +1 -1
  13. package/dist/web/client/assets/{TeamForm-Bxl3s8yF.js → TeamForm-C-WzvOl4.js} +1 -1
  14. package/dist/web/client/assets/{TeamPolicyEditor-B-ikYl3V.js → TeamPolicyEditor-CSKBx0oK.js} +1 -1
  15. package/dist/web/client/assets/{UnsavedChangesGuard-CmeIPiXp.js → UnsavedChangesGuard-GC-vzw7h.js} +1 -1
  16. package/dist/web/client/assets/{_id-iXED17f-.js → _id-BKLynswT.js} +1 -1
  17. package/dist/web/client/assets/{_id-CNN1ila9.js → _id-BYM_NORr.js} +1 -1
  18. package/dist/web/client/assets/{_id-B-Vo1VkF.js → _id-Cxa98a9m.js} +1 -1
  19. package/dist/web/client/assets/{_id-CrGDqaFa.js → _id-D4hV1U1t.js} +1 -1
  20. package/dist/web/client/assets/{agent-actions-CmkRSxQg.js → agent-actions-CXQCoxKO.js} +1 -1
  21. package/dist/web/client/assets/{agents-KnMSeucP.js → agents-BxPS1_Bp.js} +1 -1
  22. package/dist/web/client/assets/{agents-DwDcKOif.js → agents-GozAWW-l.js} +1 -1
  23. package/dist/web/client/assets/{attention-CLQIHUF6.js → attention-Cz9rZcrr.js} +1 -1
  24. package/dist/web/client/assets/chevron-right-CPAb1zac.js +1 -0
  25. package/dist/web/client/assets/{config-B483VUYj.js → config-9vv9Lipb.js} +2 -2
  26. package/dist/web/client/assets/{inbox-DIXsxGV8.js → inbox-DHLArXxl.js} +1 -1
  27. package/dist/web/client/assets/{index-CKJ3uVR4.js → index-1YXquAq8.js} +2 -2
  28. package/dist/web/client/assets/{learning-DDTz_N6N.js → learning-PvtXm8Ne.js} +1 -1
  29. package/dist/web/client/assets/{login-6S3kA9Yb.js → login-DIJpNQFo.js} +1 -1
  30. package/dist/web/client/assets/{mcp-Dm4DfYI9.js → mcp-pKBL0xIf.js} +1 -1
  31. package/dist/web/client/assets/{members-CD93Kya7.js → members-DHWsgsEs.js} +1 -1
  32. package/dist/web/client/assets/{memory-M28_uFOH.js → memory-CEVppPyU.js} +1 -1
  33. package/dist/web/client/assets/plus-BaIRdB10.js +1 -0
  34. package/dist/web/client/assets/{policy-IKYNTvWX.js → policy-DEh4BLSw.js} +1 -1
  35. package/dist/web/client/assets/{results-CGNpUJ11.js → results-DgJPjEZF.js} +1 -1
  36. package/dist/web/client/assets/{review-BN6V988m.js → review-BbshafTQ.js} +1 -1
  37. package/dist/web/client/assets/{route-DUIeAVZz.js → route-Ccb8v41z.js} +1 -1
  38. package/dist/web/client/assets/{route-V5VM1ufA.js → route-D1d6kCEV.js} +1 -1
  39. package/dist/web/client/assets/{routes-CInZFLoI.js → routes-g7V4ru7T.js} +1 -1
  40. package/dist/web/client/assets/{services-CeB7gfY5.js → services-B2f7e5jV.js} +1 -1
  41. package/dist/web/client/assets/{settings-BWonPTKi.js → settings-B6elpcYm.js} +1 -1
  42. package/dist/web/client/assets/{skills-CgrXwmh8.js → skills-CngE7TF8.js} +1 -1
  43. package/dist/web/client/assets/styles-xUnZ-ep_.css +2 -0
  44. package/dist/web/client/assets/{teams-D-g74z8r.js → teams-BdJZXOan.js} +1 -1
  45. package/dist/web/client/assets/{teams-C98Ww6Xu.js → teams-c496ISsT.js} +1 -1
  46. package/dist/web/client/assets/{telegram-Cc8NJ4Tc.js → telegram-B_-hK6EC.js} +1 -1
  47. package/dist/web/client/assets/{tokens-ZTSxCsD_.js → tokens-CKz8gx4-.js} +1 -1
  48. package/dist/web/client/assets/{triggers-Br8Wk4Yk.js → triggers-DCEPciGW.js} +1 -1
  49. package/dist/web/client/assets/{welcome-C-hJvXWG.js → welcome-D-zVOLGA.js} +1 -1
  50. package/dist/web/client/baziu.svg +176 -7
  51. package/dist/web/server/assets/{_tanstack-start-manifest_v-BUFDfU9j.js → _tanstack-start-manifest_v-B8u80HjK.js} +72 -72
  52. package/dist/web/server/assets/{config-C0lOmAcs.js → config-BNEgu7WG.js} +5 -6
  53. package/dist/web/server/assets/{config-D7Z2wgbk.js → config-C1VB28se.js} +1 -1
  54. package/dist/web/server/assets/{router-vAv1HkV1.js → router-BI9gmY3S.js} +2 -2
  55. package/dist/web/server/server.js +2 -2
  56. package/dist/worker.js +58 -8
  57. package/dist/worker.js.map +1 -1
  58. package/package.json +4 -5
  59. package/dist/web/client/assets/chevron-right-DZFmP-cr.js +0 -1
  60. package/dist/web/client/assets/plus-xCBcVxeD.js +0 -1
  61. package/dist/web/client/assets/styles-d9JiV6N4.css +0 -2
@@ -1,4 +1,4 @@
1
- import{i as e,n as t,t as n}from"./jsx-runtime-bzQ4Vb5N.js";import{A as r,M as i,N as a,_t as o,j as s}from"./index-CKJ3uVR4.js";import{t as c}from"./ResultCard-CDLhGze2.js";var l=e(t(),1),u=n();function d({agentId:e,refreshKey:t}){let[n,r]=(0,l.useState)([]);return(0,l.useEffect)(()=>{let t=new AbortController;return s(`/api/agents/${encodeURIComponent(e)}/questions`,{signal:t.signal}).then(e=>r(e.questions)).catch(()=>{}),()=>t.abort()},[e,t]),n.length?(0,u.jsx)(`section`,{"aria-label":`Agent questions`,className:`max-h-[40vh] min-w-0 shrink-0 space-y-3 overflow-y-auto border-t border-frost px-5 py-3`,children:n.map(e=>(0,u.jsx)(f,{item:e},e.id))}):null}function f({item:e}){let[t,n]=(0,l.useState)(``),[i,c]=(0,l.useState)(``),[d,f]=(0,l.useState)(!1),[p,m]=(0,l.useState)(!1),[h,g]=(0,l.useState)(``);async function _(t){f(!0),g(``);try{await s(`/api/agents/${encodeURIComponent(e.agentId)}/questions/${encodeURIComponent(e.id)}/answer`,{body:{answer:t}}),m(!0)}catch(e){g(e instanceof r&&e.status===404?`This question is no longer open.`:a(e))}finally{f(!1)}}let v=d||p;return(0,u.jsxs)(`article`,{className:`flex min-w-0 flex-col gap-3 rounded-lg border border-frost bg-ivory p-3`,children:[(0,u.jsx)(`p`,{className:`m-0 break-words font-medium`,children:e.question.prompt}),(0,u.jsxs)(`form`,{className:`flex min-w-0 flex-col gap-3`,onSubmit:e=>{e.preventDefault(),t===`other`?_({kind:`text`,text:i}):t!==``&&_({kind:`choice`,index:Number(t)})},children:[(0,u.jsxs)(`fieldset`,{disabled:v,className:`m-0 grid min-w-0 gap-2 border-0 p-0 sm:grid-cols-2`,children:[(0,u.jsx)(`legend`,{className:`sr-only`,children:`Answer this question`}),e.question.choices.map((r,i)=>(0,u.jsxs)(`label`,{className:`m-0 flex min-w-0 cursor-pointer items-center gap-2 rounded-md border border-frost px-3 py-2.5 has-[:checked]:border-sapphire has-[:checked]:bg-sapphire-glow`,children:[(0,u.jsx)(`input`,{className:`m-0 h-4 w-4 shrink-0 accent-sapphire`,type:`radio`,name:`question-${e.id}`,value:i,checked:t===String(i),onChange:()=>n(String(i))}),(0,u.jsxs)(`span`,{className:`min-w-0 break-words [overflow-wrap:anywhere]`,children:[r.label,e.question.recommendedIndex===i?` (Recommended)`:``,r.description&&(0,u.jsx)(`small`,{className:`block`,children:r.description})]})]},r.label)),(0,u.jsxs)(`label`,{className:`m-0 flex min-w-0 cursor-pointer items-center gap-2 rounded-md border border-frost px-3 py-2.5 has-[:checked]:border-sapphire has-[:checked]:bg-sapphire-glow`,children:[(0,u.jsx)(`input`,{className:`m-0 h-4 w-4 shrink-0 accent-sapphire`,type:`radio`,name:`question-${e.id}`,checked:t===`other`,onChange:()=>n(`other`)}),(0,u.jsx)(`span`,{children:`Other`})]}),t===`other`&&(0,u.jsxs)(`label`,{className:`m-0 grid gap-2 sm:col-span-2`,children:[`Your answer`,(0,u.jsx)(`textarea`,{rows:2,className:`w-full resize-y`,value:i,maxLength:4096,onChange:e=>c(e.target.value)})]})]}),(0,u.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[(0,u.jsx)(o,{variant:`primary`,type:`submit`,disabled:v||!t||t===`other`&&!i.trim(),children:`Send answer`}),(0,u.jsx)(o,{variant:`ghost`,disabled:v,onClick:()=>{_({kind:`skip`})},children:`Skip`})]}),(0,u.jsx)(`p`,{className:`m-0 text-xs text-mocha`,children:p?`Answered.`:`Waiting until ${new Date(e.expiresAt).toLocaleTimeString()}. Answering grants no permission.`})]}),h&&(0,u.jsx)(`p`,{role:`alert`,children:h})]})}function p(e,t){return{message:e,attachments:t,bashApprovalMode:`interactive`,questionMode:`web`}}function m(e){return`/api/shell-approvals?agentId=${encodeURIComponent(e)}`}var h=e=>e.startsWith(`image/`);function g(e){let t=[],n=null,r=()=>(n||(n={type:`tool`,items:[]},t.push(n)),n);for(let i of e)if(i.role===`user`)n=null,t.push({type:`user`,content:i.content,...i.images?.length?{images:i.images}:{}});else if(i.role===`assistant`){i.content&&(n=null,t.push({type:`assistant`,content:i.content}));for(let e of i.toolCalls??[])r().items.push({kind:`call`,id:e.id,name:e.name,body:e.arguments})}else if(i.role===`tool`){r().items.push({kind:/^error:/i.test(i.content)?`error`:`result`,id:i.toolCallId??``,name:i.toolName??``,body:i.content});for(let e of i.results??[])t.push({type:`result`,resultId:e.resultId}),n=null;i.images?.length&&(t.push({type:`images`,images:i.images}),n=null)}return t}function _(e,t){let n=e.findIndex(e=>e.type===`command_approval`&&e.approval.id===t.id);if(n===-1)return[...e,{type:`command_approval`,approval:t}];let r=[...e];return r[n]={type:`command_approval`,approval:t},r}function v(e,t){let n={kind:`progress`,id:t.id,name:t.name,body:t.output};for(let r=e.length-1;r>=0;r--){let i=e[r];if(i?.type!==`tool`)continue;let a=i.items.findIndex(e=>e.id===t.id);if(a<0)continue;let o=[...i.items],s=o.findIndex(e=>e.kind===`progress`&&e.id===t.id);s>=0?o[s]=n:o.splice(a+1,0,n);let c=[...e];return c[r]={type:`tool`,items:o},c}return y(e,n)}function y(e,t){let n=e[e.length-1];return n?.type===`tool`?[...e.slice(0,-1),{type:`tool`,items:[...n.items,t]}]:[...e,{type:`tool`,items:[t]}]}function b(e,t){let n=e[e.length-1];return n?.type===`assistant`?[...e.slice(0,-1),{type:`assistant`,content:t(n.content)}]:[...e,{type:`assistant`,content:t(``)}]}function x(e,t){switch(t.type){case`assistant_delta`:return b(e,e=>e+t.delta);case`assistant_message`:return b(e,()=>t.text);case`command_approval`:return _(e,t.approval);case`tool_progress`:return v(e,t);case`tool_call`:return y(e,{kind:`call`,id:t.id,name:t.name,body:t.arguments});case`tool_result`:case`tool_error`:{let n=y(e.map(e=>e.type===`tool`?{...e,items:e.items.filter(e=>!(e.kind===`progress`&&e.id===t.id))}:e),t.type===`tool_result`?{kind:`result`,id:t.id,name:t.name,body:t.result}:{kind:`error`,id:t.id,name:t.name,body:t.error});return t.type===`tool_result`&&t.images?.length?[...n,{type:`images`,images:t.images}]:n}case`file`:return[...e,{type:`result`,resultId:t.result.resultId}];case`error`:return[...e,{type:`error`,content:`[error] ${t.error}`}];default:return e}}function S(e){return e.map(e=>e.type===`command_approval`&&e.approval.status===`pending`?{type:`command_approval`,approval:{...e.approval,status:`cancelled`}}:e)}async function*ee(e){let t=e.getReader(),n=new TextDecoder,r=``;for(;;){let{done:e,value:i}=await t.read();r+=e?n.decode():n.decode(i,{stream:!0});let a=r.split(`
1
+ import{i as e,n as t,t as n}from"./jsx-runtime-bzQ4Vb5N.js";import{A as r,M as i,N as a,_t as o,j as s}from"./index-1YXquAq8.js";import{t as c}from"./ResultCard-X4nTbjYY.js";var l=e(t(),1),u=n();function d({agentId:e,refreshKey:t}){let[n,r]=(0,l.useState)([]);return(0,l.useEffect)(()=>{let t=new AbortController;return s(`/api/agents/${encodeURIComponent(e)}/questions`,{signal:t.signal}).then(e=>r(e.questions)).catch(()=>{}),()=>t.abort()},[e,t]),n.length?(0,u.jsx)(`section`,{"aria-label":`Agent questions`,className:`max-h-[40vh] min-w-0 shrink-0 space-y-3 overflow-y-auto border-t border-frost px-5 py-3`,children:n.map(e=>(0,u.jsx)(f,{item:e},e.id))}):null}function f({item:e}){let[t,n]=(0,l.useState)(``),[i,c]=(0,l.useState)(``),[d,f]=(0,l.useState)(!1),[p,m]=(0,l.useState)(!1),[h,g]=(0,l.useState)(``);async function _(t){f(!0),g(``);try{await s(`/api/agents/${encodeURIComponent(e.agentId)}/questions/${encodeURIComponent(e.id)}/answer`,{body:{answer:t}}),m(!0)}catch(e){g(e instanceof r&&e.status===404?`This question is no longer open.`:a(e))}finally{f(!1)}}let v=d||p;return(0,u.jsxs)(`article`,{className:`flex min-w-0 flex-col gap-3 rounded-lg border border-frost bg-ivory p-3`,children:[(0,u.jsx)(`p`,{className:`m-0 break-words font-medium`,children:e.question.prompt}),(0,u.jsxs)(`form`,{className:`flex min-w-0 flex-col gap-3`,onSubmit:e=>{e.preventDefault(),t===`other`?_({kind:`text`,text:i}):t!==``&&_({kind:`choice`,index:Number(t)})},children:[(0,u.jsxs)(`fieldset`,{disabled:v,className:`m-0 grid min-w-0 gap-2 border-0 p-0 sm:grid-cols-2`,children:[(0,u.jsx)(`legend`,{className:`sr-only`,children:`Answer this question`}),e.question.choices.map((r,i)=>(0,u.jsxs)(`label`,{className:`m-0 flex min-w-0 cursor-pointer items-center gap-2 rounded-md border border-frost px-3 py-2.5 has-[:checked]:border-sapphire has-[:checked]:bg-sapphire-glow`,children:[(0,u.jsx)(`input`,{className:`m-0 h-4 w-4 shrink-0 accent-sapphire`,type:`radio`,name:`question-${e.id}`,value:i,checked:t===String(i),onChange:()=>n(String(i))}),(0,u.jsxs)(`span`,{className:`min-w-0 break-words [overflow-wrap:anywhere]`,children:[r.label,e.question.recommendedIndex===i?` (Recommended)`:``,r.description&&(0,u.jsx)(`small`,{className:`block`,children:r.description})]})]},r.label)),(0,u.jsxs)(`label`,{className:`m-0 flex min-w-0 cursor-pointer items-center gap-2 rounded-md border border-frost px-3 py-2.5 has-[:checked]:border-sapphire has-[:checked]:bg-sapphire-glow`,children:[(0,u.jsx)(`input`,{className:`m-0 h-4 w-4 shrink-0 accent-sapphire`,type:`radio`,name:`question-${e.id}`,checked:t===`other`,onChange:()=>n(`other`)}),(0,u.jsx)(`span`,{children:`Other`})]}),t===`other`&&(0,u.jsxs)(`label`,{className:`m-0 grid gap-2 sm:col-span-2`,children:[`Your answer`,(0,u.jsx)(`textarea`,{rows:2,className:`w-full resize-y`,value:i,maxLength:4096,onChange:e=>c(e.target.value)})]})]}),(0,u.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[(0,u.jsx)(o,{variant:`primary`,type:`submit`,disabled:v||!t||t===`other`&&!i.trim(),children:`Send answer`}),(0,u.jsx)(o,{variant:`ghost`,disabled:v,onClick:()=>{_({kind:`skip`})},children:`Skip`})]}),(0,u.jsx)(`p`,{className:`m-0 text-xs text-mocha`,children:p?`Answered.`:`Waiting until ${new Date(e.expiresAt).toLocaleTimeString()}. Answering grants no permission.`})]}),h&&(0,u.jsx)(`p`,{role:`alert`,children:h})]})}function p(e,t){return{message:e,attachments:t,bashApprovalMode:`interactive`,questionMode:`web`}}function m(e){return`/api/shell-approvals?agentId=${encodeURIComponent(e)}`}var h=e=>e.startsWith(`image/`);function g(e){let t=[],n=null,r=()=>(n||(n={type:`tool`,items:[]},t.push(n)),n);for(let i of e)if(i.role===`user`)n=null,t.push({type:`user`,content:i.content,...i.images?.length?{images:i.images}:{}});else if(i.role===`assistant`){i.content&&(n=null,t.push({type:`assistant`,content:i.content}));for(let e of i.toolCalls??[])r().items.push({kind:`call`,id:e.id,name:e.name,body:e.arguments})}else if(i.role===`tool`){r().items.push({kind:/^error:/i.test(i.content)?`error`:`result`,id:i.toolCallId??``,name:i.toolName??``,body:i.content});for(let e of i.results??[])t.push({type:`result`,resultId:e.resultId}),n=null;i.images?.length&&(t.push({type:`images`,images:i.images}),n=null)}return t}function _(e,t){let n=e.findIndex(e=>e.type===`command_approval`&&e.approval.id===t.id);if(n===-1)return[...e,{type:`command_approval`,approval:t}];let r=[...e];return r[n]={type:`command_approval`,approval:t},r}function v(e,t){let n={kind:`progress`,id:t.id,name:t.name,body:t.output};for(let r=e.length-1;r>=0;r--){let i=e[r];if(i?.type!==`tool`)continue;let a=i.items.findIndex(e=>e.id===t.id);if(a<0)continue;let o=[...i.items],s=o.findIndex(e=>e.kind===`progress`&&e.id===t.id);s>=0?o[s]=n:o.splice(a+1,0,n);let c=[...e];return c[r]={type:`tool`,items:o},c}return y(e,n)}function y(e,t){let n=e[e.length-1];return n?.type===`tool`?[...e.slice(0,-1),{type:`tool`,items:[...n.items,t]}]:[...e,{type:`tool`,items:[t]}]}function b(e,t){let n=e[e.length-1];return n?.type===`assistant`?[...e.slice(0,-1),{type:`assistant`,content:t(n.content)}]:[...e,{type:`assistant`,content:t(``)}]}function x(e,t){switch(t.type){case`assistant_delta`:return b(e,e=>e+t.delta);case`assistant_message`:return b(e,()=>t.text);case`command_approval`:return _(e,t.approval);case`tool_progress`:return v(e,t);case`tool_call`:return y(e,{kind:`call`,id:t.id,name:t.name,body:t.arguments});case`tool_result`:case`tool_error`:{let n=y(e.map(e=>e.type===`tool`?{...e,items:e.items.filter(e=>!(e.kind===`progress`&&e.id===t.id))}:e),t.type===`tool_result`?{kind:`result`,id:t.id,name:t.name,body:t.result}:{kind:`error`,id:t.id,name:t.name,body:t.error});return t.type===`tool_result`&&t.images?.length?[...n,{type:`images`,images:t.images}]:n}case`file`:return[...e,{type:`result`,resultId:t.result.resultId}];case`error`:return[...e,{type:`error`,content:`[error] ${t.error}`}];default:return e}}function S(e){return e.map(e=>e.type===`command_approval`&&e.approval.status===`pending`?{type:`command_approval`,approval:{...e.approval,status:`cancelled`}}:e)}async function*ee(e){let t=e.getReader(),n=new TextDecoder,r=``;for(;;){let{done:e,value:i}=await t.read();r+=e?n.decode():n.decode(i,{stream:!0});let a=r.split(`
2
2
  `);r=e?``:a.pop()??``;for(let e of a)if(e.trim())try{yield JSON.parse(e)}catch{}if(e)return}}var te=200;function C(e){return new Promise((t,n)=>{let r=new FileReader;r.onload=()=>{let n=String(r.result);t({name:e.name,data:n.slice(n.indexOf(`,`)+1),mimeType:e.type||`application/octet-stream`})},r.onerror=()=>n(r.error),r.readAsDataURL(e)})}function ne(e){return Promise.all(Array.from(e).map(C))}function w({agentName:e,value:t,onChange:n,onSubmit:r,attachments:i,onAddFiles:a,onRemoveAttachment:s,editing:c,onCancelEdit:d,agentBusy:f,onStop:p,inputRef:m}){let g=(0,l.useRef)(null);return(0,l.useLayoutEffect)(()=>{let e=m.current;e&&(e.style.height=`auto`,e.style.height=`${Math.min(e.scrollHeight,te)}px`)},[t]),(0,u.jsxs)(u.Fragment,{children:[c&&(0,u.jsxs)(`div`,{className:`flex items-center gap-2 border-t border-frost bg-sapphire-glow px-5 py-2 text-[0.85em] text-sapphire-deep`,children:[(0,u.jsx)(`span`,{children:`editing last message — submit to replace, or`}),(0,u.jsx)(`button`,{type:`button`,onClick:d,className:`ml-auto rounded-sm border border-sapphire-light bg-transparent px-2 py-0.5 text-[0.92em] text-sapphire-deep hover:bg-snow`,children:`cancel`})]}),i.length>0&&(0,u.jsx)(`div`,{className:`flex max-h-24 shrink-0 flex-wrap gap-2 overflow-y-auto border-t border-frost bg-ivory px-5 pt-3`,children:i.map((e,t)=>h(e.mimeType)?(0,u.jsxs)(`div`,{className:`relative`,children:[(0,u.jsx)(`img`,{src:`data:${e.mimeType};base64,${e.data}`,alt:`pending attachment`,className:`h-16 w-16 rounded-md border border-frost object-cover`}),(0,u.jsx)(`button`,{type:`button`,onClick:()=>s(t),className:`absolute -right-1.5 -top-1.5 flex h-5 w-5 items-center justify-center rounded-full border border-frost bg-snow text-[0.7em] text-mocha hover:border-sapphire hover:text-sapphire`,"aria-label":`remove attachment`,children:`✕`})]},t):(0,u.jsxs)(`div`,{className:`flex items-center gap-1.5 rounded-md border border-frost bg-snow px-2 py-1 text-[0.82em] text-mocha`,children:[(0,u.jsx)(`span`,{children:`📄`}),(0,u.jsx)(`span`,{className:`max-w-[160px] truncate`,children:e.name??`file`}),(0,u.jsx)(`button`,{type:`button`,onClick:()=>s(t),className:`text-[0.85em] text-mocha hover:text-sapphire`,"aria-label":`remove attachment`,children:`✕`})]},t))}),(0,u.jsxs)(`form`,{className:`grid shrink-0 grid-cols-[auto_minmax(0,1fr)] items-end gap-2 border-t border-frost bg-ivory px-3 py-3 sm:grid-cols-[auto_minmax(0,1fr)_auto] sm:px-5`,onSubmit:e=>{e.preventDefault(),r()},children:[(0,u.jsx)(`input`,{ref:g,type:`file`,multiple:!0,className:`hidden`,onChange:e=>{e.target.files&&a(e.target.files),e.target.value=``}}),(0,u.jsx)(`button`,{type:`button`,onClick:()=>g.current?.click(),title:`attach images or files`,"aria-label":`attach files`,className:`flex h-11 items-center justify-center rounded-md border-[1.5px] border-frost bg-snow px-3 py-2 text-[1em] text-mocha transition-colors hover:border-sapphire hover:text-sapphire`,children:`📎`}),(0,u.jsx)(`textarea`,{ref:m,rows:1,value:t,onChange:e=>n(e.target.value),onKeyDown:e=>{e.key===`Enter`&&!e.shiftKey&&!e.nativeEvent.isComposing&&(e.preventDefault(),r())},onPaste:e=>{let t=Array.from(e.clipboardData.files);t.some(e=>h(e.type))&&(e.preventDefault(),a(t))},placeholder:`Write a message…`,title:`Shift+Enter for a new line. Paste or attach files with the paperclip.`,autoComplete:`off`,"aria-label":`Message ${e}`,className:`max-h-[200px] min-h-11 min-w-0 flex-1 resize-none overflow-y-auto rounded-md border-[1.5px] border-frost bg-snow px-3 py-2 text-[0.93em] leading-[1.45] text-chocolate outline-none transition-colors focus:border-sapphire focus:shadow-[0_0_0_3px_var(--color-sapphire-glow)]`}),(0,u.jsxs)(`div`,{className:`col-span-2 flex flex-wrap justify-end gap-2 sm:col-span-1`,children:[(0,u.jsx)(o,{variant:`primary`,type:`submit`,className:`min-h-11 whitespace-normal text-center`,disabled:!t.trim()&&i.length===0,children:f?`Queue follow-up`:`Send`}),f&&(0,u.jsx)(o,{variant:`danger`,className:`min-h-11`,onClick:p,"aria-label":`Stop response`,children:`Stop`})]})]})]})}function re(e){let t=e.split(`
3
3
  `).find(e=>e.startsWith(`--- from `));if(!t)return`Teammate update received`;let n=/^--- from (.+?) \(message [0-9a-f-]+(?:, reply to [0-9a-f-]+)?\) ---$/.exec(t);if(!n)return`Teammate update received`;let r=n[1]?.replace(/ \([0-9a-f-]{36}\)$/,``).trim();return!r||/^[0-9a-f-]{36}$/.test(r)?`Teammate update received`:`Update from ${r.slice(0,100)}`}function ie(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function T(e){if(Array.isArray(e))return e}function ae(e,t){var n=e==null?null:typeof Symbol<`u`&&e[Symbol.iterator]||e[`@@iterator`];if(n!=null){var r,i,a,o,s=[],c=!0,l=!1;try{if(a=(n=n.call(e)).next,t!==0)for(;!(c=(r=a.call(n)).done)&&(s.push(r.value),s.length!==t);c=!0);}catch(e){l=!0,i=e}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(l)throw i}}return s}}function oe(){throw TypeError(`Invalid attempt to destructure non-iterable instance.
4
4
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function se(e,t){return T(e)||ae(e,t)||ce(e,t)||oe()}function ce(e,t){if(e){if(typeof e==`string`)return ie(e,t);var n={}.toString.call(e).slice(8,-1);return n===`Object`&&e.constructor&&(n=e.constructor.name),n===`Map`||n===`Set`?Array.from(e):n===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?ie(e,t):void 0}}var le=Object.entries,ue=Object.setPrototypeOf,E=Object.isFrozen,de=Object.getPrototypeOf,fe=Object.getOwnPropertyDescriptor,D=Object.freeze,O=Object.seal,pe=Object.create,me=typeof Reflect<`u`&&Reflect,he=me.apply,ge=me.construct;D||=function(e){return e},O||=function(e){return e},he||=function(e,t){var n=[...arguments].slice(2);return e.apply(t,n)},ge||=function(e){return new e(...[...arguments].slice(1))};var k=F(Array.prototype.forEach),_e=F(Array.prototype.lastIndexOf),ve=F(Array.prototype.pop),ye=F(Array.prototype.push),be=F(Array.prototype.splice),A=Array.isArray,xe=F(String.prototype.toLowerCase),Se=F(String.prototype.toString),j=F(String.prototype.match),Ce=F(String.prototype.replace),we=F(String.prototype.indexOf),Te=F(String.prototype.trim),Ee=F(Number.prototype.toString),De=F(Boolean.prototype.toString),Oe=typeof BigInt>`u`?null:F(BigInt.prototype.toString),ke=typeof Symbol>`u`?null:F(Symbol.prototype.toString),M=F(Object.prototype.hasOwnProperty),N=F(Object.prototype.toString),P=F(RegExp.prototype.test),Ae=I(TypeError);function F(e){return function(t){t instanceof RegExp&&(t.lastIndex=0);var n=[...arguments].slice(1);return he(e,t,n)}}function I(e){return function(){return ge(e,[...arguments])}}function L(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:xe;if(ue&&ue(e,null),!A(t))return e;let r=t.length;for(;r--;){let i=t[r];if(typeof i==`string`){let e=n(i);e!==i&&(E(t)||(t[r]=e),i=e)}e[i]=!0}return e}function je(e){for(let t=0;t<e.length;t++)M(e,t)||(e[t]=null);return e}function R(e){let t=pe(null);for(let r of le(e)){var n=se(r,2);let i=n[0],a=n[1];M(e,i)&&(A(a)?t[i]=je(a):a&&typeof a==`object`&&a.constructor===Object?t[i]=R(a):t[i]=a)}return t}function Me(e){switch(typeof e){case`string`:return e;case`number`:return Ee(e);case`boolean`:return De(e);case`bigint`:return Oe?Oe(e):`0`;case`symbol`:return ke?ke(e):`Symbol()`;case`undefined`:return N(e);case`function`:case`object`:{if(e===null)return N(e);let t=e,n=z(t,`toString`);if(typeof n==`function`){let e=n(t);return typeof e==`string`?e:N(e)}return N(e)}default:return N(e)}}function z(e,t){for(;e!==null;){let n=fe(e,t);if(n){if(n.get)return F(n.get);if(typeof n.value==`function`)return F(n.value)}e=de(e)}function n(){return null}return n}function Ne(e){try{return P(e,``),!0}catch{return!1}}var Pe=D(`a.abbr.acronym.address.area.article.aside.audio.b.bdi.bdo.big.blink.blockquote.body.br.button.canvas.caption.center.cite.code.col.colgroup.content.data.datalist.dd.decorator.del.details.dfn.dialog.dir.div.dl.dt.element.em.fieldset.figcaption.figure.font.footer.form.h1.h2.h3.h4.h5.h6.head.header.hgroup.hr.html.i.img.input.ins.kbd.label.legend.li.main.map.mark.marquee.menu.menuitem.meter.nav.nobr.ol.optgroup.option.output.p.picture.pre.progress.q.rp.rt.ruby.s.samp.search.section.select.shadow.slot.small.source.spacer.span.strike.strong.style.sub.summary.sup.table.tbody.td.template.textarea.tfoot.th.thead.time.tr.track.tt.u.ul.var.video.wbr`.split(`.`)),Fe=D(`svg.a.altglyph.altglyphdef.altglyphitem.animatecolor.animatemotion.animatetransform.circle.clippath.defs.desc.ellipse.enterkeyhint.exportparts.filter.font.g.glyph.glyphref.hkern.image.inputmode.line.lineargradient.marker.mask.metadata.mpath.part.path.pattern.polygon.polyline.radialgradient.rect.stop.style.switch.symbol.text.textpath.title.tref.tspan.view.vkern`.split(`.`)),Ie=D([`feBlend`,`feColorMatrix`,`feComponentTransfer`,`feComposite`,`feConvolveMatrix`,`feDiffuseLighting`,`feDisplacementMap`,`feDistantLight`,`feDropShadow`,`feFlood`,`feFuncA`,`feFuncB`,`feFuncG`,`feFuncR`,`feGaussianBlur`,`feImage`,`feMerge`,`feMergeNode`,`feMorphology`,`feOffset`,`fePointLight`,`feSpecularLighting`,`feSpotLight`,`feTile`,`feTurbulence`]),Le=D([`animate`,`color-profile`,`cursor`,`discard`,`font-face`,`font-face-format`,`font-face-name`,`font-face-src`,`font-face-uri`,`foreignobject`,`hatch`,`hatchpath`,`mesh`,`meshgradient`,`meshpatch`,`meshrow`,`missing-glyph`,`script`,`set`,`solidcolor`,`unknown`,`use`]),Re=D(`math.menclose.merror.mfenced.mfrac.mglyph.mi.mlabeledtr.mmultiscripts.mn.mo.mover.mpadded.mphantom.mroot.mrow.ms.mspace.msqrt.mstyle.msub.msup.msubsup.mtable.mtd.mtext.mtr.munder.munderover.mprescripts`.split(`.`)),ze=D([`maction`,`maligngroup`,`malignmark`,`mlongdiv`,`mscarries`,`mscarry`,`msgroup`,`mstack`,`msline`,`msrow`,`semantics`,`annotation`,`annotation-xml`,`mprescripts`,`none`]),Be=D([`#text`]),Ve=D(`accept.action.align.alt.autocapitalize.autocomplete.autopictureinpicture.autoplay.background.bgcolor.border.capture.cellpadding.cellspacing.checked.cite.class.clear.color.cols.colspan.command.commandfor.controls.controlslist.coords.crossorigin.datetime.decoding.default.dir.disabled.disablepictureinpicture.disableremoteplayback.download.draggable.enctype.enterkeyhint.exportparts.face.for.headers.height.hidden.high.href.hreflang.id.inert.inputmode.integrity.ismap.kind.label.lang.list.loading.loop.low.max.maxlength.media.method.min.minlength.multiple.muted.name.nonce.noshade.novalidate.nowrap.open.optimum.part.pattern.placeholder.playsinline.popover.popovertarget.popovertargetaction.poster.preload.pubdate.radiogroup.readonly.rel.required.rev.reversed.role.rows.rowspan.spellcheck.scope.selected.shape.size.sizes.slot.span.srclang.start.src.srcset.step.style.summary.tabindex.title.translate.type.usemap.valign.value.width.wrap.xmlns`.split(`.`)),He=D(`accent-height.accumulate.additive.alignment-baseline.amplitude.ascent.attributename.attributetype.azimuth.basefrequency.baseline-shift.begin.bias.by.class.clip.clippathunits.clip-path.clip-rule.color.color-interpolation.color-interpolation-filters.color-profile.color-rendering.cx.cy.d.dx.dy.diffuseconstant.direction.display.divisor.dur.edgemode.elevation.end.exponent.fill.fill-opacity.fill-rule.filter.filterunits.flood-color.flood-opacity.font-family.font-size.font-size-adjust.font-stretch.font-style.font-variant.font-weight.fx.fy.g1.g2.glyph-name.glyphref.gradientunits.gradienttransform.height.href.id.image-rendering.in.in2.intercept.k.k1.k2.k3.k4.kerning.keypoints.keysplines.keytimes.lang.lengthadjust.letter-spacing.kernelmatrix.kernelunitlength.lighting-color.local.marker-end.marker-mid.marker-start.markerheight.markerunits.markerwidth.maskcontentunits.maskunits.max.mask.mask-type.media.method.mode.min.name.numoctaves.offset.operator.opacity.order.orient.orientation.origin.overflow.paint-order.path.pathlength.patterncontentunits.patterntransform.patternunits.points.preservealpha.preserveaspectratio.primitiveunits.r.rx.ry.radius.refx.refy.repeatcount.repeatdur.restart.result.rotate.scale.seed.shape-rendering.slope.specularconstant.specularexponent.spreadmethod.startoffset.stddeviation.stitchtiles.stop-color.stop-opacity.stroke-dasharray.stroke-dashoffset.stroke-linecap.stroke-linejoin.stroke-miterlimit.stroke-opacity.stroke.stroke-width.style.surfacescale.systemlanguage.tabindex.tablevalues.targetx.targety.transform.transform-origin.text-anchor.text-decoration.text-rendering.textlength.type.u1.u2.unicode.values.viewbox.visibility.version.vert-adv-y.vert-origin-x.vert-origin-y.width.word-spacing.wrap.writing-mode.xchannelselector.ychannelselector.x.x1.x2.xmlns.y.y1.y2.z.zoomandpan`.split(`.`)),Ue=D(`accent.accentunder.align.bevelled.close.columnalign.columnlines.columnspacing.columnspan.denomalign.depth.dir.display.displaystyle.encoding.fence.frame.height.href.id.largeop.length.linethickness.lquote.lspace.mathbackground.mathcolor.mathsize.mathvariant.maxsize.minsize.movablelimits.notation.numalign.open.rowalign.rowlines.rowspacing.rowspan.rspace.rquote.scriptlevel.scriptminsize.scriptsizemultiplier.selection.separator.separators.stretchy.subscriptshift.supscriptshift.symmetric.voffset.width.xmlns`.split(`.`)),We=D([`xlink:href`,`xml:id`,`xlink:title`,`xml:space`,`xmlns:xlink`]),Ge=O(/{{[\w\W]*|^[\w\W]*}}/g),Ke=O(/<%[\w\W]*|^[\w\W]*%>/g),qe=O(/\${[\w\W]*/g),Je=O(/^data-[\-\w.\u00B7-\uFFFF]+$/),Ye=O(/^aria-[\-\w]+$/),Xe=O(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),Ze=O(/^(?:\w+script|data):/i),Qe=O(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),$e=O(/^html$/i),et=O(/^[a-z][.\w]*(-[.\w]+)+$/i),tt=O(/<[/\w!]/g),nt=O(/<[/\w]/g),rt=O(/<\/no(script|embed|frames)/i),it=O(/\/>/i),B={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,processingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},at=function(){return typeof window>`u`?null:window},ot=function(e,t){if(typeof e!=`object`||typeof e.createPolicy!=`function`)return null;let n=null,r=`data-tt-policy-suffix`;t&&t.hasAttribute(r)&&(n=t.getAttribute(r));let i=`dompurify`+(n?`#`+n:``);try{return e.createPolicy(i,{createHTML(e){return e},createScriptURL(e){return e}})}catch{return console.warn(`TrustedTypes policy `+i+` could not be created.`),null}},st=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}},ct=function(e,t,n,r){return M(e,t)&&A(e[t])?L(r.base?R(r.base):{},e[t],r.transform):n};function lt(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:at(),t=e=>lt(e);if(t.version=`3.4.11`,t.removed=[],!e||!e.document||e.document.nodeType!==B.document||!e.Element)return t.isSupported=!1,t;let n=e.document,r=n,i=r.currentScript;e.DocumentFragment;let a=e.HTMLTemplateElement,o=e.Node,s=e.Element,c=e.NodeFilter;e.NamedNodeMap===void 0&&(e.NamedNodeMap||e.MozNamedAttrMap),e.HTMLFormElement;let l=e.DOMParser,u=e.trustedTypes,d=s.prototype,f=z(d,`cloneNode`),p=z(d,`remove`),m=z(d,`nextSibling`),h=z(d,`childNodes`),g=z(d,`parentNode`),_=z(d,`shadowRoot`),v=z(d,`attributes`),y=o&&o.prototype?z(o.prototype,`nodeType`):null,b=o&&o.prototype?z(o.prototype,`nodeName`):null;if(typeof a==`function`){let e=n.createElement(`template`);e.content&&e.content.ownerDocument&&(n=e.content.ownerDocument)}let x,S=``,ee,te=!1,C=0,ne=function(){if(C>0)throw Ae(`A configured TRUSTED_TYPES_POLICY callback (createHTML or createScriptURL) must not call DOMPurify.sanitize, as that causes infinite recursion. Do not pass a policy whose callbacks wrap DOMPurify as TRUSTED_TYPES_POLICY; see the "DOMPurify and Trusted Types" section of the README.`)},w=function(e){ne(),C++;try{return x.createHTML(e)}finally{C--}},re=function(e){ne(),C++;try{return x.createScriptURL(e)}finally{C--}},ie=function(){return te||=(ee=ot(u,i),!0),ee},T=n,ae=T.implementation,oe=T.createNodeIterator,se=T.createDocumentFragment,ce=T.getElementsByTagName,ue=r.importNode,E=st();t.isSupported=typeof le==`function`&&typeof g==`function`&&ae&&ae.createHTMLDocument!==void 0;let de=Ge,fe=Ke,me=qe,he=Je,ge=Ye,Ee=Ze,De=Qe,Oe=et,ke=Xe,N=null,F=L({},[...Pe,...Fe,...Ie,...Re,...Be]),I=null,je=L({},[...Ve,...He,...Ue,...We]),V=Object.seal(pe(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),ut=null,dt=null,H=Object.seal(pe(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}})),ft=!0,pt=!0,U=!1,mt=!0,W=!1,ht=!0,gt=!1,_t=!1,vt=null,yt=null,bt=!1,xt=!1,St=!1,Ct=!1,wt=!0,Tt=!1,Et=`user-content-`,Dt=!0,Ot=!1,G={},K=null,kt=L({},`annotation-xml.audio.colgroup.desc.foreignobject.head.iframe.math.mi.mn.mo.ms.mtext.noembed.noframes.noscript.plaintext.script.selectedcontent.style.svg.template.thead.title.video.xmp`.split(`.`)),At=null,jt=L({},[`audio`,`video`,`img`,`source`,`image`,`track`]),Mt=null,Nt=L({},[`alt`,`class`,`for`,`id`,`label`,`name`,`pattern`,`placeholder`,`role`,`summary`,`title`,`value`,`style`,`xmlns`]),Pt=`http://www.w3.org/1998/Math/MathML`,Ft=`http://www.w3.org/2000/svg`,q=`http://www.w3.org/1999/xhtml`,It=q,Lt=!1,Rt=null,zt=L({},[Pt,Ft,q],Se),Bt=D([`mi`,`mo`,`mn`,`ms`,`mtext`]),Vt=L({},Bt),Ht=D([`annotation-xml`]),Ut=L({},Ht),Wt=L({},[`title`,`style`,`font`,`a`,`script`]),Gt=null,Kt=[`application/xhtml+xml`,`text/html`],J=null,qt=null,Jt=n.createElement(`form`),Yt=function(e){return e instanceof RegExp||e instanceof Function},Xt=function(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(qt&&qt===e)return;(!e||typeof e!=`object`)&&(e={}),e=R(e),Gt=Kt.indexOf(e.PARSER_MEDIA_TYPE)===-1?`text/html`:e.PARSER_MEDIA_TYPE,J=Gt===`application/xhtml+xml`?Se:xe,N=ct(e,`ALLOWED_TAGS`,F,{transform:J}),I=ct(e,`ALLOWED_ATTR`,je,{transform:J}),Rt=ct(e,`ALLOWED_NAMESPACES`,zt,{transform:Se}),Mt=ct(e,`ADD_URI_SAFE_ATTR`,Nt,{transform:J,base:Nt}),At=ct(e,`ADD_DATA_URI_TAGS`,jt,{transform:J,base:jt}),K=ct(e,`FORBID_CONTENTS`,kt,{transform:J}),ut=ct(e,`FORBID_TAGS`,R({}),{transform:J}),dt=ct(e,`FORBID_ATTR`,R({}),{transform:J}),G=M(e,`USE_PROFILES`)?e.USE_PROFILES&&typeof e.USE_PROFILES==`object`?R(e.USE_PROFILES):e.USE_PROFILES:!1,ft=e.ALLOW_ARIA_ATTR!==!1,pt=e.ALLOW_DATA_ATTR!==!1,U=e.ALLOW_UNKNOWN_PROTOCOLS||!1,mt=e.ALLOW_SELF_CLOSE_IN_ATTR!==!1,W=e.SAFE_FOR_TEMPLATES||!1,ht=e.SAFE_FOR_XML!==!1,gt=e.WHOLE_DOCUMENT||!1,xt=e.RETURN_DOM||!1,St=e.RETURN_DOM_FRAGMENT||!1,Ct=e.RETURN_TRUSTED_TYPE||!1,bt=e.FORCE_BODY||!1,wt=e.SANITIZE_DOM!==!1,Tt=e.SANITIZE_NAMED_PROPS||!1,Dt=e.KEEP_CONTENT!==!1,Ot=e.IN_PLACE||!1,ke=Ne(e.ALLOWED_URI_REGEXP)?e.ALLOWED_URI_REGEXP:Xe,It=typeof e.NAMESPACE==`string`?e.NAMESPACE:q,Vt=M(e,`MATHML_TEXT_INTEGRATION_POINTS`)&&e.MATHML_TEXT_INTEGRATION_POINTS&&typeof e.MATHML_TEXT_INTEGRATION_POINTS==`object`?R(e.MATHML_TEXT_INTEGRATION_POINTS):L({},Bt),Ut=M(e,`HTML_INTEGRATION_POINTS`)&&e.HTML_INTEGRATION_POINTS&&typeof e.HTML_INTEGRATION_POINTS==`object`?R(e.HTML_INTEGRATION_POINTS):L({},Ht);let t=M(e,`CUSTOM_ELEMENT_HANDLING`)&&e.CUSTOM_ELEMENT_HANDLING&&typeof e.CUSTOM_ELEMENT_HANDLING==`object`?R(e.CUSTOM_ELEMENT_HANDLING):pe(null);if(V=pe(null),M(t,`tagNameCheck`)&&Yt(t.tagNameCheck)&&(V.tagNameCheck=t.tagNameCheck),M(t,`attributeNameCheck`)&&Yt(t.attributeNameCheck)&&(V.attributeNameCheck=t.attributeNameCheck),M(t,`allowCustomizedBuiltInElements`)&&typeof t.allowCustomizedBuiltInElements==`boolean`&&(V.allowCustomizedBuiltInElements=t.allowCustomizedBuiltInElements),O(V),W&&(pt=!1),St&&(xt=!0),G&&(N=L({},Be),I=pe(null),G.html===!0&&(L(N,Pe),L(I,Ve)),G.svg===!0&&(L(N,Fe),L(I,He),L(I,We)),G.svgFilters===!0&&(L(N,Ie),L(I,He),L(I,We)),G.mathMl===!0&&(L(N,Re),L(I,Ue),L(I,We))),H.tagCheck=null,H.attributeCheck=null,M(e,`ADD_TAGS`)&&(typeof e.ADD_TAGS==`function`?H.tagCheck=e.ADD_TAGS:A(e.ADD_TAGS)&&(N===F&&(N=R(N)),L(N,e.ADD_TAGS,J))),M(e,`ADD_ATTR`)&&(typeof e.ADD_ATTR==`function`?H.attributeCheck=e.ADD_ATTR:A(e.ADD_ATTR)&&(I===je&&(I=R(I)),L(I,e.ADD_ATTR,J))),M(e,`ADD_URI_SAFE_ATTR`)&&A(e.ADD_URI_SAFE_ATTR)&&L(Mt,e.ADD_URI_SAFE_ATTR,J),M(e,`FORBID_CONTENTS`)&&A(e.FORBID_CONTENTS)&&(K===kt&&(K=R(K)),L(K,e.FORBID_CONTENTS,J)),M(e,`ADD_FORBID_CONTENTS`)&&A(e.ADD_FORBID_CONTENTS)&&(K===kt&&(K=R(K)),L(K,e.ADD_FORBID_CONTENTS,J)),Dt&&(N[`#text`]=!0),gt&&L(N,[`html`,`head`,`body`]),N.table&&(L(N,[`tbody`]),delete ut.tbody),e.TRUSTED_TYPES_POLICY){if(typeof e.TRUSTED_TYPES_POLICY.createHTML!=`function`)throw Ae(`TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.`);if(typeof e.TRUSTED_TYPES_POLICY.createScriptURL!=`function`)throw Ae(`TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.`);let t=x;x=e.TRUSTED_TYPES_POLICY;try{S=w(``)}catch(e){throw x=t,e}}else e.TRUSTED_TYPES_POLICY===null?(x=void 0,S=``):(x===void 0&&(x=ie()),x&&typeof S==`string`&&(S=w(``)));D&&D(e),qt=e},Zt=L({},[...Fe,...Ie,...Le]),Qt=L({},[...Re,...ze]),$t=function(e,t,n){return t.namespaceURI===q?e===`svg`:t.namespaceURI===Pt?e===`svg`&&(n===`annotation-xml`||Vt[n]):!!Zt[e]},en=function(e,t,n){return t.namespaceURI===q?e===`math`:t.namespaceURI===Ft?e===`math`&&Ut[n]:!!Qt[e]},tn=function(e,t,n){return t.namespaceURI===Ft&&!Ut[n]||t.namespaceURI===Pt&&!Vt[n]?!1:!Qt[e]&&(Wt[e]||!Zt[e])},nn=function(e){let t=g(e);(!t||!t.tagName)&&(t={namespaceURI:It,tagName:`template`});let n=xe(e.tagName),r=xe(t.tagName);return Rt[e.namespaceURI]?e.namespaceURI===Ft?$t(n,t,r):e.namespaceURI===Pt?en(n,t,r):e.namespaceURI===q?tn(n,t,r):!!(Gt===`application/xhtml+xml`&&Rt[e.namespaceURI]):!1},rn=function(e){ye(t.removed,{element:e});try{g(e).removeChild(e)}catch{if(p(e),!g(e))throw Ae(`a node selected for removal could not be detached from its tree and cannot be safely returned; refusing to sanitize in place`)}},an=function(e){let t=h(e);if(t){let e=[];k(t,t=>{ye(e,t)}),k(e,e=>{try{p(e)}catch{}})}let n=v(e);if(n)for(let t=n.length-1;t>=0;--t){let r=n[t],i=r&&r.name;if(typeof i==`string`)try{e.removeAttribute(i)}catch{}}},on=function(e,n){try{ye(t.removed,{attribute:n.getAttributeNode(e),from:n})}catch{ye(t.removed,{attribute:null,from:n})}if(n.removeAttribute(e),e===`is`)if(xt||St)try{rn(n)}catch{}else try{n.setAttribute(e,``)}catch{}},sn=function(e){let t=v(e);if(t)for(let n=t.length-1;n>=0;--n){let r=t[n],i=r&&r.name;if(!(typeof i!=`string`||I[J(i)]))try{e.removeAttribute(i)}catch{}}},cn=function(e){let t=[e];for(;t.length>0;){let e=t.pop();(y?y(e):e.nodeType)===B.element&&sn(e);let n=h(e);if(n)for(let e=n.length-1;e>=0;--e)t.push(n[e])}},ln=function(e){let t=null,r=null;if(bt)e=`<remove></remove>`+e;else{let t=j(e,/^[\r\n\t ]+/);r=t&&t[0]}Gt===`application/xhtml+xml`&&It===q&&(e=`<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>`+e+`</body></html>`);let i=x?w(e):e;if(It===q)try{t=new l().parseFromString(i,Gt)}catch{}if(!t||!t.documentElement){t=ae.createDocument(It,`template`,null);try{t.documentElement.innerHTML=Lt?S:i}catch{}}let a=t.body||t.documentElement;return e&&r&&a.insertBefore(n.createTextNode(r),a.childNodes[0]||null),It===q?ce.call(t,gt?`html`:`body`)[0]:gt?t.documentElement:a},un=function(e){return oe.call(e.ownerDocument||e,e,c.SHOW_ELEMENT|c.SHOW_COMMENT|c.SHOW_TEXT|c.SHOW_PROCESSING_INSTRUCTION|c.SHOW_CDATA_SECTION,null)},dn=function(e){return e=Ce(e,de,` `),e=Ce(e,fe,` `),e=Ce(e,me,` `),e},fn=function(e){e.normalize();let t=oe.call(e.ownerDocument||e,e,c.SHOW_TEXT|c.SHOW_COMMENT|c.SHOW_CDATA_SECTION|c.SHOW_PROCESSING_INSTRUCTION,null),n=t.nextNode();for(;n;)n.data=dn(n.data),n=t.nextNode();let r=e.querySelectorAll?.call(e,`template`);r&&k(r,e=>{mn(e.content)&&fn(e.content)})},pn=function(e){let t=b?b(e):null;return typeof t!=`string`||J(t)!==`form`?!1:typeof e.nodeName!=`string`||typeof e.textContent!=`string`||typeof e.removeChild!=`function`||e.attributes!==v(e)||typeof e.removeAttribute!=`function`||typeof e.setAttribute!=`function`||typeof e.namespaceURI!=`string`||typeof e.insertBefore!=`function`||typeof e.hasChildNodes!=`function`||e.nodeType!==y(e)||e.childNodes!==h(e)},mn=function(e){if(!y||typeof e!=`object`||!e)return!1;try{return y(e)===B.documentFragment}catch{return!1}},hn=function(e){if(!y||typeof e!=`object`||!e)return!1;try{return typeof y(e)==`number`}catch{return!1}};function Y(e,n,r){e.length!==0&&k(e,e=>{e.call(t,n,r,qt)})}let gn=function(e,t){return!!(ht&&e.hasChildNodes()&&!hn(e.firstElementChild)&&P(tt,e.textContent)&&P(tt,e.innerHTML)||ht&&e.namespaceURI===q&&t===`style`&&hn(e.firstElementChild)||e.nodeType===B.processingInstruction||ht&&e.nodeType===B.comment&&P(nt,e.data))},_n=function(e,t){if(!ut[t]&&bn(t)&&(V.tagNameCheck instanceof RegExp&&P(V.tagNameCheck,t)||V.tagNameCheck instanceof Function&&V.tagNameCheck(t)))return!1;if(Dt&&!K[t]){let t=g(e),n=h(e);if(n&&t){let r=n.length;for(let i=r-1;i>=0;--i){let r=Ot?n[i]:f(n[i],!0);t.insertBefore(r,m(e))}}}return rn(e),!0},X=function(e){if(Y(E.beforeSanitizeElements,e,null),pn(e))return rn(e),!0;let n=J(b?b(e):e.nodeName);if(Y(E.uponSanitizeElement,e,{tagName:n,allowedTags:N}),gn(e,n))return rn(e),!0;if(ut[n]||!(H.tagCheck instanceof Function&&H.tagCheck(n))&&!N[n])return _n(e,n);if((y?y(e):e.nodeType)===B.element&&!nn(e)||(n===`noscript`||n===`noembed`||n===`noframes`)&&P(rt,e.innerHTML))return rn(e),!0;if(W&&e.nodeType===B.text){let n=dn(e.textContent);e.textContent!==n&&(ye(t.removed,{element:e.cloneNode()}),e.textContent=n)}return Y(E.afterSanitizeElements,e,null),!1},vn=function(e,t,r){if(dt[t]||wt&&(t===`id`||t===`name`)&&(r in n||r in Jt))return!1;let i=I[t]||H.attributeCheck instanceof Function&&H.attributeCheck(t,e);if(!(pt&&P(he,t))&&!(ft&&P(ge,t))){if(!i){if(!(bn(e)&&(V.tagNameCheck instanceof RegExp&&P(V.tagNameCheck,e)||V.tagNameCheck instanceof Function&&V.tagNameCheck(e))&&(V.attributeNameCheck instanceof RegExp&&P(V.attributeNameCheck,t)||V.attributeNameCheck instanceof Function&&V.attributeNameCheck(t,e))||t===`is`&&V.allowCustomizedBuiltInElements&&(V.tagNameCheck instanceof RegExp&&P(V.tagNameCheck,r)||V.tagNameCheck instanceof Function&&V.tagNameCheck(r))))return!1}else if(!Mt[t]&&!P(ke,Ce(r,De,``))&&!((t===`src`||t===`xlink:href`||t===`href`)&&e!==`script`&&we(r,`data:`)===0&&At[e])&&!(U&&!P(Ee,Ce(r,De,``)))&&r)return!1}return!0},yn=L({},[`annotation-xml`,`color-profile`,`font-face`,`font-face-format`,`font-face-name`,`font-face-src`,`font-face-uri`,`missing-glyph`]),bn=function(e){return!yn[xe(e)]&&P(Oe,e)},xn=function(e,t,n,r){if(x&&typeof u==`object`&&typeof u.getAttributeType==`function`&&!n)switch(u.getAttributeType(e,t)){case`TrustedHTML`:return w(r);case`TrustedScriptURL`:return re(r)}return r},Sn=function(e,n,r,i){try{r?e.setAttributeNS(r,n,i):e.setAttribute(n,i),pn(e)?rn(e):ve(t.removed)}catch{on(n,e)}},Cn=function(e){Y(E.beforeSanitizeAttributes,e,null);let t=e.attributes;if(!t||pn(e))return;let n={attrName:``,attrValue:``,keepAttr:!0,allowedAttributes:I,forceKeepAttr:void 0},r=t.length,i=J(e.nodeName);for(;r--;){let a=t[r],o=a.name,s=a.namespaceURI,c=a.value,l=J(o),u=c,d=o===`value`?u:Te(u);if(n.attrName=l,n.attrValue=d,n.keepAttr=!0,n.forceKeepAttr=void 0,Y(E.uponSanitizeAttribute,e,n),d=n.attrValue,Tt&&(l===`id`||l===`name`)&&we(d,Et)!==0&&(on(o,e),d=Et+d),ht&&P(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,d)){on(o,e);continue}if(l===`attributename`&&j(d,`href`)){on(o,e);continue}if(!n.forceKeepAttr){if(!n.keepAttr){on(o,e);continue}if(!mt&&P(it,d)){on(o,e);continue}if(W&&(d=dn(d)),!vn(i,l,d)){on(o,e);continue}d=xn(i,l,s,d),d!==u&&Sn(e,o,s,d)}}Y(E.afterSanitizeAttributes,e,null)},wn=function(e){let t=null,n=un(e);for(Y(E.beforeSanitizeShadowDOM,e,null);t=n.nextNode();)if(Y(E.uponSanitizeShadowNode,t,null),X(t),Cn(t),mn(t.content)&&wn(t.content),(y?y(t):t.nodeType)===B.element){let e=_(t);mn(e)&&(Tn(e),wn(e))}Y(E.afterSanitizeShadowDOM,e,null)},Tn=function(e){let t=[{node:e,shadow:null}];for(;t.length>0;){let e=t.pop();if(e.shadow){wn(e.shadow);continue}let n=e.node,r=(y?y(n):n.nodeType)===B.element,i=h(n);if(i)for(let e=i.length-1;e>=0;--e)t.push({node:i[e],shadow:null});if(r){let e=b?b(n):null;if(typeof e==`string`&&J(e)===`template`){let e=n.content;mn(e)&&t.push({node:e,shadow:null})}}if(r){let e=_(n);mn(e)&&t.push({node:null,shadow:e},{node:e,shadow:null})}}};return t.sanitize=function(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=null,a=null,o=null,s=null;if(Lt=!e,Lt&&(e=`<!-->`),typeof e!=`string`&&!hn(e)&&(e=Me(e),typeof e!=`string`))throw Ae(`dirty is not a string, aborting`);if(!t.isSupported)return e;_t?(N=vt,I=yt):Xt(n),(E.uponSanitizeElement.length>0||E.uponSanitizeAttribute.length>0)&&(N=R(N)),E.uponSanitizeAttribute.length>0&&(I=R(I)),t.removed=[];let c=Ot&&typeof e!=`string`&&hn(e);if(c){let t=b?b(e):e.nodeName;if(typeof t==`string`){let e=J(t);if(!N[e]||ut[e])throw Ae(`root node is forbidden and cannot be sanitized in-place`)}if(pn(e))throw Ae(`root node is clobbered and cannot be sanitized in-place`);try{Tn(e)}catch(t){throw an(e),t}}else if(hn(e))i=ln(`<!---->`),a=i.ownerDocument.importNode(e,!0),a.nodeType===B.element&&a.nodeName===`BODY`||a.nodeName===`HTML`?i=a:i.appendChild(a),Tn(a);else{if(!xt&&!W&&!gt&&e.indexOf(`<`)===-1)return x&&Ct?w(e):e;if(i=ln(e),!i)return xt?null:Ct?S:``}i&&bt&&rn(i.firstChild);let l=un(c?e:i);try{for(;o=l.nextNode();)X(o),Cn(o),mn(o.content)&&wn(o.content)}catch(t){throw c&&an(e),t}if(c)return k(t.removed,e=>{e.element&&cn(e.element)}),W&&fn(e),e;if(xt){if(W&&fn(i),St)for(s=se.call(i.ownerDocument);i.firstChild;)s.appendChild(i.firstChild);else s=i;return(I.shadowroot||I.shadowrootmode)&&(s=ue.call(r,s,!0)),s}let u=gt?i.outerHTML:i.innerHTML;return gt&&N[`!doctype`]&&i.ownerDocument&&i.ownerDocument.doctype&&i.ownerDocument.doctype.name&&P($e,i.ownerDocument.doctype.name)&&(u=`<!DOCTYPE `+i.ownerDocument.doctype.name+`>
@@ -1 +1 @@
1
- import{t as e}from"./jsx-runtime-bzQ4Vb5N.js";import{dt as t,ft as n}from"./index-CKJ3uVR4.js";import{n as r,r as i}from"./SectionTabs-DXHzXmmb.js";var a=e();function o({title:e,description:o,children:s,actions:c,size:l=`default`}){return(0,a.jsxs)(n,{size:l,children:[(0,a.jsx)(t,{eyebrow:`Configuration`,title:e,description:o,actions:c}),(0,a.jsx)(i,{label:`Configuration sections`,base:`/config`,tabs:r}),(0,a.jsx)(`div`,{className:`space-y-6`,children:s})]})}export{o as t};
1
+ import{t as e}from"./jsx-runtime-bzQ4Vb5N.js";import{dt as t,ft as n}from"./index-1YXquAq8.js";import{n as r,r as i}from"./SectionTabs-DXHzXmmb.js";var a=e();function o({title:e,description:o,children:s,actions:c,size:l=`default`}){return(0,a.jsxs)(n,{size:l,children:[(0,a.jsx)(t,{eyebrow:`Configuration`,title:e,description:o,actions:c}),(0,a.jsx)(i,{label:`Configuration sections`,base:`/config`,tabs:r}),(0,a.jsx)(`div`,{className:`space-y-6`,children:s})]})}export{o as t};
@@ -1 +1 @@
1
- import{i as e,n as t,t as n}from"./jsx-runtime-bzQ4Vb5N.js";import{$ as r,G as i,H as a,J as o,K as s,N as c,Q as l,U as u,V as d,W as f,X as p,Y as m,Z as h,_t as g,at as _,et as ee,gt as v,q as y,tt as b}from"./index-CKJ3uVR4.js";var x=_(`x`,[[`path`,{d:`M18 6 6 18`,key:`1bl5f8`}],[`path`,{d:`m6 6 12 12`,key:`d8bk6v`}]]),S=e(t(),1),C=n(),w=`Dialog`,[T,te]=l(w),[E,D]=T(w),O=e=>{let{__scopeDialog:t,children:n,open:r,defaultOpen:i,onOpenChange:a,modal:s=!0}=e,c=S.useRef(null),l=S.useRef(null),[u,d]=p({prop:r,defaultProp:i??!1,onChange:a,caller:w});return(0,C.jsx)(E,{scope:t,triggerRef:c,contentRef:l,contentId:o(),titleId:o(),descriptionId:o(),open:u,onOpenChange:d,onOpenToggle:S.useCallback(()=>d(e=>!e),[d]),modal:s,children:n})};O.displayName=w;var k=`DialogTrigger`,ne=S.forwardRef((e,t)=>{let{__scopeDialog:n,...i}=e,a=D(k,n),o=b(t,a.triggerRef);return(0,C.jsx)(r.button,{type:`button`,"aria-haspopup":`dialog`,"aria-expanded":a.open,"aria-controls":a.open?a.contentId:void 0,"data-state":Y(a.open),...i,ref:o,onClick:h(e.onClick,a.onOpenToggle)})});ne.displayName=k;var A=`DialogPortal`,[j,M]=T(A,{forceMount:void 0}),N=e=>{let{__scopeDialog:t,forceMount:n,children:r,container:i}=e,a=D(A,t);return(0,C.jsx)(j,{scope:t,forceMount:n,children:S.Children.map(r,e=>(0,C.jsx)(m,{present:n||a.open,children:(0,C.jsx)(f,{asChild:!0,container:i,children:e})}))})};N.displayName=A;var P=`DialogOverlay`,F=S.forwardRef((e,t)=>{let n=M(P,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,a=D(P,e.__scopeDialog);return a.modal?(0,C.jsx)(m,{present:r||a.open,children:(0,C.jsx)(L,{...i,ref:t})}):null});F.displayName=P;var I=ee(`DialogOverlay.RemoveScroll`),L=S.forwardRef((e,t)=>{let{__scopeDialog:n,...i}=e,o=D(P,n),s=b(t,y());return(0,C.jsx)(a,{as:I,allowPinchZoom:!0,shards:[o.contentRef],children:(0,C.jsx)(r.div,{"data-state":Y(o.open),...i,ref:s,style:{pointerEvents:`auto`,...i.style}})})}),R=`DialogContent`,z=S.forwardRef((e,t)=>{let n=M(R,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,a=D(R,e.__scopeDialog);return(0,C.jsx)(m,{present:r||a.open,children:a.modal?(0,C.jsx)(B,{...i,ref:t}):(0,C.jsx)(V,{...i,ref:t})})});z.displayName=R;var B=S.forwardRef((e,t)=>{let n=D(R,e.__scopeDialog),r=S.useRef(null),i=b(t,n.contentRef,r);return S.useEffect(()=>{let e=r.current;if(e)return d(e)},[]),(0,C.jsx)(H,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:n.open,onCloseAutoFocus:h(e.onCloseAutoFocus,e=>{e.preventDefault(),n.triggerRef.current?.focus()}),onPointerDownOutside:h(e.onPointerDownOutside,e=>{let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0;(t.button===2||n)&&e.preventDefault()}),onFocusOutside:h(e.onFocusOutside,e=>e.preventDefault())})}),V=S.forwardRef((e,t)=>{let n=D(R,e.__scopeDialog),r=S.useRef(!1),i=S.useRef(!1);return(0,C.jsx)(H,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:t=>{e.onCloseAutoFocus?.(t),t.defaultPrevented||(r.current||n.triggerRef.current?.focus(),t.preventDefault()),r.current=!1,i.current=!1},onInteractOutside:t=>{e.onInteractOutside?.(t),t.defaultPrevented||(r.current=!0,t.detail.originalEvent.type===`pointerdown`&&(i.current=!0));let a=t.target;n.triggerRef.current?.contains(a)&&t.preventDefault(),t.detail.originalEvent.type===`focusin`&&i.current&&t.preventDefault()}})}),H=S.forwardRef((e,t)=>{let{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:a,onCloseAutoFocus:o,...c}=e,l=D(R,n);return u(),(0,C.jsx)(C.Fragment,{children:(0,C.jsx)(i,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:a,onUnmountAutoFocus:o,children:(0,C.jsx)(s,{role:`dialog`,id:l.contentId,"aria-describedby":l.descriptionId,"aria-labelledby":l.titleId,"data-state":Y(l.open),...c,ref:t,deferPointerDownOutside:!0,onDismiss:()=>l.onOpenChange(!1)})})})}),U=`DialogTitle`,W=S.forwardRef((e,t)=>{let{__scopeDialog:n,...i}=e,a=D(U,n);return(0,C.jsx)(r.h2,{id:a.titleId,...i,ref:t})});W.displayName=U;var G=`DialogDescription`,K=S.forwardRef((e,t)=>{let{__scopeDialog:n,...i}=e,a=D(G,n);return(0,C.jsx)(r.p,{id:a.descriptionId,...i,ref:t})});K.displayName=G;var q=`DialogClose`,J=S.forwardRef((e,t)=>{let{__scopeDialog:n,...i}=e,a=D(q,n);return(0,C.jsx)(r.button,{type:`button`,...i,ref:t,onClick:h(e.onClick,()=>a.onOpenChange(!1))})});J.displayName=q;function Y(e){return e?`open`:`closed`}var X=typeof document>`u`?S.useEffect:S.useLayoutEffect;function Z(e){let t=e.activeElement;return!t||t===e.body||t===e.documentElement||!(`focus`in t)||typeof t.focus!=`function`?null:t}function re(e,t){!e?.isConnected||e.ownerDocument!==t||e.focus({preventScroll:!0})}function Q({open:e=!0,onClose:t,busy:n=!1,title:r,description:i,className:a,children:o}){let s=(0,S.useRef)(null),c=(0,S.useRef)(!1);return X(()=>{e&&!c.current&&(s.current=Z(document)),c.current=e},[e]),(0,C.jsx)(O,{open:e,onOpenChange:e=>{!e&&!n&&t()},children:(0,C.jsxs)(N,{children:[(0,C.jsx)(F,{className:`fixed inset-0 z-50 bg-chocolate/35 backdrop-blur-[2px] data-[state=open]:animate-in data-[state=open]:fade-in-0`}),(0,C.jsxs)(z,{className:v(`fixed left-1/2 top-1/2 z-50 grid max-h-[calc(100dvh-2rem)] w-[calc(100%-2rem)] max-w-lg -translate-x-1/2 -translate-y-1/2 gap-4 overflow-y-auto rounded-[16px] border border-frost bg-snow p-5 text-chocolate shadow-baziu-lg outline-none data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95 sm:p-6`,a),onCloseAutoFocus:e=>{e.preventDefault(),re(s.current,document),s.current=null},onEscapeKeyDown:e=>{n&&e.preventDefault()},onPointerDownOutside:e=>{n&&e.preventDefault()},children:[(0,C.jsxs)(`div`,{className:`flex flex-col gap-2 pr-6`,children:[(0,C.jsx)(W,{className:`font-serif text-xl text-chocolate`,children:r}),i?(0,C.jsx)(K,{asChild:!0,children:(0,C.jsx)(`div`,{className:`text-sm leading-6 text-mocha`,children:i})}):(0,C.jsx)(K,{className:`sr-only`,children:r})]}),o,!n&&(0,C.jsx)(J,{"aria-label":`Close`,className:`absolute right-3 top-3 inline-flex size-8 items-center justify-center rounded-lg text-mocha hover:bg-ivory hover:text-sapphire`,children:(0,C.jsx)(x,{className:`size-4`,"aria-hidden":`true`})})]})]})})}function $({children:e}){return(0,C.jsx)(`div`,{className:`flex flex-col-reverse gap-2 border-t border-frost pt-4 sm:flex-row sm:justify-end`,children:e})}function ie({open:e,title:t,description:n,confirmLabel:r,confirmVariant:i=`danger`,onConfirm:a,onOpenChange:o}){let[s,l]=(0,S.useState)(!1),[u,d]=(0,S.useState)(null);(0,S.useEffect)(()=>{e||(l(!1),d(null))},[e]);async function f(){l(!0),d(null);try{await a(),o(!1)}catch(e){d(c(e)),l(!1)}}return(0,C.jsxs)(Q,{open:e,busy:s,onClose:()=>o(!1),title:t,description:n,className:`max-w-md`,children:[u&&(0,C.jsx)(`p`,{role:`alert`,className:`rounded-md bg-danger/10 px-3 py-2 text-sm text-danger`,children:u}),(0,C.jsxs)($,{children:[(0,C.jsx)(g,{variant:`ghost`,disabled:s,onClick:()=>o(!1),children:`Cancel`}),(0,C.jsx)(g,{variant:i,disabled:s,onClick:()=>void f(),children:s?`Working…`:r})]})]})}export{x as i,Q as n,$ as r,ie as t};
1
+ import{i as e,n as t,t as n}from"./jsx-runtime-bzQ4Vb5N.js";import{$ as r,G as i,H as a,J as o,K as s,N as c,Q as l,U as u,V as d,W as f,X as p,Y as m,Z as h,_t as g,at as _,et as ee,gt as v,q as y,tt as b}from"./index-1YXquAq8.js";var x=_(`x`,[[`path`,{d:`M18 6 6 18`,key:`1bl5f8`}],[`path`,{d:`m6 6 12 12`,key:`d8bk6v`}]]),S=e(t(),1),C=n(),w=`Dialog`,[T,te]=l(w),[E,D]=T(w),O=e=>{let{__scopeDialog:t,children:n,open:r,defaultOpen:i,onOpenChange:a,modal:s=!0}=e,c=S.useRef(null),l=S.useRef(null),[u,d]=p({prop:r,defaultProp:i??!1,onChange:a,caller:w});return(0,C.jsx)(E,{scope:t,triggerRef:c,contentRef:l,contentId:o(),titleId:o(),descriptionId:o(),open:u,onOpenChange:d,onOpenToggle:S.useCallback(()=>d(e=>!e),[d]),modal:s,children:n})};O.displayName=w;var k=`DialogTrigger`,ne=S.forwardRef((e,t)=>{let{__scopeDialog:n,...i}=e,a=D(k,n),o=b(t,a.triggerRef);return(0,C.jsx)(r.button,{type:`button`,"aria-haspopup":`dialog`,"aria-expanded":a.open,"aria-controls":a.open?a.contentId:void 0,"data-state":Y(a.open),...i,ref:o,onClick:h(e.onClick,a.onOpenToggle)})});ne.displayName=k;var A=`DialogPortal`,[j,M]=T(A,{forceMount:void 0}),N=e=>{let{__scopeDialog:t,forceMount:n,children:r,container:i}=e,a=D(A,t);return(0,C.jsx)(j,{scope:t,forceMount:n,children:S.Children.map(r,e=>(0,C.jsx)(m,{present:n||a.open,children:(0,C.jsx)(f,{asChild:!0,container:i,children:e})}))})};N.displayName=A;var P=`DialogOverlay`,F=S.forwardRef((e,t)=>{let n=M(P,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,a=D(P,e.__scopeDialog);return a.modal?(0,C.jsx)(m,{present:r||a.open,children:(0,C.jsx)(L,{...i,ref:t})}):null});F.displayName=P;var I=ee(`DialogOverlay.RemoveScroll`),L=S.forwardRef((e,t)=>{let{__scopeDialog:n,...i}=e,o=D(P,n),s=b(t,y());return(0,C.jsx)(a,{as:I,allowPinchZoom:!0,shards:[o.contentRef],children:(0,C.jsx)(r.div,{"data-state":Y(o.open),...i,ref:s,style:{pointerEvents:`auto`,...i.style}})})}),R=`DialogContent`,z=S.forwardRef((e,t)=>{let n=M(R,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,a=D(R,e.__scopeDialog);return(0,C.jsx)(m,{present:r||a.open,children:a.modal?(0,C.jsx)(B,{...i,ref:t}):(0,C.jsx)(V,{...i,ref:t})})});z.displayName=R;var B=S.forwardRef((e,t)=>{let n=D(R,e.__scopeDialog),r=S.useRef(null),i=b(t,n.contentRef,r);return S.useEffect(()=>{let e=r.current;if(e)return d(e)},[]),(0,C.jsx)(H,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:n.open,onCloseAutoFocus:h(e.onCloseAutoFocus,e=>{e.preventDefault(),n.triggerRef.current?.focus()}),onPointerDownOutside:h(e.onPointerDownOutside,e=>{let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0;(t.button===2||n)&&e.preventDefault()}),onFocusOutside:h(e.onFocusOutside,e=>e.preventDefault())})}),V=S.forwardRef((e,t)=>{let n=D(R,e.__scopeDialog),r=S.useRef(!1),i=S.useRef(!1);return(0,C.jsx)(H,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:t=>{e.onCloseAutoFocus?.(t),t.defaultPrevented||(r.current||n.triggerRef.current?.focus(),t.preventDefault()),r.current=!1,i.current=!1},onInteractOutside:t=>{e.onInteractOutside?.(t),t.defaultPrevented||(r.current=!0,t.detail.originalEvent.type===`pointerdown`&&(i.current=!0));let a=t.target;n.triggerRef.current?.contains(a)&&t.preventDefault(),t.detail.originalEvent.type===`focusin`&&i.current&&t.preventDefault()}})}),H=S.forwardRef((e,t)=>{let{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:a,onCloseAutoFocus:o,...c}=e,l=D(R,n);return u(),(0,C.jsx)(C.Fragment,{children:(0,C.jsx)(i,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:a,onUnmountAutoFocus:o,children:(0,C.jsx)(s,{role:`dialog`,id:l.contentId,"aria-describedby":l.descriptionId,"aria-labelledby":l.titleId,"data-state":Y(l.open),...c,ref:t,deferPointerDownOutside:!0,onDismiss:()=>l.onOpenChange(!1)})})})}),U=`DialogTitle`,W=S.forwardRef((e,t)=>{let{__scopeDialog:n,...i}=e,a=D(U,n);return(0,C.jsx)(r.h2,{id:a.titleId,...i,ref:t})});W.displayName=U;var G=`DialogDescription`,K=S.forwardRef((e,t)=>{let{__scopeDialog:n,...i}=e,a=D(G,n);return(0,C.jsx)(r.p,{id:a.descriptionId,...i,ref:t})});K.displayName=G;var q=`DialogClose`,J=S.forwardRef((e,t)=>{let{__scopeDialog:n,...i}=e,a=D(q,n);return(0,C.jsx)(r.button,{type:`button`,...i,ref:t,onClick:h(e.onClick,()=>a.onOpenChange(!1))})});J.displayName=q;function Y(e){return e?`open`:`closed`}var X=typeof document>`u`?S.useEffect:S.useLayoutEffect;function Z(e){let t=e.activeElement;return!t||t===e.body||t===e.documentElement||!(`focus`in t)||typeof t.focus!=`function`?null:t}function re(e,t){!e?.isConnected||e.ownerDocument!==t||e.focus({preventScroll:!0})}function Q({open:e=!0,onClose:t,busy:n=!1,title:r,description:i,className:a,children:o}){let s=(0,S.useRef)(null),c=(0,S.useRef)(!1);return X(()=>{e&&!c.current&&(s.current=Z(document)),c.current=e},[e]),(0,C.jsx)(O,{open:e,onOpenChange:e=>{!e&&!n&&t()},children:(0,C.jsxs)(N,{children:[(0,C.jsx)(F,{className:`fixed inset-0 z-50 bg-chocolate/35 backdrop-blur-[2px] data-[state=open]:animate-in data-[state=open]:fade-in-0`}),(0,C.jsxs)(z,{className:v(`fixed left-1/2 top-1/2 z-50 grid max-h-[calc(100dvh-2rem)] w-[calc(100%-2rem)] max-w-lg -translate-x-1/2 -translate-y-1/2 gap-4 overflow-y-auto rounded-[16px] border border-frost bg-snow p-5 text-chocolate shadow-baziu-lg outline-none data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95 sm:p-6`,a),onCloseAutoFocus:e=>{e.preventDefault(),re(s.current,document),s.current=null},onEscapeKeyDown:e=>{n&&e.preventDefault()},onPointerDownOutside:e=>{n&&e.preventDefault()},children:[(0,C.jsxs)(`div`,{className:`flex flex-col gap-2 pr-6`,children:[(0,C.jsx)(W,{className:`font-serif text-xl text-chocolate`,children:r}),i?(0,C.jsx)(K,{asChild:!0,children:(0,C.jsx)(`div`,{className:`text-sm leading-6 text-mocha`,children:i})}):(0,C.jsx)(K,{className:`sr-only`,children:r})]}),o,!n&&(0,C.jsx)(J,{"aria-label":`Close`,className:`absolute right-3 top-3 inline-flex size-8 items-center justify-center rounded-lg text-mocha hover:bg-ivory hover:text-sapphire`,children:(0,C.jsx)(x,{className:`size-4`,"aria-hidden":`true`})})]})]})})}function $({children:e}){return(0,C.jsx)(`div`,{className:`flex flex-col-reverse gap-2 border-t border-frost pt-4 sm:flex-row sm:justify-end`,children:e})}function ie({open:e,title:t,description:n,confirmLabel:r,confirmVariant:i=`danger`,onConfirm:a,onOpenChange:o}){let[s,l]=(0,S.useState)(!1),[u,d]=(0,S.useState)(null);(0,S.useEffect)(()=>{e||(l(!1),d(null))},[e]);async function f(){l(!0),d(null);try{await a(),o(!1)}catch(e){d(c(e)),l(!1)}}return(0,C.jsxs)(Q,{open:e,busy:s,onClose:()=>o(!1),title:t,description:n,className:`max-w-md`,children:[u&&(0,C.jsx)(`p`,{role:`alert`,className:`rounded-md bg-danger/10 px-3 py-2 text-sm text-danger`,children:u}),(0,C.jsxs)($,{children:[(0,C.jsx)(g,{variant:`ghost`,disabled:s,onClick:()=>o(!1),children:`Cancel`}),(0,C.jsx)(g,{variant:i,disabled:s,onClick:()=>void f(),children:s?`Working…`:r})]})]})}export{x as i,Q as n,$ as r,ie as t};
@@ -1 +1 @@
1
- import{i as e,n as t,t as n}from"./jsx-runtime-bzQ4Vb5N.js";import{f as r}from"./preload-helper-eUUcpe2S.js";import{t as i}from"./ConfirmDialog-B5BLql5H.js";import{N as a,_t as o,j as s}from"./index-CKJ3uVR4.js";var c=e(t(),1),l=n();function u({field:e}){let t=r(),n=`/api/config/fields/${encodeURIComponent(e.envVar)}`,u=(0,c.useId)(),d=`${u}-description`,[f,p]=(0,c.useState)(e.kind===`config`?e.value??``:``),[m,h]=(0,c.useState)(!1),[g,_]=(0,c.useState)(null),[v,y]=(0,c.useState)(null),[b,x]=(0,c.useState)(!1),S=e.kind===`secret`&&f.trim().length===0;async function C(r){if(r.preventDefault(),S){_(e.set?`Paste a replacement value, or use remove credential to explicitly clear the stored secret.`:`A secret value is required.`);return}h(!0),_(null);try{await s(n,{method:`PUT`,body:{value:f}}),y(Date.now()),e.kind===`secret`&&p(``),await t.invalidate()}catch(e){_(a(e))}finally{h(!1)}}async function w(){await s(n,{method:`DELETE`}),p(``),_(null),y(Date.now()),await t.invalidate()}return(0,l.jsxs)(`form`,{onSubmit:C,className:`grid grid-cols-1 gap-2 border-b py-3 last:border-0 md:grid-cols-[12rem_minmax(0,1fr)_auto_auto] md:items-center`,children:[(0,l.jsxs)(`div`,{className:`min-w-0`,children:[(0,l.jsx)(`label`,{htmlFor:u,className:`text-sm font-medium text-foreground`,children:e.label}),e.description&&(0,l.jsx)(`div`,{id:d,className:`text-xs text-muted-foreground mt-0.5`,children:e.description}),(0,l.jsxs)(`details`,{className:`mt-1 text-xs text-muted-foreground`,children:[(0,l.jsx)(`summary`,{className:`cursor-pointer`,children:`Advanced identifier`}),(0,l.jsx)(`code`,{className:`mt-1 inline-block break-all font-mono`,children:e.envVar})]})]}),(0,l.jsx)(`div`,{className:`min-w-0`,children:e.kind===`config`&&e.options?(0,l.jsxs)(`select`,{id:u,"aria-describedby":e.description?d:void 0,value:f,onChange:e=>p(e.target.value),className:`w-full rounded-md border bg-background px-2 py-1.5 text-sm outline-none focus:ring-2 focus:ring-ring/30`,children:[(0,l.jsx)(`option`,{value:``,children:`Not set (default)`}),f&&!e.options.includes(f)&&(0,l.jsxs)(`option`,{value:f,children:[`Unsupported: `,f]}),e.options.map(t=>(0,l.jsx)(`option`,{value:t,children:e.optionLabels?.[t]??t},t))]}):e.kind===`config`?(0,l.jsx)(`input`,{id:u,type:`text`,"aria-describedby":e.description?d:void 0,value:f,onChange:e=>p(e.target.value),placeholder:e.placeholder??``,className:`w-full rounded-md border bg-background px-2 py-1.5 text-sm outline-none focus:ring-2 focus:ring-ring/30`}):(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(`input`,{id:u,type:`password`,"aria-describedby":e.description?d:void 0,value:f,onChange:e=>p(e.target.value),placeholder:e.set?`(paste to replace stored value)`:e.placeholder??`paste key…`,autoComplete:`off`,className:`w-full rounded-md border bg-background px-2 py-1.5 text-sm outline-none focus:ring-2 focus:ring-ring/30`}),e.set&&(0,l.jsx)(`p`,{className:`mt-1 text-xs text-muted-foreground`,children:`Blank keeps the current credential. Removal is a separate explicit action.`})]})}),(0,l.jsxs)(`span`,{className:`text-xs`,children:[e.kind===`secret`&&e.set&&(0,l.jsx)(`span`,{className:`rounded-full bg-success/10 text-success px-1.5 py-0.5`,title:`preview: ${e.preview??``}`,children:`set`}),v&&Date.now()-v<2e3&&(0,l.jsx)(`span`,{role:`status`,className:`text-success ml-2`,children:`saved ✓`})]}),(0,l.jsxs)(`div`,{className:`flex flex-wrap gap-2 md:justify-self-end`,children:[(0,l.jsx)(o,{variant:`ghost`,type:`submit`,disabled:m||S,className:`text-xs`,children:`save`}),e.kind===`secret`&&e.set&&(0,l.jsx)(o,{variant:`danger`,className:`text-xs`,onClick:()=>x(!0),children:`remove`})]}),g&&(0,l.jsx)(`p`,{role:`alert`,className:`text-xs text-danger md:col-span-4`,children:g}),(0,l.jsx)(i,{open:b,title:`Remove ${e.label}?`,description:(0,l.jsxs)(`p`,{children:[`This permanently deletes the stored `,(0,l.jsx)(`code`,{className:`font-mono`,children:e.envVar}),` `,`credential. Features that use it will fail until you save a replacement.`]}),confirmLabel:`remove stored credential`,onConfirm:w,onOpenChange:x})]})}export{u as t};
1
+ import{i as e,n as t,t as n}from"./jsx-runtime-bzQ4Vb5N.js";import{f as r}from"./preload-helper-eUUcpe2S.js";import{t as i}from"./ConfirmDialog-536ziJ5P.js";import{N as a,_t as o,j as s}from"./index-1YXquAq8.js";var c=e(t(),1),l=n();function u({field:e}){let t=r(),n=`/api/config/fields/${encodeURIComponent(e.envVar)}`,u=(0,c.useId)(),d=`${u}-description`,[f,p]=(0,c.useState)(e.kind===`config`?e.value??``:``),[m,h]=(0,c.useState)(!1),[g,_]=(0,c.useState)(null),[v,y]=(0,c.useState)(null),[b,x]=(0,c.useState)(!1),S=e.kind===`secret`&&f.trim().length===0;async function C(r){if(r.preventDefault(),S){_(e.set?`Paste a replacement value, or use remove credential to explicitly clear the stored secret.`:`A secret value is required.`);return}h(!0),_(null);try{await s(n,{method:`PUT`,body:{value:f}}),y(Date.now()),e.kind===`secret`&&p(``),await t.invalidate()}catch(e){_(a(e))}finally{h(!1)}}async function w(){await s(n,{method:`DELETE`}),p(``),_(null),y(Date.now()),await t.invalidate()}return(0,l.jsxs)(`form`,{onSubmit:C,className:`grid grid-cols-1 gap-2 border-b py-3 last:border-0 md:grid-cols-[12rem_minmax(0,1fr)_auto_auto] md:items-center`,children:[(0,l.jsxs)(`div`,{className:`min-w-0`,children:[(0,l.jsx)(`label`,{htmlFor:u,className:`text-sm font-medium text-foreground`,children:e.label}),e.description&&(0,l.jsx)(`div`,{id:d,className:`text-xs text-muted-foreground mt-0.5`,children:e.description}),(0,l.jsxs)(`details`,{className:`mt-1 text-xs text-muted-foreground`,children:[(0,l.jsx)(`summary`,{className:`cursor-pointer`,children:`Advanced identifier`}),(0,l.jsx)(`code`,{className:`mt-1 inline-block break-all font-mono`,children:e.envVar})]})]}),(0,l.jsx)(`div`,{className:`min-w-0`,children:e.kind===`config`&&e.options?(0,l.jsxs)(`select`,{id:u,"aria-describedby":e.description?d:void 0,value:f,onChange:e=>p(e.target.value),className:`w-full rounded-md border bg-background px-2 py-1.5 text-sm outline-none focus:ring-2 focus:ring-ring/30`,children:[(0,l.jsx)(`option`,{value:``,children:`Not set (default)`}),f&&!e.options.includes(f)&&(0,l.jsxs)(`option`,{value:f,children:[`Unsupported: `,f]}),e.options.map(t=>(0,l.jsx)(`option`,{value:t,children:e.optionLabels?.[t]??t},t))]}):e.kind===`config`?(0,l.jsx)(`input`,{id:u,type:`text`,"aria-describedby":e.description?d:void 0,value:f,onChange:e=>p(e.target.value),placeholder:e.placeholder??``,className:`w-full rounded-md border bg-background px-2 py-1.5 text-sm outline-none focus:ring-2 focus:ring-ring/30`}):(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(`input`,{id:u,type:`password`,"aria-describedby":e.description?d:void 0,value:f,onChange:e=>p(e.target.value),placeholder:e.set?`(paste to replace stored value)`:e.placeholder??`paste key…`,autoComplete:`off`,className:`w-full rounded-md border bg-background px-2 py-1.5 text-sm outline-none focus:ring-2 focus:ring-ring/30`}),e.set&&(0,l.jsx)(`p`,{className:`mt-1 text-xs text-muted-foreground`,children:`Blank keeps the current credential. Removal is a separate explicit action.`})]})}),(0,l.jsxs)(`span`,{className:`text-xs`,children:[e.kind===`secret`&&e.set&&(0,l.jsx)(`span`,{className:`rounded-full bg-success/10 text-success px-1.5 py-0.5`,title:`preview: ${e.preview??``}`,children:`set`}),v&&Date.now()-v<2e3&&(0,l.jsx)(`span`,{role:`status`,className:`text-success ml-2`,children:`saved ✓`})]}),(0,l.jsxs)(`div`,{className:`flex flex-wrap gap-2 md:justify-self-end`,children:[(0,l.jsx)(o,{variant:`ghost`,type:`submit`,disabled:m||S,className:`text-xs`,children:`save`}),e.kind===`secret`&&e.set&&(0,l.jsx)(o,{variant:`danger`,className:`text-xs`,onClick:()=>x(!0),children:`remove`})]}),g&&(0,l.jsx)(`p`,{role:`alert`,className:`text-xs text-danger md:col-span-4`,children:g}),(0,l.jsx)(i,{open:b,title:`Remove ${e.label}?`,description:(0,l.jsxs)(`p`,{children:[`This permanently deletes the stored `,(0,l.jsx)(`code`,{className:`font-mono`,children:e.envVar}),` `,`credential. Features that use it will fail until you save a replacement.`]}),confirmLabel:`remove stored credential`,onConfirm:w,onOpenChange:x})]})}export{u as t};
@@ -1 +1 @@
1
- import{i as e,n as t,t as n}from"./jsx-runtime-bzQ4Vb5N.js";import{A as r,M as i,N as a,_t as o,j as s}from"./index-CKJ3uVR4.js";var c=e(t(),1),l=n(),u=[`image/png`,`image/jpeg`,`image/gif`,`image/webp`],d=[`text/plain`,`text/markdown`];function f({resultId:e,result:t,showPreview:n=!1}){let[f,p]=(0,c.useState)(t??null),[m,h]=(0,c.useState)(``),[g,_]=(0,c.useState)(null),[v,y]=(0,c.useState)(!1),b=`/api/results/${encodeURIComponent(e)}`;(0,c.useEffect)(()=>{if(t)return;let e=new AbortController;return s(b,{signal:e.signal}).then(e=>p(e.result)).catch(t=>{e.signal.aborted||h(t instanceof r&&t.status===404?`This saved file is unavailable (it may have been deleted).`:a(t))}),()=>e.abort()},[b,t]);async function x(){if(g!==null)return _(null);h(``);try{_(await(await i(`${b}/preview`)).text())}catch(e){h(a(e))}}let S=f&&u.includes(f.mimeType)&&f.byteLength<=10*1024*1024,C=f&&d.includes(f.mimeType)&&f.byteLength<=256*1024;return(0,l.jsxs)(`section`,{className:`my-3 rounded-lg border border-fawn bg-ivory p-3 text-chocolate`,"aria-label":`Saved result`,children:[f?(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(`p`,{className:`m-0 break-all font-semibold`,children:f.name}),(0,l.jsxs)(`p`,{className:`my-1 text-sm text-mocha-light`,children:[f.byteLength<1024?`${f.byteLength} B`:`${(f.byteLength/1024).toFixed(1)} KiB`,` · `,f.mimeType,f.imageModel&&` · generated with ${f.imageModel}`]}),(0,l.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[(0,l.jsx)(`a`,{className:`ghost-btn`,href:`${b}/download`,download:f.name,children:`Download`}),S&&!n&&f.imageModel===null&&(0,l.jsx)(o,{variant:`ghost`,onClick:()=>y(e=>!e),children:v?`Close preview`:`Preview`}),C&&(0,l.jsx)(o,{variant:`ghost`,onClick:()=>void x(),children:g===null?`Preview`:`Close preview`})]}),S&&(n||f.imageModel!==null||v)&&(0,l.jsx)(`img`,{src:`${b}/preview`,alt:f.name,className:`mt-3 max-h-80 max-w-full object-contain`}),g!==null&&(0,l.jsx)(`pre`,{className:`mt-3 max-h-80 overflow-auto whitespace-pre-wrap break-words text-sm`,children:g})]}):m?null:(0,l.jsx)(`p`,{role:`status`,children:`Loading saved result…`}),m&&(0,l.jsx)(`p`,{role:`alert`,className:`mt-2 text-sm text-danger`,children:m})]})}export{f as t};
1
+ import{i as e,n as t,t as n}from"./jsx-runtime-bzQ4Vb5N.js";import{A as r,M as i,N as a,_t as o,j as s}from"./index-1YXquAq8.js";var c=e(t(),1),l=n(),u=[`image/png`,`image/jpeg`,`image/gif`,`image/webp`],d=[`text/plain`,`text/markdown`];function f({resultId:e,result:t,showPreview:n=!1}){let[f,p]=(0,c.useState)(t??null),[m,h]=(0,c.useState)(``),[g,_]=(0,c.useState)(null),[v,y]=(0,c.useState)(!1),b=`/api/results/${encodeURIComponent(e)}`;(0,c.useEffect)(()=>{if(t)return;let e=new AbortController;return s(b,{signal:e.signal}).then(e=>p(e.result)).catch(t=>{e.signal.aborted||h(t instanceof r&&t.status===404?`This saved file is unavailable (it may have been deleted).`:a(t))}),()=>e.abort()},[b,t]);async function x(){if(g!==null)return _(null);h(``);try{_(await(await i(`${b}/preview`)).text())}catch(e){h(a(e))}}let S=f&&u.includes(f.mimeType)&&f.byteLength<=10*1024*1024,C=f&&d.includes(f.mimeType)&&f.byteLength<=256*1024;return(0,l.jsxs)(`section`,{className:`my-3 rounded-lg border border-fawn bg-ivory p-3 text-chocolate`,"aria-label":`Saved result`,children:[f?(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(`p`,{className:`m-0 break-all font-semibold`,children:f.name}),(0,l.jsxs)(`p`,{className:`my-1 text-sm text-mocha-light`,children:[f.byteLength<1024?`${f.byteLength} B`:`${(f.byteLength/1024).toFixed(1)} KiB`,` · `,f.mimeType,f.imageModel&&` · generated with ${f.imageModel}`]}),(0,l.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[(0,l.jsx)(`a`,{className:`ghost-btn`,href:`${b}/download`,download:f.name,children:`Download`}),S&&!n&&f.imageModel===null&&(0,l.jsx)(o,{variant:`ghost`,onClick:()=>y(e=>!e),children:v?`Close preview`:`Preview`}),C&&(0,l.jsx)(o,{variant:`ghost`,onClick:()=>void x(),children:g===null?`Preview`:`Close preview`})]}),S&&(n||f.imageModel!==null||v)&&(0,l.jsx)(`img`,{src:`${b}/preview`,alt:f.name,className:`mt-3 max-h-80 max-w-full object-contain`}),g!==null&&(0,l.jsx)(`pre`,{className:`mt-3 max-h-80 overflow-auto whitespace-pre-wrap break-words text-sm`,children:g})]}):m?null:(0,l.jsx)(`p`,{role:`status`,children:`Loading saved result…`}),m&&(0,l.jsx)(`p`,{role:`alert`,className:`mt-2 text-sm text-danger`,children:m})]})}export{f as t};
@@ -1 +1 @@
1
- import{t as e}from"./jsx-runtime-bzQ4Vb5N.js";import{ht as t}from"./index-CKJ3uVR4.js";var n=e();function r({findings:e}){return e.length===0?(0,n.jsx)(t,{variant:`success`,children:`Clean`}):(0,n.jsxs)(`details`,{className:`text-xs`,children:[(0,n.jsx)(`summary`,{className:`cursor-pointer list-none`,children:(0,n.jsxs)(t,{variant:e.some(e=>e.severity===`danger`)?`danger`:`warning`,children:[e.length,` finding`,e.length===1?``:`s`]})}),(0,n.jsx)(`div`,{className:`mt-2 min-w-64`,children:(0,n.jsx)(i,{findings:e})})]})}function i({findings:e}){return(0,n.jsx)(`ul`,{className:`m-0 space-y-1.5 pl-0`,children:e.map((e,r)=>(0,n.jsxs)(`li`,{className:`flex items-start gap-2`,children:[(0,n.jsx)(t,{variant:e.severity===`danger`?`danger`:`warning`,children:e.severity===`danger`?`Danger`:`Warning`}),(0,n.jsxs)(`span`,{children:[(0,n.jsx)(`code`,{children:e.code}),e.line?`, line ${e.line}`:``,` — `,e.message]})]},r))})}export{r as n,i as t};
1
+ import{t as e}from"./jsx-runtime-bzQ4Vb5N.js";import{ht as t}from"./index-1YXquAq8.js";var n=e();function r({findings:e}){return e.length===0?(0,n.jsx)(t,{variant:`success`,children:`Clean`}):(0,n.jsxs)(`details`,{className:`text-xs`,children:[(0,n.jsx)(`summary`,{className:`cursor-pointer list-none`,children:(0,n.jsxs)(t,{variant:e.some(e=>e.severity===`danger`)?`danger`:`warning`,children:[e.length,` finding`,e.length===1?``:`s`]})}),(0,n.jsx)(`div`,{className:`mt-2 min-w-64`,children:(0,n.jsx)(i,{findings:e})})]})}function i({findings:e}){return(0,n.jsx)(`ul`,{className:`m-0 space-y-1.5 pl-0`,children:e.map((e,r)=>(0,n.jsxs)(`li`,{className:`flex items-start gap-2`,children:[(0,n.jsx)(t,{variant:e.severity===`danger`?`danger`:`warning`,children:e.severity===`danger`?`Danger`:`Warning`}),(0,n.jsxs)(`span`,{children:[(0,n.jsx)(`code`,{children:e.code}),e.line?`, line ${e.line}`:``,` — `,e.message]})]},r))})}export{r as n,i as t};
@@ -1 +1 @@
1
- import{i as e,n as t,t as n}from"./jsx-runtime-bzQ4Vb5N.js";import{s as r}from"./preload-helper-eUUcpe2S.js";import{n as i,r as a}from"./ConfirmDialog-B5BLql5H.js";import{N as o,_t as s,j as c}from"./index-CKJ3uVR4.js";import"./entities-xVoB-p2j.js";import{n as l,t as u}from"./ModelSelect-CvOHjUyB.js";var d=e(t(),1),f=n();function p({profiles:e,teams:t,profileId:n,onClose:p}){let m=r(),[h,g]=(0,d.useState)(n??e.find(e=>e.id==="default")?.id??e[0]?.id??``),[_,v]=(0,d.useState)(``),[y,b]=(0,d.useState)(``),[x,S]=(0,d.useState)([]),[C,w]=(0,d.useState)(t.find(e=>e.id==="default")?.id??t[0]?.id??``),[T,E]=(0,d.useState)(!1),[D,O]=(0,d.useState)(null),k=t.find(e=>e.id===C)?.policyMode===`restricted`;(0,d.useEffect)(()=>{let e=new AbortController;return c(u,{signal:e.signal}).then(e=>S(e.teams)).catch(()=>{}),()=>e.abort()},[]);async function A(e){e.preventDefault(),O(null),E(!0);try{let e={profileId:h,teamId:C};_.trim()&&(e.name=_.trim()),y&&(e.model=y);let{agent:t}=await c(`/api/agents`,{body:e});p(),await m({to:`/`,search:{agent:t.id}})}catch(e){O(o(e)),E(!1)}}return(0,f.jsx)(i,{title:`Spawn an agent`,busy:T,onClose:p,children:(0,f.jsxs)(`form`,{onSubmit:e=>void A(e),children:[(0,f.jsxs)(`label`,{children:[`Agent template`,(0,f.jsx)(`select`,{value:h,onChange:e=>g(e.target.value),required:!0,children:e.map(e=>(0,f.jsx)(`option`,{value:e.id,children:e.name||e.id},e.id))})]}),(0,f.jsxs)(`label`,{children:[`Name (optional; defaults to the template's)`,(0,f.jsx)(`input`,{value:_,onChange:e=>v(e.target.value),autoComplete:`off`})]}),(0,f.jsx)(l,{label:`Model`,value:y,onChange:b,groups:x,emptyOption:`Use the template default`}),(0,f.jsxs)(`label`,{children:[`Team`,(0,f.jsx)(`select`,{value:C,onChange:e=>w(e.target.value),children:t.map(e=>(0,f.jsxs)(`option`,{value:e.id,children:[e.name,e.id==="default"?` (default)`:``]},e.id))})]}),k&&(0,f.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`This Team is restricted: the new Agent starts with no allow edges. Add them on the Team policy page.`}),D&&(0,f.jsx)(`p`,{role:`alert`,className:`err mt-2`,children:D}),(0,f.jsx)(`div`,{className:`mt-4`,children:(0,f.jsxs)(a,{children:[(0,f.jsx)(s,{variant:`ghost`,disabled:T,onClick:p,children:`Cancel`}),(0,f.jsx)(s,{variant:`primary`,type:`submit`,disabled:T||!h,children:T?`Spawning…`:`Spawn agent`})]})})]})})}export{p as t};
1
+ import{i as e,n as t,t as n}from"./jsx-runtime-bzQ4Vb5N.js";import{s as r}from"./preload-helper-eUUcpe2S.js";import{n as i,r as a}from"./ConfirmDialog-536ziJ5P.js";import{N as o,_t as s,j as c}from"./index-1YXquAq8.js";import"./entities-xVoB-p2j.js";import{n as l,t as u}from"./ModelSelect-CvOHjUyB.js";var d=e(t(),1),f=n();function p({profiles:e,teams:t,profileId:n,onClose:p}){let m=r(),[h,g]=(0,d.useState)(n??e.find(e=>e.id==="default")?.id??e[0]?.id??``),[_,v]=(0,d.useState)(``),[y,b]=(0,d.useState)(``),[x,S]=(0,d.useState)([]),[C,w]=(0,d.useState)(t.find(e=>e.id==="default")?.id??t[0]?.id??``),[T,E]=(0,d.useState)(!1),[D,O]=(0,d.useState)(null),k=t.find(e=>e.id===C)?.policyMode===`restricted`;(0,d.useEffect)(()=>{let e=new AbortController;return c(u,{signal:e.signal}).then(e=>S(e.teams)).catch(()=>{}),()=>e.abort()},[]);async function A(e){e.preventDefault(),O(null),E(!0);try{let e={profileId:h,teamId:C};_.trim()&&(e.name=_.trim()),y&&(e.model=y);let{agent:t}=await c(`/api/agents`,{body:e});p(),await m({to:`/`,search:{agent:t.id}})}catch(e){O(o(e)),E(!1)}}return(0,f.jsx)(i,{title:`Spawn an agent`,busy:T,onClose:p,children:(0,f.jsxs)(`form`,{onSubmit:e=>void A(e),children:[(0,f.jsxs)(`label`,{children:[`Agent template`,(0,f.jsx)(`select`,{value:h,onChange:e=>g(e.target.value),required:!0,children:e.map(e=>(0,f.jsx)(`option`,{value:e.id,children:e.name||e.id},e.id))})]}),(0,f.jsxs)(`label`,{children:[`Name (optional; defaults to the template's)`,(0,f.jsx)(`input`,{value:_,onChange:e=>v(e.target.value),autoComplete:`off`})]}),(0,f.jsx)(l,{label:`Model`,value:y,onChange:b,groups:x,emptyOption:`Use the template default`}),(0,f.jsxs)(`label`,{children:[`Team`,(0,f.jsx)(`select`,{value:C,onChange:e=>w(e.target.value),children:t.map(e=>(0,f.jsxs)(`option`,{value:e.id,children:[e.name,e.id==="default"?` (default)`:``]},e.id))})]}),k&&(0,f.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`This Team is restricted: the new Agent starts with no allow edges. Add them on the Team policy page.`}),D&&(0,f.jsx)(`p`,{role:`alert`,className:`err mt-2`,children:D}),(0,f.jsx)(`div`,{className:`mt-4`,children:(0,f.jsxs)(a,{children:[(0,f.jsx)(s,{variant:`ghost`,disabled:T,onClick:p,children:`Cancel`}),(0,f.jsx)(s,{variant:`primary`,type:`submit`,disabled:T||!h,children:T?`Spawning…`:`Spawn agent`})]})})]})})}export{p as t};
@@ -1 +1 @@
1
- import{i as e,n as t,t as n}from"./jsx-runtime-bzQ4Vb5N.js";import{n as r,r as i}from"./ConfirmDialog-B5BLql5H.js";import{N as a,_t as o,j as s}from"./index-CKJ3uVR4.js";var c=e(t(),1),l=n();function u({template:e,teams:t,initialTeamId:n=``,onClose:u,onSpawned:d}){let[f,p]=(0,c.useState)(n),[m,h]=(0,c.useState)(``),[g,_]=(0,c.useState)(null),[v,y]=(0,c.useState)(!1),b=f.trim(),x=t.some(e=>e.id===b);async function S(t){t.preventDefault(),y(!0),_(null);try{await s(`/api/team-templates/${encodeURIComponent(e.id)}/spawn`,{body:{teamId:b,...m&&!x?{userMd:m}:{}}}),d(b)}catch(e){_(a(e))}finally{y(!1)}}return(0,l.jsx)(r,{title:`Spawn team: ${e.name}`,description:(0,l.jsxs)(l.Fragment,{children:[`Creates `,e.slots.length,` Agent`,e.slots.length===1?``:`s`,` and`,` `,e.edges.length,` allow edge`,e.edges.length===1?``:`s`,`. An unknown slug creates a new `,e.policyMode,` Team; an existing Team keeps its mode.`]}),busy:v,onClose:u,children:(0,l.jsxs)(`form`,{onSubmit:e=>void S(e),children:[(0,l.jsxs)(`label`,{children:[`Target Team slug`,(0,l.jsx)(`input`,{value:f,onChange:e=>p(e.target.value),list:`spawn-team-targets`,required:!0}),(0,l.jsx)(`datalist`,{id:`spawn-team-targets`,children:t.map(e=>(0,l.jsx)(`option`,{value:e.id,children:e.name},e.id))})]}),!x&&(0,l.jsxs)(`label`,{children:[`Starter USER.md (new Team only; defaults to the template's)`,(0,l.jsx)(`textarea`,{rows:3,value:m,onChange:e=>h(e.target.value),className:`font-mono text-[0.88em] leading-[1.55]`})]}),g&&(0,l.jsx)(`p`,{role:`alert`,className:`err mt-2`,children:g}),(0,l.jsx)(`div`,{className:`mt-4`,children:(0,l.jsxs)(i,{children:[(0,l.jsx)(o,{variant:`ghost`,disabled:v,onClick:u,children:`Cancel`}),(0,l.jsx)(o,{variant:`primary`,type:`submit`,disabled:v||!b||e.slots.length===0,children:v?`Spawning…`:`Spawn team`})]})})]})})}export{u as t};
1
+ import{i as e,n as t,t as n}from"./jsx-runtime-bzQ4Vb5N.js";import{n as r,r as i}from"./ConfirmDialog-536ziJ5P.js";import{N as a,_t as o,j as s}from"./index-1YXquAq8.js";var c=e(t(),1),l=n();function u({template:e,teams:t,initialTeamId:n=``,onClose:u,onSpawned:d}){let[f,p]=(0,c.useState)(n),[m,h]=(0,c.useState)(``),[g,_]=(0,c.useState)(null),[v,y]=(0,c.useState)(!1),b=f.trim(),x=t.some(e=>e.id===b);async function S(t){t.preventDefault(),y(!0),_(null);try{await s(`/api/team-templates/${encodeURIComponent(e.id)}/spawn`,{body:{teamId:b,...m&&!x?{userMd:m}:{}}}),d(b)}catch(e){_(a(e))}finally{y(!1)}}return(0,l.jsx)(r,{title:`Spawn team: ${e.name}`,description:(0,l.jsxs)(l.Fragment,{children:[`Creates `,e.slots.length,` Agent`,e.slots.length===1?``:`s`,` and`,` `,e.edges.length,` allow edge`,e.edges.length===1?``:`s`,`. An unknown slug creates a new `,e.policyMode,` Team; an existing Team keeps its mode.`]}),busy:v,onClose:u,children:(0,l.jsxs)(`form`,{onSubmit:e=>void S(e),children:[(0,l.jsxs)(`label`,{children:[`Target Team slug`,(0,l.jsx)(`input`,{value:f,onChange:e=>p(e.target.value),list:`spawn-team-targets`,required:!0}),(0,l.jsx)(`datalist`,{id:`spawn-team-targets`,children:t.map(e=>(0,l.jsx)(`option`,{value:e.id,children:e.name},e.id))})]}),!x&&(0,l.jsxs)(`label`,{children:[`Starter USER.md (new Team only; defaults to the template's)`,(0,l.jsx)(`textarea`,{rows:3,value:m,onChange:e=>h(e.target.value),className:`font-mono text-[0.88em] leading-[1.55]`})]}),g&&(0,l.jsx)(`p`,{role:`alert`,className:`err mt-2`,children:g}),(0,l.jsx)(`div`,{className:`mt-4`,children:(0,l.jsxs)(i,{children:[(0,l.jsx)(o,{variant:`ghost`,disabled:v,onClick:u,children:`Cancel`}),(0,l.jsx)(o,{variant:`primary`,type:`submit`,disabled:v||!b||e.slots.length===0,children:v?`Spawning…`:`Spawn team`})]})})]})})}export{u as t};
@@ -1 +1 @@
1
- import{i as e,n as t,t as n}from"./jsx-runtime-bzQ4Vb5N.js";import{N as r,_t as i,j as a}from"./index-CKJ3uVR4.js";var o=e(t(),1),s=n();function c({onCreated:e,onBusyChange:t,extraActions:n}){let[c,l]=(0,o.useState)(``),[u,d]=(0,o.useState)(``),[f,p]=(0,o.useState)(``),[m,h]=(0,o.useState)(!1),[g,_]=(0,o.useState)(null);function v(e){h(e),t?.(e)}async function y(t){t.preventDefault(),_(null),v(!0);try{let t=await a(`/api/teams`,{body:{id:c.trim(),name:u.trim()||void 0,link:f.trim()||void 0}});l(``),d(``),p(``),await e(t)}catch(e){_(r(e))}finally{v(!1)}}return(0,s.jsxs)(`form`,{onSubmit:e=>void y(e),children:[(0,s.jsxs)(`div`,{className:`grid gap-x-4 sm:grid-cols-2`,children:[(0,s.jsxs)(`label`,{children:[`ID (slug)`,(0,s.jsx)(`input`,{value:c,onChange:e=>l(e.target.value),required:!0,pattern:`[a-z0-9][a-z0-9\\-]*`,placeholder:`my-project`})]}),(0,s.jsxs)(`label`,{children:[`Name (optional)`,(0,s.jsx)(`input`,{value:u,onChange:e=>d(e.target.value),placeholder:`My project`})]}),(0,s.jsxs)(`label`,{className:`sm:col-span-2`,children:[`Link target (optional, absolute path)`,(0,s.jsx)(`input`,{value:f,onChange:e=>p(e.target.value),placeholder:`/home/you/projects/my-project`}),(0,s.jsxs)(`span`,{className:`mt-1 block text-xs text-muted-foreground`,children:[`Leave blank for a fresh directory under `,(0,s.jsx)(`code`,{children:`~/.bazilion/teams/<slug>/`}),`. Give a path to link the Team to an existing project tree.`]})]})]}),g&&(0,s.jsx)(`p`,{role:`alert`,className:`err mt-2`,children:g}),(0,s.jsxs)(`div`,{className:`mt-4 flex flex-wrap justify-end gap-2`,children:[n?.(m),(0,s.jsx)(i,{variant:`primary`,type:`submit`,disabled:m||!c.trim(),children:m?`Creating…`:`Create team`})]})]})}export{c as t};
1
+ import{i as e,n as t,t as n}from"./jsx-runtime-bzQ4Vb5N.js";import{N as r,_t as i,j as a}from"./index-1YXquAq8.js";var o=e(t(),1),s=n();function c({onCreated:e,onBusyChange:t,extraActions:n}){let[c,l]=(0,o.useState)(``),[u,d]=(0,o.useState)(``),[f,p]=(0,o.useState)(``),[m,h]=(0,o.useState)(!1),[g,_]=(0,o.useState)(null);function v(e){h(e),t?.(e)}async function y(t){t.preventDefault(),_(null),v(!0);try{let t=await a(`/api/teams`,{body:{id:c.trim(),name:u.trim()||void 0,link:f.trim()||void 0}});l(``),d(``),p(``),await e(t)}catch(e){_(r(e))}finally{v(!1)}}return(0,s.jsxs)(`form`,{onSubmit:e=>void y(e),children:[(0,s.jsxs)(`div`,{className:`grid gap-x-4 sm:grid-cols-2`,children:[(0,s.jsxs)(`label`,{children:[`ID (slug)`,(0,s.jsx)(`input`,{value:c,onChange:e=>l(e.target.value),required:!0,pattern:`[a-z0-9][a-z0-9\\-]*`,placeholder:`my-project`})]}),(0,s.jsxs)(`label`,{children:[`Name (optional)`,(0,s.jsx)(`input`,{value:u,onChange:e=>d(e.target.value),placeholder:`My project`})]}),(0,s.jsxs)(`label`,{className:`sm:col-span-2`,children:[`Link target (optional, absolute path)`,(0,s.jsx)(`input`,{value:f,onChange:e=>p(e.target.value),placeholder:`/home/you/projects/my-project`}),(0,s.jsxs)(`span`,{className:`mt-1 block text-xs text-muted-foreground`,children:[`Leave blank for a fresh directory under `,(0,s.jsx)(`code`,{children:`~/.bazilion/teams/<slug>/`}),`. Give a path to link the Team to an existing project tree.`]})]})]}),g&&(0,s.jsx)(`p`,{role:`alert`,className:`err mt-2`,children:g}),(0,s.jsxs)(`div`,{className:`mt-4 flex flex-wrap justify-end gap-2`,children:[n?.(m),(0,s.jsx)(i,{variant:`primary`,type:`submit`,disabled:m||!c.trim(),children:m?`Creating…`:`Create team`})]})]})}export{c as t};