PageSourceSearch

https://www.xilos.ai/assets/index-Di0Znm2I.js

js xilos.ai collected 2026-10-05 13:20:42 UTC 21,596 bytes, 33 lines download raw bytes

1import{A as T,D as p,o as Je,r,t as Ze,j as e,k as a,T as s,l as u,C as y,v as eo}from"./index-D-AFl6v8.js";import{L as oo,P as to,E as so,a as no,b as ro,l as io,B as ao}from"./index-CfApN3LR.js";import{g as lo,u as co,r as xo,d as ho,c as po}from"./routines-gbI8oLvS.js";import{S as c}from"./Stack-7YBloGKc.js";import{T as mo,a as K}from"./Tabs-506PYUc1.js";import{C as A}from"./Card-C02Ei0wK.js";import{C as R}from"./CardContent-Dm-G-azE.js";import{T as g}from"./Tooltip-BvL3hbv5.js";import{c as uo,I as b,P as go}from"./createLucideIcon-L7O1RZew.js";import{C as ue}from"./check-X8X9CWkw.js";import{C as ge}from"./copy-BGZq7eBy.js";import{C as W}from"./server-Dz7pqCYN.js";import{P as be}from"./plus-BlbmGU0j.js";import{T as bo,a as fo,b as jo,c as fe,d,e as yo}from"./TableRow-KhikY9Mj.js";import{S as je}from"./Switch-k4p5AR7T.js";import{P as Ao}from"./play--I_H-KK9.js";import{W as N}from"./webhook--Z4lXaM3.js";import{D as ye,a as Ae,b as Ce,c as ke}from"./DialogTitle-uYZLulBj.js";import{T as x,a as Co}from"./TextField-DdZmIhxv.js";import{M as P}from"./MenuItem-BOli6_Jj.js";import{T as ko}from"./trash-2-Biw0ZEum.js";import{F as vo}from"./FormControlLabel-HApM5u4z.js";import{C as Io}from"./Checkbox-B4iC--sI.js";import{T as ve}from"./terminal-B0KuHW6F.js";import"./index-BZruhSgt.js";import"./send-D6l0clPM.js";import"./Link-DQbJ92mW.js";import"./createSvgIcon-DLxHainh.js";import"./x-BTs_WrB8.js";import"./Modal-CRLh7o4j.js";import"./wrench-Bn1myMGq.js";import"./Drawer-CBLHdxOe.js";import"./styled-C-2iXfty.js";import"./useThemeProps-DgQP1pEg.js";import"./KeyboardArrowRight-D-DdgoKC.js";import"./Popper-vIybPXYE.js";import"./SwitchBase-YvJ2Pi69.js";/**
2 * @license lucide-react v0.545.0 - ISC
3 *
4 * This source code is licensed under the ISC license.
5 * See the LICENSE file in the root directory of this source tree.
6 */const So=[["path",{d:"m16 18 6-6-6-6",key:"eg8j8"}],["path",{d:"m8 6-6 6 6 6",key:"ppft3o"}]],Ie=uo("code",So),z=`${p}api/v1`,E=t=>({headers:{Authorization:`Bearer ${t}`}}),wo=async t=>(await T.get(`${z}/webhooks`,E(t))).data,Fo=async(t,h)=>(await T.post(`${z}/webhooks`,h,E(t))).data,_o=async(t,h,f)=>(await T.put(`${z}/webhooks/${h}`,f,E(t))).data,Ro=async(t,h)=>{await T.delete(`${z}/webhooks/${h}`,E(t))},l="#0066FF",Se=[{label:"Hourly",value:"0 * * * *"},{label:"Daily (9 AM)",value:"0 9 * * *"},{label:"Weekly (Mon 9 AM)",value:"0 9 * * 1"},{label:"Monthly (1st 9 AM)",value:"0 9 1 * *"}],Wo=["query.completed","query.blocked","query.cached","query.compressed","cost.threshold","user.created"],ut=()=>{const{auth:t}=Je(),h=eo(),[f,O]=r.useState(null),[m,we]=r.useState(0),[H,Fe]=r.useState([]),[_e,Re]=r.useState([]),[We,M]=r.useState(!1),[Pe,C]=r.useState(!1),[$,q]=r.useState(null),[k,Q]=r.useState(""),[G,V]=r.useState(""),[v,J]=r.useState(""),[I,L]=r.useState("0 9 * * *"),[Z,ee]=r.useState(""),[oe,te]=r.useState(!1),[U,Te]=r.useState([]),[ze,se]=r.useState(!1),[Ee,S]=r.useState(!1),[w,ne]=r.useState(""),[F,re]=r.useState(""),[ie,ae]=r.useState(""),[B,le]=r.useState([]),[ce,de]=r.useState(!1),{setOpenAlert:xe}=Ze(),D=o=>xe(!0,"error",o),he=o=>xe(!0,"success",o),Y=(t==null?void 0:t.token)??"YOUR_API_KEY",X=`${p}api/v1/chat/completions`,Oe=`${p}api/v1/models`,pe=(o,i)=>{navigator.clipboard.writeText(o.replace("YOUR_API_KEY",Y)),O(i),setTimeout(()=>O(null),2e3)},j=async()=>{if(t!=null&&t.token){M(!0);try{const o=await lo(t.token);Fe(o)}catch(o){console.error("Failed to load routines:",o)}finally{M(!1)}}},Le=async()=>{if(t!=null&&t.token)try{const o=await h.getRules(t.token);Re(o)}catch(o){console.error("Failed to load routing rules:",o)}};r.useEffect(()=>{m===1&&(j(),Le()),m===2&&_()},[m]);const _=r.useCallback(async()=>{if(t!=null&&t.token){se(!0);try{Te(await wo(t.token))}catch(o){console.error("Failed to load webhooks:",o)}finally{se(!1)}}},[t==null?void 0:t.token]),Ue=async()=>{if(t!=null&&t.token&&!(!w.trim()||!F.trim())){de(!0);try{await Fo(t.token,{name:w,url:F,secret:ie||null,event_types:B.length>0?B:null,is_active:!0}),he("Webhook created"),S(!1),ne(""),re(""),ae(""),le([]),await _()}catch{D("Failed to create webhook")}finally{de(!1)}}},Be=async o=>{if(t!=null&&t.token)try{await _o(t.token,o.id,{is_active:!o.is_active}),await _()}catch{D("Failed to update webhook")}},De=async o=>{if(t!=null&&t.token)try{await Ro(t.token,o.id),he("Webhook deleted"),await _()}catch{D("Failed to delete webhook")}},Ye=o=>{le(i=>i.includes(o)?i.filter(n=>n!==o):[...i,o])},Xe=async()=>
6{if(t!=null&&t.token&&!(!k.trim()||!v.trim())){te(!0);try{const o={name:k,description:G||null,query:v,routing_rule_id:Z||null,schedule_cron:I};await po(t.token,o),C(!1),Q(""),V(""),J(""),L("0 9 * * *"),ee(""),await j()}catch(o){console.error("Failed to create routine:",o)}finally{te(!1)}}},Ke=async o=>{if(t!=null&&t.token)try{await co(t.token,o.id,{is_active:!o.is_active}),await j()}catch(i){console.error("Failed to toggle routine:",i)}},Ne=async o=>{if(t!=null&&t.token)try{await ho(t.token,o.id),await j()}catch(i){console.error("Failed to delete routine:",i)}},He=async o=>{if(t!=null&&t.token){q(o.id);try{await xo(t.token,o.id),await j()}catch(i){console.error("Failed to run routine:",i)}finally{q(null)}}},Me=[{id:"typingmind",name:"TypingMind",description:"Connect TypingMind to Xilos as a custom OpenAI-compatible provider. All queries route through Xilos governance, caching, and workflow engine.",category:"Chat Client",icon:e.jsx(N,{size:24,color:l}),setupSteps:["Go to Settings > Model Providers > Add Custom Provider","Set API Base URL to your Xilos endpoint","Set API Key to your Xilos API token","Select the 'xilos' model from the model list"],configSnippet:`API Base URL: ${p}api/v1
7API Key: YOUR_API_KEY
8Model: xilos`,docsUrl:"https://typingmind.com/docs"},{id:"open-web-ui",name:"Open WebUI",description:"Add Xilos as an OpenAI-compatible API connection in Open WebUI. Full chat interface with Xilos routing, guardrails, and semantic caching.",category:"Chat 
8Client",icon:e.jsx(N,{size:24,color:l}),setupSteps:["Go to Settings > Connections > OpenAI API","Set Base URL to your Xilos API endpoint","Set API Key to your Xilos API token","Save and select the 'xilos' model"],configSnippet:`Base URL: ${p}api/v1
9API Key: YOUR_API_KEY
10Model: xilos`,docsUrl:"https://docs.openwebui.com"},{id:"hermes",name:"Hermes Agent",description:"Wire Hermes Agent to use Xilos as its LLM backend. Queries pass through Xilos routing rules, workflows, and governance before reaching the LLM.",category:"AI Agent",icon:e.jsx(ao,{size:24,color:l}),setupSteps:["In Hermes config, set the LLM provider to OpenAI-compatible","Set the endpoint to your Xilos chat completions URL","Set the API key to your Xilos API token","Set model name to 'xilos'"],configSnippet:`provider: openai-compatible
11endpoint: ${X}
12api_key: YOUR_API_KEY
13model: xilos`,docsUrl:"https://hermes-agent.nousresearch.com/docs"},{id:"claude-code",name:"Claude Code CLI",description:"Route Claude Code CLI requests through Xilos for governance, caching, and multi-model workflows.",category:"AI Agent",icon:e.jsx(Ie,{size:24,color:l}),setupSteps:["Set the ANTHROPIC_API_KEY env var to your Xilos API token","Configure the API base URL to point to Xilos","Set the model to 'xilos'"],configSnippet:`export ANTHROPIC_API_KEY=YOUR_API_KEY
14export ANTHROPIC_BASE_URL=${p}api/v1`},{id:"codex",name:"OpenAI Codex CLI",description:"Use Codex CLI with Xilos as the API backend. All code queries route through Xilos intelligent routing and governance.",category:"AI Agent",icon:e.jsx(ve,{size:24,color:l}),setupSteps:["Set OPENAI_API_KEY to your Xilos API token","Set OPENAI_BASE_URL to your Xilos API endpoint","Run codex with model 'xilos'"],configSnippet:`export OPENAI_API_KEY=YOUR_API_KEY
15export OPENAI_BASE_URL=${p}api/v1
16codex --model xilos`},{id:"curl",name:"REST API (curl)",description:"Direct API access via standard OpenAI-compatible endpoints. Use with any HTTP client, SDK, or programming language.",category:"Developer Tool",icon:e.jsx(ve,{size:24,color:l}),setupSteps:["Set Authorization header to Bearer YOUR_API_KEY","POST to /api/v1/chat/completions with messages array","Use model 'xilos' — Xilos handles routing internally"],configSnippet:`curl -X POST ${X} \\
17  -H "Content-Type: application/json" \\
18  -H "Authorization: Bearer YOUR_API_KEY" \\
19  -d '{
20    "model": "xilos",
21    "messages": [{"role": "user", "content": "Hello!"}]
22  }'`},{id:"python-sdk",name:"Python (OpenAI SDK)",description:"Use the official OpenAI Python SDK with Xilos as the backend. Drop-in replacement — just change the base URL and API key.",category:"Developer Tool",icon:e.jsx(Ie,{size:24,color:l}),setupSteps:["Install: pip install openai","Set base_url to your Xilos API endpoint","Set api_key to your Xilos API token","Use model='xilos' for all completions"],configSnippet:`from openai import OpenAI
23
24client = OpenAI(
25    base_url="${p}api/v1",
26    api_key="YOUR_API_KEY",
27)
28
29response = client.chat.completions.create(
30    model="xilos",
31    messages=[{"role": "user", "content": "Hello!"}],
32)
33print(response.choices[0].message.content)`}],$e=["Chat Client","AI Agent","Developer Tool"],qe={"Chat Client":"#EFF6FF","AI Agent":"#ECFDF5","Developer Tool":"#FEF3C7"},Qe={"Chat Client":"#0066FF","AI Agent":"#059669","Developer Tool":"#D97706"},Ge=o=>{if(!o)return"Never";try{return new Date(o).toLocaleString()}catch{return o}};return e.jsx(oo,{children:e.jsxs(a,{sx:{backgroundColor:"#f8f9fa",minHeight:"100vh",p:{xs:2,md:4}},children:[e.jsxs(a,{sx:{mb:4},children:[e.jsxs(c,{direction:"row",alignItems:"center",spacing:1.5,sx:{mb:1},children:[e.jsx(to,{size:28,color:l}),e.jsx(s,{variant:"h4",fontWeight:600,sx:{color:"#0A0A0A"},children:"Integrations"})]}),e.jsx(s,{variant:"body1",sx:{color:"#6B7280",maxWidth:640},children:"Connect any OpenAI-compatible client to Xilos. All queries route through your governance policies, semantic cache, and intelligent workflow engine."})]}),e.jsxs(mo,{value:m,onChange:(o,i)=>we(i),sx:{mb:3,borderBottom:"1px solid #E5E7EB"},children:[e.jsx(K,{label:"Integrations"}),e.jsx(K,{label:"Routines"}),e.jsx(K,{label:"Webhooks"})]}),m===0&&e.jsxs(e.Fragment,{children:[e.jsx(A,{sx:{borderRadius:"12px",border:"1px solid #F0F0F0",boxShadow:"0 1px 3px rgba(0,0,0,0.06)",mb:4,backgroundColor:"#FAFAFA"},children:e.jsx(R,{sx:{p:2.5},children:e.jsxs(c,{direction:{xs:"column",sm:"row"},spacing:2,alignItems:{sm:"center"},justifyContent:"space-between",children:[e.jsxs(a,{children:[e.jsx(s,{variant:"caption",sx:{color:"#6B7280",textTransform:"uppercase",letterSpacing:"0.04em",fontWeight:600},children:"Your API Endpoint"}),e.jsx(s,{variant:"body2",sx:{color:"#0A0A0A",fontFamily:"monospace",mt:.5},children:X})]}),e.jsxs(a,{children:[e.jsx(s,{variant:"caption",sx:{color:"#6B7280",textTransform:"uppercase",letterSpacing:"0.04em",fontWeight:600},children:"API Key"}),e.jsxs(c,{direction:"row",alignItems:"center",spacing:1,sx:{mt:.5},children:[e.jsxs(s,{variant:"body2",sx:{color:"#0A0A0A",fontFamily:"monospace"},children:[Y.slice(0,12),"••••••••"]}),e.jsx(g,{title:"Copy API key",children:e.jsx(b,{size:"small",onClick:()=>pe(Y,"apikey"),children:f==="apikey"?e.jsx(ue,{size:16,color:"#059669"}
33):e.jsx(ge,{size:16,color:"#9CA3AF"})})})]})]}),e.jsxs(a,{children:[e.jsx(s,{variant:"caption",sx:{color:"#6B7280",textTransform:"uppercase",letterSpacing:"0.04em",fontWeight:600},children:"Models URL"}),e.jsx(s,{variant:"body2",sx:{color:"#0A0A0A",fontFamily:"monospace",mt:.5},children:Oe})]})]})})}),$e.map(o=>{const i=Me.filter(n=>n.category===o);return i.length===0?null:e.jsxs(a,{sx:{mb:4},children:[e.jsx(s,{variant:"subtitle1",fontWeight:600,sx:{color:"#374151",mb:2,textTransform:"uppercase",letterSpacing:"0.04em",fontSize:"0.8125rem"},children:o}),e.jsx(a,{sx:{display:"grid",gridTemplateColumns:{xs:"1fr",md:"1fr 1fr"},gap:2},children:i.map(n=>e.jsx(A,{sx:{borderRadius:"12px",border:"1px solid #F0F0F0",boxShadow:"0 1px 3px rgba(0,0,0,0.06)","&:hover":{boxShadow:"0 4px 12px rgba(0,0,0,0.08)"},transition:"box-shadow 0.2s ease"},children:e.jsxs(R,{sx:{p:2.5},children:[e.jsxs(c,{direction:"row",alignItems:"flex-start",spacing:2,sx:{mb:2},children:[e.jsx(a,{sx:{width:44,height:44,borderRadius:"10px",backgroundColor:"#F9FAFB",display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0},children:n.icon}),e.jsxs(a,{sx:{flex:1,minWidth:0},children:[e.jsxs(c,{direction:"row",alignItems:"center",spacing:1,children:[e.jsx(s,{variant:"subtitle1",fontWeight:600,sx:{color:"#0A0A0A"},children:n.name}),e.jsx(W,{label:n.category,size:"small",sx:{backgroundColor:qe[n.category],color:Qe[n.category],fontWeight:600,fontSize:"0.7rem",height:22}})]}),e.jsx(s,{variant:"body2",sx:{color:"#6B7280",mt:.5},children:n.description})]}),n.docsUrl&&e.jsx(g,{title:"Open docs",children:e.jsx(b,{size:"small",component:"a",href:n.docsUrl,target:"_blank",rel:"noopener noreferrer",children:e.jsx(so,{size:16,color:"#9CA3AF"})})})]}),e.jsx(a,{sx:{mb:n.configSnippet?2:0},children:n.setupSteps.map((Ve,me)=>e.jsxs(c,{direction:"row",spacing:1.5,sx:{mb:.5},children:[e.jsxs(s,{variant:"body2",sx:{color:l,fontWeight:600,minWidth:18,fontSize:"0.8125rem"},children:[me+1,"."]}),e.jsx(s,{variant:"body2",sx:{color:"#374151",fontSize:"0.8125rem"},children:Ve})]},me))}),n.configSnippet&&e.jsxs(a,{sx:{backgroundColor:"#0F172A",borderRadius:"8px",p:2,position:"relative",overflow:"auto"},children:[e.jsx(g,{title:"Copy config",children:e.jsx(b,{size:"small",onClick:()=>pe(n.configSnippet,n.id),sx:{position:"absolute",top:4,right:4},children:f===n.id?e.jsx(ue,{size:14,color:"#059669"}):e.jsx(ge,{size:14,color:"#6B7280"})})}),e.jsx(s,{component:"pre",sx:{color:"#E5E7EB",fontFamily:"monospace",fontSize:"0.75rem",lineHeight:1.5,margin:0,whiteSpace:"pre-wrap",wordBreak:"break-word",pr:4},children:n.configSnippet})]})]})},n.id))})]},o)})]}),m===1&&e.jsxs(a,{children:[e.jsxs(c,{direction:"row",justifyContent:"space-between",alignItems:"center",sx:{mb:3},children:[e.jsxs(a,{children:[e.jsx(s,{variant:"h6",fontWeight:600,sx:{color:"#0A0A0A"},children:"Scheduled Routines"}),e.jsx(s,{variant:"body2",sx:{color:"#6B7280"},children:"Run AI-powered queries on a schedule. Results are stored for review."})]}),e.jsx(u,{variant:"contained",startIcon:e.jsx(be,{size:18}),onClick:()=>C(!0),sx:{backgroundColor:l,textTransform:"none",borderRadius:"8px","&:hover":{backgroundColor:"#0052CC"}},children:"New Routine"})]}),We?e.jsx(a,{sx:{display:"flex",justifyContent:"center",py:6},children:e.jsx(y,{sx:{color:l}})}):H.length===0?e.jsx(A,{sx:{borderRadius:"12px",border:"1px solid #F0F0F0"},children:e.jsx(R,{sx:{textAlign:"center",py:6},children:e.jsx(s,{variant:"body1",sx:{color:"#6B7280"},children:"No routines yet. Create one to get started."})})}):e.jsx(bo,{component:go,sx:{borderRadius:"12px",border:"1px solid #F0F0F0",boxShadow:"0 1px 3px rgba(0,0,0,0.06)"},children:e.jsxs(fo,{children:[e.jsx(jo,{children:e.jsxs(fe,{sx:{backgroundColor:"#FAFAFA"},children:[e.jsx(d,{sx:{fontWeight:600,color:"#374151"},children:"Name"}),e.jsx(d,{sx:{fontWeight:600,color:"#374151"},children:"Schedule"}),e.jsx(d,{sx:{fontWeight:600,color:"#374151"},children:"Last Run"}),e.jsx(d,{sx:{fontWeight:600,color:"#374151"},children:"Status"}),e.jsx(d,{sx:{fontWeight:600,color:"#374151"},align:"right",children:"Actions"})]})}),e.jsx(yo,{children:H.map(o=>e.jsxs(fe,{hover:!0,children:[e.jsxs(d,{children:[e.jsx(s,{variant:"body2",fontWeight:600,sx:{color:"#0A0A0A"},children:o.name}),o.description&&e.jsx(s,{variant:"caption",sx:{color:"#6B7280"},children:o.description})]}),e.jsx(d,{children:e.jsx(s,{variant:"body2",sx:{color:"#374151",fontFamily:"monospace",fontSize:"0.75rem"},children:o.schedule_cron})}),e.jsx(d,{children:e.jsx(s,{variant:"body2",sx:{color:"#374151",fontSize:"0.75rem"},children:Ge(o.last_run_at)})}),e.jsx(d,{children:e.jsxs(c,{direction:"row",alignItems:"center",spacing:1,children:[e.jsx(je,{size:"small",checked:o.is_active,onChange:()=>Ke(o)}),e.jsx(W,{label:o.is_active?"Active":"Inactive",size:"small",sx:{backgroundColor:o.is_active?"#ECFDF5":"#F3F4F6",color:o.is_active?"#059669":"#6B7280",fontWeight:600,fontSize:"0.7rem",height:22}})]})}),e.jsx(d,{align:"right",children:e.jsxs(c,{direction:"row",spacing:1,justifyContent:"flex-end",children:[e.jsx(g,{title:"Run now",children:e.jsx(b,{size:"small",onClick:()=>He(o),disabled:$===o.id,children:$===o.id?e.jsx(y,{size:16,sx:{color:l}}):e.jsx(Ao,{size:16,color:l})})}),e.jsx(g,{title:"Deactivate",children:e.jsx(b,{size:"small",onClick:()=>
33Ne(o),disabled:!o.is_active,children:e.jsx(N,{size:16,color:"#9CA3AF"})})})]})})]},o.id))})]})}),e.jsxs(ye,{open:Pe,onClose:()=>C(!1),maxWidth:"sm",fullWidth:!0,children:[e.jsx(Ae,{sx:{fontWeight:600},children:"Create Routine"}),e.jsx(Ce,{children:e.jsxs(c,{spacing:2,sx:{mt:1},children:[e.jsx(x,{label:"Name",value:k,onChange:o=>Q(o.target.value),fullWidth:!0,size:"small"}),e.jsx(x,{label:"Description (optional)",value:G,onChange:o=>V(o.target.value),fullWidth:!0,size:"small"}),e.jsx(x,{label:"Query",value:v,onChange:o=>J(o.target.value),fullWidth:!0,multiline:!0,rows:4,size:"small",placeholder:"The prompt to send on schedule..."}),e.jsxs(x,{select:!0,label:"Schedule Preset",value:Se.some(o=>o.value===I)?I:"custom",onChange:o=>{o.target.value!=="custom"&&L(o.target.value)},fullWidth:!0,size:"small",children:[Se.map(o=>e.jsxs(P,{value:o.value,children:[o.label," (",o.value,")"]},o.value)),e.jsx(P,{value:"custom",children:"Custom (edit below)"})]}),e.jsx(x,{label:"Cron Expression",value:I,onChange:o=>L(o.target.value),fullWidth:!0,size:"small",helperText:"Standard 5-field cron: min hour day month weekday"}),e.jsxs(x,{select:!0,label:"Routing Rule (optional)",value:Z,onChange:o=>ee(o.target.value),fullWidth:!0,size:"small",children:[e.jsx(P,{value:"",children:e.jsx("em",{children:"None (use default routing)"})}),_e.map(o=>e.jsx(P,{value:o.id,children:o.name},o.id))]})]})}),e.jsxs(ke,{sx:{p:2},children:[e.jsx(u,{onClick:()=>C(!1),sx:{textTransform:"none"},children:"Cancel"}),e.jsx(u,{variant:"contained",onClick:Xe,disabled:oe||!k.trim()||!v.trim(),sx:{backgroundColor:l,textTransform:"none","&:hover":{backgroundColor:"#0052CC"}},children:oe?e.jsx(y,{size:20,sx:{color:"white"}}):"Create"})]})]})]}),m===2&&e.jsxs(a,{children:[e.jsxs(c,{direction:"row",justifyContent:"space-between",alignItems:"center",sx:{mb:3},children:[e.jsxs(a,{children:[e.jsx(s,{variant:"h6",fontWeight:600,sx:{color:"#0A0A0A"},children:"Webhooks"}),e.jsx(s,{variant:"body2",sx:{color:"#6B7280"},children:"Receive event-driven notifications when queries complete, are blocked, cached, or compressed."})]}),e.jsx(u,{variant:"contained",startIcon:e.jsx(be,{size:18}),onClick:()=>S(!0),sx:{backgroundColor:l,textTransform:"none",borderRadius:"8px","&:hover":{backgroundColor:"#0052CC"}},children:"New Webhook"})]}),ze?e.jsx(a,{sx:{display:"flex",justifyContent:"center",py:6},children:e.jsx(y,{sx:{color:l}})}):U.length===0?e.jsx(A,{sx:{borderRadius:"12px",border:"1px solid #F0F0F0"},children:e.jsx(R,{sx:{textAlign:"center",py:6},children:e.jsx(s,{variant:"body1",sx:{color:"#6B7280"},children:"No webhooks yet. Create one to receive event notifications."})})}):e.jsx(A,{sx:{borderRadius:"12px",border:"1px solid #F0F0F0",boxShadow:"0 1px 3px rgba(0,0,0,0.06)"},children:e.jsx(Co,{children:U.map((o,i)=>e.jsxs(no,{divider:i<U.length-1,sx:{py:2},children:[e.jsx(ro,{primary:e.jsxs(c,{direction:"row",alignItems:"center",spacing:1,children:[e.jsx(s,{variant:"body2",fontWeight:600,sx:{color:"#0A0A0A"},children:o.name}),e.jsx(W,{label:o.is_active?"Active":"Inactive",size:"small",sx:{backgroundColor:o.is_active?"#ECFDF5":"#F3F4F6",color:o.is_active?"#059669":"#6B7280",fontWeight:600,fontSize:"0.7rem",height:22}})]}),secondary:e.jsxs(a,{sx:{mt:.5},children:[e.jsx(s,{variant:"caption",sx:{color:"#6B7280",fontFamily:"monospace",display:"block"},children:o.url}),o.event_types&&o.event_types.length>0&&e.jsx(c,{direction:"row",spacing:.5,sx:{mt:.5,flexWrap:"wrap",gap:.5},children:o.event_types.map(n=>e.jsx(W,{label:n,size:"small",sx:{backgroundColor:"#EFF6FF",color:l,fontSize:"0.65rem",height:18}},n))})]})}),e.jsx(io,{children:e.jsxs(c,{direction:"row",spacing:1,alignItems:"center",children:[e.jsx(je,{size:"small",checked:o.is_active,onChange:()=>Be(o)}),e.jsx(g,{title:"Delete webhook",children:e.jsx(b,{size:"small",onClick:()=>De(o),children:e.jsx(ko,{size:16,color:"#9CA3AF"})})})]})})]},o.id))})}),e.jsxs(ye,{open:Ee,onClose:()=>S(!1),maxWidth:"sm",fullWidth:!0,children:[e.jsx(Ae,{sx:{fontWeight:600},children:"Create Webhook"}),e.jsx(Ce,{children:e.jsxs(c,{spacing:2,sx:{mt:1},children:[e.jsx(x,{label:"Name",value:w,onChange:o=>ne(o.target.value),fullWidth:!0,size:"small",placeholder:"My Webhook"}),e.jsx(x,{label:"URL",value:F,onChange:o=>re(o.target.value),fullWidth:!0,size:"small",placeholder:"https://example.com/webhook"}),e.jsx(x,{label:"Secret (optional, for HMAC signing)",value:ie,onChange:o=>ae(o.target.value),fullWidth:!0,size:"small",placeholder:"Leave blank for no signing"}),e.jsxs(a,{children:[e.jsx(s,{variant:"body2",sx:{color:"#374151",mb:1,fontWeight:600},children:"Event Types"}),Wo.map(o=>e.jsx(vo,{control:e.jsx(Io,{size:"small",checked:B.includes(o),onChange:()=>Ye(o)}),label:e.jsx(s,{variant:"body2",sx:{fontSize:"0.8125rem"},children:o})},o))]})]})}),e.jsxs(ke,{sx:{p:2},children:[e.jsx(u,{onClick:()=>S(!1),sx:{textTransform:"none"},children:"Cancel"}),e.jsx(u,{variant:"contained",onClick:Ue,disabled:ce||!w.trim()||!F.trim(),sx:{backgroundColor:l,textTransform:"none","&:hover":{backgroundColor:"#0052CC"}},children:ce?e.jsx(y,{size:20,sx:{color:"white"}}):"Create"})]})]})]})]})})};export{ut 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.