@techdocs/cli 0.0.0-nightly-20230718023400 → 0.0.0-nightly-20230720022013
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 +15 -4
- package/dist/embedded-app/index.html +1 -1
- package/dist/embedded-app/static/{main.da48ea88.js → main.fef15b74.js} +2 -2
- package/dist/embedded-app/static/main.fef15b74.js.map +1 -0
- package/dist/embedded-app/static/{runtime.da48ea88.js → runtime.fef15b74.js} +1 -1
- package/dist/embedded-app/static/{runtime.da48ea88.js.map → runtime.fef15b74.js.map} +1 -1
- package/dist/embedded-app/static/{vendor.da48ea88.js → vendor.fef15b74.js} +1 -1
- package/dist/embedded-app/static/{vendor.da48ea88.js.map → vendor.fef15b74.js.map} +1 -1
- package/dist/index.cjs.js +1 -1
- package/package.json +5 -5
- package/dist/embedded-app/static/main.da48ea88.js.map +0 -1
|
@@ -30,7 +30,7 @@ spec:
|
|
|
30
30
|
hsla(0, 0%, ${s}, 0.013) 91.9%,
|
|
31
31
|
hsla(0, 0%, ${s}, 0) 100%
|
|
32
32
|
`},Fr=100,C=10,c=(0,m.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:Fr,height:`calc(100% + ${C}px)`,transition:"opacity 300ms",pointerEvents:"none"},fadeLeft:{left:-C,background:`linear-gradient(90deg, ${zn(e.palette.type)})`},fadeRight:{right:-C,background:`linear-gradient(270deg, ${zn(e.palette.type)})`},fadeHidden:{opacity:0},button:{position:"absolute"},buttonLeft:{left:-e.spacing(2)},buttonRight:{right:-e.spacing(2)}}),{name:"BackstageHorizontalScrollGrid"});function S(e){const[[s,l],u]=React.useState([0,0]);return React.useLayoutEffect(()=>{const g=e.current;if(!g){u([0,0]);return}const x=()=>{const T=g.scrollLeft,$=g.scrollWidth-g.offsetWidth-g.scrollLeft;u([T,$])};return x(),g.addEventListener("scroll",x),window.addEventListener("resize",x),()=>{g.removeEventListener("scroll",x),window.removeEventListener("resize",x)}},[e]),[s,l]}function E(e,s,l){const[u,g]=React.useState(0);return React.useLayoutEffect(()=>{if(u===0)return;const x=window.performance.now(),T=requestAnimationFrame($=>{if(!e.current)return;const _=$-x,Q=Math.abs(u)*_/s,ge=Math.max(l,Q)*Math.sign(u);e.current.scrollBy({left:ge});const Ze=u-ge;Math.sign(u)!==Math.sign(Ze)?g(0):g(Ze)});return()=>cancelAnimationFrame(T)},[e,u,s,l]),g}function J(e){const{scrollStep:s=100,scrollSpeed:l=50,minScrollDistance:u=5,children:g,...x}=e,T=c(e),$=React.useRef(),[_,Q]=S($),fe=E($,l,u),ge=Ze=>{$.current&&fe(Ze?s:-s)};return _jsxs(Box,{...x,className:T.root,children:[_jsx(Grid,{container:!0,direction:"row",wrap:"nowrap",className:T.container,ref:$,children:g}),_jsx(Box,{className:classNames(T.fade,T.fadeLeft,{[T.fadeHidden]:_===0})}),_jsx(Box,{className:classNames(T.fade,T.fadeRight,{[T.fadeHidden]:Q===0})}),_>0&&_jsx(IconButton,{title:"Scroll Left",onClick:()=>ge(!1),className:classNames(T.button,T.buttonLeft,{}),children:_jsx(ChevronLeftIcon,{})}),Q>0&&_jsx(IconButton,{title:"Scroll Right",onClick:()=>ge(!0),className:classNames(T.button,T.buttonRight,{}),children:_jsx(ChevronRightIcon,{})})]})}const ye=(0,m.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 je(e){const s=ye(e),{shorthand:l,alpha:u}=e;return l?_jsx(Typography,{component:"span",className:s[u?"alpha":"beta"],style:{fontSize:"120%"},children:u?_jsx(_Fragment,{children:"\u03B1"}):_jsx(_Fragment,{children:"\u03B2"})}):_jsx(Typography,{component:"span",className:s[u?"alpha":"beta"],children:u?"Alpha":"Beta"})}const De=(0,f.lazy)(()=>Promise.all([n.e(1049),n.e(6051)]).then(n.bind(n,76051)).then(e=>({default:e.RealLogViewer})));function et(e){const{Progress:s}=(0,p.qD)().getComponents();return(0,r.jsx)(f.Suspense,{fallback:(0,r.jsx)(s,{}),children:(0,r.jsx)(De,{...e})})}var Gt=n(28865),xn=n(60251);const qn=(0,m.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"}),mr=(e,s)=>s?typeof s=="string"?e+s:f.Children.toArray(s.props.children).reduce(mr,e):e,jr=({level:e,children:s})=>{const g=f.Children.toArray(s).reduce(mr,"").toLocaleLowerCase("en-US").replace(/\W/g,"-");return f.createElement(`h${e}`,{id:g},s)},bn={code:({inline:e,className:s,children:l,...u})=>{const g=String(l).replace(/\n+$/,""),x=/language-(\w+)/.exec(s||"");return!e&&x?(0,r.jsx)(xe,{language:x[1],text:g}):(0,r.jsx)("code",{className:s,...u,children:l})},h1:jr,h2:jr,h3:jr,h4:jr,h5:jr,h6:jr};function Wr(e){const{content:s,dialect:l="gfm",linkTarget:u,transformLinkUri:g,transformImageUri:x,className:T}=e,$=qn();return(0,r.jsx)(Gt.D,{remarkPlugins:l==="gfm"?[xn.Z]:[],className:`${$.markdown} ${T}`,children:s,components:bn,linkTarget:u,transformLinkUri:g,transformImageUri:x})}var lo=n(23054);const Co=(0,m.Z)(e=>({root:{paddingLeft:e.spacing(3)}}),{name:"BackstageLoginRequestListItem"}),Ss=({request:e,busy:s,setBusy:l})=>{const u=Co(),[g,x]=useState(),T=async()=>{l(!0);try{await e.trigger()}catch(_){x(isError(_)?_.message:"An unspecified error occurred")}finally{l(!1)}},$=e.provider.icon;return _jsxs(ListItem,{disabled:s,classes:{root:u.root},children:[_jsx(ListItemAvatar,{children:_jsx($,{fontSize:"large"})}),_jsx(ListItemText,{primary:e.provider.title,secondary:g&&_jsx(Typography,{color:"error",children:g})}),_jsx(Button,{color:"primary",variant:"contained",onClick:T,children:"Log in"})]})};var Vr=null;const Vo=(0,m.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 Cs(e){const s=Vo(),[l,u]=useState(!1),g=useApi(oauthRequestApiRef),x=useApi(configApiRef);var T;const $=(T=x.getOptionalBoolean("enableExperimentalRedirectFlow"))!==null&&T!==void 0?T:!1,_=useObservable(useMemo(()=>g.authRequest$(),[g]),[]),Q=()=>{_.forEach(fe=>fe.reject())};return _jsxs(Dialog,{open:Boolean(_.length),fullWidth:!0,maxWidth:"xs",classes:{paper:s.dialog},"aria-labelledby":"oauth-req-dialog-title",children:[_jsxs("main",{children:[_jsxs(DialogTitle,{classes:{root:s.title},id:"oauth-req-dialog-title",children:[_jsx(Typography,{className:s.titleHeading,variant:"h1",variantMapping:{h1:"span"},children:"Login Required"}),$?_jsx(Typography,{children:"This will trigger a http redirect to OAuth Login."}):null]}),_jsx(DialogContent,{dividers:!0,classes:{root:s.contentList},children:_jsx(List,{children:_.map(fe=>_jsx(LoginRequestListItem,{request:fe,busy:l,setBusy:u},fe.provider.title))})})]}),_jsx(DialogActions,{classes:{root:s.actionButtons},children:_jsx(Button,{onClick:Q,children:"Reject All"})})]})}var Ho=n(15277),Go=n.n(Ho),Er=n(29862);const lr=(0,m.Z)({container:{overflow:"visible !important"}},{name:"BackstageOverflowTooltip"});function Hr(e){const[s,l]=(0,f.useState)(!1),u=(0,Er.t)(),g=lr(),x=$=>{u()&&l($)};var T;return(0,r.jsx)(R.ZP,{title:(T=e.title)!==null&&T!==void 0?T:e.text||"",placement:e.placement,disableHoverListener:!s,children:(0,r.jsx)(Go(),{text:e.text,line:e.line,onToggled:x,containerClassName:g.container})})}var qr=n(67358);function wo(e){const s=(0,se.Z)(),[l,u]=(0,f.useState)(!1);return(0,f.useEffect)(()=>{const g=setTimeout(()=>u(!0),s.transitions.duration.short);return()=>clearTimeout(g)},[s.transitions.duration.short]),l?(0,r.jsx)(qr.Z,{...e,"data-testid":"progress"}):(0,r.jsx)(A.Z,{display:"none"})}var jo=n(94339),Zr=n(14503),Ko=n(24579),Eo=n(32552),Nn=n(15459),cr=n(27597);const Gr=(0,m.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 Kr(e){const{link:s,title:l,onClick:u}=e,g=Gr();return(0,r.jsxs)(A.Z,{children:[(0,r.jsx)(Oe.Z,{}),(0,r.jsx)(ce.r,{to:s,onClick:u,underline:"none",children:(0,r.jsxs)(A.Z,{display:"flex",alignItems:"center",className:g.root,children:[(0,r.jsx)(A.Z,{className:g.boxTitle,fontWeight:"fontWeightBold",m:1,children:(0,r.jsx)(Ye.Z,{children:(0,r.jsx)("strong",{children:l})})}),(0,r.jsx)(cr.Z,{className:g.arrow})]})})]})}const Yo=e=>{const{slackChannel:s}=e;if(s){if(typeof s=="string")return(0,r.jsxs)(Ye.Z,{children:["Please contact ",s," for help."]});if(!s.href)return(0,r.jsxs)(Ye.Z,{children:["Please contact ",s.name," for help."]})}else return null;return(0,r.jsx)(de,{to:s.href,variant:"contained",children:s.name})},vr=class extends f.Component{componentDidCatch(s,l){console.error(`ErrorBoundary, error: ${s}, info: ${l}`),this.setState({error:s,errorInfo:l})}render(){const{slackChannel:s,children:l}=this.props,{error:u}=this.state;return u?(0,r.jsx)(ct,{title:"Something Went Wrong",error:u,children:(0,r.jsx)(Yo,{slackChannel:s})}):l}constructor(s){super(s),this.state={error:void 0,errorInfo:void 0}}},Ao=(0,m.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"}),To=(0,Nn.Z)(e=>({root:{display:"inline-block",padding:e.spacing(8,8,0,0),float:"right"}}),{name:"BackstageInfoCardCardActionsTopRight"})(Zr.Z),Ro={card:{flex:{display:"flex",flexDirection:"column"},fullHeight:{display:"flex",flexDirection:"column",height:"100%"},gridItem:{display:"flex",flexDirection:"column",height:"calc(100% - 10px)",marginBottom:"10px",breakInside:"avoid-page","@media print":{height:"auto"}}},cardContent:{fullHeight:{flex:1},gridItem:{flex:1}}};function Ur(e){const{title:s,subheader:l,divider:u=!0,deepLink:g,slackChannel:x,errorBoundaryProps:T,variant:$,children:_,headerStyle:Q,headerProps:fe,icon:ge,action:Ze,actionsClassName:Ie,actions:Ve,cardClassName:pt,actionsTopRight:at,className:zt,noPadding:Bn,titleTypographyProps:Hn}=e,kt=Ao();let nn={},gn={};$&&$.split(/[\s]+/g).forEach(Cr=>{nn={...nn,...Ro.card[Cr]},gn={...gn,...Ro.cardContent[Cr]}});const Zn=()=>!l&&!ge?null:(0,r.jsxs)("div",{className:kt.headerSubheader,"data-testid":"info-card-subheader",children:[l&&(0,r.jsx)("div",{className:kt.subheader,children:l}),ge]}),Un=T||(x?{slackChannel:x}:{});return(0,r.jsx)(jo.Z,{style:nn,className:zt,children:(0,r.jsxs)(vr,{...Un,children:[s&&(0,r.jsx)(Eo.Z,{classes:{root:kt.header,title:kt.headerTitle,subheader:kt.headerSubheader,avatar:kt.headerAvatar,action:kt.headerAction,content:kt.headerContent},title:s,subheader:Zn(),action:Ze,style:{...Q},titleTypographyProps:Hn,...fe}),at&&(0,r.jsx)(To,{children:at}),u&&(0,r.jsx)(Oe.Z,{}),(0,r.jsx)(Ko.Z,{className:on()(pt,{[kt.noPadding]:Bn}),style:gn,children:_}),Ve&&(0,r.jsx)(Zr.Z,{className:Ie,children:Ve}),g&&(0,r.jsx)(Kr,{...g})]})})}var Io=n(39307);const Jo=(0,m.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"}),co={fractional:!0,inverse:!1,unit:"%",max:100},Po=({palette:e,value:s,inverse:l,max:u})=>{if(isNaN(s))return"#ddd";const g=u||co.max,x=l?g-s:s;return x<g/3?e.status.error:x<g*(2/3)?e.status.warning:e.status.ok};function ws(e){const[s,l]=useState(null),{getColor:u=Po}=e,g=Jo(e),{palette:x}=useTheme(),{value:T,fractional:$,inverse:_,unit:Q,max:fe,description:ge}={...co,...e},Ze=$?Math.round(T*fe):T,Ie=fe!==100?Math.round(T):Ze,[Ve,pt]=useState(!1);return useEffect(()=>{const at=s,zt=()=>pt(!0),Bn=()=>pt(!1);return at&&ge?(at.addEventListener("mouseenter",zt),at.addEventListener("mouseleave",Bn),()=>{at.removeEventListener("mouseenter",zt),at.removeEventListener("mouseleave",Bn)}):()=>{pt(!1)}},[ge,s]),_jsxs(Box,{ref:l,className:g.root,children:[_jsx(Circle,{strokeLinecap:"butt",percent:Ze,strokeWidth:12,trailWidth:12,strokeColor:u({palette:x,value:Ie,inverse:_,max:fe}),className:g.circle}),ge&&Ve?_jsx(Box,{className:g.description,children:ge}):_jsx(Box,{className:g.overlay,children:isNaN(T)?"N/A":`${Ie}${Q}`})]})}const Lo=(0,m.Z)({root:{height:"100%",width:250}},{name:"BackstageGaugeCard"});function dr(e){const s=Lo(e),{title:l,subheader:u,progress:g,inverse:x,deepLink:T,description:$,icon:_,variant:Q,getColor:fe}=e,ge={inverse:x,description:$,getColor:fe,value:g};return _jsx(Box,{className:s.root,children:_jsx(InfoCard,{title:l,subheader:u,deepLink:T,variant:Q,icon:_,children:_jsx(Gauge,{...ge})})})}function ci(e){const{value:s,getColor:l=getProgressColor,width:u="thick"}=e,{palette:g}=useTheme();if(isNaN(s))return null;let x=Math.round(s*100*100)/100;x>100&&(x=100);const T=u==="thick"?4:1,$=l({palette:g,value:x,inverse:!1,max:100});return _jsx(Tooltip,{title:`${x}%`,children:_jsx(Typography,{component:"span",children:_jsx(Line,{percent:x,strokeWidth:T,trailWidth:T,strokeColor:$})})})}var Qo=n(21324),js=n(7089),uo=n(42494),eo=n(74603),to=n(56939),no=n(12231),Ar=n(73698),er=n(12420),ho=n(72379);const Xo=(0,m.Z)(e=>(0,er.Z)({icon:{position:"absolute",right:e.spacing(.5),pointerEvents:"none"}}),{name:"BackstageClosedDropdown"});var ro=()=>{const e=Xo();return(0,r.jsx)(ho.Z,{className:e.icon,fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,r.jsx)("path",{d:"M7.5 8L6 9.5L12.0703 15.5703L18.1406 9.5L16.6406 8L12.0703 12.5703L7.5 8Z",fill:"#616161"})})};const _o=(0,m.Z)(e=>(0,er.Z)({icon:{position:"absolute",right:e.spacing(.5),pointerEvents:"none"}}),{name:"BackstageOpenedDropdown"});var qo=()=>{const e=_o();return(0,r.jsx)(ho.Z,{className:e.icon,fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,r.jsx)("path",{d:"M16.5 16L18 14.5L11.9297 8.42969L5.85938 14.5L7.35938 16L11.9297 11.4297L16.5 16Z",fill:"#616161"})})};const es=(0,Nn.Z)(e=>(0,er.Z)({root:{"label + &":{marginTop:e.spacing(3)},"&.Mui-focused > div[role=button]":{borderColor:e.palette.primary.main}},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"})(eo.Z),po=(0,m.Z)(e=>(0,er.Z)({formControl:{margin:e.spacing(1,0),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 Oo(e){const{multiple:s,items:l,label:u,placeholder:g,selected:x,onChange:T,triggerReset:$,native:_=!1,disabled:Q=!1,margin:fe}=e,ge=po(),[Ze,Ie]=(0,f.useState)(x||(s?[]:"")),[Ve,pt]=(0,f.useState)(!1);(0,f.useEffect)(()=>{Ie(s?[]:"")},[$,s]),(0,f.useEffect)(()=>{Ie(x||(s?[]:""))},[x,s]);const at=kt=>{Ie(kt.target.value),T(kt.target.value)},zt=kt=>{if(Q){kt.preventDefault();return}pt(nn=>s&&!(kt.target instanceof HTMLElement)?!0:!nn)},Bn=()=>{pt(!1)},Hn=kt=>()=>{const nn=Ze.filter(gn=>gn!==kt);Ie(nn),T(nn)};return(0,r.jsx)(A.Z,{className:ge.root,children:(0,r.jsxs)(uo.Z,{className:ge.formControl,children:[(0,r.jsx)(to.Z,{className:ge.formLabel,children:u}),(0,r.jsxs)(Ar.Z,{"aria-label":u,value:Ze,native:_,disabled:Q,"data-testid":"select",displayEmpty:!0,multiple:s,margin:fe,onChange:at,open:Ve,onOpen:zt,onClose:Bn,input:(0,r.jsx)(es,{}),label:u,renderValue:kt=>{var nn;return s&&Ze.length!==0?(0,r.jsx)(A.Z,{className:ge.chips,children:kt.map(gn=>{var Zn,Un;return(0,r.jsx)(js.Z,{label:(Zn=l.find(ir=>ir.value===gn))===null||Zn===void 0?void 0:Zn.label,clickable:!0,onDelete:Hn(gn),className:ge.chip},(Un=l.find(ir=>ir.value===gn))===null||Un===void 0?void 0:Un.value)})}):(0,r.jsx)(Ye.Z,{children:Ze.length===0?g||"":(nn=l.find(gn=>gn.value===kt))===null||nn===void 0?void 0:nn.label})},IconComponent:()=>Ve?(0,r.jsx)(qo,{}):(0,r.jsx)(ro,{}),MenuProps:{anchorOrigin:{vertical:"bottom",horizontal:"left"},transformOrigin:{vertical:"top",horizontal:"left"},getContentAnchorEl:null},children:[g&&!s&&(0,r.jsx)(no.Z,{value:[],children:g}),_?l&&l.map(kt=>(0,r.jsx)("option",{value:kt.value,children:kt.label},kt.value)):l&&l.map(kt=>(0,r.jsxs)(no.Z,{value:kt.value,children:[s&&(0,r.jsx)(Qo.Z,{color:"primary",checked:Ze.includes(kt.value)||!1,className:ge.checkbox}),kt.label]},kt.value))]})]})})}const fo=()=>{},Ts=f.createContext({stepperLength:0,stepIndex:0,setStepIndex:fo,stepHistory:[],setStepHistory:fo,onStepChange:fo});function di(e){const{children:s,elevated:l,onStepChange:u,activeStep:g=0}=e,[x,T]=useState(g),[$,_]=useState([0]);useEffect(()=>{T(g)},[g]);const Q=[];let fe;return Children.forEach(s,ge=>{isValidElement(ge)&&(ge.props.end?fe=ge:Q.push(ge))}),_jsxs(_Fragment,{children:[_jsx(Ts.Provider,{value:{stepIndex:x,setStepIndex:T,stepHistory:$,setStepHistory:_,onStepChange:u,stepperLength:Children.count(s)},children:_jsx(MuiStepper,{activeStep:x,orientation:"vertical",elevation:l?2:0,children:Q})}),x>=Children.count(s)-1&&fe]})}const ts=(0,m.Z)(e=>({root:{marginTop:e.spacing(3),"& button":{marginRight:e.spacing(1)}}}),{name:"BackstageSimpleStepperFooter"}),ns=({text:e,handleClick:s})=>_jsx(Button,{onClick:s,children:e||"Reset"}),cn=({text:e,handleClick:s,disabled:l,last:u,stepIndex:g})=>_jsx(Button,{variant:"contained",color:"primary",disabled:l,"data-testid":`nextButton-${g}`,onClick:s,children:e||(u?"Finish":"Next")}),Rs=({text:e,handleClick:s,disabled:l,stepIndex:u})=>_jsx(Button,{variant:"outlined",color:"primary",disabled:l,"data-testid":`skipButton-${u}`,onClick:s,children:e||"Skip"}),y=({text:e,handleClick:s,disabled:l,stepIndex:u})=>_jsx(Button,{onClick:s,"data-testid":`backButton-${u}`,disabled:l,children:e||"Back"}),j=({actions:e={},children:s})=>{const l=ts(),{stepperLength:u,stepIndex:g,setStepIndex:x,stepHistory:T,setStepHistory:$,onStepChange:_}=useContext(VerticalStepperContext),Q=(Ie,Ve)=>{Ve&&Ve(),_&&_(g,Ie),x(Ie)},fe=()=>{const Ie=e.nextStep?e.nextStep(g,u-1):g+1;Q(Ie,e.onNext),$([...T,Ie])},ge=()=>{T.pop(),Q(T[T.length-1],e.onBack),$([...T])},Ze=()=>{Q(0,e.onRestart),$([0])};return _jsxs(Box,{className:l.root,children:[[void 0,!0].includes(e.showBack)&&g!==0&&_jsx(y,{text:e.backText,handleClick:ge,disabled:g===0,stepIndex:g}),e.showSkip&&_jsx(Rs,{text:e.skipText,handleClick:fe,disabled:!!u&&g>=u||!!e.canSkip&&!e.canSkip(),stepIndex:g}),[void 0,!0].includes(e.showNext)&&_jsx(cn,{text:e.nextText,handleClick:fe,disabled:!!u&&g>=u||!!e.canNext&&!e.canNext(),stepIndex:g}),e.showRestart&&g!==0&&_jsx(ns,{text:e.restartText,handleClick:Ze,stepIndex:g}),s]})},L=(0,m.Z)(e=>({end:{padding:e.spacing(3)}}),{name:"SimpleStepperStep"});function P(e){const{title:s,children:l,end:u,actions:g,...x}=e,T=L();return u?_jsxs(Box,{className:T.end,children:[_jsx(Typography,{variant:"h6",children:s}),l,_jsx(SimpleStepperFooter,{actions:{...g||{},showNext:!1}})]}):_jsxs(MuiStep,{...x,children:[_jsx(StepLabel,{children:_jsx(Typography,{variant:"h6",children:s})}),_jsxs(StepContent,{children:[l,_jsx(SimpleStepperFooter,{actions:g})]})]})}const ae=(0,m.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 re(e){const s=ae(e);return _jsx(Typography,{component:"span",className:classNames(s.status,s.ok),"aria-label":"Status ok","aria-hidden":"true",...e})}function q(e){const s=ae(e);return _jsx(Typography,{component:"span",className:classNames(s.status,s.warning),"aria-label":"Status warning","aria-hidden":"true",...e})}function he(e){const s=ae(e);return _jsx(Typography,{component:"span",className:classNames(s.status,s.error),"aria-label":"Status error","aria-hidden":"true",...e})}function Ae(e){const s=ae(e);return _jsx(Typography,{component:"span",className:classNames(s.status,s.pending),"aria-label":"Status pending","aria-hidden":"true",...e})}function Le(e){const s=ae(e);return _jsx(Typography,{component:"span",className:classNames(s.status,s.running),"aria-label":"Status running","aria-hidden":"true",...e})}function ze(e){const s=ae(e);return _jsx(Typography,{component:"span",className:classNames(s.status,s.aborted),"aria-label":"Status aborted","aria-hidden":"true",...e})}var Ne=n(74600),We=n(15584);const it=e=>(0,er.Z)({root:{fontWeight:e.typography.fontWeightBold,whiteSpace:"nowrap",paddingRight:e.spacing(4),border:"0",verticalAlign:"top"}}),Et={root:{border:"0",verticalAlign:"top"}},Be=e=>(0,er.Z)({root:{margin:e.spacing(0,0,-1,0)}}),He=e=>(0,er.Z)({root:{padding:e.spacing(0,0,1,0)},random:{}}),At=(0,Nn.Z)(it,{name:"BackstageMetadataTableTitleCell"})(We.Z),rn=(0,Nn.Z)(Et,{name:"BackstageMetadataTableCell"})(We.Z),En=({dense:e,children:s})=>_jsx(Table,{size:e?"small":"medium",children:_jsx(TableBody,{children:s})}),Ot=({title:e,children:s,...l})=>_jsxs(TableRow,{children:[e&&_jsx(At,{children:e}),_jsx(rn,{colSpan:e?1:2,...l,children:s})]}),Rt=(0,Nn.Z)(Be,{name:"BackstageMetadataTableList"})(({classes:e,children:s})=>(0,r.jsx)(Pt.Z,{disablePadding:!0,className:e.root,children:s})),Kt=(0,Nn.Z)(He,{name:"BackstageMetadataTableListItem"})(({classes:e,children:s})=>(0,r.jsx)($t.Z,{className:e.root,children:s})),An=(0,er.Z)({root:{margin:"0 0",listStyleType:"none"}}),ur=e=>(0,er.Z)({root:{...An.root,paddingLeft:e.spacing(1)}}),Tr=(0,Nn.Z)(An,{name:"BackstageStructuredMetadataTableList"})(({classes:e,children:s})=>(0,r.jsx)(Rt,{classes:e,children:s})),Yr=(0,Nn.Z)(ur,{name:"BackstageStructuredMetadataTableNestedList"})(({classes:e,children:s})=>(0,r.jsx)(Rt,{classes:e,children:s}));function Wn(e,s){const l=e.map((u,g)=>_jsx(MetadataListItem,{children:kn(u)},g));return s?_jsx(Yr,{children:l}):_jsx(Tr,{children:l})}function fn(e,s,l){const u=Object.keys(e).map(g=>{const x=kn(e[g],!0),T=l&&l.titleFormat?l.titleFormat(g):startCase(g);return _jsxs(MetadataListItem,{children:[_jsx(Typography,{variant:"body2",component:"span",children:`${T}: `}),x]},g)});return s?_jsx(Yr,{children:u}):_jsx(Tr,{children:u})}function kn(e,s,l){return React.isValidElement(e)?_jsx(Fragment,{children:e}):typeof e=="object"&&!Array.isArray(e)?fn(e,s,l):Array.isArray(e)?Wn(e,l):typeof e=="boolean"?_jsx(Fragment,{children:e?"\u2705":"\u274C"}):_jsx(Typography,{variant:"body2",component:"span",children:e})}const yr=({value:e,options:s})=>_jsx(Fragment,{children:kn(e,s)}),ui=({title:e,value:s,options:l})=>_jsx(MetadataTableItem,{title:l&&l.titleFormat?l.titleFormat(e):startCase(e),children:_jsx(yr,{value:s,options:l})});function hi(e,s){return Object.keys(e).map(l=>_jsx(ui,{title:l,value:e[l],options:s},l))}function xa(e){const{metadata:s,dense:l=!0,options:u}=e,g=hi(s,u||{});return _jsx(MetadataTable,{dense:l,children:g})}var pi=n(49429),Is=n(86136),Ps=n(50758),go=n(79784),oo=n(76635),fi=n(19126),Ls=n.n(fi);function gi(e){return qs.stringify(e,{strictNullHandling:!0})}function Os(e){return qs.parse(e,{ignoreQueryPrefix:!0,strictNullHandling:!0})}function rs(e,s){return Os(e)[s]}function mo(e,s,l){const u={...Os(e),[s]:l};return gi(u)}function mi(e,s=250){const[l,u]=useSearchParams(),g=l.toString(),[x,T]=useState(rs(g,e));return useEffect(()=>{const $=rs(g,e);T(_=>isEqual($,_)?_:$)},[g,T,e]),useDebouncedEffect(()=>{const $=mo(g,e,x);g!==$&&u($,{replace:!0})},[u,x,g,e],s),[x,T]}const ks={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 vi(){var e;const u=(e=(0,p.I_)().get(p.Ds))===null||e===void 0?void 0:e.getOptionalConfig("app.support");if(!u)return ks;var g;return{url:u.getString("url"),items:u.getConfigArray("items").flatMap(x=>({title:x.getString("title"),icon:x.getOptionalString("icon"),links:((g=x.getOptionalConfigArray("links"))!==null&&g!==void 0?g:[]).flatMap(T=>({url:T.getString("url"),title:T.getString("title")}))}))}}var ko=n(80079);function or(e,s){const u=(0,p.qD)().getSystemIcon(e);return u?(0,r.jsx)(u,{...s}):(0,r.jsx)(ko.Z,{...s})}function ba(e){return or("brokenImage",e)}function Sa(e){return or("catalog",e)}function Ca(e){return or("chat",e)}function wa(e){return or("dashboard",e)}function ja(e){return or("docs",e)}function Ea(e){return or("email",e)}function Aa(e){return or("github",e)}function Ta(e){return or("group",e)}function vo(e){return or("help",e)}function Ra(e){return or("user",e)}function Ia(e){return or("warning",e)}const Bs=(0,m.Z)({popoverList:{minWidth:260,maxWidth:400}},{name:"BackstageSupportButton"}),Pa=({icon:e})=>{const s=(0,p.qD)();var l;const u=e&&(l=s.getSystemIcon(e))!==null&&l!==void 0?l:vo;return(0,r.jsx)(u,{})};var $s;const yi=({link:e})=>(0,r.jsx)(ce.r,{to:e.url,children:($s=e.title)!==null&&$s!==void 0?$s:e.url}),xi=({item:e})=>{var s;return(0,r.jsxs)(no.Z,{children:[(0,r.jsx)(Is.Z,{children:(0,r.jsx)(Pa,{icon:e.icon})}),(0,r.jsx)(Qt.Z,{primary:e.title,secondary:(s=e.links)===null||s===void 0?void 0:s.reduce((l,u,g)=>[...l,g>0&&(0,r.jsx)("br",{},g),(0,r.jsx)(yi,{link:u},u.url)],[])})]})};function bi(e){const{title:s,items:l,children:u}=e,{items:g}=vi(),[x,T]=(0,f.useState)(!1),[$,_]=(0,f.useState)(null),Q=Bs(),fe=(0,Se.Z)(Ie=>Ie.breakpoints.down("sm")),ge=Ie=>{_(Ie.currentTarget),T(!0)},Ze=()=>{T(!1)};return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(A.Z,{display:"flex",ml:1,children:fe?(0,r.jsx)(K.Z,{color:"primary",size:"small",onClick:ge,"data-testid":"support-button","aria-label":"Support",children:(0,r.jsx)(vo,{})}):(0,r.jsx)(ve.Z,{"data-testid":"support-button","aria-label":"Support",color:"primary",onClick:ge,startIcon:(0,r.jsx)(vo,{}),children:"Support"})}),(0,r.jsxs)(go.ZP,{"data-testid":"support-button-popover",open:x,anchorEl:$,anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"},onClose:Ze,children:[(0,r.jsxs)(Ps.Z,{className:Q.popoverList,autoFocusItem:Boolean($),children:[s&&(0,r.jsx)(no.Z,{alignItems:"flex-start",children:(0,r.jsx)(Ye.Z,{variant:"subtitle1",children:s})}),f.Children.map(u,(Ie,Ve)=>(0,r.jsx)(no.Z,{alignItems:"flex-start",children:Ie},`child-${Ve}`)),(l!=null?l:g).map((Ie,Ve)=>(0,r.jsx)(xi,{item:Ie},`item-${Ve}`))]}),(0,r.jsx)(pi.Z,{children:(0,r.jsx)(ve.Z,{color:"primary",onClick:Ze,"aria-label":"Close",children:"Close"})})]})]})}var os=n(18671),tr=n(73557),Bo=n(84800);const Si=(0,m.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 Ds(e){const{className:s,stretch:l,noPadding:u,children:g,...x}=e,T=Si();return(0,r.jsx)("article",{...x,className:on()(T.root,s,{[T.stretch]:l,[T.noPadding]:u}),children:g})}var La=n(6487),so=n(99152);const Ci=(0,m.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 Vn(e){const{tabs:s,onChange:l,selectedIndex:u}=e,[g,x]=(0,f.useState)(u!=null?u:0),T=Ci(),$=(0,f.useCallback)((_,Q)=>{u===void 0&&x(Q),l&&u!==Q&&l(Q)},[u,l]);return(0,f.useEffect)(()=>{u!==void 0&&x(u)},[u]),(0,r.jsx)(A.Z,{className:T.tabsWrapper,children:(0,r.jsx)(so.Z,{selectionFollowsFocus:!0,indicatorColor:"primary",textColor:"inherit",variant:"scrollable",scrollButtons:"auto","aria-label":"tabs",onChange:$,value:g,children:s.map((_,Q)=>(0,f.createElement)(La.Z,{..._.tabProps,"data-testid":`header-tab-${Q}`,label:_.label,key:_.id,value:Q,className:T.defaultTab,classes:{selected:T.selected,root:T.tabRoot}}))})})}function Oa(e){const s=(0,tr.UO)(),u=e.map(({path:Ze,children:Ie})=>({caseSensitive:!1,path:`${Ze}/*`,element:Ie})).sort((Ze,Ie)=>Ie.path.replace(/\/\*$/,"").localeCompare(Ze.path.replace(/\/\*$/,"")));var g;const x=(g=(0,tr.V$)(u))!==null&&g!==void 0?g:e[0].children;var T;let $=(T=s["*"])!==null&&T!==void 0?T:"";$.startsWith("/")||($=`/${$}`);var _;const[Q]=(_=(0,Bo.fp)(u,$))!==null&&_!==void 0?_:[],fe=Q?e.findIndex(Ze=>`${Ze.path}/*`===Q.route.path):0;var ge;return{index:fe===-1?0:fe,element:x,route:(ge=e[fe])!==null&&ge!==void 0?ge:e[0]}}function wi(e){const{routes:s}=e,l=(0,tr.s0)(),{index:u,route:g,element:x}=Oa(s),T=(0,f.useMemo)(()=>s.map(_=>({id:_.path,label:_.title,tabProps:_.tabProps})),[s]),$=_=>{let{path:Q}=s[_];Q=Q.replace(/\/\*$/,""),Q=Q.replace(/^\//,""),l(Q)};return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(Vn,{tabs:T,selectedIndex:u,onChange:$}),(0,r.jsxs)(Ds,{children:[(0,r.jsx)(os.q,{title:g.title}),x]})]})}const Ns=()=>null;(0,p.R5)(Ns,"core.gatherMountPoints",!0);function Fs(e){const s=(0,r.jsx)(Ns,{path:"",title:"",children:(0,r.jsx)("div",{})}).type;return f.Children.toArray(e).flatMap(l=>{if(!(0,f.isValidElement)(l))return[];if(l.type===f.Fragment)return Fs(l.props.children);if(l.type!==s)throw new Error("Child of TabbedLayout must be an TabbedLayout.Route");const{path:u,title:g,children:x,tabProps:T}=l.props;return[{path:u,title:g,children:x,tabProps:T}]})}function ka(e){const s=Fs(e.children);return(0,r.jsx)(wi,{routes:s})}ka.Route=Ns;const Ba=(0,m.Z)(e=>({value:{marginBottom:e.spacing(.75)},subvalue:{color:e.palette.textSubtle,fontWeight:"normal"}}),{name:"BackstageSubvalueCell"});function ss(e){const{value:s,subvalue:l}=e,u=Ba();return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(A.Z,{className:u.value,children:s}),(0,r.jsx)(A.Z,{className:u.subvalue,children:l})]})}var $o=n(67222),Do=n(21070),No=n(90324),Fo=n(98281),ji=n(48049),is=n(51209),as=n(33375),Ei=n(44233),Ai=n(27604),ls=n(36444),Ti=n(37971),Ri=n(59709),$a=n(17373),Ii=n(3702),Pi=n(93111);const cs=(0,m.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"}),Li=e=>{var s;const l=cs(),{onChangeFilters:u}=e,[g,x]=(0,f.useState)({...e.selectedFilters}),[T,$]=(0,f.useState)(!1),_=()=>{x({}),$(Q=>!Q)};return(0,f.useEffect)(()=>{u(g)},[g,u]),(0,r.jsxs)(A.Z,{className:l.root,children:[(0,r.jsxs)(A.Z,{className:l.header,children:[(0,r.jsx)(A.Z,{className:l.value,children:"Filters"}),(0,r.jsx)(ve.Z,{color:"primary",onClick:_,children:"Clear all"})]}),(0,r.jsx)(A.Z,{className:l.filters,children:((s=e.filters)===null||s===void 0?void 0:s.length)&&e.filters.map(Q=>(0,r.jsx)(Oo,{triggerReset:T,...Q.element,selected:g[Q.element.label],onChange:fe=>x({...g,[Q.element.label]:fe})},Q.element.label))})]})},Zs={Add:(0,f.forwardRef)((e,s)=>(0,r.jsx)(Do.Z,{...e,ref:s})),Check:(0,f.forwardRef)((e,s)=>(0,r.jsx)(Fo.Z,{...e,ref:s})),Clear:(0,f.forwardRef)((e,s)=>(0,r.jsx)(as.Z,{...e,ref:s})),Delete:(0,f.forwardRef)((e,s)=>(0,r.jsx)(Ei.Z,{...e,ref:s})),DetailPanel:(0,f.forwardRef)((e,s)=>(0,r.jsx)(is.Z,{...e,ref:s})),Edit:(0,f.forwardRef)((e,s)=>(0,r.jsx)(Ai.Z,{...e,ref:s})),Export:(0,f.forwardRef)((e,s)=>(0,r.jsx)(Ii.Z,{...e,ref:s})),Filter:(0,f.forwardRef)((e,s)=>(0,r.jsx)(ls.Z,{...e,ref:s})),FirstPage:(0,f.forwardRef)((e,s)=>(0,r.jsx)(Ti.Z,{...e,ref:s})),LastPage:(0,f.forwardRef)((e,s)=>(0,r.jsx)(Ri.Z,{...e,ref:s})),NextPage:(0,f.forwardRef)((e,s)=>(0,r.jsx)(is.Z,{...e,ref:s})),PreviousPage:(0,f.forwardRef)((e,s)=>(0,r.jsx)(ji.Z,{...e,ref:s})),ResetSearch:(0,f.forwardRef)((e,s)=>(0,r.jsx)(as.Z,{...e,ref:s})),Search:(0,f.forwardRef)((e,s)=>(0,r.jsx)(ls.Z,{...e,ref:s})),SortArrow:(0,f.forwardRef)((e,s)=>(0,r.jsx)(No.Z,{...e,ref:s})),ThirdStateCheck:(0,f.forwardRef)((e,s)=>(0,r.jsx)($a.Z,{...e,ref:s})),ViewColumn:(0,f.forwardRef)((e,s)=>(0,r.jsx)(Pi.Z,{...e,ref:s}))};function ds(e,s){const l=s.split(".");let u=e[l[0]];for(let g=1;g<l.length;++g){if(u===void 0)return u;const x=l[g];u=u[x]}return u}const Oi=(0,Nn.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"})($o.W$),Us=(0,Nn.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"})($o.UW),ki=(0,m.Z)(e=>({root:{display:"flex",alignItems:"center",justifyContent:"space-between"},title:{fontWeight:e.typography.fontWeightBold,fontSize:18,whiteSpace:"nowrap"}}),{name:"BackstageTableFiltersContainer"}),Bi=(0,m.Z)(()=>({root:{display:"flex",alignItems:"start"}}),{name:"BackstageTable"});function Da(e,s){return e.map(l=>{var u;const g=(u=l.headerStyle)!==null&&u!==void 0?u:{};let x=l.cellStyle||{};if(l.highlight)if(g.color=s.palette.textContrast,typeof x=="object")x.fontWeight=s.typography.fontWeightBold;else{const T=x;x=($,_,Q)=>({...T($,_,Q),fontWeight:s.typography.fontWeightBold})}return{...l,headerStyle:g,cellStyle:x}})}function $i(e,s){return(0,oo.transform)(e,(l,u,g)=>{(0,oo.isEqual)(u,s[g])||(l[g]=u)})}const Ms={search:"",filtersOpen:!1,filters:{}};function Di(e){const{toolbarRef:s,setSearch:l,hasFilters:u,selectedFiltersLength:g,toggleFilters:x}=e,T=ki(),$=(0,f.useCallback)(_=>{e.onSearchChanged(_),l(_)},[e,l]);return u?(0,r.jsxs)(A.Z,{className:T.root,children:[(0,r.jsxs)(A.Z,{className:T.root,children:[(0,r.jsx)(K.Z,{onClick:x,"aria-label":"filter list",children:(0,r.jsx)(ls.Z,{})}),(0,r.jsxs)(Ye.Z,{className:T.title,children:["Filters (",g,")"]})]}),(0,r.jsx)(Us,{...e,ref:s,onSearchChanged:$})]}):(0,r.jsx)(Us,{...e,ref:s,onSearchChanged:$})}function zs(e){var s,l;const{data:u,columns:g,options:x,title:T,subtitle:$,filters:_,initialState:Q,emptyContent:fe,onStateChange:ge,components:Ze,...Ie}=e,Ve=Bi(),pt=(0,se.Z)(),at={...Ms,...Q},[zt,Bn]=(0,f.useState)(at.filtersOpen),Hn=(0,f.useCallback)(()=>Bn(Qn=>!Qn),[Bn]),[kt,nn]=(0,f.useState)(0),[gn,Zn]=(0,f.useState)(u),[Un,ir]=(0,f.useState)(at.filters),Cr=Da(g,pt),[Qr,kr]=(0,f.useState)(at.search);(0,f.useEffect)(()=>{if(ge){const Qn=$i({search:Qr,filtersOpen:zt,filters:Un},Ms);ge(Qn)}},[Qr,zt,Un,ge]);const bs={headerStyle:{textTransform:"uppercase"}},dn=(0,f.useCallback)(Qn=>{var zr;return(zr=g.find(Br=>Br.title===Qn))===null||zr===void 0?void 0:zr.field},[g]);(0,f.useEffect)(()=>{if(typeof u=="function")return;if(!Un){Zn(u);return}const Qn=Object.values(Un);if(u&&Qn.flat().length){const zr=u.filter(Br=>!!Object.entries(Un).filter(([,wr])=>!!wr.length).every(([wr,Gn])=>{const ar=ds(Br,dn(wr));return Array.isArray(ar)&&Array.isArray(Gn)?ar.some(Wo=>Gn.includes(Wo)):Array.isArray(ar)?ar.includes(Gn):Array.isArray(Gn)?Gn.includes(ar):ar===Gn}));Zn(zr)}else Zn(u);nn(Qn.flat().length)},[u,Un,dn]);const zo=(Qn,zr)=>{const Br=Gn=>{const ar=new Set,Wo=ao=>{ao!=null&&ar.add(ao)};return zr&&zr.forEach(ao=>{const Xr=ds(ao,dn(Gn));Array.isArray(Xr)?Xr.forEach(Wo):Wo(Xr)}),ar},wr=Gn=>({placeholder:"All results",label:Gn.column,multiple:Gn.type==="multiple-select",items:[...Br(Gn.column)].sort().map(ar=>({label:ar,value:ar}))});return Qn.map(Gn=>({type:Gn.type,element:wr(Gn)}))},si=!!(!((s=_)===null||s===void 0)&&s.length),So=(0,f.useCallback)(Qn=>(0,r.jsx)(Di,{setSearch:kr,hasFilters:si,selectedFiltersLength:kt,toggleFilters:Hn,...Qn}),[Hn,si,kt,kr]),ii=typeof u!="function"&&u.length===0,ai=g.length,ya=(0,f.useCallback)(Qn=>fe&&ii?(0,r.jsx)("tbody",{children:(0,r.jsx)("tr",{children:(0,r.jsx)("td",{colSpan:ai,children:fe})})}):(0,r.jsx)($o.os,{...Qn}),[ii,fe,ai]);return(0,r.jsxs)(A.Z,{className:Ve.root,children:[zt&&u&&typeof u!="function"&&((l=_)===null||l===void 0?void 0:l.length)&&(0,r.jsx)(Li,{filters:zo(_,u),selectedFilters:Un,onChangeFilters:ir}),(0,r.jsx)($o.ZP,{components:{Header:Oi,Toolbar:So,Body:ya,...Ze},options:{...bs,...x},columns:Cr,icons:Zs,title:(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(Ye.Z,{variant:"h5",component:"h2",children:T}),$&&(0,r.jsx)(Ye.Z,{color:"textSecondary",variant:"body1",children:$})]}),data:typeof u=="function"?u:gn,style:{width:"100%"},localization:{toolbar:{searchPlaceholder:"Filter",searchTooltip:"Filter"}},...Ie})]})}zs.icons=Object.freeze(Zs);var Ni=n(44311);function us(e,s){const l=e[e.length-1];if(l)return l>=.9?s.palette.status.ok:l>=.5?s.palette.status.warning:s.palette.status.error}function Na(e){const s=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:us(e.data,s)})]})}const Fi=e=>(0,m.Z)(s=>({container:{width:"100%",display:"flex",flexDirection:"row",flexWrap:"wrap",justifyContent:"flex-end",alignItems:"center",marginBottom:s.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:s.spacing(1),minWidth:0,overflow:"visible"},description:{},title:{display:"inline-flex",marginBottom:0}}),{name:"BackstageContentHeader"}),Zi=({title:e="Unknown page",className:s})=>(0,r.jsx)(Ye.Z,{variant:"h4",component:"h2",className:s,"data-testid":"header-title",children:e});function Ui(e){const{description:s,title:l,titleComponent:u=void 0,children:g,textAlign:x="left"}=e,T=Fi({textAlign:x})(),$=u||(0,r.jsx)(Zi,{title:l,className:T.title});return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(os.q,{title:l}),(0,r.jsxs)(A.Z,{className:T.container,children:[(0,r.jsxs)(A.Z,{className:T.leftItemsBox,children:[$,s&&(0,r.jsx)(Ye.Z,{className:T.description,variant:"body2",children:s})]}),(0,r.jsx)(A.Z,{className:T.rightItemsBox,children:g})]})]})}var Fa=n.p+"static/mic-drop.fe3ef4d0..svg";const yo=(0,m.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"}),Za=()=>{const e=yo();return(0,r.jsx)("img",{src:Fa,className:e.micDrop,alt:"Girl dropping mic from her hands"})},Ua=(0,m.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 Ws(e){const{status:s,statusMessage:l,additionalInfo:u,supportUrl:g}=e,x=Ua(),T=(0,tr.s0)(),$=vi();return(0,r.jsxs)(Wt.Z,{container:!0,spacing:0,className:x.container,children:[(0,r.jsxs)(Wt.Z,{item:!0,xs:12,sm:8,md:4,children:[(0,r.jsxs)(Ye.Z,{"data-testid":"error",variant:"body1",className:x.subtitle,children:["ERROR ",s,": ",l]}),(0,r.jsx)(Ye.Z,{variant:"body1",className:x.subtitle,children:u}),(0,r.jsx)(Ye.Z,{variant:"h2",className:x.title,children:"Looks like someone dropped the mic!"}),(0,r.jsxs)(Ye.Z,{variant:"h6",children:[(0,r.jsx)(ce.r,{to:"#","data-testid":"go-back-link",onClick:()=>T(-1),children:"Go back"}),"... or please"," ",(0,r.jsx)(ce.r,{to:g||$.url,children:"contact support"})," if you think this is a bug."]})]}),(0,r.jsx)(Za,{})]})}var Ma=n(16173);const za=(0,Nn.Z)({root:{textDecoration:"underline",cursor:"pointer"}},{name:"BackstageBreadcrumbsClickableText"})(Ye.Z),hs=(0,Nn.Z)({root:{textDecoration:"underline",color:"inherit"}},{name:"BackstageBreadcrumbsStyledBox"})(A.Z);function Mi(e){const{children:s,...l}=e,[u,g]=f.useState(null),x=f.Children.toArray(s),[T,$,..._]=x,Q=_.length?_.pop():x[x.length-1],fe=x.length>3,ge=Ve=>{g(Ve.currentTarget)},Ze=()=>{g(null)},Ie=Boolean(u);return(0,r.jsxs)(f.Fragment,{children:[(0,r.jsxs)(Ma.Z,{"aria-label":"breadcrumb",...l,children:[x.length>1&&(0,r.jsx)(hs,{clone:!0,children:T}),x.length>2&&(0,r.jsx)(hs,{clone:!0,children:$}),fe&&(0,r.jsx)(za,{onClick:ge,children:"..."}),(0,r.jsx)(A.Z,{style:{fontStyle:"italic"},children:Q})]}),(0,r.jsx)(go.ZP,{open:Ie,anchorEl:u,onClose:Ze,anchorOrigin:{vertical:"bottom",horizontal:"left"},transformOrigin:{vertical:"top",horizontal:"left"},children:(0,r.jsx)(Pt.Z,{children:_.map((Ve,pt)=>(0,r.jsx)($t.Z,{button:!0,children:(0,r.jsx)(hs,{clone:!0,children:Ve})},pt))})})]})}const xo=72,zi=24,Wi=18,xr={drawerWidthClosed:xo,drawerWidthOpen:224,defaultOpenDelayMs:100,defaultCloseDelayMs:0,defaultFadeDuration:200,logoHeight:32,iconContainerWidth:xo,iconSize:xo-zi*2,iconPadding:zi,selectedIndicatorWidth:3,userBadgePadding:Wi,userBadgeDiameter:xo-Wi*2,mobileSidebarHeight:56},Vs=e=>({...xr,...e,iconContainerWidth:xr.drawerWidthClosed,iconSize:xr.drawerWidthClosed-xr.iconPadding*2,userBadgeDiameter:xr.drawerWidthClosed-xr.userBadgePadding*2}),Hs={drawerWidthClosed:0,drawerWidthOpen:202,defaultOpenDelayMs:xr.defaultOpenDelayMs+200},Vi=e=>({...Hs,...e}),ps="@backstage/core/sidebar-intro-dismissed",Rr=(0,f.createContext)({sidebarConfig:xr,submenuConfig:Hs}),Hi=(0,f.createContext)({isHoveredOn:!1,setIsHoveredOn:()=>{}});var Wa=n(50023),Va=n(4190),Gi=n(87685),Jn=n(44882),fs=n(51837);const Gs={isOpen:!1,setOpen:()=>{}},Ki=(0,f.createContext)(Gs),Yi=(0,fs.CT)("sidebar-open-state-context");function Ji(e){const{children:s,value:l}=e;return(0,r.jsx)(Ki.Provider,{value:l,children:(0,r.jsx)(Yi.Provider,{value:(0,fs.EI)({1:l}),children:s})})}const Ks=()=>{const e=(0,f.useContext)(Yi),s=(0,f.useContext)(Ki);if(e===void 0)return s||Gs;const l=e.atVersion(1);if(l===void 0)throw new Error("No context found for version 1.");return l};var Ha=n(57998),Ga=n(98864);const Qi={isPinned:!0,toggleSidebarPinState:()=>{},isMobile:!1},Xi=(0,f.createContext)(Qi),_i=(0,fs.CT)("sidebar-pin-state-context");function Ka(e){const{children:s,value:l}=e;return(0,r.jsx)(Xi.Provider,{value:l,children:(0,r.jsx)(_i.Provider,{value:(0,fs.EI)({1:l}),children:s})})}const gs=()=>{const e=(0,f.useContext)(_i),s=(0,f.useContext)(Xi);if(e===void 0)return s||Qi;const l=e.atVersion(1);if(l===void 0)throw new Error("No context found for version 1.");return l},Ya=(0,m.Z)(e=>({root:{flexGrow:0,margin:e.spacing(0,2),color:e.palette.navigation.color},selected:s=>({color:`${e.palette.navigation.selectedColor}!important`,borderTop:`solid ${s.sidebarConfig.selectedIndicatorWidth}px ${e.palette.navigation.indicator}`,marginTop:"-1px"}),label:{display:"none"}})),Ys=e=>{const{to:s,label:l,icon:u,value:g}=e,{sidebarConfig:x}=(0,f.useContext)(Rr),T=Ya({sidebarConfig:x}),$=(0,tr.TH)(),{selectedMenuItemIndex:_,setSelectedMenuItemIndex:Q}=(0,f.useContext)(Xs),fe=(Ze,Ie)=>{Q(Ie===_?-1:Ie)},ge=g===_&&_>=0||g!==_&&!(_>=0)&&s===$.pathname;return(0,r.jsx)(Ha.Z,{"aria-label":l,label:l,icon:u,component:Ga.rU,to:s||$.pathname,onChange:fe,value:g,selected:ge,classes:T})},Js=e=>{const{children:s,to:l,label:u,icon:g,value:x}=e,{isMobile:T}=gs();return T?(0,r.jsx)(Ys,{to:l,label:u,icon:g,value:x}):(0,r.jsx)(r.Fragment,{children:s})},Qs=(0,m.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","@media print":{display:"none"}},overlay:s=>({background:e.palette.navigation.background,width:"100%",bottom:`${s.sidebarConfig.mobileSidebarHeight}px`,height:`calc(100% - ${s.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:s=>({marginBottom:`${s.sidebarConfig.mobileSidebarHeight}px`})})),qi=e=>(0,oo.orderBy)(e,({props:{priority:s}})=>Number.isInteger(s)?s:-1,"desc"),ea=f.createElement(Js).type,ta=({children:e,label:s="Menu",open:l,onClose:u})=>{const{sidebarConfig:g}=(0,f.useContext)(Rr),x=Qs({sidebarConfig:g});return(0,r.jsxs)(Va.ZP,{anchor:"bottom",open:l,onClose:u,ModalProps:{BackdropProps:{classes:{root:x.marginMobileSidebar}}},classes:{root:x.marginMobileSidebar,paperAnchorBottom:x.overlay},children:[(0,r.jsxs)(A.Z,{className:x.overlayHeader,children:[(0,r.jsx)(Ye.Z,{variant:"h3",children:s}),(0,r.jsx)(K.Z,{onClick:u,classes:{root:x.overlayHeaderClose},children:(0,r.jsx)(Gi.Z,{})})]}),(0,r.jsx)(A.Z,{component:"nav",children:e})]})},Xs=(0,f.createContext)({selectedMenuItemIndex:-1,setSelectedMenuItemIndex:()=>{}}),na=e=>{const{sidebarConfig:s}=(0,f.useContext)(Rr),{children:l}=e,u=Qs({sidebarConfig:s}),g=(0,tr.TH)(),[x,T]=(0,f.useState)(-1);(0,f.useEffect)(()=>{T(-1)},[g.pathname]);let $=(0,p.vJ)(l,Q=>Q.getElements().filter(fe=>fe.type===ea));if(l)$.length?$=qi($):$.push((0,r.jsx)(Js,{icon:(0,r.jsx)(Jn.Z,{}),children:l},"default_menu"));else return null;const _=x>=0&&!$[x].props.to;return(0,r.jsx)(Ji,{value:{isOpen:!0,setOpen:()=>{}},children:(0,r.jsxs)(Xs.Provider,{value:{selectedMenuItemIndex:x,setSelectedMenuItemIndex:T},children:[(0,r.jsx)(ta,{label:$[x]&&$[x].props.label,open:_,onClose:()=>T(-1),children:$[x]&&$[x].props.children}),(0,r.jsx)(Wa.Z,{className:u.root,"data-testid":"mobile-sidebar-root",component:"nav",children:$})]})})};var Zo;(function(e){e.SIDEBAR_PIN_STATE="sidebarPinState"})(Zo||(Zo={}));const _s={getSidebarPinState(){let e;try{e=JSON.parse(window.localStorage.getItem(Zo.SIDEBAR_PIN_STATE)||"true")}catch{return!0}return!!e},setSidebarPinState(e){return window.localStorage.setItem(Zo.SIDEBAR_PIN_STATE,JSON.stringify(e))}},Ja=(0,m.Z)(e=>({root:{width:"100%",transition:"padding-left 0.1s ease-out",isolation:"isolate",[e.breakpoints.up("sm")]:{paddingLeft:s=>s.isPinned?s.sidebarConfig.drawerWidthOpen:s.sidebarConfig.drawerWidthClosed},[e.breakpoints.down("xs")]:{paddingBottom:s=>s.sidebarConfig.mobileSidebarHeight},"@media print":{padding:"0px !important"}},content:{zIndex:0,isolation:"isolate","&:focus":{outline:0}}}),{name:"BackstageSidebarPage"}),ei=(0,f.createContext)({content:{contentRef:void 0}});function ra(e){const[s,l]=(0,f.useState)(()=>_s.getSidebarPinState()),{sidebarConfig:u}=(0,f.useContext)(Rr),g=(0,f.useRef)(null),x=(0,f.useMemo)(()=>({content:{contentRef:g}}),[g]);(0,f.useEffect)(()=>{_s.setSidebarPinState(s)},[s]);const T=(0,Se.Z)(Q=>Q.breakpoints.down("xs"),{noSsr:!0}),$=()=>l(!s),_=Ja({isPinned:s,sidebarConfig:u});return(0,r.jsx)(Ka,{value:{isPinned:s,toggleSidebarPinState:$,isMobile:T},children:(0,r.jsx)(ei.Provider,{value:x,children:(0,r.jsx)(A.Z,{className:_.root,children:e.children})})})}function oa(){var e;const{content:s}=(0,f.useContext)(ei);return{focusContent:(0,f.useCallback)(()=>{var u,g,x;(x=s)===null||x===void 0||(g=x.contentRef)===null||g===void 0||(u=g.current)===null||u===void 0||u.focus()},[s]),contentRef:(e=s)===null||e===void 0?void 0:e.contentRef}}const ti=(0,m.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"},"@media print":{display:"none"}},drawerWidth:s=>({width:s.sidebarConfig.drawerWidthClosed}),drawerOpen:s=>({width:s.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 nr;(function(e){e[e.Closed=0]="Closed",e[e.Idle=1]="Idle",e[e.Open=2]="Open"})(nr||(nr={}));const sa=e=>{const{sidebarConfig:s}=(0,f.useContext)(Rr),{openDelayMs:l=s.defaultOpenDelayMs,closeDelayMs:u=s.defaultCloseDelayMs,disableExpandOnHover:g,children:x}=e,T=ti({sidebarConfig:s}),$=(0,Se.Z)(zt=>zt.breakpoints.down("md"),{noSsr:!0}),[_,Q]=(0,f.useState)(nr.Closed),fe=(0,f.useRef)(),{isPinned:ge,toggleSidebarPinState:Ze}=gs(),Ie=()=>{ge||g||(fe.current&&(clearTimeout(fe.current),fe.current=void 0),_!==nr.Open&&!$&&(fe.current=window.setTimeout(()=>{fe.current=void 0,Q(nr.Open)},l),Q(nr.Idle)))},Ve=()=>{ge||g||(fe.current&&(clearTimeout(fe.current),fe.current=void 0),_===nr.Idle?Q(nr.Closed):_===nr.Open&&(fe.current=window.setTimeout(()=>{fe.current=void 0,Q(nr.Closed)},u)))},pt=_===nr.Open&&!$||ge,at=zt=>{zt?(Q(nr.Open),Ze()):(Q(nr.Closed),Ze())};return(0,r.jsxs)("nav",{style:{},"aria-label":"sidebar nav",children:[(0,r.jsx)(aa,{}),(0,r.jsx)(Ji,{value:{isOpen:pt,setOpen:at},children:(0,r.jsx)(A.Z,{className:T.root,"data-testid":"sidebar-root",onMouseEnter:g?()=>{}:Ie,onFocus:g?()=>{}:Ie,onMouseLeave:g?()=>{}:Ve,onBlur:g?()=>{}:Ve,children:(0,r.jsx)(A.Z,{className:on()(T.drawer,T.drawerWidth,{[T.drawerOpen]:pt}),children:x})})})]})},ia=e=>{var s;const l=Vs((s=e.sidebarOptions)!==null&&s!==void 0?s:{});var u;const g=Vi((u=e.submenuOptions)!==null&&u!==void 0?u:{}),{children:x,disableExpandOnHover:T,openDelayMs:$,closeDelayMs:_}=e,{isMobile:Q}=gs();return Q?(0,r.jsx)(na,{children:x}):(0,r.jsx)(Rr.Provider,{value:{sidebarConfig:l,submenuConfig:g},children:(0,r.jsx)(sa,{openDelayMs:$,closeDelayMs:_,disableExpandOnHover:T,children:x})})};function aa(){var e;const{sidebarConfig:s}=(0,f.useContext)(Rr),{focusContent:l,contentRef:u}=oa(),g=ti({sidebarConfig:s});return!((e=u)===null||e===void 0)&&e.current?(0,r.jsx)(ve.Z,{onClick:l,variant:"contained",className:on()(g.visuallyHidden),children:"Skip to content"}):null}function ni(e,s,l=!1){const u=new URLSearchParams(s.search).toString(),g=Ls().parse(u),x=new URLSearchParams(e.search).toString(),T=Ls().parse(x),$=l?oo.isEqual:oo.isMatch;return(0,oo.isEqual)(s.pathname,e.pathname)&&$(T,g)}const la=(0,m.Z)(e=>{var s,l;return{item:{height:48,width:"100%","&:hover":{background:((s=e.palette.navigation.navItem)===null||s===void 0?void 0:s.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"}),Ir=e=>{const{title:s,subtitle:l,to:u,icon:g,dropdownItems:x,exact:T}=e,$=la(),{setIsHoveredOn:_}=useContext(SidebarItemWithSubmenuContext),Q=()=>{_(!1)},fe=useResolvedPath(u!=null?u:""),ge=useLocation();let Ze=isLocationMatch(ge,fe,T);const[Ie,Ve]=useState(!1),pt=()=>{Ve(!Ie)};return x!==void 0?(x.some(at=>{const zt=resolvePath(at.to);return Ze=isLocationMatch(ge,zt,T),Ze}),_jsxs(Box,{className:$.itemContainer,children:[_jsx(Tooltip,{title:s,enterDelay:500,enterNextDelay:500,children:_jsxs(Button,{role:"button",onClick:pt,onTouchStart:at=>at.stopPropagation(),className:classnames($.item,Ze?$.selected:void 0),children:[g&&_jsx(g,{fontSize:"small"}),_jsxs(Typography,{variant:"subtitle1",component:"span",className:$.label,children:[s,_jsx("br",{}),l&&_jsx(Typography,{variant:"caption",component:"span",className:$.subtitle,children:l})]}),Ie?_jsx(ArrowDropUpIcon,{className:$.dropdownArrow}):_jsx(ArrowDropDownIcon,{className:$.dropdownArrow})]})}),x&&Ie&&_jsx(Box,{className:$.dropdown,children:x.map((at,zt)=>_jsx(Tooltip,{title:at.title,enterDelay:500,enterNextDelay:500,children:_jsx(Link,{to:at.to,underline:"none",className:$.dropdownItem,onClick:Q,onTouchStart:Bn=>Bn.stopPropagation(),children:_jsx(Typography,{component:"span",className:$.textContent,children:at.title})})},zt))})]})):_jsx(Box,{className:$.itemContainer,children:_jsx(Tooltip,{title:s,enterDelay:500,enterNextDelay:500,children:_jsxs(Link,{to:u,underline:"none",className:classnames($.item,Ze?$.selected:void 0),onClick:Q,onTouchStart:at=>at.stopPropagation(),children:[g&&_jsx(g,{fontSize:"small"}),_jsxs(Typography,{variant:"subtitle1",component:"span",className:$.label,children:[s,_jsx("br",{}),l&&_jsx(Typography,{variant:"caption",component:"span",className:$.subtitle,children:l})]})]})})})};var ms;const ca=(0,m.Z)(e=>({root:{zIndex:1e3,position:"relative",overflow:"visible",width:e.spacing(7)+1},drawer:s=>{var l;return{display:"flex",flexFlow:"column nowrap",alignItems:"flex-start",position:"fixed",[e.breakpoints.up("sm")]:{marginLeft:s.left,transition:e.transitions.create("margin-left",{easing:e.transitions.easing.sharp,duration:e.transitions.duration.shortest})},top:0,bottom:0,padding:0,background:(ms=(l=e.palette.navigation.submenu)===null||l===void 0?void 0:l.background)!==null&&ms!==void 0?ms:"#404040",overflowX:"hidden",msOverflowStyle:"none",scrollbarWidth:"none",cursor:"default",width:s.submenuConfig.drawerWidthClosed,transitionDelay:`${s.submenuConfig.defaultOpenDelayMs}ms`,"& > *":{flexShrink:0},"&::-webkit-scrollbar":{display:"none"}}},drawerOpen:s=>({width:s.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"}),da=e=>{const{isOpen:s}=Ks(),{sidebarConfig:l,submenuConfig:u}=(0,f.useContext)(Rr),g=s?l.drawerWidthOpen:l.drawerWidthClosed,x=ca({left:g,submenuConfig:u}),{isHoveredOn:T}=(0,f.useContext)(Hi),[$,_]=(0,f.useState)(!1);return(0,f.useEffect)(()=>{_(T)},[T]),(0,r.jsxs)(A.Z,{className:on()(x.drawer,{[x.drawerOpen]:$}),children:[(0,r.jsx)(Ye.Z,{variant:"h5",component:"span",className:x.title,children:e.title}),e.children]})};var ri=n(26739),Uo=n(76600),ua=n(83543),ha=n(59797),oi=n(98989);const Qa=(0,m.Z)({iconContainer:{display:"flex",position:"relative",width:"100%"},arrow1:{right:"6px",position:"absolute"}}),Xa=()=>{const e=Qa();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 i=null;const t=(0,m.Z)({iconContainer:{display:"flex",position:"relative",width:"100%"},arrow1:{right:"6px",position:"absolute"}}),o=()=>{const e=t();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 a=null,d,b;const B=e=>(0,m.Z)(s=>{var l,u;return{root:{color:s.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:{[s.breakpoints.up("sm")]:{width:e.drawerWidthOpen}},highlightable:{"&:hover":{background:(d=(l=s.palette.navigation.navItem)===null||l===void 0?void 0:l.hoverBackground)!==null&&d!==void 0?d:"#404040"}},highlighted:{background:(b=(u=s.palette.navigation.navItem)===null||u===void 0?void 0:u.hoverBackground)!==null&&b!==void 0?b:"#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:-s.spacing(2),display:"flex",alignItems:"center",justifyContent:"center",lineHeight:"0"},searchRoot:{marginBottom:12},searchField:{color:"#b5b5b5",fontWeight:s.typography.fontWeightBold,fontSize:s.typography.fontSize},searchFieldHTMLInput:{padding:s.spacing(2,0,2)},searchContainer:{width:e.drawerWidthOpen-e.iconContainerWidth},secondaryAction:{width:s.spacing(6),textAlign:"center",marginRight:s.spacing(1)},closedItemIcon:{width:"100%",justifyContent:"center"},submenuArrow:{display:"flex"},expandButton:{background:"none",border:"none",color:s.palette.navigation.color,width:"100%",cursor:"pointer",position:"relative",height:48},arrows:{position:"absolute",right:10},selected:{"&$root":{borderLeft:`solid ${e.selectedIndicatorWidth}px ${s.palette.navigation.indicator}`,color:s.palette.navigation.selectedColor},"&$closed":{width:e.drawerWidthClosed},"& $closedItemIcon":{paddingRight:e.selectedIndicatorWidth},"& $iconContainer":{marginLeft:-e.selectedIndicatorWidth}}}},{name:"BackstageSidebarItem"});function Z(e){return(0,f.useMemo)(()=>B(e),[e])()}const oe=(e,s)=>(0,p.vJ)(e.props.children,l=>{let u=!1;return l.getElements().forEach(({props:{to:g,dropdownItems:x}})=>{if(!u){var T;if(!((T=x)===null||T===void 0)&&T.length){x.forEach(({to:$})=>u=u||ni(s,(0,Bo.i3)($)));return}g&&(u=ni(s,(0,Bo.i3)(g)))}}),u},[s.pathname]);function me(e){return e.to===void 0}const Me=f.createElement(da).type,Te=f.forwardRef(function({to:s,end:l,style:u,className:g,activeStyle:x,caseSensitive:T,activeClassName:$="active","aria-current":_="page",...Q},fe){let{pathname:ge}=(0,tr.TH)(),{pathname:Ze}=(0,tr.WU)(s);T||(ge=ge.toLocaleLowerCase("en-US"),Ze=Ze.toLocaleLowerCase("en-US"));let Ie=ge===Ze;!Ie&&!l&&(Ie=ge.startsWith(`${Ze}/`));const Ve=Ie?_:void 0;return(0,r.jsx)(k.rU,{...Q,to:s,ref:fe,"aria-current":Ve,style:{...u,...Ie?x:void 0},className:on()([g,Ie?$:void 0])})}),Fe=(0,f.forwardRef)((e,s)=>{const{icon:l,text:u,hasNotifications:g=!1,hasSubmenu:x=!1,disableHighlight:T=!1,onClick:$,noTrack:_,children:Q,className:fe,...ge}=e,{sidebarConfig:Ze}=(0,f.useContext)(Rr),Ie=Z(Ze),{isOpen:Ve}=Ks(),pt=!Ve&&x?{display:"flex",marginLeft:"20px"}:{lineHeight:"0"},at=(0,r.jsxs)(A.Z,{style:pt,children:[(0,r.jsx)(l,{fontSize:"small"}),!Ve&&x?(0,r.jsx)(oi.Z,{fontSize:"small"}):(0,r.jsx)(r.Fragment,{})]}),zt=(0,r.jsx)(ri.Z,{color:"secondary",variant:"dot",overlap:"circular",invisible:!g,className:on()({[Ie.closedItemIcon]:!Ve}),children:at}),Bn=(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(A.Z,{"data-testid":"login-button",className:Ie.iconContainer,children:zt}),u&&(0,r.jsx)(Ye.Z,{variant:"subtitle2",component:"span",className:Ie.label,children:u}),(0,r.jsx)("div",{className:Ie.secondaryAction,children:Q})]}),Hn=Ve?Bn:zt,kt={onClick:$,className:on()(fe,Ie.root,Ve?Ie.open:Ie.closed,me(e)&&Ie.buttonItem,{[Ie.highlightable]:!T})},nn=(0,p.z$)(),{pathname:gn}=(0,tr.WU)(!me(e)&&e.to?e.to:""),Zn=(0,f.useCallback)(Un=>{var ir;if(!_){const Cr="click",Qr=u!=null?u:"Sidebar Item",kr=gn?{attributes:{to:gn}}:void 0;nn.captureEvent(Cr,Qr,kr)}(ir=$)===null||ir===void 0||ir(Un)},[nn,u,gn,_,$]);return me(e)?(0,r.jsx)(ve.Z,{role:"button","aria-label":u,...kt,ref:s,onClick:Zn,children:Hn}):(0,r.jsx)(Te,{...kt,activeClassName:Ie.selected,to:e.to?e.to:"",ref:s,"aria-label":u||e.to,...ge,onClick:Zn,children:Hn})}),Je=({children:e,...s})=>{const{sidebarConfig:l}=(0,f.useContext)(Rr),u=Z(l),[g,x]=(0,f.useState)(!1),T=(0,tr.TH)(),$=oe(e,T),_=(0,Se.Z)(Ze=>Ze.breakpoints.down("sm")),Q=()=>{x(!0)},fe=()=>{x(!1)},ge=()=>_?g?(0,r.jsx)(ha.Z,{fontSize:"small",className:u.submenuArrow}):(0,r.jsx)(ua.Z,{fontSize:"small",className:u.submenuArrow}):!g&&(0,r.jsx)(oi.Z,{fontSize:"small",className:u.submenuArrow});return(0,r.jsx)(Hi.Provider,{value:{isHoveredOn:g,setIsHoveredOn:x},children:(0,r.jsxs)("div",{"data-testid":"item-with-submenu",onMouseLeave:fe,onTouchStart:g?fe:Q,onMouseEnter:Q,className:on()(g&&u.highlighted),children:[(0,r.jsx)(Fe,{hasSubmenu:!0,className:$?u.selected:"",...s,children:ge()}),g&&e]})})},st=(0,f.forwardRef)((e,s)=>{const[l]=(0,p.vJ)(e.children,u=>u.getElements().filter(g=>g.type===Me));return l?(0,r.jsx)(Je,{...e,children:l}):(0,r.jsx)(Fe,{...e,ref:s})});function tn(e){const{sidebarConfig:s}=useContext(SidebarConfigContext),[l,u]=useState(""),g=Z(s),x=e.icon?e.icon:SearchIcon,T=()=>{e.onSearch(l),u("")},$=ge=>{ge.key==="Enter"&&(ge.preventDefault(),T())},_=ge=>{u(ge.target.value)},Q=ge=>{ge.preventDefault(),ge.stopPropagation()},fe=ge=>{T(),ge.preventDefault()};return _jsx(Box,{className:g.searchRoot,children:_jsx(st,{icon:x,to:e.to,onClick:fe,disableHighlight:!0,children:_jsx(TextField,{placeholder:"Search",value:l,onClick:Q,onChange:_,onKeyDown:$,className:g.searchContainer,InputProps:{disableUnderline:!0,className:g.searchField},inputProps:{className:g.searchFieldHTMLInput}})})})}const Vt=(0,Uo.Z)("div")({flex:1},{name:"BackstageSidebarSpace"}),rr=(0,Uo.Z)("div")({height:8},{name:"BackstageSidebarSpacer"}),Mr=(0,Uo.Z)("hr")(({theme:e})=>({height:1,width:"100%",background:"#383838",border:"none",margin:e.spacing(1.2,0)}),{name:"BackstageSidebarDivider"}),hr=e=>({overflowY:"auto","&::-webkit-scrollbar":{backgroundColor:e.palette.background.default,width:"5px",borderRadius:"5px"},"&::-webkit-scrollbar-thumb":{backgroundColor:e.palette.text.secondary,borderRadius:"5px"}}),br=(0,Uo.Z)("div")(({theme:e})=>{const s=hr(e);return{flex:"0 1 auto",overflowX:"hidden",width:"calc(100% - 5px)",minHeight:"48px",overflowY:"hidden","@media (hover: none)":s,"&:hover":s}}),Sr=()=>{const{sidebarConfig:e}=useContext(SidebarConfigContext),s=Z(e),{isOpen:l,setOpen:u}=useSidebarOpenState();if(useMediaQuery(T=>T.breakpoints.down("md"),{noSsr:!0}))return null;const x=()=>{u(!l)};return _jsx(Button,{role:"button",onClick:x,className:s.expandButton,"aria-label":"Expand Sidebar","data-testid":"sidebar-expand-button",children:_jsx(Box,{className:s.arrows,children:l?_jsx(DoubleArrowLeft,{}):_jsx(DoubleArrowRight,{})})})},Fn=(0,m.Z)(e=>({introCard:s=>({color:"#b5b5b5",fontSize:12,width:s.sidebarConfig.drawerWidthOpen,marginTop:e.spacing(2.25),marginBottom:e.spacing(1.5),paddingLeft:s.sidebarConfig.iconPadding,paddingRight:s.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 Pr(e){const{sidebarConfig:s}=useContext(SidebarConfigContext),l=Fn({sidebarConfig:s}),{text:u,onClose:g}=e,x=()=>g();return _jsxs(Box,{className:l.introCard,children:[_jsx(Typography,{variant:"subtitle2",children:u}),_jsx(Box,{className:l.introDismiss,children:_jsxs(IconButton,{onClick:x,className:l.introDismissLink,children:[_jsx(CloseIcon,{className:l.introDismissIcon}),_jsx(Typography,{component:"span",className:l.introDismissText,children:"Dismiss"})]})})]})}const Lr=e=>{const{text:s,onDismiss:l}=e,[u,g]=useState(!1),x=()=>{g(!0)};return _jsx(Collapse,{in:!u,onExited:l,children:_jsx(Pr,{text:s,onClose:x})})},Or=null,Pn="And your recently viewed plugins will pop up here!";function Jr(e){const{isOpen:s}=useSidebarOpenState(),l={starredItemsDismissed:!1,recentlyViewedItemsDismissed:!1},{value:u,set:g}=useLocalStorageValue(SIDEBAR_INTRO_LOCAL_STORAGE),{starredItemsDismissed:x,recentlyViewedItemsDismissed:T}=u!=null?u:{},$=()=>{g(Q=>({...l,...Q,starredItemsDismissed:!0}))},_=()=>{g(Q=>({...l,...Q,recentlyViewedItemsDismissed:!0}))};return s?_jsxs(_Fragment,{children:[!x&&_jsxs(_Fragment,{children:[_jsx(Lr,{text:Or,onDismiss:$}),_jsx(SidebarDivider,{})]}),!T&&_jsx(Lr,{text:Pn,onDismiss:_})]}):null}const bo=(0,m.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"}),pa=({type:e,typeLink:s,classes:l,pageTitle:u})=>e?s?(0,r.jsxs)(Mi,{className:l.breadcrumb,children:[(0,r.jsx)(ce.r,{to:s,children:e}),(0,r.jsx)(Ye.Z,{children:u})]}):(0,r.jsx)(Ye.Z,{className:l.type,children:e}):null,io=({pageTitle:e,classes:s,tooltip:l})=>{const{contentRef:u}=oa(),g=(0,r.jsx)(Ye.Z,{ref:u,tabIndex:-1,className:s.title,variant:"h1",children:e});return l?(0,r.jsx)(R.ZP,{title:l,placement:"top-start",children:g}):g},fa=({classes:e,subtitle:s})=>s?typeof s!="string"?(0,r.jsx)(r.Fragment,{children:s}):(0,r.jsx)(Ye.Z,{className:e.subtitle,variant:"subtitle2",component:"span",children:s}):null;function vs(e){const{children:s,pageTitleOverride:l,style:u,subtitle:g,title:x,tooltip:T,type:$,typeLink:_}=e,Q=bo(),ge=(0,p.h_)(p.Ds).getOptionalString("app.title")||"Backstage",Ze=l||x,Ie=x||l,Ve=`${Ze} | %s | ${ge}`,pt=`${Ze} | ${ge}`;return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(os.q,{titleTemplate:Ve,defaultTitle:pt}),(0,r.jsxs)("header",{style:u,className:Q.header,children:[(0,r.jsxs)(A.Z,{className:Q.leftItemsBox,children:[(0,r.jsx)(pa,{classes:Q,type:$,typeLink:_,pageTitle:Ie}),(0,r.jsx)(io,{classes:Q,pageTitle:Ie,tooltip:T}),(0,r.jsx)(fa,{classes:Q,subtitle:g})]}),(0,r.jsx)(Wt.Z,{container:!0,className:Q.rightItemsBox,spacing:4,children:s})]})]})}const sl=({label:e,secondaryLabel:s,icon:l,disabled:u=!1,onClick:g})=>_jsx(Fragment,{children:_jsxs(ListItem,{"data-testid":"header-action-item",disabled:u,button:!0,onClick:x=>{g&&g(x)},children:[l&&_jsx(ListItemIcon,{children:l}),_jsx(ListItemText,{primary:e,secondary:s})]})});function Nl(e){const{palette:{common:{white:s}}}=useTheme(),{actionItems:l}=e,[u,g]=React.useState(!1),x=React.useRef(null);return _jsxs(Fragment,{children:[_jsx(IconButton,{onClick:()=>g(!0),"data-testid":"header-action-menu",ref:x,style:{color:s,height:56,width:56,marginRight:-4,padding:0},children:_jsx(MoreVert,{})}),_jsx(Popover,{open:u,anchorEl:x.current,anchorOrigin:{horizontal:"right",vertical:"bottom"},transformOrigin:{horizontal:"right",vertical:"top"},onClose:()=>g(!1),children:_jsx(List,{children:l.map((T,$)=>_jsx(sl,{...T},`header-action-menu-${$}`))})})]})}const il=(0,m.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,Xt.Fq)(e.page.fontColor,.8),fontSize:e.typography.fontSize,lineHeight:1}}),{name:"BackstageHeaderLabel"}),al=({value:e,className:s})=>(0,r.jsx)(Ye.Z,{component:typeof e=="string"?"p":"span",className:s,children:e});function ll(e){const{label:s,value:l,url:u}=e,g=il(),x=(0,r.jsx)(al,{className:g.value,value:l||"<Unknown>"});return(0,r.jsx)(Wt.Z,{item:!0,children:(0,r.jsxs)(Ye.Z,{component:"span",className:g.root,children:[(0,r.jsx)(Ye.Z,{className:g.label,children:s}),u?(0,r.jsx)(ce.r,{to:u,children:x}):x]})})}const cl=e=>(0,er.Z)({root:{color:e.palette.common.white,padding:e.spacing(2,2,3),backgroundImage:e.getPageTheme({themeId:"card"}).backgroundImage,backgroundPosition:0,backgroundSize:"inherit"}}),dl=(0,m.Z)(cl,{name:"BackstageItemCardHeader"});function ul(e){const{title:s,subtitle:l,children:u}=e,g=dl(e);return(0,r.jsxs)(A.Z,{className:g.root,children:[l&&(0,r.jsx)(Ye.Z,{variant:"subtitle2",component:"h3",children:l}),s&&(0,r.jsx)(Ye.Z,{variant:"h6",component:"h4",children:s}),u]})}function Fl(e){var s;const{description:l,tags:u,title:g,type:x,subtitle:T,label:$,onClick:_,href:Q}=e;return _jsxs(Card,{children:[_jsx(CardMedia,{children:_jsx(ItemCardHeader,{title:g,subtitle:T||x})}),_jsxs(CardContent,{children:[!((s=u)===null||s===void 0)&&s.length?_jsx(Box,{children:u.map((fe,ge)=>_jsx(Chip,{size:"small",label:fe},ge))}):null,l]}),_jsxs(CardActions,{children:[!Q&&_jsx(LinkButton,{to:"#",onClick:_,color:"primary",children:$}),Q&&_jsx(LinkButton,{to:Q,color:"primary",children:$})]})]})}const hl=e=>(0,er.Z)({root:{display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(22em, 1fr))",gridAutoRows:"1fr",gridGap:e.spacing(2)}}),pl=(0,m.Z)(hl,{name:"BackstageItemCardGrid"});function fl(e){const{children:s,...l}=e,u=pl(l);return(0,r.jsx)(A.Z,{className:u.root,...l,children:s})}var gl=n(41547);const ml=(0,m.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%"},"@media print":{display:"block",height:"auto",overflowY:"inherit"}}}),{name:"BackstagePage"});function _a(e){const{themeId:s,children:l}=e,u=ml();return(0,r.jsx)(gl.Z,{theme:g=>({...g,page:g.getPageTheme({themeId:s})}),children:(0,r.jsx)("main",{className:u.root,children:l})})}function vl(e){const{themeId:s,children:l,...u}=e;return(0,r.jsxs)(_a,{themeId:s,children:[(0,r.jsx)(vs,{...u}),l]})}var sr=n(30195);const Zl=sr.z.object({providerInfo:sr.z.object({}).catchall(sr.z.unknown()).optional(),profile:sr.z.object({email:sr.z.string().optional(),displayName:sr.z.string().optional(),picture:sr.z.string().optional()}),backstageIdentity:sr.z.object({token:sr.z.string(),identity:sr.z.object({type:sr.z.literal("user"),userEntityRef:sr.z.string(),ownershipEntityRefs:sr.z.array(sr.z.string())})})}),qa={defaultTokenExpiryMillis:5*60*1e3,tokenExpiryMarginMillis:5*60*1e3};function yl(e){const s=new Date(Date.now()+qa.defaultTokenExpiryMillis);if(!e)return s;const[l,u,g]=e.split("."),x=JSON.parse(window.atob(u));return typeof x.exp!="number"?s:new Date(x.exp*1e3-qa.tokenExpiryMarginMillis)}class Ul{async start(){await this.getSessionAsync()}getUserId(){const{backstageIdentity:s}=this.getSessionSync(),l=s.identity.userEntityRef,u=/^([^:/]+:)?([^:/]+\/)?([^:/]+)$/.exec(l);if(!u)throw new TypeError(`Invalid user entity reference "${l}"`);return u[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 s=this.state.type==="active"?this.state.session:void 0,l=this.fetchSession().then(u=>(this.state={type:"active",session:u,expiresAt:yl(u.backstageIdentity.token)},u),u=>{throw this.state={type:"failed",error:u},u});return this.state={type:"fetching",promise:l,previous:s},l}async fetchSession(){const s=await this.options.discoveryApi.getBaseUrl("auth"),l=typeof this.options.headers=="function"?await this.options.headers():this.options.headers,u=new Headers(l);u.set("X-Requested-With","XMLHttpRequest");const g=await fetch(`${s}/${this.options.provider}/refresh`,{signal:this.abortController.signal,headers:u,credentials:"include"});if(!g.ok)throw await ResponseError.fromResponse(g);return proxiedSessionSchema.parse(await g.json())}constructor(s){_define_property(this,"options",void 0),_define_property(this,"abortController",void 0),_define_property(this,"state",void 0),this.options=s,this.abortController=new AbortController,this.state={type:"empty"}}}const Ml=e=>{const s=useApi(discoveryApiRef),[{status:l,error:u},{execute:g}]=useAsync(async()=>{const x=new ProxiedSignInIdentity({provider:e.provider,discoveryApi:s,headers:e.headers});await x.start(),e.onSignInSuccess(x)});return useMountEffect(g),l==="loading"?_jsx(Progress,{}):u?_jsx(ErrorPanel,{title:"You do not appear to be signed in. Please try reloading the browser page.",error:u}):null},xl=(0,m.Z)({container:{padding:0,listStyle:"none"},item:{display:"flex",flexDirection:"column",width:"100%",maxWidth:"400px",margin:0,padding:0}},{name:"BackstageSignInPage"}),ga=({children:e})=>{const s=xl();return(0,r.jsx)(Wt.Z,{component:"li",item:!0,classes:s,children:e})};var ys=n(87612);class ma{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 s="user:default/guest";return{type:"user",userEntityRef:s,ownershipEntityRefs:[s]}}async getCredentials(){return{}}async signOut(){}}function bl(e){const[s,l,u]=e.split(".");return JSON.parse(window.atob(l))}class va{getUserId(){return this.result.userId}static fromResult(s){return new va(s)}async getIdToken(){var s,l;return(s=(l=this.result).getIdToken)===null||s===void 0?void 0:s.call(l)}getProfile(){return this.result.profile}async getProfileInfo(){return this.result.profile}async getBackstageIdentity(){const s=await this.getIdToken();if(!s){const g=`user:default/${this.getUserId()}`;return{type:"user",userEntityRef:g,ownershipEntityRefs:[g]}}const{sub:l,ent:u}=bl(s);return{type:"user",userEntityRef:l,ownershipEntityRefs:u!=null?u:[]}}async getCredentials(){var s,l;return{token:await((s=(l=this.result).getIdToken)===null||s===void 0?void 0:s.call(l))}}async signOut(){var s,l;return(s=(l=this.result).signOut)===null||s===void 0?void 0:s.call(l)}constructor(s){(0,ys._)(this,"result",void 0),this.result=s}}class xs{static createGuest(){return new ma}static fromLegacy(s){return va.fromResult(s)}static create(s){return new xs(s.identity,s.authApi,s.profile)}getUserId(){const s=this.identity.userEntityRef,l=/^([^:/]+:)?([^:/]+\/)?([^:/]+)$/.exec(s);if(!l)throw new TypeError(`Invalid user entity reference "${s}"`);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(s){throw this.profilePromise=void 0,s}}async getBackstageIdentity(){return this.identity}async getCredentials(){return{token:(await this.authApi.getBackstageIdentity()).token}}async signOut(){return this.authApi.signOut()}constructor(s,l,u){(0,ys._)(this,"identity",void 0),(0,ys._)(this,"authApi",void 0),(0,ys._)(this,"profile",void 0),(0,ys._)(this,"profilePromise",void 0),this.identity=s,this.authApi=l,this.profile=u}}const Sl={Component:({config:e,onSignInStarted:s,onSignInSuccess:l,onSignInFailure:u})=>{const{apiRef:g,title:x,message:T}=e,$=(0,p.h_)(g),_=(0,p.h_)(p.VE),Q=async()=>{try{s();const fe=await $.getBackstageIdentity({instantPopup:!0});if(!fe)throw u(),new Error(`The ${x} provider is not configured to support sign-in`);const ge=await $.getProfile();l(xs.create({identity:fe.identity,profile:ge,authApi:$}))}catch(fe){u(),_.post(new lo.SP("Login failed",fe))}};return(0,r.jsx)(ga,{children:(0,r.jsx)(Ur,{variant:"fullHeight",title:x,actions:(0,r.jsx)(ve.Z,{color:"primary",variant:"outlined",onClick:Q,children:"Sign In"}),children:(0,r.jsx)(Ye.Z,{variant:"body1",children:T})})})},loader:async(e,s)=>{const l=e.get(s),u=await l.getBackstageIdentity({optional:!0});if(!u)return;const g=await l.getProfile();return xs.create({identity:u.identity,profile:g,authApi:l})}},Cl={Component:({onSignInStarted:e,onSignInSuccess:s})=>(0,r.jsx)(ga,{children:(0,r.jsx)(Ur,{title:"Guest",variant:"fullHeight",actions:(0,r.jsx)(ve.Z,{color:"primary",variant:"outlined",onClick:()=>{e(),s(new ma)},children:"Enter"}),children:(0,r.jsxs)(Ye.Z,{variant:"body1",children:["Enter as a Guest User.",(0,r.jsx)("br",{}),"You will not have a verified identity,",(0,r.jsx)("br",{}),"meaning some features might be unavailable."]})})}),loader:async()=>new ma};var wl=n(63955),el=n(86619),tl=n(74828),jl=n(45455),El=n.n(jl);const Al=/^[a-z0-9_\-]+\.[a-z0-9_\-]+\.[a-z0-9_\-]+$/i,Tl=(0,m.Z)(e=>({form:{display:"flex",flexFlow:"column nowrap"},button:{alignSelf:"center",marginTop:e.spacing(2)}}),{name:"BackstageCustomProvider"}),nl=e=>{const{ref:s,...l}=e;return{inputRef:s,...l}},Rl={Component:({onSignInStarted:e,onSignInSuccess:s})=>{var l;const u=Tl(),{register:g,handleSubmit:x,formState:T}=(0,wl.cI)({mode:"onChange"}),{errors:$}=T,_=({userId:Q,idToken:fe})=>{e(),s(xs.fromLegacy({userId:Q,getIdToken:fe!==void 0?async()=>fe:void 0,profile:{email:`${Q}@example.com`}}))};return(0,r.jsx)(ga,{children:(0,r.jsxs)(Ur,{title:"Custom User",variant:"fullHeight",children:[(0,r.jsxs)(Ye.Z,{variant:"body1",children:["Enter your own User ID and credentials.",(0,r.jsx)("br",{}),"This selection will not be stored."]}),(0,r.jsxs)("form",{className:u.form,onSubmit:x(_),children:[(0,r.jsxs)(uo.Z,{children:[(0,r.jsx)(el.Z,{...nl(g("userId",{required:!0})),label:"User ID",margin:"normal",error:Boolean($.userId)}),$.userId&&(0,r.jsx)(tl.Z,{error:!0,children:$.userId.message})]}),(0,r.jsxs)(uo.Z,{children:[(0,r.jsx)(el.Z,{...nl(g("idToken",{required:!1,validate:Q=>!Q||Al.test(Q)||"Token is not a valid OpenID Connect JWT Token"})),label:"ID Token (optional)",margin:"normal",autoComplete:"off",error:Boolean($.idToken)}),$.idToken&&(0,r.jsx)(tl.Z,{error:!0,children:$.idToken.message})]}),(0,r.jsx)(ve.Z,{type:"submit",color:"primary",variant:"outlined",className:u.button,disabled:!(!((l=T)===null||l===void 0)&&l.isDirty)||!El()($),children:"Continue"})]})]})})},loader:async()=>{}},Mo="@backstage/core:SignInPage:provider",rl={guest:Cl,custom:Rl,common:Sl};function ol(e,s){if(e in s)throw new Error(`"${e}" ID is duplicated. IDs of identity providers have to be unique.`)}function Yl(e){return e.reduce((l,u)=>{if(typeof u=="string")return ol(u,l),l[u]={components:rl[u],id:u},l;const{id:g}=u;return ol(g,l),l[g]={components:rl.common,id:g,config:u},l},{})}const Jl=(e,s)=>{const l=useApi(errorApiRef),u=useApiHolder(),[g,x]=useState(!0),T=useCallback(_=>{s(IdentityApiSignOutProxy.from({identityApi:_,signOut:async()=>{var Q,fe;localStorage.removeItem(Mo),await((Q=(fe=_).signOut)===null||Q===void 0?void 0:Q.call(fe))}}))},[s]);useLayoutEffect(()=>{var _;if(!g)return;const Q=localStorage.getItem(Mo);if(Q===null){x(!1);return}const fe=e[Q];if(!fe){x(!1);return}let ge=!1;return fe.components.loader(u,(_=fe.config)===null||_===void 0?void 0:_.apiRef).then(Ze=>{if(ge){localStorage.removeItem(Mo);return}Ze?T(Ze):x(!1)}).catch(Ze=>{localStorage.removeItem(Mo),!ge&&(l.post(Ze),x(!1))}),()=>{ge=!0}},[g,l,s,u,e,T]);const $=useMemo(()=>Object.keys(e).map(_=>{const Q=e[_],{Component:fe}=Q.components,ge=Ve=>{T(Ve)},Ze=()=>{var Ve,pt;localStorage.setItem(Mo,((pt=Q)===null||pt===void 0||(Ve=pt.config)===null||Ve===void 0?void 0:Ve.id)||Q.id)},Ie=()=>{localStorage.removeItem(Mo)};return _jsx(fe,{config:Q.config,onSignInStarted:Ze,onSignInSuccess:ge,onSignInFailure:Ie},Q.id)}),[e,T]);return[g,$]},Il=({onSignInSuccess:e,providers:s=[],title:l,align:u="left"})=>{const g=useApi(configApiRef),x=useStyles(),T=getSignInProviders(s),[$,_]=useSignInProviders(T,e);return $?_jsx(Progress,{}):_jsxs(Page,{themeId:"home",children:[_jsx(Header,{title:g.getString("app.title")}),_jsxs(Content,{children:[l&&_jsx(ContentHeader,{title:l,textAlign:u}),_jsx(Grid,{container:!0,justifyContent:u==="center"?u:"flex-start",spacing:2,component:"ul",classes:x,children:_})]})]})},Pl=({provider:e,auto:s,onSignInSuccess:l})=>{const u=useStyles(),g=useApi(e.apiRef),x=useApi(configApiRef),[T,$]=useState(),[_,Q]=useState(!1),fe=async({checkExisting:ge,showPopup:Ze})=>{try{let Ie;if(ge&&(Ie=await g.getBackstageIdentity({optional:!0})),!Ie&&(Ze||s)&&(Q(!0),Ie=await g.getBackstageIdentity({instantPopup:!0}),!Ie))throw new Error(`The ${e.title} provider is not configured to support sign-in`);if(!Ie){Q(!0);return}const Ve=await g.getProfile();l(UserIdentity.create({identity:Ie.identity,authApi:g,profile:Ve}))}catch(Ie){$(Ie),Q(!0)}};return useMountEffect(()=>fe({checkExisting:!0})),_?_jsxs(Page,{themeId:"home",children:[_jsx(Header,{title:x.getString("app.title")}),_jsx(Content,{children:_jsx(Grid,{container:!0,justifyContent:"center",spacing:2,component:"ul",classes:u,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}),T&&T.name!=="PopupRejectedError"&&_jsx(Typography,{variant:"body1",color:"error",children:T.message})]})})})})]}):_jsx(Progress,{})};function Ql(e){return"provider"in e?_jsx(Pl,{...e}):_jsx(Il,{...e})}const Ll=(0,m.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"}),Ol=(0,Nn.Z)(e=>({root:{padding:e.spacing(2,2,2,2.5),display:"inline-block"},title:{fontWeight:700},subheader:{paddingTop:e.spacing(1)}}),{name:"BackstageTabbedCardBoldHeader"})(Eo.Z);function Xl(e){const{slackChannel:s,errorBoundaryProps:l,children:u,title:g,deepLink:x,value:T,onChange:$}=e,_=Ll(),[Q,fe]=useState(0),ge=$||((Ve,pt)=>fe(pt));let Ze;T?React.Children.map(u,Ve=>{var pt;if(React.isValidElement(Ve)&&((pt=Ve)===null||pt===void 0?void 0:pt.props.value)===T){var at;Ze=(at=Ve)===null||at===void 0?void 0:at.props.children}}):React.Children.map(u,(Ve,pt)=>{if(React.isValidElement(Ve)&&pt===Q){var at;Ze=(at=Ve)===null||at===void 0?void 0:at.props.children}});const Ie=l||(s?{slackChannel:s}:{});return _jsx(Card,{children:_jsxs(ErrorBoundary,{...Ie,children:[g&&_jsx(Ol,{title:g}),_jsx(Tabs,{selectionFollowsFocus:!0,classes:_,value:T||Q,onChange:ge,children:u}),_jsx(Divider,{}),_jsx(CardContent,{children:Ze}),x&&_jsx(BottomLink,{...x})]})})}const kl=(0,m.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 _l(e){const{children:s,...l}=e,u=kl();return _jsx(Tab,{disableRipple:!0,classes:u,...l})}},60871:function(It,Pe,n){"use strict";n.d(Pe,{fC:function(){return m},CL:function(){return Tt},sM:function(){return se},$v:function(){return Se},v_:function(){return k},hg:function(){return Ge},uB:function(){return xe},R5:function(){return tt},bq:function(){return I},Km:function(){return U},Ds:function(){return xt},ni:function(){return A},T0:function(){return D},CO:function(){return sn},x8:function(){return pn},rx:function(){return Yn},YO:function(){return Dn},P4:function(){return Tn},NT:function(){return Ct},NW:function(){return Dt},VE:function(){return Ut},W0:function(){return Nt},gP:function(){return Yt},IY:function(){return vt},F4:function(){return ee},ux:function(){return K},Kp:function(){return ie},$4:function(){return dt},p_:function(){return R},ZM:function(){return ut},D:function(){return X},gW:function(){return w},E6:function(){return St},z$:function(){return $e},h_:function(){return ve},I_:function(){return F},qD:function(){return Ke},vJ:function(){return Kn},tg:function(){return _e},Oi:function(){return Jt}});var r=n(52322),p=n(51837),W=n(2784);const f=(0,p.CT)("analytics-context"),V=()=>{const we=(0,W.useContext)(f);if(we===void 0)return{routeRef:"unknown",pluginId:"root",extension:"App"};const pe=we.atVersion(1);if(pe===void 0)throw new Error("No context found for version 1.");return pe},m=we=>{const{attributes:pe,children:Re}=we,N={...V(),...pe},le=(0,p.EI)({1:N});return(0,r.jsx)(f.Provider,{value:le,children:Re})};function h(we,pe){const Re=H=>_jsx(m,{attributes:pe,children:_jsx(we,{...H})});return Re.displayName=`WithAnalyticsContext(${we.displayName||we.name||"Component"})`,Re}function F(){const we=(0,p.Vt)("api-context");if(!we)throw new Error("API context is not available");const pe=we.atVersion(1);if(!pe)throw new Error("ApiContext v1 not available");return pe}function ve(we){const Re=F().get(we);if(!Re)throw new Error(`No implementation available for ${we}`);return Re}function ce(we){return function(Re){const H=le=>{const Ee=F(),Ue={};for(const qe in we)if(we.hasOwnProperty(qe)){const Pt=we[qe],$t=Ee.get(Pt);if(!$t)throw new Error(`No implementation available for ${Pt}`);Ue[qe]=$t}return _jsx(Re,{...le,...Ue})},N=Re.displayName||Re.name||"Component";return H.displayName=`withApis(${N})`,H}}var z=n(87612);class de{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(pe){if((0,z._)(this,"config",void 0),this.config=pe,!pe.id.split(".").flatMap(H=>H.split("-")).every(H=>H.match(/^[a-z][a-z0-9]*$/)))throw new Error(`API id must only contain period separated lowercase alphanum tokens with dashes, got '${pe.id}'`)}}function D(we){return new de(we)}function A(we,pe){return"id"in we?{api:we,deps:{},factory:()=>pe}:we}var se;(function(we){we.SignedIn="SignedIn",we.SignedOut="SignedOut"})(se||(se={}));const ie=D({id:"core.auth.google"}),ee=D({id:"core.auth.github"}),X=D({id:"core.auth.okta"}),K=D({id:"core.auth.gitlab"}),R=D({id:"core.auth.microsoft"}),w=D({id:"core.auth.onelogin"}),I=D({id:"core.auth.bitbucket"}),U=D({id:"core.auth.bitbucket-server"}),xe=D({id:"core.auth.atlassian"}),Se=D({id:"core.alert"}),k=D({id:"core.analytics"}),Ge=D({id:"core.apptheme"}),xt=D({id:"core.config"}),Dt=D({id:"core.discovery"}),Ut=D({id:"core.error"});var Tt;(function(we){we[we.None=0]="None",we[we.Active=1]="Active"})(Tt||(Tt={}));const Nt=D({id:"core.featureflags"}),Yt=D({id:"core.fetch"}),dt=D({id:"core.identity"}),ut=D({id:"core.oauthrequest"}),St=D({id:"core.storage"}),lt=(0,p.uW)("core-plugin-api:analytics-tracker-events",()=>({mostRecentGatheredNavigation:void 0,mostRecentRoutableExtensionRender:void 0,beforeUnloadRegistered:!1})),Zt="_ROUTABLE-EXTENSION-RENDERED";class Ht{setContext(pe){this.context=pe}captureEvent(pe,Re,{value:H,attributes:N}={}){const{_routeNodeType:le,...Ee}=this.context;if(pe===Zt){lt.mostRecentGatheredNavigation&&(lt.mostRecentRoutableExtensionRender={context:{...Ee,extension:"App"}});return}if(lt.mostRecentGatheredNavigation){try{this.analyticsApi.captureEvent({...lt.mostRecentGatheredNavigation,...lt.mostRecentRoutableExtensionRender})}catch(Ue){console.warn("Error during analytics event capture. %o",Ue)}lt.mostRecentGatheredNavigation=void 0,lt.mostRecentRoutableExtensionRender=void 0}if(pe==="navigate"&&le==="gathered"&&Ee.pluginId==="root"){lt.mostRecentGatheredNavigation={action:pe,subject:Re,value:H,attributes:N,context:Ee};return}try{this.analyticsApi.captureEvent({action:pe,subject:Re,value:H,attributes:N,context:Ee})}catch(Ue){console.warn("Error during analytics event capture. %o",Ue)}}constructor(pe,Re={routeRef:"unknown",pluginId:"root",extension:"App"}){(0,z._)(this,"analyticsApi",void 0),(0,z._)(this,"context",void 0),this.analyticsApi=pe,this.context=Re,lt.beforeUnloadRegistered||(addEventListener("beforeunload",()=>{lt.mostRecentGatheredNavigation&&(this.analyticsApi.captureEvent({...lt.mostRecentGatheredNavigation,...lt.mostRecentRoutableExtensionRender}),lt.mostRecentGatheredNavigation=void 0,lt.mostRecentRoutableExtensionRender=void 0)},{once:!0,passive:!0}),lt.beforeUnloadRegistered=!0)}}function Ce(){try{return ve(k)}catch{return{captureEvent:()=>{}}}}function $e(){const we=(0,W.useRef)(null),pe=V(),Re=Ce();function H(){return we.current===null&&(we.current=new Ht(Re)),we.current}const N=H();return N.setContext(pe),N}const Ke=()=>{const we=(0,p.Vt)("app-context");if(!we)throw new Error("App context is not available");const pe=we.atVersion(1);if(!pe)throw new Error("AppContext v1 not available");return pe},ht=(0,p.uW)("component-data-store",()=>new WeakMap),rt="__backstage_data";function tt(we,pe,Re){const H=we;var N;let le=(N=H[rt])!==null&&N!==void 0?N:ht.get(we);if(le||(le={map:new Map},Object.defineProperty(H,rt,{enumerable:!1,configurable:!0,writable:!1,value:le}),ht.set(we,le)),le.map.has(pe)){const Ee=we.displayName||we.name;throw new Error(`Attempted to attach duplicate data "${pe}" to component "${Ee}"`)}le.map.set(pe,Re)}function vt(we,pe){if(!we)return;const Re=we.type;if(!Re)return;var H;const N=(H=Re[rt])!==null&&H!==void 0?H:ht.get(Re);if(N)return N.map.get(pe)}const ot=(0,p.uW)("route-ref-type",()=>Symbol("route-ref-type"));let Qe=ot,ft=Qe;class gt{get title(){return this.id}toString(){return`routeRef{type=absolute,id=${this.id}}`}constructor(pe,Re){(0,z._)(this,"id",void 0),(0,z._)(this,"params",void 0),(0,z._)(this,ft,void 0),this.id=pe,this.params=Re,this[Qe]="absolute"}}function Ct(we){var pe;return new gt(we.id,(pe=we.params)!==null&&pe!==void 0?pe:[])}const mn=/^\w+$/;let un=null,ln=null;class Sn{toString(){return`routeRef{type=sub,id=${this.id}}`}constructor(pe,Re,H,N){_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,ln,void 0),this.id=pe,this.path=Re,this.parent=H,this.params=N,this[un]="sub"}}function hn(we){const{id:pe,path:Re,parent:H}=we,N=Re.split("/").filter(Ue=>Ue.startsWith(":")).map(Ue=>Ue.substring(1)),le=[...H.params,...N];if(H.params.some(Ue=>N.includes(Ue)))throw new Error("SubRouteRef may not have params that overlap with its parent");if(!Re.startsWith("/"))throw new Error(`SubRouteRef path must start with '/', got '${Re}'`);if(Re.endsWith("/"))throw new Error(`SubRouteRef path must not end with '/', got '${Re}'`);for(const Ue of N)if(!mn.test(Ue))throw new Error(`SubRouteRef path has invalid param, got '${Ue}'`);return new Sn(pe,Re,H,le)}let vn=ot,Cn=vn;class on{toString(){return`routeRef{type=external,id=${this.id}}`}constructor(pe,Re,H){(0,z._)(this,"id",void 0),(0,z._)(this,"params",void 0),(0,z._)(this,"optional",void 0),(0,z._)(this,Cn,void 0),this.id=pe,this.params=Re,this.optional=H,this[vn]="external"}}function pn(we){var pe;return new on(we.id,(pe=we.params)!==null&&pe!==void 0?pe:[],Boolean(we.optional))}var wn=n(73557);function _e(we){const{pathname:pe}=(0,wn.TH)(),Re=(0,p.Vt)("routing-context");if(!Re)throw new Error("Routing context is not available");const H=Re.atVersion(1),N=(0,W.useMemo)(()=>H&&H.resolve(we,{pathname:pe}),[H,we,pe]);if(!Re)throw new Error("useRouteRef used outside of routing context");if(!H)throw new Error("RoutingContext v1 not available");const le="optional"in we&&we.optional;if(!N&&!le)throw new Error(`No path for ${we}`);return N}function Jt(we){return(0,wn.UO)()}class Wt extends W.Component{static getDerivedStateFromError(pe){return{error:pe}}render(){const{error:pe}=this.state,{app:Re,plugin:H}=this.props,{ErrorBoundaryFallback:N}=Re.getComponents();return pe?(0,r.jsx)(N,{error:pe,resetError:this.handleErrorReset,plugin:H}):this.props.children}constructor(...pe){super(...pe),(0,z._)(this,"state",{error:void 0}),(0,z._)(this,"handleErrorReset",()=>{this.setState({error:void 0})})}}var Ye=n(64355);function Tn(we){const{component:pe,mountPoint:Re,name:H}=we;return Dn({component:{lazy:()=>pe().then(N=>{const le=Ue=>{const qe=$e();try{_e(Re)}catch(Pt){if(typeof Pt=="object"&&Pt!==null){const{message:$t}=Pt;if(typeof $t=="string"&&$t.startsWith("No path for "))throw new Error(`Routable extension component with mount point ${Re} 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 Pt}return(0,W.useEffect)(()=>{qe.captureEvent(Zt,"")},[qe]),(0,r.jsx)(N,{...Ue})},Ee=H||N.displayName||N.name||"LazyComponent";return le.displayName=`RoutableExtension(${Ee})`,le},N=>Ee=>{const Ue=Ke(),{BootErrorPage:qe}=Ue.getComponents();return(0,r.jsx)(qe,{step:"load-chunk",error:N})})},data:{"core.mountPoint":Re},name:H})}function sn(we){const{component:pe,name:Re}=we;return Dn({component:pe,name:Re})}function Dn(we){const{data:pe={},name:Re}=we;Re||console.warn("Declaring extensions without name is DEPRECATED. Make sure that all usages of createReactExtension, createComponentExtension and createRoutableExtension provide a name.");let H;if("lazy"in we.component){const le=we.component.lazy;H=(0,W.lazy)(()=>le().then(Ee=>({default:Ee})))}else H=we.component.sync;const N=Re||H.displayName||H.name||"Component";return{expose(le){const Ee=Ue=>{var qe;const Pt=Ke(),{Progress:$t}=Pt.getComponents(),Qt=(qe=pe)===null||qe===void 0?void 0:qe["core.mountPoint"];return(0,r.jsx)(W.Suspense,{fallback:(0,r.jsx)($t,{}),children:(0,r.jsx)(Wt,{app:Pt,plugin:le,children:(0,r.jsx)(m,{attributes:{pluginId:le.getId(),...Re&&{extension:Re},...Qt&&{routeRef:Qt.id}},children:(0,r.jsx)(Ye.o,{plugin:le,children:(0,r.jsx)(H,{...Ue})})})})})};tt(Ee,"core.plugin",le),tt(Ee,"core.extensionName",Re);for(const[Ue,qe]of Object.entries(pe))tt(Ee,Ue,qe);return Ee.displayName=`Extension(${N})`,Ee}}}function Rn(we,pe,Re,H){return W.Children.toArray(we).flatMap(N=>{if(!(0,W.isValidElement)(N))return[];if(N.type===W.Fragment)return Rn(N.props.children,pe,Re,H);if(vt(N,"core.featureFlagged")){const le=N.props;return("with"in le?pe.isActive(le.with):!pe.isActive(le.without))?Rn(N.props.children,pe,Re,H):[]}if(Re===void 0||Re(N))return[N];if(H)throw new Error(H);return Rn(N.props.children,pe,Re,H)})}class In{selectByComponentData(pe){const Re=Rn(this.node,this.featureFlagsApi,H=>vt(H,pe.key)!==void 0,pe.withStrictError);return new In(Re,this.featureFlagsApi)}findComponentData(pe){return Rn(this.node,this.featureFlagsApi,H=>vt(H,pe.key)!==void 0).map(H=>vt(H,pe.key)).filter(H=>H!==void 0)}getElements(){return Rn(this.node,this.featureFlagsApi)}constructor(pe,Re){(0,z._)(this,"node",void 0),(0,z._)(this,"featureFlagsApi",void 0),this.node=pe,this.featureFlagsApi=Re}}function Kn(we,pe,Re=[]){const H=ve(Nt),N=new In(we,H);return(0,W.useMemo)(()=>pe(N),[we,...Re])}class On{getId(){return this.config.id}getApis(){var pe;return(pe=this.config.apis)!==null&&pe!==void 0?pe:[]}getFeatureFlags(){var pe,Re;return(Re=(pe=this.config.featureFlags)===null||pe===void 0?void 0:pe.slice())!==null&&Re!==void 0?Re:[]}get routes(){var pe;return(pe=this.config.routes)!==null&&pe!==void 0?pe:{}}get externalRoutes(){var pe;return(pe=this.config.externalRoutes)!==null&&pe!==void 0?pe:{}}provide(pe){return pe.expose(this)}__experimentalReconfigure(pe){this.config.__experimentalConfigure&&(this.options=this.config.__experimentalConfigure(pe))}getPluginOptions(){this.config.__experimentalConfigure&&!this.options&&(this.options=this.config.__experimentalConfigure());var pe;return(pe=this.options)!==null&&pe!==void 0?pe:{}}toString(){return`plugin{${this.config.id}}`}constructor(pe){(0,z._)(this,"config",void 0),(0,z._)(this,"options",void 0),this.config=pe,this.options=void 0}}function Yn(we){return new On(we)}},64355:function(It,Pe,n){"use strict";n.d(Pe,{o:function(){return V},y:function(){return m}});var r=n(52322),p=n(51837),W=n(2784);const f="plugin-context",V=h=>{const{children:F,plugin:ve}=h,{Provider:ce}=(0,p.CT)(f);return(0,r.jsx)(ce,{value:(0,p.EI)({1:{plugin:ve}}),children:F})};function m(){const h=(0,p.Vt)(f);if(!h)throw new Error("Plugin Options context is not available");const F=h.atVersion(1);if(!F)throw new Error("Plugin Options v1 is not available");return F.plugin.getPluginOptions()}},23054:function(It,Pe,n){"use strict";n.d(Pe,{SP:function(){return ee},dR:function(){return de},VL:function(){return K},BD:function(){return p}});function r(R){if(typeof R!="object"||R===null||Array.isArray(R))return!1;const w=R;return!(typeof w.name!="string"||w.name===""||typeof w.message!="string")}function p(R){if(typeof R!="object"||R===null||Array.isArray(R))throw new Error(`Encountered invalid error, not an object, got '${R}'`);const w=R;if(typeof w.name!="string"||w.name==="")throw new Error(`Encountered error object without a name, got '${R}'`);if(typeof w.message!="string")throw new Error(`Encountered error object without a message, got '${R}'`)}var W=n(87612),f=n(24852);function V(R,w){var I;const xe={name:"Unknown",message:"<no reason given>",...serializeErrorInternal(R)};return!((I=w)===null||I===void 0)&&I.includeStack||delete xe.stack,xe}function m(R){const w=(0,f.deserializeError)(R);return R.stack||(w.stack=void 0),w}function h(R){if(r(R)){const w=String(R);return w!=="[object Object]"?w:`${R.name}: ${R.message}`}return`unknown error '${R}'`}class F extends Error{constructor(w,I){var U,xe;let Se=w;if(I!==void 0){const k=h(I);Se?Se+=`; caused by ${k}`:Se=`caused by ${k}`}super(Se),(0,W._)(this,"cause",void 0),(U=(xe=Error).captureStackTrace)===null||U===void 0||U.call(xe,this,this.constructor),(!this.name||this.name==="Error")&&this.constructor.name!=="Error"&&(this.name=this.constructor.name),this.cause=r(I)?I:void 0}}class ve extends null{constructor(...w){super(...w),_define_property(this,"name","InputError")}}class ce extends null{constructor(...w){super(...w),_define_property(this,"name","AuthenticationError")}}class z extends null{constructor(...w){super(...w),_define_property(this,"name","NotAllowedError")}}class de extends F{constructor(...w){super(...w),(0,W._)(this,"name","NotFoundError")}}class D extends null{constructor(...w){super(...w),_define_property(this,"name","ConflictError")}}class A extends null{constructor(...w){super(...w),_define_property(this,"name","NotModifiedError")}}class se extends null{constructor(...w){super(...w),_define_property(this,"name","NotImplementedError")}}class ie extends null{}class ee extends F{constructor(w,I){super(w,I),this.name=r(I)?I.name:"Error"}}async function X(R){try{const I=await R.text();if(I){var w;if(!((w=R.headers.get("content-type"))===null||w===void 0)&&w.startsWith("application/json"))try{const U=JSON.parse(I);if(U.error&&U.response)return U}catch{}return{error:{name:"Error",message:`Request failed with status ${R.status} ${R.statusText}, ${I}`},response:{statusCode:R.status}}}}catch{}return{error:{name:"Error",message:`Request failed with status ${R.status} ${R.statusText}`},response:{statusCode:R.status}}}class K extends Error{static async fromResponse(w){const I=await X(w),U=I.response.statusCode||w.status,xe=I.error.name||w.statusText,Se=`Request failed with ${U} ${xe}`,k=m(I.error);return new K({message:Se,response:w,data:I,cause:k})}constructor(w){super(w.message),(0,W._)(this,"response",void 0),(0,W._)(this,"body",void 0),(0,W._)(this,"cause",void 0),this.name="ResponseError",this.response=w.response,this.body=w.data,this.cause=w.cause}}},32838:function(It,Pe,n){"use strict";n.d(Pe,{nW:function(){return ie},ae:function(){return z},q3:function(){return de}});var r=n(60871);const p=(0,r.T0)({id:"core.scmauth"});var W=new WeakMap;class f{async getCredentials(X){const K=new URL(X.url),R=_class_private_field_get(this,W).find(w=>w.isUrlSupported(K));if(!R)throw new Error(`No auth provider available for '${X.url}', see https://backstage.io/link?scm-auth`);return R.getCredentials(X)}constructor(X){_class_private_field_init(this,W,{writable:!0,value:void 0}),_class_private_field_set(this,W,X)}}var V=new WeakMap,m=new WeakMap,h=new WeakMap,F=new WeakMap;class ve{static createDefaultApiFactory(){return createApiFactory({api:scmAuthApiRef,deps:{github:githubAuthApiRef,gitlab:gitlabAuthApiRef,azure:microsoftAuthApiRef,bitbucket:bitbucketAuthApiRef},factory:({github:X,gitlab:K,azure:R,bitbucket:w})=>ve.merge(ve.forGithub(X),ve.forGitlab(K),ve.forAzure(R),ve.forBitbucket(w))})}static forAuthApi(X,K){return new ve("generic",X,K.host,K.scopeMapping)}static forGithub(X,K){var R,w;const I=(w=(R=K)===null||R===void 0?void 0:R.host)!==null&&w!==void 0?w:"github.com";return new ve("github",X,I,{default:["repo","read:org","read:user"],repoWrite:["gist"]})}static forGitlab(X,K){var R,w;const I=(w=(R=K)===null||R===void 0?void 0:R.host)!==null&&w!==void 0?w:"gitlab.com";return new ve("gitlab",X,I,{default:["read_user","read_api","read_repository"],repoWrite:["write_repository","api"]})}static forAzure(X,K){var R,w;const I=(w=(R=K)===null||R===void 0?void 0:R.host)!==null&&w!==void 0?w:"dev.azure.com";return new ve("azure",X,I,{default:["vso.build","vso.code","vso.graph","vso.project","vso.profile"],repoWrite:["vso.code_manage"]})}static forBitbucket(X,K){var R,w;const I=(w=(R=K)===null||R===void 0?void 0:R.host)!==null&&w!==void 0?w:"bitbucket.org";return new ve("bitbucket",X,I,{default:["account","team","pullrequest","snippet","issue"],repoWrite:["pullrequest:write","snippet:write","issue:write"]})}static merge(...X){return new f(X)}isUrlSupported(X){return X.host===_class_private_field_get(this,m)}getAdditionalScopesForProvider(X){var K,R;if(!(!((K=X)===null||K===void 0)&&K.customScopes)||_class_private_field_get(this,F)==="generic")return[];var w;return(w=(R=X.customScopes)===null||R===void 0?void 0:R[_class_private_field_get(this,F)])!==null&&w!==void 0?w:[]}async getCredentials(X){var K;const{url:R,additionalScope:w,...I}=X,U=_class_private_field_get(this,h).default.slice();!((K=w)===null||K===void 0)&&K.repoWrite&&U.push(..._class_private_field_get(this,h).repoWrite);const xe=this.getAdditionalScopesForProvider(w);xe.length&&U.push(...xe);const Se=[...new Set(U)],k=await _class_private_field_get(this,V).getAccessToken(Se,I);return{token:k,headers:{Authorization:`Bearer ${k}`}}}constructor(X,K,R,w){_class_private_field_init(this,V,{writable:!0,value:void 0}),_class_private_field_init(this,m,{writable:!0,value:void 0}),_class_private_field_init(this,h,{writable:!0,value:void 0}),_class_private_field_init(this,F,{writable:!0,value:void 0}),_class_private_field_set(this,V,K),_class_private_field_set(this,m,R),_class_private_field_set(this,h,w),_class_private_field_set(this,F,X)}}var ce=n(40556);class z{static fromConfig(X){return ce.Lx.fromConfig(X)}}const de=(0,r.T0)({id:"integration.scmintegrations"});var D=n(52322),A=n(73250),se=n(2784);const ie=ee=>{const{type:X}=ee,K=(0,r.qD)(),R=A.Z;var w;const I=X&&(w=K.getSystemIcon(X))!==null&&w!==void 0?w:R;return(0,D.jsx)(I,{})}},40556:function(It,Pe,n){"use strict";n.d(Pe,{Lx:function(){return Fr},BT:function(){return wt}});var r=n(87612),p=n(82717),W=n.n(p),f=n(76635);function V(C){const c=new URL("http://example.com");return c.host=C,c.host===C}function m(C){try{return new URL(C),!0}catch{return!1}}function h(C,c){return{list(){return C},byUrl(S){try{const E=typeof S=="string"?new URL(S):S;return C.find(J=>c(J)===E.host)}catch{return}},byHost(S){return C.find(E=>c(E)===S)}}}function F(C){const{url:c,base:S,lineNumber:E}=C;try{return new URL(c),c}catch{}let J;if(c.startsWith("/")){const{filepath:ye}=W()(S);J=new URL(S);const je=(0,f.trimEnd)(J.pathname.substring(0,J.pathname.length-ye.length),"/");J.pathname=`${je}${c}`}else J=new URL(c,S);return J.search=new URL(S).search,E&&(J.hash=`L${E}`),J.toString()}function ve(C){beforeAll(()=>C.listen({onUnhandledRequest:"error"})),afterAll(()=>C.close()),afterEach(()=>C.resetHandlers())}const ce="amazonaws.com";function z(C){const c=C.getOptionalString("endpoint");var S;const E=(S=C.getOptionalBoolean("s3ForcePathStyle"))!==null&&S!==void 0?S:!1;let J,ye;if(c){try{const xn=new URL(c);J=xn.host,ye=xn.pathname}catch{throw new Error(`invalid awsS3 integration config, endpoint '${c}' is not a valid URL`)}if(ye!=="/")throw new Error(`invalid awsS3 integration config, endpoints cannot contain path, got '${c}'`)}else J=ce;const je=C.getOptionalString("accessKeyId"),De=C.getOptionalString("secretAccessKey"),et=C.getOptionalString("roleArn"),Gt=C.getOptionalString("externalId");return{host:J,endpoint:c,s3ForcePathStyle:E,accessKeyId:je,secretAccessKey:De,roleArn:et,externalId:Gt}}function de(C){const c=C.map(z);return c.some(S=>S.host===ce)||c.push({host:ce}),c}class D{get type(){return"awsS3"}get title(){return this.integrationConfig.host}get config(){return this.integrationConfig}resolveUrl(c){return F(c)}resolveEditUrl(c){return c}constructor(c){(0,r._)(this,"integrationConfig",void 0),this.integrationConfig=c}}(0,r._)(D,"factory",({config:C})=>{var c;const S=de((c=C.getOptionalConfigArray("integrations.awsS3"))!==null&&c!==void 0?c:[]);return h(S.map(E=>new D(E)),E=>E.config.host)});var A=n(88412),se=n(50629),ie=n(80956);const ee="GB";var X=new WeakMap,K=new WeakMap,R=new WeakMap,w=new WeakMap,I=new WeakMap,U=new WeakMap,xe=new WeakMap;class Se{static fromRepoUrl(c){const S=new URL(c);let E,J,ye;const je=S.pathname.split("/").map(qn=>decodeURIComponent(qn));if(je[2]==="_git"?(E=je[1],J=ye=je[3]):je[3]==="_git"?(E=je[1],J=je[2],ye=je[4]):je[4]==="_git"&&(E=`${je[1]}/${je[2]}`,J=je[3],ye=je[5]),!E||!J||!ye)throw new Error("Azure URL must point to a git repository");var De;const et=(De=S.searchParams.get("path"))!==null&&De!==void 0?De:void 0;let Gt;const xn=S.searchParams.get("version");if(xn){if(xn.slice(0,2)!=="GB")throw new Error("Azure URL version must point to a git branch");Gt=xn.slice(2)}return new Se(S.origin,E,J,ye,et,Gt)}toRepoUrl(){let c;return(0,A._)(this,R)===(0,A._)(this,w)?c=(0,A._)(this,xe).call(this,(0,A._)(this,K),"_git",(0,A._)(this,w)):c=(0,A._)(this,xe).call(this,(0,A._)(this,K),(0,A._)(this,R),"_git",(0,A._)(this,w)),(0,A._)(this,I)&&c.searchParams.set("path",(0,A._)(this,I)),(0,A._)(this,U)&&c.searchParams.set("version",ee+(0,A._)(this,U)),c.toString()}toFileUrl(){if(!(0,A._)(this,I))throw new Error("Azure URL must point to a specific path to be able to download a file");const c=(0,A._)(this,xe).call(this,(0,A._)(this,K),(0,A._)(this,R),"_apis","git","repositories",(0,A._)(this,w),"items");return c.searchParams.set("api-version","6.0"),c.searchParams.set("path",(0,A._)(this,I)),(0,A._)(this,U)&&c.searchParams.set("version",(0,A._)(this,U)),c.toString()}toArchiveUrl(){const c=(0,A._)(this,xe).call(this,(0,A._)(this,K),(0,A._)(this,R),"_apis","git","repositories",(0,A._)(this,w),"items");return c.searchParams.set("recursionLevel","full"),c.searchParams.set("download","true"),c.searchParams.set("api-version","6.0"),(0,A._)(this,I)&&c.searchParams.set("scopePath",(0,A._)(this,I)),(0,A._)(this,U)&&c.searchParams.set("version",(0,A._)(this,U)),c.toString()}toCommitsUrl(){const c=(0,A._)(this,xe).call(this,(0,A._)(this,K),(0,A._)(this,R),"_apis","git","repositories",(0,A._)(this,w),"commits");return c.searchParams.set("api-version","6.0"),(0,A._)(this,U)&&c.searchParams.set("searchCriteria.itemVersion.version",(0,A._)(this,U)),c.toString()}getOwner(){return(0,A._)(this,K)}getProject(){return(0,A._)(this,R)}getRepo(){return(0,A._)(this,w)}getPath(){return(0,A._)(this,I)}getRef(){return(0,A._)(this,U)}constructor(c,S,E,J,ye,je){(0,se._)(this,X,{writable:!0,value:void 0}),(0,se._)(this,K,{writable:!0,value:void 0}),(0,se._)(this,R,{writable:!0,value:void 0}),(0,se._)(this,w,{writable:!0,value:void 0}),(0,se._)(this,I,{writable:!0,value:void 0}),(0,se._)(this,U,{writable:!0,value:void 0}),(0,se._)(this,xe,{writable:!0,value:(...De)=>{const et=new URL((0,A._)(this,X));return et.pathname=De.map(Gt=>encodeURIComponent(Gt)).join("/"),et}}),(0,ie._)(this,X,c),(0,ie._)(this,K,S),(0,ie._)(this,R,E),(0,ie._)(this,w,J),(0,ie._)(this,I,ye),(0,ie._)(this,U,je)}}const k="dev.azure.com",Ge=C=>{const c=C;return Object.keys(C).length===3&&c.clientId!==void 0&&c.clientSecret!==void 0&&c.tenantId!==void 0},xt=C=>Object.keys(C).length===1&&C.clientId!==void 0;function Dt(C){var c;const S=(c=C.getOptionalString("host"))!==null&&c!==void 0?c:k,E=C.getOptionalString("token"),J=C.getOptional("credential")?{tenantId:C.getOptionalString("credential.tenantId"),clientId:C.getOptionalString("credential.clientId"),clientSecret:C.getOptionalString("credential.clientSecret")}:void 0;if(!V(S))throw new Error(`Invalid Azure integration config, '${S}' is not a valid host`);if(J&&!Ge(J)&&!xt(J))throw new Error("Invalid Azure integration config, credential is not valid");if(J&&S!==k)throw new Error(`Invalid Azure integration config, credential can only be used with ${k}`);if(J&&E)throw new Error("Invalid Azure integration config, specify either a token or a credential but not both");return{host:S,token:E,credential:J}}function Ut(C){const c=C.map(Dt);return c.some(S=>S.host===k)||c.push({host:k}),c}class Tt{get type(){return"azure"}get title(){return this.integrationConfig.host}get config(){return this.integrationConfig}resolveUrl(c){const{url:S,base:E}=c;if(m(S))return S;try{const ye=Se.fromRepoUrl(E),je=new URL(E);var J;const De=new URL(`https://a.com${(J=ye.getPath())!==null&&J!==void 0?J:""}`),et=new URL(S,De).pathname;return je.searchParams.set("path",et),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(S,E).toString()}}resolveEditUrl(c){return c}constructor(c){(0,r._)(this,"integrationConfig",void 0),this.integrationConfig=c}}(0,r._)(Tt,"factory",({config:C})=>{var c;const S=Ut((c=C.getOptionalConfigArray("integrations.azure"))!==null&&c!==void 0?c:[]);return h(S.map(E=>new Tt(E)),E=>E.config.host)});var Nt=n(48834).lW;function Yt(C){return AzureUrl.fromRepoUrl(C).toFileUrl()}function dt(C){return AzureUrl.fromRepoUrl(C).toArchiveUrl()}function ut(C){return AzureUrl.fromRepoUrl(C).toCommitsUrl()}async function St(C,c){const S="499b84ac-1321-427f-aa17-267ca6975798/.default",E=c?{...c}:{},{token:J,credential:ye}=C;if(ye){if(isAzureClientSecretCredential(ye)){const De=await new ClientSecretCredential(ye.tenantId,ye.clientId,ye.clientSecret).getToken(S);E.Authorization=`Bearer ${De.token}`}else if(isAzureManagedIdentityCredential(ye)){const De=await new ManagedIdentityCredential(ye.clientId).getToken(S);E.Authorization=`Bearer ${De.token}`}}else if(J){const je=Nt.from(`:${C.token}`,"utf8");E.Authorization=`Basic ${je.toString("base64")}`}return{headers:E}}const lt="bitbucket.org",Zt="https://api.bitbucket.org/2.0";function Ht(C){var c;const S=(c=C.getOptionalString("host"))!==null&&c!==void 0?c:lt;let E=C.getOptionalString("apiBaseUrl");const J=C.getOptionalString("token"),ye=C.getOptionalString("username"),je=C.getOptionalString("appPassword");if(!V(S))throw new Error(`Invalid Bitbucket integration config, '${S}' is not a valid host`);return E?E=(0,f.trimEnd)(E,"/"):S===lt?E=Zt:E=`https://${S}/rest/api/1.0`,{host:S,apiBaseUrl:E,token:J,username:ye,appPassword:je}}function Ce(C){const c=C.map(Ht);return c.some(S=>S.host===lt)||c.push({host:lt,apiBaseUrl:Zt}),c}class $e{get type(){return"bitbucket"}get title(){return this.integrationConfig.host}get config(){return this.integrationConfig}resolveUrl(c){const S=F(c);if(!c.lineNumber)return S;const E=new URL(S);return this.integrationConfig.host==="bitbucket.org"?E.hash=`lines-${c.lineNumber}`:E.hash=`${c.lineNumber}`,E.toString()}resolveEditUrl(c){const S=W()(c),E=new URL(c);return E.searchParams.set("mode","edit"),E.searchParams.set("spa","0"),E.searchParams.set("at",S.ref),E.toString()}constructor(c){(0,r._)(this,"integrationConfig",void 0),this.integrationConfig=c}}(0,r._)($e,"factory",({config:C})=>{var c,S,E;const J=Ce((E=C.getOptionalConfigArray("integrations.bitbucket"))!==null&&E!==void 0?E:[...(c=C.getOptionalConfigArray("integrations.bitbucketCloud"))!==null&&c!==void 0?c:[],...(S=C.getOptionalConfigArray("integrations.bitbucketServer"))!==null&&S!==void 0?S:[]]);return h(J.map(ye=>new $e(ye)),ye=>ye.config.host)});var Ke=n(96279),ht=n(48834).lW;async function rt(C,c){const{name:S,owner:E,resource:J}=parseGitUrl(C),ye=J==="bitbucket.org";let je=ye?`${c.apiBaseUrl}/repositories/${E}/${S}`:`${c.apiBaseUrl}/projects/${E}/repos/${S}/default-branch`,De=await fetch(je,ot(c));if(De.status===404&&!ye&&(je=`${c.apiBaseUrl}/projects/${E}/repos/${S}/branches/default`,De=await fetch(je,ot(c))),!De.ok){const Gt=`Failed to retrieve default branch from ${je}, ${De.status} ${De.statusText}`;throw new Error(Gt)}let et;if(ye)et=(await De.json()).mainbranch.name;else{const{displayId:Gt}=await De.json();et=Gt}if(!et)throw new Error(`Failed to read default branch from ${je}. Response ${De.status} ${De.json()}`);return et}async function tt(C,c){const{name:S,owner:E,ref:J,protocol:ye,resource:je,filepath:De}=parseGitUrl(C),et=je==="bitbucket.org";let Gt=J;Gt||(Gt=await rt(C,c));const xn=De?`&path=${encodeURIComponent(decodeURIComponent(De))}`:"";return et?`${ye}://${je}/${E}/${S}/get/${Gt}.tar.gz`:`${c.apiBaseUrl}/projects/${E}/repos/${S}/archive?format=tgz&at=${Gt}&prefix=${E}-${S}${xn}`}function vt(C,c){try{const{owner:S,name:E,ref:J,filepathtype:ye,filepath:je}=parseGitUrl(C);if(!S||!E||ye!=="browse"&&ye!=="raw"&&ye!=="src")throw new Error("Invalid Bitbucket URL or file path");const De=je.replace(/^\//,"");if(c.host==="bitbucket.org"){if(!J)throw new Error("Invalid Bitbucket URL or file path");return`${c.apiBaseUrl}/repositories/${S}/${E}/src/${J}/${De}`}return`${c.apiBaseUrl}/projects/${S}/repos/${E}/raw/${De}?at=${J}`}catch(S){throw new Error(`Incorrect URL: ${C}, ${S}`)}}function ot(C){const c={};if(C.token)c.Authorization=`Bearer ${C.token}`;else if(C.username&&C.appPassword){const S=ht.from(`${C.username}:${C.appPassword}`,"utf8");c.Authorization=`Basic ${S.toString("base64")}`}return{headers:c}}const Qe="bitbucket.org",ft="https://api.bitbucket.org/2.0";function gt(C){const c=Qe,S=ft,E=C.getString("username"),J=C.getString("appPassword");return{host:c,apiBaseUrl:S,username:E,appPassword:J}}function Ct(C){const c=C.map(gt);return c.length===0&&c.push({host:Qe,apiBaseUrl:ft}),c}class mn{get type(){return"bitbucketCloud"}get title(){return this.integrationConfig.host}get config(){return this.integrationConfig}resolveUrl(c){const S=F(c);if(c.lineNumber){const E=new URL(S);return E.hash=`lines-${c.lineNumber}`,E.toString()}return S}resolveEditUrl(c){const S=W()(c),E=new URL(c);return E.searchParams.set("mode","edit"),E.searchParams.set("at",S.ref),E.toString()}constructor(c){(0,r._)(this,"integrationConfig",void 0),this.integrationConfig=c}}(0,r._)(mn,"factory",({config:C})=>{var c;const S=Ct((c=C.getOptionalConfigArray("integrations.bitbucketCloud"))!==null&&c!==void 0?c:[]);return h(S.map(E=>new mn(E)),E=>E.config.host)});var un=n(48834).lW;async function ln(C,c){const{name:S,owner:E}=parseGitUrl(C),J=`${c.apiBaseUrl}/repositories/${E}/${S}`,ye=await fetch(J,vn(c));if(!ye.ok){const et=`Failed to retrieve default branch from ${J}, ${ye.status} ${ye.statusText}`;throw new Error(et)}const De=(await ye.json()).mainbranch.name;if(!De)throw new Error(`Failed to read default branch from ${J}. Response ${ye.status} ${ye.json()}`);return De}async function Sn(C,c){const{name:S,owner:E,ref:J,protocol:ye,resource:je}=parseGitUrl(C);let De=J;return De||(De=await ln(C,c)),`${ye}://${je}/${E}/${S}/get/${De}.tar.gz`}function hn(C,c){try{const{owner:S,name:E,ref:J,filepathtype:ye,filepath:je}=parseGitUrl(C);if(!S||!E||ye!=="src"&&ye!=="raw")throw new Error("Invalid Bitbucket Cloud URL or file path");const De=je.replace(/^\//,"");if(!J)throw new Error("Invalid Bitbucket Cloud URL or file path");return`${c.apiBaseUrl}/repositories/${S}/${E}/src/${J}/${De}`}catch(S){throw new Error(`Incorrect URL: ${C}, ${S}`)}}function vn(C){const c={};if(C.username&&C.appPassword){const S=un.from(`${C.username}:${C.appPassword}`,"utf8");c.Authorization=`Basic ${S.toString("base64")}`}return{headers:c}}function Cn(C){const c=C.getString("host");let S=C.getOptionalString("apiBaseUrl");const E=C.getOptionalString("token"),J=C.getOptionalString("username"),ye=C.getOptionalString("password");if(!V(c))throw new Error(`Invalid Bitbucket Server integration config, '${c}' is not a valid host`);return S?S=(0,f.trimEnd)(S,"/"):S=`https://${c}/rest/api/1.0`,{host:c,apiBaseUrl:S,token:E,username:J,password:ye}}function on(C){return C.map(Cn)}class pn{get type(){return"bitbucketServer"}get title(){return this.integrationConfig.host}get config(){return this.integrationConfig}resolveUrl(c){const S=F(c);if(c.lineNumber){const E=new URL(S);return E.hash=c.lineNumber.toString(),E.toString()}return S}resolveEditUrl(c){return c.includes("?")?c.substring(0,c.indexOf("?")):c}constructor(c){(0,r._)(this,"integrationConfig",void 0),this.integrationConfig=c}}(0,r._)(pn,"factory",({config:C})=>{var c;const S=on((c=C.getOptionalConfigArray("integrations.bitbucketServer"))!==null&&c!==void 0?c:[]);return h(S.map(E=>new pn(E)),E=>E.config.host)});var wn=n(48834).lW;async function _e(C,c){const{name:S,owner:E}=parseGitUrl(C);let J=`${c.apiBaseUrl}/projects/${E}/repos/${S}/default-branch`,ye=await fetch(J,Ye(c));if(ye.status===404&&(J=`${c.apiBaseUrl}/projects/${E}/repos/${S}/branches/default`,ye=await fetch(J,Ye(c))),!ye.ok){const et=`Failed to retrieve default branch from ${J}, ${ye.status} ${ye.statusText}`;throw new Error(et)}const{displayId:je}=await ye.json(),De=je;if(!De)throw new Error(`Failed to read default branch from ${J}. Response ${ye.status} ${ye.json()}`);return De}async function Jt(C,c){const{name:S,owner:E,ref:J,filepath:ye}=parseGitUrl(C);let je=J;je||(je=await _e(C,c));const De=ye?`&path=${encodeURIComponent(decodeURIComponent(ye))}`:"";return`${c.apiBaseUrl}/projects/${E}/repos/${S}/archive?format=tgz&at=${je}&prefix=${E}-${S}${De}`}function Wt(C,c){try{const{owner:S,name:E,ref:J,filepathtype:ye,filepath:je}=parseGitUrl(C);if(!S||!E||ye!=="browse"&&ye!=="raw"&&ye!=="src")throw new Error("Invalid Bitbucket Server URL or file path");const De=je.replace(/^\//,"");return`${c.apiBaseUrl}/projects/${S}/repos/${E}/raw/${De}?at=${J}`}catch(S){throw new Error(`Incorrect URL: ${C}, ${S}`)}}function Ye(C){const c={};if(C.token)c.Authorization=`Bearer ${C.token}`;else if(C.username&&C.password){const S=wn.from(`${C.username}:${C.password}`,"utf8");c.Authorization=`Basic ${S.toString("base64")}`}return{headers:c}}function Tn(C){const c=C.getString("host");let S=C.getOptionalString("baseUrl"),E=C.getOptionalString("cloneUrl"),J=C.getOptionalString("gitilesBaseUrl");const ye=C.getOptionalString("username"),je=C.getOptionalString("password");if(V(c)){if(S&&!m(S))throw new Error(`Invalid Gerrit integration config, '${S}' is not a valid baseUrl`);if(E&&!m(E))throw new Error(`Invalid Gerrit integration config, '${E}' is not a valid cloneUrl`);if(J&&!m(J))throw new Error(`Invalid Gerrit integration config, '${J}' is not a valid gitilesBaseUrl`)}else throw new Error(`Invalid Gerrit integration config, '${c}' is not a valid host`);return S?S=(0,f.trimEnd)(S,"/"):S=`https://${c}`,J?J=(0,f.trimEnd)(J,"/"):J=`https://${c}`,E?E=(0,f.trimEnd)(E,"/"):E=S,{host:c,baseUrl:S,cloneUrl:E,gitilesBaseUrl:J,username:ye,password:je}}function sn(C){return C.map(Tn)}var Dn=n(48834).lW;const Rn=")]}'";function In(C,c){const E=c.replace(C.gitilesBaseUrl,"").split("/").filter(Gt=>!!Gt),J=E.indexOf("+");if(J<=0)throw new Error(`Unable to parse project from url: ${c}`);const ye=(0,f.trimStart)(E.slice(0,J).join("/"),"/"),je=E.indexOf("heads");if(je<=0)throw new Error(`Unable to parse branch from url: ${c}`);const De=E[je+1],et=E.slice(je+2).join("/");return{branch:De,filePath:et===""?"/":et,project:ye}}function Kn(C,c,S,E){return`${C.gitilesBaseUrl}/${c}/+/refs/heads/${S}/${(0,f.trimStart)(E,"/")}`}function On(C){return C.password?"/a/":"/"}function Yn(C,c){const{branch:S,project:E}=In(C,c);return`${C.baseUrl}${On(C)}projects/${encodeURIComponent(E)}/branches/${S}`}function we(C,c){const{project:S}=In(C,c);return`${C.cloneUrl}${On(C)}${S}`}function pe(C,c){const{branch:S,filePath:E,project:J}=In(C,c);return`${C.baseUrl}${On(C)}projects/${encodeURIComponent(J)}/branches/${S}/files/${encodeURIComponent(E)}/content`}function Re(C){return`${C.baseUrl}${On(C)}projects/`}function H(C){const c={};if(!C.password)return c;const S=Dn.from(`${C.username}:${C.password}`,"utf8");return c.Authorization=`Basic ${S.toString("base64")}`,{headers:c}}async function N(C){const c=await C.text();if(c.startsWith(Rn))try{return JSON.parse(c.slice(Rn.length))}catch(S){throw new Error(`Invalid response from Gerrit: ${c.slice(0,10)} - ${S}`)}throw new Error(`Gerrit JSON body prefix missing. Found: ${c.slice(0,10)}`)}class le{get type(){return"gerrit"}get title(){return this.integrationConfig.host}get config(){return this.integrationConfig}resolveUrl(c){const{url:S,base:E,lineNumber:J}=c;let ye;if(S.startsWith("/")){const{branch:je,project:De}=In(this.config,E);return Kn(this.config,De,je,S)}return S?ye=new URL(S,E):ye=new URL(E),J&&(ye.hash=J.toString()),ye.toString()}resolveEditUrl(c){return c}constructor(c){(0,r._)(this,"integrationConfig",void 0),this.integrationConfig=c}}(0,r._)(le,"factory",({config:C})=>{var c;const S=sn((c=C.getOptionalConfigArray("integrations.gerrit"))!==null&&c!==void 0?c:[]);return h(S.map(E=>new le(E)),E=>E.config.host)});function Ee(C){const c=C.getString("host");let S=C.getOptionalString("baseUrl");const E=C.getOptionalString("username"),J=C.getOptionalString("password");if(!V(c))throw new Error(`Invalid Gitea integration config, '${c}' is not a valid host`);return S?S=(0,f.trimEnd)(S,"/"):S=`https://${c}`,{host:c,baseUrl:S,username:E,password:J}}var Ue=n(48834).lW;function qe(C,c){try{var S;const E=(S=C.baseUrl)!==null&&S!==void 0?S:`https://${C.host}`,[J,ye,je,De,et,Gt,...xn]=c.replace(E,"").split("/"),qn=xn.join("/").replace(/^\//,"");return`${E}/${ye}/${je}/_edit/${Gt}/${qn}`}catch(E){throw new Error(`Incorrect URL: ${c}, ${E}`)}}function Pt(C,c){try{var S;const E=(S=C.baseUrl)!==null&&S!==void 0?S:`https://${C.host}`,[J,ye,je,De,et,Gt,...xn]=c.replace(E,"").split("/"),qn=xn.join("/").replace(/^\//,"");return`${E}/api/v1/repos/${ye}/${je}/contents/${qn}?ref=${Gt}`}catch(E){throw new Error(`Incorrect URL: ${c}, ${E}`)}}function $t(C){const c={},{username:S,password:E}=C;return E?(S?c.Authorization=`basic ${Ue.from(`${S}:${E}`).toString("base64")}`:c.Authorization=`token ${E}`,{headers:c}):c}class Qt{get type(){return"gitea"}get title(){return this.config.host}resolveUrl(c){return F(c)}resolveEditUrl(c){return qe(this.config,c)}constructor(c){(0,r._)(this,"config",void 0),this.config=c}}(0,r._)(Qt,"factory",({config:C})=>{var c;const E=((c=C.getOptionalConfigArray("integrations.gitea"))!==null&&c!==void 0?c:[]).map(J=>Ee(J));return h(E.map(J=>new Qt(J)),J=>J.config.host)});const Xt="github.com",an="https://api.github.com",ne="https://raw.githubusercontent.com";function te(C){var c,S;const E=(S=C.getOptionalString("host"))!==null&&S!==void 0?S:Xt;let J=C.getOptionalString("apiBaseUrl"),ye=C.getOptionalString("rawBaseUrl");const je=C.getOptionalString("token"),De=(c=C.getOptionalConfigArray("apps"))===null||c===void 0?void 0:c.map(et=>({appId:et.getNumber("appId"),clientId:et.getString("clientId"),clientSecret:et.getString("clientSecret"),webhookSecret:et.getString("webhookSecret"),privateKey:et.getString("privateKey"),allowedInstallationOwners:et.getOptionalStringArray("allowedInstallationOwners")}));if(!V(E))throw new Error(`Invalid GitHub integration config, '${E}' is not a valid host`);return J?J=(0,f.trimEnd)(J,"/"):E===Xt&&(J=an),ye?ye=(0,f.trimEnd)(ye,"/"):E===Xt&&(ye=ne),{host:E,apiBaseUrl:J,rawBaseUrl:ye,token:je,apps:De}}function Y(C){const c=C.map(te);return c.some(S=>S.host===Xt)||c.push({host:Xt,apiBaseUrl:an,rawBaseUrl:ne}),c}function v(C,c,S){try{const{owner:E,name:J,ref:ye,filepathtype:je,filepath:De}=parseGitUrl(C);if(!E||!J||!ye||je!=="blob"&&je!=="raw"&&je!=="tree")throw new Error("Invalid GitHub URL or file path");const et=De.replace(/^\//,"");return M(c,S)==="api"?`${c.apiBaseUrl}/repos/${E}/${J}/contents/${et}?ref=${ye}`:`${c.rawBaseUrl}/${E}/${J}/${ye}/${et}`}catch(E){throw new Error(`Incorrect URL: ${C}, ${E}`)}}function O(C,c){const S={};return M(C,c)==="api"&&(S.Accept="application/vnd.github.v3.raw"),c.token&&(S.Authorization=`token ${c.token}`),{headers:S}}function M(C,c){return C.apiBaseUrl&&(c.token||!C.rawBaseUrl)?"api":"raw"}var G=n(35355),ue=n(89393),be=n(26228);class ke{async getOrCreateToken(c,S,E){let J=this.tokenCache.get(c);if((!J||this.isExpired(J.expiresAt))&&(J=await E(),J.expiresAt=J.expiresAt.minus({minutes:10}),this.tokenCache.set(c,J)),!this.appliesToRepo(J,S))throw new Error(`The Backstage GitHub application used in the ${c} organization does not have access to a repository with the name ${S}`);return{accessToken:J.token}}appliesToRepo(c,S){return S===void 0?!0:c.repositories!==void 0?c.repositories.includes(S):!0}constructor(){(0,r._)(this,"tokenCache",new Map),(0,r._)(this,"isExpired",c=>be.ou.local()>c)}}const Xe={Accept:"application/vnd.github.machine-man-preview+json"};class nt{async getInstallationCredentials(c,S){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,S,async()=>{const{installationId:J,suspended:ye}=await this.getInstallationData(c);if(ye)throw new Error(`The GitHub application for ${c} is suspended`);const je=await this.appClient.apps.createInstallationAccessToken({installation_id:J,headers:Xe});let De;if(je.data.repository_selection==="selected"){const Gt=new ue.v({baseUrl:this.baseUrl,auth:je.data.token}),xn=await Gt.paginate(Gt.apps.listReposAccessibleToInstallation);var et;De=((et=xn.repositories)!==null&&et!==void 0?et:xn).map(mr=>mr.name)}return{token:je.data.token,expiresAt:be.ou.fromISO(je.data.expires_at),repositories:De}})}getInstallations(){return this.appClient.paginate(this.appClient.apps.listInstallations)}async getInstallationData(c){const E=(await this.getInstallations()).find(ye=>{var je;return ye.account&&"login"in ye.account&&((je=ye.account.login)===null||je===void 0?void 0:je.toLocaleLowerCase("en-US"))===c.toLocaleLowerCase("en-US")});if(E)return{installationId:E.id,suspended:Boolean(E.suspended_by)};const J=new Error(`No app installation found for ${c} in ${this.baseAuthConfig.appId}`);throw J.name="NotFoundError",J}constructor(c,S){(0,r._)(this,"appClient",void 0),(0,r._)(this,"baseUrl",void 0),(0,r._)(this,"baseAuthConfig",void 0),(0,r._)(this,"cache",new ke),(0,r._)(this,"allowedInstallationOwners",void 0),this.allowedInstallationOwners=c.allowedInstallationOwners,this.baseUrl=S,this.baseAuthConfig={appId:c.appId,privateKey:c.privateKey.replace(/\\n/gm,`
|
|
33
|
-
`)},this.appClient=new ue.v({baseUrl:S,headers:Xe,authStrategy:G.i,auth:this.baseAuthConfig})}}class yt{async getAllInstallations(){return this.apps.length?(await Promise.all(this.apps.map(S=>S.getInstallations()))).flat():[]}async getAppToken(c,S){if(this.apps.length===0)return;const E=await Promise.all(this.apps.map(De=>De.getInstallationCredentials(c,S).then(et=>({credentials:et,error:void 0}),et=>({credentials:void 0,error:et})))),J=E.find(De=>{var et;return(et=De.credentials)===null||et===void 0?void 0:et.accessToken});if(J)return J.credentials.accessToken;const je=E.map(De=>De.error).find(De=>{var et;return((et=De)===null||et===void 0?void 0:et.name)!=="NotFoundError"});if(je)throw je}constructor(c){var S;(0,r._)(this,"apps",void 0);var E;this.apps=(E=(S=c.apps)===null||S===void 0?void 0:S.map(J=>new nt(J,c.apiBaseUrl)))!==null&&E!==void 0?E:[]}}class bt{async getCredentials(c){const S=W()(c.url),E=S.owner||S.name,J=S.owner?S.name:void 0;let ye="app",je=await this.githubAppCredentialsMux.getAppToken(E,J);return je||(ye="token",je=this.token),{headers:je?{Authorization:`Bearer ${je}`}:void 0,token:je,type:ye}}constructor(c,S){(0,r._)(this,"githubAppCredentialsMux",void 0),(0,r._)(this,"token",void 0),this.githubAppCredentialsMux=c,this.token=S}}(0,r._)(bt,"create",C=>new bt(new yt(C),C.token));class ct{static fromIntegrations(c){const S=new Map;return c.github.list().forEach(E=>{const J=SingleInstanceGithubCredentialsProvider.create(E.config);S.set(E.config.host,J)}),new ct(S)}async getCredentials(c){const S=new URL(c.url),E=this.providers.get(S.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 Oe{get type(){return"github"}get title(){return this.integrationConfig.host}get config(){return this.integrationConfig}resolveUrl(c){return wt(F(c),"tree")}resolveEditUrl(c){return wt(c,"edit")}constructor(c){(0,r._)(this,"integrationConfig",void 0),this.integrationConfig=c}}(0,r._)(Oe,"factory",({config:C})=>{var c;const S=Y((c=C.getOptionalConfigArray("integrations.github"))!==null&&c!==void 0?c:[]);return h(S.map(E=>new Oe(E)),E=>E.config.host)});function wt(C,c){return C.replace(/\/\/([^/]+)\/([^/]+)\/([^/]+)\/(blob|tree|edit)\//,(S,E,J,ye)=>`//${E}/${J}/${ye}/${c}/`)}const _t=null;class jt extends Oe{get config(){return super.config}constructor(c){super(c)}}(0,r._)(jt,"factory",Oe.factory);const Ft=null,qt=null,jn=null,Bt="gitlab.com",mt="https://gitlab.com/api/v4";function Lt(C){const c=C.getString("host");let S=C.getOptionalString("apiBaseUrl");const E=C.getOptionalString("token");let J=C.getOptionalString("baseUrl");if(S?S=(0,f.trimEnd)(S,"/"):c===Bt&&(S=mt),J?J=(0,f.trimEnd)(J,"/"):J=`https://${c}`,V(c)){if(!S||!m(S))throw new Error(`Invalid GitLab integration config, '${S}' is not a valid apiBaseUrl`);if(!m(J))throw new Error(`Invalid GitLab integration config, '${J}' 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:S,baseUrl:J}}function Mt(C){const c=C.map(Lt);return c.some(S=>S.host===Bt)||c.push({host:Bt,apiBaseUrl:mt,baseUrl:`https://${Bt}`}),c}function en(C){let c="";return C.host!==Bt&&(c=new URL(C.baseUrl).pathname),trimEnd(c,"/")}async function pr(C,c){const S=await yn(C,c);return _n(C,S,c).toString()}function fr(C){const{token:c=""}=C;return{headers:{"PRIVATE-TOKEN":c}}}function _n(C,c,S){try{const E=new URL(C),J=E.pathname.split("/blob/").slice(1).join("/blob/"),[ye,...je]=J.split("/"),De=getGitLabIntegrationRelativePath(S);return E.pathname=[...De?[De]:[],"api/v4/projects",c,"repository/files",encodeURIComponent(decodeURIComponent(je.join("/"))),"raw"].join("/"),E.search=`?ref=${ye}`,E}catch(E){throw new Error(`Incorrect url: ${C}, ${E}`)}}async function yn(C,c){const S=new URL(C);if(!S.pathname.includes("/blob/"))throw new Error("Please provide full path to yaml file from GitLab");try{let E=S.pathname.split("/-/blob/")[0].split("/blob/")[0];const J=getGitLabIntegrationRelativePath(c);J&&(E=E.replace(J,""));const ye=new URL(`${S.origin}${J}/api/v4/projects/${encodeURIComponent(E.replace(/^\//,""))}`),je=await fetch(ye.toString(),fr(c)),De=await je.json();if(!je.ok)throw new Error(`GitLab Error '${De.error}', ${De.error_description}`);return Number(De.id)}catch(E){throw new Error(`Could not get GitLab project ID for: ${C}, ${E}`)}}class Mn{get type(){return"gitlab"}get title(){return this.integrationConfig.host}get config(){return this.integrationConfig}resolveUrl(c){return F(c)}resolveEditUrl(c){return gr(c,"edit")}constructor(c){(0,r._)(this,"integrationConfig",void 0),this.integrationConfig=c}}(0,r._)(Mn,"factory",({config:C})=>{var c;const S=Mt((c=C.getOptionalConfigArray("integrations.gitlab"))!==null&&c!==void 0?c:[]);return h(S.map(E=>new Mn(E)),E=>E.config.host)});function gr(C,c){return C.replace(/\/\-\/(blob|tree|edit)\//,`/-/${c}/`)}class Nr{async getCredentials(c){return this.token?{headers:{Authorization:`Bearer ${this.token}`},token:this.token}:{}}constructor(c){(0,r._)(this,"token",void 0),this.token=c}}(0,r._)(Nr,"create",C=>new Nr(C.token));class zn{static fromIntegrations(c){const S=new Map;return c.gitlab.list().forEach(E=>{const J=SingleInstanceGitlabCredentialsProvider.create(E.config);S.set(E.config.host,J)}),new zn(S)}async getCredentials(c){const S=new URL(c.url),E=this.providers.get(S.host);if(!E)throw new Error(`There is no GitLab 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 Fr{static fromConfig(c){return new Fr({awsS3:D.factory({config:c}),azure:Tt.factory({config:c}),bitbucket:$e.factory({config:c}),bitbucketCloud:mn.factory({config:c}),bitbucketServer:pn.factory({config:c}),gerrit:le.factory({config:c}),github:Oe.factory({config:c}),gitlab:Mn.factory({config:c}),gitea:Qt.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 S=Object.values(this.byType).map(E=>E.byUrl(c)).filter(Boolean);if(S.length>1){const E=S.filter(J=>!(J instanceof $e));E.length!==0&&(S=E)}return S[0]}byHost(c){return Object.values(this.byType).map(S=>S.byHost(c)).find(Boolean)}resolveUrl(c){const S=this.byUrl(c.base);return S?S.resolveUrl(c):F(c)}resolveEditUrl(c){const S=this.byUrl(c);return S?S.resolveEditUrl(c):c}constructor(c){(0,r._)(this,"byType",void 0),this.byType=c}}},48514:function(It,Pe,n){"use strict";var r={};n.r(r),n.d(r,{TechDocsPlugin:function(){return w.s4}});var p=n(52322),W=n(2784),f=n(28316),V=n(73557),m=n(60871);const h=(0,m.T0)({id:"plugin.techdocs.storageservice"}),F=(0,m.T0)({id:"plugin.techdocs.service"});var ve=n(92077),ce=n(95481),z=n(7476),de=n(93225),D=n(86317),A=n(65124),se=n(22478),ie=n(85478),ee=n(68435),X=n(3482),K=n(42081),R=n(48431),w=n(89258),I=n(52943),U=n(61886),xe=n(13980),Se=n.n(xe),k=n(87612);class Ge{get(t){for(const o of this.holders){const a=o.get(t);if(a)return a}}constructor(...t){(0,k._)(this,"holders",void 0),this.holders=t}}var xt=n(51837);const Dt=(0,xt.CT)("api-context"),Ut=i=>{var t;const{apis:o,children:a}=i,d=(t=(0,W.useContext)(Dt))===null||t===void 0?void 0:t.atVersion(1),b=d?new Ge(o,d):o;return(0,p.jsx)(Dt.Provider,{value:(0,xt.EI)({1:b}),children:a})};Ut.propTypes={apis:Se().shape({get:Se().func.isRequired}).isRequired,children:Se().node};class Tt{static validateFactories(t,o){for(const a of o){const d=[a],b=new Set;for(;d.length;){const B=d.shift(),Z=t.get(B);if(Z)for(const oe of Object.values(Z.deps)){if(oe.id===a.id)throw new Error(`Circular dependency of api factory for ${a}`);b.has(oe)||(b.add(oe),d.push(oe))}}}}get(t){return this.load(t)}load(t,o=[]){const a=this.apis.get(t.id);if(a)return a;const d=this.factories.get(t);if(!d)return;if(o.includes(d.api))throw new Error(`Circular dependency of api factory for ${d.api}`);const b=this.loadDeps(t,d.deps,[...o,d.api]),B=d.factory(b);return this.apis.set(t.id,B),B}loadDeps(t,o,a){const d={};for(const b in o)if(o.hasOwnProperty(b)){const B=o[b],Z=this.load(B,a);if(!Z)throw new Error(`No API factory available for dependency ${B} of dependent ${t}`);d[b]=Z}return d}constructor(t){(0,k._)(this,"factories",void 0),(0,k._)(this,"apis",void 0),this.factories=t,this.apis=new Map}}var Nt;(function(i){i[i.default=10]="default",i[i.app=50]="app",i[i.static=100]="static"})(Nt||(Nt={}));class Yt{register(t,o){const a=Nt[t],d=this.factories.get(o.api.id);return d&&d.priority>=a?!1:(this.factories.set(o.api.id,{priority:a,factory:o}),!0)}get(t){const o=this.factories.get(t.id);if(o)return o.factory}getAllApis(){const t=new Set;for(const{factory:o}of this.factories.values())t.add(o.api);return t}constructor(){(0,k._)(this,"factories",new Map)}}function dt(i){return new Promise((t,o)=>{const a=i.width||500,d=i.height||700,b=window.screen.width/2-a/2,B=window.screen.height/2-d/2,Z=window.open(i.url,i.name,`menubar=no,location=no,resizable=no,scrollbars=no,status=no,width=${a},height=${d},top=${B},left=${b}`);let oe="";if(!Z||typeof Z.closed=="undefined"||Z.closed){const Fe=new Error("Failed to open auth popup.");Fe.name="PopupRejectedError",o(Fe);return}const me=Fe=>{if(Fe.source!==Z||Fe.origin!==i.origin)return;const{data:Je}=Fe;if(Je.type==="config_info"){oe=Je.targetOrigin;return}if(Je.type!=="authorization_response")return;const st=Je;if("error"in st){const tn=new Error(st.error.message);tn.name=st.error.name,o(tn)}else t(st.response);Te()},Me=setInterval(()=>{if(Z.closed){const Fe=`Login failed, ${oe&&oe!==window.location.origin?`Incorrect app origin, expected ${oe}`:"popup was closed"}`,Je=new Error(Fe);Je.name="PopupClosedError",o(Je),Te()}},100);function Te(){window.removeEventListener("message",me),clearInterval(Me)}window.addEventListener("message",me)})}let ut=!1;function St(i){return[...i].join(" ")}class lt{async createSession(t){return t.instantPopup?this.enableExperimentalRedirectFlow?this.executeRedirect(t.scopes):this.showPopup(t.scopes):this.authRequester(t.scopes)}async refreshSession(t){const o=await fetch(await this.buildUrl("/refresh",{optional:!0,...t&&{scope:this.joinScopesFunc(t)}}),{headers:{"x-requested-with":"XMLHttpRequest"},credentials:"include"}).catch(d=>{throw new Error(`Auth refresh request failed, ${d}`)});if(!o.ok){const d=new Error(`Auth refresh request failed, ${o.statusText}`);throw d.status=o.status,d}const a=await o.json();if(a.error){const d=new Error(a.error.message);throw a.error.name&&(d.name=a.error.name),d}return await this.sessionTransform(a)}async removeSession(){const t=await fetch(await this.buildUrl("/logout"),{method:"POST",headers:{"x-requested-with":"XMLHttpRequest"},credentials:"include"}).catch(o=>{throw new Error(`Logout request failed, ${o}`)});if(!t.ok){const o=new Error(`Logout request failed, ${t.statusText}`);throw o.status=t.status,o}}async showPopup(t){var o,a,d,b,B,Z,oe,me;const Me=this.joinScopesFunc(t),Te=await this.buildUrl("/start",{scope:Me,origin:window.location.origin,flow:"popup"}),Fe=!((a=this.popupOptions)===null||a===void 0||(o=a.size)===null||o===void 0)&&o.fullscreen?window.screen.width:((b=this.popupOptions)===null||b===void 0||(d=b.size)===null||d===void 0?void 0:d.width)||450,Je=!((Z=this.popupOptions)===null||Z===void 0||(B=Z.size)===null||B===void 0)&&B.fullscreen?window.screen.height:((me=this.popupOptions)===null||me===void 0||(oe=me.size)===null||oe===void 0?void 0:oe.height)||730,st=await dt({url:Te,name:`${this.provider.title} Login`,origin:new URL(Te).origin,width:Fe,height:Je});return await this.sessionTransform(st)}async executeRedirect(t){const o=this.joinScopesFunc(t);return window.location.href=await this.buildUrl("/start",{scope:o,origin:window.location.origin,redirectUrl:window.location.href,flow:"redirect"}),new Promise(()=>{})}async buildUrl(t,o){const a=await this.discoveryApi.getBaseUrl("auth"),d=this.buildQueryString({...o,env:this.environment});return`${a}/${this.provider.id}${t}${d}`}buildQueryString(t){if(!t)return"";const o=Object.entries(t).map(([a,d])=>{if(typeof d=="string")return`${encodeURIComponent(a)}=${encodeURIComponent(d)}`;if(d)return encodeURIComponent(a)}).filter(Boolean).join("&");return o?`?${o}`:""}constructor(t){(0,k._)(this,"discoveryApi",void 0),(0,k._)(this,"environment",void 0),(0,k._)(this,"provider",void 0),(0,k._)(this,"joinScopesFunc",void 0),(0,k._)(this,"authRequester",void 0),(0,k._)(this,"sessionTransform",void 0),(0,k._)(this,"enableExperimentalRedirectFlow",void 0),(0,k._)(this,"popupOptions",void 0);const{configApi:o,discoveryApi:a,environment:d,provider:b,joinScopes:B=St,oauthRequestApi:Z,sessionTransform:oe=Te=>Te,popupOptions:me}=t;!ut&&!o&&(console.warn("DEPRECATION WARNING: Authentication providers require a configApi instance to configure the authentication flow. Please provide one to the authentication provider constructor."),ut=!0);var Me;this.enableExperimentalRedirectFlow=o&&(Me=o.getOptionalBoolean("enableExperimentalRedirectFlow"))!==null&&Me!==void 0?Me:!1,this.authRequester=Z.createAuthRequester({provider:b,onAuthRequest:async Te=>this.enableExperimentalRedirectFlow?this.executeRedirect(Te):this.showPopup(Te)}),this.discoveryApi=a,this.environment=d,this.provider=b,this.joinScopesFunc=B,this.sessionTransform=oe,this.popupOptions=me}}function Zt(i,t){for(const o of t)if(!i.has(o))return!1;return!0}class Ht{sessionExistsAndHasScope(t,o){if(!t)return!1;if(!o||this.options.sessionScopes===void 0)return!0;const a=this.options.sessionScopes(t);return Zt(a,o)}getExtendedScope(t,o){const a=new Set(this.options.defaultScopes);if(t&&this.options.sessionScopes!==void 0){const d=this.options.sessionScopes(t);for(const b of d)a.add(b)}if(o)for(const d of o)a.add(d);return a}constructor(t){(0,k._)(this,"options",void 0),this.options=t}}var Ce=n(82394),$e=n.n(Ce);let Ke=Symbol.observable;class ht{[Ke](){return this}get closed(){return this.isClosed}next(t){if(this.isClosed)throw new Error("PublishSubject is closed");this.subscribers.forEach(o=>o.next(t))}error(t){if(this.isClosed)throw new Error("PublishSubject is closed");this.isClosed=!0,this.terminatingError=t,this.subscribers.forEach(o=>o.error(t))}complete(){if(this.isClosed)throw new Error("PublishSubject is closed");this.isClosed=!0,this.subscribers.forEach(t=>t.complete())}subscribe(t,o,a){const d=typeof t=="function"?{next:t,error:o,complete:a}:t;return this.observable.subscribe(d)}constructor(){(0,k._)(this,"isClosed",!1),(0,k._)(this,"terminatingError",void 0),(0,k._)(this,"observable",new($e())(t=>this.isClosed?(this.terminatingError?t.error(this.terminatingError):t.complete(),()=>{}):(this.subscribers.add(t),()=>{this.subscribers.delete(t)}))),(0,k._)(this,"subscribers",new Set)}}let rt=Symbol.observable;class tt{[rt](){return this}get closed(){return this.isClosed}next(t){if(this.isClosed)throw new Error("BehaviorSubject is closed");this.currentValue=t,this.subscribers.forEach(o=>o.next(t))}error(t){if(this.isClosed)throw new Error("BehaviorSubject is closed");this.isClosed=!0,this.terminatingError=t,this.subscribers.forEach(o=>o.error(t))}complete(){if(this.isClosed)throw new Error("BehaviorSubject is closed");this.isClosed=!0,this.subscribers.forEach(t=>t.complete())}subscribe(t,o,a){const d=typeof t=="function"?{next:t,error:o,complete:a}:t;return this.observable.subscribe(d)}constructor(t){(0,k._)(this,"isClosed",void 0),(0,k._)(this,"currentValue",void 0),(0,k._)(this,"terminatingError",void 0),(0,k._)(this,"observable",void 0),(0,k._)(this,"subscribers",new Set),this.isClosed=!1,this.currentValue=t,this.terminatingError=void 0,this.observable=new($e())(o=>this.isClosed?(this.terminatingError?o.error(this.terminatingError):o.complete(),()=>{}):(o.next(this.currentValue),this.subscribers.add(o),()=>{this.subscribers.delete(o)}))}}class vt{setIsSignedIn(t){this.signedIn!==t&&(this.signedIn=t,this.subject.next(this.signedIn?m.sM.SignedIn:m.sM.SignedOut))}sessionState$(){return this.subject}constructor(){(0,k._)(this,"subject",new tt(m.sM.SignedOut)),(0,k._)(this,"signedIn",!1)}}class ot{async getSession(t){if(this.helper.sessionExistsAndHasScope(this.currentSession,t.scopes)){if(!this.sessionShouldRefreshFunc(this.currentSession))return this.currentSession;try{const a=await this.collapsedSessionRefresh(t.scopes),d=this.sessionScopesFunc(this.currentSession),b=this.sessionScopesFunc(a);return Zt(b,d)&&(this.currentSession=a),a}catch(a){if(t.optional)return;throw a}}if(!this.currentSession&&!t.instantPopup)try{const o=await this.collapsedSessionRefresh(t.scopes);return this.currentSession=o,this.getSession(t)}catch{}if(!t.optional)return this.currentSession=await this.connector.createSession({...t,scopes:this.helper.getExtendedScope(this.currentSession,t.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(t){if(this.refreshPromise)return this.refreshPromise;this.refreshPromise=this.connector.refreshSession(t);try{const o=await this.refreshPromise;return this.stateTracker.setIsSignedIn(!0),o}finally{delete this.refreshPromise}}constructor(t){(0,k._)(this,"connector",void 0),(0,k._)(this,"helper",void 0),(0,k._)(this,"sessionScopesFunc",void 0),(0,k._)(this,"sessionShouldRefreshFunc",void 0),(0,k._)(this,"stateTracker",new vt),(0,k._)(this,"refreshPromise",void 0),(0,k._)(this,"currentSession",void 0);const{connector:o,defaultScopes:a=new Set,sessionScopes:d,sessionShouldRefresh:b}=t;this.connector=o,this.sessionScopesFunc=d,this.sessionShouldRefreshFunc=b,this.helper=new Ht({sessionScopes:d,defaultScopes:a})}}class Qe{setSession(t){this.currentSession=t,this.stateTracker.setIsSignedIn(Boolean(t))}async getSession(t){if(this.helper.sessionExistsAndHasScope(this.currentSession,t.scopes))return this.currentSession;if(!t.optional)return this.currentSession=await this.connector.createSession({...t,scopes:this.helper.getExtendedScope(this.currentSession,t.scopes)}),this.stateTracker.setIsSignedIn(!0),this.currentSession}async removeSession(){this.currentSession=void 0,this.stateTracker.setIsSignedIn(!1)}sessionState$(){return this.stateTracker.sessionState$()}constructor(t){_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:o,defaultScopes:a=new Set,sessionScopes:d}=t;this.connector=o,this.helper=new SessionScopeHelper({sessionScopes:d,defaultScopes:a})}}const ft={id:"oauth2",title:"Your Identity Provider",icon:()=>null};class gt{static create(t){const{configApi:o,discoveryApi:a,environment:d="development",provider:b=ft,oauthRequestApi:B,defaultScopes:Z=[],scopeTransform:oe=Fe=>Fe,popupOptions:me}=t,Me=new lt({configApi:o,discoveryApi:a,environment:d,provider:b,oauthRequestApi:B,sessionTransform(Fe){return{...Fe,providerInfo:{idToken:Fe.providerInfo.idToken,accessToken:Fe.providerInfo.accessToken,scopes:gt.normalizeScopes(oe,Fe.providerInfo.scope),expiresAt:new Date(Date.now()+Fe.providerInfo.expiresInSeconds*1e3)}}},popupOptions:me}),Te=new ot({connector:Me,defaultScopes:new Set(Z),sessionScopes:Fe=>Fe.providerInfo.scopes,sessionShouldRefresh:Fe=>(Fe.providerInfo.expiresAt.getTime()-Date.now())/1e3<60*5});return new gt({sessionManager:Te,scopeTransform:oe})}async signIn(){await this.getAccessToken()}async signOut(){await this.sessionManager.removeSession()}sessionState$(){return this.sessionManager.sessionState$()}async getAccessToken(t,o){var a;const d=gt.normalizeScopes(this.scopeTransform,t),b=await this.sessionManager.getSession({...o,scopes:d});var B;return(B=(a=b)===null||a===void 0?void 0:a.providerInfo.accessToken)!==null&&B!==void 0?B:""}async getIdToken(t={}){var o;const a=await this.sessionManager.getSession({...t,scopes:new Set(["openid"])});var d;return(d=(o=a)===null||o===void 0?void 0:o.providerInfo.idToken)!==null&&d!==void 0?d:""}async getBackstageIdentity(t={}){var o;return(o=await this.sessionManager.getSession(t))===null||o===void 0?void 0:o.backstageIdentity}async getProfile(t={}){var o;return(o=await this.sessionManager.getSession(t))===null||o===void 0?void 0:o.profile}static normalizeScopes(t,o){if(!o)return new Set;const a=Array.isArray(o)?o:o.split(/[\s|,]/).filter(Boolean);return new Set(t(a))}constructor(t){(0,k._)(this,"sessionManager",void 0),(0,k._)(this,"scopeTransform",void 0),this.sessionManager=t.sessionManager,this.scopeTransform=t.scopeTransform}}const Ct={id:"github",title:"GitHub",icon:()=>null};class mn{static create(t){const{configApi:o,discoveryApi:a,environment:d="development",provider:b=Ct,oauthRequestApi:B,defaultScopes:Z=["read:user"]}=t;return gt.create({configApi:o,discoveryApi:a,oauthRequestApi:B,provider:b,environment:d,defaultScopes:Z})}}const un={id:"gitlab",title:"GitLab",icon:()=>null};class ln{static create(t){const{configApi:o,discoveryApi:a,environment:d="development",provider:b=un,oauthRequestApi:B,defaultScopes:Z=["read_user"]}=t;return gt.create({configApi:o,discoveryApi:a,oauthRequestApi:B,provider:b,environment:d,defaultScopes:Z})}}const Sn={id:"google",title:"Google",icon:()=>null},hn="https://www.googleapis.com/auth/";class vn{static create(t){const{configApi:o,discoveryApi:a,oauthRequestApi:d,environment:b="development",provider:B=Sn,defaultScopes:Z=["openid",`${hn}userinfo.email`,`${hn}userinfo.profile`]}=t;return gt.create({configApi:o,discoveryApi:a,oauthRequestApi:d,provider:B,environment:b,defaultScopes:Z,scopeTransform(oe){return oe.map(me=>me==="openid"?me:me==="profile"||me==="email"?`${hn}userinfo.${me}`:me.startsWith(hn)?me:`${hn}${me}`)}})}}const Cn={id:"okta",title:"Okta",icon:()=>null},on=new Set(["openid","profile","email","phone","address","groups","offline_access"]),pn="okta.";class wn{static create(t){const{configApi:o,discoveryApi:a,environment:d="development",provider:b=Cn,oauthRequestApi:B,defaultScopes:Z=["openid","email","profile","offline_access"]}=t;return gt.create({configApi:o,discoveryApi:a,oauthRequestApi:B,provider:b,environment:d,defaultScopes:Z,scopeTransform(oe){return oe.map(me=>on.has(me)||me.startsWith(pn)?me:`${pn}${me}`)}})}}var _e=n(30195);const Jt=_e.z.object({profile:_e.z.object({email:_e.z.string().optional(),displayName:_e.z.string().optional(),picture:_e.z.string().optional()}),backstageIdentity:_e.z.object({token:_e.z.string(),identity:_e.z.object({type:_e.z.literal("user"),userEntityRef:_e.z.string(),ownershipEntityRefs:_e.z.array(_e.z.string())})})}),Wt={id:"saml",title:"SAML",icon:()=>null};class Ye{static create(t){const{discoveryApi:o,environment:a="development",provider:d=Wt}=t,b=new DirectAuthConnector({discoveryApi:o,environment:a,provider:d}),B=new StaticAuthSessionManager({connector:b}),Z=new AuthSessionStore({manager:B,storageKey:`${d.id}Session`,schema:samlSessionSchema});return new Ye(Z)}sessionState$(){return this.sessionManager.sessionState$()}async signIn(){await this.getBackstageIdentity({})}async signOut(){await this.sessionManager.removeSession()}async getBackstageIdentity(t={}){var o;return(o=await this.sessionManager.getSession(t))===null||o===void 0?void 0:o.backstageIdentity}async getProfile(t={}){var o;return(o=await this.sessionManager.getSession(t))===null||o===void 0?void 0:o.profile}constructor(t){_define_property(this,"sessionManager",void 0),this.sessionManager=t}}const Tn={id:"microsoft",title:"Microsoft",icon:()=>null};class sn{static create(t){return new sn(t)}microsoftGraph(){return this.oauth2[sn.MicrosoftGraphID]}static resourceForScopes(t){const o=[...new Set(t.split(" ").map(sn.resourceForScope).filter(b=>b!=="openid"))];if(o.length>1)return Promise.reject(new Error(`Requested access token with scopes from multiple Azure resources: ${o.join(", ")}. Access tokens can only have a single audience.`));var a;const d=(a=o[0])!==null&&a!==void 0?a:sn.MicrosoftGraphID;return Promise.resolve(d)}static resourceForScope(t){var o;const a=(o=t.match(RegExp("^(?<resourceURI>.*)\\/(?<scp>[^\\/]*)$")))===null||o===void 0?void 0:o.groups;if(a){const{resourceURI:d}=a;return d.replace(/^api:\/\//,"")}switch(t){case"email":case"openid":case"offline_access":case"profile":return"openid";default:return sn.MicrosoftGraphID}}async getAccessToken(t,o){const a=t===void 0?sn.MicrosoftGraphID:await sn.resourceForScopes(Array.isArray(t)?t.join(" "):t);return a in this.oauth2||(this.oauth2[a]=gt.create({configApi:this.configApi,discoveryApi:this.discoveryApi,oauthRequestApi:this.oauthRequestApi,provider:this.provider,environment:this.environment,scopeTransform:this.scopeTransform})),this.oauth2[a].getAccessToken(t,o)}getIdToken(t){return this.microsoftGraph().getIdToken(t)}getProfile(t){return this.microsoftGraph().getProfile(t)}getBackstageIdentity(t){return this.microsoftGraph().getBackstageIdentity(t)}signIn(){return this.microsoftGraph().signIn()}signOut(){return this.microsoftGraph().signOut()}sessionState$(){return this.microsoftGraph().sessionState$()}constructor(t){(0,k._)(this,"oauth2",void 0),(0,k._)(this,"configApi",void 0),(0,k._)(this,"environment",void 0),(0,k._)(this,"provider",void 0),(0,k._)(this,"oauthRequestApi",void 0),(0,k._)(this,"discoveryApi",void 0),(0,k._)(this,"scopeTransform",void 0);const{configApi:o,environment:a="development",provider:d=Tn,oauthRequestApi:b,discoveryApi:B,defaultScopes:Z=["openid","offline_access","profile","email","User.Read"],scopeTransform:oe=me=>me.concat("offline_access")}=t;this.configApi=o,this.environment=a,this.provider=d,this.oauthRequestApi=b,this.discoveryApi=B,this.scopeTransform=oe,this.oauth2={[sn.MicrosoftGraphID]:gt.create({configApi:this.configApi,discoveryApi:this.discoveryApi,oauthRequestApi:this.oauthRequestApi,provider:this.provider,environment:this.environment,scopeTransform:this.scopeTransform,defaultScopes:Z})}}}(0,k._)(sn,"MicrosoftGraphID","00000003-0000-0000-c000-000000000000");const Dn={id:"onelogin",title:"onelogin",icon:()=>null},Rn=new Set(["openid","profile","email","phone","address","groups","offline_access"]),In="onelogin.";class Kn{static create(t){const{configApi:o,discoveryApi:a,environment:d="development",provider:b=Dn,oauthRequestApi:B}=t;return gt.create({configApi:o,discoveryApi:a,oauthRequestApi:B,provider:b,environment:d,defaultScopes:["openid","email","profile","offline_access"],scopeTransform(Z){return Z.map(oe=>Rn.has(oe)||oe.startsWith(In)?oe:`${In}${oe}`)}})}}const On={id:"bitbucket",title:"Bitbucket",icon:()=>null};class Yn{static create(t){const{configApi:o,discoveryApi:a,environment:d="development",provider:b=On,oauthRequestApi:B,defaultScopes:Z=["team"]}=t;return gt.create({configApi:o,discoveryApi:a,oauthRequestApi:B,provider:b,environment:d,defaultScopes:Z})}}const we={id:"bitbucketServer",title:"Bitbucket Server",icon:()=>null};class pe{static create(t){const{configApi:o,discoveryApi:a,environment:d="development",provider:b=we,oauthRequestApi:B,defaultScopes:Z=["PROJECT_ADMIN"]}=t;return gt.create({configApi:o,discoveryApi:a,oauthRequestApi:B,provider:b,environment:d,defaultScopes:Z})}}const Re={id:"atlassian",title:"Atlassian",icon:()=>null};class H{static create(t){const{configApi:o,discoveryApi:a,environment:d="development",provider:b=Re,oauthRequestApi:B}=t;return gt.create({configApi:o,discoveryApi:a,oauthRequestApi:B,provider:b,environment:d})}}class N{post(t){this.subject.next(t)}alert$(){return this.subject}constructor(){(0,k._)(this,"subject",new ht)}}class le{captureEvent(t){}}const Ee="theme";class Ue{static createWithStorage(t){const o=new Ue(t);if(!window.localStorage)return o;var a;const d=(a=window.localStorage.getItem(Ee))!==null&&a!==void 0?a:void 0;return o.setActiveThemeId(d),o.activeThemeId$().subscribe(b=>{b?window.localStorage.setItem(Ee,b):window.localStorage.removeItem(Ee)}),window.addEventListener("storage",b=>{if(b.key===Ee){var B;const Z=(B=localStorage.getItem(Ee))!==null&&B!==void 0?B:void 0;o.setActiveThemeId(Z)}}),o}getInstalledThemes(){return this.themes.slice()}activeThemeId$(){return this.subject}getActiveThemeId(){return this.activeThemeId}setActiveThemeId(t){this.activeThemeId=t,this.subject.next(t)}constructor(t){(0,k._)(this,"themes",void 0),(0,k._)(this,"activeThemeId",void 0),(0,k._)(this,"subject",void 0),this.themes=t,this.subject=new tt(void 0)}}var qe=n(9850),Pt=n.n(qe),$t=n(12782),Qt=n.n($t);const Xt=/^[a-z][a-z0-9]*(?:[-_][a-z][a-z0-9]*)*$/i;function an(i){return typeof i=="object"&&i!==null&&!Array.isArray(i)}function ne(i){if(i===null)return"null";if(Array.isArray(i))return"array";const t=typeof i;return t==="number"&&isNaN(i)?"nan":t==="string"&&i===""?"empty-string":t}const te={type(i,t,o,a){return`Invalid type in config for key '${i}' in '${t}', got ${o}, wanted ${a}`},missing(i){return`Missing required config value at '${i}'`},convert(i,t,o){return`Unable to convert config value for key '${i}' in '${t}' to a ${o}`}};class Y{static fromConfigs(t){return t.length===0?new Y(void 0):t.reduce((o,{data:a,context:d,filteredKeys:b,deprecatedKeys:B})=>{const Z=new Y(a,d,o);if(Z.filteredKeys=b,B)for(const{key:oe,description:me}of B)console.warn(`The configuration key '${oe}' of ${d} is deprecated and may be removed soon. ${me||""}`);return Z},void 0)}has(t){var o;if(this.readValue(t)!==void 0)return!0;var d;return(d=(o=this.fallback)===null||o===void 0?void 0:o.has(t))!==null&&d!==void 0?d:!1}keys(){var t;const o=this.data?Object.keys(this.data):[];var a;const d=(a=(t=this.fallback)===null||t===void 0?void 0:t.keys())!==null&&a!==void 0?a:[];return[...new Set([...o,...d])]}get(t){const o=this.getOptional(t);if(o===void 0)throw new Error(te.missing(this.fullKey(t!=null?t:"")));return o}getOptional(t){var o;const a=Pt()(this.readValue(t)),d=(o=this.fallback)===null||o===void 0?void 0:o.getOptional(t);if(a===void 0){if(!1)var b;return d}else if(d===void 0)return a;return Qt()({},{value:d},{value:a},(B,Z)=>!an(Z)||!an(B)?Z:void 0).value}getConfig(t){const o=this.getOptionalConfig(t);if(o===void 0)throw new Error(te.missing(this.fullKey(t)));return o}getOptionalConfig(t){var o;const a=this.readValue(t),d=(o=this.fallback)===null||o===void 0?void 0:o.getOptionalConfig(t);if(an(a))return this.copy(a,t,d);if(a!==void 0)throw new TypeError(te.type(this.fullKey(t),this.context,ne(a),"object"));return d}getConfigArray(t){const o=this.getOptionalConfigArray(t);if(o===void 0)throw new Error(te.missing(this.fullKey(t)));return o}getOptionalConfigArray(t){const o=this.readConfigValue(t,d=>{if(!Array.isArray(d))return{expected:"object-array"};for(const[b,B]of d.entries())if(!an(B))return{expected:"object-array",value:B,key:`${t}[${b}]`};return!0});if(!o){if(!1)var a;return}return o.map((d,b)=>this.copy(d,`${t}[${b}]`))}getNumber(t){const o=this.getOptionalNumber(t);if(o===void 0)throw new Error(te.missing(this.fullKey(t)));return o}getOptionalNumber(t){const o=this.readConfigValue(t,d=>typeof d=="number"||typeof d=="string"||{expected:"number"});if(typeof o=="number"||o===void 0)return o;const a=Number(o);if(!Number.isFinite(a))throw new Error(te.convert(this.fullKey(t),this.context,"number"));return a}getBoolean(t){const o=this.getOptionalBoolean(t);if(o===void 0)throw new Error(te.missing(this.fullKey(t)));return o}getOptionalBoolean(t){const o=this.readConfigValue(t,d=>typeof d=="boolean"||typeof d=="number"||typeof d=="string"||{expected:"boolean"});if(typeof o=="boolean"||o===void 0)return o;const a=String(o).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(te.convert(this.fullKey(t),this.context,"boolean"))}getString(t){const o=this.getOptionalString(t);if(o===void 0)throw new Error(te.missing(this.fullKey(t)));return o}getOptionalString(t){return this.readConfigValue(t,o=>typeof o=="string"&&o!==""||{expected:"string"})}getStringArray(t){const o=this.getOptionalStringArray(t);if(o===void 0)throw new Error(te.missing(this.fullKey(t)));return o}getOptionalStringArray(t){return this.readConfigValue(t,o=>{if(!Array.isArray(o))return{expected:"string-array"};for(const[a,d]of o.entries())if(typeof d!="string"||d==="")return{expected:"string-array",value:d,key:`${t}[${a}]`};return!0})}fullKey(t){return`${this.prefix}${this.prefix?".":""}${t}`}copy(t,o,a){const d=new Y(t,this.context,a,this.fullKey(o));return d.filteredKeys=this.filteredKeys,d}readConfigValue(t,o){const a=this.readValue(t);if(a===void 0){var d;if(!1)var b;return(d=this.fallback)===null||d===void 0?void 0:d.readConfigValue(t,o)}const B=o(a);if(B!==!0){const{key:Z=t,value:oe=a,expected:me}=B;throw new TypeError(te.type(this.fullKey(Z),this.context,ne(oe),me))}return a}readValue(t){const o=t?t.split("."):[];for(const d of o)if(!Xt.test(d))throw new TypeError(`Invalid config key '${t}'`);if(this.data===void 0)return;let a=this.data;for(const[d,b]of o.entries())if(an(a))a=a[b];else if(a!==void 0){const B=this.fullKey(o.slice(0,d).join("."));throw new TypeError(te.type(B,this.context,ne(a),"object"))}return a}constructor(t,o="mock-config",a,d=""){(0,k._)(this,"data",void 0),(0,k._)(this,"context",void 0),(0,k._)(this,"fallback",void 0),(0,k._)(this,"prefix",void 0),(0,k._)(this,"filteredKeys",void 0),(0,k._)(this,"notifiedFilteredKeys",void 0),this.data=t,this.context=o,this.fallback=a,this.prefix=d,this.notifiedFilteredKeys=new Set}}const v="Invalid discovery URL pattern,";class O{static compile(t){const o=t.split(/\{\{\s*pluginId\s*\}\}/),a=o.join("pluginId");let d;try{d=new URL(a)}catch{throw new Error(`${v} URL '${a}' is invalid`)}if(d.hash)throw new Error(`${v} URL must not have a hash`);if(d.search)throw new Error(`${v} URL must not have a query`);if(a.endsWith("/"))throw new Error(`${v} URL must not end with a slash`);return new O(o)}async getBaseUrl(t){return this.parts.join(encodeURIComponent(t))}constructor(t){(0,k._)(this,"parts",void 0),this.parts=t}}class M{post(t,o){var a;return!((a=o)===null||a===void 0)&&a.hidden||this.alertApi.post({message:t.message,severity:"error"}),this.errorApi.post(t,o)}error$(){return this.errorApi.error$()}constructor(t,o){(0,k._)(this,"alertApi",void 0),(0,k._)(this,"errorApi",void 0),this.alertApi=t,this.errorApi=o}}class G{post(t,o){this.subject.next({error:t,context:o})}error$(){return this.subject}constructor(){(0,k._)(this,"subject",new ht)}}class ue{static forward(t,o){window.addEventListener("unhandledrejection",a=>{t.post(a.reason,o)})}}function be(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 ke{registerFlag(t){be(t.name),this.registeredFeatureFlags.push(t)}getRegisteredFlags(){return this.registeredFeatureFlags.slice()}isActive(t){return this.flags||(this.flags=this.load()),this.flags.get(t)===m.CL.Active}save(t){this.flags||(this.flags=this.load()),t.merge||this.flags.clear();for(const[a,d]of Object.entries(t.states))this.flags.set(a,d);const o=Array.from(this.flags.entries()).filter(([,a])=>a===m.CL.Active);window.localStorage.setItem("featureFlags",JSON.stringify(Object.fromEntries(o)))}load(){try{const t=window.localStorage.getItem("featureFlags");if(!t)return new Map;const o=JSON.parse(t);if(typeof o!="object"||o===null||Array.isArray(o))return new Map;const a=Object.entries(o).filter(([d,b])=>(be(d),b===m.CL.Active));return new Map(a)}catch{return new Map}}constructor(){(0,k._)(this,"registeredFeatureFlags",[]),(0,k._)(this,"flags",void 0)}}function Xe(i){let t=i.baseImplementation||n.g.fetch;var o;const a=[(o=i.middleware)!==null&&o!==void 0?o:[]].flat().reverse();for(const d of a)t=d.apply(t);return{fetch:t}}class nt{static create(t){var o,a;const d=yt(t),b=((o=t.header)===null||o===void 0?void 0:o.name)||"authorization",B=((a=t.header)===null||a===void 0?void 0:a.value)||(Z=>`Bearer ${Z}`);return new nt(t.identityApi,d,b,B)}apply(t){return async(o,a)=>{const d=new Request(o,a),{token:b}=await this.identityApi.getCredentials();return d.headers.get(this.headerName)||typeof b!="string"||!b||!this.allowUrl(d.url)?t(o,a):(d.headers.set(this.headerName,this.headerValue(b)),t(d))}}constructor(t,o,a,d){(0,k._)(this,"identityApi",void 0),(0,k._)(this,"allowUrl",void 0),(0,k._)(this,"headerName",void 0),(0,k._)(this,"headerValue",void 0),this.identityApi=t,this.allowUrl=o,this.headerName=a,this.headerValue=d}}function yt(i){return i.allowUrl?i.allowUrl:i.urlPrefixAllowlist?bt(i.urlPrefixAllowlist):i.config?bt([i.config.getString("backend.baseUrl")]):()=>!1}function bt(i){const t=i.map(o=>o.replace(/\/$/,""));return o=>t.some(a=>o===a||o.startsWith(`${a}/`))}function ct(i,t){return!t||t==="/"?i:`${i.replace(/\/$/,"")}/${t.replace(/^\//,"")}`}class Oe{apply(t){return async(o,a)=>{const d=new Request(o,a),b="plugin://";if(!d.url.startsWith(b))return t(o,a);const{hostname:B,pathname:Z,search:oe,hash:me,username:Me,password:Te}=new URL(`http://${d.url.substring(b.length)}`);let Fe=await this.discoveryApi.getBaseUrl(B);if(Me||Te){const st=new URL(Fe),tn=`${Me}${Te?`:${Te}`:""}@`;Fe=`${st.protocol}//${tn}${st.host}${st.pathname}`}const Je=`${ct(Fe,Z)}${oe}${me}`;return t(Je,typeof o=="string"||wt(o)?a:o)}}constructor(t){(0,k._)(this,"discoveryApi",void 0),this.discoveryApi=t}}function wt(i){var t;return typeof i=="object"&&((t=i)===null||t===void 0?void 0:t.constructor)===URL}class _t{static resolvePluginProtocol(t){return new Oe(t.discoveryApi)}static injectIdentityAuth(t){return nt.create(t)}constructor(){}}function jt(i,t){for(const o of t)if(!i.has(o))return!1;return!0}function Ft(i,...t){const o=new Set(i);for(const a of t)for(const d of a)o.add(d);return o}class qt{request(t){return new Promise((o,a)=>{this.requests.push({scopes:t,resolve:o,reject:a}),this.subject.next(this.getCurrentPending())})}resolve(t,o){this.requests=this.requests.filter(a=>jt(t,a.scopes)?(a.resolve(o),!1):!0),this.subject.next(this.getCurrentPending())}reject(t){this.requests.forEach(o=>o.reject(t)),this.requests=[],this.subject.next(this.getCurrentPending())}pending(){return this.subject}getCurrentPending(){const t=this.requests.length===0?void 0:this.requests.slice(1).reduce((o,a)=>Ft(o,a.scopes),this.requests[0].scopes);return{scopes:t,resolve:o=>{t&&this.resolve(t,o)},reject:o=>{t&&this.reject(o)}}}constructor(){(0,k._)(this,"requests",[]),(0,k._)(this,"subject",new tt(this.getCurrentPending()))}}class jn{createAuthRequester(t){const o=new qt,a=this.handlerCount;return this.handlerCount++,o.pending().subscribe({next:d=>{const b=this.currentRequests.slice(),B=this.makeAuthRequest(d,t);B?b[a]=B:delete b[a],this.currentRequests=b,this.subject.next(b.filter(Boolean))}}),d=>o.request(d)}makeAuthRequest(t,o){const{scopes:a}=t;if(a)return{provider:o.provider,trigger:async()=>{const d=await o.onAuthRequest(a);t.resolve(d)},reject:()=>{const d=new Error("Login failed, rejected by user");d.name="RejectedError",t.reject(d)}}}authRequest$(){return this.subject}constructor(){(0,k._)(this,"subject",new tt([])),(0,k._)(this,"currentRequests",[]),(0,k._)(this,"handlerCount",0)}}const Bt=new Map;class mt{static create(t){var o;return new mt((o=t.namespace)!==null&&o!==void 0?o:"",t.errorApi)}static addStorageEventListener(){window.addEventListener("storage",t=>{for(const[a,d]of Bt.entries()){var o;!((o=t.key)===null||o===void 0)&&o.startsWith(a)&&d.handleStorageChange(t.key)}})}get(t){return this.snapshot(t).value}snapshot(t){let o,a="absent";try{const d=localStorage.getItem(this.getKeyName(t));d&&(o=JSON.parse(d,(b,B)=>(typeof B=="object"&&B!==null&&Object.freeze(B),B)),a="present")}catch{this.errorApi.post(new Error(`Error when parsing JSON config from storage for: ${t}`))}return{key:t,value:o,presence:a}}forBucket(t){const o=`${this.namespace}/${t}`;return Bt.has(o)||Bt.set(o,new mt(o,this.errorApi)),Bt.get(o)}async set(t,o){localStorage.setItem(this.getKeyName(t),JSON.stringify(o)),this.notifyChanges(t)}async remove(t){localStorage.removeItem(this.getKeyName(t)),this.notifyChanges(t)}observe$(t){return mt.hasSubscribed||(mt.addStorageEventListener(),mt.hasSubscribed=!0),this.observable.filter(({key:o})=>o===t)}handleStorageChange(t){var o,a;if(!(!((o=t)===null||o===void 0)&&o.startsWith(this.namespace)))return;const d=(a=t)===null||a===void 0?void 0:a.slice(`${this.namespace}/`.length);d.includes("/")||this.notifyChanges(decodeURIComponent(d))}getKeyName(t){return`${this.namespace}/${encodeURIComponent(t)}`}notifyChanges(t){const o=this.snapshot(t);for(const a of this.subscribers)a.next(o)}constructor(t,o){(0,k._)(this,"namespace",void 0),(0,k._)(this,"errorApi",void 0),(0,k._)(this,"subscribers",void 0),(0,k._)(this,"observable",void 0),this.namespace=t,this.errorApi=o,this.subscribers=new Set,this.observable=new($e())(a=>(this.subscribers.add(a),()=>{this.subscribers.delete(a)}))}}(0,k._)(mt,"hasSubscribed",!1);const Lt=(0,W.createContext)(void 0);function Mt(){const[i]=(0,V.is)((0,p.jsx)(V.AW,{index:!0,element:(0,p.jsx)("div",{})}));return!i.index}var en=n(84800);const pr=(i,t)=>{try{var o,a,d,b;const Z=(o=(0,en.fp)(t,{pathname:i}))===null||o===void 0?void 0:o.filter(Fe=>{var Je,st;return((st=Fe)===null||st===void 0||(Je=st.route.routeRefs)===null||Je===void 0?void 0:Je.size)>0}).pop(),oe=(a=Z)===null||a===void 0?void 0:a.route;if(!oe)return;let me;oe.routeRefs.size===1&&(me=oe.routeRefs.values().next().value);let Me;oe.plugins.size===1&&(Me=oe.plugins.values().next().value);const Te=Object.entries(((d=Z)===null||d===void 0?void 0:d.params)||{}).reduce((Fe,[Je,st])=>(st!==void 0&&(Fe[Je]=st),Fe),{});return{extension:"App",pluginId:((b=Me)===null||b===void 0?void 0:b.getId())||"root",...me?{routeRef:me.id}:{},_routeNodeType:oe.element,params:Te}}catch{return}},fr=({pathname:i,search:t,hash:o,attributes:a})=>{const d=(0,m.z$)();return(0,W.useEffect)(()=>{d.captureEvent("navigate",`${i}${t}${o}`,{attributes:a})},[d,i,t,o,a]),null},_n=({routeObjects:i})=>{const{pathname:t,search:o,hash:a}=(0,V.TH)(),{params:d,...b}=pr(t,i)||{params:{}};return(0,p.jsx)(m.fC,{attributes:b,children:(0,p.jsx)(fr,{pathname:t,search:o,hash:a,attributes:d})})};function yn(i){return Mt()?Mn(i):""}function Mn(i){var t;let{pathname:o}=new URL((t=i.getOptionalString("app.baseUrl"))!==null&&t!==void 0?t:"/","http://sample.dev");return o=o.replace(/\/*$/,""),o}function gr({component:i,appIdentityProxy:t,children:o}){const[a,d]=(0,W.useState)(),b=(0,m.h_)(m.Ds),B=yn(b);return a?(t.setTarget(a,{signOutTargetUrl:B||"/"}),(0,p.jsx)(p.Fragment,{children:o})):(0,p.jsx)(i,{onSignInSuccess:d})}function Nr(i){const{Router:t,SignInPage:o}=(0,m.qD)().getComponents(),a=(0,m.h_)(m.Ds),d=Mn(a),b=`${d}/*`,B=(0,W.useContext)(Lt);if(!B)throw new Error("AppRouter must be rendered within the AppProvider");const{routeObjects:Z,appIdentityProxy:oe}=B;return o?Mt()?(0,p.jsxs)(t,{children:[(0,p.jsx)(_n,{routeObjects:Z}),(0,p.jsx)(gr,{component:o,appIdentityProxy:oe,children:(0,p.jsx)(V.Z5,{children:(0,p.jsx)(V.AW,{path:b,element:(0,p.jsx)(p.Fragment,{children:i.children})})})})]}):(0,p.jsxs)(t,{basename:d,children:[(0,p.jsx)(_n,{routeObjects:Z}),(0,p.jsx)(gr,{component:o,appIdentityProxy:oe,children:i.children})]}):(oe.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:d||"/"}),Mt()?(0,p.jsxs)(t,{children:[(0,p.jsx)(_n,{routeObjects:Z}),(0,p.jsx)(V.Z5,{children:(0,p.jsx)(V.AW,{path:b,element:(0,p.jsx)(p.Fragment,{children:i.children})})})]}):(0,p.jsxs)(t,{basename:d,children:[(0,p.jsx)(_n,{routeObjects:Z}),i.children]}))}var zn=n(88412),Fr=n(50629),C=n(80956),c=n(64279);function S(i){const t={};for(const a in i.collectors)i.collectors.hasOwnProperty(a)&&(t[a]=i.collectors[a]());const o=[{node:W.Children.toArray(i.root),parent:void 0,contexts:{}}];for(;o.length!==0;){const{node:a,parent:d,contexts:b}=o.shift();W.Children.forEach(a,B=>{if(!(0,W.isValidElement)(B))return;const Z={};for(const oe in t)if(t.hasOwnProperty(oe)){const me=t[oe];Z[oe]=me.visit(me.accumulator,B,d,b[oe])}for(const oe of i.discoverers){const me=oe(B);me&&o.push({node:me,parent:B,contexts:Z})}})}return Object.fromEntries(Object.entries(t).map(([a,d])=>[a,d.accumulator]))}function E(i,t){return()=>({accumulator:i(),visit:t})}function J(i){var t;return(t=i.props)===null||t===void 0?void 0:t.children}function ye(i){var t,o;if(!((t=i.props)===null||t===void 0)&&t.path&&(!((o=i.props)===null||o===void 0)&&o.element)){var a;return(a=i.props)===null||a===void 0?void 0:a.element}}const je=E(()=>new Set,(i,t)=>{const o=(0,m.IY)(t,"core.plugin");o&&i.add(o)}),De=i=>{const{children:t}=i,o=(0,m.h_)(m.W0),a="with"in i?o.isActive(i.with):!o.isActive(i.without);return(0,p.jsx)(p.Fragment,{children:a?t:null})};(0,m.R5)(De,"core.featureFlagged",!0);const et={caseSensitive:!1,path:"*",element:"match-all",routeRefs:new Set,plugins:new Set};function Gt(i){var t;const o=i;if(!((t=o)===null||t===void 0)&&t.type){var a,d;return(d=(a=o.type.displayName)!==null&&a!==void 0?a:o.type.name)!==null&&d!==void 0?d:String(o.type)}return String(o)}const xn=i=>{const t=new Set;return i&&t.add(i),t};function qn(i,t=new Array){return W.Children.forEach(i,o=>{if(!(0,W.isValidElement)(o))return;const a=(0,m.IY)(o,"core.mountPoint");if(a){const d=(0,m.IY)(o,"core.plugin");t.push({routeRef:a,plugin:d})}qn(o.props.children,t)}),t}const mr=E(()=>({paths:new Map,parents:new Map,objects:new Array}),(i,t,o,a)=>{var d,b,B,Z,oe;if(!((d=a)===null||d===void 0)&&d.isElementAncestor)return a;if(((b=o)===null||b===void 0?void 0:b.props.element)===t)return{...a,isElementAncestor:!0};const me=(B=t.props)===null||B===void 0?void 0:B.path,Me=(0,m.IY)(t,"core.mountPoint");if(Me&&me)throw new Error(`Path property may not be set directly on a routable extension "${Gt(t)}"`);var Te;const Fe=(Te=(oe=a)===null||oe===void 0||(Z=oe.obj)===null||Z===void 0?void 0:Z.children)!==null&&Te!==void 0?Te:i.objects;if(me!==void 0){if(typeof me!="string")throw new Error(`Element path must be a string at "${Gt(t)}"`);const Pn=me.startsWith("/")?me.slice(1):me,Jr=t.props.element;if((0,m.IY)(t,"core.gatherMountPoints")){var Je,st,tn;if(Jr)throw new Error(`Mount point gatherers may not have an element prop "${Gt(t)}"`);const bo={path:Pn,element:"gathered",routeRefs:new Set,caseSensitive:Boolean((Je=t.props)===null||Je===void 0?void 0:Je.caseSensitive),children:[et],plugins:new Set};return Fe.push(bo),{obj:bo,gatherPath:Pn,routeRef:(st=a)===null||st===void 0?void 0:st.routeRef,gatherRouteRef:(tn=a)===null||tn===void 0?void 0:tn.routeRef}}if(Jr){var Vt,rr,Mr,hr;const[bo,...pa]=qn(Jr);if(pa.length>0)throw new Error(`Route element with path "${me}" may not contain multiple routable extensions`);if(!bo)return a;const{routeRef:io,plugin:fa}=bo,vs={path:Pn,element:"mounted",routeRefs:new Set([io]),caseSensitive:Boolean((Vt=t.props)===null||Vt===void 0?void 0:Vt.caseSensitive),children:[et],plugins:xn(fa)};return Fe.push(vs),i.paths.set(io,Pn),i.parents.set(io,(rr=a)===null||rr===void 0?void 0:rr.routeRef),{obj:vs,routeRef:io!=null?io:(Mr=a)===null||Mr===void 0?void 0:Mr.routeRef,gatherPath:Pn,gatherRouteRef:(hr=a)===null||hr===void 0?void 0:hr.gatherRouteRef}}}if(Me){var br,Sr,Fn,Pr;if(((br=a)===null||br===void 0?void 0:br.gatherPath)===void 0)throw new Error(`Routable extension "${Gt(t)}" with mount point "${Me}" must be assigned a path`);(Fn=a)===null||Fn===void 0||(Sr=Fn.obj)===null||Sr===void 0||Sr.routeRefs.add(Me);const Pn=(0,m.IY)(t,"core.plugin");if(Pn){var Lr,Or;(Or=a)===null||Or===void 0||(Lr=Or.obj)===null||Lr===void 0||Lr.plugins.add(Pn)}return i.paths.set(Me,a.gatherPath),i.parents.set(Me,(Pr=a)===null||Pr===void 0?void 0:Pr.gatherRouteRef),{...a,routeRef:Me}}return a}),jr=E(()=>({paths:new Map,parents:new Map,objects:new Array}),(i,t,o,a)=>{var d,b,B,Z,oe,me,Me,Te,Fe;if(((d=o)===null||d===void 0?void 0:d.props.element)===t)return a;let Je=(b=a)===null||b===void 0?void 0:b.obj,st=(B=a)===null||B===void 0?void 0:B.routeRef,tn=(Z=a)===null||Z===void 0?void 0:Z.sticky;const Vt=(oe=t.props)===null||oe===void 0?void 0:oe.path;var rr;const Mr=(rr=(me=Je)===null||me===void 0?void 0:me.children)!==null&&rr!==void 0?rr:i.objects,hr=Boolean((Me=t.props)===null||Me===void 0?void 0:Me.caseSensitive);let br=(Te=a)===null||Te===void 0?void 0:Te.path;if((0,m.IY)(t,"core.gatherMountPoints")){if(!Vt)throw new Error("Mount point gatherer must have a path");br=Vt}const Sr=(Fe=t.props)===null||Fe===void 0?void 0:Fe.element;let Fn=(0,m.IY)(t,"core.mountPoint");if(!Fn&&(0,W.isValidElement)(Sr)&&(Fn=(0,m.IY)(Sr,"core.mountPoint")),Fn){let Jr=Vt;if(br&&(Jr?br=void 0:Jr=br),!Jr)throw new Error("Mounted routable extension must have a path");if(i.paths.set(Fn,Jr),st&&tn?(i.parents.set(Fn,st),Vt&&(st=Fn,tn=!1)):(i.parents.set(Fn,st),st=Fn),Vt)Je={caseSensitive:hr,path:Vt,element:"mounted",routeRefs:new Set([Fn]),children:[et],plugins:xn((0,m.IY)(t.props.element,"core.plugin"))},Mr.push(Je);else{var Pr;(Pr=Je)===null||Pr===void 0||Pr.routeRefs.add(Fn)}}if((0,m.IY)(t,"core.gatherMountPoints")&&(tn=!0),(0,m.IY)(t,"core.gatherMountPoints")){if(!Vt)throw new Error("Mount point gatherer must have a path");if(!Fn){var Or,Pn;Je={caseSensitive:hr,path:Vt,element:"gathered",routeRefs:new Set,children:[et],plugins:((Pn=a)===null||Pn===void 0||(Or=Pn.obj)===null||Or===void 0?void 0:Or.plugins)||new Set},Mr.push(Je)}}return{obj:Je,path:br,routeRef:st,sticky:tn}}),bn=E(()=>new Set,(i,t)=>{if(t.type===De){const o=t.props;i.add("with"in o?o.with:o.without)}}),Wr=(0,xt.uW)("route-ref-type",()=>Symbol("route-ref-type"));function lo(i){return i[Wr]==="absolute"}function Co(i){return i[Wr]==="sub"}function Ss(i){return i[Wr]==="external"}function Vr(...i){const t=i.join("/").replace(/\/\/+/g,"/");return t!=="/"&&t.endsWith("/")?t.slice(0,-1):t}function Vo(i,t,o){let a,d="";if(lo(i))a=i;else if(Co(i))a=i.parent,d=i.path;else if(Ss(i)){const Z=o.get(i);if(!Z)return[void 0,""];if(lo(Z))a=Z;else if(Co(Z))a=Z.parent,d=Z.path;else throw new Error(`ExternalRouteRef was bound to invalid target, ${Z}`)}else throw i[Wr]?new Error(`Unknown or invalid route ref type, ${i[Wr]}`):new Error(`Unknown object passed to useRouteRef, got ${i}`);if(!a)return[void 0,""];const b=t.get(a);if(b===void 0)return[void 0,""];const B=Vr(b,d);return[a,B]}function Cs(i,t,o,a,d){var b;const B=(b=(0,en.fp)(d,t))!==null&&b!==void 0?b:[],Z=Array();let oe=-1;for(let Te=i;Te&&(oe=B.findIndex(Fe=>Fe.route.routeRefs.has(Te)),oe===-1);Te=a.get(Te))Z.unshift(Te);Z.length===0&&(oe-=1);const me=oe===-1?"":B[oe].pathname,Me=Z.slice(0,-1).map(Te=>{const Fe=o.get(Te);if(Fe===void 0)throw new Error(`No path for ${Te}`);if(Fe.includes(":"))throw new Error(`Cannot route to ${i} with parent ${Te} as it has parameters`);return Fe});return`${Vr(me,...Me)}/`}class Ho{resolve(t,o){const[a,d]=Vo(t,this.routePaths,this.routeBindings);if(!a)return;let b;typeof o=="string"?b=this.trimPath(o):o.pathname?b={...o,pathname:this.trimPath(o.pathname)}:b=o;const B=this.appBasePath+Cs(a,b,this.routePaths,this.routeParents,this.routeObjects);return(...[oe])=>Vr(B,(0,en.Gn)(d,oe))}trimPath(t){return t&&(t.startsWith(this.appBasePath)?t.slice(this.appBasePath.length):t)}constructor(t,o,a,d,b){(0,k._)(this,"routePaths",void 0),(0,k._)(this,"routeParents",void 0),(0,k._)(this,"routeObjects",void 0),(0,k._)(this,"routeBindings",void 0),(0,k._)(this,"appBasePath",void 0),this.routePaths=t,this.routeParents=o,this.routeObjects=a,this.routeBindings=d,this.appBasePath=b}}const Go=(0,xt.CT)("routing-context"),Er=({routePaths:i,routeParents:t,routeObjects:o,routeBindings:a,basePath:d="",children:b})=>{const B=new Ho(i,t,o,a,d),Z=(0,xt.EI)({1:B});return(0,p.jsx)(Go.Provider,{value:Z,children:b})};function lr(i,t){const o=new Set(t.values());o.delete(void 0);for(const a of t.keys()){if(o.has(a))continue;let d=a,b="";for(;d;){const Z=i.get(d);if(Z===void 0)throw new Error(`No path for ${d}`);b=Vr(Z,b),d=t.get(d)}const B=b.match(/:(\w+)/g);if(B){for(let Z=0;Z<B.length;Z++)for(let oe=Z+1;oe<B.length;oe++)if(B[oe]===B[Z])throw new Error(`Parameter ${B[oe]} is duplicated in path ${b}`)}}}function Hr(i,t){for(const o of t)if(o.externalRoutes){for(const[a,d]of Object.entries(o.externalRoutes))if(!d.optional&&!i.has(d))throw new Error(`External route '${a}' of the '${o.getId()}' plugin must be bound to a target route. See https://backstage.io/link?bind-routes for details.`)}}const qr=(0,xt.CT)("app-context"),wo=({appContext:i,children:t})=>{const o=(0,xt.EI)({1:i});return(0,p.jsx)(qr.Provider,{value:o,children:t})};function jo(i){return new Error(`Tried to access IdentityApi ${i} before app was loaded`)}function Zr(i){console.warn(`WARNING: Call to ${i} is deprecated and will break in the future`)}class Ko{setTarget(t,o){this.target=t,this.signOutTargetUrl=o.signOutTargetUrl,this.resolveTarget(t)}getUserId(){if(!this.target)throw jo("getUserId");if(!this.target.getUserId)throw new Error("IdentityApi does not implement getUserId");return Zr("getUserId"),this.target.getUserId()}getProfile(){if(!this.target)throw jo("getProfile");if(!this.target.getProfile)throw new Error("IdentityApi does not implement getProfile");return Zr("getProfile"),this.target.getProfile()}async getProfileInfo(){return this.waitForTarget.then(t=>t.getProfileInfo())}async getBackstageIdentity(){const t=await this.waitForTarget.then(o=>o.getBackstageIdentity());return t.userEntityRef.match(/^.*:.*\/.*$/)||console.warn(`WARNING: The App IdentityApi provided an invalid userEntityRef, '${t.userEntityRef}'. It must be a full Entity Reference of the form '<kind>:<namespace>/<name>'.`),t}async getCredentials(){return this.waitForTarget.then(t=>t.getCredentials())}async getIdToken(){return this.waitForTarget.then(t=>{if(!t.getIdToken)throw new Error("IdentityApi does not implement getIdToken");return Zr("getIdToken"),t.getIdToken()})}async signOut(){await this.waitForTarget.then(t=>t.signOut()),window.location.href=this.signOutTargetUrl}constructor(){(0,k._)(this,"target",void 0),(0,k._)(this,"waitForTarget",void 0),(0,k._)(this,"resolveTarget",()=>{}),(0,k._)(this,"signOutTargetUrl","/"),this.waitForTarget=new Promise(t=>{this.resolveTarget=t})}}var Eo=n(72164);function Nn(i,t,o){if(i!==void 0){const d=o.find(b=>b.id===i);if(d)return d}if(t){const d=o.find(b=>b.variant==="dark");if(d)return d}const a=o.find(d=>d.variant==="light");return a||o[0]}const cr=()=>{const i=(0,W.useMemo)(()=>window.matchMedia("(prefers-color-scheme: dark)"),[]),[t,o]=(0,W.useState)(i.matches);return(0,W.useEffect)(()=>{const a=d=>{o(d.matches)};return i.addListener(a),()=>{i.removeListener(a)}},[i]),t};function Gr({children:i}){const t=(0,m.h_)(m.hg),o=(0,Eo.Z)(t.activeThemeId$(),t.getActiveThemeId()),a=Boolean(window.matchMedia)?cr():!1,d=Nn(o,a,t.getInstalledThemes());if(!d)throw new Error("App has no themes");return(0,p.jsx)(d.Provider,{children:i})}const Kr=async(i="__APP_INJECTED_RUNTIME_CONFIG__")=>{const t=[{context:"app-config.yaml",data:{app:{title:"Techdocs Preview App",baseUrl:"http://localhost:3000"},backend:{baseUrl:"http://localhost:3000"},techdocs:{builder:"external"}}}];if(!t)throw new Error("No static configuration provided");if(!Array.isArray(t))throw new Error("Static configuration has invalid format");const o=t.slice();if(i!=="__app_injected_runtime_config__".toLocaleUpperCase("en-US"))try{const d=JSON.parse(i);Array.isArray(d)?o.push(...d):o.push({data:d,context:"env"})}catch(d){throw new Error(`Failed to load runtime configuration, ${d}`)}const a=window.__APP_CONFIG__;return a&&o.push({context:"window",data:a}),o};class Yo{add(t,o){return this.apis.push([t.id,o]),o}build(){return new vr(new Map(this.apis))}constructor(){(0,k._)(this,"apis",[])}}class vr{static builder(){return new Yo}static from(t){return new vr(new Map(t.map(([o,a])=>[o.id,a])))}static with(t,o){return new vr(new Map([[t.id,o]]))}with(t,o){return new vr(new Map([...this.apis,[t.id,o]]))}get(t){return this.apis.get(t.id)}constructor(t){(0,k._)(this,"apis",void 0),this.apis=t}}function Ao(i){const t=new Map;return i&&i({bind:(a,d)=>{for(const[b,B]of Object.entries(d)){const Z=a[b];if(!Z)throw new Error(`Key ${b} is not an existing external route`);if(!B&&!Z.optional)throw new Error(`External route ${b} is required but was undefined`);B&&t.set(Z,B)}}}),t}function To(i){const t=new URL(i);return t.protocol=document.location.protocol,t.hostname=document.location.hostname,t.port=document.location.port,t.toString().replace(/\/$/,"")}function Ro(i,t,o){var a;const d=Boolean(i),b=(0,c.default)(i||(()=>Promise.resolve([])));let B;if(d&&b.loading){const{Progress:me}=t;B=(0,p.jsx)(me,{})}else if(b.error){const{BootErrorPage:me}=t;B=(0,p.jsx)(me,{step:"load-config",error:b.error})}const{ThemeProvider:Z=Gr}=t;if(B)return{node:(0,p.jsx)(Ut,{apis:vr.with(m.hg,o),children:(0,p.jsx)(Z,{children:B})})};let oe;if(!((a=b.value)===null||a===void 0)&&a.length){const me=Y.fromConfigs(b.value),Me=me.getOptionalString("app.baseUrl"),Te=me.getOptionalString("backend.baseUrl");let Fe=b.value;const Je={data:{},context:"relative-resolver"};if(Me&&Te){const st=new URL(Me).origin,tn=new URL(Te).origin;if(st===tn){const Vt=To(Te);Te!==Vt&&(Je.data.backend={baseUrl:Vt})}}if(Me){const st=To(Me);Me!==st&&(Je.data.app={baseUrl:st})}Object.keys(Je.data).length&&(Fe=Fe.concat([Je])),oe=Y.fromConfigs(Fe)}else oe=Y.fromConfigs([]);return{api:oe}}class Ur{getPlugins(){return this.app.getPlugins()}getSystemIcon(t){return this.app.getSystemIcon(t)}getSystemIcons(){return this.app.getSystemIcons()}getComponents(){return this.app.getComponents()}constructor(t){(0,k._)(this,"app",void 0),this.app=t}}var Io=new WeakMap;class Jo{getPlugins(){return Array.from(this.plugins)}getSystemIcon(t){return this.icons[t]}getSystemIcons(){return this.icons}getComponents(){return this.components}createRoot(t){const o=this.getProvider();return()=>(0,p.jsx)(o,{children:t})}getProvider(){if((0,zn._)(this,Io))throw new Error("app.getProvider() or app.createRoot() has already been called, and can only be called once");(0,C._)(this,Io,!0);const t=new Ur(this);let o=!1;return({children:d})=>{const b=(0,W.useRef)(!0),B=(0,W.useMemo)(()=>Ue.createWithStorage(this.themes),[]),{routing:Z,featureFlags:oe,routeBindings:me}=(0,W.useMemo)(()=>{const Je=S({root:d,discoverers:[J,ye],collectors:{routing:Mt()?jr:mr,collectedPlugins:je,featureFlags:bn}});return Je.collectedPlugins.forEach(st=>this.plugins.add(st)),this.verifyPlugins(this.plugins),this.getApiHolder(),{...Je,routeBindings:Ao(this.bindRoutes)}},[d]);o||(o=!0,lr(Z.paths,Z.parents),Hr(me,this.plugins));const Me=Ro(this.configLoader,this.components,B),Te="api"in Me;if(Te){const{api:Je}=Me;this.configApi=Je}if("node"in Me)return Me.node;if(Te&&b.current){b.current=!1;const Je=this.getApiHolder().get(m.W0);if(Je){for(const Vt of this.featureFlags)Je.registerFlag({...Vt,pluginId:""});for(const Vt of this.plugins.values())if("getFeatureFlags"in Vt)for(const rr of Vt.getFeatureFlags())Je.registerFlag({name:rr.name,pluginId:Vt.getId()});else for(const rr of Vt.output())rr.type==="feature-flag"&&Je.registerFlag({name:rr.name,pluginId:Vt.getId()});const st=Je.getRegisteredFlags(),tn=new Set(st.map(Vt=>Vt.name));for(const Vt of oe)tn.has(Vt)||Je.registerFlag({name:Vt,pluginId:""})}}const{ThemeProvider:Fe=Gr}=this.components;return(0,p.jsx)(Ut,{apis:this.getApiHolder(),children:(0,p.jsx)(wo,{appContext:t,children:(0,p.jsx)(Fe,{children:(0,p.jsx)(Er,{routePaths:Z.paths,routeParents:Z.parents,routeObjects:Z.objects,routeBindings:me,basePath:yn(Me.api),children:(0,p.jsx)(Lt.Provider,{value:{routeObjects:Z.objects,appIdentityProxy:this.appIdentityProxy},children:d})})})})})}}getRouter(){return Nr}getApiHolder(){if(this.apiHolder){for(const t of this.plugins)for(const o of t.getApis())this.apiFactoryRegistry.get(o.api)||this.apiFactoryRegistry.register("default",o);return Tt.validateFactories(this.apiFactoryRegistry,this.apiFactoryRegistry.getAllApis()),this.apiHolder}this.apiFactoryRegistry.register("static",{api:m.hg,deps:{},factory:()=>Ue.createWithStorage(this.themes)}),this.apiFactoryRegistry.register("static",{api:m.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:m.$4,deps:{},factory:()=>this.appIdentityProxy}),this.apiFactoryRegistry.register("default",{api:m.W0,deps:{},factory:()=>new ke});for(const t of this.defaultApis)this.apiFactoryRegistry.register("default",t);for(const t of this.plugins)for(const o of t.getApis())if(!this.apiFactoryRegistry.register("default",o))throw new Error(`Plugin ${t.getId()} tried to register duplicate or forbidden API factory for ${o.api}`);for(const t of this.apis)if(!this.apiFactoryRegistry.register("app",t))throw new Error(`Duplicate or forbidden API factory for ${t.api} in app`);return Tt.validateFactories(this.apiFactoryRegistry,this.apiFactoryRegistry.getAllApis()),this.apiHolder=new Tt(this.apiFactoryRegistry),this.apiHolder}verifyPlugins(t){const o=new Set;for(const a of t){const d=a.getId();if(o.has(d))throw new Error(`Duplicate plugin found '${d}'`);o.add(d)}}constructor(t){(0,k._)(this,"apiHolder",void 0),(0,k._)(this,"configApi",void 0),(0,k._)(this,"apis",void 0),(0,k._)(this,"icons",void 0),(0,k._)(this,"plugins",void 0),(0,k._)(this,"featureFlags",void 0),(0,k._)(this,"components",void 0),(0,k._)(this,"themes",void 0),(0,k._)(this,"configLoader",void 0),(0,k._)(this,"defaultApis",void 0),(0,k._)(this,"bindRoutes",void 0),(0,k._)(this,"appIdentityProxy",new Ko),(0,k._)(this,"apiFactoryRegistry",void 0),(0,Fr._)(this,Io,{writable:!0,value:!1});var o;this.apis=(o=t.apis)!==null&&o!==void 0?o:[],this.icons=t.icons;var a;this.plugins=new Set((a=t.plugins)!==null&&a!==void 0?a:[]);var d;this.featureFlags=(d=t.featureFlags)!==null&&d!==void 0?d:[],this.components=t.components,this.themes=t.themes;var b;this.configLoader=(b=t.configLoader)!==null&&b!==void 0?b:Kr;var B;this.defaultApis=(B=t.defaultApis)!==null&&B!==void 0?B:[],this.bindRoutes=t.bindRoutes,this.apiFactoryRegistry=new Yt}}function co(i){return new Jo(i)}let Po=!1;const ws=i=>{const t=(0,m.qD)(),{NotFoundErrorPage:o}=t.getComponents(),a=(0,W.useMemo)(()=>Mt(),[]),b=[...(0,m.vJ)(i.children,B=>B.getElements().flatMap(Z=>{var oe;let me=Z.props.path;if(me==="")return[];var Me;me=(Me=(oe=me)===null||oe===void 0?void 0:oe.replace(/\/\*$/,""))!==null&&Me!==void 0?Me:"/";let Te=a?Z:Z.props.element;return!a&&!Te&&(Te=Z,Po||(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] />} />."),Po=!0)),[{path:me,element:Te,children:Z.props.children?[{path:me==="/"?"/":"*",element:Z.props.children}]:void 0}]}).sort((Z,oe)=>oe.path.localeCompare(Z.path)).map(Z=>({...Z,path:Z.path==="/"?"/":`${Z.path}/*`}))),{path:"*",element:(0,p.jsx)(o,{})}];return(0,V.V$)(b)},Lo=(0,m.T0)({id:"plugin.permission.api"});var dr;(function(i){i.DENY="DENY",i.ALLOW="ALLOW",i.CONDITIONAL="CONDITIONAL"})(dr||(dr={}));function ci(i,t){return i.name===t.name}function Qo(i,t){return"resourceType"in i?!t||i.resourceType===t:!1}function js(i){return i.attributes.action==="create"}function uo(i){return i.attributes.action==="read"}function eo(i){return i.attributes.action==="update"}function to(i){return i.attributes.action==="delete"}function no(i){return{authorize:async(t,o)=>await i.authorize(t,o),authorizeConditional(t,o){const a=t;return i.authorize(a,o)}}}function Ar({name:i,attributes:t,resourceType:o}){return o?{type:"resource",name:i,attributes:t,resourceType:o}:{type:"basic",name:i,attributes:t}}var er=n(23054),ho=n(96279),Xo=n.n(ho),Es=n(9571);const ro=_e.z.lazy(()=>_e.z.object({rule:_e.z.string(),resourceType:_e.z.string(),params:_e.z.record(_e.z.any()).optional()}).or(_e.z.object({anyOf:_e.z.array(ro).nonempty()})).or(_e.z.object({allOf:_e.z.array(ro).nonempty()})).or(_e.z.object({not:ro}))),_o=_e.z.object({result:_e.z.literal(dr.ALLOW).or(_e.z.literal(dr.DENY))}),As=_e.z.union([_e.z.object({result:_e.z.literal(dr.ALLOW).or(_e.z.literal(dr.DENY))}),_e.z.object({result:_e.z.literal(dr.CONDITIONAL),pluginId:_e.z.string(),resourceType:_e.z.string(),conditions:ro})]),qo=(i,t)=>_e.z.object({items:_e.z.array(_e.z.intersection(_e.z.object({id:_e.z.string()}),i)).refine(o=>o.length===t.size&&o.every(({id:a})=>t.has(a)),{message:"Items in response do not match request"})});class es{async authorize(t,o){return this.makeRequest(t,_o,o)}async authorizeConditional(t,o){return this.makeRequest(t,As,o)}async makeRequest(t,o,a){var d;if(!this.enabled)return t.map(Te=>({result:dr.ALLOW}));const b={items:t.map(Te=>({id:Es.Z(),...Te}))},B=await this.discovery.getBaseUrl("permission"),Z=await Xo()(`${B}/authorize`,{method:"POST",body:JSON.stringify(b),headers:{...this.getAuthorizationHeader((d=a)===null||d===void 0?void 0:d.token),"content-type":"application/json"}});if(!Z.ok)throw await er.VL.fromResponse(Z);const oe=await Z.json(),Me=qo(o,new Set(b.items.map(({id:Te})=>Te))).parse(oe).items.reduce((Te,Fe)=>(Te[Fe.id]=Fe,Te),{});return b.items.map(Te=>Me[Te.id])}getAuthorizationHeader(t){return t?{Authorization:`Bearer ${t}`}:{}}constructor(t){(0,k._)(this,"enabled",void 0),(0,k._)(this,"discovery",void 0),this.discovery=t.discovery;var o;this.enabled=(o=t.config.getOptionalBoolean("permission.enabled"))!==null&&o!==void 0?o:!1}}class po{static create(t){const{config:o,discovery:a,identity:d}=t,b=new es({discovery:a,config:o});return new po(b,d)}async authorize(t){return(await this.permissionClient.authorize([t],await this.identityApi.getCredentials()))[0]}constructor(t,o){(0,k._)(this,"permissionClient",void 0),(0,k._)(this,"identityApi",void 0),this.permissionClient=t,this.identityApi=o}}var Oo=n(69984);function fo(i){const t=(0,m.h_)(Lo),{data:o,error:a}=(0,Oo.ZP)(i,async d=>{if(Qo(d.permission)&&!d.resourceRef)return dr.DENY;const{result:b}=await t.authorize(d);return b});return a?{error:a,loading:!1,allowed:!1}:o===void 0?{loading:!0,allowed:!1}:{loading:!1,allowed:o===dr.ALLOW}}const Ts=i=>{const{permission:t,resourceRef:o,errorComponent:a,...d}=i,b=usePermission(isResourcePermission(t)?{permission:t,resourceRef:o}:{permission:t}),B=useApp(),{NotFoundErrorPage:Z}=B.getComponents();let oe=a===void 0?_jsx(Z,{}):a;return b.loading?oe=null:b.allowed&&(oe=i.element),_jsx(Route,{...d,element:oe})};function di(i){const{permission:t,resourceRef:o}=i,a=usePermission(isResourcePermission(t)?{permission:t,resourceRef:o}:{permission:t}),d=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:b}=d.getComponents();return _jsx(b,{})}const ts=[(0,m.ni)({api:m.NW,deps:{configApi:m.Ds},factory:({configApi:i})=>O.compile(`${i.getString("backend.baseUrl")}/api/{{ pluginId }}`)}),(0,m.ni)({api:m.$v,deps:{},factory:()=>new N}),(0,m.ni)({api:m.v_,deps:{},factory:()=>new le}),(0,m.ni)({api:m.VE,deps:{alertApi:m.$v},factory:({alertApi:i})=>{const t=new M(i,new G);return ue.forward(t,{hidden:!1}),t}}),(0,m.ni)({api:m.E6,deps:{errorApi:m.VE},factory:({errorApi:i})=>mt.create({errorApi:i})}),(0,m.ni)({api:m.gP,deps:{configApi:m.Ds,identityApi:m.$4,discoveryApi:m.NW},factory:({configApi:i,identityApi:t,discoveryApi:o})=>Xe({middleware:[_t.resolvePluginProtocol({discoveryApi:o}),_t.injectIdentityAuth({identityApi:t,config:i})]})}),(0,m.ni)({api:m.ZM,deps:{},factory:()=>new jn}),(0,m.ni)({api:m.Kp,deps:{discoveryApi:m.NW,oauthRequestApi:m.ZM,configApi:m.Ds},factory:({discoveryApi:i,oauthRequestApi:t,configApi:o})=>vn.create({configApi:o,discoveryApi:i,oauthRequestApi:t,environment:o.getOptionalString("auth.environment")})}),(0,m.ni)({api:m.p_,deps:{discoveryApi:m.NW,oauthRequestApi:m.ZM,configApi:m.Ds},factory:({discoveryApi:i,oauthRequestApi:t,configApi:o})=>sn.create({configApi:o,discoveryApi:i,oauthRequestApi:t,environment:o.getOptionalString("auth.environment")})}),(0,m.ni)({api:m.F4,deps:{discoveryApi:m.NW,oauthRequestApi:m.ZM,configApi:m.Ds},factory:({discoveryApi:i,oauthRequestApi:t,configApi:o})=>mn.create({configApi:o,discoveryApi:i,oauthRequestApi:t,defaultScopes:["read:user"],environment:o.getOptionalString("auth.environment")})}),(0,m.ni)({api:m.D,deps:{discoveryApi:m.NW,oauthRequestApi:m.ZM,configApi:m.Ds},factory:({discoveryApi:i,oauthRequestApi:t,configApi:o})=>wn.create({configApi:o,discoveryApi:i,oauthRequestApi:t,environment:o.getOptionalString("auth.environment")})}),(0,m.ni)({api:m.ux,deps:{discoveryApi:m.NW,oauthRequestApi:m.ZM,configApi:m.Ds},factory:({discoveryApi:i,oauthRequestApi:t,configApi:o})=>ln.create({configApi:o,discoveryApi:i,oauthRequestApi:t,environment:o.getOptionalString("auth.environment")})}),(0,m.ni)({api:m.gW,deps:{discoveryApi:m.NW,oauthRequestApi:m.ZM,configApi:m.Ds},factory:({discoveryApi:i,oauthRequestApi:t,configApi:o})=>Kn.create({configApi:o,discoveryApi:i,oauthRequestApi:t,environment:o.getOptionalString("auth.environment")})}),(0,m.ni)({api:m.bq,deps:{discoveryApi:m.NW,oauthRequestApi:m.ZM,configApi:m.Ds},factory:({discoveryApi:i,oauthRequestApi:t,configApi:o})=>Yn.create({configApi:o,discoveryApi:i,oauthRequestApi:t,defaultScopes:["team"],environment:o.getOptionalString("auth.environment")})}),(0,m.ni)({api:m.Km,deps:{discoveryApi:m.NW,oauthRequestApi:m.ZM,configApi:m.Ds},factory:({discoveryApi:i,oauthRequestApi:t,configApi:o})=>pe.create({configApi:o,discoveryApi:i,oauthRequestApi:t,defaultScopes:["REPO_READ"]})}),(0,m.ni)({api:m.uB,deps:{discoveryApi:m.NW,oauthRequestApi:m.ZM,configApi:m.Ds},factory:({discoveryApi:i,oauthRequestApi:t,configApi:o})=>H.create({configApi:o,discoveryApi:i,oauthRequestApi:t,environment:o.getOptionalString("auth.environment")})}),(0,m.ni)({api:Lo,deps:{discovery:m.NW,identity:m.$4,config:m.Ds},factory:({config:i,discovery:t,identity:o})=>po.create({config:i,discovery:t,identity:o})})];var ns=n(77277),cn=n(53974),Rs=n(71597);function y({children:i}){return(0,V.GV)()?(0,p.jsx)(p.Fragment,{children:i}):(0,p.jsx)(V.VA,{children:i})}const j=()=>(0,p.jsx)(cn.mf,{status:"404",statusMessage:"PAGE NOT FOUND"}),L=({step:i,error:t})=>{let o="";return i==="load-config"?o=`The configuration failed to load, someone should have a look at this error: ${t.message}`:i==="load-chunk"&&(o=`Lazy loaded chunk failed to load, try to reload the page: ${t.message}`),(0,p.jsx)(y,{children:(0,p.jsx)(cn.mf,{status:"501",statusMessage:o})})},P=({error:i,resetError:t,plugin:o})=>{var a;return(0,p.jsx)(cn.yu,{title:`Error in ${(a=o)===null||a===void 0?void 0:a.getId()}`,defaultExpanded:!0,error:i,children:(0,p.jsx)(ns.Z,{variant:"outlined",onClick:t,children:"Retry"})})},ae={Progress:cn.Ex,Router:Rs.VK,NotFoundErrorPage:j,BootErrorPage:L,ErrorBoundaryFallback:P};var re=n(43642),q=n(80079),he=n(90941),Ae=n(32915),Le=n(40562),ze=n(21853),Ne=n(60744),We=n(66569),it=n(30254),Et=n(13384),Be=n(15933),He=n(58838),At=n(86737),rn=n(4989),En=n(44407),Ot=n(18628),Rt=n(84219),Kt=n(98685),An=n(39781),ur=n(39412);const Tr={brokenImage:q.Z,catalog:Ot.Z,scaffolder:Ae.Z,techdocs:Le.Z,search:ze.Z,chat:Ne.Z,dashboard:We.Z,docs:it.Z,email:Et.Z,github:He.Z,group:Rt.Z,help:At.Z,"kind:api":Be.Z,"kind:component":En.Z,"kind:domain":re.Z,"kind:group":Rt.Z,"kind:location":rn.Z,"kind:system":he.Z,"kind:user":Kt.Z,"kind:resource":ur.Z,user:Kt.Z,warning:An.Z};var Yr=n(73689),Wn=n(77349);const fn={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")`},kn={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 yr(i){var t;const{colors:o,shape:a,options:d}=i,B=`linear-gradient(90deg, ${(o.length===1?[o[0],o[0]]:o).join(", ")})`,Z=`${a}, ${B}`;var oe;const me=(oe=(t=d)===null||t===void 0?void 0:t.fontColor)!==null&&oe!==void 0?oe:"#FFFFFF";return{colors:o,shape:a,backgroundImage:Z,fontColor:me}}const ui={home:yr({colors:kn.teal,shape:fn.wave}),documentation:yr({colors:kn.pinkSea,shape:fn.wave2}),tool:yr({colors:kn.purpleSky,shape:fn.round}),service:yr({colors:kn.marineBlue,shape:fn.wave}),website:yr({colors:kn.veryBlue,shape:fn.wave}),library:yr({colors:kn.rubyRed,shape:fn.wave}),other:yr({colors:kn.darkGrey,shape:fn.wave}),app:yr({colors:kn.toastyOrange,shape:fn.wave}),apis:yr({colors:kn.teal,shape:fn.wave2}),card:yr({colors:kn.greens,shape:fn.wave})},hi=16,xa='"Helvetica Neue", Helvetica, Roboto, Arial, sans-serif',pi="home";function Is(i){const{palette:t,htmlFontSize:o=hi,fontFamily:a=xa,defaultPageTheme:d=pi,pageTheme:b=ui,typography:B}=i;if(!b[d])throw new Error(`${d} is not defined in pageTheme.`);const Z={htmlFontSize:o,fontFamily:a,h1:{fontSize:54,fontWeight:700,marginBottom:10},h2:{fontSize:40,fontWeight:700,marginBottom:8},h3:{fontSize:32,fontWeight:700,marginBottom:6},h4:{fontWeight:700,fontSize:28,marginBottom:6},h5:{fontWeight:700,fontSize:24,marginBottom:4},h6:{fontWeight:700,fontSize:20,marginBottom:2}};var oe;return{palette:t,typography:B!=null?B:Z,page:b[d],getPageTheme:({themeId:me})=>(oe=b[me])!==null&&oe!==void 0?oe:b[d]}}var Ps=n(47591);const go={MuiCssBaseline:{styleOverrides:i=>({html:{height:"100%",fontFamily:i.typography.fontFamily},body:{height:"100%",fontFamily:i.typography.fontFamily,overscrollBehaviorY:"none",fontSize:"0.875rem",lineHeight:1.43},a:{color:"inherit",textDecoration:"none"}})},MuiGrid:{defaultProps:{spacing:2}},MuiSwitch:{defaultProps:{color:"primary"}},MuiTableRow:{styleOverrides:{root:({theme:i})=>({"&:nth-of-type(odd)":{backgroundColor:i.palette.background.default}}),hover:{"&:hover":{cursor:"pointer"}},head:({theme:i})=>({"&:nth-of-type(odd)":{backgroundColor:i.palette.background.paper}})}},MuiTableCell:{styleOverrides:{root:({theme:i})=>({wordBreak:"break-word",overflow:"hidden",verticalAlign:"middle",lineHeight:"1",margin:0,padding:i.spacing(3,2,3,2.5),borderBottom:0}),sizeSmall:({theme:i})=>({padding:i.spacing(1.5,2,1.5,2.5)}),head:({theme:i})=>({wordBreak:"break-word",overflow:"hidden",color:i.palette.textSubtle,fontWeight:"normal",lineHeight:"1"})}},MuiTabs:{styleOverrides:{root:{minHeight:24}}},MuiTab:{styleOverrides:{root:({theme:i})=>({color:i.palette.link,minHeight:24,textTransform:"initial",letterSpacing:"0.07em","&:hover":{color:(0,Ps._j)(i.palette.link,.3),background:(0,Ps.$n)(i.palette.link,.95)},[i.breakpoints.up("md")]:{minWidth:120,fontSize:i.typography.pxToRem(14),fontWeight:500}}),textColorPrimary:({theme:i})=>({color:i.palette.link})}},MuiTableSortLabel:{styleOverrides:{root:{color:"inherit","&:hover":{color:"inherit"},"&:focus":{color:"inherit"},"&.Mui-active":{fontWeight:"bold",color:"inherit"}}}},MuiListItemText:{styleOverrides:{dense:{whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"}}},MuiButton:{styleOverrides:{text:{padding:void 0}}},MuiChip:{styleOverrides:{root:({theme:i})=>({backgroundColor:"#D9D9D9",marginRight:i.spacing(1),marginBottom:i.spacing(1),color:i.palette.grey[900]}),outlined:({theme:i})=>({color:i.palette.text.primary}),label:({theme:i})=>({lineHeight:i.spacing(2.5),fontWeight:i.typography.fontWeightMedium,fontSize:i.spacing(1.75)}),labelSmall:({theme:i})=>({fontSize:i.spacing(1.5)}),deleteIcon:({theme:i})=>({color:i.palette.grey[500],width:i.spacing(3),height:i.spacing(3),margin:i.spacing(0,.75,0,-.75)}),deleteIconSmall:({theme:i})=>({width:i.spacing(2),height:i.spacing(2),margin:i.spacing(0,.5,0,-.5)})}},MuiCard:{styleOverrides:{root:{display:"flex",flexDirection:"column"}}},MuiCardHeader:{styleOverrides:{root:{paddingBottom:0}}},MuiCardContent:{styleOverrides:{root:{flexGrow:1,"&:last-child":{paddingBottom:void 0}}}},MuiCardActions:{styleOverrides:{root:{justifyContent:"flex-end"}}},MuiLink:{defaultProps:{underline:"hover"}}},oo=i=>(...t)=>{const o=t.length===0?[1]:t,a=(d,b)=>typeof d=="string"?d:b*d;return o.map(d=>{const b=a(d,i);return typeof b=="number"?`${b}px`:b}).join(" ")};function fi(i,t){if(!t||typeof t=="string")return;const o=typeof t=="function"?t(i):t;if(o)return{"@global":o}}function Ls(i,t){if(!(!t||typeof t=="string")){if(typeof t=="object"){const o={...i},a=i.spacing(1);return typeof a=="number"&&(o.spacing=oo(a)),Object.fromEntries(Object.entries(t).map(([d,b])=>typeof b=="function"?[d,b({theme:o})]:[d,b]))}return t}}const gi=/^&.Mui-([\w-]+)$/;function Os(i){let t=i;if(!i||typeof i!="object")return t;for(const o of Object.keys(i)){const a=i[o];if(!(!a||typeof a!="object"))for(const d of Object.keys(a)){const b=d,B=b.match(gi);if(B){const[,Z]=B,{[b]:oe,...me}=a;oe&&(t={...t,[o]:me,[Z]:oe})}}}return t}function rs(i,t={}){const o={},a={};for(const d of Object.keys(t)){const b=t[d];b&&("styleOverrides"in b&&(d==="MuiCssBaseline"?o[d]=fi(i,b.styleOverrides):o[d]=Os(Ls(i,b.styleOverrides))),"defaultProps"in b&&(a[d]=b.defaultProps))}return{overrides:o,props:a}}var mo=new WeakMap;class mi{getTheme(t){return(0,zn._)(this,mo).get(t)}constructor(t,o){(0,Fr._)(this,mo,{writable:!0,value:new Map}),(0,C._)(this,mo,new Map),t&&(0,zn._)(this,mo).set("v4",t),o&&(0,zn._)(this,mo).set("v5",o)}}function ks(i){const t=Is(i),o={...go,...i.components},a=(0,Wn.Z)({...t,components:o}),d=rs(a,o),b={...(0,Yr.Z)(t),...d};return new mi(b,a)}function vi(i){const t=adaptV4Theme(i),o=createTheme(i);return new mi(o,t)}const ko={light:{type:"light",mode:"light",background:{default:"#F8F8F8",paper:"#FFFFFF"},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:"#FFD600",navigation:{background:"#171717",indicator:"#9BF0E1",color:"#b5b5b5",selectedColor:"#FFF",navItem:{hoverBackground:"#404040"},submenu:{background:"#404040"}},pinSidebarButton:{icon:"#181818",background:"#BDBDBD"},tabbar:{indicator:"#9BF0E1"}},dark:{type:"dark",mode:"dark",background:{default:"#333333",paper:"#424242"},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:"#FFD600",navigation:{background:"#424242",indicator:"#9BF0E1",color:"#b5b5b5",selectedColor:"#FFF",navItem:{hoverBackground:"#404040"},submenu:{background:"#404040"}},pinSidebarButton:{icon:"#404040",background:"#BDBDBD"},tabbar:{indicator:"#9BF0E1"}}},or={light:ks({palette:ko.light}),dark:ks({palette:ko.dark})};var ba=n(68542);ba.Z.configure(i=>`v5-${i}`);var Sa=n(87561),Ca=n(12536),wa=n(19219),ja=n(41547),Ea=n(3493),Aa=n(81887);const Ta=(0,Ca.Z)({productionPrefix:"jss4-"});function vo(i){const{children:t,theme:o,noCssBaseline:a=!1}=i,d=o.getTheme("v4"),b=o.getTheme("v5");let B;a||(B=(0,p.jsx)(Sa.ZP,{}));let Z=(0,p.jsxs)(p.Fragment,{children:[B,t]});return d&&(Z=(0,p.jsx)(wa.ZP,{generateClassName:Ta,children:(0,p.jsx)(ja.Z,{theme:d,children:Z})})),b&&(Z=(0,p.jsx)(Ea.Z,{injectFirst:!0,children:(0,p.jsx)(Aa.Z,{theme:b,children:Z})})),Z}function Ra(i){var t,o,a,d;return{props:{MuiGrid:(o=go)===null||o===void 0||(t=o.MuiGrid)===null||t===void 0?void 0:t.defaultProps,MuiSwitch:(d=go)===null||d===void 0||(a=d.MuiSwitch)===null||a===void 0?void 0:a.defaultProps},...Is(i)}}function Ia(i){return rs(i,go).overrides}function Bs(i){const t=Ra(i),o=(0,Yr.Z)(t),a=Ia(o);return{...o,overrides:a}}const Pa=Bs({palette:ko.light}),$s=Bs({palette:ko.dark});var yi=n(98192),xi=n(15222);const bi=[{id:"light",title:"Light Theme",variant:"light",icon:(0,p.jsx)(xi.Z,{}),Provider:({children:i})=>(0,p.jsx)(vo,{theme:or.light,children:i})},{id:"dark",title:"Dark Theme",variant:"dark",icon:(0,p.jsx)(yi.Z,{}),Provider:({children:i})=>(0,p.jsx)(vo,{theme:or.dark,children:i})}];function os(i){var t,o,a,d,b,B,Z,oe,me,Me,Te,Fe;return co({...i,apis:(me=(t=i)===null||t===void 0?void 0:t.apis)!==null&&me!==void 0?me:[],bindRoutes:(o=i)===null||o===void 0?void 0:o.bindRoutes,components:{...ae,...(a=i)===null||a===void 0?void 0:a.components},configLoader:(d=i)===null||d===void 0?void 0:d.configLoader,defaultApis:ts,icons:{...Tr,...(b=i)===null||b===void 0?void 0:b.icons},plugins:(Me=(B=i)===null||B===void 0?void 0:B.plugins)!==null&&Me!==void 0?Me:[],featureFlags:(Te=(Z=i)===null||Z===void 0?void 0:Z.featureFlags)!==null&&Te!==void 0?Te:[],themes:(Fe=(oe=i)===null||oe===void 0?void 0:oe.themes)!==null&&Fe!==void 0?Fe:bi})}var tr=n(25271),Bo=n(76635);async function Si({storageApi:i}){const t=i.forBucket("settings"),o=i.forBucket("starredEntities"),a=t.snapshot("starredEntities").value;if(!(0,Bo.isArray)(a))return;var d;const b=new Set((d=o.snapshot("entityRefs").value)!==null&&d!==void 0?d:[]);a.filter(Bo.isString).map(B=>B.split(":")).filter(B=>B.length===4&&B[0]==="entity").map(([B,Z,oe,me])=>(0,tr.eE)({kind:Z,namespace:oe,name:me})).forEach(B=>b.add(B)),await o.set("entityRefs",Array.from(b)),await t.remove("starredEntities")}class Ds{async toggleStarred(t){this.starredEntities.has(t)?this.starredEntities.delete(t):this.starredEntities.add(t),await this.settingsStore.set("entityRefs",Array.from(this.starredEntities))}starredEntitie$(){return this.observable}notifyChanges(){for(const t of this.subscribers)t.next(new Set(this.starredEntities))}constructor(t){(0,k._)(this,"settingsStore",void 0),(0,k._)(this,"starredEntities",void 0),(0,k._)(this,"subscribers",new Set),(0,k._)(this,"observable",new($e())(a=>(a.next(new Set(this.starredEntities)),this.subscribers.add(a),()=>{this.subscribers.delete(a)}))),Si(t).then(),this.settingsStore=t.storageApi.forBucket("starredEntities");var o;this.starredEntities=new Set((o=this.settingsStore.snapshot("entityRefs").value)!==null&&o!==void 0?o:[]),this.settingsStore.observe$("entityRefs").subscribe({next:a=>{var d;this.starredEntities=new Set((d=a.value)!==null&&d!==void 0?d:[]),this.notifyChanges()}})}}var La=n(8799),so=n(79692),Ci=n(12420),Vn=n(39709),Oa=n(19928);function wi(){const i=useApi(catalogApiRef),{error:t,loading:o,value:a}=useAsync(async()=>await i.getEntityFacets({facets:["kind"]}).then(b=>{var B;return((B=b.facets.kind)===null||B===void 0?void 0:B.map(Z=>Z.value).sort())||[]}),[i]);return{loading:o,error:t,allKinds:a!=null?a:[]}}function Ns(i,t,o){let a=i;return t&&(a=a.filter(b=>t.some(B=>B.toLocaleLowerCase("en-US")===b.toLocaleLowerCase("en-US")))),o&&!i.some(b=>b.toLocaleLowerCase("en-US")===o.toLocaleLowerCase("en-US"))&&(a=a.concat([o])),a.sort().reduce((b,B)=>(b[B.toLocaleLowerCase("en-US")]=B,b),{})}const Fs=(0,so.Z)(i=>(0,Ci.Z)({root:{...i.typography.h4}}));function ka(i){var t;const{initialFilter:o="component",allowedKinds:a}=i,d=Fs(),{allKinds:b}=useAllKinds(),{filters:B,updateFilters:Z,queryParameters:{kind:oe}}=useEntityList(),me=useMemo(()=>[oe].flat()[0],[oe]);var Me;const[Te,Fe]=useState((Me=me!=null?me:(t=B.kind)===null||t===void 0?void 0:t.value)!==null&&Me!==void 0?Me:o);useEffect(()=>{me&&Fe(me)},[me]),useEffect(()=>{var st;if(!((st=B.kind)===null||st===void 0)&&st.value){var tn;Fe((tn=B.kind)===null||tn===void 0?void 0:tn.value)}},[B.kind]),useEffect(()=>{Z({kind:Te?new EntityKindFilter(Te):void 0})},[Te,Z]);const Je=filterKinds(b,a,Te);return _jsx(Select,{input:_jsx(InputBase,{}),value:Te.toLocaleLowerCase("en-US"),onChange:st=>Fe(st.target.value),classes:d,children:Object.keys(Je).map(st=>_jsx(MenuItem,{value:st,children:`${pluralize(Je[st])}`},st))})}var Ba=n(86359),ss=n(95544),$o=n(99688),Do=n(12231),No=n(86136),Fo=n(49378),ji=n(85256),is=n(80030),as=n(61837),Ei=n(79784),Ai=n(50758),ls=n(31654),Ti=n(43054),Ri=n(65759),$a=n(49280),Ii=n(96641);function Pi(i){const{entity:t,loading:o,error:a}=(0,Ii.ce)(),{allowed:d,loading:b,error:B}=fo({permission:i,resourceRef:t?(0,tr.eE)(t):void 0});return o||b?{loading:!0,allowed:!1}:a?{loading:!1,allowed:!1,error:a}:{loading:!1,allowed:d,error:B}}const cs="catalog-entity",Li=Ar({name:"catalog.entity.read",attributes:{action:"read"},resourceType:cs}),Zs=Ar({name:"catalog.entity.create",attributes:{action:"create"}}),ds=Ar({name:"catalog.entity.delete",attributes:{action:"delete"},resourceType:cs}),Oi=Ar({name:"catalog.entity.refresh",attributes:{action:"update"},resourceType:cs}),Us=Ar({name:"catalog.location.read",attributes:{action:"read"}}),ki=Ar({name:"catalog.location.create",attributes:{action:"create"}}),Bi=Ar({name:"catalog.location.delete",attributes:{action:"delete"}}),Da=[Li,Zs,ds,Oi,Us,ki,Bi];var $i=n(49166);function Ms(i){var t,o,a,d;const{unregisterEntityOptions:b,isUnregisterAllowed:B,onUnregisterEntity:Z,onClose:oe}=i,me=typeof((t=b)===null||t===void 0?void 0:t.disableUnregister)=="boolean";var Me;const Te=(Me=!B||(me?!!(!((o=b)===null||o===void 0)&&o.disableUnregister):((a=b)===null||a===void 0?void 0:a.disableUnregister)==="disable"))!==null&&Me!==void 0?Me:!1;let Fe=(0,p.jsx)(p.Fragment,{});return((d=b)===null||d===void 0?void 0:d.disableUnregister)!=="hidden"&&(Fe=(0,p.jsxs)(Do.Z,{onClick:()=>{oe(),Z()},disabled:Te,children:[(0,p.jsx)(No.Z,{children:(0,p.jsx)($i.Z,{fontSize:"small"})}),(0,p.jsx)(Fo.Z,{primary:"Unregister entity"})]})),(0,p.jsx)(p.Fragment,{children:Fe})}const Di=(0,so.Z)(i=>({button:{color:i.page.fontColor}}),{name:"PluginCatalogEntityContextMenu"});function zs(i){const{UNSTABLE_extraContextMenuItems:t,UNSTABLE_contextMenuOptions:o,onUnregisterEntity:a,onInspectEntity:d}=i,[b,B]=(0,W.useState)(),Z=Di(),me=Pi(ds).allowed,Me=tn=>{B(tn.currentTarget)},Te=()=>{B(void 0)},Fe=(0,m.h_)(m.$v),Je=(0,W.useCallback)(()=>{window.navigator.clipboard.writeText(window.location.toString()).then(()=>Fe.post({message:"Copied!",severity:"info",display:"transient"}))},[Fe]),st=t&&[...t.map(tn=>(0,p.jsxs)(Do.Z,{onClick:()=>{Te(),tn.onClick()},children:[(0,p.jsx)(No.Z,{children:(0,p.jsx)(tn.Icon,{fontSize:"small"})}),(0,p.jsx)(Fo.Z,{primary:tn.title})]},tn.title)),(0,p.jsx)(ji.Z,{},"the divider is here!")];return(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)(is.ZP,{title:"More",arrow:!0,children:(0,p.jsx)(as.Z,{"aria-label":"more","aria-controls":"long-menu","aria-haspopup":"true","aria-expanded":!!b,role:"button",onClick:Me,"data-testid":"menu-button",className:Z.button,id:"long-menu",children:(0,p.jsx)(Ti.Z,{})})}),(0,p.jsx)(Ei.ZP,{open:Boolean(b),onClose:Te,anchorEl:b,anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"},"aria-labelledby":"long-menu",children:(0,p.jsxs)(Ai.Z,{autoFocusItem:Boolean(b),children:[st,(0,p.jsx)(Ms,{unregisterEntityOptions:o,isUnregisterAllowed:me,onUnregisterEntity:a,onClose:Te}),(0,p.jsxs)(Do.Z,{onClick:()=>{Te(),d()},children:[(0,p.jsx)(No.Z,{children:(0,p.jsx)(ls.Z,{fontSize:"small"})}),(0,p.jsx)(Fo.Z,{primary:"Inspect entity"})]}),(0,p.jsxs)(Do.Z,{onClick:()=>{Te(),Je()},children:[(0,p.jsx)(No.Z,{children:(0,p.jsx)(Ri.Z,{fontSize:"small"})}),(0,p.jsx)(Fo.Z,{primary:"Copy entity URL"})]})]})})]})}const Ni="plugin.catalog.entityLayoutRoute",us=()=>null;(0,m.R5)(us,Ni,!0),(0,m.R5)(us,"core.gatherMountPoints",!0);function Na(i){const{entity:t,title:o}=i;return(0,p.jsxs)(ss.Z,{display:"inline-flex",alignItems:"center",height:"1em",maxWidth:"100%",children:[(0,p.jsx)(ss.Z,{component:"span",textOverflow:"ellipsis",whiteSpace:"nowrap",overflow:"hidden",children:o}),t&&(0,p.jsx)(Vn.LH,{entity:t})]})}function Fi(i,t,o,a){var d,b,B,Z,oe;const me=(oe=i!=null?i:(d=a)===null||d===void 0?void 0:d.kind)!==null&&oe!==void 0?oe:"";var Me;const Te=(Me=t!=null?t:(b=a)===null||b===void 0?void 0:b.metadata.namespace)!==null&&Me!==void 0?Me:"";var Fe,Je,st;return{headerTitle:`${(st=(Je=(Fe=(B=a)===null||B===void 0?void 0:B.metadata.title)!==null&&Fe!==void 0?Fe:o)!==null&&Je!==void 0?Je:(Z=a)===null||Z===void 0?void 0:Z.metadata.name)!==null&&st!==void 0?st:""}${Te&&Te!==tr.zG?` in ${Te}`:""}`,headerType:(()=>{let Vt=me.toLocaleLowerCase("en-US");return a&&a.spec&&"type"in a.spec&&(Vt+=" \u2014 ",Vt+=a.spec.type.toLocaleLowerCase("en-US")),Vt})()}}function Zi(i){var t;const{entity:o}=i,a=(0,Vn.hF)(o,tr.S4);return(0,p.jsxs)(p.Fragment,{children:[a.length>0&&(0,p.jsx)(cn.i9,{label:"Owner",value:(0,p.jsx)(Vn.rI,{entityRefs:a,defaultKind:"Group",color:"inherit"})}),((t=o.spec)===null||t===void 0?void 0:t.lifecycle)&&(0,p.jsx)(cn.i9,{label:"Lifecycle",value:o.spec.lifecycle})]})}const Ui=i=>{var t,o,a;const{UNSTABLE_extraContextMenuItems:d,UNSTABLE_contextMenuOptions:b,children:B,NotFoundComponent:Z}=i,{kind:oe,namespace:me,name:Me}=(0,m.Oi)(Vn.wi),{entity:Te,loading:Fe,error:Je}=(0,Vn.ce)(),st=(0,V.TH)(),tn=(0,m.vJ)(B,Or=>Or.selectByComponentData({key:Ni,withStrictError:"Child of EntityLayout must be an EntityLayout.Route"}).getElements().flatMap(({props:Pn})=>{if(Te){if(Pn.if&&!Pn.if(Te))return[]}else return[];return[{path:Pn.path,title:Pn.title,children:Pn.children,tabProps:Pn.tabProps}]}),[Te]),{headerTitle:Vt,headerType:rr}=Fi(oe,me,Me,Te),[Mr,hr]=(0,W.useState)(!1),[br,Sr]=(0,W.useState)(!1),Fn=(0,V.s0)(),Pr=async()=>{hr(!1),Sr(!1),Fn("/")};(0,W.useEffect)(()=>{hr(!1),Sr(!1)},[st.pathname]);var Lr;return(0,p.jsxs)(cn.T3,{themeId:(Lr=(a=Te)===null||a===void 0||(o=a.spec)===null||o===void 0||(t=o.type)===null||t===void 0?void 0:t.toString())!==null&&Lr!==void 0?Lr:"home",children:[(0,p.jsx)(cn.h4,{title:(0,p.jsx)(Na,{title:Vt,entity:Te}),pageTitleOverride:Vt,type:rr,children:Te&&(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)(Zi,{entity:Te}),(0,p.jsx)(zs,{UNSTABLE_extraContextMenuItems:d,UNSTABLE_contextMenuOptions:b,onUnregisterEntity:()=>hr(!0),onInspectEntity:()=>Sr(!0)})]})}),Fe&&(0,p.jsx)(cn.Ex,{}),Te&&(0,p.jsx)(cn.tn,{routes:tn}),Je&&(0,p.jsx)(cn.VY,{children:(0,p.jsx)($o.Z,{severity:"error",children:Je.toString()})}),!Fe&&!Je&&!Te&&(0,p.jsx)(cn.VY,{children:Z||(0,p.jsxs)(cn.GB,{title:"Entity not found",children:["There is no ",oe," with the requested"," ",(0,p.jsx)(cn.rU,{to:"https://backstage.io/docs/features/software-catalog/references",children:"kind, namespace, and name"}),"."]})}),(0,p.jsx)(Vn.pp,{open:Mr,entity:Te,onConfirm:Pr,onClose:()=>hr(!1)}),(0,p.jsx)(Vn.U_,{open:br,entity:Te,onClose:()=>Sr(!1)})]})};Ui.Route=us;function Fa(i){const{open:t,onClose:o,onConfirm:a,entity:d}=i,[b,B]=useState(!1),Z=useApi(catalogApiRef),oe=useApi(alertApiRef),me=async()=>{B(!0);try{const Me=d.metadata.uid;await Z.removeEntityByUid(Me),a()}catch(Me){assertError(Me),oe.post({message:Me.message})}finally{B(!1)}};return _jsxs(Dialog,{open:t,onClose:o,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:b,onClick:me,children:"Delete"}),_jsx(Button,{onClick:o,color:"primary",children:"Cancel"})]})]})}var yo=n(19625);function Za(i){var t,o,a;return((a=i)===null||a===void 0||(o=a.metadata)===null||o===void 0||(t=o.annotations)===null||t===void 0?void 0:t["backstage.io/orphan"])==="true"}function Ua(){const i=useNavigate(),t=useRouteRef(rootRouteRef),[o,a]=useState(!1),{entity:d}=useEntity(),b=async()=>{a(!1),i(t())};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:o,entity:d,onConfirm:b,onClose:()=>a(!1)})]})}async function Ws(i,t){var o,a;const d=(o=i.relations)===null||o===void 0?void 0:o.map(B=>B.targetRef);if(!d||((a=d)===null||a===void 0?void 0:a.length)<1||d.length>1e3)return[];const b=await t.getEntitiesByRefs({entityRefs:d,fields:["kind","metadata.name","metadata.namespace"]});return d.filter((B,Z)=>b.items[Z]===void 0)}async function Ma(i,t){const o=t.apis.get(catalogApiRef);if(!o)throw new Error(`No implementation available for ${catalogApiRef}`);return(await Ws(i,o)).length>0}function za(){const{entity:i}=useEntity(),t=useApi(catalogApiRef),{loading:o,error:a,value:d}=useAsync(async()=>Ws(i,t),[i,t]);return a?_jsx(Box,{mb:1,children:_jsx(ResponseErrorPanel,{error:a})}):o||!d||d.length===0?null:_jsx(_Fragment,{children:_jsxs(Alert,{severity:"warning",children:["This entity has relations to other entities, which can't be found in the catalog. ",_jsx("br",{}),"Entities not found are: ",d.join(", ")]})})}var hs=n(4791);const Mi=i=>i.error&&i.level==="error"&&i.type===ENTITY_STATUS_CATALOG_PROCESSING_TYPE;async function xo(i,t){return{items:(await t.getEntityAncestors({entityRef:i})).items.map(d=>{var b,B;return{errors:((B=(b=d.entity.status)===null||b===void 0?void 0:b.items)!==null&&B!==void 0?B:[]).filter(Mi).map(me=>me.error).filter(me=>Boolean(me)),entity:d.entity}}).filter(d=>d.errors.length>0)}}async function zi(i,t){const o=t.apis.get(catalogApiRef);if(!o)throw new Error(`No implementation available for ${catalogApiRef}`);return(await xo(stringifyEntityRef(i),o)).items.length>0}function Wi(){const{entity:i}=useEntity(),t=stringifyEntityRef(i),o=useApi(catalogApiRef),{loading:a,error:d,value:b}=useAsync(async()=>xo(t,o),[t,o]);return d?_jsx(Box,{mb:1,children:_jsx(ResponseErrorPanel,{error:d})}):a||!b?null:_jsx(_Fragment,{children:b.items.map((B,Z)=>_jsxs(Box,{mb:1,children:[stringifyEntityRef(i)!==stringifyEntityRef(B.entity)&&_jsxs(Box,{p:1,children:["The error below originates from"," ",_jsx(EntityRefLink,{entityRef:B.entity})]}),B.errors.map((oe,me)=>_jsx(ResponseErrorPanel,{error:oe},me))]},Z))})}const xr="core.backstage.entitySwitch",Vs=i=>null;(0,m.R5)(Vs,xr,!0);const Hs=i=>{var t;const{entity:o,loading:a}=(0,Vn.ce)(),d=(0,m.I_)(),b=(0,m.vJ)(i.children,oe=>oe.selectByComponentData({key:xr,withStrictError:"Child of EntitySwitch is not an EntitySwitch.Case"}).getElements().flatMap(me=>{var Me;if(a)return[];const{if:Te,children:Fe}=me.props;return o?[{if:(Me=Te)===null||Me===void 0?void 0:Me(o,{apis:d}),children:Fe}]:[{if:Te===void 0,children:Fe}]}),[d,o,a]);if(b.some(oe=>typeof oe.if=="object"&&"then"in oe.if))return(0,p.jsx)(Vi,{results:b,renderMultipleMatches:i.renderMultipleMatches});if(i.renderMultipleMatches==="all"){const oe=b.filter(me=>me.if).map(me=>me.children);return oe.length===0?ps(b):(0,p.jsx)(p.Fragment,{children:oe})}var Z;return(Z=(t=b.find(oe=>oe.if))===null||t===void 0?void 0:t.children)!==null&&Z!==void 0?Z:ps(b)};function Vi({results:i,renderMultipleMatches:t}){const{loading:o,value:a}=(0,c.default)(async()=>{const d=i.map(async({if:B,children:Z})=>{try{if(await B)return Z}catch{}return null});if(t==="all"){const B=(await Promise.all(d)).filter(Boolean);return B.length===0?ps(i):(0,p.jsx)(p.Fragment,{children:B})}var b;return(b=(await Promise.all(d)).find(Boolean))!==null&&b!==void 0?b:ps(i)},[i]);return o||!a?null:a}function ps(i){var t,o;return(o=(t=i.filter(a=>a.if===void 0)[0])===null||t===void 0?void 0:t.children)!==null&&o!==void 0?o:null}Hs.Case=Vs;const Rr=null,Hi=Vn._i.Filters,Wa=Vn._i.Content;var Va=n(85877),Gi=n(15096);const Jn=(0,m.rx)({id:"catalog",apis:[(0,m.ni)({api:Vn.Ah,deps:{discoveryApi:m.NW,fetchApi:m.gP},factory:({discoveryApi:i,fetchApi:t})=>new hs.MS({discoveryApi:i,fetchApi:t})}),(0,m.ni)({api:Vn.p3,deps:{storageApi:m.E6},factory:({storageApi:i})=>new Ds({storageApi:i})})],routes:{catalogIndex:yo._Z,catalogEntity:Vn.wi},externalRoutes:{createComponent:yo.yw,viewTechDoc:yo.jU,createFromTemplate:yo.ql},__experimentalConfigure(i){return{...{createButtonTitle:"Create"},...i}}}),fs=Jn.provide((0,m.P4)({name:"CatalogIndexPage",component:()=>n.e(9323).then(n.bind(n,89323)).then(i=>i.CatalogPage),mountPoint:yo._Z})),Gs=Jn.provide((0,m.P4)({name:"CatalogEntityPage",component:()=>n.e(8951).then(n.bind(n,78951)).then(i=>i.CatalogEntityPage),mountPoint:Vn.wi})),Ki=Jn.provide((0,m.CO)({name:"EntityAboutCard",component:{lazy:()=>Promise.resolve().then(n.bind(n,8799)).then(i=>i.AboutCard)}})),Yi=Jn.provide((0,m.CO)({name:"EntityLinksCard",component:{lazy:()=>n.e(7750).then(n.bind(n,17750)).then(i=>i.EntityLinksCard)}})),Ji=Jn.provide((0,m.CO)({name:"EntityLabelsCard",component:{lazy:()=>Promise.resolve().then(n.bind(n,85877)).then(i=>i.EntityLabelsCard)}})),Ks=Jn.provide((0,m.CO)({name:"EntityHasSystemsCard",component:{lazy:()=>n.e(5458).then(n.bind(n,5458)).then(i=>i.HasSystemsCard)}})),Ha=Jn.provide((0,m.CO)({name:"EntityHasComponentsCard",component:{lazy:()=>n.e(1105).then(n.bind(n,1105)).then(i=>i.HasComponentsCard)}})),Ga=Jn.provide((0,m.CO)({name:"EntityHasSubcomponentsCard",component:{lazy:()=>n.e(2440).then(n.bind(n,82440)).then(i=>i.HasSubcomponentsCard)}})),Qi=Jn.provide((0,m.CO)({name:"EntityHasResourcesCard",component:{lazy:()=>n.e(9770).then(n.bind(n,79770)).then(i=>i.HasResourcesCard)}})),Xi=Jn.provide((0,m.CO)({name:"EntityDependsOnComponentsCard",component:{lazy:()=>n.e(9545).then(n.bind(n,19545)).then(i=>i.DependsOnComponentsCard)}})),_i=Jn.provide((0,m.CO)({name:"EntityDependencyOfComponentsCard",component:{lazy:()=>n.e(184).then(n.bind(n,40184)).then(i=>i.DependencyOfComponentsCard)}})),Ka=Jn.provide((0,m.CO)({name:"EntityDependsOnResourcesCard",component:{lazy:()=>n.e(1032).then(n.bind(n,81032)).then(i=>i.DependsOnResourcesCard)}})),gs=Jn.provide((0,m.CO)({name:"RelatedEntitiesCard",component:{lazy:()=>n.e(732).then(n.bind(n,732)).then(i=>i.RelatedEntitiesCard)}})),Ya=Jn.provide((0,Gi.E5)({name:"CatalogSearchResultListItem",component:()=>n.e(7670).then(n.bind(n,27670)).then(i=>i.CatalogSearchResultListItem),predicate:i=>i.type==="software-catalog"}));var Ys=n(32838);class Js{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(t,o){const d=`${await this.getApiOrigin()}/${o}`,b=await fetch(`${d.endsWith("/")?d:`${d}/`}index.html`);if(b.status===404)throw new Error("Page not found");return b.text()}async syncEntityDocs(t){return"cached"}async getBaseUrl(t,o,a){const d=await this.getApiOrigin();return new URL(t,`${d}/${a}`).toString()}constructor({configApi:t,discoveryApi:o,identityApi:a}){(0,k._)(this,"configApi",void 0),(0,k._)(this,"discoveryApi",void 0),(0,k._)(this,"identityApi",void 0),this.configApi=t,this.discoveryApi=o,this.identityApi=a}}class Qs{async getApiOrigin(){return await this.discoveryApi.getBaseUrl("techdocs")}async getEntityMetadata(t){return{apiVersion:"backstage.io/v1alpha1",kind:"Component",metadata:{name:"local"},spec:{owner:"test",lifecycle:"experimental"}}}async getTechDocsMetadata(t){return{site_name:"Live preview environment",site_description:""}}constructor({configApi:t,discoveryApi:o,identityApi:a}){(0,k._)(this,"configApi",void 0),(0,k._)(this,"discoveryApi",void 0),(0,k._)(this,"identityApi",void 0),this.configApi=t,this.discoveryApi=o,this.identityApi=a}}const qi=[(0,m.ni)({api:U.Dl,deps:{configApi:m.Ds,discoveryApi:m.NW,identityApi:m.$4},factory:({configApi:i,discoveryApi:t,identityApi:o})=>new Js({configApi:i,discoveryApi:t,identityApi:o})}),(0,m.ni)({api:U.gT,deps:{configApi:m.Ds,discoveryApi:m.NW,identityApi:m.$4},factory:({configApi:i,discoveryApi:t,identityApi:o})=>new Qs({configApi:i,discoveryApi:t,identityApi:o})}),(0,m.ni)({api:Ys.q3,deps:{configApi:m.Ds},factory:({configApi:i})=>Ys.ae.fromConfig(i)})],ea={backend:{baseUrl:"http://localhost:3000"},techdocs:{builder:"external"}},ta={backend:{baseUrl:"http://localhost:7007"},techdocs:{builder:"external"}};async function Xs(){const i=await fetch("/.detect");return i.ok?(await i.text()).trim()==="techdocs-cli-server":!1}async function na(){const i=await Kr(),t=await Xs();return[...i,{context:"detected",data:t?ea:ta}]}var Zo=n(58845);const _s=(0,so.Z)({svg:{width:"auto",height:30},path:{fill:"#7df3e1"}});var ei=()=>{const i=_s();return(0,p.jsx)("svg",{className:i.svg,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 2079.95 456.05",children:(0,p.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 ra=(0,so.Z)({svg:{width:"auto",height:28},path:{fill:"#7df3e1"}});var ti=()=>{const i=ra();return(0,p.jsx)("svg",{className:i.svg,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 337.46 428.5",children:(0,p.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 nr=(0,so.Z)({root:{width:cn.po.drawerWidthClosed,height:3*cn.po.logoHeight,display:"flex",flexFlow:"row nowrap",alignItems:"center",marginBottom:-14},link:{width:cn.po.drawerWidthClosed,marginLeft:24}}),sa=()=>{const i=nr(),{isOpen:t}=(0,cn.mZ)();return(0,p.jsx)("div",{className:i.root,children:(0,p.jsx)(cn.rU,{to:"/docs/default/component/local/",underline:"none",className:i.link,children:t?(0,p.jsx)(ei,{}):(0,p.jsx)(ti,{})})})},ia=({children:i})=>(0,p.jsxs)(cn.tR,{children:[(0,p.jsxs)(cn.YE,{children:[(0,p.jsx)(sa,{}),(0,p.jsx)(cn.v7,{}),(0,p.jsx)(cn.R6,{icon:Zo.Z,to:"/docs/default/component/local",text:"Docs Preview"})]}),i]});var aa=n(32388),ni=n(4142);const la=(0,so.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 Ir;(function(i){i.LIGHT="light",i.DARK="dark"})(Ir||(Ir={}));const ms=()=>{const i=(0,m.h_)(m.hg),t=la(),[o,a]=(0,W.useState)(i.getActiveThemeId()===Ir.DARK?Ir.DARK:Ir.LIGHT),d={[Ir.LIGHT]:{icon:ni.Z,title:"Dark theme"},[Ir.DARK]:{icon:aa.Z,title:"Light theme"}},{title:b,icon:B}=d[o],Z=()=>{a(oe=>{const me=oe===Ir.LIGHT?Ir.DARK:Ir.LIGHT;return i.setActiveThemeId(me),me})};return(0,p.jsx)(ss.Z,{display:"flex",alignItems:"center",mr:2,children:(0,p.jsx)(is.ZP,{title:b,arrow:!0,children:(0,p.jsx)(as.Z,{size:"small",onClick:Z,children:(0,p.jsx)(B,{className:t.headerIcon})})})})},ca=()=>(0,p.jsxs)(w.I6,{children:[(0,p.jsx)(de.S,{}),(0,p.jsx)(D.F,{withSearch:!1})]}),da=(0,p.jsx)(ca,{}),ri=os({apis:qi,configLoader:na,plugins:Object.values(r)}),Uo=ri.getProvider(),ua=ri.getRouter(),ha=w.s4.provide((0,U.KY)({name:"ThemeToggleAddon",component:ms,location:U.oZ.Header})),oi=(0,p.jsxs)(ws,{children:[(0,p.jsx)(V.Fg,{to:"/docs/default/component/local/"},"/"),(0,p.jsx)(V.AW,{path:"/catalog/:namespace/:kind/:name",element:(0,p.jsx)(Gs,{})}),(0,p.jsx)(V.AW,{path:"/docs",element:(0,p.jsx)(w.Jl,{}),children:(0,p.jsx)(X.u,{})}),(0,p.jsxs)(V.AW,{path:"/docs/:namespace/:kind/:name/*",element:(0,p.jsx)(w.I6,{}),children:[da,(0,p.jsx)(U.DR,{children:(0,p.jsx)(ha,{})})]})]});var Xa=()=>(0,p.jsx)(Uo,{children:(0,p.jsx)(ua,{children:(0,p.jsx)(ia,{children:oi})})});f.render((0,p.jsx)(Xa,{}),document.getElementById("root"))},51837:function(It,Pe,n){"use strict";n.d(Pe,{CT:function(){return m},EI:function(){return ve},uW:function(){return f},Vt:function(){return h}});function r(){return typeof window!="undefined"&&window.Math===Math?window:typeof self!="undefined"&&self.Math===Math?self:Function("return this")()}const p=r(),W=ce=>`__@backstage/${ce}__`;function f(ce,z){const de=W(ce);let D=p[de];return D||(D=z(),p[de]=D,D)}var V=n(2784);function m(ce){return f(ce,()=>(0,V.createContext)(void 0))}function h(ce){return(0,V.useContext)(m(ce))}function F(ce){return{set(z){globalThis[`__@backstage/${ce}__`]=createContext(createVersionedValueMap(z))},reset(){delete globalThis[`__@backstage/${ce}__`]}}}function ve(ce){Object.freeze(ce);const z={atVersion(de){return ce[de]}};return Object.defineProperty(z,"$map",{configurable:!0,enumerable:!0,get(){return ce}}),z}},96641:function(It,Pe,n){"use strict";n.d(Pe,{X2:function(){return ve},ce:function(){return ce},h$:function(){return h}});var r=n(52322),p=n(25271),W=n(60871),f=n(51837),V=n(2784);const m=(0,f.CT)("entity-context"),h=z=>{const{children:de,entity:D,loading:A,error:se,refresh:ie}=z,ee={entity:D,loading:A,error:se,refresh:ie};return(0,r.jsx)(m.Provider,{value:(0,f.EI)({1:ee}),children:(0,r.jsx)(W.fC,{attributes:{...D?{entityRef:(0,p.eE)(D)}:void 0},children:de})})},F=z=>_jsx(h,{entity:z.entity,loading:!Boolean(z.entity),error:void 0,refresh:void 0,children:z.children});function ve(){const z=(0,f.Vt)("entity-context");if(!z)throw new Error("Entity context is not available");const de=z.atVersion(1);if(!de)throw new Error("EntityContext v1 not available");if(!de.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:de.entity}}function ce(){const z=(0,f.Vt)("entity-context");if(!z)throw new Error("Entity context is not available");const de=z.atVersion(1);if(!de)throw new Error("EntityContext v1 not available");const{entity:D,loading:A,error:se,refresh:ie}=de;return{entity:D,loading:A,error:se,refresh:ie}}},39709:function(It,Pe,n){"use strict";n.d(Pe,{h$:function(){return dt.h$},n3:function(){return r.n3},_i:function(){return K},tW:function(){return _e},df:function(){return Ue},UO:function(){return ht},ph:function(){return cn},dq:function(){return bt},nl:function(){return ts},dx:function(){return jt},rI:function(){return qt},u3:function(){return zn},xE:function(){return C},sL:function(){return c},LH:function(){return De},U_:function(){return no},pp:function(){return ro},EW:function(){return Oo},Ah:function(){return W},wi:function(){return Oe},hF:function(){return U.hF},CV:function(){return U.CV},$3:function(){return an},p3:function(){return f},ce:function(){return dt.ce},X2:function(){return dt.X2},wp:function(){return rt},ZW:function(){return Cn},eK:function(){return Ct},CR:function(){return ln}});var r=n(4791),p=n(60871);const W=(0,p.T0)({id:"plugin.catalog.service"}),f=(0,p.T0)({id:"catalog-react.starred-entities"});var V=n(82394);class m{async toggleStarred(j){this.starredEntities.delete(j)||this.starredEntities.add(j);for(const L of this.subscribers)L.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(j=>(j.next(new Set(this.starredEntities)),this.subscribers.add(j),()=>{this.subscribers.delete(j)})))}}var h=n(52322),F=n(2784),ve=n(41156),ce=n(60364),z=n(77277),de=n(4190),D=n(95544),A=n(90436),se=n(60905),ie=n(36444);const ee=y=>{const j=(0,ve.Z)(re=>re.breakpoints.down("md")),L=(0,ce.Z)(),[P,ae]=(0,F.useState)(!1);return j?(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(z.Z,{style:{marginTop:L.spacing(1),marginLeft:L.spacing(1)},onClick:()=>ae(!0),startIcon:(0,h.jsx)(ie.Z,{}),children:"Filters"}),(0,h.jsx)(de.ZP,{open:P,onClose:()=>ae(!1),anchor:"left",disableAutoFocus:!0,keepMounted:!0,variant:"temporary",children:(0,h.jsxs)(D.Z,{m:2,children:[(0,h.jsx)(A.Z,{variant:"h6",component:"h2",style:{marginBottom:L.spacing(1)},children:"Filters"}),y.children]})})]}):(0,h.jsx)(se.Z,{item:!0,lg:2,children:y.children})},X=y=>(0,h.jsx)(se.Z,{item:!0,xs:12,lg:10,children:y.children}),K=y=>(0,h.jsx)(se.Z,{container:!0,style:{position:"relative"},children:y.children});K.Filters=ee,K.Content=X;var R=n(53974),w=n(87612),I=n(25271),U=n(49280);class xe{getCatalogFilters(){return{kind:this.value}}toQueryValue(){return this.value}constructor(j){(0,w._)(this,"value",void 0),this.value=j}}class Se{getTypes(){return Array.isArray(this.value)?this.value:[this.value]}getCatalogFilters(){return{"spec.type":this.getTypes()}}toQueryValue(){return this.getTypes()}constructor(j){(0,w._)(this,"value",void 0),this.value=j}}class k{filterEntity(j){var L;return this.values.every(P=>((L=j.metadata.tags)!==null&&L!==void 0?L:[]).includes(P))}toQueryValue(){return this.values}constructor(j){(0,w._)(this,"values",void 0),this.values=j}}class Ge{filterEntity(j){const L=this.toUpperArray(this.value.split(/\s/)),P=this.toUpperArray([j.metadata.tags]),ae=this.toUpperArray([j.metadata.name,j.metadata.title]);for(const re of L)if(P.every(q=>q!==re)&&ae.every(q=>!q.includes(re)))return!1;return!0}toUpperArray(j){return j.flat().filter(L=>Boolean(L)).map(L=>L.toLocaleUpperCase("en-US"))}constructor(j){_define_property(this,"value",void 0),this.value=j}}class xt{filterEntity(j){return this.values.some(L=>(0,U.hF)(j,I.S4).some(P=>(0,I.eE)(P)===L))}toQueryValue(){return this.values}constructor(j){(0,w._)(this,"values",void 0),this.values=j.reduce((L,P)=>{try{return L.push((0,I.eE)((0,I.of)(P,{defaultKind:"Group"}))),L}catch{return L}},[])}}class Dt{filterEntity(j){return this.values.some(L=>{var P;return((P=j.spec)===null||P===void 0?void 0:P.lifecycle)===L})}toQueryValue(){return this.values}constructor(j){(0,w._)(this,"values",void 0),this.values=j}}class Ut{filterEntity(j){return this.values.some(L=>j.metadata.namespace===L)}toQueryValue(){return this.values}constructor(j){(0,w._)(this,"values",void 0),this.values=j}}class Tt{filterEntity(j){switch(this.value){case"owned":return this.isOwnedEntity(j);case"starred":return this.isStarredEntity(j);default:return!0}}toQueryValue(){return this.value}constructor(j,L,P){(0,w._)(this,"value",void 0),(0,w._)(this,"isOwnedEntity",void 0),(0,w._)(this,"isStarredEntity",void 0),this.value=j,this.isOwnedEntity=L,this.isStarredEntity=P}}class Nt{filterEntity(j){var L;const P=(L=j.metadata.annotations)===null||L===void 0?void 0:L["backstage.io/orphan"];return P!==void 0&&this.value.toString()===P}constructor(j){(0,w._)(this,"value",void 0),this.value=j}}class Yt{filterEntity(j){var L,P,ae;const re=((ae=j)===null||ae===void 0||(P=ae.status)===null||P===void 0||(L=P.items)===null||L===void 0?void 0:L.length)>0;return re!==void 0&&this.value===re}constructor(j){(0,w._)(this,"value",void 0),this.value=j}}var dt=n(96641),ut=n(76635),St=n(19126),lt=n.n(St),Zt=n(73557),Ht=n(69294),Ce=n(48760),$e=n(90736);const Ke=(0,F.createContext)(void 0),ht=y=>{const j=(0,$e.default)(),L=(0,p.h_)(W),[P,ae]=(0,F.useState)({}),re=(0,Zt.TH)();var q;const he=(0,F.useMemo)(()=>(q=lt().parse(re.search,{ignoreQueryPrefix:!0}).filters)!==null&&q!==void 0?q:{},[re]),[Ae,Le]=(0,F.useState)(()=>({appliedFilters:{},entities:[],backendEntities:[]})),[{loading:ze,error:Ne},We]=(0,Ht.default)(async()=>{const Be=(0,ut.compact)(Object.values(P)),He=(0,U.Gz)(Be),At=(0,U.wq)(Be),rn=(0,U.wq)((0,ut.compact)(Object.values(Ae.appliedFilters))),En=Object.keys(P).reduce((Rt,Kt)=>{var An;const ur=P[Kt];return!((An=ur)===null||An===void 0)&&An.toQueryValue&&(Rt[Kt]=ur.toQueryValue()),Rt},{});if((0,ut.isEqual)(rn,At))Le({appliedFilters:P,backendEntities:Ae.backendEntities,entities:Ae.backendEntities.filter(He)});else{const Rt=await L.getEntities({filter:At});Le({appliedFilters:P,backendEntities:Rt.items,entities:Rt.items.filter(He)})}if(j()){var Ot;const Rt=lt().parse(re.search,{ignoreQueryPrefix:!0}),Kt=lt().stringify({...Rt,filters:En},{addQueryPrefix:!0,arrayFormat:"repeat"}),An=`${window.location.pathname}${Kt}`;(Ot=window.history)===null||Ot===void 0||Ot.replaceState(null,document.title,An)}},[L,he,P,Ae],{loading:!0});(0,Ce.Z)(We,10,[P]);const it=(0,F.useCallback)(Be=>{ae(He=>{const At=typeof Be=="function"?Be(He):Be;return{...He,...At}})},[]),Et=(0,F.useMemo)(()=>({filters:Ae.appliedFilters,entities:Ae.entities,backendEntities:Ae.backendEntities,updateFilters:it,queryParameters:he,loading:ze,error:Ne}),[Ae,it,he,ze,Ne]);return(0,h.jsx)(Ke.Provider,{value:Et,children:y.children})};function rt(){const y=(0,F.useContext)(Ke);if(!y)throw new Error("useEntityList must be used within EntityListProvider");return y}var tt=n(64279),vt=n(18149),ot=n.n(vt),Qe=n(829),ft=n.n(Qe);function gt(){var y;const j=(0,p.h_)(W),{filters:{kind:L,type:P},queryParameters:{type:ae},updateFilters:re}=rt(),q=(0,F.useMemo)(()=>[ae].flat().filter(Boolean),[ae]);var he;const[Ae,Le]=(0,F.useState)(q.length?q:(he=(y=P)===null||y===void 0?void 0:y.getTypes())!==null&&he!==void 0?he:[]);(0,F.useEffect)(()=>{q.length&&Le(q)},[q]);const[ze,Ne]=(0,F.useState)([]),We=(0,F.useMemo)(()=>{var At;return(At=L)===null||At===void 0?void 0:At.value},[L]),{error:it,loading:Et,value:Be}=(0,tt.default)(async()=>We?await j.getEntityFacets({filter:{kind:We},facets:["spec.type"]}).then(rn=>rn.facets["spec.type"]||[]):[],[We,j]),He=(0,F.useRef)(Be);return(0,F.useEffect)(()=>{const At=He.current;if(He.current=Be,Et||!We||At===Be||!Be)return;const rn=[...new Set(ft()(Be,Ot=>-Ot.count).map(Ot=>Ot.value.toLocaleLowerCase("en-US")))];Ne(rn);const En=Ae.filter(Ot=>rn.includes(Ot));ot()(Ae,En)||Le(En)},[Et,We,Ae,Le,Be]),(0,F.useEffect)(()=>{re({type:Ae.length?new Se(Ae):void 0})},[Ae,re]),{loading:Et,error:it,availableTypes:ze,selectedTypes:Ae,setSelectedTypes:Le}}function Ct(y,j){var L,P,ae,re;const q=(P=j)===null||P===void 0||(L=P.type)===null||L===void 0?void 0:L.toLocaleLowerCase("en-US"),he=(re=j)===null||re===void 0||(ae=re.kind)===null||ae===void 0?void 0:ae.toLocaleLowerCase("en-US"),Ae=(0,p.h_)(W),{loading:Le,value:ze,error:Ne}=(0,tt.default)(async()=>{var We,it;const Et=(We=y.relations)===null||We===void 0?void 0:We.filter(He=>(!q||He.type.toLocaleLowerCase("en-US")===q)&&(!he||(0,I.of)(He.targetRef).kind===he));if(!(!((it=Et)===null||it===void 0)&&it.length))return[];const{items:Be}=await Ae.getEntitiesByRefs({entityRefs:Et.map(He=>He.targetRef)});return Be.filter(He=>Boolean(He))},[y,q,he]);return{entities:ze,loading:Le,error:Ne}}var mn=n(72164);function un(y){return typeof y=="string"?y:(0,I.eE)(y)}function ln(){const y=(0,p.h_)(f),j=(0,mn.Z)(y.starredEntitie$(),new Set),L=(0,F.useCallback)(ae=>j.has(un(ae)),[j]),P=(0,F.useCallback)(ae=>y.toggleStarred(un(ae)).then(),[y]);return{starredEntities:j,toggleStarredEntity:P,isStarredEntity:L}}function Sn(y){return typeof y=="string"?y:(0,I.eE)(y)}function hn(y){const j=(0,p.h_)(f),[L,P]=(0,F.useState)(!1);return(0,F.useEffect)(()=>{const re=j.starredEntitie$().subscribe({next(q){P(q.has(Sn(y)))}});return()=>{re.unsubscribe()}},[y,j]),{toggleStarredEntity:(0,F.useCallback)(()=>j.toggleStarred(Sn(y)).then(),[y,j]),isStarredEntity:L}}var vn=n(75435);function Cn(){const y=(0,p.h_)(p.$4),{loading:j,value:L}=(0,tt.default)(async()=>{const{ownershipEntityRefs:ae}=await y.getBackstageIdentity();return ae},[]),P=(0,F.useMemo)(()=>{const ae=new Set(L!=null?L:[]);return re=>{const q=(0,vn.h)(re,I.S4).map(I.eE);for(const he of q)if(ae.has(he))return!0;return!1}},[L]);return(0,F.useMemo)(()=>({loading:j,isOwnedEntity:P}),[j,P])}function on(){const y=(0,p.h_)(W),{error:j,loading:L,value:P}=(0,tt.default)(async()=>await y.getEntityFacets({facets:["kind"]}).then(re=>{var q;return((q=re.facets.kind)===null||q===void 0?void 0:q.map(he=>he.value).sort())||[]}),[y]);return{loading:L,error:j,allKinds:P!=null?P:[]}}function pn(y,j,L){let P=y;return j&&(P=P.filter(re=>j.some(q=>q.toLocaleLowerCase("en-US")===re.toLocaleLowerCase("en-US")))),L&&!y.some(re=>re.toLocaleLowerCase("en-US")===L.toLocaleLowerCase("en-US"))&&(P=P.concat([L])),P.sort().reduce((re,q)=>(re[q.toLocaleLowerCase("en-US")]=q,re),{})}function wn(y){var j;const{filters:L,queryParameters:{kind:P},updateFilters:ae}=rt(),re=(0,F.useMemo)(()=>[P].flat()[0],[P]);var q;const[he,Ae]=(0,F.useState)((q=re!=null?re:(j=L.kind)===null||j===void 0?void 0:j.value)!==null&&q!==void 0?q:y.initialFilter);(0,F.useEffect)(()=>{re&&Ae(re)},[re]),(0,F.useEffect)(()=>{var We;if(!((We=L.kind)===null||We===void 0)&&We.value){var it;Ae((it=L.kind)===null||it===void 0?void 0:it.value)}},[L.kind]),(0,F.useEffect)(()=>{ae({kind:he?new xe(he):void 0})},[he,ae]);const{allKinds:Le,loading:ze,error:Ne}=on();return{loading:ze,error:Ne,allKinds:Le!=null?Le:[],selectedKind:he,setSelectedKind:Ae}}const _e=y=>{const{allowedKinds:j,hidden:L,initialFilter:P="component"}=y,ae=(0,p.h_)(p.$v),{error:re,allKinds:q,selectedKind:he,setSelectedKind:Ae}=wn({initialFilter:P});if((0,F.useEffect)(()=>{re&&ae.post({message:"Failed to load entity kinds",severity:"error"})},[re,ae]),re)return null;const Le=pn(q,j,he),ze=Object.keys(Le).map(Ne=>({value:Ne,label:Le[Ne]}));return L?null:(0,h.jsx)(D.Z,{pb:1,pt:1,children:(0,h.jsx)(R.Ph,{label:"Kind",items:ze,selected:he.toLocaleLowerCase("en-US"),onChange:Ne=>Ae(String(Ne))})})};var Jt=n(79692),Wt=n(38016),Ye=n(88013),Tn=n(21324),sn=n(5806),Dn=n(19996),Rn=n(25505);const In=(0,h.jsx)(Rn.Z,{fontSize:"small"}),Kn=(0,h.jsx)(Dn.Z,{fontSize:"small"});function On({selected:y}){return(0,h.jsx)(Tn.Z,{icon:In,checkedIcon:Kn,checked:y})}const Yn=(0,F.memo)(y=>{var j;const{selected:L,value:P,availableOptions:ae,showCounts:re}=y,q=re?`${P} (${(j=ae)===null||j===void 0?void 0:j[P]})`:P;return(0,h.jsx)(sn.Z,{control:(0,h.jsx)(On,{selected:L}),label:q,onClick:he=>he.preventDefault()})});var we=n(86619),pe=n(72779),Re=n.n(pe);const H=(0,Jt.Z)({input:{}},{name:"CatalogReactEntityAutocompletePickerInput"});function N(y){const j=H();return(0,h.jsx)(we.Z,{variant:"outlined",...y,className:Re()(j.input,y.className)})}function le(y){var j;const{label:L,name:P,path:ae,showCounts:re,Filter:q,InputProps:he,initialSelectedOptions:Ae=[]}=y,{updateFilters:Le,filters:ze,queryParameters:{[P]:Ne}}=rt(),We=(0,p.h_)(W),{value:it}=(0,tt.default)(async()=>{var Rt;const Kt=ae,{facets:An}=await We.getEntityFacets({facets:[Kt],filter:(Rt=ze.kind)===null||Rt===void 0?void 0:Rt.getCatalogFilters()});return Object.fromEntries(An[Kt].map(({value:ur,count:Tr})=>[ur,Tr]))},[ze.kind]),Et=(0,F.useMemo)(()=>[Ne].flat().filter(Boolean),[Ne]);var Be;const[He,At]=(0,F.useState)(Et.length?Et:(Be=(j=ze[P])===null||j===void 0?void 0:j.values)!==null&&Be!==void 0?Be:Ae);(0,F.useEffect)(()=>{Et.length&&At(Et)},[Et]);const rn=Object.keys(it!=null?it:{}),En=He.length&&rn.length;(0,F.useEffect)(()=>{Le({[P]:En?new q(He):void 0})},[P,En,He,q,Le]);const Ot=ze[P];return Ot&&typeof Ot=="object"&&!("values"in Ot)||!rn.length||rn.length<=1?null:(0,h.jsx)(D.Z,{pb:1,pt:1,children:(0,h.jsxs)(A.Z,{variant:"button",component:"label",children:[L,(0,h.jsx)(Ye.ZP,{multiple:!0,disableCloseOnSelect:!0,options:rn,value:He,onChange:(Rt,Kt)=>At(Kt),renderOption:(Rt,{selected:Kt})=>(0,h.jsx)(Yn,{selected:Kt,value:Rt,availableOptions:it,showCounts:!!re}),size:"small",popupIcon:(0,h.jsx)(Wt.Z,{"data-testid":`${String(P)}-picker-expand`}),renderInput:Rt=>(0,h.jsx)(N,{...Rt,...he})})]})})}const Ee=(0,Jt.Z)({input:{}},{name:"CatalogReactEntityLifecyclePicker"}),Ue=y=>{const{initialFilter:j=[]}=y,L=Ee();return(0,h.jsx)(le,{label:"Lifecycle",name:"lifecycles",path:"spec.lifecycle",Filter:Dt,InputProps:{className:L.input},initialSelectedOptions:j})};var qe=n(6232),Pt=n(98685),$t=n(62367),Qt=n(72579),Xt=n.n(Qt);function an(y,j){var L,P;const ae=(L=j)===null||L===void 0?void 0:L.defaultKind;let re,q,he;if("metadata"in y?(re=y.kind,q=y.metadata.namespace,he=y.metadata.name):(re=y.kind,q=y.namespace,he=y.name),(q===void 0||q==="")&&(q=I.zG),((P=j)===null||P===void 0?void 0:P.defaultNamespace)!==void 0){var Ae;((Ae=j)===null||Ae===void 0?void 0:Ae.defaultNamespace)===q&&(q=void 0)}else q===I.zG&&(q=void 0);return re=re.toLocaleLowerCase("en-US"),re=ae&&ae.toLocaleLowerCase("en-US")===re?void 0:re,`${re?`${re}:`:""}${q?`${q}/`:""}${he}`}function ne(y,j){for(const L of["spec.profile.displayName","metadata.title"]){const P=Xt()(y,L);if(P&&typeof P=="string")return P}return j}function te({enabled:y}){const j=(0,p.h_)(W),[L]=(0,F.useState)(async()=>{if(!y)return[];const P="relations.ownedBy";return j.getEntityFacets({facets:[P]}).then(ae=>ae.facets[P].map(re=>re.value).map(re=>{const{kind:q,name:he,namespace:Ae}=(0,I.of)(re);return{apiVersion:"backstage.io/v1beta1",kind:q,metadata:{name:he,namespace:Ae}}}).sort((re,q)=>(re.metadata.namespace||"").localeCompare(q.metadata.namespace||"","en-US")||re.metadata.name.localeCompare(q.metadata.name,"en-US")||re.kind.localeCompare(q.kind,"en-US"))).catch(()=>[])});return(0,Ht.default)(async(P,ae)=>{var re;const q=await L;if(!q)return{items:[]};var he;const Ae=(he=(re=ae)===null||re===void 0?void 0:re.limit)!==null&&he!==void 0?he:20,{text:Le,start:ze}=Y(P),Ne=q.filter(it=>M(Le,it)),We=ze+Ae;return{items:Ne.slice(0,We),...O({entities:Ne,limit:We,payload:{text:Le,start:We}})}},[L],{loading:!0,value:{items:[]}})}function Y(y){return v(y)&&y.cursor?JSON.parse(atob(y.cursor)):{text:y.text||"",start:0}}function v(y){return!!y.cursor}function O({entities:y,limit:j,payload:L}){return y.length>j?{cursor:btoa(JSON.stringify(L))}:{}}function M(y,j){var L;const P=y.trim();return j.kind.includes(P)||((L=j.metadata.namespace)===null||L===void 0?void 0:L.includes(P))||j.metadata.name.includes(P)}function G(){const y=(0,p.h_)(W);return(0,Ht.default)(async(j,L)=>{var P;const ae=j,re=j;var q;const he=(q=(P=L)===null||P===void 0?void 0:P.limit)!==null&&q!==void 0?q:20;if(re.cursor){const Le=await y.queryEntities({cursor:re.cursor,limit:he});return{cursor:Le.pageInfo.nextCursor,items:[...re.items,...Le.items]}}const Ae=await y.queryEntities({fullTextFilter:{term:ae.text||"",fields:["metadata.name","kind","spec.profile.displayname","metadata.title"]},filter:{kind:["User","Group"]},orderFields:[{field:"metadata.name",order:"asc"}],limit:he});return{cursor:Ae.pageInfo.nextCursor,items:Ae.items}},[],{loading:!0})}var ue=n(21638);function be({mode:y,initialSelectedOwnersRefs:j}){const L=y==="owners-only",P=G(),ae=te({enabled:L}),[re,q]=L?ae:P;return[re,q,ke({enabled:!L,initialSelectedOwnersRefs:j})]}function ke({enabled:y,initialSelectedOwnersRefs:j}){const L=(0,F.useRef)({}),P=(0,p.h_)(W),[,ae]=(0,Ht.default)(async()=>{(await P.getEntitiesByRefs({entityRefs:j})).items.forEach(q=>{q&&(L.current[(0,I.eE)(q)]=q)})},[]);return(0,ue.n)(()=>{y&&j.length>0&&ae()}),{getEntity:re=>L.current[re],setEntity:re=>{L.current[(0,I.eE)(re)]=re}}}const Xe=(0,Jt.Z)({input:{}},{name:"CatalogReactEntityOwnerPicker"}),nt=(0,h.jsx)(Rn.Z,{fontSize:"small"}),yt=(0,h.jsx)(Dn.Z,{fontSize:"small"}),bt=y=>{var j,L,P;const ae=Xe(),{mode:re="owners-only"}=y||{},{updateFilters:q,filters:he,queryParameters:{owners:Ae}}=rt(),[Le,ze]=(0,F.useState)(""),Ne=(0,F.useMemo)(()=>[Ae].flat().filter(Boolean),[Ae]);var We;const[it,Et]=(0,F.useState)(Ne.length?Ne:(We=(j=he.owners)===null||j===void 0?void 0:j.values)!==null&&We!==void 0?We:[]),[{value:Be,loading:He},At,rn]=be({mode:re,initialSelectedOwnersRefs:it});(0,qe.b)(()=>At({text:Le}),[Le,At],250);const En=((L=Be)===null||L===void 0?void 0:L.items)||[];return(0,F.useEffect)(()=>{if(Ne.length){const Ot=new xt(Ne);Et(Ot.values)}},[Ne]),(0,F.useEffect)(()=>{q({owners:it.length?new xt(it):void 0})},[it,q]),["user","group"].includes(((P=he.kind)===null||P===void 0?void 0:P.value.toLocaleLowerCase("en-US"))||"")?null:(0,h.jsx)(D.Z,{pb:1,pt:1,children:(0,h.jsxs)(A.Z,{variant:"button",component:"label",children:["Owner",(0,h.jsx)(Ye.ZP,{multiple:!0,disableCloseOnSelect:!0,loading:He,options:En,value:it,getOptionSelected:(Ot,Rt)=>typeof Rt=="string"?(0,I.eE)(Ot)===Rt:Ot===Rt,getOptionLabel:Ot=>{const Rt=typeof Ot=="string"?rn.getEntity(Ot)||(0,I.of)(Ot,{defaultKind:"group",defaultNamespace:"default"}):Ot;return ne(Rt,an(Rt))},onChange:(Ot,Rt)=>{ze(""),Et(Rt.map(Kt=>{const An=typeof Kt=="string"?Kt:(0,I.eE)(Kt);return typeof Kt!="string"&&rn.setEntity(Kt),An}))},filterOptions:Ot=>Ot,renderOption:(Ot,{selected:Rt})=>{const Kt=Ot.kind.toLocaleLowerCase("en-US")==="group";return(0,h.jsx)(sn.Z,{control:(0,h.jsx)(Tn.Z,{icon:nt,checkedIcon:yt,checked:Rt}),onClick:An=>An.preventDefault(),label:(0,h.jsxs)(D.Z,{display:"flex",flexWrap:"wrap",alignItems:"center",children:[Kt?(0,h.jsx)($t.Z,{fontSize:"small"}):(0,h.jsx)(Pt.Z,{fontSize:"small"}),"\xA0",ne(Ot,an(Ot,{defaultKind:Ot.kind}))]})})},size:"small",popupIcon:(0,h.jsx)(Wt.Z,{"data-testid":"owner-picker-expand"}),renderInput:Ot=>(0,h.jsx)(we.Z,{...Ot,className:ae.input,onChange:Rt=>{ze(Rt.currentTarget.value)},variant:"outlined"}),ListboxProps:{onScroll:Ot=>{var Rt;const Kt=Ot.currentTarget;Math.abs(Kt.scrollHeight-Kt.clientHeight-Kt.scrollTop)<1&&(!((Rt=Be)===null||Rt===void 0)&&Rt.cursor)&&At({items:Be.items,cursor:Be.cursor})},"data-testid":"owner-picker-listbox"}})]})})};var ct=n(51837);const Oe=(0,ct.uW)("catalog:entity-route-ref",()=>(0,p.NT)({id:"catalog:entity",params:["namespace","kind","name"]}));function wt(y){var j,L;return{kind:y.kind.toLocaleLowerCase("en-US"),namespace:(L=(j=y.metadata.namespace)===null||j===void 0?void 0:j.toLocaleLowerCase("en-US"))!==null&&L!==void 0?L:DEFAULT_NAMESPACE,name:y.metadata.name}}var _t=n(80030);const jt=(0,F.forwardRef)((y,j)=>{var L;const{entityRef:P,defaultKind:ae,title:re,children:q,...he}=y,Ae=(0,p.tg)(Oe);let Le,ze,Ne;if(typeof P=="string"){const He=(0,I.of)(P);Le=He.kind,ze=He.namespace,Ne=He.name}else"metadata"in P?(Le=P.kind,ze=P.metadata.namespace,Ne=P.metadata.name):(Le=P.kind,ze=P.namespace,Ne=P.name);Le=Le.toLocaleLowerCase("en-US");var We;ze=(We=(L=ze)===null||L===void 0?void 0:L.toLocaleLowerCase("en-US"))!==null&&We!==void 0?We:I.zG;const it={kind:Le,namespace:ze,name:Ne},Et=an({kind:Le,namespace:ze,name:Ne},{defaultKind:ae}),Be=(0,h.jsxs)(R.rU,{...he,ref:j,to:Ae(it),children:[q,!q&&(re!=null?re:Et)]});return re?(0,h.jsx)(_t.ZP,{title:Et,children:Be}):Be});function Ft(y){const{entityRefs:j,defaultKind:L,getTitle:P,...ae}=y,re=(0,p.h_)(W),{value:q=new Array,loading:he,error:Ae}=(0,tt.default)(async()=>{const Le=j.reduce((Ne,We)=>typeof We=="object"&&"metadata"in We?Ne:[...Ne,(0,I.of)(We)],new Array),ze=j.filter(Ne=>typeof Ne=="object"&&"metadata"in Ne);return Le.length>0?[...(await re.getEntities({filter:Le.map(Ne=>({kind:Ne.kind,"metadata.namespace":Ne.namespace,"metadata.name":Ne.name}))})).items,...ze]:ze},[j]);return he?(0,h.jsx)(R.Ex,{}):Ae?(0,h.jsx)(R.yu,{error:Ae}):(0,h.jsx)(h.Fragment,{children:q.map((Le,ze)=>(0,h.jsxs)(F.Fragment,{children:[ze>0&&", ",(0,h.jsx)(jt,{...ae,defaultKind:L,entityRef:Le,title:P(Le)})]},ze))})}function qt(y){const{entityRefs:j,defaultKind:L,fetchEntities:P,getTitle:ae,...re}=y;return P?(0,h.jsx)(Ft,{...re,defaultKind:L,entityRefs:j,getTitle:ae}):(0,h.jsx)(h.Fragment,{children:j.map((q,he)=>(0,h.jsxs)(F.Fragment,{children:[he>0&&", ",(0,h.jsx)(jt,{...re,defaultKind:L,entityRef:q,title:ae?ae(q):void 0})]},he))})}const jn=y=>{const j=useRouteRef(entityRouteRef);return _jsx(IconButton,{component:Link,"aria-label":"Show",title:"Show details",to:j(getCompoundEntityRef(y.entity)),children:_jsx(InfoIcon,{})})},Bt=y=>_jsx(IconButton,{component:Link,"aria-label":"Email",title:`Email ${y.email}`,to:`mailto:${y.email}`,children:_jsx(EmailIcon,{})}),mt=y=>{var j;const L=(j=y.entity.spec.profile)===null||j===void 0?void 0:j.email;return L?_jsx(EmailCardAction,{email:L}):null},Lt=y=>{var j;const L=(j=y.entity.spec.profile)===null||j===void 0?void 0:j.email;return L?_jsx(EmailCardAction,{email:L}):null},Mt=(0,Jt.Z)(()=>({popoverPaper:{width:"30em"},descriptionTypography:{overflow:"hidden",textOverflow:"ellipsis",display:"-webkit-box",WebkitLineClamp:2,WebkitBoxOrient:"vertical"}})),en=4,pr=y=>{var j,L,P;const{entityRef:ae,children:re,delayTime:q=500}=y,he=Mt(),Ae=useApiHolder(),Le=usePopupState({variant:"popover",popupId:"entity-peek-ahead"}),[ze,Ne]=useState(!1),We=useMemo(()=>debounce(()=>Ne(!0),q),[q]),[{loading:it,error:Et,value:Be},He]=useAsyncFn(async()=>{const rn=Ae.get(catalogApiRef);if(rn){const En=await rn.getEntityByRef(ae);if(!En)throw new Error(`${ae} not found`);return En}},[Ae,ae]),At=()=>{Ne(!1),We.cancel()};return useEffect(()=>{Le.isOpen&&!Be&&!Et&&!it&&He()},[Le.isOpen,He,Be,Et,it]),_jsxs(_Fragment,{children:[_jsx(Typography,{component:"span",onMouseEnter:We,children:_jsx(Typography,{component:"span","data-testid":"trigger",...bindHover(Le),children:re})}),ze&&_jsx(HoverPopover,{PaperProps:{className:he.popoverPaper},...bindPopover(Le),anchorOrigin:{vertical:"bottom",horizontal:"center"},transformOrigin:{vertical:"top",horizontal:"center"},onMouseLeave:At,children:_jsxs(Card,{children:[_jsxs(CardContent,{children:[Et&&_jsx(ResponseErrorPanel,{error:Et}),it&&_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:he.descriptionTypography,paragraph:!0,children:Be.metadata.description}),_jsx(Typography,{children:(j=Be.spec)===null||j===void 0?void 0:j.type}),_jsxs(Box,{marginTop:"0.5em",children:[(Be.metadata.tags||[]).slice(0,en).map(rn=>_jsx(Chip,{size:"small",label:rn},rn)),((L=Be.metadata.tags)===null||L===void 0?void 0:L.length)&&((P=Be.metadata.tags)===null||P===void 0?void 0:P.length)>en&&_jsx(Tooltip,{title:"Drill into the entity to see all of the tags.",children:_jsx(Chip,{size:"small",label:"..."},"other-tags")})]})]})]}),!Et&&Be&&_jsx(CardActions,{children:_jsxs(_Fragment,{children:[isUserEntity(Be)&&_jsx(UserCardActions,{entity:Be}),isGroupEntity(Be)&&_jsx(GroupCardActions,{entity:Be}),_jsx(EntityCardActions,{entity:Be})]})})]})})]})},fr=(0,Jt.Z)(y=>({searchToolbar:{paddingLeft:0,paddingRight:0},input:{}}),{name:"CatalogReactEntitySearchBar"}),_n=()=>{var y;const j=fr(),{filters:L,updateFilters:P}=useEntityList();var ae;const[re,q]=useState((ae=(y=L.text)===null||y===void 0?void 0:y.value)!==null&&ae!==void 0?ae:"");return useDebounce(()=>{P({text:re.length?new EntityTextFilter(re):void 0})},250,[re,P]),_jsx(Toolbar,{className:j.searchToolbar,children:_jsx(FormControl,{children:_jsx(Input,{"aria-label":"search",id:"input-with-icon-adornment",className:j.input,placeholder:"Search",autoComplete:"off",onChange:he=>q(he.target.value),value:re,startAdornment:_jsx(InputAdornment,{position:"start",children:_jsx(Search,{})}),endAdornment:_jsx(InputAdornment,{position:"end",children:_jsx(IconButton,{"aria-label":"clear search",onClick:()=>q(""),edge:"end",disabled:re.length===0,children:_jsx(Clear,{})})})})})})},yn=Object.freeze({createEntityRefColumn(y){const{defaultKind:j}=y;function L(P){var ae;return((ae=P.metadata)===null||ae===void 0?void 0:ae.title)||an(P,{defaultKind:j})}return{title:"Name",highlight:!0,customFilterAndSearch(P,ae){return L(ae).includes(P)},customSort(P,ae){return L(P).localeCompare(L(ae))},render:P=>{var ae;return(0,h.jsx)(jt,{entityRef:P,defaultKind:j,title:(ae=P.metadata)===null||ae===void 0?void 0:ae.title})}}},createEntityRelationColumn(y){const{title:j,relation:L,defaultKind:P,filter:ae}=y;function re(he){return(0,U.hF)(he,L,ae)}function q(he){return re(he).map(Ae=>an(Ae,{defaultKind:P})).join(", ")}return{title:j,customFilterAndSearch(he,Ae){return q(Ae).includes(he)},customSort(he,Ae){return q(he).localeCompare(q(Ae))},render:he=>(0,h.jsx)(qt,{entityRefs:re(he),defaultKind:P})}},createOwnerColumn(){return this.createEntityRelationColumn({title:"Owner",relation:I.S4,defaultKind:"group"})},createDomainColumn(){return this.createEntityRelationColumn({title:"Domain",relation:I.cz,defaultKind:"domain",filter:{kind:"domain"}})},createSystemColumn(){return this.createEntityRelationColumn({title:"System",relation:I.cz,defaultKind:"system",filter:{kind:"system"}})},createMetadataDescriptionColumn(){return{title:"Description",field:"metadata.description",render:y=>(0,h.jsx)(R.Or,{text:y.metadata.description,placement:"bottom-start",line:2})}},createSpecLifecycleColumn(){return{title:"Lifecycle",field:"spec.lifecycle"}},createSpecTypeColumn(){return{title:"Type",field:"spec.type"}}}),Mn=[yn.createEntityRefColumn({defaultKind:"system"}),yn.createDomainColumn(),yn.createOwnerColumn(),yn.createMetadataDescriptionColumn()],gr=[yn.createEntityRefColumn({defaultKind:"component"}),yn.createSystemColumn(),yn.createOwnerColumn(),yn.createSpecTypeColumn(),yn.createSpecLifecycleColumn(),yn.createMetadataDescriptionColumn()],Nr=(0,Jt.Z)(y=>({empty:{padding:y.spacing(2),display:"flex",justifyContent:"center"}})),zn=y=>{const{entities:j,title:L,emptyContent:P,variant:ae="gridItem",columns:re,tableOptions:q={}}=y,he=Nr(),Ae={minWidth:"0",width:"100%"};return ae==="gridItem"&&(Ae.height="calc(100% - 10px)"),(0,h.jsx)(R.iA,{columns:re,title:L,style:Ae,emptyContent:P&&(0,h.jsx)("div",{className:he.empty,children:P}),options:{search:!1,paging:!1,actionsColumnIndex:-1,padding:"dense",draggable:!1,...q},data:j})};zn.columns=yn,zn.systemEntityColumns=Mn,zn.componentEntityColumns=gr;const Fr=(0,Jt.Z)({input:{}},{name:"CatalogReactEntityTagPicker"}),C=y=>{const j=Fr();return(0,h.jsx)(le,{label:"Tags",name:"tags",path:"metadata.tags",Filter:k,showCounts:y.showCounts,InputProps:{className:j.input}})},c=y=>{const{hidden:j,initialFilter:L}=y,P=(0,p.h_)(p.$v),{error:ae,availableTypes:re,selectedTypes:q,setSelectedTypes:he}=gt();if((0,F.useEffect)(()=>{ae&&P.post({message:"Failed to load entity types",severity:"error"}),L&&he([L])},[ae,P,L,he]),re.length===0||ae)return null;const Ae=[{value:"all",label:"all"},...re.map(ze=>({value:ze,label:ze}))];var Le;return j?null:(0,h.jsx)(D.Z,{pb:1,pt:1,children:(0,h.jsx)(R.Ph,{label:"Type",items:Ae,selected:(Le=Ae.length>1?q[0]:void 0)!==null&&Le!==void 0?Le:"all",onChange:ze=>he(ze==="all"?[]:[String(ze)])})})};var S=n(15459),E=n(61837),J=n(11640),ye=n(28347);const je=(0,S.Z)({root:{color:"#f3ba37"}})(J.Z),De=y=>{const{toggleStarredEntity:j,isStarredEntity:L}=hn(y.entity);return(0,h.jsx)(E.Z,{"aria-label":"favorite",color:"inherit",...y,onClick:()=>j(),children:(0,h.jsx)(_t.ZP,{title:L?"Remove from favorites":"Add to favorites",children:L?(0,h.jsx)(je,{}):(0,h.jsx)(ye.Z,{})})})};var et=n(8629),Gt=n(79249),xn=n(38724),qn=n(99152),mr=n(6487),jr=n(49429),bn=n(55999),Wr=n(39412);const lo=Wr.Z;function Co(y,j){if(y)return y.toLocaleLowerCase("en-US");if(j)try{return(0,I.of)(j).kind.toLocaleLowerCase("en-US")}catch{return}}function Ss(y,j){const L=(0,p.qD)(),P=Co(y,j);return P&&L.getSystemIcon(`kind:${P}`)||lo}function Vr(y){const{kind:j,entityRef:L,...P}=y,ae=Ss(j,L);return(0,h.jsx)(ae,{...P})}const Vo=(0,Jt.Z)(y=>({node:{fill:y.palette.grey[300],stroke:y.palette.grey[300],"&.primary":{fill:y.palette.primary.light,stroke:y.palette.primary.light},"&.secondary":{fill:y.palette.secondary.light,stroke:y.palette.secondary.light}},text:{fill:y.palette.getContrastText(y.palette.grey[300]),"&.primary":{fill:y.palette.primary.contrastText},"&.secondary":{fill:y.palette.secondary.contrastText},"&.focused":{fontWeight:"bold"}},clickable:{cursor:"pointer"}}));function Cs(y){var j,L;const P=(0,p.h_)(W),ae=(0,I.eE)(y),{loading:re,error:q,value:he}=(0,tt.default)(async()=>{const Ae=await P.getEntityAncestors({entityRef:ae}),Le=new Array,ze=new Array;for(const Ne of Ae.items){const We=(0,I.eE)(Ne.entity),it=We===Ae.rootEntityRef;Le.push({id:We,root:it,...Ne.entity});for(const Et of Ne.parentEntityRefs)ze.push({from:We,to:Et})}return{nodes:Le,edges:ze}},[ae]);return{loading:re,error:q,nodes:((j=he)===null||j===void 0?void 0:j.nodes)||[],edges:((L=he)===null||L===void 0?void 0:L.edges)||[]}}function Ho({node:y}){const j=Vo(),L=(0,Zt.s0)(),P=(0,p.tg)(Oe),[ae,re]=(0,F.useState)(0),[q,he]=(0,F.useState)(0),Ae=(0,F.useRef)(null);(0,F.useLayoutEffect)(()=>{if(Ae.current){let{height:He,width:At}=Ae.current.getBBox();He=Math.round(He),At=Math.round(At),(He!==q||At!==ae)&&(re(At),he(He))}},[ae,q]);const Le=10,ze=q,Ne=ze+Le,We=Ne+ae+Le*2,it=q+Le*2,Et=y.metadata.title||(y.kind&&y.metadata.name&&y.metadata.namespace?an({kind:y.kind,name:y.metadata.name,namespace:y.metadata.namespace||""}):y.id),Be=()=>{L(P({kind:y.kind,namespace:y.metadata.namespace||I.zG,name:y.metadata.name}))};return(0,h.jsxs)("g",{onClick:Be,className:j.clickable,children:[(0,h.jsx)("rect",{className:Re()(j.node,y.root?"secondary":"primary"),width:We,height:it,rx:10}),(0,h.jsx)(Vr,{kind:y.kind,y:Le,x:Le,width:ze,height:ze,className:Re()(j.text,y.root?"secondary":"primary")}),(0,h.jsx)("text",{ref:Ae,className:Re()(j.text,y.root?"secondary":"primary"),y:it/2,x:Ne+(ae+Le*2)/2,textAnchor:"middle",alignmentBaseline:"middle",children:Et})]})}function Go(y){const{loading:j,error:L,nodes:P,edges:ae}=Cs(y.entity);return j?(0,h.jsx)(R.Ex,{}):L?(0,h.jsx)(R.Gk,{error:L}):(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(bn.Z,{variant:"h2",children:"Ancestry"}),(0,h.jsxs)(bn.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,h.jsx)(R.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,h.jsx)(D.Z,{mt:4,children:(0,h.jsx)(R.mn,{nodes:P,edges:ae,renderNode:Ho,direction:R.NX.Direction.BOTTOM_TOP,zoom:"enable-on-click"})})]})}var Er=n(11776),lr=n(38402),Hr=n(86136),qr=n(99688),wo=n(49378),jo=n(54506),Zr=n(94339),Ko=n(24579),Eo=n(27685);const Nn=(0,Jt.Z)(y=>({root:{display:"flex",flexDirection:"column"},marginTop:{marginTop:y.spacing(2)},helpIcon:{marginLeft:y.spacing(1),color:y.palette.text.disabled},monospace:{fontFamily:"monospace"}}));function cr(y){const j=Nn();return(0,h.jsx)(wo.Z,{...y,primaryTypographyProps:{className:j.monospace},secondaryTypographyProps:{className:j.monospace}})}function Gr(y){const j=Nn();return(0,h.jsx)(jo.Z,{className:j.monospace,children:y.children})}function Kr(y){return(0,h.jsx)(D.Z,{mt:2,children:(0,h.jsx)(Zr.Z,{variant:"outlined",children:(0,h.jsxs)(Ko.Z,{children:[(0,h.jsxs)(A.Z,{variant:"h6",gutterBottom:!0,children:[y.title,y.helpLink&&(0,h.jsx)(Ao,{to:y.helpLink})]}),y.children]})})})}function Yo(y){if(y.match(/^url:https?:\/\//))return y.slice(4);if(y.match(/^https?:\/\//))return y}function vr(y){const[j,L]=y.entry,P=Yo(L);return(0,h.jsxs)(lr.Z,{children:[y.indent&&(0,h.jsx)(Hr.Z,{}),(0,h.jsx)(cr,{primary:j,secondary:P?(0,h.jsx)(R.rU,{to:P,children:L}):L})]})}function Ao(y){const j=Nn();return(0,h.jsx)(R.rU,{to:y.to,className:j.helpIcon,children:(0,h.jsx)(Eo.Z,{fontSize:"inherit"})})}const To=(0,Jt.Z)({root:{display:"flex",flexDirection:"column"}});function Ro(y){var j,L,P;const ae=(0,p.h_)(W),re=(0,I.eE)(y),q=(j=y.metadata.annotations)===null||j===void 0?void 0:j[I.P1],he=(L=y.metadata.annotations)===null||L===void 0?void 0:L[I.q1],{loading:Ae,error:Le,value:ze}=(0,tt.default)(async()=>!q&&!he?[]:(await ae.getEntities({filter:[...q?[{[`metadata.annotations.${I.P1}`]:q}]:[],...he?[{[`metadata.annotations.${I.q1}`]:he}]:[]]})).items,[q,he]);return{loading:Ae,error:Le,location:q,originLocation:he,colocatedEntities:(P=ze)===null||P===void 0?void 0:P.filter(Ne=>(0,I.eE)(Ne)!==re)}}function Ur(y){return(0,h.jsxs)(Er.Z,{dense:!0,children:[y.header&&(0,h.jsx)(vr,{entry:y.header},"header"),y.entities.map(j=>(0,h.jsxs)(lr.Z,{children:[(0,h.jsx)(Hr.Z,{children:(0,h.jsx)(Vr,{kind:j.kind})}),(0,h.jsx)(cr,{primary:(0,h.jsx)(jt,{entityRef:j})})]},(0,I.eE)(j)))]})}function Io(y){var j;const{entity:L}=y,{loading:P,error:ae,location:re,originLocation:q,colocatedEntities:he}=Ro(L);if(P)return(0,h.jsx)(R.Ex,{});if(ae)return(0,h.jsx)(R.Gk,{error:ae});if(!re&&!q)return(0,h.jsx)(qr.Z,{severity:"warning",children:"Entity had no location information."});if(!(!((j=he)===null||j===void 0)&&j.length))return(0,h.jsx)(qr.Z,{severity:"info",children:"There were no other entities on this location."});if(re===q)return(0,h.jsx)(Ur,{entities:he});const Ae=he.filter(ze=>{var Ne;return((Ne=ze.metadata.annotations)===null||Ne===void 0?void 0:Ne[I.P1])===re}),Le=he.filter(ze=>{var Ne;return((Ne=ze.metadata.annotations)===null||Ne===void 0?void 0:Ne[I.q1])===q});return(0,h.jsxs)(h.Fragment,{children:[Ae.length>0&&(0,h.jsx)(Ur,{entities:Ae,header:["At the same location",re]}),Le.length>0&&(0,h.jsx)(Ur,{entities:Le,header:["At the same origin",q]})]})}function Jo(y){const j=To();return(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(bn.Z,{variant:"h2",children:"Colocated"}),(0,h.jsx)(bn.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,h.jsx)("div",{className:j.root,children:(0,h.jsx)(Io,{entity:y.entity})})]})}function co(y){return Object.fromEntries([...Object.entries(y)].sort((j,L)=>j[0]<L[0]?-1:1))}function Po(y){return(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(bn.Z,{variant:"h2",children:"Entity as JSON"}),(0,h.jsx)(bn.Z,{children:"This is the raw entity data as received from the catalog, on JSON form."}),(0,h.jsx)(bn.Z,{children:(0,h.jsx)("div",{style:{fontSize:"75%"},"data-testid":"code-snippet",children:(0,h.jsx)(R.Oi,{text:JSON.stringify(co(y.entity),void 0,2),language:"json",showCopyCodeButton:!0})})})]})}var ws=n(3440),Lo=n.n(ws);const dr=(0,Jt.Z)({root:{display:"flex",flexDirection:"column"}});function ci(y){var j,L,P;const ae=dr(),{apiVersion:re,kind:q,metadata:he,spec:Ae,relations:Le=[],status:ze={}}=y.entity,Ne=Lo()(ft()(Le,We=>We.targetRef),"type");return(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(bn.Z,{variant:"h2",children:"Overview"}),(0,h.jsxs)("div",{className:ae.root,children:[(0,h.jsx)(Kr,{title:"Identity",children:(0,h.jsxs)(Er.Z,{dense:!0,children:[(0,h.jsx)(lr.Z,{children:(0,h.jsx)(cr,{primary:"apiVersion",secondary:re})}),(0,h.jsx)(lr.Z,{children:(0,h.jsx)(cr,{primary:"kind",secondary:q})}),((j=Ae)===null||j===void 0?void 0:j.type)&&(0,h.jsx)(lr.Z,{children:(0,h.jsx)(cr,{primary:"spec.type",secondary:Ae.type})}),he.uid&&(0,h.jsx)(lr.Z,{children:(0,h.jsx)(cr,{primary:"uid",secondary:he.uid})}),he.etag&&(0,h.jsx)(lr.Z,{children:(0,h.jsx)(cr,{primary:"etag",secondary:he.etag})})]})}),(0,h.jsxs)(Kr,{title:"Metadata",children:[!!Object.keys(he.annotations||{}).length&&(0,h.jsx)(Er.Z,{dense:!0,subheader:(0,h.jsxs)(Gr,{children:["Annotations",(0,h.jsx)(Ao,{to:"https://backstage.io/docs/features/software-catalog/well-known-annotations"})]}),children:Object.entries(he.annotations).map(We=>(0,h.jsx)(vr,{indent:!0,entry:We},We[0]))}),!!Object.keys(he.labels||{}).length&&(0,h.jsx)(Er.Z,{dense:!0,subheader:(0,h.jsx)(Gr,{children:"Labels"}),children:Object.entries(he.labels).map(We=>(0,h.jsx)(vr,{indent:!0,entry:We},We[0]))}),!!(!((L=he.tags)===null||L===void 0)&&L.length)&&(0,h.jsx)(Er.Z,{dense:!0,subheader:(0,h.jsx)(Gr,{children:"Tags"}),children:he.tags.map((We,it)=>(0,h.jsxs)(lr.Z,{children:[(0,h.jsx)(Hr.Z,{}),(0,h.jsx)(cr,{primary:We})]},`${We}-${it}`))})]}),!!Le.length&&(0,h.jsx)(Kr,{title:"Relations",helpLink:"https://backstage.io/docs/features/software-catalog/well-known-relations",children:Object.entries(Ne).map(([We,it],Et)=>(0,h.jsx)("div",{children:(0,h.jsx)(Er.Z,{dense:!0,subheader:(0,h.jsx)(Gr,{children:We}),children:it.map(Be=>(0,h.jsxs)(lr.Z,{children:[(0,h.jsx)(Hr.Z,{children:(0,h.jsx)(Vr,{entityRef:Be.targetRef})}),(0,h.jsx)(cr,{primary:(0,h.jsx)(jt,{entityRef:Be.targetRef})})]},Be.targetRef))})},Et))}),!!(!((P=ze.items)===null||P===void 0)&&P.length)&&(0,h.jsx)(Kr,{title:"Status",helpLink:"https://backstage.io/docs/features/software-catalog/well-known-statuses",children:ze.items.map((We,it)=>(0,h.jsxs)("div",{children:[(0,h.jsxs)(A.Z,{children:[We.level,": ",We.type]}),(0,h.jsx)(D.Z,{ml:2,children:We.message})]},it))})]})]})}var Qo=n(72847);function js(y){return(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(bn.Z,{variant:"h2",children:"Entity as YAML"}),(0,h.jsx)(bn.Z,{children:"This is the raw entity data as received from the catalog, on YAML form."}),(0,h.jsx)(bn.Z,{children:(0,h.jsx)("div",{style:{fontSize:"75%"},"data-testid":"code-snippet",children:(0,h.jsx)(R.Oi,{text:Qo.ZP.stringify(co(y.entity)),language:"yaml",showCopyCodeButton:!0})})})]})}const uo=(0,Jt.Z)(y=>({fullHeightDialog:{height:"calc(100% - 64px)"},root:{display:"flex",flexGrow:1,width:"100%",backgroundColor:y.palette.background.paper},tabs:{borderRight:`1px solid ${y.palette.divider}`,flexShrink:0},tabContents:{flexGrow:1,overflowX:"auto"}}));function eo(y){const{children:j,value:L,index:P,...ae}=y,re=uo();return(0,h.jsx)("div",{role:"tabpanel",hidden:L!==P,id:`vertical-tabpanel-${P}`,"aria-labelledby":`vertical-tab-${P}`,className:re.tabContents,...ae,children:L===P&&(0,h.jsx)(D.Z,{pl:3,pr:3,children:j})})}function to(y){return{id:`vertical-tab-${y}`,"aria-controls":`vertical-tabpanel-${y}`}}function no(y){const j=uo(),[L,P]=F.useState(0);return(0,F.useEffect)(()=>{P(0)},[y.open]),y.entity?(0,h.jsxs)(et.Z,{fullWidth:!0,maxWidth:"xl",open:y.open,onClose:y.onClose,"aria-labelledby":"entity-inspector-dialog-title",PaperProps:{className:j.fullHeightDialog},children:[(0,h.jsx)(Gt.Z,{id:"entity-inspector-dialog-title",children:"Entity Inspector"}),(0,h.jsx)(xn.Z,{dividers:!0,children:(0,h.jsxs)("div",{className:j.root,children:[(0,h.jsxs)(qn.Z,{orientation:"vertical",variant:"scrollable",value:L,onChange:(ae,re)=>P(re),"aria-label":"Inspector options",className:j.tabs,children:[(0,h.jsx)(mr.Z,{label:"Overview",...to(0)}),(0,h.jsx)(mr.Z,{label:"Ancestry",...to(1)}),(0,h.jsx)(mr.Z,{label:"Colocated",...to(2)}),(0,h.jsx)(mr.Z,{label:"Raw JSON",...to(3)}),(0,h.jsx)(mr.Z,{label:"Raw YAML",...to(4)})]}),(0,h.jsx)(eo,{value:L,index:0,children:(0,h.jsx)(ci,{entity:y.entity})}),(0,h.jsx)(eo,{value:L,index:1,children:(0,h.jsx)(Go,{entity:y.entity})}),(0,h.jsx)(eo,{value:L,index:2,children:(0,h.jsx)(Jo,{entity:y.entity})}),(0,h.jsx)(eo,{value:L,index:3,children:(0,h.jsx)(Po,{entity:y.entity})}),(0,h.jsx)(eo,{value:L,index:4,children:(0,h.jsx)(js,{entity:y.entity})})]})}),(0,h.jsx)(jr.Z,{children:(0,h.jsx)(z.Z,{onClick:y.onClose,color:"primary",children:"Close"})})]}):null}var Ar=n(85256);function er(y){var j;const L=(0,p.h_)(W),P=(j=y.metadata.annotations)===null||j===void 0?void 0:j[I.q1],ae=y.metadata.uid,re=P==="bootstrap:bootstrap",q=(0,tt.default)(async()=>{const Et=L.getLocationByRef(P);let Be;if(!P)Be=Promise.resolve([]);else{const He=`metadata.annotations.${I.q1}`;Be=L.getEntities({filter:{[He]:P},fields:["kind","metadata.uid","metadata.name","metadata.namespace"]}).then(At=>At.items)}return Promise.all([Et,Be]).then(([He,At])=>({location:He,colocatedEntities:At}))},[L,y]),he=(0,F.useCallback)(async function(){const{location:Be}=q.value;await L.removeLocationById(Be.id)},[L,q]),Ae=(0,F.useCallback)(async function(){await L.removeEntityByUid(ae)},[L,ae]);if(re)return{type:"bootstrap",location:P,deleteEntity:Ae};const{loading:Le,error:ze,value:Ne}=q;if(Le)return{type:"loading"};if(ze)return{type:"error",error:ze};const{location:We,colocatedEntities:it}=Ne;return We?{type:"unregister",location:P,colocatedEntities:it.map(I.iB),unregisterLocation:he,deleteEntity:Ae}:{type:"only-delete",deleteEntity:Ae}}var ho=n(23054);const Xo=(0,Jt.Z)({advancedButton:{fontSize:"0.7em"},dialogActions:{display:"inline-block"}}),Es=({entity:y,onConfirm:j,onClose:L})=>{const P=(0,p.h_)(p.$v),ae=(0,p.h_)(p.Ds),re=Xo(),q=er(y),[he,Ae]=(0,F.useState)(!1),[Le,ze]=(0,F.useState)(!1);var Ne;const We=(Ne=ae.getOptionalString("app.title"))!==null&&Ne!==void 0?Ne:"Backstage",it=(0,F.useCallback)(async function(){if("unregisterLocation"in q){ze(!0);try{await q.unregisterLocation(),j()}catch(At){(0,ho.BD)(At),P.post({message:At.message})}finally{ze(!1)}}},[P,j,q]),Et=(0,F.useCallback)(async function(){if("deleteEntity"in q){ze(!0);try{await q.deleteEntity(),j()}catch(At){(0,ho.BD)(At),P.post({message:At.message})}finally{ze(!1)}}},[P,j,q]),Be=()=>(0,h.jsx)(jr.Z,{className:re.dialogActions,children:(0,h.jsx)(z.Z,{onClick:L,color:"primary",children:"Cancel"})});return q.type==="loading"?(0,h.jsx)(R.Ex,{}):q.type==="error"?(0,h.jsx)(R.Gk,{error:q.error}):q.type==="bootstrap"?(0,h.jsxs)(h.Fragment,{children:[(0,h.jsxs)(qr.Z,{severity:"info",children:['You cannot unregister this entity, since it originates from a protected Backstage configuration (location "',q.location,'"). If you believe this is in error, please contact the ',We," ","integrator."]}),(0,h.jsxs)(D.Z,{marginTop:2,children:[!he&&(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(z.Z,{variant:"text",size:"small",color:"primary",className:re.advancedButton,onClick:()=>Ae(!0),children:"Advanced Options"}),(0,h.jsx)(Be,{})]}),he&&(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(bn.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,h.jsx)(z.Z,{variant:"contained",color:"secondary",disabled:Le,onClick:Et,children:"Delete Entity"}),(0,h.jsx)(Be,{})]})]})]}):q.type==="only-delete"?(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(bn.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,h.jsx)(z.Z,{variant:"contained",color:"secondary",disabled:Le,onClick:Et,children:"Delete Entity"}),(0,h.jsx)(Be,{})]}):q.type==="unregister"?(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(bn.Z,{children:"This action will unregister the following entities:"}),(0,h.jsx)(bn.Z,{component:"ul",children:q.colocatedEntities.map(He=>(0,h.jsx)("li",{children:(0,h.jsx)(jt,{entityRef:He})},`${He.kind}:${He.namespace}/${He.name}`))}),(0,h.jsx)(bn.Z,{children:"Located at the following location:"}),(0,h.jsx)(bn.Z,{component:"ul",children:(0,h.jsx)("li",{children:q.location})}),(0,h.jsxs)(bn.Z,{children:["To undo, just re-register the entity in ",We,"."]}),(0,h.jsxs)(D.Z,{marginTop:2,children:[(0,h.jsx)(z.Z,{variant:"contained",color:"secondary",disabled:Le,onClick:it,children:"Unregister Location"}),!he&&(0,h.jsx)(D.Z,{component:"span",marginLeft:2,children:(0,h.jsx)(z.Z,{variant:"text",size:"small",color:"primary",className:re.advancedButton,onClick:()=>Ae(!0),children:"Advanced Options"})})]}),he&&(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(D.Z,{paddingTop:4,paddingBottom:4,children:(0,h.jsx)(Ar.Z,{})}),(0,h.jsx)(bn.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,h.jsx)(z.Z,{variant:"contained",color:"secondary",disabled:Le,onClick:Et,children:"Delete Entity"})]})]}):(0,h.jsx)(qr.Z,{severity:"error",children:"Internal error: Unknown state"})},ro=y=>{const{open:j,onConfirm:L,onClose:P,entity:ae}=y;return(0,h.jsxs)(et.Z,{open:j,onClose:P,children:[(0,h.jsx)(Gt.Z,{id:"responsive-dialog-title",children:"Are you sure you want to unregister this entity?"}),(0,h.jsx)(xn.Z,{children:(0,h.jsx)(Es,{entity:ae,onConfirm:L,onClose:P})})]})};var _o=n(12231),As=n(9520),qo=n(47603);const es=(0,Jt.Z)(y=>({root:{backgroundColor:"rgba(0, 0, 0, .11)",boxShadow:"none",margin:y.spacing(1,0,1,0)},title:{margin:y.spacing(1,0,0,1),textTransform:"uppercase",fontSize:12,fontWeight:"bold"},listIcon:{minWidth:30,color:y.palette.text.primary},menuItem:{minHeight:y.spacing(6)},groupWrapper:{margin:y.spacing(1,1,2,1)}}),{name:"CatalogReactUserListPicker"});function po(y){return[{name:"Personal",items:[{id:"owned",label:"Owned",icon:qo.Z},{id:"starred",label:"Starred",icon:J.Z}]},{name:y!=null?y:"Company",items:[{id:"all",label:"All"}]}]}const Oo=y=>{const{initialFilter:j,availableFilters:L}=y,P=es(),ae=(0,p.h_)(p.Ds);var re;const q=(re=ae.getOptionalString("organization.name"))!==null&&re!==void 0?re:"Company",{filters:he,updateFilters:Ae,backendEntities:Le,queryParameters:{kind:ze,user:Ne},loading:We}=rt(),it=["starred","all"],Et=po(q).map(Wn=>({...Wn,items:Wn.items.filter(({id:fn})=>["group","user"].some(kn=>kn===ze)?it.includes(fn):!L||L.includes(fn))})).filter(({items:Wn})=>!!Wn.length),{isStarredEntity:Be}=ln(),{isOwnedEntity:He,loading:At}=Cn(),rn=We||At,En=(0,F.useMemo)(()=>new Tt("owned",He,Be),[He,Be]),Ot=(0,F.useMemo)(()=>new Tt("starred",He,Be),[He,Be]),Rt=(0,F.useMemo)(()=>[Ne].flat()[0],[Ne]),[Kt,An]=(0,F.useState)(Rt!=null?Rt:j),ur=(0,F.useMemo)(()=>Le.filter((0,U.Gz)((0,ut.compact)(Object.values({...he,user:void 0})))),[he,Le]),Tr=(0,F.useMemo)(()=>({all:ur.length,starred:ur.filter(Wn=>Ot.filterEntity(Wn)).length,owned:ur.filter(Wn=>En.filterEntity(Wn)).length}),[ur,Ot,En]);(0,F.useEffect)(()=>{Rt&&An(Rt)},[Rt]),(0,F.useEffect)(()=>{!rn&&Kt&&Kt!=="all"&&Tr[Kt]===0&&An("all")},[rn,Tr,Kt,An]),(0,F.useEffect)(()=>{Ae({user:Kt?new Tt(Kt,He,Be):void 0})},[Kt,He,Be,Ae]);var Yr;return(0,h.jsx)(Zr.Z,{className:P.root,children:Et.map(Wn=>(0,h.jsxs)(F.Fragment,{children:[(0,h.jsx)(A.Z,{variant:"subtitle2",component:"span",className:P.title,children:Wn.name}),(0,h.jsx)(Zr.Z,{className:P.groupWrapper,children:(0,h.jsx)(Er.Z,{disablePadding:!0,dense:!0,role:"menu","aria-label":Wn.name,children:Wn.items.map(fn=>{var kn;return(0,h.jsxs)(_o.Z,{role:"none presentation",button:!0,divider:!0,onClick:()=>An(fn.id),selected:fn.id===((kn=he.user)===null||kn===void 0?void 0:kn.value),className:P.menuItem,disabled:Tr[fn.id]===0,"data-testid":`user-picker-${fn.id}`,tabIndex:0,ContainerProps:{role:"menuitem"},children:[fn.icon&&(0,h.jsx)(Hr.Z,{className:P.listIcon,children:(0,h.jsx)(fn.icon,{fontSize:"small"})}),(0,h.jsx)(wo.Z,{children:(0,h.jsxs)(A.Z,{variant:"body1",children:[fn.label," "]})}),(0,h.jsx)(As.Z,{children:(Yr=Tr[fn.id])!==null&&Yr!==void 0?Yr:"-"})]},fn.id)})})})]},Wn.name))})},fo=(0,Jt.Z)({input:{}},{name:"CatalogReactEntityProcessingStatusPickerPicker"}),Ts=(0,h.jsx)(Rn.Z,{fontSize:"small"}),di=(0,h.jsx)(Dn.Z,{fontSize:"small"}),ts=()=>{const y=fo(),{updateFilters:j}=rt(),[L,P]=(0,F.useState)([]);function ae(he){j({orphan:he?new Nt(he):void 0})}function re(he){j({error:he?new Yt(he):void 0})}const q=["Is Orphan","Has Error"];return(0,h.jsx)(D.Z,{pb:1,pt:1,children:(0,h.jsxs)(A.Z,{variant:"button",component:"label",children:["Processing Status",(0,h.jsx)(Ye.ZP,{multiple:!0,disableCloseOnSelect:!0,options:q,value:L,onChange:(he,Ae)=>{P(Ae),ae(Ae.includes("Is Orphan")),re(Ae.includes("Has Error"))},renderOption:(he,{selected:Ae})=>(0,h.jsx)(sn.Z,{control:(0,h.jsx)(Tn.Z,{icon:Ts,checkedIcon:di,checked:Ae}),onClick:Le=>Le.preventDefault(),label:he}),size:"small",popupIcon:(0,h.jsx)(Wt.Z,{"data-testid":"processing-status-picker-expand"}),renderInput:he=>(0,h.jsx)(we.Z,{...he,className:y.input,variant:"outlined"})})]})})},ns=(0,Jt.Z)({input:{}},{name:"CatalogReactEntityNamespacePicker"}),cn=()=>{const y=ns();return(0,h.jsx)(le,{label:"Namespace",name:"namespace",path:"metadata.namespace",Filter:Ut,InputProps:{className:y.input}})};function Rs(y){var j;const{children:L,value:P}=y;var ae;const[re,q]=useState((ae=(j=P)===null||j===void 0?void 0:j.filters)!==null&&ae!==void 0?ae:{}),he=useCallback(Be=>{q(He=>{const At=typeof Be=="function"?Be(He):Be;return{...He,...At}})},[]),Ae=useMemo(()=>({entities:[],backendEntities:[],queryParameters:{}}),[]);var Le,ze,Ne,We,it;const Et=useMemo(()=>{var Be,He,At,rn,En,Ot;return{entities:(Le=(Be=P)===null||Be===void 0?void 0:Be.entities)!==null&&Le!==void 0?Le:Ae.entities,backendEntities:(ze=(He=P)===null||He===void 0?void 0:He.backendEntities)!==null&&ze!==void 0?ze:Ae.backendEntities,updateFilters:(Ne=(At=P)===null||At===void 0?void 0:At.updateFilters)!==null&&Ne!==void 0?Ne:he,filters:re,loading:(We=(rn=P)===null||rn===void 0?void 0:rn.loading)!==null&&We!==void 0?We:!1,queryParameters:(it=(En=P)===null||En===void 0?void 0:En.queryParameters)!==null&&it!==void 0?it:Ae.queryParameters,error:(Ot=P)===null||Ot===void 0?void 0:Ot.error}},[P,Ae,re,he]);return _jsx(EntityListContext.Provider,{value:Et,children:L})}},75435:function(It,Pe,n){"use strict";n.d(Pe,{h:function(){return p}});var r=n(25271);function p(W,f,V){var m,h,F;let ve=((h=W)===null||h===void 0||(m=h.relations)===null||m===void 0?void 0:m.filter(ce=>ce.type===f).map(ce=>(0,r.of)(ce.targetRef)))||[];return!((F=V)===null||F===void 0)&&F.kind&&(ve=ve.filter(ce=>ce.kind.toLocaleLowerCase("en-US")===V.kind.toLocaleLowerCase("en-US"))),ve}},49280:function(It,Pe,n){"use strict";n.d(Pe,{hF:function(){return W.h},CV:function(){return V},wq:function(){return r},Gz:function(){return p}});function r(h){return h.reduce((F,ve)=>({...F,...ve.getCatalogFilters?ve.getCatalogFilters():{}}),{})}function p(h){return F=>h.every(ve=>!ve.filterEntity||ve.filterEntity(F))}var W=n(75435),f=n(25271);function V(h,F){var ve;const ce=(ve=h.metadata.annotations)===null||ve===void 0?void 0:ve[f.M6];if(ce)try{var z;const de=(0,f.Ou)(ce),D=F.byUrl(de.target);return{locationTargetUrl:de.target,integrationType:(z=D)===null||z===void 0?void 0:z.type}}catch{return}}function m(h,F){const ve=new Set([...getEntityRelations(h,RELATION_MEMBER_OF,{kind:"group"}),...h?[getCompoundEntityRef(h)]:[]].map(stringifyEntityRef)),ce=getEntityRelations(F,RELATION_OWNED_BY).map(stringifyEntityRef);for(const z of ce)if(ve.has(z))return!0;return!1}},8799:function(It,Pe,n){"use strict";n.r(Pe),n.d(Pe,{AboutCard:function(){return Yt},AboutContent:function(){return Tt},AboutField:function(){return Ge}});var r=n(52322),p=n(25271),W=n(53974),f=n(60871),V=n(32838),m=n(39709),h=JSON.parse('{"$schema":"http://json-schema.org/draft-07/schema","$id":"TemplateV1beta3","description":"A Template describes a scaffolding task for use with the Scaffolder. It describes the required parameters as well as a series of steps that will be taken to execute the scaffolding task.","examples":[{"apiVersion":"scaffolder.backstage.io/v1beta3","kind":"Template","metadata":{"name":"react-ssr-template","title":"React SSR Template","description":"Next.js application skeleton for creating isomorphic web applications.","tags":["recommended","react"]},"spec":{"owner":"artist-relations-team","parameters":{"required":["name","description","repoUrl"],"backstage:permissions":{"tags":["one","two"]},"properties":{"name":{"title":"Name","type":"string","description":"Unique name of the component"},"description":{"title":"Description","type":"string","description":"Description of the component"},"repoUrl":{"title":"Pick a repository","type":"string","ui:field":"RepoUrlPicker"}}},"steps":[{"id":"fetch","name":"Fetch","action":"fetch:plain","parameters":{"url":"./template"},"backstage:permissions":{"tags":["one","two"]}},{"id":"publish","name":"Publish to GitHub","action":"publish:github","parameters":{"repoUrl":"${{ parameters.repoUrl }}"},"if":"${{ parameters.repoUrl }}"}],"output":{"catalogInfoUrl":"${{ steps.publish.output.catalogInfoUrl }}"}}}],"allOf":[{"$ref":"Entity"},{"type":"object","required":["spec"],"properties":{"apiVersion":{"enum":["scaffolder.backstage.io/v1beta3"]},"kind":{"enum":["Template"]},"spec":{"type":"object","required":["type","steps"],"properties":{"type":{"type":"string","description":"The type of component created by the template. The software catalog accepts any type value, but an organization should take great care to establish a proper taxonomy for these. Tools including Backstage itself may read this field and behave differently depending on its value. For example, a website type component may present tooling in the Backstage interface that is specific to just websites.","examples":["service","website","library"],"minLength":1},"owner":{"type":"string","description":"The user (or group) owner of the template","minLength":1},"parameters":{"oneOf":[{"type":"object","description":"The JSONSchema describing the inputs for the template.","properties":{"backstage:permissions":{"type":"object","description":"Object used for authorizing the parameter","properties":{"tags":{"type":"array","items":{"type":"string"}}}}}},{"type":"array","description":"A list of separate forms to collect parameters.","items":{"type":"object","description":"The JSONSchema describing the inputs for the template.","properties":{"backstage:permissions":{"type":"object","description":"Object used for authorizing the parameter","properties":{"tags":{"type":"array","items":{"type":"string"}}}}}}}]},"steps":{"type":"array","description":"A list of steps to execute.","items":{"type":"object","description":"A description of the step to execute.","required":["action"],"properties":{"id":{"type":"string","description":"The ID of the step, which can be used to refer to its outputs."},"name":{"type":"string","description":"The name of the step, which will be displayed in the UI during the scaffolding process."},"action":{"type":"string","description":"The name of the action to execute."},"input":{"type":"object","description":"A templated object describing the inputs to the action."},"if":{"type":["string","boolean"],"description":"A templated condition that skips the step when evaluated to false. If the condition is true or not defined, the step is executed. The condition is true, if the input is not `false`, `undefined`, `null`, `\\"\\"`, `0`, or `[]`."},"backstage:permissions":{"type":"object","description":"Object used for authorizing the step","properties":{"tags":{"type":"array","items":{"type":"string"}}}}}}},"output":{"type":"object","description":"A templated object describing the outputs of the scaffolding task.","properties":{"links":{"type":"array","description":"A list of external hyperlinks, typically pointing to resources created or updated by the template","items":{"type":"object","required":[],"properties":{"url":{"type":"string","description":"A url in a standard uri format.","examples":["https://github.com/my-org/my-new-repo"],"minLength":1},"entityRef":{"type":"string","description":"An entity reference to an entity in the catalog.","examples":["Component:default/my-app"],"minLength":1},"title":{"type":"string","description":"A user friendly display name for the link.","examples":["View new repo"],"minLength":1},"icon":{"type":"string","description":"A key representing a visual icon to be displayed in the UI.","examples":["dashboard"],"minLength":1}}}},"text":{"type":"array","description":"A list of Markdown text blobs, like output data from the template.","items":{"type":"object","required":[],"properties":{"title":{"type":"string","description":"A user friendly display name for the text.","examples":["Output Content"],"minLength":1},"icon":{"type":"string","description":"A key representing a visual icon to be displayed in the UI.","examples":["dashboard"],"minLength":1},"content":{"type":"string","description":"The text blob to display in the UI, rendered as Markdown.","examples":["**hey** _I\'m_ Markdown"]}}}}},"additionalProperties":{"type":"string"}}}}}}]}');const F=(0,p.wI)(h),ve={async check(dt){return F(dt)===dt}},ce=dt=>dt.apiVersion==="scaffolder.backstage.io/v1beta3"&&dt.kind==="Template";var z=n(79692),de=n(94339),D=n(32552),A=n(61837),se=n(85256),ie=n(24579),ee=n(88188),X=n(52866),K=n(30254),R=n(27604),w=n(2784),I=n(19625),U=n(60905),xe=n(7089),Se=n(90436);const k=(0,z.Z)(dt=>({value:{fontWeight:"bold",overflow:"hidden",lineHeight:"24px",wordBreak:"break-word"},label:{color:dt.palette.text.secondary,textTransform:"uppercase",fontSize:"10px",fontWeight:"bold",letterSpacing:.5,overflow:"hidden",whiteSpace:"nowrap"}}));function Ge(dt){const{label:ut,value:St,gridSizes:lt,children:Zt}=dt,Ht=k(),Ce=(0,f.vJ)(Zt,Ke=>Ke.getElements()),$e=Ce.length>0?Ce:(0,r.jsx)(Se.Z,{variant:"body2",className:Ht.value,children:St||"unknown"});return(0,r.jsxs)(U.Z,{item:!0,...lt,children:[(0,r.jsx)(Se.Z,{variant:"h2",className:Ht.label,children:ut}),$e]})}var xt=n(24851);const Dt=(0,z.Z)({description:{wordBreak:"break-word"}});function Ut(dt,ut,St){if(ut==="url"||dt.includes("://"))return dt;const lt=St.type==="file"?`file://${St.target}`:St.target;return ut==="file"||St.type==="file"?new URL(dt,lt).href:lt}function Tt(dt){var ut,St,lt,Zt,Ht,Ce,$e,Ke,ht,rt,tt,vt,ot,Qe,ft,gt;const{entity:Ct}=dt,mn=Dt(),un=Ct.kind.toLocaleLowerCase("en-US")==="system",ln=Ct.kind.toLocaleLowerCase("en-US")==="resource",Sn=Ct.kind.toLocaleLowerCase("en-US")==="component",hn=Ct.kind.toLocaleLowerCase("en-US")==="api",vn=Ct.kind.toLocaleLowerCase("en-US")==="template",Cn=Ct.kind.toLocaleLowerCase("en-US")==="location",on=Ct.kind.toLocaleLowerCase("en-US")==="group",pn=(0,m.hF)(Ct,p.cz,{kind:"system"}),wn=(0,m.hF)(Ct,p.cz,{kind:"component"}),_e=(0,m.hF)(Ct,p.cz,{kind:"domain"}),Jt=(0,m.hF)(Ct,p.S4);let Wt;try{Wt=(0,p.CV)(Ct)}catch{Wt=void 0}return(0,r.jsxs)(U.Z,{container:!0,children:[(0,r.jsx)(Ge,{label:"Description",gridSizes:{xs:12},children:(0,r.jsx)(W.SA,{className:mn.description,content:((St=Ct)===null||St===void 0||(ut=St.metadata)===null||ut===void 0?void 0:ut.description)||"No description"})}),(0,r.jsx)(Ge,{label:"Owner",value:"No Owner",gridSizes:{xs:12,sm:6,lg:4},children:Jt.length>0&&(0,r.jsx)(m.rI,{entityRefs:Jt,defaultKind:"group"})}),(un||_e.length>0)&&(0,r.jsx)(Ge,{label:"Domain",value:"No Domain",gridSizes:{xs:12,sm:6,lg:4},children:_e.length>0&&(0,r.jsx)(m.rI,{entityRefs:_e,defaultKind:"domain"})}),(hn||Sn||ln||pn.length>0)&&(0,r.jsx)(Ge,{label:"System",value:"No System",gridSizes:{xs:12,sm:6,lg:4},children:pn.length>0&&(0,r.jsx)(m.rI,{entityRefs:pn,defaultKind:"system"})}),Sn&&wn.length>0&&(0,r.jsx)(Ge,{label:"Parent Component",value:"No Parent Component",gridSizes:{xs:12,sm:6,lg:4},children:(0,r.jsx)(m.rI,{entityRefs:wn,defaultKind:"component"})}),(hn||Sn||ln||vn||on||Cn||typeof((Zt=Ct)===null||Zt===void 0||(lt=Zt.spec)===null||lt===void 0?void 0:lt.type)=="string")&&(0,r.jsx)(Ge,{label:"Type",value:(Ce=Ct)===null||Ce===void 0||(Ht=Ce.spec)===null||Ht===void 0?void 0:Ht.type,gridSizes:{xs:12,sm:6,lg:4}}),(hn||Sn||typeof((Ke=Ct)===null||Ke===void 0||($e=Ke.spec)===null||$e===void 0?void 0:$e.lifecycle)=="string")&&(0,r.jsx)(Ge,{label:"Lifecycle",value:(rt=Ct)===null||rt===void 0||(ht=rt.spec)===null||ht===void 0?void 0:ht.lifecycle,gridSizes:{xs:12,sm:6,lg:4}}),(0,r.jsx)(Ge,{label:"Tags",value:"No Tags",gridSizes:{xs:12,sm:6,lg:4},children:(((vt=Ct)===null||vt===void 0||(tt=vt.metadata)===null||tt===void 0?void 0:tt.tags)||[]).map(Ye=>(0,r.jsx)(xe.Z,{size:"small",label:Ye},Ye))}),Cn&&(((Qe=Ct)===null||Qe===void 0||(ot=Qe.spec)===null||ot===void 0?void 0:ot.targets)||((gt=Ct)===null||gt===void 0||(ft=gt.spec)===null||ft===void 0?void 0:ft.target))&&(0,r.jsx)(Ge,{label:"Targets",gridSizes:{xs:12},children:(0,r.jsx)(xt.s,{cols:1,items:(Ct.spec.targets||[Ct.spec.target]).map(Ye=>Ye).map(Ye=>{var Tn,sn;return{text:Ye,href:Ut(Ye,((sn=Ct)===null||sn===void 0||(Tn=sn.spec)===null||Tn===void 0?void 0:Tn.type)||"unknown",Wt)}})})})]})}const Nt=(0,z.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 Yt(dt){var ut,St,lt,Zt,Ht,Ce,$e;const{variant:Ke}=dt,ht=(0,f.qD)(),rt=Nt(),{entity:tt}=(0,m.X2)(),vt=(0,f.h_)(V.q3),ot=(0,f.h_)(m.Ah),Qe=(0,f.h_)(f.$v),ft=(0,f.h_)(f.VE),gt=(0,f.tg)(I.jU),Ct=(0,f.tg)(I.ql),mn=(0,m.CV)(tt,vt),un=(ut=tt.metadata.annotations)===null||ut===void 0?void 0:ut[p.Tf],ln={label:"View Source",disabled:!mn,icon:(0,r.jsx)(V.nW,{type:(St=mn)===null||St===void 0?void 0:St.integrationType}),href:(lt=mn)===null||lt===void 0?void 0:lt.locationTargetUrl},Sn={label:"View TechDocs",disabled:!(!((Zt=tt.metadata.annotations)===null||Zt===void 0)&&Zt["backstage.io/techdocs-ref"])||!gt,icon:(0,r.jsx)(K.Z,{}),href:gt&>({namespace:tt.metadata.namespace||p.zG,kind:tt.kind,name:tt.metadata.name})},hn=[ln,Sn];if(ce(tt)){var vn;const Jt=(vn=ht.getSystemIcon("scaffolder"))!==null&&vn!==void 0?vn:ee.Z,Wt={label:"Launch Template",icon:(0,r.jsx)(Jt,{}),disabled:!Ct,href:Ct&&Ct({templateName:tt.metadata.name,namespace:tt.metadata.namespace||p.zG})};hn.push(Wt)}let Cn="";Ke==="gridItem"?Cn=rt.gridItemCard:Ke==="fullHeight"&&(Cn=rt.fullHeightCard);let on="";Ke==="gridItem"?on=rt.gridItemCardContent:Ke==="fullHeight"&&(on=rt.fullHeightCardContent);const pn=(Ht=tt.metadata.annotations)===null||Ht===void 0?void 0:Ht[p.P1],wn=((Ce=pn)===null||Ce===void 0?void 0:Ce.startsWith("url:"))||(($e=pn)===null||$e===void 0?void 0:$e.startsWith("file:")),_e=(0,w.useCallback)(async()=>{try{await ot.refreshEntity((0,p.eE)(tt)),Qe.post({message:"Refresh scheduled",severity:"info",display:"transient"})}catch(Jt){ft.post(Jt)}},[ot,Qe,ft,tt]);return(0,r.jsxs)(de.Z,{className:Cn,children:[(0,r.jsx)(D.Z,{title:"About",action:(0,r.jsxs)(r.Fragment,{children:[wn&&(0,r.jsx)(A.Z,{"aria-label":"Refresh",title:"Schedule entity refresh",onClick:_e,children:(0,r.jsx)(X.Z,{})}),(0,r.jsx)(A.Z,{component:W.rU,"aria-label":"Edit",disabled:!un,title:"Edit Metadata",to:un!=null?un:"#",children:(0,r.jsx)(R.Z,{})})]}),subheader:(0,r.jsx)(W.M6,{links:hn})}),(0,r.jsx)(se.Z,{}),(0,r.jsx)(ie.Z,{className:on,children:(0,r.jsx)(Tt,{entity:tt})})]})}},86359:function(It,Pe,n){"use strict";n.d(Pe,{E:function(){return K}});var r=n(52322),p=n(25271),W=n(53974),f=n(39709),V=n(90436),m=n(15459),h=n(27604),F=n(2997),ve=n(11640),ce=n(28347),z=n(76635),de=n(2784),D=n(7089);const A=Object.freeze({createNameColumn(R){function w(I){var U,xe;return((U=I.metadata)===null||U===void 0?void 0:U.title)||(0,f.$3)(I,{defaultKind:(xe=R)===null||xe===void 0?void 0:xe.defaultKind})}return{title:"Name",field:"resolved.name",highlight:!0,customSort({entity:I},{entity:U}){return w(I).localeCompare(w(U))},render:({entity:I})=>{var U,xe;return(0,r.jsx)(f.dx,{entityRef:I,defaultKind:((U=R)===null||U===void 0?void 0:U.defaultKind)||"Component",title:(xe=I.metadata)===null||xe===void 0?void 0:xe.title})}}},createSystemColumn(){return{title:"System",field:"resolved.partOfSystemRelationTitle",render:({resolved:R})=>(0,r.jsx)(f.rI,{entityRefs:R.partOfSystemRelations,defaultKind:"system"})}},createOwnerColumn(){return{title:"Owner",field:"resolved.ownedByRelationsTitle",render:({resolved:R})=>(0,r.jsx)(f.rI,{entityRefs:R.ownedByRelations,defaultKind:"group"})}},createSpecTargetsColumn(){return{title:"Targets",field:"entity.spec.targets",render:({entity:R})=>{var w,I,U,xe;return(0,r.jsx)(r.Fragment,{children:(((I=R)===null||I===void 0||(w=I.spec)===null||w===void 0?void 0:w.targets)||((xe=R)===null||xe===void 0||(U=xe.spec)===null||U===void 0?void 0:U.target))&&(0,r.jsx)(W.Or,{text:(R.spec.targets||[R.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:R})=>(0,r.jsx)(W.Or,{text:R.metadata.description,placement:"bottom-start"}),width:"auto"}},createTagsColumn(){return{title:"Tags",field:"entity.metadata.tags",cellStyle:{padding:"0px 16px 0px 20px"},render:({entity:R})=>(0,r.jsx)(r.Fragment,{children:R.metadata.tags&&R.metadata.tags.map(w=>(0,r.jsx)(D.Z,{label:w,size:"small",variant:"outlined",style:{marginBottom:"0px"}},w))}),width:"auto"}},createTitleColumn(R){var w;return{title:"Title",field:"entity.metadata.title",hidden:(w=R)===null||w===void 0?void 0:w.hidden,searchable:!0}},createLabelColumn(R,w){var I;return{title:((I=w)===null||I===void 0?void 0:I.title)||"Label",field:"entity.metadata.labels",cellStyle:{padding:"0px 16px 0px 20px"},render:({entity:U})=>{var xe,Se;const k=(xe=U.metadata)===null||xe===void 0?void 0:xe.labels,Ge=k&&k[R]||((Se=w)===null||Se===void 0?void 0:Se.defaultValue);return(0,r.jsx)(r.Fragment,{children:Ge&&(0,r.jsx)(D.Z,{label:Ge,size:"small",variant:"outlined"},Ge)})},width:"auto"}},createNamespaceColumn(){return{title:"Namespace",field:"entity.metadata.namespace",width:"auto"}}});var se=n(19928),ie=n.n(se);const ee=(0,m.Z)({root:{color:"#f3ba37"}})(ve.Z),X=(R,w)=>{const I=U=>U.metadata.title||(0,f.$3)(U,{defaultKind:"Component"});return I(R).localeCompare(I(w))},K=R=>{var w,I,U,xe;const{columns:Se,actions:k,tableOptions:Ge,subtitle:xt,emptyContent:Dt}=R,{isStarredEntity:Ut,toggleStarredEntity:Tt}=(0,f.CR)(),{loading:Nt,error:Yt,entities:dt,filters:ut}=(0,f.wp)(),St=(0,de.useMemo)(()=>{var ot;return[A.createTitleColumn({hidden:!0}),A.createNameColumn({defaultKind:(ot=ut.kind)===null||ot===void 0?void 0:ot.value}),...Qe(),A.createMetadataDescriptionColumn(),A.createTagsColumn()];function Qe(){var ft;const gt=[A.createSystemColumn(),A.createOwnerColumn(),A.createSpecTypeColumn(),A.createSpecLifecycleColumn()];switch((ft=ut.kind)===null||ft===void 0?void 0:ft.value){case"user":return[];case"domain":case"system":return[A.createOwnerColumn()];case"group":case"template":return[A.createSpecTypeColumn()];case"location":return[A.createSpecTypeColumn(),A.createSpecTargetsColumn()];default:return dt.every(Ct=>Ct.metadata.namespace==="default")?gt:[...gt,A.createNamespaceColumn()]}}},[(w=ut.kind)===null||w===void 0?void 0:w.value,dt]),lt=ut.type===void 0;var Zt;const Ht=(0,z.capitalize)((Zt=(I=ut.user)===null||I===void 0?void 0:I.value)!==null&&Zt!==void 0?Zt:"all");if(Yt)return(0,r.jsx)("div",{children:(0,r.jsx)(W.GB,{severity:"error",title:"Could not fetch catalog entities.",children:(0,r.jsx)(W.Oi,{language:"text",text:Yt.toString()})})});const Ce=[({entity:ot})=>{var Qe;const ft=(Qe=ot.metadata.annotations)===null||Qe===void 0?void 0:Qe[p.l2],gt="View";return{icon:()=>(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(V.Z,{variant:"srOnly",children:gt}),(0,r.jsx)(F.Z,{fontSize:"small"})]}),tooltip:gt,disabled:!ft,onClick:()=>{ft&&window.open(ft,"_blank")}}},({entity:ot})=>{var Qe;const ft=(Qe=ot.metadata.annotations)===null||Qe===void 0?void 0:Qe[p.Tf],gt="Edit";return{icon:()=>(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(V.Z,{variant:"srOnly",children:gt}),(0,r.jsx)(h.Z,{fontSize:"small"})]}),tooltip:gt,disabled:!ft,onClick:()=>{ft&&window.open(ft,"_blank")}}},({entity:ot})=>{const Qe=Ut(ot),ft=Qe?"Remove from favorites":"Add to favorites";return{cellStyle:{paddingLeft:"1em"},icon:()=>(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(V.Z,{variant:"srOnly",children:ft}),Qe?(0,r.jsx)(ee,{}):(0,r.jsx)(ce.Z,{})]}),tooltip:ft,onClick:()=>Tt(ot)}}],$e=dt.sort(X).map(ot=>{const Qe=(0,f.hF)(ot,p.cz,{kind:"system"}),ft=(0,f.hF)(ot,p.S4);return{entity:ot,resolved:{name:(0,f.$3)(ot,{defaultKind:"Component"}),ownedByRelationsTitle:ft.map(gt=>(0,f.$3)(gt,{defaultKind:"group"})).join(", "),ownedByRelations:ft,partOfSystemRelationTitle:Qe.map(gt=>(0,f.$3)(gt,{defaultKind:"system"})).join(", "),partOfSystemRelations:Qe}}}),Ke=(Se||St).find(ot=>ot.title==="Type");Ke&&(Ke.hidden=!lt);const ht=$e.length>20,rt=((U=ut.kind)===null||U===void 0?void 0:U.value)||"",tt=((xe=ut.type)===null||xe===void 0?void 0:xe.value)||"",vt=[Ht,tt,ie()(rt)].filter(ot=>ot).join(" ");return(0,r.jsx)(W.iA,{isLoading:Nt,columns:Se||St,options:{paging:ht,pageSize:20,actionsColumnIndex:-1,loadingType:"linear",showEmptyDataSourceMessage:!Nt,padding:"dense",pageSizeOptions:[20,50,100],...Ge},title:`${vt} (${dt.length})`,data:$e,actions:k||Ce,subtitle:xt,emptyContent:Dt})};K.columns=A},85877:function(It,Pe,n){"use strict";n.r(Pe),n.d(Pe,{EntityLabelsCard:function(){return de},hasLabels:function(){return D}});var r=n(52322),p=n(39709),W=n(2784),f=n(53974),V=n(79692),m=n(90436),h=n(77277);const F=`metadata:
|
|
33
|
+
`)},this.appClient=new ue.v({baseUrl:S,headers:Xe,authStrategy:G.i,auth:this.baseAuthConfig})}}class yt{async getAllInstallations(){return this.apps.length?(await Promise.all(this.apps.map(S=>S.getInstallations()))).flat():[]}async getAppToken(c,S){if(this.apps.length===0)return;const E=await Promise.all(this.apps.map(De=>De.getInstallationCredentials(c,S).then(et=>({credentials:et,error:void 0}),et=>({credentials:void 0,error:et})))),J=E.find(De=>{var et;return(et=De.credentials)===null||et===void 0?void 0:et.accessToken});if(J)return J.credentials.accessToken;const je=E.map(De=>De.error).find(De=>{var et;return((et=De)===null||et===void 0?void 0:et.name)!=="NotFoundError"});if(je)throw je}constructor(c){var S;(0,r._)(this,"apps",void 0);var E;this.apps=(E=(S=c.apps)===null||S===void 0?void 0:S.map(J=>new nt(J,c.apiBaseUrl)))!==null&&E!==void 0?E:[]}}class bt{async getCredentials(c){const S=W()(c.url),E=S.owner||S.name,J=S.owner?S.name:void 0;let ye="app",je=await this.githubAppCredentialsMux.getAppToken(E,J);return je||(ye="token",je=this.token),{headers:je?{Authorization:`Bearer ${je}`}:void 0,token:je,type:ye}}constructor(c,S){(0,r._)(this,"githubAppCredentialsMux",void 0),(0,r._)(this,"token",void 0),this.githubAppCredentialsMux=c,this.token=S}}(0,r._)(bt,"create",C=>new bt(new yt(C),C.token));class ct{static fromIntegrations(c){const S=new Map;return c.github.list().forEach(E=>{const J=SingleInstanceGithubCredentialsProvider.create(E.config);S.set(E.config.host,J)}),new ct(S)}async getCredentials(c){const S=new URL(c.url),E=this.providers.get(S.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 Oe{get type(){return"github"}get title(){return this.integrationConfig.host}get config(){return this.integrationConfig}resolveUrl(c){return wt(F(c),"tree")}resolveEditUrl(c){return wt(c,"edit")}constructor(c){(0,r._)(this,"integrationConfig",void 0),this.integrationConfig=c}}(0,r._)(Oe,"factory",({config:C})=>{var c;const S=Y((c=C.getOptionalConfigArray("integrations.github"))!==null&&c!==void 0?c:[]);return h(S.map(E=>new Oe(E)),E=>E.config.host)});function wt(C,c){return C.replace(/\/\/([^/]+)\/([^/]+)\/([^/]+)\/(blob|tree|edit)\//,(S,E,J,ye)=>`//${E}/${J}/${ye}/${c}/`)}const _t=null;class jt extends Oe{get config(){return super.config}constructor(c){super(c)}}(0,r._)(jt,"factory",Oe.factory);const Ft=null,qt=null,jn=null,Bt="gitlab.com",mt="https://gitlab.com/api/v4";function Lt(C){const c=C.getString("host");let S=C.getOptionalString("apiBaseUrl");const E=C.getOptionalString("token");let J=C.getOptionalString("baseUrl");if(S?S=(0,f.trimEnd)(S,"/"):c===Bt&&(S=mt),J?J=(0,f.trimEnd)(J,"/"):J=`https://${c}`,V(c)){if(!S||!m(S))throw new Error(`Invalid GitLab integration config, '${S}' is not a valid apiBaseUrl`);if(!m(J))throw new Error(`Invalid GitLab integration config, '${J}' 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:S,baseUrl:J}}function Mt(C){const c=C.map(Lt);return c.some(S=>S.host===Bt)||c.push({host:Bt,apiBaseUrl:mt,baseUrl:`https://${Bt}`}),c}function en(C){let c="";return C.host!==Bt&&(c=new URL(C.baseUrl).pathname),trimEnd(c,"/")}async function pr(C,c){const S=await yn(C,c);return _n(C,S,c).toString()}function fr(C){const{token:c=""}=C;return{headers:{"PRIVATE-TOKEN":c}}}function _n(C,c,S){try{const E=new URL(C),J=E.pathname.split("/blob/").slice(1).join("/blob/"),[ye,...je]=J.split("/"),De=getGitLabIntegrationRelativePath(S);return E.pathname=[...De?[De]:[],"api/v4/projects",c,"repository/files",encodeURIComponent(decodeURIComponent(je.join("/"))),"raw"].join("/"),E.search=`?ref=${ye}`,E}catch(E){throw new Error(`Incorrect url: ${C}, ${E}`)}}async function yn(C,c){const S=new URL(C);if(!S.pathname.includes("/blob/"))throw new Error("Please provide full path to yaml file from GitLab");try{let E=S.pathname.split("/-/blob/")[0].split("/blob/")[0];const J=getGitLabIntegrationRelativePath(c);J&&(E=E.replace(J,""));const ye=new URL(`${S.origin}${J}/api/v4/projects/${encodeURIComponent(E.replace(/^\//,""))}`),je=await fetch(ye.toString(),fr(c)),De=await je.json();if(!je.ok)throw new Error(`GitLab Error '${De.error}', ${De.error_description}`);return Number(De.id)}catch(E){throw new Error(`Could not get GitLab project ID for: ${C}, ${E}`)}}class Mn{get type(){return"gitlab"}get title(){return this.integrationConfig.host}get config(){return this.integrationConfig}resolveUrl(c){return F(c)}resolveEditUrl(c){return gr(c,"edit")}constructor(c){(0,r._)(this,"integrationConfig",void 0),this.integrationConfig=c}}(0,r._)(Mn,"factory",({config:C})=>{var c;const S=Mt((c=C.getOptionalConfigArray("integrations.gitlab"))!==null&&c!==void 0?c:[]);return h(S.map(E=>new Mn(E)),E=>E.config.host)});function gr(C,c){return C.replace(/\/\-\/(blob|tree|edit)\//,`/-/${c}/`)}class Nr{async getCredentials(c){return this.token?{headers:{Authorization:`Bearer ${this.token}`},token:this.token}:{}}constructor(c){(0,r._)(this,"token",void 0),this.token=c}}(0,r._)(Nr,"create",C=>new Nr(C.token));class zn{static fromIntegrations(c){const S=new Map;return c.gitlab.list().forEach(E=>{const J=SingleInstanceGitlabCredentialsProvider.create(E.config);S.set(E.config.host,J)}),new zn(S)}async getCredentials(c){const S=new URL(c.url),E=this.providers.get(S.host);if(!E)throw new Error(`There is no GitLab 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 Fr{static fromConfig(c){return new Fr({awsS3:D.factory({config:c}),azure:Tt.factory({config:c}),bitbucket:$e.factory({config:c}),bitbucketCloud:mn.factory({config:c}),bitbucketServer:pn.factory({config:c}),gerrit:le.factory({config:c}),github:Oe.factory({config:c}),gitlab:Mn.factory({config:c}),gitea:Qt.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 S=Object.values(this.byType).map(E=>E.byUrl(c)).filter(Boolean);if(S.length>1){const E=S.filter(J=>!(J instanceof $e));E.length!==0&&(S=E)}return S[0]}byHost(c){return Object.values(this.byType).map(S=>S.byHost(c)).find(Boolean)}resolveUrl(c){const S=this.byUrl(c.base);return S?S.resolveUrl(c):F(c)}resolveEditUrl(c){const S=this.byUrl(c);return S?S.resolveEditUrl(c):c}constructor(c){(0,r._)(this,"byType",void 0),this.byType=c}}},48514:function(It,Pe,n){"use strict";var r={};n.r(r),n.d(r,{TechDocsPlugin:function(){return w.s4}});var p=n(52322),W=n(2784),f=n(28316),V=n(73557),m=n(60871);const h=(0,m.T0)({id:"plugin.techdocs.storageservice"}),F=(0,m.T0)({id:"plugin.techdocs.service"});var ve=n(92077),ce=n(95481),z=n(7476),de=n(93225),D=n(86317),A=n(65124),se=n(22478),ie=n(85478),ee=n(68435),X=n(3482),K=n(42081),R=n(48431),w=n(89258),I=n(52943),U=n(61886),xe=n(13980),Se=n.n(xe),k=n(87612);class Ge{get(t){for(const o of this.holders){const a=o.get(t);if(a)return a}}constructor(...t){(0,k._)(this,"holders",void 0),this.holders=t}}var xt=n(51837);const Dt=(0,xt.CT)("api-context"),Ut=i=>{var t;const{apis:o,children:a}=i,d=(t=(0,W.useContext)(Dt))===null||t===void 0?void 0:t.atVersion(1),b=d?new Ge(o,d):o;return(0,p.jsx)(Dt.Provider,{value:(0,xt.EI)({1:b}),children:a})};Ut.propTypes={apis:Se().shape({get:Se().func.isRequired}).isRequired,children:Se().node};class Tt{static validateFactories(t,o){for(const a of o){const d=[a],b=new Set;for(;d.length;){const B=d.shift(),Z=t.get(B);if(Z)for(const oe of Object.values(Z.deps)){if(oe.id===a.id)throw new Error(`Circular dependency of api factory for ${a}`);b.has(oe)||(b.add(oe),d.push(oe))}}}}get(t){return this.load(t)}load(t,o=[]){const a=this.apis.get(t.id);if(a)return a;const d=this.factories.get(t);if(!d)return;if(o.includes(d.api))throw new Error(`Circular dependency of api factory for ${d.api}`);const b=this.loadDeps(t,d.deps,[...o,d.api]),B=d.factory(b);return this.apis.set(t.id,B),B}loadDeps(t,o,a){const d={};for(const b in o)if(o.hasOwnProperty(b)){const B=o[b],Z=this.load(B,a);if(!Z)throw new Error(`No API factory available for dependency ${B} of dependent ${t}`);d[b]=Z}return d}constructor(t){(0,k._)(this,"factories",void 0),(0,k._)(this,"apis",void 0),this.factories=t,this.apis=new Map}}var Nt;(function(i){i[i.default=10]="default",i[i.app=50]="app",i[i.static=100]="static"})(Nt||(Nt={}));class Yt{register(t,o){const a=Nt[t],d=this.factories.get(o.api.id);return d&&d.priority>=a?!1:(this.factories.set(o.api.id,{priority:a,factory:o}),!0)}get(t){const o=this.factories.get(t.id);if(o)return o.factory}getAllApis(){const t=new Set;for(const{factory:o}of this.factories.values())t.add(o.api);return t}constructor(){(0,k._)(this,"factories",new Map)}}function dt(i){return new Promise((t,o)=>{const a=i.width||500,d=i.height||700,b=window.screen.width/2-a/2,B=window.screen.height/2-d/2,Z=window.open(i.url,i.name,`menubar=no,location=no,resizable=no,scrollbars=no,status=no,width=${a},height=${d},top=${B},left=${b}`);let oe="";if(!Z||typeof Z.closed=="undefined"||Z.closed){const Fe=new Error("Failed to open auth popup.");Fe.name="PopupRejectedError",o(Fe);return}const me=Fe=>{if(Fe.source!==Z||Fe.origin!==i.origin)return;const{data:Je}=Fe;if(Je.type==="config_info"){oe=Je.targetOrigin;return}if(Je.type!=="authorization_response")return;const st=Je;if("error"in st){const tn=new Error(st.error.message);tn.name=st.error.name,o(tn)}else t(st.response);Te()},Me=setInterval(()=>{if(Z.closed){const Fe=`Login failed, ${oe&&oe!==window.location.origin?`Incorrect app origin, expected ${oe}`:"popup was closed"}`,Je=new Error(Fe);Je.name="PopupClosedError",o(Je),Te()}},100);function Te(){window.removeEventListener("message",me),clearInterval(Me)}window.addEventListener("message",me)})}let ut=!1;function St(i){return[...i].join(" ")}class lt{async createSession(t){return t.instantPopup?this.enableExperimentalRedirectFlow?this.executeRedirect(t.scopes):this.showPopup(t.scopes):this.authRequester(t.scopes)}async refreshSession(t){const o=await fetch(await this.buildUrl("/refresh",{optional:!0,...t&&{scope:this.joinScopesFunc(t)}}),{headers:{"x-requested-with":"XMLHttpRequest"},credentials:"include"}).catch(d=>{throw new Error(`Auth refresh request failed, ${d}`)});if(!o.ok){const d=new Error(`Auth refresh request failed, ${o.statusText}`);throw d.status=o.status,d}const a=await o.json();if(a.error){const d=new Error(a.error.message);throw a.error.name&&(d.name=a.error.name),d}return await this.sessionTransform(a)}async removeSession(){const t=await fetch(await this.buildUrl("/logout"),{method:"POST",headers:{"x-requested-with":"XMLHttpRequest"},credentials:"include"}).catch(o=>{throw new Error(`Logout request failed, ${o}`)});if(!t.ok){const o=new Error(`Logout request failed, ${t.statusText}`);throw o.status=t.status,o}}async showPopup(t){var o,a,d,b,B,Z,oe,me;const Me=this.joinScopesFunc(t),Te=await this.buildUrl("/start",{scope:Me,origin:window.location.origin,flow:"popup"}),Fe=!((a=this.popupOptions)===null||a===void 0||(o=a.size)===null||o===void 0)&&o.fullscreen?window.screen.width:((b=this.popupOptions)===null||b===void 0||(d=b.size)===null||d===void 0?void 0:d.width)||450,Je=!((Z=this.popupOptions)===null||Z===void 0||(B=Z.size)===null||B===void 0)&&B.fullscreen?window.screen.height:((me=this.popupOptions)===null||me===void 0||(oe=me.size)===null||oe===void 0?void 0:oe.height)||730,st=await dt({url:Te,name:`${this.provider.title} Login`,origin:new URL(Te).origin,width:Fe,height:Je});return await this.sessionTransform(st)}async executeRedirect(t){const o=this.joinScopesFunc(t);return window.location.href=await this.buildUrl("/start",{scope:o,origin:window.location.origin,redirectUrl:window.location.href,flow:"redirect"}),new Promise(()=>{})}async buildUrl(t,o){const a=await this.discoveryApi.getBaseUrl("auth"),d=this.buildQueryString({...o,env:this.environment});return`${a}/${this.provider.id}${t}${d}`}buildQueryString(t){if(!t)return"";const o=Object.entries(t).map(([a,d])=>{if(typeof d=="string")return`${encodeURIComponent(a)}=${encodeURIComponent(d)}`;if(d)return encodeURIComponent(a)}).filter(Boolean).join("&");return o?`?${o}`:""}constructor(t){(0,k._)(this,"discoveryApi",void 0),(0,k._)(this,"environment",void 0),(0,k._)(this,"provider",void 0),(0,k._)(this,"joinScopesFunc",void 0),(0,k._)(this,"authRequester",void 0),(0,k._)(this,"sessionTransform",void 0),(0,k._)(this,"enableExperimentalRedirectFlow",void 0),(0,k._)(this,"popupOptions",void 0);const{configApi:o,discoveryApi:a,environment:d,provider:b,joinScopes:B=St,oauthRequestApi:Z,sessionTransform:oe=Te=>Te,popupOptions:me}=t;!ut&&!o&&(console.warn("DEPRECATION WARNING: Authentication providers require a configApi instance to configure the authentication flow. Please provide one to the authentication provider constructor."),ut=!0);var Me;this.enableExperimentalRedirectFlow=o&&(Me=o.getOptionalBoolean("enableExperimentalRedirectFlow"))!==null&&Me!==void 0?Me:!1,this.authRequester=Z.createAuthRequester({provider:b,onAuthRequest:async Te=>this.enableExperimentalRedirectFlow?this.executeRedirect(Te):this.showPopup(Te)}),this.discoveryApi=a,this.environment=d,this.provider=b,this.joinScopesFunc=B,this.sessionTransform=oe,this.popupOptions=me}}function Zt(i,t){for(const o of t)if(!i.has(o))return!1;return!0}class Ht{sessionExistsAndHasScope(t,o){if(!t)return!1;if(!o||this.options.sessionScopes===void 0)return!0;const a=this.options.sessionScopes(t);return Zt(a,o)}getExtendedScope(t,o){const a=new Set(this.options.defaultScopes);if(t&&this.options.sessionScopes!==void 0){const d=this.options.sessionScopes(t);for(const b of d)a.add(b)}if(o)for(const d of o)a.add(d);return a}constructor(t){(0,k._)(this,"options",void 0),this.options=t}}var Ce=n(82394),$e=n.n(Ce);let Ke=Symbol.observable;class ht{[Ke](){return this}get closed(){return this.isClosed}next(t){if(this.isClosed)throw new Error("PublishSubject is closed");this.subscribers.forEach(o=>o.next(t))}error(t){if(this.isClosed)throw new Error("PublishSubject is closed");this.isClosed=!0,this.terminatingError=t,this.subscribers.forEach(o=>o.error(t))}complete(){if(this.isClosed)throw new Error("PublishSubject is closed");this.isClosed=!0,this.subscribers.forEach(t=>t.complete())}subscribe(t,o,a){const d=typeof t=="function"?{next:t,error:o,complete:a}:t;return this.observable.subscribe(d)}constructor(){(0,k._)(this,"isClosed",!1),(0,k._)(this,"terminatingError",void 0),(0,k._)(this,"observable",new($e())(t=>this.isClosed?(this.terminatingError?t.error(this.terminatingError):t.complete(),()=>{}):(this.subscribers.add(t),()=>{this.subscribers.delete(t)}))),(0,k._)(this,"subscribers",new Set)}}let rt=Symbol.observable;class tt{[rt](){return this}get closed(){return this.isClosed}next(t){if(this.isClosed)throw new Error("BehaviorSubject is closed");this.currentValue=t,this.subscribers.forEach(o=>o.next(t))}error(t){if(this.isClosed)throw new Error("BehaviorSubject is closed");this.isClosed=!0,this.terminatingError=t,this.subscribers.forEach(o=>o.error(t))}complete(){if(this.isClosed)throw new Error("BehaviorSubject is closed");this.isClosed=!0,this.subscribers.forEach(t=>t.complete())}subscribe(t,o,a){const d=typeof t=="function"?{next:t,error:o,complete:a}:t;return this.observable.subscribe(d)}constructor(t){(0,k._)(this,"isClosed",void 0),(0,k._)(this,"currentValue",void 0),(0,k._)(this,"terminatingError",void 0),(0,k._)(this,"observable",void 0),(0,k._)(this,"subscribers",new Set),this.isClosed=!1,this.currentValue=t,this.terminatingError=void 0,this.observable=new($e())(o=>this.isClosed?(this.terminatingError?o.error(this.terminatingError):o.complete(),()=>{}):(o.next(this.currentValue),this.subscribers.add(o),()=>{this.subscribers.delete(o)}))}}class vt{setIsSignedIn(t){this.signedIn!==t&&(this.signedIn=t,this.subject.next(this.signedIn?m.sM.SignedIn:m.sM.SignedOut))}sessionState$(){return this.subject}constructor(){(0,k._)(this,"subject",new tt(m.sM.SignedOut)),(0,k._)(this,"signedIn",!1)}}class ot{async getSession(t){if(this.helper.sessionExistsAndHasScope(this.currentSession,t.scopes)){if(!this.sessionShouldRefreshFunc(this.currentSession))return this.currentSession;try{const a=await this.collapsedSessionRefresh(t.scopes),d=this.sessionScopesFunc(this.currentSession),b=this.sessionScopesFunc(a);return Zt(b,d)&&(this.currentSession=a),a}catch(a){if(t.optional)return;throw a}}if(!this.currentSession&&!t.instantPopup)try{const o=await this.collapsedSessionRefresh(t.scopes);return this.currentSession=o,this.getSession(t)}catch{}if(!t.optional)return this.currentSession=await this.connector.createSession({...t,scopes:this.helper.getExtendedScope(this.currentSession,t.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(t){if(this.refreshPromise)return this.refreshPromise;this.refreshPromise=this.connector.refreshSession(t);try{const o=await this.refreshPromise;return this.stateTracker.setIsSignedIn(!0),o}finally{delete this.refreshPromise}}constructor(t){(0,k._)(this,"connector",void 0),(0,k._)(this,"helper",void 0),(0,k._)(this,"sessionScopesFunc",void 0),(0,k._)(this,"sessionShouldRefreshFunc",void 0),(0,k._)(this,"stateTracker",new vt),(0,k._)(this,"refreshPromise",void 0),(0,k._)(this,"currentSession",void 0);const{connector:o,defaultScopes:a=new Set,sessionScopes:d,sessionShouldRefresh:b}=t;this.connector=o,this.sessionScopesFunc=d,this.sessionShouldRefreshFunc=b,this.helper=new Ht({sessionScopes:d,defaultScopes:a})}}class Qe{setSession(t){this.currentSession=t,this.stateTracker.setIsSignedIn(Boolean(t))}async getSession(t){if(this.helper.sessionExistsAndHasScope(this.currentSession,t.scopes))return this.currentSession;if(!t.optional)return this.currentSession=await this.connector.createSession({...t,scopes:this.helper.getExtendedScope(this.currentSession,t.scopes)}),this.stateTracker.setIsSignedIn(!0),this.currentSession}async removeSession(){this.currentSession=void 0,this.stateTracker.setIsSignedIn(!1)}sessionState$(){return this.stateTracker.sessionState$()}constructor(t){_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:o,defaultScopes:a=new Set,sessionScopes:d}=t;this.connector=o,this.helper=new SessionScopeHelper({sessionScopes:d,defaultScopes:a})}}const ft={id:"oauth2",title:"Your Identity Provider",icon:()=>null};class gt{static create(t){const{configApi:o,discoveryApi:a,environment:d="development",provider:b=ft,oauthRequestApi:B,defaultScopes:Z=[],scopeTransform:oe=Fe=>Fe,popupOptions:me}=t,Me=new lt({configApi:o,discoveryApi:a,environment:d,provider:b,oauthRequestApi:B,sessionTransform(Fe){return{...Fe,providerInfo:{idToken:Fe.providerInfo.idToken,accessToken:Fe.providerInfo.accessToken,scopes:gt.normalizeScopes(oe,Fe.providerInfo.scope),expiresAt:new Date(Date.now()+Fe.providerInfo.expiresInSeconds*1e3)}}},popupOptions:me}),Te=new ot({connector:Me,defaultScopes:new Set(Z),sessionScopes:Fe=>Fe.providerInfo.scopes,sessionShouldRefresh:Fe=>(Fe.providerInfo.expiresAt.getTime()-Date.now())/1e3<60*5});return new gt({sessionManager:Te,scopeTransform:oe})}async signIn(){await this.getAccessToken()}async signOut(){await this.sessionManager.removeSession()}sessionState$(){return this.sessionManager.sessionState$()}async getAccessToken(t,o){var a;const d=gt.normalizeScopes(this.scopeTransform,t),b=await this.sessionManager.getSession({...o,scopes:d});var B;return(B=(a=b)===null||a===void 0?void 0:a.providerInfo.accessToken)!==null&&B!==void 0?B:""}async getIdToken(t={}){var o;const a=await this.sessionManager.getSession({...t,scopes:new Set(["openid"])});var d;return(d=(o=a)===null||o===void 0?void 0:o.providerInfo.idToken)!==null&&d!==void 0?d:""}async getBackstageIdentity(t={}){var o;return(o=await this.sessionManager.getSession(t))===null||o===void 0?void 0:o.backstageIdentity}async getProfile(t={}){var o;return(o=await this.sessionManager.getSession(t))===null||o===void 0?void 0:o.profile}static normalizeScopes(t,o){if(!o)return new Set;const a=Array.isArray(o)?o:o.split(/[\s|,]/).filter(Boolean);return new Set(t(a))}constructor(t){(0,k._)(this,"sessionManager",void 0),(0,k._)(this,"scopeTransform",void 0),this.sessionManager=t.sessionManager,this.scopeTransform=t.scopeTransform}}const Ct={id:"github",title:"GitHub",icon:()=>null};class mn{static create(t){const{configApi:o,discoveryApi:a,environment:d="development",provider:b=Ct,oauthRequestApi:B,defaultScopes:Z=["read:user"]}=t;return gt.create({configApi:o,discoveryApi:a,oauthRequestApi:B,provider:b,environment:d,defaultScopes:Z})}}const un={id:"gitlab",title:"GitLab",icon:()=>null};class ln{static create(t){const{configApi:o,discoveryApi:a,environment:d="development",provider:b=un,oauthRequestApi:B,defaultScopes:Z=["read_user"]}=t;return gt.create({configApi:o,discoveryApi:a,oauthRequestApi:B,provider:b,environment:d,defaultScopes:Z})}}const Sn={id:"google",title:"Google",icon:()=>null},hn="https://www.googleapis.com/auth/";class vn{static create(t){const{configApi:o,discoveryApi:a,oauthRequestApi:d,environment:b="development",provider:B=Sn,defaultScopes:Z=["openid",`${hn}userinfo.email`,`${hn}userinfo.profile`]}=t;return gt.create({configApi:o,discoveryApi:a,oauthRequestApi:d,provider:B,environment:b,defaultScopes:Z,scopeTransform(oe){return oe.map(me=>me==="openid"?me:me==="profile"||me==="email"?`${hn}userinfo.${me}`:me.startsWith(hn)?me:`${hn}${me}`)}})}}const Cn={id:"okta",title:"Okta",icon:()=>null},on=new Set(["openid","profile","email","phone","address","groups","offline_access"]),pn="okta.";class wn{static create(t){const{configApi:o,discoveryApi:a,environment:d="development",provider:b=Cn,oauthRequestApi:B,defaultScopes:Z=["openid","email","profile","offline_access"]}=t;return gt.create({configApi:o,discoveryApi:a,oauthRequestApi:B,provider:b,environment:d,defaultScopes:Z,scopeTransform(oe){return oe.map(me=>on.has(me)||me.startsWith(pn)?me:`${pn}${me}`)}})}}var _e=n(30195);const Jt=_e.z.object({profile:_e.z.object({email:_e.z.string().optional(),displayName:_e.z.string().optional(),picture:_e.z.string().optional()}),backstageIdentity:_e.z.object({token:_e.z.string(),identity:_e.z.object({type:_e.z.literal("user"),userEntityRef:_e.z.string(),ownershipEntityRefs:_e.z.array(_e.z.string())})})}),Wt={id:"saml",title:"SAML",icon:()=>null};class Ye{static create(t){const{discoveryApi:o,environment:a="development",provider:d=Wt}=t,b=new DirectAuthConnector({discoveryApi:o,environment:a,provider:d}),B=new StaticAuthSessionManager({connector:b}),Z=new AuthSessionStore({manager:B,storageKey:`${d.id}Session`,schema:samlSessionSchema});return new Ye(Z)}sessionState$(){return this.sessionManager.sessionState$()}async signIn(){await this.getBackstageIdentity({})}async signOut(){await this.sessionManager.removeSession()}async getBackstageIdentity(t={}){var o;return(o=await this.sessionManager.getSession(t))===null||o===void 0?void 0:o.backstageIdentity}async getProfile(t={}){var o;return(o=await this.sessionManager.getSession(t))===null||o===void 0?void 0:o.profile}constructor(t){_define_property(this,"sessionManager",void 0),this.sessionManager=t}}const Tn={id:"microsoft",title:"Microsoft",icon:()=>null};class sn{static create(t){return new sn(t)}microsoftGraph(){return this.oauth2[sn.MicrosoftGraphID]}static resourceForScopes(t){const o=[...new Set(t.split(" ").map(sn.resourceForScope).filter(b=>b!=="openid"))];if(o.length>1)return Promise.reject(new Error(`Requested access token with scopes from multiple Azure resources: ${o.join(", ")}. Access tokens can only have a single audience.`));var a;const d=(a=o[0])!==null&&a!==void 0?a:sn.MicrosoftGraphID;return Promise.resolve(d)}static resourceForScope(t){var o;const a=(o=t.match(RegExp("^(?<resourceURI>.*)\\/(?<scp>[^\\/]*)$")))===null||o===void 0?void 0:o.groups;if(a){const{resourceURI:d}=a;return d.replace(/^api:\/\//,"")}switch(t){case"email":case"openid":case"offline_access":case"profile":return"openid";default:return sn.MicrosoftGraphID}}async getAccessToken(t,o){const a=t===void 0?sn.MicrosoftGraphID:await sn.resourceForScopes(Array.isArray(t)?t.join(" "):t);return a in this.oauth2||(this.oauth2[a]=gt.create({configApi:this.configApi,discoveryApi:this.discoveryApi,oauthRequestApi:this.oauthRequestApi,provider:this.provider,environment:this.environment,scopeTransform:this.scopeTransform})),this.oauth2[a].getAccessToken(t,o)}getIdToken(t){return this.microsoftGraph().getIdToken(t)}getProfile(t){return this.microsoftGraph().getProfile(t)}getBackstageIdentity(t){return this.microsoftGraph().getBackstageIdentity(t)}signIn(){return this.microsoftGraph().signIn()}signOut(){return this.microsoftGraph().signOut()}sessionState$(){return this.microsoftGraph().sessionState$()}constructor(t){(0,k._)(this,"oauth2",void 0),(0,k._)(this,"configApi",void 0),(0,k._)(this,"environment",void 0),(0,k._)(this,"provider",void 0),(0,k._)(this,"oauthRequestApi",void 0),(0,k._)(this,"discoveryApi",void 0),(0,k._)(this,"scopeTransform",void 0);const{configApi:o,environment:a="development",provider:d=Tn,oauthRequestApi:b,discoveryApi:B,defaultScopes:Z=["openid","offline_access","profile","email","User.Read"],scopeTransform:oe=me=>me.concat("offline_access")}=t;this.configApi=o,this.environment=a,this.provider=d,this.oauthRequestApi=b,this.discoveryApi=B,this.scopeTransform=oe,this.oauth2={[sn.MicrosoftGraphID]:gt.create({configApi:this.configApi,discoveryApi:this.discoveryApi,oauthRequestApi:this.oauthRequestApi,provider:this.provider,environment:this.environment,scopeTransform:this.scopeTransform,defaultScopes:Z})}}}(0,k._)(sn,"MicrosoftGraphID","00000003-0000-0000-c000-000000000000");const Dn={id:"onelogin",title:"onelogin",icon:()=>null},Rn=new Set(["openid","profile","email","phone","address","groups","offline_access"]),In="onelogin.";class Kn{static create(t){const{configApi:o,discoveryApi:a,environment:d="development",provider:b=Dn,oauthRequestApi:B}=t;return gt.create({configApi:o,discoveryApi:a,oauthRequestApi:B,provider:b,environment:d,defaultScopes:["openid","email","profile","offline_access"],scopeTransform(Z){return Z.map(oe=>Rn.has(oe)||oe.startsWith(In)?oe:`${In}${oe}`)}})}}const On={id:"bitbucket",title:"Bitbucket",icon:()=>null};class Yn{static create(t){const{configApi:o,discoveryApi:a,environment:d="development",provider:b=On,oauthRequestApi:B,defaultScopes:Z=["team"]}=t;return gt.create({configApi:o,discoveryApi:a,oauthRequestApi:B,provider:b,environment:d,defaultScopes:Z})}}const we={id:"bitbucketServer",title:"Bitbucket Server",icon:()=>null};class pe{static create(t){const{configApi:o,discoveryApi:a,environment:d="development",provider:b=we,oauthRequestApi:B,defaultScopes:Z=["PROJECT_ADMIN"]}=t;return gt.create({configApi:o,discoveryApi:a,oauthRequestApi:B,provider:b,environment:d,defaultScopes:Z})}}const Re={id:"atlassian",title:"Atlassian",icon:()=>null};class H{static create(t){const{configApi:o,discoveryApi:a,environment:d="development",provider:b=Re,oauthRequestApi:B}=t;return gt.create({configApi:o,discoveryApi:a,oauthRequestApi:B,provider:b,environment:d})}}class N{post(t){this.subject.next(t)}alert$(){return this.subject}constructor(){(0,k._)(this,"subject",new ht)}}class le{captureEvent(t){}}const Ee="theme";class Ue{static createWithStorage(t){const o=new Ue(t);if(!window.localStorage)return o;var a;const d=(a=window.localStorage.getItem(Ee))!==null&&a!==void 0?a:void 0;return o.setActiveThemeId(d),o.activeThemeId$().subscribe(b=>{b?window.localStorage.setItem(Ee,b):window.localStorage.removeItem(Ee)}),window.addEventListener("storage",b=>{if(b.key===Ee){var B;const Z=(B=localStorage.getItem(Ee))!==null&&B!==void 0?B:void 0;o.setActiveThemeId(Z)}}),o}getInstalledThemes(){return this.themes.slice()}activeThemeId$(){return this.subject}getActiveThemeId(){return this.activeThemeId}setActiveThemeId(t){this.activeThemeId=t,this.subject.next(t)}constructor(t){(0,k._)(this,"themes",void 0),(0,k._)(this,"activeThemeId",void 0),(0,k._)(this,"subject",void 0),this.themes=t,this.subject=new tt(void 0)}}var qe=n(9850),Pt=n.n(qe),$t=n(12782),Qt=n.n($t);const Xt=/^[a-z][a-z0-9]*(?:[-_][a-z][a-z0-9]*)*$/i;function an(i){return typeof i=="object"&&i!==null&&!Array.isArray(i)}function ne(i){if(i===null)return"null";if(Array.isArray(i))return"array";const t=typeof i;return t==="number"&&isNaN(i)?"nan":t==="string"&&i===""?"empty-string":t}const te={type(i,t,o,a){return`Invalid type in config for key '${i}' in '${t}', got ${o}, wanted ${a}`},missing(i){return`Missing required config value at '${i}'`},convert(i,t,o){return`Unable to convert config value for key '${i}' in '${t}' to a ${o}`}};class Y{static fromConfigs(t){return t.length===0?new Y(void 0):t.reduce((o,{data:a,context:d,filteredKeys:b,deprecatedKeys:B})=>{const Z=new Y(a,d,o);if(Z.filteredKeys=b,B)for(const{key:oe,description:me}of B)console.warn(`The configuration key '${oe}' of ${d} is deprecated and may be removed soon. ${me||""}`);return Z},void 0)}has(t){var o;if(this.readValue(t)!==void 0)return!0;var d;return(d=(o=this.fallback)===null||o===void 0?void 0:o.has(t))!==null&&d!==void 0?d:!1}keys(){var t;const o=this.data?Object.keys(this.data):[];var a;const d=(a=(t=this.fallback)===null||t===void 0?void 0:t.keys())!==null&&a!==void 0?a:[];return[...new Set([...o,...d])]}get(t){const o=this.getOptional(t);if(o===void 0)throw new Error(te.missing(this.fullKey(t!=null?t:"")));return o}getOptional(t){var o;const a=Pt()(this.readValue(t)),d=(o=this.fallback)===null||o===void 0?void 0:o.getOptional(t);if(a===void 0){if(!1)var b;return d}else if(d===void 0)return a;return Qt()({},{value:d},{value:a},(B,Z)=>!an(Z)||!an(B)?Z:void 0).value}getConfig(t){const o=this.getOptionalConfig(t);if(o===void 0)throw new Error(te.missing(this.fullKey(t)));return o}getOptionalConfig(t){var o;const a=this.readValue(t),d=(o=this.fallback)===null||o===void 0?void 0:o.getOptionalConfig(t);if(an(a))return this.copy(a,t,d);if(a!==void 0)throw new TypeError(te.type(this.fullKey(t),this.context,ne(a),"object"));return d}getConfigArray(t){const o=this.getOptionalConfigArray(t);if(o===void 0)throw new Error(te.missing(this.fullKey(t)));return o}getOptionalConfigArray(t){const o=this.readConfigValue(t,d=>{if(!Array.isArray(d))return{expected:"object-array"};for(const[b,B]of d.entries())if(!an(B))return{expected:"object-array",value:B,key:`${t}[${b}]`};return!0});if(!o){if(!1)var a;return}return o.map((d,b)=>this.copy(d,`${t}[${b}]`))}getNumber(t){const o=this.getOptionalNumber(t);if(o===void 0)throw new Error(te.missing(this.fullKey(t)));return o}getOptionalNumber(t){const o=this.readConfigValue(t,d=>typeof d=="number"||typeof d=="string"||{expected:"number"});if(typeof o=="number"||o===void 0)return o;const a=Number(o);if(!Number.isFinite(a))throw new Error(te.convert(this.fullKey(t),this.context,"number"));return a}getBoolean(t){const o=this.getOptionalBoolean(t);if(o===void 0)throw new Error(te.missing(this.fullKey(t)));return o}getOptionalBoolean(t){const o=this.readConfigValue(t,d=>typeof d=="boolean"||typeof d=="number"||typeof d=="string"||{expected:"boolean"});if(typeof o=="boolean"||o===void 0)return o;const a=String(o).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(te.convert(this.fullKey(t),this.context,"boolean"))}getString(t){const o=this.getOptionalString(t);if(o===void 0)throw new Error(te.missing(this.fullKey(t)));return o}getOptionalString(t){return this.readConfigValue(t,o=>typeof o=="string"&&o!==""||{expected:"string"})}getStringArray(t){const o=this.getOptionalStringArray(t);if(o===void 0)throw new Error(te.missing(this.fullKey(t)));return o}getOptionalStringArray(t){return this.readConfigValue(t,o=>{if(!Array.isArray(o))return{expected:"string-array"};for(const[a,d]of o.entries())if(typeof d!="string"||d==="")return{expected:"string-array",value:d,key:`${t}[${a}]`};return!0})}fullKey(t){return`${this.prefix}${this.prefix?".":""}${t}`}copy(t,o,a){const d=new Y(t,this.context,a,this.fullKey(o));return d.filteredKeys=this.filteredKeys,d}readConfigValue(t,o){const a=this.readValue(t);if(a===void 0){var d;if(!1)var b;return(d=this.fallback)===null||d===void 0?void 0:d.readConfigValue(t,o)}const B=o(a);if(B!==!0){const{key:Z=t,value:oe=a,expected:me}=B;throw new TypeError(te.type(this.fullKey(Z),this.context,ne(oe),me))}return a}readValue(t){const o=t?t.split("."):[];for(const d of o)if(!Xt.test(d))throw new TypeError(`Invalid config key '${t}'`);if(this.data===void 0)return;let a=this.data;for(const[d,b]of o.entries())if(an(a))a=a[b];else if(a!==void 0){const B=this.fullKey(o.slice(0,d).join("."));throw new TypeError(te.type(B,this.context,ne(a),"object"))}return a}constructor(t,o="mock-config",a,d=""){(0,k._)(this,"data",void 0),(0,k._)(this,"context",void 0),(0,k._)(this,"fallback",void 0),(0,k._)(this,"prefix",void 0),(0,k._)(this,"filteredKeys",void 0),(0,k._)(this,"notifiedFilteredKeys",void 0),this.data=t,this.context=o,this.fallback=a,this.prefix=d,this.notifiedFilteredKeys=new Set}}const v="Invalid discovery URL pattern,";class O{static compile(t){const o=t.split(/\{\{\s*pluginId\s*\}\}/),a=o.join("pluginId");let d;try{d=new URL(a)}catch{throw new Error(`${v} URL '${a}' is invalid`)}if(d.hash)throw new Error(`${v} URL must not have a hash`);if(d.search)throw new Error(`${v} URL must not have a query`);if(a.endsWith("/"))throw new Error(`${v} URL must not end with a slash`);return new O(o)}async getBaseUrl(t){return this.parts.join(encodeURIComponent(t))}constructor(t){(0,k._)(this,"parts",void 0),this.parts=t}}class M{post(t,o){var a;return!((a=o)===null||a===void 0)&&a.hidden||this.alertApi.post({message:t.message,severity:"error"}),this.errorApi.post(t,o)}error$(){return this.errorApi.error$()}constructor(t,o){(0,k._)(this,"alertApi",void 0),(0,k._)(this,"errorApi",void 0),this.alertApi=t,this.errorApi=o}}class G{post(t,o){this.subject.next({error:t,context:o})}error$(){return this.subject}constructor(){(0,k._)(this,"subject",new ht)}}class ue{static forward(t,o){window.addEventListener("unhandledrejection",a=>{t.post(a.reason,o)})}}function be(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 ke{registerFlag(t){be(t.name),this.registeredFeatureFlags.push(t)}getRegisteredFlags(){return this.registeredFeatureFlags.slice()}isActive(t){return this.flags||(this.flags=this.load()),this.flags.get(t)===m.CL.Active}save(t){this.flags||(this.flags=this.load()),t.merge||this.flags.clear();for(const[a,d]of Object.entries(t.states))this.flags.set(a,d);const o=Array.from(this.flags.entries()).filter(([,a])=>a===m.CL.Active);window.localStorage.setItem("featureFlags",JSON.stringify(Object.fromEntries(o)))}load(){try{const t=window.localStorage.getItem("featureFlags");if(!t)return new Map;const o=JSON.parse(t);if(typeof o!="object"||o===null||Array.isArray(o))return new Map;const a=Object.entries(o).filter(([d,b])=>(be(d),b===m.CL.Active));return new Map(a)}catch{return new Map}}constructor(){(0,k._)(this,"registeredFeatureFlags",[]),(0,k._)(this,"flags",void 0)}}function Xe(i){let t=i.baseImplementation||n.g.fetch;var o;const a=[(o=i.middleware)!==null&&o!==void 0?o:[]].flat().reverse();for(const d of a)t=d.apply(t);return{fetch:t}}class nt{static create(t){var o,a;const d=yt(t),b=((o=t.header)===null||o===void 0?void 0:o.name)||"authorization",B=((a=t.header)===null||a===void 0?void 0:a.value)||(Z=>`Bearer ${Z}`);return new nt(t.identityApi,d,b,B)}apply(t){return async(o,a)=>{const d=new Request(o,a),{token:b}=await this.identityApi.getCredentials();return d.headers.get(this.headerName)||typeof b!="string"||!b||!this.allowUrl(d.url)?t(o,a):(d.headers.set(this.headerName,this.headerValue(b)),t(d))}}constructor(t,o,a,d){(0,k._)(this,"identityApi",void 0),(0,k._)(this,"allowUrl",void 0),(0,k._)(this,"headerName",void 0),(0,k._)(this,"headerValue",void 0),this.identityApi=t,this.allowUrl=o,this.headerName=a,this.headerValue=d}}function yt(i){return i.allowUrl?i.allowUrl:i.urlPrefixAllowlist?bt(i.urlPrefixAllowlist):i.config?bt([i.config.getString("backend.baseUrl")]):()=>!1}function bt(i){const t=i.map(o=>o.replace(/\/$/,""));return o=>t.some(a=>o===a||o.startsWith(`${a}/`))}function ct(i,t){return!t||t==="/"?i:`${i.replace(/\/$/,"")}/${t.replace(/^\//,"")}`}class Oe{apply(t){return async(o,a)=>{const d=new Request(o,a),b="plugin://";if(!d.url.startsWith(b))return t(o,a);const{hostname:B,pathname:Z,search:oe,hash:me,username:Me,password:Te}=new URL(`http://${d.url.substring(b.length)}`);let Fe=await this.discoveryApi.getBaseUrl(B);if(Me||Te){const st=new URL(Fe),tn=`${Me}${Te?`:${Te}`:""}@`;Fe=`${st.protocol}//${tn}${st.host}${st.pathname}`}const Je=`${ct(Fe,Z)}${oe}${me}`;return t(Je,typeof o=="string"||wt(o)?a:o)}}constructor(t){(0,k._)(this,"discoveryApi",void 0),this.discoveryApi=t}}function wt(i){var t;return typeof i=="object"&&((t=i)===null||t===void 0?void 0:t.constructor)===URL}class _t{static resolvePluginProtocol(t){return new Oe(t.discoveryApi)}static injectIdentityAuth(t){return nt.create(t)}constructor(){}}function jt(i,t){for(const o of t)if(!i.has(o))return!1;return!0}function Ft(i,...t){const o=new Set(i);for(const a of t)for(const d of a)o.add(d);return o}class qt{request(t){return new Promise((o,a)=>{this.requests.push({scopes:t,resolve:o,reject:a}),this.subject.next(this.getCurrentPending())})}resolve(t,o){this.requests=this.requests.filter(a=>jt(t,a.scopes)?(a.resolve(o),!1):!0),this.subject.next(this.getCurrentPending())}reject(t){this.requests.forEach(o=>o.reject(t)),this.requests=[],this.subject.next(this.getCurrentPending())}pending(){return this.subject}getCurrentPending(){const t=this.requests.length===0?void 0:this.requests.slice(1).reduce((o,a)=>Ft(o,a.scopes),this.requests[0].scopes);return{scopes:t,resolve:o=>{t&&this.resolve(t,o)},reject:o=>{t&&this.reject(o)}}}constructor(){(0,k._)(this,"requests",[]),(0,k._)(this,"subject",new tt(this.getCurrentPending()))}}class jn{createAuthRequester(t){const o=new qt,a=this.handlerCount;return this.handlerCount++,o.pending().subscribe({next:d=>{const b=this.currentRequests.slice(),B=this.makeAuthRequest(d,t);B?b[a]=B:delete b[a],this.currentRequests=b,this.subject.next(b.filter(Boolean))}}),d=>o.request(d)}makeAuthRequest(t,o){const{scopes:a}=t;if(a)return{provider:o.provider,trigger:async()=>{const d=await o.onAuthRequest(a);t.resolve(d)},reject:()=>{const d=new Error("Login failed, rejected by user");d.name="RejectedError",t.reject(d)}}}authRequest$(){return this.subject}constructor(){(0,k._)(this,"subject",new tt([])),(0,k._)(this,"currentRequests",[]),(0,k._)(this,"handlerCount",0)}}const Bt=new Map;class mt{static create(t){var o;return new mt((o=t.namespace)!==null&&o!==void 0?o:"",t.errorApi)}static addStorageEventListener(){window.addEventListener("storage",t=>{for(const[a,d]of Bt.entries()){var o;!((o=t.key)===null||o===void 0)&&o.startsWith(a)&&d.handleStorageChange(t.key)}})}get(t){return this.snapshot(t).value}snapshot(t){let o,a="absent";try{const d=localStorage.getItem(this.getKeyName(t));d&&(o=JSON.parse(d,(b,B)=>(typeof B=="object"&&B!==null&&Object.freeze(B),B)),a="present")}catch{this.errorApi.post(new Error(`Error when parsing JSON config from storage for: ${t}`))}return{key:t,value:o,presence:a}}forBucket(t){const o=`${this.namespace}/${t}`;return Bt.has(o)||Bt.set(o,new mt(o,this.errorApi)),Bt.get(o)}async set(t,o){localStorage.setItem(this.getKeyName(t),JSON.stringify(o)),this.notifyChanges(t)}async remove(t){localStorage.removeItem(this.getKeyName(t)),this.notifyChanges(t)}observe$(t){return mt.hasSubscribed||(mt.addStorageEventListener(),mt.hasSubscribed=!0),this.observable.filter(({key:o})=>o===t)}handleStorageChange(t){var o,a;if(!(!((o=t)===null||o===void 0)&&o.startsWith(this.namespace)))return;const d=(a=t)===null||a===void 0?void 0:a.slice(`${this.namespace}/`.length);d.includes("/")||this.notifyChanges(decodeURIComponent(d))}getKeyName(t){return`${this.namespace}/${encodeURIComponent(t)}`}notifyChanges(t){const o=this.snapshot(t);for(const a of this.subscribers)a.next(o)}constructor(t,o){(0,k._)(this,"namespace",void 0),(0,k._)(this,"errorApi",void 0),(0,k._)(this,"subscribers",void 0),(0,k._)(this,"observable",void 0),this.namespace=t,this.errorApi=o,this.subscribers=new Set,this.observable=new($e())(a=>(this.subscribers.add(a),()=>{this.subscribers.delete(a)}))}}(0,k._)(mt,"hasSubscribed",!1);const Lt=(0,W.createContext)(void 0);function Mt(){const[i]=(0,V.is)((0,p.jsx)(V.AW,{index:!0,element:(0,p.jsx)("div",{})}));return!i.index}var en=n(84800);const pr=(i,t)=>{try{var o,a,d,b;const Z=(o=(0,en.fp)(t,{pathname:i}))===null||o===void 0?void 0:o.filter(Fe=>{var Je,st;return((st=Fe)===null||st===void 0||(Je=st.route.routeRefs)===null||Je===void 0?void 0:Je.size)>0}).pop(),oe=(a=Z)===null||a===void 0?void 0:a.route;if(!oe)return;let me;oe.routeRefs.size===1&&(me=oe.routeRefs.values().next().value);let Me;oe.plugins.size===1&&(Me=oe.plugins.values().next().value);const Te=Object.entries(((d=Z)===null||d===void 0?void 0:d.params)||{}).reduce((Fe,[Je,st])=>(st!==void 0&&(Fe[Je]=st),Fe),{});return{extension:"App",pluginId:((b=Me)===null||b===void 0?void 0:b.getId())||"root",...me?{routeRef:me.id}:{},_routeNodeType:oe.element,params:Te}}catch{return}},fr=({pathname:i,search:t,hash:o,attributes:a})=>{const d=(0,m.z$)();return(0,W.useEffect)(()=>{d.captureEvent("navigate",`${i}${t}${o}`,{attributes:a})},[d,i,t,o,a]),null},_n=({routeObjects:i})=>{const{pathname:t,search:o,hash:a}=(0,V.TH)(),{params:d,...b}=pr(t,i)||{params:{}};return(0,p.jsx)(m.fC,{attributes:b,children:(0,p.jsx)(fr,{pathname:t,search:o,hash:a,attributes:d})})};function yn(i){return Mt()?Mn(i):""}function Mn(i){var t;let{pathname:o}=new URL((t=i.getOptionalString("app.baseUrl"))!==null&&t!==void 0?t:"/","http://sample.dev");return o=o.replace(/\/*$/,""),o}function gr({component:i,appIdentityProxy:t,children:o}){const[a,d]=(0,W.useState)(),b=(0,m.h_)(m.Ds),B=yn(b);return a?(t.setTarget(a,{signOutTargetUrl:B||"/"}),(0,p.jsx)(p.Fragment,{children:o})):(0,p.jsx)(i,{onSignInSuccess:d})}function Nr(i){const{Router:t,SignInPage:o}=(0,m.qD)().getComponents(),a=(0,m.h_)(m.Ds),d=Mn(a),b=`${d}/*`,B=(0,W.useContext)(Lt);if(!B)throw new Error("AppRouter must be rendered within the AppProvider");const{routeObjects:Z,appIdentityProxy:oe}=B;return o?Mt()?(0,p.jsxs)(t,{children:[(0,p.jsx)(_n,{routeObjects:Z}),(0,p.jsx)(gr,{component:o,appIdentityProxy:oe,children:(0,p.jsx)(V.Z5,{children:(0,p.jsx)(V.AW,{path:b,element:(0,p.jsx)(p.Fragment,{children:i.children})})})})]}):(0,p.jsxs)(t,{basename:d,children:[(0,p.jsx)(_n,{routeObjects:Z}),(0,p.jsx)(gr,{component:o,appIdentityProxy:oe,children:i.children})]}):(oe.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:d||"/"}),Mt()?(0,p.jsxs)(t,{children:[(0,p.jsx)(_n,{routeObjects:Z}),(0,p.jsx)(V.Z5,{children:(0,p.jsx)(V.AW,{path:b,element:(0,p.jsx)(p.Fragment,{children:i.children})})})]}):(0,p.jsxs)(t,{basename:d,children:[(0,p.jsx)(_n,{routeObjects:Z}),i.children]}))}var zn=n(88412),Fr=n(50629),C=n(80956),c=n(64279);function S(i){const t={};for(const a in i.collectors)i.collectors.hasOwnProperty(a)&&(t[a]=i.collectors[a]());const o=[{node:W.Children.toArray(i.root),parent:void 0,contexts:{}}];for(;o.length!==0;){const{node:a,parent:d,contexts:b}=o.shift();W.Children.forEach(a,B=>{if(!(0,W.isValidElement)(B))return;const Z={};for(const oe in t)if(t.hasOwnProperty(oe)){const me=t[oe];Z[oe]=me.visit(me.accumulator,B,d,b[oe])}for(const oe of i.discoverers){const me=oe(B);me&&o.push({node:me,parent:B,contexts:Z})}})}return Object.fromEntries(Object.entries(t).map(([a,d])=>[a,d.accumulator]))}function E(i,t){return()=>({accumulator:i(),visit:t})}function J(i){var t;return(t=i.props)===null||t===void 0?void 0:t.children}function ye(i){var t,o;if(!((t=i.props)===null||t===void 0)&&t.path&&(!((o=i.props)===null||o===void 0)&&o.element)){var a;return(a=i.props)===null||a===void 0?void 0:a.element}}const je=E(()=>new Set,(i,t)=>{const o=(0,m.IY)(t,"core.plugin");o&&i.add(o)}),De=i=>{const{children:t}=i,o=(0,m.h_)(m.W0),a="with"in i?o.isActive(i.with):!o.isActive(i.without);return(0,p.jsx)(p.Fragment,{children:a?t:null})};(0,m.R5)(De,"core.featureFlagged",!0);const et={caseSensitive:!1,path:"*",element:"match-all",routeRefs:new Set,plugins:new Set};function Gt(i){var t;const o=i;if(!((t=o)===null||t===void 0)&&t.type){var a,d;return(d=(a=o.type.displayName)!==null&&a!==void 0?a:o.type.name)!==null&&d!==void 0?d:String(o.type)}return String(o)}const xn=i=>{const t=new Set;return i&&t.add(i),t};function qn(i,t=new Array){return W.Children.forEach(i,o=>{if(!(0,W.isValidElement)(o))return;const a=(0,m.IY)(o,"core.mountPoint");if(a){const d=(0,m.IY)(o,"core.plugin");t.push({routeRef:a,plugin:d})}qn(o.props.children,t)}),t}const mr=E(()=>({paths:new Map,parents:new Map,objects:new Array}),(i,t,o,a)=>{var d,b,B,Z,oe;if(!((d=a)===null||d===void 0)&&d.isElementAncestor)return a;if(((b=o)===null||b===void 0?void 0:b.props.element)===t)return{...a,isElementAncestor:!0};const me=(B=t.props)===null||B===void 0?void 0:B.path,Me=(0,m.IY)(t,"core.mountPoint");if(Me&&me)throw new Error(`Path property may not be set directly on a routable extension "${Gt(t)}"`);var Te;const Fe=(Te=(oe=a)===null||oe===void 0||(Z=oe.obj)===null||Z===void 0?void 0:Z.children)!==null&&Te!==void 0?Te:i.objects;if(me!==void 0){if(typeof me!="string")throw new Error(`Element path must be a string at "${Gt(t)}"`);const Pn=me.startsWith("/")?me.slice(1):me,Jr=t.props.element;if((0,m.IY)(t,"core.gatherMountPoints")){var Je,st,tn;if(Jr)throw new Error(`Mount point gatherers may not have an element prop "${Gt(t)}"`);const bo={path:Pn,element:"gathered",routeRefs:new Set,caseSensitive:Boolean((Je=t.props)===null||Je===void 0?void 0:Je.caseSensitive),children:[et],plugins:new Set};return Fe.push(bo),{obj:bo,gatherPath:Pn,routeRef:(st=a)===null||st===void 0?void 0:st.routeRef,gatherRouteRef:(tn=a)===null||tn===void 0?void 0:tn.routeRef}}if(Jr){var Vt,rr,Mr,hr;const[bo,...pa]=qn(Jr);if(pa.length>0)throw new Error(`Route element with path "${me}" may not contain multiple routable extensions`);if(!bo)return a;const{routeRef:io,plugin:fa}=bo,vs={path:Pn,element:"mounted",routeRefs:new Set([io]),caseSensitive:Boolean((Vt=t.props)===null||Vt===void 0?void 0:Vt.caseSensitive),children:[et],plugins:xn(fa)};return Fe.push(vs),i.paths.set(io,Pn),i.parents.set(io,(rr=a)===null||rr===void 0?void 0:rr.routeRef),{obj:vs,routeRef:io!=null?io:(Mr=a)===null||Mr===void 0?void 0:Mr.routeRef,gatherPath:Pn,gatherRouteRef:(hr=a)===null||hr===void 0?void 0:hr.gatherRouteRef}}}if(Me){var br,Sr,Fn,Pr;if(((br=a)===null||br===void 0?void 0:br.gatherPath)===void 0)throw new Error(`Routable extension "${Gt(t)}" with mount point "${Me}" must be assigned a path`);(Fn=a)===null||Fn===void 0||(Sr=Fn.obj)===null||Sr===void 0||Sr.routeRefs.add(Me);const Pn=(0,m.IY)(t,"core.plugin");if(Pn){var Lr,Or;(Or=a)===null||Or===void 0||(Lr=Or.obj)===null||Lr===void 0||Lr.plugins.add(Pn)}return i.paths.set(Me,a.gatherPath),i.parents.set(Me,(Pr=a)===null||Pr===void 0?void 0:Pr.gatherRouteRef),{...a,routeRef:Me}}return a}),jr=E(()=>({paths:new Map,parents:new Map,objects:new Array}),(i,t,o,a)=>{var d,b,B,Z,oe,me,Me,Te,Fe;if(((d=o)===null||d===void 0?void 0:d.props.element)===t)return a;let Je=(b=a)===null||b===void 0?void 0:b.obj,st=(B=a)===null||B===void 0?void 0:B.routeRef,tn=(Z=a)===null||Z===void 0?void 0:Z.sticky;const Vt=(oe=t.props)===null||oe===void 0?void 0:oe.path;var rr;const Mr=(rr=(me=Je)===null||me===void 0?void 0:me.children)!==null&&rr!==void 0?rr:i.objects,hr=Boolean((Me=t.props)===null||Me===void 0?void 0:Me.caseSensitive);let br=(Te=a)===null||Te===void 0?void 0:Te.path;if((0,m.IY)(t,"core.gatherMountPoints")){if(!Vt)throw new Error("Mount point gatherer must have a path");br=Vt}const Sr=(Fe=t.props)===null||Fe===void 0?void 0:Fe.element;let Fn=(0,m.IY)(t,"core.mountPoint");if(!Fn&&(0,W.isValidElement)(Sr)&&(Fn=(0,m.IY)(Sr,"core.mountPoint")),Fn){let Jr=Vt;if(br&&(Jr?br=void 0:Jr=br),!Jr)throw new Error("Mounted routable extension must have a path");if(i.paths.set(Fn,Jr),st&&tn?(i.parents.set(Fn,st),Vt&&(st=Fn,tn=!1)):(i.parents.set(Fn,st),st=Fn),Vt)Je={caseSensitive:hr,path:Vt,element:"mounted",routeRefs:new Set([Fn]),children:[et],plugins:xn((0,m.IY)(t.props.element,"core.plugin"))},Mr.push(Je);else{var Pr;(Pr=Je)===null||Pr===void 0||Pr.routeRefs.add(Fn)}}if((0,m.IY)(t,"core.gatherMountPoints")&&(tn=!0),(0,m.IY)(t,"core.gatherMountPoints")){if(!Vt)throw new Error("Mount point gatherer must have a path");if(!Fn){var Or,Pn;Je={caseSensitive:hr,path:Vt,element:"gathered",routeRefs:new Set,children:[et],plugins:((Pn=a)===null||Pn===void 0||(Or=Pn.obj)===null||Or===void 0?void 0:Or.plugins)||new Set},Mr.push(Je)}}return{obj:Je,path:br,routeRef:st,sticky:tn}}),bn=E(()=>new Set,(i,t)=>{if(t.type===De){const o=t.props;i.add("with"in o?o.with:o.without)}}),Wr=(0,xt.uW)("route-ref-type",()=>Symbol("route-ref-type"));function lo(i){return i[Wr]==="absolute"}function Co(i){return i[Wr]==="sub"}function Ss(i){return i[Wr]==="external"}function Vr(...i){const t=i.join("/").replace(/\/\/+/g,"/");return t!=="/"&&t.endsWith("/")?t.slice(0,-1):t}function Vo(i,t,o){let a,d="";if(lo(i))a=i;else if(Co(i))a=i.parent,d=i.path;else if(Ss(i)){const Z=o.get(i);if(!Z)return[void 0,""];if(lo(Z))a=Z;else if(Co(Z))a=Z.parent,d=Z.path;else throw new Error(`ExternalRouteRef was bound to invalid target, ${Z}`)}else throw i[Wr]?new Error(`Unknown or invalid route ref type, ${i[Wr]}`):new Error(`Unknown object passed to useRouteRef, got ${i}`);if(!a)return[void 0,""];const b=t.get(a);if(b===void 0)return[void 0,""];const B=Vr(b,d);return[a,B]}function Cs(i,t,o,a,d){var b;const B=(b=(0,en.fp)(d,t))!==null&&b!==void 0?b:[],Z=Array();let oe=-1;for(let Te=i;Te&&(oe=B.findIndex(Fe=>Fe.route.routeRefs.has(Te)),oe===-1);Te=a.get(Te))Z.unshift(Te);Z.length===0&&(oe-=1);const me=oe===-1?"":B[oe].pathname,Me=Z.slice(0,-1).map(Te=>{const Fe=o.get(Te);if(Fe===void 0)throw new Error(`No path for ${Te}`);if(Fe.includes(":"))throw new Error(`Cannot route to ${i} with parent ${Te} as it has parameters`);return Fe});return`${Vr(me,...Me)}/`}class Ho{resolve(t,o){const[a,d]=Vo(t,this.routePaths,this.routeBindings);if(!a)return;let b;typeof o=="string"?b=this.trimPath(o):o.pathname?b={...o,pathname:this.trimPath(o.pathname)}:b=o;const B=this.appBasePath+Cs(a,b,this.routePaths,this.routeParents,this.routeObjects);return(...[oe])=>Vr(B,(0,en.Gn)(d,oe))}trimPath(t){return t&&(t.startsWith(this.appBasePath)?t.slice(this.appBasePath.length):t)}constructor(t,o,a,d,b){(0,k._)(this,"routePaths",void 0),(0,k._)(this,"routeParents",void 0),(0,k._)(this,"routeObjects",void 0),(0,k._)(this,"routeBindings",void 0),(0,k._)(this,"appBasePath",void 0),this.routePaths=t,this.routeParents=o,this.routeObjects=a,this.routeBindings=d,this.appBasePath=b}}const Go=(0,xt.CT)("routing-context"),Er=({routePaths:i,routeParents:t,routeObjects:o,routeBindings:a,basePath:d="",children:b})=>{const B=new Ho(i,t,o,a,d),Z=(0,xt.EI)({1:B});return(0,p.jsx)(Go.Provider,{value:Z,children:b})};function lr(i,t){const o=new Set(t.values());o.delete(void 0);for(const a of t.keys()){if(o.has(a))continue;let d=a,b="";for(;d;){const Z=i.get(d);if(Z===void 0)throw new Error(`No path for ${d}`);b=Vr(Z,b),d=t.get(d)}const B=b.match(/:(\w+)/g);if(B){for(let Z=0;Z<B.length;Z++)for(let oe=Z+1;oe<B.length;oe++)if(B[oe]===B[Z])throw new Error(`Parameter ${B[oe]} is duplicated in path ${b}`)}}}function Hr(i,t){for(const o of t)if(o.externalRoutes){for(const[a,d]of Object.entries(o.externalRoutes))if(!d.optional&&!i.has(d))throw new Error(`External route '${a}' of the '${o.getId()}' plugin must be bound to a target route. See https://backstage.io/link?bind-routes for details.`)}}const qr=(0,xt.CT)("app-context"),wo=({appContext:i,children:t})=>{const o=(0,xt.EI)({1:i});return(0,p.jsx)(qr.Provider,{value:o,children:t})};function jo(i){return new Error(`Tried to access IdentityApi ${i} before app was loaded`)}function Zr(i){console.warn(`WARNING: Call to ${i} is deprecated and will break in the future`)}class Ko{setTarget(t,o){this.target=t,this.signOutTargetUrl=o.signOutTargetUrl,this.resolveTarget(t)}getUserId(){if(!this.target)throw jo("getUserId");if(!this.target.getUserId)throw new Error("IdentityApi does not implement getUserId");return Zr("getUserId"),this.target.getUserId()}getProfile(){if(!this.target)throw jo("getProfile");if(!this.target.getProfile)throw new Error("IdentityApi does not implement getProfile");return Zr("getProfile"),this.target.getProfile()}async getProfileInfo(){return this.waitForTarget.then(t=>t.getProfileInfo())}async getBackstageIdentity(){const t=await this.waitForTarget.then(o=>o.getBackstageIdentity());return t.userEntityRef.match(/^.*:.*\/.*$/)||console.warn(`WARNING: The App IdentityApi provided an invalid userEntityRef, '${t.userEntityRef}'. It must be a full Entity Reference of the form '<kind>:<namespace>/<name>'.`),t}async getCredentials(){return this.waitForTarget.then(t=>t.getCredentials())}async getIdToken(){return this.waitForTarget.then(t=>{if(!t.getIdToken)throw new Error("IdentityApi does not implement getIdToken");return Zr("getIdToken"),t.getIdToken()})}async signOut(){await this.waitForTarget.then(t=>t.signOut()),window.location.href=this.signOutTargetUrl}constructor(){(0,k._)(this,"target",void 0),(0,k._)(this,"waitForTarget",void 0),(0,k._)(this,"resolveTarget",()=>{}),(0,k._)(this,"signOutTargetUrl","/"),this.waitForTarget=new Promise(t=>{this.resolveTarget=t})}}var Eo=n(72164);function Nn(i,t,o){if(i!==void 0){const d=o.find(b=>b.id===i);if(d)return d}if(t){const d=o.find(b=>b.variant==="dark");if(d)return d}const a=o.find(d=>d.variant==="light");return a||o[0]}const cr=()=>{const i=(0,W.useMemo)(()=>window.matchMedia("(prefers-color-scheme: dark)"),[]),[t,o]=(0,W.useState)(i.matches);return(0,W.useEffect)(()=>{const a=d=>{o(d.matches)};return i.addListener(a),()=>{i.removeListener(a)}},[i]),t};function Gr({children:i}){const t=(0,m.h_)(m.hg),o=(0,Eo.Z)(t.activeThemeId$(),t.getActiveThemeId()),a=Boolean(window.matchMedia)?cr():!1,d=Nn(o,a,t.getInstalledThemes());if(!d)throw new Error("App has no themes");return(0,p.jsx)(d.Provider,{children:i})}const Kr=async(i="__APP_INJECTED_RUNTIME_CONFIG__")=>{const t=[{context:"app-config.yaml",data:{app:{title:"Techdocs Preview App",baseUrl:"http://localhost:3000"},backend:{baseUrl:"http://localhost:3000"},techdocs:{builder:"external"}}}];if(!t)throw new Error("No static configuration provided");if(!Array.isArray(t))throw new Error("Static configuration has invalid format");const o=t.slice();if(i!=="__app_injected_runtime_config__".toLocaleUpperCase("en-US"))try{const d=JSON.parse(i);Array.isArray(d)?o.push(...d):o.push({data:d,context:"env"})}catch(d){throw new Error(`Failed to load runtime configuration, ${d}`)}const a=window.__APP_CONFIG__;return a&&o.push({context:"window",data:a}),o};class Yo{add(t,o){return this.apis.push([t.id,o]),o}build(){return new vr(new Map(this.apis))}constructor(){(0,k._)(this,"apis",[])}}class vr{static builder(){return new Yo}static from(t){return new vr(new Map(t.map(([o,a])=>[o.id,a])))}static with(t,o){return new vr(new Map([[t.id,o]]))}with(t,o){return new vr(new Map([...this.apis,[t.id,o]]))}get(t){return this.apis.get(t.id)}constructor(t){(0,k._)(this,"apis",void 0),this.apis=t}}function Ao(i){const t=new Map;return i&&i({bind:(a,d)=>{for(const[b,B]of Object.entries(d)){const Z=a[b];if(!Z)throw new Error(`Key ${b} is not an existing external route`);if(!B&&!Z.optional)throw new Error(`External route ${b} is required but was undefined`);B&&t.set(Z,B)}}}),t}function To(i){const t=new URL(i);return t.protocol=document.location.protocol,t.hostname=document.location.hostname,t.port=document.location.port,t.toString().replace(/\/$/,"")}function Ro(i,t,o){var a;const d=Boolean(i),b=(0,c.default)(i||(()=>Promise.resolve([])));let B;if(d&&b.loading){const{Progress:me}=t;B=(0,p.jsx)(me,{})}else if(b.error){const{BootErrorPage:me}=t;B=(0,p.jsx)(me,{step:"load-config",error:b.error})}const{ThemeProvider:Z=Gr}=t;if(B)return{node:(0,p.jsx)(Ut,{apis:vr.with(m.hg,o),children:(0,p.jsx)(Z,{children:B})})};let oe;if(!((a=b.value)===null||a===void 0)&&a.length){const me=Y.fromConfigs(b.value),Me=me.getOptionalString("app.baseUrl"),Te=me.getOptionalString("backend.baseUrl");let Fe=b.value;const Je={data:{},context:"relative-resolver"};if(Me&&Te){const st=new URL(Me).origin,tn=new URL(Te).origin;if(st===tn){const Vt=To(Te);Te!==Vt&&(Je.data.backend={baseUrl:Vt})}}if(Me){const st=To(Me);Me!==st&&(Je.data.app={baseUrl:st})}Object.keys(Je.data).length&&(Fe=Fe.concat([Je])),oe=Y.fromConfigs(Fe)}else oe=Y.fromConfigs([]);return{api:oe}}class Ur{getPlugins(){return this.app.getPlugins()}getSystemIcon(t){return this.app.getSystemIcon(t)}getSystemIcons(){return this.app.getSystemIcons()}getComponents(){return this.app.getComponents()}constructor(t){(0,k._)(this,"app",void 0),this.app=t}}var Io=new WeakMap;class Jo{getPlugins(){return Array.from(this.plugins)}getSystemIcon(t){return this.icons[t]}getSystemIcons(){return this.icons}getComponents(){return this.components}createRoot(t){const o=this.getProvider();return()=>(0,p.jsx)(o,{children:t})}getProvider(){if((0,zn._)(this,Io))throw new Error("app.getProvider() or app.createRoot() has already been called, and can only be called once");(0,C._)(this,Io,!0);const t=new Ur(this);let o=!1;return({children:d})=>{const b=(0,W.useRef)(!0),B=(0,W.useMemo)(()=>Ue.createWithStorage(this.themes),[]),{routing:Z,featureFlags:oe,routeBindings:me}=(0,W.useMemo)(()=>{const Je=S({root:d,discoverers:[J,ye],collectors:{routing:Mt()?jr:mr,collectedPlugins:je,featureFlags:bn}});return Je.collectedPlugins.forEach(st=>this.plugins.add(st)),this.verifyPlugins(this.plugins),this.getApiHolder(),{...Je,routeBindings:Ao(this.bindRoutes)}},[d]);o||(o=!0,lr(Z.paths,Z.parents),Hr(me,this.plugins));const Me=Ro(this.configLoader,this.components,B),Te="api"in Me;if(Te){const{api:Je}=Me;this.configApi=Je}if("node"in Me)return Me.node;if(Te&&b.current){b.current=!1;const Je=this.getApiHolder().get(m.W0);if(Je){for(const Vt of this.featureFlags)Je.registerFlag({...Vt,pluginId:""});for(const Vt of this.plugins.values())if("getFeatureFlags"in Vt)for(const rr of Vt.getFeatureFlags())Je.registerFlag({name:rr.name,pluginId:Vt.getId()});else for(const rr of Vt.output())rr.type==="feature-flag"&&Je.registerFlag({name:rr.name,pluginId:Vt.getId()});const st=Je.getRegisteredFlags(),tn=new Set(st.map(Vt=>Vt.name));for(const Vt of oe)tn.has(Vt)||Je.registerFlag({name:Vt,pluginId:""})}}const{ThemeProvider:Fe=Gr}=this.components;return(0,p.jsx)(Ut,{apis:this.getApiHolder(),children:(0,p.jsx)(wo,{appContext:t,children:(0,p.jsx)(Fe,{children:(0,p.jsx)(Er,{routePaths:Z.paths,routeParents:Z.parents,routeObjects:Z.objects,routeBindings:me,basePath:yn(Me.api),children:(0,p.jsx)(Lt.Provider,{value:{routeObjects:Z.objects,appIdentityProxy:this.appIdentityProxy},children:d})})})})})}}getRouter(){return Nr}getApiHolder(){if(this.apiHolder){for(const t of this.plugins)for(const o of t.getApis())this.apiFactoryRegistry.get(o.api)||this.apiFactoryRegistry.register("default",o);return Tt.validateFactories(this.apiFactoryRegistry,this.apiFactoryRegistry.getAllApis()),this.apiHolder}this.apiFactoryRegistry.register("static",{api:m.hg,deps:{},factory:()=>Ue.createWithStorage(this.themes)}),this.apiFactoryRegistry.register("static",{api:m.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:m.$4,deps:{},factory:()=>this.appIdentityProxy}),this.apiFactoryRegistry.register("default",{api:m.W0,deps:{},factory:()=>new ke});for(const t of this.defaultApis)this.apiFactoryRegistry.register("default",t);for(const t of this.plugins)for(const o of t.getApis())if(!this.apiFactoryRegistry.register("default",o))throw new Error(`Plugin ${t.getId()} tried to register duplicate or forbidden API factory for ${o.api}`);for(const t of this.apis)if(!this.apiFactoryRegistry.register("app",t))throw new Error(`Duplicate or forbidden API factory for ${t.api} in app`);return Tt.validateFactories(this.apiFactoryRegistry,this.apiFactoryRegistry.getAllApis()),this.apiHolder=new Tt(this.apiFactoryRegistry),this.apiHolder}verifyPlugins(t){const o=new Set;for(const a of t){const d=a.getId();if(o.has(d))throw new Error(`Duplicate plugin found '${d}'`);o.add(d)}}constructor(t){(0,k._)(this,"apiHolder",void 0),(0,k._)(this,"configApi",void 0),(0,k._)(this,"apis",void 0),(0,k._)(this,"icons",void 0),(0,k._)(this,"plugins",void 0),(0,k._)(this,"featureFlags",void 0),(0,k._)(this,"components",void 0),(0,k._)(this,"themes",void 0),(0,k._)(this,"configLoader",void 0),(0,k._)(this,"defaultApis",void 0),(0,k._)(this,"bindRoutes",void 0),(0,k._)(this,"appIdentityProxy",new Ko),(0,k._)(this,"apiFactoryRegistry",void 0),(0,Fr._)(this,Io,{writable:!0,value:!1});var o;this.apis=(o=t.apis)!==null&&o!==void 0?o:[],this.icons=t.icons;var a;this.plugins=new Set((a=t.plugins)!==null&&a!==void 0?a:[]);var d;this.featureFlags=(d=t.featureFlags)!==null&&d!==void 0?d:[],this.components=t.components,this.themes=t.themes;var b;this.configLoader=(b=t.configLoader)!==null&&b!==void 0?b:Kr;var B;this.defaultApis=(B=t.defaultApis)!==null&&B!==void 0?B:[],this.bindRoutes=t.bindRoutes,this.apiFactoryRegistry=new Yt}}function co(i){return new Jo(i)}let Po=!1;const ws=i=>{const t=(0,m.qD)(),{NotFoundErrorPage:o}=t.getComponents(),a=(0,W.useMemo)(()=>Mt(),[]),b=[...(0,m.vJ)(i.children,B=>B.getElements().flatMap(Z=>{var oe;let me=Z.props.path;if(me==="")return[];var Me;me=(Me=(oe=me)===null||oe===void 0?void 0:oe.replace(/\/\*$/,""))!==null&&Me!==void 0?Me:"/";let Te=a?Z:Z.props.element;return!a&&!Te&&(Te=Z,Po||(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] />} />."),Po=!0)),[{path:me,element:Te,children:Z.props.children?[{path:me==="/"?"/":"*",element:Z.props.children}]:void 0}]}).sort((Z,oe)=>oe.path.localeCompare(Z.path)).map(Z=>({...Z,path:Z.path==="/"?"/":`${Z.path}/*`}))),{path:"*",element:(0,p.jsx)(o,{})}];return(0,V.V$)(b)},Lo=(0,m.T0)({id:"plugin.permission.api"});var dr;(function(i){i.DENY="DENY",i.ALLOW="ALLOW",i.CONDITIONAL="CONDITIONAL"})(dr||(dr={}));function ci(i,t){return i.name===t.name}function Qo(i,t){return"resourceType"in i?!t||i.resourceType===t:!1}function js(i){return i.attributes.action==="create"}function uo(i){return i.attributes.action==="read"}function eo(i){return i.attributes.action==="update"}function to(i){return i.attributes.action==="delete"}function no(i){return{authorize:async(t,o)=>await i.authorize(t,o),authorizeConditional(t,o){const a=t;return i.authorize(a,o)}}}function Ar({name:i,attributes:t,resourceType:o}){return o?{type:"resource",name:i,attributes:t,resourceType:o}:{type:"basic",name:i,attributes:t}}var er=n(23054),ho=n(96279),Xo=n.n(ho),Es=n(9571);const ro=_e.z.lazy(()=>_e.z.object({rule:_e.z.string(),resourceType:_e.z.string(),params:_e.z.record(_e.z.any()).optional()}).or(_e.z.object({anyOf:_e.z.array(ro).nonempty()})).or(_e.z.object({allOf:_e.z.array(ro).nonempty()})).or(_e.z.object({not:ro}))),_o=_e.z.object({result:_e.z.literal(dr.ALLOW).or(_e.z.literal(dr.DENY))}),As=_e.z.union([_e.z.object({result:_e.z.literal(dr.ALLOW).or(_e.z.literal(dr.DENY))}),_e.z.object({result:_e.z.literal(dr.CONDITIONAL),pluginId:_e.z.string(),resourceType:_e.z.string(),conditions:ro})]),qo=(i,t)=>_e.z.object({items:_e.z.array(_e.z.intersection(_e.z.object({id:_e.z.string()}),i)).refine(o=>o.length===t.size&&o.every(({id:a})=>t.has(a)),{message:"Items in response do not match request"})});class es{async authorize(t,o){return this.makeRequest(t,_o,o)}async authorizeConditional(t,o){return this.makeRequest(t,As,o)}async makeRequest(t,o,a){var d;if(!this.enabled)return t.map(Te=>({result:dr.ALLOW}));const b={items:t.map(Te=>({id:Es.Z(),...Te}))},B=await this.discovery.getBaseUrl("permission"),Z=await Xo()(`${B}/authorize`,{method:"POST",body:JSON.stringify(b),headers:{...this.getAuthorizationHeader((d=a)===null||d===void 0?void 0:d.token),"content-type":"application/json"}});if(!Z.ok)throw await er.VL.fromResponse(Z);const oe=await Z.json(),Me=qo(o,new Set(b.items.map(({id:Te})=>Te))).parse(oe).items.reduce((Te,Fe)=>(Te[Fe.id]=Fe,Te),{});return b.items.map(Te=>Me[Te.id])}getAuthorizationHeader(t){return t?{Authorization:`Bearer ${t}`}:{}}constructor(t){(0,k._)(this,"enabled",void 0),(0,k._)(this,"discovery",void 0),this.discovery=t.discovery;var o;this.enabled=(o=t.config.getOptionalBoolean("permission.enabled"))!==null&&o!==void 0?o:!1}}class po{static create(t){const{config:o,discovery:a,identity:d}=t,b=new es({discovery:a,config:o});return new po(b,d)}async authorize(t){return(await this.permissionClient.authorize([t],await this.identityApi.getCredentials()))[0]}constructor(t,o){(0,k._)(this,"permissionClient",void 0),(0,k._)(this,"identityApi",void 0),this.permissionClient=t,this.identityApi=o}}var Oo=n(69984);function fo(i){const t=(0,m.h_)(Lo),{data:o,error:a}=(0,Oo.ZP)(i,async d=>{if(Qo(d.permission)&&!d.resourceRef)return dr.DENY;const{result:b}=await t.authorize(d);return b});return a?{error:a,loading:!1,allowed:!1}:o===void 0?{loading:!0,allowed:!1}:{loading:!1,allowed:o===dr.ALLOW}}const Ts=i=>{const{permission:t,resourceRef:o,errorComponent:a,...d}=i,b=usePermission(isResourcePermission(t)?{permission:t,resourceRef:o}:{permission:t}),B=useApp(),{NotFoundErrorPage:Z}=B.getComponents();let oe=a===void 0?_jsx(Z,{}):a;return b.loading?oe=null:b.allowed&&(oe=i.element),_jsx(Route,{...d,element:oe})};function di(i){const{permission:t,resourceRef:o}=i,a=usePermission(isResourcePermission(t)?{permission:t,resourceRef:o}:{permission:t}),d=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:b}=d.getComponents();return _jsx(b,{})}const ts=[(0,m.ni)({api:m.NW,deps:{configApi:m.Ds},factory:({configApi:i})=>O.compile(`${i.getString("backend.baseUrl")}/api/{{ pluginId }}`)}),(0,m.ni)({api:m.$v,deps:{},factory:()=>new N}),(0,m.ni)({api:m.v_,deps:{},factory:()=>new le}),(0,m.ni)({api:m.VE,deps:{alertApi:m.$v},factory:({alertApi:i})=>{const t=new M(i,new G);return ue.forward(t,{hidden:!1}),t}}),(0,m.ni)({api:m.E6,deps:{errorApi:m.VE},factory:({errorApi:i})=>mt.create({errorApi:i})}),(0,m.ni)({api:m.gP,deps:{configApi:m.Ds,identityApi:m.$4,discoveryApi:m.NW},factory:({configApi:i,identityApi:t,discoveryApi:o})=>Xe({middleware:[_t.resolvePluginProtocol({discoveryApi:o}),_t.injectIdentityAuth({identityApi:t,config:i})]})}),(0,m.ni)({api:m.ZM,deps:{},factory:()=>new jn}),(0,m.ni)({api:m.Kp,deps:{discoveryApi:m.NW,oauthRequestApi:m.ZM,configApi:m.Ds},factory:({discoveryApi:i,oauthRequestApi:t,configApi:o})=>vn.create({configApi:o,discoveryApi:i,oauthRequestApi:t,environment:o.getOptionalString("auth.environment")})}),(0,m.ni)({api:m.p_,deps:{discoveryApi:m.NW,oauthRequestApi:m.ZM,configApi:m.Ds},factory:({discoveryApi:i,oauthRequestApi:t,configApi:o})=>sn.create({configApi:o,discoveryApi:i,oauthRequestApi:t,environment:o.getOptionalString("auth.environment")})}),(0,m.ni)({api:m.F4,deps:{discoveryApi:m.NW,oauthRequestApi:m.ZM,configApi:m.Ds},factory:({discoveryApi:i,oauthRequestApi:t,configApi:o})=>mn.create({configApi:o,discoveryApi:i,oauthRequestApi:t,defaultScopes:["read:user"],environment:o.getOptionalString("auth.environment")})}),(0,m.ni)({api:m.D,deps:{discoveryApi:m.NW,oauthRequestApi:m.ZM,configApi:m.Ds},factory:({discoveryApi:i,oauthRequestApi:t,configApi:o})=>wn.create({configApi:o,discoveryApi:i,oauthRequestApi:t,environment:o.getOptionalString("auth.environment")})}),(0,m.ni)({api:m.ux,deps:{discoveryApi:m.NW,oauthRequestApi:m.ZM,configApi:m.Ds},factory:({discoveryApi:i,oauthRequestApi:t,configApi:o})=>ln.create({configApi:o,discoveryApi:i,oauthRequestApi:t,environment:o.getOptionalString("auth.environment")})}),(0,m.ni)({api:m.gW,deps:{discoveryApi:m.NW,oauthRequestApi:m.ZM,configApi:m.Ds},factory:({discoveryApi:i,oauthRequestApi:t,configApi:o})=>Kn.create({configApi:o,discoveryApi:i,oauthRequestApi:t,environment:o.getOptionalString("auth.environment")})}),(0,m.ni)({api:m.bq,deps:{discoveryApi:m.NW,oauthRequestApi:m.ZM,configApi:m.Ds},factory:({discoveryApi:i,oauthRequestApi:t,configApi:o})=>Yn.create({configApi:o,discoveryApi:i,oauthRequestApi:t,defaultScopes:["team"],environment:o.getOptionalString("auth.environment")})}),(0,m.ni)({api:m.Km,deps:{discoveryApi:m.NW,oauthRequestApi:m.ZM,configApi:m.Ds},factory:({discoveryApi:i,oauthRequestApi:t,configApi:o})=>pe.create({configApi:o,discoveryApi:i,oauthRequestApi:t,defaultScopes:["REPO_READ"]})}),(0,m.ni)({api:m.uB,deps:{discoveryApi:m.NW,oauthRequestApi:m.ZM,configApi:m.Ds},factory:({discoveryApi:i,oauthRequestApi:t,configApi:o})=>H.create({configApi:o,discoveryApi:i,oauthRequestApi:t,environment:o.getOptionalString("auth.environment")})}),(0,m.ni)({api:Lo,deps:{discovery:m.NW,identity:m.$4,config:m.Ds},factory:({config:i,discovery:t,identity:o})=>po.create({config:i,discovery:t,identity:o})})];var ns=n(77277),cn=n(53974),Rs=n(71597);function y({children:i}){return(0,V.GV)()?(0,p.jsx)(p.Fragment,{children:i}):(0,p.jsx)(V.VA,{children:i})}const j=()=>(0,p.jsx)(cn.mf,{status:"404",statusMessage:"PAGE NOT FOUND"}),L=({step:i,error:t})=>{let o="";return i==="load-config"?o=`The configuration failed to load, someone should have a look at this error: ${t.message}`:i==="load-chunk"&&(o=`Lazy loaded chunk failed to load, try to reload the page: ${t.message}`),(0,p.jsx)(y,{children:(0,p.jsx)(cn.mf,{status:"501",statusMessage:o})})},P=({error:i,resetError:t,plugin:o})=>{var a;return(0,p.jsx)(cn.yu,{title:`Error in ${(a=o)===null||a===void 0?void 0:a.getId()}`,defaultExpanded:!0,error:i,children:(0,p.jsx)(ns.Z,{variant:"outlined",onClick:t,children:"Retry"})})},ae={Progress:cn.Ex,Router:Rs.VK,NotFoundErrorPage:j,BootErrorPage:L,ErrorBoundaryFallback:P};var re=n(43642),q=n(80079),he=n(90941),Ae=n(32915),Le=n(40562),ze=n(21853),Ne=n(60744),We=n(66569),it=n(30254),Et=n(13384),Be=n(15933),He=n(58838),At=n(86737),rn=n(4989),En=n(44407),Ot=n(18628),Rt=n(84219),Kt=n(98685),An=n(39781),ur=n(39412);const Tr={brokenImage:q.Z,catalog:Ot.Z,scaffolder:Ae.Z,techdocs:Le.Z,search:ze.Z,chat:Ne.Z,dashboard:We.Z,docs:it.Z,email:Et.Z,github:He.Z,group:Rt.Z,help:At.Z,"kind:api":Be.Z,"kind:component":En.Z,"kind:domain":re.Z,"kind:group":Rt.Z,"kind:location":rn.Z,"kind:system":he.Z,"kind:user":Kt.Z,"kind:resource":ur.Z,user:Kt.Z,warning:An.Z};var Yr=n(73689),Wn=n(77349);const fn={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")`},kn={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 yr(i){var t;const{colors:o,shape:a,options:d}=i,B=`linear-gradient(90deg, ${(o.length===1?[o[0],o[0]]:o).join(", ")})`,Z=`${a}, ${B}`;var oe;const me=(oe=(t=d)===null||t===void 0?void 0:t.fontColor)!==null&&oe!==void 0?oe:"#FFFFFF";return{colors:o,shape:a,backgroundImage:Z,fontColor:me}}const ui={home:yr({colors:kn.teal,shape:fn.wave}),documentation:yr({colors:kn.pinkSea,shape:fn.wave2}),tool:yr({colors:kn.purpleSky,shape:fn.round}),service:yr({colors:kn.marineBlue,shape:fn.wave}),website:yr({colors:kn.veryBlue,shape:fn.wave}),library:yr({colors:kn.rubyRed,shape:fn.wave}),other:yr({colors:kn.darkGrey,shape:fn.wave}),app:yr({colors:kn.toastyOrange,shape:fn.wave}),apis:yr({colors:kn.teal,shape:fn.wave2}),card:yr({colors:kn.greens,shape:fn.wave})},hi=16,xa='"Helvetica Neue", Helvetica, Roboto, Arial, sans-serif',pi="home";function Is(i){const{palette:t,htmlFontSize:o=hi,fontFamily:a=xa,defaultPageTheme:d=pi,pageTheme:b=ui,typography:B}=i;if(!b[d])throw new Error(`${d} is not defined in pageTheme.`);const Z={htmlFontSize:o,fontFamily:a,h1:{fontSize:54,fontWeight:700,marginBottom:10},h2:{fontSize:40,fontWeight:700,marginBottom:8},h3:{fontSize:32,fontWeight:700,marginBottom:6},h4:{fontWeight:700,fontSize:28,marginBottom:6},h5:{fontWeight:700,fontSize:24,marginBottom:4},h6:{fontWeight:700,fontSize:20,marginBottom:2}};var oe;return{palette:t,typography:B!=null?B:Z,page:b[d],getPageTheme:({themeId:me})=>(oe=b[me])!==null&&oe!==void 0?oe:b[d]}}var Ps=n(47591);const go={MuiCssBaseline:{styleOverrides:i=>({html:{height:"100%",fontFamily:i.typography.fontFamily},body:{height:"100%",fontFamily:i.typography.fontFamily,overscrollBehaviorY:"none",fontSize:"0.875rem",lineHeight:1.43},a:{color:"inherit",textDecoration:"none"}})},MuiGrid:{defaultProps:{spacing:2}},MuiSwitch:{defaultProps:{color:"primary"}},MuiTableRow:{styleOverrides:{root:({theme:i})=>({"&:nth-of-type(odd)":{backgroundColor:i.palette.background.default}}),hover:{"&:hover":{cursor:"pointer"}},head:({theme:i})=>({"&:nth-of-type(odd)":{backgroundColor:i.palette.background.paper}})}},MuiTableCell:{styleOverrides:{root:({theme:i})=>({wordBreak:"break-word",overflow:"hidden",verticalAlign:"middle",lineHeight:"1",margin:0,padding:i.spacing(3,2,3,2.5),borderBottom:0}),sizeSmall:({theme:i})=>({padding:i.spacing(1.5,2,1.5,2.5)}),head:({theme:i})=>({wordBreak:"break-word",overflow:"hidden",color:i.palette.textSubtle,fontWeight:"normal",lineHeight:"1"})}},MuiTabs:{styleOverrides:{root:{minHeight:24}}},MuiTab:{styleOverrides:{root:({theme:i})=>({color:i.palette.link,minHeight:24,textTransform:"initial",letterSpacing:"0.07em","&:hover":{color:(0,Ps._j)(i.palette.link,.3),background:(0,Ps.$n)(i.palette.link,.95)},[i.breakpoints.up("md")]:{minWidth:120,fontSize:i.typography.pxToRem(14),fontWeight:500}}),textColorPrimary:({theme:i})=>({color:i.palette.link})}},MuiTableSortLabel:{styleOverrides:{root:{color:"inherit","&:hover":{color:"inherit"},"&:focus":{color:"inherit"},"&.Mui-active":{fontWeight:"bold",color:"inherit"}}}},MuiListItemText:{styleOverrides:{dense:{whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"}}},MuiButton:{styleOverrides:{text:{padding:void 0}}},MuiChip:{styleOverrides:{root:({theme:i})=>({marginRight:i.spacing(1),marginBottom:i.spacing(1)}),label:({theme:i})=>({lineHeight:i.spacing(2.5),fontWeight:i.typography.fontWeightMedium,fontSize:i.spacing(1.75)}),labelSmall:({theme:i})=>({fontSize:i.spacing(1.5)}),deleteIcon:({theme:i})=>({width:i.spacing(3),height:i.spacing(3),margin:i.spacing(0,.75,0,-.75)}),deleteIconSmall:({theme:i})=>({width:i.spacing(2),height:i.spacing(2),margin:i.spacing(0,.5,0,-.5)})}},MuiCard:{styleOverrides:{root:{display:"flex",flexDirection:"column"}}},MuiCardHeader:{styleOverrides:{root:{paddingBottom:0}}},MuiCardContent:{styleOverrides:{root:{flexGrow:1,"&:last-child":{paddingBottom:void 0}}}},MuiCardActions:{styleOverrides:{root:{justifyContent:"flex-end"}}},MuiLink:{defaultProps:{underline:"hover"}}},oo=i=>(...t)=>{const o=t.length===0?[1]:t,a=(d,b)=>typeof d=="string"?d:b*d;return o.map(d=>{const b=a(d,i);return typeof b=="number"?`${b}px`:b}).join(" ")};function fi(i,t){if(!t||typeof t=="string")return;const o=typeof t=="function"?t(i):t;if(o)return{"@global":o}}function Ls(i,t){if(!(!t||typeof t=="string")){if(typeof t=="object"){const o={...i},a=i.spacing(1);return typeof a=="number"&&(o.spacing=oo(a)),Object.fromEntries(Object.entries(t).map(([d,b])=>typeof b=="function"?[d,b({theme:o})]:[d,b]))}return t}}const gi=/^&.Mui-([\w-]+)$/;function Os(i){let t=i;if(!i||typeof i!="object")return t;for(const o of Object.keys(i)){const a=i[o];if(!(!a||typeof a!="object"))for(const d of Object.keys(a)){const b=d,B=b.match(gi);if(B){const[,Z]=B,{[b]:oe,...me}=a;oe&&(t={...t,[o]:me,[Z]:oe})}}}return t}function rs(i,t={}){const o={},a={};for(const d of Object.keys(t)){const b=t[d];b&&("styleOverrides"in b&&(d==="MuiCssBaseline"?o[d]=fi(i,b.styleOverrides):o[d]=Os(Ls(i,b.styleOverrides))),"defaultProps"in b&&(a[d]=b.defaultProps))}return{overrides:o,props:a}}var mo=new WeakMap;class mi{getTheme(t){return(0,zn._)(this,mo).get(t)}constructor(t,o){(0,Fr._)(this,mo,{writable:!0,value:new Map}),(0,C._)(this,mo,new Map),t&&(0,zn._)(this,mo).set("v4",t),o&&(0,zn._)(this,mo).set("v5",o)}}function ks(i){const t=Is(i),o={...go,...i.components},a=(0,Wn.Z)({...t,components:o}),d=rs(a,o),b={...(0,Yr.Z)(t),...d};return new mi(b,a)}function vi(i){const t=adaptV4Theme(i),o=createTheme(i);return new mi(o,t)}const ko={light:{type:"light",mode:"light",background:{default:"#F8F8F8",paper:"#FFFFFF"},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:"#FFD600",navigation:{background:"#171717",indicator:"#9BF0E1",color:"#b5b5b5",selectedColor:"#FFF",navItem:{hoverBackground:"#404040"},submenu:{background:"#404040"}},pinSidebarButton:{icon:"#181818",background:"#BDBDBD"},tabbar:{indicator:"#9BF0E1"}},dark:{type:"dark",mode:"dark",background:{default:"#333333",paper:"#424242"},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:"#FFD600",navigation:{background:"#424242",indicator:"#9BF0E1",color:"#b5b5b5",selectedColor:"#FFF",navItem:{hoverBackground:"#404040"},submenu:{background:"#404040"}},pinSidebarButton:{icon:"#404040",background:"#BDBDBD"},tabbar:{indicator:"#9BF0E1"}}},or={light:ks({palette:ko.light}),dark:ks({palette:ko.dark})};var ba=n(68542);ba.Z.configure(i=>`v5-${i}`);var Sa=n(87561),Ca=n(12536),wa=n(19219),ja=n(41547),Ea=n(3493),Aa=n(81887);const Ta=(0,Ca.Z)({productionPrefix:"jss4-"});function vo(i){const{children:t,theme:o,noCssBaseline:a=!1}=i,d=o.getTheme("v4"),b=o.getTheme("v5");let B;a||(B=(0,p.jsx)(Sa.ZP,{}));let Z=(0,p.jsxs)(p.Fragment,{children:[B,t]});return d&&(Z=(0,p.jsx)(wa.ZP,{generateClassName:Ta,children:(0,p.jsx)(ja.Z,{theme:d,children:Z})})),b&&(Z=(0,p.jsx)(Ea.Z,{injectFirst:!0,children:(0,p.jsx)(Aa.Z,{theme:b,children:Z})})),Z}function Ra(i){var t,o,a,d;return{props:{MuiGrid:(o=go)===null||o===void 0||(t=o.MuiGrid)===null||t===void 0?void 0:t.defaultProps,MuiSwitch:(d=go)===null||d===void 0||(a=d.MuiSwitch)===null||a===void 0?void 0:a.defaultProps},...Is(i)}}function Ia(i){return rs(i,go).overrides}function Bs(i){const t=Ra(i),o=(0,Yr.Z)(t),a=Ia(o);return{...o,overrides:a}}const Pa=Bs({palette:ko.light}),$s=Bs({palette:ko.dark});var yi=n(98192),xi=n(15222);const bi=[{id:"light",title:"Light Theme",variant:"light",icon:(0,p.jsx)(xi.Z,{}),Provider:({children:i})=>(0,p.jsx)(vo,{theme:or.light,children:i})},{id:"dark",title:"Dark Theme",variant:"dark",icon:(0,p.jsx)(yi.Z,{}),Provider:({children:i})=>(0,p.jsx)(vo,{theme:or.dark,children:i})}];function os(i){var t,o,a,d,b,B,Z,oe,me,Me,Te,Fe;return co({...i,apis:(me=(t=i)===null||t===void 0?void 0:t.apis)!==null&&me!==void 0?me:[],bindRoutes:(o=i)===null||o===void 0?void 0:o.bindRoutes,components:{...ae,...(a=i)===null||a===void 0?void 0:a.components},configLoader:(d=i)===null||d===void 0?void 0:d.configLoader,defaultApis:ts,icons:{...Tr,...(b=i)===null||b===void 0?void 0:b.icons},plugins:(Me=(B=i)===null||B===void 0?void 0:B.plugins)!==null&&Me!==void 0?Me:[],featureFlags:(Te=(Z=i)===null||Z===void 0?void 0:Z.featureFlags)!==null&&Te!==void 0?Te:[],themes:(Fe=(oe=i)===null||oe===void 0?void 0:oe.themes)!==null&&Fe!==void 0?Fe:bi})}var tr=n(25271),Bo=n(76635);async function Si({storageApi:i}){const t=i.forBucket("settings"),o=i.forBucket("starredEntities"),a=t.snapshot("starredEntities").value;if(!(0,Bo.isArray)(a))return;var d;const b=new Set((d=o.snapshot("entityRefs").value)!==null&&d!==void 0?d:[]);a.filter(Bo.isString).map(B=>B.split(":")).filter(B=>B.length===4&&B[0]==="entity").map(([B,Z,oe,me])=>(0,tr.eE)({kind:Z,namespace:oe,name:me})).forEach(B=>b.add(B)),await o.set("entityRefs",Array.from(b)),await t.remove("starredEntities")}class Ds{async toggleStarred(t){this.starredEntities.has(t)?this.starredEntities.delete(t):this.starredEntities.add(t),await this.settingsStore.set("entityRefs",Array.from(this.starredEntities))}starredEntitie$(){return this.observable}notifyChanges(){for(const t of this.subscribers)t.next(new Set(this.starredEntities))}constructor(t){(0,k._)(this,"settingsStore",void 0),(0,k._)(this,"starredEntities",void 0),(0,k._)(this,"subscribers",new Set),(0,k._)(this,"observable",new($e())(a=>(a.next(new Set(this.starredEntities)),this.subscribers.add(a),()=>{this.subscribers.delete(a)}))),Si(t).then(),this.settingsStore=t.storageApi.forBucket("starredEntities");var o;this.starredEntities=new Set((o=this.settingsStore.snapshot("entityRefs").value)!==null&&o!==void 0?o:[]),this.settingsStore.observe$("entityRefs").subscribe({next:a=>{var d;this.starredEntities=new Set((d=a.value)!==null&&d!==void 0?d:[]),this.notifyChanges()}})}}var La=n(8799),so=n(79692),Ci=n(12420),Vn=n(39709),Oa=n(19928);function wi(){const i=useApi(catalogApiRef),{error:t,loading:o,value:a}=useAsync(async()=>await i.getEntityFacets({facets:["kind"]}).then(b=>{var B;return((B=b.facets.kind)===null||B===void 0?void 0:B.map(Z=>Z.value).sort())||[]}),[i]);return{loading:o,error:t,allKinds:a!=null?a:[]}}function Ns(i,t,o){let a=i;return t&&(a=a.filter(b=>t.some(B=>B.toLocaleLowerCase("en-US")===b.toLocaleLowerCase("en-US")))),o&&!i.some(b=>b.toLocaleLowerCase("en-US")===o.toLocaleLowerCase("en-US"))&&(a=a.concat([o])),a.sort().reduce((b,B)=>(b[B.toLocaleLowerCase("en-US")]=B,b),{})}const Fs=(0,so.Z)(i=>(0,Ci.Z)({root:{...i.typography.h4}}));function ka(i){var t;const{initialFilter:o="component",allowedKinds:a}=i,d=Fs(),{allKinds:b}=useAllKinds(),{filters:B,updateFilters:Z,queryParameters:{kind:oe}}=useEntityList(),me=useMemo(()=>[oe].flat()[0],[oe]);var Me;const[Te,Fe]=useState((Me=me!=null?me:(t=B.kind)===null||t===void 0?void 0:t.value)!==null&&Me!==void 0?Me:o);useEffect(()=>{me&&Fe(me)},[me]),useEffect(()=>{var st;if(!((st=B.kind)===null||st===void 0)&&st.value){var tn;Fe((tn=B.kind)===null||tn===void 0?void 0:tn.value)}},[B.kind]),useEffect(()=>{Z({kind:Te?new EntityKindFilter(Te):void 0})},[Te,Z]);const Je=filterKinds(b,a,Te);return _jsx(Select,{input:_jsx(InputBase,{}),value:Te.toLocaleLowerCase("en-US"),onChange:st=>Fe(st.target.value),classes:d,children:Object.keys(Je).map(st=>_jsx(MenuItem,{value:st,children:`${pluralize(Je[st])}`},st))})}var Ba=n(86359),ss=n(95544),$o=n(99688),Do=n(12231),No=n(86136),Fo=n(49378),ji=n(85256),is=n(80030),as=n(61837),Ei=n(79784),Ai=n(50758),ls=n(31654),Ti=n(43054),Ri=n(65759),$a=n(49280),Ii=n(96641);function Pi(i){const{entity:t,loading:o,error:a}=(0,Ii.ce)(),{allowed:d,loading:b,error:B}=fo({permission:i,resourceRef:t?(0,tr.eE)(t):void 0});return o||b?{loading:!0,allowed:!1}:a?{loading:!1,allowed:!1,error:a}:{loading:!1,allowed:d,error:B}}const cs="catalog-entity",Li=Ar({name:"catalog.entity.read",attributes:{action:"read"},resourceType:cs}),Zs=Ar({name:"catalog.entity.create",attributes:{action:"create"}}),ds=Ar({name:"catalog.entity.delete",attributes:{action:"delete"},resourceType:cs}),Oi=Ar({name:"catalog.entity.refresh",attributes:{action:"update"},resourceType:cs}),Us=Ar({name:"catalog.location.read",attributes:{action:"read"}}),ki=Ar({name:"catalog.location.create",attributes:{action:"create"}}),Bi=Ar({name:"catalog.location.delete",attributes:{action:"delete"}}),Da=[Li,Zs,ds,Oi,Us,ki,Bi];var $i=n(49166);function Ms(i){var t,o,a,d;const{unregisterEntityOptions:b,isUnregisterAllowed:B,onUnregisterEntity:Z,onClose:oe}=i,me=typeof((t=b)===null||t===void 0?void 0:t.disableUnregister)=="boolean";var Me;const Te=(Me=!B||(me?!!(!((o=b)===null||o===void 0)&&o.disableUnregister):((a=b)===null||a===void 0?void 0:a.disableUnregister)==="disable"))!==null&&Me!==void 0?Me:!1;let Fe=(0,p.jsx)(p.Fragment,{});return((d=b)===null||d===void 0?void 0:d.disableUnregister)!=="hidden"&&(Fe=(0,p.jsxs)(Do.Z,{onClick:()=>{oe(),Z()},disabled:Te,children:[(0,p.jsx)(No.Z,{children:(0,p.jsx)($i.Z,{fontSize:"small"})}),(0,p.jsx)(Fo.Z,{primary:"Unregister entity"})]})),(0,p.jsx)(p.Fragment,{children:Fe})}const Di=(0,so.Z)(i=>({button:{color:i.page.fontColor}}),{name:"PluginCatalogEntityContextMenu"});function zs(i){const{UNSTABLE_extraContextMenuItems:t,UNSTABLE_contextMenuOptions:o,onUnregisterEntity:a,onInspectEntity:d}=i,[b,B]=(0,W.useState)(),Z=Di(),me=Pi(ds).allowed,Me=tn=>{B(tn.currentTarget)},Te=()=>{B(void 0)},Fe=(0,m.h_)(m.$v),Je=(0,W.useCallback)(()=>{window.navigator.clipboard.writeText(window.location.toString()).then(()=>Fe.post({message:"Copied!",severity:"info",display:"transient"}))},[Fe]),st=t&&[...t.map(tn=>(0,p.jsxs)(Do.Z,{onClick:()=>{Te(),tn.onClick()},children:[(0,p.jsx)(No.Z,{children:(0,p.jsx)(tn.Icon,{fontSize:"small"})}),(0,p.jsx)(Fo.Z,{primary:tn.title})]},tn.title)),(0,p.jsx)(ji.Z,{},"the divider is here!")];return(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)(is.ZP,{title:"More",arrow:!0,children:(0,p.jsx)(as.Z,{"aria-label":"more","aria-controls":"long-menu","aria-haspopup":"true","aria-expanded":!!b,role:"button",onClick:Me,"data-testid":"menu-button",className:Z.button,id:"long-menu",children:(0,p.jsx)(Ti.Z,{})})}),(0,p.jsx)(Ei.ZP,{open:Boolean(b),onClose:Te,anchorEl:b,anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"},"aria-labelledby":"long-menu",children:(0,p.jsxs)(Ai.Z,{autoFocusItem:Boolean(b),children:[st,(0,p.jsx)(Ms,{unregisterEntityOptions:o,isUnregisterAllowed:me,onUnregisterEntity:a,onClose:Te}),(0,p.jsxs)(Do.Z,{onClick:()=>{Te(),d()},children:[(0,p.jsx)(No.Z,{children:(0,p.jsx)(ls.Z,{fontSize:"small"})}),(0,p.jsx)(Fo.Z,{primary:"Inspect entity"})]}),(0,p.jsxs)(Do.Z,{onClick:()=>{Te(),Je()},children:[(0,p.jsx)(No.Z,{children:(0,p.jsx)(Ri.Z,{fontSize:"small"})}),(0,p.jsx)(Fo.Z,{primary:"Copy entity URL"})]})]})})]})}const Ni="plugin.catalog.entityLayoutRoute",us=()=>null;(0,m.R5)(us,Ni,!0),(0,m.R5)(us,"core.gatherMountPoints",!0);function Na(i){const{entity:t,title:o}=i;return(0,p.jsxs)(ss.Z,{display:"inline-flex",alignItems:"center",height:"1em",maxWidth:"100%",children:[(0,p.jsx)(ss.Z,{component:"span",textOverflow:"ellipsis",whiteSpace:"nowrap",overflow:"hidden",children:o}),t&&(0,p.jsx)(Vn.LH,{entity:t})]})}function Fi(i,t,o,a){var d,b,B,Z,oe;const me=(oe=i!=null?i:(d=a)===null||d===void 0?void 0:d.kind)!==null&&oe!==void 0?oe:"";var Me;const Te=(Me=t!=null?t:(b=a)===null||b===void 0?void 0:b.metadata.namespace)!==null&&Me!==void 0?Me:"";var Fe,Je,st;return{headerTitle:`${(st=(Je=(Fe=(B=a)===null||B===void 0?void 0:B.metadata.title)!==null&&Fe!==void 0?Fe:o)!==null&&Je!==void 0?Je:(Z=a)===null||Z===void 0?void 0:Z.metadata.name)!==null&&st!==void 0?st:""}${Te&&Te!==tr.zG?` in ${Te}`:""}`,headerType:(()=>{let Vt=me.toLocaleLowerCase("en-US");return a&&a.spec&&"type"in a.spec&&(Vt+=" \u2014 ",Vt+=a.spec.type.toLocaleLowerCase("en-US")),Vt})()}}function Zi(i){var t;const{entity:o}=i,a=(0,Vn.hF)(o,tr.S4);return(0,p.jsxs)(p.Fragment,{children:[a.length>0&&(0,p.jsx)(cn.i9,{label:"Owner",value:(0,p.jsx)(Vn.rI,{entityRefs:a,defaultKind:"Group",color:"inherit"})}),((t=o.spec)===null||t===void 0?void 0:t.lifecycle)&&(0,p.jsx)(cn.i9,{label:"Lifecycle",value:o.spec.lifecycle})]})}const Ui=i=>{var t,o,a;const{UNSTABLE_extraContextMenuItems:d,UNSTABLE_contextMenuOptions:b,children:B,NotFoundComponent:Z}=i,{kind:oe,namespace:me,name:Me}=(0,m.Oi)(Vn.wi),{entity:Te,loading:Fe,error:Je}=(0,Vn.ce)(),st=(0,V.TH)(),tn=(0,m.vJ)(B,Or=>Or.selectByComponentData({key:Ni,withStrictError:"Child of EntityLayout must be an EntityLayout.Route"}).getElements().flatMap(({props:Pn})=>{if(Te){if(Pn.if&&!Pn.if(Te))return[]}else return[];return[{path:Pn.path,title:Pn.title,children:Pn.children,tabProps:Pn.tabProps}]}),[Te]),{headerTitle:Vt,headerType:rr}=Fi(oe,me,Me,Te),[Mr,hr]=(0,W.useState)(!1),[br,Sr]=(0,W.useState)(!1),Fn=(0,V.s0)(),Pr=async()=>{hr(!1),Sr(!1),Fn("/")};(0,W.useEffect)(()=>{hr(!1),Sr(!1)},[st.pathname]);var Lr;return(0,p.jsxs)(cn.T3,{themeId:(Lr=(a=Te)===null||a===void 0||(o=a.spec)===null||o===void 0||(t=o.type)===null||t===void 0?void 0:t.toString())!==null&&Lr!==void 0?Lr:"home",children:[(0,p.jsx)(cn.h4,{title:(0,p.jsx)(Na,{title:Vt,entity:Te}),pageTitleOverride:Vt,type:rr,children:Te&&(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)(Zi,{entity:Te}),(0,p.jsx)(zs,{UNSTABLE_extraContextMenuItems:d,UNSTABLE_contextMenuOptions:b,onUnregisterEntity:()=>hr(!0),onInspectEntity:()=>Sr(!0)})]})}),Fe&&(0,p.jsx)(cn.Ex,{}),Te&&(0,p.jsx)(cn.tn,{routes:tn}),Je&&(0,p.jsx)(cn.VY,{children:(0,p.jsx)($o.Z,{severity:"error",children:Je.toString()})}),!Fe&&!Je&&!Te&&(0,p.jsx)(cn.VY,{children:Z||(0,p.jsxs)(cn.GB,{title:"Entity not found",children:["There is no ",oe," with the requested"," ",(0,p.jsx)(cn.rU,{to:"https://backstage.io/docs/features/software-catalog/references",children:"kind, namespace, and name"}),"."]})}),(0,p.jsx)(Vn.pp,{open:Mr,entity:Te,onConfirm:Pr,onClose:()=>hr(!1)}),(0,p.jsx)(Vn.U_,{open:br,entity:Te,onClose:()=>Sr(!1)})]})};Ui.Route=us;function Fa(i){const{open:t,onClose:o,onConfirm:a,entity:d}=i,[b,B]=useState(!1),Z=useApi(catalogApiRef),oe=useApi(alertApiRef),me=async()=>{B(!0);try{const Me=d.metadata.uid;await Z.removeEntityByUid(Me),a()}catch(Me){assertError(Me),oe.post({message:Me.message})}finally{B(!1)}};return _jsxs(Dialog,{open:t,onClose:o,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:b,onClick:me,children:"Delete"}),_jsx(Button,{onClick:o,color:"primary",children:"Cancel"})]})]})}var yo=n(19625);function Za(i){var t,o,a;return((a=i)===null||a===void 0||(o=a.metadata)===null||o===void 0||(t=o.annotations)===null||t===void 0?void 0:t["backstage.io/orphan"])==="true"}function Ua(){const i=useNavigate(),t=useRouteRef(rootRouteRef),[o,a]=useState(!1),{entity:d}=useEntity(),b=async()=>{a(!1),i(t())};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:o,entity:d,onConfirm:b,onClose:()=>a(!1)})]})}async function Ws(i,t){var o,a;const d=(o=i.relations)===null||o===void 0?void 0:o.map(B=>B.targetRef);if(!d||((a=d)===null||a===void 0?void 0:a.length)<1||d.length>1e3)return[];const b=await t.getEntitiesByRefs({entityRefs:d,fields:["kind","metadata.name","metadata.namespace"]});return d.filter((B,Z)=>b.items[Z]===void 0)}async function Ma(i,t){const o=t.apis.get(catalogApiRef);if(!o)throw new Error(`No implementation available for ${catalogApiRef}`);return(await Ws(i,o)).length>0}function za(){const{entity:i}=useEntity(),t=useApi(catalogApiRef),{loading:o,error:a,value:d}=useAsync(async()=>Ws(i,t),[i,t]);return a?_jsx(Box,{mb:1,children:_jsx(ResponseErrorPanel,{error:a})}):o||!d||d.length===0?null:_jsx(_Fragment,{children:_jsxs(Alert,{severity:"warning",children:["This entity has relations to other entities, which can't be found in the catalog. ",_jsx("br",{}),"Entities not found are: ",d.join(", ")]})})}var hs=n(4791);const Mi=i=>i.error&&i.level==="error"&&i.type===ENTITY_STATUS_CATALOG_PROCESSING_TYPE;async function xo(i,t){return{items:(await t.getEntityAncestors({entityRef:i})).items.map(d=>{var b,B;return{errors:((B=(b=d.entity.status)===null||b===void 0?void 0:b.items)!==null&&B!==void 0?B:[]).filter(Mi).map(me=>me.error).filter(me=>Boolean(me)),entity:d.entity}}).filter(d=>d.errors.length>0)}}async function zi(i,t){const o=t.apis.get(catalogApiRef);if(!o)throw new Error(`No implementation available for ${catalogApiRef}`);return(await xo(stringifyEntityRef(i),o)).items.length>0}function Wi(){const{entity:i}=useEntity(),t=stringifyEntityRef(i),o=useApi(catalogApiRef),{loading:a,error:d,value:b}=useAsync(async()=>xo(t,o),[t,o]);return d?_jsx(Box,{mb:1,children:_jsx(ResponseErrorPanel,{error:d})}):a||!b?null:_jsx(_Fragment,{children:b.items.map((B,Z)=>_jsxs(Box,{mb:1,children:[stringifyEntityRef(i)!==stringifyEntityRef(B.entity)&&_jsxs(Box,{p:1,children:["The error below originates from"," ",_jsx(EntityRefLink,{entityRef:B.entity})]}),B.errors.map((oe,me)=>_jsx(ResponseErrorPanel,{error:oe},me))]},Z))})}const xr="core.backstage.entitySwitch",Vs=i=>null;(0,m.R5)(Vs,xr,!0);const Hs=i=>{var t;const{entity:o,loading:a}=(0,Vn.ce)(),d=(0,m.I_)(),b=(0,m.vJ)(i.children,oe=>oe.selectByComponentData({key:xr,withStrictError:"Child of EntitySwitch is not an EntitySwitch.Case"}).getElements().flatMap(me=>{var Me;if(a)return[];const{if:Te,children:Fe}=me.props;return o?[{if:(Me=Te)===null||Me===void 0?void 0:Me(o,{apis:d}),children:Fe}]:[{if:Te===void 0,children:Fe}]}),[d,o,a]);if(b.some(oe=>typeof oe.if=="object"&&"then"in oe.if))return(0,p.jsx)(Vi,{results:b,renderMultipleMatches:i.renderMultipleMatches});if(i.renderMultipleMatches==="all"){const oe=b.filter(me=>me.if).map(me=>me.children);return oe.length===0?ps(b):(0,p.jsx)(p.Fragment,{children:oe})}var Z;return(Z=(t=b.find(oe=>oe.if))===null||t===void 0?void 0:t.children)!==null&&Z!==void 0?Z:ps(b)};function Vi({results:i,renderMultipleMatches:t}){const{loading:o,value:a}=(0,c.default)(async()=>{const d=i.map(async({if:B,children:Z})=>{try{if(await B)return Z}catch{}return null});if(t==="all"){const B=(await Promise.all(d)).filter(Boolean);return B.length===0?ps(i):(0,p.jsx)(p.Fragment,{children:B})}var b;return(b=(await Promise.all(d)).find(Boolean))!==null&&b!==void 0?b:ps(i)},[i]);return o||!a?null:a}function ps(i){var t,o;return(o=(t=i.filter(a=>a.if===void 0)[0])===null||t===void 0?void 0:t.children)!==null&&o!==void 0?o:null}Hs.Case=Vs;const Rr=null,Hi=Vn._i.Filters,Wa=Vn._i.Content;var Va=n(85877),Gi=n(15096);const Jn=(0,m.rx)({id:"catalog",apis:[(0,m.ni)({api:Vn.Ah,deps:{discoveryApi:m.NW,fetchApi:m.gP},factory:({discoveryApi:i,fetchApi:t})=>new hs.MS({discoveryApi:i,fetchApi:t})}),(0,m.ni)({api:Vn.p3,deps:{storageApi:m.E6},factory:({storageApi:i})=>new Ds({storageApi:i})})],routes:{catalogIndex:yo._Z,catalogEntity:Vn.wi},externalRoutes:{createComponent:yo.yw,viewTechDoc:yo.jU,createFromTemplate:yo.ql},__experimentalConfigure(i){return{...{createButtonTitle:"Create"},...i}}}),fs=Jn.provide((0,m.P4)({name:"CatalogIndexPage",component:()=>n.e(9323).then(n.bind(n,89323)).then(i=>i.CatalogPage),mountPoint:yo._Z})),Gs=Jn.provide((0,m.P4)({name:"CatalogEntityPage",component:()=>n.e(8951).then(n.bind(n,78951)).then(i=>i.CatalogEntityPage),mountPoint:Vn.wi})),Ki=Jn.provide((0,m.CO)({name:"EntityAboutCard",component:{lazy:()=>Promise.resolve().then(n.bind(n,8799)).then(i=>i.AboutCard)}})),Yi=Jn.provide((0,m.CO)({name:"EntityLinksCard",component:{lazy:()=>n.e(7750).then(n.bind(n,17750)).then(i=>i.EntityLinksCard)}})),Ji=Jn.provide((0,m.CO)({name:"EntityLabelsCard",component:{lazy:()=>Promise.resolve().then(n.bind(n,85877)).then(i=>i.EntityLabelsCard)}})),Ks=Jn.provide((0,m.CO)({name:"EntityHasSystemsCard",component:{lazy:()=>n.e(5458).then(n.bind(n,5458)).then(i=>i.HasSystemsCard)}})),Ha=Jn.provide((0,m.CO)({name:"EntityHasComponentsCard",component:{lazy:()=>n.e(1105).then(n.bind(n,1105)).then(i=>i.HasComponentsCard)}})),Ga=Jn.provide((0,m.CO)({name:"EntityHasSubcomponentsCard",component:{lazy:()=>n.e(2440).then(n.bind(n,82440)).then(i=>i.HasSubcomponentsCard)}})),Qi=Jn.provide((0,m.CO)({name:"EntityHasResourcesCard",component:{lazy:()=>n.e(9770).then(n.bind(n,79770)).then(i=>i.HasResourcesCard)}})),Xi=Jn.provide((0,m.CO)({name:"EntityDependsOnComponentsCard",component:{lazy:()=>n.e(9545).then(n.bind(n,19545)).then(i=>i.DependsOnComponentsCard)}})),_i=Jn.provide((0,m.CO)({name:"EntityDependencyOfComponentsCard",component:{lazy:()=>n.e(184).then(n.bind(n,40184)).then(i=>i.DependencyOfComponentsCard)}})),Ka=Jn.provide((0,m.CO)({name:"EntityDependsOnResourcesCard",component:{lazy:()=>n.e(1032).then(n.bind(n,81032)).then(i=>i.DependsOnResourcesCard)}})),gs=Jn.provide((0,m.CO)({name:"RelatedEntitiesCard",component:{lazy:()=>n.e(732).then(n.bind(n,732)).then(i=>i.RelatedEntitiesCard)}})),Ya=Jn.provide((0,Gi.E5)({name:"CatalogSearchResultListItem",component:()=>n.e(7670).then(n.bind(n,27670)).then(i=>i.CatalogSearchResultListItem),predicate:i=>i.type==="software-catalog"}));var Ys=n(32838);class Js{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(t,o){const d=`${await this.getApiOrigin()}/${o}`,b=await fetch(`${d.endsWith("/")?d:`${d}/`}index.html`);if(b.status===404)throw new Error("Page not found");return b.text()}async syncEntityDocs(t){return"cached"}async getBaseUrl(t,o,a){const d=await this.getApiOrigin();return new URL(t,`${d}/${a}`).toString()}constructor({configApi:t,discoveryApi:o,identityApi:a}){(0,k._)(this,"configApi",void 0),(0,k._)(this,"discoveryApi",void 0),(0,k._)(this,"identityApi",void 0),this.configApi=t,this.discoveryApi=o,this.identityApi=a}}class Qs{async getApiOrigin(){return await this.discoveryApi.getBaseUrl("techdocs")}async getEntityMetadata(t){return{apiVersion:"backstage.io/v1alpha1",kind:"Component",metadata:{name:"local"},spec:{owner:"test",lifecycle:"experimental"}}}async getTechDocsMetadata(t){return{site_name:"Live preview environment",site_description:""}}constructor({configApi:t,discoveryApi:o,identityApi:a}){(0,k._)(this,"configApi",void 0),(0,k._)(this,"discoveryApi",void 0),(0,k._)(this,"identityApi",void 0),this.configApi=t,this.discoveryApi=o,this.identityApi=a}}const qi=[(0,m.ni)({api:U.Dl,deps:{configApi:m.Ds,discoveryApi:m.NW,identityApi:m.$4},factory:({configApi:i,discoveryApi:t,identityApi:o})=>new Js({configApi:i,discoveryApi:t,identityApi:o})}),(0,m.ni)({api:U.gT,deps:{configApi:m.Ds,discoveryApi:m.NW,identityApi:m.$4},factory:({configApi:i,discoveryApi:t,identityApi:o})=>new Qs({configApi:i,discoveryApi:t,identityApi:o})}),(0,m.ni)({api:Ys.q3,deps:{configApi:m.Ds},factory:({configApi:i})=>Ys.ae.fromConfig(i)})],ea={backend:{baseUrl:"http://localhost:3000"},techdocs:{builder:"external"}},ta={backend:{baseUrl:"http://localhost:7007"},techdocs:{builder:"external"}};async function Xs(){const i=await fetch("/.detect");return i.ok?(await i.text()).trim()==="techdocs-cli-server":!1}async function na(){const i=await Kr(),t=await Xs();return[...i,{context:"detected",data:t?ea:ta}]}var Zo=n(58845);const _s=(0,so.Z)({svg:{width:"auto",height:30},path:{fill:"#7df3e1"}});var ei=()=>{const i=_s();return(0,p.jsx)("svg",{className:i.svg,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 2079.95 456.05",children:(0,p.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 ra=(0,so.Z)({svg:{width:"auto",height:28},path:{fill:"#7df3e1"}});var ti=()=>{const i=ra();return(0,p.jsx)("svg",{className:i.svg,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 337.46 428.5",children:(0,p.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 nr=(0,so.Z)({root:{width:cn.po.drawerWidthClosed,height:3*cn.po.logoHeight,display:"flex",flexFlow:"row nowrap",alignItems:"center",marginBottom:-14},link:{width:cn.po.drawerWidthClosed,marginLeft:24}}),sa=()=>{const i=nr(),{isOpen:t}=(0,cn.mZ)();return(0,p.jsx)("div",{className:i.root,children:(0,p.jsx)(cn.rU,{to:"/docs/default/component/local/",underline:"none",className:i.link,children:t?(0,p.jsx)(ei,{}):(0,p.jsx)(ti,{})})})},ia=({children:i})=>(0,p.jsxs)(cn.tR,{children:[(0,p.jsxs)(cn.YE,{children:[(0,p.jsx)(sa,{}),(0,p.jsx)(cn.v7,{}),(0,p.jsx)(cn.R6,{icon:Zo.Z,to:"/docs/default/component/local",text:"Docs Preview"})]}),i]});var aa=n(32388),ni=n(4142);const la=(0,so.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 Ir;(function(i){i.LIGHT="light",i.DARK="dark"})(Ir||(Ir={}));const ms=()=>{const i=(0,m.h_)(m.hg),t=la(),[o,a]=(0,W.useState)(i.getActiveThemeId()===Ir.DARK?Ir.DARK:Ir.LIGHT),d={[Ir.LIGHT]:{icon:ni.Z,title:"Dark theme"},[Ir.DARK]:{icon:aa.Z,title:"Light theme"}},{title:b,icon:B}=d[o],Z=()=>{a(oe=>{const me=oe===Ir.LIGHT?Ir.DARK:Ir.LIGHT;return i.setActiveThemeId(me),me})};return(0,p.jsx)(ss.Z,{display:"flex",alignItems:"center",mr:2,children:(0,p.jsx)(is.ZP,{title:b,arrow:!0,children:(0,p.jsx)(as.Z,{size:"small",onClick:Z,children:(0,p.jsx)(B,{className:t.headerIcon})})})})},ca=()=>(0,p.jsxs)(w.I6,{children:[(0,p.jsx)(de.S,{}),(0,p.jsx)(D.F,{withSearch:!1})]}),da=(0,p.jsx)(ca,{}),ri=os({apis:qi,configLoader:na,plugins:Object.values(r)}),Uo=ri.getProvider(),ua=ri.getRouter(),ha=w.s4.provide((0,U.KY)({name:"ThemeToggleAddon",component:ms,location:U.oZ.Header})),oi=(0,p.jsxs)(ws,{children:[(0,p.jsx)(V.Fg,{to:"/docs/default/component/local/"},"/"),(0,p.jsx)(V.AW,{path:"/catalog/:namespace/:kind/:name",element:(0,p.jsx)(Gs,{})}),(0,p.jsx)(V.AW,{path:"/docs",element:(0,p.jsx)(w.Jl,{}),children:(0,p.jsx)(X.u,{})}),(0,p.jsxs)(V.AW,{path:"/docs/:namespace/:kind/:name/*",element:(0,p.jsx)(w.I6,{}),children:[da,(0,p.jsx)(U.DR,{children:(0,p.jsx)(ha,{})})]})]});var Xa=()=>(0,p.jsx)(Uo,{children:(0,p.jsx)(ua,{children:(0,p.jsx)(ia,{children:oi})})});f.render((0,p.jsx)(Xa,{}),document.getElementById("root"))},51837:function(It,Pe,n){"use strict";n.d(Pe,{CT:function(){return m},EI:function(){return ve},uW:function(){return f},Vt:function(){return h}});function r(){return typeof window!="undefined"&&window.Math===Math?window:typeof self!="undefined"&&self.Math===Math?self:Function("return this")()}const p=r(),W=ce=>`__@backstage/${ce}__`;function f(ce,z){const de=W(ce);let D=p[de];return D||(D=z(),p[de]=D,D)}var V=n(2784);function m(ce){return f(ce,()=>(0,V.createContext)(void 0))}function h(ce){return(0,V.useContext)(m(ce))}function F(ce){return{set(z){globalThis[`__@backstage/${ce}__`]=createContext(createVersionedValueMap(z))},reset(){delete globalThis[`__@backstage/${ce}__`]}}}function ve(ce){Object.freeze(ce);const z={atVersion(de){return ce[de]}};return Object.defineProperty(z,"$map",{configurable:!0,enumerable:!0,get(){return ce}}),z}},96641:function(It,Pe,n){"use strict";n.d(Pe,{X2:function(){return ve},ce:function(){return ce},h$:function(){return h}});var r=n(52322),p=n(25271),W=n(60871),f=n(51837),V=n(2784);const m=(0,f.CT)("entity-context"),h=z=>{const{children:de,entity:D,loading:A,error:se,refresh:ie}=z,ee={entity:D,loading:A,error:se,refresh:ie};return(0,r.jsx)(m.Provider,{value:(0,f.EI)({1:ee}),children:(0,r.jsx)(W.fC,{attributes:{...D?{entityRef:(0,p.eE)(D)}:void 0},children:de})})},F=z=>_jsx(h,{entity:z.entity,loading:!Boolean(z.entity),error:void 0,refresh:void 0,children:z.children});function ve(){const z=(0,f.Vt)("entity-context");if(!z)throw new Error("Entity context is not available");const de=z.atVersion(1);if(!de)throw new Error("EntityContext v1 not available");if(!de.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:de.entity}}function ce(){const z=(0,f.Vt)("entity-context");if(!z)throw new Error("Entity context is not available");const de=z.atVersion(1);if(!de)throw new Error("EntityContext v1 not available");const{entity:D,loading:A,error:se,refresh:ie}=de;return{entity:D,loading:A,error:se,refresh:ie}}},39709:function(It,Pe,n){"use strict";n.d(Pe,{h$:function(){return dt.h$},n3:function(){return r.n3},_i:function(){return K},tW:function(){return _e},df:function(){return Ue},UO:function(){return ht},ph:function(){return cn},dq:function(){return bt},nl:function(){return ts},dx:function(){return jt},rI:function(){return qt},u3:function(){return zn},xE:function(){return C},sL:function(){return c},LH:function(){return De},U_:function(){return no},pp:function(){return ro},EW:function(){return Oo},Ah:function(){return W},wi:function(){return Oe},hF:function(){return U.hF},CV:function(){return U.CV},$3:function(){return an},p3:function(){return f},ce:function(){return dt.ce},X2:function(){return dt.X2},wp:function(){return rt},ZW:function(){return Cn},eK:function(){return Ct},CR:function(){return ln}});var r=n(4791),p=n(60871);const W=(0,p.T0)({id:"plugin.catalog.service"}),f=(0,p.T0)({id:"catalog-react.starred-entities"});var V=n(82394);class m{async toggleStarred(j){this.starredEntities.delete(j)||this.starredEntities.add(j);for(const L of this.subscribers)L.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(j=>(j.next(new Set(this.starredEntities)),this.subscribers.add(j),()=>{this.subscribers.delete(j)})))}}var h=n(52322),F=n(2784),ve=n(41156),ce=n(60364),z=n(77277),de=n(4190),D=n(95544),A=n(90436),se=n(60905),ie=n(36444);const ee=y=>{const j=(0,ve.Z)(re=>re.breakpoints.down("md")),L=(0,ce.Z)(),[P,ae]=(0,F.useState)(!1);return j?(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(z.Z,{style:{marginTop:L.spacing(1),marginLeft:L.spacing(1)},onClick:()=>ae(!0),startIcon:(0,h.jsx)(ie.Z,{}),children:"Filters"}),(0,h.jsx)(de.ZP,{open:P,onClose:()=>ae(!1),anchor:"left",disableAutoFocus:!0,keepMounted:!0,variant:"temporary",children:(0,h.jsxs)(D.Z,{m:2,children:[(0,h.jsx)(A.Z,{variant:"h6",component:"h2",style:{marginBottom:L.spacing(1)},children:"Filters"}),y.children]})})]}):(0,h.jsx)(se.Z,{item:!0,lg:2,children:y.children})},X=y=>(0,h.jsx)(se.Z,{item:!0,xs:12,lg:10,children:y.children}),K=y=>(0,h.jsx)(se.Z,{container:!0,style:{position:"relative"},children:y.children});K.Filters=ee,K.Content=X;var R=n(53974),w=n(87612),I=n(25271),U=n(49280);class xe{getCatalogFilters(){return{kind:this.value}}toQueryValue(){return this.value}constructor(j){(0,w._)(this,"value",void 0),this.value=j}}class Se{getTypes(){return Array.isArray(this.value)?this.value:[this.value]}getCatalogFilters(){return{"spec.type":this.getTypes()}}toQueryValue(){return this.getTypes()}constructor(j){(0,w._)(this,"value",void 0),this.value=j}}class k{filterEntity(j){var L;return this.values.every(P=>((L=j.metadata.tags)!==null&&L!==void 0?L:[]).includes(P))}toQueryValue(){return this.values}constructor(j){(0,w._)(this,"values",void 0),this.values=j}}class Ge{filterEntity(j){const L=this.toUpperArray(this.value.split(/\s/)),P=this.toUpperArray([j.metadata.tags]),ae=this.toUpperArray([j.metadata.name,j.metadata.title]);for(const re of L)if(P.every(q=>q!==re)&&ae.every(q=>!q.includes(re)))return!1;return!0}toUpperArray(j){return j.flat().filter(L=>Boolean(L)).map(L=>L.toLocaleUpperCase("en-US"))}constructor(j){_define_property(this,"value",void 0),this.value=j}}class xt{filterEntity(j){return this.values.some(L=>(0,U.hF)(j,I.S4).some(P=>(0,I.eE)(P)===L))}toQueryValue(){return this.values}constructor(j){(0,w._)(this,"values",void 0),this.values=j.reduce((L,P)=>{try{return L.push((0,I.eE)((0,I.of)(P,{defaultKind:"Group"}))),L}catch{return L}},[])}}class Dt{filterEntity(j){return this.values.some(L=>{var P;return((P=j.spec)===null||P===void 0?void 0:P.lifecycle)===L})}toQueryValue(){return this.values}constructor(j){(0,w._)(this,"values",void 0),this.values=j}}class Ut{filterEntity(j){return this.values.some(L=>j.metadata.namespace===L)}toQueryValue(){return this.values}constructor(j){(0,w._)(this,"values",void 0),this.values=j}}class Tt{filterEntity(j){switch(this.value){case"owned":return this.isOwnedEntity(j);case"starred":return this.isStarredEntity(j);default:return!0}}toQueryValue(){return this.value}constructor(j,L,P){(0,w._)(this,"value",void 0),(0,w._)(this,"isOwnedEntity",void 0),(0,w._)(this,"isStarredEntity",void 0),this.value=j,this.isOwnedEntity=L,this.isStarredEntity=P}}class Nt{filterEntity(j){var L;const P=(L=j.metadata.annotations)===null||L===void 0?void 0:L["backstage.io/orphan"];return P!==void 0&&this.value.toString()===P}constructor(j){(0,w._)(this,"value",void 0),this.value=j}}class Yt{filterEntity(j){var L,P,ae;const re=((ae=j)===null||ae===void 0||(P=ae.status)===null||P===void 0||(L=P.items)===null||L===void 0?void 0:L.length)>0;return re!==void 0&&this.value===re}constructor(j){(0,w._)(this,"value",void 0),this.value=j}}var dt=n(96641),ut=n(76635),St=n(19126),lt=n.n(St),Zt=n(73557),Ht=n(69294),Ce=n(48760),$e=n(90736);const Ke=(0,F.createContext)(void 0),ht=y=>{const j=(0,$e.default)(),L=(0,p.h_)(W),[P,ae]=(0,F.useState)({}),re=(0,Zt.TH)();var q;const he=(0,F.useMemo)(()=>(q=lt().parse(re.search,{ignoreQueryPrefix:!0}).filters)!==null&&q!==void 0?q:{},[re]),[Ae,Le]=(0,F.useState)(()=>({appliedFilters:{},entities:[],backendEntities:[]})),[{loading:ze,error:Ne},We]=(0,Ht.default)(async()=>{const Be=(0,ut.compact)(Object.values(P)),He=(0,U.Gz)(Be),At=(0,U.wq)(Be),rn=(0,U.wq)((0,ut.compact)(Object.values(Ae.appliedFilters))),En=Object.keys(P).reduce((Rt,Kt)=>{var An;const ur=P[Kt];return!((An=ur)===null||An===void 0)&&An.toQueryValue&&(Rt[Kt]=ur.toQueryValue()),Rt},{});if((0,ut.isEqual)(rn,At))Le({appliedFilters:P,backendEntities:Ae.backendEntities,entities:Ae.backendEntities.filter(He)});else{const Rt=await L.getEntities({filter:At});Le({appliedFilters:P,backendEntities:Rt.items,entities:Rt.items.filter(He)})}if(j()){var Ot;const Rt=lt().parse(re.search,{ignoreQueryPrefix:!0}),Kt=lt().stringify({...Rt,filters:En},{addQueryPrefix:!0,arrayFormat:"repeat"}),An=`${window.location.pathname}${Kt}`;(Ot=window.history)===null||Ot===void 0||Ot.replaceState(null,document.title,An)}},[L,he,P,Ae],{loading:!0});(0,Ce.Z)(We,10,[P]);const it=(0,F.useCallback)(Be=>{ae(He=>{const At=typeof Be=="function"?Be(He):Be;return{...He,...At}})},[]),Et=(0,F.useMemo)(()=>({filters:Ae.appliedFilters,entities:Ae.entities,backendEntities:Ae.backendEntities,updateFilters:it,queryParameters:he,loading:ze,error:Ne}),[Ae,it,he,ze,Ne]);return(0,h.jsx)(Ke.Provider,{value:Et,children:y.children})};function rt(){const y=(0,F.useContext)(Ke);if(!y)throw new Error("useEntityList must be used within EntityListProvider");return y}var tt=n(64279),vt=n(18149),ot=n.n(vt),Qe=n(829),ft=n.n(Qe);function gt(){var y;const j=(0,p.h_)(W),{filters:{kind:L,type:P},queryParameters:{type:ae},updateFilters:re}=rt(),q=(0,F.useMemo)(()=>[ae].flat().filter(Boolean),[ae]);var he;const[Ae,Le]=(0,F.useState)(q.length?q:(he=(y=P)===null||y===void 0?void 0:y.getTypes())!==null&&he!==void 0?he:[]);(0,F.useEffect)(()=>{q.length&&Le(q)},[q]);const[ze,Ne]=(0,F.useState)([]),We=(0,F.useMemo)(()=>{var At;return(At=L)===null||At===void 0?void 0:At.value},[L]),{error:it,loading:Et,value:Be}=(0,tt.default)(async()=>We?await j.getEntityFacets({filter:{kind:We},facets:["spec.type"]}).then(rn=>rn.facets["spec.type"]||[]):[],[We,j]),He=(0,F.useRef)(Be);return(0,F.useEffect)(()=>{const At=He.current;if(He.current=Be,Et||!We||At===Be||!Be)return;const rn=[...new Set(ft()(Be,Ot=>-Ot.count).map(Ot=>Ot.value.toLocaleLowerCase("en-US")))];Ne(rn);const En=Ae.filter(Ot=>rn.includes(Ot));ot()(Ae,En)||Le(En)},[Et,We,Ae,Le,Be]),(0,F.useEffect)(()=>{re({type:Ae.length?new Se(Ae):void 0})},[Ae,re]),{loading:Et,error:it,availableTypes:ze,selectedTypes:Ae,setSelectedTypes:Le}}function Ct(y,j){var L,P,ae,re;const q=(P=j)===null||P===void 0||(L=P.type)===null||L===void 0?void 0:L.toLocaleLowerCase("en-US"),he=(re=j)===null||re===void 0||(ae=re.kind)===null||ae===void 0?void 0:ae.toLocaleLowerCase("en-US"),Ae=(0,p.h_)(W),{loading:Le,value:ze,error:Ne}=(0,tt.default)(async()=>{var We,it;const Et=(We=y.relations)===null||We===void 0?void 0:We.filter(He=>(!q||He.type.toLocaleLowerCase("en-US")===q)&&(!he||(0,I.of)(He.targetRef).kind===he));if(!(!((it=Et)===null||it===void 0)&&it.length))return[];const{items:Be}=await Ae.getEntitiesByRefs({entityRefs:Et.map(He=>He.targetRef)});return Be.filter(He=>Boolean(He))},[y,q,he]);return{entities:ze,loading:Le,error:Ne}}var mn=n(72164);function un(y){return typeof y=="string"?y:(0,I.eE)(y)}function ln(){const y=(0,p.h_)(f),j=(0,mn.Z)(y.starredEntitie$(),new Set),L=(0,F.useCallback)(ae=>j.has(un(ae)),[j]),P=(0,F.useCallback)(ae=>y.toggleStarred(un(ae)).then(),[y]);return{starredEntities:j,toggleStarredEntity:P,isStarredEntity:L}}function Sn(y){return typeof y=="string"?y:(0,I.eE)(y)}function hn(y){const j=(0,p.h_)(f),[L,P]=(0,F.useState)(!1);return(0,F.useEffect)(()=>{const re=j.starredEntitie$().subscribe({next(q){P(q.has(Sn(y)))}});return()=>{re.unsubscribe()}},[y,j]),{toggleStarredEntity:(0,F.useCallback)(()=>j.toggleStarred(Sn(y)).then(),[y,j]),isStarredEntity:L}}var vn=n(75435);function Cn(){const y=(0,p.h_)(p.$4),{loading:j,value:L}=(0,tt.default)(async()=>{const{ownershipEntityRefs:ae}=await y.getBackstageIdentity();return ae},[]),P=(0,F.useMemo)(()=>{const ae=new Set(L!=null?L:[]);return re=>{const q=(0,vn.h)(re,I.S4).map(I.eE);for(const he of q)if(ae.has(he))return!0;return!1}},[L]);return(0,F.useMemo)(()=>({loading:j,isOwnedEntity:P}),[j,P])}function on(){const y=(0,p.h_)(W),{error:j,loading:L,value:P}=(0,tt.default)(async()=>await y.getEntityFacets({facets:["kind"]}).then(re=>{var q;return((q=re.facets.kind)===null||q===void 0?void 0:q.map(he=>he.value).sort())||[]}),[y]);return{loading:L,error:j,allKinds:P!=null?P:[]}}function pn(y,j,L){let P=y;return j&&(P=P.filter(re=>j.some(q=>q.toLocaleLowerCase("en-US")===re.toLocaleLowerCase("en-US")))),L&&!y.some(re=>re.toLocaleLowerCase("en-US")===L.toLocaleLowerCase("en-US"))&&(P=P.concat([L])),P.sort().reduce((re,q)=>(re[q.toLocaleLowerCase("en-US")]=q,re),{})}function wn(y){var j;const{filters:L,queryParameters:{kind:P},updateFilters:ae}=rt(),re=(0,F.useMemo)(()=>[P].flat()[0],[P]);var q;const[he,Ae]=(0,F.useState)((q=re!=null?re:(j=L.kind)===null||j===void 0?void 0:j.value)!==null&&q!==void 0?q:y.initialFilter);(0,F.useEffect)(()=>{re&&Ae(re)},[re]),(0,F.useEffect)(()=>{var We;if(!((We=L.kind)===null||We===void 0)&&We.value){var it;Ae((it=L.kind)===null||it===void 0?void 0:it.value)}},[L.kind]),(0,F.useEffect)(()=>{ae({kind:he?new xe(he):void 0})},[he,ae]);const{allKinds:Le,loading:ze,error:Ne}=on();return{loading:ze,error:Ne,allKinds:Le!=null?Le:[],selectedKind:he,setSelectedKind:Ae}}const _e=y=>{const{allowedKinds:j,hidden:L,initialFilter:P="component"}=y,ae=(0,p.h_)(p.$v),{error:re,allKinds:q,selectedKind:he,setSelectedKind:Ae}=wn({initialFilter:P});if((0,F.useEffect)(()=>{re&&ae.post({message:"Failed to load entity kinds",severity:"error"})},[re,ae]),re)return null;const Le=pn(q,j,he),ze=Object.keys(Le).map(Ne=>({value:Ne,label:Le[Ne]}));return L?null:(0,h.jsx)(D.Z,{pb:1,pt:1,children:(0,h.jsx)(R.Ph,{label:"Kind",items:ze,selected:he.toLocaleLowerCase("en-US"),onChange:Ne=>Ae(String(Ne))})})};var Jt=n(79692),Wt=n(38016),Ye=n(88013),Tn=n(21324),sn=n(5806),Dn=n(19996),Rn=n(25505);const In=(0,h.jsx)(Rn.Z,{fontSize:"small"}),Kn=(0,h.jsx)(Dn.Z,{fontSize:"small"});function On({selected:y}){return(0,h.jsx)(Tn.Z,{icon:In,checkedIcon:Kn,checked:y})}const Yn=(0,F.memo)(y=>{var j;const{selected:L,value:P,availableOptions:ae,showCounts:re}=y,q=re?`${P} (${(j=ae)===null||j===void 0?void 0:j[P]})`:P;return(0,h.jsx)(sn.Z,{control:(0,h.jsx)(On,{selected:L}),label:q,onClick:he=>he.preventDefault()})});var we=n(86619),pe=n(72779),Re=n.n(pe);const H=(0,Jt.Z)({input:{}},{name:"CatalogReactEntityAutocompletePickerInput"});function N(y){const j=H();return(0,h.jsx)(we.Z,{variant:"outlined",...y,className:Re()(j.input,y.className)})}function le(y){var j;const{label:L,name:P,path:ae,showCounts:re,Filter:q,InputProps:he,initialSelectedOptions:Ae=[]}=y,{updateFilters:Le,filters:ze,queryParameters:{[P]:Ne}}=rt(),We=(0,p.h_)(W),{value:it}=(0,tt.default)(async()=>{var Rt;const Kt=ae,{facets:An}=await We.getEntityFacets({facets:[Kt],filter:(Rt=ze.kind)===null||Rt===void 0?void 0:Rt.getCatalogFilters()});return Object.fromEntries(An[Kt].map(({value:ur,count:Tr})=>[ur,Tr]))},[ze.kind]),Et=(0,F.useMemo)(()=>[Ne].flat().filter(Boolean),[Ne]);var Be;const[He,At]=(0,F.useState)(Et.length?Et:(Be=(j=ze[P])===null||j===void 0?void 0:j.values)!==null&&Be!==void 0?Be:Ae);(0,F.useEffect)(()=>{Et.length&&At(Et)},[Et]);const rn=Object.keys(it!=null?it:{}),En=He.length&&rn.length;(0,F.useEffect)(()=>{Le({[P]:En?new q(He):void 0})},[P,En,He,q,Le]);const Ot=ze[P];return Ot&&typeof Ot=="object"&&!("values"in Ot)||!rn.length||rn.length<=1?null:(0,h.jsx)(D.Z,{pb:1,pt:1,children:(0,h.jsxs)(A.Z,{variant:"button",component:"label",children:[L,(0,h.jsx)(Ye.ZP,{multiple:!0,disableCloseOnSelect:!0,options:rn,value:He,onChange:(Rt,Kt)=>At(Kt),renderOption:(Rt,{selected:Kt})=>(0,h.jsx)(Yn,{selected:Kt,value:Rt,availableOptions:it,showCounts:!!re}),size:"small",popupIcon:(0,h.jsx)(Wt.Z,{"data-testid":`${String(P)}-picker-expand`}),renderInput:Rt=>(0,h.jsx)(N,{...Rt,...he})})]})})}const Ee=(0,Jt.Z)({input:{}},{name:"CatalogReactEntityLifecyclePicker"}),Ue=y=>{const{initialFilter:j=[]}=y,L=Ee();return(0,h.jsx)(le,{label:"Lifecycle",name:"lifecycles",path:"spec.lifecycle",Filter:Dt,InputProps:{className:L.input},initialSelectedOptions:j})};var qe=n(6232),Pt=n(98685),$t=n(62367),Qt=n(72579),Xt=n.n(Qt);function an(y,j){var L,P;const ae=(L=j)===null||L===void 0?void 0:L.defaultKind;let re,q,he;if("metadata"in y?(re=y.kind,q=y.metadata.namespace,he=y.metadata.name):(re=y.kind,q=y.namespace,he=y.name),(q===void 0||q==="")&&(q=I.zG),((P=j)===null||P===void 0?void 0:P.defaultNamespace)!==void 0){var Ae;((Ae=j)===null||Ae===void 0?void 0:Ae.defaultNamespace)===q&&(q=void 0)}else q===I.zG&&(q=void 0);return re=re.toLocaleLowerCase("en-US"),re=ae&&ae.toLocaleLowerCase("en-US")===re?void 0:re,`${re?`${re}:`:""}${q?`${q}/`:""}${he}`}function ne(y,j){for(const L of["spec.profile.displayName","metadata.title"]){const P=Xt()(y,L);if(P&&typeof P=="string")return P}return j}function te({enabled:y}){const j=(0,p.h_)(W),[L]=(0,F.useState)(async()=>{if(!y)return[];const P="relations.ownedBy";return j.getEntityFacets({facets:[P]}).then(ae=>ae.facets[P].map(re=>re.value).map(re=>{const{kind:q,name:he,namespace:Ae}=(0,I.of)(re);return{apiVersion:"backstage.io/v1beta1",kind:q,metadata:{name:he,namespace:Ae}}}).sort((re,q)=>(re.metadata.namespace||"").localeCompare(q.metadata.namespace||"","en-US")||re.metadata.name.localeCompare(q.metadata.name,"en-US")||re.kind.localeCompare(q.kind,"en-US"))).catch(()=>[])});return(0,Ht.default)(async(P,ae)=>{var re;const q=await L;if(!q)return{items:[]};var he;const Ae=(he=(re=ae)===null||re===void 0?void 0:re.limit)!==null&&he!==void 0?he:20,{text:Le,start:ze}=Y(P),Ne=q.filter(it=>M(Le,it)),We=ze+Ae;return{items:Ne.slice(0,We),...O({entities:Ne,limit:We,payload:{text:Le,start:We}})}},[L],{loading:!0,value:{items:[]}})}function Y(y){return v(y)&&y.cursor?JSON.parse(atob(y.cursor)):{text:y.text||"",start:0}}function v(y){return!!y.cursor}function O({entities:y,limit:j,payload:L}){return y.length>j?{cursor:btoa(JSON.stringify(L))}:{}}function M(y,j){var L;const P=y.trim();return j.kind.includes(P)||((L=j.metadata.namespace)===null||L===void 0?void 0:L.includes(P))||j.metadata.name.includes(P)}function G(){const y=(0,p.h_)(W);return(0,Ht.default)(async(j,L)=>{var P;const ae=j,re=j;var q;const he=(q=(P=L)===null||P===void 0?void 0:P.limit)!==null&&q!==void 0?q:20;if(re.cursor){const Le=await y.queryEntities({cursor:re.cursor,limit:he});return{cursor:Le.pageInfo.nextCursor,items:[...re.items,...Le.items]}}const Ae=await y.queryEntities({fullTextFilter:{term:ae.text||"",fields:["metadata.name","kind","spec.profile.displayname","metadata.title"]},filter:{kind:["User","Group"]},orderFields:[{field:"metadata.name",order:"asc"}],limit:he});return{cursor:Ae.pageInfo.nextCursor,items:Ae.items}},[],{loading:!0})}var ue=n(21638);function be({mode:y,initialSelectedOwnersRefs:j}){const L=y==="owners-only",P=G(),ae=te({enabled:L}),[re,q]=L?ae:P;return[re,q,ke({enabled:!L,initialSelectedOwnersRefs:j})]}function ke({enabled:y,initialSelectedOwnersRefs:j}){const L=(0,F.useRef)({}),P=(0,p.h_)(W),[,ae]=(0,Ht.default)(async()=>{(await P.getEntitiesByRefs({entityRefs:j})).items.forEach(q=>{q&&(L.current[(0,I.eE)(q)]=q)})},[]);return(0,ue.n)(()=>{y&&j.length>0&&ae()}),{getEntity:re=>L.current[re],setEntity:re=>{L.current[(0,I.eE)(re)]=re}}}const Xe=(0,Jt.Z)({input:{}},{name:"CatalogReactEntityOwnerPicker"}),nt=(0,h.jsx)(Rn.Z,{fontSize:"small"}),yt=(0,h.jsx)(Dn.Z,{fontSize:"small"}),bt=y=>{var j,L,P;const ae=Xe(),{mode:re="owners-only"}=y||{},{updateFilters:q,filters:he,queryParameters:{owners:Ae}}=rt(),[Le,ze]=(0,F.useState)(""),Ne=(0,F.useMemo)(()=>[Ae].flat().filter(Boolean),[Ae]);var We;const[it,Et]=(0,F.useState)(Ne.length?Ne:(We=(j=he.owners)===null||j===void 0?void 0:j.values)!==null&&We!==void 0?We:[]),[{value:Be,loading:He},At,rn]=be({mode:re,initialSelectedOwnersRefs:it});(0,qe.b)(()=>At({text:Le}),[Le,At],250);const En=((L=Be)===null||L===void 0?void 0:L.items)||[];return(0,F.useEffect)(()=>{if(Ne.length){const Ot=new xt(Ne);Et(Ot.values)}},[Ne]),(0,F.useEffect)(()=>{q({owners:it.length?new xt(it):void 0})},[it,q]),["user","group"].includes(((P=he.kind)===null||P===void 0?void 0:P.value.toLocaleLowerCase("en-US"))||"")?null:(0,h.jsx)(D.Z,{pb:1,pt:1,children:(0,h.jsxs)(A.Z,{variant:"button",component:"label",children:["Owner",(0,h.jsx)(Ye.ZP,{multiple:!0,disableCloseOnSelect:!0,loading:He,options:En,value:it,getOptionSelected:(Ot,Rt)=>typeof Rt=="string"?(0,I.eE)(Ot)===Rt:Ot===Rt,getOptionLabel:Ot=>{const Rt=typeof Ot=="string"?rn.getEntity(Ot)||(0,I.of)(Ot,{defaultKind:"group",defaultNamespace:"default"}):Ot;return ne(Rt,an(Rt))},onChange:(Ot,Rt)=>{ze(""),Et(Rt.map(Kt=>{const An=typeof Kt=="string"?Kt:(0,I.eE)(Kt);return typeof Kt!="string"&&rn.setEntity(Kt),An}))},filterOptions:Ot=>Ot,renderOption:(Ot,{selected:Rt})=>{const Kt=Ot.kind.toLocaleLowerCase("en-US")==="group";return(0,h.jsx)(sn.Z,{control:(0,h.jsx)(Tn.Z,{icon:nt,checkedIcon:yt,checked:Rt}),onClick:An=>An.preventDefault(),label:(0,h.jsxs)(D.Z,{display:"flex",flexWrap:"wrap",alignItems:"center",children:[Kt?(0,h.jsx)($t.Z,{fontSize:"small"}):(0,h.jsx)(Pt.Z,{fontSize:"small"}),"\xA0",ne(Ot,an(Ot,{defaultKind:Ot.kind}))]})})},size:"small",popupIcon:(0,h.jsx)(Wt.Z,{"data-testid":"owner-picker-expand"}),renderInput:Ot=>(0,h.jsx)(we.Z,{...Ot,className:ae.input,onChange:Rt=>{ze(Rt.currentTarget.value)},variant:"outlined"}),ListboxProps:{onScroll:Ot=>{var Rt;const Kt=Ot.currentTarget;Math.abs(Kt.scrollHeight-Kt.clientHeight-Kt.scrollTop)<1&&(!((Rt=Be)===null||Rt===void 0)&&Rt.cursor)&&At({items:Be.items,cursor:Be.cursor})},"data-testid":"owner-picker-listbox"}})]})})};var ct=n(51837);const Oe=(0,ct.uW)("catalog:entity-route-ref",()=>(0,p.NT)({id:"catalog:entity",params:["namespace","kind","name"]}));function wt(y){var j,L;return{kind:y.kind.toLocaleLowerCase("en-US"),namespace:(L=(j=y.metadata.namespace)===null||j===void 0?void 0:j.toLocaleLowerCase("en-US"))!==null&&L!==void 0?L:DEFAULT_NAMESPACE,name:y.metadata.name}}var _t=n(80030);const jt=(0,F.forwardRef)((y,j)=>{var L;const{entityRef:P,defaultKind:ae,title:re,children:q,...he}=y,Ae=(0,p.tg)(Oe);let Le,ze,Ne;if(typeof P=="string"){const He=(0,I.of)(P);Le=He.kind,ze=He.namespace,Ne=He.name}else"metadata"in P?(Le=P.kind,ze=P.metadata.namespace,Ne=P.metadata.name):(Le=P.kind,ze=P.namespace,Ne=P.name);Le=Le.toLocaleLowerCase("en-US");var We;ze=(We=(L=ze)===null||L===void 0?void 0:L.toLocaleLowerCase("en-US"))!==null&&We!==void 0?We:I.zG;const it={kind:Le,namespace:ze,name:Ne},Et=an({kind:Le,namespace:ze,name:Ne},{defaultKind:ae}),Be=(0,h.jsxs)(R.rU,{...he,ref:j,to:Ae(it),children:[q,!q&&(re!=null?re:Et)]});return re?(0,h.jsx)(_t.ZP,{title:Et,children:Be}):Be});function Ft(y){const{entityRefs:j,defaultKind:L,getTitle:P,...ae}=y,re=(0,p.h_)(W),{value:q=new Array,loading:he,error:Ae}=(0,tt.default)(async()=>{const Le=j.reduce((Ne,We)=>typeof We=="object"&&"metadata"in We?Ne:[...Ne,(0,I.of)(We)],new Array),ze=j.filter(Ne=>typeof Ne=="object"&&"metadata"in Ne);return Le.length>0?[...(await re.getEntities({filter:Le.map(Ne=>({kind:Ne.kind,"metadata.namespace":Ne.namespace,"metadata.name":Ne.name}))})).items,...ze]:ze},[j]);return he?(0,h.jsx)(R.Ex,{}):Ae?(0,h.jsx)(R.yu,{error:Ae}):(0,h.jsx)(h.Fragment,{children:q.map((Le,ze)=>(0,h.jsxs)(F.Fragment,{children:[ze>0&&", ",(0,h.jsx)(jt,{...ae,defaultKind:L,entityRef:Le,title:P(Le)})]},ze))})}function qt(y){const{entityRefs:j,defaultKind:L,fetchEntities:P,getTitle:ae,...re}=y;return P?(0,h.jsx)(Ft,{...re,defaultKind:L,entityRefs:j,getTitle:ae}):(0,h.jsx)(h.Fragment,{children:j.map((q,he)=>(0,h.jsxs)(F.Fragment,{children:[he>0&&", ",(0,h.jsx)(jt,{...re,defaultKind:L,entityRef:q,title:ae?ae(q):void 0})]},he))})}const jn=y=>{const j=useRouteRef(entityRouteRef);return _jsx(IconButton,{component:Link,"aria-label":"Show",title:"Show details",to:j(getCompoundEntityRef(y.entity)),children:_jsx(InfoIcon,{})})},Bt=y=>_jsx(IconButton,{component:Link,"aria-label":"Email",title:`Email ${y.email}`,to:`mailto:${y.email}`,children:_jsx(EmailIcon,{})}),mt=y=>{var j;const L=(j=y.entity.spec.profile)===null||j===void 0?void 0:j.email;return L?_jsx(EmailCardAction,{email:L}):null},Lt=y=>{var j;const L=(j=y.entity.spec.profile)===null||j===void 0?void 0:j.email;return L?_jsx(EmailCardAction,{email:L}):null},Mt=(0,Jt.Z)(()=>({popoverPaper:{width:"30em"},descriptionTypography:{overflow:"hidden",textOverflow:"ellipsis",display:"-webkit-box",WebkitLineClamp:2,WebkitBoxOrient:"vertical"}})),en=4,pr=y=>{var j,L,P;const{entityRef:ae,children:re,delayTime:q=500}=y,he=Mt(),Ae=useApiHolder(),Le=usePopupState({variant:"popover",popupId:"entity-peek-ahead"}),[ze,Ne]=useState(!1),We=useMemo(()=>debounce(()=>Ne(!0),q),[q]),[{loading:it,error:Et,value:Be},He]=useAsyncFn(async()=>{const rn=Ae.get(catalogApiRef);if(rn){const En=await rn.getEntityByRef(ae);if(!En)throw new Error(`${ae} not found`);return En}},[Ae,ae]),At=()=>{Ne(!1),We.cancel()};return useEffect(()=>{Le.isOpen&&!Be&&!Et&&!it&&He()},[Le.isOpen,He,Be,Et,it]),_jsxs(_Fragment,{children:[_jsx(Typography,{component:"span",onMouseEnter:We,children:_jsx(Typography,{component:"span","data-testid":"trigger",...bindHover(Le),children:re})}),ze&&_jsx(HoverPopover,{PaperProps:{className:he.popoverPaper},...bindPopover(Le),anchorOrigin:{vertical:"bottom",horizontal:"center"},transformOrigin:{vertical:"top",horizontal:"center"},onMouseLeave:At,children:_jsxs(Card,{children:[_jsxs(CardContent,{children:[Et&&_jsx(ResponseErrorPanel,{error:Et}),it&&_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:he.descriptionTypography,paragraph:!0,children:Be.metadata.description}),_jsx(Typography,{children:(j=Be.spec)===null||j===void 0?void 0:j.type}),_jsxs(Box,{marginTop:"0.5em",children:[(Be.metadata.tags||[]).slice(0,en).map(rn=>_jsx(Chip,{size:"small",label:rn},rn)),((L=Be.metadata.tags)===null||L===void 0?void 0:L.length)&&((P=Be.metadata.tags)===null||P===void 0?void 0:P.length)>en&&_jsx(Tooltip,{title:"Drill into the entity to see all of the tags.",children:_jsx(Chip,{size:"small",label:"..."},"other-tags")})]})]})]}),!Et&&Be&&_jsx(CardActions,{children:_jsxs(_Fragment,{children:[isUserEntity(Be)&&_jsx(UserCardActions,{entity:Be}),isGroupEntity(Be)&&_jsx(GroupCardActions,{entity:Be}),_jsx(EntityCardActions,{entity:Be})]})})]})})]})},fr=(0,Jt.Z)(y=>({searchToolbar:{paddingLeft:0,paddingRight:0},input:{}}),{name:"CatalogReactEntitySearchBar"}),_n=()=>{var y;const j=fr(),{filters:L,updateFilters:P}=useEntityList();var ae;const[re,q]=useState((ae=(y=L.text)===null||y===void 0?void 0:y.value)!==null&&ae!==void 0?ae:"");return useDebounce(()=>{P({text:re.length?new EntityTextFilter(re):void 0})},250,[re,P]),_jsx(Toolbar,{className:j.searchToolbar,children:_jsx(FormControl,{children:_jsx(Input,{"aria-label":"search",id:"input-with-icon-adornment",className:j.input,placeholder:"Search",autoComplete:"off",onChange:he=>q(he.target.value),value:re,startAdornment:_jsx(InputAdornment,{position:"start",children:_jsx(Search,{})}),endAdornment:_jsx(InputAdornment,{position:"end",children:_jsx(IconButton,{"aria-label":"clear search",onClick:()=>q(""),edge:"end",disabled:re.length===0,children:_jsx(Clear,{})})})})})})},yn=Object.freeze({createEntityRefColumn(y){const{defaultKind:j}=y;function L(P){var ae;return((ae=P.metadata)===null||ae===void 0?void 0:ae.title)||an(P,{defaultKind:j})}return{title:"Name",highlight:!0,customFilterAndSearch(P,ae){return L(ae).includes(P)},customSort(P,ae){return L(P).localeCompare(L(ae))},render:P=>{var ae;return(0,h.jsx)(jt,{entityRef:P,defaultKind:j,title:(ae=P.metadata)===null||ae===void 0?void 0:ae.title})}}},createEntityRelationColumn(y){const{title:j,relation:L,defaultKind:P,filter:ae}=y;function re(he){return(0,U.hF)(he,L,ae)}function q(he){return re(he).map(Ae=>an(Ae,{defaultKind:P})).join(", ")}return{title:j,customFilterAndSearch(he,Ae){return q(Ae).includes(he)},customSort(he,Ae){return q(he).localeCompare(q(Ae))},render:he=>(0,h.jsx)(qt,{entityRefs:re(he),defaultKind:P})}},createOwnerColumn(){return this.createEntityRelationColumn({title:"Owner",relation:I.S4,defaultKind:"group"})},createDomainColumn(){return this.createEntityRelationColumn({title:"Domain",relation:I.cz,defaultKind:"domain",filter:{kind:"domain"}})},createSystemColumn(){return this.createEntityRelationColumn({title:"System",relation:I.cz,defaultKind:"system",filter:{kind:"system"}})},createMetadataDescriptionColumn(){return{title:"Description",field:"metadata.description",render:y=>(0,h.jsx)(R.Or,{text:y.metadata.description,placement:"bottom-start",line:2})}},createSpecLifecycleColumn(){return{title:"Lifecycle",field:"spec.lifecycle"}},createSpecTypeColumn(){return{title:"Type",field:"spec.type"}}}),Mn=[yn.createEntityRefColumn({defaultKind:"system"}),yn.createDomainColumn(),yn.createOwnerColumn(),yn.createMetadataDescriptionColumn()],gr=[yn.createEntityRefColumn({defaultKind:"component"}),yn.createSystemColumn(),yn.createOwnerColumn(),yn.createSpecTypeColumn(),yn.createSpecLifecycleColumn(),yn.createMetadataDescriptionColumn()],Nr=(0,Jt.Z)(y=>({empty:{padding:y.spacing(2),display:"flex",justifyContent:"center"}})),zn=y=>{const{entities:j,title:L,emptyContent:P,variant:ae="gridItem",columns:re,tableOptions:q={}}=y,he=Nr(),Ae={minWidth:"0",width:"100%"};return ae==="gridItem"&&(Ae.height="calc(100% - 10px)"),(0,h.jsx)(R.iA,{columns:re,title:L,style:Ae,emptyContent:P&&(0,h.jsx)("div",{className:he.empty,children:P}),options:{search:!1,paging:!1,actionsColumnIndex:-1,padding:"dense",draggable:!1,...q},data:j})};zn.columns=yn,zn.systemEntityColumns=Mn,zn.componentEntityColumns=gr;const Fr=(0,Jt.Z)({input:{}},{name:"CatalogReactEntityTagPicker"}),C=y=>{const j=Fr();return(0,h.jsx)(le,{label:"Tags",name:"tags",path:"metadata.tags",Filter:k,showCounts:y.showCounts,InputProps:{className:j.input}})},c=y=>{const{hidden:j,initialFilter:L}=y,P=(0,p.h_)(p.$v),{error:ae,availableTypes:re,selectedTypes:q,setSelectedTypes:he}=gt();if((0,F.useEffect)(()=>{ae&&P.post({message:"Failed to load entity types",severity:"error"}),L&&he([L])},[ae,P,L,he]),re.length===0||ae)return null;const Ae=[{value:"all",label:"all"},...re.map(ze=>({value:ze,label:ze}))];var Le;return j?null:(0,h.jsx)(D.Z,{pb:1,pt:1,children:(0,h.jsx)(R.Ph,{label:"Type",items:Ae,selected:(Le=Ae.length>1?q[0]:void 0)!==null&&Le!==void 0?Le:"all",onChange:ze=>he(ze==="all"?[]:[String(ze)])})})};var S=n(15459),E=n(61837),J=n(11640),ye=n(28347);const je=(0,S.Z)({root:{color:"#f3ba37"}})(J.Z),De=y=>{const{toggleStarredEntity:j,isStarredEntity:L}=hn(y.entity);return(0,h.jsx)(E.Z,{"aria-label":"favorite",color:"inherit",...y,onClick:()=>j(),children:(0,h.jsx)(_t.ZP,{title:L?"Remove from favorites":"Add to favorites",children:L?(0,h.jsx)(je,{}):(0,h.jsx)(ye.Z,{})})})};var et=n(8629),Gt=n(79249),xn=n(38724),qn=n(99152),mr=n(6487),jr=n(49429),bn=n(55999),Wr=n(39412);const lo=Wr.Z;function Co(y,j){if(y)return y.toLocaleLowerCase("en-US");if(j)try{return(0,I.of)(j).kind.toLocaleLowerCase("en-US")}catch{return}}function Ss(y,j){const L=(0,p.qD)(),P=Co(y,j);return P&&L.getSystemIcon(`kind:${P}`)||lo}function Vr(y){const{kind:j,entityRef:L,...P}=y,ae=Ss(j,L);return(0,h.jsx)(ae,{...P})}const Vo=(0,Jt.Z)(y=>({node:{fill:y.palette.grey[300],stroke:y.palette.grey[300],"&.primary":{fill:y.palette.primary.light,stroke:y.palette.primary.light},"&.secondary":{fill:y.palette.secondary.light,stroke:y.palette.secondary.light}},text:{fill:y.palette.getContrastText(y.palette.grey[300]),"&.primary":{fill:y.palette.primary.contrastText},"&.secondary":{fill:y.palette.secondary.contrastText},"&.focused":{fontWeight:"bold"}},clickable:{cursor:"pointer"}}));function Cs(y){var j,L;const P=(0,p.h_)(W),ae=(0,I.eE)(y),{loading:re,error:q,value:he}=(0,tt.default)(async()=>{const Ae=await P.getEntityAncestors({entityRef:ae}),Le=new Array,ze=new Array;for(const Ne of Ae.items){const We=(0,I.eE)(Ne.entity),it=We===Ae.rootEntityRef;Le.push({id:We,root:it,...Ne.entity});for(const Et of Ne.parentEntityRefs)ze.push({from:We,to:Et})}return{nodes:Le,edges:ze}},[ae]);return{loading:re,error:q,nodes:((j=he)===null||j===void 0?void 0:j.nodes)||[],edges:((L=he)===null||L===void 0?void 0:L.edges)||[]}}function Ho({node:y}){const j=Vo(),L=(0,Zt.s0)(),P=(0,p.tg)(Oe),[ae,re]=(0,F.useState)(0),[q,he]=(0,F.useState)(0),Ae=(0,F.useRef)(null);(0,F.useLayoutEffect)(()=>{if(Ae.current){let{height:He,width:At}=Ae.current.getBBox();He=Math.round(He),At=Math.round(At),(He!==q||At!==ae)&&(re(At),he(He))}},[ae,q]);const Le=10,ze=q,Ne=ze+Le,We=Ne+ae+Le*2,it=q+Le*2,Et=y.metadata.title||(y.kind&&y.metadata.name&&y.metadata.namespace?an({kind:y.kind,name:y.metadata.name,namespace:y.metadata.namespace||""}):y.id),Be=()=>{L(P({kind:y.kind,namespace:y.metadata.namespace||I.zG,name:y.metadata.name}))};return(0,h.jsxs)("g",{onClick:Be,className:j.clickable,children:[(0,h.jsx)("rect",{className:Re()(j.node,y.root?"secondary":"primary"),width:We,height:it,rx:10}),(0,h.jsx)(Vr,{kind:y.kind,y:Le,x:Le,width:ze,height:ze,className:Re()(j.text,y.root?"secondary":"primary")}),(0,h.jsx)("text",{ref:Ae,className:Re()(j.text,y.root?"secondary":"primary"),y:it/2,x:Ne+(ae+Le*2)/2,textAnchor:"middle",alignmentBaseline:"middle",children:Et})]})}function Go(y){const{loading:j,error:L,nodes:P,edges:ae}=Cs(y.entity);return j?(0,h.jsx)(R.Ex,{}):L?(0,h.jsx)(R.Gk,{error:L}):(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(bn.Z,{variant:"h2",children:"Ancestry"}),(0,h.jsxs)(bn.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,h.jsx)(R.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,h.jsx)(D.Z,{mt:4,children:(0,h.jsx)(R.mn,{nodes:P,edges:ae,renderNode:Ho,direction:R.NX.Direction.BOTTOM_TOP,zoom:"enable-on-click"})})]})}var Er=n(11776),lr=n(38402),Hr=n(86136),qr=n(99688),wo=n(49378),jo=n(54506),Zr=n(94339),Ko=n(24579),Eo=n(27685);const Nn=(0,Jt.Z)(y=>({root:{display:"flex",flexDirection:"column"},marginTop:{marginTop:y.spacing(2)},helpIcon:{marginLeft:y.spacing(1),color:y.palette.text.disabled},monospace:{fontFamily:"monospace"}}));function cr(y){const j=Nn();return(0,h.jsx)(wo.Z,{...y,primaryTypographyProps:{className:j.monospace},secondaryTypographyProps:{className:j.monospace}})}function Gr(y){const j=Nn();return(0,h.jsx)(jo.Z,{className:j.monospace,children:y.children})}function Kr(y){return(0,h.jsx)(D.Z,{mt:2,children:(0,h.jsx)(Zr.Z,{variant:"outlined",children:(0,h.jsxs)(Ko.Z,{children:[(0,h.jsxs)(A.Z,{variant:"h6",gutterBottom:!0,children:[y.title,y.helpLink&&(0,h.jsx)(Ao,{to:y.helpLink})]}),y.children]})})})}function Yo(y){if(y.match(/^url:https?:\/\//))return y.slice(4);if(y.match(/^https?:\/\//))return y}function vr(y){const[j,L]=y.entry,P=Yo(L);return(0,h.jsxs)(lr.Z,{children:[y.indent&&(0,h.jsx)(Hr.Z,{}),(0,h.jsx)(cr,{primary:j,secondary:P?(0,h.jsx)(R.rU,{to:P,children:L}):L})]})}function Ao(y){const j=Nn();return(0,h.jsx)(R.rU,{to:y.to,className:j.helpIcon,children:(0,h.jsx)(Eo.Z,{fontSize:"inherit"})})}const To=(0,Jt.Z)({root:{display:"flex",flexDirection:"column"}});function Ro(y){var j,L,P;const ae=(0,p.h_)(W),re=(0,I.eE)(y),q=(j=y.metadata.annotations)===null||j===void 0?void 0:j[I.P1],he=(L=y.metadata.annotations)===null||L===void 0?void 0:L[I.q1],{loading:Ae,error:Le,value:ze}=(0,tt.default)(async()=>!q&&!he?[]:(await ae.getEntities({filter:[...q?[{[`metadata.annotations.${I.P1}`]:q}]:[],...he?[{[`metadata.annotations.${I.q1}`]:he}]:[]]})).items,[q,he]);return{loading:Ae,error:Le,location:q,originLocation:he,colocatedEntities:(P=ze)===null||P===void 0?void 0:P.filter(Ne=>(0,I.eE)(Ne)!==re)}}function Ur(y){return(0,h.jsxs)(Er.Z,{dense:!0,children:[y.header&&(0,h.jsx)(vr,{entry:y.header},"header"),y.entities.map(j=>(0,h.jsxs)(lr.Z,{children:[(0,h.jsx)(Hr.Z,{children:(0,h.jsx)(Vr,{kind:j.kind})}),(0,h.jsx)(cr,{primary:(0,h.jsx)(jt,{entityRef:j})})]},(0,I.eE)(j)))]})}function Io(y){var j;const{entity:L}=y,{loading:P,error:ae,location:re,originLocation:q,colocatedEntities:he}=Ro(L);if(P)return(0,h.jsx)(R.Ex,{});if(ae)return(0,h.jsx)(R.Gk,{error:ae});if(!re&&!q)return(0,h.jsx)(qr.Z,{severity:"warning",children:"Entity had no location information."});if(!(!((j=he)===null||j===void 0)&&j.length))return(0,h.jsx)(qr.Z,{severity:"info",children:"There were no other entities on this location."});if(re===q)return(0,h.jsx)(Ur,{entities:he});const Ae=he.filter(ze=>{var Ne;return((Ne=ze.metadata.annotations)===null||Ne===void 0?void 0:Ne[I.P1])===re}),Le=he.filter(ze=>{var Ne;return((Ne=ze.metadata.annotations)===null||Ne===void 0?void 0:Ne[I.q1])===q});return(0,h.jsxs)(h.Fragment,{children:[Ae.length>0&&(0,h.jsx)(Ur,{entities:Ae,header:["At the same location",re]}),Le.length>0&&(0,h.jsx)(Ur,{entities:Le,header:["At the same origin",q]})]})}function Jo(y){const j=To();return(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(bn.Z,{variant:"h2",children:"Colocated"}),(0,h.jsx)(bn.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,h.jsx)("div",{className:j.root,children:(0,h.jsx)(Io,{entity:y.entity})})]})}function co(y){return Object.fromEntries([...Object.entries(y)].sort((j,L)=>j[0]<L[0]?-1:1))}function Po(y){return(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(bn.Z,{variant:"h2",children:"Entity as JSON"}),(0,h.jsx)(bn.Z,{children:"This is the raw entity data as received from the catalog, on JSON form."}),(0,h.jsx)(bn.Z,{children:(0,h.jsx)("div",{style:{fontSize:"75%"},"data-testid":"code-snippet",children:(0,h.jsx)(R.Oi,{text:JSON.stringify(co(y.entity),void 0,2),language:"json",showCopyCodeButton:!0})})})]})}var ws=n(3440),Lo=n.n(ws);const dr=(0,Jt.Z)({root:{display:"flex",flexDirection:"column"}});function ci(y){var j,L,P;const ae=dr(),{apiVersion:re,kind:q,metadata:he,spec:Ae,relations:Le=[],status:ze={}}=y.entity,Ne=Lo()(ft()(Le,We=>We.targetRef),"type");return(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(bn.Z,{variant:"h2",children:"Overview"}),(0,h.jsxs)("div",{className:ae.root,children:[(0,h.jsx)(Kr,{title:"Identity",children:(0,h.jsxs)(Er.Z,{dense:!0,children:[(0,h.jsx)(lr.Z,{children:(0,h.jsx)(cr,{primary:"apiVersion",secondary:re})}),(0,h.jsx)(lr.Z,{children:(0,h.jsx)(cr,{primary:"kind",secondary:q})}),((j=Ae)===null||j===void 0?void 0:j.type)&&(0,h.jsx)(lr.Z,{children:(0,h.jsx)(cr,{primary:"spec.type",secondary:Ae.type})}),he.uid&&(0,h.jsx)(lr.Z,{children:(0,h.jsx)(cr,{primary:"uid",secondary:he.uid})}),he.etag&&(0,h.jsx)(lr.Z,{children:(0,h.jsx)(cr,{primary:"etag",secondary:he.etag})})]})}),(0,h.jsxs)(Kr,{title:"Metadata",children:[!!Object.keys(he.annotations||{}).length&&(0,h.jsx)(Er.Z,{dense:!0,subheader:(0,h.jsxs)(Gr,{children:["Annotations",(0,h.jsx)(Ao,{to:"https://backstage.io/docs/features/software-catalog/well-known-annotations"})]}),children:Object.entries(he.annotations).map(We=>(0,h.jsx)(vr,{indent:!0,entry:We},We[0]))}),!!Object.keys(he.labels||{}).length&&(0,h.jsx)(Er.Z,{dense:!0,subheader:(0,h.jsx)(Gr,{children:"Labels"}),children:Object.entries(he.labels).map(We=>(0,h.jsx)(vr,{indent:!0,entry:We},We[0]))}),!!(!((L=he.tags)===null||L===void 0)&&L.length)&&(0,h.jsx)(Er.Z,{dense:!0,subheader:(0,h.jsx)(Gr,{children:"Tags"}),children:he.tags.map((We,it)=>(0,h.jsxs)(lr.Z,{children:[(0,h.jsx)(Hr.Z,{}),(0,h.jsx)(cr,{primary:We})]},`${We}-${it}`))})]}),!!Le.length&&(0,h.jsx)(Kr,{title:"Relations",helpLink:"https://backstage.io/docs/features/software-catalog/well-known-relations",children:Object.entries(Ne).map(([We,it],Et)=>(0,h.jsx)("div",{children:(0,h.jsx)(Er.Z,{dense:!0,subheader:(0,h.jsx)(Gr,{children:We}),children:it.map(Be=>(0,h.jsxs)(lr.Z,{children:[(0,h.jsx)(Hr.Z,{children:(0,h.jsx)(Vr,{entityRef:Be.targetRef})}),(0,h.jsx)(cr,{primary:(0,h.jsx)(jt,{entityRef:Be.targetRef})})]},Be.targetRef))})},Et))}),!!(!((P=ze.items)===null||P===void 0)&&P.length)&&(0,h.jsx)(Kr,{title:"Status",helpLink:"https://backstage.io/docs/features/software-catalog/well-known-statuses",children:ze.items.map((We,it)=>(0,h.jsxs)("div",{children:[(0,h.jsxs)(A.Z,{children:[We.level,": ",We.type]}),(0,h.jsx)(D.Z,{ml:2,children:We.message})]},it))})]})]})}var Qo=n(72847);function js(y){return(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(bn.Z,{variant:"h2",children:"Entity as YAML"}),(0,h.jsx)(bn.Z,{children:"This is the raw entity data as received from the catalog, on YAML form."}),(0,h.jsx)(bn.Z,{children:(0,h.jsx)("div",{style:{fontSize:"75%"},"data-testid":"code-snippet",children:(0,h.jsx)(R.Oi,{text:Qo.ZP.stringify(co(y.entity)),language:"yaml",showCopyCodeButton:!0})})})]})}const uo=(0,Jt.Z)(y=>({fullHeightDialog:{height:"calc(100% - 64px)"},root:{display:"flex",flexGrow:1,width:"100%",backgroundColor:y.palette.background.paper},tabs:{borderRight:`1px solid ${y.palette.divider}`,flexShrink:0},tabContents:{flexGrow:1,overflowX:"auto"}}));function eo(y){const{children:j,value:L,index:P,...ae}=y,re=uo();return(0,h.jsx)("div",{role:"tabpanel",hidden:L!==P,id:`vertical-tabpanel-${P}`,"aria-labelledby":`vertical-tab-${P}`,className:re.tabContents,...ae,children:L===P&&(0,h.jsx)(D.Z,{pl:3,pr:3,children:j})})}function to(y){return{id:`vertical-tab-${y}`,"aria-controls":`vertical-tabpanel-${y}`}}function no(y){const j=uo(),[L,P]=F.useState(0);return(0,F.useEffect)(()=>{P(0)},[y.open]),y.entity?(0,h.jsxs)(et.Z,{fullWidth:!0,maxWidth:"xl",open:y.open,onClose:y.onClose,"aria-labelledby":"entity-inspector-dialog-title",PaperProps:{className:j.fullHeightDialog},children:[(0,h.jsx)(Gt.Z,{id:"entity-inspector-dialog-title",children:"Entity Inspector"}),(0,h.jsx)(xn.Z,{dividers:!0,children:(0,h.jsxs)("div",{className:j.root,children:[(0,h.jsxs)(qn.Z,{orientation:"vertical",variant:"scrollable",value:L,onChange:(ae,re)=>P(re),"aria-label":"Inspector options",className:j.tabs,children:[(0,h.jsx)(mr.Z,{label:"Overview",...to(0)}),(0,h.jsx)(mr.Z,{label:"Ancestry",...to(1)}),(0,h.jsx)(mr.Z,{label:"Colocated",...to(2)}),(0,h.jsx)(mr.Z,{label:"Raw JSON",...to(3)}),(0,h.jsx)(mr.Z,{label:"Raw YAML",...to(4)})]}),(0,h.jsx)(eo,{value:L,index:0,children:(0,h.jsx)(ci,{entity:y.entity})}),(0,h.jsx)(eo,{value:L,index:1,children:(0,h.jsx)(Go,{entity:y.entity})}),(0,h.jsx)(eo,{value:L,index:2,children:(0,h.jsx)(Jo,{entity:y.entity})}),(0,h.jsx)(eo,{value:L,index:3,children:(0,h.jsx)(Po,{entity:y.entity})}),(0,h.jsx)(eo,{value:L,index:4,children:(0,h.jsx)(js,{entity:y.entity})})]})}),(0,h.jsx)(jr.Z,{children:(0,h.jsx)(z.Z,{onClick:y.onClose,color:"primary",children:"Close"})})]}):null}var Ar=n(85256);function er(y){var j;const L=(0,p.h_)(W),P=(j=y.metadata.annotations)===null||j===void 0?void 0:j[I.q1],ae=y.metadata.uid,re=P==="bootstrap:bootstrap",q=(0,tt.default)(async()=>{const Et=L.getLocationByRef(P);let Be;if(!P)Be=Promise.resolve([]);else{const He=`metadata.annotations.${I.q1}`;Be=L.getEntities({filter:{[He]:P},fields:["kind","metadata.uid","metadata.name","metadata.namespace"]}).then(At=>At.items)}return Promise.all([Et,Be]).then(([He,At])=>({location:He,colocatedEntities:At}))},[L,y]),he=(0,F.useCallback)(async function(){const{location:Be}=q.value;await L.removeLocationById(Be.id)},[L,q]),Ae=(0,F.useCallback)(async function(){await L.removeEntityByUid(ae)},[L,ae]);if(re)return{type:"bootstrap",location:P,deleteEntity:Ae};const{loading:Le,error:ze,value:Ne}=q;if(Le)return{type:"loading"};if(ze)return{type:"error",error:ze};const{location:We,colocatedEntities:it}=Ne;return We?{type:"unregister",location:P,colocatedEntities:it.map(I.iB),unregisterLocation:he,deleteEntity:Ae}:{type:"only-delete",deleteEntity:Ae}}var ho=n(23054);const Xo=(0,Jt.Z)({advancedButton:{fontSize:"0.7em"},dialogActions:{display:"inline-block"}}),Es=({entity:y,onConfirm:j,onClose:L})=>{const P=(0,p.h_)(p.$v),ae=(0,p.h_)(p.Ds),re=Xo(),q=er(y),[he,Ae]=(0,F.useState)(!1),[Le,ze]=(0,F.useState)(!1);var Ne;const We=(Ne=ae.getOptionalString("app.title"))!==null&&Ne!==void 0?Ne:"Backstage",it=(0,F.useCallback)(async function(){if("unregisterLocation"in q){ze(!0);try{await q.unregisterLocation(),j()}catch(At){(0,ho.BD)(At),P.post({message:At.message})}finally{ze(!1)}}},[P,j,q]),Et=(0,F.useCallback)(async function(){if("deleteEntity"in q){ze(!0);try{await q.deleteEntity(),j()}catch(At){(0,ho.BD)(At),P.post({message:At.message})}finally{ze(!1)}}},[P,j,q]),Be=()=>(0,h.jsx)(jr.Z,{className:re.dialogActions,children:(0,h.jsx)(z.Z,{onClick:L,color:"primary",children:"Cancel"})});return q.type==="loading"?(0,h.jsx)(R.Ex,{}):q.type==="error"?(0,h.jsx)(R.Gk,{error:q.error}):q.type==="bootstrap"?(0,h.jsxs)(h.Fragment,{children:[(0,h.jsxs)(qr.Z,{severity:"info",children:['You cannot unregister this entity, since it originates from a protected Backstage configuration (location "',q.location,'"). If you believe this is in error, please contact the ',We," ","integrator."]}),(0,h.jsxs)(D.Z,{marginTop:2,children:[!he&&(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(z.Z,{variant:"text",size:"small",color:"primary",className:re.advancedButton,onClick:()=>Ae(!0),children:"Advanced Options"}),(0,h.jsx)(Be,{})]}),he&&(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(bn.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,h.jsx)(z.Z,{variant:"contained",color:"secondary",disabled:Le,onClick:Et,children:"Delete Entity"}),(0,h.jsx)(Be,{})]})]})]}):q.type==="only-delete"?(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(bn.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,h.jsx)(z.Z,{variant:"contained",color:"secondary",disabled:Le,onClick:Et,children:"Delete Entity"}),(0,h.jsx)(Be,{})]}):q.type==="unregister"?(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(bn.Z,{children:"This action will unregister the following entities:"}),(0,h.jsx)(bn.Z,{component:"ul",children:q.colocatedEntities.map(He=>(0,h.jsx)("li",{children:(0,h.jsx)(jt,{entityRef:He})},`${He.kind}:${He.namespace}/${He.name}`))}),(0,h.jsx)(bn.Z,{children:"Located at the following location:"}),(0,h.jsx)(bn.Z,{component:"ul",children:(0,h.jsx)("li",{children:q.location})}),(0,h.jsxs)(bn.Z,{children:["To undo, just re-register the entity in ",We,"."]}),(0,h.jsxs)(D.Z,{marginTop:2,children:[(0,h.jsx)(z.Z,{variant:"contained",color:"secondary",disabled:Le,onClick:it,children:"Unregister Location"}),!he&&(0,h.jsx)(D.Z,{component:"span",marginLeft:2,children:(0,h.jsx)(z.Z,{variant:"text",size:"small",color:"primary",className:re.advancedButton,onClick:()=>Ae(!0),children:"Advanced Options"})})]}),he&&(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(D.Z,{paddingTop:4,paddingBottom:4,children:(0,h.jsx)(Ar.Z,{})}),(0,h.jsx)(bn.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,h.jsx)(z.Z,{variant:"contained",color:"secondary",disabled:Le,onClick:Et,children:"Delete Entity"})]})]}):(0,h.jsx)(qr.Z,{severity:"error",children:"Internal error: Unknown state"})},ro=y=>{const{open:j,onConfirm:L,onClose:P,entity:ae}=y;return(0,h.jsxs)(et.Z,{open:j,onClose:P,children:[(0,h.jsx)(Gt.Z,{id:"responsive-dialog-title",children:"Are you sure you want to unregister this entity?"}),(0,h.jsx)(xn.Z,{children:(0,h.jsx)(Es,{entity:ae,onConfirm:L,onClose:P})})]})};var _o=n(12231),As=n(9520),qo=n(47603);const es=(0,Jt.Z)(y=>({root:{backgroundColor:"rgba(0, 0, 0, .11)",boxShadow:"none",margin:y.spacing(1,0,1,0)},title:{margin:y.spacing(1,0,0,1),textTransform:"uppercase",fontSize:12,fontWeight:"bold"},listIcon:{minWidth:30,color:y.palette.text.primary},menuItem:{minHeight:y.spacing(6)},groupWrapper:{margin:y.spacing(1,1,2,1)}}),{name:"CatalogReactUserListPicker"});function po(y){return[{name:"Personal",items:[{id:"owned",label:"Owned",icon:qo.Z},{id:"starred",label:"Starred",icon:J.Z}]},{name:y!=null?y:"Company",items:[{id:"all",label:"All"}]}]}const Oo=y=>{const{initialFilter:j,availableFilters:L}=y,P=es(),ae=(0,p.h_)(p.Ds);var re;const q=(re=ae.getOptionalString("organization.name"))!==null&&re!==void 0?re:"Company",{filters:he,updateFilters:Ae,backendEntities:Le,queryParameters:{kind:ze,user:Ne},loading:We}=rt(),it=["starred","all"],Et=po(q).map(Wn=>({...Wn,items:Wn.items.filter(({id:fn})=>["group","user"].some(kn=>kn===ze)?it.includes(fn):!L||L.includes(fn))})).filter(({items:Wn})=>!!Wn.length),{isStarredEntity:Be}=ln(),{isOwnedEntity:He,loading:At}=Cn(),rn=We||At,En=(0,F.useMemo)(()=>new Tt("owned",He,Be),[He,Be]),Ot=(0,F.useMemo)(()=>new Tt("starred",He,Be),[He,Be]),Rt=(0,F.useMemo)(()=>[Ne].flat()[0],[Ne]),[Kt,An]=(0,F.useState)(Rt!=null?Rt:j),ur=(0,F.useMemo)(()=>Le.filter((0,U.Gz)((0,ut.compact)(Object.values({...he,user:void 0})))),[he,Le]),Tr=(0,F.useMemo)(()=>({all:ur.length,starred:ur.filter(Wn=>Ot.filterEntity(Wn)).length,owned:ur.filter(Wn=>En.filterEntity(Wn)).length}),[ur,Ot,En]);(0,F.useEffect)(()=>{Rt&&An(Rt)},[Rt]),(0,F.useEffect)(()=>{!rn&&Kt&&Kt!=="all"&&Tr[Kt]===0&&An("all")},[rn,Tr,Kt,An]),(0,F.useEffect)(()=>{Ae({user:Kt?new Tt(Kt,He,Be):void 0})},[Kt,He,Be,Ae]);var Yr;return(0,h.jsx)(Zr.Z,{className:P.root,children:Et.map(Wn=>(0,h.jsxs)(F.Fragment,{children:[(0,h.jsx)(A.Z,{variant:"subtitle2",component:"span",className:P.title,children:Wn.name}),(0,h.jsx)(Zr.Z,{className:P.groupWrapper,children:(0,h.jsx)(Er.Z,{disablePadding:!0,dense:!0,role:"menu","aria-label":Wn.name,children:Wn.items.map(fn=>{var kn;return(0,h.jsxs)(_o.Z,{role:"none presentation",button:!0,divider:!0,onClick:()=>An(fn.id),selected:fn.id===((kn=he.user)===null||kn===void 0?void 0:kn.value),className:P.menuItem,disabled:Tr[fn.id]===0,"data-testid":`user-picker-${fn.id}`,tabIndex:0,ContainerProps:{role:"menuitem"},children:[fn.icon&&(0,h.jsx)(Hr.Z,{className:P.listIcon,children:(0,h.jsx)(fn.icon,{fontSize:"small"})}),(0,h.jsx)(wo.Z,{children:(0,h.jsxs)(A.Z,{variant:"body1",children:[fn.label," "]})}),(0,h.jsx)(As.Z,{children:(Yr=Tr[fn.id])!==null&&Yr!==void 0?Yr:"-"})]},fn.id)})})})]},Wn.name))})},fo=(0,Jt.Z)({input:{}},{name:"CatalogReactEntityProcessingStatusPickerPicker"}),Ts=(0,h.jsx)(Rn.Z,{fontSize:"small"}),di=(0,h.jsx)(Dn.Z,{fontSize:"small"}),ts=()=>{const y=fo(),{updateFilters:j}=rt(),[L,P]=(0,F.useState)([]);function ae(he){j({orphan:he?new Nt(he):void 0})}function re(he){j({error:he?new Yt(he):void 0})}const q=["Is Orphan","Has Error"];return(0,h.jsx)(D.Z,{pb:1,pt:1,children:(0,h.jsxs)(A.Z,{variant:"button",component:"label",children:["Processing Status",(0,h.jsx)(Ye.ZP,{multiple:!0,disableCloseOnSelect:!0,options:q,value:L,onChange:(he,Ae)=>{P(Ae),ae(Ae.includes("Is Orphan")),re(Ae.includes("Has Error"))},renderOption:(he,{selected:Ae})=>(0,h.jsx)(sn.Z,{control:(0,h.jsx)(Tn.Z,{icon:Ts,checkedIcon:di,checked:Ae}),onClick:Le=>Le.preventDefault(),label:he}),size:"small",popupIcon:(0,h.jsx)(Wt.Z,{"data-testid":"processing-status-picker-expand"}),renderInput:he=>(0,h.jsx)(we.Z,{...he,className:y.input,variant:"outlined"})})]})})},ns=(0,Jt.Z)({input:{}},{name:"CatalogReactEntityNamespacePicker"}),cn=()=>{const y=ns();return(0,h.jsx)(le,{label:"Namespace",name:"namespace",path:"metadata.namespace",Filter:Ut,InputProps:{className:y.input}})};function Rs(y){var j;const{children:L,value:P}=y;var ae;const[re,q]=useState((ae=(j=P)===null||j===void 0?void 0:j.filters)!==null&&ae!==void 0?ae:{}),he=useCallback(Be=>{q(He=>{const At=typeof Be=="function"?Be(He):Be;return{...He,...At}})},[]),Ae=useMemo(()=>({entities:[],backendEntities:[],queryParameters:{}}),[]);var Le,ze,Ne,We,it;const Et=useMemo(()=>{var Be,He,At,rn,En,Ot;return{entities:(Le=(Be=P)===null||Be===void 0?void 0:Be.entities)!==null&&Le!==void 0?Le:Ae.entities,backendEntities:(ze=(He=P)===null||He===void 0?void 0:He.backendEntities)!==null&&ze!==void 0?ze:Ae.backendEntities,updateFilters:(Ne=(At=P)===null||At===void 0?void 0:At.updateFilters)!==null&&Ne!==void 0?Ne:he,filters:re,loading:(We=(rn=P)===null||rn===void 0?void 0:rn.loading)!==null&&We!==void 0?We:!1,queryParameters:(it=(En=P)===null||En===void 0?void 0:En.queryParameters)!==null&&it!==void 0?it:Ae.queryParameters,error:(Ot=P)===null||Ot===void 0?void 0:Ot.error}},[P,Ae,re,he]);return _jsx(EntityListContext.Provider,{value:Et,children:L})}},75435:function(It,Pe,n){"use strict";n.d(Pe,{h:function(){return p}});var r=n(25271);function p(W,f,V){var m,h,F;let ve=((h=W)===null||h===void 0||(m=h.relations)===null||m===void 0?void 0:m.filter(ce=>ce.type===f).map(ce=>(0,r.of)(ce.targetRef)))||[];return!((F=V)===null||F===void 0)&&F.kind&&(ve=ve.filter(ce=>ce.kind.toLocaleLowerCase("en-US")===V.kind.toLocaleLowerCase("en-US"))),ve}},49280:function(It,Pe,n){"use strict";n.d(Pe,{hF:function(){return W.h},CV:function(){return V},wq:function(){return r},Gz:function(){return p}});function r(h){return h.reduce((F,ve)=>({...F,...ve.getCatalogFilters?ve.getCatalogFilters():{}}),{})}function p(h){return F=>h.every(ve=>!ve.filterEntity||ve.filterEntity(F))}var W=n(75435),f=n(25271);function V(h,F){var ve;const ce=(ve=h.metadata.annotations)===null||ve===void 0?void 0:ve[f.M6];if(ce)try{var z;const de=(0,f.Ou)(ce),D=F.byUrl(de.target);return{locationTargetUrl:de.target,integrationType:(z=D)===null||z===void 0?void 0:z.type}}catch{return}}function m(h,F){const ve=new Set([...getEntityRelations(h,RELATION_MEMBER_OF,{kind:"group"}),...h?[getCompoundEntityRef(h)]:[]].map(stringifyEntityRef)),ce=getEntityRelations(F,RELATION_OWNED_BY).map(stringifyEntityRef);for(const z of ce)if(ve.has(z))return!0;return!1}},8799:function(It,Pe,n){"use strict";n.r(Pe),n.d(Pe,{AboutCard:function(){return Yt},AboutContent:function(){return Tt},AboutField:function(){return Ge}});var r=n(52322),p=n(25271),W=n(53974),f=n(60871),V=n(32838),m=n(39709),h=JSON.parse('{"$schema":"http://json-schema.org/draft-07/schema","$id":"TemplateV1beta3","description":"A Template describes a scaffolding task for use with the Scaffolder. It describes the required parameters as well as a series of steps that will be taken to execute the scaffolding task.","examples":[{"apiVersion":"scaffolder.backstage.io/v1beta3","kind":"Template","metadata":{"name":"react-ssr-template","title":"React SSR Template","description":"Next.js application skeleton for creating isomorphic web applications.","tags":["recommended","react"]},"spec":{"owner":"artist-relations-team","parameters":{"required":["name","description","repoUrl"],"backstage:permissions":{"tags":["one","two"]},"properties":{"name":{"title":"Name","type":"string","description":"Unique name of the component"},"description":{"title":"Description","type":"string","description":"Description of the component"},"repoUrl":{"title":"Pick a repository","type":"string","ui:field":"RepoUrlPicker"}}},"steps":[{"id":"fetch","name":"Fetch","action":"fetch:plain","parameters":{"url":"./template"},"backstage:permissions":{"tags":["one","two"]}},{"id":"publish","name":"Publish to GitHub","action":"publish:github","parameters":{"repoUrl":"${{ parameters.repoUrl }}"},"if":"${{ parameters.repoUrl }}"}],"output":{"catalogInfoUrl":"${{ steps.publish.output.catalogInfoUrl }}"}}}],"allOf":[{"$ref":"Entity"},{"type":"object","required":["spec"],"properties":{"apiVersion":{"enum":["scaffolder.backstage.io/v1beta3"]},"kind":{"enum":["Template"]},"spec":{"type":"object","required":["type","steps"],"properties":{"type":{"type":"string","description":"The type of component created by the template. The software catalog accepts any type value, but an organization should take great care to establish a proper taxonomy for these. Tools including Backstage itself may read this field and behave differently depending on its value. For example, a website type component may present tooling in the Backstage interface that is specific to just websites.","examples":["service","website","library"],"minLength":1},"owner":{"type":"string","description":"The user (or group) owner of the template","minLength":1},"parameters":{"oneOf":[{"type":"object","description":"The JSONSchema describing the inputs for the template.","properties":{"backstage:permissions":{"type":"object","description":"Object used for authorizing the parameter","properties":{"tags":{"type":"array","items":{"type":"string"}}}}}},{"type":"array","description":"A list of separate forms to collect parameters.","items":{"type":"object","description":"The JSONSchema describing the inputs for the template.","properties":{"backstage:permissions":{"type":"object","description":"Object used for authorizing the parameter","properties":{"tags":{"type":"array","items":{"type":"string"}}}}}}}]},"steps":{"type":"array","description":"A list of steps to execute.","items":{"type":"object","description":"A description of the step to execute.","required":["action"],"properties":{"id":{"type":"string","description":"The ID of the step, which can be used to refer to its outputs."},"name":{"type":"string","description":"The name of the step, which will be displayed in the UI during the scaffolding process."},"action":{"type":"string","description":"The name of the action to execute."},"input":{"type":"object","description":"A templated object describing the inputs to the action."},"if":{"type":["string","boolean"],"description":"A templated condition that skips the step when evaluated to false. If the condition is true or not defined, the step is executed. The condition is true, if the input is not `false`, `undefined`, `null`, `\\"\\"`, `0`, or `[]`."},"backstage:permissions":{"type":"object","description":"Object used for authorizing the step","properties":{"tags":{"type":"array","items":{"type":"string"}}}}}}},"output":{"type":"object","description":"A templated object describing the outputs of the scaffolding task.","properties":{"links":{"type":"array","description":"A list of external hyperlinks, typically pointing to resources created or updated by the template","items":{"type":"object","required":[],"properties":{"url":{"type":"string","description":"A url in a standard uri format.","examples":["https://github.com/my-org/my-new-repo"],"minLength":1},"entityRef":{"type":"string","description":"An entity reference to an entity in the catalog.","examples":["Component:default/my-app"],"minLength":1},"title":{"type":"string","description":"A user friendly display name for the link.","examples":["View new repo"],"minLength":1},"icon":{"type":"string","description":"A key representing a visual icon to be displayed in the UI.","examples":["dashboard"],"minLength":1}}}},"text":{"type":"array","description":"A list of Markdown text blobs, like output data from the template.","items":{"type":"object","required":[],"properties":{"title":{"type":"string","description":"A user friendly display name for the text.","examples":["Output Content"],"minLength":1},"icon":{"type":"string","description":"A key representing a visual icon to be displayed in the UI.","examples":["dashboard"],"minLength":1},"content":{"type":"string","description":"The text blob to display in the UI, rendered as Markdown.","examples":["**hey** _I\'m_ Markdown"]}}}}},"additionalProperties":{"type":"string"}}}}}}]}');const F=(0,p.wI)(h),ve={async check(dt){return F(dt)===dt}},ce=dt=>dt.apiVersion==="scaffolder.backstage.io/v1beta3"&&dt.kind==="Template";var z=n(79692),de=n(94339),D=n(32552),A=n(61837),se=n(85256),ie=n(24579),ee=n(88188),X=n(52866),K=n(30254),R=n(27604),w=n(2784),I=n(19625),U=n(60905),xe=n(7089),Se=n(90436);const k=(0,z.Z)(dt=>({value:{fontWeight:"bold",overflow:"hidden",lineHeight:"24px",wordBreak:"break-word"},label:{color:dt.palette.text.secondary,textTransform:"uppercase",fontSize:"10px",fontWeight:"bold",letterSpacing:.5,overflow:"hidden",whiteSpace:"nowrap"}}));function Ge(dt){const{label:ut,value:St,gridSizes:lt,children:Zt}=dt,Ht=k(),Ce=(0,f.vJ)(Zt,Ke=>Ke.getElements()),$e=Ce.length>0?Ce:(0,r.jsx)(Se.Z,{variant:"body2",className:Ht.value,children:St||"unknown"});return(0,r.jsxs)(U.Z,{item:!0,...lt,children:[(0,r.jsx)(Se.Z,{variant:"h2",className:Ht.label,children:ut}),$e]})}var xt=n(24851);const Dt=(0,z.Z)({description:{wordBreak:"break-word"}});function Ut(dt,ut,St){if(ut==="url"||dt.includes("://"))return dt;const lt=St.type==="file"?`file://${St.target}`:St.target;return ut==="file"||St.type==="file"?new URL(dt,lt).href:lt}function Tt(dt){var ut,St,lt,Zt,Ht,Ce,$e,Ke,ht,rt,tt,vt,ot,Qe,ft,gt;const{entity:Ct}=dt,mn=Dt(),un=Ct.kind.toLocaleLowerCase("en-US")==="system",ln=Ct.kind.toLocaleLowerCase("en-US")==="resource",Sn=Ct.kind.toLocaleLowerCase("en-US")==="component",hn=Ct.kind.toLocaleLowerCase("en-US")==="api",vn=Ct.kind.toLocaleLowerCase("en-US")==="template",Cn=Ct.kind.toLocaleLowerCase("en-US")==="location",on=Ct.kind.toLocaleLowerCase("en-US")==="group",pn=(0,m.hF)(Ct,p.cz,{kind:"system"}),wn=(0,m.hF)(Ct,p.cz,{kind:"component"}),_e=(0,m.hF)(Ct,p.cz,{kind:"domain"}),Jt=(0,m.hF)(Ct,p.S4);let Wt;try{Wt=(0,p.CV)(Ct)}catch{Wt=void 0}return(0,r.jsxs)(U.Z,{container:!0,children:[(0,r.jsx)(Ge,{label:"Description",gridSizes:{xs:12},children:(0,r.jsx)(W.SA,{className:mn.description,content:((St=Ct)===null||St===void 0||(ut=St.metadata)===null||ut===void 0?void 0:ut.description)||"No description"})}),(0,r.jsx)(Ge,{label:"Owner",value:"No Owner",gridSizes:{xs:12,sm:6,lg:4},children:Jt.length>0&&(0,r.jsx)(m.rI,{entityRefs:Jt,defaultKind:"group"})}),(un||_e.length>0)&&(0,r.jsx)(Ge,{label:"Domain",value:"No Domain",gridSizes:{xs:12,sm:6,lg:4},children:_e.length>0&&(0,r.jsx)(m.rI,{entityRefs:_e,defaultKind:"domain"})}),(hn||Sn||ln||pn.length>0)&&(0,r.jsx)(Ge,{label:"System",value:"No System",gridSizes:{xs:12,sm:6,lg:4},children:pn.length>0&&(0,r.jsx)(m.rI,{entityRefs:pn,defaultKind:"system"})}),Sn&&wn.length>0&&(0,r.jsx)(Ge,{label:"Parent Component",value:"No Parent Component",gridSizes:{xs:12,sm:6,lg:4},children:(0,r.jsx)(m.rI,{entityRefs:wn,defaultKind:"component"})}),(hn||Sn||ln||vn||on||Cn||typeof((Zt=Ct)===null||Zt===void 0||(lt=Zt.spec)===null||lt===void 0?void 0:lt.type)=="string")&&(0,r.jsx)(Ge,{label:"Type",value:(Ce=Ct)===null||Ce===void 0||(Ht=Ce.spec)===null||Ht===void 0?void 0:Ht.type,gridSizes:{xs:12,sm:6,lg:4}}),(hn||Sn||typeof((Ke=Ct)===null||Ke===void 0||($e=Ke.spec)===null||$e===void 0?void 0:$e.lifecycle)=="string")&&(0,r.jsx)(Ge,{label:"Lifecycle",value:(rt=Ct)===null||rt===void 0||(ht=rt.spec)===null||ht===void 0?void 0:ht.lifecycle,gridSizes:{xs:12,sm:6,lg:4}}),(0,r.jsx)(Ge,{label:"Tags",value:"No Tags",gridSizes:{xs:12,sm:6,lg:4},children:(((vt=Ct)===null||vt===void 0||(tt=vt.metadata)===null||tt===void 0?void 0:tt.tags)||[]).map(Ye=>(0,r.jsx)(xe.Z,{size:"small",label:Ye},Ye))}),Cn&&(((Qe=Ct)===null||Qe===void 0||(ot=Qe.spec)===null||ot===void 0?void 0:ot.targets)||((gt=Ct)===null||gt===void 0||(ft=gt.spec)===null||ft===void 0?void 0:ft.target))&&(0,r.jsx)(Ge,{label:"Targets",gridSizes:{xs:12},children:(0,r.jsx)(xt.s,{cols:1,items:(Ct.spec.targets||[Ct.spec.target]).map(Ye=>Ye).map(Ye=>{var Tn,sn;return{text:Ye,href:Ut(Ye,((sn=Ct)===null||sn===void 0||(Tn=sn.spec)===null||Tn===void 0?void 0:Tn.type)||"unknown",Wt)}})})})]})}const Nt=(0,z.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 Yt(dt){var ut,St,lt,Zt,Ht,Ce,$e;const{variant:Ke}=dt,ht=(0,f.qD)(),rt=Nt(),{entity:tt}=(0,m.X2)(),vt=(0,f.h_)(V.q3),ot=(0,f.h_)(m.Ah),Qe=(0,f.h_)(f.$v),ft=(0,f.h_)(f.VE),gt=(0,f.tg)(I.jU),Ct=(0,f.tg)(I.ql),mn=(0,m.CV)(tt,vt),un=(ut=tt.metadata.annotations)===null||ut===void 0?void 0:ut[p.Tf],ln={label:"View Source",disabled:!mn,icon:(0,r.jsx)(V.nW,{type:(St=mn)===null||St===void 0?void 0:St.integrationType}),href:(lt=mn)===null||lt===void 0?void 0:lt.locationTargetUrl},Sn={label:"View TechDocs",disabled:!(!((Zt=tt.metadata.annotations)===null||Zt===void 0)&&Zt["backstage.io/techdocs-ref"])||!gt,icon:(0,r.jsx)(K.Z,{}),href:gt&>({namespace:tt.metadata.namespace||p.zG,kind:tt.kind,name:tt.metadata.name})},hn=[ln,Sn];if(ce(tt)){var vn;const Jt=(vn=ht.getSystemIcon("scaffolder"))!==null&&vn!==void 0?vn:ee.Z,Wt={label:"Launch Template",icon:(0,r.jsx)(Jt,{}),disabled:!Ct,href:Ct&&Ct({templateName:tt.metadata.name,namespace:tt.metadata.namespace||p.zG})};hn.push(Wt)}let Cn="";Ke==="gridItem"?Cn=rt.gridItemCard:Ke==="fullHeight"&&(Cn=rt.fullHeightCard);let on="";Ke==="gridItem"?on=rt.gridItemCardContent:Ke==="fullHeight"&&(on=rt.fullHeightCardContent);const pn=(Ht=tt.metadata.annotations)===null||Ht===void 0?void 0:Ht[p.P1],wn=((Ce=pn)===null||Ce===void 0?void 0:Ce.startsWith("url:"))||(($e=pn)===null||$e===void 0?void 0:$e.startsWith("file:")),_e=(0,w.useCallback)(async()=>{try{await ot.refreshEntity((0,p.eE)(tt)),Qe.post({message:"Refresh scheduled",severity:"info",display:"transient"})}catch(Jt){ft.post(Jt)}},[ot,Qe,ft,tt]);return(0,r.jsxs)(de.Z,{className:Cn,children:[(0,r.jsx)(D.Z,{title:"About",action:(0,r.jsxs)(r.Fragment,{children:[wn&&(0,r.jsx)(A.Z,{"aria-label":"Refresh",title:"Schedule entity refresh",onClick:_e,children:(0,r.jsx)(X.Z,{})}),(0,r.jsx)(A.Z,{component:W.rU,"aria-label":"Edit",disabled:!un,title:"Edit Metadata",to:un!=null?un:"#",children:(0,r.jsx)(R.Z,{})})]}),subheader:(0,r.jsx)(W.M6,{links:hn})}),(0,r.jsx)(se.Z,{}),(0,r.jsx)(ie.Z,{className:on,children:(0,r.jsx)(Tt,{entity:tt})})]})}},86359:function(It,Pe,n){"use strict";n.d(Pe,{E:function(){return K}});var r=n(52322),p=n(25271),W=n(53974),f=n(39709),V=n(90436),m=n(15459),h=n(27604),F=n(2997),ve=n(11640),ce=n(28347),z=n(76635),de=n(2784),D=n(7089);const A=Object.freeze({createNameColumn(R){function w(I){var U,xe;return((U=I.metadata)===null||U===void 0?void 0:U.title)||(0,f.$3)(I,{defaultKind:(xe=R)===null||xe===void 0?void 0:xe.defaultKind})}return{title:"Name",field:"resolved.name",highlight:!0,customSort({entity:I},{entity:U}){return w(I).localeCompare(w(U))},render:({entity:I})=>{var U,xe;return(0,r.jsx)(f.dx,{entityRef:I,defaultKind:((U=R)===null||U===void 0?void 0:U.defaultKind)||"Component",title:(xe=I.metadata)===null||xe===void 0?void 0:xe.title})}}},createSystemColumn(){return{title:"System",field:"resolved.partOfSystemRelationTitle",render:({resolved:R})=>(0,r.jsx)(f.rI,{entityRefs:R.partOfSystemRelations,defaultKind:"system"})}},createOwnerColumn(){return{title:"Owner",field:"resolved.ownedByRelationsTitle",render:({resolved:R})=>(0,r.jsx)(f.rI,{entityRefs:R.ownedByRelations,defaultKind:"group"})}},createSpecTargetsColumn(){return{title:"Targets",field:"entity.spec.targets",render:({entity:R})=>{var w,I,U,xe;return(0,r.jsx)(r.Fragment,{children:(((I=R)===null||I===void 0||(w=I.spec)===null||w===void 0?void 0:w.targets)||((xe=R)===null||xe===void 0||(U=xe.spec)===null||U===void 0?void 0:U.target))&&(0,r.jsx)(W.Or,{text:(R.spec.targets||[R.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:R})=>(0,r.jsx)(W.Or,{text:R.metadata.description,placement:"bottom-start"}),width:"auto"}},createTagsColumn(){return{title:"Tags",field:"entity.metadata.tags",cellStyle:{padding:"0px 16px 0px 20px"},render:({entity:R})=>(0,r.jsx)(r.Fragment,{children:R.metadata.tags&&R.metadata.tags.map(w=>(0,r.jsx)(D.Z,{label:w,size:"small",variant:"outlined",style:{marginBottom:"0px"}},w))}),width:"auto"}},createTitleColumn(R){var w;return{title:"Title",field:"entity.metadata.title",hidden:(w=R)===null||w===void 0?void 0:w.hidden,searchable:!0}},createLabelColumn(R,w){var I;return{title:((I=w)===null||I===void 0?void 0:I.title)||"Label",field:"entity.metadata.labels",cellStyle:{padding:"0px 16px 0px 20px"},render:({entity:U})=>{var xe,Se;const k=(xe=U.metadata)===null||xe===void 0?void 0:xe.labels,Ge=k&&k[R]||((Se=w)===null||Se===void 0?void 0:Se.defaultValue);return(0,r.jsx)(r.Fragment,{children:Ge&&(0,r.jsx)(D.Z,{label:Ge,size:"small",variant:"outlined"},Ge)})},width:"auto"}},createNamespaceColumn(){return{title:"Namespace",field:"entity.metadata.namespace",width:"auto"}}});var se=n(19928),ie=n.n(se);const ee=(0,m.Z)({root:{color:"#f3ba37"}})(ve.Z),X=(R,w)=>{const I=U=>U.metadata.title||(0,f.$3)(U,{defaultKind:"Component"});return I(R).localeCompare(I(w))},K=R=>{var w,I,U,xe;const{columns:Se,actions:k,tableOptions:Ge,subtitle:xt,emptyContent:Dt}=R,{isStarredEntity:Ut,toggleStarredEntity:Tt}=(0,f.CR)(),{loading:Nt,error:Yt,entities:dt,filters:ut}=(0,f.wp)(),St=(0,de.useMemo)(()=>{var ot;return[A.createTitleColumn({hidden:!0}),A.createNameColumn({defaultKind:(ot=ut.kind)===null||ot===void 0?void 0:ot.value}),...Qe(),A.createMetadataDescriptionColumn(),A.createTagsColumn()];function Qe(){var ft;const gt=[A.createSystemColumn(),A.createOwnerColumn(),A.createSpecTypeColumn(),A.createSpecLifecycleColumn()];switch((ft=ut.kind)===null||ft===void 0?void 0:ft.value){case"user":return[];case"domain":case"system":return[A.createOwnerColumn()];case"group":case"template":return[A.createSpecTypeColumn()];case"location":return[A.createSpecTypeColumn(),A.createSpecTargetsColumn()];default:return dt.every(Ct=>Ct.metadata.namespace==="default")?gt:[...gt,A.createNamespaceColumn()]}}},[(w=ut.kind)===null||w===void 0?void 0:w.value,dt]),lt=ut.type===void 0;var Zt;const Ht=(0,z.capitalize)((Zt=(I=ut.user)===null||I===void 0?void 0:I.value)!==null&&Zt!==void 0?Zt:"all");if(Yt)return(0,r.jsx)("div",{children:(0,r.jsx)(W.GB,{severity:"error",title:"Could not fetch catalog entities.",children:(0,r.jsx)(W.Oi,{language:"text",text:Yt.toString()})})});const Ce=[({entity:ot})=>{var Qe;const ft=(Qe=ot.metadata.annotations)===null||Qe===void 0?void 0:Qe[p.l2],gt="View";return{icon:()=>(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(V.Z,{variant:"srOnly",children:gt}),(0,r.jsx)(F.Z,{fontSize:"small"})]}),tooltip:gt,disabled:!ft,onClick:()=>{ft&&window.open(ft,"_blank")}}},({entity:ot})=>{var Qe;const ft=(Qe=ot.metadata.annotations)===null||Qe===void 0?void 0:Qe[p.Tf],gt="Edit";return{icon:()=>(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(V.Z,{variant:"srOnly",children:gt}),(0,r.jsx)(h.Z,{fontSize:"small"})]}),tooltip:gt,disabled:!ft,onClick:()=>{ft&&window.open(ft,"_blank")}}},({entity:ot})=>{const Qe=Ut(ot),ft=Qe?"Remove from favorites":"Add to favorites";return{cellStyle:{paddingLeft:"1em"},icon:()=>(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(V.Z,{variant:"srOnly",children:ft}),Qe?(0,r.jsx)(ee,{}):(0,r.jsx)(ce.Z,{})]}),tooltip:ft,onClick:()=>Tt(ot)}}],$e=dt.sort(X).map(ot=>{const Qe=(0,f.hF)(ot,p.cz,{kind:"system"}),ft=(0,f.hF)(ot,p.S4);return{entity:ot,resolved:{name:(0,f.$3)(ot,{defaultKind:"Component"}),ownedByRelationsTitle:ft.map(gt=>(0,f.$3)(gt,{defaultKind:"group"})).join(", "),ownedByRelations:ft,partOfSystemRelationTitle:Qe.map(gt=>(0,f.$3)(gt,{defaultKind:"system"})).join(", "),partOfSystemRelations:Qe}}}),Ke=(Se||St).find(ot=>ot.title==="Type");Ke&&(Ke.hidden=!lt);const ht=$e.length>20,rt=((U=ut.kind)===null||U===void 0?void 0:U.value)||"",tt=((xe=ut.type)===null||xe===void 0?void 0:xe.value)||"",vt=[Ht,tt,ie()(rt)].filter(ot=>ot).join(" ");return(0,r.jsx)(W.iA,{isLoading:Nt,columns:Se||St,options:{paging:ht,pageSize:20,actionsColumnIndex:-1,loadingType:"linear",showEmptyDataSourceMessage:!Nt,padding:"dense",pageSizeOptions:[20,50,100],...Ge},title:`${vt} (${dt.length})`,data:$e,actions:k||Ce,subtitle:xt,emptyContent:Dt})};K.columns=A},85877:function(It,Pe,n){"use strict";n.r(Pe),n.d(Pe,{EntityLabelsCard:function(){return de},hasLabels:function(){return D}});var r=n(52322),p=n(39709),W=n(2784),f=n(53974),V=n(79692),m=n(90436),h=n(77277);const F=`metadata:
|
|
34
34
|
name: example
|
|
35
35
|
labels:
|
|
36
36
|
javaVersion: 1.2.3`,ve=(0,V.Z)(A=>({code:{borderRadius:6,margin:`${A.spacing(2)}px 0px`,background:A.palette.type==="dark"?"#444":A.palette.common.white}}),{name:"PluginCatalogEntityLabelsEmptyState"});function ce(){const A=ve();return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(m.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,r.jsx)("div",{className:A.code,children:(0,r.jsx)(f.Oi,{text:F,language:"yaml",showLineNumbers:!0,highlightedNumbers:[3,4,5,6],customStyle:{background:"inherit",fontSize:"115%"}})}),(0,r.jsx)(h.Z,{variant:"contained",color:"primary",target:"_blank",href:"https://backstage.io/docs/features/software-catalog/descriptor-format#labels-optional",children:"Read more"})]})}const z=(0,V.Z)(A=>({key:{fontWeight:"bold"}})),de=A=>{var se,ie;const{variant:ee,title:X}=A,{entity:K}=(0,p.X2)(),R=z(),w=[{render:U=>(0,r.jsx)(m.Z,{className:R.key,variant:"body2",children:U.key})},{field:"value"}],I=(ie=K)===null||ie===void 0||(se=ie.metadata)===null||se===void 0?void 0:se.labels;return(0,r.jsx)(f.rJ,{title:X||"Labels",variant:ee,children:!I||Object.keys(I).length===0?(0,r.jsx)(ce,{}):(0,r.jsx)(f.iA,{columns:w,data:Object.keys(I).map(U=>({key:U,value:I[U]})),options:{search:!1,showTitle:!0,loadingType:"linear",header:!1,padding:"dense",pageSize:5,toolbar:!1,paging:Object.keys(I).length>5}})})};function D(A){var se,ie,ee,X;return!((ie=A)===null||ie===void 0||(se=ie.metadata)===null||se===void 0)&&se.labels?Object.keys((X=A)===null||X===void 0||(ee=X.metadata)===null||ee===void 0?void 0:ee.labels).some(Boolean):!1}},24851:function(It,Pe,n){"use strict";n.d(Pe,{s:function(){return se}});var r=n(52322),p=n(90348),W=n(11861),f=n(2784),V=n(79692),m=n(95544),h=n(90436),F=n(52160),ve=n(53974);const ce=(0,V.Z)({svgIcon:{display:"inline-block","& svg":{display:"inline-block",fontSize:"inherit",verticalAlign:"baseline"}}});function z(ie){const{href:ee,text:X,Icon:K}=ie,R=ce();return(0,r.jsxs)(m.Z,{display:"flex",children:[(0,r.jsx)(m.Z,{mr:1,className:R.svgIcon,children:(0,r.jsx)(h.Z,{component:"div",children:K?(0,r.jsx)(K,{}):(0,r.jsx)(F.Z,{})})}),(0,r.jsx)(m.Z,{flexGrow:"1",children:(0,r.jsx)(ve.rU,{to:ee,target:"_blank",rel:"noopener",children:X||ee})})]})}var de=n(41156);const D={xs:1,sm:1,md:1,lg:2,xl:3};function A(ie){const ee=[(0,de.Z)(I=>I.breakpoints.up("xl"))?"xl":null,(0,de.Z)(I=>I.breakpoints.up("lg"))?"lg":null,(0,de.Z)(I=>I.breakpoints.up("md"))?"md":null,(0,de.Z)(I=>I.breakpoints.up("sm"))?"sm":null,(0,de.Z)(I=>I.breakpoints.up("xs"))?"xs":null];let X=1;if(typeof ie=="number")X=ie;else{var K,R;const I=(R=ee.find(U=>U!==null))!==null&&R!==void 0?R:"xs";var w;X=(w=(K=ie)===null||K===void 0?void 0:K[I])!==null&&w!==void 0?w:D[I]}return X}function se(ie){const{items:ee,cols:X=void 0}=ie,K=A(X);return(0,r.jsx)(p.Z,{rowHeight:"auto",cols:K,children:ee.map(({text:R,href:w,Icon:I},U)=>(0,r.jsx)(W.Z,{children:(0,r.jsx)(z,{href:w,text:R!=null?R:w,Icon:I})},U))})}},19625:function(It,Pe,n){"use strict";n.d(Pe,{_Z:function(){return V},jU:function(){return W},ql:function(){return f},yw:function(){return p}});var r=n(60871);const p=(0,r.x8)({id:"create-component",optional:!0}),W=(0,r.x8)({id:"view-techdoc",optional:!0,params:["namespace","kind","name"]}),f=(0,r.x8)({id:"create-from-template",optional:!0,params:["namespace","templateName"]}),V=(0,r.NT)({id:"catalog"})},15096:function(It,Pe,n){"use strict";n.d(Pe,{FA:function(){return ve},qO:function(){return St},Nd:function(){return k},E5:function(){return Qt},Rx:function(){return w}});var r=n(60871);const p=(0,r.T0)({id:"plugin.search.queryservice"});class W{query(){return Promise.resolve(this.mockedResults||{results:[]})}constructor(te){_define_property(this,"mockedResults",void 0),this.mockedResults=te}}var f=n(52322),V=n(2784),m=n(38402),h=n(79692);const F=(0,h.Z)(()=>({highlight:{}}),{name:"BackstageHighlightedSearchResultText"}),ve=ne=>{const{text:te,preTag:Y,postTag:v}=ne,O=F(),M=(0,V.useMemo)(()=>te.split(new RegExp(`(${Y}.+?${v})`)),[v,Y,te]);return(0,f.jsx)(f.Fragment,{children:M.map((G,ue)=>G.includes(Y)?(0,f.jsx)("mark",{className:O.highlight,children:G.replace(new RegExp(`${Y}|${v}`,"g"),"")},ue):G)})};var ce=n(50581),z=n(61837),de=n(86619),D=n(77277),A=n(21853),se=n(48760),ie=n(76635),ee=n(64279),X=n(1849),K=n(51837);const R=(0,K.CT)("search-context"),w=()=>{const ne=(0,V.useContext)(R);if(!ne)throw new Error("useSearch must be used within a SearchContextProvider");const te=ne.atVersion(1);if(!te)throw new Error("No SearchContext v1 found");return te},I=()=>(0,V.useContext)(R)!==void 0,U={term:"",types:[],filters:{},pageLimit:void 0,pageCursor:void 0},xe=(ne=U)=>{var te,Y,v,O;const M=(0,r.h_)(p),[G,ue]=(0,V.useState)(ne.term),[be,ke]=(0,V.useState)(ne.types),[Xe,nt]=(0,V.useState)(ne.filters),[yt,bt]=(0,V.useState)(ne.pageLimit),[ct,Oe]=(0,V.useState)(ne.pageCursor),wt=(0,X.Z)(G),_t=(0,X.Z)(Xe),jt=(0,ee.default)(()=>M.query({term:G,types:be,filters:Xe,pageLimit:yt,pageCursor:ct}),[G,be,Xe,yt,ct]),Ft=!jt.loading&&!jt.error&&((te=jt.value)===null||te===void 0?void 0:te.nextPageCursor),qt=!jt.loading&&!jt.error&&((Y=jt.value)===null||Y===void 0?void 0:Y.previousPageCursor),jn=(0,V.useCallback)(()=>{var Lt;Oe((Lt=jt.value)===null||Lt===void 0?void 0:Lt.nextPageCursor)},[(v=jt.value)===null||v===void 0?void 0:v.nextPageCursor]),Bt=(0,V.useCallback)(()=>{var Lt;Oe((Lt=jt.value)===null||Lt===void 0?void 0:Lt.previousPageCursor)},[(O=jt.value)===null||O===void 0?void 0:O.previousPageCursor]);return(0,V.useEffect)(()=>{wt!==void 0&&G!==wt&&Oe(void 0)},[G,wt,Oe]),(0,V.useEffect)(()=>{_t!==void 0&&!(0,ie.isEqual)(Xe,_t)&&Oe(void 0)},[Xe,_t,Oe]),{result:jt,term:G,setTerm:ue,types:be,setTypes:ke,filters:Xe,setFilters:nt,pageLimit:yt,setPageLimit:bt,pageCursor:ct,setPageCursor:Oe,fetchNextPage:Ft?jn:void 0,fetchPreviousPage:qt?Bt:void 0}},Se=ne=>{const{initialState:te,children:Y}=ne,v=xe(te);return(0,f.jsx)(r.fC,{attributes:{searchTypes:v.types.sort().join(",")},children:(0,f.jsx)(R.Provider,{value:(0,K.EI)({1:v}),children:Y})})},k=ne=>{const{initialState:te,inheritParentContextIfAvailable:Y,children:v}=ne;return I()&&Y?(0,f.jsx)(f.Fragment,{children:v}):(0,f.jsx)(Se,{initialState:te,children:v})},Ge=({children:ne})=>{var te;const Y=Xe=>(0,X.Z)(Xe)!==Xe,v=(0,r.z$)(),{term:O,result:M}=w();var G;const ue=(G=(te=M.value)===null||te===void 0?void 0:te.numberOfResults)!==null&&G!==void 0?G:void 0,ke=Y(M.loading)&&!M.loading;return(0,V.useEffect)(()=>{O&&ke&&v.captureEvent("search",O,{value:ue})},[v,O,ue,ke]),(0,f.jsx)(f.Fragment,{children:ne})};function xt(ne){return(0,V.forwardRef)((te,Y)=>(0,f.jsx)(k,{inheritParentContextIfAvailable:!0,children:(0,f.jsx)(ne,{...te,ref:Y})}))}const Dt=xt((0,V.forwardRef)((ne,te)=>{const{onChange:Y,onKeyDown:v=()=>{},onClear:O=()=>{},onSubmit:M=()=>{},debounceTime:G=200,clearButton:ue=!0,fullWidth:be=!0,value:ke,label:Xe,placeholder:nt,inputProps:yt={},InputProps:bt={},endAdornment:ct,...Oe}=ne,wt=(0,r.h_)(r.Ds),[_t,jt]=(0,V.useState)("");(0,V.useEffect)(()=>{jt(en=>en!==ke?String(ke):en)},[ke]),(0,se.Z)(()=>Y(_t),G,[_t]);const Ft=(0,V.useCallback)(en=>{jt(en.target.value)},[jt]),qt=(0,V.useCallback)(en=>{v&&v(en),M&&en.key==="Enter"&&M()},[v,M]),jn=(0,V.useCallback)(()=>{Y(""),O&&O()},[Y,O]),Bt=Xe?void 0:"Search",mt=nt!=null?nt:`Search in ${wt.getOptionalString("app.title")||"Backstage"}`,Lt=(0,f.jsx)(ce.Z,{position:"start",children:(0,f.jsx)(z.Z,{"aria-label":"Query",size:"small",disabled:!0,children:(0,f.jsx)(A.Z,{})})}),Mt=(0,f.jsx)(ce.Z,{position:"end",children:(0,f.jsx)(D.Z,{"aria-label":"Clear",size:"small",onClick:jn,onKeyDown:en=>{en.key==="Enter"&&en.stopPropagation()},children:"Clear"})});return(0,f.jsx)(Ge,{children:(0,f.jsx)(de.Z,{id:"search-bar-text-field","data-testid":"search-bar-next",variant:"outlined",margin:"normal",inputRef:te,value:_t,label:Xe,placeholder:mt,InputProps:{startAdornment:Lt,endAdornment:ue?Mt:ct,...bt},inputProps:{"aria-label":Bt,...yt},fullWidth:be,onChange:Ft,onKeyDown:qt,...Oe})})})),Ut=xt((0,V.forwardRef)((ne,te)=>{const{value:Y="",onChange:v,...O}=ne,{term:M,setTerm:G}=w();(0,V.useEffect)(()=>{Y&&G(String(Y))},[Y,G]);const ue=(0,V.useCallback)(be=>{v?v(be):G(be)},[v,G]);return(0,f.jsx)(r.fC,{attributes:{pluginId:"search",extension:"SearchBar"},children:(0,f.jsx)(Dt,{...O,ref:te,value:M,onChange:ue})})}));var Tt=n(4614),Nt=n(88013);const Yt=(0,h.Z)(ne=>({loading:{right:ne.spacing(1),position:"absolute"}})),dt=ne=>te=>(0,f.jsx)(k,{inheritParentContextIfAvailable:!0,children:(0,f.jsx)(ne,{...te})}),ut=()=>{const ne=Yt();return(0,f.jsx)(Tt.Z,{className:ne.loading,"data-testid":"search-autocomplete-progressbar",color:"inherit",size:20})},St=dt(function(te){const{loading:Y,value:v,onChange:O=()=>{},options:M=[],getOptionLabel:G=Ft=>String(Ft),inputPlaceholder:ue,inputDebounceTime:be,freeSolo:ke=!0,fullWidth:Xe=!0,clearOnBlur:nt=!1,"data-testid":yt="search-autocomplete",...bt}=te,{setTerm:ct}=w(),Oe=(0,V.useCallback)(Ft=>Ft?typeof Ft=="string"?Ft:G(Ft):"",[G]),wt=(0,V.useMemo)(()=>Oe(v),[v,Oe]),_t=(0,V.useCallback)((Ft,qt,jn,Bt)=>{ct(Oe(qt)),O(Ft,qt,jn,Bt)},[Oe,ct,O]),jt=(0,V.useCallback)(({InputProps:{ref:Ft,className:qt,endAdornment:jn},InputLabelProps:Bt,...mt})=>(0,f.jsx)(Ut,{...mt,ref:Ft,clearButton:!1,value:wt,placeholder:ue,debounceTime:be,endAdornment:Y?(0,f.jsx)(ut,{}):jn,InputProps:{className:qt}}),[Y,wt,ue,be]);return(0,f.jsx)(Nt.ZP,{...bt,"data-testid":yt,value:v,onChange:_t,options:M,getOptionLabel:G,renderInput:jt,freeSolo:ke,fullWidth:Xe,clearOnBlur:nt})}),lt=ne=>{const{icon:te,primaryText:Y,primaryTextTypographyProps:v,secondaryText:O,secondaryTextTypographyProps:M,disableTextTypography:G}=ne;return _jsxs(_Fragment,{children:[te?_jsx(ListItemIcon,{children:te}):null,_jsx(ListItemText,{primary:Y,primaryTypographyProps:v,secondary:O,secondaryTypographyProps:M,disableTypography:G})]})};var Zt=n(42494),Ht=n(84899),Ce=n(5806),$e=n(21324),Ke=n(56939),ht=n(73698),rt=n(12231),tt=n(90436),vt=n(7089),ot=n(69294);const Qe=(ne,te,Y=[],v=250)=>{const O=(0,V.useRef)({}),M=ne||(()=>Promise.resolve([])),[G,ue]=(0,ot.default)(M,[te],{loading:!0});if((0,se.Z)(()=>{O.current[te]===void 0&&(O.current[te]=ue(te).then(ke=>(O.current[te]=ke,ke)))},v,[ue,te]),Y.length)return{loading:!1,value:Y};const be=O.current[te];return Array.isArray(be)?{loading:!1,value:be}:G},ft=(ne,te)=>{const{setFilters:Y}=w();(0,V.useEffect)(()=>{te&&[te].flat().length>0&&Y(v=>({...v,[ne]:te}))},[])},gt=ne=>{const{className:te,defaultValue:Y,name:v,values:O,valuesDebounceMs:M,label:G,filterSelectedOptions:ue,limitTags:be,multiple:ke}=ne,[Xe,nt]=(0,V.useState)("");ft(v,Y);const yt=typeof O=="function"?O:void 0,bt=typeof O=="function"?void 0:O,{value:ct,loading:Oe}=Qe(yt,Xe,bt,M),{filters:wt,setFilters:_t}=w(),jt=wt[v]||(ke?[]:null),Ft=(Bt,mt)=>{_t(Lt=>{const{[v]:Mt,...en}=Lt;return mt?{...en,[v]:mt}:{...en}})},qt=Bt=>(0,f.jsx)(de.Z,{...Bt,name:"search",variant:"outlined",label:G,fullWidth:!0}),jn=(Bt,mt)=>Bt.map((Lt,Mt)=>(0,f.jsx)(vt.Z,{label:Lt,color:"primary",...mt({index:Mt})}));return(0,f.jsx)(Nt.ZP,{filterSelectedOptions:ue,limitTags:be,multiple:ke,className:te,id:`${ke?"multi-":""}select-filter-${v}--select`,options:ct||[],loading:Oe,value:jt,onChange:Ft,onInputChange:(Bt,mt)=>nt(mt),renderInput:qt,renderTags:jn})},Ct=(0,h.Z)({label:{textTransform:"capitalize"},checkboxWrapper:{display:"flex",alignItems:"center",width:"100%"},textWrapper:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}}),mn=ne=>{const{className:te,defaultValue:Y,label:v,name:O,values:M=[],valuesDebounceMs:G}=ne,ue=Ct(),{filters:be,setFilters:ke}=w();ft(O,Y);const Xe=typeof M=="function"?M:void 0,nt=typeof M=="function"?void 0:M,{value:yt=[],loading:bt}=Qe(Xe,"",nt,G),ct=wt=>{const{target:{value:_t,checked:jt}}=wt;ke(Ft=>{const{[O]:qt,...jn}=Ft,Bt=(qt||[]).filter(Lt=>Lt!==_t),mt=jt?[...Bt,_t]:Bt;return mt.length?{...jn,[O]:mt}:jn})};var Oe;return(0,f.jsxs)(Zt.Z,{className:te,disabled:bt,fullWidth:!0,"data-testid":"search-checkboxfilter-next",children:[v?(0,f.jsx)(Ht.Z,{className:ue.label,children:v}):null,yt.map(wt=>(0,f.jsx)(Ce.Z,{classes:{root:ue.checkboxWrapper,label:ue.textWrapper},label:wt,control:(0,f.jsx)($e.Z,{color:"primary",inputProps:{"aria-labelledby":wt},value:wt,name:wt,onChange:ct,checked:((Oe=be[O])!==null&&Oe!==void 0?Oe:[]).includes(wt)})},wt))]})},un=ne=>{const{className:te,defaultValue:Y,label:v,name:O,values:M,valuesDebounceMs:G}=ne,ue=Ct();ft(O,Y);const be=typeof M=="function"?M:void 0,ke=typeof M=="function"?void 0:M,{value:Xe=[],loading:nt}=Qe(be,"",ke,G),{filters:yt,setFilters:bt}=w(),ct=Oe=>{const{target:{value:wt}}=Oe;bt(_t=>{const{[O]:jt,...Ft}=_t;return wt?{...Ft,[O]:wt}:Ft})};return(0,f.jsxs)(Zt.Z,{disabled:nt,className:te,variant:"filled",fullWidth:!0,"data-testid":"search-selectfilter-next",children:[v?(0,f.jsx)(Ke.Z,{className:ue.label,margin:"dense",children:v}):null,(0,f.jsxs)(ht.Z,{variant:"outlined",value:yt[O]||"",onChange:ct,children:[(0,f.jsx)(rt.Z,{value:"",children:(0,f.jsx)("em",{children:"All"})}),Xe.map(Oe=>(0,f.jsx)(rt.Z,{value:Oe,children:(0,f.jsx)(tt.Z,{variant:"inherit",noWrap:!0,children:Oe})},Oe))]})]})},ln=ne=>{const{component:te,...Y}=ne;return(0,f.jsx)(te,{...Y})};ln.Checkbox=ne=>(0,f.jsx)(ln,{...ne,component:mn}),ln.Select=ne=>(0,f.jsx)(ln,{...ne,component:un}),ln.Autocomplete=ne=>(0,f.jsx)(ln,{...ne,component:gt});var Sn=n(48834).lW;const hn=ne=>Sn.from(ne.toString(),"utf-8").toString("base64"),vn=ne=>ne?Number(Sn.from(ne,"base64").toString("utf-8")):0,Cn=ne=>{const{total:te=-1,cursor:Y,hasNextPage:v,onCursorChange:O,limit:M=25,limitLabel:G="Results per page:",limitText:ue=({from:ct,to:Oe})=>te>0?`of ${te}`:`${ct}-${Oe}`,limitOptions:be,onLimitChange:ke,...Xe}=ne,nt=useMemo(()=>vn(Y),[Y]),yt=useCallback((ct,Oe)=>{var wt;(wt=O)===null||wt===void 0||wt(hn(Oe))},[O]),bt=useCallback(ct=>{var Oe;const wt=ct.target.value;(Oe=ke)===null||Oe===void 0||Oe(parseInt(wt,10))},[ke]);return _jsx(TablePagination,{...Xe,component:"div",count:te,page:nt,nextIconButtonProps:{...v!==void 0&&{disabled:!v}},onPageChange:yt,rowsPerPage:M,labelRowsPerPage:G,labelDisplayedRows:ue,rowsPerPageOptions:be,onRowsPerPageChange:bt})},on=ne=>{const{pageLimit:te,setPageLimit:Y,pageCursor:v,setPageCursor:O,fetchNextPage:M}=useSearch(),G=useCallback(ue=>{Y(ue),O(void 0)},[Y,O]);return _jsx(Cn,{...ne,hasNextPage:!!M,limit:te,onLimitChange:G,cursor:v,onCursorChange:O})};var pn=n(53974);const wn=ne=>{const{children:te}=ne,Y=useSearch(),{result:v,...O}=Y;return te(v,O)},_e=ne=>{const{query:te,children:Y}=ne,v=useApi(searchApiRef),O=useAsync(()=>{const{term:M="",types:G=[],filters:ue={},...be}=te;return v.query({...be,term:M,types:G,filters:ue})},[te]);return Y(O,te)},Jt=ne=>{const{query:te,children:Y}=ne;return te?_jsx(_e,{query:te,children:Y}):_jsx(wn,{children:Y})},Wt=ne=>{const{query:te,children:Y,noResultsComponent:v=_jsx(EmptyState,{missing:"data",title:"Sorry, no results were found"}),...O}=ne;return _jsx(Jt,{query:te,children:({loading:M,error:G,value:ue})=>{var be;return M?_jsx(Progress,{}):G?_jsx(ResponseErrorPanel,{title:"Error encountered while fetching search results",error:G}):!((be=ue)===null||be===void 0)&&be.results.length?isFunction(Y)?Y(ue):_jsx(SearchResultListItemExtensions,{...O,results:ue.results,children:Y}):v}})},Ye=ne=>_jsx(AnalyticsContext,{attributes:{pluginId:"search",extension:"SearchResult"},children:_jsx(Wt,{...ne})}),Tn=({result:ne,highlight:te,icon:Y,secondaryAction:v,lineClamp:O=5})=>{var M,G,ue,be,ke;return ne?_jsxs(_Fragment,{children:[Y&&_jsx(ListItemIcon,{children:Y}),_jsx(ListItemText,{primaryTypographyProps:{variant:"h6"},primary:_jsx(Link,{noTrack:!0,to:ne.location,children:!((M=te)===null||M===void 0)&&M.fields.title?_jsx(HighlightedSearchResultText,{text:((G=te)===null||G===void 0?void 0:G.fields.title)||"",preTag:((ue=te)===null||ue===void 0?void 0:ue.preTag)||"",postTag:((be=te)===null||be===void 0?void 0:be.postTag)||""}):ne.title}),secondary:_jsx(Typography,{component:"span",style:{display:"-webkit-box",WebkitBoxOrient:"vertical",WebkitLineClamp:O,overflow:"hidden"},color:"textSecondary",variant:"body2",children:!((ke=te)===null||ke===void 0)&&ke.fields.text?_jsx(HighlightedSearchResultText,{text:te.fields.text,preTag:te.preTag,postTag:te.postTag}):ne.text})}),v&&_jsx(Box,{alignItems:"flex-end",children:v})]}):null},sn=ne=>_jsx(AnalyticsContext,{attributes:{pluginId:"search",extension:"DefaultResultListItem"},children:_jsx(Tn,{...ne})}),Dn=ne=>{var te;const{error:Y,loading:v,resultItems:O,renderResultItem:M=ke=>_jsx(DefaultResultListItem,{result:ke.document},ke.document.location),disableRenderingWithNoResults:G,noResultsComponent:ue=G?null:_jsx(EmptyState,{missing:"data",title:"Sorry, no results were found"}),...be}=ne;return v?_jsx(Progress,{}):Y?_jsx(ResponseErrorPanel,{title:"Error encountered while fetching search results",error:Y}):!((te=O)===null||te===void 0)&&te.length?_jsx(List,{...be,children:O.map(M)}):_jsx(_Fragment,{children:ue})},Rn=ne=>{const{query:te,renderResultItem:Y,children:v,...O}=ne,M=useSearchResultListItemExtensions(v);return _jsx(AnalyticsContext,{attributes:{pluginId:"search",extension:"SearchResultList"},children:_jsx(SearchResultState,{query:te,children:({loading:G,error:ue,value:be})=>{var ke;return _jsx(Dn,{...O,error:ue,loading:G,resultItems:(ke=be)===null||ke===void 0?void 0:ke.results,renderResultItem:Y!=null?Y:M})}})})};var In=n(19126);const Kn=(0,h.Z)(ne=>({listSubheader:{display:"flex",alignItems:"center"},listSubheaderName:{marginLeft:ne.spacing(1),textTransform:"uppercase"},listSubheaderChip:{color:ne.palette.text.secondary,margin:ne.spacing(0,0,0,1.5)},listSubheaderFilter:{display:"flex",color:ne.palette.text.secondary,margin:ne.spacing(0,0,0,1.5)},listSubheaderLink:{marginLeft:"auto",display:"flex",alignItems:"center"},listSubheaderLinkIcon:{fontSize:"inherit",marginLeft:ne.spacing(.5)}})),On=ne=>{const te=Kn(),{label:Y,children:v,...O}=ne;return _jsx(Chip,{...O,className:te.listSubheaderFilter,variant:"outlined",label:_jsxs(_Fragment,{children:[Y,": ",v]})})},Yn=()=>null,we=(0,h.Z)(ne=>({root:{fontSize:"inherit","&:focus":{outline:"none",background:ne.palette.common.white},"&:not(:focus)":{cursor:"pointer",color:ne.palette.primary.main,"&:hover":{textDecoration:"underline"}}}})),pe=ne=>{const te=we(),{label:Y,value:v="None",onChange:O,onDelete:M}=ne,G=useCallback(ue=>{O(ue.target.value)},[O]);return _jsx(On,{label:Y,onDelete:M,children:_jsx(Typography,{role:"textbox",component:"span",className:te.root,onChange:G,contentEditable:!0,suppressContentEditableWarning:!0,children:v})})},Re=(0,h.Z)(ne=>({root:{fontSize:"inherit","&:not(:focus)":{cursor:"pointer",color:ne.palette.primary.main,"&:hover":{textDecoration:"underline"}},"&:focus":{outline:"none"},"&>div:first-child":{padding:0}}})),H=ne=>{const te=Re(),{label:Y,value:v="none",onChange:O,onDelete:M,children:G}=ne,ue=useCallback(be=>{O(be.target.value)},[O]);return _jsx(On,{label:Y,onDelete:M,children:_jsxs(Select,{className:te.root,value:v,onChange:ue,input:_jsx(InputBase,{}),IconComponent:Yn,children:[_jsx(MenuItem,{value:"none",children:"None"}),G]})})};function N(ne){var te,Y;const v=Kn(),[O,M]=useState(null),{error:G,loading:ue,icon:be,title:ke,titleProps:Xe={},link:nt=_jsxs(_Fragment,{children:["See all",_jsx(ArrowRightIcon,{className:v.listSubheaderLinkIcon})]}),linkProps:yt={},filterOptions:bt,renderFilterOption:ct=Mt=>_jsx(MenuItem,{value:String(Mt),children:Mt},String(Mt)),filterFields:Oe,renderFilterField:wt,resultItems:_t,renderResultItem:jt=Mt=>_jsx(DefaultResultListItem,{result:Mt.document},Mt.document.location),disableRenderingWithNoResults:Ft,noResultsComponent:qt=Ft?null:_jsx(EmptyState,{missing:"data",title:"Sorry, no results were found"}),...jn}=ne,Bt=useCallback(Mt=>{M(Mt.currentTarget)},[]),mt=useCallback(()=>{M(null)},[]);if(ue)return _jsx(Progress,{});if(G)return _jsx(ResponseErrorPanel,{title:"Error encountered while fetching search results",error:G});if(!(!((te=_t)===null||te===void 0)&&te.length))return _jsx(_Fragment,{children:qt});var Lt;return _jsxs(List,{...jn,children:[_jsxs(ListSubheader,{className:v.listSubheader,children:[be,_jsx(Typography,{className:v.listSubheaderName,component:"strong",...Xe,children:ke}),bt?_jsx(Chip,{className:v.listSubheaderChip,component:"button",icon:_jsx(AddIcon,{}),variant:"outlined",label:"Add filter","aria-controls":"filters-menu","aria-haspopup":"true",onClick:Bt}):null,bt?_jsx(Menu,{id:"filters-menu",anchorEl:O,open:Boolean(O),onClose:mt,onClick:mt,keepMounted:!0,children:bt.map(ct)}):null,(Y=Oe)===null||Y===void 0?void 0:Y.map(Mt=>{var en;return(Lt=(en=wt)===null||en===void 0?void 0:en(Mt))!==null&&Lt!==void 0?Lt:null}),_jsx(Link,{className:v.listSubheaderLink,to:"/search",...yt,children:nt})]}),_t.map(jt)]})}function le(ne){const{query:te,children:Y,renderResultItem:v,linkProps:O={},...M}=ne,G=useSearchResultListItemExtensions(Y);return _jsx(AnalyticsContext,{attributes:{pluginId:"search",extension:"SearchResultGroup"},children:_jsx(SearchResultState,{query:te,children:({loading:ue,error:be,value:ke},{term:Xe,types:nt,pageCursor:yt,filters:bt={}})=>{var ct;const Oe=`/search?${qs.stringify({term:Xe,types:nt,filters:bt,pageCursor:yt,query:Xe},{arrayFormat:"brackets"})}`;return _jsx(N,{...M,error:be,loading:ue,linkProps:{to:Oe,...O},filterFields:Object.keys(bt),resultItems:(ct=ke)===null||ct===void 0?void 0:ct.results,renderResultItem:v!=null?v:G})}})})}const Ee=(0,h.Z)(ne=>({root:{display:"flex",justifyContent:"space-between",gap:ne.spacing(2),margin:ne.spacing(2,0)}})),Ue=()=>{const{fetchNextPage:ne,fetchPreviousPage:te}=useSearch(),Y=Ee();return!ne&&!te?_jsx(_Fragment,{}):_jsxs("nav",{"aria-label":"pagination navigation",className:Y.root,children:[_jsx(Button,{"aria-label":"previous page",disabled:!te,onClick:te,startIcon:_jsx(ArrowBackIosIcon,{}),children:"Previous"}),_jsx(Button,{"aria-label":"next page",disabled:!ne,onClick:ne,endIcon:_jsx(ArrowForwardIosIcon,{}),children:"Next"})]})},qe="search.results.list.items.extensions.v1",Pt=(ne,te)=>{for(const v of ne){var Y;if(!(!isValidElement(v)||!(!((Y=getComponentData(v,qe))===null||Y===void 0)&&Y(te))))return cloneElement(v,{rank:te.rank,highlight:te.highlight,result:te.document,...v.props})}return null},$t=ne=>{const{rank:te,result:Y,noTrack:v,children:O,alignItems:M="flex-start",...G}=ne,ue=(0,r.z$)(),be=(0,V.useCallback)(()=>{v||Y&&ue.captureEvent("discover",Y.title,{attributes:{to:Y.location},value:te})},[te,Y,v,ue]);return(0,f.jsx)(m.Z,{divider:!0,alignItems:M,onClickCapture:be,...G,children:O})},Qt=ne=>{const{name:te,component:Y,predicate:v=()=>!0}=ne;return(0,r.YO)({name:te,component:{lazy:()=>Y().then(O=>M=>(0,f.jsx)($t,{rank:M.rank,result:M.result,noTrack:M.noTrack,children:(0,V.createElement)(O,M)}))},data:{[qe]:v}})},Xt=ne=>{const te=useElementFilter(ne,Y=>Y.selectByComponentData({key:qe}).getElements(),[ne]);return useCallback((Y,v)=>{const O=Pt(te,Y);return _jsx(Fragment,{children:O!=null?O:_jsx($t,{rank:Y.rank,result:Y.document,children:_jsx(DefaultResultListItem,{rank:Y.rank,highlight:Y.highlight,result:Y.document})})},v)},[te])},an=ne=>{const{results:te,children:Y,...v}=ne,O=Xt(Y);return _jsx(List,{...v,children:te.map(O)})}},61886:function(It,Pe,n){"use strict";n.d(Pe,{Ox:function(){return Tt},jM:function(){return V},Zz:function(){return m},oZ:function(){return k},DR:function(){return h},ZS:function(){return xe},VA:function(){return dt},KY:function(){return ve},gT:function(){return A},Dl:function(){return se},ux:function(){return Yt},$L:function(){return D},x1:function(){return Se}});var r=n(52322),p=n(2784),W=n(73557),f=n(60871);const V="techdocs.addons.addon.v1",m="techdocs.addons.wrapper.v1",h=()=>null;(0,f.R5)(h,m,!0);const F=Ce=>`${V}.${Ce.toLocaleLowerCase("en-US")}`;function ve(Ce){const{name:$e,component:Ke}=Ce;return(0,f.YO)({name:$e,component:{sync:ht=>(0,r.jsx)(Ke,{...ht})},data:{[V]:Ce,[F($e)]:!0}})}const ce=(Ce,$e)=>Ce.selectByComponentData({key:$e}).getElements()[0],z=Ce=>Ce.selectByComponentData({key:m}).selectByComponentData({key:V}),de=Ce=>Ce.selectByComponentData({key:m}).findComponentData({key:V}),D=()=>{const Ce=(0,W.pC)(),$e=(0,f.vJ)(Ce,z),Ke=(0,f.vJ)(Ce,de),ht=(0,p.useCallback)(vt=>{if(!$e||!vt)return null;const ot=F(vt.name);var Qe;return(Qe=ce($e,ot))!==null&&Qe!==void 0?Qe:null},[$e]),rt=(0,p.useCallback)(vt=>{const ot=Ke.find(Qe=>Qe.name===vt);return ot?ht(ot):null},[Ke,ht]),tt=(0,p.useCallback)(vt=>{const ot=Ke.filter(Qe=>Qe.location===vt);return ot.length?ot.map(ht):null},[Ke,ht]);return{renderComponentByName:rt,renderComponentsByLocation:tt}},A=(0,f.T0)({id:"plugin.techdocs.service"}),se=(0,f.T0)({id:"plugin.techdocs.storageservice"});var ie=n(64279),ee=n(77446),X=n(25271),K=n(51837);function R(Ce,$e){return $e.getOptionalBoolean("techdocs.legacyUseCaseSensitiveTripletPaths")||(Ce.kind=Ce.kind.toLocaleLowerCase(),Ce.name=Ce.name.toLocaleLowerCase(),Ce.namespace=Ce.namespace.toLocaleLowerCase()),Ce}const w=(Ce,$e)=>(0,X.eE)(Ce)===(0,X.eE)($e),I={title:"",subtitle:"",setTitle:()=>{},setSubtitle:()=>{},setShadowRoot:()=>{},metadata:{loading:!0},entityMetadata:{loading:!0},entityRef:{kind:"",name:"",namespace:""}},U=(0,K.CT)("techdocs-reader-page-context"),xe=(0,p.memo)(Ce=>{const{entityRef:$e,children:Ke}=Ce,ht=(0,f.h_)(A),rt=(0,f.h_)(f.Ds),tt=(0,ie.default)(async()=>ht.getEntityMetadata($e),[$e]),vt=(0,ee.Z)(async()=>ht.getTechDocsMetadata($e),[$e]),[ot,Qe]=(0,p.useState)(I.title),[ft,gt]=(0,p.useState)(I.subtitle),[Ct,mn]=(0,p.useState)(I.shadowRoot);(0,p.useEffect)(()=>{Ct&&!vt.value&&!vt.loading&&vt.retry()},[vt.value,vt.loading,Ct,vt.retry,vt]);const un={metadata:vt,entityRef:R($e,rt),entityMetadata:tt,shadowRoot:Ct,setShadowRoot:mn,title:ot,setTitle:Qe,subtitle:ft,setSubtitle:gt},ln=(0,K.EI)({1:un});return(0,r.jsx)(f.fC,{attributes:{entityRef:(0,X.eE)($e)},children:(0,r.jsx)(U.Provider,{value:ln,children:Ke instanceof Function?Ke(un):Ke})})},(Ce,$e)=>w(Ce.entityRef,$e.entityRef)),Se=()=>{const Ce=(0,p.useContext)(U);if(Ce===void 0)return I;const $e=Ce.atVersion(1);if($e===void 0)throw new Error("No context found for version 1.");return $e},k=Object.freeze({Header:"Header",Subheader:"Subheader",Settings:"Settings",PrimarySidebar:"PrimarySidebar",SecondarySidebar:"SecondarySidebar",Content:"Content"});var Ge=n(70882),xt=n(50236),Dt=n(19219),Ut=n(53974);const Tt="TECH_DOCS_SHADOW_DOM_STYLE_LOAD",Nt=Ce=>{(0,p.useEffect)(()=>{var $e,Ke;if(!Ce)return()=>{};const ht=Ce.querySelectorAll('head > link[rel="stylesheet"]');var rt;let tt=(rt=($e=ht)===null||$e===void 0?void 0:$e.length)!==null&&rt!==void 0?rt:0;const vt=new CustomEvent(Tt);if(!tt)return Ce.dispatchEvent(vt),()=>{};const ot=()=>{--tt===0&&Ce.dispatchEvent(vt)};return(Ke=ht)===null||Ke===void 0||Ke.forEach(Qe=>{Qe.addEventListener("load",ot)}),()=>{var Qe;(Qe=ht)===null||Qe===void 0||Qe.forEach(ft=>{ft.removeEventListener("load",ot)})}},[Ce])},Yt=Ce=>{const[$e,Ke]=(0,p.useState)(!1);return(0,p.useEffect)(()=>{if(!Ce)return()=>{};Ke(!0);const ht=Ce.style;ht.setProperty("opacity","0");const rt=()=>{Ke(!1),ht.setProperty("opacity","1")};return Ce.addEventListener(Tt,rt),()=>{Ce.removeEventListener(Tt,rt)}},[Ce]),$e},dt=Ce=>{const{element:$e,onAppend:Ke,children:ht}=Ce,[rt,tt]=(0,p.useState)((0,Ge.Ue)({...(0,xt.Z)(),insertionPoint:void 0}));Nt($e);const vt=Yt($e),ot=(0,p.useCallback)(Qe=>{if(!$e||!Qe)return;tt((0,Ge.Ue)({...(0,xt.Z)(),insertionPoint:$e.querySelector("head")||void 0}));let ft=Qe.shadowRoot;ft||(ft=Qe.attachShadow({mode:"open"})),ft.replaceChildren($e),typeof Ke=="function"&&Ke(ft)},[$e,Ke]);return(0,r.jsxs)(r.Fragment,{children:[vt&&(0,r.jsx)(Ut.Ex,{}),(0,r.jsxs)(Dt.ZP,{jss:rt,sheetsManager:new Map,children:[(0,r.jsx)("div",{ref:ot,"data-testid":"techdocs-native-shadowroot"}),ht]})]})};var ut=n(54073);const St=()=>{const{shadowRoot:Ce}=useTechDocsReaderPage();return Ce},lt=Ce=>{const $e=St();return $e?Ce.map(Ke=>{var ht;return(ht=$e)===null||ht===void 0?void 0:ht.querySelectorAll(Ke)}).filter(Ke=>Ke.length).map(Ke=>Array.from(Ke)).flat():[]},Zt=Ce=>Ce.toString()&&Ce.rangeCount&&Ce.getRangeAt(0).getBoundingClientRect().top,Ht=(Ce=0)=>{const $e=St(),[Ke,ht]=useState(null),rt=useMemo(()=>debounce(()=>{const tt=$e,vt=tt.getSelection?tt.getSelection():document.getSelection();vt&&Zt(vt)?ht(vt):ht(null)},Ce),[$e,ht,Ce]);return useEffect(()=>(window.document.addEventListener("selectionchange",rt),()=>{rt.cancel(),window.document.removeEventListener("selectionchange",rt)}),[rt]),Ke}},52943:function(It,Pe,n){"use strict";n.r(Pe),n.d(Pe,{EmbeddedDocsRouter:function(){return ie},Router:function(){return se},isTechDocsAvailable:function(){return A}});var r=n(52322),p=n(2784),W=n(73557),f=n(39709),V=n(53974),m=n(25271),h=n(89258),F=n(65124),ve=n(86317);const ce=({entity:ee})=>{const X=(0,m.iB)(ee);return(0,r.jsxs)(h.I6,{entityRef:X,children:[(0,r.jsx)(F.b,{}),(0,r.jsx)(ve.F,{withSearch:!1})]})};var z=n(18662),de=n(7476);const D="backstage.io/techdocs-ref",A=ee=>{var X,K,R;return Boolean((R=ee)===null||R===void 0||(K=R.metadata)===null||K===void 0||(X=K.annotations)===null||X===void 0?void 0:X[D])},se=()=>(0,r.jsxs)(W.Z5,{children:[(0,r.jsx)(W.AW,{path:"/",element:(0,r.jsx)(z.TechDocsIndexPage,{})}),(0,r.jsx)(W.AW,{path:"/:namespace/:kind/:name/*",element:(0,r.jsx)(de.TechDocsReaderPage,{})})]}),ie=ee=>{var X;const{children:K}=ee,{entity:R}=(0,f.X2)(),w=(0,W.V$)([{path:"/*",element:(0,r.jsx)(ce,{entity:R}),children:[{path:"*",element:K}]}]);return((X=R.metadata.annotations)===null||X===void 0?void 0:X[D])?w:(0,r.jsx)(V.sk,{annotation:D})}},92077:function(It,Pe,n){"use strict";n.d(Pe,{k:function(){return m},p:function(){return V}});var r=n(87612),p=n(23054),W=n(54847),f=n.n(W);class V{async getApiOrigin(){return await this.discoveryApi.getBaseUrl("techdocs")}async getTechDocsMetadata(F){const{kind:ve,namespace:ce,name:z}=F,D=`${await this.getApiOrigin()}/metadata/techdocs/${ce}/${ve}/${z}`,A=await this.fetchApi.fetch(`${D}`);if(!A.ok)throw await p.VL.fromResponse(A);return await A.json()}async getEntityMetadata(F){const{kind:ve,namespace:ce,name:z}=F,D=`${await this.getApiOrigin()}/metadata/entity/${ce}/${ve}/${z}`,A=await this.fetchApi.fetch(`${D}`);if(!A.ok)throw await p.VL.fromResponse(A);return await A.json()}constructor(F){(0,r._)(this,"configApi",void 0),(0,r._)(this,"discoveryApi",void 0),(0,r._)(this,"fetchApi",void 0),this.configApi=F.configApi,this.discoveryApi=F.discoveryApi,this.fetchApi=F.fetchApi}}class m{async getApiOrigin(){return await this.discoveryApi.getBaseUrl("techdocs")}async getStorageUrl(){var F;return(F=this.configApi.getOptionalString("techdocs.storageUrl"))!==null&&F!==void 0?F:`${await this.discoveryApi.getBaseUrl("techdocs")}/static/docs`}async getBuilder(){return this.configApi.getString("techdocs.builder")}async getEntityDocs(F,ve){const{kind:ce,namespace:z,name:de}=F,A=`${await this.getStorageUrl()}/${z}/${ce}/${de}/${ve}`,se=await this.fetchApi.fetch(`${A.endsWith("/")?A:`${A}/`}index.html`);let ie="";switch(se.status){case 404:throw ie="Page not found. ",ve||(ie+="This could be because there is no index.md file in the root of the docs directory of this repository."),new p.dR(ie);case 500:throw ie="Could not generate documentation or an error in the TechDocs backend. ",new Error(ie);default:break}return se.text()}async syncEntityDocs(F,ve=()=>{}){const{kind:ce,namespace:z,name:de}=F,A=`${await this.getApiOrigin()}/sync/${z}/${ce}/${de}`,{token:se}=await this.identityApi.getCredentials();return new Promise((ie,ee)=>{const X=new W.EventSourcePolyfill(A,{withCredentials:!0,headers:se?{Authorization:`Bearer ${se}`}:{}});X.addEventListener("log",K=>{K.data&&ve(JSON.parse(K.data))}),X.addEventListener("finish",K=>{let R=!1;K.data&&({updated:R}=JSON.parse(K.data)),ie(R?"updated":"cached")}),X.onerror=K=>{switch(X.close(),K.status){case 404:ee(new p.dR(K.message));return;default:ee(new Error(K.data));return}}})}async getBaseUrl(F,ve,ce){const{kind:z,namespace:de,name:D}=ve,se=`${await this.getApiOrigin()}/static/docs/${de}/${z}/${D}/${ce}`;return new URL(F,se.endsWith("/")?se:`${se}/`).toString()}constructor(F){(0,r._)(this,"configApi",void 0),(0,r._)(this,"discoveryApi",void 0),(0,r._)(this,"identityApi",void 0),(0,r._)(this,"fetchApi",void 0),this.configApi=F.configApi,this.discoveryApi=F.discoveryApi,this.identityApi=F.identityApi,this.fetchApi=F.fetchApi}}},51953:function(It,Pe,n){"use strict";n.d(Pe,{D:function(){return r}});function r(p,W){return W.getOptionalBoolean("techdocs.legacyUseCaseSensitiveTripletPaths")?p:p.toLocaleLowerCase("en-US")}},3482:function(It,Pe,n){"use strict";n.d(Pe,{u:function(){return F}});var r=n(52322),p=n(2784),W=n(53974),f=n(39709),V=n(42081),m=n(48431),h=n(68435);const F=ve=>{const{initialFilter:ce="owned",columns:z,actions:de}=ve;return(0,r.jsx)(V.j,{children:(0,r.jsxs)(W.VY,{children:[(0,r.jsx)(W.yW,{title:"",children:(0,r.jsx)(W.qt,{children:"Discover documentation in your ecosystem."})}),(0,r.jsx)(f.UO,{children:(0,r.jsxs)(f._i,{children:[(0,r.jsxs)(f._i.Filters,{children:[(0,r.jsx)(m.f,{}),(0,r.jsx)(f.EW,{initialFilter:ce}),(0,r.jsx)(f.dq,{}),(0,r.jsx)(f.xE,{})]}),(0,r.jsx)(f._i.Content,{children:(0,r.jsx)(h.n,{actions:de,columns:z})})]})})]})})}},85478:function(It,Pe,n){"use strict";n.d(Pe,{f:function(){return z}});var r=n(52322),p=n(95573),W=n(51953),f=n(60871),V=n(53974),m=n(94339),h=n(16111),F=n(24579),ve=n(14503),ce=n(2784);const z=ie=>{var ee;const{entities:X}=ie,K=(0,f.tg)(p.Fw),R=(0,f.h_)(f.Ds);if(!X)return null;var w,I;return(0,r.jsx)(V.Oh,{"data-testid":"docs-explore",children:!((ee=X)===null||ee===void 0)&&ee.length?X.map((U,xe)=>(0,r.jsxs)(m.Z,{children:[(0,r.jsx)(h.Z,{children:(0,r.jsx)(V.hu,{title:(w=U.metadata.title)!==null&&w!==void 0?w:U.metadata.name})}),(0,r.jsx)(F.Z,{children:U.metadata.description}),(0,r.jsx)(ve.Z,{children:(0,r.jsx)(V.Qj,{to:K({namespace:(0,W.D)((I=U.metadata.namespace)!==null&&I!==void 0?I:"default",R),kind:(0,W.D)(U.kind,R),name:(0,W.D)(U.metadata.name,R)}),color:"primary","data-testid":"read_docs",children:"Read Docs"})})]},xe)):null})};var de=n(39709);const D={title:"All Documentation",filterPredicate:()=>!0},A=ie=>{const{entities:ee,group:X}=ie,{loading:K,isOwnedEntity:R}=useEntityOwnership(),w=ee.filter(U=>X.filterPredicate==="ownedByUser"?K?!1:R(U):typeof X.filterPredicate=="function"&&X.filterPredicate(U)),I=(()=>typeof X.title=="string"?_jsx(ContentHeader,{title:X.title}):X.title)();return w.length===0?null:_jsxs(Content,{children:[I,_jsx(DocsCardGrid,{entities:w})]})},se=ie=>{const{loading:ee,error:X,entities:K}=useEntityList();if(X)return _jsx(WarningPanel,{severity:"error",title:"Could not load available documentation.",children:_jsx(CodeSnippet,{language:"text",text:X.toString()})});if(ee)return _jsx(Progress,{});if(K.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 R,w;return K.sort((I,U)=>((R=I.metadata.title)!==null&&R!==void 0?R:I.metadata.name).localeCompare((w=U.metadata.title)!==null&&w!==void 0?w:U.metadata.name)),_jsx(Content,{children:(ie.groups||[D]).map((I,U)=>_jsx(A,{entities:K,group:I},`${I.title}-${U}`))})}},68435:function(It,Pe,n){"use strict";n.d(Pe,{H:function(){return K},n:function(){return R}});var r=n(52322),p=n(2784),W=n(95074),f=n(76635),V=n(53974),m=n(39709),h=n(60871),F=n(25271),ve=n(95573),ce=n(39981),z=n(2337),de=n(11640),D=n(28347);const A=(0,z.Z)({root:{color:"#f3ba37"}})(de.Z),se={createCopyDocsUrlAction(w){return I=>({icon:()=>(0,r.jsx)(ce.Z,{fontSize:"small"}),tooltip:"Click to copy documentation link to clipboard",onClick:()=>w(`${window.location.origin}${I.resolved.docsUrl}`)})},createStarEntityAction(w,I){return U=>{const xe=U.entity,Se=w(xe);return{cellStyle:{paddingLeft:"1em"},icon:()=>Se?(0,r.jsx)(A,{}):(0,r.jsx)(D.Z,{}),tooltip:Se?"Remove from favorites":"Add to favorites",onClick:()=>I(xe)}}}};function ie(w){return w.metadata.title||w.metadata.name}const ee={createNameColumn(){return{title:"Document",field:"entity.metadata.name",highlight:!0,render:w=>(0,r.jsx)(V.uw,{value:(0,r.jsx)(V.rU,{to:w.resolved.docsUrl,children:ie(w.entity)}),subvalue:w.entity.metadata.description})}},createOwnerColumn(){return{title:"Owner",field:"resolved.ownedByRelationsTitle",render:({resolved:w})=>(0,r.jsx)(m.rI,{entityRefs:w.ownedByRelations,defaultKind:"group"})}},createTypeColumn(){return{title:"Type",field:"entity.spec.type"}}};var X=n(51953);const K=w=>{const{entities:I,title:U,loading:xe,columns:Se,actions:k,options:Ge}=w,[,xt]=(0,W.Z)(),Dt=(0,h.tg)(ve.Fw),Ut=(0,h.h_)(h.Ds);if(!I)return null;const Tt=I.map(dt=>{const ut=(0,m.hF)(dt,F.S4);var St;return{entity:dt,resolved:{docsUrl:Dt({namespace:(0,X.D)((St=dt.metadata.namespace)!==null&&St!==void 0?St:"default",Ut),kind:(0,X.D)(dt.kind,Ut),name:(0,X.D)(dt.metadata.name,Ut)}),ownedByRelations:ut,ownedByRelationsTitle:ut.map(lt=>(0,m.$3)(lt,{defaultKind:"group"})).join(", ")}}}),Nt=[ee.createNameColumn(),ee.createOwnerColumn(),ee.createTypeColumn()],Yt=[se.createCopyDocsUrlAction(xt)];return(0,r.jsx)(r.Fragment,{children:xe||Tt&&Tt.length>0?(0,r.jsx)(V.iA,{isLoading:xe,options:{paging:!0,pageSize:20,search:!0,actionsColumnIndex:-1,...Ge},data:Tt,columns:Se||Nt,actions:k||Yt,title:U?`${U} (${Tt.length})`:`All (${Tt.length})`}):(0,r.jsx)(V.ub,{missing:"data",title:"No documents to show",description:"Create your own document. Check out our Getting Started Information",action:(0,r.jsx)(V.Qj,{color:"primary",to:"https://backstage.io/docs/features/techdocs/getting-started",variant:"contained",children:"DOCS"})})})};K.columns=ee,K.actions=se;const R=w=>{var I;const{columns:U,actions:xe,options:Se}=w,{loading:k,error:Ge,entities:xt,filters:Dt}=(0,m.wp)(),{isStarredEntity:Ut,toggleStarredEntity:Tt}=(0,m.CR)(),[,Nt]=(0,W.Z)();var Yt;const dt=(0,f.capitalize)((Yt=(I=Dt.user)===null||I===void 0?void 0:I.value)!==null&&Yt!==void 0?Yt:"all"),ut=[se.createCopyDocsUrlAction(Nt),se.createStarEntityAction(Ut,Tt)];return Ge?(0,r.jsx)(V.GB,{severity:"error",title:"Could not load available documentation.",children:(0,r.jsx)(V.Oi,{language:"text",text:Ge.toString()})}):(0,r.jsx)(K,{title:dt,entities:xt,loading:k,actions:xe||ut,columns:U,options:Se})};R.columns=ee,R.actions=se},18662:function(It,Pe,n){"use strict";n.r(Pe),n.d(Pe,{TechDocsIndexPage:function(){return V}});var r=n(52322),p=n(2784),W=n(73557),f=n(3482);const V=m=>(0,W.pC)()||(0,r.jsx)(f.u,{...m})},42081:function(It,Pe,n){"use strict";n.d(Pe,{j:function(){return V}});var r=n(52322),p=n(2784),W=n(53974),f=n(60871);const V=m=>{const{children:h}=m,F=(0,f.h_)(f.Ds);var ve;const ce=`Documentation available in ${(ve=F.getOptionalString("organization.name"))!==null&&ve!==void 0?ve:"Backstage"}`;return(0,r.jsx)(W.g9,{title:"Documentation",subtitle:ce,themeId:"documentation",children:h})}},48431:function(It,Pe,n){"use strict";n.d(Pe,{f:function(){return f}});var r=n(2784),p=n(39709);class W{getCatalogFilters(){return{"metadata.annotations.backstage.io/techdocs-ref":p.n3}}}const f=()=>{const{updateFilters:V}=(0,p.wp)();return(0,r.useEffect)(()=>{V({techdocs:new W})},[V]),null}},89258:function(It,Pe,n){"use strict";n.d(Pe,{I6:function(){return z},Jl:function(){return ce},s4:function(){return m}});var r=n(61886),p=n(92077),W=n(95573),f=n(60871),V=n(15096);const m=(0,f.rx)({id:"techdocs",apis:[(0,f.ni)({api:r.Dl,deps:{configApi:f.Ds,discoveryApi:f.NW,identityApi:f.$4,fetchApi:f.gP},factory:({configApi:D,discoveryApi:A,identityApi:se,fetchApi:ie})=>new p.k({configApi:D,discoveryApi:A,identityApi:se,fetchApi:ie})}),(0,f.ni)({api:r.gT,deps:{configApi:f.Ds,discoveryApi:f.NW,fetchApi:f.gP},factory:({configApi:D,discoveryApi:A,fetchApi:se})=>new p.p({configApi:D,discoveryApi:A,fetchApi:se})})],routes:{root:W._Z,docRoot:W.Fw,entityContent:W.pd}}),h=m.provide((0,f.P4)({name:"TechdocsPage",component:()=>Promise.resolve().then(n.bind(n,52943)).then(D=>D.Router),mountPoint:W._Z})),F=m.provide((0,f.P4)({name:"EntityTechdocsContent",component:()=>Promise.resolve().then(n.bind(n,52943)).then(D=>D.EmbeddedDocsRouter),mountPoint:W.pd})),ve=m.provide((0,f.P4)({name:"TechDocsCustomHome",component:()=>n.e(7560).then(n.bind(n,27560)).then(D=>D.TechDocsCustomHome),mountPoint:W._Z})),ce=m.provide((0,f.P4)({name:"TechDocsIndexPage",component:()=>Promise.resolve().then(n.bind(n,18662)).then(D=>D.TechDocsIndexPage),mountPoint:W._Z})),z=m.provide((0,f.P4)({name:"TechDocsReaderPage",component:()=>Promise.resolve().then(n.bind(n,7476)).then(D=>D.TechDocsReaderPage),mountPoint:W.Fw})),de=m.provide((0,V.E5)({name:"TechDocsSearchResultListItem",component:()=>Promise.resolve().then(n.bind(n,55511)).then(D=>D.TechDocsSearchResultListItem),predicate:D=>D.type==="techdocs"}))},7476:function(It,Pe,n){"use strict";n.r(Pe),n.d(Pe,{TechDocsReaderLayout:function(){return z},TechDocsReaderPage:function(){return de}});var r=n(52322),p=n(2784),W=n(73557),f=n(53974),V=n(61886),m=n(86317),h=n(93225),F=n(65124),ve=n(95573),ce=n(60871);const z=D=>{const{withSearch:A,withHeader:se=!0}=D;return(0,r.jsxs)(f.T3,{themeId:"documentation",children:[se&&(0,r.jsx)(h.S,{}),(0,r.jsx)(F.b,{}),(0,r.jsx)(m.F,{withSearch:A})]})},de=D=>{const{kind:A,name:se,namespace:ie}=(0,ce.Oi)(ve.Fw),{children:ee,entityRef:X={kind:A,name:se,namespace:ie}}=D,K=(0,W.pC)();if(!ee){const w=K?p.Children.toArray(K.props.children):[];var R;const U=w.flatMap(xe=>{var Se,k;return(R=(k=xe)===null||k===void 0||(Se=k.props)===null||Se===void 0?void 0:Se.children)!==null&&R!==void 0?R:[]}).find(xe=>!(0,ce.IY)(xe,V.Zz)&&!(0,ce.IY)(xe,V.jM));return(0,r.jsx)(V.ZS,{entityRef:X,children:U||(0,r.jsx)(z,{})})}return(0,r.jsx)(V.ZS,{entityRef:X,children:({metadata:w,entityMetadata:I,onReady:U})=>(0,r.jsx)("div",{className:"techdocs-reader-page",children:(0,r.jsx)(f.T3,{themeId:"documentation",children:ee instanceof Function?ee({entityRef:X,techdocsMetadataValue:w.value,entityMetadataValue:I.value,onReady:U}):ee})})})}},86317:function(It,Pe,n){"use strict";n.d(Pe,{F:function(){return te}});var r=n(52322),p=n(2784),W=n(79692),f=n(60905),V=n(61886),m=n(53974),h=n(22478),F=n(4614),ve=n(77277),ce=n(99688),z=n(12420),de=n(90436),D=n(61837),A=n(4190),se=n(87685);const ie=(0,W.Z)(v=>(0,z.Z)({paper:{width:"100%",[v.breakpoints.up("sm")]:{width:"75%"},[v.breakpoints.up("md")]:{width:"50%"},padding:v.spacing(2.5)},root:{height:"100%",overflow:"hidden"},logs:{background:v.palette.background.default}})),ee=({buildLog:v,onClose:O})=>{const M=ie(),G=v.length===0?"Waiting for logs...":v.join(`
|
|
@@ -519,4 +519,4 @@ ${nt.href}
|
|
|
519
519
|
|
|
520
520
|
Feedback:`),_t=((be=bt)===null||be===void 0?void 0:be.type)==="github"?(0,Sn.BT)(yt.href,"blob"):yt.href,jt=on()(_t),Ft=`/${jt.organization}/${jt.name}`,qt=nt.cloneNode();switch((ke=bt)===null||ke===void 0?void 0:ke.type){case"gitlab":qt.href=`${yt.origin}${Ft}/issues/new?issue[title]=${Oe}&issue[description]=${wt}`;break;case"github":qt.href=`${yt.origin}${Ft}/issues/new?title=${Oe}&body=${wt}`;break;default:return O}return vn.render(p.createElement(hn.Z),qt),qt.style.paddingLeft="5px",qt.title="Leave feedback for this page",qt.id="git-feedback-link",(Xe=nt)===null||Xe===void 0||Xe.insertAdjacentElement("beforebegin",qt),O};var wn=n(44882);const _e=()=>v=>{var O;const M=v.querySelector('.md-header label[for="__drawer"]'),G=v.querySelector("article");if(!M||!G)return v;const ue=M.cloneNode();return vn.render(p.createElement(wn.Z),ue),ue.id="toggle-sidebar",ue.title="Toggle Sidebar",ue.classList.add("md-content__button"),ue.style.setProperty("padding","0 0 0 5px"),ue.style.setProperty("margin","0.4rem 0 0.4rem 0.4rem"),(O=G)===null||O===void 0||O.prepend(ue),v},Jt=()=>v=>(((M,G)=>{Array.from(M).filter(ue=>ue.hasAttribute(G)).forEach(ue=>{const be=ue.getAttribute(G);if(be){be.match(/^https?:\/\//i)&&ue.setAttribute("target","_blank");try{const ke=Wt(window.location.href);ue.setAttribute(G,new URL(be,ke).toString())}catch{ue.replaceWith(ue.textContent||be)}}})})(Array.from(v.getElementsByTagName("a")),"href"),v);function Wt(v){const O=new URL(v);return!O.pathname.endsWith("/")&&!O.pathname.endsWith(".html")&&(O.pathname+="/"),O.toString()}const Ye=({baseUrl:v,onClick:O})=>M=>(Array.from(M.getElementsByTagName("a")).forEach(G=>{G.addEventListener("click",ue=>{const ke=G.getAttribute("href");ke&&ke.startsWith(v)&&!G.hasAttribute("download")&&(ue.preventDefault(),O(ue,ke))})}),M);var Tn=n(15459),sn=n(80030),Dn=n(72379),Rn=n(41547),In=n(95074);const Kn=(0,Tn.Z)(v=>({tooltip:{fontSize:"inherit",color:v.palette.text.primary,margin:0,padding:v.spacing(.5),backgroundColor:"transparent",boxShadow:"none"}}))(sn.ZP),On=()=>(0,r.jsx)(Dn.Z,{children:(0,r.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"})}),Yn=({text:v})=>{const[O,M]=(0,p.useState)(!1),[,G]=(0,In.Z)(),ue=(0,p.useCallback)(()=>{G(v),M(!0)},[v,G]),be=(0,p.useCallback)(()=>{M(!1)},[M]);return(0,r.jsx)(Kn,{title:"Copied to clipboard",placement:"left",open:O,onClose:be,leaveDelay:1e3,children:(0,r.jsx)(D.Z,{style:{color:"inherit"},className:"md-clipboard md-icon",onClick:ue,children:(0,r.jsx)(On,{})})})},we=v=>O=>{const M=O.querySelectorAll("pre > code");for(const be of M){var G,ue;const ke=be.textContent||"",Xe=document.createElement("div");(ue=be)===null||ue===void 0||(G=ue.parentElement)===null||G===void 0||G.prepend(Xe),vn.render((0,r.jsx)(Rn.Z,{theme:v,children:(0,r.jsx)(Yn,{text:ke})}),Xe)}return O},pe=()=>v=>{var O;return(O=v.querySelector(".md-header"))===null||O===void 0||O.remove(),v},Re=()=>v=>{var O,M;return(O=v.querySelector(".md-footer .md-copyright"))===null||O===void 0||O.remove(),(M=v.querySelector(".md-footer-copyright"))===null||M===void 0||M.remove(),v},H=({onLoading:v,onLoaded:O})=>M=>(v(),M.addEventListener(V.Ox,function G(){O(),M.removeEventListener(V.Ox,G)}),M),N=()=>v=>(v.addEventListener(V.Ox,function O(){if(window.location.hash){var M,G;const ue=window.location.hash.slice(1);(G=v)===null||G===void 0||(M=G.querySelector(`[id="${ue}"]`))===null||M===void 0||M.scrollIntoView()}v.removeEventListener(V.Ox,O)}),v),le=()=>v=>(setTimeout(()=>{var O;const M=(O=v)===null||O===void 0?void 0:O.querySelectorAll("li.md-nav__item--active");M.length!==0&&(M.forEach(ue=>{var be,ke;const Xe=(be=ue)===null||be===void 0?void 0:be.querySelector("input");if(!(!((ke=Xe)===null||ke===void 0)&&ke.checked)){var nt;(nt=Xe)===null||nt===void 0||nt.click()}}),M[M.length-1].scrollIntoView())},200),v),Ee=async(v,O)=>{let M;if(typeof v=="string")M=new DOMParser().parseFromString(v,"text/html").documentElement;else if(v instanceof Element)M=v;else throw new Error("dom is not a recognized type");for(const G of O)M=await G(M);return M};var Ue=n(73557);function qe(v,O){const M=new URL(O),G=`${M.origin}${M.pathname.replace(/\/$/,"")}`,ue=v.replace(G,"").replace(/^\/+/,""),be=new URL(`http://localhost/${ue}`);return`${be.pathname}${be.search}${be.hash}`}function Pt(){const v=(0,Ue.s0)(),M=(0,K.h_)(K.Ds).getOptionalString("app.baseUrl");return(0,p.useCallback)(ue=>{let be=ue;if(M)try{be=qe(ue,M)}catch{}v(be)},[v,M])}const $t="screen and (max-width: 76.1875em)",Qt=v=>{const O=Pt(),M=(0,xe.Z)(),G=(0,Se.Z)($t),ue=Ht(),be=mn(),ke=(0,K.z$)(),Xe=(0,K.h_)(V.Dl),nt=(0,K.h_)(k.q3),{state:yt,path:bt,content:ct}=(0,w.DK)(),[Oe,wt]=(0,p.useState)(null),_t=(0,V.ux)(Oe),jt=(0,p.useCallback)(()=>{if(!Oe)return;Oe.querySelectorAll(".md-sidebar").forEach(mt=>{if(G)mt.style.top="0px";else{var Lt,Mt,en;const yn=(Lt=document)===null||Lt===void 0?void 0:Lt.querySelector(".techdocs-reader-page");var pr;const Mn=(pr=(Mt=yn)===null||Mt===void 0?void 0:Mt.getBoundingClientRect().top)!==null&&pr!==void 0?pr:0;var fr;let gr=(fr=Oe.getBoundingClientRect().top)!==null&&fr!==void 0?fr:0;const Nr=Oe.querySelector(".md-container > .md-tabs");var _n;const zn=(_n=(en=Nr)===null||en===void 0?void 0:en.getBoundingClientRect().height)!==null&&_n!==void 0?_n:0;gr<Mn&&(gr=Mn),mt.style.top=`${Math.max(gr,0)+zn}px`}mt.style.setProperty("opacity","1")})},[Oe,G]);(0,p.useEffect)(()=>(window.addEventListener("resize",jt),window.addEventListener("scroll",jt,!0),()=>{window.removeEventListener("resize",jt),window.removeEventListener("scroll",jt,!0)}),[Oe,jt]);const Ft=(0,p.useCallback)(()=>{if(!Oe)return;const Bt=Oe.querySelector(".md-footer");Bt&&(Bt.style.width=`${Oe.getBoundingClientRect().width}px`)},[Oe]);(0,p.useEffect)(()=>(window.addEventListener("resize",Ft),()=>{window.removeEventListener("resize",Ft)}),[Oe,Ft]),(0,p.useEffect)(()=>{_t||(Ft(),jt())},[yt,_t,Ft,jt]);const qt=(0,p.useCallback)((Bt,mt)=>Ee(Bt,[ue,ln({techdocsStorageApi:Xe,entityId:v,path:mt}),Jt(),_e(),pe(),Re(),pn(nt),be]),[v,nt,Xe,ue,be]),jn=(0,p.useCallback)(async Bt=>Ee(Bt,[N(),le(),we(M),Ye({baseUrl:window.location.origin,onClick:(mt,Lt)=>{var Mt;const en=mt.ctrlKey||mt.metaKey,pr=new URL(Lt),fr=((Mt=mt.target)===null||Mt===void 0?void 0:Mt.innerText)||Lt,_n=Lt.replace(window.location.origin,"");if(ke.captureEvent("click",fr,{attributes:{to:_n}}),pr.hash)if(en)window.open(Lt,"_blank");else{var yn,Mn;O(Lt),(Mn=Bt)===null||Mn===void 0||(yn=Mn.querySelector(`[id="${pr.hash.slice(1)}"]`))===null||yn===void 0||yn.scrollIntoView()}else en?window.open(Lt,"_blank"):O(Lt)}}),H({onLoading:()=>{},onLoaded:()=>{var mt;(mt=Bt.querySelector(".md-nav__title"))===null||mt===void 0||mt.removeAttribute("for")}}),H({onLoading:()=>{Array.from(Bt.querySelectorAll(".md-sidebar")).forEach(Lt=>{Lt.style.setProperty("opacity","0")})},onLoaded:()=>{}})]),[M,O,ke]);return(0,p.useEffect)(()=>{if(!ct)return()=>{};let Bt=!0;return qt(ct,bt).then(async mt=>{var Lt;if(!(!((Lt=mt)===null||Lt===void 0)&&Lt.innerHTML)||!Bt)return;window.scroll({top:0});const Mt=await jn(mt);wt(Mt)}),()=>{Bt=!1}},[ct,bt,qt,jn]),Oe};var Xt=n(8560);const an=()=>{var v,O,M,G,ue;const be=(0,V.$L)(),{shadowRoot:ke}=(0,V.x1)(),Xe=(v=ke)===null||v===void 0?void 0:v.querySelector('[data-md-component="content"]'),nt=(O=ke)===null||O===void 0?void 0:O.querySelector('div[data-md-component="sidebar"][data-md-type="navigation"], div[data-md-component="navigation"]');let yt=(M=nt)===null||M===void 0?void 0:M.querySelector('[data-techdocs-addons-location="primary sidebar"]');if(!yt){var bt;yt=document.createElement("div"),yt.setAttribute("data-techdocs-addons-location","primary sidebar"),(bt=nt)===null||bt===void 0||bt.prepend(yt)}const ct=(G=ke)===null||G===void 0?void 0:G.querySelector('div[data-md-component="sidebar"][data-md-type="toc"], div[data-md-component="toc"]');let Oe=(ue=ct)===null||ue===void 0?void 0:ue.querySelector('[data-techdocs-addons-location="secondary sidebar"]');if(!Oe){var wt;Oe=document.createElement("div"),Oe.setAttribute("data-techdocs-addons-location","secondary sidebar"),(wt=ct)===null||wt===void 0||wt.prepend(Oe)}return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(Xt.Z,{container:yt,children:be.renderComponentsByLocation(V.oZ.PrimarySidebar)}),(0,r.jsx)(Xt.Z,{container:Xe,children:be.renderComponentsByLocation(V.oZ.Content)}),(0,r.jsx)(Xt.Z,{container:Oe,children:be.renderComponentsByLocation(V.oZ.SecondarySidebar)})]})},ne=(0,W.Z)({search:{width:"100%","@media (min-width: 76.1875em)":{width:"calc(100% - 34.4rem)",margin:"0 auto"},"@media print":{display:"none"}}}),te=(0,w.m1)(v=>{var O,M;const{withSearch:G=!0,onReady:ue}=v,be=ne(),{entityMetadata:{value:ke,loading:Xe},entityRef:nt,setShadowRoot:yt}=(0,V.x1)(),bt=Qt(nt),ct=(0,p.useCallback)(Oe=>{yt(Oe),ue instanceof Function&&ue()},[yt,ue]);return Xe===!1&&!ke?(0,r.jsx)(m.mf,{status:"404",statusMessage:"PAGE NOT FOUND"}):bt?(0,r.jsx)(m.VY,{children:(0,r.jsxs)(f.Z,{container:!0,children:[(0,r.jsx)(f.Z,{xs:12,item:!0,children:(0,r.jsx)(U,{})}),G&&(0,r.jsx)(f.Z,{className:be.search,xs:"auto",item:!0,children:(0,r.jsx)(h.S,{entityId:nt,entityTitle:(M=ke)===null||M===void 0||(O=M.metadata)===null||O===void 0?void 0:O.title})}),(0,r.jsx)(f.Z,{xs:12,item:!0,children:(0,r.jsx)(V.VA,{element:bt,onAppend:ct,children:(0,r.jsx)(an,{})})})]})}):(0,r.jsx)(m.VY,{children:(0,r.jsx)(f.Z,{container:!0,children:(0,r.jsx)(f.Z,{xs:12,item:!0,children:(0,r.jsx)(U,{})})})})}),Y=null},93225:function(It,Pe,n){"use strict";n.d(Pe,{S:function(){return ie}});var r=n(52322),p=n(2784),W=n(18671),f=n(60905),V=n(98069),m=n(60364),h=n(73250),F=n(61886),ve=n(39709),ce=n(25271),z=n(53974),de=n(60871),D=n(76635),A=n(95573);const se=(0,r.jsx)(V.Z,{animation:"wave",variant:"text",height:40}),ie=ee=>{var X,K,R;const{palette:{common:{white:w}}}=(0,m.Z)(),{children:I}=ee,U=(0,F.$L)(),xe=(0,de.h_)(de.Ds),{title:Se,setTitle:k,subtitle:Ge,setSubtitle:xt,entityRef:Dt,metadata:{value:Ut,loading:Tt},entityMetadata:{value:Nt,loading:Yt}}=(0,F.x1)();(0,p.useEffect)(()=>{Ut&&(k(Ut.site_name),xt(()=>{let{site_description:rt}=Ut;return(!rt||rt==="None")&&(rt=""),rt}))},[Ut,k,xt]);const dt=xe.getOptional("app.title")||"Backstage",ut=[Se,Ge,dt].filter(Boolean).join(" | "),{locationMetadata:St,spec:lt}=Nt||{},Zt=(X=lt)===null||X===void 0?void 0:X.lifecycle,Ht=Nt?(0,ve.hF)(Nt,ce.S4):[],Ce=(0,de.tg)(A._Z)(),$e=(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(z.i9,{label:(0,D.capitalize)(((K=Nt)===null||K===void 0?void 0:K.kind)||"entity"),value:(0,r.jsx)(ve.dx,{color:"inherit",entityRef:Dt,title:(R=Nt)===null||R===void 0?void 0:R.metadata.title,defaultKind:"Component"})}),Ht.length>0&&(0,r.jsx)(z.i9,{label:"Owner",value:(0,r.jsx)(ve.rI,{color:"inherit",entityRefs:Ht,defaultKind:"group"})}),Zt?(0,r.jsx)(z.i9,{label:"Lifecycle",value:Zt}):null,St&&St.type!=="dir"&&St.type!=="file"?(0,r.jsx)(z.i9,{label:"",value:(0,r.jsxs)(f.Z,{container:!0,direction:"column",alignItems:"center",style:{color:w},children:[(0,r.jsx)(f.Z,{style:{padding:0},item:!0,children:(0,r.jsx)(h.Z,{style:{marginTop:"-25px"}})}),(0,r.jsx)(f.Z,{style:{padding:0},item:!0,children:"Source"})]}),url:St.target}):null]});return!Yt&&Nt===void 0||!Tt&&Ut===void 0?null:(0,r.jsxs)(z.h4,{type:"Documentation",typeLink:Ce,title:Se||se,subtitle:Ge===""?void 0:Ge||se,children:[(0,r.jsx)(W.Z,{titleTemplate:"%s",children:(0,r.jsx)("title",{children:ut})}),$e,I,U.renderComponentsByLocation(F.oZ.Header)]})}},65124:function(It,Pe,n){"use strict";n.d(Pe,{b:function(){return de}});var r=n(52322),p=n(2784),W=n(79692),f=n(15223),V=n(95544),m=n(80030),h=n(61837),F=n(48348),ve=n(47603),ce=n(61886);const z=(0,W.Z)(D=>({root:{gridArea:"pageSubheader",flexDirection:"column",minHeight:"auto",padding:D.spacing(3,3,0),"@media print":{display:"none"}}})),de=D=>{const A=z(),[se,ie]=(0,p.useState)(null),ee=(0,p.useCallback)(xe=>{ie(xe.currentTarget)},[]),X=(0,p.useCallback)(()=>{ie(null)},[]),{entityMetadata:{value:K,loading:R}}=(0,ce.x1)(),w=(0,ce.$L)(),I=w.renderComponentsByLocation(ce.oZ.Subheader),U=w.renderComponentsByLocation(ce.oZ.Settings);return!I&&!U||R===!1&&!K?null:(0,r.jsx)(f.Z,{classes:A,...D.toolbarProps,children:(0,r.jsxs)(V.Z,{display:"flex",justifyContent:"flex-end",width:"100%",flexWrap:"wrap",children:[I,U?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(m.ZP,{title:"Settings",children:(0,r.jsx)(h.Z,{"aria-controls":"tech-docs-reader-page-settings","aria-haspopup":"true",onClick:ee,children:(0,r.jsx)(ve.Z,{})})}),(0,r.jsx)(F.Z,{id:"tech-docs-reader-page-settings",getContentAnchorEl:null,anchorEl:se,anchorOrigin:{vertical:"bottom",horizontal:"right"},open:Boolean(se),onClose:X,keepMounted:!0,children:(0,r.jsx)("div",{children:U})})]}):null]})})}},95481:function(It,Pe,n){"use strict";n.d(Pe,{DK:function(){return de},m1:function(){return A}});var r=n(52322),p=n(2784),W=n(73557),f=n(61886),V=n(60871),m=n(64279),h=n(77446);function F({contentLoading:se,content:ie,activeSyncState:ee}){return se||ee==="BUILD_READY_RELOAD"||!ie&&ee==="CHECKING"?"CHECKING":!ie&&ee==="BUILDING"?"INITIAL_BUILD":ie?ee==="BUILDING"?"CONTENT_STALE_REFRESHING":ee==="BUILD_READY"?"CONTENT_STALE_READY":ee==="ERROR"?"CONTENT_STALE_ERROR":"CONTENT_FRESH":"CONTENT_NOT_FOUND"}function ve(se,ie){const ee={...se};switch(ie.type){case"sync":ie.state==="CHECKING"&&(ee.buildLog=[]),ee.activeSyncState=ie.state,ee.syncError=ie.syncError;break;case"contentLoading":ee.contentLoading=!0,ee.contentError=void 0;break;case"content":typeof ie.path=="string"&&(ee.path=ie.path),ee.contentLoading=!1,ee.content=ie.content,ee.contentError=ie.contentError;break;case"buildLog":ee.buildLog=ee.buildLog.concat(ie.log);break;default:throw new Error}return["BUILD_READY","BUILD_READY_RELOAD"].includes(ee.activeSyncState)&&["contentLoading","content"].includes(ie.type)&&(ee.activeSyncState="UP_TO_DATE",ee.buildLog=[]),ee}function ce(se,ie,ee,X){var K,R;const[w,I]=(0,p.useReducer)(ve,{activeSyncState:"CHECKING",path:X,contentLoading:!0,buildLog:[]}),U=(0,V.h_)(f.Dl),{retry:xe}=(0,h.Z)(async()=>{I({type:"contentLoading"});try{const Ge=await U.getEntityDocs({kind:se,namespace:ie,name:ee},X);return I({type:"content",content:Ge,path:X}),Ge}catch(Ge){I({type:"content",contentError:Ge,path:X})}},[U,se,ie,ee,X]),Se=(0,p.useRef)({content:void 0,reload:()=>{}});return Se.current={content:w.content,reload:xe},(0,m.default)(async()=>{I({type:"sync",state:"CHECKING"});const Ge=setTimeout(()=>{I({type:"sync",state:"BUILDING"})},1e3);try{switch(await U.syncEntityDocs({kind:se,namespace:ie,name:ee},Dt=>{I({type:"buildLog",log:Dt})})){case"updated":Se.current.content?I({type:"sync",state:"BUILD_READY"}):(Se.current.reload(),I({type:"sync",state:"BUILD_READY_RELOAD"}));break;case"cached":I({type:"sync",state:"UP_TO_DATE"});break;default:I({type:"sync",state:"ERROR",syncError:new Error("Unexpected return state")});break}}catch(xt){I({type:"sync",state:"ERROR",syncError:xt})}finally{clearTimeout(Ge)}},[se,ee,ie,U,I,Se]),{state:(0,p.useMemo)(()=>F({activeSyncState:w.activeSyncState,contentLoading:w.contentLoading,content:w.content}),[w.activeSyncState,w.content,w.contentLoading]),contentReload:xe,path:w.path,content:w.content,contentErrorMessage:(K=w.contentError)===null||K===void 0?void 0:K.toString(),syncErrorMessage:(R=w.syncError)===null||R===void 0?void 0:R.toString(),buildLog:w.buildLog}}const z=(0,p.createContext)({}),de=()=>(0,p.useContext)(z),D=se=>{const{children:ie}=se,{"*":ee=""}=(0,W.UO)(),{entityRef:X}=(0,f.x1)(),{kind:K,namespace:R,name:w}=X,I=ce(K,R,w,ee);return(0,r.jsx)(z.Provider,{value:I,children:ie instanceof Function?ie(I):ie})},A=se=>ie=>(0,r.jsx)(D,{children:(0,r.jsx)(se,{...ie})})},95573:function(It,Pe,n){"use strict";n.d(Pe,{Fw:function(){return W},_Z:function(){return p},pd:function(){return f}});var r=n(60871);const p=(0,r.NT)({id:"techdocs:index-page"}),W=(0,r.NT)({id:"techdocs:reader-page",params:["namespace","kind","name"]}),f=(0,r.NT)({id:"techdocs:catalog-reader-view"})},55511:function(It,Pe,n){"use strict";n.r(Pe),n.d(Pe,{TechDocsSearchResultListItem:function(){return ce}});var r=n(52322),p=n(2784),W=n(79692),f=n(49378),V=n(86136),m=n(90436),h=n(53974),F=n(15096);const ve=(0,W.Z)({flexContainer:{flexWrap:"wrap"},itemText:{width:"100%",marginBottom:"1rem"}}),ce=z=>{const{result:de,highlight:D,lineClamp:A=5,asListItem:se=!0,asLink:ie=!0,title:ee,icon:X}=z,K=ve(),R=({children:U})=>ie?(0,r.jsx)(h.rU,{noTrack:!0,to:de.location,children:U}):(0,r.jsx)(r.Fragment,{children:U}),w=()=>{var U,xe,Se,k;const Ge=!((U=D)===null||U===void 0)&&U.fields.title?(0,r.jsx)(F.FA,{text:D.fields.title,preTag:D.preTag,postTag:D.postTag}):de.title,xt=!((xe=D)===null||xe===void 0)&&xe.fields.entityTitle?(0,r.jsx)(F.FA,{text:D.fields.entityTitle,preTag:D.preTag,postTag:D.postTag}):de.entityTitle,Dt=!((Se=D)===null||Se===void 0)&&Se.fields.name?(0,r.jsx)(F.FA,{text:D.fields.name,preTag:D.preTag,postTag:D.postTag}):de.name;return de?(0,r.jsx)(f.Z,{className:K.itemText,primaryTypographyProps:{variant:"h6"},primary:(0,r.jsx)(R,{children:ee||(0,r.jsxs)(r.Fragment,{children:[Ge," | ",xt!=null?xt:Dt," docs"]})}),secondary:(0,r.jsx)(m.Z,{component:"span",style:{display:"-webkit-box",WebkitBoxOrient:"vertical",WebkitLineClamp:A,overflow:"hidden"},color:"textSecondary",variant:"body2",children:!((k=D)===null||k===void 0)&&k.fields.text?(0,r.jsx)(F.FA,{text:D.fields.text,preTag:D.preTag,postTag:D.postTag}):de.text})}):null},I=({children:U})=>se?(0,r.jsxs)(r.Fragment,{children:[X&&(0,r.jsx)(V.Z,{children:typeof X=="function"?X(de):X}),(0,r.jsx)("div",{className:K.flexContainer,children:U})]}):(0,r.jsx)(r.Fragment,{children:U});return(0,r.jsx)(I,{children:(0,r.jsx)(w,{})})}},22478:function(It,Pe,n){"use strict";n.d(Pe,{S:function(){return F}});var r=n(52322),p=n(15096),W=n(2784),f=n(73557),V=n(55511);const m=ve=>{var ce;return(ce=ve)===null||ce===void 0?void 0:ce.document},h=ve=>{const{entityId:ce,entityTitle:z,debounceTime:de=150}=ve,[D,A]=(0,W.useState)(!1),se=(0,f.s0)(),{setFilters:ie,result:{loading:ee,value:X}}=(0,p.Rx)(),[K,R]=(0,W.useState)([]);(0,W.useEffect)(()=>{let Se=!0;if(Se&&X){const k=X.results.slice(0,10);R(k)}return()=>{Se=!1}},[ee,X]);const{kind:w,name:I,namespace:U}=ce;(0,W.useEffect)(()=>{ie(Se=>({...Se,kind:w,namespace:U,name:I}))},[w,U,I,ie]);const xe=(Se,k)=>{if(m(k)){const{location:Ge}=k.document;se(Ge)}};return(0,r.jsx)(p.qO,{"data-testid":"techdocs-search-bar",size:"small",open:D,getOptionLabel:()=>"",filterOptions:Se=>Se,onClose:()=>{A(!1)},onFocus:()=>{A(!0)},onChange:xe,blurOnSelect:!0,noOptionsText:"No results found",value:null,options:K,renderOption:({document:Se,highlight:k})=>(0,r.jsx)(V.TechDocsSearchResultListItem,{result:Se,lineClamp:3,asListItem:!1,asLink:!1,title:Se.title,highlight:k}),loading:ee,inputDebounceTime:de,inputPlaceholder:`Search ${z||ce.name} docs`,freeSolo:!1})},F=ve=>{const ce={term:"",types:["techdocs"],pageCursor:"",filters:ve.entityId};return(0,r.jsx)(p.Nd,{initialState:ce,children:(0,r.jsx)(h,{...ve})})}},53260:function(){}},function(It){var Pe=function(r){return It(It.s=r)};It.O(0,[2370,6202,9284,9035,2126,7012,2194,1410,427,242,5109,6816,5218,4736],function(){return Pe(48514)});var n=It.O()}]);})();
|
|
521
521
|
|
|
522
|
-
//# sourceMappingURL=main.
|
|
522
|
+
//# sourceMappingURL=main.fef15b74.js.map
|