"use strict";(self.webpackChunkgrafana=self.webpackChunkgrafana||[]).push([[9898],{71042(y,d,n){n.r(d),n.d(d,{default:()=>A});var t=n(14553),l=n(29189),m=n(54148),e=n(92745),j=n(50201),S=n(66404),T=n(89640),E=n(68079),f=n(41654),h=n(8073),L=n(35942),g=n(83793),u=n(13791),$=n(74101),R=n(62939),v=n(91555),F=n(79755);function H(o){return!!o&&new Set(["github","gitlab","bitbucket"]).has(o)}function A(){const o=(0,m.g)(),r=o.name??"",a=o["*"]??"",[i]=(0,$.z)(),s=i.get("repo_type"),p=!H(s),c=(0,g.c2)({name:r}),x=(0,g.$j)(p?l.hT:{name:r,path:a}),I=c.isError&&(0,R.E)(c.error)||p,M=p?(0,e.t)("provisioning.file-history-page.history-not-supported","File history is not supported for this repository"):(0,e.t)("provisioning.file-history-page.repository-not-found","Repository not found");return(0,t.jsx)(u.Y,{navId:"provisioning",pageNav:{text:`History: ${a}`,subTitle:c.data?.spec?.title??"Repository"},children:(0,t.jsx)(u.Y.Contents,{isLoading:!1,children:I?(0,t.jsxs)(j.p,{message:M,variant:"not-found",children:[(0,t.jsx)(S.E,{element:"p",children:s!=="git"&&(0,t.jsx)(e.x6,{i18nKey:"provisioning.file-history-page.repository-config-exists-configuration",children:"Make sure the repository config exists in the configuration file."})}),(0,t.jsx)(T.Y,{href:v.mL,children:(0,t.jsx)(e.x6,{i18nKey:"provisioning.file-history-page.back-to-repositories",children:"Back to repositories"})})]}):(0,t.jsx)("div",{children:x.data?(0,t.jsx)(C,{history:x.data,path:a,repo:r}):(0,t.jsx)(E.y,{})})})})}function C({history:o,path:r,repo:a}){return o.items?(0,t.jsx)(f.B,{direction:"column",children:o.items.map(i=>(0,t.jsxs)(h.Z,{noMargin:!0,href:`${v.mL}/${a}/file/${r}?ref=${i.ref}`,children:[(0,t.jsx)(h.Z.Heading,{children:i.message}),(0,t.jsx)(h.Z.Meta,{children:(0,t.jsx)("span",{children:(0,F.E)(i.createdAt)})}),(0,t.jsx)(h.Z.Description,{children:(0,t.jsx)(f.B,{children:i.authors.map(s=>(0,t.jsxs)("span",{style:{display:"flex",alignItems:"center",gap:"4px"},children:[s.avatarURL&&(0,t.jsx)(L.n,{userView:{user:{name:s.name,avatarUrl:s.avatarURL},lastActiveAt:new Date().toISOString()},showTooltip:!1}),(0,t.jsx)("a",{href:`https://github.com/${s.username}`,children:s.name})]},s.username))})})]},i.ref))}):(0,t.jsx)(e.x6,{i18nKey:"provisioning.history-view.not-found",children:"Not found"})}},79755(y,d,n){n.d(d,{E:()=>t});function t(l){return l?new Date(l).toLocaleString():"N/A"}}}]);

//# sourceMappingURL=FileHistoryPage-react19.8dbd3e148844ed5d9064.js.map