bazilion 0.12.2 → 0.14.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.
- package/README.md +2 -2
- package/dist/cli.js +795 -240
- package/dist/cli.js.map +1 -1
- package/dist/daemon.js +4555 -1280
- package/dist/daemon.js.map +1 -1
- package/dist/migrations/0001_init.sql +21 -0
- package/dist/web/client/assets/AgentTabs-BcmmwYJc.js +1 -0
- package/dist/web/client/assets/ConfigPage-BCLp-FUC.js +1 -0
- package/dist/web/client/assets/ConfirmDialog-CyL9A20V.js +1 -0
- package/dist/web/client/assets/FieldRow-D6REbYUa.js +1 -0
- package/dist/web/client/assets/Page-NV96O47A.js +1 -0
- package/dist/web/client/assets/ProductionTeamPolicyEditor-DBKnOezm.js +7 -0
- package/dist/web/client/assets/{ProfileCommunicationEditor-C43HvUe-.js → ProfileCommunicationEditor-4RK2laqO.js} +1 -1
- package/dist/web/client/assets/SectionTabs-4kCQXuFY.js +1 -0
- package/dist/web/client/assets/TeamTabs-CdtNEqt4.js +1 -0
- package/dist/web/client/assets/{TemplatesTabs-6Jd_xQj7.js → TemplatesTabs-CZyss2Y0.js} +1 -1
- package/dist/web/client/assets/UnsavedChangesGuard-CEoK-ZcN.js +1 -0
- package/dist/web/client/assets/_id-4ZS-w_Aj.js +1 -0
- package/dist/web/client/assets/{_id-AOAT0H_5.js → _id-DIqtdQij.js} +1 -1
- package/dist/web/client/assets/_id-DbcC2E7F.js +1 -0
- package/dist/web/client/assets/_id-f_r5M0p3.js +1 -0
- package/dist/web/client/assets/activity-CB9Ufth-.js +1 -0
- package/dist/web/client/assets/agents-D-JGXVg9.js +1 -0
- package/dist/web/client/assets/agents-DS2XafoA.js +1 -0
- package/dist/web/client/assets/approvals-Cke_mrJv.js +1 -0
- package/dist/web/client/assets/attention-PYwRM2wC.js +1 -0
- package/dist/web/client/assets/chevron-right-BG4OeFRQ.js +1 -0
- package/dist/web/client/assets/config-DF9Gqmfa.js +3 -0
- package/dist/web/client/assets/dm-sans-latin-400-normal-BwCSEQnW.woff +0 -0
- package/dist/web/client/assets/dm-sans-latin-400-normal-CW0RaeGs.woff2 +0 -0
- package/dist/web/client/assets/dm-sans-latin-500-normal-B9HHJjqV.woff2 +0 -0
- package/dist/web/client/assets/dm-sans-latin-500-normal-Dr3UlScf.woff +0 -0
- package/dist/web/client/assets/dm-sans-latin-600-normal-Aqo67rzb.woff2 +0 -0
- package/dist/web/client/assets/dm-sans-latin-600-normal-BmdmIIQ2.woff +0 -0
- package/dist/web/client/assets/dm-sans-latin-700-normal-CUSSCpQX.woff +0 -0
- package/dist/web/client/assets/dm-sans-latin-700-normal-DvUfVpUG.woff2 +0 -0
- package/dist/web/client/assets/dm-serif-display-latin-400-normal-C5_t9oOD.woff2 +0 -0
- package/dist/web/client/assets/dm-serif-display-latin-400-normal-_kVFYEpx.woff +0 -0
- package/dist/web/client/assets/{inbox-Bn1GbUsJ.js → inbox-DC_HdOfI.js} +1 -1
- package/dist/web/client/assets/index-Cofc7zhl.css +1 -0
- package/dist/web/client/assets/index-Cp6UHWr2.js +52 -0
- package/dist/web/client/assets/jetbrains-mono-latin-400-normal-6-qcROiO.woff +0 -0
- package/dist/web/client/assets/jetbrains-mono-latin-400-normal-V6pRDFza.woff2 +0 -0
- package/dist/web/client/assets/jetbrains-mono-latin-500-normal-BWZEU5yA.woff2 +0 -0
- package/dist/web/client/assets/jetbrains-mono-latin-500-normal-CJOVTJB7.woff +0 -0
- package/dist/web/client/assets/learning-BfrQ4YZY.js +1 -0
- package/dist/web/client/assets/login-D4n3AcBR.js +1 -0
- package/dist/web/client/assets/mcp-CnjQc_JJ.js +1 -0
- package/dist/web/client/assets/members-wxsVTJdW.js +1 -0
- package/dist/web/client/assets/memory-Du60O3pE.js +1 -0
- package/dist/web/client/assets/{policy-DaijITy7.js → policy-BOfnkJsL.js} +1 -1
- package/dist/web/client/assets/{preload-helper-mNuBjNXU.js → preload-helper-bztXdkDj.js} +1 -1
- package/dist/web/client/assets/routes-B9CuhzUW.js +1 -0
- package/dist/web/client/assets/services-DyvqJqM2.js +1 -0
- package/dist/web/client/assets/skills-DQo7ioW7.js +1 -0
- package/dist/web/client/assets/styles-B5vcgXln.css +2 -0
- package/dist/web/client/assets/{teams-D92R9Pb7.js → teams-DPggy97H.js} +1 -1
- package/dist/web/client/assets/teams-DdawcfNR.js +1 -0
- package/dist/web/client/assets/telegram-DcTeDpP5.js +1 -0
- package/dist/web/client/assets/tokens-CIEKwZXc.js +1 -0
- package/dist/web/client/assets/triggers-Bc2RrUPm.js +1 -0
- package/dist/web/client/assets/utils-B6KiDbIe.js +1 -0
- package/dist/web/client/assets/welcome-DlhNXUIa.js +1 -0
- package/dist/web/client/assets/wire-constants-BzdHSc6A.js +74 -0
- package/dist/web/client/assets/x-DAXGIe_Q.js +1 -0
- package/dist/web/server/assets/{AgentTabs-aXdsiiMp.js → AgentTabs-Dq8hDM2Q.js} +9 -2
- package/dist/web/server/assets/{ChatPane-Ba5wTsVk.js → ChatPane-CgSe7tsy.js} +81 -43
- package/dist/web/server/assets/{ConfigPage-BKlh5vOU.js → ConfigPage-CiQ-gxmJ.js} +3 -2
- package/dist/web/server/assets/ConfirmDialog-C-MPYYSU.js +99 -0
- package/dist/web/server/assets/FieldRow-DCOF07kl.js +160 -0
- package/dist/web/server/assets/{Page-LENulSXY.js → Page-Bz-ydB8j.js} +4 -10
- package/dist/web/server/assets/{ProductionTeamPolicyEditor-Y4mzFFvR.js → ProductionTeamPolicyEditor-DQSdP7Yx.js} +140 -123
- package/dist/web/server/assets/{SectionTabs-BJTPr5nU.js → SectionTabs-B2Yw81XN.js} +2 -2
- package/dist/web/server/assets/{Sidebar-DsRVCszF.js → Sidebar-DKyk7oIo.js} +563 -283
- package/dist/web/server/assets/{TeamTabs-zZzbP1t_.js → TeamTabs-Co3n2exj.js} +2 -6
- package/dist/web/server/assets/{TemplatesTabs-CcRxZhJe.js → TemplatesTabs-B0fA361R.js} +1 -1
- package/dist/web/server/assets/UnsavedChangesGuard-CiStXyBI.js +40 -0
- package/dist/web/server/assets/{_id-Dj1yZ3zJ.js → _id-BAA9KJBU.js} +4 -4
- package/dist/web/server/assets/{_id-LrvXU4Nr.js → _id-BM5m2FLT.js} +4 -4
- package/dist/web/server/assets/{_id-CwyGjJeP.js → _id-BYKpT2Tu.js} +4 -5
- package/dist/web/server/assets/{_id-BHYLL8M-.js → _id-BeKhPKw3.js} +350 -185
- package/dist/web/server/assets/{_id-C3HY4lWg.js → _id-BqWTB8Wl.js} +188 -86
- package/dist/web/server/assets/{_id-DinTp_7X.js → _id-BwvCtzlD.js} +3 -3
- package/dist/web/server/assets/{_id-D27T85mU.js → _id-DYU6uIBx.js} +4 -5
- package/dist/web/server/assets/{_id-IzadFZV9.js → _id-DvlDkk04.js} +4 -4
- package/dist/web/server/assets/{_id-BhOB8Umi.js → _id-DxCnEFpm.js} +4 -4
- package/dist/web/server/assets/{_id-tB47Vsfp.js → _id-HMy7jM3P.js} +3 -3
- package/dist/web/server/assets/{_id-D3Ap7zZA.js → _id-ndxFHx0t.js} +75 -71
- package/dist/web/server/assets/{_id-FcHdSocl.js → _id-sNu5aXZt.js} +5 -4
- package/dist/web/server/assets/{_tanstack-start-manifest_v-BGDBdnUs.js → _tanstack-start-manifest_v-C-OiOZeM.js} +118 -94
- package/dist/web/server/assets/{activity-DohitgwW.js → activity-9VP6QDTH.js} +3 -3
- package/dist/web/server/assets/{activity-BCI4mfNS.js → activity-BWv1goK6.js} +3 -3
- package/dist/web/server/assets/{activity-D9SMqBhy.js → activity-LjpblbDL.js} +3 -3
- package/dist/web/server/assets/{agents-C9xlWK0Z.js → agents-BDFGrU3o.js} +4 -4
- package/dist/web/server/assets/{agents-BY74v7fM.js → agents-BJAv919x.js} +3 -3
- package/dist/web/server/assets/{agents-BvttypqB.js → agents-CJk4pxKu.js} +3 -3
- package/dist/web/server/assets/{agents-CgZMHj80.js → agents-CYw1xHoY.js} +138 -16
- package/dist/web/server/assets/{agents-DZuFEj0D.js → agents-DfNKc_Q7.js} +52 -8
- package/dist/web/server/assets/{agents-BPKOshR5.js → agents-DjyQk94u.js} +4 -4
- package/dist/web/server/assets/{approvals-CWcFHlor.js → approvals-7JOoBchn.js} +3 -3
- package/dist/web/server/assets/{approvals-BGU-XGIO.js → approvals-BYi84gwl.js} +3 -3
- package/dist/web/server/assets/{approvals-DCaVw1Mz.js → approvals-Bz123liE.js} +59 -21
- package/dist/web/server/assets/{attention-BxkTf337.js → attention-B35JvhOL.js} +3 -3
- package/dist/web/server/assets/{attention-w21GQIGH.js → attention-C1pPWSXw.js} +3 -3
- package/dist/web/server/assets/{attention-CM-Ks1N9.js → attention-UhqPK_Ro.js} +3 -3
- package/dist/web/server/assets/{auth-byfSx6Ja.js → auth-7BHTH-KS.js} +5 -5
- package/dist/web/server/assets/{config-BDCJdtj2.js → config-BMiajTZP.js} +10 -5
- package/dist/web/server/assets/{config-1w2GiJUn.js → config-BlMkHStx.js} +3 -3
- package/dist/web/server/assets/config-ExacOzHX.js +958 -0
- package/dist/web/server/assets/{createServerRpc-pU-IQV2Y.js → createServerRpc-B7Yr1K8i.js} +1 -1
- package/dist/web/server/assets/{createSsrRpc-DFsIAfFd.js → createSsrRpc-6LHNEsSK.js} +1 -1
- package/dist/web/server/assets/{daemon-client-2NRMzlTr.js → daemon-client-CI5NHwNC.js} +16 -4
- package/dist/web/server/assets/{inbox-CzlKT9Wg.js → inbox-Dv55rGYq.js} +4 -4
- package/dist/web/server/assets/{inbox-BLUzA5sQ.js → inbox-RweGCV3D.js} +3 -3
- package/dist/web/server/assets/{inbox-ZvDNAjaM.js → inbox-cu3jLzNP.js} +4 -4
- package/dist/web/server/assets/{learning-B7PBkvER.js → learning-BaKM6qaw.js} +4 -4
- package/dist/web/server/assets/{learning-8zav4pIT.js → learning-C2upa1CE.js} +4 -4
- package/dist/web/server/assets/{learning-Cq7K2heb.js → learning-CbtNlqYo.js} +76 -23
- package/dist/web/server/assets/{login-CmWvxfTK.js → login-BNj3U6ok.js} +22 -12
- package/dist/web/server/assets/{login-Bx5LEyGP.js → login-Be8eP4Jp.js} +2 -2
- package/dist/web/server/assets/{mcp-DIWTogHM.js → mcp-B0goWO8Q.js} +3 -3
- package/dist/web/server/assets/{mcp-2pwT9HU8.js → mcp-BvnvlVFd.js} +3 -3
- package/dist/web/server/assets/mcp-CiBs8unU.js +332 -0
- package/dist/web/server/assets/members-BP3UTqu1.js +12 -0
- package/dist/web/server/assets/members-DHYTVgwb.js +100 -0
- package/dist/web/server/assets/members-DiYtr-zm.js +12 -0
- package/dist/web/server/assets/{memory-Dngc13Nw.js → memory-BqV-Afy1.js} +4 -4
- package/dist/web/server/assets/{memory-a8Kz57Kh.js → memory-CkXUgf5s.js} +150 -48
- package/dist/web/server/assets/{memory-pZ4pZT7p.js → memory-DTFEmfF3.js} +4 -4
- package/dist/web/server/assets/{policy-Bb-vEgqg.js → policy-18fdTFO4.js} +3 -3
- package/dist/web/server/assets/{policy-C30AeFIb.js → policy-BddK4xom.js} +3 -3
- package/dist/web/server/assets/{policy-BcGELcc9.js → policy-Bvvav8fh.js} +4 -4
- package/dist/web/server/assets/public-origin-xV0lm0Ty.js +25 -0
- package/dist/web/server/assets/router-pjH2t8Rl.js +813 -0
- package/dist/web/server/assets/{routes-B6cMLIPk.js → routes-BgHisAxH.js} +22 -5
- package/dist/web/server/assets/{routes-BrA-U_Hm.js → routes-COtkyZG1.js} +5 -5
- package/dist/web/server/assets/{routes-C19CMLZt.js → routes-DAU2g7Uz.js} +4 -4
- package/dist/web/server/assets/services-ClyGBU7W.js +83 -0
- package/dist/web/server/assets/{services-C4szdhPx.js → services-DgoU1udp.js} +3 -3
- package/dist/web/server/assets/{services-wG8I06oS.js → services-DozuJtzX.js} +3 -3
- package/dist/web/server/assets/{skills-BZdqiDig.js → skills-CYih9TJw.js} +47 -6
- package/dist/web/server/assets/{skills-a9VSWHWq.js → skills-DfGSJTCB.js} +3 -3
- package/dist/web/server/assets/{skills-C-UgkuCW.js → skills-Dw3cI3si.js} +3 -3
- package/dist/web/server/assets/start-D4Wq9iTa.js +70 -0
- package/dist/web/server/assets/{teams-OIkHuxy1.js → teams-BJuoNOTB.js} +3 -3
- package/dist/web/server/assets/{teams-CpQ0YgWf.js → teams-DF3RViAg.js} +3 -3
- package/dist/web/server/assets/{teams-DEpQR2QA.js → teams-DFnuc660.js} +3 -3
- package/dist/web/server/assets/{teams-DqfrEoH6.js → teams-DPnAX4wD.js} +4 -4
- package/dist/web/server/assets/{teams-jBtvnk59.js → teams-TV6nbEN_.js} +101 -10
- package/dist/web/server/assets/{teams-MjqgsmC3.js → teams-be05ci17.js} +3 -3
- package/dist/web/server/assets/{telegram-DNgCWebD.js → telegram-1AWL6lFw.js} +3 -3
- package/dist/web/server/assets/{telegram-XwyKSEtj.js → telegram-DbOFpTFm.js} +3 -3
- package/dist/web/server/assets/{telegram-CBF8SJzB.js → telegram-Dj4Wwhd6.js} +262 -43
- package/dist/web/server/assets/tokens-DDwtO15P.js +359 -0
- package/dist/web/server/assets/tokens-DjM8GsgS.js +19 -0
- package/dist/web/server/assets/{tokens-BnwFbV7T.js → tokens-_2hptHP6.js} +4 -4
- package/dist/web/server/assets/{triggers-BZPl5CHs.js → triggers-BvjYNmmY.js} +4 -4
- package/dist/web/server/assets/triggers-CHk9O3rU.js +367 -0
- package/dist/web/server/assets/{triggers-D79NoSXk.js → triggers-Nezfw-Bd.js} +4 -4
- package/dist/web/server/assets/utils-C_uf36nf.js +8 -0
- package/dist/web/server/assets/{welcome-DDB11L5j.js → welcome-B8nchXdF.js} +9 -8
- package/dist/web/server/server.js +29 -33
- package/dist/web-server.js +4 -0
- package/dist/web-server.js.map +1 -1
- package/dist/worker.js +1744 -362
- package/dist/worker.js.map +1 -1
- package/package.json +7 -6
- package/dist/web/client/assets/AgentTabs-R6gSjIj3.js +0 -1
- package/dist/web/client/assets/ConfigPage-BCwfgyjD.js +0 -1
- package/dist/web/client/assets/FieldRow-avAFLgYW.js +0 -1
- package/dist/web/client/assets/Page-CwNuDhWz.js +0 -1
- package/dist/web/client/assets/ProductionTeamPolicyEditor-CsWpTsy6.js +0 -7
- package/dist/web/client/assets/SectionTabs-DZzy01az.js +0 -1
- package/dist/web/client/assets/TeamTabs-DvqWieCq.js +0 -1
- package/dist/web/client/assets/_id-BUuz7Drv.js +0 -1
- package/dist/web/client/assets/_id-BegmVRmT.js +0 -1
- package/dist/web/client/assets/_id-BrA4Crh_.js +0 -1
- package/dist/web/client/assets/activity-n0Fw9_w3.js +0 -1
- package/dist/web/client/assets/agents-B33VQtbl.js +0 -1
- package/dist/web/client/assets/agents-C50pdxp7.js +0 -1
- package/dist/web/client/assets/approvals-DVW0hX8h.js +0 -1
- package/dist/web/client/assets/attention-B2490jcN.js +0 -1
- package/dist/web/client/assets/chevron-down-B0aNNOyn.js +0 -1
- package/dist/web/client/assets/config-CMMxxeX2.js +0 -3
- package/dist/web/client/assets/context-DcFzsfZ3.js +0 -1
- package/dist/web/client/assets/index-3nrK5iFr.js +0 -12
- package/dist/web/client/assets/learning-BUX1MFu2.js +0 -1
- package/dist/web/client/assets/login-CMWpGDKv.js +0 -1
- package/dist/web/client/assets/mcp-lZV08dqc.js +0 -1
- package/dist/web/client/assets/members-DAeaY2Cy.js +0 -1
- package/dist/web/client/assets/memory-HmMWxxdF.js +0 -1
- package/dist/web/client/assets/plus-CPzRJg1V.js +0 -1
- package/dist/web/client/assets/routes-BNk270AM.js +0 -1
- package/dist/web/client/assets/services-DtrpJrdo.js +0 -1
- package/dist/web/client/assets/skills-Cv93A3P3.js +0 -1
- package/dist/web/client/assets/styles-DMltY3su.css +0 -2
- package/dist/web/client/assets/teams-CCFnSNKi.js +0 -1
- package/dist/web/client/assets/telegram-BF1vdgDB.js +0 -1
- package/dist/web/client/assets/tokens-BXj6hWW-.js +0 -1
- package/dist/web/client/assets/triggers-NT24i4hZ.js +0 -1
- package/dist/web/client/assets/welcome-D0cy68eZ.js +0 -1
- package/dist/web/client/assets/wire-constants-BhVKOCQa.js +0 -74
- package/dist/web/server/assets/FieldRow-B4eTegH9.js +0 -94
- package/dist/web/server/assets/config-BmixCpz-.js +0 -372
- package/dist/web/server/assets/context-B-XDf6Ym.js +0 -12
- package/dist/web/server/assets/context-BXGo5Vfi.js +0 -12
- package/dist/web/server/assets/context-DrkrIWun.js +0 -47
- package/dist/web/server/assets/mcp-BJjLIdP0.js +0 -261
- package/dist/web/server/assets/members-CCv17cjQ.js +0 -46
- package/dist/web/server/assets/members-CW5aBe81.js +0 -12
- package/dist/web/server/assets/members-VdPwD6CE.js +0 -12
- package/dist/web/server/assets/router-CIVjTgNp.js +0 -537
- package/dist/web/server/assets/services-B9yBWDX0.js +0 -79
- package/dist/web/server/assets/start-WH8WzTL_.js +0 -4
- package/dist/web/server/assets/tokens-DPDMSN5O.js +0 -12
- package/dist/web/server/assets/tokens-yyTSfBSN.js +0 -186
- package/dist/web/server/assets/triggers-CSNNzRIi.js +0 -216
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as e,t}from"./jsx-runtime-DGeXAQPT.js";import{t as n}from"./react-3W8R1pOO.js";import{d as r}from"./preload-helper-bztXdkDj.js";import{t as i}from"./ConfirmDialog-CyL9A20V.js";import{i as a}from"./index-Cp6UHWr2.js";import{r as o}from"./Page-NV96O47A.js";import{t as s}from"./AgentTabs-BcmmwYJc.js";import{t as c}from"./Button-ByiV6fpd.js";var l=e(n()),u=t();function d(){let{resolved:e,config:t,reviews:n,proposals:i}=a.useLoaderData(),d=r(),[m,h]=(0,l.useState)(null),[g,_]=(0,l.useState)(!1);async function v(e,t,n,r=!1){h(null),_(!0);try{let r=await fetch(e,{method:t,headers:n===void 0?void 0:{"content-type":`application/json`},body:n===void 0?void 0:JSON.stringify(n)});if(!r.ok){let e=await r.json().catch(()=>null);throw Error(e?.error??`request failed (${r.status})`)}await d.invalidate()}catch(e){let t=e instanceof Error?e:Error(String(e));if(h(t.message),r)throw t}finally{_(!1)}}let y=encodeURIComponent(e.agent.id);return(0,u.jsxs)(o,{children:[(0,u.jsx)(`header`,{className:`mb-6`,children:(0,u.jsx)(`h1`,{children:e.agent.name})}),(0,u.jsx)(s,{agentId:e.agent.id,active:`learning`,archived:e.agent.status===`archived`}),m&&(0,u.jsxs)(`p`,{role:`alert`,className:`mb-4 rounded border border-red-300 bg-red-50 p-3 text-sm text-red-800`,children:[m,`. Refresh before retrying if another operator changed this proposal.`]}),(0,u.jsxs)(`section`,{className:`mb-8 rounded-lg border bg-card p-5`,children:[(0,u.jsx)(`h2`,{className:`mb-2 text-xl`,children:`Reviewed learning`}),(0,u.jsxs)(`p`,{className:`mb-4 text-sm text-muted-foreground`,children:[`Reviews inspect at most 8 successful user turns and 40,000 characters. They use`,` `,t.model??`the Agent model`,` at `,t.reasoningLevel,` reasoning, propose at most five lessons, and never apply anything without your approval.`]}),(0,u.jsx)(f,{agentId:e.agent.id,config:t,disabled:g,onError:h,onSaved:()=>d.invalidate()}),(0,u.jsxs)(`div`,{className:`mt-4 flex items-center gap-3`,children:[(0,u.jsx)(c,{variant:`primary`,disabled:g||e.agent.status===`archived`,onClick:()=>v(`/api/agents/${y}/reviews`,`POST`),children:`Review now`}),!t.enabled&&(0,u.jsx)(`span`,{className:`text-sm text-muted-foreground`,children:`Periodic review is disabled; manual review remains available.`})]})]}),(0,u.jsx)(`h2`,{className:`mb-3 text-xl`,children:`Lesson proposals`}),i.length===0?(0,u.jsx)(`p`,{className:`mb-8 text-muted-foreground`,children:`No proposals yet. A successful review may also produce zero proposals.`}):(0,u.jsx)(`div`,{className:`mb-8 grid gap-3`,children:i.map(t=>(0,u.jsx)(p,{proposal:t,agentId:e.agent.id,busy:g,act:v},t.id))}),(0,u.jsx)(`h2`,{className:`mb-3 text-xl`,children:`Review history`}),n.length===0?(0,u.jsx)(`p`,{className:`text-muted-foreground`,children:`No reviews have been queued.`}):(0,u.jsx)(`div`,{className:`overflow-x-auto`,children:(0,u.jsxs)(`table`,{children:[(0,u.jsx)(`thead`,{children:(0,u.jsxs)(`tr`,{children:[(0,u.jsx)(`th`,{children:`created`}),(0,u.jsx)(`th`,{children:`trigger`}),(0,u.jsx)(`th`,{children:`status`}),(0,u.jsx)(`th`,{children:`turns`}),(0,u.jsx)(`th`,{children:`proposals`}),(0,u.jsx)(`th`,{children:`diagnostic`})]})}),(0,u.jsx)(`tbody`,{children:n.map(e=>(0,u.jsxs)(`tr`,{children:[(0,u.jsx)(`td`,{children:new Date(e.createdAt).toLocaleString()}),(0,u.jsx)(`td`,{children:e.trigger}),(0,u.jsx)(`td`,{children:(0,u.jsx)(`code`,{children:e.status})}),(0,u.jsx)(`td`,{children:e.turnsReviewed}),(0,u.jsx)(`td`,{children:e.proposalCount}),(0,u.jsx)(`td`,{children:e.lastError??`—`})]},e.id))})]})})]})}function f({agentId:e,config:t,disabled:n,onError:r,onSaved:i}){let[a,o]=(0,l.useState)(t.enabled),[s,d]=(0,l.useState)(t.everyNTurns),[f,p]=(0,l.useState)(t.model??``),[m,h]=(0,l.useState)(t.reasoningLevel);async function g(t){t.preventDefault(),r(null);let n=await fetch(`/api/agents/${encodeURIComponent(e)}/review-config`,{method:`PATCH`,headers:{"content-type":`application/json`},body:JSON.stringify({enabled:a,everyNTurns:s,model:f.trim()||null,reasoningLevel:m})});if(!n.ok){r((await n.json().catch(()=>null))?.error??`request failed (${n.status})`);return}i()}return(0,u.jsxs)(`form`,{onSubmit:g,className:`grid gap-3 md:grid-cols-4`,children:[(0,u.jsxs)(`label`,{className:`text-sm`,children:[(0,u.jsx)(`span`,{className:`mb-1 block`,children:`Periodic review`}),(0,u.jsx)(`input`,{type:`checkbox`,checked:a,onChange:e=>o(e.target.checked)}),` `,`enabled`]}),(0,u.jsxs)(`label`,{className:`text-sm`,children:[(0,u.jsx)(`span`,{className:`mb-1 block`,children:`Every turns`}),(0,u.jsx)(`input`,{type:`number`,min:1,max:100,value:s,onChange:e=>d(Number(e.target.value))})]}),(0,u.jsxs)(`label`,{className:`text-sm`,children:[(0,u.jsx)(`span`,{className:`mb-1 block`,children:`Model override`}),(0,u.jsx)(`input`,{value:f,placeholder:`agent model`,onChange:e=>p(e.target.value)})]}),(0,u.jsxs)(`label`,{className:`text-sm`,children:[(0,u.jsx)(`span`,{className:`mb-1 block`,children:`Reasoning`}),(0,u.jsxs)(`select`,{value:m,onChange:e=>h(e.target.value),children:[(0,u.jsx)(`option`,{children:`off`}),(0,u.jsx)(`option`,{children:`minimal`}),(0,u.jsx)(`option`,{children:`low`}),(0,u.jsx)(`option`,{children:`medium`}),(0,u.jsx)(`option`,{children:`high`}),(0,u.jsx)(`option`,{children:`xhigh`})]})]}),(0,u.jsx)(`div`,{children:(0,u.jsx)(c,{variant:`primary`,type:`submit`,disabled:n,children:`Save learning settings`})})]})}function p({proposal:e,agentId:t,busy:n,act:r}){let[a,o]=(0,l.useState)(e.text),[s,d]=(0,l.useState)(e.scope),[f,p]=(0,l.useState)(null),m=`/api/agents/${encodeURIComponent(t)}/lesson-proposals/${encodeURIComponent(e.id)}`,h=`lesson-proposal-${e.id}-text`,g=`lesson-proposal-${e.id}-scope`,_=e.text.length>54?`${e.text.slice(0,51)}…`:e.text,v=f===`reject`?{title:`Reject “${_}”?`,confirmLabel:`Reject proposal`,description:(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)(`p`,{children:`This permanently marks the saved proposal as rejected. It will never change the Agent’s prompts or Team memory, while its text and evidence remain in review history for audit.`}),(0,u.jsx)(`p`,{className:`mt-2`,children:`Any edits not saved first will be discarded. A rejected proposal cannot be edited or approved later.`})]})}:{title:`Revoke “${_}”?`,confirmLabel:`Revoke lesson`,description:e.scope===`shared`?(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)(`p`,{children:`This removes the applied lesson note from Team memory, so it will no longer appear in Team-memory search.`}),(0,u.jsx)(`p`,{className:`mt-2`,children:`The proposal and its original approval remain in review history for audit. This cannot be undone here.`})]}):(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)(`p`,{children:`This removes the approved lesson from the Agent’s future prompts. It does not rewrite past conversations.`}),(0,u.jsx)(`p`,{className:`mt-2`,children:`The proposal and its original approval remain in review history for audit. This cannot be undone here.`})]})};return(0,u.jsxs)(`article`,{className:`rounded-lg border bg-card p-4`,children:[(0,u.jsxs)(`div`,{className:`mb-2 flex justify-between gap-2`,children:[(0,u.jsx)(`code`,{children:e.status}),(0,u.jsxs)(`span`,{className:`text-xs text-muted-foreground`,children:[`v`,e.version]})]}),e.status===`pending`?(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)(`label`,{htmlFor:h,className:`mb-1 block text-sm font-medium`,children:`Proposed lesson`}),(0,u.jsx)(`textarea`,{id:h,className:`w-full`,rows:3,value:a,onChange:e=>o(e.target.value)}),(0,u.jsx)(`label`,{htmlFor:g,className:`mb-1 mt-3 block text-sm font-medium`,children:`Apply approved lesson to`}),(0,u.jsxs)(`select`,{id:g,value:s,onChange:e=>d(e.target.value),children:[(0,u.jsx)(`option`,{value:`private`,children:`private Agent behavior`}),(0,u.jsx)(`option`,{value:`shared`,children:`shared Team knowledge`})]}),(0,u.jsxs)(`div`,{className:`mt-3 flex flex-wrap gap-2`,children:[(0,u.jsx)(c,{variant:`ghost`,disabled:n,onClick:()=>r(m,`PATCH`,{version:e.version,text:a,scope:s}),children:`Save edit`}),(0,u.jsx)(c,{variant:`primary`,disabled:n,onClick:()=>r(`${m}/approve`,`POST`,{version:e.version}),children:`Approve`}),(0,u.jsx)(c,{variant:`danger`,disabled:n,onClick:()=>p(`reject`),children:`Reject`})]})]}):(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)(`p`,{children:e.text}),e.status===`approved`&&(0,u.jsx)(`div`,{className:`mt-3`,children:(0,u.jsx)(c,{variant:`danger`,disabled:n,onClick:()=>p(`revoke`),children:`Revoke`})})]}),(0,u.jsxs)(`div`,{className:`mt-3 text-xs text-muted-foreground`,children:[`Evidence:`,` `,e.evidence.length===0?`none`:(0,u.jsx)(`ul`,{className:`mt-1 list-disc pl-5`,children:e.evidence.map(e=>(0,u.jsxs)(`li`,{children:[(0,u.jsxs)(`code`,{children:[e.sessionId,`:`,e.entryOrdinal]}),e.excerpt?` — ${e.excerpt}`:` — excerpt unavailable`]},`${e.sessionId}:${e.entryOrdinal}`))})]}),e.status===`pending`&&s===`shared`&&(0,u.jsx)(`p`,{className:`mt-1 text-xs text-muted-foreground`,children:`Shared lessons become searchable Team memory. Stable facts about the human belong in Team USER.md instead.`}),f&&(0,u.jsx)(i,{open:!0,title:v.title,description:v.description,confirmLabel:v.confirmLabel,onOpenChange:e=>{e||p(null)},onConfirm:()=>r(`${m}/${f}`,`POST`,{version:e.version},!0)})]})}export{d as component};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{t as e}from"./jsx-runtime-DGeXAQPT.js";import{E as t,J as n,T as r,U as i,Y as a,q as o}from"./index-Cp6UHWr2.js";var s=o(`key-round`,[[`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`}]]),c=o(`message-square-text`,[[`path`,{d:`M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z`,key:`18887p`}],[`path`,{d:`M7 11h10`,key:`1twpyw`}],[`path`,{d:`M7 15h6`,key:`d9of3u`}],[`path`,{d:`M7 7h8`,key:`af5zfr`}]]),l=e();function u(){let{error:e}=r.useSearch();return(0,l.jsxs)(`main`,{className:`relative flex min-h-dvh items-center overflow-hidden bg-cream px-5 py-16 sm:px-8`,children:[(0,l.jsx)(`div`,{"aria-hidden":`true`,className:`pointer-events-none absolute inset-0`,style:{background:`radial-gradient(circle at 16% 12%, rgba(61,120,153,0.18), transparent 36rem), radial-gradient(circle at 88% 84%, rgba(196,135,138,0.13), transparent 32rem)`}}),(0,l.jsx)(`div`,{className:`absolute right-4 top-4 z-10 sm:right-6 sm:top-6`,children:(0,l.jsx)(t,{})}),(0,l.jsxs)(`div`,{className:`relative mx-auto grid w-full max-w-5xl items-center gap-10 lg:grid-cols-[minmax(0,1fr)_25rem] lg:gap-20`,children:[(0,l.jsxs)(`section`,{className:`hidden lg:block`,children:[(0,l.jsxs)(`div`,{className:`mb-8 flex items-center gap-3`,children:[(0,l.jsx)(a,{className:`h-12 w-12`}),(0,l.jsx)(`span`,{className:`font-display text-3xl tracking-[-0.03em] text-charcoal`,children:`bazilion`})]}),(0,l.jsx)(`h1`,{className:`max-w-xl text-[3.4rem] leading-[0.98] tracking-[-0.035em]`,children:`Your agents, working as one thoughtful team.`}),(0,l.jsx)(`p`,{className:`mt-6 max-w-lg text-base leading-7 text-mocha`,children:`A private workspace for long-lived agents, shared context, and communication policies you can actually see and control.`}),(0,l.jsxs)(`div`,{className:`mt-8 grid max-w-lg gap-3 sm:grid-cols-2`,children:[(0,l.jsx)(d,{icon:(0,l.jsx)(c,{className:`h-4 w-4`}),label:`Persistent conversations`}),(0,l.jsx)(d,{icon:(0,l.jsx)(i,{className:`h-4 w-4`}),label:`Team-owned context`})]})]}),(0,l.jsxs)(`section`,{className:`w-full rounded-[24px] border border-frost bg-snow/95 p-7 shadow-baziu-lg backdrop-blur sm:p-9`,children:[(0,l.jsxs)(`div`,{className:`mb-6 flex items-center gap-3 lg:hidden`,children:[(0,l.jsx)(a,{className:`h-10 w-10`}),(0,l.jsx)(`span`,{className:`font-display text-2xl text-charcoal`,children:`bazilion`})]}),(0,l.jsx)(`div`,{className:`mb-6 flex h-10 w-10 items-center justify-center rounded-xl bg-sapphire-glow text-sapphire`,children:(0,l.jsx)(s,{className:`h-5 w-5`,"aria-hidden":`true`})}),(0,l.jsx)(`h2`,{className:`font-display text-3xl text-charcoal`,children:`Open Bazilion`}),(0,l.jsx)(`p`,{className:`mt-2 text-sm leading-6 text-mocha-light`,children:`Use the fresh-install credential once, then a named device token for future sign-ins.`}),e===`token`&&(0,l.jsxs)(`div`,{className:`err mt-5`,role:`alert`,children:[`That credential was not accepted. On first run, use the bootstrap token from`,` `,(0,l.jsx)(`code`,{children:`auth.json`}),`; afterward, use a named device token.`]}),e===`origin`&&(0,l.jsx)(`div`,{className:`err mt-5`,role:`alert`,children:`Bazilion blocked the sign-in request because its browser origin was hidden. Reload this page and try again from the configured Bazilion address.`}),(0,l.jsxs)(`form`,{method:`POST`,action:`/api/login`,className:`mt-6 text-left`,children:[(0,l.jsx)(`label`,{htmlFor:`token`,className:`block text-[0.85em] font-semibold text-mocha`,children:`Access token`}),(0,l.jsx)(`input`,{type:`password`,id:`token`,name:`token`,autoFocus:!0,required:!0,placeholder:`Paste your token`,className:`mb-4`}),(0,l.jsx)(`button`,{type:`submit`,className:`w-full`,children:`Open Bazilion`})]}),(0,l.jsxs)(`p`,{className:`mt-5 rounded-xl bg-ivory px-3 py-2.5 text-[0.78em] leading-relaxed text-mocha-light`,children:[`Fresh install? Paste the bootstrap token from `,(0,l.jsx)(`code`,{children:`auth.json`}),`; it is accepted only until provider setup is complete and is exchanged for a bounded session. For later sign-ins, run `,(0,l.jsx)(`code`,{children:`bazilion token create browser`}),` on the server.`]})]})]}),(0,l.jsxs)(`footer`,{className:`absolute bottom-4 left-0 right-0 text-center text-xs text-mocha-light`,children:[`dedicated to Baziu`,(0,l.jsx)(n,{className:`ml-1 inline-block h-3 w-3 align-[-1px] opacity-40`})]})]})}function d({icon:e,label:t}){return(0,l.jsxs)(`div`,{className:`flex items-center gap-2 rounded-xl border border-frost bg-snow/70 px-3 py-2.5 text-sm font-semibold text-mocha shadow-baziu-sm`,children:[(0,l.jsx)(`span`,{className:`text-sapphire`,children:e}),t]})}export{u as component};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as e,t}from"./jsx-runtime-DGeXAQPT.js";import{t as n}from"./react-3W8R1pOO.js";import{d as r}from"./preload-helper-bztXdkDj.js";import{t as i}from"./ConfirmDialog-CyL9A20V.js";import{h as a}from"./index-Cp6UHWr2.js";import{t as o}from"./Button-ByiV6fpd.js";import{t as s}from"./ConfigPage-BCLp-FUC.js";var c=e(n()),l=t(),u=[`stdio`,`http`,`sse`];function d(){let{servers:e}=a.useLoaderData(),t=r(),[n,d]=(0,c.useState)(``),[f,p]=(0,c.useState)(`stdio`),[m,h]=(0,c.useState)(``),[g,_]=(0,c.useState)(``),[v,y]=(0,c.useState)(``),[b,x]=(0,c.useState)(``),[S,C]=(0,c.useState)(null),[w,T]=(0,c.useState)(!1),[E,D]=(0,c.useState)({}),[O,k]=(0,c.useState)(null),[A,j]=(0,c.useState)(null);async function M(e){e.preventDefault(),C(null),T(!0);try{let e={name:n,transport:f,command:f===`stdio`?m:null,args:f===`stdio`?g.split(` `).filter(Boolean):[],url:f===`stdio`?null:v,authToken:b||void 0},r=await fetch(`/api/mcp-servers`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify(e)});if(!r.ok){let e=await r.json().catch(()=>({}));throw Error(e.error??`${r.status} ${r.statusText}`)}d(``),h(``),_(``),y(``),x(``),await t.invalidate()}catch(e){C(e.message)}finally{T(!1)}}async function N(e){k(e.id),C(null);try{let n=await fetch(`/api/mcp-servers/${encodeURIComponent(e.id)}`,{method:`PATCH`,headers:{"content-type":`application/json`},body:JSON.stringify({enabled:!e.enabled})});if(!n.ok){let t=await n.json().catch(()=>null);throw Error(t?.error??`Could not ${e.enabled?`disable`:`enable`} server`)}await t.invalidate()}catch(e){C(e instanceof Error?e.message:String(e))}finally{k(null)}}async function P(e){let n=await fetch(`/api/mcp-servers/${encodeURIComponent(e)}`,{method:`DELETE`});if(!n.ok&&n.status!==204){let e=await n.json().catch(()=>null);throw Error(e?.error??`Could not delete MCP server`)}await t.invalidate()}async function F(e){D(t=>({...t,[e]:{kind:`pending`,message:`Connecting…`}}));try{let t=await fetch(`/api/mcp-servers/${encodeURIComponent(e)}/test`,{method:`POST`}),n=await t.json().catch(()=>({}));D(r=>({...r,[e]:t.ok&&n.ok?{kind:`success`,message:`${n.tools?.length??0} tools: ${(n.tools??[]).map(e=>e.name).join(`, `)}`}:{kind:`error`,message:n.error??`Test failed (${t.status})`}}))}catch(t){D(n=>({...n,[e]:{kind:`error`,message:t instanceof Error?t.message:String(t)}}))}}return(0,l.jsxs)(s,{active:`mcp`,title:`MCP servers`,description:(0,l.jsxs)(l.Fragment,{children:[`Expose tools from local or remote Model Context Protocol servers to every agent under the `,(0,l.jsx)(`code`,{className:`font-mono`,children:`mcp__<server>__<tool>`}),` namespace. Local stdio servers inherit configured secrets; HTTP and SSE servers can use a bearer token.`]}),children:[(0,l.jsxs)(`section`,{className:`rounded-lg border bg-card p-5`,children:[(0,l.jsx)(`h3`,{className:`font-serif text-xl mb-3`,children:`Add a server`}),(0,l.jsxs)(`form`,{onSubmit:M,className:`space-y-3`,children:[(0,l.jsxs)(`div`,{className:`flex flex-col gap-3 sm:flex-row sm:flex-wrap sm:items-end`,children:[(0,l.jsxs)(`label`,{className:`w-full text-sm sm:w-auto`,children:[`Name`,(0,l.jsx)(`input`,{type:`text`,value:n,onChange:e=>d(e.target.value),required:!0,placeholder:`playwright`,pattern:`[a-zA-Z0-9_]+`,className:`mt-1 block w-full rounded-md border bg-background px-3 py-2 text-sm sm:w-48`})]}),(0,l.jsxs)(`label`,{className:`w-full text-sm sm:w-auto`,children:[`Transport`,(0,l.jsx)(`select`,{value:f,onChange:e=>p(e.target.value),className:`mt-1 block w-full rounded-md border bg-background px-3 py-2 text-sm`,children:u.map(e=>(0,l.jsx)(`option`,{value:e,children:e},e))})]})]}),f===`stdio`?(0,l.jsxs)(`div`,{className:`flex flex-col gap-3 sm:flex-row sm:flex-wrap sm:items-end`,children:[(0,l.jsxs)(`label`,{className:`w-full text-sm sm:w-auto`,children:[`Command`,(0,l.jsx)(`input`,{type:`text`,value:m,onChange:e=>h(e.target.value),placeholder:`npx`,className:`mt-1 block w-full rounded-md border bg-background px-3 py-2 text-sm sm:w-48`})]}),(0,l.jsxs)(`label`,{className:`w-full min-w-0 text-sm sm:flex-1`,children:[`Args (space-separated)`,(0,l.jsx)(`input`,{type:`text`,value:g,onChange:e=>_(e.target.value),placeholder:`-y @modelcontextprotocol/server-filesystem /tmp`,className:`block mt-1 rounded-md border bg-background px-3 py-2 text-sm w-full`})]})]}):(0,l.jsxs)(`div`,{className:`flex flex-col gap-3 sm:flex-row sm:flex-wrap sm:items-end`,children:[(0,l.jsxs)(`label`,{className:`w-full min-w-0 text-sm sm:flex-1`,children:[`URL`,(0,l.jsx)(`input`,{type:`url`,value:v,onChange:e=>y(e.target.value),placeholder:`https://mcp.example.com/sse`,className:`block mt-1 rounded-md border bg-background px-3 py-2 text-sm w-full`})]}),(0,l.jsxs)(`label`,{className:`w-full text-sm sm:w-auto`,children:[`Bearer token (optional)`,(0,l.jsx)(`input`,{type:`password`,value:b,onChange:e=>x(e.target.value),autoComplete:`off`,className:`mt-1 block w-full rounded-md border bg-background px-3 py-2 text-sm sm:w-56`})]})]}),(0,l.jsx)(o,{variant:`primary`,type:`submit`,disabled:w,className:`w-full sm:w-auto`,children:w?`adding…`:`add server`}),S&&(0,l.jsx)(`p`,{role:`alert`,className:`text-sm text-danger`,children:S})]})]}),(0,l.jsx)(`div`,{className:`overflow-x-auto`,children:(0,l.jsxs)(`table`,{className:`w-full min-w-[720px] text-sm`,children:[(0,l.jsx)(`thead`,{className:`text-left text-muted-foreground border-b`,children:(0,l.jsxs)(`tr`,{children:[(0,l.jsx)(`th`,{className:`py-2`,children:`name`}),(0,l.jsx)(`th`,{children:`transport`}),(0,l.jsx)(`th`,{children:`target`}),(0,l.jsx)(`th`,{children:`state`}),(0,l.jsx)(`th`,{})]})}),(0,l.jsxs)(`tbody`,{children:[e.length===0&&(0,l.jsx)(`tr`,{children:(0,l.jsx)(`td`,{colSpan:5,className:`py-6 text-center text-muted-foreground italic`,children:`no MCP servers yet — add one above`})}),e.map(e=>{let t=E[e.id];return(0,l.jsxs)(`tr`,{className:`border-b last:border-0 align-top`,children:[(0,l.jsxs)(`td`,{className:`py-2`,children:[e.name,e.hasAuthToken&&(0,l.jsx)(`span`,{className:`ml-2 text-[0.7em] uppercase tracking-wide text-muted-foreground`,children:`auth`})]}),(0,l.jsx)(`td`,{children:e.transport}),(0,l.jsx)(`td`,{className:`font-mono text-xs break-all`,children:e.transport===`stdio`?`${e.command??``} ${e.args.join(` `)}`.trim():e.url}),(0,l.jsx)(`td`,{children:e.enabled?(0,l.jsx)(`span`,{className:`text-success`,children:`enabled`}):(0,l.jsx)(`span`,{className:`text-muted-foreground`,children:`disabled`})}),(0,l.jsxs)(`td`,{className:`whitespace-nowrap`,children:[(0,l.jsxs)(`div`,{className:`flex gap-2`,children:[(0,l.jsx)(o,{variant:`ghost`,className:`text-xs`,onClick:()=>void F(e.id),children:`test`}),(0,l.jsx)(o,{variant:`ghost`,className:`text-xs`,disabled:O===e.id,onClick:()=>void N(e),children:O===e.id?`working…`:e.enabled?`disable`:`enable`}),(0,l.jsx)(o,{variant:`danger`,className:`text-xs`,disabled:O===e.id,onClick:()=>{C(null),j(e)},children:`delete`})]}),t&&(0,l.jsx)(`p`,{role:t.kind===`error`?`alert`:`status`,className:`mt-2 max-w-72 whitespace-normal break-words text-xs ${t.kind===`error`?`text-danger`:t.kind===`success`?`text-success`:`text-muted-foreground`}`,children:t.message})]})]},e.id)})]})]})}),(0,l.jsx)(i,{open:A!==null,title:`Delete MCP server ${A?.name??``}?`,description:(0,l.jsx)(`p`,{children:`This permanently removes the server configuration and its stored bearer token, closes the current connection, and removes its tools from future Agent turns. Reconnecting requires adding the server and credential again.`}),confirmLabel:`delete MCP server`,onConfirm:async()=>{if(A)try{await P(A.id)}catch(e){throw C(e instanceof Error?e.message:String(e)),e}},onOpenChange:e=>{e||j(null)}})]})}export{d as component};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{t as e}from"./jsx-runtime-DGeXAQPT.js";import{c as t}from"./index-Cp6UHWr2.js";import{a as n,i as r,r as i,t as a}from"./Page-NV96O47A.js";import{t as o}from"./TeamTabs-CdtNEqt4.js";var s=e();function c(){let e=t.useLoaderData(),{id:c}=t.useParams();return(0,s.jsxs)(i,{children:[(0,s.jsx)(`h1`,{children:`Team members`}),(0,s.jsxs)(`p`,{className:`muted`,children:[(0,s.jsx)(`code`,{children:`agents.team_id`}),` is the only live-membership authority.`]}),(0,s.jsx)(o,{teamId:c}),e.members.length===0?(0,s.jsx)(a,{title:`No Team members`,description:`Spawn an Agent into this Team from the Agents page or apply a Team template.`,actions:(0,s.jsx)(`a`,{href:`/agents`,className:`btn-primary no-underline`,children:`Spawn an Agent`})}):(0,s.jsxs)(r,{title:`Live roster`,description:`Every Agent belongs to exactly one Team; source slots show reusable-template lineage only.`,children:[(0,s.jsx)(`div`,{className:`hidden overflow-x-auto rounded-md border border-frost md:block`,children:(0,s.jsxs)(`table`,{className:`w-full`,children:[(0,s.jsx)(`thead`,{children:(0,s.jsxs)(`tr`,{children:[(0,s.jsx)(`th`,{children:`agent`}),(0,s.jsx)(`th`,{children:`status`}),(0,s.jsx)(`th`,{children:`agent template`}),(0,s.jsx)(`th`,{children:`source slot`})]})}),(0,s.jsx)(`tbody`,{children:e.members.map(t=>{let n=e.bindings.find(e=>e.agentId===t.id);return(0,s.jsxs)(`tr`,{children:[(0,s.jsx)(`td`,{children:(0,s.jsx)(`a`,{href:`/agents/${t.id}`,children:t.name})}),(0,s.jsx)(`td`,{children:t.status}),(0,s.jsx)(`td`,{children:t.profileId}),(0,s.jsx)(`td`,{children:(0,s.jsx)(`code`,{children:n?.sourceSlotId??`live-only`})})]},t.id)})})]})}),(0,s.jsx)(`div`,{className:`grid gap-3 md:hidden`,children:e.members.map(t=>{let r=e.bindings.find(e=>e.agentId===t.id);return(0,s.jsxs)(`article`,{className:`min-w-0 rounded-xl border border-border bg-muted/20 p-4`,children:[(0,s.jsxs)(`div`,{className:`flex min-w-0 items-start justify-between gap-3`,children:[(0,s.jsxs)(`div`,{className:`min-w-0`,children:[(0,s.jsx)(`a`,{href:`/agents/${t.id}`,className:`block truncate font-semibold text-foreground`,children:t.name}),(0,s.jsx)(`p`,{className:`mt-0.5 truncate font-mono text-xs text-muted-foreground`,children:t.id})]}),(0,s.jsx)(n,{variant:t.status===`archived`?`warning`:`success`,children:t.status})]}),(0,s.jsxs)(`dl`,{className:`mt-3 grid gap-2 text-xs`,children:[(0,s.jsxs)(`div`,{className:`rounded-lg bg-muted p-2`,children:[(0,s.jsx)(`dt`,{className:`font-semibold text-muted-foreground`,children:`Agent template`}),(0,s.jsx)(`dd`,{className:`mt-0.5 break-all font-mono`,children:t.profileId})]}),(0,s.jsxs)(`div`,{className:`rounded-lg bg-muted p-2`,children:[(0,s.jsx)(`dt`,{className:`font-semibold text-muted-foreground`,children:`Source slot`}),(0,s.jsx)(`dd`,{className:`mt-0.5 break-all font-mono`,children:r?.sourceSlotId??`live-only`})]})]})]},t.id)})})]})]})}export{c as component};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as e,t}from"./jsx-runtime-DGeXAQPT.js";import{t as n}from"./react-3W8R1pOO.js";import{t as r}from"./UnsavedChangesGuard-CEoK-ZcN.js";import{t as i}from"./ConfirmDialog-CyL9A20V.js";import{l as a}from"./index-Cp6UHWr2.js";import{r as o}from"./Page-NV96O47A.js";import{t as s}from"./Button-ByiV6fpd.js";import{t as c}from"./TeamTabs-CdtNEqt4.js";var l=e(n()),u=t();function d(e){return e.split(`/`).map(encodeURIComponent).join(`/`)}function f(){let{team:e,memberCount:t,entries:n}=a.useLoaderData(),f=e.id,[p,m]=(0,l.useState)(()=>n.map(e=>({key:e.key,preview:e.content.slice(0,80)}))),[h,g]=(0,l.useState)(!1),[_,v]=(0,l.useState)(``),[y,b]=(0,l.useState)(null),[x,S]=(0,l.useState)(`none`),[C,w]=(0,l.useState)(``),[T,E]=(0,l.useState)(``),[D,O]=(0,l.useState)(``),[k,A]=(0,l.useState)(``),[j,M]=(0,l.useState)(null),[N,P]=(0,l.useState)(null),F=(0,l.useRef)(null),I=x!==`none`&&(C!==D||T!==k);async function L(e){try{let t=e.trim().length>0?`/api/teams/${encodeURIComponent(f)}/memory/search?q=${encodeURIComponent(e)}&limit=50`:`/api/teams/${encodeURIComponent(f)}/memory`,n=await fetch(t);if(!n.ok){let e=await n.json().catch(()=>null);throw Error(e?.error??n.statusText)}let r=await n.json();e.trim().length>0?(m(r.map(e=>({key:e.key,preview:e.snippet,score:e.score}))),g(!0)):(m(r.map(e=>({key:e.key,preview:e.content.slice(0,80)}))),g(!1))}catch(e){M({msg:`error: ${e.message}`,kind:`error`})}}(0,l.useEffect)(()=>(F.current&&clearTimeout(F.current),F.current=setTimeout(()=>{L(_)},200),()=>{F.current&&clearTimeout(F.current)}),[_]);async function R(e){M({msg:`loading…`,kind:`info`});try{let t=await fetch(`/api/teams/${encodeURIComponent(f)}/memory/${d(e)}`);if(!t.ok){let e=await t.json().catch(()=>null);throw Error(e?.error??t.statusText)}let n=await t.json();b(n.key),S(`edit`),w(n.key),E(n.content??``),O(n.key),A(n.content??``),M({msg:`loaded ${n.key}`,kind:`info`})}catch(e){M({msg:`error: ${e.message}`,kind:`error`})}}function z(e){if(!(x===`edit`&&e===y)){if(!I){R(e);return}P({title:`Discard unsaved memory changes?`,description:(0,u.jsxs)(`p`,{children:[`Opening `,(0,u.jsx)(`code`,{className:`font-mono`,children:e}),` will permanently discard your changes to`,` `,(0,u.jsx)(`code`,{className:`font-mono`,children:y??(C||`this new entry`)}),`.`]}),confirmLabel:`discard and open entry`,onConfirm:()=>R(e)})}}function B(){b(null),S(`new`),w(``),E(``),O(``),A(``),M({msg:`new entry — type a key and content, then save`,kind:`info`})}function V(){if(!I){B();return}P({title:`Discard unsaved memory changes?`,description:(0,u.jsxs)(`p`,{children:[`Starting a new entry will permanently discard your changes to`,` `,(0,u.jsx)(`code`,{className:`font-mono`,children:y??(C||`this new entry`)}),`.`]}),confirmLabel:`discard and create new`,onConfirm:B})}async function H(){let e=C.trim();if(!e){M({msg:`key is required`,kind:`error`});return}try{let t=await fetch(`/api/teams/${encodeURIComponent(f)}/memory/${d(e)}`,{method:`PUT`,headers:{"content-type":`application/json`},body:JSON.stringify({content:T})});if(!t.ok){let e=await t.json().catch(()=>null);throw Error(e?.error??t.statusText)}b(e),S(`edit`),w(e),O(e),A(T),M({msg:`saved`,kind:`info`}),await L(_)}catch(e){M({msg:`error: ${e.message}`,kind:`error`})}}async function U(){if(!y)return;let e=y,t=await fetch(`/api/teams/${encodeURIComponent(f)}/memory/${d(e)}`,{method:`DELETE`});if(!t.ok&&t.status!==204){let e=await t.json().catch(()=>null);throw Error(e?.error??t.statusText)}b(null),S(`none`),w(``),E(``),O(``),A(``),M({msg:`${e} deleted`,kind:`info`}),await L(_)}function W(){if(!y)return;let e=y;P({title:`Delete ${e}?`,description:(0,u.jsxs)(`p`,{children:[`This permanently deletes `,(0,u.jsx)(`code`,{className:`font-mono`,children:e}),` from shared Team memory and removes it from search results for every Team member. This cannot be undone.`]}),confirmLabel:`delete memory entry`,onConfirm:U})}let G=x!==`none`&&C.trim().length>0,K=x===`edit`&&y!==null;return(0,u.jsxs)(o,{children:[(0,u.jsx)(r,{when:I,subject:`Team memory draft`}),(0,u.jsxs)(`header`,{className:`mb-6`,children:[(0,u.jsxs)(`h1`,{className:`font-serif text-3xl text-foreground`,children:[e.name,` `,(0,u.jsx)(`span`,{className:`text-muted-foreground text-base`,children:`/ Shared memory`})]}),(0,u.jsxs)(`p`,{className:`text-muted-foreground text-sm mt-1`,children:[`BM25-indexed markdown notes shared by every agent in`,` `,(0,u.jsx)(`a`,{href:`/teams/${encodeURIComponent(e.id)}`,className:`font-mono underline`,children:e.id}),` `,`(`,t,` member`,t===1?``:`s`,`). Anything written here is visible to every member; per-agent notes belong in the agent's own`,` `,(0,u.jsx)(`code`,{className:`font-mono`,children:`IDENTITY.md`}),` via `,(0,u.jsx)(`code`,{children:`home_write`}),`.`]})]}),(0,u.jsx)(c,{teamId:e.id}),(0,u.jsxs)(`div`,{className:`grid grid-cols-1 gap-6 lg:grid-cols-[320px_1fr]`,children:[(0,u.jsxs)(`div`,{children:[(0,u.jsxs)(`div`,{className:`overflow-hidden rounded-[16px] border border-frost bg-snow`,children:[(0,u.jsxs)(`div`,{className:`border-b border-frost p-2`,children:[(0,u.jsx)(`label`,{htmlFor:`team-memory-search`,className:`sr-only`,children:`Search Team memory`}),(0,u.jsx)(`input`,{id:`team-memory-search`,type:`text`,placeholder:`search (BM25)...`,autoComplete:`off`,value:_,onChange:e=>v(e.target.value)})]}),(0,u.jsx)(`div`,{className:`max-h-[520px] overflow-y-auto`,children:p.length===0?(0,u.jsx)(`div`,{className:`p-8 text-center text-mocha-light`,children:`no entries`}):p.map(e=>(0,u.jsxs)(`button`,{type:`button`,onClick:()=>z(e.key),className:`unstyled block w-full cursor-pointer border-b border-frost/50 px-3.5 py-2 text-left font-mono text-[0.84em] transition-colors last:border-b-0 hover:bg-sapphire-glow ${e.key===y?`bg-sapphire-glow font-medium text-sapphire-deep`:``}`,children:[h&&e.score!==void 0&&(0,u.jsx)(`span`,{className:`float-right text-[0.75em] text-sapphire`,children:e.score.toFixed(2)}),e.key,e.preview&&(0,u.jsx)(`span`,{className:`mt-1 block text-[0.9em] font-normal text-mocha-light`,children:e.preview})]},e.key))})]}),(0,u.jsx)(s,{variant:`ghost`,className:`mt-3 w-full`,onClick:V,children:`+ new entry`})]}),(0,u.jsxs)(`div`,{children:[(0,u.jsxs)(`div`,{className:`mb-3 flex items-center gap-2`,children:[(0,u.jsx)(`label`,{htmlFor:`team-memory-key`,className:`sr-only`,children:`Memory entry key`}),(0,u.jsx)(`input`,{id:`team-memory-key`,type:`text`,placeholder:`key (e.g. prefs/hiking.md)`,value:C,onChange:e=>w(e.target.value),disabled:x!==`new`,className:`flex-1 font-mono`})]}),(0,u.jsx)(`label`,{htmlFor:`team-memory-content`,className:`sr-only`,children:`Memory entry content`}),(0,u.jsx)(`textarea`,{id:`team-memory-content`,placeholder:`select an entry on the left, or create a new one.`,value:T,onChange:e=>E(e.target.value),disabled:x===`none`,className:`min-h-[360px] w-full font-mono text-[0.9em] leading-[1.55]`}),(0,u.jsxs)(`div`,{className:`mt-3 flex gap-2`,children:[(0,u.jsx)(s,{variant:`primary`,onClick:H,disabled:!G||!I,children:`save`}),(0,u.jsx)(s,{variant:`danger`,onClick:W,disabled:!K,children:`delete`})]}),j&&(0,u.jsx)(`p`,{role:j.kind===`error`?`alert`:`status`,className:`mt-2 text-[0.9em] ${j.kind===`error`?`text-danger`:`text-mocha-light`}`,children:j.msg})]})]}),(0,u.jsx)(i,{open:N!==null,title:N?.title??``,description:N?.description??null,confirmLabel:N?.confirmLabel??`continue`,onConfirm:()=>N?.onConfirm(),onOpenChange:e=>{e||P(null)}})]})}export{f as component};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as e,t}from"./jsx-runtime-DGeXAQPT.js";import{t as n}from"./react-3W8R1pOO.js";import{n as r,t as i}from"./ProductionTeamPolicyEditor-CsWpTsy6.js";import{A as a,d as o}from"./index-3nrK5iFr.js";import{r as s}from"./Page-CwNuDhWz.js";import{t as c}from"./Button-ByiV6fpd.js";import{t as l}from"./RecoveryState-QfMSuwy3.js";import{t as u}from"./TeamTabs-DvqWieCq.js";var d=a(`git-compare-arrows`,[[`circle`,{cx:`5`,cy:`6`,r:`3`,key:`1qnov2`}],[`path`,{d:`M12 6h5a2 2 0 0 1 2 2v7`,key:`1yj91y`}],[`path`,{d:`m15 9-3-3 3-3`,key:`1lwv8l`}],[`circle`,{cx:`19`,cy:`18`,r:`3`,key:`1qljk2`}],[`path`,{d:`M12 18H7a2 2 0 0 1-2-2V9`,key:`16sdep`}],[`path`,{d:`m9 15 3 3-3 3`,key:`1m3kbl`}]]),f=a(`refresh-cw`,[[`path`,{d:`M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8`,key:`v9h5vc`}],[`path`,{d:`M21 3v5h-5`,key:`1q7to0`}],[`path`,{d:`M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16`,key:`3uifl3`}],[`path`,{d:`M8 16H3v5`,key:`1cv678`}]]),p=e(n(),1),m=t();function h({teamId:e,detail:t,templates:n}){let[i,a]=(0,p.useState)(null),[o,s]=(0,p.useState)(null),[l,u]=(0,p.useState)(!1),[h,v]=(0,p.useState)(`${e}-snapshot`),[y,b]=(0,p.useState)(`${e} snapshot`),x=(0,p.useMemo)(()=>new Set(t.bindings.map(e=>e.agentId)),[t.bindings]),S=t.members.filter(e=>!x.has(e.id)),C=async()=>{let t=await fetch(`/api/teams/${encodeURIComponent(e)}/policy/diff`);if(!t.ok)throw Error((await t.json().catch(()=>null))?.error??`Could not load source comparison`);a(await t.json())};return(0,p.useEffect)(()=>{C().catch(e=>s(e instanceof Error?e.message:String(e)))},[e]),(0,m.jsxs)(`section`,{className:`card space-y-4`,"aria-labelledby":`source-workflows`,children:[(0,m.jsxs)(`div`,{className:`flex flex-wrap items-start gap-3`,children:[(0,m.jsx)(d,{className:`mt-1 h-5 w-5 text-sapphire`}),(0,m.jsxs)(`div`,{className:`mr-auto`,children:[(0,m.jsx)(`h2`,{id:`source-workflows`,className:`m-0 text-lg`,children:`Baseline and source`}),(0,m.jsx)(`p`,{className:`muted mt-1 text-sm`,children:`Lineage is retained for comparison; source edits never auto-propagate.`})]}),(0,m.jsxs)(c,{variant:`ghost`,onClick:()=>void C(),children:[(0,m.jsx)(f,{className:`h-4 w-4`}),`Refresh comparison`]})]}),i?(0,m.jsxs)(`div`,{className:`grid gap-3 sm:grid-cols-2 lg:grid-cols-4`,children:[(0,m.jsx)(g,{label:`Baseline`,value:i.baseline?`${i.baseline.templateId} r${i.baseline.templateRevision}`:`None`}),(0,m.jsx)(g,{label:`Live changes`,value:`+${i.comparison.addedSinceBaseline.length} / −${i.comparison.removedSinceBaseline.length} edges`}),(0,m.jsx)(g,{label:`Source slots`,value:`+${i.comparison.currentSourceAddedSlotIds.length} / −${i.comparison.currentSourceRemovedSlotIds.length}`}),(0,m.jsx)(g,{label:`Source state`,value:i.currentSource?i.sourceDiverged?`Diverged — rebaseline required`:`Aligned`:`Missing/tombstoned`,warning:i.sourceDiverged||!i.currentSource})]}):(0,m.jsx)(`p`,{className:`muted`,children:`Loading comparison…`}),i?.sourceDiverged&&(0,m.jsx)(`div`,{role:`alert`,className:`rounded-md border border-warning/25 bg-warning/10 p-3 text-sm text-warning`,children:`The source has changed since this Team retained its baseline. Both versions remain intact. Update-source is disabled; compare and explicitly rebaseline instead.`}),i?.currentSource&&!i.sourceDiverged&&(0,m.jsxs)(`div`,{className:`flex flex-wrap items-center gap-3`,children:[(0,m.jsxs)(`p`,{className:`mr-auto text-sm`,children:[`Promote the current live policy to `,(0,m.jsx)(`strong`,{children:i.currentSource.template.name}),`, including `,S.length,` live-only Agent`,S.length===1?``:`s`,`.`]}),(0,m.jsx)(c,{variant:`ghost`,disabled:l,onClick:async()=>{if(!(!i?.currentSource||i.sourceDiverged)){u(!0),s(null);try{let n=await fetch(`/api/teams/${encodeURIComponent(e)}/policy/update-source`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({teamExpectedRevision:t.teamPolicy.revision,templateExpectedRevision:i.currentSource.template.currentRevision,includeAgentIds:S.map(e=>e.id)})});if(!n.ok)throw Error((await n.json().catch(()=>null))?.error??`Update failed (${n.status})`);window.location.reload()}catch(e){s(e instanceof Error?e.message:String(e))}finally{u(!1)}}},children:`Update source after review`})]}),(0,m.jsxs)(`div`,{className:`grid gap-3 border-t border-frost pt-4 sm:grid-cols-[1fr_1fr_auto]`,children:[(0,m.jsxs)(`label`,{className:`text-xs`,children:[`New template ID`,(0,m.jsx)(`input`,{value:h,onChange:e=>v(e.target.value)})]}),(0,m.jsxs)(`label`,{className:`text-xs`,children:[`New template name`,(0,m.jsx)(`input`,{value:y,onChange:e=>b(e.target.value)})]}),(0,m.jsxs)(c,{variant:`primary`,disabled:l||!h.trim()||!y.trim(),onClick:async()=>{u(!0),s(null);try{let n=await fetch(`/api/teams/${encodeURIComponent(e)}/policy/save-as-template`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({expectedRevision:t.teamPolicy.revision,id:h,name:y})});if(!n.ok)throw Error((await n.json().catch(()=>null))?.error??`Save failed (${n.status})`);let r=await n.json();window.location.assign(`/templates/teams/${encodeURIComponent(r.template.id)}`)}catch(e){s(e instanceof Error?e.message:String(e))}finally{u(!1)}},children:[(0,m.jsx)(r,{className:`h-4 w-4`}),`Save independent Team template`]})]}),o&&(0,m.jsx)(`p`,{role:`alert`,className:`err`,children:o}),(0,m.jsx)(_,{teamId:e,detail:t,templates:n})]})}function g({label:e,value:t,warning:n=!1}){return(0,m.jsxs)(`div`,{className:`rounded-md border p-3 ${n?`border-warning/25 bg-warning/10 dark:bg-amber-950/30`:`border-frost bg-ivory`}`,children:[(0,m.jsx)(`dt`,{className:`text-xs font-semibold uppercase text-mocha-light`,children:e}),(0,m.jsx)(`dd`,{className:`mt-1 break-words text-sm font-semibold`,children:t})]})}function _({teamId:e,detail:t,templates:n}){let[r,i]=(0,p.useState)(n.find(e=>!e.deletedAt)?.id??``),[a,o]=(0,p.useState)(null),[s,l]=(0,p.useState)({}),[u,d]=(0,p.useState)({}),[f,h]=(0,p.useState)(null),[g,_]=(0,p.useState)(null),v=async()=>{_(null),h(null);let e=await fetch(`/api/team-templates/${encodeURIComponent(r)}`);if(!e.ok){_(`Could not load Team (${e.status})`);return}let n=await e.json();o(n);let i={};n.slots.forEach((e,n)=>{let r=t.members[n];r&&(i[e.slotId]=r.id)}),l(i);let a=new Set(Object.values(i));d(Object.fromEntries(t.members.filter(e=>!a.has(e.id)).map(e=>[e.id,`isolated`])))},y=()=>({teamExpectedRevision:t.teamPolicy.revision,templateId:a?.template.id,templateExpectedRevision:a?.template.currentRevision,slotMappings:a?.slots.map(e=>({slotId:e.slotId,agentId:s[e.slotId]}))??[],remainingPlacements:t.members.filter(e=>!Object.values(s).includes(e.id)).map(e=>({agentId:e.id,placement:u[e.id]??`isolated`}))});return(0,m.jsxs)(`div`,{className:`space-y-4 border-t border-frost pt-5`,children:[(0,m.jsxs)(`div`,{children:[(0,m.jsx)(`h3`,{className:`m-0 text-base`,children:`Adopt or rebaseline from Team Template`}),(0,m.jsx)(`p`,{className:`muted mt-1 text-sm`,children:`Map every stable source slot to one current Agent, choose placement for remaining Agents, then review the daemon-resolved edge set.`})]}),(0,m.jsxs)(`div`,{className:`flex flex-wrap items-end gap-3`,children:[(0,m.jsxs)(`label`,{className:`min-w-52 flex-1 text-xs`,children:[`Team Template`,(0,m.jsx)(`select`,{value:r,onChange:e=>{i(e.target.value),o(null),h(null)},children:n.filter(e=>!e.deletedAt).map(e=>(0,m.jsxs)(`option`,{value:e.id,children:[e.name,` · r`,e.currentRevision]},e.id))})]}),(0,m.jsx)(c,{variant:`ghost`,onClick:v,children:`Configure mapping`})]}),a&&(0,m.jsxs)(`div`,{className:`grid gap-3 md:grid-cols-2`,children:[(0,m.jsxs)(`div`,{className:`space-y-2`,children:[(0,m.jsx)(`p`,{className:`text-xs font-semibold uppercase text-mocha-light`,children:`Stable slots`}),a.slots.map(e=>(0,m.jsxs)(`label`,{className:`block text-xs`,children:[(0,m.jsxs)(`span`,{className:`block truncate`,title:e.slotId,children:[e.agentName,` · slot `,(0,m.jsx)(`code`,{children:e.slotId.slice(0,8)})]}),(0,m.jsxs)(`select`,{value:s[e.slotId]??``,onChange:t=>{l(n=>({...n,[e.slotId]:t.target.value})),h(null)},children:[(0,m.jsx)(`option`,{value:``,children:`Select Agent…`}),t.members.map(t=>(0,m.jsxs)(`option`,{value:t.id,disabled:Object.entries(s).some(([n,r])=>n!==e.slotId&&r===t.id),children:[t.name,t.status===`archived`?` (archived)`:``]},t.id))]})]},e.slotId))]}),(0,m.jsxs)(`div`,{className:`space-y-2`,children:[(0,m.jsx)(`p`,{className:`text-xs font-semibold uppercase text-mocha-light`,children:`Remaining live Agents`}),t.members.filter(e=>!Object.values(s).includes(e.id)).map(e=>(0,m.jsxs)(`label`,{className:`block text-xs`,children:[e.name,(0,m.jsxs)(`select`,{value:u[e.id]??`isolated`,onChange:t=>{d(n=>({...n,[e.id]:t.target.value})),h(null)},children:[(0,m.jsx)(`option`,{value:`isolated`,children:`Isolated`}),(0,m.jsx)(`option`,{value:`profile_defaults`,children:`Agent-template defaults`})]})]},e.id))]})]}),a&&(0,m.jsx)(c,{variant:`ghost`,onClick:async()=>{if(!a||a.slots.some(e=>!s[e.slotId])||new Set(Object.values(s)).size!==a.slots.length){_(`Map every stable slot to a distinct current Agent.`);return}let t=await fetch(`/api/teams/${encodeURIComponent(e)}/policy/adopt-template/preview`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify(y())}),n=await t.json().catch(()=>null);if(!t.ok){_(n?.error??`Preview failed (${t.status})`);return}h(n.edges)},children:`Review exact resulting policy`}),f&&(0,m.jsxs)(`div`,{className:`rounded-md border border-sapphire-light bg-sapphire-glow p-3 text-sm`,children:[(0,m.jsxs)(`p`,{children:[`The daemon resolved `,(0,m.jsx)(`strong`,{children:f.length}),` directed allow edges. This preview is submitted unchanged and recomputed transactionally at commit.`]}),(0,m.jsx)(`div`,{className:`mt-2 max-h-40 overflow-auto`,children:(0,m.jsx)(`ul`,{children:f.map((e,t)=>(0,m.jsx)(`li`,{children:(0,m.jsxs)(`code`,{children:[e.sourceKind,e.sourceId?`:${e.sourceId}`:``,` → `,e.targetKind,e.targetId?`:${e.targetId}`:``]})},`${e.sourceKind}:${e.sourceId??``}>${e.targetKind}:${e.targetId??``}:${t}`))})}),(0,m.jsx)(c,{variant:`primary`,className:`mt-3`,onClick:async()=>{if(!f)return;let t=await fetch(`/api/teams/${encodeURIComponent(e)}/policy/adopt-template`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({...y(),previewEdges:f})}),n=await t.json().catch(()=>null);if(!t.ok){_(n?.error??`Rebaseline failed (${t.status})`);return}window.location.reload()},children:`Commit reviewed rebaseline`})]}),g&&(0,m.jsx)(`p`,{role:`alert`,className:`err`,children:g})]})}function v(){let e=o.useLoaderData();if(!e.ok)return(0,m.jsx)(l,{title:`Team policy unavailable`,error:Error(e.error),reset:()=>window.location.reload(),fallbackHref:`/teams`});let{detail:t,profiles:n,templates:r}=e.value,{id:a}=o.useParams(),c=o.useSearch(),d=t.baseline;return(0,m.jsxs)(s,{size:`wide`,children:[(0,m.jsxs)(`div`,{children:[(0,m.jsx)(`h1`,{children:`Team policy`}),(0,m.jsxs)(`p`,{className:`muted`,children:[`The sole effective live communication policy for `,(0,m.jsx)(`code`,{children:a}),`.`]})]}),(0,m.jsx)(u,{teamId:a}),(0,m.jsxs)(`section`,{className:`grid gap-3 sm:grid-cols-2 lg:grid-cols-4`,"aria-label":`Policy status`,children:[(0,m.jsx)(y,{label:`Revision`,value:t.teamPolicy.revision}),(0,m.jsx)(y,{label:`Allow edges`,value:t.edges.length}),(0,m.jsx)(y,{label:`Baseline`,value:d?`${d.templateId} r${d.templateRevision}`:`Not initialized`})]}),(0,m.jsx)(i,{source:{kind:`live`,teamId:a,detail:t},profiles:n,initialUi:{view:c.view,selectedId:c.selected,viewport:{x:c.vx,y:c.vy,zoom:c.vz}}}),(0,m.jsx)(h,{teamId:a,detail:t,templates:r})]})}function y({label:e,value:t}){return(0,m.jsxs)(`div`,{className:`card`,children:[(0,m.jsx)(`dt`,{className:`muted text-xs`,children:e}),(0,m.jsx)(`dd`,{className:`break-words font-semibold`,children:t})]})}export{v as component};
|
|
1
|
+
import{r as e,t}from"./jsx-runtime-DGeXAQPT.js";import{t as n}from"./react-3W8R1pOO.js";import{n as r,t as i}from"./ProductionTeamPolicyEditor-DBKnOezm.js";import{q as a,u as o}from"./index-Cp6UHWr2.js";import{r as s}from"./Page-NV96O47A.js";import{t as c}from"./Button-ByiV6fpd.js";import{t as l}from"./RecoveryState-QfMSuwy3.js";import{t as u}from"./TeamTabs-CdtNEqt4.js";var d=a(`git-compare-arrows`,[[`circle`,{cx:`5`,cy:`6`,r:`3`,key:`1qnov2`}],[`path`,{d:`M12 6h5a2 2 0 0 1 2 2v7`,key:`1yj91y`}],[`path`,{d:`m15 9-3-3 3-3`,key:`1lwv8l`}],[`circle`,{cx:`19`,cy:`18`,r:`3`,key:`1qljk2`}],[`path`,{d:`M12 18H7a2 2 0 0 1-2-2V9`,key:`16sdep`}],[`path`,{d:`m9 15 3 3-3 3`,key:`1m3kbl`}]]),f=a(`refresh-cw`,[[`path`,{d:`M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8`,key:`v9h5vc`}],[`path`,{d:`M21 3v5h-5`,key:`1q7to0`}],[`path`,{d:`M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16`,key:`3uifl3`}],[`path`,{d:`M8 16H3v5`,key:`1cv678`}]]),p=e(n(),1),m=t();function h({teamId:e,detail:t,templates:n}){let[i,a]=(0,p.useState)(null),[o,s]=(0,p.useState)(null),[l,u]=(0,p.useState)(!1),[h,v]=(0,p.useState)(`${e}-snapshot`),[y,b]=(0,p.useState)(`${e} snapshot`),x=(0,p.useMemo)(()=>new Set(t.bindings.map(e=>e.agentId)),[t.bindings]),S=t.members.filter(e=>!x.has(e.id)),C=async()=>{let t=await fetch(`/api/teams/${encodeURIComponent(e)}/policy/diff`);if(!t.ok)throw Error((await t.json().catch(()=>null))?.error??`Could not load source comparison`);a(await t.json())};return(0,p.useEffect)(()=>{C().catch(e=>s(e instanceof Error?e.message:String(e)))},[e]),(0,m.jsxs)(`section`,{className:`card space-y-4`,"aria-labelledby":`source-workflows`,children:[(0,m.jsxs)(`div`,{className:`flex flex-wrap items-start gap-3`,children:[(0,m.jsx)(d,{className:`mt-1 h-5 w-5 text-sapphire`}),(0,m.jsxs)(`div`,{className:`mr-auto`,children:[(0,m.jsx)(`h2`,{id:`source-workflows`,className:`m-0 text-lg`,children:`Baseline and source`}),(0,m.jsx)(`p`,{className:`muted mt-1 text-sm`,children:`Lineage is retained for comparison; source edits never auto-propagate.`})]}),(0,m.jsxs)(c,{variant:`ghost`,onClick:()=>void C(),children:[(0,m.jsx)(f,{className:`h-4 w-4`}),`Refresh comparison`]})]}),i?(0,m.jsxs)(`div`,{className:`grid gap-3 sm:grid-cols-2 lg:grid-cols-4`,children:[(0,m.jsx)(g,{label:`Baseline`,value:i.baseline?`${i.baseline.templateId} r${i.baseline.templateRevision}`:`None`}),(0,m.jsx)(g,{label:`Live changes`,value:`+${i.comparison.addedSinceBaseline.length} / −${i.comparison.removedSinceBaseline.length} edges`}),(0,m.jsx)(g,{label:`Source slots`,value:`+${i.comparison.currentSourceAddedSlotIds.length} / −${i.comparison.currentSourceRemovedSlotIds.length}`}),(0,m.jsx)(g,{label:`Source state`,value:i.currentSource?i.sourceDiverged?`Diverged — rebaseline required`:`Aligned`:`Missing/tombstoned`,warning:i.sourceDiverged||!i.currentSource})]}):(0,m.jsx)(`p`,{className:`muted`,children:`Loading comparison…`}),i?.sourceDiverged&&(0,m.jsx)(`div`,{role:`alert`,className:`rounded-md border border-warning/25 bg-warning/10 p-3 text-sm text-warning`,children:`The source has changed since this Team retained its baseline. Both versions remain intact. Update-source is disabled; compare and explicitly rebaseline instead.`}),i?.currentSource&&!i.sourceDiverged&&(0,m.jsxs)(`div`,{className:`flex flex-wrap items-center gap-3`,children:[(0,m.jsxs)(`p`,{className:`mr-auto text-sm`,children:[`Promote the current live policy to `,(0,m.jsx)(`strong`,{children:i.currentSource.template.name}),`, including `,S.length,` live-only Agent`,S.length===1?``:`s`,`.`]}),(0,m.jsx)(c,{variant:`ghost`,disabled:l,onClick:async()=>{if(!(!i?.currentSource||i.sourceDiverged)){u(!0),s(null);try{let n=await fetch(`/api/teams/${encodeURIComponent(e)}/policy/update-source`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({teamExpectedRevision:t.teamPolicy.revision,templateExpectedRevision:i.currentSource.template.currentRevision,includeAgentIds:S.map(e=>e.id)})});if(!n.ok)throw Error((await n.json().catch(()=>null))?.error??`Update failed (${n.status})`);window.location.reload()}catch(e){s(e instanceof Error?e.message:String(e))}finally{u(!1)}}},children:`Update source after review`})]}),(0,m.jsxs)(`div`,{className:`grid gap-3 border-t border-frost pt-4 sm:grid-cols-[1fr_1fr_auto]`,children:[(0,m.jsxs)(`label`,{className:`text-xs`,children:[`New template ID`,(0,m.jsx)(`input`,{value:h,onChange:e=>v(e.target.value)})]}),(0,m.jsxs)(`label`,{className:`text-xs`,children:[`New template name`,(0,m.jsx)(`input`,{value:y,onChange:e=>b(e.target.value)})]}),(0,m.jsxs)(c,{variant:`primary`,disabled:l||!h.trim()||!y.trim(),onClick:async()=>{u(!0),s(null);try{let n=await fetch(`/api/teams/${encodeURIComponent(e)}/policy/save-as-template`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({expectedRevision:t.teamPolicy.revision,id:h,name:y})});if(!n.ok)throw Error((await n.json().catch(()=>null))?.error??`Save failed (${n.status})`);let r=await n.json();window.location.assign(`/templates/teams/${encodeURIComponent(r.template.id)}`)}catch(e){s(e instanceof Error?e.message:String(e))}finally{u(!1)}},children:[(0,m.jsx)(r,{className:`h-4 w-4`}),`Save independent Team template`]})]}),o&&(0,m.jsx)(`p`,{role:`alert`,className:`err`,children:o}),(0,m.jsx)(_,{teamId:e,detail:t,templates:n})]})}function g({label:e,value:t,warning:n=!1}){return(0,m.jsxs)(`div`,{className:`rounded-md border p-3 ${n?`border-warning/25 bg-warning/10 dark:bg-amber-950/30`:`border-frost bg-ivory`}`,children:[(0,m.jsx)(`dt`,{className:`text-xs font-semibold uppercase text-mocha-light`,children:e}),(0,m.jsx)(`dd`,{className:`mt-1 break-words text-sm font-semibold`,children:t})]})}function _({teamId:e,detail:t,templates:n}){let[r,i]=(0,p.useState)(n.find(e=>!e.deletedAt)?.id??``),[a,o]=(0,p.useState)(null),[s,l]=(0,p.useState)({}),[u,d]=(0,p.useState)({}),[f,h]=(0,p.useState)(null),[g,_]=(0,p.useState)(null),v=async()=>{_(null),h(null);let e=await fetch(`/api/team-templates/${encodeURIComponent(r)}`);if(!e.ok){_(`Could not load Team (${e.status})`);return}let n=await e.json();o(n);let i={};n.slots.forEach((e,n)=>{let r=t.members[n];r&&(i[e.slotId]=r.id)}),l(i);let a=new Set(Object.values(i));d(Object.fromEntries(t.members.filter(e=>!a.has(e.id)).map(e=>[e.id,`isolated`])))},y=()=>({teamExpectedRevision:t.teamPolicy.revision,templateId:a?.template.id,templateExpectedRevision:a?.template.currentRevision,slotMappings:a?.slots.map(e=>({slotId:e.slotId,agentId:s[e.slotId]}))??[],remainingPlacements:t.members.filter(e=>!Object.values(s).includes(e.id)).map(e=>({agentId:e.id,placement:u[e.id]??`isolated`}))});return(0,m.jsxs)(`div`,{className:`space-y-4 border-t border-frost pt-5`,children:[(0,m.jsxs)(`div`,{children:[(0,m.jsx)(`h3`,{className:`m-0 text-base`,children:`Adopt or rebaseline from Team Template`}),(0,m.jsx)(`p`,{className:`muted mt-1 text-sm`,children:`Map every stable source slot to one current Agent, choose placement for remaining Agents, then review the daemon-resolved edge set.`})]}),(0,m.jsxs)(`div`,{className:`flex flex-wrap items-end gap-3`,children:[(0,m.jsxs)(`label`,{className:`min-w-52 flex-1 text-xs`,children:[`Team Template`,(0,m.jsx)(`select`,{value:r,onChange:e=>{i(e.target.value),o(null),h(null)},children:n.filter(e=>!e.deletedAt).map(e=>(0,m.jsxs)(`option`,{value:e.id,children:[e.name,` · r`,e.currentRevision]},e.id))})]}),(0,m.jsx)(c,{variant:`ghost`,onClick:v,children:`Configure mapping`})]}),a&&(0,m.jsxs)(`div`,{className:`grid gap-3 md:grid-cols-2`,children:[(0,m.jsxs)(`div`,{className:`space-y-2`,children:[(0,m.jsx)(`p`,{className:`text-xs font-semibold uppercase text-mocha-light`,children:`Stable slots`}),a.slots.map(e=>(0,m.jsxs)(`label`,{className:`block text-xs`,children:[(0,m.jsxs)(`span`,{className:`block truncate`,title:e.slotId,children:[e.agentName,` · slot `,(0,m.jsx)(`code`,{children:e.slotId.slice(0,8)})]}),(0,m.jsxs)(`select`,{value:s[e.slotId]??``,onChange:t=>{l(n=>({...n,[e.slotId]:t.target.value})),h(null)},children:[(0,m.jsx)(`option`,{value:``,children:`Select Agent…`}),t.members.map(t=>(0,m.jsxs)(`option`,{value:t.id,disabled:Object.entries(s).some(([n,r])=>n!==e.slotId&&r===t.id),children:[t.name,t.status===`archived`?` (archived)`:``]},t.id))]})]},e.slotId))]}),(0,m.jsxs)(`div`,{className:`space-y-2`,children:[(0,m.jsx)(`p`,{className:`text-xs font-semibold uppercase text-mocha-light`,children:`Remaining live Agents`}),t.members.filter(e=>!Object.values(s).includes(e.id)).map(e=>(0,m.jsxs)(`label`,{className:`block text-xs`,children:[e.name,(0,m.jsxs)(`select`,{value:u[e.id]??`isolated`,onChange:t=>{d(n=>({...n,[e.id]:t.target.value})),h(null)},children:[(0,m.jsx)(`option`,{value:`isolated`,children:`Isolated`}),(0,m.jsx)(`option`,{value:`profile_defaults`,children:`Agent-template defaults`})]})]},e.id))]})]}),a&&(0,m.jsx)(c,{variant:`ghost`,onClick:async()=>{if(!a||a.slots.some(e=>!s[e.slotId])||new Set(Object.values(s)).size!==a.slots.length){_(`Map every stable slot to a distinct current Agent.`);return}let t=await fetch(`/api/teams/${encodeURIComponent(e)}/policy/adopt-template/preview`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify(y())}),n=await t.json().catch(()=>null);if(!t.ok){_(n?.error??`Preview failed (${t.status})`);return}h(n.edges)},children:`Review exact resulting policy`}),f&&(0,m.jsxs)(`div`,{className:`rounded-md border border-sapphire-light bg-sapphire-glow p-3 text-sm`,children:[(0,m.jsxs)(`p`,{children:[`The daemon resolved `,(0,m.jsx)(`strong`,{children:f.length}),` directed allow edges. This preview is submitted unchanged and recomputed transactionally at commit.`]}),(0,m.jsx)(`div`,{className:`mt-2 max-h-40 overflow-auto`,children:(0,m.jsx)(`ul`,{children:f.map((e,t)=>(0,m.jsx)(`li`,{children:(0,m.jsxs)(`code`,{children:[e.sourceKind,e.sourceId?`:${e.sourceId}`:``,` → `,e.targetKind,e.targetId?`:${e.targetId}`:``]})},`${e.sourceKind}:${e.sourceId??``}>${e.targetKind}:${e.targetId??``}:${t}`))})}),(0,m.jsx)(c,{variant:`primary`,className:`mt-3`,onClick:async()=>{if(!f)return;let t=await fetch(`/api/teams/${encodeURIComponent(e)}/policy/adopt-template`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({...y(),previewEdges:f})}),n=await t.json().catch(()=>null);if(!t.ok){_(n?.error??`Rebaseline failed (${t.status})`);return}window.location.reload()},children:`Commit reviewed rebaseline`})]}),g&&(0,m.jsx)(`p`,{role:`alert`,className:`err`,children:g})]})}function v(){let e=o.useLoaderData();if(!e.ok)return(0,m.jsx)(l,{title:`Team policy unavailable`,error:Error(e.error),reset:()=>window.location.reload(),fallbackHref:`/teams`});let{detail:t,profiles:n,templates:r}=e.value,{id:a}=o.useParams(),c=o.useSearch(),d=t.baseline;return(0,m.jsxs)(s,{size:`wide`,children:[(0,m.jsxs)(`div`,{children:[(0,m.jsx)(`h1`,{children:`Team policy`}),(0,m.jsxs)(`p`,{className:`muted`,children:[`The sole effective live communication policy for `,(0,m.jsx)(`code`,{children:a}),`.`]})]}),(0,m.jsx)(u,{teamId:a}),(0,m.jsxs)(`section`,{className:`grid gap-3 sm:grid-cols-2 lg:grid-cols-4`,"aria-label":`Policy status`,children:[(0,m.jsx)(y,{label:`Revision`,value:t.teamPolicy.revision}),(0,m.jsx)(y,{label:`Allow edges`,value:t.edges.length}),(0,m.jsx)(y,{label:`Baseline`,value:d?`${d.templateId} r${d.templateRevision}`:`Not initialized`})]}),(0,m.jsx)(i,{source:{kind:`live`,teamId:a,detail:t},profiles:n,initialUi:{view:c.view,selectedId:c.selected,viewport:{x:c.vx,y:c.vy,zoom:c.vz}}}),(0,m.jsx)(h,{teamId:a,detail:t,templates:r})]})}function y({label:e,value:t}){return(0,m.jsxs)(`div`,{className:`card`,children:[(0,m.jsx)(`dt`,{className:`muted text-xs`,children:e}),(0,m.jsx)(`dd`,{className:`break-words font-semibold`,children:t})]})}export{v as component};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{n as e,r as t,t as n}from"./jsx-runtime-DGeXAQPT.js";import{t as r}from"./react-3W8R1pOO.js";var i=e((e=>{var t=r();function n(e){var t=`https://react.dev/errors/`+e;if(1<arguments.length){t+=`?args[]=`+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+=`&args[]=`+encodeURIComponent(arguments[n])}return`Minified React error #`+e+`; visit `+t+` for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`}function i(){}var a={d:{f:i,r:function(){throw Error(n(522))},D:i,C:i,L:i,m:i,X:i,S:i,M:i},p:0,findDOMNode:null},o=Symbol.for(`react.portal`);function s(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:o,key:r==null?null:``+r,children:e,containerInfo:t,implementation:n}}var c=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function l(e,t){if(e===`font`)return``;if(typeof t==`string`)return t===`use-credentials`?t:``}e.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=a,e.createPortal=function(e,t){var r=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)throw Error(n(299));return s(e,t,null,r)},e.flushSync=function(e){var t=c.T,n=a.p;try{if(c.T=null,a.p=2,e)return e()}finally{c.T=t,a.p=n,a.d.f()}},e.preconnect=function(e,t){typeof e==`string`&&(t?(t=t.crossOrigin,t=typeof t==`string`?t===`use-credentials`?t:``:void 0):t=null,a.d.C(e,t))},e.prefetchDNS=function(e){typeof e==`string`&&a.d.D(e)},e.preinit=function(e,t){if(typeof e==`string`&&t&&typeof t.as==`string`){var n=t.as,r=l(n,t.crossOrigin),i=typeof t.integrity==`string`?t.integrity:void 0,o=typeof t.fetchPriority==`string`?t.fetchPriority:void 0;n===`style`?a.d.S(e,typeof t.precedence==`string`?t.precedence:void 0,{crossOrigin:r,integrity:i,fetchPriority:o}):n===`script`&&a.d.X(e,{crossOrigin:r,integrity:i,fetchPriority:o,nonce:typeof t.nonce==`string`?t.nonce:void 0})}},e.preinitModule=function(e,t){if(typeof e==`string`)if(typeof t==`object`&&t){if(t.as==null||t.as===`script`){var n=l(t.as,t.crossOrigin);a.d.M(e,{crossOrigin:n,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0})}}else t??a.d.M(e)},e.preload=function(e,t){if(typeof e==`string`&&typeof t==`object`&&t&&typeof t.as==`string`){var n=t.as,r=l(n,t.crossOrigin);a.d.L(e,n,{crossOrigin:r,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0,type:typeof t.type==`string`?t.type:void 0,fetchPriority:typeof t.fetchPriority==`string`?t.fetchPriority:void 0,referrerPolicy:typeof t.referrerPolicy==`string`?t.referrerPolicy:void 0,imageSrcSet:typeof t.imageSrcSet==`string`?t.imageSrcSet:void 0,imageSizes:typeof t.imageSizes==`string`?t.imageSizes:void 0,media:typeof t.media==`string`?t.media:void 0})}},e.preloadModule=function(e,t){if(typeof e==`string`)if(t){var n=l(t.as,t.crossOrigin);a.d.m(e,{as:typeof t.as==`string`&&t.as!==`script`?t.as:void 0,crossOrigin:n,integrity:typeof t.integrity==`string`?t.integrity:void 0})}else a.d.m(e)},e.requestFormReset=function(e){a.d.r(e)},e.unstable_batchedUpdates=function(e,t){return e(t)},e.useFormState=function(e,t,n){return c.H.useFormState(e,t,n)},e.useFormStatus=function(){return c.H.useHostTransitionStatus()},e.version=`19.2.7`})),a=e(((e,t)=>{function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>`u`||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!=`function`))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}n(),t.exports=i()}));function o(e){return e[e.length-1]}function s(e){return typeof e==`function`}function c(e,t){return s(e)?e(t):e}var l=Object.prototype.hasOwnProperty,u=Object.prototype.propertyIsEnumerable;function d(e){for(let t in e)if(l.call(e,t))return!0;return!1}var f=()=>Object.create(null),p=(e,t)=>m(e,t,f);function m(e,t,n=()=>({}),r=0){if(e===t)return e;if(r>500)return t;let i=t,a=v(e)&&v(i);if(!a&&!(g(e)&&g(i)))return i;let o=a?e:h(e);if(!o)return i;let s=a?i:h(i);if(!s)return i;let c=o.length,u=s.length,d=a?Array(u):n(),f=0;for(let t=0;t<u;t++){let o=a?t:s[t],u=e[o],p=i[o];if(u===p){d[o]=u,(a?t<c:l.call(e,o))&&f++;continue}if(u===null||p===null||typeof u!=`object`||typeof p!=`object`){d[o]=p;continue}let h=m(u,p,n,r+1);d[o]=h,h===u&&f++}return c===u&&f===c?e:d}function h(e){let t=Object.getOwnPropertyNames(e);for(let n of t)if(!u.call(e,n))return!1;let n=Object.getOwnPropertySymbols(e);if(n.length===0)return t;let r=t;for(let t of n){if(!u.call(e,t))return!1;r.push(t)}return r}function g(e){if(!_(e))return!1;let t=e.constructor;if(t===void 0)return!0;let n=t.prototype;return!(!_(n)||!n.hasOwnProperty(`isPrototypeOf`))}function _(e){return Object.prototype.toString.call(e)===`[object Object]`}function v(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function y(e,t,n){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return!1;for(let r=0,i=e.length;r<i;r++)if(!y(e[r],t[r],n))return!1;return!0}if(g(e)&&g(t)){let r=n?.ignoreUndefined??!0;if(n?.partial){for(let i in t)if((!r||t[i]!==void 0)&&!y(e[i],t[i],n))return!1;return!0}let i=0;if(!r)i=Object.keys(e).length;else for(let t in e)e[t]!==void 0&&i++;let a=0;for(let o in t)if((!r||t[o]!==void 0)&&(a++,a>i||!y(e[o],t[o],n)))return!1;return i===a}return!1}function b(e){let t,n,r=new Promise((e,r)=>{t=e,n=r});return r.status=`pending`,r.resolve=n=>{r.status=`resolved`,r.value=n,t(n),e?.(n)},r.reject=e=>{r.status=`rejected`,n(e)},r}function x(e){return typeof e?.message==`string`?e.message.startsWith(`Failed to fetch dynamically imported module`)||e.message.startsWith(`error loading dynamically imported module`)||e.message.startsWith(`Importing a module script failed`):!1}function S(e){return!!(e&&typeof e==`object`&&typeof e.then==`function`)}var C=/[\x00-\x1f\x7f"<>`{}]/g;function w(e){return e.replace(C,e=>`%`+e.charCodeAt(0).toString(16).toUpperCase().padStart(2,`0`))}function T(e){let t;try{t=decodeURI(e)}catch{t=e.replaceAll(/%[0-9A-F]{2}/gi,e=>{try{return decodeURI(e)}catch{return e}})}return w(t)}var E=[`http:`,`https:`,`mailto:`,`tel:`];function ee(e,t){if(!e)return!1;try{let n=new URL(e);return!t.has(n.protocol)}catch{return!1}}var D={"&":`\\u0026`,">":`\\u003e`,"<":`\\u003c`,"\u2028":`\\u2028`,"\u2029":`\\u2029`},te=/[&><\u2028\u2029]/g;function ne(e){return e.replace(te,e=>D[e])}function re(e){if(!e||!/[%\\\x00-\x1f\x7f]/.test(e)&&!e.startsWith(`//`))return{path:e,handledProtocolRelativeURL:!1};let t=/%25|%5C/gi,n=0,r=``,i;for(;(i=t.exec(e))!==null;)r+=T(e.slice(n,i.index))+i[0],n=t.lastIndex;r+=T(n?e.slice(n):e);let a=!1;return r.startsWith(`//`)&&(a=!0,r=`/`+r.replace(/^\/+/,``)),{path:r,handledProtocolRelativeURL:a}}function ie(e){return/\s|[^\u0000-\u007F]/.test(e)?e.replace(/\s|[^\u0000-\u007F]/gu,encodeURIComponent):e}function ae(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}function oe(){throw Error(`Invariant failed`)}function O(e){let t=new Map,n,r,i=e=>{e.next&&(e.prev?(e.prev.next=e.next,e.next.prev=e.prev,e.next=void 0,r&&(r.next=e,e.prev=r)):(e.next.prev=void 0,n=e.next,e.next=void 0,r&&(e.prev=r,r.next=e)),r=e)};return{get(e){let n=t.get(e);if(n)return i(n),n.value},set(a,o){if(t.size>=e&&n){let e=n;t.delete(e.key),e.next&&(n=e.next,e.next.prev=void 0),e===r&&(r=void 0)}let s=t.get(a);if(s)s.value=o,i(s);else{let e={key:a,value:o,prev:r};r&&(r.next=e),r=e,n||=e,t.set(a,e)}},clear(){t.clear(),n=void 0,r=void 0}}}var k=4,se=5;function ce(e){let t=e.indexOf(`{`);if(t===-1)return null;let n=e.indexOf(`}`,t);return n===-1||t+1>=e.length?null:[t,n]}function le(e,t,n=new Uint16Array(6)){let r=e.indexOf(`/`,t),i=r===-1?e.length:r,a=e.substring(t,i);if(!a||!a.includes(`$`))return n[0]=0,n[1]=t,n[2]=t,n[3]=i,n[4]=i,n[5]=i,n;if(a===`$`){let r=e.length;return n[0]=2,n[1]=t,n[2]=t,n[3]=r,n[4]=r,n[5]=r,n}if(a.charCodeAt(0)===36)return n[0]=1,n[1]=t,n[2]=t+1,n[3]=i,n[4]=i,n[5]=i,n;let o=ce(a);if(o){let[r,s]=o,c=a.charCodeAt(r+1);if(c===45){if(r+2<a.length&&a.charCodeAt(r+2)===36){let e=r+3,a=s;if(e<a)return n[0]=3,n[1]=t+r,n[2]=t+e,n[3]=t+a,n[4]=t+s+1,n[5]=i,n}}else if(c===36){let a=r+1,o=r+2;return o===s?(n[0]=2,n[1]=t+r,n[2]=t+a,n[3]=t+o,n[4]=t+s+1,n[5]=e.length,n):(n[0]=1,n[1]=t+r,n[2]=t+o,n[3]=t+s,n[4]=t+s+1,n[5]=i,n)}}return n[0]=0,n[1]=t,n[2]=t,n[3]=i,n[4]=i,n[5]=i,n}function A(e,t,n,r,i,a,o){o?.(n);let s=r;{let r=n.fullPath??n.from,o=r.length,c=n.options?.caseSensitive??e,l=n.options?.params?.parse??n.options?.parseParams;for(;s<o;){let e=le(r,s,t),o,u=s,d=e[5];switch(s=d+1,a++,e[0]){case 0:{let t=r.substring(e[2],e[3]);if(c){let e=i.static?.get(t);if(e)o=e;else{i.static??=new Map;let e=N(n.fullPath??n.from);e.parent=i,e.depth=a,o=e,i.static.set(t,e)}}else{let e=t.toLowerCase(),r=i.staticInsensitive?.get(e);if(r)o=r;else{i.staticInsensitive??=new Map;let t=N(n.fullPath??n.from);t.parent=i,t.depth=a,o=t,i.staticInsensitive.set(e,t)}}break}case 1:{let t=r.substring(u,e[1]),s=r.substring(e[4],d),f=c&&!!(t||s),p=t?f?t:t.toLowerCase():void 0,m=s?f?s:s.toLowerCase():void 0,h=!l&&i.dynamic?.find(e=>!e.parse&&e.caseSensitive===f&&e.prefix===p&&e.suffix===m);if(h)o=h;else{let e=P(1,n.fullPath??n.from,f,p,m);o=e,e.depth=a,e.parent=i,i.dynamic??=[],i.dynamic.push(e)}break}case 3:{let t=r.substring(u,e[1]),s=r.substring(e[4],d),f=c&&!!(t||s),p=t?f?t:t.toLowerCase():void 0,m=s?f?s:s.toLowerCase():void 0,h=!l&&i.optional?.find(e=>!e.parse&&e.caseSensitive===f&&e.prefix===p&&e.suffix===m);if(h)o=h;else{let e=P(3,n.fullPath??n.from,f,p,m);o=e,e.parent=i,e.depth=a,i.optional??=[],i.optional.push(e)}break}case 2:{let t=r.substring(u,e[1]),s=r.substring(e[4],d),l=c&&!!(t||s),f=t?l?t:t.toLowerCase():void 0,p=s?l?s:s.toLowerCase():void 0,m=P(2,n.fullPath??n.from,l,f,p);o=m,m.parent=i,m.depth=a,i.wildcard??=[],i.wildcard.push(m)}}i=o}if(l&&n.children&&!n.isRoot&&n.id&&n.id.charCodeAt(n.id.lastIndexOf(`/`)+1)===95){let e=N(n.fullPath??n.from);e.kind=se,e.parent=i,a++,e.depth=a,i.pathless??=[],i.pathless.push(e),i=e}let u=(n.path||!n.children)&&!n.isRoot;if(u&&r.endsWith(`/`)){let e=N(n.fullPath??n.from);e.kind=k,e.parent=i,a++,e.depth=a,i.index=e,i=e}i.parse=l??null,i.priority=n.options?.params?.priority??0,u&&!i.route&&(i.route=n,i.fullPath=n.fullPath??n.from)}if(n.children)for(let r of n.children)A(e,t,r,s,i,a,o)}function j(e,t){if(e.parse&&!t.parse)return-1;if(!e.parse&&t.parse)return 1;if(e.parse&&t.parse&&(e.priority||t.priority))return t.priority-e.priority;if(e.prefix&&t.prefix&&e.prefix!==t.prefix){if(e.prefix.startsWith(t.prefix))return-1;if(t.prefix.startsWith(e.prefix))return 1}if(e.suffix&&t.suffix&&e.suffix!==t.suffix){if(e.suffix.endsWith(t.suffix))return-1;if(t.suffix.endsWith(e.suffix))return 1}return e.prefix&&!t.prefix?-1:!e.prefix&&t.prefix?1:e.suffix&&!t.suffix?-1:!e.suffix&&t.suffix?1:e.caseSensitive&&!t.caseSensitive?-1:!e.caseSensitive&&t.caseSensitive?1:0}function M(e){if(e.pathless)for(let t of e.pathless)M(t);if(e.static)for(let t of e.static.values())M(t);if(e.staticInsensitive)for(let t of e.staticInsensitive.values())M(t);if(e.dynamic?.length){e.dynamic.sort(j);for(let t of e.dynamic)M(t)}if(e.optional?.length){e.optional.sort(j);for(let t of e.optional)M(t)}if(e.wildcard?.length){e.wildcard.sort(j);for(let t of e.wildcard)M(t)}}function N(e){return{kind:0,depth:0,pathless:null,index:null,static:null,staticInsensitive:null,dynamic:null,optional:null,wildcard:null,route:null,fullPath:e,parent:null,parse:null,priority:0}}function P(e,t,n,r,i){return{kind:e,depth:0,pathless:null,index:null,static:null,staticInsensitive:null,dynamic:null,optional:null,wildcard:null,route:null,fullPath:t,parent:null,parse:null,priority:0,caseSensitive:n,prefix:r,suffix:i}}function ue(e,t){let n=N(`/`),r=new Uint16Array(6);for(let t of e)A(!1,r,t,1,n,0);M(n),t.masksTree=n,t.flatCache=O(1e3)}function de(e,t){e||=`/`;let n=t.flatCache.get(e);if(n)return n;let r=R(e,t.masksTree);return t.flatCache.set(e,r),r}function F(e,t,n,r,i){e||=`/`,r||=`/`;let a=t?`case\0${e}`:e,o=i.singleCache.get(a);return o||(o=N(`/`),A(t,new Uint16Array(6),{from:e},1,o,0),i.singleCache.set(a,o)),R(r,o,n)}function I(e,t,n=!1){let r=n?e:`nofuzz\0${e}`,i=t.matchCache.get(r);if(i!==void 0)return i;e||=`/`;let a;try{a=R(e,t.segmentTree,n)}catch(e){if(e instanceof URIError)a=null;else throw e}return a&&(a.branch=B(a.route)),t.matchCache.set(r,a),a}function fe(e){return e===`/`?e:e.replace(/\/{1,}$/,``)}function L(e,t=!1,n){let r=N(e.fullPath),i=new Uint16Array(6),a={},o={},s=0;return A(t,i,e,1,r,0,e=>{if(n?.(e,s),e.id in a&&oe(),a[e.id]=e,s!==0&&e.path){let t=fe(e.fullPath);(!o[t]||e.fullPath.endsWith(`/`))&&(o[t]=e)}s++}),M(r),{processedTree:{segmentTree:r,singleCache:O(1e3),matchCache:O(1e3),flatCache:null,masksTree:null},routesById:a,routesByPath:o}}function R(e,t,n=!1){let r=e.split(`/`),i=me(e,r,t,n);if(!i)return null;let[a]=z(e,r,i);return{route:i.node.route,rawParams:a}}function z(e,t,n){let r=pe(n.node),i=null,a=Object.create(null),o=n.extract?.part??0,s=n.extract?.node??0,c=n.extract?.path??0,l=n.extract?.segment??0;for(;s<r.length;o++,s++,c++,l++){let u=r[s];if(u.kind===k)break;if(u.kind===se){l--,o--,c--;continue}let d=t[o],f=c;if(d&&(c+=d.length),u.kind===1){i??=n.node.fullPath.split(`/`);let e=i[l],t=u.prefix?.length??0;if(e.charCodeAt(t)===123){let n=u.suffix?.length??0,r=e.substring(t+2,e.length-n-1),i=d.substring(t,d.length-n);a[r]=decodeURIComponent(i)}else{let t=e.substring(1);a[t]=decodeURIComponent(d)}}else if(u.kind===3){if(n.skipped&1<<s){o--,c=f-1;continue}i??=n.node.fullPath.split(`/`);let e=i[l],t=u.prefix?.length??0,r=u.suffix?.length??0,p=e.substring(t+3,e.length-r-1),m=u.suffix||u.prefix?d.substring(t,d.length-r):d;m&&(a[p]=decodeURIComponent(m))}else if(u.kind===2){let t=u,n=e.substring(f+(t.prefix?.length??0),e.length-(t.suffix?.length??0)),r=decodeURIComponent(n);a[`*`]=r,a._splat=r;break}}return n.rawParams&&Object.assign(a,n.rawParams),[a,{part:o,node:s,path:c,segment:l}]}function B(e){let t=[e];for(;e.parentRoute;)e=e.parentRoute,t.push(e);return t.reverse(),t}function pe(e){let t=Array(e.depth+1);do t[e.depth]=e,e=e.parent;while(e);return t}function me(e,t,n,r){if(e===`/`&&n.index)return{node:n.index,skipped:0};let i=!o(t),a=i&&e!==`/`,s=t.length-+!!i,c=[{node:n,index:1,skipped:0,depth:1,statics:0,dynamics:0,optionals:0}],l=null,u=null;for(;c.length;){let n=c.pop(),{node:i,index:o,skipped:d,depth:f,statics:p,dynamics:m,optionals:h}=n,{extract:g,rawParams:_}=n;if(i.kind===2&&i.route&&!W(u,n))continue;if(i.parse){if(!U(e,t,n))continue;_=n.rawParams,g=n.extract}r&&i.route&&i.kind!==k&&W(l,n)&&(l=n);let v=o===s;if(v&&(i.route&&(!a||i.kind===k||i.kind===2)&&W(u,n)&&(u=n),!i.optional&&!i.wildcard&&!i.index&&!i.pathless))continue;let y=v?void 0:t[o],b;if(v&&i.index){let n={node:i.index,index:o,skipped:d,depth:f+1,statics:p,dynamics:m,optionals:h,extract:g,rawParams:_},r=!0;if(i.index.parse&&(U(e,t,n)||(r=!1)),r){if(!m&&!h&&!d&&H(p,s))return n;W(u,n)&&(u=n)}}if(i.wildcard)for(let e=i.wildcard.length-1;e>=0;e--){let n=i.wildcard[e],{prefix:r,suffix:a}=n;if(!(r&&(v||!(n.caseSensitive?y:b??=y.toLowerCase()).startsWith(r)))){if(a){if(v)continue;let e=t.slice(o).join(`/`).slice(-a.length);if((n.caseSensitive?e:e.toLowerCase())!==a)continue}c.push({node:n,index:s,skipped:d,depth:f+1,statics:p,dynamics:m,optionals:h,extract:g,rawParams:_})}}if(i.optional){let e=d|1<<f,t=f+1;for(let n=i.optional.length-1;n>=0;n--){let r=i.optional[n];c.push({node:r,index:o,skipped:e,depth:t,statics:p,dynamics:m,optionals:h,extract:g,rawParams:_})}if(!v)for(let e=i.optional.length-1;e>=0;e--){let n=i.optional[e],{prefix:r,suffix:a}=n;if(r||a){let e=n.caseSensitive?y:b??=y.toLowerCase();if(r&&!e.startsWith(r)||a&&!e.endsWith(a))continue}c.push({node:n,index:o+1,skipped:d,depth:t,statics:p,dynamics:m,optionals:h+V(s,o),extract:g,rawParams:_})}}if(!v&&i.dynamic&&y)for(let e=i.dynamic.length-1;e>=0;e--){let t=i.dynamic[e],{prefix:n,suffix:r}=t;if(n||r){let e=t.caseSensitive?y:b??=y.toLowerCase();if(n&&!e.startsWith(n)||r&&!e.endsWith(r))continue}c.push({node:t,index:o+1,skipped:d,depth:f+1,statics:p,dynamics:m+V(s,o),optionals:h,extract:g,rawParams:_})}if(!v&&i.staticInsensitive){let e=i.staticInsensitive.get(b??=y.toLowerCase());e&&c.push({node:e,index:o+1,skipped:d,depth:f+1,statics:p+V(s,o),dynamics:m,optionals:h,extract:g,rawParams:_})}if(!v&&i.static){let e=i.static.get(y);e&&c.push({node:e,index:o+1,skipped:d,depth:f+1,statics:p+V(s,o),dynamics:m,optionals:h,extract:g,rawParams:_})}if(i.pathless){let e=f+1;for(let t=i.pathless.length-1;t>=0;t--){let n=i.pathless[t];c.push({node:n,index:o,skipped:d,depth:e,statics:p,dynamics:m,optionals:h,extract:g,rawParams:_})}}}if(u)return u;if(r&&l){let n=l.index;for(let e=0;e<l.index;e++)n+=t[e].length;let r=n===e.length?`/`:e.slice(n);return l.rawParams??=Object.create(null),l.rawParams[`**`]=decodeURIComponent(r),l}return null}function V(e,t){return 2**(e-t-1)}function H(e,t){return e===2**(t-1)-1}function U(e,t,n){let r,i;try{[r,i]=z(e,t,n)}catch{return null}if(n.rawParams=r,n.extract=i,!n.node.parse)return!0;try{if(n.node.parse(r)===!1)return null}catch{}return!0}function W(e,t){return e?t.statics>e.statics||t.statics===e.statics&&(t.dynamics>e.dynamics||t.dynamics===e.dynamics&&(t.optionals>e.optionals||t.optionals===e.optionals&&((t.node.kind===k)>(e.node.kind===k)||t.node.kind===k==(e.node.kind===k)&&t.depth>e.depth))):!0}function G(e){return K(e.filter(e=>e!==void 0).join(`/`))}function K(e){return e.replace(/\/{2,}/g,`/`)}function he(e){return e===`/`?e:e.replace(/^\/{1,}/,``)}function q(e){let t=e.length;return t>1&&e[t-1]===`/`?e.replace(/\/{1,}$/,``):e}function ge(e){return q(he(e))}function J(e,t){return e?.endsWith(`/`)&&e!==`/`&&e!==`${t}/`?e.slice(0,-1):e}function _e(e,t,n){return J(e,n)===J(t,n)}function ve({base:e,to:t,trailingSlash:n=`never`,cache:r}){let i=t.startsWith(`/`),a=!i&&t===`.`,s;if(r){s=i?t:a?e:e+`\0`+t;let n=r.get(s);if(n)return n}let c;if(a)c=e.split(`/`);else if(i)c=t.split(`/`);else{for(c=e.split(`/`);c.length>1&&o(c)===``;)c.pop();let n=t.split(`/`);for(let e=0,t=n.length;e<t;e++){let r=n[e];r===``?e?e===t-1&&c.push(r):c=[r]:r===`..`?c.pop():r===`.`||c.push(r)}}c.length>1&&(o(c)===``?n===`never`&&c.pop():n===`always`&&c.push(``));let l=K(c.join(`/`))||`/`;return s&&r&&r.set(s,l),l}function ye(e){let t=new Map(e.map(e=>[encodeURIComponent(e),e])),n=Array.from(t.keys()).map(e=>e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)).join(`|`),r=new RegExp(n,`g`);return e=>e.replace(r,e=>t.get(e)??e)}function be(e,t,n){let r=t[e];return typeof r==`string`?e===`_splat`?/^[a-zA-Z0-9\-._~!/]*$/.test(r)?r:r.split(`/`).map(e=>Se(e,n)).join(`/`):Se(r,n):r}function xe({path:e,params:t,decoder:n,...r}){let i=!1,a=Object.create(null);if(!e||e===`/`)return{interpolatedPath:`/`,usedParams:a,isMissingParams:i};if(!e.includes(`$`))return{interpolatedPath:e,usedParams:a,isMissingParams:i};let o=e.length,s=0,c,l=``;for(;s<o;){let r=s;c=le(e,r,c);let o=c[5];if(s=o+1,r===o)continue;let u=c[0];if(u===0){l+=`/`+e.substring(r,o);continue}if(u===2){let s=t._splat;a._splat=s,a[`*`]=s;let u=e.substring(r,c[1]),d=e.substring(c[4],o);if(!s){i=!0,(u||d)&&(l+=`/`+u+d);continue}let f=be(`_splat`,t,n);l+=`/`+u+f+d;continue}if(u===1){let s=e.substring(c[2],c[3]);!i&&!(s in t)&&(i=!0),a[s]=t[s];let u=e.substring(r,c[1]),d=e.substring(c[4],o),f=be(s,t,n)??`undefined`;l+=`/`+u+f+d;continue}if(u===3){let i=e.substring(c[2],c[3]),s=t[i];if(s==null)continue;a[i]=s;let u=e.substring(r,c[1]),d=e.substring(c[4],o),f=be(i,t,n)??``;l+=`/`+u+f+d;continue}}return e.endsWith(`/`)&&(l+=`/`),{usedParams:a,interpolatedPath:l||`/`,isMissingParams:i}}function Se(e,t){let n=encodeURIComponent(e);return t?.(n)??n}function Ce(e){return e?.isNotFound===!0}var Y=`__root__`;function we(e){if(e.statusCode=e.statusCode||e.code||307,!e._builtLocation&&!e.reloadDocument&&typeof e.href==`string`)try{new URL(e.href),e.reloadDocument=!0}catch{}let t=new Headers(e.headers);e.href&&t.get(`Location`)===null&&t.set(`Location`,e.href);let n=new Response(null,{status:e.statusCode,headers:t});if(n.options=e,e.throw)throw n;return n}function Te(e){return e instanceof Response&&!!e.options}function Ee(e){if(typeof e==`object`&&e&&e.isSerializedRedirect)return we(e)}var De=`Error preloading route! ☝️`,Oe=class{get to(){return this._to}get id(){return this._id}get path(){return this._path}get fullPath(){return this._fullPath}constructor(e){if(this.init=e=>{this.originalIndex=e.originalIndex;let t=this.options,n=!t?.path&&!t?.id;this.parentRoute=this.options.getParentRoute?.(),n?this._path=Y:this.parentRoute||oe();let r=n?Y:t?.path;r&&r!==`/`&&(r=he(r));let i=t?.id||r,a=n?Y:G([this.parentRoute.id===`__root__`?``:this.parentRoute.id,i]);r===`__root__`&&(r=`/`),a!==`__root__`&&(a=G([`/`,a]));let o=a===`__root__`?`/`:G([this.parentRoute.fullPath,r]);this._path=r,this._id=a,this._fullPath=o,this._to=q(o)},this.addChildren=e=>this._addFileChildren(e),this._addFileChildren=e=>(Array.isArray(e)&&(this.children=e),typeof e==`object`&&e&&(this.children=Object.values(e)),this),this._addFileTypes=()=>this,this.updateLoader=e=>(Object.assign(this.options,e),this),this.update=e=>(Object.assign(this.options,e),this),this.lazy=e=>(this.lazyFn=e,this),this.redirect=e=>we({from:this.fullPath,...e}),this.options=e||{},this.isRoot=!e?.getParentRoute,e?.id&&e?.path)throw Error(`Route cannot have both an 'id' and a 'path' option.`)}},ke=class extends Oe{constructor(e){super(e)}},X=t(r(),1),Ae=X.use,je=typeof window<`u`?X.useLayoutEffect:X.useEffect;function Me(e){let t=X.useRef({value:e,prev:null}),n=t.current.value;return e!==n&&(t.current={value:e,prev:n}),t.current.prev}function Ne(e,t,n={},r={}){X.useEffect(()=>{if(!e.current||r.disabled||typeof IntersectionObserver!=`function`)return;let i=new IntersectionObserver(([e])=>{t(e)},n);return i.observe(e.current),()=>{i.disconnect()}},[t,n,r.disabled,e])}function Pe(e){let t=X.useRef(null);return X.useImperativeHandle(e,()=>t.current,[]),t}var Fe=n();function Ie({children:e,fallback:t=null}){return Le()?(0,Fe.jsx)(X.Fragment,{children:e}):(0,Fe.jsx)(X.Fragment,{children:t})}function Le(){return X.useSyncExternalStore(Re,()=>!0,()=>!1)}function Re(){return()=>{}}var ze=X.createContext(null);function Be(e){return X.useContext(ze)}var Ve=X.createContext(void 0),He=X.createContext(void 0),Ue=e((e=>{var t=r();function n(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var i=typeof Object.is==`function`?Object.is:n,a=t.useState,o=t.useEffect,s=t.useLayoutEffect,c=t.useDebugValue;function l(e,t){var n=t(),r=a({inst:{value:n,getSnapshot:t}}),i=r[0].inst,l=r[1];return s(function(){i.value=n,i.getSnapshot=t,u(i)&&l({inst:i})},[e,n,t]),o(function(){return u(i)&&l({inst:i}),e(function(){u(i)&&l({inst:i})})},[e]),c(n),n}function u(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!i(e,n)}catch{return!0}}function d(e,t){return t()}var f=typeof window>`u`||window.document===void 0||window.document.createElement===void 0?d:l;e.useSyncExternalStore=t.useSyncExternalStore===void 0?f:t.useSyncExternalStore})),We=e(((e,t)=>{t.exports=Ue()})),Ge=e((e=>{var t=r(),n=We();function i(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var a=typeof Object.is==`function`?Object.is:i,o=n.useSyncExternalStore,s=t.useRef,c=t.useEffect,l=t.useMemo,u=t.useDebugValue;e.useSyncExternalStoreWithSelector=function(e,t,n,r,i){var d=s(null);if(d.current===null){var f={hasValue:!1,value:null};d.current=f}else f=d.current;d=l(function(){function e(e){if(!o){if(o=!0,s=e,e=r(e),i!==void 0&&f.hasValue){var t=f.value;if(i(t,e))return c=t}return c=e}if(t=c,a(s,e))return t;var n=r(e);return i!==void 0&&i(t,n)?(s=e,t):(s=e,c=n)}var o=!1,s,c,l=n===void 0?null:n;return[function(){return e(t())},l===null?void 0:function(){return e(l())}]},[t,n,r,i]);var p=o(e,d[0],d[1]);return c(function(){f.hasValue=!0,f.value=p},[p]),u(p),p}})),Ke=e(((e,t)=>{t.exports=Ge()})),qe=t(Ke(),1);function Je(e,t){return e===t}function Ye(e,t,n=Je){let r=(0,X.useCallback)(t=>{if(!e)return()=>{};let{unsubscribe:n}=e.subscribe(t);return n},[e]),i=(0,X.useCallback)(()=>e?.get(),[e]);return(0,qe.useSyncExternalStoreWithSelector)(r,i,i,t,n)}var Xe={get(){},subscribe(){return{unsubscribe(){}}}};function Ze(e,t){let n=X.useRef();return r=>{let i=e?.select?e.select(r):r;return e?.structuralSharing??t.options.defaultStructuralSharing?n.current=m(n.current,i):i}}function Z(e){let t=Be(),n=X.useContext(e.from?He:Ve),r=e.from?t.stores.getRouteMatchStore(e.from):t.stores.matchStores.get(n),i=Ze(e,t),a=Ye(r??Xe,e=>e?i(e):Xe);if(a!==Xe)return a;(e.shouldThrow??!0)&&oe()}function Qe(e){return Z({from:e.from,strict:e.strict,structuralSharing:e.structuralSharing,select:t=>e.select?e.select(t.loaderData):t.loaderData})}function $e(e){let{select:t,...n}=e;return Z({...n,select:e=>t?t(e.loaderDeps):e.loaderDeps})}function et(e){return Z({from:e.from,shouldThrow:e.shouldThrow,structuralSharing:e.structuralSharing,strict:e.strict,select:t=>{let n=e.strict===!1?t.params:t._strictParams;return e.select?e.select(n):n}})}function tt(e){return Z({from:e.from,strict:e.strict,shouldThrow:e.shouldThrow,structuralSharing:e.structuralSharing,select:t=>e.select?e.select(t.search):t.search})}function nt(e){let t=Be();return X.useCallback(n=>t.navigate({...n,from:n.from??e?.from}),[e?.from,t])}function rt(e){return Z({...e,select:t=>e.select?e.select(t.context):t.context})}var it=a();function at(e,t){let n=Be(),r=Pe(t),{activeProps:i,inactiveProps:a,activeOptions:o,to:s,preload:l,preloadDelay:u,preloadIntentProximity:d,hashScrollIntoView:f,replace:p,startTransition:m,resetScroll:h,viewTransition:g,children:_,target:v,disabled:b,style:x,className:S,onClick:C,onBlur:w,onFocus:T,onMouseEnter:E,onMouseLeave:D,onTouchStart:te,ignoreBlocker:ne,params:re,search:ie,hash:ae,state:oe,mask:O,reloadDocument:k,unsafeRelative:se,from:ce,_fromLocation:le,...A}=e,j=Le(),M=X.useMemo(()=>e,[n,e.from,e._fromLocation,e.hash,e.to,e.search,e.params,e.state,e.mask,e.unsafeRelative]),N=Ye(n.stores.location,e=>e,(e,t)=>e.href===t.href),P=X.useMemo(()=>{let e={_fromLocation:N,...M};return n.buildLocation(e)},[n,N,M]),ue=P.maskedLocation?P.maskedLocation.publicHref:P.publicHref,de=P.maskedLocation?P.maskedLocation.external:P.external,F=X.useMemo(()=>ft(ue,de,n.history,b),[b,de,ue,n.history]),I=X.useMemo(()=>{if(F?.external)return ee(F.href,n.protocolAllowlist)?void 0:F.href;if(!pt(s)&&!(typeof s!=`string`||s.indexOf(`:`)===-1))try{return new URL(s),ee(s,n.protocolAllowlist)?void 0:s}catch{}},[s,F,n.protocolAllowlist]),fe=X.useMemo(()=>{if(I)return!1;if(o?.exact){if(!_e(N.pathname,P.pathname,n.basepath))return!1}else{let e=J(N.pathname,n.basepath),t=J(P.pathname,n.basepath);if(!(e.startsWith(t)&&(e.length===t.length||e[t.length]===`/`)))return!1}return(o?.includeSearch??!0)&&!y(N.search,P.search,{partial:!o?.exact,ignoreUndefined:!o?.explicitUndefined})?!1:o?.includeHash?j&&N.hash===P.hash:!0},[o?.exact,o?.explicitUndefined,o?.includeHash,o?.includeSearch,N,I,j,P.hash,P.pathname,P.search,n.basepath]),L=fe?c(i,{})??st:ot,R=fe?ot:c(a,{})??ot,z=[S,L.className,R.className].filter(Boolean).join(` `),B=(x||L.style||R.style)&&{...x,...L.style,...R.style},[pe,me]=X.useState(!1),V=X.useRef(!1),H=e.reloadDocument||I?!1:l??n.options.defaultPreload,U=u??n.options.defaultPreloadDelay??0,W=X.useCallback(()=>{n.preloadRoute({...M,_builtLocation:P}).catch(e=>{console.warn(e),console.warn(De)})},[n,M,P]);Ne(r,X.useCallback(e=>{e?.isIntersecting&&W()},[W]),dt,{disabled:!!b||H!==`viewport`}),X.useEffect(()=>{V.current||!b&&H===`render`&&(W(),V.current=!0)},[b,W,H]);let G=e=>{let t=e.currentTarget.getAttribute(`target`),r=v===void 0?t:v;if(!b&&!ht(e)&&!e.defaultPrevented&&(!r||r===`_self`)&&e.button===0){e.preventDefault(),(0,it.flushSync)(()=>{me(!0)});let t=n.subscribe(`onResolved`,()=>{t(),me(!1)});n.navigate({...M,replace:p,resetScroll:h,hashScrollIntoView:f,startTransition:m,viewTransition:g,ignoreBlocker:ne})}};if(I)return{...A,ref:r,href:I,..._&&{children:_},...v&&{target:v},...b&&{disabled:b},...x&&{style:x},...S&&{className:S},...C&&{onClick:C},...w&&{onBlur:w},...T&&{onFocus:T},...E&&{onMouseEnter:E},...D&&{onMouseLeave:D},...te&&{onTouchStart:te}};let K=e=>{if(b||H!==`intent`)return;if(!U){W();return}let t=e.currentTarget;if(Q.has(t))return;let n=setTimeout(()=>{Q.delete(t),W()},U);Q.set(t,n)},he=e=>{b||H!==`intent`||W()},q=e=>{if(b||!H||!U)return;let t=e.currentTarget,n=Q.get(t);n&&(clearTimeout(n),Q.delete(t))};return{...A,...L,...R,href:F?.href,ref:r,onClick:$([C,G]),onBlur:$([w,q]),onFocus:$([T,K]),onMouseEnter:$([E,K]),onMouseLeave:$([D,q]),onTouchStart:$([te,he]),disabled:!!b,target:v,...B&&{style:B},...z&&{className:z},...b&&ct,...fe&<,...j&&pe&&ut}}var ot={},st={className:`active`},ct={role:`link`,"aria-disabled":!0},lt={"data-status":`active`,"aria-current":`page`},ut={"data-transitioning":`transitioning`},Q=new WeakMap,dt={rootMargin:`100px`},$=e=>t=>{for(let n of e)if(n){if(t.defaultPrevented)return;n(t)}};function ft(e,t,n,r){if(!r)return t?{href:e,external:!0}:{href:n.createHref(e)||`/`,external:!1}}function pt(e){if(typeof e!=`string`)return!1;let t=e.charCodeAt(0);return t===47?e.charCodeAt(1)!==47:t===46}var mt=X.forwardRef((e,t)=>{let{_asChild:n,...r}=e,{type:i,...a}=at(r,t),o=typeof r.children==`function`?r.children({isActive:a[`data-status`]===`active`}):r.children;if(!n){let{disabled:e,...t}=a;return X.createElement(`a`,t,o)}return X.createElement(n,a,o)});function ht(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}var gt=class extends Oe{constructor(e){super(e),this.useMatch=e=>Z({select:e?.select,from:this.id,structuralSharing:e?.structuralSharing}),this.useRouteContext=e=>rt({...e,from:this.id}),this.useSearch=e=>tt({select:e?.select,structuralSharing:e?.structuralSharing,from:this.id}),this.useParams=e=>et({select:e?.select,structuralSharing:e?.structuralSharing,from:this.id}),this.useLoaderDeps=e=>$e({...e,from:this.id}),this.useLoaderData=e=>Qe({...e,from:this.id}),this.useNavigate=()=>nt({from:this.fullPath}),this.Link=X.forwardRef((e,t)=>(0,Fe.jsx)(mt,{ref:t,from:this.fullPath,...e}))}};function _t(e){return new gt(e)}var vt=class extends ke{constructor(e){super(e),this.useMatch=e=>Z({select:e?.select,from:this.id,structuralSharing:e?.structuralSharing}),this.useRouteContext=e=>rt({...e,from:this.id}),this.useSearch=e=>tt({select:e?.select,structuralSharing:e?.structuralSharing,from:this.id}),this.useParams=e=>et({select:e?.select,structuralSharing:e?.structuralSharing,from:this.id}),this.useLoaderDeps=e=>$e({...e,from:this.id}),this.useLoaderData=e=>Qe({...e,from:this.id}),this.useNavigate=()=>nt({from:this.fullPath}),this.Link=X.forwardRef((e,t)=>(0,Fe.jsx)(mt,{ref:t,from:this.fullPath,...e}))}};function yt(e){return new vt(e)}function bt(e){return new xt(e,{silent:!0}).createRoute}var xt=class{constructor(e,t){this.path=e,this.createRoute=e=>{let t=_t(e);return t.isRoot=!1,t},this.silent=t?.silent}};function St(e,t){let n,r,i,a,o=()=>(n||=e().then(e=>{n=void 0,r=e[t??`default`]}).catch(e=>{if(i=e,x(i)&&i instanceof Error&&typeof window<`u`&&typeof sessionStorage<`u`){let e=`tanstack_router_reload:${i.message}`;sessionStorage.getItem(e)||(sessionStorage.setItem(e,`1`),a=!0)}}),n),s=function(e){if(a)throw window.location.reload(),new Promise(()=>{});if(i)throw i;if(!r)if(Ae)Ae(o());else throw o();return X.createElement(r,e)};return s.preload=o,s}var Ct=`modulepreload`,wt=function(e){return`/`+e},Tt={},Et=function(e,t,n){let r=Promise.resolve();if(t&&t.length>0){let e=document.getElementsByTagName(`link`),i=document.querySelector(`meta[property=csp-nonce]`),a=i?.nonce||i?.getAttribute(`nonce`);function o(e){return Promise.all(e.map(e=>Promise.resolve(e).then(e=>({status:`fulfilled`,value:e}),e=>({status:`rejected`,reason:e}))))}r=o(t.map(t=>{if(t=wt(t,n),t in Tt)return;Tt[t]=!0;let r=t.endsWith(`.css`),i=r?`[rel="stylesheet"]`:``;if(n)for(let n=e.length-1;n>=0;n--){let i=e[n];if(i.href===t&&(!r||i.rel===`stylesheet`))return}else if(document.querySelector(`link[href="${t}"]${i}`))return;let o=document.createElement(`link`);if(o.rel=r?`stylesheet`:Ct,r||(o.as=`script`),o.crossOrigin=``,o.href=t,a&&o.setAttribute(`nonce`,a),document.head.appendChild(o),r)return new Promise((e,n)=>{o.addEventListener(`load`,e),o.addEventListener(`error`,()=>n(Error(`Unable to preload CSS for ${t}`)))})}))}function i(e){let t=new Event(`vite:preloadError`,{cancelable:!0});if(t.payload=e,window.dispatchEvent(t),!t.defaultPrevented)throw e}return r.then(t=>{for(let e of t||[])e.status===`rejected`&&i(e.reason);return e().catch(i)})};export{B as A,b as B,K as C,ve as D,G as E,L as F,c as G,y as H,O as I,S as J,d as K,oe as L,I as M,F as N,ge as O,ue as P,a as Q,E as R,Ce as S,xe as T,ie as U,re as V,ne as W,p as X,o as Y,m as Z,Me as _,mt as a,we as b,Ye as c,Be as d,ze as f,je as g,Ae as h,yt as i,de as j,q as k,Ke as l,Le as m,St as n,nt as o,Ie as p,ee as q,bt as r,Ze as s,Et as t,Ve as u,Te as v,ye as w,Y as x,Ee as y,ae as z};
|
|
1
|
+
import{n as e,r as t,t as n}from"./jsx-runtime-DGeXAQPT.js";import{t as r}from"./react-3W8R1pOO.js";var i=e((e=>{var t=r();function n(e){var t=`https://react.dev/errors/`+e;if(1<arguments.length){t+=`?args[]=`+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+=`&args[]=`+encodeURIComponent(arguments[n])}return`Minified React error #`+e+`; visit `+t+` for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`}function i(){}var a={d:{f:i,r:function(){throw Error(n(522))},D:i,C:i,L:i,m:i,X:i,S:i,M:i},p:0,findDOMNode:null},o=Symbol.for(`react.portal`);function s(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:o,key:r==null?null:``+r,children:e,containerInfo:t,implementation:n}}var c=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function l(e,t){if(e===`font`)return``;if(typeof t==`string`)return t===`use-credentials`?t:``}e.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=a,e.createPortal=function(e,t){var r=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)throw Error(n(299));return s(e,t,null,r)},e.flushSync=function(e){var t=c.T,n=a.p;try{if(c.T=null,a.p=2,e)return e()}finally{c.T=t,a.p=n,a.d.f()}},e.preconnect=function(e,t){typeof e==`string`&&(t?(t=t.crossOrigin,t=typeof t==`string`?t===`use-credentials`?t:``:void 0):t=null,a.d.C(e,t))},e.prefetchDNS=function(e){typeof e==`string`&&a.d.D(e)},e.preinit=function(e,t){if(typeof e==`string`&&t&&typeof t.as==`string`){var n=t.as,r=l(n,t.crossOrigin),i=typeof t.integrity==`string`?t.integrity:void 0,o=typeof t.fetchPriority==`string`?t.fetchPriority:void 0;n===`style`?a.d.S(e,typeof t.precedence==`string`?t.precedence:void 0,{crossOrigin:r,integrity:i,fetchPriority:o}):n===`script`&&a.d.X(e,{crossOrigin:r,integrity:i,fetchPriority:o,nonce:typeof t.nonce==`string`?t.nonce:void 0})}},e.preinitModule=function(e,t){if(typeof e==`string`)if(typeof t==`object`&&t){if(t.as==null||t.as===`script`){var n=l(t.as,t.crossOrigin);a.d.M(e,{crossOrigin:n,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0})}}else t??a.d.M(e)},e.preload=function(e,t){if(typeof e==`string`&&typeof t==`object`&&t&&typeof t.as==`string`){var n=t.as,r=l(n,t.crossOrigin);a.d.L(e,n,{crossOrigin:r,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0,type:typeof t.type==`string`?t.type:void 0,fetchPriority:typeof t.fetchPriority==`string`?t.fetchPriority:void 0,referrerPolicy:typeof t.referrerPolicy==`string`?t.referrerPolicy:void 0,imageSrcSet:typeof t.imageSrcSet==`string`?t.imageSrcSet:void 0,imageSizes:typeof t.imageSizes==`string`?t.imageSizes:void 0,media:typeof t.media==`string`?t.media:void 0})}},e.preloadModule=function(e,t){if(typeof e==`string`)if(t){var n=l(t.as,t.crossOrigin);a.d.m(e,{as:typeof t.as==`string`&&t.as!==`script`?t.as:void 0,crossOrigin:n,integrity:typeof t.integrity==`string`?t.integrity:void 0})}else a.d.m(e)},e.requestFormReset=function(e){a.d.r(e)},e.unstable_batchedUpdates=function(e,t){return e(t)},e.useFormState=function(e,t,n){return c.H.useFormState(e,t,n)},e.useFormStatus=function(){return c.H.useHostTransitionStatus()},e.version=`19.2.7`})),a=e(((e,t)=>{function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>`u`||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!=`function`))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}n(),t.exports=i()}));function o(e){return e[e.length-1]}function s(e){return typeof e==`function`}function c(e,t){return s(e)?e(t):e}var l=Object.prototype.hasOwnProperty,u=Object.prototype.propertyIsEnumerable;function d(e){for(let t in e)if(l.call(e,t))return!0;return!1}var f=()=>Object.create(null),p=(e,t)=>m(e,t,f);function m(e,t,n=()=>({}),r=0){if(e===t)return e;if(r>500)return t;let i=t,a=v(e)&&v(i);if(!a&&!(g(e)&&g(i)))return i;let o=a?e:h(e);if(!o)return i;let s=a?i:h(i);if(!s)return i;let c=o.length,u=s.length,d=a?Array(u):n(),f=0;for(let t=0;t<u;t++){let o=a?t:s[t],u=e[o],p=i[o];if(u===p){d[o]=u,(a?t<c:l.call(e,o))&&f++;continue}if(u===null||p===null||typeof u!=`object`||typeof p!=`object`){d[o]=p;continue}let h=m(u,p,n,r+1);d[o]=h,h===u&&f++}return c===u&&f===c?e:d}function h(e){let t=Object.getOwnPropertyNames(e);for(let n of t)if(!u.call(e,n))return!1;let n=Object.getOwnPropertySymbols(e);if(n.length===0)return t;let r=t;for(let t of n){if(!u.call(e,t))return!1;r.push(t)}return r}function g(e){if(!_(e))return!1;let t=e.constructor;if(t===void 0)return!0;let n=t.prototype;return!(!_(n)||!n.hasOwnProperty(`isPrototypeOf`))}function _(e){return Object.prototype.toString.call(e)===`[object Object]`}function v(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function y(e,t,n){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return!1;for(let r=0,i=e.length;r<i;r++)if(!y(e[r],t[r],n))return!1;return!0}if(g(e)&&g(t)){let r=n?.ignoreUndefined??!0;if(n?.partial){for(let i in t)if((!r||t[i]!==void 0)&&!y(e[i],t[i],n))return!1;return!0}let i=0;if(!r)i=Object.keys(e).length;else for(let t in e)e[t]!==void 0&&i++;let a=0;for(let o in t)if((!r||t[o]!==void 0)&&(a++,a>i||!y(e[o],t[o],n)))return!1;return i===a}return!1}function b(e){let t,n,r=new Promise((e,r)=>{t=e,n=r});return r.status=`pending`,r.resolve=n=>{r.status=`resolved`,r.value=n,t(n),e?.(n)},r.reject=e=>{r.status=`rejected`,n(e)},r}function x(e){return typeof e?.message==`string`?e.message.startsWith(`Failed to fetch dynamically imported module`)||e.message.startsWith(`error loading dynamically imported module`)||e.message.startsWith(`Importing a module script failed`):!1}function S(e){return!!(e&&typeof e==`object`&&typeof e.then==`function`)}var C=/[\x00-\x1f\x7f"<>`{}]/g;function w(e){return e.replace(C,e=>`%`+e.charCodeAt(0).toString(16).toUpperCase().padStart(2,`0`))}function T(e){let t;try{t=decodeURI(e)}catch{t=e.replaceAll(/%[0-9A-F]{2}/gi,e=>{try{return decodeURI(e)}catch{return e}})}return w(t)}var E=[`http:`,`https:`,`mailto:`,`tel:`];function ee(e,t){if(!e)return!1;try{let n=new URL(e);return!t.has(n.protocol)}catch{return!1}}var D={"&":`\\u0026`,">":`\\u003e`,"<":`\\u003c`,"\u2028":`\\u2028`,"\u2029":`\\u2029`},te=/[&><\u2028\u2029]/g;function ne(e){return e.replace(te,e=>D[e])}function re(e){if(!e||!/[%\\\x00-\x1f\x7f]/.test(e)&&!e.startsWith(`//`))return{path:e,handledProtocolRelativeURL:!1};let t=/%25|%5C/gi,n=0,r=``,i;for(;(i=t.exec(e))!==null;)r+=T(e.slice(n,i.index))+i[0],n=t.lastIndex;r+=T(n?e.slice(n):e);let a=!1;return r.startsWith(`//`)&&(a=!0,r=`/`+r.replace(/^\/+/,``)),{path:r,handledProtocolRelativeURL:a}}function ie(e){return/\s|[^\u0000-\u007F]/.test(e)?e.replace(/\s|[^\u0000-\u007F]/gu,encodeURIComponent):e}function ae(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}function oe(){throw Error(`Invariant failed`)}function O(e){let t=new Map,n,r,i=e=>{e.next&&(e.prev?(e.prev.next=e.next,e.next.prev=e.prev,e.next=void 0,r&&(r.next=e,e.prev=r)):(e.next.prev=void 0,n=e.next,e.next=void 0,r&&(e.prev=r,r.next=e)),r=e)};return{get(e){let n=t.get(e);if(n)return i(n),n.value},set(a,o){if(t.size>=e&&n){let e=n;t.delete(e.key),e.next&&(n=e.next,e.next.prev=void 0),e===r&&(r=void 0)}let s=t.get(a);if(s)s.value=o,i(s);else{let e={key:a,value:o,prev:r};r&&(r.next=e),r=e,n||=e,t.set(a,e)}},clear(){t.clear(),n=void 0,r=void 0}}}var k=4,se=5;function ce(e){let t=e.indexOf(`{`);if(t===-1)return null;let n=e.indexOf(`}`,t);return n===-1||t+1>=e.length?null:[t,n]}function le(e,t,n=new Uint16Array(6)){let r=e.indexOf(`/`,t),i=r===-1?e.length:r,a=e.substring(t,i);if(!a||!a.includes(`$`))return n[0]=0,n[1]=t,n[2]=t,n[3]=i,n[4]=i,n[5]=i,n;if(a===`$`){let r=e.length;return n[0]=2,n[1]=t,n[2]=t,n[3]=r,n[4]=r,n[5]=r,n}if(a.charCodeAt(0)===36)return n[0]=1,n[1]=t,n[2]=t+1,n[3]=i,n[4]=i,n[5]=i,n;let o=ce(a);if(o){let[r,s]=o,c=a.charCodeAt(r+1);if(c===45){if(r+2<a.length&&a.charCodeAt(r+2)===36){let e=r+3,a=s;if(e<a)return n[0]=3,n[1]=t+r,n[2]=t+e,n[3]=t+a,n[4]=t+s+1,n[5]=i,n}}else if(c===36){let a=r+1,o=r+2;return o===s?(n[0]=2,n[1]=t+r,n[2]=t+a,n[3]=t+o,n[4]=t+s+1,n[5]=e.length,n):(n[0]=1,n[1]=t+r,n[2]=t+o,n[3]=t+s,n[4]=t+s+1,n[5]=i,n)}}return n[0]=0,n[1]=t,n[2]=t,n[3]=i,n[4]=i,n[5]=i,n}function A(e,t,n,r,i,a,o){o?.(n);let s=r;{let r=n.fullPath??n.from,o=r.length,c=n.options?.caseSensitive??e,l=n.options?.params?.parse??n.options?.parseParams;for(;s<o;){let e=le(r,s,t),o,u=s,d=e[5];switch(s=d+1,a++,e[0]){case 0:{let t=r.substring(e[2],e[3]);if(c){let e=i.static?.get(t);if(e)o=e;else{i.static??=new Map;let e=N(n.fullPath??n.from);e.parent=i,e.depth=a,o=e,i.static.set(t,e)}}else{let e=t.toLowerCase(),r=i.staticInsensitive?.get(e);if(r)o=r;else{i.staticInsensitive??=new Map;let t=N(n.fullPath??n.from);t.parent=i,t.depth=a,o=t,i.staticInsensitive.set(e,t)}}break}case 1:{let t=r.substring(u,e[1]),s=r.substring(e[4],d),f=c&&!!(t||s),p=t?f?t:t.toLowerCase():void 0,m=s?f?s:s.toLowerCase():void 0,h=!l&&i.dynamic?.find(e=>!e.parse&&e.caseSensitive===f&&e.prefix===p&&e.suffix===m);if(h)o=h;else{let e=P(1,n.fullPath??n.from,f,p,m);o=e,e.depth=a,e.parent=i,i.dynamic??=[],i.dynamic.push(e)}break}case 3:{let t=r.substring(u,e[1]),s=r.substring(e[4],d),f=c&&!!(t||s),p=t?f?t:t.toLowerCase():void 0,m=s?f?s:s.toLowerCase():void 0,h=!l&&i.optional?.find(e=>!e.parse&&e.caseSensitive===f&&e.prefix===p&&e.suffix===m);if(h)o=h;else{let e=P(3,n.fullPath??n.from,f,p,m);o=e,e.parent=i,e.depth=a,i.optional??=[],i.optional.push(e)}break}case 2:{let t=r.substring(u,e[1]),s=r.substring(e[4],d),l=c&&!!(t||s),f=t?l?t:t.toLowerCase():void 0,p=s?l?s:s.toLowerCase():void 0,m=P(2,n.fullPath??n.from,l,f,p);o=m,m.parent=i,m.depth=a,i.wildcard??=[],i.wildcard.push(m)}}i=o}if(l&&n.children&&!n.isRoot&&n.id&&n.id.charCodeAt(n.id.lastIndexOf(`/`)+1)===95){let e=N(n.fullPath??n.from);e.kind=se,e.parent=i,a++,e.depth=a,i.pathless??=[],i.pathless.push(e),i=e}let u=(n.path||!n.children)&&!n.isRoot;if(u&&r.endsWith(`/`)){let e=N(n.fullPath??n.from);e.kind=k,e.parent=i,a++,e.depth=a,i.index=e,i=e}i.parse=l??null,i.priority=n.options?.params?.priority??0,u&&!i.route&&(i.route=n,i.fullPath=n.fullPath??n.from)}if(n.children)for(let r of n.children)A(e,t,r,s,i,a,o)}function j(e,t){if(e.parse&&!t.parse)return-1;if(!e.parse&&t.parse)return 1;if(e.parse&&t.parse&&(e.priority||t.priority))return t.priority-e.priority;if(e.prefix&&t.prefix&&e.prefix!==t.prefix){if(e.prefix.startsWith(t.prefix))return-1;if(t.prefix.startsWith(e.prefix))return 1}if(e.suffix&&t.suffix&&e.suffix!==t.suffix){if(e.suffix.endsWith(t.suffix))return-1;if(t.suffix.endsWith(e.suffix))return 1}return e.prefix&&!t.prefix?-1:!e.prefix&&t.prefix?1:e.suffix&&!t.suffix?-1:!e.suffix&&t.suffix?1:e.caseSensitive&&!t.caseSensitive?-1:!e.caseSensitive&&t.caseSensitive?1:0}function M(e){if(e.pathless)for(let t of e.pathless)M(t);if(e.static)for(let t of e.static.values())M(t);if(e.staticInsensitive)for(let t of e.staticInsensitive.values())M(t);if(e.dynamic?.length){e.dynamic.sort(j);for(let t of e.dynamic)M(t)}if(e.optional?.length){e.optional.sort(j);for(let t of e.optional)M(t)}if(e.wildcard?.length){e.wildcard.sort(j);for(let t of e.wildcard)M(t)}}function N(e){return{kind:0,depth:0,pathless:null,index:null,static:null,staticInsensitive:null,dynamic:null,optional:null,wildcard:null,route:null,fullPath:e,parent:null,parse:null,priority:0}}function P(e,t,n,r,i){return{kind:e,depth:0,pathless:null,index:null,static:null,staticInsensitive:null,dynamic:null,optional:null,wildcard:null,route:null,fullPath:t,parent:null,parse:null,priority:0,caseSensitive:n,prefix:r,suffix:i}}function ue(e,t){let n=N(`/`),r=new Uint16Array(6);for(let t of e)A(!1,r,t,1,n,0);M(n),t.masksTree=n,t.flatCache=O(1e3)}function de(e,t){e||=`/`;let n=t.flatCache.get(e);if(n)return n;let r=R(e,t.masksTree);return t.flatCache.set(e,r),r}function F(e,t,n,r,i){e||=`/`,r||=`/`;let a=t?`case\0${e}`:e,o=i.singleCache.get(a);return o||(o=N(`/`),A(t,new Uint16Array(6),{from:e},1,o,0),i.singleCache.set(a,o)),R(r,o,n)}function I(e,t,n=!1){let r=n?e:`nofuzz\0${e}`,i=t.matchCache.get(r);if(i!==void 0)return i;e||=`/`;let a;try{a=R(e,t.segmentTree,n)}catch(e){if(e instanceof URIError)a=null;else throw e}return a&&(a.branch=B(a.route)),t.matchCache.set(r,a),a}function fe(e){return e===`/`?e:e.replace(/\/{1,}$/,``)}function L(e,t=!1,n){let r=N(e.fullPath),i=new Uint16Array(6),a={},o={},s=0;return A(t,i,e,1,r,0,e=>{if(n?.(e,s),e.id in a&&oe(),a[e.id]=e,s!==0&&e.path){let t=fe(e.fullPath);(!o[t]||e.fullPath.endsWith(`/`))&&(o[t]=e)}s++}),M(r),{processedTree:{segmentTree:r,singleCache:O(1e3),matchCache:O(1e3),flatCache:null,masksTree:null},routesById:a,routesByPath:o}}function R(e,t,n=!1){let r=e.split(`/`),i=me(e,r,t,n);if(!i)return null;let[a]=z(e,r,i);return{route:i.node.route,rawParams:a}}function z(e,t,n){let r=pe(n.node),i=null,a=Object.create(null),o=n.extract?.part??0,s=n.extract?.node??0,c=n.extract?.path??0,l=n.extract?.segment??0;for(;s<r.length;o++,s++,c++,l++){let u=r[s];if(u.kind===k)break;if(u.kind===se){l--,o--,c--;continue}let d=t[o],f=c;if(d&&(c+=d.length),u.kind===1){i??=n.node.fullPath.split(`/`);let e=i[l],t=u.prefix?.length??0;if(e.charCodeAt(t)===123){let n=u.suffix?.length??0,r=e.substring(t+2,e.length-n-1),i=d.substring(t,d.length-n);a[r]=decodeURIComponent(i)}else{let t=e.substring(1);a[t]=decodeURIComponent(d)}}else if(u.kind===3){if(n.skipped&1<<s){o--,c=f-1;continue}i??=n.node.fullPath.split(`/`);let e=i[l],t=u.prefix?.length??0,r=u.suffix?.length??0,p=e.substring(t+3,e.length-r-1),m=u.suffix||u.prefix?d.substring(t,d.length-r):d;m&&(a[p]=decodeURIComponent(m))}else if(u.kind===2){let t=u,n=e.substring(f+(t.prefix?.length??0),e.length-(t.suffix?.length??0)),r=decodeURIComponent(n);a[`*`]=r,a._splat=r;break}}return n.rawParams&&Object.assign(a,n.rawParams),[a,{part:o,node:s,path:c,segment:l}]}function B(e){let t=[e];for(;e.parentRoute;)e=e.parentRoute,t.push(e);return t.reverse(),t}function pe(e){let t=Array(e.depth+1);do t[e.depth]=e,e=e.parent;while(e);return t}function me(e,t,n,r){if(e===`/`&&n.index)return{node:n.index,skipped:0};let i=!o(t),a=i&&e!==`/`,s=t.length-+!!i,c=[{node:n,index:1,skipped:0,depth:1,statics:0,dynamics:0,optionals:0}],l=null,u=null;for(;c.length;){let n=c.pop(),{node:i,index:o,skipped:d,depth:f,statics:p,dynamics:m,optionals:h}=n,{extract:g,rawParams:_}=n;if(i.kind===2&&i.route&&!W(u,n))continue;if(i.parse){if(!U(e,t,n))continue;_=n.rawParams,g=n.extract}r&&i.route&&i.kind!==k&&W(l,n)&&(l=n);let v=o===s;if(v&&(i.route&&(!a||i.kind===k||i.kind===2)&&W(u,n)&&(u=n),!i.optional&&!i.wildcard&&!i.index&&!i.pathless))continue;let y=v?void 0:t[o],b;if(v&&i.index){let n={node:i.index,index:o,skipped:d,depth:f+1,statics:p,dynamics:m,optionals:h,extract:g,rawParams:_},r=!0;if(i.index.parse&&(U(e,t,n)||(r=!1)),r){if(!m&&!h&&!d&&H(p,s))return n;W(u,n)&&(u=n)}}if(i.wildcard)for(let e=i.wildcard.length-1;e>=0;e--){let n=i.wildcard[e],{prefix:r,suffix:a}=n;if(!(r&&(v||!(n.caseSensitive?y:b??=y.toLowerCase()).startsWith(r)))){if(a){if(v)continue;let e=t.slice(o).join(`/`).slice(-a.length);if((n.caseSensitive?e:e.toLowerCase())!==a)continue}c.push({node:n,index:s,skipped:d,depth:f+1,statics:p,dynamics:m,optionals:h,extract:g,rawParams:_})}}if(i.optional){let e=d|1<<f,t=f+1;for(let n=i.optional.length-1;n>=0;n--){let r=i.optional[n];c.push({node:r,index:o,skipped:e,depth:t,statics:p,dynamics:m,optionals:h,extract:g,rawParams:_})}if(!v)for(let e=i.optional.length-1;e>=0;e--){let n=i.optional[e],{prefix:r,suffix:a}=n;if(r||a){let e=n.caseSensitive?y:b??=y.toLowerCase();if(r&&!e.startsWith(r)||a&&!e.endsWith(a))continue}c.push({node:n,index:o+1,skipped:d,depth:t,statics:p,dynamics:m,optionals:h+V(s,o),extract:g,rawParams:_})}}if(!v&&i.dynamic&&y)for(let e=i.dynamic.length-1;e>=0;e--){let t=i.dynamic[e],{prefix:n,suffix:r}=t;if(n||r){let e=t.caseSensitive?y:b??=y.toLowerCase();if(n&&!e.startsWith(n)||r&&!e.endsWith(r))continue}c.push({node:t,index:o+1,skipped:d,depth:f+1,statics:p,dynamics:m+V(s,o),optionals:h,extract:g,rawParams:_})}if(!v&&i.staticInsensitive){let e=i.staticInsensitive.get(b??=y.toLowerCase());e&&c.push({node:e,index:o+1,skipped:d,depth:f+1,statics:p+V(s,o),dynamics:m,optionals:h,extract:g,rawParams:_})}if(!v&&i.static){let e=i.static.get(y);e&&c.push({node:e,index:o+1,skipped:d,depth:f+1,statics:p+V(s,o),dynamics:m,optionals:h,extract:g,rawParams:_})}if(i.pathless){let e=f+1;for(let t=i.pathless.length-1;t>=0;t--){let n=i.pathless[t];c.push({node:n,index:o,skipped:d,depth:e,statics:p,dynamics:m,optionals:h,extract:g,rawParams:_})}}}if(u)return u;if(r&&l){let n=l.index;for(let e=0;e<l.index;e++)n+=t[e].length;let r=n===e.length?`/`:e.slice(n);return l.rawParams??=Object.create(null),l.rawParams[`**`]=decodeURIComponent(r),l}return null}function V(e,t){return 2**(e-t-1)}function H(e,t){return e===2**(t-1)-1}function U(e,t,n){let r,i;try{[r,i]=z(e,t,n)}catch{return null}if(n.rawParams=r,n.extract=i,!n.node.parse)return!0;try{if(n.node.parse(r)===!1)return null}catch{}return!0}function W(e,t){return e?t.statics>e.statics||t.statics===e.statics&&(t.dynamics>e.dynamics||t.dynamics===e.dynamics&&(t.optionals>e.optionals||t.optionals===e.optionals&&((t.node.kind===k)>(e.node.kind===k)||t.node.kind===k==(e.node.kind===k)&&t.depth>e.depth))):!0}function G(e){return K(e.filter(e=>e!==void 0).join(`/`))}function K(e){return e.replace(/\/{2,}/g,`/`)}function he(e){return e===`/`?e:e.replace(/^\/{1,}/,``)}function q(e){let t=e.length;return t>1&&e[t-1]===`/`?e.replace(/\/{1,}$/,``):e}function ge(e){return q(he(e))}function J(e,t){return e?.endsWith(`/`)&&e!==`/`&&e!==`${t}/`?e.slice(0,-1):e}function _e(e,t,n){return J(e,n)===J(t,n)}function ve({base:e,to:t,trailingSlash:n=`never`,cache:r}){let i=t.startsWith(`/`),a=!i&&t===`.`,s;if(r){s=i?t:a?e:e+`\0`+t;let n=r.get(s);if(n)return n}let c;if(a)c=e.split(`/`);else if(i)c=t.split(`/`);else{for(c=e.split(`/`);c.length>1&&o(c)===``;)c.pop();let n=t.split(`/`);for(let e=0,t=n.length;e<t;e++){let r=n[e];r===``?e?e===t-1&&c.push(r):c=[r]:r===`..`?c.pop():r===`.`||c.push(r)}}c.length>1&&(o(c)===``?n===`never`&&c.pop():n===`always`&&c.push(``));let l=K(c.join(`/`))||`/`;return s&&r&&r.set(s,l),l}function ye(e){let t=new Map(e.map(e=>[encodeURIComponent(e),e])),n=Array.from(t.keys()).map(e=>e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)).join(`|`),r=new RegExp(n,`g`);return e=>e.replace(r,e=>t.get(e)??e)}function be(e,t,n){let r=t[e];return typeof r==`string`?e===`_splat`?/^[a-zA-Z0-9\-._~!/]*$/.test(r)?r:r.split(`/`).map(e=>Se(e,n)).join(`/`):Se(r,n):r}function xe({path:e,params:t,decoder:n,...r}){let i=!1,a=Object.create(null);if(!e||e===`/`)return{interpolatedPath:`/`,usedParams:a,isMissingParams:i};if(!e.includes(`$`))return{interpolatedPath:e,usedParams:a,isMissingParams:i};let o=e.length,s=0,c,l=``;for(;s<o;){let r=s;c=le(e,r,c);let o=c[5];if(s=o+1,r===o)continue;let u=c[0];if(u===0){l+=`/`+e.substring(r,o);continue}if(u===2){let s=t._splat;a._splat=s,a[`*`]=s;let u=e.substring(r,c[1]),d=e.substring(c[4],o);if(!s){i=!0,(u||d)&&(l+=`/`+u+d);continue}let f=be(`_splat`,t,n);l+=`/`+u+f+d;continue}if(u===1){let s=e.substring(c[2],c[3]);!i&&!(s in t)&&(i=!0),a[s]=t[s];let u=e.substring(r,c[1]),d=e.substring(c[4],o),f=be(s,t,n)??`undefined`;l+=`/`+u+f+d;continue}if(u===3){let i=e.substring(c[2],c[3]),s=t[i];if(s==null)continue;a[i]=s;let u=e.substring(r,c[1]),d=e.substring(c[4],o),f=be(i,t,n)??``;l+=`/`+u+f+d;continue}}return e.endsWith(`/`)&&(l+=`/`),{usedParams:a,interpolatedPath:l||`/`,isMissingParams:i}}function Se(e,t){let n=encodeURIComponent(e);return t?.(n)??n}function Ce(e){return e?.isNotFound===!0}var Y=`__root__`;function we(e){if(e.statusCode=e.statusCode||e.code||307,!e._builtLocation&&!e.reloadDocument&&typeof e.href==`string`)try{new URL(e.href),e.reloadDocument=!0}catch{}let t=new Headers(e.headers);e.href&&t.get(`Location`)===null&&t.set(`Location`,e.href);let n=new Response(null,{status:e.statusCode,headers:t});if(n.options=e,e.throw)throw n;return n}function Te(e){return e instanceof Response&&!!e.options}function Ee(e){if(typeof e==`object`&&e&&e.isSerializedRedirect)return we(e)}var De=`Error preloading route! ☝️`,Oe=class{get to(){return this._to}get id(){return this._id}get path(){return this._path}get fullPath(){return this._fullPath}constructor(e){if(this.init=e=>{this.originalIndex=e.originalIndex;let t=this.options,n=!t?.path&&!t?.id;this.parentRoute=this.options.getParentRoute?.(),n?this._path=Y:this.parentRoute||oe();let r=n?Y:t?.path;r&&r!==`/`&&(r=he(r));let i=t?.id||r,a=n?Y:G([this.parentRoute.id===`__root__`?``:this.parentRoute.id,i]);r===`__root__`&&(r=`/`),a!==`__root__`&&(a=G([`/`,a]));let o=a===`__root__`?`/`:G([this.parentRoute.fullPath,r]);this._path=r,this._id=a,this._fullPath=o,this._to=q(o)},this.addChildren=e=>this._addFileChildren(e),this._addFileChildren=e=>(Array.isArray(e)&&(this.children=e),typeof e==`object`&&e&&(this.children=Object.values(e)),this),this._addFileTypes=()=>this,this.updateLoader=e=>(Object.assign(this.options,e),this),this.update=e=>(Object.assign(this.options,e),this),this.lazy=e=>(this.lazyFn=e,this),this.redirect=e=>we({from:this.fullPath,...e}),this.options=e||{},this.isRoot=!e?.getParentRoute,e?.id&&e?.path)throw Error(`Route cannot have both an 'id' and a 'path' option.`)}},ke=class extends Oe{constructor(e){super(e)}},X=t(r(),1),Ae=X.use,je=typeof window<`u`?X.useLayoutEffect:X.useEffect;function Me(e){let t=X.useRef({value:e,prev:null}),n=t.current.value;return e!==n&&(t.current={value:e,prev:n}),t.current.prev}function Ne(e,t,n={},r={}){X.useEffect(()=>{if(!e.current||r.disabled||typeof IntersectionObserver!=`function`)return;let i=new IntersectionObserver(([e])=>{t(e)},n);return i.observe(e.current),()=>{i.disconnect()}},[t,n,r.disabled,e])}function Pe(e){let t=X.useRef(null);return X.useImperativeHandle(e,()=>t.current,[]),t}var Fe=n();function Ie({children:e,fallback:t=null}){return Le()?(0,Fe.jsx)(X.Fragment,{children:e}):(0,Fe.jsx)(X.Fragment,{children:t})}function Le(){return X.useSyncExternalStore(Re,()=>!0,()=>!1)}function Re(){return()=>{}}var ze=X.createContext(null);function Be(e){return X.useContext(ze)}var Ve=X.createContext(void 0),He=X.createContext(void 0),Ue=e((e=>{var t=r();function n(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var i=typeof Object.is==`function`?Object.is:n,a=t.useState,o=t.useEffect,s=t.useLayoutEffect,c=t.useDebugValue;function l(e,t){var n=t(),r=a({inst:{value:n,getSnapshot:t}}),i=r[0].inst,l=r[1];return s(function(){i.value=n,i.getSnapshot=t,u(i)&&l({inst:i})},[e,n,t]),o(function(){return u(i)&&l({inst:i}),e(function(){u(i)&&l({inst:i})})},[e]),c(n),n}function u(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!i(e,n)}catch{return!0}}function d(e,t){return t()}var f=typeof window>`u`||window.document===void 0||window.document.createElement===void 0?d:l;e.useSyncExternalStore=t.useSyncExternalStore===void 0?f:t.useSyncExternalStore})),We=e(((e,t)=>{t.exports=Ue()})),Ge=e((e=>{var t=r(),n=We();function i(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var a=typeof Object.is==`function`?Object.is:i,o=n.useSyncExternalStore,s=t.useRef,c=t.useEffect,l=t.useMemo,u=t.useDebugValue;e.useSyncExternalStoreWithSelector=function(e,t,n,r,i){var d=s(null);if(d.current===null){var f={hasValue:!1,value:null};d.current=f}else f=d.current;d=l(function(){function e(e){if(!o){if(o=!0,s=e,e=r(e),i!==void 0&&f.hasValue){var t=f.value;if(i(t,e))return c=t}return c=e}if(t=c,a(s,e))return t;var n=r(e);return i!==void 0&&i(t,n)?(s=e,t):(s=e,c=n)}var o=!1,s,c,l=n===void 0?null:n;return[function(){return e(t())},l===null?void 0:function(){return e(l())}]},[t,n,r,i]);var p=o(e,d[0],d[1]);return c(function(){f.hasValue=!0,f.value=p},[p]),u(p),p}})),Ke=e(((e,t)=>{t.exports=Ge()})),qe=t(Ke(),1);function Je(e,t){return e===t}function Ye(e,t,n=Je){let r=(0,X.useCallback)(t=>{if(!e)return()=>{};let{unsubscribe:n}=e.subscribe(t);return n},[e]),i=(0,X.useCallback)(()=>e?.get(),[e]);return(0,qe.useSyncExternalStoreWithSelector)(r,i,i,t,n)}var Xe={get(){},subscribe(){return{unsubscribe(){}}}};function Ze(e,t){let n=X.useRef();return r=>{let i=e?.select?e.select(r):r;return e?.structuralSharing??t.options.defaultStructuralSharing?n.current=m(n.current,i):i}}function Z(e){let t=Be(),n=X.useContext(e.from?He:Ve),r=e.from?t.stores.getRouteMatchStore(e.from):t.stores.matchStores.get(n),i=Ze(e,t),a=Ye(r??Xe,e=>e?i(e):Xe);if(a!==Xe)return a;(e.shouldThrow??!0)&&oe()}function Qe(e){return Z({from:e.from,strict:e.strict,structuralSharing:e.structuralSharing,select:t=>e.select?e.select(t.loaderData):t.loaderData})}function $e(e){let{select:t,...n}=e;return Z({...n,select:e=>t?t(e.loaderDeps):e.loaderDeps})}function et(e){return Z({from:e.from,shouldThrow:e.shouldThrow,structuralSharing:e.structuralSharing,strict:e.strict,select:t=>{let n=e.strict===!1?t.params:t._strictParams;return e.select?e.select(n):n}})}function tt(e){return Z({from:e.from,strict:e.strict,shouldThrow:e.shouldThrow,structuralSharing:e.structuralSharing,select:t=>e.select?e.select(t.search):t.search})}function nt(e){let t=Be();return X.useCallback(n=>t.navigate({...n,from:n.from??e?.from}),[e?.from,t])}function rt(e){return Z({...e,select:t=>e.select?e.select(t.context):t.context})}var it=t(a(),1);function at(e,t){let n=Be(),r=Pe(t),{activeProps:i,inactiveProps:a,activeOptions:o,to:s,preload:l,preloadDelay:u,preloadIntentProximity:d,hashScrollIntoView:f,replace:p,startTransition:m,resetScroll:h,viewTransition:g,children:_,target:v,disabled:b,style:x,className:S,onClick:C,onBlur:w,onFocus:T,onMouseEnter:E,onMouseLeave:D,onTouchStart:te,ignoreBlocker:ne,params:re,search:ie,hash:ae,state:oe,mask:O,reloadDocument:k,unsafeRelative:se,from:ce,_fromLocation:le,...A}=e,j=Le(),M=X.useMemo(()=>e,[n,e.from,e._fromLocation,e.hash,e.to,e.search,e.params,e.state,e.mask,e.unsafeRelative]),N=Ye(n.stores.location,e=>e,(e,t)=>e.href===t.href),P=X.useMemo(()=>{let e={_fromLocation:N,...M};return n.buildLocation(e)},[n,N,M]),ue=P.maskedLocation?P.maskedLocation.publicHref:P.publicHref,de=P.maskedLocation?P.maskedLocation.external:P.external,F=X.useMemo(()=>ft(ue,de,n.history,b),[b,de,ue,n.history]),I=X.useMemo(()=>{if(F?.external)return ee(F.href,n.protocolAllowlist)?void 0:F.href;if(!pt(s)&&!(typeof s!=`string`||s.indexOf(`:`)===-1))try{return new URL(s),ee(s,n.protocolAllowlist)?void 0:s}catch{}},[s,F,n.protocolAllowlist]),fe=X.useMemo(()=>{if(I)return!1;if(o?.exact){if(!_e(N.pathname,P.pathname,n.basepath))return!1}else{let e=J(N.pathname,n.basepath),t=J(P.pathname,n.basepath);if(!(e.startsWith(t)&&(e.length===t.length||e[t.length]===`/`)))return!1}return(o?.includeSearch??!0)&&!y(N.search,P.search,{partial:!o?.exact,ignoreUndefined:!o?.explicitUndefined})?!1:o?.includeHash?j&&N.hash===P.hash:!0},[o?.exact,o?.explicitUndefined,o?.includeHash,o?.includeSearch,N,I,j,P.hash,P.pathname,P.search,n.basepath]),L=fe?c(i,{})??st:ot,R=fe?ot:c(a,{})??ot,z=[S,L.className,R.className].filter(Boolean).join(` `),B=(x||L.style||R.style)&&{...x,...L.style,...R.style},[pe,me]=X.useState(!1),V=X.useRef(!1),H=e.reloadDocument||I?!1:l??n.options.defaultPreload,U=u??n.options.defaultPreloadDelay??0,W=X.useCallback(()=>{n.preloadRoute({...M,_builtLocation:P}).catch(e=>{console.warn(e),console.warn(De)})},[n,M,P]);Ne(r,X.useCallback(e=>{e?.isIntersecting&&W()},[W]),dt,{disabled:!!b||H!==`viewport`}),X.useEffect(()=>{V.current||!b&&H===`render`&&(W(),V.current=!0)},[b,W,H]);let G=e=>{let t=e.currentTarget.getAttribute(`target`),r=v===void 0?t:v;if(!b&&!ht(e)&&!e.defaultPrevented&&(!r||r===`_self`)&&e.button===0){e.preventDefault(),(0,it.flushSync)(()=>{me(!0)});let t=n.subscribe(`onResolved`,()=>{t(),me(!1)});n.navigate({...M,replace:p,resetScroll:h,hashScrollIntoView:f,startTransition:m,viewTransition:g,ignoreBlocker:ne})}};if(I)return{...A,ref:r,href:I,..._&&{children:_},...v&&{target:v},...b&&{disabled:b},...x&&{style:x},...S&&{className:S},...C&&{onClick:C},...w&&{onBlur:w},...T&&{onFocus:T},...E&&{onMouseEnter:E},...D&&{onMouseLeave:D},...te&&{onTouchStart:te}};let K=e=>{if(b||H!==`intent`)return;if(!U){W();return}let t=e.currentTarget;if(Q.has(t))return;let n=setTimeout(()=>{Q.delete(t),W()},U);Q.set(t,n)},he=e=>{b||H!==`intent`||W()},q=e=>{if(b||!H||!U)return;let t=e.currentTarget,n=Q.get(t);n&&(clearTimeout(n),Q.delete(t))};return{...A,...L,...R,href:F?.href,ref:r,onClick:$([C,G]),onBlur:$([w,q]),onFocus:$([T,K]),onMouseEnter:$([E,K]),onMouseLeave:$([D,q]),onTouchStart:$([te,he]),disabled:!!b,target:v,...B&&{style:B},...z&&{className:z},...b&&ct,...fe&<,...j&&pe&&ut}}var ot={},st={className:`active`},ct={role:`link`,"aria-disabled":!0},lt={"data-status":`active`,"aria-current":`page`},ut={"data-transitioning":`transitioning`},Q=new WeakMap,dt={rootMargin:`100px`},$=e=>t=>{for(let n of e)if(n){if(t.defaultPrevented)return;n(t)}};function ft(e,t,n,r){if(!r)return t?{href:e,external:!0}:{href:n.createHref(e)||`/`,external:!1}}function pt(e){if(typeof e!=`string`)return!1;let t=e.charCodeAt(0);return t===47?e.charCodeAt(1)!==47:t===46}var mt=X.forwardRef((e,t)=>{let{_asChild:n,...r}=e,{type:i,...a}=at(r,t),o=typeof r.children==`function`?r.children({isActive:a[`data-status`]===`active`}):r.children;if(!n){let{disabled:e,...t}=a;return X.createElement(`a`,t,o)}return X.createElement(n,a,o)});function ht(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}var gt=class extends Oe{constructor(e){super(e),this.useMatch=e=>Z({select:e?.select,from:this.id,structuralSharing:e?.structuralSharing}),this.useRouteContext=e=>rt({...e,from:this.id}),this.useSearch=e=>tt({select:e?.select,structuralSharing:e?.structuralSharing,from:this.id}),this.useParams=e=>et({select:e?.select,structuralSharing:e?.structuralSharing,from:this.id}),this.useLoaderDeps=e=>$e({...e,from:this.id}),this.useLoaderData=e=>Qe({...e,from:this.id}),this.useNavigate=()=>nt({from:this.fullPath}),this.Link=X.forwardRef((e,t)=>(0,Fe.jsx)(mt,{ref:t,from:this.fullPath,...e}))}};function _t(e){return new gt(e)}var vt=class extends ke{constructor(e){super(e),this.useMatch=e=>Z({select:e?.select,from:this.id,structuralSharing:e?.structuralSharing}),this.useRouteContext=e=>rt({...e,from:this.id}),this.useSearch=e=>tt({select:e?.select,structuralSharing:e?.structuralSharing,from:this.id}),this.useParams=e=>et({select:e?.select,structuralSharing:e?.structuralSharing,from:this.id}),this.useLoaderDeps=e=>$e({...e,from:this.id}),this.useLoaderData=e=>Qe({...e,from:this.id}),this.useNavigate=()=>nt({from:this.fullPath}),this.Link=X.forwardRef((e,t)=>(0,Fe.jsx)(mt,{ref:t,from:this.fullPath,...e}))}};function yt(e){return new vt(e)}function bt(e){return new xt(e,{silent:!0}).createRoute}var xt=class{constructor(e,t){this.path=e,this.createRoute=e=>{let t=_t(e);return t.isRoot=!1,t},this.silent=t?.silent}};function St(e,t){let n,r,i,a,o=()=>(n||=e().then(e=>{n=void 0,r=e[t??`default`]}).catch(e=>{if(i=e,x(i)&&i instanceof Error&&typeof window<`u`&&typeof sessionStorage<`u`){let e=`tanstack_router_reload:${i.message}`;sessionStorage.getItem(e)||(sessionStorage.setItem(e,`1`),a=!0)}}),n),s=function(e){if(a)throw window.location.reload(),new Promise(()=>{});if(i)throw i;if(!r)if(Ae)Ae(o());else throw o();return X.createElement(r,e)};return s.preload=o,s}var Ct=`modulepreload`,wt=function(e){return`/`+e},Tt={},Et=function(e,t,n){let r=Promise.resolve();if(t&&t.length>0){let e=document.getElementsByTagName(`link`),i=document.querySelector(`meta[property=csp-nonce]`),a=i?.nonce||i?.getAttribute(`nonce`);function o(e){return Promise.all(e.map(e=>Promise.resolve(e).then(e=>({status:`fulfilled`,value:e}),e=>({status:`rejected`,reason:e}))))}r=o(t.map(t=>{if(t=wt(t,n),t in Tt)return;Tt[t]=!0;let r=t.endsWith(`.css`),i=r?`[rel="stylesheet"]`:``;if(n)for(let n=e.length-1;n>=0;n--){let i=e[n];if(i.href===t&&(!r||i.rel===`stylesheet`))return}else if(document.querySelector(`link[href="${t}"]${i}`))return;let o=document.createElement(`link`);if(o.rel=r?`stylesheet`:Ct,r||(o.as=`script`),o.crossOrigin=``,o.href=t,a&&o.setAttribute(`nonce`,a),document.head.appendChild(o),r)return new Promise((e,n)=>{o.addEventListener(`load`,e),o.addEventListener(`error`,()=>n(Error(`Unable to preload CSS for ${t}`)))})}))}function i(e){let t=new Event(`vite:preloadError`,{cancelable:!0});if(t.payload=e,window.dispatchEvent(t),!t.defaultPrevented)throw e}return r.then(t=>{for(let e of t||[])e.status===`rejected`&&i(e.reason);return e().catch(i)})};export{B as A,b as B,K as C,ve as D,G as E,L as F,c as G,y as H,O as I,S as J,d as K,oe as L,I as M,F as N,ge as O,ue as P,a as Q,E as R,Ce as S,xe as T,ie as U,re as V,ne as W,p as X,o as Y,m as Z,Me as _,mt as a,we as b,Ye as c,Be as d,ze as f,je as g,Ae as h,yt as i,de as j,q as k,Ke as l,Le as m,St as n,nt as o,Ie as p,ee as q,bt as r,Ze as s,Et as t,Ve as u,Te as v,ye as w,Y as x,Ee as y,ae as z};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as e,t}from"./jsx-runtime-DGeXAQPT.js";import{t as n}from"./react-3W8R1pOO.js";import{a as r,d as i,o as a}from"./preload-helper-bztXdkDj.js";import{t as o}from"./chevron-right-BG4OeFRQ.js";import{n as s,t as c}from"./x-DAXGIe_Q.js";import{a as l,c as u,i as d,n as f,o as p,r as m,s as h,t as g}from"./ConfirmDialog-CyL9A20V.js";import{B as _,G as v,K as y,U as b,q as x,w as S}from"./index-Cp6UHWr2.js";import{n as C,t as w}from"./utils-B6KiDbIe.js";import{t as T}from"./Button-ByiV6fpd.js";import{i as E}from"./wire-constants-BzdHSc6A.js";var D=x(`archive`,[[`rect`,{width:`20`,height:`5`,x:`2`,y:`3`,rx:`1`,key:`1wp1u1`}],[`path`,{d:`M4 8v11a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8`,key:`1s80jp`}],[`path`,{d:`M10 12h4`,key:`a56b0p`}]]),O=x(`pencil`,[[`path`,{d:`M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z`,key:`1a8usu`}],[`path`,{d:`m15 5 4 4`,key:`1mk7zo`}]]),k=x(`send`,[[`path`,{d:`M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z`,key:`1ffxy3`}],[`path`,{d:`m21.854 2.147-10.94 10.939`,key:`12cjpa`}]]),A=e(n(),1),j=e=>typeof e==`boolean`?`${e}`:e===0?`0`:e,M=C,N=(e,t)=>n=>{if(t?.variants==null)return M(e,n?.class,n?.className);let{variants:r,defaultVariants:i}=t,a=Object.keys(r).map(e=>{let t=n?.[e],a=i?.[e];if(t===null)return null;let o=j(t)||j(a);return r[e][o]}),o=n&&Object.entries(n).reduce((e,t)=>{let[n,r]=t;return r===void 0||(e[n]=r),e},{});return M(e,a,t?.compoundVariants?.reduce((e,t)=>{let{class:n,className:r,...a}=t;return Object.entries(a).every(e=>{let[t,n]=e;return Array.isArray(n)?n.includes({...i,...o}[t]):{...i,...o}[t]===n})?[...e,n,r]:e},[]),n?.class,n?.className)},P=t(),F=N(`team/button inline-flex shrink-0 items-center justify-center rounded-lg border border-transparent bg-clip-padding text-sm font-medium whitespace-nowrap transition-all outline-none select-none focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 active:not-aria-[haspopup]:translate-y-px disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,{variants:{variant:{default:`bg-primary text-primary-foreground [a]:hover:bg-primary/80`,outline:`border-border bg-background hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:border-input dark:bg-input/30 dark:hover:bg-input/50`,secondary:`bg-secondary text-secondary-foreground hover:bg-secondary/80 aria-expanded:bg-secondary aria-expanded:text-secondary-foreground`,ghost:`hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:hover:bg-muted/50`,destructive:`bg-destructive/10 text-destructive hover:bg-destructive/20 focus-visible:border-destructive/40 focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:hover:bg-destructive/30 dark:focus-visible:ring-destructive/40`,link:`text-primary underline-offset-4 hover:underline`},size:{default:`h-8 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2`,xs:`h-6 gap-1 rounded-[min(var(--radius-md),10px)] px-2 text-xs in-data-[slot=button-team]:rounded-lg has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3`,sm:`h-7 gap-1 rounded-[min(var(--radius-md),12px)] px-2.5 text-[0.8rem] in-data-[slot=button-team]:rounded-lg has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3.5`,lg:`h-9 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2`,icon:`size-8`,"icon-xs":`size-6 rounded-[min(var(--radius-md),10px)] in-data-[slot=button-team]:rounded-lg [&_svg:not([class*='size-'])]:size-3`,"icon-sm":`size-7 rounded-[min(var(--radius-md),12px)] in-data-[slot=button-team]:rounded-lg`,"icon-lg":`size-9`}},defaultVariants:{variant:`default`,size:`default`}});function I({className:e,variant:t=`default`,size:n=`default`,asChild:r=!1,...i}){return(0,P.jsx)(r?_:`button`,{"data-slot":`button`,"data-variant":t,"data-size":n,className:w(F({variant:t,size:n,className:e})),...i})}function L({...e}){return(0,P.jsx)(f,{"data-slot":`dialog`,...e})}function R({...e}){return(0,P.jsx)(h,{"data-slot":`dialog-portal`,...e})}function z({className:e,...t}){return(0,P.jsx)(p,{"data-slot":`dialog-overlay`,className:w(`fixed inset-0 isolate z-50 bg-black/10 duration-100 supports-backdrop-filter:backdrop-blur-xs data-open:animate-in data-open:fade-in-0 data-closed:animate-out data-closed:fade-out-0`,e),...t})}function B({className:e,children:t,showCloseButton:n=!0,...r}){return(0,P.jsxs)(R,{children:[(0,P.jsx)(z,{}),(0,P.jsxs)(d,{"data-slot":`dialog-content`,className:w(`fixed top-1/2 left-1/2 z-50 grid w-full max-w-[calc(100%-2rem)] -translate-x-1/2 -translate-y-1/2 gap-4 rounded-xl bg-popover p-4 text-sm text-popover-foreground ring-1 ring-foreground/10 duration-100 outline-none sm:max-w-sm data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95`,e),...r,children:[t,n&&(0,P.jsx)(m,{"data-slot":`dialog-close`,asChild:!0,children:(0,P.jsxs)(I,{variant:`ghost`,className:`absolute top-2 right-2`,size:`icon-sm`,children:[(0,P.jsx)(c,{}),(0,P.jsx)(`span`,{className:`sr-only`,children:`Close`})]})})]})]})}function V({className:e,...t}){return(0,P.jsx)(`div`,{"data-slot":`dialog-header`,className:w(`flex flex-col gap-2`,e),...t})}function H({className:e,showCloseButton:t=!1,children:n,...r}){return(0,P.jsxs)(`div`,{"data-slot":`dialog-footer`,className:w(`-mx-4 -mb-4 flex flex-col-reverse gap-2 rounded-b-xl border-t bg-muted/50 p-4 sm:flex-row sm:justify-end`,e),...r,children:[n,t&&(0,P.jsx)(m,{asChild:!0,children:(0,P.jsx)(I,{variant:`outline`,children:`Close`})})]})}function U({className:e,...t}){return(0,P.jsx)(u,{"data-slot":`dialog-title`,className:w(`font-heading text-base leading-none font-medium`,e),...t})}function W({className:e,...t}){return(0,P.jsx)(l,{"data-slot":`dialog-description`,className:w(`text-sm text-muted-foreground *:[a]:underline *:[a]:underline-offset-3 *:[a]:hover:text-foreground`,e),...t})}function G({onClose:e}){let t=i(),[n,r]=(0,A.useState)(``),[a,o]=(0,A.useState)(``),[s,c]=(0,A.useState)(``),[l,u]=(0,A.useState)(!1),[d,f]=(0,A.useState)(null);async function p(r){if(r.preventDefault(),f(null),!n.trim()){f(`id is required`);return}u(!0);try{let r={id:n.trim()};a.trim()&&(r.name=a.trim()),s.trim()&&(r.link=s.trim());let i=await fetch(`/api/teams`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify(r)});if(!i.ok){let e=await i.json().catch(()=>({}));throw Error(e.error??`${i.status} ${i.statusText}`)}e(),await t.invalidate()}catch(e){f(e.message),u(!1)}}return(0,P.jsx)(L,{open:!0,onOpenChange:t=>{!t&&!l&&e()},children:(0,P.jsx)(B,{showCloseButton:!l,className:`max-h-[calc(100dvh-2rem)] w-full max-w-lg overflow-y-auto rounded-3xl border border-frost bg-card p-6 shadow-baziu-lg sm:p-7`,onEscapeKeyDown:e=>{l&&e.preventDefault()},onPointerDownOutside:e=>{l&&e.preventDefault()},children:(0,P.jsxs)(`form`,{onSubmit:p,children:[(0,P.jsxs)(V,{children:[(0,P.jsx)(U,{className:`font-serif text-2xl text-foreground`,children:`Create a team`}),(0,P.jsxs)(W,{children:[`A team is a collaboration context — one filesystem root, one USER.md, one roster. The slot lives at `,(0,P.jsx)(`code`,{className:`font-mono`,children:`~/.bazilion/teams/<slug>/`}),`.`]})]}),(0,P.jsxs)(`div`,{className:`mb-3 mt-4 grid gap-3 sm:grid-cols-2`,children:[(0,P.jsxs)(`label`,{className:`block text-sm`,children:[`ID (slug)`,(0,P.jsx)(`input`,{type:`text`,value:n,onChange:e=>r(e.target.value),required:!0,pattern:`[a-z0-9][a-z0-9_-]*`,placeholder:`myproject`,className:`mt-1 block w-full rounded-md border bg-background px-3 py-2 outline-none focus:ring-2 focus:ring-ring/30`})]}),(0,P.jsxs)(`label`,{className:`block text-sm`,children:[`Name `,(0,P.jsx)(`span`,{className:`text-muted-foreground font-normal`,children:`(optional)`}),(0,P.jsx)(`input`,{type:`text`,value:a,onChange:e=>o(e.target.value),className:`mt-1 block w-full rounded-md border bg-background px-3 py-2 outline-none focus:ring-2 focus:ring-ring/30`})]})]}),(0,P.jsxs)(`label`,{className:`mb-3 block text-sm`,children:[`Link target`,` `,(0,P.jsx)(`span`,{className:`text-muted-foreground font-normal`,children:`(optional, absolute path)`}),(0,P.jsx)(`input`,{type:`text`,value:s,onChange:e=>c(e.target.value),placeholder:`/home/you/projects/myrepo`,className:`mt-1 block w-full rounded-md border bg-background px-3 py-2 outline-none focus:ring-2 focus:ring-ring/30`}),(0,P.jsx)(`span`,{className:`mt-1 block text-xs text-muted-foreground`,children:`Leave blank to create a fresh directory. Supply an absolute path to materialize the slot as a symlink to your existing project tree.`})]}),d&&(0,P.jsx)(`p`,{role:`alert`,className:`err mt-2`,children:d}),(0,P.jsxs)(`div`,{className:`mt-5 flex justify-end gap-2`,children:[(0,P.jsx)(T,{variant:`ghost`,disabled:l,onClick:e,children:`Cancel`}),(0,P.jsx)(T,{variant:`primary`,type:`submit`,disabled:l,children:l?`Creating…`:`Create team`})]})]})})})}function K({profileId:e,teamHint:t,teams:n,onClose:r}){let i=a(),[o,s]=(0,A.useState)(``),[c,l]=(0,A.useState)(t??n.find(e=>e.id==="default")?.id??n[0]?.id??``),[u,d]=(0,A.useState)(`profile_defaults`),[f,p]=(0,A.useState)(!1),[m,h]=(0,A.useState)(null),[g,_]=(0,A.useState)(null);async function v(){let t=await fetch(`/api/teams/${encodeURIComponent(c)}/policy`);if(!t.ok)throw Error(`The selected Team policy is unavailable. Reload and try again.`);let n=await t.json();return{current:n,body:{profileId:e,teamId:c,teamExpectedRevision:n.teamPolicy.revision,placement:u}}}async function y(){h(null),p(!0);try{let{body:e}=await v(),t=await fetch(`/api/agents/placement-preview`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify(e)});if(!t.ok){let e=await t.json().catch(()=>null);throw Error(e?.error??`Preview failed (${t.status})`)}_(await t.json())}catch(e){h(e.message)}finally{p(!1)}}async function b(t){t.preventDefault(),h(null),p(!0);try{if(!g){await y();return}let t={profile:e,teamExpectedRevision:g.currentRevision,placement:u};o.trim()&&(t.name=o.trim()),c&&(t.teamId=c);let n=await fetch(`/api/agents`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify(t)});if(!n.ok){let e=await n.json().catch(()=>({}));throw Error(e.error??`${n.status} ${n.statusText}`)}let a=(await n.json()).agent;r(),await i({to:`/`,search:{agent:a.id}})}catch(e){h(e.message),p(!1)}}return(0,P.jsx)(L,{open:!0,onOpenChange:e=>{!e&&!f&&r()},children:(0,P.jsx)(B,{showCloseButton:!f,className:`max-h-[calc(100dvh-2rem)] w-full max-w-lg overflow-y-auto rounded-3xl border border-frost bg-card p-6 shadow-baziu-lg sm:p-7`,onEscapeKeyDown:e=>{f&&e.preventDefault()},onPointerDownOutside:e=>{f&&e.preventDefault()},children:(0,P.jsxs)(`form`,{onSubmit:b,children:[(0,P.jsxs)(V,{children:[(0,P.jsx)(U,{className:`font-serif text-xl text-foreground`,children:`Spawn a new agent`}),(0,P.jsxs)(W,{children:[`Create an agent from profile `,(0,P.jsx)(`code`,{className:`font-mono`,children:e}),`, then review its exact Team policy placement before committing.`]})]}),(0,P.jsxs)(`label`,{className:`mb-3 mt-4 block text-sm text-foreground`,children:[`Agent name`,` `,(0,P.jsx)(`span`,{className:`text-muted-foreground font-normal`,children:`(optional — defaults to the profile's name)`}),(0,P.jsx)(`input`,{type:`text`,value:o,onChange:e=>s(e.target.value),autoComplete:`off`,className:`mt-1 block w-full rounded-md border bg-background px-3 py-2 outline-none focus:ring-2 focus:ring-ring/30`})]}),(0,P.jsxs)(`label`,{className:`mb-3 block text-sm text-foreground`,children:[`Initial policy placement`,(0,P.jsxs)(`select`,{value:u,onChange:e=>{d(e.target.value),_(null)},className:`mt-1 block w-full rounded-md border bg-background px-3 py-2`,children:[(0,P.jsx)(`option`,{value:`profile_defaults`,children:`Agent-template defaults`}),(0,P.jsx)(`option`,{value:`isolated`,children:`Isolated`})]}),(0,P.jsx)(`span`,{className:`mt-1 block text-xs text-muted-foreground`,children:`The current Team revision is checked again when you submit.`})]}),(0,P.jsxs)(`label`,{className:`mb-3 block text-sm text-foreground`,children:[`Team`,(0,P.jsx)(`select`,{value:c,onChange:e=>{l(e.target.value),_(null)},className:`mt-1 block w-full rounded-md border bg-background px-3 py-2 outline-none focus:ring-2 focus:ring-ring/30`,children:n.map(e=>(0,P.jsxs)(`option`,{value:e.id,children:[e.name,e.id==="default"?` (default)`:``]},e.id))})]}),m&&(0,P.jsx)(`p`,{role:`alert`,className:`err mt-2`,children:m}),g&&(0,P.jsxs)(`div`,{role:`status`,className:`mt-3 rounded-md border border-sapphire-light bg-sapphire-glow p-3 text-sm`,children:[(0,P.jsxs)(`p`,{children:[`Creating this Agent advances Team revision `,g.currentRevision,` →`,` `,(0,P.jsx)(`strong`,{children:g.resultingRevision}),` and adds`,` `,(0,P.jsx)(`strong`,{children:g.addedEdges.length}),` directed edges to the existing`,` `,g.existingEdges.length,`.`]}),(0,P.jsx)(`ul`,{className:`mt-2 max-h-36 overflow-auto`,children:g.addedEdges.map((e,t)=>(0,P.jsx)(`li`,{children:(0,P.jsxs)(`code`,{children:[e.sourceKind,e.sourceId?`:${e.sourceId}`:``,` → `,e.targetKind,e.targetId?`:${e.targetId}`:``]})},`${e.sourceKind}:${e.sourceId??``}>${e.targetKind}:${e.targetId??``}:${t}`))}),g.addedEdges.length===0&&(0,P.jsx)(`p`,{className:`mt-2`,children:`The new Agent starts isolated.`})]}),(0,P.jsxs)(`div`,{className:`mt-5 flex justify-end gap-2`,children:[(0,P.jsx)(T,{variant:`ghost`,disabled:f,onClick:r,children:`Cancel`}),(0,P.jsx)(T,{variant:`primary`,type:`submit`,disabled:f,children:f?`Working…`:g?`Commit reviewed creation`:`Review exact policy`})]})]})})})}function q({profileGroup:e,teams:t,onClose:n,onSpawned:r}){let[i,a]=(0,A.useState)(``),[o,s]=(0,A.useState)(``),[c,l]=(0,A.useState)(null),[u,d]=(0,A.useState)(!1),[f,p]=(0,A.useState)(null);async function m(){let n=i.trim();if(!n)throw Error(`Target Team slug is required`);let r=t.find(e=>e.id===n),a;if(r){let e=await fetch(`/api/teams/${encodeURIComponent(n)}/policy`);if(!e.ok)throw Error(`The target Team policy is unavailable.`);a=(await e.json()).teamPolicy.revision}return{target:n,body:{templateExpectedRevision:e.currentRevision,teamId:n,...a?{teamExpectedRevision:a}:{},mode:r?`append`:`initialize`,...o?{userMd:o}:{}}}}async function h(){d(!0),l(null),p(null);try{let{body:t}=await m(),n=await fetch(`/api/team-templates/${encodeURIComponent(e.id)}/spawn/preview`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify(t)});if(!n.ok)throw Error((await n.json().catch(()=>null))?.error??n.statusText);p(await n.json())}catch(e){l(e.message)}finally{d(!1)}}async function g(){let t=i.trim();if(!t){l(`Target Team slug is required`);return}d(!0),l(null);try{let{body:n}=await m(),i=await fetch(`/api/team-templates/${encodeURIComponent(e.id)}/spawn`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify(n)});if(!i.ok)throw Error((await i.json().catch(()=>null))?.error??i.statusText);r(t)}catch(e){l(e.message)}finally{d(!1)}}return(0,P.jsx)(L,{open:!0,onOpenChange:e=>{!e&&!u&&n()},children:(0,P.jsxs)(B,{showCloseButton:!u,className:`max-h-[calc(100dvh-2rem)] w-full max-w-lg overflow-y-auto rounded-3xl border border-frost bg-card p-6 shadow-baziu-lg sm:p-7`,onEscapeKeyDown:e=>{u&&e.preventDefault()},onPointerDownOutside:e=>{u&&e.preventDefault()},children:[(0,P.jsxs)(V,{children:[(0,P.jsxs)(U,{className:`font-serif text-xl text-foreground`,children:[`Spawn team — `,e.name]}),(0,P.jsxs)(W,{children:[`Uses immutable Team revision `,e.currentRevision,`. Existing Teams append at their current reviewed revision; a new Team initializes at revision 1. Conflicts never overwrite newer state.`]})]}),c&&(0,P.jsx)(`div`,{role:`alert`,className:`err`,children:c}),(0,P.jsxs)(`label`,{children:[`Target Team slug`,(0,P.jsx)(`input`,{value:i,onChange:e=>{a(e.target.value),p(null)},list:`canonical-teams`,required:!0}),(0,P.jsx)(`datalist`,{id:`canonical-teams`,children:t.map(e=>(0,P.jsx)(`option`,{value:e.id,children:e.name},e.id))})]}),(0,P.jsxs)(`label`,{children:[`Starter USER.md (new Team only)`,(0,P.jsx)(`textarea`,{rows:3,value:o,onChange:e=>{s(e.target.value),p(null)},className:`font-mono text-[0.88em] leading-[1.55]`})]}),f&&(0,P.jsxs)(`div`,{role:`status`,className:`mt-4 rounded-md border border-sapphire-light bg-sapphire-glow p-3 text-sm`,children:[(0,P.jsxs)(`p`,{children:[(0,P.jsx)(`strong`,{children:f.mode===`initialize`?`Initialize`:`Append`}),` produces Team revision `,f.resultingRevision,`, adds `,f.newMembers.length,` Agents, and results in `,f.edges.length,` directed allow edges.`]}),(0,P.jsx)(`ul`,{className:`mt-2 max-h-40 overflow-auto`,children:f.newMembers.map(e=>(0,P.jsxs)(`li`,{children:[e.agentName,` · stable source slot `,(0,P.jsx)(`code`,{children:e.slotId})]},e.slotId))}),(0,P.jsxs)(`details`,{className:`mt-2`,children:[(0,P.jsx)(`summary`,{className:`cursor-pointer`,children:`Review exact edge topology`}),(0,P.jsx)(`ul`,{className:`mt-2 max-h-40 overflow-auto`,children:f.edges.map((e,t)=>(0,P.jsx)(`li`,{children:(0,P.jsxs)(`code`,{children:[e.sourceKind,e.sourceId?`:${e.sourceId}`:``,` → `,e.targetKind,e.targetId?`:${e.targetId}`:``]})},`${e.sourceKind}:${e.sourceId??``}>${e.targetKind}:${e.targetId??``}:${t}`))})]})]}),(0,P.jsxs)(`div`,{className:`mt-4 flex justify-end gap-2`,children:[(0,P.jsx)(T,{variant:`ghost`,disabled:u,onClick:n,children:`Cancel`}),f?(0,P.jsx)(T,{variant:`primary`,onClick:g,disabled:u,children:u?`Spawning…`:`Commit ${f.mode}`}):(0,P.jsx)(T,{variant:`primary`,onClick:h,disabled:u||e.slotCount===0,children:u?`Reviewing…`:`Review exact result`})]})]})})}var J=`bz_sidebar_open_groups`;function Y(e){if(typeof document>`u`)return;let t=encodeURIComponent(JSON.stringify(e));document.cookie=`${J}=${t}; Path=/; Max-Age=31536000; SameSite=Lax`}function X({agents:e,teams:t,profiles:n,profileGroups:a,selectedAgentId:c,initialOpenGroups:l}){let u=i(),[d,f]=(0,A.useState)(null),[p,m]=(0,A.useState)(null),[h,_]=(0,A.useState)(!1),[x,S]=(0,A.useState)(!1),[C,w]=(0,A.useState)(null),[T,E]=(0,A.useState)(null),[j,M]=(0,A.useState)(null),N=(0,A.useRef)(null),F=(0,A.useRef)(null),I=()=>window.requestAnimationFrame(()=>N.current?.focus()),[L,R]=(0,A.useState)(()=>l??{});(0,A.useEffect)(()=>{if(!x)return;let e=F.current;window.requestAnimationFrame(()=>{e?.querySelector(`[role="menuitem"]:not([disabled])`)?.focus()});let t=t=>{e?.contains(t.target)||N.current?.contains(t.target)||(S(!1),I())},n=e=>{e.key===`Escape`&&(e.preventDefault(),S(!1),I())};return document.addEventListener(`pointerdown`,t),document.addEventListener(`keydown`,n),()=>{document.removeEventListener(`pointerdown`,t),document.removeEventListener(`keydown`,n)}},[x]);function z(e){if(![`ArrowDown`,`ArrowUp`,`Home`,`End`].includes(e.key))return;let t=Array.from(e.currentTarget.querySelectorAll(`[role="menuitem"]:not([disabled])`));if(t.length===0)return;e.preventDefault();let n=t.indexOf(document.activeElement);t[e.key===`Home`?0:e.key===`End`?t.length-1:e.key===`ArrowDown`?(n+1+t.length)%t.length:(n-1+t.length)%t.length]?.focus()}async function B(e,t){let n=t.trim();if(!n||n===e.name)return;let r=await fetch(`/api/agents/${e.id}`,{method:`PATCH`,headers:{"content-type":`application/json`},body:JSON.stringify({name:n})});if(!r.ok){let e=await r.json().catch(()=>null);throw Error(e?.error??`Could not rename agent (${r.status})`)}await u.invalidate()}async function V(e){let t=await fetch(`/api/agents/${e.id}/archive`,{method:`POST`});if(!t.ok&&t.status!==204){let e=await t.json().catch(()=>null);throw Error(e?.error??`Could not archive agent (${t.status})`)}await u.invalidate()}let H=[...n].sort((e,t)=>e.id==="default"?-1:+(t.id==="default")),U=[...t].sort((e,t)=>e.id==="default"?-1:+(t.id==="default")),W=new Map;for(let t of e){let e=W.get(t.teamId)??[];e.push(t),W.set(t.teamId,e)}let J=e.find(e=>e.id===c)?.teamId??null;return(0,P.jsxs)(`aside`,{className:`flex h-full flex-col overflow-hidden rounded-2xl border border-border bg-card shadow-baziu-sm`,children:[(0,P.jsxs)(`header`,{className:`flex items-center justify-between gap-3 border-b border-border bg-muted/30 px-3 py-2.5`,children:[(0,P.jsxs)(`div`,{className:`min-w-0`,children:[(0,P.jsxs)(`div`,{className:`flex items-center gap-2 text-sm font-semibold text-foreground`,children:[(0,P.jsx)(`span`,{className:`flex size-7 items-center justify-center rounded-lg bg-accent text-accent-foreground`,children:(0,P.jsx)(y,{className:`size-4`,"aria-hidden":`true`})}),(0,P.jsx)(`span`,{children:`Agents`})]}),(0,P.jsxs)(`p`,{className:`mt-0.5 truncate pl-9 text-xs text-muted-foreground`,children:[e.length,` agent`,e.length===1?``:`s`,` across `,t.length,` team`,t.length===1?``:`s`]})]}),(0,P.jsxs)(`div`,{className:`relative`,children:[(0,P.jsxs)(`button`,{ref:N,id:`sidebar-new-menu-button`,type:`button`,onClick:()=>S(e=>!e),"aria-label":`Create a new Agent or Team`,"aria-controls":x?`sidebar-new-menu`:void 0,"aria-expanded":x,"aria-haspopup":`menu`,className:`unstyled inline-flex h-8 items-center gap-1 rounded-lg border border-border bg-card px-2.5 text-xs font-semibold text-foreground shadow-baziu-sm transition-colors hover:border-primary/30 hover:bg-accent hover:text-accent-foreground`,children:[(0,P.jsx)(s,{className:`size-3.5`,"aria-hidden":`true`}),`New`,(0,P.jsx)(v,{className:`size-3.5 text-muted-foreground transition-transform ${x?`rotate-180`:``}`,"aria-hidden":`true`})]}),x&&(0,P.jsxs)(`div`,{ref:F,id:`sidebar-new-menu`,role:`menu`,"aria-labelledby":`sidebar-new-menu-button`,className:`absolute right-0 top-[calc(100%+0.4rem)] z-20 w-60 overflow-hidden rounded-xl border border-border bg-popover p-1.5 text-popover-foreground shadow-baziu-lg`,onKeyDown:z,children:[n.length===0?(0,P.jsxs)(`div`,{className:`rounded-lg bg-muted/40 px-3 py-2.5 text-xs leading-5 text-muted-foreground`,children:[`No Agent templates yet.`,` `,(0,P.jsx)(`a`,{href:`/templates/agents`,role:`menuitem`,className:`text-primary underline`,children:`Create one to spawn agents.`})]}):(0,P.jsxs)(P.Fragment,{children:[(0,P.jsxs)(`div`,{className:`flex items-center gap-1.5 px-2.5 pb-1 pt-1 text-xs font-semibold uppercase tracking-[0.08em] text-muted-foreground`,children:[(0,P.jsx)(y,{className:`size-3`,"aria-hidden":`true`}),`Agent templates`]}),H.map(e=>(0,P.jsxs)(`button`,{type:`button`,role:`menuitem`,onClick:()=>{S(!1),f({profileId:e.id})},className:`unstyled flex min-h-8 w-full items-center gap-2 rounded-lg px-2.5 py-1.5 text-left text-sm text-foreground transition-colors hover:bg-accent hover:text-accent-foreground`,children:[(0,P.jsx)(`span`,{className:`flex size-6 shrink-0 items-center justify-center rounded-md bg-muted text-muted-foreground`,children:(0,P.jsx)(y,{className:`size-3.5`,"aria-hidden":`true`})}),(0,P.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:e.name||e.id}),e.id==="default"&&(0,P.jsx)(`span`,{className:`rounded-full border border-border bg-muted px-1.5 py-0.5 text-xs font-semibold text-muted-foreground`,children:`Default`})]},e.id))]}),(0,P.jsx)(`div`,{className:`my-1.5 h-px bg-border`}),(0,P.jsxs)(`div`,{className:`flex items-center gap-1.5 px-2.5 pb-1 pt-1 text-xs font-semibold uppercase tracking-[0.08em] text-muted-foreground`,children:[(0,P.jsx)(b,{className:`size-3`,"aria-hidden":`true`}),`Team templates`]}),a.length===0?(0,P.jsxs)(`div`,{className:`rounded-lg bg-muted/40 px-3 py-2 text-xs leading-5 text-muted-foreground`,children:[`No team templates yet.`,` `,(0,P.jsx)(`a`,{href:`/templates/teams`,role:`menuitem`,className:`text-primary underline`,children:`Create one`}),`.`]}):a.map(e=>(0,P.jsxs)(`button`,{type:`button`,role:`menuitem`,disabled:e.slotCount===0,title:e.slotCount===0?`Add at least one member before spawning`:void 0,onClick:()=>{S(!1),m(e)},className:`unstyled flex min-h-8 w-full items-center gap-2 rounded-lg px-2.5 py-1.5 text-left text-sm text-foreground transition-colors hover:bg-accent hover:text-accent-foreground disabled:cursor-not-allowed disabled:opacity-50 disabled:hover:bg-transparent`,children:[(0,P.jsx)(`span`,{className:`flex size-6 shrink-0 items-center justify-center rounded-md bg-muted text-muted-foreground`,children:(0,P.jsx)(b,{className:`size-3.5`,"aria-hidden":`true`})}),(0,P.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:e.name||e.id}),(0,P.jsx)(`span`,{className:`inline-flex min-w-6 items-center justify-center rounded-full bg-muted px-1.5 font-mono text-xs text-muted-foreground`,children:e.slotCount})]},e.id)),(0,P.jsx)(`div`,{className:`my-1.5 h-px bg-border`}),(0,P.jsxs)(`button`,{type:`button`,role:`menuitem`,onClick:()=>{S(!1),_(!0)},className:`unstyled flex min-h-8 w-full items-center gap-2 rounded-lg px-2.5 py-1.5 text-left text-xs font-medium text-muted-foreground transition-colors hover:bg-accent hover:text-accent-foreground`,children:[(0,P.jsx)(s,{className:`size-3.5`,"aria-hidden":`true`}),`Create a team`]})]})]})]}),j&&(0,P.jsx)(`p`,{role:`alert`,className:`m-2 rounded-lg bg-danger/10 px-3 py-2 text-xs text-danger`,children:j}),(0,P.jsx)(`nav`,{className:`flex-1 overflow-y-auto p-1.5`,"aria-label":`Teams and agents`,children:e.length===0?(0,P.jsxs)(`div`,{className:`m-1 flex flex-col items-center rounded-xl border border-dashed border-border bg-muted/30 px-4 py-6 text-center`,children:[(0,P.jsx)(`span`,{className:`mb-2 flex size-9 items-center justify-center rounded-full bg-accent text-accent-foreground`,children:(0,P.jsx)(y,{className:`size-4`,"aria-hidden":`true`})}),(0,P.jsx)(`p`,{className:`text-sm font-semibold text-foreground`,children:`No agents yet`}),(0,P.jsx)(`p`,{className:`mt-1 text-xs leading-5 text-muted-foreground`,children:`Your default Team is ready. Spawn the first agent to start a conversation.`}),H[0]?(0,P.jsxs)(`button`,{type:`button`,onClick:()=>f({profileId:H[0]?.id??`default`}),className:`unstyled mt-3 inline-flex min-h-9 items-center gap-1 rounded-lg bg-primary px-3 text-xs font-semibold text-primary-foreground hover:bg-primary/90`,children:[`Spawn first agent`,(0,P.jsx)(o,{className:`size-3.5`,"aria-hidden":`true`})]}):(0,P.jsxs)(`a`,{href:`/templates/agents`,className:`mt-3 inline-flex items-center gap-1 text-xs font-semibold text-primary hover:text-primary/80`,children:[`Create an Agent template`,(0,P.jsx)(o,{className:`size-3.5`,"aria-hidden":`true`})]})]}):U.map(e=>{let t=W.get(e.id)??[],n=J===e.id,i=L[e.id];return(0,P.jsxs)(`details`,{open:i===void 0?n||e.id==="default":i,onToggle:t=>{let n=t.currentTarget.open;if(L[e.id]===n)return;let r={...L,[e.id]:n};Y(r),R(r),u.invalidate()},className:`team/details mb-1 last:mb-0`,children:[(0,P.jsxs)(`summary`,{className:`flex min-h-8 cursor-pointer list-none items-center gap-1.5 rounded-lg px-2 py-1.5 text-sm transition-colors hover:bg-accent hover:text-accent-foreground ${n?`bg-muted/60 text-foreground`:`text-muted-foreground`}`,children:[(0,P.jsx)(o,{className:`size-3.5 shrink-0 transition-transform team-open/details:rotate-90`,"aria-hidden":`true`}),(0,P.jsx)(`span`,{className:`flex size-5 shrink-0 items-center justify-center rounded-md bg-muted text-muted-foreground`,children:(0,P.jsx)(b,{className:`size-3`,"aria-hidden":`true`})}),(0,P.jsx)(`span`,{className:`min-w-0 flex-1 truncate font-medium`,children:e.name}),e.id==="default"&&(0,P.jsx)(`span`,{className:`text-xs font-semibold uppercase tracking-wide text-muted-foreground`,children:`Default`}),(0,P.jsx)(`span`,{className:`inline-flex min-w-6 items-center justify-center rounded-full border border-border bg-card px-1.5 font-mono text-xs text-muted-foreground`,children:t.length})]}),t.length===0?(0,P.jsx)(`div`,{className:`py-2 pl-12 pr-2 text-xs text-muted-foreground`,children:`No agents in this team`}):(0,P.jsx)(`div`,{className:`space-y-0.5 py-0.5 pl-2`,children:t.map(e=>(0,P.jsxs)(`div`,{className:`team/row relative rounded-lg`,children:[(0,P.jsxs)(r,{to:`/`,search:{agent:e.id},"aria-current":e.id===c?`page`:void 0,className:`block min-h-11 rounded-lg border border-transparent py-1.5 pl-2.5 pr-[4.6rem] transition-colors hover:bg-accent/70 ${e.id===c?`border-primary/20 bg-accent text-accent-foreground shadow-baziu-sm`:`text-foreground`}`,children:[(0,P.jsxs)(`div`,{className:`flex items-center gap-1.5 text-sm font-medium`,children:[(0,P.jsx)(`span`,{className:`size-1.5 shrink-0 rounded-full ${e.id===c?`bg-primary`:`bg-border`}`,"aria-hidden":`true`}),(0,P.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:e.name}),e.telegramTopicId!==null&&(0,P.jsx)(`span`,{className:`shrink-0 text-primary`,title:`Telegram topic #${e.telegramTopicId}`,"aria-label":`Bound to Telegram topic ${e.telegramTopicId}`,children:(0,P.jsx)(k,{className:`size-3`,"aria-hidden":`true`})})]}),(0,P.jsxs)(`div`,{className:`mt-0.5 flex gap-2 pl-3 font-mono text-xs text-muted-foreground`,children:[(0,P.jsx)(`span`,{className:`uppercase tracking-wide`,children:e.status}),(0,P.jsx)(`span`,{children:e.id.slice(0,8)})]})]}),(0,P.jsxs)(`div`,{className:`absolute right-1 top-1/2 z-10 flex -translate-y-1/2 gap-0.5`,children:[(0,P.jsx)(`button`,{type:`button`,onClick:()=>w(e),title:`Rename`,"aria-label":`Rename ${e.name}`,className:`unstyled flex size-8 items-center justify-center rounded-lg text-muted-foreground transition-colors hover:bg-card hover:text-primary focus-visible:bg-card`,children:(0,P.jsx)(O,{className:`size-3.5`,"aria-hidden":`true`})}),(0,P.jsx)(`button`,{type:`button`,onClick:()=>E(e),title:`Archive`,"aria-label":`Archive ${e.name}`,className:`unstyled flex size-8 items-center justify-center rounded-lg text-muted-foreground transition-colors hover:bg-destructive/10 hover:text-destructive focus-visible:bg-destructive/10 focus-visible:text-destructive`,children:(0,P.jsx)(D,{className:`size-3.5`,"aria-hidden":`true`})})]})]},e.id))})]},e.id)})}),d&&(0,P.jsx)(K,{profileId:d.profileId,teamHint:d.teamHint,teams:U,onClose:()=>{f(null),I()}}),p&&(0,P.jsx)(q,{profileGroup:p,teams:U,onClose:()=>{m(null),I()},onSpawned:e=>{m(null),u.navigate({to:`/teams/$id`,params:{id:e}})}}),h&&(0,P.jsx)(G,{onClose:()=>{_(!1),I()}}),(0,P.jsx)(Z,{agent:C,onOpenChange:e=>{e||w(null)},onRename:async(e,t)=>{M(null);try{await B(e,t)}catch(e){throw M(e instanceof Error?e.message:String(e)),e}}}),(0,P.jsx)(g,{open:T!==null,onOpenChange:e=>{e||E(null)},title:`Archive ${T?.name??`agent`}?`,description:(0,P.jsx)(`p`,{children:`The Agent will stop appearing in this sidebar and cannot receive normal work. You can restore it later from the Agents page with “Show archived”.`}),confirmLabel:`Archive agent`,confirmVariant:`primary`,onConfirm:async()=>{if(T){M(null);try{await V(T)}catch(e){throw M(e instanceof Error?e.message:String(e)),e}}}})]})}function Z({agent:e,onOpenChange:t,onRename:n}){let[r,i]=(0,A.useState)(``),[a,o]=(0,A.useState)(!1),[s,c]=(0,A.useState)(null);function l(n){!n&&a||(n&&e&&i(e.name),n||(i(``),c(null),o(!1)),t(n))}async function u(t){if(t.preventDefault(),!(!e||!r.trim()||r.trim()===e.name)){o(!0),c(null);try{await n(e,r),l(!1)}catch(e){c(e instanceof Error?e.message:String(e)),o(!1)}}}return(0,P.jsx)(L,{open:e!==null,onOpenChange:l,children:(0,P.jsx)(B,{showCloseButton:!a,children:(0,P.jsxs)(`form`,{onSubmit:e=>void u(e),children:[(0,P.jsxs)(V,{children:[(0,P.jsxs)(U,{children:[`Rename `,e?.name??`agent`]}),(0,P.jsx)(W,{children:`This changes the display name only; the Agent ID and history stay the same.`})]}),(0,P.jsxs)(`label`,{className:`mt-4 block text-sm font-semibold text-foreground`,children:[`Agent name`,(0,P.jsx)(`input`,{autoFocus:!0,className:`mt-1`,value:r||e?.name||``,onChange:e=>i(e.target.value),maxLength:120})]}),s&&(0,P.jsx)(`p`,{role:`alert`,className:`mt-3 text-sm text-danger`,children:s}),(0,P.jsxs)(H,{className:`mt-4`,children:[(0,P.jsx)(T,{variant:`ghost`,disabled:a,onClick:()=>l(!1),children:`Cancel`}),(0,P.jsx)(T,{variant:`primary`,type:`submit`,disabled:a||!r.trim()||r.trim()===e?.name,children:a?`Renaming…`:`Rename agent`})]})]})})})}function Q(){let e=S.useLoaderData(),t=e.selected?.resolved.agent.id??null;return(0,P.jsxs)(`div`,{className:`grid h-full min-h-0 grid-cols-1 gap-3 py-3 lg:grid-cols-[18rem_minmax(0,1fr)]`,children:[(0,P.jsx)(`div`,{className:`min-h-0 ${e.selected?`hidden lg:block`:``}`,children:(0,P.jsx)(X,{agents:e.agents,teams:e.teams,profiles:e.profiles,profileGroups:e.profileGroups,selectedAgentId:t,initialOpenGroups:e.initialOpenGroups})}),(0,P.jsx)(`section`,{className:`min-h-0 overflow-hidden ${e.selected?``:`hidden lg:block`}`,children:e.selected?(0,P.jsx)(E,{agentId:e.selected.resolved.agent.id,agentName:e.selected.resolved.agent.name,initialMessages:e.selected.initialMessages,initialSessionHead:e.selected.sessionHead}):(0,P.jsx)(`div`,{className:`flex h-full items-center justify-center rounded-2xl border border-dashed bg-card px-6 text-center text-muted-foreground`,children:(0,P.jsxs)(`div`,{className:`max-w-sm`,children:[(0,P.jsx)(`h1`,{className:`m-0 font-body text-lg font-semibold text-foreground`,children:e.agents.length===0?`Start your first conversation`:`Choose an agent`}),(0,P.jsx)(`p`,{className:`mt-2 text-sm leading-6`,children:e.agents.length===0?`Your default Team and Agent template are ready. Use “Spawn first agent” on the left to create a working member.`:`Pick an agent in the Team list to open its persistent conversation.`}),e.agents.length===0&&(0,P.jsx)(`a`,{href:`/agents`,className:`btn-primary mt-4 no-underline`,children:`Open agent setup`})]})})})]})}export{Q as component};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{t as e}from"./jsx-runtime-DGeXAQPT.js";import{g as t}from"./index-Cp6UHWr2.js";import{a as n,t as r}from"./Page-NV96O47A.js";import{t as i}from"./ConfigPage-BCLp-FUC.js";import{t as a}from"./FieldRow-D6REbYUa.js";var o=e(),s=`Other`;function c(e){let t=new Map;for(let n of e){let e=n.team??s,r=t.get(e)??[];r.push(n),t.set(e,r)}let n=Array.from(t,([e,t])=>({team:e,items:t}));return n.length>1&&n.sort((e,t)=>e.team===s?1:t.team===s?-1:0),n}function l(){let{services:e}=t.useLoaderData(),s=c(e);return(0,o.jsxs)(i,{active:`services`,title:`Services`,description:(0,o.jsx)(o.Fragment,{children:`Connect optional tools such as web search and crawlers. Secret values are encrypted; endpoint details remain inspectable and editable on this device.`}),children:[e.length===0&&(0,o.jsx)(r,{title:`No optional services`,description:`This Bazilion build has no additional service connectors registered.`}),s.map(({team:e,items:t})=>(0,o.jsxs)(`section`,{className:`space-y-3`,children:[(0,o.jsxs)(`div`,{children:[(0,o.jsx)(`h2`,{className:`m-0 font-body text-base font-semibold text-foreground`,children:e}),(0,o.jsx)(`p`,{className:`mt-1 text-xs text-muted-foreground`,children:`Open only the service you want to configure.`})]}),t.map(e=>{let t=e.fields.filter(e=>e.set).length;return(0,o.jsxs)(`details`,{open:t>0,className:`overflow-hidden rounded-2xl border border-border bg-card shadow-baziu-sm`,children:[(0,o.jsxs)(`summary`,{className:`flex cursor-pointer list-none items-center gap-3 px-4 py-4 marker:hidden sm:px-5`,children:[(0,o.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[(0,o.jsx)(`span`,{className:`block font-semibold text-foreground`,children:e.displayName}),(0,o.jsx)(`span`,{className:`mt-0.5 block font-mono text-xs text-muted-foreground`,children:e.id})]}),(0,o.jsx)(n,{variant:t>0?`success`:`neutral`,children:t>0?`${t} field${t===1?``:`s`} configured`:`Not configured`})]}),(0,o.jsxs)(`div`,{className:`border-t border-border px-4 py-4 sm:px-5`,children:[e.hint&&(0,o.jsx)(`p`,{className:`mb-2 text-sm text-muted-foreground`,children:e.hint}),e.fields.map(e=>(0,o.jsx)(a,{field:e},e.envVar))]})]},e.id)})]},e))]})}export{l as component};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as e,t}from"./jsx-runtime-DGeXAQPT.js";import{t as n}from"./react-3W8R1pOO.js";import{d as r}from"./preload-helper-bztXdkDj.js";import{t as i}from"./ConfirmDialog-CyL9A20V.js";import{S as a}from"./index-Cp6UHWr2.js";import{a as o,i as s,n as c,r as l,t as u}from"./Page-NV96O47A.js";import{t as d}from"./Button-ByiV6fpd.js";var f=e(n()),p=t();function m(){let e=a.useLoaderData(),t=r(),[n,m]=(0,f.useState)(null),[_,v]=(0,f.useState)(null);async function y(e){let n=await fetch(`/api/skills/${encodeURIComponent(e)}`,{method:`DELETE`});if(!n.ok&&n.status!==204){let e=await n.json().catch(()=>null);throw Error(e?.error??`Could not remove skill (${n.status})`)}await t.invalidate()}return(0,p.jsxs)(l,{size:`wide`,children:[(0,p.jsx)(c,{title:`Skills`,description:`Install and review the prompt-only skills available to your agents.`}),_&&(0,p.jsx)(`p`,{role:`alert`,className:`err`,children:_}),(0,p.jsx)(h,{onImported:()=>t.invalidate()}),(0,p.jsx)(s,{title:`Installed skills`,description:`${e.length} skill${e.length===1?``:`s`} available`,children:e.length===0?(0,p.jsx)(u,{title:`No skills installed`,description:`Import from OpenClaw, a server directory, or a ZIP archive to get started.`}):(0,p.jsx)(`div`,{className:`overflow-x-auto`,children:(0,p.jsxs)(`table`,{className:`m-0 min-w-[760px]`,children:[(0,p.jsx)(`thead`,{children:(0,p.jsxs)(`tr`,{children:[(0,p.jsx)(`th`,{children:`Name`}),(0,p.jsx)(`th`,{children:`Description`}),(0,p.jsx)(`th`,{children:`Scan`}),(0,p.jsx)(`th`,{children:`Source`}),(0,p.jsx)(`th`,{})]})}),(0,p.jsx)(`tbody`,{children:e.map(e=>(0,p.jsxs)(`tr`,{children:[(0,p.jsx)(`td`,{children:(0,p.jsx)(`code`,{children:e.name})}),(0,p.jsx)(`td`,{className:`max-w-xl`,children:e.parseError?(0,p.jsxs)(`div`,{className:`flex items-start gap-2 text-sm`,children:[(0,p.jsx)(o,{variant:`danger`,children:`Parse error`}),(0,p.jsx)(`span`,{className:`text-destructive`,children:e.parseError})]}):e.description}),(0,p.jsx)(`td`,{children:(0,p.jsx)(g,{findings:e.scanFindings??[]})}),(0,p.jsxs)(`td`,{className:`text-xs text-muted-foreground`,children:[(0,p.jsx)(`span`,{className:`font-mono`,children:e.source??`Unknown`}),e.importedAt&&(0,p.jsx)(`div`,{className:`mt-1 font-mono`,children:new Date(e.importedAt).toLocaleDateString()})]}),(0,p.jsx)(`td`,{className:`text-right`,children:(0,p.jsx)(d,{variant:`danger`,className:`whitespace-nowrap`,onClick:()=>{v(null),m(e)},children:`Remove`})})]},e.name))})]})})}),(0,p.jsx)(i,{open:n!==null,title:`Remove skill ${n?.name??``}?`,description:(0,p.jsxs)(`p`,{children:[`This permanently deletes the installed `,(0,p.jsx)(`code`,{className:`font-mono`,children:`SKILL.md`}),` and every helper script or asset in the `,(0,p.jsx)(`code`,{className:`font-mono`,children:n?.name}),` `,`directory. The skill becomes unavailable to every Agent and Agent template until it is imported again.`]}),confirmLabel:`delete installed skill`,onConfirm:async()=>{if(n)try{await y(n.name)}catch(e){throw v(e instanceof Error?e.message:String(e)),e}},onOpenChange:e=>{e||m(null)}})]})}function h({onImported:e}){let[t,n]=(0,f.useState)(`openclaw`),[r,i]=(0,f.useState)(``),[a,c]=(0,f.useState)(!1),[l,u]=(0,f.useState)(null),[m,h]=(0,f.useState)(!1),[g,y]=(0,f.useState)(null),[b,x]=(0,f.useState)([]),[S,C]=(0,f.useState)(!1),w=(0,f.useRef)(null);async function T(n){n.preventDefault(),y(null),x([]),C(!0);try{let n;if(t===`zip`){if(!l){y(`Choose a ZIP file first.`),C(!1);return}let e=new FormData;e.set(`file`,l),a&&e.set(`force`,`true`),n=await fetch(`/api/skills/import`,{method:`POST`,body:e})}else{let e;if(t===`openclaw`)e=`openclaw`;else if(e=r.trim(),!e){y(`Enter the server path.`),C(!1);return}n=await fetch(`/api/skills/import`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({source:e,force:a})})}if(!n.ok){let e=await n.json().catch(()=>null);throw x(e?.findings??[]),Error(e?.error??`${n.status} ${n.statusText}`)}x(v((await n.json().catch(()=>null))?.findings)),i(``),u(null),e()}catch(e){y(e.message)}finally{C(!1)}}function E(e){u(e.target.files?.[0]??null)}function D(e){e.preventDefault(),h(!1);let t=e.dataTransfer?.files;if(!t||t.length===0)return;let n=t[0];if(n){if(!/\.zip$/i.test(n.name)){y(`Only ZIP archives are supported.`);return}if(u(n),w.current){let e=new DataTransfer;e.items.add(n),w.current.files=e.files}}}let O=b.some(e=>e.severity===`danger`)?`danger`:`warning`;return(0,p.jsxs)(s,{title:`Import skills`,description:(0,p.jsxs)(p.Fragment,{children:[`Choose a source. Each skill's `,(0,p.jsx)(`code`,{children:`SKILL.md`}),` body is injected into the system prompt of any agent it is attached to.`]}),children:[(0,p.jsx)(`div`,{role:`tablist`,className:`mb-5 inline-flex max-w-full gap-0 overflow-x-auto rounded-lg border border-border bg-muted p-1`,children:[{id:`openclaw`,label:`OpenClaw`},{id:`path`,label:`Server directory`},{id:`zip`,label:`Upload ZIP`}].map(e=>(0,p.jsx)(`button`,{type:`button`,role:`tab`,"aria-selected":t===e.id,onClick:()=>{n(e.id),y(null)},className:`unstyled cursor-pointer whitespace-nowrap rounded-md border-none bg-transparent px-3 py-1.5 text-sm font-medium transition-colors ${t===e.id?`bg-card text-accent-foreground shadow-baziu-sm`:`text-muted-foreground hover:bg-accent/50 hover:text-foreground`}`,children:e.label},e.id))}),g&&(0,p.jsx)(`div`,{role:`alert`,className:`mb-4 rounded-lg border border-destructive/20 bg-destructive/10 px-4 py-3 text-sm text-destructive`,children:g}),b.length>0&&(0,p.jsxs)(`div`,{className:`mb-4 rounded-lg border border-border bg-muted/30 p-4 text-sm`,children:[(0,p.jsx)(o,{variant:O,className:`mb-2`,children:`Scan findings`}),(0,p.jsx)(_,{findings:b})]}),(0,p.jsxs)(`form`,{className:`space-y-4`,onSubmit:T,children:[t===`openclaw`&&(0,p.jsxs)(`p`,{className:`text-sm leading-6 text-muted-foreground`,children:[`One-click import of every skill found in `,(0,p.jsx)(`code`,{children:`~/.openclaw/skills`}),` on the server.`]}),t===`path`&&(0,p.jsxs)(p.Fragment,{children:[(0,p.jsxs)(`p`,{className:`text-sm leading-6 text-muted-foreground`,children:[`Import from an absolute path on the server — either a single skill folder (contains `,(0,p.jsx)(`code`,{children:`SKILL.md`}),`) or a parent folder holding many skill subfolders.`]}),(0,p.jsxs)(`label`,{className:`max-w-2xl`,children:[`Server path`,(0,p.jsx)(`input`,{value:r,onChange:e=>i(e.target.value),placeholder:`/home/you/my-skills`,required:!0})]})]}),t===`zip`&&(0,p.jsxs)(p.Fragment,{children:[(0,p.jsxs)(`p`,{className:`text-sm leading-6 text-muted-foreground`,children:[`Upload a `,(0,p.jsx)(`code`,{children:`.zip`}),` archive whose top level contains one folder per skill — the folder name becomes the skill name.`]}),(0,p.jsxs)(`label`,{onDragOver:e=>{e.preventDefault(),h(!0)},onDragLeave:()=>h(!1),onDrop:D,className:`block cursor-pointer rounded-xl border-2 border-dashed p-8 text-center transition-colors ${m?`border-primary bg-accent text-accent-foreground`:l?`border-solid border-primary/40 bg-card text-foreground`:`border-border bg-muted/30 text-muted-foreground hover:border-primary hover:bg-accent hover:text-accent-foreground`}`,children:[(0,p.jsx)(`input`,{ref:w,type:`file`,accept:`.zip,application/zip`,onChange:E,className:`absolute h-px w-px overflow-hidden opacity-0`}),l?(0,p.jsx)(`span`,{className:`block break-all font-mono text-sm text-accent-foreground`,children:l.name}):(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)(`span`,{className:`block text-sm font-medium text-foreground`,children:`Click to choose a ZIP file`}),(0,p.jsx)(`span`,{className:`text-xs`,children:`or drag and drop it here`})]})]})]}),(0,p.jsxs)(`div`,{className:`flex flex-wrap items-center gap-3`,children:[(0,p.jsx)(d,{variant:`primary`,type:`submit`,disabled:S,children:S?`Importing…`:t===`zip`?`Upload and import`:t===`openclaw`?`Import from OpenClaw`:`Import`}),(0,p.jsxs)(`label`,{className:`m-0 inline-flex cursor-pointer items-center gap-1 text-sm text-foreground`,children:[(0,p.jsx)(`input`,{type:`checkbox`,checked:a,onChange:e=>c(e.target.checked)}),(0,p.jsx)(`span`,{children:`Overwrite existing`}),(0,p.jsx)(`span`,{className:`text-muted-foreground`,children:`and confirm scan findings`})]})]})]})]})}function g({findings:e}){return e.length===0?(0,p.jsx)(o,{variant:`success`,children:`Clean`}):(0,p.jsxs)(`details`,{className:`text-xs`,children:[(0,p.jsx)(`summary`,{className:`cursor-pointer list-none`,children:(0,p.jsxs)(o,{variant:e.some(e=>e.severity===`danger`)?`danger`:`warning`,children:[e.length,` finding`,e.length===1?``:`s`]})}),(0,p.jsx)(`div`,{className:`mt-2 min-w-64`,children:(0,p.jsx)(_,{findings:e})})]})}function _({findings:e}){return(0,p.jsx)(`ul`,{className:`m-0 space-y-1.5 pl-0`,children:e.map((e,t)=>(0,p.jsxs)(`li`,{className:`flex items-start gap-2`,children:[(0,p.jsx)(o,{variant:e.severity===`danger`?`danger`:`warning`,children:e.severity===`danger`?`Danger`:`Warning`}),(0,p.jsxs)(`span`,{children:[(0,p.jsx)(`code`,{children:e.code}),e.line?`, line ${e.line}`:``,` — `,e.message]})]},`${e.code}-${e.line??0}-${t}`))})}function v(e){return e?Object.entries(e).flatMap(([e,t])=>t.map(t=>({...t,message:`${e}: ${t.message}`}))):[]}export{m as component};
|