PageSourceSearch

https://sala-daeng.com/_nuxt/Ktj1LInZ.js

js sala-daeng.com collected 2026-10-05 01:56:40 UTC 16,717 bytes, 2 lines download raw bytes

1const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./CkJquLhQ.js","./4sq9MsAB.js","./entry.CvIK_kIu.css"])))=>i.map(i=>d[i]);
2import{d as W,S as oe,b as i,c as d,e as t,f as o,g as k,F as B,w as le,h as S,t as u,ac as ue,W as xe,o as me,q as A,L as ge,n as l,u as e,X as ye,v as b,B as pe,r as h,V as be,a8 as q}from"./CkJquLhQ.js";import{u as ve}from"./3XRR_tCv.js";import{i as fe,D as he}from"./C4qy0ITZ.js";import"./4sq9MsAB.js";const ke={key:0,class:"text-xs text-gray-400 py-4 text-center"},we={class:"flex-1 min-w-0"},Ce={class:"text-gray-500 truncate"},De=W({__name:"CCMcpPanel",props:{sessions:{}},setup(Z){const E=oe(),_=S(()=>E.isDarkMode),R=Z,L=S(()=>{var f;const v=[];for(const c of R.sessions)if((f=c.mcpServers)!=null&&f.length)for(const I of c.mcpServers)v.push({...I,sessionName:c.repoName});return v});return(v,f)=>(i(),d("div",null,[t("h3",{class:o(["text-sm font-semibold mb-3",_.value?"text-gray-300":"text-gray-700"])},"MCP Servers",2),L.value.length===0?(i(),d("div",ke," No MCP servers connected ")):k("",!0),(i(!0),d(B,null,le(L.value,c=>(i(),d("div",{key:c.name+c.sessionName,class:o(["flex items-center gap-2 py-2 px-2 rounded text-xs",_.value?"hover:bg-white/5":"hover:bg-gray-50"])},[t("span",{class:o(["w-2 h-2 rounded-full shrink-0",c.status==="connected"?"bg-green-500":"bg-red-500"])},null,2),t("div",we,[t("div",{class:o(["font-medium truncate",_.value?"text-gray-300":"text-gray-700"])},u(c.name),3),t("div",Ce,u(c.sessionName)+" · "+u(c.status),1)])],2))),128))]))}}),Me={class:"flex-1 overflow-y-auto min-h-0"},Se={class:"max-w-3xl mx-auto py-6 px-4 pb-24"},_e={class:"space-y-4"},Ie={class:"flex items-start gap-3"},je={class:"flex-1 min-w-0"},Be={class:"flex items-start gap-3"},Le={class:"flex-1 min-w-0"},Ne={key:0,class:"text-green-500"},Te={key:2,class:"space-y-3"},$e={class:"flex items-center gap-3"},Pe={class:"text-2xl"},Ae={class:"flex-1 min-w-0"},Ee={class:"flex items-center gap-2 flex-wrap"},Re=["title"],Ve=["onClick"],Fe={class:"space-y-4"},ze={class:"flex items-center justify-between gap-4"},He={class:"min-w-0"},Ue={class:"flex items-center justify-between gap-4"},Oe={class:"min-w-0"},qe={class:"p-6"},We={class:"flex justify-center mb-4"},Ze={class:"text-center mb-6"},Xe={class:"flex gap-3"},Ge=["disabled"],Je=["disabled"],Ke={key:0,class:"animate-spin w-4 h-4",fill:"none",viewBox:"0 0 24 24"},mt=W({__name:"settings",setup(Z){const{containerClass:E,containerStyle:_,headerClass:R,headerStyle:L,configBgClass:v,configBgStyle:f,configCardClass:c,configCardStyle:I,configInputClass:Qe,configInputStyle:Ye,configButtonPrimaryClass:et,configButtonPrimaryStyle:tt,configButtonSecondaryClass:ae,configButtonSecondaryStyle:re,configButtonDangerClass:st,configButtonDangerStyle:ot,configLabelClass:N,configLabelStyle:T,configHelpTextClass:y,configHelpTextStyle:p,configHeadingClass:w,configHeadingStyle:C,configDividerClass:lt,configDividerStyle:at,configErrorClass:rt,configErrorStyle:nt}=ve(),x=ue(),V=xe(),a=oe(),j=h(null),m=h("mac"),F=h(he),z=n=>fe(n),ne=S(()=>m.value==="dev"?"power --dev":"power"),ie=S(()=>m.value==="windows"?"irm https://sala-daeng.com/install.ps1 | iex":m.value==="dev"?"cd firebase/daemon && bun link":"curl -fsSL https://sala-daeng.com/install.sh | bash"),X=S(()=>m.value==="windows"?"irm https://sala-daeng.com/install.ps1 | iex":"curl -fsSL https://sala-daeng.com/install.sh | bash");let H=null;const $=h(!1),D=h(""),G=h(""),J=h(""),M=h(!1),de=S(()=>D.value==="session"?"Remove Session":D.value==="clear-messages"?"Clear Messages":D.value==="clear-sessions"?"Remove All Sessions":"Confirm");me(async()=>{var s;a.initializeUI(),await V.waitForAuthReady();const n=(s=V.currentUser)==null?void 0:s.userId;n&&await x.initCC(n)});function U(n,s){navigator.clipboard.writeText(n),j.value=s,H&&clearTimeout(H),H=setTimeout(()=>{j.value=null},2e3)}function O(n,s,g){D.value=n,G.value=s,J.value=g,$.value=!0}function K(){M.value||($.value=!1)}async function ce(){var s;M.value=!0;const n=(s=V.currentUser)==null?void 0:s.userId;try{if(D.value==="session"&&n)await x.deleteSession(n,G.value);else if(D.value==="clear-messages"&&x.ccProjectId){const{useFirebase:g}=await be(async()=>{const{useFirebase:r}=await import("./CkJquLhQ.js").then(P=>P.ap);return{useFirebase:r}},__vite__mapDeps([0,1,2]),import.meta.url);await g().callFunction("deleteAllProjectMessages",{projectId:x.ccProjectId})}else if(D.value==="clear-sessions"&&n)for(const g of x.sessionList)await x.deleteSession(n,g.sessionId);$.value=!1}catch(g){console.error("Action failed:",g)}finally{M.value=!1}}const Q=W({props:{command:{type:String,required:!0},isDark:{type:Boolean,default:!1},copiedId:{type:String,default:null},copyId:{type:String,required:!0}},emits:["copy"],setup(n,{emit:s}){const g=S(()=>n.copiedId===n.copyId);return()=>q("div",{class:`rounded-lg px-4 py-2.5 text-sm font-mono flex items-center justify-between ${n.isDark?"bg-gray-950 text-gray-200":"bg-gray-900 text-gray-100"}`},[q("code",{class:"truncate"},n.command),q("button",{class:`ml-3 px-2 py-1 text-xs rounded transition-all flex items-center gap-1 flex-shrink-0 ${g.value?"bg-green-500/20 text-green-400":n.isDark?"text-gray-500 hover:text-white hover:bg-gray-800":"text-gray-400 hover:text-white hover:bg-gray-700"}`,onClick:()=>s("copy",n.command,n.copyId)},g.value?"✓ Copied":"Copy")])}});return(n,s)=>{const g=ye,Y=De;return i(),d("div",{class:o(["h-screen h-dvh flex flex-col",e(E)]),style:l(e(_))},[t("div",{class:o(["h-14 flex items-center px-4 gap-3 flex-shrink-0 backdrop-blur-xl border-b",e(R)]),style:l(e(L))},[A(g,{to:"/cc",class:o(["transition-colors",e(y)]),style:l(e(p))},{default:ge(()=>[...s[8]||(s[8]=[b("← Back",-1)])]),_:1},8,["class","style"]),t("h1",{class:o(["text-lg font-semibold",e(w)]),style:l(e(C))},"CC Settings",6)],6),t("div",Me,[t("div",Se,[t("div",{class:o(["rounded-2xl p-6 mb-6 backdrop-blur-xl border",e(v)
2]),style:l(e(f))},[t("h2",{class:o(["text-lg font-semibold mb-4",e(w)]),style:l(e(C))},"Daemon Setup",6),t("div",_e,[t("div",{class:o(["rounded-xl p-4 border",e(c)]),style:l(e(I))},[t("div",Ie,[s[12]||(s[12]=t("span",{class:"w-6 h-6 rounded-full bg-blue-500 text-white text-xs flex items-center justify-center flex-shrink-0 mt-0.5"},"1",-1)),t("div",je,[t("h3",{class:o(["text-sm font-medium mb-1",e(N)]),style:l(e(T))},[s[9]||(s[9]=b(" Install CLI ",-1)),t("span",{class:o(["text-xs font-normal",e(a).isDarkMode?"text-gray-600":"text-gray-400"])},"(one-time)",2)],6),t("div",{class:o(["flex gap-1 mb-3 p-0.5 rounded-lg w-fit",e(a).isDarkMode?"bg-gray-800":"bg-gray-200"])},[t("button",{class:o(["px-3 py-1 text-xs rounded-md transition-all",m.value==="mac"?e(a).isDarkMode?"bg-blue-600 text-white":"bg-white text-gray-800 shadow-sm":e(a).isDarkMode?"text-gray-400 hover:text-gray-300":"text-gray-500 hover:text-gray-700"]),onClick:s[0]||(s[0]=r=>m.value="mac")}," Mac / Linux ",2),t("button",{class:o(["px-3 py-1 text-xs rounded-md transition-all",m.value==="windows"?e(a).isDarkMode?"bg-blue-600 text-white":"bg-white text-gray-800 shadow-sm":e(a).isDarkMode?"text-gray-400 hover:text-gray-300":"text-gray-500 hover:text-gray-700"]),onClick:s[1]||(s[1]=r=>m.value="windows")}," Windows ",2),t("button",{class:o(["px-3 py-1 text-xs rounded-md transition-all",m.value==="dev"?e(a).isDarkMode?"bg-blue-600 text-white":"bg-white text-gray-800 shadow-sm":e(a).isDarkMode?"text-gray-400 hover:text-gray-300":"text-gray-500 hover:text-gray-700"]),onClick:s[2]||(s[2]=r=>m.value="dev")}," Development ",2)],2),t("p",{class:o(["text-xs mb-3",e(y)]),style:l(e(p))},[m.value==="dev"?(i(),d(B,{key:0},[b(" For contributors with the repo cloned — builds the CLI from source. ")],64)):(i(),d(B,{key:1},[s[10]||(s[10]=b(" Downloads and installs the ",-1)),t("code",{class:o(["px-1 rounded",e(a).isDarkMode?"bg-gray-800 text-blue-400":"bg-gray-200 text-blue-600"])},"power",2),s[11]||(s[11]=b(" binary to your machine. ",-1))],64))],6),A(e(Q),{command:ie.value,"is-dark":e(a).isDarkMode,"copied-id":j.value,"copy-id":"install",onCopy:U},null,8,["command","is-dark","copied-id"]),m.value!=="dev"?(i(),d("p",{key:0,class:o(["text-[10px] mt-2",e(y)]),style:l(e(p))}," To update, just run the same command again. ",6)):k("",!0)])])],6),t("div",{class:o(["rounded-xl p-4 border",e(c)]),style:l(e(I))},[t("div",Be,[s[16]||(s[16]=t("span",{class:"w-6 h-6 rounded-full bg-blue-500 text-white text-xs flex items-center justify-center flex-shrink-0 mt-0.5"},"2",-1)),t("div",Le,[t("h3",{class:o(["text-sm font-medium mb-1",e(N)]),style:l(e(T))},"Run in your project",6),t("p",{class:o(["text-xs mb-3",e(y)]),style:l(e(p))},[s[15]||(s[15]=b(" Auto-detects repo name. First run will open browser for login automatically. ",-1)),m.value==="dev"?(i(),d(B,{key:0},[s[13]||(s[13]=t("br",null,null,-1)),t("code",{class:o(["px-1 rounded",e(a).isDarkMode?"bg-gray-800 text-yellow-400":"bg-gray-200 text-yellow-600"])},"--dev",2),s[14]||(s[14]=b(" uses localhost:3000 for auth. ",-1))],64)):k("",!0)],6),A(e(Q),{command:ne.value,"is-dark":e(a).isDarkMode,"copied-id":j.value,"copy-id":"start",onCopy:U},null,8,["command","is-dark","copied-id"])])])],6)])],6),t("div",{class:o(["rounded-2xl p-6 mb-6 backdrop-blur-xl border",e(v)]),style:l(e(f))},[t("h2",{class:o(["text-lg font-semibold mb-4",e(w)]),style:l(e(C))},"Connected Sessions",6),F.value?(i(),d("div",{key:0,class:o(["mb-3 rounded-lg px-3 py-2 text-xs flex items-center gap-2 flex-wrap",e(a).isDarkMode?"bg-gray-800/60 text-gray-400":"bg-gray-100 text-gray-600"])},[t("span",null,[s[17]||(s[17]=b("Latest: ",-1)),t("strong",null,"v"+u(F.value),1)]),s[18]||(s[18]=t("span",{class:"opacity-60"},"•",-1)),t("code",{class:o(["px-1.5 py-0.5 rounded cursor-pointer hover:opacity-80",e(a).isDarkMode?"bg-gray-900 text-blue-400":"bg-white text-blue-600"]),onClick:s[3]||(s[3]=r=>U(X.value,"update-banner")),title:"Click to copy"},u(X.value),3),j.value==="update-banner"?(i(),d("span",Ne,"✓ Copied")):k("",!0)],2)):k("",!0),e(x).sessionList.length===0?(i(),d("div",{key:1,class:o(["text-center py-8",e(y)]),style:l(e(p))},[...s[19]||(s[19]=[t("span",{class:"text-4xl block mb-3"},"🤖",-1),t("p",{class:"text-sm"},"No sessions connected yet",-1),t("p",{class:"text-xs mt-1"},"Follow the steps above to connect your first daemon",-1)])],6)):(i(),d("div",Te,[(i(!0),d(B,null,le(e(x).sessionList,r=>{var P,ee,te,se;return i(),d("div",{key:r.sessionId,class:o(["rounded-xl p-4 border",e(c)]),style:l(e(I))},[t("div",$e,[t("span",Pe,u(((P=r.character)==null?void 0:P.icon)||"🤖"),1),t("div",Ae,[t("div",Ee,[t("span",{class:o(["font-medium truncate",e(w)]),style:l(e(C))},u(r.repoName),7),t("span",{class:o(["w-2 h-2 rounded-full flex-shrink-0",{"bg-green-500":r.status==="online","bg-yellow-500":r.status==="busy","bg-gray-400":r.status==="offline"}])},null,2),t("span",{class:o(["text-xs",e(y)]),style:l(e(p))}
2,u(r.status),7),(ee=r.capabilities)!=null&&ee.version?(i(),d("span",{key:0,class:o(["text-[10px] px-1.5 py-0.5 rounded font-mono",z(r.capabilities.version)?"bg-amber-100 text-amber-700 dark:bg-amber-900/30 dark:text-amber-400":e(a).isDarkMode?"bg-gray-800 text-gray-500":"bg-gray-100 text-gray-500"]),title:z(r.capabilities.version)?`Update available: v${F.value}`:"Up to date"}," v"+u(r.capabilities.version)+u(z(r.capabilities.version)?" ↑":""),11,Re)):k("",!0)]),t("div",{class:o(["text-xs truncate",e(y)]),style:l(e(p))},u(r.workingDirectory),7)]),t("div",{class:"w-4 h-4 rounded-full border-2 flex-shrink-0",style:l({borderColor:(te=r.character)==null?void 0:te.color,backgroundColor:((se=r.character)==null?void 0:se.color)+"30"})},null,4),t("button",{class:o(["ml-1 p-1.5 rounded-lg transition-colors flex-shrink-0",e(a).isDarkMode?"text-gray-600 hover:text-red-400 hover:bg-red-500/10":"text-gray-300 hover:text-red-500 hover:bg-red-50"]),title:"Remove session",onClick:it=>O("session",r.sessionId,r.repoName||"this session")},[...s[20]||(s[20]=[t("svg",{class:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[t("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M19 7l-.867 12.142A2 2 0 0116.138 21H7.862a2 2 0 01-1.995-1.858L5 7m5 4v6m4-6v6m1-10V4a1 1 0 00-1-1h-4a1 1 0 00-1 1v3M4 7h16"})],-1)])],10,Ve)])],6)}),128))]))],6),t("div",{class:o(["rounded-2xl p-6 mb-6 backdrop-blur-xl border",e(a).isDarkMode?"bg-gray-900/70 border-white/10":"bg-white/80 border-gray-200/50 shadow-sm"])},[t("h2",{class:o(["text-lg font-semibold mb-4",e(a).isDarkMode?"text-gray-200":"text-gray-800"])},"MCP Servers",2),A(Y,{sessions:e(x).sessionList},null,8,["sessions"])],2),t("div",{class:o(["rounded-2xl p-6 mb-6 backdrop-blur-xl border",e(v)]),style:l(e(f))},[t("h2",{class:o(["text-lg font-semibold mb-4",e(w)]),style:l(e(C))},"Preferences",6),t("div",{class:o(["flex items-center justify-between py-3 border-b",e(a).isDarkMode?"border-white/5":"border-gray-100"])},[t("div",null,[t("div",{class:o(["text-sm font-medium",e(a).isDarkMode?"text-gray-200":"text-gray-800"])},' Right-click "Edit with CC" ',2),t("div",{class:o(["text-xs mt-0.5",e(a).isDarkMode?"text-gray-500":"text-gray-400"])}," Right-click any element on the site to edit it with Command Center ",2)]),t("button",{class:o(["relative w-11 h-6 rounded-full transition-colors",e(x).rightClickEnabled?"bg-blue-500":e(a).isDarkMode?"bg-gray-700":"bg-gray-300"]),onClick:s[4]||(s[4]=r=>e(x).setRightClickEnabled(!e(x).rightClickEnabled))},[t("div",{class:o(["absolute top-0.5 w-5 h-5 rounded-full bg-white shadow transition-transform",e(x).rightClickEnabled?"translate-x-[22px]":"translate-x-0.5"])},null,2)],2)],2),t("p",{class:o(["text-xs mt-3",e(y)]),style:l(e(p))},"More settings coming soon",6)],6),t("div",{class:o(["rounded-2xl p-6 backdrop-blur-xl border",e(v)]),style:l(e(f))},[s[21]||(s[21]=t("h2",{class:"text-lg font-semibold mb-4 text-red-600 dark:text-red-400"},"Danger Zone",-1)),t("div",Fe,[t("div",ze,[t("div",He,[t("p",{class:o(["text-sm font-medium",e(N)]),style:l(e(T))},"Clear all messages",6),t("p",{class:o(["text-xs",e(y)]),style:l(e(p))},"Delete all chat messages in Command Center",6)]),t("button",{class:o(["px-4 py-1.5 text-sm rounded-lg border transition-colors flex-shrink-0",e(a).isDarkMode?"border-red-500/30 text-red-400 hover:bg-red-500/10":"border-red-200 text-red-600 hover:bg-red-50"]),onClick:s[5]||(s[5]=r=>O("clear-messages","","all messages"))}," Clear Messages ",2)]),t("div",Ue,[t("div",Oe,[t("p",{class:o(["text-sm font-medium",e(N)]),style:l(e(T))},"Remove all sessions",6),t("p",{class:o(["text-xs",e(y)]),style:l(e(p))},"Daemons will need to reconnect",6)]),t("button",{class:o(["px-4 py-1.5 text-sm rounded-lg border transition-colors flex-shrink-0",e(a).isDarkMode?"border-red-500/30 text-red-400 hover:bg-red-500/10":"border-red-200 text-red-600 hover:bg-red-50"]),onClick:s[6]||(s[6]=r=>O("clear-sessions","","all sessions"))}," Clear Sessions ",2)])])],6)])]),$.value?(i(),d("div",{key:0,class:"fixed inset-0 z-50 flex items-center justify-center bg-black/50",onClick:K},[t("div",{class:o(["rounded-xl shadow-2xl max-w-sm w-full mx-4",e(v)]),style:l(e(f)),onClick:s[7]||(s[7]=pe(()=>{},["stop"]))},[t("div",qe,[t("div",We,[t("div",{class:o(["w-10 h-10 rounded-full flex items-center justify-center",e(a).isDarkMode?"bg-red-900/30":"bg-red-100"])},[(i(),d("svg",{class:o(["w-5 h-5",e(a).isDarkMode?"text-red-400":"text-red-600"]),fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[...s[22]||(s[22]=[t("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3ZM12 9v4M12 17h.01"},null,-1)])],2))],2)]),t("div",Ze,[t("h3",{class:o(["text-base font-semibold mb-1",e(w)]),style:l(e(C))},u(de.value),7),t("p",{class:o(["text-sm",e(y)]),style:l(e(p))},[s[23]||(s[23]=b(" Are you sure you want to delete ",-1)),t("span",{class:o(["font-medium",e(w)]),style:l(e(C))},u(J.value),7),s[24]||(s[24]=b("? This cannot be undone. ",-1))],6)]),t("div",Xe,[t("button",{disabled:M.value,class:o(["flex-1 px-4 py-2 text-sm font-medium rounded-lg transition-colors",e(ae)]),style:l(e(re)),onClick:K}," Cancel ",14,Ge),t("button",{disabled:M.value,class:"flex-1 px-4 py-2 text-sm font-medium text-white rounded-lg transition-colors bg-red-500 hover:bg-red-600 disabled:opacity-50 flex items-center justify-center gap-2",onClick:ce},[M.value?(i(),d("svg",Ke,[...s[25]||(s[25]=[t("circle",{class:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor","stroke-width":"4"},null,-1),t("path",{class:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"},null,-1)])])):k("",!0),t("span",null,u(M.value?"Deleting...":"Delete"),1)],8,Je)])])],6)])):k("",!0)],6)}}});
2export{mt as default};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.