@techdocs/cli 0.0.0-nightly-20230514022003 → 0.0.0-nightly-20230516022030
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +3 -3
- package/dist/embedded-app/index.html +1 -1
- package/dist/embedded-app/static/{main.6029aee2.js → main.7a6c2e51.js} +2 -2
- package/dist/embedded-app/static/main.7a6c2e51.js.map +1 -0
- package/dist/embedded-app/static/{runtime.6029aee2.js → runtime.7a6c2e51.js} +1 -1
- package/dist/embedded-app/static/{runtime.6029aee2.js.map → runtime.7a6c2e51.js.map} +1 -1
- package/dist/embedded-app/static/{vendor.6029aee2.js → vendor.7a6c2e51.js} +1 -1
- package/dist/embedded-app/static/{vendor.6029aee2.js.map → vendor.7a6c2e51.js.map} +1 -1
- package/package.json +4 -4
- package/dist/embedded-app/static/main.6029aee2.js.map +0 -1
|
@@ -30,7 +30,7 @@ spec:
|
|
|
30
30
|
hsla(0, 0%, ${o}, 0.013) 91.9%,
|
|
31
31
|
hsla(0, 0%, ${o}, 0) 100%
|
|
32
32
|
`},E=100,Q=10,be=(0,g.Z)(e=>({root:{position:"relative",display:"flex",flexFlow:"row nowrap",alignItems:"center"},container:{overflow:"auto",scrollbarWidth:0,"&::-webkit-scrollbar":{display:"none"}},fade:{position:"absolute",width:E,height:`calc(100% + ${Q}px)`,transition:"opacity 300ms",pointerEvents:"none"},fadeLeft:{left:-Q,background:`linear-gradient(90deg, ${b(e.palette.type)})`},fadeRight:{right:-Q,background:`linear-gradient(270deg, ${b(e.palette.type)})`},fadeHidden:{opacity:0},button:{position:"absolute"},buttonLeft:{left:-e.spacing(2)},buttonRight:{right:-e.spacing(2)}}),{name:"BackstageHorizontalScrollGrid"});function je(e){const[[o,l],d]=React.useState([0,0]);return React.useLayoutEffect(()=>{const m=e.current;if(!m){d([0,0]);return}const v=()=>{const j=m.scrollLeft,F=m.scrollWidth-m.offsetWidth-m.scrollLeft;d([j,F])};return v(),m.addEventListener("scroll",v),window.addEventListener("resize",v),()=>{m.removeEventListener("scroll",v),window.removeEventListener("resize",v)}},[e]),[o,l]}function ke(e,o,l){const[d,m]=React.useState(0);return React.useLayoutEffect(()=>{if(d===0)return;const v=window.performance.now(),j=requestAnimationFrame(F=>{if(!e.current)return;const G=F-v,U=Math.abs(d)*G/o,he=Math.max(l,U)*Math.sign(d);e.current.scrollBy({left:he});const Pe=d-he;Math.sign(d)!==Math.sign(Pe)?m(0):m(Pe)});return()=>cancelAnimationFrame(j)},[e,d,o,l]),m}function ht(e){const{scrollStep:o=100,scrollSpeed:l=50,minScrollDistance:d=5,children:m,...v}=e,j=be(e),F=React.useRef(),[G,U]=je(F),fe=ke(F,l,d),he=Pe=>{F.current&&fe(Pe?o:-o)};return _jsxs(Box,{...v,className:j.root,children:[_jsx(Grid,{container:!0,direction:"row",wrap:"nowrap",className:j.container,ref:F,children:m}),_jsx(Box,{className:classNames(j.fade,j.fadeLeft,{[j.fadeHidden]:G===0})}),_jsx(Box,{className:classNames(j.fade,j.fadeRight,{[j.fadeHidden]:U===0})}),G>0&&_jsx(IconButton,{title:"Scroll Left",onClick:()=>he(!1),className:classNames(j.button,j.buttonLeft,{}),children:_jsx(ChevronLeftIcon,{})}),U>0&&_jsx(IconButton,{title:"Scroll Right",onClick:()=>he(!0),className:classNames(j.button,j.buttonRight,{}),children:_jsx(ChevronRightIcon,{})})]})}const ft=(0,g.Z)(e=>({alpha:{color:e.palette.common.white,fontFamily:"serif",fontWeight:"normal",fontStyle:"italic"},beta:{color:"#4d65cc",fontFamily:"serif",fontWeight:"normal",fontStyle:"italic"}}),{name:"BackstageLifecycle"});function yn(e){const o=ft(e),{shorthand:l,alpha:d}=e;return l?_jsx(Typography,{component:"span",className:o[d?"alpha":"beta"],style:{fontSize:"120%"},children:d?_jsx(_Fragment,{children:"\u03B1"}):_jsx(_Fragment,{children:"\u03B2"})}):_jsx(Typography,{component:"span",className:o[d?"alpha":"beta"],children:d?"Alpha":"Beta"})}const kn=(0,f.lazy)(()=>Promise.all([r.e(1049),r.e(6051)]).then(r.bind(r,76051)).then(e=>({default:e.RealLogViewer})));function br(e){const{Progress:o}=(0,h.qD)().getComponents();return(0,t.jsx)(f.Suspense,{fallback:(0,t.jsx)(o,{}),children:(0,t.jsx)(kn,{...e})})}var Br=r(28865),$r=r(60251);const Ao=(0,g.Z)(e=>({markdown:{"& table":{borderCollapse:"collapse",border:`1px solid ${e.palette.border}`},"& th, & td":{border:`1px solid ${e.palette.border}`,padding:e.spacing(1)},"& td":{wordBreak:"break-word",overflow:"hidden",verticalAlign:"middle",lineHeight:"1",margin:0,padding:e.spacing(3,2,3,2.5),borderBottom:0},"& th":{backgroundColor:e.palette.background.paper},"& tr":{backgroundColor:e.palette.background.paper},"& tr:nth-child(odd)":{backgroundColor:e.palette.background.default},"& a":{color:e.palette.link},"& img":{maxWidth:"100%"}}}),{name:"BackstageMarkdownContent"}),eo=(e,o)=>o?typeof o=="string"?e+o:f.Children.toArray(o.props.children).reduce(eo,e):e,Sr=({level:e,children:o})=>{const m=f.Children.toArray(o).reduce(eo,"").toLocaleLowerCase("en-US").replace(/\W/g,"-");return f.createElement(`h${e}`,{id:m},o)},Rr={code:({inline:e,className:o,children:l,...d})=>{const m=String(l).replace(/\n+$/,""),v=/language-(\w+)/.exec(o||"");return!e&&v?(0,t.jsx)(Le,{language:v[1],text:m}):(0,t.jsx)("code",{className:o,...d,children:l})},h1:Sr,h2:Sr,h3:Sr,h4:Sr,h5:Sr,h6:Sr};function or(e){const{content:o,dialect:l="gfm",linkTarget:d,transformLinkUri:m,transformImageUri:v,className:j}=e,F=Ao();return(0,t.jsx)(Br.D,{remarkPlugins:l==="gfm"?[$r.Z]:[],className:`${F.markdown} ${j}`,children:o,components:Rr,linkTarget:d,transformLinkUri:m,transformImageUri:v})}var Kn=r(23054);const Ir=(0,g.Z)(e=>({root:{paddingLeft:e.spacing(3)}}),{name:"BackstageLoginRequestListItem"}),Cr=({request:e,busy:o,setBusy:l})=>{const d=Ir(),[m,v]=useState(),j=async()=>{l(!0);try{await e.trigger()}catch(G){v(isError(G)?G.message:"An unspecified error occurred")}finally{l(!1)}},F=e.provider.icon;return _jsxs(ListItem,{disabled:o,classes:{root:d.root},children:[_jsx(ListItemAvatar,{children:_jsx(F,{fontSize:"large"})}),_jsx(ListItemText,{primary:e.provider.title,secondary:m&&_jsx(Typography,{color:"error",children:m})}),_jsx(Button,{color:"primary",variant:"contained",onClick:j,children:"Log in"})]})};var To=null;const Ro=(0,g.Z)(e=>({dialog:{paddingTop:e.spacing(1)},title:{minWidth:0},titleHeading:{fontSize:e.typography.h6.fontSize},contentList:{padding:0},actionButtons:{padding:e.spacing(2,0)}}),{name:"OAuthRequestDialog"});function to(e){const o=Ro(),[l,d]=useState(!1),m=useApi(oauthRequestApiRef),v=useApi(configApiRef);var j;const F=(j=v.getOptionalBoolean("enableExperimentalRedirectFlow"))!==null&&j!==void 0?j:!1,G=useObservable(useMemo(()=>m.authRequest$(),[m]),[]),U=()=>{G.forEach(fe=>fe.reject())};return _jsxs(Dialog,{open:Boolean(G.length),fullWidth:!0,maxWidth:"xs",classes:{paper:o.dialog},"aria-labelledby":"oauth-req-dialog-title",children:[_jsxs("main",{children:[_jsxs(DialogTitle,{classes:{root:o.title},id:"oauth-req-dialog-title",children:[_jsx(Typography,{className:o.titleHeading,variant:"h1",children:"Login Required"}),F?_jsx(Typography,{children:"This will trigger a http redirect to OAuth Login."}):null]}),_jsx(DialogContent,{dividers:!0,classes:{root:o.contentList},children:_jsx(List,{children:G.map(fe=>_jsx(LoginRequestListItem,{request:fe,busy:l,setBusy:d},fe.provider.title))})})]}),_jsx(DialogActions,{classes:{root:o.actionButtons},children:_jsx(Button,{onClick:U,children:"Reject All"})})]})}var Io=r(15277),Po=r.n(Io),Wr=r(29862);const tr=(0,g.Z)({container:{overflow:"visible !important"}},{name:"BackstageOverflowTooltip"});function Dr(e){const[o,l]=(0,f.useState)(!1),d=(0,Wr.t)(),m=tr(),v=F=>{d()&&l(F)};var j;return(0,t.jsx)(P.ZP,{title:(j=e.title)!==null&&j!==void 0?j:e.text||"",placement:e.placement,disableHoverListener:!o,children:(0,t.jsx)(Po(),{text:e.text,line:e.line,onToggled:v,containerClassName:m.container})})}var Zr=r(67358);function no(e){const o=(0,ie.Z)(),[l,d]=(0,f.useState)(!1);return(0,f.useEffect)(()=>{const m=setTimeout(()=>d(!0),o.transitions.duration.short);return()=>clearTimeout(m)},[o.transitions.duration.short]),l?(0,t.jsx)(Zr.Z,{...e,"data-testid":"progress"}):(0,t.jsx)(w.Z,{display:"none"})}var Pr=r(94339),Vr=r(14503),Lo=r(24579),ro=r(32552),Sn=r(15459),oo=r(27597);const so=(0,g.Z)(e=>({root:{maxWidth:"fit-content",padding:e.spacing(2,2,2,2.5)},boxTitle:{margin:0,color:e.palette.textSubtle},arrow:{color:e.palette.textSubtle}}),{name:"BackstageBottomLink"});function io(e){const{link:o,title:l,onClick:d}=e,m=so();return(0,t.jsxs)(w.Z,{children:[(0,t.jsx)(at.Z,{}),(0,t.jsx)(ue.r,{to:o,onClick:d,underline:"none",children:(0,t.jsxs)(w.Z,{display:"flex",alignItems:"center",className:m.root,children:[(0,t.jsx)(w.Z,{className:m.boxTitle,fontWeight:"fontWeightBold",m:1,children:(0,t.jsx)(ct.Z,{children:(0,t.jsx)("strong",{children:l})})}),(0,t.jsx)(oo.Z,{className:m.arrow})]})})]})}const wr=e=>{const{slackChannel:o}=e;if(o){if(typeof o=="string")return(0,t.jsxs)(ct.Z,{children:["Please contact ",o," for help."]});if(!o.href)return(0,t.jsxs)(ct.Z,{children:["Please contact ",o.name," for help."]})}else return null;return(0,t.jsx)(K,{to:o.href,variant:"contained",children:o.name})},Oo=class extends f.Component{componentDidCatch(o,l){console.error(`ErrorBoundary, error: ${o}, info: ${l}`),this.setState({error:o,errorInfo:l})}render(){const{slackChannel:o,children:l}=this.props,{error:d}=this.state;return d?(0,t.jsx)(dt,{title:"Something Went Wrong",error:d,children:(0,t.jsx)(wr,{slackChannel:o})}):l}constructor(o){super(o),this.state={error:void 0,errorInfo:void 0}}},ao=(0,g.Z)(e=>({noPadding:{padding:0,"&:last-child":{paddingBottom:0}},header:{padding:e.spacing(2,2,2,2.5)},headerTitle:{fontWeight:e.typography.fontWeightBold},headerSubheader:{paddingTop:e.spacing(1)},headerAvatar:{},headerAction:{},headerContent:{},subheader:{display:"flex"}}),{name:"BackstageInfoCard"}),ko=(0,Sn.Z)(e=>({root:{display:"inline-block",padding:e.spacing(8,8,0,0),float:"right"}}),{name:"BackstageInfoCardCardActionsTopRight"})(Vr.Z),lo={card:{flex:{display:"flex",flexDirection:"column"},fullHeight:{display:"flex",flexDirection:"column",height:"100%"},gridItem:{display:"flex",flexDirection:"column",height:"calc(100% - 10px)",marginBottom:"10px"}},cardContent:{fullHeight:{flex:1},gridItem:{flex:1}}};function jr(e){const{title:o,subheader:l,divider:d=!0,deepLink:m,slackChannel:v,errorBoundaryProps:j,variant:F,children:G,headerStyle:U,headerProps:fe,icon:he,action:Pe,actionsClassName:Te,actions:Ue,cardClassName:_e,actionsTopRight:Vt,className:dn,noPadding:Dn,titleTypographyProps:rr}=e,$t=ao();let sn={},an={};F&&F.split(/[\s]+/g).forEach(vr=>{sn={...sn,...lo.card[vr]},an={...an,...lo.cardContent[vr]}});const dr=()=>!l&&!he?null:(0,t.jsxs)("div",{className:$t.headerSubheader,"data-testid":"info-card-subheader",children:[l&&(0,t.jsx)("div",{className:$t.subheader,children:l}),he]}),gr=j||(v?{slackChannel:v}:{});return(0,t.jsx)(Pr.Z,{style:sn,className:dn,children:(0,t.jsxs)(Oo,{...gr,children:[o&&(0,t.jsx)(ro.Z,{classes:{root:$t.header,title:$t.headerTitle,subheader:$t.headerSubheader,avatar:$t.headerAvatar,action:$t.headerAction,content:$t.headerContent},title:o,subheader:dr(),action:Pe,style:{...U},titleTypographyProps:rr,...fe}),Vt&&(0,t.jsx)(ko,{children:Vt}),d&&(0,t.jsx)(at.Z,{}),(0,t.jsx)(Lo.Z,{className:tn()(_e,{[$t.noPadding]:Dn}),style:an,children:G}),Ue&&(0,t.jsx)(Vr.Z,{className:Te,children:Ue}),m&&(0,t.jsx)(io,{...m})]})})}var us=r(39307);const co=(0,g.Z)(e=>({root:{position:"relative",lineHeight:0},overlay:{position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -60%)",fontSize:e.typography.pxToRem(45),fontWeight:e.typography.fontWeightBold,color:e.palette.textContrast},description:{fontSize:"100%",top:"50%",left:"50%",transform:"translate(-50%, -50%)",position:"absolute",wordBreak:"break-all",display:"inline-block"},circle:{width:"80%",transform:"translate(10%, 0)"},colorUnknown:{}}),{name:"BackstageGauge"}),hr={fractional:!0,inverse:!1,unit:"%",max:100},Lr=({palette:e,value:o,inverse:l,max:d})=>{if(isNaN(o))return"#ddd";const m=d||hr.max,v=l?m-o:o;return v<m/3?e.status.error:v<m*(2/3)?e.status.warning:e.status.ok};function Bo(e){const[o,l]=useState(null),{getColor:d=Lr}=e,m=co(e),{palette:v}=useTheme(),{value:j,fractional:F,inverse:G,unit:U,max:fe,description:he}={...hr,...e},Pe=F?Math.round(j*fe):j,Te=fe!==100?Math.round(j):Pe,[Ue,_e]=useState(!1);return useEffect(()=>{const Vt=o,dn=()=>_e(!0),Dn=()=>_e(!1);return Vt&&he?(Vt.addEventListener("mouseenter",dn),Vt.addEventListener("mouseleave",Dn),()=>{Vt.removeEventListener("mouseenter",dn),Vt.removeEventListener("mouseleave",Dn)}):()=>{_e(!1)}},[he,o]),_jsxs(Box,{ref:l,className:m.root,children:[_jsx(Circle,{strokeLinecap:"butt",percent:Pe,strokeWidth:12,trailWidth:12,strokeColor:d({palette:v,value:Te,inverse:G,max:fe}),className:m.circle}),he&&Ue?_jsx(Box,{className:m.description,children:he}):_jsx(Box,{className:m.overlay,children:isNaN(j)?"N/A":`${Te}${U}`})]})}const Yn=(0,g.Z)({root:{height:"100%",width:250}},{name:"BackstageGaugeCard"});function Gs(e){const o=Yn(e),{title:l,subheader:d,progress:m,inverse:v,deepLink:j,description:F,icon:G,variant:U,getColor:fe}=e,he={inverse:v,description:F,getColor:fe,value:m};return _jsx(Box,{className:o.root,children:_jsx(InfoCard,{title:l,subheader:d,deepLink:j,variant:U,icon:G,children:_jsx(Gauge,{...he})})})}function $o(e){const{value:o,getColor:l=getProgressColor}=e,{palette:d}=useTheme();if(isNaN(o))return null;let m=Math.round(o*100*100)/100;m>100&&(m=100);const v=l({palette:d,value:m,inverse:!1,max:100});return _jsx(Tooltip,{title:`${m}%`,children:_jsx(Typography,{component:"span",children:_jsx(Line,{percent:m,strokeWidth:4,trailWidth:4,strokeColor:v})})})}var hs=r(21324),ps=r(7089),uo=r(42494),fs=r(74603),gs=r(56939),sr=r(12231),Do=r(73698),Wn=r(12420),ho=r(72379);const Zo=(0,g.Z)(e=>(0,Wn.Z)({icon:{position:"absolute",right:e.spacing(.5),pointerEvents:"none"}}),{name:"BackstageClosedDropdown"});var No=()=>{const e=Zo();return(0,t.jsx)(ho.Z,{className:e.icon,fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,t.jsx)("path",{d:"M7.5 8L6 9.5L12.0703 15.5703L18.1406 9.5L16.6406 8L12.0703 12.5703L7.5 8Z",fill:"#616161"})})};const Fo=(0,g.Z)(e=>(0,Wn.Z)({icon:{position:"absolute",right:e.spacing(.5),pointerEvents:"none"}}),{name:"BackstageOpenedDropdown"});var Uo=()=>{const e=Fo();return(0,t.jsx)(ho.Z,{className:e.icon,fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,t.jsx)("path",{d:"M16.5 16L18 14.5L11.9297 8.42969L5.85938 14.5L7.35938 16L11.9297 11.4297L16.5 16Z",fill:"#616161"})})};const po=(0,Sn.Z)(e=>(0,Wn.Z)({root:{"label + &":{marginTop:e.spacing(3)}},input:{borderRadius:e.shape.borderRadius,position:"relative",backgroundColor:e.palette.background.paper,border:"1px solid #ced4da",fontSize:e.typography.body1.fontSize,padding:e.spacing(1.25,3.25,1.25,1.5),transition:e.transitions.create(["border-color","box-shadow"]),fontFamily:"Helvetica Neue","&:focus":{background:e.palette.background.paper,borderRadius:e.shape.borderRadius}}}),{name:"BackstageSelectInputBase"})(fs.Z),x=(0,g.Z)(e=>(0,Wn.Z)({formControl:{margin:`${e.spacing(1)} 0px`,maxWidth:300},label:{transform:"initial",fontWeight:"bold",fontSize:e.typography.body2.fontSize,fontFamily:e.typography.fontFamily,color:e.palette.text.primary,"&.Mui-focused":{color:e.palette.text.primary}},formLabel:{transform:"initial",fontWeight:"bold",fontSize:e.typography.body2.fontSize,fontFamily:e.typography.fontFamily,color:e.palette.text.primary,"&.Mui-focused":{color:e.palette.text.primary}},chips:{display:"flex",flexWrap:"wrap"},chip:{margin:2},checkbox:{},root:{display:"flex",flexDirection:"column"}}),{name:"BackstageSelect"});function C(e){const{multiple:o,items:l,label:d,placeholder:m,selected:v,onChange:j,triggerReset:F,native:G=!1,disabled:U=!1,margin:fe}=e,he=x(),[Pe,Te]=(0,f.useState)(v||(o?[]:"")),[Ue,_e]=(0,f.useState)(!1);(0,f.useEffect)(()=>{Te(o?[]:"")},[F,o]),(0,f.useEffect)(()=>{Te(v||(o?[]:""))},[v,o]);const Vt=$t=>{Te($t.target.value),j($t.target.value)},dn=$t=>{if(U){$t.preventDefault();return}_e(sn=>o&&!($t.target instanceof HTMLElement)?!0:!sn)},Dn=()=>{_e(!1)},rr=$t=>()=>{const sn=Pe.filter(an=>an!==$t);Te(sn),j(sn)};return(0,t.jsx)(w.Z,{className:he.root,children:(0,t.jsxs)(uo.Z,{className:he.formControl,children:[(0,t.jsx)(gs.Z,{className:he.formLabel,children:d}),(0,t.jsxs)(Do.Z,{"aria-label":d,value:Pe,native:G,disabled:U,"data-testid":"select",displayEmpty:!0,multiple:o,margin:fe,onChange:Vt,open:Ue,onOpen:dn,onClose:Dn,input:(0,t.jsx)(po,{}),label:d,tabIndex:0,renderValue:$t=>{var sn;return o&&Pe.length!==0?(0,t.jsx)(w.Z,{className:he.chips,children:$t.map(an=>{var dr,gr;return(0,t.jsx)(ps.Z,{label:(dr=l.find(mr=>mr.value===an))===null||dr===void 0?void 0:dr.label,clickable:!0,onDelete:rr(an),className:he.chip},(gr=l.find(mr=>mr.value===an))===null||gr===void 0?void 0:gr.value)})}):(0,t.jsx)(ct.Z,{children:Pe.length===0?m||"":(sn=l.find(an=>an.value===$t))===null||sn===void 0?void 0:sn.label})},IconComponent:()=>Ue?(0,t.jsx)(Uo,{}):(0,t.jsx)(No,{}),MenuProps:{anchorOrigin:{vertical:"bottom",horizontal:"left"},transformOrigin:{vertical:"top",horizontal:"left"},getContentAnchorEl:null},children:[m&&!o&&(0,t.jsx)(sr.Z,{value:[],children:m}),G?l&&l.map($t=>(0,t.jsx)("option",{value:$t.value,children:$t.label},$t.value)):l&&l.map($t=>(0,t.jsxs)(sr.Z,{value:$t.value,children:[o&&(0,t.jsx)(hs.Z,{color:"primary",checked:Pe.includes($t.value)||!1,className:he.checkbox}),$t.label]},$t.value))]})]})})}const R=()=>{},N=f.createContext({stepperLength:0,stepIndex:0,setStepIndex:R,stepHistory:[],setStepHistory:R,onStepChange:R});function re(e){const{children:o,elevated:l,onStepChange:d,activeStep:m=0}=e,[v,j]=useState(m),[F,G]=useState([0]);useEffect(()=>{j(m)},[m]);const U=[];let fe;return Children.forEach(o,he=>{isValidElement(he)&&(he.props.end?fe=he:U.push(he))}),_jsxs(_Fragment,{children:[_jsx(N.Provider,{value:{stepIndex:v,setStepIndex:j,stepHistory:F,setStepHistory:G,onStepChange:d,stepperLength:Children.count(o)},children:_jsx(MuiStepper,{activeStep:v,orientation:"vertical",elevation:l?2:0,children:U})}),v>=Children.count(o)-1&&fe]})}const de=(0,g.Z)(e=>({root:{marginTop:e.spacing(3),"& button":{marginRight:e.spacing(1)}}}),{name:"BackstageSimpleStepperFooter"}),X=({text:e,handleClick:o})=>_jsx(Button,{onClick:o,children:e||"Reset"}),ye=({text:e,handleClick:o,disabled:l,last:d,stepIndex:m})=>_jsx(Button,{variant:"contained",color:"primary",disabled:l,"data-testid":`nextButton-${m}`,onClick:o,children:e||(d?"Finish":"Next")}),Ee=({text:e,handleClick:o,disabled:l,stepIndex:d})=>_jsx(Button,{variant:"outlined",color:"primary",disabled:l,"data-testid":`skipButton-${d}`,onClick:o,children:e||"Skip"}),Re=({text:e,handleClick:o,disabled:l,stepIndex:d})=>_jsx(Button,{onClick:o,"data-testid":`backButton-${d}`,disabled:l,children:e||"Back"}),Ze=({actions:e={},children:o})=>{const l=de(),{stepperLength:d,stepIndex:m,setStepIndex:v,stepHistory:j,setStepHistory:F,onStepChange:G}=useContext(VerticalStepperContext),U=(Te,Ue)=>{Ue&&Ue(),G&&G(m,Te),v(Te)},fe=()=>{const Te=e.nextStep?e.nextStep(m,d-1):m+1;U(Te,e.onNext),F([...j,Te])},he=()=>{j.pop(),U(j[j.length-1],e.onBack),F([...j])},Pe=()=>{U(0,e.onRestart),F([0])};return _jsxs(Box,{className:l.root,children:[[void 0,!0].includes(e.showBack)&&m!==0&&_jsx(Re,{text:e.backText,handleClick:he,disabled:m===0,stepIndex:m}),e.showSkip&&_jsx(Ee,{text:e.skipText,handleClick:fe,disabled:!!d&&m>=d||!!e.canSkip&&!e.canSkip(),stepIndex:m}),[void 0,!0].includes(e.showNext)&&_jsx(ye,{text:e.nextText,handleClick:fe,disabled:!!d&&m>=d||!!e.canNext&&!e.canNext(),stepIndex:m}),e.showRestart&&m!==0&&_jsx(X,{text:e.restartText,handleClick:Pe,stepIndex:m}),o]})},Ne=(0,g.Z)(e=>({end:{padding:e.spacing(3)}}),{name:"SimpleStepperStep"});function rt(e){const{title:o,children:l,end:d,actions:m,...v}=e,j=Ne();return d?_jsxs(Box,{className:j.end,children:[_jsx(Typography,{variant:"h6",children:o}),l,_jsx(SimpleStepperFooter,{actions:{...m||{},showNext:!1}})]}):_jsxs(MuiStep,{...v,children:[_jsx(StepLabel,{children:_jsx(Typography,{variant:"h6",children:o})}),_jsxs(StepContent,{children:[l,_jsx(SimpleStepperFooter,{actions:m})]})]})}const qe=(0,g.Z)(e=>({status:{fontWeight:e.typography.fontWeightMedium,"&::before":{width:"0.7em",height:"0.7em",display:"inline-block",marginRight:e.spacing(1),borderRadius:"50%",content:'""'}},ok:{"&::before":{backgroundColor:e.palette.status.ok}},warning:{"&::before":{backgroundColor:e.palette.status.warning}},error:{"&::before":{backgroundColor:e.palette.status.error}},pending:{"&::before":{backgroundColor:e.palette.status.pending}},running:{"&::before":{backgroundColor:e.palette.status.running}},aborted:{"&::before":{backgroundColor:e.palette.status.aborted}}}),{name:"BackstageStatus"});function Ge(e){const o=qe(e);return _jsx(Typography,{component:"span",className:classNames(o.status,o.ok),"aria-label":"Status ok","aria-hidden":"true",...e})}function Be(e){const o=qe(e);return _jsx(Typography,{component:"span",className:classNames(o.status,o.warning),"aria-label":"Status warning","aria-hidden":"true",...e})}function Je(e){const o=qe(e);return _jsx(Typography,{component:"span",className:classNames(o.status,o.error),"aria-label":"Status error","aria-hidden":"true",...e})}function At(e){const o=qe(e);return _jsx(Typography,{component:"span",className:classNames(o.status,o.pending),"aria-label":"Status pending","aria-hidden":"true",...e})}function cn(e){const o=qe(e);return _jsx(Typography,{component:"span",className:classNames(o.status,o.running),"aria-label":"Status running","aria-hidden":"true",...e})}function qt(e){const o=qe(e);return _jsx(Typography,{component:"span",className:classNames(o.status,o.aborted),"aria-label":"Status aborted","aria-hidden":"true",...e})}var on=r(74600),nn=r(15584);const An=e=>(0,Wn.Z)({root:{fontWeight:e.typography.fontWeightBold,whiteSpace:"nowrap",paddingRight:e.spacing(4),border:"0",verticalAlign:"top"}}),Rn={root:{border:"0",verticalAlign:"top"}},Er=e=>(0,Wn.Z)({root:{margin:e.spacing(0,0,-1,0)}}),Nr=e=>(0,Wn.Z)({root:{padding:e.spacing(0,0,1,0)},random:{}}),Gr=(0,Sn.Z)(An,{name:"BackstageMetadataTableTitleCell"})(nn.Z),In=(0,Sn.Z)(Rn,{name:"BackstageMetadataTableCell"})(nn.Z),Vn=({dense:e,children:o})=>_jsx(Table,{size:e?"small":"medium",children:_jsx(TableBody,{children:o})}),Or=({title:e,children:o,...l})=>_jsxs(TableRow,{children:[e&&_jsx(Gr,{children:e}),_jsx(In,{colSpan:e?1:2,...l,children:o})]}),Mo=(0,Sn.Z)(Er,{name:"BackstageMetadataTableList"})(({classes:e,children:o})=>(0,t.jsx)(kt.Z,{disablePadding:!0,className:e.root,children:o})),Fi=(0,Sn.Z)(Nr,{name:"BackstageMetadataTableListItem"})(({classes:e,children:o})=>(0,t.jsx)(Ft.Z,{className:e.root,children:o})),vs=(0,Wn.Z)({root:{margin:"0 0",listStyleType:"none"}}),Ks=e=>(0,Wn.Z)({root:{...vs.root,paddingLeft:e.spacing(1)}}),ys=(0,Sn.Z)(vs,{name:"BackstageStructuredMetadataTableList"})(({classes:e,children:o})=>(0,t.jsx)(Mo,{classes:e,children:o})),zo=(0,Sn.Z)(Ks,{name:"BackstageStructuredMetadataTableNestedList"})(({classes:e,children:o})=>(0,t.jsx)(Mo,{classes:e,children:o}));function ir(e,o){const l=e.map((d,m)=>_jsx(MetadataListItem,{children:Jn(d)},m));return o?_jsx(zo,{children:l}):_jsx(ys,{children:l})}function ar(e,o,l){const d=Object.keys(e).map(m=>{const v=Jn(e[m],!0),j=l&&l.titleFormat?l.titleFormat(m):startCase(m);return _jsxs(MetadataListItem,{children:[_jsx(Typography,{variant:"body2",component:"span",children:`${j}: `}),v]},m)});return o?_jsx(zo,{children:d}):_jsx(ys,{children:d})}function Jn(e,o,l){return React.isValidElement(e)?_jsx(Fragment,{children:e}):typeof e=="object"&&!Array.isArray(e)?ar(e,o,l):Array.isArray(e)?ir(e,l):typeof e=="boolean"?_jsx(Fragment,{children:e?"\u2705":"\u274C"}):_jsx(Typography,{variant:"body2",component:"span",children:e})}const Wo=({value:e,options:o})=>_jsx(Fragment,{children:Jn(e,o)}),Ys=({title:e,value:o,options:l})=>_jsx(MetadataTableItem,{title:l&&l.titleFormat?l.titleFormat(e):startCase(e),children:_jsx(Wo,{value:o,options:l})});function Js(e,o){return Object.keys(e).map(l=>_jsx(Ys,{title:l,value:e[l],options:o},l))}function Ui(e){const{metadata:o,dense:l=!0,options:d}=e,m=Js(o,d||{});return _jsx(MetadataTable,{dense:l,children:m})}var Qs=r(49429),xs=r(86136),Vo=r(79784),Kr=r(76635),Xs=r(19126),bs=r.n(Xs);function _s(e){return qs.stringify(e,{strictNullHandling:!0})}function Ho(e){return qs.parse(e,{ignoreQueryPrefix:!0,strictNullHandling:!0})}function Go(e,o){return Ho(e)[o]}function ei(e,o,l){const d={...Ho(e),[o]:l};return _s(d)}function Mi(e,o=250){const[l,d]=useSearchParams(),m=l.toString(),[v,j]=useState(Go(m,e));return useEffect(()=>{const F=Go(m,e);j(G=>isEqual(F,G)?G:F)},[m,j,e]),useDebouncedEffect(()=>{const F=ei(m,e,v);m!==F&&d(F,{replace:!0})},[d,v,m,e],o),[v,j]}const fo={url:"https://github.com/backstage/backstage/issues",items:[{title:"Support Not Configured",icon:"warning",links:[{title:"Add `app.support` config key",url:"https://github.com/backstage/backstage/blob/master/app-config.yaml"}]}]};function Ko(){const o=(0,h.I_)().get(h.Ds),l=o==null?void 0:o.getOptionalConfig("app.support");if(!l)return fo;var d;return{url:l.getString("url"),items:l.getConfigArray("items").flatMap(m=>({title:m.getString("title"),icon:m.getOptionalString("icon"),links:((d=m.getOptionalConfigArray("links"))!==null&&d!==void 0?d:[]).flatMap(v=>({url:v.getString("url"),title:v.getString("title")}))}))}}var ti=r(80079);function nr(e,o){const d=(0,h.qD)().getSystemIcon(e);return d?(0,t.jsx)(d,{...o}):(0,t.jsx)(ti.Z,{...o})}function Aa(e){return nr("brokenImage",e)}function Yr(e){return nr("catalog",e)}function zi(e){return nr("chat",e)}function Hn(e){return nr("dashboard",e)}function Ta(e){return nr("docs",e)}function Ra(e){return nr("email",e)}function Ia(e){return nr("github",e)}function Wi(e){return nr("group",e)}function Yo(e){return nr("help",e)}function Pa(e){return nr("user",e)}function Ss(e){return nr("warning",e)}const ni=(0,g.Z)({popoverList:{minWidth:260,maxWidth:400}},{name:"BackstageSupportButton"}),go=({icon:e})=>{const o=(0,h.qD)();var l;const d=e&&(l=o.getSystemIcon(e))!==null&&l!==void 0?l:Yo;return(0,t.jsx)(d,{})};var Fr;const mo=({link:e})=>(0,t.jsx)(ue.r,{to:e.url,children:(Fr=e.title)!==null&&Fr!==void 0?Fr:e.url}),ri=({item:e})=>{var o;return(0,t.jsxs)(Ft.Z,{children:[(0,t.jsx)(xs.Z,{children:(0,t.jsx)(go,{icon:e.icon})}),(0,t.jsx)(Qt.Z,{primary:e.title,secondary:(o=e.links)===null||o===void 0?void 0:o.reduce((l,d,m)=>[...l,m>0&&(0,t.jsx)("br",{},m),(0,t.jsx)(mo,{link:d},d.url)],[])})]})};function Cs(e){const{title:o,items:l,children:d}=e,{items:m}=Ko(),[v,j]=(0,f.useState)(!1),[F,G]=(0,f.useState)(null),U=ni(),fe=(0,ze.Z)(Te=>Te.breakpoints.down("sm")),he=Te=>{G(Te.currentTarget),j(!0)},Pe=()=>{j(!1)};return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(w.Z,{display:"flex",ml:1,children:fe?(0,t.jsx)(T.Z,{color:"primary",size:"small",onClick:he,"data-testid":"support-button","aria-label":"Support",children:(0,t.jsx)(Yo,{})}):(0,t.jsx)(ve.Z,{"data-testid":"support-button","aria-label":"Support",color:"primary",onClick:he,startIcon:(0,t.jsx)(Yo,{}),children:"Support"})}),(0,t.jsxs)(Vo.ZP,{"data-testid":"support-button-popover",open:v,anchorEl:F,anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"},onClose:Pe,children:[(0,t.jsxs)(kt.Z,{className:U.popoverList,children:[o&&(0,t.jsx)(Ft.Z,{alignItems:"flex-start",children:(0,t.jsx)(ct.Z,{variant:"subtitle1",children:o})}),f.Children.map(d,(Te,Ue)=>(0,t.jsx)(Ft.Z,{alignItems:"flex-start",children:Te},`child-${Ue}`)),(l!=null?l:m).map((Te,Ue)=>(0,t.jsx)(ri,{item:Te},`item-${Ue}`))]}),(0,t.jsx)(Qs.Z,{children:(0,t.jsx)(ve.Z,{color:"primary",onClick:Pe,"aria-label":"Close",children:"Close"})})]})]})}var vo=r(18671),lr=r(73557),Jo=r(84800);const yo=72,ws=24,js=18,Ar={drawerWidthClosed:yo,drawerWidthOpen:224,defaultOpenDelayMs:100,defaultCloseDelayMs:0,defaultFadeDuration:200,logoHeight:32,iconContainerWidth:yo,iconSize:yo-ws*2,iconPadding:ws,selectedIndicatorWidth:3,userBadgePadding:js,userBadgeDiameter:yo-js*2,mobileSidebarHeight:56},oi=e=>({...Ar,...e,iconContainerWidth:Ar.drawerWidthClosed,iconSize:Ar.drawerWidthClosed-Ar.iconPadding*2,userBadgeDiameter:Ar.drawerWidthClosed-Ar.userBadgePadding*2}),Es={drawerWidthClosed:0,drawerWidthOpen:202,defaultOpenDelayMs:Ar.defaultOpenDelayMs+200},Qo=e=>({...Es,...e}),Vi="@backstage/core/sidebar-intro-dismissed",cr=(0,f.createContext)({sidebarConfig:Ar,submenuConfig:Es}),Xo=(0,f.createContext)({isHoveredOn:!1,setIsHoveredOn:()=>{}});var si=r(50023),ii=r(4190),ai=r(87685),li=r(44882),qo=r(51837);const As={isOpen:!1,setOpen:()=>{}},Ts=(0,f.createContext)(As),Rs=(0,qo.CT)("sidebar-open-state-context");function Is(e){const{children:o,value:l}=e;return(0,t.jsx)(Ts.Provider,{value:l,children:(0,t.jsx)(Rs.Provider,{value:(0,qo.EI)({1:l}),children:o})})}const xo=()=>{const e=(0,f.useContext)(Rs),o=(0,f.useContext)(Ts);if(e===void 0)return o||As;const l=e.atVersion(1);if(l===void 0)throw new Error("No context found for version 1.");return l};var _o=r(57998);const Ps={isPinned:!0,toggleSidebarPinState:()=>{},isMobile:!1},Ls=(0,f.createContext)(Ps),Os=(0,qo.CT)("sidebar-pin-state-context");function ci(e){const{children:o,value:l}=e;return(0,t.jsx)(Ls.Provider,{value:l,children:(0,t.jsx)(Os.Provider,{value:(0,qo.EI)({1:l}),children:o})})}const es=()=>{const e=(0,f.useContext)(Os),o=(0,f.useContext)(Ls);if(e===void 0)return o||Ps;const l=e.atVersion(1);if(l===void 0)throw new Error("No context found for version 1.");return l},bo=(0,g.Z)(e=>({root:{flexGrow:0,margin:e.spacing(0,2),color:e.palette.navigation.color},selected:o=>({color:`${e.palette.navigation.selectedColor}!important`,borderTop:`solid ${o.sidebarConfig.selectedIndicatorWidth}px ${e.palette.navigation.indicator}`,marginTop:"-1px"}),label:{display:"none"}})),Hi=e=>{const{to:o,label:l,icon:d,value:m}=e,{sidebarConfig:v}=(0,f.useContext)(cr),j=bo({sidebarConfig:v}),F=(0,lr.TH)(),{selectedMenuItemIndex:G,setSelectedMenuItemIndex:U}=(0,f.useContext)(hi),fe=(Pe,Te)=>{U(Te===G?-1:Te)},he=m===G&&G>=0||m!==G&&!(G>=0)&&o===F.pathname;return(0,t.jsx)(_o.Z,{"aria-label":l,label:l,icon:d,component:ue.r,to:o||F.pathname,onChange:fe,value:m,selected:he,classes:j})},di=e=>{const{children:o,to:l,label:d,icon:m,value:v}=e,{isMobile:j}=es();return j?(0,t.jsx)(Hi,{to:l,label:d,icon:m,value:v}):(0,t.jsx)(t.Fragment,{children:o})},ks=(0,g.Z)(e=>({root:{position:"fixed",backgroundColor:e.palette.navigation.background,color:e.palette.navigation.color,bottom:0,left:0,right:0,zIndex:e.zIndex.snackbar,borderTop:"1px solid #383838"},overlay:o=>({background:e.palette.navigation.background,width:"100%",bottom:`${o.sidebarConfig.mobileSidebarHeight}px`,height:`calc(100% - ${o.sidebarConfig.mobileSidebarHeight}px)`,flex:"0 1 auto",overflow:"auto"}),overlayHeader:{display:"flex",color:e.palette.text.primary,alignItems:"center",justifyContent:"space-between",padding:e.spacing(2,3)},overlayHeaderClose:{color:e.palette.text.primary},marginMobileSidebar:o=>({marginBottom:`${o.sidebarConfig.mobileSidebarHeight}px`})})),ui=e=>(0,Kr.orderBy)(e,({props:{priority:o}})=>Number.isInteger(o)?o:-1,"desc"),Bs=f.createElement(di).type,Gi=({children:e,label:o="Menu",open:l,onClose:d})=>{const{sidebarConfig:m}=(0,f.useContext)(cr),v=ks({sidebarConfig:m});return(0,t.jsxs)(ii.ZP,{anchor:"bottom",open:l,onClose:d,ModalProps:{BackdropProps:{classes:{root:v.marginMobileSidebar}}},classes:{root:v.marginMobileSidebar,paperAnchorBottom:v.overlay},children:[(0,t.jsxs)(w.Z,{className:v.overlayHeader,children:[(0,t.jsx)(ct.Z,{variant:"h3",children:o}),(0,t.jsx)(T.Z,{onClick:d,classes:{root:v.overlayHeaderClose},children:(0,t.jsx)(ai.Z,{})})]}),(0,t.jsx)(w.Z,{component:"nav",children:e})]})},hi=(0,f.createContext)({selectedMenuItemIndex:-1,setSelectedMenuItemIndex:()=>{}}),$s=e=>{const{sidebarConfig:o}=(0,f.useContext)(cr),{children:l}=e,d=ks({sidebarConfig:o}),m=(0,lr.TH)(),[v,j]=(0,f.useState)(-1);(0,f.useEffect)(()=>{j(-1)},[m.pathname]);let F=(0,h.vJ)(l,U=>U.getElements().filter(fe=>fe.type===Bs));if(l)F.length?F=ui(F):F.push((0,t.jsx)(di,{icon:(0,t.jsx)(li.Z,{}),children:l},"default_menu"));else return null;const G=v>=0&&!F[v].props.to;return(0,t.jsx)(Is,{value:{isOpen:!0,setOpen:()=>{}},children:(0,t.jsxs)(hi.Provider,{value:{selectedMenuItemIndex:v,setSelectedMenuItemIndex:j},children:[(0,t.jsx)(Gi,{label:F[v]&&F[v].props.label,open:G,onClose:()=>j(-1),children:F[v]&&F[v].props.children}),(0,t.jsx)(si.Z,{className:d.root,"data-testid":"mobile-sidebar-root",component:"nav",children:F})]})})};var Jr;(function(e){e.SIDEBAR_PIN_STATE="sidebarPinState"})(Jr||(Jr={}));const Ds={getSidebarPinState(){let e;try{e=JSON.parse(window.localStorage.getItem(Jr.SIDEBAR_PIN_STATE)||"true")}catch{return!0}return!!e},setSidebarPinState(e){return window.localStorage.setItem(Jr.SIDEBAR_PIN_STATE,JSON.stringify(e))}},pi=(0,g.Z)(e=>({root:{width:"100%",transition:"padding-left 0.1s ease-out",isolation:"isolate",[e.breakpoints.up("sm")]:{paddingLeft:o=>o.isPinned?o.sidebarConfig.drawerWidthOpen:o.sidebarConfig.drawerWidthClosed},[e.breakpoints.down("xs")]:{paddingBottom:o=>o.sidebarConfig.mobileSidebarHeight}},content:{zIndex:0,isolation:"isolate","&:focus":{outline:0}}}),{name:"BackstageSidebarPage"}),Qr=(0,f.createContext)({content:{contentRef:void 0}});function Ki(e){const[o,l]=(0,f.useState)(()=>Ds.getSidebarPinState()),{sidebarConfig:d}=(0,f.useContext)(cr),m=(0,f.useRef)(null),v=(0,f.useMemo)(()=>({content:{contentRef:m}}),[m]);(0,f.useEffect)(()=>{Ds.setSidebarPinState(o)},[o]);const j=(0,ze.Z)(U=>U.breakpoints.down("xs"),{noSsr:!0}),F=()=>l(!o),G=pi({isPinned:o,sidebarConfig:d});return(0,t.jsx)(ci,{value:{isPinned:o,toggleSidebarPinState:F,isMobile:j},children:(0,t.jsx)(Qr.Provider,{value:v,children:(0,t.jsx)(w.Z,{className:G.root,children:e.children})})})}function fi(){const{content:e}=(0,f.useContext)(Qr);return{focusContent:(0,f.useCallback)(()=>{var l,d;e==null||(l=e.contentRef)===null||l===void 0||(d=l.current)===null||d===void 0||d.focus()},[e]),contentRef:e==null?void 0:e.contentRef}}const gi=(0,g.Z)(e=>({drawer:{display:"flex",flexFlow:"column nowrap",alignItems:"flex-start",position:"fixed",left:0,top:0,bottom:0,zIndex:e.zIndex.appBar,background:e.palette.navigation.background,overflowX:"hidden",msOverflowStyle:"none",scrollbarWidth:"none",transition:e.transitions.create("width",{easing:e.transitions.easing.sharp,duration:e.transitions.duration.shortest}),"& > *":{flexShrink:0},"&::-webkit-scrollbar":{display:"none"}},drawerWidth:o=>({width:o.sidebarConfig.drawerWidthClosed}),drawerOpen:o=>({width:o.sidebarConfig.drawerWidthOpen,transition:e.transitions.create("width",{easing:e.transitions.easing.sharp,duration:e.transitions.duration.shorter})}),visuallyHidden:{top:0,position:"absolute",zIndex:1e3,transform:"translateY(-200%)","&:focus":{transform:"translateY(5px)"}}}),{name:"BackstageSidebar"});var Qn;(function(e){e[e.Closed=0]="Closed",e[e.Idle=1]="Idle",e[e.Open=2]="Open"})(Qn||(Qn={}));const mi=e=>{const{sidebarConfig:o}=(0,f.useContext)(cr),{openDelayMs:l=o.defaultOpenDelayMs,closeDelayMs:d=o.defaultCloseDelayMs,disableExpandOnHover:m,children:v}=e,j=gi({sidebarConfig:o}),F=(0,ze.Z)(dn=>dn.breakpoints.down("md"),{noSsr:!0}),[G,U]=(0,f.useState)(Qn.Closed),fe=(0,f.useRef)(),{isPinned:he,toggleSidebarPinState:Pe}=es(),Te=()=>{he||m||(fe.current&&(clearTimeout(fe.current),fe.current=void 0),G!==Qn.Open&&!F&&(fe.current=window.setTimeout(()=>{fe.current=void 0,U(Qn.Open)},l),U(Qn.Idle)))},Ue=()=>{he||m||(fe.current&&(clearTimeout(fe.current),fe.current=void 0),G===Qn.Idle?U(Qn.Closed):G===Qn.Open&&(fe.current=window.setTimeout(()=>{fe.current=void 0,U(Qn.Closed)},d)))},_e=G===Qn.Open&&!F||he,Vt=dn=>{dn?(U(Qn.Open),Pe()):(U(Qn.Closed),Pe())};return(0,t.jsxs)("nav",{style:{},"aria-label":"sidebar nav",children:[(0,t.jsx)(Yi,{}),(0,t.jsx)(Is,{value:{isOpen:_e,setOpen:Vt},children:(0,t.jsx)(w.Z,{className:j.root,"data-testid":"sidebar-root",onMouseEnter:m?()=>{}:Te,onFocus:m?()=>{}:Te,onMouseLeave:m?()=>{}:Ue,onBlur:m?()=>{}:Ue,children:(0,t.jsx)(w.Z,{className:tn()(j.drawer,j.drawerWidth,{[j.drawerOpen]:_e}),children:v})})})]})},Bn=e=>{var o;const l=oi((o=e.sidebarOptions)!==null&&o!==void 0?o:{});var d;const m=Qo((d=e.submenuOptions)!==null&&d!==void 0?d:{}),{children:v,disableExpandOnHover:j,openDelayMs:F,closeDelayMs:G}=e,{isMobile:U}=es();return U?(0,t.jsx)($s,{children:v}):(0,t.jsx)(cr.Provider,{value:{sidebarConfig:l,submenuConfig:m},children:(0,t.jsx)(mi,{openDelayMs:F,closeDelayMs:G,disableExpandOnHover:j,children:v})})};function Yi(){const{sidebarConfig:e}=(0,f.useContext)(cr),{focusContent:o,contentRef:l}=fi(),d=gi({sidebarConfig:e});return l!=null&&l.current?(0,t.jsx)(ve.Z,{onClick:o,variant:"contained",className:tn()(d.visuallyHidden),children:"Skip to content"}):null}function Zs(e,o){const l=new URLSearchParams(o.search).toString(),d=bs().parse(l),m=new URLSearchParams(e.search).toString(),v=bs().parse(m);return(0,Kr.isEqual)(o.pathname,e.pathname)&&(0,Kr.isMatch)(v,d)}const Ji=(0,g.Z)(e=>{var o,l;return{item:{height:48,width:"100%","&:hover":{background:((o=e.palette.navigation.navItem)===null||o===void 0?void 0:o.hoverBackground)||"#6f6f6f",color:e.palette.navigation.selectedColor},display:"flex",alignItems:"center",color:e.palette.navigation.color,padding:e.spacing(2.5),cursor:"pointer",position:"relative",background:"none",border:"none"},itemContainer:{width:"100%"},selected:{background:"#6f6f6f",color:e.palette.common.white},label:{margin:e.spacing(1.75),marginLeft:e.spacing(1),fontSize:e.typography.body2.fontSize,whiteSpace:"nowrap",overflow:"hidden","text-overflow":"ellipsis",lineHeight:1},subtitle:{fontSize:10,whiteSpace:"nowrap",overflow:"hidden","text-overflow":"ellipsis"},dropdownArrow:{position:"absolute",right:21},dropdown:{display:"flex",flexDirection:"column",alignItems:"end"},dropdownItem:{width:"100%",padding:"10px 0 10px 0","&:hover":{background:((l=e.palette.navigation.navItem)===null||l===void 0?void 0:l.hoverBackground)||"#6f6f6f",color:e.palette.navigation.selectedColor}},textContent:{color:e.palette.navigation.color,paddingLeft:e.spacing(4),paddingRight:e.spacing(1),fontSize:e.typography.body2.fontSize,whiteSpace:"nowrap",overflow:"hidden","text-overflow":"ellipsis"}}},{name:"BackstageSidebarSubmenuItem"}),La=e=>{const{title:o,subtitle:l,to:d,icon:m,dropdownItems:v}=e,j=Ji(),{setIsHoveredOn:F}=useContext(SidebarItemWithSubmenuContext),G=()=>{F(!1)},U=useResolvedPath(d!=null?d:""),fe=useLocation();let he=isLocationMatch(fe,U);const[Pe,Te]=useState(!1),Ue=()=>{Te(!Pe)};return v!==void 0?(v.some(_e=>{const Vt=resolvePath(_e.to);return he=isLocationMatch(fe,Vt),he}),_jsxs(Box,{className:j.itemContainer,children:[_jsx(Tooltip,{title:o,enterDelay:500,enterNextDelay:500,children:_jsxs(Button,{role:"button",onClick:Ue,onTouchStart:_e=>_e.stopPropagation(),className:classnames(j.item,he?j.selected:void 0),children:[m&&_jsx(m,{fontSize:"small"}),_jsxs(Typography,{variant:"subtitle1",className:j.label,children:[o,_jsx("br",{}),l&&_jsx(Typography,{variant:"caption",className:j.subtitle,children:l})]}),Pe?_jsx(ArrowDropUpIcon,{className:j.dropdownArrow}):_jsx(ArrowDropDownIcon,{className:j.dropdownArrow})]})}),v&&Pe&&_jsx(Box,{className:j.dropdown,children:v.map((_e,Vt)=>_jsx(Tooltip,{title:_e.title,enterDelay:500,enterNextDelay:500,children:_jsx(Link,{to:_e.to,underline:"none",className:j.dropdownItem,onClick:G,onTouchStart:dn=>dn.stopPropagation(),children:_jsx(Typography,{className:j.textContent,children:_e.title})})},Vt))})]})):_jsx(Box,{className:j.itemContainer,children:_jsx(Tooltip,{title:o,enterDelay:500,enterNextDelay:500,children:_jsxs(Link,{to:d,underline:"none",className:classnames(j.item,he?j.selected:void 0),onClick:G,onTouchStart:_e=>_e.stopPropagation(),children:[m&&_jsx(m,{fontSize:"small"}),_jsxs(Typography,{variant:"subtitle1",className:j.label,children:[o,_jsx("br",{}),l&&_jsx(Typography,{variant:"caption",className:j.subtitle,children:l})]})]})})})};var Ns;const Qi=(0,g.Z)(e=>({root:{zIndex:1e3,position:"relative",overflow:"visible",width:e.spacing(7)+1},drawer:o=>{var l;return{display:"flex",flexFlow:"column nowrap",alignItems:"flex-start",position:"fixed",[e.breakpoints.up("sm")]:{marginLeft:o.left,transition:e.transitions.create("margin-left",{easing:e.transitions.easing.sharp,duration:e.transitions.duration.shortest})},top:0,bottom:0,padding:0,background:(Ns=(l=e.palette.navigation.submenu)===null||l===void 0?void 0:l.background)!==null&&Ns!==void 0?Ns:"#404040",overflowX:"hidden",msOverflowStyle:"none",scrollbarWidth:"none",cursor:"default",width:o.submenuConfig.drawerWidthClosed,transitionDelay:`${o.submenuConfig.defaultOpenDelayMs}ms`,"& > *":{flexShrink:0},"&::-webkit-scrollbar":{display:"none"}}},drawerOpen:o=>({width:o.submenuConfig.drawerWidthOpen,[e.breakpoints.down("xs")]:{width:"100%",position:"relative",paddingLeft:e.spacing(3),left:0,top:0}}),title:{fontSize:e.typography.h5.fontSize,fontWeight:e.typography.fontWeightMedium,color:e.palette.common.white,padding:e.spacing(2.5),[e.breakpoints.down("xs")]:{display:"none"}}}),{name:"BackstageSidebarSubmenu"}),Xi=e=>{const{isOpen:o}=xo(),{sidebarConfig:l,submenuConfig:d}=(0,f.useContext)(cr),m=o?l.drawerWidthOpen:l.drawerWidthClosed,v=Qi({left:m,submenuConfig:d}),{isHoveredOn:j}=(0,f.useContext)(Xo),[F,G]=(0,f.useState)(!1);return(0,f.useEffect)(()=>{G(j)},[j]),(0,t.jsxs)(w.Z,{className:tn()(v.drawer,{[v.drawerOpen]:F}),children:[(0,t.jsx)(ct.Z,{variant:"h5",className:v.title,children:e.title}),e.children]})};var qi=r(26739),ts=r(76600),_i=r(83543),ea=r(59797),vi=r(98989);const ta=(0,g.Z)({iconContainer:{display:"flex",position:"relative",width:"100%"},arrow1:{right:"6px",position:"absolute"}}),Oa=()=>{const e=ta();return _jsxs(Box,{className:e.iconContainer,children:[_jsx(Box,{className:e.arrow1,children:_jsx(ArrowBackIosIcon,{style:{fontSize:"12px"}})}),_jsx(Box,{children:_jsx(ArrowBackIosIcon,{style:{fontSize:"12px"}})})]})};var yi=null;const xi=(0,g.Z)({iconContainer:{display:"flex",position:"relative",width:"100%"},arrow1:{right:"6px",position:"absolute"}}),na=()=>{const e=xi();return _jsxs(Box,{className:e.iconContainer,children:[_jsx(Box,{className:e.arrow1,children:_jsx(ArrowForwardIosIcon,{style:{fontSize:"12px"}})}),_jsx(Box,{children:_jsx(ArrowForwardIosIcon,{style:{fontSize:"12px"}})})]})};var ra=null,ns,rs;const bi=e=>(0,g.Z)(o=>{var l,d;return{root:{color:o.palette.navigation.color,display:"flex",flexFlow:"row nowrap",alignItems:"center",height:48,cursor:"pointer"},buttonItem:{background:"none",border:"none",width:"100%",margin:0,padding:0,textAlign:"inherit",font:"inherit",textTransform:"none"},closed:{width:e.drawerWidthClosed,justifyContent:"center"},open:{[o.breakpoints.up("sm")]:{width:e.drawerWidthOpen}},highlightable:{"&:hover":{background:(ns=(l=o.palette.navigation.navItem)===null||l===void 0?void 0:l.hoverBackground)!==null&&ns!==void 0?ns:"#404040"}},highlighted:{background:(rs=(d=o.palette.navigation.navItem)===null||d===void 0?void 0:d.hoverBackground)!==null&&rs!==void 0?rs:"#404040"},label:{fontWeight:"bold",whiteSpace:"nowrap",lineHeight:"auto",flex:"3 1 auto",width:"110px",overflow:"hidden","text-overflow":"ellipsis"},iconContainer:{boxSizing:"border-box",height:"100%",width:e.iconContainerWidth,marginRight:-o.spacing(2),display:"flex",alignItems:"center",justifyContent:"center",lineHeight:"0"},searchRoot:{marginBottom:12},searchField:{color:"#b5b5b5",fontWeight:o.typography.fontWeightBold,fontSize:o.typography.fontSize},searchFieldHTMLInput:{padding:o.spacing(2,0,2)},searchContainer:{width:e.drawerWidthOpen-e.iconContainerWidth},secondaryAction:{width:o.spacing(6),textAlign:"center",marginRight:o.spacing(1)},closedItemIcon:{width:"100%",justifyContent:"center"},submenuArrow:{display:"flex"},expandButton:{background:"none",border:"none",color:o.palette.navigation.color,width:"100%",cursor:"pointer",position:"relative",height:48},arrows:{position:"absolute",right:10},selected:{"&$root":{borderLeft:`solid ${e.selectedIndicatorWidth}px ${o.palette.navigation.indicator}`,color:o.palette.navigation.selectedColor},"&$closed":{width:e.drawerWidthClosed},"& $closedItemIcon":{paddingRight:e.selectedIndicatorWidth},"& $iconContainer":{marginLeft:-e.selectedIndicatorWidth}}}},{name:"BackstageSidebarItem"});function So(e){return(0,f.useMemo)(()=>bi(e),[e])()}const Si=(e,o)=>(0,h.vJ)(e.props.children,l=>{let d=!1;return l.getElements().forEach(({props:{to:m,dropdownItems:v}})=>{if(!d){if(v!=null&&v.length){v.forEach(({to:j})=>d=d||Zs(o,(0,Jo.i3)(j)));return}m&&(d=Zs(o,(0,Jo.i3)(m)))}}),d},[o.pathname]);function os(e){return e.to===void 0}const oa=f.createElement(Xi).type,Ci=f.forwardRef(function({to:o,end:l,style:d,className:m,activeStyle:v,caseSensitive:j,activeClassName:F="active","aria-current":G="page",...U},fe){let{pathname:he}=(0,lr.TH)(),{pathname:Pe}=(0,lr.WU)(o);j||(he=he.toLocaleLowerCase("en-US"),Pe=Pe.toLocaleLowerCase("en-US"));let Te=he===Pe;!Te&&!l&&(Te=he.startsWith(`${Pe}/`));const Ue=Te?G:void 0;return(0,t.jsx)(z.rU,{...U,to:o,ref:fe,"aria-current":Ue,style:{...d,...Te?v:void 0},className:tn()([m,Te?F:void 0])})}),Fs=(0,f.forwardRef)((e,o)=>{const{icon:l,text:d,hasNotifications:m=!1,hasSubmenu:v=!1,disableHighlight:j=!1,onClick:F,noTrack:G,children:U,className:fe,...he}=e,{sidebarConfig:Pe}=(0,f.useContext)(cr),Te=So(Pe),{isOpen:Ue}=xo(),_e=!Ue&&v?{display:"flex",marginLeft:"20px"}:{lineHeight:"0"},Vt=(0,t.jsxs)(w.Z,{style:_e,children:[(0,t.jsx)(l,{fontSize:"small"}),!Ue&&v?(0,t.jsx)(vi.Z,{fontSize:"small"}):(0,t.jsx)(t.Fragment,{})]}),dn=(0,t.jsx)(qi.Z,{color:"secondary",variant:"dot",overlap:"circular",invisible:!m,className:tn()({[Te.closedItemIcon]:!Ue}),children:Vt}),Dn=(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(w.Z,{"data-testid":"login-button",className:Te.iconContainer,children:dn}),d&&(0,t.jsx)(ct.Z,{variant:"subtitle2",className:Te.label,children:d}),(0,t.jsx)("div",{className:Te.secondaryAction,children:U})]}),rr=Ue?Dn:dn,$t={onClick:F,className:tn()(fe,Te.root,Ue?Te.open:Te.closed,os(e)&&Te.buttonItem,{[Te.highlightable]:!j})},sn=(0,h.z$)(),{pathname:an}=(0,lr.WU)(!os(e)&&e.to?e.to:""),dr=(0,f.useCallback)(gr=>{if(!G){const mr="click",vr=d!=null?d:"Sidebar Item",ls=an?{attributes:{to:an}}:void 0;sn.captureEvent(mr,vr,ls)}F==null||F(gr)},[sn,d,an,G,F]);return os(e)?(0,t.jsx)(ve.Z,{role:"button","aria-label":d,...$t,ref:o,onClick:dr,children:rr}):(0,t.jsx)(Ci,{...$t,activeClassName:Te.selected,to:e.to?e.to:"",ref:o,"aria-label":d||e.to,...he,onClick:dr,children:rr})}),sa=({children:e,...o})=>{const{sidebarConfig:l}=(0,f.useContext)(cr),d=So(l),[m,v]=(0,f.useState)(!1),j=(0,lr.TH)(),F=Si(e,j),G=(0,ze.Z)(Pe=>Pe.breakpoints.down("sm")),U=()=>{v(!0)},fe=()=>{v(!1)},he=()=>G?m?(0,t.jsx)(ea.Z,{fontSize:"small",className:d.submenuArrow}):(0,t.jsx)(_i.Z,{fontSize:"small",className:d.submenuArrow}):!m&&(0,t.jsx)(vi.Z,{fontSize:"small",className:d.submenuArrow});return(0,t.jsx)(Xo.Provider,{value:{isHoveredOn:m,setIsHoveredOn:v},children:(0,t.jsxs)("div",{"data-testid":"item-with-submenu",onMouseLeave:fe,onTouchStart:m?fe:U,onMouseEnter:U,className:tn()(m&&d.highlighted),children:[(0,t.jsx)(Fs,{hasSubmenu:!0,className:F?d.selected:"",...o,children:he()}),m&&e]})})},Us=(0,f.forwardRef)((e,o)=>{const[l]=(0,h.vJ)(e.children,d=>d.getElements().filter(m=>m.type===oa));return l?(0,t.jsx)(sa,{...e,children:l}):(0,t.jsx)(Fs,{...e,ref:o})});function ia(e){const{sidebarConfig:o}=useContext(SidebarConfigContext),[l,d]=useState(""),m=So(o),v=e.icon?e.icon:SearchIcon,j=()=>{e.onSearch(l),d("")},F=he=>{he.key==="Enter"&&(he.preventDefault(),j())},G=he=>{d(he.target.value)},U=he=>{he.preventDefault(),he.stopPropagation()},fe=he=>{j(),he.preventDefault()};return _jsx(Box,{className:m.searchRoot,children:_jsx(Us,{icon:v,to:e.to,onClick:fe,disableHighlight:!0,children:_jsx(TextField,{placeholder:"Search",value:l,onClick:U,onChange:G,onKeyDown:F,className:m.searchContainer,InputProps:{disableUnderline:!0,className:m.searchField},inputProps:{className:m.searchFieldHTMLInput}})})})}const aa=(0,ts.Z)("div")({flex:1},{name:"BackstageSidebarSpace"}),la=(0,ts.Z)("div")({height:8},{name:"BackstageSidebarSpacer"}),wi=(0,ts.Z)("hr")(({theme:e})=>({height:1,width:"100%",background:"#383838",border:"none",margin:e.spacing(1.2,0)}),{name:"BackstageSidebarDivider"}),ji=e=>({overflowY:"auto","&::-webkit-scrollbar":{backgroundColor:e.palette.background.default,width:"5px",borderRadius:"5px"},"&::-webkit-scrollbar-thumb":{backgroundColor:e.palette.text.hint,borderRadius:"5px"}}),ca=(0,ts.Z)("div")(({theme:e})=>{const o=ji(e);return{flex:"0 1 auto",overflowX:"hidden",width:"calc(100% - 5px)",minHeight:"48px",overflowY:"hidden","@media (hover: none)":o,"&:hover":o}}),pr=()=>{const{sidebarConfig:e}=useContext(SidebarConfigContext),o=So(e),{isOpen:l,setOpen:d}=useSidebarOpenState();if(useMediaQuery(j=>j.breakpoints.down("md"),{noSsr:!0}))return null;const v=()=>{d(!l)};return _jsx(Button,{role:"button",onClick:v,className:o.expandButton,"aria-label":"Expand Sidebar","data-testid":"sidebar-expand-button",children:_jsx(Box,{className:o.arrows,children:l?_jsx(DoubleArrowLeft,{}):_jsx(DoubleArrowRight,{})})})},Ei=(0,g.Z)(e=>({introCard:o=>({color:"#b5b5b5",fontSize:12,width:o.sidebarConfig.drawerWidthOpen,marginTop:e.spacing(2.25),marginBottom:e.spacing(1.5),paddingLeft:o.sidebarConfig.iconPadding,paddingRight:o.sidebarConfig.iconPadding}),introDismiss:{display:"flex",justifyContent:"flex-end",alignItems:"center",marginTop:e.spacing(1.5)},introDismissLink:{color:"#dddddd",display:"flex",alignItems:"center",marginBottom:e.spacing(.5),"&:hover":{color:e.palette.linkHover,transition:e.transitions.create("color",{easing:e.transitions.easing.sharp,duration:e.transitions.duration.shortest})}},introDismissText:{fontSize:"0.7rem",fontWeight:"bold",textTransform:"uppercase",letterSpacing:1},introDismissIcon:{width:18,height:18,marginRight:e.spacing(1.5)}}),{name:"BackstageSidebarIntro"});function Ai(e){const{sidebarConfig:o}=useContext(SidebarConfigContext),l=Ei({sidebarConfig:o}),{text:d,onClose:m}=e,v=()=>m();return _jsxs(Box,{className:l.introCard,children:[_jsx(Typography,{variant:"subtitle2",children:d}),_jsx(Box,{className:l.introDismiss,children:_jsxs(IconButton,{onClick:v,className:l.introDismissLink,children:[_jsx(CloseIcon,{className:l.introDismissIcon}),_jsx(Typography,{component:"span",className:l.introDismissText,children:"Dismiss"})]})})]})}const Ms=e=>{const{text:o,onDismiss:l}=e,[d,m]=useState(!1),v=()=>{m(!0)};return _jsx(Collapse,{in:!d,onExited:l,children:_jsx(Ai,{text:o,onClose:v})})},zs=null,Ti="And your recently viewed plugins will pop up here!";function da(e){const{isOpen:o}=useSidebarOpenState(),l={starredItemsDismissed:!1,recentlyViewedItemsDismissed:!1},{value:d,set:m}=useLocalStorageValue(SIDEBAR_INTRO_LOCAL_STORAGE),{starredItemsDismissed:v,recentlyViewedItemsDismissed:j}=d!=null?d:{},F=()=>{m(U=>({...l,...U,starredItemsDismissed:!0}))},G=()=>{m(U=>({...l,...U,recentlyViewedItemsDismissed:!0}))};return o?_jsxs(_Fragment,{children:[!v&&_jsxs(_Fragment,{children:[_jsx(Ms,{text:zs,onDismiss:F}),_jsx(SidebarDivider,{})]}),!j&&_jsx(Ms,{text:Ti,onDismiss:G})]}):null}const Ri=(0,g.Z)(e=>({root:{gridArea:"pageContent",minWidth:0,paddingTop:e.spacing(3),paddingBottom:e.spacing(3),paddingLeft:e.spacing(2),paddingRight:e.spacing(2),[e.breakpoints.up("sm")]:{paddingLeft:e.spacing(3),paddingRight:e.spacing(3)}},stretch:{display:"flex",flexDirection:"column",flexGrow:1},noPadding:{padding:0}}),{name:"BackstageContent"});function Ws(e){const{className:o,stretch:l,noPadding:d,children:m,...v}=e,{contentRef:j}=fi(),F=Ri();return(0,t.jsx)("article",{ref:j,tabIndex:-1,...v,className:tn()(F.root,o,{[F.stretch]:l,[F.noPadding]:d}),children:m})}var ua=r(6487),Ii=r(99152);const i=(0,g.Z)(e=>({tabsWrapper:{gridArea:"pageSubheader",backgroundColor:e.palette.background.paper,paddingLeft:e.spacing(3),minWidth:0},defaultTab:{...e.typography.caption,padding:e.spacing(3,3),textTransform:"uppercase",fontWeight:e.typography.fontWeightBold,color:e.palette.text.secondary},selected:{color:e.palette.text.primary},tabRoot:{"&:hover":{backgroundColor:e.palette.background.default,color:e.palette.text.primary}}}),{name:"BackstageHeaderTabs"});function n(e){const{tabs:o,onChange:l,selectedIndex:d}=e,[m,v]=(0,f.useState)(d!=null?d:0),j=i(),F=(0,f.useCallback)((G,U)=>{d===void 0&&v(U),l&&d!==U&&l(U)},[d,l]);return(0,f.useEffect)(()=>{d!==void 0&&v(d)},[d]),(0,t.jsx)(w.Z,{className:j.tabsWrapper,children:(0,t.jsx)(Ii.Z,{selectionFollowsFocus:!0,indicatorColor:"primary",textColor:"inherit",variant:"scrollable",scrollButtons:"auto","aria-label":"tabs",onChange:F,value:m,children:o.map((G,U)=>(0,f.createElement)(ua.Z,{...G.tabProps,"data-testid":`header-tab-${U}`,label:G.label,key:G.id,value:U,className:j.defaultTab,classes:{selected:j.selected,root:j.tabRoot}}))})})}function s(e){const o=(0,lr.UO)(),d=e.map(({path:Pe,children:Te})=>({caseSensitive:!1,path:`${Pe}/*`,element:Te})).sort((Pe,Te)=>Te.path.replace(/\/\*$/,"").localeCompare(Pe.path.replace(/\/\*$/,"")));var m;const v=(m=(0,lr.V$)(d))!==null&&m!==void 0?m:e[0].children;var j;let F=(j=o["*"])!==null&&j!==void 0?j:"";F.startsWith("/")||(F=`/${F}`);var G;const[U]=(G=(0,Jo.fp)(d,F))!==null&&G!==void 0?G:[],fe=U?e.findIndex(Pe=>`${Pe.path}/*`===U.route.path):0;var he;return{index:fe===-1?0:fe,element:v,route:(he=e[fe])!==null&&he!==void 0?he:e[0]}}function a(e){const{routes:o}=e,l=(0,lr.s0)(),{index:d,route:m,element:v}=s(o),j=(0,f.useMemo)(()=>o.map(G=>({id:G.path,label:G.title,tabProps:G.tabProps})),[o]),F=G=>{let{path:U}=o[G];U=U.replace(/\/\*$/,""),U=U.replace(/^\//,""),l(U)};return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(n,{tabs:j,selectedIndex:d,onChange:F}),(0,t.jsxs)(Ws,{children:[(0,t.jsx)(vo.q,{title:m.title}),v]})]})}const p=()=>null;(0,h.R5)(p,"core.gatherMountPoints",!0);function A(e){const o=(0,t.jsx)(p,{path:"",title:"",children:(0,t.jsx)("div",{})}).type;return f.Children.toArray(e).flatMap(l=>{if(!(0,f.isValidElement)(l))return[];if(l.type===f.Fragment)return A(l.props.children);if(l.type!==o)throw new Error("Child of TabbedLayout must be an TabbedLayout.Route");const{path:d,title:m,children:v,tabProps:j}=l.props;return[{path:d,title:m,children:v,tabProps:j}]})}function k(e){const o=A(e.children);return(0,t.jsx)(a,{routes:o})}k.Route=p;const M=(0,g.Z)(e=>({value:{marginBottom:e.spacing(.75)},subvalue:{color:e.palette.textSubtle,fontWeight:"normal"}}),{name:"BackstageSubvalueCell"});function ae(e){const{value:o,subvalue:l}=e,d=M();return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(w.Z,{className:d.value,children:o}),(0,t.jsx)(w.Z,{className:d.subvalue,children:l})]})}var xe=r(67222),Ie=r(21070),Ve=r(90324),gt=r(98281),Tt=r(48049),Rt=r(51209),Wt=r(33375),Gt=r(44233),$n=r(27604),Xn=r(36444),fr=r(37971),Co=r(59709),Pi=r(17373),Li=r(3702),ss=r(93111);const Oi=(0,g.Z)(e=>({root:{height:"100%",width:"315px",display:"flex",flexDirection:"column",marginRight:e.spacing(3)},value:{fontWeight:"bold",fontSize:18},header:{display:"flex",alignItems:"center",height:e.spacing(7.5),justifyContent:"space-between",borderBottom:`1px solid ${e.palette.grey[500]}`},filters:{display:"flex",flexDirection:"column","& > *":{marginTop:e.spacing(2)}}}),{name:"BackstageTableFilters"}),Ur=e=>{var o;const l=Oi(),{onChangeFilters:d}=e,[m,v]=(0,f.useState)({...e.selectedFilters}),[j,F]=(0,f.useState)(!1),G=()=>{v({}),F(U=>!U)};return(0,f.useEffect)(()=>{d(m)},[m,d]),(0,t.jsxs)(w.Z,{className:l.root,children:[(0,t.jsxs)(w.Z,{className:l.header,children:[(0,t.jsx)(w.Z,{className:l.value,children:"Filters"}),(0,t.jsx)(ve.Z,{color:"primary",onClick:G,children:"Clear all"})]}),(0,t.jsx)(w.Z,{className:l.filters,children:((o=e.filters)===null||o===void 0?void 0:o.length)&&e.filters.map(U=>(0,t.jsx)(C,{triggerReset:j,...U.element,selected:m[U.element.label],onChange:fe=>v({...m,[U.element.label]:fe})},U.element.label))})]})},ha={Add:(0,f.forwardRef)((e,o)=>(0,t.jsx)(Ie.Z,{...e,ref:o})),Check:(0,f.forwardRef)((e,o)=>(0,t.jsx)(gt.Z,{...e,ref:o})),Clear:(0,f.forwardRef)((e,o)=>(0,t.jsx)(Wt.Z,{...e,ref:o})),Delete:(0,f.forwardRef)((e,o)=>(0,t.jsx)(Gt.Z,{...e,ref:o})),DetailPanel:(0,f.forwardRef)((e,o)=>(0,t.jsx)(Rt.Z,{...e,ref:o})),Edit:(0,f.forwardRef)((e,o)=>(0,t.jsx)($n.Z,{...e,ref:o})),Export:(0,f.forwardRef)((e,o)=>(0,t.jsx)(Li.Z,{...e,ref:o})),Filter:(0,f.forwardRef)((e,o)=>(0,t.jsx)(Xn.Z,{...e,ref:o})),FirstPage:(0,f.forwardRef)((e,o)=>(0,t.jsx)(fr.Z,{...e,ref:o})),LastPage:(0,f.forwardRef)((e,o)=>(0,t.jsx)(Co.Z,{...e,ref:o})),NextPage:(0,f.forwardRef)((e,o)=>(0,t.jsx)(Rt.Z,{...e,ref:o})),PreviousPage:(0,f.forwardRef)((e,o)=>(0,t.jsx)(Tt.Z,{...e,ref:o})),ResetSearch:(0,f.forwardRef)((e,o)=>(0,t.jsx)(Wt.Z,{...e,ref:o})),Search:(0,f.forwardRef)((e,o)=>(0,t.jsx)(Xn.Z,{...e,ref:o})),SortArrow:(0,f.forwardRef)((e,o)=>(0,t.jsx)(Ve.Z,{...e,ref:o})),ThirdStateCheck:(0,f.forwardRef)((e,o)=>(0,t.jsx)(Pi.Z,{...e,ref:o})),ViewColumn:(0,f.forwardRef)((e,o)=>(0,t.jsx)(ss.Z,{...e,ref:o}))};function pa(e,o){const l=o.split(".");let d=e[l[0]];for(let m=1;m<l.length;++m){if(d===void 0)return d;const v=l[m];d=d[v]}return d}const ka=(0,Sn.Z)(e=>({header:{padding:e.spacing(1,2,1,2.5),borderTop:`1px solid ${e.palette.grey.A100}`,borderBottom:`1px solid ${e.palette.grey.A100}`,fontWeight:e.typography.fontWeightBold,position:"static",wordBreak:"normal"}}),{name:"BackstageTableHeader"})(xe.W$),fa=(0,Sn.Z)(e=>({root:{padding:e.spacing(3,0,2.5,2.5)},title:{"& > h6":{fontWeight:e.typography.fontWeightBold}},searchField:{paddingRight:e.spacing(2)}}),{name:"BackstageTableToolbar"})(xe.UW),Ba=(0,g.Z)(e=>({root:{display:"flex",alignItems:"center",justifyContent:"space-between"},title:{fontWeight:e.typography.fontWeightBold,fontSize:18,whiteSpace:"nowrap"}}),{name:"BackstageTableFiltersContainer"}),$a=(0,g.Z)(()=>({root:{display:"flex",alignItems:"start"}}),{name:"BackstageTable"});function Da(e,o){return e.map(l=>{var d;const m=(d=l.headerStyle)!==null&&d!==void 0?d:{};let v=l.cellStyle||{};if(l.highlight)if(m.color=o.palette.textContrast,typeof v=="object")v.fontWeight=o.typography.fontWeightBold;else{const j=v;v=(F,G,U)=>({...j(F,G,U),fontWeight:o.typography.fontWeightBold})}return{...l,headerStyle:m,cellStyle:v}})}function Za(e,o){return(0,Kr.transform)(e,(l,d,m)=>{(0,Kr.isEqual)(d,o[m])||(l[m]=d)})}const ga={search:"",filtersOpen:!1,filters:{}};function Na(e){const{toolbarRef:o,setSearch:l,hasFilters:d,selectedFiltersLength:m,toggleFilters:v}=e,j=Ba(),F=(0,f.useCallback)(G=>{e.onSearchChanged(G),l(G)},[e,l]);return d?(0,t.jsxs)(w.Z,{className:j.root,children:[(0,t.jsxs)(w.Z,{className:j.root,children:[(0,t.jsx)(T.Z,{onClick:v,"aria-label":"filter list",children:(0,t.jsx)(Xn.Z,{})}),(0,t.jsxs)(ct.Z,{className:j.title,children:["Filters (",m,")"]})]}),(0,t.jsx)(fa,{...e,ref:o,onSearchChanged:F})]}):(0,t.jsx)(fa,{...e,ref:o,onSearchChanged:F})}function ma(e){const{data:o,columns:l,options:d,title:m,subtitle:v,filters:j,initialState:F,emptyContent:G,onStateChange:U,components:fe,...he}=e,Pe=$a(),Te=(0,ie.Z)(),Ue={...ga,...F},[_e,Vt]=(0,f.useState)(Ue.filtersOpen),dn=(0,f.useCallback)(()=>Vt(Zn=>!Zn),[Vt]),[Dn,rr]=(0,f.useState)(0),[$t,sn]=(0,f.useState)(o),[an,dr]=(0,f.useState)(Ue.filters),gr=Da(l,Te),[mr,vr]=(0,f.useState)(Ue.search);(0,f.useEffect)(()=>{if(U){const Zn=Za({search:mr,filtersOpen:_e,filters:an},ga);U(Zn)}},[mr,_e,an,U]);const ls={headerStyle:{textTransform:"uppercase"}},Mr=(0,f.useCallback)(Zn=>{var Tr;return(Tr=l.find(Xr=>Xr.title===Zn))===null||Tr===void 0?void 0:Tr.field},[l]);(0,f.useEffect)(()=>{if(typeof o=="function")return;if(!an){sn(o);return}const Zn=Object.values(an);if(o&&Zn.flat().length){const Tr=o.filter(Xr=>!!Object.entries(an).filter(([,qr])=>!!qr.length).every(([qr,gn])=>{const Cn=pa(Xr,Mr(qr));return Array.isArray(Cn)&&Array.isArray(gn)?Cn.some(Eo=>gn.includes(Eo)):Array.isArray(Cn)?Cn.includes(gn):Array.isArray(gn)?gn.includes(Cn):Cn===gn}));sn(Tr)}else sn(o);rr(Zn.flat().length)},[o,an,Mr]);const Zi=(Zn,Tr)=>{const Xr=gn=>{const Cn=new Set,Eo=_r=>{_r!=null&&Cn.add(_r)};return Tr&&Tr.forEach(_r=>{const cs=pa(_r,Mr(gn));Array.isArray(cs)?cs.forEach(Eo):Eo(cs)}),Cn},qr=gn=>({placeholder:"All results",label:gn.column,multiple:gn.type==="multiple-select",items:[...Xr(gn.column)].sort().map(Cn=>({label:Cn,value:Cn}))});return Zn.map(gn=>({type:gn.type,element:qr(gn)}))},rn=!!(j!=null&&j.length),jo=(0,f.useCallback)(Zn=>(0,t.jsx)(Na,{setSearch:vr,hasFilters:rn,selectedFiltersLength:Dn,toggleFilters:dn,...Zn}),[dn,rn,Dn,vr]),Vs=typeof o!="function"&&o.length===0,zr=l.length,Ni=(0,f.useCallback)(Zn=>G&&Vs?(0,t.jsx)("tbody",{children:(0,t.jsx)("tr",{children:(0,t.jsx)("td",{colSpan:zr,children:G})})}):(0,t.jsx)(xe.os,{...Zn}),[Vs,G,zr]);return(0,t.jsxs)(w.Z,{className:Pe.root,children:[_e&&o&&typeof o!="function"&&(j==null?void 0:j.length)&&(0,t.jsx)(Ur,{filters:Zi(j,o),selectedFilters:an,onChangeFilters:dr}),(0,t.jsx)(xe.ZP,{components:{Header:ka,Toolbar:jo,Body:Ni,...fe},options:{...ls,...d},columns:gr,icons:ha,title:(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(ct.Z,{variant:"h5",component:"h2",children:m}),v&&(0,t.jsx)(ct.Z,{color:"textSecondary",variant:"body1",children:v})]}),data:typeof o=="function"?o:$t,style:{width:"100%"},localization:{toolbar:{searchPlaceholder:"Filter",searchTooltip:"Filter"}},...he})]})}ma.icons=Object.freeze(ha);var kl=r(44311);function Fa(e,o){const l=e[e.length-1];if(l)return l>=.9?o.palette.status.ok:l>=.5?o.palette.status.warning:o.palette.status.error}function Bl(e){const o=useTheme();if(!e.data)return null;var l;return _jsxs(Sparklines,{width:120,height:30,min:0,max:1,...e,children:[e.title&&_jsx("title",{children:e.title}),_jsx(SparklinesLine,{color:(l=e.color)!==null&&l!==void 0?l:Fa(e.data,o)})]})}const Ua=e=>(0,g.Z)(o=>({container:{width:"100%",display:"flex",flexDirection:"row",flexWrap:"wrap",justifyContent:"flex-end",alignItems:"center",marginBottom:o.spacing(2),textAlign:e.textAlign},leftItemsBox:{flex:"1 1 auto",minWidth:0,overflow:"visible"},rightItemsBox:{flex:"0 1 auto",display:"flex",flexDirection:"row",flexWrap:"wrap",alignItems:"center",marginLeft:o.spacing(1),minWidth:0,overflow:"visible"},description:{},title:{display:"inline-flex",marginBottom:0}}),{name:"BackstageContentHeader"}),Ma=({title:e="Unknown page",className:o})=>(0,t.jsx)(ct.Z,{variant:"h4",component:"h2",className:o,"data-testid":"header-title",children:e});function za(e){const{description:o,title:l,titleComponent:d=void 0,children:m,textAlign:v="left"}=e,j=Ua({textAlign:v})(),F=d||(0,t.jsx)(Ma,{title:l,className:j.title});return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(vo.q,{title:l}),(0,t.jsxs)(w.Z,{className:j.container,children:[(0,t.jsxs)(w.Z,{className:j.leftItemsBox,children:[F,o&&(0,t.jsx)(ct.Z,{className:j.description,variant:"body2",children:o})]}),(0,t.jsx)(w.Z,{className:j.rightItemsBox,children:m})]})]})}var Wa=r.p+"static/mic-drop.fe3ef4d0..svg";const Va=(0,g.Z)(e=>({micDrop:{maxWidth:"60%",bottom:e.spacing(2),right:e.spacing(2),[e.breakpoints.down("xs")]:{maxWidth:"96%",bottom:"unset",right:"unset",margin:`${e.spacing(10)}px auto ${e.spacing(4)}px`}}}),{name:"BackstageErrorPageMicDrop"}),Ha=()=>{const e=Va();return(0,t.jsx)("img",{src:Wa,className:e.micDrop,alt:"Girl dropping mic from her hands"})},Ga=(0,g.Z)(e=>({container:{padding:e.spacing(8),[e.breakpoints.down("xs")]:{padding:e.spacing(2)}},title:{paddingBottom:e.spacing(5),[e.breakpoints.down("xs")]:{paddingBottom:e.spacing(4),fontSize:e.typography.h3.fontSize}},subtitle:{color:e.palette.textSubtle}}),{name:"BackstageErrorPage"});function Ka(e){const{status:o,statusMessage:l,additionalInfo:d,supportUrl:m}=e,v=Ga(),j=(0,lr.s0)(),F=Ko();return(0,t.jsxs)(wt.Z,{container:!0,spacing:0,className:v.container,children:[(0,t.jsxs)(wt.Z,{item:!0,xs:12,sm:8,md:4,children:[(0,t.jsxs)(ct.Z,{"data-testid":"error",variant:"body1",className:v.subtitle,children:["ERROR ",o,": ",l]}),(0,t.jsx)(ct.Z,{variant:"body1",className:v.subtitle,children:d}),(0,t.jsx)(ct.Z,{variant:"h2",className:v.title,children:"Looks like someone dropped the mic!"}),(0,t.jsxs)(ct.Z,{variant:"h6",children:[(0,t.jsx)(ue.r,{to:"#","data-testid":"go-back-link",onClick:()=>j(-1),children:"Go back"}),"... or please"," ",(0,t.jsx)(ue.r,{to:m||F.url,children:"contact support"})," if you think this is a bug."]})]}),(0,t.jsx)(Ha,{})]})}var Ya=r(16173);const Ja=(0,Sn.Z)({root:{textDecoration:"underline",cursor:"pointer"}},{name:"BackstageBreadcrumbsClickableText"})(ct.Z),ki=(0,Sn.Z)({root:{textDecoration:"underline",color:"inherit"}},{name:"BackstageBreadcrumbsStyledBox"})(w.Z);function Qa(e){const{children:o,...l}=e,[d,m]=f.useState(null),v=f.Children.toArray(o),[j,F,...G]=v,U=G.length?G.pop():v[v.length-1],fe=v.length>3,he=Ue=>{m(Ue.currentTarget)},Pe=()=>{m(null)},Te=Boolean(d);return(0,t.jsxs)(f.Fragment,{children:[(0,t.jsxs)(Ya.Z,{"aria-label":"breadcrumb",...l,children:[v.length>1&&(0,t.jsx)(ki,{clone:!0,children:j}),v.length>2&&(0,t.jsx)(ki,{clone:!0,children:F}),fe&&(0,t.jsx)(Ja,{onClick:he,children:"..."}),(0,t.jsx)(w.Z,{style:{fontStyle:"italic"},children:U})]}),(0,t.jsx)(Vo.ZP,{open:Te,anchorEl:d,onClose:Pe,anchorOrigin:{vertical:"bottom",horizontal:"left"},transformOrigin:{vertical:"top",horizontal:"left"},children:(0,t.jsx)(kt.Z,{children:G.map((Ue,_e)=>(0,t.jsx)(Ft.Z,{button:!0,children:(0,t.jsx)(ki,{clone:!0,children:Ue})},_e))})})]})}const Xa=(0,g.Z)(e=>({header:{gridArea:"pageHeader",padding:e.spacing(3),width:"100%",boxShadow:e.shadows[4],position:"relative",zIndex:100,display:"flex",flexDirection:"row",alignItems:"center",backgroundImage:e.page.backgroundImage,backgroundPosition:"center",backgroundSize:"cover",[e.breakpoints.down("sm")]:{flexWrap:"wrap"}},leftItemsBox:{maxWidth:"100%",flexGrow:1},rightItemsBox:{width:"auto",alignItems:"center"},title:{color:e.page.fontColor,wordBreak:"break-word",fontSize:e.typography.h3.fontSize,marginBottom:0},subtitle:{color:e.page.fontColor,opacity:.8,display:"inline-block",marginTop:e.spacing(1),maxWidth:"75ch"},type:{textTransform:"uppercase",fontSize:11,opacity:.8,marginBottom:e.spacing(1),color:e.page.fontColor},breadcrumb:{color:e.page.fontColor},breadcrumbType:{fontSize:"inherit",opacity:.7,marginRight:-e.spacing(.3),marginBottom:e.spacing(.3)},breadcrumbTitle:{fontSize:"inherit",marginLeft:-e.spacing(.3),marginBottom:e.spacing(.3)}}),{name:"BackstageHeader"}),qa=({type:e,typeLink:o,classes:l,pageTitle:d})=>e?o?(0,t.jsxs)(Qa,{className:l.breadcrumb,children:[(0,t.jsx)(ue.r,{to:o,children:e}),(0,t.jsx)(ct.Z,{children:d})]}):(0,t.jsx)(ct.Z,{className:l.type,children:e}):null,_a=({pageTitle:e,classes:o,tooltip:l})=>{const d=(0,t.jsx)(ct.Z,{className:o.title,variant:"h1",children:e});return l?(0,t.jsx)(P.ZP,{title:l,placement:"top-start",children:d}):d},el=({classes:e,subtitle:o})=>o?typeof o!="string"?(0,t.jsx)(t.Fragment,{children:o}):(0,t.jsx)(ct.Z,{className:e.subtitle,variant:"subtitle2",component:"span",children:o}):null;function va(e){const{children:o,pageTitleOverride:l,style:d,subtitle:m,title:v,tooltip:j,type:F,typeLink:G}=e,U=Xa(),he=(0,h.h_)(h.Ds).getOptionalString("app.title")||"Backstage",Pe=l||v,Te=v||l,Ue=`${Pe} | %s | ${he}`,_e=`${Pe} | ${he}`;return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(vo.q,{titleTemplate:Ue,defaultTitle:_e}),(0,t.jsxs)("header",{style:d,className:U.header,children:[(0,t.jsxs)(w.Z,{className:U.leftItemsBox,children:[(0,t.jsx)(qa,{classes:U,type:F,typeLink:G,pageTitle:Te}),(0,t.jsx)(_a,{classes:U,pageTitle:Te,tooltip:j}),(0,t.jsx)(el,{classes:U,subtitle:m})]}),(0,t.jsx)(wt.Z,{container:!0,className:U.rightItemsBox,spacing:4,children:o})]})]})}const tl=({label:e,secondaryLabel:o,icon:l,disabled:d=!1,onClick:m})=>_jsx(Fragment,{children:_jsxs(ListItem,{"data-testid":"header-action-item",disabled:d,button:!0,onClick:v=>{m&&m(v)},children:[l&&_jsx(ListItemIcon,{children:l}),_jsx(ListItemText,{primary:e,secondary:o})]})});function $l(e){const{palette:{common:{white:o}}}=useTheme(),{actionItems:l}=e,[d,m]=React.useState(!1),v=React.useRef(null);return _jsxs(Fragment,{children:[_jsx(IconButton,{onClick:()=>m(!0),"data-testid":"header-action-menu",ref:v,style:{color:o,height:56,width:56,marginRight:-4,padding:0},children:_jsx(MoreVert,{})}),_jsx(Popover,{open:d,anchorEl:v.current,anchorOrigin:{horizontal:"right",vertical:"bottom"},transformOrigin:{horizontal:"right",vertical:"top"},onClose:()=>m(!1),children:_jsx(List,{children:l.map((j,F)=>_jsx(tl,{...j},`header-action-menu-${F}`))})})]})}const nl=(0,g.Z)(e=>({root:{textAlign:"left"},label:{color:e.page.fontColor,fontWeight:e.typography.fontWeightBold,letterSpacing:0,fontSize:e.typography.fontSize,marginBottom:e.spacing(1)/2,lineHeight:1},value:{color:(0,_.Fq)(e.page.fontColor,.8),fontSize:e.typography.fontSize,lineHeight:1}}),{name:"BackstageHeaderLabel"}),rl=({value:e,className:o})=>(0,t.jsx)(ct.Z,{component:typeof e=="string"?"p":"span",className:o,children:e});function ol(e){const{label:o,value:l,url:d}=e,m=nl(),v=(0,t.jsx)(rl,{className:m.value,value:l||"<Unknown>"});return(0,t.jsx)(wt.Z,{item:!0,children:(0,t.jsxs)(ct.Z,{component:"span",className:m.root,children:[(0,t.jsx)(ct.Z,{className:m.label,children:o}),d?(0,t.jsx)(ue.r,{to:d,children:v}):v]})})}const sl=e=>(0,Wn.Z)({root:{color:e.palette.common.white,padding:e.spacing(2,2,3),backgroundImage:e.getPageTheme({themeId:"card"}).backgroundImage,backgroundPosition:0,backgroundSize:"inherit"}}),il=(0,g.Z)(sl,{name:"BackstageItemCardHeader"});function al(e){const{title:o,subtitle:l,children:d}=e,m=il(e);return(0,t.jsxs)(w.Z,{className:m.root,children:[l&&(0,t.jsx)(ct.Z,{variant:"subtitle2",component:"h3",children:l}),o&&(0,t.jsx)(ct.Z,{variant:"h6",component:"h4",children:o}),d]})}function Dl(e){const{description:o,tags:l,title:d,type:m,subtitle:v,label:j,onClick:F,href:G}=e;return _jsxs(Card,{children:[_jsx(CardMedia,{children:_jsx(ItemCardHeader,{title:d,subtitle:v||m})}),_jsxs(CardContent,{children:[l!=null&&l.length?_jsx(Box,{children:l.map((U,fe)=>_jsx(Chip,{size:"small",label:U},fe))}):null,o]}),_jsxs(CardActions,{children:[!G&&_jsx(LinkButton,{to:"#",onClick:F,color:"primary",children:j}),G&&_jsx(LinkButton,{to:G,color:"primary",children:j})]})]})}const ll=e=>(0,Wn.Z)({root:{display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(22em, 1fr))",gridAutoRows:"1fr",gridGap:e.spacing(2)}}),cl=(0,g.Z)(ll,{name:"BackstageItemCardGrid"});function dl(e){const{children:o,...l}=e,d=cl(l);return(0,t.jsx)(w.Z,{className:d.root,...l,children:o})}var ul=r(41547);const hl=(0,g.Z)(e=>({root:{display:"grid",gridTemplateAreas:"'pageHeader pageHeader pageHeader' 'pageSubheader pageSubheader pageSubheader' 'pageNav pageContent pageSidebar'",gridTemplateRows:"max-content auto 1fr",gridTemplateColumns:"auto 1fr auto",overflowY:"auto",height:"100vh",[e.breakpoints.down("xs")]:{height:"100%"}}}),{name:"BackstagePage"});function ya(e){const{themeId:o,children:l}=e,d=hl();return(0,t.jsx)(ul.Z,{theme:m=>({...m,page:m.getPageTheme({themeId:o})}),children:(0,t.jsx)("main",{className:d.root,children:l})})}function pl(e){const{themeId:o,children:l,...d}=e;return(0,t.jsxs)(ya,{themeId:o,children:[(0,t.jsx)(va,{...d}),l]})}var qn=r(30195);const Zl=qn.z.object({providerInfo:qn.z.object({}).catchall(qn.z.unknown()).optional(),profile:qn.z.object({email:qn.z.string().optional(),displayName:qn.z.string().optional(),picture:qn.z.string().optional()}),backstageIdentity:qn.z.object({token:qn.z.string(),identity:qn.z.object({type:qn.z.literal("user"),userEntityRef:qn.z.string(),ownershipEntityRefs:qn.z.array(qn.z.string())})})}),xa={defaultTokenExpiryMillis:5*60*1e3,tokenExpiryMarginMillis:5*60*1e3};function fl(e){const o=new Date(Date.now()+xa.defaultTokenExpiryMillis);if(!e)return o;const[l,d,m]=e.split("."),v=JSON.parse(window.atob(d));return typeof v.exp!="number"?o:new Date(v.exp*1e3-xa.tokenExpiryMarginMillis)}class Nl{async start(){await this.getSessionAsync()}getUserId(){const{backstageIdentity:o}=this.getSessionSync(),l=o.identity.userEntityRef,d=/^([^:/]+:)?([^:/]+\/)?([^:/]+)$/.exec(l);if(!d)throw new TypeError(`Invalid user entity reference "${l}"`);return d[3]}async getIdToken(){return(await this.getSessionAsync()).backstageIdentity.token}getProfile(){return this.getSessionSync().profile}async getProfileInfo(){return(await this.getSessionAsync()).profile}async getBackstageIdentity(){return(await this.getSessionAsync()).backstageIdentity.identity}async getCredentials(){return{token:(await this.getSessionAsync()).backstageIdentity.token}}async signOut(){this.abortController.abort()}getSessionSync(){if(this.state.type==="active")return this.state.session;if(this.state.type==="fetching"&&this.state.previous)return this.state.previous;throw new Error("No session available. Try reloading your browser page.")}async getSessionAsync(){if(this.state.type==="fetching")return this.state.promise;if(this.state.type==="active"&&new Date<this.state.expiresAt)return this.state.session;const o=this.state.type==="active"?this.state.session:void 0,l=this.fetchSession().then(d=>(this.state={type:"active",session:d,expiresAt:fl(d.backstageIdentity.token)},d),d=>{throw this.state={type:"failed",error:d},d});return this.state={type:"fetching",promise:l,previous:o},l}async fetchSession(){const o=await this.options.discoveryApi.getBaseUrl("auth"),l=typeof this.options.headers=="function"?await this.options.headers():this.options.headers,d=new Headers(l);d.set("X-Requested-With","XMLHttpRequest");const m=await fetch(`${o}/${this.options.provider}/refresh`,{signal:this.abortController.signal,headers:d,credentials:"include"});if(!m.ok)throw await ResponseError.fromResponse(m);return proxiedSessionSchema.parse(await m.json())}constructor(o){_define_property(this,"options",void 0),_define_property(this,"abortController",void 0),_define_property(this,"state",void 0),this.options=o,this.abortController=new AbortController,this.state={type:"empty"}}}const Fl=e=>{const o=useApi(discoveryApiRef),[{status:l,error:d},{execute:m}]=useAsync(async()=>{const v=new ProxiedSignInIdentity({provider:e.provider,discoveryApi:o,headers:e.headers});await v.start(),e.onSignInSuccess(v)});return useMountEffect(m),l==="loading"?_jsx(Progress,{}):d?_jsx(ErrorPanel,{title:"You do not appear to be signed in. Please try reloading the browser page.",error:d}):null},gl=(0,g.Z)({container:{padding:0,listStyle:"none"},item:{display:"flex",flexDirection:"column",width:"100%",maxWidth:"400px",margin:0,padding:0}},{name:"BackstageSignInPage"}),Bi=({children:e})=>{const o=gl();return(0,t.jsx)(wt.Z,{component:"li",item:!0,classes:o,children:e})};var is=r(87612);class $i{getUserId(){return"guest"}async getIdToken(){}getProfile(){return{email:"guest@example.com",displayName:"Guest"}}async getProfileInfo(){return{email:"guest@example.com",displayName:"Guest"}}async getBackstageIdentity(){const o="user:default/guest";return{type:"user",userEntityRef:o,ownershipEntityRefs:[o]}}async getCredentials(){return{}}async signOut(){}}function ml(e){const[o,l,d]=e.split(".");return JSON.parse(window.atob(l))}class Di{getUserId(){return this.result.userId}static fromResult(o){return new Di(o)}async getIdToken(){var o,l;return(l=(o=this.result).getIdToken)===null||l===void 0?void 0:l.call(o)}getProfile(){return this.result.profile}async getProfileInfo(){return this.result.profile}async getBackstageIdentity(){const o=await this.getIdToken();if(!o){const m=`user:default/${this.getUserId()}`;return{type:"user",userEntityRef:m,ownershipEntityRefs:[m]}}const{sub:l,ent:d}=ml(o);return{type:"user",userEntityRef:l,ownershipEntityRefs:d!=null?d:[]}}async getCredentials(){var o,l;return{token:await((l=(o=this.result).getIdToken)===null||l===void 0?void 0:l.call(o))}}async signOut(){var o,l;return(l=(o=this.result).signOut)===null||l===void 0?void 0:l.call(o)}constructor(o){(0,is._)(this,"result",void 0),this.result=o}}class as{static createGuest(){return new $i}static fromLegacy(o){return Di.fromResult(o)}static create(o){return new as(o.identity,o.authApi,o.profile)}getUserId(){const o=this.identity.userEntityRef,l=/^([^:/]+:)?([^:/]+\/)?([^:/]+)$/.exec(o);if(!l)throw new TypeError(`Invalid user entity reference "${o}"`);return l[3]}async getIdToken(){return(await this.authApi.getBackstageIdentity()).token}getProfile(){if(!this.profile)throw new Error("The identity API does not implement synchronous profile fetching, use getProfileInfo() instead");return this.profile}async getProfileInfo(){if(this.profilePromise)return await this.profilePromise;try{return this.profilePromise=this.authApi.getProfile(),await this.profilePromise}catch(o){throw this.profilePromise=void 0,o}}async getBackstageIdentity(){return this.identity}async getCredentials(){return{token:(await this.authApi.getBackstageIdentity()).token}}async signOut(){return this.authApi.signOut()}constructor(o,l,d){(0,is._)(this,"identity",void 0),(0,is._)(this,"authApi",void 0),(0,is._)(this,"profile",void 0),(0,is._)(this,"profilePromise",void 0),this.identity=o,this.authApi=l,this.profile=d}}const vl={Component:({config:e,onSignInStarted:o,onSignInSuccess:l,onSignInFailure:d})=>{const{apiRef:m,title:v,message:j}=e,F=(0,h.h_)(m),G=(0,h.h_)(h.VE),U=async()=>{try{o();const fe=await F.getBackstageIdentity({instantPopup:!0});if(!fe)throw d(),new Error(`The ${v} provider is not configured to support sign-in`);const he=await F.getProfile();l(as.create({identity:fe.identity,profile:he,authApi:F}))}catch(fe){d(),G.post(new Kn.SP("Login failed",fe))}};return(0,t.jsx)(Bi,{children:(0,t.jsx)(jr,{variant:"fullHeight",title:v,actions:(0,t.jsx)(ve.Z,{color:"primary",variant:"outlined",onClick:U,children:"Sign In"}),children:(0,t.jsx)(ct.Z,{variant:"body1",children:j})})})},loader:async(e,o)=>{const l=e.get(o),d=await l.getBackstageIdentity({optional:!0});if(!d)return;const m=await l.getProfile();return as.create({identity:d.identity,profile:m,authApi:l})}},yl={Component:({onSignInStarted:e,onSignInSuccess:o})=>(0,t.jsx)(Bi,{children:(0,t.jsx)(jr,{title:"Guest",variant:"fullHeight",actions:(0,t.jsx)(ve.Z,{color:"primary",variant:"outlined",onClick:()=>{e(),o(new $i)},children:"Enter"}),children:(0,t.jsxs)(ct.Z,{variant:"body1",children:["Enter as a Guest User.",(0,t.jsx)("br",{}),"You will not have a verified identity,",(0,t.jsx)("br",{}),"meaning some features might be unavailable."]})})}),loader:async()=>new $i};var xl=r(63955),ba=r(86619),Sa=r(74828),bl=r(45455),Sl=r.n(bl);const Cl=/^[a-z0-9_\-]+\.[a-z0-9_\-]+\.[a-z0-9_\-]+$/i,wl=(0,g.Z)(e=>({form:{display:"flex",flexFlow:"column nowrap"},button:{alignSelf:"center",marginTop:e.spacing(2)}}),{name:"BackstageCustomProvider"}),Ca=e=>{const{ref:o,...l}=e;return{inputRef:o,...l}},jl={Component:({onSignInStarted:e,onSignInSuccess:o})=>{const l=wl(),{register:d,handleSubmit:m,formState:v}=(0,xl.cI)({mode:"onChange"}),{errors:j}=v,F=({userId:G,idToken:U})=>{e(),o(as.fromLegacy({userId:G,getIdToken:U!==void 0?async()=>U:void 0,profile:{email:`${G}@example.com`}}))};return(0,t.jsx)(Bi,{children:(0,t.jsxs)(jr,{title:"Custom User",variant:"fullHeight",children:[(0,t.jsxs)(ct.Z,{variant:"body1",children:["Enter your own User ID and credentials.",(0,t.jsx)("br",{}),"This selection will not be stored."]}),(0,t.jsxs)("form",{className:l.form,onSubmit:m(F),children:[(0,t.jsxs)(uo.Z,{children:[(0,t.jsx)(ba.Z,{...Ca(d("userId",{required:!0})),label:"User ID",margin:"normal",error:Boolean(j.userId)}),j.userId&&(0,t.jsx)(Sa.Z,{error:!0,children:j.userId.message})]}),(0,t.jsxs)(uo.Z,{children:[(0,t.jsx)(ba.Z,{...Ca(d("idToken",{required:!1,validate:G=>!G||Cl.test(G)||"Token is not a valid OpenID Connect JWT Token"})),label:"ID Token (optional)",margin:"normal",autoComplete:"off",error:Boolean(j.idToken)}),j.idToken&&(0,t.jsx)(Sa.Z,{error:!0,children:j.idToken.message})]}),(0,t.jsx)(ve.Z,{type:"submit",color:"primary",variant:"outlined",className:l.button,disabled:!(v!=null&&v.isDirty)||!Sl()(j),children:"Continue"})]})]})})},loader:async()=>{}},wo="@backstage/core:SignInPage:provider",wa={guest:yl,custom:jl,common:vl};function ja(e,o){if(e in o)throw new Error(`"${e}" ID is duplicated. IDs of identity providers have to be unique.`)}function Gl(e){return e.reduce((l,d)=>{if(typeof d=="string")return ja(d,l),l[d]={components:wa[d],id:d},l;const{id:m}=d;return ja(m,l),l[m]={components:wa.common,id:m,config:d},l},{})}const Kl=(e,o)=>{const l=useApi(errorApiRef),d=useApiHolder(),[m,v]=useState(!0),j=useCallback(G=>{o(IdentityApiSignOutProxy.from({identityApi:G,signOut:async()=>{var U;localStorage.removeItem(wo),await((U=G.signOut)===null||U===void 0?void 0:U.call(G))}}))},[o]);useLayoutEffect(()=>{var G;if(!m)return;const U=localStorage.getItem(wo);if(U===null){v(!1);return}const fe=e[U];if(!fe){v(!1);return}let he=!1;return fe.components.loader(d,(G=fe.config)===null||G===void 0?void 0:G.apiRef).then(Pe=>{if(he){localStorage.removeItem(wo);return}Pe?j(Pe):v(!1)}).catch(Pe=>{localStorage.removeItem(wo),!he&&(l.post(Pe),v(!1))}),()=>{he=!0}},[m,l,o,d,e,j]);const F=useMemo(()=>Object.keys(e).map(G=>{const U=e[G],{Component:fe}=U.components,he=Ue=>{j(Ue)},Pe=()=>{var Ue;localStorage.setItem(wo,(U==null||(Ue=U.config)===null||Ue===void 0?void 0:Ue.id)||U.id)},Te=()=>{localStorage.removeItem(wo)};return _jsx(fe,{config:U.config,onSignInStarted:Pe,onSignInSuccess:he,onSignInFailure:Te},U.id)}),[e,j]);return[m,F]},El=({onSignInSuccess:e,providers:o=[],title:l,align:d="left"})=>{const m=useApi(configApiRef),v=useStyles(),j=getSignInProviders(o),[F,G]=useSignInProviders(j,e);return F?_jsx(Progress,{}):_jsxs(Page,{themeId:"home",children:[_jsx(Header,{title:m.getString("app.title")}),_jsxs(Content,{children:[l&&_jsx(ContentHeader,{title:l,textAlign:d}),_jsx(Grid,{container:!0,justifyContent:d==="center"?d:"flex-start",spacing:2,component:"ul",classes:v,children:G})]})]})},Al=({provider:e,auto:o,onSignInSuccess:l})=>{const d=useStyles(),m=useApi(e.apiRef),v=useApi(configApiRef),[j,F]=useState(),[G,U]=useState(!1),fe=async({checkExisting:he,showPopup:Pe})=>{try{let Te;if(he&&(Te=await m.getBackstageIdentity({optional:!0})),!Te&&(Pe||o)&&(U(!0),Te=await m.getBackstageIdentity({instantPopup:!0}),!Te))throw new Error(`The ${e.title} provider is not configured to support sign-in`);if(!Te){U(!0);return}const Ue=await m.getProfile();l(UserIdentity.create({identity:Te.identity,authApi:m,profile:Ue}))}catch(Te){F(Te),U(!0)}};return useMountEffect(()=>fe({checkExisting:!0})),G?_jsxs(Page,{themeId:"home",children:[_jsx(Header,{title:v.getString("app.title")}),_jsx(Content,{children:_jsx(Grid,{container:!0,justifyContent:"center",spacing:2,component:"ul",classes:d,children:_jsx(GridItem,{children:_jsxs(InfoCard,{variant:"fullHeight",title:e.title,actions:_jsx(Button,{color:"primary",variant:"outlined",onClick:()=>{fe({showPopup:!0})},children:"Sign In"}),children:[_jsx(Typography,{variant:"body1",children:e.message}),j&&j.name!=="PopupRejectedError"&&_jsx(Typography,{variant:"body1",color:"error",children:j.message})]})})})})]}):_jsx(Progress,{})};function Yl(e){return"provider"in e?_jsx(Al,{...e}):_jsx(El,{...e})}const Tl=(0,g.Z)(e=>({root:{padding:e.spacing(0,2,0,2.5),minHeight:e.spacing(3)},indicator:{backgroundColor:e.palette.info.main,height:e.spacing(.3)}}),{name:"BackstageTabbedCard"}),Rl=(0,Sn.Z)(e=>({root:{padding:e.spacing(2,2,2,2.5),display:"inline-block"},title:{fontWeight:700},subheader:{paddingTop:e.spacing(1)}}),{name:"BackstageTabbedCardBoldHeader"})(ro.Z);function Jl(e){const{slackChannel:o,errorBoundaryProps:l,children:d,title:m,deepLink:v,value:j,onChange:F}=e,G=Tl(),[U,fe]=useState(0),he=F||((Ue,_e)=>fe(_e));let Pe;j?React.Children.map(d,Ue=>{if(React.isValidElement(Ue)&&(Ue==null?void 0:Ue.props.value)===j){var _e;Pe=Ue==null||(_e=Ue.props)===null||_e===void 0?void 0:_e.children}}):React.Children.map(d,(Ue,_e)=>{React.isValidElement(Ue)&&_e===U&&(Pe=Ue==null?void 0:Ue.props.children)});const Te=l||(o?{slackChannel:o}:{});return _jsx(Card,{children:_jsxs(ErrorBoundary,{...Te,children:[m&&_jsx(Rl,{title:m}),_jsx(Tabs,{selectionFollowsFocus:!0,classes:G,value:j||U,onChange:he,children:d}),_jsx(Divider,{}),_jsx(CardContent,{children:Pe}),v&&_jsx(BottomLink,{...v})]})})}const Il=(0,g.Z)(e=>({root:{minWidth:e.spacing(6),minHeight:e.spacing(3),margin:e.spacing(0,2,0,0),padding:e.spacing(.5,0,.5,0),textTransform:"none","&:hover":{opacity:1,backgroundColor:"transparent",color:e.palette.text.primary}},selected:{fontWeight:e.typography.fontWeightBold}}),{name:"BackstageCardTab"});function Ql(e){const{children:o,...l}=e,d=Il();return _jsx(Tab,{disableRipple:!0,classes:d,...l})}},60871:function(Ct,$e,r){"use strict";r.d($e,{fC:function(){return g},CL:function(){return Qe},sM:function(){return ie},$v:function(){return ze},v_:function(){return z},hg:function(){return yt},uB:function(){return Le},R5:function(){return tt},bq:function(){return O},Km:function(){return oe},Ds:function(){return ot},ni:function(){return w},T0:function(){return I},CO:function(){return ct},x8:function(){return Un},rx:function(){return Tn},YO:function(){return vn},P4:function(){return wt},NT:function(){return Jt},NW:function(){return He},VE:function(){return st},W0:function(){return St},gP:function(){return It},IY:function(){return mt},F4:function(){return ne},ux:function(){return T},Kp:function(){return ee},$4:function(){return xt},p_:function(){return P},ZM:function(){return lt},D:function(){return $},gW:function(){return L},E6:function(){return Pt},z$:function(){return _t},h_:function(){return ve},I_:function(){return B},qD:function(){return ge},vJ:function(){return jn},tg:function(){return wn},Oi:function(){return Mn}});var t=r(52322),h=r(51837),H=r(2784);const f=(0,h.CT)("analytics-context"),W=()=>{const Ce=(0,H.useContext)(f);if(Ce===void 0)return{routeRef:"unknown",pluginId:"root",extension:"App"};const ce=Ce.atVersion(1);if(ce===void 0)throw new Error("No context found for version 1.");return ce},g=Ce=>{const{attributes:ce,children:Oe}=Ce,Xe={...W(),...ce},se=(0,h.EI)({1:Xe});return(0,t.jsx)(f.Provider,{value:se,children:Oe})};function u(Ce,ce){const Oe=Me=>_jsx(g,{attributes:ce,children:_jsx(Ce,{...Me})});return Oe.displayName=`WithAnalyticsContext(${Ce.displayName||Ce.name||"Component"})`,Oe}function B(){const Ce=(0,h.Vt)("api-context");if(!Ce)throw new Error("API context is not available");const ce=Ce.atVersion(1);if(!ce)throw new Error("ApiContext v1 not available");return ce}function ve(Ce){const Oe=B().get(Ce);if(!Oe)throw new Error(`No implementation available for ${Ce}`);return Oe}function ue(Ce){return function(Oe){const Me=se=>{const D=B(),me={};for(const De in Ce)if(Ce.hasOwnProperty(De)){const et=Ce[De],it=D.get(et);if(!it)throw new Error(`No implementation available for ${et}`);me[De]=it}return _jsx(Oe,{...se,...me})},Xe=Oe.displayName||Oe.name||"Component";return Me.displayName=`withApis(${Xe})`,Me}}var V=r(87612);class K{get id(){return this.config.id}get T(){throw new Error(`tried to read ApiRef.T of ${this}`)}toString(){return`apiRef{${this.config.id}}`}constructor(ce){if((0,V._)(this,"config",void 0),this.config=ce,!ce.id.split(".").flatMap(Me=>Me.split("-")).every(Me=>Me.match(/^[a-z][a-z0-9]*$/)))throw new Error(`API id must only contain period separated lowercase alphanum tokens with dashes, got '${ce.id}'`)}}function I(Ce){return new K(Ce)}function w(Ce,ce){return"id"in Ce?{api:Ce,deps:{},factory:()=>ce}:Ce}var ie;(function(Ce){Ce.SignedIn="SignedIn",Ce.SignedOut="SignedOut"})(ie||(ie={}));const ee=I({id:"core.auth.google"}),ne=I({id:"core.auth.github"}),$=I({id:"core.auth.okta"}),T=I({id:"core.auth.gitlab"}),P=I({id:"core.auth.microsoft"}),L=I({id:"core.auth.onelogin"}),O=I({id:"core.auth.bitbucket"}),oe=I({id:"core.auth.bitbucket-server"}),Le=I({id:"core.auth.atlassian"}),ze=I({id:"core.alert"}),z=I({id:"core.analytics"}),yt=I({id:"core.apptheme"}),ot=I({id:"core.config"}),He=I({id:"core.discovery"}),st=I({id:"core.error"});var Qe;(function(Ce){Ce[Ce.None=0]="None",Ce[Ce.Active=1]="Active"})(Qe||(Qe={}));const St=I({id:"core.featureflags"}),It=I({id:"core.fetch"}),xt=I({id:"core.identity"}),lt=I({id:"core.oauthrequest"}),Pt=I({id:"core.storage"});class Nt{setContext(ce){this.context=ce}captureEvent(ce,Oe,{value:Me,attributes:Xe}={}){try{this.analyticsApi.captureEvent({action:ce,subject:Oe,value:Me,attributes:Xe,context:this.context})}catch(se){console.warn("Error during analytics event capture. %o",se)}}constructor(ce,Oe={routeRef:"unknown",pluginId:"root",extension:"App"}){(0,V._)(this,"analyticsApi",void 0),(0,V._)(this,"context",void 0),this.analyticsApi=ce,this.context=Oe}}function We(){try{return ve(z)}catch{return{captureEvent:()=>{}}}}function _t(){const Ce=(0,H.useRef)(null),ce=W(),Oe=We();function Me(){return Ce.current===null&&(Ce.current=new Nt(Oe)),Ce.current}const Xe=Me();return Xe.setContext(ce),Xe}const ge=()=>{const Ce=(0,h.Vt)("app-context");if(!Ce)throw new Error("App context is not available");const ce=Ce.atVersion(1);if(!ce)throw new Error("AppContext v1 not available");return ce},Se=(0,h.uW)("component-data-store",()=>new WeakMap),Fe="__backstage_data";function tt(Ce,ce,Oe){const Me=Ce;var Xe;let se=(Xe=Me[Fe])!==null&&Xe!==void 0?Xe:Se.get(Ce);if(se||(se={map:new Map},Object.defineProperty(Me,Fe,{enumerable:!1,configurable:!0,writable:!1,value:se}),Se.set(Ce,se)),se.map.has(ce)){const D=Ce.displayName||Ce.name;throw new Error(`Attempted to attach duplicate data "${ce}" to component "${D}"`)}se.map.set(ce,Oe)}function mt(Ce,ce){if(!Ce)return;const Oe=Ce.type;if(!Oe)return;var Me;const Xe=(Me=Oe[Fe])!==null&&Me!==void 0?Me:Se.get(Oe);if(Xe)return Xe.map.get(ce)}const bt=(0,h.uW)("route-ref-type",()=>Symbol("route-ref-type"));let pt=bt,Ot=pt;class Ht{get title(){return this.id}toString(){return`routeRef{type=absolute,id=${this.id}}`}constructor(ce,Oe){(0,V._)(this,"id",void 0),(0,V._)(this,"params",void 0),(0,V._)(this,Ot,void 0),this.id=ce,this.params=Oe,this[pt]="absolute"}}function Jt(Ce){var ce;return new Ht(Ce.id,(ce=Ce.params)!==null&&ce!==void 0?ce:[])}const Bt=/^\w+$/;let un=null,Yt=null;class pn{toString(){return`routeRef{type=sub,id=${this.id}}`}constructor(ce,Oe,Me,Xe){_define_property(this,"id",void 0),_define_property(this,"path",void 0),_define_property(this,"parent",void 0),_define_property(this,"params",void 0),_define_property(this,Yt,void 0),this.id=ce,this.path=Oe,this.parent=Me,this.params=Xe,this[un]="sub"}}function Fn(Ce){const{id:ce,path:Oe,parent:Me}=Ce,Xe=Oe.split("/").filter(me=>me.startsWith(":")).map(me=>me.substring(1)),se=[...Me.params,...Xe];if(Me.params.some(me=>Xe.includes(me)))throw new Error("SubRouteRef may not have params that overlap with its parent");if(!Oe.startsWith("/"))throw new Error(`SubRouteRef path must start with '/', got '${Oe}'`);if(Oe.endsWith("/"))throw new Error(`SubRouteRef path must not end with '/', got '${Oe}'`);for(const me of Xe)if(!Bt.test(me))throw new Error(`SubRouteRef path has invalid param, got '${me}'`);return new pn(ce,Oe,Me,se)}let Pn=bt,fn=Pn;class Ln{toString(){return`routeRef{type=external,id=${this.id}}`}constructor(ce,Oe,Me){(0,V._)(this,"id",void 0),(0,V._)(this,"params",void 0),(0,V._)(this,"optional",void 0),(0,V._)(this,fn,void 0),this.id=ce,this.params=Oe,this.optional=Me,this[Pn]="external"}}function Un(Ce){var ce;return new Ln(Ce.id,(ce=Ce.params)!==null&&ce!==void 0?ce:[],Boolean(Ce.optional))}var tn=r(73557);function wn(Ce){const{pathname:ce}=(0,tn.TH)(),Oe=(0,h.Vt)("routing-context");if(!Oe)throw new Error("Routing context is not available");const Me=Oe.atVersion(1),Xe=(0,H.useMemo)(()=>Me&&Me.resolve(Ce,{pathname:ce}),[Me,Ce,ce]);if(!Oe)throw new Error("useRouteRef used outside of routing context");if(!Me)throw new Error("RoutingContext v1 not available");const se="optional"in Ce&&Ce.optional;if(!Xe&&!se)throw new Error(`No path for ${Ce}`);return Xe}function Mn(Ce){return(0,tn.UO)()}class ut extends H.Component{static getDerivedStateFromError(ce){return{error:ce}}render(){const{error:ce}=this.state,{app:Oe,plugin:Me}=this.props,{ErrorBoundaryFallback:Xe}=Oe.getComponents();return ce?(0,t.jsx)(Xe,{error:ce,resetError:this.handleErrorReset,plugin:Me}):this.props.children}constructor(...ce){super(...ce),(0,V._)(this,"state",{error:void 0}),(0,V._)(this,"handleErrorReset",()=>{this.setState({error:void 0})})}}var _n=r(64355);function wt(Ce){const{component:ce,mountPoint:Oe,name:Me}=Ce;return vn({component:{lazy:()=>ce().then(Xe=>{const se=me=>{try{wn(Oe)}catch(De){if(typeof De=="object"&&De!==null){const{message:et}=De;if(typeof et=="string"&&et.startsWith("No path for "))throw new Error(`Routable extension component with mount point ${Oe} was not discovered in the app element tree. Routable extension components may not be rendered by other components and must be directly available as an element within the App provider component.`)}throw De}return(0,t.jsx)(Xe,{...me})},D=Me||Xe.displayName||Xe.name||"LazyComponent";return se.displayName=`RoutableExtension(${D})`,se},Xe=>D=>{const me=ge(),{BootErrorPage:De}=me.getComponents();return(0,t.jsx)(De,{step:"load-chunk",error:Xe})})},data:{"core.mountPoint":Oe},name:Me})}function ct(Ce){const{component:ce,name:Oe}=Ce;return vn({component:ce,name:Oe})}function vn(Ce){const{data:ce={},name:Oe}=Ce;Oe||console.warn("Declaring extensions without name is DEPRECATED. Make sure that all usages of createReactExtension, createComponentExtension and createRoutableExtension provide a name.");let Me;if("lazy"in Ce.component){const se=Ce.component.lazy;Me=(0,H.lazy)(()=>se().then(D=>({default:D})))}else Me=Ce.component.sync;const Xe=Oe||Me.displayName||Me.name||"Component";return{expose(se){const D=me=>{const De=ge(),{Progress:et}=De.getComponents(),it=ce==null?void 0:ce["core.mountPoint"];return(0,t.jsx)(H.Suspense,{fallback:(0,t.jsx)(et,{}),children:(0,t.jsx)(ut,{app:De,plugin:se,children:(0,t.jsx)(g,{attributes:{pluginId:se.getId(),...Oe&&{extension:Oe},...it&&{routeRef:it.id}},children:(0,t.jsx)(_n.o,{plugin:se,children:(0,t.jsx)(Me,{...me})})})})})};tt(D,"core.plugin",se),tt(D,"core.extensionName",Oe);for(const[me,De]of Object.entries(ce))tt(D,me,De);return D.displayName=`Extension(${Xe})`,D}}}function Kt(Ce,ce,Oe,Me){return H.Children.toArray(Ce).flatMap(Xe=>{if(!(0,H.isValidElement)(Xe))return[];if(Xe.type===H.Fragment)return Kt(Xe.props.children,ce,Oe,Me);if(mt(Xe,"core.featureFlagged")){const se=Xe.props;return("with"in se?ce.isActive(se.with):!ce.isActive(se.without))?Kt(Xe.props.children,ce,Oe,Me):[]}if(Oe===void 0||Oe(Xe))return[Xe];if(Me)throw new Error(Me);return Kt(Xe.props.children,ce,Oe,Me)})}class hn{selectByComponentData(ce){const Oe=Kt(this.node,this.featureFlagsApi,Me=>mt(Me,ce.key)!==void 0,ce.withStrictError);return new hn(Oe,this.featureFlagsApi)}findComponentData(ce){return Kt(this.node,this.featureFlagsApi,Me=>mt(Me,ce.key)!==void 0).map(Me=>mt(Me,ce.key)).filter(Me=>Me!==void 0)}getElements(){return Kt(this.node,this.featureFlagsApi)}constructor(ce,Oe){(0,V._)(this,"node",void 0),(0,V._)(this,"featureFlagsApi",void 0),this.node=ce,this.featureFlagsApi=Oe}}function jn(Ce,ce,Oe=[]){const Me=ve(St),Xe=new hn(Ce,Me);return(0,H.useMemo)(()=>ce(Xe),[Ce,...Oe])}class ln{getId(){return this.config.id}getApis(){var ce;return(ce=this.config.apis)!==null&&ce!==void 0?ce:[]}getFeatureFlags(){var ce,Oe;return(Oe=(ce=this.config.featureFlags)===null||ce===void 0?void 0:ce.slice())!==null&&Oe!==void 0?Oe:[]}get routes(){var ce;return(ce=this.config.routes)!==null&&ce!==void 0?ce:{}}get externalRoutes(){var ce;return(ce=this.config.externalRoutes)!==null&&ce!==void 0?ce:{}}provide(ce){return ce.expose(this)}__experimentalReconfigure(ce){this.config.__experimentalConfigure&&(this.options=this.config.__experimentalConfigure(ce))}getPluginOptions(){this.config.__experimentalConfigure&&!this.options&&(this.options=this.config.__experimentalConfigure());var ce;return(ce=this.options)!==null&&ce!==void 0?ce:{}}toString(){return`plugin{${this.config.id}}`}constructor(ce){(0,V._)(this,"config",void 0),(0,V._)(this,"options",void 0),this.config=ce,this.options=void 0}}function Tn(Ce){return new ln(Ce)}},64355:function(Ct,$e,r){"use strict";r.d($e,{o:function(){return W},y:function(){return g}});var t=r(52322),h=r(51837),H=r(2784);const f="plugin-context",W=u=>{const{children:B,plugin:ve}=u,{Provider:ue}=(0,h.CT)(f);return(0,t.jsx)(ue,{value:(0,h.EI)({1:{plugin:ve}}),children:B})};function g(){const u=(0,h.Vt)(f);if(!u)throw new Error("Plugin Options context is not available");const B=u.atVersion(1);if(!B)throw new Error("Plugin Options v1 is not available");return B.plugin.getPluginOptions()}},23054:function(Ct,$e,r){"use strict";r.d($e,{SP:function(){return ee},dR:function(){return K},VL:function(){return $},BD:function(){return h}});function t(T){if(typeof T!="object"||T===null||Array.isArray(T))return!1;const P=T;return!(typeof P.name!="string"||P.name===""||typeof P.message!="string")}function h(T){if(typeof T!="object"||T===null||Array.isArray(T))throw new Error(`Encountered invalid error, not an object, got '${T}'`);const P=T;if(typeof P.name!="string"||P.name==="")throw new Error(`Encountered error object without a name, got '${T}'`);if(typeof P.message!="string")throw new Error(`Encountered error object without a message, got '${T}'`)}var H=r(87612),f=r(24852);function W(T,P){const O={name:"Unknown",message:"<no reason given>",...serializeErrorInternal(T)};return P!=null&&P.includeStack||delete O.stack,O}function g(T){const P=(0,f.deserializeError)(T);return T.stack||(P.stack=void 0),P}function u(T){if(t(T)){const P=String(T);return P!=="[object Object]"?P:`${T.name}: ${T.message}`}return`unknown error '${T}'`}class B extends Error{constructor(P,L){var O;let oe=P;if(L!==void 0){const Le=u(L);oe?oe+=`; caused by ${Le}`:oe=`caused by ${Le}`}super(oe),(0,H._)(this,"cause",void 0),(O=Error.captureStackTrace)===null||O===void 0||O.call(Error,this,this.constructor),this.name=this.constructor.name,this.cause=t(L)?L:void 0}}class ve extends null{}class ue extends null{}class V extends null{}class K extends B{}class I extends null{}class w extends null{}class ie extends null{}class ee extends B{constructor(P,L){super(P,L),this.name=t(L)?L.name:"Error"}}async function ne(T){try{const L=await T.text();if(L){var P;if(!((P=T.headers.get("content-type"))===null||P===void 0)&&P.startsWith("application/json"))try{const O=JSON.parse(L);if(O.error&&O.response)return O}catch{}return{error:{name:"Error",message:`Request failed with status ${T.status} ${T.statusText}, ${L}`},response:{statusCode:T.status}}}}catch{}return{error:{name:"Error",message:`Request failed with status ${T.status} ${T.statusText}`},response:{statusCode:T.status}}}class $ extends Error{static async fromResponse(P){const L=await ne(P),O=L.response.statusCode||P.status,oe=L.error.name||P.statusText,Le=`Request failed with ${O} ${oe}`,ze=g(L.error);return new $({message:Le,response:P,data:L,cause:ze})}constructor(P){super(P.message),(0,H._)(this,"response",void 0),(0,H._)(this,"body",void 0),(0,H._)(this,"cause",void 0),this.name="ResponseError",this.response=P.response,this.body=P.data,this.cause=P.cause}}},32838:function(Ct,$e,r){"use strict";r.d($e,{nW:function(){return ee},ae:function(){return V},q3:function(){return K}});var t=r(60871);const h=(0,t.T0)({id:"core.scmauth"});var H=new WeakMap;class f{async getCredentials($){const T=new URL($.url),P=_class_private_field_get(this,H).find(L=>L.isUrlSupported(T));if(!P)throw new Error(`No auth provider available for '${$.url}', see https://backstage.io/link?scm-auth`);return P.getCredentials($)}constructor($){_class_private_field_init(this,H,{writable:!0,value:void 0}),_class_private_field_set(this,H,$)}}var W=new WeakMap,g=new WeakMap,u=new WeakMap,B=new WeakMap;class ve{static createDefaultApiFactory(){return createApiFactory({api:scmAuthApiRef,deps:{github:githubAuthApiRef,gitlab:gitlabAuthApiRef,azure:microsoftAuthApiRef,bitbucket:bitbucketAuthApiRef},factory:({github:$,gitlab:T,azure:P,bitbucket:L})=>ve.merge(ve.forGithub($),ve.forGitlab(T),ve.forAzure(P),ve.forBitbucket(L))})}static forAuthApi($,T){return new ve("generic",$,T.host,T.scopeMapping)}static forGithub($,T){var P;const L=(P=T==null?void 0:T.host)!==null&&P!==void 0?P:"github.com";return new ve("github",$,L,{default:["repo","read:org","read:user"],repoWrite:["gist"]})}static forGitlab($,T){var P;const L=(P=T==null?void 0:T.host)!==null&&P!==void 0?P:"gitlab.com";return new ve("gitlab",$,L,{default:["read_user","read_api","read_repository"],repoWrite:["write_repository","api"]})}static forAzure($,T){var P;const L=(P=T==null?void 0:T.host)!==null&&P!==void 0?P:"dev.azure.com";return new ve("azure",$,L,{default:["vso.build","vso.code","vso.graph","vso.project","vso.profile"],repoWrite:["vso.code_manage"]})}static forBitbucket($,T){var P;const L=(P=T==null?void 0:T.host)!==null&&P!==void 0?P:"bitbucket.org";return new ve("bitbucket",$,L,{default:["account","team","pullrequest","snippet","issue"],repoWrite:["pullrequest:write","snippet:write","issue:write"]})}static merge(...$){return new f($)}isUrlSupported($){return $.host===_class_private_field_get(this,g)}getAdditionalScopesForProvider($){var T;if(!($!=null&&$.customScopes)||_class_private_field_get(this,B)==="generic")return[];var P;return(P=(T=$.customScopes)===null||T===void 0?void 0:T[_class_private_field_get(this,B)])!==null&&P!==void 0?P:[]}async getCredentials($){const{url:T,additionalScope:P,...L}=$,O=_class_private_field_get(this,u).default.slice();P!=null&&P.repoWrite&&O.push(..._class_private_field_get(this,u).repoWrite);const oe=this.getAdditionalScopesForProvider(P);oe.length&&O.push(...oe);const Le=[...new Set(O)],ze=await _class_private_field_get(this,W).getAccessToken(Le,L);return{token:ze,headers:{Authorization:`Bearer ${ze}`}}}constructor($,T,P,L){_class_private_field_init(this,W,{writable:!0,value:void 0}),_class_private_field_init(this,g,{writable:!0,value:void 0}),_class_private_field_init(this,u,{writable:!0,value:void 0}),_class_private_field_init(this,B,{writable:!0,value:void 0}),_class_private_field_set(this,W,T),_class_private_field_set(this,g,P),_class_private_field_set(this,u,L),_class_private_field_set(this,B,$)}}var ue=r(79158);class V{static fromConfig($){return ue.Lx.fromConfig($)}}const K=(0,t.T0)({id:"integration.scmintegrations"});var I=r(52322),w=r(73250),ie=r(2784);const ee=ne=>{const{type:$}=ne,T=(0,t.qD)(),P=w.Z;var L;const O=$&&(L=T.getSystemIcon($))!==null&&L!==void 0?L:P;return(0,I.jsx)(O,{})}},79158:function(Ct,$e,r){"use strict";r.d($e,{Lx:function(){return er},BT:function(){return dt}});var t=r(87612),h=r(82717),H=r.n(h),f=r(76635);function W(S){const c=new URL("http://example.com");return c.host=S,c.host===S}function g(S){try{return new URL(S),!0}catch{return!1}}function u(S,c){return{list(){return S},byUrl(b){try{const E=typeof b=="string"?new URL(b):b;return S.find(Q=>c(Q)===E.host)}catch{return}},byHost(b){return S.find(E=>c(E)===b)}}}function B(S){const{url:c,base:b,lineNumber:E}=S;try{return new URL(c),c}catch{}let Q;if(c.startsWith("/")){const{filepath:be}=H()(b);Q=new URL(b);const je=(0,f.trimEnd)(Q.pathname.substring(0,Q.pathname.length-be.length),"/");Q.pathname=`${je}${c}`}else Q=new URL(c,b);return Q.search=new URL(b).search,E&&(Q.hash=`L${E}`),Q.toString()}function ve(S){beforeAll(()=>S.listen({onUnhandledRequest:"error"})),afterAll(()=>S.close()),afterEach(()=>S.resetHandlers())}const ue="amazonaws.com";function V(S){const c=S.getOptionalString("endpoint");var b;const E=(b=S.getOptionalBoolean("s3ForcePathStyle"))!==null&&b!==void 0?b:!1;let Q,be;if(c){try{const yn=new URL(c);Q=yn.host,be=yn.pathname}catch{throw new Error(`invalid awsS3 integration config, endpoint '${c}' is not a valid URL`)}if(be!=="/")throw new Error(`invalid awsS3 integration config, endpoints cannot contain path, got '${c}'`)}else Q=ue;const je=S.getOptionalString("accessKeyId"),ke=S.getOptionalString("secretAccessKey"),ht=S.getOptionalString("roleArn"),ft=S.getOptionalString("externalId");return{host:Q,endpoint:c,s3ForcePathStyle:E,accessKeyId:je,secretAccessKey:ke,roleArn:ht,externalId:ft}}function K(S){const c=S.map(V);return c.some(b=>b.host===ue)||c.push({host:ue}),c}class I{get type(){return"awsS3"}get title(){return this.integrationConfig.host}get config(){return this.integrationConfig}resolveUrl(c){return B(c)}resolveEditUrl(c){return c}constructor(c){(0,t._)(this,"integrationConfig",void 0),this.integrationConfig=c}}(0,t._)(I,"factory",({config:S})=>{var c;const b=K((c=S.getOptionalConfigArray("integrations.awsS3"))!==null&&c!==void 0?c:[]);return u(b.map(E=>new I(E)),E=>E.config.host)});var w=r(88412),ie=r(50629),ee=r(80956);const ne="GB";var $=new WeakMap,T=new WeakMap,P=new WeakMap,L=new WeakMap,O=new WeakMap,oe=new WeakMap,Le=new WeakMap;class ze{static fromRepoUrl(c){const b=new URL(c);let E,Q,be;const je=b.pathname.split("/").map(kn=>decodeURIComponent(kn));if(je[2]==="_git"?(E=je[1],Q=be=je[3]):je[3]==="_git"?(E=je[1],Q=je[2],be=je[4]):je[4]==="_git"&&(E=`${je[1]}/${je[2]}`,Q=je[3],be=je[5]),!E||!Q||!be)throw new Error("Azure URL must point to a git repository");var ke;const ht=(ke=b.searchParams.get("path"))!==null&&ke!==void 0?ke:void 0;let ft;const yn=b.searchParams.get("version");if(yn){if(yn.slice(0,2)!=="GB")throw new Error("Azure URL version must point to a git branch");ft=yn.slice(2)}return new ze(b.origin,E,Q,be,ht,ft)}toRepoUrl(){let c;return(0,w._)(this,P)===(0,w._)(this,L)?c=(0,w._)(this,Le).call(this,(0,w._)(this,T),"_git",(0,w._)(this,L)):c=(0,w._)(this,Le).call(this,(0,w._)(this,T),(0,w._)(this,P),"_git",(0,w._)(this,L)),(0,w._)(this,O)&&c.searchParams.set("path",(0,w._)(this,O)),(0,w._)(this,oe)&&c.searchParams.set("version",ne+(0,w._)(this,oe)),c.toString()}toFileUrl(){if(!(0,w._)(this,O))throw new Error("Azure URL must point to a specific path to be able to download a file");const c=(0,w._)(this,Le).call(this,(0,w._)(this,T),(0,w._)(this,P),"_apis","git","repositories",(0,w._)(this,L),"items");return c.searchParams.set("api-version","6.0"),c.searchParams.set("path",(0,w._)(this,O)),(0,w._)(this,oe)&&c.searchParams.set("version",(0,w._)(this,oe)),c.toString()}toArchiveUrl(){const c=(0,w._)(this,Le).call(this,(0,w._)(this,T),(0,w._)(this,P),"_apis","git","repositories",(0,w._)(this,L),"items");return c.searchParams.set("recursionLevel","full"),c.searchParams.set("download","true"),c.searchParams.set("api-version","6.0"),(0,w._)(this,O)&&c.searchParams.set("scopePath",(0,w._)(this,O)),(0,w._)(this,oe)&&c.searchParams.set("version",(0,w._)(this,oe)),c.toString()}toCommitsUrl(){const c=(0,w._)(this,Le).call(this,(0,w._)(this,T),(0,w._)(this,P),"_apis","git","repositories",(0,w._)(this,L),"commits");return c.searchParams.set("api-version","6.0"),(0,w._)(this,oe)&&c.searchParams.set("searchCriteria.itemVersion.version",(0,w._)(this,oe)),c.toString()}getOwner(){return(0,w._)(this,T)}getProject(){return(0,w._)(this,P)}getRepo(){return(0,w._)(this,L)}getPath(){return(0,w._)(this,O)}getRef(){return(0,w._)(this,oe)}constructor(c,b,E,Q,be,je){(0,ie._)(this,$,{writable:!0,value:void 0}),(0,ie._)(this,T,{writable:!0,value:void 0}),(0,ie._)(this,P,{writable:!0,value:void 0}),(0,ie._)(this,L,{writable:!0,value:void 0}),(0,ie._)(this,O,{writable:!0,value:void 0}),(0,ie._)(this,oe,{writable:!0,value:void 0}),(0,ie._)(this,Le,{writable:!0,value:(...ke)=>{const ht=new URL((0,w._)(this,$));return ht.pathname=ke.map(ft=>encodeURIComponent(ft)).join("/"),ht}}),(0,ee._)(this,$,c),(0,ee._)(this,T,b),(0,ee._)(this,P,E),(0,ee._)(this,L,Q),(0,ee._)(this,O,be),(0,ee._)(this,oe,je)}}const z="dev.azure.com";function yt(S){var c;const b=(c=S.getOptionalString("host"))!==null&&c!==void 0?c:z,E=S.getOptionalString("token");if(!W(b))throw new Error(`Invalid Azure integration config, '${b}' is not a valid host`);return{host:b,token:E}}function ot(S){const c=S.map(yt);return c.some(b=>b.host===z)||c.push({host:z}),c}class He{get type(){return"azure"}get title(){return this.integrationConfig.host}get config(){return this.integrationConfig}resolveUrl(c){const{url:b,base:E}=c;if(g(b))return b;try{const be=ze.fromRepoUrl(E),je=new URL(E);var Q;const ke=new URL(`https://a.com${(Q=be.getPath())!==null&&Q!==void 0?Q:""}`),ht=new URL(b,ke).pathname;return je.searchParams.set("path",ht),c.lineNumber&&(je.searchParams.set("line",String(c.lineNumber)),je.searchParams.set("lineEnd",String(c.lineNumber+1)),je.searchParams.set("lineStartColumn","1"),je.searchParams.set("lineEndColumn","1")),je.toString()}catch{return new URL(b,E).toString()}}resolveEditUrl(c){return c}constructor(c){(0,t._)(this,"integrationConfig",void 0),this.integrationConfig=c}}(0,t._)(He,"factory",({config:S})=>{var c;const b=ot((c=S.getOptionalConfigArray("integrations.azure"))!==null&&c!==void 0?c:[]);return u(b.map(E=>new He(E)),E=>E.config.host)});var st=r(48834).lW;function Qe(S){return AzureUrl.fromRepoUrl(S).toFileUrl()}function St(S){return AzureUrl.fromRepoUrl(S).toArchiveUrl()}function It(S){return AzureUrl.fromRepoUrl(S).toCommitsUrl()}function xt(S,c){const b=c?{...c}:{};if(S.token){const E=st.from(`:${S.token}`,"utf8");b.Authorization=`Basic ${E.toString("base64")}`}return{headers:b}}const lt="bitbucket.org",Pt="https://api.bitbucket.org/2.0";function Nt(S){var c;const b=(c=S.getOptionalString("host"))!==null&&c!==void 0?c:lt;let E=S.getOptionalString("apiBaseUrl");const Q=S.getOptionalString("token"),be=S.getOptionalString("username"),je=S.getOptionalString("appPassword");if(!W(b))throw new Error(`Invalid Bitbucket integration config, '${b}' is not a valid host`);return E?E=(0,f.trimEnd)(E,"/"):b===lt?E=Pt:E=`https://${b}/rest/api/1.0`,{host:b,apiBaseUrl:E,token:Q,username:be,appPassword:je}}function We(S){const c=S.map(Nt);return c.some(b=>b.host===lt)||c.push({host:lt,apiBaseUrl:Pt}),c}class _t{get type(){return"bitbucket"}get title(){return this.integrationConfig.host}get config(){return this.integrationConfig}resolveUrl(c){const b=B(c);if(!c.lineNumber)return b;const E=new URL(b);return this.integrationConfig.host==="bitbucket.org"?E.hash=`lines-${c.lineNumber}`:E.hash=`${c.lineNumber}`,E.toString()}resolveEditUrl(c){const b=H()(c),E=new URL(c);return E.searchParams.set("mode","edit"),E.searchParams.set("spa","0"),E.searchParams.set("at",b.ref),E.toString()}constructor(c){(0,t._)(this,"integrationConfig",void 0),this.integrationConfig=c}}(0,t._)(_t,"factory",({config:S})=>{var c,b,E;const Q=We((E=S.getOptionalConfigArray("integrations.bitbucket"))!==null&&E!==void 0?E:[...(c=S.getOptionalConfigArray("integrations.bitbucketCloud"))!==null&&c!==void 0?c:[],...(b=S.getOptionalConfigArray("integrations.bitbucketServer"))!==null&&b!==void 0?b:[]]);return u(Q.map(be=>new _t(be)),be=>be.config.host)});var ge=r(96279),Se=r(48834).lW;async function Fe(S,c){const{name:b,owner:E,resource:Q}=parseGitUrl(S),be=Q==="bitbucket.org";let je=be?`${c.apiBaseUrl}/repositories/${E}/${b}`:`${c.apiBaseUrl}/projects/${E}/repos/${b}/default-branch`,ke=await fetch(je,bt(c));if(ke.status===404&&!be&&(je=`${c.apiBaseUrl}/projects/${E}/repos/${b}/branches/default`,ke=await fetch(je,bt(c))),!ke.ok){const ft=`Failed to retrieve default branch from ${je}, ${ke.status} ${ke.statusText}`;throw new Error(ft)}let ht;if(be)ht=(await ke.json()).mainbranch.name;else{const{displayId:ft}=await ke.json();ht=ft}if(!ht)throw new Error(`Failed to read default branch from ${je}. Response ${ke.status} ${ke.json()}`);return ht}async function tt(S,c){const{name:b,owner:E,ref:Q,protocol:be,resource:je,filepath:ke}=parseGitUrl(S),ht=je==="bitbucket.org";let ft=Q;ft||(ft=await Fe(S,c));const yn=ke?`&path=${encodeURIComponent(decodeURIComponent(ke))}`:"";return ht?`${be}://${je}/${E}/${b}/get/${ft}.tar.gz`:`${c.apiBaseUrl}/projects/${E}/repos/${b}/archive?format=tgz&at=${ft}&prefix=${E}-${b}${yn}`}function mt(S,c){try{const{owner:b,name:E,ref:Q,filepathtype:be,filepath:je}=parseGitUrl(S);if(!b||!E||be!=="browse"&&be!=="raw"&&be!=="src")throw new Error("Invalid Bitbucket URL or file path");const ke=je.replace(/^\//,"");if(c.host==="bitbucket.org"){if(!Q)throw new Error("Invalid Bitbucket URL or file path");return`${c.apiBaseUrl}/repositories/${b}/${E}/src/${Q}/${ke}`}return`${c.apiBaseUrl}/projects/${b}/repos/${E}/raw/${ke}?at=${Q}`}catch(b){throw new Error(`Incorrect URL: ${S}, ${b}`)}}function bt(S){const c={};if(S.token)c.Authorization=`Bearer ${S.token}`;else if(S.username&&S.appPassword){const b=Se.from(`${S.username}:${S.appPassword}`,"utf8");c.Authorization=`Basic ${b.toString("base64")}`}return{headers:c}}const pt="bitbucket.org",Ot="https://api.bitbucket.org/2.0";function Ht(S){const c=pt,b=Ot,E=S.getString("username"),Q=S.getString("appPassword");return{host:c,apiBaseUrl:b,username:E,appPassword:Q}}function Jt(S){const c=S.map(Ht);return c.length===0&&c.push({host:pt,apiBaseUrl:Ot}),c}class Bt{get type(){return"bitbucketCloud"}get title(){return this.integrationConfig.host}get config(){return this.integrationConfig}resolveUrl(c){const b=B(c);if(c.lineNumber){const E=new URL(b);return E.hash=`lines-${c.lineNumber}`,E.toString()}return b}resolveEditUrl(c){const b=H()(c),E=new URL(c);return E.searchParams.set("mode","edit"),E.searchParams.set("at",b.ref),E.toString()}constructor(c){(0,t._)(this,"integrationConfig",void 0),this.integrationConfig=c}}(0,t._)(Bt,"factory",({config:S})=>{var c;const b=Jt((c=S.getOptionalConfigArray("integrations.bitbucketCloud"))!==null&&c!==void 0?c:[]);return u(b.map(E=>new Bt(E)),E=>E.config.host)});var un=r(48834).lW;async function Yt(S,c){const{name:b,owner:E}=parseGitUrl(S),Q=`${c.apiBaseUrl}/repositories/${E}/${b}`,be=await fetch(Q,Pn(c));if(!be.ok){const ht=`Failed to retrieve default branch from ${Q}, ${be.status} ${be.statusText}`;throw new Error(ht)}const ke=(await be.json()).mainbranch.name;if(!ke)throw new Error(`Failed to read default branch from ${Q}. Response ${be.status} ${be.json()}`);return ke}async function pn(S,c){const{name:b,owner:E,ref:Q,protocol:be,resource:je}=parseGitUrl(S);let ke=Q;return ke||(ke=await Yt(S,c)),`${be}://${je}/${E}/${b}/get/${ke}.tar.gz`}function Fn(S,c){try{const{owner:b,name:E,ref:Q,filepathtype:be,filepath:je}=parseGitUrl(S);if(!b||!E||be!=="src"&&be!=="raw")throw new Error("Invalid Bitbucket Cloud URL or file path");const ke=je.replace(/^\//,"");if(!Q)throw new Error("Invalid Bitbucket Cloud URL or file path");return`${c.apiBaseUrl}/repositories/${b}/${E}/src/${Q}/${ke}`}catch(b){throw new Error(`Incorrect URL: ${S}, ${b}`)}}function Pn(S){const c={};if(S.username&&S.appPassword){const b=un.from(`${S.username}:${S.appPassword}`,"utf8");c.Authorization=`Basic ${b.toString("base64")}`}return{headers:c}}function fn(S){const c=S.getString("host");let b=S.getOptionalString("apiBaseUrl");const E=S.getOptionalString("token"),Q=S.getOptionalString("username"),be=S.getOptionalString("password");if(!W(c))throw new Error(`Invalid Bitbucket Server integration config, '${c}' is not a valid host`);return b?b=(0,f.trimEnd)(b,"/"):b=`https://${c}/rest/api/1.0`,{host:c,apiBaseUrl:b,token:E,username:Q,password:be}}function Ln(S){return S.map(fn)}class Un{get type(){return"bitbucketServer"}get title(){return this.integrationConfig.host}get config(){return this.integrationConfig}resolveUrl(c){const b=B(c);if(c.lineNumber){const E=new URL(b);return E.hash=c.lineNumber.toString(),E.toString()}return b}resolveEditUrl(c){return c.includes("?")?c.substring(0,c.indexOf("?")):c}constructor(c){(0,t._)(this,"integrationConfig",void 0),this.integrationConfig=c}}(0,t._)(Un,"factory",({config:S})=>{var c;const b=Ln((c=S.getOptionalConfigArray("integrations.bitbucketServer"))!==null&&c!==void 0?c:[]);return u(b.map(E=>new Un(E)),E=>E.config.host)});var tn=r(48834).lW;async function wn(S,c){const{name:b,owner:E}=parseGitUrl(S);let Q=`${c.apiBaseUrl}/projects/${E}/repos/${b}/default-branch`,be=await fetch(Q,_n(c));if(be.status===404&&(Q=`${c.apiBaseUrl}/projects/${E}/repos/${b}/branches/default`,be=await fetch(Q,_n(c))),!be.ok){const ht=`Failed to retrieve default branch from ${Q}, ${be.status} ${be.statusText}`;throw new Error(ht)}const{displayId:je}=await be.json(),ke=je;if(!ke)throw new Error(`Failed to read default branch from ${Q}. Response ${be.status} ${be.json()}`);return ke}async function Mn(S,c){const{name:b,owner:E,ref:Q,filepath:be}=parseGitUrl(S);let je=Q;je||(je=await wn(S,c));const ke=be?`&path=${encodeURIComponent(decodeURIComponent(be))}`:"";return`${c.apiBaseUrl}/projects/${E}/repos/${b}/archive?format=tgz&at=${je}&prefix=${E}-${b}${ke}`}function ut(S,c){try{const{owner:b,name:E,ref:Q,filepathtype:be,filepath:je}=parseGitUrl(S);if(!b||!E||be!=="browse"&&be!=="raw"&&be!=="src")throw new Error("Invalid Bitbucket Server URL or file path");const ke=je.replace(/^\//,"");return`${c.apiBaseUrl}/projects/${b}/repos/${E}/raw/${ke}?at=${Q}`}catch(b){throw new Error(`Incorrect URL: ${S}, ${b}`)}}function _n(S){const c={};if(S.token)c.Authorization=`Bearer ${S.token}`;else if(S.username&&S.password){const b=tn.from(`${S.username}:${S.password}`,"utf8");c.Authorization=`Basic ${b.toString("base64")}`}return{headers:c}}function wt(S){const c=S.getString("host");let b=S.getOptionalString("baseUrl"),E=S.getOptionalString("cloneUrl"),Q=S.getOptionalString("gitilesBaseUrl");const be=S.getOptionalString("username"),je=S.getOptionalString("password");if(W(c)){if(b&&!g(b))throw new Error(`Invalid Gerrit integration config, '${b}' is not a valid baseUrl`);if(E&&!g(E))throw new Error(`Invalid Gerrit integration config, '${E}' is not a valid cloneUrl`);if(Q&&!g(Q))throw new Error(`Invalid Gerrit integration config, '${Q}' is not a valid gitilesBaseUrl`)}else throw new Error(`Invalid Gerrit integration config, '${c}' is not a valid host`);return b?b=(0,f.trimEnd)(b,"/"):b=`https://${c}`,Q?Q=(0,f.trimEnd)(Q,"/"):Q=`https://${c}`,E?E=(0,f.trimEnd)(E,"/"):E=b,{host:c,baseUrl:b,cloneUrl:E,gitilesBaseUrl:Q,username:be,password:je}}function ct(S){return S.map(wt)}var vn=r(48834).lW;const Kt=")]}'";function hn(S,c){const E=c.replace(S.gitilesBaseUrl,"").split("/").filter(ft=>!!ft),Q=E.indexOf("+");if(Q<=0)throw new Error(`Unable to parse project from url: ${c}`);const be=(0,f.trimStart)(E.slice(0,Q).join("/"),"/"),je=E.indexOf("heads");if(je<=0)throw new Error(`Unable to parse branch from url: ${c}`);const ke=E[je+1],ht=E.slice(je+2).join("/");return{branch:ke,filePath:ht===""?"/":ht,project:be}}function jn(S,c,b,E){return`${S.gitilesBaseUrl}/${c}/+/refs/heads/${b}/${(0,f.trimStart)(E,"/")}`}function ln(S){return S.password?"/a/":"/"}function Tn(S,c){const{branch:b,project:E}=hn(S,c);return`${S.baseUrl}${ln(S)}projects/${encodeURIComponent(E)}/branches/${b}`}function Ce(S,c){const{project:b}=hn(S,c);return`${S.cloneUrl}${ln(S)}${b}`}function ce(S,c){const{branch:b,filePath:E,project:Q}=hn(S,c);return`${S.baseUrl}${ln(S)}projects/${encodeURIComponent(Q)}/branches/${b}/files/${encodeURIComponent(E)}/content`}function Oe(S){return`${S.baseUrl}${ln(S)}projects/`}function Me(S){const c={};if(!S.password)return c;const b=vn.from(`${S.username}:${S.password}`,"utf8");return c.Authorization=`Basic ${b.toString("base64")}`,{headers:c}}async function Xe(S){const c=await S.text();if(c.startsWith(Kt))try{return JSON.parse(c.slice(Kt.length))}catch(b){throw new Error(`Invalid response from Gerrit: ${c.slice(0,10)} - ${b}`)}throw new Error(`Gerrit JSON body prefix missing. Found: ${c.slice(0,10)}`)}class se{get type(){return"gerrit"}get title(){return this.integrationConfig.host}get config(){return this.integrationConfig}resolveUrl(c){const{url:b,base:E,lineNumber:Q}=c;let be;if(b.startsWith("/")){const{branch:je,project:ke}=hn(this.config,E);return jn(this.config,ke,je,b)}return b?be=new URL(b,E):be=new URL(E),Q&&(be.hash=Q.toString()),be.toString()}resolveEditUrl(c){return c}constructor(c){(0,t._)(this,"integrationConfig",void 0),this.integrationConfig=c}}(0,t._)(se,"factory",({config:S})=>{var c;const b=ct((c=S.getOptionalConfigArray("integrations.gerrit"))!==null&&c!==void 0?c:[]);return u(b.map(E=>new se(E)),E=>E.config.host)});function D(S){const c=S.getString("host");let b=S.getOptionalString("baseUrl");const E=S.getOptionalString("username"),Q=S.getOptionalString("password");if(!W(c))throw new Error(`Invalid Gitea integration config, '${c}' is not a valid host`);return b?b=(0,f.trimEnd)(b,"/"):b=`https://${c}`,{host:c,baseUrl:b,username:E,password:Q}}var me=r(48834).lW;function De(S,c){try{var b;const E=(b=S.baseUrl)!==null&&b!==void 0?b:`https://${S.host}`,[Q,be,je,ke,ht,ft,...yn]=c.replace(E,"").split("/"),kn=yn.join("/").replace(/^\//,"");return`${E}/${be}/${je}/_edit/${ft}/${kn}`}catch(E){throw new Error(`Incorrect URL: ${c}, ${E}`)}}function et(S,c){try{var b;const E=(b=S.baseUrl)!==null&&b!==void 0?b:`https://${S.host}`,[Q,be,je,ke,ht,ft,...yn]=c.replace(E,"").split("/"),kn=yn.join("/").replace(/^\//,"");return`${E}/api/v1/repos/${be}/${je}/contents/${kn}?ref=${ft}`}catch(E){throw new Error(`Incorrect URL: ${c}, ${E}`)}}function it(S){const c={},{username:b,password:E}=S;return E?(b?c.Authorization=`basic ${me.from(`${b}:${E}`).toString("base64")}`:c.Authorization=`token ${E}`,{headers:c}):c}class kt{get type(){return"gitea"}get title(){return this.config.host}resolveUrl(c){return B(c)}resolveEditUrl(c){return De(this.config,c)}constructor(c){(0,t._)(this,"config",void 0),this.config=c}}(0,t._)(kt,"factory",({config:S})=>{var c;const E=((c=S.getOptionalConfigArray("integrations.gitea"))!==null&&c!==void 0?c:[]).map(Q=>D(Q));return u(E.map(Q=>new kt(Q)),Q=>Q.config.host)});const Ft="github.com",Qt="https://api.github.com",_="https://raw.githubusercontent.com";function J(S){var c,b;const E=(b=S.getOptionalString("host"))!==null&&b!==void 0?b:Ft;let Q=S.getOptionalString("apiBaseUrl"),be=S.getOptionalString("rawBaseUrl");const je=S.getOptionalString("token"),ke=(c=S.getOptionalConfigArray("apps"))===null||c===void 0?void 0:c.map(ht=>({appId:ht.getNumber("appId"),clientId:ht.getString("clientId"),clientSecret:ht.getString("clientSecret"),webhookSecret:ht.getString("webhookSecret"),privateKey:ht.getString("privateKey"),allowedInstallationOwners:ht.getOptionalStringArray("allowedInstallationOwners")}));if(!W(E))throw new Error(`Invalid GitHub integration config, '${E}' is not a valid host`);return Q?Q=(0,f.trimEnd)(Q,"/"):E===Ft&&(Q=Qt),be?be=(0,f.trimEnd)(be,"/"):E===Ft&&(be=_),{host:E,apiBaseUrl:Q,rawBaseUrl:be,token:je,apps:ke}}function te(S){const c=S.map(J);return c.some(b=>b.host===Ft)||c.push({host:Ft,apiBaseUrl:Qt,rawBaseUrl:_}),c}function pe(S,c,b){try{const{owner:E,name:Q,ref:be,filepathtype:je,filepath:ke}=parseGitUrl(S);if(!E||!Q||!be||je!=="blob"&&je!=="raw"&&je!=="tree")throw new Error("Invalid GitHub URL or file path");const ht=ke.replace(/^\//,"");return y(c,b)==="api"?`${c.apiBaseUrl}/repos/${E}/${Q}/contents/${ht}?ref=${be}`:`${c.rawBaseUrl}/${E}/${Q}/${be}/${ht}`}catch(E){throw new Error(`Incorrect URL: ${S}, ${E}`)}}function le(S,c){const b={};return y(S,c)==="api"&&(b.Accept="application/vnd.github.v3.raw"),c.token&&(b.Authorization=`token ${c.token}`),{headers:b}}function y(S,c){return S.apiBaseUrl&&(c.token||!S.rawBaseUrl)?"api":"raw"}var Z=r(42822),q=r(89393),Y=r(26228);class we{async getOrCreateToken(c,b,E){let Q=this.tokenCache.get(c);if((!Q||this.isExpired(Q.expiresAt))&&(Q=await E(),Q.expiresAt=Q.expiresAt.minus({minutes:10}),this.tokenCache.set(c,Q)),!this.appliesToRepo(Q,b))throw new Error(`The Backstage GitHub application used in the ${c} organization does not have access to a repository with the name ${b}`);return{accessToken:Q.token}}appliesToRepo(c,b){return b===void 0?!0:c.repositories!==void 0?c.repositories.includes(b):!0}constructor(){(0,t._)(this,"tokenCache",new Map),(0,t._)(this,"isExpired",c=>Y.ou.local()>c)}}const Ae={Accept:"application/vnd.github.machine-man-preview+json"};class Ye{async getInstallationCredentials(c,b){if(this.allowedInstallationOwners){var E;if(!(!((E=this.allowedInstallationOwners)===null||E===void 0)&&E.includes(c)))return{accessToken:void 0}}return this.cache.getOrCreateToken(c,b,async()=>{const{installationId:Q,suspended:be}=await this.getInstallationData(c);if(be)throw new Error(`The GitHub application for ${c} is suspended`);const je=await this.appClient.apps.createInstallationAccessToken({installation_id:Q,headers:Ae});let ke;if(je.data.repository_selection==="selected"){const ft=new q.v({baseUrl:this.baseUrl,auth:je.data.token}),yn=await ft.paginate(ft.apps.listReposAccessibleToInstallation);var ht;ke=((ht=yn.repositories)!==null&&ht!==void 0?ht:yn).map(br=>br.name)}return{token:je.data.token,expiresAt:Y.ou.fromISO(je.data.expires_at),repositories:ke}})}getInstallations(){return this.appClient.paginate(this.appClient.apps.listInstallations)}async getInstallationData(c){const E=(await this.getInstallations()).find(be=>{var je,ke;return((je=be.account)===null||je===void 0||(ke=je.login)===null||ke===void 0?void 0:ke.toLocaleLowerCase("en-US"))===c.toLocaleLowerCase("en-US")});if(E)return{installationId:E.id,suspended:Boolean(E.suspended_by)};const Q=new Error(`No app installation found for ${c} in ${this.baseAuthConfig.appId}`);throw Q.name="NotFoundError",Q}constructor(c,b){(0,t._)(this,"appClient",void 0),(0,t._)(this,"baseUrl",void 0),(0,t._)(this,"baseAuthConfig",void 0),(0,t._)(this,"cache",new we),(0,t._)(this,"allowedInstallationOwners",void 0),this.allowedInstallationOwners=c.allowedInstallationOwners,this.baseUrl=b,this.baseAuthConfig={appId:c.appId,privateKey:c.privateKey.replace(/\\n/gm,`
|
|
33
|
-
`)},this.appClient=new q.v({baseUrl:b,headers:Ae,authStrategy:Z.i,auth:this.baseAuthConfig})}}class jt{async getAllInstallations(){return this.apps.length?(await Promise.all(this.apps.map(b=>b.getInstallations()))).flat():[]}async getAppToken(c,b){if(this.apps.length===0)return;const E=await Promise.all(this.apps.map(ke=>ke.getInstallationCredentials(c,b).then(ht=>({credentials:ht,error:void 0}),ht=>({credentials:void 0,error:ht})))),Q=E.find(ke=>{var ht;return(ht=ke.credentials)===null||ht===void 0?void 0:ht.accessToken});if(Q)return Q.credentials.accessToken;const je=E.map(ke=>ke.error).find(ke=>(ke==null?void 0:ke.name)!=="NotFoundError");if(je)throw je}constructor(c){var b;(0,t._)(this,"apps",void 0);var E;this.apps=(E=(b=c.apps)===null||b===void 0?void 0:b.map(Q=>new Ye(Q,c.apiBaseUrl)))!==null&&E!==void 0?E:[]}}class vt{async getCredentials(c){const b=H()(c.url),E=b.owner||b.name,Q=b.owner?b.name:void 0;let be="app",je=await this.githubAppCredentialsMux.getAppToken(E,Q);return je||(be="token",je=this.token),{headers:je?{Authorization:`Bearer ${je}`}:void 0,token:je,type:be}}constructor(c,b){(0,t._)(this,"githubAppCredentialsMux",void 0),(0,t._)(this,"token",void 0),this.githubAppCredentialsMux=c,this.token=b}}(0,t._)(vt,"create",S=>new vt(new jt(S),S.token));class nt{static fromIntegrations(c){const b=new Map;return c.github.list().forEach(E=>{const Q=SingleInstanceGithubCredentialsProvider.create(E.config);b.set(E.config.host,Q)}),new nt(b)}async getCredentials(c){const b=new URL(c.url),E=this.providers.get(b.host);if(!E)throw new Error(`There is no GitHub integration that matches ${c.url}. Please add a configuration for an integration.`);return E.getCredentials(c)}constructor(c){_define_property(this,"providers",void 0),this.providers=c}}class Ke{get type(){return"github"}get title(){return this.integrationConfig.host}get config(){return this.integrationConfig}resolveUrl(c){return dt(B(c),"tree")}resolveEditUrl(c){return dt(c,"edit")}constructor(c){(0,t._)(this,"integrationConfig",void 0),this.integrationConfig=c}}(0,t._)(Ke,"factory",({config:S})=>{var c;const b=te((c=S.getOptionalConfigArray("integrations.github"))!==null&&c!==void 0?c:[]);return u(b.map(E=>new Ke(E)),E=>E.config.host)});function dt(S,c){return S.replace(/\/\/([^/]+)\/([^/]+)\/([^/]+)\/(blob|tree|edit)\//,(b,E,Q,be)=>`//${E}/${Q}/${be}/${c}/`)}const at=null;class Dt extends Ke{get config(){return super.config}constructor(c){super(c)}}(0,t._)(Dt,"factory",Ke.factory);const Mt=null,Xt=null,en=null,Ut="gitlab.com",zt="https://gitlab.com/api/v4";function Et(S){const c=S.getString("host");let b=S.getOptionalString("apiBaseUrl");const E=S.getOptionalString("token");let Q=S.getOptionalString("baseUrl");if(b?b=(0,f.trimEnd)(b,"/"):c===Ut&&(b=zt),Q?Q=(0,f.trimEnd)(Q,"/"):Q=`https://${c}`,W(c)){if(!b||!g(b))throw new Error(`Invalid GitLab integration config, '${b}' is not a valid apiBaseUrl`);if(!g(Q))throw new Error(`Invalid GitLab integration config, '${Q}' is not a valid baseUrl`)}else throw new Error(`Invalid GitLab integration config, '${c}' is not a valid host`);return{host:c,token:E,apiBaseUrl:b,baseUrl:Q}}function Lt(S){const c=S.map(Et);return c.some(b=>b.host===Ut)||c.push({host:Ut,apiBaseUrl:zt,baseUrl:`https://${Ut}`}),c}function Zt(S){let c="";return S.host!==Ut&&(c=new URL(S.baseUrl).pathname),trimEnd(c,"/")}async function bn(S,c){const b=await ur(S,c);return Gn(S,b,c).toString()}function zn(S){const{token:c=""}=S;return{headers:{"PRIVATE-TOKEN":c}}}function Gn(S,c,b){try{const E=new URL(S),Q=E.pathname.split("/blob/").slice(1).join("/blob/"),[be,...je]=Q.split("/"),ke=getGitLabIntegrationRelativePath(b);return E.pathname=[...ke?[ke]:[],"api/v4/projects",c,"repository/files",encodeURIComponent(decodeURIComponent(je.join("/"))),"raw"].join("/"),E.search=`?ref=${be}`,E}catch(E){throw new Error(`Incorrect url: ${S}, ${E}`)}}async function ur(S,c){const b=new URL(S);if(!b.pathname.includes("/blob/"))throw new Error("Please provide full path to yaml file from GitLab");try{let E=b.pathname.split("/-/blob/")[0].split("/blob/")[0];const Q=getGitLabIntegrationRelativePath(c);Q&&(E=E.replace(Q,""));const be=new URL(`${b.origin}${Q}/api/v4/projects/${encodeURIComponent(E.replace(/^\//,""))}`),je=await fetch(be.toString(),zn(c)),ke=await je.json();if(!je.ok)throw new Error(`GitLab Error '${ke.error}', ${ke.error_description}`);return Number(ke.id)}catch(E){throw new Error(`Could not get GitLab project ID for: ${S}, ${E}`)}}class En{get type(){return"gitlab"}get title(){return this.integrationConfig.host}get config(){return this.integrationConfig}resolveUrl(c){return B(c)}resolveEditUrl(c){return On(c,"edit")}constructor(c){(0,t._)(this,"integrationConfig",void 0),this.integrationConfig=c}}(0,t._)(En,"factory",({config:S})=>{var c;const b=Lt((c=S.getOptionalConfigArray("integrations.gitlab"))!==null&&c!==void 0?c:[]);return u(b.map(E=>new En(E)),E=>E.config.host)});function On(S,c){return S.replace(/\/\-\/(blob|tree|edit)\//,`/-/${c}/`)}class er{static fromConfig(c){return new er({awsS3:I.factory({config:c}),azure:He.factory({config:c}),bitbucket:_t.factory({config:c}),bitbucketCloud:Bt.factory({config:c}),bitbucketServer:Un.factory({config:c}),gerrit:se.factory({config:c}),github:Ke.factory({config:c}),gitlab:En.factory({config:c}),gitea:kt.factory({config:c})})}get awsS3(){return this.byType.awsS3}get azure(){return this.byType.azure}get bitbucket(){return this.byType.bitbucket}get bitbucketCloud(){return this.byType.bitbucketCloud}get bitbucketServer(){return this.byType.bitbucketServer}get gerrit(){return this.byType.gerrit}get github(){return this.byType.github}get gitlab(){return this.byType.gitlab}get gitea(){return this.byType.gitea}list(){return Object.values(this.byType).flatMap(c=>c.list())}byUrl(c){let b=Object.values(this.byType).map(E=>E.byUrl(c)).filter(Boolean);if(b.length>1){const E=b.filter(Q=>!(Q instanceof _t));E.length!==0&&(b=E)}return b[0]}byHost(c){return Object.values(this.byType).map(b=>b.byHost(c)).find(Boolean)}resolveUrl(c){const b=this.byUrl(c.base);return b?b.resolveUrl(c):B(c)}resolveEditUrl(c){const b=this.byUrl(c);return b?b.resolveEditUrl(c):c}constructor(c){(0,t._)(this,"byType",void 0),this.byType=c}}},6290:function(Ct,$e,r){"use strict";var t={};r.r(t),r.d(t,{TechDocsPlugin:function(){return L.s4}});var h=r(52322),H=r(2784),f=r(28316),W=r(73557),g=r(60871);const u=(0,g.T0)({id:"plugin.techdocs.storageservice"}),B=(0,g.T0)({id:"plugin.techdocs.service"});var ve=r(92077),ue=r(95481),V=r(7476),K=r(93225),I=r(86317),w=r(65124),ie=r(22478),ee=r(85478),ne=r(68435),$=r(3482),T=r(42081),P=r(48431),L=r(89258),O=r(52943),oe=r(61886),Le=r(13980),ze=r.n(Le),z=r(87612);class yt{get(n){for(const s of this.holders){const a=s.get(n);if(a)return a}}constructor(...n){(0,z._)(this,"holders",void 0),this.holders=n}}var ot=r(51837);const He=(0,ot.CT)("api-context"),st=i=>{var n;const{apis:s,children:a}=i,p=(n=(0,H.useContext)(He))===null||n===void 0?void 0:n.atVersion(1),A=p?new yt(s,p):s;return(0,h.jsx)(He.Provider,{value:(0,ot.EI)({1:A}),children:a})};st.propTypes={apis:ze().shape({get:ze().func.isRequired}).isRequired,children:ze().node};class Qe{static validateFactories(n,s){for(const a of s){const p=[a],A=new Set;for(;p.length;){const k=p.shift(),M=n.get(k);if(M)for(const ae of Object.values(M.deps)){if(ae.id===a.id)throw new Error(`Circular dependency of api factory for ${a}`);A.has(ae)||(A.add(ae),p.push(ae))}}}}get(n){return this.load(n)}load(n,s=[]){const a=this.apis.get(n.id);if(a)return a;const p=this.factories.get(n);if(!p)return;if(s.includes(p.api))throw new Error(`Circular dependency of api factory for ${p.api}`);const A=this.loadDeps(n,p.deps,[...s,p.api]),k=p.factory(A);return this.apis.set(n.id,k),k}loadDeps(n,s,a){const p={};for(const A in s)if(s.hasOwnProperty(A)){const k=s[A],M=this.load(k,a);if(!M)throw new Error(`No API factory available for dependency ${k} of dependent ${n}`);p[A]=M}return p}constructor(n){(0,z._)(this,"factories",void 0),(0,z._)(this,"apis",void 0),this.factories=n,this.apis=new Map}}var St;(function(i){i[i.default=10]="default",i[i.app=50]="app",i[i.static=100]="static"})(St||(St={}));class It{register(n,s){const a=St[n],p=this.factories.get(s.api.id);return p&&p.priority>=a?!1:(this.factories.set(s.api.id,{priority:a,factory:s}),!0)}get(n){const s=this.factories.get(n.id);if(s)return s.factory}getAllApis(){const n=new Set;for(const{factory:s}of this.factories.values())n.add(s.api);return n}constructor(){(0,z._)(this,"factories",new Map)}}function xt(i){return new Promise((n,s)=>{const a=i.width||500,p=i.height||700,A=window.screen.width/2-a/2,k=window.screen.height/2-p/2,M=window.open(i.url,i.name,`menubar=no,location=no,resizable=no,scrollbars=no,status=no,width=${a},height=${p},top=${k},left=${A}`);let ae="";if(!M||typeof M.closed=="undefined"||M.closed){const gt=new Error("Failed to open auth popup.");gt.name="PopupRejectedError",s(gt);return}const xe=gt=>{if(gt.source!==M||gt.origin!==i.origin)return;const{data:Tt}=gt;if(Tt.type==="config_info"){ae=Tt.targetOrigin;return}if(Tt.type!=="authorization_response")return;const Rt=Tt;if("error"in Rt){const Wt=new Error(Rt.error.message);Wt.name=Rt.error.name,s(Wt)}else n(Rt.response);Ve()},Ie=setInterval(()=>{if(M.closed){const gt=`Login failed, ${ae&&ae!==window.location.origin?`Incorrect app origin, expected ${ae}`:"popup was closed"}`,Tt=new Error(gt);Tt.name="PopupClosedError",s(Tt),Ve()}},100);function Ve(){window.removeEventListener("message",xe),clearInterval(Ie)}window.addEventListener("message",xe)})}let lt=!1;function Pt(i){return[...i].join(" ")}class Nt{async createSession(n){return n.instantPopup?this.enableExperimentalRedirectFlow?this.executeRedirect(n.scopes):this.showPopup(n.scopes):this.authRequester(n.scopes)}async refreshSession(n){const s=await fetch(await this.buildUrl("/refresh",{optional:!0,...n&&{scope:this.joinScopesFunc(n)}}),{headers:{"x-requested-with":"XMLHttpRequest"},credentials:"include"}).catch(p=>{throw new Error(`Auth refresh request failed, ${p}`)});if(!s.ok){const p=new Error(`Auth refresh request failed, ${s.statusText}`);throw p.status=s.status,p}const a=await s.json();if(a.error){const p=new Error(a.error.message);throw a.error.name&&(p.name=a.error.name),p}return await this.sessionTransform(a)}async removeSession(){const n=await fetch(await this.buildUrl("/logout"),{method:"POST",headers:{"x-requested-with":"XMLHttpRequest"},credentials:"include"}).catch(s=>{throw new Error(`Logout request failed, ${s}`)});if(!n.ok){const s=new Error(`Logout request failed, ${n.statusText}`);throw s.status=n.status,s}}async showPopup(n){const s=this.joinScopesFunc(n),a=await this.buildUrl("/start",{scope:s,origin:window.location.origin,flow:"popup"}),p=await xt({url:a,name:`${this.provider.title} Login`,origin:new URL(a).origin,width:450,height:730});return await this.sessionTransform(p)}async executeRedirect(n){const s=this.joinScopesFunc(n);return window.location.href=await this.buildUrl("/start",{scope:s,origin:window.location.origin,redirectUrl:window.location.href,flow:"redirect"}),new Promise(()=>{})}async buildUrl(n,s){const a=await this.discoveryApi.getBaseUrl("auth"),p=this.buildQueryString({...s,env:this.environment});return`${a}/${this.provider.id}${n}${p}`}buildQueryString(n){if(!n)return"";const s=Object.entries(n).map(([a,p])=>{if(typeof p=="string")return`${encodeURIComponent(a)}=${encodeURIComponent(p)}`;if(p)return encodeURIComponent(a)}).filter(Boolean).join("&");return s?`?${s}`:""}constructor(n){(0,z._)(this,"discoveryApi",void 0),(0,z._)(this,"environment",void 0),(0,z._)(this,"provider",void 0),(0,z._)(this,"joinScopesFunc",void 0),(0,z._)(this,"authRequester",void 0),(0,z._)(this,"sessionTransform",void 0),(0,z._)(this,"enableExperimentalRedirectFlow",void 0);const{configApi:s,discoveryApi:a,environment:p,provider:A,joinScopes:k=Pt,oauthRequestApi:M,sessionTransform:ae=Ie=>Ie}=n;!lt&&!s&&(console.warn("DEPRECATION WARNING: Authentication providers require a configApi instance to configure the authentication flow. Please provide one to the authentication provider constructor."),lt=!0);var xe;this.enableExperimentalRedirectFlow=s&&(xe=s.getOptionalBoolean("enableExperimentalRedirectFlow"))!==null&&xe!==void 0?xe:!1,this.authRequester=M.createAuthRequester({provider:A,onAuthRequest:async Ie=>this.enableExperimentalRedirectFlow?this.executeRedirect(Ie):this.showPopup(Ie)}),this.discoveryApi=a,this.environment=p,this.provider=A,this.joinScopesFunc=k,this.sessionTransform=ae}}function We(i,n){for(const s of n)if(!i.has(s))return!1;return!0}class _t{sessionExistsAndHasScope(n,s){if(!n)return!1;if(!s||this.options.sessionScopes===void 0)return!0;const a=this.options.sessionScopes(n);return We(a,s)}getExtendedScope(n,s){const a=new Set(this.options.defaultScopes);if(n&&this.options.sessionScopes!==void 0){const p=this.options.sessionScopes(n);for(const A of p)a.add(A)}if(s)for(const p of s)a.add(p);return a}constructor(n){(0,z._)(this,"options",void 0),this.options=n}}var ge=r(82394),Se=r.n(ge);let Fe=Symbol.observable;class tt{[Fe](){return this}get closed(){return this.isClosed}next(n){if(this.isClosed)throw new Error("PublishSubject is closed");this.subscribers.forEach(s=>s.next(n))}error(n){if(this.isClosed)throw new Error("PublishSubject is closed");this.isClosed=!0,this.terminatingError=n,this.subscribers.forEach(s=>s.error(n))}complete(){if(this.isClosed)throw new Error("PublishSubject is closed");this.isClosed=!0,this.subscribers.forEach(n=>n.complete())}subscribe(n,s,a){const p=typeof n=="function"?{next:n,error:s,complete:a}:n;return this.observable.subscribe(p)}constructor(){(0,z._)(this,"isClosed",!1),(0,z._)(this,"terminatingError",void 0),(0,z._)(this,"observable",new(Se())(n=>this.isClosed?(this.terminatingError?n.error(this.terminatingError):n.complete(),()=>{}):(this.subscribers.add(n),()=>{this.subscribers.delete(n)}))),(0,z._)(this,"subscribers",new Set)}}let mt=Symbol.observable;class bt{[mt](){return this}get closed(){return this.isClosed}next(n){if(this.isClosed)throw new Error("BehaviorSubject is closed");this.currentValue=n,this.subscribers.forEach(s=>s.next(n))}error(n){if(this.isClosed)throw new Error("BehaviorSubject is closed");this.isClosed=!0,this.terminatingError=n,this.subscribers.forEach(s=>s.error(n))}complete(){if(this.isClosed)throw new Error("BehaviorSubject is closed");this.isClosed=!0,this.subscribers.forEach(n=>n.complete())}subscribe(n,s,a){const p=typeof n=="function"?{next:n,error:s,complete:a}:n;return this.observable.subscribe(p)}constructor(n){(0,z._)(this,"isClosed",void 0),(0,z._)(this,"currentValue",void 0),(0,z._)(this,"terminatingError",void 0),(0,z._)(this,"observable",void 0),(0,z._)(this,"subscribers",new Set),this.isClosed=!1,this.currentValue=n,this.terminatingError=void 0,this.observable=new(Se())(s=>this.isClosed?(this.terminatingError?s.error(this.terminatingError):s.complete(),()=>{}):(s.next(this.currentValue),this.subscribers.add(s),()=>{this.subscribers.delete(s)}))}}class pt{setIsSignedIn(n){this.signedIn!==n&&(this.signedIn=n,this.subject.next(this.signedIn?g.sM.SignedIn:g.sM.SignedOut))}sessionState$(){return this.subject}constructor(){(0,z._)(this,"subject",new bt(g.sM.SignedOut)),(0,z._)(this,"signedIn",!1)}}class Ot{async getSession(n){if(this.helper.sessionExistsAndHasScope(this.currentSession,n.scopes)){if(!this.sessionShouldRefreshFunc(this.currentSession))return this.currentSession;try{const a=await this.collapsedSessionRefresh(n.scopes),p=this.sessionScopesFunc(this.currentSession),A=this.sessionScopesFunc(a);return We(A,p)&&(this.currentSession=a),a}catch(a){if(n.optional)return;throw a}}if(!this.currentSession&&!n.instantPopup)try{const s=await this.collapsedSessionRefresh(n.scopes);return this.currentSession=s,this.getSession(n)}catch{}if(!n.optional)return this.currentSession=await this.connector.createSession({...n,scopes:this.helper.getExtendedScope(this.currentSession,n.scopes)}),this.stateTracker.setIsSignedIn(!0),this.currentSession}async removeSession(){this.currentSession=void 0,await this.connector.removeSession(),this.stateTracker.setIsSignedIn(!1)}sessionState$(){return this.stateTracker.sessionState$()}async collapsedSessionRefresh(n){if(this.refreshPromise)return this.refreshPromise;this.refreshPromise=this.connector.refreshSession(n);try{const s=await this.refreshPromise;return this.stateTracker.setIsSignedIn(!0),s}finally{delete this.refreshPromise}}constructor(n){(0,z._)(this,"connector",void 0),(0,z._)(this,"helper",void 0),(0,z._)(this,"sessionScopesFunc",void 0),(0,z._)(this,"sessionShouldRefreshFunc",void 0),(0,z._)(this,"stateTracker",new pt),(0,z._)(this,"refreshPromise",void 0),(0,z._)(this,"currentSession",void 0);const{connector:s,defaultScopes:a=new Set,sessionScopes:p,sessionShouldRefresh:A}=n;this.connector=s,this.sessionScopesFunc=p,this.sessionShouldRefreshFunc=A,this.helper=new _t({sessionScopes:p,defaultScopes:a})}}class Ht{setSession(n){this.currentSession=n,this.stateTracker.setIsSignedIn(Boolean(n))}async getSession(n){if(this.helper.sessionExistsAndHasScope(this.currentSession,n.scopes))return this.currentSession;if(!n.optional)return this.currentSession=await this.connector.createSession({...n,scopes:this.helper.getExtendedScope(this.currentSession,n.scopes)}),this.stateTracker.setIsSignedIn(!0),this.currentSession}async removeSession(){this.currentSession=void 0,this.stateTracker.setIsSignedIn(!1)}sessionState$(){return this.stateTracker.sessionState$()}constructor(n){_define_property(this,"connector",void 0),_define_property(this,"helper",void 0),_define_property(this,"stateTracker",new SessionStateTracker),_define_property(this,"currentSession",void 0);const{connector:s,defaultScopes:a=new Set,sessionScopes:p}=n;this.connector=s,this.helper=new SessionScopeHelper({sessionScopes:p,defaultScopes:a})}}const Jt={id:"oauth2",title:"Your Identity Provider",icon:()=>null};class Bt{static create(n){const{configApi:s,discoveryApi:a,environment:p="development",provider:A=Jt,oauthRequestApi:k,defaultScopes:M=[],scopeTransform:ae=Ve=>Ve}=n,xe=new Nt({configApi:s,discoveryApi:a,environment:p,provider:A,oauthRequestApi:k,sessionTransform(Ve){return{...Ve,providerInfo:{idToken:Ve.providerInfo.idToken,accessToken:Ve.providerInfo.accessToken,scopes:Bt.normalizeScopes(ae,Ve.providerInfo.scope),expiresAt:new Date(Date.now()+Ve.providerInfo.expiresInSeconds*1e3)}}}}),Ie=new Ot({connector:xe,defaultScopes:new Set(M),sessionScopes:Ve=>Ve.providerInfo.scopes,sessionShouldRefresh:Ve=>(Ve.providerInfo.expiresAt.getTime()-Date.now())/1e3<60*5});return new Bt({sessionManager:Ie,scopeTransform:ae})}async signIn(){await this.getAccessToken()}async signOut(){await this.sessionManager.removeSession()}sessionState$(){return this.sessionManager.sessionState$()}async getAccessToken(n,s){const a=Bt.normalizeScopes(this.scopeTransform,n),p=await this.sessionManager.getSession({...s,scopes:a});var A;return(A=p==null?void 0:p.providerInfo.accessToken)!==null&&A!==void 0?A:""}async getIdToken(n={}){const s=await this.sessionManager.getSession({...n,scopes:new Set(["openid"])});var a;return(a=s==null?void 0:s.providerInfo.idToken)!==null&&a!==void 0?a:""}async getBackstageIdentity(n={}){const s=await this.sessionManager.getSession(n);return s==null?void 0:s.backstageIdentity}async getProfile(n={}){const s=await this.sessionManager.getSession(n);return s==null?void 0:s.profile}static normalizeScopes(n,s){if(!s)return new Set;const a=Array.isArray(s)?s:s.split(/[\s|,]/).filter(Boolean);return new Set(n(a))}constructor(n){(0,z._)(this,"sessionManager",void 0),(0,z._)(this,"scopeTransform",void 0),this.sessionManager=n.sessionManager,this.scopeTransform=n.scopeTransform}}const un={id:"github",title:"GitHub",icon:()=>null};class Yt{static create(n){const{configApi:s,discoveryApi:a,environment:p="development",provider:A=un,oauthRequestApi:k,defaultScopes:M=["read:user"]}=n;return Bt.create({configApi:s,discoveryApi:a,oauthRequestApi:k,provider:A,environment:p,defaultScopes:M})}}const pn={id:"gitlab",title:"GitLab",icon:()=>null};class Fn{static create(n){const{configApi:s,discoveryApi:a,environment:p="development",provider:A=pn,oauthRequestApi:k,defaultScopes:M=["read_user"]}=n;return Bt.create({configApi:s,discoveryApi:a,oauthRequestApi:k,provider:A,environment:p,defaultScopes:M})}}const Pn={id:"google",title:"Google",icon:()=>null},fn="https://www.googleapis.com/auth/";class Ln{static create(n){const{configApi:s,discoveryApi:a,oauthRequestApi:p,environment:A="development",provider:k=Pn,defaultScopes:M=["openid",`${fn}userinfo.email`,`${fn}userinfo.profile`]}=n;return Bt.create({configApi:s,discoveryApi:a,oauthRequestApi:p,provider:k,environment:A,defaultScopes:M,scopeTransform(ae){return ae.map(xe=>xe==="openid"?xe:xe==="profile"||xe==="email"?`${fn}userinfo.${xe}`:xe.startsWith(fn)?xe:`${fn}${xe}`)}})}}const Un={id:"okta",title:"Okta",icon:()=>null},tn=new Set(["openid","profile","email","phone","address","groups","offline_access"]),wn="okta.";class Mn{static create(n){const{configApi:s,discoveryApi:a,environment:p="development",provider:A=Un,oauthRequestApi:k,defaultScopes:M=["openid","email","profile","offline_access"]}=n;return Bt.create({configApi:s,discoveryApi:a,oauthRequestApi:k,provider:A,environment:p,defaultScopes:M,scopeTransform(ae){return ae.map(xe=>tn.has(xe)||xe.startsWith(wn)?xe:`${wn}${xe}`)}})}}var ut=r(30195);const _n=ut.z.object({profile:ut.z.object({email:ut.z.string().optional(),displayName:ut.z.string().optional(),picture:ut.z.string().optional()}),backstageIdentity:ut.z.object({token:ut.z.string(),identity:ut.z.object({type:ut.z.literal("user"),userEntityRef:ut.z.string(),ownershipEntityRefs:ut.z.array(ut.z.string())})})}),wt={id:"saml",title:"SAML",icon:()=>null};class ct{static create(n){const{discoveryApi:s,environment:a="development",provider:p=wt}=n,A=new DirectAuthConnector({discoveryApi:s,environment:a,provider:p}),k=new StaticAuthSessionManager({connector:A}),M=new AuthSessionStore({manager:k,storageKey:`${p.id}Session`,schema:samlSessionSchema});return new ct(M)}sessionState$(){return this.sessionManager.sessionState$()}async signIn(){await this.getBackstageIdentity({})}async signOut(){await this.sessionManager.removeSession()}async getBackstageIdentity(n={}){const s=await this.sessionManager.getSession(n);return s==null?void 0:s.backstageIdentity}async getProfile(n={}){const s=await this.sessionManager.getSession(n);return s==null?void 0:s.profile}constructor(n){_define_property(this,"sessionManager",void 0),this.sessionManager=n}}const vn={id:"microsoft",title:"Microsoft",icon:()=>null};class Kt{static create(n){return new Kt(n)}microsoftGraph(){return this.oauth2[Kt.MicrosoftGraphID]}static resourceForScopes(n){const s=n.split(" ").map(Kt.resourceForScope).filter(A=>A!=="openid");if(s.length>1)return Promise.reject(new Error(`Requested access token with scopes from multiple Azure resources: ${s.join(", ")}. Access tokens can only have a single audience.`));var a;const p=(a=s[0])!==null&&a!==void 0?a:Kt.MicrosoftGraphID;return Promise.resolve(p)}static resourceForScope(n){var s;const a=(s=n.match(RegExp("^(?<resourceURI>.*)\\/(?<scp>[^\\/]*)$")))===null||s===void 0?void 0:s.groups;if(a){const{resourceURI:p}=a;return p.replace(/^api:\/\//,"")}switch(n){case"email":case"openid":case"offline_access":case"profile":return"openid";default:return Kt.MicrosoftGraphID}}async getAccessToken(n,s){const a=n===void 0?Kt.MicrosoftGraphID:await Kt.resourceForScopes(Array.isArray(n)?n.join(" "):n);return a in this.oauth2||(this.oauth2[a]=Bt.create({configApi:this.configApi,discoveryApi:this.discoveryApi,oauthRequestApi:this.oauthRequestApi,provider:this.provider,environment:this.environment,scopeTransform:this.scopeTransform})),this.oauth2[a].getAccessToken(n,s)}getIdToken(n){return this.microsoftGraph().getIdToken(n)}getProfile(n){return this.microsoftGraph().getProfile(n)}getBackstageIdentity(n){return this.microsoftGraph().getBackstageIdentity(n)}signIn(){return this.microsoftGraph().signIn()}signOut(){return this.microsoftGraph().signOut()}sessionState$(){return this.microsoftGraph().sessionState$()}constructor(n){(0,z._)(this,"oauth2",void 0),(0,z._)(this,"configApi",void 0),(0,z._)(this,"environment",void 0),(0,z._)(this,"provider",void 0),(0,z._)(this,"oauthRequestApi",void 0),(0,z._)(this,"discoveryApi",void 0),(0,z._)(this,"scopeTransform",void 0);const{configApi:s,environment:a="development",provider:p=vn,oauthRequestApi:A,discoveryApi:k,defaultScopes:M=["openid","offline_access","profile","email","User.Read"],scopeTransform:ae=xe=>xe.concat("offline_access")}=n;this.configApi=s,this.environment=a,this.provider=p,this.oauthRequestApi=A,this.discoveryApi=k,this.scopeTransform=ae,this.oauth2={[Kt.MicrosoftGraphID]:Bt.create({configApi:this.configApi,discoveryApi:this.discoveryApi,oauthRequestApi:this.oauthRequestApi,provider:this.provider,environment:this.environment,scopeTransform:this.scopeTransform,defaultScopes:M})}}}(0,z._)(Kt,"MicrosoftGraphID","00000003-0000-0000-c000-000000000000");const hn={id:"onelogin",title:"onelogin",icon:()=>null},jn=new Set(["openid","profile","email","phone","address","groups","offline_access"]),ln="onelogin.";class Tn{static create(n){const{configApi:s,discoveryApi:a,environment:p="development",provider:A=hn,oauthRequestApi:k}=n;return Bt.create({configApi:s,discoveryApi:a,oauthRequestApi:k,provider:A,environment:p,defaultScopes:["openid","email","profile","offline_access"],scopeTransform(M){return M.map(ae=>jn.has(ae)||ae.startsWith(ln)?ae:`${ln}${ae}`)}})}}const Ce={id:"bitbucket",title:"Bitbucket",icon:()=>null};class ce{static create(n){const{configApi:s,discoveryApi:a,environment:p="development",provider:A=Ce,oauthRequestApi:k,defaultScopes:M=["team"]}=n;return Bt.create({configApi:s,discoveryApi:a,oauthRequestApi:k,provider:A,environment:p,defaultScopes:M})}}const Oe={id:"bitbucketServer",title:"Bitbucket Server",icon:()=>null};class Me{static create(n){const{configApi:s,discoveryApi:a,environment:p="development",provider:A=Oe,oauthRequestApi:k,defaultScopes:M=["PROJECT_ADMIN"]}=n;return Bt.create({configApi:s,discoveryApi:a,oauthRequestApi:k,provider:A,environment:p,defaultScopes:M})}}const Xe={id:"atlassian",title:"Atlassian",icon:()=>null};class se{static create(n){const{configApi:s,discoveryApi:a,environment:p="development",provider:A=Xe,oauthRequestApi:k}=n;return Bt.create({configApi:s,discoveryApi:a,oauthRequestApi:k,provider:A,environment:p})}}class D{post(n){this.subject.next(n)}alert$(){return this.subject}constructor(){(0,z._)(this,"subject",new tt)}}class me{captureEvent(n){}}const De="theme";class et{static createWithStorage(n){const s=new et(n);if(!window.localStorage)return s;var a;const p=(a=window.localStorage.getItem(De))!==null&&a!==void 0?a:void 0;return s.setActiveThemeId(p),s.activeThemeId$().subscribe(A=>{A?window.localStorage.setItem(De,A):window.localStorage.removeItem(De)}),window.addEventListener("storage",A=>{if(A.key===De){var k;const M=(k=localStorage.getItem(De))!==null&&k!==void 0?k:void 0;s.setActiveThemeId(M)}}),s}getInstalledThemes(){return this.themes.slice()}activeThemeId$(){return this.subject}getActiveThemeId(){return this.activeThemeId}setActiveThemeId(n){this.activeThemeId=n,this.subject.next(n)}constructor(n){(0,z._)(this,"themes",void 0),(0,z._)(this,"activeThemeId",void 0),(0,z._)(this,"subject",void 0),this.themes=n,this.subject=new bt(void 0)}}var it=r(9850),kt=r.n(it),Ft=r(12782),Qt=r.n(Ft);const _=/^[a-z][a-z0-9]*(?:[-_][a-z][a-z0-9]*)*$/i;function J(i){return typeof i=="object"&&i!==null&&!Array.isArray(i)}function te(i){if(i===null)return"null";if(Array.isArray(i))return"array";const n=typeof i;return n==="number"&&isNaN(i)?"nan":n==="string"&&i===""?"empty-string":n}const pe={type(i,n,s,a){return`Invalid type in config for key '${i}' in '${n}', got ${s}, wanted ${a}`},missing(i){return`Missing required config value at '${i}'`},convert(i,n,s){return`Unable to convert config value for key '${i}' in '${n}' to a ${s}`}};class le{static fromConfigs(n){return n.length===0?new le(void 0):n.reduce((s,{data:a,context:p,filteredKeys:A,deprecatedKeys:k})=>{const M=new le(a,p,s);if(M.filteredKeys=A,k)for(const{key:ae,description:xe}of k)console.warn(`The configuration key '${ae}' of ${p} is deprecated and may be removed soon. ${xe||""}`);return M},void 0)}has(n){var s;if(this.readValue(n)!==void 0)return!0;var p;return(p=(s=this.fallback)===null||s===void 0?void 0:s.has(n))!==null&&p!==void 0?p:!1}keys(){var n;const s=this.data?Object.keys(this.data):[];var a;const p=(a=(n=this.fallback)===null||n===void 0?void 0:n.keys())!==null&&a!==void 0?a:[];return[...new Set([...s,...p])]}get(n){const s=this.getOptional(n);if(s===void 0)throw new Error(pe.missing(this.fullKey(n!=null?n:"")));return s}getOptional(n){var s;const a=kt()(this.readValue(n)),p=(s=this.fallback)===null||s===void 0?void 0:s.getOptional(n);if(a===void 0){if(!1)var A;return p}else if(p===void 0)return a;return Qt()({},{value:p},{value:a},(k,M)=>!J(M)||!J(k)?M:void 0).value}getConfig(n){const s=this.getOptionalConfig(n);if(s===void 0)throw new Error(pe.missing(this.fullKey(n)));return s}getOptionalConfig(n){var s;const a=this.readValue(n),p=(s=this.fallback)===null||s===void 0?void 0:s.getOptionalConfig(n);if(J(a))return this.copy(a,n,p);if(a!==void 0)throw new TypeError(pe.type(this.fullKey(n),this.context,te(a),"object"));return p}getConfigArray(n){const s=this.getOptionalConfigArray(n);if(s===void 0)throw new Error(pe.missing(this.fullKey(n)));return s}getOptionalConfigArray(n){const s=this.readConfigValue(n,p=>{if(!Array.isArray(p))return{expected:"object-array"};for(const[A,k]of p.entries())if(!J(k))return{expected:"object-array",value:k,key:`${n}[${A}]`};return!0});if(!s){if(!1)var a;return}return s.map((p,A)=>this.copy(p,`${n}[${A}]`))}getNumber(n){const s=this.getOptionalNumber(n);if(s===void 0)throw new Error(pe.missing(this.fullKey(n)));return s}getOptionalNumber(n){const s=this.readConfigValue(n,p=>typeof p=="number"||typeof p=="string"||{expected:"number"});if(typeof s=="number"||s===void 0)return s;const a=Number(s);if(!Number.isFinite(a))throw new Error(pe.convert(this.fullKey(n),this.context,"number"));return a}getBoolean(n){const s=this.getOptionalBoolean(n);if(s===void 0)throw new Error(pe.missing(this.fullKey(n)));return s}getOptionalBoolean(n){const s=this.readConfigValue(n,p=>typeof p=="boolean"||typeof p=="number"||typeof p=="string"||{expected:"boolean"});if(typeof s=="boolean"||s===void 0)return s;const a=String(s).trim();if(/^(?:y|yes|true|1|on)$/i.test(a))return!0;if(/^(?:n|no|false|0|off)$/i.test(a))return!1;throw new Error(pe.convert(this.fullKey(n),this.context,"boolean"))}getString(n){const s=this.getOptionalString(n);if(s===void 0)throw new Error(pe.missing(this.fullKey(n)));return s}getOptionalString(n){return this.readConfigValue(n,s=>typeof s=="string"&&s!==""||{expected:"string"})}getStringArray(n){const s=this.getOptionalStringArray(n);if(s===void 0)throw new Error(pe.missing(this.fullKey(n)));return s}getOptionalStringArray(n){return this.readConfigValue(n,s=>{if(!Array.isArray(s))return{expected:"string-array"};for(const[a,p]of s.entries())if(typeof p!="string"||p==="")return{expected:"string-array",value:p,key:`${n}[${a}]`};return!0})}fullKey(n){return`${this.prefix}${this.prefix?".":""}${n}`}copy(n,s,a){const p=new le(n,this.context,a,this.fullKey(s));return p.filteredKeys=this.filteredKeys,p}readConfigValue(n,s){const a=this.readValue(n);if(a===void 0){var p;if(!1)var A;return(p=this.fallback)===null||p===void 0?void 0:p.readConfigValue(n,s)}const k=s(a);if(k!==!0){const{key:M=n,value:ae=a,expected:xe}=k;throw new TypeError(pe.type(this.fullKey(M),this.context,te(ae),xe))}return a}readValue(n){const s=n?n.split("."):[];for(const p of s)if(!_.test(p))throw new TypeError(`Invalid config key '${n}'`);if(this.data===void 0)return;let a=this.data;for(const[p,A]of s.entries())if(J(a))a=a[A];else if(a!==void 0){const k=this.fullKey(s.slice(0,p).join("."));throw new TypeError(pe.type(k,this.context,te(a),"object"))}return a}constructor(n,s="mock-config",a,p=""){(0,z._)(this,"data",void 0),(0,z._)(this,"context",void 0),(0,z._)(this,"fallback",void 0),(0,z._)(this,"prefix",void 0),(0,z._)(this,"filteredKeys",void 0),(0,z._)(this,"notifiedFilteredKeys",void 0),this.data=n,this.context=s,this.fallback=a,this.prefix=p,this.notifiedFilteredKeys=new Set}}const y="Invalid discovery URL pattern,";class Z{static compile(n){const s=n.split(/\{\{\s*pluginId\s*\}\}/),a=s.join("pluginId");let p;try{p=new URL(a)}catch{throw new Error(`${y} URL '${a}' is invalid`)}if(p.hash)throw new Error(`${y} URL must not have a hash`);if(p.search)throw new Error(`${y} URL must not have a query`);if(a.endsWith("/"))throw new Error(`${y} URL must not end with a slash`);return new Z(s)}async getBaseUrl(n){return this.parts.join(encodeURIComponent(n))}constructor(n){(0,z._)(this,"parts",void 0),this.parts=n}}class q{post(n,s){return s!=null&&s.hidden||this.alertApi.post({message:n.message,severity:"error"}),this.errorApi.post(n,s)}error$(){return this.errorApi.error$()}constructor(n,s){(0,z._)(this,"alertApi",void 0),(0,z._)(this,"errorApi",void 0),this.alertApi=n,this.errorApi=s}}class Y{post(n,s){this.subject.next({error:n,context:s})}error$(){return this.subject}constructor(){(0,z._)(this,"subject",new tt)}}class we{static forward(n,s){window.addEventListener("unhandledrejection",a=>{n.post(a.reason,s)})}}function Ae(i){if(i.length<3)throw new Error(`The '${i}' feature flag must have a minimum length of three characters.`);if(i.length>150)throw new Error(`The '${i}' feature flag must not exceed 150 characters.`);if(!i.match(/^[a-z]+[a-z0-9-]+$/))throw new Error(`The '${i}' feature flag must start with a lowercase letter and only contain lowercase letters, numbers and hyphens. Examples: feature-flag-one, alpha, release-2020`)}class Ye{registerFlag(n){Ae(n.name),this.registeredFeatureFlags.push(n)}getRegisteredFlags(){return this.registeredFeatureFlags.slice()}isActive(n){return this.flags||(this.flags=this.load()),this.flags.get(n)===g.CL.Active}save(n){this.flags||(this.flags=this.load()),n.merge||this.flags.clear();for(const[a,p]of Object.entries(n.states))this.flags.set(a,p);const s=Array.from(this.flags.entries()).filter(([,a])=>a===g.CL.Active);window.localStorage.setItem("featureFlags",JSON.stringify(Object.fromEntries(s)))}load(){try{const n=window.localStorage.getItem("featureFlags");if(!n)return new Map;const s=JSON.parse(n);if(typeof s!="object"||s===null||Array.isArray(s))return new Map;const a=Object.entries(s).filter(([p,A])=>(Ae(p),A===g.CL.Active));return new Map(a)}catch{return new Map}}constructor(){(0,z._)(this,"registeredFeatureFlags",[]),(0,z._)(this,"flags",void 0)}}function jt(i){let n=i.baseImplementation||r.g.fetch;var s;const a=[(s=i.middleware)!==null&&s!==void 0?s:[]].flat().reverse();for(const p of a)n=p.apply(n);return{fetch:n}}class vt{static create(n){var s,a;const p=nt(n),A=((s=n.header)===null||s===void 0?void 0:s.name)||"authorization",k=((a=n.header)===null||a===void 0?void 0:a.value)||(M=>`Bearer ${M}`);return new vt(n.identityApi,p,A,k)}apply(n){return async(s,a)=>{const p=new Request(s,a),{token:A}=await this.identityApi.getCredentials();return p.headers.get(this.headerName)||typeof A!="string"||!A||!this.allowUrl(p.url)?n(s,a):(p.headers.set(this.headerName,this.headerValue(A)),n(p))}}constructor(n,s,a,p){(0,z._)(this,"identityApi",void 0),(0,z._)(this,"allowUrl",void 0),(0,z._)(this,"headerName",void 0),(0,z._)(this,"headerValue",void 0),this.identityApi=n,this.allowUrl=s,this.headerName=a,this.headerValue=p}}function nt(i){return i.allowUrl?i.allowUrl:i.urlPrefixAllowlist?Ke(i.urlPrefixAllowlist):i.config?Ke([i.config.getString("backend.baseUrl")]):()=>!1}function Ke(i){const n=i.map(s=>s.replace(/\/$/,""));return s=>n.some(a=>s===a||s.startsWith(`${a}/`))}function dt(i,n){return!n||n==="/"?i:`${i.replace(/\/$/,"")}/${n.replace(/^\//,"")}`}class at{apply(n){return async(s,a)=>{const p=new Request(s,a),A="plugin://";if(!p.url.startsWith(A))return n(s,a);const{hostname:k,pathname:M,search:ae,hash:xe,username:Ie,password:Ve}=new URL(`http://${p.url.substring(A.length)}`);let gt=await this.discoveryApi.getBaseUrl(k);if(Ie||Ve){const Rt=new URL(gt),Wt=`${Ie}${Ve?`:${Ve}`:""}@`;gt=`${Rt.protocol}//${Wt}${Rt.host}${Rt.pathname}`}const Tt=`${dt(gt,M)}${ae}${xe}`;return n(Tt,typeof s=="string"||Dt(s)?a:s)}}constructor(n){(0,z._)(this,"discoveryApi",void 0),this.discoveryApi=n}}function Dt(i){return typeof i=="object"&&(i==null?void 0:i.constructor)===URL}class Mt{static resolvePluginProtocol(n){return new at(n.discoveryApi)}static injectIdentityAuth(n){return vt.create(n)}constructor(){}}function Xt(i,n){for(const s of n)if(!i.has(s))return!1;return!0}function en(i,...n){const s=new Set(i);for(const a of n)for(const p of a)s.add(p);return s}class Ut{request(n){return new Promise((s,a)=>{this.requests.push({scopes:n,resolve:s,reject:a}),this.subject.next(this.getCurrentPending())})}resolve(n,s){this.requests=this.requests.filter(a=>Xt(n,a.scopes)?(a.resolve(s),!1):!0),this.subject.next(this.getCurrentPending())}reject(n){this.requests.forEach(s=>s.reject(n)),this.requests=[],this.subject.next(this.getCurrentPending())}pending(){return this.subject}getCurrentPending(){const n=this.requests.length===0?void 0:this.requests.slice(1).reduce((s,a)=>en(s,a.scopes),this.requests[0].scopes);return{scopes:n,resolve:s=>{n&&this.resolve(n,s)},reject:s=>{n&&this.reject(s)}}}constructor(){(0,z._)(this,"requests",[]),(0,z._)(this,"subject",new bt(this.getCurrentPending()))}}class zt{createAuthRequester(n){const s=new Ut,a=this.handlerCount;return this.handlerCount++,s.pending().subscribe({next:p=>{const A=this.currentRequests.slice(),k=this.makeAuthRequest(p,n);k?A[a]=k:delete A[a],this.currentRequests=A,this.subject.next(A.filter(Boolean))}}),p=>s.request(p)}makeAuthRequest(n,s){const{scopes:a}=n;if(a)return{provider:s.provider,trigger:async()=>{const p=await s.onAuthRequest(a);n.resolve(p)},reject:()=>{const p=new Error("Login failed, rejected by user");p.name="RejectedError",n.reject(p)}}}authRequest$(){return this.subject}constructor(){(0,z._)(this,"subject",new bt([])),(0,z._)(this,"currentRequests",[]),(0,z._)(this,"handlerCount",0)}}const Et=new Map;class Lt{static create(n){var s;return new Lt((s=n.namespace)!==null&&s!==void 0?s:"",n.errorApi)}static addStorageEventListener(){window.addEventListener("storage",n=>{for(const[a,p]of Et.entries()){var s;!((s=n.key)===null||s===void 0)&&s.startsWith(a)&&p.handleStorageChange(n.key)}})}get(n){return this.snapshot(n).value}snapshot(n){let s,a="absent";try{const p=localStorage.getItem(this.getKeyName(n));p&&(s=JSON.parse(p,(A,k)=>(typeof k=="object"&&k!==null&&Object.freeze(k),k)),a="present")}catch{this.errorApi.post(new Error(`Error when parsing JSON config from storage for: ${n}`))}return{key:n,value:s,presence:a}}forBucket(n){const s=`${this.namespace}/${n}`;return Et.has(s)||Et.set(s,new Lt(s,this.errorApi)),Et.get(s)}async set(n,s){localStorage.setItem(this.getKeyName(n),JSON.stringify(s)),this.notifyChanges(n)}async remove(n){localStorage.removeItem(this.getKeyName(n)),this.notifyChanges(n)}observe$(n){return Lt.hasSubscribed||(Lt.addStorageEventListener(),Lt.hasSubscribed=!0),this.observable.filter(({key:s})=>s===n)}handleStorageChange(n){if(!(n!=null&&n.startsWith(this.namespace)))return;const s=n==null?void 0:n.slice(`${this.namespace}/`.length);s.includes("/")||this.notifyChanges(decodeURIComponent(s))}getKeyName(n){return`${this.namespace}/${encodeURIComponent(n)}`}notifyChanges(n){const s=this.snapshot(n);for(const a of this.subscribers)a.next(s)}constructor(n,s){(0,z._)(this,"namespace",void 0),(0,z._)(this,"errorApi",void 0),(0,z._)(this,"subscribers",void 0),(0,z._)(this,"observable",void 0),this.namespace=n,this.errorApi=s,this.subscribers=new Set,this.observable=new(Se())(a=>(this.subscribers.add(a),()=>{this.subscribers.delete(a)}))}}(0,z._)(Lt,"hasSubscribed",!1);const Zt=(0,H.createContext)(void 0);function bn(){const[i]=(0,W.is)((0,h.jsx)(W.AW,{index:!0,element:(0,h.jsx)("div",{})}));return!i.index}var zn=r(84800);const Gn=(i,n)=>{try{var s;const a=(0,zn.fp)(n,{pathname:i}),p=a==null?void 0:a.filter(ae=>{var xe;return((xe=ae==null?void 0:ae.route.routeRefs)===null||xe===void 0?void 0:xe.size)>0}).pop(),A=p==null?void 0:p.route;if(!A)return;let k;A.routeRefs.size===1&&(k=A.routeRefs.values().next().value);const M=Object.entries((p==null?void 0:p.params)||{}).reduce((ae,[xe,Ie])=>(Ie!==void 0&&(ae[xe]=Ie),ae),{});return{extension:"App",pluginId:((s=A.plugin)===null||s===void 0?void 0:s.getId())||"root",...k?{routeRef:k.id}:{},params:M}}catch{return}},ur=({pathname:i,search:n,hash:s,attributes:a})=>{const p=(0,g.z$)();return(0,H.useEffect)(()=>{p.captureEvent("navigate",`${i}${n}${s}`,{attributes:a})},[p,i,n,s,a]),null},En=({routeObjects:i})=>{const{pathname:n,search:s,hash:a}=(0,W.TH)(),{params:p,...A}=Gn(n,i)||{params:{}};return(0,h.jsx)(g.fC,{attributes:A,children:(0,h.jsx)(ur,{pathname:n,search:s,hash:a,attributes:p})})};function On(i){return bn()?er(i):""}function er(i){var n;let{pathname:s}=new URL((n=i.getOptionalString("app.baseUrl"))!==null&&n!==void 0?n:"/","http://sample.dev");return s=s.replace(/\/*$/,""),s}function S({component:i,appIdentityProxy:n,children:s}){const[a,p]=(0,H.useState)(),A=(0,g.h_)(g.Ds),k=On(A);return a?(n.setTarget(a,{signOutTargetUrl:k||"/"}),(0,h.jsx)(h.Fragment,{children:s})):(0,h.jsx)(i,{onSignInSuccess:p})}function c(i){const{Router:n,SignInPage:s}=(0,g.qD)().getComponents(),a=(0,g.h_)(g.Ds),p=er(a),A=`${p}/*`,k=(0,H.useContext)(Zt);if(!k)throw new Error("AppRouter must be rendered within the AppProvider");const{routeObjects:M,appIdentityProxy:ae}=k;return s?bn()?(0,h.jsxs)(n,{children:[(0,h.jsx)(En,{routeObjects:M}),(0,h.jsx)(S,{component:s,appIdentityProxy:ae,children:(0,h.jsx)(W.Z5,{children:(0,h.jsx)(W.AW,{path:A,element:(0,h.jsx)(h.Fragment,{children:i.children})})})})]}):(0,h.jsxs)(n,{basename:p,children:[(0,h.jsx)(En,{routeObjects:M}),(0,h.jsx)(S,{component:s,appIdentityProxy:ae,children:i.children})]}):(ae.setTarget({getUserId:()=>"guest",getIdToken:async()=>{},getProfile:()=>({email:"guest@example.com",displayName:"Guest"}),getProfileInfo:async()=>({email:"guest@example.com",displayName:"Guest"}),getBackstageIdentity:async()=>({type:"user",userEntityRef:"user:default/guest",ownershipEntityRefs:["user:default/guest"]}),getCredentials:async()=>({}),signOut:async()=>{}},{signOutTargetUrl:p||"/"}),bn()?(0,h.jsxs)(n,{children:[(0,h.jsx)(En,{routeObjects:M}),(0,h.jsx)(W.Z5,{children:(0,h.jsx)(W.AW,{path:A,element:(0,h.jsx)(h.Fragment,{children:i.children})})})]}):(0,h.jsxs)(n,{basename:p,children:[(0,h.jsx)(En,{routeObjects:M}),i.children]}))}var b=r(88412),E=r(50629),Q=r(80956),be=r(64279);function je(i){const n={};for(const a in i.collectors)i.collectors.hasOwnProperty(a)&&(n[a]=i.collectors[a]());const s=[{node:H.Children.toArray(i.root),parent:void 0,contexts:{}}];for(;s.length!==0;){const{node:a,parent:p,contexts:A}=s.shift();H.Children.forEach(a,k=>{if(!(0,H.isValidElement)(k))return;const M={};for(const ae in n)if(n.hasOwnProperty(ae)){const xe=n[ae];M[ae]=xe.visit(xe.accumulator,k,p,A[ae])}for(const ae of i.discoverers){const xe=ae(k);xe&&s.push({node:xe,parent:k,contexts:M})}})}return Object.fromEntries(Object.entries(n).map(([a,p])=>[a,p.accumulator]))}function ke(i,n){return()=>({accumulator:i(),visit:n})}function ht(i){var n;return(n=i.props)===null||n===void 0?void 0:n.children}function ft(i){var n,s;if(!((n=i.props)===null||n===void 0)&&n.path&&(!((s=i.props)===null||s===void 0)&&s.element)){var a;return(a=i.props)===null||a===void 0?void 0:a.element}}const yn=ke(()=>new Set,(i,n)=>{const s=(0,g.IY)(n,"core.plugin");s&&i.add(s)}),kn=i=>{const{children:n}=i,s=(0,g.h_)(g.W0),a="with"in i?s.isActive(i.with):!s.isActive(i.without);return(0,h.jsx)(h.Fragment,{children:a?n:null})};(0,g.R5)(kn,"core.featureFlagged",!0);const br={caseSensitive:!1,path:"*",element:"match-all",routeRefs:new Set};function Br(i){const n=i;if(n!=null&&n.type){var s,a;return(a=(s=n.type.displayName)!==null&&s!==void 0?s:n.type.name)!==null&&a!==void 0?a:String(n.type)}return String(n)}function $r(i,n=new Array){return H.Children.forEach(i,s=>{if(!(0,H.isValidElement)(s))return;const a=(0,g.IY)(s,"core.mountPoint");if(a){const p=(0,g.IY)(s,"core.plugin");n.push({routeRef:a,plugin:p})}$r(s.props.children,n)}),n}const Ao=ke(()=>({paths:new Map,parents:new Map,objects:new Array}),(i,n,s,a)=>{var p,A;if(a!=null&&a.isElementAncestor)return a;if((s==null?void 0:s.props.element)===n)return{...a,isElementAncestor:!0};const k=(p=n.props)===null||p===void 0?void 0:p.path,M=(0,g.IY)(n,"core.mountPoint");if(M&&k)throw new Error(`Path property may not be set directly on a routable extension "${Br(n)}"`);var ae;const xe=(ae=a==null||(A=a.obj)===null||A===void 0?void 0:A.children)!==null&&ae!==void 0?ae:i.objects;if(k!==void 0){if(typeof k!="string")throw new Error(`Element path must be a string at "${Br(n)}"`);const Tt=k.startsWith("/")?k.slice(1):k,Rt=n.props.element;if((0,g.IY)(n,"core.gatherMountPoints")){var Ie;if(Rt)throw new Error(`Mount point gatherers may not have an element prop "${Br(n)}"`);const Wt={path:Tt,element:"gathered",routeRefs:new Set,caseSensitive:Boolean((Ie=n.props)===null||Ie===void 0?void 0:Ie.caseSensitive),children:[br],plugin:void 0};return xe.push(Wt),{obj:Wt,gatherPath:Tt,routeRef:a==null?void 0:a.routeRef,gatherRouteRef:a==null?void 0:a.routeRef}}if(Rt){var Ve;const[Wt,...Gt]=$r(Rt);if(Gt.length>0)throw new Error(`Route element with path "${k}" may not contain multiple routable extensions`);if(!Wt)return a;const{routeRef:$n,plugin:Xn}=Wt,fr={path:Tt,element:"mounted",routeRefs:new Set([$n]),caseSensitive:Boolean((Ve=n.props)===null||Ve===void 0?void 0:Ve.caseSensitive),children:[br],plugin:Xn};return xe.push(fr),i.paths.set($n,Tt),i.parents.set($n,a==null?void 0:a.routeRef),{obj:fr,routeRef:$n!=null?$n:a==null?void 0:a.routeRef,gatherPath:Tt,gatherRouteRef:a==null?void 0:a.gatherRouteRef}}}if(M){var gt;if((a==null?void 0:a.gatherPath)===void 0)throw new Error(`Routable extension "${Br(n)}" with mount point "${M}" must be assigned a path`);return a==null||(gt=a.obj)===null||gt===void 0||gt.routeRefs.add(M),i.paths.set(M,a.gatherPath),i.parents.set(M,a==null?void 0:a.gatherRouteRef),{...a,routeRef:M}}return a}),eo=ke(()=>({paths:new Map,parents:new Map,objects:new Array}),(i,n,s,a)=>{var p,A,k;if((s==null?void 0:s.props.element)===n)return a;let M=a==null?void 0:a.obj,ae=a==null?void 0:a.routeRef,xe=a==null?void 0:a.sticky;const Ie=(p=n.props)===null||p===void 0?void 0:p.path;var Ve;const gt=(Ve=M==null?void 0:M.children)!==null&&Ve!==void 0?Ve:i.objects,Tt=Boolean((A=n.props)===null||A===void 0?void 0:A.caseSensitive);let Rt=a==null?void 0:a.path;if((0,g.IY)(n,"core.gatherMountPoints")){if(!Ie)throw new Error("Mount point gatherer must have a path");Rt=Ie}const Wt=(k=n.props)===null||k===void 0?void 0:k.element;let Gt=(0,g.IY)(n,"core.mountPoint");if(!Gt&&(0,H.isValidElement)(Wt)&&(Gt=(0,g.IY)(Wt,"core.mountPoint")),Gt){let fr=Ie;if(Rt&&(fr?Rt=void 0:fr=Rt),!fr)throw new Error("Mounted routable extension must have a path");i.paths.set(Gt,fr),ae&&xe?(i.parents.set(Gt,ae),Ie&&(ae=Gt,xe=!1)):(i.parents.set(Gt,ae),ae=Gt),Ie?(M={caseSensitive:Tt,path:Ie,element:"mounted",routeRefs:new Set([Gt]),children:[br],plugin:(0,g.IY)(n.props.element,"core.plugin")},gt.push(M)):M==null||M.routeRefs.add(Gt)}if((0,g.IY)(n,"core.gatherMountPoints")&&(xe=!0),(0,g.IY)(n,"core.gatherMountPoints")){if(!Ie)throw new Error("Mount point gatherer must have a path");if(!Gt){var Xn;M={caseSensitive:Tt,path:Ie,element:"gathered",routeRefs:new Set,children:[br],plugin:a==null||(Xn=a.obj)===null||Xn===void 0?void 0:Xn.plugin},gt.push(M)}}return{obj:M,path:Rt,routeRef:ae,sticky:xe}}),Sr=ke(()=>new Set,(i,n)=>{if(n.type===kn){const s=n.props;i.add("with"in s?s.with:s.without)}}),Rr=(0,ot.uW)("route-ref-type",()=>Symbol("route-ref-type"));function or(i){return i[Rr]==="absolute"}function Kn(i){return i[Rr]==="sub"}function Ir(i){return i[Rr]==="external"}function Cr(...i){const n=i.join("/").replace(/\/\/+/g,"/");return n!=="/"&&n.endsWith("/")?n.slice(0,-1):n}function To(i,n,s){let a,p="";if(or(i))a=i;else if(Kn(i))a=i.parent,p=i.path;else if(Ir(i)){const M=s.get(i);if(!M)return[void 0,""];if(or(M))a=M;else if(Kn(M))a=M.parent,p=M.path;else throw new Error(`ExternalRouteRef was bound to invalid target, ${M}`)}else throw i[Rr]?new Error(`Unknown or invalid route ref type, ${i[Rr]}`):new Error(`Unknown object passed to useRouteRef, got ${i}`);if(!a)return[void 0,""];const A=n.get(a);if(A===void 0)return[void 0,""];const k=Cr(A,p);return[a,k]}function Ro(i,n,s,a,p){var A;const k=(A=(0,zn.fp)(p,n))!==null&&A!==void 0?A:[],M=Array();let ae=-1;for(let Ve=i;Ve&&(ae=k.findIndex(gt=>gt.route.routeRefs.has(Ve)),ae===-1);Ve=a.get(Ve))M.unshift(Ve);M.length===0&&(ae-=1);const xe=ae===-1?"":k[ae].pathname,Ie=M.slice(0,-1).map(Ve=>{const gt=s.get(Ve);if(gt===void 0)throw new Error(`No path for ${Ve}`);if(gt.includes(":"))throw new Error(`Cannot route to ${i} with parent ${Ve} as it has parameters`);return gt});return`${Cr(xe,...Ie)}/`}class to{resolve(n,s){const[a,p]=To(n,this.routePaths,this.routeBindings);if(!a)return;let A;typeof s=="string"?A=this.trimPath(s):s.pathname?A={...s,pathname:this.trimPath(s.pathname)}:A=s;const k=this.appBasePath+Ro(a,A,this.routePaths,this.routeParents,this.routeObjects);return(...[ae])=>Cr(k,(0,zn.Gn)(p,ae))}trimPath(n){return n&&(n.startsWith(this.appBasePath)?n.slice(this.appBasePath.length):n)}constructor(n,s,a,p,A){(0,z._)(this,"routePaths",void 0),(0,z._)(this,"routeParents",void 0),(0,z._)(this,"routeObjects",void 0),(0,z._)(this,"routeBindings",void 0),(0,z._)(this,"appBasePath",void 0),this.routePaths=n,this.routeParents=s,this.routeObjects=a,this.routeBindings=p,this.appBasePath=A}}const Io=(0,ot.CT)("routing-context"),Po=({routePaths:i,routeParents:n,routeObjects:s,routeBindings:a,basePath:p="",children:A})=>{const k=new to(i,n,s,a,p),M=(0,ot.EI)({1:k});return(0,h.jsx)(Io.Provider,{value:M,children:A})};function Wr(i,n){const s=new Set(n.values());s.delete(void 0);for(const a of n.keys()){if(s.has(a))continue;let p=a,A="";for(;p;){const M=i.get(p);if(M===void 0)throw new Error(`No path for ${p}`);A=Cr(M,A),p=n.get(p)}const k=A.match(/:(\w+)/g);if(k){for(let M=0;M<k.length;M++)for(let ae=M+1;ae<k.length;ae++)if(k[ae]===k[M])throw new Error(`Parameter ${k[ae]} is duplicated in path ${A}`)}}}function tr(i,n){for(const s of n)if(s.externalRoutes){for(const[a,p]of Object.entries(s.externalRoutes))if(!p.optional&&!i.has(p))throw new Error(`External route '${a}' of the '${s.getId()}' plugin must be bound to a target route. See https://backstage.io/link?bind-routes for details.`)}}const Dr=(0,ot.CT)("app-context"),Zr=({appContext:i,children:n})=>{const s=(0,ot.EI)({1:i});return(0,h.jsx)(Dr.Provider,{value:s,children:n})};function no(i){return new Error(`Tried to access IdentityApi ${i} before app was loaded`)}function Pr(i){console.warn(`WARNING: Call to ${i} is deprecated and will break in the future`)}class Vr{setTarget(n,s){this.target=n,this.signOutTargetUrl=s.signOutTargetUrl,this.resolveTarget(n)}getUserId(){if(!this.target)throw no("getUserId");if(!this.target.getUserId)throw new Error("IdentityApi does not implement getUserId");return Pr("getUserId"),this.target.getUserId()}getProfile(){if(!this.target)throw no("getProfile");if(!this.target.getProfile)throw new Error("IdentityApi does not implement getProfile");return Pr("getProfile"),this.target.getProfile()}async getProfileInfo(){return this.waitForTarget.then(n=>n.getProfileInfo())}async getBackstageIdentity(){const n=await this.waitForTarget.then(s=>s.getBackstageIdentity());return n.userEntityRef.match(/^.*:.*\/.*$/)||console.warn(`WARNING: The App IdentityApi provided an invalid userEntityRef, '${n.userEntityRef}'. It must be a full Entity Reference of the form '<kind>:<namespace>/<name>'.`),n}async getCredentials(){return this.waitForTarget.then(n=>n.getCredentials())}async getIdToken(){return this.waitForTarget.then(n=>{if(!n.getIdToken)throw new Error("IdentityApi does not implement getIdToken");return Pr("getIdToken"),n.getIdToken()})}async signOut(){await this.waitForTarget.then(n=>n.signOut()),window.location.href=this.signOutTargetUrl}constructor(){(0,z._)(this,"target",void 0),(0,z._)(this,"waitForTarget",void 0),(0,z._)(this,"resolveTarget",()=>{}),(0,z._)(this,"signOutTargetUrl","/"),this.waitForTarget=new Promise(n=>{this.resolveTarget=n})}}var Lo=r(72164);function ro(i,n,s){if(i!==void 0){const p=s.find(A=>A.id===i);if(p)return p}if(n){const p=s.find(A=>A.variant==="dark");if(p)return p}const a=s.find(p=>p.variant==="light");return a||s[0]}const Sn=()=>{const i=(0,H.useMemo)(()=>window.matchMedia("(prefers-color-scheme: dark)"),[]),[n,s]=(0,H.useState)(i.matches);return(0,H.useEffect)(()=>{const a=p=>{s(p.matches)};return i.addListener(a),()=>{i.removeListener(a)}},[i]),n};function oo({children:i}){const n=(0,g.h_)(g.hg),s=(0,Lo.Z)(n.activeThemeId$(),n.getActiveThemeId()),a=Boolean(window.matchMedia)?Sn():!1,p=ro(s,a,n.getInstalledThemes());if(!p)throw new Error("App has no themes");return(0,h.jsx)(p.Provider,{children:i})}const so=async(i="__APP_INJECTED_RUNTIME_CONFIG__")=>{const n=[{context:"app-config.yaml",data:{app:{title:"Techdocs Preview App",baseUrl:"http://localhost:3000"},backend:{baseUrl:"http://localhost:3000"},techdocs:{builder:"external"}}}];if(!n)throw new Error("No static configuration provided");if(!Array.isArray(n))throw new Error("Static configuration has invalid format");const s=n.slice();if(i!=="__app_injected_runtime_config__".toLocaleUpperCase("en-US"))try{const p=JSON.parse(i);Array.isArray(p)?s.push(...p):s.push({data:p,context:"env"})}catch(p){throw new Error(`Failed to load runtime configuration, ${p}`)}const a=window.__APP_CONFIG__;return a&&s.push({context:"window",data:a}),s};class io{add(n,s){return this.apis.push([n.id,s]),s}build(){return new wr(new Map(this.apis))}constructor(){(0,z._)(this,"apis",[])}}class wr{static builder(){return new io}static from(n){return new wr(new Map(n.map(([s,a])=>[s.id,a])))}static with(n,s){return new wr(new Map([[n.id,s]]))}with(n,s){return new wr(new Map([...this.apis,[n.id,s]]))}get(n){return this.apis.get(n.id)}constructor(n){(0,z._)(this,"apis",void 0),this.apis=n}}function Oo(i){const n=new Map;return i&&i({bind:(a,p)=>{for(const[A,k]of Object.entries(p)){const M=a[A];if(!M)throw new Error(`Key ${A} is not an existing external route`);if(!k&&!M.optional)throw new Error(`External route ${A} is required but was undefined`);k&&n.set(M,k)}}}),n}function ao(i){const n=new URL(i);return n.protocol=document.location.protocol,n.hostname=document.location.hostname,n.port=document.location.port,n.toString().replace(/\/$/,"")}function ko(i,n,s){var a;const p=Boolean(i),A=(0,be.default)(i||(()=>Promise.resolve([])));let k;if(p&&A.loading){const{Progress:xe}=n;k=(0,h.jsx)(xe,{})}else if(A.error){const{BootErrorPage:xe}=n;k=(0,h.jsx)(xe,{step:"load-config",error:A.error})}const{ThemeProvider:M=oo}=n;if(k)return{node:(0,h.jsx)(st,{apis:wr.with(g.hg,s),children:(0,h.jsx)(M,{children:k})})};let ae;if(!((a=A.value)===null||a===void 0)&&a.length){const xe=le.fromConfigs(A.value),Ie=xe.getOptionalString("app.baseUrl"),Ve=xe.getOptionalString("backend.baseUrl");let gt=A.value;const Tt={data:{},context:"relative-resolver"};if(Ie&&Ve){const Rt=new URL(Ie).origin,Wt=new URL(Ve).origin;if(Rt===Wt){const Gt=ao(Ve);Ve!==Gt&&(Tt.data.backend={baseUrl:Gt})}}if(Ie){const Rt=ao(Ie);Ie!==Rt&&(Tt.data.app={baseUrl:Rt})}Object.keys(Tt.data).length&&(gt=gt.concat([Tt])),ae=le.fromConfigs(gt)}else ae=le.fromConfigs([]);return{api:ae}}class lo{getPlugins(){return this.app.getPlugins()}getSystemIcon(n){return this.app.getSystemIcon(n)}getSystemIcons(){return this.app.getSystemIcons()}getComponents(){return this.app.getComponents()}constructor(n){(0,z._)(this,"app",void 0),this.app=n}}var jr=new WeakMap;class us{getPlugins(){return Array.from(this.plugins)}getSystemIcon(n){return this.icons[n]}getSystemIcons(){return this.icons}getComponents(){return this.components}createRoot(n){const s=this.getProvider();return()=>(0,h.jsx)(s,{children:n})}getProvider(){if((0,b._)(this,jr))throw new Error("app.getProvider() or app.createRoot() has already been called, and can only be called once");(0,Q._)(this,jr,!0);const n=new lo(this);let s=!1;return({children:p})=>{const A=(0,H.useRef)(!0),k=(0,H.useMemo)(()=>et.createWithStorage(this.themes),[]),{routing:M,featureFlags:ae,routeBindings:xe}=(0,H.useMemo)(()=>{const Tt=je({root:p,discoverers:[ht,ft],collectors:{routing:bn()?eo:Ao,collectedPlugins:yn,featureFlags:Sr}});return Tt.collectedPlugins.forEach(Rt=>this.plugins.add(Rt)),this.verifyPlugins(this.plugins),this.getApiHolder(),{...Tt,routeBindings:Oo(this.bindRoutes)}},[p]);s||(s=!0,Wr(M.paths,M.parents),tr(xe,this.plugins));const Ie=ko(this.configLoader,this.components,k),Ve="api"in Ie;if(Ve){const{api:Tt}=Ie;this.configApi=Tt}if("node"in Ie)return Ie.node;if(Ve&&A.current){A.current=!1;const Tt=this.getApiHolder().get(g.W0);if(Tt){for(const Gt of this.featureFlags)Tt.registerFlag({...Gt,pluginId:""});for(const Gt of this.plugins.values())if("getFeatureFlags"in Gt)for(const $n of Gt.getFeatureFlags())Tt.registerFlag({name:$n.name,pluginId:Gt.getId()});else for(const $n of Gt.output())$n.type==="feature-flag"&&Tt.registerFlag({name:$n.name,pluginId:Gt.getId()});const Rt=Tt.getRegisteredFlags(),Wt=new Set(Rt.map(Gt=>Gt.name));for(const Gt of ae)Wt.has(Gt)||Tt.registerFlag({name:Gt,pluginId:""})}}const{ThemeProvider:gt=oo}=this.components;return(0,h.jsx)(st,{apis:this.getApiHolder(),children:(0,h.jsx)(Zr,{appContext:n,children:(0,h.jsx)(gt,{children:(0,h.jsx)(Po,{routePaths:M.paths,routeParents:M.parents,routeObjects:M.objects,routeBindings:xe,basePath:On(Ie.api),children:(0,h.jsx)(Zt.Provider,{value:{routeObjects:M.objects,appIdentityProxy:this.appIdentityProxy},children:p})})})})})}}getRouter(){return c}getApiHolder(){if(this.apiHolder){for(const n of this.plugins)for(const s of n.getApis())this.apiFactoryRegistry.get(s.api)||this.apiFactoryRegistry.register("default",s);return Qe.validateFactories(this.apiFactoryRegistry,this.apiFactoryRegistry.getAllApis()),this.apiHolder}this.apiFactoryRegistry.register("static",{api:g.hg,deps:{},factory:()=>et.createWithStorage(this.themes)}),this.apiFactoryRegistry.register("static",{api:g.Ds,deps:{},factory:()=>{if(!this.configApi)throw new Error("Tried to access config API before config was loaded");return this.configApi}}),this.apiFactoryRegistry.register("static",{api:g.$4,deps:{},factory:()=>this.appIdentityProxy}),this.apiFactoryRegistry.register("default",{api:g.W0,deps:{},factory:()=>new Ye});for(const n of this.defaultApis)this.apiFactoryRegistry.register("default",n);for(const n of this.plugins)for(const s of n.getApis())if(!this.apiFactoryRegistry.register("default",s))throw new Error(`Plugin ${n.getId()} tried to register duplicate or forbidden API factory for ${s.api}`);for(const n of this.apis)if(!this.apiFactoryRegistry.register("app",n))throw new Error(`Duplicate or forbidden API factory for ${n.api} in app`);return Qe.validateFactories(this.apiFactoryRegistry,this.apiFactoryRegistry.getAllApis()),this.apiHolder=new Qe(this.apiFactoryRegistry),this.apiHolder}verifyPlugins(n){const s=new Set;for(const a of n){const p=a.getId();if(s.has(p))throw new Error(`Duplicate plugin found '${p}'`);s.add(p)}}constructor(n){(0,z._)(this,"apiHolder",void 0),(0,z._)(this,"configApi",void 0),(0,z._)(this,"apis",void 0),(0,z._)(this,"icons",void 0),(0,z._)(this,"plugins",void 0),(0,z._)(this,"featureFlags",void 0),(0,z._)(this,"components",void 0),(0,z._)(this,"themes",void 0),(0,z._)(this,"configLoader",void 0),(0,z._)(this,"defaultApis",void 0),(0,z._)(this,"bindRoutes",void 0),(0,z._)(this,"appIdentityProxy",new Vr),(0,z._)(this,"apiFactoryRegistry",void 0),(0,E._)(this,jr,{writable:!0,value:!1});var s;this.apis=(s=n.apis)!==null&&s!==void 0?s:[],this.icons=n.icons;var a;this.plugins=new Set((a=n.plugins)!==null&&a!==void 0?a:[]);var p;this.featureFlags=(p=n.featureFlags)!==null&&p!==void 0?p:[],this.components=n.components,this.themes=n.themes;var A;this.configLoader=(A=n.configLoader)!==null&&A!==void 0?A:so;var k;this.defaultApis=(k=n.defaultApis)!==null&&k!==void 0?k:[],this.bindRoutes=n.bindRoutes,this.apiFactoryRegistry=new It}}function co(i){return new us(i)}let hr=!1;const Lr=i=>{const n=(0,g.qD)(),{NotFoundErrorPage:s}=n.getComponents(),a=(0,H.useMemo)(()=>bn(),[]),A=[...(0,g.vJ)(i.children,k=>k.getElements().flatMap(M=>{let ae=M.props.path;if(ae==="")return[];var xe;ae=(xe=ae==null?void 0:ae.replace(/\/\*$/,""))!==null&&xe!==void 0?xe:"/";let Ie=a?M:M.props.element;return!a&&!Ie&&(Ie=M,hr||(console.warn("DEPRECATION WARNING: All elements within <FlatRoutes> must be of type <Route> with an element prop. Existing usages of <Navigate key=[path] to=[to] /> should be replaced with <Route path=[path] element={<Navigate to=[to] />} />."),hr=!0)),[{path:ae,element:Ie,children:M.props.children?[{path:ae==="/"?"/":"*",element:M.props.children}]:void 0}]}).sort((M,ae)=>ae.path.localeCompare(M.path)).map(M=>({...M,path:M.path==="/"?"/":`${M.path}/*`}))),{path:"*",element:(0,h.jsx)(s,{})}];return(0,W.V$)(A)},Bo=(0,g.T0)({id:"plugin.permission.api"});var Yn;(function(i){i.DENY="DENY",i.ALLOW="ALLOW",i.CONDITIONAL="CONDITIONAL"})(Yn||(Yn={}));function Gs(i,n){return i.name===n.name}function $o(i,n){return"resourceType"in i?!n||i.resourceType===n:!1}function hs(i){return i.attributes.action==="create"}function ps(i){return i.attributes.action==="read"}function uo(i){return i.attributes.action==="update"}function fs(i){return i.attributes.action==="delete"}function gs(i){return{authorize:async(n,s)=>await i.authorize(n,s),authorizeConditional(n,s){const a=n;return i.authorize(a,s)}}}function sr({name:i,attributes:n,resourceType:s}){return s?{type:"resource",name:i,attributes:n,resourceType:s}:{type:"basic",name:i,attributes:n}}var Do=r(23054),Wn=r(96279),ho=r.n(Wn),Zo=r(9571);const Hr=ut.z.lazy(()=>ut.z.object({rule:ut.z.string(),resourceType:ut.z.string(),params:ut.z.record(ut.z.any()).optional()}).or(ut.z.object({anyOf:ut.z.array(Hr).nonempty()})).or(ut.z.object({allOf:ut.z.array(Hr).nonempty()})).or(ut.z.object({not:Hr}))),No=ut.z.object({result:ut.z.literal(Yn.ALLOW).or(ut.z.literal(Yn.DENY))}),Fo=ut.z.union([ut.z.object({result:ut.z.literal(Yn.ALLOW).or(ut.z.literal(Yn.DENY))}),ut.z.object({result:ut.z.literal(Yn.CONDITIONAL),pluginId:ut.z.string(),resourceType:ut.z.string(),conditions:Hr})]),ms=(i,n)=>ut.z.object({items:ut.z.array(ut.z.intersection(ut.z.object({id:ut.z.string()}),i)).refine(s=>s.length===n.size&&s.every(({id:a})=>n.has(a)),{message:"Items in response do not match request"})});class Uo{async authorize(n,s){return this.makeRequest(n,No,s)}async authorizeConditional(n,s){return this.makeRequest(n,Fo,s)}async makeRequest(n,s,a){if(!this.enabled)return n.map(Ie=>({result:Yn.ALLOW}));const p={items:n.map(Ie=>({id:Zo.Z(),...Ie}))},A=await this.discovery.getBaseUrl("permission"),k=await ho()(`${A}/authorize`,{method:"POST",body:JSON.stringify(p),headers:{...this.getAuthorizationHeader(a==null?void 0:a.token),"content-type":"application/json"}});if(!k.ok)throw await Do.VL.fromResponse(k);const M=await k.json(),xe=ms(s,new Set(p.items.map(({id:Ie})=>Ie))).parse(M).items.reduce((Ie,Ve)=>(Ie[Ve.id]=Ve,Ie),{});return p.items.map(Ie=>xe[Ie.id])}getAuthorizationHeader(n){return n?{Authorization:`Bearer ${n}`}:{}}constructor(n){(0,z._)(this,"enabled",void 0),(0,z._)(this,"discovery",void 0),this.discovery=n.discovery;var s;this.enabled=(s=n.config.getOptionalBoolean("permission.enabled"))!==null&&s!==void 0?s:!1}}class po{static create(n){const{config:s,discovery:a,identity:p}=n,A=new Uo({discovery:a,config:s});return new po(A,p)}async authorize(n){return(await this.permissionClient.authorize([n],await this.identityApi.getCredentials()))[0]}constructor(n,s){(0,z._)(this,"permissionClient",void 0),(0,z._)(this,"identityApi",void 0),this.permissionClient=n,this.identityApi=s}}var x=r(69984);function C(i){const n=(0,g.h_)(Bo),{data:s,error:a}=(0,x.ZP)(i,async p=>{if($o(p.permission)&&!p.resourceRef)return Yn.DENY;const{result:A}=await n.authorize(p);return A});return a?{error:a,loading:!1,allowed:!1}:s===void 0?{loading:!0,allowed:!1}:{loading:!1,allowed:s===Yn.ALLOW}}const R=i=>{const{permission:n,resourceRef:s,errorComponent:a,...p}=i,A=usePermission(isResourcePermission(n)?{permission:n,resourceRef:s}:{permission:n}),k=useApp(),{NotFoundErrorPage:M}=k.getComponents();let ae=a===void 0?_jsx(M,{}):a;return A.loading?ae=null:A.allowed&&(ae=i.element),_jsx(Route,{...p,element:ae})};function N(i){const{permission:n,resourceRef:s}=i,a=usePermission(isResourcePermission(n)?{permission:n,resourceRef:s}:{permission:n}),p=useApp();if(a.loading)return null;if(a.allowed)return _jsx(_Fragment,{children:i.children});if(i.errorPage)return _jsx(_Fragment,{children:i.errorPage});const{NotFoundErrorPage:A}=p.getComponents();return _jsx(A,{})}const re=[(0,g.ni)({api:g.NW,deps:{configApi:g.Ds},factory:({configApi:i})=>Z.compile(`${i.getString("backend.baseUrl")}/api/{{ pluginId }}`)}),(0,g.ni)({api:g.$v,deps:{},factory:()=>new D}),(0,g.ni)({api:g.v_,deps:{},factory:()=>new me}),(0,g.ni)({api:g.VE,deps:{alertApi:g.$v},factory:({alertApi:i})=>{const n=new q(i,new Y);return we.forward(n,{hidden:!1}),n}}),(0,g.ni)({api:g.E6,deps:{errorApi:g.VE},factory:({errorApi:i})=>Lt.create({errorApi:i})}),(0,g.ni)({api:g.gP,deps:{configApi:g.Ds,identityApi:g.$4,discoveryApi:g.NW},factory:({configApi:i,identityApi:n,discoveryApi:s})=>jt({middleware:[Mt.resolvePluginProtocol({discoveryApi:s}),Mt.injectIdentityAuth({identityApi:n,config:i})]})}),(0,g.ni)({api:g.ZM,deps:{},factory:()=>new zt}),(0,g.ni)({api:g.Kp,deps:{discoveryApi:g.NW,oauthRequestApi:g.ZM,configApi:g.Ds},factory:({discoveryApi:i,oauthRequestApi:n,configApi:s})=>Ln.create({configApi:s,discoveryApi:i,oauthRequestApi:n,environment:s.getOptionalString("auth.environment")})}),(0,g.ni)({api:g.p_,deps:{discoveryApi:g.NW,oauthRequestApi:g.ZM,configApi:g.Ds},factory:({discoveryApi:i,oauthRequestApi:n,configApi:s})=>Kt.create({configApi:s,discoveryApi:i,oauthRequestApi:n,environment:s.getOptionalString("auth.environment")})}),(0,g.ni)({api:g.F4,deps:{discoveryApi:g.NW,oauthRequestApi:g.ZM,configApi:g.Ds},factory:({discoveryApi:i,oauthRequestApi:n,configApi:s})=>Yt.create({configApi:s,discoveryApi:i,oauthRequestApi:n,defaultScopes:["read:user"],environment:s.getOptionalString("auth.environment")})}),(0,g.ni)({api:g.D,deps:{discoveryApi:g.NW,oauthRequestApi:g.ZM,configApi:g.Ds},factory:({discoveryApi:i,oauthRequestApi:n,configApi:s})=>Mn.create({configApi:s,discoveryApi:i,oauthRequestApi:n,environment:s.getOptionalString("auth.environment")})}),(0,g.ni)({api:g.ux,deps:{discoveryApi:g.NW,oauthRequestApi:g.ZM,configApi:g.Ds},factory:({discoveryApi:i,oauthRequestApi:n,configApi:s})=>Fn.create({configApi:s,discoveryApi:i,oauthRequestApi:n,environment:s.getOptionalString("auth.environment")})}),(0,g.ni)({api:g.gW,deps:{discoveryApi:g.NW,oauthRequestApi:g.ZM,configApi:g.Ds},factory:({discoveryApi:i,oauthRequestApi:n,configApi:s})=>Tn.create({configApi:s,discoveryApi:i,oauthRequestApi:n,environment:s.getOptionalString("auth.environment")})}),(0,g.ni)({api:g.bq,deps:{discoveryApi:g.NW,oauthRequestApi:g.ZM,configApi:g.Ds},factory:({discoveryApi:i,oauthRequestApi:n,configApi:s})=>ce.create({configApi:s,discoveryApi:i,oauthRequestApi:n,defaultScopes:["team"],environment:s.getOptionalString("auth.environment")})}),(0,g.ni)({api:g.Km,deps:{discoveryApi:g.NW,oauthRequestApi:g.ZM,configApi:g.Ds},factory:({discoveryApi:i,oauthRequestApi:n,configApi:s})=>Me.create({configApi:s,discoveryApi:i,oauthRequestApi:n,defaultScopes:["REPO_READ"]})}),(0,g.ni)({api:g.uB,deps:{discoveryApi:g.NW,oauthRequestApi:g.ZM,configApi:g.Ds},factory:({discoveryApi:i,oauthRequestApi:n,configApi:s})=>se.create({configApi:s,discoveryApi:i,oauthRequestApi:n,environment:s.getOptionalString("auth.environment")})}),(0,g.ni)({api:Bo,deps:{discovery:g.NW,identity:g.$4,config:g.Ds},factory:({config:i,discovery:n,identity:s})=>po.create({config:i,discovery:n,identity:s})})];var de=r(77277),X=r(53974),ye=r(71597);function Ee({children:i}){return(0,W.GV)()?(0,h.jsx)(h.Fragment,{children:i}):(0,h.jsx)(W.VA,{children:i})}const Re=()=>(0,h.jsx)(X.mf,{status:"404",statusMessage:"PAGE NOT FOUND"}),Ze=({step:i,error:n})=>{let s="";return i==="load-config"?s=`The configuration failed to load, someone should have a look at this error: ${n.message}`:i==="load-chunk"&&(s=`Lazy loaded chunk failed to load, try to reload the page: ${n.message}`),(0,h.jsx)(Ee,{children:(0,h.jsx)(X.mf,{status:"501",statusMessage:s})})},Ne=({error:i,resetError:n,plugin:s})=>(0,h.jsx)(X.yu,{title:`Error in ${s==null?void 0:s.getId()}`,defaultExpanded:!0,error:i,children:(0,h.jsx)(de.Z,{variant:"outlined",onClick:n,children:"Retry"})}),rt={Progress:X.Ex,Router:ye.VK,NotFoundErrorPage:Re,BootErrorPage:Ze,ErrorBoundaryFallback:Ne};var qe=r(43642),Ge=r(80079),Be=r(90941),Je=r(32915),At=r(40562),cn=r(21853),qt=r(60744),on=r(66569),nn=r(30254),An=r(13384),Rn=r(15933),Er=r(58838),Nr=r(86737),Gr=r(4989),In=r(44407),Vn=r(18628),Or=r(84219),Mo=r(98685),Fi=r(39781),vs=r(39412);const Ks={brokenImage:Ge.Z,catalog:Vn.Z,scaffolder:Je.Z,techdocs:At.Z,search:cn.Z,chat:qt.Z,dashboard:on.Z,docs:nn.Z,email:An.Z,github:Er.Z,group:Or.Z,help:Nr.Z,"kind:api":Rn.Z,"kind:component":In.Z,"kind:domain":qe.Z,"kind:group":Or.Z,"kind:location":Gr.Z,"kind:system":Be.Z,"kind:user":Mo.Z,"kind:resource":vs.Z,user:Mo.Z,warning:Fi.Z};var ys=r(73689),zo=r(48032);const ir={wave:`url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='1368' height='400' fill='none'%3e%3cmask id='a' width='1368' height='401' x='0' y='0' maskUnits='userSpaceOnUse'%3e%3cpath fill='url(%23paint0_linear)' d='M437 116C223 116 112 0 112 0h1256v400c-82 0-225-21-282-109-112-175-436-175-649-175z'/%3e%3cpath fill='url(%23paint1_linear)' d='M1368 400V282C891-29 788 40 711 161 608 324 121 372 0 361v39h1368z'/%3e%3cpath fill='url(%23paint2_linear)' d='M1368 244v156H0V94c92-24 198-46 375 0l135 41c176 51 195 109 858 109z'/%3e%3cpath fill='url(%23paint3_linear)' d='M1252 400h116c-14-7-35-14-116-16-663-14-837-128-1013-258l-85-61C98 28 46 8 0 0v400h1252z'/%3e%3c/mask%3e%3cg mask='url(%23a)'%3e%3cpath fill='white' d='M-172-98h1671v601H-172z'/%3e%3c/g%3e%3cdefs%3e%3clinearGradient id='paint0_linear' x1='602' x2='1093.5' y1='-960.5' y2='272' gradientUnits='userSpaceOnUse'%3e%3cstop stop-color='white'/%3e%3cstop offset='1' stop-color='white' stop-opacity='0'/%3e%3c/linearGradient%3e%3clinearGradient id='paint1_linear' x1='482' x2='480' y1='1058.5' y2='70.5' gradientUnits='userSpaceOnUse'%3e%3cstop stop-color='white'/%3e%3cstop offset='1' stop-color='white' stop-opacity='0'/%3e%3c/linearGradient%3e%3clinearGradient id='paint2_linear' x1='424' x2='446.1' y1='-587.5' y2='274.6' gradientUnits='userSpaceOnUse'%3e%3cstop stop-color='white'/%3e%3cstop offset='1' stop-color='white' stop-opacity='0'/%3e%3c/linearGradient%3e%3clinearGradient id='paint3_linear' x1='587' x2='349' y1='-1120.5' y2='341' gradientUnits='userSpaceOnUse'%3e%3cstop stop-color='white'/%3e%3cstop offset='1' stop-color='white' stop-opacity='0'/%3e%3c/linearGradient%3e%3c/defs%3e%3c/svg%3e")`,wave2:`url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='1368' height='400' fill='none'%3e%3cmask id='a' width='1764' height='479' x='-229' y='-6' maskUnits='userSpaceOnUse'%3e%3cpath fill='url(%23paint0_linear)' d='M0 400h1350C1321 336 525 33 179-2c-345-34-395 236-408 402H0z'/%3e%3cpath fill='url(%23paint1_linear)' d='M1378 177v223H0V217s219 75 327 52C436 246 717-35 965 45s254 144 413 132z'/%3e%3cpath fill='url(%23paint2_linear)' d='M26 400l-78-16c-170 205-44-6-137-30l-4-1 4 1 137 30c37-45 89-110 159-201 399-514-45 238 1176-50 275-65 354-39 91 267H26z'/%3e%3c/mask%3e%3cg mask='url(%23a)'%3e%3cpath fill='white' d='M0 0h1368v400H0z'/%3e%3c/g%3e%3cdefs%3e%3clinearGradient id='paint0_linear' x1='431' x2='397.3' y1='-599' y2='372.8' gradientUnits='userSpaceOnUse'%3e%3cstop stop-color='white'/%3e%3cstop offset='1' stop-color='white' stop-opacity='0'/%3e%3c/linearGradient%3e%3clinearGradient id='paint1_linear' x1='236.5' x2='446.6' y1='-586' y2='381.5' gradientUnits='userSpaceOnUse'%3e%3cstop stop-color='white'/%3e%3cstop offset='1' stop-color='white' stop-opacity='0'/%3e%3c/linearGradient%3e%3clinearGradient id='paint2_linear' x1='851.8' x2='640.4' y1='-867.2' y2='363.7' gradientUnits='userSpaceOnUse'%3e%3cstop stop-color='white'/%3e%3cstop offset='1' stop-color='white' stop-opacity='0'/%3e%3c/linearGradient%3e%3c/defs%3e%3c/svg%3e")`,round:`url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='1368' height='400' fill='none'%3e%3cmask id='a' width='2269' height='1408' x='-610' y='-509' maskUnits='userSpaceOnUse'%3e%3ccircle cx='1212.8' cy='74.8' r='317.5' fill='url(%23paint0_linear)' transform='rotate(-52 1213 75)'/%3e%3ccircle cx='737.8' cy='445.8' r='317.5' fill='url(%23paint1_linear)' transform='rotate(-116 738 446)'/%3e%3ccircle cx='601.8' cy='52.8' r='418.6' fill='url(%23paint2_linear)' transform='rotate(-117 602 53)'/%3e%3ccircle cx='999.8' cy='364' r='389.1' fill='url(%23paint3_linear)' transform='rotate(31 1000 364)'/%3e%3cellipse cx='-109.2' cy='263.5' fill='url(%23paint4_linear)' rx='429.2' ry='465.8' transform='rotate(-85 -109 264)'/%3e%3c/mask%3e%3cg mask='url(%23a)'%3e%3cpath fill='white' d='M0 0h1368v400H0z'/%3e%3c/g%3e%3cdefs%3e%3clinearGradient id='paint0_linear' x1='1301.2' x2='161.4' y1='-1879.7' y2='-969.6' gradientUnits='userSpaceOnUse'%3e%3cstop stop-color='white'/%3e%3cstop offset='1' stop-color='white' stop-opacity='0'/%3e%3c/linearGradient%3e%3clinearGradient id='paint1_linear' x1='826.2' x2='-313.6' y1='-1508.7' y2='-598.6' gradientUnits='userSpaceOnUse'%3e%3cstop stop-color='white'/%3e%3cstop offset='1' stop-color='white' stop-opacity='0'/%3e%3c/linearGradient%3e%3clinearGradient id='paint2_linear' x1='718.4' x2='-784.3' y1='-2524' y2='-1324.2' gradientUnits='userSpaceOnUse'%3e%3cstop stop-color='white'/%3e%3cstop offset='1' stop-color='white' stop-opacity='0'/%3e%3c/linearGradient%3e%3clinearGradient id='paint3_linear' x1='1108.2' x2='-288.6' y1='-2031.1' y2='-915.9' gradientUnits='userSpaceOnUse'%3e%3cstop stop-color='white'/%3e%3cstop offset='1' stop-color='white' stop-opacity='0'/%3e%3c/linearGradient%3e%3clinearGradient id='paint4_linear' x1='10.4' x2='-1626.5' y1='-2603.8' y2='-1399.5' gradientUnits='userSpaceOnUse'%3e%3cstop stop-color='white'/%3e%3cstop offset='1' stop-color='white' stop-opacity='0'/%3e%3c/linearGradient%3e%3c/defs%3e%3c/svg%3e")`},ar={darkGrey:["#171717","#383838"],marineBlue:["#006D8F","#0049A1"],veryBlue:["#0027AF","#270094"],rubyRed:["#98002B","#8D1134"],toastyOrange:["#BE2200","#A41D00"],purpleSky:["#8912CA","#3E00EA"],eveningSea:["#00FFF2","#035355"],teal:["#005B4B"],pinkSea:["#C8077A","#C2297D"],greens:["#4BB8A5","#187656"]};function Jn(i){const{colors:n,shape:s,options:a}=i,A=`linear-gradient(90deg, ${(n.length===1?[n[0],n[0]]:n).join(", ")})`,k=`${s}, ${A}`;var M;const ae=(M=a==null?void 0:a.fontColor)!==null&&M!==void 0?M:"#FFFFFF";return{colors:n,shape:s,backgroundImage:k,fontColor:ae}}const Wo={home:Jn({colors:ar.teal,shape:ir.wave}),documentation:Jn({colors:ar.pinkSea,shape:ir.wave2}),tool:Jn({colors:ar.purpleSky,shape:ir.round}),service:Jn({colors:ar.marineBlue,shape:ir.wave}),website:Jn({colors:ar.veryBlue,shape:ir.wave}),library:Jn({colors:ar.rubyRed,shape:ir.wave}),other:Jn({colors:ar.darkGrey,shape:ir.wave}),app:Jn({colors:ar.toastyOrange,shape:ir.wave}),apis:Jn({colors:ar.teal,shape:ir.wave2}),card:Jn({colors:ar.greens,shape:ir.wave})},Ys=16,Js='"Helvetica Neue", Helvetica, Roboto, Arial, sans-serif';function Ui(i){const{palette:n,htmlFontSize:s=Ys,fontFamily:a=Js,defaultPageTheme:p,pageTheme:A=Wo}=i;if(!A[p])throw new Error(`${p} is not defined in pageTheme.`);var k;return{palette:n,props:{MuiGrid:{spacing:2},MuiSwitch:{color:"primary"}},typography:{htmlFontSize:s,fontFamily:a,h6:{fontWeight:700,fontSize:20,marginBottom:2},h5:{fontWeight:700,fontSize:24,marginBottom:4},h4:{fontWeight:700,fontSize:28,marginBottom:6},h3:{fontSize:32,fontWeight:700,marginBottom:6},h2:{fontSize:40,fontWeight:700,marginBottom:8},h1:{fontSize:54,fontWeight:700,marginBottom:10}},page:A[p],getPageTheme:({themeId:M})=>(k=A[M])!==null&&k!==void 0?k:A[p]}}function Qs(i){return{MuiCssBaseline:{"@global":{html:{height:"100%",fontFamily:i.typography.fontFamily},body:{height:"100%",fontFamily:i.typography.fontFamily,"overscroll-behavior-y":"none"},a:{color:"inherit",textDecoration:"none"}}},MuiTableRow:{root:{"&:nth-of-type(odd)":{backgroundColor:i.palette.background.default}},hover:{"&:hover":{cursor:"pointer"}},head:{"&:nth-of-type(odd)":{backgroundColor:i.palette.background.paper}}},MuiTableCell:{root:{wordBreak:"break-word",overflow:"hidden",verticalAlign:"middle",lineHeight:"1",margin:0,padding:i.spacing(3,2,3,2.5),borderBottom:0},sizeSmall:{padding:i.spacing(1.5,2,1.5,2.5)},head:{wordBreak:"break-word",overflow:"hidden",fontWeight:"normal",lineHeight:"1"}},MuiTabs:{root:{minHeight:24}},MuiTab:{root:{color:i.palette.link,minHeight:24,textTransform:"initial",letterSpacing:"0.07em","&:hover":{color:(0,zo.darken)(i.palette.link,.3),background:(0,zo.lighten)(i.palette.link,.95)},[i.breakpoints.up("md")]:{minWidth:120,fontSize:i.typography.pxToRem(14),fontWeight:500}},textColorPrimary:{color:i.palette.link}},MuiTableSortLabel:{root:{color:"inherit","&:hover":{color:"inherit"}},active:{fontWeight:"bold"}},MuiListItemText:{dense:{whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"}},MuiButton:{text:{padding:void 0}},MuiChip:{root:{backgroundColor:"#D9D9D9",marginRight:i.spacing(1),marginBottom:i.spacing(1),color:i.palette.grey[900]},outlined:{color:i.palette.text.primary},label:{lineHeight:`${i.spacing(2.5)}px`,fontWeight:i.typography.fontWeightMedium,fontSize:`${i.spacing(1.75)}px`},labelSmall:{fontSize:`${i.spacing(1.5)}px`},deleteIcon:{color:i.palette.grey[500],width:`${i.spacing(3)}px`,height:`${i.spacing(3)}px`,margin:`0 ${i.spacing(.75)}px 0 -${i.spacing(.75)}px`},deleteIconSmall:{width:`${i.spacing(2)}px`,height:`${i.spacing(2)}px`,margin:`0 ${i.spacing(.5)}px 0 -${i.spacing(.5)}px`}},MuiCard:{root:{display:"flex",flexDirection:"column"}},MuiCardHeader:{root:{paddingBottom:0}},MuiCardContent:{root:{flexGrow:1,"&:last-child":{paddingBottom:void 0}}},MuiCardActions:{root:{justifyContent:"flex-end"}}}}function xs(i){const n=Ui(i),s=(0,ys.Z)(n),a=Qs(s);return{...s,overrides:a}}var Vo=r(34505);const Kr=xs({palette:{type:"light",background:{default:"#F8F8F8"},status:{ok:"#1DB954",warning:"#FF9800",error:"#E22134",running:"#1F5493",pending:"#FFED51",aborted:"#757575"},bursts:{fontColor:"#FEFEFE",slackChannelText:"#ddd",backgroundColor:{default:"#7C3699"},gradient:{linear:"linear-gradient(-137deg, #4BB8A5 0%, #187656 100%)"}},primary:{main:"#1F5493"},banner:{info:"#2E77D0",error:"#E22134",text:"#FFFFFF",link:"#000000",closeButtonColor:"#FFFFFF",warning:"#FF9800"},border:"#E6E6E6",textContrast:"#000000",textVerySubtle:"#DDD",textSubtle:"#6E6E6E",highlight:"#FFFBCC",errorBackground:"#FFEBEE",warningBackground:"#F59B23",infoBackground:"#ebf5ff",errorText:"#CA001B",infoText:"#004e8a",warningText:"#000000",linkHover:"#2196F3",link:"#0A6EBE",gold:Vo.Z.A700,navigation:{background:"#171717",indicator:"#9BF0E1",color:"#b5b5b5",selectedColor:"#FFF",navItem:{hoverBackground:"#404040"},submenu:{background:"#404040"}},pinSidebarButton:{icon:"#181818",background:"#BDBDBD"},tabbar:{indicator:"#9BF0E1"}},defaultPageTheme:"home",pageTheme:Wo}),Xs=xs({palette:{type:"dark",background:{default:"#333333"},status:{ok:"#71CF88",warning:"#FFB84D",error:"#F84C55",running:"#3488E3",pending:"#FEF071",aborted:"#9E9E9E"},bursts:{fontColor:"#FEFEFE",slackChannelText:"#ddd",backgroundColor:{default:"#7C3699"},gradient:{linear:"linear-gradient(-137deg, #4BB8A5 0%, #187656 100%)"}},primary:{main:"#9CC9FF",dark:"#82BAFD"},secondary:{main:"#FF88B2"},banner:{info:"#2E77D0",error:"#E22134",text:"#FFFFFF",link:"#000000",closeButtonColor:"#FFFFFF",warning:"#FF9800"},border:"#E6E6E6",textContrast:"#FFFFFF",textVerySubtle:"#727272",textSubtle:"#CCCCCC",highlight:"#FFFBCC",errorBackground:"#FFEBEE",warningBackground:"#F59B23",infoBackground:"#ebf5ff",errorText:"#CA001B",infoText:"#004e8a",warningText:"#000000",linkHover:"#82BAFD",link:"#9CC9FF",gold:Vo.Z.A700,navigation:{background:"#424242",indicator:"#9BF0E1",color:"#b5b5b5",selectedColor:"#FFF",navItem:{hoverBackground:"#404040"},submenu:{background:"#404040"}},pinSidebarButton:{icon:"#404040",background:"#BDBDBD"},tabbar:{indicator:"#9BF0E1"}},defaultPageTheme:"home",pageTheme:Wo});var bs=r(98192),_s=r(15222),Ho=r(41547),Go=r(87561);const ei=[{id:"light",title:"Light Theme",variant:"light",icon:(0,h.jsx)(_s.Z,{}),Provider:({children:i})=>(0,h.jsx)(Ho.Z,{theme:Kr,children:(0,h.jsx)(Go.ZP,{children:i})})},{id:"dark",title:"Dark Theme",variant:"dark",icon:(0,h.jsx)(bs.Z,{}),Provider:({children:i})=>(0,h.jsx)(Ho.Z,{theme:Xs,children:(0,h.jsx)(Go.ZP,{children:i})})}];function Mi(i){var n,s,a,p;return co({...i,apis:(n=i==null?void 0:i.apis)!==null&&n!==void 0?n:[],bindRoutes:i==null?void 0:i.bindRoutes,components:{...rt,...i==null?void 0:i.components},configLoader:i==null?void 0:i.configLoader,defaultApis:re,icons:{...Ks,...i==null?void 0:i.icons},plugins:(s=i==null?void 0:i.plugins)!==null&&s!==void 0?s:[],featureFlags:(a=i==null?void 0:i.featureFlags)!==null&&a!==void 0?a:[],themes:(p=i==null?void 0:i.themes)!==null&&p!==void 0?p:ei})}var fo=r(25271),Ko=r(76635);async function ti({storageApi:i}){const n=i.forBucket("settings"),s=i.forBucket("starredEntities"),a=n.snapshot("starredEntities").value;if(!(0,Ko.isArray)(a))return;var p;const A=new Set((p=s.snapshot("entityRefs").value)!==null&&p!==void 0?p:[]);a.filter(Ko.isString).map(k=>k.split(":")).filter(k=>k.length===4&&k[0]==="entity").map(([k,M,ae,xe])=>(0,fo.eE)({kind:M,namespace:ae,name:xe})).forEach(k=>A.add(k)),await s.set("entityRefs",Array.from(A)),await n.remove("starredEntities")}class nr{async toggleStarred(n){this.starredEntities.has(n)?this.starredEntities.delete(n):this.starredEntities.add(n),await this.settingsStore.set("entityRefs",Array.from(this.starredEntities))}starredEntitie$(){return this.observable}notifyChanges(){for(const n of this.subscribers)n.next(new Set(this.starredEntities))}constructor(n){(0,z._)(this,"settingsStore",void 0),(0,z._)(this,"starredEntities",void 0),(0,z._)(this,"subscribers",new Set),(0,z._)(this,"observable",new(Se())(a=>(a.next(new Set(this.starredEntities)),this.subscribers.add(a),()=>{this.subscribers.delete(a)}))),ti(n).then(),this.settingsStore=n.storageApi.forBucket("starredEntities");var s;this.starredEntities=new Set((s=this.settingsStore.snapshot("entityRefs").value)!==null&&s!==void 0?s:[]),this.settingsStore.observe$("entityRefs").subscribe({next:a=>{var p;this.starredEntities=new Set((p=a.value)!==null&&p!==void 0?p:[]),this.notifyChanges()}})}}var Aa=r(33414),Yr=r(79692),zi=r(12420),Hn=r(43514),Ta=r(19928);function Ra(){const i=useApi(catalogApiRef),{error:n,loading:s,value:a}=useAsync(async()=>await i.getEntityFacets({facets:["kind"]}).then(A=>{var k;return((k=A.facets.kind)===null||k===void 0?void 0:k.map(M=>M.value).sort())||[]}),[i]);return{loading:s,error:n,allKinds:a!=null?a:[]}}function Ia(i,n,s){let a=i;return n&&(a=a.filter(A=>n.some(k=>k.toLocaleLowerCase("en-US")===A.toLocaleLowerCase("en-US")))),s&&!i.some(A=>A.toLocaleLowerCase("en-US")===s.toLocaleLowerCase("en-US"))&&(a=a.concat([s])),a.sort().reduce((A,k)=>(A[k.toLocaleLowerCase("en-US")]=k,A),{})}const Wi=(0,Yr.Z)(i=>(0,zi.Z)({root:{...i.typography.h4}}));function Yo(i){var n;const{initialFilter:s="component",allowedKinds:a}=i,p=Wi(),{allKinds:A}=useAllKinds(),{filters:k,updateFilters:M,queryParameters:{kind:ae}}=useEntityList(),xe=useMemo(()=>[ae].flat()[0],[ae]);var Ie;const[Ve,gt]=useState((Ie=xe!=null?xe:(n=k.kind)===null||n===void 0?void 0:n.value)!==null&&Ie!==void 0?Ie:s);useEffect(()=>{xe&>(xe)},[xe]),useEffect(()=>{var Rt;if(!((Rt=k.kind)===null||Rt===void 0)&&Rt.value){var Wt;gt((Wt=k.kind)===null||Wt===void 0?void 0:Wt.value)}},[k.kind]),useEffect(()=>{M({kind:Ve?new EntityKindFilter(Ve):void 0})},[Ve,M]);const Tt=filterKinds(A,a,Ve);return _jsx(Select,{input:_jsx(InputBase,{}),value:Ve.toLocaleLowerCase("en-US"),onChange:Rt=>gt(Rt.target.value),classes:p,children:Object.keys(Tt).map(Rt=>_jsx(MenuItem,{value:Rt,children:`${pluralize(Tt[Rt])}`},Rt))})}var Pa=r(86359),Ss=r(95544),ni=r(99688),go=r(12231),Fr=r(86136),mo=r(49378),ri=r(85256),Cs=r(80030),vo=r(61837),lr=r(79784),Jo=r(50758),yo=r(31654),ws=r(43054),js=r(65759),Ar=r(49280),oi=r(96641);function Es(i){const{entity:n,loading:s,error:a}=(0,oi.ce)(),{allowed:p,loading:A,error:k}=C({permission:i,resourceRef:n?(0,fo.eE)(n):void 0});return s||A?{loading:!0,allowed:!1}:a?{loading:!1,allowed:!1,error:a}:{loading:!1,allowed:p,error:k}}const Qo="catalog-entity",Vi=sr({name:"catalog.entity.read",attributes:{action:"read"},resourceType:Qo}),cr=sr({name:"catalog.entity.create",attributes:{action:"create"}}),Xo=sr({name:"catalog.entity.delete",attributes:{action:"delete"},resourceType:Qo}),si=sr({name:"catalog.entity.refresh",attributes:{action:"update"},resourceType:Qo}),ii=sr({name:"catalog.location.read",attributes:{action:"read"}}),ai=sr({name:"catalog.location.create",attributes:{action:"create"}}),li=sr({name:"catalog.location.delete",attributes:{action:"delete"}}),qo=[Vi,cr,Xo,si,ii,ai,li];var As=r(49166);function Ts(i){const{unregisterEntityOptions:n,isUnregisterAllowed:s,onUnregisterEntity:a,onClose:p}=i,A=typeof(n==null?void 0:n.disableUnregister)=="boolean";var k;const M=(k=!s||(A?!!(n!=null&&n.disableUnregister):(n==null?void 0:n.disableUnregister)==="disable"))!==null&&k!==void 0?k:!1;let ae=(0,h.jsx)(h.Fragment,{});return(n==null?void 0:n.disableUnregister)!=="hidden"&&(ae=(0,h.jsxs)(go.Z,{onClick:()=>{p(),a()},disabled:M,children:[(0,h.jsx)(Fr.Z,{children:(0,h.jsx)(As.Z,{fontSize:"small"})}),(0,h.jsx)(mo.Z,{primary:"Unregister entity"})]})),(0,h.jsx)(h.Fragment,{children:ae})}const Rs=(0,Yr.Z)(i=>({button:{color:i.page.fontColor}}),{name:"PluginCatalogEntityContextMenu"});function Is(i){const{UNSTABLE_extraContextMenuItems:n,UNSTABLE_contextMenuOptions:s,onUnregisterEntity:a,onInspectEntity:p}=i,[A,k]=(0,H.useState)(),M=Rs(),xe=Es(Xo).allowed,Ie=Wt=>{k(Wt.currentTarget)},Ve=()=>{k(void 0)},gt=(0,g.h_)(g.$v),Tt=(0,H.useCallback)(()=>{window.navigator.clipboard.writeText(window.location.toString()).then(()=>gt.post({message:"Copied!",severity:"info",display:"transient"}))},[gt]),Rt=n&&[...n.map(Wt=>(0,h.jsxs)(go.Z,{onClick:()=>{Ve(),Wt.onClick()},children:[(0,h.jsx)(Fr.Z,{children:(0,h.jsx)(Wt.Icon,{fontSize:"small"})}),(0,h.jsx)(mo.Z,{primary:Wt.title})]},Wt.title)),(0,h.jsx)(ri.Z,{},"the divider is here!")];return(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(Cs.ZP,{title:"More",arrow:!0,children:(0,h.jsx)(vo.Z,{"aria-label":"more","aria-controls":"long-menu","aria-haspopup":"true","aria-expanded":!!A,role:"button",onClick:Ie,"data-testid":"menu-button",className:M.button,id:"long-menu",children:(0,h.jsx)(ws.Z,{})})}),(0,h.jsx)(lr.ZP,{open:Boolean(A),onClose:Ve,anchorEl:A,anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"},"aria-labelledby":"long-menu",children:(0,h.jsxs)(Jo.Z,{children:[Rt,(0,h.jsx)(Ts,{unregisterEntityOptions:s,isUnregisterAllowed:xe,onUnregisterEntity:a,onClose:Ve}),(0,h.jsxs)(go.Z,{onClick:()=>{Ve(),p()},children:[(0,h.jsx)(Fr.Z,{children:(0,h.jsx)(yo.Z,{fontSize:"small"})}),(0,h.jsx)(mo.Z,{primary:"Inspect entity"})]}),(0,h.jsxs)(go.Z,{onClick:()=>{Ve(),Tt()},children:[(0,h.jsx)(Fr.Z,{children:(0,h.jsx)(js.Z,{fontSize:"small"})}),(0,h.jsx)(mo.Z,{primary:"Copy entity URL"})]})]})})]})}const xo="plugin.catalog.entityLayoutRoute",_o=()=>null;(0,g.R5)(_o,xo,!0),(0,g.R5)(_o,"core.gatherMountPoints",!0);function Ps(i){const{entity:n,title:s}=i;return(0,h.jsxs)(Ss.Z,{display:"inline-flex",alignItems:"center",height:"1em",maxWidth:"100%",children:[(0,h.jsx)(Ss.Z,{component:"span",textOverflow:"ellipsis",whiteSpace:"nowrap",overflow:"hidden",children:s}),n&&(0,h.jsx)(Hn.LH,{entity:n})]})}function Ls(i,n,s,a){var p;const A=(p=i!=null?i:a==null?void 0:a.kind)!==null&&p!==void 0?p:"";var k;const M=(k=n!=null?n:a==null?void 0:a.metadata.namespace)!==null&&k!==void 0?k:"";var ae,xe,Ie;return{headerTitle:`${(Ie=(xe=(ae=a==null?void 0:a.metadata.title)!==null&&ae!==void 0?ae:s)!==null&&xe!==void 0?xe:a==null?void 0:a.metadata.name)!==null&&Ie!==void 0?Ie:""}${M&&M!==fo.zG?` in ${M}`:""}`,headerType:(()=>{let gt=A.toLocaleLowerCase("en-US");return a&&a.spec&&"type"in a.spec&&(gt+=" \u2014 ",gt+=a.spec.type.toLocaleLowerCase("en-US")),gt})()}}function Os(i){var n;const{entity:s}=i,a=(0,Hn.hF)(s,fo.S4);return(0,h.jsxs)(h.Fragment,{children:[a.length>0&&(0,h.jsx)(X.i9,{label:"Owner",value:(0,h.jsx)(Hn.rI,{entityRefs:a,defaultKind:"Group",color:"inherit"})}),((n=s.spec)===null||n===void 0?void 0:n.lifecycle)&&(0,h.jsx)(X.i9,{label:"Lifecycle",value:s.spec.lifecycle})]})}const ci=i=>{var n,s;const{UNSTABLE_extraContextMenuItems:a,UNSTABLE_contextMenuOptions:p,children:A,NotFoundComponent:k}=i,{kind:M,namespace:ae,name:xe}=(0,g.Oi)(Hn.wi),{entity:Ie,loading:Ve,error:gt}=(0,Hn.ce)(),Tt=(0,W.TH)(),Rt=(0,g.vJ)(A,Oi=>Oi.selectByComponentData({key:xo,withStrictError:"Child of EntityLayout must be an EntityLayout.Route"}).getElements().flatMap(({props:Ur})=>{if(Ie){if(Ur.if&&!Ur.if(Ie))return[]}else return[];return[{path:Ur.path,title:Ur.title,children:Ur.children,tabProps:Ur.tabProps}]}),[Ie]),{headerTitle:Wt,headerType:Gt}=Ls(M,ae,xe,Ie),[$n,Xn]=(0,H.useState)(!1),[fr,Co]=(0,H.useState)(!1),Pi=(0,W.s0)(),Li=async()=>{Xn(!1),Co(!1),Pi("/")};(0,H.useEffect)(()=>{Xn(!1),Co(!1)},[Tt.pathname]);var ss;return(0,h.jsxs)(X.T3,{themeId:(ss=Ie==null||(n=Ie.spec)===null||n===void 0||(s=n.type)===null||s===void 0?void 0:s.toString())!==null&&ss!==void 0?ss:"home",children:[(0,h.jsx)(X.h4,{title:(0,h.jsx)(Ps,{title:Wt,entity:Ie}),pageTitleOverride:Wt,type:Gt,children:Ie&&(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(Os,{entity:Ie}),(0,h.jsx)(Is,{UNSTABLE_extraContextMenuItems:a,UNSTABLE_contextMenuOptions:p,onUnregisterEntity:()=>Xn(!0),onInspectEntity:()=>Co(!0)})]})}),Ve&&(0,h.jsx)(X.Ex,{}),Ie&&(0,h.jsx)(X.tn,{routes:Rt}),gt&&(0,h.jsx)(X.VY,{children:(0,h.jsx)(ni.Z,{severity:"error",children:gt.toString()})}),!Ve&&!gt&&!Ie&&(0,h.jsx)(X.VY,{children:k||(0,h.jsxs)(X.GB,{title:"Entity not found",children:["There is no ",M," with the requested"," ",(0,h.jsx)(X.rU,{to:"https://backstage.io/docs/features/software-catalog/references",children:"kind, namespace, and name"}),"."]})}),(0,h.jsx)(Hn.pp,{open:$n,entity:Ie,onConfirm:Li,onClose:()=>Xn(!1)}),(0,h.jsx)(Hn.U_,{open:fr,entity:Ie,onClose:()=>Co(!1)})]})};ci.Route=_o;function es(i){const{open:n,onClose:s,onConfirm:a,entity:p}=i,[A,k]=useState(!1),M=useApi(catalogApiRef),ae=useApi(alertApiRef),xe=async()=>{k(!0);try{const Ie=p.metadata.uid;await M.removeEntityByUid(Ie),a()}catch(Ie){assertError(Ie),ae.post({message:Ie.message})}finally{k(!1)}};return _jsxs(Dialog,{open:n,onClose:s,children:[_jsx(DialogTitle,{id:"responsive-dialog-title",children:"Are you sure you want to delete this entity?"}),_jsxs(DialogActions,{children:[_jsx(Button,{variant:"contained",color:"secondary",disabled:A,onClick:xe,children:"Delete"}),_jsx(Button,{onClick:s,color:"primary",children:"Cancel"})]})]})}var bo=r(19625);function Hi(i){var n,s;return(i==null||(n=i.metadata)===null||n===void 0||(s=n.annotations)===null||s===void 0?void 0:s["backstage.io/orphan"])==="true"}function di(){const i=useNavigate(),n=useRouteRef(rootRouteRef),[s,a]=useState(!1),{entity:p}=useEntity(),A=async()=>{a(!1),i(n())};return _jsxs(_Fragment,{children:[_jsx(Alert,{severity:"warning",onClick:()=>a(!0),children:"This entity is not referenced by any location and is therefore not receiving updates. Click here to delete."}),_jsx(DeleteEntityDialog,{open:s,entity:p,onConfirm:A,onClose:()=>a(!1)})]})}var ks=r(4791);const ui=i=>i.error&&i.level==="error"&&i.type===ENTITY_STATUS_CATALOG_PROCESSING_TYPE;async function Bs(i,n){return{items:(await n.getEntityAncestors({entityRef:i})).items.map(p=>{var A,k;return{errors:((k=(A=p.entity.status)===null||A===void 0?void 0:A.items)!==null&&k!==void 0?k:[]).filter(ui).map(xe=>xe.error).filter(xe=>Boolean(xe)),entity:p.entity}}).filter(p=>p.errors.length>0)}}async function Gi(i,n){const s=n.apis.get(catalogApiRef);if(!s)throw new Error(`No implementation available for ${catalogApiRef}`);return(await Bs(stringifyEntityRef(i),s)).items.length>0}function hi(){const{entity:i}=useEntity(),n=stringifyEntityRef(i),s=useApi(catalogApiRef),{loading:a,error:p,value:A}=useAsync(async()=>Bs(n,s),[n,s]);return p?_jsx(Box,{mb:1,children:_jsx(ResponseErrorPanel,{error:p})}):a||!A?null:_jsx(_Fragment,{children:A.items.map((k,M)=>_jsxs(Box,{mb:1,children:[stringifyEntityRef(i)!==stringifyEntityRef(k.entity)&&_jsxs(Box,{p:1,children:["The error below originates from"," ",_jsx(EntityRefLink,{entityRef:k.entity})]}),k.errors.map((ae,xe)=>_jsx(ResponseErrorPanel,{error:ae},xe))]},M))})}const $s="core.backstage.entitySwitch",Jr=i=>null;(0,g.R5)(Jr,$s,!0);const Ds=i=>{var n;const{entity:s,loading:a}=(0,Hn.ce)(),p=(0,g.I_)(),A=(0,g.vJ)(i.children,ae=>ae.selectByComponentData({key:$s,withStrictError:"Child of EntitySwitch is not an EntitySwitch.Case"}).getElements().flatMap(xe=>{if(a)return[];const{if:Ie,children:Ve}=xe.props;return s?[{if:Ie==null?void 0:Ie(s,{apis:p}),children:Ve}]:[{if:Ie===void 0,children:Ve}]}),[p,s,a]);if(A.some(ae=>typeof ae.if=="object"&&"then"in ae.if))return(0,h.jsx)(pi,{results:A,renderMultipleMatches:i.renderMultipleMatches});if(i.renderMultipleMatches==="all"){const ae=A.filter(xe=>xe.if).map(xe=>xe.children);return ae.length===0?Qr(A):(0,h.jsx)(h.Fragment,{children:ae})}var M;return(M=(n=A.find(ae=>ae.if))===null||n===void 0?void 0:n.children)!==null&&M!==void 0?M:Qr(A)};function pi({results:i,renderMultipleMatches:n}){const{loading:s,value:a}=(0,be.default)(async()=>{const p=i.map(async({if:k,children:M})=>{try{if(await k)return M}catch{}return null});if(n==="all"){const k=(await Promise.all(p)).filter(Boolean);return k.length===0?Qr(i):(0,h.jsx)(h.Fragment,{children:k})}var A;return(A=(await Promise.all(p)).find(Boolean))!==null&&A!==void 0?A:Qr(i)},[i]);return s||!a?null:a}function Qr(i){var n,s;return(s=(n=i.filter(a=>a.if===void 0)[0])===null||n===void 0?void 0:n.children)!==null&&s!==void 0?s:null}Ds.Case=Jr;const Ki=null,fi=Hn._i.Filters,gi=Hn._i.Content;var Qn=r(85877),mi=r(15096);const Bn=(0,g.rx)({id:"catalog",apis:[(0,g.ni)({api:Hn.Ah,deps:{discoveryApi:g.NW,fetchApi:g.gP},factory:({discoveryApi:i,fetchApi:n})=>new ks.MS({discoveryApi:i,fetchApi:n})}),(0,g.ni)({api:Hn.p3,deps:{storageApi:g.E6},factory:({storageApi:i})=>new nr({storageApi:i})})],routes:{catalogIndex:bo._Z,catalogEntity:Hn.wi},externalRoutes:{createComponent:bo.yw,viewTechDoc:bo.jU},__experimentalConfigure(i){return{...{createButtonTitle:"Create"},...i}}}),Yi=Bn.provide((0,g.P4)({name:"CatalogIndexPage",component:()=>r.e(9323).then(r.bind(r,89323)).then(i=>i.CatalogPage),mountPoint:bo._Z})),Zs=Bn.provide((0,g.P4)({name:"CatalogEntityPage",component:()=>r.e(8951).then(r.bind(r,78951)).then(i=>i.CatalogEntityPage),mountPoint:Hn.wi})),Ji=Bn.provide((0,g.CO)({name:"EntityAboutCard",component:{lazy:()=>Promise.resolve().then(r.bind(r,33414)).then(i=>i.AboutCard)}})),La=Bn.provide((0,g.CO)({name:"EntityLinksCard",component:{lazy:()=>r.e(7750).then(r.bind(r,17750)).then(i=>i.EntityLinksCard)}})),Ns=Bn.provide((0,g.CO)({name:"EntityLabelsCard",component:{lazy:()=>Promise.resolve().then(r.bind(r,85877)).then(i=>i.EntityLabelsCard)}})),Qi=Bn.provide((0,g.CO)({name:"EntityHasSystemsCard",component:{lazy:()=>r.e(5458).then(r.bind(r,5458)).then(i=>i.HasSystemsCard)}})),Xi=Bn.provide((0,g.CO)({name:"EntityHasComponentsCard",component:{lazy:()=>r.e(1105).then(r.bind(r,1105)).then(i=>i.HasComponentsCard)}})),qi=Bn.provide((0,g.CO)({name:"EntityHasSubcomponentsCard",component:{lazy:()=>r.e(2440).then(r.bind(r,82440)).then(i=>i.HasSubcomponentsCard)}})),ts=Bn.provide((0,g.CO)({name:"EntityHasResourcesCard",component:{lazy:()=>r.e(9770).then(r.bind(r,79770)).then(i=>i.HasResourcesCard)}})),_i=Bn.provide((0,g.CO)({name:"EntityDependsOnComponentsCard",component:{lazy:()=>r.e(9545).then(r.bind(r,19545)).then(i=>i.DependsOnComponentsCard)}})),ea=Bn.provide((0,g.CO)({name:"EntityDependencyOfComponentsCard",component:{lazy:()=>r.e(184).then(r.bind(r,40184)).then(i=>i.DependencyOfComponentsCard)}})),vi=Bn.provide((0,g.CO)({name:"EntityDependsOnResourcesCard",component:{lazy:()=>r.e(1032).then(r.bind(r,81032)).then(i=>i.DependsOnResourcesCard)}})),ta=Bn.provide((0,g.CO)({name:"RelatedEntitiesCard",component:{lazy:()=>r.e(732).then(r.bind(r,732)).then(i=>i.RelatedEntitiesCard)}})),Oa=Bn.provide((0,mi.E5)({name:"CatalogSearchResultListItem",component:()=>r.e(7670).then(r.bind(r,27670)).then(i=>i.CatalogSearchResultListItem),predicate:i=>i.type==="software-catalog"}));var yi=r(32838);class xi{async getApiOrigin(){return await this.discoveryApi.getBaseUrl("techdocs")}async getStorageUrl(){return`${await this.discoveryApi.getBaseUrl("techdocs")}/static/docs`}async getBuilder(){return this.configApi.getString("techdocs.builder")}async getEntityDocs(n,s){const p=`${await this.getApiOrigin()}/${s}`,A=await fetch(`${p.endsWith("/")?p:`${p}/`}index.html`);if(A.status===404)throw new Error("Page not found");return A.text()}async syncEntityDocs(n){return"cached"}async getBaseUrl(n,s,a){const p=await this.getApiOrigin();return new URL(n,`${p}/${a}`).toString()}constructor({configApi:n,discoveryApi:s,identityApi:a}){(0,z._)(this,"configApi",void 0),(0,z._)(this,"discoveryApi",void 0),(0,z._)(this,"identityApi",void 0),this.configApi=n,this.discoveryApi=s,this.identityApi=a}}class na{async getApiOrigin(){return await this.discoveryApi.getBaseUrl("techdocs")}async getEntityMetadata(n){return{apiVersion:"backstage.io/v1alpha1",kind:"Component",metadata:{name:"local"},spec:{owner:"test",lifecycle:"experimental"}}}async getTechDocsMetadata(n){return{site_name:"Live preview environment",site_description:""}}constructor({configApi:n,discoveryApi:s,identityApi:a}){(0,z._)(this,"configApi",void 0),(0,z._)(this,"discoveryApi",void 0),(0,z._)(this,"identityApi",void 0),this.configApi=n,this.discoveryApi=s,this.identityApi=a}}const ra=[(0,g.ni)({api:oe.Dl,deps:{configApi:g.Ds,discoveryApi:g.NW,identityApi:g.$4},factory:({configApi:i,discoveryApi:n,identityApi:s})=>new xi({configApi:i,discoveryApi:n,identityApi:s})}),(0,g.ni)({api:oe.gT,deps:{configApi:g.Ds,discoveryApi:g.NW,identityApi:g.$4},factory:({configApi:i,discoveryApi:n,identityApi:s})=>new na({configApi:i,discoveryApi:n,identityApi:s})}),(0,g.ni)({api:yi.q3,deps:{configApi:g.Ds},factory:({configApi:i})=>yi.ae.fromConfig(i)})],ns={backend:{baseUrl:"http://localhost:3000"},techdocs:{builder:"external"}},rs={backend:{baseUrl:"http://localhost:7007"},techdocs:{builder:"external"}};async function bi(){const i=await fetch("/.detect");return i.ok?(await i.text()).trim()==="techdocs-cli-server":!1}async function So(){const i=await so(),n=await bi();return[...i,{context:"detected",data:n?ns:rs}]}var Si=r(58845);const os=(0,Yr.Z)({svg:{width:"auto",height:30},path:{fill:"#7df3e1"}});var Ci=()=>{const i=os();return(0,h.jsx)("svg",{className:i.svg,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 2079.95 456.05",children:(0,h.jsx)("path",{className:i.path,d:"M302.9,180a80.62,80.62,0,0,0,13.44-10.37c.8-.77,1.55-1.54,2.31-2.31a81.89,81.89,0,0,0,7.92-9.37,62.37,62.37,0,0,0,6.27-10.77,48.6,48.6,0,0,0,4.36-16.4c1.49-19.39-10-38.67-35.62-54.22L198.42,14,78.16,129.22l-78.29,75,108.6,65.9a111.6,111.6,0,0,0,57.76,16.42c24.92,0,48.8-8.8,66.42-25.69,19.16-18.36,25.52-42.12,13.7-61.87a49.69,49.69,0,0,0-6.8-8.87,89.78,89.78,0,0,0,19.28,2.15H259a85.09,85.09,0,0,0,31-5.79A80.88,80.88,0,0,0,302.9,180Zm-100.59,59.8c-19.32,18.51-50.4,21.24-75.7,5.9l-75.13-45.6,67.44-64.65,76.42,46.39C222.88,198.57,221.36,221.6,202.31,239.84Zm8.94-82.21L140.6,114.74,205,53l69.37,42.11c25.94,15.73,29.31,37.05,10.55,55A60.71,60.71,0,0,1,211.25,157.63Zm29.86,190c-19.57,18.75-46.17,29.08-74.88,29.08a123.84,123.84,0,0,1-64.11-18.19L-.13,296.51v24.67l108.6,65.91a111.6,111.6,0,0,0,57.76,16.42c24.92,0,48.8-8.81,66.42-25.69,12.88-12.34,20-27.13,19.68-41.49v-1.79A87.85,87.85,0,0,1,241.11,347.67Zm0-39c-19.57,18.76-46.17,29.09-74.88,29.09a123.84,123.84,0,0,1-64.11-18.19L-.13,257.52V282.2l108.6,65.91a111.59,111.59,0,0,0,57.76,16.41c24.92,0,48.8-8.8,66.42-25.68,12.88-12.35,20-27.13,19.68-41.5v-1.79A86.86,86.86,0,0,1,241.11,308.68Zm0-39c-19.57,18.76-46.17,29.09-74.88,29.09a123.84,123.84,0,0,1-64.11-18.19L-.13,218.54v24.68l108.6,65.91a111.59,111.59,0,0,0,57.76,16.41c24.92,0,48.8-8.8,66.42-25.69,12.88-12.34,20-27.12,19.68-41.49v-1.82A87.14,87.14,0,0,1,241.11,269.7Zm83.69,25.74a94.16,94.16,0,0,1-60.19,25.86h0V348a81.6,81.6,0,0,0,51.73-22.37c14-13.38,21.15-28.11,21-42.64v-2.2A95.14,95.14,0,0,1,324.8,295.44Zm-83.69,91.21c-19.57,18.75-46.17,29.09-74.88,29.09a123.76,123.76,0,0,1-64.11-18.2L-.13,335.49v24.67l108.6,65.91a111.6,111.6,0,0,0,57.76,16.42c24.92,0,48.8-8.81,66.42-25.69,12.88-12.34,20-27.13,19.68-41.49v-1.79A87.35,87.35,0,0,1,241.11,386.65Zm85.75-210.21c-.68.69-1.35,1.38-2.06,2.05a99.19,99.19,0,0,1-22.23,15.69,94.53,94.53,0,0,1-26.24,8.71,97.84,97.84,0,0,1-14.16,1.57c.5,1.61.9,3.25,1.25,4.9a52.7,52.7,0,0,1,1.13,12V231h.05A84.48,84.48,0,0,0,290,225.47a80.83,80.83,0,0,0,26.38-16.82c.81-.77,1.51-1.56,2.27-2.34a82,82,0,0,0,7.92-9.38,62.85,62.85,0,0,0,6.29-10.78,48.5,48.5,0,0,0,4.32-16.44c.09-1.23.2-2.47.19-3.7v-2c-.72,1-1.48,2.06-2.26,3.09A98,98,0,0,1,326.86,176.44Zm0,77.92c-.68.7-1.3,1.41-2,2.1a94.09,94.09,0,0,1-60.19,25.85h0V309h0a81.65,81.65,0,0,0,51.73-22.37,73.51,73.51,0,0,0,16.48-22.49,48.56,48.56,0,0,0,4.32-16.44c.09-1.24.2-2.48.19-3.71v-2.2c-.74,1.08-1.47,2.16-2.27,3.22A95.81,95.81,0,0,1,326.82,254.36Zm0-39c-.68.7-1.3,1.41-2,2.1a92.22,92.22,0,0,1-10.62,8.65,93.53,93.53,0,0,1-11.63,7,95.63,95.63,0,0,1-37.94,10.18h-.05l0,26.67h0a81.63,81.63,0,0,0,51.73-22.37c.81-.77,1.51-1.56,2.27-2.34a82,82,0,0,0,7.92-9.38,63.16,63.16,0,0,0,6.29-10.77,48.55,48.55,0,0,0,4.32-16.45c.09-1.23.2-2.47.19-3.7v-2.2c-.74,1.08-1.47,2.16-2.27,3.22A98.19,98.19,0,0,1,326.82,215.38Zm241-88.84q7.94,0,17.09.17t18.12,1a139.3,139.3,0,0,1,16.74,2.57,42.78,42.78,0,0,1,13.3,5.14,64.27,64.27,0,0,1,20.54,19.89Q662,168,662,186.54q0,19.54-9.49,33.78t-27.1,21.09v.68q22.78,4.82,34.87,20.58t12.08,38.4a72.62,72.62,0,0,1-4.83,26.06,65.29,65.29,0,0,1-14.33,22.46,71.57,71.57,0,0,1-23.47,15.78q-14,6-32.28,6H478.38V126.54Zm9,105.27q28,0,40.21-9.78t12.26-29.31q0-13-4.14-20.58a29.47,29.47,0,0,0-11.4-11.66A45,45,0,0,0,597,155.17a161.2,161.2,0,0,0-20.19-1.2h-65.6v77.84Zm16.57,112.13q21.74,0,34-11.66T639.59,300q0-12-4.48-19.88a34.85,34.85,0,0,0-11.91-12.52,50.14,50.14,0,0,0-17.09-6.52,105,105,0,0,0-20-1.88H511.17v84.7Zm274.79,26.74q-7.61,4.45-21.06,4.46-11.4,0-18.12-6.34t-6.74-20.75a70.17,70.17,0,0,1-28.13,20.75,97.87,97.87,0,0,1-57.65,3.6,53.51,53.51,0,0,1-18.82-8.58A41.19,41.19,0,0,1,705,348.56q-4.65-9.42-4.66-22.8,0-15.09,5.18-24.69a44.92,44.92,0,0,1,13.64-15.6,62.63,62.63,0,0,1,19.33-9.09q10.88-3.08,22.27-5.14,12.08-2.4,23-3.6a128,128,0,0,0,19.16-3.43c5.53-1.48,9.89-3.65,13.12-6.51s4.83-7,4.83-12.52q0-9.6-3.62-15.43a24.94,24.94,0,0,0-9.32-8.92,38.38,38.38,0,0,0-12.78-4.11,96.54,96.54,0,0,0-14-1q-18.63,0-31.07,7T736.6,249.29H707.26q.69-16.46,6.9-27.77a52.21,52.21,0,0,1,16.57-18.35,70,70,0,0,1,23.65-10.11A125.51,125.51,0,0,1,782.86,190a168.63,168.63,0,0,1,24,1.72,63.26,63.26,0,0,1,21.58,7A41.23,41.23,0,0,1,844,213.59q5.87,9.57,5.87,25v91q0,10.26,1.21,15.05t8.11,4.79a35.57,35.57,0,0,0,9-1.37Zm-47.64-90.87c-3.69,2.74-8.52,4.72-14.5,6s-12.26,2.27-18.82,3.07-13.17,1.71-19.85,2.73a73.7,73.7,0,0,0-18,4.94,32.62,32.62,0,0,0-12.94,9.73q-5,6.32-5,17.23a23.31,23.31,0,0,0,2.94,12.11,24.11,24.11,0,0,0,7.59,8,32,32,0,0,0,10.88,4.44,60.94,60.94,0,0,0,13.11,1.36q14.5,0,24.86-3.92a52.49,52.49,0,0,0,16.91-9.9,39.1,39.1,0,0,0,9.67-13,32.53,32.53,0,0,0,3.11-13.14ZM1002.07,225q-11.05-9.25-29.69-9.26-15.89,0-26.58,5.83A47.29,47.29,0,0,0,928.71,237a64.66,64.66,0,0,0-9.15,22.12A119.83,119.83,0,0,0,916.8,285a98.22,98.22,0,0,0,2.93,24,64.18,64.18,0,0,0,9.15,20.74,46.2,46.2,0,0,0,16.23,14.58q10,5.49,23.82,5.48,21.75,0,34-11.31t15-31.89h30q-4.83,32.91-24.68,50.75t-54,17.83q-20.37,0-36.07-6.52A69.86,69.86,0,0,1,907,350.11a79.92,79.92,0,0,1-15.88-28.63A118.64,118.64,0,0,1,885.73,285a129.41,129.41,0,0,1,5.18-37.21,85.63,85.63,0,0,1,15.71-30.17A73.46,73.46,0,0,1,933,197.35Q948.91,190,970,190a108.54,108.54,0,0,1,28.48,3.6,69.59,69.59,0,0,1,23.48,11.15,61,61,0,0,1,16.74,19q6.55,11.49,8.29,27.26h-30.38Q1013.11,234.21,1002.07,225Zm109.77-98.41v145l81.47-77.49h39.36l-70.77,64.46,75.95,112.82h-37.29l-61.1-92.59-27.62,25.38v67.21H1082.5V126.54Zm170.54,205.22a31.07,31.07,0,0,0,10.87,10.63,49,49,0,0,0,15.19,5.66,87.06,87.06,0,0,0,17.44,1.71,109.18,109.18,0,0,0,14.5-1,53.22,53.22,0,0,0,14-3.78,26.27,26.27,0,0,0,10.53-8q4.14-5.32,4.14-13.55,0-11.31-8.63-17.14a73.69,73.69,0,0,0-21.58-9.43q-12.94-3.6-28.13-6.52a146,146,0,0,1-28.14-8.23A58.16,58.16,0,0,1,1261,267.13q-8.64-9.6-8.63-26.75,0-13.38,6-23a49.26,49.26,0,0,1,15.53-15.61,71.76,71.76,0,0,1,21.4-8.91A99.41,99.41,0,0,1,1319,190a141.31,141.31,0,0,1,28,2.58,64.85,64.85,0,0,1,22.62,8.91,46.16,46.16,0,0,1,15.7,17.15q5.87,10.8,6.91,26.91h-29.35q-.69-8.57-4.48-14.23a29.36,29.36,0,0,0-9.67-9.08,44.16,44.16,0,0,0-12.94-5,67.68,67.68,0,0,0-14.33-1.54,87.29,87.29,0,0,0-13.29,1,45.28,45.28,0,0,0-12.26,3.6,24.49,24.49,0,0,0-9,6.86q-3.46,4.29-3.46,11.14a16.32,16.32,0,0,0,5.36,12.52,42.75,42.75,0,0,0,13.63,8.23,120,120,0,0,0,18.64,5.48q10.37,2.24,20.72,4.63,11,2.4,21.57,5.83A70.74,70.74,0,0,1,1382,284.1a44.55,44.55,0,0,1,13.12,14.23q5,8.58,5,21.26,0,16.13-6.73,26.75a52.5,52.5,0,0,1-17.61,17.14,73.89,73.89,0,0,1-24.51,9.09,146.3,146.3,0,0,1-27.1,2.57,126.24,126.24,0,0,1-28.31-3.09A69.56,69.56,0,0,1,1272,361.94a51.74,51.74,0,0,1-16.57-18.52q-6.21-11.49-6.9-27.95h29.34A32.65,32.65,0,0,0,1282.38,331.76Zm226.46-137.67v25.72h-35.56V329.88a31.37,31.37,0,0,0,.87,8.23,8.42,8.42,0,0,0,3.28,4.8,14.61,14.61,0,0,0,6.73,2.23,99.19,99.19,0,0,0,11.22.51h13.46v25.72H1486.4a105.8,105.8,0,0,1-19.5-1.55,28.65,28.65,0,0,1-13.12-5.65,24.09,24.09,0,0,1-7.42-11.66q-2.43-7.54-2.42-19.89V219.81h-30.38V194.09h30.38V140.94h29.34v53.15ZM1699.4,370.68q-7.61,4.45-21.06,4.46-11.4,0-18.12-6.34t-6.74-20.75a70.17,70.17,0,0,1-28.13,20.75,97.87,97.87,0,0,1-57.65,3.6,53.51,53.51,0,0,1-18.82-8.58,41.19,41.19,0,0,1-12.6-15.26q-4.65-9.42-4.66-22.8,0-15.09,5.18-24.69a44.92,44.92,0,0,1,13.64-15.6,62.63,62.63,0,0,1,19.33-9.09q10.88-3.08,22.27-5.14,12.07-2.4,23-3.6a128,128,0,0,0,19.16-3.43c5.53-1.48,9.89-3.65,13.12-6.51s4.83-7,4.83-12.52q0-9.6-3.62-15.43a24.94,24.94,0,0,0-9.32-8.92,38.38,38.38,0,0,0-12.78-4.11,96.54,96.54,0,0,0-14-1q-18.63,0-31.07,7t-13.46,26.57h-29.34q.67-16.46,6.9-27.77A52.21,52.21,0,0,1,1562,203.17a70,70,0,0,1,23.65-10.11,125.51,125.51,0,0,1,28.48-3.09,168.63,168.63,0,0,1,24,1.72,63.26,63.26,0,0,1,21.58,7,41.23,41.23,0,0,1,15.53,14.89q5.87,9.57,5.87,25v91q0,10.26,1.21,15.05t8.11,4.79a35.57,35.57,0,0,0,9-1.37Zm-47.64-90.87c-3.69,2.74-8.52,4.72-14.5,6s-12.26,2.27-18.82,3.07-13.17,1.71-19.85,2.73a73.7,73.7,0,0,0-17.95,4.94,32.62,32.62,0,0,0-12.94,9.73q-5,6.32-5,17.23a23.31,23.31,0,0,0,2.94,12.11,24.11,24.11,0,0,0,7.59,8,32,32,0,0,0,10.88,4.44,60.94,60.94,0,0,0,13.11,1.36q14.51,0,24.86-3.92a52.49,52.49,0,0,0,16.91-9.9,39.1,39.1,0,0,0,9.67-13,32.53,32.53,0,0,0,3.11-13.14Zm208.85,141.62q-20,21.6-62.83,21.6a122.11,122.11,0,0,1-25.37-2.74,78,78,0,0,1-23.48-8.92,54.41,54.41,0,0,1-17.43-16.11q-6.91-10-7.6-24.35h29.35a21.47,21.47,0,0,0,5,13.38,36.67,36.67,0,0,0,11.4,8.91,55.52,55.52,0,0,0,14.67,5,79.51,79.51,0,0,0,15.19,1.55q14.49,0,24.51-5A46,46,0,0,0,1840.59,401a56.53,56.53,0,0,0,9.49-21.09,117.46,117.46,0,0,0,2.94-27.09V341.19h-.7q-7.59,16.46-23,24.18a71.8,71.8,0,0,1-32.63,7.71q-20,0-34.86-7.2A72.88,72.88,0,0,1,1737,346.51a82.13,82.13,0,0,1-15-28.46,116.62,116.62,0,0,1-5-34.47,133.92,133.92,0,0,1,4.14-32.4A88.17,88.17,0,0,1,1735,221a75.49,75.49,0,0,1,25.55-22.29q15.87-8.75,39-8.75a66.21,66.21,0,0,1,31.07,7.38,52.13,52.13,0,0,1,22.09,22.11h.35V194.09h27.61V356.28Q1880.63,399.83,1860.61,421.43Zm-37.46-79.72a47.94,47.94,0,0,0,16.4-15.78,71.89,71.89,0,0,0,9.15-22.11,106.77,106.77,0,0,0,2.93-24.69,96.71,96.71,0,0,0-2.76-23,64,64,0,0,0-8.8-20.4,45.76,45.76,0,0,0-15.71-14.57q-9.66-5.49-23.47-5.49-14.16,0-24.17,5.32a46.77,46.77,0,0,0-16.4,14.23,60.14,60.14,0,0,0-9.32,20.57,99.69,99.69,0,0,0-2.93,24.35,120.63,120.63,0,0,0,2.42,24,67.5,67.5,0,0,0,8.28,21.77,46.37,46.37,0,0,0,15.54,15.78q9.66,6,24.16,6T1823.15,341.71Zm228,18.34q-20,15.09-50.41,15.09-21.4,0-37.11-6.86a73.16,73.16,0,0,1-26.41-19.2,81.52,81.52,0,0,1-16-29.49,141.12,141.12,0,0,1-6-37.38,106.1,106.1,0,0,1,6.21-37A88.56,88.56,0,0,1,1938.8,216a79.09,79.09,0,0,1,26.58-19.2A81.66,81.66,0,0,1,1999,190q23.82,0,39.53,9.78a78,78,0,0,1,25.2,24.86,98.18,98.18,0,0,1,13.12,32.91,140.6,140.6,0,0,1,2.93,34h-133.6a70,70,0,0,0,2.76,22.12,49.9,49.9,0,0,0,10,18.51A49.1,49.1,0,0,0,1976.6,345q10.7,4.82,25.2,4.8,18.65,0,30.55-8.57t15.71-26.06h29Q2071.18,345,2051.17,360.05Zm-7.08-113.84a50,50,0,0,0-10.7-16,53.1,53.1,0,0,0-56.62-10.63,47.48,47.48,0,0,0-15.71,10.81,51.69,51.69,0,0,0-10.35,15.94,60.18,60.18,0,0,0-4.49,19.37h102.53A59.47,59.47,0,0,0,2044.09,246.21ZM302.9,180a80.62,80.62,0,0,0,13.44-10.37c.8-.77,1.55-1.54,2.31-2.31a81.89,81.89,0,0,0,7.92-9.37,62.37,62.37,0,0,0,6.27-10.77,48.6,48.6,0,0,0,4.36-16.4c1.49-19.39-10-38.67-35.62-54.22L198.42,14,78.16,129.22l-78.29,75,108.6,65.9a111.6,111.6,0,0,0,57.76,16.42c24.92,0,48.8-8.8,66.42-25.69,19.16-18.36,25.52-42.12,13.7-61.87a49.69,49.69,0,0,0-6.8-8.87,89.78,89.78,0,0,0,19.28,2.15H259a85.09,85.09,0,0,0,31-5.79A80.88,80.88,0,0,0,302.9,180Zm-100.59,59.8c-19.32,18.51-50.4,21.24-75.7,5.9l-75.13-45.6,67.44-64.65,76.42,46.39C222.88,198.57,221.36,221.6,202.31,239.84Zm8.94-82.21L140.6,114.74,205,53l69.37,42.11c25.94,15.73,29.31,37.05,10.55,55A60.71,60.71,0,0,1,211.25,157.63Zm29.86,190c-19.57,18.75-46.17,29.08-74.88,29.08a123.84,123.84,0,0,1-64.11-18.19L-.13,296.51v24.67l108.6,65.91a111.6,111.6,0,0,0,57.76,16.42c24.92,0,48.8-8.81,66.42-25.69,12.88-12.34,20-27.13,19.68-41.49v-1.79A87.85,87.85,0,0,1,241.11,347.67Zm0-39c-19.57,18.76-46.17,29.09-74.88,29.09a123.84,123.84,0,0,1-64.11-18.19L-.13,257.52V282.2l108.6,65.91a111.59,111.59,0,0,0,57.76,16.41c24.92,0,48.8-8.8,66.42-25.68,12.88-12.35,20-27.13,19.68-41.5v-1.79A86.86,86.86,0,0,1,241.11,308.68Zm0-39c-19.57,18.76-46.17,29.09-74.88,29.09a123.84,123.84,0,0,1-64.11-18.19L-.13,218.54v24.68l108.6,65.91a111.59,111.59,0,0,0,57.76,16.41c24.92,0,48.8-8.8,66.42-25.69,12.88-12.34,20-27.12,19.68-41.49v-1.82A87.14,87.14,0,0,1,241.11,269.7Zm83.69,25.74a94.16,94.16,0,0,1-60.19,25.86h0V348a81.6,81.6,0,0,0,51.73-22.37c14-13.38,21.15-28.11,21-42.64v-2.2A95.14,95.14,0,0,1,324.8,295.44Zm-83.69,91.21c-19.57,18.75-46.17,29.09-74.88,29.09a123.76,123.76,0,0,1-64.11-18.2L-.13,335.49v24.67l108.6,65.91a111.6,111.6,0,0,0,57.76,16.42c24.92,0,48.8-8.81,66.42-25.69,12.88-12.34,20-27.13,19.68-41.49v-1.79A87.35,87.35,0,0,1,241.11,386.65Zm85.75-210.21c-.68.69-1.35,1.38-2.06,2.05a99.19,99.19,0,0,1-22.23,15.69,94.53,94.53,0,0,1-26.24,8.71,97.84,97.84,0,0,1-14.16,1.57c.5,1.61.9,3.25,1.25,4.9a52.7,52.7,0,0,1,1.13,12V231h.05A84.48,84.48,0,0,0,290,225.47a80.83,80.83,0,0,0,26.38-16.82c.81-.77,1.51-1.56,2.27-2.34a82,82,0,0,0,7.92-9.38,62.85,62.85,0,0,0,6.29-10.78,48.5,48.5,0,0,0,4.32-16.44c.09-1.23.2-2.47.19-3.7v-2c-.72,1-1.48,2.06-2.26,3.09A98,98,0,0,1,326.86,176.44Zm0,77.92c-.68.7-1.3,1.41-2,2.1a94.09,94.09,0,0,1-60.19,25.85h0V309h0a81.65,81.65,0,0,0,51.73-22.37,73.51,73.51,0,0,0,16.48-22.49,48.56,48.56,0,0,0,4.32-16.44c.09-1.24.2-2.48.19-3.71v-2.2c-.74,1.08-1.47,2.16-2.27,3.22A95.81,95.81,0,0,1,326.82,254.36Zm0-39c-.68.7-1.3,1.41-2,2.1a92.22,92.22,0,0,1-10.62,8.65,93.53,93.53,0,0,1-11.63,7,95.63,95.63,0,0,1-37.94,10.18h-.05l0,26.67h0a81.63,81.63,0,0,0,51.73-22.37c.81-.77,1.51-1.56,2.27-2.34a82,82,0,0,0,7.92-9.38,63.16,63.16,0,0,0,6.29-10.77,48.55,48.55,0,0,0,4.32-16.45c.09-1.23.2-2.47.19-3.7v-2.2c-.74,1.08-1.47,2.16-2.27,3.22A98.19,98.19,0,0,1,326.82,215.38Z"})})};const Fs=(0,Yr.Z)({svg:{width:"auto",height:28},path:{fill:"#7df3e1"}});var Us=()=>{const i=Fs();return(0,h.jsx)("svg",{className:i.svg,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 337.46 428.5",children:(0,h.jsx)("path",{className:i.path,d:"M303,166.05a80.69,80.69,0,0,0,13.45-10.37c.79-.77,1.55-1.53,2.3-2.3a83.12,83.12,0,0,0,7.93-9.38A63.69,63.69,0,0,0,333,133.23a48.58,48.58,0,0,0,4.35-16.4c1.49-19.39-10-38.67-35.62-54.22L198.56,0,78.3,115.23,0,190.25l108.6,65.91a111.59,111.59,0,0,0,57.76,16.41c24.92,0,48.8-8.8,66.42-25.69,19.16-18.36,25.52-42.12,13.7-61.87a49.22,49.22,0,0,0-6.8-8.87A89.17,89.17,0,0,0,259,178.29h.15a85.08,85.08,0,0,0,31-5.79A80.88,80.88,0,0,0,303,166.05ZM202.45,225.86c-19.32,18.51-50.4,21.23-75.7,5.9L51.61,186.15l67.45-64.64,76.41,46.38C223,184.58,221.49,207.61,202.45,225.86Zm8.93-82.22-70.65-42.89L205.14,39,274.51,81.1c25.94,15.72,29.31,37,10.55,55A60.69,60.69,0,0,1,211.38,143.64Zm29.86,190c-19.57,18.75-46.17,29.09-74.88,29.09a123.73,123.73,0,0,1-64.1-18.2L0,282.52v24.67L108.6,373.1a111.6,111.6,0,0,0,57.76,16.42c24.92,0,48.8-8.81,66.42-25.69,12.88-12.34,20-27.13,19.68-41.49v-1.79A87.27,87.27,0,0,1,241.24,333.68Zm0-39c-19.57,18.75-46.17,29.08-74.88,29.08a123.81,123.81,0,0,1-64.1-18.19L0,243.53v24.68l108.6,65.91a111.6,111.6,0,0,0,57.76,16.42c24.92,0,48.8-8.81,66.42-25.69,12.88-12.34,20-27.13,19.68-41.5v-1.78A87.27,87.27,0,0,1,241.24,294.7Zm0-39c-19.57,18.76-46.17,29.09-74.88,29.09a123.81,123.81,0,0,1-64.1-18.19L0,204.55v24.68l108.6,65.91a111.59,111.59,0,0,0,57.76,16.41c24.92,0,48.8-8.8,66.42-25.68,12.88-12.35,20-27.13,19.68-41.5v-1.82A86.09,86.09,0,0,1,241.24,255.71Zm83.7,25.74a94.15,94.15,0,0,1-60.2,25.86h0V334a81.6,81.6,0,0,0,51.74-22.37c14-13.38,21.14-28.11,21-42.64v-2.19A94.92,94.92,0,0,1,324.94,281.45Zm-83.7,91.21c-19.57,18.76-46.17,29.09-74.88,29.09a123.73,123.73,0,0,1-64.1-18.2L0,321.5v24.68l108.6,65.9a111.6,111.6,0,0,0,57.76,16.42c24.92,0,48.8-8.8,66.42-25.69,12.88-12.34,20-27.13,19.68-41.49v-1.79A86.29,86.29,0,0,1,241.24,372.66ZM327,162.45c-.68.69-1.35,1.38-2.05,2.06a94.37,94.37,0,0,1-10.64,8.65,91.35,91.35,0,0,1-11.6,7,94.53,94.53,0,0,1-26.24,8.71,97.69,97.69,0,0,1-14.16,1.57c.5,1.61.9,3.25,1.25,4.9a53.27,53.27,0,0,1,1.14,12V217h.05a84.41,84.41,0,0,0,25.35-5.55,81,81,0,0,0,26.39-16.82c.8-.77,1.5-1.56,2.26-2.34a82.08,82.08,0,0,0,7.93-9.38A63.76,63.76,0,0,0,333,172.17a48.55,48.55,0,0,0,4.32-16.45c.09-1.23.2-2.47.19-3.7V150q-1.08,1.54-2.25,3.09A96.73,96.73,0,0,1,327,162.45Zm0,77.92c-.69.7-1.31,1.41-2,2.1a94.2,94.2,0,0,1-60.2,25.86h0l0,26.67h0a81.6,81.6,0,0,0,51.74-22.37A73.51,73.51,0,0,0,333,250.13a48.56,48.56,0,0,0,4.32-16.44c.09-1.24.2-2.47.19-3.71v-2.19c-.74,1.07-1.46,2.15-2.27,3.21A95.68,95.68,0,0,1,327,240.37Zm0-39c-.69.7-1.31,1.41-2,2.1a93.18,93.18,0,0,1-10.63,8.65,91.63,91.63,0,0,1-11.63,7,95.47,95.47,0,0,1-37.94,10.18h0V256h0a81.65,81.65,0,0,0,51.74-22.37c.8-.77,1.5-1.56,2.26-2.34a82.08,82.08,0,0,0,7.93-9.38A63.76,63.76,0,0,0,333,211.15a48.56,48.56,0,0,0,4.32-16.44c.09-1.24.2-2.48.19-3.71v-2.2c-.74,1.08-1.46,2.16-2.27,3.22A95.68,95.68,0,0,1,327,201.39Z"})})};const ia=(0,Yr.Z)({root:{width:X.po.drawerWidthClosed,height:3*X.po.logoHeight,display:"flex",flexFlow:"row nowrap",alignItems:"center",marginBottom:-14},link:{width:X.po.drawerWidthClosed,marginLeft:24}}),aa=()=>{const i=ia(),{isOpen:n}=(0,X.mZ)();return(0,h.jsx)("div",{className:i.root,children:(0,h.jsx)(X.rU,{to:"/docs/default/component/local/",underline:"none",className:i.link,children:n?(0,h.jsx)(Ci,{}):(0,h.jsx)(Us,{})})})},la=({children:i})=>(0,h.jsxs)(X.tR,{children:[(0,h.jsxs)(X.YE,{children:[(0,h.jsx)(aa,{}),(0,h.jsx)(X.v7,{}),(0,h.jsx)(X.R6,{icon:Si.Z,to:"/docs/default/component/local",text:"Docs Preview"})]}),i]});var wi=r(32388),ji=r(4142);const ca=(0,Yr.Z)(i=>({headerIcon:{color:i.palette.common.white,width:"32px",height:"32px"},content:{backgroundColor:i.palette.background.default},contentToolbar:{display:"flex",justifyContent:"flex-end",padding:0}}));var pr;(function(i){i.LIGHT="light",i.DARK="dark"})(pr||(pr={}));const Ei=()=>{const i=(0,g.h_)(g.hg),n=ca(),[s,a]=(0,H.useState)(i.getActiveThemeId()===pr.DARK?pr.DARK:pr.LIGHT),p={[pr.LIGHT]:{icon:ji.Z,title:"Dark theme"},[pr.DARK]:{icon:wi.Z,title:"Light theme"}},{title:A,icon:k}=p[s],M=()=>{a(ae=>{const xe=ae===pr.LIGHT?pr.DARK:pr.LIGHT;return i.setActiveThemeId(xe),xe})};return(0,h.jsx)(Ss.Z,{display:"flex",alignItems:"center",mr:2,children:(0,h.jsx)(Cs.ZP,{title:A,arrow:!0,children:(0,h.jsx)(vo.Z,{size:"small",onClick:M,children:(0,h.jsx)(k,{className:n.headerIcon})})})})},Ai=()=>(0,h.jsxs)(L.I6,{children:[(0,h.jsx)(K.S,{}),(0,h.jsx)(I.F,{withSearch:!1})]}),Ms=(0,h.jsx)(Ai,{}),zs=Mi({apis:ra,configLoader:So,plugins:Object.values(t)}),Ti=zs.getProvider(),da=zs.getRouter(),Ri=L.s4.provide((0,oe.KY)({name:"ThemeToggleAddon",component:Ei,location:oe.oZ.Header})),Ws=(0,h.jsxs)(Lr,{children:[(0,h.jsx)(W.Fg,{to:"/docs/default/component/local/"},"/"),(0,h.jsx)(W.AW,{path:"/catalog/:namespace/:kind/:name",element:(0,h.jsx)(Zs,{})}),(0,h.jsx)(W.AW,{path:"/docs",element:(0,h.jsx)(L.Jl,{}),children:(0,h.jsx)($.u,{})}),(0,h.jsxs)(W.AW,{path:"/docs/:namespace/:kind/:name/*",element:(0,h.jsx)(L.I6,{}),children:[Ms,(0,h.jsx)(oe.DR,{children:(0,h.jsx)(Ri,{})})]})]});var Ii=()=>(0,h.jsx)(Ti,{children:(0,h.jsx)(da,{children:(0,h.jsx)(la,{children:Ws})})});f.render((0,h.jsx)(Ii,{}),document.getElementById("root"))},51837:function(Ct,$e,r){"use strict";r.d($e,{CT:function(){return g},EI:function(){return ve},uW:function(){return f},Vt:function(){return u}});function t(){return typeof window!="undefined"&&window.Math===Math?window:typeof self!="undefined"&&self.Math===Math?self:Function("return this")()}const h=t(),H=ue=>`__@backstage/${ue}__`;function f(ue,V){const K=H(ue);let I=h[K];return I||(I=V(),h[K]=I,I)}var W=r(2784);function g(ue){return f(ue,()=>(0,W.createContext)(void 0))}function u(ue){return(0,W.useContext)(g(ue))}function B(ue){return{set(V){globalThis[`__@backstage/${ue}__`]=createContext(createVersionedValueMap(V))},reset(){delete globalThis[`__@backstage/${ue}__`]}}}function ve(ue){Object.freeze(ue);const V={atVersion(K){return ue[K]}};return Object.defineProperty(V,"$map",{configurable:!0,enumerable:!0,get(){return ue}}),V}},96641:function(Ct,$e,r){"use strict";r.d($e,{X2:function(){return ve},ce:function(){return ue},h$:function(){return u}});var t=r(52322),h=r(25271),H=r(60871),f=r(51837),W=r(2784);const g=(0,f.CT)("entity-context"),u=V=>{const{children:K,entity:I,loading:w,error:ie,refresh:ee}=V,ne={entity:I,loading:w,error:ie,refresh:ee};return(0,t.jsx)(g.Provider,{value:(0,f.EI)({1:ne}),children:(0,t.jsx)(H.fC,{attributes:{...I?{entityRef:(0,h.eE)(I)}:void 0},children:K})})},B=V=>_jsx(u,{entity:V.entity,loading:!Boolean(V.entity),error:void 0,refresh:void 0,children:V.children});function ve(){const V=(0,f.Vt)("entity-context");if(!V)throw new Error("Entity context is not available");const K=V.atVersion(1);if(!K)throw new Error("EntityContext v1 not available");if(!K.entity)throw new Error("useEntity hook is being called outside of an EntityLayout where the entity has not been loaded. If this is intentional, please use useAsyncEntity instead.");return{entity:K.entity}}function ue(){const V=(0,f.Vt)("entity-context");if(!V)throw new Error("Entity context is not available");const K=V.atVersion(1);if(!K)throw new Error("EntityContext v1 not available");const{entity:I,loading:w,error:ie,refresh:ee}=K;return{entity:I,loading:w,error:ie,refresh:ee}}},43514:function(Ct,$e,r){"use strict";r.d($e,{h$:function(){return xt.h$},n3:function(){return t.n3},_i:function(){return T},tW:function(){return _n},df:function(){return Me},UO:function(){return tt},ph:function(){return Uo},dq:function(){return kt},nl:function(){return Fo},dx:function(){return te},rI:function(){return le},u3:function(){return Dt},xE:function(){return Gn},sL:function(){return ur},LH:function(){return b},U_:function(){return Bo},pp:function(){return uo},EW:function(){return ho},Ah:function(){return H},wi:function(){return Qt},hF:function(){return oe.hF},CV:function(){return oe.CV},$3:function(){return D},p3:function(){return f},ce:function(){return xt.ce},X2:function(){return xt.X2},wp:function(){return mt},ZW:function(){return tn},eK:function(){return Yt},CR:function(){return Pn}});var t=r(4791),h=r(60871);const H=(0,h.T0)({id:"plugin.catalog.service"}),f=(0,h.T0)({id:"catalog-react.starred-entities"});var W=r(82394);class g{async toggleStarred(C){this.starredEntities.delete(C)||this.starredEntities.add(C);for(const R of this.subscribers)R.next(new Set(this.starredEntities))}starredEntitie$(){return this.observable}constructor(){_define_property(this,"starredEntities",new Set),_define_property(this,"subscribers",new Set),_define_property(this,"observable",new ObservableImpl(C=>(C.next(new Set(this.starredEntities)),this.subscribers.add(C),()=>{this.subscribers.delete(C)})))}}var u=r(52322),B=r(2784),ve=r(41156),ue=r(60364),V=r(77277),K=r(4190),I=r(95544),w=r(90436),ie=r(60905),ee=r(36444);const ne=x=>{const C=(0,ve.Z)(de=>de.breakpoints.down("md")),R=(0,ue.Z)(),[N,re]=(0,B.useState)(!1);return C?(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)(V.Z,{style:{marginTop:R.spacing(1),marginLeft:R.spacing(1)},onClick:()=>re(!0),startIcon:(0,u.jsx)(ee.Z,{}),children:"Filters"}),(0,u.jsx)(K.ZP,{open:N,onClose:()=>re(!1),anchor:"left",disableAutoFocus:!0,keepMounted:!0,variant:"temporary",children:(0,u.jsxs)(I.Z,{m:2,children:[(0,u.jsx)(w.Z,{variant:"h6",component:"h2",style:{marginBottom:R.spacing(1)},children:"Filters"}),x.children]})})]}):(0,u.jsx)(ie.Z,{item:!0,lg:2,children:x.children})},$=x=>(0,u.jsx)(ie.Z,{item:!0,xs:12,lg:10,children:x.children}),T=x=>(0,u.jsx)(ie.Z,{container:!0,style:{position:"relative"},children:x.children});T.Filters=ne,T.Content=$;var P=r(53974),L=r(87612),O=r(25271),oe=r(49280);class Le{getCatalogFilters(){return{kind:this.value}}toQueryValue(){return this.value}constructor(C){(0,L._)(this,"value",void 0),this.value=C}}class ze{getTypes(){return Array.isArray(this.value)?this.value:[this.value]}getCatalogFilters(){return{"spec.type":this.getTypes()}}toQueryValue(){return this.getTypes()}constructor(C){(0,L._)(this,"value",void 0),this.value=C}}class z{filterEntity(C){var R;return this.values.every(N=>((R=C.metadata.tags)!==null&&R!==void 0?R:[]).includes(N))}toQueryValue(){return this.values}constructor(C){(0,L._)(this,"values",void 0),this.values=C}}class yt{filterEntity(C){const R=this.toUpperArray(this.value.split(/\s/)),N=this.toUpperArray([C.metadata.tags]),re=this.toUpperArray([C.metadata.name,C.metadata.title]);for(const de of R)if(N.every(X=>X!==de)&&re.every(X=>!X.includes(de)))return!1;return!0}toUpperArray(C){return C.flat().filter(R=>Boolean(R)).map(R=>R.toLocaleUpperCase("en-US"))}constructor(C){_define_property(this,"value",void 0),this.value=C}}class ot{filterEntity(C){return this.values.some(R=>(0,oe.hF)(C,O.S4).some(N=>(0,O.eE)(N)===R))}toQueryValue(){return this.values}constructor(C){(0,L._)(this,"values",void 0),this.values=C.reduce((R,N)=>{try{return R.push((0,O.eE)((0,O.of)(N,{defaultKind:"Group"}))),R}catch{return R}},[])}}class He{filterEntity(C){return this.values.some(R=>{var N;return((N=C.spec)===null||N===void 0?void 0:N.lifecycle)===R})}toQueryValue(){return this.values}constructor(C){(0,L._)(this,"values",void 0),this.values=C}}class st{filterEntity(C){return this.values.some(R=>C.metadata.namespace===R)}toQueryValue(){return this.values}constructor(C){(0,L._)(this,"values",void 0),this.values=C}}class Qe{filterEntity(C){switch(this.value){case"owned":return this.isOwnedEntity(C);case"starred":return this.isStarredEntity(C);default:return!0}}toQueryValue(){return this.value}constructor(C,R,N){(0,L._)(this,"value",void 0),(0,L._)(this,"isOwnedEntity",void 0),(0,L._)(this,"isStarredEntity",void 0),this.value=C,this.isOwnedEntity=R,this.isStarredEntity=N}}class St{filterEntity(C){var R;const N=(R=C.metadata.annotations)===null||R===void 0?void 0:R["backstage.io/orphan"];return N!==void 0&&this.value.toString()===N}constructor(C){(0,L._)(this,"value",void 0),this.value=C}}class It{filterEntity(C){var R,N;const re=(C==null||(R=C.status)===null||R===void 0||(N=R.items)===null||N===void 0?void 0:N.length)>0;return re!==void 0&&this.value===re}constructor(C){(0,L._)(this,"value",void 0),this.value=C}}var xt=r(96641),lt=r(76635),Pt=r(19126),Nt=r.n(Pt),We=r(73557),_t=r(69294),ge=r(48760),Se=r(90736);const Fe=(0,B.createContext)(void 0),tt=x=>{const C=(0,Se.default)(),R=(0,h.h_)(H),[N,re]=(0,B.useState)({}),de=(0,We.TH)();var X;const ye=(0,B.useMemo)(()=>(X=Nt().parse(de.search,{ignoreQueryPrefix:!0}).filters)!==null&&X!==void 0?X:{},[de]),[Ee,Re]=(0,B.useState)(()=>({appliedFilters:{},entities:[],backendEntities:[]})),[{loading:Ze,error:Ne},rt]=(0,_t.default)(async()=>{const Be=(0,lt.compact)(Object.values(N)),Je=(0,oe.Gz)(Be),At=(0,oe.wq)(Be),cn=(0,oe.wq)((0,lt.compact)(Object.values(Ee.appliedFilters))),qt=Object.keys(N).reduce((nn,An)=>{const Rn=N[An];return Rn!=null&&Rn.toQueryValue&&(nn[An]=Rn.toQueryValue()),nn},{});if((0,lt.isEqual)(cn,At))Re({appliedFilters:N,backendEntities:Ee.backendEntities,entities:Ee.backendEntities.filter(Je)});else{const nn=await R.getEntities({filter:At});Re({appliedFilters:N,backendEntities:nn.items,entities:nn.items.filter(Je)})}if(C()){var on;const nn=Nt().parse(de.search,{ignoreQueryPrefix:!0}),An=Nt().stringify({...nn,filters:qt},{addQueryPrefix:!0,arrayFormat:"repeat"}),Rn=`${window.location.pathname}${An}`;(on=window.history)===null||on===void 0||on.replaceState(null,document.title,Rn)}},[R,ye,N,Ee],{loading:!0});(0,ge.Z)(rt,10,[N]);const qe=(0,B.useCallback)(Be=>{re(Je=>{const At=typeof Be=="function"?Be(Je):Be;return{...Je,...At}})},[]),Ge=(0,B.useMemo)(()=>({filters:Ee.appliedFilters,entities:Ee.entities,backendEntities:Ee.backendEntities,updateFilters:qe,queryParameters:ye,loading:Ze,error:Ne}),[Ee,qe,ye,Ze,Ne]);return(0,u.jsx)(Fe.Provider,{value:Ge,children:x.children})};function mt(){const x=(0,B.useContext)(Fe);if(!x)throw new Error("useEntityList must be used within EntityListProvider");return x}var bt=r(64279),pt=r(18149),Ot=r.n(pt),Ht=r(829),Jt=r.n(Ht);function Bt(){const x=(0,h.h_)(H),{filters:{kind:C,type:R},queryParameters:{type:N},updateFilters:re}=mt(),de=(0,B.useMemo)(()=>[N].flat().filter(Boolean),[N]);var X;const[ye,Ee]=(0,B.useState)(de.length?de:(X=R==null?void 0:R.getTypes())!==null&&X!==void 0?X:[]);(0,B.useEffect)(()=>{de.length&&Ee(de)},[de]);const[Re,Ze]=(0,B.useState)([]),Ne=(0,B.useMemo)(()=>C==null?void 0:C.value,[C]),{error:rt,loading:qe,value:Ge}=(0,bt.default)(async()=>Ne?await x.getEntityFacets({filter:{kind:Ne},facets:["spec.type"]}).then(At=>At.facets["spec.type"]||[]):[],[Ne,x]),Be=(0,B.useRef)(Ge);return(0,B.useEffect)(()=>{const Je=Be.current;if(Be.current=Ge,qe||!Ne||Je===Ge||!Ge)return;const At=[...new Set(Jt()(Ge,qt=>-qt.count).map(qt=>qt.value.toLocaleLowerCase("en-US")))];Ze(At);const cn=ye.filter(qt=>At.includes(qt));Ot()(ye,cn)||Ee(cn)},[qe,Ne,ye,Ee,Ge]),(0,B.useEffect)(()=>{re({type:ye.length?new ze(ye):void 0})},[ye,re]),{loading:qe,error:rt,availableTypes:Re,selectedTypes:ye,setSelectedTypes:Ee}}const un=20;function Yt(x,C){var R,N;const re=C==null||(R=C.type)===null||R===void 0?void 0:R.toLocaleLowerCase("en-US"),de=C==null||(N=C.kind)===null||N===void 0?void 0:N.toLocaleLowerCase("en-US"),X=(0,h.h_)(H),{loading:ye,value:Ee,error:Re}=(0,bt.default)(async()=>{var Ze;const Ne=(Ze=x.relations)===null||Ze===void 0?void 0:Ze.map(Be=>({type:Be.type,target:(0,O.of)(Be.targetRef)})).filter(Be=>(!re||Be.type.toLocaleLowerCase("en-US")===re)&&(!de||Be.target.kind===de));if(!Ne)return[];const rt=Object.values((0,lt.groupBy)(Ne,({target:Be})=>`${Be.kind}:${Be.namespace}`.toLocaleLowerCase("en-US"))),qe=[];for(const Be of rt)qe.push({kind:Be[0].target.kind,namespace:Be[0].target.namespace,nameBatches:(0,lt.chunk)(Be.map(Je=>Je.target.name),un)});return(await Promise.all(qe.flatMap(Be=>Be.nameBatches.map(Je=>X.getEntities({filter:{kind:Be.kind,"metadata.namespace":Be.namespace,"metadata.name":Je}}))))).flatMap(Be=>Be.items)},[x,re,de]);return{entities:Ee,loading:ye,error:Re}}var pn=r(72164);function Fn(x){return typeof x=="string"?x:(0,O.eE)(x)}function Pn(){const x=(0,h.h_)(f),C=(0,pn.Z)(x.starredEntitie$(),new Set),R=(0,B.useCallback)(re=>C.has(Fn(re)),[C]),N=(0,B.useCallback)(re=>x.toggleStarred(Fn(re)).then(),[x]);return{starredEntities:C,toggleStarredEntity:N,isStarredEntity:R}}function fn(x){return typeof x=="string"?x:(0,O.eE)(x)}function Ln(x){const C=(0,h.h_)(f),[R,N]=(0,B.useState)(!1);return(0,B.useEffect)(()=>{const de=C.starredEntitie$().subscribe({next(X){N(X.has(fn(x)))}});return()=>{de.unsubscribe()}},[x,C]),{toggleStarredEntity:(0,B.useCallback)(()=>C.toggleStarred(fn(x)).then(),[x,C]),isStarredEntity:R}}var Un=r(75435);function tn(){const x=(0,h.h_)(h.$4),{loading:C,value:R}=(0,bt.default)(async()=>{const{ownershipEntityRefs:re}=await x.getBackstageIdentity();return re},[]),N=(0,B.useMemo)(()=>{const re=new Set(R!=null?R:[]);return de=>{const X=(0,Un.h)(de,O.S4).map(O.eE);for(const ye of X)if(re.has(ye))return!0;return!1}},[R]);return(0,B.useMemo)(()=>({loading:C,isOwnedEntity:N}),[C,N])}function wn(){const x=(0,h.h_)(H),{error:C,loading:R,value:N}=(0,bt.default)(async()=>await x.getEntityFacets({facets:["kind"]}).then(de=>{var X;return((X=de.facets.kind)===null||X===void 0?void 0:X.map(ye=>ye.value).sort())||[]}),[x]);return{loading:R,error:C,allKinds:N!=null?N:[]}}function Mn(x,C,R){let N=x;return C&&(N=N.filter(de=>C.some(X=>X.toLocaleLowerCase("en-US")===de.toLocaleLowerCase("en-US")))),R&&!x.some(de=>de.toLocaleLowerCase("en-US")===R.toLocaleLowerCase("en-US"))&&(N=N.concat([R])),N.sort().reduce((de,X)=>(de[X.toLocaleLowerCase("en-US")]=X,de),{})}function ut(x){var C;const{filters:R,queryParameters:{kind:N},updateFilters:re}=mt(),de=(0,B.useMemo)(()=>[N].flat()[0],[N]);var X;const[ye,Ee]=(0,B.useState)((X=de!=null?de:(C=R.kind)===null||C===void 0?void 0:C.value)!==null&&X!==void 0?X:x.initialFilter);(0,B.useEffect)(()=>{de&&Ee(de)},[de]),(0,B.useEffect)(()=>{var rt;if(!((rt=R.kind)===null||rt===void 0)&&rt.value){var qe;Ee((qe=R.kind)===null||qe===void 0?void 0:qe.value)}},[R.kind]),(0,B.useEffect)(()=>{re({kind:ye?new Le(ye):void 0})},[ye,re]);const{allKinds:Re,loading:Ze,error:Ne}=wn();return{loading:Ze,error:Ne,allKinds:Re!=null?Re:[],selectedKind:ye,setSelectedKind:Ee}}const _n=x=>{const{allowedKinds:C,hidden:R,initialFilter:N="component"}=x,re=(0,h.h_)(h.$v),{error:de,allKinds:X,selectedKind:ye,setSelectedKind:Ee}=ut({initialFilter:N});if((0,B.useEffect)(()=>{de&&re.post({message:"Failed to load entity kinds",severity:"error"})},[de,re]),de)return null;const Re=Mn(X,C,ye),Ze=Object.keys(Re).map(Ne=>({value:Ne,label:Re[Ne]}));return R?null:(0,u.jsx)(I.Z,{pb:1,pt:1,children:(0,u.jsx)(P.Ph,{label:"Kind",items:Ze,selected:ye.toLocaleLowerCase("en-US"),onChange:Ne=>Ee(String(Ne))})})};var wt=r(79692),ct=r(5806),vn=r(21324),Kt=r(86619),hn=r(19996),jn=r(25505),ln=r(38016),Tn=r(88013);const Ce=(0,wt.Z)({input:{}},{name:"CatalogReactEntityLifecyclePicker"}),ce=(0,u.jsx)(jn.Z,{fontSize:"small"}),Oe=(0,u.jsx)(hn.Z,{fontSize:"small"}),Me=x=>{var C;const{initialFilter:R=[]}=x,N=Ce(),{updateFilters:re,backendEntities:de,filters:X,queryParameters:{lifecycles:ye}}=mt(),Ee=(0,B.useMemo)(()=>[ye].flat().filter(Boolean),[ye]);var Re;const[Ze,Ne]=(0,B.useState)(Ee.length?Ee:(Re=(C=X.lifecycles)===null||C===void 0?void 0:C.values)!==null&&Re!==void 0?Re:R);(0,B.useEffect)(()=>{Ee.length&&Ne(Ee)},[Ee]);const rt=(0,B.useMemo)(()=>[...new Set(de.map(qe=>{var Ge;return(Ge=qe.spec)===null||Ge===void 0?void 0:Ge.lifecycle}).filter(Boolean))].sort(),[de]);return(0,B.useEffect)(()=>{re({lifecycles:Ze.length&&rt.length?new He(Ze):void 0})},[Ze,re,rt]),rt.length?(0,u.jsx)(I.Z,{pb:1,pt:1,children:(0,u.jsxs)(w.Z,{variant:"button",component:"label",children:["Lifecycle",(0,u.jsx)(Tn.ZP,{multiple:!0,disableCloseOnSelect:!0,options:rt,value:Ze,onChange:(qe,Ge)=>Ne(Ge),renderOption:(qe,{selected:Ge})=>(0,u.jsx)(ct.Z,{control:(0,u.jsx)(vn.Z,{icon:ce,checkedIcon:Oe,checked:Ge}),onClick:Be=>Be.preventDefault(),label:qe}),size:"small",popupIcon:(0,u.jsx)(ln.Z,{"data-testid":"lifecycle-picker-expand"}),renderInput:qe=>(0,u.jsx)(Kt.Z,{...qe,className:N.input,variant:"outlined"})})]})}):null};var Xe=r(72579),se=r.n(Xe);function D(x,C){const R=C==null?void 0:C.defaultKind;let N,re,de;return"metadata"in x?(N=x.kind,re=x.metadata.namespace,de=x.metadata.name):(N=x.kind,re=x.namespace,de=x.name),(re===void 0||re==="")&&(re=O.zG),(C==null?void 0:C.defaultNamespace)!==void 0?(C==null?void 0:C.defaultNamespace)===re&&(re=void 0):re===O.zG&&(re=void 0),N=N.toLocaleLowerCase("en-US"),N=R&&R.toLocaleLowerCase("en-US")===N?void 0:N,`${N?`${N}:`:""}${re?`${re}/`:""}${de}`}function me(x,C){for(const R of["spec.profile.displayName","metadata.title"]){const N=se()(x,R);if(N&&typeof N=="string")return N}return D(x,C)}const De=(0,wt.Z)({input:{}},{name:"CatalogReactEntityOwnerPicker"}),et=(0,u.jsx)(jn.Z,{fontSize:"small"}),it=(0,u.jsx)(hn.Z,{fontSize:"small"}),kt=()=>{var x;const C=De(),{updateFilters:R,backendEntities:N,filters:re,queryParameters:{owners:de}}=mt(),X=(0,h.h_)(H),ye=(0,h.h_)(h.VE),Ee=(0,B.useMemo)(()=>[de].flat().filter(Boolean),[de]);var Re;const[Ze,Ne]=(0,B.useState)(Ee.length?new ot(Ee).values:(Re=(x=re.owners)===null||x===void 0?void 0:x.values)!==null&&Re!==void 0?Re:[]),{loading:rt,error:qe,value:Ge}=(0,bt.default)(async()=>{const Je=[...new Set(N.flatMap(qt=>(0,oe.hF)(qt,O.S4).map(on=>(0,O.eE)(on))).filter(Boolean))],{items:At}=await X.getEntitiesByRefs({entityRefs:Je,fields:["kind","metadata.name","metadata.title","metadata.namespace","spec.profile.displayName"]});return At.map((qt,on)=>qt?{label:me(qt,{defaultKind:"Group"}),entityRef:(0,O.eE)(qt)}:{label:D((0,O.of)(Je[on]),{defaultKind:"group"}),entityRef:Je[on]}).sort((qt,on)=>qt.label.localeCompare(on.label,"en-US",{ignorePunctuation:!0,caseFirst:"upper"}))},[N]);if((0,B.useEffect)(()=>{qe&&ye.post({...qe,message:`EntityOwnerPicker failed to initialize: ${qe.message}`},{})},[qe,ye]),(0,B.useEffect)(()=>{if(Ee.length){const Je=new ot(Ee);Ne(Je.values)}},[Ee]),(0,B.useEffect)(()=>{!rt&&Ge&&R({owners:Ze.length&&Ge.length?new ot(Ze):void 0})},[Ze,R,Ge,rt]),!rt&&!(Ge!=null&&Ge.length))return null;var Be;return(0,u.jsx)(I.Z,{pb:1,pt:1,children:(0,u.jsxs)(w.Z,{variant:"button",component:"label",children:["Owner",(0,u.jsx)(Tn.ZP,{multiple:!0,disableCloseOnSelect:!0,loading:rt,options:Ge||[],value:(Be=Ge==null?void 0:Ge.filter(Je=>Ze.some(At=>At===Je.entityRef)))!==null&&Be!==void 0?Be:[],onChange:(Je,At)=>Ne(At.map(cn=>cn.entityRef)),getOptionLabel:Je=>Je.label,renderOption:(Je,{selected:At})=>(0,u.jsx)(ct.Z,{control:(0,u.jsx)(vn.Z,{icon:et,checkedIcon:it,checked:At}),onClick:cn=>cn.preventDefault(),label:Je.label}),size:"small",popupIcon:(0,u.jsx)(ln.Z,{"data-testid":"owner-picker-expand"}),renderInput:Je=>(0,u.jsx)(Kt.Z,{...Je,className:C.input,variant:"outlined"})})]})})};var Ft=r(51837);const Qt=(0,Ft.uW)("catalog:entity-route-ref",()=>(0,h.NT)({id:"catalog:entity",params:["namespace","kind","name"]}));function _(x){var C,R;return{kind:x.kind.toLocaleLowerCase("en-US"),namespace:(R=(C=x.metadata.namespace)===null||C===void 0?void 0:C.toLocaleLowerCase("en-US"))!==null&&R!==void 0?R:DEFAULT_NAMESPACE,name:x.metadata.name}}var J=r(80030);const te=(0,B.forwardRef)((x,C)=>{const{entityRef:R,defaultKind:N,title:re,children:de,...X}=x,ye=(0,h.tg)(Qt);let Ee,Re,Ze;if(typeof R=="string"){const Be=(0,O.of)(R);Ee=Be.kind,Re=Be.namespace,Ze=Be.name}else"metadata"in R?(Ee=R.kind,Re=R.metadata.namespace,Ze=R.metadata.name):(Ee=R.kind,Re=R.namespace,Ze=R.name);Ee=Ee.toLocaleLowerCase("en-US");var Ne;Re=(Ne=Re==null?void 0:Re.toLocaleLowerCase("en-US"))!==null&&Ne!==void 0?Ne:O.zG;const rt={kind:Ee,namespace:Re,name:Ze},qe=D({kind:Ee,namespace:Re,name:Ze},{defaultKind:N}),Ge=(0,u.jsxs)(P.rU,{...X,ref:C,to:ye(rt),children:[de,!de&&(re!=null?re:qe)]});return re?(0,u.jsx)(J.ZP,{title:qe,children:Ge}):Ge});function pe(x){const{entityRefs:C,defaultKind:R,getTitle:N,...re}=x,de=(0,h.h_)(H),{value:X=new Array,loading:ye,error:Ee}=(0,bt.default)(async()=>{const Re=C.reduce((Ne,rt)=>typeof rt=="object"&&"metadata"in rt?Ne:[...Ne,(0,O.of)(rt)],new Array),Ze=C.filter(Ne=>typeof Ne=="object"&&"metadata"in Ne);return Re.length>0?[...(await de.getEntities({filter:Re.map(Ne=>({kind:Ne.kind,"metadata.namespace":Ne.namespace,"metadata.name":Ne.name}))})).items,...Ze]:Ze},[C]);return ye?(0,u.jsx)(P.Ex,{}):Ee?(0,u.jsx)(P.yu,{error:Ee}):(0,u.jsx)(u.Fragment,{children:X.map((Re,Ze)=>(0,u.jsxs)(B.Fragment,{children:[Ze>0&&", ",(0,u.jsx)(te,{...re,defaultKind:R,entityRef:Re,title:N(Re)})]},Ze))})}function le(x){const{entityRefs:C,defaultKind:R,fetchEntities:N,getTitle:re,...de}=x;return N?(0,u.jsx)(pe,{...de,defaultKind:R,entityRefs:C,getTitle:re}):(0,u.jsx)(u.Fragment,{children:C.map((X,ye)=>(0,u.jsxs)(B.Fragment,{children:[ye>0&&", ",(0,u.jsx)(te,{...de,defaultKind:R,entityRef:X,title:re?re(X):void 0})]},ye))})}const y=x=>{const C=useRouteRef(entityRouteRef);return _jsx(IconButton,{component:Link,"aria-label":"Show",title:"Show details",to:C(getCompoundEntityRef(x.entity)),children:_jsx(InfoIcon,{})})},Z=x=>_jsx(IconButton,{component:Link,"aria-label":"Email",title:`Email ${x.email}`,to:`mailto:${x.email}`,children:_jsx(EmailIcon,{})}),q=x=>{var C;const R=(C=x.entity.spec.profile)===null||C===void 0?void 0:C.email;return R?_jsx(EmailCardAction,{email:R}):null},Y=x=>{var C;const R=(C=x.entity.spec.profile)===null||C===void 0?void 0:C.email;return R?_jsx(EmailCardAction,{email:R}):null},we=(0,wt.Z)(()=>({popoverPaper:{width:"30em"},descriptionTypography:{overflow:"hidden",textOverflow:"ellipsis",display:"-webkit-box",WebkitLineClamp:2,WebkitBoxOrient:"vertical"}})),Ae=4,Ye=x=>{var C,R,N;const{entityRef:re,children:de,delayTime:X=500}=x,ye=we(),Ee=useApiHolder(),Re=usePopupState({variant:"popover",popupId:"entity-peek-ahead"}),[Ze,Ne]=useState(!1),rt=useMemo(()=>debounce(()=>Ne(!0),X),[X]),[{loading:qe,error:Ge,value:Be},Je]=useAsyncFn(async()=>{const cn=Ee.get(catalogApiRef);if(cn){const qt=await cn.getEntityByRef(re);if(!qt)throw new Error(`${re} not found`);return qt}},[Ee,re]),At=()=>{Ne(!1),rt.cancel()};return useEffect(()=>{Re.isOpen&&!Be&&!Ge&&!qe&&Je()},[Re.isOpen,Je,Be,Ge,qe]),_jsxs(_Fragment,{children:[_jsx(Typography,{component:"span",onMouseEnter:rt,children:_jsx(Typography,{component:"span","data-testid":"trigger",...bindHover(Re),children:de})}),Ze&&_jsx(HoverPopover,{PaperProps:{className:ye.popoverPaper},...bindPopover(Re),anchorOrigin:{vertical:"bottom",horizontal:"center"},transformOrigin:{vertical:"top",horizontal:"center"},onMouseLeave:At,children:_jsxs(Card,{children:[_jsxs(CardContent,{children:[Ge&&_jsx(ResponseErrorPanel,{error:Ge}),qe&&_jsx(Progress,{}),Be&&_jsxs(_Fragment,{children:[_jsx(Typography,{color:"textSecondary",children:Be.metadata.namespace}),_jsx(Typography,{variant:"h5",component:"div",children:Be.metadata.name}),_jsx(Typography,{color:"textSecondary",gutterBottom:!0,children:Be.kind}),Be.metadata.description&&_jsx(Typography,{className:ye.descriptionTypography,paragraph:!0,children:Be.metadata.description}),_jsx(Typography,{children:(C=Be.spec)===null||C===void 0?void 0:C.type}),_jsxs(Box,{marginTop:"0.5em",children:[(Be.metadata.tags||[]).slice(0,Ae).map(cn=>_jsx(Chip,{size:"small",label:cn},cn)),((R=Be.metadata.tags)===null||R===void 0?void 0:R.length)&&((N=Be.metadata.tags)===null||N===void 0?void 0:N.length)>Ae&&_jsx(Tooltip,{title:"Drill into the entity to see all of the tags.",children:_jsx(Chip,{size:"small",label:"..."},"other-tags")})]})]})]}),!Ge&&Be&&_jsx(CardActions,{children:_jsxs(_Fragment,{children:[isUserEntity(Be)&&_jsx(UserCardActions,{entity:Be}),isGroupEntity(Be)&&_jsx(GroupCardActions,{entity:Be}),_jsx(EntityCardActions,{entity:Be})]})})]})})]})},jt=(0,wt.Z)(x=>({searchToolbar:{paddingLeft:0,paddingRight:0},input:{}}),{name:"CatalogReactEntitySearchBar"}),vt=()=>{var x;const C=jt(),{filters:R,updateFilters:N}=useEntityList();var re;const[de,X]=useState((re=(x=R.text)===null||x===void 0?void 0:x.value)!==null&&re!==void 0?re:"");return useDebounce(()=>{N({text:de.length?new EntityTextFilter(de):void 0})},250,[de,N]),_jsx(Toolbar,{className:C.searchToolbar,children:_jsx(FormControl,{children:_jsx(Input,{"aria-label":"search",id:"input-with-icon-adornment",className:C.input,placeholder:"Search",autoComplete:"off",onChange:ye=>X(ye.target.value),value:de,startAdornment:_jsx(InputAdornment,{position:"start",children:_jsx(Search,{})}),endAdornment:_jsx(InputAdornment,{position:"end",children:_jsx(IconButton,{"aria-label":"clear search",onClick:()=>X(""),edge:"end",disabled:de.length===0,children:_jsx(Clear,{})})})})})})},nt=Object.freeze({createEntityRefColumn(x){const{defaultKind:C}=x;function R(N){var re;return((re=N.metadata)===null||re===void 0?void 0:re.title)||D(N,{defaultKind:C})}return{title:"Name",highlight:!0,customFilterAndSearch(N,re){return R(re).includes(N)},customSort(N,re){return R(N).localeCompare(R(re))},render:N=>{var re;return(0,u.jsx)(te,{entityRef:N,defaultKind:C,title:(re=N.metadata)===null||re===void 0?void 0:re.title})}}},createEntityRelationColumn(x){const{title:C,relation:R,defaultKind:N,filter:re}=x;function de(ye){return(0,oe.hF)(ye,R,re)}function X(ye){return de(ye).map(Ee=>D(Ee,{defaultKind:N})).join(", ")}return{title:C,customFilterAndSearch(ye,Ee){return X(Ee).includes(ye)},customSort(ye,Ee){return X(ye).localeCompare(X(Ee))},render:ye=>(0,u.jsx)(le,{entityRefs:de(ye),defaultKind:N})}},createOwnerColumn(){return this.createEntityRelationColumn({title:"Owner",relation:O.S4,defaultKind:"group"})},createDomainColumn(){return this.createEntityRelationColumn({title:"Domain",relation:O.cz,defaultKind:"domain",filter:{kind:"domain"}})},createSystemColumn(){return this.createEntityRelationColumn({title:"System",relation:O.cz,defaultKind:"system",filter:{kind:"system"}})},createMetadataDescriptionColumn(){return{title:"Description",field:"metadata.description",render:x=>(0,u.jsx)(P.Or,{text:x.metadata.description,placement:"bottom-start",line:2})}},createSpecLifecycleColumn(){return{title:"Lifecycle",field:"spec.lifecycle"}},createSpecTypeColumn(){return{title:"Type",field:"spec.type"}}}),Ke=[nt.createEntityRefColumn({defaultKind:"system"}),nt.createDomainColumn(),nt.createOwnerColumn(),nt.createMetadataDescriptionColumn()],dt=[nt.createEntityRefColumn({defaultKind:"component"}),nt.createSystemColumn(),nt.createOwnerColumn(),nt.createSpecTypeColumn(),nt.createSpecLifecycleColumn(),nt.createMetadataDescriptionColumn()],at=(0,wt.Z)(x=>({empty:{padding:x.spacing(2),display:"flex",justifyContent:"center"}})),Dt=x=>{const{entities:C,title:R,emptyContent:N,variant:re="gridItem",columns:de}=x,X=at(),ye={minWidth:"0",width:"100%"};return re==="gridItem"&&(ye.height="calc(100% - 10px)"),(0,u.jsx)(P.iA,{columns:de,title:R,style:ye,emptyContent:N&&(0,u.jsx)("div",{className:X.empty,children:N}),options:{search:!1,paging:!1,actionsColumnIndex:-1,padding:"dense",draggable:!1},data:C})};Dt.columns=nt,Dt.systemEntityColumns=Ke,Dt.componentEntityColumns=dt;const Mt=(0,u.jsx)(jn.Z,{fontSize:"small"}),Xt=(0,u.jsx)(hn.Z,{fontSize:"small"});function en({selected:x}){return(0,u.jsx)(vn.Z,{icon:Mt,checkedIcon:Xt,checked:x})}const Ut=(0,B.memo)(x=>{const{selected:C,value:R,availableOptions:N,showCounts:re}=x,de=re?`${R} (${N==null?void 0:N[R]})`:R;return(0,u.jsx)(ct.Z,{control:(0,u.jsx)(en,{selected:C}),label:de,onClick:X=>X.preventDefault()})});var zt=r(72779),Et=r.n(zt);const Lt=(0,wt.Z)({input:{}},{name:"CatalogReactEntityAutocompletePickerInput"});function Zt(x){const C=Lt();return(0,u.jsx)(Kt.Z,{variant:"outlined",...x,className:Et()(C.input,x.className)})}function bn(x){var C;const{label:R,name:N,path:re,showCounts:de,Filter:X,InputProps:ye}=x,{updateFilters:Ee,filters:Re,queryParameters:{[N]:Ze}}=mt(),Ne=(0,h.h_)(H),{value:rt}=(0,bt.default)(async()=>{var on;const nn=re,{facets:An}=await Ne.getEntityFacets({facets:[nn],filter:(on=Re.kind)===null||on===void 0?void 0:on.getCatalogFilters()});return Object.fromEntries(An[nn].map(({value:Rn,count:Er})=>[Rn,Er]))},[Re.kind]),qe=(0,B.useMemo)(()=>[Ze].flat().filter(Boolean),[Ze]);var Ge;const[Be,Je]=(0,B.useState)(qe.length?qe:(Ge=(C=Re[N])===null||C===void 0?void 0:C.values)!==null&&Ge!==void 0?Ge:[]);(0,B.useEffect)(()=>{qe.length&&Je(qe)},[qe]);const At=Object.keys(rt!=null?rt:{}),cn=Be.length&&At.length;(0,B.useEffect)(()=>{Ee({[N]:cn?new X(Be):void 0})},[N,cn,Be,X,Ee]);const qt=Re[N];return qt&&typeof qt=="object"&&!("values"in qt)||!At.length||At.length<=1?null:(0,u.jsx)(I.Z,{pb:1,pt:1,children:(0,u.jsxs)(w.Z,{variant:"button",component:"label",children:[R,(0,u.jsx)(Tn.ZP,{multiple:!0,disableCloseOnSelect:!0,options:At,value:Be,onChange:(on,nn)=>Je(nn),renderOption:(on,{selected:nn})=>(0,u.jsx)(Ut,{selected:nn,value:on,availableOptions:rt,showCounts:!!de}),size:"small",popupIcon:(0,u.jsx)(ln.Z,{"data-testid":`${String(N)}-picker-expand`}),renderInput:on=>(0,u.jsx)(Zt,{...on,...ye})})]})})}const zn=(0,wt.Z)({input:{}},{name:"CatalogReactEntityTagPicker"}),Gn=x=>{const C=zn();return(0,u.jsx)(bn,{label:"Tags",name:"tags",path:"metadata.tags",Filter:z,showCounts:x.showCounts,InputProps:{className:C.input}})},ur=x=>{const{hidden:C,initialFilter:R}=x,N=(0,h.h_)(h.$v),{error:re,availableTypes:de,selectedTypes:X,setSelectedTypes:ye}=Bt();if((0,B.useEffect)(()=>{re&&N.post({message:"Failed to load entity types",severity:"error"}),R&&ye([R])},[re,N,R,ye]),de.length===0||re)return null;const Ee=[{value:"all",label:"all"},...de.map(Ze=>({value:Ze,label:Ze}))];var Re;return C?null:(0,u.jsx)(I.Z,{pb:1,pt:1,children:(0,u.jsx)(P.Ph,{label:"Type",items:Ee,selected:(Re=Ee.length>1?X[0]:void 0)!==null&&Re!==void 0?Re:"all",onChange:Ze=>ye(Ze==="all"?[]:[String(Ze)])})})};var En=r(15459),On=r(61837),er=r(11640),S=r(28347);const c=(0,En.Z)({root:{color:"#f3ba37"}})(er.Z),b=x=>{const{toggleStarredEntity:C,isStarredEntity:R}=Ln(x.entity);return(0,u.jsx)(On.Z,{"aria-label":"favorite",color:"inherit",...x,onClick:()=>C(),children:(0,u.jsx)(J.ZP,{title:R?"Remove from favorites":"Add to favorites",children:R?(0,u.jsx)(c,{}):(0,u.jsx)(S.Z,{})})})};var E=r(8629),Q=r(79249),be=r(38724),je=r(99152),ke=r(6487),ht=r(49429),ft=r(55999),yn=r(39412);const kn=yn.Z;function br(x,C){if(x)return x.toLocaleLowerCase("en-US");if(C)try{return(0,O.of)(C).kind.toLocaleLowerCase("en-US")}catch{return}}function Br(x,C){const R=(0,h.qD)(),N=br(x,C);return N&&R.getSystemIcon(`kind:${N}`)||kn}function $r(x){const{kind:C,entityRef:R,...N}=x,re=Br(C,R);return(0,u.jsx)(re,{...N})}const Ao=(0,wt.Z)(x=>({node:{fill:x.palette.grey[300],stroke:x.palette.grey[300],"&.primary":{fill:x.palette.primary.light,stroke:x.palette.primary.light},"&.secondary":{fill:x.palette.secondary.light,stroke:x.palette.secondary.light}},text:{fill:x.palette.getContrastText(x.palette.grey[300]),"&.primary":{fill:x.palette.primary.contrastText},"&.secondary":{fill:x.palette.secondary.contrastText},"&.focused":{fontWeight:"bold"}},clickable:{cursor:"pointer"}}));function eo(x){const C=(0,h.h_)(H),R=(0,O.eE)(x),{loading:N,error:re,value:de}=(0,bt.default)(async()=>{const X=await C.getEntityAncestors({entityRef:R}),ye=new Array,Ee=new Array;for(const Re of X.items){const Ze=(0,O.eE)(Re.entity),Ne=Ze===X.rootEntityRef;ye.push({id:Ze,root:Ne,...Re.entity});for(const rt of Re.parentEntityRefs)Ee.push({from:Ze,to:rt})}return{nodes:ye,edges:Ee}},[R]);return{loading:N,error:re,nodes:(de==null?void 0:de.nodes)||[],edges:(de==null?void 0:de.edges)||[]}}function Sr({node:x}){const C=Ao(),R=(0,We.s0)(),N=(0,h.tg)(Qt),[re,de]=(0,B.useState)(0),[X,ye]=(0,B.useState)(0),Ee=(0,B.useRef)(null);(0,B.useLayoutEffect)(()=>{if(Ee.current){let{height:Je,width:At}=Ee.current.getBBox();Je=Math.round(Je),At=Math.round(At),(Je!==X||At!==re)&&(de(At),ye(Je))}},[re,X]);const Re=10,Ze=X,Ne=Ze+Re,rt=Ne+re+Re*2,qe=X+Re*2,Ge=x.metadata.title||(x.kind&&x.metadata.name&&x.metadata.namespace?D({kind:x.kind,name:x.metadata.name,namespace:x.metadata.namespace||""}):x.id),Be=()=>{R(N({kind:x.kind,namespace:x.metadata.namespace||O.zG,name:x.metadata.name}))};return(0,u.jsxs)("g",{onClick:Be,className:C.clickable,children:[(0,u.jsx)("rect",{className:Et()(C.node,x.root?"secondary":"primary"),width:rt,height:qe,rx:10}),(0,u.jsx)($r,{kind:x.kind,y:Re,x:Re,width:Ze,height:Ze,className:Et()(C.text,x.root?"secondary":"primary")}),(0,u.jsx)("text",{ref:Ee,className:Et()(C.text,x.root?"secondary":"primary"),y:qe/2,x:Ne+(re+Re*2)/2,textAnchor:"middle",alignmentBaseline:"middle",children:Ge})]})}function Rr(x){const{loading:C,error:R,nodes:N,edges:re}=eo(x.entity);return C?(0,u.jsx)(P.Ex,{}):R?(0,u.jsx)(P.Gk,{error:R}):(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)(ft.Z,{variant:"h2",children:"Ancestry"}),(0,u.jsxs)(ft.Z,{gutterBottom:!0,children:["This is the ancestry of entities above the current one - as in, the chain(s) of entities down to the current one, where"," ",(0,u.jsx)(P.rU,{to:"https://backstage.io/docs/features/software-catalog/life-of-an-entity",children:"processors emitted"})," ","child entities that ultimately led to the current one existing. Note that this is a completely different mechanism from relations."]}),(0,u.jsx)(I.Z,{mt:4,children:(0,u.jsx)(P.mn,{nodes:N,edges:re,renderNode:Sr,direction:P.NX.Direction.BOTTOM_TOP,zoom:"enable-on-click"})})]})}var or=r(11776),Kn=r(38402),Ir=r(86136),Cr=r(99688),To=r(49378),Ro=r(54506),to=r(94339),Io=r(24579),Po=r(27685);const Wr=(0,wt.Z)(x=>({root:{display:"flex",flexDirection:"column"},marginTop:{marginTop:x.spacing(2)},helpIcon:{marginLeft:x.spacing(1),color:x.palette.text.disabled},monospace:{fontFamily:"monospace"}}));function tr(x){const C=Wr();return(0,u.jsx)(To.Z,{...x,primaryTypographyProps:{className:C.monospace},secondaryTypographyProps:{className:C.monospace}})}function Dr(x){const C=Wr();return(0,u.jsx)(Ro.Z,{className:C.monospace,children:x.children})}function Zr(x){return(0,u.jsx)(I.Z,{mt:2,children:(0,u.jsx)(to.Z,{variant:"outlined",children:(0,u.jsxs)(Io.Z,{children:[(0,u.jsxs)(w.Z,{variant:"h6",gutterBottom:!0,children:[x.title,x.helpLink&&(0,u.jsx)(Vr,{to:x.helpLink})]}),x.children]})})})}function no(x){if(x.match(/^url:https?:\/\//))return x.slice(4);if(x.match(/^https?:\/\//))return x}function Pr(x){const[C,R]=x.entry,N=no(R);return(0,u.jsxs)(Kn.Z,{children:[x.indent&&(0,u.jsx)(Ir.Z,{}),(0,u.jsx)(tr,{primary:C,secondary:N?(0,u.jsx)(P.rU,{to:N,children:R}):R})]})}function Vr(x){const C=Wr();return(0,u.jsx)(P.rU,{to:x.to,className:C.helpIcon,children:(0,u.jsx)(Po.Z,{fontSize:"inherit"})})}const Lo=(0,wt.Z)({root:{display:"flex",flexDirection:"column"}});function ro(x){var C,R;const N=(0,h.h_)(H),re=(0,O.eE)(x),de=(C=x.metadata.annotations)===null||C===void 0?void 0:C[O.P1],X=(R=x.metadata.annotations)===null||R===void 0?void 0:R[O.q1],{loading:ye,error:Ee,value:Re}=(0,bt.default)(async()=>!de&&!X?[]:(await N.getEntities({filter:[...de?[{[`metadata.annotations.${O.P1}`]:de}]:[],...X?[{[`metadata.annotations.${O.q1}`]:X}]:[]]})).items,[de,X]);return{loading:ye,error:Ee,location:de,originLocation:X,colocatedEntities:Re==null?void 0:Re.filter(Ze=>(0,O.eE)(Ze)!==re)}}function Sn(x){return(0,u.jsxs)(or.Z,{dense:!0,children:[x.header&&(0,u.jsx)(Pr,{entry:x.header},"header"),x.entities.map(C=>(0,u.jsxs)(Kn.Z,{children:[(0,u.jsx)(Ir.Z,{children:(0,u.jsx)($r,{kind:C.kind})}),(0,u.jsx)(tr,{primary:(0,u.jsx)(te,{entityRef:C})})]},(0,O.eE)(C)))]})}function oo(x){const{entity:C}=x,{loading:R,error:N,location:re,originLocation:de,colocatedEntities:X}=ro(C);if(R)return(0,u.jsx)(P.Ex,{});if(N)return(0,u.jsx)(P.Gk,{error:N});if(!re&&!de)return(0,u.jsx)(Cr.Z,{severity:"warning",children:"Entity had no location information."});if(!(X!=null&&X.length))return(0,u.jsx)(Cr.Z,{severity:"info",children:"There were no other entities on this location."});if(re===de)return(0,u.jsx)(Sn,{entities:X});const ye=X.filter(Re=>{var Ze;return((Ze=Re.metadata.annotations)===null||Ze===void 0?void 0:Ze[O.P1])===re}),Ee=X.filter(Re=>{var Ze;return((Ze=Re.metadata.annotations)===null||Ze===void 0?void 0:Ze[O.q1])===de});return(0,u.jsxs)(u.Fragment,{children:[ye.length>0&&(0,u.jsx)(Sn,{entities:ye,header:["At the same location",re]}),Ee.length>0&&(0,u.jsx)(Sn,{entities:Ee,header:["At the same origin",de]})]})}function so(x){const C=Lo();return(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)(ft.Z,{variant:"h2",children:"Colocated"}),(0,u.jsx)(ft.Z,{children:"These are the entities that are colocated with this entity - as in, they originated from the same data source (e.g. came from the same YAML file), or from the same origin (e.g. the originally registered URL)."}),(0,u.jsx)("div",{className:C.root,children:(0,u.jsx)(oo,{entity:x.entity})})]})}function io(x){return Object.fromEntries([...Object.entries(x)].sort((C,R)=>C[0]<R[0]?-1:1))}function wr(x){return(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)(ft.Z,{variant:"h2",children:"Entity as JSON"}),(0,u.jsx)(ft.Z,{children:"This is the raw entity data as received from the catalog, on JSON form."}),(0,u.jsx)(ft.Z,{children:(0,u.jsx)("div",{style:{fontSize:"75%"},"data-testid":"code-snippet",children:(0,u.jsx)(P.Oi,{text:JSON.stringify(io(x.entity),void 0,2),language:"json",showCopyCodeButton:!0})})})]})}var Oo=r(3440),ao=r.n(Oo);const ko=(0,wt.Z)({root:{display:"flex",flexDirection:"column"}});function lo(x){var C,R;const N=ko(),{apiVersion:re,kind:de,metadata:X,spec:ye,relations:Ee=[],status:Re={}}=x.entity,Ze=ao()(Jt()(Ee,Ne=>Ne.targetRef),"type");return(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)(ft.Z,{variant:"h2",children:"Overview"}),(0,u.jsxs)("div",{className:N.root,children:[(0,u.jsx)(Zr,{title:"Identity",children:(0,u.jsxs)(or.Z,{dense:!0,children:[(0,u.jsx)(Kn.Z,{children:(0,u.jsx)(tr,{primary:"apiVersion",secondary:re})}),(0,u.jsx)(Kn.Z,{children:(0,u.jsx)(tr,{primary:"kind",secondary:de})}),(ye==null?void 0:ye.type)&&(0,u.jsx)(Kn.Z,{children:(0,u.jsx)(tr,{primary:"spec.type",secondary:ye.type})}),X.uid&&(0,u.jsx)(Kn.Z,{children:(0,u.jsx)(tr,{primary:"uid",secondary:X.uid})}),X.etag&&(0,u.jsx)(Kn.Z,{children:(0,u.jsx)(tr,{primary:"etag",secondary:X.etag})})]})}),(0,u.jsxs)(Zr,{title:"Metadata",children:[!!Object.keys(X.annotations||{}).length&&(0,u.jsx)(or.Z,{dense:!0,subheader:(0,u.jsxs)(Dr,{children:["Annotations",(0,u.jsx)(Vr,{to:"https://backstage.io/docs/features/software-catalog/well-known-annotations"})]}),children:Object.entries(X.annotations).map(Ne=>(0,u.jsx)(Pr,{indent:!0,entry:Ne},Ne[0]))}),!!Object.keys(X.labels||{}).length&&(0,u.jsx)(or.Z,{dense:!0,subheader:(0,u.jsx)(Dr,{children:"Labels"}),children:Object.entries(X.labels).map(Ne=>(0,u.jsx)(Pr,{indent:!0,entry:Ne},Ne[0]))}),!!(!((C=X.tags)===null||C===void 0)&&C.length)&&(0,u.jsx)(or.Z,{dense:!0,subheader:(0,u.jsx)(Dr,{children:"Tags"}),children:X.tags.map((Ne,rt)=>(0,u.jsxs)(Kn.Z,{children:[(0,u.jsx)(Ir.Z,{}),(0,u.jsx)(tr,{primary:Ne})]},`${Ne}-${rt}`))})]}),!!Ee.length&&(0,u.jsx)(Zr,{title:"Relations",helpLink:"https://backstage.io/docs/features/software-catalog/well-known-relations",children:Object.entries(Ze).map(([Ne,rt],qe)=>(0,u.jsx)("div",{children:(0,u.jsx)(or.Z,{dense:!0,subheader:(0,u.jsx)(Dr,{children:Ne}),children:rt.map(Ge=>(0,u.jsxs)(Kn.Z,{children:[(0,u.jsx)(Ir.Z,{children:(0,u.jsx)($r,{entityRef:Ge.targetRef})}),(0,u.jsx)(tr,{primary:(0,u.jsx)(te,{entityRef:Ge.targetRef})})]},Ge.targetRef))})},qe))}),!!(!((R=Re.items)===null||R===void 0)&&R.length)&&(0,u.jsx)(Zr,{title:"Status",helpLink:"https://backstage.io/docs/features/software-catalog/well-known-statuses",children:Re.items.map((Ne,rt)=>(0,u.jsxs)("div",{children:[(0,u.jsxs)(w.Z,{children:[Ne.level,": ",Ne.type]}),(0,u.jsx)(I.Z,{ml:2,children:Ne.message})]},rt))})]})]})}var jr=r(72847);function us(x){return(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)(ft.Z,{variant:"h2",children:"Entity as YAML"}),(0,u.jsx)(ft.Z,{children:"This is the raw entity data as received from the catalog, on YAML form."}),(0,u.jsx)(ft.Z,{children:(0,u.jsx)("div",{style:{fontSize:"75%"},"data-testid":"code-snippet",children:(0,u.jsx)(P.Oi,{text:jr.ZP.stringify(io(x.entity)),language:"yaml",showCopyCodeButton:!0})})})]})}const co=(0,wt.Z)(x=>({fullHeightDialog:{height:"calc(100% - 64px)"},root:{display:"flex",flexGrow:1,width:"100%",backgroundColor:x.palette.background.paper},tabs:{borderRight:`1px solid ${x.palette.divider}`,flexShrink:0},tabContents:{flexGrow:1,overflowX:"auto"}}));function hr(x){const{children:C,value:R,index:N,...re}=x,de=co();return(0,u.jsx)("div",{role:"tabpanel",hidden:R!==N,id:`vertical-tabpanel-${N}`,"aria-labelledby":`vertical-tab-${N}`,className:de.tabContents,...re,children:R===N&&(0,u.jsx)(I.Z,{pl:3,pr:3,children:C})})}function Lr(x){return{id:`vertical-tab-${x}`,"aria-controls":`vertical-tabpanel-${x}`}}function Bo(x){const C=co(),[R,N]=B.useState(0);return(0,B.useEffect)(()=>{N(0)},[x.open]),x.entity?(0,u.jsxs)(E.Z,{fullWidth:!0,maxWidth:"xl",open:x.open,onClose:x.onClose,"aria-labelledby":"entity-inspector-dialog-title",PaperProps:{className:C.fullHeightDialog},children:[(0,u.jsx)(Q.Z,{id:"entity-inspector-dialog-title",children:"Entity Inspector"}),(0,u.jsx)(be.Z,{dividers:!0,children:(0,u.jsxs)("div",{className:C.root,children:[(0,u.jsxs)(je.Z,{orientation:"vertical",variant:"scrollable",value:R,onChange:(re,de)=>N(de),"aria-label":"Inspector options",className:C.tabs,children:[(0,u.jsx)(ke.Z,{label:"Overview",...Lr(0)}),(0,u.jsx)(ke.Z,{label:"Ancestry",...Lr(1)}),(0,u.jsx)(ke.Z,{label:"Colocated",...Lr(2)}),(0,u.jsx)(ke.Z,{label:"Raw JSON",...Lr(3)}),(0,u.jsx)(ke.Z,{label:"Raw YAML",...Lr(4)})]}),(0,u.jsx)(hr,{value:R,index:0,children:(0,u.jsx)(lo,{entity:x.entity})}),(0,u.jsx)(hr,{value:R,index:1,children:(0,u.jsx)(Rr,{entity:x.entity})}),(0,u.jsx)(hr,{value:R,index:2,children:(0,u.jsx)(so,{entity:x.entity})}),(0,u.jsx)(hr,{value:R,index:3,children:(0,u.jsx)(wr,{entity:x.entity})}),(0,u.jsx)(hr,{value:R,index:4,children:(0,u.jsx)(us,{entity:x.entity})})]})}),(0,u.jsx)(ht.Z,{children:(0,u.jsx)(V.Z,{onClick:x.onClose,color:"primary",children:"Close"})})]}):null}var Yn=r(85256);function Gs(x){var C;const R=(0,h.h_)(H),N=(C=x.metadata.annotations)===null||C===void 0?void 0:C[O.q1],re=x.metadata.uid,de=N==="bootstrap:bootstrap",X=(0,bt.default)(async()=>{const Ge=R.getLocationByRef(N);let Be;if(!N)Be=Promise.resolve([]);else{const Je=`metadata.annotations.${O.q1}`;Be=R.getEntities({filter:{[Je]:N},fields:["kind","metadata.uid","metadata.name","metadata.namespace"]}).then(At=>At.items)}return Promise.all([Ge,Be]).then(([Je,At])=>({location:Je,colocatedEntities:At}))},[R,x]),ye=(0,B.useCallback)(async function(){const{location:Be}=X.value;await R.removeLocationById(Be.id)},[R,X]),Ee=(0,B.useCallback)(async function(){await R.removeEntityByUid(re)},[R,re]);if(de)return{type:"bootstrap",location:N,deleteEntity:Ee};const{loading:Re,error:Ze,value:Ne}=X;if(Re)return{type:"loading"};if(Ze)return{type:"error",error:Ze};const{location:rt,colocatedEntities:qe}=Ne;return rt?{type:"unregister",location:N,colocatedEntities:qe.map(O.iB),unregisterLocation:ye,deleteEntity:Ee}:{type:"only-delete",deleteEntity:Ee}}var $o=r(23054);const hs=(0,wt.Z)({advancedButton:{fontSize:"0.7em"},dialogActions:{display:"inline-block"}}),ps=({entity:x,onConfirm:C,onClose:R})=>{const N=(0,h.h_)(h.$v),re=(0,h.h_)(h.Ds),de=hs(),X=Gs(x),[ye,Ee]=(0,B.useState)(!1),[Re,Ze]=(0,B.useState)(!1);var Ne;const rt=(Ne=re.getOptionalString("app.title"))!==null&&Ne!==void 0?Ne:"Backstage",qe=(0,B.useCallback)(async function(){if("unregisterLocation"in X){Ze(!0);try{await X.unregisterLocation(),C()}catch(At){(0,$o.BD)(At),N.post({message:At.message})}finally{Ze(!1)}}},[N,C,X]),Ge=(0,B.useCallback)(async function(){if("deleteEntity"in X){Ze(!0);try{await X.deleteEntity(),C()}catch(At){(0,$o.BD)(At),N.post({message:At.message})}finally{Ze(!1)}}},[N,C,X]),Be=()=>(0,u.jsx)(ht.Z,{className:de.dialogActions,children:(0,u.jsx)(V.Z,{onClick:R,color:"primary",children:"Cancel"})});return X.type==="loading"?(0,u.jsx)(P.Ex,{}):X.type==="error"?(0,u.jsx)(P.Gk,{error:X.error}):X.type==="bootstrap"?(0,u.jsxs)(u.Fragment,{children:[(0,u.jsxs)(Cr.Z,{severity:"info",children:['You cannot unregister this entity, since it originates from a protected Backstage configuration (location "',X.location,'"). If you believe this is in error, please contact the ',rt," ","integrator."]}),(0,u.jsxs)(I.Z,{marginTop:2,children:[!ye&&(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)(V.Z,{variant:"text",size:"small",color:"primary",className:de.advancedButton,onClick:()=>Ee(!0),children:"Advanced Options"}),(0,u.jsx)(Be,{})]}),ye&&(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)(ft.Z,{children:"You have the option to delete the entity itself from the catalog. Note that this should only be done if you know that the catalog file has been deleted at, or moved from, its origin location. If that is not the case, the entity will reappear shortly as the next refresh round is performed by the catalog."}),(0,u.jsx)(V.Z,{variant:"contained",color:"secondary",disabled:Re,onClick:Ge,children:"Delete Entity"}),(0,u.jsx)(Be,{})]})]})]}):X.type==="only-delete"?(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)(ft.Z,{children:"This entity does not seem to originate from a registered location. You therefore only have the option to delete it outright from the catalog."}),(0,u.jsx)(V.Z,{variant:"contained",color:"secondary",disabled:Re,onClick:Ge,children:"Delete Entity"}),(0,u.jsx)(Be,{})]}):X.type==="unregister"?(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)(ft.Z,{children:"This action will unregister the following entities:"}),(0,u.jsx)(ft.Z,{component:"ul",children:X.colocatedEntities.map(Je=>(0,u.jsx)("li",{children:(0,u.jsx)(te,{entityRef:Je})},`${Je.kind}:${Je.namespace}/${Je.name}`))}),(0,u.jsx)(ft.Z,{children:"Located at the following location:"}),(0,u.jsx)(ft.Z,{component:"ul",children:(0,u.jsx)("li",{children:X.location})}),(0,u.jsxs)(ft.Z,{children:["To undo, just re-register the entity in ",rt,"."]}),(0,u.jsxs)(I.Z,{marginTop:2,children:[(0,u.jsx)(V.Z,{variant:"contained",color:"secondary",disabled:Re,onClick:qe,children:"Unregister Location"}),!ye&&(0,u.jsx)(I.Z,{component:"span",marginLeft:2,children:(0,u.jsx)(V.Z,{variant:"text",size:"small",color:"primary",className:de.advancedButton,onClick:()=>Ee(!0),children:"Advanced Options"})})]}),ye&&(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)(I.Z,{paddingTop:4,paddingBottom:4,children:(0,u.jsx)(Yn.Z,{})}),(0,u.jsx)(ft.Z,{children:"You also have the option to delete the entity itself from the catalog. Note that this should only be done if you know that the catalog file has been deleted at, or moved from, its origin location. If that is not the case, the entity will reappear shortly as the next refresh round is performed by the catalog."}),(0,u.jsx)(V.Z,{variant:"contained",color:"secondary",disabled:Re,onClick:Ge,children:"Delete Entity"})]})]}):(0,u.jsx)(Cr.Z,{severity:"error",children:"Internal error: Unknown state"})},uo=x=>{const{open:C,onConfirm:R,onClose:N,entity:re}=x;return(0,u.jsxs)(E.Z,{open:C,onClose:N,children:[(0,u.jsx)(Q.Z,{id:"responsive-dialog-title",children:"Are you sure you want to unregister this entity?"}),(0,u.jsx)(be.Z,{children:(0,u.jsx)(ps,{entity:re,onConfirm:R,onClose:N})})]})};var fs=r(12231),gs=r(9520),sr=r(47603);const Do=(0,wt.Z)(x=>({root:{backgroundColor:"rgba(0, 0, 0, .11)",boxShadow:"none",margin:x.spacing(1,0,1,0)},title:{margin:x.spacing(1,0,0,1),textTransform:"uppercase",fontSize:12,fontWeight:"bold"},listIcon:{minWidth:30,color:x.palette.text.primary},menuItem:{minHeight:x.spacing(6)},groupWrapper:{margin:x.spacing(1,1,2,1)}}),{name:"CatalogReactUserListPicker"});function Wn(x){return[{name:"Personal",items:[{id:"owned",label:"Owned",icon:sr.Z},{id:"starred",label:"Starred",icon:er.Z}]},{name:x!=null?x:"Company",items:[{id:"all",label:"All"}]}]}const ho=x=>{const{initialFilter:C,availableFilters:R}=x,N=Do(),re=(0,h.h_)(h.Ds);var de;const X=(de=re.getOptionalString("organization.name"))!==null&&de!==void 0?de:"Company",{filters:ye,updateFilters:Ee,backendEntities:Re,queryParameters:{kind:Ze,user:Ne},loading:rt}=mt(),qe=["starred","all"],Ge=Wn(X).map(In=>({...In,items:In.items.filter(({id:Vn})=>["group","user"].some(Or=>Or===Ze)?qe.includes(Vn):!R||R.includes(Vn))})).filter(({items:In})=>!!In.length),{isStarredEntity:Be}=Pn(),{isOwnedEntity:Je,loading:At}=tn(),cn=rt||At,qt=(0,B.useMemo)(()=>new Qe("owned",Je,Be),[Je,Be]),on=(0,B.useMemo)(()=>new Qe("starred",Je,Be),[Je,Be]),nn=(0,B.useMemo)(()=>[Ne].flat()[0],[Ne]),[An,Rn]=(0,B.useState)(nn!=null?nn:C),Er=(0,B.useMemo)(()=>Re.filter((0,oe.Gz)((0,lt.compact)(Object.values({...ye,user:void 0})))),[ye,Re]),Nr=(0,B.useMemo)(()=>({all:Er.length,starred:Er.filter(In=>on.filterEntity(In)).length,owned:Er.filter(In=>qt.filterEntity(In)).length}),[Er,on,qt]);(0,B.useEffect)(()=>{nn&&Rn(nn)},[nn]),(0,B.useEffect)(()=>{!cn&&An&&An!=="all"&&Nr[An]===0&&Rn("all")},[cn,Nr,An,Rn]),(0,B.useEffect)(()=>{Ee({user:An?new Qe(An,Je,Be):void 0})},[An,Je,Be,Ee]);var Gr;return(0,u.jsx)(to.Z,{className:N.root,children:Ge.map(In=>(0,u.jsxs)(B.Fragment,{children:[(0,u.jsx)(w.Z,{variant:"subtitle2",component:"span",className:N.title,children:In.name}),(0,u.jsx)(to.Z,{className:N.groupWrapper,children:(0,u.jsx)(or.Z,{disablePadding:!0,dense:!0,role:"menu","aria-label":In.name,children:In.items.map(Vn=>{var Or;return(0,u.jsxs)(fs.Z,{role:"none presentation",button:!0,divider:!0,onClick:()=>Rn(Vn.id),selected:Vn.id===((Or=ye.user)===null||Or===void 0?void 0:Or.value),className:N.menuItem,disabled:Nr[Vn.id]===0,"data-testid":`user-picker-${Vn.id}`,tabIndex:0,ContainerProps:{role:"menuitem"},children:[Vn.icon&&(0,u.jsx)(Ir.Z,{className:N.listIcon,children:(0,u.jsx)(Vn.icon,{fontSize:"small"})}),(0,u.jsx)(To.Z,{children:(0,u.jsxs)(w.Z,{variant:"body1",children:[Vn.label," "]})}),(0,u.jsx)(gs.Z,{children:(Gr=Nr[Vn.id])!==null&&Gr!==void 0?Gr:"-"})]},Vn.id)})})})]},In.name))})},Zo=(0,wt.Z)({input:{}},{name:"CatalogReactEntityProcessingStatusPickerPicker"}),Hr=(0,u.jsx)(jn.Z,{fontSize:"small"}),No=(0,u.jsx)(hn.Z,{fontSize:"small"}),Fo=()=>{const x=Zo(),{updateFilters:C}=mt(),[R,N]=(0,B.useState)([]);function re(ye){C({orphan:ye?new St(ye):void 0})}function de(ye){C({error:ye?new It(ye):void 0})}const X=["Is Orphan","Has Error"];return(0,u.jsx)(I.Z,{pb:1,pt:1,children:(0,u.jsxs)(w.Z,{variant:"button",component:"label",children:["Processing Status",(0,u.jsx)(Tn.ZP,{multiple:!0,disableCloseOnSelect:!0,options:X,value:R,onChange:(ye,Ee)=>{N(Ee),re(Ee.includes("Is Orphan")),de(Ee.includes("Has Error"))},renderOption:(ye,{selected:Ee})=>(0,u.jsx)(ct.Z,{control:(0,u.jsx)(vn.Z,{icon:Hr,checkedIcon:No,checked:Ee}),onClick:Re=>Re.preventDefault(),label:ye}),size:"small",popupIcon:(0,u.jsx)(ln.Z,{"data-testid":"processing-status-picker-expand"}),renderInput:ye=>(0,u.jsx)(Kt.Z,{...ye,className:x.input,variant:"outlined"})})]})})},ms=(0,wt.Z)({input:{}},{name:"CatalogReactEntityNamespacePicker"}),Uo=()=>{const x=ms();return(0,u.jsx)(bn,{label:"Namespace",name:"namespace",path:"metadata.namespace",Filter:st,InputProps:{className:x.input}})};function po(x){const{children:C,value:R}=x;var N;const[re,de]=useState((N=R==null?void 0:R.filters)!==null&&N!==void 0?N:{}),X=useCallback(Ge=>{de(Be=>{const Je=typeof Ge=="function"?Ge(Be):Ge;return{...Be,...Je}})},[]),ye=useMemo(()=>({entities:[],backendEntities:[],queryParameters:{}}),[]);var Ee,Re,Ze,Ne,rt;const qe=useMemo(()=>({entities:(Ee=R==null?void 0:R.entities)!==null&&Ee!==void 0?Ee:ye.entities,backendEntities:(Re=R==null?void 0:R.backendEntities)!==null&&Re!==void 0?Re:ye.backendEntities,updateFilters:(Ze=R==null?void 0:R.updateFilters)!==null&&Ze!==void 0?Ze:X,filters:re,loading:(Ne=R==null?void 0:R.loading)!==null&&Ne!==void 0?Ne:!1,queryParameters:(rt=R==null?void 0:R.queryParameters)!==null&&rt!==void 0?rt:ye.queryParameters,error:R==null?void 0:R.error}),[R,ye,re,X]);return _jsx(EntityListContext.Provider,{value:qe,children:C})}},75435:function(Ct,$e,r){"use strict";r.d($e,{h:function(){return h}});var t=r(25271);function h(H,f,W){var g;let u=(H==null||(g=H.relations)===null||g===void 0?void 0:g.filter(B=>B.type===f).map(B=>(0,t.of)(B.targetRef)))||[];return W!=null&&W.kind&&(u=u.filter(B=>B.kind.toLocaleLowerCase("en-US")===W.kind.toLocaleLowerCase("en-US"))),u}},49280:function(Ct,$e,r){"use strict";r.d($e,{hF:function(){return H.h},CV:function(){return W},wq:function(){return t},Gz:function(){return h}});function t(u){return u.reduce((B,ve)=>({...B,...ve.getCatalogFilters?ve.getCatalogFilters():{}}),{})}function h(u){return B=>u.every(ve=>!ve.filterEntity||ve.filterEntity(B))}var H=r(75435),f=r(25271);function W(u,B){var ve;const ue=(ve=u.metadata.annotations)===null||ve===void 0?void 0:ve[f.M6];if(ue)try{const V=(0,f.Ou)(ue),K=B.byUrl(V.target);return{locationTargetUrl:V.target,integrationType:K==null?void 0:K.type}}catch{return}}function g(u,B){const ve=new Set([...getEntityRelations(u,RELATION_MEMBER_OF,{kind:"group"}),...u?[getCompoundEntityRef(u)]:[]].map(stringifyEntityRef)),ue=getEntityRelations(B,RELATION_OWNED_BY).map(stringifyEntityRef);for(const V of ue)if(ve.has(V))return!0;return!1}},33414:function(Ct,$e,r){"use strict";r.r($e),r.d($e,{AboutCard:function(){return ot},AboutContent:function(){return z},AboutField:function(){return O}});var t=r(52322),h=r(25271),H=r(53974),f=r(60871),W=r(32838),g=r(43514),u=r(79692),B=r(94339),ve=r(32552),ue=r(61837),V=r(85256),K=r(24579),I=r(52866),w=r(30254),ie=r(27604),ee=r(2784),ne=r(19625),$=r(60905),T=r(7089),P=r(90436);const L=(0,u.Z)(He=>({value:{fontWeight:"bold",overflow:"hidden",lineHeight:"24px",wordBreak:"break-word"},label:{color:He.palette.text.secondary,textTransform:"uppercase",fontSize:"10px",fontWeight:"bold",letterSpacing:.5,overflow:"hidden",whiteSpace:"nowrap"}}));function O(He){const{label:st,value:Qe,gridSizes:St,children:It}=He,xt=L(),lt=(0,f.vJ)(It,Nt=>Nt.getElements()),Pt=lt.length>0?lt:(0,t.jsx)(P.Z,{variant:"body2",className:xt.value,children:Qe||"unknown"});return(0,t.jsxs)($.Z,{item:!0,...St,children:[(0,t.jsx)(P.Z,{variant:"h2",className:xt.label,children:st}),Pt]})}var oe=r(24851);const Le=(0,u.Z)({description:{wordBreak:"break-word"}});function ze(He,st,Qe){if(st==="url"||He.includes("://"))return He;const St=Qe.type==="file"?`file://${Qe.target}`:Qe.target;return st==="file"||Qe.type==="file"?new URL(He,St).href:St}function z(He){var st,Qe,St,It,xt,lt,Pt,Nt;const{entity:We}=He,_t=Le(),ge=We.kind.toLocaleLowerCase("en-US")==="system",Se=We.kind.toLocaleLowerCase("en-US")==="resource",Fe=We.kind.toLocaleLowerCase("en-US")==="component",tt=We.kind.toLocaleLowerCase("en-US")==="api",mt=We.kind.toLocaleLowerCase("en-US")==="template",bt=We.kind.toLocaleLowerCase("en-US")==="location",pt=We.kind.toLocaleLowerCase("en-US")==="group",Ot=(0,g.hF)(We,h.cz,{kind:"system"}),Ht=(0,g.hF)(We,h.cz,{kind:"component"}),Jt=(0,g.hF)(We,h.cz,{kind:"domain"}),Bt=(0,g.hF)(We,h.S4);let un;try{un=(0,h.CV)(We)}catch{un=void 0}return(0,t.jsxs)($.Z,{container:!0,children:[(0,t.jsx)(O,{label:"Description",gridSizes:{xs:12},children:(0,t.jsx)(H.SA,{className:_t.description,content:(We==null||(st=We.metadata)===null||st===void 0?void 0:st.description)||"No description"})}),(0,t.jsx)(O,{label:"Owner",value:"No Owner",gridSizes:{xs:12,sm:6,lg:4},children:Bt.length>0&&(0,t.jsx)(g.rI,{entityRefs:Bt,defaultKind:"group"})}),(ge||Jt.length>0)&&(0,t.jsx)(O,{label:"Domain",value:"No Domain",gridSizes:{xs:12,sm:6,lg:4},children:Jt.length>0&&(0,t.jsx)(g.rI,{entityRefs:Jt,defaultKind:"domain"})}),(tt||Fe||Se||Ot.length>0)&&(0,t.jsx)(O,{label:"System",value:"No System",gridSizes:{xs:12,sm:6,lg:4},children:Ot.length>0&&(0,t.jsx)(g.rI,{entityRefs:Ot,defaultKind:"system"})}),Fe&&Ht.length>0&&(0,t.jsx)(O,{label:"Parent Component",value:"No Parent Component",gridSizes:{xs:12,sm:6,lg:4},children:(0,t.jsx)(g.rI,{entityRefs:Ht,defaultKind:"component"})}),(tt||Fe||Se||mt||pt||bt||typeof(We==null||(Qe=We.spec)===null||Qe===void 0?void 0:Qe.type)=="string")&&(0,t.jsx)(O,{label:"Type",value:We==null||(St=We.spec)===null||St===void 0?void 0:St.type,gridSizes:{xs:12,sm:6,lg:4}}),(tt||Fe||typeof(We==null||(It=We.spec)===null||It===void 0?void 0:It.lifecycle)=="string")&&(0,t.jsx)(O,{label:"Lifecycle",value:We==null||(xt=We.spec)===null||xt===void 0?void 0:xt.lifecycle,gridSizes:{xs:12,sm:6,lg:4}}),(0,t.jsx)(O,{label:"Tags",value:"No Tags",gridSizes:{xs:12,sm:6,lg:4},children:((We==null||(lt=We.metadata)===null||lt===void 0?void 0:lt.tags)||[]).map(Yt=>(0,t.jsx)(T.Z,{size:"small",label:Yt},Yt))}),bt&&((We==null||(Pt=We.spec)===null||Pt===void 0?void 0:Pt.targets)||(We==null||(Nt=We.spec)===null||Nt===void 0?void 0:Nt.target))&&(0,t.jsx)(O,{label:"Targets",gridSizes:{xs:12},children:(0,t.jsx)(oe.s,{cols:1,items:(We.spec.targets||[We.spec.target]).map(Yt=>Yt).map(Yt=>{var pn;return{text:Yt,href:ze(Yt,(We==null||(pn=We.spec)===null||pn===void 0?void 0:pn.type)||"unknown",un)}})})})]})}const yt=(0,u.Z)({gridItemCard:{display:"flex",flexDirection:"column",height:"calc(100% - 10px)",marginBottom:"10px"},fullHeightCard:{display:"flex",flexDirection:"column",height:"100%"},gridItemCardContent:{flex:1},fullHeightCardContent:{flex:1}});function ot(He){var st,Qe,St;const{variant:It}=He,xt=yt(),{entity:lt}=(0,g.X2)(),Pt=(0,f.h_)(W.q3),Nt=(0,f.h_)(g.Ah),We=(0,f.h_)(f.$v),_t=(0,f.h_)(f.VE),ge=(0,f.tg)(ne.jU),Se=(0,g.CV)(lt,Pt),Fe=(st=lt.metadata.annotations)===null||st===void 0?void 0:st[h.Tf],tt={label:"View Source",disabled:!Se,icon:(0,t.jsx)(W.nW,{type:Se==null?void 0:Se.integrationType}),href:Se==null?void 0:Se.locationTargetUrl},mt={label:"View TechDocs",disabled:!(!((Qe=lt.metadata.annotations)===null||Qe===void 0)&&Qe["backstage.io/techdocs-ref"])||!ge,icon:(0,t.jsx)(w.Z,{}),href:ge&&ge({namespace:lt.metadata.namespace||h.zG,kind:lt.kind,name:lt.metadata.name})};let bt="";It==="gridItem"?bt=xt.gridItemCard:It==="fullHeight"&&(bt=xt.fullHeightCard);let pt="";It==="gridItem"?pt=xt.gridItemCardContent:It==="fullHeight"&&(pt=xt.fullHeightCardContent);const Ot=(St=lt.metadata.annotations)===null||St===void 0?void 0:St[h.P1],Ht=(Ot==null?void 0:Ot.startsWith("url:"))||(Ot==null?void 0:Ot.startsWith("file:")),Jt=(0,ee.useCallback)(async()=>{try{await Nt.refreshEntity((0,h.eE)(lt)),We.post({message:"Refresh scheduled",severity:"info"})}catch(Bt){_t.post(Bt)}},[Nt,We,_t,lt]);return(0,t.jsxs)(B.Z,{className:bt,children:[(0,t.jsx)(ve.Z,{title:"About",action:(0,t.jsxs)(t.Fragment,{children:[Ht&&(0,t.jsx)(ue.Z,{"aria-label":"Refresh",title:"Schedule entity refresh",onClick:Jt,children:(0,t.jsx)(I.Z,{})}),(0,t.jsx)(ue.Z,{component:H.rU,"aria-label":"Edit",disabled:!Fe,title:"Edit Metadata",to:Fe!=null?Fe:"#",children:(0,t.jsx)(ie.Z,{})})]}),subheader:(0,t.jsx)(H.M6,{links:[tt,mt]})}),(0,t.jsx)(V.Z,{}),(0,t.jsx)(K.Z,{className:pt,children:(0,t.jsx)(z,{entity:lt})})]})}},86359:function(Ct,$e,r){"use strict";r.d($e,{E:function(){return ne}});var t=r(52322),h=r(25271),H=r(53974),f=r(43514),W=r(90436),g=r(15459),u=r(27604),B=r(2997),ve=r(11640),ue=r(28347),V=r(76635),K=r(2784),I=r(7089);const w=Object.freeze({createNameColumn($){function T(P){var L;return((L=P.metadata)===null||L===void 0?void 0:L.title)||(0,f.$3)(P,{defaultKind:$==null?void 0:$.defaultKind})}return{title:"Name",field:"resolved.name",highlight:!0,customSort({entity:P},{entity:L}){return T(P).localeCompare(T(L))},render:({entity:P})=>{var L;return(0,t.jsx)(f.dx,{entityRef:P,defaultKind:($==null?void 0:$.defaultKind)||"Component",title:(L=P.metadata)===null||L===void 0?void 0:L.title})}}},createSystemColumn(){return{title:"System",field:"resolved.partOfSystemRelationTitle",render:({resolved:$})=>(0,t.jsx)(f.rI,{entityRefs:$.partOfSystemRelations,defaultKind:"system"})}},createOwnerColumn(){return{title:"Owner",field:"resolved.ownedByRelationsTitle",render:({resolved:$})=>(0,t.jsx)(f.rI,{entityRefs:$.ownedByRelations,defaultKind:"group"})}},createSpecTargetsColumn(){return{title:"Targets",field:"entity.spec.targets",render:({entity:$})=>{var T,P;return(0,t.jsx)(t.Fragment,{children:(($==null||(T=$.spec)===null||T===void 0?void 0:T.targets)||($==null||(P=$.spec)===null||P===void 0?void 0:P.target))&&(0,t.jsx)(H.Or,{text:($.spec.targets||[$.spec.target]).join(", "),placement:"bottom-start"})})}}},createSpecTypeColumn(){return{title:"Type",field:"entity.spec.type",hidden:!0,width:"auto"}},createSpecLifecycleColumn(){return{title:"Lifecycle",field:"entity.spec.lifecycle"}},createMetadataDescriptionColumn(){return{title:"Description",field:"entity.metadata.description",render:({entity:$})=>(0,t.jsx)(H.Or,{text:$.metadata.description,placement:"bottom-start"}),width:"auto"}},createTagsColumn(){return{title:"Tags",field:"entity.metadata.tags",cellStyle:{padding:"0px 16px 0px 20px"},render:({entity:$})=>(0,t.jsx)(t.Fragment,{children:$.metadata.tags&&$.metadata.tags.map(T=>(0,t.jsx)(I.Z,{label:T,size:"small",variant:"outlined",style:{marginBottom:"0px"}},T))}),width:"auto"}},createTitleColumn($){return{title:"Title",field:"entity.metadata.title",hidden:$==null?void 0:$.hidden,searchable:!0}},createLabelColumn($,T){return{title:(T==null?void 0:T.title)||"Label",field:"entity.metadata.labels",cellStyle:{padding:"0px 16px 0px 20px"},render:({entity:P})=>{var L;const O=(L=P.metadata)===null||L===void 0?void 0:L.labels,oe=O&&O[$]||(T==null?void 0:T.defaultValue);return(0,t.jsx)(t.Fragment,{children:oe&&(0,t.jsx)(I.Z,{label:oe,size:"small",variant:"outlined"},oe)})},width:"auto"}},createNamespaceColumn(){return{title:"Namespace",field:"entity.metadata.namespace",width:"auto"}}}),ie=(0,g.Z)({root:{color:"#f3ba37"}})(ve.Z),ee=($,T)=>{const P=L=>L.metadata.title||(0,f.$3)(L,{defaultKind:"Component"});return P($).localeCompare(P(T))},ne=$=>{var T,P;const{columns:L,actions:O,tableOptions:oe,subtitle:Le,emptyContent:ze}=$,{isStarredEntity:z,toggleStarredEntity:yt}=(0,f.CR)(),{loading:ot,error:He,entities:st,filters:Qe}=(0,f.wp)(),St=(0,K.useMemo)(()=>{var ge;return[w.createTitleColumn({hidden:!0}),w.createNameColumn({defaultKind:(ge=Qe.kind)===null||ge===void 0?void 0:ge.value}),...Se(),w.createMetadataDescriptionColumn(),w.createTagsColumn()];function Se(){var Fe;const tt=[w.createSystemColumn(),w.createOwnerColumn(),w.createSpecTypeColumn(),w.createSpecLifecycleColumn()];switch((Fe=Qe.kind)===null||Fe===void 0?void 0:Fe.value){case"user":return[];case"domain":case"system":return[w.createOwnerColumn()];case"group":case"template":return[w.createSpecTypeColumn()];case"location":return[w.createSpecTypeColumn(),w.createSpecTargetsColumn()];default:return st.every(mt=>mt.metadata.namespace==="default")?tt:[...tt,w.createNamespaceColumn()]}}},[(T=Qe.kind)===null||T===void 0?void 0:T.value,st]),It=Qe.type===void 0;var xt;const lt=(0,V.capitalize)((xt=(P=Qe.user)===null||P===void 0?void 0:P.value)!==null&&xt!==void 0?xt:"all");if(He)return(0,t.jsx)("div",{children:(0,t.jsx)(H.GB,{severity:"error",title:"Could not fetch catalog entities.",children:(0,t.jsx)(H.Oi,{language:"text",text:He.toString()})})});const Pt=[({entity:ge})=>{var Se;const Fe=(Se=ge.metadata.annotations)===null||Se===void 0?void 0:Se[h.l2],tt="View";return{icon:()=>(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(W.Z,{variant:"srOnly",children:tt}),(0,t.jsx)(B.Z,{fontSize:"small"})]}),tooltip:tt,disabled:!Fe,onClick:()=>{Fe&&window.open(Fe,"_blank")}}},({entity:ge})=>{var Se;const Fe=(Se=ge.metadata.annotations)===null||Se===void 0?void 0:Se[h.Tf],tt="Edit";return{icon:()=>(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(W.Z,{variant:"srOnly",children:tt}),(0,t.jsx)(u.Z,{fontSize:"small"})]}),tooltip:tt,disabled:!Fe,onClick:()=>{Fe&&window.open(Fe,"_blank")}}},({entity:ge})=>{const Se=z(ge),Fe=Se?"Remove from favorites":"Add to favorites";return{cellStyle:{paddingLeft:"1em"},icon:()=>(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(W.Z,{variant:"srOnly",children:Fe}),Se?(0,t.jsx)(ie,{}):(0,t.jsx)(ue.Z,{})]}),tooltip:Fe,onClick:()=>yt(ge)}}],Nt=st.sort(ee).map(ge=>{const Se=(0,f.hF)(ge,h.cz,{kind:"system"}),Fe=(0,f.hF)(ge,h.S4);return{entity:ge,resolved:{name:(0,f.$3)(ge,{defaultKind:"Component"}),ownedByRelationsTitle:Fe.map(tt=>(0,f.$3)(tt,{defaultKind:"group"})).join(", "),ownedByRelations:Fe,partOfSystemRelationTitle:Se.map(tt=>(0,f.$3)(tt,{defaultKind:"system"})).join(", "),partOfSystemRelations:Se}}}),We=(L||St).find(ge=>ge.title==="Type");We&&(We.hidden=!It);const _t=Nt.length>20;return(0,t.jsx)(H.iA,{isLoading:ot,columns:L||St,options:{paging:_t,pageSize:20,actionsColumnIndex:-1,loadingType:"linear",showEmptyDataSourceMessage:!ot,padding:"dense",pageSizeOptions:[20,50,100],...oe},title:`${lt} (${st.length})`,data:Nt,actions:O||Pt,subtitle:Le,emptyContent:ze})};ne.columns=w},85877:function(Ct,$e,r){"use strict";r.r($e),r.d($e,{EntityLabelsCard:function(){return K},hasLabels:function(){return I}});var t=r(52322),h=r(43514),H=r(2784),f=r(53974),W=r(79692),g=r(90436),u=r(77277);const B=`metadata:
|
|
33
|
+
`)},this.appClient=new q.v({baseUrl:b,headers:Ae,authStrategy:Z.i,auth:this.baseAuthConfig})}}class jt{async getAllInstallations(){return this.apps.length?(await Promise.all(this.apps.map(b=>b.getInstallations()))).flat():[]}async getAppToken(c,b){if(this.apps.length===0)return;const E=await Promise.all(this.apps.map(ke=>ke.getInstallationCredentials(c,b).then(ht=>({credentials:ht,error:void 0}),ht=>({credentials:void 0,error:ht})))),Q=E.find(ke=>{var ht;return(ht=ke.credentials)===null||ht===void 0?void 0:ht.accessToken});if(Q)return Q.credentials.accessToken;const je=E.map(ke=>ke.error).find(ke=>(ke==null?void 0:ke.name)!=="NotFoundError");if(je)throw je}constructor(c){var b;(0,t._)(this,"apps",void 0);var E;this.apps=(E=(b=c.apps)===null||b===void 0?void 0:b.map(Q=>new Ye(Q,c.apiBaseUrl)))!==null&&E!==void 0?E:[]}}class vt{async getCredentials(c){const b=H()(c.url),E=b.owner||b.name,Q=b.owner?b.name:void 0;let be="app",je=await this.githubAppCredentialsMux.getAppToken(E,Q);return je||(be="token",je=this.token),{headers:je?{Authorization:`Bearer ${je}`}:void 0,token:je,type:be}}constructor(c,b){(0,t._)(this,"githubAppCredentialsMux",void 0),(0,t._)(this,"token",void 0),this.githubAppCredentialsMux=c,this.token=b}}(0,t._)(vt,"create",S=>new vt(new jt(S),S.token));class nt{static fromIntegrations(c){const b=new Map;return c.github.list().forEach(E=>{const Q=SingleInstanceGithubCredentialsProvider.create(E.config);b.set(E.config.host,Q)}),new nt(b)}async getCredentials(c){const b=new URL(c.url),E=this.providers.get(b.host);if(!E)throw new Error(`There is no GitHub integration that matches ${c.url}. Please add a configuration for an integration.`);return E.getCredentials(c)}constructor(c){_define_property(this,"providers",void 0),this.providers=c}}class Ke{get type(){return"github"}get title(){return this.integrationConfig.host}get config(){return this.integrationConfig}resolveUrl(c){return dt(B(c),"tree")}resolveEditUrl(c){return dt(c,"edit")}constructor(c){(0,t._)(this,"integrationConfig",void 0),this.integrationConfig=c}}(0,t._)(Ke,"factory",({config:S})=>{var c;const b=te((c=S.getOptionalConfigArray("integrations.github"))!==null&&c!==void 0?c:[]);return u(b.map(E=>new Ke(E)),E=>E.config.host)});function dt(S,c){return S.replace(/\/\/([^/]+)\/([^/]+)\/([^/]+)\/(blob|tree|edit)\//,(b,E,Q,be)=>`//${E}/${Q}/${be}/${c}/`)}const at=null;class Dt extends Ke{get config(){return super.config}constructor(c){super(c)}}(0,t._)(Dt,"factory",Ke.factory);const Mt=null,Xt=null,en=null,Ut="gitlab.com",zt="https://gitlab.com/api/v4";function Et(S){const c=S.getString("host");let b=S.getOptionalString("apiBaseUrl");const E=S.getOptionalString("token");let Q=S.getOptionalString("baseUrl");if(b?b=(0,f.trimEnd)(b,"/"):c===Ut&&(b=zt),Q?Q=(0,f.trimEnd)(Q,"/"):Q=`https://${c}`,W(c)){if(!b||!g(b))throw new Error(`Invalid GitLab integration config, '${b}' is not a valid apiBaseUrl`);if(!g(Q))throw new Error(`Invalid GitLab integration config, '${Q}' is not a valid baseUrl`)}else throw new Error(`Invalid GitLab integration config, '${c}' is not a valid host`);return{host:c,token:E,apiBaseUrl:b,baseUrl:Q}}function Lt(S){const c=S.map(Et);return c.some(b=>b.host===Ut)||c.push({host:Ut,apiBaseUrl:zt,baseUrl:`https://${Ut}`}),c}function Zt(S){let c="";return S.host!==Ut&&(c=new URL(S.baseUrl).pathname),trimEnd(c,"/")}async function bn(S,c){const b=await ur(S,c);return Gn(S,b,c).toString()}function zn(S){const{token:c=""}=S;return{headers:{"PRIVATE-TOKEN":c}}}function Gn(S,c,b){try{const E=new URL(S),Q=E.pathname.split("/blob/").slice(1).join("/blob/"),[be,...je]=Q.split("/"),ke=getGitLabIntegrationRelativePath(b);return E.pathname=[...ke?[ke]:[],"api/v4/projects",c,"repository/files",encodeURIComponent(decodeURIComponent(je.join("/"))),"raw"].join("/"),E.search=`?ref=${be}`,E}catch(E){throw new Error(`Incorrect url: ${S}, ${E}`)}}async function ur(S,c){const b=new URL(S);if(!b.pathname.includes("/blob/"))throw new Error("Please provide full path to yaml file from GitLab");try{let E=b.pathname.split("/-/blob/")[0].split("/blob/")[0];const Q=getGitLabIntegrationRelativePath(c);Q&&(E=E.replace(Q,""));const be=new URL(`${b.origin}${Q}/api/v4/projects/${encodeURIComponent(E.replace(/^\//,""))}`),je=await fetch(be.toString(),zn(c)),ke=await je.json();if(!je.ok)throw new Error(`GitLab Error '${ke.error}', ${ke.error_description}`);return Number(ke.id)}catch(E){throw new Error(`Could not get GitLab project ID for: ${S}, ${E}`)}}class En{get type(){return"gitlab"}get title(){return this.integrationConfig.host}get config(){return this.integrationConfig}resolveUrl(c){return B(c)}resolveEditUrl(c){return On(c,"edit")}constructor(c){(0,t._)(this,"integrationConfig",void 0),this.integrationConfig=c}}(0,t._)(En,"factory",({config:S})=>{var c;const b=Lt((c=S.getOptionalConfigArray("integrations.gitlab"))!==null&&c!==void 0?c:[]);return u(b.map(E=>new En(E)),E=>E.config.host)});function On(S,c){return S.replace(/\/\-\/(blob|tree|edit)\//,`/-/${c}/`)}class er{static fromConfig(c){return new er({awsS3:I.factory({config:c}),azure:He.factory({config:c}),bitbucket:_t.factory({config:c}),bitbucketCloud:Bt.factory({config:c}),bitbucketServer:Un.factory({config:c}),gerrit:se.factory({config:c}),github:Ke.factory({config:c}),gitlab:En.factory({config:c}),gitea:kt.factory({config:c})})}get awsS3(){return this.byType.awsS3}get azure(){return this.byType.azure}get bitbucket(){return this.byType.bitbucket}get bitbucketCloud(){return this.byType.bitbucketCloud}get bitbucketServer(){return this.byType.bitbucketServer}get gerrit(){return this.byType.gerrit}get github(){return this.byType.github}get gitlab(){return this.byType.gitlab}get gitea(){return this.byType.gitea}list(){return Object.values(this.byType).flatMap(c=>c.list())}byUrl(c){let b=Object.values(this.byType).map(E=>E.byUrl(c)).filter(Boolean);if(b.length>1){const E=b.filter(Q=>!(Q instanceof _t));E.length!==0&&(b=E)}return b[0]}byHost(c){return Object.values(this.byType).map(b=>b.byHost(c)).find(Boolean)}resolveUrl(c){const b=this.byUrl(c.base);return b?b.resolveUrl(c):B(c)}resolveEditUrl(c){const b=this.byUrl(c);return b?b.resolveEditUrl(c):c}constructor(c){(0,t._)(this,"byType",void 0),this.byType=c}}},6290:function(Ct,$e,r){"use strict";var t={};r.r(t),r.d(t,{TechDocsPlugin:function(){return L.s4}});var h=r(52322),H=r(2784),f=r(28316),W=r(73557),g=r(60871);const u=(0,g.T0)({id:"plugin.techdocs.storageservice"}),B=(0,g.T0)({id:"plugin.techdocs.service"});var ve=r(92077),ue=r(95481),V=r(7476),K=r(93225),I=r(86317),w=r(65124),ie=r(22478),ee=r(85478),ne=r(68435),$=r(3482),T=r(42081),P=r(48431),L=r(89258),O=r(52943),oe=r(61886),Le=r(13980),ze=r.n(Le),z=r(87612);class yt{get(n){for(const s of this.holders){const a=s.get(n);if(a)return a}}constructor(...n){(0,z._)(this,"holders",void 0),this.holders=n}}var ot=r(51837);const He=(0,ot.CT)("api-context"),st=i=>{var n;const{apis:s,children:a}=i,p=(n=(0,H.useContext)(He))===null||n===void 0?void 0:n.atVersion(1),A=p?new yt(s,p):s;return(0,h.jsx)(He.Provider,{value:(0,ot.EI)({1:A}),children:a})};st.propTypes={apis:ze().shape({get:ze().func.isRequired}).isRequired,children:ze().node};class Qe{static validateFactories(n,s){for(const a of s){const p=[a],A=new Set;for(;p.length;){const k=p.shift(),M=n.get(k);if(M)for(const ae of Object.values(M.deps)){if(ae.id===a.id)throw new Error(`Circular dependency of api factory for ${a}`);A.has(ae)||(A.add(ae),p.push(ae))}}}}get(n){return this.load(n)}load(n,s=[]){const a=this.apis.get(n.id);if(a)return a;const p=this.factories.get(n);if(!p)return;if(s.includes(p.api))throw new Error(`Circular dependency of api factory for ${p.api}`);const A=this.loadDeps(n,p.deps,[...s,p.api]),k=p.factory(A);return this.apis.set(n.id,k),k}loadDeps(n,s,a){const p={};for(const A in s)if(s.hasOwnProperty(A)){const k=s[A],M=this.load(k,a);if(!M)throw new Error(`No API factory available for dependency ${k} of dependent ${n}`);p[A]=M}return p}constructor(n){(0,z._)(this,"factories",void 0),(0,z._)(this,"apis",void 0),this.factories=n,this.apis=new Map}}var St;(function(i){i[i.default=10]="default",i[i.app=50]="app",i[i.static=100]="static"})(St||(St={}));class It{register(n,s){const a=St[n],p=this.factories.get(s.api.id);return p&&p.priority>=a?!1:(this.factories.set(s.api.id,{priority:a,factory:s}),!0)}get(n){const s=this.factories.get(n.id);if(s)return s.factory}getAllApis(){const n=new Set;for(const{factory:s}of this.factories.values())n.add(s.api);return n}constructor(){(0,z._)(this,"factories",new Map)}}function xt(i){return new Promise((n,s)=>{const a=i.width||500,p=i.height||700,A=window.screen.width/2-a/2,k=window.screen.height/2-p/2,M=window.open(i.url,i.name,`menubar=no,location=no,resizable=no,scrollbars=no,status=no,width=${a},height=${p},top=${k},left=${A}`);let ae="";if(!M||typeof M.closed=="undefined"||M.closed){const gt=new Error("Failed to open auth popup.");gt.name="PopupRejectedError",s(gt);return}const xe=gt=>{if(gt.source!==M||gt.origin!==i.origin)return;const{data:Tt}=gt;if(Tt.type==="config_info"){ae=Tt.targetOrigin;return}if(Tt.type!=="authorization_response")return;const Rt=Tt;if("error"in Rt){const Wt=new Error(Rt.error.message);Wt.name=Rt.error.name,s(Wt)}else n(Rt.response);Ve()},Ie=setInterval(()=>{if(M.closed){const gt=`Login failed, ${ae&&ae!==window.location.origin?`Incorrect app origin, expected ${ae}`:"popup was closed"}`,Tt=new Error(gt);Tt.name="PopupClosedError",s(Tt),Ve()}},100);function Ve(){window.removeEventListener("message",xe),clearInterval(Ie)}window.addEventListener("message",xe)})}let lt=!1;function Pt(i){return[...i].join(" ")}class Nt{async createSession(n){return n.instantPopup?this.enableExperimentalRedirectFlow?this.executeRedirect(n.scopes):this.showPopup(n.scopes):this.authRequester(n.scopes)}async refreshSession(n){const s=await fetch(await this.buildUrl("/refresh",{optional:!0,...n&&{scope:this.joinScopesFunc(n)}}),{headers:{"x-requested-with":"XMLHttpRequest"},credentials:"include"}).catch(p=>{throw new Error(`Auth refresh request failed, ${p}`)});if(!s.ok){const p=new Error(`Auth refresh request failed, ${s.statusText}`);throw p.status=s.status,p}const a=await s.json();if(a.error){const p=new Error(a.error.message);throw a.error.name&&(p.name=a.error.name),p}return await this.sessionTransform(a)}async removeSession(){const n=await fetch(await this.buildUrl("/logout"),{method:"POST",headers:{"x-requested-with":"XMLHttpRequest"},credentials:"include"}).catch(s=>{throw new Error(`Logout request failed, ${s}`)});if(!n.ok){const s=new Error(`Logout request failed, ${n.statusText}`);throw s.status=n.status,s}}async showPopup(n){const s=this.joinScopesFunc(n),a=await this.buildUrl("/start",{scope:s,origin:window.location.origin,flow:"popup"}),p=await xt({url:a,name:`${this.provider.title} Login`,origin:new URL(a).origin,width:450,height:730});return await this.sessionTransform(p)}async executeRedirect(n){const s=this.joinScopesFunc(n);return window.location.href=await this.buildUrl("/start",{scope:s,origin:window.location.origin,redirectUrl:window.location.href,flow:"redirect"}),new Promise(()=>{})}async buildUrl(n,s){const a=await this.discoveryApi.getBaseUrl("auth"),p=this.buildQueryString({...s,env:this.environment});return`${a}/${this.provider.id}${n}${p}`}buildQueryString(n){if(!n)return"";const s=Object.entries(n).map(([a,p])=>{if(typeof p=="string")return`${encodeURIComponent(a)}=${encodeURIComponent(p)}`;if(p)return encodeURIComponent(a)}).filter(Boolean).join("&");return s?`?${s}`:""}constructor(n){(0,z._)(this,"discoveryApi",void 0),(0,z._)(this,"environment",void 0),(0,z._)(this,"provider",void 0),(0,z._)(this,"joinScopesFunc",void 0),(0,z._)(this,"authRequester",void 0),(0,z._)(this,"sessionTransform",void 0),(0,z._)(this,"enableExperimentalRedirectFlow",void 0);const{configApi:s,discoveryApi:a,environment:p,provider:A,joinScopes:k=Pt,oauthRequestApi:M,sessionTransform:ae=Ie=>Ie}=n;!lt&&!s&&(console.warn("DEPRECATION WARNING: Authentication providers require a configApi instance to configure the authentication flow. Please provide one to the authentication provider constructor."),lt=!0);var xe;this.enableExperimentalRedirectFlow=s&&(xe=s.getOptionalBoolean("enableExperimentalRedirectFlow"))!==null&&xe!==void 0?xe:!1,this.authRequester=M.createAuthRequester({provider:A,onAuthRequest:async Ie=>this.enableExperimentalRedirectFlow?this.executeRedirect(Ie):this.showPopup(Ie)}),this.discoveryApi=a,this.environment=p,this.provider=A,this.joinScopesFunc=k,this.sessionTransform=ae}}function We(i,n){for(const s of n)if(!i.has(s))return!1;return!0}class _t{sessionExistsAndHasScope(n,s){if(!n)return!1;if(!s||this.options.sessionScopes===void 0)return!0;const a=this.options.sessionScopes(n);return We(a,s)}getExtendedScope(n,s){const a=new Set(this.options.defaultScopes);if(n&&this.options.sessionScopes!==void 0){const p=this.options.sessionScopes(n);for(const A of p)a.add(A)}if(s)for(const p of s)a.add(p);return a}constructor(n){(0,z._)(this,"options",void 0),this.options=n}}var ge=r(82394),Se=r.n(ge);let Fe=Symbol.observable;class tt{[Fe](){return this}get closed(){return this.isClosed}next(n){if(this.isClosed)throw new Error("PublishSubject is closed");this.subscribers.forEach(s=>s.next(n))}error(n){if(this.isClosed)throw new Error("PublishSubject is closed");this.isClosed=!0,this.terminatingError=n,this.subscribers.forEach(s=>s.error(n))}complete(){if(this.isClosed)throw new Error("PublishSubject is closed");this.isClosed=!0,this.subscribers.forEach(n=>n.complete())}subscribe(n,s,a){const p=typeof n=="function"?{next:n,error:s,complete:a}:n;return this.observable.subscribe(p)}constructor(){(0,z._)(this,"isClosed",!1),(0,z._)(this,"terminatingError",void 0),(0,z._)(this,"observable",new(Se())(n=>this.isClosed?(this.terminatingError?n.error(this.terminatingError):n.complete(),()=>{}):(this.subscribers.add(n),()=>{this.subscribers.delete(n)}))),(0,z._)(this,"subscribers",new Set)}}let mt=Symbol.observable;class bt{[mt](){return this}get closed(){return this.isClosed}next(n){if(this.isClosed)throw new Error("BehaviorSubject is closed");this.currentValue=n,this.subscribers.forEach(s=>s.next(n))}error(n){if(this.isClosed)throw new Error("BehaviorSubject is closed");this.isClosed=!0,this.terminatingError=n,this.subscribers.forEach(s=>s.error(n))}complete(){if(this.isClosed)throw new Error("BehaviorSubject is closed");this.isClosed=!0,this.subscribers.forEach(n=>n.complete())}subscribe(n,s,a){const p=typeof n=="function"?{next:n,error:s,complete:a}:n;return this.observable.subscribe(p)}constructor(n){(0,z._)(this,"isClosed",void 0),(0,z._)(this,"currentValue",void 0),(0,z._)(this,"terminatingError",void 0),(0,z._)(this,"observable",void 0),(0,z._)(this,"subscribers",new Set),this.isClosed=!1,this.currentValue=n,this.terminatingError=void 0,this.observable=new(Se())(s=>this.isClosed?(this.terminatingError?s.error(this.terminatingError):s.complete(),()=>{}):(s.next(this.currentValue),this.subscribers.add(s),()=>{this.subscribers.delete(s)}))}}class pt{setIsSignedIn(n){this.signedIn!==n&&(this.signedIn=n,this.subject.next(this.signedIn?g.sM.SignedIn:g.sM.SignedOut))}sessionState$(){return this.subject}constructor(){(0,z._)(this,"subject",new bt(g.sM.SignedOut)),(0,z._)(this,"signedIn",!1)}}class Ot{async getSession(n){if(this.helper.sessionExistsAndHasScope(this.currentSession,n.scopes)){if(!this.sessionShouldRefreshFunc(this.currentSession))return this.currentSession;try{const a=await this.collapsedSessionRefresh(n.scopes),p=this.sessionScopesFunc(this.currentSession),A=this.sessionScopesFunc(a);return We(A,p)&&(this.currentSession=a),a}catch(a){if(n.optional)return;throw a}}if(!this.currentSession&&!n.instantPopup)try{const s=await this.collapsedSessionRefresh(n.scopes);return this.currentSession=s,this.getSession(n)}catch{}if(!n.optional)return this.currentSession=await this.connector.createSession({...n,scopes:this.helper.getExtendedScope(this.currentSession,n.scopes)}),this.stateTracker.setIsSignedIn(!0),this.currentSession}async removeSession(){this.currentSession=void 0,await this.connector.removeSession(),this.stateTracker.setIsSignedIn(!1)}sessionState$(){return this.stateTracker.sessionState$()}async collapsedSessionRefresh(n){if(this.refreshPromise)return this.refreshPromise;this.refreshPromise=this.connector.refreshSession(n);try{const s=await this.refreshPromise;return this.stateTracker.setIsSignedIn(!0),s}finally{delete this.refreshPromise}}constructor(n){(0,z._)(this,"connector",void 0),(0,z._)(this,"helper",void 0),(0,z._)(this,"sessionScopesFunc",void 0),(0,z._)(this,"sessionShouldRefreshFunc",void 0),(0,z._)(this,"stateTracker",new pt),(0,z._)(this,"refreshPromise",void 0),(0,z._)(this,"currentSession",void 0);const{connector:s,defaultScopes:a=new Set,sessionScopes:p,sessionShouldRefresh:A}=n;this.connector=s,this.sessionScopesFunc=p,this.sessionShouldRefreshFunc=A,this.helper=new _t({sessionScopes:p,defaultScopes:a})}}class Ht{setSession(n){this.currentSession=n,this.stateTracker.setIsSignedIn(Boolean(n))}async getSession(n){if(this.helper.sessionExistsAndHasScope(this.currentSession,n.scopes))return this.currentSession;if(!n.optional)return this.currentSession=await this.connector.createSession({...n,scopes:this.helper.getExtendedScope(this.currentSession,n.scopes)}),this.stateTracker.setIsSignedIn(!0),this.currentSession}async removeSession(){this.currentSession=void 0,this.stateTracker.setIsSignedIn(!1)}sessionState$(){return this.stateTracker.sessionState$()}constructor(n){_define_property(this,"connector",void 0),_define_property(this,"helper",void 0),_define_property(this,"stateTracker",new SessionStateTracker),_define_property(this,"currentSession",void 0);const{connector:s,defaultScopes:a=new Set,sessionScopes:p}=n;this.connector=s,this.helper=new SessionScopeHelper({sessionScopes:p,defaultScopes:a})}}const Jt={id:"oauth2",title:"Your Identity Provider",icon:()=>null};class Bt{static create(n){const{configApi:s,discoveryApi:a,environment:p="development",provider:A=Jt,oauthRequestApi:k,defaultScopes:M=[],scopeTransform:ae=Ve=>Ve}=n,xe=new Nt({configApi:s,discoveryApi:a,environment:p,provider:A,oauthRequestApi:k,sessionTransform(Ve){return{...Ve,providerInfo:{idToken:Ve.providerInfo.idToken,accessToken:Ve.providerInfo.accessToken,scopes:Bt.normalizeScopes(ae,Ve.providerInfo.scope),expiresAt:new Date(Date.now()+Ve.providerInfo.expiresInSeconds*1e3)}}}}),Ie=new Ot({connector:xe,defaultScopes:new Set(M),sessionScopes:Ve=>Ve.providerInfo.scopes,sessionShouldRefresh:Ve=>(Ve.providerInfo.expiresAt.getTime()-Date.now())/1e3<60*5});return new Bt({sessionManager:Ie,scopeTransform:ae})}async signIn(){await this.getAccessToken()}async signOut(){await this.sessionManager.removeSession()}sessionState$(){return this.sessionManager.sessionState$()}async getAccessToken(n,s){const a=Bt.normalizeScopes(this.scopeTransform,n),p=await this.sessionManager.getSession({...s,scopes:a});var A;return(A=p==null?void 0:p.providerInfo.accessToken)!==null&&A!==void 0?A:""}async getIdToken(n={}){const s=await this.sessionManager.getSession({...n,scopes:new Set(["openid"])});var a;return(a=s==null?void 0:s.providerInfo.idToken)!==null&&a!==void 0?a:""}async getBackstageIdentity(n={}){const s=await this.sessionManager.getSession(n);return s==null?void 0:s.backstageIdentity}async getProfile(n={}){const s=await this.sessionManager.getSession(n);return s==null?void 0:s.profile}static normalizeScopes(n,s){if(!s)return new Set;const a=Array.isArray(s)?s:s.split(/[\s|,]/).filter(Boolean);return new Set(n(a))}constructor(n){(0,z._)(this,"sessionManager",void 0),(0,z._)(this,"scopeTransform",void 0),this.sessionManager=n.sessionManager,this.scopeTransform=n.scopeTransform}}const un={id:"github",title:"GitHub",icon:()=>null};class Yt{static create(n){const{configApi:s,discoveryApi:a,environment:p="development",provider:A=un,oauthRequestApi:k,defaultScopes:M=["read:user"]}=n;return Bt.create({configApi:s,discoveryApi:a,oauthRequestApi:k,provider:A,environment:p,defaultScopes:M})}}const pn={id:"gitlab",title:"GitLab",icon:()=>null};class Fn{static create(n){const{configApi:s,discoveryApi:a,environment:p="development",provider:A=pn,oauthRequestApi:k,defaultScopes:M=["read_user"]}=n;return Bt.create({configApi:s,discoveryApi:a,oauthRequestApi:k,provider:A,environment:p,defaultScopes:M})}}const Pn={id:"google",title:"Google",icon:()=>null},fn="https://www.googleapis.com/auth/";class Ln{static create(n){const{configApi:s,discoveryApi:a,oauthRequestApi:p,environment:A="development",provider:k=Pn,defaultScopes:M=["openid",`${fn}userinfo.email`,`${fn}userinfo.profile`]}=n;return Bt.create({configApi:s,discoveryApi:a,oauthRequestApi:p,provider:k,environment:A,defaultScopes:M,scopeTransform(ae){return ae.map(xe=>xe==="openid"?xe:xe==="profile"||xe==="email"?`${fn}userinfo.${xe}`:xe.startsWith(fn)?xe:`${fn}${xe}`)}})}}const Un={id:"okta",title:"Okta",icon:()=>null},tn=new Set(["openid","profile","email","phone","address","groups","offline_access"]),wn="okta.";class Mn{static create(n){const{configApi:s,discoveryApi:a,environment:p="development",provider:A=Un,oauthRequestApi:k,defaultScopes:M=["openid","email","profile","offline_access"]}=n;return Bt.create({configApi:s,discoveryApi:a,oauthRequestApi:k,provider:A,environment:p,defaultScopes:M,scopeTransform(ae){return ae.map(xe=>tn.has(xe)||xe.startsWith(wn)?xe:`${wn}${xe}`)}})}}var ut=r(30195);const _n=ut.z.object({profile:ut.z.object({email:ut.z.string().optional(),displayName:ut.z.string().optional(),picture:ut.z.string().optional()}),backstageIdentity:ut.z.object({token:ut.z.string(),identity:ut.z.object({type:ut.z.literal("user"),userEntityRef:ut.z.string(),ownershipEntityRefs:ut.z.array(ut.z.string())})})}),wt={id:"saml",title:"SAML",icon:()=>null};class ct{static create(n){const{discoveryApi:s,environment:a="development",provider:p=wt}=n,A=new DirectAuthConnector({discoveryApi:s,environment:a,provider:p}),k=new StaticAuthSessionManager({connector:A}),M=new AuthSessionStore({manager:k,storageKey:`${p.id}Session`,schema:samlSessionSchema});return new ct(M)}sessionState$(){return this.sessionManager.sessionState$()}async signIn(){await this.getBackstageIdentity({})}async signOut(){await this.sessionManager.removeSession()}async getBackstageIdentity(n={}){const s=await this.sessionManager.getSession(n);return s==null?void 0:s.backstageIdentity}async getProfile(n={}){const s=await this.sessionManager.getSession(n);return s==null?void 0:s.profile}constructor(n){_define_property(this,"sessionManager",void 0),this.sessionManager=n}}const vn={id:"microsoft",title:"Microsoft",icon:()=>null};class Kt{static create(n){return new Kt(n)}microsoftGraph(){return this.oauth2[Kt.MicrosoftGraphID]}static resourceForScopes(n){const s=[...new Set(n.split(" ").map(Kt.resourceForScope).filter(A=>A!=="openid"))];if(s.length>1)return Promise.reject(new Error(`Requested access token with scopes from multiple Azure resources: ${s.join(", ")}. Access tokens can only have a single audience.`));var a;const p=(a=s[0])!==null&&a!==void 0?a:Kt.MicrosoftGraphID;return Promise.resolve(p)}static resourceForScope(n){var s;const a=(s=n.match(RegExp("^(?<resourceURI>.*)\\/(?<scp>[^\\/]*)$")))===null||s===void 0?void 0:s.groups;if(a){const{resourceURI:p}=a;return p.replace(/^api:\/\//,"")}switch(n){case"email":case"openid":case"offline_access":case"profile":return"openid";default:return Kt.MicrosoftGraphID}}async getAccessToken(n,s){const a=n===void 0?Kt.MicrosoftGraphID:await Kt.resourceForScopes(Array.isArray(n)?n.join(" "):n);return a in this.oauth2||(this.oauth2[a]=Bt.create({configApi:this.configApi,discoveryApi:this.discoveryApi,oauthRequestApi:this.oauthRequestApi,provider:this.provider,environment:this.environment,scopeTransform:this.scopeTransform})),this.oauth2[a].getAccessToken(n,s)}getIdToken(n){return this.microsoftGraph().getIdToken(n)}getProfile(n){return this.microsoftGraph().getProfile(n)}getBackstageIdentity(n){return this.microsoftGraph().getBackstageIdentity(n)}signIn(){return this.microsoftGraph().signIn()}signOut(){return this.microsoftGraph().signOut()}sessionState$(){return this.microsoftGraph().sessionState$()}constructor(n){(0,z._)(this,"oauth2",void 0),(0,z._)(this,"configApi",void 0),(0,z._)(this,"environment",void 0),(0,z._)(this,"provider",void 0),(0,z._)(this,"oauthRequestApi",void 0),(0,z._)(this,"discoveryApi",void 0),(0,z._)(this,"scopeTransform",void 0);const{configApi:s,environment:a="development",provider:p=vn,oauthRequestApi:A,discoveryApi:k,defaultScopes:M=["openid","offline_access","profile","email","User.Read"],scopeTransform:ae=xe=>xe.concat("offline_access")}=n;this.configApi=s,this.environment=a,this.provider=p,this.oauthRequestApi=A,this.discoveryApi=k,this.scopeTransform=ae,this.oauth2={[Kt.MicrosoftGraphID]:Bt.create({configApi:this.configApi,discoveryApi:this.discoveryApi,oauthRequestApi:this.oauthRequestApi,provider:this.provider,environment:this.environment,scopeTransform:this.scopeTransform,defaultScopes:M})}}}(0,z._)(Kt,"MicrosoftGraphID","00000003-0000-0000-c000-000000000000");const hn={id:"onelogin",title:"onelogin",icon:()=>null},jn=new Set(["openid","profile","email","phone","address","groups","offline_access"]),ln="onelogin.";class Tn{static create(n){const{configApi:s,discoveryApi:a,environment:p="development",provider:A=hn,oauthRequestApi:k}=n;return Bt.create({configApi:s,discoveryApi:a,oauthRequestApi:k,provider:A,environment:p,defaultScopes:["openid","email","profile","offline_access"],scopeTransform(M){return M.map(ae=>jn.has(ae)||ae.startsWith(ln)?ae:`${ln}${ae}`)}})}}const Ce={id:"bitbucket",title:"Bitbucket",icon:()=>null};class ce{static create(n){const{configApi:s,discoveryApi:a,environment:p="development",provider:A=Ce,oauthRequestApi:k,defaultScopes:M=["team"]}=n;return Bt.create({configApi:s,discoveryApi:a,oauthRequestApi:k,provider:A,environment:p,defaultScopes:M})}}const Oe={id:"bitbucketServer",title:"Bitbucket Server",icon:()=>null};class Me{static create(n){const{configApi:s,discoveryApi:a,environment:p="development",provider:A=Oe,oauthRequestApi:k,defaultScopes:M=["PROJECT_ADMIN"]}=n;return Bt.create({configApi:s,discoveryApi:a,oauthRequestApi:k,provider:A,environment:p,defaultScopes:M})}}const Xe={id:"atlassian",title:"Atlassian",icon:()=>null};class se{static create(n){const{configApi:s,discoveryApi:a,environment:p="development",provider:A=Xe,oauthRequestApi:k}=n;return Bt.create({configApi:s,discoveryApi:a,oauthRequestApi:k,provider:A,environment:p})}}class D{post(n){this.subject.next(n)}alert$(){return this.subject}constructor(){(0,z._)(this,"subject",new tt)}}class me{captureEvent(n){}}const De="theme";class et{static createWithStorage(n){const s=new et(n);if(!window.localStorage)return s;var a;const p=(a=window.localStorage.getItem(De))!==null&&a!==void 0?a:void 0;return s.setActiveThemeId(p),s.activeThemeId$().subscribe(A=>{A?window.localStorage.setItem(De,A):window.localStorage.removeItem(De)}),window.addEventListener("storage",A=>{if(A.key===De){var k;const M=(k=localStorage.getItem(De))!==null&&k!==void 0?k:void 0;s.setActiveThemeId(M)}}),s}getInstalledThemes(){return this.themes.slice()}activeThemeId$(){return this.subject}getActiveThemeId(){return this.activeThemeId}setActiveThemeId(n){this.activeThemeId=n,this.subject.next(n)}constructor(n){(0,z._)(this,"themes",void 0),(0,z._)(this,"activeThemeId",void 0),(0,z._)(this,"subject",void 0),this.themes=n,this.subject=new bt(void 0)}}var it=r(9850),kt=r.n(it),Ft=r(12782),Qt=r.n(Ft);const _=/^[a-z][a-z0-9]*(?:[-_][a-z][a-z0-9]*)*$/i;function J(i){return typeof i=="object"&&i!==null&&!Array.isArray(i)}function te(i){if(i===null)return"null";if(Array.isArray(i))return"array";const n=typeof i;return n==="number"&&isNaN(i)?"nan":n==="string"&&i===""?"empty-string":n}const pe={type(i,n,s,a){return`Invalid type in config for key '${i}' in '${n}', got ${s}, wanted ${a}`},missing(i){return`Missing required config value at '${i}'`},convert(i,n,s){return`Unable to convert config value for key '${i}' in '${n}' to a ${s}`}};class le{static fromConfigs(n){return n.length===0?new le(void 0):n.reduce((s,{data:a,context:p,filteredKeys:A,deprecatedKeys:k})=>{const M=new le(a,p,s);if(M.filteredKeys=A,k)for(const{key:ae,description:xe}of k)console.warn(`The configuration key '${ae}' of ${p} is deprecated and may be removed soon. ${xe||""}`);return M},void 0)}has(n){var s;if(this.readValue(n)!==void 0)return!0;var p;return(p=(s=this.fallback)===null||s===void 0?void 0:s.has(n))!==null&&p!==void 0?p:!1}keys(){var n;const s=this.data?Object.keys(this.data):[];var a;const p=(a=(n=this.fallback)===null||n===void 0?void 0:n.keys())!==null&&a!==void 0?a:[];return[...new Set([...s,...p])]}get(n){const s=this.getOptional(n);if(s===void 0)throw new Error(pe.missing(this.fullKey(n!=null?n:"")));return s}getOptional(n){var s;const a=kt()(this.readValue(n)),p=(s=this.fallback)===null||s===void 0?void 0:s.getOptional(n);if(a===void 0){if(!1)var A;return p}else if(p===void 0)return a;return Qt()({},{value:p},{value:a},(k,M)=>!J(M)||!J(k)?M:void 0).value}getConfig(n){const s=this.getOptionalConfig(n);if(s===void 0)throw new Error(pe.missing(this.fullKey(n)));return s}getOptionalConfig(n){var s;const a=this.readValue(n),p=(s=this.fallback)===null||s===void 0?void 0:s.getOptionalConfig(n);if(J(a))return this.copy(a,n,p);if(a!==void 0)throw new TypeError(pe.type(this.fullKey(n),this.context,te(a),"object"));return p}getConfigArray(n){const s=this.getOptionalConfigArray(n);if(s===void 0)throw new Error(pe.missing(this.fullKey(n)));return s}getOptionalConfigArray(n){const s=this.readConfigValue(n,p=>{if(!Array.isArray(p))return{expected:"object-array"};for(const[A,k]of p.entries())if(!J(k))return{expected:"object-array",value:k,key:`${n}[${A}]`};return!0});if(!s){if(!1)var a;return}return s.map((p,A)=>this.copy(p,`${n}[${A}]`))}getNumber(n){const s=this.getOptionalNumber(n);if(s===void 0)throw new Error(pe.missing(this.fullKey(n)));return s}getOptionalNumber(n){const s=this.readConfigValue(n,p=>typeof p=="number"||typeof p=="string"||{expected:"number"});if(typeof s=="number"||s===void 0)return s;const a=Number(s);if(!Number.isFinite(a))throw new Error(pe.convert(this.fullKey(n),this.context,"number"));return a}getBoolean(n){const s=this.getOptionalBoolean(n);if(s===void 0)throw new Error(pe.missing(this.fullKey(n)));return s}getOptionalBoolean(n){const s=this.readConfigValue(n,p=>typeof p=="boolean"||typeof p=="number"||typeof p=="string"||{expected:"boolean"});if(typeof s=="boolean"||s===void 0)return s;const a=String(s).trim();if(/^(?:y|yes|true|1|on)$/i.test(a))return!0;if(/^(?:n|no|false|0|off)$/i.test(a))return!1;throw new Error(pe.convert(this.fullKey(n),this.context,"boolean"))}getString(n){const s=this.getOptionalString(n);if(s===void 0)throw new Error(pe.missing(this.fullKey(n)));return s}getOptionalString(n){return this.readConfigValue(n,s=>typeof s=="string"&&s!==""||{expected:"string"})}getStringArray(n){const s=this.getOptionalStringArray(n);if(s===void 0)throw new Error(pe.missing(this.fullKey(n)));return s}getOptionalStringArray(n){return this.readConfigValue(n,s=>{if(!Array.isArray(s))return{expected:"string-array"};for(const[a,p]of s.entries())if(typeof p!="string"||p==="")return{expected:"string-array",value:p,key:`${n}[${a}]`};return!0})}fullKey(n){return`${this.prefix}${this.prefix?".":""}${n}`}copy(n,s,a){const p=new le(n,this.context,a,this.fullKey(s));return p.filteredKeys=this.filteredKeys,p}readConfigValue(n,s){const a=this.readValue(n);if(a===void 0){var p;if(!1)var A;return(p=this.fallback)===null||p===void 0?void 0:p.readConfigValue(n,s)}const k=s(a);if(k!==!0){const{key:M=n,value:ae=a,expected:xe}=k;throw new TypeError(pe.type(this.fullKey(M),this.context,te(ae),xe))}return a}readValue(n){const s=n?n.split("."):[];for(const p of s)if(!_.test(p))throw new TypeError(`Invalid config key '${n}'`);if(this.data===void 0)return;let a=this.data;for(const[p,A]of s.entries())if(J(a))a=a[A];else if(a!==void 0){const k=this.fullKey(s.slice(0,p).join("."));throw new TypeError(pe.type(k,this.context,te(a),"object"))}return a}constructor(n,s="mock-config",a,p=""){(0,z._)(this,"data",void 0),(0,z._)(this,"context",void 0),(0,z._)(this,"fallback",void 0),(0,z._)(this,"prefix",void 0),(0,z._)(this,"filteredKeys",void 0),(0,z._)(this,"notifiedFilteredKeys",void 0),this.data=n,this.context=s,this.fallback=a,this.prefix=p,this.notifiedFilteredKeys=new Set}}const y="Invalid discovery URL pattern,";class Z{static compile(n){const s=n.split(/\{\{\s*pluginId\s*\}\}/),a=s.join("pluginId");let p;try{p=new URL(a)}catch{throw new Error(`${y} URL '${a}' is invalid`)}if(p.hash)throw new Error(`${y} URL must not have a hash`);if(p.search)throw new Error(`${y} URL must not have a query`);if(a.endsWith("/"))throw new Error(`${y} URL must not end with a slash`);return new Z(s)}async getBaseUrl(n){return this.parts.join(encodeURIComponent(n))}constructor(n){(0,z._)(this,"parts",void 0),this.parts=n}}class q{post(n,s){return s!=null&&s.hidden||this.alertApi.post({message:n.message,severity:"error"}),this.errorApi.post(n,s)}error$(){return this.errorApi.error$()}constructor(n,s){(0,z._)(this,"alertApi",void 0),(0,z._)(this,"errorApi",void 0),this.alertApi=n,this.errorApi=s}}class Y{post(n,s){this.subject.next({error:n,context:s})}error$(){return this.subject}constructor(){(0,z._)(this,"subject",new tt)}}class we{static forward(n,s){window.addEventListener("unhandledrejection",a=>{n.post(a.reason,s)})}}function Ae(i){if(i.length<3)throw new Error(`The '${i}' feature flag must have a minimum length of three characters.`);if(i.length>150)throw new Error(`The '${i}' feature flag must not exceed 150 characters.`);if(!i.match(/^[a-z]+[a-z0-9-]+$/))throw new Error(`The '${i}' feature flag must start with a lowercase letter and only contain lowercase letters, numbers and hyphens. Examples: feature-flag-one, alpha, release-2020`)}class Ye{registerFlag(n){Ae(n.name),this.registeredFeatureFlags.push(n)}getRegisteredFlags(){return this.registeredFeatureFlags.slice()}isActive(n){return this.flags||(this.flags=this.load()),this.flags.get(n)===g.CL.Active}save(n){this.flags||(this.flags=this.load()),n.merge||this.flags.clear();for(const[a,p]of Object.entries(n.states))this.flags.set(a,p);const s=Array.from(this.flags.entries()).filter(([,a])=>a===g.CL.Active);window.localStorage.setItem("featureFlags",JSON.stringify(Object.fromEntries(s)))}load(){try{const n=window.localStorage.getItem("featureFlags");if(!n)return new Map;const s=JSON.parse(n);if(typeof s!="object"||s===null||Array.isArray(s))return new Map;const a=Object.entries(s).filter(([p,A])=>(Ae(p),A===g.CL.Active));return new Map(a)}catch{return new Map}}constructor(){(0,z._)(this,"registeredFeatureFlags",[]),(0,z._)(this,"flags",void 0)}}function jt(i){let n=i.baseImplementation||r.g.fetch;var s;const a=[(s=i.middleware)!==null&&s!==void 0?s:[]].flat().reverse();for(const p of a)n=p.apply(n);return{fetch:n}}class vt{static create(n){var s,a;const p=nt(n),A=((s=n.header)===null||s===void 0?void 0:s.name)||"authorization",k=((a=n.header)===null||a===void 0?void 0:a.value)||(M=>`Bearer ${M}`);return new vt(n.identityApi,p,A,k)}apply(n){return async(s,a)=>{const p=new Request(s,a),{token:A}=await this.identityApi.getCredentials();return p.headers.get(this.headerName)||typeof A!="string"||!A||!this.allowUrl(p.url)?n(s,a):(p.headers.set(this.headerName,this.headerValue(A)),n(p))}}constructor(n,s,a,p){(0,z._)(this,"identityApi",void 0),(0,z._)(this,"allowUrl",void 0),(0,z._)(this,"headerName",void 0),(0,z._)(this,"headerValue",void 0),this.identityApi=n,this.allowUrl=s,this.headerName=a,this.headerValue=p}}function nt(i){return i.allowUrl?i.allowUrl:i.urlPrefixAllowlist?Ke(i.urlPrefixAllowlist):i.config?Ke([i.config.getString("backend.baseUrl")]):()=>!1}function Ke(i){const n=i.map(s=>s.replace(/\/$/,""));return s=>n.some(a=>s===a||s.startsWith(`${a}/`))}function dt(i,n){return!n||n==="/"?i:`${i.replace(/\/$/,"")}/${n.replace(/^\//,"")}`}class at{apply(n){return async(s,a)=>{const p=new Request(s,a),A="plugin://";if(!p.url.startsWith(A))return n(s,a);const{hostname:k,pathname:M,search:ae,hash:xe,username:Ie,password:Ve}=new URL(`http://${p.url.substring(A.length)}`);let gt=await this.discoveryApi.getBaseUrl(k);if(Ie||Ve){const Rt=new URL(gt),Wt=`${Ie}${Ve?`:${Ve}`:""}@`;gt=`${Rt.protocol}//${Wt}${Rt.host}${Rt.pathname}`}const Tt=`${dt(gt,M)}${ae}${xe}`;return n(Tt,typeof s=="string"||Dt(s)?a:s)}}constructor(n){(0,z._)(this,"discoveryApi",void 0),this.discoveryApi=n}}function Dt(i){return typeof i=="object"&&(i==null?void 0:i.constructor)===URL}class Mt{static resolvePluginProtocol(n){return new at(n.discoveryApi)}static injectIdentityAuth(n){return vt.create(n)}constructor(){}}function Xt(i,n){for(const s of n)if(!i.has(s))return!1;return!0}function en(i,...n){const s=new Set(i);for(const a of n)for(const p of a)s.add(p);return s}class Ut{request(n){return new Promise((s,a)=>{this.requests.push({scopes:n,resolve:s,reject:a}),this.subject.next(this.getCurrentPending())})}resolve(n,s){this.requests=this.requests.filter(a=>Xt(n,a.scopes)?(a.resolve(s),!1):!0),this.subject.next(this.getCurrentPending())}reject(n){this.requests.forEach(s=>s.reject(n)),this.requests=[],this.subject.next(this.getCurrentPending())}pending(){return this.subject}getCurrentPending(){const n=this.requests.length===0?void 0:this.requests.slice(1).reduce((s,a)=>en(s,a.scopes),this.requests[0].scopes);return{scopes:n,resolve:s=>{n&&this.resolve(n,s)},reject:s=>{n&&this.reject(s)}}}constructor(){(0,z._)(this,"requests",[]),(0,z._)(this,"subject",new bt(this.getCurrentPending()))}}class zt{createAuthRequester(n){const s=new Ut,a=this.handlerCount;return this.handlerCount++,s.pending().subscribe({next:p=>{const A=this.currentRequests.slice(),k=this.makeAuthRequest(p,n);k?A[a]=k:delete A[a],this.currentRequests=A,this.subject.next(A.filter(Boolean))}}),p=>s.request(p)}makeAuthRequest(n,s){const{scopes:a}=n;if(a)return{provider:s.provider,trigger:async()=>{const p=await s.onAuthRequest(a);n.resolve(p)},reject:()=>{const p=new Error("Login failed, rejected by user");p.name="RejectedError",n.reject(p)}}}authRequest$(){return this.subject}constructor(){(0,z._)(this,"subject",new bt([])),(0,z._)(this,"currentRequests",[]),(0,z._)(this,"handlerCount",0)}}const Et=new Map;class Lt{static create(n){var s;return new Lt((s=n.namespace)!==null&&s!==void 0?s:"",n.errorApi)}static addStorageEventListener(){window.addEventListener("storage",n=>{for(const[a,p]of Et.entries()){var s;!((s=n.key)===null||s===void 0)&&s.startsWith(a)&&p.handleStorageChange(n.key)}})}get(n){return this.snapshot(n).value}snapshot(n){let s,a="absent";try{const p=localStorage.getItem(this.getKeyName(n));p&&(s=JSON.parse(p,(A,k)=>(typeof k=="object"&&k!==null&&Object.freeze(k),k)),a="present")}catch{this.errorApi.post(new Error(`Error when parsing JSON config from storage for: ${n}`))}return{key:n,value:s,presence:a}}forBucket(n){const s=`${this.namespace}/${n}`;return Et.has(s)||Et.set(s,new Lt(s,this.errorApi)),Et.get(s)}async set(n,s){localStorage.setItem(this.getKeyName(n),JSON.stringify(s)),this.notifyChanges(n)}async remove(n){localStorage.removeItem(this.getKeyName(n)),this.notifyChanges(n)}observe$(n){return Lt.hasSubscribed||(Lt.addStorageEventListener(),Lt.hasSubscribed=!0),this.observable.filter(({key:s})=>s===n)}handleStorageChange(n){if(!(n!=null&&n.startsWith(this.namespace)))return;const s=n==null?void 0:n.slice(`${this.namespace}/`.length);s.includes("/")||this.notifyChanges(decodeURIComponent(s))}getKeyName(n){return`${this.namespace}/${encodeURIComponent(n)}`}notifyChanges(n){const s=this.snapshot(n);for(const a of this.subscribers)a.next(s)}constructor(n,s){(0,z._)(this,"namespace",void 0),(0,z._)(this,"errorApi",void 0),(0,z._)(this,"subscribers",void 0),(0,z._)(this,"observable",void 0),this.namespace=n,this.errorApi=s,this.subscribers=new Set,this.observable=new(Se())(a=>(this.subscribers.add(a),()=>{this.subscribers.delete(a)}))}}(0,z._)(Lt,"hasSubscribed",!1);const Zt=(0,H.createContext)(void 0);function bn(){const[i]=(0,W.is)((0,h.jsx)(W.AW,{index:!0,element:(0,h.jsx)("div",{})}));return!i.index}var zn=r(84800);const Gn=(i,n)=>{try{var s;const a=(0,zn.fp)(n,{pathname:i}),p=a==null?void 0:a.filter(ae=>{var xe;return((xe=ae==null?void 0:ae.route.routeRefs)===null||xe===void 0?void 0:xe.size)>0}).pop(),A=p==null?void 0:p.route;if(!A)return;let k;A.routeRefs.size===1&&(k=A.routeRefs.values().next().value);const M=Object.entries((p==null?void 0:p.params)||{}).reduce((ae,[xe,Ie])=>(Ie!==void 0&&(ae[xe]=Ie),ae),{});return{extension:"App",pluginId:((s=A.plugin)===null||s===void 0?void 0:s.getId())||"root",...k?{routeRef:k.id}:{},params:M}}catch{return}},ur=({pathname:i,search:n,hash:s,attributes:a})=>{const p=(0,g.z$)();return(0,H.useEffect)(()=>{p.captureEvent("navigate",`${i}${n}${s}`,{attributes:a})},[p,i,n,s,a]),null},En=({routeObjects:i})=>{const{pathname:n,search:s,hash:a}=(0,W.TH)(),{params:p,...A}=Gn(n,i)||{params:{}};return(0,h.jsx)(g.fC,{attributes:A,children:(0,h.jsx)(ur,{pathname:n,search:s,hash:a,attributes:p})})};function On(i){return bn()?er(i):""}function er(i){var n;let{pathname:s}=new URL((n=i.getOptionalString("app.baseUrl"))!==null&&n!==void 0?n:"/","http://sample.dev");return s=s.replace(/\/*$/,""),s}function S({component:i,appIdentityProxy:n,children:s}){const[a,p]=(0,H.useState)(),A=(0,g.h_)(g.Ds),k=On(A);return a?(n.setTarget(a,{signOutTargetUrl:k||"/"}),(0,h.jsx)(h.Fragment,{children:s})):(0,h.jsx)(i,{onSignInSuccess:p})}function c(i){const{Router:n,SignInPage:s}=(0,g.qD)().getComponents(),a=(0,g.h_)(g.Ds),p=er(a),A=`${p}/*`,k=(0,H.useContext)(Zt);if(!k)throw new Error("AppRouter must be rendered within the AppProvider");const{routeObjects:M,appIdentityProxy:ae}=k;return s?bn()?(0,h.jsxs)(n,{children:[(0,h.jsx)(En,{routeObjects:M}),(0,h.jsx)(S,{component:s,appIdentityProxy:ae,children:(0,h.jsx)(W.Z5,{children:(0,h.jsx)(W.AW,{path:A,element:(0,h.jsx)(h.Fragment,{children:i.children})})})})]}):(0,h.jsxs)(n,{basename:p,children:[(0,h.jsx)(En,{routeObjects:M}),(0,h.jsx)(S,{component:s,appIdentityProxy:ae,children:i.children})]}):(ae.setTarget({getUserId:()=>"guest",getIdToken:async()=>{},getProfile:()=>({email:"guest@example.com",displayName:"Guest"}),getProfileInfo:async()=>({email:"guest@example.com",displayName:"Guest"}),getBackstageIdentity:async()=>({type:"user",userEntityRef:"user:default/guest",ownershipEntityRefs:["user:default/guest"]}),getCredentials:async()=>({}),signOut:async()=>{}},{signOutTargetUrl:p||"/"}),bn()?(0,h.jsxs)(n,{children:[(0,h.jsx)(En,{routeObjects:M}),(0,h.jsx)(W.Z5,{children:(0,h.jsx)(W.AW,{path:A,element:(0,h.jsx)(h.Fragment,{children:i.children})})})]}):(0,h.jsxs)(n,{basename:p,children:[(0,h.jsx)(En,{routeObjects:M}),i.children]}))}var b=r(88412),E=r(50629),Q=r(80956),be=r(64279);function je(i){const n={};for(const a in i.collectors)i.collectors.hasOwnProperty(a)&&(n[a]=i.collectors[a]());const s=[{node:H.Children.toArray(i.root),parent:void 0,contexts:{}}];for(;s.length!==0;){const{node:a,parent:p,contexts:A}=s.shift();H.Children.forEach(a,k=>{if(!(0,H.isValidElement)(k))return;const M={};for(const ae in n)if(n.hasOwnProperty(ae)){const xe=n[ae];M[ae]=xe.visit(xe.accumulator,k,p,A[ae])}for(const ae of i.discoverers){const xe=ae(k);xe&&s.push({node:xe,parent:k,contexts:M})}})}return Object.fromEntries(Object.entries(n).map(([a,p])=>[a,p.accumulator]))}function ke(i,n){return()=>({accumulator:i(),visit:n})}function ht(i){var n;return(n=i.props)===null||n===void 0?void 0:n.children}function ft(i){var n,s;if(!((n=i.props)===null||n===void 0)&&n.path&&(!((s=i.props)===null||s===void 0)&&s.element)){var a;return(a=i.props)===null||a===void 0?void 0:a.element}}const yn=ke(()=>new Set,(i,n)=>{const s=(0,g.IY)(n,"core.plugin");s&&i.add(s)}),kn=i=>{const{children:n}=i,s=(0,g.h_)(g.W0),a="with"in i?s.isActive(i.with):!s.isActive(i.without);return(0,h.jsx)(h.Fragment,{children:a?n:null})};(0,g.R5)(kn,"core.featureFlagged",!0);const br={caseSensitive:!1,path:"*",element:"match-all",routeRefs:new Set};function Br(i){const n=i;if(n!=null&&n.type){var s,a;return(a=(s=n.type.displayName)!==null&&s!==void 0?s:n.type.name)!==null&&a!==void 0?a:String(n.type)}return String(n)}function $r(i,n=new Array){return H.Children.forEach(i,s=>{if(!(0,H.isValidElement)(s))return;const a=(0,g.IY)(s,"core.mountPoint");if(a){const p=(0,g.IY)(s,"core.plugin");n.push({routeRef:a,plugin:p})}$r(s.props.children,n)}),n}const Ao=ke(()=>({paths:new Map,parents:new Map,objects:new Array}),(i,n,s,a)=>{var p,A;if(a!=null&&a.isElementAncestor)return a;if((s==null?void 0:s.props.element)===n)return{...a,isElementAncestor:!0};const k=(p=n.props)===null||p===void 0?void 0:p.path,M=(0,g.IY)(n,"core.mountPoint");if(M&&k)throw new Error(`Path property may not be set directly on a routable extension "${Br(n)}"`);var ae;const xe=(ae=a==null||(A=a.obj)===null||A===void 0?void 0:A.children)!==null&&ae!==void 0?ae:i.objects;if(k!==void 0){if(typeof k!="string")throw new Error(`Element path must be a string at "${Br(n)}"`);const Tt=k.startsWith("/")?k.slice(1):k,Rt=n.props.element;if((0,g.IY)(n,"core.gatherMountPoints")){var Ie;if(Rt)throw new Error(`Mount point gatherers may not have an element prop "${Br(n)}"`);const Wt={path:Tt,element:"gathered",routeRefs:new Set,caseSensitive:Boolean((Ie=n.props)===null||Ie===void 0?void 0:Ie.caseSensitive),children:[br],plugin:void 0};return xe.push(Wt),{obj:Wt,gatherPath:Tt,routeRef:a==null?void 0:a.routeRef,gatherRouteRef:a==null?void 0:a.routeRef}}if(Rt){var Ve;const[Wt,...Gt]=$r(Rt);if(Gt.length>0)throw new Error(`Route element with path "${k}" may not contain multiple routable extensions`);if(!Wt)return a;const{routeRef:$n,plugin:Xn}=Wt,fr={path:Tt,element:"mounted",routeRefs:new Set([$n]),caseSensitive:Boolean((Ve=n.props)===null||Ve===void 0?void 0:Ve.caseSensitive),children:[br],plugin:Xn};return xe.push(fr),i.paths.set($n,Tt),i.parents.set($n,a==null?void 0:a.routeRef),{obj:fr,routeRef:$n!=null?$n:a==null?void 0:a.routeRef,gatherPath:Tt,gatherRouteRef:a==null?void 0:a.gatherRouteRef}}}if(M){var gt;if((a==null?void 0:a.gatherPath)===void 0)throw new Error(`Routable extension "${Br(n)}" with mount point "${M}" must be assigned a path`);return a==null||(gt=a.obj)===null||gt===void 0||gt.routeRefs.add(M),i.paths.set(M,a.gatherPath),i.parents.set(M,a==null?void 0:a.gatherRouteRef),{...a,routeRef:M}}return a}),eo=ke(()=>({paths:new Map,parents:new Map,objects:new Array}),(i,n,s,a)=>{var p,A,k;if((s==null?void 0:s.props.element)===n)return a;let M=a==null?void 0:a.obj,ae=a==null?void 0:a.routeRef,xe=a==null?void 0:a.sticky;const Ie=(p=n.props)===null||p===void 0?void 0:p.path;var Ve;const gt=(Ve=M==null?void 0:M.children)!==null&&Ve!==void 0?Ve:i.objects,Tt=Boolean((A=n.props)===null||A===void 0?void 0:A.caseSensitive);let Rt=a==null?void 0:a.path;if((0,g.IY)(n,"core.gatherMountPoints")){if(!Ie)throw new Error("Mount point gatherer must have a path");Rt=Ie}const Wt=(k=n.props)===null||k===void 0?void 0:k.element;let Gt=(0,g.IY)(n,"core.mountPoint");if(!Gt&&(0,H.isValidElement)(Wt)&&(Gt=(0,g.IY)(Wt,"core.mountPoint")),Gt){let fr=Ie;if(Rt&&(fr?Rt=void 0:fr=Rt),!fr)throw new Error("Mounted routable extension must have a path");i.paths.set(Gt,fr),ae&&xe?(i.parents.set(Gt,ae),Ie&&(ae=Gt,xe=!1)):(i.parents.set(Gt,ae),ae=Gt),Ie?(M={caseSensitive:Tt,path:Ie,element:"mounted",routeRefs:new Set([Gt]),children:[br],plugin:(0,g.IY)(n.props.element,"core.plugin")},gt.push(M)):M==null||M.routeRefs.add(Gt)}if((0,g.IY)(n,"core.gatherMountPoints")&&(xe=!0),(0,g.IY)(n,"core.gatherMountPoints")){if(!Ie)throw new Error("Mount point gatherer must have a path");if(!Gt){var Xn;M={caseSensitive:Tt,path:Ie,element:"gathered",routeRefs:new Set,children:[br],plugin:a==null||(Xn=a.obj)===null||Xn===void 0?void 0:Xn.plugin},gt.push(M)}}return{obj:M,path:Rt,routeRef:ae,sticky:xe}}),Sr=ke(()=>new Set,(i,n)=>{if(n.type===kn){const s=n.props;i.add("with"in s?s.with:s.without)}}),Rr=(0,ot.uW)("route-ref-type",()=>Symbol("route-ref-type"));function or(i){return i[Rr]==="absolute"}function Kn(i){return i[Rr]==="sub"}function Ir(i){return i[Rr]==="external"}function Cr(...i){const n=i.join("/").replace(/\/\/+/g,"/");return n!=="/"&&n.endsWith("/")?n.slice(0,-1):n}function To(i,n,s){let a,p="";if(or(i))a=i;else if(Kn(i))a=i.parent,p=i.path;else if(Ir(i)){const M=s.get(i);if(!M)return[void 0,""];if(or(M))a=M;else if(Kn(M))a=M.parent,p=M.path;else throw new Error(`ExternalRouteRef was bound to invalid target, ${M}`)}else throw i[Rr]?new Error(`Unknown or invalid route ref type, ${i[Rr]}`):new Error(`Unknown object passed to useRouteRef, got ${i}`);if(!a)return[void 0,""];const A=n.get(a);if(A===void 0)return[void 0,""];const k=Cr(A,p);return[a,k]}function Ro(i,n,s,a,p){var A;const k=(A=(0,zn.fp)(p,n))!==null&&A!==void 0?A:[],M=Array();let ae=-1;for(let Ve=i;Ve&&(ae=k.findIndex(gt=>gt.route.routeRefs.has(Ve)),ae===-1);Ve=a.get(Ve))M.unshift(Ve);M.length===0&&(ae-=1);const xe=ae===-1?"":k[ae].pathname,Ie=M.slice(0,-1).map(Ve=>{const gt=s.get(Ve);if(gt===void 0)throw new Error(`No path for ${Ve}`);if(gt.includes(":"))throw new Error(`Cannot route to ${i} with parent ${Ve} as it has parameters`);return gt});return`${Cr(xe,...Ie)}/`}class to{resolve(n,s){const[a,p]=To(n,this.routePaths,this.routeBindings);if(!a)return;let A;typeof s=="string"?A=this.trimPath(s):s.pathname?A={...s,pathname:this.trimPath(s.pathname)}:A=s;const k=this.appBasePath+Ro(a,A,this.routePaths,this.routeParents,this.routeObjects);return(...[ae])=>Cr(k,(0,zn.Gn)(p,ae))}trimPath(n){return n&&(n.startsWith(this.appBasePath)?n.slice(this.appBasePath.length):n)}constructor(n,s,a,p,A){(0,z._)(this,"routePaths",void 0),(0,z._)(this,"routeParents",void 0),(0,z._)(this,"routeObjects",void 0),(0,z._)(this,"routeBindings",void 0),(0,z._)(this,"appBasePath",void 0),this.routePaths=n,this.routeParents=s,this.routeObjects=a,this.routeBindings=p,this.appBasePath=A}}const Io=(0,ot.CT)("routing-context"),Po=({routePaths:i,routeParents:n,routeObjects:s,routeBindings:a,basePath:p="",children:A})=>{const k=new to(i,n,s,a,p),M=(0,ot.EI)({1:k});return(0,h.jsx)(Io.Provider,{value:M,children:A})};function Wr(i,n){const s=new Set(n.values());s.delete(void 0);for(const a of n.keys()){if(s.has(a))continue;let p=a,A="";for(;p;){const M=i.get(p);if(M===void 0)throw new Error(`No path for ${p}`);A=Cr(M,A),p=n.get(p)}const k=A.match(/:(\w+)/g);if(k){for(let M=0;M<k.length;M++)for(let ae=M+1;ae<k.length;ae++)if(k[ae]===k[M])throw new Error(`Parameter ${k[ae]} is duplicated in path ${A}`)}}}function tr(i,n){for(const s of n)if(s.externalRoutes){for(const[a,p]of Object.entries(s.externalRoutes))if(!p.optional&&!i.has(p))throw new Error(`External route '${a}' of the '${s.getId()}' plugin must be bound to a target route. See https://backstage.io/link?bind-routes for details.`)}}const Dr=(0,ot.CT)("app-context"),Zr=({appContext:i,children:n})=>{const s=(0,ot.EI)({1:i});return(0,h.jsx)(Dr.Provider,{value:s,children:n})};function no(i){return new Error(`Tried to access IdentityApi ${i} before app was loaded`)}function Pr(i){console.warn(`WARNING: Call to ${i} is deprecated and will break in the future`)}class Vr{setTarget(n,s){this.target=n,this.signOutTargetUrl=s.signOutTargetUrl,this.resolveTarget(n)}getUserId(){if(!this.target)throw no("getUserId");if(!this.target.getUserId)throw new Error("IdentityApi does not implement getUserId");return Pr("getUserId"),this.target.getUserId()}getProfile(){if(!this.target)throw no("getProfile");if(!this.target.getProfile)throw new Error("IdentityApi does not implement getProfile");return Pr("getProfile"),this.target.getProfile()}async getProfileInfo(){return this.waitForTarget.then(n=>n.getProfileInfo())}async getBackstageIdentity(){const n=await this.waitForTarget.then(s=>s.getBackstageIdentity());return n.userEntityRef.match(/^.*:.*\/.*$/)||console.warn(`WARNING: The App IdentityApi provided an invalid userEntityRef, '${n.userEntityRef}'. It must be a full Entity Reference of the form '<kind>:<namespace>/<name>'.`),n}async getCredentials(){return this.waitForTarget.then(n=>n.getCredentials())}async getIdToken(){return this.waitForTarget.then(n=>{if(!n.getIdToken)throw new Error("IdentityApi does not implement getIdToken");return Pr("getIdToken"),n.getIdToken()})}async signOut(){await this.waitForTarget.then(n=>n.signOut()),window.location.href=this.signOutTargetUrl}constructor(){(0,z._)(this,"target",void 0),(0,z._)(this,"waitForTarget",void 0),(0,z._)(this,"resolveTarget",()=>{}),(0,z._)(this,"signOutTargetUrl","/"),this.waitForTarget=new Promise(n=>{this.resolveTarget=n})}}var Lo=r(72164);function ro(i,n,s){if(i!==void 0){const p=s.find(A=>A.id===i);if(p)return p}if(n){const p=s.find(A=>A.variant==="dark");if(p)return p}const a=s.find(p=>p.variant==="light");return a||s[0]}const Sn=()=>{const i=(0,H.useMemo)(()=>window.matchMedia("(prefers-color-scheme: dark)"),[]),[n,s]=(0,H.useState)(i.matches);return(0,H.useEffect)(()=>{const a=p=>{s(p.matches)};return i.addListener(a),()=>{i.removeListener(a)}},[i]),n};function oo({children:i}){const n=(0,g.h_)(g.hg),s=(0,Lo.Z)(n.activeThemeId$(),n.getActiveThemeId()),a=Boolean(window.matchMedia)?Sn():!1,p=ro(s,a,n.getInstalledThemes());if(!p)throw new Error("App has no themes");return(0,h.jsx)(p.Provider,{children:i})}const so=async(i="__APP_INJECTED_RUNTIME_CONFIG__")=>{const n=[{context:"app-config.yaml",data:{app:{title:"Techdocs Preview App",baseUrl:"http://localhost:3000"},backend:{baseUrl:"http://localhost:3000"},techdocs:{builder:"external"}}}];if(!n)throw new Error("No static configuration provided");if(!Array.isArray(n))throw new Error("Static configuration has invalid format");const s=n.slice();if(i!=="__app_injected_runtime_config__".toLocaleUpperCase("en-US"))try{const p=JSON.parse(i);Array.isArray(p)?s.push(...p):s.push({data:p,context:"env"})}catch(p){throw new Error(`Failed to load runtime configuration, ${p}`)}const a=window.__APP_CONFIG__;return a&&s.push({context:"window",data:a}),s};class io{add(n,s){return this.apis.push([n.id,s]),s}build(){return new wr(new Map(this.apis))}constructor(){(0,z._)(this,"apis",[])}}class wr{static builder(){return new io}static from(n){return new wr(new Map(n.map(([s,a])=>[s.id,a])))}static with(n,s){return new wr(new Map([[n.id,s]]))}with(n,s){return new wr(new Map([...this.apis,[n.id,s]]))}get(n){return this.apis.get(n.id)}constructor(n){(0,z._)(this,"apis",void 0),this.apis=n}}function Oo(i){const n=new Map;return i&&i({bind:(a,p)=>{for(const[A,k]of Object.entries(p)){const M=a[A];if(!M)throw new Error(`Key ${A} is not an existing external route`);if(!k&&!M.optional)throw new Error(`External route ${A} is required but was undefined`);k&&n.set(M,k)}}}),n}function ao(i){const n=new URL(i);return n.protocol=document.location.protocol,n.hostname=document.location.hostname,n.port=document.location.port,n.toString().replace(/\/$/,"")}function ko(i,n,s){var a;const p=Boolean(i),A=(0,be.default)(i||(()=>Promise.resolve([])));let k;if(p&&A.loading){const{Progress:xe}=n;k=(0,h.jsx)(xe,{})}else if(A.error){const{BootErrorPage:xe}=n;k=(0,h.jsx)(xe,{step:"load-config",error:A.error})}const{ThemeProvider:M=oo}=n;if(k)return{node:(0,h.jsx)(st,{apis:wr.with(g.hg,s),children:(0,h.jsx)(M,{children:k})})};let ae;if(!((a=A.value)===null||a===void 0)&&a.length){const xe=le.fromConfigs(A.value),Ie=xe.getOptionalString("app.baseUrl"),Ve=xe.getOptionalString("backend.baseUrl");let gt=A.value;const Tt={data:{},context:"relative-resolver"};if(Ie&&Ve){const Rt=new URL(Ie).origin,Wt=new URL(Ve).origin;if(Rt===Wt){const Gt=ao(Ve);Ve!==Gt&&(Tt.data.backend={baseUrl:Gt})}}if(Ie){const Rt=ao(Ie);Ie!==Rt&&(Tt.data.app={baseUrl:Rt})}Object.keys(Tt.data).length&&(gt=gt.concat([Tt])),ae=le.fromConfigs(gt)}else ae=le.fromConfigs([]);return{api:ae}}class lo{getPlugins(){return this.app.getPlugins()}getSystemIcon(n){return this.app.getSystemIcon(n)}getSystemIcons(){return this.app.getSystemIcons()}getComponents(){return this.app.getComponents()}constructor(n){(0,z._)(this,"app",void 0),this.app=n}}var jr=new WeakMap;class us{getPlugins(){return Array.from(this.plugins)}getSystemIcon(n){return this.icons[n]}getSystemIcons(){return this.icons}getComponents(){return this.components}createRoot(n){const s=this.getProvider();return()=>(0,h.jsx)(s,{children:n})}getProvider(){if((0,b._)(this,jr))throw new Error("app.getProvider() or app.createRoot() has already been called, and can only be called once");(0,Q._)(this,jr,!0);const n=new lo(this);let s=!1;return({children:p})=>{const A=(0,H.useRef)(!0),k=(0,H.useMemo)(()=>et.createWithStorage(this.themes),[]),{routing:M,featureFlags:ae,routeBindings:xe}=(0,H.useMemo)(()=>{const Tt=je({root:p,discoverers:[ht,ft],collectors:{routing:bn()?eo:Ao,collectedPlugins:yn,featureFlags:Sr}});return Tt.collectedPlugins.forEach(Rt=>this.plugins.add(Rt)),this.verifyPlugins(this.plugins),this.getApiHolder(),{...Tt,routeBindings:Oo(this.bindRoutes)}},[p]);s||(s=!0,Wr(M.paths,M.parents),tr(xe,this.plugins));const Ie=ko(this.configLoader,this.components,k),Ve="api"in Ie;if(Ve){const{api:Tt}=Ie;this.configApi=Tt}if("node"in Ie)return Ie.node;if(Ve&&A.current){A.current=!1;const Tt=this.getApiHolder().get(g.W0);if(Tt){for(const Gt of this.featureFlags)Tt.registerFlag({...Gt,pluginId:""});for(const Gt of this.plugins.values())if("getFeatureFlags"in Gt)for(const $n of Gt.getFeatureFlags())Tt.registerFlag({name:$n.name,pluginId:Gt.getId()});else for(const $n of Gt.output())$n.type==="feature-flag"&&Tt.registerFlag({name:$n.name,pluginId:Gt.getId()});const Rt=Tt.getRegisteredFlags(),Wt=new Set(Rt.map(Gt=>Gt.name));for(const Gt of ae)Wt.has(Gt)||Tt.registerFlag({name:Gt,pluginId:""})}}const{ThemeProvider:gt=oo}=this.components;return(0,h.jsx)(st,{apis:this.getApiHolder(),children:(0,h.jsx)(Zr,{appContext:n,children:(0,h.jsx)(gt,{children:(0,h.jsx)(Po,{routePaths:M.paths,routeParents:M.parents,routeObjects:M.objects,routeBindings:xe,basePath:On(Ie.api),children:(0,h.jsx)(Zt.Provider,{value:{routeObjects:M.objects,appIdentityProxy:this.appIdentityProxy},children:p})})})})})}}getRouter(){return c}getApiHolder(){if(this.apiHolder){for(const n of this.plugins)for(const s of n.getApis())this.apiFactoryRegistry.get(s.api)||this.apiFactoryRegistry.register("default",s);return Qe.validateFactories(this.apiFactoryRegistry,this.apiFactoryRegistry.getAllApis()),this.apiHolder}this.apiFactoryRegistry.register("static",{api:g.hg,deps:{},factory:()=>et.createWithStorage(this.themes)}),this.apiFactoryRegistry.register("static",{api:g.Ds,deps:{},factory:()=>{if(!this.configApi)throw new Error("Tried to access config API before config was loaded");return this.configApi}}),this.apiFactoryRegistry.register("static",{api:g.$4,deps:{},factory:()=>this.appIdentityProxy}),this.apiFactoryRegistry.register("default",{api:g.W0,deps:{},factory:()=>new Ye});for(const n of this.defaultApis)this.apiFactoryRegistry.register("default",n);for(const n of this.plugins)for(const s of n.getApis())if(!this.apiFactoryRegistry.register("default",s))throw new Error(`Plugin ${n.getId()} tried to register duplicate or forbidden API factory for ${s.api}`);for(const n of this.apis)if(!this.apiFactoryRegistry.register("app",n))throw new Error(`Duplicate or forbidden API factory for ${n.api} in app`);return Qe.validateFactories(this.apiFactoryRegistry,this.apiFactoryRegistry.getAllApis()),this.apiHolder=new Qe(this.apiFactoryRegistry),this.apiHolder}verifyPlugins(n){const s=new Set;for(const a of n){const p=a.getId();if(s.has(p))throw new Error(`Duplicate plugin found '${p}'`);s.add(p)}}constructor(n){(0,z._)(this,"apiHolder",void 0),(0,z._)(this,"configApi",void 0),(0,z._)(this,"apis",void 0),(0,z._)(this,"icons",void 0),(0,z._)(this,"plugins",void 0),(0,z._)(this,"featureFlags",void 0),(0,z._)(this,"components",void 0),(0,z._)(this,"themes",void 0),(0,z._)(this,"configLoader",void 0),(0,z._)(this,"defaultApis",void 0),(0,z._)(this,"bindRoutes",void 0),(0,z._)(this,"appIdentityProxy",new Vr),(0,z._)(this,"apiFactoryRegistry",void 0),(0,E._)(this,jr,{writable:!0,value:!1});var s;this.apis=(s=n.apis)!==null&&s!==void 0?s:[],this.icons=n.icons;var a;this.plugins=new Set((a=n.plugins)!==null&&a!==void 0?a:[]);var p;this.featureFlags=(p=n.featureFlags)!==null&&p!==void 0?p:[],this.components=n.components,this.themes=n.themes;var A;this.configLoader=(A=n.configLoader)!==null&&A!==void 0?A:so;var k;this.defaultApis=(k=n.defaultApis)!==null&&k!==void 0?k:[],this.bindRoutes=n.bindRoutes,this.apiFactoryRegistry=new It}}function co(i){return new us(i)}let hr=!1;const Lr=i=>{const n=(0,g.qD)(),{NotFoundErrorPage:s}=n.getComponents(),a=(0,H.useMemo)(()=>bn(),[]),A=[...(0,g.vJ)(i.children,k=>k.getElements().flatMap(M=>{let ae=M.props.path;if(ae==="")return[];var xe;ae=(xe=ae==null?void 0:ae.replace(/\/\*$/,""))!==null&&xe!==void 0?xe:"/";let Ie=a?M:M.props.element;return!a&&!Ie&&(Ie=M,hr||(console.warn("DEPRECATION WARNING: All elements within <FlatRoutes> must be of type <Route> with an element prop. Existing usages of <Navigate key=[path] to=[to] /> should be replaced with <Route path=[path] element={<Navigate to=[to] />} />."),hr=!0)),[{path:ae,element:Ie,children:M.props.children?[{path:ae==="/"?"/":"*",element:M.props.children}]:void 0}]}).sort((M,ae)=>ae.path.localeCompare(M.path)).map(M=>({...M,path:M.path==="/"?"/":`${M.path}/*`}))),{path:"*",element:(0,h.jsx)(s,{})}];return(0,W.V$)(A)},Bo=(0,g.T0)({id:"plugin.permission.api"});var Yn;(function(i){i.DENY="DENY",i.ALLOW="ALLOW",i.CONDITIONAL="CONDITIONAL"})(Yn||(Yn={}));function Gs(i,n){return i.name===n.name}function $o(i,n){return"resourceType"in i?!n||i.resourceType===n:!1}function hs(i){return i.attributes.action==="create"}function ps(i){return i.attributes.action==="read"}function uo(i){return i.attributes.action==="update"}function fs(i){return i.attributes.action==="delete"}function gs(i){return{authorize:async(n,s)=>await i.authorize(n,s),authorizeConditional(n,s){const a=n;return i.authorize(a,s)}}}function sr({name:i,attributes:n,resourceType:s}){return s?{type:"resource",name:i,attributes:n,resourceType:s}:{type:"basic",name:i,attributes:n}}var Do=r(23054),Wn=r(96279),ho=r.n(Wn),Zo=r(9571);const Hr=ut.z.lazy(()=>ut.z.object({rule:ut.z.string(),resourceType:ut.z.string(),params:ut.z.record(ut.z.any()).optional()}).or(ut.z.object({anyOf:ut.z.array(Hr).nonempty()})).or(ut.z.object({allOf:ut.z.array(Hr).nonempty()})).or(ut.z.object({not:Hr}))),No=ut.z.object({result:ut.z.literal(Yn.ALLOW).or(ut.z.literal(Yn.DENY))}),Fo=ut.z.union([ut.z.object({result:ut.z.literal(Yn.ALLOW).or(ut.z.literal(Yn.DENY))}),ut.z.object({result:ut.z.literal(Yn.CONDITIONAL),pluginId:ut.z.string(),resourceType:ut.z.string(),conditions:Hr})]),ms=(i,n)=>ut.z.object({items:ut.z.array(ut.z.intersection(ut.z.object({id:ut.z.string()}),i)).refine(s=>s.length===n.size&&s.every(({id:a})=>n.has(a)),{message:"Items in response do not match request"})});class Uo{async authorize(n,s){return this.makeRequest(n,No,s)}async authorizeConditional(n,s){return this.makeRequest(n,Fo,s)}async makeRequest(n,s,a){if(!this.enabled)return n.map(Ie=>({result:Yn.ALLOW}));const p={items:n.map(Ie=>({id:Zo.Z(),...Ie}))},A=await this.discovery.getBaseUrl("permission"),k=await ho()(`${A}/authorize`,{method:"POST",body:JSON.stringify(p),headers:{...this.getAuthorizationHeader(a==null?void 0:a.token),"content-type":"application/json"}});if(!k.ok)throw await Do.VL.fromResponse(k);const M=await k.json(),xe=ms(s,new Set(p.items.map(({id:Ie})=>Ie))).parse(M).items.reduce((Ie,Ve)=>(Ie[Ve.id]=Ve,Ie),{});return p.items.map(Ie=>xe[Ie.id])}getAuthorizationHeader(n){return n?{Authorization:`Bearer ${n}`}:{}}constructor(n){(0,z._)(this,"enabled",void 0),(0,z._)(this,"discovery",void 0),this.discovery=n.discovery;var s;this.enabled=(s=n.config.getOptionalBoolean("permission.enabled"))!==null&&s!==void 0?s:!1}}class po{static create(n){const{config:s,discovery:a,identity:p}=n,A=new Uo({discovery:a,config:s});return new po(A,p)}async authorize(n){return(await this.permissionClient.authorize([n],await this.identityApi.getCredentials()))[0]}constructor(n,s){(0,z._)(this,"permissionClient",void 0),(0,z._)(this,"identityApi",void 0),this.permissionClient=n,this.identityApi=s}}var x=r(69984);function C(i){const n=(0,g.h_)(Bo),{data:s,error:a}=(0,x.ZP)(i,async p=>{if($o(p.permission)&&!p.resourceRef)return Yn.DENY;const{result:A}=await n.authorize(p);return A});return a?{error:a,loading:!1,allowed:!1}:s===void 0?{loading:!0,allowed:!1}:{loading:!1,allowed:s===Yn.ALLOW}}const R=i=>{const{permission:n,resourceRef:s,errorComponent:a,...p}=i,A=usePermission(isResourcePermission(n)?{permission:n,resourceRef:s}:{permission:n}),k=useApp(),{NotFoundErrorPage:M}=k.getComponents();let ae=a===void 0?_jsx(M,{}):a;return A.loading?ae=null:A.allowed&&(ae=i.element),_jsx(Route,{...p,element:ae})};function N(i){const{permission:n,resourceRef:s}=i,a=usePermission(isResourcePermission(n)?{permission:n,resourceRef:s}:{permission:n}),p=useApp();if(a.loading)return null;if(a.allowed)return _jsx(_Fragment,{children:i.children});if(i.errorPage)return _jsx(_Fragment,{children:i.errorPage});const{NotFoundErrorPage:A}=p.getComponents();return _jsx(A,{})}const re=[(0,g.ni)({api:g.NW,deps:{configApi:g.Ds},factory:({configApi:i})=>Z.compile(`${i.getString("backend.baseUrl")}/api/{{ pluginId }}`)}),(0,g.ni)({api:g.$v,deps:{},factory:()=>new D}),(0,g.ni)({api:g.v_,deps:{},factory:()=>new me}),(0,g.ni)({api:g.VE,deps:{alertApi:g.$v},factory:({alertApi:i})=>{const n=new q(i,new Y);return we.forward(n,{hidden:!1}),n}}),(0,g.ni)({api:g.E6,deps:{errorApi:g.VE},factory:({errorApi:i})=>Lt.create({errorApi:i})}),(0,g.ni)({api:g.gP,deps:{configApi:g.Ds,identityApi:g.$4,discoveryApi:g.NW},factory:({configApi:i,identityApi:n,discoveryApi:s})=>jt({middleware:[Mt.resolvePluginProtocol({discoveryApi:s}),Mt.injectIdentityAuth({identityApi:n,config:i})]})}),(0,g.ni)({api:g.ZM,deps:{},factory:()=>new zt}),(0,g.ni)({api:g.Kp,deps:{discoveryApi:g.NW,oauthRequestApi:g.ZM,configApi:g.Ds},factory:({discoveryApi:i,oauthRequestApi:n,configApi:s})=>Ln.create({configApi:s,discoveryApi:i,oauthRequestApi:n,environment:s.getOptionalString("auth.environment")})}),(0,g.ni)({api:g.p_,deps:{discoveryApi:g.NW,oauthRequestApi:g.ZM,configApi:g.Ds},factory:({discoveryApi:i,oauthRequestApi:n,configApi:s})=>Kt.create({configApi:s,discoveryApi:i,oauthRequestApi:n,environment:s.getOptionalString("auth.environment")})}),(0,g.ni)({api:g.F4,deps:{discoveryApi:g.NW,oauthRequestApi:g.ZM,configApi:g.Ds},factory:({discoveryApi:i,oauthRequestApi:n,configApi:s})=>Yt.create({configApi:s,discoveryApi:i,oauthRequestApi:n,defaultScopes:["read:user"],environment:s.getOptionalString("auth.environment")})}),(0,g.ni)({api:g.D,deps:{discoveryApi:g.NW,oauthRequestApi:g.ZM,configApi:g.Ds},factory:({discoveryApi:i,oauthRequestApi:n,configApi:s})=>Mn.create({configApi:s,discoveryApi:i,oauthRequestApi:n,environment:s.getOptionalString("auth.environment")})}),(0,g.ni)({api:g.ux,deps:{discoveryApi:g.NW,oauthRequestApi:g.ZM,configApi:g.Ds},factory:({discoveryApi:i,oauthRequestApi:n,configApi:s})=>Fn.create({configApi:s,discoveryApi:i,oauthRequestApi:n,environment:s.getOptionalString("auth.environment")})}),(0,g.ni)({api:g.gW,deps:{discoveryApi:g.NW,oauthRequestApi:g.ZM,configApi:g.Ds},factory:({discoveryApi:i,oauthRequestApi:n,configApi:s})=>Tn.create({configApi:s,discoveryApi:i,oauthRequestApi:n,environment:s.getOptionalString("auth.environment")})}),(0,g.ni)({api:g.bq,deps:{discoveryApi:g.NW,oauthRequestApi:g.ZM,configApi:g.Ds},factory:({discoveryApi:i,oauthRequestApi:n,configApi:s})=>ce.create({configApi:s,discoveryApi:i,oauthRequestApi:n,defaultScopes:["team"],environment:s.getOptionalString("auth.environment")})}),(0,g.ni)({api:g.Km,deps:{discoveryApi:g.NW,oauthRequestApi:g.ZM,configApi:g.Ds},factory:({discoveryApi:i,oauthRequestApi:n,configApi:s})=>Me.create({configApi:s,discoveryApi:i,oauthRequestApi:n,defaultScopes:["REPO_READ"]})}),(0,g.ni)({api:g.uB,deps:{discoveryApi:g.NW,oauthRequestApi:g.ZM,configApi:g.Ds},factory:({discoveryApi:i,oauthRequestApi:n,configApi:s})=>se.create({configApi:s,discoveryApi:i,oauthRequestApi:n,environment:s.getOptionalString("auth.environment")})}),(0,g.ni)({api:Bo,deps:{discovery:g.NW,identity:g.$4,config:g.Ds},factory:({config:i,discovery:n,identity:s})=>po.create({config:i,discovery:n,identity:s})})];var de=r(77277),X=r(53974),ye=r(71597);function Ee({children:i}){return(0,W.GV)()?(0,h.jsx)(h.Fragment,{children:i}):(0,h.jsx)(W.VA,{children:i})}const Re=()=>(0,h.jsx)(X.mf,{status:"404",statusMessage:"PAGE NOT FOUND"}),Ze=({step:i,error:n})=>{let s="";return i==="load-config"?s=`The configuration failed to load, someone should have a look at this error: ${n.message}`:i==="load-chunk"&&(s=`Lazy loaded chunk failed to load, try to reload the page: ${n.message}`),(0,h.jsx)(Ee,{children:(0,h.jsx)(X.mf,{status:"501",statusMessage:s})})},Ne=({error:i,resetError:n,plugin:s})=>(0,h.jsx)(X.yu,{title:`Error in ${s==null?void 0:s.getId()}`,defaultExpanded:!0,error:i,children:(0,h.jsx)(de.Z,{variant:"outlined",onClick:n,children:"Retry"})}),rt={Progress:X.Ex,Router:ye.VK,NotFoundErrorPage:Re,BootErrorPage:Ze,ErrorBoundaryFallback:Ne};var qe=r(43642),Ge=r(80079),Be=r(90941),Je=r(32915),At=r(40562),cn=r(21853),qt=r(60744),on=r(66569),nn=r(30254),An=r(13384),Rn=r(15933),Er=r(58838),Nr=r(86737),Gr=r(4989),In=r(44407),Vn=r(18628),Or=r(84219),Mo=r(98685),Fi=r(39781),vs=r(39412);const Ks={brokenImage:Ge.Z,catalog:Vn.Z,scaffolder:Je.Z,techdocs:At.Z,search:cn.Z,chat:qt.Z,dashboard:on.Z,docs:nn.Z,email:An.Z,github:Er.Z,group:Or.Z,help:Nr.Z,"kind:api":Rn.Z,"kind:component":In.Z,"kind:domain":qe.Z,"kind:group":Or.Z,"kind:location":Gr.Z,"kind:system":Be.Z,"kind:user":Mo.Z,"kind:resource":vs.Z,user:Mo.Z,warning:Fi.Z};var ys=r(73689),zo=r(48032);const ir={wave:`url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='1368' height='400' fill='none'%3e%3cmask id='a' width='1368' height='401' x='0' y='0' maskUnits='userSpaceOnUse'%3e%3cpath fill='url(%23paint0_linear)' d='M437 116C223 116 112 0 112 0h1256v400c-82 0-225-21-282-109-112-175-436-175-649-175z'/%3e%3cpath fill='url(%23paint1_linear)' d='M1368 400V282C891-29 788 40 711 161 608 324 121 372 0 361v39h1368z'/%3e%3cpath fill='url(%23paint2_linear)' d='M1368 244v156H0V94c92-24 198-46 375 0l135 41c176 51 195 109 858 109z'/%3e%3cpath fill='url(%23paint3_linear)' d='M1252 400h116c-14-7-35-14-116-16-663-14-837-128-1013-258l-85-61C98 28 46 8 0 0v400h1252z'/%3e%3c/mask%3e%3cg mask='url(%23a)'%3e%3cpath fill='white' d='M-172-98h1671v601H-172z'/%3e%3c/g%3e%3cdefs%3e%3clinearGradient id='paint0_linear' x1='602' x2='1093.5' y1='-960.5' y2='272' gradientUnits='userSpaceOnUse'%3e%3cstop stop-color='white'/%3e%3cstop offset='1' stop-color='white' stop-opacity='0'/%3e%3c/linearGradient%3e%3clinearGradient id='paint1_linear' x1='482' x2='480' y1='1058.5' y2='70.5' gradientUnits='userSpaceOnUse'%3e%3cstop stop-color='white'/%3e%3cstop offset='1' stop-color='white' stop-opacity='0'/%3e%3c/linearGradient%3e%3clinearGradient id='paint2_linear' x1='424' x2='446.1' y1='-587.5' y2='274.6' gradientUnits='userSpaceOnUse'%3e%3cstop stop-color='white'/%3e%3cstop offset='1' stop-color='white' stop-opacity='0'/%3e%3c/linearGradient%3e%3clinearGradient id='paint3_linear' x1='587' x2='349' y1='-1120.5' y2='341' gradientUnits='userSpaceOnUse'%3e%3cstop stop-color='white'/%3e%3cstop offset='1' stop-color='white' stop-opacity='0'/%3e%3c/linearGradient%3e%3c/defs%3e%3c/svg%3e")`,wave2:`url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='1368' height='400' fill='none'%3e%3cmask id='a' width='1764' height='479' x='-229' y='-6' maskUnits='userSpaceOnUse'%3e%3cpath fill='url(%23paint0_linear)' d='M0 400h1350C1321 336 525 33 179-2c-345-34-395 236-408 402H0z'/%3e%3cpath fill='url(%23paint1_linear)' d='M1378 177v223H0V217s219 75 327 52C436 246 717-35 965 45s254 144 413 132z'/%3e%3cpath fill='url(%23paint2_linear)' d='M26 400l-78-16c-170 205-44-6-137-30l-4-1 4 1 137 30c37-45 89-110 159-201 399-514-45 238 1176-50 275-65 354-39 91 267H26z'/%3e%3c/mask%3e%3cg mask='url(%23a)'%3e%3cpath fill='white' d='M0 0h1368v400H0z'/%3e%3c/g%3e%3cdefs%3e%3clinearGradient id='paint0_linear' x1='431' x2='397.3' y1='-599' y2='372.8' gradientUnits='userSpaceOnUse'%3e%3cstop stop-color='white'/%3e%3cstop offset='1' stop-color='white' stop-opacity='0'/%3e%3c/linearGradient%3e%3clinearGradient id='paint1_linear' x1='236.5' x2='446.6' y1='-586' y2='381.5' gradientUnits='userSpaceOnUse'%3e%3cstop stop-color='white'/%3e%3cstop offset='1' stop-color='white' stop-opacity='0'/%3e%3c/linearGradient%3e%3clinearGradient id='paint2_linear' x1='851.8' x2='640.4' y1='-867.2' y2='363.7' gradientUnits='userSpaceOnUse'%3e%3cstop stop-color='white'/%3e%3cstop offset='1' stop-color='white' stop-opacity='0'/%3e%3c/linearGradient%3e%3c/defs%3e%3c/svg%3e")`,round:`url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='1368' height='400' fill='none'%3e%3cmask id='a' width='2269' height='1408' x='-610' y='-509' maskUnits='userSpaceOnUse'%3e%3ccircle cx='1212.8' cy='74.8' r='317.5' fill='url(%23paint0_linear)' transform='rotate(-52 1213 75)'/%3e%3ccircle cx='737.8' cy='445.8' r='317.5' fill='url(%23paint1_linear)' transform='rotate(-116 738 446)'/%3e%3ccircle cx='601.8' cy='52.8' r='418.6' fill='url(%23paint2_linear)' transform='rotate(-117 602 53)'/%3e%3ccircle cx='999.8' cy='364' r='389.1' fill='url(%23paint3_linear)' transform='rotate(31 1000 364)'/%3e%3cellipse cx='-109.2' cy='263.5' fill='url(%23paint4_linear)' rx='429.2' ry='465.8' transform='rotate(-85 -109 264)'/%3e%3c/mask%3e%3cg mask='url(%23a)'%3e%3cpath fill='white' d='M0 0h1368v400H0z'/%3e%3c/g%3e%3cdefs%3e%3clinearGradient id='paint0_linear' x1='1301.2' x2='161.4' y1='-1879.7' y2='-969.6' gradientUnits='userSpaceOnUse'%3e%3cstop stop-color='white'/%3e%3cstop offset='1' stop-color='white' stop-opacity='0'/%3e%3c/linearGradient%3e%3clinearGradient id='paint1_linear' x1='826.2' x2='-313.6' y1='-1508.7' y2='-598.6' gradientUnits='userSpaceOnUse'%3e%3cstop stop-color='white'/%3e%3cstop offset='1' stop-color='white' stop-opacity='0'/%3e%3c/linearGradient%3e%3clinearGradient id='paint2_linear' x1='718.4' x2='-784.3' y1='-2524' y2='-1324.2' gradientUnits='userSpaceOnUse'%3e%3cstop stop-color='white'/%3e%3cstop offset='1' stop-color='white' stop-opacity='0'/%3e%3c/linearGradient%3e%3clinearGradient id='paint3_linear' x1='1108.2' x2='-288.6' y1='-2031.1' y2='-915.9' gradientUnits='userSpaceOnUse'%3e%3cstop stop-color='white'/%3e%3cstop offset='1' stop-color='white' stop-opacity='0'/%3e%3c/linearGradient%3e%3clinearGradient id='paint4_linear' x1='10.4' x2='-1626.5' y1='-2603.8' y2='-1399.5' gradientUnits='userSpaceOnUse'%3e%3cstop stop-color='white'/%3e%3cstop offset='1' stop-color='white' stop-opacity='0'/%3e%3c/linearGradient%3e%3c/defs%3e%3c/svg%3e")`},ar={darkGrey:["#171717","#383838"],marineBlue:["#006D8F","#0049A1"],veryBlue:["#0027AF","#270094"],rubyRed:["#98002B","#8D1134"],toastyOrange:["#BE2200","#A41D00"],purpleSky:["#8912CA","#3E00EA"],eveningSea:["#00FFF2","#035355"],teal:["#005B4B"],pinkSea:["#C8077A","#C2297D"],greens:["#4BB8A5","#187656"]};function Jn(i){const{colors:n,shape:s,options:a}=i,A=`linear-gradient(90deg, ${(n.length===1?[n[0],n[0]]:n).join(", ")})`,k=`${s}, ${A}`;var M;const ae=(M=a==null?void 0:a.fontColor)!==null&&M!==void 0?M:"#FFFFFF";return{colors:n,shape:s,backgroundImage:k,fontColor:ae}}const Wo={home:Jn({colors:ar.teal,shape:ir.wave}),documentation:Jn({colors:ar.pinkSea,shape:ir.wave2}),tool:Jn({colors:ar.purpleSky,shape:ir.round}),service:Jn({colors:ar.marineBlue,shape:ir.wave}),website:Jn({colors:ar.veryBlue,shape:ir.wave}),library:Jn({colors:ar.rubyRed,shape:ir.wave}),other:Jn({colors:ar.darkGrey,shape:ir.wave}),app:Jn({colors:ar.toastyOrange,shape:ir.wave}),apis:Jn({colors:ar.teal,shape:ir.wave2}),card:Jn({colors:ar.greens,shape:ir.wave})},Ys=16,Js='"Helvetica Neue", Helvetica, Roboto, Arial, sans-serif';function Ui(i){const{palette:n,htmlFontSize:s=Ys,fontFamily:a=Js,defaultPageTheme:p,pageTheme:A=Wo}=i;if(!A[p])throw new Error(`${p} is not defined in pageTheme.`);var k;return{palette:n,props:{MuiGrid:{spacing:2},MuiSwitch:{color:"primary"}},typography:{htmlFontSize:s,fontFamily:a,h6:{fontWeight:700,fontSize:20,marginBottom:2},h5:{fontWeight:700,fontSize:24,marginBottom:4},h4:{fontWeight:700,fontSize:28,marginBottom:6},h3:{fontSize:32,fontWeight:700,marginBottom:6},h2:{fontSize:40,fontWeight:700,marginBottom:8},h1:{fontSize:54,fontWeight:700,marginBottom:10}},page:A[p],getPageTheme:({themeId:M})=>(k=A[M])!==null&&k!==void 0?k:A[p]}}function Qs(i){return{MuiCssBaseline:{"@global":{html:{height:"100%",fontFamily:i.typography.fontFamily},body:{height:"100%",fontFamily:i.typography.fontFamily,"overscroll-behavior-y":"none"},a:{color:"inherit",textDecoration:"none"}}},MuiTableRow:{root:{"&:nth-of-type(odd)":{backgroundColor:i.palette.background.default}},hover:{"&:hover":{cursor:"pointer"}},head:{"&:nth-of-type(odd)":{backgroundColor:i.palette.background.paper}}},MuiTableCell:{root:{wordBreak:"break-word",overflow:"hidden",verticalAlign:"middle",lineHeight:"1",margin:0,padding:i.spacing(3,2,3,2.5),borderBottom:0},sizeSmall:{padding:i.spacing(1.5,2,1.5,2.5)},head:{wordBreak:"break-word",overflow:"hidden",fontWeight:"normal",lineHeight:"1"}},MuiTabs:{root:{minHeight:24}},MuiTab:{root:{color:i.palette.link,minHeight:24,textTransform:"initial",letterSpacing:"0.07em","&:hover":{color:(0,zo.darken)(i.palette.link,.3),background:(0,zo.lighten)(i.palette.link,.95)},[i.breakpoints.up("md")]:{minWidth:120,fontSize:i.typography.pxToRem(14),fontWeight:500}},textColorPrimary:{color:i.palette.link}},MuiTableSortLabel:{root:{color:"inherit","&:hover":{color:"inherit"}},active:{fontWeight:"bold"}},MuiListItemText:{dense:{whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"}},MuiButton:{text:{padding:void 0}},MuiChip:{root:{backgroundColor:"#D9D9D9",marginRight:i.spacing(1),marginBottom:i.spacing(1),color:i.palette.grey[900]},outlined:{color:i.palette.text.primary},label:{lineHeight:`${i.spacing(2.5)}px`,fontWeight:i.typography.fontWeightMedium,fontSize:`${i.spacing(1.75)}px`},labelSmall:{fontSize:`${i.spacing(1.5)}px`},deleteIcon:{color:i.palette.grey[500],width:`${i.spacing(3)}px`,height:`${i.spacing(3)}px`,margin:`0 ${i.spacing(.75)}px 0 -${i.spacing(.75)}px`},deleteIconSmall:{width:`${i.spacing(2)}px`,height:`${i.spacing(2)}px`,margin:`0 ${i.spacing(.5)}px 0 -${i.spacing(.5)}px`}},MuiCard:{root:{display:"flex",flexDirection:"column"}},MuiCardHeader:{root:{paddingBottom:0}},MuiCardContent:{root:{flexGrow:1,"&:last-child":{paddingBottom:void 0}}},MuiCardActions:{root:{justifyContent:"flex-end"}}}}function xs(i){const n=Ui(i),s=(0,ys.Z)(n),a=Qs(s);return{...s,overrides:a}}var Vo=r(34505);const Kr=xs({palette:{type:"light",background:{default:"#F8F8F8"},status:{ok:"#1DB954",warning:"#FF9800",error:"#E22134",running:"#1F5493",pending:"#FFED51",aborted:"#757575"},bursts:{fontColor:"#FEFEFE",slackChannelText:"#ddd",backgroundColor:{default:"#7C3699"},gradient:{linear:"linear-gradient(-137deg, #4BB8A5 0%, #187656 100%)"}},primary:{main:"#1F5493"},banner:{info:"#2E77D0",error:"#E22134",text:"#FFFFFF",link:"#000000",closeButtonColor:"#FFFFFF",warning:"#FF9800"},border:"#E6E6E6",textContrast:"#000000",textVerySubtle:"#DDD",textSubtle:"#6E6E6E",highlight:"#FFFBCC",errorBackground:"#FFEBEE",warningBackground:"#F59B23",infoBackground:"#ebf5ff",errorText:"#CA001B",infoText:"#004e8a",warningText:"#000000",linkHover:"#2196F3",link:"#0A6EBE",gold:Vo.Z.A700,navigation:{background:"#171717",indicator:"#9BF0E1",color:"#b5b5b5",selectedColor:"#FFF",navItem:{hoverBackground:"#404040"},submenu:{background:"#404040"}},pinSidebarButton:{icon:"#181818",background:"#BDBDBD"},tabbar:{indicator:"#9BF0E1"}},defaultPageTheme:"home",pageTheme:Wo}),Xs=xs({palette:{type:"dark",background:{default:"#333333"},status:{ok:"#71CF88",warning:"#FFB84D",error:"#F84C55",running:"#3488E3",pending:"#FEF071",aborted:"#9E9E9E"},bursts:{fontColor:"#FEFEFE",slackChannelText:"#ddd",backgroundColor:{default:"#7C3699"},gradient:{linear:"linear-gradient(-137deg, #4BB8A5 0%, #187656 100%)"}},primary:{main:"#9CC9FF",dark:"#82BAFD"},secondary:{main:"#FF88B2"},banner:{info:"#2E77D0",error:"#E22134",text:"#FFFFFF",link:"#000000",closeButtonColor:"#FFFFFF",warning:"#FF9800"},border:"#E6E6E6",textContrast:"#FFFFFF",textVerySubtle:"#727272",textSubtle:"#CCCCCC",highlight:"#FFFBCC",errorBackground:"#FFEBEE",warningBackground:"#F59B23",infoBackground:"#ebf5ff",errorText:"#CA001B",infoText:"#004e8a",warningText:"#000000",linkHover:"#82BAFD",link:"#9CC9FF",gold:Vo.Z.A700,navigation:{background:"#424242",indicator:"#9BF0E1",color:"#b5b5b5",selectedColor:"#FFF",navItem:{hoverBackground:"#404040"},submenu:{background:"#404040"}},pinSidebarButton:{icon:"#404040",background:"#BDBDBD"},tabbar:{indicator:"#9BF0E1"}},defaultPageTheme:"home",pageTheme:Wo});var bs=r(98192),_s=r(15222),Ho=r(41547),Go=r(87561);const ei=[{id:"light",title:"Light Theme",variant:"light",icon:(0,h.jsx)(_s.Z,{}),Provider:({children:i})=>(0,h.jsx)(Ho.Z,{theme:Kr,children:(0,h.jsx)(Go.ZP,{children:i})})},{id:"dark",title:"Dark Theme",variant:"dark",icon:(0,h.jsx)(bs.Z,{}),Provider:({children:i})=>(0,h.jsx)(Ho.Z,{theme:Xs,children:(0,h.jsx)(Go.ZP,{children:i})})}];function Mi(i){var n,s,a,p;return co({...i,apis:(n=i==null?void 0:i.apis)!==null&&n!==void 0?n:[],bindRoutes:i==null?void 0:i.bindRoutes,components:{...rt,...i==null?void 0:i.components},configLoader:i==null?void 0:i.configLoader,defaultApis:re,icons:{...Ks,...i==null?void 0:i.icons},plugins:(s=i==null?void 0:i.plugins)!==null&&s!==void 0?s:[],featureFlags:(a=i==null?void 0:i.featureFlags)!==null&&a!==void 0?a:[],themes:(p=i==null?void 0:i.themes)!==null&&p!==void 0?p:ei})}var fo=r(25271),Ko=r(76635);async function ti({storageApi:i}){const n=i.forBucket("settings"),s=i.forBucket("starredEntities"),a=n.snapshot("starredEntities").value;if(!(0,Ko.isArray)(a))return;var p;const A=new Set((p=s.snapshot("entityRefs").value)!==null&&p!==void 0?p:[]);a.filter(Ko.isString).map(k=>k.split(":")).filter(k=>k.length===4&&k[0]==="entity").map(([k,M,ae,xe])=>(0,fo.eE)({kind:M,namespace:ae,name:xe})).forEach(k=>A.add(k)),await s.set("entityRefs",Array.from(A)),await n.remove("starredEntities")}class nr{async toggleStarred(n){this.starredEntities.has(n)?this.starredEntities.delete(n):this.starredEntities.add(n),await this.settingsStore.set("entityRefs",Array.from(this.starredEntities))}starredEntitie$(){return this.observable}notifyChanges(){for(const n of this.subscribers)n.next(new Set(this.starredEntities))}constructor(n){(0,z._)(this,"settingsStore",void 0),(0,z._)(this,"starredEntities",void 0),(0,z._)(this,"subscribers",new Set),(0,z._)(this,"observable",new(Se())(a=>(a.next(new Set(this.starredEntities)),this.subscribers.add(a),()=>{this.subscribers.delete(a)}))),ti(n).then(),this.settingsStore=n.storageApi.forBucket("starredEntities");var s;this.starredEntities=new Set((s=this.settingsStore.snapshot("entityRefs").value)!==null&&s!==void 0?s:[]),this.settingsStore.observe$("entityRefs").subscribe({next:a=>{var p;this.starredEntities=new Set((p=a.value)!==null&&p!==void 0?p:[]),this.notifyChanges()}})}}var Aa=r(33414),Yr=r(79692),zi=r(12420),Hn=r(43514),Ta=r(19928);function Ra(){const i=useApi(catalogApiRef),{error:n,loading:s,value:a}=useAsync(async()=>await i.getEntityFacets({facets:["kind"]}).then(A=>{var k;return((k=A.facets.kind)===null||k===void 0?void 0:k.map(M=>M.value).sort())||[]}),[i]);return{loading:s,error:n,allKinds:a!=null?a:[]}}function Ia(i,n,s){let a=i;return n&&(a=a.filter(A=>n.some(k=>k.toLocaleLowerCase("en-US")===A.toLocaleLowerCase("en-US")))),s&&!i.some(A=>A.toLocaleLowerCase("en-US")===s.toLocaleLowerCase("en-US"))&&(a=a.concat([s])),a.sort().reduce((A,k)=>(A[k.toLocaleLowerCase("en-US")]=k,A),{})}const Wi=(0,Yr.Z)(i=>(0,zi.Z)({root:{...i.typography.h4}}));function Yo(i){var n;const{initialFilter:s="component",allowedKinds:a}=i,p=Wi(),{allKinds:A}=useAllKinds(),{filters:k,updateFilters:M,queryParameters:{kind:ae}}=useEntityList(),xe=useMemo(()=>[ae].flat()[0],[ae]);var Ie;const[Ve,gt]=useState((Ie=xe!=null?xe:(n=k.kind)===null||n===void 0?void 0:n.value)!==null&&Ie!==void 0?Ie:s);useEffect(()=>{xe&>(xe)},[xe]),useEffect(()=>{var Rt;if(!((Rt=k.kind)===null||Rt===void 0)&&Rt.value){var Wt;gt((Wt=k.kind)===null||Wt===void 0?void 0:Wt.value)}},[k.kind]),useEffect(()=>{M({kind:Ve?new EntityKindFilter(Ve):void 0})},[Ve,M]);const Tt=filterKinds(A,a,Ve);return _jsx(Select,{input:_jsx(InputBase,{}),value:Ve.toLocaleLowerCase("en-US"),onChange:Rt=>gt(Rt.target.value),classes:p,children:Object.keys(Tt).map(Rt=>_jsx(MenuItem,{value:Rt,children:`${pluralize(Tt[Rt])}`},Rt))})}var Pa=r(86359),Ss=r(95544),ni=r(99688),go=r(12231),Fr=r(86136),mo=r(49378),ri=r(85256),Cs=r(80030),vo=r(61837),lr=r(79784),Jo=r(50758),yo=r(31654),ws=r(43054),js=r(65759),Ar=r(49280),oi=r(96641);function Es(i){const{entity:n,loading:s,error:a}=(0,oi.ce)(),{allowed:p,loading:A,error:k}=C({permission:i,resourceRef:n?(0,fo.eE)(n):void 0});return s||A?{loading:!0,allowed:!1}:a?{loading:!1,allowed:!1,error:a}:{loading:!1,allowed:p,error:k}}const Qo="catalog-entity",Vi=sr({name:"catalog.entity.read",attributes:{action:"read"},resourceType:Qo}),cr=sr({name:"catalog.entity.create",attributes:{action:"create"}}),Xo=sr({name:"catalog.entity.delete",attributes:{action:"delete"},resourceType:Qo}),si=sr({name:"catalog.entity.refresh",attributes:{action:"update"},resourceType:Qo}),ii=sr({name:"catalog.location.read",attributes:{action:"read"}}),ai=sr({name:"catalog.location.create",attributes:{action:"create"}}),li=sr({name:"catalog.location.delete",attributes:{action:"delete"}}),qo=[Vi,cr,Xo,si,ii,ai,li];var As=r(49166);function Ts(i){const{unregisterEntityOptions:n,isUnregisterAllowed:s,onUnregisterEntity:a,onClose:p}=i,A=typeof(n==null?void 0:n.disableUnregister)=="boolean";var k;const M=(k=!s||(A?!!(n!=null&&n.disableUnregister):(n==null?void 0:n.disableUnregister)==="disable"))!==null&&k!==void 0?k:!1;let ae=(0,h.jsx)(h.Fragment,{});return(n==null?void 0:n.disableUnregister)!=="hidden"&&(ae=(0,h.jsxs)(go.Z,{onClick:()=>{p(),a()},disabled:M,children:[(0,h.jsx)(Fr.Z,{children:(0,h.jsx)(As.Z,{fontSize:"small"})}),(0,h.jsx)(mo.Z,{primary:"Unregister entity"})]})),(0,h.jsx)(h.Fragment,{children:ae})}const Rs=(0,Yr.Z)(i=>({button:{color:i.page.fontColor}}),{name:"PluginCatalogEntityContextMenu"});function Is(i){const{UNSTABLE_extraContextMenuItems:n,UNSTABLE_contextMenuOptions:s,onUnregisterEntity:a,onInspectEntity:p}=i,[A,k]=(0,H.useState)(),M=Rs(),xe=Es(Xo).allowed,Ie=Wt=>{k(Wt.currentTarget)},Ve=()=>{k(void 0)},gt=(0,g.h_)(g.$v),Tt=(0,H.useCallback)(()=>{window.navigator.clipboard.writeText(window.location.toString()).then(()=>gt.post({message:"Copied!",severity:"info",display:"transient"}))},[gt]),Rt=n&&[...n.map(Wt=>(0,h.jsxs)(go.Z,{onClick:()=>{Ve(),Wt.onClick()},children:[(0,h.jsx)(Fr.Z,{children:(0,h.jsx)(Wt.Icon,{fontSize:"small"})}),(0,h.jsx)(mo.Z,{primary:Wt.title})]},Wt.title)),(0,h.jsx)(ri.Z,{},"the divider is here!")];return(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(Cs.ZP,{title:"More",arrow:!0,children:(0,h.jsx)(vo.Z,{"aria-label":"more","aria-controls":"long-menu","aria-haspopup":"true","aria-expanded":!!A,role:"button",onClick:Ie,"data-testid":"menu-button",className:M.button,id:"long-menu",children:(0,h.jsx)(ws.Z,{})})}),(0,h.jsx)(lr.ZP,{open:Boolean(A),onClose:Ve,anchorEl:A,anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"},"aria-labelledby":"long-menu",children:(0,h.jsxs)(Jo.Z,{children:[Rt,(0,h.jsx)(Ts,{unregisterEntityOptions:s,isUnregisterAllowed:xe,onUnregisterEntity:a,onClose:Ve}),(0,h.jsxs)(go.Z,{onClick:()=>{Ve(),p()},children:[(0,h.jsx)(Fr.Z,{children:(0,h.jsx)(yo.Z,{fontSize:"small"})}),(0,h.jsx)(mo.Z,{primary:"Inspect entity"})]}),(0,h.jsxs)(go.Z,{onClick:()=>{Ve(),Tt()},children:[(0,h.jsx)(Fr.Z,{children:(0,h.jsx)(js.Z,{fontSize:"small"})}),(0,h.jsx)(mo.Z,{primary:"Copy entity URL"})]})]})})]})}const xo="plugin.catalog.entityLayoutRoute",_o=()=>null;(0,g.R5)(_o,xo,!0),(0,g.R5)(_o,"core.gatherMountPoints",!0);function Ps(i){const{entity:n,title:s}=i;return(0,h.jsxs)(Ss.Z,{display:"inline-flex",alignItems:"center",height:"1em",maxWidth:"100%",children:[(0,h.jsx)(Ss.Z,{component:"span",textOverflow:"ellipsis",whiteSpace:"nowrap",overflow:"hidden",children:s}),n&&(0,h.jsx)(Hn.LH,{entity:n})]})}function Ls(i,n,s,a){var p;const A=(p=i!=null?i:a==null?void 0:a.kind)!==null&&p!==void 0?p:"";var k;const M=(k=n!=null?n:a==null?void 0:a.metadata.namespace)!==null&&k!==void 0?k:"";var ae,xe,Ie;return{headerTitle:`${(Ie=(xe=(ae=a==null?void 0:a.metadata.title)!==null&&ae!==void 0?ae:s)!==null&&xe!==void 0?xe:a==null?void 0:a.metadata.name)!==null&&Ie!==void 0?Ie:""}${M&&M!==fo.zG?` in ${M}`:""}`,headerType:(()=>{let gt=A.toLocaleLowerCase("en-US");return a&&a.spec&&"type"in a.spec&&(gt+=" \u2014 ",gt+=a.spec.type.toLocaleLowerCase("en-US")),gt})()}}function Os(i){var n;const{entity:s}=i,a=(0,Hn.hF)(s,fo.S4);return(0,h.jsxs)(h.Fragment,{children:[a.length>0&&(0,h.jsx)(X.i9,{label:"Owner",value:(0,h.jsx)(Hn.rI,{entityRefs:a,defaultKind:"Group",color:"inherit"})}),((n=s.spec)===null||n===void 0?void 0:n.lifecycle)&&(0,h.jsx)(X.i9,{label:"Lifecycle",value:s.spec.lifecycle})]})}const ci=i=>{var n,s;const{UNSTABLE_extraContextMenuItems:a,UNSTABLE_contextMenuOptions:p,children:A,NotFoundComponent:k}=i,{kind:M,namespace:ae,name:xe}=(0,g.Oi)(Hn.wi),{entity:Ie,loading:Ve,error:gt}=(0,Hn.ce)(),Tt=(0,W.TH)(),Rt=(0,g.vJ)(A,Oi=>Oi.selectByComponentData({key:xo,withStrictError:"Child of EntityLayout must be an EntityLayout.Route"}).getElements().flatMap(({props:Ur})=>{if(Ie){if(Ur.if&&!Ur.if(Ie))return[]}else return[];return[{path:Ur.path,title:Ur.title,children:Ur.children,tabProps:Ur.tabProps}]}),[Ie]),{headerTitle:Wt,headerType:Gt}=Ls(M,ae,xe,Ie),[$n,Xn]=(0,H.useState)(!1),[fr,Co]=(0,H.useState)(!1),Pi=(0,W.s0)(),Li=async()=>{Xn(!1),Co(!1),Pi("/")};(0,H.useEffect)(()=>{Xn(!1),Co(!1)},[Tt.pathname]);var ss;return(0,h.jsxs)(X.T3,{themeId:(ss=Ie==null||(n=Ie.spec)===null||n===void 0||(s=n.type)===null||s===void 0?void 0:s.toString())!==null&&ss!==void 0?ss:"home",children:[(0,h.jsx)(X.h4,{title:(0,h.jsx)(Ps,{title:Wt,entity:Ie}),pageTitleOverride:Wt,type:Gt,children:Ie&&(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(Os,{entity:Ie}),(0,h.jsx)(Is,{UNSTABLE_extraContextMenuItems:a,UNSTABLE_contextMenuOptions:p,onUnregisterEntity:()=>Xn(!0),onInspectEntity:()=>Co(!0)})]})}),Ve&&(0,h.jsx)(X.Ex,{}),Ie&&(0,h.jsx)(X.tn,{routes:Rt}),gt&&(0,h.jsx)(X.VY,{children:(0,h.jsx)(ni.Z,{severity:"error",children:gt.toString()})}),!Ve&&!gt&&!Ie&&(0,h.jsx)(X.VY,{children:k||(0,h.jsxs)(X.GB,{title:"Entity not found",children:["There is no ",M," with the requested"," ",(0,h.jsx)(X.rU,{to:"https://backstage.io/docs/features/software-catalog/references",children:"kind, namespace, and name"}),"."]})}),(0,h.jsx)(Hn.pp,{open:$n,entity:Ie,onConfirm:Li,onClose:()=>Xn(!1)}),(0,h.jsx)(Hn.U_,{open:fr,entity:Ie,onClose:()=>Co(!1)})]})};ci.Route=_o;function es(i){const{open:n,onClose:s,onConfirm:a,entity:p}=i,[A,k]=useState(!1),M=useApi(catalogApiRef),ae=useApi(alertApiRef),xe=async()=>{k(!0);try{const Ie=p.metadata.uid;await M.removeEntityByUid(Ie),a()}catch(Ie){assertError(Ie),ae.post({message:Ie.message})}finally{k(!1)}};return _jsxs(Dialog,{open:n,onClose:s,children:[_jsx(DialogTitle,{id:"responsive-dialog-title",children:"Are you sure you want to delete this entity?"}),_jsxs(DialogActions,{children:[_jsx(Button,{variant:"contained",color:"secondary",disabled:A,onClick:xe,children:"Delete"}),_jsx(Button,{onClick:s,color:"primary",children:"Cancel"})]})]})}var bo=r(19625);function Hi(i){var n,s;return(i==null||(n=i.metadata)===null||n===void 0||(s=n.annotations)===null||s===void 0?void 0:s["backstage.io/orphan"])==="true"}function di(){const i=useNavigate(),n=useRouteRef(rootRouteRef),[s,a]=useState(!1),{entity:p}=useEntity(),A=async()=>{a(!1),i(n())};return _jsxs(_Fragment,{children:[_jsx(Alert,{severity:"warning",onClick:()=>a(!0),children:"This entity is not referenced by any location and is therefore not receiving updates. Click here to delete."}),_jsx(DeleteEntityDialog,{open:s,entity:p,onConfirm:A,onClose:()=>a(!1)})]})}var ks=r(4791);const ui=i=>i.error&&i.level==="error"&&i.type===ENTITY_STATUS_CATALOG_PROCESSING_TYPE;async function Bs(i,n){return{items:(await n.getEntityAncestors({entityRef:i})).items.map(p=>{var A,k;return{errors:((k=(A=p.entity.status)===null||A===void 0?void 0:A.items)!==null&&k!==void 0?k:[]).filter(ui).map(xe=>xe.error).filter(xe=>Boolean(xe)),entity:p.entity}}).filter(p=>p.errors.length>0)}}async function Gi(i,n){const s=n.apis.get(catalogApiRef);if(!s)throw new Error(`No implementation available for ${catalogApiRef}`);return(await Bs(stringifyEntityRef(i),s)).items.length>0}function hi(){const{entity:i}=useEntity(),n=stringifyEntityRef(i),s=useApi(catalogApiRef),{loading:a,error:p,value:A}=useAsync(async()=>Bs(n,s),[n,s]);return p?_jsx(Box,{mb:1,children:_jsx(ResponseErrorPanel,{error:p})}):a||!A?null:_jsx(_Fragment,{children:A.items.map((k,M)=>_jsxs(Box,{mb:1,children:[stringifyEntityRef(i)!==stringifyEntityRef(k.entity)&&_jsxs(Box,{p:1,children:["The error below originates from"," ",_jsx(EntityRefLink,{entityRef:k.entity})]}),k.errors.map((ae,xe)=>_jsx(ResponseErrorPanel,{error:ae},xe))]},M))})}const $s="core.backstage.entitySwitch",Jr=i=>null;(0,g.R5)(Jr,$s,!0);const Ds=i=>{var n;const{entity:s,loading:a}=(0,Hn.ce)(),p=(0,g.I_)(),A=(0,g.vJ)(i.children,ae=>ae.selectByComponentData({key:$s,withStrictError:"Child of EntitySwitch is not an EntitySwitch.Case"}).getElements().flatMap(xe=>{if(a)return[];const{if:Ie,children:Ve}=xe.props;return s?[{if:Ie==null?void 0:Ie(s,{apis:p}),children:Ve}]:[{if:Ie===void 0,children:Ve}]}),[p,s,a]);if(A.some(ae=>typeof ae.if=="object"&&"then"in ae.if))return(0,h.jsx)(pi,{results:A,renderMultipleMatches:i.renderMultipleMatches});if(i.renderMultipleMatches==="all"){const ae=A.filter(xe=>xe.if).map(xe=>xe.children);return ae.length===0?Qr(A):(0,h.jsx)(h.Fragment,{children:ae})}var M;return(M=(n=A.find(ae=>ae.if))===null||n===void 0?void 0:n.children)!==null&&M!==void 0?M:Qr(A)};function pi({results:i,renderMultipleMatches:n}){const{loading:s,value:a}=(0,be.default)(async()=>{const p=i.map(async({if:k,children:M})=>{try{if(await k)return M}catch{}return null});if(n==="all"){const k=(await Promise.all(p)).filter(Boolean);return k.length===0?Qr(i):(0,h.jsx)(h.Fragment,{children:k})}var A;return(A=(await Promise.all(p)).find(Boolean))!==null&&A!==void 0?A:Qr(i)},[i]);return s||!a?null:a}function Qr(i){var n,s;return(s=(n=i.filter(a=>a.if===void 0)[0])===null||n===void 0?void 0:n.children)!==null&&s!==void 0?s:null}Ds.Case=Jr;const Ki=null,fi=Hn._i.Filters,gi=Hn._i.Content;var Qn=r(85877),mi=r(15096);const Bn=(0,g.rx)({id:"catalog",apis:[(0,g.ni)({api:Hn.Ah,deps:{discoveryApi:g.NW,fetchApi:g.gP},factory:({discoveryApi:i,fetchApi:n})=>new ks.MS({discoveryApi:i,fetchApi:n})}),(0,g.ni)({api:Hn.p3,deps:{storageApi:g.E6},factory:({storageApi:i})=>new nr({storageApi:i})})],routes:{catalogIndex:bo._Z,catalogEntity:Hn.wi},externalRoutes:{createComponent:bo.yw,viewTechDoc:bo.jU},__experimentalConfigure(i){return{...{createButtonTitle:"Create"},...i}}}),Yi=Bn.provide((0,g.P4)({name:"CatalogIndexPage",component:()=>r.e(9323).then(r.bind(r,89323)).then(i=>i.CatalogPage),mountPoint:bo._Z})),Zs=Bn.provide((0,g.P4)({name:"CatalogEntityPage",component:()=>r.e(8951).then(r.bind(r,78951)).then(i=>i.CatalogEntityPage),mountPoint:Hn.wi})),Ji=Bn.provide((0,g.CO)({name:"EntityAboutCard",component:{lazy:()=>Promise.resolve().then(r.bind(r,33414)).then(i=>i.AboutCard)}})),La=Bn.provide((0,g.CO)({name:"EntityLinksCard",component:{lazy:()=>r.e(7750).then(r.bind(r,17750)).then(i=>i.EntityLinksCard)}})),Ns=Bn.provide((0,g.CO)({name:"EntityLabelsCard",component:{lazy:()=>Promise.resolve().then(r.bind(r,85877)).then(i=>i.EntityLabelsCard)}})),Qi=Bn.provide((0,g.CO)({name:"EntityHasSystemsCard",component:{lazy:()=>r.e(5458).then(r.bind(r,5458)).then(i=>i.HasSystemsCard)}})),Xi=Bn.provide((0,g.CO)({name:"EntityHasComponentsCard",component:{lazy:()=>r.e(1105).then(r.bind(r,1105)).then(i=>i.HasComponentsCard)}})),qi=Bn.provide((0,g.CO)({name:"EntityHasSubcomponentsCard",component:{lazy:()=>r.e(2440).then(r.bind(r,82440)).then(i=>i.HasSubcomponentsCard)}})),ts=Bn.provide((0,g.CO)({name:"EntityHasResourcesCard",component:{lazy:()=>r.e(9770).then(r.bind(r,79770)).then(i=>i.HasResourcesCard)}})),_i=Bn.provide((0,g.CO)({name:"EntityDependsOnComponentsCard",component:{lazy:()=>r.e(9545).then(r.bind(r,19545)).then(i=>i.DependsOnComponentsCard)}})),ea=Bn.provide((0,g.CO)({name:"EntityDependencyOfComponentsCard",component:{lazy:()=>r.e(184).then(r.bind(r,40184)).then(i=>i.DependencyOfComponentsCard)}})),vi=Bn.provide((0,g.CO)({name:"EntityDependsOnResourcesCard",component:{lazy:()=>r.e(1032).then(r.bind(r,81032)).then(i=>i.DependsOnResourcesCard)}})),ta=Bn.provide((0,g.CO)({name:"RelatedEntitiesCard",component:{lazy:()=>r.e(732).then(r.bind(r,732)).then(i=>i.RelatedEntitiesCard)}})),Oa=Bn.provide((0,mi.E5)({name:"CatalogSearchResultListItem",component:()=>r.e(7670).then(r.bind(r,27670)).then(i=>i.CatalogSearchResultListItem),predicate:i=>i.type==="software-catalog"}));var yi=r(32838);class xi{async getApiOrigin(){return await this.discoveryApi.getBaseUrl("techdocs")}async getStorageUrl(){return`${await this.discoveryApi.getBaseUrl("techdocs")}/static/docs`}async getBuilder(){return this.configApi.getString("techdocs.builder")}async getEntityDocs(n,s){const p=`${await this.getApiOrigin()}/${s}`,A=await fetch(`${p.endsWith("/")?p:`${p}/`}index.html`);if(A.status===404)throw new Error("Page not found");return A.text()}async syncEntityDocs(n){return"cached"}async getBaseUrl(n,s,a){const p=await this.getApiOrigin();return new URL(n,`${p}/${a}`).toString()}constructor({configApi:n,discoveryApi:s,identityApi:a}){(0,z._)(this,"configApi",void 0),(0,z._)(this,"discoveryApi",void 0),(0,z._)(this,"identityApi",void 0),this.configApi=n,this.discoveryApi=s,this.identityApi=a}}class na{async getApiOrigin(){return await this.discoveryApi.getBaseUrl("techdocs")}async getEntityMetadata(n){return{apiVersion:"backstage.io/v1alpha1",kind:"Component",metadata:{name:"local"},spec:{owner:"test",lifecycle:"experimental"}}}async getTechDocsMetadata(n){return{site_name:"Live preview environment",site_description:""}}constructor({configApi:n,discoveryApi:s,identityApi:a}){(0,z._)(this,"configApi",void 0),(0,z._)(this,"discoveryApi",void 0),(0,z._)(this,"identityApi",void 0),this.configApi=n,this.discoveryApi=s,this.identityApi=a}}const ra=[(0,g.ni)({api:oe.Dl,deps:{configApi:g.Ds,discoveryApi:g.NW,identityApi:g.$4},factory:({configApi:i,discoveryApi:n,identityApi:s})=>new xi({configApi:i,discoveryApi:n,identityApi:s})}),(0,g.ni)({api:oe.gT,deps:{configApi:g.Ds,discoveryApi:g.NW,identityApi:g.$4},factory:({configApi:i,discoveryApi:n,identityApi:s})=>new na({configApi:i,discoveryApi:n,identityApi:s})}),(0,g.ni)({api:yi.q3,deps:{configApi:g.Ds},factory:({configApi:i})=>yi.ae.fromConfig(i)})],ns={backend:{baseUrl:"http://localhost:3000"},techdocs:{builder:"external"}},rs={backend:{baseUrl:"http://localhost:7007"},techdocs:{builder:"external"}};async function bi(){const i=await fetch("/.detect");return i.ok?(await i.text()).trim()==="techdocs-cli-server":!1}async function So(){const i=await so(),n=await bi();return[...i,{context:"detected",data:n?ns:rs}]}var Si=r(58845);const os=(0,Yr.Z)({svg:{width:"auto",height:30},path:{fill:"#7df3e1"}});var Ci=()=>{const i=os();return(0,h.jsx)("svg",{className:i.svg,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 2079.95 456.05",children:(0,h.jsx)("path",{className:i.path,d:"M302.9,180a80.62,80.62,0,0,0,13.44-10.37c.8-.77,1.55-1.54,2.31-2.31a81.89,81.89,0,0,0,7.92-9.37,62.37,62.37,0,0,0,6.27-10.77,48.6,48.6,0,0,0,4.36-16.4c1.49-19.39-10-38.67-35.62-54.22L198.42,14,78.16,129.22l-78.29,75,108.6,65.9a111.6,111.6,0,0,0,57.76,16.42c24.92,0,48.8-8.8,66.42-25.69,19.16-18.36,25.52-42.12,13.7-61.87a49.69,49.69,0,0,0-6.8-8.87,89.78,89.78,0,0,0,19.28,2.15H259a85.09,85.09,0,0,0,31-5.79A80.88,80.88,0,0,0,302.9,180Zm-100.59,59.8c-19.32,18.51-50.4,21.24-75.7,5.9l-75.13-45.6,67.44-64.65,76.42,46.39C222.88,198.57,221.36,221.6,202.31,239.84Zm8.94-82.21L140.6,114.74,205,53l69.37,42.11c25.94,15.73,29.31,37.05,10.55,55A60.71,60.71,0,0,1,211.25,157.63Zm29.86,190c-19.57,18.75-46.17,29.08-74.88,29.08a123.84,123.84,0,0,1-64.11-18.19L-.13,296.51v24.67l108.6,65.91a111.6,111.6,0,0,0,57.76,16.42c24.92,0,48.8-8.81,66.42-25.69,12.88-12.34,20-27.13,19.68-41.49v-1.79A87.85,87.85,0,0,1,241.11,347.67Zm0-39c-19.57,18.76-46.17,29.09-74.88,29.09a123.84,123.84,0,0,1-64.11-18.19L-.13,257.52V282.2l108.6,65.91a111.59,111.59,0,0,0,57.76,16.41c24.92,0,48.8-8.8,66.42-25.68,12.88-12.35,20-27.13,19.68-41.5v-1.79A86.86,86.86,0,0,1,241.11,308.68Zm0-39c-19.57,18.76-46.17,29.09-74.88,29.09a123.84,123.84,0,0,1-64.11-18.19L-.13,218.54v24.68l108.6,65.91a111.59,111.59,0,0,0,57.76,16.41c24.92,0,48.8-8.8,66.42-25.69,12.88-12.34,20-27.12,19.68-41.49v-1.82A87.14,87.14,0,0,1,241.11,269.7Zm83.69,25.74a94.16,94.16,0,0,1-60.19,25.86h0V348a81.6,81.6,0,0,0,51.73-22.37c14-13.38,21.15-28.11,21-42.64v-2.2A95.14,95.14,0,0,1,324.8,295.44Zm-83.69,91.21c-19.57,18.75-46.17,29.09-74.88,29.09a123.76,123.76,0,0,1-64.11-18.2L-.13,335.49v24.67l108.6,65.91a111.6,111.6,0,0,0,57.76,16.42c24.92,0,48.8-8.81,66.42-25.69,12.88-12.34,20-27.13,19.68-41.49v-1.79A87.35,87.35,0,0,1,241.11,386.65Zm85.75-210.21c-.68.69-1.35,1.38-2.06,2.05a99.19,99.19,0,0,1-22.23,15.69,94.53,94.53,0,0,1-26.24,8.71,97.84,97.84,0,0,1-14.16,1.57c.5,1.61.9,3.25,1.25,4.9a52.7,52.7,0,0,1,1.13,12V231h.05A84.48,84.48,0,0,0,290,225.47a80.83,80.83,0,0,0,26.38-16.82c.81-.77,1.51-1.56,2.27-2.34a82,82,0,0,0,7.92-9.38,62.85,62.85,0,0,0,6.29-10.78,48.5,48.5,0,0,0,4.32-16.44c.09-1.23.2-2.47.19-3.7v-2c-.72,1-1.48,2.06-2.26,3.09A98,98,0,0,1,326.86,176.44Zm0,77.92c-.68.7-1.3,1.41-2,2.1a94.09,94.09,0,0,1-60.19,25.85h0V309h0a81.65,81.65,0,0,0,51.73-22.37,73.51,73.51,0,0,0,16.48-22.49,48.56,48.56,0,0,0,4.32-16.44c.09-1.24.2-2.48.19-3.71v-2.2c-.74,1.08-1.47,2.16-2.27,3.22A95.81,95.81,0,0,1,326.82,254.36Zm0-39c-.68.7-1.3,1.41-2,2.1a92.22,92.22,0,0,1-10.62,8.65,93.53,93.53,0,0,1-11.63,7,95.63,95.63,0,0,1-37.94,10.18h-.05l0,26.67h0a81.63,81.63,0,0,0,51.73-22.37c.81-.77,1.51-1.56,2.27-2.34a82,82,0,0,0,7.92-9.38,63.16,63.16,0,0,0,6.29-10.77,48.55,48.55,0,0,0,4.32-16.45c.09-1.23.2-2.47.19-3.7v-2.2c-.74,1.08-1.47,2.16-2.27,3.22A98.19,98.19,0,0,1,326.82,215.38Zm241-88.84q7.94,0,17.09.17t18.12,1a139.3,139.3,0,0,1,16.74,2.57,42.78,42.78,0,0,1,13.3,5.14,64.27,64.27,0,0,1,20.54,19.89Q662,168,662,186.54q0,19.54-9.49,33.78t-27.1,21.09v.68q22.78,4.82,34.87,20.58t12.08,38.4a72.62,72.62,0,0,1-4.83,26.06,65.29,65.29,0,0,1-14.33,22.46,71.57,71.57,0,0,1-23.47,15.78q-14,6-32.28,6H478.38V126.54Zm9,105.27q28,0,40.21-9.78t12.26-29.31q0-13-4.14-20.58a29.47,29.47,0,0,0-11.4-11.66A45,45,0,0,0,597,155.17a161.2,161.2,0,0,0-20.19-1.2h-65.6v77.84Zm16.57,112.13q21.74,0,34-11.66T639.59,300q0-12-4.48-19.88a34.85,34.85,0,0,0-11.91-12.52,50.14,50.14,0,0,0-17.09-6.52,105,105,0,0,0-20-1.88H511.17v84.7Zm274.79,26.74q-7.61,4.45-21.06,4.46-11.4,0-18.12-6.34t-6.74-20.75a70.17,70.17,0,0,1-28.13,20.75,97.87,97.87,0,0,1-57.65,3.6,53.51,53.51,0,0,1-18.82-8.58A41.19,41.19,0,0,1,705,348.56q-4.65-9.42-4.66-22.8,0-15.09,5.18-24.69a44.92,44.92,0,0,1,13.64-15.6,62.63,62.63,0,0,1,19.33-9.09q10.88-3.08,22.27-5.14,12.08-2.4,23-3.6a128,128,0,0,0,19.16-3.43c5.53-1.48,9.89-3.65,13.12-6.51s4.83-7,4.83-12.52q0-9.6-3.62-15.43a24.94,24.94,0,0,0-9.32-8.92,38.38,38.38,0,0,0-12.78-4.11,96.54,96.54,0,0,0-14-1q-18.63,0-31.07,7T736.6,249.29H707.26q.69-16.46,6.9-27.77a52.21,52.21,0,0,1,16.57-18.35,70,70,0,0,1,23.65-10.11A125.51,125.51,0,0,1,782.86,190a168.63,168.63,0,0,1,24,1.72,63.26,63.26,0,0,1,21.58,7A41.23,41.23,0,0,1,844,213.59q5.87,9.57,5.87,25v91q0,10.26,1.21,15.05t8.11,4.79a35.57,35.57,0,0,0,9-1.37Zm-47.64-90.87c-3.69,2.74-8.52,4.72-14.5,6s-12.26,2.27-18.82,3.07-13.17,1.71-19.85,2.73a73.7,73.7,0,0,0-18,4.94,32.62,32.62,0,0,0-12.94,9.73q-5,6.32-5,17.23a23.31,23.31,0,0,0,2.94,12.11,24.11,24.11,0,0,0,7.59,8,32,32,0,0,0,10.88,4.44,60.94,60.94,0,0,0,13.11,1.36q14.5,0,24.86-3.92a52.49,52.49,0,0,0,16.91-9.9,39.1,39.1,0,0,0,9.67-13,32.53,32.53,0,0,0,3.11-13.14ZM1002.07,225q-11.05-9.25-29.69-9.26-15.89,0-26.58,5.83A47.29,47.29,0,0,0,928.71,237a64.66,64.66,0,0,0-9.15,22.12A119.83,119.83,0,0,0,916.8,285a98.22,98.22,0,0,0,2.93,24,64.18,64.18,0,0,0,9.15,20.74,46.2,46.2,0,0,0,16.23,14.58q10,5.49,23.82,5.48,21.75,0,34-11.31t15-31.89h30q-4.83,32.91-24.68,50.75t-54,17.83q-20.37,0-36.07-6.52A69.86,69.86,0,0,1,907,350.11a79.92,79.92,0,0,1-15.88-28.63A118.64,118.64,0,0,1,885.73,285a129.41,129.41,0,0,1,5.18-37.21,85.63,85.63,0,0,1,15.71-30.17A73.46,73.46,0,0,1,933,197.35Q948.91,190,970,190a108.54,108.54,0,0,1,28.48,3.6,69.59,69.59,0,0,1,23.48,11.15,61,61,0,0,1,16.74,19q6.55,11.49,8.29,27.26h-30.38Q1013.11,234.21,1002.07,225Zm109.77-98.41v145l81.47-77.49h39.36l-70.77,64.46,75.95,112.82h-37.29l-61.1-92.59-27.62,25.38v67.21H1082.5V126.54Zm170.54,205.22a31.07,31.07,0,0,0,10.87,10.63,49,49,0,0,0,15.19,5.66,87.06,87.06,0,0,0,17.44,1.71,109.18,109.18,0,0,0,14.5-1,53.22,53.22,0,0,0,14-3.78,26.27,26.27,0,0,0,10.53-8q4.14-5.32,4.14-13.55,0-11.31-8.63-17.14a73.69,73.69,0,0,0-21.58-9.43q-12.94-3.6-28.13-6.52a146,146,0,0,1-28.14-8.23A58.16,58.16,0,0,1,1261,267.13q-8.64-9.6-8.63-26.75,0-13.38,6-23a49.26,49.26,0,0,1,15.53-15.61,71.76,71.76,0,0,1,21.4-8.91A99.41,99.41,0,0,1,1319,190a141.31,141.31,0,0,1,28,2.58,64.85,64.85,0,0,1,22.62,8.91,46.16,46.16,0,0,1,15.7,17.15q5.87,10.8,6.91,26.91h-29.35q-.69-8.57-4.48-14.23a29.36,29.36,0,0,0-9.67-9.08,44.16,44.16,0,0,0-12.94-5,67.68,67.68,0,0,0-14.33-1.54,87.29,87.29,0,0,0-13.29,1,45.28,45.28,0,0,0-12.26,3.6,24.49,24.49,0,0,0-9,6.86q-3.46,4.29-3.46,11.14a16.32,16.32,0,0,0,5.36,12.52,42.75,42.75,0,0,0,13.63,8.23,120,120,0,0,0,18.64,5.48q10.37,2.24,20.72,4.63,11,2.4,21.57,5.83A70.74,70.74,0,0,1,1382,284.1a44.55,44.55,0,0,1,13.12,14.23q5,8.58,5,21.26,0,16.13-6.73,26.75a52.5,52.5,0,0,1-17.61,17.14,73.89,73.89,0,0,1-24.51,9.09,146.3,146.3,0,0,1-27.1,2.57,126.24,126.24,0,0,1-28.31-3.09A69.56,69.56,0,0,1,1272,361.94a51.74,51.74,0,0,1-16.57-18.52q-6.21-11.49-6.9-27.95h29.34A32.65,32.65,0,0,0,1282.38,331.76Zm226.46-137.67v25.72h-35.56V329.88a31.37,31.37,0,0,0,.87,8.23,8.42,8.42,0,0,0,3.28,4.8,14.61,14.61,0,0,0,6.73,2.23,99.19,99.19,0,0,0,11.22.51h13.46v25.72H1486.4a105.8,105.8,0,0,1-19.5-1.55,28.65,28.65,0,0,1-13.12-5.65,24.09,24.09,0,0,1-7.42-11.66q-2.43-7.54-2.42-19.89V219.81h-30.38V194.09h30.38V140.94h29.34v53.15ZM1699.4,370.68q-7.61,4.45-21.06,4.46-11.4,0-18.12-6.34t-6.74-20.75a70.17,70.17,0,0,1-28.13,20.75,97.87,97.87,0,0,1-57.65,3.6,53.51,53.51,0,0,1-18.82-8.58,41.19,41.19,0,0,1-12.6-15.26q-4.65-9.42-4.66-22.8,0-15.09,5.18-24.69a44.92,44.92,0,0,1,13.64-15.6,62.63,62.63,0,0,1,19.33-9.09q10.88-3.08,22.27-5.14,12.07-2.4,23-3.6a128,128,0,0,0,19.16-3.43c5.53-1.48,9.89-3.65,13.12-6.51s4.83-7,4.83-12.52q0-9.6-3.62-15.43a24.94,24.94,0,0,0-9.32-8.92,38.38,38.38,0,0,0-12.78-4.11,96.54,96.54,0,0,0-14-1q-18.63,0-31.07,7t-13.46,26.57h-29.34q.67-16.46,6.9-27.77A52.21,52.21,0,0,1,1562,203.17a70,70,0,0,1,23.65-10.11,125.51,125.51,0,0,1,28.48-3.09,168.63,168.63,0,0,1,24,1.72,63.26,63.26,0,0,1,21.58,7,41.23,41.23,0,0,1,15.53,14.89q5.87,9.57,5.87,25v91q0,10.26,1.21,15.05t8.11,4.79a35.57,35.57,0,0,0,9-1.37Zm-47.64-90.87c-3.69,2.74-8.52,4.72-14.5,6s-12.26,2.27-18.82,3.07-13.17,1.71-19.85,2.73a73.7,73.7,0,0,0-17.95,4.94,32.62,32.62,0,0,0-12.94,9.73q-5,6.32-5,17.23a23.31,23.31,0,0,0,2.94,12.11,24.11,24.11,0,0,0,7.59,8,32,32,0,0,0,10.88,4.44,60.94,60.94,0,0,0,13.11,1.36q14.51,0,24.86-3.92a52.49,52.49,0,0,0,16.91-9.9,39.1,39.1,0,0,0,9.67-13,32.53,32.53,0,0,0,3.11-13.14Zm208.85,141.62q-20,21.6-62.83,21.6a122.11,122.11,0,0,1-25.37-2.74,78,78,0,0,1-23.48-8.92,54.41,54.41,0,0,1-17.43-16.11q-6.91-10-7.6-24.35h29.35a21.47,21.47,0,0,0,5,13.38,36.67,36.67,0,0,0,11.4,8.91,55.52,55.52,0,0,0,14.67,5,79.51,79.51,0,0,0,15.19,1.55q14.49,0,24.51-5A46,46,0,0,0,1840.59,401a56.53,56.53,0,0,0,9.49-21.09,117.46,117.46,0,0,0,2.94-27.09V341.19h-.7q-7.59,16.46-23,24.18a71.8,71.8,0,0,1-32.63,7.71q-20,0-34.86-7.2A72.88,72.88,0,0,1,1737,346.51a82.13,82.13,0,0,1-15-28.46,116.62,116.62,0,0,1-5-34.47,133.92,133.92,0,0,1,4.14-32.4A88.17,88.17,0,0,1,1735,221a75.49,75.49,0,0,1,25.55-22.29q15.87-8.75,39-8.75a66.21,66.21,0,0,1,31.07,7.38,52.13,52.13,0,0,1,22.09,22.11h.35V194.09h27.61V356.28Q1880.63,399.83,1860.61,421.43Zm-37.46-79.72a47.94,47.94,0,0,0,16.4-15.78,71.89,71.89,0,0,0,9.15-22.11,106.77,106.77,0,0,0,2.93-24.69,96.71,96.71,0,0,0-2.76-23,64,64,0,0,0-8.8-20.4,45.76,45.76,0,0,0-15.71-14.57q-9.66-5.49-23.47-5.49-14.16,0-24.17,5.32a46.77,46.77,0,0,0-16.4,14.23,60.14,60.14,0,0,0-9.32,20.57,99.69,99.69,0,0,0-2.93,24.35,120.63,120.63,0,0,0,2.42,24,67.5,67.5,0,0,0,8.28,21.77,46.37,46.37,0,0,0,15.54,15.78q9.66,6,24.16,6T1823.15,341.71Zm228,18.34q-20,15.09-50.41,15.09-21.4,0-37.11-6.86a73.16,73.16,0,0,1-26.41-19.2,81.52,81.52,0,0,1-16-29.49,141.12,141.12,0,0,1-6-37.38,106.1,106.1,0,0,1,6.21-37A88.56,88.56,0,0,1,1938.8,216a79.09,79.09,0,0,1,26.58-19.2A81.66,81.66,0,0,1,1999,190q23.82,0,39.53,9.78a78,78,0,0,1,25.2,24.86,98.18,98.18,0,0,1,13.12,32.91,140.6,140.6,0,0,1,2.93,34h-133.6a70,70,0,0,0,2.76,22.12,49.9,49.9,0,0,0,10,18.51A49.1,49.1,0,0,0,1976.6,345q10.7,4.82,25.2,4.8,18.65,0,30.55-8.57t15.71-26.06h29Q2071.18,345,2051.17,360.05Zm-7.08-113.84a50,50,0,0,0-10.7-16,53.1,53.1,0,0,0-56.62-10.63,47.48,47.48,0,0,0-15.71,10.81,51.69,51.69,0,0,0-10.35,15.94,60.18,60.18,0,0,0-4.49,19.37h102.53A59.47,59.47,0,0,0,2044.09,246.21ZM302.9,180a80.62,80.62,0,0,0,13.44-10.37c.8-.77,1.55-1.54,2.31-2.31a81.89,81.89,0,0,0,7.92-9.37,62.37,62.37,0,0,0,6.27-10.77,48.6,48.6,0,0,0,4.36-16.4c1.49-19.39-10-38.67-35.62-54.22L198.42,14,78.16,129.22l-78.29,75,108.6,65.9a111.6,111.6,0,0,0,57.76,16.42c24.92,0,48.8-8.8,66.42-25.69,19.16-18.36,25.52-42.12,13.7-61.87a49.69,49.69,0,0,0-6.8-8.87,89.78,89.78,0,0,0,19.28,2.15H259a85.09,85.09,0,0,0,31-5.79A80.88,80.88,0,0,0,302.9,180Zm-100.59,59.8c-19.32,18.51-50.4,21.24-75.7,5.9l-75.13-45.6,67.44-64.65,76.42,46.39C222.88,198.57,221.36,221.6,202.31,239.84Zm8.94-82.21L140.6,114.74,205,53l69.37,42.11c25.94,15.73,29.31,37.05,10.55,55A60.71,60.71,0,0,1,211.25,157.63Zm29.86,190c-19.57,18.75-46.17,29.08-74.88,29.08a123.84,123.84,0,0,1-64.11-18.19L-.13,296.51v24.67l108.6,65.91a111.6,111.6,0,0,0,57.76,16.42c24.92,0,48.8-8.81,66.42-25.69,12.88-12.34,20-27.13,19.68-41.49v-1.79A87.85,87.85,0,0,1,241.11,347.67Zm0-39c-19.57,18.76-46.17,29.09-74.88,29.09a123.84,123.84,0,0,1-64.11-18.19L-.13,257.52V282.2l108.6,65.91a111.59,111.59,0,0,0,57.76,16.41c24.92,0,48.8-8.8,66.42-25.68,12.88-12.35,20-27.13,19.68-41.5v-1.79A86.86,86.86,0,0,1,241.11,308.68Zm0-39c-19.57,18.76-46.17,29.09-74.88,29.09a123.84,123.84,0,0,1-64.11-18.19L-.13,218.54v24.68l108.6,65.91a111.59,111.59,0,0,0,57.76,16.41c24.92,0,48.8-8.8,66.42-25.69,12.88-12.34,20-27.12,19.68-41.49v-1.82A87.14,87.14,0,0,1,241.11,269.7Zm83.69,25.74a94.16,94.16,0,0,1-60.19,25.86h0V348a81.6,81.6,0,0,0,51.73-22.37c14-13.38,21.15-28.11,21-42.64v-2.2A95.14,95.14,0,0,1,324.8,295.44Zm-83.69,91.21c-19.57,18.75-46.17,29.09-74.88,29.09a123.76,123.76,0,0,1-64.11-18.2L-.13,335.49v24.67l108.6,65.91a111.6,111.6,0,0,0,57.76,16.42c24.92,0,48.8-8.81,66.42-25.69,12.88-12.34,20-27.13,19.68-41.49v-1.79A87.35,87.35,0,0,1,241.11,386.65Zm85.75-210.21c-.68.69-1.35,1.38-2.06,2.05a99.19,99.19,0,0,1-22.23,15.69,94.53,94.53,0,0,1-26.24,8.71,97.84,97.84,0,0,1-14.16,1.57c.5,1.61.9,3.25,1.25,4.9a52.7,52.7,0,0,1,1.13,12V231h.05A84.48,84.48,0,0,0,290,225.47a80.83,80.83,0,0,0,26.38-16.82c.81-.77,1.51-1.56,2.27-2.34a82,82,0,0,0,7.92-9.38,62.85,62.85,0,0,0,6.29-10.78,48.5,48.5,0,0,0,4.32-16.44c.09-1.23.2-2.47.19-3.7v-2c-.72,1-1.48,2.06-2.26,3.09A98,98,0,0,1,326.86,176.44Zm0,77.92c-.68.7-1.3,1.41-2,2.1a94.09,94.09,0,0,1-60.19,25.85h0V309h0a81.65,81.65,0,0,0,51.73-22.37,73.51,73.51,0,0,0,16.48-22.49,48.56,48.56,0,0,0,4.32-16.44c.09-1.24.2-2.48.19-3.71v-2.2c-.74,1.08-1.47,2.16-2.27,3.22A95.81,95.81,0,0,1,326.82,254.36Zm0-39c-.68.7-1.3,1.41-2,2.1a92.22,92.22,0,0,1-10.62,8.65,93.53,93.53,0,0,1-11.63,7,95.63,95.63,0,0,1-37.94,10.18h-.05l0,26.67h0a81.63,81.63,0,0,0,51.73-22.37c.81-.77,1.51-1.56,2.27-2.34a82,82,0,0,0,7.92-9.38,63.16,63.16,0,0,0,6.29-10.77,48.55,48.55,0,0,0,4.32-16.45c.09-1.23.2-2.47.19-3.7v-2.2c-.74,1.08-1.47,2.16-2.27,3.22A98.19,98.19,0,0,1,326.82,215.38Z"})})};const Fs=(0,Yr.Z)({svg:{width:"auto",height:28},path:{fill:"#7df3e1"}});var Us=()=>{const i=Fs();return(0,h.jsx)("svg",{className:i.svg,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 337.46 428.5",children:(0,h.jsx)("path",{className:i.path,d:"M303,166.05a80.69,80.69,0,0,0,13.45-10.37c.79-.77,1.55-1.53,2.3-2.3a83.12,83.12,0,0,0,7.93-9.38A63.69,63.69,0,0,0,333,133.23a48.58,48.58,0,0,0,4.35-16.4c1.49-19.39-10-38.67-35.62-54.22L198.56,0,78.3,115.23,0,190.25l108.6,65.91a111.59,111.59,0,0,0,57.76,16.41c24.92,0,48.8-8.8,66.42-25.69,19.16-18.36,25.52-42.12,13.7-61.87a49.22,49.22,0,0,0-6.8-8.87A89.17,89.17,0,0,0,259,178.29h.15a85.08,85.08,0,0,0,31-5.79A80.88,80.88,0,0,0,303,166.05ZM202.45,225.86c-19.32,18.51-50.4,21.23-75.7,5.9L51.61,186.15l67.45-64.64,76.41,46.38C223,184.58,221.49,207.61,202.45,225.86Zm8.93-82.22-70.65-42.89L205.14,39,274.51,81.1c25.94,15.72,29.31,37,10.55,55A60.69,60.69,0,0,1,211.38,143.64Zm29.86,190c-19.57,18.75-46.17,29.09-74.88,29.09a123.73,123.73,0,0,1-64.1-18.2L0,282.52v24.67L108.6,373.1a111.6,111.6,0,0,0,57.76,16.42c24.92,0,48.8-8.81,66.42-25.69,12.88-12.34,20-27.13,19.68-41.49v-1.79A87.27,87.27,0,0,1,241.24,333.68Zm0-39c-19.57,18.75-46.17,29.08-74.88,29.08a123.81,123.81,0,0,1-64.1-18.19L0,243.53v24.68l108.6,65.91a111.6,111.6,0,0,0,57.76,16.42c24.92,0,48.8-8.81,66.42-25.69,12.88-12.34,20-27.13,19.68-41.5v-1.78A87.27,87.27,0,0,1,241.24,294.7Zm0-39c-19.57,18.76-46.17,29.09-74.88,29.09a123.81,123.81,0,0,1-64.1-18.19L0,204.55v24.68l108.6,65.91a111.59,111.59,0,0,0,57.76,16.41c24.92,0,48.8-8.8,66.42-25.68,12.88-12.35,20-27.13,19.68-41.5v-1.82A86.09,86.09,0,0,1,241.24,255.71Zm83.7,25.74a94.15,94.15,0,0,1-60.2,25.86h0V334a81.6,81.6,0,0,0,51.74-22.37c14-13.38,21.14-28.11,21-42.64v-2.19A94.92,94.92,0,0,1,324.94,281.45Zm-83.7,91.21c-19.57,18.76-46.17,29.09-74.88,29.09a123.73,123.73,0,0,1-64.1-18.2L0,321.5v24.68l108.6,65.9a111.6,111.6,0,0,0,57.76,16.42c24.92,0,48.8-8.8,66.42-25.69,12.88-12.34,20-27.13,19.68-41.49v-1.79A86.29,86.29,0,0,1,241.24,372.66ZM327,162.45c-.68.69-1.35,1.38-2.05,2.06a94.37,94.37,0,0,1-10.64,8.65,91.35,91.35,0,0,1-11.6,7,94.53,94.53,0,0,1-26.24,8.71,97.69,97.69,0,0,1-14.16,1.57c.5,1.61.9,3.25,1.25,4.9a53.27,53.27,0,0,1,1.14,12V217h.05a84.41,84.41,0,0,0,25.35-5.55,81,81,0,0,0,26.39-16.82c.8-.77,1.5-1.56,2.26-2.34a82.08,82.08,0,0,0,7.93-9.38A63.76,63.76,0,0,0,333,172.17a48.55,48.55,0,0,0,4.32-16.45c.09-1.23.2-2.47.19-3.7V150q-1.08,1.54-2.25,3.09A96.73,96.73,0,0,1,327,162.45Zm0,77.92c-.69.7-1.31,1.41-2,2.1a94.2,94.2,0,0,1-60.2,25.86h0l0,26.67h0a81.6,81.6,0,0,0,51.74-22.37A73.51,73.51,0,0,0,333,250.13a48.56,48.56,0,0,0,4.32-16.44c.09-1.24.2-2.47.19-3.71v-2.19c-.74,1.07-1.46,2.15-2.27,3.21A95.68,95.68,0,0,1,327,240.37Zm0-39c-.69.7-1.31,1.41-2,2.1a93.18,93.18,0,0,1-10.63,8.65,91.63,91.63,0,0,1-11.63,7,95.47,95.47,0,0,1-37.94,10.18h0V256h0a81.65,81.65,0,0,0,51.74-22.37c.8-.77,1.5-1.56,2.26-2.34a82.08,82.08,0,0,0,7.93-9.38A63.76,63.76,0,0,0,333,211.15a48.56,48.56,0,0,0,4.32-16.44c.09-1.24.2-2.48.19-3.71v-2.2c-.74,1.08-1.46,2.16-2.27,3.22A95.68,95.68,0,0,1,327,201.39Z"})})};const ia=(0,Yr.Z)({root:{width:X.po.drawerWidthClosed,height:3*X.po.logoHeight,display:"flex",flexFlow:"row nowrap",alignItems:"center",marginBottom:-14},link:{width:X.po.drawerWidthClosed,marginLeft:24}}),aa=()=>{const i=ia(),{isOpen:n}=(0,X.mZ)();return(0,h.jsx)("div",{className:i.root,children:(0,h.jsx)(X.rU,{to:"/docs/default/component/local/",underline:"none",className:i.link,children:n?(0,h.jsx)(Ci,{}):(0,h.jsx)(Us,{})})})},la=({children:i})=>(0,h.jsxs)(X.tR,{children:[(0,h.jsxs)(X.YE,{children:[(0,h.jsx)(aa,{}),(0,h.jsx)(X.v7,{}),(0,h.jsx)(X.R6,{icon:Si.Z,to:"/docs/default/component/local",text:"Docs Preview"})]}),i]});var wi=r(32388),ji=r(4142);const ca=(0,Yr.Z)(i=>({headerIcon:{color:i.palette.common.white,width:"32px",height:"32px"},content:{backgroundColor:i.palette.background.default},contentToolbar:{display:"flex",justifyContent:"flex-end",padding:0}}));var pr;(function(i){i.LIGHT="light",i.DARK="dark"})(pr||(pr={}));const Ei=()=>{const i=(0,g.h_)(g.hg),n=ca(),[s,a]=(0,H.useState)(i.getActiveThemeId()===pr.DARK?pr.DARK:pr.LIGHT),p={[pr.LIGHT]:{icon:ji.Z,title:"Dark theme"},[pr.DARK]:{icon:wi.Z,title:"Light theme"}},{title:A,icon:k}=p[s],M=()=>{a(ae=>{const xe=ae===pr.LIGHT?pr.DARK:pr.LIGHT;return i.setActiveThemeId(xe),xe})};return(0,h.jsx)(Ss.Z,{display:"flex",alignItems:"center",mr:2,children:(0,h.jsx)(Cs.ZP,{title:A,arrow:!0,children:(0,h.jsx)(vo.Z,{size:"small",onClick:M,children:(0,h.jsx)(k,{className:n.headerIcon})})})})},Ai=()=>(0,h.jsxs)(L.I6,{children:[(0,h.jsx)(K.S,{}),(0,h.jsx)(I.F,{withSearch:!1})]}),Ms=(0,h.jsx)(Ai,{}),zs=Mi({apis:ra,configLoader:So,plugins:Object.values(t)}),Ti=zs.getProvider(),da=zs.getRouter(),Ri=L.s4.provide((0,oe.KY)({name:"ThemeToggleAddon",component:Ei,location:oe.oZ.Header})),Ws=(0,h.jsxs)(Lr,{children:[(0,h.jsx)(W.Fg,{to:"/docs/default/component/local/"},"/"),(0,h.jsx)(W.AW,{path:"/catalog/:namespace/:kind/:name",element:(0,h.jsx)(Zs,{})}),(0,h.jsx)(W.AW,{path:"/docs",element:(0,h.jsx)(L.Jl,{}),children:(0,h.jsx)($.u,{})}),(0,h.jsxs)(W.AW,{path:"/docs/:namespace/:kind/:name/*",element:(0,h.jsx)(L.I6,{}),children:[Ms,(0,h.jsx)(oe.DR,{children:(0,h.jsx)(Ri,{})})]})]});var Ii=()=>(0,h.jsx)(Ti,{children:(0,h.jsx)(da,{children:(0,h.jsx)(la,{children:Ws})})});f.render((0,h.jsx)(Ii,{}),document.getElementById("root"))},51837:function(Ct,$e,r){"use strict";r.d($e,{CT:function(){return g},EI:function(){return ve},uW:function(){return f},Vt:function(){return u}});function t(){return typeof window!="undefined"&&window.Math===Math?window:typeof self!="undefined"&&self.Math===Math?self:Function("return this")()}const h=t(),H=ue=>`__@backstage/${ue}__`;function f(ue,V){const K=H(ue);let I=h[K];return I||(I=V(),h[K]=I,I)}var W=r(2784);function g(ue){return f(ue,()=>(0,W.createContext)(void 0))}function u(ue){return(0,W.useContext)(g(ue))}function B(ue){return{set(V){globalThis[`__@backstage/${ue}__`]=createContext(createVersionedValueMap(V))},reset(){delete globalThis[`__@backstage/${ue}__`]}}}function ve(ue){Object.freeze(ue);const V={atVersion(K){return ue[K]}};return Object.defineProperty(V,"$map",{configurable:!0,enumerable:!0,get(){return ue}}),V}},96641:function(Ct,$e,r){"use strict";r.d($e,{X2:function(){return ve},ce:function(){return ue},h$:function(){return u}});var t=r(52322),h=r(25271),H=r(60871),f=r(51837),W=r(2784);const g=(0,f.CT)("entity-context"),u=V=>{const{children:K,entity:I,loading:w,error:ie,refresh:ee}=V,ne={entity:I,loading:w,error:ie,refresh:ee};return(0,t.jsx)(g.Provider,{value:(0,f.EI)({1:ne}),children:(0,t.jsx)(H.fC,{attributes:{...I?{entityRef:(0,h.eE)(I)}:void 0},children:K})})},B=V=>_jsx(u,{entity:V.entity,loading:!Boolean(V.entity),error:void 0,refresh:void 0,children:V.children});function ve(){const V=(0,f.Vt)("entity-context");if(!V)throw new Error("Entity context is not available");const K=V.atVersion(1);if(!K)throw new Error("EntityContext v1 not available");if(!K.entity)throw new Error("useEntity hook is being called outside of an EntityLayout where the entity has not been loaded. If this is intentional, please use useAsyncEntity instead.");return{entity:K.entity}}function ue(){const V=(0,f.Vt)("entity-context");if(!V)throw new Error("Entity context is not available");const K=V.atVersion(1);if(!K)throw new Error("EntityContext v1 not available");const{entity:I,loading:w,error:ie,refresh:ee}=K;return{entity:I,loading:w,error:ie,refresh:ee}}},43514:function(Ct,$e,r){"use strict";r.d($e,{h$:function(){return xt.h$},n3:function(){return t.n3},_i:function(){return T},tW:function(){return _n},df:function(){return Me},UO:function(){return tt},ph:function(){return Uo},dq:function(){return kt},nl:function(){return Fo},dx:function(){return te},rI:function(){return le},u3:function(){return Dt},xE:function(){return Gn},sL:function(){return ur},LH:function(){return b},U_:function(){return Bo},pp:function(){return uo},EW:function(){return ho},Ah:function(){return H},wi:function(){return Qt},hF:function(){return oe.hF},CV:function(){return oe.CV},$3:function(){return D},p3:function(){return f},ce:function(){return xt.ce},X2:function(){return xt.X2},wp:function(){return mt},ZW:function(){return tn},eK:function(){return Yt},CR:function(){return Pn}});var t=r(4791),h=r(60871);const H=(0,h.T0)({id:"plugin.catalog.service"}),f=(0,h.T0)({id:"catalog-react.starred-entities"});var W=r(82394);class g{async toggleStarred(C){this.starredEntities.delete(C)||this.starredEntities.add(C);for(const R of this.subscribers)R.next(new Set(this.starredEntities))}starredEntitie$(){return this.observable}constructor(){_define_property(this,"starredEntities",new Set),_define_property(this,"subscribers",new Set),_define_property(this,"observable",new ObservableImpl(C=>(C.next(new Set(this.starredEntities)),this.subscribers.add(C),()=>{this.subscribers.delete(C)})))}}var u=r(52322),B=r(2784),ve=r(41156),ue=r(60364),V=r(77277),K=r(4190),I=r(95544),w=r(90436),ie=r(60905),ee=r(36444);const ne=x=>{const C=(0,ve.Z)(de=>de.breakpoints.down("md")),R=(0,ue.Z)(),[N,re]=(0,B.useState)(!1);return C?(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)(V.Z,{style:{marginTop:R.spacing(1),marginLeft:R.spacing(1)},onClick:()=>re(!0),startIcon:(0,u.jsx)(ee.Z,{}),children:"Filters"}),(0,u.jsx)(K.ZP,{open:N,onClose:()=>re(!1),anchor:"left",disableAutoFocus:!0,keepMounted:!0,variant:"temporary",children:(0,u.jsxs)(I.Z,{m:2,children:[(0,u.jsx)(w.Z,{variant:"h6",component:"h2",style:{marginBottom:R.spacing(1)},children:"Filters"}),x.children]})})]}):(0,u.jsx)(ie.Z,{item:!0,lg:2,children:x.children})},$=x=>(0,u.jsx)(ie.Z,{item:!0,xs:12,lg:10,children:x.children}),T=x=>(0,u.jsx)(ie.Z,{container:!0,style:{position:"relative"},children:x.children});T.Filters=ne,T.Content=$;var P=r(53974),L=r(87612),O=r(25271),oe=r(49280);class Le{getCatalogFilters(){return{kind:this.value}}toQueryValue(){return this.value}constructor(C){(0,L._)(this,"value",void 0),this.value=C}}class ze{getTypes(){return Array.isArray(this.value)?this.value:[this.value]}getCatalogFilters(){return{"spec.type":this.getTypes()}}toQueryValue(){return this.getTypes()}constructor(C){(0,L._)(this,"value",void 0),this.value=C}}class z{filterEntity(C){var R;return this.values.every(N=>((R=C.metadata.tags)!==null&&R!==void 0?R:[]).includes(N))}toQueryValue(){return this.values}constructor(C){(0,L._)(this,"values",void 0),this.values=C}}class yt{filterEntity(C){const R=this.toUpperArray(this.value.split(/\s/)),N=this.toUpperArray([C.metadata.tags]),re=this.toUpperArray([C.metadata.name,C.metadata.title]);for(const de of R)if(N.every(X=>X!==de)&&re.every(X=>!X.includes(de)))return!1;return!0}toUpperArray(C){return C.flat().filter(R=>Boolean(R)).map(R=>R.toLocaleUpperCase("en-US"))}constructor(C){_define_property(this,"value",void 0),this.value=C}}class ot{filterEntity(C){return this.values.some(R=>(0,oe.hF)(C,O.S4).some(N=>(0,O.eE)(N)===R))}toQueryValue(){return this.values}constructor(C){(0,L._)(this,"values",void 0),this.values=C.reduce((R,N)=>{try{return R.push((0,O.eE)((0,O.of)(N,{defaultKind:"Group"}))),R}catch{return R}},[])}}class He{filterEntity(C){return this.values.some(R=>{var N;return((N=C.spec)===null||N===void 0?void 0:N.lifecycle)===R})}toQueryValue(){return this.values}constructor(C){(0,L._)(this,"values",void 0),this.values=C}}class st{filterEntity(C){return this.values.some(R=>C.metadata.namespace===R)}toQueryValue(){return this.values}constructor(C){(0,L._)(this,"values",void 0),this.values=C}}class Qe{filterEntity(C){switch(this.value){case"owned":return this.isOwnedEntity(C);case"starred":return this.isStarredEntity(C);default:return!0}}toQueryValue(){return this.value}constructor(C,R,N){(0,L._)(this,"value",void 0),(0,L._)(this,"isOwnedEntity",void 0),(0,L._)(this,"isStarredEntity",void 0),this.value=C,this.isOwnedEntity=R,this.isStarredEntity=N}}class St{filterEntity(C){var R;const N=(R=C.metadata.annotations)===null||R===void 0?void 0:R["backstage.io/orphan"];return N!==void 0&&this.value.toString()===N}constructor(C){(0,L._)(this,"value",void 0),this.value=C}}class It{filterEntity(C){var R,N;const re=(C==null||(R=C.status)===null||R===void 0||(N=R.items)===null||N===void 0?void 0:N.length)>0;return re!==void 0&&this.value===re}constructor(C){(0,L._)(this,"value",void 0),this.value=C}}var xt=r(96641),lt=r(76635),Pt=r(19126),Nt=r.n(Pt),We=r(73557),_t=r(69294),ge=r(48760),Se=r(90736);const Fe=(0,B.createContext)(void 0),tt=x=>{const C=(0,Se.default)(),R=(0,h.h_)(H),[N,re]=(0,B.useState)({}),de=(0,We.TH)();var X;const ye=(0,B.useMemo)(()=>(X=Nt().parse(de.search,{ignoreQueryPrefix:!0}).filters)!==null&&X!==void 0?X:{},[de]),[Ee,Re]=(0,B.useState)(()=>({appliedFilters:{},entities:[],backendEntities:[]})),[{loading:Ze,error:Ne},rt]=(0,_t.default)(async()=>{const Be=(0,lt.compact)(Object.values(N)),Je=(0,oe.Gz)(Be),At=(0,oe.wq)(Be),cn=(0,oe.wq)((0,lt.compact)(Object.values(Ee.appliedFilters))),qt=Object.keys(N).reduce((nn,An)=>{const Rn=N[An];return Rn!=null&&Rn.toQueryValue&&(nn[An]=Rn.toQueryValue()),nn},{});if((0,lt.isEqual)(cn,At))Re({appliedFilters:N,backendEntities:Ee.backendEntities,entities:Ee.backendEntities.filter(Je)});else{const nn=await R.getEntities({filter:At});Re({appliedFilters:N,backendEntities:nn.items,entities:nn.items.filter(Je)})}if(C()){var on;const nn=Nt().parse(de.search,{ignoreQueryPrefix:!0}),An=Nt().stringify({...nn,filters:qt},{addQueryPrefix:!0,arrayFormat:"repeat"}),Rn=`${window.location.pathname}${An}`;(on=window.history)===null||on===void 0||on.replaceState(null,document.title,Rn)}},[R,ye,N,Ee],{loading:!0});(0,ge.Z)(rt,10,[N]);const qe=(0,B.useCallback)(Be=>{re(Je=>{const At=typeof Be=="function"?Be(Je):Be;return{...Je,...At}})},[]),Ge=(0,B.useMemo)(()=>({filters:Ee.appliedFilters,entities:Ee.entities,backendEntities:Ee.backendEntities,updateFilters:qe,queryParameters:ye,loading:Ze,error:Ne}),[Ee,qe,ye,Ze,Ne]);return(0,u.jsx)(Fe.Provider,{value:Ge,children:x.children})};function mt(){const x=(0,B.useContext)(Fe);if(!x)throw new Error("useEntityList must be used within EntityListProvider");return x}var bt=r(64279),pt=r(18149),Ot=r.n(pt),Ht=r(829),Jt=r.n(Ht);function Bt(){const x=(0,h.h_)(H),{filters:{kind:C,type:R},queryParameters:{type:N},updateFilters:re}=mt(),de=(0,B.useMemo)(()=>[N].flat().filter(Boolean),[N]);var X;const[ye,Ee]=(0,B.useState)(de.length?de:(X=R==null?void 0:R.getTypes())!==null&&X!==void 0?X:[]);(0,B.useEffect)(()=>{de.length&&Ee(de)},[de]);const[Re,Ze]=(0,B.useState)([]),Ne=(0,B.useMemo)(()=>C==null?void 0:C.value,[C]),{error:rt,loading:qe,value:Ge}=(0,bt.default)(async()=>Ne?await x.getEntityFacets({filter:{kind:Ne},facets:["spec.type"]}).then(At=>At.facets["spec.type"]||[]):[],[Ne,x]),Be=(0,B.useRef)(Ge);return(0,B.useEffect)(()=>{const Je=Be.current;if(Be.current=Ge,qe||!Ne||Je===Ge||!Ge)return;const At=[...new Set(Jt()(Ge,qt=>-qt.count).map(qt=>qt.value.toLocaleLowerCase("en-US")))];Ze(At);const cn=ye.filter(qt=>At.includes(qt));Ot()(ye,cn)||Ee(cn)},[qe,Ne,ye,Ee,Ge]),(0,B.useEffect)(()=>{re({type:ye.length?new ze(ye):void 0})},[ye,re]),{loading:qe,error:rt,availableTypes:Re,selectedTypes:ye,setSelectedTypes:Ee}}const un=20;function Yt(x,C){var R,N;const re=C==null||(R=C.type)===null||R===void 0?void 0:R.toLocaleLowerCase("en-US"),de=C==null||(N=C.kind)===null||N===void 0?void 0:N.toLocaleLowerCase("en-US"),X=(0,h.h_)(H),{loading:ye,value:Ee,error:Re}=(0,bt.default)(async()=>{var Ze;const Ne=(Ze=x.relations)===null||Ze===void 0?void 0:Ze.map(Be=>({type:Be.type,target:(0,O.of)(Be.targetRef)})).filter(Be=>(!re||Be.type.toLocaleLowerCase("en-US")===re)&&(!de||Be.target.kind===de));if(!Ne)return[];const rt=Object.values((0,lt.groupBy)(Ne,({target:Be})=>`${Be.kind}:${Be.namespace}`.toLocaleLowerCase("en-US"))),qe=[];for(const Be of rt)qe.push({kind:Be[0].target.kind,namespace:Be[0].target.namespace,nameBatches:(0,lt.chunk)(Be.map(Je=>Je.target.name),un)});return(await Promise.all(qe.flatMap(Be=>Be.nameBatches.map(Je=>X.getEntities({filter:{kind:Be.kind,"metadata.namespace":Be.namespace,"metadata.name":Je}}))))).flatMap(Be=>Be.items)},[x,re,de]);return{entities:Ee,loading:ye,error:Re}}var pn=r(72164);function Fn(x){return typeof x=="string"?x:(0,O.eE)(x)}function Pn(){const x=(0,h.h_)(f),C=(0,pn.Z)(x.starredEntitie$(),new Set),R=(0,B.useCallback)(re=>C.has(Fn(re)),[C]),N=(0,B.useCallback)(re=>x.toggleStarred(Fn(re)).then(),[x]);return{starredEntities:C,toggleStarredEntity:N,isStarredEntity:R}}function fn(x){return typeof x=="string"?x:(0,O.eE)(x)}function Ln(x){const C=(0,h.h_)(f),[R,N]=(0,B.useState)(!1);return(0,B.useEffect)(()=>{const de=C.starredEntitie$().subscribe({next(X){N(X.has(fn(x)))}});return()=>{de.unsubscribe()}},[x,C]),{toggleStarredEntity:(0,B.useCallback)(()=>C.toggleStarred(fn(x)).then(),[x,C]),isStarredEntity:R}}var Un=r(75435);function tn(){const x=(0,h.h_)(h.$4),{loading:C,value:R}=(0,bt.default)(async()=>{const{ownershipEntityRefs:re}=await x.getBackstageIdentity();return re},[]),N=(0,B.useMemo)(()=>{const re=new Set(R!=null?R:[]);return de=>{const X=(0,Un.h)(de,O.S4).map(O.eE);for(const ye of X)if(re.has(ye))return!0;return!1}},[R]);return(0,B.useMemo)(()=>({loading:C,isOwnedEntity:N}),[C,N])}function wn(){const x=(0,h.h_)(H),{error:C,loading:R,value:N}=(0,bt.default)(async()=>await x.getEntityFacets({facets:["kind"]}).then(de=>{var X;return((X=de.facets.kind)===null||X===void 0?void 0:X.map(ye=>ye.value).sort())||[]}),[x]);return{loading:R,error:C,allKinds:N!=null?N:[]}}function Mn(x,C,R){let N=x;return C&&(N=N.filter(de=>C.some(X=>X.toLocaleLowerCase("en-US")===de.toLocaleLowerCase("en-US")))),R&&!x.some(de=>de.toLocaleLowerCase("en-US")===R.toLocaleLowerCase("en-US"))&&(N=N.concat([R])),N.sort().reduce((de,X)=>(de[X.toLocaleLowerCase("en-US")]=X,de),{})}function ut(x){var C;const{filters:R,queryParameters:{kind:N},updateFilters:re}=mt(),de=(0,B.useMemo)(()=>[N].flat()[0],[N]);var X;const[ye,Ee]=(0,B.useState)((X=de!=null?de:(C=R.kind)===null||C===void 0?void 0:C.value)!==null&&X!==void 0?X:x.initialFilter);(0,B.useEffect)(()=>{de&&Ee(de)},[de]),(0,B.useEffect)(()=>{var rt;if(!((rt=R.kind)===null||rt===void 0)&&rt.value){var qe;Ee((qe=R.kind)===null||qe===void 0?void 0:qe.value)}},[R.kind]),(0,B.useEffect)(()=>{re({kind:ye?new Le(ye):void 0})},[ye,re]);const{allKinds:Re,loading:Ze,error:Ne}=wn();return{loading:Ze,error:Ne,allKinds:Re!=null?Re:[],selectedKind:ye,setSelectedKind:Ee}}const _n=x=>{const{allowedKinds:C,hidden:R,initialFilter:N="component"}=x,re=(0,h.h_)(h.$v),{error:de,allKinds:X,selectedKind:ye,setSelectedKind:Ee}=ut({initialFilter:N});if((0,B.useEffect)(()=>{de&&re.post({message:"Failed to load entity kinds",severity:"error"})},[de,re]),de)return null;const Re=Mn(X,C,ye),Ze=Object.keys(Re).map(Ne=>({value:Ne,label:Re[Ne]}));return R?null:(0,u.jsx)(I.Z,{pb:1,pt:1,children:(0,u.jsx)(P.Ph,{label:"Kind",items:Ze,selected:ye.toLocaleLowerCase("en-US"),onChange:Ne=>Ee(String(Ne))})})};var wt=r(79692),ct=r(5806),vn=r(21324),Kt=r(86619),hn=r(19996),jn=r(25505),ln=r(38016),Tn=r(88013);const Ce=(0,wt.Z)({input:{}},{name:"CatalogReactEntityLifecyclePicker"}),ce=(0,u.jsx)(jn.Z,{fontSize:"small"}),Oe=(0,u.jsx)(hn.Z,{fontSize:"small"}),Me=x=>{var C;const{initialFilter:R=[]}=x,N=Ce(),{updateFilters:re,backendEntities:de,filters:X,queryParameters:{lifecycles:ye}}=mt(),Ee=(0,B.useMemo)(()=>[ye].flat().filter(Boolean),[ye]);var Re;const[Ze,Ne]=(0,B.useState)(Ee.length?Ee:(Re=(C=X.lifecycles)===null||C===void 0?void 0:C.values)!==null&&Re!==void 0?Re:R);(0,B.useEffect)(()=>{Ee.length&&Ne(Ee)},[Ee]);const rt=(0,B.useMemo)(()=>[...new Set(de.map(qe=>{var Ge;return(Ge=qe.spec)===null||Ge===void 0?void 0:Ge.lifecycle}).filter(Boolean))].sort(),[de]);return(0,B.useEffect)(()=>{re({lifecycles:Ze.length&&rt.length?new He(Ze):void 0})},[Ze,re,rt]),rt.length?(0,u.jsx)(I.Z,{pb:1,pt:1,children:(0,u.jsxs)(w.Z,{variant:"button",component:"label",children:["Lifecycle",(0,u.jsx)(Tn.ZP,{multiple:!0,disableCloseOnSelect:!0,options:rt,value:Ze,onChange:(qe,Ge)=>Ne(Ge),renderOption:(qe,{selected:Ge})=>(0,u.jsx)(ct.Z,{control:(0,u.jsx)(vn.Z,{icon:ce,checkedIcon:Oe,checked:Ge}),onClick:Be=>Be.preventDefault(),label:qe}),size:"small",popupIcon:(0,u.jsx)(ln.Z,{"data-testid":"lifecycle-picker-expand"}),renderInput:qe=>(0,u.jsx)(Kt.Z,{...qe,className:N.input,variant:"outlined"})})]})}):null};var Xe=r(72579),se=r.n(Xe);function D(x,C){const R=C==null?void 0:C.defaultKind;let N,re,de;return"metadata"in x?(N=x.kind,re=x.metadata.namespace,de=x.metadata.name):(N=x.kind,re=x.namespace,de=x.name),(re===void 0||re==="")&&(re=O.zG),(C==null?void 0:C.defaultNamespace)!==void 0?(C==null?void 0:C.defaultNamespace)===re&&(re=void 0):re===O.zG&&(re=void 0),N=N.toLocaleLowerCase("en-US"),N=R&&R.toLocaleLowerCase("en-US")===N?void 0:N,`${N?`${N}:`:""}${re?`${re}/`:""}${de}`}function me(x,C){for(const R of["spec.profile.displayName","metadata.title"]){const N=se()(x,R);if(N&&typeof N=="string")return N}return D(x,C)}const De=(0,wt.Z)({input:{}},{name:"CatalogReactEntityOwnerPicker"}),et=(0,u.jsx)(jn.Z,{fontSize:"small"}),it=(0,u.jsx)(hn.Z,{fontSize:"small"}),kt=()=>{var x;const C=De(),{updateFilters:R,backendEntities:N,filters:re,queryParameters:{owners:de}}=mt(),X=(0,h.h_)(H),ye=(0,h.h_)(h.VE),Ee=(0,B.useMemo)(()=>[de].flat().filter(Boolean),[de]);var Re;const[Ze,Ne]=(0,B.useState)(Ee.length?new ot(Ee).values:(Re=(x=re.owners)===null||x===void 0?void 0:x.values)!==null&&Re!==void 0?Re:[]),{loading:rt,error:qe,value:Ge}=(0,bt.default)(async()=>{const Je=[...new Set(N.flatMap(qt=>(0,oe.hF)(qt,O.S4).map(on=>(0,O.eE)(on))).filter(Boolean))],{items:At}=await X.getEntitiesByRefs({entityRefs:Je,fields:["kind","metadata.name","metadata.title","metadata.namespace","spec.profile.displayName"]});return At.map((qt,on)=>qt?{label:me(qt,{defaultKind:"Group"}),entityRef:(0,O.eE)(qt)}:{label:D((0,O.of)(Je[on]),{defaultKind:"group"}),entityRef:Je[on]}).sort((qt,on)=>qt.label.localeCompare(on.label,"en-US",{ignorePunctuation:!0,caseFirst:"upper"}))},[N]);if((0,B.useEffect)(()=>{qe&&ye.post({...qe,message:`EntityOwnerPicker failed to initialize: ${qe.message}`},{})},[qe,ye]),(0,B.useEffect)(()=>{if(Ee.length){const Je=new ot(Ee);Ne(Je.values)}},[Ee]),(0,B.useEffect)(()=>{!rt&&Ge&&R({owners:Ze.length&&Ge.length?new ot(Ze):void 0})},[Ze,R,Ge,rt]),!rt&&!(Ge!=null&&Ge.length))return null;var Be;return(0,u.jsx)(I.Z,{pb:1,pt:1,children:(0,u.jsxs)(w.Z,{variant:"button",component:"label",children:["Owner",(0,u.jsx)(Tn.ZP,{multiple:!0,disableCloseOnSelect:!0,loading:rt,options:Ge||[],value:(Be=Ge==null?void 0:Ge.filter(Je=>Ze.some(At=>At===Je.entityRef)))!==null&&Be!==void 0?Be:[],onChange:(Je,At)=>Ne(At.map(cn=>cn.entityRef)),getOptionLabel:Je=>Je.label,renderOption:(Je,{selected:At})=>(0,u.jsx)(ct.Z,{control:(0,u.jsx)(vn.Z,{icon:et,checkedIcon:it,checked:At}),onClick:cn=>cn.preventDefault(),label:Je.label}),size:"small",popupIcon:(0,u.jsx)(ln.Z,{"data-testid":"owner-picker-expand"}),renderInput:Je=>(0,u.jsx)(Kt.Z,{...Je,className:C.input,variant:"outlined"})})]})})};var Ft=r(51837);const Qt=(0,Ft.uW)("catalog:entity-route-ref",()=>(0,h.NT)({id:"catalog:entity",params:["namespace","kind","name"]}));function _(x){var C,R;return{kind:x.kind.toLocaleLowerCase("en-US"),namespace:(R=(C=x.metadata.namespace)===null||C===void 0?void 0:C.toLocaleLowerCase("en-US"))!==null&&R!==void 0?R:DEFAULT_NAMESPACE,name:x.metadata.name}}var J=r(80030);const te=(0,B.forwardRef)((x,C)=>{const{entityRef:R,defaultKind:N,title:re,children:de,...X}=x,ye=(0,h.tg)(Qt);let Ee,Re,Ze;if(typeof R=="string"){const Be=(0,O.of)(R);Ee=Be.kind,Re=Be.namespace,Ze=Be.name}else"metadata"in R?(Ee=R.kind,Re=R.metadata.namespace,Ze=R.metadata.name):(Ee=R.kind,Re=R.namespace,Ze=R.name);Ee=Ee.toLocaleLowerCase("en-US");var Ne;Re=(Ne=Re==null?void 0:Re.toLocaleLowerCase("en-US"))!==null&&Ne!==void 0?Ne:O.zG;const rt={kind:Ee,namespace:Re,name:Ze},qe=D({kind:Ee,namespace:Re,name:Ze},{defaultKind:N}),Ge=(0,u.jsxs)(P.rU,{...X,ref:C,to:ye(rt),children:[de,!de&&(re!=null?re:qe)]});return re?(0,u.jsx)(J.ZP,{title:qe,children:Ge}):Ge});function pe(x){const{entityRefs:C,defaultKind:R,getTitle:N,...re}=x,de=(0,h.h_)(H),{value:X=new Array,loading:ye,error:Ee}=(0,bt.default)(async()=>{const Re=C.reduce((Ne,rt)=>typeof rt=="object"&&"metadata"in rt?Ne:[...Ne,(0,O.of)(rt)],new Array),Ze=C.filter(Ne=>typeof Ne=="object"&&"metadata"in Ne);return Re.length>0?[...(await de.getEntities({filter:Re.map(Ne=>({kind:Ne.kind,"metadata.namespace":Ne.namespace,"metadata.name":Ne.name}))})).items,...Ze]:Ze},[C]);return ye?(0,u.jsx)(P.Ex,{}):Ee?(0,u.jsx)(P.yu,{error:Ee}):(0,u.jsx)(u.Fragment,{children:X.map((Re,Ze)=>(0,u.jsxs)(B.Fragment,{children:[Ze>0&&", ",(0,u.jsx)(te,{...re,defaultKind:R,entityRef:Re,title:N(Re)})]},Ze))})}function le(x){const{entityRefs:C,defaultKind:R,fetchEntities:N,getTitle:re,...de}=x;return N?(0,u.jsx)(pe,{...de,defaultKind:R,entityRefs:C,getTitle:re}):(0,u.jsx)(u.Fragment,{children:C.map((X,ye)=>(0,u.jsxs)(B.Fragment,{children:[ye>0&&", ",(0,u.jsx)(te,{...de,defaultKind:R,entityRef:X,title:re?re(X):void 0})]},ye))})}const y=x=>{const C=useRouteRef(entityRouteRef);return _jsx(IconButton,{component:Link,"aria-label":"Show",title:"Show details",to:C(getCompoundEntityRef(x.entity)),children:_jsx(InfoIcon,{})})},Z=x=>_jsx(IconButton,{component:Link,"aria-label":"Email",title:`Email ${x.email}`,to:`mailto:${x.email}`,children:_jsx(EmailIcon,{})}),q=x=>{var C;const R=(C=x.entity.spec.profile)===null||C===void 0?void 0:C.email;return R?_jsx(EmailCardAction,{email:R}):null},Y=x=>{var C;const R=(C=x.entity.spec.profile)===null||C===void 0?void 0:C.email;return R?_jsx(EmailCardAction,{email:R}):null},we=(0,wt.Z)(()=>({popoverPaper:{width:"30em"},descriptionTypography:{overflow:"hidden",textOverflow:"ellipsis",display:"-webkit-box",WebkitLineClamp:2,WebkitBoxOrient:"vertical"}})),Ae=4,Ye=x=>{var C,R,N;const{entityRef:re,children:de,delayTime:X=500}=x,ye=we(),Ee=useApiHolder(),Re=usePopupState({variant:"popover",popupId:"entity-peek-ahead"}),[Ze,Ne]=useState(!1),rt=useMemo(()=>debounce(()=>Ne(!0),X),[X]),[{loading:qe,error:Ge,value:Be},Je]=useAsyncFn(async()=>{const cn=Ee.get(catalogApiRef);if(cn){const qt=await cn.getEntityByRef(re);if(!qt)throw new Error(`${re} not found`);return qt}},[Ee,re]),At=()=>{Ne(!1),rt.cancel()};return useEffect(()=>{Re.isOpen&&!Be&&!Ge&&!qe&&Je()},[Re.isOpen,Je,Be,Ge,qe]),_jsxs(_Fragment,{children:[_jsx(Typography,{component:"span",onMouseEnter:rt,children:_jsx(Typography,{component:"span","data-testid":"trigger",...bindHover(Re),children:de})}),Ze&&_jsx(HoverPopover,{PaperProps:{className:ye.popoverPaper},...bindPopover(Re),anchorOrigin:{vertical:"bottom",horizontal:"center"},transformOrigin:{vertical:"top",horizontal:"center"},onMouseLeave:At,children:_jsxs(Card,{children:[_jsxs(CardContent,{children:[Ge&&_jsx(ResponseErrorPanel,{error:Ge}),qe&&_jsx(Progress,{}),Be&&_jsxs(_Fragment,{children:[_jsx(Typography,{color:"textSecondary",children:Be.metadata.namespace}),_jsx(Typography,{variant:"h5",component:"div",children:Be.metadata.name}),_jsx(Typography,{color:"textSecondary",gutterBottom:!0,children:Be.kind}),Be.metadata.description&&_jsx(Typography,{className:ye.descriptionTypography,paragraph:!0,children:Be.metadata.description}),_jsx(Typography,{children:(C=Be.spec)===null||C===void 0?void 0:C.type}),_jsxs(Box,{marginTop:"0.5em",children:[(Be.metadata.tags||[]).slice(0,Ae).map(cn=>_jsx(Chip,{size:"small",label:cn},cn)),((R=Be.metadata.tags)===null||R===void 0?void 0:R.length)&&((N=Be.metadata.tags)===null||N===void 0?void 0:N.length)>Ae&&_jsx(Tooltip,{title:"Drill into the entity to see all of the tags.",children:_jsx(Chip,{size:"small",label:"..."},"other-tags")})]})]})]}),!Ge&&Be&&_jsx(CardActions,{children:_jsxs(_Fragment,{children:[isUserEntity(Be)&&_jsx(UserCardActions,{entity:Be}),isGroupEntity(Be)&&_jsx(GroupCardActions,{entity:Be}),_jsx(EntityCardActions,{entity:Be})]})})]})})]})},jt=(0,wt.Z)(x=>({searchToolbar:{paddingLeft:0,paddingRight:0},input:{}}),{name:"CatalogReactEntitySearchBar"}),vt=()=>{var x;const C=jt(),{filters:R,updateFilters:N}=useEntityList();var re;const[de,X]=useState((re=(x=R.text)===null||x===void 0?void 0:x.value)!==null&&re!==void 0?re:"");return useDebounce(()=>{N({text:de.length?new EntityTextFilter(de):void 0})},250,[de,N]),_jsx(Toolbar,{className:C.searchToolbar,children:_jsx(FormControl,{children:_jsx(Input,{"aria-label":"search",id:"input-with-icon-adornment",className:C.input,placeholder:"Search",autoComplete:"off",onChange:ye=>X(ye.target.value),value:de,startAdornment:_jsx(InputAdornment,{position:"start",children:_jsx(Search,{})}),endAdornment:_jsx(InputAdornment,{position:"end",children:_jsx(IconButton,{"aria-label":"clear search",onClick:()=>X(""),edge:"end",disabled:de.length===0,children:_jsx(Clear,{})})})})})})},nt=Object.freeze({createEntityRefColumn(x){const{defaultKind:C}=x;function R(N){var re;return((re=N.metadata)===null||re===void 0?void 0:re.title)||D(N,{defaultKind:C})}return{title:"Name",highlight:!0,customFilterAndSearch(N,re){return R(re).includes(N)},customSort(N,re){return R(N).localeCompare(R(re))},render:N=>{var re;return(0,u.jsx)(te,{entityRef:N,defaultKind:C,title:(re=N.metadata)===null||re===void 0?void 0:re.title})}}},createEntityRelationColumn(x){const{title:C,relation:R,defaultKind:N,filter:re}=x;function de(ye){return(0,oe.hF)(ye,R,re)}function X(ye){return de(ye).map(Ee=>D(Ee,{defaultKind:N})).join(", ")}return{title:C,customFilterAndSearch(ye,Ee){return X(Ee).includes(ye)},customSort(ye,Ee){return X(ye).localeCompare(X(Ee))},render:ye=>(0,u.jsx)(le,{entityRefs:de(ye),defaultKind:N})}},createOwnerColumn(){return this.createEntityRelationColumn({title:"Owner",relation:O.S4,defaultKind:"group"})},createDomainColumn(){return this.createEntityRelationColumn({title:"Domain",relation:O.cz,defaultKind:"domain",filter:{kind:"domain"}})},createSystemColumn(){return this.createEntityRelationColumn({title:"System",relation:O.cz,defaultKind:"system",filter:{kind:"system"}})},createMetadataDescriptionColumn(){return{title:"Description",field:"metadata.description",render:x=>(0,u.jsx)(P.Or,{text:x.metadata.description,placement:"bottom-start",line:2})}},createSpecLifecycleColumn(){return{title:"Lifecycle",field:"spec.lifecycle"}},createSpecTypeColumn(){return{title:"Type",field:"spec.type"}}}),Ke=[nt.createEntityRefColumn({defaultKind:"system"}),nt.createDomainColumn(),nt.createOwnerColumn(),nt.createMetadataDescriptionColumn()],dt=[nt.createEntityRefColumn({defaultKind:"component"}),nt.createSystemColumn(),nt.createOwnerColumn(),nt.createSpecTypeColumn(),nt.createSpecLifecycleColumn(),nt.createMetadataDescriptionColumn()],at=(0,wt.Z)(x=>({empty:{padding:x.spacing(2),display:"flex",justifyContent:"center"}})),Dt=x=>{const{entities:C,title:R,emptyContent:N,variant:re="gridItem",columns:de}=x,X=at(),ye={minWidth:"0",width:"100%"};return re==="gridItem"&&(ye.height="calc(100% - 10px)"),(0,u.jsx)(P.iA,{columns:de,title:R,style:ye,emptyContent:N&&(0,u.jsx)("div",{className:X.empty,children:N}),options:{search:!1,paging:!1,actionsColumnIndex:-1,padding:"dense",draggable:!1},data:C})};Dt.columns=nt,Dt.systemEntityColumns=Ke,Dt.componentEntityColumns=dt;const Mt=(0,u.jsx)(jn.Z,{fontSize:"small"}),Xt=(0,u.jsx)(hn.Z,{fontSize:"small"});function en({selected:x}){return(0,u.jsx)(vn.Z,{icon:Mt,checkedIcon:Xt,checked:x})}const Ut=(0,B.memo)(x=>{const{selected:C,value:R,availableOptions:N,showCounts:re}=x,de=re?`${R} (${N==null?void 0:N[R]})`:R;return(0,u.jsx)(ct.Z,{control:(0,u.jsx)(en,{selected:C}),label:de,onClick:X=>X.preventDefault()})});var zt=r(72779),Et=r.n(zt);const Lt=(0,wt.Z)({input:{}},{name:"CatalogReactEntityAutocompletePickerInput"});function Zt(x){const C=Lt();return(0,u.jsx)(Kt.Z,{variant:"outlined",...x,className:Et()(C.input,x.className)})}function bn(x){var C;const{label:R,name:N,path:re,showCounts:de,Filter:X,InputProps:ye}=x,{updateFilters:Ee,filters:Re,queryParameters:{[N]:Ze}}=mt(),Ne=(0,h.h_)(H),{value:rt}=(0,bt.default)(async()=>{var on;const nn=re,{facets:An}=await Ne.getEntityFacets({facets:[nn],filter:(on=Re.kind)===null||on===void 0?void 0:on.getCatalogFilters()});return Object.fromEntries(An[nn].map(({value:Rn,count:Er})=>[Rn,Er]))},[Re.kind]),qe=(0,B.useMemo)(()=>[Ze].flat().filter(Boolean),[Ze]);var Ge;const[Be,Je]=(0,B.useState)(qe.length?qe:(Ge=(C=Re[N])===null||C===void 0?void 0:C.values)!==null&&Ge!==void 0?Ge:[]);(0,B.useEffect)(()=>{qe.length&&Je(qe)},[qe]);const At=Object.keys(rt!=null?rt:{}),cn=Be.length&&At.length;(0,B.useEffect)(()=>{Ee({[N]:cn?new X(Be):void 0})},[N,cn,Be,X,Ee]);const qt=Re[N];return qt&&typeof qt=="object"&&!("values"in qt)||!At.length||At.length<=1?null:(0,u.jsx)(I.Z,{pb:1,pt:1,children:(0,u.jsxs)(w.Z,{variant:"button",component:"label",children:[R,(0,u.jsx)(Tn.ZP,{multiple:!0,disableCloseOnSelect:!0,options:At,value:Be,onChange:(on,nn)=>Je(nn),renderOption:(on,{selected:nn})=>(0,u.jsx)(Ut,{selected:nn,value:on,availableOptions:rt,showCounts:!!de}),size:"small",popupIcon:(0,u.jsx)(ln.Z,{"data-testid":`${String(N)}-picker-expand`}),renderInput:on=>(0,u.jsx)(Zt,{...on,...ye})})]})})}const zn=(0,wt.Z)({input:{}},{name:"CatalogReactEntityTagPicker"}),Gn=x=>{const C=zn();return(0,u.jsx)(bn,{label:"Tags",name:"tags",path:"metadata.tags",Filter:z,showCounts:x.showCounts,InputProps:{className:C.input}})},ur=x=>{const{hidden:C,initialFilter:R}=x,N=(0,h.h_)(h.$v),{error:re,availableTypes:de,selectedTypes:X,setSelectedTypes:ye}=Bt();if((0,B.useEffect)(()=>{re&&N.post({message:"Failed to load entity types",severity:"error"}),R&&ye([R])},[re,N,R,ye]),de.length===0||re)return null;const Ee=[{value:"all",label:"all"},...de.map(Ze=>({value:Ze,label:Ze}))];var Re;return C?null:(0,u.jsx)(I.Z,{pb:1,pt:1,children:(0,u.jsx)(P.Ph,{label:"Type",items:Ee,selected:(Re=Ee.length>1?X[0]:void 0)!==null&&Re!==void 0?Re:"all",onChange:Ze=>ye(Ze==="all"?[]:[String(Ze)])})})};var En=r(15459),On=r(61837),er=r(11640),S=r(28347);const c=(0,En.Z)({root:{color:"#f3ba37"}})(er.Z),b=x=>{const{toggleStarredEntity:C,isStarredEntity:R}=Ln(x.entity);return(0,u.jsx)(On.Z,{"aria-label":"favorite",color:"inherit",...x,onClick:()=>C(),children:(0,u.jsx)(J.ZP,{title:R?"Remove from favorites":"Add to favorites",children:R?(0,u.jsx)(c,{}):(0,u.jsx)(S.Z,{})})})};var E=r(8629),Q=r(79249),be=r(38724),je=r(99152),ke=r(6487),ht=r(49429),ft=r(55999),yn=r(39412);const kn=yn.Z;function br(x,C){if(x)return x.toLocaleLowerCase("en-US");if(C)try{return(0,O.of)(C).kind.toLocaleLowerCase("en-US")}catch{return}}function Br(x,C){const R=(0,h.qD)(),N=br(x,C);return N&&R.getSystemIcon(`kind:${N}`)||kn}function $r(x){const{kind:C,entityRef:R,...N}=x,re=Br(C,R);return(0,u.jsx)(re,{...N})}const Ao=(0,wt.Z)(x=>({node:{fill:x.palette.grey[300],stroke:x.palette.grey[300],"&.primary":{fill:x.palette.primary.light,stroke:x.palette.primary.light},"&.secondary":{fill:x.palette.secondary.light,stroke:x.palette.secondary.light}},text:{fill:x.palette.getContrastText(x.palette.grey[300]),"&.primary":{fill:x.palette.primary.contrastText},"&.secondary":{fill:x.palette.secondary.contrastText},"&.focused":{fontWeight:"bold"}},clickable:{cursor:"pointer"}}));function eo(x){const C=(0,h.h_)(H),R=(0,O.eE)(x),{loading:N,error:re,value:de}=(0,bt.default)(async()=>{const X=await C.getEntityAncestors({entityRef:R}),ye=new Array,Ee=new Array;for(const Re of X.items){const Ze=(0,O.eE)(Re.entity),Ne=Ze===X.rootEntityRef;ye.push({id:Ze,root:Ne,...Re.entity});for(const rt of Re.parentEntityRefs)Ee.push({from:Ze,to:rt})}return{nodes:ye,edges:Ee}},[R]);return{loading:N,error:re,nodes:(de==null?void 0:de.nodes)||[],edges:(de==null?void 0:de.edges)||[]}}function Sr({node:x}){const C=Ao(),R=(0,We.s0)(),N=(0,h.tg)(Qt),[re,de]=(0,B.useState)(0),[X,ye]=(0,B.useState)(0),Ee=(0,B.useRef)(null);(0,B.useLayoutEffect)(()=>{if(Ee.current){let{height:Je,width:At}=Ee.current.getBBox();Je=Math.round(Je),At=Math.round(At),(Je!==X||At!==re)&&(de(At),ye(Je))}},[re,X]);const Re=10,Ze=X,Ne=Ze+Re,rt=Ne+re+Re*2,qe=X+Re*2,Ge=x.metadata.title||(x.kind&&x.metadata.name&&x.metadata.namespace?D({kind:x.kind,name:x.metadata.name,namespace:x.metadata.namespace||""}):x.id),Be=()=>{R(N({kind:x.kind,namespace:x.metadata.namespace||O.zG,name:x.metadata.name}))};return(0,u.jsxs)("g",{onClick:Be,className:C.clickable,children:[(0,u.jsx)("rect",{className:Et()(C.node,x.root?"secondary":"primary"),width:rt,height:qe,rx:10}),(0,u.jsx)($r,{kind:x.kind,y:Re,x:Re,width:Ze,height:Ze,className:Et()(C.text,x.root?"secondary":"primary")}),(0,u.jsx)("text",{ref:Ee,className:Et()(C.text,x.root?"secondary":"primary"),y:qe/2,x:Ne+(re+Re*2)/2,textAnchor:"middle",alignmentBaseline:"middle",children:Ge})]})}function Rr(x){const{loading:C,error:R,nodes:N,edges:re}=eo(x.entity);return C?(0,u.jsx)(P.Ex,{}):R?(0,u.jsx)(P.Gk,{error:R}):(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)(ft.Z,{variant:"h2",children:"Ancestry"}),(0,u.jsxs)(ft.Z,{gutterBottom:!0,children:["This is the ancestry of entities above the current one - as in, the chain(s) of entities down to the current one, where"," ",(0,u.jsx)(P.rU,{to:"https://backstage.io/docs/features/software-catalog/life-of-an-entity",children:"processors emitted"})," ","child entities that ultimately led to the current one existing. Note that this is a completely different mechanism from relations."]}),(0,u.jsx)(I.Z,{mt:4,children:(0,u.jsx)(P.mn,{nodes:N,edges:re,renderNode:Sr,direction:P.NX.Direction.BOTTOM_TOP,zoom:"enable-on-click"})})]})}var or=r(11776),Kn=r(38402),Ir=r(86136),Cr=r(99688),To=r(49378),Ro=r(54506),to=r(94339),Io=r(24579),Po=r(27685);const Wr=(0,wt.Z)(x=>({root:{display:"flex",flexDirection:"column"},marginTop:{marginTop:x.spacing(2)},helpIcon:{marginLeft:x.spacing(1),color:x.palette.text.disabled},monospace:{fontFamily:"monospace"}}));function tr(x){const C=Wr();return(0,u.jsx)(To.Z,{...x,primaryTypographyProps:{className:C.monospace},secondaryTypographyProps:{className:C.monospace}})}function Dr(x){const C=Wr();return(0,u.jsx)(Ro.Z,{className:C.monospace,children:x.children})}function Zr(x){return(0,u.jsx)(I.Z,{mt:2,children:(0,u.jsx)(to.Z,{variant:"outlined",children:(0,u.jsxs)(Io.Z,{children:[(0,u.jsxs)(w.Z,{variant:"h6",gutterBottom:!0,children:[x.title,x.helpLink&&(0,u.jsx)(Vr,{to:x.helpLink})]}),x.children]})})})}function no(x){if(x.match(/^url:https?:\/\//))return x.slice(4);if(x.match(/^https?:\/\//))return x}function Pr(x){const[C,R]=x.entry,N=no(R);return(0,u.jsxs)(Kn.Z,{children:[x.indent&&(0,u.jsx)(Ir.Z,{}),(0,u.jsx)(tr,{primary:C,secondary:N?(0,u.jsx)(P.rU,{to:N,children:R}):R})]})}function Vr(x){const C=Wr();return(0,u.jsx)(P.rU,{to:x.to,className:C.helpIcon,children:(0,u.jsx)(Po.Z,{fontSize:"inherit"})})}const Lo=(0,wt.Z)({root:{display:"flex",flexDirection:"column"}});function ro(x){var C,R;const N=(0,h.h_)(H),re=(0,O.eE)(x),de=(C=x.metadata.annotations)===null||C===void 0?void 0:C[O.P1],X=(R=x.metadata.annotations)===null||R===void 0?void 0:R[O.q1],{loading:ye,error:Ee,value:Re}=(0,bt.default)(async()=>!de&&!X?[]:(await N.getEntities({filter:[...de?[{[`metadata.annotations.${O.P1}`]:de}]:[],...X?[{[`metadata.annotations.${O.q1}`]:X}]:[]]})).items,[de,X]);return{loading:ye,error:Ee,location:de,originLocation:X,colocatedEntities:Re==null?void 0:Re.filter(Ze=>(0,O.eE)(Ze)!==re)}}function Sn(x){return(0,u.jsxs)(or.Z,{dense:!0,children:[x.header&&(0,u.jsx)(Pr,{entry:x.header},"header"),x.entities.map(C=>(0,u.jsxs)(Kn.Z,{children:[(0,u.jsx)(Ir.Z,{children:(0,u.jsx)($r,{kind:C.kind})}),(0,u.jsx)(tr,{primary:(0,u.jsx)(te,{entityRef:C})})]},(0,O.eE)(C)))]})}function oo(x){const{entity:C}=x,{loading:R,error:N,location:re,originLocation:de,colocatedEntities:X}=ro(C);if(R)return(0,u.jsx)(P.Ex,{});if(N)return(0,u.jsx)(P.Gk,{error:N});if(!re&&!de)return(0,u.jsx)(Cr.Z,{severity:"warning",children:"Entity had no location information."});if(!(X!=null&&X.length))return(0,u.jsx)(Cr.Z,{severity:"info",children:"There were no other entities on this location."});if(re===de)return(0,u.jsx)(Sn,{entities:X});const ye=X.filter(Re=>{var Ze;return((Ze=Re.metadata.annotations)===null||Ze===void 0?void 0:Ze[O.P1])===re}),Ee=X.filter(Re=>{var Ze;return((Ze=Re.metadata.annotations)===null||Ze===void 0?void 0:Ze[O.q1])===de});return(0,u.jsxs)(u.Fragment,{children:[ye.length>0&&(0,u.jsx)(Sn,{entities:ye,header:["At the same location",re]}),Ee.length>0&&(0,u.jsx)(Sn,{entities:Ee,header:["At the same origin",de]})]})}function so(x){const C=Lo();return(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)(ft.Z,{variant:"h2",children:"Colocated"}),(0,u.jsx)(ft.Z,{children:"These are the entities that are colocated with this entity - as in, they originated from the same data source (e.g. came from the same YAML file), or from the same origin (e.g. the originally registered URL)."}),(0,u.jsx)("div",{className:C.root,children:(0,u.jsx)(oo,{entity:x.entity})})]})}function io(x){return Object.fromEntries([...Object.entries(x)].sort((C,R)=>C[0]<R[0]?-1:1))}function wr(x){return(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)(ft.Z,{variant:"h2",children:"Entity as JSON"}),(0,u.jsx)(ft.Z,{children:"This is the raw entity data as received from the catalog, on JSON form."}),(0,u.jsx)(ft.Z,{children:(0,u.jsx)("div",{style:{fontSize:"75%"},"data-testid":"code-snippet",children:(0,u.jsx)(P.Oi,{text:JSON.stringify(io(x.entity),void 0,2),language:"json",showCopyCodeButton:!0})})})]})}var Oo=r(3440),ao=r.n(Oo);const ko=(0,wt.Z)({root:{display:"flex",flexDirection:"column"}});function lo(x){var C,R;const N=ko(),{apiVersion:re,kind:de,metadata:X,spec:ye,relations:Ee=[],status:Re={}}=x.entity,Ze=ao()(Jt()(Ee,Ne=>Ne.targetRef),"type");return(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)(ft.Z,{variant:"h2",children:"Overview"}),(0,u.jsxs)("div",{className:N.root,children:[(0,u.jsx)(Zr,{title:"Identity",children:(0,u.jsxs)(or.Z,{dense:!0,children:[(0,u.jsx)(Kn.Z,{children:(0,u.jsx)(tr,{primary:"apiVersion",secondary:re})}),(0,u.jsx)(Kn.Z,{children:(0,u.jsx)(tr,{primary:"kind",secondary:de})}),(ye==null?void 0:ye.type)&&(0,u.jsx)(Kn.Z,{children:(0,u.jsx)(tr,{primary:"spec.type",secondary:ye.type})}),X.uid&&(0,u.jsx)(Kn.Z,{children:(0,u.jsx)(tr,{primary:"uid",secondary:X.uid})}),X.etag&&(0,u.jsx)(Kn.Z,{children:(0,u.jsx)(tr,{primary:"etag",secondary:X.etag})})]})}),(0,u.jsxs)(Zr,{title:"Metadata",children:[!!Object.keys(X.annotations||{}).length&&(0,u.jsx)(or.Z,{dense:!0,subheader:(0,u.jsxs)(Dr,{children:["Annotations",(0,u.jsx)(Vr,{to:"https://backstage.io/docs/features/software-catalog/well-known-annotations"})]}),children:Object.entries(X.annotations).map(Ne=>(0,u.jsx)(Pr,{indent:!0,entry:Ne},Ne[0]))}),!!Object.keys(X.labels||{}).length&&(0,u.jsx)(or.Z,{dense:!0,subheader:(0,u.jsx)(Dr,{children:"Labels"}),children:Object.entries(X.labels).map(Ne=>(0,u.jsx)(Pr,{indent:!0,entry:Ne},Ne[0]))}),!!(!((C=X.tags)===null||C===void 0)&&C.length)&&(0,u.jsx)(or.Z,{dense:!0,subheader:(0,u.jsx)(Dr,{children:"Tags"}),children:X.tags.map((Ne,rt)=>(0,u.jsxs)(Kn.Z,{children:[(0,u.jsx)(Ir.Z,{}),(0,u.jsx)(tr,{primary:Ne})]},`${Ne}-${rt}`))})]}),!!Ee.length&&(0,u.jsx)(Zr,{title:"Relations",helpLink:"https://backstage.io/docs/features/software-catalog/well-known-relations",children:Object.entries(Ze).map(([Ne,rt],qe)=>(0,u.jsx)("div",{children:(0,u.jsx)(or.Z,{dense:!0,subheader:(0,u.jsx)(Dr,{children:Ne}),children:rt.map(Ge=>(0,u.jsxs)(Kn.Z,{children:[(0,u.jsx)(Ir.Z,{children:(0,u.jsx)($r,{entityRef:Ge.targetRef})}),(0,u.jsx)(tr,{primary:(0,u.jsx)(te,{entityRef:Ge.targetRef})})]},Ge.targetRef))})},qe))}),!!(!((R=Re.items)===null||R===void 0)&&R.length)&&(0,u.jsx)(Zr,{title:"Status",helpLink:"https://backstage.io/docs/features/software-catalog/well-known-statuses",children:Re.items.map((Ne,rt)=>(0,u.jsxs)("div",{children:[(0,u.jsxs)(w.Z,{children:[Ne.level,": ",Ne.type]}),(0,u.jsx)(I.Z,{ml:2,children:Ne.message})]},rt))})]})]})}var jr=r(72847);function us(x){return(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)(ft.Z,{variant:"h2",children:"Entity as YAML"}),(0,u.jsx)(ft.Z,{children:"This is the raw entity data as received from the catalog, on YAML form."}),(0,u.jsx)(ft.Z,{children:(0,u.jsx)("div",{style:{fontSize:"75%"},"data-testid":"code-snippet",children:(0,u.jsx)(P.Oi,{text:jr.ZP.stringify(io(x.entity)),language:"yaml",showCopyCodeButton:!0})})})]})}const co=(0,wt.Z)(x=>({fullHeightDialog:{height:"calc(100% - 64px)"},root:{display:"flex",flexGrow:1,width:"100%",backgroundColor:x.palette.background.paper},tabs:{borderRight:`1px solid ${x.palette.divider}`,flexShrink:0},tabContents:{flexGrow:1,overflowX:"auto"}}));function hr(x){const{children:C,value:R,index:N,...re}=x,de=co();return(0,u.jsx)("div",{role:"tabpanel",hidden:R!==N,id:`vertical-tabpanel-${N}`,"aria-labelledby":`vertical-tab-${N}`,className:de.tabContents,...re,children:R===N&&(0,u.jsx)(I.Z,{pl:3,pr:3,children:C})})}function Lr(x){return{id:`vertical-tab-${x}`,"aria-controls":`vertical-tabpanel-${x}`}}function Bo(x){const C=co(),[R,N]=B.useState(0);return(0,B.useEffect)(()=>{N(0)},[x.open]),x.entity?(0,u.jsxs)(E.Z,{fullWidth:!0,maxWidth:"xl",open:x.open,onClose:x.onClose,"aria-labelledby":"entity-inspector-dialog-title",PaperProps:{className:C.fullHeightDialog},children:[(0,u.jsx)(Q.Z,{id:"entity-inspector-dialog-title",children:"Entity Inspector"}),(0,u.jsx)(be.Z,{dividers:!0,children:(0,u.jsxs)("div",{className:C.root,children:[(0,u.jsxs)(je.Z,{orientation:"vertical",variant:"scrollable",value:R,onChange:(re,de)=>N(de),"aria-label":"Inspector options",className:C.tabs,children:[(0,u.jsx)(ke.Z,{label:"Overview",...Lr(0)}),(0,u.jsx)(ke.Z,{label:"Ancestry",...Lr(1)}),(0,u.jsx)(ke.Z,{label:"Colocated",...Lr(2)}),(0,u.jsx)(ke.Z,{label:"Raw JSON",...Lr(3)}),(0,u.jsx)(ke.Z,{label:"Raw YAML",...Lr(4)})]}),(0,u.jsx)(hr,{value:R,index:0,children:(0,u.jsx)(lo,{entity:x.entity})}),(0,u.jsx)(hr,{value:R,index:1,children:(0,u.jsx)(Rr,{entity:x.entity})}),(0,u.jsx)(hr,{value:R,index:2,children:(0,u.jsx)(so,{entity:x.entity})}),(0,u.jsx)(hr,{value:R,index:3,children:(0,u.jsx)(wr,{entity:x.entity})}),(0,u.jsx)(hr,{value:R,index:4,children:(0,u.jsx)(us,{entity:x.entity})})]})}),(0,u.jsx)(ht.Z,{children:(0,u.jsx)(V.Z,{onClick:x.onClose,color:"primary",children:"Close"})})]}):null}var Yn=r(85256);function Gs(x){var C;const R=(0,h.h_)(H),N=(C=x.metadata.annotations)===null||C===void 0?void 0:C[O.q1],re=x.metadata.uid,de=N==="bootstrap:bootstrap",X=(0,bt.default)(async()=>{const Ge=R.getLocationByRef(N);let Be;if(!N)Be=Promise.resolve([]);else{const Je=`metadata.annotations.${O.q1}`;Be=R.getEntities({filter:{[Je]:N},fields:["kind","metadata.uid","metadata.name","metadata.namespace"]}).then(At=>At.items)}return Promise.all([Ge,Be]).then(([Je,At])=>({location:Je,colocatedEntities:At}))},[R,x]),ye=(0,B.useCallback)(async function(){const{location:Be}=X.value;await R.removeLocationById(Be.id)},[R,X]),Ee=(0,B.useCallback)(async function(){await R.removeEntityByUid(re)},[R,re]);if(de)return{type:"bootstrap",location:N,deleteEntity:Ee};const{loading:Re,error:Ze,value:Ne}=X;if(Re)return{type:"loading"};if(Ze)return{type:"error",error:Ze};const{location:rt,colocatedEntities:qe}=Ne;return rt?{type:"unregister",location:N,colocatedEntities:qe.map(O.iB),unregisterLocation:ye,deleteEntity:Ee}:{type:"only-delete",deleteEntity:Ee}}var $o=r(23054);const hs=(0,wt.Z)({advancedButton:{fontSize:"0.7em"},dialogActions:{display:"inline-block"}}),ps=({entity:x,onConfirm:C,onClose:R})=>{const N=(0,h.h_)(h.$v),re=(0,h.h_)(h.Ds),de=hs(),X=Gs(x),[ye,Ee]=(0,B.useState)(!1),[Re,Ze]=(0,B.useState)(!1);var Ne;const rt=(Ne=re.getOptionalString("app.title"))!==null&&Ne!==void 0?Ne:"Backstage",qe=(0,B.useCallback)(async function(){if("unregisterLocation"in X){Ze(!0);try{await X.unregisterLocation(),C()}catch(At){(0,$o.BD)(At),N.post({message:At.message})}finally{Ze(!1)}}},[N,C,X]),Ge=(0,B.useCallback)(async function(){if("deleteEntity"in X){Ze(!0);try{await X.deleteEntity(),C()}catch(At){(0,$o.BD)(At),N.post({message:At.message})}finally{Ze(!1)}}},[N,C,X]),Be=()=>(0,u.jsx)(ht.Z,{className:de.dialogActions,children:(0,u.jsx)(V.Z,{onClick:R,color:"primary",children:"Cancel"})});return X.type==="loading"?(0,u.jsx)(P.Ex,{}):X.type==="error"?(0,u.jsx)(P.Gk,{error:X.error}):X.type==="bootstrap"?(0,u.jsxs)(u.Fragment,{children:[(0,u.jsxs)(Cr.Z,{severity:"info",children:['You cannot unregister this entity, since it originates from a protected Backstage configuration (location "',X.location,'"). If you believe this is in error, please contact the ',rt," ","integrator."]}),(0,u.jsxs)(I.Z,{marginTop:2,children:[!ye&&(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)(V.Z,{variant:"text",size:"small",color:"primary",className:de.advancedButton,onClick:()=>Ee(!0),children:"Advanced Options"}),(0,u.jsx)(Be,{})]}),ye&&(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)(ft.Z,{children:"You have the option to delete the entity itself from the catalog. Note that this should only be done if you know that the catalog file has been deleted at, or moved from, its origin location. If that is not the case, the entity will reappear shortly as the next refresh round is performed by the catalog."}),(0,u.jsx)(V.Z,{variant:"contained",color:"secondary",disabled:Re,onClick:Ge,children:"Delete Entity"}),(0,u.jsx)(Be,{})]})]})]}):X.type==="only-delete"?(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)(ft.Z,{children:"This entity does not seem to originate from a registered location. You therefore only have the option to delete it outright from the catalog."}),(0,u.jsx)(V.Z,{variant:"contained",color:"secondary",disabled:Re,onClick:Ge,children:"Delete Entity"}),(0,u.jsx)(Be,{})]}):X.type==="unregister"?(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)(ft.Z,{children:"This action will unregister the following entities:"}),(0,u.jsx)(ft.Z,{component:"ul",children:X.colocatedEntities.map(Je=>(0,u.jsx)("li",{children:(0,u.jsx)(te,{entityRef:Je})},`${Je.kind}:${Je.namespace}/${Je.name}`))}),(0,u.jsx)(ft.Z,{children:"Located at the following location:"}),(0,u.jsx)(ft.Z,{component:"ul",children:(0,u.jsx)("li",{children:X.location})}),(0,u.jsxs)(ft.Z,{children:["To undo, just re-register the entity in ",rt,"."]}),(0,u.jsxs)(I.Z,{marginTop:2,children:[(0,u.jsx)(V.Z,{variant:"contained",color:"secondary",disabled:Re,onClick:qe,children:"Unregister Location"}),!ye&&(0,u.jsx)(I.Z,{component:"span",marginLeft:2,children:(0,u.jsx)(V.Z,{variant:"text",size:"small",color:"primary",className:de.advancedButton,onClick:()=>Ee(!0),children:"Advanced Options"})})]}),ye&&(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)(I.Z,{paddingTop:4,paddingBottom:4,children:(0,u.jsx)(Yn.Z,{})}),(0,u.jsx)(ft.Z,{children:"You also have the option to delete the entity itself from the catalog. Note that this should only be done if you know that the catalog file has been deleted at, or moved from, its origin location. If that is not the case, the entity will reappear shortly as the next refresh round is performed by the catalog."}),(0,u.jsx)(V.Z,{variant:"contained",color:"secondary",disabled:Re,onClick:Ge,children:"Delete Entity"})]})]}):(0,u.jsx)(Cr.Z,{severity:"error",children:"Internal error: Unknown state"})},uo=x=>{const{open:C,onConfirm:R,onClose:N,entity:re}=x;return(0,u.jsxs)(E.Z,{open:C,onClose:N,children:[(0,u.jsx)(Q.Z,{id:"responsive-dialog-title",children:"Are you sure you want to unregister this entity?"}),(0,u.jsx)(be.Z,{children:(0,u.jsx)(ps,{entity:re,onConfirm:R,onClose:N})})]})};var fs=r(12231),gs=r(9520),sr=r(47603);const Do=(0,wt.Z)(x=>({root:{backgroundColor:"rgba(0, 0, 0, .11)",boxShadow:"none",margin:x.spacing(1,0,1,0)},title:{margin:x.spacing(1,0,0,1),textTransform:"uppercase",fontSize:12,fontWeight:"bold"},listIcon:{minWidth:30,color:x.palette.text.primary},menuItem:{minHeight:x.spacing(6)},groupWrapper:{margin:x.spacing(1,1,2,1)}}),{name:"CatalogReactUserListPicker"});function Wn(x){return[{name:"Personal",items:[{id:"owned",label:"Owned",icon:sr.Z},{id:"starred",label:"Starred",icon:er.Z}]},{name:x!=null?x:"Company",items:[{id:"all",label:"All"}]}]}const ho=x=>{const{initialFilter:C,availableFilters:R}=x,N=Do(),re=(0,h.h_)(h.Ds);var de;const X=(de=re.getOptionalString("organization.name"))!==null&&de!==void 0?de:"Company",{filters:ye,updateFilters:Ee,backendEntities:Re,queryParameters:{kind:Ze,user:Ne},loading:rt}=mt(),qe=["starred","all"],Ge=Wn(X).map(In=>({...In,items:In.items.filter(({id:Vn})=>["group","user"].some(Or=>Or===Ze)?qe.includes(Vn):!R||R.includes(Vn))})).filter(({items:In})=>!!In.length),{isStarredEntity:Be}=Pn(),{isOwnedEntity:Je,loading:At}=tn(),cn=rt||At,qt=(0,B.useMemo)(()=>new Qe("owned",Je,Be),[Je,Be]),on=(0,B.useMemo)(()=>new Qe("starred",Je,Be),[Je,Be]),nn=(0,B.useMemo)(()=>[Ne].flat()[0],[Ne]),[An,Rn]=(0,B.useState)(nn!=null?nn:C),Er=(0,B.useMemo)(()=>Re.filter((0,oe.Gz)((0,lt.compact)(Object.values({...ye,user:void 0})))),[ye,Re]),Nr=(0,B.useMemo)(()=>({all:Er.length,starred:Er.filter(In=>on.filterEntity(In)).length,owned:Er.filter(In=>qt.filterEntity(In)).length}),[Er,on,qt]);(0,B.useEffect)(()=>{nn&&Rn(nn)},[nn]),(0,B.useEffect)(()=>{!cn&&An&&An!=="all"&&Nr[An]===0&&Rn("all")},[cn,Nr,An,Rn]),(0,B.useEffect)(()=>{Ee({user:An?new Qe(An,Je,Be):void 0})},[An,Je,Be,Ee]);var Gr;return(0,u.jsx)(to.Z,{className:N.root,children:Ge.map(In=>(0,u.jsxs)(B.Fragment,{children:[(0,u.jsx)(w.Z,{variant:"subtitle2",component:"span",className:N.title,children:In.name}),(0,u.jsx)(to.Z,{className:N.groupWrapper,children:(0,u.jsx)(or.Z,{disablePadding:!0,dense:!0,role:"menu","aria-label":In.name,children:In.items.map(Vn=>{var Or;return(0,u.jsxs)(fs.Z,{role:"none presentation",button:!0,divider:!0,onClick:()=>Rn(Vn.id),selected:Vn.id===((Or=ye.user)===null||Or===void 0?void 0:Or.value),className:N.menuItem,disabled:Nr[Vn.id]===0,"data-testid":`user-picker-${Vn.id}`,tabIndex:0,ContainerProps:{role:"menuitem"},children:[Vn.icon&&(0,u.jsx)(Ir.Z,{className:N.listIcon,children:(0,u.jsx)(Vn.icon,{fontSize:"small"})}),(0,u.jsx)(To.Z,{children:(0,u.jsxs)(w.Z,{variant:"body1",children:[Vn.label," "]})}),(0,u.jsx)(gs.Z,{children:(Gr=Nr[Vn.id])!==null&&Gr!==void 0?Gr:"-"})]},Vn.id)})})})]},In.name))})},Zo=(0,wt.Z)({input:{}},{name:"CatalogReactEntityProcessingStatusPickerPicker"}),Hr=(0,u.jsx)(jn.Z,{fontSize:"small"}),No=(0,u.jsx)(hn.Z,{fontSize:"small"}),Fo=()=>{const x=Zo(),{updateFilters:C}=mt(),[R,N]=(0,B.useState)([]);function re(ye){C({orphan:ye?new St(ye):void 0})}function de(ye){C({error:ye?new It(ye):void 0})}const X=["Is Orphan","Has Error"];return(0,u.jsx)(I.Z,{pb:1,pt:1,children:(0,u.jsxs)(w.Z,{variant:"button",component:"label",children:["Processing Status",(0,u.jsx)(Tn.ZP,{multiple:!0,disableCloseOnSelect:!0,options:X,value:R,onChange:(ye,Ee)=>{N(Ee),re(Ee.includes("Is Orphan")),de(Ee.includes("Has Error"))},renderOption:(ye,{selected:Ee})=>(0,u.jsx)(ct.Z,{control:(0,u.jsx)(vn.Z,{icon:Hr,checkedIcon:No,checked:Ee}),onClick:Re=>Re.preventDefault(),label:ye}),size:"small",popupIcon:(0,u.jsx)(ln.Z,{"data-testid":"processing-status-picker-expand"}),renderInput:ye=>(0,u.jsx)(Kt.Z,{...ye,className:x.input,variant:"outlined"})})]})})},ms=(0,wt.Z)({input:{}},{name:"CatalogReactEntityNamespacePicker"}),Uo=()=>{const x=ms();return(0,u.jsx)(bn,{label:"Namespace",name:"namespace",path:"metadata.namespace",Filter:st,InputProps:{className:x.input}})};function po(x){const{children:C,value:R}=x;var N;const[re,de]=useState((N=R==null?void 0:R.filters)!==null&&N!==void 0?N:{}),X=useCallback(Ge=>{de(Be=>{const Je=typeof Ge=="function"?Ge(Be):Ge;return{...Be,...Je}})},[]),ye=useMemo(()=>({entities:[],backendEntities:[],queryParameters:{}}),[]);var Ee,Re,Ze,Ne,rt;const qe=useMemo(()=>({entities:(Ee=R==null?void 0:R.entities)!==null&&Ee!==void 0?Ee:ye.entities,backendEntities:(Re=R==null?void 0:R.backendEntities)!==null&&Re!==void 0?Re:ye.backendEntities,updateFilters:(Ze=R==null?void 0:R.updateFilters)!==null&&Ze!==void 0?Ze:X,filters:re,loading:(Ne=R==null?void 0:R.loading)!==null&&Ne!==void 0?Ne:!1,queryParameters:(rt=R==null?void 0:R.queryParameters)!==null&&rt!==void 0?rt:ye.queryParameters,error:R==null?void 0:R.error}),[R,ye,re,X]);return _jsx(EntityListContext.Provider,{value:qe,children:C})}},75435:function(Ct,$e,r){"use strict";r.d($e,{h:function(){return h}});var t=r(25271);function h(H,f,W){var g;let u=(H==null||(g=H.relations)===null||g===void 0?void 0:g.filter(B=>B.type===f).map(B=>(0,t.of)(B.targetRef)))||[];return W!=null&&W.kind&&(u=u.filter(B=>B.kind.toLocaleLowerCase("en-US")===W.kind.toLocaleLowerCase("en-US"))),u}},49280:function(Ct,$e,r){"use strict";r.d($e,{hF:function(){return H.h},CV:function(){return W},wq:function(){return t},Gz:function(){return h}});function t(u){return u.reduce((B,ve)=>({...B,...ve.getCatalogFilters?ve.getCatalogFilters():{}}),{})}function h(u){return B=>u.every(ve=>!ve.filterEntity||ve.filterEntity(B))}var H=r(75435),f=r(25271);function W(u,B){var ve;const ue=(ve=u.metadata.annotations)===null||ve===void 0?void 0:ve[f.M6];if(ue)try{const V=(0,f.Ou)(ue),K=B.byUrl(V.target);return{locationTargetUrl:V.target,integrationType:K==null?void 0:K.type}}catch{return}}function g(u,B){const ve=new Set([...getEntityRelations(u,RELATION_MEMBER_OF,{kind:"group"}),...u?[getCompoundEntityRef(u)]:[]].map(stringifyEntityRef)),ue=getEntityRelations(B,RELATION_OWNED_BY).map(stringifyEntityRef);for(const V of ue)if(ve.has(V))return!0;return!1}},33414:function(Ct,$e,r){"use strict";r.r($e),r.d($e,{AboutCard:function(){return ot},AboutContent:function(){return z},AboutField:function(){return O}});var t=r(52322),h=r(25271),H=r(53974),f=r(60871),W=r(32838),g=r(43514),u=r(79692),B=r(94339),ve=r(32552),ue=r(61837),V=r(85256),K=r(24579),I=r(52866),w=r(30254),ie=r(27604),ee=r(2784),ne=r(19625),$=r(60905),T=r(7089),P=r(90436);const L=(0,u.Z)(He=>({value:{fontWeight:"bold",overflow:"hidden",lineHeight:"24px",wordBreak:"break-word"},label:{color:He.palette.text.secondary,textTransform:"uppercase",fontSize:"10px",fontWeight:"bold",letterSpacing:.5,overflow:"hidden",whiteSpace:"nowrap"}}));function O(He){const{label:st,value:Qe,gridSizes:St,children:It}=He,xt=L(),lt=(0,f.vJ)(It,Nt=>Nt.getElements()),Pt=lt.length>0?lt:(0,t.jsx)(P.Z,{variant:"body2",className:xt.value,children:Qe||"unknown"});return(0,t.jsxs)($.Z,{item:!0,...St,children:[(0,t.jsx)(P.Z,{variant:"h2",className:xt.label,children:st}),Pt]})}var oe=r(24851);const Le=(0,u.Z)({description:{wordBreak:"break-word"}});function ze(He,st,Qe){if(st==="url"||He.includes("://"))return He;const St=Qe.type==="file"?`file://${Qe.target}`:Qe.target;return st==="file"||Qe.type==="file"?new URL(He,St).href:St}function z(He){var st,Qe,St,It,xt,lt,Pt,Nt;const{entity:We}=He,_t=Le(),ge=We.kind.toLocaleLowerCase("en-US")==="system",Se=We.kind.toLocaleLowerCase("en-US")==="resource",Fe=We.kind.toLocaleLowerCase("en-US")==="component",tt=We.kind.toLocaleLowerCase("en-US")==="api",mt=We.kind.toLocaleLowerCase("en-US")==="template",bt=We.kind.toLocaleLowerCase("en-US")==="location",pt=We.kind.toLocaleLowerCase("en-US")==="group",Ot=(0,g.hF)(We,h.cz,{kind:"system"}),Ht=(0,g.hF)(We,h.cz,{kind:"component"}),Jt=(0,g.hF)(We,h.cz,{kind:"domain"}),Bt=(0,g.hF)(We,h.S4);let un;try{un=(0,h.CV)(We)}catch{un=void 0}return(0,t.jsxs)($.Z,{container:!0,children:[(0,t.jsx)(O,{label:"Description",gridSizes:{xs:12},children:(0,t.jsx)(H.SA,{className:_t.description,content:(We==null||(st=We.metadata)===null||st===void 0?void 0:st.description)||"No description"})}),(0,t.jsx)(O,{label:"Owner",value:"No Owner",gridSizes:{xs:12,sm:6,lg:4},children:Bt.length>0&&(0,t.jsx)(g.rI,{entityRefs:Bt,defaultKind:"group"})}),(ge||Jt.length>0)&&(0,t.jsx)(O,{label:"Domain",value:"No Domain",gridSizes:{xs:12,sm:6,lg:4},children:Jt.length>0&&(0,t.jsx)(g.rI,{entityRefs:Jt,defaultKind:"domain"})}),(tt||Fe||Se||Ot.length>0)&&(0,t.jsx)(O,{label:"System",value:"No System",gridSizes:{xs:12,sm:6,lg:4},children:Ot.length>0&&(0,t.jsx)(g.rI,{entityRefs:Ot,defaultKind:"system"})}),Fe&&Ht.length>0&&(0,t.jsx)(O,{label:"Parent Component",value:"No Parent Component",gridSizes:{xs:12,sm:6,lg:4},children:(0,t.jsx)(g.rI,{entityRefs:Ht,defaultKind:"component"})}),(tt||Fe||Se||mt||pt||bt||typeof(We==null||(Qe=We.spec)===null||Qe===void 0?void 0:Qe.type)=="string")&&(0,t.jsx)(O,{label:"Type",value:We==null||(St=We.spec)===null||St===void 0?void 0:St.type,gridSizes:{xs:12,sm:6,lg:4}}),(tt||Fe||typeof(We==null||(It=We.spec)===null||It===void 0?void 0:It.lifecycle)=="string")&&(0,t.jsx)(O,{label:"Lifecycle",value:We==null||(xt=We.spec)===null||xt===void 0?void 0:xt.lifecycle,gridSizes:{xs:12,sm:6,lg:4}}),(0,t.jsx)(O,{label:"Tags",value:"No Tags",gridSizes:{xs:12,sm:6,lg:4},children:((We==null||(lt=We.metadata)===null||lt===void 0?void 0:lt.tags)||[]).map(Yt=>(0,t.jsx)(T.Z,{size:"small",label:Yt},Yt))}),bt&&((We==null||(Pt=We.spec)===null||Pt===void 0?void 0:Pt.targets)||(We==null||(Nt=We.spec)===null||Nt===void 0?void 0:Nt.target))&&(0,t.jsx)(O,{label:"Targets",gridSizes:{xs:12},children:(0,t.jsx)(oe.s,{cols:1,items:(We.spec.targets||[We.spec.target]).map(Yt=>Yt).map(Yt=>{var pn;return{text:Yt,href:ze(Yt,(We==null||(pn=We.spec)===null||pn===void 0?void 0:pn.type)||"unknown",un)}})})})]})}const yt=(0,u.Z)({gridItemCard:{display:"flex",flexDirection:"column",height:"calc(100% - 10px)",marginBottom:"10px"},fullHeightCard:{display:"flex",flexDirection:"column",height:"100%"},gridItemCardContent:{flex:1},fullHeightCardContent:{flex:1}});function ot(He){var st,Qe,St;const{variant:It}=He,xt=yt(),{entity:lt}=(0,g.X2)(),Pt=(0,f.h_)(W.q3),Nt=(0,f.h_)(g.Ah),We=(0,f.h_)(f.$v),_t=(0,f.h_)(f.VE),ge=(0,f.tg)(ne.jU),Se=(0,g.CV)(lt,Pt),Fe=(st=lt.metadata.annotations)===null||st===void 0?void 0:st[h.Tf],tt={label:"View Source",disabled:!Se,icon:(0,t.jsx)(W.nW,{type:Se==null?void 0:Se.integrationType}),href:Se==null?void 0:Se.locationTargetUrl},mt={label:"View TechDocs",disabled:!(!((Qe=lt.metadata.annotations)===null||Qe===void 0)&&Qe["backstage.io/techdocs-ref"])||!ge,icon:(0,t.jsx)(w.Z,{}),href:ge&&ge({namespace:lt.metadata.namespace||h.zG,kind:lt.kind,name:lt.metadata.name})};let bt="";It==="gridItem"?bt=xt.gridItemCard:It==="fullHeight"&&(bt=xt.fullHeightCard);let pt="";It==="gridItem"?pt=xt.gridItemCardContent:It==="fullHeight"&&(pt=xt.fullHeightCardContent);const Ot=(St=lt.metadata.annotations)===null||St===void 0?void 0:St[h.P1],Ht=(Ot==null?void 0:Ot.startsWith("url:"))||(Ot==null?void 0:Ot.startsWith("file:")),Jt=(0,ee.useCallback)(async()=>{try{await Nt.refreshEntity((0,h.eE)(lt)),We.post({message:"Refresh scheduled",severity:"info"})}catch(Bt){_t.post(Bt)}},[Nt,We,_t,lt]);return(0,t.jsxs)(B.Z,{className:bt,children:[(0,t.jsx)(ve.Z,{title:"About",action:(0,t.jsxs)(t.Fragment,{children:[Ht&&(0,t.jsx)(ue.Z,{"aria-label":"Refresh",title:"Schedule entity refresh",onClick:Jt,children:(0,t.jsx)(I.Z,{})}),(0,t.jsx)(ue.Z,{component:H.rU,"aria-label":"Edit",disabled:!Fe,title:"Edit Metadata",to:Fe!=null?Fe:"#",children:(0,t.jsx)(ie.Z,{})})]}),subheader:(0,t.jsx)(H.M6,{links:[tt,mt]})}),(0,t.jsx)(V.Z,{}),(0,t.jsx)(K.Z,{className:pt,children:(0,t.jsx)(z,{entity:lt})})]})}},86359:function(Ct,$e,r){"use strict";r.d($e,{E:function(){return ne}});var t=r(52322),h=r(25271),H=r(53974),f=r(43514),W=r(90436),g=r(15459),u=r(27604),B=r(2997),ve=r(11640),ue=r(28347),V=r(76635),K=r(2784),I=r(7089);const w=Object.freeze({createNameColumn($){function T(P){var L;return((L=P.metadata)===null||L===void 0?void 0:L.title)||(0,f.$3)(P,{defaultKind:$==null?void 0:$.defaultKind})}return{title:"Name",field:"resolved.name",highlight:!0,customSort({entity:P},{entity:L}){return T(P).localeCompare(T(L))},render:({entity:P})=>{var L;return(0,t.jsx)(f.dx,{entityRef:P,defaultKind:($==null?void 0:$.defaultKind)||"Component",title:(L=P.metadata)===null||L===void 0?void 0:L.title})}}},createSystemColumn(){return{title:"System",field:"resolved.partOfSystemRelationTitle",render:({resolved:$})=>(0,t.jsx)(f.rI,{entityRefs:$.partOfSystemRelations,defaultKind:"system"})}},createOwnerColumn(){return{title:"Owner",field:"resolved.ownedByRelationsTitle",render:({resolved:$})=>(0,t.jsx)(f.rI,{entityRefs:$.ownedByRelations,defaultKind:"group"})}},createSpecTargetsColumn(){return{title:"Targets",field:"entity.spec.targets",render:({entity:$})=>{var T,P;return(0,t.jsx)(t.Fragment,{children:(($==null||(T=$.spec)===null||T===void 0?void 0:T.targets)||($==null||(P=$.spec)===null||P===void 0?void 0:P.target))&&(0,t.jsx)(H.Or,{text:($.spec.targets||[$.spec.target]).join(", "),placement:"bottom-start"})})}}},createSpecTypeColumn(){return{title:"Type",field:"entity.spec.type",hidden:!0,width:"auto"}},createSpecLifecycleColumn(){return{title:"Lifecycle",field:"entity.spec.lifecycle"}},createMetadataDescriptionColumn(){return{title:"Description",field:"entity.metadata.description",render:({entity:$})=>(0,t.jsx)(H.Or,{text:$.metadata.description,placement:"bottom-start"}),width:"auto"}},createTagsColumn(){return{title:"Tags",field:"entity.metadata.tags",cellStyle:{padding:"0px 16px 0px 20px"},render:({entity:$})=>(0,t.jsx)(t.Fragment,{children:$.metadata.tags&&$.metadata.tags.map(T=>(0,t.jsx)(I.Z,{label:T,size:"small",variant:"outlined",style:{marginBottom:"0px"}},T))}),width:"auto"}},createTitleColumn($){return{title:"Title",field:"entity.metadata.title",hidden:$==null?void 0:$.hidden,searchable:!0}},createLabelColumn($,T){return{title:(T==null?void 0:T.title)||"Label",field:"entity.metadata.labels",cellStyle:{padding:"0px 16px 0px 20px"},render:({entity:P})=>{var L;const O=(L=P.metadata)===null||L===void 0?void 0:L.labels,oe=O&&O[$]||(T==null?void 0:T.defaultValue);return(0,t.jsx)(t.Fragment,{children:oe&&(0,t.jsx)(I.Z,{label:oe,size:"small",variant:"outlined"},oe)})},width:"auto"}},createNamespaceColumn(){return{title:"Namespace",field:"entity.metadata.namespace",width:"auto"}}}),ie=(0,g.Z)({root:{color:"#f3ba37"}})(ve.Z),ee=($,T)=>{const P=L=>L.metadata.title||(0,f.$3)(L,{defaultKind:"Component"});return P($).localeCompare(P(T))},ne=$=>{var T,P;const{columns:L,actions:O,tableOptions:oe,subtitle:Le,emptyContent:ze}=$,{isStarredEntity:z,toggleStarredEntity:yt}=(0,f.CR)(),{loading:ot,error:He,entities:st,filters:Qe}=(0,f.wp)(),St=(0,K.useMemo)(()=>{var ge;return[w.createTitleColumn({hidden:!0}),w.createNameColumn({defaultKind:(ge=Qe.kind)===null||ge===void 0?void 0:ge.value}),...Se(),w.createMetadataDescriptionColumn(),w.createTagsColumn()];function Se(){var Fe;const tt=[w.createSystemColumn(),w.createOwnerColumn(),w.createSpecTypeColumn(),w.createSpecLifecycleColumn()];switch((Fe=Qe.kind)===null||Fe===void 0?void 0:Fe.value){case"user":return[];case"domain":case"system":return[w.createOwnerColumn()];case"group":case"template":return[w.createSpecTypeColumn()];case"location":return[w.createSpecTypeColumn(),w.createSpecTargetsColumn()];default:return st.every(mt=>mt.metadata.namespace==="default")?tt:[...tt,w.createNamespaceColumn()]}}},[(T=Qe.kind)===null||T===void 0?void 0:T.value,st]),It=Qe.type===void 0;var xt;const lt=(0,V.capitalize)((xt=(P=Qe.user)===null||P===void 0?void 0:P.value)!==null&&xt!==void 0?xt:"all");if(He)return(0,t.jsx)("div",{children:(0,t.jsx)(H.GB,{severity:"error",title:"Could not fetch catalog entities.",children:(0,t.jsx)(H.Oi,{language:"text",text:He.toString()})})});const Pt=[({entity:ge})=>{var Se;const Fe=(Se=ge.metadata.annotations)===null||Se===void 0?void 0:Se[h.l2],tt="View";return{icon:()=>(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(W.Z,{variant:"srOnly",children:tt}),(0,t.jsx)(B.Z,{fontSize:"small"})]}),tooltip:tt,disabled:!Fe,onClick:()=>{Fe&&window.open(Fe,"_blank")}}},({entity:ge})=>{var Se;const Fe=(Se=ge.metadata.annotations)===null||Se===void 0?void 0:Se[h.Tf],tt="Edit";return{icon:()=>(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(W.Z,{variant:"srOnly",children:tt}),(0,t.jsx)(u.Z,{fontSize:"small"})]}),tooltip:tt,disabled:!Fe,onClick:()=>{Fe&&window.open(Fe,"_blank")}}},({entity:ge})=>{const Se=z(ge),Fe=Se?"Remove from favorites":"Add to favorites";return{cellStyle:{paddingLeft:"1em"},icon:()=>(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(W.Z,{variant:"srOnly",children:Fe}),Se?(0,t.jsx)(ie,{}):(0,t.jsx)(ue.Z,{})]}),tooltip:Fe,onClick:()=>yt(ge)}}],Nt=st.sort(ee).map(ge=>{const Se=(0,f.hF)(ge,h.cz,{kind:"system"}),Fe=(0,f.hF)(ge,h.S4);return{entity:ge,resolved:{name:(0,f.$3)(ge,{defaultKind:"Component"}),ownedByRelationsTitle:Fe.map(tt=>(0,f.$3)(tt,{defaultKind:"group"})).join(", "),ownedByRelations:Fe,partOfSystemRelationTitle:Se.map(tt=>(0,f.$3)(tt,{defaultKind:"system"})).join(", "),partOfSystemRelations:Se}}}),We=(L||St).find(ge=>ge.title==="Type");We&&(We.hidden=!It);const _t=Nt.length>20;return(0,t.jsx)(H.iA,{isLoading:ot,columns:L||St,options:{paging:_t,pageSize:20,actionsColumnIndex:-1,loadingType:"linear",showEmptyDataSourceMessage:!ot,padding:"dense",pageSizeOptions:[20,50,100],...oe},title:`${lt} (${st.length})`,data:Nt,actions:O||Pt,subtitle:Le,emptyContent:ze})};ne.columns=w},85877:function(Ct,$e,r){"use strict";r.r($e),r.d($e,{EntityLabelsCard:function(){return K},hasLabels:function(){return I}});var t=r(52322),h=r(43514),H=r(2784),f=r(53974),W=r(79692),g=r(90436),u=r(77277);const B=`metadata:
|
|
34
34
|
name: example
|
|
35
35
|
labels:
|
|
36
36
|
javaVersion: 1.2.3`,ve=(0,W.Z)(w=>({code:{borderRadius:6,margin:`${w.spacing(2)}px 0px`,background:w.palette.type==="dark"?"#444":w.palette.common.white}}),{name:"PluginCatalogEntityLabelsEmptyState"});function ue(){const w=ve();return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(g.Z,{variant:"body1",children:"No labels defined for this entity. You can add labels to your entity YAML as shown in the highlighted example below:"}),(0,t.jsx)("div",{className:w.code,children:(0,t.jsx)(f.Oi,{text:B,language:"yaml",showLineNumbers:!0,highlightedNumbers:[3,4,5,6],customStyle:{background:"inherit",fontSize:"115%"}})}),(0,t.jsx)(u.Z,{variant:"contained",color:"primary",target:"_blank",href:"https://backstage.io/docs/features/software-catalog/descriptor-format#labels-optional",children:"Read more"})]})}const V=(0,W.Z)(w=>({key:{fontWeight:"bold"}})),K=w=>{var ie;const{variant:ee,title:ne}=w,{entity:$}=(0,h.X2)(),T=V(),P=[{render:O=>(0,t.jsx)(g.Z,{className:T.key,variant:"body2",children:O.key})},{field:"value"}],L=$==null||(ie=$.metadata)===null||ie===void 0?void 0:ie.labels;return(0,t.jsx)(f.rJ,{title:ne||"Labels",variant:ee,children:!L||Object.keys(L).length===0?(0,t.jsx)(ue,{}):(0,t.jsx)(f.iA,{columns:P,data:Object.keys(L).map(O=>({key:O,value:L[O]})),options:{search:!1,showTitle:!0,loadingType:"linear",header:!1,padding:"dense",pageSize:5,toolbar:!1,paging:Object.keys(L).length>5}})})};function I(w){var ie,ee;return!(w==null||(ie=w.metadata)===null||ie===void 0)&&ie.labels?Object.keys(w==null||(ee=w.metadata)===null||ee===void 0?void 0:ee.labels).some(Boolean):!1}},24851:function(Ct,$e,r){"use strict";r.d($e,{s:function(){return ie}});var t=r(52322),h=r(90348),H=r(11861),f=r(2784),W=r(79692),g=r(95544),u=r(90436),B=r(52160),ve=r(53974);const ue=(0,W.Z)({svgIcon:{display:"inline-block","& svg":{display:"inline-block",fontSize:"inherit",verticalAlign:"baseline"}}});function V(ee){const{href:ne,text:$,Icon:T}=ee,P=ue();return(0,t.jsxs)(g.Z,{display:"flex",children:[(0,t.jsx)(g.Z,{mr:1,className:P.svgIcon,children:(0,t.jsx)(u.Z,{component:"div",children:T?(0,t.jsx)(T,{}):(0,t.jsx)(B.Z,{})})}),(0,t.jsx)(g.Z,{flexGrow:"1",children:(0,t.jsx)(ve.rU,{to:ne,target:"_blank",rel:"noopener",children:$||ne})})]})}var K=r(41156);const I={xs:1,sm:1,md:1,lg:2,xl:3};function w(ee){const ne=[(0,K.Z)(L=>L.breakpoints.up("xl"))?"xl":null,(0,K.Z)(L=>L.breakpoints.up("lg"))?"lg":null,(0,K.Z)(L=>L.breakpoints.up("md"))?"md":null,(0,K.Z)(L=>L.breakpoints.up("sm"))?"sm":null,(0,K.Z)(L=>L.breakpoints.up("xs"))?"xs":null];let $=1;if(typeof ee=="number")$=ee;else{var T;const L=(T=ne.find(O=>O!==null))!==null&&T!==void 0?T:"xs";var P;$=(P=ee==null?void 0:ee[L])!==null&&P!==void 0?P:I[L]}return $}function ie(ee){const{items:ne,cols:$=void 0}=ee,T=w($);return(0,t.jsx)(h.Z,{rowHeight:"auto",cols:T,children:ne.map(({text:P,href:L,Icon:O},oe)=>(0,t.jsx)(H.Z,{children:(0,t.jsx)(V,{href:L,text:P!=null?P:L,Icon:O})},oe))})}},19625:function(Ct,$e,r){"use strict";r.d($e,{_Z:function(){return f},jU:function(){return H},yw:function(){return h}});var t=r(60871);const h=(0,t.x8)({id:"create-component",optional:!0}),H=(0,t.x8)({id:"view-techdoc",optional:!0,params:["namespace","kind","name"]}),f=(0,t.NT)({id:"catalog"})},15096:function(Ct,$e,r){"use strict";r.d($e,{FA:function(){return ve},qO:function(){return xt},Nd:function(){return z},E5:function(){return kt},Rx:function(){return L}});var t=r(60871);const h=(0,t.T0)({id:"plugin.search.queryservice"});class H{query(){return Promise.resolve(this.mockedResults||{results:[]})}constructor(J){_define_property(this,"mockedResults",void 0),this.mockedResults=J}}var f=r(52322),W=r(2784),g=r(38402),u=r(79692);const B=(0,u.Z)(()=>({highlight:{}}),{name:"BackstageHighlightedSearchResultText"}),ve=_=>{const{text:J,preTag:te,postTag:pe}=_,le=B(),y=(0,W.useMemo)(()=>J.split(new RegExp(`(${te}.+?${pe})`)),[pe,te,J]);return(0,f.jsx)(f.Fragment,{children:y.map((Z,q)=>Z.includes(te)?(0,f.jsx)("mark",{className:le.highlight,children:Z.replace(new RegExp(`${te}|${pe}`,"g"),"")},q):Z)})};var ue=r(50581),V=r(61837),K=r(86619),I=r(77277),w=r(21853),ie=r(48760),ee=r(76635),ne=r(64279),$=r(1849),T=r(51837);const P=(0,T.CT)("search-context"),L=()=>{const _=(0,W.useContext)(P);if(!_)throw new Error("useSearch must be used within a SearchContextProvider");const J=_.atVersion(1);if(!J)throw new Error("No SearchContext v1 found");return J},O=()=>(0,W.useContext)(P)!==void 0,oe={term:"",types:[],filters:{},pageLimit:void 0,pageCursor:void 0},Le=(_=oe)=>{var J,te,pe,le;const y=(0,t.h_)(h),[Z,q]=(0,W.useState)(_.term),[Y,we]=(0,W.useState)(_.types),[Ae,Ye]=(0,W.useState)(_.filters),[jt,vt]=(0,W.useState)(_.pageLimit),[nt,Ke]=(0,W.useState)(_.pageCursor),dt=(0,$.Z)(Z),at=(0,$.Z)(Ae),Dt=(0,ne.default)(()=>y.query({term:Z,types:Y,filters:Ae,pageLimit:jt,pageCursor:nt}),[Z,Y,Ae,jt,nt]),Mt=!Dt.loading&&!Dt.error&&((J=Dt.value)===null||J===void 0?void 0:J.nextPageCursor),Xt=!Dt.loading&&!Dt.error&&((te=Dt.value)===null||te===void 0?void 0:te.previousPageCursor),en=(0,W.useCallback)(()=>{var Et;Ke((Et=Dt.value)===null||Et===void 0?void 0:Et.nextPageCursor)},[(pe=Dt.value)===null||pe===void 0?void 0:pe.nextPageCursor]),Ut=(0,W.useCallback)(()=>{var Et;Ke((Et=Dt.value)===null||Et===void 0?void 0:Et.previousPageCursor)},[(le=Dt.value)===null||le===void 0?void 0:le.previousPageCursor]);return(0,W.useEffect)(()=>{dt!==void 0&&Z!==dt&&Ke(void 0)},[Z,dt,Ke]),(0,W.useEffect)(()=>{at!==void 0&&!(0,ee.isEqual)(Ae,at)&&Ke(void 0)},[Ae,at,Ke]),{result:Dt,term:Z,setTerm:q,types:Y,setTypes:we,filters:Ae,setFilters:Ye,pageLimit:jt,setPageLimit:vt,pageCursor:nt,setPageCursor:Ke,fetchNextPage:Mt?en:void 0,fetchPreviousPage:Xt?Ut:void 0}},ze=_=>{const{initialState:J,children:te}=_,pe=Le(J);return(0,f.jsx)(t.fC,{attributes:{searchTypes:pe.types.sort().join(",")},children:(0,f.jsx)(P.Provider,{value:(0,T.EI)({1:pe}),children:te})})},z=_=>{const{initialState:J,inheritParentContextIfAvailable:te,children:pe}=_;return O()&&te?(0,f.jsx)(f.Fragment,{children:pe}):(0,f.jsx)(ze,{initialState:J,children:pe})},yt=({children:_})=>{var J;const te=Ae=>(0,$.Z)(Ae)!==Ae,pe=(0,t.z$)(),{term:le,result:y}=L();var Z;const q=(Z=(J=y.value)===null||J===void 0?void 0:J.numberOfResults)!==null&&Z!==void 0?Z:void 0,we=te(y.loading)&&!y.loading;return(0,W.useEffect)(()=>{le&&we&&pe.captureEvent("search",le,{value:q})},[pe,le,q,we]),(0,f.jsx)(f.Fragment,{children:_})};function ot(_){return(0,W.forwardRef)((J,te)=>(0,f.jsx)(z,{inheritParentContextIfAvailable:!0,children:(0,f.jsx)(_,{...J,ref:te})}))}const He=ot((0,W.forwardRef)((_,J)=>{const{onChange:te,onKeyDown:pe=()=>{},onClear:le=()=>{},onSubmit:y=()=>{},debounceTime:Z=200,clearButton:q=!0,fullWidth:Y=!0,value:we,label:Ae,placeholder:Ye,inputProps:jt={},InputProps:vt={},endAdornment:nt,...Ke}=_,dt=(0,t.h_)(t.Ds),[at,Dt]=(0,W.useState)("");(0,W.useEffect)(()=>{Dt(Zt=>Zt!==we?String(we):Zt)},[we]),(0,ie.Z)(()=>te(at),Z,[at]);const Mt=(0,W.useCallback)(Zt=>{Dt(Zt.target.value)},[Dt]),Xt=(0,W.useCallback)(Zt=>{pe&&pe(Zt),y&&Zt.key==="Enter"&&y()},[pe,y]),en=(0,W.useCallback)(()=>{te(""),le&&le()},[te,le]),Ut=Ae?void 0:"Search",zt=Ye!=null?Ye:`Search in ${dt.getOptionalString("app.title")||"Backstage"}`,Et=(0,f.jsx)(ue.Z,{position:"start",children:(0,f.jsx)(V.Z,{"aria-label":"Query",size:"small",disabled:!0,children:(0,f.jsx)(w.Z,{})})}),Lt=(0,f.jsx)(ue.Z,{position:"end",children:(0,f.jsx)(I.Z,{"aria-label":"Clear",size:"small",onClick:en,onKeyDown:Zt=>{Zt.key==="Enter"&&Zt.stopPropagation()},children:"Clear"})});return(0,f.jsx)(yt,{children:(0,f.jsx)(K.Z,{id:"search-bar-text-field","data-testid":"search-bar-next",variant:"outlined",margin:"normal",inputRef:J,value:at,label:Ae,placeholder:zt,InputProps:{startAdornment:Et,endAdornment:q?Lt:nt,...vt},inputProps:{"aria-label":Ut,...jt},fullWidth:Y,onChange:Mt,onKeyDown:Xt,...Ke})})})),st=ot((0,W.forwardRef)((_,J)=>{const{value:te="",onChange:pe,...le}=_,{term:y,setTerm:Z}=L();(0,W.useEffect)(()=>{te&&Z(String(te))},[te,Z]);const q=(0,W.useCallback)(Y=>{pe?pe(Y):Z(Y)},[pe,Z]);return(0,f.jsx)(t.fC,{attributes:{pluginId:"search",extension:"SearchBar"},children:(0,f.jsx)(He,{...le,ref:J,value:y,onChange:q})})}));var Qe=r(4614),St=r(88013);const xt=(_=>J=>(0,f.jsx)(z,{inheritParentContextIfAvailable:!0,children:(0,f.jsx)(_,{...J})}))(function(J){const{loading:te,value:pe,onChange:le=()=>{},options:y=[],getOptionLabel:Z=Mt=>String(Mt),inputPlaceholder:q,inputDebounceTime:Y,freeSolo:we=!0,fullWidth:Ae=!0,clearOnBlur:Ye=!1,"data-testid":jt="search-autocomplete",...vt}=J,{setTerm:nt}=L(),Ke=(0,W.useCallback)(Mt=>Mt?typeof Mt=="string"?Mt:Z(Mt):"",[Z]),dt=(0,W.useMemo)(()=>Ke(pe),[pe,Ke]),at=(0,W.useCallback)((Mt,Xt,en,Ut)=>{nt(Ke(Xt)),le(Mt,Xt,en,Ut)},[Ke,nt,le]),Dt=(0,W.useCallback)(({InputProps:{ref:Mt,endAdornment:Xt},InputLabelProps:en,...Ut})=>(0,f.jsx)(st,{...Ut,ref:Mt,clearButton:!1,value:dt,placeholder:q,debounceTime:Y,endAdornment:te?(0,f.jsx)(Qe.Z,{"data-testid":"search-autocomplete-progressbar",color:"inherit",size:20}):Xt}),[te,dt,q,Y]);return(0,f.jsx)(St.ZP,{...vt,"data-testid":jt,value:pe,onChange:at,options:y,getOptionLabel:Z,renderInput:Dt,freeSolo:we,fullWidth:Ae,clearOnBlur:Ye})}),lt=_=>{const{icon:J,primaryText:te,primaryTextTypographyProps:pe,secondaryText:le,secondaryTextTypographyProps:y,disableTextTypography:Z}=_;return _jsxs(_Fragment,{children:[J?_jsx(ListItemIcon,{children:J}):null,_jsx(ListItemText,{primary:te,primaryTypographyProps:pe,secondary:le,secondaryTypographyProps:y,disableTypography:Z})]})};var Pt=r(42494),Nt=r(84899),We=r(5806),_t=r(21324),ge=r(56939),Se=r(73698),Fe=r(12231),tt=r(90436),mt=r(7089),bt=r(69294);const pt=(_,J,te=[],pe=250)=>{const le=(0,W.useRef)({}),y=_||(()=>Promise.resolve([])),[Z,q]=(0,bt.default)(y,[J],{loading:!0});if((0,ie.Z)(()=>{le.current[J]===void 0&&(le.current[J]=q(J).then(we=>(le.current[J]=we,we)))},pe,[q,J]),te.length)return{loading:!1,value:te};const Y=le.current[J];return Array.isArray(Y)?{loading:!1,value:Y}:Z},Ot=(_,J)=>{const{setFilters:te}=L();(0,W.useEffect)(()=>{J&&[J].flat().length>0&&te(pe=>({...pe,[_]:J}))},[])},Ht=_=>{const{className:J,defaultValue:te,name:pe,values:le,valuesDebounceMs:y,label:Z,filterSelectedOptions:q,limitTags:Y,multiple:we}=_,[Ae,Ye]=(0,W.useState)("");Ot(pe,te);const jt=typeof le=="function"?le:void 0,vt=typeof le=="function"?void 0:le,{value:nt,loading:Ke}=pt(jt,Ae,vt,y),{filters:dt,setFilters:at}=L(),Dt=dt[pe]||(we?[]:null),Mt=(Ut,zt)=>{at(Et=>{const{[pe]:Lt,...Zt}=Et;return zt?{...Zt,[pe]:zt}:{...Zt}})},Xt=Ut=>(0,f.jsx)(K.Z,{...Ut,name:"search",variant:"outlined",label:Z,fullWidth:!0}),en=(Ut,zt)=>Ut.map((Et,Lt)=>(0,f.jsx)(mt.Z,{label:Et,color:"primary",...zt({index:Lt})}));return(0,f.jsx)(St.ZP,{filterSelectedOptions:q,limitTags:Y,multiple:we,className:J,id:`${we?"multi-":""}select-filter-${pe}--select`,options:nt||[],loading:Ke,value:Dt,onChange:Mt,onInputChange:(Ut,zt)=>Ye(zt),renderInput:Xt,renderTags:en})},Jt=(0,u.Z)({label:{textTransform:"capitalize"},checkboxWrapper:{display:"flex",alignItems:"center",width:"100%"},textWrapper:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}}),Bt=_=>{const{className:J,defaultValue:te,label:pe,name:le,values:y=[],valuesDebounceMs:Z}=_,q=Jt(),{filters:Y,setFilters:we}=L();Ot(le,te);const Ae=typeof y=="function"?y:void 0,Ye=typeof y=="function"?void 0:y,{value:jt=[],loading:vt}=pt(Ae,"",Ye,Z),nt=dt=>{const{target:{value:at,checked:Dt}}=dt;we(Mt=>{const{[le]:Xt,...en}=Mt,Ut=(Xt||[]).filter(Et=>Et!==at),zt=Dt?[...Ut,at]:Ut;return zt.length?{...en,[le]:zt}:en})};var Ke;return(0,f.jsxs)(Pt.Z,{className:J,disabled:vt,fullWidth:!0,"data-testid":"search-checkboxfilter-next",children:[pe?(0,f.jsx)(Nt.Z,{className:q.label,children:pe}):null,jt.map(dt=>(0,f.jsx)(We.Z,{classes:{root:q.checkboxWrapper,label:q.textWrapper},label:dt,control:(0,f.jsx)(_t.Z,{color:"primary",tabIndex:-1,inputProps:{"aria-labelledby":dt},value:dt,name:dt,onChange:nt,checked:((Ke=Y[le])!==null&&Ke!==void 0?Ke:[]).includes(dt)})},dt))]})},un=_=>{const{className:J,defaultValue:te,label:pe,name:le,values:y,valuesDebounceMs:Z}=_,q=Jt();Ot(le,te);const Y=typeof y=="function"?y:void 0,we=typeof y=="function"?void 0:y,{value:Ae=[],loading:Ye}=pt(Y,"",we,Z),{filters:jt,setFilters:vt}=L(),nt=Ke=>{const{target:{value:dt}}=Ke;vt(at=>{const{[le]:Dt,...Mt}=at;return dt?{...Mt,[le]:dt}:Mt})};return(0,f.jsxs)(Pt.Z,{disabled:Ye,className:J,variant:"filled",fullWidth:!0,"data-testid":"search-selectfilter-next",children:[pe?(0,f.jsx)(ge.Z,{className:q.label,margin:"dense",children:pe}):null,(0,f.jsxs)(Se.Z,{variant:"outlined",value:jt[le]||"",onChange:nt,children:[(0,f.jsx)(Fe.Z,{value:"",children:(0,f.jsx)("em",{children:"All"})}),Ae.map(Ke=>(0,f.jsx)(Fe.Z,{value:Ke,children:(0,f.jsx)(tt.Z,{variant:"inherit",noWrap:!0,children:Ke})},Ke))]})]})},Yt=_=>{const{component:J,...te}=_;return(0,f.jsx)(J,{...te})};Yt.Checkbox=_=>(0,f.jsx)(Yt,{..._,component:Bt}),Yt.Select=_=>(0,f.jsx)(Yt,{..._,component:un}),Yt.Autocomplete=_=>(0,f.jsx)(Yt,{..._,component:Ht});var pn=r(48834).lW;const Fn=_=>pn.from(_.toString(),"utf-8").toString("base64"),Pn=_=>_?Number(pn.from(_,"base64").toString("utf-8")):0,fn=_=>{const{total:J=-1,cursor:te,hasNextPage:pe,onCursorChange:le,limit:y=25,limitLabel:Z="Results per page:",limitText:q=({from:nt,to:Ke})=>J>0?`of ${J}`:`${nt}-${Ke}`,limitOptions:Y,onLimitChange:we,...Ae}=_,Ye=useMemo(()=>Pn(te),[te]),jt=useCallback((nt,Ke)=>{le==null||le(Fn(Ke))},[le]),vt=useCallback(nt=>{const Ke=nt.target.value;we==null||we(parseInt(Ke,10))},[we]);return _jsx(TablePagination,{...Ae,component:"div",count:J,page:Ye,nextIconButtonProps:{...pe!==void 0&&{disabled:!pe}},onPageChange:jt,rowsPerPage:y,labelRowsPerPage:Z,labelDisplayedRows:q,rowsPerPageOptions:Y,onRowsPerPageChange:vt})},Ln=_=>{const{pageLimit:J,setPageLimit:te,pageCursor:pe,setPageCursor:le,fetchNextPage:y}=useSearch(),Z=useCallback(q=>{te(q),le(void 0)},[te,le]);return _jsx(fn,{..._,hasNextPage:!!y,limit:J,onLimitChange:Z,cursor:pe,onCursorChange:le})};var Un=r(53974);const tn=_=>{const{children:J}=_,te=useSearch(),{result:pe,...le}=te;return J(pe,le)},wn=_=>{const{query:J,children:te}=_,pe=useApi(searchApiRef),le=useAsync(()=>{const{term:y="",types:Z=[],filters:q={},...Y}=J;return pe.query({...Y,term:y,types:Z,filters:q})},[J]);return te(le,J)},Mn=_=>{const{query:J,children:te}=_;return J?_jsx(wn,{query:J,children:te}):_jsx(tn,{children:te})},ut=_=>{const{query:J,children:te,noResultsComponent:pe=_jsx(EmptyState,{missing:"data",title:"Sorry, no results were found"}),...le}=_;return _jsx(Mn,{query:J,children:({loading:y,error:Z,value:q})=>y?_jsx(Progress,{}):Z?_jsx(ResponseErrorPanel,{title:"Error encountered while fetching search results",error:Z}):q!=null&&q.results.length?isFunction(te)?te(q):_jsx(SearchResultListItemExtensions,{...le,results:q.results,children:te}):pe})},_n=_=>_jsx(AnalyticsContext,{attributes:{pluginId:"search",extension:"SearchResult"},children:_jsx(ut,{..._})}),wt=({result:_,highlight:J,icon:te,secondaryAction:pe,lineClamp:le=5})=>_?_jsxs(_Fragment,{children:[te&&_jsx(ListItemIcon,{children:te}),_jsx(ListItemText,{primaryTypographyProps:{variant:"h6"},primary:_jsx(Link,{noTrack:!0,to:_.location,children:J!=null&&J.fields.title?_jsx(HighlightedSearchResultText,{text:(J==null?void 0:J.fields.title)||"",preTag:(J==null?void 0:J.preTag)||"",postTag:(J==null?void 0:J.postTag)||""}):_.title}),secondary:_jsx(Typography,{component:"span",style:{display:"-webkit-box",WebkitBoxOrient:"vertical",WebkitLineClamp:le,overflow:"hidden"},color:"textSecondary",variant:"body2",children:J!=null&&J.fields.text?_jsx(HighlightedSearchResultText,{text:J.fields.text,preTag:J.preTag,postTag:J.postTag}):_.text})}),pe&&_jsx(Box,{alignItems:"flex-end",children:pe})]}):null,ct=_=>_jsx(AnalyticsContext,{attributes:{pluginId:"search",extension:"DefaultResultListItem"},children:_jsx(wt,{..._})}),vn=_=>{const{error:J,loading:te,resultItems:pe,renderResultItem:le=Y=>_jsx(DefaultResultListItem,{result:Y.document},Y.document.location),disableRenderingWithNoResults:y,noResultsComponent:Z=y?null:_jsx(EmptyState,{missing:"data",title:"Sorry, no results were found"}),...q}=_;return te?_jsx(Progress,{}):J?_jsx(ResponseErrorPanel,{title:"Error encountered while fetching search results",error:J}):pe!=null&&pe.length?_jsx(List,{...q,children:pe.map(le)}):_jsx(_Fragment,{children:Z})},Kt=_=>{const{query:J,renderResultItem:te,children:pe,...le}=_,y=useSearchResultListItemExtensions(pe);return _jsx(AnalyticsContext,{attributes:{pluginId:"search",extension:"SearchResultList"},children:_jsx(SearchResultState,{query:J,children:({loading:Z,error:q,value:Y})=>_jsx(vn,{...le,error:q,loading:Z,resultItems:Y==null?void 0:Y.results,renderResultItem:te!=null?te:y})})})};var hn=r(19126);const jn=(0,u.Z)(_=>({listSubheader:{display:"flex",alignItems:"center"},listSubheaderName:{marginLeft:_.spacing(1),textTransform:"uppercase"},listSubheaderChip:{color:_.palette.text.secondary,margin:_.spacing(0,0,0,1.5)},listSubheaderFilter:{display:"flex",color:_.palette.text.secondary,margin:_.spacing(0,0,0,1.5)},listSubheaderLink:{marginLeft:"auto",display:"flex",alignItems:"center"},listSubheaderLinkIcon:{fontSize:"inherit",marginLeft:_.spacing(.5)}})),ln=_=>{const J=jn(),{label:te,children:pe,...le}=_;return _jsx(Chip,{...le,className:J.listSubheaderFilter,variant:"outlined",label:_jsxs(_Fragment,{children:[te,": ",pe]})})},Tn=()=>null,Ce=(0,u.Z)(_=>({root:{fontSize:"inherit","&:focus":{outline:"none",background:_.palette.common.white},"&:not(:focus)":{cursor:"pointer",color:_.palette.primary.main,"&:hover":{textDecoration:"underline"}}}})),ce=_=>{const J=Ce(),{label:te,value:pe="None",onChange:le,onDelete:y}=_,Z=useCallback(q=>{le(q.target.value)},[le]);return _jsx(ln,{label:te,onDelete:y,children:_jsx(Typography,{role:"textbox",component:"span",className:J.root,onChange:Z,contentEditable:!0,suppressContentEditableWarning:!0,children:pe})})},Oe=(0,u.Z)(_=>({root:{fontSize:"inherit","&:not(:focus)":{cursor:"pointer",color:_.palette.primary.main,"&:hover":{textDecoration:"underline"}},"&:focus":{outline:"none"},"&>div:first-child":{padding:0}}})),Me=_=>{const J=Oe(),{label:te,value:pe="none",onChange:le,onDelete:y,children:Z}=_,q=useCallback(Y=>{le(Y.target.value)},[le]);return _jsx(ln,{label:te,onDelete:y,children:_jsxs(Select,{className:J.root,value:pe,onChange:q,input:_jsx(InputBase,{}),IconComponent:Tn,children:[_jsx(MenuItem,{value:"none",children:"None"}),Z]})})};function Xe(_){const J=jn(),[te,pe]=useState(null),{error:le,loading:y,icon:Z,title:q,titleProps:Y={},link:we=_jsxs(_Fragment,{children:["See all",_jsx(ArrowRightIcon,{className:J.listSubheaderLinkIcon})]}),linkProps:Ae={},filterOptions:Ye,renderFilterOption:jt=zt=>_jsx(MenuItem,{value:String(zt),children:zt},String(zt)),filterFields:vt,renderFilterField:nt,resultItems:Ke,renderResultItem:dt=zt=>_jsx(DefaultResultListItem,{result:zt.document},zt.document.location),disableRenderingWithNoResults:at,noResultsComponent:Dt=at?null:_jsx(EmptyState,{missing:"data",title:"Sorry, no results were found"}),...Mt}=_,Xt=useCallback(zt=>{pe(zt.currentTarget)},[]),en=useCallback(()=>{pe(null)},[]);if(y)return _jsx(Progress,{});if(le)return _jsx(ResponseErrorPanel,{title:"Error encountered while fetching search results",error:le});if(!(Ke!=null&&Ke.length))return _jsx(_Fragment,{children:Dt});var Ut;return _jsxs(List,{...Mt,children:[_jsxs(ListSubheader,{className:J.listSubheader,children:[Z,_jsx(Typography,{className:J.listSubheaderName,component:"strong",...Y,children:q}),Ye?_jsx(Chip,{className:J.listSubheaderChip,component:"button",icon:_jsx(AddIcon,{}),variant:"outlined",label:"Add filter","aria-controls":"filters-menu","aria-haspopup":"true",onClick:Xt}):null,Ye?_jsx(Menu,{id:"filters-menu",anchorEl:te,open:Boolean(te),onClose:en,onClick:en,keepMounted:!0,children:Ye.map(jt)}):null,vt==null?void 0:vt.map(zt=>(Ut=nt==null?void 0:nt(zt))!==null&&Ut!==void 0?Ut:null),_jsx(Link,{className:J.listSubheaderLink,to:"/search",...Ae,children:we})]}),Ke.map(dt)]})}function se(_){const{query:J,children:te,renderResultItem:pe,linkProps:le={},...y}=_,Z=useSearchResultListItemExtensions(te);return _jsx(AnalyticsContext,{attributes:{pluginId:"search",extension:"SearchResultGroup"},children:_jsx(SearchResultState,{query:J,children:({loading:q,error:Y,value:we},{term:Ae,types:Ye,pageCursor:jt,filters:vt={}})=>{const nt=`/search?${qs.stringify({term:Ae,types:Ye,filters:vt,pageCursor:jt,query:Ae},{arrayFormat:"brackets"})}`;return _jsx(Xe,{...y,error:Y,loading:q,linkProps:{to:nt,...le},filterFields:Object.keys(vt),resultItems:we==null?void 0:we.results,renderResultItem:pe!=null?pe:Z})}})})}const D=(0,u.Z)(_=>({root:{display:"flex",justifyContent:"space-between",gap:_.spacing(2),margin:_.spacing(2,0)}})),me=()=>{const{fetchNextPage:_,fetchPreviousPage:J}=useSearch(),te=D();return!_&&!J?_jsx(_Fragment,{}):_jsxs("nav",{"aria-label":"pagination navigation",className:te.root,children:[_jsx(Button,{"aria-label":"previous page",disabled:!J,onClick:J,startIcon:_jsx(ArrowBackIosIcon,{}),children:"Previous"}),_jsx(Button,{"aria-label":"next page",disabled:!_,onClick:_,endIcon:_jsx(ArrowForwardIosIcon,{}),children:"Next"})]})},De="search.results.list.items.extensions.v1",et=(_,J)=>{for(const te of _){if(!isValidElement(te))continue;const pe=getComponentData(te,De);if(pe!=null&&pe(J))return cloneElement(te,{rank:J.rank,highlight:J.highlight,result:J.document,...te.props})}return null},it=_=>{const{rank:J,result:te,noTrack:pe,children:le,alignItems:y="flex-start",...Z}=_,q=(0,t.z$)(),Y=(0,W.useCallback)(()=>{pe||te&&q.captureEvent("discover",te.title,{attributes:{to:te.location},value:J})},[J,te,pe,q]);return(0,f.jsx)(g.Z,{divider:!0,alignItems:y,onClickCapture:Y,...Z,children:le})},kt=_=>{const{name:J,component:te,predicate:pe=()=>!0}=_;return(0,t.YO)({name:J,component:{lazy:()=>te().then(le=>y=>(0,f.jsx)(it,{rank:y.rank,result:y.result,noTrack:y.noTrack,children:(0,W.createElement)(le,y)}))},data:{[De]:pe}})},Ft=_=>{const J=useElementFilter(_,te=>te.selectByComponentData({key:De}).getElements(),[_]);return useCallback((te,pe)=>{const le=et(J,te);return _jsx(Fragment,{children:le!=null?le:_jsx(it,{rank:te.rank,result:te.document,children:_jsx(DefaultResultListItem,{rank:te.rank,highlight:te.highlight,result:te.document})})},pe)},[J])},Qt=_=>{const{results:J,children:te,...pe}=_,le=Ft(te);return _jsx(List,{...pe,children:J.map(le)})}},61886:function(Ct,$e,r){"use strict";r.d($e,{Ox:function(){return Qe},jM:function(){return W},Zz:function(){return g},oZ:function(){return z},DR:function(){return u},ZS:function(){return Le},VA:function(){return xt},KY:function(){return ve},gT:function(){return w},Dl:function(){return ie},ux:function(){return It},$L:function(){return I},x1:function(){return ze}});var t=r(52322),h=r(2784),H=r(73557),f=r(60871);const W="techdocs.addons.addon.v1",g="techdocs.addons.wrapper.v1",u=()=>null;(0,f.R5)(u,g,!0);const B=ge=>`${W}.${ge.toLocaleLowerCase("en-US")}`;function ve(ge){const{name:Se,component:Fe}=ge;return(0,f.YO)({name:Se,component:{sync:tt=>(0,t.jsx)(Fe,{...tt})},data:{[W]:ge,[B(Se)]:!0}})}const ue=(ge,Se)=>ge.selectByComponentData({key:Se}).getElements()[0],V=ge=>ge.selectByComponentData({key:g}).selectByComponentData({key:W}),K=ge=>ge.selectByComponentData({key:g}).findComponentData({key:W}),I=()=>{const ge=(0,H.pC)(),Se=(0,f.vJ)(ge,V),Fe=(0,f.vJ)(ge,K),tt=(0,h.useCallback)(pt=>{if(!Se||!pt)return null;const Ot=B(pt.name);var Ht;return(Ht=ue(Se,Ot))!==null&&Ht!==void 0?Ht:null},[Se]),mt=(0,h.useCallback)(pt=>{const Ot=Fe.find(Ht=>Ht.name===pt);return Ot?tt(Ot):null},[Fe,tt]),bt=(0,h.useCallback)(pt=>{const Ot=Fe.filter(Ht=>Ht.location===pt);return Ot.length?Ot.map(tt):null},[Fe,tt]);return{renderComponentByName:mt,renderComponentsByLocation:bt}},w=(0,f.T0)({id:"plugin.techdocs.service"}),ie=(0,f.T0)({id:"plugin.techdocs.storageservice"});var ee=r(64279),ne=r(77446),$=r(25271),T=r(51837);function P(ge,Se){return Se.getOptionalBoolean("techdocs.legacyUseCaseSensitiveTripletPaths")||(ge.kind=ge.kind.toLocaleLowerCase(),ge.name=ge.name.toLocaleLowerCase(),ge.namespace=ge.namespace.toLocaleLowerCase()),ge}const L=(ge,Se)=>(0,$.eE)(ge)===(0,$.eE)(Se),O={title:"",subtitle:"",setTitle:()=>{},setSubtitle:()=>{},setShadowRoot:()=>{},metadata:{loading:!0},entityMetadata:{loading:!0},entityRef:{kind:"",name:"",namespace:""}},oe=(0,T.CT)("techdocs-reader-page-context"),Le=(0,h.memo)(ge=>{const{entityRef:Se,children:Fe}=ge,tt=(0,f.h_)(w),mt=(0,f.h_)(f.Ds),bt=(0,ee.default)(async()=>tt.getEntityMetadata(Se),[Se]),pt=(0,ne.Z)(async()=>tt.getTechDocsMetadata(Se),[Se]),[Ot,Ht]=(0,h.useState)(O.title),[Jt,Bt]=(0,h.useState)(O.subtitle),[un,Yt]=(0,h.useState)(O.shadowRoot);(0,h.useEffect)(()=>{un&&!pt.value&&!pt.loading&&pt.retry()},[pt.value,pt.loading,un,pt.retry,pt]);const pn={metadata:pt,entityRef:P(Se,mt),entityMetadata:bt,shadowRoot:un,setShadowRoot:Yt,title:Ot,setTitle:Ht,subtitle:Jt,setSubtitle:Bt},Fn=(0,T.EI)({1:pn});return(0,t.jsx)(f.fC,{attributes:{entityRef:(0,$.eE)(Se)},children:(0,t.jsx)(oe.Provider,{value:Fn,children:Fe instanceof Function?Fe(pn):Fe})})},(ge,Se)=>L(ge.entityRef,Se.entityRef)),ze=()=>{const ge=(0,h.useContext)(oe);if(ge===void 0)return O;const Se=ge.atVersion(1);if(Se===void 0)throw new Error("No context found for version 1.");return Se},z=Object.freeze({Header:"Header",Subheader:"Subheader",Settings:"Settings",PrimarySidebar:"PrimarySidebar",SecondarySidebar:"SecondarySidebar",Content:"Content"});var yt=r(70882),ot=r(50236),He=r(19219),st=r(53974);const Qe="TECH_DOCS_SHADOW_DOM_STYLE_LOAD",St=ge=>{(0,h.useEffect)(()=>{if(!ge)return()=>{};const Se=ge.querySelectorAll('head > link[rel="stylesheet"]');var Fe;let tt=(Fe=Se==null?void 0:Se.length)!==null&&Fe!==void 0?Fe:0;const mt=new CustomEvent(Qe);if(!tt)return ge.dispatchEvent(mt),()=>{};const bt=()=>{--tt===0&&ge.dispatchEvent(mt)};return Se==null||Se.forEach(pt=>{pt.addEventListener("load",bt)}),()=>{Se==null||Se.forEach(pt=>{pt.removeEventListener("load",bt)})}},[ge])},It=ge=>{const[Se,Fe]=(0,h.useState)(!1);return(0,h.useEffect)(()=>{if(!ge)return()=>{};Fe(!0);const tt=ge.style;tt.setProperty("opacity","0");const mt=()=>{Fe(!1),tt.setProperty("opacity","1")};return ge.addEventListener(Qe,mt),()=>{ge.removeEventListener(Qe,mt)}},[ge]),Se},xt=ge=>{const{element:Se,onAppend:Fe,children:tt}=ge,[mt,bt]=(0,h.useState)((0,yt.Ue)({...(0,ot.Z)(),insertionPoint:void 0}));St(Se);const pt=It(Se),Ot=(0,h.useCallback)(Ht=>{if(!Se||!Ht)return;bt((0,yt.Ue)({...(0,ot.Z)(),insertionPoint:Se.querySelector("head")||void 0}));let Jt=Ht.shadowRoot;Jt||(Jt=Ht.attachShadow({mode:"open"})),Jt.replaceChildren(Se),typeof Fe=="function"&&Fe(Jt)},[Se,Fe]);return(0,t.jsxs)(t.Fragment,{children:[pt&&(0,t.jsx)(st.Ex,{}),(0,t.jsxs)(He.ZP,{jss:mt,sheetsManager:new Map,children:[(0,t.jsx)("div",{ref:Ot,"data-testid":"techdocs-native-shadowroot"}),tt]})]})};var lt=r(54073);const Pt=()=>{const{shadowRoot:ge}=useTechDocsReaderPage();return ge},Nt=ge=>{const Se=Pt();return Se?ge.map(Fe=>Se==null?void 0:Se.querySelectorAll(Fe)).filter(Fe=>Fe.length).map(Fe=>Array.from(Fe)).flat():[]},We=ge=>ge.toString()&&ge.rangeCount&&ge.getRangeAt(0).getBoundingClientRect().top,_t=(ge=0)=>{const Se=Pt(),[Fe,tt]=useState(null),mt=useMemo(()=>debounce(()=>{const bt=Se,pt=bt.getSelection?bt.getSelection():document.getSelection();pt&&We(pt)?tt(pt):tt(null)},ge),[Se,tt,ge]);return useEffect(()=>(window.document.addEventListener("selectionchange",mt),()=>{mt.cancel(),window.document.removeEventListener("selectionchange",mt)}),[mt]),Fe}},52943:function(Ct,$e,r){"use strict";r.r($e),r.d($e,{EmbeddedDocsRouter:function(){return ee},Router:function(){return ie},isTechDocsAvailable:function(){return w}});var t=r(52322),h=r(2784),H=r(73557),f=r(43514),W=r(53974),g=r(25271),u=r(89258),B=r(65124),ve=r(86317);const ue=({entity:ne})=>{const $=(0,g.iB)(ne);return(0,t.jsxs)(u.I6,{entityRef:$,children:[(0,t.jsx)(B.b,{}),(0,t.jsx)(ve.F,{withSearch:!1})]})};var V=r(18662),K=r(7476);const I="backstage.io/techdocs-ref",w=ne=>{var $,T;return Boolean(ne==null||($=ne.metadata)===null||$===void 0||(T=$.annotations)===null||T===void 0?void 0:T[I])},ie=()=>(0,t.jsxs)(H.Z5,{children:[(0,t.jsx)(H.AW,{path:"/",element:(0,t.jsx)(V.TechDocsIndexPage,{})}),(0,t.jsx)(H.AW,{path:"/:namespace/:kind/:name/*",element:(0,t.jsx)(K.TechDocsReaderPage,{})})]}),ee=ne=>{var $;const{children:T}=ne,{entity:P}=(0,f.X2)(),L=(0,H.V$)([{path:"/*",element:(0,t.jsx)(ue,{entity:P}),children:[{path:"*",element:T}]}]);return(($=P.metadata.annotations)===null||$===void 0?void 0:$[I])?L:(0,t.jsx)(W.sk,{annotation:I})}},92077:function(Ct,$e,r){"use strict";r.d($e,{k:function(){return g},p:function(){return W}});var t=r(87612),h=r(23054),H=r(76372),f=r.n(H);class W{async getApiOrigin(){return await this.discoveryApi.getBaseUrl("techdocs")}async getTechDocsMetadata(B){const{kind:ve,namespace:ue,name:V}=B,I=`${await this.getApiOrigin()}/metadata/techdocs/${ue}/${ve}/${V}`,w=await this.fetchApi.fetch(`${I}`);if(!w.ok)throw await h.VL.fromResponse(w);return await w.json()}async getEntityMetadata(B){const{kind:ve,namespace:ue,name:V}=B,I=`${await this.getApiOrigin()}/metadata/entity/${ue}/${ve}/${V}`,w=await this.fetchApi.fetch(`${I}`);if(!w.ok)throw await h.VL.fromResponse(w);return await w.json()}constructor(B){(0,t._)(this,"configApi",void 0),(0,t._)(this,"discoveryApi",void 0),(0,t._)(this,"fetchApi",void 0),this.configApi=B.configApi,this.discoveryApi=B.discoveryApi,this.fetchApi=B.fetchApi}}class g{async getApiOrigin(){return await this.discoveryApi.getBaseUrl("techdocs")}async getStorageUrl(){var B;return(B=this.configApi.getOptionalString("techdocs.storageUrl"))!==null&&B!==void 0?B:`${await this.discoveryApi.getBaseUrl("techdocs")}/static/docs`}async getBuilder(){return this.configApi.getString("techdocs.builder")}async getEntityDocs(B,ve){const{kind:ue,namespace:V,name:K}=B,w=`${await this.getStorageUrl()}/${V}/${ue}/${K}/${ve}`,ie=await this.fetchApi.fetch(`${w.endsWith("/")?w:`${w}/`}index.html`);let ee="";switch(ie.status){case 404:throw ee="Page not found. ",ve||(ee+="This could be because there is no index.md file in the root of the docs directory of this repository."),new h.dR(ee);case 500:throw ee="Could not generate documentation or an error in the TechDocs backend. ",new Error(ee);default:break}return ie.text()}async syncEntityDocs(B,ve=()=>{}){const{kind:ue,namespace:V,name:K}=B,w=`${await this.getApiOrigin()}/sync/${V}/${ue}/${K}`,{token:ie}=await this.identityApi.getCredentials();return new Promise((ee,ne)=>{const $=new H.EventSourcePolyfill(w,{withCredentials:!0,headers:ie?{Authorization:`Bearer ${ie}`}:{}});$.addEventListener("log",T=>{T.data&&ve(JSON.parse(T.data))}),$.addEventListener("finish",T=>{let P=!1;T.data&&({updated:P}=JSON.parse(T.data)),ee(P?"updated":"cached")}),$.onerror=T=>{switch($.close(),T.status){case 404:ne(new h.dR(T.message));return;default:ne(new Error(T.data));return}}})}async getBaseUrl(B,ve,ue){const{kind:V,namespace:K,name:I}=ve,ie=`${await this.getApiOrigin()}/static/docs/${K}/${V}/${I}/${ue}`;return new URL(B,ie.endsWith("/")?ie:`${ie}/`).toString()}constructor(B){(0,t._)(this,"configApi",void 0),(0,t._)(this,"discoveryApi",void 0),(0,t._)(this,"identityApi",void 0),(0,t._)(this,"fetchApi",void 0),this.configApi=B.configApi,this.discoveryApi=B.discoveryApi,this.identityApi=B.identityApi,this.fetchApi=B.fetchApi}}},51953:function(Ct,$e,r){"use strict";r.d($e,{D:function(){return t}});function t(h,H){return H.getOptionalBoolean("techdocs.legacyUseCaseSensitiveTripletPaths")?h:h.toLocaleLowerCase("en-US")}},3482:function(Ct,$e,r){"use strict";r.d($e,{u:function(){return B}});var t=r(52322),h=r(2784),H=r(53974),f=r(43514),W=r(42081),g=r(48431),u=r(68435);const B=ve=>{const{initialFilter:ue="owned",columns:V,actions:K}=ve;return(0,t.jsx)(W.j,{children:(0,t.jsxs)(H.VY,{children:[(0,t.jsx)(H.yW,{title:"",children:(0,t.jsx)(H.qt,{children:"Discover documentation in your ecosystem."})}),(0,t.jsx)(f.UO,{children:(0,t.jsxs)(f._i,{children:[(0,t.jsxs)(f._i.Filters,{children:[(0,t.jsx)(g.f,{}),(0,t.jsx)(f.EW,{initialFilter:ue}),(0,t.jsx)(f.dq,{}),(0,t.jsx)(f.xE,{})]}),(0,t.jsx)(f._i.Content,{children:(0,t.jsx)(u.n,{actions:K,columns:V})})]})})]})})}},85478:function(Ct,$e,r){"use strict";r.d($e,{f:function(){return V}});var t=r(52322),h=r(95573),H=r(51953),f=r(60871),W=r(53974),g=r(94339),u=r(16111),B=r(24579),ve=r(14503),ue=r(2784);const V=ee=>{const{entities:ne}=ee,$=(0,f.tg)(h.Fw),T=(0,f.h_)(f.Ds);if(!ne)return null;var P,L;return(0,t.jsx)(W.Oh,{"data-testid":"docs-explore",children:ne!=null&&ne.length?ne.map((O,oe)=>(0,t.jsxs)(g.Z,{children:[(0,t.jsx)(u.Z,{children:(0,t.jsx)(W.hu,{title:(P=O.metadata.title)!==null&&P!==void 0?P:O.metadata.name})}),(0,t.jsx)(B.Z,{children:O.metadata.description}),(0,t.jsx)(ve.Z,{children:(0,t.jsx)(W.Qj,{to:$({namespace:(0,H.D)((L=O.metadata.namespace)!==null&&L!==void 0?L:"default",T),kind:(0,H.D)(O.kind,T),name:(0,H.D)(O.metadata.name,T)}),color:"primary","data-testid":"read_docs",children:"Read Docs"})})]},oe)):null})};var K=r(43514);const I={title:"All Documentation",filterPredicate:()=>!0},w=ee=>{const{entities:ne,group:$}=ee,{loading:T,isOwnedEntity:P}=useEntityOwnership(),L=ne.filter(oe=>$.filterPredicate==="ownedByUser"?T?!1:P(oe):typeof $.filterPredicate=="function"&&$.filterPredicate(oe)),O=(()=>typeof $.title=="string"?_jsx(ContentHeader,{title:$.title}):$.title)();return L.length===0?null:_jsxs(Content,{children:[O,_jsx(DocsCardGrid,{entities:L})]})},ie=ee=>{const{loading:ne,error:$,entities:T}=useEntityList();if($)return _jsx(WarningPanel,{severity:"error",title:"Could not load available documentation.",children:_jsx(CodeSnippet,{language:"text",text:$.toString()})});if(ne)return _jsx(Progress,{});if(T.length===0)return _jsx("div",{"data-testid":"doc-not-found",children:_jsxs(Typography,{variant:"body2",children:["No documentation found that match your filter. Learn more about"," ",_jsx(Link,{to:"https://backstage.io/docs/features/techdocs/creating-and-publishing",children:"publishing documentation"}),"."]})});var P,L;return T.sort((O,oe)=>((P=O.metadata.title)!==null&&P!==void 0?P:O.metadata.name).localeCompare((L=oe.metadata.title)!==null&&L!==void 0?L:oe.metadata.name)),_jsx(Content,{children:(ee.groups||[I]).map((O,oe)=>_jsx(w,{entities:T,group:O},`${O.title}-${oe}`))})}},68435:function(Ct,$e,r){"use strict";r.d($e,{H:function(){return T},n:function(){return P}});var t=r(52322),h=r(2784),H=r(95074),f=r(76635),W=r(53974),g=r(43514),u=r(60871),B=r(25271),ve=r(95573),ue=r(39981),V=r(2337),K=r(11640),I=r(28347);const w=(0,V.Z)({root:{color:"#f3ba37"}})(K.Z),ie={createCopyDocsUrlAction(L){return O=>({icon:()=>(0,t.jsx)(ue.Z,{fontSize:"small"}),tooltip:"Click to copy documentation link to clipboard",onClick:()=>L(`${window.location.origin}${O.resolved.docsUrl}`)})},createStarEntityAction(L,O){return oe=>{const Le=oe.entity,ze=L(Le);return{cellStyle:{paddingLeft:"1em"},icon:()=>ze?(0,t.jsx)(w,{}):(0,t.jsx)(I.Z,{}),tooltip:ze?"Remove from favorites":"Add to favorites",onClick:()=>O(Le)}}}};function ee(L){return L.metadata.title||L.metadata.name}const ne={createNameColumn(){return{title:"Document",field:"entity.metadata.name",highlight:!0,render:L=>(0,t.jsx)(W.uw,{value:(0,t.jsx)(W.rU,{to:L.resolved.docsUrl,children:ee(L.entity)}),subvalue:L.entity.metadata.description})}},createOwnerColumn(){return{title:"Owner",field:"resolved.ownedByRelationsTitle",render:({resolved:L})=>(0,t.jsx)(g.rI,{entityRefs:L.ownedByRelations,defaultKind:"group"})}},createTypeColumn(){return{title:"Type",field:"entity.spec.type"}}};var $=r(51953);const T=L=>{const{entities:O,title:oe,loading:Le,columns:ze,actions:z,options:yt}=L,[,ot]=(0,H.Z)(),He=(0,u.tg)(ve.Fw),st=(0,u.h_)(u.Ds);if(!O)return null;const Qe=O.map(xt=>{const lt=(0,g.hF)(xt,B.S4);var Pt;return{entity:xt,resolved:{docsUrl:He({namespace:(0,$.D)((Pt=xt.metadata.namespace)!==null&&Pt!==void 0?Pt:"default",st),kind:(0,$.D)(xt.kind,st),name:(0,$.D)(xt.metadata.name,st)}),ownedByRelations:lt,ownedByRelationsTitle:lt.map(Nt=>(0,g.$3)(Nt,{defaultKind:"group"})).join(", ")}}}),St=[ne.createNameColumn(),ne.createOwnerColumn(),ne.createTypeColumn()],It=[ie.createCopyDocsUrlAction(ot)];return(0,t.jsx)(t.Fragment,{children:Le||Qe&&Qe.length>0?(0,t.jsx)(W.iA,{isLoading:Le,options:{paging:!0,pageSize:20,search:!0,actionsColumnIndex:-1,...yt},data:Qe,columns:ze||St,actions:z||It,title:oe?`${oe} (${Qe.length})`:`All (${Qe.length})`}):(0,t.jsx)(W.ub,{missing:"data",title:"No documents to show",description:"Create your own document. Check out our Getting Started Information",action:(0,t.jsx)(W.Qj,{color:"primary",to:"https://backstage.io/docs/features/techdocs/getting-started",variant:"contained",children:"DOCS"})})})};T.columns=ne,T.actions=ie;const P=L=>{var O;const{columns:oe,actions:Le,options:ze}=L,{loading:z,error:yt,entities:ot,filters:He}=(0,g.wp)(),{isStarredEntity:st,toggleStarredEntity:Qe}=(0,g.CR)(),[,St]=(0,H.Z)();var It;const xt=(0,f.capitalize)((It=(O=He.user)===null||O===void 0?void 0:O.value)!==null&&It!==void 0?It:"all"),lt=[ie.createCopyDocsUrlAction(St),ie.createStarEntityAction(st,Qe)];return yt?(0,t.jsx)(W.GB,{severity:"error",title:"Could not load available documentation.",children:(0,t.jsx)(W.Oi,{language:"text",text:yt.toString()})}):(0,t.jsx)(T,{title:xt,entities:ot,loading:z,actions:Le||lt,columns:oe,options:ze})};P.columns=ne,P.actions=ie},18662:function(Ct,$e,r){"use strict";r.r($e),r.d($e,{TechDocsIndexPage:function(){return W}});var t=r(52322),h=r(2784),H=r(73557),f=r(3482);const W=g=>(0,H.pC)()||(0,t.jsx)(f.u,{...g})},42081:function(Ct,$e,r){"use strict";r.d($e,{j:function(){return W}});var t=r(52322),h=r(2784),H=r(53974),f=r(60871);const W=g=>{const{children:u}=g,B=(0,f.h_)(f.Ds);var ve;const ue=`Documentation available in ${(ve=B.getOptionalString("organization.name"))!==null&&ve!==void 0?ve:"Backstage"}`;return(0,t.jsx)(H.g9,{title:"Documentation",subtitle:ue,themeId:"documentation",children:u})}},48431:function(Ct,$e,r){"use strict";r.d($e,{f:function(){return f}});var t=r(2784),h=r(43514);class H{getCatalogFilters(){return{"metadata.annotations.backstage.io/techdocs-ref":h.n3}}}const f=()=>{const{updateFilters:W}=(0,h.wp)();return(0,t.useEffect)(()=>{W({techdocs:new H})},[W]),null}},89258:function(Ct,$e,r){"use strict";r.d($e,{I6:function(){return V},Jl:function(){return ue},s4:function(){return g}});var t=r(61886),h=r(92077),H=r(95573),f=r(60871),W=r(15096);const g=(0,f.rx)({id:"techdocs",apis:[(0,f.ni)({api:t.Dl,deps:{configApi:f.Ds,discoveryApi:f.NW,identityApi:f.$4,fetchApi:f.gP},factory:({configApi:I,discoveryApi:w,identityApi:ie,fetchApi:ee})=>new h.k({configApi:I,discoveryApi:w,identityApi:ie,fetchApi:ee})}),(0,f.ni)({api:t.gT,deps:{configApi:f.Ds,discoveryApi:f.NW,fetchApi:f.gP},factory:({configApi:I,discoveryApi:w,fetchApi:ie})=>new h.p({configApi:I,discoveryApi:w,fetchApi:ie})})],routes:{root:H._Z,docRoot:H.Fw,entityContent:H.pd}}),u=g.provide((0,f.P4)({name:"TechdocsPage",component:()=>Promise.resolve().then(r.bind(r,52943)).then(I=>I.Router),mountPoint:H._Z})),B=g.provide((0,f.P4)({name:"EntityTechdocsContent",component:()=>Promise.resolve().then(r.bind(r,52943)).then(I=>I.EmbeddedDocsRouter),mountPoint:H.pd})),ve=g.provide((0,f.P4)({name:"TechDocsCustomHome",component:()=>r.e(7560).then(r.bind(r,27560)).then(I=>I.TechDocsCustomHome),mountPoint:H._Z})),ue=g.provide((0,f.P4)({name:"TechDocsIndexPage",component:()=>Promise.resolve().then(r.bind(r,18662)).then(I=>I.TechDocsIndexPage),mountPoint:H._Z})),V=g.provide((0,f.P4)({name:"TechDocsReaderPage",component:()=>Promise.resolve().then(r.bind(r,7476)).then(I=>I.TechDocsReaderPage),mountPoint:H.Fw})),K=g.provide((0,W.E5)({name:"TechDocsSearchResultListItem",component:()=>Promise.resolve().then(r.bind(r,55511)).then(I=>I.TechDocsSearchResultListItem),predicate:I=>I.type==="techdocs"}))},7476:function(Ct,$e,r){"use strict";r.r($e),r.d($e,{TechDocsReaderLayout:function(){return V},TechDocsReaderPage:function(){return K}});var t=r(52322),h=r(2784),H=r(73557),f=r(53974),W=r(61886),g=r(86317),u=r(93225),B=r(65124),ve=r(95573),ue=r(60871);const V=I=>{const{withSearch:w,withHeader:ie=!0}=I;return(0,t.jsxs)(f.T3,{themeId:"documentation",children:[ie&&(0,t.jsx)(u.S,{}),(0,t.jsx)(B.b,{}),(0,t.jsx)(g.F,{withSearch:w})]})},K=I=>{const{kind:w,name:ie,namespace:ee}=(0,ue.Oi)(ve.Fw),{children:ne,entityRef:$={kind:w,name:ie,namespace:ee}}=I,T=(0,H.pC)();if(!ne){const L=T?h.Children.toArray(T.props.children):[];var P;const oe=L.flatMap(Le=>{var ze;return(P=Le==null||(ze=Le.props)===null||ze===void 0?void 0:ze.children)!==null&&P!==void 0?P:[]}).find(Le=>!(0,ue.IY)(Le,W.Zz)&&!(0,ue.IY)(Le,W.jM));return(0,t.jsx)(W.ZS,{entityRef:$,children:oe||(0,t.jsx)(V,{})})}return(0,t.jsx)(W.ZS,{entityRef:$,children:({metadata:L,entityMetadata:O,onReady:oe})=>(0,t.jsx)("div",{className:"techdocs-reader-page",children:(0,t.jsx)(f.T3,{themeId:"documentation",children:ne instanceof Function?ne({entityRef:$,techdocsMetadataValue:L.value,entityMetadataValue:O.value,onReady:oe}):ne})})})}},86317:function(Ct,$e,r){"use strict";r.d($e,{F:function(){return pe}});var t=r(52322),h=r(2784),H=r(79692),f=r(60905),W=r(61886),g=r(53974),u=r(22478),B=r(4614),ve=r(77277),ue=r(99688),V=r(12420),K=r(90436),I=r(61837),w=r(4190),ie=r(87685);const ee=(0,H.Z)(y=>(0,V.Z)({paper:{width:"100%",[y.breakpoints.up("sm")]:{width:"75%"},[y.breakpoints.up("md")]:{width:"50%"},padding:y.spacing(2.5)},root:{height:"100%",overflow:"hidden"},logs:{background:y.palette.background.default}})),ne=({buildLog:y,onClose:Z})=>{const q=ee(),Y=y.length===0?"Waiting for logs...":y.join(`
|
|
@@ -505,4 +505,4 @@ ${Y.href}
|
|
|
505
505
|
|
|
506
506
|
Feedback:`),nt=(Ae==null?void 0:Ae.type)==="github"?(0,Pn.BT)(we.href,"blob"):we.href,Ke=tn()(nt),dt=`/${Ke.organization}/${Ke.name}`,at=Y.cloneNode();switch(Ae==null?void 0:Ae.type){case"gitlab":at.href=`${we.origin}${dt}/issues/new?issue[title]=${jt}&issue[description]=${vt}`;break;case"github":at.href=`${we.origin}${dt}/issues/new?title=${jt}&body=${vt}`;break;default:return Z}return Ln.render(h.createElement(fn.Z),at),at.style.paddingLeft="5px",at.title="Leave feedback for this page",at.id="git-feedback-link",Y==null||Y.insertAdjacentElement("beforebegin",at),Z};var Mn=r(44882);const ut=()=>y=>{const Z=y.querySelector('.md-header label[for="__drawer"]'),q=y.querySelector("article");if(!Z||!q)return y;const Y=Z.cloneNode();return Ln.render(h.createElement(Mn.Z),Y),Y.id="toggle-sidebar",Y.title="Toggle Sidebar",Y.classList.add("md-content__button"),Y.style.setProperty("padding","0 0 0 5px"),Y.style.setProperty("margin","0.4rem 0 0.4rem 0.4rem"),q==null||q.prepend(Y),y},_n=()=>y=>(((q,Y)=>{Array.from(q).filter(we=>we.hasAttribute(Y)).forEach(we=>{const Ae=we.getAttribute(Y);if(Ae){Ae.match(/^https?:\/\//i)&&we.setAttribute("target","_blank");try{const Ye=wt(window.location.href);we.setAttribute(Y,new URL(Ae,Ye).toString())}catch{we.replaceWith(we.textContent||Ae)}}})})(Array.from(y.getElementsByTagName("a")),"href"),y);function wt(y){const Z=new URL(y);return!Z.pathname.endsWith("/")&&!Z.pathname.endsWith(".html")&&(Z.pathname+="/"),Z.toString()}const ct=({baseUrl:y,onClick:Z})=>q=>(Array.from(q.getElementsByTagName("a")).forEach(Y=>{Y.addEventListener("click",we=>{const Ye=Y.getAttribute("href");Ye&&Ye.startsWith(y)&&!Y.hasAttribute("download")&&(we.preventDefault(),Z(we,Ye))})}),q);var vn=r(15459),Kt=r(80030),hn=r(72379),jn=r(41547),ln=r(95074);const Tn=(0,vn.Z)(y=>({tooltip:{fontSize:"inherit",color:y.palette.text.primary,margin:0,padding:y.spacing(.5),backgroundColor:"transparent",boxShadow:"none"}}))(Kt.ZP),Ce=()=>(0,t.jsx)(hn.Z,{children:(0,t.jsx)("path",{d:"M16 1H4c-1.1 0-2 .9-2 2v14h2V3h12V1zm3 4H8c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h11c1.1 0 2-.9 2-2V7c0-1.1-.9-2-2-2zm0 16H8V7h11v14z"})}),ce=({text:y})=>{const[Z,q]=(0,h.useState)(!1),[,Y]=(0,ln.Z)(),we=(0,h.useCallback)(()=>{Y(y),q(!0)},[y,Y]),Ae=(0,h.useCallback)(()=>{q(!1)},[q]);return(0,t.jsx)(Tn,{title:"Copied to clipboard",placement:"left",open:Z,onClose:Ae,leaveDelay:1e3,children:(0,t.jsx)(I.Z,{style:{color:"inherit"},className:"md-clipboard md-icon",onClick:we,children:(0,t.jsx)(Ce,{})})})},Oe=y=>Z=>{const q=Z.querySelectorAll("pre > code");for(const we of q){var Y;const Ae=we.textContent||"",Ye=document.createElement("div");we==null||(Y=we.parentElement)===null||Y===void 0||Y.prepend(Ye),Ln.render((0,t.jsx)(jn.Z,{theme:y,children:(0,t.jsx)(ce,{text:Ae})}),Ye)}return Z},Me=()=>y=>{var Z;return(Z=y.querySelector(".md-header"))===null||Z===void 0||Z.remove(),y},Xe=()=>y=>{var Z,q;return(Z=y.querySelector(".md-footer .md-copyright"))===null||Z===void 0||Z.remove(),(q=y.querySelector(".md-footer-copyright"))===null||q===void 0||q.remove(),y},se=({onLoading:y,onLoaded:Z})=>q=>(y(),q.addEventListener(W.Ox,function Y(){Z(),q.removeEventListener(W.Ox,Y)}),q),D=()=>y=>(y.addEventListener(W.Ox,function Z(){if(window.location.hash){var q;const Y=window.location.hash.slice(1);(q=y==null?void 0:y.querySelector(`[id="${Y}"]`))===null||q===void 0||q.scrollIntoView()}y.removeEventListener(W.Ox,Z)}),y),me=()=>y=>(setTimeout(()=>{const Z=y==null?void 0:y.querySelectorAll("li.md-nav__item--active");Z.length!==0&&(Z.forEach(Y=>{const we=Y==null?void 0:Y.querySelector("input");we!=null&&we.checked||we==null||we.click()}),Z[Z.length-1].scrollIntoView())},200),y),De=async(y,Z)=>{let q;if(typeof y=="string")q=new DOMParser().parseFromString(y,"text/html").documentElement;else if(y instanceof Element)q=y;else throw new Error("dom is not a recognized type");for(const Y of Z)q=await Y(q);return q};var et=r(73557);function it(y,Z){const q=new URL(Z),Y=`${q.origin}${q.pathname.replace(/\/$/,"")}`,we=y.replace(Y,"").replace(/^\/+/,""),Ae=new URL(`http://localhost/${we}`);return`${Ae.pathname}${Ae.search}${Ae.hash}`}function kt(){const y=(0,et.s0)(),q=(0,T.h_)(T.Ds).getOptionalString("app.baseUrl");return(0,h.useCallback)(we=>{let Ae=we;if(q)try{Ae=it(we,q)}catch{}y(Ae)},[y,q])}const Ft="screen and (max-width: 76.1875em)",Qt=y=>{const Z=kt(),q=(0,Le.Z)(),Y=(0,ze.Z)(Ft),we=_t(),Ae=Yt(),Ye=(0,T.z$)(),jt=(0,T.h_)(W.Dl),vt=(0,T.h_)(z.q3),{state:nt,path:Ke,content:dt}=(0,L.DK)(),[at,Dt]=(0,h.useState)(null),Mt=(0,W.ux)(at),Xt=(0,h.useCallback)(()=>{if(!at)return;at.querySelectorAll(".md-sidebar").forEach(Lt=>{if(Y)Lt.style.top="0px";else{const Gn=document==null?void 0:document.querySelector(".techdocs-reader-page");var Zt;const ur=(Zt=Gn==null?void 0:Gn.getBoundingClientRect().top)!==null&&Zt!==void 0?Zt:0;var bn;let En=(bn=at.getBoundingClientRect().top)!==null&&bn!==void 0?bn:0;const On=at.querySelector(".md-container > .md-tabs");var zn;const er=(zn=On==null?void 0:On.getBoundingClientRect().height)!==null&&zn!==void 0?zn:0;En<ur&&(En=ur),Lt.style.top=`${Math.max(En,0)+er}px`}Lt.style.setProperty("opacity","1")})},[at,Y]);(0,h.useEffect)(()=>(window.addEventListener("resize",Xt),window.addEventListener("scroll",Xt,!0),()=>{window.removeEventListener("resize",Xt),window.removeEventListener("scroll",Xt,!0)}),[at,Xt]);const en=(0,h.useCallback)(()=>{if(!at)return;const Et=at.querySelector(".md-footer");Et&&(Et.style.width=`${at.getBoundingClientRect().width}px`)},[at]);(0,h.useEffect)(()=>(window.addEventListener("resize",en),()=>{window.removeEventListener("resize",en)}),[at,en]),(0,h.useEffect)(()=>{Mt||(en(),Xt())},[nt,Mt,en,Xt]);const Ut=(0,h.useCallback)((Et,Lt)=>De(Et,[we,Fn({techdocsStorageApi:jt,entityId:y,path:Lt}),_n(),ut(),Me(),Xe(),wn(vt),Ae]),[y,vt,jt,we,Ae]),zt=(0,h.useCallback)(async Et=>De(Et,[D(),me(),Oe(q),ct({baseUrl:window.location.origin,onClick:(Lt,Zt)=>{var bn;const zn=Lt.ctrlKey||Lt.metaKey,Gn=new URL(Zt),ur=((bn=Lt.target)===null||bn===void 0?void 0:bn.innerText)||Zt,En=Zt.replace(window.location.origin,"");if(Ye.captureEvent("click",ur,{attributes:{to:En}}),Gn.hash)if(zn)window.open(Zt,"_blank");else{var On;Z(Zt),(On=Et==null?void 0:Et.querySelector(`[id="${Gn.hash.slice(1)}"]`))===null||On===void 0||On.scrollIntoView()}else zn?window.open(Zt,"_blank"):Z(Zt)}}),se({onLoading:()=>{},onLoaded:()=>{var Lt;(Lt=Et.querySelector(".md-nav__title"))===null||Lt===void 0||Lt.removeAttribute("for")}}),se({onLoading:()=>{Array.from(Et.querySelectorAll(".md-sidebar")).forEach(Zt=>{Zt.style.setProperty("opacity","0")})},onLoaded:()=>{}})]),[q,Z,Ye]);return(0,h.useEffect)(()=>{if(!dt)return()=>{};let Et=!0;return Ut(dt,Ke).then(async Lt=>{if(!(Lt!=null&&Lt.innerHTML)||!Et)return;window.scroll({top:0});const Zt=await zt(Lt);Dt(Zt)}),()=>{Et=!1}},[dt,Ke,Ut,zt]),at};var _=r(8560);const J=()=>{const y=(0,W.$L)(),{shadowRoot:Z}=(0,W.x1)(),q=Z==null?void 0:Z.querySelector('[data-md-component="content"]'),Y=Z==null?void 0:Z.querySelector('div[data-md-component="sidebar"][data-md-type="navigation"], div[data-md-component="navigation"]');let we=Y==null?void 0:Y.querySelector('[data-techdocs-addons-location="primary sidebar"]');we||(we=document.createElement("div"),we.setAttribute("data-techdocs-addons-location","primary sidebar"),Y==null||Y.prepend(we));const Ae=Z==null?void 0:Z.querySelector('div[data-md-component="sidebar"][data-md-type="toc"], div[data-md-component="toc"]');let Ye=Ae==null?void 0:Ae.querySelector('[data-techdocs-addons-location="secondary sidebar"]');return Ye||(Ye=document.createElement("div"),Ye.setAttribute("data-techdocs-addons-location","secondary sidebar"),Ae==null||Ae.prepend(Ye)),(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(_.Z,{container:we,children:y.renderComponentsByLocation(W.oZ.PrimarySidebar)}),(0,t.jsx)(_.Z,{container:q,children:y.renderComponentsByLocation(W.oZ.Content)}),(0,t.jsx)(_.Z,{container:Ye,children:y.renderComponentsByLocation(W.oZ.SecondarySidebar)})]})},te=(0,H.Z)({search:{width:"100%","@media (min-width: 76.1875em)":{width:"calc(100% - 34.4rem)",margin:"0 auto"}}}),pe=(0,L.m1)(y=>{var Z;const{withSearch:q=!0,onReady:Y}=y,we=te(),{entityMetadata:{value:Ae,loading:Ye},entityRef:jt,setShadowRoot:vt}=(0,W.x1)(),nt=Qt(jt),Ke=(0,h.useCallback)(dt=>{vt(dt),Y instanceof Function&&Y()},[vt,Y]);return Ye===!1&&!Ae?(0,t.jsx)(g.mf,{status:"404",statusMessage:"PAGE NOT FOUND"}):nt?(0,t.jsx)(g.VY,{children:(0,t.jsxs)(f.Z,{container:!0,children:[(0,t.jsx)(f.Z,{xs:12,item:!0,children:(0,t.jsx)(oe,{})}),q&&(0,t.jsx)(f.Z,{className:we.search,xs:"auto",item:!0,children:(0,t.jsx)(u.S,{entityId:jt,entityTitle:Ae==null||(Z=Ae.metadata)===null||Z===void 0?void 0:Z.title})}),(0,t.jsx)(f.Z,{xs:12,item:!0,children:(0,t.jsx)(W.VA,{element:nt,onAppend:Ke,children:(0,t.jsx)(J,{})})})]})}):(0,t.jsx)(g.VY,{children:(0,t.jsx)(f.Z,{container:!0,children:(0,t.jsx)(f.Z,{xs:12,item:!0,children:(0,t.jsx)(oe,{})})})})}),le=null},93225:function(Ct,$e,r){"use strict";r.d($e,{S:function(){return ee}});var t=r(52322),h=r(2784),H=r(18671),f=r(60905),W=r(98069),g=r(60364),u=r(73250),B=r(61886),ve=r(43514),ue=r(25271),V=r(53974),K=r(60871),I=r(76635),w=r(95573);const ie=(0,t.jsx)(W.Z,{animation:"wave",variant:"text",height:40}),ee=ne=>{const{palette:{common:{white:$}}}=(0,g.Z)(),{children:T}=ne,P=(0,B.$L)(),L=(0,K.h_)(K.Ds),{title:O,setTitle:oe,subtitle:Le,setSubtitle:ze,entityRef:z,metadata:{value:yt,loading:ot},entityMetadata:{value:He,loading:st}}=(0,B.x1)();(0,h.useEffect)(()=>{yt&&(oe(yt.site_name),ze(()=>{let{site_description:Se}=yt;return(!Se||Se==="None")&&(Se=""),Se}))},[yt,oe,ze]);const Qe=L.getOptional("app.title")||"Backstage",St=[O,Le,Qe].filter(Boolean).join(" | "),{locationMetadata:It,spec:xt}=He||{},lt=xt==null?void 0:xt.lifecycle,Pt=He?(0,ve.hF)(He,ue.S4):[],Nt=(0,K.tg)(w._Z)(),We=(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(V.i9,{label:(0,I.capitalize)((He==null?void 0:He.kind)||"entity"),value:(0,t.jsx)(ve.dx,{color:"inherit",entityRef:z,title:He==null?void 0:He.metadata.title,defaultKind:"Component"})}),Pt.length>0&&(0,t.jsx)(V.i9,{label:"Owner",value:(0,t.jsx)(ve.rI,{color:"inherit",entityRefs:Pt,defaultKind:"group"})}),lt?(0,t.jsx)(V.i9,{label:"Lifecycle",value:lt}):null,It&&It.type!=="dir"&&It.type!=="file"?(0,t.jsx)(V.i9,{label:"",value:(0,t.jsxs)(f.Z,{container:!0,direction:"column",alignItems:"center",style:{color:$},children:[(0,t.jsx)(f.Z,{style:{padding:0},item:!0,children:(0,t.jsx)(u.Z,{style:{marginTop:"-25px"}})}),(0,t.jsx)(f.Z,{style:{padding:0},item:!0,children:"Source"})]}),url:It.target}):null]});return!st&&He===void 0||!ot&&yt===void 0?null:(0,t.jsxs)(V.h4,{type:"Documentation",typeLink:Nt,title:O||ie,subtitle:Le===""?void 0:Le||ie,children:[(0,t.jsx)(H.Z,{titleTemplate:"%s",children:(0,t.jsx)("title",{children:St})}),We,T,P.renderComponentsByLocation(B.oZ.Header)]})}},65124:function(Ct,$e,r){"use strict";r.d($e,{b:function(){return K}});var t=r(52322),h=r(2784),H=r(79692),f=r(15223),W=r(95544),g=r(80030),u=r(61837),B=r(48348),ve=r(47603),ue=r(61886);const V=(0,H.Z)(I=>({root:{gridArea:"pageSubheader",flexDirection:"column",minHeight:"auto",padding:I.spacing(3,3,0)}})),K=I=>{const w=V(),[ie,ee]=(0,h.useState)(null),ne=(0,h.useCallback)(Le=>{ee(Le.currentTarget)},[]),$=(0,h.useCallback)(()=>{ee(null)},[]),{entityMetadata:{value:T,loading:P}}=(0,ue.x1)(),L=(0,ue.$L)(),O=L.renderComponentsByLocation(ue.oZ.Subheader),oe=L.renderComponentsByLocation(ue.oZ.Settings);return!O&&!oe||P===!1&&!T?null:(0,t.jsx)(f.Z,{classes:w,...I.toolbarProps,children:(0,t.jsxs)(W.Z,{display:"flex",justifyContent:"flex-end",width:"100%",flexWrap:"wrap",children:[O,oe?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(g.ZP,{title:"Settings",children:(0,t.jsx)(u.Z,{"aria-controls":"tech-docs-reader-page-settings","aria-haspopup":"true",onClick:ne,children:(0,t.jsx)(ve.Z,{})})}),(0,t.jsx)(B.Z,{id:"tech-docs-reader-page-settings",getContentAnchorEl:null,anchorEl:ie,anchorOrigin:{vertical:"bottom",horizontal:"right"},open:Boolean(ie),onClose:$,keepMounted:!0,children:(0,t.jsx)("div",{children:oe})})]}):null]})})}},95481:function(Ct,$e,r){"use strict";r.d($e,{DK:function(){return K},m1:function(){return w}});var t=r(52322),h=r(2784),H=r(73557),f=r(61886),W=r(60871),g=r(64279),u=r(77446);function B({contentLoading:ie,content:ee,activeSyncState:ne}){return ie||ne==="BUILD_READY_RELOAD"||!ee&&ne==="CHECKING"?"CHECKING":!ee&&ne==="BUILDING"?"INITIAL_BUILD":ee?ne==="BUILDING"?"CONTENT_STALE_REFRESHING":ne==="BUILD_READY"?"CONTENT_STALE_READY":ne==="ERROR"?"CONTENT_STALE_ERROR":"CONTENT_FRESH":"CONTENT_NOT_FOUND"}function ve(ie,ee){const ne={...ie};switch(ee.type){case"sync":ee.state==="CHECKING"&&(ne.buildLog=[]),ne.activeSyncState=ee.state,ne.syncError=ee.syncError;break;case"contentLoading":ne.contentLoading=!0,ne.contentError=void 0;break;case"content":typeof ee.path=="string"&&(ne.path=ee.path),ne.contentLoading=!1,ne.content=ee.content,ne.contentError=ee.contentError;break;case"buildLog":ne.buildLog=ne.buildLog.concat(ee.log);break;default:throw new Error}return["BUILD_READY","BUILD_READY_RELOAD"].includes(ne.activeSyncState)&&["contentLoading","content"].includes(ee.type)&&(ne.activeSyncState="UP_TO_DATE",ne.buildLog=[]),ne}function ue(ie,ee,ne,$){var T,P;const[L,O]=(0,h.useReducer)(ve,{activeSyncState:"CHECKING",path:$,contentLoading:!0,buildLog:[]}),oe=(0,W.h_)(f.Dl),{retry:Le}=(0,u.Z)(async()=>{O({type:"contentLoading"});try{const yt=await oe.getEntityDocs({kind:ie,namespace:ee,name:ne},$);return O({type:"content",content:yt,path:$}),yt}catch(yt){O({type:"content",contentError:yt,path:$})}},[oe,ie,ee,ne,$]),ze=(0,h.useRef)({content:void 0,reload:()=>{}});return ze.current={content:L.content,reload:Le},(0,g.default)(async()=>{O({type:"sync",state:"CHECKING"});const yt=setTimeout(()=>{O({type:"sync",state:"BUILDING"})},1e3);try{switch(await oe.syncEntityDocs({kind:ie,namespace:ee,name:ne},He=>{O({type:"buildLog",log:He})})){case"updated":ze.current.content?O({type:"sync",state:"BUILD_READY"}):(ze.current.reload(),O({type:"sync",state:"BUILD_READY_RELOAD"}));break;case"cached":O({type:"sync",state:"UP_TO_DATE"});break;default:O({type:"sync",state:"ERROR",syncError:new Error("Unexpected return state")});break}}catch(ot){O({type:"sync",state:"ERROR",syncError:ot})}finally{clearTimeout(yt)}},[ie,ne,ee,oe,O,ze]),{state:(0,h.useMemo)(()=>B({activeSyncState:L.activeSyncState,contentLoading:L.contentLoading,content:L.content}),[L.activeSyncState,L.content,L.contentLoading]),contentReload:Le,path:L.path,content:L.content,contentErrorMessage:(T=L.contentError)===null||T===void 0?void 0:T.toString(),syncErrorMessage:(P=L.syncError)===null||P===void 0?void 0:P.toString(),buildLog:L.buildLog}}const V=(0,h.createContext)({}),K=()=>(0,h.useContext)(V),I=ie=>{const{children:ee}=ie,{"*":ne=""}=(0,H.UO)(),{entityRef:$}=(0,f.x1)(),{kind:T,namespace:P,name:L}=$,O=ue(T,P,L,ne);return(0,t.jsx)(V.Provider,{value:O,children:ee instanceof Function?ee(O):ee})},w=ie=>ee=>(0,t.jsx)(I,{children:(0,t.jsx)(ie,{...ee})})},95573:function(Ct,$e,r){"use strict";r.d($e,{Fw:function(){return H},_Z:function(){return h},pd:function(){return f}});var t=r(60871);const h=(0,t.NT)({id:"techdocs:index-page"}),H=(0,t.NT)({id:"techdocs:reader-page",params:["namespace","kind","name"]}),f=(0,t.NT)({id:"techdocs:catalog-reader-view"})},55511:function(Ct,$e,r){"use strict";r.r($e),r.d($e,{TechDocsSearchResultListItem:function(){return ue}});var t=r(52322),h=r(2784),H=r(79692),f=r(49378),W=r(86136),g=r(90436),u=r(53974),B=r(15096);const ve=(0,H.Z)({flexContainer:{flexWrap:"wrap"},itemText:{width:"100%",marginBottom:"1rem"}}),ue=V=>{const{result:K,highlight:I,lineClamp:w=5,asListItem:ie=!0,asLink:ee=!0,title:ne,icon:$}=V,T=ve(),P=({children:oe})=>ee?(0,t.jsx)(u.rU,{noTrack:!0,to:K.location,children:oe}):(0,t.jsx)(t.Fragment,{children:oe}),L=()=>{const oe=I!=null&&I.fields.title?(0,t.jsx)(B.FA,{text:I.fields.title,preTag:I.preTag,postTag:I.postTag}):K.title,Le=I!=null&&I.fields.entityTitle?(0,t.jsx)(B.FA,{text:I.fields.entityTitle,preTag:I.preTag,postTag:I.postTag}):K.entityTitle,ze=I!=null&&I.fields.name?(0,t.jsx)(B.FA,{text:I.fields.name,preTag:I.preTag,postTag:I.postTag}):K.name;return K?(0,t.jsx)(f.Z,{className:T.itemText,primaryTypographyProps:{variant:"h6"},primary:(0,t.jsx)(P,{children:ne||(0,t.jsxs)(t.Fragment,{children:[oe," | ",Le!=null?Le:ze," docs"]})}),secondary:(0,t.jsx)(g.Z,{component:"span",style:{display:"-webkit-box",WebkitBoxOrient:"vertical",WebkitLineClamp:w,overflow:"hidden"},color:"textSecondary",variant:"body2",children:I!=null&&I.fields.text?(0,t.jsx)(B.FA,{text:I.fields.text,preTag:I.preTag,postTag:I.postTag}):K.text})}):null},O=({children:oe})=>ie?(0,t.jsxs)(t.Fragment,{children:[$&&(0,t.jsx)(W.Z,{children:typeof $=="function"?$(K):$}),(0,t.jsx)("div",{className:T.flexContainer,children:oe})]}):(0,t.jsx)(t.Fragment,{children:oe});return(0,t.jsx)(O,{children:(0,t.jsx)(L,{})})}},22478:function(Ct,$e,r){"use strict";r.d($e,{S:function(){return V}});var t=r(52322),h=r(15096),H=r(79692),f=r(27556),W=r(2784),g=r(73557),u=r(55511);const B=(0,H.Z)(K=>({root:{width:"100%"},bar:{padding:K.spacing(1)}})),ve=K=>K==null?void 0:K.document,ue=K=>{const{entityId:I,entityTitle:w,debounceTime:ie=150}=K,[ee,ne]=(0,W.useState)(!1),$=(0,g.s0)(),{setFilters:T,result:{loading:P,value:L}}=(0,h.Rx)(),O=B(),[oe,Le]=(0,W.useState)([]);(0,W.useEffect)(()=>{let He=!0;if(He&&L){const st=L.results.slice(0,10);Le(st)}return()=>{He=!1}},[P,L]);const{kind:ze,name:z,namespace:yt}=I;(0,W.useEffect)(()=>{T(He=>({...He,kind:ze,namespace:yt,name:z}))},[ze,yt,z,T]);const ot=(He,st)=>{if(ve(st)){const{location:Qe}=st.document;$(Qe)}};return(0,t.jsx)(f.Z,{className:O.bar,variant:"outlined",children:(0,t.jsx)(h.qO,{classes:{root:O.root},"data-testid":"techdocs-search-bar",size:"small",open:ee,getOptionLabel:()=>"",filterOptions:He=>He,onClose:()=>{ne(!1)},onFocus:()=>{ne(!0)},onChange:ot,blurOnSelect:!0,noOptionsText:"No results found",value:null,options:oe,renderOption:({document:He,highlight:st})=>(0,t.jsx)(u.TechDocsSearchResultListItem,{result:He,lineClamp:3,asListItem:!1,asLink:!1,title:He.title,highlight:st}),loading:P,inputDebounceTime:ie,inputPlaceholder:`Search ${w||I.name} docs`,freeSolo:!1})})},V=K=>{const I={term:"",types:["techdocs"],pageCursor:"",filters:K.entityId};return(0,t.jsx)(h.Nd,{initialState:I,children:(0,t.jsx)(ue,{...K})})}},53260:function(){}},function(Ct){var $e=function(t){return Ct(Ct.s=t)};Ct.O(0,[2370,6202,9284,9035,2126,7012,2194,1410,427,242,5109,6816,5218,4736],function(){return $e(6290)});var r=Ct.O()}]);})();
|
|
507
507
|
|
|
508
|
-
//# sourceMappingURL=main.
|
|
508
|
+
//# sourceMappingURL=main.7a6c2e51.js.map
|