(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[6607],{23879:(e,t,s)=>{"use strict";s.d(t,{default:()=>c});var a=s(95155),n=s(12115),i=s(3534),l=s(28777),o=s(52679),r=s(83433);function c(){let[e,t]=(0,n.useState)([]),[s,c]=(0,n.useState)([]),[d,u]=(0,n.useState)({}),[x,p]=(0,n.useState)(!1),[h,m]=(0,n.useState)(null),[f,w]=(0,n.useState)({running:!1,certExists:!1,dnsStatus:{},hasCachedPassword:!1}),[g,v]=(0,n.useState)(!1),y=async()=>{try{let e=await fetch("/api/providers");if(e.ok){let s=await e.json();t(s.connections||[])}}catch{}},S=async()=>{try{let e=await fetch("/api/keys");if(e.ok){let t=await e.json();c(t.keys||[])}}catch{}},k=async()=>{try{let e=await fetch("/api/models/alias");if(e.ok){let t=await e.json();u(t.aliases||{})}}catch{}},j=async()=>{try{let e=await fetch("/api/settings");if(e.ok){let t=await e.json();p(t.cloudEnabled||!1),v(!!t.tokenSwapEnabled)}}catch{}};(0,n.useEffect)(()=>{(async()=>{await Promise.all([y(),S(),k(),j()])})()},[]);let b=()=>e.filter(e=>!1!==e.isActive),E=Object.entries(i.wn);return(0,a.jsxs)("div",{className:"mx-auto flex w-full max-w-5xl flex-col gap-6 px-1 sm:px-0",children:[(0,a.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,a.jsx)("h1",{className:"text-xl font-semibold text-text-main sm:text-2xl",children:"MITM"}),(0,a.jsx)("p",{className:"text-sm text-text-muted",children:"Route supported IDE traffic through 9Router with local DNS interception."})]}),(0,a.jsxs)("div",{className:"flex items-start gap-2 px-3 py-2 rounded-lg bg-yellow-500/10 border border-yellow-500/30",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[16px] text-yellow-500 mt-0.5 shrink-0",children:"warning"}),(0,a.jsx)("p",{className:"text-xs text-red-600 dark:text-yellow-400 leading-relaxed",children:"⚠️ MITM intercepts HTTPS traffic of IDE tools (Antigravity, GitHub Copilot, Kiro) via local CA to redirect requests to your providers. May violate ToS → account ban. Use at your own risk."})]}),(0,a.jsx)(r.tA,{apiKeys:s,cloudEnabled:x,onStatusChange:w}),(0,a.jsx)("div",{className:"grid gap-3 sm:gap-4",children:E.map(([t,i])=>(0,a.jsxs)(n.Fragment,{children:[(0,a.jsx)(r.kn,{tool:i,isExpanded:h===t,onToggle:()=>m(h===t?null:t),serverRunning:f.running,dnsActive:f.dnsStatus?.[t]||!1,hasCachedPassword:f.hasCachedPassword||!1,apiKeys:s,activeProviders:b(),hasActiveProviders:b().some(e=>(0,l.KC)(e.provider).length>0||(0,o.mq)(e.provider)||(0,o.gb)(e.provider)),modelAliases:d,cloudEnabled:x,tokenSwapActive:i.supportsTokenSwap&&g,onDnsChange:e=>w(t=>({...t,dnsStatus:e.dnsStatus??t.dnsStatus}))}),i.supportsTokenSwap&&(0,a.jsx)(r.xm,{tool:i,connections:e,serverRunning:f.running,dnsActive:f.dnsStatus?.[t]||!1,onToggle:e=>v(e),onRefreshConnections:y})]},t))})]})}},60817:(e,t,s)=>{Promise.resolve().then(s.bind(s,23879))}},e=>{e.O(0,[2574,3862,128,5772,1321,5497,4406,8441,3794,7358],()=>e(e.s=60817)),_N_E=e.O()}]);