@techdocs/cli 1.4.6 → 1.4.7
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 +11 -0
- package/dist/embedded-app/index.html +1 -1
- package/dist/embedded-app/static/{main.b4097720.js → main.4b61d1bd.js} +2 -2
- package/dist/embedded-app/static/main.4b61d1bd.js.map +1 -0
- package/dist/embedded-app/static/{runtime.b4097720.js → runtime.4b61d1bd.js} +1 -1
- package/dist/embedded-app/static/{runtime.b4097720.js.map → runtime.4b61d1bd.js.map} +1 -1
- package/dist/embedded-app/static/{vendor.b4097720.js → vendor.4b61d1bd.js} +1 -1
- package/dist/embedded-app/static/{vendor.b4097720.js.map → vendor.4b61d1bd.js.map} +1 -1
- package/dist/index.cjs.js +1 -1
- package/package.json +4 -4
- package/dist/embedded-app/static/main.b4097720.js.map +0 -1
|
@@ -29,7 +29,7 @@ spec:
|
|
|
29
29
|
hsla(0, 0%, ${s}, 0.049) 84.5%,
|
|
30
30
|
hsla(0, 0%, ${s}, 0.013) 91.9%,
|
|
31
31
|
hsla(0, 0%, ${s}, 0) 100%
|
|
32
|
-
`},zr=100,jr=10,Nr=(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:zr,height:`calc(100% + ${jr}px)`,transition:"opacity 300ms",pointerEvents:"none"},fadeLeft:{left:-jr,background:`linear-gradient(90deg, ${Yn(e.palette.type)})`},fadeRight:{right:-jr,background:`linear-gradient(270deg, ${Yn(e.palette.type)})`},fadeHidden:{opacity:0},button:{position:"absolute"},buttonLeft:{left:-e.spacing(2)},buttonRight:{right:-e.spacing(2)}}),{name:"BackstageHorizontalScrollGrid"});function C(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 c(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 q=$-x,Q=Math.abs(u)*q/s,ge=Math.max(l,Q)*Math.sign(u);e.current.scrollBy({left:ge});const Ue=u-ge;Math.sign(u)!==Math.sign(Ue)?g(0):g(Ue)});return()=>cancelAnimationFrame(T)},[e,u,s,l]),g}function b(e){const{scrollStep:s=100,scrollSpeed:l=50,minScrollDistance:u=5,children:g,...x}=e,T=Nr(e),$=React.useRef(),[q,Q]=C($),fe=c($,l,u),ge=Ue=>{$.current&&fe(Ue?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]:q===0})}),_jsx(Box,{className:classNames(T.fade,T.fadeRight,{[T.fadeHidden]:Q===0})}),q>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 A=(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 J(e){const s=A(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 ve=(0,f.lazy)(()=>Promise.all([n.e(1049),n.e(6051)]).then(n.bind(n,76051)).then(e=>({default:e.RealLogViewer})));function je(e){const{Progress:s}=(0,p.qD)().getComponents();return(0,r.jsx)(f.Suspense,{fallback:(0,r.jsx)(s,{}),children:(0,r.jsx)(ve,{...e})})}var ke=n(28865),nt=n(60251);const _t=(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"}),an=(e,s)=>s?typeof s=="string"?e+s:f.Children.toArray(s.props.children).reduce(an,e):e,En=({level:e,children:s})=>{const g=f.Children.toArray(s).reduce(an,"").toLocaleLowerCase("en-US").replace(/\W/g,"-");return f.createElement(`h${e}`,{id:g},s)},gn={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:En,h2:En,h3:En,h4:En,h5:En,h6:En};function Wr(e){const{content:s,dialect:l="gfm",linkTarget:u,transformLinkUri:g,transformImageUri:x,className:T}=e,$=_t();return(0,r.jsx)(ke.D,{remarkPlugins:l==="gfm"?[nt.Z]:[],className:`${$.markdown} ${T}`,children:s,components:gn,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(q){x(isError(q)?q.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,q=useObservable(useMemo(()=>g.authRequest$(),[g]),[]),Q=()=>{q.forEach(fe=>fe.reject())};return _jsxs(Dialog,{open:Boolean(q.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:q.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 cr=(0,m.Z)({container:{overflow:"visible !important"}},{name:"BackstageOverflowTooltip"});function Hr(e){const[s,l]=(0,f.useState)(!1),u=(0,Er.t)(),g=cr(),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)(E.Z,{display:"none"})}var jo=n(94339),Fr=n(14503),Ko=n(24579),Eo=n(32552),Fn=n(15459),dr=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)(E.Z,{children:[(0,r.jsx)(Be.Z,{}),(0,r.jsx)(le.r,{to:s,onClick:u,underline:"none",children:(0,r.jsxs)(E.Z,{display:"flex",alignItems:"center",className:g.root,children:[(0,r.jsx)(E.Z,{className:g.boxTitle,fontWeight:"fontWeightBold",m:1,children:(0,r.jsx)(Je.Z,{children:(0,r.jsx)("strong",{children:l})})}),(0,r.jsx)(dr.Z,{className:g.arrow})]})})]})}const Yo=e=>{const{slackChannel:s}=e;if(s){if(typeof s=="string")return(0,r.jsxs)(Je.Z,{children:["Please contact ",s," for help."]});if(!s.href)return(0,r.jsxs)(Je.Z,{children:["Please contact ",s.name," for help."]})}else return null;return(0,r.jsx)(de,{to:s.href,variant:"contained",children:s.name})},gr=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)(dt,{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,Fn.Z)(e=>({root:{display:"inline-block",padding:e.spacing(8,8,0,0),float:"right"}}),{name:"BackstageInfoCardCardActionsTopRight"})(Fr.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 Zr(e){const{title:s,subheader:l,divider:u=!0,deepLink:g,slackChannel:x,errorBoundaryProps:T,variant:$,children:q,headerStyle:Q,headerProps:fe,icon:ge,action:Ue,actionsClassName:Pe,actions:Ve,cardClassName:pt,actionsTopRight:at,className:Wt,noPadding:$n,titleTypographyProps:Vn}=e,kt=Ao();let en={},vn={};$&&$.split(/[\s]+/g).forEach(br=>{en={...en,...Ro.card[br]},vn={...vn,...Ro.cardContent[br]}});const Un=()=>!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]}),Mn=T||(x?{slackChannel:x}:{});return(0,r.jsx)(jo.Z,{style:en,className:Wt,children:(0,r.jsxs)(gr,{...Mn,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:Un(),action:Ue,style:{...Q},titleTypographyProps:Vn,...fe}),at&&(0,r.jsx)(To,{children:at}),u&&(0,r.jsx)(Be.Z,{}),(0,r.jsx)(Ko.Z,{className:on()(pt,{[kt.noPadding]:$n}),style:vn,children:q}),Ve&&(0,r.jsx)(Fr.Z,{className:Pe,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:q,unit:Q,max:fe,description:ge}={...co,...e},Ue=$?Math.round(T*fe):T,Pe=fe!==100?Math.round(T):Ue,[Ve,pt]=useState(!1);return useEffect(()=>{const at=s,Wt=()=>pt(!0),$n=()=>pt(!1);return at&&ge?(at.addEventListener("mouseenter",Wt),at.addEventListener("mouseleave",$n),()=>{at.removeEventListener("mouseenter",Wt),at.removeEventListener("mouseleave",$n)}):()=>{pt(!1)}},[ge,s]),_jsxs(Box,{ref:l,className:g.root,children:[_jsx(Circle,{strokeLinecap:"butt",percent:Ue,strokeWidth:12,trailWidth:12,strokeColor:u({palette:x,value:Pe,inverse:q,max:fe}),className:g.circle}),ge&&Ve?_jsx(Box,{className:g.description,children:ge}):_jsx(Box,{className:g.overlay,children:isNaN(T)?"N/A":`${Pe}${Q}`})]})}const Lo=(0,m.Z)({root:{height:"100%",width:250}},{name:"BackstageGaugeCard"});function ur(e){const s=Lo(e),{title:l,subheader:u,progress:g,inverse:x,deepLink:T,description:$,icon:q,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:q,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),qn=n(12420),ho=n(72379);const Xo=(0,m.Z)(e=>(0,qn.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,qn.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,Fn.Z)(e=>(0,qn.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,qn.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:q=!1,disabled:Q=!1,margin:fe}=e,ge=po(),[Ue,Pe]=(0,f.useState)(x||(s?[]:"")),[Ve,pt]=(0,f.useState)(!1);(0,f.useEffect)(()=>{Pe(s?[]:"")},[$,s]),(0,f.useEffect)(()=>{Pe(x||(s?[]:""))},[x,s]);const at=kt=>{Pe(kt.target.value),T(kt.target.value)},Wt=kt=>{if(Q){kt.preventDefault();return}pt(en=>s&&!(kt.target instanceof HTMLElement)?!0:!en)},$n=()=>{pt(!1)},Vn=kt=>()=>{const en=Ue.filter(vn=>vn!==kt);Pe(en),T(en)};return(0,r.jsx)(E.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:Ue,native:q,disabled:Q,"data-testid":"select",displayEmpty:!0,multiple:s,margin:fe,onChange:at,open:Ve,onOpen:Wt,onClose:$n,input:(0,r.jsx)(es,{}),label:u,renderValue:kt=>{var en;return s&&Ue.length!==0?(0,r.jsx)(E.Z,{className:ge.chips,children:kt.map(vn=>{var Un,Mn;return(0,r.jsx)(js.Z,{label:(Un=l.find(ir=>ir.value===vn))===null||Un===void 0?void 0:Un.label,clickable:!0,onDelete:Vn(vn),className:ge.chip},(Mn=l.find(ir=>ir.value===vn))===null||Mn===void 0?void 0:Mn.value)})}):(0,r.jsx)(Je.Z,{children:Ue.length===0?g||"":(en=l.find(vn=>vn.value===kt))===null||en===void 0?void 0:en.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}),q?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:Ue.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),[$,q]=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:q,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"}),dn=({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:q}=useContext(VerticalStepperContext),Q=(Pe,Ve)=>{Ve&&Ve(),q&&q(g,Pe),x(Pe)},fe=()=>{const Pe=e.nextStep?e.nextStep(g,u-1):g+1;Q(Pe,e.onNext),$([...T,Pe])},ge=()=>{T.pop(),Q(T[T.length-1],e.onBack),$([...T])},Ue=()=>{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(dn,{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:Ue,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 _(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 ue(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 Ee(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 Re(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 Fe=n(74600),We=n(15584);const it=e=>(0,qn.Z)({root:{fontWeight:e.typography.fontWeightBold,whiteSpace:"nowrap",paddingRight:e.spacing(4),border:"0",verticalAlign:"top"}}),Et={root:{border:"0",verticalAlign:"top"}},De=e=>(0,qn.Z)({root:{margin:e.spacing(0,0,-1,0)}}),He=e=>(0,qn.Z)({root:{padding:e.spacing(0,0,1,0)},random:{}}),Tt=(0,Fn.Z)(it,{name:"BackstageMetadataTableTitleCell"})(We.Z),tn=(0,Fn.Z)(Et,{name:"BackstageMetadataTableCell"})(We.Z),An=({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(Tt,{children:e}),_jsx(tn,{colSpan:e?1:2,...l,children:s})]}),Pt=(0,Fn.Z)(De,{name:"BackstageMetadataTableList"})(({classes:e,children:s})=>(0,r.jsx)(It.Z,{disablePadding:!0,className:e.root,children:s})),Kt=(0,Fn.Z)(He,{name:"BackstageMetadataTableListItem"})(({classes:e,children:s})=>(0,r.jsx)(Bt.Z,{className:e.root,children:s})),Tn=(0,qn.Z)({root:{margin:"0 0",listStyleType:"none"}}),hr=e=>(0,qn.Z)({root:{...Tn.root,paddingLeft:e.spacing(1)}}),Tr=(0,Fn.Z)(Tn,{name:"BackstageStructuredMetadataTableList"})(({classes:e,children:s})=>(0,r.jsx)(Pt,{classes:e,children:s})),Yr=(0,Fn.Z)(hr,{name:"BackstageStructuredMetadataTableNestedList"})(({classes:e,children:s})=>(0,r.jsx)(Pt,{classes:e,children:s}));function zn(e,s){const l=e.map((u,g)=>_jsx(MetadataListItem,{children:Bn(u)},g));return s?_jsx(Yr,{children:l}):_jsx(Tr,{children:l})}function mn(e,s,l){const u=Object.keys(e).map(g=>{const x=Bn(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 Bn(e,s,l){return React.isValidElement(e)?_jsx(Fragment,{children:e}):typeof e=="object"&&!Array.isArray(e)?mn(e,s,l):Array.isArray(e)?zn(e,l):typeof e=="boolean"?_jsx(Fragment,{children:e?"\u2705":"\u274C"}):_jsx(Typography,{variant:"body2",component:"span",children:e})}const mr=({value:e,options:s})=>_jsx(Fragment,{children:Bn(e,s)}),ui=({title:e,value:s,options:l})=>_jsx(MetadataTableItem,{title:l&&l.titleFormat?l.titleFormat(e):startCase(e),children:_jsx(mr,{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(q=>isEqual($,q)?q:$)},[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)(le.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)(nn.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),[$,q]=(0,f.useState)(null),Q=Bs(),fe=(0,Se.Z)(Pe=>Pe.breakpoints.down("sm")),ge=Pe=>{q(Pe.currentTarget),T(!0)},Ue=()=>{T(!1)};return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(E.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)(ye.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:Ue,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)(Je.Z,{variant:"subtitle1",children:s})}),f.Children.map(u,(Pe,Ve)=>(0,r.jsx)(no.Z,{alignItems:"flex-start",children:Pe},`child-${Ve}`)),(l!=null?l:g).map((Pe,Ve)=>(0,r.jsx)(xi,{item:Pe},`item-${Ve}`))]}),(0,r.jsx)(pi.Z,{children:(0,r.jsx)(ye.Z,{color:"primary",onClick:Ue,"aria-label":"Close",children:"Close"})})]})]})}var os=n(18671),er=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 Wn(e){const{tabs:s,onChange:l,selectedIndex:u}=e,[g,x]=(0,f.useState)(u!=null?u:0),T=Ci(),$=(0,f.useCallback)((q,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)(E.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,Q)=>(0,f.createElement)(La.Z,{...q.tabProps,"data-testid":`header-tab-${Q}`,label:q.label,key:q.id,value:Q,className:T.defaultTab,classes:{selected:T.selected,root:T.tabRoot}}))})})}function Oa(e){const s=(0,er.UO)(),u=e.map(({path:Ue,children:Pe})=>({caseSensitive:!1,path:`${Ue}/*`,element:Pe})).sort((Ue,Pe)=>Pe.path.replace(/\/\*$/,"").localeCompare(Ue.path.replace(/\/\*$/,"")));var g;const x=(g=(0,er.V$)(u))!==null&&g!==void 0?g:e[0].children;var T;let $=(T=s["*"])!==null&&T!==void 0?T:"";$.startsWith("/")||($=`/${$}`);var q;const[Q]=(q=(0,Bo.fp)(u,$))!==null&&q!==void 0?q:[],fe=Q?e.findIndex(Ue=>`${Ue.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,er.s0)(),{index:u,route:g,element:x}=Oa(s),T=(0,f.useMemo)(()=>s.map(q=>({id:q.path,label:q.title,tabProps:q.tabProps})),[s]),$=q=>{let{path:Q}=s[q];Q=Q.replace(/\/\*$/,""),Q=Q.replace(/^\//,""),l(Q)};return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(Wn,{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)(E.Z,{className:u.value,children:s}),(0,r.jsx)(E.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),q=()=>{x({}),$(Q=>!Q)};return(0,f.useEffect)(()=>{u(g)},[g,u]),(0,r.jsxs)(E.Z,{className:l.root,children:[(0,r.jsxs)(E.Z,{className:l.header,children:[(0,r.jsx)(E.Z,{className:l.value,children:"Filters"}),(0,r.jsx)(ye.Z,{color:"primary",onClick:q,children:"Clear all"})]}),(0,r.jsx)(E.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,Fn.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,Fn.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,Q)=>({...T($,q,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)(q=>{e.onSearchChanged(q),l(q)},[e,l]);return u?(0,r.jsxs)(E.Z,{className:T.root,children:[(0,r.jsxs)(E.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)(Je.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:q,initialState:Q,emptyContent:fe,onStateChange:ge,components:Ue,...Pe}=e,Ve=Bi(),pt=(0,se.Z)(),at={...Ms,...Q},[Wt,$n]=(0,f.useState)(at.filtersOpen),Vn=(0,f.useCallback)(()=>$n(Qn=>!Qn),[$n]),[kt,en]=(0,f.useState)(0),[vn,Un]=(0,f.useState)(u),[Mn,ir]=(0,f.useState)(at.filters),br=Da(g,pt),[Qr,kr]=(0,f.useState)(at.search);(0,f.useEffect)(()=>{if(ge){const Qn=$i({search:Qr,filtersOpen:Wt,filters:Mn},Ms);ge(Qn)}},[Qr,Wt,Mn,ge]);const bs={headerStyle:{textTransform:"uppercase"}},un=(0,f.useCallback)(Qn=>{var Mr;return(Mr=g.find(Br=>Br.title===Qn))===null||Mr===void 0?void 0:Mr.field},[g]);(0,f.useEffect)(()=>{if(typeof u=="function")return;if(!Mn){Un(u);return}const Qn=Object.values(Mn);if(u&&Qn.flat().length){const Mr=u.filter(Br=>!!Object.entries(Mn).filter(([,Sr])=>!!Sr.length).every(([Sr,Hn])=>{const ar=ds(Br,un(Sr));return Array.isArray(ar)&&Array.isArray(Hn)?ar.some(Wo=>Hn.includes(Wo)):Array.isArray(ar)?ar.includes(Hn):Array.isArray(Hn)?Hn.includes(ar):ar===Hn}));Un(Mr)}else Un(u);en(Qn.flat().length)},[u,Mn,un]);const zo=(Qn,Mr)=>{const Br=Hn=>{const ar=new Set,Wo=ao=>{ao!=null&&ar.add(ao)};return Mr&&Mr.forEach(ao=>{const Xr=ds(ao,un(Hn));Array.isArray(Xr)?Xr.forEach(Wo):Wo(Xr)}),ar},Sr=Hn=>({placeholder:"All results",label:Hn.column,multiple:Hn.type==="multiple-select",items:[...Br(Hn.column)].sort().map(ar=>({label:ar,value:ar}))});return Qn.map(Hn=>({type:Hn.type,element:Sr(Hn)}))},si=!!(!((s=q)===null||s===void 0)&&s.length),So=(0,f.useCallback)(Qn=>(0,r.jsx)(Di,{setSearch:kr,hasFilters:si,selectedFiltersLength:kt,toggleFilters:Vn,...Qn}),[Vn,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)(E.Z,{className:Ve.root,children:[Wt&&u&&typeof u!="function"&&((l=q)===null||l===void 0?void 0:l.length)&&(0,r.jsx)(Li,{filters:zo(q,u),selectedFilters:Mn,onChangeFilters:ir}),(0,r.jsx)($o.ZP,{components:{Header:Oi,Toolbar:So,Body:ya,...Ue},options:{...bs,...x},columns:br,icons:Zs,title:(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(Je.Z,{variant:"h5",component:"h2",children:T}),$&&(0,r.jsx)(Je.Z,{color:"textSecondary",variant:"body1",children:$})]}),data:typeof u=="function"?u:vn,style:{width:"100%"},localization:{toolbar:{searchPlaceholder:"Filter",searchTooltip:"Filter"}},...Pe})]})}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)(Je.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)(E.Z,{className:T.container,children:[(0,r.jsxs)(E.Z,{className:T.leftItemsBox,children:[$,s&&(0,r.jsx)(Je.Z,{className:T.description,variant:"body2",children:s})]}),(0,r.jsx)(E.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,"auto",4)}}}),{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,er.s0)(),$=vi();return(0,r.jsxs)(Vt.Z,{container:!0,spacing:0,className:x.container,children:[(0,r.jsxs)(Vt.Z,{item:!0,xs:12,sm:8,md:4,children:[(0,r.jsxs)(Je.Z,{"data-testid":"error",variant:"body1",className:x.subtitle,children:["ERROR ",s,": ",l]}),(0,r.jsx)(Je.Z,{variant:"body1",className:x.subtitle,children:u}),(0,r.jsx)(Je.Z,{variant:"h2",className:x.title,children:"Looks like someone dropped the mic!"}),(0,r.jsxs)(Je.Z,{variant:"h6",children:[(0,r.jsx)(le.r,{to:"#","data-testid":"go-back-link",onClick:()=>T(-1),children:"Go back"}),"... or please"," ",(0,r.jsx)(le.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,Fn.Z)({root:{textDecoration:"underline",cursor:"pointer"}},{name:"BackstageBreadcrumbsClickableText"})(Je.Z),hs=(0,Fn.Z)({root:{textDecoration:"underline",color:"inherit"}},{name:"BackstageBreadcrumbsStyledBox"})(E.Z);function Mi(e){const{children:s,...l}=e,[u,g]=f.useState(null),x=f.Children.toArray(s),[T,$,...q]=x,Q=q.length?q.pop():x[x.length-1],fe=x.length>3,ge=Ve=>{g(Ve.currentTarget)},Ue=()=>{g(null)},Pe=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)(E.Z,{style:{fontStyle:"italic"},children:Q})]}),(0,r.jsx)(go.ZP,{open:Pe,anchorEl:u,onClose:Ue,anchorOrigin:{vertical:"bottom",horizontal:"left"},transformOrigin:{vertical:"top",horizontal:"left"},children:(0,r.jsx)(It.Z,{children:q.map((Ve,pt)=>(0,r.jsx)(Bt.Z,{button:!0,children:(0,r.jsx)(hs,{clone:!0,children:Ve})},pt))})})]})}const xo=72,zi=24,Wi=18,vr={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=>({...vr,...e,iconContainerWidth:vr.drawerWidthClosed,iconSize:vr.drawerWidthClosed-vr.iconPadding*2,userBadgeDiameter:vr.drawerWidthClosed-vr.userBadgePadding*2}),Hs={drawerWidthClosed:0,drawerWidthOpen:202,defaultOpenDelayMs:vr.defaultOpenDelayMs+200},Vi=e=>({...Hs,...e}),ps="@backstage/core/sidebar-intro-dismissed",Rr=(0,f.createContext)({sidebarConfig:vr,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,er.TH)(),{selectedMenuItemIndex:q,setSelectedMenuItemIndex:Q}=(0,f.useContext)(Xs),fe=(Ue,Pe)=>{Q(Pe===q?-1:Pe)},ge=g===q&&q>=0||g!==q&&!(q>=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)(E.Z,{className:x.overlayHeader,children:[(0,r.jsx)(Je.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)(E.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,er.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 q=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:q,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),q=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)(E.Z,{className:q.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 tr;(function(e){e[e.Closed=0]="Closed",e[e.Idle=1]="Idle",e[e.Open=2]="Open"})(tr||(tr={}));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)(Wt=>Wt.breakpoints.down("md"),{noSsr:!0}),[q,Q]=(0,f.useState)(tr.Closed),fe=(0,f.useRef)(),{isPinned:ge,toggleSidebarPinState:Ue}=gs(),Pe=()=>{ge||g||(fe.current&&(clearTimeout(fe.current),fe.current=void 0),q!==tr.Open&&!$&&(fe.current=window.setTimeout(()=>{fe.current=void 0,Q(tr.Open)},l),Q(tr.Idle)))},Ve=()=>{ge||g||(fe.current&&(clearTimeout(fe.current),fe.current=void 0),q===tr.Idle?Q(tr.Closed):q===tr.Open&&(fe.current=window.setTimeout(()=>{fe.current=void 0,Q(tr.Closed)},u)))},pt=q===tr.Open&&!$||ge,at=Wt=>{Wt?(Q(tr.Open),Ue()):(Q(tr.Closed),Ue())};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)(E.Z,{className:T.root,"data-testid":"sidebar-root",onMouseEnter:g?()=>{}:Pe,onFocus:g?()=>{}:Pe,onMouseLeave:g?()=>{}:Ve,onBlur:g?()=>{}:Ve,children:(0,r.jsx)(E.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:q}=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:q,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)(ye.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:q}=useContext(SidebarItemWithSubmenuContext),Q=()=>{q(!1)},fe=useResolvedPath(u!=null?u:""),ge=useLocation();let Ue=isLocationMatch(ge,fe,T);const[Pe,Ve]=useState(!1),pt=()=>{Ve(!Pe)};return x!==void 0?(x.some(at=>{const Wt=resolvePath(at.to);return Ue=isLocationMatch(ge,Wt,T),Ue}),_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,Ue?$.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})]}),Pe?_jsx(ArrowDropUpIcon,{className:$.dropdownArrow}):_jsx(ArrowDropDownIcon,{className:$.dropdownArrow})]})}),x&&Pe&&_jsx(Box,{className:$.dropdown,children:x.map((at,Wt)=>_jsx(Tooltip,{title:at.title,enterDelay:500,enterNextDelay:500,children:_jsx(Link,{to:at.to,underline:"none",className:$.dropdownItem,onClick:Q,onTouchStart:$n=>$n.stopPropagation(),children:_jsx(Typography,{component:"span",className:$.textContent,children:at.title})})},Wt))})]})):_jsx(Box,{className:$.itemContainer,children:_jsx(Tooltip,{title:s,enterDelay:500,enterNextDelay:500,children:_jsxs(Link,{to:u,underline:"none",className:classnames($.item,Ue?$.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),[$,q]=(0,f.useState)(!1);return(0,f.useEffect)(()=>{q(T)},[T]),(0,r.jsxs)(E.Z,{className:on()(x.drawer,{[x.drawerOpen]:$}),children:[(0,r.jsx)(Je.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,S;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:(S=(u=s.palette.navigation.navItem)===null||u===void 0?void 0:u.hoverBackground)!==null&&S!==void 0?S:"#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":q="page",...Q},fe){let{pathname:ge}=(0,er.TH)(),{pathname:Ue}=(0,er.WU)(s);T||(ge=ge.toLocaleLowerCase("en-US"),Ue=Ue.toLocaleLowerCase("en-US"));let Pe=ge===Ue;!Pe&&!l&&(Pe=ge.startsWith(`${Ue}/`));const Ve=Pe?q:void 0;return(0,r.jsx)(k.rU,{...Q,to:s,ref:fe,"aria-current":Ve,style:{...u,...Pe?x:void 0},className:on()([g,Pe?$:void 0])})}),Ze=(0,f.forwardRef)((e,s)=>{const{icon:l,text:u,hasNotifications:g=!1,hasSubmenu:x=!1,disableHighlight:T=!1,onClick:$,noTrack:q,children:Q,className:fe,...ge}=e,{sidebarConfig:Ue}=(0,f.useContext)(Rr),Pe=Z(Ue),{isOpen:Ve}=Ks(),pt=!Ve&&x?{display:"flex",marginLeft:"20px"}:{lineHeight:"0"},at=(0,r.jsxs)(E.Z,{style:pt,children:[(0,r.jsx)(l,{fontSize:"small"}),!Ve&&x?(0,r.jsx)(oi.Z,{fontSize:"small"}):(0,r.jsx)(r.Fragment,{})]}),Wt=(0,r.jsx)(ri.Z,{color:"secondary",variant:"dot",overlap:"circular",invisible:!g,className:on()({[Pe.closedItemIcon]:!Ve}),children:at}),$n=(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(E.Z,{"data-testid":"login-button",className:Pe.iconContainer,children:Wt}),u&&(0,r.jsx)(Je.Z,{variant:"subtitle2",component:"span",className:Pe.label,children:u}),(0,r.jsx)("div",{className:Pe.secondaryAction,children:Q})]}),Vn=Ve?$n:Wt,kt={onClick:$,className:on()(fe,Pe.root,Ve?Pe.open:Pe.closed,me(e)&&Pe.buttonItem,{[Pe.highlightable]:!T})},en=(0,p.z$)(),{pathname:vn}=(0,er.WU)(!me(e)&&e.to?e.to:""),Un=(0,f.useCallback)(Mn=>{var ir;if(!q){const br="click",Qr=u!=null?u:"Sidebar Item",kr=vn?{attributes:{to:vn}}:void 0;en.captureEvent(br,Qr,kr)}(ir=$)===null||ir===void 0||ir(Mn)},[en,u,vn,q,$]);return me(e)?(0,r.jsx)(ye.Z,{role:"button","aria-label":u,...kt,ref:s,onClick:Un,children:Vn}):(0,r.jsx)(Te,{...kt,activeClassName:Pe.selected,to:e.to?e.to:"",ref:s,"aria-label":u||e.to,...ge,onClick:Un,children:Vn})}),Ge=({children:e,...s})=>{const{sidebarConfig:l}=(0,f.useContext)(Rr),u=Z(l),[g,x]=(0,f.useState)(!1),T=(0,er.TH)(),$=oe(e,T),q=(0,Se.Z)(Ue=>Ue.breakpoints.down("sm")),Q=()=>{x(!0)},fe=()=>{x(!1)},ge=()=>q?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)(Ze,{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)(Ge,{...e,children:l}):(0,r.jsx)(Ze,{...e,ref:s})});function qt(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())},q=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:q,onKeyDown:$,className:g.searchContainer,InputProps:{disableUnderline:!0,className:g.searchField},inputProps:{className:g.searchFieldHTMLInput}})})})}const Ht=(0,Uo.Z)("div")({flex:1},{name:"BackstageSidebarSpace"}),nr=(0,Uo.Z)("div")({height:8},{name:"BackstageSidebarSpacer"}),Ur=(0,Uo.Z)("hr")(({theme:e})=>({height:1,width:"100%",background:"#383838",border:"none",margin:e.spacing(1.2,0)}),{name:"BackstageSidebarDivider"}),pr=e=>({overflowY:"auto","&::-webkit-scrollbar":{backgroundColor:e.palette.background.default,width:"5px",borderRadius:"5px"},"&::-webkit-scrollbar-thumb":{backgroundColor:e.palette.text.secondary,borderRadius:"5px"}}),yr=(0,Uo.Z)("div")(({theme:e})=>{const s=pr(e);return{flex:"0 1 auto",overflowX:"hidden",width:"calc(100% - 5px)",minHeight:"48px",overflowY:"hidden","@media (hover: none)":s,"&:hover":s}}),xr=()=>{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,{})})})},Zn=(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=Zn({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,On="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}))},q=()=>{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:On,onDismiss:q})]}):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)(le.r,{to:s,children:e}),(0,r.jsx)(Je.Z,{children:u})]}):(0,r.jsx)(Je.Z,{className:l.type,children:e}):null,io=({pageTitle:e,classes:s,tooltip:l})=>{const{contentRef:u}=oa(),g=(0,r.jsx)(Je.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)(Je.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:q}=e,Q=bo(),ge=(0,p.h_)(p.Ds).getOptionalString("app.title")||"Backstage",Ue=l||x,Pe=x||l,Ve=`${Ue} | %s | ${ge}`,pt=`${Ue} | ${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)(E.Z,{className:Q.leftItemsBox,children:[(0,r.jsx)(pa,{classes:Q,type:$,typeLink:q,pageTitle:Pe}),(0,r.jsx)(io,{classes:Q,pageTitle:Pe,tooltip:T}),(0,r.jsx)(fa,{classes:Q,subtitle:g})]}),(0,r.jsx)(Vt.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,ln.Fq)(e.page.fontColor,.8),fontSize:e.typography.fontSize,lineHeight:1}}),{name:"BackstageHeaderLabel"}),al=({value:e,className:s})=>(0,r.jsx)(Je.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)(Vt.Z,{item:!0,children:(0,r.jsxs)(Je.Z,{component:"span",className:g.root,children:[(0,r.jsx)(Je.Z,{className:g.label,children:s}),u?(0,r.jsx)(le.r,{to:u,children:x}):x]})})}const cl=e=>(0,qn.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)(E.Z,{className:g.root,children:[l&&(0,r.jsx)(Je.Z,{variant:"subtitle2",component:"h3",children:l}),s&&(0,r.jsx)(Je.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:q,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:q,color:"primary",children:$}),Q&&_jsx(LinkButton,{to:Q,color:"primary",children:$})]})]})}const hl=e=>(0,qn.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)(E.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)(Vt.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),q=(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(),q.post(new lo.SP("Login failed",fe))}};return(0,r.jsx)(ga,{children:(0,r.jsx)(Zr,{variant:"fullHeight",title:x,actions:(0,r.jsx)(ye.Z,{color:"primary",variant:"outlined",onClick:Q,children:"Sign In"}),children:(0,r.jsx)(Je.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)(Zr,{title:"Guest",variant:"fullHeight",actions:(0,r.jsx)(ye.Z,{color:"primary",variant:"outlined",onClick:()=>{e(),s(new ma)},children:"Enter"}),children:(0,r.jsxs)(Je.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,q=({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)(Zr,{title:"Custom User",variant:"fullHeight",children:[(0,r.jsxs)(Je.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(q),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)(ye.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(q=>{s(IdentityApiSignOutProxy.from({identityApi:q,signOut:async()=>{var Q,fe;localStorage.removeItem(Mo),await((Q=(fe=q).signOut)===null||Q===void 0?void 0:Q.call(fe))}}))},[s]);useLayoutEffect(()=>{var q;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,(q=fe.config)===null||q===void 0?void 0:q.apiRef).then(Ue=>{if(ge){localStorage.removeItem(Mo);return}Ue?T(Ue):x(!1)}).catch(Ue=>{localStorage.removeItem(Mo),!ge&&(l.post(Ue),x(!1))}),()=>{ge=!0}},[g,l,s,u,e,T]);const $=useMemo(()=>Object.keys(e).map(q=>{const Q=e[q],{Component:fe}=Q.components,ge=Ve=>{T(Ve)},Ue=()=>{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)},Pe=()=>{localStorage.removeItem(Mo)};return _jsx(fe,{config:Q.config,onSignInStarted:Ue,onSignInSuccess:ge,onSignInFailure:Pe},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),[$,q]=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:q})]})]})},Pl=({provider:e,auto:s,onSignInSuccess:l})=>{const u=useStyles(),g=useApi(e.apiRef),x=useApi(configApiRef),[T,$]=useState(),[q,Q]=useState(!1),fe=async({checkExisting:ge,showPopup:Ue})=>{try{let Pe;if(ge&&(Pe=await g.getBackstageIdentity({optional:!0})),!Pe&&(Ue||s)&&(Q(!0),Pe=await g.getBackstageIdentity({instantPopup:!0}),!Pe))throw new Error(`The ${e.title} provider is not configured to support sign-in`);if(!Pe){Q(!0);return}const Ve=await g.getProfile();l(UserIdentity.create({identity:Pe.identity,authApi:g,profile:Ve}))}catch(Pe){$(Pe),Q(!0)}};return useMountEffect(()=>fe({checkExisting:!0})),q?_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,Fn.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,q=Ll(),[Q,fe]=useState(0),ge=$||((Ve,pt)=>fe(pt));let Ue;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;Ue=(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;Ue=(at=Ve)===null||at===void 0?void 0:at.props.children}});const Pe=l||(s?{slackChannel:s}:{});return _jsx(Card,{children:_jsxs(ErrorBoundary,{...Pe,children:[g&&_jsx(Ol,{title:g}),_jsx(Tabs,{selectionFollowsFocus:!0,classes:q,value:T||Q,onChange:ge,children:u}),_jsx(Divider,{}),_jsx(CardContent,{children:Ue}),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(Lt,Le,n){"use strict";n.d(Le,{fC:function(){return m},CL:function(){return Rt},sM:function(){return se},$v:function(){return Se},v_:function(){return k},hg:function(){return Ke},uB:function(){return xe},R5:function(){return et},bq:function(){return I},Km:function(){return U},Ds:function(){return yt},ni:function(){return E},T0:function(){return D},CO:function(){return sn},x8:function(){return fn},rx:function(){return Ln},YO:function(){return Nn},P4:function(){return Rn},NT:function(){return Ct},NW:function(){return $t},VE:function(){return zt},W0:function(){return Dt},gP:function(){return Yt},IY:function(){return vt},F4:function(){return ne},ux:function(){return K},Kp:function(){return ie},$4:function(){return ct},p_:function(){return R},ZM:function(){return ut},D:function(){return X},gW:function(){return w},E6:function(){return St},z$:function(){return Ne},h_:function(){return ye},I_:function(){return F},qD:function(){return Ye},vJ:function(){return Gn},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 be=(0,W.useContext)(f);if(be===void 0)return{routeRef:"unknown",pluginId:"root",extension:"App"};const pe=be.atVersion(1);if(pe===void 0)throw new Error("No context found for version 1.");return pe},m=be=>{const{attributes:pe,children:Ie}=be,N={...V(),...pe},ce=(0,p.EI)({1:N});return(0,r.jsx)(f.Provider,{value:ce,children:Ie})};function h(be,pe){const Ie=H=>_jsx(m,{attributes:pe,children:_jsx(be,{...H})});return Ie.displayName=`WithAnalyticsContext(${be.displayName||be.name||"Component"})`,Ie}function F(){const be=(0,p.Vt)("api-context");if(!be)throw new Error("API context is not available");const pe=be.atVersion(1);if(!pe)throw new Error("ApiContext v1 not available");return pe}function ye(be){const Ie=F().get(be);if(!Ie)throw new Error(`No implementation available for ${be}`);return Ie}function le(be){return function(Ie){const H=ce=>{const Ae=F(),$e={};for(const qe in be)if(be.hasOwnProperty(qe)){const It=be[qe],Bt=Ae.get(It);if(!Bt)throw new Error(`No implementation available for ${It}`);$e[qe]=Bt}return _jsx(Ie,{...ce,...$e})},N=Ie.displayName||Ie.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(be){return new de(be)}function E(be,pe){return"id"in be?{api:be,deps:{},factory:()=>pe}:be}var se;(function(be){be.SignedIn="SignedIn",be.SignedOut="SignedOut"})(se||(se={}));const ie=D({id:"core.auth.google"}),ne=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"}),Ke=D({id:"core.apptheme"}),yt=D({id:"core.config"}),$t=D({id:"core.discovery"}),zt=D({id:"core.error"});var Rt;(function(be){be[be.None=0]="None",be[be.Active=1]="Active"})(Rt||(Rt={}));const Dt=D({id:"core.featureflags"}),Yt=D({id:"core.fetch"}),ct=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 Gt{setContext(pe){this.context=pe}captureEvent(pe,Ie,{value:H,attributes:N}={}){const{_routeNodeType:ce,...Ae}=this.context;if(pe===Zt){lt.mostRecentGatheredNavigation&&(lt.mostRecentRoutableExtensionRender={context:{...Ae,extension:"App"}});return}if(lt.mostRecentGatheredNavigation){try{this.analyticsApi.captureEvent({...lt.mostRecentGatheredNavigation,...lt.mostRecentRoutableExtensionRender})}catch($e){console.warn("Error during analytics event capture. %o",$e)}lt.mostRecentGatheredNavigation=void 0,lt.mostRecentRoutableExtensionRender=void 0}if(pe==="navigate"&&ce==="gathered"&&Ae.pluginId==="root"){lt.mostRecentGatheredNavigation={action:pe,subject:Ie,value:H,attributes:N,context:Ae};return}try{this.analyticsApi.captureEvent({action:pe,subject:Ie,value:H,attributes:N,context:Ae})}catch($e){console.warn("Error during analytics event capture. %o",$e)}}constructor(pe,Ie={routeRef:"unknown",pluginId:"root",extension:"App"}){(0,z._)(this,"analyticsApi",void 0),(0,z._)(this,"context",void 0),this.analyticsApi=pe,this.context=Ie,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 ye(k)}catch{return{captureEvent:()=>{}}}}function Ne(){const be=(0,W.useRef)(null),pe=V(),Ie=Ce();function H(){return be.current===null&&(be.current=new Gt(Ie)),be.current}const N=H();return N.setContext(pe),N}const Ye=()=>{const be=(0,p.Vt)("app-context");if(!be)throw new Error("App context is not available");const pe=be.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 et(be,pe,Ie){const H=be;var N;let ce=(N=H[rt])!==null&&N!==void 0?N:ht.get(be);if(ce||(ce={map:new Map},Object.defineProperty(H,rt,{enumerable:!1,configurable:!0,writable:!1,value:ce}),ht.set(be,ce)),ce.map.has(pe)){const Ae=be.displayName||be.name;throw new Error(`Attempted to attach duplicate data "${pe}" to component "${Ae}"`)}ce.map.set(pe,Ie)}function vt(be,pe){if(!be)return;const Ie=be.type;if(!Ie)return;var H;const N=(H=Ie[rt])!==null&&H!==void 0?H:ht.get(Ie);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,Ie){(0,z._)(this,"id",void 0),(0,z._)(this,"params",void 0),(0,z._)(this,ft,void 0),this.id=pe,this.params=Ie,this[Qe]="absolute"}}function Ct(be){var pe;return new gt(be.id,(pe=be.params)!==null&&pe!==void 0?pe:[])}const yn=/^\w+$/;let hn=null,cn=null;class Sn{toString(){return`routeRef{type=sub,id=${this.id}}`}constructor(pe,Ie,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,cn,void 0),this.id=pe,this.path=Ie,this.parent=H,this.params=N,this[hn]="sub"}}function pn(be){const{id:pe,path:Ie,parent:H}=be,N=Ie.split("/").filter($e=>$e.startsWith(":")).map($e=>$e.substring(1)),ce=[...H.params,...N];if(H.params.some($e=>N.includes($e)))throw new Error("SubRouteRef may not have params that overlap with its parent");if(!Ie.startsWith("/"))throw new Error(`SubRouteRef path must start with '/', got '${Ie}'`);if(Ie.endsWith("/"))throw new Error(`SubRouteRef path must not end with '/', got '${Ie}'`);for(const $e of N)if(!yn.test($e))throw new Error(`SubRouteRef path has invalid param, got '${$e}'`);return new Sn(pe,Ie,H,ce)}let xn=ot,Cn=xn;class on{toString(){return`routeRef{type=external,id=${this.id}}`}constructor(pe,Ie,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=Ie,this.optional=H,this[xn]="external"}}function fn(be){var pe;return new on(be.id,(pe=be.params)!==null&&pe!==void 0?pe:[],Boolean(be.optional))}var wn=n(73557);function _e(be){const{pathname:pe}=(0,wn.TH)(),Ie=(0,p.Vt)("routing-context");if(!Ie)throw new Error("Routing context is not available");const H=Ie.atVersion(1),N=(0,W.useMemo)(()=>H&&H.resolve(be,{pathname:pe}),[H,be,pe]);if(!Ie)throw new Error("useRouteRef used outside of routing context");if(!H)throw new Error("RoutingContext v1 not available");const ce="optional"in be&&be.optional;if(!N&&!ce)throw new Error(`No path for ${be}`);return N}function Jt(be){return(0,wn.UO)()}class Vt extends W.Component{static getDerivedStateFromError(pe){return{error:pe}}render(){const{error:pe}=this.state,{app:Ie,plugin:H}=this.props,{ErrorBoundaryFallback:N}=Ie.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 Je=n(64355);function Rn(be){const{component:pe,mountPoint:Ie,name:H}=be;return Nn({component:{lazy:()=>pe().then(N=>{const ce=$e=>{const qe=Ne();try{_e(Ie)}catch(It){if(typeof It=="object"&&It!==null){const{message:Bt}=It;if(typeof Bt=="string"&&Bt.startsWith("No path for "))throw new Error(`Routable extension component with mount point ${Ie} 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 It}return(0,W.useEffect)(()=>{qe.captureEvent(Zt,"")},[qe]),(0,r.jsx)(N,{...$e})},Ae=H||N.displayName||N.name||"LazyComponent";return ce.displayName=`RoutableExtension(${Ae})`,ce},N=>Ae=>{const $e=Ye(),{BootErrorPage:qe}=$e.getComponents();return(0,r.jsx)(qe,{step:"load-chunk",error:N})})},data:{"core.mountPoint":Ie},name:H})}function sn(be){const{component:pe,name:Ie}=be;return Nn({component:pe,name:Ie})}function Nn(be){const{data:pe={},name:Ie}=be;Ie||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 be.component){const ce=be.component.lazy;H=(0,W.lazy)(()=>ce().then(Ae=>({default:Ae})))}else H=be.component.sync;const N=Ie||H.displayName||H.name||"Component";return{expose(ce){const Ae=$e=>{var qe;const It=Ye(),{Progress:Bt}=It.getComponents(),nn=(qe=pe)===null||qe===void 0?void 0:qe["core.mountPoint"];return(0,r.jsx)(W.Suspense,{fallback:(0,r.jsx)(Bt,{}),children:(0,r.jsx)(Vt,{app:It,plugin:ce,children:(0,r.jsx)(m,{attributes:{pluginId:ce.getId(),...Ie&&{extension:Ie},...nn&&{routeRef:nn.id}},children:(0,r.jsx)(Je.o,{plugin:ce,children:(0,r.jsx)(H,{...$e})})})})})};et(Ae,"core.plugin",ce),et(Ae,"core.extensionName",Ie);for(const[$e,qe]of Object.entries(pe))et(Ae,$e,qe);return Ae.displayName=`Extension(${N})`,Ae}}}function In(be,pe,Ie,H){return W.Children.toArray(be).flatMap(N=>{if(!(0,W.isValidElement)(N))return[];if(N.type===W.Fragment)return In(N.props.children,pe,Ie,H);if(vt(N,"core.featureFlagged")){const ce=N.props;return("with"in ce?pe.isActive(ce.with):!pe.isActive(ce.without))?In(N.props.children,pe,Ie,H):[]}if(Ie===void 0||Ie(N))return[N];if(H)throw new Error(H);return In(N.props.children,pe,Ie,H)})}class Pn{selectByComponentData(pe){const Ie=In(this.node,this.featureFlagsApi,H=>vt(H,pe.key)!==void 0,pe.withStrictError);return new Pn(Ie,this.featureFlagsApi)}findComponentData(pe){return In(this.node,this.featureFlagsApi,H=>vt(H,pe.key)!==void 0).map(H=>vt(H,pe.key)).filter(H=>H!==void 0)}getElements(){return In(this.node,this.featureFlagsApi)}constructor(pe,Ie){(0,z._)(this,"node",void 0),(0,z._)(this,"featureFlagsApi",void 0),this.node=pe,this.featureFlagsApi=Ie}}function Gn(be,pe,Ie=[]){const H=ye(Dt),N=new Pn(be,H);return(0,W.useMemo)(()=>pe(N),[be,...Ie])}class Kn{getId(){return this.config.id}getApis(){var pe;return(pe=this.config.apis)!==null&&pe!==void 0?pe:[]}getFeatureFlags(){var pe,Ie;return(Ie=(pe=this.config.featureFlags)===null||pe===void 0?void 0:pe.slice())!==null&&Ie!==void 0?Ie:[]}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 Ln(be){return new Kn(be)}},64355:function(Lt,Le,n){"use strict";n.d(Le,{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:ye}=h,{Provider:le}=(0,p.CT)(f);return(0,r.jsx)(le,{value:(0,p.EI)({1:{plugin:ye}}),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(Lt,Le,n){"use strict";n.d(Le,{SP:function(){return ne},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 ye extends null{constructor(...w){super(...w),_define_property(this,"name","InputError")}}class le 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 E 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 ne 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(Lt,Le,n){"use strict";n.d(Le,{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 ye{static createDefaultApiFactory(){return createApiFactory({api:scmAuthApiRef,deps:{github:githubAuthApiRef,gitlab:gitlabAuthApiRef,azure:microsoftAuthApiRef,bitbucket:bitbucketAuthApiRef},factory:({github:X,gitlab:K,azure:R,bitbucket:w})=>ye.merge(ye.forGithub(X),ye.forGitlab(K),ye.forAzure(R),ye.forBitbucket(w))})}static forAuthApi(X,K){return new ye("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 ye("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 ye("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 ye("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 ye("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 le=n(40556);class z{static fromConfig(X){return le.Lx.fromConfig(X)}}const de=(0,r.T0)({id:"integration.scmintegrations"});var D=n(52322),E=n(73250),se=n(2784);const ie=ne=>{const{type:X}=ne,K=(0,r.qD)(),R=E.Z;var w;const I=X&&(w=K.getSystemIcon(X))!==null&&w!==void 0?w:R;return(0,D.jsx)(I,{})}},40556:function(Lt,Le,n){"use strict";n.d(Le,{Lx:function(){return Nr},BT:function(){return xt}});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(b){try{const A=typeof b=="string"?new URL(b):b;return C.find(J=>c(J)===A.host)}catch{return}},byHost(b){return C.find(A=>c(A)===b)}}}function F(C){const{url:c,base:b,lineNumber:A}=C;try{return new URL(c),c}catch{}let J;if(c.startsWith("/")){const{filepath:ve}=W()(b);J=new URL(b);const je=(0,f.trimEnd)(J.pathname.substring(0,J.pathname.length-ve.length),"/");J.pathname=`${je}${c}`}else J=new URL(c,b);return J.search=new URL(b).search,A&&(J.hash=`L${A}`),J.toString()}function ye(C){beforeAll(()=>C.listen({onUnhandledRequest:"error"})),afterAll(()=>C.close()),afterEach(()=>C.resetHandlers())}const le="amazonaws.com";function z(C){const c=C.getOptionalString("endpoint");var b;const A=(b=C.getOptionalBoolean("s3ForcePathStyle"))!==null&&b!==void 0?b:!1;let J,ve;if(c){try{const an=new URL(c);J=an.host,ve=an.pathname}catch{throw new Error(`invalid awsS3 integration config, endpoint '${c}' is not a valid URL`)}if(ve!=="/")throw new Error(`invalid awsS3 integration config, endpoints cannot contain path, got '${c}'`)}else J=le;const je=C.getOptionalString("accessKeyId"),ke=C.getOptionalString("secretAccessKey"),nt=C.getOptionalString("roleArn"),_t=C.getOptionalString("externalId");return{host:J,endpoint:c,s3ForcePathStyle:A,accessKeyId:je,secretAccessKey:ke,roleArn:nt,externalId:_t}}function de(C){const c=C.map(z);return c.some(b=>b.host===le)||c.push({host:le}),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 b=de((c=C.getOptionalConfigArray("integrations.awsS3"))!==null&&c!==void 0?c:[]);return h(b.map(A=>new D(A)),A=>A.config.host)});var E=n(88412),se=n(50629),ie=n(80956);const ne="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 b=new URL(c);let A,J,ve;const je=b.pathname.split("/").map(En=>decodeURIComponent(En));if(je[2]==="_git"?(A=je[1],J=ve=je[3]):je[3]==="_git"?(A=je[1],J=je[2],ve=je[4]):je[4]==="_git"&&(A=`${je[1]}/${je[2]}`,J=je[3],ve=je[5]),!A||!J||!ve)throw new Error("Azure URL must point to a git repository");var ke;const nt=(ke=b.searchParams.get("path"))!==null&&ke!==void 0?ke:void 0;let _t;const an=b.searchParams.get("version");if(an){if(an.slice(0,2)!=="GB")throw new Error("Azure URL version must point to a git branch");_t=an.slice(2)}return new Se(b.origin,A,J,ve,nt,_t)}toRepoUrl(){let c;return(0,E._)(this,R)===(0,E._)(this,w)?c=(0,E._)(this,xe).call(this,(0,E._)(this,K),"_git",(0,E._)(this,w)):c=(0,E._)(this,xe).call(this,(0,E._)(this,K),(0,E._)(this,R),"_git",(0,E._)(this,w)),(0,E._)(this,I)&&c.searchParams.set("path",(0,E._)(this,I)),(0,E._)(this,U)&&c.searchParams.set("version",ne+(0,E._)(this,U)),c.toString()}toFileUrl(){if(!(0,E._)(this,I))throw new Error("Azure URL must point to a specific path to be able to download a file");const c=(0,E._)(this,xe).call(this,(0,E._)(this,K),(0,E._)(this,R),"_apis","git","repositories",(0,E._)(this,w),"items");return c.searchParams.set("api-version","6.0"),c.searchParams.set("path",(0,E._)(this,I)),(0,E._)(this,U)&&c.searchParams.set("version",(0,E._)(this,U)),c.toString()}toArchiveUrl(){const c=(0,E._)(this,xe).call(this,(0,E._)(this,K),(0,E._)(this,R),"_apis","git","repositories",(0,E._)(this,w),"items");return c.searchParams.set("recursionLevel","full"),c.searchParams.set("download","true"),c.searchParams.set("api-version","6.0"),(0,E._)(this,I)&&c.searchParams.set("scopePath",(0,E._)(this,I)),(0,E._)(this,U)&&c.searchParams.set("version",(0,E._)(this,U)),c.toString()}toCommitsUrl(){const c=(0,E._)(this,xe).call(this,(0,E._)(this,K),(0,E._)(this,R),"_apis","git","repositories",(0,E._)(this,w),"commits");return c.searchParams.set("api-version","6.0"),(0,E._)(this,U)&&c.searchParams.set("searchCriteria.itemVersion.version",(0,E._)(this,U)),c.toString()}getOwner(){return(0,E._)(this,K)}getProject(){return(0,E._)(this,R)}getRepo(){return(0,E._)(this,w)}getPath(){return(0,E._)(this,I)}getRef(){return(0,E._)(this,U)}constructor(c,b,A,J,ve,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:(...ke)=>{const nt=new URL((0,E._)(this,X));return nt.pathname=ke.map(_t=>encodeURIComponent(_t)).join("/"),nt}}),(0,ie._)(this,X,c),(0,ie._)(this,K,b),(0,ie._)(this,R,A),(0,ie._)(this,w,J),(0,ie._)(this,I,ve),(0,ie._)(this,U,je)}}const k="dev.azure.com",Ke=C=>{const c=C;return Object.keys(C).length===3&&c.clientId!==void 0&&c.clientSecret!==void 0&&c.tenantId!==void 0},yt=C=>Object.keys(C).length===1&&C.clientId!==void 0;function $t(C){var c;const b=(c=C.getOptionalString("host"))!==null&&c!==void 0?c:k,A=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(b))throw new Error(`Invalid Azure integration config, '${b}' is not a valid host`);if(J&&!Ke(J)&&!yt(J))throw new Error("Invalid Azure integration config, credential is not valid");if(J&&b!==k)throw new Error(`Invalid Azure integration config, credential can only be used with ${k}`);if(J&&A)throw new Error("Invalid Azure integration config, specify either a token or a credential but not both");return{host:b,token:A,credential:J}}function zt(C){const c=C.map($t);return c.some(b=>b.host===k)||c.push({host:k}),c}class Rt{get type(){return"azure"}get title(){return this.integrationConfig.host}get config(){return this.integrationConfig}resolveUrl(c){const{url:b,base:A}=c;if(m(b))return b;try{const ve=Se.fromRepoUrl(A),je=new URL(A);var J;const ke=new URL(`https://a.com${(J=ve.getPath())!==null&&J!==void 0?J:""}`),nt=new URL(b,ke).pathname;return je.searchParams.set("path",nt),c.lineNumber&&(je.searchParams.set("line",String(c.lineNumber)),je.searchParams.set("lineEnd",String(c.lineNumber+1)),je.searchParams.set("lineStartColumn","1"),je.searchParams.set("lineEndColumn","1")),je.toString()}catch{return new URL(b,A).toString()}}resolveEditUrl(c){return c}constructor(c){(0,r._)(this,"integrationConfig",void 0),this.integrationConfig=c}}(0,r._)(Rt,"factory",({config:C})=>{var c;const b=zt((c=C.getOptionalConfigArray("integrations.azure"))!==null&&c!==void 0?c:[]);return h(b.map(A=>new Rt(A)),A=>A.config.host)});var Dt=n(48834).lW;function Yt(C){return AzureUrl.fromRepoUrl(C).toFileUrl()}function ct(C){return AzureUrl.fromRepoUrl(C).toArchiveUrl()}function ut(C){return AzureUrl.fromRepoUrl(C).toCommitsUrl()}async function St(C,c){const b="499b84ac-1321-427f-aa17-267ca6975798/.default",A=c?{...c}:{},{token:J,credential:ve}=C;if(ve){if(isAzureClientSecretCredential(ve)){const ke=await new ClientSecretCredential(ve.tenantId,ve.clientId,ve.clientSecret).getToken(b);A.Authorization=`Bearer ${ke.token}`}else if(isAzureManagedIdentityCredential(ve)){const ke=await new ManagedIdentityCredential(ve.clientId).getToken(b);A.Authorization=`Bearer ${ke.token}`}}else if(J){const je=Dt.from(`:${C.token}`,"utf8");A.Authorization=`Basic ${je.toString("base64")}`}return{headers:A}}const lt="bitbucket.org",Zt="https://api.bitbucket.org/2.0";function Gt(C){var c;const b=(c=C.getOptionalString("host"))!==null&&c!==void 0?c:lt;let A=C.getOptionalString("apiBaseUrl");const J=C.getOptionalString("token"),ve=C.getOptionalString("username"),je=C.getOptionalString("appPassword");if(!V(b))throw new Error(`Invalid Bitbucket integration config, '${b}' is not a valid host`);return A?A=(0,f.trimEnd)(A,"/"):b===lt?A=Zt:A=`https://${b}/rest/api/1.0`,{host:b,apiBaseUrl:A,token:J,username:ve,appPassword:je}}function Ce(C){const c=C.map(Gt);return c.some(b=>b.host===lt)||c.push({host:lt,apiBaseUrl:Zt}),c}class Ne{get type(){return"bitbucket"}get title(){return this.integrationConfig.host}get config(){return this.integrationConfig}resolveUrl(c){const b=F(c);if(!c.lineNumber)return b;const A=new URL(b);return this.integrationConfig.host==="bitbucket.org"?A.hash=`lines-${c.lineNumber}`:A.hash=`${c.lineNumber}`,A.toString()}resolveEditUrl(c){const b=W()(c),A=new URL(c);return A.searchParams.set("mode","edit"),A.searchParams.set("spa","0"),A.searchParams.set("at",b.ref),A.toString()}constructor(c){(0,r._)(this,"integrationConfig",void 0),this.integrationConfig=c}}(0,r._)(Ne,"factory",({config:C})=>{var c,b,A;const J=Ce((A=C.getOptionalConfigArray("integrations.bitbucket"))!==null&&A!==void 0?A:[...(c=C.getOptionalConfigArray("integrations.bitbucketCloud"))!==null&&c!==void 0?c:[],...(b=C.getOptionalConfigArray("integrations.bitbucketServer"))!==null&&b!==void 0?b:[]]);return h(J.map(ve=>new Ne(ve)),ve=>ve.config.host)});var Ye=n(96279),ht=n(48834).lW;async function rt(C,c){const{name:b,owner:A,resource:J}=parseGitUrl(C),ve=J==="bitbucket.org";let je=ve?`${c.apiBaseUrl}/repositories/${A}/${b}`:`${c.apiBaseUrl}/projects/${A}/repos/${b}/default-branch`,ke=await fetch(je,ot(c));if(ke.status===404&&!ve&&(je=`${c.apiBaseUrl}/projects/${A}/repos/${b}/branches/default`,ke=await fetch(je,ot(c))),!ke.ok){const _t=`Failed to retrieve default branch from ${je}, ${ke.status} ${ke.statusText}`;throw new Error(_t)}let nt;if(ve)nt=(await ke.json()).mainbranch.name;else{const{displayId:_t}=await ke.json();nt=_t}if(!nt)throw new Error(`Failed to read default branch from ${je}. Response ${ke.status} ${ke.json()}`);return nt}async function et(C,c){const{name:b,owner:A,ref:J,protocol:ve,resource:je,filepath:ke}=parseGitUrl(C),nt=je==="bitbucket.org";let _t=J;_t||(_t=await rt(C,c));const an=ke?`&path=${encodeURIComponent(decodeURIComponent(ke))}`:"";return nt?`${ve}://${je}/${A}/${b}/get/${_t}.tar.gz`:`${c.apiBaseUrl}/projects/${A}/repos/${b}/archive?format=tgz&at=${_t}&prefix=${A}-${b}${an}`}function vt(C,c){try{const{owner:b,name:A,ref:J,filepathtype:ve,filepath:je}=parseGitUrl(C);if(!b||!A||ve!=="browse"&&ve!=="raw"&&ve!=="src")throw new Error("Invalid Bitbucket URL or file path");const ke=je.replace(/^\//,"");if(c.host==="bitbucket.org"){if(!J)throw new Error("Invalid Bitbucket URL or file path");return`${c.apiBaseUrl}/repositories/${b}/${A}/src/${J}/${ke}`}return`${c.apiBaseUrl}/projects/${b}/repos/${A}/raw/${ke}?at=${J}`}catch(b){throw new Error(`Incorrect URL: ${C}, ${b}`)}}function ot(C){const c={};if(C.token)c.Authorization=`Bearer ${C.token}`;else if(C.username&&C.appPassword){const b=ht.from(`${C.username}:${C.appPassword}`,"utf8");c.Authorization=`Basic ${b.toString("base64")}`}return{headers:c}}const Qe="bitbucket.org",ft="https://api.bitbucket.org/2.0";function gt(C){const c=Qe,b=ft,A=C.getString("username"),J=C.getString("appPassword");return{host:c,apiBaseUrl:b,username:A,appPassword:J}}function Ct(C){const c=C.map(gt);return c.length===0&&c.push({host:Qe,apiBaseUrl:ft}),c}class yn{get type(){return"bitbucketCloud"}get title(){return this.integrationConfig.host}get config(){return this.integrationConfig}resolveUrl(c){const b=F(c);if(c.lineNumber){const A=new URL(b);return A.hash=`lines-${c.lineNumber}`,A.toString()}return b}resolveEditUrl(c){const b=W()(c),A=new URL(c);return A.searchParams.set("mode","edit"),A.searchParams.set("at",b.ref),A.toString()}constructor(c){(0,r._)(this,"integrationConfig",void 0),this.integrationConfig=c}}(0,r._)(yn,"factory",({config:C})=>{var c;const b=Ct((c=C.getOptionalConfigArray("integrations.bitbucketCloud"))!==null&&c!==void 0?c:[]);return h(b.map(A=>new yn(A)),A=>A.config.host)});var hn=n(48834).lW;async function cn(C,c){const{name:b,owner:A}=parseGitUrl(C),J=`${c.apiBaseUrl}/repositories/${A}/${b}`,ve=await fetch(J,xn(c));if(!ve.ok){const nt=`Failed to retrieve default branch from ${J}, ${ve.status} ${ve.statusText}`;throw new Error(nt)}const ke=(await ve.json()).mainbranch.name;if(!ke)throw new Error(`Failed to read default branch from ${J}. Response ${ve.status} ${ve.json()}`);return ke}async function Sn(C,c){const{name:b,owner:A,ref:J,protocol:ve,resource:je}=parseGitUrl(C);let ke=J;return ke||(ke=await cn(C,c)),`${ve}://${je}/${A}/${b}/get/${ke}.tar.gz`}function pn(C,c){try{const{owner:b,name:A,ref:J,filepathtype:ve,filepath:je}=parseGitUrl(C);if(!b||!A||ve!=="src"&&ve!=="raw")throw new Error("Invalid Bitbucket Cloud URL or file path");const ke=je.replace(/^\//,"");if(!J)throw new Error("Invalid Bitbucket Cloud URL or file path");return`${c.apiBaseUrl}/repositories/${b}/${A}/src/${J}/${ke}`}catch(b){throw new Error(`Incorrect URL: ${C}, ${b}`)}}function xn(C){const c={};if(C.username&&C.appPassword){const b=hn.from(`${C.username}:${C.appPassword}`,"utf8");c.Authorization=`Basic ${b.toString("base64")}`}return{headers:c}}function Cn(C){const c=C.getString("host");let b=C.getOptionalString("apiBaseUrl");const A=C.getOptionalString("token"),J=C.getOptionalString("username"),ve=C.getOptionalString("password");if(!V(c))throw new Error(`Invalid Bitbucket Server integration config, '${c}' is not a valid host`);return b?b=(0,f.trimEnd)(b,"/"):b=`https://${c}/rest/api/1.0`,{host:c,apiBaseUrl:b,token:A,username:J,password:ve}}function on(C){return C.map(Cn)}class fn{get type(){return"bitbucketServer"}get title(){return this.integrationConfig.host}get config(){return this.integrationConfig}resolveUrl(c){const b=F(c);if(c.lineNumber){const A=new URL(b);return A.hash=c.lineNumber.toString(),A.toString()}return b}resolveEditUrl(c){return c.includes("?")?c.substring(0,c.indexOf("?")):c}constructor(c){(0,r._)(this,"integrationConfig",void 0),this.integrationConfig=c}}(0,r._)(fn,"factory",({config:C})=>{var c;const b=on((c=C.getOptionalConfigArray("integrations.bitbucketServer"))!==null&&c!==void 0?c:[]);return h(b.map(A=>new fn(A)),A=>A.config.host)});var wn=n(48834).lW;async function _e(C,c){const{name:b,owner:A}=parseGitUrl(C);let J=`${c.apiBaseUrl}/projects/${A}/repos/${b}/default-branch`,ve=await fetch(J,Je(c));if(ve.status===404&&(J=`${c.apiBaseUrl}/projects/${A}/repos/${b}/branches/default`,ve=await fetch(J,Je(c))),!ve.ok){const nt=`Failed to retrieve default branch from ${J}, ${ve.status} ${ve.statusText}`;throw new Error(nt)}const{displayId:je}=await ve.json(),ke=je;if(!ke)throw new Error(`Failed to read default branch from ${J}. Response ${ve.status} ${ve.json()}`);return ke}async function Jt(C,c){const{name:b,owner:A,ref:J,filepath:ve}=parseGitUrl(C);let je=J;je||(je=await _e(C,c));const ke=ve?`&path=${encodeURIComponent(decodeURIComponent(ve))}`:"";return`${c.apiBaseUrl}/projects/${A}/repos/${b}/archive?format=tgz&at=${je}&prefix=${A}-${b}${ke}`}function Vt(C,c){try{const{owner:b,name:A,ref:J,filepathtype:ve,filepath:je}=parseGitUrl(C);if(!b||!A||ve!=="browse"&&ve!=="raw"&&ve!=="src")throw new Error("Invalid Bitbucket Server URL or file path");const ke=je.replace(/^\//,"");return`${c.apiBaseUrl}/projects/${b}/repos/${A}/raw/${ke}?at=${J}`}catch(b){throw new Error(`Incorrect URL: ${C}, ${b}`)}}function Je(C){const c={};if(C.token)c.Authorization=`Bearer ${C.token}`;else if(C.username&&C.password){const b=wn.from(`${C.username}:${C.password}`,"utf8");c.Authorization=`Basic ${b.toString("base64")}`}return{headers:c}}function Rn(C){const c=C.getString("host");let b=C.getOptionalString("baseUrl"),A=C.getOptionalString("cloneUrl"),J=C.getOptionalString("gitilesBaseUrl");const ve=C.getOptionalString("username"),je=C.getOptionalString("password");if(V(c)){if(b&&!m(b))throw new Error(`Invalid Gerrit integration config, '${b}' is not a valid baseUrl`);if(A&&!m(A))throw new Error(`Invalid Gerrit integration config, '${A}' 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 b?b=(0,f.trimEnd)(b,"/"):b=`https://${c}`,J?J=(0,f.trimEnd)(J,"/"):J=`https://${c}`,A?A=(0,f.trimEnd)(A,"/"):A=b,{host:c,baseUrl:b,cloneUrl:A,gitilesBaseUrl:J,username:ve,password:je}}function sn(C){return C.map(Rn)}var Nn=n(48834).lW;const In=")]}'";function Pn(C,c){const b=new URL(C.gitilesBaseUrl),A=new URL(c),ve=A.pathname.substring(A.pathname.startsWith("/a/")?2:0).replace(b.pathname,"").split("/").filter(En=>!!En),je=ve.indexOf("+");if(je<=0)throw new Error(`Unable to parse project from url: ${c}`);const ke=(0,f.trimStart)(ve.slice(0,je).join("/"),"/"),nt=ve.indexOf("heads");if(nt<=0)throw new Error(`Unable to parse branch from url: ${c}`);const _t=ve[nt+1],an=ve.slice(nt+2).join("/");return{branch:_t,filePath:an===""?"/":an,project:ke}}function Gn(C,c,b,A){return`${C.gitilesBaseUrl}/${c}/+/refs/heads/${b}/${(0,f.trimStart)(A,"/")}`}function Kn(C,c,b,A){const J=A==="/"||A===""?".tar.gz":`/${A}.tar.gz`;return`${be(C)}/${c}/+archive/refs/heads/${b}${J}`}function Ln(C){return C.password?"/a/":"/"}function be(C){const c=new URL(C.gitilesBaseUrl);return c.pathname=c.pathname.replace(/\/?$/,""),c.pathname=c.pathname.replace(/\/([^\/]*)$/,`${Ln(C)}$1`),c.toString()}function pe(C,c){const{branch:b,project:A}=Pn(C,c);return`${C.baseUrl}${Ln(C)}projects/${encodeURIComponent(A)}/branches/${b}`}function Ie(C,c){const{project:b}=Pn(C,c);return`${C.cloneUrl}${Ln(C)}${b}`}function H(C,c){const{branch:b,filePath:A,project:J}=Pn(C,c);return`${C.baseUrl}${Ln(C)}projects/${encodeURIComponent(J)}/branches/${b}/files/${encodeURIComponent(A)}/content`}function N(C){return`${C.baseUrl}${Ln(C)}projects/`}function ce(C){const c={};if(!C.password)return c;const b=Nn.from(`${C.username}:${C.password}`,"utf8");return c.Authorization=`Basic ${b.toString("base64")}`,{headers:c}}async function Ae(C){const c=await C.text();if(c.startsWith(In))try{return JSON.parse(c.slice(In.length))}catch(b){throw new Error(`Invalid response from Gerrit: ${c.slice(0,10)} - ${b}`)}throw new Error(`Gerrit JSON body prefix missing. Found: ${c.slice(0,10)}`)}class $e{get type(){return"gerrit"}get title(){return this.integrationConfig.host}get config(){return this.integrationConfig}resolveUrl(c){const{url:b,base:A,lineNumber:J}=c;let ve;if(b.startsWith("/")){const{branch:je,project:ke}=Pn(this.config,A);return Gn(this.config,ke,je,b)}return b?ve=new URL(b,A):ve=new URL(A),J&&(ve.hash=J.toString()),ve.toString()}resolveEditUrl(c){return c}constructor(c){(0,r._)(this,"integrationConfig",void 0),this.integrationConfig=c}}(0,r._)($e,"factory",({config:C})=>{var c;const b=sn((c=C.getOptionalConfigArray("integrations.gerrit"))!==null&&c!==void 0?c:[]);return h(b.map(A=>new $e(A)),A=>A.config.host)});function qe(C){const c=C.getString("host");let b=C.getOptionalString("baseUrl");const A=C.getOptionalString("username"),J=C.getOptionalString("password");if(!V(c))throw new Error(`Invalid Gitea integration config, '${c}' is not a valid host`);return b?b=(0,f.trimEnd)(b,"/"):b=`https://${c}`,{host:c,baseUrl:b,username:A,password:J}}var It=n(48834).lW;function Bt(C,c){try{var b;const A=(b=C.baseUrl)!==null&&b!==void 0?b:`https://${C.host}`,[J,ve,je,ke,nt,_t,...an]=c.replace(A,"").split("/"),En=an.join("/").replace(/^\//,"");return`${A}/${ve}/${je}/_edit/${_t}/${En}`}catch(A){throw new Error(`Incorrect URL: ${c}, ${A}`)}}function nn(C,c){try{var b;const A=(b=C.baseUrl)!==null&&b!==void 0?b:`https://${C.host}`,[J,ve,je,ke,nt,_t,...an]=c.replace(A,"").split("/"),En=an.join("/").replace(/^\//,"");return`${A}/api/v1/repos/${ve}/${je}/contents/${En}?ref=${_t}`}catch(A){throw new Error(`Incorrect URL: ${c}, ${A}`)}}function ln(C){const c={},{username:b,password:A}=C;return A?(b?c.Authorization=`basic ${It.from(`${b}:${A}`).toString("base64")}`:c.Authorization=`token ${A}`,{headers:c}):c}class rn{get type(){return"gitea"}get title(){return this.config.host}resolveUrl(c){return F(c)}resolveEditUrl(c){return Bt(this.config,c)}constructor(c){(0,r._)(this,"config",void 0),this.config=c}}(0,r._)(rn,"factory",({config:C})=>{var c;const A=((c=C.getOptionalConfigArray("integrations.gitea"))!==null&&c!==void 0?c:[]).map(J=>qe(J));return h(A.map(J=>new rn(J)),J=>J.config.host)});const ee="github.com",te="https://api.github.com",G="https://raw.githubusercontent.com";function v(C){var c,b;const A=(b=C.getOptionalString("host"))!==null&&b!==void 0?b:ee;let J=C.getOptionalString("apiBaseUrl"),ve=C.getOptionalString("rawBaseUrl");const je=C.getOptionalString("token"),ke=(c=C.getOptionalConfigArray("apps"))===null||c===void 0?void 0:c.map(nt=>({appId:nt.getNumber("appId"),clientId:nt.getString("clientId"),clientSecret:nt.getString("clientSecret"),webhookSecret:nt.getString("webhookSecret"),privateKey:nt.getString("privateKey"),allowedInstallationOwners:nt.getOptionalStringArray("allowedInstallationOwners")}));if(!V(A))throw new Error(`Invalid GitHub integration config, '${A}' is not a valid host`);return J?J=(0,f.trimEnd)(J,"/"):A===ee&&(J=te),ve?ve=(0,f.trimEnd)(ve,"/"):A===ee&&(ve=G),{host:A,apiBaseUrl:J,rawBaseUrl:ve,token:je,apps:ke}}function O(C){const c=C.map(v);return c.some(b=>b.host===ee)||c.push({host:ee,apiBaseUrl:te,rawBaseUrl:G}),c}function M(C,c,b){try{const{owner:A,name:J,ref:ve,filepathtype:je,filepath:ke}=parseGitUrl(C);if(!A||!J||!ve||je!=="blob"&&je!=="raw"&&je!=="tree")throw new Error("Invalid GitHub URL or file path");const nt=ke.replace(/^\//,"");return he(c,b)==="api"?`${c.apiBaseUrl}/repos/${A}/${J}/contents/${nt}?ref=${ve}`:`${c.rawBaseUrl}/${A}/${J}/${ve}/${nt}`}catch(A){throw new Error(`Incorrect URL: ${C}, ${A}`)}}function Y(C,c){const b={};return he(C,c)==="api"&&(b.Accept="application/vnd.github.v3.raw"),c.token&&(b.Authorization=`token ${c.token}`),{headers:b}}function he(C,c){return C.apiBaseUrl&&(c.token||!C.rawBaseUrl)?"api":"raw"}var we=n(35355),Oe=n(89393),Xe=n(26228);class tt{async getOrCreateToken(c,b,A){let J=this.tokenCache.get(c);if((!J||this.isExpired(J.expiresAt))&&(J=await A(),J.expiresAt=J.expiresAt.minus({minutes:10}),this.tokenCache.set(c,J)),!this.appliesToRepo(J,b))throw new Error(`The Backstage GitHub application used in the ${c} organization does not have access to a repository with the name ${b}`);return{accessToken:J.token}}appliesToRepo(c,b){return b===void 0?!0:c.repositories!==void 0?c.repositories.includes(b):!0}constructor(){(0,r._)(this,"tokenCache",new Map),(0,r._)(this,"isExpired",c=>Xe.ou.local()>c)}}const mt={Accept:"application/vnd.github.machine-man-preview+json"};class wt{async getInstallationCredentials(c,b){if(this.allowedInstallationOwners){var A;if(!(!((A=this.allowedInstallationOwners)===null||A===void 0)&&A.includes(c)))return{accessToken:void 0}}return this.cache.getOrCreateToken(c,b,async()=>{const{installationId:J,suspended:ve}=await this.getInstallationData(c);if(ve)throw new Error(`The GitHub application for ${c} is suspended`);const je=await this.appClient.apps.createInstallationAccessToken({installation_id:J,headers:mt});let ke;if(je.data.repository_selection==="selected"){const _t=new Oe.v({baseUrl:this.baseUrl,auth:je.data.token}),an=await _t.paginate(_t.apps.listReposAccessibleToInstallation);var nt;ke=((nt=an.repositories)!==null&&nt!==void 0?nt:an).map(gn=>gn.name)}return{token:je.data.token,expiresAt:Xe.ou.fromISO(je.data.expires_at),repositories:ke}})}getInstallations(){return this.appClient.paginate(this.appClient.apps.listInstallations)}async getInstallationData(c){const A=(await this.getInstallations()).find(ve=>{var je;return ve.account&&"login"in ve.account&&((je=ve.account.login)===null||je===void 0?void 0:je.toLocaleLowerCase("en-US"))===c.toLocaleLowerCase("en-US")});if(A)return{installationId:A.id,suspended:Boolean(A.suspended_by)};const J=new Error(`No app installation found for ${c} in ${this.baseAuthConfig.appId}`);throw J.name="NotFoundError",J}constructor(c,b){(0,r._)(this,"appClient",void 0),(0,r._)(this,"baseUrl",void 0),(0,r._)(this,"baseAuthConfig",void 0),(0,r._)(this,"cache",new tt),(0,r._)(this,"allowedInstallationOwners",void 0),this.allowedInstallationOwners=c.allowedInstallationOwners,this.baseUrl=b,this.baseAuthConfig={appId:c.appId,privateKey:c.privateKey.replace(/\\n/gm,`
|
|
32
|
+
`},zr=100,jr=10,Nr=(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:zr,height:`calc(100% + ${jr}px)`,transition:"opacity 300ms",pointerEvents:"none"},fadeLeft:{left:-jr,background:`linear-gradient(90deg, ${Yn(e.palette.type)})`},fadeRight:{right:-jr,background:`linear-gradient(270deg, ${Yn(e.palette.type)})`},fadeHidden:{opacity:0},button:{position:"absolute"},buttonLeft:{left:-e.spacing(2)},buttonRight:{right:-e.spacing(2)}}),{name:"BackstageHorizontalScrollGrid"});function C(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 c(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 q=$-x,Q=Math.abs(u)*q/s,ge=Math.max(l,Q)*Math.sign(u);e.current.scrollBy({left:ge});const Ue=u-ge;Math.sign(u)!==Math.sign(Ue)?g(0):g(Ue)});return()=>cancelAnimationFrame(T)},[e,u,s,l]),g}function b(e){const{scrollStep:s=100,scrollSpeed:l=50,minScrollDistance:u=5,children:g,...x}=e,T=Nr(e),$=React.useRef(),[q,Q]=C($),fe=c($,l,u),ge=Ue=>{$.current&&fe(Ue?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]:q===0})}),_jsx(Box,{className:classNames(T.fade,T.fadeRight,{[T.fadeHidden]:Q===0})}),q>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 A=(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 J(e){const s=A(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 ve=(0,f.lazy)(()=>Promise.all([n.e(1049),n.e(6051)]).then(n.bind(n,76051)).then(e=>({default:e.RealLogViewer})));function je(e){const{Progress:s}=(0,p.qD)().getComponents();return(0,r.jsx)(f.Suspense,{fallback:(0,r.jsx)(s,{}),children:(0,r.jsx)(ve,{...e})})}var ke=n(28865),nt=n(60251);const _t=(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"}),an=(e,s)=>s?typeof s=="string"?e+s:f.Children.toArray(s.props.children).reduce(an,e):e,En=({level:e,children:s})=>{const g=f.Children.toArray(s).reduce(an,"").toLocaleLowerCase("en-US").replace(/\W/g,"-");return f.createElement(`h${e}`,{id:g},s)},gn={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:En,h2:En,h3:En,h4:En,h5:En,h6:En};function Wr(e){const{content:s,dialect:l="gfm",linkTarget:u,transformLinkUri:g,transformImageUri:x,className:T}=e,$=_t();return(0,r.jsx)(ke.D,{remarkPlugins:l==="gfm"?[nt.Z]:[],className:`${$.markdown} ${T}`,children:s,components:gn,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(q){x(isError(q)?q.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,q=useObservable(useMemo(()=>g.authRequest$(),[g]),[]),Q=()=>{q.forEach(fe=>fe.reject())};return _jsxs(Dialog,{open:Boolean(q.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:q.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 cr=(0,m.Z)({container:{overflow:"visible !important"}},{name:"BackstageOverflowTooltip"});function Hr(e){const[s,l]=(0,f.useState)(!1),u=(0,Er.t)(),g=cr(),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)(E.Z,{display:"none"})}var jo=n(94339),Fr=n(14503),Ko=n(24579),Eo=n(32552),Fn=n(15459),dr=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)(E.Z,{children:[(0,r.jsx)(Be.Z,{}),(0,r.jsx)(le.r,{to:s,onClick:u,underline:"none",children:(0,r.jsxs)(E.Z,{display:"flex",alignItems:"center",className:g.root,children:[(0,r.jsx)(E.Z,{className:g.boxTitle,fontWeight:"fontWeightBold",m:1,children:(0,r.jsx)(Je.Z,{children:(0,r.jsx)("strong",{children:l})})}),(0,r.jsx)(dr.Z,{className:g.arrow})]})})]})}const Yo=e=>{const{slackChannel:s}=e;if(s){if(typeof s=="string")return(0,r.jsxs)(Je.Z,{children:["Please contact ",s," for help."]});if(!s.href)return(0,r.jsxs)(Je.Z,{children:["Please contact ",s.name," for help."]})}else return null;return(0,r.jsx)(de,{to:s.href,variant:"contained",children:s.name})},gr=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)(dt,{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,Fn.Z)(e=>({root:{display:"inline-block",padding:e.spacing(8,8,0,0),float:"right"}}),{name:"BackstageInfoCardCardActionsTopRight"})(Fr.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 Zr(e){const{title:s,subheader:l,divider:u=!0,deepLink:g,slackChannel:x,errorBoundaryProps:T,variant:$,children:q,headerStyle:Q,headerProps:fe,icon:ge,action:Ue,actionsClassName:Pe,actions:Ve,cardClassName:pt,actionsTopRight:at,className:Wt,noPadding:$n,titleTypographyProps:Vn}=e,kt=Ao();let en={},vn={};$&&$.split(/[\s]+/g).forEach(br=>{en={...en,...Ro.card[br]},vn={...vn,...Ro.cardContent[br]}});const Un=()=>!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]}),Mn=T||(x?{slackChannel:x}:{});return(0,r.jsx)(jo.Z,{style:en,className:Wt,children:(0,r.jsxs)(gr,{...Mn,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:Un(),action:Ue,style:{...Q},titleTypographyProps:Vn,...fe}),at&&(0,r.jsx)(To,{children:at}),u&&(0,r.jsx)(Be.Z,{}),(0,r.jsx)(Ko.Z,{className:on()(pt,{[kt.noPadding]:$n}),style:vn,children:q}),Ve&&(0,r.jsx)(Fr.Z,{className:Pe,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:q,unit:Q,max:fe,description:ge}={...co,...e},Ue=$?Math.round(T*fe):T,Pe=fe!==100?Math.round(T):Ue,[Ve,pt]=useState(!1);return useEffect(()=>{const at=s,Wt=()=>pt(!0),$n=()=>pt(!1);return at&&ge?(at.addEventListener("mouseenter",Wt),at.addEventListener("mouseleave",$n),()=>{at.removeEventListener("mouseenter",Wt),at.removeEventListener("mouseleave",$n)}):()=>{pt(!1)}},[ge,s]),_jsxs(Box,{ref:l,className:g.root,children:[_jsx(Circle,{strokeLinecap:"butt",percent:Ue,strokeWidth:12,trailWidth:12,strokeColor:u({palette:x,value:Pe,inverse:q,max:fe}),className:g.circle}),ge&&Ve?_jsx(Box,{className:g.description,children:ge}):_jsx(Box,{className:g.overlay,children:isNaN(T)?"N/A":`${Pe}${Q}`})]})}const Lo=(0,m.Z)({root:{height:"100%",width:250}},{name:"BackstageGaugeCard"});function ur(e){const s=Lo(e),{title:l,subheader:u,progress:g,inverse:x,deepLink:T,description:$,icon:q,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:q,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),qn=n(12420),ho=n(72379);const Xo=(0,m.Z)(e=>(0,qn.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,qn.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,Fn.Z)(e=>(0,qn.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,qn.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:q=!1,disabled:Q=!1,margin:fe}=e,ge=po(),[Ue,Pe]=(0,f.useState)(x||(s?[]:"")),[Ve,pt]=(0,f.useState)(!1);(0,f.useEffect)(()=>{Pe(s?[]:"")},[$,s]),(0,f.useEffect)(()=>{Pe(x||(s?[]:""))},[x,s]);const at=kt=>{Pe(kt.target.value),T(kt.target.value)},Wt=kt=>{if(Q){kt.preventDefault();return}pt(en=>s&&!(kt.target instanceof HTMLElement)?!0:!en)},$n=()=>{pt(!1)},Vn=kt=>()=>{const en=Ue.filter(vn=>vn!==kt);Pe(en),T(en)};return(0,r.jsx)(E.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:Ue,native:q,disabled:Q,"data-testid":"select",displayEmpty:!0,multiple:s,margin:fe,onChange:at,open:Ve,onOpen:Wt,onClose:$n,input:(0,r.jsx)(es,{}),label:u,renderValue:kt=>{var en;return s&&Ue.length!==0?(0,r.jsx)(E.Z,{className:ge.chips,children:kt.map(vn=>{var Un,Mn;return(0,r.jsx)(js.Z,{label:(Un=l.find(ir=>ir.value===vn))===null||Un===void 0?void 0:Un.label,clickable:!0,onDelete:Vn(vn),className:ge.chip},(Mn=l.find(ir=>ir.value===vn))===null||Mn===void 0?void 0:Mn.value)})}):(0,r.jsx)(Je.Z,{children:Ue.length===0?g||"":(en=l.find(vn=>vn.value===kt))===null||en===void 0?void 0:en.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}),q?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:Ue.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),[$,q]=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:q,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"}),dn=({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:q}=useContext(VerticalStepperContext),Q=(Pe,Ve)=>{Ve&&Ve(),q&&q(g,Pe),x(Pe)},fe=()=>{const Pe=e.nextStep?e.nextStep(g,u-1):g+1;Q(Pe,e.onNext),$([...T,Pe])},ge=()=>{T.pop(),Q(T[T.length-1],e.onBack),$([...T])},Ue=()=>{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(dn,{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:Ue,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 _(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 ue(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 Ee(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 Re(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 Fe=n(74600),We=n(15584);const it=e=>(0,qn.Z)({root:{fontWeight:e.typography.fontWeightBold,whiteSpace:"nowrap",paddingRight:e.spacing(4),border:"0",verticalAlign:"top"}}),Et={root:{border:"0",verticalAlign:"top"}},De=e=>(0,qn.Z)({root:{margin:e.spacing(0,0,-1,0)}}),He=e=>(0,qn.Z)({root:{padding:e.spacing(0,0,1,0)},random:{}}),Tt=(0,Fn.Z)(it,{name:"BackstageMetadataTableTitleCell"})(We.Z),tn=(0,Fn.Z)(Et,{name:"BackstageMetadataTableCell"})(We.Z),An=({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(Tt,{children:e}),_jsx(tn,{colSpan:e?1:2,...l,children:s})]}),Pt=(0,Fn.Z)(De,{name:"BackstageMetadataTableList"})(({classes:e,children:s})=>(0,r.jsx)(It.Z,{disablePadding:!0,className:e.root,children:s})),Kt=(0,Fn.Z)(He,{name:"BackstageMetadataTableListItem"})(({classes:e,children:s})=>(0,r.jsx)(Bt.Z,{className:e.root,children:s})),Tn=(0,qn.Z)({root:{margin:"0 0",listStyleType:"none"}}),hr=e=>(0,qn.Z)({root:{...Tn.root,paddingLeft:e.spacing(1)}}),Tr=(0,Fn.Z)(Tn,{name:"BackstageStructuredMetadataTableList"})(({classes:e,children:s})=>(0,r.jsx)(Pt,{classes:e,children:s})),Yr=(0,Fn.Z)(hr,{name:"BackstageStructuredMetadataTableNestedList"})(({classes:e,children:s})=>(0,r.jsx)(Pt,{classes:e,children:s}));function zn(e,s){const l=e.map((u,g)=>_jsx(MetadataListItem,{children:Bn(u)},g));return s?_jsx(Yr,{children:l}):_jsx(Tr,{children:l})}function mn(e,s,l){const u=Object.keys(e).map(g=>{const x=Bn(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 Bn(e,s,l){return React.isValidElement(e)?_jsx(Fragment,{children:e}):typeof e=="object"&&!Array.isArray(e)?mn(e,s,l):Array.isArray(e)?zn(e,l):typeof e=="boolean"?_jsx(Fragment,{children:e?"\u2705":"\u274C"}):_jsx(Typography,{variant:"body2",component:"span",children:e})}const mr=({value:e,options:s})=>_jsx(Fragment,{children:Bn(e,s)}),ui=({title:e,value:s,options:l})=>_jsx(MetadataTableItem,{title:l&&l.titleFormat?l.titleFormat(e):startCase(e),children:_jsx(mr,{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(q=>isEqual($,q)?q:$)},[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)(le.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)(nn.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),[$,q]=(0,f.useState)(null),Q=Bs(),fe=(0,Se.Z)(Pe=>Pe.breakpoints.down("sm")),ge=Pe=>{q(Pe.currentTarget),T(!0)},Ue=()=>{T(!1)};return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(E.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)(ye.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:Ue,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)(Je.Z,{variant:"subtitle1",children:s})}),f.Children.map(u,(Pe,Ve)=>(0,r.jsx)(no.Z,{alignItems:"flex-start",children:Pe},`child-${Ve}`)),(l!=null?l:g).map((Pe,Ve)=>(0,r.jsx)(xi,{item:Pe},`item-${Ve}`))]}),(0,r.jsx)(pi.Z,{children:(0,r.jsx)(ye.Z,{color:"primary",onClick:Ue,"aria-label":"Close",children:"Close"})})]})]})}var os=n(18671),er=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 Wn(e){const{tabs:s,onChange:l,selectedIndex:u}=e,[g,x]=(0,f.useState)(u!=null?u:0),T=Ci(),$=(0,f.useCallback)((q,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)(E.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,Q)=>(0,f.createElement)(La.Z,{...q.tabProps,"data-testid":`header-tab-${Q}`,label:q.label,key:q.id,value:Q,className:T.defaultTab,classes:{selected:T.selected,root:T.tabRoot}}))})})}function Oa(e){const s=(0,er.UO)(),u=e.map(({path:Ue,children:Pe})=>({caseSensitive:!1,path:`${Ue}/*`,element:Pe})).sort((Ue,Pe)=>Pe.path.replace(/\/\*$/,"").localeCompare(Ue.path.replace(/\/\*$/,"")));var g;const x=(g=(0,er.V$)(u))!==null&&g!==void 0?g:e[0].children;var T;let $=(T=s["*"])!==null&&T!==void 0?T:"";$.startsWith("/")||($=`/${$}`);var q;const[Q]=(q=(0,Bo.fp)(u,$))!==null&&q!==void 0?q:[],fe=Q?e.findIndex(Ue=>`${Ue.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,er.s0)(),{index:u,route:g,element:x}=Oa(s),T=(0,f.useMemo)(()=>s.map(q=>({id:q.path,label:q.title,tabProps:q.tabProps})),[s]),$=q=>{let{path:Q}=s[q];Q=Q.replace(/\/\*$/,""),Q=Q.replace(/^\//,""),l(Q)};return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(Wn,{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)(E.Z,{className:u.value,children:s}),(0,r.jsx)(E.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),q=()=>{x({}),$(Q=>!Q)};return(0,f.useEffect)(()=>{u(g)},[g,u]),(0,r.jsxs)(E.Z,{className:l.root,children:[(0,r.jsxs)(E.Z,{className:l.header,children:[(0,r.jsx)(E.Z,{className:l.value,children:"Filters"}),(0,r.jsx)(ye.Z,{color:"primary",onClick:q,children:"Clear all"})]}),(0,r.jsx)(E.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,Fn.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,Fn.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,Q)=>({...T($,q,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)(q=>{e.onSearchChanged(q),l(q)},[e,l]);return u?(0,r.jsxs)(E.Z,{className:T.root,children:[(0,r.jsxs)(E.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)(Je.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:q,initialState:Q,emptyContent:fe,onStateChange:ge,components:Ue,...Pe}=e,Ve=Bi(),pt=(0,se.Z)(),at={...Ms,...Q},[Wt,$n]=(0,f.useState)(at.filtersOpen),Vn=(0,f.useCallback)(()=>$n(Qn=>!Qn),[$n]),[kt,en]=(0,f.useState)(0),[vn,Un]=(0,f.useState)(u),[Mn,ir]=(0,f.useState)(at.filters),br=Da(g,pt),[Qr,kr]=(0,f.useState)(at.search);(0,f.useEffect)(()=>{if(ge){const Qn=$i({search:Qr,filtersOpen:Wt,filters:Mn},Ms);ge(Qn)}},[Qr,Wt,Mn,ge]);const bs={headerStyle:{textTransform:"uppercase"}},un=(0,f.useCallback)(Qn=>{var Mr;return(Mr=g.find(Br=>Br.title===Qn))===null||Mr===void 0?void 0:Mr.field},[g]);(0,f.useEffect)(()=>{if(typeof u=="function")return;if(!Mn){Un(u);return}const Qn=Object.values(Mn);if(u&&Qn.flat().length){const Mr=u.filter(Br=>!!Object.entries(Mn).filter(([,Sr])=>!!Sr.length).every(([Sr,Hn])=>{const ar=ds(Br,un(Sr));return Array.isArray(ar)&&Array.isArray(Hn)?ar.some(Wo=>Hn.includes(Wo)):Array.isArray(ar)?ar.includes(Hn):Array.isArray(Hn)?Hn.includes(ar):ar===Hn}));Un(Mr)}else Un(u);en(Qn.flat().length)},[u,Mn,un]);const zo=(Qn,Mr)=>{const Br=Hn=>{const ar=new Set,Wo=ao=>{ao!=null&&ar.add(ao)};return Mr&&Mr.forEach(ao=>{const Xr=ds(ao,un(Hn));Array.isArray(Xr)?Xr.forEach(Wo):Wo(Xr)}),ar},Sr=Hn=>({placeholder:"All results",label:Hn.column,multiple:Hn.type==="multiple-select",items:[...Br(Hn.column)].sort().map(ar=>({label:ar,value:ar}))});return Qn.map(Hn=>({type:Hn.type,element:Sr(Hn)}))},si=!!(!((s=q)===null||s===void 0)&&s.length),So=(0,f.useCallback)(Qn=>(0,r.jsx)(Di,{setSearch:kr,hasFilters:si,selectedFiltersLength:kt,toggleFilters:Vn,...Qn}),[Vn,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)(E.Z,{className:Ve.root,children:[Wt&&u&&typeof u!="function"&&((l=q)===null||l===void 0?void 0:l.length)&&(0,r.jsx)(Li,{filters:zo(q,u),selectedFilters:Mn,onChangeFilters:ir}),(0,r.jsx)($o.ZP,{components:{Header:Oi,Toolbar:So,Body:ya,...Ue},options:{...bs,...x},columns:br,icons:Zs,title:(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(Je.Z,{variant:"h5",component:"h2",children:T}),$&&(0,r.jsx)(Je.Z,{color:"textSecondary",variant:"body1",children:$})]}),data:typeof u=="function"?u:vn,style:{width:"100%"},localization:{toolbar:{searchPlaceholder:"Filter",searchTooltip:"Filter"}},...Pe})]})}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)(Je.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)(E.Z,{className:T.container,children:[(0,r.jsxs)(E.Z,{className:T.leftItemsBox,children:[$,s&&(0,r.jsx)(Je.Z,{className:T.description,variant:"body2",children:s})]}),(0,r.jsx)(E.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,"auto",4)}}}),{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,er.s0)(),$=vi();return(0,r.jsxs)(Vt.Z,{container:!0,spacing:0,className:x.container,children:[(0,r.jsxs)(Vt.Z,{item:!0,xs:12,sm:8,md:4,children:[(0,r.jsxs)(Je.Z,{"data-testid":"error",variant:"body1",className:x.subtitle,children:["ERROR ",s,": ",l]}),(0,r.jsx)(Je.Z,{variant:"body1",className:x.subtitle,children:u}),(0,r.jsx)(Je.Z,{variant:"h2",className:x.title,children:"Looks like someone dropped the mic!"}),(0,r.jsxs)(Je.Z,{variant:"h6",children:[(0,r.jsx)(le.r,{to:"#","data-testid":"go-back-link",onClick:()=>T(-1),children:"Go back"}),"... or please"," ",(0,r.jsx)(le.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,Fn.Z)({root:{textDecoration:"underline",cursor:"pointer"}},{name:"BackstageBreadcrumbsClickableText"})(Je.Z),hs=(0,Fn.Z)({root:{textDecoration:"underline",color:"inherit"}},{name:"BackstageBreadcrumbsStyledBox"})(E.Z);function Mi(e){const{children:s,...l}=e,[u,g]=f.useState(null),x=f.Children.toArray(s),[T,$,...q]=x,Q=q.length?q.pop():x[x.length-1],fe=x.length>3,ge=Ve=>{g(Ve.currentTarget)},Ue=()=>{g(null)},Pe=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)(E.Z,{style:{fontStyle:"italic"},children:Q})]}),(0,r.jsx)(go.ZP,{open:Pe,anchorEl:u,onClose:Ue,anchorOrigin:{vertical:"bottom",horizontal:"left"},transformOrigin:{vertical:"top",horizontal:"left"},children:(0,r.jsx)(It.Z,{children:q.map((Ve,pt)=>(0,r.jsx)(Bt.Z,{button:!0,children:(0,r.jsx)(hs,{clone:!0,children:Ve})},pt))})})]})}const xo=72,zi=24,Wi=18,vr={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=>({...vr,...e,iconContainerWidth:vr.drawerWidthClosed,iconSize:vr.drawerWidthClosed-vr.iconPadding*2,userBadgeDiameter:vr.drawerWidthClosed-vr.userBadgePadding*2}),Hs={drawerWidthClosed:0,drawerWidthOpen:202,defaultOpenDelayMs:vr.defaultOpenDelayMs+200},Vi=e=>({...Hs,...e}),ps="@backstage/core/sidebar-intro-dismissed",Rr=(0,f.createContext)({sidebarConfig:vr,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,er.TH)(),{selectedMenuItemIndex:q,setSelectedMenuItemIndex:Q}=(0,f.useContext)(Xs),fe=(Ue,Pe)=>{Q(Pe===q?-1:Pe)},ge=g===q&&q>=0||g!==q&&!(q>=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)(E.Z,{className:x.overlayHeader,children:[(0,r.jsx)(Je.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)(E.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,er.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 q=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:q,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),q=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)(E.Z,{className:q.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 tr;(function(e){e[e.Closed=0]="Closed",e[e.Idle=1]="Idle",e[e.Open=2]="Open"})(tr||(tr={}));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)(Wt=>Wt.breakpoints.down("md"),{noSsr:!0}),[q,Q]=(0,f.useState)(tr.Closed),fe=(0,f.useRef)(),{isPinned:ge,toggleSidebarPinState:Ue}=gs(),Pe=()=>{ge||g||(fe.current&&(clearTimeout(fe.current),fe.current=void 0),q!==tr.Open&&!$&&(fe.current=window.setTimeout(()=>{fe.current=void 0,Q(tr.Open)},l),Q(tr.Idle)))},Ve=()=>{ge||g||(fe.current&&(clearTimeout(fe.current),fe.current=void 0),q===tr.Idle?Q(tr.Closed):q===tr.Open&&(fe.current=window.setTimeout(()=>{fe.current=void 0,Q(tr.Closed)},u)))},pt=q===tr.Open&&!$||ge,at=Wt=>{Wt?(Q(tr.Open),Ue()):(Q(tr.Closed),Ue())};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)(E.Z,{className:T.root,"data-testid":"sidebar-root",onMouseEnter:g?()=>{}:Pe,onFocus:g?()=>{}:Pe,onMouseLeave:g?()=>{}:Ve,onBlur:g?()=>{}:Ve,children:(0,r.jsx)(E.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:q}=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:q,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)(ye.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:q}=useContext(SidebarItemWithSubmenuContext),Q=()=>{q(!1)},fe=useResolvedPath(u!=null?u:""),ge=useLocation();let Ue=isLocationMatch(ge,fe,T);const[Pe,Ve]=useState(!1),pt=()=>{Ve(!Pe)};return x!==void 0?(x.some(at=>{const Wt=resolvePath(at.to);return Ue=isLocationMatch(ge,Wt,T),Ue}),_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,Ue?$.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})]}),Pe?_jsx(ArrowDropUpIcon,{className:$.dropdownArrow}):_jsx(ArrowDropDownIcon,{className:$.dropdownArrow})]})}),x&&Pe&&_jsx(Box,{className:$.dropdown,children:x.map((at,Wt)=>_jsx(Tooltip,{title:at.title,enterDelay:500,enterNextDelay:500,children:_jsx(Link,{to:at.to,underline:"none",className:$.dropdownItem,onClick:Q,onTouchStart:$n=>$n.stopPropagation(),children:_jsx(Typography,{component:"span",className:$.textContent,children:at.title})})},Wt))})]})):_jsx(Box,{className:$.itemContainer,children:_jsx(Tooltip,{title:s,enterDelay:500,enterNextDelay:500,children:_jsxs(Link,{to:u,underline:"none",className:classnames($.item,Ue?$.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),[$,q]=(0,f.useState)(!1);return(0,f.useEffect)(()=>{q(T)},[T]),(0,r.jsxs)(E.Z,{className:on()(x.drawer,{[x.drawerOpen]:$}),children:[(0,r.jsx)(Je.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,S;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:(S=(u=s.palette.navigation.navItem)===null||u===void 0?void 0:u.hoverBackground)!==null&&S!==void 0?S:"#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":q="page",...Q},fe){let{pathname:ge}=(0,er.TH)(),{pathname:Ue}=(0,er.WU)(s);T||(ge=ge.toLocaleLowerCase("en-US"),Ue=Ue.toLocaleLowerCase("en-US"));let Pe=ge===Ue;!Pe&&!l&&(Pe=ge.startsWith(`${Ue}/`));const Ve=Pe?q:void 0;return(0,r.jsx)(k.rU,{...Q,to:s,ref:fe,"aria-current":Ve,style:{...u,...Pe?x:void 0},className:on()([g,Pe?$:void 0])})}),Ze=(0,f.forwardRef)((e,s)=>{const{icon:l,text:u,hasNotifications:g=!1,hasSubmenu:x=!1,disableHighlight:T=!1,onClick:$,noTrack:q,children:Q,className:fe,...ge}=e,{sidebarConfig:Ue}=(0,f.useContext)(Rr),Pe=Z(Ue),{isOpen:Ve}=Ks(),pt=!Ve&&x?{display:"flex",marginLeft:"20px"}:{lineHeight:"0"},at=(0,r.jsxs)(E.Z,{style:pt,children:[(0,r.jsx)(l,{fontSize:"small"}),!Ve&&x?(0,r.jsx)(oi.Z,{fontSize:"small"}):(0,r.jsx)(r.Fragment,{})]}),Wt=(0,r.jsx)(ri.Z,{color:"secondary",variant:"dot",overlap:"circular",invisible:!g,className:on()({[Pe.closedItemIcon]:!Ve}),children:at}),$n=(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(E.Z,{"data-testid":"login-button",className:Pe.iconContainer,children:Wt}),u&&(0,r.jsx)(Je.Z,{variant:"subtitle2",component:"span",className:Pe.label,children:u}),(0,r.jsx)("div",{className:Pe.secondaryAction,children:Q})]}),Vn=Ve?$n:Wt,kt={onClick:$,className:on()(fe,Pe.root,Ve?Pe.open:Pe.closed,me(e)&&Pe.buttonItem,{[Pe.highlightable]:!T})},en=(0,p.z$)(),{pathname:vn}=(0,er.WU)(!me(e)&&e.to?e.to:""),Un=(0,f.useCallback)(Mn=>{var ir;if(!q){const br="click",Qr=u!=null?u:"Sidebar Item",kr=vn?{attributes:{to:vn}}:void 0;en.captureEvent(br,Qr,kr)}(ir=$)===null||ir===void 0||ir(Mn)},[en,u,vn,q,$]);return me(e)?(0,r.jsx)(ye.Z,{role:"button","aria-label":u,...kt,ref:s,onClick:Un,children:Vn}):(0,r.jsx)(Te,{...kt,activeClassName:Pe.selected,to:e.to?e.to:"",ref:s,"aria-label":u||e.to,...ge,onClick:Un,children:Vn})}),Ge=({children:e,...s})=>{const{sidebarConfig:l}=(0,f.useContext)(Rr),u=Z(l),[g,x]=(0,f.useState)(!1),T=(0,er.TH)(),$=oe(e,T),q=(0,Se.Z)(Ue=>Ue.breakpoints.down("sm")),Q=()=>{x(!0)},fe=()=>{x(!1)},ge=()=>q?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)(Ze,{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)(Ge,{...e,children:l}):(0,r.jsx)(Ze,{...e,ref:s})});function qt(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())},q=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:q,onKeyDown:$,className:g.searchContainer,InputProps:{disableUnderline:!0,className:g.searchField},inputProps:{className:g.searchFieldHTMLInput}})})})}const Ht=(0,Uo.Z)("div")({flex:1},{name:"BackstageSidebarSpace"}),nr=(0,Uo.Z)("div")({height:8},{name:"BackstageSidebarSpacer"}),Ur=(0,Uo.Z)("hr")(({theme:e})=>({height:1,width:"100%",background:"#383838",border:"none",margin:e.spacing(1.2,0)}),{name:"BackstageSidebarDivider"}),pr=e=>({overflowY:"auto","&::-webkit-scrollbar":{backgroundColor:e.palette.background.default,width:"5px",borderRadius:"5px"},"&::-webkit-scrollbar-thumb":{backgroundColor:e.palette.text.secondary,borderRadius:"5px"}}),yr=(0,Uo.Z)("div")(({theme:e})=>{const s=pr(e);return{flex:"0 1 auto",overflowX:"hidden",width:"calc(100% - 5px)",minHeight:"48px",overflowY:"hidden","@media (hover: none)":s,"&:hover":s}}),xr=()=>{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,{})})})},Zn=(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=Zn({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,On="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}))},q=()=>{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:On,onDismiss:q})]}):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)(le.r,{to:s,children:e}),(0,r.jsx)(Je.Z,{children:u})]}):(0,r.jsx)(Je.Z,{className:l.type,children:e}):null,io=({pageTitle:e,classes:s,tooltip:l})=>{const{contentRef:u}=oa(),g=(0,r.jsx)(Je.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)(Je.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:q}=e,Q=bo(),ge=(0,p.h_)(p.Ds).getOptionalString("app.title")||"Backstage",Ue=l||x,Pe=x||l,Ve=`${Ue} | %s | ${ge}`,pt=`${Ue} | ${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)(E.Z,{className:Q.leftItemsBox,children:[(0,r.jsx)(pa,{classes:Q,type:$,typeLink:q,pageTitle:Pe}),(0,r.jsx)(io,{classes:Q,pageTitle:Pe,tooltip:T}),(0,r.jsx)(fa,{classes:Q,subtitle:g})]}),(0,r.jsx)(Vt.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,ln.Fq)(e.page.fontColor,.8),fontSize:e.typography.fontSize,lineHeight:1}}),{name:"BackstageHeaderLabel"}),al=({value:e,className:s})=>(0,r.jsx)(Je.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)(Vt.Z,{item:!0,children:(0,r.jsxs)(Je.Z,{component:"span",className:g.root,children:[(0,r.jsx)(Je.Z,{className:g.label,children:s}),u?(0,r.jsx)(le.r,{to:u,children:x}):x]})})}const cl=e=>(0,qn.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)(E.Z,{className:g.root,children:[l&&(0,r.jsx)(Je.Z,{variant:"subtitle2",component:"h3",children:l}),s&&(0,r.jsx)(Je.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:q,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:q,color:"primary",children:$}),Q&&_jsx(LinkButton,{to:Q,color:"primary",children:$})]})]})}const hl=e=>(0,qn.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)(E.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)(Vt.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),q=(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(),q.post(new lo.SP("Login failed",fe))}};return(0,r.jsx)(ga,{children:(0,r.jsx)(Zr,{variant:"fullHeight",title:x,actions:(0,r.jsx)(ye.Z,{color:"primary",variant:"outlined",onClick:Q,children:"Sign In"}),children:(0,r.jsx)(Je.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)(Zr,{title:"Guest",variant:"fullHeight",actions:(0,r.jsx)(ye.Z,{color:"primary",variant:"outlined",onClick:()=>{e(),s(new ma)},children:"Enter"}),children:(0,r.jsxs)(Je.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,q=({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)(Zr,{title:"Custom User",variant:"fullHeight",children:[(0,r.jsxs)(Je.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(q),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)(ye.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(q=>{s(IdentityApiSignOutProxy.from({identityApi:q,signOut:async()=>{var Q,fe;localStorage.removeItem(Mo),await((Q=(fe=q).signOut)===null||Q===void 0?void 0:Q.call(fe))}}))},[s]);useLayoutEffect(()=>{var q;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,(q=fe.config)===null||q===void 0?void 0:q.apiRef).then(Ue=>{if(ge){localStorage.removeItem(Mo);return}Ue?T(Ue):x(!1)}).catch(Ue=>{localStorage.removeItem(Mo),!ge&&(l.post(Ue),x(!1))}),()=>{ge=!0}},[g,l,s,u,e,T]);const $=useMemo(()=>Object.keys(e).map(q=>{const Q=e[q],{Component:fe}=Q.components,ge=Ve=>{T(Ve)},Ue=()=>{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)},Pe=()=>{localStorage.removeItem(Mo)};return _jsx(fe,{config:Q.config,onSignInStarted:Ue,onSignInSuccess:ge,onSignInFailure:Pe},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),[$,q]=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:q})]})]})},Pl=({provider:e,auto:s,onSignInSuccess:l})=>{const u=useStyles(),g=useApi(e.apiRef),x=useApi(configApiRef),[T,$]=useState(),[q,Q]=useState(!1),fe=async({checkExisting:ge,showPopup:Ue})=>{try{let Pe;if(ge&&(Pe=await g.getBackstageIdentity({optional:!0})),!Pe&&(Ue||s)&&(Q(!0),Pe=await g.getBackstageIdentity({instantPopup:!0}),!Pe))throw new Error(`The ${e.title} provider is not configured to support sign-in`);if(!Pe){Q(!0);return}const Ve=await g.getProfile();l(UserIdentity.create({identity:Pe.identity,authApi:g,profile:Ve}))}catch(Pe){$(Pe),Q(!0)}};return useMountEffect(()=>fe({checkExisting:!0})),q?_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,Fn.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,q=Ll(),[Q,fe]=useState(0),ge=$||((Ve,pt)=>fe(pt));let Ue;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;Ue=(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;Ue=(at=Ve)===null||at===void 0?void 0:at.props.children}});const Pe=l||(s?{slackChannel:s}:{});return _jsx(Card,{children:_jsxs(ErrorBoundary,{...Pe,children:[g&&_jsx(Ol,{title:g}),_jsx(Tabs,{selectionFollowsFocus:!0,classes:q,value:T||Q,onChange:ge,children:u}),_jsx(Divider,{}),_jsx(CardContent,{children:Ue}),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(Lt,Le,n){"use strict";n.d(Le,{fC:function(){return m},CL:function(){return Rt},sM:function(){return se},$v:function(){return Se},v_:function(){return k},hg:function(){return Ke},uB:function(){return xe},R5:function(){return et},bq:function(){return I},Km:function(){return U},Ds:function(){return yt},ni:function(){return E},T0:function(){return D},CO:function(){return sn},x8:function(){return fn},rx:function(){return Ln},YO:function(){return Nn},P4:function(){return Rn},NT:function(){return Ct},NW:function(){return $t},VE:function(){return zt},W0:function(){return Dt},gP:function(){return Yt},IY:function(){return vt},F4:function(){return ne},ux:function(){return K},Kp:function(){return ie},$4:function(){return ct},p_:function(){return R},ZM:function(){return ut},D:function(){return X},gW:function(){return w},E6:function(){return St},z$:function(){return Ne},h_:function(){return ye},I_:function(){return F},qD:function(){return Ye},vJ:function(){return Gn},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 be=(0,W.useContext)(f);if(be===void 0)return{routeRef:"unknown",pluginId:"root",extension:"App"};const pe=be.atVersion(1);if(pe===void 0)throw new Error("No context found for version 1.");return pe},m=be=>{const{attributes:pe,children:Ie}=be,N={...V(),...pe},ce=(0,p.EI)({1:N});return(0,r.jsx)(f.Provider,{value:ce,children:Ie})};function h(be,pe){const Ie=H=>_jsx(m,{attributes:pe,children:_jsx(be,{...H})});return Ie.displayName=`WithAnalyticsContext(${be.displayName||be.name||"Component"})`,Ie}function F(){const be=(0,p.Vt)("api-context");if(!be)throw new Error("API context is not available");const pe=be.atVersion(1);if(!pe)throw new Error("ApiContext v1 not available");return pe}function ye(be){const Ie=F().get(be);if(!Ie)throw new Error(`No implementation available for ${be}`);return Ie}function le(be){return function(Ie){const H=ce=>{const Ae=F(),$e={};for(const qe in be)if(be.hasOwnProperty(qe)){const It=be[qe],Bt=Ae.get(It);if(!Bt)throw new Error(`No implementation available for ${It}`);$e[qe]=Bt}return _jsx(Ie,{...ce,...$e})},N=Ie.displayName||Ie.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(be){return new de(be)}function E(be,pe){return"id"in be?{api:be,deps:{},factory:()=>pe}:be}var se;(function(be){be.SignedIn="SignedIn",be.SignedOut="SignedOut"})(se||(se={}));const ie=D({id:"core.auth.google"}),ne=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"}),Ke=D({id:"core.apptheme"}),yt=D({id:"core.config"}),$t=D({id:"core.discovery"}),zt=D({id:"core.error"});var Rt;(function(be){be[be.None=0]="None",be[be.Active=1]="Active"})(Rt||(Rt={}));const Dt=D({id:"core.featureflags"}),Yt=D({id:"core.fetch"}),ct=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 Gt{setContext(pe){this.context=pe}captureEvent(pe,Ie,{value:H,attributes:N}={}){const{_routeNodeType:ce,...Ae}=this.context;if(pe===Zt){lt.mostRecentGatheredNavigation&&(lt.mostRecentRoutableExtensionRender={context:{...Ae,extension:"App"}});return}if(lt.mostRecentGatheredNavigation){try{this.analyticsApi.captureEvent({...lt.mostRecentGatheredNavigation,...lt.mostRecentRoutableExtensionRender})}catch($e){console.warn("Error during analytics event capture. %o",$e)}lt.mostRecentGatheredNavigation=void 0,lt.mostRecentRoutableExtensionRender=void 0}if(pe==="navigate"&&ce==="gathered"&&Ae.pluginId==="root"){lt.mostRecentGatheredNavigation={action:pe,subject:Ie,value:H,attributes:N,context:Ae};return}try{this.analyticsApi.captureEvent({action:pe,subject:Ie,value:H,attributes:N,context:Ae})}catch($e){console.warn("Error during analytics event capture. %o",$e)}}constructor(pe,Ie={routeRef:"unknown",pluginId:"root",extension:"App"}){(0,z._)(this,"analyticsApi",void 0),(0,z._)(this,"context",void 0),this.analyticsApi=pe,this.context=Ie,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 ye(k)}catch{return{captureEvent:()=>{}}}}function Ne(){const be=(0,W.useRef)(null),pe=V(),Ie=Ce();function H(){return be.current===null&&(be.current=new Gt(Ie)),be.current}const N=H();return N.setContext(pe),N}const Ye=()=>{const be=(0,p.Vt)("app-context");if(!be)throw new Error("App context is not available");const pe=be.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 et(be,pe,Ie){const H=be;var N;let ce=(N=H[rt])!==null&&N!==void 0?N:ht.get(be);if(ce||(ce={map:new Map},Object.defineProperty(H,rt,{enumerable:!1,configurable:!0,writable:!1,value:ce}),ht.set(be,ce)),ce.map.has(pe)){const Ae=be.displayName||be.name;throw new Error(`Attempted to attach duplicate data "${pe}" to component "${Ae}"`)}ce.map.set(pe,Ie)}function vt(be,pe){if(!be)return;const Ie=be.type;if(!Ie)return;var H;const N=(H=Ie[rt])!==null&&H!==void 0?H:ht.get(Ie);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,Ie){(0,z._)(this,"id",void 0),(0,z._)(this,"params",void 0),(0,z._)(this,ft,void 0),this.id=pe,this.params=Ie,this[Qe]="absolute"}}function Ct(be){var pe;return new gt(be.id,(pe=be.params)!==null&&pe!==void 0?pe:[])}const yn=/^\w+$/;let hn=null,cn=null;class Sn{toString(){return`routeRef{type=sub,id=${this.id}}`}constructor(pe,Ie,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,cn,void 0),this.id=pe,this.path=Ie,this.parent=H,this.params=N,this[hn]="sub"}}function pn(be){const{id:pe,path:Ie,parent:H}=be,N=Ie.split("/").filter($e=>$e.startsWith(":")).map($e=>$e.substring(1)),ce=[...H.params,...N];if(H.params.some($e=>N.includes($e)))throw new Error("SubRouteRef may not have params that overlap with its parent");if(!Ie.startsWith("/"))throw new Error(`SubRouteRef path must start with '/', got '${Ie}'`);if(Ie.endsWith("/"))throw new Error(`SubRouteRef path must not end with '/', got '${Ie}'`);for(const $e of N)if(!yn.test($e))throw new Error(`SubRouteRef path has invalid param, got '${$e}'`);return new Sn(pe,Ie,H,ce)}let xn=ot,Cn=xn;class on{toString(){return`routeRef{type=external,id=${this.id}}`}constructor(pe,Ie,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=Ie,this.optional=H,this[xn]="external"}}function fn(be){var pe;return new on(be.id,(pe=be.params)!==null&&pe!==void 0?pe:[],Boolean(be.optional))}var wn=n(73557);function _e(be){const{pathname:pe}=(0,wn.TH)(),Ie=(0,p.Vt)("routing-context");if(!Ie)throw new Error("Routing context is not available");const H=Ie.atVersion(1),N=(0,W.useMemo)(()=>H&&H.resolve(be,{pathname:pe}),[H,be,pe]);if(!Ie)throw new Error("useRouteRef used outside of routing context");if(!H)throw new Error("RoutingContext v1 not available");const ce="optional"in be&&be.optional;if(!N&&!ce)throw new Error(`No path for ${be}`);return N}function Jt(be){return(0,wn.UO)()}class Vt extends W.Component{static getDerivedStateFromError(pe){return{error:pe}}render(){const{error:pe}=this.state,{app:Ie,plugin:H}=this.props,{ErrorBoundaryFallback:N}=Ie.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 Je=n(64355);function Rn(be){const{component:pe,mountPoint:Ie,name:H}=be;return Nn({component:{lazy:()=>pe().then(N=>{const ce=$e=>{const qe=Ne();try{_e(Ie)}catch(It){if(typeof It=="object"&&It!==null){const{message:Bt}=It;if(typeof Bt=="string"&&Bt.startsWith("No path for "))throw new Error(`Routable extension component with mount point ${Ie} 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 It}return(0,W.useEffect)(()=>{qe.captureEvent(Zt,"")},[qe]),(0,r.jsx)(N,{...$e})},Ae=H||N.displayName||N.name||"LazyComponent";return ce.displayName=`RoutableExtension(${Ae})`,ce},N=>Ae=>{const $e=Ye(),{BootErrorPage:qe}=$e.getComponents();return(0,r.jsx)(qe,{step:"load-chunk",error:N})})},data:{"core.mountPoint":Ie},name:H})}function sn(be){const{component:pe,name:Ie}=be;return Nn({component:pe,name:Ie})}function Nn(be){const{data:pe={},name:Ie}=be;Ie||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 be.component){const ce=be.component.lazy;H=(0,W.lazy)(()=>ce().then(Ae=>({default:Ae})))}else H=be.component.sync;const N=Ie||H.displayName||H.name||"Component";return{expose(ce){const Ae=$e=>{var qe;const It=Ye(),{Progress:Bt}=It.getComponents(),nn=(qe=pe)===null||qe===void 0?void 0:qe["core.mountPoint"];return(0,r.jsx)(W.Suspense,{fallback:(0,r.jsx)(Bt,{}),children:(0,r.jsx)(Vt,{app:It,plugin:ce,children:(0,r.jsx)(m,{attributes:{pluginId:ce.getId(),...Ie&&{extension:Ie},...nn&&{routeRef:nn.id}},children:(0,r.jsx)(Je.o,{plugin:ce,children:(0,r.jsx)(H,{...$e})})})})})};et(Ae,"core.plugin",ce),et(Ae,"core.extensionName",Ie);for(const[$e,qe]of Object.entries(pe))et(Ae,$e,qe);return Ae.displayName=`Extension(${N})`,Ae}}}function In(be,pe,Ie,H){return W.Children.toArray(be).flatMap(N=>{if(!(0,W.isValidElement)(N))return[];if(N.type===W.Fragment)return In(N.props.children,pe,Ie,H);if(vt(N,"core.featureFlagged")){const ce=N.props;return("with"in ce?pe.isActive(ce.with):!pe.isActive(ce.without))?In(N.props.children,pe,Ie,H):[]}if(Ie===void 0||Ie(N))return[N];if(H)throw new Error(H);return In(N.props.children,pe,Ie,H)})}class Pn{selectByComponentData(pe){const Ie=In(this.node,this.featureFlagsApi,H=>vt(H,pe.key)!==void 0,pe.withStrictError);return new Pn(Ie,this.featureFlagsApi)}findComponentData(pe){return In(this.node,this.featureFlagsApi,H=>vt(H,pe.key)!==void 0).map(H=>vt(H,pe.key)).filter(H=>H!==void 0)}getElements(){return In(this.node,this.featureFlagsApi)}constructor(pe,Ie){(0,z._)(this,"node",void 0),(0,z._)(this,"featureFlagsApi",void 0),this.node=pe,this.featureFlagsApi=Ie}}function Gn(be,pe,Ie=[]){const H=ye(Dt),N=new Pn(be,H);return(0,W.useMemo)(()=>pe(N),[be,...Ie])}class Kn{getId(){return this.config.id}getApis(){var pe;return(pe=this.config.apis)!==null&&pe!==void 0?pe:[]}getFeatureFlags(){var pe,Ie;return(Ie=(pe=this.config.featureFlags)===null||pe===void 0?void 0:pe.slice())!==null&&Ie!==void 0?Ie:[]}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 Ln(be){return new Kn(be)}},64355:function(Lt,Le,n){"use strict";n.d(Le,{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:ye}=h,{Provider:le}=(0,p.CT)(f);return(0,r.jsx)(le,{value:(0,p.EI)({1:{plugin:ye}}),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(Lt,Le,n){"use strict";n.d(Le,{SP:function(){return ne},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 ye extends null{constructor(...w){super(...w),_define_property(this,"name","InputError")}}class le 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 E 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 ne 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(Lt,Le,n){"use strict";n.d(Le,{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 ye{static createDefaultApiFactory(){return createApiFactory({api:scmAuthApiRef,deps:{github:githubAuthApiRef,gitlab:gitlabAuthApiRef,azure:microsoftAuthApiRef,bitbucket:bitbucketAuthApiRef},factory:({github:X,gitlab:K,azure:R,bitbucket:w})=>ye.merge(ye.forGithub(X),ye.forGitlab(K),ye.forAzure(R),ye.forBitbucket(w))})}static forAuthApi(X,K){return new ye("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 ye("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 ye("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 ye("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 ye("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 le=n(40556);class z{static fromConfig(X){return le.Lx.fromConfig(X)}}const de=(0,r.T0)({id:"integration.scmintegrations"});var D=n(52322),E=n(73250),se=n(2784);const ie=ne=>{const{type:X}=ne,K=(0,r.qD)(),R=E.Z;var w;const I=X&&(w=K.getSystemIcon(X))!==null&&w!==void 0?w:R;return(0,D.jsx)(I,{})}},40556:function(Lt,Le,n){"use strict";n.d(Le,{Lx:function(){return Nr},BT:function(){return xt}});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(b){try{const A=typeof b=="string"?new URL(b):b;return C.find(J=>c(J)===A.host)}catch{return}},byHost(b){return C.find(A=>c(A)===b)}}}function F(C){const{url:c,base:b,lineNumber:A}=C;try{return new URL(c),c}catch{}let J;if(c.startsWith("/")){const{filepath:ve}=W()(b);J=new URL(b);const je=(0,f.trimEnd)(J.pathname.substring(0,J.pathname.length-ve.length),"/");J.pathname=`${je}${c}`}else J=new URL(c,b);return J.search=new URL(b).search,A&&(J.hash=`L${A}`),J.toString()}function ye(C){beforeAll(()=>C.listen({onUnhandledRequest:"error"})),afterAll(()=>C.close()),afterEach(()=>C.resetHandlers())}const le="amazonaws.com";function z(C){const c=C.getOptionalString("endpoint");var b;const A=(b=C.getOptionalBoolean("s3ForcePathStyle"))!==null&&b!==void 0?b:!1;let J,ve;if(c){try{const an=new URL(c);J=an.host,ve=an.pathname}catch{throw new Error(`invalid awsS3 integration config, endpoint '${c}' is not a valid URL`)}if(ve!=="/")throw new Error(`invalid awsS3 integration config, endpoints cannot contain path, got '${c}'`)}else J=le;const je=C.getOptionalString("accessKeyId"),ke=C.getOptionalString("secretAccessKey"),nt=C.getOptionalString("roleArn"),_t=C.getOptionalString("externalId");return{host:J,endpoint:c,s3ForcePathStyle:A,accessKeyId:je,secretAccessKey:ke,roleArn:nt,externalId:_t}}function de(C){const c=C.map(z);return c.some(b=>b.host===le)||c.push({host:le}),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 b=de((c=C.getOptionalConfigArray("integrations.awsS3"))!==null&&c!==void 0?c:[]);return h(b.map(A=>new D(A)),A=>A.config.host)});var E=n(88412),se=n(50629),ie=n(80956);const ne="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 b=new URL(c);let A,J,ve;const je=b.pathname.split("/").map(En=>decodeURIComponent(En));if(je[2]==="_git"?(A=je[1],J=ve=je[3]):je[3]==="_git"?(A=je[1],J=je[2],ve=je[4]):je[4]==="_git"&&(A=`${je[1]}/${je[2]}`,J=je[3],ve=je[5]),!A||!J||!ve)throw new Error("Azure URL must point to a git repository");var ke;const nt=(ke=b.searchParams.get("path"))!==null&&ke!==void 0?ke:void 0;let _t;const an=b.searchParams.get("version");if(an){if(an.slice(0,2)!=="GB")throw new Error("Azure URL version must point to a git branch");_t=an.slice(2)}return new Se(b.origin,A,J,ve,nt,_t)}toRepoUrl(){let c;return(0,E._)(this,R)===(0,E._)(this,w)?c=(0,E._)(this,xe).call(this,(0,E._)(this,K),"_git",(0,E._)(this,w)):c=(0,E._)(this,xe).call(this,(0,E._)(this,K),(0,E._)(this,R),"_git",(0,E._)(this,w)),(0,E._)(this,I)&&c.searchParams.set("path",(0,E._)(this,I)),(0,E._)(this,U)&&c.searchParams.set("version",ne+(0,E._)(this,U)),c.toString()}toFileUrl(){if(!(0,E._)(this,I))throw new Error("Azure URL must point to a specific path to be able to download a file");const c=(0,E._)(this,xe).call(this,(0,E._)(this,K),(0,E._)(this,R),"_apis","git","repositories",(0,E._)(this,w),"items");return c.searchParams.set("api-version","6.0"),c.searchParams.set("path",(0,E._)(this,I)),(0,E._)(this,U)&&c.searchParams.set("version",(0,E._)(this,U)),c.toString()}toArchiveUrl(){const c=(0,E._)(this,xe).call(this,(0,E._)(this,K),(0,E._)(this,R),"_apis","git","repositories",(0,E._)(this,w),"items");return c.searchParams.set("recursionLevel","full"),c.searchParams.set("download","true"),c.searchParams.set("api-version","6.0"),(0,E._)(this,I)&&c.searchParams.set("scopePath",(0,E._)(this,I)),(0,E._)(this,U)&&c.searchParams.set("version",(0,E._)(this,U)),c.toString()}toCommitsUrl(){const c=(0,E._)(this,xe).call(this,(0,E._)(this,K),(0,E._)(this,R),"_apis","git","repositories",(0,E._)(this,w),"commits");return c.searchParams.set("api-version","6.0"),(0,E._)(this,U)&&c.searchParams.set("searchCriteria.itemVersion.version",(0,E._)(this,U)),c.toString()}getOwner(){return(0,E._)(this,K)}getProject(){return(0,E._)(this,R)}getRepo(){return(0,E._)(this,w)}getPath(){return(0,E._)(this,I)}getRef(){return(0,E._)(this,U)}constructor(c,b,A,J,ve,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:(...ke)=>{const nt=new URL((0,E._)(this,X));return nt.pathname=ke.map(_t=>encodeURIComponent(_t)).join("/"),nt}}),(0,ie._)(this,X,c),(0,ie._)(this,K,b),(0,ie._)(this,R,A),(0,ie._)(this,w,J),(0,ie._)(this,I,ve),(0,ie._)(this,U,je)}}const k="dev.azure.com",Ke=C=>{const c=C;return Object.keys(C).length===3&&c.clientId!==void 0&&c.clientSecret!==void 0&&c.tenantId!==void 0},yt=C=>Object.keys(C).length===1&&C.clientId!==void 0;function $t(C){var c;const b=(c=C.getOptionalString("host"))!==null&&c!==void 0?c:k,A=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(b))throw new Error(`Invalid Azure integration config, '${b}' is not a valid host`);if(J&&!Ke(J)&&!yt(J))throw new Error("Invalid Azure integration config, credential is not valid");if(J&&b!==k)throw new Error(`Invalid Azure integration config, credential can only be used with ${k}`);if(J&&A)throw new Error("Invalid Azure integration config, specify either a token or a credential but not both");return{host:b,token:A,credential:J}}function zt(C){const c=C.map($t);return c.some(b=>b.host===k)||c.push({host:k}),c}class Rt{get type(){return"azure"}get title(){return this.integrationConfig.host}get config(){return this.integrationConfig}resolveUrl(c){const{url:b,base:A}=c;if(m(b))return b;try{const ve=Se.fromRepoUrl(A),je=new URL(A);var J;const ke=new URL(`https://a.com${(J=ve.getPath())!==null&&J!==void 0?J:""}`),nt=new URL(b,ke).pathname;return je.searchParams.set("path",nt),c.lineNumber&&(je.searchParams.set("line",String(c.lineNumber)),je.searchParams.set("lineEnd",String(c.lineNumber+1)),je.searchParams.set("lineStartColumn","1"),je.searchParams.set("lineEndColumn","1")),je.toString()}catch{return new URL(b,A).toString()}}resolveEditUrl(c){return c}constructor(c){(0,r._)(this,"integrationConfig",void 0),this.integrationConfig=c}}(0,r._)(Rt,"factory",({config:C})=>{var c;const b=zt((c=C.getOptionalConfigArray("integrations.azure"))!==null&&c!==void 0?c:[]);return h(b.map(A=>new Rt(A)),A=>A.config.host)});var Dt=n(48834).lW;function Yt(C){return AzureUrl.fromRepoUrl(C).toFileUrl()}function ct(C){return AzureUrl.fromRepoUrl(C).toArchiveUrl()}function ut(C){return AzureUrl.fromRepoUrl(C).toCommitsUrl()}async function St(C,c){const b="499b84ac-1321-427f-aa17-267ca6975798/.default",A=c?{...c}:{},{token:J,credential:ve}=C;if(ve){if(isAzureClientSecretCredential(ve)){const ke=await new ClientSecretCredential(ve.tenantId,ve.clientId,ve.clientSecret).getToken(b);A.Authorization=`Bearer ${ke.token}`}else if(isAzureManagedIdentityCredential(ve)){const ke=await new ManagedIdentityCredential(ve.clientId).getToken(b);A.Authorization=`Bearer ${ke.token}`}}else if(J){const je=Dt.from(`:${C.token}`,"utf8");A.Authorization=`Basic ${je.toString("base64")}`}return{headers:A}}const lt="bitbucket.org",Zt="https://api.bitbucket.org/2.0";function Gt(C){var c;const b=(c=C.getOptionalString("host"))!==null&&c!==void 0?c:lt;let A=C.getOptionalString("apiBaseUrl");const J=C.getOptionalString("token"),ve=C.getOptionalString("username"),je=C.getOptionalString("appPassword");if(!V(b))throw new Error(`Invalid Bitbucket integration config, '${b}' is not a valid host`);return A?A=(0,f.trimEnd)(A,"/"):b===lt?A=Zt:A=`https://${b}/rest/api/1.0`,{host:b,apiBaseUrl:A,token:J,username:ve,appPassword:je}}function Ce(C){const c=C.map(Gt);return c.some(b=>b.host===lt)||c.push({host:lt,apiBaseUrl:Zt}),c}class Ne{get type(){return"bitbucket"}get title(){return this.integrationConfig.host}get config(){return this.integrationConfig}resolveUrl(c){const b=F(c);if(!c.lineNumber)return b;const A=new URL(b);return this.integrationConfig.host==="bitbucket.org"?A.hash=`lines-${c.lineNumber}`:A.hash=`${c.lineNumber}`,A.toString()}resolveEditUrl(c){const b=W()(c),A=new URL(c);return A.searchParams.set("mode","edit"),A.searchParams.set("spa","0"),A.searchParams.set("at",b.ref),A.toString()}constructor(c){(0,r._)(this,"integrationConfig",void 0),this.integrationConfig=c}}(0,r._)(Ne,"factory",({config:C})=>{var c,b,A;const J=Ce((A=C.getOptionalConfigArray("integrations.bitbucket"))!==null&&A!==void 0?A:[...(c=C.getOptionalConfigArray("integrations.bitbucketCloud"))!==null&&c!==void 0?c:[],...(b=C.getOptionalConfigArray("integrations.bitbucketServer"))!==null&&b!==void 0?b:[]]);return h(J.map(ve=>new Ne(ve)),ve=>ve.config.host)});var Ye=n(96279),ht=n(48834).lW;async function rt(C,c){const{name:b,owner:A,resource:J}=parseGitUrl(C),ve=J==="bitbucket.org";let je=ve?`${c.apiBaseUrl}/repositories/${A}/${b}`:`${c.apiBaseUrl}/projects/${A}/repos/${b}/default-branch`,ke=await fetch(je,ot(c));if(ke.status===404&&!ve&&(je=`${c.apiBaseUrl}/projects/${A}/repos/${b}/branches/default`,ke=await fetch(je,ot(c))),!ke.ok){const _t=`Failed to retrieve default branch from ${je}, ${ke.status} ${ke.statusText}`;throw new Error(_t)}let nt;if(ve)nt=(await ke.json()).mainbranch.name;else{const{displayId:_t}=await ke.json();nt=_t}if(!nt)throw new Error(`Failed to read default branch from ${je}. Response ${ke.status} ${ke.json()}`);return nt}async function et(C,c){const{name:b,owner:A,ref:J,protocol:ve,resource:je,filepath:ke}=parseGitUrl(C),nt=je==="bitbucket.org";let _t=J;_t||(_t=await rt(C,c));const an=ke?`&path=${encodeURIComponent(decodeURIComponent(ke))}`:"";return nt?`${ve}://${je}/${A}/${b}/get/${_t}.tar.gz`:`${c.apiBaseUrl}/projects/${A}/repos/${b}/archive?format=tgz&at=${_t}&prefix=${A}-${b}${an}`}function vt(C,c){try{const{owner:b,name:A,ref:J,filepathtype:ve,filepath:je}=parseGitUrl(C);if(!b||!A||ve!=="browse"&&ve!=="raw"&&ve!=="src")throw new Error("Invalid Bitbucket URL or file path");const ke=je.replace(/^\//,"");if(c.host==="bitbucket.org"){if(!J)throw new Error("Invalid Bitbucket URL or file path");return`${c.apiBaseUrl}/repositories/${b}/${A}/src/${J}/${ke}`}return`${c.apiBaseUrl}/projects/${b}/repos/${A}/raw/${ke}?at=${J}`}catch(b){throw new Error(`Incorrect URL: ${C}, ${b}`)}}function ot(C){const c={};if(C.token)c.Authorization=`Bearer ${C.token}`;else if(C.username&&C.appPassword){const b=ht.from(`${C.username}:${C.appPassword}`,"utf8");c.Authorization=`Basic ${b.toString("base64")}`}return{headers:c}}const Qe="bitbucket.org",ft="https://api.bitbucket.org/2.0";function gt(C){const c=Qe,b=ft,A=C.getString("username"),J=C.getString("appPassword");return{host:c,apiBaseUrl:b,username:A,appPassword:J}}function Ct(C){const c=C.map(gt);return c.length===0&&c.push({host:Qe,apiBaseUrl:ft}),c}class yn{get type(){return"bitbucketCloud"}get title(){return this.integrationConfig.host}get config(){return this.integrationConfig}resolveUrl(c){const b=F(c);if(c.lineNumber){const A=new URL(b);return A.hash=`lines-${c.lineNumber}`,A.toString()}return b}resolveEditUrl(c){const b=W()(c),A=new URL(c);return A.searchParams.set("mode","edit"),A.searchParams.set("at",b.ref),A.toString()}constructor(c){(0,r._)(this,"integrationConfig",void 0),this.integrationConfig=c}}(0,r._)(yn,"factory",({config:C})=>{var c;const b=Ct((c=C.getOptionalConfigArray("integrations.bitbucketCloud"))!==null&&c!==void 0?c:[]);return h(b.map(A=>new yn(A)),A=>A.config.host)});var hn=n(48834).lW;async function cn(C,c){const{name:b,owner:A}=parseGitUrl(C),J=`${c.apiBaseUrl}/repositories/${A}/${b}`,ve=await fetch(J,xn(c));if(!ve.ok){const nt=`Failed to retrieve default branch from ${J}, ${ve.status} ${ve.statusText}`;throw new Error(nt)}const ke=(await ve.json()).mainbranch.name;if(!ke)throw new Error(`Failed to read default branch from ${J}. Response ${ve.status} ${ve.json()}`);return ke}async function Sn(C,c){const{name:b,owner:A,ref:J,protocol:ve,resource:je}=parseGitUrl(C);let ke=J;return ke||(ke=await cn(C,c)),`${ve}://${je}/${A}/${b}/get/${ke}.tar.gz`}function pn(C,c){try{const{owner:b,name:A,ref:J,filepathtype:ve,filepath:je}=parseGitUrl(C);if(!b||!A||ve!=="src"&&ve!=="raw")throw new Error("Invalid Bitbucket Cloud URL or file path");const ke=je.replace(/^\//,"");if(!J)throw new Error("Invalid Bitbucket Cloud URL or file path");return`${c.apiBaseUrl}/repositories/${b}/${A}/src/${J}/${ke}`}catch(b){throw new Error(`Incorrect URL: ${C}, ${b}`)}}function xn(C){const c={};if(C.username&&C.appPassword){const b=hn.from(`${C.username}:${C.appPassword}`,"utf8");c.Authorization=`Basic ${b.toString("base64")}`}return{headers:c}}function Cn(C){const c=C.getString("host");let b=C.getOptionalString("apiBaseUrl");const A=C.getOptionalString("token"),J=C.getOptionalString("username"),ve=C.getOptionalString("password");if(!V(c))throw new Error(`Invalid Bitbucket Server integration config, '${c}' is not a valid host`);return b?b=(0,f.trimEnd)(b,"/"):b=`https://${c}/rest/api/1.0`,{host:c,apiBaseUrl:b,token:A,username:J,password:ve}}function on(C){return C.map(Cn)}class fn{get type(){return"bitbucketServer"}get title(){return this.integrationConfig.host}get config(){return this.integrationConfig}resolveUrl(c){const b=F(c);if(c.lineNumber){const A=new URL(b);return A.hash=c.lineNumber.toString(),A.toString()}return b}resolveEditUrl(c){return c.includes("?")?c.substring(0,c.indexOf("?")):c}constructor(c){(0,r._)(this,"integrationConfig",void 0),this.integrationConfig=c}}(0,r._)(fn,"factory",({config:C})=>{var c;const b=on((c=C.getOptionalConfigArray("integrations.bitbucketServer"))!==null&&c!==void 0?c:[]);return h(b.map(A=>new fn(A)),A=>A.config.host)});var wn=n(48834).lW;async function _e(C,c){const{name:b,owner:A}=parseGitUrl(C);let J=`${c.apiBaseUrl}/projects/${A}/repos/${b}/default-branch`,ve=await fetch(J,Je(c));if(ve.status===404&&(J=`${c.apiBaseUrl}/projects/${A}/repos/${b}/branches/default`,ve=await fetch(J,Je(c))),!ve.ok){const nt=`Failed to retrieve default branch from ${J}, ${ve.status} ${ve.statusText}`;throw new Error(nt)}const{displayId:je}=await ve.json(),ke=je;if(!ke)throw new Error(`Failed to read default branch from ${J}. Response ${ve.status} ${ve.json()}`);return ke}async function Jt(C,c){const{name:b,owner:A,ref:J,filepath:ve}=parseGitUrl(C);let je=J;je||(je=await _e(C,c));const ke=ve?`&path=${encodeURIComponent(decodeURIComponent(ve))}`:"";return`${c.apiBaseUrl}/projects/${A}/repos/${b}/archive?format=tgz&at=${je}&prefix=${A}-${b}${ke}`}function Vt(C,c){try{const{owner:b,name:A,ref:J,filepathtype:ve,filepath:je}=parseGitUrl(C);if(!b||!A||ve!=="browse"&&ve!=="raw"&&ve!=="src")throw new Error("Invalid Bitbucket Server URL or file path");const ke=je.replace(/^\//,"");return`${c.apiBaseUrl}/projects/${b}/repos/${A}/raw/${ke}?at=${J}`}catch(b){throw new Error(`Incorrect URL: ${C}, ${b}`)}}function Je(C){const c={};if(C.token)c.Authorization=`Bearer ${C.token}`;else if(C.username&&C.password){const b=wn.from(`${C.username}:${C.password}`,"utf8");c.Authorization=`Basic ${b.toString("base64")}`}return{headers:c}}function Rn(C){const c=C.getString("host");let b=C.getOptionalString("baseUrl"),A=C.getOptionalString("cloneUrl"),J=C.getOptionalString("gitilesBaseUrl");const ve=C.getOptionalString("username"),je=C.getOptionalString("password");if(V(c)){if(b&&!m(b))throw new Error(`Invalid Gerrit integration config, '${b}' is not a valid baseUrl`);if(A&&!m(A))throw new Error(`Invalid Gerrit integration config, '${A}' 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 b?b=(0,f.trimEnd)(b,"/"):b=`https://${c}`,J?J=(0,f.trimEnd)(J,"/"):J=`https://${c}`,A?A=(0,f.trimEnd)(A,"/"):A=b,{host:c,baseUrl:b,cloneUrl:A,gitilesBaseUrl:J,username:ve,password:je}}function sn(C){return C.map(Rn)}var Nn=n(48834).lW;const In=")]}'";function Pn(C,c){const b=new URL(C.gitilesBaseUrl),A=new URL(c),ve=A.pathname.substring(A.pathname.startsWith("/a/")?2:0).replace(b.pathname,"").split("/").filter(En=>!!En),je=ve.indexOf("+");if(je<=0)throw new Error(`Unable to parse project from url: ${c}`);const ke=(0,f.trimStart)(ve.slice(0,je).join("/"),"/"),nt=ve.indexOf("heads");if(nt<=0)throw new Error(`Unable to parse branch from url: ${c}`);const _t=ve[nt+1],an=ve.slice(nt+2).join("/");return{branch:_t,filePath:an===""?"/":an,project:ke}}function Gn(C,c,b,A){return`${C.gitilesBaseUrl}/${c}/+/refs/heads/${b}/${(0,f.trimStart)(A,"/")}`}function Kn(C,c,b,A){const J=A==="/"||A===""?".tar.gz":`/${A}.tar.gz`;return`${be(C)}/${c}/+archive/refs/heads/${b}${J}`}function Ln(C){return C.password?"/a/":"/"}function be(C){if(!C.baseUrl||!C.gitilesBaseUrl)throw new Error("Unexpected Gerrit config values. baseUrl or gitilesBaseUrl not set.");if(C.gitilesBaseUrl.startsWith(C.baseUrl))return C.gitilesBaseUrl.replace(C.baseUrl.concat("/"),C.baseUrl.concat(Ln(C)));if(C.password)throw new Error("Since the baseUrl (Gerrit) is not part of the gitilesBaseUrl, an authentication URL could not be constructed.");return C.gitilesBaseUrl}function pe(C,c){const{branch:b,project:A}=Pn(C,c);return`${C.baseUrl}${Ln(C)}projects/${encodeURIComponent(A)}/branches/${b}`}function Ie(C,c){const{project:b}=Pn(C,c);return`${C.cloneUrl}${Ln(C)}${b}`}function H(C,c){const{branch:b,filePath:A,project:J}=Pn(C,c);return`${C.baseUrl}${Ln(C)}projects/${encodeURIComponent(J)}/branches/${b}/files/${encodeURIComponent(A)}/content`}function N(C){return`${C.baseUrl}${Ln(C)}projects/`}function ce(C){const c={};if(!C.password)return c;const b=Nn.from(`${C.username}:${C.password}`,"utf8");return c.Authorization=`Basic ${b.toString("base64")}`,{headers:c}}async function Ae(C){const c=await C.text();if(c.startsWith(In))try{return JSON.parse(c.slice(In.length))}catch(b){throw new Error(`Invalid response from Gerrit: ${c.slice(0,10)} - ${b}`)}throw new Error(`Gerrit JSON body prefix missing. Found: ${c.slice(0,10)}`)}class $e{get type(){return"gerrit"}get title(){return this.integrationConfig.host}get config(){return this.integrationConfig}resolveUrl(c){const{url:b,base:A,lineNumber:J}=c;let ve;if(b.startsWith("/")){const{branch:je,project:ke}=Pn(this.config,A);return Gn(this.config,ke,je,b)}return b?ve=new URL(b,A):ve=new URL(A),J&&(ve.hash=J.toString()),ve.toString()}resolveEditUrl(c){return c}constructor(c){(0,r._)(this,"integrationConfig",void 0),this.integrationConfig=c}}(0,r._)($e,"factory",({config:C})=>{var c;const b=sn((c=C.getOptionalConfigArray("integrations.gerrit"))!==null&&c!==void 0?c:[]);return h(b.map(A=>new $e(A)),A=>A.config.host)});function qe(C){const c=C.getString("host");let b=C.getOptionalString("baseUrl");const A=C.getOptionalString("username"),J=C.getOptionalString("password");if(!V(c))throw new Error(`Invalid Gitea integration config, '${c}' is not a valid host`);return b?b=(0,f.trimEnd)(b,"/"):b=`https://${c}`,{host:c,baseUrl:b,username:A,password:J}}var It=n(48834).lW;function Bt(C,c){try{var b;const A=(b=C.baseUrl)!==null&&b!==void 0?b:`https://${C.host}`,[J,ve,je,ke,nt,_t,...an]=c.replace(A,"").split("/"),En=an.join("/").replace(/^\//,"");return`${A}/${ve}/${je}/_edit/${_t}/${En}`}catch(A){throw new Error(`Incorrect URL: ${c}, ${A}`)}}function nn(C,c){try{var b;const A=(b=C.baseUrl)!==null&&b!==void 0?b:`https://${C.host}`,[J,ve,je,ke,nt,_t,...an]=c.replace(A,"").split("/"),En=an.join("/").replace(/^\//,"");return`${A}/api/v1/repos/${ve}/${je}/contents/${En}?ref=${_t}`}catch(A){throw new Error(`Incorrect URL: ${c}, ${A}`)}}function ln(C){const c={},{username:b,password:A}=C;return A?(b?c.Authorization=`basic ${It.from(`${b}:${A}`).toString("base64")}`:c.Authorization=`token ${A}`,{headers:c}):c}class rn{get type(){return"gitea"}get title(){return this.config.host}resolveUrl(c){return F(c)}resolveEditUrl(c){return Bt(this.config,c)}constructor(c){(0,r._)(this,"config",void 0),this.config=c}}(0,r._)(rn,"factory",({config:C})=>{var c;const A=((c=C.getOptionalConfigArray("integrations.gitea"))!==null&&c!==void 0?c:[]).map(J=>qe(J));return h(A.map(J=>new rn(J)),J=>J.config.host)});const ee="github.com",te="https://api.github.com",G="https://raw.githubusercontent.com";function v(C){var c,b;const A=(b=C.getOptionalString("host"))!==null&&b!==void 0?b:ee;let J=C.getOptionalString("apiBaseUrl"),ve=C.getOptionalString("rawBaseUrl");const je=C.getOptionalString("token"),ke=(c=C.getOptionalConfigArray("apps"))===null||c===void 0?void 0:c.map(nt=>({appId:nt.getNumber("appId"),clientId:nt.getString("clientId"),clientSecret:nt.getString("clientSecret"),webhookSecret:nt.getString("webhookSecret"),privateKey:nt.getString("privateKey"),allowedInstallationOwners:nt.getOptionalStringArray("allowedInstallationOwners")}));if(!V(A))throw new Error(`Invalid GitHub integration config, '${A}' is not a valid host`);return J?J=(0,f.trimEnd)(J,"/"):A===ee&&(J=te),ve?ve=(0,f.trimEnd)(ve,"/"):A===ee&&(ve=G),{host:A,apiBaseUrl:J,rawBaseUrl:ve,token:je,apps:ke}}function O(C){const c=C.map(v);return c.some(b=>b.host===ee)||c.push({host:ee,apiBaseUrl:te,rawBaseUrl:G}),c}function M(C,c,b){try{const{owner:A,name:J,ref:ve,filepathtype:je,filepath:ke}=parseGitUrl(C);if(!A||!J||!ve||je!=="blob"&&je!=="raw"&&je!=="tree")throw new Error("Invalid GitHub URL or file path");const nt=ke.replace(/^\//,"");return he(c,b)==="api"?`${c.apiBaseUrl}/repos/${A}/${J}/contents/${nt}?ref=${ve}`:`${c.rawBaseUrl}/${A}/${J}/${ve}/${nt}`}catch(A){throw new Error(`Incorrect URL: ${C}, ${A}`)}}function Y(C,c){const b={};return he(C,c)==="api"&&(b.Accept="application/vnd.github.v3.raw"),c.token&&(b.Authorization=`token ${c.token}`),{headers:b}}function he(C,c){return C.apiBaseUrl&&(c.token||!C.rawBaseUrl)?"api":"raw"}var we=n(35355),Oe=n(89393),Xe=n(26228);class tt{async getOrCreateToken(c,b,A){let J=this.tokenCache.get(c);if((!J||this.isExpired(J.expiresAt))&&(J=await A(),J.expiresAt=J.expiresAt.minus({minutes:10}),this.tokenCache.set(c,J)),!this.appliesToRepo(J,b))throw new Error(`The Backstage GitHub application used in the ${c} organization does not have access to a repository with the name ${b}`);return{accessToken:J.token}}appliesToRepo(c,b){return b===void 0?!0:c.repositories!==void 0?c.repositories.includes(b):!0}constructor(){(0,r._)(this,"tokenCache",new Map),(0,r._)(this,"isExpired",c=>Xe.ou.local()>c)}}const mt={Accept:"application/vnd.github.machine-man-preview+json"};class wt{async getInstallationCredentials(c,b){if(this.allowedInstallationOwners){var A;if(!(!((A=this.allowedInstallationOwners)===null||A===void 0)&&A.includes(c)))return{accessToken:void 0}}return this.cache.getOrCreateToken(c,b,async()=>{const{installationId:J,suspended:ve}=await this.getInstallationData(c);if(ve)throw new Error(`The GitHub application for ${c} is suspended`);const je=await this.appClient.apps.createInstallationAccessToken({installation_id:J,headers:mt});let ke;if(je.data.repository_selection==="selected"){const _t=new Oe.v({baseUrl:this.baseUrl,auth:je.data.token}),an=await _t.paginate(_t.apps.listReposAccessibleToInstallation);var nt;ke=((nt=an.repositories)!==null&&nt!==void 0?nt:an).map(gn=>gn.name)}return{token:je.data.token,expiresAt:Xe.ou.fromISO(je.data.expires_at),repositories:ke}})}getInstallations(){return this.appClient.paginate(this.appClient.apps.listInstallations)}async getInstallationData(c){const A=(await this.getInstallations()).find(ve=>{var je;return ve.account&&"login"in ve.account&&((je=ve.account.login)===null||je===void 0?void 0:je.toLocaleLowerCase("en-US"))===c.toLocaleLowerCase("en-US")});if(A)return{installationId:A.id,suspended:Boolean(A.suspended_by)};const J=new Error(`No app installation found for ${c} in ${this.baseAuthConfig.appId}`);throw J.name="NotFoundError",J}constructor(c,b){(0,r._)(this,"appClient",void 0),(0,r._)(this,"baseUrl",void 0),(0,r._)(this,"baseAuthConfig",void 0),(0,r._)(this,"cache",new tt),(0,r._)(this,"allowedInstallationOwners",void 0),this.allowedInstallationOwners=c.allowedInstallationOwners,this.baseUrl=b,this.baseAuthConfig={appId:c.appId,privateKey:c.privateKey.replace(/\\n/gm,`
|
|
33
33
|
`)},this.appClient=new Oe.v({baseUrl:b,headers:mt,authStrategy:we.i,auth:this.baseAuthConfig})}}class dt{async getAllInstallations(){return this.apps.length?(await Promise.all(this.apps.map(b=>b.getInstallations()))).flat():[]}async getAppToken(c,b){if(this.apps.length===0)return;const A=await Promise.all(this.apps.map(ke=>ke.getInstallationCredentials(c,b).then(nt=>({credentials:nt,error:void 0}),nt=>({credentials:void 0,error:nt})))),J=A.find(ke=>{var nt;return(nt=ke.credentials)===null||nt===void 0?void 0:nt.accessToken});if(J)return J.credentials.accessToken;const je=A.map(ke=>ke.error).find(ke=>{var nt;return((nt=ke)===null||nt===void 0?void 0:nt.name)!=="NotFoundError"});if(je)throw je}constructor(c){var b;(0,r._)(this,"apps",void 0);var A;this.apps=(A=(b=c.apps)===null||b===void 0?void 0:b.map(J=>new wt(J,c.apiBaseUrl)))!==null&&A!==void 0?A:[]}}class Be{async getCredentials(c){const b=W()(c.url),A=b.owner||b.name,J=b.owner?b.name:void 0;let ve="app",je=await this.githubAppCredentialsMux.getAppToken(A,J);return je||(ve="token",je=this.token),{headers:je?{Authorization:`Bearer ${je}`}:void 0,token:je,type:ve}}constructor(c,b){(0,r._)(this,"githubAppCredentialsMux",void 0),(0,r._)(this,"token",void 0),this.githubAppCredentialsMux=c,this.token=b}}(0,r._)(Be,"create",C=>new Be(new dt(C),C.token));class At{static fromIntegrations(c){const b=new Map;return c.github.list().forEach(A=>{const J=SingleInstanceGithubCredentialsProvider.create(A.config);b.set(A.config.host,J)}),new At(b)}async getCredentials(c){const b=new URL(c.url),A=this.providers.get(b.host);if(!A)throw new Error(`There is no GitHub integration that matches ${c.url}. Please add a configuration for an integration.`);return A.getCredentials(c)}constructor(c){_define_property(this,"providers",void 0),this.providers=c}}class Ut{get type(){return"github"}get title(){return this.integrationConfig.host}get config(){return this.integrationConfig}resolveUrl(c){return xt(F(c),"tree")}resolveEditUrl(c){return xt(c,"edit")}constructor(c){(0,r._)(this,"integrationConfig",void 0),this.integrationConfig=c}}(0,r._)(Ut,"factory",({config:C})=>{var c;const b=O((c=C.getOptionalConfigArray("integrations.github"))!==null&&c!==void 0?c:[]);return h(b.map(A=>new Ut(A)),A=>A.config.host)});function xt(C,c){return C.replace(/\/\/([^/]+)\/([^/]+)\/([^/]+)\/(blob|tree|edit)\//,(b,A,J,ve)=>`//${A}/${J}/${ve}/${c}/`)}const Nt=null;class Qt extends Ut{get config(){return super.config}constructor(c){super(c)}}(0,r._)(Qt,"factory",Ut.factory);const jn=null,Ft=null,bt=null,jt="gitlab.com",Mt="https://gitlab.com/api/v4";function Xt(C){const c=C.getString("host");let b=C.getOptionalString("apiBaseUrl");const A=C.getOptionalString("token");let J=C.getOptionalString("baseUrl");if(b?b=(0,f.trimEnd)(b,"/"):c===jt&&(b=Mt),J?J=(0,f.trimEnd)(J,"/"):J=`https://${c}`,V(c)){if(!b||!m(b))throw new Error(`Invalid GitLab integration config, '${b}' 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:A,apiBaseUrl:b,baseUrl:J}}function lr(C){const c=C.map(Xt);return c.some(b=>b.host===jt)||c.push({host:jt,apiBaseUrl:Mt,baseUrl:`https://${jt}`}),c}function Cr(C){let c="";return C.host!==jt&&(c=new URL(C.baseUrl).pathname),trimEnd(c,"/")}async function rr(C,c){const b=await fr(C,c);return _n(C,b,c).toString()}function bn(C){const{token:c=""}=C;return{headers:{"PRIVATE-TOKEN":c}}}function _n(C,c,b){try{const A=new URL(C),J=A.pathname.split("/blob/").slice(1).join("/blob/"),[ve,...je]=J.split("/"),ke=getGitLabIntegrationRelativePath(b);return A.pathname=[...ke?[ke]:[],"api/v4/projects",c,"repository/files",encodeURIComponent(decodeURIComponent(je.join("/"))),"raw"].join("/"),A.search=`?ref=${ve}`,A}catch(A){throw new Error(`Incorrect url: ${C}, ${A}`)}}async function fr(C,c){const b=new URL(C);if(!b.pathname.includes("/blob/"))throw new Error("Please provide full path to yaml file from GitLab");try{let A=b.pathname.split("/-/blob/")[0].split("/blob/")[0];const J=getGitLabIntegrationRelativePath(c);J&&(A=A.replace(J,""));const ve=new URL(`${b.origin}${J}/api/v4/projects/${encodeURIComponent(A.replace(/^\//,""))}`),je=await fetch(ve.toString(),bn(c)),ke=await je.json();if(!je.ok)throw new Error(`GitLab Error '${ke.error}', ${ke.error_description}`);return Number(ke.id)}catch(A){throw new Error(`Could not get GitLab project ID for: ${C}, ${A}`)}}class wr{get type(){return"gitlab"}get title(){return this.integrationConfig.host}get config(){return this.integrationConfig}resolveUrl(c){return F(c)}resolveEditUrl(c){return Yn(c,"edit")}constructor(c){(0,r._)(this,"integrationConfig",void 0),this.integrationConfig=c}}(0,r._)(wr,"factory",({config:C})=>{var c;const b=lr((c=C.getOptionalConfigArray("integrations.gitlab"))!==null&&c!==void 0?c:[]);return h(b.map(A=>new wr(A)),A=>A.config.host)});function Yn(C,c){return C.replace(/\/\-\/(blob|tree|edit)\//,`/-/${c}/`)}class zr{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._)(zr,"create",C=>new zr(C.token));class jr{static fromIntegrations(c){const b=new Map;return c.gitlab.list().forEach(A=>{const J=SingleInstanceGitlabCredentialsProvider.create(A.config);b.set(A.config.host,J)}),new jr(b)}async getCredentials(c){const b=new URL(c.url),A=this.providers.get(b.host);if(!A)throw new Error(`There is no GitLab integration that matches ${c.url}. Please add a configuration for an integration.`);return A.getCredentials(c)}constructor(c){_define_property(this,"providers",void 0),this.providers=c}}class Nr{static fromConfig(c){return new Nr({awsS3:D.factory({config:c}),azure:Rt.factory({config:c}),bitbucket:Ne.factory({config:c}),bitbucketCloud:yn.factory({config:c}),bitbucketServer:fn.factory({config:c}),gerrit:$e.factory({config:c}),github:Ut.factory({config:c}),gitlab:wr.factory({config:c}),gitea:rn.factory({config:c})})}get awsS3(){return this.byType.awsS3}get azure(){return this.byType.azure}get bitbucket(){return this.byType.bitbucket}get bitbucketCloud(){return this.byType.bitbucketCloud}get bitbucketServer(){return this.byType.bitbucketServer}get gerrit(){return this.byType.gerrit}get github(){return this.byType.github}get gitlab(){return this.byType.gitlab}get gitea(){return this.byType.gitea}list(){return Object.values(this.byType).flatMap(c=>c.list())}byUrl(c){let b=Object.values(this.byType).map(A=>A.byUrl(c)).filter(Boolean);if(b.length>1){const A=b.filter(J=>!(J instanceof Ne));A.length!==0&&(b=A)}return b[0]}byHost(c){return Object.values(this.byType).map(b=>b.byHost(c)).find(Boolean)}resolveUrl(c){const b=this.byUrl(c.base);return b?b.resolveUrl(c):F(c)}resolveEditUrl(c){const b=this.byUrl(c);return b?b.resolveEditUrl(c):c}constructor(c){(0,r._)(this,"byType",void 0),this.byType=c}}},48514:function(Lt,Le,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 ye=n(92077),le=n(95481),z=n(7476),de=n(93225),D=n(86317),E=n(65124),se=n(22478),ie=n(85478),ne=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 Ke{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 yt=n(51837);const $t=(0,yt.CT)("api-context"),zt=i=>{var t;const{apis:o,children:a}=i,d=(t=(0,W.useContext)($t))===null||t===void 0?void 0:t.atVersion(1),S=d?new Ke(o,d):o;return(0,p.jsx)($t.Provider,{value:(0,yt.EI)({1:S}),children:a})};zt.propTypes={apis:Se().shape({get:Se().func.isRequired}).isRequired,children:Se().node};class Rt{static validateFactories(t,o){for(const a of o){const d=[a],S=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}`);S.has(oe)||(S.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 S=this.loadDeps(t,d.deps,[...o,d.api]),B=d.factory(S);return this.apis.set(t.id,B),B}loadDeps(t,o,a){const d={};for(const S in o)if(o.hasOwnProperty(S)){const B=o[S],Z=this.load(B,a);if(!Z)throw new Error(`No API factory available for dependency ${B} of dependent ${t}`);d[S]=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 Dt;(function(i){i[i.default=10]="default",i[i.app=50]="app",i[i.static=100]="static"})(Dt||(Dt={}));class Yt{register(t,o){const a=Dt[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 ct(i){return new Promise((t,o)=>{const a=i.width||500,d=i.height||700,S=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=${S}`);let oe="";if(!Z||typeof Z.closed=="undefined"||Z.closed){const Ze=new Error("Failed to open auth popup.");Ze.name="PopupRejectedError",o(Ze);return}const me=Ze=>{if(Ze.source!==Z||Ze.origin!==i.origin)return;const{data:Ge}=Ze;if(Ge.type==="config_info"){oe=Ge.targetOrigin;return}if(Ge.type!=="authorization_response")return;const st=Ge;if("error"in st){const qt=new Error(st.error.message);qt.name=st.error.name,o(qt)}else t(st.response);Te()},Me=setInterval(()=>{if(Z.closed){const Ze=`Login failed, ${oe&&oe!==window.location.origin?`Incorrect app origin, expected ${oe}`:"popup was closed"}`,Ge=new Error(Ze);Ge.name="PopupClosedError",o(Ge),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,S,B,Z,oe,me;const Me=this.joinScopesFunc(t),Te=await this.buildUrl("/start",{scope:Me,origin:window.location.origin,flow:"popup"}),Ze=!((a=this.popupOptions)===null||a===void 0||(o=a.size)===null||o===void 0)&&o.fullscreen?window.screen.width:((S=this.popupOptions)===null||S===void 0||(d=S.size)===null||d===void 0?void 0:d.width)||450,Ge=!((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 ct({url:Te,name:`${this.provider.title} Login`,origin:new URL(Te).origin,width:Ze,height:Ge});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:S,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:S,onAuthRequest:async Te=>this.enableExperimentalRedirectFlow?this.executeRedirect(Te):this.showPopup(Te)}),this.discoveryApi=a,this.environment=d,this.provider=S,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 Gt{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 S of d)a.add(S)}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),Ne=n.n(Ce);let Ye=Symbol.observable;class ht{[Ye](){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(Ne())(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 et{[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(Ne())(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 et(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),S=this.sessionScopesFunc(a);return Zt(S,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:S}=t;this.connector=o,this.sessionScopesFunc=d,this.sessionShouldRefreshFunc=S,this.helper=new Gt({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:S=ft,oauthRequestApi:B,defaultScopes:Z=[],scopeTransform:oe=Ze=>Ze,popupOptions:me}=t,Me=new lt({configApi:o,discoveryApi:a,environment:d,provider:S,oauthRequestApi:B,sessionTransform(Ze){return{...Ze,providerInfo:{idToken:Ze.providerInfo.idToken,accessToken:Ze.providerInfo.accessToken,scopes:gt.normalizeScopes(oe,Ze.providerInfo.scope),expiresAt:new Date(Date.now()+Ze.providerInfo.expiresInSeconds*1e3)}}},popupOptions:me}),Te=new ot({connector:Me,defaultScopes:new Set(Z),sessionScopes:Ze=>Ze.providerInfo.scopes,sessionShouldRefresh:Ze=>(Ze.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),S=await this.sessionManager.getSession({...o,scopes:d});var B;return(B=(a=S)===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 yn{static create(t){const{configApi:o,discoveryApi:a,environment:d="development",provider:S=Ct,oauthRequestApi:B,defaultScopes:Z=["read:user"]}=t;return gt.create({configApi:o,discoveryApi:a,oauthRequestApi:B,provider:S,environment:d,defaultScopes:Z})}}const hn={id:"gitlab",title:"GitLab",icon:()=>null};class cn{static create(t){const{configApi:o,discoveryApi:a,environment:d="development",provider:S=hn,oauthRequestApi:B,defaultScopes:Z=["read_user"]}=t;return gt.create({configApi:o,discoveryApi:a,oauthRequestApi:B,provider:S,environment:d,defaultScopes:Z})}}const Sn={id:"google",title:"Google",icon:()=>null},pn="https://www.googleapis.com/auth/";class xn{static create(t){const{configApi:o,discoveryApi:a,oauthRequestApi:d,environment:S="development",provider:B=Sn,defaultScopes:Z=["openid",`${pn}userinfo.email`,`${pn}userinfo.profile`]}=t;return gt.create({configApi:o,discoveryApi:a,oauthRequestApi:d,provider:B,environment:S,defaultScopes:Z,scopeTransform(oe){return oe.map(me=>me==="openid"?me:me==="profile"||me==="email"?`${pn}userinfo.${me}`:me.startsWith(pn)?me:`${pn}${me}`)}})}}const Cn={id:"okta",title:"Okta",icon:()=>null},on=new Set(["openid","profile","email","phone","address","groups","offline_access"]),fn="okta.";class wn{static create(t){const{configApi:o,discoveryApi:a,environment:d="development",provider:S=Cn,oauthRequestApi:B,defaultScopes:Z=["openid","email","profile","offline_access"]}=t;return gt.create({configApi:o,discoveryApi:a,oauthRequestApi:B,provider:S,environment:d,defaultScopes:Z,scopeTransform(oe){return oe.map(me=>on.has(me)||me.startsWith(fn)?me:`${fn}${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())})})}),Vt={id:"saml",title:"SAML",icon:()=>null};class Je{static create(t){const{discoveryApi:o,environment:a="development",provider:d=Vt}=t,S=new DirectAuthConnector({discoveryApi:o,environment:a,provider:d}),B=new StaticAuthSessionManager({connector:S}),Z=new AuthSessionStore({manager:B,storageKey:`${d.id}Session`,schema:samlSessionSchema});return new Je(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 Rn={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(S=>S!=="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=Rn,oauthRequestApi:S,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=S,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 Nn={id:"onelogin",title:"onelogin",icon:()=>null},In=new Set(["openid","profile","email","phone","address","groups","offline_access"]),Pn="onelogin.";class Gn{static create(t){const{configApi:o,discoveryApi:a,environment:d="development",provider:S=Nn,oauthRequestApi:B}=t;return gt.create({configApi:o,discoveryApi:a,oauthRequestApi:B,provider:S,environment:d,defaultScopes:["openid","email","profile","offline_access"],scopeTransform(Z){return Z.map(oe=>In.has(oe)||oe.startsWith(Pn)?oe:`${Pn}${oe}`)}})}}const Kn={id:"bitbucket",title:"Bitbucket",icon:()=>null};class Ln{static create(t){const{configApi:o,discoveryApi:a,environment:d="development",provider:S=Kn,oauthRequestApi:B,defaultScopes:Z=["team"]}=t;return gt.create({configApi:o,discoveryApi:a,oauthRequestApi:B,provider:S,environment:d,defaultScopes:Z})}}const be={id:"bitbucketServer",title:"Bitbucket Server",icon:()=>null};class pe{static create(t){const{configApi:o,discoveryApi:a,environment:d="development",provider:S=be,oauthRequestApi:B,defaultScopes:Z=["PROJECT_ADMIN"]}=t;return gt.create({configApi:o,discoveryApi:a,oauthRequestApi:B,provider:S,environment:d,defaultScopes:Z})}}const Ie={id:"atlassian",title:"Atlassian",icon:()=>null};class H{static create(t){const{configApi:o,discoveryApi:a,environment:d="development",provider:S=Ie,oauthRequestApi:B}=t;return gt.create({configApi:o,discoveryApi:a,oauthRequestApi:B,provider:S,environment:d})}}class N{post(t){this.subject.next(t)}alert$(){return this.subject}constructor(){(0,k._)(this,"subject",new ht)}}class ce{captureEvent(t){}}const Ae="theme";class $e{static createWithStorage(t){const o=new $e(t);if(!window.localStorage)return o;var a;const d=(a=window.localStorage.getItem(Ae))!==null&&a!==void 0?a:void 0;return o.setActiveThemeId(d),o.activeThemeId$().subscribe(S=>{S?window.localStorage.setItem(Ae,S):window.localStorage.removeItem(Ae)}),window.addEventListener("storage",S=>{if(S.key===Ae){var B;const Z=(B=localStorage.getItem(Ae))!==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 et(void 0)}}var qe=n(9850),It=n.n(qe),Bt=n(12782),nn=n.n(Bt);const ln=/^[a-z][a-z0-9]*(?:[-_][a-z][a-z0-9]*)*$/i;function rn(i){return typeof i=="object"&&i!==null&&!Array.isArray(i)}function ee(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 G{static fromConfigs(t){return t.length===0?new G(void 0):t.reduce((o,{data:a,context:d,filteredKeys:S,deprecatedKeys:B})=>{const Z=new G(a,d,o);if(Z.filteredKeys=S,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=It()(this.readValue(t)),d=(o=this.fallback)===null||o===void 0?void 0:o.getOptional(t);if(a===void 0){if(!1)var S;return d}else if(d===void 0)return a;return nn()({},{value:d},{value:a},(B,Z)=>!rn(Z)||!rn(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(rn(a))return this.copy(a,t,d);if(a!==void 0)throw new TypeError(te.type(this.fullKey(t),this.context,ee(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[S,B]of d.entries())if(!rn(B))return{expected:"object-array",value:B,key:`${t}[${S}]`};return!0});if(!o){if(!1)var a;return}return o.map((d,S)=>this.copy(d,`${t}[${S}]`))}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 G(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 S;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,ee(oe),me))}return a}readValue(t){const o=t?t.split("."):[];for(const d of o)if(!ln.test(d))throw new TypeError(`Invalid config key '${t}'`);if(this.data===void 0)return;let a=this.data;for(const[d,S]of o.entries())if(rn(a))a=a[S];else if(a!==void 0){const B=this.fullKey(o.slice(0,d).join("."));throw new TypeError(te.type(B,this.context,ee(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 Y{post(t,o){this.subject.next({error:t,context:o})}error$(){return this.subject}constructor(){(0,k._)(this,"subject",new ht)}}class he{static forward(t,o){window.addEventListener("unhandledrejection",a=>{t.post(a.reason,o)})}}function we(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 Oe{registerFlag(t){we(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,S])=>(we(d),S===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 tt{static create(t){var o,a;const d=mt(t),S=((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 tt(t.identityApi,d,S,B)}apply(t){return async(o,a)=>{const d=new Request(o,a),{token:S}=await this.identityApi.getCredentials();return d.headers.get(this.headerName)||typeof S!="string"||!S||!this.allowUrl(d.url)?t(o,a):(d.headers.set(this.headerName,this.headerValue(S)),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 mt(i){return i.allowUrl?i.allowUrl:i.urlPrefixAllowlist?wt(i.urlPrefixAllowlist):i.config?wt([i.config.getString("backend.baseUrl")]):()=>!1}function wt(i){const t=i.map(o=>o.replace(/\/$/,""));return o=>t.some(a=>o===a||o.startsWith(`${a}/`))}function dt(i,t){return!t||t==="/"?i:`${i.replace(/\/$/,"")}/${t.replace(/^\//,"")}`}class Be{apply(t){return async(o,a)=>{const d=new Request(o,a),S="plugin://";if(!d.url.startsWith(S))return t(o,a);const{hostname:B,pathname:Z,search:oe,hash:me,username:Me,password:Te}=new URL(`http://${d.url.substring(S.length)}`);let Ze=await this.discoveryApi.getBaseUrl(B);if(Me||Te){const st=new URL(Ze),qt=`${Me}${Te?`:${Te}`:""}@`;Ze=`${st.protocol}//${qt}${st.host}${st.pathname}`}const Ge=`${dt(Ze,Z)}${oe}${me}`;return t(Ge,typeof o=="string"||At(o)?a:o)}}constructor(t){(0,k._)(this,"discoveryApi",void 0),this.discoveryApi=t}}function At(i){var t;return typeof i=="object"&&((t=i)===null||t===void 0?void 0:t.constructor)===URL}class Ut{static resolvePluginProtocol(t){return new Be(t.discoveryApi)}static injectIdentityAuth(t){return tt.create(t)}constructor(){}}function xt(i,t){for(const o of t)if(!i.has(o))return!1;return!0}function Nt(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=>xt(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)=>Nt(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 et(this.getCurrentPending()))}}class jn{createAuthRequester(t){const o=new Qt,a=this.handlerCount;return this.handlerCount++,o.pending().subscribe({next:d=>{const S=this.currentRequests.slice(),B=this.makeAuthRequest(d,t);B?S[a]=B:delete S[a],this.currentRequests=S,this.subject.next(S.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 et([])),(0,k._)(this,"currentRequests",[]),(0,k._)(this,"handlerCount",0)}}const Ft=new Map;class bt{static create(t){var o;return new bt((o=t.namespace)!==null&&o!==void 0?o:"",t.errorApi)}static addStorageEventListener(){window.addEventListener("storage",t=>{for(const[a,d]of Ft.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,(S,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 Ft.has(o)||Ft.set(o,new bt(o,this.errorApi)),Ft.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 bt.hasSubscribed||(bt.addStorageEventListener(),bt.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(Ne())(a=>(this.subscribers.add(a),()=>{this.subscribers.delete(a)}))}}(0,k._)(bt,"hasSubscribed",!1);const jt=(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 Xt=n(84800);const lr=(i,t)=>{try{var o,a,d,S;const Z=(o=(0,Xt.fp)(t,{pathname:i}))===null||o===void 0?void 0:o.filter(Ze=>{var Ge,st;return((st=Ze)===null||st===void 0||(Ge=st.route.routeRefs)===null||Ge===void 0?void 0:Ge.size)>0}).pop(),oe=(a=Z)===null||a===void 0?void 0:a.route;if(!oe||oe.path===""&&i!=="/")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((Ze,[Ge,st])=>(st!==void 0&&Ge!=="*"&&(Ze[Ge]=st),Ze),{});return{extension:"App",pluginId:((S=Me)===null||S===void 0?void 0:S.getId())||"root",...me?{routeRef:me.id}:{},_routeNodeType:oe.element,params:Te}}catch{return}},Cr=({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},rr=({routeObjects:i})=>{const{pathname:t,search:o,hash:a}=(0,V.TH)(),{params:d,...S}=lr(t,i)||{params:{}};return(0,p.jsx)(m.fC,{attributes:S,children:(0,p.jsx)(Cr,{pathname:t,search:o,hash:a,attributes:d})})};function bn(i){return Mt()?_n(i):""}function _n(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 fr({component:i,appIdentityProxy:t,children:o}){const[a,d]=(0,W.useState)(),S=(0,m.h_)(m.Ds),B=bn(S);return a?(t.setTarget(a,{signOutTargetUrl:B||"/"}),(0,p.jsx)(p.Fragment,{children:o})):(0,p.jsx)(i,{onSignInSuccess:d})}function wr(i){const{Router:t,SignInPage:o}=(0,m.qD)().getComponents(),a=(0,m.h_)(m.Ds),d=_n(a),S=`${d}/*`,B=(0,W.useContext)(jt);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)(rr,{routeObjects:Z}),(0,p.jsx)(fr,{component:o,appIdentityProxy:oe,children:(0,p.jsx)(V.Z5,{children:(0,p.jsx)(V.AW,{path:S,element:(0,p.jsx)(p.Fragment,{children:i.children})})})})]}):(0,p.jsxs)(t,{basename:d,children:[(0,p.jsx)(rr,{routeObjects:Z}),(0,p.jsx)(fr,{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)(rr,{routeObjects:Z}),(0,p.jsx)(V.Z5,{children:(0,p.jsx)(V.AW,{path:S,element:(0,p.jsx)(p.Fragment,{children:i.children})})})]}):(0,p.jsxs)(t,{basename:d,children:[(0,p.jsx)(rr,{routeObjects:Z}),i.children]}))}var Yn=n(88412),zr=n(50629),jr=n(80956),Nr=n(64279);function C(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:S}=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,S[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 c(i,t){return()=>({accumulator:i(),visit:t})}function b(i){var t;return(t=i.props)===null||t===void 0?void 0:t.children}function A(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 J=c(()=>new Set,(i,t)=>{const o=(0,m.IY)(t,"core.plugin");o&&i.add(o)}),ve=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)(ve,"core.featureFlagged",!0);const je={caseSensitive:!1,path:"*",element:"match-all",routeRefs:new Set,plugins:new Set};function ke(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 nt=i=>{const t=new Set;return i&&t.add(i),t};function _t(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})}_t(o.props.children,t)}),t}const an=c(()=>({paths:new Map,parents:new Map,objects:new Array}),(i,t,o,a)=>{var d,S,B,Z,oe;if(!((d=a)===null||d===void 0)&&d.isElementAncestor)return a;if(((S=o)===null||S===void 0?void 0:S.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 "${ke(t)}"`);var Te;const Ze=(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 "${ke(t)}"`);const On=me.startsWith("/")?me.slice(1):me,Jr=t.props.element;if((0,m.IY)(t,"core.gatherMountPoints")){var Ge,st,qt;if(Jr)throw new Error(`Mount point gatherers may not have an element prop "${ke(t)}"`);const bo={path:On,element:"gathered",routeRefs:new Set,caseSensitive:Boolean((Ge=t.props)===null||Ge===void 0?void 0:Ge.caseSensitive),children:[je],plugins:new Set};return Ze.push(bo),{obj:bo,gatherPath:On,routeRef:(st=a)===null||st===void 0?void 0:st.routeRef,gatherRouteRef:(qt=a)===null||qt===void 0?void 0:qt.routeRef}}if(Jr){var Ht,nr,Ur,pr;const[bo,...pa]=_t(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:On,element:"mounted",routeRefs:new Set([io]),caseSensitive:Boolean((Ht=t.props)===null||Ht===void 0?void 0:Ht.caseSensitive),children:[je],plugins:nt(fa)};return Ze.push(vs),i.paths.set(io,On),i.parents.set(io,(nr=a)===null||nr===void 0?void 0:nr.routeRef),{obj:vs,routeRef:io!=null?io:(Ur=a)===null||Ur===void 0?void 0:Ur.routeRef,gatherPath:On,gatherRouteRef:(pr=a)===null||pr===void 0?void 0:pr.gatherRouteRef}}}if(Me){var yr,xr,Zn,Pr;if(((yr=a)===null||yr===void 0?void 0:yr.gatherPath)===void 0)throw new Error(`Routable extension "${ke(t)}" with mount point "${Me}" must be assigned a path`);(Zn=a)===null||Zn===void 0||(xr=Zn.obj)===null||xr===void 0||xr.routeRefs.add(Me);const On=(0,m.IY)(t,"core.plugin");if(On){var Lr,Or;(Or=a)===null||Or===void 0||(Lr=Or.obj)===null||Lr===void 0||Lr.plugins.add(On)}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}),En=c(()=>({paths:new Map,parents:new Map,objects:new Array}),(i,t,o,a)=>{var d,S,B,Z,oe,me,Me,Te,Ze;if(((d=o)===null||d===void 0?void 0:d.props.element)===t)return a;let Ge=(S=a)===null||S===void 0?void 0:S.obj,st=(B=a)===null||B===void 0?void 0:B.routeRef,qt=(Z=a)===null||Z===void 0?void 0:Z.sticky;const Ht=(oe=t.props)===null||oe===void 0?void 0:oe.path;var nr;const Ur=(nr=(me=Ge)===null||me===void 0?void 0:me.children)!==null&&nr!==void 0?nr:i.objects,pr=Boolean((Me=t.props)===null||Me===void 0?void 0:Me.caseSensitive);let yr=(Te=a)===null||Te===void 0?void 0:Te.path;if((0,m.IY)(t,"core.gatherMountPoints")){if(!Ht)throw new Error("Mount point gatherer must have a path");yr=Ht}const xr=(Ze=t.props)===null||Ze===void 0?void 0:Ze.element;let Zn=(0,m.IY)(t,"core.mountPoint");if(!Zn&&(0,W.isValidElement)(xr)&&(Zn=(0,m.IY)(xr,"core.mountPoint")),Zn){let Jr=Ht;if(yr&&(Jr?yr=void 0:Jr=yr),!Jr)throw new Error("Mounted routable extension must have a path");if(i.paths.set(Zn,Jr),st&&qt?(i.parents.set(Zn,st),Ht&&(st=Zn,qt=!1)):(i.parents.set(Zn,st),st=Zn),Ht)Ge={caseSensitive:pr,path:Ht,element:"mounted",routeRefs:new Set([Zn]),children:[je],plugins:nt((0,m.IY)(t.props.element,"core.plugin"))},Ur.push(Ge);else{var Pr;(Pr=Ge)===null||Pr===void 0||Pr.routeRefs.add(Zn)}}if((0,m.IY)(t,"core.gatherMountPoints")&&(qt=!0),(0,m.IY)(t,"core.gatherMountPoints")){if(!Ht)throw new Error("Mount point gatherer must have a path");if(!Zn){var Or,On;Ge={caseSensitive:pr,path:Ht,element:"gathered",routeRefs:new Set,children:[je],plugins:((On=a)===null||On===void 0||(Or=On.obj)===null||Or===void 0?void 0:Or.plugins)||new Set},Ur.push(Ge)}}return{obj:Ge,path:yr,routeRef:st,sticky:qt}}),gn=c(()=>new Set,(i,t)=>{if(t.type===ve){const o=t.props;i.add("with"in o?o.with:o.without)}}),Wr=(0,yt.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 S=t.get(a);if(S===void 0)return[void 0,""];const B=Vr(S,d);return[a,B]}function Cs(i,t,o,a,d){var S;const B=(S=(0,Xt.fp)(d,t))!==null&&S!==void 0?S:[],Z=Array();let oe=-1;for(let Te=i;Te&&(oe=B.findIndex(Ze=>Ze.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 Ze=o.get(Te);if(Ze===void 0)throw new Error(`No path for ${Te}`);if(Ze.includes(":"))throw new Error(`Cannot route to ${i} with parent ${Te} as it has parameters`);return Ze});return`${Vr(me,...Me)}/`}class Ho{resolve(t,o){const[a,d]=Vo(t,this.routePaths,this.routeBindings);if(!a)return;let S;typeof o=="string"?S=this.trimPath(o):o.pathname?S={...o,pathname:this.trimPath(o.pathname)}:S=o;const B=this.appBasePath+Cs(a,S,this.routePaths,this.routeParents,this.routeObjects);return(...[oe])=>Vr(B,(0,Xt.Gn)(d,oe))}trimPath(t){return t&&(t.startsWith(this.appBasePath)?t.slice(this.appBasePath.length):t)}constructor(t,o,a,d,S){(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=S}}const Go=(0,yt.CT)("routing-context"),Er=({routePaths:i,routeParents:t,routeObjects:o,routeBindings:a,basePath:d="",children:S})=>{const B=new Ho(i,t,o,a,d),Z=(0,yt.EI)({1:B});return(0,p.jsx)(Go.Provider,{value:Z,children:S})};function cr(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,S="";for(;d;){const Z=i.get(d);if(Z===void 0)throw new Error(`No path for ${d}`);S=Vr(Z,S),d=t.get(d)}const B=S.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 ${S}`)}}}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,yt.CT)("app-context"),wo=({appContext:i,children:t})=>{const o=(0,yt.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 Fr(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 Fr("getUserId"),this.target.getUserId()}getProfile(){if(!this.target)throw jo("getProfile");if(!this.target.getProfile)throw new Error("IdentityApi does not implement getProfile");return Fr("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 Fr("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 Fn(i,t,o){if(i!==void 0){const d=o.find(S=>S.id===i);if(d)return d}if(t){const d=o.find(S=>S.variant==="dark");if(d)return d}const a=o.find(d=>d.variant==="light");return a||o[0]}const dr=()=>{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)?dr():!1,d=Fn(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 gr(new Map(this.apis))}constructor(){(0,k._)(this,"apis",[])}}class gr{static builder(){return new Yo}static from(t){return new gr(new Map(t.map(([o,a])=>[o.id,a])))}static with(t,o){return new gr(new Map([[t.id,o]]))}with(t,o){return new gr(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[S,B]of Object.entries(d)){const Z=a[S];if(!Z)throw new Error(`Key ${S} is not an existing external route`);if(!B&&!Z.optional)throw new Error(`External route ${S} 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),S=(0,Nr.default)(i||(()=>Promise.resolve([])));let B;if(d&&S.loading){const{Progress:me}=t;B=(0,p.jsx)(me,{})}else if(S.error){const{BootErrorPage:me}=t;B=(0,p.jsx)(me,{step:"load-config",error:S.error})}const{ThemeProvider:Z=Gr}=t;if(B)return{node:(0,p.jsx)(zt,{apis:gr.with(m.hg,o),children:(0,p.jsx)(Z,{children:B})})};let oe;if(!((a=S.value)===null||a===void 0)&&a.length){const me=G.fromConfigs(S.value),Me=me.getOptionalString("app.baseUrl"),Te=me.getOptionalString("backend.baseUrl");let Ze=S.value;const Ge={data:{},context:"relative-resolver"};if(Me&&Te){const st=new URL(Me).origin,qt=new URL(Te).origin;if(st===qt){const Ht=To(Te);Te!==Ht&&(Ge.data.backend={baseUrl:Ht})}}if(Me){const st=To(Me);Me!==st&&(Ge.data.app={baseUrl:st})}Object.keys(Ge.data).length&&(Ze=Ze.concat([Ge])),oe=G.fromConfigs(Ze)}else oe=G.fromConfigs([]);return{api:oe}}class Zr{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,Yn._)(this,Io))throw new Error("app.getProvider() or app.createRoot() has already been called, and can only be called once");(0,jr._)(this,Io,!0);const t=new Zr(this);let o=!1;return({children:d})=>{const S=(0,W.useRef)(!0),B=(0,W.useMemo)(()=>$e.createWithStorage(this.themes),[]),{routing:Z,featureFlags:oe,routeBindings:me}=(0,W.useMemo)(()=>{const Ge=C({root:d,discoverers:[b,A],collectors:{routing:Mt()?En:an,collectedPlugins:J,featureFlags:gn}});return Ge.collectedPlugins.forEach(st=>this.plugins.add(st)),this.verifyPlugins(this.plugins),this.getApiHolder(),{...Ge,routeBindings:Ao(this.bindRoutes)}},[d]);o||(o=!0,cr(Z.paths,Z.parents),Hr(me,this.plugins));const Me=Ro(this.configLoader,this.components,B),Te="api"in Me;if(Te){const{api:Ge}=Me;this.configApi=Ge}if("node"in Me)return Me.node;if(Te&&S.current){S.current=!1;const Ge=this.getApiHolder().get(m.W0);if(Ge){for(const Ht of this.featureFlags)Ge.registerFlag({...Ht,pluginId:""});for(const Ht of this.plugins.values())if("getFeatureFlags"in Ht)for(const nr of Ht.getFeatureFlags())Ge.registerFlag({name:nr.name,pluginId:Ht.getId()});else for(const nr of Ht.output())nr.type==="feature-flag"&&Ge.registerFlag({name:nr.name,pluginId:Ht.getId()});const st=Ge.getRegisteredFlags(),qt=new Set(st.map(Ht=>Ht.name));for(const Ht of oe)qt.has(Ht)||Ge.registerFlag({name:Ht,pluginId:""})}}const{ThemeProvider:Ze=Gr}=this.components;return(0,p.jsx)(zt,{apis:this.getApiHolder(),children:(0,p.jsx)(wo,{appContext:t,children:(0,p.jsx)(Ze,{children:(0,p.jsx)(Er,{routePaths:Z.paths,routeParents:Z.parents,routeObjects:Z.objects,routeBindings:me,basePath:bn(Me.api),children:(0,p.jsx)(jt.Provider,{value:{routeObjects:Z.objects,appIdentityProxy:this.appIdentityProxy},children:d})})})})})}}getRouter(){return wr}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 Rt.validateFactories(this.apiFactoryRegistry,this.apiFactoryRegistry.getAllApis()),this.apiHolder}this.apiFactoryRegistry.register("static",{api:m.hg,deps:{},factory:()=>$e.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 Oe});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 Rt.validateFactories(this.apiFactoryRegistry,this.apiFactoryRegistry.getAllApis()),this.apiHolder=new Rt(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,zr._)(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 S;this.configLoader=(S=t.configLoader)!==null&&S!==void 0?S: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(),[]),S=[...(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$)(S)},Lo=(0,m.T0)({id:"plugin.permission.api"});var ur;(function(i){i.DENY="DENY",i.ALLOW="ALLOW",i.CONDITIONAL="CONDITIONAL"})(ur||(ur={}));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 qn=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(ur.ALLOW).or(_e.z.literal(ur.DENY))}),As=_e.z.union([_e.z.object({result:_e.z.literal(ur.ALLOW).or(_e.z.literal(ur.DENY))}),_e.z.object({result:_e.z.literal(ur.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:ur.ALLOW}));const S={items:t.map(Te=>({id:Es.Z(),...Te}))},B=await this.discovery.getBaseUrl("permission"),Z=await Xo()(`${B}/authorize`,{method:"POST",body:JSON.stringify(S),headers:{...this.getAuthorizationHeader((d=a)===null||d===void 0?void 0:d.token),"content-type":"application/json"}});if(!Z.ok)throw await qn.VL.fromResponse(Z);const oe=await Z.json(),Me=qo(o,new Set(S.items.map(({id:Te})=>Te))).parse(oe).items.reduce((Te,Ze)=>(Te[Ze.id]=Ze,Te),{});return S.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,S=new es({discovery:a,config:o});return new po(S,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 ur.DENY;const{result:S}=await t.authorize(d);return S});return a?{error:a,loading:!1,allowed:!1}:o===void 0?{loading:!0,allowed:!1}:{loading:!1,allowed:o===ur.ALLOW}}const Ts=i=>{const{permission:t,resourceRef:o,errorComponent:a,...d}=i,S=usePermission(isResourcePermission(t)?{permission:t,resourceRef:o}:{permission:t}),B=useApp(),{NotFoundErrorPage:Z}=B.getComponents();let oe=a===void 0?_jsx(Z,{}):a;return S.loading?oe=null:S.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:S}=d.getComponents();return _jsx(S,{})}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 ce}),(0,m.ni)({api:m.VE,deps:{alertApi:m.$v},factory:({alertApi:i})=>{const t=new M(i,new Y);return he.forward(t,{hidden:!1}),t}}),(0,m.ni)({api:m.E6,deps:{errorApi:m.VE},factory:({errorApi:i})=>bt.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:[Ut.resolvePluginProtocol({discoveryApi:o}),Ut.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})=>xn.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})=>yn.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})=>cn.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})=>Gn.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})=>Ln.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),dn=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)(dn.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)(dn.mf,{status:"501",statusMessage:o})})},P=({error:i,resetError:t,plugin:o})=>{var a;return(0,p.jsx)(dn.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:dn.Ex,Router:Rs.VK,NotFoundErrorPage:j,BootErrorPage:L,ErrorBoundaryFallback:P};var re=n(43642),_=n(80079),ue=n(90941),Ee=n(32915),Re=n(40562),ze=n(21853),Fe=n(60744),We=n(66569),it=n(30254),Et=n(13384),De=n(15933),He=n(58838),Tt=n(86737),tn=n(4989),An=n(44407),Ot=n(18628),Pt=n(84219),Kt=n(98685),Tn=n(39781),hr=n(39412);const Tr={brokenImage:_.Z,catalog:Ot.Z,scaffolder:Ee.Z,techdocs:Re.Z,search:ze.Z,chat:Fe.Z,dashboard:We.Z,docs:it.Z,email:Et.Z,github:He.Z,group:Pt.Z,help:Tt.Z,"kind:api":De.Z,"kind:component":An.Z,"kind:domain":re.Z,"kind:group":Pt.Z,"kind:location":tn.Z,"kind:system":ue.Z,"kind:user":Kt.Z,"kind:resource":hr.Z,user:Kt.Z,warning:Tn.Z};var Yr=n(73689),zn=n(77349);const mn={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")`},Bn={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 mr(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:mr({colors:Bn.teal,shape:mn.wave}),documentation:mr({colors:Bn.pinkSea,shape:mn.wave2}),tool:mr({colors:Bn.purpleSky,shape:mn.round}),service:mr({colors:Bn.marineBlue,shape:mn.wave}),website:mr({colors:Bn.veryBlue,shape:mn.wave}),library:mr({colors:Bn.rubyRed,shape:mn.wave}),other:mr({colors:Bn.darkGrey,shape:mn.wave}),app:mr({colors:Bn.toastyOrange,shape:mn.wave}),apis:mr({colors:Bn.teal,shape:mn.wave2}),card:mr({colors:Bn.greens,shape:mn.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:S=ui,typography:B}=i;if(!S[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:S[d],getPageTheme:({themeId:me})=>(oe=S[me])!==null&&oe!==void 0?oe:S[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,S)=>typeof d=="string"?d:S*d;return o.map(d=>{const S=a(d,i);return typeof S=="number"?`${S}px`:S}).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,S])=>typeof S=="function"?[d,S({theme:o})]:[d,S]))}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 S=d,B=S.match(gi);if(B){const[,Z]=B,{[S]: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 S=t[d];S&&("styleOverrides"in S&&(d==="MuiCssBaseline"?o[d]=fi(i,S.styleOverrides):o[d]=Os(Ls(i,S.styleOverrides))),"defaultProps"in S&&(a[d]=S.defaultProps))}return{overrides:o,props:a}}var mo=new WeakMap;class mi{getTheme(t){return(0,Yn._)(this,mo).get(t)}constructor(t,o){(0,zr._)(this,mo,{writable:!0,value:new Map}),(0,jr._)(this,mo,new Map),t&&(0,Yn._)(this,mo).set("v4",t),o&&(0,Yn._)(this,mo).set("v5",o)}}function ks(i){const t=Is(i),o={...go,...i.components},a=(0,zn.Z)({...t,components:o}),d=rs(a,o),S={...(0,Yr.Z)(t),...d};return new mi(S,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"),S=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})})),S&&(Z=(0,p.jsx)(Ea.Z,{injectFirst:!0,children:(0,p.jsx)(Aa.Z,{theme:S,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,S,B,Z,oe,me,Me,Te,Ze;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,...(S=i)===null||S===void 0?void 0:S.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:(Ze=(oe=i)===null||oe===void 0?void 0:oe.themes)!==null&&Ze!==void 0?Ze:bi})}var er=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 S=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,er.eE)({kind:Z,namespace:oe,name:me})).forEach(B=>S.add(B)),await o.set("entityRefs",Array.from(S)),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(Ne())(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),Wn=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(S=>{var B;return((B=S.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(S=>t.some(B=>B.toLocaleLowerCase("en-US")===S.toLocaleLowerCase("en-US")))),o&&!i.some(S=>S.toLocaleLowerCase("en-US")===o.toLocaleLowerCase("en-US"))&&(a=a.concat([o])),a.sort().reduce((S,B)=>(S[B.toLocaleLowerCase("en-US")]=B,S),{})}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:S}=useAllKinds(),{filters:B,updateFilters:Z,queryParameters:{kind:oe}}=useEntityList(),me=useMemo(()=>[oe].flat()[0],[oe]);var Me;const[Te,Ze]=useState((Me=me!=null?me:(t=B.kind)===null||t===void 0?void 0:t.value)!==null&&Me!==void 0?Me:o);useEffect(()=>{me&&Ze(me)},[me]),useEffect(()=>{var st;if(!((st=B.kind)===null||st===void 0)&&st.value){var qt;Ze((qt=B.kind)===null||qt===void 0?void 0:qt.value)}},[B.kind]),useEffect(()=>{Z({kind:Te?new EntityKindFilter(Te):void 0})},[Te,Z]);const Ge=filterKinds(S,a,Te);return _jsx(Select,{input:_jsx(InputBase,{}),value:Te.toLocaleLowerCase("en-US"),onChange:st=>Ze(st.target.value),classes:d,children:Object.keys(Ge).map(st=>_jsx(MenuItem,{value:st,children:`${pluralize(Ge[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:S,error:B}=fo({permission:i,resourceRef:t?(0,er.eE)(t):void 0});return o||S?{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:S,isUnregisterAllowed:B,onUnregisterEntity:Z,onClose:oe}=i,me=typeof((t=S)===null||t===void 0?void 0:t.disableUnregister)=="boolean";var Me;const Te=(Me=!B||(me?!!(!((o=S)===null||o===void 0)&&o.disableUnregister):((a=S)===null||a===void 0?void 0:a.disableUnregister)==="disable"))!==null&&Me!==void 0?Me:!1;let Ze=(0,p.jsx)(p.Fragment,{});return((d=S)===null||d===void 0?void 0:d.disableUnregister)!=="hidden"&&(Ze=(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:Ze})}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,[S,B]=(0,W.useState)(),Z=Di(),me=Pi(ds).allowed,Me=qt=>{B(qt.currentTarget)},Te=()=>{B(void 0)},Ze=(0,m.h_)(m.$v),Ge=(0,W.useCallback)(()=>{window.navigator.clipboard.writeText(window.location.toString()).then(()=>Ze.post({message:"Copied!",severity:"info",display:"transient"}))},[Ze]),st=t&&[...t.map(qt=>(0,p.jsxs)(Do.Z,{onClick:()=>{Te(),qt.onClick()},children:[(0,p.jsx)(No.Z,{children:(0,p.jsx)(qt.Icon,{fontSize:"small"})}),(0,p.jsx)(Fo.Z,{primary:qt.title})]},qt.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":!!S,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(S),onClose:Te,anchorEl:S,anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"},"aria-labelledby":"long-menu",children:(0,p.jsxs)(Ai.Z,{autoFocusItem:Boolean(S),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(),Ge()},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)(Wn.LH,{entity:t})]})}function Fi(i,t,o,a){var d,S,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:(S=a)===null||S===void 0?void 0:S.metadata.namespace)!==null&&Me!==void 0?Me:"";var Ze,Ge,st;return{headerTitle:`${(st=(Ge=(Ze=(B=a)===null||B===void 0?void 0:B.metadata.title)!==null&&Ze!==void 0?Ze:o)!==null&&Ge!==void 0?Ge:(Z=a)===null||Z===void 0?void 0:Z.metadata.name)!==null&&st!==void 0?st:""}${Te&&Te!==er.zG?` in ${Te}`:""}`,headerType:(()=>{let Ht=me.toLocaleLowerCase("en-US");return a&&a.spec&&"type"in a.spec&&(Ht+=" \u2014 ",Ht+=a.spec.type.toLocaleLowerCase("en-US")),Ht})()}}function Zi(i){var t;const{entity:o}=i,a=(0,Wn.hF)(o,er.S4);return(0,p.jsxs)(p.Fragment,{children:[a.length>0&&(0,p.jsx)(dn.i9,{label:"Owner",value:(0,p.jsx)(Wn.rI,{entityRefs:a,defaultKind:"Group",color:"inherit"})}),((t=o.spec)===null||t===void 0?void 0:t.lifecycle)&&(0,p.jsx)(dn.i9,{label:"Lifecycle",value:o.spec.lifecycle})]})}const Ui=i=>{var t,o,a;const{UNSTABLE_extraContextMenuItems:d,UNSTABLE_contextMenuOptions:S,children:B,NotFoundComponent:Z}=i,{kind:oe,namespace:me,name:Me}=(0,m.Oi)(Wn.wi),{entity:Te,loading:Ze,error:Ge}=(0,Wn.ce)(),st=(0,V.TH)(),qt=(0,m.vJ)(B,Or=>Or.selectByComponentData({key:Ni,withStrictError:"Child of EntityLayout must be an EntityLayout.Route"}).getElements().flatMap(({props:On})=>{if(Te){if(On.if&&!On.if(Te))return[]}else return[];return[{path:On.path,title:On.title,children:On.children,tabProps:On.tabProps}]}),[Te]),{headerTitle:Ht,headerType:nr}=Fi(oe,me,Me,Te),[Ur,pr]=(0,W.useState)(!1),[yr,xr]=(0,W.useState)(!1),Zn=(0,V.s0)(),Pr=async()=>{pr(!1),xr(!1),Zn("/")};(0,W.useEffect)(()=>{pr(!1),xr(!1)},[st.pathname]);var Lr;return(0,p.jsxs)(dn.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)(dn.h4,{title:(0,p.jsx)(Na,{title:Ht,entity:Te}),pageTitleOverride:Ht,type:nr,children:Te&&(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)(Zi,{entity:Te}),(0,p.jsx)(zs,{UNSTABLE_extraContextMenuItems:d,UNSTABLE_contextMenuOptions:S,onUnregisterEntity:()=>pr(!0),onInspectEntity:()=>xr(!0)})]})}),Ze&&(0,p.jsx)(dn.Ex,{}),Te&&(0,p.jsx)(dn.tn,{routes:qt}),Ge&&(0,p.jsx)(dn.VY,{children:(0,p.jsx)($o.Z,{severity:"error",children:Ge.toString()})}),!Ze&&!Ge&&!Te&&(0,p.jsx)(dn.VY,{children:Z||(0,p.jsxs)(dn.GB,{title:"Entity not found",children:["There is no ",oe," with the requested"," ",(0,p.jsx)(dn.rU,{to:"https://backstage.io/docs/features/software-catalog/references",children:"kind, namespace, and name"}),"."]})}),(0,p.jsx)(Wn.pp,{open:Ur,entity:Te,onConfirm:Pr,onClose:()=>pr(!1)}),(0,p.jsx)(Wn.U_,{open:yr,entity:Te,onClose:()=>xr(!1)})]})};Ui.Route=us;function Fa(i){const{open:t,onClose:o,onConfirm:a,entity:d}=i,[S,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:S,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(),S=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:S,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 S=await t.getEntitiesByRefs({entityRefs:d,fields:["kind","metadata.name","metadata.namespace"]});return d.filter((B,Z)=>S.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 S,B;return{errors:((B=(S=d.entity.status)===null||S===void 0?void 0:S.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:S}=useAsync(async()=>xo(t,o),[t,o]);return d?_jsx(Box,{mb:1,children:_jsx(ResponseErrorPanel,{error:d})}):a||!S?null:_jsx(_Fragment,{children:S.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 vr="core.backstage.entitySwitch",Vs=i=>null;(0,m.R5)(Vs,vr,!0);const Hs=i=>{var t;const{entity:o,loading:a}=(0,Wn.ce)(),d=(0,m.I_)(),S=(0,m.vJ)(i.children,oe=>oe.selectByComponentData({key:vr,withStrictError:"Child of EntitySwitch is not an EntitySwitch.Case"}).getElements().flatMap(me=>{var Me;if(a&&!o)return[];const{if:Te,children:Ze}=me.props;return o?[{if:(Me=Te)===null||Me===void 0?void 0:Me(o,{apis:d}),children:Ze}]:[{if:Te===void 0,children:Ze}]}),[d,o,a]);if(S.some(oe=>typeof oe.if=="object"&&"then"in oe.if))return(0,p.jsx)(Vi,{results:S,renderMultipleMatches:i.renderMultipleMatches});if(i.renderMultipleMatches==="all"){const oe=S.filter(me=>me.if).map(me=>me.children);return oe.length===0?ps(S):(0,p.jsx)(p.Fragment,{children:oe})}var Z;return(Z=(t=S.find(oe=>oe.if))===null||t===void 0?void 0:t.children)!==null&&Z!==void 0?Z:ps(S)};function Vi({results:i,renderMultipleMatches:t}){const{loading:o,value:a}=(0,Nr.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 S;return(S=(await Promise.all(d)).find(Boolean))!==null&&S!==void 0?S: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=Wn._i.Filters,Wa=Wn._i.Content;var Va=n(85877),Gi=n(15096);const Jn=(0,m.rx)({id:"catalog",apis:[(0,m.ni)({api:Wn.Ah,deps:{discoveryApi:m.NW,fetchApi:m.gP},factory:({discoveryApi:i,fetchApi:t})=>new hs.MS({discoveryApi:i,fetchApi:t})}),(0,m.ni)({api:Wn.p3,deps:{storageApi:m.E6},factory:({storageApi:i})=>new Ds({storageApi:i})})],routes:{catalogIndex:yo._Z,catalogEntity:Wn.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:Wn.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}`,S=await fetch(`${d.endsWith("/")?d:`${d}/`}index.html`);if(S.status===404)throw new Error("Page not found");return S.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 tr=(0,so.Z)({root:{width:dn.po.drawerWidthClosed,height:3*dn.po.logoHeight,display:"flex",flexFlow:"row nowrap",alignItems:"center",marginBottom:-14},link:{width:dn.po.drawerWidthClosed,marginLeft:24}}),sa=()=>{const i=tr(),{isOpen:t}=(0,dn.mZ)();return(0,p.jsx)("div",{className:i.root,children:(0,p.jsx)(dn.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)(dn.tR,{children:[(0,p.jsxs)(dn.YE,{children:[(0,p.jsx)(sa,{}),(0,p.jsx)(dn.v7,{}),(0,p.jsx)(dn.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:S,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:S,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(Lt,Le,n){"use strict";n.d(Le,{CT:function(){return m},EI:function(){return ye},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=le=>`__@backstage/${le}__`;function f(le,z){const de=W(le);let D=p[de];return D||(D=z(),p[de]=D,D)}var V=n(2784);function m(le){return f(le,()=>(0,V.createContext)(void 0))}function h(le){return(0,V.useContext)(m(le))}function F(le){return{set(z){globalThis[`__@backstage/${le}__`]=createContext(createVersionedValueMap(z))},reset(){delete globalThis[`__@backstage/${le}__`]}}}function ye(le){Object.freeze(le);const z={atVersion(de){return le[de]}};return Object.defineProperty(z,"$map",{configurable:!0,enumerable:!0,get(){return le}}),z}},96641:function(Lt,Le,n){"use strict";n.d(Le,{X2:function(){return ye},ce:function(){return le},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:E,error:se,refresh:ie}=z,ne={entity:D,loading:E,error:se,refresh:ie};return(0,r.jsx)(m.Provider,{value:(0,f.EI)({1:ne}),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 ye(){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 le(){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:E,error:se,refresh:ie}=de;return{entity:D,loading:E,error:se,refresh:ie}}},39709:function(Lt,Le,n){"use strict";n.d(Le,{h$:function(){return ct.h$},n3:function(){return r.n3},_i:function(){return K},tW:function(){return _e},df:function(){return $e},UO:function(){return ht},ph:function(){return dn},dq:function(){return wt},nl:function(){return ts},dx:function(){return xt},rI:function(){return Qt},u3:function(){return Yn},xE:function(){return jr},sL:function(){return Nr},LH:function(){return ve},U_:function(){return no},pp:function(){return ro},EW:function(){return Oo},Ah:function(){return W},wi:function(){return Be},hF:function(){return U.hF},CV:function(){return U.CV},$3:function(){return rn},p3:function(){return f},ce:function(){return ct.ce},X2:function(){return ct.X2},wp:function(){return rt},ZW:function(){return Cn},eK:function(){return Ct},CR:function(){return cn}});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),ye=n(41156),le=n(60364),z=n(77277),de=n(4190),D=n(95544),E=n(90436),se=n(60905),ie=n(36444);const ne=y=>{var j,L;const P=(0,ye.Z)(Ee=>{var Re;return Ee.breakpoints.down((L=(Re=y.options)===null||Re===void 0?void 0:Re.drawerBreakpoint)!==null&&L!==void 0?L:"md")}),ae=(0,le.Z)(),[re,_]=(0,F.useState)(!1);var ue;return P?(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(z.Z,{style:{marginTop:ae.spacing(1),marginLeft:ae.spacing(1)},onClick:()=>_(!0),startIcon:(0,h.jsx)(ie.Z,{}),children:"Filters"}),(0,h.jsx)(de.ZP,{open:re,onClose:()=>_(!1),anchor:(ue=(j=y.options)===null||j===void 0?void 0:j.drawerAnchor)!==null&&ue!==void 0?ue:"left",disableAutoFocus:!0,keepMounted:!0,variant:"temporary",children:(0,h.jsxs)(D.Z,{m:2,children:[(0,h.jsx)(E.Z,{variant:"h6",component:"h2",style:{marginBottom:ae.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=ne,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 Ke{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(_=>_!==re)&&ae.every(_=>!_.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 yt{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 $t{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 zt{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 Rt{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 Dt{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 ct=n(96641),ut=n(76635),St=n(19126),lt=n.n(St),Zt=n(73557),Gt=n(69294),Ce=n(48760),Ne=n(90736);const Ye=(0,F.createContext)(void 0),ht=y=>{const j=(0,Ne.default)(),L=(0,p.h_)(W),[P,ae]=(0,F.useState)({}),re=(0,Zt.TH)();var _;const ue=(0,F.useMemo)(()=>(_=lt().parse(re.search,{ignoreQueryPrefix:!0}).filters)!==null&&_!==void 0?_:{},[re]),[Ee,Re]=(0,F.useState)(()=>({appliedFilters:{},entities:[],backendEntities:[]})),[{loading:ze,error:Fe},We]=(0,Gt.default)(async()=>{const De=(0,ut.compact)(Object.values(P)),He=(0,U.Gz)(De),Tt=(0,U.wq)(De),tn=(0,U.wq)((0,ut.compact)(Object.values(Ee.appliedFilters))),An=Object.keys(P).reduce((Pt,Kt)=>{var Tn;const hr=P[Kt];return!((Tn=hr)===null||Tn===void 0)&&Tn.toQueryValue&&(Pt[Kt]=hr.toQueryValue()),Pt},{});if((0,ut.isEqual)(tn,Tt))Re({appliedFilters:P,backendEntities:Ee.backendEntities,entities:Ee.backendEntities.filter(He)});else{const Pt=await L.getEntities({filter:Tt});Re({appliedFilters:P,backendEntities:Pt.items,entities:Pt.items.filter(He)})}if(j()){var Ot;const Pt=lt().parse(re.search,{ignoreQueryPrefix:!0}),Kt=lt().stringify({...Pt,filters:An},{addQueryPrefix:!0,arrayFormat:"repeat"}),Tn=`${window.location.pathname}${Kt}`;(Ot=window.history)===null||Ot===void 0||Ot.replaceState(null,document.title,Tn)}},[L,ue,P,Ee],{loading:!0});(0,Ce.Z)(We,10,[P]);const it=(0,F.useCallback)(De=>{ae(He=>{const Tt=typeof De=="function"?De(He):De;return{...He,...Tt}})},[]),Et=(0,F.useMemo)(()=>({filters:Ee.appliedFilters,entities:Ee.entities,backendEntities:Ee.backendEntities,updateFilters:it,queryParameters:ue,loading:ze,error:Fe}),[Ee,it,ue,ze,Fe]);return(0,h.jsx)(Ye.Provider,{value:Et,children:y.children})};function rt(){const y=(0,F.useContext)(Ye);if(!y)throw new Error("useEntityList must be used within EntityListProvider");return y}var et=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(),_=(0,F.useMemo)(()=>[ae].flat().filter(Boolean),[ae]);var ue;const[Ee,Re]=(0,F.useState)(_.length?_:(ue=(y=P)===null||y===void 0?void 0:y.getTypes())!==null&&ue!==void 0?ue:[]);(0,F.useEffect)(()=>{_.length&&Re(_)},[_]);const[ze,Fe]=(0,F.useState)([]),We=(0,F.useMemo)(()=>{var Tt;return(Tt=L)===null||Tt===void 0?void 0:Tt.value},[L]),{error:it,loading:Et,value:De}=(0,et.default)(async()=>We?await j.getEntityFacets({filter:{kind:We},facets:["spec.type"]}).then(tn=>tn.facets["spec.type"]||[]):[],[We,j]),He=(0,F.useRef)(De);return(0,F.useEffect)(()=>{const Tt=He.current;if(He.current=De,Et||!We||Tt===De||!De)return;const tn=[...new Set(ft()(De,Ot=>-Ot.count).map(Ot=>Ot.value.toLocaleLowerCase("en-US")))];Fe(tn);const An=Ee.filter(Ot=>tn.includes(Ot));ot()(Ee,An)||Re(An)},[Et,We,Ee,Re,De]),(0,F.useEffect)(()=>{re({type:Ee.length?new Se(Ee):void 0})},[Ee,re]),{loading:Et,error:it,availableTypes:ze,selectedTypes:Ee,setSelectedTypes:Re}}function Ct(y,j){var L,P,ae,re;const _=(P=j)===null||P===void 0||(L=P.type)===null||L===void 0?void 0:L.toLocaleLowerCase("en-US"),ue=(re=j)===null||re===void 0||(ae=re.kind)===null||ae===void 0?void 0:ae.toLocaleLowerCase("en-US"),Ee=(0,p.h_)(W),{loading:Re,value:ze,error:Fe}=(0,et.default)(async()=>{var We,it;const Et=(We=y.relations)===null||We===void 0?void 0:We.filter(He=>(!_||He.type.toLocaleLowerCase("en-US")===_)&&(!ue||(0,I.of)(He.targetRef).kind===ue));if(!(!((it=Et)===null||it===void 0)&&it.length))return[];const{items:De}=await Ee.getEntitiesByRefs({entityRefs:Et.map(He=>He.targetRef)});return De.filter(He=>Boolean(He))},[y,_,ue]);return{entities:ze,loading:Re,error:Fe}}var yn=n(72164);function hn(y){return typeof y=="string"?y:(0,I.eE)(y)}function cn(){const y=(0,p.h_)(f),j=(0,yn.Z)(y.starredEntitie$(),new Set),L=(0,F.useCallback)(ae=>j.has(hn(ae)),[j]),P=(0,F.useCallback)(ae=>y.toggleStarred(hn(ae)).then(),[y]);return{starredEntities:j,toggleStarredEntity:P,isStarredEntity:L}}function Sn(y){return typeof y=="string"?y:(0,I.eE)(y)}function pn(y){const j=(0,p.h_)(f),[L,P]=(0,F.useState)(!1);return(0,F.useEffect)(()=>{const re=j.starredEntitie$().subscribe({next(_){P(_.has(Sn(y)))}});return()=>{re.unsubscribe()}},[y,j]),{toggleStarredEntity:(0,F.useCallback)(()=>j.toggleStarred(Sn(y)).then(),[y,j]),isStarredEntity:L}}var xn=n(75435);function Cn(){const y=(0,p.h_)(p.$4),{loading:j,value:L}=(0,et.default)(async()=>{const{ownershipEntityRefs:ae}=await y.getBackstageIdentity();return ae},[]),P=(0,F.useMemo)(()=>{const ae=new Set(L!=null?L:[]);return re=>{const _=(0,xn.h)(re,I.S4).map(I.eE);for(const ue of _)if(ae.has(ue))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,et.default)(async()=>await y.getEntityFacets({facets:["kind"]}).then(re=>{var _;return((_=re.facets.kind)===null||_===void 0?void 0:_.map(ue=>ue.value).sort())||[]}),[y]);return{loading:L,error:j,allKinds:P!=null?P:[]}}function fn(y,j,L){let P=y;return j&&(P=P.filter(re=>j.some(_=>_.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,_)=>(re[_.toLocaleLowerCase("en-US")]=_,re),{})}function wn(y){var j;const{filters:L,queryParameters:{kind:P},updateFilters:ae}=rt(),re=(0,F.useMemo)(()=>[P].flat()[0],[P]);var _;const[ue,Ee]=(0,F.useState)((_=re!=null?re:(j=L.kind)===null||j===void 0?void 0:j.value)!==null&&_!==void 0?_:y.initialFilter);(0,F.useEffect)(()=>{re&&Ee(re)},[re]),(0,F.useEffect)(()=>{var We;if(!((We=L.kind)===null||We===void 0)&&We.value){var it;Ee((it=L.kind)===null||it===void 0?void 0:it.value)}},[L.kind]),(0,F.useEffect)(()=>{ae({kind:ue?new xe(ue):void 0})},[ue,ae]);const{allKinds:Re,loading:ze,error:Fe}=on();return{loading:ze,error:Fe,allKinds:Re!=null?Re:[],selectedKind:ue,setSelectedKind:Ee}}const _e=y=>{const{allowedKinds:j,hidden:L,initialFilter:P="component"}=y,ae=(0,p.h_)(p.$v),{error:re,allKinds:_,selectedKind:ue,setSelectedKind:Ee}=wn({initialFilter:P});if((0,F.useEffect)(()=>{re&&ae.post({message:"Failed to load entity kinds",severity:"error"})},[re,ae]),re)return null;const Re=fn(_,j,ue),ze=Object.keys(Re).map(Fe=>({value:Fe,label:Re[Fe]}));return L?null:(0,h.jsx)(D.Z,{pb:1,pt:1,children:(0,h.jsx)(R.Ph,{label:"Kind",items:ze,selected:ue.toLocaleLowerCase("en-US"),onChange:Fe=>Ee(String(Fe))})})};var Jt=n(79692),Vt=n(38016),Je=n(88013),Rn=n(21324),sn=n(5806),Nn=n(19996),In=n(25505);const Pn=(0,h.jsx)(In.Z,{fontSize:"small"}),Gn=(0,h.jsx)(Nn.Z,{fontSize:"small"});function Kn({selected:y}){return(0,h.jsx)(Rn.Z,{icon:Pn,checkedIcon:Gn,checked:y})}const Ln=(0,F.memo)(y=>{var j;const{selected:L,value:P,availableOptions:ae,showCounts:re}=y,_=re?`${P} (${(j=ae)===null||j===void 0?void 0:j[P]})`:P;return(0,h.jsx)(sn.Z,{control:(0,h.jsx)(Kn,{selected:L}),label:_,onClick:ue=>ue.preventDefault()})});var be=n(86619),pe=n(72779),Ie=n.n(pe);const H=(0,Jt.Z)({input:{}},{name:"CatalogReactEntityAutocompletePickerInput"});function N(y){const j=H();return(0,h.jsx)(be.Z,{variant:"outlined",...y,className:Ie()(j.input,y.className)})}function ce(y){var j;const{label:L,name:P,path:ae,showCounts:re,Filter:_,InputProps:ue,initialSelectedOptions:Ee=[]}=y,{updateFilters:Re,filters:ze,queryParameters:{[P]:Fe}}=rt(),We=(0,p.h_)(W),{value:it}=(0,et.default)(async()=>{var Pt;const Kt=ae,{facets:Tn}=await We.getEntityFacets({facets:[Kt],filter:(Pt=ze.kind)===null||Pt===void 0?void 0:Pt.getCatalogFilters()});return Object.fromEntries(Tn[Kt].map(({value:hr,count:Tr})=>[hr,Tr]))},[ze.kind]),Et=(0,F.useMemo)(()=>[Fe].flat().filter(Boolean),[Fe]);var De;const[He,Tt]=(0,F.useState)(Et.length?Et:(De=(j=ze[P])===null||j===void 0?void 0:j.values)!==null&&De!==void 0?De:Ee);(0,F.useEffect)(()=>{Et.length&&Tt(Et)},[Et]);const tn=Object.keys(it!=null?it:{}),An=He.length&&tn.length;(0,F.useEffect)(()=>{Re({[P]:An?new _(He):void 0})},[P,An,He,_,Re]);const Ot=ze[P];return Ot&&typeof Ot=="object"&&!("values"in Ot)||!tn.length||tn.length<=1?null:(0,h.jsx)(D.Z,{pb:1,pt:1,children:(0,h.jsxs)(E.Z,{variant:"button",component:"label",children:[L,(0,h.jsx)(Je.ZP,{multiple:!0,disableCloseOnSelect:!0,options:tn,value:He,onChange:(Pt,Kt)=>Tt(Kt),renderOption:(Pt,{selected:Kt})=>(0,h.jsx)(Ln,{selected:Kt,value:Pt,availableOptions:it,showCounts:!!re}),size:"small",popupIcon:(0,h.jsx)(Vt.Z,{"data-testid":`${String(P)}-picker-expand`}),renderInput:Pt=>(0,h.jsx)(N,{...Pt,...ue})})]})})}const Ae=(0,Jt.Z)({input:{}},{name:"CatalogReactEntityLifecyclePicker"}),$e=y=>{const{initialFilter:j=[]}=y,L=Ae();return(0,h.jsx)(ce,{label:"Lifecycle",name:"lifecycles",path:"spec.lifecycle",Filter:$t,InputProps:{className:L.input},initialSelectedOptions:j})};var qe=n(6232),It=n(98685),Bt=n(62367),nn=n(72579),ln=n.n(nn);function rn(y,j){var L,P;const ae=(L=j)===null||L===void 0?void 0:L.defaultKind;let re,_,ue;if("metadata"in y?(re=y.kind,_=y.metadata.namespace,ue=y.metadata.name):(re=y.kind,_=y.namespace,ue=y.name),(_===void 0||_==="")&&(_=I.zG),((P=j)===null||P===void 0?void 0:P.defaultNamespace)!==void 0){var Ee;((Ee=j)===null||Ee===void 0?void 0:Ee.defaultNamespace)===_&&(_=void 0)}else _===I.zG&&(_=void 0);return re=re.toLocaleLowerCase("en-US"),re=ae&&ae.toLocaleLowerCase("en-US")===re?void 0:re,`${re?`${re}:`:""}${_?`${_}/`:""}${ue}`}function ee(y,j){for(const L of["spec.profile.displayName","metadata.title"]){const P=ln()(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:_,name:ue,namespace:Ee}=(0,I.of)(re);return{apiVersion:"backstage.io/v1beta1",kind:_,metadata:{name:ue,namespace:Ee}}}).sort((re,_)=>(re.metadata.namespace||"").localeCompare(_.metadata.namespace||"","en-US")||re.metadata.name.localeCompare(_.metadata.name,"en-US")||re.kind.localeCompare(_.kind,"en-US"))).catch(()=>[])});return(0,Gt.default)(async(P,ae)=>{var re;const _=await L;if(!_)return{items:[]};var ue;const Ee=(ue=(re=ae)===null||re===void 0?void 0:re.limit)!==null&&ue!==void 0?ue:20,{text:Re,start:ze}=G(P),Fe=_.filter(it=>M(Re,it)),We=ze+Ee;return{items:Fe.slice(0,We),...O({entities:Fe,limit:We,payload:{text:Re,start:We}})}},[L],{loading:!0,value:{items:[]}})}function G(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 Y(){const y=(0,p.h_)(W);return(0,Gt.default)(async(j,L)=>{var P;const ae=j,re=j;var _;const ue=(_=(P=L)===null||P===void 0?void 0:P.limit)!==null&&_!==void 0?_:20;if(re.cursor){const Re=await y.queryEntities({cursor:re.cursor,limit:ue});return{cursor:Re.pageInfo.nextCursor,items:[...re.items,...Re.items]}}const Ee=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:ue});return{cursor:Ee.pageInfo.nextCursor,items:Ee.items}},[],{loading:!0})}var he=n(21638);function we({mode:y,initialSelectedOwnersRefs:j}){const L=y==="owners-only",P=Y(),ae=te({enabled:L}),[re,_]=L?ae:P;return[re,_,Oe({enabled:!L,initialSelectedOwnersRefs:j})]}function Oe({enabled:y,initialSelectedOwnersRefs:j}){const L=(0,F.useRef)({}),P=(0,p.h_)(W),[,ae]=(0,Gt.default)(async()=>{(await P.getEntitiesByRefs({entityRefs:j})).items.forEach(_=>{_&&(L.current[(0,I.eE)(_)]=_)})},[]);return(0,he.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"}),tt=(0,h.jsx)(In.Z,{fontSize:"small"}),mt=(0,h.jsx)(Nn.Z,{fontSize:"small"}),wt=y=>{var j,L,P;const ae=Xe(),{mode:re="owners-only"}=y||{},{updateFilters:_,filters:ue,queryParameters:{owners:Ee}}=rt(),[Re,ze]=(0,F.useState)(""),Fe=(0,F.useMemo)(()=>[Ee].flat().filter(Boolean),[Ee]);var We;const[it,Et]=(0,F.useState)(Fe.length?Fe:(We=(j=ue.owners)===null||j===void 0?void 0:j.values)!==null&&We!==void 0?We:[]),[{value:De,loading:He},Tt,tn]=we({mode:re,initialSelectedOwnersRefs:it});(0,qe.b)(()=>Tt({text:Re}),[Re,Tt],250);const An=((L=De)===null||L===void 0?void 0:L.items)||[];return(0,F.useEffect)(()=>{if(Fe.length){const Ot=new yt(Fe);Et(Ot.values)}},[Fe]),(0,F.useEffect)(()=>{_({owners:it.length?new yt(it):void 0})},[it,_]),["user","group"].includes(((P=ue.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)(E.Z,{variant:"button",component:"label",children:["Owner",(0,h.jsx)(Je.ZP,{multiple:!0,disableCloseOnSelect:!0,loading:He,options:An,value:it,getOptionSelected:(Ot,Pt)=>typeof Pt=="string"?(0,I.eE)(Ot)===Pt:Ot===Pt,getOptionLabel:Ot=>{const Pt=typeof Ot=="string"?tn.getEntity(Ot)||(0,I.of)(Ot,{defaultKind:"group",defaultNamespace:"default"}):Ot;return ee(Pt,rn(Pt))},onChange:(Ot,Pt)=>{ze(""),Et(Pt.map(Kt=>{const Tn=typeof Kt=="string"?Kt:(0,I.eE)(Kt);return typeof Kt!="string"&&tn.setEntity(Kt),Tn}))},filterOptions:Ot=>Ot,renderOption:(Ot,{selected:Pt})=>{const Kt=Ot.kind.toLocaleLowerCase("en-US")==="group";return(0,h.jsx)(sn.Z,{control:(0,h.jsx)(Rn.Z,{icon:tt,checkedIcon:mt,checked:Pt}),onClick:Tn=>Tn.preventDefault(),label:(0,h.jsxs)(D.Z,{display:"flex",flexWrap:"wrap",alignItems:"center",children:[Kt?(0,h.jsx)(Bt.Z,{fontSize:"small"}):(0,h.jsx)(It.Z,{fontSize:"small"}),"\xA0",ee(Ot,rn(Ot,{defaultKind:Ot.kind}))]})})},size:"small",popupIcon:(0,h.jsx)(Vt.Z,{"data-testid":"owner-picker-expand"}),renderInput:Ot=>(0,h.jsx)(be.Z,{...Ot,className:ae.input,onChange:Pt=>{ze(Pt.currentTarget.value)},variant:"outlined"}),ListboxProps:{onScroll:Ot=>{var Pt;const Kt=Ot.currentTarget;Math.abs(Kt.scrollHeight-Kt.clientHeight-Kt.scrollTop)<1&&(!((Pt=De)===null||Pt===void 0)&&Pt.cursor)&&Tt({items:De.items,cursor:De.cursor})},"data-testid":"owner-picker-listbox"}})]})})};var dt=n(51837);const Be=(0,dt.uW)("catalog:entity-route-ref",()=>(0,p.NT)({id:"catalog:entity",params:["namespace","kind","name"]}));function At(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 Ut=n(80030);const xt=(0,F.forwardRef)((y,j)=>{var L;const{entityRef:P,defaultKind:ae,title:re,children:_,...ue}=y,Ee=(0,p.tg)(Be);let Re,ze,Fe;if(typeof P=="string"){const He=(0,I.of)(P);Re=He.kind,ze=He.namespace,Fe=He.name}else"metadata"in P?(Re=P.kind,ze=P.metadata.namespace,Fe=P.metadata.name):(Re=P.kind,ze=P.namespace,Fe=P.name);Re=Re.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:Re,namespace:ze,name:Fe},Et=rn({kind:Re,namespace:ze,name:Fe},{defaultKind:ae}),De=(0,h.jsxs)(R.rU,{...ue,ref:j,to:Ee(it),children:[_,!_&&(re!=null?re:Et)]});return re?(0,h.jsx)(Ut.ZP,{title:Et,children:De}):De});function Nt(y){const{entityRefs:j,defaultKind:L,getTitle:P,...ae}=y,re=(0,p.h_)(W),{value:_=new Array,loading:ue,error:Ee}=(0,et.default)(async()=>{const Re=j.reduce((Fe,We)=>typeof We=="object"&&"metadata"in We?Fe:[...Fe,(0,I.of)(We)],new Array),ze=j.filter(Fe=>typeof Fe=="object"&&"metadata"in Fe);return Re.length>0?[...(await re.getEntities({filter:Re.map(Fe=>({kind:Fe.kind,"metadata.namespace":Fe.namespace,"metadata.name":Fe.name}))})).items,...ze]:ze},[j]);return ue?(0,h.jsx)(R.Ex,{}):Ee?(0,h.jsx)(R.yu,{error:Ee}):(0,h.jsx)(h.Fragment,{children:_.map((Re,ze)=>(0,h.jsxs)(F.Fragment,{children:[ze>0&&", ",(0,h.jsx)(xt,{...ae,defaultKind:L,entityRef:Re,title:P(Re)})]},ze))})}function Qt(y){const{entityRefs:j,defaultKind:L,fetchEntities:P,getTitle:ae,...re}=y;return P?(0,h.jsx)(Nt,{...re,defaultKind:L,entityRefs:j,getTitle:ae}):(0,h.jsx)(h.Fragment,{children:j.map((_,ue)=>(0,h.jsxs)(F.Fragment,{children:[ue>0&&", ",(0,h.jsx)(xt,{...re,defaultKind:L,entityRef:_,title:ae?ae(_):void 0})]},ue))})}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,{})})},Ft=y=>_jsx(IconButton,{component:Link,"aria-label":"Email",title:`Email ${y.email}`,to:`mailto:${y.email}`,children:_jsx(EmailIcon,{})}),bt=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},jt=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"}})),Xt=4,lr=y=>{var j,L,P;const{entityRef:ae,children:re,delayTime:_=500}=y,ue=Mt(),Ee=useApiHolder(),Re=usePopupState({variant:"popover",popupId:"entity-peek-ahead"}),[ze,Fe]=useState(!1),We=useMemo(()=>debounce(()=>Fe(!0),_),[_]),[{loading:it,error:Et,value:De},He]=useAsyncFn(async()=>{const tn=Ee.get(catalogApiRef);if(tn){const An=await tn.getEntityByRef(ae);if(!An)throw new Error(`${ae} not found`);return An}},[Ee,ae]),Tt=()=>{Fe(!1),We.cancel()};return useEffect(()=>{Re.isOpen&&!De&&!Et&&!it&&He()},[Re.isOpen,He,De,Et,it]),_jsxs(_Fragment,{children:[_jsx(Typography,{component:"span",onMouseEnter:We,children:_jsx(Typography,{component:"span","data-testid":"trigger",...bindHover(Re),children:re})}),ze&&_jsx(HoverPopover,{PaperProps:{className:ue.popoverPaper},...bindPopover(Re),anchorOrigin:{vertical:"bottom",horizontal:"center"},transformOrigin:{vertical:"top",horizontal:"center"},onMouseLeave:Tt,children:_jsxs(Card,{children:[_jsxs(CardContent,{children:[Et&&_jsx(ResponseErrorPanel,{error:Et}),it&&_jsx(Progress,{}),De&&_jsxs(_Fragment,{children:[_jsx(Typography,{color:"textSecondary",children:De.metadata.namespace}),_jsx(Typography,{variant:"h5",component:"div",children:De.metadata.name}),_jsx(Typography,{color:"textSecondary",gutterBottom:!0,children:De.kind}),De.metadata.description&&_jsx(Typography,{className:ue.descriptionTypography,paragraph:!0,children:De.metadata.description}),_jsx(Typography,{children:(j=De.spec)===null||j===void 0?void 0:j.type}),_jsxs(Box,{marginTop:"0.5em",children:[(De.metadata.tags||[]).slice(0,Xt).map(tn=>_jsx(Chip,{size:"small",label:tn},tn)),((L=De.metadata.tags)===null||L===void 0?void 0:L.length)&&((P=De.metadata.tags)===null||P===void 0?void 0:P.length)>Xt&&_jsx(Tooltip,{title:"Drill into the entity to see all of the tags.",children:_jsx(Chip,{size:"small",label:"..."},"other-tags")})]})]})]}),!Et&&De&&_jsx(CardActions,{children:_jsxs(_Fragment,{children:[isUserEntity(De)&&_jsx(UserCardActions,{entity:De}),isGroupEntity(De)&&_jsx(GroupCardActions,{entity:De}),_jsx(EntityCardActions,{entity:De})]})})]})})]})},Cr=(0,Jt.Z)(y=>({searchToolbar:{paddingLeft:0,paddingRight:0},input:{}}),{name:"CatalogReactEntitySearchBar"}),rr=()=>{var y;const j=Cr(),{filters:L,updateFilters:P}=useEntityList();var ae;const[re,_]=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:ue=>_(ue.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:()=>_(""),edge:"end",disabled:re.length===0,children:_jsx(Clear,{})})})})})})},bn=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)||rn(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)(xt,{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(ue){return(0,U.hF)(ue,L,ae)}function _(ue){return re(ue).map(Ee=>rn(Ee,{defaultKind:P})).join(", ")}return{title:j,customFilterAndSearch(ue,Ee){return _(Ee).includes(ue)},customSort(ue,Ee){return _(ue).localeCompare(_(Ee))},render:ue=>(0,h.jsx)(Qt,{entityRefs:re(ue),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"}}}),_n=[bn.createEntityRefColumn({defaultKind:"system"}),bn.createDomainColumn(),bn.createOwnerColumn(),bn.createMetadataDescriptionColumn()],fr=[bn.createEntityRefColumn({defaultKind:"component"}),bn.createSystemColumn(),bn.createOwnerColumn(),bn.createSpecTypeColumn(),bn.createSpecLifecycleColumn(),bn.createMetadataDescriptionColumn()],wr=(0,Jt.Z)(y=>({empty:{padding:y.spacing(2),display:"flex",justifyContent:"center"}})),Yn=y=>{const{entities:j,title:L,emptyContent:P,variant:ae="gridItem",columns:re,tableOptions:_={}}=y,ue=wr(),Ee={minWidth:"0",width:"100%"};return ae==="gridItem"&&(Ee.height="calc(100% - 10px)"),(0,h.jsx)(R.iA,{columns:re,title:L,style:Ee,emptyContent:P&&(0,h.jsx)("div",{className:ue.empty,children:P}),options:{search:!1,paging:!1,actionsColumnIndex:-1,padding:"dense",draggable:!1,..._},data:j})};Yn.columns=bn,Yn.systemEntityColumns=_n,Yn.componentEntityColumns=fr;const zr=(0,Jt.Z)({input:{}},{name:"CatalogReactEntityTagPicker"}),jr=y=>{const j=zr();return(0,h.jsx)(ce,{label:"Tags",name:"tags",path:"metadata.tags",Filter:k,showCounts:y.showCounts,InputProps:{className:j.input}})},Nr=y=>{const{hidden:j,initialFilter:L}=y,P=(0,p.h_)(p.$v),{error:ae,availableTypes:re,selectedTypes:_,setSelectedTypes:ue}=gt();if((0,F.useEffect)(()=>{ae&&P.post({message:"Failed to load entity types",severity:"error"}),L&&ue([L])},[ae,P,L,ue]),re.length===0||ae)return null;const Ee=[{value:"all",label:"all"},...re.map(ze=>({value:ze,label:ze}))];var Re;return j?null:(0,h.jsx)(D.Z,{pb:1,pt:1,children:(0,h.jsx)(R.Ph,{label:"Type",items:Ee,selected:(Re=Ee.length>1?_[0]:void 0)!==null&&Re!==void 0?Re:"all",onChange:ze=>ue(ze==="all"?[]:[String(ze)])})})};var C=n(15459),c=n(61837),b=n(11640),A=n(28347);const J=(0,C.Z)({root:{color:"#f3ba37"}})(b.Z),ve=y=>{const{toggleStarredEntity:j,isStarredEntity:L}=pn(y.entity);return(0,h.jsx)(c.Z,{"aria-label":"favorite",color:"inherit",...y,onClick:()=>j(),children:(0,h.jsx)(Ut.ZP,{title:L?"Remove from favorites":"Add to favorites",children:L?(0,h.jsx)(J,{}):(0,h.jsx)(A.Z,{})})})};var je=n(8629),ke=n(79249),nt=n(38724),_t=n(99152),an=n(6487),En=n(49429),gn=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:_,value:ue}=(0,et.default)(async()=>{const Ee=await P.getEntityAncestors({entityRef:ae}),Re=new Array,ze=new Array;for(const Fe of Ee.items){const We=(0,I.eE)(Fe.entity),it=We===Ee.rootEntityRef;Re.push({id:We,root:it,...Fe.entity});for(const Et of Fe.parentEntityRefs)ze.push({from:We,to:Et})}return{nodes:Re,edges:ze}},[ae]);return{loading:re,error:_,nodes:((j=ue)===null||j===void 0?void 0:j.nodes)||[],edges:((L=ue)===null||L===void 0?void 0:L.edges)||[]}}function Ho({node:y}){const j=Vo(),L=(0,Zt.s0)(),P=(0,p.tg)(Be),[ae,re]=(0,F.useState)(0),[_,ue]=(0,F.useState)(0),Ee=(0,F.useRef)(null);(0,F.useLayoutEffect)(()=>{if(Ee.current){let{height:He,width:Tt}=Ee.current.getBBox();He=Math.round(He),Tt=Math.round(Tt),(He!==_||Tt!==ae)&&(re(Tt),ue(He))}},[ae,_]);const Re=10,ze=_,Fe=ze+Re,We=Fe+ae+Re*2,it=_+Re*2,Et=y.metadata.title||(y.kind&&y.metadata.name&&y.metadata.namespace?rn({kind:y.kind,name:y.metadata.name,namespace:y.metadata.namespace||""}):y.id),De=()=>{L(P({kind:y.kind,namespace:y.metadata.namespace||I.zG,name:y.metadata.name}))};return(0,h.jsxs)("g",{onClick:De,className:j.clickable,children:[(0,h.jsx)("rect",{className:Ie()(j.node,y.root?"secondary":"primary"),width:We,height:it,rx:10}),(0,h.jsx)(Vr,{kind:y.kind,y:Re,x:Re,width:ze,height:ze,className:Ie()(j.text,y.root?"secondary":"primary")}),(0,h.jsx)("text",{ref:Ee,className:Ie()(j.text,y.root?"secondary":"primary"),y:it/2,x:Fe+(ae+Re*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)(gn.Z,{variant:"h2",children:"Ancestry"}),(0,h.jsxs)(gn.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),cr=n(38402),Hr=n(86136),qr=n(99688),wo=n(49378),jo=n(54506),Fr=n(94339),Ko=n(24579),Eo=n(27685);const Fn=(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 dr(y){const j=Fn();return(0,h.jsx)(wo.Z,{...y,primaryTypographyProps:{className:j.monospace},secondaryTypographyProps:{className:j.monospace}})}function Gr(y){const j=Fn();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)(Fr.Z,{variant:"outlined",children:(0,h.jsxs)(Ko.Z,{children:[(0,h.jsxs)(E.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 gr(y){const[j,L]=y.entry,P=Yo(L);return(0,h.jsxs)(cr.Z,{children:[y.indent&&(0,h.jsx)(Hr.Z,{}),(0,h.jsx)(dr,{primary:j,secondary:P?(0,h.jsx)(R.rU,{to:P,children:L}):L})]})}function Ao(y){const j=Fn();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),_=(j=y.metadata.annotations)===null||j===void 0?void 0:j[I.P1],ue=(L=y.metadata.annotations)===null||L===void 0?void 0:L[I.q1],{loading:Ee,error:Re,value:ze}=(0,et.default)(async()=>!_&&!ue?[]:(await ae.getEntities({filter:[..._?[{[`metadata.annotations.${I.P1}`]:_}]:[],...ue?[{[`metadata.annotations.${I.q1}`]:ue}]:[]]})).items,[_,ue]);return{loading:Ee,error:Re,location:_,originLocation:ue,colocatedEntities:(P=ze)===null||P===void 0?void 0:P.filter(Fe=>(0,I.eE)(Fe)!==re)}}function Zr(y){return(0,h.jsxs)(Er.Z,{dense:!0,children:[y.header&&(0,h.jsx)(gr,{entry:y.header},"header"),y.entities.map(j=>(0,h.jsxs)(cr.Z,{children:[(0,h.jsx)(Hr.Z,{children:(0,h.jsx)(Vr,{kind:j.kind})}),(0,h.jsx)(dr,{primary:(0,h.jsx)(xt,{entityRef:j})})]},(0,I.eE)(j)))]})}function Io(y){var j;const{entity:L}=y,{loading:P,error:ae,location:re,originLocation:_,colocatedEntities:ue}=Ro(L);if(P)return(0,h.jsx)(R.Ex,{});if(ae)return(0,h.jsx)(R.Gk,{error:ae});if(!re&&!_)return(0,h.jsx)(qr.Z,{severity:"warning",children:"Entity had no location information."});if(!(!((j=ue)===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===_)return(0,h.jsx)(Zr,{entities:ue});const Ee=ue.filter(ze=>{var Fe;return((Fe=ze.metadata.annotations)===null||Fe===void 0?void 0:Fe[I.P1])===re}),Re=ue.filter(ze=>{var Fe;return((Fe=ze.metadata.annotations)===null||Fe===void 0?void 0:Fe[I.q1])===_});return(0,h.jsxs)(h.Fragment,{children:[Ee.length>0&&(0,h.jsx)(Zr,{entities:Ee,header:["At the same location",re]}),Re.length>0&&(0,h.jsx)(Zr,{entities:Re,header:["At the same origin",_]})]})}function Jo(y){const j=To();return(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(gn.Z,{variant:"h2",children:"Colocated"}),(0,h.jsx)(gn.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)(gn.Z,{variant:"h2",children:"Entity as JSON"}),(0,h.jsx)(gn.Z,{children:"This is the raw entity data as received from the catalog, on JSON form."}),(0,h.jsx)(gn.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 ur=(0,Jt.Z)({root:{display:"flex",flexDirection:"column"}});function ci(y){var j,L,P;const ae=ur(),{apiVersion:re,kind:_,metadata:ue,spec:Ee,relations:Re=[],status:ze={}}=y.entity,Fe=Lo()(ft()(Re,We=>We.targetRef),"type");return(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(gn.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)(cr.Z,{children:(0,h.jsx)(dr,{primary:"apiVersion",secondary:re})}),(0,h.jsx)(cr.Z,{children:(0,h.jsx)(dr,{primary:"kind",secondary:_})}),((j=Ee)===null||j===void 0?void 0:j.type)&&(0,h.jsx)(cr.Z,{children:(0,h.jsx)(dr,{primary:"spec.type",secondary:Ee.type})}),ue.uid&&(0,h.jsx)(cr.Z,{children:(0,h.jsx)(dr,{primary:"uid",secondary:ue.uid})}),ue.etag&&(0,h.jsx)(cr.Z,{children:(0,h.jsx)(dr,{primary:"etag",secondary:ue.etag})})]})}),(0,h.jsxs)(Kr,{title:"Metadata",children:[!!Object.keys(ue.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(ue.annotations).map(We=>(0,h.jsx)(gr,{indent:!0,entry:We},We[0]))}),!!Object.keys(ue.labels||{}).length&&(0,h.jsx)(Er.Z,{dense:!0,subheader:(0,h.jsx)(Gr,{children:"Labels"}),children:Object.entries(ue.labels).map(We=>(0,h.jsx)(gr,{indent:!0,entry:We},We[0]))}),!!(!((L=ue.tags)===null||L===void 0)&&L.length)&&(0,h.jsx)(Er.Z,{dense:!0,subheader:(0,h.jsx)(Gr,{children:"Tags"}),children:ue.tags.map((We,it)=>(0,h.jsxs)(cr.Z,{children:[(0,h.jsx)(Hr.Z,{}),(0,h.jsx)(dr,{primary:We})]},`${We}-${it}`))})]}),!!Re.length&&(0,h.jsx)(Kr,{title:"Relations",helpLink:"https://backstage.io/docs/features/software-catalog/well-known-relations",children:Object.entries(Fe).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(De=>(0,h.jsxs)(cr.Z,{children:[(0,h.jsx)(Hr.Z,{children:(0,h.jsx)(Vr,{entityRef:De.targetRef})}),(0,h.jsx)(dr,{primary:(0,h.jsx)(xt,{entityRef:De.targetRef})})]},De.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)(E.Z,{children:[We.level,": ",We.type]}),(0,h.jsx)(D.Z,{ml:2,children:We.message})]},it))})]})]})}var Qo=n(10921);function js(y){return(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(gn.Z,{variant:"h2",children:"Entity as YAML"}),(0,h.jsx)(gn.Z,{children:"This is the raw entity data as received from the catalog, on YAML form."}),(0,h.jsx)(gn.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)(je.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)(ke.Z,{id:"entity-inspector-dialog-title",children:"Entity Inspector"}),(0,h.jsx)(nt.Z,{dividers:!0,children:(0,h.jsxs)("div",{className:j.root,children:[(0,h.jsxs)(_t.Z,{orientation:"vertical",variant:"scrollable",value:L,onChange:(ae,re)=>P(re),"aria-label":"Inspector options",className:j.tabs,children:[(0,h.jsx)(an.Z,{label:"Overview",...to(0)}),(0,h.jsx)(an.Z,{label:"Ancestry",...to(1)}),(0,h.jsx)(an.Z,{label:"Colocated",...to(2)}),(0,h.jsx)(an.Z,{label:"Raw JSON",...to(3)}),(0,h.jsx)(an.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)(En.Z,{children:(0,h.jsx)(z.Z,{onClick:y.onClose,color:"primary",children:"Close"})})]}):null}var Ar=n(85256);function qn(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",_=(0,et.default)(async()=>{const Et=L.getLocationByRef(P);let De;if(!P)De=Promise.resolve([]);else{const He=`metadata.annotations.${I.q1}`;De=L.getEntities({filter:{[He]:P},fields:["kind","metadata.uid","metadata.name","metadata.namespace"]}).then(Tt=>Tt.items)}return Promise.all([Et,De]).then(([He,Tt])=>({location:He,colocatedEntities:Tt}))},[L,y]),ue=(0,F.useCallback)(async function(){const{location:De}=_.value;await L.removeLocationById(De.id)},[L,_]),Ee=(0,F.useCallback)(async function(){await L.removeEntityByUid(ae)},[L,ae]);if(re)return{type:"bootstrap",location:P,deleteEntity:Ee};const{loading:Re,error:ze,value:Fe}=_;if(Re)return{type:"loading"};if(ze)return{type:"error",error:ze};const{location:We,colocatedEntities:it}=Fe;return We?{type:"unregister",location:P,colocatedEntities:it.map(I.iB),unregisterLocation:ue,deleteEntity:Ee}:{type:"only-delete",deleteEntity:Ee}}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(),_=qn(y),[ue,Ee]=(0,F.useState)(!1),[Re,ze]=(0,F.useState)(!1);var Fe;const We=(Fe=ae.getOptionalString("app.title"))!==null&&Fe!==void 0?Fe:"Backstage",it=(0,F.useCallback)(async function(){if("unregisterLocation"in _){ze(!0);try{await _.unregisterLocation(),j()}catch(Tt){(0,ho.BD)(Tt),P.post({message:Tt.message})}finally{ze(!1)}}},[P,j,_]),Et=(0,F.useCallback)(async function(){if("deleteEntity"in _){ze(!0);try{await _.deleteEntity(),j()}catch(Tt){(0,ho.BD)(Tt),P.post({message:Tt.message})}finally{ze(!1)}}},[P,j,_]),De=()=>(0,h.jsx)(En.Z,{className:re.dialogActions,children:(0,h.jsx)(z.Z,{onClick:L,color:"primary",children:"Cancel"})});return _.type==="loading"?(0,h.jsx)(R.Ex,{}):_.type==="error"?(0,h.jsx)(R.Gk,{error:_.error}):_.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 "',_.location,'"). If you believe this is in error, please contact the ',We," ","integrator."]}),(0,h.jsxs)(D.Z,{marginTop:2,children:[!ue&&(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(z.Z,{variant:"text",size:"small",color:"primary",className:re.advancedButton,onClick:()=>Ee(!0),children:"Advanced Options"}),(0,h.jsx)(De,{})]}),ue&&(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(gn.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:Re,onClick:Et,children:"Delete Entity"}),(0,h.jsx)(De,{})]})]})]}):_.type==="only-delete"?(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(gn.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:Re,onClick:Et,children:"Delete Entity"}),(0,h.jsx)(De,{})]}):_.type==="unregister"?(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(gn.Z,{children:"This action will unregister the following entities:"}),(0,h.jsx)(gn.Z,{component:"ul",children:_.colocatedEntities.map(He=>(0,h.jsx)("li",{children:(0,h.jsx)(xt,{entityRef:He})},`${He.kind}:${He.namespace}/${He.name}`))}),(0,h.jsx)(gn.Z,{children:"Located at the following location:"}),(0,h.jsx)(gn.Z,{component:"ul",children:(0,h.jsx)("li",{children:_.location})}),(0,h.jsxs)(gn.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:Re,onClick:it,children:"Unregister Location"}),!ue&&(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:()=>Ee(!0),children:"Advanced Options"})})]}),ue&&(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(D.Z,{paddingTop:4,paddingBottom:4,children:(0,h.jsx)(Ar.Z,{})}),(0,h.jsx)(gn.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:Re,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)(je.Z,{open:j,onClose:P,children:[(0,h.jsx)(ke.Z,{id:"responsive-dialog-title",children:"Are you sure you want to unregister this entity?"}),(0,h.jsx)(nt.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:b.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 _=(re=ae.getOptionalString("organization.name"))!==null&&re!==void 0?re:"Company",{filters:ue,updateFilters:Ee,backendEntities:Re,queryParameters:{kind:ze,user:Fe},loading:We}=rt(),it=["starred","all"],Et=po(_).map(zn=>({...zn,items:zn.items.filter(({id:mn})=>["group","user"].some(Bn=>Bn===ze)?it.includes(mn):!L||L.includes(mn))})).filter(({items:zn})=>!!zn.length),{isStarredEntity:De}=cn(),{isOwnedEntity:He,loading:Tt}=Cn(),tn=We||Tt,An=(0,F.useMemo)(()=>new Rt("owned",He,De),[He,De]),Ot=(0,F.useMemo)(()=>new Rt("starred",He,De),[He,De]),Pt=(0,F.useMemo)(()=>[Fe].flat()[0],[Fe]),[Kt,Tn]=(0,F.useState)(Pt!=null?Pt:j),hr=(0,F.useMemo)(()=>Re.filter((0,U.Gz)((0,ut.compact)(Object.values({...ue,user:void 0})))),[ue,Re]),Tr=(0,F.useMemo)(()=>({all:hr.length,starred:hr.filter(zn=>Ot.filterEntity(zn)).length,owned:hr.filter(zn=>An.filterEntity(zn)).length}),[hr,Ot,An]);(0,F.useEffect)(()=>{Pt&&Tn(Pt)},[Pt]),(0,F.useEffect)(()=>{!tn&&Kt&&Kt!=="all"&&Tr[Kt]===0&&Tn("all")},[tn,Tr,Kt,Tn]),(0,F.useEffect)(()=>{Ee({user:Kt?new Rt(Kt,He,De):void 0})},[Kt,He,De,Ee]);var Yr;return(0,h.jsx)(Fr.Z,{className:P.root,children:Et.map(zn=>(0,h.jsxs)(F.Fragment,{children:[(0,h.jsx)(E.Z,{variant:"subtitle2",component:"span",className:P.title,children:zn.name}),(0,h.jsx)(Fr.Z,{className:P.groupWrapper,children:(0,h.jsx)(Er.Z,{disablePadding:!0,dense:!0,role:"menu","aria-label":zn.name,children:zn.items.map(mn=>{var Bn;return(0,h.jsxs)(_o.Z,{role:"none presentation",button:!0,divider:!0,onClick:()=>Tn(mn.id),selected:mn.id===((Bn=ue.user)===null||Bn===void 0?void 0:Bn.value),className:P.menuItem,disabled:Tr[mn.id]===0,"data-testid":`user-picker-${mn.id}`,tabIndex:0,ContainerProps:{role:"menuitem"},children:[mn.icon&&(0,h.jsx)(Hr.Z,{className:P.listIcon,children:(0,h.jsx)(mn.icon,{fontSize:"small"})}),(0,h.jsx)(wo.Z,{children:(0,h.jsxs)(E.Z,{variant:"body1",children:[mn.label," "]})}),(0,h.jsx)(As.Z,{children:(Yr=Tr[mn.id])!==null&&Yr!==void 0?Yr:"-"})]},mn.id)})})})]},zn.name))})},fo=(0,Jt.Z)({input:{}},{name:"CatalogReactEntityProcessingStatusPickerPicker"}),Ts=(0,h.jsx)(In.Z,{fontSize:"small"}),di=(0,h.jsx)(Nn.Z,{fontSize:"small"}),ts=()=>{const y=fo(),{updateFilters:j}=rt(),[L,P]=(0,F.useState)([]);function ae(ue){j({orphan:ue?new Dt(ue):void 0})}function re(ue){j({error:ue?new Yt(ue):void 0})}const _=["Is Orphan","Has Error"];return(0,h.jsx)(D.Z,{pb:1,pt:1,children:(0,h.jsxs)(E.Z,{variant:"button",component:"label",children:["Processing Status",(0,h.jsx)(Je.ZP,{multiple:!0,disableCloseOnSelect:!0,options:_,value:L,onChange:(ue,Ee)=>{P(Ee),ae(Ee.includes("Is Orphan")),re(Ee.includes("Has Error"))},renderOption:(ue,{selected:Ee})=>(0,h.jsx)(sn.Z,{control:(0,h.jsx)(Rn.Z,{icon:Ts,checkedIcon:di,checked:Ee}),onClick:Re=>Re.preventDefault(),label:ue}),size:"small",popupIcon:(0,h.jsx)(Vt.Z,{"data-testid":"processing-status-picker-expand"}),renderInput:ue=>(0,h.jsx)(be.Z,{...ue,className:y.input,variant:"outlined"})})]})})},ns=(0,Jt.Z)({input:{}},{name:"CatalogReactEntityNamespacePicker"}),dn=()=>{const y=ns();return(0,h.jsx)(ce,{label:"Namespace",name:"namespace",path:"metadata.namespace",Filter:zt,InputProps:{className:y.input}})};function Rs(y){var j;const{children:L,value:P}=y;var ae;const[re,_]=useState((ae=(j=P)===null||j===void 0?void 0:j.filters)!==null&&ae!==void 0?ae:{}),ue=useCallback(De=>{_(He=>{const Tt=typeof De=="function"?De(He):De;return{...He,...Tt}})},[]),Ee=useMemo(()=>({entities:[],backendEntities:[],queryParameters:{}}),[]);var Re,ze,Fe,We,it;const Et=useMemo(()=>{var De,He,Tt,tn,An,Ot;return{entities:(Re=(De=P)===null||De===void 0?void 0:De.entities)!==null&&Re!==void 0?Re:Ee.entities,backendEntities:(ze=(He=P)===null||He===void 0?void 0:He.backendEntities)!==null&&ze!==void 0?ze:Ee.backendEntities,updateFilters:(Fe=(Tt=P)===null||Tt===void 0?void 0:Tt.updateFilters)!==null&&Fe!==void 0?Fe:ue,filters:re,loading:(We=(tn=P)===null||tn===void 0?void 0:tn.loading)!==null&&We!==void 0?We:!1,queryParameters:(it=(An=P)===null||An===void 0?void 0:An.queryParameters)!==null&&it!==void 0?it:Ee.queryParameters,error:(Ot=P)===null||Ot===void 0?void 0:Ot.error}},[P,Ee,re,ue]);return _jsx(EntityListContext.Provider,{value:Et,children:L})}},75435:function(Lt,Le,n){"use strict";n.d(Le,{h:function(){return p}});var r=n(25271);function p(W,f,V){var m,h,F;let ye=((h=W)===null||h===void 0||(m=h.relations)===null||m===void 0?void 0:m.filter(le=>le.type===f).map(le=>(0,r.of)(le.targetRef)))||[];return!((F=V)===null||F===void 0)&&F.kind&&(ye=ye.filter(le=>le.kind.toLocaleLowerCase("en-US")===V.kind.toLocaleLowerCase("en-US"))),ye}},49280:function(Lt,Le,n){"use strict";n.d(Le,{hF:function(){return W.h},CV:function(){return V},wq:function(){return r},Gz:function(){return p}});function r(h){return h.reduce((F,ye)=>({...F,...ye.getCatalogFilters?ye.getCatalogFilters():{}}),{})}function p(h){return F=>h.every(ye=>!ye.filterEntity||ye.filterEntity(F))}var W=n(75435),f=n(25271);function V(h,F){var ye;const le=(ye=h.metadata.annotations)===null||ye===void 0?void 0:ye[f.M6];if(le)try{var z;const de=(0,f.Ou)(le),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 ye=new Set([...getEntityRelations(h,RELATION_MEMBER_OF,{kind:"group"}),...h?[getCompoundEntityRef(h)]:[]].map(stringifyEntityRef)),le=getEntityRelations(F,RELATION_OWNED_BY).map(stringifyEntityRef);for(const z of le)if(ye.has(z))return!0;return!1}},8799:function(Lt,Le,n){"use strict";n.r(Le),n.d(Le,{AboutCard:function(){return Yt},AboutContent:function(){return Rt},AboutField:function(){return Ke}});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),ye={async check(ct){return F(ct)===ct}},le=ct=>ct.apiVersion==="scaffolder.backstage.io/v1beta3"&&ct.kind==="Template";var z=n(79692),de=n(94339),D=n(32552),E=n(61837),se=n(85256),ie=n(24579),ne=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)(ct=>({value:{fontWeight:"bold",overflow:"hidden",lineHeight:"24px",wordBreak:"break-word"},label:{color:ct.palette.text.secondary,textTransform:"uppercase",fontSize:"10px",fontWeight:"bold",letterSpacing:.5,overflow:"hidden",whiteSpace:"nowrap"}}));function Ke(ct){const{label:ut,value:St,gridSizes:lt,children:Zt}=ct,Gt=k(),Ce=(0,f.vJ)(Zt,Ye=>Ye.getElements()),Ne=Ce.length>0?Ce:(0,r.jsx)(Se.Z,{variant:"body2",className:Gt.value,children:St||"unknown"});return(0,r.jsxs)(U.Z,{item:!0,...lt,children:[(0,r.jsx)(Se.Z,{variant:"h2",className:Gt.label,children:ut}),Ne]})}var yt=n(24851);const $t=(0,z.Z)({description:{wordBreak:"break-word"}});function zt(ct,ut,St){if(ut==="url"||ct.includes("://"))return ct;const lt=St.type==="file"?`file://${St.target}`:St.target;return ut==="file"||St.type==="file"?new URL(ct,lt).href:lt}function Rt(ct){var ut,St,lt,Zt,Gt,Ce,Ne,Ye,ht,rt,et,vt,ot,Qe,ft,gt;const{entity:Ct}=ct,yn=$t(),hn=Ct.kind.toLocaleLowerCase("en-US")==="system",cn=Ct.kind.toLocaleLowerCase("en-US")==="resource",Sn=Ct.kind.toLocaleLowerCase("en-US")==="component",pn=Ct.kind.toLocaleLowerCase("en-US")==="api",xn=Ct.kind.toLocaleLowerCase("en-US")==="template",Cn=Ct.kind.toLocaleLowerCase("en-US")==="location",on=Ct.kind.toLocaleLowerCase("en-US")==="group",fn=(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 Vt;try{Vt=(0,p.CV)(Ct)}catch{Vt=void 0}return(0,r.jsxs)(U.Z,{container:!0,children:[(0,r.jsx)(Ke,{label:"Description",gridSizes:{xs:12},children:(0,r.jsx)(W.SA,{className:yn.description,content:((St=Ct)===null||St===void 0||(ut=St.metadata)===null||ut===void 0?void 0:ut.description)||"No description"})}),(0,r.jsx)(Ke,{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"})}),(hn||_e.length>0)&&(0,r.jsx)(Ke,{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"})}),(pn||Sn||cn||fn.length>0)&&(0,r.jsx)(Ke,{label:"System",value:"No System",gridSizes:{xs:12,sm:6,lg:4},children:fn.length>0&&(0,r.jsx)(m.rI,{entityRefs:fn,defaultKind:"system"})}),Sn&&wn.length>0&&(0,r.jsx)(Ke,{label:"Parent Component",value:"No Parent Component",gridSizes:{xs:12,sm:6,lg:4},children:(0,r.jsx)(m.rI,{entityRefs:wn,defaultKind:"component"})}),(pn||Sn||cn||xn||on||Cn||typeof((Zt=Ct)===null||Zt===void 0||(lt=Zt.spec)===null||lt===void 0?void 0:lt.type)=="string")&&(0,r.jsx)(Ke,{label:"Type",value:(Ce=Ct)===null||Ce===void 0||(Gt=Ce.spec)===null||Gt===void 0?void 0:Gt.type,gridSizes:{xs:12,sm:6,lg:4}}),(pn||Sn||typeof((Ye=Ct)===null||Ye===void 0||(Ne=Ye.spec)===null||Ne===void 0?void 0:Ne.lifecycle)=="string")&&(0,r.jsx)(Ke,{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)(Ke,{label:"Tags",value:"No Tags",gridSizes:{xs:12,sm:6,lg:4},children:(((vt=Ct)===null||vt===void 0||(et=vt.metadata)===null||et===void 0?void 0:et.tags)||[]).map(Je=>(0,r.jsx)(xe.Z,{size:"small",label:Je},Je))}),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)(Ke,{label:"Targets",gridSizes:{xs:12},children:(0,r.jsx)(yt.s,{cols:1,items:(Ct.spec.targets||[Ct.spec.target]).map(Je=>Je).map(Je=>{var Rn,sn;return{text:Je,href:zt(Je,((sn=Ct)===null||sn===void 0||(Rn=sn.spec)===null||Rn===void 0?void 0:Rn.type)||"unknown",Vt)}})})})]})}const Dt=(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(ct){var ut,St,lt,Zt,Gt,Ce,Ne;const{variant:Ye}=ct,ht=(0,f.qD)(),rt=Dt(),{entity:et}=(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),yn=(0,m.CV)(et,vt),hn=(ut=et.metadata.annotations)===null||ut===void 0?void 0:ut[p.Tf],cn={label:"View Source",disabled:!yn,icon:(0,r.jsx)(V.nW,{type:(St=yn)===null||St===void 0?void 0:St.integrationType}),href:(lt=yn)===null||lt===void 0?void 0:lt.locationTargetUrl},Sn={label:"View TechDocs",disabled:!(!((Zt=et.metadata.annotations)===null||Zt===void 0)&&Zt["backstage.io/techdocs-ref"])||!gt,icon:(0,r.jsx)(K.Z,{}),href:gt&>({namespace:et.metadata.namespace||p.zG,kind:et.kind,name:et.metadata.name})},pn=[cn,Sn];if(le(et)){var xn;const Jt=(xn=ht.getSystemIcon("scaffolder"))!==null&&xn!==void 0?xn:ne.Z,Vt={label:"Launch Template",icon:(0,r.jsx)(Jt,{}),disabled:!Ct,href:Ct&&Ct({templateName:et.metadata.name,namespace:et.metadata.namespace||p.zG})};pn.push(Vt)}let Cn="";Ye==="gridItem"?Cn=rt.gridItemCard:Ye==="fullHeight"&&(Cn=rt.fullHeightCard);let on="";Ye==="gridItem"?on=rt.gridItemCardContent:Ye==="fullHeight"&&(on=rt.fullHeightCardContent);const fn=(Gt=et.metadata.annotations)===null||Gt===void 0?void 0:Gt[p.P1],wn=((Ce=fn)===null||Ce===void 0?void 0:Ce.startsWith("url:"))||((Ne=fn)===null||Ne===void 0?void 0:Ne.startsWith("file:")),_e=(0,w.useCallback)(async()=>{try{await ot.refreshEntity((0,p.eE)(et)),Qe.post({message:"Refresh scheduled",severity:"info",display:"transient"})}catch(Jt){ft.post(Jt)}},[ot,Qe,ft,et]);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)(E.Z,{"aria-label":"Refresh",title:"Schedule entity refresh",onClick:_e,children:(0,r.jsx)(X.Z,{})}),(0,r.jsx)(E.Z,{component:W.rU,"aria-label":"Edit",disabled:!hn,title:"Edit Metadata",to:hn!=null?hn:"#",children:(0,r.jsx)(R.Z,{})})]}),subheader:(0,r.jsx)(W.M6,{links:pn})}),(0,r.jsx)(se.Z,{}),(0,r.jsx)(ie.Z,{className:on,children:(0,r.jsx)(Rt,{entity:et})})]})}},86359:function(Lt,Le,n){"use strict";n.d(Le,{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),ye=n(11640),le=n(28347),z=n(76635),de=n(2784),D=n(7089);const E=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,Ke=k&&k[R]||((Se=w)===null||Se===void 0?void 0:Se.defaultValue);return(0,r.jsx)(r.Fragment,{children:Ke&&(0,r.jsx)(D.Z,{label:Ke,size:"small",variant:"outlined"},Ke)})},width:"auto"}},createNamespaceColumn(){return{title:"Namespace",field:"entity.metadata.namespace",width:"auto"}}});var se=n(19928),ie=n.n(se);const ne=(0,m.Z)({root:{color:"#f3ba37"}})(ye.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:Ke,subtitle:yt,emptyContent:$t}=R,{isStarredEntity:zt,toggleStarredEntity:Rt}=(0,f.CR)(),{loading:Dt,error:Yt,entities:ct,filters:ut}=(0,f.wp)(),St=(0,de.useMemo)(()=>{var ot;return[E.createTitleColumn({hidden:!0}),E.createNameColumn({defaultKind:(ot=ut.kind)===null||ot===void 0?void 0:ot.value}),...Qe(),E.createMetadataDescriptionColumn(),E.createTagsColumn()];function Qe(){var ft;const gt=[E.createSystemColumn(),E.createOwnerColumn(),E.createSpecTypeColumn(),E.createSpecLifecycleColumn()];switch((ft=ut.kind)===null||ft===void 0?void 0:ft.value){case"user":return[];case"domain":case"system":return[E.createOwnerColumn()];case"group":case"template":return[E.createSpecTypeColumn()];case"location":return[E.createSpecTypeColumn(),E.createSpecTargetsColumn()];default:return ct.every(Ct=>Ct.metadata.namespace==="default")?gt:[...gt,E.createNamespaceColumn()]}}},[(w=ut.kind)===null||w===void 0?void 0:w.value,ct]),lt=ut.type===void 0;var Zt;const Gt=(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=zt(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)(ne,{}):(0,r.jsx)(le.Z,{})]}),tooltip:ft,onClick:()=>Rt(ot)}}],Ne=ct.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}}}),Ye=(Se||St).find(ot=>ot.title==="Type");Ye&&(Ye.hidden=!lt);const ht=Ne.length>20,rt=((U=ut.kind)===null||U===void 0?void 0:U.value)||"",et=((xe=ut.type)===null||xe===void 0?void 0:xe.value)||"",vt=[Gt,et,ie()(rt)].filter(ot=>ot).join(" ");return(0,r.jsx)(W.iA,{isLoading:Dt,columns:Se||St,options:{paging:ht,pageSize:20,actionsColumnIndex:-1,loadingType:"linear",showEmptyDataSourceMessage:!Dt,padding:"dense",pageSizeOptions:[20,50,100],...Ke},title:`${vt} (${ct.length})`,data:Ne,actions:k||Ce,subtitle:yt,emptyContent:$t})};K.columns=E},85877:function(Lt,Le,n){"use strict";n.r(Le),n.d(Le,{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:
|
|
@@ -519,4 +519,4 @@ ${tt.href}
|
|
|
519
519
|
|
|
520
520
|
Feedback:`),Ut=((we=wt)===null||we===void 0?void 0:we.type)==="github"?(0,Sn.BT)(mt.href,"blob"):mt.href,xt=on()(Ut),Nt=`/${xt.organization}/${xt.name}`,Qt=tt.cloneNode();switch((Oe=wt)===null||Oe===void 0?void 0:Oe.type){case"gitlab":Qt.href=`${mt.origin}${Nt}/issues/new?issue[title]=${Be}&issue[description]=${At}`;break;case"github":Qt.href=`${mt.origin}${Nt}/issues/new?title=${Be}&body=${At}`;break;default:return O}return xn.render(p.createElement(pn.Z),Qt),Qt.style.paddingLeft="5px",Qt.title="Leave feedback for this page",Qt.id="git-feedback-link",(Xe=tt)===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"]'),Y=v.querySelector("article");if(!M||!Y)return v;const he=M.cloneNode();return xn.render(p.createElement(wn.Z),he),he.id="toggle-sidebar",he.title="Toggle Sidebar",he.classList.add("md-content__button"),he.style.setProperty("padding","0 0 0 5px"),he.style.setProperty("margin","0.4rem 0 0.4rem 0.4rem"),(O=Y)===null||O===void 0||O.prepend(he),v},Jt=()=>v=>(((M,Y)=>{Array.from(M).filter(he=>he.hasAttribute(Y)).forEach(he=>{const we=he.getAttribute(Y);if(we){we.match(/^https?:\/\//i)&&he.setAttribute("target","_blank");try{const Oe=Vt(window.location.href);he.setAttribute(Y,new URL(we,Oe).toString())}catch{he.replaceWith(he.textContent||we)}}})})(Array.from(v.getElementsByTagName("a")),"href"),v);function Vt(v){const O=new URL(v);return!O.pathname.endsWith("/")&&!O.pathname.endsWith(".html")&&(O.pathname+="/"),O.toString()}const Je=({baseUrl:v,onClick:O})=>M=>(Array.from(M.getElementsByTagName("a")).forEach(Y=>{Y.addEventListener("click",he=>{const Oe=Y.getAttribute("href");Oe&&Oe.startsWith(v)&&!Y.hasAttribute("download")&&(he.preventDefault(),O(he,Oe))})}),M);var Rn=n(15459),sn=n(80030),Nn=n(72379),In=n(41547),Pn=n(95074);const Gn=(0,Rn.Z)(v=>({tooltip:{fontSize:"inherit",color:v.palette.text.primary,margin:0,padding:v.spacing(.5),backgroundColor:"transparent",boxShadow:"none"}}))(sn.ZP),Kn=()=>(0,r.jsx)(Nn.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"})}),Ln=({text:v})=>{const[O,M]=(0,p.useState)(!1),[,Y]=(0,Pn.Z)(),he=(0,p.useCallback)(()=>{Y(v),M(!0)},[v,Y]),we=(0,p.useCallback)(()=>{M(!1)},[M]);return(0,r.jsx)(Gn,{title:"Copied to clipboard",placement:"left",open:O,onClose:we,leaveDelay:1e3,children:(0,r.jsx)(D.Z,{style:{color:"inherit"},className:"md-clipboard md-icon",onClick:he,children:(0,r.jsx)(Kn,{})})})},be=v=>O=>{const M=O.querySelectorAll("pre > code");for(const we of M){var Y,he;const Oe=we.textContent||"",Xe=document.createElement("div");(he=we)===null||he===void 0||(Y=he.parentElement)===null||Y===void 0||Y.prepend(Xe),xn.render((0,r.jsx)(In.Z,{theme:v,children:(0,r.jsx)(Ln,{text:Oe})}),Xe)}return O},pe=()=>v=>{var O;return(O=v.querySelector(".md-header"))===null||O===void 0||O.remove(),v},Ie=()=>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 Y(){O(),M.removeEventListener(V.Ox,Y)}),M),N=()=>v=>(v.addEventListener(V.Ox,function O(){if(window.location.hash){var M,Y;const he=window.location.hash.slice(1);(Y=v)===null||Y===void 0||(M=Y.querySelector(`[id="${he}"]`))===null||M===void 0||M.scrollIntoView()}v.removeEventListener(V.Ox,O)}),v),ce=()=>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(he=>{var we,Oe;const Xe=(we=he)===null||we===void 0?void 0:we.querySelector("input");if(!(!((Oe=Xe)===null||Oe===void 0)&&Oe.checked)){var tt;(tt=Xe)===null||tt===void 0||tt.click()}}),M[M.length-1].scrollIntoView())},200),v),Ae=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 Y of O)M=await Y(M);return M};var $e=n(73557);function qe(v,O){const M=new URL(O),Y=`${M.origin}${M.pathname.replace(/\/$/,"")}`,he=v.replace(Y,"").replace(/^\/+/,""),we=new URL(`http://localhost/${he}`);return`${we.pathname}${we.search}${we.hash}`}function It(){const v=(0,$e.s0)(),M=(0,K.h_)(K.Ds).getOptionalString("app.baseUrl");return(0,p.useCallback)(he=>{let we=he;if(M)try{we=qe(he,M)}catch{}v(we)},[v,M])}const Bt="screen and (max-width: 76.1875em)",nn=v=>{const O=It(),M=(0,xe.Z)(),Y=(0,Se.Z)(Bt),he=Gt(),we=yn(),Oe=(0,K.z$)(),Xe=(0,K.h_)(V.Dl),tt=(0,K.h_)(k.q3),{state:mt,path:wt,content:dt}=(0,w.DK)(),[Be,At]=(0,p.useState)(null),Ut=(0,V.ux)(Be),xt=(0,p.useCallback)(()=>{if(!Be)return;Be.querySelectorAll(".md-sidebar").forEach(bt=>{if(Y)bt.style.top="0px";else{var jt,Mt,Xt;const bn=(jt=document)===null||jt===void 0?void 0:jt.querySelector(".techdocs-reader-page");var lr;const _n=(lr=(Mt=bn)===null||Mt===void 0?void 0:Mt.getBoundingClientRect().top)!==null&&lr!==void 0?lr:0;var Cr;let fr=(Cr=Be.getBoundingClientRect().top)!==null&&Cr!==void 0?Cr:0;const wr=Be.querySelector(".md-container > .md-tabs");var rr;const Yn=(rr=(Xt=wr)===null||Xt===void 0?void 0:Xt.getBoundingClientRect().height)!==null&&rr!==void 0?rr:0;fr<_n&&(fr=_n),bt.style.top=`${Math.max(fr,0)+Yn}px`}bt.style.setProperty("opacity","1")})},[Be,Y]);(0,p.useEffect)(()=>(window.addEventListener("resize",xt),window.addEventListener("scroll",xt,!0),()=>{window.removeEventListener("resize",xt),window.removeEventListener("scroll",xt,!0)}),[Be,xt]);const Nt=(0,p.useCallback)(()=>{if(!Be)return;const Ft=Be.querySelector(".md-footer");Ft&&(Ft.style.width=`${Be.getBoundingClientRect().width}px`)},[Be]);(0,p.useEffect)(()=>(window.addEventListener("resize",Nt),()=>{window.removeEventListener("resize",Nt)}),[Be,Nt]),(0,p.useEffect)(()=>{Ut||(Nt(),xt())},[mt,Ut,Nt,xt]);const Qt=(0,p.useCallback)((Ft,bt)=>Ae(Ft,[he,cn({techdocsStorageApi:Xe,entityId:v,path:bt}),Jt(),_e(),pe(),Ie(),fn(tt),we]),[v,tt,Xe,he,we]),jn=(0,p.useCallback)(async Ft=>Ae(Ft,[N(),ce(),be(M),Je({baseUrl:window.location.origin,onClick:(bt,jt)=>{var Mt;const Xt=bt.ctrlKey||bt.metaKey,lr=new URL(jt),Cr=((Mt=bt.target)===null||Mt===void 0?void 0:Mt.innerText)||jt,rr=jt.replace(window.location.origin,"");if(Oe.captureEvent("click",Cr,{attributes:{to:rr}}),lr.hash)if(Xt)window.open(jt,"_blank");else{var bn,_n;O(jt),(_n=Ft)===null||_n===void 0||(bn=_n.querySelector(`[id="${lr.hash.slice(1)}"]`))===null||bn===void 0||bn.scrollIntoView()}else Xt?window.open(jt,"_blank"):O(jt)}}),H({onLoading:()=>{},onLoaded:()=>{var bt;(bt=Ft.querySelector(".md-nav__title"))===null||bt===void 0||bt.removeAttribute("for")}}),H({onLoading:()=>{Array.from(Ft.querySelectorAll(".md-sidebar")).forEach(jt=>{jt.style.setProperty("opacity","0")})},onLoaded:()=>{}})]),[M,O,Oe]);return(0,p.useEffect)(()=>{if(!dt)return()=>{};let Ft=!0;return Qt(dt,wt).then(async bt=>{var jt;if(!(!((jt=bt)===null||jt===void 0)&&jt.innerHTML)||!Ft)return;window.scroll({top:0});const Mt=await jn(bt);At(Mt)}),()=>{Ft=!1}},[dt,wt,Qt,jn]),Be};var ln=n(8560);const rn=()=>{var v,O,M,Y,he;const we=(0,V.$L)(),{shadowRoot:Oe}=(0,V.x1)(),Xe=(v=Oe)===null||v===void 0?void 0:v.querySelector('[data-md-component="content"]'),tt=(O=Oe)===null||O===void 0?void 0:O.querySelector('div[data-md-component="sidebar"][data-md-type="navigation"], div[data-md-component="navigation"]');let mt=(M=tt)===null||M===void 0?void 0:M.querySelector('[data-techdocs-addons-location="primary sidebar"]');if(!mt){var wt;mt=document.createElement("div"),mt.setAttribute("data-techdocs-addons-location","primary sidebar"),(wt=tt)===null||wt===void 0||wt.prepend(mt)}const dt=(Y=Oe)===null||Y===void 0?void 0:Y.querySelector('div[data-md-component="sidebar"][data-md-type="toc"], div[data-md-component="toc"]');let Be=(he=dt)===null||he===void 0?void 0:he.querySelector('[data-techdocs-addons-location="secondary sidebar"]');if(!Be){var At;Be=document.createElement("div"),Be.setAttribute("data-techdocs-addons-location","secondary sidebar"),(At=dt)===null||At===void 0||At.prepend(Be)}return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(ln.Z,{container:mt,children:we.renderComponentsByLocation(V.oZ.PrimarySidebar)}),(0,r.jsx)(ln.Z,{container:Xe,children:we.renderComponentsByLocation(V.oZ.Content)}),(0,r.jsx)(ln.Z,{container:Be,children:we.renderComponentsByLocation(V.oZ.SecondarySidebar)})]})},ee=(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:Y=!0,onReady:he}=v,we=ee(),{entityMetadata:{value:Oe,loading:Xe},entityRef:tt,setShadowRoot:mt}=(0,V.x1)(),wt=nn(tt),dt=(0,p.useCallback)(Be=>{mt(Be),he instanceof Function&&he()},[mt,he]);return Xe===!1&&!Oe?(0,r.jsx)(m.mf,{status:"404",statusMessage:"PAGE NOT FOUND"}):wt?(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,{})}),Y&&(0,r.jsx)(f.Z,{className:we.search,xs:"auto",item:!0,children:(0,r.jsx)(h.S,{entityId:tt,entityTitle:(M=Oe)===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:wt,onAppend:dt,children:(0,r.jsx)(rn,{})})})]})}):(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,{})})})})}),G=null},93225:function(Lt,Le,n){"use strict";n.d(Le,{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),ye=n(39709),le=n(25271),z=n(53974),de=n(60871),D=n(76635),E=n(95573);const se=(0,r.jsx)(V.Z,{animation:"wave",variant:"text",height:40}),ie=ne=>{var X,K,R;const{palette:{common:{white:w}}}=(0,m.Z)(),{children:I}=ne,U=(0,F.$L)(),xe=(0,de.h_)(de.Ds),{title:Se,setTitle:k,subtitle:Ke,setSubtitle:yt,entityRef:$t,metadata:{value:zt,loading:Rt},entityMetadata:{value:Dt,loading:Yt}}=(0,F.x1)();(0,p.useEffect)(()=>{zt&&(k(zt.site_name),yt(()=>{let{site_description:rt}=zt;return(!rt||rt==="None")&&(rt=""),rt}))},[zt,k,yt]);const ct=xe.getOptional("app.title")||"Backstage",ut=[Se,Ke,ct].filter(Boolean).join(" | "),{locationMetadata:St,spec:lt}=Dt||{},Zt=(X=lt)===null||X===void 0?void 0:X.lifecycle,Gt=Dt?(0,ye.hF)(Dt,le.S4):[],Ce=(0,de.tg)(E._Z)(),Ne=(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(z.i9,{label:(0,D.capitalize)(((K=Dt)===null||K===void 0?void 0:K.kind)||"entity"),value:(0,r.jsx)(ye.dx,{color:"inherit",entityRef:$t,title:(R=Dt)===null||R===void 0?void 0:R.metadata.title,defaultKind:"Component"})}),Gt.length>0&&(0,r.jsx)(z.i9,{label:"Owner",value:(0,r.jsx)(ye.rI,{color:"inherit",entityRefs:Gt,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&&Dt===void 0||!Rt&&zt===void 0?null:(0,r.jsxs)(z.h4,{type:"Documentation",typeLink:Ce,title:Se||se,subtitle:Ke===""?void 0:Ke||se,children:[(0,r.jsx)(W.Z,{titleTemplate:"%s",children:(0,r.jsx)("title",{children:ut})}),Ne,I,U.renderComponentsByLocation(F.oZ.Header)]})}},65124:function(Lt,Le,n){"use strict";n.d(Le,{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),ye=n(47603),le=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 E=z(),[se,ie]=(0,p.useState)(null),ne=(0,p.useCallback)(xe=>{ie(xe.currentTarget)},[]),X=(0,p.useCallback)(()=>{ie(null)},[]),{entityMetadata:{value:K,loading:R}}=(0,le.x1)(),w=(0,le.$L)(),I=w.renderComponentsByLocation(le.oZ.Subheader),U=w.renderComponentsByLocation(le.oZ.Settings);return!I&&!U||R===!1&&!K?null:(0,r.jsx)(f.Z,{classes:E,...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:ne,children:(0,r.jsx)(ye.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(Lt,Le,n){"use strict";n.d(Le,{DK:function(){return de},m1:function(){return E}});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:ne}){return se||ne==="BUILD_READY_RELOAD"||!ie&&ne==="CHECKING"?"CHECKING":!ie&&ne==="BUILDING"?"INITIAL_BUILD":ie?ne==="BUILDING"?"CONTENT_STALE_REFRESHING":ne==="BUILD_READY"?"CONTENT_STALE_READY":ne==="ERROR"?"CONTENT_STALE_ERROR":"CONTENT_FRESH":"CONTENT_NOT_FOUND"}function ye(se,ie){const ne={...se};switch(ie.type){case"sync":ie.state==="CHECKING"&&(ne.buildLog=[]),ne.activeSyncState=ie.state,ne.syncError=ie.syncError;break;case"contentLoading":ne.contentLoading=!0,ne.contentError=void 0;break;case"content":typeof ie.path=="string"&&(ne.path=ie.path),ne.contentLoading=!1,ne.content=ie.content,ne.contentError=ie.contentError;break;case"buildLog":ne.buildLog=ne.buildLog.concat(ie.log);break;default:throw new Error}return["BUILD_READY","BUILD_READY_RELOAD"].includes(ne.activeSyncState)&&["contentLoading","content"].includes(ie.type)&&(ne.activeSyncState="UP_TO_DATE",ne.buildLog=[]),ne}function le(se,ie,ne,X){var K,R;const[w,I]=(0,p.useReducer)(ye,{activeSyncState:"CHECKING",path:X,contentLoading:!0,buildLog:[]}),U=(0,V.h_)(f.Dl),{retry:xe}=(0,h.Z)(async()=>{I({type:"contentLoading"});try{const Ke=await U.getEntityDocs({kind:se,namespace:ie,name:ne},X);return I({type:"content",content:Ke,path:X}),Ke}catch(Ke){I({type:"content",contentError:Ke,path:X})}},[U,se,ie,ne,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 Ke=setTimeout(()=>{I({type:"sync",state:"BUILDING"})},1e3);try{switch(await U.syncEntityDocs({kind:se,namespace:ie,name:ne},$t=>{I({type:"buildLog",log:$t})})){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(yt){I({type:"sync",state:"ERROR",syncError:yt})}finally{clearTimeout(Ke)}},[se,ne,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,{"*":ne=""}=(0,W.UO)(),{entityRef:X}=(0,f.x1)(),{kind:K,namespace:R,name:w}=X,I=le(K,R,w,ne);return(0,r.jsx)(z.Provider,{value:I,children:ie instanceof Function?ie(I):ie})},E=se=>ie=>(0,r.jsx)(D,{children:(0,r.jsx)(se,{...ie})})},95573:function(Lt,Le,n){"use strict";n.d(Le,{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(Lt,Le,n){"use strict";n.r(Le),n.d(Le,{TechDocsSearchResultListItem:function(){return le}});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 ye=(0,W.Z)({flexContainer:{flexWrap:"wrap"},itemText:{width:"100%",marginBottom:"1rem"}}),le=z=>{const{result:de,highlight:D,lineClamp:E=5,asListItem:se=!0,asLink:ie=!0,title:ne,icon:X}=z,K=ye(),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 Ke=!((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,yt=!((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,$t=!((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:ne||(0,r.jsxs)(r.Fragment,{children:[Ke," | ",yt!=null?yt:$t," docs"]})}),secondary:(0,r.jsx)(m.Z,{component:"span",style:{display:"-webkit-box",WebkitBoxOrient:"vertical",WebkitLineClamp:E,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(Lt,Le,n){"use strict";n.d(Le,{S:function(){return F}});var r=n(52322),p=n(15096),W=n(2784),f=n(73557),V=n(55511);const m=ye=>{var le;return(le=ye)===null||le===void 0?void 0:le.document},h=ye=>{const{entityId:le,entityTitle:z,debounceTime:de=150}=ye,[D,E]=(0,W.useState)(!1),se=(0,f.s0)(),{setFilters:ie,result:{loading:ne,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}},[ne,X]);const{kind:w,name:I,namespace:U}=le;(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:Ke}=k.document;se(Ke)}};return(0,r.jsx)(p.qO,{"data-testid":"techdocs-search-bar",size:"small",open:D,getOptionLabel:()=>"",filterOptions:Se=>Se,onClose:()=>{E(!1)},onFocus:()=>{E(!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:ne,inputDebounceTime:de,inputPlaceholder:`Search ${z||le.name} docs`,freeSolo:!1})},F=ye=>{const le={term:"",types:["techdocs"],pageCursor:"",filters:ye.entityId};return(0,r.jsx)(p.Nd,{initialState:le,children:(0,r.jsx)(h,{...ye})})}},53260:function(){}},function(Lt){var Le=function(r){return Lt(Lt.s=r)};Lt.O(0,[2370,6202,9284,9035,2126,7012,2194,1410,427,242,5109,6816,5218,4736],function(){return Le(48514)});var n=Lt.O()}]);})();
|
|
521
521
|
|
|
522
|
-
//# sourceMappingURL=main.
|
|
522
|
+
//# sourceMappingURL=main.4b61d1bd.js.map
|