1import{r as b,j as e}from"./vendor-radix-C-iWsDp5.js";import{s as v}from"./externalLink-B7OoR8Bn.js";import{C as g,d as j}from"./card-FSlDZnj2.js";import{c4 as k,_ as P,d7 as E,a as F,u as _,d6 as N,B as m,r as T,g as A,K as B,dF as I,aT as L,a6 as z}from"./index-Dpj7kwyk.js";import{B as q}from"./badge-CWr-kLBs.js";import{a as K}from"./useUrlState-BR5aiTu3.js";import{p as x}from"./useWorkflowChatModels-C-J4h-vv.js";import"./preload-helper-BXl3LOEh.js";import"./vendor-utils--BulIq_u.js";import"./vendor-supabase-D228LLle.js";import"./vendor-motion-Dlvx6ono.js";function O(){return k({queryKey:["model-certifications-catalog"],queryFn:async()=>{const{data:i,error:s}=await P.from("available_models").select("id, model_key, display_name, provider, model_category, deployment_mode, certifications, certifications_note").eq("is_enabled",!0).order("provider",{ascending:!0}).order("display_name",{ascending:!0});if(s)throw s;return(i??[]).map(r=>({id:r.id,model_key:r.model_key,display_name:r.display_name,provider:r.provider,model_category:String(r.model_category),deployment_mode:r.deployment_mode?String(r.deployment_mode):null,certifications:E(r.certifications),certifications_note:r.certifications_note}))},staleTime:1e3*60*5})}function R(i){const s=new Set;return i.filter(r=>s.has(r.key)?!1:(s.add(r.key),!0))}function C({cert:i}){const{i18n:s}=_("common"),r=I[i.category],p=`${s.language.startsWith("de")?r.labelDe:r.labelEn}${i.verified_at?` · ${i.verified_at}`:""}`,o=e.jsx(L,{content:p,asChild:!0,children:e.jsxs(q,{variant:"outline",className:"text-xs gap-1",children:[i.label,i.source_url?e.jsx(z,{className:"h-3 w-3"}):null]})});return v(i.source_url)?e.jsx("a",{href:v(i.source_url),target:"_blank",rel:"noopener noreferrer",className:"inline-flex transition-opacity hover:opacity-75",children:o}):o}function X(){const i=F(),{t:s}=_("common"),{data:r=[],isLoading:p,isError:o}=O(),[c,f]=K("provider",""),u=b.useMemo(()=>{const t=new Map;for(const a of r){const n=t.get(a.provider)??[];n.push(a),t.set(a.provider,n)}return Array.from(t.entries()).map(([a,n])=>{const d=N(R(n.flatMap(l=>l.certifications.filter(h=>h.scope==="provider")))),S=n.map(l=>({model:l,certs:N(l.certifications.filter(h=>h.scope==="model"))})).filter(l=>l.certs.length>0),w=Array.from(new Set(n.map(l=>l.certifications_note).filter(l=>!!l)));return{provider:a,models:n,providerCerts:d,modelCerts:S,notes:w}}).sort((a,n)=>x(a.provider).localeCompare(x(n.provider)))},[r]),y=c?u.filter(t=>t.provider===c):u;return e.jsxs("div",{className:"w-full py-8 px-4 space-y-8",children:[e.jsxs("div",{className:"flex items-center gap-4",children:[e.jsx(m,{variant:"ghost",size:"icon",onClick:()=>i(-1),children:e.jsx(T,{className:"h-5 w-5"})}),e.jsxs("div",{children:[e.jsx("h1",{className:"text-2xl font-bold tracking-tight",children:s("dataSecurity.certPage.title")}),e.jsx("p",{className:"text-muted-foreground text-sm mt-1",children:s("dataSecurity.certPage.subtitle")})]})]}),e.jsx("p",{className:"text-xs text-muted-foreground leading-relaxed",children:s("dataSecurity.certPage.disclaimer")}),p?e.jsx("div",{className:"flex items-center justify-center py-16",children:e.jsx(A,{className:"h-6 w-6 animate-spin text-primary"})}):o?e.jsx("p",{className:"text-sm text-destructive",children:s("dataSecurity.certPage.loadError")}):e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"flex flex-wrap gap-2",children:[e.jsx(m,{variant:c===""?"secondary":"outline",size:"sm",onClick:()=>f(""),children:s("dataSecurity.certPage.allProviders")}),u.map(t=>e.jsx(m,{variant:c===t.provider?"secondary":"outline",size:"sm",onClick:()=>f(t.provider),children:x(t.provider)},t.provider))]}),y.length===0?e.jsx(g,{spotlight:!1,className:"hover:translate-y-0",children:e.jsxs(j,{className:"p-6 flex flex-col items-start gap-3",children:[e.jsx("p",{className:"text-sm text-muted-foreground",children:s("dataSecurity.certPage.providerNotFound")}),e.jsx(m,{variant:"outline",size:"sm",onClick:()=>f(""),children:s("dataSecurity.certPage.showAll")})]})}):y.map(t=>e.jsx(g,{spotlight:!1,className:"hover:translate-y-0",children:e.jsxs(j,{className:"p-6 space-y-4",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"h-10 w-10 rounded-full bg-primary/10 flex items-center justify-center",children:e.jsx(B,{className:"h-5 w-5 text-primary"})}),e.jsxs("div",{children:[e.jsx("h2",{className:"font-semibold",children:x(t.provider)}),e.jsx("p",{className:"text-xs text-muted-foreground",children:s("dataSecurity.certPage.modelCount",{count:t.models.length})})]})]}),t.providerCerts.length===0&&t.modelCerts.length===0?e.jsx("p",{className:"text-sm text-muted-foreground",children:s("dataSecurity.certPage.noCerts")}):e.jsxs(e.Fragment,{children:[t.providerCerts.length>0&&e.jsxs("div",{className:"space-y-2",children:[e.jsx("h3",{className:"text-sm font-medium",children:s("dataSecurity.certPage.providerCerts")}),e.jsx("div",{className:"flex flex-wrap gap-1.5",children:t.providerCerts.map(a=>e.jsx(C,{cert:a},a.key))})]}),t.modelCerts.length>0&&e.jsxs("div",{className:"space-y-2",children:[e.jsx("h3",{className:"text-sm font-medium",children:s("dataSecurity.certPage.modelCerts")}),e.jsx("div",{className:"space-y-1.5",children:t.modelCerts.map(({model:a,certs:n})=>e.jsxs("div",{className:"flex flex-wrap items-center gap-1.5",children:[e.jsxs("span",{className:"text-sm text-muted-foreground",children:[a.display_name,":"]}),n.map(d=>e.jsx(C,{cert:d},d.key))]},a.id))})]})]}),t.notes.length>0&&e.jsx("div",{className:"space-y-1",children:t.notes.map(a=>e.jsx("p",{className:"text-xs text-muted-foreground leading-relaxed",children:a},a))})]})},t.provider))]})]})}export{X 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.