1/*! LICENSE: 1424.0e2174402e.js.LICENSE.txt */ 2"use strict";(self.rspackChunknewapi_web=self.rspackChunknewapi_web||[]).push([[1424],{88371(e,s,t){t.r(s),t.d(s,{component:()=>ed});var a=t(72361),l=t(68413),n=t(6702),r=t(47745),o=t(39130),i=t(37116),d=t(23921),c=t(90879),m=t(72868),u=t(6242),x=t(95327),p=t(56275),h=t(10328),g=t(53422);function f(e,s){return e.reduce((e,t)=>e+ +!!s(t),0)}function j(e){return(0,a.jsxs)("button",{type:"button",onClick:e.onClick,className:(0,p.cn)("group inline-flex max-w-full items-center gap-1.5 rounded-md border px-2 py-1 text-xs font-medium transition-all",e.active?"border-foreground/30 bg-foreground/5 text-foreground shadow-sm":"border-border/70 bg-background text-muted-foreground hover:border-border hover:bg-muted/50 hover:text-foreground"),title:e.option.label,children:[e.option.icon&&(0,a.jsx)("span",{className:"shrink-0",children:e.option.icon}),(0,a.jsx)("span",{className:"truncate",children:e.option.label}),(e.option.suffix||null!=e.option.count)&&(0,a.jsx)("span",{className:(0,p.cn)("rounded-md px-1.5 py-0.5 text-[12px]",e.active?"bg-background text-foreground":"bg-muted text-muted-foreground"),children:e.option.suffix??e.option.count})]})}function v(e){return(0,a.jsxs)(u.Nt,{defaultOpen:!0,className:"border-border/70 border-b pb-3 last:border-b-0",children:[(0,a.jsxs)(u.R6,{className:"group flex w-full items-center justify-between py-2.5 text-left",children:[(0,a.jsx)("span",{className:"text-foreground text-sm font-semibold",children:e.title}),(0,a.jsx)(i.A,{className:"text-muted-foreground size-4 transition-transform group-data-[panel-open]:rotate-180"})]}),(0,a.jsx)(u.Ke,{children:(0,a.jsx)("div",{className:"flex flex-wrap gap-1.5",children:e.options.map(s=>(0,a.jsx)(j,{option:s,active:e.value===s.value,onClick:()=>e.onChange(s.value)},s.value))})})]})}function b(e){let{t:s}=(0,n.Bd)(),t=(0,h.SZ)(s),l=(0,h.fb)(s),r=[{value:"all",label:s("All Vendors"),count:e.models.length},...e.vendors.map(s=>({value:s.name,label:s.name,count:f(e.models,e=>
2e.vendor_name===s.name),icon:s.icon?(0,x.Y)(s.icon,14):void 0})).filter(e=>e.count>0)],o=[{value:"all",label:s("All Groups")},...e.groups.map(s=>({value:s,label:s,suffix:function(e){if(null==e)return;let s=Number.isInteger(e)?e.toString():e.toFixed(3).replace(/0+$/,"").replace(/\.$/,"");return`x${s}`}(e.groupRatios?.[s])}))],i=[{value:h.zH.ALL,label:t[h.zH.ALL],count:e.models.length},{value:h.zH.TOKEN,label:t[h.zH.TOKEN],count:f(e.models,e=>0===e.quota_type)},{value:h.zH.REQUEST,label:t[h.zH.REQUEST],count:f(e.models,e=>1===e.quota_type)}],u=[{value:"all",label:s("All Tags"),count:e.models.length},...e.tags.map(s=>({value:s,label:s,count:f(e.models,e=>(0,g.rL)(e.tags).map(e=>e.toLowerCase()).includes(s.toLowerCase()))}))],j=[{value:h.s4.ALL,label:l[h.s4.ALL],count:e.models.length},...Object.entries(l).filter(e=>{let[s]=e;return s!==h.s4.ALL}).map(s=>{let[t,a]=s;return{value:t,label:a,count:f(e.models,e=>e.supported_endpoint_types?.includes(t)??!1)}})];return(0,a.jsxs)("aside",{className:(0,p.cn)("rounded-xl border p-3",e.className),children:[(0,a.jsxs)("div",{className:"mb-2.5 flex items-center justify-between gap-2",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("h2",{className:"text-foreground text-sm font-bold",children:s("Filter")}),(0,a.jsx)("p",{className:"text-muted-foreground mt-1 text-xs",children:s("Refine models by provider, group, type, and tags.")})]}),(0,a.jsxs)(m.$,{type:"button",variant:"ghost",size:"sm",onClick:e.onClearFilters,disabled:!e.hasActiveFilters,className:"h-7 gap-1.5 px-2 text-xs",children:[(0,a.jsx)(d.A,{className:"size-3.5"}),s("Reset")]})]}),e.hasActiveFilters&&(0,a.jsx)(c.E,{variant:"secondary",className:"mb-3",children:s("Filters active")}),(0,a.jsxs)("div",{className:"space-y-1",children:[(0,a.jsx)(v,{title:s("Groups"),value:e.groupFilter,options:o,onChange:e.onGroupChange}),(0,a.jsx)(v,{title:s("All Vendors"),value:e.vendorFilter,options:r,onChange:e.onVendorChange}),(0,a.jsx)(v,{title:s("Model Tags"),value:e.tagFilter,options:u,onChange:e.onTagChange}),(0,a.jsx)(v,{title:s("Pricing Type"),value:e.quotaTypeFilter,options:i,onChange:e.onQuotaTypeChange}),(0,a.jsx)(v,{title:s("Endpoint Type"),value:e.endpointTypeFilter,options:j,onChange:e.onEndpointTypeChange})]})]})}var N=t(43014);let y=(0,t(9781).A)("arrow-up-down",[["path",{d:"m21 16-4 4-4-4",key:"f6ql7i"}],["path",{d:"M17 20V4",key:"1ejh1v"}],["path",{d:"m3 8 4-4 4 4",key:"11wl7u"}],["path",{d:"M7 4v16",key:"1glfcx"}]]);var w=t(67834),C=t(16333),k=t(50475),A=t(47029),E=t(84368),F=t(74559),T=t(47303);function M(e){return(0,a.jsx)("div",{role:"group","aria-label":e.ariaLabel,className:"bg-muted/60 inline-flex h-8 items-center rounded-lg border p-0.5",children:e.options.map(s=>{let t=s.icon,l=s.value===e.value,n=(0,a.jsxs)("button",{type:"button",onClick:()=>e.onChange(s.value),"aria-pressed":l,className:(0,p.cn)("inline-flex h-full items-center justify-center rounded-md text-xs font-medium transition-all",t&&!s.label?"w-7":"gap-1.5 px-3",l?"bg-primary text-primary-foreground shadow-sm":"text-muted-foreground hover:text-foreground"),children:[t&&(0,a.jsx)(t,{className:"size-3.5"}),s.label]},s.value);return s.tooltip?(0,a.jsxs)(T.m_,{children:[(0,a.jsx)(T.k$,{render:n}),(0,a.jsx)(T.ZI,{side:"bottom",className:"text-xs",children:s.tooltip})]},s.value):n})})}function z(e){let{t:s}=(0,n.Bd)(),[t,r]=(0,l.useState)(!1),o=(0,h.WU)(s),i=(0,l.useCallback)(s=>e.onTokenUnitChange(s),[e]),d=(0,l.useCallback)(s=>e.onViewModeChange(s),[e]),u=(0,l.useCallback)(s=>e.onRechargePriceChange("recharge"===s),[e]);return(0,a.jsxs)("div",{className:"rounded-xl border p-3",children:[(0,a.jsxs)("div",{className:"flex flex-col gap-3 lg:flex-row lg:items-center lg:justify-between",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsxs)(m.$,{type:"button",variant:"outline",size:"sm",onClick:()=>r(!0),className:"gap-1.5 xl:hidden",children:[(0,a.jsx)(N.A,{className:"size-4"}),s("Filter"),e.activeFilterCount>0&&(0,a.jsx)(c.E,{className:"ml-0.5 size-5 justify-center p-0 text-[10px]",children:e.activeFilterCount})]}),(0,a.jsxs)("div",{className:"text-muted-foreground flex items-baseline gap-1 text-sm",children:[(0,a.jsx)("span",{className:"text-foreground font-semibold tabular-nums",children:e.filteredCount.toLocaleStr
2ing()}),(0,a.jsx)("span",{children:s(1===e.filteredCount?"model":"models")}),e.hasActiveFilters&&e.totalCount&&(0,a.jsxs)("span",{className:"text-muted-foreground/60 text-xs",children:["/ ",e.totalCount.toLocaleString()]})]})]}),(0,a.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,a.jsxs)("div",{className:"hidden items-center gap-2 sm:flex",children:[(0,a.jsx)(M,{options:[{value:"standard",label:s("Standard")},{value:"recharge",label:s("Recharge")}],value:e.showRechargePrice?"recharge":"standard",onChange:u,ariaLabel:s("Price display mode")}),(0,a.jsx)(M,{options:[{value:"M",label:"/1M"},{value:"K",label:"/1K"}],value:e.tokenUnit,onChange:i,ariaLabel:s("Token unit")})]}),(0,a.jsxs)(E.rI,{children:[(0,a.jsxs)(E.ty,{render:(0,a.jsx)(m.$,{type:"button",variant:"outline",size:"sm",className:"h-8 gap-1.5 px-3 text-xs"}),children:[(0,a.jsx)(y,{className:"size-3.5"}),(0,a.jsx)("span",{children:o[e.sortBy]||s("Sort")})]}),(0,a.jsx)(E.SQ,{align:"end",className:"w-44",children:Object.entries(o).map(s=>{let[t,l]=s;return(0,a.jsxs)(E._2,{onClick:()=>e.onSortChange(t),className:"gap-2",children:[(0,a.jsx)(w.A,{className:(0,p.cn)("size-4 shrink-0",e.sortBy===t?"opacity-100":"opacity-0")}),l]},t)})})]}),(0,a.jsx)(M,{options:[{value:h.pV.CARD,icon:C.A,tooltip:s("Card view")},{value:h.pV.TABLE,icon:k.A,tooltip:s("Table view")}],value:e.viewMode,onChange:d,ariaLabel:s("View mode")})]})]}),(0,a.jsx)(F.cj,{open:t,onOpenChange:r,children:(0,a.jsxs)(F.h,{side:"right",className:(0,A.jW)("sm:max-w-md"),children:[(0,a.jsxs)(F.Fm,{className:(0,A.Dt)(),children:[(0,a.jsx)(F.qp,{children:s("Filter")}),(0,a.jsx)(F.Qs,{children:s("Filter models by provider, group, type, endpoint, and tags.")})]}),(0,a.jsx)("div",{className:(0,A.e)("gap-0"),children:(0,a.jsx)(b,{quotaTypeFilter:e.quotaTypeFilter,endpointTypeFilter:e.endpointTypeFilter,vendorFilter:e.vendorFilter,groupFilter:e.groupFilter,tagFilter:e.tagFilter,onQuotaTypeChange:e.onQuotaTypeChange,onEndpointTypeChange:e.onEndpointTypeChange,onVendorChange:e.onVendorChange,onGroupChange:e.onGroupChange,onTagChange:e.onTagChange,vendors:e.vendors,groups:e.groups,groupRatios:e.groupRatios,tags:e.tags,models:e.models,hasActiveFilters:e.hasActiveFilters,onClearFilters:e.onClearFilters,className:"border-0 bg-transparent p-0 shadow-none"})})]})})]})}var _=t(63162),R=t(99893),L=t(29625),S=t(79220),$=t(50956),K=t(36832),P=t(85785),G=t(43754);function q(e){return!Number.isFinite(e)||e<=0?"â":e>1?String(Math.round(e)):e.toFixed(1)}let V=(0,l.memo)(function(e){let{t:s}=(0,n.Bd)();if(!e.perf)return null;let{avg_latency_ms:t,avg_tps:l,success_rate:r}=e.perf,o=e.perf.recent_success_rates?.filter(e=>Number.isFinite(e))??[],i=o.length>0?o.slice(-3):[r],d=[...Array(Math.max(0,3-i.length)).fill(null),...i].slice(-3);return(0,a.jsxs)("div",{className:(0,p.cn)("hidden w-[132px] grid-cols-[38px_48px_30px] gap-x-2 text-right tabular-nums min-[460px]:grid",e.className),children:[(0,a.jsxs)("div",{title:s("Average latency"),className:"min-w-0",children:[(0,a.jsx)("div",{className:"text-muted-foreground/55 text-[10px] leading-4",children:s("Latency short")}),(0,a.jsx)("div",{className:"text-muted-foreground/80 font-mono text-xs leading-4 whitespace-nowrap",children:!Number.isFinite(t)||t<=0?"â":t>=1e3?`${q(t/1e3)}s`:`${q(t)}ms`})]}),(0,a.jsxs)("div",{title:s("Throughput"),className:"min-w-0",children:[(0,a.jsx)("div",{className:"text-muted-foreground/55 truncate text-[10px] leading-4",children:s("Throughput short")}),(0,a.jsx)("div",{className:"text-muted-foreground/80 font-mono text-xs leading-4 whitespace-nowrap",children:!Number.isFinite(l)||l<=0?"â":l>=1e3?`${q(l/1e3)}Kt`:`${q(l)}t`})]}),(0,a.jsxs)("div",{title:`${s("Success rate")}: ${r.toFixed(1)}%`,className:"min-w-0",children:[(0,a.jsx)("div",{className:"text-muted-foreground/55 truncate text-[10px] leading-4",children:s("Status short")}),(0,a.jsx)("div",{className:"flex h-4 items-center justify-end gap-0.5",children:d.map((e,s)=>(0,a.jsx)("span",{className:(0,p.cn)("w-1 rounded-full",0===s&&"h-2",1===s&&"h-2.5",2===s&&"h-3",null==e?0===s?"bg-muted-foreground
2/10":"bg-muted-foreground/15":(0,G.NY)(e))},`${s}-${e??"empty"}`))})]})]})}),B=(0,l.memo)(function(e){let s,{t}=(0,n.Bd)(),{copyToClipboard:l}=(0,L.C)(),r=e.tokenUnit??"M",o=e.priceRate??1,i=e.usdExchangeRate??1,d=e.showRechargePrice??!1,c=(0,$.ow)(e.model),m="K"===r?"1K":"1M",u=(0,g.rL)(e.model.tags),h=e.model.enable_groups||[],f=e.model.supported_endpoint_types||[],j=e.model.icon||e.model.vendor_icon,v=j?(0,x.Y)(j,28):null,b=e.model.model_name?.charAt(0).toUpperCase()||"?",N="tiered_expr"===e.model.billing_mode&&!!e.model.billing_expr,y=c&&null!=e.model.cache_ratio,w=N?(0,S.kK)(e.model,{tokenUnit:r,showRechargePrice:d,priceRate:o,usdExchangeRate:i,groupRatioMultiplier:(0,S.kt)(e.model,e.selectedGroup)}):null,C=h[0],k=[...f.slice(0,2),...u.slice(0,2)],A=Math.max(h.length-1,0)+Math.max(f.length-2,0)+Math.max(u.length-2,0);return s=w?w.isSpecialExpression?(0,a.jsxs)("span",{className:"min-w-0",children:[(0,a.jsx)("span",{className:"text-amber-700 dark:text-amber-300",children:t("Special billing expression")}),(0,a.jsx)("code",{className:"text-muted-foreground/70 mt-0.5 line-clamp-1 block font-mono text-[11px] break-all",children:w.rawExpression})]}):w.primaryEntries.length>0?(0,a.jsx)(a.Fragment,{children:w.primaryEntries.map(e=>(0,a.jsxs)("span",{className:"text-muted-foreground whitespace-nowrap",children:[t(e.shortLabel)," ",(0,a.jsx)("span",{className:"text-foreground font-mono font-semibold",children:e.formatted})]},e.key))}):(0,a.jsx)("span",{className:"text-muted-foreground text-sm",children:t("Dynamic Pricing")}):c?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("span",{className:"text-muted-foreground whitespace-nowrap",children:[t("Input")," ",(0,a.jsx)("span",{className:"text-foreground font-mono font-semibold",children:(0,K.$g)(e.model,"input",r,d,o,i,e.selectedGroup)})]}),(0,a.jsxs)("span",{className:"text-muted-foreground whitespace-nowrap",children:[t("Output")," ",(0,a.jsx)("span",{className:"text-foreground font-mono font-semibold",children:(0,K.$g)(e.model,"output",r,d,o,i,e.selectedGroup)})]}),y&&(0,a.jsxs)("span",{className:"text-muted-foreground whitespace-nowrap",children:[t("Cached")," ",(0,a.jsx)("span",{className:"text-foreground font-mono font-semibold",children:(0,K.$g)(e.model,"cache",r,d,o,i,e.selectedGroup)})]})]}):(0,a.jsxs)("span",{className:"text-muted-foreground whitespace-nowrap",children:[(0,a.jsx)("span",{className:"text-foreground font-mono font-semibold",children:(0,K.Yj)(e.model,d,o,i,e.selectedGroup)})," ","/ ",t("request")]}),(0,a.jsxs)("div",{className:(0,p.cn)("group relative flex flex-col rounded-xl border p-3 transition-colors sm:p-5","hover:bg-muted/20"),children:[(0,a.jsxs)("div",{className:"flex items-start justify-between gap-2.5 sm:gap-3",children:[(0,a.jsxs)("div",{className:"flex min-w-0 items-start gap-2.5 sm:gap-3",children:[(0,a.jsx)("div",{className:"bg-muted/40 flex size-9 shrink-0 items-center justify-center rounded-lg sm:size-10 sm:rounded-xl",children:v||(0,a.jsx)("span",{className:"text-muted-foreground text-sm font-bold",children:b})}),(0,a.jsxs)("div",{className:"min-w-0",children:[(0,a.jsx)("h3",{className:"text-foreground truncate font-mono text-[15px] leading-tight font-bold",children:e.model.model_name}),(0,a.jsx)("div",{className:"mt-0.5 flex flex-wrap items-baseline gap-x-2 gap-y-0.5 text-sm sm:mt-1 sm:gap-x-3",children:s})]})]}),(0,a.jsxs)("div",{className:"flex shrink-0 items-center gap-1.5",children:[(0,a.jsxs)("button",{type:"button",onClick:e.onClick,className:"text-muted-foreground hover:text-foreground hover:bg-muted inline-flex items-center gap-1 rounded-md border px-2 py-1 text-xs transition-colors sm:px-2.5 sm:py-1.5",children:[t("Details"),(0,a.jsx)(_.A,{className:"size-3.5"})]}),(0,a.jsx)("button",{type:"button",onClick:s=>{s.stopPropagation(),l(e.model.model_name||"")},className:"text-muted-foreground hover:text-foreground hover:bg-muted rounded-md border p-1.5 transition-colors",title:t("Copy"),children:(0,a.jsx)(R.A,{className:"size-3.5"})})]})]}),(0,a.jsx)("p",{className:"text-muted-foreground mt-2 line-clamp-1 flex-1 text-[13px] leading-relaxed sm:mt-4 sm:line-clamp-2 sm:min-h-[2.5rem]",children:e.model.description||t("No description available.")}),(0,a.jsxs)("div",{className:"mt-2 grid grid-cols-[minmax(0,1fr)_auto] items-start gap-x-2 gap-y-1 sm:mt-4",children:[(0,a.jsxs)("div",{className:"flex min-w-0 flex-wrap items-center gap-x-2 gap-y-1",children:[C&&
2(0,a.jsx)("span",{className:"text-muted-foreground text-sm font-medium",children:C}),(0,a.jsx)(P.v,{model:e.model})]}),(0,a.jsx)(V,{perf:e.perf,className:"row-span-2 self-start"}),(0,a.jsxs)("div",{className:"flex min-w-0 flex-wrap items-center gap-x-2.5 gap-y-0.5 sm:gap-x-3 sm:gap-y-1",children:[k.map(e=>(0,a.jsx)("span",{className:"text-muted-foreground/70 text-xs",children:e},e)),(0,a.jsx)("span",{className:"text-muted-foreground/50 text-xs",children:m}),A>0&&(0,a.jsxs)("span",{className:"text-muted-foreground/40 text-xs",children:["+",A]})]})]})]})});var U=t(53540),Q=t(24623),D=t(48145);function H(e){let{t:s}=(0,n.Bd)(),[t,r]=(0,l.useState)(1),o=e.tokenUnit??"M",i=Math.max(1,Math.ceil(e.models.length/20)),d=Math.min(t,i),c=(0,U.I)({queryKey:["perf-metrics-summary",24],queryFn:()=>(0,D.R)(24),staleTime:6e4,retry:!1}),u=(0,l.useMemo)(()=>{let s=(d-1)*20;return e.models.slice(s,s+20)},[d,20,e.models]),x=(0,l.useMemo)(()=>{let e=new Map;for(let s of c.data?.data?.models??[])e.set(s.model_name,s);return e},[c.data]);return 0===e.models.length?null:(0,a.jsxs)("div",{className:"space-y-4 sm:space-y-5",children:[(0,a.jsx)("div",{className:"grid grid-cols-1 gap-3 sm:gap-4 md:grid-cols-2 lg:grid-cols-3",children:u.map(s=>(0,a.jsx)(B,{model:s,tokenUnit:o,priceRate:e.priceRate,usdExchangeRate:e.usdExchangeRate,showRechargePrice:e.showRechargePrice,selectedGroup:e.selectedGroup,perf:x.get(s.model_name||""),onClick:()=>e.onModelClick(s.model_name||"")},s.id??s.model_name))}),i>1&&(0,a.jsxs)("div",{className:"text-muted-foreground flex flex-col items-center justify-between gap-3 border-t px-4 py-3 text-sm sm:flex-row",children:[(0,a.jsx)("p",{className:"text-muted-foreground",children:s("Page {{current}} of {{total}}",{current:d,total:i})}),(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsxs)(m.$,{type:"button",variant:"outline",size:"sm",onClick:()=>r(e=>Math.max(1,e-1)),disabled:d<=1,className:"gap-1.5",children:[(0,a.jsx)(Q.A,{className:"size-4"}),s("Previous page")]}),(0,a.jsxs)(m.$,{type:"button",variant:"outline",size:"sm",onClick:()=>r(e=>Math.min(i,e+1)),disabled:d>=i,className:"gap-1.5",children:[s("Next page"),(0,a.jsx)(_.A,{className:"size-4"})]})]})]})]})}var O=t(97785);function I(e){let s=e.viewMode??h.pV.CARD;return(0,a.jsxs)("div",{className:"space-y-5",children:[(0,a.jsxs)("div",{className:"space-y-1.5",children:[(0,a.jsx)(O.E,{className:"h-8 w-40"}),(0,a.jsx)(O.E,{className:"h-4 w-52"})]}),(0,a.jsx)(O.E,{className:"h-10 w-full rounded-lg"}),(0,a.jsx)(W,{}),s===h.pV.TABLE?(0,a.jsx)(Z,{}):(0,a.jsx)(Y,{})]})}function Y(){return(0,a.jsx)("div",{className:"grid grid-cols-1 gap-4 md:grid-cols-2 lg:grid-cols-3",children:Array.from({length:9}).map((e,s)=>(0,a.jsxs)("div",{className:"rounded-xl border p-5",children:[(0,a.jsxs)("div",{className:"flex items-start justify-between gap-3",children:[(0,a.jsxs)("div",{className:"flex min-w-0 items-start gap-3",children:[(0,a.jsx)(O.E,{className:"size-10 shrink-0 rounded-xl"}),(0,a.jsxs)("div",{className:"min-w-0 flex-1 space-y-2",children:[(0,a.jsx)(O.E,{className:"h-5 w-36"}),(0,a.jsx)(O.E,{className:"h-3.5 w-48"})]})]}),(0,a.jsx)(O.E,{className:"h-8 w-16 rounded-md"})]}),(0,a.jsxs)("div",{className:"mt-4 space-y-2",children:[(0,a.jsx)(O.E,{className:"h-3.5 w-full"}),(0,a.jsx)(O.E,{className:"h-3.5 w-4/5"})]}),(0,a.jsxs)("div",{className:"mt-4 flex items-center gap-2",children:[(0,a.jsx)(O.E,{className:"h-4 w-24"}),(0,a.jsx)(O.E,{className:"h-4 w-16"})]}),(0,a.jsxs)("div",{className:"mt-2 flex items-center gap-3",children:[(0,a.jsx)(O.E,{className:"h-3.5 w-14"}),(0,a.jsx)(O.E,{className:"h-3.5 w-14"}),(0,a.jsx)(O.E,{className:"h-3.5 w-8"})]})]},s))})}function W(){return(0,a.jsxs)("div",{className:"space-y-3",children:[(0,a.jsxs)("div",{className:"flex items-center gap-3",children:[(0,a.jsx)("div",{className:"flex flex-1 flex-wrap items-center gap-2",children:[80,90,75,85,70].map((e,s)=>(0,a.jsx)(O.E,{className:"h-8 rounded-lg",style:{width:`${e}px`}},s))}),(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)(O.E,{className:"h-8 w-24 rounded-lg"}),(0,a.jsx)(O.E,{className:"h-8 w-20 rounded-lg"}),(0,a.jsx)(O.E,{className:"h-8 w-24"}),(0,a.jsx)(O.E,{className:"h-8 w-20 rounded-lg"})]})]}),(0,a.jsx)(O.E,{className:"h-5 w-24"})]})}function Z(){let e=[{width:200},{width:100},{width:100},{width:100},{width:80},{width:100}];return(0,a.jsxs)("div",{className:"space-y-4",children:[(0,a.jsxs)("div",{className:"overflow-hidden rounded-lg border",children:[(0,a.jsx)("div",{className:"bg-muted/30 border-b px-4 py-3",children:(0,a.jsx)("div",{className:"flex items-center gap-4",children:e.map((e,s)=>(0,a.jsx)(O.E,{className:"h-4",style:{width:`${e.width}px`}},s))})}),Array.from({length:10}).map((s,t)=>(0,a.jsx)("div",{className:"flex items-center gap-4 border-b px-4 py-3 last:border-b-0",children:e.map((e,s)=>(0,a.jsx)(O.E,{className:"h-5",style:{width:`${e.width}px`}},s))},t))]}),(0,a.jsxs)("div",{className:"flex items-center justify-between",children:[(0,a.jsx)(O.E,{className:"h-5 w-32"}),(0,a.jsx)("div",{className:"flex items-center gap-2",children:Array.from({length:4}).map((e,s)=>(0,a.jsx)(O.E,{className:"size-8"},s))})]})]})}var J=t(38766);function X(e){let{t:s}=(0,n.Bd)(),t=!!e.searchQuery?.trim();return(0,a.jsxs)("div",{className:"flex min-h-[320px] flex-col items-center justify-center rounded-lg border border-dashed px-6 py-12 text-center",children:[(0,a.jsx)(J.A,{className:"text-muted-foreground
2/40 mb-3 size-10"}),(0,a.jsx)("h3",{className:"text-foreground mb-1 text-base font-semibold",children:s("No models found")}),(0,a.jsx)("p",{className:"text-muted-foreground mb-5 max-w-xs text-sm",children:t?s('No results for "{{query}}". Try adjusting your search or filters.',{query:e.searchQuery}):s("No models match your current filters.")}),(e.hasActiveFilters||t)&&(0,a.jsx)(m.$,{variant:"outline",size:"sm",onClick:e.onClearFilters,children:s("Clear all filters")})]})}var ee=t(15762);function es(e){let{t:s}=(0,n.Bd)(),t=(0,l.useRef)(null);return(0,l.useEffect)(()=>{function e(e){(e.metaKey||e.ctrlKey)&&"k"===e.key&&(e.preventDefault(),t.current?.focus()),"Escape"===e.key&&document.activeElement===t.current&&t.current?.blur()}return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)},[]),(0,a.jsxs)("div",{className:(0,p.cn)("relative",e.className),children:[(0,a.jsx)(J.A,{className:"text-muted-foreground/60 pointer-events-none absolute top-1/2 left-3.5 size-4 -translate-y-1/2"}),(0,a.jsx)("input",{ref:t,type:"text",placeholder:e.placeholder||s("Search models..."),value:e.value,onChange:s=>e.onChange(s.target.value),className:(0,p.cn)("border-border/60 bg-background placeholder:text-muted-foreground/50","hover:border-border","focus:border-primary/50 focus:ring-primary/20 focus:ring-2","h-10 w-full rounded-lg border pr-16 pl-10 text-sm transition-all outline-none"),"aria-label":s("Search models")}),(0,a.jsx)("div",{className:"absolute top-1/2 right-2.5 flex -translate-y-1/2 items-center gap-1",children:e.value?(0,a.jsx)(m.$,{variant:"ghost",size:"icon",onClick:e.onClear,className:"text-muted-foreground/60 hover:text-foreground size-7","aria-label":s("Clear search"),children:(0,a.jsx)(ee.A,{className:"size-4"})}):(0,a.jsx)("kbd",{className:"bg-muted text-muted-foreground pointer-events-none hidden rounded border px-1.5 py-0.5 font-mono text-[10px] sm:inline-block",children:"âK"})})]})}var et=t(12424),ea=t(55045),el=t(98622),en=t(42817);function er(e){let{t:s}=(0,n.Bd)(),{models:t,isLoading:r=!1,priceRate:o=1,usdExchangeRate:i=1,tokenUnit:d="M",showRechargePrice:c=!1,selectedGroup:m,onModelClick:u}=e,[p,h]=(0,l.useState)({pageIndex:0,pageSize:20}),f=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{t:s}=(0,n.Bd)(),{tokenUnit:t="M",priceRate:l=1,usdExchangeRate:r=1,showRechargePrice:o=!1,selectedGroup:i}=e,d="K"===t?"1K":"1M";return[{accessorKey:"model_name",meta:{label:s("Model")},header:e=>{let{column:t}=e;return(0,a.jsx)(ea.wZ,{column:t,title:s("Model")})},cell:e=>{let{row:s}=e,t=s.original,l=t.icon||t.vendor_icon,n=l?(0,x.Y)(l,14):null;return(0,a.jsxs)("div",{className:"flex max-w-full min-w-0 items-center gap-2",children:[n,(0,a.jsx)("span",{className:"truncate font-mono text-sm font-medium",children:t.model_name})]})},minSize:200},{accessorKey:"quota_type",header:s("Type"),cell:e=>{let{row:s}=e;return(0,a.jsx)(P.v,{model:s.original,className:"-ml-1.5"})},size:110,enableSorting:!1},{accessorKey:"price",meta:{label:s("Price")},header:e=>{let{column:t}=e;return(0,a.jsx)(ea.wZ,{column:t,title:s("Price")})},cell:e=>{let{row:n}=e,c=n.original,m=(0,S.kK)(c,{tokenUnit:t,showRechargePrice:o,priceRate:l,usdExchangeRate:r,groupRatioMultiplier:(0,S.kt)(c,i)});if(m){if(m.isSpecialExpression)return(0,a.jsxs)("div",{className:"max-w-full min-w-0",children:[(0,a.jsx)("div",{className:"text-xs font-medium text-amber-700 dark:text-amber-300",children:s("Special billing expression")}),(0,a.jsx)("div",{className:"text-muted-foreground text-[11px]",children:s("Unable to parse structured pricing")}),(0,a.jsx)("code",{className:"text-muted-foreground/70 mt-1 line-clamp-2 block font-mono text-[10px] leading-relaxed break-all",children:m.rawExpression})]});let e=m.primaryEntries.slice(0,2);return 0===e.length?(0,a.jsx)("span",{className:"text-muted-foreground text-xs",children:s("Dynamic Pricing")}):(0,a.jsxs)("div",{className:"max-w-full min-w-0",children:[(0,a.jsx)("span",{className:"font-mono text-sm tabular-nums",children:e.map((e,s)=>(0,a.jsxs)("span",{children:[s>
20&&(0,a.jsx)("span",{className:"text-muted-foreground/40 mx-1",children:"/"}),(0,K.CG)(e.formatted)]},e.key))}),(0,a.jsxs)("div",{className:"text-muted-foreground/50 text-[10px]",children:["/ ",d," tokens",m.tierCount>1&&` \xb7 ${s("{{count}} tiers",{count:m.tierCount})}`]})]})}if((0,$.ow)(c)){let e=(0,K.CG)((0,K.$g)(c,"input",t,o,l,r,i)),s=(0,K.CG)((0,K.$g)(c,"output",t,o,l,r,i));return(0,a.jsxs)("div",{className:"max-w-full min-w-0",children:[(0,a.jsxs)("span",{className:"font-mono text-sm tabular-nums",children:[e,(0,a.jsx)("span",{className:"text-muted-foreground/40 mx-1",children:"/"}),s]}),(0,a.jsxs)("div",{className:"text-muted-foreground/50 text-[10px]",children:["/ ",d," tokens"]})]})}let u=(0,K.CG)((0,K.Yj)(c,o,l,r,i));return(0,a.jsxs)("div",{className:"max-w-full min-w-0",children:[(0,a.jsx)("span",{className:"font-mono text-sm tabular-nums",children:u}),(0,a.jsxs)("div",{className:"text-muted-foreground/50 text-[10px]",children:["/ ",s("request")]})]})},size:180,enableSorting:!1},{id:"cached_price",header:s("Cached"),cell:e=>{let{row:n}=e,c=n.original,m=(0,S.kK)(c,{tokenUnit:t,showRechargePrice:o,priceRate:l,usdExchangeRate:r,groupRatioMultiplier:(0,S.kt)(c,i)});if(m){if(m.isSpecialExpression)return(0,a.jsx)("span",{className:"text-muted-foreground/50 text-xs",children:s("Special billing expression")});let e=m.entries.find(e=>"cacheReadPrice"===e.field);return e?(0,a.jsxs)("div",{className:"max-w-full min-w-0",children:[(0,a.jsx)("span",{className:"font-mono text-sm tabular-nums",children:(0,K.CG)(e.formatted)}),(0,a.jsxs)("div",{className:"text-muted-foreground/50 text-[10px]",children:["/ ",d]})]}):(0,a.jsx)("span",{className:"text-muted-foreground/30 text-xs",children:"â"})}if(!(0,$.ow)(c)||null==c.cache_ratio)return(0,a.jsx)("span",{className:"text-muted-foreground/30 text-xs",children:"â"});let u=(0,K.CG)((0,K.$g)(c,"cache",t,o,l,r,i));return(0,a.jsxs)("div",{className:"max-w-full min-w-0",children:[(0,a.jsx)("span",{className:"font-mono text-sm tabular-nums",children:u}),(0,a.jsxs)("div",{className:"text-muted-foreground/50 text-[10px]",children:["/ ",d]})]})},size:110,enableSorting:!1},{accessorKey:"vendor_name",header:s("Vendor"),cell:e=>{let{row:s}=e,t=s.original;if(!t.vendor_name)return(0,a.jsx)("span",{className:"text-muted-foreground/50 text-xs",children:"â"});let l=t.vendor_icon?(0,x.Y)(t.vendor_icon,12):null;return(0,a.jsxs)(ea.ak,{className:"gap-1.5",children:[l,(0,a.jsx)(en.Wh,{label:t.vendor_name,autoColor:t.vendor_name,size:"sm",copyable:!1})]})},size:130,enableSorting:!1},{accessorKey:"tags",header:s("Tags"),cell:e=>{let{row:s}=e,t=(0,g.rL)(s.original.tags);return(0,a.jsx)(ea.Yt,{items:t.map(e=>(0,a.jsx)(en.Wh,{label:e,autoColor:e,size:"sm",copyable:!1},e))})},size:140,enableSorting:!1},{accessorKey:"supported_endpoint_types",header:s("Endpoints"),cell:e=>{let{row:s}=e,t=s.original.supported_endpoint_types||[];return(0,a.jsx)(ea.Yt,{items:t.map(e=>(0,a.jsx)(en.Wh,{label:e,autoColor:e,size:"sm",copyable:!1},e))})},size:130,enableSorting:!1},{accessorKey:"enable_groups",header:s("Groups"),cell:e=>{let{row:s}=e,t=s.original.enable_groups||[];return(0,a.jsx)(ea.Yt,{items:t.map(e=>(0,a.jsx)(el.d,{group:e,size:"sm"},e)),tooltipClassName:"max-w-[280px] p-2"})},size:130,enableSorting:!1}]}({tokenUnit:d,priceRate:o,usdExchangeRate:i,showRechargePrice:c,selectedGroup:m}),{table:j}=(0,ea.uI)({data:t,columns:f,pageCount:Math.ceil(t.length/p.pageSize),pagination:p,onPaginationChange:h,manualPagination:!1,withFilteredRowModel:!1,withSortedRowModel:!1,withFacetedRowModel:!1}),v=(0,l.useCallback)(e=>{u?.(e.model_name)},[u]);return(0,a.jsxs)("div",{className:"space-y-4",children:[(0,a.jsx)(ea.Oz,{table:j,isLoading:r,emptyTitle:s("No Models Found"),emptyDescription:s("No models match your current filters."),skeletonKeyPrefix:"pricing-skeleton",applyHeaderSize:!0,getColumnClassName:(e,s)=>"header"===s?"text-muted-foreground font-medium":void 0,renderRow:e=>(0,a.jsx)(ea.J2,{row:e,className:"hover:bg-muted/30 cursor-pointer transition-colors",onClick:()=>v(e.original)},e.id)}),!r&&t.length>0&&(0,a.jsx)(ea.Tw,{table:j})]})}var eo=t(45064),ei=t(89347);let ed=function(){let{t:e}=(0,n.Bd)(),[s,t]=(0,l.useState)(null),{models:i,vendors:d,groupRatio:c,usableGroup:m,endpointMap:u,autoGroups:x,isLoading:p,priceRate:f,usdExchangeRate:j}=(0,ei.y)(),{searchInput:v,sortBy:N,vendorFilter:y,groupFilter:w,quotaTypeFilter:C,endpointTypeFilter:k,tagFilter:A,tokenUnit:E,viewMode:F,showRechargePrice:T,setSearchInput:M,setSortBy:_,setVendorFilter:R,setGroupFilter:L,setQuotaTypeFilter:S,setEndpointTypeFilter:$,setTagFilter:K,setTokenUnit:P,setViewMode:G,setShowRechargePrice:q,filteredModels:V,hasActiveFilters:B,activeFilterCount:U,availableTags:Q,clearFilters:D,clearSearch:O}=function(e){let s=(0,eo.S)({from:"/pricing/"}),[t,a]=(0,l.useState)(()=>({search:s.search,sort:s.sort,vendor:s.vendor,group:s.group,quotaType:s.quotaType,endpointType:s.endpointType,tag:s.tag,tokenUnit:s.tokenUnit,view:s.view,rechargePrice:s.rechargePrice})),n=t.search||"",r=t.sort||h.QB.NAME,o=t.vendor||"all",i=t.group||"all",d=t.quotaType||h.zH.ALL,c=t.endpointType||h.s4.ALL,m=t.tag||"all",u="K"===t.tokenUnit?"K":"M",x=t.view===h.pV.TABLE?h.pV.TABLE:h.pV.CARD,p=!0===t.rechargePrice,f=(0,l.useCallback)(e=>{a(s=>{let t={...s,...e};for(let e of Object.keys(t))(void 0===t[e]||null===t[e])&&delete t[e];return t})},[]),j=(0,l.useCallback)(e=>
2f({search:e||void 0}),[f]),v=(0,l.useCallback)(e=>f({sort:e===h.QB.NAME?void 0:e}),[f]),b=(0,l.useCallback)(e=>f({vendor:"all"===e?void 0:e}),[f]),N=(0,l.useCallback)(e=>f({group:"all"===e?void 0:e}),[f]),y=(0,l.useCallback)(e=>f({quotaType:e===h.zH.ALL?void 0:e}),[f]),w=(0,l.useCallback)(e=>f({endpointType:e===h.s4.ALL?void 0:e}),[f]),C=(0,l.useCallback)(e=>f({tag:"all"===e?void 0:e}),[f]),k=(0,l.useCallback)(e=>f({tokenUnit:"M"===e?void 0:e}),[f]),A=(0,l.useCallback)(e=>f({view:e===h.pV.CARD?void 0:e}),[f]),E=(0,l.useCallback)(e=>f({rechargePrice:e||void 0}),[f]),F=(0,l.useMemo)(()=>e&&0!==e.length?(0,g.Mt)(e):[],[e]),T=(0,l.useMemo)(()=>e&&0!==e.length?(0,g.mv)(e,{search:n,vendor:o,group:i,quotaType:d,endpointType:c,tag:m,sortBy:r}):[],[e,n,o,i,d,c,m,r]),M=(0,l.useMemo)(()=>"all"!==o||"all"!==i||d!==h.zH.ALL||c!==h.s4.ALL||"all"!==m,[o,i,d,c,m]),z=(0,l.useMemo)(()=>+("all"!==o)+ +("all"!==i)+ +(d!==h.zH.ALL)+ +(c!==h.s4.ALL)+ +("all"!==m),[o,i,d,c,m]);return{searchInput:n,sortBy:r,vendorFilter:o,groupFilter:i,quotaTypeFilter:d,endpointTypeFilter:c,tagFilter:m,tokenUnit:u,viewMode:x,showRechargePrice:p,setSearchInput:j,setSortBy:v,setVendorFilter:b,setGroupFilter:N,setQuotaTypeFilter:y,setEndpointTypeFilter:w,setTagFilter:C,setTokenUnit:k,setViewMode:A,setShowRechargePrice:E,filteredModels:T,hasActiveFilters:M,activeFilterCount:z,availableTags:F,clearFilters:(0,l.useCallback)(()=>{f({vendor:void 0,group:void 0,quotaType:void 0,endpointType:void 0,tag:void 0})},[f]),clearSearch:(0,l.useCallback)(()=>{f({search:void 0})},[f])}}(i||[]),Y=(0,l.useCallback)(e=>{t(e)},[]),W=(0,l.useMemo)(()=>s&&(i||[]).find(e=>e.model_name===s)||null,[i,s]),Z=(0,l.useMemo)(()=>Object.keys(m||{}).filter(e=>!h.An.includes(e)),[m]),J=(0,l.useCallback)(()=>{D(),O()},[D,O]);return p?(0,a.jsx)(r.si,{showMainContainer:!1,children:(0,a.jsx)("div",{className:"mx-auto w-full max-w-[1800px] px-3 pt-16 pb-8 sm:px-6 sm:pt-20 sm:pb-10 xl:px-8",children:(0,a.jsx)(I,{viewMode:F})})}):(0,a.jsx)(r.si,{showMainContainer:!1,children:(0,a.jsxs)("div",{className:"relative",children:[(0,a.jsx)("div",{"aria-hidden":!0,className:"pointer-events-none absolute inset-x-0 top-0 h-[600px] opacity-20 dark:opacity-[0.10]",style:{background:"radial-gradient(ellipse 60% 50% at 20% 20%, oklch(0.72 0.18 250 / 80%) 0%, transparent 70%), radial-gradient(ellipse 50% 40% at 80% 15%, oklch(0.65 0.15 200 / 60%) 0%, transparent 70%), radial-gradient(ellipse 40% 35% at 50% 70%, oklch(0.70 0.12 280 / 40%) 0%, transparent 70%)",maskImage:"linear-gradient(to bottom, black 40%, transparent 100%)",WebkitMaskImage:"linear-gradient(to bottom, black 40%, transparent 100%)"}}),(0,a.jsxs)(o.Z_,{className:"relative mx-auto w-full max-w-[1800px] px-3 pt-16 pb-8 sm:px-6 sm:pt-20 sm:pb-10 xl:px-8",children:[(0,a.jsxs)("header",{className:"mx-auto mb-5 max-w-3xl pt-5 text-center sm:mb-10 sm:pt-10",children:[(0,a.jsx)("h1",{className:"text-[clamp(2rem,5.5vw,3.5rem)] leading-[1.15] font-bold tracking-tight",children:e("Model Square")}),(0,a.jsx)("p",{className:"text-muted-foreground/80 mt-3 text-sm sm:mt-4 sm:text-base",children:e("This site currently has {{count}} models enabled",{count:i?.length||0})}),(0,a.jsx)("p",{className:"text-muted-foreground/60 mx-auto mt-2 max-w-2xl text-xs leading-relaxed sm:text-sm",children:e("Discover curated AI models, compare pricing and capabilities, and choose the right model for every scenario.")}),(0,a.jsx)(es,{value:v,onChange:M,onClear:O,placeholder:e("Search model name, provider, endpoint, or tag..."),className:"mx-auto mt-4 max-w-2xl sm:mt-6"})]}),(0,a.jsxs)("div",{className:"grid gap-4 xl:grid-cols-[330px_minmax(0,1fr)]",children:[(0,a.jsx)(b,{quotaTypeFilter:C,endpointTypeFilter:k,vendorFilter:y,groupFilter:w,tagFilter:A,onQuotaTypeChange:S,onEndpointTypeChange:$,onVendorChange:R,onGroupChange:L,onTagChange:K,vendors:d||[],groups:Z,groupRatios:c,tags:Q,models:i||[],hasActiveFilters:B,onClearFilters:D,className:"hover-scrollbar sticky top-4 hidden max-h-[calc(100dvh-2rem)] self-start overflow-y-auto xl:block"}),(0,a.jsxs)("main",{className:"min-w-0 space-y-4",children:[(0,a.jsx)(z,{filteredCount:V.length,totalCount:i?.length,sortBy:N,onSortChange:_,tokenUnit:E,onTokenUnitChange:P,showRechargePrice:T,onRechargePriceChange:q,viewMode:F,onViewModeChange:G,quotaTypeFilter:C,endpointTypeFilter:k,vendorFilter:y,groupFilter:w,tagFilter:A,onQuotaTypeChange:S,onEndpointTypeChange:$,onVendorChange:R,onGroupChange:L,onTagChange:K,vendors:d||[],groups:Z,groupRatios:c,tags:Q,models:i||[],hasActiveFilters:B,activeFilterCount:U,onClearFilters:D}),0===V.length?(0,a.jsx)(X,{searchQuery:v,hasActiveFilters:B,onClearFilters:J}):F===h.pV.CARD?(0,a.jsx)(H,{models:V,onModelClick:Y,priceRate:f,usdExchangeRate:j,tokenUnit:E,showRechargePrice:T,selectedGroup:w}):(0,a.jsx)(er,{models:V,priceRate:f,usdExchangeRate:j,tokenUnit:E,showRechargePrice:T,selectedGroup:w,onModelClick:Y})]})]}),W&&(0,a.jsx)(et.n$,{open:!!W,onOpenChange:e=>{e||t(null)},model:W,groupRatio:c||{},usableGroup:m||{},endpointMap:u||{},autoGroups:x||[],priceRate:f??1,usdExchangeRate:j??1,tokenUnit:E,showRechargePrice:T})]})]})})}},43014(e,s,t){let a=(0,t(9781).A)("funnel",[["path",{d:"M10 20a1 1 0 0 0 .553.895l2 1A1 1 0 0 0 14 21v-7a2 2 0 0 1 .517-1.341L21.74 4.67A1 1 0 0 0 21 3H3a1 1 0 0 0-.742 1.67l7.225 7.989A2 2 0 0 1 10 14z",key:"sc7q7i"}]]);t.d(s,{},{A:a})}}]);
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.