1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3521],{63521:(e,t,r)=>{r.r(t),r.d(t,{default:()=>g});var o=r(95155),s=r(12115),a=r(14051),i=r.n(a),n=r(81750),l=r(6793);r(53255);var d=r(88105),c=r(8247);function p({data:e}){let{label:t,color:r,imageUrl:a,textIcon:i,active:d}=e,[u,h]=(0,s.useState)(!1);return(0,o.jsxs)("div",{className:"flex items-center gap-2.5 px-4 py-2.5 rounded-lg border-2 transition-all duration-300 bg-bg",style:{borderColor:d?r:"var(--color-border)",boxShadow:d?`0 0 16px ${r}40`:"none",minWidth:"150px"},children:[(0,o.jsx)(n.h7,{type:"target",position:l.yX.Top,id:"top",className:"!bg-transparent !border-0 !w-0 !h-0"}),(0,o.jsx)(n.h7,{type:"target",position:l.yX.Bottom,id:"bottom",className:"!bg-transparent !border-0 !w-0 !h-0"}),(0,o.jsx)(n.h7,{type:"target",position:l.yX.Left,id:"left",className:"!bg-transparent !border-0 !w-0 !h-0"}),(0,o.jsx)(n.h7,{type:"target",position:l.yX.Right,id:"right",className:"!bg-transparent !border-0 !w-0 !h-0"}),(0,o.jsx)("div",{className:"w-8 h-8 rounded-md flex items-center justify-center shrink-0",style:{backgroundColor:`${r}15`},children:a&&!u?(0,o.jsx)("img",{src:a,alt:t,className:"w-6 h-6 rounded-sm object-contain",loading:"lazy",decoding:"async",onError:()=>{let e=a?.match(/^\/providers\/([^/]+)\.png$/i);e&&(0,c.Kw)(e[1]),h(!0)}}):(0,o.jsx)("span",{className:"text-sm font-bold",style:{color:r},children:i})}),(0,o.jsx)("span",{className:"text-base font-medium truncate",style:{color:d?r:"var(--color-text)"},children:t}),d&&(0,o.jsxs)("span",{className:"relative flex h-2 w-2 shrink-0",children:[(0,o.jsx)("span",{className:"animate-ping absolute inline-flex h-full w-full rounded-full opacity-75",style:{backgroundColor:r}}),(0,o.jsx)("span",{className:"relative inline-flex rounded-full h-2 w-2",style:{backgroundColor:r}})]})]})}function u({data:e}){let t=(e.activeCount||0)>0;return(0,o.jsxs)("div",{className:`relative z-[1] flex items-center justify-center px-5 py-3 rounded-xl border-2 min-w-[130px] ${t?"topology-router-core border-yellow-300 bg-gradient-to-br from-primary/30 via-yellow-400/20 to-cyan-400/25":"border-primary bg-primary/5 shadow-md"}`,children:[(0,o.jsx)(n.h7,{type:"source",position:l.yX.Top,id:"top",className:"!bg-transparent !border-0 !w-0 !h-0"}),(0,o.jsx)(n.h7,{type:"source",position:l.yX.Bottom,id:"bottom",className:"!bg-transparent !border-0 !w-0 !h-0"}),(0,o.jsx)(n.h7,{type:"source",position:l.yX.Left,id:"left",className:"!bg-transparent !border-0 !w-0 !h-0"}),(0,o.jsx)(n.h7,{type:"source",position:l.yX.Right,id:"right",className:"!bg-transparent !border-0 !w-0 !h-0"}),(0,o.jsx)("img",{src:"/favicon.svg",alt:"9Router",className:`w-6 h-6 mr-2 ${t?"topology-router-icon":""}`,loading:"lazy",decoding:"async"}),(0,o.jsx)("span",{className:`text-sm font-bold ${t?"topology-router-label text-yellow-300":"text-primary"}`,children:"9Router"}),e.activeCount>0&&(0,o.jsx)("span",{className:"ml-2 px-1.5 py-0.5 rounded-full bg-yellow-400 text-black text-xs font-bold topology-router-badge",children:e.activeCount})]})}function h({id:e,sourceX:t,sourceY:r,targetX:s,targetY:a,sourcePosition:i,targetPosition:d,style:c={},data:p}){let[u]=(0,l.Fp)({sourceX:t,sourceY:r,sourcePosition:i,targetX:s,targetY:a,targetPosition:d}),m=!!p?.active,f=c.stroke||"var(--color-border)",g=`topo-electric-${e}`;return m?(0,o.jsxs)("g",{className:"topology-edge-electric",children:[(0,o.jsx)("defs",{children:(0,o.jsxs)("filter",{id:g,x:"-40%",y:"-40%",width:"180%",height:"180%",children:[(0,o.jsx)("feTurbulence",{type:"fractalNoise",baseFrequency:"0.9",numOctaves:"2",seed:"2",result:"noise",children:(0,o.jsx)("animate",{attributeName:"baseFrequency",values:"0.8;1.4;0.8",dur:"0.25s",repeatCount:"indefinite"})}),(0,o.jsx)("feDisplacementMap",{in:"SourceGraphic",in2:"noise",scale:"3.5",xChannelSelector:"R",yChannelSelector:"G"})]})}),(0,o.jsx)("path",{d:u,fill:"none",stroke:"#22d3ee",strokeWidth:10,strokeOpacity:.35,strokeLinecap:"round",filter:`url(#${g})`,className:"topology-edge-halo"}),(0,o.jsx)("path",{d:u,fill:"none",stroke:"#4ade80",strokeWidth:5,strokeOpacity:.85,strokeLinecap:"round",filter:`url(#${g})`,className:"topology-edge-plasma"}),(0,o.jsx)(n.tE,{id:e,path:u,style:{stroke:"#f8fafc",strokeWidth:2.2,opacity:1},className:"topology-edge-kame"}),Array.from({length:6},(t,r)=>(0,o.jsx)("circle",{r:r%2==0?4:2.5,fill:r%3==0?"#fde047":r%3==1?"#67e8f9":"#fff",opacity:.95,style:{filter:"drop-shadow(0 0 4px #22d3ee)"},children:(0,o.jsx)("animateMotion",{dur:`${.4+.08*r}
1s`,repeatCount:"indefinite",path:u,begin:`${.09*r}s`})},`${e}-p-${r}`)),Array.from({length:5},(t,r)=>(0,o.jsxs)("circle",{r:1.8,fill:"#e0f2fe",opacity:0,children:[(0,o.jsx)("animate",{attributeName:"opacity",values:"0;1;0;0;1;0",dur:`${.35+r%3*.1}s`,begin:`${.07*r}s`,repeatCount:"indefinite"}),(0,o.jsx)("animateMotion",{dur:`${.28+.05*r}s`,repeatCount:"indefinite",path:u,begin:`${.11*r}s`})]},`${e}-s-${r}`))]}):(0,o.jsx)(n.tE,{id:e,path:u,style:{...c,stroke:f}})}p.propTypes={data:i().object.isRequired},u.propTypes={data:i().object.isRequired},h.propTypes={id:i().string,sourceX:i().number,sourceY:i().number,targetX:i().number,targetY:i().number,sourcePosition:i().string,targetPosition:i().string,style:i().object,data:i().object};let m={provider:p,router:u},f={topology:h};function g({providers:e=[],activeRequests:t=[],lastProvider:r="",errorProvider:a=""}){let i=(0,s.useMemo)(()=>t.map(e=>e.provider?.toLowerCase()).filter(Boolean).sort().join(","),[t]),l=r?.toLowerCase()||"",p=a?.toLowerCase()||"",u=(0,s.useMemo)(()=>new Set(i?i.split(","):[]),[i]),h=(0,s.useMemo)(()=>new Set(l?[l]:[]),[l]),b=(0,s.useMemo)(()=>new Set(p?[p]:[]),[p]),y=(0,s.useRef)({}),[x,v]=(0,s.useState)(0);(0,s.useEffect)(()=>{let e=y.current,t=Date.now();for(let r of u)e[r]||(e[r]=t);for(let t of Object.keys(e))u.has(t)||delete e[t]},[u]),(0,s.useEffect)(()=>{if(0===u.size)return;let e=setInterval(()=>v(e=>e+1),1e3);return()=>clearInterval(e)},[u]);let j=(0,s.useMemo)(()=>{let e=Date.now(),t=new Set;for(let r of u){let o=y.current[r];(!o||e-o<6e4)&&t.add(r)}return t},[u,x]),{nodes:w,edges:N}=(0,s.useMemo)(()=>(function(e,t,r,o){let s=e.length,a=Math.max(320,204*s/(2*Math.PI)),i=Math.max(200,.55*a);if(0===s)return{nodes:[{id:"router",type:"router",position:{x:0,y:0},data:{activeCount:0},draggable:!1}],edges:[]};let n=[],l=[];return n.push({id:"router",type:"router",position:{x:-60,y:-22},data:{activeCount:t.size},draggable:!1}),e.forEach((e,p)=>{var u,h;let m,f,g=(u=e.provider,d.Q2[u]||{color:"#6b7280",name:u}),b=t.has(e.provider?.toLowerCase()),y=!b&&r.has(e.provider?.toLowerCase()),x=!b&&o.has(e.provider?.toLowerCase()),v=`provider-${e.provider}`,j={label:(g.name!==e.provider?g.name:null)||e.nodeName||e.name||e.provider,color:g.color||"#6b7280",imageUrl:(h=e.provider,(0,c.HY)(h)),textIcon:g.textIcon||(e.provider||"?").slice(0,2).toUpperCase(),active:b},w=-Math.PI/2+2*Math.PI*p/s,N=a*Math.cos(w),k=i*Math.sin(w);Math.abs(w+Math.PI/2)<Math.PI/4||Math.abs(w-3*Math.PI/2)<Math.PI/4?(m="top",f="bottom"):Math.abs(w-Math.PI/2)<Math.PI/4?(m="bottom",f="top"):N>0?(m="right",f="left"):(m="left",f="right"),n.push({id:v,type:"provider",position:{x:N-90,y:k-15},data:j,draggable:!1}),l.push({id:`e-${v}`,type:"topology",source:"router",sourceHandle:m,target:v,targetHandle:f,animated:!1,data:{active:b},style:x?{stroke:"#ef4444",strokeWidth:2.5,opacity:.9}:b?{stroke:"#22d3ee",strokeWidth:3.5,opacity:1}:y?{stroke:"#f59e0b",strokeWidth:2,opacity:.7}:{stroke:"var(--color-border)",strokeWidth:1,opacity:.3}})}),{nodes:n,edges:l}})(e,j,h,b),[e,j,h,b]),k=(0,s.useMemo)(()=>e.map(e=>e.provider).sort().join(","),[e]),C=(0,s.useRef)(null),M=(0,s.useRef)(null),$={padding:.2,duration:200},I=(0,s.useCallback)(e=>{C.current=e,setTimeout(()=>e.fitView($),50)},[]);return(0,s.useEffect)(()=>{let e=M.current;if(!e)return;let t=new ResizeObserver(()=>{C.current&&C.current.fitView($)});return t.observe(e),()=>t.disconnect()},[]),(0,s.useEffect)(()=>{if(C.current){let e=setTimeout(()=>C.current.fitView($),50);return()=>clearTimeout(e)}},[w.length]),(0,o.jsx)("div",{ref:M,className:"h-[320px] w-full min-w-0 rounded-lg border border-border bg-bg-subtle/30 sm:h-[480px]",children:0===e.length?(0,o.jsx)("div",{className:"h-full flex items-center justify-center text-text-muted text-sm",children:"No providers connected"}):(0,o.jsx)(n.Gc,{nodes:w,edges:N,nodeTypes:m,edgeTypes:f,fitView:!0,fitViewOptions:$,minZoom:.1,maxZoom:2,onInit:I,proOptions:{hideAttribution:!0},panOnDrag:!0,zoomOnScroll:!0,zoomOnPinch:!0,zoomOnDoubleClick:!0,preventScrolling:!1,nodesDraggable:!1,nodesConnectable:!1,elementsSelectable:!1,
1children:(0,o.jsx)(n.H2,{showInteractive:!1,className:"react-flow-controls-custom"})},k)})}g.propTypes={providers:i().arrayOf(i().shape({id:i().string,provider:i().string,name:i().string})),activeRequests:i().arrayOf(i().shape({provider:i().string,model:i().string,account:i().string})),lastProvider:i().string,errorProvider:i().string}}}]);
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.