(function(){try{var g=typeof window!=="undefined"?window:typeof global!=="undefined"?global:typeof self!=="undefined"?self:{};g["__faroBundleId_hub-ui"]="1776171900957-0cd8d4af42"}catch(l){}})();import{r as j,j as e}from"./c2heove9.js";import{B as l}from"./s386w7ee.js";import{C as P}from"./hrhvij4l.js";import{D as z}from"./n0aar0cs.js";import{E as W}from"./d8nscn7y.js";import{W as T,a5 as X,at as G,V as n,l as U,T as h,n as b,w as g}from"./la47cm74.js";import{M as k,L as V}from"./f30dsew0.js";import{S as _}from"./i1xqv3bx.js";import{T as Y}from"./z64hlsum.js";import{g as Z}from"./m6px07lc.js";import{P as w}from"./mn87mi0e.js";import{H as v}from"./hb2vd7l6.js";import{f}from"./gsyzq037.js";import{g as q}from"./iwmhkx4s.js";import{g as J}from"./due6y0ql.js";import{A as K}from"./iy3smwie.js";import{V as L}from"./cr3yi9y8.js";const Q=(o,t)=>e.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",ref:t,...o,children:[e.jsx("path",{d:"M18.4 6.64979V6.375C18.4 4.86286 18.4 5.05179 18.1057 4.47423C17.8469 3.96619 17.4338 3.55314 16.9258 3.29428C16.3482 3 15.5921 3 14.08 3H8.32C6.80786 3 6.05179 3 5.47423 3.29428C4.96619 3.55314 4.55314 3.96619 4.29428 4.47423C4 5.05179 4 5.80786 4 7.32V16.68C4 18.1921 4 18.9482 4.29428 19.5258C4.55314 20.0338 4.96619 20.4469 5.47423 20.7057C6.05179 21 6.80786 21 8.32 21H11.65",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"}),e.jsx("path",{d:"M15.9341 20.4155C16.0461 20.486 16.1022 20.5212 16.1813 20.5395C16.2427 20.5537 16.3322 20.5537 16.3936 20.5395C16.4727 20.5212 16.5287 20.486 16.6408 20.4155C17.627 19.7954 20.3374 17.8475 20.3374 15.1693V12.5599C20.3374 12.1237 20.3374 11.9055 20.2712 11.718C20.2127 11.5524 20.1177 11.4046 19.9944 11.2875C19.8547 11.1548 19.6652 11.0782 19.2862 10.9251L16.5718 9.82797C16.4666 9.78543 16.414 9.76416 16.3598 9.75573C16.3118 9.74825 16.263 9.74825 16.215 9.75573C16.1609 9.76416 16.1083 9.78543 16.003 9.82797L13.2886 10.9251C12.9096 11.0782 12.7201 11.1548 12.5805 11.2875C12.4571 11.4046 12.3621 11.5524 12.3036 11.718C12.2374 11.9055 12.2374 12.1237 12.2374 12.5599V15.1693C12.2374 17.8475 14.9479 19.7954 15.9341 20.4155Z",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"})]}),oo=j.forwardRef(Q),I=j.forwardRef((o,t)=>e.jsx(T,{"data-testid":"FileShieldIcon",component:oo,ref:t,...o}));I.muiName="FileShield";const eo=(o,t)=>e.jsx("svg",{viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",ref:t,...o,children:e.jsx("path",{d:"M21.7 11.5L19.7005 13.5L17.7 11.5M19.9451 13C19.9814 12.6717 20 12.338 20 12C20 7.02944 15.9706 3 11 3C6.02944 3 2 7.02944 2 12C2 16.9706 6.02944 21 11 21C13.8273 21 16.35 19.6963 18 17.6573M11 7V12L14 14",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"})}),to=j.forwardRef(eo),R=j.forwardRef((o,t)=>e.jsx(T,{"data-testid":"UpdateIcon",component:to,ref:t,...o}));R.muiName="Update";const ro="ShowRecommendedBadge",no="Disabled",io="Enabled",so={lessThanXSeconds:o=>`${o}s`,xSeconds:o=>`${o}s`,halfAMinute:()=>"30s",lessThanXMinutes:o=>`${o}m`,xMinutes:o=>`${o}m`,aboutXHours:o=>`${o}h`,xHours:o=>`${o}h`,xDays:o=>`${o}d`,aboutXWeeks:o=>`${o}w`,xWeeks:o=>`${o}w`,aboutXMonths:o=>`${o}m`,xMonths:o=>`${o}m`,aboutXYears:o=>`${o}y`,xYears:o=>`${o}y`,overXYears:o=>`${o}y`,almostXYears:o=>`${o}y`};function $o({id:o,slug:t,name:d,pull_count:i,logo_url:m,type:r,short_description:s,badge:x,onClick:A,updated_at:C,star_count:u,content_types:$,publisher:N,isPrivate:y,showRecommendedPill:H,isRecommendedExpEnabled:B,additional_metadata:E}){const p=po(t),D=J({type:r,slug:t||o,namespace:p}),M=r==="dhi"||x===l.OFFICIAL?`${D}?xk=${ro}&xt=${B?io:no}`:D,F=Z();return e.jsx(X,{"data-testid":"product-card",onClick:a=>{if(a.target instanceof HTMLElement&&(a.target.nodeName==="A"||a.target.parentNode?.nodeName==="A")){a.stopPropagation();return}F(M),A?.(a)},children:e.jsx(G,{component:"div",sx:{p:2,height:"100%"},children:e.jsxs(n,{spacing:2,sx:{height:"100%"},children:[e.jsxs(n,{direction:"row",sx:{justifyContent:"space-between"},children:[e.jsx(mo,{types:$||[r],badge:x}),H&&e.jsx(U,{label:"Recommended",size:"small",color:"premium"})]}),e.jsxs(n,{spacing:1,direction:"row",children:[e.jsx(K,{sx:{backgroundColor:"transparent",color:"text.primary"},title:e.jsx(P,{fontSize:"large",sx:{wordBreak:"break-word",opacity:.56}}),variant:"rounded",imageSrc:q(m)}),e.jsxs(n,{spacing:1,sx:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:[e.jsx(h,{variant:"h6",noWrap:!0,children:e.jsx(k,{to:M,color:"inherit",underline:"none","data-testId":"product-card-link",children:d})}),e.jsx(k,{variant:"body2",to:p==="dhi"?"/hardened-images/catalog":`/u/${p==="library"&&r==="mcp"?"mcp":p}`,underline:"none",sx:{alignSelf:"baseline",wordBreak:"break-word","&:not(.MuiMenuItem-root, .MuiListItemButton-root) .MuiSvgIcon-root":{ml:0}},children:e.jsx(uo,{badge:x,publisher:N})})]})]}),e.jsx(h,{variant:"body2",color:"docker.grey.700",children:s}),e.jsxs(n,{direction:"row",sx:{justifyContent:"space-between",color:"docker.grey.700",marginTop:"auto"},children:[e.jsxs(n,{direction:"row",spacing:1.5,children:[C&&e.jsx(c,{tooltipTitle:`Updated ${L(C,{addSuffix:!0})}`,icon:e.jsx(R,{fontSize:"small"}),label:L(C,{locale:{formatDistance:(a,O)=>so[a](O)}})}),i&&e.jsx(c,{tooltipTitle:`${f(i)} pulls`,icon:e.jsx(z,{fontSize:"small"}),label:f(i)}),!!u&&u>0&&e.jsx(c,{tooltipTitle:`${f(u)} stars`,icon:e.jsx(_,{fontSize:"small"}),label:f(u)})]}),e.jsxs(n,{direction:"row",spacing:1.5,children:[r==="dhi"&&e.jsx(ao,{metadata:E}),r==="mcp"&&e.jsx(lo,{metadata:E}),r==="agent"&&e.jsx(co,{metadata:E}),y?e.jsx(c,{tooltipTitle:"Private",icon:e.jsx(V,{fontSize:"small"})}):null]})]})]})})})}function ao({metadata:o}){return o?e.jsxs(e.Fragment,{children:[o.tools&&o.tools.length>0&&e.jsx(S,{tools:o.tools}),o.els_available&&e.jsx(c,{tooltipTitle:"Extended Lifecycle Support: Docker supports both end-of-life and actively maintained tags for this image",icon:e.jsx(W,{fontSize:"small"})}),e.jsx(c,{tooltipTitle:`${["CIS",o.fips_compliant&&"FIPS",o.stig_certified&&"STIG"].filter(Boolean).join(", ")} compliant`,icon:e.jsx(I,{fontSize:"small"})})]}):null}function lo({metadata:o}){return!o?.tools||o.tools.length===0?null:e.jsx(S,{tools:o.tools})}function co({metadata:o}){return!o?.tools||o.tools.length===0?null:e.jsx(S,{tools:o.tools})}function S({tools:o}){return e.jsx(c,{tooltipTitle:e.jsxs(n,{children:[o.length," Tools included:"," ",o.map(t=>e.jsx(g,{children:t.name},t.name))]}),icon:e.jsx(Y,{fontSize:"small"}),label:o.length})}function c({label:o,icon:t,tooltipTitle:d}){return e.jsx(b,{title:d,children:e.jsxs(n,{direction:"row",spacing:.5,sx:{alignItems:"center"},children:[t,o&&e.jsx(h,{variant:"body2",children:o})]})})}function mo({types:o,badge:t}){if(!o||o.length===0)return null;const d=o.sort((s,x)=>s==="unrecognized"?1:x==="unrecognized"?-1:0).map(s=>xo(s)),[i,...m]=d;let r=e.jsx(e.Fragment,{children:i});if(i&&t===l.HARDENED){const s={helm:"HELM CHART",image:"HARDENED IMAGE",dhi:"HARDENED IMAGE"};r=e.jsx(g,{sx:{background:`linear-gradient(${v})`,backgroundClip:"text",color:"transparent"},children:s[i]})}return e.jsx(b,{title:m.join(", "),children:e.jsxs(h,{variant:"overline",className:"product-type",color:"textSecondary",sx:{width:"fit-content",marginBottom:1},children:[r," ",m.length>0&&`+ ${m.length} more`]})})}function xo(o){return o==="unrecognized"?"Artifact":o}function uo({badge:o,publisher:t}){return o===l.OFFICIAL||t?.name==="library"?e.jsx(w,{hideTooltip:!0,badge:l.OFFICIAL}):o===l.HARDENED?e.jsx(w,{hideTooltip:!0,customLabel:e.jsx(g,{sx:{background:`linear-gradient(${v})`,backgroundClip:"text",color:"transparent",pointerEvents:"none"},children:"Docker Hardened Image"}),badge:o}):o===l.VERIFIED_PUBLISHER||o===l.OPEN_SOURCE?e.jsx(w,{customLabel:t?.name,badge:o}):e.jsx(g,{sx:{opacity:.56,color:"text.primary"},children:t?.name})}function po(o){const t=o.split("/");return t.length>1&&t[0]?t[0]:"library"}export{$o as P};