PageSourceSearch

https://aiyunrouter.com/static/js/async/3078.b66936fa6f.js

js aiyunrouter.com collected 2026-10-06 14:14:51 UTC 24,568 bytes, 2 lines download raw bytes

1/*! LICENSE: 3078.b66936fa6f.js.LICENSE.txt */
2"use strict";(self.rspackChunknewapi_web=self.rspackChunknewapi_web||[]).push([[3078],{57701(e,s,a){a.r(s),a.d(s,{component:()=>ei});var t=a(72361),r=a(96962),n=a(53540),i=a(55667),l=a(66002),d=a(67834),c=a(95227),o=a(9781);let m=(0,o.A)("handshake",[["path",{d:"m11 17 2 2a1 1 0 1 0 3-3",key:"efffak"}],["path",{d:"m14 14 2.5 2.5a1 1 0 1 0 3-3l-3.88-3.88a3 3 0 0 0-4.24 0l-.88.88a1 1 0 1 1-3-3l2.81-2.81a5.79 5.79 0 0 1 7.06-.87l.47.28a2 2 0 0 0 1.42.25L21 4",key:"9pr0kb"}],["path",{d:"m21 3 1 11h-2",key:"1tisrp"}],["path",{d:"M3 3 2 14l6.5 6.5a1 1 0 1 0 3-3",key:"1uvwmv"}],["path",{d:"M3 4h8",key:"1ep09j"}]]),u=(0,o.A)("file-key",[["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M4 12v6",key:"bg1pfk"}],["path",{d:"M4 14h2",key:"1sf9f8"}],["path",{d:"M9.65 22H18a2 2 0 0 0 2-2V8a2.4 2.4 0 0 0-.706-1.706l-3.588-3.588A2.4 2.4 0 0 0 14 2H6a2 2 0 0 0-2 2v4",key:"d56i0q"}],["circle",{cx:"4",cy:"20",r:"2",key:"6kqj1y"}]]);var x=a(98307);let p=(0,o.A)("badge-check",[["path",{d:"M3.85 8.62a4 4 0 0 1 4.78-4.77 4 4 0 0 1 6.74 0 4 4 0 0 1 4.78 4.78 4 4 0 0 1 0 6.74 4 4 0 0 1-4.77 4.78 4 4 0 0 1-6.75 0 4 4 0 0 1-4.78-4.77 4 4 0 0 1 0-6.76Z",key:"3c2336"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);var h=a(55724),j=a(54622),g=a(65277),b=a(14653),f=a(23921),v=a(13236),N=a(40315),y=a(35432),k=a(45202),w=a(68413),A=a(6702),C=a(20598),_=a(47745),S=a(18353),z=a(90879),F=a(72868),R=a(97653),P=a(49641),$=a(54052),M=a(1738),L=a(11728),T=a(74501),U=a(38939),E=a(49302),I=a(70954),B=a(11768),H=a(95327),q=a(29164),J=a(51430),O=a(85398),D=a(22267),K=a(2076),V=a(22990);async function G(e,s,a){let t=a?`/api/business-cooperation/${e}/resubmit`:`/api/business-cooperation/${e}`;return(await V.FH.request({method:a?"POST":"PUT",url:t,data:{upstream:s}})).data}async function Q(e){return(await V.FH.delete(`/api/business-cooperation/${e}`)).data}async function Y(){return(await V.FH.get("/api/business-cooperation")).data}async function W(e){return(await V.FH.post("/api/business-cooperation",{upstream:e})).data}async function X(e){return(await V.FH.post("/api/business-cooperation/models",{...e,models:void 0})).data}var Z=a(2160);let ee={type:1,name:"",base_url:"",api_key:"",models:"",contact:"",remark:""},es=[];function ea(e){let{title:s,value:a,options:r,searchPlaceholder:n,emptyText:i,clearText:c,onValueChange:o}=e,[m,u]=(0,w.useState)(!1),x=r.find(e=>e.value===a);return(0,t.jsxs)(T.AM,{open:m,onOpenChange:u,children:[(0,t.jsxs)(T.Wv,{render:(0,t.jsx)(F.$,{type:"button",variant:"outline",size:"sm",className:"h-8 border-dashed"}),children:[(0,t.jsx)(l.A,{className:"size-4"}),s,x&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(U.w,{orientation:"vertical",className:"mx-1 h-4"}),(0,t.jsx)(z.E,{variant:"secondary",className:"max-w-44 truncate rounded-sm px-1 font-normal",children:x.label})]})]}),(0,t.jsx)(T.hl,{className:"max-w-[360px] min-w-[200px] p-0",align:"start",children:(0,t.jsxs)(R.uB,{children:[(0,t.jsx)(R.G7,{placeholder:n}),(0,t.jsxs)(R.oI,{className:"max-h-72",children:[(0,t.jsx)(R.xL,{children:i}),(0,t.jsx)(R.L$,{children:r.map(e=>{let s=e.value===a;return(0,t.jsxs)(R.h_,{value:`${e.label} ${e.value}`,onSelect:()=>{o(e.value),u(!1)},children:[(0,t.jsx)("span",{className:`flex size-4 items-center justify-center rounded-sm border ${s?"border-primary bg-primary text-primary-foreground":"border-input opacity-60 [&_svg]:invisible"}`,children:(0,t.jsx)(d.A,{className:"size-3"})}),(0,t.jsx)("span",{className:"min-w-0 flex-1 truncate",children:e.label})]},e.value)})})]}),x&&(0,t.jsx)("div",{className:"border-border border-t p-1",children:(0,t.jsx)("button",{type:"button",className:"text-muted-foreground hover:bg-muted hover:text-foreground flex h-8 w-full items-center justify-center rounded-sm px-2 text-sm transition-colors",onClick:()=>{o("all"),u(!1)},children:c})})]})})]})}function et(e){switch(e){case"benchmark_running":return"Application status benchmarking";case"pending_decision":default:return"Application status pending review";case"approved":return"Application status approved";case"rejected":return"Application status failed"}}let er={approved:"border-emerald-200 bg-emerald-50 text-emerald-700 dark:border-emerald-900 dark:bg-emerald-950/40 dark:text-emerald-300",benchmark_running:"border-blue-200 bg-blue-50 text-blue-700 dark:border-blue-900 dark:bg-blue-950/40 dark:text-blue-300",pen
2ding_decision:"border-amber-200 bg-amber-50 text-amber-700 dark:border-amber-900 dark:bg-amber-950/40 dark:text-amber-300",rejected:"border-red-200 bg-red-50 text-red-700 dark:border-red-900 dark:bg-red-950/40 dark:text-red-300",pending_review:"border-slate-200 bg-slate-50 text-slate-700 dark:border-slate-800 dark:bg-slate-900/60 dark:text-slate-300"};function en(e){return q.Uz.some(s=>s.value===e.type)?(0,t.jsx)("span",{className:"inline-flex shrink-0",children:(0,H.Y)(`${(0,O.hd)(e.type)}.Color`,e.size??16)}):(0,t.jsx)(c.A,{className:"text-muted-foreground shrink-0",style:{width:e.size??16,height:e.size??16},"aria-hidden":"true"})}let ei=function(){let{t:e}=(0,A.Bd)(),s=(0,r.jE)(),[a,c]=(0,w.useState)(!1),[o,R]=(0,w.useState)(ee),[T,H]=(0,w.useState)(null),[V,ei]=(0,w.useState)(null),[el,ed]=(0,w.useState)(""),[ec,eo]=(0,w.useState)("all"),[em,eu]=(0,w.useState)("all"),[ex,ep]=(0,w.useState)([]),eh=(0,n.I)({queryKey:["business-cooperations"],queryFn:Y,refetchInterval:e=>!!e.state.data?.data?.items.some(e=>["benchmark_running","pending_decision"].includes(e.status))&&5e3}),ej=(0,i.n)({mutationFn:e=>T?G(T.id,e,"rejected"===T.status):W(e),onSuccess:a=>{a.success&&(c(!1),R(ee),H(null),C.oR.success(e("Application submitted")),s.invalidateQueries({queryKey:["business-cooperations"]}))}}),eg=(0,i.n)({mutationFn:X,onSuccess:s=>{if(!s.success)return void C.oR.error(s.message||e("Failed to fetch models"));let a=s.data?.models??[];ep(a),C.oR.success(e("Fetched {{count}} model(s) from upstream",{count:a.length}))},onError:s=>C.oR.error(s instanceof Error?s.message:e("Failed to fetch models"))}),eb=(0,i.n)({mutationFn:Q,onSuccess:a=>{a.success&&(C.oR.success(e("Application deleted")),s.invalidateQueries({queryKey:["business-cooperations"]}))}}),ef=eh.data?.data?.items??es,ev=(0,w.useMemo)(()=>{let e=el.trim().toLowerCase();return ef.filter(s=>{var a;return("all"===ec||String(s.upstream.type)===ec)&&("all"===em||("pending_review"===em?"pending_review"===(a=s.status)||"pending_decision"===a:s.status===em))&&(!e||[s.upstream.name,s.upstream.base_url].some(s=>s.toLowerCase().includes(e)))})},[ef,el,em,ec]),eN=(0,w.useMemo)(()=>o.models.split(",").map(e=>e.trim()).filter(Boolean),[o.models]),ey=(0,w.useMemo)(()=>((0,J.A5)(o.type).hints?.models??"").split(",").map(e=>e.trim()).filter(Boolean),[o.type]),ek=(0,w.useMemo)(()=>[...new Set([...ex,...eN])].map(e=>({value:e,label:e})),[ex,eN]),ew=(0,w.useMemo)(()=>q.Uz.map(s=>({value:String(s.value),label:e(s.label),icon:(0,t.jsx)(en,{type:s.value,size:16})})),[e]),eA=(0,w.useMemo)(()=>q.Uz.map(s=>({value:String(s.value),label:e(s.label)})),[e]),eC=(0,w.useMemo)(()=>["pending_review","benchmark_running","approved","rejected"].map(s=>({value:s,label:e(et(s))})),[e]),e_=()=>{H(null),R(ee),ep([]),c(!0)},eS=e=>{H(e),R({type:e.upstream.type,name:e.upstream.name,base_url:e.upstream.base_url,api_key:"",models:e.upstream.models||"",contact:e.upstream.contact,remark:e.upstream.remark}),ep([]),c(!0)},ez=e=>R(s=>({...s,models:e.join(",")})),eF=e=>ez([...new Set(e.map(e=>e.trim()).filter(Boolean))]),eR=async()=>{o.models.trim()?await (0,B.l)(o.models)&&C.oR.success(e("Copied to clipboard")):C.oR.info(e("No models to copy"))},eP="New cooperation application";T&&(eP="rejected"===T.status?"Resubmit application":"Edit application");let e$=(0,t.jsx)("div",{className:"h-full overflow-y-auto",children:(0,t.jsx)("section",{className:"flex min-h-full items-center py-2 sm:py-4",children:(0,t.jsxs)("div",{className:"grid w-full overflow-hidden rounded-md border lg:grid-cols-[minmax(0,1.05fr)_minmax(360px,0.95fr)]",children:[(0,t.jsxs)("div",{className:"flex flex-col justify-center p-6 sm:p-8 lg:p-10",children:[(0,t.jsx)("div",{className:"bg-primary/10 text-primary mb-5 flex size-11 items-center justify-center rounded-md",children:(0,t.jsx)(m,{"aria-hidden":"true",className:"size-5"})}),(0,t.jsx)("h3",{className:"max-w-xl text-xl font-semibold sm:text-2xl",children:e("Connect your upstream to start cooperating")}),(0,t.jsx)("p",{className:"text-muted-foreground mt-3 max-w-xl text-sm leading-6 sm:text-base",children:e("Submit your channel type, API endpoint, credentials, contact details, and supported models for review.")}),(0,t.jsxs)(F.$,{className:"mt-6 self-start",disabled:ej.isPending,onClick:e_,children:[(0,t.jsx)(l.A,{"data-icon":"inl
2ine-start"}),e("New application")]})]}),(0,t.jsxs)("div",{className:"bg-muted/30 flex flex-col justify-center border-t px-6 py-5 sm:px-8 lg:border-t-0 lg:border-l lg:px-9 lg:py-8",children:[(0,t.jsxs)("div",{className:"flex gap-4 py-4 first:pt-0 last:pb-0",children:[(0,t.jsx)("div",{className:"bg-background text-foreground flex size-9 shrink-0 items-center justify-center rounded-md border",children:(0,t.jsx)(u,{"aria-hidden":"true",className:"size-4"})}),(0,t.jsxs)("div",{className:"min-w-0",children:[(0,t.jsx)("h4",{className:"text-sm font-medium",children:e("Prepare upstream details")}),(0,t.jsx)("p",{className:"text-muted-foreground mt-1 text-sm leading-5",children:e("Provide the connection information and models required for verification.")})]})]}),(0,t.jsx)(U.w,{}),(0,t.jsxs)("div",{className:"flex gap-4 py-4 first:pt-0 last:pb-0",children:[(0,t.jsx)("div",{className:"bg-background text-foreground flex size-9 shrink-0 items-center justify-center rounded-md border",children:(0,t.jsx)(x.A,{"aria-hidden":"true",className:"size-4"})}),(0,t.jsxs)("div",{className:"min-w-0",children:[(0,t.jsx)("h4",{className:"text-sm font-medium",children:e("Platform benchmark review")}),(0,t.jsx)("p",{className:"text-muted-foreground mt-1 text-sm leading-5",children:e("The platform verifies connectivity, stability, concurrency, and error rate.")})]})]}),(0,t.jsx)(U.w,{}),(0,t.jsxs)("div",{className:"flex gap-4 py-4 first:pt-0 last:pb-0",children:[(0,t.jsx)("div",{className:"bg-background text-foreground flex size-9 shrink-0 items-center justify-center rounded-md border",children:(0,t.jsx)(p,{"aria-hidden":"true",className:"size-4"})}),(0,t.jsxs)("div",{className:"min-w-0",children:[(0,t.jsx)("h4",{className:"text-sm font-medium",children:e("Review result")}),(0,t.jsx)("p",{className:"text-muted-foreground mt-1 text-sm leading-5",children:e("Approved applications can be synchronized into channels; rejected applications can be revised and resubmitted.")})]})]})]})]})})});return eh.isLoading?e$=(0,t.jsx)("div",{className:"flex h-48 items-center justify-center",children:(0,t.jsx)(h.A,{className:"animate-spin"})}):ef.length>0&&(e$=(0,t.jsx)("div",{className:"h-full overflow-y-auto",children:(0,t.jsxs)("div",{className:"space-y-4 pb-1",children:[(0,t.jsx)("p",{className:"text-muted-foreground text-sm",children:e("For providers with existing relay capabilities seeking users and traffic distribution through the platform.")}),(0,t.jsx)("section",{className:"bg-card rounded-md border px-4 py-4 sm:px-5",children:(0,t.jsxs)("div",{className:"grid gap-4 lg:grid-cols-[minmax(0,2.1fr)_repeat(3,minmax(140px,1fr))]",children:[(0,t.jsxs)("div",{className:"min-w-0 lg:pr-5",children:[(0,t.jsx)("h3",{className:"text-sm font-semibold",children:e("Cooperation guide")}),(0,t.jsxs)("p",{className:"text-muted-foreground mt-2 text-sm leading-5",children:[e("Submit your channel type, API endpoint, credentials, contact details, and supported models for review.")," ",e("The platform verifies connectivity, stability, concurrency, and error rate.")," ",e("Approved applications can be synchronized into channels; rejected applications can be revised and resubmitted.")]})]}),(0,t.jsxs)("div",{className:"border-border/70 border-l pl-4",children:[(0,t.jsx)("p",{className:"text-muted-foreground text-xs",children:e("Review criteria")}),(0,t.jsx)("p",{className:"mt-1 text-sm",children:e("Stability, latency, available models, and error rate")})]}),(0,t.jsxs)("div",{className:"border-border/70 border-l pl-4",children:[(0,t.jsx)("p",{className:"text-muted-foreground text-xs",children:e("Credential usage")}),(0,t.jsx)("p",{className:"mt-1 text-sm",children:e("Only used for internal benchmark and acceptance testing")})]}),(0,t.jsxs)("div",{className:"border-border/70 border-l pl-4",children:[(0,t.jsx)("p",{className:"text-muted-foreground text-xs",children:e("Result handling")}),(0,t.jsx)("p",{className:"mt-1 text-sm",children:e("Approved for integration; rejected applications can be resubmitted")})]})]})}),(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,t.jsx)("div",{className:"relative min-w-48 flex-1 sm:max-w-72",children:(0,t.jsx)(M.p,{value:el,onChange:e=>ed(e.target.value),placeholder:e("Search by name or URL..."),"aria-label":e("Search by name or URL...")})}),(0,t.jsx)(ea,{title:e("Type"),options:eA,value:ec,onValueChange:e=>eo(e??"all"),searchPlaceholder:e("Search channel type..."),emptyText:e("No channel type found."),clearText:e("Clear filters")}),(0,t.jsx)(ea,{title:e("Status"),options:eC,value:em,onValueChange:e=>eu(e??"all"),searchPlaceholder:e("Search status..."),emptyText:e("No status found."),clearText:e("Clear filters")}),(0,t.jsx)(F.$,{type:"button",variant:"outline",size:"icon",title:e("Refresh"),"aria-label":e("Refresh"),disabled:eh.isFetching,onClick:()=>eh.refetch(),children:(0,t.jsx)(j.A,{className:eh.isFetching?"animate-spin":""})}),(0,t.jsxs)(F.$,{className:"ml-auto",disabled:ej.isPending,onClick:e_,children:[(0,t.jsx)(l.A,{"data-icon":"inl
2ine-start"}),e("New application")]})]}),(0,t.jsx)("div",{className:"overflow-hidden rounded-md border",children:(0,t.jsxs)(E.XI,{className:"min-w-[920px]",children:[(0,t.jsx)(E.A0,{className:"bg-muted/40",children:(0,t.jsxs)(E.Hj,{children:[(0,t.jsx)(E.nd,{children:e("Name")}),(0,t.jsx)(E.nd,{children:e("Type")}),(0,t.jsx)(E.nd,{children:e("Status")}),(0,t.jsx)(E.nd,{children:e("Latest benchmark duration")}),(0,t.jsx)(E.nd,{children:e("Latest benchmark score")}),(0,t.jsx)(E.nd,{children:e("Created At")}),(0,t.jsx)(E.nd,{className:"text-right",children:e("Actions")})]})}),(0,t.jsx)(E.BF,{children:0===ev.length?(0,t.jsx)(E.Hj,{children:(0,t.jsx)(E.nA,{colSpan:7,className:"text-muted-foreground h-24 text-center",children:e("No matching applications")})}):ev.map(s=>{let a=s.upstream.latest_benchmark,r=q.Uz.find(e=>e.value===s.upstream.type),n=a?.overall_score,i=a?(0,K.t)(a):0;return(0,t.jsxs)(E.Hj,{children:[(0,t.jsx)(E.nA,{className:"max-w-64",children:(0,t.jsxs)("div",{className:"min-w-0",children:[(0,t.jsx)("p",{className:"truncate font-medium",children:s.upstream.name}),(0,t.jsx)("p",{className:"text-muted-foreground truncate text-xs",children:s.upstream.base_url})]})}),(0,t.jsx)(E.nA,{children:(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(en,{type:s.upstream.type,size:16}),(0,t.jsx)("span",{children:e(r?.label??"Unknown")})]})}),(0,t.jsx)(E.nA,{children:(0,t.jsx)(z.E,{className:er[s.status],variant:"outline",children:e(et(s.status))})}),(0,t.jsx)(E.nA,{children:function(e,s){if(!e||e<0)return"-";let a=Math.max(0,Math.round(e/1e3)),t=Math.floor(a/3600),r=Math.floor(a/60),n=a%60;return t>0?s("{{hours}}h {{minutes}}m {{seconds}}s",{hours:t,minutes:r%60,seconds:n}):0===r?s("{{seconds}}s",{seconds:n}):s("{{minutes}}m {{seconds}}s",{minutes:r,seconds:n})}(a?.duration_ms,e)}),(0,t.jsx)(E.nA,{children:null==n?"-":(0,t.jsxs)("div",{className:"flex flex-col gap-0.5",children:[(0,t.jsxs)("span",{className:"text-base font-semibold tabular-nums",children:[null!=n&&Number.isFinite(n)?Number.isInteger(n)?n.toLocaleString():n.toLocaleString(void 0,{maximumFractionDigits:2}):"-"," / 100"]}),i>0&&(0,t.jsx)("span",{className:"text-muted-foreground text-xs whitespace-nowrap",children:e("{{count}} criteria unmet",{count:i})})]})}),(0,t.jsx)(E.nA,{children:new Date(1e3*s.created_time).toLocaleString()}),(0,t.jsx)(E.nA,{children:(0,t.jsxs)("div",{className:"flex justify-end gap-1",children:["pending_review"===s.status&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(F.$,{variant:"ghost",size:"icon",title:e("Edit"),onClick:()=>eS(s),children:(0,t.jsx)(g.A,{})}),(0,t.jsx)(F.$,{variant:"ghost",size:"icon",title:e("Delete"),disabled:eb.isPending,onClick:()=>{window.confirm(e("Confirm delete?"))&&eb.mutate(s.id)},children:(0,t.jsx)(b.A,{})})]}),"pending_review"!==s.status&&"benchmark_running"!==s.status&&(0,t.jsx)(F.$,{variant:"ghost",size:"sm",onClick:()=>ei(s),children:e("Details")}),"rejected"===s.status&&(0,t.jsxs)(F.$,{variant:"ghost",size:"sm",title:e("Resubmit application"),"aria-label":e("Resubmit application"),disabled:ej.isPending,onClick:()=>eS(s),children:[ej.isPending&&T?.id===s.id?(0,t.jsx)(h.A,{className:"animate-spin","data-icon":"inline-start"}):(0,t.jsx)(f.A,{"data-icon":"inline-start"}),e("Resubmit application")]}),"benchmark_running"===s.status&&(0,t.jsx)("span",{className:"text-muted-foreground px-2",children:"-"})]})})]},s.id)})})]})})]})})),(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)(_.Ni,{fixedContent:!0,children:[(0,t.jsx)(_.Ni.Title,{children:e("Business Cooperation")}),(0,t.jsx)(_.Ni.Content,{children:e$})]}),(0,t.jsx)($.lG,{open:a,onOpenChange:c,children:(0,t.jsxs)($.Cf,{className:"flex max-h-[90vh] flex-col overflow-hidden sm:max-w-2xl",children:[(0,t.jsxs)($.c7,{className:"shrink-0",children:[(0,t.jsx)($.L3,{children:e(eP)}),(0,t.jsx)($.rr,{children:e("Submit upstream access for administrator benchmark review.")})]}),(0,t.jsx)("div",{className:"min-h-0 flex-1 overflow-y-auto overscroll-contain pr-1",children:(0,t.jsxs)("div",{className:"grid gap-4 sm:grid-cols-2",children:[(0,t.jsxs)("div",{className:"grid gap-2",children:[(0,t.jsx)(L.J,{htmlFor:"cooperation-type",children:e("Type *")}),(0,t.jsxs)("div",{className:"relative",children:[(0,t.jsx)("span",{className:"pointer-events-none absolute top-1/2 left-3 z-10 flex -translate-y-1/2",children:(0,t.jsx)(en,{type:o.type,size:18})}),(0,t.jsx)(P.G3,{id:"cooperation-type",options:ew,value:String(o.type),onValueChange:e=>{let s=Number(e);Number.isInteger(s)&&!(s<=0)&&(ep([]),R(e=>({...e,type:s})))},placeholder:e("Select channel type"),searchPlaceholder:e("Search channel type..."),emptyText:e("No channel type found."),className:"pl-10",openOnFocus:!1})]})]}),(0,t.jsxs)("div",{className:"grid gap-2",children:[(0,t.jsx)(L.J,{htmlFor:"cooperation-name",children:e("Name *")}),(0,t.jsx)(M.p,{id:"cooperation-name",placeholder:e(q.CJ.NAME),value:o.name,onChange:e=>R(s=>({...s,name:e.target.value}))})]}),(0,t.jsxs)("div",{className:"grid gap-2",children:[(0,t.jsx)(L.J,{htmlFor:"cooperation-contact",children:e("Contact")}),(0,t.jsx)(M.p,{id:"cooperation-contact",value:o.contact,onChange:e=>R({...o,contact:e.target.value})})]}),(0,t.jsx)("div",{className:"border-border/60 rounded-lg border p-4 sm:col-span-2",children:(0,t.jsxs)("div",{className:"grid gap-4",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("p",{className:"text-sm font-medium",children:e("Credentials")}),(0,t.jsx)("p",{className:"text-muted-foreground text-xs",children:e("Authentication")})]}),(0,t.jsxs)("div",{className:"grid gap-2",children:[(0,t.jsx)(L.J,{htmlFor:"cooperation-url",children:e("API Base URL *")}),(0,t.jsx)(M.p,{id:"cooperation-url",type:"url",value:o.base_url,onChange:e=>R(s=>({...s,base_url:e.target.value})),placeholder:"https://api.example.com"}),(0,t.jsx)("p",{className:"text-muted-foreground text-xs",children:e("Base URL is required for this channel type")})]}),(0,t.jsxs)("div",{className:"grid gap-2",children:[(0,t.jsx)(L.J,{htmlFor:"cooperation-key",children:e("API Key *")}),(0,t.jsx)(I.T,{id:"cooperation-key",rows:3,value:o.api_key,onChange:e=>R(s=>({...s,api_key:e.target.value})),placeholder:e(T?"Leave empty to keep existing key":(0,O.D6)(o.type))}),(0,t.jsx)("p",{className:"text-muted-foreground text-xs",children:e(q.B1.KEY)})]})]})}),(0,t.jsx)("div",{className:"border-border/60 bg-muted/10 rounded-lg border p-4 sm:col-span-2",children:(0,t.jsxs)("div",{className:"grid gap-3",children:[(0,t.jsxs)("div",{className:"flex flex-col gap-2 sm:flex-row sm:items-center sm:justify-between",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)(L.J,{children:e("Models *")}),(0,t.jsx)("p",{className:"text-muted-foreground text-xs",children:e("Select models or add custom ones")})]}),(0,t.jsx)(z.E,{variant:"outline",children:e("Selected {{count}}",{count:eN.length})})]}),(0,t.jsx)(S.K,{id:"cooperation-models",options:ek,selected:eN,onChange:ez,placeholder:e("Select models or add custom ones"),allowCreate:!0,createLabel:'Add custom model "{{value}}"',maxVisibleChips:6}),(0,t.jsx)(U.w,{}),(0,t.jsxs)("div",{children:[(0,t.jsx)("p",{className:"mb-1 text-sm font-medium",children:e("Quick actions")}),(0,t.jsx)("p",{className:"text-muted-foreground mb-2 text-xs",children:e("Use presets or upstream discovery to populate the model list faster.")}),(0,t.jsxs)("div",{className:"flex flex-wrap gap-2",children:[(0,t.jsxs)(F.$,{type:"button",variant:"outline",size:"sm",onClick:()=>eF(ey),disabled:!ey.length,children:[(0,t.jsx)(v.A,{"data-icon":"inl
2ine-start"}),e("Fill Related Models")]}),(0,t.jsxs)(F.$,{type:"button",variant:"outline",size:"sm",onClick:()=>eF(ex),disabled:!ex.length,children:[(0,t.jsx)(d.A,{"data-icon":"inline-start"}),e("Fill All Models")]}),Z.U.has(o.type)&&(0,t.jsxs)(F.$,{type:"button",variant:"outline",size:"sm",onClick:()=>{o.api_key.trim()?eg.mutate(o):C.oR.error(e("Please enter API key first"))},disabled:eg.isPending,children:[eg.isPending?(0,t.jsx)(j.A,{className:"animate-spin","data-icon":"inline-start"}):(0,t.jsx)(N.A,{"data-icon":"inline-start"}),e("Fetch from Upstream")]}),(0,t.jsxs)(F.$,{type:"button",variant:"outline",size:"sm",onClick:eR,disabled:!eN.length,children:[(0,t.jsx)(y.A,{"data-icon":"inline-start"}),e("Copy All")]}),(0,t.jsxs)(F.$,{type:"button",variant:"ghost",size:"sm",onClick:()=>ez([]),disabled:!eN.length,children:[(0,t.jsx)(k.A,{"data-icon":"inline-start"}),e("Clear All")]})]})]})]})}),(0,t.jsxs)("div",{className:"grid gap-2 sm:col-span-2",children:[(0,t.jsx)(L.J,{htmlFor:"cooperation-remark",children:e("Remark")}),(0,t.jsx)(I.T,{id:"cooperation-remark",value:o.remark,onChange:e=>R({...o,remark:e.target.value})})]})]})}),(0,t.jsxs)($.Es,{className:"shrink-0",children:[(0,t.jsx)(F.$,{variant:"outline",onClick:()=>c(!1),children:e("Cancel")}),(0,t.jsxs)(F.$,{disabled:!o.name||!o.base_url||!o.models.trim()||!T&&!o.api_key||ej.isPending,onClick:()=>ej.mutate(o),children:[ej.isPending&&(0,t.jsx)(h.A,{className:"animate-spin"}),e("Submit")]})]})]})}),V?.upstream.latest_benchmark?(0,t.jsx)(D.p,{run:V.upstream.latest_benchmark,upstreamName:V.upstream.name,onClose:()=>ei(null),summaryOnly:!0}):(0,t.jsx)($.lG,{open:null!==V,onOpenChange:e=>{e||ei(null)},children:(0,t.jsxs)($.Cf,{className:"max-h-[90vh] overflow-y-auto sm:max-w-2xl",children:[(0,t.jsxs)($.c7,{children:[(0,t.jsx)($.L3,{children:V?.upstream.name}),(0,t.jsx)($.rr,{children:e("Application details")})]}),V&&(0,t.jsxs)("div",{className:"grid gap-4 sm:grid-cols-2",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("p",{className:"text-muted-foreground text-xs",children:e("Type")}),(0,t.jsxs)("div",{className:"mt-1 flex items-center gap-2 text-sm",children:[(0,t.jsx)(en,{type:V.upstream.type,size:16}),e(q.Uz.find(e=>e.value===V.upstream.type)?.label??"Unknown")]})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("p",{className:"text-muted-foreground text-xs",children:e("Status")}),(0,t.jsx)(z.E,{className:`mt-1 ${er[V.status]}`,variant:"outline",children:e(et(V.status))})]}),(0,t.jsxs)("div",{className:"sm:col-span-2",children:[(0,t.jsx)("p",{className:"text-muted-foreground text-xs",children:e("API URL")}),(0,t.jsx)("p",{className:"mt-1 text-sm break-all",children:V.upstream.base_url})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("p",{className:"text-muted-foreground text-xs",children:e("Contact")}),(0,t.jsx)("p",{className:"mt-1 text-sm",children:V.upstream.contact||"-"})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("p",{className:"text-muted-foreground text-xs",children:e("Created At")}),(0,t.jsx)("p",{className:"mt-1 text-sm",children:new Date(1e3*V.created_time).toLocaleString()})]}),V.reject_reason&&(0,t.jsxs)("div",{className:"sm:col-span-2",children:[(0,t.jsx)("p",{className:"text-muted-foreground text-xs",children:e("Review result")}),(0,t.jsx)("p",{className:"mt-1 text-sm",children:V.reject_reason})]})]})]})})]})}}}]);

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.