(function(){try{var g=typeof window!=="undefined"?window:typeof global!=="undefined"?global:typeof self!=="undefined"?self:{};g["__faroBundleId_hub-ui"]="1776361634403-2195cb2175"}catch(l){}})();import{j as a}from"./c2heove9.js";import{p as h}from"./oldsao4z.js";import{C as L,T as w,B as S}from"./mau5ylft.js";import{o as _,e as k,s as t,n as i,a as g,b as o,r as A}from"./c2kxmmw2.js";import{i as B}from"./m6px07lc.js";import{r as O}from"./hrjiqtyo.js";import{F as $}from"./hm9i4ib6.js";import{P as F}from"./dglyc4h1.js";import{i as N}from"./j8acazhz.js";import{P as U}from"./nmok1n6e.js";import{b}from"./oap4gxto.js";import{f as V}from"./gsyzq037.js";import{m as d}from"./fy3e5a2o.js";import{V as P,S as G,T as W,w as z}from"./la47cm74.js";import{S as D}from"./c4p371x0.js";import{E as H}from"./k6j0tug9.js";const l=_({categories:L,content_types:g(w),date_registered:t().nullish(),description:t(),is_private:o(),last_updated:t(),last_modified:t(),media_types:g(t()),name:t(),namespace:t(),pull_count:i(),repository_type:t().nullish(),star_count:i(),status:i(),status_description:t().nullish(),source:k(["dhi"]).nullish()}),M=_({enabled:o(),rules:g(t())}),Z=l.extend({collaborator_count:i(),full_description:t().nullish(),has_starred:o(),hub_user:t().nullish().optional(),immutable_tags_settings:M,is_automated:o().nullish(),permissions:_({read:o(),write:o(),admin:o()}),user:t(),storage_size:i().nullish()});Z.extend({last_modified:t().nullable().optional()});h(l);const q=l.omit({content_types:!0,media_types:!0});h(q);const J=l.extend({logo_url:A(t()).optional()});h(J);function he({enableSearch:c=!1,repos:s,page:r,setPage:p,namespace:n,emptyComponent:e,onChange:T,isSearching:u=!1,orgData:m}){const[R]=B(),j=R.get("search")||"",y=(r-1)*b+1,E=y+(s?.results.length??0)-1,f=Math.ceil((s?.count??0)/b),C=m?.badge===S.OPEN_SOURCE||m?.badge===S.VERIFIED_PUBLISHER?m?.company??n:n,x=s.count===0,I=x?"No repositories":`Displaying ${y} to ${E} of ${s.count} repositories`;return a.jsxs(P,{spacing:2,"data-testid":"profile-repos-list",children:[a.jsxs(P,{direction:"row",spacing:2,sx:{alignItems:"center"},children:[c?a.jsx(D,{loading:u,sx:{minWidth:280},defaultValue:j,onChange:v=>{T?.(v)},placeholder:"Search by repository name","data-testid":"searchInput"},"namespace-search"):null,u?a.jsx(G,{variant:"text",width:"200px"}):a.jsx(W,{variant:"body1",children:I})]}),a.jsx($,{isLoading:u,children:a.jsx(K,{isEmpty:x,publisherDisplayName:C,badge:m?.badge||null,emptyComponent:e||a.jsx(Q,{}),repos:s})}),f>1&&a.jsx(F,{page:r,totalPages:f,onChange:p})]})}function K({isEmpty:c,publisherDisplayName:s,badge:r,repos:p,emptyComponent:n}){return c?n:a.jsx(z,{sx:e=>({display:"grid",gridTemplateColumns:{xs:"1fr",md:"repeat(2, 1fr)",lg:"repeat(3, 1fr)"},gridTemplateRows:"1fr",gridColumnGap:e.spacing(3),gridRowGap:e.spacing(3),gridArea:"zstack"}),children:p?.results.map(e=>a.jsx(U,{...e,name:d({namespace:e.namespace,reponame:e.name}),id:d({namespace:e.namespace,reponame:e.name}),pull_count:V(e.pull_count),star_count:e.star_count,short_description:e.description,updated_at:e.last_updated,slug:d({namespace:e.namespace,reponame:e.name}),badge:r,categories:e.categories,type:N(e.content_types)?"plugin":"image",content_types:e.content_types,publisher:s?{name:s}:void 0,archived:e.status===O.archived,logo_url:e.logo_url,additional_metadata:null,isPrivate:e.is_private},`${e.namespace}/${e.name}`))})}function Q(){return a.jsx(H,{title:"No repositories",content:"There are no repositories that match your search criteria."})}export{he as P};