tide-commander 1.54.1 → 1.55.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/{BossLogsModal-DUiZqNgH.js → BossLogsModal-NMLA8Tb-.js} +1 -1
- package/dist/assets/BossSpawnModal-CHWYUZ5g.js +1 -0
- package/dist/assets/{ControlsModal-BfDKWXvW.js → ControlsModal-B7YvUMVm.js} +1 -1
- package/dist/assets/{DockerLogsModal-DqA2Giuu.js → DockerLogsModal-CaspMYEh.js} +1 -1
- package/dist/assets/{EmbeddedEditor-DTtGbPaL.js → EmbeddedEditor-kYx4AdLw.js} +1 -1
- package/dist/assets/GmailOAuthSetup-9eQ1r9Ar.js +388 -0
- package/dist/assets/{GoogleOAuthSetup-B2iKiwfK.js → GoogleOAuthSetup-Pi7a58Mi.js} +1 -1
- package/dist/assets/{IframeModal-DdNbye_X.js → IframeModal-z1T59LJS.js} +1 -1
- package/dist/assets/IntegrationsPanel-CB9QtfvD.js +2 -0
- package/dist/assets/{LogViewerModal-c75TXerK.js → LogViewerModal-BBdr9r3i.js} +1 -1
- package/dist/assets/MonitoringModal-CUZ4Xhuk.js +1 -0
- package/dist/assets/{PM2LogsModal-DH0yYlop.js → PM2LogsModal-Bt16sW5A.js} +1 -1
- package/dist/assets/RestoreArchivedAreaModal-BETGHA22.js +1 -0
- package/dist/assets/{Scene2DCanvas-DAoKvsnu.js → Scene2DCanvas-BelfJXGw.js} +1 -1
- package/dist/assets/{SceneManager-CMXAQhzJ.js → SceneManager-BI_UCXtB.js} +1 -1
- package/dist/assets/{SkillsPanel-DHM98LMN.js → SkillsPanel-BHjnx8LP.js} +3 -3
- package/dist/assets/SpawnModal-Dwfx-NFz.js +1 -0
- package/dist/assets/SubordinateAssignmentModal-DHRZ-Evy.js +1 -0
- package/dist/assets/{TriggerManagerPanel-DhB30aBg.js → TriggerManagerPanel-cUWM5poU.js} +2 -2
- package/dist/assets/{WorkflowEditorPanel-Dk45mTwM.js → WorkflowEditorPanel-Ha9SXdvW.js} +2 -2
- package/dist/assets/{index-DGyFiR6f.js → index-BsEoXc0j.js} +2 -2
- package/dist/assets/{index-D4P-SR9b.js → index-BvZsOpS_.js} +28 -28
- package/dist/assets/index-CD9Q_div.js +1 -0
- package/dist/assets/index-CesYqhoW.js +1 -0
- package/dist/assets/index-DBgGw8Bd.js +1 -0
- package/dist/assets/index-De9wibqy.js +8 -0
- package/dist/assets/index-Vcs3Odgf.js +5 -0
- package/dist/assets/index-xU9wiWEU.js +1 -0
- package/dist/assets/main-B_0o0aI9.js +198 -0
- package/dist/assets/main-DTgTDvIL.css +1 -0
- package/dist/assets/pdf.worker.min-FHbmGBN0.mjs +28 -0
- package/dist/assets/{web-DEy5Qeug.js → web-D2W-1YTG.js} +1 -1
- package/dist/assets/{web-Digk7n-G.js → web-DGSbcqAM.js} +1 -1
- package/dist/index.html +2 -2
- package/dist/src/packages/server/claude/runner.js +50 -4
- package/dist/src/packages/server/routes/files.js +4 -0
- package/dist/src/packages/server/services/runtime-command-execution.js +21 -12
- package/package.json +3 -1
- package/dist/assets/BossSpawnModal-DkqJhT13.js +0 -1
- package/dist/assets/GmailOAuthSetup-jYL6ePTR.js +0 -388
- package/dist/assets/IntegrationsPanel-Bdjlb9px.js +0 -2
- package/dist/assets/MonitoringModal-CpGtVwp4.js +0 -1
- package/dist/assets/RestoreArchivedAreaModal-CSK1xNmN.js +0 -1
- package/dist/assets/SpawnModal-DMet2_YC.js +0 -1
- package/dist/assets/SubordinateAssignmentModal-CvAG5u8C.js +0 -1
- package/dist/assets/index-6Omcq88H.js +0 -5
- package/dist/assets/index-BEDuwNpM.js +0 -1
- package/dist/assets/index-BPe2uM0c.js +0 -8
- package/dist/assets/index-C5UQle-d.js +0 -1
- package/dist/assets/index-CShAh11Z.js +0 -1
- package/dist/assets/index-dWOReLiF.js +0 -1
- package/dist/assets/main-DmwZJVMh.js +0 -145
- package/dist/assets/main-zQD-7B9r.css +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{u as M,f as N,r as m,s as u,j as r}from"./main-
|
|
1
|
+
import{u as M,f as N,r as m,s as u,j as r}from"./main-B_0o0aI9.js";import{L as v}from"./LogViewerModal-BBdr9r3i.js";import"./modulepreload-polyfill-B5Qt9EMX.js";import"./vendor-react--Eh9ivFN.js";import"./vendor-three-Chj50gSY.js";function C(o){const n=["#3498db","#2ecc71","#9b59b6","#e67e22","#1abc9c","#e74c3c","#f1c40f","#00bcd4"];let a=0;for(let t=0;t<o.length;t++)a=o.charCodeAt(t)+((a<<5)-a);return n[Math.abs(a)%n.length]}function w({building:o,isOpen:n,onClose:a}){const{t}=M(["terminal","common"]),{bossStreamingLogs:b,buildings:f}=N(),l=b.get(o.id)||[],[i,d]=m.useState(null),c=o.subordinateBuildingIds||[],g=c.map(e=>f.get(e)).filter(e=>e!==void 0);m.useEffect(()=>(n&&c.length>0&&u.startBossLogStreaming(o.id),()=>{o.id&&u.stopBossLogStreaming(o.id)}),[n,o.id,c.length]);const h=m.useMemo(()=>{const e=new Set;return l.forEach(s=>e.add(s.subordinateName)),Array.from(e)},[l]),p=m.useMemo(()=>(i?l.filter(s=>s.subordinateName===i):l).map((s,j)=>({text:s.chunk,lineNumber:j+1,sourceLabel:s.subordinateName,sourceColor:C(s.subordinateName),isError:s.isError})),[l,i]),x=g.some(e=>{var s;return(s=e.pm2)==null?void 0:s.enabled}),S=h.length>1?r.jsxs("select",{className:"toolbar-btn source-filter",value:i||"",onChange:e=>d(e.target.value||null),children:[r.jsx("option",{value:"",children:t("terminal:logs.allSources")}),h.map(e=>r.jsx("option",{value:e,children:e},e))]}):void 0,L=i?r.jsxs("div",{className:"shortcut",style:{marginLeft:"auto"},children:[r.jsxs("span",{children:[t("terminal:logs.filtered"),": ",i]}),r.jsx("button",{style:{background:"transparent",border:"none",color:"inherit",cursor:"pointer",marginLeft:"0.5rem"},onClick:()=>d(null),children:"x"})]}):void 0;return r.jsx(v,{isOpen:n,onClose:a,title:`${o.name} - ${t("terminal:logs.bossLogs")}`,icon:"👑",lines:p,isStreaming:c.length>0,streamingIndicatorLabel:`${g.length} ${t("terminal:logs.units")}`,onClear:()=>u.clearBossStreamingLogs(o.id),emptyMessage:x?l.length===0?t("terminal:logs.waitingForLogs"):t("terminal:logs.noMatchingLogs"):t("terminal:logs.noPM2Subordinates"),extraToolbar:S,extraFooter:L,modalClassName:"boss-logs-modal"})}export{w as BossLogsModal};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{u as Ie,N as Ee,a0 as De,$ as _e,r as t,a3 as Be,S as ae,l as Re,a4 as O,A as ne,ae as z,s as T,af as j,j as s,G as S,a6 as Oe,a8 as ze,I as L,a9 as P,aa as g,ab as I,ad as Te}from"./main-B_0o0aI9.js";import"./modulepreload-polyfill-B5Qt9EMX.js";import"./vendor-react--Eh9ivFN.js";import"./vendor-three-Chj50gSY.js";function le(u){const h=j.filter(C=>!u.has(`Boss ${C}`));return h.length===0?`Boss ${j[Math.floor(Math.random()*j.length)]}-${Date.now()%1e3}`:`Boss ${h[Math.floor(Math.random()*h.length)]}`}function We({isOpen:u,onClose:h,onSpawnStart:C,onSpawnEnd:E,spawnPosition:te}){const{t:n}=Ie(["terminal","common"]),q=Ee(),o=De(),k=_e(),[r,p]=t.useState(""),[M,ie]=t.useState(()=>Be(ae.LAST_CWD)),[c,D]=t.useState("boss"),[F,U]=t.useState(!1),[ce,y]=t.useState(!1),[W,oe]=t.useState(!0),[G,re]=t.useState("bypass"),[d,_]=t.useState("claude"),[b,N]=t.useState({fullAuto:!0,sandbox:"workspace-write",approvalMode:"on-request",search:!1}),[K,de]=t.useState("opus[1m]"),[H,pe]=t.useState("gpt-5.3-codex"),[v,$]=t.useState(new Set),[J,B]=t.useState(new Set),[m,me]=t.useState(""),[f,ue]=t.useState(""),[V,he]=t.useState(""),A=t.useRef(null),R=t.useRef(!1),X=t.useRef(!1),w=t.useMemo(()=>k.filter(e=>e.enabled),[k]),Y=t.useMemo(()=>{if(!f.trim())return w;const e=f.toLowerCase();return w.filter(a=>a.name.toLowerCase().includes(e)||a.description.toLowerCase().includes(e)||a.slug.toLowerCase().includes(e))},[w,f]),xe=t.useMemo(()=>{var a;const e=o.find(l=>l.id===c);return(a=e==null?void 0:e.defaultSkillIds)!=null&&a.length?k.filter(l=>e.defaultSkillIds.includes(l.id)):[]},[o,c,k]),we=["full-notifications","streaming-exec","task-label","report-task-to-boss","send-message-to-agent"];t.useEffect(()=>{if(u&&!X.current&&w.length>0){const a=w.filter(l=>we.includes(l.slug)).map(l=>l.id);a.length>0&&B(new Set(a))}X.current=u},[u,w]);const be=t.useCallback(e=>{B(a=>{const l=new Set(a);return l.has(e)?l.delete(e):l.add(e),l})},[]),i=t.useMemo(()=>o.find(e=>e.id===c),[o,c]),fe=t.useMemo(()=>{if(i!=null&&i.model)return i.model},[i]),je=t.useMemo(()=>{if(i!=null&&i.customModelPath)return Re(`/api/custom-models/${i.id}`)},[i]),Ne=i==null?void 0:i.modelScale,ve=t.useMemo(()=>i?"scout":c==="boss"?"architect":c,[c,i]),Q=t.useMemo(()=>Array.from(q.values()).filter(e=>!e.isBoss&&e.class!=="boss"&&!e.bossId),[q]),Z=t.useMemo(()=>{if(!m.trim())return o;const e=m.toLowerCase();return o.filter(a=>a.name.toLowerCase().includes(e)||a.description.toLowerCase().includes(e)||a.id.toLowerCase().includes(e))},[o,m]),ee=t.useMemo(()=>{if(!m.trim())return O;const e=m.toLowerCase();return O.filter(a=>{const l=ne[a.id];return l?a.name.toLowerCase().includes(e)||a.id.toLowerCase().includes(e)||l.description.toLowerCase().includes(e):!1})},[m]),se=t.useMemo(()=>{if(!m.trim())return!0;const e=m.toLowerCase(),a=z.boss;return"boss".includes(e)||a.description.toLowerCase().includes(e)},[m]);t.useEffect(()=>{if(u&&!R.current){R.current=!0;const e=new Set(Array.from(T.getState().agents.values()).map(l=>l.name)),a=o.find(l=>l.id===c);if(a){const l=j.filter(x=>!e.has(`${a.name} ${x}`));if(l.length===0){const x=j[Math.floor(Math.random()*j.length)];p(`${a.name} ${x}-${Date.now()%1e3}`)}else p(`${a.name} ${l[Math.floor(Math.random()*l.length)]}`)}else p(le(e));$(new Set),A.current&&(A.current.focus(),A.current.select())}else u||(R.current=!1)},[u]),t.useEffect(()=>{if(!u)return;const e=o.find(a=>a.id===c);if(e)if(r.startsWith("Boss ")){const a=r.substring(5);p(`${e.name} ${a}`)}else{const a=o.find(l=>r.startsWith(l.name+" "));if(a){const l=r.substring(a.name.length+1);p(`${e.name} ${l}`)}else p(`${e.name} ${r}`)}else{const a=o.find(l=>r.startsWith(l.name+" "));if(a){const l=r.substring(a.name.length+1);p(`Boss ${l}`)}else r.startsWith("Boss ")||p(`Boss ${r}`)}},[c]);const Se=()=>{if(y(!1),!M.trim()){y(!0);return}if(!r.trim()){const l=new Set(Array.from(T.getState().agents.values()).map(x=>x.name));p(le(l));return}Te(ae.LAST_CWD,M),C();const e=V.trim()||void 0,a=Array.from(J);T.spawnBossAgent(r.trim(),c,M.trim(),te||void 0,Array.from(v),d==="claude"?W:!1,G,d,d==="codex"?b:void 0,d==="codex"?H:void 0,d==="claude"?K:void 0,e,a),p(""),$(new Set),B(new Set),E(),h()},ge=()=>{U(!1),p(""),$(new Set),E(),h()},Ce=()=>{U(!1),y(!0),E()};t.useEffect(()=>(window.__bossSpawnModalSuccess=ge,window.__bossSpawnModalError=Ce,()=>{delete window.__bossSpawnModalSuccess,delete window.__bossSpawnModalError}),[r]);const ke=e=>{e.target===e.currentTarget&&h()},Me=e=>{e.key==="Escape"&&h()},ye=e=>{const a=new Set(v);a.has(e)?a.delete(e):a.add(e),$(a)};if(!u)return null;const $e=z.boss;return s.jsx("div",{className:`modal-overlay ${u?"visible":""}`,onClick:ke,onKeyDown:Me,children:s.jsxs("div",{className:"modal boss-spawn-modal",children:[s.jsxs("div",{className:"modal-header",children:[s.jsx(S,{classId:"boss",size:22,className:"boss-header-icon"}),n("terminal:spawn.deployBossTitle")]}),s.jsxs("div",{className:"modal-body spawn-modal-body",children:[s.jsxs("div",{className:"spawn-top-section",children:[s.jsx("div",{className:"spawn-preview-compact",children:s.jsx(Oe,{agentClass:ve,modelFile:fe,customModelUrl:je,modelScale:Ne,width:100,height:120})}),s.jsxs("div",{className:"spawn-class-section",children:[s.jsx("div",{className:"spawn-class-label",children:n("terminal:spawn.bossClass")}),o.length+O.length+1>6&&s.jsx("input",{type:"text",className:"spawn-input class-search-input",placeholder:n("terminal:spawn.filterClasses"),value:m,onChange:e=>me(e.target.value)}),s.jsxs("div",{className:"class-selector-inline",children:[Z.map(e=>s.jsxs("button",{className:`class-chip ${c===e.id?"selected":""}`,onClick:()=>D(e.id),title:e.description,children:[s.jsx(S,{classId:e.id,size:18,className:"class-chip-icon"}),s.jsx("span",{className:"class-chip-name",children:e.name})]},e.id)),se&&s.jsxs("button",{className:`class-chip ${c==="boss"?"selected":""}`,onClick:()=>D("boss"),title:$e.description,children:[s.jsx(S,{classId:"boss",size:18,className:"class-chip-icon"}),s.jsx("span",{className:"class-chip-name",children:n("terminal:spawn.bossClassName")})]}),ee.map(e=>{const a=ne[e.id];return a?s.jsxs("button",{className:`class-chip ${c===e.id?"selected":""}`,onClick:()=>D(e.id),title:a.description,children:[s.jsx(S,{classId:e.id,size:18,className:"class-chip-icon"}),s.jsx("span",{className:"class-chip-name",children:e.name})]},e.id):null}),m&&Z.length===0&&!se&&ee.length===0&&s.jsx("div",{className:"class-search-empty",children:n("terminal:spawn.noClassesMatch",{query:m})})]})]})]}),s.jsxs("div",{className:"spawn-form-section",children:[s.jsxs("div",{className:"spawn-form-row",children:[s.jsxs("div",{className:"spawn-field",children:[s.jsx("label",{className:"spawn-label",children:n("common:labels.name")}),s.jsx("input",{ref:A,type:"text",className:"spawn-input",placeholder:n("terminal:spawn.bossNamePlaceholder"),value:r,onChange:e=>p(e.target.value)})]}),s.jsxs("div",{className:"spawn-field spawn-field-wide",children:[s.jsx("label",{className:"spawn-label",children:n("terminal:spawn.workingDir")}),s.jsx(ze,{value:M,onChange:e=>{ie(e),y(!1)},placeholder:n("terminal:spawn.workingDirPlaceholder"),className:"spawn-input",hasError:ce,directoriesOnly:!0})]})]}),s.jsxs("div",{className:"spawn-form-row",children:[s.jsxs("div",{className:"spawn-field",children:[s.jsx("label",{className:"spawn-label",children:n("common:labels.runtime")}),s.jsxs("div",{className:"spawn-select-row",children:[s.jsxs("button",{className:`spawn-select-btn ${d==="claude"?"selected":""}`,onClick:()=>_("claude"),title:n("terminal:spawn.useClaudeCli"),children:[s.jsx("img",{src:"/assets/claude.ico",alt:"Claude",className:"spawn-provider-icon"}),s.jsx("span",{children:"Claude"})]}),s.jsxs("button",{className:`spawn-select-btn ${d==="codex"?"selected":""}`,onClick:()=>_("codex"),title:n("terminal:spawn.useCodexCli"),children:[s.jsx("img",{src:"/assets/codex.ico",alt:"Codex",className:"spawn-provider-icon"}),s.jsx("span",{children:"Codex"})]}),s.jsxs("button",{className:`spawn-select-btn spawn-select-btn--opencode ${d==="opencode"?"selected":""}`,onClick:()=>_("opencode"),title:"Use OpenCode CLI (multi-provider)",children:[s.jsx("span",{children:s.jsx(L,{name:"status-pending",size:14,weight:"fill",color:"#4ade80"})}),s.jsx("span",{children:"OpenCode"})]})]})]}),s.jsxs("div",{className:"spawn-field",children:[s.jsx("label",{className:"spawn-label",children:n("common:labels.permissions")}),s.jsx("div",{className:"spawn-select-row",children:Object.keys(P).map(e=>s.jsxs("button",{className:`spawn-select-btn ${G===e?"selected":""}`,onClick:()=>re(e),title:P[e].description,children:[s.jsx("span",{children:s.jsx(L,{name:e==="bypass"?"bolt":"lock",size:14})}),s.jsx("span",{children:P[e].label})]},e))})]})]}),s.jsxs("div",{className:"spawn-form-row",children:[s.jsxs("div",{className:"spawn-field",children:[s.jsx("label",{className:"spawn-label",children:n("common:labels.model")}),d==="claude"?s.jsx("div",{className:"spawn-select-row",children:Object.keys(g).filter(e=>!g[e].deprecated).map(e=>s.jsxs("button",{className:`spawn-select-btn ${K===e?"selected":""}`,onClick:()=>de(e),title:g[e].description,children:[s.jsx("span",{children:g[e].icon}),s.jsx("span",{children:g[e].label})]},e))}):d==="codex"?s.jsx("div",{className:"spawn-select-row spawn-select-row--codex-models",children:Object.keys(I).map(e=>s.jsxs("button",{className:`spawn-select-btn ${H===e?"selected":""}`,onClick:()=>pe(e),title:I[e].description,children:[s.jsx("span",{children:I[e].icon}),s.jsx("span",{children:I[e].label})]},e))}):d==="opencode"?s.jsx("input",{type:"text",className:"spawn-input",defaultValue:"minimax/MiniMax-M1-80k",placeholder:"provider/model (e.g., minimax/MiniMax-M1-80k)"}):s.jsx("div",{className:"spawn-inline-hint",children:n("terminal:spawn.codex.configuration")})]}),s.jsxs("div",{className:"spawn-field",children:[s.jsx("label",{className:"spawn-label",children:n("common:labels.browser")}),s.jsx("div",{className:"spawn-form-row spawn-options-row",children:s.jsxs("label",{className:"spawn-checkbox",children:[s.jsx("input",{type:"checkbox",checked:W,onChange:e=>oe(e.target.checked),disabled:d!=="claude"}),s.jsx("span",{children:n("terminal:spawn.chromeBrowser")})]})})]})]}),d==="codex"&&s.jsx("div",{className:"spawn-form-row",children:s.jsxs("div",{className:"spawn-field",children:[s.jsx("label",{className:"spawn-label",children:n("terminal:spawn.codex.config")}),s.jsxs("div",{className:"spawn-options-row",style:{display:"flex",flexDirection:"column",gap:8},children:[s.jsxs("label",{className:"spawn-checkbox",children:[s.jsx("input",{type:"checkbox",checked:b.fullAuto!==!1,onChange:e=>N(a=>({...a,fullAuto:e.target.checked}))}),s.jsx("span",{children:n("terminal:spawn.codex.useFullAuto")})]}),s.jsxs("label",{className:"spawn-checkbox",children:[s.jsx("input",{type:"checkbox",checked:!!b.search,onChange:e=>N(a=>({...a,search:e.target.checked}))}),s.jsx("span",{children:n("terminal:spawn.codex.enableSearch")})]}),b.fullAuto===!1&&s.jsxs(s.Fragment,{children:[s.jsxs("select",{className:"spawn-input",value:b.sandbox||"workspace-write",onChange:e=>N(a=>({...a,sandbox:e.target.value})),children:[s.jsx("option",{value:"read-only",children:n("terminal:spawn.codex.sandboxReadOnly")}),s.jsx("option",{value:"workspace-write",children:n("terminal:spawn.codex.sandboxWorkspaceWrite")}),s.jsx("option",{value:"danger-full-access",children:n("terminal:spawn.codex.sandboxDangerFullAccess")})]}),s.jsxs("select",{className:"spawn-input",value:b.approvalMode||"on-request",onChange:e=>N(a=>({...a,approvalMode:e.target.value})),children:[s.jsx("option",{value:"untrusted",children:n("terminal:spawn.codex.approvalsUntrusted")}),s.jsx("option",{value:"on-failure",children:n("terminal:spawn.codex.approvalsOnFailure")}),s.jsx("option",{value:"on-request",children:n("terminal:spawn.codex.approvalsOnRequest")}),s.jsx("option",{value:"never",children:n("terminal:spawn.codex.approvalsNever")})]})]}),s.jsx("input",{type:"text",className:"spawn-input",placeholder:n("terminal:spawn.codex.profileOptional"),value:b.profile||"",onChange:e=>N(a=>({...a,profile:e.target.value||void 0}))})]})]})}),w.length>0&&s.jsxs("div",{className:"spawn-skills-section",children:[s.jsxs("label",{className:"spawn-label",children:[n("terminal:spawn.skills")," ",s.jsxs("span",{className:"spawn-label-hint",children:["(",n("common:labels.optional"),")"]})]}),w.length>6&&s.jsx("input",{type:"text",className:"spawn-input skill-search-input",placeholder:n("terminal:spawn.filterSkills"),value:f,onChange:e=>ue(e.target.value)}),s.jsxs("div",{className:"spawn-skills-inline",children:[Y.map(e=>{const a=J.has(e.id);return xe.some(x=>x.id===e.id)?null:s.jsxs("button",{className:`spawn-skill-chip ${a?"selected":""}`,onClick:()=>be(e.id),title:e.description,children:[a&&s.jsx("span",{className:"spawn-skill-check",children:s.jsx(L,{name:"check",size:12})}),s.jsx("span",{children:e.name}),e.builtin&&s.jsx("span",{className:"spawn-skill-builtin",children:"TC"})]},e.id)}),f&&Y.length===0&&s.jsx("div",{className:"skill-search-empty",children:n("terminal:spawn.noSkillsMatch",{query:f})})]})]}),s.jsxs("div",{className:"spawn-custom-instructions-section",children:[s.jsxs("label",{className:"spawn-label",children:[n("terminal:spawn.customInstructions")," ",s.jsxs("span",{className:"spawn-label-hint",children:["(",n("common:labels.optional"),")"]})]}),s.jsx("textarea",{className:"spawn-input spawn-textarea",placeholder:n("terminal:spawn.customInstructionsBossPlaceholder"),value:V,onChange:e=>he(e.target.value),rows:3})]}),s.jsxs("div",{className:"spawn-subordinates-section",children:[s.jsxs("label",{className:"spawn-label",children:[n("terminal:spawn.initialSubordinates")," ",s.jsxs("span",{className:"spawn-label-hint",children:["(",n("common:labels.optional"),")"]})]}),s.jsx("div",{className:"subordinates-selector-compact",children:Q.length===0?s.jsx("div",{className:"subordinates-empty",children:n("terminal:spawn.noAvailableAgents")}):Q.map(e=>{const a=v.has(e.id),l=z[e.class],x=o.find(Le=>Le.id===e.class),Ae=l||x||{color:"#888888"};return s.jsxs("button",{className:`subordinate-chip ${a?"selected":""}`,onClick:()=>ye(e.id),children:[a&&s.jsx("span",{className:"subordinate-check",children:s.jsx(L,{name:"check",size:12})}),s.jsx("span",{className:"subordinate-chip-icon",style:{color:Ae.color},children:s.jsx(S,{classId:e.class,size:16})}),s.jsx("span",{className:"subordinate-chip-name",children:e.name})]},e.id)})}),v.size>0&&s.jsxs("div",{className:"subordinates-count",children:[v.size," ",n("common:labels.selected").toLowerCase()]})]})]})]}),s.jsxs("div",{className:"modal-footer",children:[s.jsx("button",{className:"btn btn-secondary",onClick:h,children:n("common:buttons.cancel")}),s.jsx("button",{className:"btn btn-boss",onClick:Se,disabled:F,children:n(F?"common:buttons.deploying":"common:buttons2.deployBoss")})]})]})})}export{We as BossSpawnModal};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{u as T,f as X,b7 as W,b8 as Z,r as x,z as _,h as q,b6 as L,b9 as A,ba as H,j as e,bb as Q,s as b,bc as V,bd as R}from"./main-DmwZJVMh.js";import"./modulepreload-polyfill-B5Qt9EMX.js";import"./vendor-react--Eh9ivFN.js";import"./vendor-three-Chj50gSY.js";const G={global:"terminal:controls.contextGlobal",commander:"terminal:controls.contextCommander",toolbox:"terminal:controls.contextToolbox"},J={global:"terminal:controls.contextGlobalDesc",commander:"terminal:controls.contextCommanderDesc",toolbox:"terminal:controls.contextToolboxDesc"},U={camera:["camera-pan","camera-orbit","camera-rotate","camera-zoom","camera-tilt"],interaction:["primary-action","selection-box","context-menu","move-command"]},ee={camera:"terminal:controls.cameraControls",interaction:"terminal:controls.interaction"};function ie({isOpen:s,onClose:r}){const{t:a}=T(["terminal","common"]),l=X(),c=W(),h=Z(),[m,v]=x.useState("keyboard"),[j,g]=x.useState(""),[p,N]=x.useState("all"),[d,f]=x.useState(!1),[o,k]=x.useState(null),u=_.useRef(null),{handleMouseDown:D,handleClick:w}=q(r);if(x.useEffect(()=>{if(!s||d)return;const t=n=>{n.key==="Escape"&&(n.preventDefault(),n.stopPropagation(),r())};return document.addEventListener("keydown",t,!0),()=>document.removeEventListener("keydown",t,!0)},[s,r,d]),x.useEffect(()=>{s||(g(""),f(!1),k(null))},[s]),x.useEffect(()=>{if(!s||!d)return;const t=n=>{if(n.key==="Escape"){n.preventDefault(),n.stopPropagation(),f(!1),k(null);return}if(["Control","Alt","Shift","Meta"].includes(n.key))return;n.preventDefault(),n.stopPropagation();let i=n.key;n.code.startsWith("Key")&&n.code.length===4?i=n.code.charAt(3).toLowerCase():n.code.startsWith("Digit")&&n.code.length===6?i=n.code.charAt(5):n.code==="Space"&&(i="Space"),k({key:i,modifiers:{ctrl:n.ctrlKey,alt:n.altKey,shift:n.shiftKey,meta:n.metaKey}})};return document.addEventListener("keydown",t,!0),()=>document.removeEventListener("keydown",t,!0)},[s,d]),!s)return null;const F=l.shortcuts.filter(t=>{const n=a(`terminal:controls.shortcuts.${t.id}.name`,{defaultValue:t.name}),i=a(`terminal:controls.shortcuts.${t.id}.description`,{defaultValue:t.description});if(d&&o){const O=C=>C===" "||C==="Space"?"Space":C.length===1?C.toLowerCase():C,$=O(t.key),B=O(o.key);if(!(B.length===1&&/^[a-zA-Z]$/.test($)?`Key${$.toUpperCase()}`==`Key${B.toUpperCase()}`:$===B))return!1;const S=t.modifiers,M=o.modifiers;return(S.ctrl||!1)===(M.ctrl||!1)&&(S.alt||!1)===(M.alt||!1)&&(S.shift||!1)===(M.shift||!1)&&(S.meta||!1)===(M.meta||!1)}if(!j)return!0;const y=j.toLowerCase();return n.toLowerCase().includes(y)||i.toLowerCase().includes(y)||L(t).toLowerCase().includes(y)}),K=Array.from(l.agents.values()).map(t=>t).filter(t=>t.shortcut&&t.shortcut.trim().length>0).filter(t=>{const n=A(t.shortcut).toLowerCase();if(d&&o){const y={key:o.key,code:o.key.length===1&&/^[a-zA-Z]$/.test(o.key)?`Key${o.key.toUpperCase()}`:o.key.length===1&&/^[0-9]$/.test(o.key)?`Digit${o.key}`:o.key==="Space"?"Space":o.key,ctrlKey:!!o.modifiers.ctrl,altKey:!!o.modifiers.alt,shiftKey:!!o.modifiers.shift,metaKey:!!o.modifiers.meta};return H(y,t.shortcut)}if(!j)return!0;const i=j.toLowerCase();return t.name.toLowerCase().includes(i)||n.toLowerCase().includes(i)}),P=F.reduce((t,n)=>(t[n.context]||(t[n.context]=[]),t[n.context].push(n),t),{}),Y=(t,n)=>{b.updateShortcut(t,n)},E=()=>{m==="keyboard"?confirm(a("terminal:controls.confirmResetKeyboard"))&&b.resetShortcuts():m==="mouse"?confirm(a("terminal:controls.confirmResetMouse"))&&b.resetMouseControls():m==="trackpad"&&confirm(a("terminal:controls.confirmResetTrackpad"))&&b.resetMouseControls()},z=["global","commander","toolbox"],I=c.bindings.reduce((t,n)=>(U.camera.includes(n.action)?t.camera.push(n):U.interaction.includes(n.action)&&t.interaction.push(n),t),{camera:[],interaction:[]});return e.jsx("div",{className:"shortcuts-modal-overlay",onMouseDown:D,onClick:w,children:e.jsxs("div",{className:"shortcuts-modal controls-modal",children:[e.jsxs("div",{className:"shortcuts-modal-header",children:[e.jsxs("div",{className:"shortcuts-modal-title",children:[e.jsxs("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[e.jsx("circle",{cx:"12",cy:"12",r:"3"}),e.jsx("path",{d:"M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 0 1-2.83 2.83l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 0 1-4 0v-.09A1.65 1.65 0 0 0 9 19.4a1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 0 1-2.83-2.83l.06-.06a1.65 1.65 0 0 0 .33-1.82 1.65 1.65 0 0 0-1.51-1H3a2 2 0 0 1 0-4h.09A1.65 1.65 0 0 0 4.6 9a1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 0 1 2.83-2.83l.06.06a1.65 1.65 0 0 0 1.82.33H9a1.65 1.65 0 0 0 1-1.51V3a2 2 0 0 1 4 0v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 0 1 2.83 2.83l-.06.06a1.65 1.65 0 0 0-.33 1.82V9a1.65 1.65 0 0 0 1.51 1H21a2 2 0 0 1 0 4h-.09a1.65 1.65 0 0 0-1.51 1z"})]}),e.jsx("span",{children:a("terminal:controls.title")})]}),e.jsx("button",{className:"shortcuts-modal-close",onClick:r,children:"×"})]}),e.jsxs("div",{className:"controls-main-tabs",children:[e.jsxs("button",{className:`controls-main-tab ${m==="keyboard"?"active":""}`,onClick:()=>v("keyboard"),children:[e.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[e.jsx("rect",{x:"2",y:"4",width:"20",height:"16",rx:"2"}),e.jsx("path",{d:"M6 8h.01M10 8h.01M14 8h.01M18 8h.01M6 12h.01M18 12h.01M8 16h8"})]}),a("terminal:controls.keyboard")]}),e.jsxs("button",{className:`controls-main-tab ${m==="mouse"?"active":""}`,onClick:()=>v("mouse"),children:[e.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[e.jsx("rect",{x:"6",y:"3",width:"12",height:"18",rx:"6"}),e.jsx("line",{x1:"12",y1:"7",x2:"12",y2:"11"})]}),a("terminal:controls.mouse")]}),e.jsxs("button",{className:`controls-main-tab ${m==="trackpad"?"active":""}`,onClick:()=>v("trackpad"),children:[e.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[e.jsx("rect",{x:"2",y:"4",width:"20",height:"16",rx:"2"}),e.jsx("circle",{cx:"12",cy:"12",r:"3"})]}),a("terminal:controls.trackpad")]})]}),m==="keyboard"&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"shortcuts-modal-toolbar",children:[d?e.jsxs("div",{className:"shortcuts-search find-by-shortcut-active",children:[e.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[e.jsx("rect",{x:"2",y:"4",width:"20",height:"16",rx:"2"}),e.jsx("path",{d:"M6 8h.01M10 8h.01M14 8h.01M18 8h.01M6 12h.01M18 12h.01M8 16h8"})]}),o?e.jsxs("span",{className:"find-by-shortcut-display",children:[L({key:o.key,modifiers:o.modifiers}),e.jsx("button",{className:"shortcuts-search-clear",onClick:()=>k(null),children:"×"})]}):e.jsx("span",{className:"find-by-shortcut-prompt",children:a("terminal:controls.pressKeyCombination")})]}):e.jsxs("div",{className:"shortcuts-search",children:[e.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[e.jsx("circle",{cx:"11",cy:"11",r:"8"}),e.jsx("path",{d:"M21 21l-4.35-4.35"})]}),e.jsx("input",{ref:u,type:"text",placeholder:a("terminal:controls.searchShortcuts"),value:j,onChange:t=>g(t.target.value),autoFocus:!0}),j&&e.jsx("button",{className:"shortcuts-search-clear",onClick:()=>g(""),children:"×"})]}),e.jsx("button",{className:`shortcuts-find-by-key-btn ${d?"active":""}`,onClick:()=>{f(!d),k(null),g("")},title:a(d?"terminal:controls.switchToTextSearch":"terminal:controls.findByPressingKeys"),children:e.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[e.jsx("rect",{x:"2",y:"4",width:"20",height:"16",rx:"2"}),e.jsx("path",{d:"M6 8h.01M10 8h.01M14 8h.01M18 8h.01M6 12h.01M18 12h.01M8 16h8"})]})}),e.jsx("button",{className:"shortcuts-reset-all-btn",onClick:E,children:a("common:buttons.reset")})]}),e.jsxs("div",{className:"shortcuts-context-tabs",children:[e.jsxs("button",{className:`shortcuts-context-tab ${p==="all"?"active":""}`,onClick:()=>N("all"),children:[a("common:labels.all"),e.jsx("span",{className:"shortcuts-context-tab-count",children:F.length})]}),z.map(t=>{var i;const n=((i=P[t])==null?void 0:i.length)||0;return e.jsxs("button",{className:`shortcuts-context-tab ${p===t?"active":""}`,onClick:()=>N(t),children:[a(G[t]),e.jsx("span",{className:"shortcuts-context-tab-count",children:n})]},t)})]}),e.jsxs("div",{className:"shortcuts-modal-content",children:[z.map(t=>{const n=P[t]||[];return n.length===0||p!=="all"&&p!==t?null:e.jsxs("div",{className:"shortcuts-context-group",children:[p==="all"&&e.jsxs("div",{className:"shortcuts-context-header",children:[e.jsx("span",{className:"shortcuts-context-label",children:a(G[t])}),e.jsx("span",{className:"shortcuts-context-description",children:a(J[t])})]}),e.jsx("div",{className:"shortcuts-grid",children:n.map(i=>e.jsxs("div",{className:"shortcut-item",children:[e.jsxs("div",{className:"shortcut-item-info",children:[e.jsx("span",{className:"shortcut-item-name",children:a(`terminal:controls.shortcuts.${i.id}.name`,{defaultValue:i.name})}),e.jsx("span",{className:"shortcut-item-description",children:a(`terminal:controls.shortcuts.${i.id}.description`,{defaultValue:i.description})})]}),e.jsx(Q,{shortcut:i,onUpdate:y=>Y(i.id,y)})]},i.id))})]},t)}),F.length===0&&K.length===0&&e.jsx("div",{className:"shortcuts-empty",children:d?o?e.jsx("p",{children:a("terminal:controls.noShortcutBoundTo",{keys:L({key:o.key,modifiers:o.modifiers})})}):e.jsx("p",{children:a("terminal:controls.pressKeyCombinationToFind")}):e.jsx("p",{children:a("terminal:controls.noShortcutsFound",{query:j})})}),K.length>0&&(p==="all"||p==="global")&&e.jsxs("div",{className:"shortcuts-context-group",children:[p==="all"&&e.jsxs("div",{className:"shortcuts-context-header",children:[e.jsx("span",{className:"shortcuts-context-label",children:"Agent Terminal Shortcuts"}),e.jsx("span",{className:"shortcuts-context-description",children:"Per-agent global shortcuts that open the guake terminal"})]}),e.jsx("div",{className:"shortcuts-grid",children:K.map(t=>e.jsxs("div",{className:"shortcut-item",children:[e.jsxs("div",{className:"shortcut-item-info",children:[e.jsx("span",{className:"shortcut-item-name",children:t.name}),e.jsx("span",{className:"shortcut-item-description",children:"Open terminal for this agent"})]}),e.jsx("div",{className:"key-capture-container",children:e.jsx("button",{className:"key-capture-input disabled",disabled:!0,children:e.jsx("span",{className:"key-capture-value",children:A(t.shortcut)})})})]},t.id))})]})]})]}),m==="mouse"&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"shortcuts-modal-toolbar",children:[e.jsx("span",{className:"mouse-controls-subtitle",children:a("terminal:controls.cameraAndInteraction")}),e.jsx("button",{className:"shortcuts-reset-all-btn",onClick:E,children:a("common:buttons.reset")})]}),e.jsxs("div",{className:"shortcuts-modal-content mouse-controls-content",children:[e.jsx("div",{className:"mouse-controls-bindings",children:Object.entries(I).map(([t,n])=>e.jsxs("div",{className:"shortcuts-context-group",children:[e.jsx("div",{className:"shortcuts-context-header",children:e.jsx("span",{className:"shortcuts-context-label",children:a(ee[t])})}),e.jsx("div",{className:"shortcuts-grid",children:n.map(i=>e.jsx(se,{binding:i},i.id))})]},t))}),e.jsxs("div",{className:"shortcuts-context-group",children:[e.jsxs("div",{className:"shortcuts-context-header",children:[e.jsx("span",{className:"shortcuts-context-label",children:a("terminal:controls.sensitivity")}),e.jsx("span",{className:"shortcuts-context-description",children:a("terminal:controls.adjustCameraSpeed")})]}),e.jsx(te,{sensitivity:c.sensitivity})]})]})]}),m==="trackpad"&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"shortcuts-modal-toolbar",children:[e.jsx("span",{className:"mouse-controls-subtitle",children:a("terminal:controls.trackpadGestureSettings")}),e.jsx("button",{className:"shortcuts-reset-all-btn",onClick:E,children:a("common:buttons.reset")})]}),e.jsx("div",{className:"shortcuts-modal-content trackpad-controls-content",children:e.jsx(ae,{config:h})})]}),e.jsx("div",{className:"shortcuts-modal-footer",children:e.jsx("span",{className:"shortcuts-modal-hint",children:a(m==="keyboard"?d?"terminal:controls.hintFindByShortcut":"terminal:controls.hintKeyboard":m==="mouse"?"terminal:controls.hintMouse":"terminal:controls.hintTrackpad")})})]})})}function se({binding:s}){const{t:r}=T(["terminal"]),a=W(),[l,c]=x.useState(!1),[h,m]=x.useState(null);x.useEffect(()=>{if(!l)return;const d=u=>{u.preventDefault(),u.stopPropagation();const w={0:"left",1:"middle",2:"right",3:"back",4:"forward"}[u.button];w&&m({button:w,modifiers:{ctrl:u.ctrlKey,alt:u.altKey,shift:u.shiftKey,meta:u.metaKey}})},f=u=>{u.key==="Escape"&&(u.preventDefault(),u.stopPropagation(),c(!1),m(null))},o=()=>{h&&V(a.bindings,h,s.id).length===0&&b.updateMouseBinding(s.id,{button:h.button,modifiers:h.modifiers}),c(!1),m(null)},k=setTimeout(()=>{document.addEventListener("mousedown",d,!0),document.addEventListener("keydown",f,!0),document.addEventListener("click",o,!0)},100);return()=>{clearTimeout(k),document.removeEventListener("mousedown",d,!0),document.removeEventListener("keydown",f,!0),document.removeEventListener("click",o,!0)}},[l,h,s.id,a.bindings]);const v=h?V(a.bindings,h,s.id):[],j=r(`terminal:controls.mouseBindings.${s.id}.name`,{defaultValue:s.name}),g=r(`terminal:controls.mouseBindings.${s.id}.description`,{defaultValue:s.description}),p=d=>r(`terminal:controls.mouseButtons.${d}`,{defaultValue:d}),N=h?R({...s,...h},p):R(s,p);return e.jsxs("div",{className:`shortcut-item ${s.enabled?"":"disabled"}`,children:[e.jsxs("div",{className:"shortcut-item-info",children:[e.jsx("span",{className:"shortcut-item-name",children:j}),e.jsx("span",{className:"shortcut-item-description",children:g})]}),e.jsxs("div",{className:"key-capture-container",children:[e.jsx("button",{className:`key-capture-input ${l?"capturing":""} ${v.length>0?"conflict":""}`,onClick:()=>c(!0),children:l?h?e.jsx("span",{className:"key-capture-value",style:{color:"#f1fa8c"},children:N}):e.jsx("span",{style:{color:"#6272a4",fontStyle:"italic"},children:r("terminal:controls.clickToCapture")}):e.jsx("span",{className:"key-capture-value",children:N})}),v.length>0&&e.jsxs("span",{className:"key-capture-conflict",children:[r("terminal:controls.conflicts"),": ",v.map(d=>r(`terminal:controls.mouseBindings.${d.id}.name`,{defaultValue:d.name})).join(", ")]})]})]})}function te({sensitivity:s}){const{t:r}=T(["terminal"]),a=x.useCallback((l,c)=>{b.updateCameraSensitivity({[l]:c})},[]);return e.jsxs("div",{className:"sensitivity-inline-settings",children:[e.jsxs("div",{className:"sensitivity-sliders",children:[e.jsxs("div",{className:"sensitivity-slider-row",children:[e.jsx("label",{children:r("terminal:controls.panSpeed")}),e.jsx("input",{type:"range",min:"0.1",max:"3",step:"0.1",value:s.panSpeed,onChange:l=>a("panSpeed",parseFloat(l.target.value))}),e.jsxs("span",{className:"sensitivity-slider-value",children:[s.panSpeed.toFixed(1),"x"]})]}),e.jsxs("div",{className:"sensitivity-slider-row",children:[e.jsx("label",{children:r("terminal:controls.orbitSpeed")}),e.jsx("input",{type:"range",min:"0.1",max:"3",step:"0.1",value:s.orbitSpeed,onChange:l=>a("orbitSpeed",parseFloat(l.target.value))}),e.jsxs("span",{className:"sensitivity-slider-value",children:[s.orbitSpeed.toFixed(1),"x"]})]}),e.jsxs("div",{className:"sensitivity-slider-row",children:[e.jsx("label",{children:r("terminal:controls.zoomSpeed")}),e.jsx("input",{type:"range",min:"0.1",max:"3",step:"0.1",value:s.zoomSpeed,onChange:l=>a("zoomSpeed",parseFloat(l.target.value))}),e.jsxs("span",{className:"sensitivity-slider-value",children:[s.zoomSpeed.toFixed(1),"x"]})]}),e.jsxs("div",{className:"sensitivity-slider-row",children:[e.jsx("label",{children:r("terminal:controls.smoothing")}),e.jsx("input",{type:"range",min:"0",max:"1",step:"0.1",value:s.smoothing,onChange:l=>a("smoothing",parseFloat(l.target.value))}),e.jsx("span",{className:"sensitivity-slider-value",children:s.smoothing.toFixed(1)})]})]}),e.jsxs("div",{className:"sensitivity-checkboxes-inline",children:[e.jsxs("label",{className:"sensitivity-checkbox-inline",children:[e.jsx("input",{type:"checkbox",checked:s.invertPanX,onChange:l=>a("invertPanX",l.target.checked)}),e.jsx("span",{children:r("terminal:controls.invertPanX")})]}),e.jsxs("label",{className:"sensitivity-checkbox-inline",children:[e.jsx("input",{type:"checkbox",checked:s.invertPanY,onChange:l=>a("invertPanY",l.target.checked)}),e.jsx("span",{children:r("terminal:controls.invertPanY")})]}),e.jsxs("label",{className:"sensitivity-checkbox-inline",children:[e.jsx("input",{type:"checkbox",checked:s.invertOrbitX,onChange:l=>a("invertOrbitX",l.target.checked)}),e.jsx("span",{children:r("terminal:controls.invertOrbitX")})]}),e.jsxs("label",{className:"sensitivity-checkbox-inline",children:[e.jsx("input",{type:"checkbox",checked:s.invertOrbitY,onChange:l=>a("invertOrbitY",l.target.checked)}),e.jsx("span",{children:r("terminal:controls.invertOrbitY")})]})]})]})}function ae({config:s}){const{t:r}=T(["terminal"]),a=x.useCallback((c,h)=>{b.updateTrackpadConfig({[c]:h})},[]),l=x.useCallback((c,h)=>{b.updateTrackpadConfig({sensitivity:{[c]:h}})},[]);return e.jsxs("div",{className:"trackpad-settings",children:[e.jsxs("div",{className:"shortcuts-context-group",children:[e.jsxs("div",{className:"shortcuts-context-header",children:[e.jsx("span",{className:"shortcuts-context-label",children:r("terminal:controls.trackpadGestures")}),e.jsx("span",{className:"shortcuts-context-description",children:r("terminal:controls.enableTrackpadSupport")})]}),e.jsx("div",{className:"trackpad-toggle-row",children:e.jsxs("label",{className:"trackpad-toggle",children:[e.jsx("input",{type:"checkbox",checked:s.enabled,onChange:c=>a("enabled",c.target.checked)}),e.jsx("span",{className:"trackpad-toggle-label",children:r("terminal:controls.enableTrackpadGestures")})]})})]}),e.jsxs("div",{className:"shortcuts-context-group",children:[e.jsxs("div",{className:"shortcuts-context-header",children:[e.jsx("span",{className:"shortcuts-context-label",children:r("terminal:controls.gestureControls")}),e.jsx("span",{className:"shortcuts-context-description",children:r("terminal:controls.enableDisableGestures")})]}),e.jsxs("div",{className:"trackpad-gestures-grid",children:[e.jsxs("label",{className:`trackpad-gesture-item ${s.enabled?"":"disabled"}`,children:[e.jsx("input",{type:"checkbox",checked:s.pinchToZoom,onChange:c=>a("pinchToZoom",c.target.checked),disabled:!s.enabled}),e.jsxs("div",{className:"trackpad-gesture-info",children:[e.jsx("span",{className:"trackpad-gesture-name",children:r("terminal:controls.pinchToZoom")}),e.jsx("span",{className:"trackpad-gesture-desc",children:r("terminal:controls.pinchToZoomDesc")})]})]}),e.jsxs("label",{className:`trackpad-gesture-item ${s.enabled?"":"disabled"}`,children:[e.jsx("input",{type:"checkbox",checked:s.twoFingerPan,onChange:c=>a("twoFingerPan",c.target.checked),disabled:!s.enabled}),e.jsxs("div",{className:"trackpad-gesture-info",children:[e.jsx("span",{className:"trackpad-gesture-name",children:r("terminal:controls.twoFingerPan")}),e.jsx("span",{className:"trackpad-gesture-desc",children:r("terminal:controls.twoFingerPanDesc")})]})]}),e.jsxs("label",{className:`trackpad-gesture-item ${s.enabled?"":"disabled"}`,children:[e.jsx("input",{type:"checkbox",checked:s.shiftTwoFingerOrbit,onChange:c=>a("shiftTwoFingerOrbit",c.target.checked),disabled:!s.enabled}),e.jsxs("div",{className:"trackpad-gesture-info",children:[e.jsx("span",{className:"trackpad-gesture-name",children:r("terminal:controls.shiftTwoFingerOrbit")}),e.jsx("span",{className:"trackpad-gesture-desc",children:r("terminal:controls.shiftTwoFingerOrbitDesc")})]})]})]})]}),e.jsxs("div",{className:"shortcuts-context-group",children:[e.jsxs("div",{className:"shortcuts-context-header",children:[e.jsx("span",{className:"shortcuts-context-label",children:r("terminal:controls.sensitivity")}),e.jsx("span",{className:"shortcuts-context-description",children:r("terminal:controls.adjustGestureSensitivity")})]}),e.jsxs("div",{className:"trackpad-sensitivity-sliders",children:[e.jsxs("div",{className:`trackpad-slider-row ${!s.enabled||!s.pinchToZoom?"disabled":""}`,children:[e.jsx("label",{children:r("terminal:controls.zoom")}),e.jsx("input",{type:"range",min:"0.1",max:"3",step:"0.1",value:s.sensitivity.zoom,onChange:c=>l("zoom",parseFloat(c.target.value)),disabled:!s.enabled||!s.pinchToZoom}),e.jsxs("span",{className:"trackpad-slider-value",children:[s.sensitivity.zoom.toFixed(1),"x"]})]}),e.jsxs("div",{className:`trackpad-slider-row ${!s.enabled||!s.twoFingerPan?"disabled":""}`,children:[e.jsx("label",{children:r("terminal:controls.pan")}),e.jsx("input",{type:"range",min:"0.1",max:"3",step:"0.1",value:s.sensitivity.pan,onChange:c=>l("pan",parseFloat(c.target.value)),disabled:!s.enabled||!s.twoFingerPan}),e.jsxs("span",{className:"trackpad-slider-value",children:[s.sensitivity.pan.toFixed(1),"x"]})]}),e.jsxs("div",{className:`trackpad-slider-row ${!s.enabled||!s.shiftTwoFingerOrbit?"disabled":""}`,children:[e.jsx("label",{children:r("terminal:controls.orbit")}),e.jsx("input",{type:"range",min:"0.1",max:"3",step:"0.1",value:s.sensitivity.orbit,onChange:c=>l("orbit",parseFloat(c.target.value)),disabled:!s.enabled||!s.shiftTwoFingerOrbit}),e.jsxs("span",{className:"trackpad-slider-value",children:[s.sensitivity.orbit.toFixed(1),"x"]})]})]})]})]})}export{ie as ControlsModal};
|
|
1
|
+
import{u as T,f as X,bi as W,bj as Z,r as x,z as _,h as q,bh as L,bk as A,bl as H,j as e,bm as Q,s as b,bn as V,bo as R}from"./main-B_0o0aI9.js";import"./modulepreload-polyfill-B5Qt9EMX.js";import"./vendor-react--Eh9ivFN.js";import"./vendor-three-Chj50gSY.js";const G={global:"terminal:controls.contextGlobal",commander:"terminal:controls.contextCommander",toolbox:"terminal:controls.contextToolbox"},J={global:"terminal:controls.contextGlobalDesc",commander:"terminal:controls.contextCommanderDesc",toolbox:"terminal:controls.contextToolboxDesc"},U={camera:["camera-pan","camera-orbit","camera-rotate","camera-zoom","camera-tilt"],interaction:["primary-action","selection-box","context-menu","move-command"]},ee={camera:"terminal:controls.cameraControls",interaction:"terminal:controls.interaction"};function ie({isOpen:s,onClose:r}){const{t:a}=T(["terminal","common"]),l=X(),c=W(),h=Z(),[m,v]=x.useState("keyboard"),[j,g]=x.useState(""),[p,N]=x.useState("all"),[d,f]=x.useState(!1),[o,k]=x.useState(null),u=_.useRef(null),{handleMouseDown:D,handleClick:w}=q(r);if(x.useEffect(()=>{if(!s||d)return;const t=n=>{n.key==="Escape"&&(n.preventDefault(),n.stopPropagation(),r())};return document.addEventListener("keydown",t,!0),()=>document.removeEventListener("keydown",t,!0)},[s,r,d]),x.useEffect(()=>{s||(g(""),f(!1),k(null))},[s]),x.useEffect(()=>{if(!s||!d)return;const t=n=>{if(n.key==="Escape"){n.preventDefault(),n.stopPropagation(),f(!1),k(null);return}if(["Control","Alt","Shift","Meta"].includes(n.key))return;n.preventDefault(),n.stopPropagation();let i=n.key;n.code.startsWith("Key")&&n.code.length===4?i=n.code.charAt(3).toLowerCase():n.code.startsWith("Digit")&&n.code.length===6?i=n.code.charAt(5):n.code==="Space"&&(i="Space"),k({key:i,modifiers:{ctrl:n.ctrlKey,alt:n.altKey,shift:n.shiftKey,meta:n.metaKey}})};return document.addEventListener("keydown",t,!0),()=>document.removeEventListener("keydown",t,!0)},[s,d]),!s)return null;const F=l.shortcuts.filter(t=>{const n=a(`terminal:controls.shortcuts.${t.id}.name`,{defaultValue:t.name}),i=a(`terminal:controls.shortcuts.${t.id}.description`,{defaultValue:t.description});if(d&&o){const O=C=>C===" "||C==="Space"?"Space":C.length===1?C.toLowerCase():C,$=O(t.key),B=O(o.key);if(!(B.length===1&&/^[a-zA-Z]$/.test($)?`Key${$.toUpperCase()}`==`Key${B.toUpperCase()}`:$===B))return!1;const S=t.modifiers,M=o.modifiers;return(S.ctrl||!1)===(M.ctrl||!1)&&(S.alt||!1)===(M.alt||!1)&&(S.shift||!1)===(M.shift||!1)&&(S.meta||!1)===(M.meta||!1)}if(!j)return!0;const y=j.toLowerCase();return n.toLowerCase().includes(y)||i.toLowerCase().includes(y)||L(t).toLowerCase().includes(y)}),K=Array.from(l.agents.values()).map(t=>t).filter(t=>t.shortcut&&t.shortcut.trim().length>0).filter(t=>{const n=A(t.shortcut).toLowerCase();if(d&&o){const y={key:o.key,code:o.key.length===1&&/^[a-zA-Z]$/.test(o.key)?`Key${o.key.toUpperCase()}`:o.key.length===1&&/^[0-9]$/.test(o.key)?`Digit${o.key}`:o.key==="Space"?"Space":o.key,ctrlKey:!!o.modifiers.ctrl,altKey:!!o.modifiers.alt,shiftKey:!!o.modifiers.shift,metaKey:!!o.modifiers.meta};return H(y,t.shortcut)}if(!j)return!0;const i=j.toLowerCase();return t.name.toLowerCase().includes(i)||n.toLowerCase().includes(i)}),P=F.reduce((t,n)=>(t[n.context]||(t[n.context]=[]),t[n.context].push(n),t),{}),Y=(t,n)=>{b.updateShortcut(t,n)},E=()=>{m==="keyboard"?confirm(a("terminal:controls.confirmResetKeyboard"))&&b.resetShortcuts():m==="mouse"?confirm(a("terminal:controls.confirmResetMouse"))&&b.resetMouseControls():m==="trackpad"&&confirm(a("terminal:controls.confirmResetTrackpad"))&&b.resetMouseControls()},z=["global","commander","toolbox"],I=c.bindings.reduce((t,n)=>(U.camera.includes(n.action)?t.camera.push(n):U.interaction.includes(n.action)&&t.interaction.push(n),t),{camera:[],interaction:[]});return e.jsx("div",{className:"shortcuts-modal-overlay",onMouseDown:D,onClick:w,children:e.jsxs("div",{className:"shortcuts-modal controls-modal",children:[e.jsxs("div",{className:"shortcuts-modal-header",children:[e.jsxs("div",{className:"shortcuts-modal-title",children:[e.jsxs("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[e.jsx("circle",{cx:"12",cy:"12",r:"3"}),e.jsx("path",{d:"M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 0 1-2.83 2.83l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 0 1-4 0v-.09A1.65 1.65 0 0 0 9 19.4a1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 0 1-2.83-2.83l.06-.06a1.65 1.65 0 0 0 .33-1.82 1.65 1.65 0 0 0-1.51-1H3a2 2 0 0 1 0-4h.09A1.65 1.65 0 0 0 4.6 9a1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 0 1 2.83-2.83l.06.06a1.65 1.65 0 0 0 1.82.33H9a1.65 1.65 0 0 0 1-1.51V3a2 2 0 0 1 4 0v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 0 1 2.83 2.83l-.06.06a1.65 1.65 0 0 0-.33 1.82V9a1.65 1.65 0 0 0 1.51 1H21a2 2 0 0 1 0 4h-.09a1.65 1.65 0 0 0-1.51 1z"})]}),e.jsx("span",{children:a("terminal:controls.title")})]}),e.jsx("button",{className:"shortcuts-modal-close",onClick:r,children:"×"})]}),e.jsxs("div",{className:"controls-main-tabs",children:[e.jsxs("button",{className:`controls-main-tab ${m==="keyboard"?"active":""}`,onClick:()=>v("keyboard"),children:[e.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[e.jsx("rect",{x:"2",y:"4",width:"20",height:"16",rx:"2"}),e.jsx("path",{d:"M6 8h.01M10 8h.01M14 8h.01M18 8h.01M6 12h.01M18 12h.01M8 16h8"})]}),a("terminal:controls.keyboard")]}),e.jsxs("button",{className:`controls-main-tab ${m==="mouse"?"active":""}`,onClick:()=>v("mouse"),children:[e.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[e.jsx("rect",{x:"6",y:"3",width:"12",height:"18",rx:"6"}),e.jsx("line",{x1:"12",y1:"7",x2:"12",y2:"11"})]}),a("terminal:controls.mouse")]}),e.jsxs("button",{className:`controls-main-tab ${m==="trackpad"?"active":""}`,onClick:()=>v("trackpad"),children:[e.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[e.jsx("rect",{x:"2",y:"4",width:"20",height:"16",rx:"2"}),e.jsx("circle",{cx:"12",cy:"12",r:"3"})]}),a("terminal:controls.trackpad")]})]}),m==="keyboard"&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"shortcuts-modal-toolbar",children:[d?e.jsxs("div",{className:"shortcuts-search find-by-shortcut-active",children:[e.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[e.jsx("rect",{x:"2",y:"4",width:"20",height:"16",rx:"2"}),e.jsx("path",{d:"M6 8h.01M10 8h.01M14 8h.01M18 8h.01M6 12h.01M18 12h.01M8 16h8"})]}),o?e.jsxs("span",{className:"find-by-shortcut-display",children:[L({key:o.key,modifiers:o.modifiers}),e.jsx("button",{className:"shortcuts-search-clear",onClick:()=>k(null),children:"×"})]}):e.jsx("span",{className:"find-by-shortcut-prompt",children:a("terminal:controls.pressKeyCombination")})]}):e.jsxs("div",{className:"shortcuts-search",children:[e.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[e.jsx("circle",{cx:"11",cy:"11",r:"8"}),e.jsx("path",{d:"M21 21l-4.35-4.35"})]}),e.jsx("input",{ref:u,type:"text",placeholder:a("terminal:controls.searchShortcuts"),value:j,onChange:t=>g(t.target.value),autoFocus:!0}),j&&e.jsx("button",{className:"shortcuts-search-clear",onClick:()=>g(""),children:"×"})]}),e.jsx("button",{className:`shortcuts-find-by-key-btn ${d?"active":""}`,onClick:()=>{f(!d),k(null),g("")},title:a(d?"terminal:controls.switchToTextSearch":"terminal:controls.findByPressingKeys"),children:e.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[e.jsx("rect",{x:"2",y:"4",width:"20",height:"16",rx:"2"}),e.jsx("path",{d:"M6 8h.01M10 8h.01M14 8h.01M18 8h.01M6 12h.01M18 12h.01M8 16h8"})]})}),e.jsx("button",{className:"shortcuts-reset-all-btn",onClick:E,children:a("common:buttons.reset")})]}),e.jsxs("div",{className:"shortcuts-context-tabs",children:[e.jsxs("button",{className:`shortcuts-context-tab ${p==="all"?"active":""}`,onClick:()=>N("all"),children:[a("common:labels.all"),e.jsx("span",{className:"shortcuts-context-tab-count",children:F.length})]}),z.map(t=>{var i;const n=((i=P[t])==null?void 0:i.length)||0;return e.jsxs("button",{className:`shortcuts-context-tab ${p===t?"active":""}`,onClick:()=>N(t),children:[a(G[t]),e.jsx("span",{className:"shortcuts-context-tab-count",children:n})]},t)})]}),e.jsxs("div",{className:"shortcuts-modal-content",children:[z.map(t=>{const n=P[t]||[];return n.length===0||p!=="all"&&p!==t?null:e.jsxs("div",{className:"shortcuts-context-group",children:[p==="all"&&e.jsxs("div",{className:"shortcuts-context-header",children:[e.jsx("span",{className:"shortcuts-context-label",children:a(G[t])}),e.jsx("span",{className:"shortcuts-context-description",children:a(J[t])})]}),e.jsx("div",{className:"shortcuts-grid",children:n.map(i=>e.jsxs("div",{className:"shortcut-item",children:[e.jsxs("div",{className:"shortcut-item-info",children:[e.jsx("span",{className:"shortcut-item-name",children:a(`terminal:controls.shortcuts.${i.id}.name`,{defaultValue:i.name})}),e.jsx("span",{className:"shortcut-item-description",children:a(`terminal:controls.shortcuts.${i.id}.description`,{defaultValue:i.description})})]}),e.jsx(Q,{shortcut:i,onUpdate:y=>Y(i.id,y)})]},i.id))})]},t)}),F.length===0&&K.length===0&&e.jsx("div",{className:"shortcuts-empty",children:d?o?e.jsx("p",{children:a("terminal:controls.noShortcutBoundTo",{keys:L({key:o.key,modifiers:o.modifiers})})}):e.jsx("p",{children:a("terminal:controls.pressKeyCombinationToFind")}):e.jsx("p",{children:a("terminal:controls.noShortcutsFound",{query:j})})}),K.length>0&&(p==="all"||p==="global")&&e.jsxs("div",{className:"shortcuts-context-group",children:[p==="all"&&e.jsxs("div",{className:"shortcuts-context-header",children:[e.jsx("span",{className:"shortcuts-context-label",children:"Agent Terminal Shortcuts"}),e.jsx("span",{className:"shortcuts-context-description",children:"Per-agent global shortcuts that open the guake terminal"})]}),e.jsx("div",{className:"shortcuts-grid",children:K.map(t=>e.jsxs("div",{className:"shortcut-item",children:[e.jsxs("div",{className:"shortcut-item-info",children:[e.jsx("span",{className:"shortcut-item-name",children:t.name}),e.jsx("span",{className:"shortcut-item-description",children:"Open terminal for this agent"})]}),e.jsx("div",{className:"key-capture-container",children:e.jsx("button",{className:"key-capture-input disabled",disabled:!0,children:e.jsx("span",{className:"key-capture-value",children:A(t.shortcut)})})})]},t.id))})]})]})]}),m==="mouse"&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"shortcuts-modal-toolbar",children:[e.jsx("span",{className:"mouse-controls-subtitle",children:a("terminal:controls.cameraAndInteraction")}),e.jsx("button",{className:"shortcuts-reset-all-btn",onClick:E,children:a("common:buttons.reset")})]}),e.jsxs("div",{className:"shortcuts-modal-content mouse-controls-content",children:[e.jsx("div",{className:"mouse-controls-bindings",children:Object.entries(I).map(([t,n])=>e.jsxs("div",{className:"shortcuts-context-group",children:[e.jsx("div",{className:"shortcuts-context-header",children:e.jsx("span",{className:"shortcuts-context-label",children:a(ee[t])})}),e.jsx("div",{className:"shortcuts-grid",children:n.map(i=>e.jsx(se,{binding:i},i.id))})]},t))}),e.jsxs("div",{className:"shortcuts-context-group",children:[e.jsxs("div",{className:"shortcuts-context-header",children:[e.jsx("span",{className:"shortcuts-context-label",children:a("terminal:controls.sensitivity")}),e.jsx("span",{className:"shortcuts-context-description",children:a("terminal:controls.adjustCameraSpeed")})]}),e.jsx(te,{sensitivity:c.sensitivity})]})]})]}),m==="trackpad"&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"shortcuts-modal-toolbar",children:[e.jsx("span",{className:"mouse-controls-subtitle",children:a("terminal:controls.trackpadGestureSettings")}),e.jsx("button",{className:"shortcuts-reset-all-btn",onClick:E,children:a("common:buttons.reset")})]}),e.jsx("div",{className:"shortcuts-modal-content trackpad-controls-content",children:e.jsx(ae,{config:h})})]}),e.jsx("div",{className:"shortcuts-modal-footer",children:e.jsx("span",{className:"shortcuts-modal-hint",children:a(m==="keyboard"?d?"terminal:controls.hintFindByShortcut":"terminal:controls.hintKeyboard":m==="mouse"?"terminal:controls.hintMouse":"terminal:controls.hintTrackpad")})})]})})}function se({binding:s}){const{t:r}=T(["terminal"]),a=W(),[l,c]=x.useState(!1),[h,m]=x.useState(null);x.useEffect(()=>{if(!l)return;const d=u=>{u.preventDefault(),u.stopPropagation();const w={0:"left",1:"middle",2:"right",3:"back",4:"forward"}[u.button];w&&m({button:w,modifiers:{ctrl:u.ctrlKey,alt:u.altKey,shift:u.shiftKey,meta:u.metaKey}})},f=u=>{u.key==="Escape"&&(u.preventDefault(),u.stopPropagation(),c(!1),m(null))},o=()=>{h&&V(a.bindings,h,s.id).length===0&&b.updateMouseBinding(s.id,{button:h.button,modifiers:h.modifiers}),c(!1),m(null)},k=setTimeout(()=>{document.addEventListener("mousedown",d,!0),document.addEventListener("keydown",f,!0),document.addEventListener("click",o,!0)},100);return()=>{clearTimeout(k),document.removeEventListener("mousedown",d,!0),document.removeEventListener("keydown",f,!0),document.removeEventListener("click",o,!0)}},[l,h,s.id,a.bindings]);const v=h?V(a.bindings,h,s.id):[],j=r(`terminal:controls.mouseBindings.${s.id}.name`,{defaultValue:s.name}),g=r(`terminal:controls.mouseBindings.${s.id}.description`,{defaultValue:s.description}),p=d=>r(`terminal:controls.mouseButtons.${d}`,{defaultValue:d}),N=h?R({...s,...h},p):R(s,p);return e.jsxs("div",{className:`shortcut-item ${s.enabled?"":"disabled"}`,children:[e.jsxs("div",{className:"shortcut-item-info",children:[e.jsx("span",{className:"shortcut-item-name",children:j}),e.jsx("span",{className:"shortcut-item-description",children:g})]}),e.jsxs("div",{className:"key-capture-container",children:[e.jsx("button",{className:`key-capture-input ${l?"capturing":""} ${v.length>0?"conflict":""}`,onClick:()=>c(!0),children:l?h?e.jsx("span",{className:"key-capture-value",style:{color:"#f1fa8c"},children:N}):e.jsx("span",{style:{color:"#6272a4",fontStyle:"italic"},children:r("terminal:controls.clickToCapture")}):e.jsx("span",{className:"key-capture-value",children:N})}),v.length>0&&e.jsxs("span",{className:"key-capture-conflict",children:[r("terminal:controls.conflicts"),": ",v.map(d=>r(`terminal:controls.mouseBindings.${d.id}.name`,{defaultValue:d.name})).join(", ")]})]})]})}function te({sensitivity:s}){const{t:r}=T(["terminal"]),a=x.useCallback((l,c)=>{b.updateCameraSensitivity({[l]:c})},[]);return e.jsxs("div",{className:"sensitivity-inline-settings",children:[e.jsxs("div",{className:"sensitivity-sliders",children:[e.jsxs("div",{className:"sensitivity-slider-row",children:[e.jsx("label",{children:r("terminal:controls.panSpeed")}),e.jsx("input",{type:"range",min:"0.1",max:"3",step:"0.1",value:s.panSpeed,onChange:l=>a("panSpeed",parseFloat(l.target.value))}),e.jsxs("span",{className:"sensitivity-slider-value",children:[s.panSpeed.toFixed(1),"x"]})]}),e.jsxs("div",{className:"sensitivity-slider-row",children:[e.jsx("label",{children:r("terminal:controls.orbitSpeed")}),e.jsx("input",{type:"range",min:"0.1",max:"3",step:"0.1",value:s.orbitSpeed,onChange:l=>a("orbitSpeed",parseFloat(l.target.value))}),e.jsxs("span",{className:"sensitivity-slider-value",children:[s.orbitSpeed.toFixed(1),"x"]})]}),e.jsxs("div",{className:"sensitivity-slider-row",children:[e.jsx("label",{children:r("terminal:controls.zoomSpeed")}),e.jsx("input",{type:"range",min:"0.1",max:"3",step:"0.1",value:s.zoomSpeed,onChange:l=>a("zoomSpeed",parseFloat(l.target.value))}),e.jsxs("span",{className:"sensitivity-slider-value",children:[s.zoomSpeed.toFixed(1),"x"]})]}),e.jsxs("div",{className:"sensitivity-slider-row",children:[e.jsx("label",{children:r("terminal:controls.smoothing")}),e.jsx("input",{type:"range",min:"0",max:"1",step:"0.1",value:s.smoothing,onChange:l=>a("smoothing",parseFloat(l.target.value))}),e.jsx("span",{className:"sensitivity-slider-value",children:s.smoothing.toFixed(1)})]})]}),e.jsxs("div",{className:"sensitivity-checkboxes-inline",children:[e.jsxs("label",{className:"sensitivity-checkbox-inline",children:[e.jsx("input",{type:"checkbox",checked:s.invertPanX,onChange:l=>a("invertPanX",l.target.checked)}),e.jsx("span",{children:r("terminal:controls.invertPanX")})]}),e.jsxs("label",{className:"sensitivity-checkbox-inline",children:[e.jsx("input",{type:"checkbox",checked:s.invertPanY,onChange:l=>a("invertPanY",l.target.checked)}),e.jsx("span",{children:r("terminal:controls.invertPanY")})]}),e.jsxs("label",{className:"sensitivity-checkbox-inline",children:[e.jsx("input",{type:"checkbox",checked:s.invertOrbitX,onChange:l=>a("invertOrbitX",l.target.checked)}),e.jsx("span",{children:r("terminal:controls.invertOrbitX")})]}),e.jsxs("label",{className:"sensitivity-checkbox-inline",children:[e.jsx("input",{type:"checkbox",checked:s.invertOrbitY,onChange:l=>a("invertOrbitY",l.target.checked)}),e.jsx("span",{children:r("terminal:controls.invertOrbitY")})]})]})]})}function ae({config:s}){const{t:r}=T(["terminal"]),a=x.useCallback((c,h)=>{b.updateTrackpadConfig({[c]:h})},[]),l=x.useCallback((c,h)=>{b.updateTrackpadConfig({sensitivity:{[c]:h}})},[]);return e.jsxs("div",{className:"trackpad-settings",children:[e.jsxs("div",{className:"shortcuts-context-group",children:[e.jsxs("div",{className:"shortcuts-context-header",children:[e.jsx("span",{className:"shortcuts-context-label",children:r("terminal:controls.trackpadGestures")}),e.jsx("span",{className:"shortcuts-context-description",children:r("terminal:controls.enableTrackpadSupport")})]}),e.jsx("div",{className:"trackpad-toggle-row",children:e.jsxs("label",{className:"trackpad-toggle",children:[e.jsx("input",{type:"checkbox",checked:s.enabled,onChange:c=>a("enabled",c.target.checked)}),e.jsx("span",{className:"trackpad-toggle-label",children:r("terminal:controls.enableTrackpadGestures")})]})})]}),e.jsxs("div",{className:"shortcuts-context-group",children:[e.jsxs("div",{className:"shortcuts-context-header",children:[e.jsx("span",{className:"shortcuts-context-label",children:r("terminal:controls.gestureControls")}),e.jsx("span",{className:"shortcuts-context-description",children:r("terminal:controls.enableDisableGestures")})]}),e.jsxs("div",{className:"trackpad-gestures-grid",children:[e.jsxs("label",{className:`trackpad-gesture-item ${s.enabled?"":"disabled"}`,children:[e.jsx("input",{type:"checkbox",checked:s.pinchToZoom,onChange:c=>a("pinchToZoom",c.target.checked),disabled:!s.enabled}),e.jsxs("div",{className:"trackpad-gesture-info",children:[e.jsx("span",{className:"trackpad-gesture-name",children:r("terminal:controls.pinchToZoom")}),e.jsx("span",{className:"trackpad-gesture-desc",children:r("terminal:controls.pinchToZoomDesc")})]})]}),e.jsxs("label",{className:`trackpad-gesture-item ${s.enabled?"":"disabled"}`,children:[e.jsx("input",{type:"checkbox",checked:s.twoFingerPan,onChange:c=>a("twoFingerPan",c.target.checked),disabled:!s.enabled}),e.jsxs("div",{className:"trackpad-gesture-info",children:[e.jsx("span",{className:"trackpad-gesture-name",children:r("terminal:controls.twoFingerPan")}),e.jsx("span",{className:"trackpad-gesture-desc",children:r("terminal:controls.twoFingerPanDesc")})]})]}),e.jsxs("label",{className:`trackpad-gesture-item ${s.enabled?"":"disabled"}`,children:[e.jsx("input",{type:"checkbox",checked:s.shiftTwoFingerOrbit,onChange:c=>a("shiftTwoFingerOrbit",c.target.checked),disabled:!s.enabled}),e.jsxs("div",{className:"trackpad-gesture-info",children:[e.jsx("span",{className:"trackpad-gesture-name",children:r("terminal:controls.shiftTwoFingerOrbit")}),e.jsx("span",{className:"trackpad-gesture-desc",children:r("terminal:controls.shiftTwoFingerOrbitDesc")})]})]})]})]}),e.jsxs("div",{className:"shortcuts-context-group",children:[e.jsxs("div",{className:"shortcuts-context-header",children:[e.jsx("span",{className:"shortcuts-context-label",children:r("terminal:controls.sensitivity")}),e.jsx("span",{className:"shortcuts-context-description",children:r("terminal:controls.adjustGestureSensitivity")})]}),e.jsxs("div",{className:"trackpad-sensitivity-sliders",children:[e.jsxs("div",{className:`trackpad-slider-row ${!s.enabled||!s.pinchToZoom?"disabled":""}`,children:[e.jsx("label",{children:r("terminal:controls.zoom")}),e.jsx("input",{type:"range",min:"0.1",max:"3",step:"0.1",value:s.sensitivity.zoom,onChange:c=>l("zoom",parseFloat(c.target.value)),disabled:!s.enabled||!s.pinchToZoom}),e.jsxs("span",{className:"trackpad-slider-value",children:[s.sensitivity.zoom.toFixed(1),"x"]})]}),e.jsxs("div",{className:`trackpad-slider-row ${!s.enabled||!s.twoFingerPan?"disabled":""}`,children:[e.jsx("label",{children:r("terminal:controls.pan")}),e.jsx("input",{type:"range",min:"0.1",max:"3",step:"0.1",value:s.sensitivity.pan,onChange:c=>l("pan",parseFloat(c.target.value)),disabled:!s.enabled||!s.twoFingerPan}),e.jsxs("span",{className:"trackpad-slider-value",children:[s.sensitivity.pan.toFixed(1),"x"]})]}),e.jsxs("div",{className:`trackpad-slider-row ${!s.enabled||!s.shiftTwoFingerOrbit?"disabled":""}`,children:[e.jsx("label",{children:r("terminal:controls.orbit")}),e.jsx("input",{type:"range",min:"0.1",max:"3",step:"0.1",value:s.sensitivity.orbit,onChange:c=>l("orbit",parseFloat(c.target.value)),disabled:!s.enabled||!s.shiftTwoFingerOrbit}),e.jsxs("span",{className:"trackpad-slider-value",children:[s.sensitivity.orbit.toFixed(1),"x"]})]})]})]})]})}export{ie as ControlsModal};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{u as l,f as L,r as m,s as r,j as x}from"./main-
|
|
1
|
+
import{u as l,f as L,r as m,s as r,j as x}from"./main-B_0o0aI9.js";import{L as S}from"./LogViewerModal-BBdr9r3i.js";import"./modulepreload-polyfill-B5Qt9EMX.js";import"./vendor-react--Eh9ivFN.js";import"./vendor-three-Chj50gSY.js";function B({building:t,isOpen:o,onClose:n}){var a;const{t:i}=l(["terminal"]),{streamingBuildingLogs:c,streamingBuildingIds:g}=L(),s=c.get(t.id)||"",p=g.has(t.id);m.useEffect(()=>{var e;return o&&((e=t.docker)!=null&&e.enabled)&&r.startLogStreaming(t.id,200),()=>{t.id&&r.stopLogStreaming(t.id)}},[o,t.id,(a=t.docker)==null?void 0:a.enabled]);const d=m.useMemo(()=>s.split(`
|
|
2
2
|
`).map((e,f)=>({text:e,lineNumber:f+1})),[s]);return x.jsx(S,{isOpen:o,onClose:n,title:`${t.name} - ${i("terminal:logs.dockerLogs")}`,icon:"🐳",lines:d,isStreaming:p,onClear:()=>r.clearStreamingLogs(t.id)})}export{B as DockerLogsModal};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as e,j as s}from"./main-
|
|
1
|
+
import{r as e,j as s}from"./main-B_0o0aI9.js";import{g as j,o as k,E as f,l as N,h as R,a as T,f as A,d as w,r as C,i as K,b as L,c as M,e as q,j as B,s as D,k as G,m as H,n as O,p as V,q as W,t as F,u as I,v as U,w as Y,x as z}from"./index-BvZsOpS_.js";import"./modulepreload-polyfill-B5Qt9EMX.js";import"./vendor-react--Eh9ivFN.js";import"./vendor-three-Chj50gSY.js";const J=1e3,ee=({content:_,extension:p,onSave:h,onCancel:b})=>{const c=e.useRef(null),i=e.useRef(null),t=e.useRef(null),o=e.useRef(!1),v=e.useRef(h);v.current=h;const[u,d]=e.useState("idle"),[S,l]=e.useState(null),a=e.useCallback(async()=>{if(!(!i.current||o.current)){o.current=!0,d("saving"),l(null);try{const r=i.current.state.doc.toString();await v.current(r),d("saved"),setTimeout(()=>d(n=>n==="saved"?"idle":n),1500)}catch(r){d("error"),l(r.message||"Save failed")}finally{o.current=!1}}},[]),x=e.useCallback(()=>{t.current&&clearTimeout(t.current),t.current=setTimeout(()=>{a()},J)},[a]),g=e.useCallback(()=>{t.current&&(clearTimeout(t.current),t.current=null,a()),b()},[b,a]);return e.useEffect(()=>()=>{t.current&&clearTimeout(t.current)},[]),e.useEffect(()=>{if(!c.current)return;const r=j(p),n=[N(),R(),T(),A(),w(),C(),K(),L(),M(),q(),B(),D({top:!0}),G(z,{fallback:!0}),k,f.lineWrapping,H.of([...O,...V,...W,...F,...I,U,{key:"Mod-s",run:()=>(t.current&&(clearTimeout(t.current),t.current=null),a(),!0)},{key:"Escape",run:()=>(g(),!0)}]),f.updateListener.of(y=>{y.docChanged&&(l(null),x())})];r&&n.push(r);const E=Y.create({doc:_,extensions:n}),m=new f({state:E,parent:c.current});return i.current=m,requestAnimationFrame(()=>m.focus()),()=>{m.destroy(),i.current=null}},[]),s.jsxs("div",{className:"embedded-editor",children:[s.jsxs("div",{className:"embedded-editor__toolbar",children:[s.jsxs("div",{className:"embedded-editor__toolbar-left",children:[u==="saving"&&s.jsx("span",{className:"embedded-editor__status embedded-editor__status--saving",children:"Saving..."}),u==="saved"&&s.jsx("span",{className:"embedded-editor__status embedded-editor__status--saved",children:"Saved"}),u==="error"&&s.jsx("span",{className:"embedded-editor__status embedded-editor__status--error",children:S||"Save failed"})]}),s.jsxs("div",{className:"embedded-editor__toolbar-right",children:[s.jsx("span",{className:"embedded-editor__shortcut-hint",children:"Auto-saves · Esc to close"}),s.jsx("button",{className:"embedded-editor__btn embedded-editor__btn--close",onClick:g,children:"Close"})]})]}),s.jsx("div",{className:"embedded-editor__container",ref:c})]})};export{ee as EmbeddedEditor};
|
|
@@ -0,0 +1,388 @@
|
|
|
1
|
+
import{r as i,a5 as C,l as j,j as e,I as R}from"./main-B_0o0aI9.js";import"./modulepreload-polyfill-B5Qt9EMX.js";import"./vendor-react--Eh9ivFN.js";import"./vendor-three-Chj50gSY.js";function le({integration:o,onSave:f,onCancel:S}){const[s,z]=i.useState(o.values.authMethod||"oauth2"),[g,q]=i.useState(o.values.clientId||""),[v,K]=i.useState(""),[m,L]=i.useState(""),[w,$]=i.useState(o.values.impersonateEmail||""),[p,I]=i.useState(String(o.values.pollingIntervalMs??3e4)),[x,E]=i.useState(o.values.defaultApprovalKeywords||"approved,aprobado,autorizado,yes,ok"),[O,M]=i.useState(null),[n,G]=i.useState(null),[c,d]=i.useState(!1),[T,t]=i.useState(null),[P,F]=i.useState(!1),[B,J]=i.useState(!1),[y,Y]=i.useState(!1),[b,h]=i.useState(o.status.connected?"connected":"credentials"),N=s==="oauth2"&&o.values.clientId==="********"&&o.values.clientSecret==="********",r=i.useRef(null),_=i.useRef(o.status.connected),u=i.useCallback(async()=>{try{const a=await C(j("/api/email/status"));if(a.ok){const l=await a.json();G(l),l.authenticated&&(h("connected"),r.current&&(clearInterval(r.current),r.current=null))}}catch(a){console.error("Failed to fetch Gmail status:",a)}},[]);i.useEffect(()=>{const a=o.status.connected,l=_.current;a&&!l&&b!=="connected"?h("connected"):!a&&l&&b==="connected"&&h("credentials"),_.current=a},[o.status.connected]),i.useEffect(()=>(u(),()=>{r.current&&clearInterval(r.current)}),[u]);const D=async()=>{const a=await C(j("/api/email/auth/url"));if(!a.ok){const k=await a.json().catch(()=>({}));throw new Error(k.error||`HTTP ${a.status}`)}const l=await a.json();if(!l.url)throw new Error("OAuth URL is empty");M(l.url),t(null),h("authorize"),r.current&&clearInterval(r.current),r.current=setInterval(u,3e3)},H=async()=>{d(!0),t(null);try{await D()}catch(a){t(a instanceof Error?a.message:"Failed to get OAuth URL")}finally{d(!1)}},W=async()=>{if(!g.trim()){t("Client ID is required");return}d(!0),t(null);try{const a={authMethod:"oauth2",pollingIntervalMs:parseInt(p)||3e4,defaultApprovalKeywords:x};g.trim()&&g.trim()!=="********"&&(a.clientId=g.trim()),v.trim()&&v.trim()!=="********"&&(a.clientSecret=v.trim()),await f(a),await D()}catch(a){const l=a instanceof Error?a.message:"Failed to get OAuth URL";t(l)}finally{d(!1)}},X=async()=>{if(!m.trim()){t("Service Account JSON is required");return}if(!w.trim()){t("Impersonate Email is required");return}try{const a=JSON.parse(m.trim());if(!a.client_email||!a.private_key){t("Service Account JSON must contain client_email and private_key");return}}catch{t("Invalid JSON in Service Account field");return}d(!0),t(null);try{await f({authMethod:"service_account",serviceAccountJson:m.trim(),impersonateEmail:w.trim(),pollingIntervalMs:parseInt(p)||3e4,defaultApprovalKeywords:x}),await new Promise(a=>setTimeout(a,1e3)),await u()}catch(a){const l=a instanceof Error?a.message:"Failed to save service account";t(l)}finally{d(!1)}},Q=async()=>{F(!0),t(null);try{await f({pollingIntervalMs:parseInt(p)||3e4,defaultApprovalKeywords:x})}catch(a){t(a instanceof Error?a.message:"Failed to save settings")}finally{F(!1)}},V=async()=>{const a=!(n!=null&&n.pollingActive);J(!0),t(null);try{const l=a?"/api/email/polling/start":"/api/email/polling/stop",k=a?{intervalMs:parseInt(p)||3e4}:{},A=await C(j(l),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(k)});if(!A.ok){const ee=await A.json().catch(()=>({}));throw new Error(ee.error||`HTTP ${A.status}`)}await u()}catch(l){t(l instanceof Error?l.message:"Failed to toggle polling")}finally{J(!1)}},Z=async()=>{d(!0),t(null);try{await f({refreshToken:"",serviceAccountJson:"",impersonateEmail:""}),G(null),M(null),h("credentials"),await u()}catch(a){t(a instanceof Error?a.message:"Failed to disconnect")}finally{d(!1)}},U=!!o.values.serviceAccountJson;return e.jsxs("div",{className:"gmail-oauth-setup",children:[T&&e.jsx("div",{className:"gmail-oauth-error",children:T}),b==="credentials"&&e.jsxs("div",{className:"gmail-oauth-section",children:[e.jsxs("div",{className:"gmail-oauth-field",style:{marginBottom:24},children:[e.jsx("label",{className:"integration-field-label",children:"Authentication Method"}),e.jsxs("div",{className:"gmail-auth-method-selector",children:[e.jsxs("button",{type:"button",className:`gmail-auth-method-btn ${s==="oauth2"?"active":""}`,onClick:()=>{z("oauth2"),t(null)},children:[e.jsx("span",{className:"gmail-auth-method-icon",children:e.jsx(R,{name:"key",size:14})}),e.jsx("span",{className:"gmail-auth-method-label",children:"OAuth 2.0"}),e.jsx("span",{className:"gmail-auth-method-desc",children:"Browser login flow"})]}),e.jsxs("button",{type:"button",className:`gmail-auth-method-btn ${s==="service_account"?"active":""}`,onClick:()=>{z("service_account"),t(null)},children:[e.jsx("span",{className:"gmail-auth-method-icon",children:e.jsx(R,{name:"robot",size:14})}),e.jsx("span",{className:"gmail-auth-method-label",children:"Service Account"}),e.jsx("span",{className:"gmail-auth-method-desc",children:"Domain-wide delegation"})]})]})]}),s==="oauth2"&&N&&!y&&e.jsxs(e.Fragment,{children:[e.jsx("h4",{className:"gmail-oauth-section-title",children:"Google OAuth Credentials"}),e.jsxs("div",{className:"gmail-oauth-shared-banner",children:[e.jsxs("div",{className:"gmail-oauth-shared-title",children:[e.jsx("span",{children:"✓"}),e.jsx("span",{children:"Credentials already configured"})]}),e.jsx("div",{className:"gmail-oauth-shared-body",children:"Existing Google OAuth credentials (Client ID and Secret) are saved in your secrets store — they're shared between Gmail, Calendar, and Drive. You may still need to re-authorize once so the refresh token grants Gmail access."})]})]}),s==="oauth2"&&(!N||y)&&e.jsxs(e.Fragment,{children:[e.jsx("h4",{className:"gmail-oauth-section-title",children:"Google OAuth Credentials"}),e.jsxs("p",{className:"gmail-oauth-help",children:["Create OAuth2 credentials in the"," ",e.jsx("a",{href:"https://console.cloud.google.com/apis/credentials",target:"_blank",rel:"noopener noreferrer",className:"gmail-oauth-link",children:"Google Cloud Console"}),". Enable the Gmail API and (optionally) the Calendar API. Set the redirect URI to:"," ",e.jsx("code",{className:"gmail-oauth-code",children:j("/api/email/auth/callback")})]}),e.jsxs("div",{className:"gmail-oauth-field",children:[e.jsxs("label",{className:"integration-field-label",children:["OAuth Client ID ",e.jsx("span",{className:"integration-field-required",children:"*"})]}),e.jsx("input",{type:"text",className:"integration-field-input",value:g,placeholder:"xxxx.apps.googleusercontent.com",onChange:a=>q(a.target.value)})]}),e.jsxs("div",{className:"gmail-oauth-field",children:[e.jsxs("label",{className:"integration-field-label",children:["OAuth Client Secret ",e.jsx("span",{className:"integration-field-required",children:"*"})]}),e.jsx("input",{type:"password",className:"integration-field-input",value:v,placeholder:o.values.clientSecret?"(saved)":"Enter client secret",onChange:a=>K(a.target.value),autoComplete:"off"})]})]}),s==="service_account"&&e.jsxs(e.Fragment,{children:[e.jsx("h4",{className:"gmail-oauth-section-title",children:"Service Account Credentials"}),e.jsxs("p",{className:"gmail-oauth-help",children:["Use a Google service account with"," ",e.jsx("a",{href:"https://admin.google.com/ac/owl/domainwidedelegation",target:"_blank",rel:"noopener noreferrer",className:"gmail-oauth-link",children:"domain-wide delegation"})," ","enabled. The service account must be authorized for Gmail scopes in Google Workspace Admin."]}),e.jsxs("div",{className:"gmail-oauth-field",children:[e.jsxs("label",{className:"integration-field-label",children:["Service Account JSON ",e.jsx("span",{className:"integration-field-required",children:"*"})]}),e.jsx("textarea",{className:"integration-field-input integration-field-textarea",value:m,placeholder:U?"(saved — paste new JSON to replace)":"Paste the full service account JSON key file contents",onChange:a=>L(a.target.value),rows:6,spellCheck:!1}),e.jsx("span",{className:"integration-field-description",children:"The JSON key file downloaded from Google Cloud Console containing client_email and private_key."})]}),e.jsxs("div",{className:"gmail-oauth-field",children:[e.jsxs("label",{className:"integration-field-label",children:["Impersonate Email ",e.jsx("span",{className:"integration-field-required",children:"*"})]}),e.jsx("input",{type:"email",className:"integration-field-input",value:w,placeholder:"user@yourdomain.com",onChange:a=>$(a.target.value)}),e.jsx("span",{className:"integration-field-description",children:"The email address to impersonate via domain-wide delegation. Must be a user in your Google Workspace domain."})]})]}),e.jsxs("div",{className:"gmail-oauth-field",children:[e.jsx("label",{className:"integration-field-label",children:"Polling Interval (ms)"}),e.jsx("input",{type:"number",className:"integration-field-input",value:p,onChange:a=>I(a.target.value)}),e.jsx("span",{className:"integration-field-description",children:"How often to check for new emails. Default: 30000 (30s)."})]}),e.jsxs("div",{className:"gmail-oauth-field",children:[e.jsx("label",{className:"integration-field-label",children:"Approval Keywords"}),e.jsx("textarea",{className:"integration-field-input integration-field-textarea",value:x,onChange:a=>E(a.target.value),rows:2}),e.jsx("span",{className:"integration-field-description",children:"Comma-separated keywords that indicate email approval."})]}),e.jsxs("div",{className:"integration-form-actions",children:[e.jsx("button",{type:"button",className:"integration-btn cancel",onClick:S,children:"Cancel"}),s==="oauth2"&&N&&!y?e.jsxs(e.Fragment,{children:[e.jsx("button",{type:"button",className:"integration-btn secondary",onClick:()=>Y(!0),disabled:c,children:"Edit credentials"}),e.jsx("button",{type:"button",className:"integration-btn save",onClick:H,disabled:c,children:c?"Loading...":"Authorize with existing credentials"})]}):s==="oauth2"?e.jsx("button",{type:"button",className:"integration-btn save",onClick:W,disabled:c||!g.trim(),children:c?"Saving...":"Save & Authorize"}):e.jsx("button",{type:"button",className:"integration-btn save",onClick:X,disabled:c||!w.trim()||!m.trim()&&!U,children:c?"Connecting...":"Save & Connect"})]})]}),b==="authorize"&&e.jsxs("div",{className:"gmail-oauth-section",children:[e.jsx("h4",{className:"gmail-oauth-section-title",children:"Authorize Gmail Access"}),e.jsx("p",{className:"gmail-oauth-help",children:"Click the link below to authorize Tide Commander to access your Gmail account. After granting access, you will be redirected back and the connection will be established automatically."}),O&&e.jsx("a",{href:O,target:"_blank",rel:"noopener noreferrer",className:"gmail-oauth-authorize-btn",children:"Authorize with Google"}),e.jsxs("div",{className:"gmail-oauth-waiting",children:[e.jsx("span",{className:"gmail-oauth-spinner"}),e.jsx("span",{children:"Waiting for authorization to complete..."})]}),e.jsx("div",{className:"integration-form-actions",children:e.jsx("button",{type:"button",className:"integration-btn cancel",onClick:()=>{r.current&&(clearInterval(r.current),r.current=null),h("credentials")},children:"Back"})})]}),b==="connected"&&e.jsxs("div",{className:"gmail-oauth-section",children:[e.jsx("h4",{className:"gmail-oauth-section-title",children:"Gmail Connected"}),e.jsxs("div",{className:"gmail-oauth-connected-info",children:[e.jsx("span",{className:"gmail-oauth-connected-badge",children:"Connected"}),(n==null?void 0:n.emailAddress)&&e.jsx("span",{className:"gmail-oauth-email",children:n.emailAddress}),e.jsx("span",{className:"gmail-oauth-auth-type",children:s==="service_account"?"Service Account":"OAuth 2.0"})]}),e.jsxs("div",{className:"gmail-polling-toggle-row",children:[e.jsxs("div",{className:"gmail-polling-toggle-info",children:[e.jsx("div",{className:"gmail-polling-toggle-label",children:"Automatic Polling"}),e.jsx("div",{className:"gmail-polling-toggle-status",children:n!=null&&n.pollingActive?e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"gmail-polling-dot active"}),"Active",n.lastChecked&&e.jsxs("span",{className:"gmail-polling-last",children:["— last checked ",new Date(n.lastChecked).toLocaleTimeString()]})]}):e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"gmail-polling-dot paused"}),"Paused — new emails will not be ingested"]})})]}),e.jsx("button",{type:"button",role:"switch","aria-checked":!!(n!=null&&n.pollingActive),"aria-label":"Toggle automatic polling",className:`gmail-polling-switch ${n!=null&&n.pollingActive?"on":"off"}`,onClick:V,disabled:B,children:e.jsx("span",{className:"gmail-polling-switch-thumb"})})]}),e.jsxs("div",{className:"gmail-oauth-field",children:[e.jsx("label",{className:"integration-field-label",children:"Polling Interval (ms)"}),e.jsx("input",{type:"number",className:"integration-field-input",value:p,onChange:a=>I(a.target.value)})]}),e.jsxs("div",{className:"gmail-oauth-field",children:[e.jsx("label",{className:"integration-field-label",children:"Approval Keywords"}),e.jsx("textarea",{className:"integration-field-input integration-field-textarea",value:x,onChange:a=>E(a.target.value),rows:2})]}),e.jsxs("div",{className:"integration-form-actions",children:[e.jsx("button",{type:"button",className:"integration-btn cancel",onClick:S,children:"Close"}),e.jsx("button",{type:"button",className:"integration-btn",style:{backgroundColor:"#f38ba8",color:"#1e1e2e"},onClick:Z,disabled:c,children:c?"Disconnecting...":"Disconnect"}),e.jsx("button",{type:"button",className:"integration-btn save",onClick:Q,disabled:P,children:P?"Saving...":"Save Settings"})]})]}),e.jsx("style",{children:`
|
|
2
|
+
.gmail-oauth-setup {
|
|
3
|
+
padding: 0;
|
|
4
|
+
}
|
|
5
|
+
.gmail-oauth-error {
|
|
6
|
+
background: linear-gradient(135deg, rgba(243, 139, 168, 0.2) 0%, rgba(243, 139, 168, 0.08) 100%);
|
|
7
|
+
border-left: 3px solid #f38ba8;
|
|
8
|
+
color: #f38ba8;
|
|
9
|
+
padding: 12px 16px;
|
|
10
|
+
border-radius: 8px;
|
|
11
|
+
margin-bottom: 18px;
|
|
12
|
+
font-size: 13px;
|
|
13
|
+
font-weight: 500;
|
|
14
|
+
}
|
|
15
|
+
.gmail-oauth-section {
|
|
16
|
+
background: linear-gradient(180deg, rgba(45, 49, 69, 0.4) 0%, rgba(30, 30, 46, 0.2) 100%);
|
|
17
|
+
border: 1px solid rgba(137, 180, 250, 0.15);
|
|
18
|
+
border-radius: 12px;
|
|
19
|
+
padding: 28px;
|
|
20
|
+
backdrop-filter: blur(10px);
|
|
21
|
+
}
|
|
22
|
+
.gmail-oauth-section-title {
|
|
23
|
+
margin: 0 0 16px 0;
|
|
24
|
+
color: #cdd6f4;
|
|
25
|
+
font-size: 18px;
|
|
26
|
+
font-weight: 700;
|
|
27
|
+
letter-spacing: -0.5px;
|
|
28
|
+
}
|
|
29
|
+
.gmail-oauth-help {
|
|
30
|
+
color: #a6adc8;
|
|
31
|
+
font-size: 13px;
|
|
32
|
+
line-height: 1.6;
|
|
33
|
+
margin: 0 0 20px 0;
|
|
34
|
+
font-weight: 400;
|
|
35
|
+
}
|
|
36
|
+
.gmail-oauth-link {
|
|
37
|
+
color: #89b4fa;
|
|
38
|
+
text-decoration: none;
|
|
39
|
+
border-bottom: 1.5px solid rgba(137, 180, 250, 0.4);
|
|
40
|
+
transition: all 0.2s ease;
|
|
41
|
+
font-weight: 500;
|
|
42
|
+
}
|
|
43
|
+
.gmail-oauth-link:hover {
|
|
44
|
+
color: #a8c5ff;
|
|
45
|
+
border-bottom-color: #89b4fa;
|
|
46
|
+
}
|
|
47
|
+
.gmail-oauth-code {
|
|
48
|
+
background: rgba(137, 180, 250, 0.15);
|
|
49
|
+
color: #89b4fa;
|
|
50
|
+
padding: 4px 10px;
|
|
51
|
+
border-radius: 6px;
|
|
52
|
+
font-size: 12px;
|
|
53
|
+
word-break: break-all;
|
|
54
|
+
font-weight: 500;
|
|
55
|
+
font-family: 'Monaco', 'Menlo', monospace;
|
|
56
|
+
}
|
|
57
|
+
.gmail-oauth-field {
|
|
58
|
+
margin-bottom: 18px;
|
|
59
|
+
}
|
|
60
|
+
.gmail-auth-method-selector {
|
|
61
|
+
display: flex;
|
|
62
|
+
gap: 12px;
|
|
63
|
+
}
|
|
64
|
+
.gmail-auth-method-btn {
|
|
65
|
+
flex: 1;
|
|
66
|
+
display: flex;
|
|
67
|
+
flex-direction: column;
|
|
68
|
+
align-items: center;
|
|
69
|
+
gap: 6px;
|
|
70
|
+
padding: 16px 12px;
|
|
71
|
+
background: rgba(30, 30, 46, 0.6);
|
|
72
|
+
border: 2px solid rgba(137, 180, 250, 0.15);
|
|
73
|
+
border-radius: 10px;
|
|
74
|
+
cursor: pointer;
|
|
75
|
+
transition: all 0.2s ease;
|
|
76
|
+
}
|
|
77
|
+
.gmail-auth-method-btn:hover {
|
|
78
|
+
border-color: rgba(137, 180, 250, 0.35);
|
|
79
|
+
background: rgba(30, 30, 46, 0.8);
|
|
80
|
+
}
|
|
81
|
+
.gmail-auth-method-btn.active {
|
|
82
|
+
border-color: #89b4fa;
|
|
83
|
+
background: rgba(137, 180, 250, 0.1);
|
|
84
|
+
box-shadow: 0 0 0 3px rgba(137, 180, 250, 0.1);
|
|
85
|
+
}
|
|
86
|
+
.gmail-auth-method-icon {
|
|
87
|
+
font-size: 22px;
|
|
88
|
+
}
|
|
89
|
+
.gmail-auth-method-label {
|
|
90
|
+
color: #cdd6f4;
|
|
91
|
+
font-size: 14px;
|
|
92
|
+
font-weight: 600;
|
|
93
|
+
}
|
|
94
|
+
.gmail-auth-method-desc {
|
|
95
|
+
color: #7f849c;
|
|
96
|
+
font-size: 11px;
|
|
97
|
+
font-weight: 400;
|
|
98
|
+
}
|
|
99
|
+
.gmail-oauth-auth-type {
|
|
100
|
+
color: #7f849c;
|
|
101
|
+
font-size: 12px;
|
|
102
|
+
font-weight: 500;
|
|
103
|
+
margin-left: auto;
|
|
104
|
+
background: rgba(137, 180, 250, 0.1);
|
|
105
|
+
padding: 4px 10px;
|
|
106
|
+
border-radius: 6px;
|
|
107
|
+
}
|
|
108
|
+
.integration-field-label {
|
|
109
|
+
display: block;
|
|
110
|
+
margin-bottom: 8px;
|
|
111
|
+
color: #cdd6f4;
|
|
112
|
+
font-size: 14px;
|
|
113
|
+
font-weight: 600;
|
|
114
|
+
letter-spacing: 0.3px;
|
|
115
|
+
}
|
|
116
|
+
.integration-field-required {
|
|
117
|
+
color: #f38ba8;
|
|
118
|
+
}
|
|
119
|
+
.integration-field-input {
|
|
120
|
+
width: 100%;
|
|
121
|
+
background: rgba(30, 30, 46, 0.6);
|
|
122
|
+
border: 1.5px solid rgba(137, 180, 250, 0.2);
|
|
123
|
+
color: #cdd6f4;
|
|
124
|
+
padding: 11px 14px;
|
|
125
|
+
border-radius: 8px;
|
|
126
|
+
font-size: 13px;
|
|
127
|
+
transition: all 0.2s ease;
|
|
128
|
+
font-weight: 500;
|
|
129
|
+
}
|
|
130
|
+
.integration-field-input:focus {
|
|
131
|
+
outline: none;
|
|
132
|
+
border-color: #89b4fa;
|
|
133
|
+
background: rgba(30, 30, 46, 0.8);
|
|
134
|
+
box-shadow: 0 0 0 3px rgba(137, 180, 250, 0.15);
|
|
135
|
+
}
|
|
136
|
+
.integration-field-input::placeholder {
|
|
137
|
+
color: #6c7086;
|
|
138
|
+
}
|
|
139
|
+
.integration-field-textarea {
|
|
140
|
+
resize: vertical;
|
|
141
|
+
min-height: 80px;
|
|
142
|
+
font-family: 'Monaco', 'Menlo', monospace;
|
|
143
|
+
font-size: 12px;
|
|
144
|
+
}
|
|
145
|
+
.integration-field-description {
|
|
146
|
+
display: block;
|
|
147
|
+
margin-top: 7px;
|
|
148
|
+
color: #7f849c;
|
|
149
|
+
font-size: 12px;
|
|
150
|
+
font-weight: 400;
|
|
151
|
+
}
|
|
152
|
+
.gmail-oauth-authorize-btn {
|
|
153
|
+
display: inline-block;
|
|
154
|
+
background: linear-gradient(135deg, #89b4fa 0%, #7aa3f0 100%);
|
|
155
|
+
color: #1e1e2e;
|
|
156
|
+
padding: 12px 32px;
|
|
157
|
+
border-radius: 8px;
|
|
158
|
+
text-decoration: none;
|
|
159
|
+
font-weight: 700;
|
|
160
|
+
font-size: 14px;
|
|
161
|
+
margin-bottom: 20px;
|
|
162
|
+
transition: all 0.25s ease;
|
|
163
|
+
border: none;
|
|
164
|
+
cursor: pointer;
|
|
165
|
+
box-shadow: 0 4px 12px rgba(137, 180, 250, 0.25);
|
|
166
|
+
letter-spacing: 0.3px;
|
|
167
|
+
}
|
|
168
|
+
.gmail-oauth-authorize-btn:hover {
|
|
169
|
+
transform: translateY(-2px);
|
|
170
|
+
box-shadow: 0 6px 16px rgba(137, 180, 250, 0.35);
|
|
171
|
+
background: linear-gradient(135deg, #a8c5ff 0%, #8eb8ff 100%);
|
|
172
|
+
}
|
|
173
|
+
.gmail-oauth-authorize-btn:active {
|
|
174
|
+
transform: translateY(0);
|
|
175
|
+
}
|
|
176
|
+
.gmail-oauth-waiting {
|
|
177
|
+
display: flex;
|
|
178
|
+
align-items: center;
|
|
179
|
+
gap: 12px;
|
|
180
|
+
color: #a6adc8;
|
|
181
|
+
font-size: 13px;
|
|
182
|
+
margin-bottom: 20px;
|
|
183
|
+
background: rgba(137, 180, 250, 0.08);
|
|
184
|
+
padding: 14px 16px;
|
|
185
|
+
border-radius: 8px;
|
|
186
|
+
border-left: 3px solid #89b4fa;
|
|
187
|
+
font-weight: 500;
|
|
188
|
+
}
|
|
189
|
+
.gmail-oauth-spinner {
|
|
190
|
+
display: inline-block;
|
|
191
|
+
width: 16px;
|
|
192
|
+
height: 16px;
|
|
193
|
+
border: 2.5px solid rgba(137, 180, 250, 0.25);
|
|
194
|
+
border-top-color: #89b4fa;
|
|
195
|
+
border-radius: 50%;
|
|
196
|
+
animation: gmail-spin 0.8s linear infinite;
|
|
197
|
+
flex-shrink: 0;
|
|
198
|
+
}
|
|
199
|
+
@keyframes gmail-spin {
|
|
200
|
+
to { transform: rotate(360deg); }
|
|
201
|
+
}
|
|
202
|
+
.gmail-oauth-connected-info {
|
|
203
|
+
display: flex;
|
|
204
|
+
align-items: center;
|
|
205
|
+
gap: 14px;
|
|
206
|
+
margin-bottom: 20px;
|
|
207
|
+
background: rgba(166, 227, 161, 0.08);
|
|
208
|
+
padding: 16px;
|
|
209
|
+
border-radius: 10px;
|
|
210
|
+
border-left: 3px solid #a6e3a1;
|
|
211
|
+
}
|
|
212
|
+
.gmail-oauth-connected-badge {
|
|
213
|
+
background: linear-gradient(135deg, rgba(166, 227, 161, 0.3) 0%, rgba(166, 227, 161, 0.15) 100%);
|
|
214
|
+
color: #a6e3a1;
|
|
215
|
+
padding: 6px 14px;
|
|
216
|
+
border-radius: 6px;
|
|
217
|
+
font-size: 12px;
|
|
218
|
+
font-weight: 700;
|
|
219
|
+
letter-spacing: 0.4px;
|
|
220
|
+
text-transform: uppercase;
|
|
221
|
+
border: 1px solid rgba(166, 227, 161, 0.3);
|
|
222
|
+
flex-shrink: 0;
|
|
223
|
+
}
|
|
224
|
+
.gmail-oauth-email {
|
|
225
|
+
color: #cdd6f4;
|
|
226
|
+
font-size: 14px;
|
|
227
|
+
font-weight: 600;
|
|
228
|
+
letter-spacing: 0.2px;
|
|
229
|
+
}
|
|
230
|
+
.gmail-polling-toggle-row {
|
|
231
|
+
display: flex;
|
|
232
|
+
align-items: center;
|
|
233
|
+
justify-content: space-between;
|
|
234
|
+
gap: 16px;
|
|
235
|
+
margin: 0 0 20px 0;
|
|
236
|
+
padding: 14px 16px;
|
|
237
|
+
background: rgba(30, 30, 46, 0.6);
|
|
238
|
+
border: 1px solid rgba(137, 180, 250, 0.15);
|
|
239
|
+
border-radius: 10px;
|
|
240
|
+
}
|
|
241
|
+
.gmail-polling-toggle-info {
|
|
242
|
+
display: flex;
|
|
243
|
+
flex-direction: column;
|
|
244
|
+
gap: 4px;
|
|
245
|
+
min-width: 0;
|
|
246
|
+
}
|
|
247
|
+
.gmail-polling-toggle-label {
|
|
248
|
+
color: #cdd6f4;
|
|
249
|
+
font-size: 14px;
|
|
250
|
+
font-weight: 600;
|
|
251
|
+
letter-spacing: 0.2px;
|
|
252
|
+
}
|
|
253
|
+
.gmail-polling-toggle-status {
|
|
254
|
+
color: #a6adc8;
|
|
255
|
+
font-size: 12px;
|
|
256
|
+
font-weight: 500;
|
|
257
|
+
display: flex;
|
|
258
|
+
align-items: center;
|
|
259
|
+
gap: 6px;
|
|
260
|
+
flex-wrap: wrap;
|
|
261
|
+
}
|
|
262
|
+
.gmail-polling-last {
|
|
263
|
+
color: #7f849c;
|
|
264
|
+
font-weight: 400;
|
|
265
|
+
}
|
|
266
|
+
.gmail-polling-dot {
|
|
267
|
+
display: inline-block;
|
|
268
|
+
width: 8px;
|
|
269
|
+
height: 8px;
|
|
270
|
+
border-radius: 50%;
|
|
271
|
+
flex-shrink: 0;
|
|
272
|
+
}
|
|
273
|
+
.gmail-polling-dot.active {
|
|
274
|
+
background: #a6e3a1;
|
|
275
|
+
box-shadow: 0 0 6px rgba(166, 227, 161, 0.6);
|
|
276
|
+
}
|
|
277
|
+
.gmail-polling-dot.paused {
|
|
278
|
+
background: #fab387;
|
|
279
|
+
}
|
|
280
|
+
.gmail-polling-switch {
|
|
281
|
+
position: relative;
|
|
282
|
+
width: 44px;
|
|
283
|
+
height: 24px;
|
|
284
|
+
border-radius: 12px;
|
|
285
|
+
border: none;
|
|
286
|
+
cursor: pointer;
|
|
287
|
+
transition: background 0.2s ease;
|
|
288
|
+
flex-shrink: 0;
|
|
289
|
+
padding: 0;
|
|
290
|
+
}
|
|
291
|
+
.gmail-polling-switch.on {
|
|
292
|
+
background: linear-gradient(135deg, #a6e3a1 0%, #94d38f 100%);
|
|
293
|
+
}
|
|
294
|
+
.gmail-polling-switch.off {
|
|
295
|
+
background: rgba(108, 112, 134, 0.5);
|
|
296
|
+
}
|
|
297
|
+
.gmail-polling-switch:disabled {
|
|
298
|
+
opacity: 0.6;
|
|
299
|
+
cursor: wait;
|
|
300
|
+
}
|
|
301
|
+
.gmail-polling-switch-thumb {
|
|
302
|
+
position: absolute;
|
|
303
|
+
top: 2px;
|
|
304
|
+
left: 2px;
|
|
305
|
+
width: 20px;
|
|
306
|
+
height: 20px;
|
|
307
|
+
background: #ffffff;
|
|
308
|
+
border-radius: 50%;
|
|
309
|
+
transition: transform 0.2s ease;
|
|
310
|
+
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
|
|
311
|
+
}
|
|
312
|
+
.gmail-polling-switch.on .gmail-polling-switch-thumb {
|
|
313
|
+
transform: translateX(20px);
|
|
314
|
+
}
|
|
315
|
+
.integration-form-actions {
|
|
316
|
+
display: flex;
|
|
317
|
+
gap: 12px;
|
|
318
|
+
justify-content: flex-end;
|
|
319
|
+
margin-top: 24px;
|
|
320
|
+
padding-top: 20px;
|
|
321
|
+
border-top: 1px solid rgba(137, 180, 250, 0.1);
|
|
322
|
+
}
|
|
323
|
+
.integration-btn {
|
|
324
|
+
padding: 10px 24px;
|
|
325
|
+
border-radius: 8px;
|
|
326
|
+
font-weight: 600;
|
|
327
|
+
font-size: 13px;
|
|
328
|
+
border: none;
|
|
329
|
+
cursor: pointer;
|
|
330
|
+
transition: all 0.2s ease;
|
|
331
|
+
letter-spacing: 0.3px;
|
|
332
|
+
}
|
|
333
|
+
.integration-btn.save {
|
|
334
|
+
background: linear-gradient(135deg, #89b4fa 0%, #7aa3f0 100%);
|
|
335
|
+
color: #1e1e2e;
|
|
336
|
+
box-shadow: 0 4px 12px rgba(137, 180, 250, 0.25);
|
|
337
|
+
}
|
|
338
|
+
.integration-btn.save:hover:not(:disabled) {
|
|
339
|
+
transform: translateY(-2px);
|
|
340
|
+
box-shadow: 0 6px 16px rgba(137, 180, 250, 0.35);
|
|
341
|
+
}
|
|
342
|
+
.integration-btn.cancel {
|
|
343
|
+
background: rgba(137, 180, 250, 0.1);
|
|
344
|
+
color: #89b4fa;
|
|
345
|
+
border: 1.5px solid rgba(137, 180, 250, 0.2);
|
|
346
|
+
}
|
|
347
|
+
.integration-btn.cancel:hover:not(:disabled) {
|
|
348
|
+
background: rgba(137, 180, 250, 0.15);
|
|
349
|
+
border-color: #89b4fa;
|
|
350
|
+
}
|
|
351
|
+
.integration-btn.secondary {
|
|
352
|
+
background: rgba(249, 226, 175, 0.1);
|
|
353
|
+
color: #f9e2af;
|
|
354
|
+
border: 1.5px solid rgba(249, 226, 175, 0.25);
|
|
355
|
+
}
|
|
356
|
+
.integration-btn.secondary:hover:not(:disabled) {
|
|
357
|
+
background: rgba(249, 226, 175, 0.18);
|
|
358
|
+
border-color: #f9e2af;
|
|
359
|
+
}
|
|
360
|
+
.integration-btn:disabled {
|
|
361
|
+
opacity: 0.5;
|
|
362
|
+
cursor: not-allowed;
|
|
363
|
+
}
|
|
364
|
+
.gmail-oauth-shared-banner {
|
|
365
|
+
background: linear-gradient(135deg, rgba(166, 227, 161, 0.15) 0%, rgba(166, 227, 161, 0.05) 100%);
|
|
366
|
+
border: 1px solid rgba(166, 227, 161, 0.3);
|
|
367
|
+
border-left: 3px solid #a6e3a1;
|
|
368
|
+
border-radius: 10px;
|
|
369
|
+
padding: 16px 18px;
|
|
370
|
+
margin-bottom: 8px;
|
|
371
|
+
}
|
|
372
|
+
.gmail-oauth-shared-title {
|
|
373
|
+
display: flex;
|
|
374
|
+
align-items: center;
|
|
375
|
+
gap: 10px;
|
|
376
|
+
color: #a6e3a1;
|
|
377
|
+
font-size: 14px;
|
|
378
|
+
font-weight: 700;
|
|
379
|
+
letter-spacing: 0.2px;
|
|
380
|
+
margin-bottom: 8px;
|
|
381
|
+
}
|
|
382
|
+
.gmail-oauth-shared-body {
|
|
383
|
+
color: #a6adc8;
|
|
384
|
+
font-size: 13px;
|
|
385
|
+
line-height: 1.6;
|
|
386
|
+
font-weight: 400;
|
|
387
|
+
}
|
|
388
|
+
`})]})}export{le as GmailOAuthSetup};
|