@techdocs/cli 1.1.2 → 1.1.3-next.0
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 +10 -0
- package/dist/embedded-app/.config-schema.json +1 -0
- package/dist/embedded-app/index.html +1 -1
- package/dist/embedded-app/static/{main.9724fcfa.js → main.ca83e3a7.js} +11 -11
- package/dist/embedded-app/static/main.ca83e3a7.js.map +1 -0
- package/dist/embedded-app/static/{runtime.9724fcfa.js → runtime.ca83e3a7.js} +1 -1
- package/dist/embedded-app/static/{runtime.9724fcfa.js.map → runtime.ca83e3a7.js.map} +1 -1
- package/dist/embedded-app/static/vendor.ca83e3a7.js +103 -0
- package/dist/embedded-app/static/vendor.ca83e3a7.js.map +1 -0
- package/dist/index.cjs.js +2 -2
- package/dist/index.cjs.js.map +1 -1
- package/package.json +7 -7
- package/dist/embedded-app/static/main.9724fcfa.js.map +0 -1
- package/dist/embedded-app/static/vendor.9724fcfa.js +0 -103
- package/dist/embedded-app/static/vendor.9724fcfa.js.map +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
(()=>{var qi=Object.defineProperty;var _i=(ee,s,e)=>s in ee?qi(ee,s,{enumerable:!0,configurable:!0,writable:!0,value:e}):ee[s]=e;var q=(ee,s,e)=>(_i(ee,typeof s!="symbol"?s+"":s,e),e),po=(ee,s,e)=>{if(!s.has(ee))throw TypeError("Cannot "+e)};var rt=(ee,s,e)=>(po(ee,s,"read from private field"),e?e.call(ee):s.get(ee)),Dn=(ee,s,e)=>{if(s.has(ee))throw TypeError("Cannot add the same private member more than once");s instanceof WeakSet?s.add(ee):s.set(ee,e)},wn=(ee,s,e,r)=>(po(ee,s,"write to private field"),r?r.call(ee,e):s.set(ee,e),e);(self.webpackChunktechdocs_cli_embedded_app=self.webpackChunktechdocs_cli_embedded_app||[]).push([[179],{30001:function(ee,s,e){"use strict";e.d(s,{n3:function(){return A},MS:function(){return m}});var r=e(48023),t=e(10179),l=e(96279),u=e.n(l);const A=Symbol.for("CATALOG_FILTER_EXISTS_0e15b590c0b343a2bae3e787e84c2111");class m{constructor(c){q(this,"discoveryApi");q(this,"fetchApi");this.discoveryApi=c.discoveryApi,this.fetchApi=c.fetchApi||{fetch:u()}}async getEntityAncestors(c,f){const{kind:y,namespace:p,name:E}=(0,r.of)(c.entityRef);return await this.requestRequired("GET",`/entities/by-name/${encodeURIComponent(y)}/${encodeURIComponent(p)}/${encodeURIComponent(E)}/ancestry`,f)}async getLocationById(c,f){return await this.requestOptional("GET",`/locations/${encodeURIComponent(c)}`,f)}async getEntities(c,f){const{filter:y=[],fields:p=[],offset:E,limit:T,after:I}=c!=null?c:{},B=[];for(const L of[y].flat()){const D=[];for(const[U,Y]of Object.entries(L))for(const te of[Y].flat())te===A?D.push(encodeURIComponent(U)):typeof te=="string"&&D.push(`${encodeURIComponent(U)}=${encodeURIComponent(te)}`);D.length&&B.push(`filter=${D.join(",")}`)}p.length&&B.push(`fields=${p.map(encodeURIComponent).join(",")}`),E!==void 0&&B.push(`offset=${E}`),T!==void 0&&B.push(`limit=${T}`),I!==void 0&&B.push(`after=${encodeURIComponent(I)}`);const j=B.length?`?${B.join("&")}`:"",M=await this.requestRequired("GET",`/entities${j}`,f),b=(L,D)=>{var te,ue;if(((te=L.metadata)==null?void 0:te.name)===void 0||L.kind===void 0||((ue=D.metadata)==null?void 0:ue.name)===void 0||D.kind===void 0)return 0;const U=(0,r.eE)(L),Y=(0,r.eE)(D);return U<Y?-1:U>Y?1:0};return{items:M.sort(b)}}async getEntityByRef(c,f){const{kind:y,namespace:p,name:E}=(0,r.of)(c);return this.requestOptional("GET",`/entities/by-name/${encodeURIComponent(y)}/${encodeURIComponent(p)}/${encodeURIComponent(E)}`,f)}async getEntityByName(c,f){const{kind:y,namespace:p="default",name:E}=c;return this.requestOptional("GET",`/entities/by-name/${encodeURIComponent(y)}/${encodeURIComponent(p)}/${encodeURIComponent(E)}`,f)}async refreshEntity(c,f){const y=await this.fetchApi.fetch(`${await this.discoveryApi.getBaseUrl("catalog")}/refresh`,{headers:{"Content-Type":"application/json",...(f==null?void 0:f.token)&&{Authorization:`Bearer ${f==null?void 0:f.token}`}},method:"POST",body:JSON.stringify({entityRef:c})});if(y.status!==200)throw new Error(await y.text())}async getEntityFacets(c,f){const{filter:y=[],facets:p}=c,E=[];for(const I of[y].flat()){const B=[];for(const[j,M]of Object.entries(I))for(const b of[M].flat())b===A?B.push(encodeURIComponent(j)):typeof b=="string"&&B.push(`${encodeURIComponent(j)}=${encodeURIComponent(b)}`);B.length&&E.push(`filter=${B.join(",")}`)}for(const I of p)E.push(`facet=${encodeURIComponent(I)}`);const T=E.length?`?${E.join("&")}`:"";return await this.requestOptional("GET",`/entity-facets${T}`,f)}async addLocation({type:c="url",target:f,dryRun:y},p){const E=await this.fetchApi.fetch(`${await this.discoveryApi.getBaseUrl("catalog")}/locations${y?"?dryRun=true":""}`,{headers:{"Content-Type":"application/json",...(p==null?void 0:p.token)&&{Authorization:`Bearer ${p==null?void 0:p.token}`}},method:"POST",body:JSON.stringify({type:c,target:f})});if(E.status!==201)throw new Error(await E.text());const{location:T,entities:I,exists:B}=await E.json();if(!T)throw new Error(`Location wasn't added: ${f}`);return{location:T,entities:I,exists:B}}async getLocationByRef(c,f){return(await this.requestRequired("GET","/locations",f)).map(p=>p.data).find(p=>c===(0,r.NZ)(p))}async removeLocationById(c,f){await this.requestIgnored("DELETE",`/locations/${encodeURIComponent(c)}`,f)}async removeEntityByUid(c,f){await this.requestIgnored("DELETE",`/entities/by-uid/${encodeURIComponent(c)}`,f)}async requestIgnored(c,f,y){const p=`${await this.discoveryApi.getBaseUrl("catalog")}${f}`,E=y!=null&&y.token?{Authorization:`Bearer ${y.token}`}:{},T=await this.fetchApi.fetch(p,{method:c,headers:E});if(!T.ok)throw await t.VL.fromResponse(T)}async requestRequired(c,f,y){const p=`${await this.discoveryApi.getBaseUrl("catalog")}${f}`,E=y!=null&&y.token?{Authorization:`Bearer ${y.token}`}:{},T=await this.fetchApi.fetch(p,{method:c,headers:E});if(!T.ok)throw await t.VL.fromResponse(T);return await T.json()}async requestOptional(c,f,y){const p=`${await this.discoveryApi.getBaseUrl("catalog")}${f}`,E=y!=null&&y.token?{Authorization:`Bearer ${y.token}`}:{},T=await this.fetchApi.fetch(p,{method:c,headers:E});if(!T.ok){if(T.status===404)return;throw await t.VL.fromResponse(T)}return await T.json()}}},48023:function(ee,s,e){"use strict";e.d(s,{Tf:function(){return l},P1:function(){return Rt},q1:function(){return Nt},M6:function(){return Zt},l2:function(){return t},zG:function(){return r},w$:function(){return X},nP:function(){return Z},aS:function(){return Ke},S4:function(){return me},cz:function(){return Ae},iB:function(){return _e},of:function(){return et},Ou:function(){return vt},eE:function(){return st},NZ:function(){return at}});const r="default",t="backstage.io/view-url",l="backstage.io/edit-url";var u=e(76635),A=e.n(u);class m{constructor(V=DEFAULT_NAMESPACE){q(this,"namespace");this.namespace=V}async enforce(V){return V.metadata.namespace?V:lodash.merge({metadata:{namespace:this.namespace}},V)}}class o{static isValidPrefixAndOrSuffix(V,ye,We,qe){if(typeof V!="string")return!1;const ot=V.split(ye);return ot.length===1?qe(ot[0]):ot.length===2?We(ot[0])&&qe(ot[1]):!1}static isJsonSafe(V){try{return A().isEqual(V,JSON.parse(JSON.stringify(V)))}catch{return!1}}static isValidDnsSubdomain(V){return typeof V=="string"&&V.length>=1&&V.length<=253&&V.split(".").every(o.isValidDnsLabel)}static isValidDnsLabel(V){return typeof V=="string"&&V.length>=1&&V.length<=63&&/^[a-z0-9]+(\-[a-z0-9]+)*$/.test(V)}static isValidTag(V){return typeof V=="string"&&V.length>=1&&V.length<=63&&/^[a-z0-9+#]+(\-[a-z0-9+#]+)*$/.test(V)}static isValidUrl(V){if(typeof V!="string")return!1;try{return new URL(V),!0}catch{return!1}}static isValidString(V){var ye;return typeof V=="string"&&((ye=V==null?void 0:V.trim())==null?void 0:ye.length)>=1}static isNonEmptyString(V){var ye;return typeof V=="string"&&((ye=V==null?void 0:V.trim())==null?void 0:ye.length)>=1}}var c=JSON.parse('{"$schema":"http://json-schema.org/draft-07/schema","$id":"EntityEnvelope","description":"The envelope skeleton parts of an entity - whatever is necessary to be able to give it a ref and pass to further validation / policy checking.","examples":[{"apiVersion":"backstage.io/v1alpha1","kind":"Component","metadata":{"name":"LoremService"}}],"type":"object","required":["apiVersion","kind","metadata"],"additionalProperties":true,"properties":{"apiVersion":{"type":"string","description":"The version of specification format for this particular entity that this is written against.","minLength":1,"examples":["backstage.io/v1alpha1","my-company.net/v1","1.0"]},"kind":{"type":"string","description":"The high level entity type being described.","minLength":1,"examples":["API","Component","Domain","Group","Location","Resource","System","Template","User"]},"metadata":{"type":"object","required":["name"],"additionalProperties":true,"properties":{"name":{"type":"string","description":"The name of the entity. Must be unique within the catalog at any given point in time, for any given namespace + kind pair.","examples":["metadata-proxy"],"minLength":1},"namespace":{"type":"string","description":"The namespace that the entity belongs to.","default":"default","examples":["default","admin"],"minLength":1}}}}}'),f=e(48231),y=e.n(f),p=JSON.parse(`{"$schema":"http://json-schema.org/draft-07/schema","$id":"Entity","description":"The parts of the format that's common to all versions/kinds of entity.","examples":[{"apiVersion":"backstage.io/v1alpha1","kind":"Component","metadata":{"name":"LoremService","description":"Creates Lorems like a pro.","labels":{"product_name":"Random value Generator"},"annotations":{"docs":"https://github.com/..../tree/develop/doc"}},"spec":{"type":"service","lifecycle":"production","owner":"tools"}}],"type":"object","required":["apiVersion","kind","metadata"],"additionalProperties":false,"properties":{"apiVersion":{"type":"string","description":"The version of specification format for this particular entity that this is written against.","minLength":1,"examples":["backstage.io/v1alpha1","my-company.net/v1","1.0"]},"kind":{"type":"string","description":"The high level entity type being described.","minLength":1,"examples":["API","Component","Domain","Group","Location","Resource","System","Template","User"]},"metadata":{"$ref":"EntityMeta"},"spec":{"type":"object","description":"The specification data describing the entity itself."},"relations":{"type":"array","description":"The relations that this entity has with other entities.","items":{"$ref":"common#relation"}},"status":{"$ref":"common#status"}}}`),E=JSON.parse('{"$schema":"http://json-schema.org/draft-07/schema","$id":"EntityMeta","description":"Metadata fields common to all versions/kinds of entity.","examples":[{"uid":"e01199ab-08cc-44c2-8e19-5c29ded82521","etag":"lsndfkjsndfkjnsdfkjnsd==","name":"my-component-yay","namespace":"the-namespace","labels":{"backstage.io/custom":"ValueStuff"},"annotations":{"example.com/bindings":"are-secret"},"tags":["java","data"]}],"type":"object","required":["name"],"additionalProperties":true,"properties":{"uid":{"type":"string","description":"A globally unique ID for the entity. This field can not be set by the user at creation time, and the server will reject an attempt to do so. The field will be populated in read operations. The field can (optionally) be specified when performing update or delete operations, but the server is free to reject requests that do so in such a way that it breaks semantics.","examples":["e01199ab-08cc-44c2-8e19-5c29ded82521"],"minLength":1},"etag":{"type":"string","description":"An opaque string that changes for each update operation to any part of the entity, including metadata. This field can not be set by the user at creation time, and the server will reject an attempt to do so. The field will be populated in read operations. The field can (optionally) be specified when performing update or delete operations, and the server will then reject the operation if it does not match the current stored value.","examples":["lsndfkjsndfkjnsdfkjnsd=="],"minLength":1},"name":{"type":"string","description":"The name of the entity. Must be unique within the catalog at any given point in time, for any given namespace + kind pair.","examples":["metadata-proxy"],"minLength":1},"namespace":{"type":"string","description":"The namespace that the entity belongs to.","default":"default","examples":["default","admin"],"minLength":1},"title":{"type":"string","description":"A display name of the entity, to be presented in user interfaces instead of the name property, when available.","examples":["React SSR Template"],"minLength":1},"description":{"type":"string","description":"A short (typically relatively few words, on one line) description of the entity."},"labels":{"type":"object","description":"Key/value pairs of identifying information attached to the entity.","additionalProperties":true,"patternProperties":{"^.+$":{"type":"string"}}},"annotations":{"type":"object","description":"Key/value pairs of non-identifying auxiliary information attached to the entity.","additionalProperties":true,"patternProperties":{"^.+$":{"type":"string"}}},"tags":{"type":"array","description":"A list of single-valued strings, to for example classify catalog entities in various ways.","items":{"type":"string","minLength":1}},"links":{"type":"array","description":"A list of external hyperlinks related to the entity. Links can provide additional contextual information that may be located outside of Backstage itself. For example, an admin dashboard or external CMS page.","items":{"type":"object","required":["url"],"properties":{"url":{"type":"string","description":"A url in a standard uri format.","examples":["https://admin.example-org.com"],"minLength":1},"title":{"type":"string","description":"A user friendly display name for the link.","examples":["Admin Dashboard"],"minLength":1},"icon":{"type":"string","description":"A key representing a visual icon to be displayed in the UI.","examples":["dashboard"],"minLength":1}}}}}}'),T=JSON.parse('{"$schema":"http://json-schema.org/draft-07/schema","$id":"common","type":"object","description":"Common definitions to import from other schemas","definitions":{"reference":{"$id":"#reference","type":"object","description":"A reference by name to another entity.","required":["kind","namespace","name"],"additionalProperties":false,"properties":{"kind":{"type":"string","description":"The kind field of the entity.","minLength":1},"namespace":{"type":"string","description":"The metadata.namespace field of the entity.","minLength":1},"name":{"type":"string","description":"The metadata.name field of the entity.","minLength":1}}},"relation":{"$id":"#relation","type":"object","description":"A directed relation from one entity to another.","required":["type","target"],"additionalProperties":false,"properties":{"type":{"type":"string","minLength":1,"pattern":"^\\\\w+$","description":"The type of relation."},"target":{"$ref":"#reference"},"targetRef":{"type":"string","minLength":1,"description":"The entity ref of the target of this relation."}}},"status":{"$id":"#status","type":"object","description":"The current status of the entity, as claimed by various sources.","required":[],"additionalProperties":true,"properties":{"items":{"type":"array","items":{"$ref":"#statusItem"}}}},"statusItem":{"$id":"#statusItem","type":"object","description":"A specific status item on a well known format.","required":["type","level","message"],"additionalProperties":true,"properties":{"type":{"type":"string","minLength":1},"level":{"$ref":"#statusLevel","description":"The status level / severity of the status item."},"message":{"type":"string","description":"A brief message describing the status, intended for human consumption."},"error":{"$ref":"#error","description":"An optional serialized error object related to the status."}}},"statusLevel":{"$id":"#statusLevel","type":"string","description":"A status level / severity.","enum":["info","warning","error"]},"error":{"$id":"#error","type":"object","description":"A serialized error object.","required":["name","message"],"additionalProperties":true,"properties":{"name":{"type":"string","examples":["Error","InputError"],"description":"The type name of the error","minLength":1},"message":{"type":"string","description":"The message of the error"},"code":{"type":"string","description":"An error code associated with the error"},"stack":{"type":"string","description":"An error stack trace"}}}}}');const I=new Map,B=[c,p,E,T];function j(ae){if(!(ae!=null&&ae.length))throw new TypeError("Unknown error");const V=ae[0];throw new TypeError(`${V.instancePath||"<root>"} ${V.message}${V.params?` - ${Object.entries(V.params).map(([ye,We])=>`${ye}: ${We}`).join(", ")}`:""}`)}function M(ae,V={}){var Wt;const ye=(Wt=V==null?void 0:V.disableCache)!=null?Wt:!1,We=ye?"":JSON.stringify(ae);if(!ye){const Xt=I.get(We);if(Xt)return Xt}const qe=b(ae),ot=new(y())({allowUnionTypes:!0,allErrors:!0,validateSchema:!0});qe.length&&ot.addSchema(qe,void 0,void 0,!0);const bt=ot.compile(ae);return ye||I.set(We,bt),bt}function b(ae){if(typeof ae!="object")return[];const V=new Set;ae.$id&&V.add(ae.$id);const ye=new Array,We=[ae];for(;We.length;){const qe=We.pop();for(const ot of L(qe))if(!V.has(ot)){V.add(ot);const bt=B.find(Wt=>Wt.$id===ot);bt&&(ye.push(bt),We.push(bt))}}return ye}function*L(ae){const V=[ae];for(;V.length;){const ye=V.pop();if(typeof ye=="object"&&ye)for(const[We,qe]of Object.entries(ye))We==="$ref"&&typeof qe=="string"?yield qe.split("#")[0]:V.push(qe)}}function D(ae){const V=compileAjvSchema(ae||entityEnvelopeSchema);return ye=>{if(V(ye)===!0)return ye;throw throwAjvError(V.errors)}}function U(ae){const V=M(ae);return ye=>{var ot;if(V(ye)===!0)return ye;const qe=(ot=V.errors)==null?void 0:ot.filter(bt=>["/kind","/apiVersion"].includes(bt.instancePath));if((qe==null?void 0:qe.length)&&qe.every(bt=>bt.keyword==="enum"))return!1;throw j(V.errors)}}function Y(ae){const V=compileAjvSchema(ae||entitySchema);return ye=>{if(V(ye)===!0)return ye;throw throwAjvError(V.errors)}}class te{static isValidApiVersion(V){return o.isValidPrefixAndOrSuffix(V,"/",o.isValidDnsSubdomain,ye=>ye.length>=1&&ye.length<=63&&/^[a-z0-9A-Z]+$/.test(ye))}static isValidKind(V){return typeof V=="string"&&V.length>=1&&V.length<=63&&/^[a-zA-Z][a-z0-9A-Z]*$/.test(V)}static isValidObjectName(V){return typeof V=="string"&&V.length>=1&&V.length<=63&&/^([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9]$/.test(V)}static isValidNamespace(V){return o.isValidDnsLabel(V)}static isValidLabelKey(V){return o.isValidPrefixAndOrSuffix(V,"/",o.isValidDnsSubdomain,te.isValidObjectName)}static isValidLabelValue(V){return V===""||te.isValidObjectName(V)}static isValidAnnotationKey(V){return o.isValidPrefixAndOrSuffix(V,"/",o.isValidDnsSubdomain,te.isValidObjectName)}static isValidAnnotationValue(V){return typeof V=="string"}}const ue={isValidApiVersion:te.isValidApiVersion,isValidKind:te.isValidKind,isValidEntityName:te.isValidObjectName,isValidNamespace:te.isValidNamespace,isValidLabelKey:te.isValidLabelKey,isValidLabelValue:te.isValidLabelValue,isValidAnnotationKey:te.isValidAnnotationKey,isValidAnnotationValue:te.isValidAnnotationValue,isValidTag:ae=>typeof ae=="string"&&ae.length>=1&&ae.length<=63&&/^[a-z0-9:+#]+(\-[a-z0-9:+#]+)*$/.test(ae)};function Re(ae={}){return{...ue,...ae}}class we{constructor(V=makeValidator()){q(this,"validators");this.validators=V}async enforce(V){var bt,Wt,Xt,un,dn,xt,qt;function ye(x,re,Ee){if(re==null)throw new Error(`${x} must have a value`);let Te;try{Te=Ee(re)}catch(Le){throw new Error(`${x} could not be validated, ${Le}`)}if(!Te){let Le;switch(Ee.name){case"isValidLabelValue":case"isValidObjectName":Le="a string that is sequences of [a-zA-Z0-9] separated by any of [-_.], at most 63 characters in total";break;case"isValidLabelKey":case"isValidApiVersion":case"isValidAnnotationKey":Le="a valid prefix and/or suffix";break;case"isValidNamespace":case"isValidDnsLabel":Le="a string that is sequences of [a-z0-9] separated by [-], at most 63 characters in total";break;case"isValidTag":Le="a string that is sequences of [a-z0-9+#] separated by [-], at most 63 characters in total";break;case"isValidAnnotationValue":Le="a string";break;case"isValidKind":Le="a string that is a sequence of [a-zA-Z][a-z0-9A-Z], at most 63 characters in total";break;case"isValidUrl":Le="a string that is a valid url";break;case"isValidString":case"isNonEmptyString":Le="a non empty string";break;default:Le=void 0;break}const Je=Le?` expected ${Le} but found "${re}".`:"";throw new Error(`"${x}" is not valid;${Je} To learn more about catalog file format, visit: https://github.com/backstage/backstage/blob/master/docs/architecture-decisions/adr002-default-catalog-file-format.md`)}}function We(x,re,Ee){return re===void 0||ye(x,re,Ee)}ye("apiVersion",V.apiVersion,this.validators.isValidApiVersion),ye("kind",V.kind,this.validators.isValidKind),ye("metadata.name",V.metadata.name,this.validators.isValidEntityName),We("metadata.namespace",V.metadata.namespace,this.validators.isValidNamespace);for(const[x,re]of Object.entries((bt=V.metadata.labels)!=null?bt:[]))ye(`labels.${x}`,x,this.validators.isValidLabelKey),ye(`labels.${x}`,re,this.validators.isValidLabelValue);for(const[x,re]of Object.entries((Wt=V.metadata.annotations)!=null?Wt:[]))ye(`annotations.${x}`,x,this.validators.isValidAnnotationKey),ye(`annotations.${x}`,re,this.validators.isValidAnnotationValue);const qe=(Xt=V.metadata.tags)!=null?Xt:[];for(let x=0;x<qe.length;++x)ye(`tags.${x}`,qe[x],this.validators.isValidTag);const ot=(un=V.metadata.links)!=null?un:[];for(let x=0;x<ot.length;++x)ye(`links.${x}.url`,(dn=ot[x])==null?void 0:dn.url,CommonValidatorFunctions.isValidUrl),We(`links.${x}.title`,(xt=ot[x])==null?void 0:xt.title,CommonValidatorFunctions.isNonEmptyString),We(`links.${x}.icon`,(qt=ot[x])==null?void 0:qt.icon,KubernetesValidatorFunctions.isValidObjectName);return V}}class ge{constructor(){q(this,"validate")}async enforce(V){if(!this.validate){const qe=new Ajv({allowUnionTypes:!0});this.validate=qe.addSchema([commonSchema,entityMetaSchema],void 0,void 0,!0).compile(entitySchema)}if(this.validate(V)===!0)return V;const[We]=this.validate.errors||[];throw We?new Error(`Malformed envelope, ${We.instancePath||"<root>"} ${We.message}`):new Error("Malformed envelope, Unknown error")}}function ze(ae){let V=ae.indexOf(":");const ye=ae.indexOf("/");ye!==-1&&ye<V&&(V=-1);const We=V===-1?void 0:ae.slice(0,V),qe=ye===-1?void 0:ae.slice(V+1,ye),ot=ae.slice(Math.max(V+1,ye+1));if(We===""||qe===""||ot==="")throw new TypeError(`Entity reference "${ae}" was not on the form [<kind>:][<namespace>/]<name>`);return{kind:We,namespace:qe,name:ot}}function _e(ae){return{kind:ae.kind,namespace:ae.metadata.namespace||r,name:ae.metadata.name}}function et(ae,V){var Wt,Xt,un,dn;if(!ae)throw new Error("Entity reference must not be empty");const ye=V==null?void 0:V.defaultKind,We=(V==null?void 0:V.defaultNamespace)||r;let qe,ot,bt;if(typeof ae=="string"){const xt=ze(ae);qe=(Wt=xt.kind)!=null?Wt:ye,ot=(Xt=xt.namespace)!=null?Xt:We,bt=xt.name}else qe=(un=ae.kind)!=null?un:ye,ot=(dn=ae.namespace)!=null?dn:We,bt=ae.name;if(qe)if(ot){if(!bt){const xt=JSON.stringify(ae);throw new Error(`Entity reference ${xt} had missing or empty name`)}}else{const xt=JSON.stringify(ae);throw new Error(`Entity reference ${xt} had missing or empty namespace`)}else{const xt=JSON.stringify(ae);throw new Error(`Entity reference ${xt} had missing or empty kind (e.g. did not start with "component:" or similar)`)}return{kind:qe,namespace:ot,name:bt}}function st(ae){var qe,ot;let V,ye,We;return"metadata"in ae?(V=ae.kind,ye=(qe=ae.metadata.namespace)!=null?qe:r,We=ae.metadata.name):(V=ae.kind,ye=(ot=ae.namespace)!=null?ot:r,We=ae.name),`${V.toLocaleLowerCase("en-US")}:${ye.toLocaleLowerCase("en-US")}/${We.toLocaleLowerCase("en-US")}`}class Ct{constructor(V){this.policies=V}async enforce(V){let ye=V;for(const We of this.policies){const qe=await We.enforce(ye);if(!qe)throw new Error(`Policy ${We.constructor.name} did not return a result`);ye=qe}return ye}}class pt{constructor(V){this.policies=V}async enforce(V){for(const ye of this.policies){const We=await ye.enforce(V);if(We)return We}throw new Error("The entity did not match any known policy")}}const Pe={allOf(ae){return new Ct(ae)},oneOf(ae){return new pt(ae)}};var ht=JSON.parse('{"$schema":"http://json-schema.org/draft-07/schema","$id":"ApiV1alpha1","description":"An API describes an interface that can be exposed by a component. The API can be defined in different formats, like OpenAPI, AsyncAPI, GraphQL, gRPC, or other formats.","examples":[{"apiVersion":"backstage.io/v1alpha1","kind":"API","metadata":{"name":"artist-api","description":"Retrieve artist details","labels":{"product_name":"Random value Generator"},"annotations":{"docs":"https://github.com/..../tree/develop/doc"}},"spec":{"type":"openapi","lifecycle":"production","owner":"artist-relations-team","system":"artist-engagement-portal","definition":"openapi: \\"3.0.0\\"\\ninfo:..."}}],"allOf":[{"$ref":"Entity"},{"type":"object","required":["spec"],"properties":{"apiVersion":{"enum":["backstage.io/v1alpha1","backstage.io/v1beta1"]},"kind":{"enum":["API"]},"spec":{"type":"object","required":["type","lifecycle","owner","definition"],"properties":{"type":{"type":"string","description":"The type of the API definition.","examples":["openapi","asyncapi","graphql","grpc"],"minLength":1},"lifecycle":{"type":"string","description":"The lifecycle state of the API.","examples":["experimental","production","deprecated"],"minLength":1},"owner":{"type":"string","description":"An entity reference to the owner of the API.","examples":["artist-relations-team","user:john.johnson"],"minLength":1},"system":{"type":"string","description":"An entity reference to the system that the API belongs to.","minLength":1},"definition":{"type":"string","description":"The definition of the API, based on the format defined by the type.","minLength":1}}}}}]}');function je(ae){const V=U(ae);return{async check(ye){return V(ye)===ye}}}const ie=je(ht);var de=JSON.parse('{"$schema":"http://json-schema.org/draft-07/schema","$id":"ComponentV1alpha1","description":"A Component describes a software component. It is typically intimately linked to the source code that constitutes the component, and should be what a developer may regard a \\"unit of software\\", usually with a distinct deployable or linkable artifact.","examples":[{"apiVersion":"backstage.io/v1alpha1","kind":"Component","metadata":{"name":"LoremService","description":"Creates Lorems like a pro.","labels":{"product_name":"Random value Generator"},"annotations":{"docs":"https://github.com/..../tree/develop/doc"}},"spec":{"type":"service","lifecycle":"production","owner":"tools"}}],"allOf":[{"$ref":"Entity"},{"type":"object","required":["spec"],"properties":{"apiVersion":{"enum":["backstage.io/v1alpha1","backstage.io/v1beta1"]},"kind":{"enum":["Component"]},"spec":{"type":"object","required":["type","lifecycle","owner"],"properties":{"type":{"type":"string","description":"The type of component.","examples":["service","website","library"],"minLength":1},"lifecycle":{"type":"string","description":"The lifecycle state of the component.","examples":["experimental","production","deprecated"],"minLength":1},"owner":{"type":"string","description":"An entity reference to the owner of the component.","examples":["artist-relations-team","user:john.johnson"],"minLength":1},"system":{"type":"string","description":"An entity reference to the system that the component belongs to.","minLength":1},"subcomponentOf":{"type":"string","description":"An entity reference to another component of which the component is a part.","minLength":1},"providesApis":{"type":"array","description":"An array of entity references to the APIs that are provided by the component.","items":{"type":"string","minLength":1}},"consumesApis":{"type":"array","description":"An array of entity references to the APIs that are consumed by the component.","items":{"type":"string","minLength":1}},"dependsOn":{"type":"array","description":"An array of references to other entities that the component depends on to function.","items":{"type":"string","minLength":1}}}}}}]}');const Ue=je(de);var Be=JSON.parse('{"$schema":"http://json-schema.org/draft-07/schema","$id":"DomainV1alpha1","description":"A Domain groups a collection of systems that share terminology, domain models, business purpose, or documentation, i.e. form a bounded context.","examples":[{"apiVersion":"backstage.io/v1alpha1","kind":"Domain","metadata":{"name":"artists","description":"Everything about artists"},"spec":{"owner":"artist-relations-team"}}],"allOf":[{"$ref":"Entity"},{"type":"object","required":["spec"],"properties":{"apiVersion":{"enum":["backstage.io/v1alpha1","backstage.io/v1beta1"]},"kind":{"enum":["Domain"]},"spec":{"type":"object","required":["owner"],"properties":{"owner":{"type":"string","description":"An entity reference to the owner of the component.","examples":["artist-relations-team","user:john.johnson"],"minLength":1}}}}}]}');const Xe=je(Be);var mt=JSON.parse(`{"$schema":"http://json-schema.org/draft-07/schema","$id":"GroupV1alpha1","description":"A group describes an organizational entity, such as for example a team, a business unit, or a loose collection of people in an interest group. Members of these groups are modeled in the catalog as kind User.","examples":[{"apiVersion":"backstage.io/v1alpha1","kind":"Group","metadata":{"name":"infrastructure","description":"The infra business unit"},"spec":{"type":"business-unit","profile":{"displayName":"Infrastructure","email":"infrastructure@example.com","picture":"https://example.com/groups/bu-infrastructure.jpeg"},"parent":"ops","children":["backstage","other"]}}],"allOf":[{"$ref":"Entity"},{"type":"object","required":["spec"],"properties":{"apiVersion":{"enum":["backstage.io/v1alpha1","backstage.io/v1beta1"]},"kind":{"enum":["Group"]},"spec":{"type":"object","required":["type","children"],"properties":{"type":{"type":"string","description":"The type of group. There is currently no enforced set of values for this field, so it is left up to the adopting organization to choose a nomenclature that matches their org hierarchy.","examples":["team","business-unit","product-area","root"],"minLength":1},"profile":{"type":"object","description":"Optional profile information about the group, mainly for display purposes. All fields of this structure are also optional. The email would be a group email of some form, that the group may wish to be used for contacting them. The picture is expected to be a URL pointing to an image that's representative of the group, and that a browser could fetch and render on a group page or similar.","properties":{"displayName":{"type":"string","description":"A simple display name to present to users.","examples":["Infrastructure"],"minLength":1},"email":{"type":"string","description":"An email where this entity can be reached.","examples":["infrastructure@example.com"],"minLength":1},"picture":{"type":"string","description":"The URL of an image that represents this entity.","examples":["https://example.com/groups/bu-infrastructure.jpeg"],"minLength":1}}},"parent":{"type":"string","description":"The immediate parent group in the hierarchy, if any. Not all groups must have a parent; the catalog supports multi-root hierarchies. Groups may however not have more than one parent. This field is an entity reference.","examples":["ops"],"minLength":1},"children":{"type":"array","description":"The immediate child groups of this group in the hierarchy (whose parent field points to this group). The list must be present, but may be empty if there are no child groups. The items are not guaranteed to be ordered in any particular way. The entries of this array are entity references.","items":{"type":"string","examples":["backstage","other"],"minLength":1}},"members":{"type":"array","description":"The users that are members of this group. The entries of this array are entity references.","items":{"type":"string","examples":["jdoe"],"minLength":1}}}}}}]}`);const Ye=je(mt);var yt=JSON.parse(`{"$schema":"http://json-schema.org/draft-07/schema","$id":"LocationV1alpha1","description":"A location is a marker that references other places to look for catalog data.","examples":[{"apiVersion":"backstage.io/v1alpha1","kind":"Location","metadata":{"name":"org-data"},"spec":{"type":"url","targets":["http://github.com/myorg/myproject/org-data-dump/catalog-info-staff.yaml","http://github.com/myorg/myproject/org-data-dump/catalog-info-consultants.yaml"]}}],"allOf":[{"$ref":"Entity"},{"type":"object","required":["spec"],"properties":{"apiVersion":{"enum":["backstage.io/v1alpha1","backstage.io/v1beta1"]},"kind":{"enum":["Location"]},"spec":{"type":"object","required":[],"properties":{"type":{"type":"string","description":"The single location type, that's common to the targets specified in the spec. If it is left out, it is inherited from the location type that originally read the entity data.","examples":["url"],"minLength":1},"target":{"type":"string","description":"A single target as a string. Can be either an absolute path/URL (depending on the type), or a relative path such as ./details/catalog-info.yaml which is resolved relative to the location of this Location entity itself.","examples":["./details/catalog-info.yaml"],"minLength":1},"targets":{"type":"array","description":"A list of targets as strings. They can all be either absolute paths/URLs (depending on the type), or relative paths such as ./details/catalog-info.yaml which are resolved relative to the location of this Location entity itself.","items":{"type":"string","examples":["./details/catalog-info.yaml","http://github.com/myorg/myproject/org-data-dump/catalog-info-staff.yaml"],"minLength":1}},"presence":{"type":"string","description":"Whether the presence of the location target is required and it should be considered an error if it can not be found","default":"required","examples":["required"],"enum":["required","optional"]}}}}}]}`);const oe=je(yt),me="ownedBy",tt="ownerOf",Ge="consumesApi",Ne="apiConsumedBy",ct="providesApi",Q="apiProvidedBy",Z="dependsOn",X="dependencyOf",se="parentOf",le="childOf",be="memberOf",Oe="hasMember",Ae="partOf",Ke="hasPart";var ke=JSON.parse('{"$schema":"http://json-schema.org/draft-07/schema","$id":"ResourceV1alpha1","description":"A resource describes the infrastructure a system needs to operate, like BigTable databases, Pub/Sub topics, S3 buckets or CDNs. Modelling them together with components and systems allows to visualize resource footprint, and create tooling around them.","examples":[{"apiVersion":"backstage.io/v1alpha1","kind":"Resource","metadata":{"name":"artists-db","description":"Stores artist details"},"spec":{"type":"database","owner":"artist-relations-team","system":"artist-engagement-portal"}}],"allOf":[{"$ref":"Entity"},{"type":"object","required":["spec"],"properties":{"apiVersion":{"enum":["backstage.io/v1alpha1","backstage.io/v1beta1"]},"kind":{"enum":["Resource"]},"spec":{"type":"object","required":["type","owner"],"properties":{"type":{"type":"string","description":"The type of resource.","examples":["database","s3-bucket","cluster"],"minLength":1},"owner":{"type":"string","description":"An entity reference to the owner of the resource.","examples":["artist-relations-team","user:john.johnson"],"minLength":1},"dependsOn":{"type":"array","description":"An array of references to other entities that the resource depends on to function.","items":{"type":"string","minLength":1}},"system":{"type":"string","description":"An entity reference to the system that the resource belongs to.","minLength":1}}}}}]}');const Et=je(ke);var It=JSON.parse('{"$schema":"http://json-schema.org/draft-07/schema","$id":"SystemV1alpha1","description":"A system is a collection of resources and components. The system may expose or consume one or several APIs. It is viewed as abstraction level that provides potential consumers insights into exposed features without needing a too detailed view into the details of all components. This also gives the owning team the possibility to decide about published artifacts and APIs.","examples":[{"apiVersion":"backstage.io/v1alpha1","kind":"System","metadata":{"name":"artist-engagement-portal","description":"Handy tools to keep artists in the loop"},"spec":{"owner":"artist-relations-team","domain":"artists"}}],"allOf":[{"$ref":"Entity"},{"type":"object","required":["spec"],"properties":{"apiVersion":{"enum":["backstage.io/v1alpha1","backstage.io/v1beta1"]},"kind":{"enum":["System"]},"spec":{"type":"object","required":["owner"],"properties":{"owner":{"type":"string","description":"An entity reference to the owner of the component.","examples":["artist-relations-team","user:john.johnson"],"minLength":1},"domain":{"type":"string","description":"An entity reference to the domain that the system belongs to.","examples":["artists"],"minLength":1}}}}}]}');const lt=je(It);var Tt=JSON.parse(`{"$schema":"http://json-schema.org/draft-07/schema","$id":"UserV1alpha1","description":"A user describes a person, such as an employee, a contractor, or similar. Users belong to Group entities in the catalog. These catalog user entries are connected to the way that authentication within the Backstage ecosystem works. See the auth section of the docs for a discussion of these concepts.","examples":[{"apiVersion":"backstage.io/v1alpha1","kind":"User","metadata":{"name":"jdoe"},"spec":{"profile":{"displayName":"Jenny Doe","email":"jenny-doe@example.com","picture":"https://example.com/staff/jenny-with-party-hat.jpeg"},"memberOf":["team-b","employees"]}}],"allOf":[{"$ref":"Entity"},{"type":"object","required":["spec"],"properties":{"apiVersion":{"enum":["backstage.io/v1alpha1","backstage.io/v1beta1"]},"kind":{"enum":["User"]},"spec":{"type":"object","required":["memberOf"],"properties":{"profile":{"type":"object","description":"Optional profile information about the user, mainly for display purposes. All fields of this structure are also optional. The email would be a primary email of some form, that the user may wish to be used for contacting them. The picture is expected to be a URL pointing to an image that's representative of the user, and that a browser could fetch and render on a profile page or similar.","properties":{"displayName":{"type":"string","description":"A simple display name to present to users.","examples":["Jenny Doe"],"minLength":1},"email":{"type":"string","description":"An email where this user can be reached.","examples":["jenny-doe@example.com"],"minLength":1},"picture":{"type":"string","description":"The URL of an image that represents this user.","examples":["https://example.com/staff/jenny-with-party-hat.jpeg"],"minLength":1}}},"memberOf":{"type":"array","description":"The list of groups that the user is a direct member of (i.e., no transitive memberships are listed here). The list must be present, but may be empty if the user is not member of any groups. The items are not guaranteed to be ordered in any particular way. The entries of this array are entity references.","items":{"type":"string","examples":["team-b","employees"],"minLength":1}}}}}}]}`);const Lt=je(Tt),Rt="backstage.io/managed-by-location",Nt="backstage.io/managed-by-origin-location",Zt="backstage.io/source-location";function vt(ae){if(typeof ae!="string")throw new TypeError(`Unable to parse location ref '${ae}', unexpected argument ${typeof ae}`);const V=ae.indexOf(":");if(V<0)throw new TypeError(`Unable to parse location ref '${ae}', expected '<type>:<target>', e.g. 'url:https://host/path'`);const ye=ae.substring(0,V).trim(),We=ae.substring(V+1).trim();if(!ye||!We)throw new TypeError(`Unable to parse location ref '${ae}', expected '<type>:<target>', e.g. 'url:https://host/path'`);if(ye==="http"||ye==="https")throw new TypeError(`Invalid location ref '${ae}', please prefix it with 'url:', e.g. 'url:${ae}'`);return{type:ye,target:We}}function at(ae){const{type:V,target:ye}=ae;if(V){if(!ye)throw new TypeError("Unable to stringify location ref, empty target")}else throw new TypeError("Unable to stringify location ref, empty type");return`${V}:${ye}`}function zt(ae){var ye,We,qe,ot,bt;const V=(bt=(We=(ye=ae.metadata)==null?void 0:ye.annotations)==null?void 0:We[ANNOTATION_SOURCE_LOCATION])!=null?bt:(ot=(qe=ae.metadata)==null?void 0:qe.annotations)==null?void 0:ot[ANNOTATION_LOCATION];if(!V)throw new Error(`Entity '${stringifyEntityRef(ae)}' is missing location`);return vt(V)}},23235:function(ee,s,e){"use strict";e.d(s,{C:function(){return t}});var r=e(98005);class t{constructor(){q(this,"subject",new r.J)}post(u){this.subject.next(u)}alert$(){return this.subject}}},47150:function(ee,s,e){"use strict";e.d(s,{g:function(){return r}});class r{captureEvent(l){}}},58652:function(ee,s,e){"use strict";e.d(s,{C:function(){return l}});var r=e(98005);const t="theme";class l{constructor(A){q(this,"activeThemeId");q(this,"subject",new r.X(void 0));this.themes=A}static createWithStorage(A){var c;const m=new l(A);if(!window.localStorage)return m;const o=(c=window.localStorage.getItem(t))!=null?c:void 0;return m.setActiveThemeId(o),m.activeThemeId$().subscribe(f=>{f?window.localStorage.setItem(t,f):window.localStorage.removeItem(t)}),window.addEventListener("storage",f=>{var y;if(f.key===t){const p=(y=localStorage.getItem(t))!=null?y:void 0;m.setActiveThemeId(p)}}),m}getInstalledThemes(){return this.themes.slice()}activeThemeId$(){return this.subject}getActiveThemeId(){return this.activeThemeId}setActiveThemeId(A){this.activeThemeId=A,this.subject.next(A)}}},14721:function(ee,s,e){"use strict";e.d(s,{m:function(){return f}});var r=e(9850),t=e.n(r),l=e(12782),u=e.n(l);const A=/^[a-z][a-z0-9]*(?:[-_][a-z][a-z0-9]*)*$/i;function m(y){return typeof y=="object"&&y!==null&&!Array.isArray(y)}function o(y){if(y===null)return"null";if(Array.isArray(y))return"array";const p=typeof y;return p==="number"&&isNaN(y)?"nan":p==="string"&&y===""?"empty-string":p}const c={type(y,p,E,T){return`Invalid type in config for key '${y}' in '${p}', got ${E}, wanted ${T}`},missing(y){return`Missing required config value at '${y}'`},convert(y,p,E){return`Unable to convert config value for key '${y}' in '${p}' to a ${E}`}};class f{constructor(p,E="mock-config",T,I=""){q(this,"filteredKeys");q(this,"notifiedFilteredKeys",new Set);this.data=p,this.context=E,this.fallback=T,this.prefix=I}static fromConfigs(p){return p.length===0?new f(void 0):p.reduce((E,{data:T,context:I,filteredKeys:B,deprecatedKeys:j})=>{const M=new f(T,I,E);if(M.filteredKeys=B,j)for(const{key:b,description:L}of j)console.warn(`The configuration key '${b}' of ${I} is deprecated and may be removed soon. ${L||""}`);return M},void 0)}has(p){var T,I;return this.readValue(p)!==void 0?!0:(I=(T=this.fallback)==null?void 0:T.has(p))!=null?I:!1}keys(){var T,I;const p=this.data?Object.keys(this.data):[],E=(I=(T=this.fallback)==null?void 0:T.keys())!=null?I:[];return[...new Set([...p,...E])]}get(p){const E=this.getOptional(p);if(E===void 0)throw new Error(c.missing(this.fullKey(p!=null?p:"")));return E}getOptional(p){var I;const E=t()(this.readValue(p)),T=(I=this.fallback)==null?void 0:I.getOptional(p);return E===void 0?T:T===void 0?E:u()({},{value:T},{value:E},(B,j)=>!m(j)||!m(B)?j:void 0).value}getConfig(p){const E=this.getOptionalConfig(p);if(E===void 0)throw new Error(c.missing(this.fullKey(p)));return E}getOptionalConfig(p){var I;const E=this.readValue(p),T=(I=this.fallback)==null?void 0:I.getOptionalConfig(p);if(m(E))return this.copy(E,p,T);if(E!==void 0)throw new TypeError(c.type(this.fullKey(p),this.context,o(E),"object"));return T}getConfigArray(p){const E=this.getOptionalConfigArray(p);if(E===void 0)throw new Error(c.missing(this.fullKey(p)));return E}getOptionalConfigArray(p){const E=this.readConfigValue(p,T=>{if(!Array.isArray(T))return{expected:"object-array"};for(const[I,B]of T.entries())if(!m(B))return{expected:"object-array",value:B,key:`${p}[${I}]`};return!0});if(!!E)return E.map((T,I)=>this.copy(T,`${p}[${I}]`))}getNumber(p){const E=this.getOptionalNumber(p);if(E===void 0)throw new Error(c.missing(this.fullKey(p)));return E}getOptionalNumber(p){const E=this.readConfigValue(p,I=>typeof I=="number"||typeof I=="string"||{expected:"number"});if(typeof E=="number"||E===void 0)return E;const T=Number(E);if(!Number.isFinite(T))throw new Error(c.convert(this.fullKey(p),this.context,"number"));return T}getBoolean(p){const E=this.getOptionalBoolean(p);if(E===void 0)throw new Error(c.missing(this.fullKey(p)));return E}getOptionalBoolean(p){return this.readConfigValue(p,E=>typeof E=="boolean"||{expected:"boolean"})}getString(p){const E=this.getOptionalString(p);if(E===void 0)throw new Error(c.missing(this.fullKey(p)));return E}getOptionalString(p){return this.readConfigValue(p,E=>typeof E=="string"&&E!==""||{expected:"string"})}getStringArray(p){const E=this.getOptionalStringArray(p);if(E===void 0)throw new Error(c.missing(this.fullKey(p)));return E}getOptionalStringArray(p){return this.readConfigValue(p,E=>{if(!Array.isArray(E))return{expected:"string-array"};for(const[T,I]of E.entries())if(typeof I!="string"||I==="")return{expected:"string-array",value:I,key:`${p}[${T}]`};return!0})}fullKey(p){return`${this.prefix}${this.prefix?".":""}${p}`}copy(p,E,T){const I=new f(p,this.context,T,this.fullKey(E));return I.filteredKeys=this.filteredKeys,I}readConfigValue(p,E){var B;const T=this.readValue(p);if(T===void 0)return(B=this.fallback)==null?void 0:B.readConfigValue(p,E);const I=E(T);if(I!==!0){const{key:j=p,value:M=T,expected:b}=I;throw new TypeError(c.type(this.fullKey(j),this.context,o(M),b))}return T}readValue(p){const E=p?p.split("."):[];for(const I of E)if(!A.test(I))throw new TypeError(`Invalid config key '${p}'`);if(this.data===void 0)return;let T=this.data;for(const[I,B]of E.entries())if(m(T))T=T[B];else if(T!==void 0){const j=this.fullKey(E.slice(0,I).join("."));throw new TypeError(c.type(j,this.context,o(T),"object"))}return T}}},4333:function(ee,s,e){"use strict";e.d(s,{p:function(){return t}});const r="Invalid discovery URL pattern,";class t{static compile(u){const A=u.split(/\{\{\s*pluginId\s*\}\}/),m=A.join("pluginId");let o;try{o=new URL(m)}catch{throw new Error(`${r} URL '${m}' is invalid`)}if(o.hash)throw new Error(`${r} URL must not have a hash`);if(o.search)throw new Error(`${r} URL must not have a query`);if(m.endsWith("/"))throw new Error(`${r} URL must not end with a slash`);return new t(A)}constructor(u){this.parts=u}async getBaseUrl(u){return this.parts.join(u)}}},89536:function(ee,s,e){"use strict";e.d(s,{KN:function(){return r},gr:function(){return l},Jv:function(){return u}});class r{constructor(m,o){this.alertApi=m,this.errorApi=o}post(m,o){return o!=null&&o.hidden||this.alertApi.post({message:m.message,severity:"error"}),this.errorApi.post(m,o)}error$(){return this.errorApi.error$()}}var t=e(98005);class l{constructor(){q(this,"subject",new t.J)}post(m,o){this.subject.next({error:m,context:o})}error$(){return this.subject}}class u{static forward(m,o){window.addEventListener("unhandledrejection",c=>{m.post(c.reason,o)})}}},14884:function(ee,s,e){"use strict";e.d(s,{b:function(){return l}});var r=e(36964);function t(u){if(u.length<3)throw new Error(`The '${u}' feature flag must have a minimum length of three characters.`);if(u.length>150)throw new Error(`The '${u}' feature flag must not exceed 150 characters.`);if(!u.match(/^[a-z]+[a-z0-9-]+$/))throw new Error(`The '${u}' feature flag must start with a lowercase letter and only contain lowercase letters, numbers and hyphens. Examples: feature-flag-one, alpha, release-2020`)}class l{constructor(){q(this,"registeredFeatureFlags",[]);q(this,"flags")}registerFlag(A){t(A.name),this.registeredFeatureFlags.push(A)}getRegisteredFlags(){return this.registeredFeatureFlags.slice()}isActive(A){return this.flags||(this.flags=this.load()),this.flags.get(A)===r.FeatureFlagState.Active}save(A){this.flags||(this.flags=this.load()),A.merge||this.flags.clear();for(const[o,c]of Object.entries(A.states))this.flags.set(o,c);const m=Array.from(this.flags.entries()).filter(([,o])=>o===r.FeatureFlagState.Active);window.localStorage.setItem("featureFlags",JSON.stringify(Object.fromEntries(m)))}load(){try{const A=window.localStorage.getItem("featureFlags");if(!A)return new Map;const m=JSON.parse(A);if(typeof m!="object"||m===null||Array.isArray(m))return new Map;const o=Object.entries(m).filter(([c,f])=>(t(c),f===r.FeatureFlagState.Active));return new Map(o)}catch{return new Map}}}},50160:function(ee,s,e){"use strict";e.d(s,{I:function(){return c},j:function(){return r}});function r(f){var E;let y=f.baseImplementation||e.g.fetch;const p=[(E=f.middleware)!=null?E:[]].flat().reverse();for(const T of p)y=T.apply(y);return{fetch:y}}class t{static create(y){var I,B;const p=l(y),E=((I=y.header)==null?void 0:I.name)||"authorization",T=((B=y.header)==null?void 0:B.value)||(j=>`Bearer ${j}`);return new t(y.identityApi,p,E,T)}constructor(y,p,E,T){this.identityApi=y,this.allowUrl=p,this.headerName=E,this.headerValue=T}apply(y){return async(p,E)=>{const T=new Request(p,E),{token:I}=await this.identityApi.getCredentials();return T.headers.get(this.headerName)||typeof I!="string"||!I||!this.allowUrl(T.url)?y(p,E):(T.headers.set(this.headerName,this.headerValue(I)),y(T))}}}function l(f){return f.allowUrl?f.allowUrl:f.urlPrefixAllowlist?u(f.urlPrefixAllowlist):f.config?u([f.config.getString("backend.baseUrl")]):()=>!1}function u(f){const y=f.map(p=>p.replace(/\/$/,""));return p=>y.some(E=>p===E||p.startsWith(`${E}/`))}function A(f,y){return!y||y==="/"?f:`${f.replace(/\/$/,"")}/${y.replace(/^\//,"")}`}class m{constructor(y){this.discoveryApi=y}apply(y){return async(p,E)=>{const T=new Request(p,E),I="plugin://";if(!T.url.startsWith(I))return y(p,E);const{hostname:B,pathname:j,search:M,hash:b,username:L,password:D}=new URL(`http://${T.url.substring(I.length)}`);let U=await this.discoveryApi.getBaseUrl(B);if(L||D){const te=new URL(U),ue=`${L}${D?`:${D}`:""}@`;U=`${te.protocol}//${ue}${te.host}${te.pathname}`}const Y=`${A(U,j)}${M}${b}`;return y(Y,typeof p=="string"||o(p)?E:p)}}}function o(f){return typeof f=="object"&&(f==null?void 0:f.constructor)===URL}class c{static resolvePluginProtocol(y){return new m(y.discoveryApi)}static injectIdentityAuth(y){return t.create(y)}constructor(){}}},11358:function(ee,s,e){"use strict";e.d(s,{Y:function(){return A}});var r=e(98005);function t(m,o){for(const c of o)if(!m.has(c))return!1;return!0}function l(m,...o){const c=new Set(m);for(const f of o)for(const y of f)c.add(y);return c}class u{constructor(){q(this,"requests",[]);q(this,"subject",new r.X(this.getCurrentPending()))}request(o){return new Promise((c,f)=>{this.requests.push({scopes:o,resolve:c,reject:f}),this.subject.next(this.getCurrentPending())})}resolve(o,c){this.requests=this.requests.filter(f=>t(o,f.scopes)?(f.resolve(c),!1):!0),this.subject.next(this.getCurrentPending())}reject(o){this.requests.forEach(c=>c.reject(o)),this.requests=[],this.subject.next(this.getCurrentPending())}pending(){return this.subject}getCurrentPending(){const o=this.requests.length===0?void 0:this.requests.slice(1).reduce((c,f)=>l(c,f.scopes),this.requests[0].scopes);return{scopes:o,resolve:c=>{o&&this.resolve(o,c)},reject:c=>{o&&this.reject(c)}}}}class A{constructor(){q(this,"subject",new r.X([]));q(this,"currentRequests",[]);q(this,"handlerCount",0)}createAuthRequester(o){const c=new u,f=this.handlerCount;return this.handlerCount++,c.pending().subscribe({next:y=>{const p=this.currentRequests.slice(),E=this.makeAuthRequest(y,o);E?p[f]=E:delete p[f],this.currentRequests=p,this.subject.next(p.filter(Boolean))}}),y=>c.request(y)}makeAuthRequest(o,c){const{scopes:f}=o;if(!!f)return{provider:c.provider,trigger:async()=>{const y=await c.onAuthRequest(f);o.resolve(y)},reject:()=>{const y=new Error("Login failed, rejected by user");y.name="RejectedError",o.reject(y)}}}authRequest$(){return this.subject}}},56054:function(ee,s,e){"use strict";e.d(s,{C:function(){return u}});var r=e(82394),t=e.n(r);const l=new Map;class u{constructor(m,o){q(this,"subscribers",new Set);q(this,"observable",new(t())(m=>(this.subscribers.add(m),()=>{this.subscribers.delete(m)})));this.namespace=m,this.errorApi=o}static create(m){var o;return new u((o=m.namespace)!=null?o:"",m.errorApi)}get(m){return this.snapshot(m).value}snapshot(m){let o,c="absent";try{const f=localStorage.getItem(this.getKeyName(m));f&&(o=JSON.parse(f,(y,p)=>(typeof p=="object"&&p!==null&&Object.freeze(p),p)),c="present")}catch{this.errorApi.post(new Error(`Error when parsing JSON config from storage for: ${m}`))}return{key:m,value:o,presence:c}}forBucket(m){const o=`${this.namespace}/${m}`;return l.has(o)||l.set(o,new u(o,this.errorApi)),l.get(o)}async set(m,o){localStorage.setItem(this.getKeyName(m),JSON.stringify(o)),this.notifyChanges(m)}async remove(m){localStorage.removeItem(this.getKeyName(m)),this.notifyChanges(m)}observe$(m){return this.observable.filter(({key:o})=>o===m)}getKeyName(m){return`${this.namespace}/${encodeURIComponent(m)}`}notifyChanges(m){const o=this.snapshot(m);for(const c of this.subscribers)c.next(o)}}},59589:function(ee,s,e){"use strict";e.d(s,{u:function(){return l}});var r=e(91205);const t={id:"atlassian",title:"Atlassian",icon:()=>null};class l{static create(A){const{discoveryApi:m,environment:o="development",provider:c=t,oauthRequestApi:f}=A;return r.OAuth2.create({discoveryApi:m,oauthRequestApi:f,provider:c,environment:o})}}},6098:function(ee,s,e){"use strict";e.d(s,{Z:function(){return l}});var r=e(91205);const t={id:"bitbucket",title:"Bitbucket",icon:()=>null};class l{static create(A){const{discoveryApi:m,environment:o="development",provider:c=t,oauthRequestApi:f,defaultScopes:y=["team"]}=A;return r.OAuth2.create({discoveryApi:m,oauthRequestApi:f,provider:c,environment:o,defaultScopes:y})}}},44431:function(ee,s,e){"use strict";e.d(s,{BitbucketAuth:function(){return l.Z}});var r=e(19347),t=e.n(r);e.o(r,"AlertApiForwarder")&&e.d(s,{AlertApiForwarder:function(){return r.AlertApiForwarder}}),e.o(r,"AppThemeSelector")&&e.d(s,{AppThemeSelector:function(){return r.AppThemeSelector}}),e.o(r,"AtlassianAuth")&&e.d(s,{AtlassianAuth:function(){return r.AtlassianAuth}}),e.o(r,"ConfigReader")&&e.d(s,{ConfigReader:function(){return r.ConfigReader}}),e.o(r,"ErrorAlerter")&&e.d(s,{ErrorAlerter:function(){return r.ErrorAlerter}}),e.o(r,"ErrorApiForwarder")&&e.d(s,{ErrorApiForwarder:function(){return r.ErrorApiForwarder}}),e.o(r,"FetchMiddlewares")&&e.d(s,{FetchMiddlewares:function(){return r.FetchMiddlewares}}),e.o(r,"FlatRoutes")&&e.d(s,{FlatRoutes:function(){return r.FlatRoutes}}),e.o(r,"LocalStorageFeatureFlags")&&e.d(s,{LocalStorageFeatureFlags:function(){return r.LocalStorageFeatureFlags}}),e.o(r,"NoOpAnalyticsApi")&&e.d(s,{NoOpAnalyticsApi:function(){return r.NoOpAnalyticsApi}}),e.o(r,"OAuthRequestManager")&&e.d(s,{OAuthRequestManager:function(){return r.OAuthRequestManager}}),e.o(r,"UnhandledErrorForwarder")&&e.d(s,{UnhandledErrorForwarder:function(){return r.UnhandledErrorForwarder}}),e.o(r,"UrlPatternDiscovery")&&e.d(s,{UrlPatternDiscovery:function(){return r.UrlPatternDiscovery}}),e.o(r,"WebStorage")&&e.d(s,{WebStorage:function(){return r.WebStorage}}),e.o(r,"createFetchApi")&&e.d(s,{createFetchApi:function(){return r.createFetchApi}}),e.o(r,"createSpecializedApp")&&e.d(s,{createSpecializedApp:function(){return r.createSpecializedApp}}),e.o(r,"defaultConfigLoader")&&e.d(s,{defaultConfigLoader:function(){return r.defaultConfigLoader}});var l=e(6098)},19347:function(){},44474:function(ee,s,e){"use strict";e.d(s,{T:function(){return l}});var r=e(91205);const t={id:"github",title:"GitHub",icon:()=>null};class l{static create(A){const{discoveryApi:m,environment:o="development",provider:c=t,oauthRequestApi:f,defaultScopes:y=["read:user"]}=A;return r.OAuth2.create({discoveryApi:m,oauthRequestApi:f,provider:c,environment:o,defaultScopes:y})}}},2922:function(ee,s,e){"use strict";e.d(s,{a:function(){return l}});var r=e(91205);const t={id:"gitlab",title:"GitLab",icon:()=>null};class l{static create(A){const{discoveryApi:m,environment:o="development",provider:c=t,oauthRequestApi:f,defaultScopes:y=["read_user"]}=A;return r.OAuth2.create({discoveryApi:m,oauthRequestApi:f,provider:c,environment:o,defaultScopes:y})}}},59938:function(ee,s,e){"use strict";e.d(s,{e:function(){return u}});var r=e(91205);const t={id:"google",title:"Google",icon:()=>null},l="https://www.googleapis.com/auth/";class u{static create(m){const{discoveryApi:o,oauthRequestApi:c,environment:f="development",provider:y=t,defaultScopes:p=["openid",`${l}userinfo.email`,`${l}userinfo.profile`]}=m;return r.OAuth2.create({discoveryApi:o,oauthRequestApi:c,provider:y,environment:f,defaultScopes:p,scopeTransform(E){return E.map(T=>T==="openid"?T:T==="profile"||T==="email"?`${l}userinfo.${T}`:T.startsWith(l)?T:`${l}${T}`)}})}}},91668:function(ee,s,e){"use strict";e.d(s,{AtlassianAuth:function(){return y.u},BitbucketAuth:function(){return f.BitbucketAuth},GithubAuth:function(){return r.T},GitlabAuth:function(){return t.a},GoogleAuth:function(){return l.e},MicrosoftAuth:function(){return o._},OktaAuth:function(){return A.s},OneLoginAuth:function(){return c.$}});var r=e(44474),t=e(2922),l=e(59938),u=e(91205);e.o(u,"AlertApiForwarder")&&e.d(s,{AlertApiForwarder:function(){return u.AlertApiForwarder}}),e.o(u,"AppThemeSelector")&&e.d(s,{AppThemeSelector:function(){return u.AppThemeSelector}}),e.o(u,"AtlassianAuth")&&e.d(s,{AtlassianAuth:function(){return u.AtlassianAuth}}),e.o(u,"BitbucketAuth")&&e.d(s,{BitbucketAuth:function(){return u.BitbucketAuth}}),e.o(u,"ConfigReader")&&e.d(s,{ConfigReader:function(){return u.ConfigReader}}),e.o(u,"ErrorAlerter")&&e.d(s,{ErrorAlerter:function(){return u.ErrorAlerter}}),e.o(u,"ErrorApiForwarder")&&e.d(s,{ErrorApiForwarder:function(){return u.ErrorApiForwarder}}),e.o(u,"FetchMiddlewares")&&e.d(s,{FetchMiddlewares:function(){return u.FetchMiddlewares}}),e.o(u,"FlatRoutes")&&e.d(s,{FlatRoutes:function(){return u.FlatRoutes}}),e.o(u,"LocalStorageFeatureFlags")&&e.d(s,{LocalStorageFeatureFlags:function(){return u.LocalStorageFeatureFlags}}),e.o(u,"MicrosoftAuth")&&e.d(s,{MicrosoftAuth:function(){return u.MicrosoftAuth}}),e.o(u,"NoOpAnalyticsApi")&&e.d(s,{NoOpAnalyticsApi:function(){return u.NoOpAnalyticsApi}}),e.o(u,"OAuthRequestManager")&&e.d(s,{OAuthRequestManager:function(){return u.OAuthRequestManager}}),e.o(u,"OktaAuth")&&e.d(s,{OktaAuth:function(){return u.OktaAuth}}),e.o(u,"OneLoginAuth")&&e.d(s,{OneLoginAuth:function(){return u.OneLoginAuth}}),e.o(u,"UnhandledErrorForwarder")&&e.d(s,{UnhandledErrorForwarder:function(){return u.UnhandledErrorForwarder}}),e.o(u,"UrlPatternDiscovery")&&e.d(s,{UrlPatternDiscovery:function(){return u.UrlPatternDiscovery}}),e.o(u,"WebStorage")&&e.d(s,{WebStorage:function(){return u.WebStorage}}),e.o(u,"createFetchApi")&&e.d(s,{createFetchApi:function(){return u.createFetchApi}}),e.o(u,"createSpecializedApp")&&e.d(s,{createSpecializedApp:function(){return u.createSpecializedApp}}),e.o(u,"defaultConfigLoader")&&e.d(s,{defaultConfigLoader:function(){return u.defaultConfigLoader}});var A=e(26079),m=e(67604),o=e(38482),c=e(58381),f=e(44431);e.o(f,"AlertApiForwarder")&&e.d(s,{AlertApiForwarder:function(){return f.AlertApiForwarder}}),e.o(f,"AppThemeSelector")&&e.d(s,{AppThemeSelector:function(){return f.AppThemeSelector}}),e.o(f,"AtlassianAuth")&&e.d(s,{AtlassianAuth:function(){return f.AtlassianAuth}}),e.o(f,"ConfigReader")&&e.d(s,{ConfigReader:function(){return f.ConfigReader}}),e.o(f,"ErrorAlerter")&&e.d(s,{ErrorAlerter:function(){return f.ErrorAlerter}}),e.o(f,"ErrorApiForwarder")&&e.d(s,{ErrorApiForwarder:function(){return f.ErrorApiForwarder}}),e.o(f,"FetchMiddlewares")&&e.d(s,{FetchMiddlewares:function(){return f.FetchMiddlewares}}),e.o(f,"FlatRoutes")&&e.d(s,{FlatRoutes:function(){return f.FlatRoutes}}),e.o(f,"LocalStorageFeatureFlags")&&e.d(s,{LocalStorageFeatureFlags:function(){return f.LocalStorageFeatureFlags}}),e.o(f,"NoOpAnalyticsApi")&&e.d(s,{NoOpAnalyticsApi:function(){return f.NoOpAnalyticsApi}}),e.o(f,"OAuthRequestManager")&&e.d(s,{OAuthRequestManager:function(){return f.OAuthRequestManager}}),e.o(f,"UnhandledErrorForwarder")&&e.d(s,{UnhandledErrorForwarder:function(){return f.UnhandledErrorForwarder}}),e.o(f,"UrlPatternDiscovery")&&e.d(s,{UrlPatternDiscovery:function(){return f.UrlPatternDiscovery}}),e.o(f,"WebStorage")&&e.d(s,{WebStorage:function(){return f.WebStorage}}),e.o(f,"createFetchApi")&&e.d(s,{createFetchApi:function(){return f.createFetchApi}}),e.o(f,"createSpecializedApp")&&e.d(s,{createSpecializedApp:function(){return f.createSpecializedApp}}),e.o(f,"defaultConfigLoader")&&e.d(s,{defaultConfigLoader:function(){return f.defaultConfigLoader}});var y=e(59589)},38482:function(ee,s,e){"use strict";e.d(s,{_:function(){return l}});var r=e(91205);const t={id:"microsoft",title:"Microsoft",icon:()=>null};class l{static create(A){const{environment:m="development",provider:o=t,oauthRequestApi:c,discoveryApi:f,defaultScopes:y=["openid","offline_access","profile","email","User.Read"]}=A;return r.OAuth2.create({discoveryApi:f,oauthRequestApi:c,provider:o,environment:m,defaultScopes:y})}}},73124:function(ee,s,e){"use strict";e.d(s,{Z:function(){return m}});function r(o){return new Promise((c,f)=>{const y=o.width||500,p=o.height||700,E=window.screen.width/2-y/2,T=window.screen.height/2-p/2,I=window.open(o.url,o.name,`menubar=no,location=no,resizable=no,scrollbars=no,status=no,width=${y},height=${p},top=${T},left=${E}`);let B="";if(!I||typeof I.closed=="undefined"||I.closed){const L=new Error("Failed to open auth popup.");L.name="PopupRejectedError",f(L);return}const j=L=>{if(L.source!==I||L.origin!==o.origin)return;const{data:D}=L;if(D.type==="config_info"){B=D.targetOrigin;return}if(D.type!=="authorization_response")return;const U=D;if("error"in U){const Y=new Error(U.error.message);Y.name=U.error.name,f(Y)}else c(U.response);b()},M=setInterval(()=>{if(I.closed){const L=`Login failed, ${B&&B!==window.location.origin?`Incorrect app origin, expected ${B}`:"popup was closed"}`,D=new Error(L);D.name="PopupClosedError",f(D),b()}},100);function b(){window.removeEventListener("message",j),clearInterval(M)}window.addEventListener("message",j)})}function t(o){return[...o].join(" ")}class l{constructor(c){q(this,"discoveryApi");q(this,"environment");q(this,"provider");q(this,"joinScopesFunc");q(this,"authRequester");q(this,"sessionTransform");const{discoveryApi:f,environment:y,provider:p,joinScopes:E=t,oauthRequestApi:T,sessionTransform:I=B=>B}=c;this.authRequester=T.createAuthRequester({provider:p,onAuthRequest:B=>this.showPopup(B)}),this.discoveryApi=f,this.environment=y,this.provider=p,this.joinScopesFunc=E,this.sessionTransform=I}async createSession(c){return c.instantPopup?this.showPopup(c.scopes):this.authRequester(c.scopes)}async refreshSession(){const c=await fetch(await this.buildUrl("/refresh",{optional:!0}),{headers:{"x-requested-with":"XMLHttpRequest"},credentials:"include"}).catch(y=>{throw new Error(`Auth refresh request failed, ${y}`)});if(!c.ok){const y=new Error(`Auth refresh request failed, ${c.statusText}`);throw y.status=c.status,y}const f=await c.json();if(f.error){const y=new Error(f.error.message);throw f.error.name&&(y.name=f.error.name),y}return await this.sessionTransform(f)}async removeSession(){const c=await fetch(await this.buildUrl("/logout"),{method:"POST",headers:{"x-requested-with":"XMLHttpRequest"},credentials:"include"}).catch(f=>{throw new Error(`Logout request failed, ${f}`)});if(!c.ok){const f=new Error(`Logout request failed, ${c.statusText}`);throw f.status=c.status,f}}async showPopup(c){const f=this.joinScopesFunc(c),y=await this.buildUrl("/start",{scope:f,origin:location.origin}),p=await r({url:y,name:`${this.provider.title} Login`,origin:new URL(y).origin,width:450,height:730});return await this.sessionTransform(p)}async buildUrl(c,f){const y=await this.discoveryApi.getBaseUrl("auth"),p=this.buildQueryString({...f,env:this.environment});return`${y}/${this.provider.id}${c}${p}`}buildQueryString(c){if(!c)return"";const f=Object.entries(c).map(([y,p])=>{if(typeof p=="string")return`${encodeURIComponent(y)}=${encodeURIComponent(p)}`;if(p)return encodeURIComponent(y)}).filter(Boolean).join("&");return f?`?${f}`:""}}var u=e(57018);const A={id:"oauth2",title:"Your Identity Provider",icon:()=>null};class m{constructor(c){q(this,"sessionManager");q(this,"scopeTransform");this.sessionManager=c.sessionManager,this.scopeTransform=c.scopeTransform}static create(c){const{discoveryApi:f,environment:y="development",provider:p=A,oauthRequestApi:E,defaultScopes:T=[],scopeTransform:I=M=>M}=c,B=new l({discoveryApi:f,environment:y,provider:p,oauthRequestApi:E,sessionTransform(M){return{...M,providerInfo:{idToken:M.providerInfo.idToken,accessToken:M.providerInfo.accessToken,scopes:m.normalizeScopes(I,M.providerInfo.scope),expiresAt:new Date(Date.now()+M.providerInfo.expiresInSeconds*1e3)}}}}),j=new u.RefreshingAuthSessionManager({connector:B,defaultScopes:new Set(T),sessionScopes:M=>M.providerInfo.scopes,sessionShouldRefresh:M=>(M.providerInfo.expiresAt.getTime()-Date.now())/1e3<60*5});return new m({sessionManager:j,scopeTransform:I})}async signIn(){await this.getAccessToken()}async signOut(){await this.sessionManager.removeSession()}sessionState$(){return this.sessionManager.sessionState$()}async getAccessToken(c,f){var E;const y=m.normalizeScopes(this.scopeTransform,c),p=await this.sessionManager.getSession({...f,scopes:y});return(E=p==null?void 0:p.providerInfo.accessToken)!=null?E:""}async getIdToken(c={}){var y;const f=await this.sessionManager.getSession(c);return(y=f==null?void 0:f.providerInfo.idToken)!=null?y:""}async getBackstageIdentity(c={}){const f=await this.sessionManager.getSession(c);return f==null?void 0:f.backstageIdentity}async getProfile(c={}){const f=await this.sessionManager.getSession(c);return f==null?void 0:f.profile}static normalizeScopes(c,f){if(!f)return new Set;const y=Array.isArray(f)?f:f.split(/[\s|,]/).filter(Boolean);return new Set(c(y))}}},91205:function(ee,s,e){"use strict";e.d(s,{OAuth2:function(){return r.Z}});var r=e(73124),t=e(5973),l=e.n(t);e.o(t,"AlertApiForwarder")&&e.d(s,{AlertApiForwarder:function(){return t.AlertApiForwarder}}),e.o(t,"AppThemeSelector")&&e.d(s,{AppThemeSelector:function(){return t.AppThemeSelector}}),e.o(t,"AtlassianAuth")&&e.d(s,{AtlassianAuth:function(){return t.AtlassianAuth}}),e.o(t,"BitbucketAuth")&&e.d(s,{BitbucketAuth:function(){return t.BitbucketAuth}}),e.o(t,"ConfigReader")&&e.d(s,{ConfigReader:function(){return t.ConfigReader}}),e.o(t,"ErrorAlerter")&&e.d(s,{ErrorAlerter:function(){return t.ErrorAlerter}}),e.o(t,"ErrorApiForwarder")&&e.d(s,{ErrorApiForwarder:function(){return t.ErrorApiForwarder}}),e.o(t,"FetchMiddlewares")&&e.d(s,{FetchMiddlewares:function(){return t.FetchMiddlewares}}),e.o(t,"FlatRoutes")&&e.d(s,{FlatRoutes:function(){return t.FlatRoutes}}),e.o(t,"LocalStorageFeatureFlags")&&e.d(s,{LocalStorageFeatureFlags:function(){return t.LocalStorageFeatureFlags}}),e.o(t,"MicrosoftAuth")&&e.d(s,{MicrosoftAuth:function(){return t.MicrosoftAuth}}),e.o(t,"NoOpAnalyticsApi")&&e.d(s,{NoOpAnalyticsApi:function(){return t.NoOpAnalyticsApi}}),e.o(t,"OAuthRequestManager")&&e.d(s,{OAuthRequestManager:function(){return t.OAuthRequestManager}}),e.o(t,"OktaAuth")&&e.d(s,{OktaAuth:function(){return t.OktaAuth}}),e.o(t,"OneLoginAuth")&&e.d(s,{OneLoginAuth:function(){return t.OneLoginAuth}}),e.o(t,"UnhandledErrorForwarder")&&e.d(s,{UnhandledErrorForwarder:function(){return t.UnhandledErrorForwarder}}),e.o(t,"UrlPatternDiscovery")&&e.d(s,{UrlPatternDiscovery:function(){return t.UrlPatternDiscovery}}),e.o(t,"WebStorage")&&e.d(s,{WebStorage:function(){return t.WebStorage}}),e.o(t,"createFetchApi")&&e.d(s,{createFetchApi:function(){return t.createFetchApi}}),e.o(t,"createSpecializedApp")&&e.d(s,{createSpecializedApp:function(){return t.createSpecializedApp}}),e.o(t,"defaultConfigLoader")&&e.d(s,{defaultConfigLoader:function(){return t.defaultConfigLoader}})},5973:function(){},26079:function(ee,s,e){"use strict";e.d(s,{s:function(){return A}});var r=e(91205);const t={id:"okta",title:"Okta",icon:()=>null},l=new Set(["openid","profile","email","phone","address","groups","offline_access"]),u="okta.";class A{static create(o){const{discoveryApi:c,environment:f="development",provider:y=t,oauthRequestApi:p,defaultScopes:E=["openid","email","profile","offline_access"]}=o;return r.OAuth2.create({discoveryApi:c,oauthRequestApi:p,provider:y,environment:f,defaultScopes:E,scopeTransform(T){return T.map(I=>l.has(I)||I.startsWith(u)?I:`${u}${I}`)}})}}},58381:function(ee,s,e){"use strict";e.d(s,{$:function(){return A}});var r=e(91205);const t={id:"onelogin",title:"onelogin",icon:()=>null},l=new Set(["openid","profile","email","phone","address","groups","offline_access"]),u="onelogin.";class A{static create(o){const{discoveryApi:c,environment:f="development",provider:y=t,oauthRequestApi:p}=o;return r.OAuth2.create({discoveryApi:c,oauthRequestApi:p,provider:y,environment:f,defaultScopes:["openid","email","profile","offline_access"],scopeTransform(E){return E.map(T=>l.has(T)||T.startsWith(u)?T:`${u}${T}`)}})}}},67604:function(ee,s,e){"use strict";var r=e(57018),t=e(30195);const l=t.z.object({profile:t.z.object({email:t.z.string().optional(),displayName:t.z.string().optional(),picture:t.z.string().optional()}),backstageIdentity:t.z.object({token:t.z.string(),identity:t.z.object({type:t.z.literal("user"),userEntityRef:t.z.string(),ownershipEntityRefs:t.z.array(t.z.string())})})}),u={id:"saml",title:"SAML",icon:()=>null};class A{static create(o){const{discoveryApi:c,environment:f="development",provider:y=u}=o,p=new DirectAuthConnector({discoveryApi:c,environment:f,provider:y}),E=new StaticAuthSessionManager({connector:p}),T=new AuthSessionStore({manager:E,storageKey:`${y.id}Session`,schema:samlSessionSchema});return new A(T)}sessionState$(){return this.sessionManager.sessionState$()}constructor(o){this.sessionManager=o}async signIn(){await this.getBackstageIdentity({})}async signOut(){await this.sessionManager.removeSession()}async getBackstageIdentity(o={}){const c=await this.sessionManager.getSession(o);return c==null?void 0:c.backstageIdentity}async getProfile(o={}){const c=await this.sessionManager.getSession(o);return c==null?void 0:c.profile}}},91631:function(ee,s,e){"use strict";e.d(s,{AlertApiForwarder:function(){return t.C},AppThemeSelector:function(){return u.C},AtlassianAuth:function(){return r.AtlassianAuth},ConfigReader:function(){return A.m},ErrorAlerter:function(){return o.KN},ErrorApiForwarder:function(){return o.gr},FetchMiddlewares:function(){return f.I},GithubAuth:function(){return r.GithubAuth},GitlabAuth:function(){return r.GitlabAuth},GoogleAuth:function(){return r.GoogleAuth},LocalStorageFeatureFlags:function(){return c.b},MicrosoftAuth:function(){return r.MicrosoftAuth},NoOpAnalyticsApi:function(){return l.g},OAuthRequestManager:function(){return y.Y},OktaAuth:function(){return r.OktaAuth},OneLoginAuth:function(){return r.OneLoginAuth},UnhandledErrorForwarder:function(){return o.Jv},UrlPatternDiscovery:function(){return m.p},WebStorage:function(){return p.C},createFetchApi:function(){return f.j}});var r=e(91668);e.o(r,"AlertApiForwarder")&&e.d(s,{AlertApiForwarder:function(){return r.AlertApiForwarder}}),e.o(r,"AppThemeSelector")&&e.d(s,{AppThemeSelector:function(){return r.AppThemeSelector}}),e.o(r,"BitbucketAuth")&&e.d(s,{BitbucketAuth:function(){return r.BitbucketAuth}}),e.o(r,"ConfigReader")&&e.d(s,{ConfigReader:function(){return r.ConfigReader}}),e.o(r,"ErrorAlerter")&&e.d(s,{ErrorAlerter:function(){return r.ErrorAlerter}}),e.o(r,"ErrorApiForwarder")&&e.d(s,{ErrorApiForwarder:function(){return r.ErrorApiForwarder}}),e.o(r,"FetchMiddlewares")&&e.d(s,{FetchMiddlewares:function(){return r.FetchMiddlewares}}),e.o(r,"FlatRoutes")&&e.d(s,{FlatRoutes:function(){return r.FlatRoutes}}),e.o(r,"LocalStorageFeatureFlags")&&e.d(s,{LocalStorageFeatureFlags:function(){return r.LocalStorageFeatureFlags}}),e.o(r,"NoOpAnalyticsApi")&&e.d(s,{NoOpAnalyticsApi:function(){return r.NoOpAnalyticsApi}}),e.o(r,"OAuthRequestManager")&&e.d(s,{OAuthRequestManager:function(){return r.OAuthRequestManager}}),e.o(r,"UnhandledErrorForwarder")&&e.d(s,{UnhandledErrorForwarder:function(){return r.UnhandledErrorForwarder}}),e.o(r,"UrlPatternDiscovery")&&e.d(s,{UrlPatternDiscovery:function(){return r.UrlPatternDiscovery}}),e.o(r,"WebStorage")&&e.d(s,{WebStorage:function(){return r.WebStorage}}),e.o(r,"createFetchApi")&&e.d(s,{createFetchApi:function(){return r.createFetchApi}}),e.o(r,"createSpecializedApp")&&e.d(s,{createSpecializedApp:function(){return r.createSpecializedApp}}),e.o(r,"defaultConfigLoader")&&e.d(s,{defaultConfigLoader:function(){return r.defaultConfigLoader}});var t=e(23235),l=e(47150),u=e(58652),A=e(14721),m=e(4333),o=e(89536),c=e(14884),f=e(50160),y=e(11358),p=e(56054)},56494:function(ee,s,e){"use strict";e.d(s,{AlertApiForwarder:function(){return t.AlertApiForwarder},ApiProvider:function(){return r.ApiProvider},AppThemeSelector:function(){return t.AppThemeSelector},ConfigReader:function(){return t.ConfigReader},ErrorAlerter:function(){return t.ErrorAlerter},ErrorApiForwarder:function(){return t.ErrorApiForwarder},FetchMiddlewares:function(){return t.FetchMiddlewares},LocalStorageFeatureFlags:function(){return t.LocalStorageFeatureFlags},NoOpAnalyticsApi:function(){return t.NoOpAnalyticsApi},OAuthRequestManager:function(){return t.OAuthRequestManager},UnhandledErrorForwarder:function(){return t.UnhandledErrorForwarder},UrlPatternDiscovery:function(){return t.UrlPatternDiscovery},WebStorage:function(){return t.WebStorage},createFetchApi:function(){return t.createFetchApi}});var r=e(76105);e.o(r,"AlertApiForwarder")&&e.d(s,{AlertApiForwarder:function(){return r.AlertApiForwarder}}),e.o(r,"AppThemeSelector")&&e.d(s,{AppThemeSelector:function(){return r.AppThemeSelector}}),e.o(r,"AtlassianAuth")&&e.d(s,{AtlassianAuth:function(){return r.AtlassianAuth}}),e.o(r,"BitbucketAuth")&&e.d(s,{BitbucketAuth:function(){return r.BitbucketAuth}}),e.o(r,"ConfigReader")&&e.d(s,{ConfigReader:function(){return r.ConfigReader}}),e.o(r,"ErrorAlerter")&&e.d(s,{ErrorAlerter:function(){return r.ErrorAlerter}}),e.o(r,"ErrorApiForwarder")&&e.d(s,{ErrorApiForwarder:function(){return r.ErrorApiForwarder}}),e.o(r,"FetchMiddlewares")&&e.d(s,{FetchMiddlewares:function(){return r.FetchMiddlewares}}),e.o(r,"FlatRoutes")&&e.d(s,{FlatRoutes:function(){return r.FlatRoutes}}),e.o(r,"GithubAuth")&&e.d(s,{GithubAuth:function(){return r.GithubAuth}}),e.o(r,"GitlabAuth")&&e.d(s,{GitlabAuth:function(){return r.GitlabAuth}}),e.o(r,"GoogleAuth")&&e.d(s,{GoogleAuth:function(){return r.GoogleAuth}}),e.o(r,"LocalStorageFeatureFlags")&&e.d(s,{LocalStorageFeatureFlags:function(){return r.LocalStorageFeatureFlags}}),e.o(r,"MicrosoftAuth")&&e.d(s,{MicrosoftAuth:function(){return r.MicrosoftAuth}}),e.o(r,"NoOpAnalyticsApi")&&e.d(s,{NoOpAnalyticsApi:function(){return r.NoOpAnalyticsApi}}),e.o(r,"OAuthRequestManager")&&e.d(s,{OAuthRequestManager:function(){return r.OAuthRequestManager}}),e.o(r,"OktaAuth")&&e.d(s,{OktaAuth:function(){return r.OktaAuth}}),e.o(r,"OneLoginAuth")&&e.d(s,{OneLoginAuth:function(){return r.OneLoginAuth}}),e.o(r,"UnhandledErrorForwarder")&&e.d(s,{UnhandledErrorForwarder:function(){return r.UnhandledErrorForwarder}}),e.o(r,"UrlPatternDiscovery")&&e.d(s,{UrlPatternDiscovery:function(){return r.UrlPatternDiscovery}}),e.o(r,"WebStorage")&&e.d(s,{WebStorage:function(){return r.WebStorage}}),e.o(r,"createFetchApi")&&e.d(s,{createFetchApi:function(){return r.createFetchApi}}),e.o(r,"createSpecializedApp")&&e.d(s,{createSpecializedApp:function(){return r.createSpecializedApp}}),e.o(r,"defaultConfigLoader")&&e.d(s,{defaultConfigLoader:function(){return r.defaultConfigLoader}});var t=e(91631);e.o(t,"AtlassianAuth")&&e.d(s,{AtlassianAuth:function(){return t.AtlassianAuth}}),e.o(t,"BitbucketAuth")&&e.d(s,{BitbucketAuth:function(){return t.BitbucketAuth}}),e.o(t,"FlatRoutes")&&e.d(s,{FlatRoutes:function(){return t.FlatRoutes}}),e.o(t,"GithubAuth")&&e.d(s,{GithubAuth:function(){return t.GithubAuth}}),e.o(t,"GitlabAuth")&&e.d(s,{GitlabAuth:function(){return t.GitlabAuth}}),e.o(t,"GoogleAuth")&&e.d(s,{GoogleAuth:function(){return t.GoogleAuth}}),e.o(t,"MicrosoftAuth")&&e.d(s,{MicrosoftAuth:function(){return t.MicrosoftAuth}}),e.o(t,"OktaAuth")&&e.d(s,{OktaAuth:function(){return t.OktaAuth}}),e.o(t,"OneLoginAuth")&&e.d(s,{OneLoginAuth:function(){return t.OneLoginAuth}}),e.o(t,"createSpecializedApp")&&e.d(s,{createSpecializedApp:function(){return t.createSpecializedApp}}),e.o(t,"defaultConfigLoader")&&e.d(s,{defaultConfigLoader:function(){return t.defaultConfigLoader}})},80396:function(ee,s,e){"use strict";e.d(s,{p:function(){return t}});var r;(function(l){l[l.default=10]="default";const u=50;l[l.app=u]="app",l[l.static=100]="static"})(r||(r={}));class t{constructor(){q(this,"factories",new Map)}register(u,A){const m=r[u],o=this.factories.get(A.api.id);return o&&o.priority>=m?!1:(this.factories.set(A.api.id,{priority:m,factory:A}),!0)}get(u){const A=this.factories.get(u.id);if(!!A)return A.factory}getAllApis(){const u=new Set;for(const{factory:A}of this.factories.values())u.add(A.api);return u}}},14406:function(ee,s,e){"use strict";e.d(s,{g:function(){return o}});var r=e(2784),t=e(13980),l=e.n(t);class u{constructor(...f){q(this,"holders");this.holders=f}get(f){for(const y of this.holders){const p=y.get(f);if(p)return p}}}var A=e(76241);const m=(0,A.CT)("api-context"),o=c=>{var T;const{apis:f,children:y}=c,p=(T=(0,r.useContext)(m))==null?void 0:T.atVersion(1),E=p?new u(f,p):f;return r.createElement(m.Provider,{value:(0,A.EI)({1:E}),children:y})};o.propTypes={apis:l().shape({get:l().func.isRequired}).isRequired,children:l().node}},12132:function(ee,s,e){"use strict";e.d(s,{M:function(){return r}});class r{constructor(l){q(this,"apis",new Map);this.factories=l}static validateFactories(l,u){for(const A of u){const m=[A],o=new Set;for(;m.length;){const c=m.shift(),f=l.get(c);if(!!f)for(const y of Object.values(f.deps)){if(y.id===A.id)throw new Error(`Circular dependency of api factory for ${A}`);o.has(y)||(o.add(y),m.push(y))}}}}get(l){return this.load(l)}load(l,u=[]){const A=this.apis.get(l.id);if(A)return A;const m=this.factories.get(l);if(!m)return;if(u.includes(m.api))throw new Error(`Circular dependency of api factory for ${m.api}`);const o=this.loadDeps(l,m.deps,[...u,m.api]),c=m.factory(o);return this.apis.set(l.id,c),c}loadDeps(l,u,A){const m={};for(const o in u)if(u.hasOwnProperty(o)){const c=u[o],f=this.load(c,A);if(!f)throw new Error(`No API factory available for dependency ${c} of dependent ${l}`);m[o]=f}return m}}},76105:function(ee,s,e){"use strict";e.d(s,{ApiFactoryRegistry:function(){return l.p},ApiProvider:function(){return r.g},ApiResolver:function(){return t.M}});var r=e(14406),t=e(12132),l=e(80396),u=e(82488),A=e.n(u);e.o(u,"AlertApiForwarder")&&e.d(s,{AlertApiForwarder:function(){return u.AlertApiForwarder}}),e.o(u,"AppThemeSelector")&&e.d(s,{AppThemeSelector:function(){return u.AppThemeSelector}}),e.o(u,"AtlassianAuth")&&e.d(s,{AtlassianAuth:function(){return u.AtlassianAuth}}),e.o(u,"BitbucketAuth")&&e.d(s,{BitbucketAuth:function(){return u.BitbucketAuth}}),e.o(u,"ConfigReader")&&e.d(s,{ConfigReader:function(){return u.ConfigReader}}),e.o(u,"ErrorAlerter")&&e.d(s,{ErrorAlerter:function(){return u.ErrorAlerter}}),e.o(u,"ErrorApiForwarder")&&e.d(s,{ErrorApiForwarder:function(){return u.ErrorApiForwarder}}),e.o(u,"FetchMiddlewares")&&e.d(s,{FetchMiddlewares:function(){return u.FetchMiddlewares}}),e.o(u,"FlatRoutes")&&e.d(s,{FlatRoutes:function(){return u.FlatRoutes}}),e.o(u,"GithubAuth")&&e.d(s,{GithubAuth:function(){return u.GithubAuth}}),e.o(u,"GitlabAuth")&&e.d(s,{GitlabAuth:function(){return u.GitlabAuth}}),e.o(u,"GoogleAuth")&&e.d(s,{GoogleAuth:function(){return u.GoogleAuth}}),e.o(u,"LocalStorageFeatureFlags")&&e.d(s,{LocalStorageFeatureFlags:function(){return u.LocalStorageFeatureFlags}}),e.o(u,"MicrosoftAuth")&&e.d(s,{MicrosoftAuth:function(){return u.MicrosoftAuth}}),e.o(u,"NoOpAnalyticsApi")&&e.d(s,{NoOpAnalyticsApi:function(){return u.NoOpAnalyticsApi}}),e.o(u,"OAuthRequestManager")&&e.d(s,{OAuthRequestManager:function(){return u.OAuthRequestManager}}),e.o(u,"OktaAuth")&&e.d(s,{OktaAuth:function(){return u.OktaAuth}}),e.o(u,"OneLoginAuth")&&e.d(s,{OneLoginAuth:function(){return u.OneLoginAuth}}),e.o(u,"UnhandledErrorForwarder")&&e.d(s,{UnhandledErrorForwarder:function(){return u.UnhandledErrorForwarder}}),e.o(u,"UrlPatternDiscovery")&&e.d(s,{UrlPatternDiscovery:function(){return u.UrlPatternDiscovery}}),e.o(u,"WebStorage")&&e.d(s,{WebStorage:function(){return u.WebStorage}}),e.o(u,"createFetchApi")&&e.d(s,{createFetchApi:function(){return u.createFetchApi}}),e.o(u,"createSpecializedApp")&&e.d(s,{createSpecializedApp:function(){return u.createSpecializedApp}}),e.o(u,"defaultConfigLoader")&&e.d(s,{defaultConfigLoader:function(){return u.defaultConfigLoader}})},82488:function(){},82370:function(ee,s,e){"use strict";e.d(s,{b:function(){return ct}});var r=e(2784),t=e(10289),l=e(64279),u=e(56494),A=e(36964),m=e(76105);function o(Q){const Z={};for(const se in Q.collectors)Q.collectors.hasOwnProperty(se)&&(Z[se]=Q.collectors[se]());const X=[{node:r.Children.toArray(Q.root),parent:void 0,contexts:{}}];for(;X.length!==0;){const{node:se,parent:le,contexts:be}=X.shift();r.Children.forEach(se,Oe=>{if(!(0,r.isValidElement)(Oe))return;const Ae={};for(const Ke in Z)if(Z.hasOwnProperty(Ke)){const ke=Z[Ke];Ae[Ke]=ke.visit(ke.accumulator,Oe,le,be[Ke])}for(const Ke of Q.discoverers){const ke=Ke(Oe);ke&&X.push({node:ke,parent:Oe,contexts:Ae})}})}return Object.fromEntries(Object.entries(Z).map(([se,le])=>[se,le.accumulator]))}function c(Q,Z){return()=>({accumulator:Q(),visit:Z})}function f(Q){var Z;return(Z=Q.props)==null?void 0:Z.children}function y(Q){var Z,X,se;if(((Z=Q.props)==null?void 0:Z.path)&&((X=Q.props)==null?void 0:X.element))return(se=Q.props)==null?void 0:se.element}const p=c(()=>new Set,(Q,Z)=>{const X=(0,A.getComponentData)(Z,"core.plugin");X&&Q.add(X)});var E=e(88934);const T={caseSensitive:!1,path:"/*",element:"match-all",routeRefs:new Set},I=c(()=>({paths:new Map,parents:new Map,objects:new Array}),(Q,Z,X,se)=>{var Lt,Rt,Nt,Zt,vt;if((X==null?void 0:X.props.element)===Z)return se;let le=se==null?void 0:se.obj,be=se==null?void 0:se.routeRef,Oe=se==null?void 0:se.sticky;const Ae=(Lt=Z.props)==null?void 0:Lt.path,Ke=(Rt=le==null?void 0:le.children)!=null?Rt:Q.objects,ke=Boolean((Nt=Z.props)==null?void 0:Nt.caseSensitive);let Et=se==null?void 0:se.path;if((0,A.getComponentData)(Z,"core.gatherMountPoints")){if(!Ae)throw new Error("Mount point gatherer must have a path");Et=Ae}const It=(Zt=Z.props)==null?void 0:Zt.element;let lt=(0,A.getComponentData)(Z,"core.mountPoint");if(!lt&&(0,r.isValidElement)(It)&&(lt=(0,A.getComponentData)(It,"core.mountPoint")),lt){let at=Ae;if(Et&&(at?Et=void 0:at=Et),!at)throw new Error("Mounted routable extension must have a path");Q.paths.set(lt,at),be&&Oe?(Q.parents.set(lt,be),Ae&&(be=lt,Oe=!1)):(Q.parents.set(lt,be),be=lt),Ae?(le={caseSensitive:ke,path:Ae,element:"mounted",routeRefs:new Set([lt]),children:[T],plugin:(0,A.getComponentData)(Z.props.element,"core.plugin")},Ke.push(le)):le==null||le.routeRefs.add(lt)}if((0,A.getComponentData)(Z,"core.gatherMountPoints")&&(Oe=!0),(0,A.getComponentData)(Z,"core.gatherMountPoints")){if(!Ae)throw new Error("Mount point gatherer must have a path");lt||(le={caseSensitive:ke,path:Ae,element:"gathered",routeRefs:new Set,children:[T],plugin:(vt=se==null?void 0:se.obj)==null?void 0:vt.plugin},Ke.push(le))}return{obj:le,path:Et,routeRef:be,sticky:Oe}}),B=c(()=>new Set,(Q,Z)=>{if(Z.type===E.L){const X=Z.props;Q.add("with"in X?X.with:X.without)}});var j=e(76241);const M=(0,j.uW)("route-ref-type",()=>Symbol("route-ref-type"));function b(Q){return Q[M]==="absolute"}function L(Q){return Q[M]==="sub"}function D(Q){return Q[M]==="external"}function U(...Q){const Z=Q.join("/").replace(/\/\/+/g,"/");return Z!=="/"&&Z.endsWith("/")?Z.slice(0,-1):Z}function Y(Q,Z,X){let se,le="";if(b(Q))se=Q;else if(L(Q))se=Q.parent,le=Q.path;else if(D(Q)){const Ae=X.get(Q);if(!Ae)return[void 0,""];if(b(Ae))se=Ae;else if(L(Ae))se=Ae.parent,le=Ae.path;else throw new Error(`ExternalRouteRef was bound to invalid target, ${Ae}`)}else throw Q[M]?new Error(`Unknown or invalid route ref type, ${Q[M]}`):new Error(`Unknown object passed to useRouteRef, got ${Q}`);if(!se)return[void 0,""];const be=Z.get(se);if(!be)return[void 0,""];const Oe=U(be,le);return[se,Oe]}function te(Q,Z,X,se,le){var Et;const be=(Et=(0,t.fp)(le,Z))!=null?Et:[],Oe=Array();let Ae=-1;for(let It=Q;It&&(Ae=be.findIndex(lt=>lt.route.routeRefs.has(It)),Ae===-1);It=se.get(It))Oe.unshift(It);Oe.length===0&&(Ae-=1);const Ke=Ae===-1?"":be[Ae].pathname,ke=U(...Oe.slice(0,-1).map(It=>{const lt=X.get(It);if(!lt)throw new Error(`No path for ${It}`);if(lt.includes(":"))throw new Error(`Cannot route to ${Q} with parent ${It} as it has parameters`);return lt}));return Ke+ke}class ue{constructor(Z,X,se,le,be){this.routePaths=Z,this.routeParents=X,this.routeObjects=se,this.routeBindings=le,this.appBasePath=be}resolve(Z,X){const[se,le]=Y(Z,this.routePaths,this.routeBindings);if(!se)return;let be;typeof X=="string"?be=this.trimPath(X):X.pathname?be={...X,pathname:this.trimPath(X.pathname)}:be=X;const Oe=this.appBasePath+te(se,be,this.routePaths,this.routeParents,this.routeObjects);return(...[Ke])=>Oe+(0,t.Gn)(le,Ke)}trimPath(Z){return Z&&(Z.startsWith(this.appBasePath)?Z.slice(this.appBasePath.length):Z)}}const Re=(0,j.CT)("routing-context"),we=({routePaths:Q,routeParents:Z,routeObjects:X,routeBindings:se,basePath:le="",children:be})=>{const Oe=new ue(Q,Z,X,se,le),Ae=(0,j.EI)({1:Oe});return r.createElement(Re.Provider,{value:Ae},be)},ge=(Q,Z)=>{var X,se;try{const le=(0,t.fp)(Z,{pathname:Q}),be=(X=le==null?void 0:le.filter(Ae=>{var Ke;return((Ke=Ae==null?void 0:Ae.route.routeRefs)==null?void 0:Ke.size)>0}).pop())==null?void 0:X.route;if(!be)return{};let Oe;return be.routeRefs.size===1&&(Oe=be.routeRefs.values().next().value),{extension:"App",pluginId:((se=be.plugin)==null?void 0:se.getId())||"root",...Oe?{routeRef:Oe.id}:{}}}catch{return{}}},ze=({pathname:Q,search:Z,hash:X})=>{const se=(0,A.useAnalytics)();return(0,r.useEffect)(()=>{se.captureEvent("navigate",`${Q}${Z}${X}`)},[se,Q,Z,X]),null},_e=({routeObjects:Q})=>{const{pathname:Z,search:X,hash:se}=(0,t.TH)();return r.createElement(A.AnalyticsContext,{attributes:ge(Z,Q)},r.createElement(ze,{pathname:Z,search:X,hash:se}))};function et(Q,Z){const X=new Set(Z.values());X.delete(void 0);for(const se of Z.keys()){if(X.has(se))continue;let le=se,be="";for(;le;){const Ae=Q.get(le);if(!Ae)throw new Error(`No path for ${le}`);be=`${Ae}${be}`,le=Z.get(le)}const Oe=be.match(/:(\w+)/g);if(Oe){for(let Ae=0;Ae<Oe.length;Ae++)for(let Ke=Ae+1;Ke<Oe.length;Ke++)if(Oe[Ke]===Oe[Ae])throw new Error(`Parameter ${Oe[Ke]} is duplicated in path ${be}`)}}}function st(Q,Z){for(const X of Z)if(!!X.externalRoutes){for(const[se,le]of Object.entries(X.externalRoutes))if(!le.optional&&!Q.has(le))throw new Error(`External route '${se}' of the '${X.getId()}' plugin must be bound to a target route. See https://backstage.io/link?bind-routes for details.`)}}const Ct=(0,j.CT)("app-context"),pt=({appContext:Q,children:Z})=>{const X=(0,j.EI)({1:Q});return r.createElement(Ct.Provider,{value:X,children:Z})};function Pe(Q){return new Error(`Tried to access IdentityApi ${Q} before app was loaded`)}function ht(Q){console.warn(`WARNING: Call to ${Q} is deprecated and will break in the future`)}class je{constructor(){q(this,"target");q(this,"waitForTarget");q(this,"resolveTarget",()=>{});this.waitForTarget=new Promise(Z=>{this.resolveTarget=Z})}setTarget(Z){this.target=Z,this.resolveTarget(Z)}getUserId(){if(!this.target)throw Pe("getUserId");if(!this.target.getUserId)throw new Error("IdentityApi does not implement getUserId");return ht("getUserId"),this.target.getUserId()}getProfile(){if(!this.target)throw Pe("getProfile");if(!this.target.getProfile)throw new Error("IdentityApi does not implement getProfile");return ht("getProfile"),this.target.getProfile()}async getProfileInfo(){return this.waitForTarget.then(Z=>Z.getProfileInfo())}async getBackstageIdentity(){const Z=await this.waitForTarget.then(X=>X.getBackstageIdentity());return Z.userEntityRef.match(/^.*:.*\/.*$/)||console.warn(`WARNING: The App IdentityApi provided an invalid userEntityRef, '${Z.userEntityRef}'. It must be a full Entity Reference of the form '<kind>:<namespace>/<name>'.`),Z}async getCredentials(){return this.waitForTarget.then(Z=>Z.getCredentials())}async getIdToken(){return this.waitForTarget.then(Z=>{if(!Z.getIdToken)throw new Error("IdentityApi does not implement getIdToken");return ht("getIdToken"),Z.getIdToken()})}async signOut(){await this.waitForTarget.then(Z=>Z.signOut()),location.reload()}}var ie=e(72164);function de(Q,Z,X){if(Q!==void 0){const le=X.find(be=>be.id===Q);if(le)return le}if(Z){const le=X.find(be=>be.variant==="dark");if(le)return le}const se=X.find(le=>le.variant==="light");return se||X[0]}const Ue=()=>{const Q=(0,r.useMemo)(()=>window.matchMedia("(prefers-color-scheme: dark)"),[]),[Z,X]=(0,r.useState)(Q.matches);return(0,r.useEffect)(()=>{const se=le=>{X(le.matches)};return Q.addListener(se),()=>{Q.removeListener(se)}},[Q]),Z};function Be({children:Q}){const Z=(0,A.useApi)(A.appThemeApiRef),X=(0,ie.Z)(Z.activeThemeId$(),Z.getActiveThemeId()),se=Boolean(window.matchMedia)?Ue():!1,le=de(X,se,Z.getInstalledThemes());if(!le)throw new Error("App has no themes");return r.createElement(le.Provider,{children:Q})}var Xe=e(46611);class mt{constructor(){q(this,"apis",[])}add(Z,X){return this.apis.push([Z.id,X]),X}build(){return new Ye(new Map(this.apis))}}class Ye{static builder(){return new mt}static from(Z){return new Ye(new Map(Z.map(([X,se])=>[X.id,se])))}static with(Z,X){return new Ye(new Map([[Z.id,X]]))}constructor(Z){this.apis=Z}with(Z,X){return new Ye(new Map([...this.apis,[Z.id,X]]))}get(Z){return this.apis.get(Z.id)}}function yt(Q){const Z=new Map;return Q&&Q({bind:(se,le)=>{for(const[be,Oe]of Object.entries(le)){const Ae=se[be];if(!Ae)throw new Error(`Key ${be} is not an existing external route`);if(!Oe&&!Ae.optional)throw new Error(`External route ${be} is required but was undefined`);Oe&&Z.set(Ae,Oe)}}}),Z}const oe=(0,r.createContext)({routeObjects:[]});function me(Q){var X;let{pathname:Z}=new URL((X=Q.getOptionalString("app.baseUrl"))!=null?X:"/","http://dummy.dev");return Z=Z.replace(/\/*$/,""),Z}function tt(Q,Z,X){var Ke;const se=Boolean(Q),le=(0,l.default)(Q||(()=>Promise.resolve([])));let be;if(se&&le.loading){const{Progress:ke}=Z;be=r.createElement(ke,null)}else if(le.error){const{BootErrorPage:ke}=Z;be=r.createElement(ke,{step:"load-config",error:le.error})}const{ThemeProvider:Oe=Be}=Z;return be?{node:r.createElement(u.ApiProvider,{apis:Ye.with(A.appThemeApiRef,X)},r.createElement(Oe,null,be))}:{api:u.ConfigReader.fromConfigs((Ke=le.value)!=null?Ke:[])}}class Ge{constructor(Z){this.app=Z}getPlugins(){return this.app.getPlugins()}getSystemIcon(Z){return this.app.getSystemIcon(Z)}getComponents(){return this.app.getComponents()}}class Ne{constructor(Z){q(this,"apiHolder");q(this,"configApi");q(this,"apis");q(this,"icons");q(this,"plugins");q(this,"components");q(this,"themes");q(this,"configLoader");q(this,"defaultApis");q(this,"bindRoutes");q(this,"appIdentityProxy",new je);q(this,"apiFactoryRegistry");var X,se,le,be;this.apis=(X=Z.apis)!=null?X:[],this.icons=Z.icons,this.plugins=new Set((se=Z.plugins)!=null?se:[]),this.components=Z.components,this.themes=Z.themes,this.configLoader=(le=Z.configLoader)!=null?le:Xe.t,this.defaultApis=(be=Z.defaultApis)!=null?be:[],this.bindRoutes=Z.bindRoutes,this.apiFactoryRegistry=new m.ApiFactoryRegistry}getPlugins(){return Array.from(this.plugins)}getSystemIcon(Z){return this.icons[Z]}getComponents(){return this.components}getProvider(){const Z=new Ge(this);let X=!1;return({children:le})=>{const be=(0,r.useMemo)(()=>u.AppThemeSelector.createWithStorage(this.themes),[]),{routing:Oe,featureFlags:Ae,routeBindings:Ke}=(0,r.useMemo)(()=>{const lt=o({root:le,discoverers:[f,y],collectors:{routing:I,collectedPlugins:p,featureFlags:B}});return lt.collectedPlugins.forEach(Tt=>this.plugins.add(Tt)),this.verifyPlugins(this.plugins),this.getApiHolder(),{...lt,routeBindings:yt(this.bindRoutes)}},[le]);X||(X=!0,et(Oe.paths,Oe.parents),st(Ke,this.plugins));const ke=tt(this.configLoader,this.components,be),Et="api"in ke;if(Et){const{api:lt}=ke;this.configApi=lt}if((0,r.useEffect)(()=>{if(Et){const lt=this.getApiHolder().get(A.featureFlagsApiRef);for(const Tt of this.plugins.values())if("getFeatureFlags"in Tt)for(const Lt of Tt.getFeatureFlags())lt.registerFlag({name:Lt.name,pluginId:Tt.getId()});else for(const Lt of Tt.output())Lt.type==="feature-flag"&<.registerFlag({name:Lt.name,pluginId:Tt.getId()});for(const Tt of Ae)lt.registerFlag({name:Tt,pluginId:""})}},[Et,ke,Ae]),"node"in ke)return ke.node;const{ThemeProvider:It=Be}=this.components;return r.createElement(u.ApiProvider,{apis:this.getApiHolder()},r.createElement(pt,{appContext:Z},r.createElement(It,null,r.createElement(we,{routePaths:Oe.paths,routeParents:Oe.parents,routeObjects:Oe.objects,routeBindings:Ke,basePath:me(ke.api)},r.createElement(oe.Provider,{value:{routeObjects:Oe.objects}},le)))))}}getRouter(){const{Router:Z,SignInPage:X}=this.components,se=({component:be,children:Oe})=>{const[Ae,Ke]=(0,r.useState)();return Ae?(this.appIdentityProxy.setTarget(Ae),Oe):r.createElement(be,{onSignInSuccess:Ke})};return({children:be})=>{const Oe=(0,A.useApi)(A.configApiRef),Ae=`${me(Oe)}/*`,{routeObjects:Ke}=(0,r.useContext)(oe);return X?r.createElement(Z,null,r.createElement(_e,{routeObjects:Ke}),r.createElement(se,{component:X},r.createElement(t.Z5,null,r.createElement(t.AW,{path:Ae,element:r.createElement(r.Fragment,null,be)})))):(this.appIdentityProxy.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()=>{}}),r.createElement(Z,null,r.createElement(_e,{routeObjects:Ke}),r.createElement(t.Z5,null,r.createElement(t.AW,{path:Ae,element:r.createElement(r.Fragment,null,be)}))))}}getApiHolder(){if(this.apiHolder){for(const Z of this.plugins)for(const X of Z.getApis())this.apiFactoryRegistry.get(X.api)||this.apiFactoryRegistry.register("default",X);return m.ApiResolver.validateFactories(this.apiFactoryRegistry,this.apiFactoryRegistry.getAllApis()),this.apiHolder}this.apiFactoryRegistry.register("static",{api:A.appThemeApiRef,deps:{},factory:()=>u.AppThemeSelector.createWithStorage(this.themes)}),this.apiFactoryRegistry.register("static",{api:A.configApiRef,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:A.identityApiRef,deps:{},factory:()=>this.appIdentityProxy}),this.apiFactoryRegistry.register("default",{api:A.featureFlagsApiRef,deps:{},factory:()=>new u.LocalStorageFeatureFlags});for(const Z of this.defaultApis)this.apiFactoryRegistry.register("default",Z);for(const Z of this.plugins)for(const X of Z.getApis())if(!this.apiFactoryRegistry.register("default",X))throw new Error(`Plugin ${Z.getId()} tried to register duplicate or forbidden API factory for ${X.api}`);for(const Z of this.apis)if(!this.apiFactoryRegistry.register("app",Z))throw new Error(`Duplicate or forbidden API factory for ${Z.api} in app`);return m.ApiResolver.validateFactories(this.apiFactoryRegistry,this.apiFactoryRegistry.getAllApis()),this.apiHolder=new m.ApiResolver(this.apiFactoryRegistry),this.apiHolder}verifyPlugins(Z){const X=new Set;for(const se of Z){const le=se.getId();if(X.has(le))throw new Error(`Duplicate plugin found '${le}'`);X.add(le)}}}function ct(Q){return new Ne(Q)}},46611:function(ee,s,e){"use strict";e.d(s,{t:function(){return r}});const r=async(t="__APP_INJECTED_RUNTIME_CONFIG__")=>{const l=[{context:"app-config.yaml",data:{app:{title:"Techdocs Preview App",baseUrl:"http://localhost:3000"},backend:{baseUrl:"http://localhost:3000"},techdocs:{builder:"external"}}}];if(!l)throw new Error("No static configuration provided");if(!Array.isArray(l))throw new Error("Static configuration has invalid format");const u=l.slice();if(t!=="__app_injected_runtime_config__".toLocaleUpperCase("en-US"))try{const m=JSON.parse(t);Array.isArray(m)?u.push(...m):u.push({data:m,context:"env"})}catch(m){throw new Error(`Failed to load runtime configuration, ${m}`)}const A=window.__APP_CONFIG__;return A&&u.push({context:"window",data:A}),u}},44056:function(ee,s,e){"use strict";e.d(s,{createSpecializedApp:function(){return r.b},defaultConfigLoader:function(){return t.t}});var r=e(82370),t=e(46611),l=e(73495),u=e.n(l);e.o(l,"AtlassianAuth")&&e.d(s,{AtlassianAuth:function(){return l.AtlassianAuth}}),e.o(l,"BitbucketAuth")&&e.d(s,{BitbucketAuth:function(){return l.BitbucketAuth}}),e.o(l,"FlatRoutes")&&e.d(s,{FlatRoutes:function(){return l.FlatRoutes}}),e.o(l,"GithubAuth")&&e.d(s,{GithubAuth:function(){return l.GithubAuth}}),e.o(l,"GitlabAuth")&&e.d(s,{GitlabAuth:function(){return l.GitlabAuth}}),e.o(l,"GoogleAuth")&&e.d(s,{GoogleAuth:function(){return l.GoogleAuth}}),e.o(l,"MicrosoftAuth")&&e.d(s,{MicrosoftAuth:function(){return l.MicrosoftAuth}}),e.o(l,"OktaAuth")&&e.d(s,{OktaAuth:function(){return l.OktaAuth}}),e.o(l,"OneLoginAuth")&&e.d(s,{OneLoginAuth:function(){return l.OneLoginAuth}})},73495:function(){},49208:function(ee,s,e){"use strict";e.d(s,{AlertApiForwarder:function(){return r.AlertApiForwarder},ErrorAlerter:function(){return r.ErrorAlerter},ErrorApiForwarder:function(){return r.ErrorApiForwarder},FetchMiddlewares:function(){return r.FetchMiddlewares},FlatRoutes:function(){return l.w},NoOpAnalyticsApi:function(){return r.NoOpAnalyticsApi},OAuthRequestManager:function(){return r.OAuthRequestManager},UnhandledErrorForwarder:function(){return r.UnhandledErrorForwarder},UrlPatternDiscovery:function(){return r.UrlPatternDiscovery},WebStorage:function(){return r.WebStorage},createFetchApi:function(){return r.createFetchApi},createSpecializedApp:function(){return t.createSpecializedApp},defaultConfigLoader:function(){return t.defaultConfigLoader}});var r=e(56494);e.o(r,"AtlassianAuth")&&e.d(s,{AtlassianAuth:function(){return r.AtlassianAuth}}),e.o(r,"BitbucketAuth")&&e.d(s,{BitbucketAuth:function(){return r.BitbucketAuth}}),e.o(r,"FlatRoutes")&&e.d(s,{FlatRoutes:function(){return r.FlatRoutes}}),e.o(r,"GithubAuth")&&e.d(s,{GithubAuth:function(){return r.GithubAuth}}),e.o(r,"GitlabAuth")&&e.d(s,{GitlabAuth:function(){return r.GitlabAuth}}),e.o(r,"GoogleAuth")&&e.d(s,{GoogleAuth:function(){return r.GoogleAuth}}),e.o(r,"MicrosoftAuth")&&e.d(s,{MicrosoftAuth:function(){return r.MicrosoftAuth}}),e.o(r,"OktaAuth")&&e.d(s,{OktaAuth:function(){return r.OktaAuth}}),e.o(r,"OneLoginAuth")&&e.d(s,{OneLoginAuth:function(){return r.OneLoginAuth}}),e.o(r,"createSpecializedApp")&&e.d(s,{createSpecializedApp:function(){return r.createSpecializedApp}}),e.o(r,"defaultConfigLoader")&&e.d(s,{defaultConfigLoader:function(){return r.defaultConfigLoader}});var t=e(44056);e.o(t,"AtlassianAuth")&&e.d(s,{AtlassianAuth:function(){return t.AtlassianAuth}}),e.o(t,"BitbucketAuth")&&e.d(s,{BitbucketAuth:function(){return t.BitbucketAuth}}),e.o(t,"FlatRoutes")&&e.d(s,{FlatRoutes:function(){return t.FlatRoutes}}),e.o(t,"GithubAuth")&&e.d(s,{GithubAuth:function(){return t.GithubAuth}}),e.o(t,"GitlabAuth")&&e.d(s,{GitlabAuth:function(){return t.GitlabAuth}}),e.o(t,"GoogleAuth")&&e.d(s,{GoogleAuth:function(){return t.GoogleAuth}}),e.o(t,"MicrosoftAuth")&&e.d(s,{MicrosoftAuth:function(){return t.MicrosoftAuth}}),e.o(t,"OktaAuth")&&e.d(s,{OktaAuth:function(){return t.OktaAuth}}),e.o(t,"OneLoginAuth")&&e.d(s,{OneLoginAuth:function(){return t.OneLoginAuth}});var l=e(63938)},57018:function(ee,s,e){"use strict";e.d(s,{RefreshingAuthSessionManager:function(){return m}});function r(c,f){for(const y of f)if(!c.has(y))return!1;return!0}class t{constructor(f){this.options=f}sessionExistsAndHasScope(f,y){if(!f)return!1;if(!y||this.options.sessionScopes===void 0)return!0;const p=this.options.sessionScopes(f);return r(p,y)}getExtendedScope(f,y){const p=new Set(this.options.defaultScopes);if(f&&this.options.sessionScopes!==void 0){const E=this.options.sessionScopes(f);for(const T of E)p.add(T)}if(y)for(const E of y)p.add(E);return p}}var l=e(98005),u=e(36964);class A{constructor(){q(this,"subject",new l.X(u.SessionState.SignedOut));q(this,"signedIn",!1)}setIsSignedIn(f){this.signedIn!==f&&(this.signedIn=f,this.subject.next(this.signedIn?u.SessionState.SignedIn:u.SessionState.SignedOut))}sessionState$(){return this.subject}}class m{constructor(f){q(this,"connector");q(this,"helper");q(this,"sessionScopesFunc");q(this,"sessionShouldRefreshFunc");q(this,"stateTracker",new A);q(this,"refreshPromise");q(this,"currentSession");const{connector:y,defaultScopes:p=new Set,sessionScopes:E,sessionShouldRefresh:T}=f;this.connector=y,this.sessionScopesFunc=E,this.sessionShouldRefreshFunc=T,this.helper=new t({sessionScopes:E,defaultScopes:p})}async getSession(f){if(this.helper.sessionExistsAndHasScope(this.currentSession,f.scopes)){if(!this.sessionShouldRefreshFunc(this.currentSession))return this.currentSession;try{const p=await this.collapsedSessionRefresh(),E=this.sessionScopesFunc(this.currentSession),T=this.sessionScopesFunc(p);return r(T,E)&&(this.currentSession=p),p}catch(p){if(f.optional)return;throw p}}if(!this.currentSession&&!f.instantPopup)try{const y=await this.collapsedSessionRefresh();return this.currentSession=y,this.getSession(f)}catch{}if(!f.optional)return this.currentSession=await this.connector.createSession({...f,scopes:this.helper.getExtendedScope(this.currentSession,f.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(){if(this.refreshPromise)return this.refreshPromise;this.refreshPromise=this.connector.refreshSession();try{const f=await this.refreshPromise;return this.stateTracker.setIsSignedIn(!0),f}finally{delete this.refreshPromise}}}class o{constructor(f){q(this,"connector");q(this,"helper");q(this,"stateTracker",new SessionStateTracker);q(this,"currentSession");const{connector:y,defaultScopes:p=new Set,sessionScopes:E}=f;this.connector=y,this.helper=new SessionScopeHelper({sessionScopes:E,defaultScopes:p})}setSession(f){this.currentSession=f,this.stateTracker.setIsSignedIn(Boolean(f))}async getSession(f){if(this.helper.sessionExistsAndHasScope(this.currentSession,f.scopes))return this.currentSession;if(!f.optional)return this.currentSession=await this.connector.createSession({...f,scopes:this.helper.getExtendedScope(this.currentSession,f.scopes)}),this.stateTracker.setIsSignedIn(!0),this.currentSession}async removeSession(){this.currentSession=void 0,this.stateTracker.setIsSignedIn(!1)}sessionState$(){return this.stateTracker.sessionState$()}}},98005:function(ee,s,e){"use strict";e.d(s,{J:function(){return l},X:function(){return u}});var r=e(82394),t=e.n(r);class l{constructor(){q(this,"isClosed",!1);q(this,"terminatingError");q(this,"observable",new(t())(m=>this.isClosed?(this.terminatingError?m.error(this.terminatingError):m.complete(),()=>{}):(this.subscribers.add(m),()=>{this.subscribers.delete(m)})));q(this,"subscribers",new Set)}[Symbol.observable](){return this}get closed(){return this.isClosed}next(m){if(this.isClosed)throw new Error("PublishSubject is closed");this.subscribers.forEach(o=>o.next(m))}error(m){if(this.isClosed)throw new Error("PublishSubject is closed");this.isClosed=!0,this.terminatingError=m,this.subscribers.forEach(o=>o.error(m))}complete(){if(this.isClosed)throw new Error("PublishSubject is closed");this.isClosed=!0,this.subscribers.forEach(m=>m.complete())}subscribe(m,o,c){const f=typeof m=="function"?{next:m,error:o,complete:c}:m;return this.observable.subscribe(f)}}class u{constructor(m){q(this,"isClosed");q(this,"currentValue");q(this,"terminatingError");q(this,"observable");q(this,"subscribers",new Set);this.isClosed=!1,this.currentValue=m,this.terminatingError=void 0,this.observable=new(t())(o=>this.isClosed?(this.terminatingError?o.error(this.terminatingError):o.complete(),()=>{}):(o.next(this.currentValue),this.subscribers.add(o),()=>{this.subscribers.delete(o)}))}[Symbol.observable](){return this}get closed(){return this.isClosed}next(m){if(this.isClosed)throw new Error("BehaviorSubject is closed");this.currentValue=m,this.subscribers.forEach(o=>o.next(m))}error(m){if(this.isClosed)throw new Error("BehaviorSubject is closed");this.isClosed=!0,this.terminatingError=m,this.subscribers.forEach(o=>o.error(m))}complete(){if(this.isClosed)throw new Error("BehaviorSubject is closed");this.isClosed=!0,this.subscribers.forEach(m=>m.complete())}subscribe(m,o,c){const f=typeof m=="function"?{next:m,error:o,complete:c}:m;return this.observable.subscribe(f)}}},88934:function(ee,s,e){"use strict";e.d(s,{L:function(){return l}});var r=e(36964),t=e(2784);const l=u=>{const{children:A}=u,m=(0,r.useApi)(r.featureFlagsApiRef),o="with"in u?m.isActive(u.with):!m.isActive(u.without);return t.createElement(t.Fragment,null,o?A:null)};(0,r.attachComponentData)(l,"core.featureFlagged",!0)},63938:function(ee,s,e){"use strict";e.d(s,{w:function(){return u}});var r=e(2784),t=e(10289),l=e(36964);const u=m=>{const o=(0,l.useApp)(),{NotFoundErrorPage:c}=o.getComponents(),f=(0,l.useElementFilter)(m.children,y=>y.getElements().flatMap(p=>{var T;let E=p.props.path;return E===""?[]:(E=(T=E==null?void 0:E.replace(/\/\*$/,""))!=null?T:"/",[{path:E,element:p,children:p.props.children?[{path:E==="/"?"/":"/*",element:p.props.children}]:void 0}])}).sort((p,E)=>E.path.localeCompare(p.path)).map(p=>(p.path=p.path==="/"?"/":`${p.path}/*`,p)));return f.push({element:r.createElement(c,null),path:"/*"}),(0,t.V$)(f)};var A=e(88934)},82339:function(ee,s,e){"use strict";e.d(s,{Button:function(){return D},CodeSnippet:function(){return et},Content:function(){return Xa},ContentHeader:function(){return ci},CreateButton:function(){return pt},DependencyGraph:function(){return Rt},DependencyGraphTypes:function(){return r},EmptyState:function(){return bt},ErrorPage:function(){return hi},ErrorPanel:function(){return cn},Header:function(){return so},HeaderIconLinkRow:function(){return bn},HeaderLabel:function(){return Ti},HeaderTabs:function(){return qa},InfoCard:function(){return Kn},ItemCardGrid:function(){return Di},ItemCardHeader:function(){return Li},Link:function(){return b},LogViewer:function(){return zr},MissingAnnotationEmptyState:function(){return un},OverflowTooltip:function(){return br},Page:function(){return lo},PageWithHeader:function(){return Mi},Progress:function(){return cr},ResponseErrorPanel:function(){return $t},RoutedTabs:function(){return _a},Select:function(){return He},Sidebar:function(){return as},SidebarDivider:function(){return vs},SidebarItem:function(){return Ja},SidebarPage:function(){return Go},SubvalueCell:function(){return Fs},SupportButton:function(){return zo},Table:function(){return ei},WarningPanel:function(){return tn},sidebarConfig:function(){return kn},useSidebarOpenState:function(){return la},useSidebarPinState:function(){return Br}});var r={};e.r(r),e.d(r,{Nm:function(){return Pe},ht:function(){return ie},LJ:function(){return je}});var t=e(2784),l=e(36964),u=e(19928);function A(n){const[a,i]=useState([]),d=useApi(alertApiRef),{anchorOrigin:g={vertical:"top",horizontal:"center"}}=n;if(useEffect(()=>{const N=d.alert$().subscribe(G=>i(H=>H.concat(G)));return()=>{N.unsubscribe()}},[d]),a.length===0)return null;const[v]=a,O=()=>{i(N=>N.filter(G=>G!==v))};return React.createElement(Snackbar,{open:!0,anchorOrigin:g},React.createElement(Alert,{action:React.createElement(IconButton,{color:"inherit",size:"small",onClick:O,"data-testid":"error-button-close"},React.createElement(CloseIcon,null)),severity:v.severity},React.createElement("span",null,v.message.toString(),a.length>1&&React.createElement("em",null,` (${a.length-1} older ${pluralize("message",a.length-1)})`))))}var m=e(79692),o=e(12420);const c=(0,m.Z)(n=>(0,o.Z)({avatar:{width:"4rem",height:"4rem",color:"#fff",fontWeight:n.typography.fontWeightBold,letterSpacing:"1px",textTransform:"uppercase"}}),{name:"BackstageAvatar"});function f(n){const{displayName:a,picture:i,customStyles:d}=n,g=c();let v={...d};return i||(v={backgroundColor:stringToColor(a||""),...d}),React.createElement(MaterialAvatar,{alt:a,src:i,className:g.avatar,style:v},a&&extractInitials(a))}var y=e(77277),p=e(72779),E=e.n(p),T=e(86689),I=e(62833);const B=(0,m.Z)({visuallyHidden:{clip:"rect(0 0 0 0)",clipPath:"inset(50%)",overflow:"hidden",position:"absolute",whiteSpace:"nowrap",height:1,width:1},externalLink:{position:"relative"}},{name:"Link"}),j=n=>/^([a-z+.-]+):/.test(n),M=n=>{var a;return n instanceof Array?n.map(M).join(" ").trim():typeof n=="object"&&n?M((a=n==null?void 0:n.props)==null?void 0:a.children):["string","number"].includes(typeof n)?String(n):""},b=t.forwardRef(({onClick:n,noTrack:a,...i},d)=>{const g=B(),v=(0,l.useAnalytics)(),O=String(i.to),N=M(i.children)||O,G=j(O),H=G&&!!/^https?:/.exec(O),ne=_=>{n==null||n(_),a||v.captureEvent("click",N,{attributes:{to:O}})};return G?t.createElement(T.Z,{ref:d,href:O,onClick:ne,...H?{target:"_blank",rel:"noopener"}:{},...i,className:E()(g.externalLink,i.className)},i.children,t.createElement("span",{className:g.visuallyHidden},", Opens in a new window")):t.createElement(T.Z,{ref:d,component:I.rU,onClick:ne,...i})}),L=t.forwardRef((n,a)=>t.createElement(b,{ref:a,...n,color:"initial"})),D=t.forwardRef((n,a)=>t.createElement(y.Z,{ref:a,component:L,...n}));var U=e(60364),Y=e(61837),te=e(80030),ue=e(19353),Re=e(95074);function we(n){const{text:a,tooltipDelay:i=1e3,tooltipText:d="Text copied to clipboard"}=n,g=(0,l.useApi)(l.errorApiRef),[v,O]=(0,t.useState)(!1),[{error:N},G]=(0,Re.Z)();(0,t.useEffect)(()=>{N&&g.post(N)},[N,g]);const H=ne=>{ne.stopPropagation(),O(!0),G(a)};return t.createElement(t.Fragment,null,t.createElement(te.ZP,{id:"copy-test-tooltip",title:d,placement:"top",leaveDelay:i,onClose:()=>O(!1),open:v},t.createElement(Y.Z,{onClick:H},t.createElement(ue.Z,null))))}var ge=e(83229),ze=e(26639),_e=e(39595);function et(n){const{text:a,language:i,showLineNumbers:d=!1,highlightedNumbers:g,customStyle:v,showCopyCodeButton:O=!1}=n,N=(0,U.Z)(),G=N.palette.type==="dark"?ze.Z:_e.Z,H=N.palette.type==="dark"?"#256bf3":"#e6ffed";return t.createElement("div",{style:{position:"relative"}},t.createElement(ge.Z,{customStyle:v,language:i,style:G,showLineNumbers:d,wrapLines:!0,lineNumberStyle:{color:N.palette.textVerySubtle},lineProps:ne=>g!=null&&g.includes(ne)?{style:{backgroundColor:H}}:{}},a),O&&t.createElement("div",{style:{position:"absolute",top:0,right:0}},t.createElement(we,{text:a})))}var st=e(41156),Ct=e(88188);function pt(n){const{title:a,to:i}=n,d=(0,st.Z)(g=>g.breakpoints.down("xs"));return i?d?t.createElement(Y.Z,{component:I.rU,color:"primary",title:a,size:"small",to:i},t.createElement(Ct.Z,null)):t.createElement(y.Z,{component:I.rU,variant:"contained",color:"primary",to:i},a):null}var Pe;(function(n){const a="TB";n.TOP_BOTTOM=a;const i="BT";n.BOTTOM_TOP=i;const d="LR";n.LEFT_RIGHT=d;const g="RL";n.RIGHT_LEFT=g})(Pe||(Pe={}));var ht;(function(n){const a="UL";n.UP_LEFT=a;const i="UR";n.UP_RIGHT=i;const d="DL";n.DOWN_LEFT=d;const g="DR";n.DOWN_RIGHT=g})(ht||(ht={}));var je;(function(n){const a="network-simplex";n.NETWORK_SIMPLEX=a;const i="tight-tree";n.TIGHT_TREE=i;const d="longest-path";n.LONGEST_PATH=d})(je||(je={}));var ie;(function(n){const a="l";n.LEFT=a;const i="r";n.RIGHT=i;const d="c";n.CENTER=d})(ie||(ie={}));var de=e(84945),Ue=e(11105),Be=e(97963),Xe=e(46506),mt=e.n(Xe),Ye=e(54073),yt=e.n(Ye),oe=e(10368);const me=(0,m.Z)(n=>({node:{fill:n.palette.primary.light,stroke:n.palette.primary.light},text:{fill:n.palette.primary.contrastText}}),{name:"BackstageDependencyGraphDefaultNode"});function tt({node:{id:n}}){const a=me(),[i,d]=t.useState(0),[g,v]=t.useState(0),O=t.useRef(null);t.useLayoutEffect(()=>{if(O.current){let{height:ne,width:_}=O.current.getBBox();ne=Math.round(ne),_=Math.round(_),(ne!==g||_!==i)&&(d(_),v(ne))}},[i,g]);const N=10,G=i+N*2,H=g+N*2;return t.createElement("g",null,t.createElement("rect",{className:a.node,width:G,height:H,rx:10}),t.createElement("text",{ref:O,className:a.text,y:H/2,x:G/2,textAnchor:"middle",alignmentBaseline:"middle"},n))}const Ge="arrow-marker",Ne="node",ct="edge",Q="label",Z=(0,oe.Z)(n=>({node:{transition:`${n.transitions.duration.shortest}ms`}}),{name:"BackstageDependencyGraphNode"}),X=n=>t.createElement(tt,{...n});function se({render:n=X,setNode:a,node:i}){const{width:d,height:g,x:v=0,y:O=0}=i,N=i,G=Z(),H=t.useRef(null);return t.useLayoutEffect(()=>{if(H.current){let{height:ne,width:_}=H.current.getBBox();ne=Math.round(ne),_=Math.round(_),(ne!==g||_!==d)&&a(i.id,{...i,height:ne,width:_})}},[i,d,g,a]),t.createElement("g",{ref:H,"data-testid":Ne,className:G.node,transform:`translate(${v-d/2},${O-g/2})`},n({node:N}))}var le=e(40408),be=e(49810),Oe=e(19574),Ae=e.n(Oe);const Ke=(0,oe.Z)(n=>({text:{fill:n.palette.textContrast}}),{name:"BackstageDependencyGraphDefaultLabel"});function ke({edge:{label:n}}){const a=Ke();return t.createElement("text",{className:a.text,textAnchor:"middle"},n)}const Et=(0,oe.Z)(n=>({path:{strokeWidth:2,stroke:n.palette.textSubtle,fill:"none",transition:`${n.transitions.duration.shortest}ms`},label:{transition:`${n.transitions.duration.shortest}ms`}}),{name:"BackstageDependencyGraphEdge"}),It=n=>t.createElement(ke,{...n}),lt=le.Z().x(n=>n.x).y(n=>n.y).curve(be.Z);function Tt({render:n=It,setEdge:a,id:i,edge:d}){const{x:g=0,y:v=0,width:O,height:N,points:G}=d,H=d,ne=Et(),_=t.useRef(null);t.useLayoutEffect(()=>{if(_.current){let{height:Ce,width:Ie}=_.current.getBBox();Ce=Math.round(Ce),Ie=Math.round(Ie),(Ce!==N||Ie!==O)&&a(i,{...d,height:Ce,width:Ie})}},[d,N,O,a,i]);let ve="";if(G){const Ce=G.filter(Ie=>Ae()(Ie.x)&&Ae()(Ie.y));ve=lt(Ce)||""}return t.createElement(t.Fragment,null,ve&&t.createElement("path",{"data-testid":ct,className:ne.path,markerEnd:`url(#${Ge})`,d:ve}),H.label?t.createElement("g",{ref:_,"data-testid":Q,className:ne.label,transform:`translate(${g},${v})`},n({edge:H})):null)}const Lt="workspace";function Rt(n){var _n,Ar;const{edges:a,nodes:i,renderNode:d,direction:g=Pe.TOP_BOTTOM,align:v,nodeMargin:O=50,edgeMargin:N=10,rankMargin:G=50,paddingX:H=0,paddingY:ne=0,acyclicer:_,ranker:ve=je.NETWORK_SIMPLEX,labelPosition:Ce=ie.RIGHT,labelOffset:Ie=10,edgeRanks:gt=1,edgeWeight:Ut=1,renderLabel:Yt,defs:Jt,zoom:dt="enabled",...Gt}=n,en=(0,Be.Z)(),[Qt,Xn]=t.useState(100),[Nn,wr]=t.useState(100),Mt=t.useRef(new(mt()).graphlib.Graph),[yr,$r]=t.useState(((_n=Mt.current.graph())==null?void 0:_n.width)||0),[Er,ea]=t.useState(((Ar=Mt.current.graph())==null?void 0:Ar.height)||0),[ga,ta]=t.useState([]),[na,pa]=t.useState([]),sn=Math.max(yr,Qt),Sn=Math.max(Er,Nn),ar=t.useMemo(()=>yt()(ln=>{if(!ln)return;const pn=Ue.Z(ln),rn=Ue.Z(ln.getElementById(Lt));function Zn(){pn.call(de.sP().scaleExtent([1,10]).on("zoom",Yn=>{Yn.transform.x=Math.min(0,Math.max(Yn.transform.x,sn-sn*Yn.transform.k)),Yn.transform.y=Math.min(0,Math.max(Yn.transform.y,Sn-Sn*Yn.transform.k)),rn.attr("transform",Yn.transform)}))}dt==="enabled"?Zn():dt==="enable-on-click"&&pn.on("click",()=>Zn());const{width:zn,height:ra}=ln.getBoundingClientRect();Qt!==zn&&Xn(zn),Nn!==ra&&wr(ra)},100),[Nn,Qt,sn,Sn,dt]),qn=t.useCallback(()=>{const ln=Mt.current.nodes(),pn=Mt.current.edges();ln.forEach(rn=>{i.some(zn=>zn.id===rn)||Mt.current.removeNode(rn)}),pn.forEach(rn=>{a.some(zn=>zn.from===rn.v&&zn.to===rn.w)||Mt.current.removeEdge(rn.v,rn.w)}),i.forEach(rn=>{const Zn=Mt.current.nodes().find(zn=>rn.id===zn);if(Zn&&Mt.current.node(Zn)){const{width:zn,height:ra,x:Yn,y:Xi}=Mt.current.node(Zn);Mt.current.setNode(Zn,{...rn,width:zn,height:ra,x:Yn,y:Xi})}else Mt.current.setNode(rn.id,{...rn,width:0,height:0})}),a.forEach(rn=>{Mt.current.setEdge(rn.from,rn.to,{...rn,label:rn.label,width:0,height:0,labelpos:Ce,labeloffset:Ie,weight:Ut,minlen:gt})})},[a,i,Ce,Ie,Ut,gt]),nn=t.useMemo(()=>yt()(()=>{mt().layout(Mt.current);const{height:ln,width:pn}=Mt.current.graph(),rn=Math.max(0,ln||0),Zn=Math.max(0,pn||0);$r(Zn),ea(rn),ta(Mt.current.nodes()),pa(Mt.current.edges())},250,{leading:!0}),[]);t.useEffect(()=>(Mt.current.setGraph({rankdir:g,align:v,nodesep:O,edgesep:N,ranksep:G,marginx:H,marginy:ne,acyclicer:_,ranker:ve}),qn(),nn(),nn.cancel),[_,v,g,N,H,ne,O,G,ve,qn,nn]);function Cn(ln,pn){return Mt.current.setNode(ln,pn),nn(),Mt.current}function vr(ln,pn){return Mt.current.setEdge(ln,pn),nn(),Mt.current}return t.createElement("svg",{ref:ar,...Gt,width:"100%",height:Sn,viewBox:`0 0 ${sn} ${Sn}`},t.createElement("defs",null,t.createElement("marker",{id:Ge,viewBox:"0 0 24 24",markerWidth:"14",markerHeight:"14",refX:"16",refY:"12",orient:"auto",markerUnits:"strokeWidth"},t.createElement("path",{fill:en.palette.textSubtle,d:"M8.59 16.59L13.17 12 8.59 7.41 10 6l6 6-6 6-1.41-1.41z"})),Jt),t.createElement("g",{id:Lt},t.createElement("svg",{width:yr,height:Er,y:Sn/2-Er/2,x:sn/2-yr/2,viewBox:`0 0 ${yr} ${Er}`},na.map(ln=>{const pn=Mt.current.edge(ln);return pn?t.createElement(Tt,{key:`${ln.v}-${ln.w}`,id:ln,setEdge:vr,render:Yt,edge:pn}):null}),ga.map(ln=>{const pn=Mt.current.node(ln);return pn?t.createElement(se,{key:ln,setNode:Cn,render:d,node:pn}):null}))))}const Nt=(0,m.Z)(n=>{var a;return{root:{padding:n.spacing(0),marginBottom:n.spacing(0),marginTop:n.spacing(0),display:"flex",flexFlow:"row nowrap"},topPosition:{position:"relative",marginBottom:n.spacing(6),marginTop:-n.spacing(3),zIndex:"unset"},icon:{fontSize:20},content:{width:"100%",maxWidth:"inherit",flexWrap:"nowrap"},message:{display:"flex",alignItems:"center",color:n.palette.banner.text,"& a":{color:n.palette.banner.link}},info:{backgroundColor:n.palette.banner.info},error:{backgroundColor:n.palette.banner.error},warning:{backgroundColor:(a=n.palette.banner.warning)!=null?a:n.palette.banner.error}}},{name:"BackstageDismissableBanner"}),Zt=n=>{var Ce;const{variant:a,message:i,id:d,fixed:g=!1}=n,v=Nt(),N=useApi(storageApiRef).forBucket("notifications"),G=(Ce=N.snapshot("dismissedBanners").value)!=null?Ce:[],[H,ne]=useState(new Set(G)),_=useObservable(N.observe$("dismissedBanners"));useEffect(()=>{var Ie;if(_!=null&&_.value){const gt=(Ie=_==null?void 0:_.value)!=null?Ie:[];ne(new Set(gt))}},[_==null?void 0:_.value]);const ve=()=>{N.set("dismissedBanners",[...H,d])};return React.createElement(Snackbar,{anchorOrigin:g?{vertical:"bottom",horizontal:"center"}:{vertical:"top",horizontal:"center"},open:!H.has(d),classes:{root:classNames(v.root,!g&&v.topPosition)}},React.createElement(SnackbarContent,{classes:{root:classNames(v.content,v[a]),message:v.message},message:i,action:[React.createElement(IconButton,{key:"dismiss",title:"Permanently dismiss this message",color:"inherit",onClick:ve},React.createElement(Close,{className:v.icon}))]}))};var vt=e(60905),at=e(90436),zt=e.p+"static/missingAnnotation.67f79e98..svg",ae=e.p+"static/noInformation.4b426325..svg",V=e.p+"static/createComponent.975d1e1e..svg",ye=e.p+"static/noBuild.1715fa71..svg";const We=(0,m.Z)({generalImg:{width:"95%",zIndex:2,position:"relative",left:"50%",top:"50%",transform:"translate(-50%, 15%)"}},{name:"BackstageEmptyStateImage"}),qe=({missing:n})=>{const a=We();switch(n){case"field":return t.createElement("img",{src:zt,className:a.generalImg,alt:"annotation is missing"});case"info":return t.createElement("img",{src:ae,alt:"no Information",className:a.generalImg});case"content":return t.createElement("img",{src:V,alt:"create Component",className:a.generalImg});case"data":return t.createElement("img",{src:ye,alt:"no Build",className:a.generalImg});default:return null}},ot=(0,m.Z)(n=>({root:{backgroundColor:n.palette.background.default,padding:n.spacing(2,0,0,0)},action:{marginTop:n.spacing(2)},imageContainer:{position:"relative"}}),{name:"BackstageEmptyState"});function bt(n){const{title:a,description:i,missing:d,action:g}=n,v=ot();return t.createElement(vt.Z,{container:!0,direction:"row",justifyContent:"space-around",alignItems:"flex-start",className:v.root,spacing:2},t.createElement(vt.Z,{item:!0,xs:12,md:6},t.createElement(vt.Z,{container:!0,direction:"column"},t.createElement(vt.Z,{item:!0,xs:!0},t.createElement(at.Z,{variant:"h5"},a)),t.createElement(vt.Z,{item:!0,xs:!0},t.createElement(at.Z,{variant:"body1"},i)),t.createElement(vt.Z,{item:!0,xs:!0,className:v.action},g))),t.createElement(vt.Z,{item:!0,xs:12,md:6,className:v.imageContainer},t.createElement(qe,{missing:d})))}const Wt=`apiVersion: backstage.io/v1alpha1
|
|
1
|
+
(()=>{var qi=Object.defineProperty;var _i=(ee,s,e)=>s in ee?qi(ee,s,{enumerable:!0,configurable:!0,writable:!0,value:e}):ee[s]=e;var q=(ee,s,e)=>(_i(ee,typeof s!="symbol"?s+"":s,e),e),po=(ee,s,e)=>{if(!s.has(ee))throw TypeError("Cannot "+e)};var rt=(ee,s,e)=>(po(ee,s,"read from private field"),e?e.call(ee):s.get(ee)),Dn=(ee,s,e)=>{if(s.has(ee))throw TypeError("Cannot add the same private member more than once");s instanceof WeakSet?s.add(ee):s.set(ee,e)},wn=(ee,s,e,r)=>(po(ee,s,"write to private field"),r?r.call(ee,e):s.set(ee,e),e);(self.webpackChunktechdocs_cli_embedded_app=self.webpackChunktechdocs_cli_embedded_app||[]).push([[179],{30001:function(ee,s,e){"use strict";e.d(s,{n3:function(){return A},MS:function(){return m}});var r=e(48023),t=e(10179),l=e(96279),u=e.n(l);const A=Symbol.for("CATALOG_FILTER_EXISTS_0e15b590c0b343a2bae3e787e84c2111");class m{constructor(c){q(this,"discoveryApi");q(this,"fetchApi");this.discoveryApi=c.discoveryApi,this.fetchApi=c.fetchApi||{fetch:u()}}async getEntityAncestors(c,f){const{kind:y,namespace:p,name:E}=(0,r.of)(c.entityRef);return await this.requestRequired("GET",`/entities/by-name/${encodeURIComponent(y)}/${encodeURIComponent(p)}/${encodeURIComponent(E)}/ancestry`,f)}async getLocationById(c,f){return await this.requestOptional("GET",`/locations/${encodeURIComponent(c)}`,f)}async getEntities(c,f){const{filter:y=[],fields:p=[],offset:E,limit:T,after:I}=c!=null?c:{},B=[];for(const L of[y].flat()){const D=[];for(const[U,Y]of Object.entries(L))for(const te of[Y].flat())te===A?D.push(encodeURIComponent(U)):typeof te=="string"&&D.push(`${encodeURIComponent(U)}=${encodeURIComponent(te)}`);D.length&&B.push(`filter=${D.join(",")}`)}p.length&&B.push(`fields=${p.map(encodeURIComponent).join(",")}`),E!==void 0&&B.push(`offset=${E}`),T!==void 0&&B.push(`limit=${T}`),I!==void 0&&B.push(`after=${encodeURIComponent(I)}`);const j=B.length?`?${B.join("&")}`:"",M=await this.requestRequired("GET",`/entities${j}`,f),b=(L,D)=>{var te,ue;if(((te=L.metadata)==null?void 0:te.name)===void 0||L.kind===void 0||((ue=D.metadata)==null?void 0:ue.name)===void 0||D.kind===void 0)return 0;const U=(0,r.eE)(L),Y=(0,r.eE)(D);return U<Y?-1:U>Y?1:0};return{items:M.sort(b)}}async getEntityByRef(c,f){const{kind:y,namespace:p,name:E}=(0,r.of)(c);return this.requestOptional("GET",`/entities/by-name/${encodeURIComponent(y)}/${encodeURIComponent(p)}/${encodeURIComponent(E)}`,f)}async getEntityByName(c,f){const{kind:y,namespace:p="default",name:E}=c;return this.requestOptional("GET",`/entities/by-name/${encodeURIComponent(y)}/${encodeURIComponent(p)}/${encodeURIComponent(E)}`,f)}async refreshEntity(c,f){const y=await this.fetchApi.fetch(`${await this.discoveryApi.getBaseUrl("catalog")}/refresh`,{headers:{"Content-Type":"application/json",...(f==null?void 0:f.token)&&{Authorization:`Bearer ${f==null?void 0:f.token}`}},method:"POST",body:JSON.stringify({entityRef:c})});if(y.status!==200)throw new Error(await y.text())}async getEntityFacets(c,f){const{filter:y=[],facets:p}=c,E=[];for(const I of[y].flat()){const B=[];for(const[j,M]of Object.entries(I))for(const b of[M].flat())b===A?B.push(encodeURIComponent(j)):typeof b=="string"&&B.push(`${encodeURIComponent(j)}=${encodeURIComponent(b)}`);B.length&&E.push(`filter=${B.join(",")}`)}for(const I of p)E.push(`facet=${encodeURIComponent(I)}`);const T=E.length?`?${E.join("&")}`:"";return await this.requestOptional("GET",`/entity-facets${T}`,f)}async addLocation({type:c="url",target:f,dryRun:y},p){const E=await this.fetchApi.fetch(`${await this.discoveryApi.getBaseUrl("catalog")}/locations${y?"?dryRun=true":""}`,{headers:{"Content-Type":"application/json",...(p==null?void 0:p.token)&&{Authorization:`Bearer ${p==null?void 0:p.token}`}},method:"POST",body:JSON.stringify({type:c,target:f})});if(E.status!==201)throw new Error(await E.text());const{location:T,entities:I,exists:B}=await E.json();if(!T)throw new Error(`Location wasn't added: ${f}`);return{location:T,entities:I,exists:B}}async getLocationByRef(c,f){return(await this.requestRequired("GET","/locations",f)).map(p=>p.data).find(p=>c===(0,r.NZ)(p))}async removeLocationById(c,f){await this.requestIgnored("DELETE",`/locations/${encodeURIComponent(c)}`,f)}async removeEntityByUid(c,f){await this.requestIgnored("DELETE",`/entities/by-uid/${encodeURIComponent(c)}`,f)}async requestIgnored(c,f,y){const p=`${await this.discoveryApi.getBaseUrl("catalog")}${f}`,E=y!=null&&y.token?{Authorization:`Bearer ${y.token}`}:{},T=await this.fetchApi.fetch(p,{method:c,headers:E});if(!T.ok)throw await t.VL.fromResponse(T)}async requestRequired(c,f,y){const p=`${await this.discoveryApi.getBaseUrl("catalog")}${f}`,E=y!=null&&y.token?{Authorization:`Bearer ${y.token}`}:{},T=await this.fetchApi.fetch(p,{method:c,headers:E});if(!T.ok)throw await t.VL.fromResponse(T);return await T.json()}async requestOptional(c,f,y){const p=`${await this.discoveryApi.getBaseUrl("catalog")}${f}`,E=y!=null&&y.token?{Authorization:`Bearer ${y.token}`}:{},T=await this.fetchApi.fetch(p,{method:c,headers:E});if(!T.ok){if(T.status===404)return;throw await t.VL.fromResponse(T)}return await T.json()}}},48023:function(ee,s,e){"use strict";e.d(s,{Tf:function(){return l},P1:function(){return Rt},q1:function(){return Nt},M6:function(){return Zt},l2:function(){return t},zG:function(){return r},w$:function(){return Q},nP:function(){return Z},aS:function(){return ke},S4:function(){return fe},cz:function(){return Ae},iB:function(){return _e},of:function(){return et},Ou:function(){return vt},eE:function(){return st},NZ:function(){return at}});const r="default",t="backstage.io/view-url",l="backstage.io/edit-url";var u=e(76635),A=e.n(u);class m{constructor(V=DEFAULT_NAMESPACE){q(this,"namespace");this.namespace=V}async enforce(V){return V.metadata.namespace?V:lodash.merge({metadata:{namespace:this.namespace}},V)}}class o{static isValidPrefixAndOrSuffix(V,ye,He,qe){if(typeof V!="string")return!1;const ot=V.split(ye);return ot.length===1?qe(ot[0]):ot.length===2?He(ot[0])&&qe(ot[1]):!1}static isJsonSafe(V){try{return A().isEqual(V,JSON.parse(JSON.stringify(V)))}catch{return!1}}static isValidDnsSubdomain(V){return typeof V=="string"&&V.length>=1&&V.length<=253&&V.split(".").every(o.isValidDnsLabel)}static isValidDnsLabel(V){return typeof V=="string"&&V.length>=1&&V.length<=63&&/^[a-z0-9]+(\-[a-z0-9]+)*$/.test(V)}static isValidTag(V){return typeof V=="string"&&V.length>=1&&V.length<=63&&/^[a-z0-9+#]+(\-[a-z0-9+#]+)*$/.test(V)}static isValidUrl(V){if(typeof V!="string")return!1;try{return new URL(V),!0}catch{return!1}}static isValidString(V){var ye;return typeof V=="string"&&((ye=V==null?void 0:V.trim())==null?void 0:ye.length)>=1}static isNonEmptyString(V){var ye;return typeof V=="string"&&((ye=V==null?void 0:V.trim())==null?void 0:ye.length)>=1}}var c=JSON.parse('{"$schema":"http://json-schema.org/draft-07/schema","$id":"EntityEnvelope","description":"The envelope skeleton parts of an entity - whatever is necessary to be able to give it a ref and pass to further validation / policy checking.","examples":[{"apiVersion":"backstage.io/v1alpha1","kind":"Component","metadata":{"name":"LoremService"}}],"type":"object","required":["apiVersion","kind","metadata"],"additionalProperties":true,"properties":{"apiVersion":{"type":"string","description":"The version of specification format for this particular entity that this is written against.","minLength":1,"examples":["backstage.io/v1alpha1","my-company.net/v1","1.0"]},"kind":{"type":"string","description":"The high level entity type being described.","minLength":1,"examples":["API","Component","Domain","Group","Location","Resource","System","Template","User"]},"metadata":{"type":"object","required":["name"],"additionalProperties":true,"properties":{"name":{"type":"string","description":"The name of the entity. Must be unique within the catalog at any given point in time, for any given namespace + kind pair.","examples":["metadata-proxy"],"minLength":1},"namespace":{"type":"string","description":"The namespace that the entity belongs to.","default":"default","examples":["default","admin"],"minLength":1}}}}}'),f=e(48231),y=e.n(f),p=JSON.parse(`{"$schema":"http://json-schema.org/draft-07/schema","$id":"Entity","description":"The parts of the format that's common to all versions/kinds of entity.","examples":[{"apiVersion":"backstage.io/v1alpha1","kind":"Component","metadata":{"name":"LoremService","description":"Creates Lorems like a pro.","labels":{"product_name":"Random value Generator"},"annotations":{"docs":"https://github.com/..../tree/develop/doc"}},"spec":{"type":"service","lifecycle":"production","owner":"tools"}}],"type":"object","required":["apiVersion","kind","metadata"],"additionalProperties":false,"properties":{"apiVersion":{"type":"string","description":"The version of specification format for this particular entity that this is written against.","minLength":1,"examples":["backstage.io/v1alpha1","my-company.net/v1","1.0"]},"kind":{"type":"string","description":"The high level entity type being described.","minLength":1,"examples":["API","Component","Domain","Group","Location","Resource","System","Template","User"]},"metadata":{"$ref":"EntityMeta"},"spec":{"type":"object","description":"The specification data describing the entity itself."},"relations":{"type":"array","description":"The relations that this entity has with other entities.","items":{"$ref":"common#relation"}},"status":{"$ref":"common#status"}}}`),E=JSON.parse('{"$schema":"http://json-schema.org/draft-07/schema","$id":"EntityMeta","description":"Metadata fields common to all versions/kinds of entity.","examples":[{"uid":"e01199ab-08cc-44c2-8e19-5c29ded82521","etag":"lsndfkjsndfkjnsdfkjnsd==","name":"my-component-yay","namespace":"the-namespace","labels":{"backstage.io/custom":"ValueStuff"},"annotations":{"example.com/bindings":"are-secret"},"tags":["java","data"]}],"type":"object","required":["name"],"additionalProperties":true,"properties":{"uid":{"type":"string","description":"A globally unique ID for the entity. This field can not be set by the user at creation time, and the server will reject an attempt to do so. The field will be populated in read operations. The field can (optionally) be specified when performing update or delete operations, but the server is free to reject requests that do so in such a way that it breaks semantics.","examples":["e01199ab-08cc-44c2-8e19-5c29ded82521"],"minLength":1},"etag":{"type":"string","description":"An opaque string that changes for each update operation to any part of the entity, including metadata. This field can not be set by the user at creation time, and the server will reject an attempt to do so. The field will be populated in read operations. The field can (optionally) be specified when performing update or delete operations, and the server will then reject the operation if it does not match the current stored value.","examples":["lsndfkjsndfkjnsdfkjnsd=="],"minLength":1},"name":{"type":"string","description":"The name of the entity. Must be unique within the catalog at any given point in time, for any given namespace + kind pair.","examples":["metadata-proxy"],"minLength":1},"namespace":{"type":"string","description":"The namespace that the entity belongs to.","default":"default","examples":["default","admin"],"minLength":1},"title":{"type":"string","description":"A display name of the entity, to be presented in user interfaces instead of the name property, when available.","examples":["React SSR Template"],"minLength":1},"description":{"type":"string","description":"A short (typically relatively few words, on one line) description of the entity."},"labels":{"type":"object","description":"Key/value pairs of identifying information attached to the entity.","additionalProperties":true,"patternProperties":{"^.+$":{"type":"string"}}},"annotations":{"type":"object","description":"Key/value pairs of non-identifying auxiliary information attached to the entity.","additionalProperties":true,"patternProperties":{"^.+$":{"type":"string"}}},"tags":{"type":"array","description":"A list of single-valued strings, to for example classify catalog entities in various ways.","items":{"type":"string","minLength":1}},"links":{"type":"array","description":"A list of external hyperlinks related to the entity. Links can provide additional contextual information that may be located outside of Backstage itself. For example, an admin dashboard or external CMS page.","items":{"type":"object","required":["url"],"properties":{"url":{"type":"string","description":"A url in a standard uri format.","examples":["https://admin.example-org.com"],"minLength":1},"title":{"type":"string","description":"A user friendly display name for the link.","examples":["Admin Dashboard"],"minLength":1},"icon":{"type":"string","description":"A key representing a visual icon to be displayed in the UI.","examples":["dashboard"],"minLength":1},"type":{"type":"string","description":"An optional value to categorize links into specific groups.","examples":["runbook","documentation","logs","dashboard"],"minLength":1}}}}}}'),T=JSON.parse('{"$schema":"http://json-schema.org/draft-07/schema","$id":"common","type":"object","description":"Common definitions to import from other schemas","definitions":{"reference":{"$id":"#reference","type":"object","description":"A reference by name to another entity.","required":["kind","namespace","name"],"additionalProperties":false,"properties":{"kind":{"type":"string","description":"The kind field of the entity.","minLength":1},"namespace":{"type":"string","description":"The metadata.namespace field of the entity.","minLength":1},"name":{"type":"string","description":"The metadata.name field of the entity.","minLength":1}}},"relation":{"$id":"#relation","type":"object","description":"A directed relation from one entity to another.","required":["type","target"],"additionalProperties":false,"properties":{"type":{"type":"string","minLength":1,"pattern":"^\\\\w+$","description":"The type of relation."},"target":{"$ref":"#reference"},"targetRef":{"type":"string","minLength":1,"description":"The entity ref of the target of this relation."}}},"status":{"$id":"#status","type":"object","description":"The current status of the entity, as claimed by various sources.","required":[],"additionalProperties":true,"properties":{"items":{"type":"array","items":{"$ref":"#statusItem"}}}},"statusItem":{"$id":"#statusItem","type":"object","description":"A specific status item on a well known format.","required":["type","level","message"],"additionalProperties":true,"properties":{"type":{"type":"string","minLength":1},"level":{"$ref":"#statusLevel","description":"The status level / severity of the status item."},"message":{"type":"string","description":"A brief message describing the status, intended for human consumption."},"error":{"$ref":"#error","description":"An optional serialized error object related to the status."}}},"statusLevel":{"$id":"#statusLevel","type":"string","description":"A status level / severity.","enum":["info","warning","error"]},"error":{"$id":"#error","type":"object","description":"A serialized error object.","required":["name","message"],"additionalProperties":true,"properties":{"name":{"type":"string","examples":["Error","InputError"],"description":"The type name of the error","minLength":1},"message":{"type":"string","description":"The message of the error"},"code":{"type":"string","description":"An error code associated with the error"},"stack":{"type":"string","description":"An error stack trace"}}}}}');const I=new Map,B=[c,p,E,T];function j(ae){if(!(ae!=null&&ae.length))throw new TypeError("Unknown error");const V=ae[0];throw new TypeError(`${V.instancePath||"<root>"} ${V.message}${V.params?` - ${Object.entries(V.params).map(([ye,He])=>`${ye}: ${He}`).join(", ")}`:""}`)}function M(ae,V={}){var Wt;const ye=(Wt=V==null?void 0:V.disableCache)!=null?Wt:!1,He=ye?"":JSON.stringify(ae);if(!ye){const Xt=I.get(He);if(Xt)return Xt}const qe=b(ae),ot=new(y())({allowUnionTypes:!0,allErrors:!0,validateSchema:!0});qe.length&&ot.addSchema(qe,void 0,void 0,!0);const bt=ot.compile(ae);return ye||I.set(He,bt),bt}function b(ae){if(typeof ae!="object")return[];const V=new Set;ae.$id&&V.add(ae.$id);const ye=new Array,He=[ae];for(;He.length;){const qe=He.pop();for(const ot of L(qe))if(!V.has(ot)){V.add(ot);const bt=B.find(Wt=>Wt.$id===ot);bt&&(ye.push(bt),He.push(bt))}}return ye}function*L(ae){const V=[ae];for(;V.length;){const ye=V.pop();if(typeof ye=="object"&&ye)for(const[He,qe]of Object.entries(ye))He==="$ref"&&typeof qe=="string"?yield qe.split("#")[0]:V.push(qe)}}function D(ae){const V=compileAjvSchema(ae||entityEnvelopeSchema);return ye=>{if(V(ye)===!0)return ye;throw throwAjvError(V.errors)}}function U(ae){const V=M(ae);return ye=>{var ot;if(V(ye)===!0)return ye;const qe=(ot=V.errors)==null?void 0:ot.filter(bt=>["/kind","/apiVersion"].includes(bt.instancePath));if((qe==null?void 0:qe.length)&&qe.every(bt=>bt.keyword==="enum"))return!1;throw j(V.errors)}}function Y(ae){const V=compileAjvSchema(ae||entitySchema);return ye=>{if(V(ye)===!0)return ye;throw throwAjvError(V.errors)}}class te{static isValidApiVersion(V){return o.isValidPrefixAndOrSuffix(V,"/",o.isValidDnsSubdomain,ye=>ye.length>=1&&ye.length<=63&&/^[a-z0-9A-Z]+$/.test(ye))}static isValidKind(V){return typeof V=="string"&&V.length>=1&&V.length<=63&&/^[a-zA-Z][a-z0-9A-Z]*$/.test(V)}static isValidObjectName(V){return typeof V=="string"&&V.length>=1&&V.length<=63&&/^([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9]$/.test(V)}static isValidNamespace(V){return o.isValidDnsLabel(V)}static isValidLabelKey(V){return o.isValidPrefixAndOrSuffix(V,"/",o.isValidDnsSubdomain,te.isValidObjectName)}static isValidLabelValue(V){return V===""||te.isValidObjectName(V)}static isValidAnnotationKey(V){return o.isValidPrefixAndOrSuffix(V,"/",o.isValidDnsSubdomain,te.isValidObjectName)}static isValidAnnotationValue(V){return typeof V=="string"}}const ue={isValidApiVersion:te.isValidApiVersion,isValidKind:te.isValidKind,isValidEntityName:te.isValidObjectName,isValidNamespace:te.isValidNamespace,isValidLabelKey:te.isValidLabelKey,isValidLabelValue:te.isValidLabelValue,isValidAnnotationKey:te.isValidAnnotationKey,isValidAnnotationValue:te.isValidAnnotationValue,isValidTag:ae=>typeof ae=="string"&&ae.length>=1&&ae.length<=63&&/^[a-z0-9:+#]+(\-[a-z0-9:+#]+)*$/.test(ae)};function Re(ae={}){return{...ue,...ae}}class we{constructor(V=makeValidator()){q(this,"validators");this.validators=V}async enforce(V){var bt,Wt,Xt,un,dn,xt,qt;function ye(x,re,Ee){if(re==null)throw new Error(`${x} must have a value`);let Te;try{Te=Ee(re)}catch(Le){throw new Error(`${x} could not be validated, ${Le}`)}if(!Te){let Le;switch(Ee.name){case"isValidLabelValue":case"isValidObjectName":Le="a string that is sequences of [a-zA-Z0-9] separated by any of [-_.], at most 63 characters in total";break;case"isValidLabelKey":case"isValidApiVersion":case"isValidAnnotationKey":Le="a valid prefix and/or suffix";break;case"isValidNamespace":case"isValidDnsLabel":Le="a string that is sequences of [a-z0-9] separated by [-], at most 63 characters in total";break;case"isValidTag":Le="a string that is sequences of [a-z0-9+#] separated by [-], at most 63 characters in total";break;case"isValidAnnotationValue":Le="a string";break;case"isValidKind":Le="a string that is a sequence of [a-zA-Z][a-z0-9A-Z], at most 63 characters in total";break;case"isValidUrl":Le="a string that is a valid url";break;case"isValidString":case"isNonEmptyString":Le="a non empty string";break;default:Le=void 0;break}const Je=Le?` expected ${Le} but found "${re}".`:"";throw new Error(`"${x}" is not valid;${Je} To learn more about catalog file format, visit: https://github.com/backstage/backstage/blob/master/docs/architecture-decisions/adr002-default-catalog-file-format.md`)}}function He(x,re,Ee){return re===void 0||ye(x,re,Ee)}ye("apiVersion",V.apiVersion,this.validators.isValidApiVersion),ye("kind",V.kind,this.validators.isValidKind),ye("metadata.name",V.metadata.name,this.validators.isValidEntityName),He("metadata.namespace",V.metadata.namespace,this.validators.isValidNamespace);for(const[x,re]of Object.entries((bt=V.metadata.labels)!=null?bt:[]))ye(`labels.${x}`,x,this.validators.isValidLabelKey),ye(`labels.${x}`,re,this.validators.isValidLabelValue);for(const[x,re]of Object.entries((Wt=V.metadata.annotations)!=null?Wt:[]))ye(`annotations.${x}`,x,this.validators.isValidAnnotationKey),ye(`annotations.${x}`,re,this.validators.isValidAnnotationValue);const qe=(Xt=V.metadata.tags)!=null?Xt:[];for(let x=0;x<qe.length;++x)ye(`tags.${x}`,qe[x],this.validators.isValidTag);const ot=(un=V.metadata.links)!=null?un:[];for(let x=0;x<ot.length;++x)ye(`links.${x}.url`,(dn=ot[x])==null?void 0:dn.url,CommonValidatorFunctions.isValidUrl),He(`links.${x}.title`,(xt=ot[x])==null?void 0:xt.title,CommonValidatorFunctions.isNonEmptyString),He(`links.${x}.icon`,(qt=ot[x])==null?void 0:qt.icon,KubernetesValidatorFunctions.isValidObjectName);return V}}class ge{constructor(){q(this,"validate")}async enforce(V){if(!this.validate){const qe=new Ajv({allowUnionTypes:!0});this.validate=qe.addSchema([commonSchema,entityMetaSchema],void 0,void 0,!0).compile(entitySchema)}if(this.validate(V)===!0)return V;const[He]=this.validate.errors||[];throw He?new Error(`Malformed envelope, ${He.instancePath||"<root>"} ${He.message}`):new Error("Malformed envelope, Unknown error")}}function ze(ae){let V=ae.indexOf(":");const ye=ae.indexOf("/");ye!==-1&&ye<V&&(V=-1);const He=V===-1?void 0:ae.slice(0,V),qe=ye===-1?void 0:ae.slice(V+1,ye),ot=ae.slice(Math.max(V+1,ye+1));if(He===""||qe===""||ot==="")throw new TypeError(`Entity reference "${ae}" was not on the form [<kind>:][<namespace>/]<name>`);return{kind:He,namespace:qe,name:ot}}function _e(ae){return{kind:ae.kind,namespace:ae.metadata.namespace||r,name:ae.metadata.name}}function et(ae,V){var Wt,Xt,un,dn;if(!ae)throw new Error("Entity reference must not be empty");const ye=V==null?void 0:V.defaultKind,He=(V==null?void 0:V.defaultNamespace)||r;let qe,ot,bt;if(typeof ae=="string"){const xt=ze(ae);qe=(Wt=xt.kind)!=null?Wt:ye,ot=(Xt=xt.namespace)!=null?Xt:He,bt=xt.name}else qe=(un=ae.kind)!=null?un:ye,ot=(dn=ae.namespace)!=null?dn:He,bt=ae.name;if(qe)if(ot){if(!bt){const xt=JSON.stringify(ae);throw new Error(`Entity reference ${xt} had missing or empty name`)}}else{const xt=JSON.stringify(ae);throw new Error(`Entity reference ${xt} had missing or empty namespace`)}else{const xt=JSON.stringify(ae);throw new Error(`Entity reference ${xt} had missing or empty kind (e.g. did not start with "component:" or similar)`)}return{kind:qe,namespace:ot,name:bt}}function st(ae){var qe,ot;let V,ye,He;return"metadata"in ae?(V=ae.kind,ye=(qe=ae.metadata.namespace)!=null?qe:r,He=ae.metadata.name):(V=ae.kind,ye=(ot=ae.namespace)!=null?ot:r,He=ae.name),`${V.toLocaleLowerCase("en-US")}:${ye.toLocaleLowerCase("en-US")}/${He.toLocaleLowerCase("en-US")}`}class Ct{constructor(V){this.policies=V}async enforce(V){let ye=V;for(const He of this.policies){const qe=await He.enforce(ye);if(!qe)throw new Error(`Policy ${He.constructor.name} did not return a result`);ye=qe}return ye}}class yt{constructor(V){this.policies=V}async enforce(V){for(const ye of this.policies){const He=await ye.enforce(V);if(He)return He}throw new Error("The entity did not match any known policy")}}const Pe={allOf(ae){return new Ct(ae)},oneOf(ae){return new yt(ae)}};var ht=JSON.parse('{"$schema":"http://json-schema.org/draft-07/schema","$id":"ApiV1alpha1","description":"An API describes an interface that can be exposed by a component. The API can be defined in different formats, like OpenAPI, AsyncAPI, GraphQL, gRPC, or other formats.","examples":[{"apiVersion":"backstage.io/v1alpha1","kind":"API","metadata":{"name":"artist-api","description":"Retrieve artist details","labels":{"product_name":"Random value Generator"},"annotations":{"docs":"https://github.com/..../tree/develop/doc"}},"spec":{"type":"openapi","lifecycle":"production","owner":"artist-relations-team","system":"artist-engagement-portal","definition":"openapi: \\"3.0.0\\"\\ninfo:..."}}],"allOf":[{"$ref":"Entity"},{"type":"object","required":["spec"],"properties":{"apiVersion":{"enum":["backstage.io/v1alpha1","backstage.io/v1beta1"]},"kind":{"enum":["API"]},"spec":{"type":"object","required":["type","lifecycle","owner","definition"],"properties":{"type":{"type":"string","description":"The type of the API definition.","examples":["openapi","asyncapi","graphql","grpc"],"minLength":1},"lifecycle":{"type":"string","description":"The lifecycle state of the API.","examples":["experimental","production","deprecated"],"minLength":1},"owner":{"type":"string","description":"An entity reference to the owner of the API.","examples":["artist-relations-team","user:john.johnson"],"minLength":1},"system":{"type":"string","description":"An entity reference to the system that the API belongs to.","minLength":1},"definition":{"type":"string","description":"The definition of the API, based on the format defined by the type.","minLength":1}}}}}]}');function Ve(ae){const V=U(ae);return{async check(ye){return V(ye)===ye}}}const ie=Ve(ht);var de=JSON.parse('{"$schema":"http://json-schema.org/draft-07/schema","$id":"ComponentV1alpha1","description":"A Component describes a software component. It is typically intimately linked to the source code that constitutes the component, and should be what a developer may regard a \\"unit of software\\", usually with a distinct deployable or linkable artifact.","examples":[{"apiVersion":"backstage.io/v1alpha1","kind":"Component","metadata":{"name":"LoremService","description":"Creates Lorems like a pro.","labels":{"product_name":"Random value Generator"},"annotations":{"docs":"https://github.com/..../tree/develop/doc"}},"spec":{"type":"service","lifecycle":"production","owner":"tools"}}],"allOf":[{"$ref":"Entity"},{"type":"object","required":["spec"],"properties":{"apiVersion":{"enum":["backstage.io/v1alpha1","backstage.io/v1beta1"]},"kind":{"enum":["Component"]},"spec":{"type":"object","required":["type","lifecycle","owner"],"properties":{"type":{"type":"string","description":"The type of component.","examples":["service","website","library"],"minLength":1},"lifecycle":{"type":"string","description":"The lifecycle state of the component.","examples":["experimental","production","deprecated"],"minLength":1},"owner":{"type":"string","description":"An entity reference to the owner of the component.","examples":["artist-relations-team","user:john.johnson"],"minLength":1},"system":{"type":"string","description":"An entity reference to the system that the component belongs to.","minLength":1},"subcomponentOf":{"type":"string","description":"An entity reference to another component of which the component is a part.","minLength":1},"providesApis":{"type":"array","description":"An array of entity references to the APIs that are provided by the component.","items":{"type":"string","minLength":1}},"consumesApis":{"type":"array","description":"An array of entity references to the APIs that are consumed by the component.","items":{"type":"string","minLength":1}},"dependsOn":{"type":"array","description":"An array of references to other entities that the component depends on to function.","items":{"type":"string","minLength":1}}}}}}]}');const Ue=Ve(de);var Be=JSON.parse('{"$schema":"http://json-schema.org/draft-07/schema","$id":"DomainV1alpha1","description":"A Domain groups a collection of systems that share terminology, domain models, business purpose, or documentation, i.e. form a bounded context.","examples":[{"apiVersion":"backstage.io/v1alpha1","kind":"Domain","metadata":{"name":"artists","description":"Everything about artists"},"spec":{"owner":"artist-relations-team"}}],"allOf":[{"$ref":"Entity"},{"type":"object","required":["spec"],"properties":{"apiVersion":{"enum":["backstage.io/v1alpha1","backstage.io/v1beta1"]},"kind":{"enum":["Domain"]},"spec":{"type":"object","required":["owner"],"properties":{"owner":{"type":"string","description":"An entity reference to the owner of the component.","examples":["artist-relations-team","user:john.johnson"],"minLength":1}}}}}]}');const Xe=Ve(Be);var mt=JSON.parse(`{"$schema":"http://json-schema.org/draft-07/schema","$id":"GroupV1alpha1","description":"A group describes an organizational entity, such as for example a team, a business unit, or a loose collection of people in an interest group. Members of these groups are modeled in the catalog as kind User.","examples":[{"apiVersion":"backstage.io/v1alpha1","kind":"Group","metadata":{"name":"infrastructure","description":"The infra business unit"},"spec":{"type":"business-unit","profile":{"displayName":"Infrastructure","email":"infrastructure@example.com","picture":"https://example.com/groups/bu-infrastructure.jpeg"},"parent":"ops","children":["backstage","other"]}}],"allOf":[{"$ref":"Entity"},{"type":"object","required":["spec"],"properties":{"apiVersion":{"enum":["backstage.io/v1alpha1","backstage.io/v1beta1"]},"kind":{"enum":["Group"]},"spec":{"type":"object","required":["type","children"],"properties":{"type":{"type":"string","description":"The type of group. There is currently no enforced set of values for this field, so it is left up to the adopting organization to choose a nomenclature that matches their org hierarchy.","examples":["team","business-unit","product-area","root"],"minLength":1},"profile":{"type":"object","description":"Optional profile information about the group, mainly for display purposes. All fields of this structure are also optional. The email would be a group email of some form, that the group may wish to be used for contacting them. The picture is expected to be a URL pointing to an image that's representative of the group, and that a browser could fetch and render on a group page or similar.","properties":{"displayName":{"type":"string","description":"A simple display name to present to users.","examples":["Infrastructure"],"minLength":1},"email":{"type":"string","description":"An email where this entity can be reached.","examples":["infrastructure@example.com"],"minLength":1},"picture":{"type":"string","description":"The URL of an image that represents this entity.","examples":["https://example.com/groups/bu-infrastructure.jpeg"],"minLength":1}}},"parent":{"type":"string","description":"The immediate parent group in the hierarchy, if any. Not all groups must have a parent; the catalog supports multi-root hierarchies. Groups may however not have more than one parent. This field is an entity reference.","examples":["ops"],"minLength":1},"children":{"type":"array","description":"The immediate child groups of this group in the hierarchy (whose parent field points to this group). The list must be present, but may be empty if there are no child groups. The items are not guaranteed to be ordered in any particular way. The entries of this array are entity references.","items":{"type":"string","examples":["backstage","other"],"minLength":1}},"members":{"type":"array","description":"The users that are members of this group. The entries of this array are entity references.","items":{"type":"string","examples":["jdoe"],"minLength":1}}}}}}]}`);const Ye=Ve(mt);var Et=JSON.parse(`{"$schema":"http://json-schema.org/draft-07/schema","$id":"LocationV1alpha1","description":"A location is a marker that references other places to look for catalog data.","examples":[{"apiVersion":"backstage.io/v1alpha1","kind":"Location","metadata":{"name":"org-data"},"spec":{"type":"url","targets":["http://github.com/myorg/myproject/org-data-dump/catalog-info-staff.yaml","http://github.com/myorg/myproject/org-data-dump/catalog-info-consultants.yaml"]}}],"allOf":[{"$ref":"Entity"},{"type":"object","required":["spec"],"properties":{"apiVersion":{"enum":["backstage.io/v1alpha1","backstage.io/v1beta1"]},"kind":{"enum":["Location"]},"spec":{"type":"object","required":[],"properties":{"type":{"type":"string","description":"The single location type, that's common to the targets specified in the spec. If it is left out, it is inherited from the location type that originally read the entity data.","examples":["url"],"minLength":1},"target":{"type":"string","description":"A single target as a string. Can be either an absolute path/URL (depending on the type), or a relative path such as ./details/catalog-info.yaml which is resolved relative to the location of this Location entity itself.","examples":["./details/catalog-info.yaml"],"minLength":1},"targets":{"type":"array","description":"A list of targets as strings. They can all be either absolute paths/URLs (depending on the type), or relative paths such as ./details/catalog-info.yaml which are resolved relative to the location of this Location entity itself.","items":{"type":"string","examples":["./details/catalog-info.yaml","http://github.com/myorg/myproject/org-data-dump/catalog-info-staff.yaml"],"minLength":1}},"presence":{"type":"string","description":"Whether the presence of the location target is required and it should be considered an error if it can not be found","default":"required","examples":["required"],"enum":["required","optional"]}}}}}]}`);const oe=Ve(Et),fe="ownedBy",tt="ownerOf",Ke="consumesApi",Ne="apiConsumedBy",ct="providesApi",X="apiProvidedBy",Z="dependsOn",Q="dependencyOf",se="parentOf",le="childOf",be="memberOf",Oe="hasMember",Ae="partOf",ke="hasPart";var We=JSON.parse('{"$schema":"http://json-schema.org/draft-07/schema","$id":"ResourceV1alpha1","description":"A resource describes the infrastructure a system needs to operate, like BigTable databases, Pub/Sub topics, S3 buckets or CDNs. Modelling them together with components and systems allows to visualize resource footprint, and create tooling around them.","examples":[{"apiVersion":"backstage.io/v1alpha1","kind":"Resource","metadata":{"name":"artists-db","description":"Stores artist details"},"spec":{"type":"database","owner":"artist-relations-team","system":"artist-engagement-portal"}}],"allOf":[{"$ref":"Entity"},{"type":"object","required":["spec"],"properties":{"apiVersion":{"enum":["backstage.io/v1alpha1","backstage.io/v1beta1"]},"kind":{"enum":["Resource"]},"spec":{"type":"object","required":["type","owner"],"properties":{"type":{"type":"string","description":"The type of resource.","examples":["database","s3-bucket","cluster"],"minLength":1},"owner":{"type":"string","description":"An entity reference to the owner of the resource.","examples":["artist-relations-team","user:john.johnson"],"minLength":1},"dependsOn":{"type":"array","description":"An array of references to other entities that the resource depends on to function.","items":{"type":"string","minLength":1}},"system":{"type":"string","description":"An entity reference to the system that the resource belongs to.","minLength":1}}}}}]}');const gt=Ve(We);var It=JSON.parse('{"$schema":"http://json-schema.org/draft-07/schema","$id":"SystemV1alpha1","description":"A system is a collection of resources and components. The system may expose or consume one or several APIs. It is viewed as abstraction level that provides potential consumers insights into exposed features without needing a too detailed view into the details of all components. This also gives the owning team the possibility to decide about published artifacts and APIs.","examples":[{"apiVersion":"backstage.io/v1alpha1","kind":"System","metadata":{"name":"artist-engagement-portal","description":"Handy tools to keep artists in the loop"},"spec":{"owner":"artist-relations-team","domain":"artists"}}],"allOf":[{"$ref":"Entity"},{"type":"object","required":["spec"],"properties":{"apiVersion":{"enum":["backstage.io/v1alpha1","backstage.io/v1beta1"]},"kind":{"enum":["System"]},"spec":{"type":"object","required":["owner"],"properties":{"owner":{"type":"string","description":"An entity reference to the owner of the component.","examples":["artist-relations-team","user:john.johnson"],"minLength":1},"domain":{"type":"string","description":"An entity reference to the domain that the system belongs to.","examples":["artists"],"minLength":1}}}}}]}');const lt=Ve(It);var Tt=JSON.parse(`{"$schema":"http://json-schema.org/draft-07/schema","$id":"UserV1alpha1","description":"A user describes a person, such as an employee, a contractor, or similar. Users belong to Group entities in the catalog. These catalog user entries are connected to the way that authentication within the Backstage ecosystem works. See the auth section of the docs for a discussion of these concepts.","examples":[{"apiVersion":"backstage.io/v1alpha1","kind":"User","metadata":{"name":"jdoe"},"spec":{"profile":{"displayName":"Jenny Doe","email":"jenny-doe@example.com","picture":"https://example.com/staff/jenny-with-party-hat.jpeg"},"memberOf":["team-b","employees"]}}],"allOf":[{"$ref":"Entity"},{"type":"object","required":["spec"],"properties":{"apiVersion":{"enum":["backstage.io/v1alpha1","backstage.io/v1beta1"]},"kind":{"enum":["User"]},"spec":{"type":"object","required":["memberOf"],"properties":{"profile":{"type":"object","description":"Optional profile information about the user, mainly for display purposes. All fields of this structure are also optional. The email would be a primary email of some form, that the user may wish to be used for contacting them. The picture is expected to be a URL pointing to an image that's representative of the user, and that a browser could fetch and render on a profile page or similar.","properties":{"displayName":{"type":"string","description":"A simple display name to present to users.","examples":["Jenny Doe"],"minLength":1},"email":{"type":"string","description":"An email where this user can be reached.","examples":["jenny-doe@example.com"],"minLength":1},"picture":{"type":"string","description":"The URL of an image that represents this user.","examples":["https://example.com/staff/jenny-with-party-hat.jpeg"],"minLength":1}}},"memberOf":{"type":"array","description":"The list of groups that the user is a direct member of (i.e., no transitive memberships are listed here). The list must be present, but may be empty if the user is not member of any groups. The items are not guaranteed to be ordered in any particular way. The entries of this array are entity references.","items":{"type":"string","examples":["team-b","employees"],"minLength":1}}}}}}]}`);const Lt=Ve(Tt),Rt="backstage.io/managed-by-location",Nt="backstage.io/managed-by-origin-location",Zt="backstage.io/source-location";function vt(ae){if(typeof ae!="string")throw new TypeError(`Unable to parse location ref '${ae}', unexpected argument ${typeof ae}`);const V=ae.indexOf(":");if(V<0)throw new TypeError(`Unable to parse location ref '${ae}', expected '<type>:<target>', e.g. 'url:https://host/path'`);const ye=ae.substring(0,V).trim(),He=ae.substring(V+1).trim();if(!ye||!He)throw new TypeError(`Unable to parse location ref '${ae}', expected '<type>:<target>', e.g. 'url:https://host/path'`);if(ye==="http"||ye==="https")throw new TypeError(`Invalid location ref '${ae}', please prefix it with 'url:', e.g. 'url:${ae}'`);return{type:ye,target:He}}function at(ae){const{type:V,target:ye}=ae;if(V){if(!ye)throw new TypeError("Unable to stringify location ref, empty target")}else throw new TypeError("Unable to stringify location ref, empty type");return`${V}:${ye}`}function zt(ae){var ye,He,qe,ot,bt;const V=(bt=(He=(ye=ae.metadata)==null?void 0:ye.annotations)==null?void 0:He[ANNOTATION_SOURCE_LOCATION])!=null?bt:(ot=(qe=ae.metadata)==null?void 0:qe.annotations)==null?void 0:ot[ANNOTATION_LOCATION];if(!V)throw new Error(`Entity '${stringifyEntityRef(ae)}' is missing location`);return vt(V)}},23235:function(ee,s,e){"use strict";e.d(s,{C:function(){return t}});var r=e(98005);class t{constructor(){q(this,"subject",new r.J)}post(u){this.subject.next(u)}alert$(){return this.subject}}},47150:function(ee,s,e){"use strict";e.d(s,{g:function(){return r}});class r{captureEvent(l){}}},58652:function(ee,s,e){"use strict";e.d(s,{C:function(){return l}});var r=e(98005);const t="theme";class l{constructor(A){q(this,"activeThemeId");q(this,"subject",new r.X(void 0));this.themes=A}static createWithStorage(A){var c;const m=new l(A);if(!window.localStorage)return m;const o=(c=window.localStorage.getItem(t))!=null?c:void 0;return m.setActiveThemeId(o),m.activeThemeId$().subscribe(f=>{f?window.localStorage.setItem(t,f):window.localStorage.removeItem(t)}),window.addEventListener("storage",f=>{var y;if(f.key===t){const p=(y=localStorage.getItem(t))!=null?y:void 0;m.setActiveThemeId(p)}}),m}getInstalledThemes(){return this.themes.slice()}activeThemeId$(){return this.subject}getActiveThemeId(){return this.activeThemeId}setActiveThemeId(A){this.activeThemeId=A,this.subject.next(A)}}},14721:function(ee,s,e){"use strict";e.d(s,{m:function(){return f}});var r=e(9850),t=e.n(r),l=e(12782),u=e.n(l);const A=/^[a-z][a-z0-9]*(?:[-_][a-z][a-z0-9]*)*$/i;function m(y){return typeof y=="object"&&y!==null&&!Array.isArray(y)}function o(y){if(y===null)return"null";if(Array.isArray(y))return"array";const p=typeof y;return p==="number"&&isNaN(y)?"nan":p==="string"&&y===""?"empty-string":p}const c={type(y,p,E,T){return`Invalid type in config for key '${y}' in '${p}', got ${E}, wanted ${T}`},missing(y){return`Missing required config value at '${y}'`},convert(y,p,E){return`Unable to convert config value for key '${y}' in '${p}' to a ${E}`}};class f{constructor(p,E="mock-config",T,I=""){q(this,"filteredKeys");q(this,"notifiedFilteredKeys",new Set);this.data=p,this.context=E,this.fallback=T,this.prefix=I}static fromConfigs(p){return p.length===0?new f(void 0):p.reduce((E,{data:T,context:I,filteredKeys:B,deprecatedKeys:j})=>{const M=new f(T,I,E);if(M.filteredKeys=B,j)for(const{key:b,description:L}of j)console.warn(`The configuration key '${b}' of ${I} is deprecated and may be removed soon. ${L||""}`);return M},void 0)}has(p){var T,I;return this.readValue(p)!==void 0?!0:(I=(T=this.fallback)==null?void 0:T.has(p))!=null?I:!1}keys(){var T,I;const p=this.data?Object.keys(this.data):[],E=(I=(T=this.fallback)==null?void 0:T.keys())!=null?I:[];return[...new Set([...p,...E])]}get(p){const E=this.getOptional(p);if(E===void 0)throw new Error(c.missing(this.fullKey(p!=null?p:"")));return E}getOptional(p){var I;const E=t()(this.readValue(p)),T=(I=this.fallback)==null?void 0:I.getOptional(p);return E===void 0?T:T===void 0?E:u()({},{value:T},{value:E},(B,j)=>!m(j)||!m(B)?j:void 0).value}getConfig(p){const E=this.getOptionalConfig(p);if(E===void 0)throw new Error(c.missing(this.fullKey(p)));return E}getOptionalConfig(p){var I;const E=this.readValue(p),T=(I=this.fallback)==null?void 0:I.getOptionalConfig(p);if(m(E))return this.copy(E,p,T);if(E!==void 0)throw new TypeError(c.type(this.fullKey(p),this.context,o(E),"object"));return T}getConfigArray(p){const E=this.getOptionalConfigArray(p);if(E===void 0)throw new Error(c.missing(this.fullKey(p)));return E}getOptionalConfigArray(p){const E=this.readConfigValue(p,T=>{if(!Array.isArray(T))return{expected:"object-array"};for(const[I,B]of T.entries())if(!m(B))return{expected:"object-array",value:B,key:`${p}[${I}]`};return!0});if(!!E)return E.map((T,I)=>this.copy(T,`${p}[${I}]`))}getNumber(p){const E=this.getOptionalNumber(p);if(E===void 0)throw new Error(c.missing(this.fullKey(p)));return E}getOptionalNumber(p){const E=this.readConfigValue(p,I=>typeof I=="number"||typeof I=="string"||{expected:"number"});if(typeof E=="number"||E===void 0)return E;const T=Number(E);if(!Number.isFinite(T))throw new Error(c.convert(this.fullKey(p),this.context,"number"));return T}getBoolean(p){const E=this.getOptionalBoolean(p);if(E===void 0)throw new Error(c.missing(this.fullKey(p)));return E}getOptionalBoolean(p){return this.readConfigValue(p,E=>typeof E=="boolean"||{expected:"boolean"})}getString(p){const E=this.getOptionalString(p);if(E===void 0)throw new Error(c.missing(this.fullKey(p)));return E}getOptionalString(p){return this.readConfigValue(p,E=>typeof E=="string"&&E!==""||{expected:"string"})}getStringArray(p){const E=this.getOptionalStringArray(p);if(E===void 0)throw new Error(c.missing(this.fullKey(p)));return E}getOptionalStringArray(p){return this.readConfigValue(p,E=>{if(!Array.isArray(E))return{expected:"string-array"};for(const[T,I]of E.entries())if(typeof I!="string"||I==="")return{expected:"string-array",value:I,key:`${p}[${T}]`};return!0})}fullKey(p){return`${this.prefix}${this.prefix?".":""}${p}`}copy(p,E,T){const I=new f(p,this.context,T,this.fullKey(E));return I.filteredKeys=this.filteredKeys,I}readConfigValue(p,E){var B;const T=this.readValue(p);if(T===void 0)return(B=this.fallback)==null?void 0:B.readConfigValue(p,E);const I=E(T);if(I!==!0){const{key:j=p,value:M=T,expected:b}=I;throw new TypeError(c.type(this.fullKey(j),this.context,o(M),b))}return T}readValue(p){const E=p?p.split("."):[];for(const I of E)if(!A.test(I))throw new TypeError(`Invalid config key '${p}'`);if(this.data===void 0)return;let T=this.data;for(const[I,B]of E.entries())if(m(T))T=T[B];else if(T!==void 0){const j=this.fullKey(E.slice(0,I).join("."));throw new TypeError(c.type(j,this.context,o(T),"object"))}return T}}},4333:function(ee,s,e){"use strict";e.d(s,{p:function(){return t}});const r="Invalid discovery URL pattern,";class t{static compile(u){const A=u.split(/\{\{\s*pluginId\s*\}\}/),m=A.join("pluginId");let o;try{o=new URL(m)}catch{throw new Error(`${r} URL '${m}' is invalid`)}if(o.hash)throw new Error(`${r} URL must not have a hash`);if(o.search)throw new Error(`${r} URL must not have a query`);if(m.endsWith("/"))throw new Error(`${r} URL must not end with a slash`);return new t(A)}constructor(u){this.parts=u}async getBaseUrl(u){return this.parts.join(u)}}},89536:function(ee,s,e){"use strict";e.d(s,{KN:function(){return r},gr:function(){return l},Jv:function(){return u}});class r{constructor(m,o){this.alertApi=m,this.errorApi=o}post(m,o){return o!=null&&o.hidden||this.alertApi.post({message:m.message,severity:"error"}),this.errorApi.post(m,o)}error$(){return this.errorApi.error$()}}var t=e(98005);class l{constructor(){q(this,"subject",new t.J)}post(m,o){this.subject.next({error:m,context:o})}error$(){return this.subject}}class u{static forward(m,o){window.addEventListener("unhandledrejection",c=>{m.post(c.reason,o)})}}},14884:function(ee,s,e){"use strict";e.d(s,{b:function(){return l}});var r=e(36964);function t(u){if(u.length<3)throw new Error(`The '${u}' feature flag must have a minimum length of three characters.`);if(u.length>150)throw new Error(`The '${u}' feature flag must not exceed 150 characters.`);if(!u.match(/^[a-z]+[a-z0-9-]+$/))throw new Error(`The '${u}' feature flag must start with a lowercase letter and only contain lowercase letters, numbers and hyphens. Examples: feature-flag-one, alpha, release-2020`)}class l{constructor(){q(this,"registeredFeatureFlags",[]);q(this,"flags")}registerFlag(A){t(A.name),this.registeredFeatureFlags.push(A)}getRegisteredFlags(){return this.registeredFeatureFlags.slice()}isActive(A){return this.flags||(this.flags=this.load()),this.flags.get(A)===r.FeatureFlagState.Active}save(A){this.flags||(this.flags=this.load()),A.merge||this.flags.clear();for(const[o,c]of Object.entries(A.states))this.flags.set(o,c);const m=Array.from(this.flags.entries()).filter(([,o])=>o===r.FeatureFlagState.Active);window.localStorage.setItem("featureFlags",JSON.stringify(Object.fromEntries(m)))}load(){try{const A=window.localStorage.getItem("featureFlags");if(!A)return new Map;const m=JSON.parse(A);if(typeof m!="object"||m===null||Array.isArray(m))return new Map;const o=Object.entries(m).filter(([c,f])=>(t(c),f===r.FeatureFlagState.Active));return new Map(o)}catch{return new Map}}}},50160:function(ee,s,e){"use strict";e.d(s,{I:function(){return c},j:function(){return r}});function r(f){var E;let y=f.baseImplementation||e.g.fetch;const p=[(E=f.middleware)!=null?E:[]].flat().reverse();for(const T of p)y=T.apply(y);return{fetch:y}}class t{static create(y){var I,B;const p=l(y),E=((I=y.header)==null?void 0:I.name)||"authorization",T=((B=y.header)==null?void 0:B.value)||(j=>`Bearer ${j}`);return new t(y.identityApi,p,E,T)}constructor(y,p,E,T){this.identityApi=y,this.allowUrl=p,this.headerName=E,this.headerValue=T}apply(y){return async(p,E)=>{const T=new Request(p,E),{token:I}=await this.identityApi.getCredentials();return T.headers.get(this.headerName)||typeof I!="string"||!I||!this.allowUrl(T.url)?y(p,E):(T.headers.set(this.headerName,this.headerValue(I)),y(T))}}}function l(f){return f.allowUrl?f.allowUrl:f.urlPrefixAllowlist?u(f.urlPrefixAllowlist):f.config?u([f.config.getString("backend.baseUrl")]):()=>!1}function u(f){const y=f.map(p=>p.replace(/\/$/,""));return p=>y.some(E=>p===E||p.startsWith(`${E}/`))}function A(f,y){return!y||y==="/"?f:`${f.replace(/\/$/,"")}/${y.replace(/^\//,"")}`}class m{constructor(y){this.discoveryApi=y}apply(y){return async(p,E)=>{const T=new Request(p,E),I="plugin://";if(!T.url.startsWith(I))return y(p,E);const{hostname:B,pathname:j,search:M,hash:b,username:L,password:D}=new URL(`http://${T.url.substring(I.length)}`);let U=await this.discoveryApi.getBaseUrl(B);if(L||D){const te=new URL(U),ue=`${L}${D?`:${D}`:""}@`;U=`${te.protocol}//${ue}${te.host}${te.pathname}`}const Y=`${A(U,j)}${M}${b}`;return y(Y,typeof p=="string"||o(p)?E:p)}}}function o(f){return typeof f=="object"&&(f==null?void 0:f.constructor)===URL}class c{static resolvePluginProtocol(y){return new m(y.discoveryApi)}static injectIdentityAuth(y){return t.create(y)}constructor(){}}},11358:function(ee,s,e){"use strict";e.d(s,{Y:function(){return A}});var r=e(98005);function t(m,o){for(const c of o)if(!m.has(c))return!1;return!0}function l(m,...o){const c=new Set(m);for(const f of o)for(const y of f)c.add(y);return c}class u{constructor(){q(this,"requests",[]);q(this,"subject",new r.X(this.getCurrentPending()))}request(o){return new Promise((c,f)=>{this.requests.push({scopes:o,resolve:c,reject:f}),this.subject.next(this.getCurrentPending())})}resolve(o,c){this.requests=this.requests.filter(f=>t(o,f.scopes)?(f.resolve(c),!1):!0),this.subject.next(this.getCurrentPending())}reject(o){this.requests.forEach(c=>c.reject(o)),this.requests=[],this.subject.next(this.getCurrentPending())}pending(){return this.subject}getCurrentPending(){const o=this.requests.length===0?void 0:this.requests.slice(1).reduce((c,f)=>l(c,f.scopes),this.requests[0].scopes);return{scopes:o,resolve:c=>{o&&this.resolve(o,c)},reject:c=>{o&&this.reject(c)}}}}class A{constructor(){q(this,"subject",new r.X([]));q(this,"currentRequests",[]);q(this,"handlerCount",0)}createAuthRequester(o){const c=new u,f=this.handlerCount;return this.handlerCount++,c.pending().subscribe({next:y=>{const p=this.currentRequests.slice(),E=this.makeAuthRequest(y,o);E?p[f]=E:delete p[f],this.currentRequests=p,this.subject.next(p.filter(Boolean))}}),y=>c.request(y)}makeAuthRequest(o,c){const{scopes:f}=o;if(!!f)return{provider:c.provider,trigger:async()=>{const y=await c.onAuthRequest(f);o.resolve(y)},reject:()=>{const y=new Error("Login failed, rejected by user");y.name="RejectedError",o.reject(y)}}}authRequest$(){return this.subject}}},56054:function(ee,s,e){"use strict";e.d(s,{C:function(){return u}});var r=e(82394),t=e.n(r);const l=new Map;class u{constructor(m,o){q(this,"subscribers",new Set);q(this,"observable",new(t())(m=>(this.subscribers.add(m),()=>{this.subscribers.delete(m)})));this.namespace=m,this.errorApi=o}static create(m){var o;return new u((o=m.namespace)!=null?o:"",m.errorApi)}get(m){return this.snapshot(m).value}snapshot(m){let o,c="absent";try{const f=localStorage.getItem(this.getKeyName(m));f&&(o=JSON.parse(f,(y,p)=>(typeof p=="object"&&p!==null&&Object.freeze(p),p)),c="present")}catch{this.errorApi.post(new Error(`Error when parsing JSON config from storage for: ${m}`))}return{key:m,value:o,presence:c}}forBucket(m){const o=`${this.namespace}/${m}`;return l.has(o)||l.set(o,new u(o,this.errorApi)),l.get(o)}async set(m,o){localStorage.setItem(this.getKeyName(m),JSON.stringify(o)),this.notifyChanges(m)}async remove(m){localStorage.removeItem(this.getKeyName(m)),this.notifyChanges(m)}observe$(m){return this.observable.filter(({key:o})=>o===m)}getKeyName(m){return`${this.namespace}/${encodeURIComponent(m)}`}notifyChanges(m){const o=this.snapshot(m);for(const c of this.subscribers)c.next(o)}}},59589:function(ee,s,e){"use strict";e.d(s,{u:function(){return l}});var r=e(91205);const t={id:"atlassian",title:"Atlassian",icon:()=>null};class l{static create(A){const{discoveryApi:m,environment:o="development",provider:c=t,oauthRequestApi:f}=A;return r.OAuth2.create({discoveryApi:m,oauthRequestApi:f,provider:c,environment:o})}}},6098:function(ee,s,e){"use strict";e.d(s,{Z:function(){return l}});var r=e(91205);const t={id:"bitbucket",title:"Bitbucket",icon:()=>null};class l{static create(A){const{discoveryApi:m,environment:o="development",provider:c=t,oauthRequestApi:f,defaultScopes:y=["team"]}=A;return r.OAuth2.create({discoveryApi:m,oauthRequestApi:f,provider:c,environment:o,defaultScopes:y})}}},44431:function(ee,s,e){"use strict";e.d(s,{BitbucketAuth:function(){return l.Z}});var r=e(19347),t=e.n(r);e.o(r,"AlertApiForwarder")&&e.d(s,{AlertApiForwarder:function(){return r.AlertApiForwarder}}),e.o(r,"AppThemeSelector")&&e.d(s,{AppThemeSelector:function(){return r.AppThemeSelector}}),e.o(r,"AtlassianAuth")&&e.d(s,{AtlassianAuth:function(){return r.AtlassianAuth}}),e.o(r,"ConfigReader")&&e.d(s,{ConfigReader:function(){return r.ConfigReader}}),e.o(r,"ErrorAlerter")&&e.d(s,{ErrorAlerter:function(){return r.ErrorAlerter}}),e.o(r,"ErrorApiForwarder")&&e.d(s,{ErrorApiForwarder:function(){return r.ErrorApiForwarder}}),e.o(r,"FetchMiddlewares")&&e.d(s,{FetchMiddlewares:function(){return r.FetchMiddlewares}}),e.o(r,"FlatRoutes")&&e.d(s,{FlatRoutes:function(){return r.FlatRoutes}}),e.o(r,"LocalStorageFeatureFlags")&&e.d(s,{LocalStorageFeatureFlags:function(){return r.LocalStorageFeatureFlags}}),e.o(r,"NoOpAnalyticsApi")&&e.d(s,{NoOpAnalyticsApi:function(){return r.NoOpAnalyticsApi}}),e.o(r,"OAuthRequestManager")&&e.d(s,{OAuthRequestManager:function(){return r.OAuthRequestManager}}),e.o(r,"UnhandledErrorForwarder")&&e.d(s,{UnhandledErrorForwarder:function(){return r.UnhandledErrorForwarder}}),e.o(r,"UrlPatternDiscovery")&&e.d(s,{UrlPatternDiscovery:function(){return r.UrlPatternDiscovery}}),e.o(r,"WebStorage")&&e.d(s,{WebStorage:function(){return r.WebStorage}}),e.o(r,"createFetchApi")&&e.d(s,{createFetchApi:function(){return r.createFetchApi}}),e.o(r,"createSpecializedApp")&&e.d(s,{createSpecializedApp:function(){return r.createSpecializedApp}}),e.o(r,"defaultConfigLoader")&&e.d(s,{defaultConfigLoader:function(){return r.defaultConfigLoader}});var l=e(6098)},19347:function(){},44474:function(ee,s,e){"use strict";e.d(s,{T:function(){return l}});var r=e(91205);const t={id:"github",title:"GitHub",icon:()=>null};class l{static create(A){const{discoveryApi:m,environment:o="development",provider:c=t,oauthRequestApi:f,defaultScopes:y=["read:user"]}=A;return r.OAuth2.create({discoveryApi:m,oauthRequestApi:f,provider:c,environment:o,defaultScopes:y})}}},2922:function(ee,s,e){"use strict";e.d(s,{a:function(){return l}});var r=e(91205);const t={id:"gitlab",title:"GitLab",icon:()=>null};class l{static create(A){const{discoveryApi:m,environment:o="development",provider:c=t,oauthRequestApi:f,defaultScopes:y=["read_user"]}=A;return r.OAuth2.create({discoveryApi:m,oauthRequestApi:f,provider:c,environment:o,defaultScopes:y})}}},59938:function(ee,s,e){"use strict";e.d(s,{e:function(){return u}});var r=e(91205);const t={id:"google",title:"Google",icon:()=>null},l="https://www.googleapis.com/auth/";class u{static create(m){const{discoveryApi:o,oauthRequestApi:c,environment:f="development",provider:y=t,defaultScopes:p=["openid",`${l}userinfo.email`,`${l}userinfo.profile`]}=m;return r.OAuth2.create({discoveryApi:o,oauthRequestApi:c,provider:y,environment:f,defaultScopes:p,scopeTransform(E){return E.map(T=>T==="openid"?T:T==="profile"||T==="email"?`${l}userinfo.${T}`:T.startsWith(l)?T:`${l}${T}`)}})}}},91668:function(ee,s,e){"use strict";e.d(s,{AtlassianAuth:function(){return y.u},BitbucketAuth:function(){return f.BitbucketAuth},GithubAuth:function(){return r.T},GitlabAuth:function(){return t.a},GoogleAuth:function(){return l.e},MicrosoftAuth:function(){return o._},OktaAuth:function(){return A.s},OneLoginAuth:function(){return c.$}});var r=e(44474),t=e(2922),l=e(59938),u=e(91205);e.o(u,"AlertApiForwarder")&&e.d(s,{AlertApiForwarder:function(){return u.AlertApiForwarder}}),e.o(u,"AppThemeSelector")&&e.d(s,{AppThemeSelector:function(){return u.AppThemeSelector}}),e.o(u,"AtlassianAuth")&&e.d(s,{AtlassianAuth:function(){return u.AtlassianAuth}}),e.o(u,"BitbucketAuth")&&e.d(s,{BitbucketAuth:function(){return u.BitbucketAuth}}),e.o(u,"ConfigReader")&&e.d(s,{ConfigReader:function(){return u.ConfigReader}}),e.o(u,"ErrorAlerter")&&e.d(s,{ErrorAlerter:function(){return u.ErrorAlerter}}),e.o(u,"ErrorApiForwarder")&&e.d(s,{ErrorApiForwarder:function(){return u.ErrorApiForwarder}}),e.o(u,"FetchMiddlewares")&&e.d(s,{FetchMiddlewares:function(){return u.FetchMiddlewares}}),e.o(u,"FlatRoutes")&&e.d(s,{FlatRoutes:function(){return u.FlatRoutes}}),e.o(u,"LocalStorageFeatureFlags")&&e.d(s,{LocalStorageFeatureFlags:function(){return u.LocalStorageFeatureFlags}}),e.o(u,"MicrosoftAuth")&&e.d(s,{MicrosoftAuth:function(){return u.MicrosoftAuth}}),e.o(u,"NoOpAnalyticsApi")&&e.d(s,{NoOpAnalyticsApi:function(){return u.NoOpAnalyticsApi}}),e.o(u,"OAuthRequestManager")&&e.d(s,{OAuthRequestManager:function(){return u.OAuthRequestManager}}),e.o(u,"OktaAuth")&&e.d(s,{OktaAuth:function(){return u.OktaAuth}}),e.o(u,"OneLoginAuth")&&e.d(s,{OneLoginAuth:function(){return u.OneLoginAuth}}),e.o(u,"UnhandledErrorForwarder")&&e.d(s,{UnhandledErrorForwarder:function(){return u.UnhandledErrorForwarder}}),e.o(u,"UrlPatternDiscovery")&&e.d(s,{UrlPatternDiscovery:function(){return u.UrlPatternDiscovery}}),e.o(u,"WebStorage")&&e.d(s,{WebStorage:function(){return u.WebStorage}}),e.o(u,"createFetchApi")&&e.d(s,{createFetchApi:function(){return u.createFetchApi}}),e.o(u,"createSpecializedApp")&&e.d(s,{createSpecializedApp:function(){return u.createSpecializedApp}}),e.o(u,"defaultConfigLoader")&&e.d(s,{defaultConfigLoader:function(){return u.defaultConfigLoader}});var A=e(26079),m=e(67604),o=e(38482),c=e(58381),f=e(44431);e.o(f,"AlertApiForwarder")&&e.d(s,{AlertApiForwarder:function(){return f.AlertApiForwarder}}),e.o(f,"AppThemeSelector")&&e.d(s,{AppThemeSelector:function(){return f.AppThemeSelector}}),e.o(f,"AtlassianAuth")&&e.d(s,{AtlassianAuth:function(){return f.AtlassianAuth}}),e.o(f,"ConfigReader")&&e.d(s,{ConfigReader:function(){return f.ConfigReader}}),e.o(f,"ErrorAlerter")&&e.d(s,{ErrorAlerter:function(){return f.ErrorAlerter}}),e.o(f,"ErrorApiForwarder")&&e.d(s,{ErrorApiForwarder:function(){return f.ErrorApiForwarder}}),e.o(f,"FetchMiddlewares")&&e.d(s,{FetchMiddlewares:function(){return f.FetchMiddlewares}}),e.o(f,"FlatRoutes")&&e.d(s,{FlatRoutes:function(){return f.FlatRoutes}}),e.o(f,"LocalStorageFeatureFlags")&&e.d(s,{LocalStorageFeatureFlags:function(){return f.LocalStorageFeatureFlags}}),e.o(f,"NoOpAnalyticsApi")&&e.d(s,{NoOpAnalyticsApi:function(){return f.NoOpAnalyticsApi}}),e.o(f,"OAuthRequestManager")&&e.d(s,{OAuthRequestManager:function(){return f.OAuthRequestManager}}),e.o(f,"UnhandledErrorForwarder")&&e.d(s,{UnhandledErrorForwarder:function(){return f.UnhandledErrorForwarder}}),e.o(f,"UrlPatternDiscovery")&&e.d(s,{UrlPatternDiscovery:function(){return f.UrlPatternDiscovery}}),e.o(f,"WebStorage")&&e.d(s,{WebStorage:function(){return f.WebStorage}}),e.o(f,"createFetchApi")&&e.d(s,{createFetchApi:function(){return f.createFetchApi}}),e.o(f,"createSpecializedApp")&&e.d(s,{createSpecializedApp:function(){return f.createSpecializedApp}}),e.o(f,"defaultConfigLoader")&&e.d(s,{defaultConfigLoader:function(){return f.defaultConfigLoader}});var y=e(59589)},38482:function(ee,s,e){"use strict";e.d(s,{_:function(){return l}});var r=e(91205);const t={id:"microsoft",title:"Microsoft",icon:()=>null};class l{static create(A){const{environment:m="development",provider:o=t,oauthRequestApi:c,discoveryApi:f,defaultScopes:y=["openid","offline_access","profile","email","User.Read"]}=A;return r.OAuth2.create({discoveryApi:f,oauthRequestApi:c,provider:o,environment:m,defaultScopes:y})}}},73124:function(ee,s,e){"use strict";e.d(s,{Z:function(){return m}});function r(o){return new Promise((c,f)=>{const y=o.width||500,p=o.height||700,E=window.screen.width/2-y/2,T=window.screen.height/2-p/2,I=window.open(o.url,o.name,`menubar=no,location=no,resizable=no,scrollbars=no,status=no,width=${y},height=${p},top=${T},left=${E}`);let B="";if(!I||typeof I.closed=="undefined"||I.closed){const L=new Error("Failed to open auth popup.");L.name="PopupRejectedError",f(L);return}const j=L=>{if(L.source!==I||L.origin!==o.origin)return;const{data:D}=L;if(D.type==="config_info"){B=D.targetOrigin;return}if(D.type!=="authorization_response")return;const U=D;if("error"in U){const Y=new Error(U.error.message);Y.name=U.error.name,f(Y)}else c(U.response);b()},M=setInterval(()=>{if(I.closed){const L=`Login failed, ${B&&B!==window.location.origin?`Incorrect app origin, expected ${B}`:"popup was closed"}`,D=new Error(L);D.name="PopupClosedError",f(D),b()}},100);function b(){window.removeEventListener("message",j),clearInterval(M)}window.addEventListener("message",j)})}function t(o){return[...o].join(" ")}class l{constructor(c){q(this,"discoveryApi");q(this,"environment");q(this,"provider");q(this,"joinScopesFunc");q(this,"authRequester");q(this,"sessionTransform");const{discoveryApi:f,environment:y,provider:p,joinScopes:E=t,oauthRequestApi:T,sessionTransform:I=B=>B}=c;this.authRequester=T.createAuthRequester({provider:p,onAuthRequest:B=>this.showPopup(B)}),this.discoveryApi=f,this.environment=y,this.provider=p,this.joinScopesFunc=E,this.sessionTransform=I}async createSession(c){return c.instantPopup?this.showPopup(c.scopes):this.authRequester(c.scopes)}async refreshSession(){const c=await fetch(await this.buildUrl("/refresh",{optional:!0}),{headers:{"x-requested-with":"XMLHttpRequest"},credentials:"include"}).catch(y=>{throw new Error(`Auth refresh request failed, ${y}`)});if(!c.ok){const y=new Error(`Auth refresh request failed, ${c.statusText}`);throw y.status=c.status,y}const f=await c.json();if(f.error){const y=new Error(f.error.message);throw f.error.name&&(y.name=f.error.name),y}return await this.sessionTransform(f)}async removeSession(){const c=await fetch(await this.buildUrl("/logout"),{method:"POST",headers:{"x-requested-with":"XMLHttpRequest"},credentials:"include"}).catch(f=>{throw new Error(`Logout request failed, ${f}`)});if(!c.ok){const f=new Error(`Logout request failed, ${c.statusText}`);throw f.status=c.status,f}}async showPopup(c){const f=this.joinScopesFunc(c),y=await this.buildUrl("/start",{scope:f,origin:location.origin}),p=await r({url:y,name:`${this.provider.title} Login`,origin:new URL(y).origin,width:450,height:730});return await this.sessionTransform(p)}async buildUrl(c,f){const y=await this.discoveryApi.getBaseUrl("auth"),p=this.buildQueryString({...f,env:this.environment});return`${y}/${this.provider.id}${c}${p}`}buildQueryString(c){if(!c)return"";const f=Object.entries(c).map(([y,p])=>{if(typeof p=="string")return`${encodeURIComponent(y)}=${encodeURIComponent(p)}`;if(p)return encodeURIComponent(y)}).filter(Boolean).join("&");return f?`?${f}`:""}}var u=e(57018);const A={id:"oauth2",title:"Your Identity Provider",icon:()=>null};class m{constructor(c){q(this,"sessionManager");q(this,"scopeTransform");this.sessionManager=c.sessionManager,this.scopeTransform=c.scopeTransform}static create(c){const{discoveryApi:f,environment:y="development",provider:p=A,oauthRequestApi:E,defaultScopes:T=[],scopeTransform:I=M=>M}=c,B=new l({discoveryApi:f,environment:y,provider:p,oauthRequestApi:E,sessionTransform(M){return{...M,providerInfo:{idToken:M.providerInfo.idToken,accessToken:M.providerInfo.accessToken,scopes:m.normalizeScopes(I,M.providerInfo.scope),expiresAt:new Date(Date.now()+M.providerInfo.expiresInSeconds*1e3)}}}}),j=new u.RefreshingAuthSessionManager({connector:B,defaultScopes:new Set(T),sessionScopes:M=>M.providerInfo.scopes,sessionShouldRefresh:M=>(M.providerInfo.expiresAt.getTime()-Date.now())/1e3<60*5});return new m({sessionManager:j,scopeTransform:I})}async signIn(){await this.getAccessToken()}async signOut(){await this.sessionManager.removeSession()}sessionState$(){return this.sessionManager.sessionState$()}async getAccessToken(c,f){var E;const y=m.normalizeScopes(this.scopeTransform,c),p=await this.sessionManager.getSession({...f,scopes:y});return(E=p==null?void 0:p.providerInfo.accessToken)!=null?E:""}async getIdToken(c={}){var y;const f=await this.sessionManager.getSession(c);return(y=f==null?void 0:f.providerInfo.idToken)!=null?y:""}async getBackstageIdentity(c={}){const f=await this.sessionManager.getSession(c);return f==null?void 0:f.backstageIdentity}async getProfile(c={}){const f=await this.sessionManager.getSession(c);return f==null?void 0:f.profile}static normalizeScopes(c,f){if(!f)return new Set;const y=Array.isArray(f)?f:f.split(/[\s|,]/).filter(Boolean);return new Set(c(y))}}},91205:function(ee,s,e){"use strict";e.d(s,{OAuth2:function(){return r.Z}});var r=e(73124),t=e(5973),l=e.n(t);e.o(t,"AlertApiForwarder")&&e.d(s,{AlertApiForwarder:function(){return t.AlertApiForwarder}}),e.o(t,"AppThemeSelector")&&e.d(s,{AppThemeSelector:function(){return t.AppThemeSelector}}),e.o(t,"AtlassianAuth")&&e.d(s,{AtlassianAuth:function(){return t.AtlassianAuth}}),e.o(t,"BitbucketAuth")&&e.d(s,{BitbucketAuth:function(){return t.BitbucketAuth}}),e.o(t,"ConfigReader")&&e.d(s,{ConfigReader:function(){return t.ConfigReader}}),e.o(t,"ErrorAlerter")&&e.d(s,{ErrorAlerter:function(){return t.ErrorAlerter}}),e.o(t,"ErrorApiForwarder")&&e.d(s,{ErrorApiForwarder:function(){return t.ErrorApiForwarder}}),e.o(t,"FetchMiddlewares")&&e.d(s,{FetchMiddlewares:function(){return t.FetchMiddlewares}}),e.o(t,"FlatRoutes")&&e.d(s,{FlatRoutes:function(){return t.FlatRoutes}}),e.o(t,"LocalStorageFeatureFlags")&&e.d(s,{LocalStorageFeatureFlags:function(){return t.LocalStorageFeatureFlags}}),e.o(t,"MicrosoftAuth")&&e.d(s,{MicrosoftAuth:function(){return t.MicrosoftAuth}}),e.o(t,"NoOpAnalyticsApi")&&e.d(s,{NoOpAnalyticsApi:function(){return t.NoOpAnalyticsApi}}),e.o(t,"OAuthRequestManager")&&e.d(s,{OAuthRequestManager:function(){return t.OAuthRequestManager}}),e.o(t,"OktaAuth")&&e.d(s,{OktaAuth:function(){return t.OktaAuth}}),e.o(t,"OneLoginAuth")&&e.d(s,{OneLoginAuth:function(){return t.OneLoginAuth}}),e.o(t,"UnhandledErrorForwarder")&&e.d(s,{UnhandledErrorForwarder:function(){return t.UnhandledErrorForwarder}}),e.o(t,"UrlPatternDiscovery")&&e.d(s,{UrlPatternDiscovery:function(){return t.UrlPatternDiscovery}}),e.o(t,"WebStorage")&&e.d(s,{WebStorage:function(){return t.WebStorage}}),e.o(t,"createFetchApi")&&e.d(s,{createFetchApi:function(){return t.createFetchApi}}),e.o(t,"createSpecializedApp")&&e.d(s,{createSpecializedApp:function(){return t.createSpecializedApp}}),e.o(t,"defaultConfigLoader")&&e.d(s,{defaultConfigLoader:function(){return t.defaultConfigLoader}})},5973:function(){},26079:function(ee,s,e){"use strict";e.d(s,{s:function(){return A}});var r=e(91205);const t={id:"okta",title:"Okta",icon:()=>null},l=new Set(["openid","profile","email","phone","address","groups","offline_access"]),u="okta.";class A{static create(o){const{discoveryApi:c,environment:f="development",provider:y=t,oauthRequestApi:p,defaultScopes:E=["openid","email","profile","offline_access"]}=o;return r.OAuth2.create({discoveryApi:c,oauthRequestApi:p,provider:y,environment:f,defaultScopes:E,scopeTransform(T){return T.map(I=>l.has(I)||I.startsWith(u)?I:`${u}${I}`)}})}}},58381:function(ee,s,e){"use strict";e.d(s,{$:function(){return A}});var r=e(91205);const t={id:"onelogin",title:"onelogin",icon:()=>null},l=new Set(["openid","profile","email","phone","address","groups","offline_access"]),u="onelogin.";class A{static create(o){const{discoveryApi:c,environment:f="development",provider:y=t,oauthRequestApi:p}=o;return r.OAuth2.create({discoveryApi:c,oauthRequestApi:p,provider:y,environment:f,defaultScopes:["openid","email","profile","offline_access"],scopeTransform(E){return E.map(T=>l.has(T)||T.startsWith(u)?T:`${u}${T}`)}})}}},67604:function(ee,s,e){"use strict";var r=e(57018),t=e(30195);const l=t.z.object({profile:t.z.object({email:t.z.string().optional(),displayName:t.z.string().optional(),picture:t.z.string().optional()}),backstageIdentity:t.z.object({token:t.z.string(),identity:t.z.object({type:t.z.literal("user"),userEntityRef:t.z.string(),ownershipEntityRefs:t.z.array(t.z.string())})})}),u={id:"saml",title:"SAML",icon:()=>null};class A{static create(o){const{discoveryApi:c,environment:f="development",provider:y=u}=o,p=new DirectAuthConnector({discoveryApi:c,environment:f,provider:y}),E=new StaticAuthSessionManager({connector:p}),T=new AuthSessionStore({manager:E,storageKey:`${y.id}Session`,schema:samlSessionSchema});return new A(T)}sessionState$(){return this.sessionManager.sessionState$()}constructor(o){this.sessionManager=o}async signIn(){await this.getBackstageIdentity({})}async signOut(){await this.sessionManager.removeSession()}async getBackstageIdentity(o={}){const c=await this.sessionManager.getSession(o);return c==null?void 0:c.backstageIdentity}async getProfile(o={}){const c=await this.sessionManager.getSession(o);return c==null?void 0:c.profile}}},91631:function(ee,s,e){"use strict";e.d(s,{AlertApiForwarder:function(){return t.C},AppThemeSelector:function(){return u.C},AtlassianAuth:function(){return r.AtlassianAuth},ConfigReader:function(){return A.m},ErrorAlerter:function(){return o.KN},ErrorApiForwarder:function(){return o.gr},FetchMiddlewares:function(){return f.I},GithubAuth:function(){return r.GithubAuth},GitlabAuth:function(){return r.GitlabAuth},GoogleAuth:function(){return r.GoogleAuth},LocalStorageFeatureFlags:function(){return c.b},MicrosoftAuth:function(){return r.MicrosoftAuth},NoOpAnalyticsApi:function(){return l.g},OAuthRequestManager:function(){return y.Y},OktaAuth:function(){return r.OktaAuth},OneLoginAuth:function(){return r.OneLoginAuth},UnhandledErrorForwarder:function(){return o.Jv},UrlPatternDiscovery:function(){return m.p},WebStorage:function(){return p.C},createFetchApi:function(){return f.j}});var r=e(91668);e.o(r,"AlertApiForwarder")&&e.d(s,{AlertApiForwarder:function(){return r.AlertApiForwarder}}),e.o(r,"AppThemeSelector")&&e.d(s,{AppThemeSelector:function(){return r.AppThemeSelector}}),e.o(r,"BitbucketAuth")&&e.d(s,{BitbucketAuth:function(){return r.BitbucketAuth}}),e.o(r,"ConfigReader")&&e.d(s,{ConfigReader:function(){return r.ConfigReader}}),e.o(r,"ErrorAlerter")&&e.d(s,{ErrorAlerter:function(){return r.ErrorAlerter}}),e.o(r,"ErrorApiForwarder")&&e.d(s,{ErrorApiForwarder:function(){return r.ErrorApiForwarder}}),e.o(r,"FetchMiddlewares")&&e.d(s,{FetchMiddlewares:function(){return r.FetchMiddlewares}}),e.o(r,"FlatRoutes")&&e.d(s,{FlatRoutes:function(){return r.FlatRoutes}}),e.o(r,"LocalStorageFeatureFlags")&&e.d(s,{LocalStorageFeatureFlags:function(){return r.LocalStorageFeatureFlags}}),e.o(r,"NoOpAnalyticsApi")&&e.d(s,{NoOpAnalyticsApi:function(){return r.NoOpAnalyticsApi}}),e.o(r,"OAuthRequestManager")&&e.d(s,{OAuthRequestManager:function(){return r.OAuthRequestManager}}),e.o(r,"UnhandledErrorForwarder")&&e.d(s,{UnhandledErrorForwarder:function(){return r.UnhandledErrorForwarder}}),e.o(r,"UrlPatternDiscovery")&&e.d(s,{UrlPatternDiscovery:function(){return r.UrlPatternDiscovery}}),e.o(r,"WebStorage")&&e.d(s,{WebStorage:function(){return r.WebStorage}}),e.o(r,"createFetchApi")&&e.d(s,{createFetchApi:function(){return r.createFetchApi}}),e.o(r,"createSpecializedApp")&&e.d(s,{createSpecializedApp:function(){return r.createSpecializedApp}}),e.o(r,"defaultConfigLoader")&&e.d(s,{defaultConfigLoader:function(){return r.defaultConfigLoader}});var t=e(23235),l=e(47150),u=e(58652),A=e(14721),m=e(4333),o=e(89536),c=e(14884),f=e(50160),y=e(11358),p=e(56054)},56494:function(ee,s,e){"use strict";e.d(s,{AlertApiForwarder:function(){return t.AlertApiForwarder},ApiProvider:function(){return r.ApiProvider},AppThemeSelector:function(){return t.AppThemeSelector},ConfigReader:function(){return t.ConfigReader},ErrorAlerter:function(){return t.ErrorAlerter},ErrorApiForwarder:function(){return t.ErrorApiForwarder},FetchMiddlewares:function(){return t.FetchMiddlewares},LocalStorageFeatureFlags:function(){return t.LocalStorageFeatureFlags},NoOpAnalyticsApi:function(){return t.NoOpAnalyticsApi},OAuthRequestManager:function(){return t.OAuthRequestManager},UnhandledErrorForwarder:function(){return t.UnhandledErrorForwarder},UrlPatternDiscovery:function(){return t.UrlPatternDiscovery},WebStorage:function(){return t.WebStorage},createFetchApi:function(){return t.createFetchApi}});var r=e(76105);e.o(r,"AlertApiForwarder")&&e.d(s,{AlertApiForwarder:function(){return r.AlertApiForwarder}}),e.o(r,"AppThemeSelector")&&e.d(s,{AppThemeSelector:function(){return r.AppThemeSelector}}),e.o(r,"AtlassianAuth")&&e.d(s,{AtlassianAuth:function(){return r.AtlassianAuth}}),e.o(r,"BitbucketAuth")&&e.d(s,{BitbucketAuth:function(){return r.BitbucketAuth}}),e.o(r,"ConfigReader")&&e.d(s,{ConfigReader:function(){return r.ConfigReader}}),e.o(r,"ErrorAlerter")&&e.d(s,{ErrorAlerter:function(){return r.ErrorAlerter}}),e.o(r,"ErrorApiForwarder")&&e.d(s,{ErrorApiForwarder:function(){return r.ErrorApiForwarder}}),e.o(r,"FetchMiddlewares")&&e.d(s,{FetchMiddlewares:function(){return r.FetchMiddlewares}}),e.o(r,"FlatRoutes")&&e.d(s,{FlatRoutes:function(){return r.FlatRoutes}}),e.o(r,"GithubAuth")&&e.d(s,{GithubAuth:function(){return r.GithubAuth}}),e.o(r,"GitlabAuth")&&e.d(s,{GitlabAuth:function(){return r.GitlabAuth}}),e.o(r,"GoogleAuth")&&e.d(s,{GoogleAuth:function(){return r.GoogleAuth}}),e.o(r,"LocalStorageFeatureFlags")&&e.d(s,{LocalStorageFeatureFlags:function(){return r.LocalStorageFeatureFlags}}),e.o(r,"MicrosoftAuth")&&e.d(s,{MicrosoftAuth:function(){return r.MicrosoftAuth}}),e.o(r,"NoOpAnalyticsApi")&&e.d(s,{NoOpAnalyticsApi:function(){return r.NoOpAnalyticsApi}}),e.o(r,"OAuthRequestManager")&&e.d(s,{OAuthRequestManager:function(){return r.OAuthRequestManager}}),e.o(r,"OktaAuth")&&e.d(s,{OktaAuth:function(){return r.OktaAuth}}),e.o(r,"OneLoginAuth")&&e.d(s,{OneLoginAuth:function(){return r.OneLoginAuth}}),e.o(r,"UnhandledErrorForwarder")&&e.d(s,{UnhandledErrorForwarder:function(){return r.UnhandledErrorForwarder}}),e.o(r,"UrlPatternDiscovery")&&e.d(s,{UrlPatternDiscovery:function(){return r.UrlPatternDiscovery}}),e.o(r,"WebStorage")&&e.d(s,{WebStorage:function(){return r.WebStorage}}),e.o(r,"createFetchApi")&&e.d(s,{createFetchApi:function(){return r.createFetchApi}}),e.o(r,"createSpecializedApp")&&e.d(s,{createSpecializedApp:function(){return r.createSpecializedApp}}),e.o(r,"defaultConfigLoader")&&e.d(s,{defaultConfigLoader:function(){return r.defaultConfigLoader}});var t=e(91631);e.o(t,"AtlassianAuth")&&e.d(s,{AtlassianAuth:function(){return t.AtlassianAuth}}),e.o(t,"BitbucketAuth")&&e.d(s,{BitbucketAuth:function(){return t.BitbucketAuth}}),e.o(t,"FlatRoutes")&&e.d(s,{FlatRoutes:function(){return t.FlatRoutes}}),e.o(t,"GithubAuth")&&e.d(s,{GithubAuth:function(){return t.GithubAuth}}),e.o(t,"GitlabAuth")&&e.d(s,{GitlabAuth:function(){return t.GitlabAuth}}),e.o(t,"GoogleAuth")&&e.d(s,{GoogleAuth:function(){return t.GoogleAuth}}),e.o(t,"MicrosoftAuth")&&e.d(s,{MicrosoftAuth:function(){return t.MicrosoftAuth}}),e.o(t,"OktaAuth")&&e.d(s,{OktaAuth:function(){return t.OktaAuth}}),e.o(t,"OneLoginAuth")&&e.d(s,{OneLoginAuth:function(){return t.OneLoginAuth}}),e.o(t,"createSpecializedApp")&&e.d(s,{createSpecializedApp:function(){return t.createSpecializedApp}}),e.o(t,"defaultConfigLoader")&&e.d(s,{defaultConfigLoader:function(){return t.defaultConfigLoader}})},80396:function(ee,s,e){"use strict";e.d(s,{p:function(){return t}});var r;(function(l){l[l.default=10]="default";const u=50;l[l.app=u]="app",l[l.static=100]="static"})(r||(r={}));class t{constructor(){q(this,"factories",new Map)}register(u,A){const m=r[u],o=this.factories.get(A.api.id);return o&&o.priority>=m?!1:(this.factories.set(A.api.id,{priority:m,factory:A}),!0)}get(u){const A=this.factories.get(u.id);if(!!A)return A.factory}getAllApis(){const u=new Set;for(const{factory:A}of this.factories.values())u.add(A.api);return u}}},14406:function(ee,s,e){"use strict";e.d(s,{g:function(){return o}});var r=e(2784),t=e(13980),l=e.n(t);class u{constructor(...f){q(this,"holders");this.holders=f}get(f){for(const y of this.holders){const p=y.get(f);if(p)return p}}}var A=e(76241);const m=(0,A.CT)("api-context"),o=c=>{var T;const{apis:f,children:y}=c,p=(T=(0,r.useContext)(m))==null?void 0:T.atVersion(1),E=p?new u(f,p):f;return r.createElement(m.Provider,{value:(0,A.EI)({1:E}),children:y})};o.propTypes={apis:l().shape({get:l().func.isRequired}).isRequired,children:l().node}},12132:function(ee,s,e){"use strict";e.d(s,{M:function(){return r}});class r{constructor(l){q(this,"apis",new Map);this.factories=l}static validateFactories(l,u){for(const A of u){const m=[A],o=new Set;for(;m.length;){const c=m.shift(),f=l.get(c);if(!!f)for(const y of Object.values(f.deps)){if(y.id===A.id)throw new Error(`Circular dependency of api factory for ${A}`);o.has(y)||(o.add(y),m.push(y))}}}}get(l){return this.load(l)}load(l,u=[]){const A=this.apis.get(l.id);if(A)return A;const m=this.factories.get(l);if(!m)return;if(u.includes(m.api))throw new Error(`Circular dependency of api factory for ${m.api}`);const o=this.loadDeps(l,m.deps,[...u,m.api]),c=m.factory(o);return this.apis.set(l.id,c),c}loadDeps(l,u,A){const m={};for(const o in u)if(u.hasOwnProperty(o)){const c=u[o],f=this.load(c,A);if(!f)throw new Error(`No API factory available for dependency ${c} of dependent ${l}`);m[o]=f}return m}}},76105:function(ee,s,e){"use strict";e.d(s,{ApiFactoryRegistry:function(){return l.p},ApiProvider:function(){return r.g},ApiResolver:function(){return t.M}});var r=e(14406),t=e(12132),l=e(80396),u=e(82488),A=e.n(u);e.o(u,"AlertApiForwarder")&&e.d(s,{AlertApiForwarder:function(){return u.AlertApiForwarder}}),e.o(u,"AppThemeSelector")&&e.d(s,{AppThemeSelector:function(){return u.AppThemeSelector}}),e.o(u,"AtlassianAuth")&&e.d(s,{AtlassianAuth:function(){return u.AtlassianAuth}}),e.o(u,"BitbucketAuth")&&e.d(s,{BitbucketAuth:function(){return u.BitbucketAuth}}),e.o(u,"ConfigReader")&&e.d(s,{ConfigReader:function(){return u.ConfigReader}}),e.o(u,"ErrorAlerter")&&e.d(s,{ErrorAlerter:function(){return u.ErrorAlerter}}),e.o(u,"ErrorApiForwarder")&&e.d(s,{ErrorApiForwarder:function(){return u.ErrorApiForwarder}}),e.o(u,"FetchMiddlewares")&&e.d(s,{FetchMiddlewares:function(){return u.FetchMiddlewares}}),e.o(u,"FlatRoutes")&&e.d(s,{FlatRoutes:function(){return u.FlatRoutes}}),e.o(u,"GithubAuth")&&e.d(s,{GithubAuth:function(){return u.GithubAuth}}),e.o(u,"GitlabAuth")&&e.d(s,{GitlabAuth:function(){return u.GitlabAuth}}),e.o(u,"GoogleAuth")&&e.d(s,{GoogleAuth:function(){return u.GoogleAuth}}),e.o(u,"LocalStorageFeatureFlags")&&e.d(s,{LocalStorageFeatureFlags:function(){return u.LocalStorageFeatureFlags}}),e.o(u,"MicrosoftAuth")&&e.d(s,{MicrosoftAuth:function(){return u.MicrosoftAuth}}),e.o(u,"NoOpAnalyticsApi")&&e.d(s,{NoOpAnalyticsApi:function(){return u.NoOpAnalyticsApi}}),e.o(u,"OAuthRequestManager")&&e.d(s,{OAuthRequestManager:function(){return u.OAuthRequestManager}}),e.o(u,"OktaAuth")&&e.d(s,{OktaAuth:function(){return u.OktaAuth}}),e.o(u,"OneLoginAuth")&&e.d(s,{OneLoginAuth:function(){return u.OneLoginAuth}}),e.o(u,"UnhandledErrorForwarder")&&e.d(s,{UnhandledErrorForwarder:function(){return u.UnhandledErrorForwarder}}),e.o(u,"UrlPatternDiscovery")&&e.d(s,{UrlPatternDiscovery:function(){return u.UrlPatternDiscovery}}),e.o(u,"WebStorage")&&e.d(s,{WebStorage:function(){return u.WebStorage}}),e.o(u,"createFetchApi")&&e.d(s,{createFetchApi:function(){return u.createFetchApi}}),e.o(u,"createSpecializedApp")&&e.d(s,{createSpecializedApp:function(){return u.createSpecializedApp}}),e.o(u,"defaultConfigLoader")&&e.d(s,{defaultConfigLoader:function(){return u.defaultConfigLoader}})},82488:function(){},82370:function(ee,s,e){"use strict";e.d(s,{b:function(){return ct}});var r=e(2784),t=e(10289),l=e(64279),u=e(56494),A=e(36964),m=e(76105);function o(X){const Z={};for(const se in X.collectors)X.collectors.hasOwnProperty(se)&&(Z[se]=X.collectors[se]());const Q=[{node:r.Children.toArray(X.root),parent:void 0,contexts:{}}];for(;Q.length!==0;){const{node:se,parent:le,contexts:be}=Q.shift();r.Children.forEach(se,Oe=>{if(!(0,r.isValidElement)(Oe))return;const Ae={};for(const ke in Z)if(Z.hasOwnProperty(ke)){const We=Z[ke];Ae[ke]=We.visit(We.accumulator,Oe,le,be[ke])}for(const ke of X.discoverers){const We=ke(Oe);We&&Q.push({node:We,parent:Oe,contexts:Ae})}})}return Object.fromEntries(Object.entries(Z).map(([se,le])=>[se,le.accumulator]))}function c(X,Z){return()=>({accumulator:X(),visit:Z})}function f(X){var Z;return(Z=X.props)==null?void 0:Z.children}function y(X){var Z,Q,se;if(((Z=X.props)==null?void 0:Z.path)&&((Q=X.props)==null?void 0:Q.element))return(se=X.props)==null?void 0:se.element}const p=c(()=>new Set,(X,Z)=>{const Q=(0,A.getComponentData)(Z,"core.plugin");Q&&X.add(Q)});var E=e(88934);const T={caseSensitive:!1,path:"/*",element:"match-all",routeRefs:new Set},I=c(()=>({paths:new Map,parents:new Map,objects:new Array}),(X,Z,Q,se)=>{var Lt,Rt,Nt,Zt,vt;if((Q==null?void 0:Q.props.element)===Z)return se;let le=se==null?void 0:se.obj,be=se==null?void 0:se.routeRef,Oe=se==null?void 0:se.sticky;const Ae=(Lt=Z.props)==null?void 0:Lt.path,ke=(Rt=le==null?void 0:le.children)!=null?Rt:X.objects,We=Boolean((Nt=Z.props)==null?void 0:Nt.caseSensitive);let gt=se==null?void 0:se.path;if((0,A.getComponentData)(Z,"core.gatherMountPoints")){if(!Ae)throw new Error("Mount point gatherer must have a path");gt=Ae}const It=(Zt=Z.props)==null?void 0:Zt.element;let lt=(0,A.getComponentData)(Z,"core.mountPoint");if(!lt&&(0,r.isValidElement)(It)&&(lt=(0,A.getComponentData)(It,"core.mountPoint")),lt){let at=Ae;if(gt&&(at?gt=void 0:at=gt),!at)throw new Error("Mounted routable extension must have a path");X.paths.set(lt,at),be&&Oe?(X.parents.set(lt,be),Ae&&(be=lt,Oe=!1)):(X.parents.set(lt,be),be=lt),Ae?(le={caseSensitive:We,path:Ae,element:"mounted",routeRefs:new Set([lt]),children:[T],plugin:(0,A.getComponentData)(Z.props.element,"core.plugin")},ke.push(le)):le==null||le.routeRefs.add(lt)}if((0,A.getComponentData)(Z,"core.gatherMountPoints")&&(Oe=!0),(0,A.getComponentData)(Z,"core.gatherMountPoints")){if(!Ae)throw new Error("Mount point gatherer must have a path");lt||(le={caseSensitive:We,path:Ae,element:"gathered",routeRefs:new Set,children:[T],plugin:(vt=se==null?void 0:se.obj)==null?void 0:vt.plugin},ke.push(le))}return{obj:le,path:gt,routeRef:be,sticky:Oe}}),B=c(()=>new Set,(X,Z)=>{if(Z.type===E.L){const Q=Z.props;X.add("with"in Q?Q.with:Q.without)}});var j=e(76241);const M=(0,j.uW)("route-ref-type",()=>Symbol("route-ref-type"));function b(X){return X[M]==="absolute"}function L(X){return X[M]==="sub"}function D(X){return X[M]==="external"}function U(...X){const Z=X.join("/").replace(/\/\/+/g,"/");return Z!=="/"&&Z.endsWith("/")?Z.slice(0,-1):Z}function Y(X,Z,Q){let se,le="";if(b(X))se=X;else if(L(X))se=X.parent,le=X.path;else if(D(X)){const Ae=Q.get(X);if(!Ae)return[void 0,""];if(b(Ae))se=Ae;else if(L(Ae))se=Ae.parent,le=Ae.path;else throw new Error(`ExternalRouteRef was bound to invalid target, ${Ae}`)}else throw X[M]?new Error(`Unknown or invalid route ref type, ${X[M]}`):new Error(`Unknown object passed to useRouteRef, got ${X}`);if(!se)return[void 0,""];const be=Z.get(se);if(!be)return[void 0,""];const Oe=U(be,le);return[se,Oe]}function te(X,Z,Q,se,le){var gt;const be=(gt=(0,t.fp)(le,Z))!=null?gt:[],Oe=Array();let Ae=-1;for(let It=X;It&&(Ae=be.findIndex(lt=>lt.route.routeRefs.has(It)),Ae===-1);It=se.get(It))Oe.unshift(It);Oe.length===0&&(Ae-=1);const ke=Ae===-1?"":be[Ae].pathname,We=U(...Oe.slice(0,-1).map(It=>{const lt=Q.get(It);if(!lt)throw new Error(`No path for ${It}`);if(lt.includes(":"))throw new Error(`Cannot route to ${X} with parent ${It} as it has parameters`);return lt}));return ke+We}class ue{constructor(Z,Q,se,le,be){this.routePaths=Z,this.routeParents=Q,this.routeObjects=se,this.routeBindings=le,this.appBasePath=be}resolve(Z,Q){const[se,le]=Y(Z,this.routePaths,this.routeBindings);if(!se)return;let be;typeof Q=="string"?be=this.trimPath(Q):Q.pathname?be={...Q,pathname:this.trimPath(Q.pathname)}:be=Q;const Oe=this.appBasePath+te(se,be,this.routePaths,this.routeParents,this.routeObjects);return(...[ke])=>Oe+(0,t.Gn)(le,ke)}trimPath(Z){return Z&&(Z.startsWith(this.appBasePath)?Z.slice(this.appBasePath.length):Z)}}const Re=(0,j.CT)("routing-context"),we=({routePaths:X,routeParents:Z,routeObjects:Q,routeBindings:se,basePath:le="",children:be})=>{const Oe=new ue(X,Z,Q,se,le),Ae=(0,j.EI)({1:Oe});return r.createElement(Re.Provider,{value:Ae},be)},ge=(X,Z)=>{var Q,se;try{const le=(0,t.fp)(Z,{pathname:X}),be=(Q=le==null?void 0:le.filter(Ae=>{var ke;return((ke=Ae==null?void 0:Ae.route.routeRefs)==null?void 0:ke.size)>0}).pop())==null?void 0:Q.route;if(!be)return{};let Oe;return be.routeRefs.size===1&&(Oe=be.routeRefs.values().next().value),{extension:"App",pluginId:((se=be.plugin)==null?void 0:se.getId())||"root",...Oe?{routeRef:Oe.id}:{}}}catch{return{}}},ze=({pathname:X,search:Z,hash:Q})=>{const se=(0,A.useAnalytics)();return(0,r.useEffect)(()=>{se.captureEvent("navigate",`${X}${Z}${Q}`)},[se,X,Z,Q]),null},_e=({routeObjects:X})=>{const{pathname:Z,search:Q,hash:se}=(0,t.TH)();return r.createElement(A.AnalyticsContext,{attributes:ge(Z,X)},r.createElement(ze,{pathname:Z,search:Q,hash:se}))};function et(X,Z){const Q=new Set(Z.values());Q.delete(void 0);for(const se of Z.keys()){if(Q.has(se))continue;let le=se,be="";for(;le;){const Ae=X.get(le);if(!Ae)throw new Error(`No path for ${le}`);be=`${Ae}${be}`,le=Z.get(le)}const Oe=be.match(/:(\w+)/g);if(Oe){for(let Ae=0;Ae<Oe.length;Ae++)for(let ke=Ae+1;ke<Oe.length;ke++)if(Oe[ke]===Oe[Ae])throw new Error(`Parameter ${Oe[ke]} is duplicated in path ${be}`)}}}function st(X,Z){for(const Q of Z)if(!!Q.externalRoutes){for(const[se,le]of Object.entries(Q.externalRoutes))if(!le.optional&&!X.has(le))throw new Error(`External route '${se}' of the '${Q.getId()}' plugin must be bound to a target route. See https://backstage.io/link?bind-routes for details.`)}}const Ct=(0,j.CT)("app-context"),yt=({appContext:X,children:Z})=>{const Q=(0,j.EI)({1:X});return r.createElement(Ct.Provider,{value:Q,children:Z})};function Pe(X){return new Error(`Tried to access IdentityApi ${X} before app was loaded`)}function ht(X){console.warn(`WARNING: Call to ${X} is deprecated and will break in the future`)}class Ve{constructor(){q(this,"target");q(this,"waitForTarget");q(this,"resolveTarget",()=>{});q(this,"signOutTargetUrl","/");this.waitForTarget=new Promise(Z=>{this.resolveTarget=Z})}setTarget(Z,Q){this.target=Z,this.signOutTargetUrl=Q.signOutTargetUrl,this.resolveTarget(Z)}getUserId(){if(!this.target)throw Pe("getUserId");if(!this.target.getUserId)throw new Error("IdentityApi does not implement getUserId");return ht("getUserId"),this.target.getUserId()}getProfile(){if(!this.target)throw Pe("getProfile");if(!this.target.getProfile)throw new Error("IdentityApi does not implement getProfile");return ht("getProfile"),this.target.getProfile()}async getProfileInfo(){return this.waitForTarget.then(Z=>Z.getProfileInfo())}async getBackstageIdentity(){const Z=await this.waitForTarget.then(Q=>Q.getBackstageIdentity());return Z.userEntityRef.match(/^.*:.*\/.*$/)||console.warn(`WARNING: The App IdentityApi provided an invalid userEntityRef, '${Z.userEntityRef}'. It must be a full Entity Reference of the form '<kind>:<namespace>/<name>'.`),Z}async getCredentials(){return this.waitForTarget.then(Z=>Z.getCredentials())}async getIdToken(){return this.waitForTarget.then(Z=>{if(!Z.getIdToken)throw new Error("IdentityApi does not implement getIdToken");return ht("getIdToken"),Z.getIdToken()})}async signOut(){await this.waitForTarget.then(Z=>Z.signOut()),location.href=this.signOutTargetUrl}}var ie=e(72164);function de(X,Z,Q){if(X!==void 0){const le=Q.find(be=>be.id===X);if(le)return le}if(Z){const le=Q.find(be=>be.variant==="dark");if(le)return le}const se=Q.find(le=>le.variant==="light");return se||Q[0]}const Ue=()=>{const X=(0,r.useMemo)(()=>window.matchMedia("(prefers-color-scheme: dark)"),[]),[Z,Q]=(0,r.useState)(X.matches);return(0,r.useEffect)(()=>{const se=le=>{Q(le.matches)};return X.addListener(se),()=>{X.removeListener(se)}},[X]),Z};function Be({children:X}){const Z=(0,A.useApi)(A.appThemeApiRef),Q=(0,ie.Z)(Z.activeThemeId$(),Z.getActiveThemeId()),se=Boolean(window.matchMedia)?Ue():!1,le=de(Q,se,Z.getInstalledThemes());if(!le)throw new Error("App has no themes");return r.createElement(le.Provider,{children:X})}var Xe=e(46611);class mt{constructor(){q(this,"apis",[])}add(Z,Q){return this.apis.push([Z.id,Q]),Q}build(){return new Ye(new Map(this.apis))}}class Ye{static builder(){return new mt}static from(Z){return new Ye(new Map(Z.map(([Q,se])=>[Q.id,se])))}static with(Z,Q){return new Ye(new Map([[Z.id,Q]]))}constructor(Z){this.apis=Z}with(Z,Q){return new Ye(new Map([...this.apis,[Z.id,Q]]))}get(Z){return this.apis.get(Z.id)}}function Et(X){const Z=new Map;return X&&X({bind:(se,le)=>{for(const[be,Oe]of Object.entries(le)){const Ae=se[be];if(!Ae)throw new Error(`Key ${be} is not an existing external route`);if(!Oe&&!Ae.optional)throw new Error(`External route ${be} is required but was undefined`);Oe&&Z.set(Ae,Oe)}}}),Z}const oe=(0,r.createContext)({routeObjects:[]});function fe(X){var Q;let{pathname:Z}=new URL((Q=X.getOptionalString("app.baseUrl"))!=null?Q:"/","http://dummy.dev");return Z=Z.replace(/\/*$/,""),Z}function tt(X,Z,Q){var ke;const se=Boolean(X),le=(0,l.default)(X||(()=>Promise.resolve([])));let be;if(se&&le.loading){const{Progress:We}=Z;be=r.createElement(We,null)}else if(le.error){const{BootErrorPage:We}=Z;be=r.createElement(We,{step:"load-config",error:le.error})}const{ThemeProvider:Oe=Be}=Z;return be?{node:r.createElement(u.ApiProvider,{apis:Ye.with(A.appThemeApiRef,Q)},r.createElement(Oe,null,be))}:{api:u.ConfigReader.fromConfigs((ke=le.value)!=null?ke:[])}}class Ke{constructor(Z){this.app=Z}getPlugins(){return this.app.getPlugins()}getSystemIcon(Z){return this.app.getSystemIcon(Z)}getComponents(){return this.app.getComponents()}}class Ne{constructor(Z){q(this,"apiHolder");q(this,"configApi");q(this,"apis");q(this,"icons");q(this,"plugins");q(this,"components");q(this,"themes");q(this,"configLoader");q(this,"defaultApis");q(this,"bindRoutes");q(this,"appIdentityProxy",new Ve);q(this,"apiFactoryRegistry");var Q,se,le,be;this.apis=(Q=Z.apis)!=null?Q:[],this.icons=Z.icons,this.plugins=new Set((se=Z.plugins)!=null?se:[]),this.components=Z.components,this.themes=Z.themes,this.configLoader=(le=Z.configLoader)!=null?le:Xe.t,this.defaultApis=(be=Z.defaultApis)!=null?be:[],this.bindRoutes=Z.bindRoutes,this.apiFactoryRegistry=new m.ApiFactoryRegistry}getPlugins(){return Array.from(this.plugins)}getSystemIcon(Z){return this.icons[Z]}getComponents(){return this.components}getProvider(){const Z=new Ke(this);let Q=!1;return({children:le})=>{const be=(0,r.useMemo)(()=>u.AppThemeSelector.createWithStorage(this.themes),[]),{routing:Oe,featureFlags:Ae,routeBindings:ke}=(0,r.useMemo)(()=>{const lt=o({root:le,discoverers:[f,y],collectors:{routing:I,collectedPlugins:p,featureFlags:B}});return lt.collectedPlugins.forEach(Tt=>this.plugins.add(Tt)),this.verifyPlugins(this.plugins),this.getApiHolder(),{...lt,routeBindings:Et(this.bindRoutes)}},[le]);Q||(Q=!0,et(Oe.paths,Oe.parents),st(ke,this.plugins));const We=tt(this.configLoader,this.components,be),gt="api"in We;if(gt){const{api:lt}=We;this.configApi=lt}if((0,r.useEffect)(()=>{if(gt){const lt=this.getApiHolder().get(A.featureFlagsApiRef);for(const Tt of this.plugins.values())if("getFeatureFlags"in Tt)for(const Lt of Tt.getFeatureFlags())lt.registerFlag({name:Lt.name,pluginId:Tt.getId()});else for(const Lt of Tt.output())Lt.type==="feature-flag"&<.registerFlag({name:Lt.name,pluginId:Tt.getId()});for(const Tt of Ae)lt.registerFlag({name:Tt,pluginId:""})}},[gt,We,Ae]),"node"in We)return We.node;const{ThemeProvider:It=Be}=this.components;return r.createElement(u.ApiProvider,{apis:this.getApiHolder()},r.createElement(yt,{appContext:Z},r.createElement(It,null,r.createElement(we,{routePaths:Oe.paths,routeParents:Oe.parents,routeObjects:Oe.objects,routeBindings:ke,basePath:fe(We.api)},r.createElement(oe.Provider,{value:{routeObjects:Oe.objects}},le)))))}}getRouter(){const{Router:Z,SignInPage:Q}=this.components,se=({component:be,children:Oe})=>{const[Ae,ke]=(0,r.useState)(),We=(0,A.useApi)(A.configApiRef),gt=fe(We);return Ae?(this.appIdentityProxy.setTarget(Ae,{signOutTargetUrl:gt||"/"}),Oe):r.createElement(be,{onSignInSuccess:ke})};return({children:be})=>{const Oe=(0,A.useApi)(A.configApiRef),Ae=fe(Oe),ke=`${Ae}/*`,{routeObjects:We}=(0,r.useContext)(oe);return Q?r.createElement(Z,null,r.createElement(_e,{routeObjects:We}),r.createElement(se,{component:Q},r.createElement(t.Z5,null,r.createElement(t.AW,{path:ke,element:r.createElement(r.Fragment,null,be)})))):(this.appIdentityProxy.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:Ae||"/"}),r.createElement(Z,null,r.createElement(_e,{routeObjects:We}),r.createElement(t.Z5,null,r.createElement(t.AW,{path:ke,element:r.createElement(r.Fragment,null,be)}))))}}getApiHolder(){if(this.apiHolder){for(const Z of this.plugins)for(const Q of Z.getApis())this.apiFactoryRegistry.get(Q.api)||this.apiFactoryRegistry.register("default",Q);return m.ApiResolver.validateFactories(this.apiFactoryRegistry,this.apiFactoryRegistry.getAllApis()),this.apiHolder}this.apiFactoryRegistry.register("static",{api:A.appThemeApiRef,deps:{},factory:()=>u.AppThemeSelector.createWithStorage(this.themes)}),this.apiFactoryRegistry.register("static",{api:A.configApiRef,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:A.identityApiRef,deps:{},factory:()=>this.appIdentityProxy}),this.apiFactoryRegistry.register("default",{api:A.featureFlagsApiRef,deps:{},factory:()=>new u.LocalStorageFeatureFlags});for(const Z of this.defaultApis)this.apiFactoryRegistry.register("default",Z);for(const Z of this.plugins)for(const Q of Z.getApis())if(!this.apiFactoryRegistry.register("default",Q))throw new Error(`Plugin ${Z.getId()} tried to register duplicate or forbidden API factory for ${Q.api}`);for(const Z of this.apis)if(!this.apiFactoryRegistry.register("app",Z))throw new Error(`Duplicate or forbidden API factory for ${Z.api} in app`);return m.ApiResolver.validateFactories(this.apiFactoryRegistry,this.apiFactoryRegistry.getAllApis()),this.apiHolder=new m.ApiResolver(this.apiFactoryRegistry),this.apiHolder}verifyPlugins(Z){const Q=new Set;for(const se of Z){const le=se.getId();if(Q.has(le))throw new Error(`Duplicate plugin found '${le}'`);Q.add(le)}}}function ct(X){return new Ne(X)}},46611:function(ee,s,e){"use strict";e.d(s,{t:function(){return r}});const r=async(t="__APP_INJECTED_RUNTIME_CONFIG__")=>{const l=[{context:"app-config.yaml",data:{app:{title:"Techdocs Preview App",baseUrl:"http://localhost:3000"},backend:{baseUrl:"http://localhost:3000"},techdocs:{builder:"external"}}}];if(!l)throw new Error("No static configuration provided");if(!Array.isArray(l))throw new Error("Static configuration has invalid format");const u=l.slice();if(t!=="__app_injected_runtime_config__".toLocaleUpperCase("en-US"))try{const m=JSON.parse(t);Array.isArray(m)?u.push(...m):u.push({data:m,context:"env"})}catch(m){throw new Error(`Failed to load runtime configuration, ${m}`)}const A=window.__APP_CONFIG__;return A&&u.push({context:"window",data:A}),u}},44056:function(ee,s,e){"use strict";e.d(s,{createSpecializedApp:function(){return r.b},defaultConfigLoader:function(){return t.t}});var r=e(82370),t=e(46611),l=e(73495),u=e.n(l);e.o(l,"AtlassianAuth")&&e.d(s,{AtlassianAuth:function(){return l.AtlassianAuth}}),e.o(l,"BitbucketAuth")&&e.d(s,{BitbucketAuth:function(){return l.BitbucketAuth}}),e.o(l,"FlatRoutes")&&e.d(s,{FlatRoutes:function(){return l.FlatRoutes}}),e.o(l,"GithubAuth")&&e.d(s,{GithubAuth:function(){return l.GithubAuth}}),e.o(l,"GitlabAuth")&&e.d(s,{GitlabAuth:function(){return l.GitlabAuth}}),e.o(l,"GoogleAuth")&&e.d(s,{GoogleAuth:function(){return l.GoogleAuth}}),e.o(l,"MicrosoftAuth")&&e.d(s,{MicrosoftAuth:function(){return l.MicrosoftAuth}}),e.o(l,"OktaAuth")&&e.d(s,{OktaAuth:function(){return l.OktaAuth}}),e.o(l,"OneLoginAuth")&&e.d(s,{OneLoginAuth:function(){return l.OneLoginAuth}})},73495:function(){},49208:function(ee,s,e){"use strict";e.d(s,{AlertApiForwarder:function(){return r.AlertApiForwarder},ErrorAlerter:function(){return r.ErrorAlerter},ErrorApiForwarder:function(){return r.ErrorApiForwarder},FetchMiddlewares:function(){return r.FetchMiddlewares},FlatRoutes:function(){return l.w},NoOpAnalyticsApi:function(){return r.NoOpAnalyticsApi},OAuthRequestManager:function(){return r.OAuthRequestManager},UnhandledErrorForwarder:function(){return r.UnhandledErrorForwarder},UrlPatternDiscovery:function(){return r.UrlPatternDiscovery},WebStorage:function(){return r.WebStorage},createFetchApi:function(){return r.createFetchApi},createSpecializedApp:function(){return t.createSpecializedApp},defaultConfigLoader:function(){return t.defaultConfigLoader}});var r=e(56494);e.o(r,"AtlassianAuth")&&e.d(s,{AtlassianAuth:function(){return r.AtlassianAuth}}),e.o(r,"BitbucketAuth")&&e.d(s,{BitbucketAuth:function(){return r.BitbucketAuth}}),e.o(r,"FlatRoutes")&&e.d(s,{FlatRoutes:function(){return r.FlatRoutes}}),e.o(r,"GithubAuth")&&e.d(s,{GithubAuth:function(){return r.GithubAuth}}),e.o(r,"GitlabAuth")&&e.d(s,{GitlabAuth:function(){return r.GitlabAuth}}),e.o(r,"GoogleAuth")&&e.d(s,{GoogleAuth:function(){return r.GoogleAuth}}),e.o(r,"MicrosoftAuth")&&e.d(s,{MicrosoftAuth:function(){return r.MicrosoftAuth}}),e.o(r,"OktaAuth")&&e.d(s,{OktaAuth:function(){return r.OktaAuth}}),e.o(r,"OneLoginAuth")&&e.d(s,{OneLoginAuth:function(){return r.OneLoginAuth}}),e.o(r,"createSpecializedApp")&&e.d(s,{createSpecializedApp:function(){return r.createSpecializedApp}}),e.o(r,"defaultConfigLoader")&&e.d(s,{defaultConfigLoader:function(){return r.defaultConfigLoader}});var t=e(44056);e.o(t,"AtlassianAuth")&&e.d(s,{AtlassianAuth:function(){return t.AtlassianAuth}}),e.o(t,"BitbucketAuth")&&e.d(s,{BitbucketAuth:function(){return t.BitbucketAuth}}),e.o(t,"FlatRoutes")&&e.d(s,{FlatRoutes:function(){return t.FlatRoutes}}),e.o(t,"GithubAuth")&&e.d(s,{GithubAuth:function(){return t.GithubAuth}}),e.o(t,"GitlabAuth")&&e.d(s,{GitlabAuth:function(){return t.GitlabAuth}}),e.o(t,"GoogleAuth")&&e.d(s,{GoogleAuth:function(){return t.GoogleAuth}}),e.o(t,"MicrosoftAuth")&&e.d(s,{MicrosoftAuth:function(){return t.MicrosoftAuth}}),e.o(t,"OktaAuth")&&e.d(s,{OktaAuth:function(){return t.OktaAuth}}),e.o(t,"OneLoginAuth")&&e.d(s,{OneLoginAuth:function(){return t.OneLoginAuth}});var l=e(63938)},57018:function(ee,s,e){"use strict";e.d(s,{RefreshingAuthSessionManager:function(){return m}});function r(c,f){for(const y of f)if(!c.has(y))return!1;return!0}class t{constructor(f){this.options=f}sessionExistsAndHasScope(f,y){if(!f)return!1;if(!y||this.options.sessionScopes===void 0)return!0;const p=this.options.sessionScopes(f);return r(p,y)}getExtendedScope(f,y){const p=new Set(this.options.defaultScopes);if(f&&this.options.sessionScopes!==void 0){const E=this.options.sessionScopes(f);for(const T of E)p.add(T)}if(y)for(const E of y)p.add(E);return p}}var l=e(98005),u=e(36964);class A{constructor(){q(this,"subject",new l.X(u.SessionState.SignedOut));q(this,"signedIn",!1)}setIsSignedIn(f){this.signedIn!==f&&(this.signedIn=f,this.subject.next(this.signedIn?u.SessionState.SignedIn:u.SessionState.SignedOut))}sessionState$(){return this.subject}}class m{constructor(f){q(this,"connector");q(this,"helper");q(this,"sessionScopesFunc");q(this,"sessionShouldRefreshFunc");q(this,"stateTracker",new A);q(this,"refreshPromise");q(this,"currentSession");const{connector:y,defaultScopes:p=new Set,sessionScopes:E,sessionShouldRefresh:T}=f;this.connector=y,this.sessionScopesFunc=E,this.sessionShouldRefreshFunc=T,this.helper=new t({sessionScopes:E,defaultScopes:p})}async getSession(f){if(this.helper.sessionExistsAndHasScope(this.currentSession,f.scopes)){if(!this.sessionShouldRefreshFunc(this.currentSession))return this.currentSession;try{const p=await this.collapsedSessionRefresh(),E=this.sessionScopesFunc(this.currentSession),T=this.sessionScopesFunc(p);return r(T,E)&&(this.currentSession=p),p}catch(p){if(f.optional)return;throw p}}if(!this.currentSession&&!f.instantPopup)try{const y=await this.collapsedSessionRefresh();return this.currentSession=y,this.getSession(f)}catch{}if(!f.optional)return this.currentSession=await this.connector.createSession({...f,scopes:this.helper.getExtendedScope(this.currentSession,f.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(){if(this.refreshPromise)return this.refreshPromise;this.refreshPromise=this.connector.refreshSession();try{const f=await this.refreshPromise;return this.stateTracker.setIsSignedIn(!0),f}finally{delete this.refreshPromise}}}class o{constructor(f){q(this,"connector");q(this,"helper");q(this,"stateTracker",new SessionStateTracker);q(this,"currentSession");const{connector:y,defaultScopes:p=new Set,sessionScopes:E}=f;this.connector=y,this.helper=new SessionScopeHelper({sessionScopes:E,defaultScopes:p})}setSession(f){this.currentSession=f,this.stateTracker.setIsSignedIn(Boolean(f))}async getSession(f){if(this.helper.sessionExistsAndHasScope(this.currentSession,f.scopes))return this.currentSession;if(!f.optional)return this.currentSession=await this.connector.createSession({...f,scopes:this.helper.getExtendedScope(this.currentSession,f.scopes)}),this.stateTracker.setIsSignedIn(!0),this.currentSession}async removeSession(){this.currentSession=void 0,this.stateTracker.setIsSignedIn(!1)}sessionState$(){return this.stateTracker.sessionState$()}}},98005:function(ee,s,e){"use strict";e.d(s,{J:function(){return l},X:function(){return u}});var r=e(82394),t=e.n(r);class l{constructor(){q(this,"isClosed",!1);q(this,"terminatingError");q(this,"observable",new(t())(m=>this.isClosed?(this.terminatingError?m.error(this.terminatingError):m.complete(),()=>{}):(this.subscribers.add(m),()=>{this.subscribers.delete(m)})));q(this,"subscribers",new Set)}[Symbol.observable](){return this}get closed(){return this.isClosed}next(m){if(this.isClosed)throw new Error("PublishSubject is closed");this.subscribers.forEach(o=>o.next(m))}error(m){if(this.isClosed)throw new Error("PublishSubject is closed");this.isClosed=!0,this.terminatingError=m,this.subscribers.forEach(o=>o.error(m))}complete(){if(this.isClosed)throw new Error("PublishSubject is closed");this.isClosed=!0,this.subscribers.forEach(m=>m.complete())}subscribe(m,o,c){const f=typeof m=="function"?{next:m,error:o,complete:c}:m;return this.observable.subscribe(f)}}class u{constructor(m){q(this,"isClosed");q(this,"currentValue");q(this,"terminatingError");q(this,"observable");q(this,"subscribers",new Set);this.isClosed=!1,this.currentValue=m,this.terminatingError=void 0,this.observable=new(t())(o=>this.isClosed?(this.terminatingError?o.error(this.terminatingError):o.complete(),()=>{}):(o.next(this.currentValue),this.subscribers.add(o),()=>{this.subscribers.delete(o)}))}[Symbol.observable](){return this}get closed(){return this.isClosed}next(m){if(this.isClosed)throw new Error("BehaviorSubject is closed");this.currentValue=m,this.subscribers.forEach(o=>o.next(m))}error(m){if(this.isClosed)throw new Error("BehaviorSubject is closed");this.isClosed=!0,this.terminatingError=m,this.subscribers.forEach(o=>o.error(m))}complete(){if(this.isClosed)throw new Error("BehaviorSubject is closed");this.isClosed=!0,this.subscribers.forEach(m=>m.complete())}subscribe(m,o,c){const f=typeof m=="function"?{next:m,error:o,complete:c}:m;return this.observable.subscribe(f)}}},88934:function(ee,s,e){"use strict";e.d(s,{L:function(){return l}});var r=e(36964),t=e(2784);const l=u=>{const{children:A}=u,m=(0,r.useApi)(r.featureFlagsApiRef),o="with"in u?m.isActive(u.with):!m.isActive(u.without);return t.createElement(t.Fragment,null,o?A:null)};(0,r.attachComponentData)(l,"core.featureFlagged",!0)},63938:function(ee,s,e){"use strict";e.d(s,{w:function(){return u}});var r=e(2784),t=e(10289),l=e(36964);const u=m=>{const o=(0,l.useApp)(),{NotFoundErrorPage:c}=o.getComponents(),f=(0,l.useElementFilter)(m.children,y=>y.getElements().flatMap(p=>{var T;let E=p.props.path;return E===""?[]:(E=(T=E==null?void 0:E.replace(/\/\*$/,""))!=null?T:"/",[{path:E,element:p,children:p.props.children?[{path:E==="/"?"/":"/*",element:p.props.children}]:void 0}])}).sort((p,E)=>E.path.localeCompare(p.path)).map(p=>(p.path=p.path==="/"?"/":`${p.path}/*`,p)));return f.push({element:r.createElement(c,null),path:"/*"}),(0,t.V$)(f)};var A=e(88934)},82339:function(ee,s,e){"use strict";e.d(s,{Button:function(){return D},CodeSnippet:function(){return et},Content:function(){return Xa},ContentHeader:function(){return ci},CreateButton:function(){return yt},DependencyGraph:function(){return Rt},DependencyGraphTypes:function(){return r},EmptyState:function(){return bt},ErrorPage:function(){return hi},ErrorPanel:function(){return cn},Header:function(){return so},HeaderIconLinkRow:function(){return bn},HeaderLabel:function(){return Ti},HeaderTabs:function(){return qa},InfoCard:function(){return Kn},ItemCardGrid:function(){return Di},ItemCardHeader:function(){return Li},Link:function(){return b},LogViewer:function(){return zr},MissingAnnotationEmptyState:function(){return un},OverflowTooltip:function(){return br},Page:function(){return lo},PageWithHeader:function(){return Mi},Progress:function(){return cr},ResponseErrorPanel:function(){return $t},RoutedTabs:function(){return _a},Select:function(){return je},Sidebar:function(){return as},SidebarDivider:function(){return vs},SidebarItem:function(){return Ja},SidebarPage:function(){return Go},SubvalueCell:function(){return Fs},SupportButton:function(){return zo},Table:function(){return ei},WarningPanel:function(){return tn},sidebarConfig:function(){return kn},useSidebarOpenState:function(){return la},useSidebarPinState:function(){return Br}});var r={};e.r(r),e.d(r,{Nm:function(){return Pe},ht:function(){return ie},LJ:function(){return Ve}});var t=e(2784),l=e(36964),u=e(19928);function A(n){const[a,i]=useState([]),d=useApi(alertApiRef),{anchorOrigin:g={vertical:"top",horizontal:"center"}}=n;if(useEffect(()=>{const N=d.alert$().subscribe(G=>i(H=>H.concat(G)));return()=>{N.unsubscribe()}},[d]),a.length===0)return null;const[v]=a,O=()=>{i(N=>N.filter(G=>G!==v))};return React.createElement(Snackbar,{open:!0,anchorOrigin:g},React.createElement(Alert,{action:React.createElement(IconButton,{color:"inherit",size:"small",onClick:O,"data-testid":"error-button-close"},React.createElement(CloseIcon,null)),severity:v.severity},React.createElement("span",null,v.message.toString(),a.length>1&&React.createElement("em",null,` (${a.length-1} older ${pluralize("message",a.length-1)})`))))}var m=e(79692),o=e(12420);const c=(0,m.Z)(n=>(0,o.Z)({avatar:{width:"4rem",height:"4rem",color:"#fff",fontWeight:n.typography.fontWeightBold,letterSpacing:"1px",textTransform:"uppercase"}}),{name:"BackstageAvatar"});function f(n){const{displayName:a,picture:i,customStyles:d}=n,g=c();let v={...d};return i||(v={backgroundColor:stringToColor(a||""),...d}),React.createElement(MaterialAvatar,{alt:a,src:i,className:g.avatar,style:v},a&&extractInitials(a))}var y=e(77277),p=e(72779),E=e.n(p),T=e(86689),I=e(62833);const B=(0,m.Z)({visuallyHidden:{clip:"rect(0 0 0 0)",clipPath:"inset(50%)",overflow:"hidden",position:"absolute",whiteSpace:"nowrap",height:1,width:1},externalLink:{position:"relative"}},{name:"Link"}),j=n=>/^([a-z+.-]+):/.test(n),M=n=>{var a;return n instanceof Array?n.map(M).join(" ").trim():typeof n=="object"&&n?M((a=n==null?void 0:n.props)==null?void 0:a.children):["string","number"].includes(typeof n)?String(n):""},b=t.forwardRef(({onClick:n,noTrack:a,...i},d)=>{const g=B(),v=(0,l.useAnalytics)(),O=String(i.to),N=M(i.children)||O,G=j(O),H=G&&!!/^https?:/.exec(O),ne=_=>{n==null||n(_),a||v.captureEvent("click",N,{attributes:{to:O}})};return G?t.createElement(T.Z,{ref:d,href:O,onClick:ne,...H?{target:"_blank",rel:"noopener"}:{},...i,className:E()(g.externalLink,i.className)},i.children,t.createElement("span",{className:g.visuallyHidden},", Opens in a new window")):t.createElement(T.Z,{ref:d,component:I.rU,onClick:ne,...i})}),L=t.forwardRef((n,a)=>t.createElement(b,{ref:a,...n,color:"initial"})),D=t.forwardRef((n,a)=>t.createElement(y.Z,{ref:a,component:L,...n}));var U=e(60364),Y=e(61837),te=e(80030),ue=e(19353),Re=e(95074);function we(n){const{text:a,tooltipDelay:i=1e3,tooltipText:d="Text copied to clipboard"}=n,g=(0,l.useApi)(l.errorApiRef),[v,O]=(0,t.useState)(!1),[{error:N},G]=(0,Re.Z)();(0,t.useEffect)(()=>{N&&g.post(N)},[N,g]);const H=ne=>{ne.stopPropagation(),O(!0),G(a)};return t.createElement(t.Fragment,null,t.createElement(te.ZP,{id:"copy-test-tooltip",title:d,placement:"top",leaveDelay:i,onClose:()=>O(!1),open:v},t.createElement(Y.Z,{onClick:H},t.createElement(ue.Z,null))))}var ge=e(83229),ze=e(26639),_e=e(39595);function et(n){const{text:a,language:i,showLineNumbers:d=!1,highlightedNumbers:g,customStyle:v,showCopyCodeButton:O=!1}=n,N=(0,U.Z)(),G=N.palette.type==="dark"?ze.Z:_e.Z,H=N.palette.type==="dark"?"#256bf3":"#e6ffed";return t.createElement("div",{style:{position:"relative"}},t.createElement(ge.Z,{customStyle:v,language:i,style:G,showLineNumbers:d,wrapLines:!0,lineNumberStyle:{color:N.palette.textVerySubtle},lineProps:ne=>g!=null&&g.includes(ne)?{style:{backgroundColor:H}}:{}},a),O&&t.createElement("div",{style:{position:"absolute",top:0,right:0}},t.createElement(we,{text:a})))}var st=e(41156),Ct=e(88188);function yt(n){const{title:a,to:i}=n,d=(0,st.Z)(g=>g.breakpoints.down("xs"));return i?d?t.createElement(Y.Z,{component:I.rU,color:"primary",title:a,size:"small",to:i},t.createElement(Ct.Z,null)):t.createElement(y.Z,{component:I.rU,variant:"contained",color:"primary",to:i},a):null}var Pe;(function(n){const a="TB";n.TOP_BOTTOM=a;const i="BT";n.BOTTOM_TOP=i;const d="LR";n.LEFT_RIGHT=d;const g="RL";n.RIGHT_LEFT=g})(Pe||(Pe={}));var ht;(function(n){const a="UL";n.UP_LEFT=a;const i="UR";n.UP_RIGHT=i;const d="DL";n.DOWN_LEFT=d;const g="DR";n.DOWN_RIGHT=g})(ht||(ht={}));var Ve;(function(n){const a="network-simplex";n.NETWORK_SIMPLEX=a;const i="tight-tree";n.TIGHT_TREE=i;const d="longest-path";n.LONGEST_PATH=d})(Ve||(Ve={}));var ie;(function(n){const a="l";n.LEFT=a;const i="r";n.RIGHT=i;const d="c";n.CENTER=d})(ie||(ie={}));var de=e(84945),Ue=e(11105),Be=e(97963),Xe=e(46506),mt=e.n(Xe),Ye=e(54073),Et=e.n(Ye),oe=e(10368);const fe=(0,m.Z)(n=>({node:{fill:n.palette.primary.light,stroke:n.palette.primary.light},text:{fill:n.palette.primary.contrastText}}),{name:"BackstageDependencyGraphDefaultNode"});function tt({node:{id:n}}){const a=fe(),[i,d]=t.useState(0),[g,v]=t.useState(0),O=t.useRef(null);t.useLayoutEffect(()=>{if(O.current){let{height:ne,width:_}=O.current.getBBox();ne=Math.round(ne),_=Math.round(_),(ne!==g||_!==i)&&(d(_),v(ne))}},[i,g]);const N=10,G=i+N*2,H=g+N*2;return t.createElement("g",null,t.createElement("rect",{className:a.node,width:G,height:H,rx:10}),t.createElement("text",{ref:O,className:a.text,y:H/2,x:G/2,textAnchor:"middle",alignmentBaseline:"middle"},n))}const Ke="arrow-marker",Ne="node",ct="edge",X="label",Z=(0,oe.Z)(n=>({node:{transition:`${n.transitions.duration.shortest}ms`}}),{name:"BackstageDependencyGraphNode"}),Q=n=>t.createElement(tt,{...n});function se({render:n=Q,setNode:a,node:i}){const{width:d,height:g,x:v=0,y:O=0}=i,N=i,G=Z(),H=t.useRef(null);return t.useLayoutEffect(()=>{if(H.current){let{height:ne,width:_}=H.current.getBBox();ne=Math.round(ne),_=Math.round(_),(ne!==g||_!==d)&&a(i.id,{...i,height:ne,width:_})}},[i,d,g,a]),t.createElement("g",{ref:H,"data-testid":Ne,className:G.node,transform:`translate(${v-d/2},${O-g/2})`},n({node:N}))}var le=e(55876),be=e(66481),Oe=e(19574),Ae=e.n(Oe);const ke=(0,oe.Z)(n=>({text:{fill:n.palette.textContrast}}),{name:"BackstageDependencyGraphDefaultLabel"});function We({edge:{label:n}}){const a=ke();return t.createElement("text",{className:a.text,textAnchor:"middle"},n)}const gt=(0,oe.Z)(n=>({path:{strokeWidth:2,stroke:n.palette.textSubtle,fill:"none",transition:`${n.transitions.duration.shortest}ms`},label:{transition:`${n.transitions.duration.shortest}ms`}}),{name:"BackstageDependencyGraphEdge"}),It=n=>t.createElement(We,{...n}),lt=le.Z().x(n=>n.x).y(n=>n.y).curve(be.Z);function Tt({render:n=It,setEdge:a,id:i,edge:d}){const{x:g=0,y:v=0,width:O,height:N,points:G}=d,H=d,ne=gt(),_=t.useRef(null);t.useLayoutEffect(()=>{if(_.current){let{height:Ce,width:Ie}=_.current.getBBox();Ce=Math.round(Ce),Ie=Math.round(Ie),(Ce!==N||Ie!==O)&&a(i,{...d,height:Ce,width:Ie})}},[d,N,O,a,i]);let ve="";if(G){const Ce=G.filter(Ie=>Ae()(Ie.x)&&Ae()(Ie.y));ve=lt(Ce)||""}return t.createElement(t.Fragment,null,ve&&t.createElement("path",{"data-testid":ct,className:ne.path,markerEnd:`url(#${Ke})`,d:ve}),H.label?t.createElement("g",{ref:_,"data-testid":X,className:ne.label,transform:`translate(${g},${v})`},n({edge:H})):null)}const Lt="workspace";function Rt(n){var _n,Ar;const{edges:a,nodes:i,renderNode:d,direction:g=Pe.TOP_BOTTOM,align:v,nodeMargin:O=50,edgeMargin:N=10,rankMargin:G=50,paddingX:H=0,paddingY:ne=0,acyclicer:_,ranker:ve=Ve.NETWORK_SIMPLEX,labelPosition:Ce=ie.RIGHT,labelOffset:Ie=10,edgeRanks:pt=1,edgeWeight:Ut=1,renderLabel:Yt,defs:Jt,zoom:dt="enabled",...Gt}=n,en=(0,Be.Z)(),[Qt,Xn]=t.useState(100),[Nn,wr]=t.useState(100),Mt=t.useRef(new(mt()).graphlib.Graph),[yr,$r]=t.useState(((_n=Mt.current.graph())==null?void 0:_n.width)||0),[Er,ea]=t.useState(((Ar=Mt.current.graph())==null?void 0:Ar.height)||0),[ga,ta]=t.useState([]),[na,pa]=t.useState([]),sn=Math.max(yr,Qt),Sn=Math.max(Er,Nn),ar=t.useMemo(()=>Et()(ln=>{if(!ln)return;const pn=Ue.Z(ln),rn=Ue.Z(ln.getElementById(Lt));function Zn(){pn.call(de.sP().scaleExtent([1,10]).on("zoom",Yn=>{Yn.transform.x=Math.min(0,Math.max(Yn.transform.x,sn-sn*Yn.transform.k)),Yn.transform.y=Math.min(0,Math.max(Yn.transform.y,Sn-Sn*Yn.transform.k)),rn.attr("transform",Yn.transform)}))}dt==="enabled"?Zn():dt==="enable-on-click"&&pn.on("click",()=>Zn());const{width:zn,height:ra}=ln.getBoundingClientRect();Qt!==zn&&Xn(zn),Nn!==ra&&wr(ra)},100),[Nn,Qt,sn,Sn,dt]),qn=t.useCallback(()=>{const ln=Mt.current.nodes(),pn=Mt.current.edges();ln.forEach(rn=>{i.some(zn=>zn.id===rn)||Mt.current.removeNode(rn)}),pn.forEach(rn=>{a.some(zn=>zn.from===rn.v&&zn.to===rn.w)||Mt.current.removeEdge(rn.v,rn.w)}),i.forEach(rn=>{const Zn=Mt.current.nodes().find(zn=>rn.id===zn);if(Zn&&Mt.current.node(Zn)){const{width:zn,height:ra,x:Yn,y:Xi}=Mt.current.node(Zn);Mt.current.setNode(Zn,{...rn,width:zn,height:ra,x:Yn,y:Xi})}else Mt.current.setNode(rn.id,{...rn,width:0,height:0})}),a.forEach(rn=>{Mt.current.setEdge(rn.from,rn.to,{...rn,label:rn.label,width:0,height:0,labelpos:Ce,labeloffset:Ie,weight:Ut,minlen:pt})})},[a,i,Ce,Ie,Ut,pt]),nn=t.useMemo(()=>Et()(()=>{mt().layout(Mt.current);const{height:ln,width:pn}=Mt.current.graph(),rn=Math.max(0,ln||0),Zn=Math.max(0,pn||0);$r(Zn),ea(rn),ta(Mt.current.nodes()),pa(Mt.current.edges())},250,{leading:!0}),[]);t.useEffect(()=>(Mt.current.setGraph({rankdir:g,align:v,nodesep:O,edgesep:N,ranksep:G,marginx:H,marginy:ne,acyclicer:_,ranker:ve}),qn(),nn(),nn.cancel),[_,v,g,N,H,ne,O,G,ve,qn,nn]);function Cn(ln,pn){return Mt.current.setNode(ln,pn),nn(),Mt.current}function vr(ln,pn){return Mt.current.setEdge(ln,pn),nn(),Mt.current}return t.createElement("svg",{ref:ar,...Gt,width:"100%",height:Sn,viewBox:`0 0 ${sn} ${Sn}`},t.createElement("defs",null,t.createElement("marker",{id:Ke,viewBox:"0 0 24 24",markerWidth:"14",markerHeight:"14",refX:"16",refY:"12",orient:"auto",markerUnits:"strokeWidth"},t.createElement("path",{fill:en.palette.textSubtle,d:"M8.59 16.59L13.17 12 8.59 7.41 10 6l6 6-6 6-1.41-1.41z"})),Jt),t.createElement("g",{id:Lt},t.createElement("svg",{width:yr,height:Er,y:Sn/2-Er/2,x:sn/2-yr/2,viewBox:`0 0 ${yr} ${Er}`},na.map(ln=>{const pn=Mt.current.edge(ln);return pn?t.createElement(Tt,{key:`${ln.v}-${ln.w}`,id:ln,setEdge:vr,render:Yt,edge:pn}):null}),ga.map(ln=>{const pn=Mt.current.node(ln);return pn?t.createElement(se,{key:ln,setNode:Cn,render:d,node:pn}):null}))))}const Nt=(0,m.Z)(n=>{var a;return{root:{padding:n.spacing(0),marginBottom:n.spacing(0),marginTop:n.spacing(0),display:"flex",flexFlow:"row nowrap"},topPosition:{position:"relative",marginBottom:n.spacing(6),marginTop:-n.spacing(3),zIndex:"unset"},icon:{fontSize:20},content:{width:"100%",maxWidth:"inherit",flexWrap:"nowrap"},message:{display:"flex",alignItems:"center",color:n.palette.banner.text,"& a":{color:n.palette.banner.link}},info:{backgroundColor:n.palette.banner.info},error:{backgroundColor:n.palette.banner.error},warning:{backgroundColor:(a=n.palette.banner.warning)!=null?a:n.palette.banner.error}}},{name:"BackstageDismissableBanner"}),Zt=n=>{var Ce;const{variant:a,message:i,id:d,fixed:g=!1}=n,v=Nt(),N=useApi(storageApiRef).forBucket("notifications"),G=(Ce=N.snapshot("dismissedBanners").value)!=null?Ce:[],[H,ne]=useState(new Set(G)),_=useObservable(N.observe$("dismissedBanners"));useEffect(()=>{var Ie;if(_!=null&&_.value){const pt=(Ie=_==null?void 0:_.value)!=null?Ie:[];ne(new Set(pt))}},[_==null?void 0:_.value]);const ve=()=>{N.set("dismissedBanners",[...H,d])};return React.createElement(Snackbar,{anchorOrigin:g?{vertical:"bottom",horizontal:"center"}:{vertical:"top",horizontal:"center"},open:!H.has(d),classes:{root:classNames(v.root,!g&&v.topPosition)}},React.createElement(SnackbarContent,{classes:{root:classNames(v.content,v[a]),message:v.message},message:i,action:[React.createElement(IconButton,{key:"dismiss",title:"Permanently dismiss this message",color:"inherit",onClick:ve},React.createElement(Close,{className:v.icon}))]}))};var vt=e(60905),at=e(90436),zt=e.p+"static/missingAnnotation.67f79e98..svg",ae=e.p+"static/noInformation.4b426325..svg",V=e.p+"static/createComponent.975d1e1e..svg",ye=e.p+"static/noBuild.1715fa71..svg";const He=(0,m.Z)({generalImg:{width:"95%",zIndex:2,position:"relative",left:"50%",top:"50%",transform:"translate(-50%, 15%)"}},{name:"BackstageEmptyStateImage"}),qe=({missing:n})=>{const a=He();switch(n){case"field":return t.createElement("img",{src:zt,className:a.generalImg,alt:"annotation is missing"});case"info":return t.createElement("img",{src:ae,alt:"no Information",className:a.generalImg});case"content":return t.createElement("img",{src:V,alt:"create Component",className:a.generalImg});case"data":return t.createElement("img",{src:ye,alt:"no Build",className:a.generalImg});default:return null}},ot=(0,m.Z)(n=>({root:{backgroundColor:n.palette.background.default,padding:n.spacing(2,0,0,0)},action:{marginTop:n.spacing(2)},imageContainer:{position:"relative"}}),{name:"BackstageEmptyState"});function bt(n){const{title:a,description:i,missing:d,action:g}=n,v=ot();return t.createElement(vt.Z,{container:!0,direction:"row",justifyContent:"space-around",alignItems:"flex-start",className:v.root,spacing:2},t.createElement(vt.Z,{item:!0,xs:12,md:6},t.createElement(vt.Z,{container:!0,direction:"column"},t.createElement(vt.Z,{item:!0,xs:!0},t.createElement(at.Z,{variant:"h5"},a)),t.createElement(vt.Z,{item:!0,xs:!0},t.createElement(at.Z,{variant:"body1"},i)),t.createElement(vt.Z,{item:!0,xs:!0,className:v.action},g))),t.createElement(vt.Z,{item:!0,xs:12,md:6,className:v.imageContainer},t.createElement(qe,{missing:d})))}const Wt=`apiVersion: backstage.io/v1alpha1
|
|
2
2
|
kind: Component
|
|
3
3
|
metadata:
|
|
4
4
|
name: example
|
|
@@ -10,7 +10,7 @@ spec:
|
|
|
10
10
|
lifecycle: production
|
|
11
11
|
owner: user:guest`,Xt=(0,m.Z)(n=>({code:{borderRadius:6,margin:`${n.spacing(2)}px 0px`,background:n.palette.type==="dark"?"#444":"#fff"}}),{name:"BackstageMissingAnnotationEmptyState"});function un(n){const{annotation:a,readMoreUrl:i}=n,d=i||"https://backstage.io/docs/features/software-catalog/well-known-annotations",g=Xt(),v=t.createElement(t.Fragment,null,"The ",t.createElement("code",null,a)," annotation is missing. You need to add the annotation to your component if you want to enable this tool.");return t.createElement(bt,{missing:"field",title:"Missing Annotation",description:v,action:t.createElement(t.Fragment,null,t.createElement(at.Z,{variant:"body1"},"Add the annotation to your component YAML as shown in the highlighted example below:"),t.createElement("div",{className:g.code},t.createElement(et,{text:Wt.replace("ANNOTATION",a),language:"yaml",showLineNumbers:!0,highlightedNumbers:[6,7],customStyle:{background:"inherit",fontSize:"115%"}})),t.createElement(y.Z,{color:"primary",component:b,to:d},"Read more"))})}var dn=e(11776),xt=e(38402),qt=e(49378),x=e(41128),re=e(27616),Ee=e(8284),Te=e(70660),Le=e(91750),Je=e(38016);const it=(n,a)=>(a.palette.type==="light"?x._j:x.$n)(a.palette[n].light,.6),Kt=(n,a)=>(a.palette.type==="light"?x.$n:x._j)(a.palette[n].light,.9),Ht=(0,m.Z)(n=>({root:{marginRight:n.spacing(1),fill:({severity:a})=>it(a,n)}})),Dt=({severity:n})=>{const a=Ht({severity:n});return t.createElement(Le.Z,{classes:a})},Ft=({severity:n})=>{const a=Ht({severity:n});return t.createElement(Je.Z,{classes:a})},ut=(0,m.Z)(n=>({panel:{backgroundColor:({severity:a})=>Kt(a,n),color:({severity:a})=>it(a,n),verticalAlign:"middle"},summary:{display:"flex",flexDirection:"row"},summaryText:{color:({severity:a})=>it(a,n),fontWeight:"bold"},message:{width:"100%",display:"block",color:({severity:a})=>it(a,n),backgroundColor:({severity:a})=>Kt(a,n)},details:{width:"100%",display:"block",color:n.palette.textContrast,backgroundColor:n.palette.background.default,border:`1px solid ${n.palette.border}`,padding:n.spacing(2),fontFamily:"sans-serif"}}),{name:"BackstageWarningPanel"}),kt=n=>n.charAt(0).toLocaleUpperCase("en-US")+n.slice(1);function tn(n){const{severity:a="warning",title:i,message:d,children:g,defaultExpanded:v}=n,O=ut({severity:a}),N=kt(a)+(i?`: ${i}`:"");return t.createElement(re.Z,{defaultExpanded:v!=null?v:!1,className:O.panel,role:"alert"},t.createElement(Ee.Z,{expandIcon:t.createElement(Ft,{severity:a}),className:O.summary},t.createElement(Dt,{severity:a}),t.createElement(at.Z,{className:O.summaryText,variant:"subtitle1"},N)),(d||g)&&t.createElement(Te.Z,null,t.createElement(vt.Z,{container:!0},d&&t.createElement(vt.Z,{item:!0,xs:12},t.createElement(at.Z,{className:O.message,variant:"body1"},d)),g&&t.createElement(vt.Z,{item:!0,xs:12,className:O.details},g))))}const jt=(0,m.Z)(n=>({text:{fontFamily:"monospace",whiteSpace:"pre",overflowX:"auto",marginRight:n.spacing(2)},divider:{margin:n.spacing(2)}}),{name:"BackstageErrorPanel"}),Vt=({error:n,message:a,stack:i,children:d})=>{const g=jt();return t.createElement(dn.Z,{dense:!0},t.createElement(xt.Z,{alignItems:"flex-start"},t.createElement(qt.Z,{classes:{secondary:g.text},primary:"Error",secondary:n}),t.createElement(we,{text:n})),t.createElement(xt.Z,{alignItems:"flex-start"},t.createElement(qt.Z,{classes:{secondary:g.text},primary:"Message",secondary:a}),t.createElement(we,{text:a})),i&&t.createElement(xt.Z,{alignItems:"flex-start"},t.createElement(qt.Z,{classes:{secondary:g.text},primary:"Stack Trace",secondary:i}),t.createElement(we,{text:i})),d)};function cn(n){const{title:a,error:i,defaultExpanded:d,children:g}=n;return t.createElement(tn,{severity:"error",title:a!=null?a:i.message,defaultExpanded:d},t.createElement(Vt,{error:i.name,message:i.message,stack:i.stack,children:g}))}var Tn=e(85256);const wt=(0,m.Z)(n=>({text:{fontFamily:"monospace",whiteSpace:"pre",overflowX:"auto",marginRight:n.spacing(2)},divider:{margin:n.spacing(2)}}),{name:"BackstageResponseErrorPanel"});function $t(n){var Ie;const{title:a,error:i,defaultExpanded:d}=n,g=wt();if(i.name!=="ResponseError")return t.createElement(cn,{title:a!=null?a:i.message,defaultExpanded:d,error:i});const{body:v,cause:O}=i,{request:N,response:G}=v,H=`${G.statusCode}: ${O.name}`,ne=N&&`${N.method} ${N.url}`,_=O.message.replace(/\\n/g,`
|
|
12
12
|
`),ve=(Ie=O.stack)==null?void 0:Ie.replace(/\\n/g,`
|
|
13
|
-
`),Ce=JSON.stringify(v,void 0,2);return t.createElement(cn,{title:a!=null?a:i.message,defaultExpanded:d,error:{name:H,message:_,stack:ve}},ne&&t.createElement(xt.Z,{alignItems:"flex-start"},t.createElement(qt.Z,{classes:{secondary:g.text},primary:"Request",secondary:N?`${ne}`:void 0}),t.createElement(we,{text:ne})),t.createElement(t.Fragment,null,t.createElement(Tn.Z,{component:"li",className:g.divider}),t.createElement(xt.Z,{alignItems:"flex-start"},t.createElement(qt.Z,{classes:{secondary:g.text},primary:"Full Error as JSON"})),t.createElement(et,{language:"json",text:Ce,showCopyCodeButton:!0})))}var hn=e(47093);function yn(n){const a=document.createElement("div");return a.setAttribute("id",n),a}function an(n){document.body.insertBefore(n,document.body.lastElementChild.nextElementSibling)}function fn(n){const a=useRef(null);useEffect(function(){const g=document.querySelector(`#${n}`),v=g||yn(n);return g||an(v),v.appendChild(a.current),function(){a.current.remove(),v.childNodes.length===-1&&v.remove()}},[n]);function i(){return a.current||(a.current=document.createElement("div")),a.current}return i()}var Wn=null;const $="core.calloutSeen";function h(){const[n,a]=useState(()=>{const d=localStorage.getItem($);return d?JSON.parse(d):{}}),i=useCallback((d,g)=>{const v=localStorage.getItem($),N={...v?JSON.parse(v):{},[d]:g};a(N),localStorage.setItem($,JSON.stringify(N))},[]);return{states:n,setState:i}}function S(n){const{states:a,setState:i}=h(),d=useCallback(()=>{i(n,!0)},[i,n]);return{seen:a[n]===!0,markSeen:d}}function F(n){const{seen:a,markSeen:i}=S(n);return{show:a===!1,hide:i}}const W=(0,m.Z)({"@keyframes pulsateSlightly":{"0%":{transform:"scale(1.0)"},"100%":{transform:"scale(1.1)"}},"@keyframes pulsateAndFade":{"0%":{transform:"scale(1.0)",opacity:.9},"100%":{transform:"scale(1.5)",opacity:0}},featureWrapper:{position:"relative"},backdrop:{zIndex:2e3,position:"fixed",overflow:"hidden",left:0,right:0,top:0,bottom:0},dot:{position:"absolute",backgroundColor:"transparent",borderRadius:"100%",border:"1px solid rgba(103, 146, 180, 0.98)",boxShadow:"0px 0px 0px 20000px rgba(0, 0, 0, 0.5)",zIndex:2001,transformOrigin:"center center",animation:"$pulsateSlightly 1744ms 1.2s cubic-bezier(0.4, 0, 0.2, 1) alternate infinite"},pulseCircle:{width:"100%",height:"100%",backgroundColor:"transparent",borderRadius:"100%",border:"2px solid white",zIndex:2001,transformOrigin:"center center",animation:"$pulsateAndFade 872ms 1.2s cubic-bezier(0.4, 0, 0.2, 1) infinite"},text:{position:"absolute",color:"white",zIndex:2003}},{name:"BackstageFeatureCalloutCircular"});function pe(n){const{featureId:a,title:i,description:d,children:g}=n,{show:v,hide:O}=useShowCallout(a),N=usePortal("core.callout"),G=useRef(null),[H,ne]=useState(),_=W(),ve=useCallback(()=>{if(G.current){const Ce=G.current.getBoundingClientRect(),Ie=Math.max(Ce.width,Ce.height),
|
|
13
|
+
`),Ce=JSON.stringify(v,void 0,2);return t.createElement(cn,{title:a!=null?a:i.message,defaultExpanded:d,error:{name:H,message:_,stack:ve}},ne&&t.createElement(xt.Z,{alignItems:"flex-start"},t.createElement(qt.Z,{classes:{secondary:g.text},primary:"Request",secondary:N?`${ne}`:void 0}),t.createElement(we,{text:ne})),t.createElement(t.Fragment,null,t.createElement(Tn.Z,{component:"li",className:g.divider}),t.createElement(xt.Z,{alignItems:"flex-start"},t.createElement(qt.Z,{classes:{secondary:g.text},primary:"Full Error as JSON"})),t.createElement(et,{language:"json",text:Ce,showCopyCodeButton:!0})))}var hn=e(47093);function yn(n){const a=document.createElement("div");return a.setAttribute("id",n),a}function an(n){document.body.insertBefore(n,document.body.lastElementChild.nextElementSibling)}function fn(n){const a=useRef(null);useEffect(function(){const g=document.querySelector(`#${n}`),v=g||yn(n);return g||an(v),v.appendChild(a.current),function(){a.current.remove(),v.childNodes.length===-1&&v.remove()}},[n]);function i(){return a.current||(a.current=document.createElement("div")),a.current}return i()}var Wn=null;const $="core.calloutSeen";function h(){const[n,a]=useState(()=>{const d=localStorage.getItem($);return d?JSON.parse(d):{}}),i=useCallback((d,g)=>{const v=localStorage.getItem($),N={...v?JSON.parse(v):{},[d]:g};a(N),localStorage.setItem($,JSON.stringify(N))},[]);return{states:n,setState:i}}function S(n){const{states:a,setState:i}=h(),d=useCallback(()=>{i(n,!0)},[i,n]);return{seen:a[n]===!0,markSeen:d}}function F(n){const{seen:a,markSeen:i}=S(n);return{show:a===!1,hide:i}}const W=(0,m.Z)({"@keyframes pulsateSlightly":{"0%":{transform:"scale(1.0)"},"100%":{transform:"scale(1.1)"}},"@keyframes pulsateAndFade":{"0%":{transform:"scale(1.0)",opacity:.9},"100%":{transform:"scale(1.5)",opacity:0}},featureWrapper:{position:"relative"},backdrop:{zIndex:2e3,position:"fixed",overflow:"hidden",left:0,right:0,top:0,bottom:0},dot:{position:"absolute",backgroundColor:"transparent",borderRadius:"100%",border:"1px solid rgba(103, 146, 180, 0.98)",boxShadow:"0px 0px 0px 20000px rgba(0, 0, 0, 0.5)",zIndex:2001,transformOrigin:"center center",animation:"$pulsateSlightly 1744ms 1.2s cubic-bezier(0.4, 0, 0.2, 1) alternate infinite"},pulseCircle:{width:"100%",height:"100%",backgroundColor:"transparent",borderRadius:"100%",border:"2px solid white",zIndex:2001,transformOrigin:"center center",animation:"$pulsateAndFade 872ms 1.2s cubic-bezier(0.4, 0, 0.2, 1) infinite"},text:{position:"absolute",color:"white",zIndex:2003}},{name:"BackstageFeatureCalloutCircular"});function pe(n){const{featureId:a,title:i,description:d,children:g}=n,{show:v,hide:O}=useShowCallout(a),N=usePortal("core.callout"),G=useRef(null),[H,ne]=useState(),_=W(),ve=useCallback(()=>{if(G.current){const Ce=G.current.getBoundingClientRect(),Ie=Math.max(Ce.width,Ce.height),pt=800,Ut=Ce.x-(Ie-Ce.width)/2-pt,Yt=Ce.y-(Ie-Ce.height)/2-pt,Jt=Ie+2*pt,dt=450,Gt=Ce.x+Ce.width/2-dt,en=Ce.y-(Ie-Ce.height)/2+Ie+20;ne({dotLeft:Ut,dotTop:Yt,dotSize:Jt,borderWidth:pt,textTop:en,textLeft:Gt,textWidth:dt})}},[]);return useEffect(()=>(window.addEventListener("resize",ve),window.addEventListener("scroll",ve),()=>{window.removeEventListener("resize",ve),window.removeEventListener("scroll",ve)}),[ve]),useLayoutEffect(ve,[G.current,ve]),v?React.createElement(React.Fragment,null,React.createElement("div",{className:_.featureWrapper,ref:G},g),createPortal(React.createElement("div",{className:_.backdrop},React.createElement(ClickAwayListener,{onClickAway:O},React.createElement(React.Fragment,null,React.createElement("div",{className:_.dot,"data-testid":"dot",style:{left:H==null?void 0:H.dotLeft,top:H==null?void 0:H.dotTop,width:H==null?void 0:H.dotSize,height:H==null?void 0:H.dotSize,borderWidth:H==null?void 0:H.borderWidth},onClick:O,onKeyDown:O,role:"button",tabIndex:0},React.createElement("div",{className:_.pulseCircle})),React.createElement("div",{className:_.text,"data-testid":"text",style:{left:H==null?void 0:H.textLeft,top:H==null?void 0:H.textTop,width:H==null?void 0:H.textWidth}},React.createElement(Typography,{variant:"h2",paragraph:!0},i),React.createElement(Typography,null,d))))),N)):React.createElement(React.Fragment,null,g)}var he=e(35292);const Me=(0,m.Z)(n=>({link:{display:"grid",justifyItems:"center",gridGap:4,textAlign:"center"},disabled:{color:"gray",cursor:"default"},primary:{color:n.palette.primary.main},secondary:{color:n.palette.secondary.main},label:{fontSize:"0.7rem",textTransform:"uppercase",fontWeight:600,letterSpacing:1.2}}),{name:"BackstageIconLinkVertical"});function ft({color:n="primary",disabled:a=!1,href:i="#",icon:d=t.createElement(he.Z,null),label:g,onClick:v,title:O}){const N=Me();return a?t.createElement(T.Z,{title:O,className:E()(N.link,N.disabled),underline:"none"},d,t.createElement("span",{className:N.label},g)):t.createElement(T.Z,{title:O,className:E()(N.link,N[n]),to:i,component:b,onClick:v},d,t.createElement("span",{className:N.label},g))}const Pt=(0,m.Z)(n=>({links:{margin:n.spacing(2,0),display:"grid",gridAutoFlow:"column",gridAutoColumns:"min-content",gridGap:n.spacing(3)}}),{name:"BackstageHeaderIconLinkRow"});function bn(n){const{links:a}=n,i=Pt();return t.createElement("nav",{className:i.links},a.map((d,g)=>t.createElement(ft,{key:g+1,...d})))}const vn=n=>{const a=n==="dark"?"16%":"97%";return`
|
|
14
14
|
hsl(0, 0%, ${a}) 0%,
|
|
15
15
|
hsla(0, 0%, ${a}, 0.987) 8.1%,
|
|
16
16
|
hsla(0, 0%, ${a}, 0.951) 15.5%,
|
|
@@ -27,9 +27,9 @@ spec:
|
|
|
27
27
|
hsla(0, 0%, ${a}, 0.049) 84.5%,
|
|
28
28
|
hsla(0, 0%, ${a}, 0.013) 91.9%,
|
|
29
29
|
hsla(0, 0%, ${a}, 0) 100%
|
|
30
|
-
`},Ur=100,or=10,Nr=(0,m.Z)(n=>({root:{position:"relative",display:"flex",flexFlow:"row nowrap",alignItems:"center"},container:{overflow:"auto",scrollbarWidth:0,"&::-webkit-scrollbar":{display:"none"}},fade:{position:"absolute",width:Ur,height:`calc(100% + ${or}px)`,transition:"opacity 300ms",pointerEvents:"none"},fadeLeft:{left:-or,background:`linear-gradient(90deg, ${vn(n.palette.type)})`},fadeRight:{right:-or,background:`linear-gradient(270deg, ${vn(n.palette.type)})`},fadeHidden:{opacity:0},button:{position:"absolute"},buttonLeft:{left:-n.spacing(2)},buttonRight:{right:-n.spacing(2)}}),{name:"BackstageHorizontalScrollGrid"});function Zr(n){const[[a,i],d]=React.useState([0,0]);return React.useLayoutEffect(()=>{const g=n.current;if(!g){d([0,0]);return}const v=()=>{const O=g.scrollLeft,N=g.scrollWidth-g.offsetWidth-g.scrollLeft;d([O,N])};return v(),g.addEventListener("scroll",v),window.addEventListener("resize",v),()=>{g.removeEventListener("scroll",v),window.removeEventListener("resize",v)}},[n]),[a,i]}function Hn(n,a,i){const[d,g]=React.useState(0);return React.useLayoutEffect(()=>{if(d===0)return;const v=performance.now(),O=requestAnimationFrame(N=>{if(!n.current)return;const G=N-v,H=Math.abs(d)*G/a,_=Math.max(i,H)*Math.sign(d);n.current.scrollBy({left:_});const ve=d-_;Math.sign(d)!==Math.sign(ve)?g(0):g(ve)});return()=>cancelAnimationFrame(O)},[n,d,a,i]),g}function $n(n){const{scrollStep:a=100,scrollSpeed:i=50,minScrollDistance:d=5,children:g,...v}=n,O=Nr(n),N=React.useRef(),[G,H]=Zr(N),ne=Hn(N,i,d),_=ve=>{!N.current||ne(ve?a:-a)};return React.createElement("div",{...v,className:O.root},React.createElement(Grid,{container:!0,direction:"row",wrap:"nowrap",className:O.container,ref:N},g),React.createElement("div",{className:classNames(O.fade,O.fadeLeft,{[O.fadeHidden]:G===0})}),React.createElement("div",{className:classNames(O.fade,O.fadeRight,{[O.fadeHidden]:H===0})}),G>0&&React.createElement(IconButton,{title:"Scroll Left",onClick:()=>_(!1),className:classNames(O.button,O.buttonLeft,{})},React.createElement(ChevronLeftIcon,null)),H>0&&React.createElement(IconButton,{title:"Scroll Right",onClick:()=>_(!0),className:classNames(O.button,O.buttonRight,{})},React.createElement(ChevronRightIcon,null)))}const Jn=(0,m.Z)({alpha:{color:"#ffffff",fontFamily:"serif",fontWeight:"normal",fontStyle:"italic"},beta:{color:"#4d65cc",fontFamily:"serif",fontWeight:"normal",fontStyle:"italic"}},{name:"BackstageLifecycle"});function sr(n){const a=Jn(n),{shorthand:i,alpha:d}=n;return i?React.createElement("span",{className:a[d?"alpha":"beta"],style:{fontSize:"120%"}},d?React.createElement(React.Fragment,null,"\u03B1"):React.createElement(React.Fragment,null,"\u03B2")):React.createElement("span",{className:a[d?"alpha":"beta"]},d?"Alpha":"Beta")}const Rr=(0,t.lazy)(()=>Promise.all([e.e(3860),e.e(8718)]).then(e.bind(e,98718)).then(n=>({default:n.RealLogViewer})));function zr(n){const{Progress:a}=(0,l.useApp)().getComponents();return t.createElement(t.Suspense,{fallback:t.createElement(a,null)},t.createElement(Rr,{...n}))}const Qn=(0,m.Z)(n=>({markdown:{"& table":{borderCollapse:"collapse",border:`1px solid ${n.palette.border}`},"& th, & td":{border:`1px solid ${n.palette.border}`,padding:n.spacing(1)},"& td":{wordBreak:"break-word",overflow:"hidden",verticalAlign:"middle",lineHeight:"1",margin:0,padding:n.spacing(3,2,3,2.5),borderBottom:0},"& th":{backgroundColor:n.palette.background.paper},"& tr":{backgroundColor:n.palette.background.paper},"& tr:nth-child(odd)":{backgroundColor:n.palette.background.default},"& a":{color:n.palette.link},"& img":{maxWidth:"100%"}}}),{name:"BackstageMarkdownContent"}),Sr={code:({inline:n,className:a,children:i,...d})=>{const g=String(i).replace(/\n+$/,""),v=/language-(\w+)/.exec(a||"");return!n&&v?t.createElement(et,{language:v[1],text:g}):t.createElement("code",{className:a,...d},i)}};function Wr(n){const{content:a,dialect:i="gfm",linkTarget:d}=n,g=Qn();return React.createElement(ReactMarkdown,{remarkPlugins:i==="gfm"?[gfm]:[],className:g.markdown,children:a,components:Sr,linkTarget:d})}var er=e(10179);const Pn=(0,m.Z)(n=>({root:{paddingLeft:n.spacing(3)}}),{name:"BackstageLoginRequestListItem"}),tr=({request:n,busy:a,setBusy:i})=>{const d=Pn(),[g,v]=useState(),O=async()=>{i(!0);try{await n.trigger()}catch(G){v(isError(G)?G.message:"An unspecified error occurred")}finally{i(!1)}},N=n.provider.icon;return React.createElement(ListItem,{disabled:a,classes:{root:d.root}},React.createElement(ListItemAvatar,null,React.createElement(N,{fontSize:"large"})),React.createElement(ListItemText,{primary:n.provider.title,secondary:g&&React.createElement(Typography,{color:"error"},g)}),React.createElement(Button,{color:"primary",variant:"contained",onClick:O},"Log in"))};var nr=null;const Cr=(0,m.Z)(n=>({dialog:{paddingTop:n.spacing(1)},title:{minWidth:0},titleHeading:{fontSize:n.typography.h6.fontSize},contentList:{padding:0},actionButtons:{padding:n.spacing(2,0)}}),{name:"OAuthRequestDialog"});function ir(n){const a=Cr(),[i,d]=useState(!1),g=useApi(oauthRequestApiRef),v=useObservable(useMemo(()=>g.authRequest$(),[g]),[]),O=()=>{v.forEach(N=>N.reject())};return React.createElement(Dialog,{open:Boolean(v.length),fullWidth:!0,maxWidth:"xs",classes:{paper:a.dialog},"aria-labelledby":"oauth-req-dialog-title"},React.createElement("main",null,React.createElement(DialogTitle,{classes:{root:a.title},id:"oauth-req-dialog-title"},React.createElement(Typography,{className:a.titleHeading,variant:"h1"},"Login Required")),React.createElement(DialogContent,{dividers:!0,classes:{root:a.contentList}},React.createElement(List,null,v.map(N=>React.createElement(LoginRequestListItem,{key:N.provider.title,request:N,busy:i,setBusy:d}))))),React.createElement(DialogActions,{classes:{root:a.actionButtons}},React.createElement(Button,{onClick:O},"Reject All")))}var lr=e(15277),Tr=e.n(lr),Hr=e(29862);const rr=(0,m.Z)({container:{overflow:"visible !important"}},{name:"BackstageOverflowTooltip"});function br(n){var O;const[a,i]=(0,t.useState)(!1),d=(0,Hr.t)(),g=rr(),v=N=>{d()&&i(N)};return t.createElement(te.ZP,{title:(O=n.title)!=null?O:n.text||"",placement:n.placement,disableHoverListener:!a},t.createElement(Tr(),{text:n.text,line:n.line,onToggled:v,containerClassName:g.container}))}var jr=e(67358);function cr(n){const[a,i]=(0,t.useState)(!1);return(0,t.useEffect)(()=>{const d=setTimeout(()=>i(!0),250);return()=>clearTimeout(d)},[]),a?t.createElement(jr.Z,{...n,"data-testid":"progress"}):t.createElement("div",{style:{display:"none"}})}var Pr=e(94339),ur=e(14503),Ir=e(24579),dr=e(32552),mn=e(15459),Fn=e(95544),Lr=e(27597);const Bn=(0,m.Z)(n=>({root:{maxWidth:"fit-content",padding:n.spacing(2,2,2,2.5)},boxTitle:{margin:0,color:n.palette.textSubtle},arrow:{color:n.palette.textSubtle}}),{name:"BackstageBottomLink"});function fr(n){const{link:a,title:i,onClick:d}=n,g=Bn();return t.createElement("div",null,t.createElement(Tn.Z,null),t.createElement(b,{to:a,onClick:d,underline:"none"},t.createElement(Fn.Z,{display:"flex",alignItems:"center",className:g.root},t.createElement(Fn.Z,{className:g.boxTitle,fontWeight:"fontWeightBold",m:1},t.createElement(at.Z,null,t.createElement("strong",null,i))),t.createElement(Lr.Z,{className:g.arrow}))))}const Vn=n=>{const{slackChannel:a}=n;if(a){if(typeof a=="string")return t.createElement(t.Fragment,null,"Please contact ",a," for help.");if(!a.href)return t.createElement(t.Fragment,null,"Please contact ",a.name," for help.")}else return null;return t.createElement(D,{to:a.href,variant:"contained"},a.name)},Gn=class extends t.Component{constructor(a){super(a),this.state={error:void 0,errorInfo:void 0}}componentDidCatch(a,i){console.error(`ErrorBoundary, error: ${a}, info: ${i}`),this.setState({error:a,errorInfo:i})}render(){const{slackChannel:a,children:i}=this.props,{error:d}=this.state;return d?t.createElement(cn,{title:"Something Went Wrong",error:d},t.createElement(Vn,{slackChannel:a})):i}},mr=(0,m.Z)(n=>({noPadding:{padding:0,"&:last-child":{paddingBottom:0}},header:{padding:n.spacing(2,2,2,2.5)},headerTitle:{fontWeight:700},headerSubheader:{paddingTop:n.spacing(1)},headerAvatar:{},headerAction:{},headerContent:{},subheader:{display:"flex"}}),{name:"BackstageInfoCard"}),Or=(0,mn.Z)(n=>({root:{display:"inline-block",padding:n.spacing(8,8,0,0),float:"right"}}),{name:"BackstageInfoCardCardActionsTopRight"})(ur.Z),hr={card:{flex:{display:"flex",flexDirection:"column"},fullHeight:{display:"flex",flexDirection:"column",height:"100%"},gridItem:{display:"flex",flexDirection:"column",height:"calc(100% - 10px)",marginBottom:"10px"}},cardContent:{fullHeight:{flex:1},gridItem:{flex:1}}};function Kn(n){const{title:a,subheader:i,divider:d=!0,deepLink:g,slackChannel:v,errorBoundaryProps:O,variant:N,children:G,headerStyle:H,headerProps:ne,icon:_,action:ve,actionsClassName:Ce,actions:Ie,cardClassName:gt,actionsTopRight:Ut,className:Yt,noPadding:Jt,titleTypographyProps:dt}=n,Gt=mr();let en={},Qt={};N&&N.split(/[\s]+/g).forEach(Mt=>{en={...en,...hr.card[Mt]},Qt={...Qt,...hr.cardContent[Mt]}});const Xn=()=>t.createElement("div",{className:Gt.headerSubheader},i&&t.createElement("div",{className:Gt.subheader},i),_),Nn=O||(v?{slackChannel:v}:{});return t.createElement(Pr.Z,{style:en,className:Yt},t.createElement(Gn,{...Nn},a&&t.createElement(dr.Z,{classes:{root:Gt.header,title:Gt.headerTitle,subheader:Gt.headerSubheader,avatar:Gt.headerAvatar,action:Gt.headerAction,content:Gt.headerContent},title:a,subheader:Xn(),action:ve,style:{...H},titleTypographyProps:dt,...ne}),Ut&&t.createElement(Or,null,Ut),d&&t.createElement(Tn.Z,null),t.createElement(Ir.Z,{className:E()(gt,{[Gt.noPadding]:Jt}),style:Qt},G),Ie&&t.createElement(ur.Z,{className:Ce},Ie),g&&t.createElement(fr,{...g})))}var Vr=e(39307);const Gr=(0,m.Z)(n=>({root:{position:"relative",lineHeight:0},overlay:{position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -60%)",fontSize:45,fontWeight:"bold",color:n.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"}),gr={fractional:!0,inverse:!1,unit:"%",max:100},P=({palette:n,value:a,inverse:i,max:d})=>{if(isNaN(a))return"#ddd";const g=d||gr.max,v=i?g-a:a;return v<g/3?n.status.error:v<g*(2/3)?n.status.warning:n.status.ok};function J(n){const[a,i]=useState(null),{getColor:d=P}=n,g=Gr(n),{palette:v}=useTheme(),{value:O,fractional:N,inverse:G,unit:H,max:ne,description:_}={...gr,...n},ve=N?Math.round(O*ne):O,Ce=ne!==100?Math.round(O):ve,[Ie,gt]=useState(!1);return useEffect(()=>{const Ut=a,Yt=()=>gt(!0),Jt=()=>gt(!1);return Ut&&_?(Ut.addEventListener("mouseenter",Yt),Ut.addEventListener("mouseleave",Jt),()=>{Ut.removeEventListener("mouseenter",Yt),Ut.removeEventListener("mouseleave",Jt)}):()=>{gt(!1)}},[_,a]),React.createElement("div",{ref:i,className:g.root},React.createElement(Circle,{strokeLinecap:"butt",percent:ve,strokeWidth:12,trailWidth:12,strokeColor:d({palette:v,value:Ce,inverse:G,max:ne}),className:g.circle}),_&&Ie?React.createElement("div",{className:g.description},_):React.createElement("div",{className:g.overlay},isNaN(O)?"N/A":`${Ce}${H}`))}const fe=(0,m.Z)({root:{height:"100%",width:250}},{name:"BackstageGaugeCard"});function De(n){const a=fe(n),{title:i,subheader:d,progress:g,inverse:v,deepLink:O,description:N,icon:G,variant:H,getColor:ne}=n,_={inverse:v,description:N,getColor:ne,value:g};return React.createElement("div",{className:a.root},React.createElement(InfoCard,{title:i,subheader:d,deepLink:O,variant:H,icon:G},React.createElement(Gauge,{..._})))}function Qe(n){const{value:a,getColor:i=getProgressColor}=n,{palette:d}=useTheme();if(isNaN(a))return null;let g=Math.round(a*100*100)/100;g>100&&(g=100);const v=i({palette:d,value:g,inverse:!1,max:100});return React.createElement(Tooltip,{title:`${g}%`},React.createElement("span",null,React.createElement(Line,{percent:g,strokeWidth:4,trailWidth:4,strokeColor:v})))}var At=e(21324),St=e(7089),R=e(1292),C=e(42494),w=e(74603),z=e(56939),k=e(12231),K=e(73698),ce=e(72379);const Se=(0,m.Z)(()=>(0,o.Z)({icon:{position:"absolute",right:"4px",pointerEvents:"none"}}),{name:"BackstageClosedDropdown"});var xe=()=>{const n=Se();return t.createElement(ce.Z,{className:n.icon,fill:"none",xmlns:"http://www.w3.org/2000/svg"},t.createElement("path",{d:"M7.5 8L6 9.5L12.0703 15.5703L18.1406 9.5L16.6406 8L12.0703 12.5703L7.5 8Z",fill:"#616161"}))};const Fe=(0,m.Z)(()=>(0,o.Z)({icon:{position:"absolute",right:"4px",pointerEvents:"none"}}),{name:"BackstageOpenedDropdown"});var Ve=()=>{const n=Fe();return t.createElement(ce.Z,{className:n.icon,fill:"none",xmlns:"http://www.w3.org/2000/svg"},t.createElement("path",{d:"M16.5 16L18 14.5L11.9297 8.42969L5.85938 14.5L7.35938 16L11.9297 11.4297L16.5 16Z",fill:"#616161"}))};const Ot=(0,mn.Z)(n=>(0,o.Z)({root:{"label + &":{marginTop:n.spacing(3)}},input:{borderRadius:4,position:"relative",backgroundColor:n.palette.background.paper,border:"1px solid #ced4da",fontSize:16,padding:"10px 26px 10px 12px",transition:n.transitions.create(["border-color","box-shadow"]),fontFamily:"Helvetica Neue","&:focus":{background:n.palette.background.paper,borderRadius:4}}}),{name:"BackstageSelectInputBase"})(w.Z),nt=(0,m.Z)(n=>(0,o.Z)({formControl:{margin:`${n.spacing(1)} 0px`,maxWidth:300},label:{transform:"initial",fontWeight:"bold",fontSize:14,fontFamily:n.typography.fontFamily,color:n.palette.text.primary,"&.Mui-focused":{color:n.palette.text.primary}},formLabel:{transform:"initial",fontWeight:"bold",fontSize:14,fontFamily:n.typography.fontFamily,color:n.palette.text.primary,"&.Mui-focused":{color:n.palette.text.primary}},chips:{display:"flex",flexWrap:"wrap"},chip:{margin:2},checkbox:{},root:{display:"flex",flexDirection:"column"}}),{name:"BackstageSelect"});function He(n){const{multiple:a,items:i,label:d,placeholder:g,selected:v,onChange:O,triggerReset:N,native:G=!1,disabled:H=!1}=n,ne=nt(),[_,ve]=(0,t.useState)(v||(a?[]:"")),[Ce,Ie]=(0,t.useState)(!1);(0,t.useEffect)(()=>{ve(a?[]:"")},[N,a]),(0,t.useEffect)(()=>{v!==void 0&&ve(v)},[v]);const gt=dt=>{ve(dt.target.value),O(dt.target.value)},Ut=dt=>{if(H){dt.preventDefault();return}Ie(Gt=>a&&!(dt.target instanceof HTMLElement)?!0:!Gt)},Yt=()=>{Ie(!1)},Jt=dt=>()=>{const Gt=_.filter(en=>en!==dt);ve(Gt),O(Gt)};return t.createElement("div",{className:ne.root},t.createElement(R.Z,{onClickAway:Yt},t.createElement(C.Z,{className:ne.formControl},t.createElement(z.Z,{className:ne.formLabel},d),t.createElement(K.Z,{"aria-label":d,value:_,native:G,disabled:H,"data-testid":"select",displayEmpty:!0,multiple:a,onChange:gt,onClick:Ut,open:Ce,input:t.createElement(Ot,null),label:d,tabIndex:0,renderValue:dt=>{var Gt;return a&&_.length!==0?t.createElement("div",{className:ne.chips},dt.map(en=>{var Qt,Xn;return t.createElement(St.Z,{key:(Qt=i.find(Nn=>Nn.value===en))==null?void 0:Qt.value,label:(Xn=i.find(Nn=>Nn.value===en))==null?void 0:Xn.label,clickable:!0,onDelete:Jt(en),className:ne.chip})})):t.createElement(at.Z,null,_.length===0?g||"":(Gt=i.find(en=>en.value===dt))==null?void 0:Gt.label)},IconComponent:()=>Ce?t.createElement(Ve,null):t.createElement(xe,null),MenuProps:{anchorOrigin:{vertical:"bottom",horizontal:"left"},transformOrigin:{vertical:"top",horizontal:"left"},getContentAnchorEl:null}},g&&!a&&t.createElement(k.Z,{value:[]},g),G?i&&i.map(dt=>t.createElement("option",{value:dt.value,key:dt.value},dt.label)):i&&i.map(dt=>t.createElement(k.Z,{key:dt.value,value:dt.value},a&&t.createElement(At.Z,{color:"primary",checked:_.includes(dt.value)||!1,className:ne.checkbox}),dt.label))))))}const Bt=()=>{},_t=t.createContext({stepperLength:0,stepIndex:0,setStepIndex:Bt,stepHistory:[],setStepHistory:Bt,onStepChange:Bt});function En(n){const{children:a,elevated:i,onStepChange:d,activeStep:g=0}=n,[v,O]=useState(g),[N,G]=useState([0]);useEffect(()=>{O(g)},[g]);const H=[];let ne;return Children.forEach(a,_=>{isValidElement(_)&&(_.props.end?ne=_:H.push(_))}),React.createElement(React.Fragment,null,React.createElement(_t.Provider,{value:{stepIndex:v,setStepIndex:O,stepHistory:N,setStepHistory:G,onStepChange:d,stepperLength:Children.count(a)}},React.createElement(MuiStepper,{activeStep:v,orientation:"vertical",elevation:i?2:0},H)),v>=Children.count(a)-1&&ne)}const In=(0,m.Z)(n=>({root:{marginTop:n.spacing(3),"& button":{marginRight:n.spacing(1)}}}),{name:"BackstageSimpleStepperFooter"}),gn=({text:n,handleClick:a})=>React.createElement(Button,{onClick:a},n||"Reset"),An=({text:n,handleClick:a,disabled:i,last:d,stepIndex:g})=>React.createElement(Button,{variant:"contained",color:"primary",disabled:i,"data-testid":`nextButton-${g}`,onClick:a},n||(d?"Finish":"Next")),Ln=({text:n,handleClick:a,disabled:i,stepIndex:d})=>React.createElement(Button,{onClick:a,"data-testid":`backButton-${d}`,disabled:i},n||"Back"),xr=({actions:n={},children:a})=>{const i=In(),{stepperLength:d,stepIndex:g,setStepIndex:v,stepHistory:O,setStepHistory:N,onStepChange:G}=useContext(VerticalStepperContext),H=(Ce,Ie)=>{Ie&&Ie(),G&&G(g,Ce),v(Ce)},ne=()=>{const Ce=n.nextStep?n.nextStep(g,d-1):g+1;H(Ce,n.onNext),N([...O,Ce])},_=()=>{O.pop(),H(O[O.length-1],n.onBack),N([...O])},ve=()=>{H(0,n.onRestart),N([0])};return React.createElement("div",{className:i.root},[void 0,!0].includes(n.showBack)&&g!==0&&React.createElement(Ln,{text:n.backText,handleClick:_,disabled:g===0,stepIndex:g}),[void 0,!0].includes(n.showNext)&&React.createElement(An,{text:n.nextText,handleClick:ne,disabled:!!d&&g>=d||!!n.canNext&&!n.canNext(),stepIndex:g}),n.showRestart&&g!==0&&React.createElement(gn,{text:n.restartText,handleClick:ve,stepIndex:g}),a)},pr=(0,m.Z)(n=>({end:{padding:n.spacing(3)}}),{name:"SimpleStepperStep"});function aa(n){const{title:a,children:i,end:d,actions:g,...v}=n,O=pr();return d?React.createElement("div",{className:O.end},React.createElement(Typography,{variant:"h6"},a),i,React.createElement(SimpleStepperFooter,{actions:{...g||{},showNext:!1}})):React.createElement(MuiStep,{...v},React.createElement(StepLabel,null,React.createElement(Typography,{variant:"h6"},a)),React.createElement(StepContent,null,i,React.createElement(SimpleStepperFooter,{actions:g})))}const on=(0,m.Z)(n=>({status:{fontWeight:500,"&::before":{width:"0.7em",height:"0.7em",display:"inline-block",marginRight:8,borderRadius:"50%",content:'""'}},ok:{"&::before":{backgroundColor:n.palette.status.ok}},warning:{"&::before":{backgroundColor:n.palette.status.warning}},error:{"&::before":{backgroundColor:n.palette.status.error}},pending:{"&::before":{backgroundColor:n.palette.status.pending}},running:{"&::before":{backgroundColor:n.palette.status.running}},aborted:{"&::before":{backgroundColor:n.palette.status.aborted}}}),{name:"BackstageStatus"});function On(n){const a=on(n);return React.createElement("span",{className:classNames(a.status,a.ok),"aria-label":"Status ok","aria-hidden":"true",...n})}function Dr(n){const a=on(n);return React.createElement("span",{className:classNames(a.status,a.warning),"aria-label":"Status warning","aria-hidden":"true",...n})}function oa(n){const a=on(n);return React.createElement("span",{className:classNames(a.status,a.error),"aria-label":"Status error","aria-hidden":"true",...n})}function el(n){const a=on(n);return React.createElement("span",{className:classNames(a.status,a.pending),"aria-label":"Status pending","aria-hidden":"true",...n})}function tl(n){const a=on(n);return React.createElement("span",{className:classNames(a.status,a.running),"aria-label":"Status running","aria-hidden":"true",...n})}function nl(n){const a=on(n);return React.createElement("span",{className:classNames(a.status,a.aborted),"aria-label":"Status aborted","aria-hidden":"true",...n})}var rl=e(74600),ya=e(15584);const yo=n=>(0,o.Z)({root:{fontWeight:"bolder",whiteSpace:"nowrap",paddingRight:n.spacing(4),border:"0",verticalAlign:"top"}}),Eo={root:{border:"0",verticalAlign:"top"}},vo=n=>(0,o.Z)({root:{listStyle:"none",margin:n.spacing(0,0,-1,0),padding:"0"}}),Ao=n=>(0,o.Z)({root:{padding:n.spacing(0,0,1,0)},random:{}}),Ro=(0,mn.Z)(yo,{name:"BackstageMetadataTableTitleCell"})(ya.Z),So=(0,mn.Z)(Eo,{name:"BackstageMetadataTableCell"})(ya.Z),al=({dense:n,children:a})=>React.createElement(Table,{size:n?"small":"medium"},React.createElement(TableBody,null,a)),ol=({title:n,children:a,...i})=>React.createElement(TableRow,null,n&&React.createElement(Ro,null,n),React.createElement(So,{colSpan:n?1:2,...i},a)),Ea=(0,mn.Z)(vo,{name:"BackstageMetadataTableList"})(({classes:n,children:a})=>t.createElement("ul",{className:n.root},a)),sl=(0,mn.Z)(Ao,{name:"BackstageMetadataTableListItem"})(({classes:n,children:a})=>t.createElement("li",{className:n.root},a)),va=(0,o.Z)({root:{margin:"0 0",listStyleType:"none"}}),Co=n=>(0,o.Z)({root:{...va.root,paddingLeft:n.spacing(1)}}),Aa=(0,mn.Z)(va,{name:"BackstageStructuredMetadataTableList"})(({classes:n,children:a})=>t.createElement(Ea,{classes:n},a)),Ra=(0,mn.Z)(Co,{name:"BackstageStructuredMetadataTableNestedList"})(({classes:n,children:a})=>t.createElement(Ea,{classes:n},a));function To(n,a){const i=n.map((d,g)=>React.createElement(MetadataListItem,{key:g},sa(d)));return a?React.createElement(Ra,null,i):React.createElement(Aa,null,i)}function bo(n,a,i){const d=Object.keys(n).map(g=>{const v=sa(n[g],!0),O=i&&i.titleFormat?i.titleFormat(g):startCase(g);return React.createElement(MetadataListItem,{key:g},`${O}: `,v)});return a?React.createElement(Ra,null,d):React.createElement(Aa,null,d)}function sa(n,a,i){return React.isValidElement(n)?React.createElement(Fragment,null,n):typeof n=="object"&&!Array.isArray(n)?bo(n,a,i):Array.isArray(n)?To(n,i):typeof n=="boolean"?React.createElement(Fragment,null,n?"\u2705":"\u274C"):React.createElement(Fragment,null,n)}const Po=({value:n,options:a})=>React.createElement(Fragment,null,sa(n,a)),Io=({title:n,value:a,options:i})=>React.createElement(MetadataTableItem,{title:i&&i.titleFormat?i.titleFormat(n):startCase(n)},React.createElement(Po,{value:a,options:i}));function Lo(n,a){return Object.keys(n).map(i=>React.createElement(Io,{key:i,title:i,value:n[i],options:a}))}function il(n){const{metadata:a,dense:i=!0,options:d}=n,g=Lo(a,d||{});return React.createElement(MetadataTable,{dense:i},g)}var Oo=e(49429),xo=e(86136),Sa=e(79784),Fr=e(76635),Do=e(19126),Ca=e.n(Do);function Fo(n){return qs.stringify(n,{strictNullHandling:!0})}function Ta(n){return qs.parse(n,{ignoreQueryPrefix:!0,strictNullHandling:!0})}function ba(n,a){return Ta(n)[a]}function Bo(n,a,i){const d={...Ta(n),[a]:i};return Fo(d)}function ll(n,a=250){const[i,d]=useSearchParams(),g=i.toString(),[v,O]=useState(ba(g,n));return useEffect(()=>{const N=ba(g,n);O(G=>isEqual(N,G)?G:N)},[g,O,n]),useDebouncedEffect(()=>{const N=Bo(g,n,v);g!==N&&d(N,{replace:!0})},[d,v,g,n],a),[v,O]}const Mo={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 Pa(){const a=(0,l.useApiHolder)().get(l.configApiRef),i=a==null?void 0:a.getOptionalConfig("app.support");return i?{url:i.getString("url"),items:i.getConfigArray("items").flatMap(d=>{var g;return{title:d.getString("title"),icon:d.getOptionalString("icon"),links:((g=d.getOptionalConfigArray("links"))!=null?g:[]).flatMap(v=>({url:v.getString("url"),title:v.getString("title")}))}})}:Mo}var wo=e(80079);function Un(n,a){const d=(0,l.useApp)().getSystemIcon(n);return d?t.createElement(d,{...a}):t.createElement(wo.Z,{...a})}function cl(n){return Un("brokenImage",n)}function ul(n){return Un("catalog",n)}function dl(n){return Un("chat",n)}function fl(n){return Un("dashboard",n)}function ml(n){return Un("docs",n)}function hl(n){return Un("email",n)}function gl(n){return Un("github",n)}function pl(n){return Un("group",n)}function Kr(n){return Un("help",n)}function yl(n){return Un("user",n)}function El(n){return Un("warning",n)}const $o=(0,m.Z)({popoverList:{minWidth:260,maxWidth:400}},{name:"BackstageSupportButton"}),Uo=({icon:n})=>{var d;const a=(0,l.useApp)(),i=n&&(d=a.getSystemIcon(n))!=null?d:Kr;return t.createElement(i,null)},No=({link:n})=>{var a;return t.createElement(b,{to:n.url},(a=n.title)!=null?a:n.url)},Zo=({item:n})=>{var a;return t.createElement(xt.Z,null,t.createElement(xo.Z,null,t.createElement(Uo,{icon:n.icon})),t.createElement(qt.Z,{primary:n.title,secondary:(a=n.links)==null?void 0:a.reduce((i,d,g)=>[...i,g>0&&t.createElement("br",{key:g}),t.createElement(No,{link:d,key:d.url})],[])}))};function zo(n){const{title:a,children:i}=n,{items:d}=Pa(),[g,v]=(0,t.useState)(!1),[O,N]=(0,t.useState)(null),G=$o(),H=(0,st.Z)(ve=>ve.breakpoints.down("sm")),ne=ve=>{N(ve.currentTarget),v(!0)},_=()=>{v(!1)};return t.createElement(t.Fragment,null,t.createElement(Fn.Z,{display:"flex",ml:1},H?t.createElement(Y.Z,{color:"primary",size:"small",onClick:ne,"data-testid":"support-button"},t.createElement(Kr,null)):t.createElement(y.Z,{"data-testid":"support-button","aria-label":"support",color:"primary",onClick:ne,startIcon:t.createElement(Kr,null)},"Support")),t.createElement(Sa.ZP,{"data-testid":"support-button-popover",open:g,anchorEl:O,anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"},onClose:_},t.createElement(dn.Z,{className:G.popoverList},a&&t.createElement(xt.Z,{alignItems:"flex-start"},t.createElement(at.Z,{variant:"subtitle1"},a)),t.Children.map(i,(ve,Ce)=>t.createElement(xt.Z,{alignItems:"flex-start",key:`child-${Ce}`},ve)),d&&d.map((ve,Ce)=>t.createElement(Zo,{item:ve,key:`item-${Ce}`}))),t.createElement(Oo.Z,null,t.createElement(y.Z,{color:"primary",onClick:_},"Close"))))}var ia=e(18671),Mn=e(10289);const kr=72,Ia=24,La=18,kn={drawerWidthClosed:kr,drawerWidthOpen:224,defaultOpenDelayMs:100,defaultCloseDelayMs:0,defaultFadeDuration:200,logoHeight:32,iconContainerWidth:kr,iconSize:kr-Ia*2,iconPadding:Ia,selectedIndicatorWidth:3,userBadgePadding:La,userBadgeDiameter:kr-La*2,mobileSidebarHeight:56},Wo=n=>({...kn,...n,iconContainerWidth:kn.drawerWidthClosed,iconSize:kn.drawerWidthClosed-kn.iconPadding*2,userBadgeDiameter:kn.drawerWidthClosed-kn.userBadgePadding*2}),Oa={drawerWidthClosed:0,drawerWidthOpen:202,defaultOpenDelayMs:kn.defaultOpenDelayMs+200},Ho=n=>({...Oa,...n}),vl="@backstage/core/sidebar-intro-dismissed",jn=(0,t.createContext)({sidebarConfig:kn,submenuConfig:Oa}),xa=(0,t.createContext)({isHoveredOn:!1,setIsHoveredOn:()=>{}});var Yr;(function(n){const a="sidebarPinState";n.SIDEBAR_PIN_STATE=a})(Yr||(Yr={}));const Da={getSidebarPinState(){let n;try{n=JSON.parse(window.localStorage.getItem(Yr.SIDEBAR_PIN_STATE)||"true")}catch{return!0}return!!n},setSidebarPinState(n){return window.localStorage.setItem(Yr.SIDEBAR_PIN_STATE,JSON.stringify(n))}};var Jr=e(76241);const Fa={isPinned:!0,toggleSidebarPinState:()=>{},isMobile:!1},Ba=(0,t.createContext)(Fa),Ma=(0,Jr.CT)("sidebar-pin-state-context"),jo=({children:n,value:a})=>t.createElement(Ba.Provider,{value:a},t.createElement(Ma.Provider,{value:(0,Jr.EI)({1:a})},n)),Br=()=>{const n=(0,t.useContext)(Ma),a=(0,t.useContext)(Ba);if(n===void 0)return a||Fa;const i=n.atVersion(1);if(i===void 0)throw new Error("No context found for version 1.");return i},Vo=(0,m.Z)(n=>({root:{width:"100%",transition:"padding-left 0.1s ease-out",isolation:"isolate",[n.breakpoints.up("sm")]:{paddingLeft:a=>a.isPinned?a.sidebarConfig.drawerWidthOpen:a.sidebarConfig.drawerWidthClosed},[n.breakpoints.down("xs")]:{paddingBottom:a=>a.sidebarConfig.mobileSidebarHeight}},content:{zIndex:0,isolation:"isolate","&:focus":{outline:0}}}),{name:"BackstageSidebarPage"}),wa=(0,t.createContext)({content:{contentRef:void 0}});function Go(n){const[a,i]=(0,t.useState)(()=>Da.getSidebarPinState()),{sidebarConfig:d}=(0,t.useContext)(jn),g=(0,t.useRef)(null),v=(0,t.useMemo)(()=>({content:{contentRef:g}}),[g]);(0,t.useEffect)(()=>{Da.setSidebarPinState(a)},[a]);const O=(0,st.Z)(H=>H.breakpoints.down("xs"),{noSsr:!0}),N=()=>i(!a),G=Vo({isPinned:a,sidebarConfig:d});return t.createElement(jo,{value:{isPinned:a,toggleSidebarPinState:N,isMobile:O}},t.createElement(wa.Provider,{value:v},t.createElement("div",{className:G.root},n.children)))}function $a(){const{content:n}=(0,t.useContext)(wa);return{focusContent:(0,t.useCallback)(()=>{var i,d;(d=(i=n==null?void 0:n.contentRef)==null?void 0:i.current)==null||d.focus()},[n]),contentRef:n==null?void 0:n.contentRef}}const Ua={isOpen:!1,setOpen:()=>{}},Na=(0,t.createContext)(Ua),Za=(0,Jr.CT)("sidebar-open-state-context"),za=({children:n,value:a})=>t.createElement(Na.Provider,{value:a},t.createElement(Za.Provider,{value:(0,Jr.EI)({1:a})},n)),la=()=>{const n=(0,t.useContext)(Za),a=(0,t.useContext)(Na);if(n===void 0)return a||Ua;const i=n.atVersion(1);if(i===void 0)throw new Error("No context found for version 1.");return i};var Ko=e(50023),ko=e(4190),Yo=e(87685),Jo=e(44882),Qo=e(57998);const Xo=(0,m.Z)(n=>({root:{flexGrow:0,margin:n.spacing(0,2),color:n.palette.navigation.color},selected:a=>({color:`${n.palette.navigation.selectedColor}!important`,borderTop:`solid ${a.sidebarConfig.selectedIndicatorWidth}px ${n.palette.navigation.indicator}`,marginTop:"-1px"}),label:{display:"none"}})),qo=n=>{const{to:a,label:i,icon:d,value:g}=n,{sidebarConfig:v}=(0,t.useContext)(jn),O=Xo({sidebarConfig:v}),N=(0,Mn.TH)(),{selectedMenuItemIndex:G,setSelectedMenuItemIndex:H}=(0,t.useContext)(ja),ne=(ve,Ce)=>{H(Ce===G?-1:Ce)},_=g===G&&G>=0||g!==G&&!(G>=0)&&a===N.pathname;return t.createElement(Qo.Z,{label:i,icon:d,component:b,to:a||N.pathname,onChange:ne,value:g,selected:_,classes:O})},Wa=n=>{const{children:a,to:i,label:d,icon:g,value:v}=n,{isMobile:O}=Br();return O?t.createElement(qo,{to:i,label:d,icon:g,value:v}):t.createElement(t.Fragment,null,a)},Ha=(0,m.Z)(n=>({root:{position:"fixed",backgroundColor:n.palette.navigation.background,color:n.palette.navigation.color,bottom:0,left:0,right:0,zIndex:n.zIndex.snackbar,borderTop:"1px solid #383838"},overlay:a=>({background:n.palette.navigation.background,width:"100%",bottom:`${a.sidebarConfig.mobileSidebarHeight}px`,height:`calc(100% - ${a.sidebarConfig.mobileSidebarHeight}px)`,flex:"0 1 auto",overflow:"auto"}),overlayHeader:{display:"flex",color:n.palette.bursts.fontColor,alignItems:"center",justifyContent:"space-between",padding:n.spacing(2,3)},overlayHeaderClose:{color:n.palette.bursts.fontColor},marginMobileSidebar:a=>({marginBottom:`${a.sidebarConfig.mobileSidebarHeight}px`})})),_o=n=>(0,Fr.orderBy)(n,({props:{priority:a}})=>Number.isInteger(a)?a:-1,"desc"),es=t.createElement(Wa).type,ts=({children:n,label:a="Menu",open:i,onClose:d})=>{const{sidebarConfig:g}=(0,t.useContext)(jn),v=Ha({sidebarConfig:g});return t.createElement(ko.ZP,{anchor:"bottom",open:i,onClose:d,ModalProps:{BackdropProps:{classes:{root:v.marginMobileSidebar}}},classes:{root:v.marginMobileSidebar,paperAnchorBottom:v.overlay}},t.createElement(Fn.Z,{className:v.overlayHeader},t.createElement(at.Z,{variant:"h3"},a),t.createElement(Y.Z,{onClick:d,classes:{root:v.overlayHeaderClose}},t.createElement(Yo.Z,null))),t.createElement(Fn.Z,{component:"nav"},n))},ja=(0,t.createContext)({selectedMenuItemIndex:-1,setSelectedMenuItemIndex:()=>{}}),ns=n=>{const{sidebarConfig:a}=(0,t.useContext)(jn),{children:i}=n,d=Ha({sidebarConfig:a}),g=(0,Mn.TH)(),[v,O]=(0,t.useState)(-1);(0,t.useEffect)(()=>{O(-1)},[g.pathname]);let N=(0,l.useElementFilter)(i,H=>H.getElements().filter(ne=>ne.type===es));if(i)N.length?N=_o(N):N.push(t.createElement(Wa,{key:"default_menu",icon:t.createElement(Jo.Z,null)},i));else return null;const G=v>=0&&!N[v].props.to;return t.createElement(za,{value:{isOpen:!0,setOpen:()=>{}}},t.createElement(ja.Provider,{value:{selectedMenuItemIndex:v,setSelectedMenuItemIndex:O}},t.createElement(ts,{label:N[v]&&N[v].props.label,open:G,onClose:()=>O(-1)},N[v]&&N[v].props.children),t.createElement(Ko.Z,{className:d.root,"data-testid":"mobile-sidebar-root",component:"nav"},N)))},Va=(0,m.Z)(n=>({drawer:a=>({display:"flex",flexFlow:"column nowrap",alignItems:"flex-start",position:"fixed",left:0,top:0,bottom:0,zIndex:n.zIndex.appBar,background:n.palette.navigation.background,overflowX:"hidden",msOverflowStyle:"none",scrollbarWidth:"none",width:a.sidebarConfig.drawerWidthClosed,transition:n.transitions.create("width",{easing:n.transitions.easing.sharp,duration:n.transitions.duration.shortest}),"& > *":{flexShrink:0},"&::-webkit-scrollbar":{display:"none"}}),drawerOpen:a=>({width:a.sidebarConfig.drawerWidthOpen,transition:n.transitions.create("width",{easing:n.transitions.easing.sharp,duration:n.transitions.duration.shorter})}),visuallyHidden:{top:0,position:"absolute",zIndex:1e3,transform:"translateY(-200%)","&:focus":{transform:"translateY(5px)"}}}),{name:"BackstageSidebar"});var xn;(function(n){n[n.Closed=0]="Closed";const i=0+1;n[n.Idle=i]="Idle";const d=i+1;n[n.Open=d]="Open"})(xn||(xn={}));const rs=n=>{const{sidebarConfig:a}=(0,t.useContext)(jn),{openDelayMs:i=a.defaultOpenDelayMs,closeDelayMs:d=a.defaultCloseDelayMs,disableExpandOnHover:g,children:v}=n,O=Va({sidebarConfig:a}),N=(0,st.Z)(Yt=>Yt.breakpoints.down("md"),{noSsr:!0}),[G,H]=(0,t.useState)(xn.Closed),ne=(0,t.useRef)(),{isPinned:_,toggleSidebarPinState:ve}=Br(),Ce=()=>{_||g||(ne.current&&(clearTimeout(ne.current),ne.current=void 0),G!==xn.Open&&!N&&(ne.current=window.setTimeout(()=>{ne.current=void 0,H(xn.Open)},i),H(xn.Idle)))},Ie=()=>{_||g||(ne.current&&(clearTimeout(ne.current),ne.current=void 0),G===xn.Idle?H(xn.Closed):G===xn.Open&&(ne.current=window.setTimeout(()=>{ne.current=void 0,H(xn.Closed)},d)))},gt=G===xn.Open&&!N||_,Ut=Yt=>{Yt?(H(xn.Open),ve()):(H(xn.Closed),ve())};return t.createElement("nav",{style:{},"aria-label":"sidebar nav"},t.createElement(os,null),t.createElement(za,{value:{isOpen:gt,setOpen:Ut}},t.createElement("div",{className:O.root,"data-testid":"sidebar-root",onMouseEnter:g?()=>{}:Ce,onFocus:g?()=>{}:Ce,onMouseLeave:g?()=>{}:Ie,onBlur:g?()=>{}:Ie},t.createElement("div",{className:E()(O.drawer,{[O.drawerOpen]:gt})},v))))},as=n=>{var G,H;const a=Wo((G=n.sidebarOptions)!=null?G:{}),i=Ho((H=n.submenuOptions)!=null?H:{}),{children:d,disableExpandOnHover:g,openDelayMs:v,closeDelayMs:O}=n,{isMobile:N}=Br();return N?t.createElement(ns,null,d):t.createElement(jn.Provider,{value:{sidebarConfig:a,submenuConfig:i}},t.createElement(rs,{openDelayMs:v,closeDelayMs:O,disableExpandOnHover:g},d))};function os(){const{sidebarConfig:n}=(0,t.useContext)(jn),{focusContent:a,contentRef:i}=$a(),d=Va({sidebarConfig:n});return i!=null&&i.current?t.createElement(y.Z,{onClick:a,variant:"contained",className:E()(d.visuallyHidden)},"Skip to content"):null}function Ga(n,a){const i=new URLSearchParams(a.search).toString(),d=Ca().parse(i),g=new URLSearchParams(n.search).toString(),v=Ca().parse(g);return(0,Fr.isEqual)(a.pathname,n.pathname)&&(0,Fr.isMatch)(v,d)}const ss=(0,m.Z)(n=>({item:{height:48,width:"100%","&:hover":{background:"#6f6f6f",color:n.palette.navigation.selectedColor},display:"flex",alignItems:"center",color:n.palette.navigation.color,padding:20,cursor:"pointer",position:"relative",background:"none",border:"none"},itemContainer:{width:"100%"},selected:{background:"#6f6f6f",color:"#FFF"},label:{margin:14,marginLeft:7,fontSize:14,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:"#6f6f6f",color:n.palette.navigation.selectedColor}},textContent:{color:n.palette.navigation.color,paddingLeft:n.spacing(4),paddingRight:n.spacing(1),fontSize:"14px",whiteSpace:"nowrap",overflow:"hidden","text-overflow":"ellipsis"}}),{name:"BackstageSidebarSubmenuItem"}),Al=n=>{const{title:a,to:i,icon:d,dropdownItems:g}=n,v=ss(),{setIsHoveredOn:O}=useContext(SidebarItemWithSubmenuContext),N=()=>{O(!1)},G=useResolvedPath(i!=null?i:""),H=useLocation();let ne=isLocationMatch(H,G);const[_,ve]=useState(!1),Ce=()=>{ve(!_)};return g!==void 0?(g.some(Ie=>{const gt=resolvePath(Ie.to);return ne=isLocationMatch(H,gt),ne}),React.createElement("div",{className:v.itemContainer},React.createElement(Tooltip,{title:a,enterDelay:500,enterNextDelay:500},React.createElement("button",{onClick:Ce,onTouchStart:Ie=>Ie.stopPropagation(),className:classnames(v.item,ne?v.selected:void 0)},d&&React.createElement(d,{fontSize:"small"}),React.createElement(Typography,{variant:"subtitle1",className:v.label},a),_?React.createElement(ArrowDropUpIcon,{className:v.dropdownArrow}):React.createElement(ArrowDropDownIcon,{className:v.dropdownArrow}))),g&&_&&React.createElement("div",{className:v.dropdown},g.map((Ie,gt)=>React.createElement(Tooltip,{key:gt,title:Ie.title,enterDelay:500,enterNextDelay:500},React.createElement(Link,{to:Ie.to,underline:"none",className:v.dropdownItem,onClick:N,onTouchStart:Ut=>Ut.stopPropagation()},React.createElement(Typography,{className:v.textContent},Ie.title))))))):React.createElement("div",{className:v.itemContainer},React.createElement(Tooltip,{title:a,enterDelay:500,enterNextDelay:500},React.createElement(Link,{to:i,underline:"none",className:classnames(v.item,ne?v.selected:void 0),onClick:N,onTouchStart:Ie=>Ie.stopPropagation()},d&&React.createElement(d,{fontSize:"small"}),React.createElement(Typography,{variant:"subtitle1",className:v.label},a))))},is=(0,m.Z)(n=>({root:{zIndex:1e3,position:"relative",overflow:"visible",width:n.spacing(7)+1},drawer:a=>{var i,d;return{display:"flex",flexFlow:"column nowrap",alignItems:"flex-start",position:"fixed",[n.breakpoints.up("sm")]:{marginLeft:a.left,transition:n.transitions.create("margin-left",{easing:n.transitions.easing.sharp,duration:n.transitions.duration.shortest})},top:0,bottom:0,padding:0,background:(d=(i=n.palette.navigation.submenu)==null?void 0:i.background)!=null?d:"#404040",overflowX:"hidden",msOverflowStyle:"none",scrollbarWidth:"none",cursor:"default",width:a.submenuConfig.drawerWidthClosed,transitionDelay:`${a.submenuConfig.defaultOpenDelayMs}ms`,"& > *":{flexShrink:0},"&::-webkit-scrollbar":{display:"none"}}},drawerOpen:a=>({width:a.submenuConfig.drawerWidthOpen,[n.breakpoints.down("xs")]:{width:"100%",position:"relative",paddingLeft:n.spacing(3),left:0,top:0}}),title:{fontSize:24,fontWeight:500,color:"#FFF",padding:20,[n.breakpoints.down("xs")]:{display:"none"}}}),{name:"BackstageSidebarSubmenu"}),ls=n=>{const{isOpen:a}=la(),{sidebarConfig:i,submenuConfig:d}=(0,t.useContext)(jn),g=a?i.drawerWidthOpen:i.drawerWidthClosed,v=is({left:g,submenuConfig:d}),{isHoveredOn:O}=(0,t.useContext)(xa),[N,G]=(0,t.useState)(!1);return(0,t.useEffect)(()=>{G(O)},[O]),t.createElement("div",{className:E()(v.drawer,{[v.drawerOpen]:N})},t.createElement(at.Z,{variant:"h5",className:v.title},n.title),n.children)};var Qr=e(76600),cs=e(26739),Ka=e(98989),us=e(59797),ds=e(83543);const fs=(0,m.Z)({iconContainer:{display:"flex",position:"relative",width:"100%"},arrow1:{right:"6px",position:"absolute"}}),Rl=()=>{const n=fs();return React.createElement("div",{className:n.iconContainer},React.createElement("div",{className:n.arrow1},React.createElement(ArrowBackIosIcon,{style:{fontSize:"12px"}})),React.createElement("div",null,React.createElement(ArrowBackIosIcon,{style:{fontSize:"12px"}})))};var Sl=null;const ms=(0,m.Z)({iconContainer:{display:"flex",position:"relative",width:"100%"},arrow1:{right:"6px",position:"absolute"}}),Cl=()=>{const n=ms();return React.createElement("div",{className:n.iconContainer},React.createElement("div",{className:n.arrow1},React.createElement(ArrowForwardIosIcon,{style:{fontSize:"12px"}})),React.createElement("div",null,React.createElement(ArrowForwardIosIcon,{style:{fontSize:"12px"}})))};var Tl=null;const hs=n=>(0,m.Z)(a=>{var i,d,g,v;return{root:{color:a.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"},closed:{width:n.drawerWidthClosed,justifyContent:"center"},open:{[a.breakpoints.up("sm")]:{width:n.drawerWidthOpen}},highlightable:{"&:hover":{background:(d=(i=a.palette.navigation.navItem)==null?void 0:i.hoverBackground)!=null?d:"#404040"}},highlighted:{background:(v=(g=a.palette.navigation.navItem)==null?void 0:g.hoverBackground)!=null?v:"#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:n.iconContainerWidth,marginRight:-a.spacing(2),display:"flex",alignItems:"center",justifyContent:"center"},searchRoot:{marginBottom:12},searchField:{color:"#b5b5b5",fontWeight:"bold",fontSize:a.typography.fontSize},searchFieldHTMLInput:{padding:a.spacing(2,0,2)},searchContainer:{width:n.drawerWidthOpen-n.iconContainerWidth},secondaryAction:{width:a.spacing(6),textAlign:"center",marginRight:a.spacing(1)},closedItemIcon:{width:"100%",justifyContent:"center"},submenuArrow:{display:"flex"},expandButton:{background:"none",border:"none",color:a.palette.navigation.color,width:"100%",cursor:"pointer",position:"relative",height:48},arrows:{position:"absolute",right:10},selected:{"&$root":{borderLeft:`solid ${n.selectedIndicatorWidth}px ${a.palette.navigation.indicator}`,color:a.palette.navigation.selectedColor},"&$closed":{width:n.drawerWidthClosed},"& $closedItemIcon":{paddingRight:n.selectedIndicatorWidth},"& $iconContainer":{marginLeft:-n.selectedIndicatorWidth}}}},{name:"BackstageSidebarItem"});function Xr(n){return(0,t.useMemo)(()=>hs(n),[n])()}const gs=(n,a)=>(0,l.useElementFilter)(n.props.children,i=>{let d=!1;return i.getElements().forEach(({props:{to:g,dropdownItems:v}})=>{if(!d){if(v!=null&&v.length){v.forEach(({to:O})=>d=d||Ga(a,(0,Mn.i3)(O)));return}g&&(d=Ga(a,(0,Mn.i3)(g)))}}),d},[a.pathname]);function ka(n){return n.to===void 0}const ps=t.createElement(ls).type,ys=t.forwardRef(function({to:a,end:i,style:d,className:g,activeStyle:v,caseSensitive:O,activeClassName:N="active","aria-current":G="page",...H},ne){let{pathname:_}=(0,Mn.TH)(),{pathname:ve}=(0,Mn.WU)(a);O||(_=_.toLocaleLowerCase("en-US"),ve=ve.toLocaleLowerCase("en-US"));let Ce=_===ve;!Ce&&!i&&(Ce=_.startsWith(`${ve}/`));const Ie=Ce?G:void 0;return t.createElement(I.rU,{...H,to:a,ref:ne,"aria-current":Ie,style:{...d,...Ce?v:void 0},className:E()([g,Ce?N:void 0])})}),Ya=(0,t.forwardRef)((n,a)=>{const{icon:i,text:d,hasNotifications:g=!1,hasSubmenu:v=!1,disableHighlight:O=!1,onClick:N,children:G,className:H,...ne}=n,{sidebarConfig:_}=(0,t.useContext)(jn),ve=Xr(_),{isOpen:Ce}=la(),Ie=!Ce&&v?{display:"flex",marginLeft:"24px"}:{},gt=t.createElement("div",{style:Ie},t.createElement(i,{fontSize:"small"}),!Ce&&v?t.createElement(Ka.Z,null):t.createElement(t.Fragment,null)),Ut=t.createElement(cs.Z,{color:"secondary",variant:"dot",overlap:"circular",invisible:!g,className:E()({[ve.closedItemIcon]:!Ce})},gt),Yt=t.createElement(t.Fragment,null,t.createElement("div",{"data-testid":"login-button",className:ve.iconContainer},Ut),d&&t.createElement(at.Z,{variant:"subtitle2",className:ve.label},d),t.createElement("div",{className:ve.secondaryAction},G)),Jt=Ce?Yt:Ut,dt={onClick:N,className:E()(H,ve.root,Ce?ve.open:ve.closed,ka(n)&&ve.buttonItem,{[ve.highlightable]:!O})};return ka(n)?t.createElement("button",{"aria-label":d,...dt,ref:a},Jt):t.createElement(ys,{...dt,activeClassName:ve.selected,to:n.to?n.to:"",ref:a,"aria-label":d||n.to,...ne},Jt)}),Es=({children:n,...a})=>{const{sidebarConfig:i}=(0,t.useContext)(jn),d=Xr(i),[g,v]=(0,t.useState)(!1),O=(0,Mn.TH)(),N=gs(n,O),G=(0,st.Z)(ve=>ve.breakpoints.down("sm")),H=()=>{v(!0)},ne=()=>{v(!1)},_=()=>G?g?t.createElement(us.Z,{fontSize:"small",className:d.submenuArrow}):t.createElement(ds.Z,{fontSize:"small",className:d.submenuArrow}):!g&&t.createElement(Ka.Z,{fontSize:"small",className:d.submenuArrow});return t.createElement(xa.Provider,{value:{isHoveredOn:g,setIsHoveredOn:v}},t.createElement("div",{"data-testid":"item-with-submenu",onMouseLeave:ne,onTouchStart:g?ne:H,onMouseEnter:H,className:E()(g&&d.highlighted)},t.createElement(Ya,{hasSubmenu:!0,className:N?d.selected:"",...a},_()),g&&n))},Ja=(0,t.forwardRef)((n,a)=>{const[i]=(0,l.useElementFilter)(n.children,d=>d.getElements().filter(g=>g.type===ps));return i?t.createElement(Es,{...n},i):t.createElement(Ya,{...n,ref:a})});function bl(n){const{sidebarConfig:a}=useContext(SidebarConfigContext),[i,d]=useState(""),g=Xr(a),v=n.icon?n.icon:SearchIcon,O=()=>{n.onSearch(i),d("")},N=_=>{_.key==="Enter"&&(_.preventDefault(),O())},G=_=>{d(_.target.value)},H=_=>{_.preventDefault(),_.stopPropagation()},ne=_=>{O(),_.preventDefault()};return React.createElement("div",{className:g.searchRoot},React.createElement(Ja,{icon:v,to:n.to,onClick:ne,disableHighlight:!0},React.createElement(TextField,{placeholder:"Search",value:i,onClick:H,onChange:G,onKeyDown:N,className:g.searchContainer,InputProps:{disableUnderline:!0,className:g.searchField},inputProps:{className:g.searchFieldHTMLInput}})))}const Pl=(0,Qr.Z)("div")({flex:1},{name:"BackstageSidebarSpace"}),Il=(0,Qr.Z)("div")({height:8},{name:"BackstageSidebarSpacer"}),vs=(0,Qr.Z)("hr")({height:1,width:"100%",background:"#383838",border:"none",margin:"12px 0px"},{name:"BackstageSidebarDivider"}),As=n=>({overflowY:"auto","&::-webkit-scrollbar":{backgroundColor:n.palette.background.default,width:"5px",borderRadius:"5px"},"&::-webkit-scrollbar-thumb":{backgroundColor:n.palette.text.hint,borderRadius:"5px"}}),Ll=(0,Qr.Z)("div")(({theme:n})=>{const a=As(n);return{flex:"0 1 auto",overflowX:"hidden",width:"calc(100% - 5px)",minHeight:"48px",overflowY:"hidden","@media (hover: none)":a,"&:hover":a}}),Ol=()=>{const{sidebarConfig:n}=useContext(SidebarConfigContext),a=Xr(n),{isOpen:i,setOpen:d}=useSidebarOpenState();if(useMediaQuery(O=>O.breakpoints.down("md"),{noSsr:!0}))return null;const v=()=>{d(!i)};return React.createElement("button",{onClick:v,className:a.expandButton,"aria-label":"Expand Sidebar","data-testid":"sidebar-expand-button"},React.createElement("div",{className:a.arrows},i?React.createElement(DoubleArrowLeft,null):React.createElement(DoubleArrowRight,null)))},Rs=(0,m.Z)(n=>({introCard:a=>({color:"#b5b5b5",fontSize:12,width:a.sidebarConfig.drawerWidthOpen,marginTop:18,marginBottom:12,paddingLeft:a.sidebarConfig.iconPadding,paddingRight:a.sidebarConfig.iconPadding}),introDismiss:{display:"flex",justifyContent:"flex-end",alignItems:"center",marginTop:12},introDismissLink:{color:"#dddddd",display:"flex",alignItems:"center",marginBottom:4,"&:hover":{color:n.palette.linkHover,transition:n.transitions.create("color",{easing:n.transitions.easing.sharp,duration:n.transitions.duration.shortest})}},introDismissText:{fontSize:"0.7rem",fontWeight:"bold",textTransform:"uppercase",letterSpacing:1},introDismissIcon:{width:18,height:18,marginRight:12}}),{name:"BackstageSidebarIntro"});function Ss(n){const{sidebarConfig:a}=useContext(SidebarConfigContext),i=Rs({sidebarConfig:a}),{text:d,onClose:g}=n,v=()=>g();return React.createElement("div",{className:i.introCard},React.createElement(Typography,{variant:"subtitle2"},d),React.createElement("div",{className:i.introDismiss},React.createElement(Link,{component:"button",onClick:v,underline:"none",className:i.introDismissLink},React.createElement(CloseIcon,{className:i.introDismissIcon}),React.createElement(Typography,{component:"span",className:i.introDismissText},"Dismiss"))))}const Qa=n=>{const{text:a,onDismiss:i}=n,[d,g]=useState(!1),v=()=>{g(!0)};return React.createElement(Collapse,{in:!d,onExited:i},React.createElement(Ss,{text:a,onClose:v}))},Cs=null,Ts="And your recently viewed plugins will pop up here!";function xl(n){const{isOpen:a}=useSidebarOpenState(),i={starredItemsDismissed:!1,recentlyViewedItemsDismissed:!1},[d,g]=useLocalStorageValue(SIDEBAR_INTRO_LOCAL_STORAGE),{starredItemsDismissed:v,recentlyViewedItemsDismissed:O}=d!=null?d:{},N=()=>{g(H=>({...i,...H,starredItemsDismissed:!0}))},G=()=>{g(H=>({...i,...H,recentlyViewedItemsDismissed:!0}))};return a?React.createElement(React.Fragment,null,!v&&React.createElement(React.Fragment,null,React.createElement(Qa,{text:Cs,onDismiss:N}),React.createElement(SidebarDivider,null)),!O&&React.createElement(Qa,{text:Ts,onDismiss:G})):null}const bs=(0,m.Z)(n=>({root:{gridArea:"pageContent",minWidth:0,paddingTop:n.spacing(3),paddingBottom:n.spacing(3),paddingLeft:n.spacing(2),paddingRight:n.spacing(2),[n.breakpoints.up("sm")]:{paddingLeft:n.spacing(3),paddingRight:n.spacing(3)}},stretch:{display:"flex",flexDirection:"column",flexGrow:1},noPadding:{padding:0}}),{name:"BackstageContent"});function Xa(n){const{className:a,stretch:i,noPadding:d,children:g,...v}=n,{contentRef:O}=$a(),N=bs();return t.createElement("article",{ref:O,tabIndex:-1,...v,className:E()(N.root,a,{[N.stretch]:i,[N.noPadding]:d})},g)}var Ps=e(6487),Is=e(99152);const Ls=(0,m.Z)(n=>({tabsWrapper:{gridArea:"pageSubheader",backgroundColor:n.palette.background.paper,paddingLeft:n.spacing(3),minWidth:0},defaultTab:{padding:n.spacing(3,3),...n.typography.caption,textTransform:"uppercase",fontWeight:"bold",color:n.palette.text.secondary},selected:{color:n.palette.text.primary},tabRoot:{"&:hover":{backgroundColor:n.palette.background.default,color:n.palette.text.primary}}}),{name:"BackstageHeaderTabs"});function qa(n){const{tabs:a,onChange:i,selectedIndex:d}=n,[g,v]=(0,t.useState)(d!=null?d:0),O=Ls(),N=(G,H)=>{d===void 0&&v(H),i&&i(H)};return(0,t.useEffect)(()=>{d!==void 0&&v(d)},[d]),t.createElement("div",{className:O.tabsWrapper},t.createElement(Is.Z,{selectionFollowsFocus:!0,indicatorColor:"primary",textColor:"inherit",variant:"scrollable",scrollButtons:"auto","aria-label":"scrollable auto tabs example",onChange:N,value:g},a.map((G,H)=>t.createElement(Ps.Z,{...G.tabProps,"data-testid":`header-tab-${H}`,label:G.label,key:G.id,value:H,className:O.defaultTab,classes:{selected:O.selected,root:O.tabRoot}}))))}function Os(n){var N,G,H;const a=(0,Mn.UO)(),d=n.map(({path:ne,children:_})=>({caseSensitive:!1,path:`${ne}/*`,element:_})).sort((ne,_)=>_.path.replace(/\/\*$/,"").localeCompare(ne.path.replace(/\/\*$/,""))),g=(N=(0,Mn.V$)(d))!=null?N:n[0].children,[v]=(G=(0,Mn.fp)(d,`/${a["*"]}`))!=null?G:[],O=v?n.findIndex(ne=>`${ne.path}/*`===v.route.path):0;return{index:O===-1?0:O,element:g,route:(H=n[O])!=null?H:n[0]}}function _a(n){const{routes:a}=n,i=(0,Mn.s0)(),{index:d,route:g,element:v}=Os(a),O=(0,t.useMemo)(()=>a.map(G=>({id:G.path,label:G.title,tabProps:G.tabProps})),[a]),N=G=>i(a[G].path.replace(/\/\*$/,"").replace(/^\//,""));return t.createElement(t.Fragment,null,t.createElement(qa,{tabs:O,selectedIndex:d,onChange:N}),t.createElement(Xa,null,t.createElement(ia.q,{title:g.title}),v))}const ca=()=>null;(0,l.attachComponentData)(ca,"core.gatherMountPoints",!0);function eo(n){const a=t.createElement(ca,{path:"",title:""},t.createElement("div",null)).type;return t.Children.toArray(n).flatMap(i=>{if(!(0,t.isValidElement)(i))return[];if(i.type===t.Fragment)return eo(i.props.children);if(i.type!==a)throw new Error("Child of TabbedLayout must be an TabbedLayout.Route");const{path:d,title:g,children:v,tabProps:O}=i.props;return[{path:d,title:g,children:v,tabProps:O}]})}function xs(n){const a=eo(n.children);return t.createElement(_a,{routes:a})}xs.Route=ca;const Ds=(0,m.Z)(n=>({value:{marginBottom:"6px"},subvalue:{color:n.palette.textSubtle,fontWeight:"normal"}}),{name:"BackstageSubvalueCell"});function Fs(n){const{value:a,subvalue:i}=n,d=Ds();return t.createElement(t.Fragment,null,t.createElement("div",{className:d.value},a),t.createElement("div",{className:d.subvalue},i))}var Bs=e(21070),Ms=e(90324),ws=e(98281),$s=e(48049),to=e(51209),no=e(33375),Us=e(44233),Ns=e(27604),ua=e(36444),Zs=e(37971),zs=e(59709),Ws=e(17373),Hs=e(3702),js=e(93111),qr=e(67222);const Vs=(0,m.Z)(n=>({root:{height:"100%",width:"315px",display:"flex",flexDirection:"column",marginRight:n.spacing(3)},value:{fontWeight:"bold",fontSize:18},header:{display:"flex",alignItems:"center",height:"60px",justifyContent:"space-between",borderBottom:`1px solid ${n.palette.grey[500]}`},filters:{display:"flex",flexDirection:"column","& > *":{marginTop:n.spacing(2)}}}),{name:"BackstageTableFilters"}),Gs=n=>{var G;const a=Vs(),{onChangeFilters:i}=n,[d,g]=(0,t.useState)({...n.selectedFilters}),[v,O]=(0,t.useState)(!1),N=()=>{g({}),O(H=>!H)};return(0,t.useEffect)(()=>{i(d)},[d,i]),t.createElement("div",{className:a.root},t.createElement("div",{className:a.header},t.createElement("div",{className:a.value},"Filters"),t.createElement(y.Z,{color:"primary",onClick:N},"Clear all")),t.createElement("div",{className:a.filters},((G=n.filters)==null?void 0:G.length)&&n.filters.map(H=>t.createElement(He,{triggerReset:v,key:H.element.label,...H.element,selected:d[H.element.label],onChange:ne=>g({...d,[H.element.label]:ne})}))))},Ks={Add:(0,t.forwardRef)((n,a)=>t.createElement(Bs.Z,{...n,ref:a})),Check:(0,t.forwardRef)((n,a)=>t.createElement(ws.Z,{...n,ref:a})),Clear:(0,t.forwardRef)((n,a)=>t.createElement(no.Z,{...n,ref:a})),Delete:(0,t.forwardRef)((n,a)=>t.createElement(Us.Z,{...n,ref:a})),DetailPanel:(0,t.forwardRef)((n,a)=>t.createElement(to.Z,{...n,ref:a})),Edit:(0,t.forwardRef)((n,a)=>t.createElement(Ns.Z,{...n,ref:a})),Export:(0,t.forwardRef)((n,a)=>t.createElement(Hs.Z,{...n,ref:a})),Filter:(0,t.forwardRef)((n,a)=>t.createElement(ua.Z,{...n,ref:a})),FirstPage:(0,t.forwardRef)((n,a)=>t.createElement(Zs.Z,{...n,ref:a})),LastPage:(0,t.forwardRef)((n,a)=>t.createElement(zs.Z,{...n,ref:a})),NextPage:(0,t.forwardRef)((n,a)=>t.createElement(to.Z,{...n,ref:a})),PreviousPage:(0,t.forwardRef)((n,a)=>t.createElement($s.Z,{...n,ref:a})),ResetSearch:(0,t.forwardRef)((n,a)=>t.createElement(no.Z,{...n,ref:a})),Search:(0,t.forwardRef)((n,a)=>t.createElement(ua.Z,{...n,ref:a})),SortArrow:(0,t.forwardRef)((n,a)=>t.createElement(Ms.Z,{...n,ref:a})),ThirdStateCheck:(0,t.forwardRef)((n,a)=>t.createElement(Ws.Z,{...n,ref:a})),ViewColumn:(0,t.forwardRef)((n,a)=>t.createElement(js.Z,{...n,ref:a}))};function ro(n,a){const i=a.split(".");let d=n[i[0]];for(let g=1;g<i.length;++g){if(d===void 0)return d;const v=i[g];d=d[v]}return d}const ks=(0,mn.Z)(n=>({header:{padding:n.spacing(1,2,1,2.5),borderTop:`1px solid ${n.palette.grey.A100}`,borderBottom:`1px solid ${n.palette.grey.A100}`,color:n.palette.textSubtle,fontWeight:n.typography.fontWeightBold,position:"static",wordBreak:"normal"}}),{name:"BackstageTableHeader"})(qr.W$),ao=(0,mn.Z)(n=>({root:{padding:n.spacing(3,0,2.5,2.5)},title:{"& > h6":{fontWeight:"bold"}},searchField:{paddingRight:n.spacing(2)}}),{name:"BackstageTableToolbar"})(qr.UW),Ys=(0,m.Z)(()=>({root:{display:"flex",alignItems:"center",justifyContent:"space-between"},title:{fontWeight:"bold",fontSize:18,whiteSpace:"nowrap"}}),{name:"BackstageTableFiltersContainer"}),Js=(0,m.Z)(()=>({root:{display:"flex",alignItems:"start"}}),{name:"BackstageTable"});function Qs(n,a){return n.map(i=>{const d={};let g=i.cellStyle||{};if(i.highlight)if(d.color=a.palette.textContrast,typeof g=="object")g.fontWeight=a.typography.fontWeightBold;else{const v=g;g=(O,N,G)=>({...v(O,N,G),fontWeight:a.typography.fontWeightBold})}return{...i,headerStyle:d,cellStyle:g}})}function Xs(n,a){return(0,Fr.transform)(n,(i,d,g)=>{(0,Fr.isEqual)(d,a[g])||(i[g]=d)})}const oo={search:"",filtersOpen:!1,filters:{}};function _s(n){const{toolbarRef:a,setSearch:i,hasFilters:d,selectedFiltersLength:g,toggleFilters:v}=n,O=Ys(),N=(0,t.useCallback)(G=>{n.onSearchChanged(G),i(G)},[n,i]);return d?t.createElement("div",{className:O.root},t.createElement("div",{className:O.root},t.createElement(Y.Z,{onClick:v,"aria-label":"filter list"},t.createElement(ua.Z,null)),t.createElement(at.Z,{className:O.title},"Filters (",g,")")),t.createElement(ao,{...n,ref:a,onSearchChanged:N})):t.createElement(ao,{...n,ref:a,onSearchChanged:N})}function ei(n){const{data:a,columns:i,options:d,title:g,subtitle:v,filters:O,initialState:N,emptyContent:G,onStateChange:H,components:ne,..._}=n,ve=Js(),Ce=(0,U.Z)(),Ie={...oo,...N},[gt,Ut]=(0,t.useState)(Ie.filtersOpen),Yt=(0,t.useCallback)(()=>Ut(sn=>!sn),[Ut]),[Jt,dt]=(0,t.useState)(0),[Gt,en]=(0,t.useState)(a),[Qt,Xn]=(0,t.useState)(Ie.filters),Nn=Qs(i,Ce),[wr,Mt]=(0,t.useState)(Ie.search);(0,t.useEffect)(()=>{if(H){const sn=Xs({search:wr,filtersOpen:gt,filters:Qt},oo);H(sn)}},[wr,gt,Qt,H]);const yr={headerStyle:{textTransform:"uppercase"}},$r=(0,t.useCallback)(sn=>{var Sn;return(Sn=i.find(ar=>ar.title===sn))==null?void 0:Sn.field},[i]);(0,t.useEffect)(()=>{if(typeof a=="function")return;if(!Qt){en(a);return}const sn=Object.values(Qt);if(a&&sn.flat().length){const Sn=a.filter(ar=>!!Object.entries(Qt).filter(([,qn])=>!!qn.length).every(([qn,nn])=>{const Cn=ro(ar,$r(qn));return Array.isArray(Cn)&&Array.isArray(nn)?Cn.some(vr=>nn.includes(vr)):Array.isArray(Cn)?Cn.includes(nn):Array.isArray(nn)?nn.includes(Cn):Cn===nn}));en(Sn)}else en(a);dt(sn.flat().length)},[a,Qt,$r]);const Er=(sn,Sn)=>{const ar=nn=>{const Cn=new Set,vr=_n=>{_n!=null&&Cn.add(_n)};return Sn&&Sn.forEach(_n=>{const Ar=ro(_n,$r(nn));Array.isArray(Ar)?Ar.forEach(vr):vr(Ar)}),Cn},qn=nn=>({placeholder:"All results",label:nn.column,multiple:nn.type==="multiple-select",items:[...ar(nn.column)].sort().map(Cn=>({label:Cn,value:Cn}))});return sn.map(nn=>({type:nn.type,element:qn(nn)}))},ea=!!(O!=null&&O.length),ga=(0,t.useCallback)(sn=>t.createElement(_s,{setSearch:Mt,hasFilters:ea,selectedFiltersLength:Jt,toggleFilters:Yt,...sn}),[Yt,ea,Jt,Mt]),ta=typeof a!="function"&&a.length===0,na=i.length,pa=(0,t.useCallback)(sn=>G&&ta?t.createElement("tbody",null,t.createElement("tr",null,t.createElement("td",{colSpan:na},G))):t.createElement(qr.os,{...sn}),[ta,G,na]);return t.createElement("div",{className:ve.root},gt&&a&&typeof a!="function"&&(O==null?void 0:O.length)&&t.createElement(Gs,{filters:Er(O,a),selectedFilters:Qt,onChangeFilters:Xn}),t.createElement(qr.ZP,{components:{Header:ks,Toolbar:ga,Body:pa,...ne},options:{...yr,...d},columns:Nn,icons:Ks,title:t.createElement(t.Fragment,null,t.createElement(at.Z,{variant:"h5",component:"h2"},g),v&&t.createElement(at.Z,{color:"textSecondary",variant:"body1"},v)),data:typeof a=="function"?a:Gt,style:{width:"100%"},localization:{toolbar:{searchPlaceholder:"Filter"}},..._}))}const Dl=n=>{const{children:a,value:i,index:d,...g}=n;return React.createElement("div",{role:"tabpanel",hidden:i!==d,"aria-labelledby":`scrollable-auto-tab-${d}`,...g},i===d&&React.createElement(Box,{p:3},a))},ti=(0,m.Z)(()=>({root:{color:"#6E6E6E",overflow:"visible",fontSize:"1.5rem",textAlign:"center",borderRadius:"50%",backgroundColor:"#E6E6E6",marginLeft:n=>n.isNext?"auto":"0",marginRight:n=>n.isNext?"0":"10px","&:hover":{backgroundColor:"#E6E6E6",opacity:"1"}}}),{name:"BackstageTabIcon"}),Fl=n=>{const a=ti(n),{ariaLabel:i,onClick:d}=n;return React.createElement(IconButton,{onClick:d,className:a.root,size:"small",disableRipple:!0,disableFocusRipple:!0,"aria-label":i},n.children)},ni=(n,a)=>a?n?"20px":"0":"40px",ri=(0,m.Z)(n=>({root:{textTransform:"none",height:"64px",fontWeight:n.typography.fontWeightBold,fontSize:n.typography.pxToRem(13),color:n.palette.textSubtle,marginLeft:a=>ni(a.isFirstNav,a.isFirstIndex),width:"130px",minWidth:"130px","&:hover":{outline:"none",backgroundColor:"transparent",color:n.palette.textSubtle}}}),{name:"BackstageTab"}),Bl=n=>{const a=ri(n),{isFirstNav:i,isFirstIndex:d,...g}=n;return React.createElement(Tab,{classes:a,disableRipple:!0,...g})},ai=(0,m.Z)(n=>({indicator:{display:"flex",justifyContent:"center",backgroundColor:n.palette.tabbar.indicator,height:"4px"},flexContainer:{alignItems:"center"},root:{"&:last-child":{marginLeft:"auto"}}}),{name:"BackstageTabBar"}),Ml=n=>{const a=ai(n);return React.createElement(Tabs,{classes:a,...n,TabIndicatorProps:{children:React.createElement("span",null)}})},oi=(0,m.Z)(n=>({root:{flexGrow:1,width:"100%"},styledTabs:{backgroundColor:n.palette.background.paper},appbar:{boxShadow:"none",backgroundColor:n.palette.background.paper,paddingLeft:"10px",paddingRight:"10px"}}),{name:"BackstageTabs"});function wl(n){const{tabs:a}=n,i=oi(),[d,g]=useState([0,0]),[v,O]=useState(0),[N,G]=useState(0),[H,ne]=useState([[]]),_=useRef(),{width:ve}=useWindowSize(),Ce=(Jt,dt)=>{g([v,dt])},Ie=()=>{O(v-1)},gt=()=>{O(v+1)},Ut=()=>v+1<H.length;useEffect(()=>{const dt=v===0?1:2,Gt=_.current.offsetWidth-20-dt*30,en=d[0]*N+d[1],Qt=Math.floor(Gt/170);G(Qt),ne(chunkArray(a,Qt)),g([Math.floor(en/Qt),en%Qt])},[ve,a]);const Yt=v===d[0]?d[1]:!1;return React.createElement("div",{className:i.root},React.createElement(AppBar,{ref:_,className:i.appbar,position:"static"},React.createElement("div",null,React.createElement(StyledTabs,{value:Yt,onChange:Ce,selectionFollowsFocus:!0},v!==0&&React.createElement(StyledIcon,{onClick:Ie,ariaLabel:"navigate-before"},React.createElement(NavigateBeforeIcon,null)),H[v].map((Jt,dt)=>React.createElement(StyledTab,{value:dt,isFirstIndex:dt===0,isFirstNav:v===0,key:dt,icon:Jt.icon||void 0,label:Jt.label||void 0})),Ut()&&React.createElement(StyledIcon,{isNext:!0,onClick:gt,ariaLabel:"navigate-next"},React.createElement(NavigateNextIcon,null))))),Yt!==!1?H[v].map((Jt,dt)=>React.createElement(TabPanel,{key:dt,value:dt,index:Yt},Jt.content)):React.createElement(TabPanel,{key:"panel_outside_chunked_array",value:d[1],index:d[1]},H[d[0]][d[1]].content))}var $l=e(44311);function si(n,a){const i=n[n.length-1];if(!!i)return i>=.9?a.palette.status.ok:i>=.5?a.palette.status.warning:a.palette.status.error}function Ul(n){var i;const a=useTheme();return n.data?React.createElement(Sparklines,{width:120,height:30,min:0,max:1,...n},n.title&&React.createElement("title",null,n.title),React.createElement(SparklinesLine,{color:(i=n.color)!=null?i:si(n.data,a)})):null}const ii=n=>(0,m.Z)(a=>({container:{width:"100%",display:"flex",flexDirection:"row",flexWrap:"wrap",justifyContent:"flex-end",alignItems:"center",marginBottom:a.spacing(2),textAlign:n.textAlign},leftItemsBox:{flex:"1 1 auto",minWidth:0,overflow:"visible"},rightItemsBox:{flex:"0 1 auto",display:"flex",flexDirection:"row",flexWrap:"wrap",alignItems:"center",marginLeft:a.spacing(1),minWidth:0,overflow:"visible"},description:{},title:{display:"inline-flex",marginBottom:0}}),{name:"BackstageContentHeader"}),li=({title:n="Unknown page",className:a})=>t.createElement(at.Z,{variant:"h4",component:"h2",className:a,"data-testid":"header-title"},n);function ci(n){const{description:a,title:i,titleComponent:d=void 0,children:g,textAlign:v="left"}=n,O=ii({textAlign:v})(),N=d||t.createElement(li,{title:i,className:O.title});return t.createElement(t.Fragment,null,t.createElement(ia.q,{title:i}),t.createElement("div",{className:O.container},t.createElement("div",{className:O.leftItemsBox},N,a&&t.createElement(at.Z,{className:O.description,variant:"body2"},a)),t.createElement("div",{className:O.rightItemsBox},g)))}var ui=e.p+"static/mic-drop.fe3ef4d0..svg";const di=(0,m.Z)(n=>({micDrop:{maxWidth:"60%",position:"absolute",bottom:n.spacing(2),right:n.spacing(2),[n.breakpoints.down("xs")]:{maxWidth:"96%",position:"relative",bottom:"unset",right:"unset",margin:`${n.spacing(10)}px auto ${n.spacing(4)}px`}}}),{name:"BackstageErrorPageMicDrop"}),fi=()=>{const n=di();return t.createElement("img",{src:ui,className:n.micDrop,alt:"Girl dropping mic from her hands"})},mi=(0,m.Z)(n=>({container:{padding:n.spacing(8),[n.breakpoints.down("xs")]:{padding:n.spacing(2)}},title:{paddingBottom:n.spacing(5),[n.breakpoints.down("xs")]:{paddingBottom:n.spacing(4),fontSize:32}},subtitle:{color:n.palette.textSubtle}}),{name:"BackstageErrorPage"});function hi(n){const{status:a,statusMessage:i,additionalInfo:d,supportUrl:g}=n,v=mi(),O=(0,Mn.s0)(),N=Pa();return t.createElement(vt.Z,{container:!0,spacing:0,className:v.container},t.createElement(fi,null),t.createElement(vt.Z,{item:!0,xs:12,sm:8,md:4},t.createElement(at.Z,{"data-testid":"error",variant:"body1",className:v.subtitle},"ERROR ",a,": ",i),t.createElement(at.Z,{variant:"body1",className:v.subtitle},d),t.createElement(at.Z,{variant:"h2",className:v.title},"Looks like someone dropped the mic!"),t.createElement(at.Z,{variant:"h6"},t.createElement(b,{to:"#","data-testid":"go-back-link",onClick:()=>O(-1)},"Go back"),"... or please"," ",t.createElement(b,{to:g||N.url},"contact support")," if you think this is a bug.")))}var gi=e(16173);const pi=(0,mn.Z)({root:{textDecoration:"underline",cursor:"pointer"}},{name:"BackstageBreadcrumbsClickableText"})(at.Z),da=(0,mn.Z)({root:{textDecoration:"underline",color:"inherit"}},{name:"BackstageBreadcrumbsStyledBox"})(Fn.Z);function yi(n){const{children:a,...i}=n,[d,g]=t.useState(null),v=t.Children.toArray(a),[O,N,...G]=v,H=G.length?G.pop():v[v.length-1],ne=v.length>3,_=Ie=>{g(Ie.currentTarget)},ve=()=>{g(null)},Ce=Boolean(d);return t.createElement(t.Fragment,null,t.createElement(gi.Z,{"aria-label":"breadcrumb",...i},v.length>1&&t.createElement(da,{clone:!0},O),v.length>2&&t.createElement(da,{clone:!0},N),ne&&t.createElement(pi,{onClick:_},"..."),t.createElement(Fn.Z,{style:{fontStyle:"italic"}},H)),t.createElement(Sa.ZP,{open:Ce,anchorEl:d,onClose:ve,anchorOrigin:{vertical:"bottom",horizontal:"left"},transformOrigin:{vertical:"top",horizontal:"left"}},t.createElement(dn.Z,null,G.map((Ie,gt)=>t.createElement(xt.Z,{key:gt,button:!0},t.createElement(da,{clone:!0},Ie))))))}const Ei=(0,m.Z)(n=>({header:{gridArea:"pageHeader",padding:n.spacing(3),width:"100%",boxShadow:n.shadows[4],position:"relative",zIndex:100,display:"flex",flexDirection:"row",alignItems:"center",backgroundImage:n.page.backgroundImage,backgroundPosition:"center",backgroundSize:"cover",[n.breakpoints.down("sm")]:{flexWrap:"wrap"}},leftItemsBox:{maxWidth:"100%",flexGrow:1},rightItemsBox:{width:"auto"},title:{color:n.palette.bursts.fontColor,wordBreak:"break-word",fontSize:n.typography.h3.fontSize,marginBottom:0},subtitle:{color:n.palette.bursts.fontColor,opacity:.8,display:"inline-block",marginTop:n.spacing(1),maxWidth:"75ch"},type:{textTransform:"uppercase",fontSize:11,opacity:.8,marginBottom:n.spacing(1),color:n.palette.bursts.fontColor},breadcrumb:{color:n.palette.bursts.fontColor},breadcrumbType:{fontSize:"inherit",opacity:.7,marginRight:-n.spacing(.3),marginBottom:n.spacing(.3)},breadcrumbTitle:{fontSize:"inherit",marginLeft:-n.spacing(.3),marginBottom:n.spacing(.3)}}),{name:"BackstageHeader"}),vi=({type:n,typeLink:a,classes:i,pageTitle:d})=>n?a?t.createElement(yi,{className:i.breadcrumb},t.createElement(b,{to:a},n),t.createElement(at.Z,null,d)):t.createElement(at.Z,{className:i.type},n):null,Ai=({pageTitle:n,classes:a,tooltip:i})=>{const d=t.createElement(at.Z,{className:a.title,variant:"h1"},n);return i?t.createElement(te.ZP,{title:i,placement:"top-start"},d):d},Ri=({classes:n,subtitle:a})=>a?typeof a!="string"?t.createElement(t.Fragment,null,a):t.createElement(at.Z,{className:n.subtitle,variant:"subtitle2",component:"span"},a):null;function so(n){const{children:a,pageTitleOverride:i,style:d,subtitle:g,title:v,tooltip:O,type:N,typeLink:G}=n,H=Ei(),_=(0,l.useApi)(l.configApiRef).getOptionalString("app.title")||"Backstage",ve=i||v,Ce=v||i,Ie=`${ve} | %s | ${_}`,gt=`${ve} | ${_}`;return t.createElement(t.Fragment,null,t.createElement(ia.q,{titleTemplate:Ie,defaultTitle:gt}),t.createElement("header",{style:d,className:H.header},t.createElement(Fn.Z,{className:H.leftItemsBox},t.createElement(vi,{classes:H,type:N,typeLink:G,pageTitle:Ce}),t.createElement(Ai,{classes:H,pageTitle:Ce,tooltip:O}),t.createElement(Ri,{classes:H,subtitle:g})),t.createElement(vt.Z,{container:!0,className:H.rightItemsBox,spacing:4},a)))}const Si=(0,m.Z)(n=>({root:{textAlign:"left"},label:{color:n.palette.common.white,fontWeight:"bold",letterSpacing:0,fontSize:n.typography.fontSize,marginBottom:n.spacing(1)/2,lineHeight:1},value:{color:"rgba(255, 255, 255, 0.8)",fontSize:n.typography.fontSize,lineHeight:1}}),{name:"BackstageHeaderLabel"}),Ci=({value:n,className:a})=>t.createElement(at.Z,{className:a},n);function Ti(n){const{label:a,value:i,url:d}=n,g=Si(),v=t.createElement(Ci,{className:g.value,value:i||"<Unknown>"});return t.createElement(vt.Z,{item:!0},t.createElement("span",{className:g.root},t.createElement(at.Z,{className:g.label},a),d?t.createElement(b,{to:d},v):v))}const bi={hour:"2-digit",minute:"2-digit"};function io(n){const a=new Date,i=window.navigator.language,d=[];if(!n.has("homepage.clocks"))return d;const g=n.getConfigArray("homepage.clocks");for(const v of g)if(v.has("label")&&v.has("timezone")){let O=v.getString("label");const N={timeZone:v.getString("timezone"),...bi};try{new Date().toLocaleString(i,N)}catch{console.warn(`The timezone ${N.timeZone} is invalid. Defaulting to GMT`),N.timeZone="GMT",O="GMT"}const G=a.toLocaleTimeString(i,N);d.push({time:G,label:O})}return d}function Nl(n){const a=useApi(configApiRef),i=[],[d,g]=React.useState(i);return React.useEffect(()=>{g(io(a));const v=setInterval(()=>{g(io(a))},1e3);return()=>{clearInterval(v)}},[a]),d.length!==0?React.createElement(React.Fragment,null,d.map(v=>React.createElement(HeaderLabel,{label:v.label,value:v.time,key:v.label}))):null}const Pi=n=>(0,o.Z)({root:{color:n.palette.common.white,padding:n.spacing(2,2,3),backgroundImage:n.palette.bursts.gradient.linear,backgroundPosition:0,backgroundSize:"inherit"}}),Ii=(0,m.Z)(Pi,{name:"BackstageItemCardHeader"});function Li(n){const{title:a,subtitle:i,children:d}=n,g=Ii(n);return t.createElement("div",{className:g.root},i&&t.createElement(at.Z,{variant:"subtitle2",component:"h3"},i),a&&t.createElement(at.Z,{variant:"h6",component:"h4"},a),d)}function Zl(n){const{description:a,tags:i,title:d,type:g,subtitle:v,label:O,onClick:N,href:G}=n;return React.createElement(Card,null,React.createElement(CardMedia,null,React.createElement(ItemCardHeader,{title:d,subtitle:v||g})),React.createElement(CardContent,null,i!=null&&i.length?React.createElement(Box,null,i.map((H,ne)=>React.createElement(Chip,{size:"small",label:H,key:ne}))):null,a),React.createElement(CardActions,null,!G&&React.createElement(Button,{to:"#",onClick:N,color:"primary"},O),G&&React.createElement(Button,{to:G,color:"primary"},O)))}const Oi=n=>(0,o.Z)({root:{display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(22em, 1fr))",gridAutoRows:"1fr",gridGap:n.spacing(2)}}),xi=(0,m.Z)(Oi,{name:"BackstageItemCardGrid"});function Di(n){const{children:a,...i}=n,d=xi(i);return t.createElement("div",{className:d.root,...i},a)}var Fi=e(41547);const Bi=(0,m.Z)(()=>({root:({isMobile:n})=>({display:"grid",gridTemplateAreas:"'pageHeader pageHeader pageHeader' 'pageSubheader pageSubheader pageSubheader' 'pageNav pageContent pageSidebar'",gridTemplateRows:"max-content auto 1fr",gridTemplateColumns:"auto 1fr auto",height:n?"100%":"100vh",overflowY:"auto"})}),{name:"BackstagePage"});function lo(n){const{themeId:a,children:i}=n,{isMobile:d}=Br(),g=Bi({isMobile:d});return t.createElement(Fi.Z,{theme:v=>({...v,page:v.getPageTheme({themeId:a})})},t.createElement("main",{className:g.root},i))}function Mi(n){const{themeId:a,children:i,...d}=n;return t.createElement(lo,{themeId:a},t.createElement(so,{...d}),i)}var Rn=e(30195);const zl=Rn.z.object({providerInfo:Rn.z.object({}).catchall(Rn.z.unknown()).optional(),profile:Rn.z.object({email:Rn.z.string().optional(),displayName:Rn.z.string().optional(),picture:Rn.z.string().optional()}),backstageIdentity:Rn.z.object({token:Rn.z.string(),identity:Rn.z.object({type:Rn.z.literal("user"),userEntityRef:Rn.z.string(),ownershipEntityRefs:Rn.z.array(Rn.z.string())})})}),co={defaultTokenExpiryMillis:5*60*1e3,tokenExpiryMarginMillis:5*60*1e3};function wi(n){const a=new Date(Date.now()+co.defaultTokenExpiryMillis);if(!n)return a;const[i,d,g]=n.split("."),v=JSON.parse(atob(d));return typeof v.exp!="number"?a:new Date(v.exp*1e3-co.tokenExpiryMarginMillis)}class Wl{constructor(a){q(this,"options");q(this,"abortController");q(this,"state");this.options=a,this.abortController=new AbortController,this.state={type:"empty"}}async start(){await this.getSessionAsync()}getUserId(){const{backstageIdentity:a}=this.getSessionSync(),i=a.identity.userEntityRef,d=/^([^:/]+:)?([^:/]+\/)?([^:/]+)$/.exec(i);if(!d)throw new TypeError(`Invalid user entity reference "${i}"`);return d[3]}async getIdToken(){return(await this.getSessionAsync()).backstageIdentity.token}getProfile(){return this.getSessionSync().profile}async getProfileInfo(){return(await this.getSessionAsync()).profile}async getBackstageIdentity(){return(await this.getSessionAsync()).backstageIdentity.identity}async getCredentials(){return{token:(await this.getSessionAsync()).backstageIdentity.token}}async signOut(){this.abortController.abort()}getSessionSync(){if(this.state.type==="active")return this.state.session;if(this.state.type==="fetching"&&this.state.previous)return this.state.previous;throw new Error("No session available. Try reloading your browser page.")}async getSessionAsync(){if(this.state.type==="fetching")return this.state.promise;if(this.state.type==="active"&&new Date<this.state.expiresAt)return this.state.session;const a=this.state.type==="active"?this.state.session:void 0,i=this.fetchSession().then(d=>(this.state={type:"active",session:d,expiresAt:wi(d.backstageIdentity.token)},d),d=>{throw this.state={type:"failed",error:d},d});return this.state={type:"fetching",promise:i,previous:a},i}async fetchSession(){const a=await this.options.discoveryApi.getBaseUrl("auth"),i=await fetch(`${a}/${this.options.provider}/refresh`,{signal:this.abortController.signal,headers:{"x-requested-with":"XMLHttpRequest"},credentials:"include"});if(!i.ok)throw await ResponseError.fromResponse(i);return proxiedSessionSchema.parse(await i.json())}}const Hl=n=>{const a=useApi(discoveryApiRef),[{status:i,error:d},{execute:g}]=useAsync(async()=>{const v=new ProxiedSignInIdentity({provider:n.provider,discoveryApi:a});await v.start(),n.onSignInSuccess(v)});return useMountEffect(g),i==="loading"?React.createElement(Progress,null):d?React.createElement(ErrorPanel,{title:"You do not appear to be signed in. Please try reloading the browser page.",error:d}):null},$i=(0,m.Z)({container:{padding:0,listStyle:"none"},item:{display:"flex",flexDirection:"column",width:"100%",maxWidth:"400px",margin:0,padding:0}},{name:"BackstageSignInPage"}),fa=({children:n})=>{const a=$i();return t.createElement(vt.Z,{component:"li",item:!0,classes:a},n)};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 a="user:default/guest";return{type:"user",userEntityRef:a,ownershipEntityRefs:[a]}}async getCredentials(){return{}}async signOut(){}}function Ui(n){const[a,i,d]=n.split(".");return JSON.parse(atob(i))}class ha{constructor(a){this.result=a}getUserId(){return this.result.userId}static fromResult(a){return new ha(a)}async getIdToken(){var a,i;return(i=(a=this.result).getIdToken)==null?void 0:i.call(a)}getProfile(){return this.result.profile}async getProfileInfo(){return this.result.profile}async getBackstageIdentity(){const a=await this.getIdToken();if(!a){const g=`user:default/${this.getUserId()}`;return{type:"user",userEntityRef:g,ownershipEntityRefs:[g]}}const{sub:i,ent:d}=Ui(a);return{type:"user",userEntityRef:i,ownershipEntityRefs:d!=null?d:[]}}async getCredentials(){var i,d;return{token:await((d=(i=this.result).getIdToken)==null?void 0:d.call(i))}}async signOut(){var a,i;return(i=(a=this.result).signOut)==null?void 0:i.call(a)}}class Mr{constructor(a,i,d){q(this,"profilePromise");this.identity=a,this.authApi=i,this.profile=d}static createGuest(){return new ma}static fromLegacy(a){return ha.fromResult(a)}static create(a){return new Mr(a.identity,a.authApi,a.profile)}getUserId(){const a=this.identity.userEntityRef,i=/^([^:/]+:)?([^:/]+\/)?([^:/]+)$/.exec(a);if(!i)throw new TypeError(`Invalid user entity reference "${a}"`);return i[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(a){throw this.profilePromise=void 0,a}}async getBackstageIdentity(){return this.identity}async getCredentials(){return{token:(await this.authApi.getBackstageIdentity()).token}}async signOut(){return this.authApi.signOut()}}const Ni={Component:({config:n,onSignInSuccess:a})=>{const{apiRef:i,title:d,message:g}=n,v=(0,l.useApi)(i),O=(0,l.useApi)(l.errorApiRef),N=async()=>{try{const G=await v.getBackstageIdentity({instantPopup:!0});if(!G)throw new Error(`The ${d} provider is not configured to support sign-in`);const H=await v.getProfile();a(Mr.create({identity:G.identity,profile:H,authApi:v}))}catch(G){O.post(new er.SP("Login failed",G))}};return t.createElement(fa,null,t.createElement(Kn,{variant:"fullHeight",title:d,actions:t.createElement(y.Z,{color:"primary",variant:"outlined",onClick:N},"Sign In")},t.createElement(at.Z,{variant:"body1"},g)))},loader:async(n,a)=>{const i=n.get(a),d=await i.getBackstageIdentity({optional:!0});if(!d)return;const g=await i.getProfile();return Mr.create({identity:d.identity,profile:g,authApi:i})}},Zi={Component:({onSignInSuccess:n})=>t.createElement(fa,null,t.createElement(Kn,{title:"Guest",variant:"fullHeight",actions:t.createElement(y.Z,{color:"primary",variant:"outlined",onClick:()=>n(new ma)},"Enter")},t.createElement(at.Z,{variant:"body1"},"Enter as a Guest User.",t.createElement("br",null),"You will not have a verified identity,",t.createElement("br",null),"meaning some features might be unavailable."))),loader:async()=>new ma};var zi=e(63955),uo=e(86619),fo=e(74828),Wi=e(45455),Hi=e.n(Wi);const ji=/^[a-z0-9_\-]+\.[a-z0-9_\-]+\.[a-z0-9_\-]+$/i,Vi=(0,m.Z)(n=>({form:{display:"flex",flexFlow:"column nowrap"},button:{alignSelf:"center",marginTop:n.spacing(2)}}),{name:"BackstageCustomProvider"}),mo=n=>{const{ref:a,...i}=n;return{inputRef:a,...i}},Gi={Component:({onSignInSuccess:n})=>{const a=Vi(),{register:i,handleSubmit:d,formState:g}=(0,zi.cI)({mode:"onChange"}),{errors:v}=g,O=({userId:N})=>{n(Mr.fromLegacy({userId:N,profile:{email:`${N}@example.com`}}))};return t.createElement(fa,null,t.createElement(Kn,{title:"Custom User",variant:"fullHeight"},t.createElement(at.Z,{variant:"body1"},"Enter your own User ID and credentials.",t.createElement("br",null),"This selection will not be stored."),t.createElement("form",{className:a.form,onSubmit:d(O)},t.createElement(C.Z,null,t.createElement(uo.Z,{...mo(i("userId",{required:!0})),label:"User ID",margin:"normal",error:Boolean(v.userId)}),v.userId&&t.createElement(fo.Z,{error:!0},v.userId.message)),t.createElement(C.Z,null,t.createElement(uo.Z,{...mo(i("idToken",{required:!1,validate:N=>!N||ji.test(N)||"Token is not a valid OpenID Connect JWT Token"})),label:"ID Token (optional)",margin:"normal",autoComplete:"off",error:Boolean(v.idToken)}),v.idToken&&t.createElement(fo.Z,{error:!0},v.idToken.message)),t.createElement(y.Z,{type:"submit",color:"primary",variant:"outlined",className:a.button,disabled:!(g!=null&&g.isDirty)||!Hi()(v)},"Continue"))))},loader:async()=>{}},_r="@backstage/core:SignInPage:provider",ho={guest:Zi,custom:Gi,common:Ni};function go(n,a){if(n in a)throw new Error(`"${n}" ID is duplicated. IDs of identity providers have to be unique.`)}function Jl(n){return n.reduce((i,d)=>{if(typeof d=="string")return go(d,i),i[d]={components:ho[d],id:d},i;const{id:g}=d;return go(g,i),i[g]={components:ho.common,id:g,config:d},i},{})}const Ql=(n,a)=>{const i=useApi(errorApiRef),d=useApiHolder(),[g,v]=useState(!0),O=useCallback(G=>{a(IdentityApiSignOutProxy.from({identityApi:G,signOut:async()=>{var H;localStorage.removeItem(_r),await((H=G.signOut)==null?void 0:H.call(G))}}))},[a]);useLayoutEffect(()=>{var _;if(!g)return;const G=localStorage.getItem(_r);if(G===null){v(!1);return}const H=n[G];if(!H){v(!1);return}let ne=!1;return H.components.loader(d,(_=H.config)==null?void 0:_.apiRef).then(ve=>{ne||(ve?O(ve):v(!1))}).catch(ve=>{ne||(localStorage.removeItem(_r),i.post(ve),v(!1))}),()=>{ne=!0}},[g,i,a,d,n,O]);const N=useMemo(()=>Object.keys(n).map(G=>{const H=n[G],{Component:ne}=H.components,_=ve=>{localStorage.setItem(_r,H.id),O(ve)};return React.createElement(ne,{key:H.id,config:H.config,onSignInSuccess:_})}),[n,O]);return[g,N]},Ki=({onSignInSuccess:n,providers:a=[],title:i,align:d="left"})=>{const g=useApi(configApiRef),v=useStyles(),O=getSignInProviders(a),[N,G]=useSignInProviders(O,n);return N?React.createElement(Progress,null):React.createElement(Page,{themeId:"home"},React.createElement(Header,{title:g.getString("app.title")}),React.createElement(Content,null,i&&React.createElement(ContentHeader,{title:i,textAlign:d}),React.createElement(Grid,{container:!0,justifyContent:d==="center"?d:"flex-start",spacing:2,component:"ul",classes:v},G)))},ki=({provider:n,auto:a,onSignInSuccess:i})=>{const d=useStyles(),g=useApi(n.apiRef),v=useApi(configApiRef),[O,N]=useState(),[G,H]=useState(!1),ne=async({checkExisting:_,showPopup:ve})=>{try{let Ce;if(_&&(Ce=await g.getBackstageIdentity({optional:!0})),!Ce&&(ve||a)&&(H(!0),Ce=await g.getBackstageIdentity({instantPopup:!0}),!Ce))throw new Error(`The ${n.title} provider is not configured to support sign-in`);if(!Ce){H(!0);return}const Ie=await g.getProfile();i(UserIdentity.create({identity:Ce.identity,authApi:g,profile:Ie}))}catch(Ce){N(Ce),H(!0)}};return useMountEffect(()=>ne({checkExisting:!0})),G?React.createElement(Page,{themeId:"home"},React.createElement(Header,{title:v.getString("app.title")}),React.createElement(Content,null,React.createElement(Grid,{container:!0,justifyContent:"center",spacing:2,component:"ul",classes:d},React.createElement(GridItem,null,React.createElement(InfoCard,{variant:"fullHeight",title:n.title,actions:React.createElement(Button,{color:"primary",variant:"outlined",onClick:()=>{ne({showPopup:!0})}},"Sign In")},React.createElement(Typography,{variant:"body1"},n.message),O&&O.name!=="PopupRejectedError"&&React.createElement(Typography,{variant:"body1",color:"error"},O.message)))))):React.createElement(Progress,null)};function Xl(n){return"provider"in n?React.createElement(ki,{...n}):React.createElement(Ki,{...n})}const Yi=(0,m.Z)(n=>({root:{padding:n.spacing(0,2,0,2.5),minHeight:n.spacing(3)},indicator:{backgroundColor:n.palette.info.main,height:n.spacing(.3)}}),{name:"BackstageTabbedCard"}),Ji=(0,mn.Z)(n=>({root:{padding:n.spacing(2,2,2,2.5),display:"inline-block"},title:{fontWeight:700},subheader:{paddingTop:n.spacing(1)}}),{name:"BackstageTabbedCardBoldHeader"})(dr.Z);function ql(n){const{slackChannel:a,errorBoundaryProps:i,children:d,title:g,deepLink:v,value:O,onChange:N}=n,G=Yi(),[H,ne]=useState(0),_=N||((Ie,gt)=>ne(gt));let ve;O?React.Children.map(d,Ie=>{React.isValidElement(Ie)&&(Ie==null?void 0:Ie.props.value)===O&&(ve=Ie==null?void 0:Ie.props.children)}):React.Children.map(d,(Ie,gt)=>{React.isValidElement(Ie)&>===H&&(ve=Ie==null?void 0:Ie.props.children)});const Ce=i||(a?{slackChannel:a}:{});return React.createElement(Card,null,React.createElement(ErrorBoundary,{...Ce},g&&React.createElement(Ji,{title:g}),React.createElement(Tabs,{selectionFollowsFocus:!0,classes:G,value:O||H,onChange:_},d),React.createElement(Divider,null),React.createElement(CardContent,null,ve),v&&React.createElement(BottomLink,{...v})))}const Qi=(0,m.Z)(n=>({root:{minWidth:n.spacing(6),minHeight:n.spacing(3),margin:n.spacing(0,2,0,0),padding:n.spacing(.5,0,.5,0),textTransform:"none","&:hover":{opacity:1,backgroundColor:"transparent",color:n.palette.text.primary}},selected:{fontWeight:"bold"}}),{name:"BackstageCardTab"});function _l(n){const{children:a,...i}=n,d=Qi();return React.createElement(Tab,{disableRipple:!0,classes:d,...i})}},88609:function(ee,s,e){"use strict";e.d(s,{Os:function(){return u},fC:function(){return A}});var r=e(76241),t=e(2784);const l=(0,r.CT)("analytics-context"),u=()=>{const o=(0,t.useContext)(l);if(o===void 0)return{routeRef:"unknown",pluginId:"root",extension:"App"};const c=o.atVersion(1);if(c===void 0)throw new Error("No context found for version 1.");return c},A=o=>{const{attributes:c,children:f}=o,p={...u(),...c},E=(0,r.EI)({1:p});return t.createElement(l.Provider,{value:E},f)};function m(o,c){const f=y=>React.createElement(A,{attributes:c},React.createElement(o,{...y}));return f.displayName=`WithAnalyticsContext(${o.displayName||o.name||"Component"})`,f}},28461:function(ee,s,e){"use strict";e.d(s,{f:function(){return r.fC},z:function(){return m}});var r=e(88609),t=e(27399),l=e(2784);class u{constructor(c,f={routeRef:"unknown",pluginId:"root",extension:"App"}){this.analyticsApi=c,this.context=f}setContext(c){this.context=c}captureEvent(c,f,{value:y,attributes:p}={}){try{this.analyticsApi.captureEvent({action:c,subject:f,value:y,attributes:p,context:this.context})}catch(E){console.warn("Error during analytics event capture. %o",E)}}}function A(){try{return(0,t.useApi)(t.analyticsApiRef)}catch{return{captureEvent:()=>{}}}}function m(){const o=(0,l.useRef)(null),c=(0,r.Os)(),f=A();function y(){return o.current===null&&(o.current=new u(f)),o.current}const p=y();return p.setContext(c),p}},39135:function(ee,s,e){"use strict";e.d(s,{CL:function(){return M},sM:function(){return t},$v:function(){return p},v_:function(){return E},hg:function(){return T},uB:function(){return y},bq:function(){return f},Ds:function(){return I},NW:function(){return B},VE:function(){return j},W0:function(){return b},gP:function(){return L},F4:function(){return u},ux:function(){return m},Kp:function(){return l},$4:function(){return D},p_:function(){return o},ZM:function(){return U},D:function(){return A},gW:function(){return c},E6:function(){return Y}});var r=e(86833),t;(function(te){const ue="SignedIn";te.SignedIn=ue;const Re="SignedOut";te.SignedOut=Re})(t||(t={}));const l=(0,r.createApiRef)({id:"core.auth.google"}),u=(0,r.createApiRef)({id:"core.auth.github"}),A=(0,r.createApiRef)({id:"core.auth.okta"}),m=(0,r.createApiRef)({id:"core.auth.gitlab"}),o=(0,r.createApiRef)({id:"core.auth.microsoft"}),c=(0,r.createApiRef)({id:"core.auth.onelogin"}),f=(0,r.createApiRef)({id:"core.auth.bitbucket"}),y=(0,r.createApiRef)({id:"core.auth.atlassian"}),p=(0,r.createApiRef)({id:"core.alert"}),E=(0,r.createApiRef)({id:"core.analytics"}),T=(0,r.createApiRef)({id:"core.apptheme"}),I=(0,r.createApiRef)({id:"core.config"}),B=(0,r.createApiRef)({id:"core.discovery"}),j=(0,r.createApiRef)({id:"core.error"});var M;(function(te){te[te.None=0]="None";const Re=1;te[te.Active=Re]="Active"})(M||(M={}));const b=(0,r.createApiRef)({id:"core.featureflags"}),L=(0,r.createApiRef)({id:"core.fetch"}),D=(0,r.createApiRef)({id:"core.identity"}),U=(0,r.createApiRef)({id:"core.oauthrequest"}),Y=(0,r.createApiRef)({id:"core.storage"})},27399:function(ee,s,e){"use strict";e.d(s,{FeatureFlagState:function(){return t.CL},SessionState:function(){return t.sM},alertApiRef:function(){return t.$v},analyticsApiRef:function(){return t.v_},appThemeApiRef:function(){return t.hg},atlassianAuthApiRef:function(){return t.uB},bitbucketAuthApiRef:function(){return t.bq},configApiRef:function(){return t.Ds},createApiFactory:function(){return r.createApiFactory},createApiRef:function(){return r.createApiRef},discoveryApiRef:function(){return t.NW},errorApiRef:function(){return t.VE},featureFlagsApiRef:function(){return t.W0},fetchApiRef:function(){return t.gP},githubAuthApiRef:function(){return t.F4},gitlabAuthApiRef:function(){return t.ux},googleAuthApiRef:function(){return t.Kp},identityApiRef:function(){return t.$4},microsoftAuthApiRef:function(){return t.p_},oauthRequestApiRef:function(){return t.ZM},oktaAuthApiRef:function(){return t.D},oneloginAuthApiRef:function(){return t.gW},storageApiRef:function(){return t.E6},useApi:function(){return r.useApi},useApiHolder:function(){return r.useApiHolder}});var r=e(86833);e.o(r,"FeatureFlagState")&&e.d(s,{FeatureFlagState:function(){return r.FeatureFlagState}}),e.o(r,"SessionState")&&e.d(s,{SessionState:function(){return r.SessionState}}),e.o(r,"alertApiRef")&&e.d(s,{alertApiRef:function(){return r.alertApiRef}}),e.o(r,"analyticsApiRef")&&e.d(s,{analyticsApiRef:function(){return r.analyticsApiRef}}),e.o(r,"appThemeApiRef")&&e.d(s,{appThemeApiRef:function(){return r.appThemeApiRef}}),e.o(r,"atlassianAuthApiRef")&&e.d(s,{atlassianAuthApiRef:function(){return r.atlassianAuthApiRef}}),e.o(r,"attachComponentData")&&e.d(s,{attachComponentData:function(){return r.attachComponentData}}),e.o(r,"bitbucketAuthApiRef")&&e.d(s,{bitbucketAuthApiRef:function(){return r.bitbucketAuthApiRef}}),e.o(r,"configApiRef")&&e.d(s,{configApiRef:function(){return r.configApiRef}}),e.o(r,"createComponentExtension")&&e.d(s,{createComponentExtension:function(){return r.createComponentExtension}}),e.o(r,"createExternalRouteRef")&&e.d(s,{createExternalRouteRef:function(){return r.createExternalRouteRef}}),e.o(r,"createPlugin")&&e.d(s,{createPlugin:function(){return r.createPlugin}}),e.o(r,"createReactExtension")&&e.d(s,{createReactExtension:function(){return r.createReactExtension}}),e.o(r,"createRoutableExtension")&&e.d(s,{createRoutableExtension:function(){return r.createRoutableExtension}}),e.o(r,"createRouteRef")&&e.d(s,{createRouteRef:function(){return r.createRouteRef}}),e.o(r,"discoveryApiRef")&&e.d(s,{discoveryApiRef:function(){return r.discoveryApiRef}}),e.o(r,"errorApiRef")&&e.d(s,{errorApiRef:function(){return r.errorApiRef}}),e.o(r,"featureFlagsApiRef")&&e.d(s,{featureFlagsApiRef:function(){return r.featureFlagsApiRef}}),e.o(r,"fetchApiRef")&&e.d(s,{fetchApiRef:function(){return r.fetchApiRef}}),e.o(r,"getComponentData")&&e.d(s,{getComponentData:function(){return r.getComponentData}}),e.o(r,"githubAuthApiRef")&&e.d(s,{githubAuthApiRef:function(){return r.githubAuthApiRef}}),e.o(r,"gitlabAuthApiRef")&&e.d(s,{gitlabAuthApiRef:function(){return r.gitlabAuthApiRef}}),e.o(r,"googleAuthApiRef")&&e.d(s,{googleAuthApiRef:function(){return r.googleAuthApiRef}}),e.o(r,"identityApiRef")&&e.d(s,{identityApiRef:function(){return r.identityApiRef}}),e.o(r,"microsoftAuthApiRef")&&e.d(s,{microsoftAuthApiRef:function(){return r.microsoftAuthApiRef}}),e.o(r,"oauthRequestApiRef")&&e.d(s,{oauthRequestApiRef:function(){return r.oauthRequestApiRef}}),e.o(r,"oktaAuthApiRef")&&e.d(s,{oktaAuthApiRef:function(){return r.oktaAuthApiRef}}),e.o(r,"oneloginAuthApiRef")&&e.d(s,{oneloginAuthApiRef:function(){return r.oneloginAuthApiRef}}),e.o(r,"storageApiRef")&&e.d(s,{storageApiRef:function(){return r.storageApiRef}}),e.o(r,"useApp")&&e.d(s,{useApp:function(){return r.useApp}}),e.o(r,"useElementFilter")&&e.d(s,{useElementFilter:function(){return r.useElementFilter}}),e.o(r,"useRouteRef")&&e.d(s,{useRouteRef:function(){return r.useRouteRef}}),e.o(r,"useRouteRefParams")&&e.d(s,{useRouteRefParams:function(){return r.useRouteRefParams}});var t=e(39135)},90515:function(ee,s,e){"use strict";e.d(s,{T:function(){return t}});class r{constructor(u){if(this.config=u,!u.id.split(".").flatMap(m=>m.split("-")).every(m=>m.match(/^[a-z][a-z0-9]*$/)))throw new Error(`API id must only contain period separated lowercase alphanum tokens with dashes, got '${u.id}'`)}get id(){return this.config.id}get T(){throw new Error(`tried to read ApiRef.T of ${this}`)}toString(){return`apiRef{${this.config.id}}`}}function t(l){return new r(l)}},25182:function(ee,s,e){"use strict";e.d(s,{n:function(){return r}});function r(t,l){return"id"in t?{api:t,deps:{},factory:()=>l}:t}},86833:function(ee,s,e){"use strict";e.d(s,{createApiFactory:function(){return A.n},createApiRef:function(){return t.T},useApi:function(){return r.h_},useApiHolder:function(){return r.I_}});var r=e(5761),t=e(90515),l=e(16362),u=e.n(l);e.o(l,"FeatureFlagState")&&e.d(s,{FeatureFlagState:function(){return l.FeatureFlagState}}),e.o(l,"SessionState")&&e.d(s,{SessionState:function(){return l.SessionState}}),e.o(l,"alertApiRef")&&e.d(s,{alertApiRef:function(){return l.alertApiRef}}),e.o(l,"analyticsApiRef")&&e.d(s,{analyticsApiRef:function(){return l.analyticsApiRef}}),e.o(l,"appThemeApiRef")&&e.d(s,{appThemeApiRef:function(){return l.appThemeApiRef}}),e.o(l,"atlassianAuthApiRef")&&e.d(s,{atlassianAuthApiRef:function(){return l.atlassianAuthApiRef}}),e.o(l,"attachComponentData")&&e.d(s,{attachComponentData:function(){return l.attachComponentData}}),e.o(l,"bitbucketAuthApiRef")&&e.d(s,{bitbucketAuthApiRef:function(){return l.bitbucketAuthApiRef}}),e.o(l,"configApiRef")&&e.d(s,{configApiRef:function(){return l.configApiRef}}),e.o(l,"createApiFactory")&&e.d(s,{createApiFactory:function(){return l.createApiFactory}}),e.o(l,"createComponentExtension")&&e.d(s,{createComponentExtension:function(){return l.createComponentExtension}}),e.o(l,"createExternalRouteRef")&&e.d(s,{createExternalRouteRef:function(){return l.createExternalRouteRef}}),e.o(l,"createPlugin")&&e.d(s,{createPlugin:function(){return l.createPlugin}}),e.o(l,"createReactExtension")&&e.d(s,{createReactExtension:function(){return l.createReactExtension}}),e.o(l,"createRoutableExtension")&&e.d(s,{createRoutableExtension:function(){return l.createRoutableExtension}}),e.o(l,"createRouteRef")&&e.d(s,{createRouteRef:function(){return l.createRouteRef}}),e.o(l,"discoveryApiRef")&&e.d(s,{discoveryApiRef:function(){return l.discoveryApiRef}}),e.o(l,"errorApiRef")&&e.d(s,{errorApiRef:function(){return l.errorApiRef}}),e.o(l,"featureFlagsApiRef")&&e.d(s,{featureFlagsApiRef:function(){return l.featureFlagsApiRef}}),e.o(l,"fetchApiRef")&&e.d(s,{fetchApiRef:function(){return l.fetchApiRef}}),e.o(l,"getComponentData")&&e.d(s,{getComponentData:function(){return l.getComponentData}}),e.o(l,"githubAuthApiRef")&&e.d(s,{githubAuthApiRef:function(){return l.githubAuthApiRef}}),e.o(l,"gitlabAuthApiRef")&&e.d(s,{gitlabAuthApiRef:function(){return l.gitlabAuthApiRef}}),e.o(l,"googleAuthApiRef")&&e.d(s,{googleAuthApiRef:function(){return l.googleAuthApiRef}}),e.o(l,"identityApiRef")&&e.d(s,{identityApiRef:function(){return l.identityApiRef}}),e.o(l,"microsoftAuthApiRef")&&e.d(s,{microsoftAuthApiRef:function(){return l.microsoftAuthApiRef}}),e.o(l,"oauthRequestApiRef")&&e.d(s,{oauthRequestApiRef:function(){return l.oauthRequestApiRef}}),e.o(l,"oktaAuthApiRef")&&e.d(s,{oktaAuthApiRef:function(){return l.oktaAuthApiRef}}),e.o(l,"oneloginAuthApiRef")&&e.d(s,{oneloginAuthApiRef:function(){return l.oneloginAuthApiRef}}),e.o(l,"storageApiRef")&&e.d(s,{storageApiRef:function(){return l.storageApiRef}}),e.o(l,"useApp")&&e.d(s,{useApp:function(){return l.useApp}}),e.o(l,"useElementFilter")&&e.d(s,{useElementFilter:function(){return l.useElementFilter}}),e.o(l,"useRouteRef")&&e.d(s,{useRouteRef:function(){return l.useRouteRef}}),e.o(l,"useRouteRefParams")&&e.d(s,{useRouteRefParams:function(){return l.useRouteRefParams}});var A=e(25182)},16362:function(){},5761:function(ee,s,e){"use strict";e.d(s,{I_:function(){return l},h_:function(){return u}});var r=e(2784),t=e(76241);function l(){const m=(0,t.Vt)("api-context");if(!m)throw new Error("API context is not available");const o=m.atVersion(1);if(!o)throw new Error("ApiContext v1 not available");return o}function u(m){const c=l().get(m);if(!c)throw new Error(`No implementation available for ${m}`);return c}function A(m){return function(c){const f=p=>{const E=l(),T={};for(const I in m)if(m.hasOwnProperty(I)){const B=m[I],j=E.get(B);if(!j)throw new Error(`No implementation available for ${B}`);T[I]=j}return React.createElement(c,{...p,...T})},y=c.displayName||c.name||"Component";return f.displayName=`withApis(${y})`,f}}},31311:function(ee,s,e){"use strict";e.d(s,{useApp:function(){return r.q}});var r=e(32483),t=e(67229),l=e.n(t);e.o(t,"attachComponentData")&&e.d(s,{attachComponentData:function(){return t.attachComponentData}}),e.o(t,"createApiFactory")&&e.d(s,{createApiFactory:function(){return t.createApiFactory}}),e.o(t,"createApiRef")&&e.d(s,{createApiRef:function(){return t.createApiRef}}),e.o(t,"createComponentExtension")&&e.d(s,{createComponentExtension:function(){return t.createComponentExtension}}),e.o(t,"createExternalRouteRef")&&e.d(s,{createExternalRouteRef:function(){return t.createExternalRouteRef}}),e.o(t,"createPlugin")&&e.d(s,{createPlugin:function(){return t.createPlugin}}),e.o(t,"createReactExtension")&&e.d(s,{createReactExtension:function(){return t.createReactExtension}}),e.o(t,"createRoutableExtension")&&e.d(s,{createRoutableExtension:function(){return t.createRoutableExtension}}),e.o(t,"createRouteRef")&&e.d(s,{createRouteRef:function(){return t.createRouteRef}}),e.o(t,"getComponentData")&&e.d(s,{getComponentData:function(){return t.getComponentData}}),e.o(t,"useApi")&&e.d(s,{useApi:function(){return t.useApi}}),e.o(t,"useApiHolder")&&e.d(s,{useApiHolder:function(){return t.useApiHolder}}),e.o(t,"useElementFilter")&&e.d(s,{useElementFilter:function(){return t.useElementFilter}}),e.o(t,"useRouteRef")&&e.d(s,{useRouteRef:function(){return t.useRouteRef}}),e.o(t,"useRouteRefParams")&&e.d(s,{useRouteRefParams:function(){return t.useRouteRefParams}})},67229:function(){},32483:function(ee,s,e){"use strict";e.d(s,{q:function(){return t}});var r=e(76241);const t=()=>{const l=(0,r.Vt)("app-context");if(!l)throw new Error("App context is not available");const u=l.atVersion(1);if(!u)throw new Error("AppContext v1 not available");return u}},74181:function(ee,s,e){"use strict";e.d(s,{R5:function(){return u},CO:function(){return E},YO:function(){return T},P4:function(){return p},IY:function(){return A},vJ:function(){return M}});var r=e(76241);const t=(0,r.uW)("component-data-store",()=>new WeakMap),l="__backstage_data";function u(b,L,D){var te;const U=b;let Y=(te=U[l])!=null?te:t.get(b);if(Y||(Y={map:new Map},Object.defineProperty(U,l,{enumerable:!1,configurable:!0,writable:!1,value:Y}),t.set(b,Y)),Y.map.has(L)){const ue=b.displayName||b.name;throw new Error(`Attempted to attach duplicate data "${L}" to component "${ue}"`)}Y.map.set(L,D)}function A(b,L){var Y;if(!b)return;const D=b.type;if(!D)return;const U=(Y=D[l])!=null?Y:t.get(D);if(!!U)return U.map.get(L)}var m=e(2784),o=e(88609),c=e(31311),f=e(82772);class y extends m.Component{constructor(){super(...arguments);q(this,"state",{error:void 0});q(this,"handleErrorReset",()=>{this.setState({error:void 0})})}static getDerivedStateFromError(D){return{error:D}}render(){const{error:D}=this.state,{app:U,plugin:Y}=this.props,{ErrorBoundaryFallback:te}=U.getComponents();return D?m.createElement(te,{error:D,resetError:this.handleErrorReset,plugin:Y}):this.props.children}}function p(b){const{component:L,mountPoint:D,name:U}=b;return T({component:{lazy:()=>L().then(Y=>{const te=Re=>{try{(0,f.tg)(D)}catch(we){if(typeof we=="object"&&we!==null){const{message:ge}=we;if(typeof ge=="string"&&ge.startsWith("No path for "))throw new Error(`Routable extension component with mount point ${D} 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 we}return m.createElement(Y,{...Re})},ue=U||Y.displayName||Y.name||"LazyComponent";return te.displayName=`RoutableExtension(${ue})`,te},Y=>ue=>{const Re=(0,c.useApp)(),{BootErrorPage:we}=Re.getComponents();return m.createElement(we,{step:"load-chunk",error:Y})})},data:{"core.mountPoint":D},name:U})}function E(b){const{component:L,name:D}=b;return T({component:L,name:D})}function T(b){const{data:L={},name:D}=b;D||console.warn("Declaring extensions without name is DEPRECATED. Make sure that all usages of createReactExtension, createComponentExtension and createRoutableExtension provide a name.");let U;if("lazy"in b.component){const te=b.component.lazy;U=(0,m.lazy)(()=>te().then(ue=>({default:ue})))}else U=b.component.sync;const Y=D||U.displayName||U.name||"Component";return{expose(te){const ue=Re=>{const we=(0,c.useApp)(),{Progress:ge}=we.getComponents(),ze=L==null?void 0:L["core.mountPoint"];return m.createElement(m.Suspense,{fallback:m.createElement(ge,null)},m.createElement(y,{app:we,plugin:te},m.createElement(o.fC,{attributes:{pluginId:te.getId(),...D&&{extension:D},...ze&&{routeRef:ze.id}}},m.createElement(U,{...Re}))))};u(ue,"core.plugin",te);for(const[Re,we]of Object.entries(L))u(ue,Re,we);return ue.displayName=`Extension(${Y})`,ue}}}var I=e(27399);function B(b,L,D,U){return m.Children.toArray(b).flatMap(Y=>{if(!(0,m.isValidElement)(Y))return[];if(Y.type===m.Fragment)return B(Y.props.children,L,D,U);if(A(Y,"core.featureFlagged")){const te=Y.props;return("with"in te?L.isActive(te.with):!L.isActive(te.without))?B(Y.props.children,L,D,U):[]}if(D===void 0||D(Y))return[Y];if(U)throw new Error(U);return B(Y.props.children,L,D,U)})}class j{constructor(L,D){this.node=L,this.featureFlagsApi=D}selectByComponentData(L){const D=B(this.node,this.featureFlagsApi,U=>A(U,L.key)!==void 0,L.withStrictError);return new j(D,this.featureFlagsApi)}findComponentData(L){return B(this.node,this.featureFlagsApi,U=>A(U,L.key)!==void 0).map(U=>A(U,L.key)).filter(U=>U!==void 0)}getElements(){return B(this.node,this.featureFlagsApi)}}function M(b,L,D=[]){const U=(0,I.useApi)(I.featureFlagsApiRef),Y=new j(b,U);return(0,m.useMemo)(()=>L(Y),[b,...D])}},80274:function(){},36964:function(ee,s,e){"use strict";e.d(s,{AnalyticsContext:function(){return r.f},FeatureFlagState:function(){return t.FeatureFlagState},SessionState:function(){return t.SessionState},alertApiRef:function(){return t.alertApiRef},analyticsApiRef:function(){return t.analyticsApiRef},appThemeApiRef:function(){return t.appThemeApiRef},atlassianAuthApiRef:function(){return t.atlassianAuthApiRef},attachComponentData:function(){return u.R5},bitbucketAuthApiRef:function(){return t.bitbucketAuthApiRef},configApiRef:function(){return t.configApiRef},createComponentExtension:function(){return u.CO},createExternalRouteRef:function(){return c.x8},createPlugin:function(){return o.r},createReactExtension:function(){return u.YO},createRoutableExtension:function(){return u.P4},createRouteRef:function(){return c.NT},discoveryApiRef:function(){return t.discoveryApiRef},errorApiRef:function(){return t.errorApiRef},featureFlagsApiRef:function(){return t.featureFlagsApiRef},fetchApiRef:function(){return t.fetchApiRef},getComponentData:function(){return u.IY},githubAuthApiRef:function(){return t.githubAuthApiRef},gitlabAuthApiRef:function(){return t.gitlabAuthApiRef},googleAuthApiRef:function(){return t.googleAuthApiRef},identityApiRef:function(){return t.identityApiRef},microsoftAuthApiRef:function(){return t.microsoftAuthApiRef},oauthRequestApiRef:function(){return t.oauthRequestApiRef},oktaAuthApiRef:function(){return t.oktaAuthApiRef},oneloginAuthApiRef:function(){return t.oneloginAuthApiRef},storageApiRef:function(){return t.storageApiRef},useAnalytics:function(){return r.z},useApp:function(){return l.useApp},useElementFilter:function(){return u.vJ},useRouteRef:function(){return c.tg},useRouteRefParams:function(){return c.Oi}});var r=e(28461),t=e(27399);e.o(t,"attachComponentData")&&e.d(s,{attachComponentData:function(){return t.attachComponentData}}),e.o(t,"createApiFactory")&&e.d(s,{createApiFactory:function(){return t.createApiFactory}}),e.o(t,"createApiRef")&&e.d(s,{createApiRef:function(){return t.createApiRef}}),e.o(t,"createComponentExtension")&&e.d(s,{createComponentExtension:function(){return t.createComponentExtension}}),e.o(t,"createExternalRouteRef")&&e.d(s,{createExternalRouteRef:function(){return t.createExternalRouteRef}}),e.o(t,"createPlugin")&&e.d(s,{createPlugin:function(){return t.createPlugin}}),e.o(t,"createReactExtension")&&e.d(s,{createReactExtension:function(){return t.createReactExtension}}),e.o(t,"createRoutableExtension")&&e.d(s,{createRoutableExtension:function(){return t.createRoutableExtension}}),e.o(t,"createRouteRef")&&e.d(s,{createRouteRef:function(){return t.createRouteRef}}),e.o(t,"getComponentData")&&e.d(s,{getComponentData:function(){return t.getComponentData}}),e.o(t,"useApi")&&e.d(s,{useApi:function(){return t.useApi}}),e.o(t,"useApiHolder")&&e.d(s,{useApiHolder:function(){return t.useApiHolder}}),e.o(t,"useApp")&&e.d(s,{useApp:function(){return t.useApp}}),e.o(t,"useElementFilter")&&e.d(s,{useElementFilter:function(){return t.useElementFilter}}),e.o(t,"useRouteRef")&&e.d(s,{useRouteRef:function(){return t.useRouteRef}}),e.o(t,"useRouteRefParams")&&e.d(s,{useRouteRefParams:function(){return t.useRouteRefParams}});var l=e(31311);e.o(l,"attachComponentData")&&e.d(s,{attachComponentData:function(){return l.attachComponentData}}),e.o(l,"createApiFactory")&&e.d(s,{createApiFactory:function(){return l.createApiFactory}}),e.o(l,"createApiRef")&&e.d(s,{createApiRef:function(){return l.createApiRef}}),e.o(l,"createComponentExtension")&&e.d(s,{createComponentExtension:function(){return l.createComponentExtension}}),e.o(l,"createExternalRouteRef")&&e.d(s,{createExternalRouteRef:function(){return l.createExternalRouteRef}}),e.o(l,"createPlugin")&&e.d(s,{createPlugin:function(){return l.createPlugin}}),e.o(l,"createReactExtension")&&e.d(s,{createReactExtension:function(){return l.createReactExtension}}),e.o(l,"createRoutableExtension")&&e.d(s,{createRoutableExtension:function(){return l.createRoutableExtension}}),e.o(l,"createRouteRef")&&e.d(s,{createRouteRef:function(){return l.createRouteRef}}),e.o(l,"getComponentData")&&e.d(s,{getComponentData:function(){return l.getComponentData}}),e.o(l,"useApi")&&e.d(s,{useApi:function(){return l.useApi}}),e.o(l,"useApiHolder")&&e.d(s,{useApiHolder:function(){return l.useApiHolder}}),e.o(l,"useElementFilter")&&e.d(s,{useElementFilter:function(){return l.useElementFilter}}),e.o(l,"useRouteRef")&&e.d(s,{useRouteRef:function(){return l.useRouteRef}}),e.o(l,"useRouteRefParams")&&e.d(s,{useRouteRefParams:function(){return l.useRouteRefParams}});var u=e(74181),A=e(80274),m=e.n(A);e.o(A,"createApiFactory")&&e.d(s,{createApiFactory:function(){return A.createApiFactory}}),e.o(A,"createApiRef")&&e.d(s,{createApiRef:function(){return A.createApiRef}}),e.o(A,"createExternalRouteRef")&&e.d(s,{createExternalRouteRef:function(){return A.createExternalRouteRef}}),e.o(A,"createPlugin")&&e.d(s,{createPlugin:function(){return A.createPlugin}}),e.o(A,"createRouteRef")&&e.d(s,{createRouteRef:function(){return A.createRouteRef}}),e.o(A,"useApi")&&e.d(s,{useApi:function(){return A.useApi}}),e.o(A,"useApiHolder")&&e.d(s,{useApiHolder:function(){return A.useApiHolder}}),e.o(A,"useRouteRef")&&e.d(s,{useRouteRef:function(){return A.useRouteRef}}),e.o(A,"useRouteRefParams")&&e.d(s,{useRouteRefParams:function(){return A.useRouteRefParams}});var o=e(96896),c=e(82772)},96896:function(ee,s,e){"use strict";e.d(s,{r:function(){return t}});class r{constructor(u){this.config=u}getId(){return this.config.id}getApis(){var u;return(u=this.config.apis)!=null?u:[]}getFeatureFlags(){var u,A;return(A=(u=this.config.featureFlags)==null?void 0:u.slice())!=null?A:[]}get routes(){var u;return(u=this.config.routes)!=null?u:{}}get externalRoutes(){var u;return(u=this.config.externalRoutes)!=null?u:{}}provide(u){return u.expose(this)}toString(){return`plugin{${this.config.id}}`}}function t(l){return new r(l)}},82772:function(ee,s,e){var I,B,j;"use strict";e.d(s,{x8:function(){return f},NT:function(){return u},tg:function(){return E},Oi:function(){return T}});var r=e(76241);const t=(0,r.uW)("route-ref-type",()=>Symbol("route-ref-type"));class l{constructor(b,L){q(this,I,"absolute");this.id=b,this.params=L}get title(){return this.id}toString(){return`routeRef{type=absolute,id=${this.id}}`}}I=t;function u(M){var b;return new l(M.id,(b=M.params)!=null?b:[])}const A=/^\w+$/;class m{constructor(b,L,D,U){q(this,B,"sub");this.id=b,this.path=L,this.parent=D,this.params=U}toString(){return`routeRef{type=sub,id=${this.id}}`}}B=t;function o(M){const{id:b,path:L,parent:D}=M,U=L.split("/").filter(ue=>ue.startsWith(":")).map(ue=>ue.substring(1)),Y=[...D.params,...U];if(D.params.some(ue=>U.includes(ue)))throw new Error("SubRouteRef may not have params that overlap with its parent");if(!L.startsWith("/"))throw new Error(`SubRouteRef path must start with '/', got '${L}'`);if(L.endsWith("/"))throw new Error(`SubRouteRef path must not end with '/', got '${L}'`);for(const ue of U)if(!A.test(ue))throw new Error(`SubRouteRef path has invalid param, got '${ue}'`);return new m(b,L,D,Y)}class c{constructor(b,L,D){q(this,j,"external");this.id=b,this.params=L,this.optional=D}toString(){return`routeRef{type=external,id=${this.id}}`}}j=t;function f(M){var b;return new c(M.id,(b=M.params)!=null?b:[],Boolean(M.optional))}var y=e(2784),p=e(10289);function E(M){const b=(0,p.TH)(),L=(0,r.Vt)("routing-context");if(!L)throw new Error("Routing context is not available");const D=L.atVersion(1),U=(0,y.useMemo)(()=>D&&D.resolve(M,b),[D,M,b]);if(!L)throw new Error("useRouteRef used outside of routing context");if(!D)throw new Error("RoutingContext v1 not available");const Y="optional"in M&&M.optional;if(!U&&!Y)throw new Error(`No path for ${M}`);return U}function T(M){return(0,p.UO)()}},10179:function(ee,s,e){"use strict";e.d(s,{SP:function(){return I},dR:function(){return p},VL:function(){return j},BD:function(){return t}});function r(M){if(typeof M!="object"||M===null||Array.isArray(M))return!1;const b=M;return!(typeof b.name!="string"||b.name===""||typeof b.message!="string")}function t(M){if(typeof M!="object"||M===null||Array.isArray(M))throw new Error(`Encountered invalid error, not an object, got '${M}'`);const b=M;if(typeof b.name!="string"||b.name==="")throw new Error(`Encountered error object without a name, got '${M}'`);if(typeof b.message!="string")throw new Error(`Encountered error object without a message, got '${M}'`)}var l=e(24852);function u(M,b){const L=serializeErrorInternal(M),D={name:"Unknown",message:"<no reason given>",...L};return b!=null&&b.includeStack||delete D.stack,D}function A(M){const b=(0,l.deserializeError)(M);return M.stack||(b.stack=void 0),b}function m(M){if(r(M)){const b=String(M);return b!=="[object Object]"?b:`${M.name}: ${M.message}`}return`unknown error '${M}'`}class o extends Error{constructor(L,D){var Y;let U=L;if(D!==void 0){const te=m(D);U?U+=`; caused by ${te}`:U=`caused by ${te}`}super(U);q(this,"cause");(Y=Error.captureStackTrace)==null||Y.call(Error,this,this.constructor),this.name=this.constructor.name,this.cause=r(D)?D:void 0}}class c extends null{}class f extends null{}class y extends null{}class p extends o{}class E extends null{}class T extends null{}class I extends o{constructor(b,L){super(b,L),this.name=r(L)?L.name:"Error"}}async function B(M){var b;try{const L=await M.text();if(L){if((b=M.headers.get("content-type"))!=null&&b.startsWith("application/json"))try{const D=JSON.parse(L);if(D.error&&D.response)return D}catch{}return{error:{name:"Error",message:`Request failed with status ${M.status} ${M.statusText}, ${L}`},response:{statusCode:M.status}}}}catch{}return{error:{name:"Error",message:`Request failed with status ${M.status} ${M.statusText}`},response:{statusCode:M.status}}}class j extends Error{constructor(L){super(L.message);q(this,"response");q(this,"body");q(this,"cause");this.name="ResponseError",this.response=L.response,this.body=L.data,this.cause=L.cause}static async fromResponse(L){const D=await B(L),U=D.response.statusCode||L.status,Y=D.error.name||L.statusText,te=`Request failed with ${U} ${Y}`,ue=A(D.error);return new j({message:te,response:L,data:D,cause:ue})}}},36356:function(ee,s,e){var p,E,T,I,B;"use strict";e.d(s,{nW:function(){return y},ae:function(){return m},q3:function(){return o}});var r=e(36964);const t=(0,r.createApiRef)({id:"core.scmauth"});class l{constructor(b){Dn(this,p,void 0);wn(this,p,b)}async getCredentials(b){const L=new URL(b.url),D=rt(this,p).find(U=>U.isUrlSupported(L));if(!D)throw new Error(`No auth provider available for '${b.url}', see https://backstage.io/link?scm-auth`);return D.getCredentials(b)}}p=new WeakMap;const j=class{constructor(b,L,D,U){Dn(this,E,void 0);Dn(this,T,void 0);Dn(this,I,void 0);Dn(this,B,void 0);wn(this,E,L),wn(this,T,D),wn(this,I,U),wn(this,B,b)}static createDefaultApiFactory(){return createApiFactory({api:scmAuthApiRef,deps:{github:githubAuthApiRef,gitlab:gitlabAuthApiRef,azure:microsoftAuthApiRef,bitbucket:bitbucketAuthApiRef},factory:({github:b,gitlab:L,azure:D,bitbucket:U})=>j.merge(j.forGithub(b),j.forGitlab(L),j.forAzure(D),j.forBitbucket(U))})}static forAuthApi(b,L){return new j("generic",b,L.host,L.scopeMapping)}static forGithub(b,L){var U;const D=(U=L==null?void 0:L.host)!=null?U:"github.com";return new j("github",b,D,{default:["repo","read:org","read:user"],repoWrite:["gist"]})}static forGitlab(b,L){var U;const D=(U=L==null?void 0:L.host)!=null?U:"gitlab.com";return new j("gitlab",b,D,{default:["read_user","read_api","read_repository"],repoWrite:["write_repository","api"]})}static forAzure(b,L){var U;const D=(U=L==null?void 0:L.host)!=null?U:"dev.azure.com";return new j("azure",b,D,{default:["vso.build","vso.code","vso.graph","vso.project","vso.profile"],repoWrite:["vso.code_manage"]})}static forBitbucket(b,L){var U;const D=(U=L==null?void 0:L.host)!=null?U:"bitbucket.org";return new j("bitbucket",b,D,{default:["account","team","pullrequest","snippet","issue"],repoWrite:["pullrequest:write","snippet:write","issue:write"]})}static merge(...b){return new l(b)}isUrlSupported(b){return b.host===rt(this,T)}getAdditionalScopesForProvider(b){var L,D;return!(b!=null&&b.customScopes)||rt(this,B)==="generic"?[]:(D=(L=b.customScopes)==null?void 0:L[rt(this,B)])!=null?D:[]}async getCredentials(b){const{url:L,additionalScope:D,...U}=b,Y=rt(this,I).default.slice();D!=null&&D.repoWrite&&Y.push(...rt(this,I).repoWrite);const te=this.getAdditionalScopesForProvider(D);te.length&&Y.push(...te);const ue=[...new Set(Y)],Re=await rt(this,E).getAccessToken(ue,U);return{token:Re,headers:{Authorization:`Bearer ${Re}`}}}};let u=j;E=new WeakMap,T=new WeakMap,I=new WeakMap,B=new WeakMap;var A=e(68370);class m{static fromConfig(b){return A.Lx.fromConfig(b)}}const o=(0,r.createApiRef)({id:"integration.scmintegrations"});var c=e(73250),f=e(2784);const y=M=>{var Y;const{type:b}=M,L=(0,r.useApp)(),D=c.Z,U=b&&(Y=L.getSystemIcon(b))!=null?Y:D;return f.createElement(U,null)}},68370:function(ee,s,e){var Ft,ut,kt,tn,jt,Vt,cn;"use strict";e.d(s,{Lx:function(){return Ht},Pb:function(){return Xt}});var r=e(82717),t=e.n(r),l=e(76635);function u($){const h=new URL("http://example.com");return h.host=$,h.host===$}function A($){try{return new URL($),!0}catch{return!1}}function m($,h){return{list(){return $},byUrl(S){try{const F=typeof S=="string"?new URL(S):S;return $.find(W=>h(W)===F.host)}catch{return}},byHost(S){return $.find(F=>h(F)===S)}}}function o($){const{url:h,base:S,lineNumber:F}=$;try{return new URL(h),h}catch{}let W;if(h.startsWith("/")){const{filepath:pe}=t()(S);W=new URL(S);const he=(0,l.trimEnd)(W.pathname.substring(0,W.pathname.length-pe.length),"/");W.pathname=`${he}${h}`}else W=new URL(h,S);return W.search=new URL(S).search,F&&(W.hash=`L${F}`),W.toString()}const c="amazonaws.com";function f($){var Pt;const h=$.getOptionalString("endpoint"),S=(Pt=$.getOptionalBoolean("s3ForcePathStyle"))!=null?Pt:!1;let F,W;if(h){try{const bn=new URL(h);F=bn.host,W=bn.pathname}catch{throw new Error(`invalid awsS3 integration config, endpoint '${h}' is not a valid URL`)}if(W!=="/")throw new Error(`invalid awsS3 integration config, endpoints cannot contain path, got '${h}'`)}else F=c;const pe=$.getOptionalString("accessKeyId"),he=$.getOptionalString("secretAccessKey"),Me=$.getOptionalString("roleArn"),ft=$.getOptionalString("externalId");return{host:F,endpoint:h,s3ForcePathStyle:S,accessKeyId:pe,secretAccessKey:he,roleArn:Me,externalId:ft}}function y($){const h=$.map(f);return h.some(S=>S.host===c)||h.push({host:c}),h}const Dt=class{get type(){return"awsS3"}get title(){return this.integrationConfig.host}get config(){return this.integrationConfig}constructor(h){this.integrationConfig=h}resolveUrl(h){return o(h)}resolveEditUrl(h){return h}};let p=Dt;q(p,"factory",({config:h})=>{var F;const S=y((F=h.getOptionalConfigArray("integrations.awsS3"))!=null?F:[]);return m(S.map(W=>new Dt(W)),W=>W.config.host)});const E="GB",Tn=class{constructor(h,S,F,W,pe,he){Dn(this,Ft,void 0);Dn(this,ut,void 0);Dn(this,kt,void 0);Dn(this,tn,void 0);Dn(this,jt,void 0);Dn(this,Vt,void 0);Dn(this,cn,(...h)=>{const S=new URL(rt(this,Ft));return S.pathname=h.map(F=>encodeURIComponent(F)).join("/"),S});wn(this,Ft,h),wn(this,ut,S),wn(this,kt,F),wn(this,tn,W),wn(this,jt,pe),wn(this,Vt,he)}static fromRepoUrl(h){var bn;const S=new URL(h);let F,W,pe;const he=S.pathname.split("/").map(vn=>decodeURIComponent(vn));if(he[2]==="_git"?(F=he[1],W=pe=he[3]):he[3]==="_git"?(F=he[1],W=he[2],pe=he[4]):he[4]==="_git"&&(F=`${he[1]}/${he[2]}`,W=he[3],pe=he[5]),!F||!W||!pe)throw new Error("Azure URL must point to a git repository");const Me=(bn=S.searchParams.get("path"))!=null?bn:void 0;let ft;const Pt=S.searchParams.get("version");if(Pt){if(Pt.slice(0,2)!=="GB")throw new Error("Azure URL version must point to a git branch");ft=Pt.slice(2)}return new Tn(S.origin,F,W,pe,Me,ft)}toRepoUrl(){let h;return rt(this,kt)===rt(this,tn)?h=rt(this,cn).call(this,rt(this,ut),"_git",rt(this,tn)):h=rt(this,cn).call(this,rt(this,ut),rt(this,kt),"_git",rt(this,tn)),rt(this,jt)&&h.searchParams.set("path",rt(this,jt)),rt(this,Vt)&&h.searchParams.set("version",E+rt(this,Vt)),h.toString()}toFileUrl(){if(!rt(this,jt))throw new Error("Azure URL must point to a specific path to be able to download a file");const h=rt(this,cn).call(this,rt(this,ut),rt(this,kt),"_apis","git","repositories",rt(this,tn),"items");return h.searchParams.set("api-version","6.0"),h.searchParams.set("path",rt(this,jt)),rt(this,Vt)&&h.searchParams.set("version",rt(this,Vt)),h.toString()}toArchiveUrl(){const h=rt(this,cn).call(this,rt(this,ut),rt(this,kt),"_apis","git","repositories",rt(this,tn),"items");return h.searchParams.set("recursionLevel","full"),h.searchParams.set("download","true"),h.searchParams.set("api-version","6.0"),rt(this,jt)&&h.searchParams.set("scopePath",rt(this,jt)),rt(this,Vt)&&h.searchParams.set("version",rt(this,Vt)),h.toString()}toCommitsUrl(){const h=rt(this,cn).call(this,rt(this,ut),rt(this,kt),"_apis","git","repositories",rt(this,tn),"commits");return h.searchParams.set("api-version","6.0"),rt(this,Vt)&&h.searchParams.set("searchCriteria.itemVersion.version",rt(this,Vt)),h.toString()}getOwner(){return rt(this,ut)}getProject(){return rt(this,kt)}getRepo(){return rt(this,tn)}getPath(){return rt(this,jt)}getRef(){return rt(this,Vt)}};let T=Tn;Ft=new WeakMap,ut=new WeakMap,kt=new WeakMap,tn=new WeakMap,jt=new WeakMap,Vt=new WeakMap,cn=new WeakMap;const I="dev.azure.com";function B($){var F;const h=(F=$.getOptionalString("host"))!=null?F:I,S=$.getOptionalString("token");if(!u(h))throw new Error(`Invalid Azure integration config, '${h}' is not a valid host`);return{host:h,token:S}}function j($){const h=$.map(B);return h.some(S=>S.host===I)||h.push({host:I}),h}const wt=class{constructor(h){this.integrationConfig=h}get type(){return"azure"}get title(){return this.integrationConfig.host}get config(){return this.integrationConfig}resolveUrl(h){var W;const{url:S,base:F}=h;if(A(S))return S;try{const pe=T.fromRepoUrl(F),he=new URL(F),Me=new URL(`https://a.com${(W=pe.getPath())!=null?W:""}`),ft=new URL(S,Me).pathname;return he.searchParams.set("path",ft),h.lineNumber&&(he.searchParams.set("line",String(h.lineNumber)),he.searchParams.set("lineEnd",String(h.lineNumber+1)),he.searchParams.set("lineStartColumn","1"),he.searchParams.set("lineEndColumn","1")),he.toString()}catch{return new URL(S,F).toString()}}resolveEditUrl(h){return h}};let M=wt;q(M,"factory",({config:h})=>{var F;const S=j((F=h.getOptionalConfigArray("integrations.azure"))!=null?F:[]);return m(S.map(W=>new wt(W)),W=>W.config.host)});var b=e(48834).Buffer;function L($){return AzureUrl.fromRepoUrl($).toFileUrl()}function D($){return AzureUrl.fromRepoUrl($).toArchiveUrl()}function U($){return AzureUrl.fromRepoUrl($).toCommitsUrl()}function Y($,h){const S=h?{...h}:{};if($.token){const F=b.from(`:${$.token}`,"utf8");S.Authorization=`Basic ${F.toString("base64")}`}return{headers:S}}const te="bitbucket.org",ue="https://api.bitbucket.org/2.0";function Re($){var he;const h=(he=$.getOptionalString("host"))!=null?he:te;let S=$.getOptionalString("apiBaseUrl");const F=$.getOptionalString("token"),W=$.getOptionalString("username"),pe=$.getOptionalString("appPassword");if(!u(h))throw new Error(`Invalid Bitbucket integration config, '${h}' is not a valid host`);return S?S=(0,l.trimEnd)(S,"/"):h===te?S=ue:S=`https://${h}/rest/api/1.0`,{host:h,apiBaseUrl:S,token:F,username:W,appPassword:pe}}function we($){const h=$.map(Re);return h.some(S=>S.host===te)||h.push({host:te,apiBaseUrl:ue}),h}const $t=class{constructor(h){this.integrationConfig=h}get type(){return"bitbucket"}get title(){return this.integrationConfig.host}get config(){return this.integrationConfig}resolveUrl(h){const S=o(h);if(!h.lineNumber)return S;const F=new URL(S);return this.integrationConfig.host==="bitbucket.org"?F.hash=`lines-${h.lineNumber}`:F.hash=`${h.lineNumber}`,F.toString()}resolveEditUrl(h){const S=t()(h),F=new URL(h);return F.searchParams.set("mode","edit"),F.searchParams.set("spa","0"),F.searchParams.set("at",S.ref),F.toString()}};let ge=$t;q(ge,"factory",({config:h})=>{var F,W,pe;const S=we((pe=h.getOptionalConfigArray("integrations.bitbucket"))!=null?pe:[...(F=h.getOptionalConfigArray("integrations.bitbucketCloud"))!=null?F:[],...(W=h.getOptionalConfigArray("integrations.bitbucketServer"))!=null?W:[]]);return m(S.map(he=>new $t(he)),he=>he.config.host)});var ze=e(96279),_e=e(48834).Buffer;async function et($,h){const{name:S,owner:F,resource:W}=parseGitUrl($),pe=W==="bitbucket.org";let he=pe?`${h.apiBaseUrl}/repositories/${F}/${S}`:`${h.apiBaseUrl}/projects/${F}/repos/${S}/default-branch`,Me=await fetch(he,pt(h));if(Me.status===404&&!pe&&(he=`${h.apiBaseUrl}/projects/${F}/repos/${S}/branches/default`,Me=await fetch(he,pt(h))),!Me.ok){const Pt=`Failed to retrieve default branch from ${he}, ${Me.status} ${Me.statusText}`;throw new Error(Pt)}let ft;if(pe)ft=(await Me.json()).mainbranch.name;else{const{displayId:Pt}=await Me.json();ft=Pt}if(!ft)throw new Error(`Failed to read default branch from ${he}. Response ${Me.status} ${Me.json()}`);return ft}async function st($,h){const{name:S,owner:F,ref:W,protocol:pe,resource:he,filepath:Me}=parseGitUrl($),ft=he==="bitbucket.org";let Pt=W;Pt||(Pt=await et($,h));const bn=Me?`&path=${encodeURIComponent(Me)}`:"";return ft?`${pe}://${he}/${F}/${S}/get/${Pt}.tar.gz`:`${h.apiBaseUrl}/projects/${F}/repos/${S}/archive?format=tgz&at=${Pt}&prefix=${F}-${S}${bn}`}function Ct($,h){try{const{owner:S,name:F,ref:W,filepathtype:pe,filepath:he}=parseGitUrl($);if(!S||!F||pe!=="browse"&&pe!=="raw"&&pe!=="src")throw new Error("Invalid Bitbucket URL or file path");const Me=he.replace(/^\//,"");if(h.host==="bitbucket.org"){if(!W)throw new Error("Invalid Bitbucket URL or file path");return`${h.apiBaseUrl}/repositories/${S}/${F}/src/${W}/${Me}`}return`${h.apiBaseUrl}/projects/${S}/repos/${F}/raw/${Me}?at=${W}`}catch(S){throw new Error(`Incorrect URL: ${$}, ${S}`)}}function pt($){const h={};if($.token)h.Authorization=`Bearer ${$.token}`;else if($.username&&$.appPassword){const S=_e.from(`${$.username}:${$.appPassword}`,"utf8");h.Authorization=`Basic ${S.toString("base64")}`}return{headers:h}}const Pe="bitbucket.org",ht="https://api.bitbucket.org/2.0";function je($){const h=Pe,S=ht,F=$.getString("username"),W=$.getString("appPassword");return{host:h,apiBaseUrl:S,username:F,appPassword:W}}function ie($){const h=$.map(je);return h.length===0&&h.push({host:Pe,apiBaseUrl:ht}),h}const hn=class{constructor(h){this.integrationConfig=h}get type(){return"bitbucketCloud"}get title(){return this.integrationConfig.host}get config(){return this.integrationConfig}resolveUrl(h){const S=o(h);if(h.lineNumber){const F=new URL(S);return F.hash=`lines-${h.lineNumber}`,F.toString()}return S}resolveEditUrl(h){const S=t()(h),F=new URL(h);return F.searchParams.set("mode","edit"),F.searchParams.set("at",S.ref),F.toString()}};let de=hn;q(de,"factory",({config:h})=>{var F;const S=ie((F=h.getOptionalConfigArray("integrations.bitbucketCloud"))!=null?F:[]);return m(S.map(W=>new hn(W)),W=>W.config.host)});var Ue=e(48834).Buffer;async function Be($,h){const{name:S,owner:F}=parseGitUrl($),W=`${h.apiBaseUrl}/repositories/${F}/${S}`,pe=await fetch(W,Ye(h));if(!pe.ok){const ft=`Failed to retrieve default branch from ${W}, ${pe.status} ${pe.statusText}`;throw new Error(ft)}const Me=(await pe.json()).mainbranch.name;if(!Me)throw new Error(`Failed to read default branch from ${W}. Response ${pe.status} ${pe.json()}`);return Me}async function Xe($,h){const{name:S,owner:F,ref:W,protocol:pe,resource:he}=parseGitUrl($);let Me=W;return Me||(Me=await Be($,h)),`${pe}://${he}/${F}/${S}/get/${Me}.tar.gz`}function mt($,h){try{const{owner:S,name:F,ref:W,filepathtype:pe,filepath:he}=parseGitUrl($);if(!S||!F||pe!=="src"&&pe!=="raw")throw new Error("Invalid Bitbucket Cloud URL or file path");const Me=he.replace(/^\//,"");if(!W)throw new Error("Invalid Bitbucket Cloud URL or file path");return`${h.apiBaseUrl}/repositories/${S}/${F}/src/${W}/${Me}`}catch(S){throw new Error(`Incorrect URL: ${$}, ${S}`)}}function Ye($){const h={};if($.username&&$.appPassword){const S=Ue.from(`${$.username}:${$.appPassword}`,"utf8");h.Authorization=`Basic ${S.toString("base64")}`}return{headers:h}}function yt($){const h=$.getString("host");let S=$.getOptionalString("apiBaseUrl");const F=$.getOptionalString("token");if(!u(h))throw new Error(`Invalid Bitbucket Server integration config, '${h}' is not a valid host`);return S?S=(0,l.trimEnd)(S,"/"):S=`https://${h}/rest/api/1.0`,{host:h,apiBaseUrl:S,token:F}}function oe($){return $.map(yt)}const yn=class{constructor(h){this.integrationConfig=h}get type(){return"bitbucketServer"}get title(){return this.integrationConfig.host}get config(){return this.integrationConfig}resolveUrl(h){const S=o(h);if(h.lineNumber){const F=new URL(S),W=F.pathname.split("/").slice(-1)[0];return F.hash=`${W}-${h.lineNumber}`,F.toString()}return S}resolveEditUrl(h){const S=t()(h),F=new URL(h);return F.searchParams.set("mode","edit"),F.searchParams.set("spa","0"),F.searchParams.set("at",S.ref),F.toString()}};let me=yn;q(me,"factory",({config:h})=>{var F;const S=oe((F=h.getOptionalConfigArray("integrations.bitbucketServer"))!=null?F:[]);return m(S.map(W=>new yn(W)),W=>W.config.host)});async function tt($,h){const{name:S,owner:F}=parseGitUrl($);let W=`${h.apiBaseUrl}/projects/${F}/repos/${S}/default-branch`,pe=await fetch(W,ct(h));if(pe.status===404&&(W=`${h.apiBaseUrl}/projects/${F}/repos/${S}/branches/default`,pe=await fetch(W,ct(h))),!pe.ok){const ft=`Failed to retrieve default branch from ${W}, ${pe.status} ${pe.statusText}`;throw new Error(ft)}const{displayId:he}=await pe.json(),Me=he;if(!Me)throw new Error(`Failed to read default branch from ${W}. Response ${pe.status} ${pe.json()}`);return Me}async function Ge($,h){const{name:S,owner:F,ref:W,filepath:pe}=parseGitUrl($);let he=W;he||(he=await tt($,h));const Me=pe?`&path=${encodeURIComponent(pe)}`:"";return`${h.apiBaseUrl}/projects/${F}/repos/${S}/archive?format=tgz&at=${he}&prefix=${F}-${S}${Me}`}function Ne($,h){try{const{owner:S,name:F,ref:W,filepathtype:pe,filepath:he}=parseGitUrl($);if(!S||!F||pe!=="browse"&&pe!=="raw"&&pe!=="src")throw new Error("Invalid Bitbucket Server URL or file path");const Me=he.replace(/^\//,"");return`${h.apiBaseUrl}/projects/${S}/repos/${F}/raw/${Me}?at=${W}`}catch(S){throw new Error(`Incorrect URL: ${$}, ${S}`)}}function ct($){const h={};return $.token&&(h.Authorization=`Bearer ${$.token}`),{headers:h}}function Q($){const h=$.getString("host");let S=$.getOptionalString("baseUrl"),F=$.getOptionalString("cloneUrl"),W=$.getOptionalString("gitilesBaseUrl");const pe=$.getOptionalString("username"),he=$.getOptionalString("password");if(u(h)){if(S&&!A(S))throw new Error(`Invalid Gerrit integration config, '${S}' is not a valid baseUrl`);if(F&&!A(F))throw new Error(`Invalid Gerrit integration config, '${F}' is not a valid cloneUrl`);if(W&&!A(W))throw new Error(`Invalid Gerrit integration config, '${W}' is not a valid gitilesBaseUrl`)}else throw new Error(`Invalid Gerrit integration config, '${h}' is not a valid host`);return S?S=(0,l.trimEnd)(S,"/"):S=`https://${h}`,W?W=(0,l.trimEnd)(W,"/"):W=`https://${h}`,F?F=(0,l.trimEnd)(F,"/"):F=S,{host:h,baseUrl:S,cloneUrl:F,gitilesBaseUrl:W,username:pe,password:he}}function Z($){return $.map(Q)}var X=e(48834).Buffer;const se=")]}'";function le($,h){const F=h.replace($.gitilesBaseUrl,"").split("/").filter(Pt=>!!Pt),W=F.indexOf("+");if(W<=0)throw new Error(`Unable to parse project from url: ${h}`);const pe=(0,l.trimStart)(F.slice(0,W).join("/"),"/"),he=F.indexOf("heads");if(he<=0)throw new Error(`Unable to parse branch from url: ${h}`);const Me=F[he+1],ft=F.slice(he+2).join("/");return{branch:Me,filePath:ft===""?"/":ft,project:pe}}function be($,h,S,F){return`${$.gitilesBaseUrl}/${h}/+/refs/heads/${S}/${(0,l.trimStart)(F,"/")}`}function Oe($){return $.password?"/a/":"/"}function Ae($,h){const{branch:S,project:F}=le($,h);return`${$.baseUrl}${Oe($)}projects/${encodeURIComponent(F)}/branches/${S}`}function Ke($,h){const{project:S}=le($,h);return`${$.cloneUrl}${Oe($)}${S}`}function ke($,h){const{branch:S,filePath:F,project:W}=le($,h);return`${$.baseUrl}${Oe($)}projects/${encodeURIComponent(W)}/branches/${S}/files/${encodeURIComponent(F)}/content`}function Et($){return`${$.baseUrl}${Oe($)}projects/`}function It($){const h={};if(!$.password)return h;const S=X.from(`${$.username}:${$.password}`,"utf8");return h.Authorization=`Basic ${S.toString("base64")}`,{headers:h}}async function lt($){const h=await $.text();if(h.startsWith(se))try{return JSON.parse(h.slice(se.length))}catch(S){throw new Error(`Invalid response from Gerrit: ${h.slice(0,10)} - ${S}`)}throw new Error(`Gerrit JSON body prefix missing. Found: ${h.slice(0,10)}`)}const an=class{constructor(h){this.integrationConfig=h}get type(){return"gerrit"}get title(){return this.integrationConfig.host}get config(){return this.integrationConfig}resolveUrl(h){const{url:S,base:F,lineNumber:W}=h;let pe;if(S.startsWith("/")){const{branch:he,project:Me}=le(this.config,F);return be(this.config,Me,he,S)}return S?pe=new URL(S,F):pe=new URL(F),W&&(pe.hash=W.toString()),pe.toString()}resolveEditUrl(h){return h}};let Tt=an;q(Tt,"factory",({config:h})=>{var F;const S=Z((F=h.getOptionalConfigArray("integrations.gerrit"))!=null?F:[]);return m(S.map(W=>new an(W)),W=>W.config.host)});const Lt="github.com",Rt="https://api.github.com",Nt="https://raw.githubusercontent.com";function Zt($){var he,Me;const h=(he=$.getOptionalString("host"))!=null?he:Lt;let S=$.getOptionalString("apiBaseUrl"),F=$.getOptionalString("rawBaseUrl");const W=$.getOptionalString("token"),pe=(Me=$.getOptionalConfigArray("apps"))==null?void 0:Me.map(ft=>({appId:ft.getNumber("appId"),clientId:ft.getString("clientId"),clientSecret:ft.getString("clientSecret"),webhookSecret:ft.getString("webhookSecret"),privateKey:ft.getString("privateKey"),allowedInstallationOwners:ft.getOptionalStringArray("allowedInstallationOwners")}));if(!u(h))throw new Error(`Invalid GitHub integration config, '${h}' is not a valid host`);return S?S=(0,l.trimEnd)(S,"/"):h===Lt&&(S=Rt),F?F=(0,l.trimEnd)(F,"/"):h===Lt&&(F=Nt),{host:h,apiBaseUrl:S,rawBaseUrl:F,token:W,apps:pe}}function vt($){const h=$.map(Zt);return h.some(S=>S.host===Lt)||h.push({host:Lt,apiBaseUrl:Rt,rawBaseUrl:Nt}),h}function at($,h,S){try{const{owner:F,name:W,ref:pe,filepathtype:he,filepath:Me}=parseGitUrl($);if(!F||!W||!pe||he!=="blob"&&he!=="raw"&&he!=="tree")throw new Error("Invalid GitHub URL or file path");const ft=Me.replace(/^\//,"");return ae(h,S)==="api"?`${h.apiBaseUrl}/repos/${F}/${W}/contents/${ft}?ref=${pe}`:`${h.rawBaseUrl}/${F}/${W}/${pe}/${ft}`}catch(F){throw new Error(`Incorrect URL: ${$}, ${F}`)}}function zt($,h){const S={};return ae($,h)==="api"&&(S.Accept="application/vnd.github.v3.raw"),h.token&&(S.Authorization=`token ${h.token}`),{headers:S}}function ae($,h){return $.apiBaseUrl&&(h.token||!$.rawBaseUrl)?"api":"raw"}class V{constructor(){q(this,"tokenCache",new Map);q(this,"isNotExpired",h=>h.diff(DateTime.local(),"minutes").minutes>50)}async getOrCreateToken(h,S){const F=this.tokenCache.get(h);if(F&&this.isNotExpired(F.expiresAt))return{accessToken:F.token};const W=await S();return this.tokenCache.set(h,W),{accessToken:W.token}}}const ye={Accept:"application/vnd.github.machine-man-preview+json"};class We{constructor(h,S){q(this,"appClient");q(this,"baseUrl");q(this,"baseAuthConfig");q(this,"cache",new V);q(this,"allowedInstallationOwners");this.allowedInstallationOwners=h.allowedInstallationOwners,this.baseUrl=S,this.baseAuthConfig={appId:h.appId,privateKey:h.privateKey.replace(/\\n/gm,`
|
|
31
|
-
`)},this.appClient=new Octokit({baseUrl:S,headers:ye,authStrategy:createAppAuth,auth:this.baseAuthConfig})}async getInstallationCredentials(h,S){var he;const{installationId:F,suspended:W}=await this.getInstallationData(h);if(this.allowedInstallationOwners&&!((he=this.allowedInstallationOwners)!=null&&he.includes(h)))return{accessToken:void 0};if(W)throw new Error(`The GitHub application for ${h} is suspended`);const pe=S?`${h}/${S}`:h;return this.cache.getOrCreateToken(pe,async()=>{const Me=await this.appClient.apps.createInstallationAccessToken({installation_id:F,headers:ye});if(S&&Me.data.repository_selection==="selected"){const ft=new Octokit({baseUrl:this.baseUrl,auth:Me.data.token});if(!(await ft.paginate(ft.apps.listReposAccessibleToInstallation)).some(vn=>vn.name===S))throw new Error(`The Backstage GitHub application used in the ${h} organization does not have access to a repository with the name ${S}`)}return{token:Me.data.token,expiresAt:DateTime.fromISO(Me.data.expires_at)}})}getInstallations(){return this.appClient.paginate(this.appClient.apps.listInstallations)}async getInstallationData(h){const F=(await this.getInstallations()).find(pe=>{var he,Me;return((Me=(he=pe.account)==null?void 0:he.login)==null?void 0:Me.toLocaleLowerCase("en-US"))===h.toLocaleLowerCase("en-US")});if(F)return{installationId:F.id,suspended:Boolean(F.suspended_by)};const W=new Error(`No app installation found for ${h} in ${this.baseAuthConfig.appId}`);throw W.name="NotFoundError",W}}class qe{constructor(h){q(this,"apps");var S,F;this.apps=(F=(S=h.apps)==null?void 0:S.map(W=>new We(W,h.apiBaseUrl)))!=null?F:[]}async getAllInstallations(){return this.apps.length?(await Promise.all(this.apps.map(S=>S.getInstallations()))).flat():[]}async getAppToken(h,S){if(this.apps.length===0)return;const F=await Promise.all(this.apps.map(Me=>Me.getInstallationCredentials(h,S).then(ft=>({credentials:ft,error:void 0}),ft=>({credentials:void 0,error:ft})))),W=F.find(Me=>Me.credentials);if(W)return W.credentials.accessToken;const he=F.map(Me=>Me.error).find(Me=>Me.name!=="NotFoundError");if(he)throw he}}class ot{constructor(h,S){this.githubAppCredentialsMux=h,this.token=S}async getCredentials(h){const S=parseGitUrl(h.url),F=S.owner||S.name,W=S.owner?S.name:void 0;let pe="app",he=await this.githubAppCredentialsMux.getAppToken(F,W);return he||(pe="token",he=this.token),{headers:he?{Authorization:`Bearer ${he}`}:void 0,token:he,type:pe}}}q(ot,"create",null);class bt{static fromIntegrations(h){const S=new Map;return h.github.list().forEach(F=>{const W=SingleInstanceGithubCredentialsProvider.create(F.config);S.set(F.config.host,W)}),new bt(S)}constructor(h){this.providers=h}async getCredentials(h){const S=new URL(h.url),F=this.providers.get(S.host);if(!F)throw new Error(`There is no GitHub integration that matches ${h.url}. Please add a configuration for an integration.`);return F.getCredentials(h)}}const fn=class{constructor(h){this.integrationConfig=h}get type(){return"github"}get title(){return this.integrationConfig.host}get config(){return this.integrationConfig}resolveUrl(h){return Xt(o(h),"tree")}resolveEditUrl(h){return Xt(h,"edit")}};let Wt=fn;q(Wt,"factory",({config:h})=>{var F;const S=vt((F=h.getOptionalConfigArray("integrations.github"))!=null?F:[]);return m(S.map(W=>new fn(W)),W=>W.config.host)});function Xt($,h){return $.replace(/\/\/([^/]+)\/([^/]+)\/([^/]+)\/(blob|tree|edit)\//,(S,F,W,pe)=>`//${F}/${W}/${pe}/${h}/`)}const un="gitlab.com",dn="https://gitlab.com/api/v4";function xt($){const h=$.getString("host");let S=$.getOptionalString("apiBaseUrl");const F=$.getOptionalString("token");let W=$.getOptionalString("baseUrl");if(S?S=(0,l.trimEnd)(S,"/"):h===un&&(S=dn),W?W=(0,l.trimEnd)(W,"/"):W=`https://${h}`,u(h)){if(!S||!A(S))throw new Error(`Invalid GitLab integration config, '${S}' is not a valid apiBaseUrl`);if(!A(W))throw new Error(`Invalid GitLab integration config, '${W}' is not a valid baseUrl`)}else throw new Error(`Invalid GitLab integration config, '${h}' is not a valid host`);return{host:h,token:F,apiBaseUrl:S,baseUrl:W}}function qt($){const h=$.map(xt);return h.some(S=>S.host===un)||h.push({host:un,apiBaseUrl:dn,baseUrl:`https://${un}`}),h}var x=e(10179);async function re($,h){if($.includes("/-/blob/")){const S=await Je($,h);return Le($,S).toString()}return Te($).toString()}function Ee($){const{token:h=""}=$;return{headers:{"PRIVATE-TOKEN":h}}}function Te($){try{const h=new URL($),S=h.pathname.split("/").filter(Boolean),F=S.indexOf("blob",2);if(F<2||F===S.length-1)throw new InputError("Wrong GitLab URL");const W=S.slice(0,F),pe=S.slice(F+1);if(!pe.join("/").match(/\.(yaml|yml)$/))throw new InputError("Wrong GitLab URL");return h.pathname=[...W,"raw",...pe].join("/"),h}catch(h){throw new InputError(`Incorrect url: ${$}, ${h}`)}}function Le($,h){try{const S=new URL($),F=S.pathname.split("/-/blob/")[1],[W,...pe]=F.split("/");return S.pathname=["/api/v4/projects",h,"repository/files",encodeURIComponent(decodeURIComponent(pe.join("/"))),"raw"].join("/"),S.search=`?ref=${W}`,S}catch(S){throw new Error(`Incorrect url: ${$}, ${S}`)}}async function Je($,h){const S=new URL($);if(!S.pathname.includes("/-/blob/"))throw new Error("Please provide full path to yaml file from GitLab");try{const F=S.pathname.split("/-/blob/")[0],W=new URL(`${S.origin}/api/v4/projects/${encodeURIComponent(F.replace(/^\//,""))}`),pe=await fetch(W.toString(),Ee(h)),he=await pe.json();if(!pe.ok)throw new Error(`GitLab Error '${he.error}', ${he.error_description}`);return Number(he.id)}catch(F){throw new Error(`Could not get GitLab project ID for: ${$}, ${F}`)}}const Wn=class{constructor(h){this.integrationConfig=h}get type(){return"gitlab"}get title(){return this.integrationConfig.host}get config(){return this.integrationConfig}resolveUrl(h){return o(h)}resolveEditUrl(h){return Kt(h,"edit")}};let it=Wn;q(it,"factory",({config:h})=>{var F;const S=qt((F=h.getOptionalConfigArray("integrations.gitlab"))!=null?F:[]);return m(S.map(W=>new Wn(W)),W=>W.config.host)});function Kt($,h){return $.replace(/\/\-\/(blob|tree|edit)\//,`/-/${h}/`)}class Ht{constructor(h){q(this,"byType");this.byType=h}static fromConfig(h){return new Ht({awsS3:p.factory({config:h}),azure:M.factory({config:h}),bitbucket:ge.factory({config:h}),bitbucketCloud:de.factory({config:h}),bitbucketServer:me.factory({config:h}),gerrit:Tt.factory({config:h}),github:Wt.factory({config:h}),gitlab:it.factory({config:h})})}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}list(){return Object.values(this.byType).flatMap(h=>h.list())}byUrl(h){return Object.values(this.byType).map(S=>S.byUrl(h)).find(Boolean)}byHost(h){return Object.values(this.byType).map(S=>S.byHost(h)).find(Boolean)}resolveUrl(h){const S=this.byUrl(h.base);return S?S.resolveUrl(h):o(h)}resolveEditUrl(h){const S=this.byUrl(h);return S?S.resolveEditUrl(h):h}}},46054:function(ee,s,e){"use strict";var r={};e.r(r),e.d(r,{TechDocsPlugin:function(){return A.plugin}});var t=e(2784),l=e(47093),u=e(10289),A=e(82250),m=e(26136),o=e(49208),c=e(36964),f=e(68099);const y=[(0,c.createApiFactory)({api:c.discoveryApiRef,deps:{configApi:c.configApiRef},factory:({configApi:P})=>o.UrlPatternDiscovery.compile(`${P.getString("backend.baseUrl")}/api/{{ pluginId }}`)}),(0,c.createApiFactory)({api:c.alertApiRef,deps:{},factory:()=>new o.AlertApiForwarder}),(0,c.createApiFactory)({api:c.analyticsApiRef,deps:{},factory:()=>new o.NoOpAnalyticsApi}),(0,c.createApiFactory)({api:c.errorApiRef,deps:{alertApi:c.alertApiRef},factory:({alertApi:P})=>{const J=new o.ErrorAlerter(P,new o.ErrorApiForwarder);return o.UnhandledErrorForwarder.forward(J,{hidden:!1}),J}}),(0,c.createApiFactory)({api:c.storageApiRef,deps:{errorApi:c.errorApiRef},factory:({errorApi:P})=>o.WebStorage.create({errorApi:P})}),(0,c.createApiFactory)({api:c.fetchApiRef,deps:{configApi:c.configApiRef,identityApi:c.identityApiRef,discoveryApi:c.discoveryApiRef},factory:({configApi:P,identityApi:J,discoveryApi:fe})=>(0,o.createFetchApi)({middleware:[o.FetchMiddlewares.resolvePluginProtocol({discoveryApi:fe}),o.FetchMiddlewares.injectIdentityAuth({identityApi:J,config:P})]})}),(0,c.createApiFactory)({api:c.oauthRequestApiRef,deps:{},factory:()=>new o.OAuthRequestManager}),(0,c.createApiFactory)({api:c.googleAuthApiRef,deps:{discoveryApi:c.discoveryApiRef,oauthRequestApi:c.oauthRequestApiRef,configApi:c.configApiRef},factory:({discoveryApi:P,oauthRequestApi:J,configApi:fe})=>o.GoogleAuth.create({discoveryApi:P,oauthRequestApi:J,environment:fe.getOptionalString("auth.environment")})}),(0,c.createApiFactory)({api:c.microsoftAuthApiRef,deps:{discoveryApi:c.discoveryApiRef,oauthRequestApi:c.oauthRequestApiRef,configApi:c.configApiRef},factory:({discoveryApi:P,oauthRequestApi:J,configApi:fe})=>o.MicrosoftAuth.create({discoveryApi:P,oauthRequestApi:J,environment:fe.getOptionalString("auth.environment")})}),(0,c.createApiFactory)({api:c.githubAuthApiRef,deps:{discoveryApi:c.discoveryApiRef,oauthRequestApi:c.oauthRequestApiRef,configApi:c.configApiRef},factory:({discoveryApi:P,oauthRequestApi:J,configApi:fe})=>o.GithubAuth.create({discoveryApi:P,oauthRequestApi:J,defaultScopes:["read:user"],environment:fe.getOptionalString("auth.environment")})}),(0,c.createApiFactory)({api:c.oktaAuthApiRef,deps:{discoveryApi:c.discoveryApiRef,oauthRequestApi:c.oauthRequestApiRef,configApi:c.configApiRef},factory:({discoveryApi:P,oauthRequestApi:J,configApi:fe})=>o.OktaAuth.create({discoveryApi:P,oauthRequestApi:J,environment:fe.getOptionalString("auth.environment")})}),(0,c.createApiFactory)({api:c.gitlabAuthApiRef,deps:{discoveryApi:c.discoveryApiRef,oauthRequestApi:c.oauthRequestApiRef,configApi:c.configApiRef},factory:({discoveryApi:P,oauthRequestApi:J,configApi:fe})=>o.GitlabAuth.create({discoveryApi:P,oauthRequestApi:J,environment:fe.getOptionalString("auth.environment")})}),(0,c.createApiFactory)({api:c.oneloginAuthApiRef,deps:{discoveryApi:c.discoveryApiRef,oauthRequestApi:c.oauthRequestApiRef,configApi:c.configApiRef},factory:({discoveryApi:P,oauthRequestApi:J,configApi:fe})=>o.OneLoginAuth.create({discoveryApi:P,oauthRequestApi:J,environment:fe.getOptionalString("auth.environment")})}),(0,c.createApiFactory)({api:c.bitbucketAuthApiRef,deps:{discoveryApi:c.discoveryApiRef,oauthRequestApi:c.oauthRequestApiRef,configApi:c.configApiRef},factory:({discoveryApi:P,oauthRequestApi:J,configApi:fe})=>o.BitbucketAuth.create({discoveryApi:P,oauthRequestApi:J,defaultScopes:["team"],environment:fe.getOptionalString("auth.environment")})}),(0,c.createApiFactory)({api:c.atlassianAuthApiRef,deps:{discoveryApi:c.discoveryApiRef,oauthRequestApi:c.oauthRequestApiRef,configApi:c.configApiRef},factory:({discoveryApi:P,oauthRequestApi:J,configApi:fe})=>o.AtlassianAuth.create({discoveryApi:P,oauthRequestApi:J,environment:fe.getOptionalString("auth.environment")})}),(0,c.createApiFactory)({api:f.RV,deps:{discovery:c.discoveryApiRef,identity:c.identityApiRef,config:c.configApiRef},factory:({config:P,discovery:J,identity:fe})=>f.iM.create({config:P,discovery:J,identity:fe})})];var p=e(77277),E=e(82339),T=e(62833);function I({children:P}){return(0,u.GV)()?t.createElement(t.Fragment,null,P):t.createElement(u.VA,null,P)}const B=()=>t.createElement(E.ErrorPage,{status:"404",statusMessage:"PAGE NOT FOUND"}),j=({step:P,error:J})=>{let fe="";return P==="load-config"?fe=`The configuration failed to load, someone should have a look at this error: ${J.message}`:P==="load-chunk"&&(fe=`Lazy loaded chunk failed to load, try to reload the page: ${J.message}`),t.createElement(I,null,t.createElement(E.ErrorPage,{status:"501",statusMessage:fe}))},M=({error:P,resetError:J,plugin:fe})=>t.createElement(E.ErrorPanel,{title:`Error in ${fe==null?void 0:fe.getId()}`,defaultExpanded:!0,error:P},t.createElement(p.Z,{variant:"outlined",onClick:J},"Retry")),b={Progress:E.Progress,Router:T.VK,NotFoundErrorPage:B,BootErrorPage:j,ErrorBoundaryFallback:M};var L=e(43642),D=e(80079),U=e(90941),Y=e(32915),te=e(40562),ue=e(21853),Re=e(60744),we=e(66569),ge=e(30254),ze=e(13384),_e=e(15933),et=e(58838),st=e(86737),Ct=e(4989),pt=e(44407),Pe=e(18628),ht=e(84219),je=e(98685),ie=e(39781);const de={brokenImage:D.Z,catalog:Pe.Z,scaffolder:Y.Z,techdocs:te.Z,search:ue.Z,chat:Re.Z,dashboard:we.Z,docs:ge.Z,email:ze.Z,github:et.Z,group:ht.Z,help:st.Z,"kind:api":_e.Z,"kind:component":pt.Z,"kind:domain":L.Z,"kind:group":ht.Z,"kind:location":Ct.Z,"kind:system":U.Z,"kind:user":je.Z,user:je.Z,warning:ie.Z};var Ue=e(73689),Be=e(48032);const Xe={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")`},mt={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"]};function Ye(P,J){const De=`linear-gradient(90deg, ${(P.length===1?[P[0],P[0]]:P).join(", ")})`,Qe=`${J}, ${De}`;return{colors:P,shape:J,backgroundImage:Qe}}const yt={home:Ye(mt.teal,Xe.wave),documentation:Ye(mt.pinkSea,Xe.wave2),tool:Ye(mt.purpleSky,Xe.round),service:Ye(mt.marineBlue,Xe.wave),website:Ye(mt.veryBlue,Xe.wave),library:Ye(mt.rubyRed,Xe.wave),other:Ye(mt.darkGrey,Xe.wave),app:Ye(mt.toastyOrange,Xe.wave),apis:Ye(mt.teal,Xe.wave2)},oe='"Helvetica Neue", Helvetica, Roboto, Arial, sans-serif';function me(P){const{palette:J,fontFamily:fe=oe,defaultPageTheme:De,pageTheme:Qe=yt}=P;if(!Qe[De])throw new Error(`${De} is not defined in pageTheme.`);return{palette:J,props:{MuiGrid:{spacing:2},MuiSwitch:{color:"primary"}},typography:{fontFamily:fe,h5:{fontWeight:700},h4:{fontWeight:700,fontSize:28,marginBottom:6},h3:{fontSize:32,fontWeight:700,marginBottom:6},h2:{fontSize:40,fontWeight:700,marginBottom:8},h1:{fontSize:54,fontWeight:700,marginBottom:10}},page:Qe[De],getPageTheme:({themeId:At})=>{var St;return(St=Qe[At])!=null?St:Qe[De]}}}function tt(P){return{MuiCssBaseline:{"@global":{html:{height:"100%",fontFamily:P.typography.fontFamily},body:{height:"100%",fontFamily:P.typography.fontFamily,"overscroll-behavior-y":"none"},a:{color:"inherit",textDecoration:"none"}}},MuiTableRow:{root:{"&:nth-of-type(odd)":{backgroundColor:P.palette.background.default}},hover:{"&:hover":{cursor:"pointer"}},head:{"&:nth-of-type(odd)":{backgroundColor:P.palette.background.paper}}},MuiTableCell:{root:{wordBreak:"break-word",overflow:"hidden",verticalAlign:"middle",lineHeight:"1",margin:0,padding:P.spacing(3,2,3,2.5),borderBottom:0},sizeSmall:{padding:P.spacing(1.5,2,1.5,2.5)},head:{wordBreak:"break-word",overflow:"hidden",color:"rgb(179, 179, 179)",fontWeight:"normal",lineHeight:"1"}},MuiTabs:{root:{minHeight:24}},MuiTab:{root:{color:P.palette.link,minHeight:24,textTransform:"initial",letterSpacing:"0.07em","&:hover":{color:(0,Be.darken)(P.palette.link,.3),background:(0,Be.lighten)(P.palette.link,.95)},[P.breakpoints.up("md")]:{minWidth:120,fontSize:P.typography.pxToRem(14),fontWeight:500}},textColorPrimary:{color:P.palette.link}},MuiTableSortLabel:{root:{color:"inherit","&:hover":{color:"inherit"},"&:focus":{color:"inherit"}},active:{fontWeight:"bold",color:"inherit"}},MuiListItemText:{dense:{whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"}},MuiButton:{text:{padding:void 0}},MuiChip:{root:{backgroundColor:"#D9D9D9",marginRight:P.spacing(1),marginBottom:P.spacing(1),color:P.palette.grey[900]},outlined:{color:P.palette.text.primary},label:{lineHeight:`${P.spacing(2.5)}px`,fontWeight:P.typography.fontWeightMedium,fontSize:`${P.spacing(1.75)}px`},labelSmall:{fontSize:`${P.spacing(1.5)}px`},deleteIcon:{color:P.palette.grey[500],width:`${P.spacing(3)}px`,height:`${P.spacing(3)}px`,margin:`0 ${P.spacing(.75)}px 0 -${P.spacing(.75)}px`},deleteIconSmall:{width:`${P.spacing(2)}px`,height:`${P.spacing(2)}px`,margin:`0 ${P.spacing(.5)}px 0 -${P.spacing(.5)}px`}},MuiCard:{root:{display:"flex",flexDirection:"column"}},MuiCardHeader:{root:{paddingBottom:0}},MuiCardContent:{root:{flexGrow:1,"&:last-child":{paddingBottom:void 0}}},MuiCardActions:{root:{justifyContent:"flex-end"}}}}function Ge(P){const J=me(P),fe=(0,Ue.Z)(J),De=tt(fe);return{...fe,overrides:De}}var Ne=e(34505);const ct=Ge({palette:{type:"light",background:{default:"#F8F8F8"},status:{ok:"#1DB954",warning:"#FF9800",error:"#E22134",running:"#2E77D0",pending:"#FFED51",aborted:"#757575"},bursts:{fontColor:"#FEFEFE",slackChannelText:"#ddd",backgroundColor:{default:"#7C3699"},gradient:{linear:"linear-gradient(-137deg, #4BB8A5 0%, #187656 100%)"}},primary:{main:"#2E77D0"},banner:{info:"#2E77D0",error:"#E22134",text:"#FFFFFF",link:"#000000",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:Ne.Z.A700,navigation:{background:"#171717",indicator:"#9BF0E1",color:"#b5b5b5",selectedColor:"#FFF",navItem:{hoverBackground:"#404040"},submenu:{background:"#404040"}},pinSidebarButton:{icon:"#181818",background:"#BDBDBD"},tabbar:{indicator:"#9BF0E1"}},defaultPageTheme:"home",pageTheme:yt}),Q=Ge({palette:{type:"dark",background:{default:"#333333"},status:{ok:"#71CF88",warning:"#FFB84D",error:"#F84C55",running:"#3488E3",pending:"#FEF071",aborted:"#9E9E9E"},bursts:{fontColor:"#FEFEFE",slackChannelText:"#ddd",backgroundColor:{default:"#7C3699"},gradient:{linear:"linear-gradient(-137deg, #4BB8A5 0%, #187656 100%)"}},primary:{main:"#9CC9FF",dark:"#82BAFD"},secondary:{main:"#FF88B2"},banner:{info:"#2E77D0",error:"#E22134",text:"#FFFFFF",link:"#000000",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:Ne.Z.A700,navigation:{background:"#424242",indicator:"#9BF0E1",color:"#b5b5b5",selectedColor:"#FFF",navItem:{hoverBackground:"#404040"},submenu:{background:"#404040"}},pinSidebarButton:{icon:"#404040",background:"#BDBDBD"},tabbar:{indicator:"#9BF0E1"}},defaultPageTheme:"home",pageTheme:yt});var Z=e(98192),X=e(15222),se=e(41547),le=e(87561);const be=[{id:"light",title:"Light Theme",variant:"light",icon:t.createElement(X.Z,null),Provider:({children:P})=>t.createElement(se.Z,{theme:ct},t.createElement(le.ZP,null,P))},{id:"dark",title:"Dark Theme",variant:"dark",icon:t.createElement(Z.Z,null),Provider:({children:P})=>t.createElement(se.Z,{theme:Q},t.createElement(le.ZP,null,P))}];function Oe(P){var J,fe,De;return(0,o.createSpecializedApp)({...P,apis:(J=P==null?void 0:P.apis)!=null?J:[],bindRoutes:P==null?void 0:P.bindRoutes,components:{...b,...P==null?void 0:P.components},configLoader:P==null?void 0:P.configLoader,defaultApis:y,icons:{...de,...P==null?void 0:P.icons},plugins:(fe=P==null?void 0:P.plugins)!=null?fe:[],themes:(De=P==null?void 0:P.themes)!=null?De:be})}var Ae=e(82394),Ke=e.n(Ae),ke=e(48023),Et=e(76635);async function It({storageApi:P}){var At;const J=P.forBucket("settings"),fe=P.forBucket("starredEntities"),De=J.snapshot("starredEntities").value;if(!(0,Et.isArray)(De))return;const Qe=new Set((At=fe.snapshot("entityRefs").value)!=null?At:[]);De.filter(Et.isString).map(St=>St.split(":")).filter(St=>St.length===4&&St[0]==="entity").map(([St,R,C,w])=>(0,ke.eE)({kind:R,namespace:C,name:w})).forEach(St=>Qe.add(St)),await fe.set("entityRefs",Array.from(Qe)),await J.remove("starredEntities")}class lt{constructor(J){q(this,"settingsStore");q(this,"starredEntities");q(this,"subscribers",new Set);q(this,"observable",new(Ke())(J=>(J.next(new Set(this.starredEntities)),this.subscribers.add(J),()=>{this.subscribers.delete(J)})));var fe;It(J).then(),this.settingsStore=J.storageApi.forBucket("starredEntities"),this.starredEntities=new Set((fe=this.settingsStore.snapshot("entityRefs").value)!=null?fe:[]),this.settingsStore.observe$("entityRefs").subscribe({next:De=>{var Qe;this.starredEntities=new Set((Qe=De.value)!=null?Qe:[]),this.notifyChanges()}})}async toggleStarred(J){this.starredEntities.has(J)?this.starredEntities.delete(J):this.starredEntities.add(J),await this.settingsStore.set("entityRefs",Array.from(this.starredEntities))}starredEntitie$(){return this.observable}notifyChanges(){for(const J of this.subscribers)J.next(new Set(this.starredEntities))}}var Tt=e(39398),Lt=e(49782),Rt=e(79692),Nt=e(74450);const Zt=(0,Rt.Z)({flexContainer:{flexWrap:"wrap"},itemText:{width:"100%",wordBreak:"break-all",marginBottom:"1rem"}});function vt(P){var At,St;const J=P.result,fe=Zt(),De=useAnalytics(),Qe=()=>{De.captureEvent("discover",J.title,{attributes:{to:J.location},value:P.rank})};return React.createElement(Link,{noTrack:!0,to:J.location,onClick:Qe},React.createElement(ListItem,{alignItems:"flex-start"},P.icon&&React.createElement(ListItemIcon,null,P.icon),React.createElement("div",{className:fe.flexContainer},React.createElement(ListItemText,{className:fe.itemText,primaryTypographyProps:{variant:"h6"},primary:(At=P.highlight)!=null&&At.fields.title?React.createElement(HighlightedSearchResultText,{text:P.highlight.fields.title,preTag:P.highlight.preTag,postTag:P.highlight.postTag}):J.title,secondary:(St=P.highlight)!=null&&St.fields.text?React.createElement(HighlightedSearchResultText,{text:P.highlight.fields.text,preTag:P.highlight.preTag,postTag:P.highlight.postTag}):J.text}),React.createElement(Box,null,J.kind&&React.createElement(Chip,{label:`Kind: ${J.kind}`,size:"small"}),J.lifecycle&&React.createElement(Chip,{label:`Lifecycle: ${J.lifecycle}`,size:"small"})))),React.createElement(Divider,{component:"li"}))}var at=e(30097),zt=e(53479),ae=e(95544),V=e(99688),ye=e(12231),We=e(86136),qe=e(49378),ot=e(85256),bt=e(61837),Wt=e(79784),Xt=e(50758),un=e(49166),dn=e(31654),xt=e(43054),qt=e(40749);const x="catalog-entity",re=(0,qt.J$)({name:"catalog.entity.read",attributes:{action:"read"},resourceType:x}),Ee=(0,qt.J$)({name:"catalog.entity.create",attributes:{action:"create"}}),Te=(0,qt.J$)({name:"catalog.entity.delete",attributes:{action:"delete"},resourceType:x}),Le=(0,qt.J$)({name:"catalog.entity.refresh",attributes:{action:"update"},resourceType:x}),Je=(0,qt.J$)({name:"catalog.location.read",attributes:{action:"read"}}),it=(0,qt.J$)({name:"catalog.location.create",attributes:{action:"create"}}),Kt=(0,qt.J$)({name:"catalog.location.delete",attributes:{action:"delete"}}),Ht=(0,Rt.Z)({button:{color:"white"}});function Dt(P){var ce;const{UNSTABLE_extraContextMenuItems:J,UNSTABLE_contextMenuOptions:fe,onUnregisterEntity:De,onInspectEntity:Qe}=P,[At,St]=(0,t.useState)(),R=Ht(),C=(0,zt.useEntityPermission)(Te),w=Se=>{St(Se.currentTarget)},z=()=>{St(void 0)},k=J&&[...J.map(Se=>t.createElement(ye.Z,{key:Se.title,onClick:()=>{z(),Se.onClick()}},t.createElement(We.Z,null,t.createElement(Se.Icon,{fontSize:"small"})),t.createElement(qe.Z,{primary:Se.title}))),t.createElement(ot.Z,{key:"the divider is here!"})],K=(ce=!C.allowed||(fe==null?void 0:fe.disableUnregister))!=null?ce:!1;return t.createElement(t.Fragment,null,t.createElement(bt.Z,{"aria-label":"more","aria-controls":"long-menu","aria-haspopup":"true","aria-expanded":!!At,role:"button",onClick:w,"data-testid":"menu-button",className:R.button,id:"long-menu"},t.createElement(xt.Z,null)),t.createElement(Wt.ZP,{open:Boolean(At),onClose:z,anchorEl:At,anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"},"aria-labelledby":"long-menu"},t.createElement(Xt.Z,null,k,t.createElement(ye.Z,{onClick:()=>{z(),De()},disabled:K},t.createElement(We.Z,null,t.createElement(un.Z,{fontSize:"small"})),t.createElement(qe.Z,{primary:"Unregister entity"})),t.createElement(ye.Z,{onClick:()=>{z(),Qe()}},t.createElement(We.Z,null,t.createElement(dn.Z,{fontSize:"small"})),t.createElement(qe.Z,{primary:"Inspect entity"})))))}const Ft="plugin.catalog.entityLayoutRoute",ut=()=>null;(0,c.attachComponentData)(ut,Ft,!0),(0,c.attachComponentData)(ut,"core.gatherMountPoints",!0);function kt(P){const{entity:J,title:fe}=P;return t.createElement(ae.Z,{display:"inline-flex",alignItems:"center",height:"1em",maxWidth:"100%"},t.createElement(ae.Z,{component:"span",textOverflow:"ellipsis",whiteSpace:"nowrap",overflow:"hidden"},fe),J&&t.createElement(zt.FavoriteEntity,{entity:J}))}function tn(P,J,fe,De){var R,C,w,z,k;const Qe=(R=P!=null?P:De==null?void 0:De.kind)!=null?R:"",At=(C=J!=null?J:De==null?void 0:De.metadata.namespace)!=null?C:"";return{headerTitle:`${(k=(z=(w=De==null?void 0:De.metadata.title)!=null?w:fe)!=null?z:De==null?void 0:De.metadata.name)!=null?k:""}${At&&At!==ke.zG?` in ${At}`:""}`,headerType:(()=>{let K=Qe.toLocaleLowerCase("en-US");return De&&De.spec&&"type"in De.spec&&(K+=" \u2014 ",K+=De.spec.type.toLocaleLowerCase("en-US")),K})()}}function jt(P){var De;const{entity:J}=P,fe=(0,zt.getEntityRelations)(J,ke.S4);return t.createElement(t.Fragment,null,fe.length>0&&t.createElement(E.HeaderLabel,{label:"Owner",value:t.createElement(zt.EntityRefLinks,{entityRefs:fe,defaultKind:"Group",color:"inherit"})}),((De=J.spec)==null?void 0:De.lifecycle)&&t.createElement(E.HeaderLabel,{label:"Lifecycle",value:J.spec.lifecycle}))}const Vt=P=>{var nt,He,Bt;const{UNSTABLE_extraContextMenuItems:J,UNSTABLE_contextMenuOptions:fe,children:De,NotFoundComponent:Qe}=P,{kind:At,namespace:St,name:R}=(0,c.useRouteRefParams)(zt.entityRouteRef),{entity:C,loading:w,error:z}=(0,zt.useAsyncEntity)(),k=(0,u.TH)(),K=(0,c.useElementFilter)(De,_t=>_t.selectByComponentData({key:Ft,withStrictError:"Child of EntityLayout must be an EntityLayout.Route"}).getElements().flatMap(({props:En})=>{if(C){if(En.if&&!En.if(C))return[]}else return[];return[{path:En.path,title:En.title,children:En.children,tabProps:En.tabProps}]}),[C]),{headerTitle:ce,headerType:Se}=tn(At,St,R,C),[Ze,xe]=(0,t.useState)(!1),[Fe,$e]=(0,t.useState)(!1),Ve=(0,u.s0)(),Ot=async()=>{xe(!1),$e(!1),Ve("/")};return(0,t.useEffect)(()=>{xe(!1),$e(!1)},[k.pathname]),t.createElement(E.Page,{themeId:(Bt=(He=(nt=C==null?void 0:C.spec)==null?void 0:nt.type)==null?void 0:He.toString())!=null?Bt:"home"},t.createElement(E.Header,{title:t.createElement(kt,{title:ce,entity:C}),pageTitleOverride:ce,type:Se},C&&t.createElement(t.Fragment,null,t.createElement(jt,{entity:C}),t.createElement(Dt,{UNSTABLE_extraContextMenuItems:J,UNSTABLE_contextMenuOptions:fe,onUnregisterEntity:()=>xe(!0),onInspectEntity:()=>$e(!0)}))),w&&t.createElement(E.Progress,null),C&&t.createElement(E.RoutedTabs,{routes:K}),z&&t.createElement(E.Content,null,t.createElement(V.Z,{severity:"error"},z.toString())),!w&&!z&&!C&&t.createElement(E.Content,null,Qe||t.createElement(E.WarningPanel,{title:"Entity not found"},"There is no ",At," with the requested"," ",t.createElement(E.Link,{to:"https://backstage.io/docs/features/software-catalog/references"},"kind, namespace, and name"),".")),t.createElement(zt.UnregisterEntityDialog,{open:Ze,entity:C,onConfirm:Ot,onClose:()=>xe(!1)}),t.createElement(zt.InspectEntityDialog,{open:Fe,entity:C,onClose:()=>$e(!1)}))};Vt.Route=ut;var cn=e(10179);function Tn(P){const{open:J,onClose:fe,onConfirm:De,entity:Qe}=P,[At,St]=useState(!1),R=useApi(catalogApiRef),C=useApi(alertApiRef),w=async()=>{St(!0);try{const z=Qe.metadata.uid;await R.removeEntityByUid(z),De()}catch(z){assertError(z),C.post({message:z.message})}finally{St(!1)}};return React.createElement(Dialog,{open:J,onClose:fe},React.createElement(DialogTitle,{id:"responsive-dialog-title"},"Are you sure you want to delete this entity?"),React.createElement(DialogActions,null,React.createElement(Button,{variant:"contained",color:"secondary",disabled:At,onClick:w},"Delete"),React.createElement(Button,{onClick:fe,color:"primary"},"Cancel")))}var wt=e(47851);function $t(P){var J,fe;return((fe=(J=P==null?void 0:P.metadata)==null?void 0:J.annotations)==null?void 0:fe["backstage.io/orphan"])==="true"}function hn(){const P=useNavigate(),J=useRouteRef(rootRouteRef),[fe,De]=useState(!1),{entity:Qe}=useEntity(),At=async()=>{De(!1),P(J())};return React.createElement(React.Fragment,null,React.createElement(Alert,{severity:"warning",onClick:()=>De(!0)},"This entity is not referenced by any location and is therefore not receiving updates. Click here to delete."),React.createElement(DeleteEntityDialog,{open:fe,entity:Qe,onConfirm:At,onClose:()=>De(!1)}))}var yn=e(30001);const an=P=>P.error&&P.level==="error"&&P.type===ENTITY_STATUS_CATALOG_PROCESSING_TYPE;async function fn(P,J){return{items:(await J.getEntityAncestors({entityRef:P})).items.map(Qe=>{var R,C;return{errors:((C=(R=Qe.entity.status)==null?void 0:R.items)!=null?C:[]).filter(an).map(w=>w.error).filter(w=>Boolean(w)),entity:Qe.entity}}).filter(Qe=>Qe.errors.length>0)}}async function Wn(P,J){const fe=J.apis.get(catalogApiRef);if(!fe)throw new Error(`No implementation available for ${catalogApiRef}`);return(await fn(stringifyEntityRef(P),fe)).items.length>0}function $(){const{entity:P}=useEntity(),J=stringifyEntityRef(P),fe=useApi(catalogApiRef),{loading:De,error:Qe,value:At}=useAsync(async()=>fn(J,fe),[J,fe]);return Qe?React.createElement(Box,{mb:1},React.createElement(ResponseErrorPanel,{error:Qe})):De||!At?null:React.createElement(React.Fragment,null,At.items.map((St,R)=>React.createElement(Box,{key:R,mb:1},stringifyEntityRef(P)!==stringifyEntityRef(St.entity)&&React.createElement(Box,{p:1},"The error below originates from"," ",React.createElement(EntityRefLink,{entityRef:St.entity})),St.errors.map((C,w)=>React.createElement(ResponseErrorPanel,{key:w,error:C})))))}var h=e(64279);const S="core.backstage.entitySwitch",F=P=>null;(0,c.attachComponentData)(F,S,!0);const W=P=>{var St,R;const{entity:J,loading:fe}=(0,zt.useAsyncEntity)(),De=(0,c.useApiHolder)(),Qe=(0,c.useElementFilter)(P.children,C=>C.selectByComponentData({key:S,withStrictError:"Child of EntitySwitch is not an EntitySwitch.Case"}).getElements().flatMap(w=>{var K;if(fe)return[];const{if:z,children:k}=w.props;return J?[{if:(K=z==null?void 0:z(J,{apis:De}))!=null?K:!0,children:k}]:[{if:z===void 0,children:k}]}),[De,J,fe]);return Qe.some(C=>typeof C.if=="object"&&"then"in C.if)?t.createElement(pe,{results:Qe}):(R=(St=Qe.find(C=>C.if))==null?void 0:St.children)!=null?R:null};function pe({results:P}){const{loading:J,value:fe}=(0,h.default)(async()=>{var Qe;const De=P.map(async({if:At,children:St})=>{try{if(await At)return St}catch{}return null});return(Qe=(await Promise.all(De)).find(Boolean))!=null?Qe:null},[P]);return J||!fe?null:fe}W.Case=F;const he=null,Me=zt.CatalogFilterLayout.Filters,ft=zt.CatalogFilterLayout.Content,Pt=(0,c.createPlugin)({id:"catalog",apis:[(0,c.createApiFactory)({api:zt.catalogApiRef,deps:{discoveryApi:c.discoveryApiRef,fetchApi:c.fetchApiRef},factory:({discoveryApi:P,fetchApi:J})=>new yn.MS({discoveryApi:P,fetchApi:J})}),(0,c.createApiFactory)({api:zt.starredEntitiesApiRef,deps:{storageApi:c.storageApiRef},factory:({storageApi:P})=>new lt({storageApi:P})})],routes:{catalogIndex:wt._Z,catalogEntity:zt.entityRouteRef},externalRoutes:{createComponent:wt.yw,viewTechDoc:wt.jU}}),bn=Pt.provide((0,c.createRoutableExtension)({name:"CatalogIndexPage",component:()=>e.e(7758).then(e.bind(e,7758)).then(P=>P.CatalogPage),mountPoint:wt._Z})),vn=Pt.provide((0,c.createRoutableExtension)({name:"CatalogEntityPage",component:()=>e.e(6583).then(e.bind(e,96583)).then(P=>P.CatalogEntityPage),mountPoint:zt.entityRouteRef})),Ur=Pt.provide((0,c.createComponentExtension)({name:"EntityAboutCard",component:{lazy:()=>Promise.resolve().then(e.bind(e,39398)).then(P=>P.AboutCard)}})),or=Pt.provide((0,c.createComponentExtension)({name:"EntityLinksCard",component:{lazy:()=>e.e(1959).then(e.bind(e,81959)).then(P=>P.EntityLinksCard)}})),Nr=Pt.provide((0,c.createComponentExtension)({name:"EntityHasSystemsCard",component:{lazy:()=>e.e(390).then(e.bind(e,60390)).then(P=>P.HasSystemsCard)}})),Zr=Pt.provide((0,c.createComponentExtension)({name:"EntityHasComponentsCard",component:{lazy:()=>e.e(4022).then(e.bind(e,4022)).then(P=>P.HasComponentsCard)}})),Hn=Pt.provide((0,c.createComponentExtension)({name:"EntityHasSubcomponentsCard",component:{lazy:()=>e.e(8792).then(e.bind(e,38792)).then(P=>P.HasSubcomponentsCard)}})),$n=Pt.provide((0,c.createComponentExtension)({name:"EntityHasResourcesCard",component:{lazy:()=>e.e(1553).then(e.bind(e,11553)).then(P=>P.HasResourcesCard)}})),Jn=Pt.provide((0,c.createComponentExtension)({name:"EntityDependsOnComponentsCard",component:{lazy:()=>e.e(8061).then(e.bind(e,48061)).then(P=>P.DependsOnComponentsCard)}})),sr=Pt.provide((0,c.createComponentExtension)({name:"EntityDependencyOfComponentsCard",component:{lazy:()=>e.e(6235).then(e.bind(e,56235)).then(P=>P.DependencyOfComponentsCard)}})),Rr=Pt.provide((0,c.createComponentExtension)({name:"EntityDependsOnResourcesCard",component:{lazy:()=>e.e(9028).then(e.bind(e,59028)).then(P=>P.DependsOnResourcesCard)}})),zr=Pt.provide((0,c.createComponentExtension)({name:"RelatedEntitiesCard",component:{lazy:()=>e.e(2426).then(e.bind(e,62426)).then(P=>P.RelatedEntitiesCard)}}));var Qn=e(36356);class Sr{constructor({configApi:J,discoveryApi:fe,identityApi:De}){q(this,"configApi");q(this,"discoveryApi");q(this,"identityApi");this.configApi=J,this.discoveryApi=fe,this.identityApi=De}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(J,fe){const Qe=`${await this.getApiOrigin()}/${fe}`,At=await fetch(`${Qe.endsWith("/")?Qe:`${Qe}/`}index.html`);if(At.status===404)throw new Error("Page not found");return At.text()}async syncEntityDocs(J){return"cached"}async getBaseUrl(J,fe,De){const Qe=await this.getApiOrigin();return new URL(J,`${Qe}/${De}`).toString()}}class Wr{constructor({configApi:J,discoveryApi:fe,identityApi:De}){q(this,"configApi");q(this,"discoveryApi");q(this,"identityApi");this.configApi=J,this.discoveryApi=fe,this.identityApi=De}async getApiOrigin(){return await this.discoveryApi.getBaseUrl("techdocs")}async getEntityMetadata(J){return{apiVersion:"backstage.io/v1alpha1",kind:"Component",metadata:{name:"local"},spec:{owner:"test",lifecycle:"experimental"}}}async getTechDocsMetadata(J){return{site_name:"Live preview environment",site_description:""}}}const er=[(0,c.createApiFactory)({api:m.Dl,deps:{configApi:c.configApiRef,discoveryApi:c.discoveryApiRef,identityApi:c.identityApiRef},factory:({configApi:P,discoveryApi:J,identityApi:fe})=>new Sr({configApi:P,discoveryApi:J,identityApi:fe})}),(0,c.createApiFactory)({api:m.gT,deps:{configApi:c.configApiRef,discoveryApi:c.discoveryApiRef,identityApi:c.identityApiRef},factory:({configApi:P,discoveryApi:J,identityApi:fe})=>new Wr({configApi:P,discoveryApi:J,identityApi:fe})}),(0,c.createApiFactory)({api:Qn.q3,deps:{configApi:c.configApiRef},factory:({configApi:P})=>Qn.ae.fromConfig(P)})],Pn={backend:{baseUrl:"http://localhost:3000"},techdocs:{builder:"external"}},tr={backend:{baseUrl:"http://localhost:7007"},techdocs:{builder:"external"}};async function nr(){const P=await fetch("/.detect");return P.ok?(await P.text()).trim()==="techdocs-cli-server":!1}async function Cr(){const P=await(0,o.defaultConfigLoader)(),J=await nr();return[...P,{context:"detected",data:J?Pn:tr}]}var ir=e(86689),lr=e(58845);const Tr=(0,Rt.Z)({svg:{width:"auto",height:30},path:{fill:"#7df3e1"}});var rr=()=>{const P=Tr();return t.createElement("svg",{className:P.svg,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 2079.95 456.05"},t.createElement("path",{className:P.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 br=(0,Rt.Z)({svg:{width:"auto",height:28},path:{fill:"#7df3e1"}});var cr=()=>{const P=br();return t.createElement("svg",{className:P.svg,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 337.46 428.5"},t.createElement("path",{className:P.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 Pr=(0,Rt.Z)({root:{width:E.sidebarConfig.drawerWidthClosed,height:3*E.sidebarConfig.logoHeight,display:"flex",flexFlow:"row nowrap",alignItems:"center",marginBottom:-14},link:{width:E.sidebarConfig.drawerWidthClosed,marginLeft:24}}),ur=()=>{const P=Pr(),{isOpen:J}=(0,E.useSidebarOpenState)();return t.createElement("div",{className:P.root},t.createElement(ir.Z,{component:T.OL,to:"/docs/default/component/local/",underline:"none",className:P.link},J?t.createElement(rr,null):t.createElement(cr,null)))},Ir=({children:P})=>t.createElement(E.SidebarPage,null,t.createElement(E.Sidebar,null,t.createElement(ur,null),t.createElement(E.SidebarDivider,null),t.createElement(E.SidebarItem,{icon:lr.Z,to:"/docs/default/component/local",text:"Docs Preview"})),P);var dr=e(80030),mn=e(32388),Fn=e(4142);const Lr=(0,Rt.Z)(P=>({headerIcon:{color:P.palette.common.white,width:"32px",height:"32px"},content:{backgroundColor:P.palette.background.default},contentToolbar:{display:"flex",justifyContent:"flex-end",padding:0}}));var Bn;(function(P){const J="light";P.LIGHT=J;const fe="dark";P.DARK=fe})(Bn||(Bn={}));const fr=()=>{const P=(0,c.useApi)(c.appThemeApiRef),J=Lr(),[fe,De]=(0,t.useState)(P.getActiveThemeId()||Bn.LIGHT),Qe={[Bn.LIGHT]:{icon:Fn.Z,title:"Dark theme"},[Bn.DARK]:{icon:mn.Z,title:"Light theme"}},{title:At,icon:St}=Qe[fe],R=()=>{De(C=>{const w=C===Bn.LIGHT?Bn.DARK:Bn.LIGHT;return P.setActiveThemeId(w),w})};return t.createElement(ae.Z,{display:"flex",alignItems:"center",mr:2},t.createElement(dr.ZP,{title:At,arrow:!0},t.createElement(bt.Z,{size:"small",onClick:R},t.createElement(St,{className:J.headerIcon}))))},Vn=()=>t.createElement(A.TechDocsReaderPage,null,t.createElement(A.TechDocsReaderPageHeader,null),t.createElement(A.TechDocsReaderPageContent,{withSearch:!1})),Gn=t.createElement(Vn,null),mr=Oe({apis:er,configLoader:Cr,plugins:Object.values(r)}),Or=mr.getProvider(),hr=mr.getRouter(),Kn=A.techdocsPlugin.provide((0,m.KY)({name:"ThemeToggleAddon",component:fr,location:m.oZ.Header})),Vr=t.createElement(o.FlatRoutes,null,t.createElement(u.Fg,{key:"/",to:"/docs/default/component/local/"}),t.createElement(u.AW,{path:"/catalog/:namespace/:kind/:name",element:t.createElement(vn,null)}),t.createElement(u.AW,{path:"/docs",element:t.createElement(A.TechDocsIndexPage,null)},t.createElement(A.DefaultTechDocsHome,null)),t.createElement(u.AW,{path:"/docs/:namespace/:kind/:name/*",element:t.createElement(A.TechDocsReaderPage,null)},Gn,t.createElement(m.DR,null,t.createElement(Kn,null))));var gr=()=>t.createElement(Or,null,t.createElement(hr,null,t.createElement(Ir,null,Vr)));l.render(t.createElement(gr,null),document.getElementById("root"))},76241:function(ee,s,e){"use strict";e.d(s,{CT:function(){return m},EI:function(){return f},uW:function(){return u},Vt:function(){return o}});function r(){return typeof window!="undefined"&&window.Math===Math?window:typeof self!="undefined"&&self.Math===Math?self:Function("return this")()}const t=r(),l=y=>`__@backstage/${y}__`;function u(y,p){const E=l(y);let T=t[E];return T||(T=p(),t[E]=T,T)}var A=e(2784);function m(y){return u(y,()=>(0,A.createContext)(void 0))}function o(y){return(0,A.useContext)(m(y))}function c(y){return{set(p){globalThis[`__@backstage/${y}__`]=createContext(createVersionedValueMap(p))},reset(){delete globalThis[`__@backstage/${y}__`]}}}function f(y){return Object.freeze(y),{atVersion(p){return y[p]}}}},53479:function(ee,s,e){"use strict";e.d(s,{AsyncEntityProvider:function(){return U},CATALOG_FILTER_EXISTS:function(){return r.n3},CatalogFilterLayout:function(){return b},EntityKindFilter:function(){return X},EntityLifecyclePicker:function(){return xt},EntityListProvider:function(){return Ue},EntityOwnerPicker:function(){return Ee},EntityRefLink:function(){return Q},EntityRefLinks:function(){return Z},EntityTable:function(){return Dt},EntityTagPicker:function(){return tn},EntityTypePicker:function(){return cn},FavoriteEntity:function(){return an},InspectEntityDialog:function(){return mr},UnregisterEntityDialog:function(){return gr},UserListPicker:function(){return At},catalogApiRef:function(){return l},entityRouteRef:function(){return me},getEntityRelations:function(){return ht},getEntitySourceLocation:function(){return je},humanizeEntityRef:function(){return Ge},starredEntitiesApiRef:function(){return u},useAsyncEntity:function(){return ue},useEntity:function(){return te},useEntityList:function(){return Be},useEntityOwnership:function(){return Zt},useEntityPermission:function(){return at},useRelatedEntities:function(){return It},useStarredEntities:function(){return Lt}});var r=e(30001),t=e(36964);const l=(0,t.createApiRef)({id:"plugin.catalog.service"}),u=(0,t.createApiRef)({id:"catalog-react.starred-entities"});var A=e(82394);class m{constructor(){q(this,"starredEntities",new Set);q(this,"subscribers",new Set);q(this,"observable",new ObservableImpl(C=>(C.next(new Set(this.starredEntities)),this.subscribers.add(C),()=>{this.subscribers.delete(C)})))}async toggleStarred(C){this.starredEntities.delete(C)||this.starredEntities.add(C);for(const w of this.subscribers)w.next(new Set(this.starredEntities))}starredEntitie$(){return this.observable}}var o=e(2784),c=e(41156),f=e(60364),y=e(77277),p=e(4190),E=e(95544),T=e(90436),I=e(60905),B=e(36444);const j=R=>{const C=(0,c.Z)(K=>K.breakpoints.down("md")),w=(0,f.Z)(),[z,k]=(0,o.useState)(!1);return C?o.createElement(o.Fragment,null,o.createElement(y.Z,{style:{marginTop:w.spacing(1),marginLeft:w.spacing(1)},onClick:()=>k(!0),startIcon:o.createElement(B.Z,null)},"Filters"),o.createElement(p.ZP,{open:z,onClose:()=>k(!1),anchor:"left",disableAutoFocus:!0,keepMounted:!0,variant:"temporary"},o.createElement(E.Z,{m:2},o.createElement(T.Z,{variant:"h6",component:"h2",style:{marginBottom:w.spacing(1)}},"Filters"),R.children))):o.createElement(I.Z,{item:!0,lg:2},R.children)},M=R=>o.createElement(I.Z,{item:!0,xs:12,lg:10},R.children),b=R=>o.createElement(I.Z,{container:!0,style:{position:"relative"}},R.children);b.Filters=j,b.Content=M;var L=e(76241);const D=(0,L.CT)("entity-context"),U=({children:R,entity:C,loading:w,error:z,refresh:k})=>{const K={entity:C,loading:w,error:z,refresh:k};return o.createElement(D.Provider,{value:(0,L.EI)({1:K})},R)},Y=R=>React.createElement(U,{entity:R.entity,loading:!Boolean(R.entity),error:void 0,refresh:void 0,children:R.children});function te(){const R=(0,L.Vt)("entity-context");if(!R)throw new Error("Entity context is not available");const C=R.atVersion(1);if(!C)throw new Error("EntityContext v1 not available");if(!C.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:C.entity}}function ue(){const R=(0,L.Vt)("entity-context");if(!R)throw new Error("Entity context is not available");const C=R.atVersion(1);if(!C)throw new Error("EntityContext v1 not available");const{entity:w,loading:z,error:k,refresh:K}=C;return{entity:w,loading:z,error:k,refresh:K}}var Re=e(76635),we=e(19126),ge=e.n(we),ze=e(10289),_e=e(69294),et=e(48760),st=e(90736);function Ct(R){return R.reduce((C,w)=>({...C,...w.getCatalogFilters?w.getCatalogFilters():{}}),{})}function pt(R){return C=>R.every(w=>!w.filterEntity||w.filterEntity(C))}var Pe=e(48023);function ht(R,C,w){var k;let z=((k=R==null?void 0:R.relations)==null?void 0:k.filter(K=>K.type===C).map(K=>(0,Pe.of)(K.targetRef)))||[];return w!=null&&w.kind&&(z=z.filter(K=>K.kind.toLocaleLowerCase("en-US")===w.kind.toLocaleLowerCase("en-US"))),z}function je(R,C){var z;const w=(z=R.metadata.annotations)==null?void 0:z[Pe.M6];if(!!w)try{const k=(0,Pe.Ou)(w),K=C.byUrl(k.target);return{locationTargetUrl:k.target,integrationType:K==null?void 0:K.type}}catch{return}}function ie(R,C){const w=new Set([...getEntityRelations(R,RELATION_MEMBER_OF,{kind:"group"}),...R?[getCompoundEntityRef(R)]:[]].map(stringifyEntityRef)),z=getEntityRelations(C,RELATION_OWNED_BY).map(stringifyEntityRef);for(const k of z)if(w.has(k))return!0;return!1}const de=(0,o.createContext)(void 0),Ue=({children:R})=>{const C=(0,st.default)(),w=(0,t.useApi)(l),[z,k]=(0,o.useState)({}),K=(0,ze.TH)(),ce=(0,o.useMemo)(()=>{var nt;return(nt=ge().parse(K.search,{ignoreQueryPrefix:!0}).filters)!=null?nt:{}},[K]),[Se,Ze]=(0,o.useState)(()=>({appliedFilters:{},entities:[],backendEntities:[]})),[{loading:xe,error:Fe},$e]=(0,_e.default)(async()=>{var In;const nt=(0,Re.compact)(Object.values(z)),He=pt(nt),Bt=Ct(nt),_t=Ct((0,Re.compact)(Object.values(Se.appliedFilters))),En=Object.keys(z).reduce((gn,An)=>{const Ln=z[An];return Ln!=null&&Ln.toQueryValue&&(gn[An]=Ln.toQueryValue()),gn},{});if((0,Re.isEqual)(_t,Bt))Ze({appliedFilters:z,backendEntities:Se.backendEntities,entities:Se.backendEntities.filter(He)});else{const gn=await w.getEntities({filter:Bt});Ze({appliedFilters:z,backendEntities:gn.items,entities:gn.items.filter(He)})}if(C()){const gn=ge().parse(K.search,{ignoreQueryPrefix:!0}),An=ge().stringify({...gn,filters:En},{addQueryPrefix:!0,arrayFormat:"repeat"}),Ln=`${window.location.pathname}${An}`;(In=window.history)==null||In.replaceState(null,document.title,Ln)}},[w,ce,z,Se],{loading:!0});(0,et.Z)($e,10,[z]);const Ve=(0,o.useCallback)(nt=>{k(He=>{const Bt=typeof nt=="function"?nt(He):nt;return{...He,...Bt}})},[]),Ot=(0,o.useMemo)(()=>({filters:Se.appliedFilters,entities:Se.entities,backendEntities:Se.backendEntities,updateFilters:Ve,queryParameters:ce,loading:xe,error:Fe}),[Se,Ve,ce,xe,Fe]);return o.createElement(de.Provider,{value:Ot},R)};function Be(){const R=(0,o.useContext)(de);if(!R)throw new Error("useEntityList must be used within EntityListProvider");return R}var Xe=e(64279),mt=e(18149),Ye=e.n(mt),yt=e(829),oe=e.n(yt);const me=(0,L.uW)("catalog:entity-route-ref",()=>(0,t.createRouteRef)({id:"catalog:entity",params:["namespace","kind","name"]}));function tt(R){var C,w;return{kind:R.kind.toLocaleLowerCase("en-US"),namespace:(w=(C=R.metadata.namespace)==null?void 0:C.toLocaleLowerCase("en-US"))!=null?w:DEFAULT_NAMESPACE,name:R.metadata.name}}function Ge(R,C){const w=C==null?void 0:C.defaultKind;let z,k,K;return"metadata"in R?(z=R.kind,k=R.metadata.namespace,K=R.metadata.name):(z=R.kind,k=R.namespace,K=R.name),k===Pe.zG&&(k=void 0),z=z.toLocaleLowerCase("en-US"),z=w&&w.toLocaleLowerCase("en-US")===z?void 0:z,`${z?`${z}:`:""}${k?`${k}/`:""}${K}`}var Ne=e(82339),ct=e(80030);const Q=(0,o.forwardRef)((R,C)=>{var nt;const{entityRef:w,defaultKind:z,title:k,children:K,...ce}=R,Se=(0,t.useRouteRef)(me);let Ze,xe,Fe;if(typeof w=="string"){const He=(0,Pe.of)(w);Ze=He.kind,xe=He.namespace,Fe=He.name}else"metadata"in w?(Ze=w.kind,xe=w.metadata.namespace,Fe=w.metadata.name):(Ze=w.kind,xe=w.namespace,Fe=w.name);Ze=Ze.toLocaleLowerCase("en-US"),xe=(nt=xe==null?void 0:xe.toLocaleLowerCase("en-US"))!=null?nt:Pe.zG;const $e={kind:Ze,namespace:xe,name:Fe},Ve=Ge({kind:Ze,namespace:xe,name:Fe},{defaultKind:z}),Ot=o.createElement(Ne.Link,{...ce,ref:C,to:Se($e)},K,!K&&(k!=null?k:Ve));return k?o.createElement(ct.ZP,{title:Ve},Ot):Ot});function Z(R){const{entityRefs:C,defaultKind:w,...z}=R;return o.createElement(o.Fragment,null,C.map((k,K)=>o.createElement(o.Fragment,{key:K},K>0&&", ",o.createElement(Q,{...z,entityRef:k,defaultKind:w}))))}class X{constructor(C){this.value=C}getCatalogFilters(){return{kind:this.value}}toQueryValue(){return this.value}}class se{constructor(C){this.value=C}getTypes(){return Array.isArray(this.value)?this.value:[this.value]}getCatalogFilters(){return{"spec.type":this.getTypes()}}toQueryValue(){return this.getTypes()}}class le{constructor(C){this.values=C}filterEntity(C){return this.values.every(w=>{var z;return((z=C.metadata.tags)!=null?z:[]).includes(w)})}toQueryValue(){return this.values}}class be{constructor(C){this.value=C}filterEntity(C){var z;const w=this.value.toLocaleUpperCase("en-US");return C.metadata.name.toLocaleUpperCase("en-US").includes(w)||`${C.metadata.title}`.toLocaleUpperCase("en-US").includes(w)||((z=C.metadata.tags)==null?void 0:z.join("").toLocaleUpperCase("en-US").indexOf(w))!==-1}}class Oe{constructor(C){this.values=C}filterEntity(C){return this.values.some(w=>ht(C,Pe.S4).some(z=>Ge(z,{defaultKind:"group"})===w))}toQueryValue(){return this.values}}class Ae{constructor(C){this.values=C}filterEntity(C){return this.values.some(w=>{var z;return((z=C.spec)==null?void 0:z.lifecycle)===w})}toQueryValue(){return this.values}}class Ke{constructor(C,w,z){this.value=C,this.isOwnedEntity=w,this.isStarredEntity=z}filterEntity(C){switch(this.value){case"owned":return this.isOwnedEntity(C);case"starred":return this.isStarredEntity(C);default:return!0}}toQueryValue(){return this.value}}function ke(){var He;const R=(0,t.useApi)(l),{filters:{kind:C,type:w},queryParameters:{type:z},updateFilters:k}=Be(),K=(0,o.useMemo)(()=>[z].flat().filter(Boolean),[z]),[ce,Se]=(0,o.useState)(K.length?K:(He=w==null?void 0:w.getTypes())!=null?He:[]);(0,o.useEffect)(()=>{K.length&&Se(K)},[K]);const[Ze,xe]=(0,o.useState)([]),Fe=(0,o.useMemo)(()=>C==null?void 0:C.value,[C]),{error:$e,loading:Ve,value:Ot}=(0,Xe.default)(async()=>Fe?await R.getEntityFacets({filter:{kind:Fe},facets:["spec.type"]}).then(_t=>_t.facets["spec.type"]||[]):[],[Fe,R]),nt=(0,o.useRef)(Ot);return(0,o.useEffect)(()=>{const Bt=nt.current;if(nt.current=Ot,Ve||!Fe||Bt===Ot||!Ot)return;const _t=[...new Set(oe()(Ot,In=>-In.count).map(In=>In.value.toLocaleLowerCase("en-US")))];xe(_t);const En=ce.filter(In=>_t.includes(In));Ye()(ce,En)||Se(En)},[Ve,Fe,ce,Se,Ot]),(0,o.useEffect)(()=>{k({type:ce.length?new se(ce):void 0})},[ce,k]),{loading:Ve,error:$e,availableTypes:Ze,selectedTypes:ce,setSelectedTypes:Se}}const Et=20;function It(R,C){var Ze,xe;const w=(Ze=C==null?void 0:C.type)==null?void 0:Ze.toLocaleLowerCase("en-US"),z=(xe=C==null?void 0:C.kind)==null?void 0:xe.toLocaleLowerCase("en-US"),k=(0,t.useApi)(l),{loading:K,value:ce,error:Se}=(0,Xe.default)(async()=>{var nt;const Fe=(nt=R.relations)==null?void 0:nt.map(He=>({type:He.type,target:(0,Pe.of)(He.targetRef)})).filter(He=>(!w||He.type.toLocaleLowerCase("en-US")===w)&&(!z||He.target.kind===z));if(!Fe)return[];const $e=Object.values((0,Re.groupBy)(Fe,({target:He})=>`${He.kind}:${He.namespace}`.toLocaleLowerCase("en-US"))),Ve=[];for(const He of $e)Ve.push({kind:He[0].target.kind,namespace:He[0].target.namespace,nameBatches:(0,Re.chunk)(He.map(Bt=>Bt.target.name),Et)});return(await Promise.all(Ve.flatMap(He=>He.nameBatches.map(Bt=>k.getEntities({filter:{kind:He.kind,"metadata.namespace":He.namespace,"metadata.name":Bt}}))))).flatMap(He=>He.items)},[R,w,z]);return{entities:ce,loading:K,error:Se}}var lt=e(72164);function Tt(R){return typeof R=="string"?R:(0,Pe.eE)(R)}function Lt(){const R=(0,t.useApi)(u),C=(0,lt.Z)(R.starredEntitie$(),new Set),w=(0,o.useCallback)(k=>C.has(Tt(k)),[C]),z=(0,o.useCallback)(k=>R.toggleStarred(Tt(k)).then(),[R]);return{starredEntities:C,toggleStarredEntity:z,isStarredEntity:w}}function Rt(R){return typeof R=="string"?R:(0,Pe.eE)(R)}function Nt(R){const C=(0,t.useApi)(u),[w,z]=(0,o.useState)(!1);return(0,o.useEffect)(()=>{const K=C.starredEntitie$().subscribe({next(ce){z(ce.has(Rt(R)))}});return()=>{K.unsubscribe()}},[R,C]),{toggleStarredEntity:(0,o.useCallback)(()=>C.toggleStarred(Rt(R)).then(),[R,C]),isStarredEntity:w}}function Zt(){const R=(0,t.useApi)(t.identityApiRef),{loading:C,value:w}=(0,Xe.default)(async()=>{const{ownershipEntityRefs:k}=await R.getBackstageIdentity();return k},[]),z=(0,o.useMemo)(()=>{const k=new Set(w!=null?w:[]);return K=>{const ce=ht(K,Pe.S4).map(Pe.eE);for(const Se of ce)if(k.has(Se))return!0;return!1}},[w]);return(0,o.useMemo)(()=>({loading:C,isOwnedEntity:z}),[C,z])}var vt=e(68099);function at(R){const{entity:C,loading:w,error:z}=ue(),{allowed:k,loading:K,error:ce}=(0,vt.gI)({permission:R,resourceRef:C?(0,Pe.eE)(C):void 0});return w||K?{loading:!0,allowed:!1}:z?{loading:!1,allowed:!1,error:z}:{loading:!1,allowed:k,error:ce}}const zt=R=>{var ce;const{initialFilter:C,hidden:w}=R,{updateFilters:z,queryParameters:{kind:k}}=useEntityList(),[K]=useState((ce=[k].flat()[0])!=null?ce:C);return useEffect(()=>{z({kind:K?new EntityKindFilter(K):void 0})},[K,z]),w?null:React.createElement(Alert,{severity:"warning"},"Kind filter not yet available")};var ae=e(79692),V=e(5806),ye=e(21324),We=e(86619),qe=e(19996),ot=e(25505),bt=e(38016),Wt=e(88013);const Xt=(0,ae.Z)({input:{}},{name:"CatalogReactEntityLifecyclePicker"}),un=o.createElement(ot.Z,{fontSize:"small"}),dn=o.createElement(qe.Z,{fontSize:"small"}),xt=()=>{var xe,Fe;const R=Xt(),{updateFilters:C,backendEntities:w,filters:z,queryParameters:{lifecycles:k}}=Be(),K=(0,o.useMemo)(()=>[k].flat().filter(Boolean),[k]),[ce,Se]=(0,o.useState)(K.length?K:(Fe=(xe=z.lifecycles)==null?void 0:xe.values)!=null?Fe:[]);(0,o.useEffect)(()=>{K.length&&Se(K)},[K]),(0,o.useEffect)(()=>{C({lifecycles:ce.length?new Ae(ce):void 0})},[ce,C]);const Ze=(0,o.useMemo)(()=>[...new Set(w.map($e=>{var Ve;return(Ve=$e.spec)==null?void 0:Ve.lifecycle}).filter(Boolean))].sort(),[w]);return Ze.length?o.createElement(E.Z,{pb:1,pt:1},o.createElement(T.Z,{variant:"button",component:"label"},"Lifecycle",o.createElement(Wt.ZP,{multiple:!0,options:Ze,value:ce,onChange:($e,Ve)=>Se(Ve),renderOption:($e,{selected:Ve})=>o.createElement(V.Z,{control:o.createElement(ye.Z,{icon:un,checkedIcon:dn,checked:Ve}),label:$e}),size:"small",popupIcon:o.createElement(bt.Z,{"data-testid":"lifecycle-picker-expand"}),renderInput:$e=>o.createElement(We.Z,{...$e,className:R.input,variant:"outlined"})}))):null},qt=(0,ae.Z)({input:{}},{name:"CatalogReactEntityOwnerPicker"}),x=o.createElement(ot.Z,{fontSize:"small"}),re=o.createElement(qe.Z,{fontSize:"small"}),Ee=()=>{var xe,Fe;const R=qt(),{updateFilters:C,backendEntities:w,filters:z,queryParameters:{owners:k}}=Be(),K=(0,o.useMemo)(()=>[k].flat().filter(Boolean),[k]),[ce,Se]=(0,o.useState)(K.length?K:(Fe=(xe=z.owners)==null?void 0:xe.values)!=null?Fe:[]);(0,o.useEffect)(()=>{K.length&&Se(K)},[K]),(0,o.useEffect)(()=>{C({owners:ce.length?new Oe(ce):void 0})},[ce,C]);const Ze=(0,o.useMemo)(()=>[...new Set(w.flatMap($e=>ht($e,Pe.S4).map(Ve=>Ge(Ve,{defaultKind:"group"}))).filter(Boolean))].sort(),[w]);return Ze.length?o.createElement(E.Z,{pb:1,pt:1},o.createElement(T.Z,{variant:"button",component:"label"},"Owner",o.createElement(Wt.ZP,{multiple:!0,options:Ze,value:ce,onChange:($e,Ve)=>Se(Ve),renderOption:($e,{selected:Ve})=>o.createElement(V.Z,{control:o.createElement(ye.Z,{icon:x,checkedIcon:re,checked:Ve}),label:$e}),size:"small",popupIcon:o.createElement(bt.Z,{"data-testid":"owner-picker-expand"}),renderInput:$e=>o.createElement(We.Z,{...$e,className:R.input,variant:"outlined"})}))):null},Te=(0,ae.Z)(R=>({searchToolbar:{paddingLeft:0,paddingRight:0},input:{}}),{name:"CatalogReactEntitySearchBar"}),Le=()=>{var K,ce;const R=Te(),{filters:C,updateFilters:w}=useEntityList(),[z,k]=useState((ce=(K=C.text)==null?void 0:K.value)!=null?ce:"");return useDebounce(()=>{w({text:z.length?new EntityTextFilter(z):void 0})},250,[z,w]),React.createElement(Toolbar,{className:R.searchToolbar},React.createElement(FormControl,null,React.createElement(Input,{"aria-label":"search",id:"input-with-icon-adornment",className:R.input,placeholder:"Search",autoComplete:"off",onChange:Se=>k(Se.target.value),value:z,startAdornment:React.createElement(InputAdornment,{position:"start"},React.createElement(Search,null)),endAdornment:React.createElement(InputAdornment,{position:"end"},React.createElement(IconButton,{"aria-label":"clear search",onClick:()=>k(""),edge:"end",disabled:z.length===0},React.createElement(Clear,null)))})))},Je=Object.freeze({createEntityRefColumn(R){const{defaultKind:C}=R;function w(z){var k;return((k=z.metadata)==null?void 0:k.title)||Ge(z,{defaultKind:C})}return{title:"Name",highlight:!0,customFilterAndSearch(z,k){return w(k).includes(z)},customSort(z,k){return w(z).localeCompare(w(k))},render:z=>{var k;return o.createElement(Q,{entityRef:z,defaultKind:C,title:(k=z.metadata)==null?void 0:k.title})}}},createEntityRelationColumn({title:R,relation:C,defaultKind:w,filter:z}){function k(ce){return ht(ce,C,z)}function K(ce){return k(ce).map(Se=>Ge(Se,{defaultKind:w})).join(", ")}return{title:R,customFilterAndSearch(ce,Se){return K(Se).includes(ce)},customSort(ce,Se){return K(ce).localeCompare(K(Se))},render:ce=>o.createElement(Z,{entityRefs:k(ce),defaultKind:w})}},createOwnerColumn(){return this.createEntityRelationColumn({title:"Owner",relation:Pe.S4,defaultKind:"group"})},createDomainColumn(){return this.createEntityRelationColumn({title:"Domain",relation:Pe.cz,defaultKind:"domain",filter:{kind:"domain"}})},createSystemColumn(){return this.createEntityRelationColumn({title:"System",relation:Pe.cz,defaultKind:"system",filter:{kind:"system"}})},createMetadataDescriptionColumn(){return{title:"Description",field:"metadata.description",render:R=>o.createElement(Ne.OverflowTooltip,{text:R.metadata.description,placement:"bottom-start",line:2}),width:"auto"}},createSpecLifecycleColumn(){return{title:"Lifecycle",field:"spec.lifecycle"}},createSpecTypeColumn(){return{title:"Type",field:"spec.type"}}}),it=[Je.createEntityRefColumn({defaultKind:"system"}),Je.createDomainColumn(),Je.createOwnerColumn(),Je.createMetadataDescriptionColumn()],Kt=[Je.createEntityRefColumn({defaultKind:"component"}),Je.createSystemColumn(),Je.createOwnerColumn(),Je.createSpecTypeColumn(),Je.createSpecLifecycleColumn(),Je.createMetadataDescriptionColumn()],Ht=(0,ae.Z)(R=>({empty:{padding:R.spacing(2),display:"flex",justifyContent:"center"}})),Dt=R=>{const{entities:C,title:w,emptyContent:z,variant:k="gridItem",columns:K}=R,ce=Ht(),Se={minWidth:"0",width:"100%"};return k==="gridItem"&&(Se.height="calc(100% - 10px)"),o.createElement(Ne.Table,{columns:K,title:w,style:Se,emptyContent:z&&o.createElement("div",{className:ce.empty},z),options:{search:!1,paging:!1,actionsColumnIndex:-1,padding:"dense",draggable:!1},data:C})};Dt.columns=Je,Dt.systemEntityColumns=it,Dt.componentEntityColumns=Kt;const Ft=(0,ae.Z)({input:{}},{name:"CatalogReactEntityTagPicker"}),ut=o.createElement(ot.Z,{fontSize:"small"}),kt=o.createElement(qe.Z,{fontSize:"small"}),tn=()=>{var xe,Fe;const R=Ft(),{updateFilters:C,filters:w,queryParameters:{tags:z}}=Be(),k=(0,t.useApi)(l),{value:K}=(0,Xe.default)(async()=>{var Ot;const $e="metadata.tags",{facets:Ve}=await k.getEntityFacets({facets:[$e],filter:(Ot=w.kind)==null?void 0:Ot.getCatalogFilters()});return Ve[$e].map(({value:nt})=>nt)},[w.kind]),ce=(0,o.useMemo)(()=>[z].flat().filter(Boolean),[z]),[Se,Ze]=(0,o.useState)(ce.length?ce:(Fe=(xe=w.tags)==null?void 0:xe.values)!=null?Fe:[]);return(0,o.useEffect)(()=>{ce.length&&Ze(ce)},[ce]),(0,o.useEffect)(()=>{C({tags:Se.length?new le(Se):void 0})},[Se,C]),K!=null&&K.length?o.createElement(E.Z,{pb:1,pt:1},o.createElement(T.Z,{variant:"button",component:"label"},"Tags",o.createElement(Wt.ZP,{multiple:!0,options:K,value:Se,onChange:($e,Ve)=>Ze(Ve),renderOption:($e,{selected:Ve})=>o.createElement(V.Z,{control:o.createElement(ye.Z,{icon:ut,checkedIcon:kt,checked:Ve}),label:$e}),size:"small",popupIcon:o.createElement(bt.Z,{"data-testid":"tag-picker-expand"}),renderInput:$e=>o.createElement(We.Z,{...$e,className:R.input,variant:"outlined"})}))):null};var jt=e(82108),Vt=e.n(jt);const cn=R=>{var xe;const{hidden:C,initialFilter:w}=R,z=(0,t.useApi)(t.alertApiRef),{error:k,availableTypes:K,selectedTypes:ce,setSelectedTypes:Se}=ke();if((0,o.useEffect)(()=>{k&&z.post({message:"Failed to load entity types",severity:"error"}),w&&Se([w])},[k,z,w,Se]),K.length===0||k)return null;const Ze=[{value:"all",label:"All"},...K.map(Fe=>({value:Fe,label:Vt()(Fe)}))];return C?null:o.createElement(E.Z,{pb:1,pt:1},o.createElement(Ne.Select,{label:"Type",items:Ze,selected:(xe=Ze.length>1?ce[0]:void 0)!=null?xe:"all",onChange:Fe=>Se(Fe==="all"?[]:[String(Fe)])}))};var Tn=e(15459),wt=e(61837),$t=e(11640),hn=e(28347);const yn=(0,Tn.Z)({root:{color:"#f3ba37"}})($t.Z),an=R=>{const{toggleStarredEntity:C,isStarredEntity:w}=Nt(R.entity);return o.createElement(wt.Z,{"aria-label":"favorite",color:"inherit",...R,onClick:()=>C()},o.createElement(ct.ZP,{title:w?"Remove from favorites":"Add to favorites"},w?o.createElement(yn,null):o.createElement(hn.Z,null)))};var fn=e(8629),Wn=e(79249),$=e(38724),h=e(99152),S=e(6487),F=e(49429),W=e(55999),pe=e(72779),he=e.n(pe),Me=e(39412);const ft=Me.Z;function Pt(R,C){if(R)return R.toLocaleLowerCase("en-US");if(C)try{return(0,Pe.of)(C).kind.toLocaleLowerCase("en-US")}catch{return}}function bn(R,C){const w=(0,t.useApp)(),z=Pt(R,C);return z&&w.getSystemIcon(`kind:${z}`)||ft}function vn(R){const{kind:C,entityRef:w,...z}=R,k=bn(C,w);return o.createElement(k,{...z})}const Ur=(0,ae.Z)(R=>({node:{fill:R.palette.grey[300],stroke:R.palette.grey[300],"&.primary":{fill:R.palette.primary.light,stroke:R.palette.primary.light},"&.secondary":{fill:R.palette.secondary.light,stroke:R.palette.secondary.light}},text:{fill:R.palette.getContrastText(R.palette.grey[300]),"&.primary":{fill:R.palette.primary.contrastText},"&.secondary":{fill:R.palette.secondary.contrastText},"&.focused":{fontWeight:"bold"}},clickable:{cursor:"pointer"}}));function or(R){const C=(0,t.useApi)(l),w=(0,Pe.eE)(R),{loading:z,error:k,value:K}=(0,Xe.default)(async()=>{const ce=await C.getEntityAncestors({entityRef:w}),Se=new Array,Ze=new Array;for(const xe of ce.items){const Fe=(0,Pe.eE)(xe.entity),$e=Fe===ce.rootEntityRef;Se.push({id:Fe,root:$e,...xe.entity});for(const Ve of xe.parentEntityRefs)Ze.push({from:Fe,to:Ve})}return{nodes:Se,edges:Ze}},[w]);return{loading:z,error:k,nodes:(K==null?void 0:K.nodes)||[],edges:(K==null?void 0:K.edges)||[]}}function Nr({node:R}){const C=Ur(),w=(0,ze.s0)(),z=(0,t.useRouteRef)(me),[k,K]=(0,o.useState)(0),[ce,Se]=(0,o.useState)(0),Ze=(0,o.useRef)(null);(0,o.useLayoutEffect)(()=>{if(Ze.current){let{height:Bt,width:_t}=Ze.current.getBBox();Bt=Math.round(Bt),_t=Math.round(_t),(Bt!==ce||_t!==k)&&(K(_t),Se(Bt))}},[k,ce]);const xe=10,Fe=ce,$e=Fe+xe,Ve=$e+k+xe*2,Ot=ce+xe*2,nt=R.metadata.title||(R.kind&&R.metadata.name&&R.metadata.namespace?Ge({kind:R.kind,name:R.metadata.name,namespace:R.metadata.namespace||""}):R.id),He=()=>{w(z({kind:R.kind,namespace:R.metadata.namespace||Pe.zG,name:R.metadata.name}))};return o.createElement("g",{onClick:He,className:C.clickable},o.createElement("rect",{className:he()(C.node,R.root?"secondary":"primary"),width:Ve,height:Ot,rx:10}),o.createElement(vn,{kind:R.kind,y:xe,x:xe,width:Fe,height:Fe,className:he()(C.text,R.root?"secondary":"primary")}),o.createElement("text",{ref:Ze,className:he()(C.text,R.root?"secondary":"primary"),y:Ot/2,x:$e+(k+xe*2)/2,textAnchor:"middle",alignmentBaseline:"middle"},nt))}function Zr(R){const{loading:C,error:w,nodes:z,edges:k}=or(R.entity);return C?o.createElement(Ne.Progress,null):w?o.createElement(Ne.ResponseErrorPanel,{error:w}):o.createElement(o.Fragment,null,o.createElement(W.Z,{variant:"h2"},"Ancestry"),o.createElement(W.Z,{gutterBottom:!0},"This is the ancestry of entities above the current one - as in, the chain(s) of entities down to the current one, where"," ",o.createElement(Ne.Link,{to:"https://backstage.io/docs/features/software-catalog/life-of-an-entity"},"processors emitted")," ","child entities that ultimately led to the current one existing. Note that this is a completely different mechanism from relations."),o.createElement(E.Z,{mt:4},o.createElement(Ne.DependencyGraph,{nodes:z,edges:k,renderNode:Nr,direction:Ne.DependencyGraphTypes.Nm.BOTTOM_TOP,zoom:"enable-on-click"})))}var Hn=e(11776),$n=e(38402),Jn=e(86136),sr=e(99688),Rr=e(49378),zr=e(54506),Qn=e(94339),Sr=e(24579),Wr=e(27685);const er=(0,ae.Z)(R=>({root:{display:"flex",flexDirection:"column"},marginTop:{marginTop:R.spacing(2)},helpIcon:{marginLeft:R.spacing(1),color:R.palette.text.disabled},monospace:{fontFamily:"monospace"}}));function Pn(R){const C=er();return o.createElement(Rr.Z,{...R,primaryTypographyProps:{className:C.monospace},secondaryTypographyProps:{className:C.monospace}})}function tr(R){const C=er();return o.createElement(zr.Z,{className:C.monospace},R.children)}function nr(R){return o.createElement(E.Z,{mt:2},o.createElement(Qn.Z,{variant:"outlined"},o.createElement(Sr.Z,null,o.createElement(T.Z,{variant:"h6",gutterBottom:!0},R.title,R.helpLink&&o.createElement(lr,{to:R.helpLink})),R.children)))}function Cr(R){if(R.match(/^url:https?:\/\//))return R.slice(4);if(R.match(/^https?:\/\//))return R}function ir(R){const[C,w]=R.entry,z=Cr(w);return o.createElement($n.Z,null,R.indent&&o.createElement(Jn.Z,null),o.createElement(Pn,{primary:C,secondary:z?o.createElement(Ne.Link,{to:z},w):w}))}function lr(R){const C=er();return o.createElement(Ne.Link,{to:R.to,className:C.helpIcon},o.createElement(Wr.Z,{fontSize:"inherit"}))}const Tr=(0,ae.Z)({root:{display:"flex",flexDirection:"column"}});function Hr(R){var Ze,xe;const C=(0,t.useApi)(l),w=(0,Pe.eE)(R),z=(Ze=R.metadata.annotations)==null?void 0:Ze[Pe.P1],k=(xe=R.metadata.annotations)==null?void 0:xe[Pe.q1],{loading:K,error:ce,value:Se}=(0,Xe.default)(async()=>!z&&!k?[]:(await C.getEntities({filter:[...z?[{[`metadata.annotations.${Pe.P1}`]:z}]:[],...k?[{[`metadata.annotations.${Pe.q1}`]:k}]:[]]})).items,[z,k]);return{loading:K,error:ce,location:z,originLocation:k,colocatedEntities:Se==null?void 0:Se.filter(Fe=>(0,Pe.eE)(Fe)!==w)}}function rr(R){return o.createElement(Hn.Z,{dense:!0},R.header&&o.createElement(ir,{key:"header",entry:R.header}),R.entities.map(C=>o.createElement($n.Z,{key:(0,Pe.eE)(C)},o.createElement(Jn.Z,null,o.createElement(vn,{kind:C.kind})),o.createElement(Pn,{primary:o.createElement(Q,{entityRef:C})}))))}function br(R){const{entity:C}=R,{loading:w,error:z,location:k,originLocation:K,colocatedEntities:ce}=Hr(C);if(w)return o.createElement(Ne.Progress,null);if(z)return o.createElement(Ne.ResponseErrorPanel,{error:z});if(!k&&!K)return o.createElement(sr.Z,{severity:"warning"},"Entity had no location information.");if(!(ce!=null&&ce.length))return o.createElement(sr.Z,{severity:"info"},"There were no other entities on this location.");if(k===K)return o.createElement(rr,{entities:ce});const Se=ce.filter(xe=>{var Fe;return((Fe=xe.metadata.annotations)==null?void 0:Fe[Pe.P1])===k}),Ze=ce.filter(xe=>{var Fe;return((Fe=xe.metadata.annotations)==null?void 0:Fe[Pe.q1])===K});return o.createElement(o.Fragment,null,Se.length>0&&o.createElement(rr,{entities:Se,header:["At the same location",k]}),Ze.length>0&&o.createElement(rr,{entities:Ze,header:["At the same origin",K]}))}function jr(R){const C=Tr();return o.createElement(o.Fragment,null,o.createElement(W.Z,{variant:"h2"},"Colocated"),o.createElement(W.Z,null,"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)."),o.createElement("div",{className:C.root},o.createElement(br,{entity:R.entity})))}function cr(R){return Object.fromEntries([...Object.entries(R)].sort((C,w)=>C[0]<w[0]?-1:1))}function Pr(R){return o.createElement(o.Fragment,null,o.createElement(W.Z,{variant:"h2"},"Entity as JSON"),o.createElement(W.Z,null,"This is the raw entity data as received from the catalog, on JSON form."),o.createElement(W.Z,null,o.createElement("div",{style:{fontSize:"75%"},"data-testid":"code-snippet"},o.createElement(Ne.CodeSnippet,{text:JSON.stringify(cr(R.entity),void 0,2),language:"json",showCopyCodeButton:!0}))))}var ur=e(3440),Ir=e.n(ur);const dr=(0,ae.Z)({root:{display:"flex",flexDirection:"column"}});function mn(R){var xe,Fe;const C=dr(),{apiVersion:w,kind:z,metadata:k,spec:K,relations:ce=[],status:Se={}}=R.entity,Ze=Ir()(oe()(ce,$e=>$e.targetRef),"type");return o.createElement(o.Fragment,null,o.createElement(W.Z,{variant:"h2"},"Overview"),o.createElement("div",{className:C.root},o.createElement(nr,{title:"Identity"},o.createElement(Hn.Z,{dense:!0},o.createElement($n.Z,null,o.createElement(Pn,{primary:"apiVersion",secondary:w})),o.createElement($n.Z,null,o.createElement(Pn,{primary:"kind",secondary:z})),(K==null?void 0:K.type)&&o.createElement($n.Z,null,o.createElement(Pn,{primary:"spec.type",secondary:K.type})),k.uid&&o.createElement($n.Z,null,o.createElement(Pn,{primary:"uid",secondary:k.uid})),k.etag&&o.createElement($n.Z,null,o.createElement(Pn,{primary:"etag",secondary:k.etag})))),o.createElement(nr,{title:"Metadata"},!!Object.keys(k.annotations||{}).length&&o.createElement(Hn.Z,{dense:!0,subheader:o.createElement(tr,null,"Annotations",o.createElement(lr,{to:"https://backstage.io/docs/features/software-catalog/well-known-annotations"}))},Object.entries(k.annotations).map($e=>o.createElement(ir,{key:$e[0],indent:!0,entry:$e}))),!!Object.keys(k.labels||{}).length&&o.createElement(Hn.Z,{dense:!0,subheader:o.createElement(tr,null,"Labels")},Object.entries(k.labels).map($e=>o.createElement(ir,{key:$e[0],indent:!0,entry:$e}))),!!((xe=k.tags)!=null&&xe.length)&&o.createElement(Hn.Z,{dense:!0,subheader:o.createElement(tr,null,"Tags")},k.tags.map(($e,Ve)=>o.createElement($n.Z,{key:`${$e}-${Ve}`},o.createElement(Jn.Z,null),o.createElement(Pn,{primary:$e}))))),!!ce.length&&o.createElement(nr,{title:"Relations",helpLink:"https://backstage.io/docs/features/software-catalog/well-known-relations"},Object.entries(Ze).map(([$e,Ve],Ot)=>o.createElement("div",{key:Ot},o.createElement(Hn.Z,{dense:!0,subheader:o.createElement(tr,null,$e)},Ve.map(nt=>o.createElement($n.Z,{key:nt.targetRef},o.createElement(Jn.Z,null,o.createElement(vn,{entityRef:nt.targetRef})),o.createElement(Pn,{primary:o.createElement(Q,{entityRef:nt.targetRef})}))))))),!!((Fe=Se.items)!=null&&Fe.length)&&o.createElement(nr,{title:"Status",helpLink:"https://backstage.io/docs/features/software-catalog/well-known-statuses"},Se.items.map(($e,Ve)=>o.createElement("div",{key:Ve},o.createElement(T.Z,null,$e.level,": ",$e.type),o.createElement(E.Z,{ml:2},$e.message))))))}var Fn=e(60155),Lr=e.n(Fn);function Bn(R){return o.createElement(o.Fragment,null,o.createElement(W.Z,{variant:"h2"},"Entity as YAML"),o.createElement(W.Z,null,"This is the raw entity data as received from the catalog, on YAML form."),o.createElement(W.Z,null,o.createElement("div",{style:{fontSize:"75%"},"data-testid":"code-snippet"},o.createElement(Ne.CodeSnippet,{text:Lr().stringify(cr(R.entity)),language:"yaml",showCopyCodeButton:!0}))))}const fr=(0,ae.Z)(R=>({fullHeightDialog:{height:"calc(100% - 64px)"},root:{display:"flex",flexGrow:1,width:"100%",backgroundColor:R.palette.background.paper},tabs:{borderRight:`1px solid ${R.palette.divider}`,flexShrink:0},tabContents:{flexGrow:1,overflowX:"auto"}}));function Vn(R){const{children:C,value:w,index:z,...k}=R,K=fr();return o.createElement("div",{role:"tabpanel",hidden:w!==z,id:`vertical-tabpanel-${z}`,"aria-labelledby":`vertical-tab-${z}`,className:K.tabContents,...k},w===z&&o.createElement(E.Z,{pl:3,pr:3},C))}function Gn(R){return{id:`vertical-tab-${R}`,"aria-controls":`vertical-tabpanel-${R}`}}function mr(R){const C=fr(),[w,z]=o.useState(0);return(0,o.useEffect)(()=>{z(0)},[R.open]),R.entity?o.createElement(fn.Z,{fullWidth:!0,maxWidth:"xl",open:R.open,onClose:R.onClose,"aria-labelledby":"entity-inspector-dialog-title",PaperProps:{className:C.fullHeightDialog}},o.createElement(Wn.Z,{id:"entity-inspector-dialog-title"},"Entity Inspector"),o.createElement($.Z,{dividers:!0},o.createElement("div",{className:C.root},o.createElement(h.Z,{orientation:"vertical",variant:"scrollable",value:w,onChange:(k,K)=>z(K),"aria-label":"Inspector options",className:C.tabs},o.createElement(S.Z,{label:"Overview",...Gn(0)}),o.createElement(S.Z,{label:"Ancestry",...Gn(1)}),o.createElement(S.Z,{label:"Colocated",...Gn(2)}),o.createElement(S.Z,{label:"Raw JSON",...Gn(3)}),o.createElement(S.Z,{label:"Raw YAML",...Gn(4)})),o.createElement(Vn,{value:w,index:0},o.createElement(mn,{entity:R.entity})),o.createElement(Vn,{value:w,index:1},o.createElement(Zr,{entity:R.entity})),o.createElement(Vn,{value:w,index:2},o.createElement(jr,{entity:R.entity})),o.createElement(Vn,{value:w,index:3},o.createElement(Pr,{entity:R.entity})),o.createElement(Vn,{value:w,index:4},o.createElement(Bn,{entity:R.entity})))),o.createElement(F.Z,null,o.createElement(y.Z,{onClick:R.onClose,color:"primary"},"Close"))):null}var Or=e(85256);function hr(R){var Ot;const C=(0,t.useApi)(l),w=(Ot=R.metadata.annotations)==null?void 0:Ot[Pe.q1],z=R.metadata.uid,k=w==="bootstrap:bootstrap",K=(0,Xe.default)(async()=>{const nt=C.getLocationByRef(w);let He;if(!w)He=Promise.resolve([]);else{const Bt=`metadata.annotations.${Pe.q1}`;He=C.getEntities({filter:{[Bt]:w},fields:["kind","metadata.uid","metadata.name","metadata.namespace"]}).then(_t=>_t.items)}return Promise.all([nt,He]).then(([Bt,_t])=>({location:Bt,colocatedEntities:_t}))},[C,R]),ce=(0,o.useCallback)(async function(){const{location:He}=K.value;await C.removeLocationById(He.id)},[C,K]),Se=(0,o.useCallback)(async function(){await C.removeEntityByUid(z)},[C,z]);if(k)return{type:"bootstrap",location:w,deleteEntity:Se};const{loading:Ze,error:xe,value:Fe}=K;if(Ze)return{type:"loading"};if(xe)return{type:"error",error:xe};const{location:$e,colocatedEntities:Ve}=Fe;return $e?{type:"unregister",location:w,colocatedEntities:Ve.map(Pe.iB),unregisterLocation:ce,deleteEntity:Se}:{type:"only-delete",deleteEntity:Se}}var Kn=e(10179);const Vr=(0,ae.Z)({advancedButton:{fontSize:"0.7em"}}),Gr=({entity:R,onConfirm:C})=>{var Ot;const w=(0,t.useApi)(t.alertApiRef),z=(0,t.useApi)(t.configApiRef),k=Vr(),K=hr(R),[ce,Se]=(0,o.useState)(!1),[Ze,xe]=(0,o.useState)(!1),Fe=(Ot=z.getOptionalString("app.title"))!=null?Ot:"Backstage",$e=(0,o.useCallback)(async function(){if("unregisterLocation"in K){xe(!0);try{await K.unregisterLocation(),C()}catch(He){(0,Kn.BD)(He),w.post({message:He.message})}finally{xe(!1)}}},[w,C,K]),Ve=(0,o.useCallback)(async function(){if("deleteEntity"in K){xe(!0);try{await K.deleteEntity(),C()}catch(He){(0,Kn.BD)(He),w.post({message:He.message})}finally{xe(!1)}}},[w,C,K]);return K.type==="loading"?o.createElement(Ne.Progress,null):K.type==="error"?o.createElement(Ne.ResponseErrorPanel,{error:K.error}):K.type==="bootstrap"?o.createElement(o.Fragment,null,o.createElement(sr.Z,{severity:"info"},'You cannot unregister this entity, since it originates from a protected Backstage configuration (location "',K.location,'"). If you believe this is in error, please contact the ',Fe," ","integrator."),o.createElement(E.Z,{marginTop:2},!ce&&o.createElement(y.Z,{variant:"text",size:"small",color:"primary",className:k.advancedButton,onClick:()=>Se(!0)},"Advanced Options"),ce&&o.createElement(o.Fragment,null,o.createElement(W.Z,null,"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."),o.createElement(y.Z,{variant:"contained",color:"secondary",disabled:Ze,onClick:Ve},"Delete Entity")))):K.type==="only-delete"?o.createElement(o.Fragment,null,o.createElement(W.Z,null,"This entity does not seem to originate from a registered location. You therefore only have the option to delete it outright from the catalog."),o.createElement(y.Z,{variant:"contained",color:"secondary",disabled:Ze,onClick:Ve},"Delete Entity")):K.type==="unregister"?o.createElement(o.Fragment,null,o.createElement(W.Z,null,"This action will unregister the following entities:"),o.createElement(W.Z,{component:"ul"},K.colocatedEntities.map(nt=>o.createElement("li",{key:`${nt.kind}:${nt.namespace}/${nt.name}`},o.createElement(Q,{entityRef:nt})))),o.createElement(W.Z,null,"Located at the following location:"),o.createElement(W.Z,{component:"ul"},o.createElement("li",null,K.location)),o.createElement(W.Z,null,"To undo, just re-register the entity in ",Fe,"."),o.createElement(E.Z,{marginTop:2},o.createElement(y.Z,{variant:"contained",color:"secondary",disabled:Ze,onClick:$e},"Unregister Location"),!ce&&o.createElement(E.Z,{component:"span",marginLeft:2},o.createElement(y.Z,{variant:"text",size:"small",color:"primary",className:k.advancedButton,onClick:()=>Se(!0)},"Advanced Options"))),ce&&o.createElement(o.Fragment,null,o.createElement(E.Z,{paddingTop:4,paddingBottom:4},o.createElement(Or.Z,null)),o.createElement(W.Z,null,"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."),o.createElement(y.Z,{variant:"contained",color:"secondary",disabled:Ze,onClick:Ve},"Delete Entity"))):o.createElement(sr.Z,{severity:"error"},"Internal error: Unknown state")},gr=R=>{const{open:C,onConfirm:w,onClose:z,entity:k}=R;return o.createElement(fn.Z,{open:C,onClose:z},o.createElement(Wn.Z,{id:"responsive-dialog-title"},"Are you sure you want to unregister this entity?"),o.createElement($.Z,null,o.createElement(Gr,{entity:k,onConfirm:w})),o.createElement(F.Z,null,o.createElement(y.Z,{onClick:z,color:"primary"},"Cancel")))};var P=e(12231),J=e(9520),fe=e(47603);const De=(0,ae.Z)(R=>({root:{backgroundColor:"rgba(0, 0, 0, .11)",boxShadow:"none",margin:R.spacing(1,0,1,0)},title:{margin:R.spacing(1,0,0,1),textTransform:"uppercase",fontSize:12,fontWeight:"bold"},listIcon:{minWidth:30,color:R.palette.text.primary},menuItem:{minHeight:R.spacing(6)},groupWrapper:{margin:R.spacing(1,1,2,1)}}),{name:"CatalogReactUserListPicker"});function Qe(R){return[{name:"Personal",items:[{id:"owned",label:"Owned",icon:fe.Z},{id:"starred",label:"Starred",icon:$t.Z}]},{name:R!=null?R:"Company",items:[{id:"all",label:"All"}]}]}const At=R=>{var aa;const{initialFilter:C,availableFilters:w}=R,z=De(),K=(aa=(0,t.useApi)(t.configApiRef).getOptionalString("organization.name"))!=null?aa:"Company",{filters:ce,updateFilters:Se,backendEntities:Ze,queryParameters:{kind:xe,user:Fe},loading:$e}=Be(),Ve=["starred","all"],Ot=Qe(K).map(on=>({...on,items:on.items.filter(({id:On})=>["group","user"].some(Dr=>Dr===xe)?Ve.includes(On):!w||w.includes(On))})).filter(({items:on})=>!!on.length),{isStarredEntity:nt}=Lt(),{isOwnedEntity:He,loading:Bt}=Zt(),_t=$e||Bt,En=(0,o.useMemo)(()=>new Ke("owned",He,nt),[He,nt]),In=(0,o.useMemo)(()=>new Ke("starred",He,nt),[He,nt]),gn=(0,o.useMemo)(()=>[Fe].flat()[0],[Fe]),[An,Ln]=(0,o.useState)(gn!=null?gn:C),xr=(0,o.useMemo)(()=>Ze.filter(pt((0,Re.compact)(Object.values({...ce,user:void 0})))),[ce,Ze]),pr=(0,o.useMemo)(()=>({all:xr.length,starred:xr.filter(on=>In.filterEntity(on)).length,owned:xr.filter(on=>En.filterEntity(on)).length}),[xr,In,En]);return(0,o.useEffect)(()=>{gn&&Ln(gn)},[gn]),(0,o.useEffect)(()=>{!_t&&!!An&&An!=="all"&&pr[An]===0&&Ln("all")},[_t,pr,An,Ln]),(0,o.useEffect)(()=>{Se({user:An?new Ke(An,He,nt):void 0})},[An,He,nt,Se]),o.createElement(Qn.Z,{className:z.root},Ot.map(on=>o.createElement(o.Fragment,{key:on.name},o.createElement(T.Z,{variant:"subtitle2",component:"span",className:z.title},on.name),o.createElement(Qn.Z,{className:z.groupWrapper},o.createElement(Hn.Z,{disablePadding:!0,dense:!0,role:"menu","aria-label":on.name},on.items.map(On=>{var Dr,oa;return o.createElement(P.Z,{role:"none presentation",key:On.id,button:!0,divider:!0,onClick:()=>Ln(On.id),selected:On.id===((Dr=ce.user)==null?void 0:Dr.value),className:z.menuItem,disabled:pr[On.id]===0,"data-testid":`user-picker-${On.id}`,tabIndex:0,ContainerProps:{role:"menuitem"}},On.icon&&o.createElement(Jn.Z,{className:z.listIcon},o.createElement(On.icon,{fontSize:"small"})),o.createElement(Rr.Z,null,o.createElement(T.Z,{variant:"body1"},On.label," ")),o.createElement(J.Z,null,(oa=pr[On.id])!=null?oa:"-"))}))))))},St=({children:R,value:C})=>{var Se;const[w,z]=useState((Se=C==null?void 0:C.filters)!=null?Se:{}),k=useCallback(Ze=>{z(xe=>{const Fe=typeof Ze=="function"?Ze(xe):Ze;return{...xe,...Fe}})},[]),K=useMemo(()=>({entities:[],backendEntities:[],queryParameters:{}}),[]),ce=useMemo(()=>{var Ze,xe,Fe,$e,Ve;return{entities:(Ze=C==null?void 0:C.entities)!=null?Ze:K.entities,backendEntities:(xe=C==null?void 0:C.backendEntities)!=null?xe:K.backendEntities,updateFilters:(Fe=C==null?void 0:C.updateFilters)!=null?Fe:k,filters:w,loading:($e=C==null?void 0:C.loading)!=null?$e:!1,queryParameters:(Ve=C==null?void 0:C.queryParameters)!=null?Ve:K.queryParameters,error:C==null?void 0:C.error}},[C,K,w,k]);return React.createElement(EntityListContext.Provider,{value:ce},R)}},39398:function(ee,s,e){"use strict";e.r(s),e.d(s,{AboutCard:function(){return Re},AboutContent:function(){return te},AboutField:function(){return U}});var r=e(48023),t=e(82339),l=e(36964),u=e(36356),A=e(53479),m=e(79692),o=e(94339),c=e(32552),f=e(61837),y=e(85256),p=e(24579),E=e(52866),T=e(30254),I=e(27604),B=e(2784),j=e(47851),M=e(60905),b=e(90436),L=e(7089);const D=(0,m.Z)(we=>({value:{fontWeight:"bold",overflow:"hidden",lineHeight:"24px",wordBreak:"break-word"},label:{color:we.palette.text.secondary,textTransform:"uppercase",fontSize:"10px",fontWeight:"bold",letterSpacing:.5,overflow:"hidden",whiteSpace:"nowrap"}}));function U(we){const{label:ge,value:ze,gridSizes:_e,children:et}=we,st=D(),Ct=(0,l.useElementFilter)(et,Pe=>Pe.getElements()),pt=Ct.length>0?Ct:B.createElement(b.Z,{variant:"body2",className:st.value},ze||"unknown");return B.createElement(M.Z,{item:!0,..._e},B.createElement(b.Z,{variant:"h2",className:st.label},ge),pt)}const Y=(0,m.Z)({description:{wordBreak:"break-word"}});function te(we){var Be,Xe,mt,Ye,yt,oe;const{entity:ge}=we,ze=Y(),_e=ge.kind.toLocaleLowerCase("en-US")==="system",et=ge.kind.toLocaleLowerCase("en-US")==="resource",st=ge.kind.toLocaleLowerCase("en-US")==="component",Ct=ge.kind.toLocaleLowerCase("en-US")==="api",pt=ge.kind.toLocaleLowerCase("en-US")==="template",Pe=ge.kind.toLocaleLowerCase("en-US")==="location",ht=ge.kind.toLocaleLowerCase("en-US")==="group",je=(0,A.getEntityRelations)(ge,r.cz,{kind:"system"}),ie=(0,A.getEntityRelations)(ge,r.cz,{kind:"component"}),de=(0,A.getEntityRelations)(ge,r.cz,{kind:"domain"}),Ue=(0,A.getEntityRelations)(ge,r.S4);return B.createElement(M.Z,{container:!0},B.createElement(U,{label:"Description",gridSizes:{xs:12}},B.createElement(b.Z,{variant:"body2",paragraph:!0,className:ze.description},((Be=ge==null?void 0:ge.metadata)==null?void 0:Be.description)||"No description")),B.createElement(U,{label:"Owner",value:"No Owner",gridSizes:{xs:12,sm:6,lg:4}},Ue.length>0&&B.createElement(A.EntityRefLinks,{entityRefs:Ue,defaultKind:"group"})),(_e||de.length>0)&&B.createElement(U,{label:"Domain",value:"No Domain",gridSizes:{xs:12,sm:6,lg:4}},de.length>0&&B.createElement(A.EntityRefLinks,{entityRefs:de,defaultKind:"domain"})),(Ct||st||et||je.length>0)&&B.createElement(U,{label:"System",value:"No System",gridSizes:{xs:12,sm:6,lg:4}},je.length>0&&B.createElement(A.EntityRefLinks,{entityRefs:je,defaultKind:"system"})),st&&ie.length>0&&B.createElement(U,{label:"Parent Component",value:"No Parent Component",gridSizes:{xs:12,sm:6,lg:4}},B.createElement(A.EntityRefLinks,{entityRefs:ie,defaultKind:"component"})),(Ct||st||et||pt||ht||Pe||typeof((Xe=ge==null?void 0:ge.spec)==null?void 0:Xe.type)=="string")&&B.createElement(U,{label:"Type",value:(mt=ge==null?void 0:ge.spec)==null?void 0:mt.type,gridSizes:{xs:12,sm:6,lg:4}}),(Ct||st||typeof((Ye=ge==null?void 0:ge.spec)==null?void 0:Ye.lifecycle)=="string")&&B.createElement(U,{label:"Lifecycle",value:(yt=ge==null?void 0:ge.spec)==null?void 0:yt.lifecycle,gridSizes:{xs:12,sm:6,lg:4}}),B.createElement(U,{label:"Tags",value:"No Tags",gridSizes:{xs:12,sm:6,lg:4}},(((oe=ge==null?void 0:ge.metadata)==null?void 0:oe.tags)||[]).map(me=>B.createElement(L.Z,{key:me,size:"small",label:me}))))}const ue=(0,m.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 Re(we){var Ye,yt,oe;const{variant:ge}=we,ze=ue(),{entity:_e}=(0,A.useEntity)(),et=(0,l.useApi)(u.q3),st=(0,l.useApi)(A.catalogApiRef),Ct=(0,l.useApi)(l.alertApiRef),pt=(0,l.useRouteRef)(j.jU),Pe=(0,A.getEntitySourceLocation)(_e,et),ht=(Ye=_e.metadata.annotations)==null?void 0:Ye[r.Tf],je={label:"View Source",disabled:!Pe,icon:B.createElement(u.nW,{type:Pe==null?void 0:Pe.integrationType}),href:Pe==null?void 0:Pe.locationTargetUrl},ie={label:"View TechDocs",disabled:!((yt=_e.metadata.annotations)!=null&&yt["backstage.io/techdocs-ref"])||!pt,icon:B.createElement(T.Z,null),href:pt&&pt({namespace:_e.metadata.namespace||r.zG,kind:_e.kind,name:_e.metadata.name})};let de="";ge==="gridItem"?de=ze.gridItemCard:ge==="fullHeight"&&(de=ze.fullHeightCard);let Ue="";ge==="gridItem"?Ue=ze.gridItemCardContent:ge==="fullHeight"&&(Ue=ze.fullHeightCardContent);const Be=(oe=_e.metadata.annotations)==null?void 0:oe[r.P1],Xe=(Be==null?void 0:Be.startsWith("url:"))||(Be==null?void 0:Be.startsWith("file:")),mt=(0,B.useCallback)(async()=>{await st.refreshEntity((0,r.eE)(_e)),Ct.post({message:"Refresh scheduled",severity:"info"})},[st,Ct,_e]);return B.createElement(o.Z,{className:de},B.createElement(c.Z,{title:"About",action:B.createElement(B.Fragment,null,Xe&&B.createElement(f.Z,{"aria-label":"Refresh",title:"Schedule entity refresh",onClick:mt},B.createElement(E.Z,null)),B.createElement(f.Z,{component:t.Link,"aria-label":"Edit",disabled:!ht,title:"Edit Metadata",to:ht!=null?ht:"#"},B.createElement(I.Z,null))),subheader:B.createElement(t.HeaderIconLinkRow,{links:[je,ie]})}),B.createElement(y.Z,null),B.createElement(p.Z,{className:Ue},B.createElement(te,{entity:_e})))}},49782:function(ee,s,e){"use strict";e.d(s,{K:function(){return E}});var r=e(2784),t=e(79692),l=e(12420),u=e(97580),A=e(73698),m=e(74603),o=e(12231),c=e(53479),f=e(64279),y=e(36964);const p=(0,t.Z)(T=>(0,l.Z)({root:{...T.typography.h4}}));function E(T){var we;const{initialFilter:I="component",allowedKinds:B}=T,j=p(),M=(0,y.useApi)(c.catalogApiRef),{value:b}=(0,f.default)(async()=>await M.getEntityFacets({facets:["kind"]}).then(ge=>{var ze;return((ze=ge.facets.kind)==null?void 0:ze.map(_e=>_e.value).sort())||[]})),{updateFilters:L,queryParameters:{kind:D}}=(0,c.useEntityList)(),U=(0,r.useMemo)(()=>{var ge;return(ge=[D].flat()[0])==null?void 0:ge.toLocaleLowerCase("en-US")},[D]),[Y,te]=(0,r.useState)(U!=null?U:I);(0,r.useEffect)(()=>{L({kind:Y?new c.EntityKindFilter(Y):void 0})},[Y,L]),(0,r.useEffect)(()=>{U&&te(U)},[U]);const Re=[(0,u.Z)(Y)].concat((we=b==null?void 0:b.filter(ge=>B?B.some(ze=>ze.toLocaleLowerCase("en-US")===ge.toLocaleLowerCase("en-US")):!0))!=null?we:[]).sort().reduce((ge,ze)=>(ge[ze.toLocaleLowerCase("en-US")]=ze,ge),{});return r.createElement(A.Z,{input:r.createElement(m.Z,{value:Y}),value:Y,onChange:ge=>te(ge.target.value),classes:j},Object.keys(Re).map(ge=>r.createElement(o.Z,{value:ge,key:ge},`${Re[ge]}s`)))}},30097:function(ee,s,e){"use strict";e.d(s,{E:function(){return B}});var r=e(48023),t=e(53479),l=e(27604),u=e(2997),A=e(76635),m=e(2784),o=e(7089),c=e(82339);const f=Object.freeze({createNameColumn(j){function M(b){var L;return((L=b.metadata)==null?void 0:L.title)||(0,t.humanizeEntityRef)(b,{defaultKind:j==null?void 0:j.defaultKind})}return{title:"Name",field:"resolved.name",highlight:!0,customSort({entity:b},{entity:L}){return M(b).localeCompare(M(L))},render:({entity:b})=>{var L;return m.createElement(t.EntityRefLink,{entityRef:b,defaultKind:(j==null?void 0:j.defaultKind)||"Component",title:(L=b.metadata)==null?void 0:L.title})}}},createSystemColumn(){return{title:"System",field:"resolved.partOfSystemRelationTitle",render:({resolved:j})=>m.createElement(t.EntityRefLinks,{entityRefs:j.partOfSystemRelations,defaultKind:"system"})}},createOwnerColumn(){return{title:"Owner",field:"resolved.ownedByRelationsTitle",render:({resolved:j})=>m.createElement(t.EntityRefLinks,{entityRefs:j.ownedByRelations,defaultKind:"group"})}},createSpecTypeColumn(){return{title:"Type",field:"entity.spec.type",hidden:!0}},createSpecLifecycleColumn(){return{title:"Lifecycle",field:"entity.spec.lifecycle"}},createMetadataDescriptionColumn(){return{title:"Description",field:"entity.metadata.description",render:({entity:j})=>m.createElement(c.OverflowTooltip,{text:j.metadata.description,placement:"bottom-start"}),width:"auto"}},createTagsColumn(){return{title:"Tags",field:"entity.metadata.tags",cellStyle:{padding:"0px 16px 0px 20px"},render:({entity:j})=>m.createElement(m.Fragment,null,j.metadata.tags&&j.metadata.tags.map(M=>m.createElement(o.Z,{key:M,label:M,size:"small",variant:"outlined",style:{marginBottom:"0px"}})))}}});var y=e(28347),p=e(15459),E=e(11640),T=e(90436);const I=(0,p.Z)({root:{color:"#f3ba37"}})(E.Z),B=j=>{var pt,Pe,ht;const{columns:M,actions:b,tableOptions:L}=j,{isStarredEntity:D,toggleStarredEntity:U}=(0,t.useStarredEntities)(),{loading:Y,error:te,entities:ue,filters:Re}=(0,t.useEntityList)(),we=(0,m.useMemo)(()=>{var ie;return[f.createNameColumn({defaultKind:(ie=Re.kind)==null?void 0:ie.value}),...je(),f.createMetadataDescriptionColumn(),f.createTagsColumn()];function je(){var de;switch((de=Re.kind)==null?void 0:de.value){case"user":return[];case"domain":case"system":return[f.createOwnerColumn()];case"group":case"location":case"template":return[f.createSpecTypeColumn()];default:return[f.createSystemColumn(),f.createOwnerColumn(),f.createSpecTypeColumn(),f.createSpecLifecycleColumn()]}}},[(pt=Re.kind)==null?void 0:pt.value]),ge=Re.type===void 0,ze=(0,A.capitalize)((ht=(Pe=Re.user)==null?void 0:Pe.value)!=null?ht:"all");if(te)return m.createElement("div",null,m.createElement(c.WarningPanel,{severity:"error",title:"Could not fetch catalog entities."},m.createElement(c.CodeSnippet,{language:"text",text:te.toString()})));const _e=[({entity:je})=>{var Ue;const ie=(Ue=je.metadata.annotations)==null?void 0:Ue[r.l2],de="View";return{icon:()=>m.createElement(m.Fragment,null,m.createElement(T.Z,{variant:"srOnly"},de),m.createElement(u.Z,{fontSize:"small"})),tooltip:de,disabled:!ie,onClick:()=>{!ie||window.open(ie,"_blank")}}},({entity:je})=>{var Ue;const ie=(Ue=je.metadata.annotations)==null?void 0:Ue[r.Tf],de="Edit";return{icon:()=>m.createElement(m.Fragment,null,m.createElement(T.Z,{variant:"srOnly"},de),m.createElement(l.Z,{fontSize:"small"})),tooltip:de,disabled:!ie,onClick:()=>{!ie||window.open(ie,"_blank")}}},({entity:je})=>{const ie=D(je),de=ie?"Remove from favorites":"Add to favorites";return{cellStyle:{paddingLeft:"1em"},icon:()=>m.createElement(m.Fragment,null,m.createElement(T.Z,{variant:"srOnly"},de),ie?m.createElement(I,null):m.createElement(y.Z,null)),tooltip:de,onClick:()=>U(je)}}],et=ue.map(je=>{const ie=(0,t.getEntityRelations)(je,r.cz,{kind:"system"}),de=(0,t.getEntityRelations)(je,r.S4);return{entity:je,resolved:{name:(0,t.humanizeEntityRef)(je,{defaultKind:"Component"}),ownedByRelationsTitle:de.map(Ue=>(0,t.humanizeEntityRef)(Ue,{defaultKind:"group"})).join(", "),ownedByRelations:de,partOfSystemRelationTitle:ie.map(Ue=>(0,t.humanizeEntityRef)(Ue,{defaultKind:"system"})).join(", "),partOfSystemRelations:ie}}}),st=(M||we).find(je=>je.title==="Type");st&&(st.hidden=!ge);const Ct=et.length>20;return m.createElement(c.Table,{isLoading:Y,columns:M||we,options:{paging:Ct,pageSize:20,actionsColumnIndex:-1,loadingType:"linear",showEmptyDataSourceMessage:!Y,padding:"dense",pageSizeOptions:[20,50,100],...L},title:`${ze} (${ue.length})`,data:et,actions:b||_e})};B.columns=f},47851:function(ee,s,e){"use strict";e.d(s,{_Z:function(){return u},jU:function(){return l},yw:function(){return t}});var r=e(36964);const t=(0,r.createExternalRouteRef)({id:"create-component",optional:!0}),l=(0,r.createExternalRouteRef)({id:"view-techdoc",optional:!0,params:["namespace","kind","name"]}),u=(0,r.createRouteRef)({id:"catalog"})},40749:function(ee,s,e){"use strict";e.d(s,{rG:function(){return r},Y2:function(){return L},J$:function(){return f},g2:function(){return l}});var r;(function(D){const U="DENY";D.DENY=U;const Y="ALLOW";D.ALLOW=Y;const te="CONDITIONAL";D.CONDITIONAL=te})(r||(r={}));function t(D,U){return D.name===U.name}function l(D,U){return"resourceType"in D?!U||D.resourceType===U:!1}function u(D){return D.attributes.action==="create"}function A(D){return D.attributes.action==="read"}function m(D){return D.attributes.action==="update"}function o(D){return D.attributes.action==="delete"}function c(D){return{authorize:async(U,Y)=>await D.authorize(U,Y),authorizeConditional(U,Y){const te=U;return D.authorize(te,Y)}}}function f({name:D,attributes:U,resourceType:Y}){return Y?{type:"resource",name:D,attributes:U,resourceType:Y}:{type:"basic",name:D,attributes:U}}var y=e(10179),p=e(96279),E=e.n(p),T=e(9571),I=e(30195);const B=I.z.lazy(()=>I.z.object({rule:I.z.string(),resourceType:I.z.string(),params:I.z.array(I.z.unknown())}).or(I.z.object({anyOf:I.z.array(B).nonempty()})).or(I.z.object({allOf:I.z.array(B).nonempty()})).or(I.z.object({not:B}))),j=I.z.object({result:I.z.literal(r.ALLOW).or(I.z.literal(r.DENY))}),M=I.z.union([I.z.object({result:I.z.literal(r.ALLOW).or(I.z.literal(r.DENY))}),I.z.object({result:I.z.literal(r.CONDITIONAL),pluginId:I.z.string(),resourceType:I.z.string(),conditions:B})]),b=(D,U)=>I.z.object({items:I.z.array(I.z.intersection(I.z.object({id:I.z.string()}),D)).refine(Y=>Y.length===U.size&&Y.every(({id:te})=>U.has(te)),{message:"Items in response do not match request"})});class L{constructor(U){q(this,"enabled");q(this,"discovery");var Y;this.discovery=U.discovery,this.enabled=(Y=U.config.getOptionalBoolean("permission.enabled"))!=null?Y:!1}async authorize(U,Y){return this.makeRequest(U,j,Y)}async authorizeConditional(U,Y){return this.makeRequest(U,M,Y)}async makeRequest(U,Y,te){if(!this.enabled)return U.map(et=>({result:r.ALLOW}));const ue={items:U.map(et=>({id:T.Z(),...et}))},Re=await this.discovery.getBaseUrl("permission"),we=await E()(`${Re}/authorize`,{method:"POST",body:JSON.stringify(ue),headers:{...this.getAuthorizationHeader(te==null?void 0:te.token),"content-type":"application/json"}});if(!we.ok)throw await y.VL.fromResponse(we);const ge=await we.json(),_e=b(Y,new Set(ue.items.map(({id:et})=>et))).parse(ge).items.reduce((et,st)=>(et[st.id]=st,et),{});return ue.items.map(et=>_e[et.id])}getAuthorizationHeader(U){return U?{Authorization:`Bearer ${U}`}:{}}}},68099:function(ee,s,e){"use strict";e.d(s,{iM:function(){return A},RV:function(){return l},gI:function(){return o}});var r=e(2784),t=e(36964);const l=(0,t.createApiRef)({id:"plugin.permission.api"});var u=e(40749);class A{constructor(y,p){this.permissionClient=y,this.identityApi=p}static create(y){const{config:p,discovery:E,identity:T}=y,I=new u.Y2({discovery:E,config:p});return new A(I,T)}async authorize(y){return(await this.permissionClient.authorize([y],await this.identityApi.getCredentials()))[0]}}var m=e(49857);function o(f){const y=(0,t.useApi)(l),{data:p,error:E}=(0,m.ZP)(f,async T=>{if((0,u.g2)(T.permission)&&!T.resourceRef)return u.rG.DENY;const{result:I}=await y.authorize(T);return I});return E?{error:E,loading:!1,allowed:!1}:p===void 0?{loading:!0,allowed:!1}:{loading:!1,allowed:p===u.rG.ALLOW}}const c=f=>{const{permission:y,resourceRef:p,errorComponent:E,...T}=f,I=usePermission(isResourcePermission(y)?{permission:y,resourceRef:p}:{permission:y}),B=useApp(),{NotFoundErrorPage:j}=B.getComponents();let M=E===void 0?React.createElement(j,null):E;return I.loading?M=null:I.allowed&&(M=f.element),React.createElement(Route,{...T,element:M})}},74450:function(ee,s,e){"use strict";e.d(s,{FA:function(){return o},Nd:function(){return Y},Rx:function(){return L}});var r=e(36964);const t=(0,r.createApiRef)({id:"plugin.search.queryservice"});class l{constructor(me){this.mockedResults=me}query(){return Promise.resolve(this.mockedResults||{results:[]})}}var u=e(2784),A=e(79692);const m=(0,A.Z)(()=>({highlight:{}}),{name:"BackstageHighlightedSearchResultText"}),o=({text:oe,preTag:me,postTag:tt})=>{const Ge=m(),Ne=(0,u.useMemo)(()=>oe.split(new RegExp(`(${me}.+?${tt})`)),[tt,me,oe]);return u.createElement(u.Fragment,null,Ne.map((ct,Q)=>ct.includes(me)?u.createElement("mark",{className:Ge.highlight,key:Q},ct.replace(new RegExp(`${me}|${tt}`,"g"),"")):ct))};var c=e(42494),f=e(84899),y=e(5806),p=e(21324),E=e(56939),T=e(73698),I=e(12231),B=e(76241),j=e(64279),M=e(1849);const b=(0,B.CT)("search-context"),L=()=>{const oe=(0,u.useContext)(b);if(!oe)throw new Error("useSearch must be used within a SearchContextProvider");const me=oe.atVersion(1);if(!me)throw new Error("No SearchContext v1 found");return me},D=()=>useContext(b)!==void 0,U={term:"",pageCursor:void 0,filters:{},types:[]},Y=oe=>{var Lt,Rt,Nt,Zt;const{initialState:me=U,children:tt}=oe,Ge=(0,r.useApi)(t),[Ne,ct]=(0,u.useState)(me.pageCursor),[Q,Z]=(0,u.useState)(me.filters),[X,se]=(0,u.useState)(me.term),[le,be]=(0,u.useState)(me.types),Oe=(0,M.Z)(X),Ae=(0,j.default)(()=>Ge.query({term:X,filters:Q,pageCursor:Ne,types:le}),[X,Q,le,Ne]),Ke=!Ae.loading&&!Ae.error&&((Lt=Ae.value)==null?void 0:Lt.nextPageCursor),ke=!Ae.loading&&!Ae.error&&((Rt=Ae.value)==null?void 0:Rt.previousPageCursor),Et=(0,u.useCallback)(()=>{var vt;ct((vt=Ae.value)==null?void 0:vt.nextPageCursor)},[(Nt=Ae.value)==null?void 0:Nt.nextPageCursor]),It=(0,u.useCallback)(()=>{var vt;ct((vt=Ae.value)==null?void 0:vt.previousPageCursor)},[(Zt=Ae.value)==null?void 0:Zt.previousPageCursor]);(0,u.useEffect)(()=>{X&&Oe&&X!==Oe&&ct(void 0)},[X,Oe,me.pageCursor]);const lt={result:Ae,filters:Q,setFilters:Z,term:X,setTerm:se,types:le,setTypes:be,pageCursor:Ne,setPageCursor:ct,fetchNextPage:Ke?Et:void 0,fetchPreviousPage:ke?It:void 0},Tt=(0,B.EI)({1:lt});return u.createElement(r.AnalyticsContext,{attributes:{searchTypes:le.sort().join(",")}},u.createElement(b.Provider,{value:Tt,children:tt}))};var te=e(86619),ue=e(7089),Re=e(88013),we=e(69294),ge=e(48760);const ze=(oe,me,tt=[],Ge=250)=>{const Ne=(0,u.useRef)({}),ct=oe||(()=>Promise.resolve([])),[Q,Z]=(0,we.default)(ct,[me],{loading:!0});if((0,ge.Z)(()=>{Ne.current[me]===void 0&&(Ne.current[me]=Z(me).then(se=>(Ne.current[me]=se,se)))},Ge,[Z,me]),tt.length)return{loading:!1,value:tt};const X=Ne.current[me];return Array.isArray(X)?{loading:!1,value:X}:Q},_e=(oe,me)=>{const{setFilters:tt}=L();(0,u.useEffect)(()=>{me&&[me].flat().length>0&&tt(Ge=>({...Ge,[oe]:me}))},[])},et=oe=>{const{className:me,defaultValue:tt,name:Ge,values:Ne,valuesDebounceMs:ct,label:Q,filterSelectedOptions:Z,limitTags:X,multiple:se}=oe,[le,be]=(0,u.useState)("");_e(Ge,tt);const Oe=typeof Ne=="function"?Ne:void 0,Ae=typeof Ne=="function"?void 0:Ne,{value:Ke,loading:ke}=ze(Oe,le,Ae,ct),{filters:Et,setFilters:It}=L(),lt=Et[Ge]||(se?[]:null),Tt=(Nt,Zt)=>{It(vt=>{const{[Ge]:at,...zt}=vt;return Zt?{...zt,[Ge]:Zt}:{...zt}})},Lt=Nt=>u.createElement(te.Z,{...Nt,name:"search",variant:"outlined",label:Q,fullWidth:!0}),Rt=(Nt,Zt)=>Nt.map((vt,at)=>u.createElement(ue.Z,{label:vt,color:"primary",...Zt({index:at})}));return u.createElement(Re.ZP,{filterSelectedOptions:Z,limitTags:X,multiple:se,className:me,id:`${se?"multi-":""}select-filter-${Ge}--select`,options:Ke||[],loading:ke,value:lt,onChange:Tt,onInputChange:(Nt,Zt)=>be(Zt),renderInput:Lt,renderTags:Rt})},st=(0,A.Z)({label:{textTransform:"capitalize"}}),Ct=oe=>{const{className:me,defaultValue:tt,label:Ge,name:Ne,values:ct=[],valuesDebounceMs:Q}=oe,Z=st(),{filters:X,setFilters:se}=L();_e(Ne,tt);const le=typeof ct=="function"?ct:void 0,be=typeof ct=="function"?void 0:ct,{value:Oe=[],loading:Ae}=ze(le,"",be,Q),Ke=ke=>{const{target:{value:Et,checked:It}}=ke;se(lt=>{const{[Ne]:Tt,...Lt}=lt,Rt=(Tt||[]).filter(Zt=>Zt!==Et),Nt=It?[...Rt,Et]:Rt;return Nt.length?{...Lt,[Ne]:Nt}:Lt})};return u.createElement(c.Z,{className:me,disabled:Ae,fullWidth:!0,"data-testid":"search-checkboxfilter-next"},Ge?u.createElement(f.Z,{className:Z.label},Ge):null,Oe.map(ke=>{var Et;return u.createElement(y.Z,{key:ke,control:u.createElement(p.Z,{color:"primary",tabIndex:-1,inputProps:{"aria-labelledby":ke},value:ke,name:ke,onChange:Ke,checked:((Et=X[Ne])!=null?Et:[]).includes(ke)}),label:ke})}))},pt=oe=>{const{className:me,defaultValue:tt,label:Ge,name:Ne,values:ct,valuesDebounceMs:Q}=oe,Z=st();_e(Ne,tt);const X=typeof ct=="function"?ct:void 0,se=typeof ct=="function"?void 0:ct,{value:le=[],loading:be}=ze(X,"",se,Q),{filters:Oe,setFilters:Ae}=L(),Ke=ke=>{const{target:{value:Et}}=ke;Ae(It=>{const{[Ne]:lt,...Tt}=It;return Et?{...Tt,[Ne]:Et}:Tt})};return u.createElement(c.Z,{disabled:be,className:me,variant:"filled",fullWidth:!0,"data-testid":"search-selectfilter-next"},Ge?u.createElement(E.Z,{className:Z.label,margin:"dense"},Ge):null,u.createElement(T.Z,{variant:"outlined",value:Oe[Ne]||"",onChange:Ke},u.createElement(I.Z,{value:""},u.createElement("em",null,"All")),le.map(ke=>u.createElement(I.Z,{key:ke,value:ke},ke))))},Pe=({component:oe,...me})=>u.createElement(oe,{...me});Pe.Checkbox=oe=>u.createElement(Pe,{...oe,component:Ct}),Pe.Select=oe=>u.createElement(Pe,{...oe,component:pt}),Pe.Autocomplete=oe=>u.createElement(Pe,{...oe,component:et});var ht=e(82339);const je=({children:oe})=>{const{result:{loading:me,error:tt,value:Ge}}=useSearch();return me?React.createElement(Progress,null):tt?React.createElement(ResponseErrorPanel,{title:"Error encountered while fetching search results",error:tt}):Ge!=null&&Ge.results.length?React.createElement(React.Fragment,null,oe({results:Ge.results})):React.createElement(EmptyState,{missing:"data",title:"Sorry, no results were found"})},ie=oe=>React.createElement(AnalyticsContext,{attributes:{pluginId:"search",extension:"SearchResult"}},React.createElement(je,{...oe})),de=(0,A.Z)(oe=>({root:{display:"flex",justifyContent:"space-between",gap:oe.spacing(2),margin:oe.spacing(2,0)}})),Ue=()=>{const{fetchNextPage:oe,fetchPreviousPage:me}=useSearch(),tt=de();return!oe&&!me?React.createElement(React.Fragment,null):React.createElement("nav",{"arial-label":"pagination navigation",className:tt.root},React.createElement(Button,{"aria-label":"previous page",disabled:!me,onClick:me,startIcon:React.createElement(ArrowBackIosIcon,null)},"Previous"),React.createElement(Button,{"aria-label":"next page",disabled:!oe,onClick:oe,endIcon:React.createElement(ArrowForwardIosIcon,null)},"Next"))},Be=({children:oe})=>{const me=useAnalytics(),{term:tt}=useSearch();return useEffect(()=>{tt&&me.captureEvent("search",tt)},[me,tt]),React.createElement(React.Fragment,null,oe)},Xe=({onChange:oe,onKeyDown:me,onSubmit:tt,debounceTime:Ge=200,clearButton:Ne=!0,fullWidth:ct=!0,value:Q,inputProps:Z={},endAdornment:X,...se})=>{const le=useApi(configApiRef),[be,Oe]=useState(Q),Ae=useSearchContextCheck();useEffect(()=>{Oe(Rt=>Rt!==Q?Q:Rt)},[Q]),useDebounce(()=>oe(be),Ge,[be]);const Ke=useCallback(Rt=>{Oe(Rt.target.value)},[Oe]),ke=useCallback(Rt=>{me&&me(Rt),tt&&Rt.key==="Enter"&&tt()},[me,tt]),Et=useCallback(()=>{oe("")},[oe]),It=`Search in ${le.getOptionalString("app.title")||"Backstage"}`,lt=React.createElement(InputAdornment,{position:"start"},React.createElement(IconButton,{"aria-label":"Query",disabled:!0},React.createElement(SearchIcon,null))),Tt=React.createElement(InputAdornment,{position:"end"},React.createElement(IconButton,{"aria-label":"Clear",onClick:Et},React.createElement(ClearButton,null))),Lt=React.createElement(TrackSearch,null,React.createElement(InputBase,{"data-testid":"search-bar-next",value:be,placeholder:It,startAdornment:lt,endAdornment:Ne?Tt:X,inputProps:{"aria-label":"Search",...Z},fullWidth:ct,onChange:Ke,onKeyDown:ke,...se}));return Ae?Lt:React.createElement(SearchContextProvider,null,Lt)},mt=({onChange:oe,...me})=>{const{term:tt,setTerm:Ge}=useSearch(),Ne=useCallback(ct=>{oe?oe(ct):Ge(ct)},[oe,Ge]);return React.createElement(AnalyticsContext,{attributes:{pluginId:"search",extension:"SearchBar"}},React.createElement(Xe,{value:tt,onChange:Ne,...me}))},Ye=({result:oe,highlight:me,rank:tt,icon:Ge,secondaryAction:Ne,lineClamp:ct=5})=>{const Q=useAnalytics(),Z=()=>{Q.captureEvent("discover",oe.title,{attributes:{to:oe.location},value:tt})};return React.createElement(Link,{noTrack:!0,to:oe.location,onClick:Z},React.createElement(ListItem,{alignItems:"center"},Ge&&React.createElement(ListItemIcon,null,Ge),React.createElement(ListItemText,{primaryTypographyProps:{variant:"h6"},primary:me!=null&&me.fields.title?React.createElement(HighlightedSearchResultText,{text:me.fields.title,preTag:me.preTag,postTag:me.postTag}):oe.title,secondary:React.createElement("span",{style:{display:"-webkit-box",WebkitBoxOrient:"vertical",WebkitLineClamp:ct,overflow:"hidden"}},me!=null&&me.fields.text?React.createElement(HighlightedSearchResultText,{text:me.fields.text,preTag:me.preTag,postTag:me.postTag}):oe.text)}),Ne&&React.createElement(Box,{alignItems:"flex-end"},Ne)),React.createElement(Divider,null))},yt=oe=>React.createElement(AnalyticsContext,{attributes:{pluginId:"search",extension:"DefaultResultListItem"}},React.createElement(Ye,{...oe}))},26136:function(ee,s,e){"use strict";e.d(s,{Ox:function(){return ze},Zz:function(){return A},oZ:function(){return te},DR:function(){return m},ZS:function(){return U},VA:function(){return st},KY:function(){return c},gT:function(){return T},Dl:function(){return I},ux:function(){return et},$L:function(){return E},x1:function(){return Y}});var r=e(2784),t=e(10289),l=e(36964);const u="techdocs.addons.addon.v1",A="techdocs.addons.wrapper.v1",m=()=>null;(0,l.attachComponentData)(m,A,!0);const o=ie=>`${u}.${ie.toLocaleLowerCase("en-US")}`;function c(ie){const{name:de,component:Ue}=ie;return(0,l.createReactExtension)({name:de,component:{sync:Be=>r.createElement(Ue,{...Be})},data:{[u]:ie,[o(de)]:!0}})}const f=(ie,de)=>ie.selectByComponentData({key:de}).getElements()[0],y=ie=>ie.selectByComponentData({key:A}).selectByComponentData({key:u}),p=ie=>ie.selectByComponentData({key:A}).findComponentData({key:u}),E=()=>{const ie=(0,t.pC)(),de=(0,l.useElementFilter)(ie,y),Ue=(0,l.useElementFilter)(ie,p),Be=(0,r.useCallback)(Ye=>{var oe;if(!de||!Ye)return null;const yt=o(Ye.name);return(oe=f(de,yt))!=null?oe:null},[de]),Xe=(0,r.useCallback)(Ye=>{const yt=Ue.find(oe=>oe.name===Ye);return yt?Be(yt):null},[Ue,Be]),mt=(0,r.useCallback)(Ye=>{const yt=Ue.filter(oe=>oe.location===Ye);return yt.length?yt.map(Be):null},[Ue,Be]);return{renderComponentByName:Xe,renderComponentsByLocation:mt}},T=(0,l.createApiRef)({id:"plugin.techdocs.service"}),I=(0,l.createApiRef)({id:"plugin.techdocs.storageservice"});var B=e(64279),j=e(48023),M=e(76241);const b=(ie,de)=>(0,j.eE)(ie)===(0,j.eE)(de),L={title:"",subtitle:"",setTitle:()=>{},setSubtitle:()=>{},setShadowRoot:()=>{},metadata:{loading:!0},entityMetadata:{loading:!0},entityRef:{kind:"",name:"",namespace:""}},D=(0,M.CT)("techdocs-reader-page-context"),U=(0,r.memo)(({entityRef:ie,children:de})=>{const Ue=(0,l.useApi)(T),Be=(0,B.default)(async()=>Ue.getTechDocsMetadata(ie),[ie]),Xe=(0,B.default)(async()=>Ue.getEntityMetadata(ie),[ie]),[mt,Ye]=(0,r.useState)(L.title),[yt,oe]=(0,r.useState)(L.subtitle),[me,tt]=(0,r.useState)(L.shadowRoot),Ge={metadata:Be,entityRef:ie,entityMetadata:Xe,shadowRoot:me,setShadowRoot:tt,title:mt,setTitle:Ye,subtitle:yt,setSubtitle:oe},Ne=(0,M.EI)({1:Ge});return r.createElement(D.Provider,{value:Ne},de instanceof Function?de(Ge):de)},(ie,de)=>b(ie.entityRef,de.entityRef)),Y=()=>{const ie=(0,r.useContext)(D);if(ie===void 0)return L;const de=ie.atVersion(1);if(de===void 0)throw new Error("No context found for version 1.");return de},te=Object.freeze({Header:"Header",Subheader:"Subheader",Settings:"Settings",PrimarySidebar:"PrimarySidebar",SecondarySidebar:"SecondarySidebar",Content:"Content"});var ue=e(6553),Re=e(50236),we=e(19219),ge=e(82339);const ze="TECH_DOCS_SHADOW_DOM_STYLE_LOAD",_e=ie=>{(0,r.useEffect)(()=>{var mt;if(!ie)return()=>{};const de=ie.querySelectorAll('head > link[rel="stylesheet"]');let Ue=(mt=de==null?void 0:de.length)!=null?mt:0;const Be=new CustomEvent(ze);if(!Ue)return ie.dispatchEvent(Be),()=>{};const Xe=()=>{--Ue===0&&ie.dispatchEvent(Be)};return de==null||de.forEach(Ye=>{Ye.addEventListener("load",Xe)}),()=>{de==null||de.forEach(Ye=>{Ye.removeEventListener("load",Xe)})}},[ie])},et=ie=>{const[de,Ue]=(0,r.useState)(!1);return(0,r.useEffect)(()=>{if(!ie)return()=>{};Ue(!0);const Be=ie.style;Be.setProperty("opacity","0");const Xe=()=>{Ue(!1),Be.setProperty("opacity","1")};return ie.addEventListener(ze,Xe),()=>{ie.removeEventListener(ze,Xe)}},[ie]),de},st=({element:ie,onAppend:de,children:Ue})=>{const[Be,Xe]=(0,r.useState)((0,ue.Ue)({...(0,Re.Z)(),insertionPoint:void 0}));_e(ie);const mt=et(ie),Ye=(0,r.useCallback)(yt=>{if(!ie||!yt)return;Xe((0,ue.Ue)({...(0,Re.Z)(),insertionPoint:ie.querySelector("head")||void 0}));let oe=yt.shadowRoot;oe||(oe=yt.attachShadow({mode:"open"})),oe.replaceChildren(ie),typeof de=="function"&&de(oe)},[ie,de]);return r.createElement(r.Fragment,null,mt&&r.createElement(ge.Progress,null),r.createElement(we.ZP,{jss:Be,sheetsManager:new Map},r.createElement("div",{ref:Ye,"data-testid":"techdocs-native-shadowroot"}),Ue))};var Ct=e(54073);const pt=()=>{const{shadowRoot:ie}=useTechDocsReaderPage();return ie},Pe=ie=>{const de=pt();return de?ie.map(Ue=>de==null?void 0:de.querySelectorAll(Ue)).filter(Ue=>Ue.length).map(Ue=>Array.from(Ue)).flat():[]},ht=ie=>ie.toString()&&ie.rangeCount&&ie.getRangeAt(0).getBoundingClientRect().top,je=(ie=0)=>{const de=pt(),[Ue,Be]=useState(null),Xe=useMemo(()=>debounce(()=>{const mt=de,Ye=mt.getSelection?mt.getSelection():document.getSelection();Ye&&ht(Ye)?Be(Ye):Be(null)},ie),[de,Be,ie]);return useEffect(()=>(window.document.addEventListener("selectionchange",Xe),()=>window.document.removeEventListener("selectionchange",Xe)),[Xe]),Ue}},94067:function(ee,s,e){"use strict";e.r(s),e.d(s,{EmbeddedDocsRouter:function(){return B},Router:function(){return I},isTechDocsAvailable:function(){return T}});var r=e(2784),t=e(10289),l=e(53479),u=e(82339),A=e(48023),m=e(20961),o=e(16172),c=e(63126);const f=({entity:j})=>{const M=(0,A.iB)(j);return r.createElement(m.I6,{entityRef:M},r.createElement(o.b,null),r.createElement(c.F,{withSearch:!1}))};var y=e(50021),p=e(26220);const E="backstage.io/techdocs-ref",T=j=>{var M,b;return Boolean((b=(M=j==null?void 0:j.metadata)==null?void 0:M.annotations)==null?void 0:b[E])},I=()=>r.createElement(t.Z5,null,r.createElement(t.AW,{path:"/",element:r.createElement(y.TechDocsIndexPage,null)}),r.createElement(t.AW,{path:"/:namespace/:kind/:name/*",element:r.createElement(p.TechDocsReaderPage,null)})),B=j=>{var U;const{children:M}=j,{entity:b}=(0,l.useEntity)(),L=(0,t.V$)([{path:"/*",element:r.createElement(f,{entity:b}),children:[{path:"/*",element:M}]}]);return((U=b.metadata.annotations)==null?void 0:U[E])?L:r.createElement(u.MissingAnnotationEmptyState,{annotation:E})}},3337:function(ee,s,e){"use strict";var r=e(36964);const t=(0,r.createApiRef)({id:"plugin.techdocs.storageservice"}),l=(0,r.createApiRef)({id:"plugin.techdocs.service"})},42723:function(ee,s,e){"use strict";e.d(s,{k:function(){return A},p:function(){return u}});var r=e(10179),t=e(76372),l=e.n(t);class u{constructor(o){q(this,"configApi");q(this,"discoveryApi");q(this,"fetchApi");this.configApi=o.configApi,this.discoveryApi=o.discoveryApi,this.fetchApi=o.fetchApi}async getApiOrigin(){return await this.discoveryApi.getBaseUrl("techdocs")}async getTechDocsMetadata(o){const{kind:c,namespace:f,name:y}=o,E=`${await this.getApiOrigin()}/metadata/techdocs/${f}/${c}/${y}`,T=await this.fetchApi.fetch(`${E}`);if(!T.ok)throw await r.VL.fromResponse(T);return await T.json()}async getEntityMetadata(o){const{kind:c,namespace:f,name:y}=o,E=`${await this.getApiOrigin()}/metadata/entity/${f}/${c}/${y}`,T=await this.fetchApi.fetch(`${E}`);if(!T.ok)throw await r.VL.fromResponse(T);return await T.json()}}class A{constructor(o){q(this,"configApi");q(this,"discoveryApi");q(this,"identityApi");q(this,"fetchApi");this.configApi=o.configApi,this.discoveryApi=o.discoveryApi,this.identityApi=o.identityApi,this.fetchApi=o.fetchApi}async getApiOrigin(){return await this.discoveryApi.getBaseUrl("techdocs")}async getStorageUrl(){var o;return(o=this.configApi.getOptionalString("techdocs.storageUrl"))!=null?o:`${await this.discoveryApi.getBaseUrl("techdocs")}/static/docs`}async getBuilder(){return this.configApi.getString("techdocs.builder")}async getEntityDocs(o,c){const{kind:f,namespace:y,name:p}=o,T=`${await this.getStorageUrl()}/${y}/${f}/${p}/${c}`,I=await this.fetchApi.fetch(`${T.endsWith("/")?T:`${T}/`}index.html`);let B="";switch(I.status){case 404:throw B="Page not found. ",c||(B+="This could be because there is no index.md file in the root of the docs directory of this repository."),new r.dR(B);case 500:throw B="Could not generate documentation or an error in the TechDocs backend. ",new Error(B);default:break}return I.text()}async syncEntityDocs(o,c=()=>{}){const{kind:f,namespace:y,name:p}=o,T=`${await this.getApiOrigin()}/sync/${y}/${f}/${p}`,{token:I}=await this.identityApi.getCredentials();return new Promise((B,j)=>{const M=new t.EventSourcePolyfill(T,{withCredentials:!0,headers:I?{Authorization:`Bearer ${I}`}:{}});M.addEventListener("log",b=>{b.data&&c(JSON.parse(b.data))}),M.addEventListener("finish",b=>{let L=!1;b.data&&({updated:L}=JSON.parse(b.data)),B(L?"updated":"cached")}),M.onerror=b=>{switch(M.close(),b.status){case 404:j(new r.dR(b.message));return;default:j(new Error(b.data));return}}})}async getBaseUrl(o,c,f){const{kind:y,namespace:p,name:E}=c,I=`${await this.getApiOrigin()}/static/docs/${p}/${y}/${E}/${f}`;return new URL(o,I.endsWith("/")?I:`${I}/`).toString()}}},97589:function(ee,s,e){"use strict";e.d(s,{D:function(){return r}});function r(t,l){return l.getOptionalBoolean("techdocs.legacyUseCaseSensitiveTripletPaths")?t:t.toLocaleLowerCase("en-US")}},2546:function(ee,s,e){"use strict";e.d(s,{u:function(){return o}});var r=e(2784),t=e(82339),l=e(53479),u=e(1114),A=e(70335),m=e(21956);const o=c=>{const{initialFilter:f="all",columns:y,actions:p}=c;return r.createElement(u.j,null,r.createElement(t.Content,null,r.createElement(t.ContentHeader,{title:""},r.createElement(t.SupportButton,null,"Discover documentation in your ecosystem.")),r.createElement(l.EntityListProvider,null,r.createElement(l.CatalogFilterLayout,null,r.createElement(l.CatalogFilterLayout.Filters,null,r.createElement(A.f,null),r.createElement(l.UserListPicker,{initialFilter:f}),r.createElement(l.EntityOwnerPicker,null),r.createElement(l.EntityTagPicker,null)),r.createElement(l.CatalogFilterLayout.Content,null,r.createElement(m.EntityListDocsTable,{actions:p,columns:y}))))))}},51016:function(ee,s,e){"use strict";e.d(s,{f:function(){return y}});var r=e(68725),t=e(97589),l=e(36964),u=e(82339),A=e(94339),m=e(16111),o=e(24579),c=e(14503),f=e(2784);const y=T=>{const{entities:I}=T,B=(0,l.useRouteRef)(r.Fw),j=(0,l.useApi)(l.configApiRef);return I?f.createElement(u.ItemCardGrid,{"data-testid":"docs-explore"},I!=null&&I.length?I.map((M,b)=>{var L,D;return f.createElement(A.Z,{key:b},f.createElement(m.Z,null,f.createElement(u.ItemCardHeader,{title:(L=M.metadata.title)!=null?L:M.metadata.name})),f.createElement(o.Z,null,M.metadata.description),f.createElement(c.Z,null,f.createElement(u.Button,{to:B({namespace:(0,t.D)((D=M.metadata.namespace)!=null?D:"default",j),kind:(0,t.D)(M.kind,j),name:(0,t.D)(M.metadata.name,j)}),color:"primary","data-testid":"read_docs"},"Read Docs")))}):null):null};var p=e(53479);const E=()=>{const{loading:T,error:I,entities:B}=useEntityList();return I?React.createElement(WarningPanel,{severity:"error",title:"Could not load available documentation."},React.createElement(CodeSnippet,{language:"text",text:I.toString()})):T||!B?React.createElement(Progress,null):(B.sort((j,M)=>{var b,L;return((b=j.metadata.title)!=null?b:j.metadata.name).localeCompare((L=M.metadata.title)!=null?L:M.metadata.name)}),React.createElement(DocsCardGrid,{entities:B}))}},38634:function(ee,s,e){"use strict";e.d(s,{H:function(){return p}});var r=e(2784),t=e(95074),l=e(36964),u=e(48023),A=e(53479),m=e(68725),o=e(82339),c=e(98095),f=e(3792),y=e(97589);const p=E=>{const{entities:T,title:I,loading:B,columns:j,actions:M}=E,[,b]=(0,t.Z)(),L=(0,l.useRouteRef)(m.Fw),D=(0,l.useApi)(l.configApiRef);if(!T)return null;const U=T.map(ue=>{var we;const Re=(0,A.getEntityRelations)(ue,u.S4);return{entity:ue,resolved:{docsUrl:L({namespace:(0,y.D)((we=ue.metadata.namespace)!=null?we:"default",D),kind:(0,y.D)(ue.kind,D),name:(0,y.D)(ue.metadata.name,D)}),ownedByRelations:Re,ownedByRelationsTitle:Re.map(ge=>(0,A.humanizeEntityRef)(ge,{defaultKind:"group"})).join(", ")}}}),Y=[f.N.createNameColumn(),f.N.createOwnerColumn(),f.N.createTypeColumn()],te=[c.n.createCopyDocsUrlAction(b)];return r.createElement(r.Fragment,null,B||U&&U.length>0?r.createElement(o.Table,{isLoading:B,options:{paging:!0,pageSize:20,search:!0,actionsColumnIndex:-1},data:U,columns:j||Y,actions:M||te,title:I?`${I} (${U.length})`:`All (${U.length})`}):r.createElement(o.EmptyState,{missing:"data",title:"No documents to show",description:"Create your own document. Check out our Getting Started Information",action:r.createElement(o.Button,{color:"primary",to:"https://backstage.io/docs/features/techdocs/getting-started",variant:"contained"},"DOCS")}))};p.columns=f.N,p.actions=c.n},12481:function(ee,s,e){"use strict";e.d(s,{n:function(){return y}});var r=e(2784),t=e(95074),l=e(76635),u=e.n(l),A=e(82339),m=e(53479),o=e(38634),c=e(98095),f=e(3792);const y=p=>{var te,ue;const{columns:E,actions:T}=p,{loading:I,error:B,entities:j,filters:M}=(0,m.useEntityList)(),{isStarredEntity:b,toggleStarredEntity:L}=(0,m.useStarredEntities)(),[,D]=(0,t.Z)(),U=(0,l.capitalize)((ue=(te=M.user)==null?void 0:te.value)!=null?ue:"all"),Y=[c.n.createCopyDocsUrlAction(D),c.n.createStarEntityAction(b,L)];return B?r.createElement(A.WarningPanel,{severity:"error",title:"Could not load available documentation."},r.createElement(A.CodeSnippet,{language:"text",text:B.toString()})):r.createElement(o.H,{title:U,entities:j,loading:I,actions:T||Y,columns:E})};y.columns=f.N,y.actions=c.n},98095:function(ee,s,e){"use strict";e.d(s,{n:function(){return o}});var r=e(2784),t=e(39981),l=e(2337),u=e(11640),A=e(28347);const m=(0,l.Z)({root:{color:"#f3ba37"}})(u.Z),o={createCopyDocsUrlAction(c){return f=>({icon:()=>r.createElement(t.Z,{fontSize:"small"}),tooltip:"Click to copy documentation link to clipboard",onClick:()=>c(`${window.location.origin}${f.resolved.docsUrl}`)})},createStarEntityAction(c,f){return({entity:y})=>{const p=c(y);return{cellStyle:{paddingLeft:"1em"},icon:()=>p?r.createElement(m,null):r.createElement(A.Z,null),tooltip:p?"Remove from favorites":"Add to favorites",onClick:()=>f(y)}}}}},3792:function(ee,s,e){"use strict";e.d(s,{N:function(){return A}});var r=e(2784),t=e(82339),l=e(53479);function u(m){return m.metadata.title||m.metadata.name}const A={createNameColumn(){return{title:"Document",field:"entity.metadata.name",highlight:!0,render:m=>r.createElement(t.SubvalueCell,{value:r.createElement(t.Link,{to:m.resolved.docsUrl},u(m.entity)),subvalue:m.entity.metadata.description})}},createOwnerColumn(){return{title:"Owner",field:"resolved.ownedByRelationsTitle",render:({resolved:m})=>r.createElement(l.EntityRefLinks,{entityRefs:m.ownedByRelations,defaultKind:"group"})}},createTypeColumn(){return{title:"Type",field:"entity.spec.type"}}}},21956:function(ee,s,e){"use strict";e.d(s,{DocsTable:function(){return t.H},EntityListDocsTable:function(){return r.n}});var r=e(12481),t=e(38634),l=e(72580),u=e.n(l);e.o(l,"DefaultTechDocsHome")&&e.d(s,{DefaultTechDocsHome:function(){return l.DefaultTechDocsHome}})},72580:function(){},50021:function(ee,s,e){"use strict";e.r(s),e.d(s,{TechDocsIndexPage:function(){return u}});var r=e(2784),t=e(10289),l=e(2546);const u=()=>(0,t.pC)()||r.createElement(l.u,null)},1114:function(ee,s,e){"use strict";e.d(s,{j:function(){return u}});var r=e(2784),t=e(82339),l=e(36964);const u=A=>{var f;const{children:m}=A,c=`Documentation available in ${(f=(0,l.useApi)(l.configApiRef).getOptionalString("organization.name"))!=null?f:"Backstage"}`;return r.createElement(t.PageWithHeader,{title:"Documentation",subtitle:c,themeId:"documentation"},m)}},70335:function(ee,s,e){"use strict";e.d(s,{f:function(){return u}});var r=e(2784),t=e(53479);class l{getCatalogFilters(){return{"metadata.annotations.backstage.io/techdocs-ref":t.CATALOG_FILTER_EXISTS}}}const u=()=>{const{updateFilters:A}=(0,t.useEntityList)();return(0,r.useEffect)(()=>{A({techdocs:new l})},[A]),null}},19192:function(ee,s,e){"use strict";e.d(s,{DefaultTechDocsHome:function(){return l.u}});var r=e(51016),t=e(21956),l=e(2546),u=e(1114),A=e(70335)},82250:function(ee,s,e){"use strict";e.d(s,{DefaultTechDocsHome:function(){return o.DefaultTechDocsHome},TechDocsIndexPage:function(){return c.Jl},TechDocsReaderPage:function(){return c.I6},TechDocsReaderPageContent:function(){return A.Fq},TechDocsReaderPageHeader:function(){return A.SE},plugin:function(){return c.s4},techdocsPlugin:function(){return c.s4}});var r=e(98157),t=e.n(r);e.o(r,"DefaultTechDocsHome")&&e.d(s,{DefaultTechDocsHome:function(){return r.DefaultTechDocsHome}}),e.o(r,"TechDocsReaderPageContent")&&e.d(s,{TechDocsReaderPageContent:function(){return r.TechDocsReaderPageContent}}),e.o(r,"TechDocsReaderPageHeader")&&e.d(s,{TechDocsReaderPageHeader:function(){return r.TechDocsReaderPageHeader}});var l=e(3337),u=e(42723),A=e(96393),m=e(47861),o=e(19192),c=e(20961),f=e(94067)},20961:function(ee,s,e){"use strict";e.d(s,{I6:function(){return y},Jl:function(){return f},s4:function(){return A}});var r=e(26136),t=e(42723),l=e(68725),u=e(36964);const A=(0,u.createPlugin)({id:"techdocs",apis:[(0,u.createApiFactory)({api:r.Dl,deps:{configApi:u.configApiRef,discoveryApi:u.discoveryApiRef,identityApi:u.identityApiRef,fetchApi:u.fetchApiRef},factory:({configApi:p,discoveryApi:E,identityApi:T,fetchApi:I})=>new t.k({configApi:p,discoveryApi:E,identityApi:T,fetchApi:I})}),(0,u.createApiFactory)({api:r.gT,deps:{configApi:u.configApiRef,discoveryApi:u.discoveryApiRef,fetchApi:u.fetchApiRef},factory:({configApi:p,discoveryApi:E,fetchApi:T})=>new t.p({configApi:p,discoveryApi:E,fetchApi:T})})],routes:{root:l._Z,docRoot:l.Fw,entityContent:l.pd}}),m=A.provide((0,u.createRoutableExtension)({name:"TechdocsPage",component:()=>Promise.resolve().then(e.bind(e,94067)).then(p=>p.Router),mountPoint:l._Z})),o=A.provide((0,u.createRoutableExtension)({name:"EntityTechdocsContent",component:()=>Promise.resolve().then(e.bind(e,94067)).then(p=>p.EmbeddedDocsRouter),mountPoint:l.pd})),c=A.provide((0,u.createRoutableExtension)({name:"TechDocsCustomHome",component:()=>e.e(7110).then(e.bind(e,57110)).then(p=>p.TechDocsCustomHome),mountPoint:l._Z})),f=A.provide((0,u.createRoutableExtension)({name:"TechDocsIndexPage",component:()=>Promise.resolve().then(e.bind(e,50021)).then(p=>p.TechDocsIndexPage),mountPoint:l._Z})),y=A.provide((0,u.createRoutableExtension)({name:"TechDocsReaderPage",component:()=>Promise.resolve().then(e.bind(e,26220)).then(p=>p.TechDocsReaderPage),mountPoint:l.Fw}))},26220:function(ee,s,e){"use strict";e.r(s),e.d(s,{TechDocsReaderLayout:function(){return c},TechDocsReaderPage:function(){return f}});var r=e(2784),t=e(10289),l=e(82339),u=e(26136),A=e(63126),m=e(99954),o=e(16172);const c=({withSearch:y,withHeader:p=!0})=>r.createElement(l.Page,{themeId:"documentation"},p&&r.createElement(m.S,null),r.createElement(o.b,null),r.createElement(A.F,{withSearch:y})),f=y=>{const{kind:p,name:E,namespace:T}=(0,t.UO)(),{children:I,entityRef:B={kind:p,name:E,namespace:T}}=y,j=(0,t.pC)();if(!I){const b=(j?r.Children.toArray(j.props.children):[]).find(L=>{var U,Y;const{type:D}=L;return!((Y=(U=D==null?void 0:D.__backstage_data)==null?void 0:U.map)!=null&&Y.get(u.Zz))});return r.createElement(u.ZS,{entityRef:B},b||r.createElement(c,null))}return r.createElement(u.ZS,{entityRef:B},({metadata:M,entityMetadata:b,onReady:L})=>r.createElement(l.Page,{themeId:"documentation"},I instanceof Function?I({entityRef:B,techdocsMetadataValue:M.value,entityMetadataValue:b.value,onReady:L}):I))}},63126:function(ee,s,e){"use strict";e.d(s,{F:function(){return xt}});var r=e(2784),t=e(79692),l=e(60905),u=e(26136),A=e(82339),m=e(47861),o=e(4614),c=e(77277),f=e(99688),y=e(12420),p=e(90436),E=e(61837),T=e(4190),I=e(87685);const B=(0,t.Z)(x=>(0,y.Z)({paper:{width:"100%",[x.breakpoints.up("sm")]:{width:"75%"},[x.breakpoints.up("md")]:{width:"50%"},padding:x.spacing(2.5)},root:{height:"100%",overflow:"hidden"},logs:{background:x.palette.background.default}})),j=({buildLog:x,onClose:re})=>{const Ee=B(),Te=x.length===0?"Waiting for logs...":x.join(`
|
|
32
|
-
`);return r.createElement(l.Z,{container:!0,direction:"column",className:Ee.root,spacing:0,wrap:"nowrap"},r.createElement(l.Z,{item:!0,container:!0,justifyContent:"space-between",alignItems:"center",spacing:0,wrap:"nowrap"},r.createElement(p.Z,{variant:"h5"},"Build Details"),r.createElement(E.Z,{key:"dismiss",title:"Close the drawer",onClick:re,color:"inherit"},r.createElement(I.Z,null))),r.createElement(A.LogViewer,{text:Te,classes:{root:Ee.logs}}))},M=({buildLog:x})=>{const re=B(),[Ee,Te]=(0,r.useState)(!1);return r.createElement(r.Fragment,null,r.createElement(c.Z,{color:"inherit",onClick:()=>Te(!0)},"Show Build Logs"),r.createElement(T.ZP,{classes:{paper:re.paper},anchor:"right",open:Ee,onClose:()=>Te(!1)},r.createElement(j,{buildLog:x,onClose:()=>Te(!1)})))};var b=e(36964);const L=({errorMessage:x})=>{const re=(0,b.useApi)(b.configApiRef).getOptionalString("techdocs.builder");let Ee="";return re!=="local"&&(Ee="Note that techdocs.builder is not set to 'local' in your config, which means this Backstage app will not generate docs if they are not found. Make sure the project's docs are generated and published by some external process (e.g. CI/CD pipeline). Or change techdocs.builder to 'local' to generate docs from this Backstage instance."),r.createElement(A.ErrorPage,{status:"404",statusMessage:x||"Documentation not found",additionalInfo:Ee})};var D=e(2263);const U=(0,t.Z)(x=>({root:{marginBottom:x.spacing(2)},message:{wordBreak:"break-word",overflowWrap:"anywhere"}})),Y=()=>{let x=null;const re=U(),{state:Ee,contentReload:Te,contentErrorMessage:Le,syncErrorMessage:Je,buildLog:it}=(0,D.DK)();return Ee==="INITIAL_BUILD"&&(x=r.createElement(f.Z,{classes:{root:re.root},variant:"outlined",severity:"info",icon:r.createElement(o.Z,{size:"24px"}),action:r.createElement(M,{buildLog:it})},"Documentation is accessed for the first time and is being prepared. The subsequent loads are much faster.")),Ee==="CONTENT_STALE_REFRESHING"&&(x=r.createElement(f.Z,{variant:"outlined",severity:"info",icon:r.createElement(o.Z,{size:"24px"}),action:r.createElement(M,{buildLog:it}),classes:{root:re.root}},"A newer version of this documentation is being prepared and will be available shortly.")),Ee==="CONTENT_STALE_READY"&&(x=r.createElement(f.Z,{variant:"outlined",severity:"success",action:r.createElement(c.Z,{color:"inherit",onClick:()=>Te()},"Refresh"),classes:{root:re.root}},"A newer version of this documentation is now available, please refresh to view.")),Ee==="CONTENT_STALE_ERROR"&&(x=r.createElement(f.Z,{variant:"outlined",severity:"error",action:r.createElement(M,{buildLog:it}),classes:{root:re.root,message:re.message}},"Building a newer version of this documentation failed."," ",Je)),Ee==="CONTENT_NOT_FOUND"&&(x=r.createElement(r.Fragment,null,Je&&r.createElement(f.Z,{variant:"outlined",severity:"error",action:r.createElement(M,{buildLog:it}),classes:{root:re.root,message:re.message}},"Building a newer version of this documentation failed."," ",Je),r.createElement(L,{errorMessage:Le}))),x};var te=e(10289),ue=e(60364),Re=e(41156),we=e(36356),ge=e(35368),ze=e.n(ge);const _e=/main\.[A-Fa-f0-9]{8}\.min\.css$/,et=/^https:\/\/fonts\.googleapis\.com/,st=/^https:\/\/fonts\.gstatic\.com/,Ct=x=>x.nodeName==="LINK",
|
|
30
|
+
`},Ur=100,or=10,Nr=(0,m.Z)(n=>({root:{position:"relative",display:"flex",flexFlow:"row nowrap",alignItems:"center"},container:{overflow:"auto",scrollbarWidth:0,"&::-webkit-scrollbar":{display:"none"}},fade:{position:"absolute",width:Ur,height:`calc(100% + ${or}px)`,transition:"opacity 300ms",pointerEvents:"none"},fadeLeft:{left:-or,background:`linear-gradient(90deg, ${vn(n.palette.type)})`},fadeRight:{right:-or,background:`linear-gradient(270deg, ${vn(n.palette.type)})`},fadeHidden:{opacity:0},button:{position:"absolute"},buttonLeft:{left:-n.spacing(2)},buttonRight:{right:-n.spacing(2)}}),{name:"BackstageHorizontalScrollGrid"});function Zr(n){const[[a,i],d]=React.useState([0,0]);return React.useLayoutEffect(()=>{const g=n.current;if(!g){d([0,0]);return}const v=()=>{const O=g.scrollLeft,N=g.scrollWidth-g.offsetWidth-g.scrollLeft;d([O,N])};return v(),g.addEventListener("scroll",v),window.addEventListener("resize",v),()=>{g.removeEventListener("scroll",v),window.removeEventListener("resize",v)}},[n]),[a,i]}function Hn(n,a,i){const[d,g]=React.useState(0);return React.useLayoutEffect(()=>{if(d===0)return;const v=performance.now(),O=requestAnimationFrame(N=>{if(!n.current)return;const G=N-v,H=Math.abs(d)*G/a,_=Math.max(i,H)*Math.sign(d);n.current.scrollBy({left:_});const ve=d-_;Math.sign(d)!==Math.sign(ve)?g(0):g(ve)});return()=>cancelAnimationFrame(O)},[n,d,a,i]),g}function $n(n){const{scrollStep:a=100,scrollSpeed:i=50,minScrollDistance:d=5,children:g,...v}=n,O=Nr(n),N=React.useRef(),[G,H]=Zr(N),ne=Hn(N,i,d),_=ve=>{!N.current||ne(ve?a:-a)};return React.createElement("div",{...v,className:O.root},React.createElement(Grid,{container:!0,direction:"row",wrap:"nowrap",className:O.container,ref:N},g),React.createElement("div",{className:classNames(O.fade,O.fadeLeft,{[O.fadeHidden]:G===0})}),React.createElement("div",{className:classNames(O.fade,O.fadeRight,{[O.fadeHidden]:H===0})}),G>0&&React.createElement(IconButton,{title:"Scroll Left",onClick:()=>_(!1),className:classNames(O.button,O.buttonLeft,{})},React.createElement(ChevronLeftIcon,null)),H>0&&React.createElement(IconButton,{title:"Scroll Right",onClick:()=>_(!0),className:classNames(O.button,O.buttonRight,{})},React.createElement(ChevronRightIcon,null)))}const Jn=(0,m.Z)({alpha:{color:"#ffffff",fontFamily:"serif",fontWeight:"normal",fontStyle:"italic"},beta:{color:"#4d65cc",fontFamily:"serif",fontWeight:"normal",fontStyle:"italic"}},{name:"BackstageLifecycle"});function sr(n){const a=Jn(n),{shorthand:i,alpha:d}=n;return i?React.createElement("span",{className:a[d?"alpha":"beta"],style:{fontSize:"120%"}},d?React.createElement(React.Fragment,null,"\u03B1"):React.createElement(React.Fragment,null,"\u03B2")):React.createElement("span",{className:a[d?"alpha":"beta"]},d?"Alpha":"Beta")}const Rr=(0,t.lazy)(()=>Promise.all([e.e(3860),e.e(8718)]).then(e.bind(e,98718)).then(n=>({default:n.RealLogViewer})));function zr(n){const{Progress:a}=(0,l.useApp)().getComponents();return t.createElement(t.Suspense,{fallback:t.createElement(a,null)},t.createElement(Rr,{...n}))}const Qn=(0,m.Z)(n=>({markdown:{"& table":{borderCollapse:"collapse",border:`1px solid ${n.palette.border}`},"& th, & td":{border:`1px solid ${n.palette.border}`,padding:n.spacing(1)},"& td":{wordBreak:"break-word",overflow:"hidden",verticalAlign:"middle",lineHeight:"1",margin:0,padding:n.spacing(3,2,3,2.5),borderBottom:0},"& th":{backgroundColor:n.palette.background.paper},"& tr":{backgroundColor:n.palette.background.paper},"& tr:nth-child(odd)":{backgroundColor:n.palette.background.default},"& a":{color:n.palette.link},"& img":{maxWidth:"100%"}}}),{name:"BackstageMarkdownContent"}),Sr={code:({inline:n,className:a,children:i,...d})=>{const g=String(i).replace(/\n+$/,""),v=/language-(\w+)/.exec(a||"");return!n&&v?t.createElement(et,{language:v[1],text:g}):t.createElement("code",{className:a,...d},i)}};function Wr(n){const{content:a,dialect:i="gfm",linkTarget:d}=n,g=Qn();return React.createElement(ReactMarkdown,{remarkPlugins:i==="gfm"?[gfm]:[],className:g.markdown,children:a,components:Sr,linkTarget:d})}var er=e(10179);const Pn=(0,m.Z)(n=>({root:{paddingLeft:n.spacing(3)}}),{name:"BackstageLoginRequestListItem"}),tr=({request:n,busy:a,setBusy:i})=>{const d=Pn(),[g,v]=useState(),O=async()=>{i(!0);try{await n.trigger()}catch(G){v(isError(G)?G.message:"An unspecified error occurred")}finally{i(!1)}},N=n.provider.icon;return React.createElement(ListItem,{disabled:a,classes:{root:d.root}},React.createElement(ListItemAvatar,null,React.createElement(N,{fontSize:"large"})),React.createElement(ListItemText,{primary:n.provider.title,secondary:g&&React.createElement(Typography,{color:"error"},g)}),React.createElement(Button,{color:"primary",variant:"contained",onClick:O},"Log in"))};var nr=null;const Cr=(0,m.Z)(n=>({dialog:{paddingTop:n.spacing(1)},title:{minWidth:0},titleHeading:{fontSize:n.typography.h6.fontSize},contentList:{padding:0},actionButtons:{padding:n.spacing(2,0)}}),{name:"OAuthRequestDialog"});function ir(n){const a=Cr(),[i,d]=useState(!1),g=useApi(oauthRequestApiRef),v=useObservable(useMemo(()=>g.authRequest$(),[g]),[]),O=()=>{v.forEach(N=>N.reject())};return React.createElement(Dialog,{open:Boolean(v.length),fullWidth:!0,maxWidth:"xs",classes:{paper:a.dialog},"aria-labelledby":"oauth-req-dialog-title"},React.createElement("main",null,React.createElement(DialogTitle,{classes:{root:a.title},id:"oauth-req-dialog-title"},React.createElement(Typography,{className:a.titleHeading,variant:"h1"},"Login Required")),React.createElement(DialogContent,{dividers:!0,classes:{root:a.contentList}},React.createElement(List,null,v.map(N=>React.createElement(LoginRequestListItem,{key:N.provider.title,request:N,busy:i,setBusy:d}))))),React.createElement(DialogActions,{classes:{root:a.actionButtons}},React.createElement(Button,{onClick:O},"Reject All")))}var lr=e(15277),Tr=e.n(lr),Hr=e(29862);const rr=(0,m.Z)({container:{overflow:"visible !important"}},{name:"BackstageOverflowTooltip"});function br(n){var O;const[a,i]=(0,t.useState)(!1),d=(0,Hr.t)(),g=rr(),v=N=>{d()&&i(N)};return t.createElement(te.ZP,{title:(O=n.title)!=null?O:n.text||"",placement:n.placement,disableHoverListener:!a},t.createElement(Tr(),{text:n.text,line:n.line,onToggled:v,containerClassName:g.container}))}var jr=e(67358);function cr(n){const[a,i]=(0,t.useState)(!1);return(0,t.useEffect)(()=>{const d=setTimeout(()=>i(!0),250);return()=>clearTimeout(d)},[]),a?t.createElement(jr.Z,{...n,"data-testid":"progress"}):t.createElement("div",{style:{display:"none"}})}var Pr=e(94339),ur=e(14503),Ir=e(24579),dr=e(32552),mn=e(15459),Fn=e(95544),Lr=e(27597);const Bn=(0,m.Z)(n=>({root:{maxWidth:"fit-content",padding:n.spacing(2,2,2,2.5)},boxTitle:{margin:0,color:n.palette.textSubtle},arrow:{color:n.palette.textSubtle}}),{name:"BackstageBottomLink"});function fr(n){const{link:a,title:i,onClick:d}=n,g=Bn();return t.createElement("div",null,t.createElement(Tn.Z,null),t.createElement(b,{to:a,onClick:d,underline:"none"},t.createElement(Fn.Z,{display:"flex",alignItems:"center",className:g.root},t.createElement(Fn.Z,{className:g.boxTitle,fontWeight:"fontWeightBold",m:1},t.createElement(at.Z,null,t.createElement("strong",null,i))),t.createElement(Lr.Z,{className:g.arrow}))))}const Vn=n=>{const{slackChannel:a}=n;if(a){if(typeof a=="string")return t.createElement(t.Fragment,null,"Please contact ",a," for help.");if(!a.href)return t.createElement(t.Fragment,null,"Please contact ",a.name," for help.")}else return null;return t.createElement(D,{to:a.href,variant:"contained"},a.name)},Gn=class extends t.Component{constructor(a){super(a),this.state={error:void 0,errorInfo:void 0}}componentDidCatch(a,i){console.error(`ErrorBoundary, error: ${a}, info: ${i}`),this.setState({error:a,errorInfo:i})}render(){const{slackChannel:a,children:i}=this.props,{error:d}=this.state;return d?t.createElement(cn,{title:"Something Went Wrong",error:d},t.createElement(Vn,{slackChannel:a})):i}},mr=(0,m.Z)(n=>({noPadding:{padding:0,"&:last-child":{paddingBottom:0}},header:{padding:n.spacing(2,2,2,2.5)},headerTitle:{fontWeight:700},headerSubheader:{paddingTop:n.spacing(1)},headerAvatar:{},headerAction:{},headerContent:{},subheader:{display:"flex"}}),{name:"BackstageInfoCard"}),Or=(0,mn.Z)(n=>({root:{display:"inline-block",padding:n.spacing(8,8,0,0),float:"right"}}),{name:"BackstageInfoCardCardActionsTopRight"})(ur.Z),hr={card:{flex:{display:"flex",flexDirection:"column"},fullHeight:{display:"flex",flexDirection:"column",height:"100%"},gridItem:{display:"flex",flexDirection:"column",height:"calc(100% - 10px)",marginBottom:"10px"}},cardContent:{fullHeight:{flex:1},gridItem:{flex:1}}};function Kn(n){const{title:a,subheader:i,divider:d=!0,deepLink:g,slackChannel:v,errorBoundaryProps:O,variant:N,children:G,headerStyle:H,headerProps:ne,icon:_,action:ve,actionsClassName:Ce,actions:Ie,cardClassName:pt,actionsTopRight:Ut,className:Yt,noPadding:Jt,titleTypographyProps:dt}=n,Gt=mr();let en={},Qt={};N&&N.split(/[\s]+/g).forEach(Mt=>{en={...en,...hr.card[Mt]},Qt={...Qt,...hr.cardContent[Mt]}});const Xn=()=>t.createElement("div",{className:Gt.headerSubheader},i&&t.createElement("div",{className:Gt.subheader},i),_),Nn=O||(v?{slackChannel:v}:{});return t.createElement(Pr.Z,{style:en,className:Yt},t.createElement(Gn,{...Nn},a&&t.createElement(dr.Z,{classes:{root:Gt.header,title:Gt.headerTitle,subheader:Gt.headerSubheader,avatar:Gt.headerAvatar,action:Gt.headerAction,content:Gt.headerContent},title:a,subheader:Xn(),action:ve,style:{...H},titleTypographyProps:dt,...ne}),Ut&&t.createElement(Or,null,Ut),d&&t.createElement(Tn.Z,null),t.createElement(Ir.Z,{className:E()(pt,{[Gt.noPadding]:Jt}),style:Qt},G),Ie&&t.createElement(ur.Z,{className:Ce},Ie),g&&t.createElement(fr,{...g})))}var Vr=e(39307);const Gr=(0,m.Z)(n=>({root:{position:"relative",lineHeight:0},overlay:{position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -60%)",fontSize:45,fontWeight:"bold",color:n.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"}),gr={fractional:!0,inverse:!1,unit:"%",max:100},P=({palette:n,value:a,inverse:i,max:d})=>{if(isNaN(a))return"#ddd";const g=d||gr.max,v=i?g-a:a;return v<g/3?n.status.error:v<g*(2/3)?n.status.warning:n.status.ok};function J(n){const[a,i]=useState(null),{getColor:d=P}=n,g=Gr(n),{palette:v}=useTheme(),{value:O,fractional:N,inverse:G,unit:H,max:ne,description:_}={...gr,...n},ve=N?Math.round(O*ne):O,Ce=ne!==100?Math.round(O):ve,[Ie,pt]=useState(!1);return useEffect(()=>{const Ut=a,Yt=()=>pt(!0),Jt=()=>pt(!1);return Ut&&_?(Ut.addEventListener("mouseenter",Yt),Ut.addEventListener("mouseleave",Jt),()=>{Ut.removeEventListener("mouseenter",Yt),Ut.removeEventListener("mouseleave",Jt)}):()=>{pt(!1)}},[_,a]),React.createElement("div",{ref:i,className:g.root},React.createElement(Circle,{strokeLinecap:"butt",percent:ve,strokeWidth:12,trailWidth:12,strokeColor:d({palette:v,value:Ce,inverse:G,max:ne}),className:g.circle}),_&&Ie?React.createElement("div",{className:g.description},_):React.createElement("div",{className:g.overlay},isNaN(O)?"N/A":`${Ce}${H}`))}const me=(0,m.Z)({root:{height:"100%",width:250}},{name:"BackstageGaugeCard"});function De(n){const a=me(n),{title:i,subheader:d,progress:g,inverse:v,deepLink:O,description:N,icon:G,variant:H,getColor:ne}=n,_={inverse:v,description:N,getColor:ne,value:g};return React.createElement("div",{className:a.root},React.createElement(InfoCard,{title:i,subheader:d,deepLink:O,variant:H,icon:G},React.createElement(Gauge,{..._})))}function Qe(n){const{value:a,getColor:i=getProgressColor}=n,{palette:d}=useTheme();if(isNaN(a))return null;let g=Math.round(a*100*100)/100;g>100&&(g=100);const v=i({palette:d,value:g,inverse:!1,max:100});return React.createElement(Tooltip,{title:`${g}%`},React.createElement("span",null,React.createElement(Line,{percent:g,strokeWidth:4,trailWidth:4,strokeColor:v})))}var At=e(21324),St=e(7089),R=e(1292),C=e(42494),w=e(74603),z=e(56939),k=e(12231),K=e(73698),ce=e(72379);const Se=(0,m.Z)(()=>(0,o.Z)({icon:{position:"absolute",right:"4px",pointerEvents:"none"}}),{name:"BackstageClosedDropdown"});var xe=()=>{const n=Se();return t.createElement(ce.Z,{className:n.icon,fill:"none",xmlns:"http://www.w3.org/2000/svg"},t.createElement("path",{d:"M7.5 8L6 9.5L12.0703 15.5703L18.1406 9.5L16.6406 8L12.0703 12.5703L7.5 8Z",fill:"#616161"}))};const Fe=(0,m.Z)(()=>(0,o.Z)({icon:{position:"absolute",right:"4px",pointerEvents:"none"}}),{name:"BackstageOpenedDropdown"});var Ge=()=>{const n=Fe();return t.createElement(ce.Z,{className:n.icon,fill:"none",xmlns:"http://www.w3.org/2000/svg"},t.createElement("path",{d:"M16.5 16L18 14.5L11.9297 8.42969L5.85938 14.5L7.35938 16L11.9297 11.4297L16.5 16Z",fill:"#616161"}))};const Ot=(0,mn.Z)(n=>(0,o.Z)({root:{"label + &":{marginTop:n.spacing(3)}},input:{borderRadius:4,position:"relative",backgroundColor:n.palette.background.paper,border:"1px solid #ced4da",fontSize:16,padding:"10px 26px 10px 12px",transition:n.transitions.create(["border-color","box-shadow"]),fontFamily:"Helvetica Neue","&:focus":{background:n.palette.background.paper,borderRadius:4}}}),{name:"BackstageSelectInputBase"})(w.Z),nt=(0,m.Z)(n=>(0,o.Z)({formControl:{margin:`${n.spacing(1)} 0px`,maxWidth:300},label:{transform:"initial",fontWeight:"bold",fontSize:14,fontFamily:n.typography.fontFamily,color:n.palette.text.primary,"&.Mui-focused":{color:n.palette.text.primary}},formLabel:{transform:"initial",fontWeight:"bold",fontSize:14,fontFamily:n.typography.fontFamily,color:n.palette.text.primary,"&.Mui-focused":{color:n.palette.text.primary}},chips:{display:"flex",flexWrap:"wrap"},chip:{margin:2},checkbox:{},root:{display:"flex",flexDirection:"column"}}),{name:"BackstageSelect"});function je(n){const{multiple:a,items:i,label:d,placeholder:g,selected:v,onChange:O,triggerReset:N,native:G=!1,disabled:H=!1}=n,ne=nt(),[_,ve]=(0,t.useState)(v||(a?[]:"")),[Ce,Ie]=(0,t.useState)(!1);(0,t.useEffect)(()=>{ve(a?[]:"")},[N,a]),(0,t.useEffect)(()=>{v!==void 0&&ve(v)},[v]);const pt=dt=>{ve(dt.target.value),O(dt.target.value)},Ut=dt=>{if(H){dt.preventDefault();return}Ie(Gt=>a&&!(dt.target instanceof HTMLElement)?!0:!Gt)},Yt=()=>{Ie(!1)},Jt=dt=>()=>{const Gt=_.filter(en=>en!==dt);ve(Gt),O(Gt)};return t.createElement("div",{className:ne.root},t.createElement(R.Z,{onClickAway:Yt},t.createElement(C.Z,{className:ne.formControl},t.createElement(z.Z,{className:ne.formLabel},d),t.createElement(K.Z,{"aria-label":d,value:_,native:G,disabled:H,"data-testid":"select",displayEmpty:!0,multiple:a,onChange:pt,onClick:Ut,open:Ce,input:t.createElement(Ot,null),label:d,tabIndex:0,renderValue:dt=>{var Gt;return a&&_.length!==0?t.createElement("div",{className:ne.chips},dt.map(en=>{var Qt,Xn;return t.createElement(St.Z,{key:(Qt=i.find(Nn=>Nn.value===en))==null?void 0:Qt.value,label:(Xn=i.find(Nn=>Nn.value===en))==null?void 0:Xn.label,clickable:!0,onDelete:Jt(en),className:ne.chip})})):t.createElement(at.Z,null,_.length===0?g||"":(Gt=i.find(en=>en.value===dt))==null?void 0:Gt.label)},IconComponent:()=>Ce?t.createElement(Ge,null):t.createElement(xe,null),MenuProps:{anchorOrigin:{vertical:"bottom",horizontal:"left"},transformOrigin:{vertical:"top",horizontal:"left"},getContentAnchorEl:null}},g&&!a&&t.createElement(k.Z,{value:[]},g),G?i&&i.map(dt=>t.createElement("option",{value:dt.value,key:dt.value},dt.label)):i&&i.map(dt=>t.createElement(k.Z,{key:dt.value,value:dt.value},a&&t.createElement(At.Z,{color:"primary",checked:_.includes(dt.value)||!1,className:ne.checkbox}),dt.label))))))}const Bt=()=>{},_t=t.createContext({stepperLength:0,stepIndex:0,setStepIndex:Bt,stepHistory:[],setStepHistory:Bt,onStepChange:Bt});function En(n){const{children:a,elevated:i,onStepChange:d,activeStep:g=0}=n,[v,O]=useState(g),[N,G]=useState([0]);useEffect(()=>{O(g)},[g]);const H=[];let ne;return Children.forEach(a,_=>{isValidElement(_)&&(_.props.end?ne=_:H.push(_))}),React.createElement(React.Fragment,null,React.createElement(_t.Provider,{value:{stepIndex:v,setStepIndex:O,stepHistory:N,setStepHistory:G,onStepChange:d,stepperLength:Children.count(a)}},React.createElement(MuiStepper,{activeStep:v,orientation:"vertical",elevation:i?2:0},H)),v>=Children.count(a)-1&&ne)}const In=(0,m.Z)(n=>({root:{marginTop:n.spacing(3),"& button":{marginRight:n.spacing(1)}}}),{name:"BackstageSimpleStepperFooter"}),gn=({text:n,handleClick:a})=>React.createElement(Button,{onClick:a},n||"Reset"),An=({text:n,handleClick:a,disabled:i,last:d,stepIndex:g})=>React.createElement(Button,{variant:"contained",color:"primary",disabled:i,"data-testid":`nextButton-${g}`,onClick:a},n||(d?"Finish":"Next")),Ln=({text:n,handleClick:a,disabled:i,stepIndex:d})=>React.createElement(Button,{onClick:a,"data-testid":`backButton-${d}`,disabled:i},n||"Back"),xr=({actions:n={},children:a})=>{const i=In(),{stepperLength:d,stepIndex:g,setStepIndex:v,stepHistory:O,setStepHistory:N,onStepChange:G}=useContext(VerticalStepperContext),H=(Ce,Ie)=>{Ie&&Ie(),G&&G(g,Ce),v(Ce)},ne=()=>{const Ce=n.nextStep?n.nextStep(g,d-1):g+1;H(Ce,n.onNext),N([...O,Ce])},_=()=>{O.pop(),H(O[O.length-1],n.onBack),N([...O])},ve=()=>{H(0,n.onRestart),N([0])};return React.createElement("div",{className:i.root},[void 0,!0].includes(n.showBack)&&g!==0&&React.createElement(Ln,{text:n.backText,handleClick:_,disabled:g===0,stepIndex:g}),[void 0,!0].includes(n.showNext)&&React.createElement(An,{text:n.nextText,handleClick:ne,disabled:!!d&&g>=d||!!n.canNext&&!n.canNext(),stepIndex:g}),n.showRestart&&g!==0&&React.createElement(gn,{text:n.restartText,handleClick:ve,stepIndex:g}),a)},pr=(0,m.Z)(n=>({end:{padding:n.spacing(3)}}),{name:"SimpleStepperStep"});function aa(n){const{title:a,children:i,end:d,actions:g,...v}=n,O=pr();return d?React.createElement("div",{className:O.end},React.createElement(Typography,{variant:"h6"},a),i,React.createElement(SimpleStepperFooter,{actions:{...g||{},showNext:!1}})):React.createElement(MuiStep,{...v},React.createElement(StepLabel,null,React.createElement(Typography,{variant:"h6"},a)),React.createElement(StepContent,null,i,React.createElement(SimpleStepperFooter,{actions:g})))}const on=(0,m.Z)(n=>({status:{fontWeight:500,"&::before":{width:"0.7em",height:"0.7em",display:"inline-block",marginRight:8,borderRadius:"50%",content:'""'}},ok:{"&::before":{backgroundColor:n.palette.status.ok}},warning:{"&::before":{backgroundColor:n.palette.status.warning}},error:{"&::before":{backgroundColor:n.palette.status.error}},pending:{"&::before":{backgroundColor:n.palette.status.pending}},running:{"&::before":{backgroundColor:n.palette.status.running}},aborted:{"&::before":{backgroundColor:n.palette.status.aborted}}}),{name:"BackstageStatus"});function On(n){const a=on(n);return React.createElement("span",{className:classNames(a.status,a.ok),"aria-label":"Status ok","aria-hidden":"true",...n})}function Dr(n){const a=on(n);return React.createElement("span",{className:classNames(a.status,a.warning),"aria-label":"Status warning","aria-hidden":"true",...n})}function oa(n){const a=on(n);return React.createElement("span",{className:classNames(a.status,a.error),"aria-label":"Status error","aria-hidden":"true",...n})}function el(n){const a=on(n);return React.createElement("span",{className:classNames(a.status,a.pending),"aria-label":"Status pending","aria-hidden":"true",...n})}function tl(n){const a=on(n);return React.createElement("span",{className:classNames(a.status,a.running),"aria-label":"Status running","aria-hidden":"true",...n})}function nl(n){const a=on(n);return React.createElement("span",{className:classNames(a.status,a.aborted),"aria-label":"Status aborted","aria-hidden":"true",...n})}var rl=e(74600),ya=e(15584);const yo=n=>(0,o.Z)({root:{fontWeight:"bolder",whiteSpace:"nowrap",paddingRight:n.spacing(4),border:"0",verticalAlign:"top"}}),Eo={root:{border:"0",verticalAlign:"top"}},vo=n=>(0,o.Z)({root:{listStyle:"none",margin:n.spacing(0,0,-1,0),padding:"0"}}),Ao=n=>(0,o.Z)({root:{padding:n.spacing(0,0,1,0)},random:{}}),Ro=(0,mn.Z)(yo,{name:"BackstageMetadataTableTitleCell"})(ya.Z),So=(0,mn.Z)(Eo,{name:"BackstageMetadataTableCell"})(ya.Z),al=({dense:n,children:a})=>React.createElement(Table,{size:n?"small":"medium"},React.createElement(TableBody,null,a)),ol=({title:n,children:a,...i})=>React.createElement(TableRow,null,n&&React.createElement(Ro,null,n),React.createElement(So,{colSpan:n?1:2,...i},a)),Ea=(0,mn.Z)(vo,{name:"BackstageMetadataTableList"})(({classes:n,children:a})=>t.createElement("ul",{className:n.root},a)),sl=(0,mn.Z)(Ao,{name:"BackstageMetadataTableListItem"})(({classes:n,children:a})=>t.createElement("li",{className:n.root},a)),va=(0,o.Z)({root:{margin:"0 0",listStyleType:"none"}}),Co=n=>(0,o.Z)({root:{...va.root,paddingLeft:n.spacing(1)}}),Aa=(0,mn.Z)(va,{name:"BackstageStructuredMetadataTableList"})(({classes:n,children:a})=>t.createElement(Ea,{classes:n},a)),Ra=(0,mn.Z)(Co,{name:"BackstageStructuredMetadataTableNestedList"})(({classes:n,children:a})=>t.createElement(Ea,{classes:n},a));function To(n,a){const i=n.map((d,g)=>React.createElement(MetadataListItem,{key:g},sa(d)));return a?React.createElement(Ra,null,i):React.createElement(Aa,null,i)}function bo(n,a,i){const d=Object.keys(n).map(g=>{const v=sa(n[g],!0),O=i&&i.titleFormat?i.titleFormat(g):startCase(g);return React.createElement(MetadataListItem,{key:g},`${O}: `,v)});return a?React.createElement(Ra,null,d):React.createElement(Aa,null,d)}function sa(n,a,i){return React.isValidElement(n)?React.createElement(Fragment,null,n):typeof n=="object"&&!Array.isArray(n)?bo(n,a,i):Array.isArray(n)?To(n,i):typeof n=="boolean"?React.createElement(Fragment,null,n?"\u2705":"\u274C"):React.createElement(Fragment,null,n)}const Po=({value:n,options:a})=>React.createElement(Fragment,null,sa(n,a)),Io=({title:n,value:a,options:i})=>React.createElement(MetadataTableItem,{title:i&&i.titleFormat?i.titleFormat(n):startCase(n)},React.createElement(Po,{value:a,options:i}));function Lo(n,a){return Object.keys(n).map(i=>React.createElement(Io,{key:i,title:i,value:n[i],options:a}))}function il(n){const{metadata:a,dense:i=!0,options:d}=n,g=Lo(a,d||{});return React.createElement(MetadataTable,{dense:i},g)}var Oo=e(49429),xo=e(86136),Sa=e(79784),Fr=e(76635),Do=e(19126),Ca=e.n(Do);function Fo(n){return qs.stringify(n,{strictNullHandling:!0})}function Ta(n){return qs.parse(n,{ignoreQueryPrefix:!0,strictNullHandling:!0})}function ba(n,a){return Ta(n)[a]}function Bo(n,a,i){const d={...Ta(n),[a]:i};return Fo(d)}function ll(n,a=250){const[i,d]=useSearchParams(),g=i.toString(),[v,O]=useState(ba(g,n));return useEffect(()=>{const N=ba(g,n);O(G=>isEqual(N,G)?G:N)},[g,O,n]),useDebouncedEffect(()=>{const N=Bo(g,n,v);g!==N&&d(N,{replace:!0})},[d,v,g,n],a),[v,O]}const Mo={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 Pa(){const a=(0,l.useApiHolder)().get(l.configApiRef),i=a==null?void 0:a.getOptionalConfig("app.support");return i?{url:i.getString("url"),items:i.getConfigArray("items").flatMap(d=>{var g;return{title:d.getString("title"),icon:d.getOptionalString("icon"),links:((g=d.getOptionalConfigArray("links"))!=null?g:[]).flatMap(v=>({url:v.getString("url"),title:v.getString("title")}))}})}:Mo}var wo=e(80079);function Un(n,a){const d=(0,l.useApp)().getSystemIcon(n);return d?t.createElement(d,{...a}):t.createElement(wo.Z,{...a})}function cl(n){return Un("brokenImage",n)}function ul(n){return Un("catalog",n)}function dl(n){return Un("chat",n)}function fl(n){return Un("dashboard",n)}function ml(n){return Un("docs",n)}function hl(n){return Un("email",n)}function gl(n){return Un("github",n)}function pl(n){return Un("group",n)}function Kr(n){return Un("help",n)}function yl(n){return Un("user",n)}function El(n){return Un("warning",n)}const $o=(0,m.Z)({popoverList:{minWidth:260,maxWidth:400}},{name:"BackstageSupportButton"}),Uo=({icon:n})=>{var d;const a=(0,l.useApp)(),i=n&&(d=a.getSystemIcon(n))!=null?d:Kr;return t.createElement(i,null)},No=({link:n})=>{var a;return t.createElement(b,{to:n.url},(a=n.title)!=null?a:n.url)},Zo=({item:n})=>{var a;return t.createElement(xt.Z,null,t.createElement(xo.Z,null,t.createElement(Uo,{icon:n.icon})),t.createElement(qt.Z,{primary:n.title,secondary:(a=n.links)==null?void 0:a.reduce((i,d,g)=>[...i,g>0&&t.createElement("br",{key:g}),t.createElement(No,{link:d,key:d.url})],[])}))};function zo(n){const{title:a,children:i}=n,{items:d}=Pa(),[g,v]=(0,t.useState)(!1),[O,N]=(0,t.useState)(null),G=$o(),H=(0,st.Z)(ve=>ve.breakpoints.down("sm")),ne=ve=>{N(ve.currentTarget),v(!0)},_=()=>{v(!1)};return t.createElement(t.Fragment,null,t.createElement(Fn.Z,{display:"flex",ml:1},H?t.createElement(Y.Z,{color:"primary",size:"small",onClick:ne,"data-testid":"support-button"},t.createElement(Kr,null)):t.createElement(y.Z,{"data-testid":"support-button","aria-label":"support",color:"primary",onClick:ne,startIcon:t.createElement(Kr,null)},"Support")),t.createElement(Sa.ZP,{"data-testid":"support-button-popover",open:g,anchorEl:O,anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"},onClose:_},t.createElement(dn.Z,{className:G.popoverList},a&&t.createElement(xt.Z,{alignItems:"flex-start"},t.createElement(at.Z,{variant:"subtitle1"},a)),t.Children.map(i,(ve,Ce)=>t.createElement(xt.Z,{alignItems:"flex-start",key:`child-${Ce}`},ve)),d&&d.map((ve,Ce)=>t.createElement(Zo,{item:ve,key:`item-${Ce}`}))),t.createElement(Oo.Z,null,t.createElement(y.Z,{color:"primary",onClick:_},"Close"))))}var ia=e(18671),Mn=e(10289);const kr=72,Ia=24,La=18,kn={drawerWidthClosed:kr,drawerWidthOpen:224,defaultOpenDelayMs:100,defaultCloseDelayMs:0,defaultFadeDuration:200,logoHeight:32,iconContainerWidth:kr,iconSize:kr-Ia*2,iconPadding:Ia,selectedIndicatorWidth:3,userBadgePadding:La,userBadgeDiameter:kr-La*2,mobileSidebarHeight:56},Wo=n=>({...kn,...n,iconContainerWidth:kn.drawerWidthClosed,iconSize:kn.drawerWidthClosed-kn.iconPadding*2,userBadgeDiameter:kn.drawerWidthClosed-kn.userBadgePadding*2}),Oa={drawerWidthClosed:0,drawerWidthOpen:202,defaultOpenDelayMs:kn.defaultOpenDelayMs+200},Ho=n=>({...Oa,...n}),vl="@backstage/core/sidebar-intro-dismissed",jn=(0,t.createContext)({sidebarConfig:kn,submenuConfig:Oa}),xa=(0,t.createContext)({isHoveredOn:!1,setIsHoveredOn:()=>{}});var Yr;(function(n){const a="sidebarPinState";n.SIDEBAR_PIN_STATE=a})(Yr||(Yr={}));const Da={getSidebarPinState(){let n;try{n=JSON.parse(window.localStorage.getItem(Yr.SIDEBAR_PIN_STATE)||"true")}catch{return!0}return!!n},setSidebarPinState(n){return window.localStorage.setItem(Yr.SIDEBAR_PIN_STATE,JSON.stringify(n))}};var Jr=e(76241);const Fa={isPinned:!0,toggleSidebarPinState:()=>{},isMobile:!1},Ba=(0,t.createContext)(Fa),Ma=(0,Jr.CT)("sidebar-pin-state-context"),jo=({children:n,value:a})=>t.createElement(Ba.Provider,{value:a},t.createElement(Ma.Provider,{value:(0,Jr.EI)({1:a})},n)),Br=()=>{const n=(0,t.useContext)(Ma),a=(0,t.useContext)(Ba);if(n===void 0)return a||Fa;const i=n.atVersion(1);if(i===void 0)throw new Error("No context found for version 1.");return i},Vo=(0,m.Z)(n=>({root:{width:"100%",transition:"padding-left 0.1s ease-out",isolation:"isolate",[n.breakpoints.up("sm")]:{paddingLeft:a=>a.isPinned?a.sidebarConfig.drawerWidthOpen:a.sidebarConfig.drawerWidthClosed},[n.breakpoints.down("xs")]:{paddingBottom:a=>a.sidebarConfig.mobileSidebarHeight}},content:{zIndex:0,isolation:"isolate","&:focus":{outline:0}}}),{name:"BackstageSidebarPage"}),wa=(0,t.createContext)({content:{contentRef:void 0}});function Go(n){const[a,i]=(0,t.useState)(()=>Da.getSidebarPinState()),{sidebarConfig:d}=(0,t.useContext)(jn),g=(0,t.useRef)(null),v=(0,t.useMemo)(()=>({content:{contentRef:g}}),[g]);(0,t.useEffect)(()=>{Da.setSidebarPinState(a)},[a]);const O=(0,st.Z)(H=>H.breakpoints.down("xs"),{noSsr:!0}),N=()=>i(!a),G=Vo({isPinned:a,sidebarConfig:d});return t.createElement(jo,{value:{isPinned:a,toggleSidebarPinState:N,isMobile:O}},t.createElement(wa.Provider,{value:v},t.createElement("div",{className:G.root},n.children)))}function $a(){const{content:n}=(0,t.useContext)(wa);return{focusContent:(0,t.useCallback)(()=>{var i,d;(d=(i=n==null?void 0:n.contentRef)==null?void 0:i.current)==null||d.focus()},[n]),contentRef:n==null?void 0:n.contentRef}}const Ua={isOpen:!1,setOpen:()=>{}},Na=(0,t.createContext)(Ua),Za=(0,Jr.CT)("sidebar-open-state-context"),za=({children:n,value:a})=>t.createElement(Na.Provider,{value:a},t.createElement(Za.Provider,{value:(0,Jr.EI)({1:a})},n)),la=()=>{const n=(0,t.useContext)(Za),a=(0,t.useContext)(Na);if(n===void 0)return a||Ua;const i=n.atVersion(1);if(i===void 0)throw new Error("No context found for version 1.");return i};var Ko=e(50023),ko=e(4190),Yo=e(87685),Jo=e(44882),Qo=e(57998);const Xo=(0,m.Z)(n=>({root:{flexGrow:0,margin:n.spacing(0,2),color:n.palette.navigation.color},selected:a=>({color:`${n.palette.navigation.selectedColor}!important`,borderTop:`solid ${a.sidebarConfig.selectedIndicatorWidth}px ${n.palette.navigation.indicator}`,marginTop:"-1px"}),label:{display:"none"}})),qo=n=>{const{to:a,label:i,icon:d,value:g}=n,{sidebarConfig:v}=(0,t.useContext)(jn),O=Xo({sidebarConfig:v}),N=(0,Mn.TH)(),{selectedMenuItemIndex:G,setSelectedMenuItemIndex:H}=(0,t.useContext)(ja),ne=(ve,Ce)=>{H(Ce===G?-1:Ce)},_=g===G&&G>=0||g!==G&&!(G>=0)&&a===N.pathname;return t.createElement(Qo.Z,{label:i,icon:d,component:b,to:a||N.pathname,onChange:ne,value:g,selected:_,classes:O})},Wa=n=>{const{children:a,to:i,label:d,icon:g,value:v}=n,{isMobile:O}=Br();return O?t.createElement(qo,{to:i,label:d,icon:g,value:v}):t.createElement(t.Fragment,null,a)},Ha=(0,m.Z)(n=>({root:{position:"fixed",backgroundColor:n.palette.navigation.background,color:n.palette.navigation.color,bottom:0,left:0,right:0,zIndex:n.zIndex.snackbar,borderTop:"1px solid #383838"},overlay:a=>({background:n.palette.navigation.background,width:"100%",bottom:`${a.sidebarConfig.mobileSidebarHeight}px`,height:`calc(100% - ${a.sidebarConfig.mobileSidebarHeight}px)`,flex:"0 1 auto",overflow:"auto"}),overlayHeader:{display:"flex",color:n.palette.bursts.fontColor,alignItems:"center",justifyContent:"space-between",padding:n.spacing(2,3)},overlayHeaderClose:{color:n.palette.bursts.fontColor},marginMobileSidebar:a=>({marginBottom:`${a.sidebarConfig.mobileSidebarHeight}px`})})),_o=n=>(0,Fr.orderBy)(n,({props:{priority:a}})=>Number.isInteger(a)?a:-1,"desc"),es=t.createElement(Wa).type,ts=({children:n,label:a="Menu",open:i,onClose:d})=>{const{sidebarConfig:g}=(0,t.useContext)(jn),v=Ha({sidebarConfig:g});return t.createElement(ko.ZP,{anchor:"bottom",open:i,onClose:d,ModalProps:{BackdropProps:{classes:{root:v.marginMobileSidebar}}},classes:{root:v.marginMobileSidebar,paperAnchorBottom:v.overlay}},t.createElement(Fn.Z,{className:v.overlayHeader},t.createElement(at.Z,{variant:"h3"},a),t.createElement(Y.Z,{onClick:d,classes:{root:v.overlayHeaderClose}},t.createElement(Yo.Z,null))),t.createElement(Fn.Z,{component:"nav"},n))},ja=(0,t.createContext)({selectedMenuItemIndex:-1,setSelectedMenuItemIndex:()=>{}}),ns=n=>{const{sidebarConfig:a}=(0,t.useContext)(jn),{children:i}=n,d=Ha({sidebarConfig:a}),g=(0,Mn.TH)(),[v,O]=(0,t.useState)(-1);(0,t.useEffect)(()=>{O(-1)},[g.pathname]);let N=(0,l.useElementFilter)(i,H=>H.getElements().filter(ne=>ne.type===es));if(i)N.length?N=_o(N):N.push(t.createElement(Wa,{key:"default_menu",icon:t.createElement(Jo.Z,null)},i));else return null;const G=v>=0&&!N[v].props.to;return t.createElement(za,{value:{isOpen:!0,setOpen:()=>{}}},t.createElement(ja.Provider,{value:{selectedMenuItemIndex:v,setSelectedMenuItemIndex:O}},t.createElement(ts,{label:N[v]&&N[v].props.label,open:G,onClose:()=>O(-1)},N[v]&&N[v].props.children),t.createElement(Ko.Z,{className:d.root,"data-testid":"mobile-sidebar-root",component:"nav"},N)))},Va=(0,m.Z)(n=>({drawer:a=>({display:"flex",flexFlow:"column nowrap",alignItems:"flex-start",position:"fixed",left:0,top:0,bottom:0,zIndex:n.zIndex.appBar,background:n.palette.navigation.background,overflowX:"hidden",msOverflowStyle:"none",scrollbarWidth:"none",width:a.sidebarConfig.drawerWidthClosed,transition:n.transitions.create("width",{easing:n.transitions.easing.sharp,duration:n.transitions.duration.shortest}),"& > *":{flexShrink:0},"&::-webkit-scrollbar":{display:"none"}}),drawerOpen:a=>({width:a.sidebarConfig.drawerWidthOpen,transition:n.transitions.create("width",{easing:n.transitions.easing.sharp,duration:n.transitions.duration.shorter})}),visuallyHidden:{top:0,position:"absolute",zIndex:1e3,transform:"translateY(-200%)","&:focus":{transform:"translateY(5px)"}}}),{name:"BackstageSidebar"});var xn;(function(n){n[n.Closed=0]="Closed";const i=0+1;n[n.Idle=i]="Idle";const d=i+1;n[n.Open=d]="Open"})(xn||(xn={}));const rs=n=>{const{sidebarConfig:a}=(0,t.useContext)(jn),{openDelayMs:i=a.defaultOpenDelayMs,closeDelayMs:d=a.defaultCloseDelayMs,disableExpandOnHover:g,children:v}=n,O=Va({sidebarConfig:a}),N=(0,st.Z)(Yt=>Yt.breakpoints.down("md"),{noSsr:!0}),[G,H]=(0,t.useState)(xn.Closed),ne=(0,t.useRef)(),{isPinned:_,toggleSidebarPinState:ve}=Br(),Ce=()=>{_||g||(ne.current&&(clearTimeout(ne.current),ne.current=void 0),G!==xn.Open&&!N&&(ne.current=window.setTimeout(()=>{ne.current=void 0,H(xn.Open)},i),H(xn.Idle)))},Ie=()=>{_||g||(ne.current&&(clearTimeout(ne.current),ne.current=void 0),G===xn.Idle?H(xn.Closed):G===xn.Open&&(ne.current=window.setTimeout(()=>{ne.current=void 0,H(xn.Closed)},d)))},pt=G===xn.Open&&!N||_,Ut=Yt=>{Yt?(H(xn.Open),ve()):(H(xn.Closed),ve())};return t.createElement("nav",{style:{},"aria-label":"sidebar nav"},t.createElement(os,null),t.createElement(za,{value:{isOpen:pt,setOpen:Ut}},t.createElement("div",{className:O.root,"data-testid":"sidebar-root",onMouseEnter:g?()=>{}:Ce,onFocus:g?()=>{}:Ce,onMouseLeave:g?()=>{}:Ie,onBlur:g?()=>{}:Ie},t.createElement("div",{className:E()(O.drawer,{[O.drawerOpen]:pt})},v))))},as=n=>{var G,H;const a=Wo((G=n.sidebarOptions)!=null?G:{}),i=Ho((H=n.submenuOptions)!=null?H:{}),{children:d,disableExpandOnHover:g,openDelayMs:v,closeDelayMs:O}=n,{isMobile:N}=Br();return N?t.createElement(ns,null,d):t.createElement(jn.Provider,{value:{sidebarConfig:a,submenuConfig:i}},t.createElement(rs,{openDelayMs:v,closeDelayMs:O,disableExpandOnHover:g},d))};function os(){const{sidebarConfig:n}=(0,t.useContext)(jn),{focusContent:a,contentRef:i}=$a(),d=Va({sidebarConfig:n});return i!=null&&i.current?t.createElement(y.Z,{onClick:a,variant:"contained",className:E()(d.visuallyHidden)},"Skip to content"):null}function Ga(n,a){const i=new URLSearchParams(a.search).toString(),d=Ca().parse(i),g=new URLSearchParams(n.search).toString(),v=Ca().parse(g);return(0,Fr.isEqual)(a.pathname,n.pathname)&&(0,Fr.isMatch)(v,d)}const ss=(0,m.Z)(n=>({item:{height:48,width:"100%","&:hover":{background:"#6f6f6f",color:n.palette.navigation.selectedColor},display:"flex",alignItems:"center",color:n.palette.navigation.color,padding:20,cursor:"pointer",position:"relative",background:"none",border:"none"},itemContainer:{width:"100%"},selected:{background:"#6f6f6f",color:"#FFF"},label:{margin:14,marginLeft:7,fontSize:14,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:"#6f6f6f",color:n.palette.navigation.selectedColor}},textContent:{color:n.palette.navigation.color,paddingLeft:n.spacing(4),paddingRight:n.spacing(1),fontSize:"14px",whiteSpace:"nowrap",overflow:"hidden","text-overflow":"ellipsis"}}),{name:"BackstageSidebarSubmenuItem"}),Al=n=>{const{title:a,to:i,icon:d,dropdownItems:g}=n,v=ss(),{setIsHoveredOn:O}=useContext(SidebarItemWithSubmenuContext),N=()=>{O(!1)},G=useResolvedPath(i!=null?i:""),H=useLocation();let ne=isLocationMatch(H,G);const[_,ve]=useState(!1),Ce=()=>{ve(!_)};return g!==void 0?(g.some(Ie=>{const pt=resolvePath(Ie.to);return ne=isLocationMatch(H,pt),ne}),React.createElement("div",{className:v.itemContainer},React.createElement(Tooltip,{title:a,enterDelay:500,enterNextDelay:500},React.createElement("button",{onClick:Ce,onTouchStart:Ie=>Ie.stopPropagation(),className:classnames(v.item,ne?v.selected:void 0)},d&&React.createElement(d,{fontSize:"small"}),React.createElement(Typography,{variant:"subtitle1",className:v.label},a),_?React.createElement(ArrowDropUpIcon,{className:v.dropdownArrow}):React.createElement(ArrowDropDownIcon,{className:v.dropdownArrow}))),g&&_&&React.createElement("div",{className:v.dropdown},g.map((Ie,pt)=>React.createElement(Tooltip,{key:pt,title:Ie.title,enterDelay:500,enterNextDelay:500},React.createElement(Link,{to:Ie.to,underline:"none",className:v.dropdownItem,onClick:N,onTouchStart:Ut=>Ut.stopPropagation()},React.createElement(Typography,{className:v.textContent},Ie.title))))))):React.createElement("div",{className:v.itemContainer},React.createElement(Tooltip,{title:a,enterDelay:500,enterNextDelay:500},React.createElement(Link,{to:i,underline:"none",className:classnames(v.item,ne?v.selected:void 0),onClick:N,onTouchStart:Ie=>Ie.stopPropagation()},d&&React.createElement(d,{fontSize:"small"}),React.createElement(Typography,{variant:"subtitle1",className:v.label},a))))},is=(0,m.Z)(n=>({root:{zIndex:1e3,position:"relative",overflow:"visible",width:n.spacing(7)+1},drawer:a=>{var i,d;return{display:"flex",flexFlow:"column nowrap",alignItems:"flex-start",position:"fixed",[n.breakpoints.up("sm")]:{marginLeft:a.left,transition:n.transitions.create("margin-left",{easing:n.transitions.easing.sharp,duration:n.transitions.duration.shortest})},top:0,bottom:0,padding:0,background:(d=(i=n.palette.navigation.submenu)==null?void 0:i.background)!=null?d:"#404040",overflowX:"hidden",msOverflowStyle:"none",scrollbarWidth:"none",cursor:"default",width:a.submenuConfig.drawerWidthClosed,transitionDelay:`${a.submenuConfig.defaultOpenDelayMs}ms`,"& > *":{flexShrink:0},"&::-webkit-scrollbar":{display:"none"}}},drawerOpen:a=>({width:a.submenuConfig.drawerWidthOpen,[n.breakpoints.down("xs")]:{width:"100%",position:"relative",paddingLeft:n.spacing(3),left:0,top:0}}),title:{fontSize:24,fontWeight:500,color:"#FFF",padding:20,[n.breakpoints.down("xs")]:{display:"none"}}}),{name:"BackstageSidebarSubmenu"}),ls=n=>{const{isOpen:a}=la(),{sidebarConfig:i,submenuConfig:d}=(0,t.useContext)(jn),g=a?i.drawerWidthOpen:i.drawerWidthClosed,v=is({left:g,submenuConfig:d}),{isHoveredOn:O}=(0,t.useContext)(xa),[N,G]=(0,t.useState)(!1);return(0,t.useEffect)(()=>{G(O)},[O]),t.createElement("div",{className:E()(v.drawer,{[v.drawerOpen]:N})},t.createElement(at.Z,{variant:"h5",className:v.title},n.title),n.children)};var Qr=e(76600),cs=e(26739),Ka=e(98989),us=e(59797),ds=e(83543);const fs=(0,m.Z)({iconContainer:{display:"flex",position:"relative",width:"100%"},arrow1:{right:"6px",position:"absolute"}}),Rl=()=>{const n=fs();return React.createElement("div",{className:n.iconContainer},React.createElement("div",{className:n.arrow1},React.createElement(ArrowBackIosIcon,{style:{fontSize:"12px"}})),React.createElement("div",null,React.createElement(ArrowBackIosIcon,{style:{fontSize:"12px"}})))};var Sl=null;const ms=(0,m.Z)({iconContainer:{display:"flex",position:"relative",width:"100%"},arrow1:{right:"6px",position:"absolute"}}),Cl=()=>{const n=ms();return React.createElement("div",{className:n.iconContainer},React.createElement("div",{className:n.arrow1},React.createElement(ArrowForwardIosIcon,{style:{fontSize:"12px"}})),React.createElement("div",null,React.createElement(ArrowForwardIosIcon,{style:{fontSize:"12px"}})))};var Tl=null;const hs=n=>(0,m.Z)(a=>{var i,d,g,v;return{root:{color:a.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"},closed:{width:n.drawerWidthClosed,justifyContent:"center"},open:{[a.breakpoints.up("sm")]:{width:n.drawerWidthOpen}},highlightable:{"&:hover":{background:(d=(i=a.palette.navigation.navItem)==null?void 0:i.hoverBackground)!=null?d:"#404040"}},highlighted:{background:(v=(g=a.palette.navigation.navItem)==null?void 0:g.hoverBackground)!=null?v:"#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:n.iconContainerWidth,marginRight:-a.spacing(2),display:"flex",alignItems:"center",justifyContent:"center"},searchRoot:{marginBottom:12},searchField:{color:"#b5b5b5",fontWeight:"bold",fontSize:a.typography.fontSize},searchFieldHTMLInput:{padding:a.spacing(2,0,2)},searchContainer:{width:n.drawerWidthOpen-n.iconContainerWidth},secondaryAction:{width:a.spacing(6),textAlign:"center",marginRight:a.spacing(1)},closedItemIcon:{width:"100%",justifyContent:"center"},submenuArrow:{display:"flex"},expandButton:{background:"none",border:"none",color:a.palette.navigation.color,width:"100%",cursor:"pointer",position:"relative",height:48},arrows:{position:"absolute",right:10},selected:{"&$root":{borderLeft:`solid ${n.selectedIndicatorWidth}px ${a.palette.navigation.indicator}`,color:a.palette.navigation.selectedColor},"&$closed":{width:n.drawerWidthClosed},"& $closedItemIcon":{paddingRight:n.selectedIndicatorWidth},"& $iconContainer":{marginLeft:-n.selectedIndicatorWidth}}}},{name:"BackstageSidebarItem"});function Xr(n){return(0,t.useMemo)(()=>hs(n),[n])()}const gs=(n,a)=>(0,l.useElementFilter)(n.props.children,i=>{let d=!1;return i.getElements().forEach(({props:{to:g,dropdownItems:v}})=>{if(!d){if(v!=null&&v.length){v.forEach(({to:O})=>d=d||Ga(a,(0,Mn.i3)(O)));return}g&&(d=Ga(a,(0,Mn.i3)(g)))}}),d},[a.pathname]);function ka(n){return n.to===void 0}const ps=t.createElement(ls).type,ys=t.forwardRef(function({to:a,end:i,style:d,className:g,activeStyle:v,caseSensitive:O,activeClassName:N="active","aria-current":G="page",...H},ne){let{pathname:_}=(0,Mn.TH)(),{pathname:ve}=(0,Mn.WU)(a);O||(_=_.toLocaleLowerCase("en-US"),ve=ve.toLocaleLowerCase("en-US"));let Ce=_===ve;!Ce&&!i&&(Ce=_.startsWith(`${ve}/`));const Ie=Ce?G:void 0;return t.createElement(I.rU,{...H,to:a,ref:ne,"aria-current":Ie,style:{...d,...Ce?v:void 0},className:E()([g,Ce?N:void 0])})}),Ya=(0,t.forwardRef)((n,a)=>{const{icon:i,text:d,hasNotifications:g=!1,hasSubmenu:v=!1,disableHighlight:O=!1,onClick:N,children:G,className:H,...ne}=n,{sidebarConfig:_}=(0,t.useContext)(jn),ve=Xr(_),{isOpen:Ce}=la(),Ie=!Ce&&v?{display:"flex",marginLeft:"24px"}:{},pt=t.createElement("div",{style:Ie},t.createElement(i,{fontSize:"small"}),!Ce&&v?t.createElement(Ka.Z,null):t.createElement(t.Fragment,null)),Ut=t.createElement(cs.Z,{color:"secondary",variant:"dot",overlap:"circular",invisible:!g,className:E()({[ve.closedItemIcon]:!Ce})},pt),Yt=t.createElement(t.Fragment,null,t.createElement("div",{"data-testid":"login-button",className:ve.iconContainer},Ut),d&&t.createElement(at.Z,{variant:"subtitle2",className:ve.label},d),t.createElement("div",{className:ve.secondaryAction},G)),Jt=Ce?Yt:Ut,dt={onClick:N,className:E()(H,ve.root,Ce?ve.open:ve.closed,ka(n)&&ve.buttonItem,{[ve.highlightable]:!O})};return ka(n)?t.createElement("button",{"aria-label":d,...dt,ref:a},Jt):t.createElement(ys,{...dt,activeClassName:ve.selected,to:n.to?n.to:"",ref:a,"aria-label":d||n.to,...ne},Jt)}),Es=({children:n,...a})=>{const{sidebarConfig:i}=(0,t.useContext)(jn),d=Xr(i),[g,v]=(0,t.useState)(!1),O=(0,Mn.TH)(),N=gs(n,O),G=(0,st.Z)(ve=>ve.breakpoints.down("sm")),H=()=>{v(!0)},ne=()=>{v(!1)},_=()=>G?g?t.createElement(us.Z,{fontSize:"small",className:d.submenuArrow}):t.createElement(ds.Z,{fontSize:"small",className:d.submenuArrow}):!g&&t.createElement(Ka.Z,{fontSize:"small",className:d.submenuArrow});return t.createElement(xa.Provider,{value:{isHoveredOn:g,setIsHoveredOn:v}},t.createElement("div",{"data-testid":"item-with-submenu",onMouseLeave:ne,onTouchStart:g?ne:H,onMouseEnter:H,className:E()(g&&d.highlighted)},t.createElement(Ya,{hasSubmenu:!0,className:N?d.selected:"",...a},_()),g&&n))},Ja=(0,t.forwardRef)((n,a)=>{const[i]=(0,l.useElementFilter)(n.children,d=>d.getElements().filter(g=>g.type===ps));return i?t.createElement(Es,{...n},i):t.createElement(Ya,{...n,ref:a})});function bl(n){const{sidebarConfig:a}=useContext(SidebarConfigContext),[i,d]=useState(""),g=Xr(a),v=n.icon?n.icon:SearchIcon,O=()=>{n.onSearch(i),d("")},N=_=>{_.key==="Enter"&&(_.preventDefault(),O())},G=_=>{d(_.target.value)},H=_=>{_.preventDefault(),_.stopPropagation()},ne=_=>{O(),_.preventDefault()};return React.createElement("div",{className:g.searchRoot},React.createElement(Ja,{icon:v,to:n.to,onClick:ne,disableHighlight:!0},React.createElement(TextField,{placeholder:"Search",value:i,onClick:H,onChange:G,onKeyDown:N,className:g.searchContainer,InputProps:{disableUnderline:!0,className:g.searchField},inputProps:{className:g.searchFieldHTMLInput}})))}const Pl=(0,Qr.Z)("div")({flex:1},{name:"BackstageSidebarSpace"}),Il=(0,Qr.Z)("div")({height:8},{name:"BackstageSidebarSpacer"}),vs=(0,Qr.Z)("hr")({height:1,width:"100%",background:"#383838",border:"none",margin:"12px 0px"},{name:"BackstageSidebarDivider"}),As=n=>({overflowY:"auto","&::-webkit-scrollbar":{backgroundColor:n.palette.background.default,width:"5px",borderRadius:"5px"},"&::-webkit-scrollbar-thumb":{backgroundColor:n.palette.text.hint,borderRadius:"5px"}}),Ll=(0,Qr.Z)("div")(({theme:n})=>{const a=As(n);return{flex:"0 1 auto",overflowX:"hidden",width:"calc(100% - 5px)",minHeight:"48px",overflowY:"hidden","@media (hover: none)":a,"&:hover":a}}),Ol=()=>{const{sidebarConfig:n}=useContext(SidebarConfigContext),a=Xr(n),{isOpen:i,setOpen:d}=useSidebarOpenState();if(useMediaQuery(O=>O.breakpoints.down("md"),{noSsr:!0}))return null;const v=()=>{d(!i)};return React.createElement("button",{onClick:v,className:a.expandButton,"aria-label":"Expand Sidebar","data-testid":"sidebar-expand-button"},React.createElement("div",{className:a.arrows},i?React.createElement(DoubleArrowLeft,null):React.createElement(DoubleArrowRight,null)))},Rs=(0,m.Z)(n=>({introCard:a=>({color:"#b5b5b5",fontSize:12,width:a.sidebarConfig.drawerWidthOpen,marginTop:18,marginBottom:12,paddingLeft:a.sidebarConfig.iconPadding,paddingRight:a.sidebarConfig.iconPadding}),introDismiss:{display:"flex",justifyContent:"flex-end",alignItems:"center",marginTop:12},introDismissLink:{color:"#dddddd",display:"flex",alignItems:"center",marginBottom:4,"&:hover":{color:n.palette.linkHover,transition:n.transitions.create("color",{easing:n.transitions.easing.sharp,duration:n.transitions.duration.shortest})}},introDismissText:{fontSize:"0.7rem",fontWeight:"bold",textTransform:"uppercase",letterSpacing:1},introDismissIcon:{width:18,height:18,marginRight:12}}),{name:"BackstageSidebarIntro"});function Ss(n){const{sidebarConfig:a}=useContext(SidebarConfigContext),i=Rs({sidebarConfig:a}),{text:d,onClose:g}=n,v=()=>g();return React.createElement("div",{className:i.introCard},React.createElement(Typography,{variant:"subtitle2"},d),React.createElement("div",{className:i.introDismiss},React.createElement(Link,{component:"button",onClick:v,underline:"none",className:i.introDismissLink},React.createElement(CloseIcon,{className:i.introDismissIcon}),React.createElement(Typography,{component:"span",className:i.introDismissText},"Dismiss"))))}const Qa=n=>{const{text:a,onDismiss:i}=n,[d,g]=useState(!1),v=()=>{g(!0)};return React.createElement(Collapse,{in:!d,onExited:i},React.createElement(Ss,{text:a,onClose:v}))},Cs=null,Ts="And your recently viewed plugins will pop up here!";function xl(n){const{isOpen:a}=useSidebarOpenState(),i={starredItemsDismissed:!1,recentlyViewedItemsDismissed:!1},[d,g]=useLocalStorageValue(SIDEBAR_INTRO_LOCAL_STORAGE),{starredItemsDismissed:v,recentlyViewedItemsDismissed:O}=d!=null?d:{},N=()=>{g(H=>({...i,...H,starredItemsDismissed:!0}))},G=()=>{g(H=>({...i,...H,recentlyViewedItemsDismissed:!0}))};return a?React.createElement(React.Fragment,null,!v&&React.createElement(React.Fragment,null,React.createElement(Qa,{text:Cs,onDismiss:N}),React.createElement(SidebarDivider,null)),!O&&React.createElement(Qa,{text:Ts,onDismiss:G})):null}const bs=(0,m.Z)(n=>({root:{gridArea:"pageContent",minWidth:0,paddingTop:n.spacing(3),paddingBottom:n.spacing(3),paddingLeft:n.spacing(2),paddingRight:n.spacing(2),[n.breakpoints.up("sm")]:{paddingLeft:n.spacing(3),paddingRight:n.spacing(3)}},stretch:{display:"flex",flexDirection:"column",flexGrow:1},noPadding:{padding:0}}),{name:"BackstageContent"});function Xa(n){const{className:a,stretch:i,noPadding:d,children:g,...v}=n,{contentRef:O}=$a(),N=bs();return t.createElement("article",{ref:O,tabIndex:-1,...v,className:E()(N.root,a,{[N.stretch]:i,[N.noPadding]:d})},g)}var Ps=e(6487),Is=e(99152);const Ls=(0,m.Z)(n=>({tabsWrapper:{gridArea:"pageSubheader",backgroundColor:n.palette.background.paper,paddingLeft:n.spacing(3),minWidth:0},defaultTab:{padding:n.spacing(3,3),...n.typography.caption,textTransform:"uppercase",fontWeight:"bold",color:n.palette.text.secondary},selected:{color:n.palette.text.primary},tabRoot:{"&:hover":{backgroundColor:n.palette.background.default,color:n.palette.text.primary}}}),{name:"BackstageHeaderTabs"});function qa(n){const{tabs:a,onChange:i,selectedIndex:d}=n,[g,v]=(0,t.useState)(d!=null?d:0),O=Ls(),N=(G,H)=>{d===void 0&&v(H),i&&i(H)};return(0,t.useEffect)(()=>{d!==void 0&&v(d)},[d]),t.createElement("div",{className:O.tabsWrapper},t.createElement(Is.Z,{selectionFollowsFocus:!0,indicatorColor:"primary",textColor:"inherit",variant:"scrollable",scrollButtons:"auto","aria-label":"scrollable auto tabs example",onChange:N,value:g},a.map((G,H)=>t.createElement(Ps.Z,{...G.tabProps,"data-testid":`header-tab-${H}`,label:G.label,key:G.id,value:H,className:O.defaultTab,classes:{selected:O.selected,root:O.tabRoot}}))))}function Os(n){var N,G,H;const a=(0,Mn.UO)(),d=n.map(({path:ne,children:_})=>({caseSensitive:!1,path:`${ne}/*`,element:_})).sort((ne,_)=>_.path.replace(/\/\*$/,"").localeCompare(ne.path.replace(/\/\*$/,""))),g=(N=(0,Mn.V$)(d))!=null?N:n[0].children,[v]=(G=(0,Mn.fp)(d,`/${a["*"]}`))!=null?G:[],O=v?n.findIndex(ne=>`${ne.path}/*`===v.route.path):0;return{index:O===-1?0:O,element:g,route:(H=n[O])!=null?H:n[0]}}function _a(n){const{routes:a}=n,i=(0,Mn.s0)(),{index:d,route:g,element:v}=Os(a),O=(0,t.useMemo)(()=>a.map(G=>({id:G.path,label:G.title,tabProps:G.tabProps})),[a]),N=G=>i(a[G].path.replace(/\/\*$/,"").replace(/^\//,""));return t.createElement(t.Fragment,null,t.createElement(qa,{tabs:O,selectedIndex:d,onChange:N}),t.createElement(Xa,null,t.createElement(ia.q,{title:g.title}),v))}const ca=()=>null;(0,l.attachComponentData)(ca,"core.gatherMountPoints",!0);function eo(n){const a=t.createElement(ca,{path:"",title:""},t.createElement("div",null)).type;return t.Children.toArray(n).flatMap(i=>{if(!(0,t.isValidElement)(i))return[];if(i.type===t.Fragment)return eo(i.props.children);if(i.type!==a)throw new Error("Child of TabbedLayout must be an TabbedLayout.Route");const{path:d,title:g,children:v,tabProps:O}=i.props;return[{path:d,title:g,children:v,tabProps:O}]})}function xs(n){const a=eo(n.children);return t.createElement(_a,{routes:a})}xs.Route=ca;const Ds=(0,m.Z)(n=>({value:{marginBottom:"6px"},subvalue:{color:n.palette.textSubtle,fontWeight:"normal"}}),{name:"BackstageSubvalueCell"});function Fs(n){const{value:a,subvalue:i}=n,d=Ds();return t.createElement(t.Fragment,null,t.createElement("div",{className:d.value},a),t.createElement("div",{className:d.subvalue},i))}var Bs=e(21070),Ms=e(90324),ws=e(98281),$s=e(48049),to=e(51209),no=e(33375),Us=e(44233),Ns=e(27604),ua=e(36444),Zs=e(37971),zs=e(59709),Ws=e(17373),Hs=e(3702),js=e(93111),qr=e(67222);const Vs=(0,m.Z)(n=>({root:{height:"100%",width:"315px",display:"flex",flexDirection:"column",marginRight:n.spacing(3)},value:{fontWeight:"bold",fontSize:18},header:{display:"flex",alignItems:"center",height:"60px",justifyContent:"space-between",borderBottom:`1px solid ${n.palette.grey[500]}`},filters:{display:"flex",flexDirection:"column","& > *":{marginTop:n.spacing(2)}}}),{name:"BackstageTableFilters"}),Gs=n=>{var G;const a=Vs(),{onChangeFilters:i}=n,[d,g]=(0,t.useState)({...n.selectedFilters}),[v,O]=(0,t.useState)(!1),N=()=>{g({}),O(H=>!H)};return(0,t.useEffect)(()=>{i(d)},[d,i]),t.createElement("div",{className:a.root},t.createElement("div",{className:a.header},t.createElement("div",{className:a.value},"Filters"),t.createElement(y.Z,{color:"primary",onClick:N},"Clear all")),t.createElement("div",{className:a.filters},((G=n.filters)==null?void 0:G.length)&&n.filters.map(H=>t.createElement(je,{triggerReset:v,key:H.element.label,...H.element,selected:d[H.element.label],onChange:ne=>g({...d,[H.element.label]:ne})}))))},Ks={Add:(0,t.forwardRef)((n,a)=>t.createElement(Bs.Z,{...n,ref:a})),Check:(0,t.forwardRef)((n,a)=>t.createElement(ws.Z,{...n,ref:a})),Clear:(0,t.forwardRef)((n,a)=>t.createElement(no.Z,{...n,ref:a})),Delete:(0,t.forwardRef)((n,a)=>t.createElement(Us.Z,{...n,ref:a})),DetailPanel:(0,t.forwardRef)((n,a)=>t.createElement(to.Z,{...n,ref:a})),Edit:(0,t.forwardRef)((n,a)=>t.createElement(Ns.Z,{...n,ref:a})),Export:(0,t.forwardRef)((n,a)=>t.createElement(Hs.Z,{...n,ref:a})),Filter:(0,t.forwardRef)((n,a)=>t.createElement(ua.Z,{...n,ref:a})),FirstPage:(0,t.forwardRef)((n,a)=>t.createElement(Zs.Z,{...n,ref:a})),LastPage:(0,t.forwardRef)((n,a)=>t.createElement(zs.Z,{...n,ref:a})),NextPage:(0,t.forwardRef)((n,a)=>t.createElement(to.Z,{...n,ref:a})),PreviousPage:(0,t.forwardRef)((n,a)=>t.createElement($s.Z,{...n,ref:a})),ResetSearch:(0,t.forwardRef)((n,a)=>t.createElement(no.Z,{...n,ref:a})),Search:(0,t.forwardRef)((n,a)=>t.createElement(ua.Z,{...n,ref:a})),SortArrow:(0,t.forwardRef)((n,a)=>t.createElement(Ms.Z,{...n,ref:a})),ThirdStateCheck:(0,t.forwardRef)((n,a)=>t.createElement(Ws.Z,{...n,ref:a})),ViewColumn:(0,t.forwardRef)((n,a)=>t.createElement(js.Z,{...n,ref:a}))};function ro(n,a){const i=a.split(".");let d=n[i[0]];for(let g=1;g<i.length;++g){if(d===void 0)return d;const v=i[g];d=d[v]}return d}const ks=(0,mn.Z)(n=>({header:{padding:n.spacing(1,2,1,2.5),borderTop:`1px solid ${n.palette.grey.A100}`,borderBottom:`1px solid ${n.palette.grey.A100}`,color:n.palette.textSubtle,fontWeight:n.typography.fontWeightBold,position:"static",wordBreak:"normal"}}),{name:"BackstageTableHeader"})(qr.W$),ao=(0,mn.Z)(n=>({root:{padding:n.spacing(3,0,2.5,2.5)},title:{"& > h6":{fontWeight:"bold"}},searchField:{paddingRight:n.spacing(2)}}),{name:"BackstageTableToolbar"})(qr.UW),Ys=(0,m.Z)(()=>({root:{display:"flex",alignItems:"center",justifyContent:"space-between"},title:{fontWeight:"bold",fontSize:18,whiteSpace:"nowrap"}}),{name:"BackstageTableFiltersContainer"}),Js=(0,m.Z)(()=>({root:{display:"flex",alignItems:"start"}}),{name:"BackstageTable"});function Qs(n,a){return n.map(i=>{const d={};let g=i.cellStyle||{};if(i.highlight)if(d.color=a.palette.textContrast,typeof g=="object")g.fontWeight=a.typography.fontWeightBold;else{const v=g;g=(O,N,G)=>({...v(O,N,G),fontWeight:a.typography.fontWeightBold})}return{...i,headerStyle:d,cellStyle:g}})}function Xs(n,a){return(0,Fr.transform)(n,(i,d,g)=>{(0,Fr.isEqual)(d,a[g])||(i[g]=d)})}const oo={search:"",filtersOpen:!1,filters:{}};function _s(n){const{toolbarRef:a,setSearch:i,hasFilters:d,selectedFiltersLength:g,toggleFilters:v}=n,O=Ys(),N=(0,t.useCallback)(G=>{n.onSearchChanged(G),i(G)},[n,i]);return d?t.createElement("div",{className:O.root},t.createElement("div",{className:O.root},t.createElement(Y.Z,{onClick:v,"aria-label":"filter list"},t.createElement(ua.Z,null)),t.createElement(at.Z,{className:O.title},"Filters (",g,")")),t.createElement(ao,{...n,ref:a,onSearchChanged:N})):t.createElement(ao,{...n,ref:a,onSearchChanged:N})}function ei(n){const{data:a,columns:i,options:d,title:g,subtitle:v,filters:O,initialState:N,emptyContent:G,onStateChange:H,components:ne,..._}=n,ve=Js(),Ce=(0,U.Z)(),Ie={...oo,...N},[pt,Ut]=(0,t.useState)(Ie.filtersOpen),Yt=(0,t.useCallback)(()=>Ut(sn=>!sn),[Ut]),[Jt,dt]=(0,t.useState)(0),[Gt,en]=(0,t.useState)(a),[Qt,Xn]=(0,t.useState)(Ie.filters),Nn=Qs(i,Ce),[wr,Mt]=(0,t.useState)(Ie.search);(0,t.useEffect)(()=>{if(H){const sn=Xs({search:wr,filtersOpen:pt,filters:Qt},oo);H(sn)}},[wr,pt,Qt,H]);const yr={headerStyle:{textTransform:"uppercase"}},$r=(0,t.useCallback)(sn=>{var Sn;return(Sn=i.find(ar=>ar.title===sn))==null?void 0:Sn.field},[i]);(0,t.useEffect)(()=>{if(typeof a=="function")return;if(!Qt){en(a);return}const sn=Object.values(Qt);if(a&&sn.flat().length){const Sn=a.filter(ar=>!!Object.entries(Qt).filter(([,qn])=>!!qn.length).every(([qn,nn])=>{const Cn=ro(ar,$r(qn));return Array.isArray(Cn)&&Array.isArray(nn)?Cn.some(vr=>nn.includes(vr)):Array.isArray(Cn)?Cn.includes(nn):Array.isArray(nn)?nn.includes(Cn):Cn===nn}));en(Sn)}else en(a);dt(sn.flat().length)},[a,Qt,$r]);const Er=(sn,Sn)=>{const ar=nn=>{const Cn=new Set,vr=_n=>{_n!=null&&Cn.add(_n)};return Sn&&Sn.forEach(_n=>{const Ar=ro(_n,$r(nn));Array.isArray(Ar)?Ar.forEach(vr):vr(Ar)}),Cn},qn=nn=>({placeholder:"All results",label:nn.column,multiple:nn.type==="multiple-select",items:[...ar(nn.column)].sort().map(Cn=>({label:Cn,value:Cn}))});return sn.map(nn=>({type:nn.type,element:qn(nn)}))},ea=!!(O!=null&&O.length),ga=(0,t.useCallback)(sn=>t.createElement(_s,{setSearch:Mt,hasFilters:ea,selectedFiltersLength:Jt,toggleFilters:Yt,...sn}),[Yt,ea,Jt,Mt]),ta=typeof a!="function"&&a.length===0,na=i.length,pa=(0,t.useCallback)(sn=>G&&ta?t.createElement("tbody",null,t.createElement("tr",null,t.createElement("td",{colSpan:na},G))):t.createElement(qr.os,{...sn}),[ta,G,na]);return t.createElement("div",{className:ve.root},pt&&a&&typeof a!="function"&&(O==null?void 0:O.length)&&t.createElement(Gs,{filters:Er(O,a),selectedFilters:Qt,onChangeFilters:Xn}),t.createElement(qr.ZP,{components:{Header:ks,Toolbar:ga,Body:pa,...ne},options:{...yr,...d},columns:Nn,icons:Ks,title:t.createElement(t.Fragment,null,t.createElement(at.Z,{variant:"h5",component:"h2"},g),v&&t.createElement(at.Z,{color:"textSecondary",variant:"body1"},v)),data:typeof a=="function"?a:Gt,style:{width:"100%"},localization:{toolbar:{searchPlaceholder:"Filter"}},..._}))}const Dl=n=>{const{children:a,value:i,index:d,...g}=n;return React.createElement("div",{role:"tabpanel",hidden:i!==d,"aria-labelledby":`scrollable-auto-tab-${d}`,...g},i===d&&React.createElement(Box,{p:3},a))},ti=(0,m.Z)(()=>({root:{color:"#6E6E6E",overflow:"visible",fontSize:"1.5rem",textAlign:"center",borderRadius:"50%",backgroundColor:"#E6E6E6",marginLeft:n=>n.isNext?"auto":"0",marginRight:n=>n.isNext?"0":"10px","&:hover":{backgroundColor:"#E6E6E6",opacity:"1"}}}),{name:"BackstageTabIcon"}),Fl=n=>{const a=ti(n),{ariaLabel:i,onClick:d}=n;return React.createElement(IconButton,{onClick:d,className:a.root,size:"small",disableRipple:!0,disableFocusRipple:!0,"aria-label":i},n.children)},ni=(n,a)=>a?n?"20px":"0":"40px",ri=(0,m.Z)(n=>({root:{textTransform:"none",height:"64px",fontWeight:n.typography.fontWeightBold,fontSize:n.typography.pxToRem(13),color:n.palette.textSubtle,marginLeft:a=>ni(a.isFirstNav,a.isFirstIndex),width:"130px",minWidth:"130px","&:hover":{outline:"none",backgroundColor:"transparent",color:n.palette.textSubtle}}}),{name:"BackstageTab"}),Bl=n=>{const a=ri(n),{isFirstNav:i,isFirstIndex:d,...g}=n;return React.createElement(Tab,{classes:a,disableRipple:!0,...g})},ai=(0,m.Z)(n=>({indicator:{display:"flex",justifyContent:"center",backgroundColor:n.palette.tabbar.indicator,height:"4px"},flexContainer:{alignItems:"center"},root:{"&:last-child":{marginLeft:"auto"}}}),{name:"BackstageTabBar"}),Ml=n=>{const a=ai(n);return React.createElement(Tabs,{classes:a,...n,TabIndicatorProps:{children:React.createElement("span",null)}})},oi=(0,m.Z)(n=>({root:{flexGrow:1,width:"100%"},styledTabs:{backgroundColor:n.palette.background.paper},appbar:{boxShadow:"none",backgroundColor:n.palette.background.paper,paddingLeft:"10px",paddingRight:"10px"}}),{name:"BackstageTabs"});function wl(n){const{tabs:a}=n,i=oi(),[d,g]=useState([0,0]),[v,O]=useState(0),[N,G]=useState(0),[H,ne]=useState([[]]),_=useRef(),{width:ve}=useWindowSize(),Ce=(Jt,dt)=>{g([v,dt])},Ie=()=>{O(v-1)},pt=()=>{O(v+1)},Ut=()=>v+1<H.length;useEffect(()=>{const dt=v===0?1:2,Gt=_.current.offsetWidth-20-dt*30,en=d[0]*N+d[1],Qt=Math.floor(Gt/170);G(Qt),ne(chunkArray(a,Qt)),g([Math.floor(en/Qt),en%Qt])},[ve,a]);const Yt=v===d[0]?d[1]:!1;return React.createElement("div",{className:i.root},React.createElement(AppBar,{ref:_,className:i.appbar,position:"static"},React.createElement("div",null,React.createElement(StyledTabs,{value:Yt,onChange:Ce,selectionFollowsFocus:!0},v!==0&&React.createElement(StyledIcon,{onClick:Ie,ariaLabel:"navigate-before"},React.createElement(NavigateBeforeIcon,null)),H[v].map((Jt,dt)=>React.createElement(StyledTab,{value:dt,isFirstIndex:dt===0,isFirstNav:v===0,key:dt,icon:Jt.icon||void 0,label:Jt.label||void 0})),Ut()&&React.createElement(StyledIcon,{isNext:!0,onClick:pt,ariaLabel:"navigate-next"},React.createElement(NavigateNextIcon,null))))),Yt!==!1?H[v].map((Jt,dt)=>React.createElement(TabPanel,{key:dt,value:dt,index:Yt},Jt.content)):React.createElement(TabPanel,{key:"panel_outside_chunked_array",value:d[1],index:d[1]},H[d[0]][d[1]].content))}var $l=e(44311);function si(n,a){const i=n[n.length-1];if(!!i)return i>=.9?a.palette.status.ok:i>=.5?a.palette.status.warning:a.palette.status.error}function Ul(n){var i;const a=useTheme();return n.data?React.createElement(Sparklines,{width:120,height:30,min:0,max:1,...n},n.title&&React.createElement("title",null,n.title),React.createElement(SparklinesLine,{color:(i=n.color)!=null?i:si(n.data,a)})):null}const ii=n=>(0,m.Z)(a=>({container:{width:"100%",display:"flex",flexDirection:"row",flexWrap:"wrap",justifyContent:"flex-end",alignItems:"center",marginBottom:a.spacing(2),textAlign:n.textAlign},leftItemsBox:{flex:"1 1 auto",minWidth:0,overflow:"visible"},rightItemsBox:{flex:"0 1 auto",display:"flex",flexDirection:"row",flexWrap:"wrap",alignItems:"center",marginLeft:a.spacing(1),minWidth:0,overflow:"visible"},description:{},title:{display:"inline-flex",marginBottom:0}}),{name:"BackstageContentHeader"}),li=({title:n="Unknown page",className:a})=>t.createElement(at.Z,{variant:"h4",component:"h2",className:a,"data-testid":"header-title"},n);function ci(n){const{description:a,title:i,titleComponent:d=void 0,children:g,textAlign:v="left"}=n,O=ii({textAlign:v})(),N=d||t.createElement(li,{title:i,className:O.title});return t.createElement(t.Fragment,null,t.createElement(ia.q,{title:i}),t.createElement("div",{className:O.container},t.createElement("div",{className:O.leftItemsBox},N,a&&t.createElement(at.Z,{className:O.description,variant:"body2"},a)),t.createElement("div",{className:O.rightItemsBox},g)))}var ui=e.p+"static/mic-drop.fe3ef4d0..svg";const di=(0,m.Z)(n=>({micDrop:{maxWidth:"60%",position:"absolute",bottom:n.spacing(2),right:n.spacing(2),[n.breakpoints.down("xs")]:{maxWidth:"96%",position:"relative",bottom:"unset",right:"unset",margin:`${n.spacing(10)}px auto ${n.spacing(4)}px`}}}),{name:"BackstageErrorPageMicDrop"}),fi=()=>{const n=di();return t.createElement("img",{src:ui,className:n.micDrop,alt:"Girl dropping mic from her hands"})},mi=(0,m.Z)(n=>({container:{padding:n.spacing(8),[n.breakpoints.down("xs")]:{padding:n.spacing(2)}},title:{paddingBottom:n.spacing(5),[n.breakpoints.down("xs")]:{paddingBottom:n.spacing(4),fontSize:32}},subtitle:{color:n.palette.textSubtle}}),{name:"BackstageErrorPage"});function hi(n){const{status:a,statusMessage:i,additionalInfo:d,supportUrl:g}=n,v=mi(),O=(0,Mn.s0)(),N=Pa();return t.createElement(vt.Z,{container:!0,spacing:0,className:v.container},t.createElement(fi,null),t.createElement(vt.Z,{item:!0,xs:12,sm:8,md:4},t.createElement(at.Z,{"data-testid":"error",variant:"body1",className:v.subtitle},"ERROR ",a,": ",i),t.createElement(at.Z,{variant:"body1",className:v.subtitle},d),t.createElement(at.Z,{variant:"h2",className:v.title},"Looks like someone dropped the mic!"),t.createElement(at.Z,{variant:"h6"},t.createElement(b,{to:"#","data-testid":"go-back-link",onClick:()=>O(-1)},"Go back"),"... or please"," ",t.createElement(b,{to:g||N.url},"contact support")," if you think this is a bug.")))}var gi=e(16173);const pi=(0,mn.Z)({root:{textDecoration:"underline",cursor:"pointer"}},{name:"BackstageBreadcrumbsClickableText"})(at.Z),da=(0,mn.Z)({root:{textDecoration:"underline",color:"inherit"}},{name:"BackstageBreadcrumbsStyledBox"})(Fn.Z);function yi(n){const{children:a,...i}=n,[d,g]=t.useState(null),v=t.Children.toArray(a),[O,N,...G]=v,H=G.length?G.pop():v[v.length-1],ne=v.length>3,_=Ie=>{g(Ie.currentTarget)},ve=()=>{g(null)},Ce=Boolean(d);return t.createElement(t.Fragment,null,t.createElement(gi.Z,{"aria-label":"breadcrumb",...i},v.length>1&&t.createElement(da,{clone:!0},O),v.length>2&&t.createElement(da,{clone:!0},N),ne&&t.createElement(pi,{onClick:_},"..."),t.createElement(Fn.Z,{style:{fontStyle:"italic"}},H)),t.createElement(Sa.ZP,{open:Ce,anchorEl:d,onClose:ve,anchorOrigin:{vertical:"bottom",horizontal:"left"},transformOrigin:{vertical:"top",horizontal:"left"}},t.createElement(dn.Z,null,G.map((Ie,pt)=>t.createElement(xt.Z,{key:pt,button:!0},t.createElement(da,{clone:!0},Ie))))))}const Ei=(0,m.Z)(n=>({header:{gridArea:"pageHeader",padding:n.spacing(3),width:"100%",boxShadow:n.shadows[4],position:"relative",zIndex:100,display:"flex",flexDirection:"row",alignItems:"center",backgroundImage:n.page.backgroundImage,backgroundPosition:"center",backgroundSize:"cover",[n.breakpoints.down("sm")]:{flexWrap:"wrap"}},leftItemsBox:{maxWidth:"100%",flexGrow:1},rightItemsBox:{width:"auto"},title:{color:n.palette.bursts.fontColor,wordBreak:"break-word",fontSize:n.typography.h3.fontSize,marginBottom:0},subtitle:{color:n.palette.bursts.fontColor,opacity:.8,display:"inline-block",marginTop:n.spacing(1),maxWidth:"75ch"},type:{textTransform:"uppercase",fontSize:11,opacity:.8,marginBottom:n.spacing(1),color:n.palette.bursts.fontColor},breadcrumb:{color:n.palette.bursts.fontColor},breadcrumbType:{fontSize:"inherit",opacity:.7,marginRight:-n.spacing(.3),marginBottom:n.spacing(.3)},breadcrumbTitle:{fontSize:"inherit",marginLeft:-n.spacing(.3),marginBottom:n.spacing(.3)}}),{name:"BackstageHeader"}),vi=({type:n,typeLink:a,classes:i,pageTitle:d})=>n?a?t.createElement(yi,{className:i.breadcrumb},t.createElement(b,{to:a},n),t.createElement(at.Z,null,d)):t.createElement(at.Z,{className:i.type},n):null,Ai=({pageTitle:n,classes:a,tooltip:i})=>{const d=t.createElement(at.Z,{className:a.title,variant:"h1"},n);return i?t.createElement(te.ZP,{title:i,placement:"top-start"},d):d},Ri=({classes:n,subtitle:a})=>a?typeof a!="string"?t.createElement(t.Fragment,null,a):t.createElement(at.Z,{className:n.subtitle,variant:"subtitle2",component:"span"},a):null;function so(n){const{children:a,pageTitleOverride:i,style:d,subtitle:g,title:v,tooltip:O,type:N,typeLink:G}=n,H=Ei(),_=(0,l.useApi)(l.configApiRef).getOptionalString("app.title")||"Backstage",ve=i||v,Ce=v||i,Ie=`${ve} | %s | ${_}`,pt=`${ve} | ${_}`;return t.createElement(t.Fragment,null,t.createElement(ia.q,{titleTemplate:Ie,defaultTitle:pt}),t.createElement("header",{style:d,className:H.header},t.createElement(Fn.Z,{className:H.leftItemsBox},t.createElement(vi,{classes:H,type:N,typeLink:G,pageTitle:Ce}),t.createElement(Ai,{classes:H,pageTitle:Ce,tooltip:O}),t.createElement(Ri,{classes:H,subtitle:g})),t.createElement(vt.Z,{container:!0,className:H.rightItemsBox,spacing:4},a)))}const Si=(0,m.Z)(n=>({root:{textAlign:"left"},label:{color:n.palette.common.white,fontWeight:"bold",letterSpacing:0,fontSize:n.typography.fontSize,marginBottom:n.spacing(1)/2,lineHeight:1},value:{color:"rgba(255, 255, 255, 0.8)",fontSize:n.typography.fontSize,lineHeight:1}}),{name:"BackstageHeaderLabel"}),Ci=({value:n,className:a})=>t.createElement(at.Z,{className:a},n);function Ti(n){const{label:a,value:i,url:d}=n,g=Si(),v=t.createElement(Ci,{className:g.value,value:i||"<Unknown>"});return t.createElement(vt.Z,{item:!0},t.createElement("span",{className:g.root},t.createElement(at.Z,{className:g.label},a),d?t.createElement(b,{to:d},v):v))}const bi={hour:"2-digit",minute:"2-digit"};function io(n){const a=new Date,i=window.navigator.language,d=[];if(!n.has("homepage.clocks"))return d;const g=n.getConfigArray("homepage.clocks");for(const v of g)if(v.has("label")&&v.has("timezone")){let O=v.getString("label");const N={timeZone:v.getString("timezone"),...bi};try{new Date().toLocaleString(i,N)}catch{console.warn(`The timezone ${N.timeZone} is invalid. Defaulting to GMT`),N.timeZone="GMT",O="GMT"}const G=a.toLocaleTimeString(i,N);d.push({time:G,label:O})}return d}function Nl(n){const a=useApi(configApiRef),i=[],[d,g]=React.useState(i);return React.useEffect(()=>{g(io(a));const v=setInterval(()=>{g(io(a))},1e3);return()=>{clearInterval(v)}},[a]),d.length!==0?React.createElement(React.Fragment,null,d.map(v=>React.createElement(HeaderLabel,{label:v.label,value:v.time,key:v.label}))):null}const Pi=n=>(0,o.Z)({root:{color:n.palette.common.white,padding:n.spacing(2,2,3),backgroundImage:n.palette.bursts.gradient.linear,backgroundPosition:0,backgroundSize:"inherit"}}),Ii=(0,m.Z)(Pi,{name:"BackstageItemCardHeader"});function Li(n){const{title:a,subtitle:i,children:d}=n,g=Ii(n);return t.createElement("div",{className:g.root},i&&t.createElement(at.Z,{variant:"subtitle2",component:"h3"},i),a&&t.createElement(at.Z,{variant:"h6",component:"h4"},a),d)}function Zl(n){const{description:a,tags:i,title:d,type:g,subtitle:v,label:O,onClick:N,href:G}=n;return React.createElement(Card,null,React.createElement(CardMedia,null,React.createElement(ItemCardHeader,{title:d,subtitle:v||g})),React.createElement(CardContent,null,i!=null&&i.length?React.createElement(Box,null,i.map((H,ne)=>React.createElement(Chip,{size:"small",label:H,key:ne}))):null,a),React.createElement(CardActions,null,!G&&React.createElement(Button,{to:"#",onClick:N,color:"primary"},O),G&&React.createElement(Button,{to:G,color:"primary"},O)))}const Oi=n=>(0,o.Z)({root:{display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(22em, 1fr))",gridAutoRows:"1fr",gridGap:n.spacing(2)}}),xi=(0,m.Z)(Oi,{name:"BackstageItemCardGrid"});function Di(n){const{children:a,...i}=n,d=xi(i);return t.createElement("div",{className:d.root,...i},a)}var Fi=e(41547);const Bi=(0,m.Z)(()=>({root:({isMobile:n})=>({display:"grid",gridTemplateAreas:"'pageHeader pageHeader pageHeader' 'pageSubheader pageSubheader pageSubheader' 'pageNav pageContent pageSidebar'",gridTemplateRows:"max-content auto 1fr",gridTemplateColumns:"auto 1fr auto",height:n?"100%":"100vh",overflowY:"auto"})}),{name:"BackstagePage"});function lo(n){const{themeId:a,children:i}=n,{isMobile:d}=Br(),g=Bi({isMobile:d});return t.createElement(Fi.Z,{theme:v=>({...v,page:v.getPageTheme({themeId:a})})},t.createElement("main",{className:g.root},i))}function Mi(n){const{themeId:a,children:i,...d}=n;return t.createElement(lo,{themeId:a},t.createElement(so,{...d}),i)}var Rn=e(30195);const zl=Rn.z.object({providerInfo:Rn.z.object({}).catchall(Rn.z.unknown()).optional(),profile:Rn.z.object({email:Rn.z.string().optional(),displayName:Rn.z.string().optional(),picture:Rn.z.string().optional()}),backstageIdentity:Rn.z.object({token:Rn.z.string(),identity:Rn.z.object({type:Rn.z.literal("user"),userEntityRef:Rn.z.string(),ownershipEntityRefs:Rn.z.array(Rn.z.string())})})}),co={defaultTokenExpiryMillis:5*60*1e3,tokenExpiryMarginMillis:5*60*1e3};function wi(n){const a=new Date(Date.now()+co.defaultTokenExpiryMillis);if(!n)return a;const[i,d,g]=n.split("."),v=JSON.parse(atob(d));return typeof v.exp!="number"?a:new Date(v.exp*1e3-co.tokenExpiryMarginMillis)}class Wl{constructor(a){q(this,"options");q(this,"abortController");q(this,"state");this.options=a,this.abortController=new AbortController,this.state={type:"empty"}}async start(){await this.getSessionAsync()}getUserId(){const{backstageIdentity:a}=this.getSessionSync(),i=a.identity.userEntityRef,d=/^([^:/]+:)?([^:/]+\/)?([^:/]+)$/.exec(i);if(!d)throw new TypeError(`Invalid user entity reference "${i}"`);return d[3]}async getIdToken(){return(await this.getSessionAsync()).backstageIdentity.token}getProfile(){return this.getSessionSync().profile}async getProfileInfo(){return(await this.getSessionAsync()).profile}async getBackstageIdentity(){return(await this.getSessionAsync()).backstageIdentity.identity}async getCredentials(){return{token:(await this.getSessionAsync()).backstageIdentity.token}}async signOut(){this.abortController.abort()}getSessionSync(){if(this.state.type==="active")return this.state.session;if(this.state.type==="fetching"&&this.state.previous)return this.state.previous;throw new Error("No session available. Try reloading your browser page.")}async getSessionAsync(){if(this.state.type==="fetching")return this.state.promise;if(this.state.type==="active"&&new Date<this.state.expiresAt)return this.state.session;const a=this.state.type==="active"?this.state.session:void 0,i=this.fetchSession().then(d=>(this.state={type:"active",session:d,expiresAt:wi(d.backstageIdentity.token)},d),d=>{throw this.state={type:"failed",error:d},d});return this.state={type:"fetching",promise:i,previous:a},i}async fetchSession(){const a=await this.options.discoveryApi.getBaseUrl("auth"),i=await fetch(`${a}/${this.options.provider}/refresh`,{signal:this.abortController.signal,headers:{"x-requested-with":"XMLHttpRequest"},credentials:"include"});if(!i.ok)throw await ResponseError.fromResponse(i);return proxiedSessionSchema.parse(await i.json())}}const Hl=n=>{const a=useApi(discoveryApiRef),[{status:i,error:d},{execute:g}]=useAsync(async()=>{const v=new ProxiedSignInIdentity({provider:n.provider,discoveryApi:a});await v.start(),n.onSignInSuccess(v)});return useMountEffect(g),i==="loading"?React.createElement(Progress,null):d?React.createElement(ErrorPanel,{title:"You do not appear to be signed in. Please try reloading the browser page.",error:d}):null},$i=(0,m.Z)({container:{padding:0,listStyle:"none"},item:{display:"flex",flexDirection:"column",width:"100%",maxWidth:"400px",margin:0,padding:0}},{name:"BackstageSignInPage"}),fa=({children:n})=>{const a=$i();return t.createElement(vt.Z,{component:"li",item:!0,classes:a},n)};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 a="user:default/guest";return{type:"user",userEntityRef:a,ownershipEntityRefs:[a]}}async getCredentials(){return{}}async signOut(){}}function Ui(n){const[a,i,d]=n.split(".");return JSON.parse(atob(i))}class ha{constructor(a){this.result=a}getUserId(){return this.result.userId}static fromResult(a){return new ha(a)}async getIdToken(){var a,i;return(i=(a=this.result).getIdToken)==null?void 0:i.call(a)}getProfile(){return this.result.profile}async getProfileInfo(){return this.result.profile}async getBackstageIdentity(){const a=await this.getIdToken();if(!a){const g=`user:default/${this.getUserId()}`;return{type:"user",userEntityRef:g,ownershipEntityRefs:[g]}}const{sub:i,ent:d}=Ui(a);return{type:"user",userEntityRef:i,ownershipEntityRefs:d!=null?d:[]}}async getCredentials(){var i,d;return{token:await((d=(i=this.result).getIdToken)==null?void 0:d.call(i))}}async signOut(){var a,i;return(i=(a=this.result).signOut)==null?void 0:i.call(a)}}class Mr{constructor(a,i,d){q(this,"profilePromise");this.identity=a,this.authApi=i,this.profile=d}static createGuest(){return new ma}static fromLegacy(a){return ha.fromResult(a)}static create(a){return new Mr(a.identity,a.authApi,a.profile)}getUserId(){const a=this.identity.userEntityRef,i=/^([^:/]+:)?([^:/]+\/)?([^:/]+)$/.exec(a);if(!i)throw new TypeError(`Invalid user entity reference "${a}"`);return i[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(a){throw this.profilePromise=void 0,a}}async getBackstageIdentity(){return this.identity}async getCredentials(){return{token:(await this.authApi.getBackstageIdentity()).token}}async signOut(){return this.authApi.signOut()}}const Ni={Component:({config:n,onSignInSuccess:a})=>{const{apiRef:i,title:d,message:g}=n,v=(0,l.useApi)(i),O=(0,l.useApi)(l.errorApiRef),N=async()=>{try{const G=await v.getBackstageIdentity({instantPopup:!0});if(!G)throw new Error(`The ${d} provider is not configured to support sign-in`);const H=await v.getProfile();a(Mr.create({identity:G.identity,profile:H,authApi:v}))}catch(G){O.post(new er.SP("Login failed",G))}};return t.createElement(fa,null,t.createElement(Kn,{variant:"fullHeight",title:d,actions:t.createElement(y.Z,{color:"primary",variant:"outlined",onClick:N},"Sign In")},t.createElement(at.Z,{variant:"body1"},g)))},loader:async(n,a)=>{const i=n.get(a),d=await i.getBackstageIdentity({optional:!0});if(!d)return;const g=await i.getProfile();return Mr.create({identity:d.identity,profile:g,authApi:i})}},Zi={Component:({onSignInSuccess:n})=>t.createElement(fa,null,t.createElement(Kn,{title:"Guest",variant:"fullHeight",actions:t.createElement(y.Z,{color:"primary",variant:"outlined",onClick:()=>n(new ma)},"Enter")},t.createElement(at.Z,{variant:"body1"},"Enter as a Guest User.",t.createElement("br",null),"You will not have a verified identity,",t.createElement("br",null),"meaning some features might be unavailable."))),loader:async()=>new ma};var zi=e(63955),uo=e(86619),fo=e(74828),Wi=e(45455),Hi=e.n(Wi);const ji=/^[a-z0-9_\-]+\.[a-z0-9_\-]+\.[a-z0-9_\-]+$/i,Vi=(0,m.Z)(n=>({form:{display:"flex",flexFlow:"column nowrap"},button:{alignSelf:"center",marginTop:n.spacing(2)}}),{name:"BackstageCustomProvider"}),mo=n=>{const{ref:a,...i}=n;return{inputRef:a,...i}},Gi={Component:({onSignInSuccess:n})=>{const a=Vi(),{register:i,handleSubmit:d,formState:g}=(0,zi.cI)({mode:"onChange"}),{errors:v}=g,O=({userId:N})=>{n(Mr.fromLegacy({userId:N,profile:{email:`${N}@example.com`}}))};return t.createElement(fa,null,t.createElement(Kn,{title:"Custom User",variant:"fullHeight"},t.createElement(at.Z,{variant:"body1"},"Enter your own User ID and credentials.",t.createElement("br",null),"This selection will not be stored."),t.createElement("form",{className:a.form,onSubmit:d(O)},t.createElement(C.Z,null,t.createElement(uo.Z,{...mo(i("userId",{required:!0})),label:"User ID",margin:"normal",error:Boolean(v.userId)}),v.userId&&t.createElement(fo.Z,{error:!0},v.userId.message)),t.createElement(C.Z,null,t.createElement(uo.Z,{...mo(i("idToken",{required:!1,validate:N=>!N||ji.test(N)||"Token is not a valid OpenID Connect JWT Token"})),label:"ID Token (optional)",margin:"normal",autoComplete:"off",error:Boolean(v.idToken)}),v.idToken&&t.createElement(fo.Z,{error:!0},v.idToken.message)),t.createElement(y.Z,{type:"submit",color:"primary",variant:"outlined",className:a.button,disabled:!(g!=null&&g.isDirty)||!Hi()(v)},"Continue"))))},loader:async()=>{}},_r="@backstage/core:SignInPage:provider",ho={guest:Zi,custom:Gi,common:Ni};function go(n,a){if(n in a)throw new Error(`"${n}" ID is duplicated. IDs of identity providers have to be unique.`)}function Jl(n){return n.reduce((i,d)=>{if(typeof d=="string")return go(d,i),i[d]={components:ho[d],id:d},i;const{id:g}=d;return go(g,i),i[g]={components:ho.common,id:g,config:d},i},{})}const Ql=(n,a)=>{const i=useApi(errorApiRef),d=useApiHolder(),[g,v]=useState(!0),O=useCallback(G=>{a(IdentityApiSignOutProxy.from({identityApi:G,signOut:async()=>{var H;localStorage.removeItem(_r),await((H=G.signOut)==null?void 0:H.call(G))}}))},[a]);useLayoutEffect(()=>{var _;if(!g)return;const G=localStorage.getItem(_r);if(G===null){v(!1);return}const H=n[G];if(!H){v(!1);return}let ne=!1;return H.components.loader(d,(_=H.config)==null?void 0:_.apiRef).then(ve=>{ne||(ve?O(ve):v(!1))}).catch(ve=>{ne||(localStorage.removeItem(_r),i.post(ve),v(!1))}),()=>{ne=!0}},[g,i,a,d,n,O]);const N=useMemo(()=>Object.keys(n).map(G=>{const H=n[G],{Component:ne}=H.components,_=ve=>{localStorage.setItem(_r,H.id),O(ve)};return React.createElement(ne,{key:H.id,config:H.config,onSignInSuccess:_})}),[n,O]);return[g,N]},Ki=({onSignInSuccess:n,providers:a=[],title:i,align:d="left"})=>{const g=useApi(configApiRef),v=useStyles(),O=getSignInProviders(a),[N,G]=useSignInProviders(O,n);return N?React.createElement(Progress,null):React.createElement(Page,{themeId:"home"},React.createElement(Header,{title:g.getString("app.title")}),React.createElement(Content,null,i&&React.createElement(ContentHeader,{title:i,textAlign:d}),React.createElement(Grid,{container:!0,justifyContent:d==="center"?d:"flex-start",spacing:2,component:"ul",classes:v},G)))},ki=({provider:n,auto:a,onSignInSuccess:i})=>{const d=useStyles(),g=useApi(n.apiRef),v=useApi(configApiRef),[O,N]=useState(),[G,H]=useState(!1),ne=async({checkExisting:_,showPopup:ve})=>{try{let Ce;if(_&&(Ce=await g.getBackstageIdentity({optional:!0})),!Ce&&(ve||a)&&(H(!0),Ce=await g.getBackstageIdentity({instantPopup:!0}),!Ce))throw new Error(`The ${n.title} provider is not configured to support sign-in`);if(!Ce){H(!0);return}const Ie=await g.getProfile();i(UserIdentity.create({identity:Ce.identity,authApi:g,profile:Ie}))}catch(Ce){N(Ce),H(!0)}};return useMountEffect(()=>ne({checkExisting:!0})),G?React.createElement(Page,{themeId:"home"},React.createElement(Header,{title:v.getString("app.title")}),React.createElement(Content,null,React.createElement(Grid,{container:!0,justifyContent:"center",spacing:2,component:"ul",classes:d},React.createElement(GridItem,null,React.createElement(InfoCard,{variant:"fullHeight",title:n.title,actions:React.createElement(Button,{color:"primary",variant:"outlined",onClick:()=>{ne({showPopup:!0})}},"Sign In")},React.createElement(Typography,{variant:"body1"},n.message),O&&O.name!=="PopupRejectedError"&&React.createElement(Typography,{variant:"body1",color:"error"},O.message)))))):React.createElement(Progress,null)};function Xl(n){return"provider"in n?React.createElement(ki,{...n}):React.createElement(Ki,{...n})}const Yi=(0,m.Z)(n=>({root:{padding:n.spacing(0,2,0,2.5),minHeight:n.spacing(3)},indicator:{backgroundColor:n.palette.info.main,height:n.spacing(.3)}}),{name:"BackstageTabbedCard"}),Ji=(0,mn.Z)(n=>({root:{padding:n.spacing(2,2,2,2.5),display:"inline-block"},title:{fontWeight:700},subheader:{paddingTop:n.spacing(1)}}),{name:"BackstageTabbedCardBoldHeader"})(dr.Z);function ql(n){const{slackChannel:a,errorBoundaryProps:i,children:d,title:g,deepLink:v,value:O,onChange:N}=n,G=Yi(),[H,ne]=useState(0),_=N||((Ie,pt)=>ne(pt));let ve;O?React.Children.map(d,Ie=>{React.isValidElement(Ie)&&(Ie==null?void 0:Ie.props.value)===O&&(ve=Ie==null?void 0:Ie.props.children)}):React.Children.map(d,(Ie,pt)=>{React.isValidElement(Ie)&&pt===H&&(ve=Ie==null?void 0:Ie.props.children)});const Ce=i||(a?{slackChannel:a}:{});return React.createElement(Card,null,React.createElement(ErrorBoundary,{...Ce},g&&React.createElement(Ji,{title:g}),React.createElement(Tabs,{selectionFollowsFocus:!0,classes:G,value:O||H,onChange:_},d),React.createElement(Divider,null),React.createElement(CardContent,null,ve),v&&React.createElement(BottomLink,{...v})))}const Qi=(0,m.Z)(n=>({root:{minWidth:n.spacing(6),minHeight:n.spacing(3),margin:n.spacing(0,2,0,0),padding:n.spacing(.5,0,.5,0),textTransform:"none","&:hover":{opacity:1,backgroundColor:"transparent",color:n.palette.text.primary}},selected:{fontWeight:"bold"}}),{name:"BackstageCardTab"});function _l(n){const{children:a,...i}=n,d=Qi();return React.createElement(Tab,{disableRipple:!0,classes:d,...i})}},88609:function(ee,s,e){"use strict";e.d(s,{Os:function(){return u},fC:function(){return A}});var r=e(76241),t=e(2784);const l=(0,r.CT)("analytics-context"),u=()=>{const o=(0,t.useContext)(l);if(o===void 0)return{routeRef:"unknown",pluginId:"root",extension:"App"};const c=o.atVersion(1);if(c===void 0)throw new Error("No context found for version 1.");return c},A=o=>{const{attributes:c,children:f}=o,p={...u(),...c},E=(0,r.EI)({1:p});return t.createElement(l.Provider,{value:E},f)};function m(o,c){const f=y=>React.createElement(A,{attributes:c},React.createElement(o,{...y}));return f.displayName=`WithAnalyticsContext(${o.displayName||o.name||"Component"})`,f}},28461:function(ee,s,e){"use strict";e.d(s,{f:function(){return r.fC},z:function(){return m}});var r=e(88609),t=e(27399),l=e(2784);class u{constructor(c,f={routeRef:"unknown",pluginId:"root",extension:"App"}){this.analyticsApi=c,this.context=f}setContext(c){this.context=c}captureEvent(c,f,{value:y,attributes:p}={}){try{this.analyticsApi.captureEvent({action:c,subject:f,value:y,attributes:p,context:this.context})}catch(E){console.warn("Error during analytics event capture. %o",E)}}}function A(){try{return(0,t.useApi)(t.analyticsApiRef)}catch{return{captureEvent:()=>{}}}}function m(){const o=(0,l.useRef)(null),c=(0,r.Os)(),f=A();function y(){return o.current===null&&(o.current=new u(f)),o.current}const p=y();return p.setContext(c),p}},39135:function(ee,s,e){"use strict";e.d(s,{CL:function(){return M},sM:function(){return t},$v:function(){return p},v_:function(){return E},hg:function(){return T},uB:function(){return y},bq:function(){return f},Ds:function(){return I},NW:function(){return B},VE:function(){return j},W0:function(){return b},gP:function(){return L},F4:function(){return u},ux:function(){return m},Kp:function(){return l},$4:function(){return D},p_:function(){return o},ZM:function(){return U},D:function(){return A},gW:function(){return c},E6:function(){return Y}});var r=e(86833),t;(function(te){const ue="SignedIn";te.SignedIn=ue;const Re="SignedOut";te.SignedOut=Re})(t||(t={}));const l=(0,r.createApiRef)({id:"core.auth.google"}),u=(0,r.createApiRef)({id:"core.auth.github"}),A=(0,r.createApiRef)({id:"core.auth.okta"}),m=(0,r.createApiRef)({id:"core.auth.gitlab"}),o=(0,r.createApiRef)({id:"core.auth.microsoft"}),c=(0,r.createApiRef)({id:"core.auth.onelogin"}),f=(0,r.createApiRef)({id:"core.auth.bitbucket"}),y=(0,r.createApiRef)({id:"core.auth.atlassian"}),p=(0,r.createApiRef)({id:"core.alert"}),E=(0,r.createApiRef)({id:"core.analytics"}),T=(0,r.createApiRef)({id:"core.apptheme"}),I=(0,r.createApiRef)({id:"core.config"}),B=(0,r.createApiRef)({id:"core.discovery"}),j=(0,r.createApiRef)({id:"core.error"});var M;(function(te){te[te.None=0]="None";const Re=1;te[te.Active=Re]="Active"})(M||(M={}));const b=(0,r.createApiRef)({id:"core.featureflags"}),L=(0,r.createApiRef)({id:"core.fetch"}),D=(0,r.createApiRef)({id:"core.identity"}),U=(0,r.createApiRef)({id:"core.oauthrequest"}),Y=(0,r.createApiRef)({id:"core.storage"})},27399:function(ee,s,e){"use strict";e.d(s,{FeatureFlagState:function(){return t.CL},SessionState:function(){return t.sM},alertApiRef:function(){return t.$v},analyticsApiRef:function(){return t.v_},appThemeApiRef:function(){return t.hg},atlassianAuthApiRef:function(){return t.uB},bitbucketAuthApiRef:function(){return t.bq},configApiRef:function(){return t.Ds},createApiFactory:function(){return r.createApiFactory},createApiRef:function(){return r.createApiRef},discoveryApiRef:function(){return t.NW},errorApiRef:function(){return t.VE},featureFlagsApiRef:function(){return t.W0},fetchApiRef:function(){return t.gP},githubAuthApiRef:function(){return t.F4},gitlabAuthApiRef:function(){return t.ux},googleAuthApiRef:function(){return t.Kp},identityApiRef:function(){return t.$4},microsoftAuthApiRef:function(){return t.p_},oauthRequestApiRef:function(){return t.ZM},oktaAuthApiRef:function(){return t.D},oneloginAuthApiRef:function(){return t.gW},storageApiRef:function(){return t.E6},useApi:function(){return r.useApi},useApiHolder:function(){return r.useApiHolder}});var r=e(86833);e.o(r,"FeatureFlagState")&&e.d(s,{FeatureFlagState:function(){return r.FeatureFlagState}}),e.o(r,"SessionState")&&e.d(s,{SessionState:function(){return r.SessionState}}),e.o(r,"alertApiRef")&&e.d(s,{alertApiRef:function(){return r.alertApiRef}}),e.o(r,"analyticsApiRef")&&e.d(s,{analyticsApiRef:function(){return r.analyticsApiRef}}),e.o(r,"appThemeApiRef")&&e.d(s,{appThemeApiRef:function(){return r.appThemeApiRef}}),e.o(r,"atlassianAuthApiRef")&&e.d(s,{atlassianAuthApiRef:function(){return r.atlassianAuthApiRef}}),e.o(r,"attachComponentData")&&e.d(s,{attachComponentData:function(){return r.attachComponentData}}),e.o(r,"bitbucketAuthApiRef")&&e.d(s,{bitbucketAuthApiRef:function(){return r.bitbucketAuthApiRef}}),e.o(r,"configApiRef")&&e.d(s,{configApiRef:function(){return r.configApiRef}}),e.o(r,"createComponentExtension")&&e.d(s,{createComponentExtension:function(){return r.createComponentExtension}}),e.o(r,"createExternalRouteRef")&&e.d(s,{createExternalRouteRef:function(){return r.createExternalRouteRef}}),e.o(r,"createPlugin")&&e.d(s,{createPlugin:function(){return r.createPlugin}}),e.o(r,"createReactExtension")&&e.d(s,{createReactExtension:function(){return r.createReactExtension}}),e.o(r,"createRoutableExtension")&&e.d(s,{createRoutableExtension:function(){return r.createRoutableExtension}}),e.o(r,"createRouteRef")&&e.d(s,{createRouteRef:function(){return r.createRouteRef}}),e.o(r,"discoveryApiRef")&&e.d(s,{discoveryApiRef:function(){return r.discoveryApiRef}}),e.o(r,"errorApiRef")&&e.d(s,{errorApiRef:function(){return r.errorApiRef}}),e.o(r,"featureFlagsApiRef")&&e.d(s,{featureFlagsApiRef:function(){return r.featureFlagsApiRef}}),e.o(r,"fetchApiRef")&&e.d(s,{fetchApiRef:function(){return r.fetchApiRef}}),e.o(r,"getComponentData")&&e.d(s,{getComponentData:function(){return r.getComponentData}}),e.o(r,"githubAuthApiRef")&&e.d(s,{githubAuthApiRef:function(){return r.githubAuthApiRef}}),e.o(r,"gitlabAuthApiRef")&&e.d(s,{gitlabAuthApiRef:function(){return r.gitlabAuthApiRef}}),e.o(r,"googleAuthApiRef")&&e.d(s,{googleAuthApiRef:function(){return r.googleAuthApiRef}}),e.o(r,"identityApiRef")&&e.d(s,{identityApiRef:function(){return r.identityApiRef}}),e.o(r,"microsoftAuthApiRef")&&e.d(s,{microsoftAuthApiRef:function(){return r.microsoftAuthApiRef}}),e.o(r,"oauthRequestApiRef")&&e.d(s,{oauthRequestApiRef:function(){return r.oauthRequestApiRef}}),e.o(r,"oktaAuthApiRef")&&e.d(s,{oktaAuthApiRef:function(){return r.oktaAuthApiRef}}),e.o(r,"oneloginAuthApiRef")&&e.d(s,{oneloginAuthApiRef:function(){return r.oneloginAuthApiRef}}),e.o(r,"storageApiRef")&&e.d(s,{storageApiRef:function(){return r.storageApiRef}}),e.o(r,"useApp")&&e.d(s,{useApp:function(){return r.useApp}}),e.o(r,"useElementFilter")&&e.d(s,{useElementFilter:function(){return r.useElementFilter}}),e.o(r,"useRouteRef")&&e.d(s,{useRouteRef:function(){return r.useRouteRef}}),e.o(r,"useRouteRefParams")&&e.d(s,{useRouteRefParams:function(){return r.useRouteRefParams}});var t=e(39135)},90515:function(ee,s,e){"use strict";e.d(s,{T:function(){return t}});class r{constructor(u){if(this.config=u,!u.id.split(".").flatMap(m=>m.split("-")).every(m=>m.match(/^[a-z][a-z0-9]*$/)))throw new Error(`API id must only contain period separated lowercase alphanum tokens with dashes, got '${u.id}'`)}get id(){return this.config.id}get T(){throw new Error(`tried to read ApiRef.T of ${this}`)}toString(){return`apiRef{${this.config.id}}`}}function t(l){return new r(l)}},25182:function(ee,s,e){"use strict";e.d(s,{n:function(){return r}});function r(t,l){return"id"in t?{api:t,deps:{},factory:()=>l}:t}},86833:function(ee,s,e){"use strict";e.d(s,{createApiFactory:function(){return A.n},createApiRef:function(){return t.T},useApi:function(){return r.h_},useApiHolder:function(){return r.I_}});var r=e(5761),t=e(90515),l=e(16362),u=e.n(l);e.o(l,"FeatureFlagState")&&e.d(s,{FeatureFlagState:function(){return l.FeatureFlagState}}),e.o(l,"SessionState")&&e.d(s,{SessionState:function(){return l.SessionState}}),e.o(l,"alertApiRef")&&e.d(s,{alertApiRef:function(){return l.alertApiRef}}),e.o(l,"analyticsApiRef")&&e.d(s,{analyticsApiRef:function(){return l.analyticsApiRef}}),e.o(l,"appThemeApiRef")&&e.d(s,{appThemeApiRef:function(){return l.appThemeApiRef}}),e.o(l,"atlassianAuthApiRef")&&e.d(s,{atlassianAuthApiRef:function(){return l.atlassianAuthApiRef}}),e.o(l,"attachComponentData")&&e.d(s,{attachComponentData:function(){return l.attachComponentData}}),e.o(l,"bitbucketAuthApiRef")&&e.d(s,{bitbucketAuthApiRef:function(){return l.bitbucketAuthApiRef}}),e.o(l,"configApiRef")&&e.d(s,{configApiRef:function(){return l.configApiRef}}),e.o(l,"createApiFactory")&&e.d(s,{createApiFactory:function(){return l.createApiFactory}}),e.o(l,"createComponentExtension")&&e.d(s,{createComponentExtension:function(){return l.createComponentExtension}}),e.o(l,"createExternalRouteRef")&&e.d(s,{createExternalRouteRef:function(){return l.createExternalRouteRef}}),e.o(l,"createPlugin")&&e.d(s,{createPlugin:function(){return l.createPlugin}}),e.o(l,"createReactExtension")&&e.d(s,{createReactExtension:function(){return l.createReactExtension}}),e.o(l,"createRoutableExtension")&&e.d(s,{createRoutableExtension:function(){return l.createRoutableExtension}}),e.o(l,"createRouteRef")&&e.d(s,{createRouteRef:function(){return l.createRouteRef}}),e.o(l,"discoveryApiRef")&&e.d(s,{discoveryApiRef:function(){return l.discoveryApiRef}}),e.o(l,"errorApiRef")&&e.d(s,{errorApiRef:function(){return l.errorApiRef}}),e.o(l,"featureFlagsApiRef")&&e.d(s,{featureFlagsApiRef:function(){return l.featureFlagsApiRef}}),e.o(l,"fetchApiRef")&&e.d(s,{fetchApiRef:function(){return l.fetchApiRef}}),e.o(l,"getComponentData")&&e.d(s,{getComponentData:function(){return l.getComponentData}}),e.o(l,"githubAuthApiRef")&&e.d(s,{githubAuthApiRef:function(){return l.githubAuthApiRef}}),e.o(l,"gitlabAuthApiRef")&&e.d(s,{gitlabAuthApiRef:function(){return l.gitlabAuthApiRef}}),e.o(l,"googleAuthApiRef")&&e.d(s,{googleAuthApiRef:function(){return l.googleAuthApiRef}}),e.o(l,"identityApiRef")&&e.d(s,{identityApiRef:function(){return l.identityApiRef}}),e.o(l,"microsoftAuthApiRef")&&e.d(s,{microsoftAuthApiRef:function(){return l.microsoftAuthApiRef}}),e.o(l,"oauthRequestApiRef")&&e.d(s,{oauthRequestApiRef:function(){return l.oauthRequestApiRef}}),e.o(l,"oktaAuthApiRef")&&e.d(s,{oktaAuthApiRef:function(){return l.oktaAuthApiRef}}),e.o(l,"oneloginAuthApiRef")&&e.d(s,{oneloginAuthApiRef:function(){return l.oneloginAuthApiRef}}),e.o(l,"storageApiRef")&&e.d(s,{storageApiRef:function(){return l.storageApiRef}}),e.o(l,"useApp")&&e.d(s,{useApp:function(){return l.useApp}}),e.o(l,"useElementFilter")&&e.d(s,{useElementFilter:function(){return l.useElementFilter}}),e.o(l,"useRouteRef")&&e.d(s,{useRouteRef:function(){return l.useRouteRef}}),e.o(l,"useRouteRefParams")&&e.d(s,{useRouteRefParams:function(){return l.useRouteRefParams}});var A=e(25182)},16362:function(){},5761:function(ee,s,e){"use strict";e.d(s,{I_:function(){return l},h_:function(){return u}});var r=e(2784),t=e(76241);function l(){const m=(0,t.Vt)("api-context");if(!m)throw new Error("API context is not available");const o=m.atVersion(1);if(!o)throw new Error("ApiContext v1 not available");return o}function u(m){const c=l().get(m);if(!c)throw new Error(`No implementation available for ${m}`);return c}function A(m){return function(c){const f=p=>{const E=l(),T={};for(const I in m)if(m.hasOwnProperty(I)){const B=m[I],j=E.get(B);if(!j)throw new Error(`No implementation available for ${B}`);T[I]=j}return React.createElement(c,{...p,...T})},y=c.displayName||c.name||"Component";return f.displayName=`withApis(${y})`,f}}},31311:function(ee,s,e){"use strict";e.d(s,{useApp:function(){return r.q}});var r=e(32483),t=e(67229),l=e.n(t);e.o(t,"attachComponentData")&&e.d(s,{attachComponentData:function(){return t.attachComponentData}}),e.o(t,"createApiFactory")&&e.d(s,{createApiFactory:function(){return t.createApiFactory}}),e.o(t,"createApiRef")&&e.d(s,{createApiRef:function(){return t.createApiRef}}),e.o(t,"createComponentExtension")&&e.d(s,{createComponentExtension:function(){return t.createComponentExtension}}),e.o(t,"createExternalRouteRef")&&e.d(s,{createExternalRouteRef:function(){return t.createExternalRouteRef}}),e.o(t,"createPlugin")&&e.d(s,{createPlugin:function(){return t.createPlugin}}),e.o(t,"createReactExtension")&&e.d(s,{createReactExtension:function(){return t.createReactExtension}}),e.o(t,"createRoutableExtension")&&e.d(s,{createRoutableExtension:function(){return t.createRoutableExtension}}),e.o(t,"createRouteRef")&&e.d(s,{createRouteRef:function(){return t.createRouteRef}}),e.o(t,"getComponentData")&&e.d(s,{getComponentData:function(){return t.getComponentData}}),e.o(t,"useApi")&&e.d(s,{useApi:function(){return t.useApi}}),e.o(t,"useApiHolder")&&e.d(s,{useApiHolder:function(){return t.useApiHolder}}),e.o(t,"useElementFilter")&&e.d(s,{useElementFilter:function(){return t.useElementFilter}}),e.o(t,"useRouteRef")&&e.d(s,{useRouteRef:function(){return t.useRouteRef}}),e.o(t,"useRouteRefParams")&&e.d(s,{useRouteRefParams:function(){return t.useRouteRefParams}})},67229:function(){},32483:function(ee,s,e){"use strict";e.d(s,{q:function(){return t}});var r=e(76241);const t=()=>{const l=(0,r.Vt)("app-context");if(!l)throw new Error("App context is not available");const u=l.atVersion(1);if(!u)throw new Error("AppContext v1 not available");return u}},74181:function(ee,s,e){"use strict";e.d(s,{R5:function(){return u},CO:function(){return E},YO:function(){return T},P4:function(){return p},IY:function(){return A},vJ:function(){return M}});var r=e(76241);const t=(0,r.uW)("component-data-store",()=>new WeakMap),l="__backstage_data";function u(b,L,D){var te;const U=b;let Y=(te=U[l])!=null?te:t.get(b);if(Y||(Y={map:new Map},Object.defineProperty(U,l,{enumerable:!1,configurable:!0,writable:!1,value:Y}),t.set(b,Y)),Y.map.has(L)){const ue=b.displayName||b.name;throw new Error(`Attempted to attach duplicate data "${L}" to component "${ue}"`)}Y.map.set(L,D)}function A(b,L){var Y;if(!b)return;const D=b.type;if(!D)return;const U=(Y=D[l])!=null?Y:t.get(D);if(!!U)return U.map.get(L)}var m=e(2784),o=e(88609),c=e(31311),f=e(82772);class y extends m.Component{constructor(){super(...arguments);q(this,"state",{error:void 0});q(this,"handleErrorReset",()=>{this.setState({error:void 0})})}static getDerivedStateFromError(D){return{error:D}}render(){const{error:D}=this.state,{app:U,plugin:Y}=this.props,{ErrorBoundaryFallback:te}=U.getComponents();return D?m.createElement(te,{error:D,resetError:this.handleErrorReset,plugin:Y}):this.props.children}}function p(b){const{component:L,mountPoint:D,name:U}=b;return T({component:{lazy:()=>L().then(Y=>{const te=Re=>{try{(0,f.tg)(D)}catch(we){if(typeof we=="object"&&we!==null){const{message:ge}=we;if(typeof ge=="string"&&ge.startsWith("No path for "))throw new Error(`Routable extension component with mount point ${D} 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 we}return m.createElement(Y,{...Re})},ue=U||Y.displayName||Y.name||"LazyComponent";return te.displayName=`RoutableExtension(${ue})`,te},Y=>ue=>{const Re=(0,c.useApp)(),{BootErrorPage:we}=Re.getComponents();return m.createElement(we,{step:"load-chunk",error:Y})})},data:{"core.mountPoint":D},name:U})}function E(b){const{component:L,name:D}=b;return T({component:L,name:D})}function T(b){const{data:L={},name:D}=b;D||console.warn("Declaring extensions without name is DEPRECATED. Make sure that all usages of createReactExtension, createComponentExtension and createRoutableExtension provide a name.");let U;if("lazy"in b.component){const te=b.component.lazy;U=(0,m.lazy)(()=>te().then(ue=>({default:ue})))}else U=b.component.sync;const Y=D||U.displayName||U.name||"Component";return{expose(te){const ue=Re=>{const we=(0,c.useApp)(),{Progress:ge}=we.getComponents(),ze=L==null?void 0:L["core.mountPoint"];return m.createElement(m.Suspense,{fallback:m.createElement(ge,null)},m.createElement(y,{app:we,plugin:te},m.createElement(o.fC,{attributes:{pluginId:te.getId(),...D&&{extension:D},...ze&&{routeRef:ze.id}}},m.createElement(U,{...Re}))))};u(ue,"core.plugin",te);for(const[Re,we]of Object.entries(L))u(ue,Re,we);return ue.displayName=`Extension(${Y})`,ue}}}var I=e(27399);function B(b,L,D,U){return m.Children.toArray(b).flatMap(Y=>{if(!(0,m.isValidElement)(Y))return[];if(Y.type===m.Fragment)return B(Y.props.children,L,D,U);if(A(Y,"core.featureFlagged")){const te=Y.props;return("with"in te?L.isActive(te.with):!L.isActive(te.without))?B(Y.props.children,L,D,U):[]}if(D===void 0||D(Y))return[Y];if(U)throw new Error(U);return B(Y.props.children,L,D,U)})}class j{constructor(L,D){this.node=L,this.featureFlagsApi=D}selectByComponentData(L){const D=B(this.node,this.featureFlagsApi,U=>A(U,L.key)!==void 0,L.withStrictError);return new j(D,this.featureFlagsApi)}findComponentData(L){return B(this.node,this.featureFlagsApi,U=>A(U,L.key)!==void 0).map(U=>A(U,L.key)).filter(U=>U!==void 0)}getElements(){return B(this.node,this.featureFlagsApi)}}function M(b,L,D=[]){const U=(0,I.useApi)(I.featureFlagsApiRef),Y=new j(b,U);return(0,m.useMemo)(()=>L(Y),[b,...D])}},80274:function(){},36964:function(ee,s,e){"use strict";e.d(s,{AnalyticsContext:function(){return r.f},FeatureFlagState:function(){return t.FeatureFlagState},SessionState:function(){return t.SessionState},alertApiRef:function(){return t.alertApiRef},analyticsApiRef:function(){return t.analyticsApiRef},appThemeApiRef:function(){return t.appThemeApiRef},atlassianAuthApiRef:function(){return t.atlassianAuthApiRef},attachComponentData:function(){return u.R5},bitbucketAuthApiRef:function(){return t.bitbucketAuthApiRef},configApiRef:function(){return t.configApiRef},createComponentExtension:function(){return u.CO},createExternalRouteRef:function(){return c.x8},createPlugin:function(){return o.r},createReactExtension:function(){return u.YO},createRoutableExtension:function(){return u.P4},createRouteRef:function(){return c.NT},discoveryApiRef:function(){return t.discoveryApiRef},errorApiRef:function(){return t.errorApiRef},featureFlagsApiRef:function(){return t.featureFlagsApiRef},fetchApiRef:function(){return t.fetchApiRef},getComponentData:function(){return u.IY},githubAuthApiRef:function(){return t.githubAuthApiRef},gitlabAuthApiRef:function(){return t.gitlabAuthApiRef},googleAuthApiRef:function(){return t.googleAuthApiRef},identityApiRef:function(){return t.identityApiRef},microsoftAuthApiRef:function(){return t.microsoftAuthApiRef},oauthRequestApiRef:function(){return t.oauthRequestApiRef},oktaAuthApiRef:function(){return t.oktaAuthApiRef},oneloginAuthApiRef:function(){return t.oneloginAuthApiRef},storageApiRef:function(){return t.storageApiRef},useAnalytics:function(){return r.z},useApp:function(){return l.useApp},useElementFilter:function(){return u.vJ},useRouteRef:function(){return c.tg},useRouteRefParams:function(){return c.Oi}});var r=e(28461),t=e(27399);e.o(t,"attachComponentData")&&e.d(s,{attachComponentData:function(){return t.attachComponentData}}),e.o(t,"createApiFactory")&&e.d(s,{createApiFactory:function(){return t.createApiFactory}}),e.o(t,"createApiRef")&&e.d(s,{createApiRef:function(){return t.createApiRef}}),e.o(t,"createComponentExtension")&&e.d(s,{createComponentExtension:function(){return t.createComponentExtension}}),e.o(t,"createExternalRouteRef")&&e.d(s,{createExternalRouteRef:function(){return t.createExternalRouteRef}}),e.o(t,"createPlugin")&&e.d(s,{createPlugin:function(){return t.createPlugin}}),e.o(t,"createReactExtension")&&e.d(s,{createReactExtension:function(){return t.createReactExtension}}),e.o(t,"createRoutableExtension")&&e.d(s,{createRoutableExtension:function(){return t.createRoutableExtension}}),e.o(t,"createRouteRef")&&e.d(s,{createRouteRef:function(){return t.createRouteRef}}),e.o(t,"getComponentData")&&e.d(s,{getComponentData:function(){return t.getComponentData}}),e.o(t,"useApi")&&e.d(s,{useApi:function(){return t.useApi}}),e.o(t,"useApiHolder")&&e.d(s,{useApiHolder:function(){return t.useApiHolder}}),e.o(t,"useApp")&&e.d(s,{useApp:function(){return t.useApp}}),e.o(t,"useElementFilter")&&e.d(s,{useElementFilter:function(){return t.useElementFilter}}),e.o(t,"useRouteRef")&&e.d(s,{useRouteRef:function(){return t.useRouteRef}}),e.o(t,"useRouteRefParams")&&e.d(s,{useRouteRefParams:function(){return t.useRouteRefParams}});var l=e(31311);e.o(l,"attachComponentData")&&e.d(s,{attachComponentData:function(){return l.attachComponentData}}),e.o(l,"createApiFactory")&&e.d(s,{createApiFactory:function(){return l.createApiFactory}}),e.o(l,"createApiRef")&&e.d(s,{createApiRef:function(){return l.createApiRef}}),e.o(l,"createComponentExtension")&&e.d(s,{createComponentExtension:function(){return l.createComponentExtension}}),e.o(l,"createExternalRouteRef")&&e.d(s,{createExternalRouteRef:function(){return l.createExternalRouteRef}}),e.o(l,"createPlugin")&&e.d(s,{createPlugin:function(){return l.createPlugin}}),e.o(l,"createReactExtension")&&e.d(s,{createReactExtension:function(){return l.createReactExtension}}),e.o(l,"createRoutableExtension")&&e.d(s,{createRoutableExtension:function(){return l.createRoutableExtension}}),e.o(l,"createRouteRef")&&e.d(s,{createRouteRef:function(){return l.createRouteRef}}),e.o(l,"getComponentData")&&e.d(s,{getComponentData:function(){return l.getComponentData}}),e.o(l,"useApi")&&e.d(s,{useApi:function(){return l.useApi}}),e.o(l,"useApiHolder")&&e.d(s,{useApiHolder:function(){return l.useApiHolder}}),e.o(l,"useElementFilter")&&e.d(s,{useElementFilter:function(){return l.useElementFilter}}),e.o(l,"useRouteRef")&&e.d(s,{useRouteRef:function(){return l.useRouteRef}}),e.o(l,"useRouteRefParams")&&e.d(s,{useRouteRefParams:function(){return l.useRouteRefParams}});var u=e(74181),A=e(80274),m=e.n(A);e.o(A,"createApiFactory")&&e.d(s,{createApiFactory:function(){return A.createApiFactory}}),e.o(A,"createApiRef")&&e.d(s,{createApiRef:function(){return A.createApiRef}}),e.o(A,"createExternalRouteRef")&&e.d(s,{createExternalRouteRef:function(){return A.createExternalRouteRef}}),e.o(A,"createPlugin")&&e.d(s,{createPlugin:function(){return A.createPlugin}}),e.o(A,"createRouteRef")&&e.d(s,{createRouteRef:function(){return A.createRouteRef}}),e.o(A,"useApi")&&e.d(s,{useApi:function(){return A.useApi}}),e.o(A,"useApiHolder")&&e.d(s,{useApiHolder:function(){return A.useApiHolder}}),e.o(A,"useRouteRef")&&e.d(s,{useRouteRef:function(){return A.useRouteRef}}),e.o(A,"useRouteRefParams")&&e.d(s,{useRouteRefParams:function(){return A.useRouteRefParams}});var o=e(96896),c=e(82772)},96896:function(ee,s,e){"use strict";e.d(s,{r:function(){return t}});class r{constructor(u){this.config=u}getId(){return this.config.id}getApis(){var u;return(u=this.config.apis)!=null?u:[]}getFeatureFlags(){var u,A;return(A=(u=this.config.featureFlags)==null?void 0:u.slice())!=null?A:[]}get routes(){var u;return(u=this.config.routes)!=null?u:{}}get externalRoutes(){var u;return(u=this.config.externalRoutes)!=null?u:{}}provide(u){return u.expose(this)}toString(){return`plugin{${this.config.id}}`}}function t(l){return new r(l)}},82772:function(ee,s,e){var I,B,j;"use strict";e.d(s,{x8:function(){return f},NT:function(){return u},tg:function(){return E},Oi:function(){return T}});var r=e(76241);const t=(0,r.uW)("route-ref-type",()=>Symbol("route-ref-type"));class l{constructor(b,L){q(this,I,"absolute");this.id=b,this.params=L}get title(){return this.id}toString(){return`routeRef{type=absolute,id=${this.id}}`}}I=t;function u(M){var b;return new l(M.id,(b=M.params)!=null?b:[])}const A=/^\w+$/;class m{constructor(b,L,D,U){q(this,B,"sub");this.id=b,this.path=L,this.parent=D,this.params=U}toString(){return`routeRef{type=sub,id=${this.id}}`}}B=t;function o(M){const{id:b,path:L,parent:D}=M,U=L.split("/").filter(ue=>ue.startsWith(":")).map(ue=>ue.substring(1)),Y=[...D.params,...U];if(D.params.some(ue=>U.includes(ue)))throw new Error("SubRouteRef may not have params that overlap with its parent");if(!L.startsWith("/"))throw new Error(`SubRouteRef path must start with '/', got '${L}'`);if(L.endsWith("/"))throw new Error(`SubRouteRef path must not end with '/', got '${L}'`);for(const ue of U)if(!A.test(ue))throw new Error(`SubRouteRef path has invalid param, got '${ue}'`);return new m(b,L,D,Y)}class c{constructor(b,L,D){q(this,j,"external");this.id=b,this.params=L,this.optional=D}toString(){return`routeRef{type=external,id=${this.id}}`}}j=t;function f(M){var b;return new c(M.id,(b=M.params)!=null?b:[],Boolean(M.optional))}var y=e(2784),p=e(10289);function E(M){const b=(0,p.TH)(),L=(0,r.Vt)("routing-context");if(!L)throw new Error("Routing context is not available");const D=L.atVersion(1),U=(0,y.useMemo)(()=>D&&D.resolve(M,b),[D,M,b]);if(!L)throw new Error("useRouteRef used outside of routing context");if(!D)throw new Error("RoutingContext v1 not available");const Y="optional"in M&&M.optional;if(!U&&!Y)throw new Error(`No path for ${M}`);return U}function T(M){return(0,p.UO)()}},10179:function(ee,s,e){"use strict";e.d(s,{SP:function(){return I},dR:function(){return p},VL:function(){return j},BD:function(){return t}});function r(M){if(typeof M!="object"||M===null||Array.isArray(M))return!1;const b=M;return!(typeof b.name!="string"||b.name===""||typeof b.message!="string")}function t(M){if(typeof M!="object"||M===null||Array.isArray(M))throw new Error(`Encountered invalid error, not an object, got '${M}'`);const b=M;if(typeof b.name!="string"||b.name==="")throw new Error(`Encountered error object without a name, got '${M}'`);if(typeof b.message!="string")throw new Error(`Encountered error object without a message, got '${M}'`)}var l=e(24852);function u(M,b){const L=serializeErrorInternal(M),D={name:"Unknown",message:"<no reason given>",...L};return b!=null&&b.includeStack||delete D.stack,D}function A(M){const b=(0,l.deserializeError)(M);return M.stack||(b.stack=void 0),b}function m(M){if(r(M)){const b=String(M);return b!=="[object Object]"?b:`${M.name}: ${M.message}`}return`unknown error '${M}'`}class o extends Error{constructor(L,D){var Y;let U=L;if(D!==void 0){const te=m(D);U?U+=`; caused by ${te}`:U=`caused by ${te}`}super(U);q(this,"cause");(Y=Error.captureStackTrace)==null||Y.call(Error,this,this.constructor),this.name=this.constructor.name,this.cause=r(D)?D:void 0}}class c extends null{}class f extends null{}class y extends null{}class p extends o{}class E extends null{}class T extends null{}class I extends o{constructor(b,L){super(b,L),this.name=r(L)?L.name:"Error"}}async function B(M){var b;try{const L=await M.text();if(L){if((b=M.headers.get("content-type"))!=null&&b.startsWith("application/json"))try{const D=JSON.parse(L);if(D.error&&D.response)return D}catch{}return{error:{name:"Error",message:`Request failed with status ${M.status} ${M.statusText}, ${L}`},response:{statusCode:M.status}}}}catch{}return{error:{name:"Error",message:`Request failed with status ${M.status} ${M.statusText}`},response:{statusCode:M.status}}}class j extends Error{constructor(L){super(L.message);q(this,"response");q(this,"body");q(this,"cause");this.name="ResponseError",this.response=L.response,this.body=L.data,this.cause=L.cause}static async fromResponse(L){const D=await B(L),U=D.response.statusCode||L.status,Y=D.error.name||L.statusText,te=`Request failed with ${U} ${Y}`,ue=A(D.error);return new j({message:te,response:L,data:D,cause:ue})}}},36356:function(ee,s,e){var p,E,T,I,B;"use strict";e.d(s,{nW:function(){return y},ae:function(){return m},q3:function(){return o}});var r=e(36964);const t=(0,r.createApiRef)({id:"core.scmauth"});class l{constructor(b){Dn(this,p,void 0);wn(this,p,b)}async getCredentials(b){const L=new URL(b.url),D=rt(this,p).find(U=>U.isUrlSupported(L));if(!D)throw new Error(`No auth provider available for '${b.url}', see https://backstage.io/link?scm-auth`);return D.getCredentials(b)}}p=new WeakMap;const j=class{constructor(b,L,D,U){Dn(this,E,void 0);Dn(this,T,void 0);Dn(this,I,void 0);Dn(this,B,void 0);wn(this,E,L),wn(this,T,D),wn(this,I,U),wn(this,B,b)}static createDefaultApiFactory(){return createApiFactory({api:scmAuthApiRef,deps:{github:githubAuthApiRef,gitlab:gitlabAuthApiRef,azure:microsoftAuthApiRef,bitbucket:bitbucketAuthApiRef},factory:({github:b,gitlab:L,azure:D,bitbucket:U})=>j.merge(j.forGithub(b),j.forGitlab(L),j.forAzure(D),j.forBitbucket(U))})}static forAuthApi(b,L){return new j("generic",b,L.host,L.scopeMapping)}static forGithub(b,L){var U;const D=(U=L==null?void 0:L.host)!=null?U:"github.com";return new j("github",b,D,{default:["repo","read:org","read:user"],repoWrite:["gist"]})}static forGitlab(b,L){var U;const D=(U=L==null?void 0:L.host)!=null?U:"gitlab.com";return new j("gitlab",b,D,{default:["read_user","read_api","read_repository"],repoWrite:["write_repository","api"]})}static forAzure(b,L){var U;const D=(U=L==null?void 0:L.host)!=null?U:"dev.azure.com";return new j("azure",b,D,{default:["vso.build","vso.code","vso.graph","vso.project","vso.profile"],repoWrite:["vso.code_manage"]})}static forBitbucket(b,L){var U;const D=(U=L==null?void 0:L.host)!=null?U:"bitbucket.org";return new j("bitbucket",b,D,{default:["account","team","pullrequest","snippet","issue"],repoWrite:["pullrequest:write","snippet:write","issue:write"]})}static merge(...b){return new l(b)}isUrlSupported(b){return b.host===rt(this,T)}getAdditionalScopesForProvider(b){var L,D;return!(b!=null&&b.customScopes)||rt(this,B)==="generic"?[]:(D=(L=b.customScopes)==null?void 0:L[rt(this,B)])!=null?D:[]}async getCredentials(b){const{url:L,additionalScope:D,...U}=b,Y=rt(this,I).default.slice();D!=null&&D.repoWrite&&Y.push(...rt(this,I).repoWrite);const te=this.getAdditionalScopesForProvider(D);te.length&&Y.push(...te);const ue=[...new Set(Y)],Re=await rt(this,E).getAccessToken(ue,U);return{token:Re,headers:{Authorization:`Bearer ${Re}`}}}};let u=j;E=new WeakMap,T=new WeakMap,I=new WeakMap,B=new WeakMap;var A=e(68370);class m{static fromConfig(b){return A.Lx.fromConfig(b)}}const o=(0,r.createApiRef)({id:"integration.scmintegrations"});var c=e(73250),f=e(2784);const y=M=>{var Y;const{type:b}=M,L=(0,r.useApp)(),D=c.Z,U=b&&(Y=L.getSystemIcon(b))!=null?Y:D;return f.createElement(U,null)}},68370:function(ee,s,e){var Ft,ut,kt,tn,jt,Vt,cn;"use strict";e.d(s,{Lx:function(){return Ht},Pb:function(){return Xt}});var r=e(82717),t=e.n(r),l=e(76635);function u($){const h=new URL("http://example.com");return h.host=$,h.host===$}function A($){try{return new URL($),!0}catch{return!1}}function m($,h){return{list(){return $},byUrl(S){try{const F=typeof S=="string"?new URL(S):S;return $.find(W=>h(W)===F.host)}catch{return}},byHost(S){return $.find(F=>h(F)===S)}}}function o($){const{url:h,base:S,lineNumber:F}=$;try{return new URL(h),h}catch{}let W;if(h.startsWith("/")){const{filepath:pe}=t()(S);W=new URL(S);const he=(0,l.trimEnd)(W.pathname.substring(0,W.pathname.length-pe.length),"/");W.pathname=`${he}${h}`}else W=new URL(h,S);return W.search=new URL(S).search,F&&(W.hash=`L${F}`),W.toString()}const c="amazonaws.com";function f($){var Pt;const h=$.getOptionalString("endpoint"),S=(Pt=$.getOptionalBoolean("s3ForcePathStyle"))!=null?Pt:!1;let F,W;if(h){try{const bn=new URL(h);F=bn.host,W=bn.pathname}catch{throw new Error(`invalid awsS3 integration config, endpoint '${h}' is not a valid URL`)}if(W!=="/")throw new Error(`invalid awsS3 integration config, endpoints cannot contain path, got '${h}'`)}else F=c;const pe=$.getOptionalString("accessKeyId"),he=$.getOptionalString("secretAccessKey"),Me=$.getOptionalString("roleArn"),ft=$.getOptionalString("externalId");return{host:F,endpoint:h,s3ForcePathStyle:S,accessKeyId:pe,secretAccessKey:he,roleArn:Me,externalId:ft}}function y($){const h=$.map(f);return h.some(S=>S.host===c)||h.push({host:c}),h}const Dt=class{get type(){return"awsS3"}get title(){return this.integrationConfig.host}get config(){return this.integrationConfig}constructor(h){this.integrationConfig=h}resolveUrl(h){return o(h)}resolveEditUrl(h){return h}};let p=Dt;q(p,"factory",({config:h})=>{var F;const S=y((F=h.getOptionalConfigArray("integrations.awsS3"))!=null?F:[]);return m(S.map(W=>new Dt(W)),W=>W.config.host)});const E="GB",Tn=class{constructor(h,S,F,W,pe,he){Dn(this,Ft,void 0);Dn(this,ut,void 0);Dn(this,kt,void 0);Dn(this,tn,void 0);Dn(this,jt,void 0);Dn(this,Vt,void 0);Dn(this,cn,(...h)=>{const S=new URL(rt(this,Ft));return S.pathname=h.map(F=>encodeURIComponent(F)).join("/"),S});wn(this,Ft,h),wn(this,ut,S),wn(this,kt,F),wn(this,tn,W),wn(this,jt,pe),wn(this,Vt,he)}static fromRepoUrl(h){var bn;const S=new URL(h);let F,W,pe;const he=S.pathname.split("/").map(vn=>decodeURIComponent(vn));if(he[2]==="_git"?(F=he[1],W=pe=he[3]):he[3]==="_git"?(F=he[1],W=he[2],pe=he[4]):he[4]==="_git"&&(F=`${he[1]}/${he[2]}`,W=he[3],pe=he[5]),!F||!W||!pe)throw new Error("Azure URL must point to a git repository");const Me=(bn=S.searchParams.get("path"))!=null?bn:void 0;let ft;const Pt=S.searchParams.get("version");if(Pt){if(Pt.slice(0,2)!=="GB")throw new Error("Azure URL version must point to a git branch");ft=Pt.slice(2)}return new Tn(S.origin,F,W,pe,Me,ft)}toRepoUrl(){let h;return rt(this,kt)===rt(this,tn)?h=rt(this,cn).call(this,rt(this,ut),"_git",rt(this,tn)):h=rt(this,cn).call(this,rt(this,ut),rt(this,kt),"_git",rt(this,tn)),rt(this,jt)&&h.searchParams.set("path",rt(this,jt)),rt(this,Vt)&&h.searchParams.set("version",E+rt(this,Vt)),h.toString()}toFileUrl(){if(!rt(this,jt))throw new Error("Azure URL must point to a specific path to be able to download a file");const h=rt(this,cn).call(this,rt(this,ut),rt(this,kt),"_apis","git","repositories",rt(this,tn),"items");return h.searchParams.set("api-version","6.0"),h.searchParams.set("path",rt(this,jt)),rt(this,Vt)&&h.searchParams.set("version",rt(this,Vt)),h.toString()}toArchiveUrl(){const h=rt(this,cn).call(this,rt(this,ut),rt(this,kt),"_apis","git","repositories",rt(this,tn),"items");return h.searchParams.set("recursionLevel","full"),h.searchParams.set("download","true"),h.searchParams.set("api-version","6.0"),rt(this,jt)&&h.searchParams.set("scopePath",rt(this,jt)),rt(this,Vt)&&h.searchParams.set("version",rt(this,Vt)),h.toString()}toCommitsUrl(){const h=rt(this,cn).call(this,rt(this,ut),rt(this,kt),"_apis","git","repositories",rt(this,tn),"commits");return h.searchParams.set("api-version","6.0"),rt(this,Vt)&&h.searchParams.set("searchCriteria.itemVersion.version",rt(this,Vt)),h.toString()}getOwner(){return rt(this,ut)}getProject(){return rt(this,kt)}getRepo(){return rt(this,tn)}getPath(){return rt(this,jt)}getRef(){return rt(this,Vt)}};let T=Tn;Ft=new WeakMap,ut=new WeakMap,kt=new WeakMap,tn=new WeakMap,jt=new WeakMap,Vt=new WeakMap,cn=new WeakMap;const I="dev.azure.com";function B($){var F;const h=(F=$.getOptionalString("host"))!=null?F:I,S=$.getOptionalString("token");if(!u(h))throw new Error(`Invalid Azure integration config, '${h}' is not a valid host`);return{host:h,token:S}}function j($){const h=$.map(B);return h.some(S=>S.host===I)||h.push({host:I}),h}const wt=class{constructor(h){this.integrationConfig=h}get type(){return"azure"}get title(){return this.integrationConfig.host}get config(){return this.integrationConfig}resolveUrl(h){var W;const{url:S,base:F}=h;if(A(S))return S;try{const pe=T.fromRepoUrl(F),he=new URL(F),Me=new URL(`https://a.com${(W=pe.getPath())!=null?W:""}`),ft=new URL(S,Me).pathname;return he.searchParams.set("path",ft),h.lineNumber&&(he.searchParams.set("line",String(h.lineNumber)),he.searchParams.set("lineEnd",String(h.lineNumber+1)),he.searchParams.set("lineStartColumn","1"),he.searchParams.set("lineEndColumn","1")),he.toString()}catch{return new URL(S,F).toString()}}resolveEditUrl(h){return h}};let M=wt;q(M,"factory",({config:h})=>{var F;const S=j((F=h.getOptionalConfigArray("integrations.azure"))!=null?F:[]);return m(S.map(W=>new wt(W)),W=>W.config.host)});var b=e(48834).Buffer;function L($){return AzureUrl.fromRepoUrl($).toFileUrl()}function D($){return AzureUrl.fromRepoUrl($).toArchiveUrl()}function U($){return AzureUrl.fromRepoUrl($).toCommitsUrl()}function Y($,h){const S=h?{...h}:{};if($.token){const F=b.from(`:${$.token}`,"utf8");S.Authorization=`Basic ${F.toString("base64")}`}return{headers:S}}const te="bitbucket.org",ue="https://api.bitbucket.org/2.0";function Re($){var he;const h=(he=$.getOptionalString("host"))!=null?he:te;let S=$.getOptionalString("apiBaseUrl");const F=$.getOptionalString("token"),W=$.getOptionalString("username"),pe=$.getOptionalString("appPassword");if(!u(h))throw new Error(`Invalid Bitbucket integration config, '${h}' is not a valid host`);return S?S=(0,l.trimEnd)(S,"/"):h===te?S=ue:S=`https://${h}/rest/api/1.0`,{host:h,apiBaseUrl:S,token:F,username:W,appPassword:pe}}function we($){const h=$.map(Re);return h.some(S=>S.host===te)||h.push({host:te,apiBaseUrl:ue}),h}const $t=class{constructor(h){this.integrationConfig=h}get type(){return"bitbucket"}get title(){return this.integrationConfig.host}get config(){return this.integrationConfig}resolveUrl(h){const S=o(h);if(!h.lineNumber)return S;const F=new URL(S);return this.integrationConfig.host==="bitbucket.org"?F.hash=`lines-${h.lineNumber}`:F.hash=`${h.lineNumber}`,F.toString()}resolveEditUrl(h){const S=t()(h),F=new URL(h);return F.searchParams.set("mode","edit"),F.searchParams.set("spa","0"),F.searchParams.set("at",S.ref),F.toString()}};let ge=$t;q(ge,"factory",({config:h})=>{var F,W,pe;const S=we((pe=h.getOptionalConfigArray("integrations.bitbucket"))!=null?pe:[...(F=h.getOptionalConfigArray("integrations.bitbucketCloud"))!=null?F:[],...(W=h.getOptionalConfigArray("integrations.bitbucketServer"))!=null?W:[]]);return m(S.map(he=>new $t(he)),he=>he.config.host)});var ze=e(96279),_e=e(48834).Buffer;async function et($,h){const{name:S,owner:F,resource:W}=parseGitUrl($),pe=W==="bitbucket.org";let he=pe?`${h.apiBaseUrl}/repositories/${F}/${S}`:`${h.apiBaseUrl}/projects/${F}/repos/${S}/default-branch`,Me=await fetch(he,yt(h));if(Me.status===404&&!pe&&(he=`${h.apiBaseUrl}/projects/${F}/repos/${S}/branches/default`,Me=await fetch(he,yt(h))),!Me.ok){const Pt=`Failed to retrieve default branch from ${he}, ${Me.status} ${Me.statusText}`;throw new Error(Pt)}let ft;if(pe)ft=(await Me.json()).mainbranch.name;else{const{displayId:Pt}=await Me.json();ft=Pt}if(!ft)throw new Error(`Failed to read default branch from ${he}. Response ${Me.status} ${Me.json()}`);return ft}async function st($,h){const{name:S,owner:F,ref:W,protocol:pe,resource:he,filepath:Me}=parseGitUrl($),ft=he==="bitbucket.org";let Pt=W;Pt||(Pt=await et($,h));const bn=Me?`&path=${encodeURIComponent(Me)}`:"";return ft?`${pe}://${he}/${F}/${S}/get/${Pt}.tar.gz`:`${h.apiBaseUrl}/projects/${F}/repos/${S}/archive?format=tgz&at=${Pt}&prefix=${F}-${S}${bn}`}function Ct($,h){try{const{owner:S,name:F,ref:W,filepathtype:pe,filepath:he}=parseGitUrl($);if(!S||!F||pe!=="browse"&&pe!=="raw"&&pe!=="src")throw new Error("Invalid Bitbucket URL or file path");const Me=he.replace(/^\//,"");if(h.host==="bitbucket.org"){if(!W)throw new Error("Invalid Bitbucket URL or file path");return`${h.apiBaseUrl}/repositories/${S}/${F}/src/${W}/${Me}`}return`${h.apiBaseUrl}/projects/${S}/repos/${F}/raw/${Me}?at=${W}`}catch(S){throw new Error(`Incorrect URL: ${$}, ${S}`)}}function yt($){const h={};if($.token)h.Authorization=`Bearer ${$.token}`;else if($.username&&$.appPassword){const S=_e.from(`${$.username}:${$.appPassword}`,"utf8");h.Authorization=`Basic ${S.toString("base64")}`}return{headers:h}}const Pe="bitbucket.org",ht="https://api.bitbucket.org/2.0";function Ve($){const h=Pe,S=ht,F=$.getString("username"),W=$.getString("appPassword");return{host:h,apiBaseUrl:S,username:F,appPassword:W}}function ie($){const h=$.map(Ve);return h.length===0&&h.push({host:Pe,apiBaseUrl:ht}),h}const hn=class{constructor(h){this.integrationConfig=h}get type(){return"bitbucketCloud"}get title(){return this.integrationConfig.host}get config(){return this.integrationConfig}resolveUrl(h){const S=o(h);if(h.lineNumber){const F=new URL(S);return F.hash=`lines-${h.lineNumber}`,F.toString()}return S}resolveEditUrl(h){const S=t()(h),F=new URL(h);return F.searchParams.set("mode","edit"),F.searchParams.set("at",S.ref),F.toString()}};let de=hn;q(de,"factory",({config:h})=>{var F;const S=ie((F=h.getOptionalConfigArray("integrations.bitbucketCloud"))!=null?F:[]);return m(S.map(W=>new hn(W)),W=>W.config.host)});var Ue=e(48834).Buffer;async function Be($,h){const{name:S,owner:F}=parseGitUrl($),W=`${h.apiBaseUrl}/repositories/${F}/${S}`,pe=await fetch(W,Ye(h));if(!pe.ok){const ft=`Failed to retrieve default branch from ${W}, ${pe.status} ${pe.statusText}`;throw new Error(ft)}const Me=(await pe.json()).mainbranch.name;if(!Me)throw new Error(`Failed to read default branch from ${W}. Response ${pe.status} ${pe.json()}`);return Me}async function Xe($,h){const{name:S,owner:F,ref:W,protocol:pe,resource:he}=parseGitUrl($);let Me=W;return Me||(Me=await Be($,h)),`${pe}://${he}/${F}/${S}/get/${Me}.tar.gz`}function mt($,h){try{const{owner:S,name:F,ref:W,filepathtype:pe,filepath:he}=parseGitUrl($);if(!S||!F||pe!=="src"&&pe!=="raw")throw new Error("Invalid Bitbucket Cloud URL or file path");const Me=he.replace(/^\//,"");if(!W)throw new Error("Invalid Bitbucket Cloud URL or file path");return`${h.apiBaseUrl}/repositories/${S}/${F}/src/${W}/${Me}`}catch(S){throw new Error(`Incorrect URL: ${$}, ${S}`)}}function Ye($){const h={};if($.username&&$.appPassword){const S=Ue.from(`${$.username}:${$.appPassword}`,"utf8");h.Authorization=`Basic ${S.toString("base64")}`}return{headers:h}}function Et($){const h=$.getString("host");let S=$.getOptionalString("apiBaseUrl");const F=$.getOptionalString("token");if(!u(h))throw new Error(`Invalid Bitbucket Server integration config, '${h}' is not a valid host`);return S?S=(0,l.trimEnd)(S,"/"):S=`https://${h}/rest/api/1.0`,{host:h,apiBaseUrl:S,token:F}}function oe($){return $.map(Et)}const yn=class{constructor(h){this.integrationConfig=h}get type(){return"bitbucketServer"}get title(){return this.integrationConfig.host}get config(){return this.integrationConfig}resolveUrl(h){const S=o(h);if(h.lineNumber){const F=new URL(S),W=F.pathname.split("/").slice(-1)[0];return F.hash=`${W}-${h.lineNumber}`,F.toString()}return S}resolveEditUrl(h){const S=t()(h),F=new URL(h);return F.searchParams.set("mode","edit"),F.searchParams.set("spa","0"),F.searchParams.set("at",S.ref),F.toString()}};let fe=yn;q(fe,"factory",({config:h})=>{var F;const S=oe((F=h.getOptionalConfigArray("integrations.bitbucketServer"))!=null?F:[]);return m(S.map(W=>new yn(W)),W=>W.config.host)});async function tt($,h){const{name:S,owner:F}=parseGitUrl($);let W=`${h.apiBaseUrl}/projects/${F}/repos/${S}/default-branch`,pe=await fetch(W,ct(h));if(pe.status===404&&(W=`${h.apiBaseUrl}/projects/${F}/repos/${S}/branches/default`,pe=await fetch(W,ct(h))),!pe.ok){const ft=`Failed to retrieve default branch from ${W}, ${pe.status} ${pe.statusText}`;throw new Error(ft)}const{displayId:he}=await pe.json(),Me=he;if(!Me)throw new Error(`Failed to read default branch from ${W}. Response ${pe.status} ${pe.json()}`);return Me}async function Ke($,h){const{name:S,owner:F,ref:W,filepath:pe}=parseGitUrl($);let he=W;he||(he=await tt($,h));const Me=pe?`&path=${encodeURIComponent(pe)}`:"";return`${h.apiBaseUrl}/projects/${F}/repos/${S}/archive?format=tgz&at=${he}&prefix=${F}-${S}${Me}`}function Ne($,h){try{const{owner:S,name:F,ref:W,filepathtype:pe,filepath:he}=parseGitUrl($);if(!S||!F||pe!=="browse"&&pe!=="raw"&&pe!=="src")throw new Error("Invalid Bitbucket Server URL or file path");const Me=he.replace(/^\//,"");return`${h.apiBaseUrl}/projects/${S}/repos/${F}/raw/${Me}?at=${W}`}catch(S){throw new Error(`Incorrect URL: ${$}, ${S}`)}}function ct($){const h={};return $.token&&(h.Authorization=`Bearer ${$.token}`),{headers:h}}function X($){const h=$.getString("host");let S=$.getOptionalString("baseUrl"),F=$.getOptionalString("cloneUrl"),W=$.getOptionalString("gitilesBaseUrl");const pe=$.getOptionalString("username"),he=$.getOptionalString("password");if(u(h)){if(S&&!A(S))throw new Error(`Invalid Gerrit integration config, '${S}' is not a valid baseUrl`);if(F&&!A(F))throw new Error(`Invalid Gerrit integration config, '${F}' is not a valid cloneUrl`);if(W&&!A(W))throw new Error(`Invalid Gerrit integration config, '${W}' is not a valid gitilesBaseUrl`)}else throw new Error(`Invalid Gerrit integration config, '${h}' is not a valid host`);return S?S=(0,l.trimEnd)(S,"/"):S=`https://${h}`,W?W=(0,l.trimEnd)(W,"/"):W=`https://${h}`,F?F=(0,l.trimEnd)(F,"/"):F=S,{host:h,baseUrl:S,cloneUrl:F,gitilesBaseUrl:W,username:pe,password:he}}function Z($){return $.map(X)}var Q=e(48834).Buffer;const se=")]}'";function le($,h){const F=h.replace($.gitilesBaseUrl,"").split("/").filter(Pt=>!!Pt),W=F.indexOf("+");if(W<=0)throw new Error(`Unable to parse project from url: ${h}`);const pe=(0,l.trimStart)(F.slice(0,W).join("/"),"/"),he=F.indexOf("heads");if(he<=0)throw new Error(`Unable to parse branch from url: ${h}`);const Me=F[he+1],ft=F.slice(he+2).join("/");return{branch:Me,filePath:ft===""?"/":ft,project:pe}}function be($,h,S,F){return`${$.gitilesBaseUrl}/${h}/+/refs/heads/${S}/${(0,l.trimStart)(F,"/")}`}function Oe($){return $.password?"/a/":"/"}function Ae($,h){const{branch:S,project:F}=le($,h);return`${$.baseUrl}${Oe($)}projects/${encodeURIComponent(F)}/branches/${S}`}function ke($,h){const{project:S}=le($,h);return`${$.cloneUrl}${Oe($)}${S}`}function We($,h){const{branch:S,filePath:F,project:W}=le($,h);return`${$.baseUrl}${Oe($)}projects/${encodeURIComponent(W)}/branches/${S}/files/${encodeURIComponent(F)}/content`}function gt($){return`${$.baseUrl}${Oe($)}projects/`}function It($){const h={};if(!$.password)return h;const S=Q.from(`${$.username}:${$.password}`,"utf8");return h.Authorization=`Basic ${S.toString("base64")}`,{headers:h}}async function lt($){const h=await $.text();if(h.startsWith(se))try{return JSON.parse(h.slice(se.length))}catch(S){throw new Error(`Invalid response from Gerrit: ${h.slice(0,10)} - ${S}`)}throw new Error(`Gerrit JSON body prefix missing. Found: ${h.slice(0,10)}`)}const an=class{constructor(h){this.integrationConfig=h}get type(){return"gerrit"}get title(){return this.integrationConfig.host}get config(){return this.integrationConfig}resolveUrl(h){const{url:S,base:F,lineNumber:W}=h;let pe;if(S.startsWith("/")){const{branch:he,project:Me}=le(this.config,F);return be(this.config,Me,he,S)}return S?pe=new URL(S,F):pe=new URL(F),W&&(pe.hash=W.toString()),pe.toString()}resolveEditUrl(h){return h}};let Tt=an;q(Tt,"factory",({config:h})=>{var F;const S=Z((F=h.getOptionalConfigArray("integrations.gerrit"))!=null?F:[]);return m(S.map(W=>new an(W)),W=>W.config.host)});const Lt="github.com",Rt="https://api.github.com",Nt="https://raw.githubusercontent.com";function Zt($){var he,Me;const h=(he=$.getOptionalString("host"))!=null?he:Lt;let S=$.getOptionalString("apiBaseUrl"),F=$.getOptionalString("rawBaseUrl");const W=$.getOptionalString("token"),pe=(Me=$.getOptionalConfigArray("apps"))==null?void 0:Me.map(ft=>({appId:ft.getNumber("appId"),clientId:ft.getString("clientId"),clientSecret:ft.getString("clientSecret"),webhookSecret:ft.getString("webhookSecret"),privateKey:ft.getString("privateKey"),allowedInstallationOwners:ft.getOptionalStringArray("allowedInstallationOwners")}));if(!u(h))throw new Error(`Invalid GitHub integration config, '${h}' is not a valid host`);return S?S=(0,l.trimEnd)(S,"/"):h===Lt&&(S=Rt),F?F=(0,l.trimEnd)(F,"/"):h===Lt&&(F=Nt),{host:h,apiBaseUrl:S,rawBaseUrl:F,token:W,apps:pe}}function vt($){const h=$.map(Zt);return h.some(S=>S.host===Lt)||h.push({host:Lt,apiBaseUrl:Rt,rawBaseUrl:Nt}),h}function at($,h,S){try{const{owner:F,name:W,ref:pe,filepathtype:he,filepath:Me}=parseGitUrl($);if(!F||!W||!pe||he!=="blob"&&he!=="raw"&&he!=="tree")throw new Error("Invalid GitHub URL or file path");const ft=Me.replace(/^\//,"");return ae(h,S)==="api"?`${h.apiBaseUrl}/repos/${F}/${W}/contents/${ft}?ref=${pe}`:`${h.rawBaseUrl}/${F}/${W}/${pe}/${ft}`}catch(F){throw new Error(`Incorrect URL: ${$}, ${F}`)}}function zt($,h){const S={};return ae($,h)==="api"&&(S.Accept="application/vnd.github.v3.raw"),h.token&&(S.Authorization=`token ${h.token}`),{headers:S}}function ae($,h){return $.apiBaseUrl&&(h.token||!$.rawBaseUrl)?"api":"raw"}class V{constructor(){q(this,"tokenCache",new Map);q(this,"isNotExpired",h=>h.diff(DateTime.local(),"minutes").minutes>50)}async getOrCreateToken(h,S){const F=this.tokenCache.get(h);if(F&&this.isNotExpired(F.expiresAt))return{accessToken:F.token};const W=await S();return this.tokenCache.set(h,W),{accessToken:W.token}}}const ye={Accept:"application/vnd.github.machine-man-preview+json"};class He{constructor(h,S){q(this,"appClient");q(this,"baseUrl");q(this,"baseAuthConfig");q(this,"cache",new V);q(this,"allowedInstallationOwners");this.allowedInstallationOwners=h.allowedInstallationOwners,this.baseUrl=S,this.baseAuthConfig={appId:h.appId,privateKey:h.privateKey.replace(/\\n/gm,`
|
|
31
|
+
`)},this.appClient=new Octokit({baseUrl:S,headers:ye,authStrategy:createAppAuth,auth:this.baseAuthConfig})}async getInstallationCredentials(h,S){var he;const{installationId:F,suspended:W}=await this.getInstallationData(h);if(this.allowedInstallationOwners&&!((he=this.allowedInstallationOwners)!=null&&he.includes(h)))return{accessToken:void 0};if(W)throw new Error(`The GitHub application for ${h} is suspended`);const pe=S?`${h}/${S}`:h;return this.cache.getOrCreateToken(pe,async()=>{const Me=await this.appClient.apps.createInstallationAccessToken({installation_id:F,headers:ye});if(S&&Me.data.repository_selection==="selected"){const ft=new Octokit({baseUrl:this.baseUrl,auth:Me.data.token});if(!(await ft.paginate(ft.apps.listReposAccessibleToInstallation)).some(vn=>vn.name===S))throw new Error(`The Backstage GitHub application used in the ${h} organization does not have access to a repository with the name ${S}`)}return{token:Me.data.token,expiresAt:DateTime.fromISO(Me.data.expires_at)}})}getInstallations(){return this.appClient.paginate(this.appClient.apps.listInstallations)}async getInstallationData(h){const F=(await this.getInstallations()).find(pe=>{var he,Me;return((Me=(he=pe.account)==null?void 0:he.login)==null?void 0:Me.toLocaleLowerCase("en-US"))===h.toLocaleLowerCase("en-US")});if(F)return{installationId:F.id,suspended:Boolean(F.suspended_by)};const W=new Error(`No app installation found for ${h} in ${this.baseAuthConfig.appId}`);throw W.name="NotFoundError",W}}class qe{constructor(h){q(this,"apps");var S,F;this.apps=(F=(S=h.apps)==null?void 0:S.map(W=>new He(W,h.apiBaseUrl)))!=null?F:[]}async getAllInstallations(){return this.apps.length?(await Promise.all(this.apps.map(S=>S.getInstallations()))).flat():[]}async getAppToken(h,S){if(this.apps.length===0)return;const F=await Promise.all(this.apps.map(Me=>Me.getInstallationCredentials(h,S).then(ft=>({credentials:ft,error:void 0}),ft=>({credentials:void 0,error:ft})))),W=F.find(Me=>Me.credentials);if(W)return W.credentials.accessToken;const he=F.map(Me=>Me.error).find(Me=>Me.name!=="NotFoundError");if(he)throw he}}class ot{constructor(h,S){this.githubAppCredentialsMux=h,this.token=S}async getCredentials(h){const S=parseGitUrl(h.url),F=S.owner||S.name,W=S.owner?S.name:void 0;let pe="app",he=await this.githubAppCredentialsMux.getAppToken(F,W);return he||(pe="token",he=this.token),{headers:he?{Authorization:`Bearer ${he}`}:void 0,token:he,type:pe}}}q(ot,"create",null);class bt{static fromIntegrations(h){const S=new Map;return h.github.list().forEach(F=>{const W=SingleInstanceGithubCredentialsProvider.create(F.config);S.set(F.config.host,W)}),new bt(S)}constructor(h){this.providers=h}async getCredentials(h){const S=new URL(h.url),F=this.providers.get(S.host);if(!F)throw new Error(`There is no GitHub integration that matches ${h.url}. Please add a configuration for an integration.`);return F.getCredentials(h)}}const fn=class{constructor(h){this.integrationConfig=h}get type(){return"github"}get title(){return this.integrationConfig.host}get config(){return this.integrationConfig}resolveUrl(h){return Xt(o(h),"tree")}resolveEditUrl(h){return Xt(h,"edit")}};let Wt=fn;q(Wt,"factory",({config:h})=>{var F;const S=vt((F=h.getOptionalConfigArray("integrations.github"))!=null?F:[]);return m(S.map(W=>new fn(W)),W=>W.config.host)});function Xt($,h){return $.replace(/\/\/([^/]+)\/([^/]+)\/([^/]+)\/(blob|tree|edit)\//,(S,F,W,pe)=>`//${F}/${W}/${pe}/${h}/`)}const un="gitlab.com",dn="https://gitlab.com/api/v4";function xt($){const h=$.getString("host");let S=$.getOptionalString("apiBaseUrl");const F=$.getOptionalString("token");let W=$.getOptionalString("baseUrl");if(S?S=(0,l.trimEnd)(S,"/"):h===un&&(S=dn),W?W=(0,l.trimEnd)(W,"/"):W=`https://${h}`,u(h)){if(!S||!A(S))throw new Error(`Invalid GitLab integration config, '${S}' is not a valid apiBaseUrl`);if(!A(W))throw new Error(`Invalid GitLab integration config, '${W}' is not a valid baseUrl`)}else throw new Error(`Invalid GitLab integration config, '${h}' is not a valid host`);return{host:h,token:F,apiBaseUrl:S,baseUrl:W}}function qt($){const h=$.map(xt);return h.some(S=>S.host===un)||h.push({host:un,apiBaseUrl:dn,baseUrl:`https://${un}`}),h}var x=e(10179);async function re($,h){if($.includes("/-/blob/")){const S=await Je($,h);return Le($,S).toString()}return Te($).toString()}function Ee($){const{token:h=""}=$;return{headers:{"PRIVATE-TOKEN":h}}}function Te($){try{const h=new URL($),S=h.pathname.split("/").filter(Boolean),F=S.indexOf("blob",2);if(F<2||F===S.length-1)throw new InputError("Wrong GitLab URL");const W=S.slice(0,F),pe=S.slice(F+1);if(!pe.join("/").match(/\.(yaml|yml)$/))throw new InputError("Wrong GitLab URL");return h.pathname=[...W,"raw",...pe].join("/"),h}catch(h){throw new InputError(`Incorrect url: ${$}, ${h}`)}}function Le($,h){try{const S=new URL($),F=S.pathname.split("/-/blob/")[1],[W,...pe]=F.split("/");return S.pathname=["/api/v4/projects",h,"repository/files",encodeURIComponent(decodeURIComponent(pe.join("/"))),"raw"].join("/"),S.search=`?ref=${W}`,S}catch(S){throw new Error(`Incorrect url: ${$}, ${S}`)}}async function Je($,h){const S=new URL($);if(!S.pathname.includes("/-/blob/"))throw new Error("Please provide full path to yaml file from GitLab");try{const F=S.pathname.split("/-/blob/")[0],W=new URL(`${S.origin}/api/v4/projects/${encodeURIComponent(F.replace(/^\//,""))}`),pe=await fetch(W.toString(),Ee(h)),he=await pe.json();if(!pe.ok)throw new Error(`GitLab Error '${he.error}', ${he.error_description}`);return Number(he.id)}catch(F){throw new Error(`Could not get GitLab project ID for: ${$}, ${F}`)}}const Wn=class{constructor(h){this.integrationConfig=h}get type(){return"gitlab"}get title(){return this.integrationConfig.host}get config(){return this.integrationConfig}resolveUrl(h){return o(h)}resolveEditUrl(h){return Kt(h,"edit")}};let it=Wn;q(it,"factory",({config:h})=>{var F;const S=qt((F=h.getOptionalConfigArray("integrations.gitlab"))!=null?F:[]);return m(S.map(W=>new Wn(W)),W=>W.config.host)});function Kt($,h){return $.replace(/\/\-\/(blob|tree|edit)\//,`/-/${h}/`)}class Ht{constructor(h){q(this,"byType");this.byType=h}static fromConfig(h){return new Ht({awsS3:p.factory({config:h}),azure:M.factory({config:h}),bitbucket:ge.factory({config:h}),bitbucketCloud:de.factory({config:h}),bitbucketServer:fe.factory({config:h}),gerrit:Tt.factory({config:h}),github:Wt.factory({config:h}),gitlab:it.factory({config:h})})}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}list(){return Object.values(this.byType).flatMap(h=>h.list())}byUrl(h){return Object.values(this.byType).map(S=>S.byUrl(h)).find(Boolean)}byHost(h){return Object.values(this.byType).map(S=>S.byHost(h)).find(Boolean)}resolveUrl(h){const S=this.byUrl(h.base);return S?S.resolveUrl(h):o(h)}resolveEditUrl(h){const S=this.byUrl(h);return S?S.resolveEditUrl(h):h}}},46054:function(ee,s,e){"use strict";var r={};e.r(r),e.d(r,{TechDocsPlugin:function(){return A.plugin}});var t=e(2784),l=e(47093),u=e(10289),A=e(82250),m=e(26136),o=e(49208),c=e(36964),f=e(68099);const y=[(0,c.createApiFactory)({api:c.discoveryApiRef,deps:{configApi:c.configApiRef},factory:({configApi:P})=>o.UrlPatternDiscovery.compile(`${P.getString("backend.baseUrl")}/api/{{ pluginId }}`)}),(0,c.createApiFactory)({api:c.alertApiRef,deps:{},factory:()=>new o.AlertApiForwarder}),(0,c.createApiFactory)({api:c.analyticsApiRef,deps:{},factory:()=>new o.NoOpAnalyticsApi}),(0,c.createApiFactory)({api:c.errorApiRef,deps:{alertApi:c.alertApiRef},factory:({alertApi:P})=>{const J=new o.ErrorAlerter(P,new o.ErrorApiForwarder);return o.UnhandledErrorForwarder.forward(J,{hidden:!1}),J}}),(0,c.createApiFactory)({api:c.storageApiRef,deps:{errorApi:c.errorApiRef},factory:({errorApi:P})=>o.WebStorage.create({errorApi:P})}),(0,c.createApiFactory)({api:c.fetchApiRef,deps:{configApi:c.configApiRef,identityApi:c.identityApiRef,discoveryApi:c.discoveryApiRef},factory:({configApi:P,identityApi:J,discoveryApi:me})=>(0,o.createFetchApi)({middleware:[o.FetchMiddlewares.resolvePluginProtocol({discoveryApi:me}),o.FetchMiddlewares.injectIdentityAuth({identityApi:J,config:P})]})}),(0,c.createApiFactory)({api:c.oauthRequestApiRef,deps:{},factory:()=>new o.OAuthRequestManager}),(0,c.createApiFactory)({api:c.googleAuthApiRef,deps:{discoveryApi:c.discoveryApiRef,oauthRequestApi:c.oauthRequestApiRef,configApi:c.configApiRef},factory:({discoveryApi:P,oauthRequestApi:J,configApi:me})=>o.GoogleAuth.create({discoveryApi:P,oauthRequestApi:J,environment:me.getOptionalString("auth.environment")})}),(0,c.createApiFactory)({api:c.microsoftAuthApiRef,deps:{discoveryApi:c.discoveryApiRef,oauthRequestApi:c.oauthRequestApiRef,configApi:c.configApiRef},factory:({discoveryApi:P,oauthRequestApi:J,configApi:me})=>o.MicrosoftAuth.create({discoveryApi:P,oauthRequestApi:J,environment:me.getOptionalString("auth.environment")})}),(0,c.createApiFactory)({api:c.githubAuthApiRef,deps:{discoveryApi:c.discoveryApiRef,oauthRequestApi:c.oauthRequestApiRef,configApi:c.configApiRef},factory:({discoveryApi:P,oauthRequestApi:J,configApi:me})=>o.GithubAuth.create({discoveryApi:P,oauthRequestApi:J,defaultScopes:["read:user"],environment:me.getOptionalString("auth.environment")})}),(0,c.createApiFactory)({api:c.oktaAuthApiRef,deps:{discoveryApi:c.discoveryApiRef,oauthRequestApi:c.oauthRequestApiRef,configApi:c.configApiRef},factory:({discoveryApi:P,oauthRequestApi:J,configApi:me})=>o.OktaAuth.create({discoveryApi:P,oauthRequestApi:J,environment:me.getOptionalString("auth.environment")})}),(0,c.createApiFactory)({api:c.gitlabAuthApiRef,deps:{discoveryApi:c.discoveryApiRef,oauthRequestApi:c.oauthRequestApiRef,configApi:c.configApiRef},factory:({discoveryApi:P,oauthRequestApi:J,configApi:me})=>o.GitlabAuth.create({discoveryApi:P,oauthRequestApi:J,environment:me.getOptionalString("auth.environment")})}),(0,c.createApiFactory)({api:c.oneloginAuthApiRef,deps:{discoveryApi:c.discoveryApiRef,oauthRequestApi:c.oauthRequestApiRef,configApi:c.configApiRef},factory:({discoveryApi:P,oauthRequestApi:J,configApi:me})=>o.OneLoginAuth.create({discoveryApi:P,oauthRequestApi:J,environment:me.getOptionalString("auth.environment")})}),(0,c.createApiFactory)({api:c.bitbucketAuthApiRef,deps:{discoveryApi:c.discoveryApiRef,oauthRequestApi:c.oauthRequestApiRef,configApi:c.configApiRef},factory:({discoveryApi:P,oauthRequestApi:J,configApi:me})=>o.BitbucketAuth.create({discoveryApi:P,oauthRequestApi:J,defaultScopes:["team"],environment:me.getOptionalString("auth.environment")})}),(0,c.createApiFactory)({api:c.atlassianAuthApiRef,deps:{discoveryApi:c.discoveryApiRef,oauthRequestApi:c.oauthRequestApiRef,configApi:c.configApiRef},factory:({discoveryApi:P,oauthRequestApi:J,configApi:me})=>o.AtlassianAuth.create({discoveryApi:P,oauthRequestApi:J,environment:me.getOptionalString("auth.environment")})}),(0,c.createApiFactory)({api:f.RV,deps:{discovery:c.discoveryApiRef,identity:c.identityApiRef,config:c.configApiRef},factory:({config:P,discovery:J,identity:me})=>f.iM.create({config:P,discovery:J,identity:me})})];var p=e(77277),E=e(82339),T=e(62833);function I({children:P}){return(0,u.GV)()?t.createElement(t.Fragment,null,P):t.createElement(u.VA,null,P)}const B=()=>t.createElement(E.ErrorPage,{status:"404",statusMessage:"PAGE NOT FOUND"}),j=({step:P,error:J})=>{let me="";return P==="load-config"?me=`The configuration failed to load, someone should have a look at this error: ${J.message}`:P==="load-chunk"&&(me=`Lazy loaded chunk failed to load, try to reload the page: ${J.message}`),t.createElement(I,null,t.createElement(E.ErrorPage,{status:"501",statusMessage:me}))},M=({error:P,resetError:J,plugin:me})=>t.createElement(E.ErrorPanel,{title:`Error in ${me==null?void 0:me.getId()}`,defaultExpanded:!0,error:P},t.createElement(p.Z,{variant:"outlined",onClick:J},"Retry")),b={Progress:E.Progress,Router:T.VK,NotFoundErrorPage:B,BootErrorPage:j,ErrorBoundaryFallback:M};var L=e(43642),D=e(80079),U=e(90941),Y=e(32915),te=e(40562),ue=e(21853),Re=e(60744),we=e(66569),ge=e(30254),ze=e(13384),_e=e(15933),et=e(58838),st=e(86737),Ct=e(4989),yt=e(44407),Pe=e(18628),ht=e(84219),Ve=e(98685),ie=e(39781);const de={brokenImage:D.Z,catalog:Pe.Z,scaffolder:Y.Z,techdocs:te.Z,search:ue.Z,chat:Re.Z,dashboard:we.Z,docs:ge.Z,email:ze.Z,github:et.Z,group:ht.Z,help:st.Z,"kind:api":_e.Z,"kind:component":yt.Z,"kind:domain":L.Z,"kind:group":ht.Z,"kind:location":Ct.Z,"kind:system":U.Z,"kind:user":Ve.Z,user:Ve.Z,warning:ie.Z};var Ue=e(73689),Be=e(48032);const Xe={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")`},mt={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"]};function Ye(P,J){const De=`linear-gradient(90deg, ${(P.length===1?[P[0],P[0]]:P).join(", ")})`,Qe=`${J}, ${De}`;return{colors:P,shape:J,backgroundImage:Qe}}const Et={home:Ye(mt.teal,Xe.wave),documentation:Ye(mt.pinkSea,Xe.wave2),tool:Ye(mt.purpleSky,Xe.round),service:Ye(mt.marineBlue,Xe.wave),website:Ye(mt.veryBlue,Xe.wave),library:Ye(mt.rubyRed,Xe.wave),other:Ye(mt.darkGrey,Xe.wave),app:Ye(mt.toastyOrange,Xe.wave),apis:Ye(mt.teal,Xe.wave2)},oe='"Helvetica Neue", Helvetica, Roboto, Arial, sans-serif';function fe(P){const{palette:J,fontFamily:me=oe,defaultPageTheme:De,pageTheme:Qe=Et}=P;if(!Qe[De])throw new Error(`${De} is not defined in pageTheme.`);return{palette:J,props:{MuiGrid:{spacing:2},MuiSwitch:{color:"primary"}},typography:{fontFamily:me,h5:{fontWeight:700},h4:{fontWeight:700,fontSize:28,marginBottom:6},h3:{fontSize:32,fontWeight:700,marginBottom:6},h2:{fontSize:40,fontWeight:700,marginBottom:8},h1:{fontSize:54,fontWeight:700,marginBottom:10}},page:Qe[De],getPageTheme:({themeId:At})=>{var St;return(St=Qe[At])!=null?St:Qe[De]}}}function tt(P){return{MuiCssBaseline:{"@global":{html:{height:"100%",fontFamily:P.typography.fontFamily},body:{height:"100%",fontFamily:P.typography.fontFamily,"overscroll-behavior-y":"none"},a:{color:"inherit",textDecoration:"none"}}},MuiTableRow:{root:{"&:nth-of-type(odd)":{backgroundColor:P.palette.background.default}},hover:{"&:hover":{cursor:"pointer"}},head:{"&:nth-of-type(odd)":{backgroundColor:P.palette.background.paper}}},MuiTableCell:{root:{wordBreak:"break-word",overflow:"hidden",verticalAlign:"middle",lineHeight:"1",margin:0,padding:P.spacing(3,2,3,2.5),borderBottom:0},sizeSmall:{padding:P.spacing(1.5,2,1.5,2.5)},head:{wordBreak:"break-word",overflow:"hidden",color:"rgb(179, 179, 179)",fontWeight:"normal",lineHeight:"1"}},MuiTabs:{root:{minHeight:24}},MuiTab:{root:{color:P.palette.link,minHeight:24,textTransform:"initial",letterSpacing:"0.07em","&:hover":{color:(0,Be.darken)(P.palette.link,.3),background:(0,Be.lighten)(P.palette.link,.95)},[P.breakpoints.up("md")]:{minWidth:120,fontSize:P.typography.pxToRem(14),fontWeight:500}},textColorPrimary:{color:P.palette.link}},MuiTableSortLabel:{root:{color:"inherit","&:hover":{color:"inherit"},"&:focus":{color:"inherit"}},active:{fontWeight:"bold",color:"inherit"}},MuiListItemText:{dense:{whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"}},MuiButton:{text:{padding:void 0}},MuiChip:{root:{backgroundColor:"#D9D9D9",marginRight:P.spacing(1),marginBottom:P.spacing(1),color:P.palette.grey[900]},outlined:{color:P.palette.text.primary},label:{lineHeight:`${P.spacing(2.5)}px`,fontWeight:P.typography.fontWeightMedium,fontSize:`${P.spacing(1.75)}px`},labelSmall:{fontSize:`${P.spacing(1.5)}px`},deleteIcon:{color:P.palette.grey[500],width:`${P.spacing(3)}px`,height:`${P.spacing(3)}px`,margin:`0 ${P.spacing(.75)}px 0 -${P.spacing(.75)}px`},deleteIconSmall:{width:`${P.spacing(2)}px`,height:`${P.spacing(2)}px`,margin:`0 ${P.spacing(.5)}px 0 -${P.spacing(.5)}px`}},MuiCard:{root:{display:"flex",flexDirection:"column"}},MuiCardHeader:{root:{paddingBottom:0}},MuiCardContent:{root:{flexGrow:1,"&:last-child":{paddingBottom:void 0}}},MuiCardActions:{root:{justifyContent:"flex-end"}}}}function Ke(P){const J=fe(P),me=(0,Ue.Z)(J),De=tt(me);return{...me,overrides:De}}var Ne=e(34505);const ct=Ke({palette:{type:"light",background:{default:"#F8F8F8"},status:{ok:"#1DB954",warning:"#FF9800",error:"#E22134",running:"#2E77D0",pending:"#FFED51",aborted:"#757575"},bursts:{fontColor:"#FEFEFE",slackChannelText:"#ddd",backgroundColor:{default:"#7C3699"},gradient:{linear:"linear-gradient(-137deg, #4BB8A5 0%, #187656 100%)"}},primary:{main:"#2E77D0"},banner:{info:"#2E77D0",error:"#E22134",text:"#FFFFFF",link:"#000000",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:Ne.Z.A700,navigation:{background:"#171717",indicator:"#9BF0E1",color:"#b5b5b5",selectedColor:"#FFF",navItem:{hoverBackground:"#404040"},submenu:{background:"#404040"}},pinSidebarButton:{icon:"#181818",background:"#BDBDBD"},tabbar:{indicator:"#9BF0E1"}},defaultPageTheme:"home",pageTheme:Et}),X=Ke({palette:{type:"dark",background:{default:"#333333"},status:{ok:"#71CF88",warning:"#FFB84D",error:"#F84C55",running:"#3488E3",pending:"#FEF071",aborted:"#9E9E9E"},bursts:{fontColor:"#FEFEFE",slackChannelText:"#ddd",backgroundColor:{default:"#7C3699"},gradient:{linear:"linear-gradient(-137deg, #4BB8A5 0%, #187656 100%)"}},primary:{main:"#9CC9FF",dark:"#82BAFD"},secondary:{main:"#FF88B2"},banner:{info:"#2E77D0",error:"#E22134",text:"#FFFFFF",link:"#000000",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:Ne.Z.A700,navigation:{background:"#424242",indicator:"#9BF0E1",color:"#b5b5b5",selectedColor:"#FFF",navItem:{hoverBackground:"#404040"},submenu:{background:"#404040"}},pinSidebarButton:{icon:"#404040",background:"#BDBDBD"},tabbar:{indicator:"#9BF0E1"}},defaultPageTheme:"home",pageTheme:Et});var Z=e(98192),Q=e(15222),se=e(41547),le=e(87561);const be=[{id:"light",title:"Light Theme",variant:"light",icon:t.createElement(Q.Z,null),Provider:({children:P})=>t.createElement(se.Z,{theme:ct},t.createElement(le.ZP,null,P))},{id:"dark",title:"Dark Theme",variant:"dark",icon:t.createElement(Z.Z,null),Provider:({children:P})=>t.createElement(se.Z,{theme:X},t.createElement(le.ZP,null,P))}];function Oe(P){var J,me,De;return(0,o.createSpecializedApp)({...P,apis:(J=P==null?void 0:P.apis)!=null?J:[],bindRoutes:P==null?void 0:P.bindRoutes,components:{...b,...P==null?void 0:P.components},configLoader:P==null?void 0:P.configLoader,defaultApis:y,icons:{...de,...P==null?void 0:P.icons},plugins:(me=P==null?void 0:P.plugins)!=null?me:[],themes:(De=P==null?void 0:P.themes)!=null?De:be})}var Ae=e(82394),ke=e.n(Ae),We=e(48023),gt=e(76635);async function It({storageApi:P}){var At;const J=P.forBucket("settings"),me=P.forBucket("starredEntities"),De=J.snapshot("starredEntities").value;if(!(0,gt.isArray)(De))return;const Qe=new Set((At=me.snapshot("entityRefs").value)!=null?At:[]);De.filter(gt.isString).map(St=>St.split(":")).filter(St=>St.length===4&&St[0]==="entity").map(([St,R,C,w])=>(0,We.eE)({kind:R,namespace:C,name:w})).forEach(St=>Qe.add(St)),await me.set("entityRefs",Array.from(Qe)),await J.remove("starredEntities")}class lt{constructor(J){q(this,"settingsStore");q(this,"starredEntities");q(this,"subscribers",new Set);q(this,"observable",new(ke())(J=>(J.next(new Set(this.starredEntities)),this.subscribers.add(J),()=>{this.subscribers.delete(J)})));var me;It(J).then(),this.settingsStore=J.storageApi.forBucket("starredEntities"),this.starredEntities=new Set((me=this.settingsStore.snapshot("entityRefs").value)!=null?me:[]),this.settingsStore.observe$("entityRefs").subscribe({next:De=>{var Qe;this.starredEntities=new Set((Qe=De.value)!=null?Qe:[]),this.notifyChanges()}})}async toggleStarred(J){this.starredEntities.has(J)?this.starredEntities.delete(J):this.starredEntities.add(J),await this.settingsStore.set("entityRefs",Array.from(this.starredEntities))}starredEntitie$(){return this.observable}notifyChanges(){for(const J of this.subscribers)J.next(new Set(this.starredEntities))}}var Tt=e(39398),Lt=e(49782),Rt=e(79692),Nt=e(74450);const Zt=(0,Rt.Z)({flexContainer:{flexWrap:"wrap"},itemText:{width:"100%",wordBreak:"break-all",marginBottom:"1rem"}});function vt(P){var At,St;const J=P.result,me=Zt(),De=useAnalytics(),Qe=()=>{De.captureEvent("discover",J.title,{attributes:{to:J.location},value:P.rank})};return React.createElement(Link,{noTrack:!0,to:J.location,onClick:Qe},React.createElement(ListItem,{alignItems:"flex-start"},P.icon&&React.createElement(ListItemIcon,null,P.icon),React.createElement("div",{className:me.flexContainer},React.createElement(ListItemText,{className:me.itemText,primaryTypographyProps:{variant:"h6"},primary:(At=P.highlight)!=null&&At.fields.title?React.createElement(HighlightedSearchResultText,{text:P.highlight.fields.title,preTag:P.highlight.preTag,postTag:P.highlight.postTag}):J.title,secondary:(St=P.highlight)!=null&&St.fields.text?React.createElement(HighlightedSearchResultText,{text:P.highlight.fields.text,preTag:P.highlight.preTag,postTag:P.highlight.postTag}):J.text}),React.createElement(Box,null,J.kind&&React.createElement(Chip,{label:`Kind: ${J.kind}`,size:"small"}),J.lifecycle&&React.createElement(Chip,{label:`Lifecycle: ${J.lifecycle}`,size:"small"})))),React.createElement(Divider,{component:"li"}))}var at=e(30097),zt=e(53479),ae=e(95544),V=e(99688),ye=e(12231),He=e(86136),qe=e(49378),ot=e(85256),bt=e(61837),Wt=e(79784),Xt=e(50758),un=e(49166),dn=e(31654),xt=e(43054),qt=e(40749);const x="catalog-entity",re=(0,qt.J$)({name:"catalog.entity.read",attributes:{action:"read"},resourceType:x}),Ee=(0,qt.J$)({name:"catalog.entity.create",attributes:{action:"create"}}),Te=(0,qt.J$)({name:"catalog.entity.delete",attributes:{action:"delete"},resourceType:x}),Le=(0,qt.J$)({name:"catalog.entity.refresh",attributes:{action:"update"},resourceType:x}),Je=(0,qt.J$)({name:"catalog.location.read",attributes:{action:"read"}}),it=(0,qt.J$)({name:"catalog.location.create",attributes:{action:"create"}}),Kt=(0,qt.J$)({name:"catalog.location.delete",attributes:{action:"delete"}}),Ht=(0,Rt.Z)(P=>({button:{color:P.palette.bursts.fontColor}}),{name:"PluginCatalogEntityContextMenu"});function Dt(P){var ce;const{UNSTABLE_extraContextMenuItems:J,UNSTABLE_contextMenuOptions:me,onUnregisterEntity:De,onInspectEntity:Qe}=P,[At,St]=(0,t.useState)(),R=Ht(),C=(0,zt.useEntityPermission)(Te),w=Se=>{St(Se.currentTarget)},z=()=>{St(void 0)},k=J&&[...J.map(Se=>t.createElement(ye.Z,{key:Se.title,onClick:()=>{z(),Se.onClick()}},t.createElement(He.Z,null,t.createElement(Se.Icon,{fontSize:"small"})),t.createElement(qe.Z,{primary:Se.title}))),t.createElement(ot.Z,{key:"the divider is here!"})],K=(ce=!C.allowed||(me==null?void 0:me.disableUnregister))!=null?ce:!1;return t.createElement(t.Fragment,null,t.createElement(bt.Z,{"aria-label":"more","aria-controls":"long-menu","aria-haspopup":"true","aria-expanded":!!At,role:"button",onClick:w,"data-testid":"menu-button",className:R.button,id:"long-menu"},t.createElement(xt.Z,null)),t.createElement(Wt.ZP,{open:Boolean(At),onClose:z,anchorEl:At,anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"},"aria-labelledby":"long-menu"},t.createElement(Xt.Z,null,k,t.createElement(ye.Z,{onClick:()=>{z(),De()},disabled:K},t.createElement(He.Z,null,t.createElement(un.Z,{fontSize:"small"})),t.createElement(qe.Z,{primary:"Unregister entity"})),t.createElement(ye.Z,{onClick:()=>{z(),Qe()}},t.createElement(He.Z,null,t.createElement(dn.Z,{fontSize:"small"})),t.createElement(qe.Z,{primary:"Inspect entity"})))))}const Ft="plugin.catalog.entityLayoutRoute",ut=()=>null;(0,c.attachComponentData)(ut,Ft,!0),(0,c.attachComponentData)(ut,"core.gatherMountPoints",!0);function kt(P){const{entity:J,title:me}=P;return t.createElement(ae.Z,{display:"inline-flex",alignItems:"center",height:"1em",maxWidth:"100%"},t.createElement(ae.Z,{component:"span",textOverflow:"ellipsis",whiteSpace:"nowrap",overflow:"hidden"},me),J&&t.createElement(zt.FavoriteEntity,{entity:J}))}function tn(P,J,me,De){var R,C,w,z,k;const Qe=(R=P!=null?P:De==null?void 0:De.kind)!=null?R:"",At=(C=J!=null?J:De==null?void 0:De.metadata.namespace)!=null?C:"";return{headerTitle:`${(k=(z=(w=De==null?void 0:De.metadata.title)!=null?w:me)!=null?z:De==null?void 0:De.metadata.name)!=null?k:""}${At&&At!==We.zG?` in ${At}`:""}`,headerType:(()=>{let K=Qe.toLocaleLowerCase("en-US");return De&&De.spec&&"type"in De.spec&&(K+=" \u2014 ",K+=De.spec.type.toLocaleLowerCase("en-US")),K})()}}function jt(P){var De;const{entity:J}=P,me=(0,zt.getEntityRelations)(J,We.S4);return t.createElement(t.Fragment,null,me.length>0&&t.createElement(E.HeaderLabel,{label:"Owner",value:t.createElement(zt.EntityRefLinks,{entityRefs:me,defaultKind:"Group",color:"inherit"})}),((De=J.spec)==null?void 0:De.lifecycle)&&t.createElement(E.HeaderLabel,{label:"Lifecycle",value:J.spec.lifecycle}))}const Vt=P=>{var nt,je,Bt;const{UNSTABLE_extraContextMenuItems:J,UNSTABLE_contextMenuOptions:me,children:De,NotFoundComponent:Qe}=P,{kind:At,namespace:St,name:R}=(0,c.useRouteRefParams)(zt.entityRouteRef),{entity:C,loading:w,error:z}=(0,zt.useAsyncEntity)(),k=(0,u.TH)(),K=(0,c.useElementFilter)(De,_t=>_t.selectByComponentData({key:Ft,withStrictError:"Child of EntityLayout must be an EntityLayout.Route"}).getElements().flatMap(({props:En})=>{if(C){if(En.if&&!En.if(C))return[]}else return[];return[{path:En.path,title:En.title,children:En.children,tabProps:En.tabProps}]}),[C]),{headerTitle:ce,headerType:Se}=tn(At,St,R,C),[Ze,xe]=(0,t.useState)(!1),[Fe,$e]=(0,t.useState)(!1),Ge=(0,u.s0)(),Ot=async()=>{xe(!1),$e(!1),Ge("/")};return(0,t.useEffect)(()=>{xe(!1),$e(!1)},[k.pathname]),t.createElement(E.Page,{themeId:(Bt=(je=(nt=C==null?void 0:C.spec)==null?void 0:nt.type)==null?void 0:je.toString())!=null?Bt:"home"},t.createElement(E.Header,{title:t.createElement(kt,{title:ce,entity:C}),pageTitleOverride:ce,type:Se},C&&t.createElement(t.Fragment,null,t.createElement(jt,{entity:C}),t.createElement(Dt,{UNSTABLE_extraContextMenuItems:J,UNSTABLE_contextMenuOptions:me,onUnregisterEntity:()=>xe(!0),onInspectEntity:()=>$e(!0)}))),w&&t.createElement(E.Progress,null),C&&t.createElement(E.RoutedTabs,{routes:K}),z&&t.createElement(E.Content,null,t.createElement(V.Z,{severity:"error"},z.toString())),!w&&!z&&!C&&t.createElement(E.Content,null,Qe||t.createElement(E.WarningPanel,{title:"Entity not found"},"There is no ",At," with the requested"," ",t.createElement(E.Link,{to:"https://backstage.io/docs/features/software-catalog/references"},"kind, namespace, and name"),".")),t.createElement(zt.UnregisterEntityDialog,{open:Ze,entity:C,onConfirm:Ot,onClose:()=>xe(!1)}),t.createElement(zt.InspectEntityDialog,{open:Fe,entity:C,onClose:()=>$e(!1)}))};Vt.Route=ut;var cn=e(10179);function Tn(P){const{open:J,onClose:me,onConfirm:De,entity:Qe}=P,[At,St]=useState(!1),R=useApi(catalogApiRef),C=useApi(alertApiRef),w=async()=>{St(!0);try{const z=Qe.metadata.uid;await R.removeEntityByUid(z),De()}catch(z){assertError(z),C.post({message:z.message})}finally{St(!1)}};return React.createElement(Dialog,{open:J,onClose:me},React.createElement(DialogTitle,{id:"responsive-dialog-title"},"Are you sure you want to delete this entity?"),React.createElement(DialogActions,null,React.createElement(Button,{variant:"contained",color:"secondary",disabled:At,onClick:w},"Delete"),React.createElement(Button,{onClick:me,color:"primary"},"Cancel")))}var wt=e(47851);function $t(P){var J,me;return((me=(J=P==null?void 0:P.metadata)==null?void 0:J.annotations)==null?void 0:me["backstage.io/orphan"])==="true"}function hn(){const P=useNavigate(),J=useRouteRef(rootRouteRef),[me,De]=useState(!1),{entity:Qe}=useEntity(),At=async()=>{De(!1),P(J())};return React.createElement(React.Fragment,null,React.createElement(Alert,{severity:"warning",onClick:()=>De(!0)},"This entity is not referenced by any location and is therefore not receiving updates. Click here to delete."),React.createElement(DeleteEntityDialog,{open:me,entity:Qe,onConfirm:At,onClose:()=>De(!1)}))}var yn=e(30001);const an=P=>P.error&&P.level==="error"&&P.type===ENTITY_STATUS_CATALOG_PROCESSING_TYPE;async function fn(P,J){return{items:(await J.getEntityAncestors({entityRef:P})).items.map(Qe=>{var R,C;return{errors:((C=(R=Qe.entity.status)==null?void 0:R.items)!=null?C:[]).filter(an).map(w=>w.error).filter(w=>Boolean(w)),entity:Qe.entity}}).filter(Qe=>Qe.errors.length>0)}}async function Wn(P,J){const me=J.apis.get(catalogApiRef);if(!me)throw new Error(`No implementation available for ${catalogApiRef}`);return(await fn(stringifyEntityRef(P),me)).items.length>0}function $(){const{entity:P}=useEntity(),J=stringifyEntityRef(P),me=useApi(catalogApiRef),{loading:De,error:Qe,value:At}=useAsync(async()=>fn(J,me),[J,me]);return Qe?React.createElement(Box,{mb:1},React.createElement(ResponseErrorPanel,{error:Qe})):De||!At?null:React.createElement(React.Fragment,null,At.items.map((St,R)=>React.createElement(Box,{key:R,mb:1},stringifyEntityRef(P)!==stringifyEntityRef(St.entity)&&React.createElement(Box,{p:1},"The error below originates from"," ",React.createElement(EntityRefLink,{entityRef:St.entity})),St.errors.map((C,w)=>React.createElement(ResponseErrorPanel,{key:w,error:C})))))}var h=e(64279);const S="core.backstage.entitySwitch",F=P=>null;(0,c.attachComponentData)(F,S,!0);const W=P=>{var St,R;const{entity:J,loading:me}=(0,zt.useAsyncEntity)(),De=(0,c.useApiHolder)(),Qe=(0,c.useElementFilter)(P.children,C=>C.selectByComponentData({key:S,withStrictError:"Child of EntitySwitch is not an EntitySwitch.Case"}).getElements().flatMap(w=>{var K;if(me)return[];const{if:z,children:k}=w.props;return J?[{if:(K=z==null?void 0:z(J,{apis:De}))!=null?K:!0,children:k}]:[{if:z===void 0,children:k}]}),[De,J,me]);return Qe.some(C=>typeof C.if=="object"&&"then"in C.if)?t.createElement(pe,{results:Qe}):(R=(St=Qe.find(C=>C.if))==null?void 0:St.children)!=null?R:null};function pe({results:P}){const{loading:J,value:me}=(0,h.default)(async()=>{var Qe;const De=P.map(async({if:At,children:St})=>{try{if(await At)return St}catch{}return null});return(Qe=(await Promise.all(De)).find(Boolean))!=null?Qe:null},[P]);return J||!me?null:me}W.Case=F;const he=null,Me=zt.CatalogFilterLayout.Filters,ft=zt.CatalogFilterLayout.Content,Pt=(0,c.createPlugin)({id:"catalog",apis:[(0,c.createApiFactory)({api:zt.catalogApiRef,deps:{discoveryApi:c.discoveryApiRef,fetchApi:c.fetchApiRef},factory:({discoveryApi:P,fetchApi:J})=>new yn.MS({discoveryApi:P,fetchApi:J})}),(0,c.createApiFactory)({api:zt.starredEntitiesApiRef,deps:{storageApi:c.storageApiRef},factory:({storageApi:P})=>new lt({storageApi:P})})],routes:{catalogIndex:wt._Z,catalogEntity:zt.entityRouteRef},externalRoutes:{createComponent:wt.yw,viewTechDoc:wt.jU}}),bn=Pt.provide((0,c.createRoutableExtension)({name:"CatalogIndexPage",component:()=>e.e(7758).then(e.bind(e,7758)).then(P=>P.CatalogPage),mountPoint:wt._Z})),vn=Pt.provide((0,c.createRoutableExtension)({name:"CatalogEntityPage",component:()=>e.e(6583).then(e.bind(e,96583)).then(P=>P.CatalogEntityPage),mountPoint:zt.entityRouteRef})),Ur=Pt.provide((0,c.createComponentExtension)({name:"EntityAboutCard",component:{lazy:()=>Promise.resolve().then(e.bind(e,39398)).then(P=>P.AboutCard)}})),or=Pt.provide((0,c.createComponentExtension)({name:"EntityLinksCard",component:{lazy:()=>e.e(1959).then(e.bind(e,81959)).then(P=>P.EntityLinksCard)}})),Nr=Pt.provide((0,c.createComponentExtension)({name:"EntityHasSystemsCard",component:{lazy:()=>e.e(390).then(e.bind(e,60390)).then(P=>P.HasSystemsCard)}})),Zr=Pt.provide((0,c.createComponentExtension)({name:"EntityHasComponentsCard",component:{lazy:()=>e.e(4022).then(e.bind(e,4022)).then(P=>P.HasComponentsCard)}})),Hn=Pt.provide((0,c.createComponentExtension)({name:"EntityHasSubcomponentsCard",component:{lazy:()=>e.e(8792).then(e.bind(e,38792)).then(P=>P.HasSubcomponentsCard)}})),$n=Pt.provide((0,c.createComponentExtension)({name:"EntityHasResourcesCard",component:{lazy:()=>e.e(1553).then(e.bind(e,11553)).then(P=>P.HasResourcesCard)}})),Jn=Pt.provide((0,c.createComponentExtension)({name:"EntityDependsOnComponentsCard",component:{lazy:()=>e.e(8061).then(e.bind(e,48061)).then(P=>P.DependsOnComponentsCard)}})),sr=Pt.provide((0,c.createComponentExtension)({name:"EntityDependencyOfComponentsCard",component:{lazy:()=>e.e(6235).then(e.bind(e,56235)).then(P=>P.DependencyOfComponentsCard)}})),Rr=Pt.provide((0,c.createComponentExtension)({name:"EntityDependsOnResourcesCard",component:{lazy:()=>e.e(9028).then(e.bind(e,59028)).then(P=>P.DependsOnResourcesCard)}})),zr=Pt.provide((0,c.createComponentExtension)({name:"RelatedEntitiesCard",component:{lazy:()=>e.e(2426).then(e.bind(e,62426)).then(P=>P.RelatedEntitiesCard)}}));var Qn=e(36356);class Sr{constructor({configApi:J,discoveryApi:me,identityApi:De}){q(this,"configApi");q(this,"discoveryApi");q(this,"identityApi");this.configApi=J,this.discoveryApi=me,this.identityApi=De}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(J,me){const Qe=`${await this.getApiOrigin()}/${me}`,At=await fetch(`${Qe.endsWith("/")?Qe:`${Qe}/`}index.html`);if(At.status===404)throw new Error("Page not found");return At.text()}async syncEntityDocs(J){return"cached"}async getBaseUrl(J,me,De){const Qe=await this.getApiOrigin();return new URL(J,`${Qe}/${De}`).toString()}}class Wr{constructor({configApi:J,discoveryApi:me,identityApi:De}){q(this,"configApi");q(this,"discoveryApi");q(this,"identityApi");this.configApi=J,this.discoveryApi=me,this.identityApi=De}async getApiOrigin(){return await this.discoveryApi.getBaseUrl("techdocs")}async getEntityMetadata(J){return{apiVersion:"backstage.io/v1alpha1",kind:"Component",metadata:{name:"local"},spec:{owner:"test",lifecycle:"experimental"}}}async getTechDocsMetadata(J){return{site_name:"Live preview environment",site_description:""}}}const er=[(0,c.createApiFactory)({api:m.Dl,deps:{configApi:c.configApiRef,discoveryApi:c.discoveryApiRef,identityApi:c.identityApiRef},factory:({configApi:P,discoveryApi:J,identityApi:me})=>new Sr({configApi:P,discoveryApi:J,identityApi:me})}),(0,c.createApiFactory)({api:m.gT,deps:{configApi:c.configApiRef,discoveryApi:c.discoveryApiRef,identityApi:c.identityApiRef},factory:({configApi:P,discoveryApi:J,identityApi:me})=>new Wr({configApi:P,discoveryApi:J,identityApi:me})}),(0,c.createApiFactory)({api:Qn.q3,deps:{configApi:c.configApiRef},factory:({configApi:P})=>Qn.ae.fromConfig(P)})],Pn={backend:{baseUrl:"http://localhost:3000"},techdocs:{builder:"external"}},tr={backend:{baseUrl:"http://localhost:7007"},techdocs:{builder:"external"}};async function nr(){const P=await fetch("/.detect");return P.ok?(await P.text()).trim()==="techdocs-cli-server":!1}async function Cr(){const P=await(0,o.defaultConfigLoader)(),J=await nr();return[...P,{context:"detected",data:J?Pn:tr}]}var ir=e(86689),lr=e(58845);const Tr=(0,Rt.Z)({svg:{width:"auto",height:30},path:{fill:"#7df3e1"}});var rr=()=>{const P=Tr();return t.createElement("svg",{className:P.svg,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 2079.95 456.05"},t.createElement("path",{className:P.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 br=(0,Rt.Z)({svg:{width:"auto",height:28},path:{fill:"#7df3e1"}});var cr=()=>{const P=br();return t.createElement("svg",{className:P.svg,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 337.46 428.5"},t.createElement("path",{className:P.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 Pr=(0,Rt.Z)({root:{width:E.sidebarConfig.drawerWidthClosed,height:3*E.sidebarConfig.logoHeight,display:"flex",flexFlow:"row nowrap",alignItems:"center",marginBottom:-14},link:{width:E.sidebarConfig.drawerWidthClosed,marginLeft:24}}),ur=()=>{const P=Pr(),{isOpen:J}=(0,E.useSidebarOpenState)();return t.createElement("div",{className:P.root},t.createElement(ir.Z,{component:T.OL,to:"/docs/default/component/local/",underline:"none",className:P.link},J?t.createElement(rr,null):t.createElement(cr,null)))},Ir=({children:P})=>t.createElement(E.SidebarPage,null,t.createElement(E.Sidebar,null,t.createElement(ur,null),t.createElement(E.SidebarDivider,null),t.createElement(E.SidebarItem,{icon:lr.Z,to:"/docs/default/component/local",text:"Docs Preview"})),P);var dr=e(80030),mn=e(32388),Fn=e(4142);const Lr=(0,Rt.Z)(P=>({headerIcon:{color:P.palette.common.white,width:"32px",height:"32px"},content:{backgroundColor:P.palette.background.default},contentToolbar:{display:"flex",justifyContent:"flex-end",padding:0}}));var Bn;(function(P){const J="light";P.LIGHT=J;const me="dark";P.DARK=me})(Bn||(Bn={}));const fr=()=>{const P=(0,c.useApi)(c.appThemeApiRef),J=Lr(),[me,De]=(0,t.useState)(P.getActiveThemeId()||Bn.LIGHT),Qe={[Bn.LIGHT]:{icon:Fn.Z,title:"Dark theme"},[Bn.DARK]:{icon:mn.Z,title:"Light theme"}},{title:At,icon:St}=Qe[me],R=()=>{De(C=>{const w=C===Bn.LIGHT?Bn.DARK:Bn.LIGHT;return P.setActiveThemeId(w),w})};return t.createElement(ae.Z,{display:"flex",alignItems:"center",mr:2},t.createElement(dr.ZP,{title:At,arrow:!0},t.createElement(bt.Z,{size:"small",onClick:R},t.createElement(St,{className:J.headerIcon}))))},Vn=()=>t.createElement(A.TechDocsReaderPage,null,t.createElement(A.TechDocsReaderPageHeader,null),t.createElement(A.TechDocsReaderPageContent,{withSearch:!1})),Gn=t.createElement(Vn,null),mr=Oe({apis:er,configLoader:Cr,plugins:Object.values(r)}),Or=mr.getProvider(),hr=mr.getRouter(),Kn=A.techdocsPlugin.provide((0,m.KY)({name:"ThemeToggleAddon",component:fr,location:m.oZ.Header})),Vr=t.createElement(o.FlatRoutes,null,t.createElement(u.Fg,{key:"/",to:"/docs/default/component/local/"}),t.createElement(u.AW,{path:"/catalog/:namespace/:kind/:name",element:t.createElement(vn,null)}),t.createElement(u.AW,{path:"/docs",element:t.createElement(A.TechDocsIndexPage,null)},t.createElement(A.DefaultTechDocsHome,null)),t.createElement(u.AW,{path:"/docs/:namespace/:kind/:name/*",element:t.createElement(A.TechDocsReaderPage,null)},Gn,t.createElement(m.DR,null,t.createElement(Kn,null))));var gr=()=>t.createElement(Or,null,t.createElement(hr,null,t.createElement(Ir,null,Vr)));l.render(t.createElement(gr,null),document.getElementById("root"))},76241:function(ee,s,e){"use strict";e.d(s,{CT:function(){return m},EI:function(){return f},uW:function(){return u},Vt:function(){return o}});function r(){return typeof window!="undefined"&&window.Math===Math?window:typeof self!="undefined"&&self.Math===Math?self:Function("return this")()}const t=r(),l=y=>`__@backstage/${y}__`;function u(y,p){const E=l(y);let T=t[E];return T||(T=p(),t[E]=T,T)}var A=e(2784);function m(y){return u(y,()=>(0,A.createContext)(void 0))}function o(y){return(0,A.useContext)(m(y))}function c(y){return{set(p){globalThis[`__@backstage/${y}__`]=createContext(createVersionedValueMap(p))},reset(){delete globalThis[`__@backstage/${y}__`]}}}function f(y){return Object.freeze(y),{atVersion(p){return y[p]}}}},53479:function(ee,s,e){"use strict";e.d(s,{AsyncEntityProvider:function(){return U},CATALOG_FILTER_EXISTS:function(){return r.n3},CatalogFilterLayout:function(){return b},EntityKindFilter:function(){return Q},EntityLifecyclePicker:function(){return xt},EntityListProvider:function(){return Ue},EntityOwnerPicker:function(){return Ee},EntityRefLink:function(){return X},EntityRefLinks:function(){return Z},EntityTable:function(){return Dt},EntityTagPicker:function(){return tn},EntityTypePicker:function(){return cn},FavoriteEntity:function(){return an},InspectEntityDialog:function(){return mr},UnregisterEntityDialog:function(){return gr},UserListPicker:function(){return At},catalogApiRef:function(){return l},entityRouteRef:function(){return fe},getEntityRelations:function(){return ht},getEntitySourceLocation:function(){return Ve},humanizeEntityRef:function(){return Ke},starredEntitiesApiRef:function(){return u},useAsyncEntity:function(){return ue},useEntity:function(){return te},useEntityList:function(){return Be},useEntityOwnership:function(){return Zt},useEntityPermission:function(){return at},useRelatedEntities:function(){return It},useStarredEntities:function(){return Lt}});var r=e(30001),t=e(36964);const l=(0,t.createApiRef)({id:"plugin.catalog.service"}),u=(0,t.createApiRef)({id:"catalog-react.starred-entities"});var A=e(82394);class m{constructor(){q(this,"starredEntities",new Set);q(this,"subscribers",new Set);q(this,"observable",new ObservableImpl(C=>(C.next(new Set(this.starredEntities)),this.subscribers.add(C),()=>{this.subscribers.delete(C)})))}async toggleStarred(C){this.starredEntities.delete(C)||this.starredEntities.add(C);for(const w of this.subscribers)w.next(new Set(this.starredEntities))}starredEntitie$(){return this.observable}}var o=e(2784),c=e(41156),f=e(60364),y=e(77277),p=e(4190),E=e(95544),T=e(90436),I=e(60905),B=e(36444);const j=R=>{const C=(0,c.Z)(K=>K.breakpoints.down("md")),w=(0,f.Z)(),[z,k]=(0,o.useState)(!1);return C?o.createElement(o.Fragment,null,o.createElement(y.Z,{style:{marginTop:w.spacing(1),marginLeft:w.spacing(1)},onClick:()=>k(!0),startIcon:o.createElement(B.Z,null)},"Filters"),o.createElement(p.ZP,{open:z,onClose:()=>k(!1),anchor:"left",disableAutoFocus:!0,keepMounted:!0,variant:"temporary"},o.createElement(E.Z,{m:2},o.createElement(T.Z,{variant:"h6",component:"h2",style:{marginBottom:w.spacing(1)}},"Filters"),R.children))):o.createElement(I.Z,{item:!0,lg:2},R.children)},M=R=>o.createElement(I.Z,{item:!0,xs:12,lg:10},R.children),b=R=>o.createElement(I.Z,{container:!0,style:{position:"relative"}},R.children);b.Filters=j,b.Content=M;var L=e(76241);const D=(0,L.CT)("entity-context"),U=({children:R,entity:C,loading:w,error:z,refresh:k})=>{const K={entity:C,loading:w,error:z,refresh:k};return o.createElement(D.Provider,{value:(0,L.EI)({1:K})},R)},Y=R=>React.createElement(U,{entity:R.entity,loading:!Boolean(R.entity),error:void 0,refresh:void 0,children:R.children});function te(){const R=(0,L.Vt)("entity-context");if(!R)throw new Error("Entity context is not available");const C=R.atVersion(1);if(!C)throw new Error("EntityContext v1 not available");if(!C.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:C.entity}}function ue(){const R=(0,L.Vt)("entity-context");if(!R)throw new Error("Entity context is not available");const C=R.atVersion(1);if(!C)throw new Error("EntityContext v1 not available");const{entity:w,loading:z,error:k,refresh:K}=C;return{entity:w,loading:z,error:k,refresh:K}}var Re=e(76635),we=e(19126),ge=e.n(we),ze=e(10289),_e=e(69294),et=e(48760),st=e(90736);function Ct(R){return R.reduce((C,w)=>({...C,...w.getCatalogFilters?w.getCatalogFilters():{}}),{})}function yt(R){return C=>R.every(w=>!w.filterEntity||w.filterEntity(C))}var Pe=e(48023);function ht(R,C,w){var k;let z=((k=R==null?void 0:R.relations)==null?void 0:k.filter(K=>K.type===C).map(K=>(0,Pe.of)(K.targetRef)))||[];return w!=null&&w.kind&&(z=z.filter(K=>K.kind.toLocaleLowerCase("en-US")===w.kind.toLocaleLowerCase("en-US"))),z}function Ve(R,C){var z;const w=(z=R.metadata.annotations)==null?void 0:z[Pe.M6];if(!!w)try{const k=(0,Pe.Ou)(w),K=C.byUrl(k.target);return{locationTargetUrl:k.target,integrationType:K==null?void 0:K.type}}catch{return}}function ie(R,C){const w=new Set([...getEntityRelations(R,RELATION_MEMBER_OF,{kind:"group"}),...R?[getCompoundEntityRef(R)]:[]].map(stringifyEntityRef)),z=getEntityRelations(C,RELATION_OWNED_BY).map(stringifyEntityRef);for(const k of z)if(w.has(k))return!0;return!1}const de=(0,o.createContext)(void 0),Ue=({children:R})=>{const C=(0,st.default)(),w=(0,t.useApi)(l),[z,k]=(0,o.useState)({}),K=(0,ze.TH)(),ce=(0,o.useMemo)(()=>{var nt;return(nt=ge().parse(K.search,{ignoreQueryPrefix:!0}).filters)!=null?nt:{}},[K]),[Se,Ze]=(0,o.useState)(()=>({appliedFilters:{},entities:[],backendEntities:[]})),[{loading:xe,error:Fe},$e]=(0,_e.default)(async()=>{var In;const nt=(0,Re.compact)(Object.values(z)),je=yt(nt),Bt=Ct(nt),_t=Ct((0,Re.compact)(Object.values(Se.appliedFilters))),En=Object.keys(z).reduce((gn,An)=>{const Ln=z[An];return Ln!=null&&Ln.toQueryValue&&(gn[An]=Ln.toQueryValue()),gn},{});if((0,Re.isEqual)(_t,Bt))Ze({appliedFilters:z,backendEntities:Se.backendEntities,entities:Se.backendEntities.filter(je)});else{const gn=await w.getEntities({filter:Bt});Ze({appliedFilters:z,backendEntities:gn.items,entities:gn.items.filter(je)})}if(C()){const gn=ge().parse(K.search,{ignoreQueryPrefix:!0}),An=ge().stringify({...gn,filters:En},{addQueryPrefix:!0,arrayFormat:"repeat"}),Ln=`${window.location.pathname}${An}`;(In=window.history)==null||In.replaceState(null,document.title,Ln)}},[w,ce,z,Se],{loading:!0});(0,et.Z)($e,10,[z]);const Ge=(0,o.useCallback)(nt=>{k(je=>{const Bt=typeof nt=="function"?nt(je):nt;return{...je,...Bt}})},[]),Ot=(0,o.useMemo)(()=>({filters:Se.appliedFilters,entities:Se.entities,backendEntities:Se.backendEntities,updateFilters:Ge,queryParameters:ce,loading:xe,error:Fe}),[Se,Ge,ce,xe,Fe]);return o.createElement(de.Provider,{value:Ot},R)};function Be(){const R=(0,o.useContext)(de);if(!R)throw new Error("useEntityList must be used within EntityListProvider");return R}var Xe=e(64279),mt=e(18149),Ye=e.n(mt),Et=e(829),oe=e.n(Et);const fe=(0,L.uW)("catalog:entity-route-ref",()=>(0,t.createRouteRef)({id:"catalog:entity",params:["namespace","kind","name"]}));function tt(R){var C,w;return{kind:R.kind.toLocaleLowerCase("en-US"),namespace:(w=(C=R.metadata.namespace)==null?void 0:C.toLocaleLowerCase("en-US"))!=null?w:DEFAULT_NAMESPACE,name:R.metadata.name}}function Ke(R,C){const w=C==null?void 0:C.defaultKind;let z,k,K;return"metadata"in R?(z=R.kind,k=R.metadata.namespace,K=R.metadata.name):(z=R.kind,k=R.namespace,K=R.name),k===Pe.zG&&(k=void 0),z=z.toLocaleLowerCase("en-US"),z=w&&w.toLocaleLowerCase("en-US")===z?void 0:z,`${z?`${z}:`:""}${k?`${k}/`:""}${K}`}var Ne=e(82339),ct=e(80030);const X=(0,o.forwardRef)((R,C)=>{var nt;const{entityRef:w,defaultKind:z,title:k,children:K,...ce}=R,Se=(0,t.useRouteRef)(fe);let Ze,xe,Fe;if(typeof w=="string"){const je=(0,Pe.of)(w);Ze=je.kind,xe=je.namespace,Fe=je.name}else"metadata"in w?(Ze=w.kind,xe=w.metadata.namespace,Fe=w.metadata.name):(Ze=w.kind,xe=w.namespace,Fe=w.name);Ze=Ze.toLocaleLowerCase("en-US"),xe=(nt=xe==null?void 0:xe.toLocaleLowerCase("en-US"))!=null?nt:Pe.zG;const $e={kind:Ze,namespace:xe,name:Fe},Ge=Ke({kind:Ze,namespace:xe,name:Fe},{defaultKind:z}),Ot=o.createElement(Ne.Link,{...ce,ref:C,to:Se($e)},K,!K&&(k!=null?k:Ge));return k?o.createElement(ct.ZP,{title:Ge},Ot):Ot});function Z(R){const{entityRefs:C,defaultKind:w,...z}=R;return o.createElement(o.Fragment,null,C.map((k,K)=>o.createElement(o.Fragment,{key:K},K>0&&", ",o.createElement(X,{...z,entityRef:k,defaultKind:w}))))}class Q{constructor(C){this.value=C}getCatalogFilters(){return{kind:this.value}}toQueryValue(){return this.value}}class se{constructor(C){this.value=C}getTypes(){return Array.isArray(this.value)?this.value:[this.value]}getCatalogFilters(){return{"spec.type":this.getTypes()}}toQueryValue(){return this.getTypes()}}class le{constructor(C){this.values=C}filterEntity(C){return this.values.every(w=>{var z;return((z=C.metadata.tags)!=null?z:[]).includes(w)})}toQueryValue(){return this.values}}class be{constructor(C){this.value=C}filterEntity(C){var z;const w=this.value.toLocaleUpperCase("en-US");return C.metadata.name.toLocaleUpperCase("en-US").includes(w)||`${C.metadata.title}`.toLocaleUpperCase("en-US").includes(w)||((z=C.metadata.tags)==null?void 0:z.join("").toLocaleUpperCase("en-US").indexOf(w))!==-1}}class Oe{constructor(C){this.values=C}filterEntity(C){return this.values.some(w=>ht(C,Pe.S4).some(z=>Ke(z,{defaultKind:"group"})===w))}toQueryValue(){return this.values}}class Ae{constructor(C){this.values=C}filterEntity(C){return this.values.some(w=>{var z;return((z=C.spec)==null?void 0:z.lifecycle)===w})}toQueryValue(){return this.values}}class ke{constructor(C,w,z){this.value=C,this.isOwnedEntity=w,this.isStarredEntity=z}filterEntity(C){switch(this.value){case"owned":return this.isOwnedEntity(C);case"starred":return this.isStarredEntity(C);default:return!0}}toQueryValue(){return this.value}}function We(){var je;const R=(0,t.useApi)(l),{filters:{kind:C,type:w},queryParameters:{type:z},updateFilters:k}=Be(),K=(0,o.useMemo)(()=>[z].flat().filter(Boolean),[z]),[ce,Se]=(0,o.useState)(K.length?K:(je=w==null?void 0:w.getTypes())!=null?je:[]);(0,o.useEffect)(()=>{K.length&&Se(K)},[K]);const[Ze,xe]=(0,o.useState)([]),Fe=(0,o.useMemo)(()=>C==null?void 0:C.value,[C]),{error:$e,loading:Ge,value:Ot}=(0,Xe.default)(async()=>Fe?await R.getEntityFacets({filter:{kind:Fe},facets:["spec.type"]}).then(_t=>_t.facets["spec.type"]||[]):[],[Fe,R]),nt=(0,o.useRef)(Ot);return(0,o.useEffect)(()=>{const Bt=nt.current;if(nt.current=Ot,Ge||!Fe||Bt===Ot||!Ot)return;const _t=[...new Set(oe()(Ot,In=>-In.count).map(In=>In.value.toLocaleLowerCase("en-US")))];xe(_t);const En=ce.filter(In=>_t.includes(In));Ye()(ce,En)||Se(En)},[Ge,Fe,ce,Se,Ot]),(0,o.useEffect)(()=>{k({type:ce.length?new se(ce):void 0})},[ce,k]),{loading:Ge,error:$e,availableTypes:Ze,selectedTypes:ce,setSelectedTypes:Se}}const gt=20;function It(R,C){var Ze,xe;const w=(Ze=C==null?void 0:C.type)==null?void 0:Ze.toLocaleLowerCase("en-US"),z=(xe=C==null?void 0:C.kind)==null?void 0:xe.toLocaleLowerCase("en-US"),k=(0,t.useApi)(l),{loading:K,value:ce,error:Se}=(0,Xe.default)(async()=>{var nt;const Fe=(nt=R.relations)==null?void 0:nt.map(je=>({type:je.type,target:(0,Pe.of)(je.targetRef)})).filter(je=>(!w||je.type.toLocaleLowerCase("en-US")===w)&&(!z||je.target.kind===z));if(!Fe)return[];const $e=Object.values((0,Re.groupBy)(Fe,({target:je})=>`${je.kind}:${je.namespace}`.toLocaleLowerCase("en-US"))),Ge=[];for(const je of $e)Ge.push({kind:je[0].target.kind,namespace:je[0].target.namespace,nameBatches:(0,Re.chunk)(je.map(Bt=>Bt.target.name),gt)});return(await Promise.all(Ge.flatMap(je=>je.nameBatches.map(Bt=>k.getEntities({filter:{kind:je.kind,"metadata.namespace":je.namespace,"metadata.name":Bt}}))))).flatMap(je=>je.items)},[R,w,z]);return{entities:ce,loading:K,error:Se}}var lt=e(72164);function Tt(R){return typeof R=="string"?R:(0,Pe.eE)(R)}function Lt(){const R=(0,t.useApi)(u),C=(0,lt.Z)(R.starredEntitie$(),new Set),w=(0,o.useCallback)(k=>C.has(Tt(k)),[C]),z=(0,o.useCallback)(k=>R.toggleStarred(Tt(k)).then(),[R]);return{starredEntities:C,toggleStarredEntity:z,isStarredEntity:w}}function Rt(R){return typeof R=="string"?R:(0,Pe.eE)(R)}function Nt(R){const C=(0,t.useApi)(u),[w,z]=(0,o.useState)(!1);return(0,o.useEffect)(()=>{const K=C.starredEntitie$().subscribe({next(ce){z(ce.has(Rt(R)))}});return()=>{K.unsubscribe()}},[R,C]),{toggleStarredEntity:(0,o.useCallback)(()=>C.toggleStarred(Rt(R)).then(),[R,C]),isStarredEntity:w}}function Zt(){const R=(0,t.useApi)(t.identityApiRef),{loading:C,value:w}=(0,Xe.default)(async()=>{const{ownershipEntityRefs:k}=await R.getBackstageIdentity();return k},[]),z=(0,o.useMemo)(()=>{const k=new Set(w!=null?w:[]);return K=>{const ce=ht(K,Pe.S4).map(Pe.eE);for(const Se of ce)if(k.has(Se))return!0;return!1}},[w]);return(0,o.useMemo)(()=>({loading:C,isOwnedEntity:z}),[C,z])}var vt=e(68099);function at(R){const{entity:C,loading:w,error:z}=ue(),{allowed:k,loading:K,error:ce}=(0,vt.gI)({permission:R,resourceRef:C?(0,Pe.eE)(C):void 0});return w||K?{loading:!0,allowed:!1}:z?{loading:!1,allowed:!1,error:z}:{loading:!1,allowed:k,error:ce}}const zt=R=>{var ce;const{initialFilter:C,hidden:w}=R,{updateFilters:z,queryParameters:{kind:k}}=useEntityList(),[K]=useState((ce=[k].flat()[0])!=null?ce:C);return useEffect(()=>{z({kind:K?new EntityKindFilter(K):void 0})},[K,z]),w?null:React.createElement(Alert,{severity:"warning"},"Kind filter not yet available")};var ae=e(79692),V=e(5806),ye=e(21324),He=e(86619),qe=e(19996),ot=e(25505),bt=e(38016),Wt=e(88013);const Xt=(0,ae.Z)({input:{}},{name:"CatalogReactEntityLifecyclePicker"}),un=o.createElement(ot.Z,{fontSize:"small"}),dn=o.createElement(qe.Z,{fontSize:"small"}),xt=()=>{var xe,Fe;const R=Xt(),{updateFilters:C,backendEntities:w,filters:z,queryParameters:{lifecycles:k}}=Be(),K=(0,o.useMemo)(()=>[k].flat().filter(Boolean),[k]),[ce,Se]=(0,o.useState)(K.length?K:(Fe=(xe=z.lifecycles)==null?void 0:xe.values)!=null?Fe:[]);(0,o.useEffect)(()=>{K.length&&Se(K)},[K]),(0,o.useEffect)(()=>{C({lifecycles:ce.length?new Ae(ce):void 0})},[ce,C]);const Ze=(0,o.useMemo)(()=>[...new Set(w.map($e=>{var Ge;return(Ge=$e.spec)==null?void 0:Ge.lifecycle}).filter(Boolean))].sort(),[w]);return Ze.length?o.createElement(E.Z,{pb:1,pt:1},o.createElement(T.Z,{variant:"button",component:"label"},"Lifecycle",o.createElement(Wt.ZP,{multiple:!0,options:Ze,value:ce,onChange:($e,Ge)=>Se(Ge),renderOption:($e,{selected:Ge})=>o.createElement(V.Z,{control:o.createElement(ye.Z,{icon:un,checkedIcon:dn,checked:Ge}),label:$e}),size:"small",popupIcon:o.createElement(bt.Z,{"data-testid":"lifecycle-picker-expand"}),renderInput:$e=>o.createElement(He.Z,{...$e,className:R.input,variant:"outlined"})}))):null},qt=(0,ae.Z)({input:{}},{name:"CatalogReactEntityOwnerPicker"}),x=o.createElement(ot.Z,{fontSize:"small"}),re=o.createElement(qe.Z,{fontSize:"small"}),Ee=()=>{var xe,Fe;const R=qt(),{updateFilters:C,backendEntities:w,filters:z,queryParameters:{owners:k}}=Be(),K=(0,o.useMemo)(()=>[k].flat().filter(Boolean),[k]),[ce,Se]=(0,o.useState)(K.length?K:(Fe=(xe=z.owners)==null?void 0:xe.values)!=null?Fe:[]);(0,o.useEffect)(()=>{K.length&&Se(K)},[K]),(0,o.useEffect)(()=>{C({owners:ce.length?new Oe(ce):void 0})},[ce,C]);const Ze=(0,o.useMemo)(()=>[...new Set(w.flatMap($e=>ht($e,Pe.S4).map(Ge=>Ke(Ge,{defaultKind:"group"}))).filter(Boolean))].sort(),[w]);return Ze.length?o.createElement(E.Z,{pb:1,pt:1},o.createElement(T.Z,{variant:"button",component:"label"},"Owner",o.createElement(Wt.ZP,{multiple:!0,options:Ze,value:ce,onChange:($e,Ge)=>Se(Ge),renderOption:($e,{selected:Ge})=>o.createElement(V.Z,{control:o.createElement(ye.Z,{icon:x,checkedIcon:re,checked:Ge}),label:$e}),size:"small",popupIcon:o.createElement(bt.Z,{"data-testid":"owner-picker-expand"}),renderInput:$e=>o.createElement(He.Z,{...$e,className:R.input,variant:"outlined"})}))):null},Te=(0,ae.Z)(R=>({searchToolbar:{paddingLeft:0,paddingRight:0},input:{}}),{name:"CatalogReactEntitySearchBar"}),Le=()=>{var K,ce;const R=Te(),{filters:C,updateFilters:w}=useEntityList(),[z,k]=useState((ce=(K=C.text)==null?void 0:K.value)!=null?ce:"");return useDebounce(()=>{w({text:z.length?new EntityTextFilter(z):void 0})},250,[z,w]),React.createElement(Toolbar,{className:R.searchToolbar},React.createElement(FormControl,null,React.createElement(Input,{"aria-label":"search",id:"input-with-icon-adornment",className:R.input,placeholder:"Search",autoComplete:"off",onChange:Se=>k(Se.target.value),value:z,startAdornment:React.createElement(InputAdornment,{position:"start"},React.createElement(Search,null)),endAdornment:React.createElement(InputAdornment,{position:"end"},React.createElement(IconButton,{"aria-label":"clear search",onClick:()=>k(""),edge:"end",disabled:z.length===0},React.createElement(Clear,null)))})))},Je=Object.freeze({createEntityRefColumn(R){const{defaultKind:C}=R;function w(z){var k;return((k=z.metadata)==null?void 0:k.title)||Ke(z,{defaultKind:C})}return{title:"Name",highlight:!0,customFilterAndSearch(z,k){return w(k).includes(z)},customSort(z,k){return w(z).localeCompare(w(k))},render:z=>{var k;return o.createElement(X,{entityRef:z,defaultKind:C,title:(k=z.metadata)==null?void 0:k.title})}}},createEntityRelationColumn({title:R,relation:C,defaultKind:w,filter:z}){function k(ce){return ht(ce,C,z)}function K(ce){return k(ce).map(Se=>Ke(Se,{defaultKind:w})).join(", ")}return{title:R,customFilterAndSearch(ce,Se){return K(Se).includes(ce)},customSort(ce,Se){return K(ce).localeCompare(K(Se))},render:ce=>o.createElement(Z,{entityRefs:k(ce),defaultKind:w})}},createOwnerColumn(){return this.createEntityRelationColumn({title:"Owner",relation:Pe.S4,defaultKind:"group"})},createDomainColumn(){return this.createEntityRelationColumn({title:"Domain",relation:Pe.cz,defaultKind:"domain",filter:{kind:"domain"}})},createSystemColumn(){return this.createEntityRelationColumn({title:"System",relation:Pe.cz,defaultKind:"system",filter:{kind:"system"}})},createMetadataDescriptionColumn(){return{title:"Description",field:"metadata.description",render:R=>o.createElement(Ne.OverflowTooltip,{text:R.metadata.description,placement:"bottom-start",line:2}),width:"auto"}},createSpecLifecycleColumn(){return{title:"Lifecycle",field:"spec.lifecycle"}},createSpecTypeColumn(){return{title:"Type",field:"spec.type"}}}),it=[Je.createEntityRefColumn({defaultKind:"system"}),Je.createDomainColumn(),Je.createOwnerColumn(),Je.createMetadataDescriptionColumn()],Kt=[Je.createEntityRefColumn({defaultKind:"component"}),Je.createSystemColumn(),Je.createOwnerColumn(),Je.createSpecTypeColumn(),Je.createSpecLifecycleColumn(),Je.createMetadataDescriptionColumn()],Ht=(0,ae.Z)(R=>({empty:{padding:R.spacing(2),display:"flex",justifyContent:"center"}})),Dt=R=>{const{entities:C,title:w,emptyContent:z,variant:k="gridItem",columns:K}=R,ce=Ht(),Se={minWidth:"0",width:"100%"};return k==="gridItem"&&(Se.height="calc(100% - 10px)"),o.createElement(Ne.Table,{columns:K,title:w,style:Se,emptyContent:z&&o.createElement("div",{className:ce.empty},z),options:{search:!1,paging:!1,actionsColumnIndex:-1,padding:"dense",draggable:!1},data:C})};Dt.columns=Je,Dt.systemEntityColumns=it,Dt.componentEntityColumns=Kt;const Ft=(0,ae.Z)({input:{}},{name:"CatalogReactEntityTagPicker"}),ut=o.createElement(ot.Z,{fontSize:"small"}),kt=o.createElement(qe.Z,{fontSize:"small"}),tn=()=>{var xe,Fe;const R=Ft(),{updateFilters:C,filters:w,queryParameters:{tags:z}}=Be(),k=(0,t.useApi)(l),{value:K}=(0,Xe.default)(async()=>{var Ot;const $e="metadata.tags",{facets:Ge}=await k.getEntityFacets({facets:[$e],filter:(Ot=w.kind)==null?void 0:Ot.getCatalogFilters()});return Ge[$e].map(({value:nt})=>nt)},[w.kind]),ce=(0,o.useMemo)(()=>[z].flat().filter(Boolean),[z]),[Se,Ze]=(0,o.useState)(ce.length?ce:(Fe=(xe=w.tags)==null?void 0:xe.values)!=null?Fe:[]);return(0,o.useEffect)(()=>{ce.length&&Ze(ce)},[ce]),(0,o.useEffect)(()=>{C({tags:Se.length?new le(Se):void 0})},[Se,C]),K!=null&&K.length?o.createElement(E.Z,{pb:1,pt:1},o.createElement(T.Z,{variant:"button",component:"label"},"Tags",o.createElement(Wt.ZP,{multiple:!0,options:K,value:Se,onChange:($e,Ge)=>Ze(Ge),renderOption:($e,{selected:Ge})=>o.createElement(V.Z,{control:o.createElement(ye.Z,{icon:ut,checkedIcon:kt,checked:Ge}),label:$e}),size:"small",popupIcon:o.createElement(bt.Z,{"data-testid":"tag-picker-expand"}),renderInput:$e=>o.createElement(He.Z,{...$e,className:R.input,variant:"outlined"})}))):null};var jt=e(82108),Vt=e.n(jt);const cn=R=>{var xe;const{hidden:C,initialFilter:w}=R,z=(0,t.useApi)(t.alertApiRef),{error:k,availableTypes:K,selectedTypes:ce,setSelectedTypes:Se}=We();if((0,o.useEffect)(()=>{k&&z.post({message:"Failed to load entity types",severity:"error"}),w&&Se([w])},[k,z,w,Se]),K.length===0||k)return null;const Ze=[{value:"all",label:"All"},...K.map(Fe=>({value:Fe,label:Vt()(Fe)}))];return C?null:o.createElement(E.Z,{pb:1,pt:1},o.createElement(Ne.Select,{label:"Type",items:Ze,selected:(xe=Ze.length>1?ce[0]:void 0)!=null?xe:"all",onChange:Fe=>Se(Fe==="all"?[]:[String(Fe)])}))};var Tn=e(15459),wt=e(61837),$t=e(11640),hn=e(28347);const yn=(0,Tn.Z)({root:{color:"#f3ba37"}})($t.Z),an=R=>{const{toggleStarredEntity:C,isStarredEntity:w}=Nt(R.entity);return o.createElement(wt.Z,{"aria-label":"favorite",color:"inherit",...R,onClick:()=>C()},o.createElement(ct.ZP,{title:w?"Remove from favorites":"Add to favorites"},w?o.createElement(yn,null):o.createElement(hn.Z,null)))};var fn=e(8629),Wn=e(79249),$=e(38724),h=e(99152),S=e(6487),F=e(49429),W=e(55999),pe=e(72779),he=e.n(pe),Me=e(39412);const ft=Me.Z;function Pt(R,C){if(R)return R.toLocaleLowerCase("en-US");if(C)try{return(0,Pe.of)(C).kind.toLocaleLowerCase("en-US")}catch{return}}function bn(R,C){const w=(0,t.useApp)(),z=Pt(R,C);return z&&w.getSystemIcon(`kind:${z}`)||ft}function vn(R){const{kind:C,entityRef:w,...z}=R,k=bn(C,w);return o.createElement(k,{...z})}const Ur=(0,ae.Z)(R=>({node:{fill:R.palette.grey[300],stroke:R.palette.grey[300],"&.primary":{fill:R.palette.primary.light,stroke:R.palette.primary.light},"&.secondary":{fill:R.palette.secondary.light,stroke:R.palette.secondary.light}},text:{fill:R.palette.getContrastText(R.palette.grey[300]),"&.primary":{fill:R.palette.primary.contrastText},"&.secondary":{fill:R.palette.secondary.contrastText},"&.focused":{fontWeight:"bold"}},clickable:{cursor:"pointer"}}));function or(R){const C=(0,t.useApi)(l),w=(0,Pe.eE)(R),{loading:z,error:k,value:K}=(0,Xe.default)(async()=>{const ce=await C.getEntityAncestors({entityRef:w}),Se=new Array,Ze=new Array;for(const xe of ce.items){const Fe=(0,Pe.eE)(xe.entity),$e=Fe===ce.rootEntityRef;Se.push({id:Fe,root:$e,...xe.entity});for(const Ge of xe.parentEntityRefs)Ze.push({from:Fe,to:Ge})}return{nodes:Se,edges:Ze}},[w]);return{loading:z,error:k,nodes:(K==null?void 0:K.nodes)||[],edges:(K==null?void 0:K.edges)||[]}}function Nr({node:R}){const C=Ur(),w=(0,ze.s0)(),z=(0,t.useRouteRef)(fe),[k,K]=(0,o.useState)(0),[ce,Se]=(0,o.useState)(0),Ze=(0,o.useRef)(null);(0,o.useLayoutEffect)(()=>{if(Ze.current){let{height:Bt,width:_t}=Ze.current.getBBox();Bt=Math.round(Bt),_t=Math.round(_t),(Bt!==ce||_t!==k)&&(K(_t),Se(Bt))}},[k,ce]);const xe=10,Fe=ce,$e=Fe+xe,Ge=$e+k+xe*2,Ot=ce+xe*2,nt=R.metadata.title||(R.kind&&R.metadata.name&&R.metadata.namespace?Ke({kind:R.kind,name:R.metadata.name,namespace:R.metadata.namespace||""}):R.id),je=()=>{w(z({kind:R.kind,namespace:R.metadata.namespace||Pe.zG,name:R.metadata.name}))};return o.createElement("g",{onClick:je,className:C.clickable},o.createElement("rect",{className:he()(C.node,R.root?"secondary":"primary"),width:Ge,height:Ot,rx:10}),o.createElement(vn,{kind:R.kind,y:xe,x:xe,width:Fe,height:Fe,className:he()(C.text,R.root?"secondary":"primary")}),o.createElement("text",{ref:Ze,className:he()(C.text,R.root?"secondary":"primary"),y:Ot/2,x:$e+(k+xe*2)/2,textAnchor:"middle",alignmentBaseline:"middle"},nt))}function Zr(R){const{loading:C,error:w,nodes:z,edges:k}=or(R.entity);return C?o.createElement(Ne.Progress,null):w?o.createElement(Ne.ResponseErrorPanel,{error:w}):o.createElement(o.Fragment,null,o.createElement(W.Z,{variant:"h2"},"Ancestry"),o.createElement(W.Z,{gutterBottom:!0},"This is the ancestry of entities above the current one - as in, the chain(s) of entities down to the current one, where"," ",o.createElement(Ne.Link,{to:"https://backstage.io/docs/features/software-catalog/life-of-an-entity"},"processors emitted")," ","child entities that ultimately led to the current one existing. Note that this is a completely different mechanism from relations."),o.createElement(E.Z,{mt:4},o.createElement(Ne.DependencyGraph,{nodes:z,edges:k,renderNode:Nr,direction:Ne.DependencyGraphTypes.Nm.BOTTOM_TOP,zoom:"enable-on-click"})))}var Hn=e(11776),$n=e(38402),Jn=e(86136),sr=e(99688),Rr=e(49378),zr=e(54506),Qn=e(94339),Sr=e(24579),Wr=e(27685);const er=(0,ae.Z)(R=>({root:{display:"flex",flexDirection:"column"},marginTop:{marginTop:R.spacing(2)},helpIcon:{marginLeft:R.spacing(1),color:R.palette.text.disabled},monospace:{fontFamily:"monospace"}}));function Pn(R){const C=er();return o.createElement(Rr.Z,{...R,primaryTypographyProps:{className:C.monospace},secondaryTypographyProps:{className:C.monospace}})}function tr(R){const C=er();return o.createElement(zr.Z,{className:C.monospace},R.children)}function nr(R){return o.createElement(E.Z,{mt:2},o.createElement(Qn.Z,{variant:"outlined"},o.createElement(Sr.Z,null,o.createElement(T.Z,{variant:"h6",gutterBottom:!0},R.title,R.helpLink&&o.createElement(lr,{to:R.helpLink})),R.children)))}function Cr(R){if(R.match(/^url:https?:\/\//))return R.slice(4);if(R.match(/^https?:\/\//))return R}function ir(R){const[C,w]=R.entry,z=Cr(w);return o.createElement($n.Z,null,R.indent&&o.createElement(Jn.Z,null),o.createElement(Pn,{primary:C,secondary:z?o.createElement(Ne.Link,{to:z},w):w}))}function lr(R){const C=er();return o.createElement(Ne.Link,{to:R.to,className:C.helpIcon},o.createElement(Wr.Z,{fontSize:"inherit"}))}const Tr=(0,ae.Z)({root:{display:"flex",flexDirection:"column"}});function Hr(R){var Ze,xe;const C=(0,t.useApi)(l),w=(0,Pe.eE)(R),z=(Ze=R.metadata.annotations)==null?void 0:Ze[Pe.P1],k=(xe=R.metadata.annotations)==null?void 0:xe[Pe.q1],{loading:K,error:ce,value:Se}=(0,Xe.default)(async()=>!z&&!k?[]:(await C.getEntities({filter:[...z?[{[`metadata.annotations.${Pe.P1}`]:z}]:[],...k?[{[`metadata.annotations.${Pe.q1}`]:k}]:[]]})).items,[z,k]);return{loading:K,error:ce,location:z,originLocation:k,colocatedEntities:Se==null?void 0:Se.filter(Fe=>(0,Pe.eE)(Fe)!==w)}}function rr(R){return o.createElement(Hn.Z,{dense:!0},R.header&&o.createElement(ir,{key:"header",entry:R.header}),R.entities.map(C=>o.createElement($n.Z,{key:(0,Pe.eE)(C)},o.createElement(Jn.Z,null,o.createElement(vn,{kind:C.kind})),o.createElement(Pn,{primary:o.createElement(X,{entityRef:C})}))))}function br(R){const{entity:C}=R,{loading:w,error:z,location:k,originLocation:K,colocatedEntities:ce}=Hr(C);if(w)return o.createElement(Ne.Progress,null);if(z)return o.createElement(Ne.ResponseErrorPanel,{error:z});if(!k&&!K)return o.createElement(sr.Z,{severity:"warning"},"Entity had no location information.");if(!(ce!=null&&ce.length))return o.createElement(sr.Z,{severity:"info"},"There were no other entities on this location.");if(k===K)return o.createElement(rr,{entities:ce});const Se=ce.filter(xe=>{var Fe;return((Fe=xe.metadata.annotations)==null?void 0:Fe[Pe.P1])===k}),Ze=ce.filter(xe=>{var Fe;return((Fe=xe.metadata.annotations)==null?void 0:Fe[Pe.q1])===K});return o.createElement(o.Fragment,null,Se.length>0&&o.createElement(rr,{entities:Se,header:["At the same location",k]}),Ze.length>0&&o.createElement(rr,{entities:Ze,header:["At the same origin",K]}))}function jr(R){const C=Tr();return o.createElement(o.Fragment,null,o.createElement(W.Z,{variant:"h2"},"Colocated"),o.createElement(W.Z,null,"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)."),o.createElement("div",{className:C.root},o.createElement(br,{entity:R.entity})))}function cr(R){return Object.fromEntries([...Object.entries(R)].sort((C,w)=>C[0]<w[0]?-1:1))}function Pr(R){return o.createElement(o.Fragment,null,o.createElement(W.Z,{variant:"h2"},"Entity as JSON"),o.createElement(W.Z,null,"This is the raw entity data as received from the catalog, on JSON form."),o.createElement(W.Z,null,o.createElement("div",{style:{fontSize:"75%"},"data-testid":"code-snippet"},o.createElement(Ne.CodeSnippet,{text:JSON.stringify(cr(R.entity),void 0,2),language:"json",showCopyCodeButton:!0}))))}var ur=e(3440),Ir=e.n(ur);const dr=(0,ae.Z)({root:{display:"flex",flexDirection:"column"}});function mn(R){var xe,Fe;const C=dr(),{apiVersion:w,kind:z,metadata:k,spec:K,relations:ce=[],status:Se={}}=R.entity,Ze=Ir()(oe()(ce,$e=>$e.targetRef),"type");return o.createElement(o.Fragment,null,o.createElement(W.Z,{variant:"h2"},"Overview"),o.createElement("div",{className:C.root},o.createElement(nr,{title:"Identity"},o.createElement(Hn.Z,{dense:!0},o.createElement($n.Z,null,o.createElement(Pn,{primary:"apiVersion",secondary:w})),o.createElement($n.Z,null,o.createElement(Pn,{primary:"kind",secondary:z})),(K==null?void 0:K.type)&&o.createElement($n.Z,null,o.createElement(Pn,{primary:"spec.type",secondary:K.type})),k.uid&&o.createElement($n.Z,null,o.createElement(Pn,{primary:"uid",secondary:k.uid})),k.etag&&o.createElement($n.Z,null,o.createElement(Pn,{primary:"etag",secondary:k.etag})))),o.createElement(nr,{title:"Metadata"},!!Object.keys(k.annotations||{}).length&&o.createElement(Hn.Z,{dense:!0,subheader:o.createElement(tr,null,"Annotations",o.createElement(lr,{to:"https://backstage.io/docs/features/software-catalog/well-known-annotations"}))},Object.entries(k.annotations).map($e=>o.createElement(ir,{key:$e[0],indent:!0,entry:$e}))),!!Object.keys(k.labels||{}).length&&o.createElement(Hn.Z,{dense:!0,subheader:o.createElement(tr,null,"Labels")},Object.entries(k.labels).map($e=>o.createElement(ir,{key:$e[0],indent:!0,entry:$e}))),!!((xe=k.tags)!=null&&xe.length)&&o.createElement(Hn.Z,{dense:!0,subheader:o.createElement(tr,null,"Tags")},k.tags.map(($e,Ge)=>o.createElement($n.Z,{key:`${$e}-${Ge}`},o.createElement(Jn.Z,null),o.createElement(Pn,{primary:$e}))))),!!ce.length&&o.createElement(nr,{title:"Relations",helpLink:"https://backstage.io/docs/features/software-catalog/well-known-relations"},Object.entries(Ze).map(([$e,Ge],Ot)=>o.createElement("div",{key:Ot},o.createElement(Hn.Z,{dense:!0,subheader:o.createElement(tr,null,$e)},Ge.map(nt=>o.createElement($n.Z,{key:nt.targetRef},o.createElement(Jn.Z,null,o.createElement(vn,{entityRef:nt.targetRef})),o.createElement(Pn,{primary:o.createElement(X,{entityRef:nt.targetRef})}))))))),!!((Fe=Se.items)!=null&&Fe.length)&&o.createElement(nr,{title:"Status",helpLink:"https://backstage.io/docs/features/software-catalog/well-known-statuses"},Se.items.map(($e,Ge)=>o.createElement("div",{key:Ge},o.createElement(T.Z,null,$e.level,": ",$e.type),o.createElement(E.Z,{ml:2},$e.message))))))}var Fn=e(60155),Lr=e.n(Fn);function Bn(R){return o.createElement(o.Fragment,null,o.createElement(W.Z,{variant:"h2"},"Entity as YAML"),o.createElement(W.Z,null,"This is the raw entity data as received from the catalog, on YAML form."),o.createElement(W.Z,null,o.createElement("div",{style:{fontSize:"75%"},"data-testid":"code-snippet"},o.createElement(Ne.CodeSnippet,{text:Lr().stringify(cr(R.entity)),language:"yaml",showCopyCodeButton:!0}))))}const fr=(0,ae.Z)(R=>({fullHeightDialog:{height:"calc(100% - 64px)"},root:{display:"flex",flexGrow:1,width:"100%",backgroundColor:R.palette.background.paper},tabs:{borderRight:`1px solid ${R.palette.divider}`,flexShrink:0},tabContents:{flexGrow:1,overflowX:"auto"}}));function Vn(R){const{children:C,value:w,index:z,...k}=R,K=fr();return o.createElement("div",{role:"tabpanel",hidden:w!==z,id:`vertical-tabpanel-${z}`,"aria-labelledby":`vertical-tab-${z}`,className:K.tabContents,...k},w===z&&o.createElement(E.Z,{pl:3,pr:3},C))}function Gn(R){return{id:`vertical-tab-${R}`,"aria-controls":`vertical-tabpanel-${R}`}}function mr(R){const C=fr(),[w,z]=o.useState(0);return(0,o.useEffect)(()=>{z(0)},[R.open]),R.entity?o.createElement(fn.Z,{fullWidth:!0,maxWidth:"xl",open:R.open,onClose:R.onClose,"aria-labelledby":"entity-inspector-dialog-title",PaperProps:{className:C.fullHeightDialog}},o.createElement(Wn.Z,{id:"entity-inspector-dialog-title"},"Entity Inspector"),o.createElement($.Z,{dividers:!0},o.createElement("div",{className:C.root},o.createElement(h.Z,{orientation:"vertical",variant:"scrollable",value:w,onChange:(k,K)=>z(K),"aria-label":"Inspector options",className:C.tabs},o.createElement(S.Z,{label:"Overview",...Gn(0)}),o.createElement(S.Z,{label:"Ancestry",...Gn(1)}),o.createElement(S.Z,{label:"Colocated",...Gn(2)}),o.createElement(S.Z,{label:"Raw JSON",...Gn(3)}),o.createElement(S.Z,{label:"Raw YAML",...Gn(4)})),o.createElement(Vn,{value:w,index:0},o.createElement(mn,{entity:R.entity})),o.createElement(Vn,{value:w,index:1},o.createElement(Zr,{entity:R.entity})),o.createElement(Vn,{value:w,index:2},o.createElement(jr,{entity:R.entity})),o.createElement(Vn,{value:w,index:3},o.createElement(Pr,{entity:R.entity})),o.createElement(Vn,{value:w,index:4},o.createElement(Bn,{entity:R.entity})))),o.createElement(F.Z,null,o.createElement(y.Z,{onClick:R.onClose,color:"primary"},"Close"))):null}var Or=e(85256);function hr(R){var Ot;const C=(0,t.useApi)(l),w=(Ot=R.metadata.annotations)==null?void 0:Ot[Pe.q1],z=R.metadata.uid,k=w==="bootstrap:bootstrap",K=(0,Xe.default)(async()=>{const nt=C.getLocationByRef(w);let je;if(!w)je=Promise.resolve([]);else{const Bt=`metadata.annotations.${Pe.q1}`;je=C.getEntities({filter:{[Bt]:w},fields:["kind","metadata.uid","metadata.name","metadata.namespace"]}).then(_t=>_t.items)}return Promise.all([nt,je]).then(([Bt,_t])=>({location:Bt,colocatedEntities:_t}))},[C,R]),ce=(0,o.useCallback)(async function(){const{location:je}=K.value;await C.removeLocationById(je.id)},[C,K]),Se=(0,o.useCallback)(async function(){await C.removeEntityByUid(z)},[C,z]);if(k)return{type:"bootstrap",location:w,deleteEntity:Se};const{loading:Ze,error:xe,value:Fe}=K;if(Ze)return{type:"loading"};if(xe)return{type:"error",error:xe};const{location:$e,colocatedEntities:Ge}=Fe;return $e?{type:"unregister",location:w,colocatedEntities:Ge.map(Pe.iB),unregisterLocation:ce,deleteEntity:Se}:{type:"only-delete",deleteEntity:Se}}var Kn=e(10179);const Vr=(0,ae.Z)({advancedButton:{fontSize:"0.7em"}}),Gr=({entity:R,onConfirm:C})=>{var Ot;const w=(0,t.useApi)(t.alertApiRef),z=(0,t.useApi)(t.configApiRef),k=Vr(),K=hr(R),[ce,Se]=(0,o.useState)(!1),[Ze,xe]=(0,o.useState)(!1),Fe=(Ot=z.getOptionalString("app.title"))!=null?Ot:"Backstage",$e=(0,o.useCallback)(async function(){if("unregisterLocation"in K){xe(!0);try{await K.unregisterLocation(),C()}catch(je){(0,Kn.BD)(je),w.post({message:je.message})}finally{xe(!1)}}},[w,C,K]),Ge=(0,o.useCallback)(async function(){if("deleteEntity"in K){xe(!0);try{await K.deleteEntity(),C()}catch(je){(0,Kn.BD)(je),w.post({message:je.message})}finally{xe(!1)}}},[w,C,K]);return K.type==="loading"?o.createElement(Ne.Progress,null):K.type==="error"?o.createElement(Ne.ResponseErrorPanel,{error:K.error}):K.type==="bootstrap"?o.createElement(o.Fragment,null,o.createElement(sr.Z,{severity:"info"},'You cannot unregister this entity, since it originates from a protected Backstage configuration (location "',K.location,'"). If you believe this is in error, please contact the ',Fe," ","integrator."),o.createElement(E.Z,{marginTop:2},!ce&&o.createElement(y.Z,{variant:"text",size:"small",color:"primary",className:k.advancedButton,onClick:()=>Se(!0)},"Advanced Options"),ce&&o.createElement(o.Fragment,null,o.createElement(W.Z,null,"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."),o.createElement(y.Z,{variant:"contained",color:"secondary",disabled:Ze,onClick:Ge},"Delete Entity")))):K.type==="only-delete"?o.createElement(o.Fragment,null,o.createElement(W.Z,null,"This entity does not seem to originate from a registered location. You therefore only have the option to delete it outright from the catalog."),o.createElement(y.Z,{variant:"contained",color:"secondary",disabled:Ze,onClick:Ge},"Delete Entity")):K.type==="unregister"?o.createElement(o.Fragment,null,o.createElement(W.Z,null,"This action will unregister the following entities:"),o.createElement(W.Z,{component:"ul"},K.colocatedEntities.map(nt=>o.createElement("li",{key:`${nt.kind}:${nt.namespace}/${nt.name}`},o.createElement(X,{entityRef:nt})))),o.createElement(W.Z,null,"Located at the following location:"),o.createElement(W.Z,{component:"ul"},o.createElement("li",null,K.location)),o.createElement(W.Z,null,"To undo, just re-register the entity in ",Fe,"."),o.createElement(E.Z,{marginTop:2},o.createElement(y.Z,{variant:"contained",color:"secondary",disabled:Ze,onClick:$e},"Unregister Location"),!ce&&o.createElement(E.Z,{component:"span",marginLeft:2},o.createElement(y.Z,{variant:"text",size:"small",color:"primary",className:k.advancedButton,onClick:()=>Se(!0)},"Advanced Options"))),ce&&o.createElement(o.Fragment,null,o.createElement(E.Z,{paddingTop:4,paddingBottom:4},o.createElement(Or.Z,null)),o.createElement(W.Z,null,"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."),o.createElement(y.Z,{variant:"contained",color:"secondary",disabled:Ze,onClick:Ge},"Delete Entity"))):o.createElement(sr.Z,{severity:"error"},"Internal error: Unknown state")},gr=R=>{const{open:C,onConfirm:w,onClose:z,entity:k}=R;return o.createElement(fn.Z,{open:C,onClose:z},o.createElement(Wn.Z,{id:"responsive-dialog-title"},"Are you sure you want to unregister this entity?"),o.createElement($.Z,null,o.createElement(Gr,{entity:k,onConfirm:w})),o.createElement(F.Z,null,o.createElement(y.Z,{onClick:z,color:"primary"},"Cancel")))};var P=e(12231),J=e(9520),me=e(47603);const De=(0,ae.Z)(R=>({root:{backgroundColor:"rgba(0, 0, 0, .11)",boxShadow:"none",margin:R.spacing(1,0,1,0)},title:{margin:R.spacing(1,0,0,1),textTransform:"uppercase",fontSize:12,fontWeight:"bold"},listIcon:{minWidth:30,color:R.palette.text.primary},menuItem:{minHeight:R.spacing(6)},groupWrapper:{margin:R.spacing(1,1,2,1)}}),{name:"CatalogReactUserListPicker"});function Qe(R){return[{name:"Personal",items:[{id:"owned",label:"Owned",icon:me.Z},{id:"starred",label:"Starred",icon:$t.Z}]},{name:R!=null?R:"Company",items:[{id:"all",label:"All"}]}]}const At=R=>{var aa;const{initialFilter:C,availableFilters:w}=R,z=De(),K=(aa=(0,t.useApi)(t.configApiRef).getOptionalString("organization.name"))!=null?aa:"Company",{filters:ce,updateFilters:Se,backendEntities:Ze,queryParameters:{kind:xe,user:Fe},loading:$e}=Be(),Ge=["starred","all"],Ot=Qe(K).map(on=>({...on,items:on.items.filter(({id:On})=>["group","user"].some(Dr=>Dr===xe)?Ge.includes(On):!w||w.includes(On))})).filter(({items:on})=>!!on.length),{isStarredEntity:nt}=Lt(),{isOwnedEntity:je,loading:Bt}=Zt(),_t=$e||Bt,En=(0,o.useMemo)(()=>new ke("owned",je,nt),[je,nt]),In=(0,o.useMemo)(()=>new ke("starred",je,nt),[je,nt]),gn=(0,o.useMemo)(()=>[Fe].flat()[0],[Fe]),[An,Ln]=(0,o.useState)(gn!=null?gn:C),xr=(0,o.useMemo)(()=>Ze.filter(yt((0,Re.compact)(Object.values({...ce,user:void 0})))),[ce,Ze]),pr=(0,o.useMemo)(()=>({all:xr.length,starred:xr.filter(on=>In.filterEntity(on)).length,owned:xr.filter(on=>En.filterEntity(on)).length}),[xr,In,En]);return(0,o.useEffect)(()=>{gn&&Ln(gn)},[gn]),(0,o.useEffect)(()=>{!_t&&!!An&&An!=="all"&&pr[An]===0&&Ln("all")},[_t,pr,An,Ln]),(0,o.useEffect)(()=>{Se({user:An?new ke(An,je,nt):void 0})},[An,je,nt,Se]),o.createElement(Qn.Z,{className:z.root},Ot.map(on=>o.createElement(o.Fragment,{key:on.name},o.createElement(T.Z,{variant:"subtitle2",component:"span",className:z.title},on.name),o.createElement(Qn.Z,{className:z.groupWrapper},o.createElement(Hn.Z,{disablePadding:!0,dense:!0,role:"menu","aria-label":on.name},on.items.map(On=>{var Dr,oa;return o.createElement(P.Z,{role:"none presentation",key:On.id,button:!0,divider:!0,onClick:()=>Ln(On.id),selected:On.id===((Dr=ce.user)==null?void 0:Dr.value),className:z.menuItem,disabled:pr[On.id]===0,"data-testid":`user-picker-${On.id}`,tabIndex:0,ContainerProps:{role:"menuitem"}},On.icon&&o.createElement(Jn.Z,{className:z.listIcon},o.createElement(On.icon,{fontSize:"small"})),o.createElement(Rr.Z,null,o.createElement(T.Z,{variant:"body1"},On.label," ")),o.createElement(J.Z,null,(oa=pr[On.id])!=null?oa:"-"))}))))))},St=({children:R,value:C})=>{var Se;const[w,z]=useState((Se=C==null?void 0:C.filters)!=null?Se:{}),k=useCallback(Ze=>{z(xe=>{const Fe=typeof Ze=="function"?Ze(xe):Ze;return{...xe,...Fe}})},[]),K=useMemo(()=>({entities:[],backendEntities:[],queryParameters:{}}),[]),ce=useMemo(()=>{var Ze,xe,Fe,$e,Ge;return{entities:(Ze=C==null?void 0:C.entities)!=null?Ze:K.entities,backendEntities:(xe=C==null?void 0:C.backendEntities)!=null?xe:K.backendEntities,updateFilters:(Fe=C==null?void 0:C.updateFilters)!=null?Fe:k,filters:w,loading:($e=C==null?void 0:C.loading)!=null?$e:!1,queryParameters:(Ge=C==null?void 0:C.queryParameters)!=null?Ge:K.queryParameters,error:C==null?void 0:C.error}},[C,K,w,k]);return React.createElement(EntityListContext.Provider,{value:ce},R)}},39398:function(ee,s,e){"use strict";e.r(s),e.d(s,{AboutCard:function(){return Re},AboutContent:function(){return te},AboutField:function(){return U}});var r=e(48023),t=e(82339),l=e(36964),u=e(36356),A=e(53479),m=e(79692),o=e(94339),c=e(32552),f=e(61837),y=e(85256),p=e(24579),E=e(52866),T=e(30254),I=e(27604),B=e(2784),j=e(47851),M=e(60905),b=e(90436),L=e(7089);const D=(0,m.Z)(we=>({value:{fontWeight:"bold",overflow:"hidden",lineHeight:"24px",wordBreak:"break-word"},label:{color:we.palette.text.secondary,textTransform:"uppercase",fontSize:"10px",fontWeight:"bold",letterSpacing:.5,overflow:"hidden",whiteSpace:"nowrap"}}));function U(we){const{label:ge,value:ze,gridSizes:_e,children:et}=we,st=D(),Ct=(0,l.useElementFilter)(et,Pe=>Pe.getElements()),yt=Ct.length>0?Ct:B.createElement(b.Z,{variant:"body2",className:st.value},ze||"unknown");return B.createElement(M.Z,{item:!0,..._e},B.createElement(b.Z,{variant:"h2",className:st.label},ge),yt)}const Y=(0,m.Z)({description:{wordBreak:"break-word"}});function te(we){var Be,Xe,mt,Ye,Et,oe;const{entity:ge}=we,ze=Y(),_e=ge.kind.toLocaleLowerCase("en-US")==="system",et=ge.kind.toLocaleLowerCase("en-US")==="resource",st=ge.kind.toLocaleLowerCase("en-US")==="component",Ct=ge.kind.toLocaleLowerCase("en-US")==="api",yt=ge.kind.toLocaleLowerCase("en-US")==="template",Pe=ge.kind.toLocaleLowerCase("en-US")==="location",ht=ge.kind.toLocaleLowerCase("en-US")==="group",Ve=(0,A.getEntityRelations)(ge,r.cz,{kind:"system"}),ie=(0,A.getEntityRelations)(ge,r.cz,{kind:"component"}),de=(0,A.getEntityRelations)(ge,r.cz,{kind:"domain"}),Ue=(0,A.getEntityRelations)(ge,r.S4);return B.createElement(M.Z,{container:!0},B.createElement(U,{label:"Description",gridSizes:{xs:12}},B.createElement(b.Z,{variant:"body2",paragraph:!0,className:ze.description},((Be=ge==null?void 0:ge.metadata)==null?void 0:Be.description)||"No description")),B.createElement(U,{label:"Owner",value:"No Owner",gridSizes:{xs:12,sm:6,lg:4}},Ue.length>0&&B.createElement(A.EntityRefLinks,{entityRefs:Ue,defaultKind:"group"})),(_e||de.length>0)&&B.createElement(U,{label:"Domain",value:"No Domain",gridSizes:{xs:12,sm:6,lg:4}},de.length>0&&B.createElement(A.EntityRefLinks,{entityRefs:de,defaultKind:"domain"})),(Ct||st||et||Ve.length>0)&&B.createElement(U,{label:"System",value:"No System",gridSizes:{xs:12,sm:6,lg:4}},Ve.length>0&&B.createElement(A.EntityRefLinks,{entityRefs:Ve,defaultKind:"system"})),st&&ie.length>0&&B.createElement(U,{label:"Parent Component",value:"No Parent Component",gridSizes:{xs:12,sm:6,lg:4}},B.createElement(A.EntityRefLinks,{entityRefs:ie,defaultKind:"component"})),(Ct||st||et||yt||ht||Pe||typeof((Xe=ge==null?void 0:ge.spec)==null?void 0:Xe.type)=="string")&&B.createElement(U,{label:"Type",value:(mt=ge==null?void 0:ge.spec)==null?void 0:mt.type,gridSizes:{xs:12,sm:6,lg:4}}),(Ct||st||typeof((Ye=ge==null?void 0:ge.spec)==null?void 0:Ye.lifecycle)=="string")&&B.createElement(U,{label:"Lifecycle",value:(Et=ge==null?void 0:ge.spec)==null?void 0:Et.lifecycle,gridSizes:{xs:12,sm:6,lg:4}}),B.createElement(U,{label:"Tags",value:"No Tags",gridSizes:{xs:12,sm:6,lg:4}},(((oe=ge==null?void 0:ge.metadata)==null?void 0:oe.tags)||[]).map(fe=>B.createElement(L.Z,{key:fe,size:"small",label:fe}))))}const ue=(0,m.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 Re(we){var Ye,Et,oe;const{variant:ge}=we,ze=ue(),{entity:_e}=(0,A.useEntity)(),et=(0,l.useApi)(u.q3),st=(0,l.useApi)(A.catalogApiRef),Ct=(0,l.useApi)(l.alertApiRef),yt=(0,l.useRouteRef)(j.jU),Pe=(0,A.getEntitySourceLocation)(_e,et),ht=(Ye=_e.metadata.annotations)==null?void 0:Ye[r.Tf],Ve={label:"View Source",disabled:!Pe,icon:B.createElement(u.nW,{type:Pe==null?void 0:Pe.integrationType}),href:Pe==null?void 0:Pe.locationTargetUrl},ie={label:"View TechDocs",disabled:!((Et=_e.metadata.annotations)!=null&&Et["backstage.io/techdocs-ref"])||!yt,icon:B.createElement(T.Z,null),href:yt&&yt({namespace:_e.metadata.namespace||r.zG,kind:_e.kind,name:_e.metadata.name})};let de="";ge==="gridItem"?de=ze.gridItemCard:ge==="fullHeight"&&(de=ze.fullHeightCard);let Ue="";ge==="gridItem"?Ue=ze.gridItemCardContent:ge==="fullHeight"&&(Ue=ze.fullHeightCardContent);const Be=(oe=_e.metadata.annotations)==null?void 0:oe[r.P1],Xe=(Be==null?void 0:Be.startsWith("url:"))||(Be==null?void 0:Be.startsWith("file:")),mt=(0,B.useCallback)(async()=>{await st.refreshEntity((0,r.eE)(_e)),Ct.post({message:"Refresh scheduled",severity:"info"})},[st,Ct,_e]);return B.createElement(o.Z,{className:de},B.createElement(c.Z,{title:"About",action:B.createElement(B.Fragment,null,Xe&&B.createElement(f.Z,{"aria-label":"Refresh",title:"Schedule entity refresh",onClick:mt},B.createElement(E.Z,null)),B.createElement(f.Z,{component:t.Link,"aria-label":"Edit",disabled:!ht,title:"Edit Metadata",to:ht!=null?ht:"#"},B.createElement(I.Z,null))),subheader:B.createElement(t.HeaderIconLinkRow,{links:[Ve,ie]})}),B.createElement(y.Z,null),B.createElement(p.Z,{className:Ue},B.createElement(te,{entity:_e})))}},49782:function(ee,s,e){"use strict";e.d(s,{K:function(){return E}});var r=e(2784),t=e(79692),l=e(12420),u=e(97580),A=e(73698),m=e(74603),o=e(12231),c=e(53479),f=e(64279),y=e(36964);const p=(0,t.Z)(T=>(0,l.Z)({root:{...T.typography.h4}}));function E(T){var we;const{initialFilter:I="component",allowedKinds:B}=T,j=p(),M=(0,y.useApi)(c.catalogApiRef),{value:b}=(0,f.default)(async()=>await M.getEntityFacets({facets:["kind"]}).then(ge=>{var ze;return((ze=ge.facets.kind)==null?void 0:ze.map(_e=>_e.value).sort())||[]})),{updateFilters:L,queryParameters:{kind:D}}=(0,c.useEntityList)(),U=(0,r.useMemo)(()=>{var ge;return(ge=[D].flat()[0])==null?void 0:ge.toLocaleLowerCase("en-US")},[D]),[Y,te]=(0,r.useState)(U!=null?U:I);(0,r.useEffect)(()=>{L({kind:Y?new c.EntityKindFilter(Y):void 0})},[Y,L]),(0,r.useEffect)(()=>{U&&te(U)},[U]);const Re=[(0,u.Z)(Y)].concat((we=b==null?void 0:b.filter(ge=>B?B.some(ze=>ze.toLocaleLowerCase("en-US")===ge.toLocaleLowerCase("en-US")):!0))!=null?we:[]).sort().reduce((ge,ze)=>(ge[ze.toLocaleLowerCase("en-US")]=ze,ge),{});return r.createElement(A.Z,{input:r.createElement(m.Z,{value:Y}),value:Y,onChange:ge=>te(ge.target.value),classes:j},Object.keys(Re).map(ge=>r.createElement(o.Z,{value:ge,key:ge},`${Re[ge]}s`)))}},30097:function(ee,s,e){"use strict";e.d(s,{E:function(){return B}});var r=e(48023),t=e(53479),l=e(27604),u=e(2997),A=e(76635),m=e(2784),o=e(7089),c=e(82339);const f=Object.freeze({createNameColumn(j){function M(b){var L;return((L=b.metadata)==null?void 0:L.title)||(0,t.humanizeEntityRef)(b,{defaultKind:j==null?void 0:j.defaultKind})}return{title:"Name",field:"resolved.name",highlight:!0,customSort({entity:b},{entity:L}){return M(b).localeCompare(M(L))},render:({entity:b})=>{var L;return m.createElement(t.EntityRefLink,{entityRef:b,defaultKind:(j==null?void 0:j.defaultKind)||"Component",title:(L=b.metadata)==null?void 0:L.title})}}},createSystemColumn(){return{title:"System",field:"resolved.partOfSystemRelationTitle",render:({resolved:j})=>m.createElement(t.EntityRefLinks,{entityRefs:j.partOfSystemRelations,defaultKind:"system"})}},createOwnerColumn(){return{title:"Owner",field:"resolved.ownedByRelationsTitle",render:({resolved:j})=>m.createElement(t.EntityRefLinks,{entityRefs:j.ownedByRelations,defaultKind:"group"})}},createSpecTypeColumn(){return{title:"Type",field:"entity.spec.type",hidden:!0}},createSpecLifecycleColumn(){return{title:"Lifecycle",field:"entity.spec.lifecycle"}},createMetadataDescriptionColumn(){return{title:"Description",field:"entity.metadata.description",render:({entity:j})=>m.createElement(c.OverflowTooltip,{text:j.metadata.description,placement:"bottom-start"}),width:"auto"}},createTagsColumn(){return{title:"Tags",field:"entity.metadata.tags",cellStyle:{padding:"0px 16px 0px 20px"},render:({entity:j})=>m.createElement(m.Fragment,null,j.metadata.tags&&j.metadata.tags.map(M=>m.createElement(o.Z,{key:M,label:M,size:"small",variant:"outlined",style:{marginBottom:"0px"}})))}}});var y=e(28347),p=e(15459),E=e(11640),T=e(90436);const I=(0,p.Z)({root:{color:"#f3ba37"}})(E.Z),B=j=>{var yt,Pe,ht;const{columns:M,actions:b,tableOptions:L}=j,{isStarredEntity:D,toggleStarredEntity:U}=(0,t.useStarredEntities)(),{loading:Y,error:te,entities:ue,filters:Re}=(0,t.useEntityList)(),we=(0,m.useMemo)(()=>{var ie;return[f.createNameColumn({defaultKind:(ie=Re.kind)==null?void 0:ie.value}),...Ve(),f.createMetadataDescriptionColumn(),f.createTagsColumn()];function Ve(){var de;switch((de=Re.kind)==null?void 0:de.value){case"user":return[];case"domain":case"system":return[f.createOwnerColumn()];case"group":case"location":case"template":return[f.createSpecTypeColumn()];default:return[f.createSystemColumn(),f.createOwnerColumn(),f.createSpecTypeColumn(),f.createSpecLifecycleColumn()]}}},[(yt=Re.kind)==null?void 0:yt.value]),ge=Re.type===void 0,ze=(0,A.capitalize)((ht=(Pe=Re.user)==null?void 0:Pe.value)!=null?ht:"all");if(te)return m.createElement("div",null,m.createElement(c.WarningPanel,{severity:"error",title:"Could not fetch catalog entities."},m.createElement(c.CodeSnippet,{language:"text",text:te.toString()})));const _e=[({entity:Ve})=>{var Ue;const ie=(Ue=Ve.metadata.annotations)==null?void 0:Ue[r.l2],de="View";return{icon:()=>m.createElement(m.Fragment,null,m.createElement(T.Z,{variant:"srOnly"},de),m.createElement(u.Z,{fontSize:"small"})),tooltip:de,disabled:!ie,onClick:()=>{!ie||window.open(ie,"_blank")}}},({entity:Ve})=>{var Ue;const ie=(Ue=Ve.metadata.annotations)==null?void 0:Ue[r.Tf],de="Edit";return{icon:()=>m.createElement(m.Fragment,null,m.createElement(T.Z,{variant:"srOnly"},de),m.createElement(l.Z,{fontSize:"small"})),tooltip:de,disabled:!ie,onClick:()=>{!ie||window.open(ie,"_blank")}}},({entity:Ve})=>{const ie=D(Ve),de=ie?"Remove from favorites":"Add to favorites";return{cellStyle:{paddingLeft:"1em"},icon:()=>m.createElement(m.Fragment,null,m.createElement(T.Z,{variant:"srOnly"},de),ie?m.createElement(I,null):m.createElement(y.Z,null)),tooltip:de,onClick:()=>U(Ve)}}],et=ue.map(Ve=>{const ie=(0,t.getEntityRelations)(Ve,r.cz,{kind:"system"}),de=(0,t.getEntityRelations)(Ve,r.S4);return{entity:Ve,resolved:{name:(0,t.humanizeEntityRef)(Ve,{defaultKind:"Component"}),ownedByRelationsTitle:de.map(Ue=>(0,t.humanizeEntityRef)(Ue,{defaultKind:"group"})).join(", "),ownedByRelations:de,partOfSystemRelationTitle:ie.map(Ue=>(0,t.humanizeEntityRef)(Ue,{defaultKind:"system"})).join(", "),partOfSystemRelations:ie}}}),st=(M||we).find(Ve=>Ve.title==="Type");st&&(st.hidden=!ge);const Ct=et.length>20;return m.createElement(c.Table,{isLoading:Y,columns:M||we,options:{paging:Ct,pageSize:20,actionsColumnIndex:-1,loadingType:"linear",showEmptyDataSourceMessage:!Y,padding:"dense",pageSizeOptions:[20,50,100],...L},title:`${ze} (${ue.length})`,data:et,actions:b||_e})};B.columns=f},47851:function(ee,s,e){"use strict";e.d(s,{_Z:function(){return u},jU:function(){return l},yw:function(){return t}});var r=e(36964);const t=(0,r.createExternalRouteRef)({id:"create-component",optional:!0}),l=(0,r.createExternalRouteRef)({id:"view-techdoc",optional:!0,params:["namespace","kind","name"]}),u=(0,r.createRouteRef)({id:"catalog"})},40749:function(ee,s,e){"use strict";e.d(s,{rG:function(){return r},Y2:function(){return L},J$:function(){return f},g2:function(){return l}});var r;(function(D){const U="DENY";D.DENY=U;const Y="ALLOW";D.ALLOW=Y;const te="CONDITIONAL";D.CONDITIONAL=te})(r||(r={}));function t(D,U){return D.name===U.name}function l(D,U){return"resourceType"in D?!U||D.resourceType===U:!1}function u(D){return D.attributes.action==="create"}function A(D){return D.attributes.action==="read"}function m(D){return D.attributes.action==="update"}function o(D){return D.attributes.action==="delete"}function c(D){return{authorize:async(U,Y)=>await D.authorize(U,Y),authorizeConditional(U,Y){const te=U;return D.authorize(te,Y)}}}function f({name:D,attributes:U,resourceType:Y}){return Y?{type:"resource",name:D,attributes:U,resourceType:Y}:{type:"basic",name:D,attributes:U}}var y=e(10179),p=e(96279),E=e.n(p),T=e(9571),I=e(30195);const B=I.z.lazy(()=>I.z.object({rule:I.z.string(),resourceType:I.z.string(),params:I.z.array(I.z.unknown())}).or(I.z.object({anyOf:I.z.array(B).nonempty()})).or(I.z.object({allOf:I.z.array(B).nonempty()})).or(I.z.object({not:B}))),j=I.z.object({result:I.z.literal(r.ALLOW).or(I.z.literal(r.DENY))}),M=I.z.union([I.z.object({result:I.z.literal(r.ALLOW).or(I.z.literal(r.DENY))}),I.z.object({result:I.z.literal(r.CONDITIONAL),pluginId:I.z.string(),resourceType:I.z.string(),conditions:B})]),b=(D,U)=>I.z.object({items:I.z.array(I.z.intersection(I.z.object({id:I.z.string()}),D)).refine(Y=>Y.length===U.size&&Y.every(({id:te})=>U.has(te)),{message:"Items in response do not match request"})});class L{constructor(U){q(this,"enabled");q(this,"discovery");var Y;this.discovery=U.discovery,this.enabled=(Y=U.config.getOptionalBoolean("permission.enabled"))!=null?Y:!1}async authorize(U,Y){return this.makeRequest(U,j,Y)}async authorizeConditional(U,Y){return this.makeRequest(U,M,Y)}async makeRequest(U,Y,te){if(!this.enabled)return U.map(et=>({result:r.ALLOW}));const ue={items:U.map(et=>({id:T.Z(),...et}))},Re=await this.discovery.getBaseUrl("permission"),we=await E()(`${Re}/authorize`,{method:"POST",body:JSON.stringify(ue),headers:{...this.getAuthorizationHeader(te==null?void 0:te.token),"content-type":"application/json"}});if(!we.ok)throw await y.VL.fromResponse(we);const ge=await we.json(),_e=b(Y,new Set(ue.items.map(({id:et})=>et))).parse(ge).items.reduce((et,st)=>(et[st.id]=st,et),{});return ue.items.map(et=>_e[et.id])}getAuthorizationHeader(U){return U?{Authorization:`Bearer ${U}`}:{}}}},68099:function(ee,s,e){"use strict";e.d(s,{iM:function(){return A},RV:function(){return l},gI:function(){return o}});var r=e(2784),t=e(36964);const l=(0,t.createApiRef)({id:"plugin.permission.api"});var u=e(40749);class A{constructor(y,p){this.permissionClient=y,this.identityApi=p}static create(y){const{config:p,discovery:E,identity:T}=y,I=new u.Y2({discovery:E,config:p});return new A(I,T)}async authorize(y){return(await this.permissionClient.authorize([y],await this.identityApi.getCredentials()))[0]}}var m=e(49857);function o(f){const y=(0,t.useApi)(l),{data:p,error:E}=(0,m.ZP)(f,async T=>{if((0,u.g2)(T.permission)&&!T.resourceRef)return u.rG.DENY;const{result:I}=await y.authorize(T);return I});return E?{error:E,loading:!1,allowed:!1}:p===void 0?{loading:!0,allowed:!1}:{loading:!1,allowed:p===u.rG.ALLOW}}const c=f=>{const{permission:y,resourceRef:p,errorComponent:E,...T}=f,I=usePermission(isResourcePermission(y)?{permission:y,resourceRef:p}:{permission:y}),B=useApp(),{NotFoundErrorPage:j}=B.getComponents();let M=E===void 0?React.createElement(j,null):E;return I.loading?M=null:I.allowed&&(M=f.element),React.createElement(Route,{...T,element:M})}},74450:function(ee,s,e){"use strict";e.d(s,{FA:function(){return o},Nd:function(){return Y},Rx:function(){return L}});var r=e(36964);const t=(0,r.createApiRef)({id:"plugin.search.queryservice"});class l{constructor(fe){this.mockedResults=fe}query(){return Promise.resolve(this.mockedResults||{results:[]})}}var u=e(2784),A=e(79692);const m=(0,A.Z)(()=>({highlight:{}}),{name:"BackstageHighlightedSearchResultText"}),o=({text:oe,preTag:fe,postTag:tt})=>{const Ke=m(),Ne=(0,u.useMemo)(()=>oe.split(new RegExp(`(${fe}.+?${tt})`)),[tt,fe,oe]);return u.createElement(u.Fragment,null,Ne.map((ct,X)=>ct.includes(fe)?u.createElement("mark",{className:Ke.highlight,key:X},ct.replace(new RegExp(`${fe}|${tt}`,"g"),"")):ct))};var c=e(42494),f=e(84899),y=e(5806),p=e(21324),E=e(56939),T=e(73698),I=e(12231),B=e(76241),j=e(64279),M=e(1849);const b=(0,B.CT)("search-context"),L=()=>{const oe=(0,u.useContext)(b);if(!oe)throw new Error("useSearch must be used within a SearchContextProvider");const fe=oe.atVersion(1);if(!fe)throw new Error("No SearchContext v1 found");return fe},D=()=>useContext(b)!==void 0,U={term:"",pageCursor:void 0,filters:{},types:[]},Y=oe=>{var Lt,Rt,Nt,Zt;const{initialState:fe=U,children:tt}=oe,Ke=(0,r.useApi)(t),[Ne,ct]=(0,u.useState)(fe.pageCursor),[X,Z]=(0,u.useState)(fe.filters),[Q,se]=(0,u.useState)(fe.term),[le,be]=(0,u.useState)(fe.types),Oe=(0,M.Z)(Q),Ae=(0,j.default)(()=>Ke.query({term:Q,filters:X,pageCursor:Ne,types:le}),[Q,X,le,Ne]),ke=!Ae.loading&&!Ae.error&&((Lt=Ae.value)==null?void 0:Lt.nextPageCursor),We=!Ae.loading&&!Ae.error&&((Rt=Ae.value)==null?void 0:Rt.previousPageCursor),gt=(0,u.useCallback)(()=>{var vt;ct((vt=Ae.value)==null?void 0:vt.nextPageCursor)},[(Nt=Ae.value)==null?void 0:Nt.nextPageCursor]),It=(0,u.useCallback)(()=>{var vt;ct((vt=Ae.value)==null?void 0:vt.previousPageCursor)},[(Zt=Ae.value)==null?void 0:Zt.previousPageCursor]);(0,u.useEffect)(()=>{Q&&Oe&&Q!==Oe&&ct(void 0)},[Q,Oe,fe.pageCursor]);const lt={result:Ae,filters:X,setFilters:Z,term:Q,setTerm:se,types:le,setTypes:be,pageCursor:Ne,setPageCursor:ct,fetchNextPage:ke?gt:void 0,fetchPreviousPage:We?It:void 0},Tt=(0,B.EI)({1:lt});return u.createElement(r.AnalyticsContext,{attributes:{searchTypes:le.sort().join(",")}},u.createElement(b.Provider,{value:Tt,children:tt}))};var te=e(86619),ue=e(7089),Re=e(88013),we=e(69294),ge=e(48760);const ze=(oe,fe,tt=[],Ke=250)=>{const Ne=(0,u.useRef)({}),ct=oe||(()=>Promise.resolve([])),[X,Z]=(0,we.default)(ct,[fe],{loading:!0});if((0,ge.Z)(()=>{Ne.current[fe]===void 0&&(Ne.current[fe]=Z(fe).then(se=>(Ne.current[fe]=se,se)))},Ke,[Z,fe]),tt.length)return{loading:!1,value:tt};const Q=Ne.current[fe];return Array.isArray(Q)?{loading:!1,value:Q}:X},_e=(oe,fe)=>{const{setFilters:tt}=L();(0,u.useEffect)(()=>{fe&&[fe].flat().length>0&&tt(Ke=>({...Ke,[oe]:fe}))},[])},et=oe=>{const{className:fe,defaultValue:tt,name:Ke,values:Ne,valuesDebounceMs:ct,label:X,filterSelectedOptions:Z,limitTags:Q,multiple:se}=oe,[le,be]=(0,u.useState)("");_e(Ke,tt);const Oe=typeof Ne=="function"?Ne:void 0,Ae=typeof Ne=="function"?void 0:Ne,{value:ke,loading:We}=ze(Oe,le,Ae,ct),{filters:gt,setFilters:It}=L(),lt=gt[Ke]||(se?[]:null),Tt=(Nt,Zt)=>{It(vt=>{const{[Ke]:at,...zt}=vt;return Zt?{...zt,[Ke]:Zt}:{...zt}})},Lt=Nt=>u.createElement(te.Z,{...Nt,name:"search",variant:"outlined",label:X,fullWidth:!0}),Rt=(Nt,Zt)=>Nt.map((vt,at)=>u.createElement(ue.Z,{label:vt,color:"primary",...Zt({index:at})}));return u.createElement(Re.ZP,{filterSelectedOptions:Z,limitTags:Q,multiple:se,className:fe,id:`${se?"multi-":""}select-filter-${Ke}--select`,options:ke||[],loading:We,value:lt,onChange:Tt,onInputChange:(Nt,Zt)=>be(Zt),renderInput:Lt,renderTags:Rt})},st=(0,A.Z)({label:{textTransform:"capitalize"}}),Ct=oe=>{const{className:fe,defaultValue:tt,label:Ke,name:Ne,values:ct=[],valuesDebounceMs:X}=oe,Z=st(),{filters:Q,setFilters:se}=L();_e(Ne,tt);const le=typeof ct=="function"?ct:void 0,be=typeof ct=="function"?void 0:ct,{value:Oe=[],loading:Ae}=ze(le,"",be,X),ke=We=>{const{target:{value:gt,checked:It}}=We;se(lt=>{const{[Ne]:Tt,...Lt}=lt,Rt=(Tt||[]).filter(Zt=>Zt!==gt),Nt=It?[...Rt,gt]:Rt;return Nt.length?{...Lt,[Ne]:Nt}:Lt})};return u.createElement(c.Z,{className:fe,disabled:Ae,fullWidth:!0,"data-testid":"search-checkboxfilter-next"},Ke?u.createElement(f.Z,{className:Z.label},Ke):null,Oe.map(We=>{var gt;return u.createElement(y.Z,{key:We,control:u.createElement(p.Z,{color:"primary",tabIndex:-1,inputProps:{"aria-labelledby":We},value:We,name:We,onChange:ke,checked:((gt=Q[Ne])!=null?gt:[]).includes(We)}),label:We})}))},yt=oe=>{const{className:fe,defaultValue:tt,label:Ke,name:Ne,values:ct,valuesDebounceMs:X}=oe,Z=st();_e(Ne,tt);const Q=typeof ct=="function"?ct:void 0,se=typeof ct=="function"?void 0:ct,{value:le=[],loading:be}=ze(Q,"",se,X),{filters:Oe,setFilters:Ae}=L(),ke=We=>{const{target:{value:gt}}=We;Ae(It=>{const{[Ne]:lt,...Tt}=It;return gt?{...Tt,[Ne]:gt}:Tt})};return u.createElement(c.Z,{disabled:be,className:fe,variant:"filled",fullWidth:!0,"data-testid":"search-selectfilter-next"},Ke?u.createElement(E.Z,{className:Z.label,margin:"dense"},Ke):null,u.createElement(T.Z,{variant:"outlined",value:Oe[Ne]||"",onChange:ke},u.createElement(I.Z,{value:""},u.createElement("em",null,"All")),le.map(We=>u.createElement(I.Z,{key:We,value:We},We))))},Pe=({component:oe,...fe})=>u.createElement(oe,{...fe});Pe.Checkbox=oe=>u.createElement(Pe,{...oe,component:Ct}),Pe.Select=oe=>u.createElement(Pe,{...oe,component:yt}),Pe.Autocomplete=oe=>u.createElement(Pe,{...oe,component:et});var ht=e(82339);const Ve=({children:oe})=>{const{result:{loading:fe,error:tt,value:Ke}}=useSearch();return fe?React.createElement(Progress,null):tt?React.createElement(ResponseErrorPanel,{title:"Error encountered while fetching search results",error:tt}):Ke!=null&&Ke.results.length?React.createElement(React.Fragment,null,oe({results:Ke.results})):React.createElement(EmptyState,{missing:"data",title:"Sorry, no results were found"})},ie=oe=>React.createElement(AnalyticsContext,{attributes:{pluginId:"search",extension:"SearchResult"}},React.createElement(Ve,{...oe})),de=(0,A.Z)(oe=>({root:{display:"flex",justifyContent:"space-between",gap:oe.spacing(2),margin:oe.spacing(2,0)}})),Ue=()=>{const{fetchNextPage:oe,fetchPreviousPage:fe}=useSearch(),tt=de();return!oe&&!fe?React.createElement(React.Fragment,null):React.createElement("nav",{"arial-label":"pagination navigation",className:tt.root},React.createElement(Button,{"aria-label":"previous page",disabled:!fe,onClick:fe,startIcon:React.createElement(ArrowBackIosIcon,null)},"Previous"),React.createElement(Button,{"aria-label":"next page",disabled:!oe,onClick:oe,endIcon:React.createElement(ArrowForwardIosIcon,null)},"Next"))},Be=({children:oe})=>{const fe=useAnalytics(),{term:tt}=useSearch();return useEffect(()=>{tt&&fe.captureEvent("search",tt)},[fe,tt]),React.createElement(React.Fragment,null,oe)},Xe=({onChange:oe,onKeyDown:fe,onSubmit:tt,debounceTime:Ke=200,clearButton:Ne=!0,fullWidth:ct=!0,value:X,inputProps:Z={},endAdornment:Q,...se})=>{const le=useApi(configApiRef),[be,Oe]=useState(X),Ae=useSearchContextCheck();useEffect(()=>{Oe(Rt=>Rt!==X?X:Rt)},[X]),useDebounce(()=>oe(be),Ke,[be]);const ke=useCallback(Rt=>{Oe(Rt.target.value)},[Oe]),We=useCallback(Rt=>{fe&&fe(Rt),tt&&Rt.key==="Enter"&&tt()},[fe,tt]),gt=useCallback(()=>{oe("")},[oe]),It=`Search in ${le.getOptionalString("app.title")||"Backstage"}`,lt=React.createElement(InputAdornment,{position:"start"},React.createElement(IconButton,{"aria-label":"Query",disabled:!0},React.createElement(SearchIcon,null))),Tt=React.createElement(InputAdornment,{position:"end"},React.createElement(IconButton,{"aria-label":"Clear",onClick:gt},React.createElement(ClearButton,null))),Lt=React.createElement(TrackSearch,null,React.createElement(InputBase,{"data-testid":"search-bar-next",value:be,placeholder:It,startAdornment:lt,endAdornment:Ne?Tt:Q,inputProps:{"aria-label":"Search",...Z},fullWidth:ct,onChange:ke,onKeyDown:We,...se}));return Ae?Lt:React.createElement(SearchContextProvider,null,Lt)},mt=({onChange:oe,...fe})=>{const{term:tt,setTerm:Ke}=useSearch(),Ne=useCallback(ct=>{oe?oe(ct):Ke(ct)},[oe,Ke]);return React.createElement(AnalyticsContext,{attributes:{pluginId:"search",extension:"SearchBar"}},React.createElement(Xe,{value:tt,onChange:Ne,...fe}))},Ye=({result:oe,highlight:fe,rank:tt,icon:Ke,secondaryAction:Ne,lineClamp:ct=5})=>{const X=useAnalytics(),Z=()=>{X.captureEvent("discover",oe.title,{attributes:{to:oe.location},value:tt})};return React.createElement(Link,{noTrack:!0,to:oe.location,onClick:Z},React.createElement(ListItem,{alignItems:"center"},Ke&&React.createElement(ListItemIcon,null,Ke),React.createElement(ListItemText,{primaryTypographyProps:{variant:"h6"},primary:fe!=null&&fe.fields.title?React.createElement(HighlightedSearchResultText,{text:fe.fields.title,preTag:fe.preTag,postTag:fe.postTag}):oe.title,secondary:React.createElement("span",{style:{display:"-webkit-box",WebkitBoxOrient:"vertical",WebkitLineClamp:ct,overflow:"hidden"}},fe!=null&&fe.fields.text?React.createElement(HighlightedSearchResultText,{text:fe.fields.text,preTag:fe.preTag,postTag:fe.postTag}):oe.text)}),Ne&&React.createElement(Box,{alignItems:"flex-end"},Ne)),React.createElement(Divider,null))},Et=oe=>React.createElement(AnalyticsContext,{attributes:{pluginId:"search",extension:"DefaultResultListItem"}},React.createElement(Ye,{...oe}))},26136:function(ee,s,e){"use strict";e.d(s,{Ox:function(){return ze},Zz:function(){return A},oZ:function(){return te},DR:function(){return m},ZS:function(){return U},VA:function(){return st},KY:function(){return c},gT:function(){return T},Dl:function(){return I},ux:function(){return et},$L:function(){return E},x1:function(){return Y}});var r=e(2784),t=e(10289),l=e(36964);const u="techdocs.addons.addon.v1",A="techdocs.addons.wrapper.v1",m=()=>null;(0,l.attachComponentData)(m,A,!0);const o=ie=>`${u}.${ie.toLocaleLowerCase("en-US")}`;function c(ie){const{name:de,component:Ue}=ie;return(0,l.createReactExtension)({name:de,component:{sync:Be=>r.createElement(Ue,{...Be})},data:{[u]:ie,[o(de)]:!0}})}const f=(ie,de)=>ie.selectByComponentData({key:de}).getElements()[0],y=ie=>ie.selectByComponentData({key:A}).selectByComponentData({key:u}),p=ie=>ie.selectByComponentData({key:A}).findComponentData({key:u}),E=()=>{const ie=(0,t.pC)(),de=(0,l.useElementFilter)(ie,y),Ue=(0,l.useElementFilter)(ie,p),Be=(0,r.useCallback)(Ye=>{var oe;if(!de||!Ye)return null;const Et=o(Ye.name);return(oe=f(de,Et))!=null?oe:null},[de]),Xe=(0,r.useCallback)(Ye=>{const Et=Ue.find(oe=>oe.name===Ye);return Et?Be(Et):null},[Ue,Be]),mt=(0,r.useCallback)(Ye=>{const Et=Ue.filter(oe=>oe.location===Ye);return Et.length?Et.map(Be):null},[Ue,Be]);return{renderComponentByName:Xe,renderComponentsByLocation:mt}},T=(0,l.createApiRef)({id:"plugin.techdocs.service"}),I=(0,l.createApiRef)({id:"plugin.techdocs.storageservice"});var B=e(64279),j=e(48023),M=e(76241);const b=(ie,de)=>(0,j.eE)(ie)===(0,j.eE)(de),L={title:"",subtitle:"",setTitle:()=>{},setSubtitle:()=>{},setShadowRoot:()=>{},metadata:{loading:!0},entityMetadata:{loading:!0},entityRef:{kind:"",name:"",namespace:""}},D=(0,M.CT)("techdocs-reader-page-context"),U=(0,r.memo)(({entityRef:ie,children:de})=>{const Ue=(0,l.useApi)(T),Be=(0,B.default)(async()=>Ue.getTechDocsMetadata(ie),[ie]),Xe=(0,B.default)(async()=>Ue.getEntityMetadata(ie),[ie]),[mt,Ye]=(0,r.useState)(L.title),[Et,oe]=(0,r.useState)(L.subtitle),[fe,tt]=(0,r.useState)(L.shadowRoot),Ke={metadata:Be,entityRef:ie,entityMetadata:Xe,shadowRoot:fe,setShadowRoot:tt,title:mt,setTitle:Ye,subtitle:Et,setSubtitle:oe},Ne=(0,M.EI)({1:Ke});return r.createElement(D.Provider,{value:Ne},de instanceof Function?de(Ke):de)},(ie,de)=>b(ie.entityRef,de.entityRef)),Y=()=>{const ie=(0,r.useContext)(D);if(ie===void 0)return L;const de=ie.atVersion(1);if(de===void 0)throw new Error("No context found for version 1.");return de},te=Object.freeze({Header:"Header",Subheader:"Subheader",Settings:"Settings",PrimarySidebar:"PrimarySidebar",SecondarySidebar:"SecondarySidebar",Content:"Content"});var ue=e(6553),Re=e(50236),we=e(19219),ge=e(82339);const ze="TECH_DOCS_SHADOW_DOM_STYLE_LOAD",_e=ie=>{(0,r.useEffect)(()=>{var mt;if(!ie)return()=>{};const de=ie.querySelectorAll('head > link[rel="stylesheet"]');let Ue=(mt=de==null?void 0:de.length)!=null?mt:0;const Be=new CustomEvent(ze);if(!Ue)return ie.dispatchEvent(Be),()=>{};const Xe=()=>{--Ue===0&&ie.dispatchEvent(Be)};return de==null||de.forEach(Ye=>{Ye.addEventListener("load",Xe)}),()=>{de==null||de.forEach(Ye=>{Ye.removeEventListener("load",Xe)})}},[ie])},et=ie=>{const[de,Ue]=(0,r.useState)(!1);return(0,r.useEffect)(()=>{if(!ie)return()=>{};Ue(!0);const Be=ie.style;Be.setProperty("opacity","0");const Xe=()=>{Ue(!1),Be.setProperty("opacity","1")};return ie.addEventListener(ze,Xe),()=>{ie.removeEventListener(ze,Xe)}},[ie]),de},st=({element:ie,onAppend:de,children:Ue})=>{const[Be,Xe]=(0,r.useState)((0,ue.Ue)({...(0,Re.Z)(),insertionPoint:void 0}));_e(ie);const mt=et(ie),Ye=(0,r.useCallback)(Et=>{if(!ie||!Et)return;Xe((0,ue.Ue)({...(0,Re.Z)(),insertionPoint:ie.querySelector("head")||void 0}));let oe=Et.shadowRoot;oe||(oe=Et.attachShadow({mode:"open"})),oe.replaceChildren(ie),typeof de=="function"&&de(oe)},[ie,de]);return r.createElement(r.Fragment,null,mt&&r.createElement(ge.Progress,null),r.createElement(we.ZP,{jss:Be,sheetsManager:new Map},r.createElement("div",{ref:Ye,"data-testid":"techdocs-native-shadowroot"}),Ue))};var Ct=e(54073);const yt=()=>{const{shadowRoot:ie}=useTechDocsReaderPage();return ie},Pe=ie=>{const de=yt();return de?ie.map(Ue=>de==null?void 0:de.querySelectorAll(Ue)).filter(Ue=>Ue.length).map(Ue=>Array.from(Ue)).flat():[]},ht=ie=>ie.toString()&&ie.rangeCount&&ie.getRangeAt(0).getBoundingClientRect().top,Ve=(ie=0)=>{const de=yt(),[Ue,Be]=useState(null),Xe=useMemo(()=>debounce(()=>{const mt=de,Ye=mt.getSelection?mt.getSelection():document.getSelection();Ye&&ht(Ye)?Be(Ye):Be(null)},ie),[de,Be,ie]);return useEffect(()=>(window.document.addEventListener("selectionchange",Xe),()=>window.document.removeEventListener("selectionchange",Xe)),[Xe]),Ue}},94067:function(ee,s,e){"use strict";e.r(s),e.d(s,{EmbeddedDocsRouter:function(){return B},Router:function(){return I},isTechDocsAvailable:function(){return T}});var r=e(2784),t=e(10289),l=e(53479),u=e(82339),A=e(48023),m=e(20961),o=e(16172),c=e(63126);const f=({entity:j})=>{const M=(0,A.iB)(j);return r.createElement(m.I6,{entityRef:M},r.createElement(o.b,null),r.createElement(c.F,{withSearch:!1}))};var y=e(50021),p=e(26220);const E="backstage.io/techdocs-ref",T=j=>{var M,b;return Boolean((b=(M=j==null?void 0:j.metadata)==null?void 0:M.annotations)==null?void 0:b[E])},I=()=>r.createElement(t.Z5,null,r.createElement(t.AW,{path:"/",element:r.createElement(y.TechDocsIndexPage,null)}),r.createElement(t.AW,{path:"/:namespace/:kind/:name/*",element:r.createElement(p.TechDocsReaderPage,null)})),B=j=>{var U;const{children:M}=j,{entity:b}=(0,l.useEntity)(),L=(0,t.V$)([{path:"/*",element:r.createElement(f,{entity:b}),children:[{path:"/*",element:M}]}]);return((U=b.metadata.annotations)==null?void 0:U[E])?L:r.createElement(u.MissingAnnotationEmptyState,{annotation:E})}},3337:function(ee,s,e){"use strict";var r=e(36964);const t=(0,r.createApiRef)({id:"plugin.techdocs.storageservice"}),l=(0,r.createApiRef)({id:"plugin.techdocs.service"})},42723:function(ee,s,e){"use strict";e.d(s,{k:function(){return A},p:function(){return u}});var r=e(10179),t=e(76372),l=e.n(t);class u{constructor(o){q(this,"configApi");q(this,"discoveryApi");q(this,"fetchApi");this.configApi=o.configApi,this.discoveryApi=o.discoveryApi,this.fetchApi=o.fetchApi}async getApiOrigin(){return await this.discoveryApi.getBaseUrl("techdocs")}async getTechDocsMetadata(o){const{kind:c,namespace:f,name:y}=o,E=`${await this.getApiOrigin()}/metadata/techdocs/${f}/${c}/${y}`,T=await this.fetchApi.fetch(`${E}`);if(!T.ok)throw await r.VL.fromResponse(T);return await T.json()}async getEntityMetadata(o){const{kind:c,namespace:f,name:y}=o,E=`${await this.getApiOrigin()}/metadata/entity/${f}/${c}/${y}`,T=await this.fetchApi.fetch(`${E}`);if(!T.ok)throw await r.VL.fromResponse(T);return await T.json()}}class A{constructor(o){q(this,"configApi");q(this,"discoveryApi");q(this,"identityApi");q(this,"fetchApi");this.configApi=o.configApi,this.discoveryApi=o.discoveryApi,this.identityApi=o.identityApi,this.fetchApi=o.fetchApi}async getApiOrigin(){return await this.discoveryApi.getBaseUrl("techdocs")}async getStorageUrl(){var o;return(o=this.configApi.getOptionalString("techdocs.storageUrl"))!=null?o:`${await this.discoveryApi.getBaseUrl("techdocs")}/static/docs`}async getBuilder(){return this.configApi.getString("techdocs.builder")}async getEntityDocs(o,c){const{kind:f,namespace:y,name:p}=o,T=`${await this.getStorageUrl()}/${y}/${f}/${p}/${c}`,I=await this.fetchApi.fetch(`${T.endsWith("/")?T:`${T}/`}index.html`);let B="";switch(I.status){case 404:throw B="Page not found. ",c||(B+="This could be because there is no index.md file in the root of the docs directory of this repository."),new r.dR(B);case 500:throw B="Could not generate documentation or an error in the TechDocs backend. ",new Error(B);default:break}return I.text()}async syncEntityDocs(o,c=()=>{}){const{kind:f,namespace:y,name:p}=o,T=`${await this.getApiOrigin()}/sync/${y}/${f}/${p}`,{token:I}=await this.identityApi.getCredentials();return new Promise((B,j)=>{const M=new t.EventSourcePolyfill(T,{withCredentials:!0,headers:I?{Authorization:`Bearer ${I}`}:{}});M.addEventListener("log",b=>{b.data&&c(JSON.parse(b.data))}),M.addEventListener("finish",b=>{let L=!1;b.data&&({updated:L}=JSON.parse(b.data)),B(L?"updated":"cached")}),M.onerror=b=>{switch(M.close(),b.status){case 404:j(new r.dR(b.message));return;default:j(new Error(b.data));return}}})}async getBaseUrl(o,c,f){const{kind:y,namespace:p,name:E}=c,I=`${await this.getApiOrigin()}/static/docs/${p}/${y}/${E}/${f}`;return new URL(o,I.endsWith("/")?I:`${I}/`).toString()}}},97589:function(ee,s,e){"use strict";e.d(s,{D:function(){return r}});function r(t,l){return l.getOptionalBoolean("techdocs.legacyUseCaseSensitiveTripletPaths")?t:t.toLocaleLowerCase("en-US")}},2546:function(ee,s,e){"use strict";e.d(s,{u:function(){return o}});var r=e(2784),t=e(82339),l=e(53479),u=e(1114),A=e(70335),m=e(21956);const o=c=>{const{initialFilter:f="all",columns:y,actions:p}=c;return r.createElement(u.j,null,r.createElement(t.Content,null,r.createElement(t.ContentHeader,{title:""},r.createElement(t.SupportButton,null,"Discover documentation in your ecosystem.")),r.createElement(l.EntityListProvider,null,r.createElement(l.CatalogFilterLayout,null,r.createElement(l.CatalogFilterLayout.Filters,null,r.createElement(A.f,null),r.createElement(l.UserListPicker,{initialFilter:f}),r.createElement(l.EntityOwnerPicker,null),r.createElement(l.EntityTagPicker,null)),r.createElement(l.CatalogFilterLayout.Content,null,r.createElement(m.EntityListDocsTable,{actions:p,columns:y}))))))}},51016:function(ee,s,e){"use strict";e.d(s,{f:function(){return y}});var r=e(68725),t=e(97589),l=e(36964),u=e(82339),A=e(94339),m=e(16111),o=e(24579),c=e(14503),f=e(2784);const y=T=>{const{entities:I}=T,B=(0,l.useRouteRef)(r.Fw),j=(0,l.useApi)(l.configApiRef);return I?f.createElement(u.ItemCardGrid,{"data-testid":"docs-explore"},I!=null&&I.length?I.map((M,b)=>{var L,D;return f.createElement(A.Z,{key:b},f.createElement(m.Z,null,f.createElement(u.ItemCardHeader,{title:(L=M.metadata.title)!=null?L:M.metadata.name})),f.createElement(o.Z,null,M.metadata.description),f.createElement(c.Z,null,f.createElement(u.Button,{to:B({namespace:(0,t.D)((D=M.metadata.namespace)!=null?D:"default",j),kind:(0,t.D)(M.kind,j),name:(0,t.D)(M.metadata.name,j)}),color:"primary","data-testid":"read_docs"},"Read Docs")))}):null):null};var p=e(53479);const E=()=>{const{loading:T,error:I,entities:B}=useEntityList();return I?React.createElement(WarningPanel,{severity:"error",title:"Could not load available documentation."},React.createElement(CodeSnippet,{language:"text",text:I.toString()})):T||!B?React.createElement(Progress,null):(B.sort((j,M)=>{var b,L;return((b=j.metadata.title)!=null?b:j.metadata.name).localeCompare((L=M.metadata.title)!=null?L:M.metadata.name)}),React.createElement(DocsCardGrid,{entities:B}))}},38634:function(ee,s,e){"use strict";e.d(s,{H:function(){return p}});var r=e(2784),t=e(95074),l=e(36964),u=e(48023),A=e(53479),m=e(68725),o=e(82339),c=e(98095),f=e(3792),y=e(97589);const p=E=>{const{entities:T,title:I,loading:B,columns:j,actions:M}=E,[,b]=(0,t.Z)(),L=(0,l.useRouteRef)(m.Fw),D=(0,l.useApi)(l.configApiRef);if(!T)return null;const U=T.map(ue=>{var we;const Re=(0,A.getEntityRelations)(ue,u.S4);return{entity:ue,resolved:{docsUrl:L({namespace:(0,y.D)((we=ue.metadata.namespace)!=null?we:"default",D),kind:(0,y.D)(ue.kind,D),name:(0,y.D)(ue.metadata.name,D)}),ownedByRelations:Re,ownedByRelationsTitle:Re.map(ge=>(0,A.humanizeEntityRef)(ge,{defaultKind:"group"})).join(", ")}}}),Y=[f.N.createNameColumn(),f.N.createOwnerColumn(),f.N.createTypeColumn()],te=[c.n.createCopyDocsUrlAction(b)];return r.createElement(r.Fragment,null,B||U&&U.length>0?r.createElement(o.Table,{isLoading:B,options:{paging:!0,pageSize:20,search:!0,actionsColumnIndex:-1},data:U,columns:j||Y,actions:M||te,title:I?`${I} (${U.length})`:`All (${U.length})`}):r.createElement(o.EmptyState,{missing:"data",title:"No documents to show",description:"Create your own document. Check out our Getting Started Information",action:r.createElement(o.Button,{color:"primary",to:"https://backstage.io/docs/features/techdocs/getting-started",variant:"contained"},"DOCS")}))};p.columns=f.N,p.actions=c.n},12481:function(ee,s,e){"use strict";e.d(s,{n:function(){return y}});var r=e(2784),t=e(95074),l=e(76635),u=e.n(l),A=e(82339),m=e(53479),o=e(38634),c=e(98095),f=e(3792);const y=p=>{var te,ue;const{columns:E,actions:T}=p,{loading:I,error:B,entities:j,filters:M}=(0,m.useEntityList)(),{isStarredEntity:b,toggleStarredEntity:L}=(0,m.useStarredEntities)(),[,D]=(0,t.Z)(),U=(0,l.capitalize)((ue=(te=M.user)==null?void 0:te.value)!=null?ue:"all"),Y=[c.n.createCopyDocsUrlAction(D),c.n.createStarEntityAction(b,L)];return B?r.createElement(A.WarningPanel,{severity:"error",title:"Could not load available documentation."},r.createElement(A.CodeSnippet,{language:"text",text:B.toString()})):r.createElement(o.H,{title:U,entities:j,loading:I,actions:T||Y,columns:E})};y.columns=f.N,y.actions=c.n},98095:function(ee,s,e){"use strict";e.d(s,{n:function(){return o}});var r=e(2784),t=e(39981),l=e(2337),u=e(11640),A=e(28347);const m=(0,l.Z)({root:{color:"#f3ba37"}})(u.Z),o={createCopyDocsUrlAction(c){return f=>({icon:()=>r.createElement(t.Z,{fontSize:"small"}),tooltip:"Click to copy documentation link to clipboard",onClick:()=>c(`${window.location.origin}${f.resolved.docsUrl}`)})},createStarEntityAction(c,f){return({entity:y})=>{const p=c(y);return{cellStyle:{paddingLeft:"1em"},icon:()=>p?r.createElement(m,null):r.createElement(A.Z,null),tooltip:p?"Remove from favorites":"Add to favorites",onClick:()=>f(y)}}}}},3792:function(ee,s,e){"use strict";e.d(s,{N:function(){return A}});var r=e(2784),t=e(82339),l=e(53479);function u(m){return m.metadata.title||m.metadata.name}const A={createNameColumn(){return{title:"Document",field:"entity.metadata.name",highlight:!0,render:m=>r.createElement(t.SubvalueCell,{value:r.createElement(t.Link,{to:m.resolved.docsUrl},u(m.entity)),subvalue:m.entity.metadata.description})}},createOwnerColumn(){return{title:"Owner",field:"resolved.ownedByRelationsTitle",render:({resolved:m})=>r.createElement(l.EntityRefLinks,{entityRefs:m.ownedByRelations,defaultKind:"group"})}},createTypeColumn(){return{title:"Type",field:"entity.spec.type"}}}},21956:function(ee,s,e){"use strict";e.d(s,{DocsTable:function(){return t.H},EntityListDocsTable:function(){return r.n}});var r=e(12481),t=e(38634),l=e(72580),u=e.n(l);e.o(l,"DefaultTechDocsHome")&&e.d(s,{DefaultTechDocsHome:function(){return l.DefaultTechDocsHome}})},72580:function(){},50021:function(ee,s,e){"use strict";e.r(s),e.d(s,{TechDocsIndexPage:function(){return u}});var r=e(2784),t=e(10289),l=e(2546);const u=()=>(0,t.pC)()||r.createElement(l.u,null)},1114:function(ee,s,e){"use strict";e.d(s,{j:function(){return u}});var r=e(2784),t=e(82339),l=e(36964);const u=A=>{var f;const{children:m}=A,c=`Documentation available in ${(f=(0,l.useApi)(l.configApiRef).getOptionalString("organization.name"))!=null?f:"Backstage"}`;return r.createElement(t.PageWithHeader,{title:"Documentation",subtitle:c,themeId:"documentation"},m)}},70335:function(ee,s,e){"use strict";e.d(s,{f:function(){return u}});var r=e(2784),t=e(53479);class l{getCatalogFilters(){return{"metadata.annotations.backstage.io/techdocs-ref":t.CATALOG_FILTER_EXISTS}}}const u=()=>{const{updateFilters:A}=(0,t.useEntityList)();return(0,r.useEffect)(()=>{A({techdocs:new l})},[A]),null}},19192:function(ee,s,e){"use strict";e.d(s,{DefaultTechDocsHome:function(){return l.u}});var r=e(51016),t=e(21956),l=e(2546),u=e(1114),A=e(70335)},82250:function(ee,s,e){"use strict";e.d(s,{DefaultTechDocsHome:function(){return o.DefaultTechDocsHome},TechDocsIndexPage:function(){return c.Jl},TechDocsReaderPage:function(){return c.I6},TechDocsReaderPageContent:function(){return A.Fq},TechDocsReaderPageHeader:function(){return A.SE},plugin:function(){return c.s4},techdocsPlugin:function(){return c.s4}});var r=e(98157),t=e.n(r);e.o(r,"DefaultTechDocsHome")&&e.d(s,{DefaultTechDocsHome:function(){return r.DefaultTechDocsHome}}),e.o(r,"TechDocsReaderPageContent")&&e.d(s,{TechDocsReaderPageContent:function(){return r.TechDocsReaderPageContent}}),e.o(r,"TechDocsReaderPageHeader")&&e.d(s,{TechDocsReaderPageHeader:function(){return r.TechDocsReaderPageHeader}});var l=e(3337),u=e(42723),A=e(96393),m=e(47861),o=e(19192),c=e(20961),f=e(94067)},20961:function(ee,s,e){"use strict";e.d(s,{I6:function(){return y},Jl:function(){return f},s4:function(){return A}});var r=e(26136),t=e(42723),l=e(68725),u=e(36964);const A=(0,u.createPlugin)({id:"techdocs",apis:[(0,u.createApiFactory)({api:r.Dl,deps:{configApi:u.configApiRef,discoveryApi:u.discoveryApiRef,identityApi:u.identityApiRef,fetchApi:u.fetchApiRef},factory:({configApi:p,discoveryApi:E,identityApi:T,fetchApi:I})=>new t.k({configApi:p,discoveryApi:E,identityApi:T,fetchApi:I})}),(0,u.createApiFactory)({api:r.gT,deps:{configApi:u.configApiRef,discoveryApi:u.discoveryApiRef,fetchApi:u.fetchApiRef},factory:({configApi:p,discoveryApi:E,fetchApi:T})=>new t.p({configApi:p,discoveryApi:E,fetchApi:T})})],routes:{root:l._Z,docRoot:l.Fw,entityContent:l.pd}}),m=A.provide((0,u.createRoutableExtension)({name:"TechdocsPage",component:()=>Promise.resolve().then(e.bind(e,94067)).then(p=>p.Router),mountPoint:l._Z})),o=A.provide((0,u.createRoutableExtension)({name:"EntityTechdocsContent",component:()=>Promise.resolve().then(e.bind(e,94067)).then(p=>p.EmbeddedDocsRouter),mountPoint:l.pd})),c=A.provide((0,u.createRoutableExtension)({name:"TechDocsCustomHome",component:()=>e.e(7110).then(e.bind(e,57110)).then(p=>p.TechDocsCustomHome),mountPoint:l._Z})),f=A.provide((0,u.createRoutableExtension)({name:"TechDocsIndexPage",component:()=>Promise.resolve().then(e.bind(e,50021)).then(p=>p.TechDocsIndexPage),mountPoint:l._Z})),y=A.provide((0,u.createRoutableExtension)({name:"TechDocsReaderPage",component:()=>Promise.resolve().then(e.bind(e,26220)).then(p=>p.TechDocsReaderPage),mountPoint:l.Fw}))},26220:function(ee,s,e){"use strict";e.r(s),e.d(s,{TechDocsReaderLayout:function(){return c},TechDocsReaderPage:function(){return f}});var r=e(2784),t=e(10289),l=e(82339),u=e(26136),A=e(63126),m=e(99954),o=e(16172);const c=({withSearch:y,withHeader:p=!0})=>r.createElement(l.Page,{themeId:"documentation"},p&&r.createElement(m.S,null),r.createElement(o.b,null),r.createElement(A.F,{withSearch:y})),f=y=>{const{kind:p,name:E,namespace:T}=(0,t.UO)(),{children:I,entityRef:B={kind:p,name:E,namespace:T}}=y,j=(0,t.pC)();if(!I){const b=(j?r.Children.toArray(j.props.children):[]).find(L=>{var U,Y;const{type:D}=L;return!((Y=(U=D==null?void 0:D.__backstage_data)==null?void 0:U.map)!=null&&Y.get(u.Zz))});return r.createElement(u.ZS,{entityRef:B},b||r.createElement(c,null))}return r.createElement(u.ZS,{entityRef:B},({metadata:M,entityMetadata:b,onReady:L})=>r.createElement(l.Page,{themeId:"documentation"},I instanceof Function?I({entityRef:B,techdocsMetadataValue:M.value,entityMetadataValue:b.value,onReady:L}):I))}},63126:function(ee,s,e){"use strict";e.d(s,{F:function(){return xt}});var r=e(2784),t=e(79692),l=e(60905),u=e(26136),A=e(82339),m=e(47861),o=e(4614),c=e(77277),f=e(99688),y=e(12420),p=e(90436),E=e(61837),T=e(4190),I=e(87685);const B=(0,t.Z)(x=>(0,y.Z)({paper:{width:"100%",[x.breakpoints.up("sm")]:{width:"75%"},[x.breakpoints.up("md")]:{width:"50%"},padding:x.spacing(2.5)},root:{height:"100%",overflow:"hidden"},logs:{background:x.palette.background.default}})),j=({buildLog:x,onClose:re})=>{const Ee=B(),Te=x.length===0?"Waiting for logs...":x.join(`
|
|
32
|
+
`);return r.createElement(l.Z,{container:!0,direction:"column",className:Ee.root,spacing:0,wrap:"nowrap"},r.createElement(l.Z,{item:!0,container:!0,justifyContent:"space-between",alignItems:"center",spacing:0,wrap:"nowrap"},r.createElement(p.Z,{variant:"h5"},"Build Details"),r.createElement(E.Z,{key:"dismiss",title:"Close the drawer",onClick:re,color:"inherit"},r.createElement(I.Z,null))),r.createElement(A.LogViewer,{text:Te,classes:{root:Ee.logs}}))},M=({buildLog:x})=>{const re=B(),[Ee,Te]=(0,r.useState)(!1);return r.createElement(r.Fragment,null,r.createElement(c.Z,{color:"inherit",onClick:()=>Te(!0)},"Show Build Logs"),r.createElement(T.ZP,{classes:{paper:re.paper},anchor:"right",open:Ee,onClose:()=>Te(!1)},r.createElement(j,{buildLog:x,onClose:()=>Te(!1)})))};var b=e(36964);const L=({errorMessage:x})=>{const re=(0,b.useApi)(b.configApiRef).getOptionalString("techdocs.builder");let Ee="";return re!=="local"&&(Ee="Note that techdocs.builder is not set to 'local' in your config, which means this Backstage app will not generate docs if they are not found. Make sure the project's docs are generated and published by some external process (e.g. CI/CD pipeline). Or change techdocs.builder to 'local' to generate docs from this Backstage instance."),r.createElement(A.ErrorPage,{status:"404",statusMessage:x||"Documentation not found",additionalInfo:Ee})};var D=e(2263);const U=(0,t.Z)(x=>({root:{marginBottom:x.spacing(2)},message:{wordBreak:"break-word",overflowWrap:"anywhere"}})),Y=()=>{let x=null;const re=U(),{state:Ee,contentReload:Te,contentErrorMessage:Le,syncErrorMessage:Je,buildLog:it}=(0,D.DK)();return Ee==="INITIAL_BUILD"&&(x=r.createElement(f.Z,{classes:{root:re.root},variant:"outlined",severity:"info",icon:r.createElement(o.Z,{size:"24px"}),action:r.createElement(M,{buildLog:it})},"Documentation is accessed for the first time and is being prepared. The subsequent loads are much faster.")),Ee==="CONTENT_STALE_REFRESHING"&&(x=r.createElement(f.Z,{variant:"outlined",severity:"info",icon:r.createElement(o.Z,{size:"24px"}),action:r.createElement(M,{buildLog:it}),classes:{root:re.root}},"A newer version of this documentation is being prepared and will be available shortly.")),Ee==="CONTENT_STALE_READY"&&(x=r.createElement(f.Z,{variant:"outlined",severity:"success",action:r.createElement(c.Z,{color:"inherit",onClick:()=>Te()},"Refresh"),classes:{root:re.root}},"A newer version of this documentation is now available, please refresh to view.")),Ee==="CONTENT_STALE_ERROR"&&(x=r.createElement(f.Z,{variant:"outlined",severity:"error",action:r.createElement(M,{buildLog:it}),classes:{root:re.root,message:re.message}},"Building a newer version of this documentation failed."," ",Je)),Ee==="CONTENT_NOT_FOUND"&&(x=r.createElement(r.Fragment,null,Je&&r.createElement(f.Z,{variant:"outlined",severity:"error",action:r.createElement(M,{buildLog:it}),classes:{root:re.root,message:re.message}},"Building a newer version of this documentation failed."," ",Je),r.createElement(L,{errorMessage:Le}))),x};var te=e(10289),ue=e(60364),Re=e(41156),we=e(36356),ge=e(35368),ze=e.n(ge);const _e=/main\.[A-Fa-f0-9]{8}\.min\.css$/,et=/^https:\/\/fonts\.googleapis\.com/,st=/^https:\/\/fonts\.gstatic\.com/,Ct=x=>x.nodeName==="LINK",yt=x=>{const re=(x==null?void 0:x.getAttribute("href"))||"",Ee=re.match(_e),Te=re.match(et),Le=re.match(st);return Ee||Te||Le},Pe=x=>(Ct(x)&&!yt(x)&&x.remove(),x),ht=x=>x.nodeName==="IFRAME",Ve=(x,re)=>{const Ee=x.getAttribute("src")||"";try{const{host:Te}=new URL(Ee);return re.includes(Te)}catch{return!1}},ie=x=>re=>(ht(re)&&!Ve(re,x)&&re.remove(),re),de=()=>{const x=(0,b.useApi)(b.configApiRef);return(0,r.useMemo)(()=>x.getOptionalConfig("techdocs.sanitizer"),[x])},Ue=()=>{const x=de();return(0,r.useCallback)(async re=>{const Ee=x==null?void 0:x.getOptionalStringArray("allowedIframeHosts");ze().addHook("beforeSanitizeElements",Pe);const Te=["link"];return Ee&&(Te.push("iframe"),ze().addHook("beforeSanitizeElements",ie(Ee))),ze().sanitize(re.innerHTML,{ADD_TAGS:Te,FORBID_TAGS:["style"],WHOLE_DOCUMENT:!0,RETURN_DOM:!0})},[x])};var Be=e(41128),Xe=({theme:x})=>`
|
|
33
33
|
/*================== Variables ==================*/
|
|
34
34
|
/*
|
|
35
35
|
As the MkDocs output is rendered in shadow DOM, the CSS variable definitions on the root selector are not applied. Instead, they have to be applied on :host.
|
|
@@ -336,14 +336,14 @@ body {
|
|
|
336
336
|
width: 12.1rem;
|
|
337
337
|
}
|
|
338
338
|
}
|
|
339
|
-
`;const
|
|
339
|
+
`;const Et=["h1","h2","h3","h4","h5","h6"];var oe=({theme:x})=>`
|
|
340
340
|
/*================== Typeset ==================*/
|
|
341
341
|
|
|
342
342
|
.md-typeset {
|
|
343
343
|
font-size: var(--md-typeset-font-size);
|
|
344
344
|
}
|
|
345
345
|
|
|
346
|
-
${
|
|
346
|
+
${Et.reduce((re,Ee)=>{const Te=x.typography[Ee],{lineHeight:Le,fontFamily:Je,fontWeight:it,fontSize:Kt}=Te,Ht=Dt=>{let Ft=1;return typeof Dt=="number"&&(Ft=Dt/16*.6),typeof Dt=="string"&&(Ft=Dt.replace("rem","")),`calc(${Ft} * var(--md-typeset-font-size))`};return re.concat(`
|
|
347
347
|
.md-typeset ${Ee} {
|
|
348
348
|
color: var(--md-default-fg-color);
|
|
349
349
|
line-height: ${Le};
|
|
@@ -402,7 +402,7 @@ ${yt.reduce((re,Ee)=>{const Te=x.typography[Ee],{lineHeight:Le,fontFamily:Je,fon
|
|
|
402
402
|
.md-typeset pre > code::-webkit-scrollbar-thumb:hover {
|
|
403
403
|
background-color: hsla(0, 0%, 0%, 0.87);
|
|
404
404
|
}
|
|
405
|
-
`,
|
|
405
|
+
`,fe=()=>`
|
|
406
406
|
/*================== Animations ==================*/
|
|
407
407
|
/*
|
|
408
408
|
Disable CSS animations on link colors as they lead to issues in dark mode.
|
|
@@ -479,9 +479,9 @@ ${yt.reduce((re,Ee)=>{const Te=x.typography[Ee],{lineHeight:Le,fontFamily:Je,fon
|
|
|
479
479
|
height: 20px !important;
|
|
480
480
|
transform: translateY(-50%) !important;
|
|
481
481
|
}
|
|
482
|
-
`;const
|
|
482
|
+
`;const Ke=[Xe,mt,Ye,oe,fe,tt],Ne=()=>(0,A.useSidebarPinState)(),ct=()=>{const x=Ne(),re=(0,ue.Z)();return(0,r.useMemo)(()=>{const Ee={theme:re,sidebar:x};return Ke.reduce((Te,Le)=>Te+Le(Ee),"")},[re,x])},X=()=>{const x=ct();return(0,r.useCallback)(re=>(re.getElementsByTagName("head")[0].insertAdjacentHTML("beforeend",`<style>${x}</style>`),re),[x])},Z=(x,re,Ee)=>{const Te=x==="src"&&re.endsWith(".svg"),Le=!re.match(/^([a-z]*:)?\/\//i),Je=re.startsWith(Ee);return Te&&(Le||Je)},Q=({techdocsStorageApi:x,entityId:re,path:Ee})=>async Te=>{const Le=await x.getApiOrigin(),Je=async(it,Kt)=>{for(const Ht of it)if(Ht.hasAttribute(Kt)){const Dt=Ht.getAttribute(Kt);if(!Dt)return;const Ft=await x.getBaseUrl(Dt,re,Ee);if(Z(Kt,Dt,Le))try{const kt=await(await fetch(Ft,{credentials:"include"})).text();Ht.setAttribute(Kt,`data:image/svg+xml;base64,${btoa(unescape(encodeURIComponent(kt)))}`)}catch{Ht.setAttribute("alt",`Error: ${Dt}`)}else Ht.setAttribute(Kt,Ft)}};return await Promise.all([Je(Te.querySelectorAll("img"),"src"),Je(Te.querySelectorAll("script"),"src"),Je(Te.querySelectorAll("source"),"src"),Je(Te.querySelectorAll("link"),"href"),Je(Te.querySelectorAll("a[download]"),"href")]),Te};var se=e(68370),le=e(67097),be=e(47093),Oe=e(82717),Ae=e.n(Oe);const ke=x=>re=>{var kt;const Ee=re.querySelector('[title="Edit this page"]');if(!Ee||!Ee.href)return re;const Te=new URL(Ee.href),Le=x.byUrl(Te);if((Le==null?void 0:Le.type)!=="github"&&(Le==null?void 0:Le.type)!=="gitlab")return re;const Je=((kt=re.querySelector("article>h1"))==null?void 0:kt.childNodes[0].textContent)||"",it=encodeURIComponent(`Documentation Feedback: ${Je}`),Kt=encodeURIComponent(`Page source:
|
|
483
483
|
${Ee.href}
|
|
484
484
|
|
|
485
|
-
Feedback:`),Ht=(Le==null?void 0:Le.type)==="github"?(0,se.Pb)(Te.href,"blob"):Te.href,Dt=Ae()(Ht),Ft=`/${Dt.organization}/${Dt.name}`,ut=Ee.cloneNode();switch(Le==null?void 0:Le.type){case"gitlab":ut.href=`${Te.origin}${Ft}/issues/new?issue[title]=${it}&issue[description]=${Kt}`;break;case"github":ut.href=`${Te.origin}${Ft}/issues/new?title=${it}&body=${Kt}`;break;default:return re}return be.render(r.createElement(le.Z),ut),ut.style.paddingLeft="5px",ut.title="Leave feedback for this page",ut.id="git-feedback-link",Ee==null||Ee.insertAdjacentElement("beforebegin",ut),re};var ke=e(44882);const Et=()=>x=>{const re=x.querySelector('.md-header label[for="__drawer"]'),Ee=x.querySelector("article");if(!re||!Ee)return x;const Te=re.cloneNode();return be.render(r.createElement(ke.Z),Te),Te.id="toggle-sidebar",Te.title="Toggle Sidebar",Te.classList.add("md-content__button"),Te.style.setProperty("padding","0 0 0 5px"),Te.style.setProperty("margin","0.4rem 0 0.4rem 0.4rem"),Ee==null||Ee.prepend(Te),x},It=()=>x=>(((Ee,Te)=>{Array.from(Ee).filter(Le=>Le.hasAttribute(Te)).forEach(Le=>{const Je=Le.getAttribute(Te);if(Je){Je.match(/^https?:\/\//i)&&Le.setAttribute("target","_blank");try{const it=lt(window.location.href);Le.setAttribute(Te,new URL(Je,it).toString())}catch{Le.replaceWith(Le.textContent||Je)}}})})(Array.from(x.getElementsByTagName("a")),"href"),x);function lt(x){const re=new URL(x);return!re.pathname.endsWith("/")&&!re.pathname.endsWith(".html")&&(re.pathname+="/"),re.toString()}const Tt=({baseUrl:x,onClick:re})=>Ee=>(Array.from(Ee.getElementsByTagName("a")).forEach(Te=>{Te.addEventListener("click",Le=>{const it=Te.getAttribute("href");!it||it.startsWith(x)&&!Te.hasAttribute("download")&&(Le.preventDefault(),re(Le,it))})}),Ee);var Lt=e(15459),Rt=e(80030),Nt=e(72379),Zt=e(41547);const vt=(0,Lt.Z)(x=>({tooltip:{fontSize:"inherit",color:x.palette.text.primary,margin:0,padding:x.spacing(.5),backgroundColor:"transparent",boxShadow:"none"}}))(Rt.ZP),at=()=>r.createElement(Nt.Z,null,r.createElement("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"})),zt=({text:x})=>{const[re,Ee]=(0,r.useState)(!1),Te=(0,r.useCallback)(()=>{navigator.clipboard.writeText(x),Ee(!0)},[x]),Le=(0,r.useCallback)(()=>{Ee(!1)},[Ee]);return r.createElement(vt,{title:"Copied to clipboard",placement:"left",open:re,onClose:Le,leaveDelay:1e3},r.createElement("button",{className:"md-clipboard md-icon",onClick:Te},r.createElement(at,null)))},ae=x=>re=>{var Te;const Ee=re.querySelectorAll("pre > code");for(const Le of Ee){const Je=Le.textContent||"",it=document.createElement("div");(Te=Le==null?void 0:Le.parentElement)==null||Te.prepend(it),be.render(r.createElement(Zt.Z,{theme:x},r.createElement(zt,{text:Je})),it)}return re},V=()=>x=>{var re;return(re=x.querySelector(".md-header"))==null||re.remove(),x},ye=()=>x=>{var re,Ee;return(re=x.querySelector(".md-footer .md-copyright"))==null||re.remove(),(Ee=x.querySelector(".md-footer-copyright"))==null||Ee.remove(),x},We=({onLoading:x,onLoaded:re})=>Ee=>(x(),Ee.addEventListener(u.Ox,function Te(){re(),Ee.removeEventListener(u.Ox,Te)}),Ee),qe=()=>x=>(setTimeout(()=>{var re;if(window.location.hash){const Ee=window.location.hash.slice(1);(re=x==null?void 0:x.querySelector(`[id="${Ee}"]`))==null||re.scrollIntoView()}},200),x),ot=async(x,re)=>{let Ee;if(typeof x=="string")Ee=new DOMParser().parseFromString(x,"text/html").documentElement;else if(x instanceof Element)Ee=x;else throw new Error("dom is not a recognized type");for(const Te of re)Ee=await Te(Ee);return Ee},bt="screen and (max-width: 76.1875em)",Wt=x=>{const re=(0,te.s0)(),Ee=(0,ue.Z)(),Te=(0,Re.Z)(bt),Le=Ue(),Je=Q(),it=(0,b.useApi)(u.Dl),Kt=(0,b.useApi)(we.q3),{state:Ht,path:Dt,content:Ft}=(0,D.DK)(),[ut,kt]=(0,r.useState)(null),tn=(0,u.ux)(ut),jt=(0,r.useCallback)(()=>{if(!ut)return;ut.querySelectorAll(".md-sidebar").forEach($t=>{var hn,yn;if(Te)$t.style.top="0px";else{const an=(hn=ut.getBoundingClientRect().top)!=null?hn:0,fn=ut.querySelector(".md-container > .md-tabs"),Wn=(yn=fn==null?void 0:fn.getBoundingClientRect().height)!=null?yn:0;$t.style.top=`${Math.max(an,0)+Wn}px`}$t.style.setProperty("opacity","1")})},[ut,Te]);(0,r.useEffect)(()=>(window.addEventListener("resize",jt),window.addEventListener("scroll",jt,!0),()=>{window.removeEventListener("resize",jt),window.removeEventListener("scroll",jt,!0)}),[ut,jt]);const Vt=(0,r.useCallback)(()=>{if(!ut)return;const wt=ut.querySelector(".md-footer");wt&&(wt.style.width=`${ut.getBoundingClientRect().width}px`)},[ut]);(0,r.useEffect)(()=>(window.addEventListener("resize",Vt),()=>{window.removeEventListener("resize",Vt)}),[ut,Vt]),(0,r.useEffect)(()=>{tn||(Vt(),jt())},[Ht,tn,Vt,jt]);const cn=(0,r.useCallback)((wt,$t)=>ot(wt,[Le,X({techdocsStorageApi:it,entityId:x,path:$t}),It(),Et(),V(),ye(),Ke(Kt),Je]),[x,Kt,it,Le,Je]),Tn=(0,r.useCallback)(async wt=>ot(wt,[qe(),ae(Ee),Tt({baseUrl:window.location.origin,onClick:($t,hn)=>{var fn;const yn=$t.ctrlKey||$t.metaKey,an=new URL(hn);an.hash?yn?window.open(`${an.pathname}${an.hash}`,"_blank"):(re(`${an.pathname}${an.hash}`),(fn=wt==null?void 0:wt.querySelector(`#${an.hash.slice(1)}`))==null||fn.scrollIntoView()):yn?window.open(an.pathname,"_blank"):re(an.pathname)}}),We({onLoading:()=>{},onLoaded:()=>{var $t;($t=wt.querySelector(".md-nav__title"))==null||$t.removeAttribute("for")}}),We({onLoading:()=>{Array.from(wt.querySelectorAll(".md-sidebar")).forEach(hn=>{hn.style.setProperty("opacity","0")})},onLoaded:()=>{}})]),[Ee,re]);return(0,r.useEffect)(()=>{if(!Ft)return()=>{};let wt=!0;return cn(Ft,Dt).then(async $t=>{if(!($t!=null&&$t.innerHTML)||!wt)return;window.scroll({top:0});const hn=await Tn($t);kt(hn)}),()=>{wt=!1}},[Ft,Dt,cn,Tn]),ut};var Xt=e(8560);const un=()=>{const x=(0,u.$L)(),{shadowRoot:re}=(0,u.x1)(),Ee=re==null?void 0:re.querySelector('[data-md-component="content"]'),Te=re==null?void 0:re.querySelector('div[data-md-component="sidebar"][data-md-type="navigation"], div[data-md-component="navigation"]');let Le=Te==null?void 0:Te.querySelector('[data-techdocs-addons-location="primary sidebar"]');Le||(Le=document.createElement("div"),Le.setAttribute("data-techdocs-addons-location","primary sidebar"),Te==null||Te.prepend(Le));const Je=re==null?void 0:re.querySelector('div[data-md-component="sidebar"][data-md-type="toc"], div[data-md-component="toc"]');let it=Je==null?void 0:Je.querySelector('[data-techdocs-addons-location="secondary sidebar"]');return it||(it=document.createElement("div"),it.setAttribute("data-techdocs-addons-location","secondary sidebar"),Je==null||Je.prepend(it)),r.createElement(r.Fragment,null,r.createElement(Xt.Z,{container:Le},x.renderComponentsByLocation(u.oZ.PrimarySidebar)),r.createElement(Xt.Z,{container:Ee},x.renderComponentsByLocation(u.oZ.Content)),r.createElement(Xt.Z,{container:it},x.renderComponentsByLocation(u.oZ.SecondarySidebar)))},dn=(0,t.Z)({search:{width:"100%","@media (min-width: 76.1875em)":{width:"calc(100% - 34.4rem)",margin:"0 auto"}}}),xt=(0,D.m1)(x=>{var Ft;const{withSearch:re=!0,onReady:Ee}=x,Te=dn(),{entityMetadata:{value:Le,loading:Je},entityRef:it,setShadowRoot:Kt}=(0,u.x1)(),Ht=Wt(it),Dt=(0,r.useCallback)(ut=>{Kt(ut),Ee instanceof Function&&Ee()},[Kt,Ee]);return Je===!1&&!Le?r.createElement(A.ErrorPage,{status:"404",statusMessage:"PAGE NOT FOUND"}):Ht?r.createElement(A.Content,null,r.createElement(l.Z,{container:!0},r.createElement(l.Z,{xs:12,item:!0},r.createElement(Y,null)),re&&r.createElement(l.Z,{className:Te.search,xs:"auto",item:!0},r.createElement(m.S,{entityId:it,entityTitle:(Ft=Le==null?void 0:Le.metadata)==null?void 0:Ft.title})),r.createElement(l.Z,{xs:12,item:!0},r.createElement(u.VA,{element:Ht,onAppend:Dt},r.createElement(un,null))))):r.createElement(A.Content,null,r.createElement(l.Z,{container:!0},r.createElement(l.Z,{xs:12,item:!0},r.createElement(Y,null))))}),qt=null},99954:function(ee,s,e){"use strict";e.d(s,{S:function(){return E}});var r=e(2784),t=e(18671),l=e(98069),u=e(73250),A=e(26136),m=e(53479),o=e(48023),c=e(82339),f=e(36964),y=e(68725);const p=r.createElement(l.Z,{animation:"wave",variant:"text",height:40}),E=T=>{const{children:I}=T,B=(0,A.$L)(),j=(0,f.useApi)(f.configApiRef),{title:M,setTitle:b,subtitle:L,setSubtitle:D,entityRef:U,metadata:{value:Y,loading:te},entityMetadata:{value:ue,loading:Re}}=(0,A.x1)();(0,r.useEffect)(()=>{!Y||(b(je=>{const{site_name:ie}=Y;return je||ie}),D(je=>{let{site_description:ie}=Y;return(!ie||ie==="None")&&(ie="Home"),je||ie}))},[Y,b,D]);const we=j.getOptional("app.title")||"Backstage",ge=[L,M,we].filter(Boolean).join(" | "),{locationMetadata:ze,spec:_e}=ue||{},et=_e==null?void 0:_e.lifecycle,st=ue?(0,m.getEntityRelations)(ue,o.S4):[],Ct=(0,f.useRouteRef)(y._Z)(),pt=r.createElement(r.Fragment,null,r.createElement(c.HeaderLabel,{label:"Component",value:r.createElement(m.EntityRefLink,{color:"inherit",entityRef:U,title:ue==null?void 0:ue.metadata.title,defaultKind:"Component"})}),st.length>0&&r.createElement(c.HeaderLabel,{label:"Owner",value:r.createElement(m.EntityRefLinks,{color:"inherit",entityRefs:st,defaultKind:"group"})}),et?r.createElement(c.HeaderLabel,{label:"Lifecycle",value:et}):null,ze&&ze.type!=="dir"&&ze.type!=="file"?r.createElement(c.HeaderLabel,{label:"",value:r.createElement("a",{href:ze.target,target:"_blank",rel:"noopener noreferrer"},r.createElement(u.Z,{style:{marginTop:"-25px",fill:"#fff"}}))}):null);return!Re&&ue===void 0||!te&&Y===void 0?null:r.createElement(c.Header,{type:"Documentation",typeLink:Ct,title:M||p,subtitle:L||p},r.createElement(t.Z,{titleTemplate:"%s"},r.createElement("title",null,ge)),pt,I,B.renderComponentsByLocation(A.oZ.Header))}},16172:function(ee,s,e){"use strict";e.d(s,{b:function(){return p}});var r=e(2784),t=e(79692),l=e(15223),u=e(95544),A=e(80030),m=e(61837),o=e(48348),c=e(47603),f=e(26136);const y=(0,t.Z)(E=>({root:{gridArea:"pageSubheader",flexDirection:"column",minHeight:"auto",padding:E.spacing(3,3,0)}})),p=({toolbarProps:E})=>{const T=y(),[I,B]=(0,r.useState)(null),j=(0,r.useCallback)(te=>{B(te.currentTarget)},[]),M=(0,r.useCallback)(()=>{B(null)},[]),{entityMetadata:{value:b,loading:L}}=(0,f.x1)(),D=(0,f.$L)(),U=D.renderComponentsByLocation(f.oZ.Subheader),Y=D.renderComponentsByLocation(f.oZ.Settings);return!U&&!Y||L===!1&&!b?null:r.createElement(l.Z,{classes:T,...E},r.createElement(u.Z,{display:"flex",justifyContent:"flex-end",width:"100%",flexWrap:"wrap"},U,Y?r.createElement(r.Fragment,null,r.createElement(A.ZP,{title:"Settings"},r.createElement(m.Z,{"aria-controls":"tech-docs-reader-page-settings","aria-haspopup":"true",onClick:j},r.createElement(c.Z,null))),r.createElement(o.Z,{id:"tech-docs-reader-page-settings",getContentAnchorEl:null,anchorEl:I,anchorOrigin:{vertical:"bottom",horizontal:"right"},open:Boolean(I),onClose:M,keepMounted:!0},Y)):null))}},2263:function(ee,s,e){"use strict";e.d(s,{DK:function(){return p},m1:function(){return T}});var r=e(2784),t=e(10289),l=e(26136),u=e(36964),A=e(64279),m=e(77446);function o({contentLoading:I,content:B,activeSyncState:j}){return I||j==="BUILD_READY_RELOAD"||!B&&j==="CHECKING"?"CHECKING":!B&&j==="BUILDING"?"INITIAL_BUILD":B?j==="BUILDING"?"CONTENT_STALE_REFRESHING":j==="BUILD_READY"?"CONTENT_STALE_READY":j==="ERROR"?"CONTENT_STALE_ERROR":"CONTENT_FRESH":"CONTENT_NOT_FOUND"}function c(I,B){const j={...I};switch(B.type){case"sync":B.state==="CHECKING"&&(j.buildLog=[]),j.activeSyncState=B.state,j.syncError=B.syncError;break;case"contentLoading":j.contentLoading=!0,j.contentError=void 0;break;case"content":typeof B.path=="string"&&(j.path=B.path),j.contentLoading=!1,j.content=B.content,j.contentError=B.contentError;break;case"buildLog":j.buildLog=j.buildLog.concat(B.log);break;default:throw new Error}return["BUILD_READY","BUILD_READY_RELOAD"].includes(j.activeSyncState)&&["contentLoading","content"].includes(B.type)&&(j.activeSyncState="UP_TO_DATE",j.buildLog=[]),j}function f(I,B,j,M){var ue,Re;const[b,L]=(0,r.useReducer)(c,{activeSyncState:"CHECKING",path:M,contentLoading:!0,buildLog:[]}),D=(0,u.useApi)(l.Dl),{retry:U}=(0,m.Z)(async()=>{L({type:"contentLoading"});try{const we=await D.getEntityDocs({kind:I,namespace:B,name:j},M);return L({type:"content",content:we,path:M}),we}catch(we){L({type:"content",contentError:we,path:M})}},[D,I,B,j,M]),Y=(0,r.useRef)({content:void 0,reload:()=>{}});return Y.current={content:b.content,reload:U},(0,A.default)(async()=>{L({type:"sync",state:"CHECKING"});const we=setTimeout(()=>{L({type:"sync",state:"BUILDING"})},1e3);try{switch(await D.syncEntityDocs({kind:I,namespace:B,name:j},ze=>{L({type:"buildLog",log:ze})})){case"updated":Y.current.content?L({type:"sync",state:"BUILD_READY"}):(Y.current.reload(),L({type:"sync",state:"BUILD_READY_RELOAD"}));break;case"cached":L({type:"sync",state:"UP_TO_DATE"});break;default:L({type:"sync",state:"ERROR",syncError:new Error("Unexpected return state")});break}}catch(ge){L({type:"sync",state:"ERROR",syncError:ge})}finally{clearTimeout(we)}},[I,j,B,D,L,Y]),{state:(0,r.useMemo)(()=>o({activeSyncState:b.activeSyncState,contentLoading:b.contentLoading,content:b.content}),[b.activeSyncState,b.content,b.contentLoading]),contentReload:U,path:b.path,content:b.content,contentErrorMessage:(ue=b.contentError)==null?void 0:ue.toString(),syncErrorMessage:(Re=b.syncError)==null?void 0:Re.toString(),buildLog:b.buildLog}}const y=(0,r.createContext)({}),p=()=>(0,r.useContext)(y),E=({children:I})=>{const{"*":B=""}=(0,t.UO)(),{entityRef:j}=(0,l.x1)(),{kind:M,namespace:b,name:L}=j,D=f(M,b,L,B);return r.createElement(y.Provider,{value:D},I instanceof Function?I(D):I)},T=I=>B=>r.createElement(E,null,r.createElement(I,{...B}))},96393:function(ee,s,e){"use strict";e.d(s,{Fq:function(){return u.F},SE:function(){return l.S}});var r=e(2263),t=e(26220),l=e(99954),u=e(63126),A=e(16172)},68725:function(ee,s,e){"use strict";e.d(s,{Fw:function(){return l},_Z:function(){return t},pd:function(){return u}});var r=e(36964);const t=(0,r.createRouteRef)({id:"techdocs:index-page"}),l=(0,r.createRouteRef)({id:"techdocs:reader-page",params:["namespace","kind","name"]}),u=(0,r.createRouteRef)({id:"techdocs:catalog-reader-view"})},47861:function(ee,s,e){"use strict";e.d(s,{S:function(){return Y}});var r=e(2784),t=e(79692),l=e(49378),u=e(38402),A=e(86136),m=e(85256),o=e(82339),c=e(36964),f=e(74450);const y=(0,t.Z)({flexContainer:{flexWrap:"wrap"},itemText:{width:"100%",marginBottom:"1rem"}}),p=te=>{const{result:ue,highlight:Re,rank:we,lineClamp:ge=5,asListItem:ze=!0,asLink:_e=!0,title:et,icon:st}=te,Ct=y(),pt=(0,c.useAnalytics)(),Pe=()=>{pt.captureEvent("discover",ue.title,{attributes:{to:ue.location},value:we})},ht=()=>{const de=Re!=null&&Re.fields.title?r.createElement(f.FA,{text:Re.fields.title,preTag:Re.preTag,postTag:Re.postTag}):ue.title,Ue=Re!=null&&Re.fields.entityTitle?r.createElement(f.FA,{text:Re.fields.entityTitle,preTag:Re.preTag,postTag:Re.postTag}):ue.entityTitle,Be=Re!=null&&Re.fields.name?r.createElement(f.FA,{text:Re.fields.name,preTag:Re.preTag,postTag:Re.postTag}):ue.name;return r.createElement(l.Z,{className:Ct.itemText,primaryTypographyProps:{variant:"h6"},primary:et||r.createElement(r.Fragment,null,de," | ",Ue!=null?Ue:Be," docs"),secondary:r.createElement("span",{style:{display:"-webkit-box",WebkitBoxOrient:"vertical",WebkitLineClamp:ge,overflow:"hidden"}},Re!=null&&Re.fields.text?r.createElement(f.FA,{text:Re.fields.text,preTag:Re.preTag,postTag:Re.postTag}):ue.text)})},je=({children:de})=>_e?r.createElement(o.Link,{noTrack:!0,to:ue.location,onClick:Pe},de):r.createElement(r.Fragment,null,de),ie=({children:de})=>ze?r.createElement(r.Fragment,null,r.createElement(u.Z,{alignItems:"flex-start"},st&&r.createElement(A.Z,null,st),r.createElement("div",{className:Ct.flexContainer},de)),r.createElement(m.Z,{component:"li"})):r.createElement(r.Fragment,null,de);return r.createElement(je,null,r.createElement(ie,null,r.createElement(ht,null)))};var E=e(86619),T=e(50581),I=e(61837),B=e(4614),j=e(21853),M=e(88013),b=e(10289),L=e(48760);const D=(0,t.Z)({root:{width:"100%"}}),U=te=>{const{entityId:ue,entityTitle:Re,debounceTime:we=150}=te,[ge,ze]=(0,r.useState)(!1),_e=(0,b.s0)(),{term:et,setTerm:st,setFilters:Ct,result:{loading:pt,value:Pe}}=(0,f.Rx)(),ht=D(),[je,ie]=(0,r.useState)([]);(0,r.useEffect)(()=>{let oe=!0;if(oe&&Pe){const me=Pe.results.slice(0,10);ie(me)}return()=>{oe=!1}},[pt,Pe]);const[de,Ue]=(0,r.useState)(et);(0,L.Z)(()=>st(de),we,[de]);const{kind:Be,name:Xe,namespace:mt}=ue;(0,r.useEffect)(()=>{Ct(oe=>({...oe,kind:Be,namespace:mt,name:Xe}))},[Be,mt,Xe,Ct]);const Ye=oe=>{ge||ze(!0),Ue(oe.target.value)},yt=(oe,me)=>{if(me!=null&&me.document){const{location:tt}=me.document;_e(tt)}};return r.createElement(M.ZP,{classes:{root:ht.root},"data-testid":"techdocs-search-bar",size:"small",open:ge,getOptionLabel:()=>"",filterOptions:oe=>oe,onClose:()=>{ze(!1)},onFocus:()=>{ze(!0)},onChange:yt,blurOnSelect:!0,noOptionsText:"No results found",value:null,options:je,renderOption:({document:oe,highlight:me})=>r.createElement(p,{result:oe,lineClamp:3,asListItem:!1,asLink:!1,title:oe.title,highlight:me}),loading:pt,renderInput:oe=>r.createElement(E.Z,{...oe,"data-testid":"techdocs-search-bar-input",variant:"outlined",fullWidth:!0,placeholder:`Search ${Re||ue.name} docs`,value:de,onChange:Ye,InputProps:{...oe.InputProps,startAdornment:r.createElement(T.Z,{position:"start"},r.createElement(I.Z,{"aria-label":"Query",disabled:!0},r.createElement(j.Z,null))),endAdornment:r.createElement(r.Fragment,null,pt?r.createElement(B.Z,{color:"inherit",size:20}):null,oe.InputProps.endAdornment)}})})},Y=te=>{const ue={term:"",types:["techdocs"],pageCursor:"",filters:te.entityId};return r.createElement(f.Nd,{initialState:ue},r.createElement(U,{...te}))}},98157:function(){},53260:function(){}},function(ee){var s=function(r){return ee(ee.s=r)};ee.O(0,[2370,6202,9284,2126,7012,9035,4983,3222,6816,5218,4736],function(){return s(88649),s(46054)});var e=ee.O()}]);})();
|
|
485
|
+
Feedback:`),Ht=(Le==null?void 0:Le.type)==="github"?(0,se.Pb)(Te.href,"blob"):Te.href,Dt=Ae()(Ht),Ft=`/${Dt.organization}/${Dt.name}`,ut=Ee.cloneNode();switch(Le==null?void 0:Le.type){case"gitlab":ut.href=`${Te.origin}${Ft}/issues/new?issue[title]=${it}&issue[description]=${Kt}`;break;case"github":ut.href=`${Te.origin}${Ft}/issues/new?title=${it}&body=${Kt}`;break;default:return re}return be.render(r.createElement(le.Z),ut),ut.style.paddingLeft="5px",ut.title="Leave feedback for this page",ut.id="git-feedback-link",Ee==null||Ee.insertAdjacentElement("beforebegin",ut),re};var We=e(44882);const gt=()=>x=>{const re=x.querySelector('.md-header label[for="__drawer"]'),Ee=x.querySelector("article");if(!re||!Ee)return x;const Te=re.cloneNode();return be.render(r.createElement(We.Z),Te),Te.id="toggle-sidebar",Te.title="Toggle Sidebar",Te.classList.add("md-content__button"),Te.style.setProperty("padding","0 0 0 5px"),Te.style.setProperty("margin","0.4rem 0 0.4rem 0.4rem"),Ee==null||Ee.prepend(Te),x},It=()=>x=>(((Ee,Te)=>{Array.from(Ee).filter(Le=>Le.hasAttribute(Te)).forEach(Le=>{const Je=Le.getAttribute(Te);if(Je){Je.match(/^https?:\/\//i)&&Le.setAttribute("target","_blank");try{const it=lt(window.location.href);Le.setAttribute(Te,new URL(Je,it).toString())}catch{Le.replaceWith(Le.textContent||Je)}}})})(Array.from(x.getElementsByTagName("a")),"href"),x);function lt(x){const re=new URL(x);return!re.pathname.endsWith("/")&&!re.pathname.endsWith(".html")&&(re.pathname+="/"),re.toString()}const Tt=({baseUrl:x,onClick:re})=>Ee=>(Array.from(Ee.getElementsByTagName("a")).forEach(Te=>{Te.addEventListener("click",Le=>{const it=Te.getAttribute("href");!it||it.startsWith(x)&&!Te.hasAttribute("download")&&(Le.preventDefault(),re(Le,it))})}),Ee);var Lt=e(15459),Rt=e(80030),Nt=e(72379),Zt=e(41547);const vt=(0,Lt.Z)(x=>({tooltip:{fontSize:"inherit",color:x.palette.text.primary,margin:0,padding:x.spacing(.5),backgroundColor:"transparent",boxShadow:"none"}}))(Rt.ZP),at=()=>r.createElement(Nt.Z,null,r.createElement("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"})),zt=({text:x})=>{const[re,Ee]=(0,r.useState)(!1),Te=(0,r.useCallback)(()=>{navigator.clipboard.writeText(x),Ee(!0)},[x]),Le=(0,r.useCallback)(()=>{Ee(!1)},[Ee]);return r.createElement(vt,{title:"Copied to clipboard",placement:"left",open:re,onClose:Le,leaveDelay:1e3},r.createElement("button",{className:"md-clipboard md-icon",onClick:Te},r.createElement(at,null)))},ae=x=>re=>{var Te;const Ee=re.querySelectorAll("pre > code");for(const Le of Ee){const Je=Le.textContent||"",it=document.createElement("div");(Te=Le==null?void 0:Le.parentElement)==null||Te.prepend(it),be.render(r.createElement(Zt.Z,{theme:x},r.createElement(zt,{text:Je})),it)}return re},V=()=>x=>{var re;return(re=x.querySelector(".md-header"))==null||re.remove(),x},ye=()=>x=>{var re,Ee;return(re=x.querySelector(".md-footer .md-copyright"))==null||re.remove(),(Ee=x.querySelector(".md-footer-copyright"))==null||Ee.remove(),x},He=({onLoading:x,onLoaded:re})=>Ee=>(x(),Ee.addEventListener(u.Ox,function Te(){re(),Ee.removeEventListener(u.Ox,Te)}),Ee),qe=()=>x=>(setTimeout(()=>{var re;if(window.location.hash){const Ee=window.location.hash.slice(1);(re=x==null?void 0:x.querySelector(`[id="${Ee}"]`))==null||re.scrollIntoView()}},200),x),ot=async(x,re)=>{let Ee;if(typeof x=="string")Ee=new DOMParser().parseFromString(x,"text/html").documentElement;else if(x instanceof Element)Ee=x;else throw new Error("dom is not a recognized type");for(const Te of re)Ee=await Te(Ee);return Ee},bt="screen and (max-width: 76.1875em)",Wt=x=>{const re=(0,te.s0)(),Ee=(0,ue.Z)(),Te=(0,Re.Z)(bt),Le=Ue(),Je=X(),it=(0,b.useApi)(u.Dl),Kt=(0,b.useApi)(we.q3),{state:Ht,path:Dt,content:Ft}=(0,D.DK)(),[ut,kt]=(0,r.useState)(null),tn=(0,u.ux)(ut),jt=(0,r.useCallback)(()=>{if(!ut)return;ut.querySelectorAll(".md-sidebar").forEach($t=>{var hn,yn;if(Te)$t.style.top="0px";else{const an=(hn=ut.getBoundingClientRect().top)!=null?hn:0,fn=ut.querySelector(".md-container > .md-tabs"),Wn=(yn=fn==null?void 0:fn.getBoundingClientRect().height)!=null?yn:0;$t.style.top=`${Math.max(an,0)+Wn}px`}$t.style.setProperty("opacity","1")})},[ut,Te]);(0,r.useEffect)(()=>(window.addEventListener("resize",jt),window.addEventListener("scroll",jt,!0),()=>{window.removeEventListener("resize",jt),window.removeEventListener("scroll",jt,!0)}),[ut,jt]);const Vt=(0,r.useCallback)(()=>{if(!ut)return;const wt=ut.querySelector(".md-footer");wt&&(wt.style.width=`${ut.getBoundingClientRect().width}px`)},[ut]);(0,r.useEffect)(()=>(window.addEventListener("resize",Vt),()=>{window.removeEventListener("resize",Vt)}),[ut,Vt]),(0,r.useEffect)(()=>{tn||(Vt(),jt())},[Ht,tn,Vt,jt]);const cn=(0,r.useCallback)((wt,$t)=>ot(wt,[Le,Q({techdocsStorageApi:it,entityId:x,path:$t}),It(),gt(),V(),ye(),ke(Kt),Je]),[x,Kt,it,Le,Je]),Tn=(0,r.useCallback)(async wt=>ot(wt,[qe(),ae(Ee),Tt({baseUrl:window.location.origin,onClick:($t,hn)=>{var fn;const yn=$t.ctrlKey||$t.metaKey,an=new URL(hn);an.hash?yn?window.open(`${an.pathname}${an.hash}`,"_blank"):(re(`${an.pathname}${an.hash}`),(fn=wt==null?void 0:wt.querySelector(`#${an.hash.slice(1)}`))==null||fn.scrollIntoView()):yn?window.open(an.pathname,"_blank"):re(an.pathname)}}),He({onLoading:()=>{},onLoaded:()=>{var $t;($t=wt.querySelector(".md-nav__title"))==null||$t.removeAttribute("for")}}),He({onLoading:()=>{Array.from(wt.querySelectorAll(".md-sidebar")).forEach(hn=>{hn.style.setProperty("opacity","0")})},onLoaded:()=>{}})]),[Ee,re]);return(0,r.useEffect)(()=>{if(!Ft)return()=>{};let wt=!0;return cn(Ft,Dt).then(async $t=>{if(!($t!=null&&$t.innerHTML)||!wt)return;window.scroll({top:0});const hn=await Tn($t);kt(hn)}),()=>{wt=!1}},[Ft,Dt,cn,Tn]),ut};var Xt=e(8560);const un=()=>{const x=(0,u.$L)(),{shadowRoot:re}=(0,u.x1)(),Ee=re==null?void 0:re.querySelector('[data-md-component="content"]'),Te=re==null?void 0:re.querySelector('div[data-md-component="sidebar"][data-md-type="navigation"], div[data-md-component="navigation"]');let Le=Te==null?void 0:Te.querySelector('[data-techdocs-addons-location="primary sidebar"]');Le||(Le=document.createElement("div"),Le.setAttribute("data-techdocs-addons-location","primary sidebar"),Te==null||Te.prepend(Le));const Je=re==null?void 0:re.querySelector('div[data-md-component="sidebar"][data-md-type="toc"], div[data-md-component="toc"]');let it=Je==null?void 0:Je.querySelector('[data-techdocs-addons-location="secondary sidebar"]');return it||(it=document.createElement("div"),it.setAttribute("data-techdocs-addons-location","secondary sidebar"),Je==null||Je.prepend(it)),r.createElement(r.Fragment,null,r.createElement(Xt.Z,{container:Le},x.renderComponentsByLocation(u.oZ.PrimarySidebar)),r.createElement(Xt.Z,{container:Ee},x.renderComponentsByLocation(u.oZ.Content)),r.createElement(Xt.Z,{container:it},x.renderComponentsByLocation(u.oZ.SecondarySidebar)))},dn=(0,t.Z)({search:{width:"100%","@media (min-width: 76.1875em)":{width:"calc(100% - 34.4rem)",margin:"0 auto"}}}),xt=(0,D.m1)(x=>{var Ft;const{withSearch:re=!0,onReady:Ee}=x,Te=dn(),{entityMetadata:{value:Le,loading:Je},entityRef:it,setShadowRoot:Kt}=(0,u.x1)(),Ht=Wt(it),Dt=(0,r.useCallback)(ut=>{Kt(ut),Ee instanceof Function&&Ee()},[Kt,Ee]);return Je===!1&&!Le?r.createElement(A.ErrorPage,{status:"404",statusMessage:"PAGE NOT FOUND"}):Ht?r.createElement(A.Content,null,r.createElement(l.Z,{container:!0},r.createElement(l.Z,{xs:12,item:!0},r.createElement(Y,null)),re&&r.createElement(l.Z,{className:Te.search,xs:"auto",item:!0},r.createElement(m.S,{entityId:it,entityTitle:(Ft=Le==null?void 0:Le.metadata)==null?void 0:Ft.title})),r.createElement(l.Z,{xs:12,item:!0},r.createElement(u.VA,{element:Ht,onAppend:Dt},r.createElement(un,null))))):r.createElement(A.Content,null,r.createElement(l.Z,{container:!0},r.createElement(l.Z,{xs:12,item:!0},r.createElement(Y,null))))}),qt=null},99954:function(ee,s,e){"use strict";e.d(s,{S:function(){return E}});var r=e(2784),t=e(18671),l=e(98069),u=e(73250),A=e(26136),m=e(53479),o=e(48023),c=e(82339),f=e(36964),y=e(68725);const p=r.createElement(l.Z,{animation:"wave",variant:"text",height:40}),E=T=>{const{children:I}=T,B=(0,A.$L)(),j=(0,f.useApi)(f.configApiRef),{title:M,setTitle:b,subtitle:L,setSubtitle:D,entityRef:U,metadata:{value:Y,loading:te},entityMetadata:{value:ue,loading:Re}}=(0,A.x1)();(0,r.useEffect)(()=>{!Y||(b(Ve=>{const{site_name:ie}=Y;return Ve||ie}),D(Ve=>{let{site_description:ie}=Y;return(!ie||ie==="None")&&(ie="Home"),Ve||ie}))},[Y,b,D]);const we=j.getOptional("app.title")||"Backstage",ge=[M,L,we].filter(Boolean).join(" | "),{locationMetadata:ze,spec:_e}=ue||{},et=_e==null?void 0:_e.lifecycle,st=ue?(0,m.getEntityRelations)(ue,o.S4):[],Ct=(0,f.useRouteRef)(y._Z)(),yt=r.createElement(r.Fragment,null,r.createElement(c.HeaderLabel,{label:"Component",value:r.createElement(m.EntityRefLink,{color:"inherit",entityRef:U,title:ue==null?void 0:ue.metadata.title,defaultKind:"Component"})}),st.length>0&&r.createElement(c.HeaderLabel,{label:"Owner",value:r.createElement(m.EntityRefLinks,{color:"inherit",entityRefs:st,defaultKind:"group"})}),et?r.createElement(c.HeaderLabel,{label:"Lifecycle",value:et}):null,ze&&ze.type!=="dir"&&ze.type!=="file"?r.createElement(c.HeaderLabel,{label:"",value:r.createElement("a",{href:ze.target,target:"_blank",rel:"noopener noreferrer"},r.createElement(u.Z,{style:{marginTop:"-25px",fill:"#fff"}}))}):null);return!Re&&ue===void 0||!te&&Y===void 0?null:r.createElement(c.Header,{type:"Documentation",typeLink:Ct,title:M||p,subtitle:L||p},r.createElement(t.Z,{titleTemplate:"%s"},r.createElement("title",null,ge)),yt,I,B.renderComponentsByLocation(A.oZ.Header))}},16172:function(ee,s,e){"use strict";e.d(s,{b:function(){return p}});var r=e(2784),t=e(79692),l=e(15223),u=e(95544),A=e(80030),m=e(61837),o=e(48348),c=e(47603),f=e(26136);const y=(0,t.Z)(E=>({root:{gridArea:"pageSubheader",flexDirection:"column",minHeight:"auto",padding:E.spacing(3,3,0)}})),p=({toolbarProps:E})=>{const T=y(),[I,B]=(0,r.useState)(null),j=(0,r.useCallback)(te=>{B(te.currentTarget)},[]),M=(0,r.useCallback)(()=>{B(null)},[]),{entityMetadata:{value:b,loading:L}}=(0,f.x1)(),D=(0,f.$L)(),U=D.renderComponentsByLocation(f.oZ.Subheader),Y=D.renderComponentsByLocation(f.oZ.Settings);return!U&&!Y||L===!1&&!b?null:r.createElement(l.Z,{classes:T,...E},r.createElement(u.Z,{display:"flex",justifyContent:"flex-end",width:"100%",flexWrap:"wrap"},U,Y?r.createElement(r.Fragment,null,r.createElement(A.ZP,{title:"Settings"},r.createElement(m.Z,{"aria-controls":"tech-docs-reader-page-settings","aria-haspopup":"true",onClick:j},r.createElement(c.Z,null))),r.createElement(o.Z,{id:"tech-docs-reader-page-settings",getContentAnchorEl:null,anchorEl:I,anchorOrigin:{vertical:"bottom",horizontal:"right"},open:Boolean(I),onClose:M,keepMounted:!0},Y)):null))}},2263:function(ee,s,e){"use strict";e.d(s,{DK:function(){return p},m1:function(){return T}});var r=e(2784),t=e(10289),l=e(26136),u=e(36964),A=e(64279),m=e(77446);function o({contentLoading:I,content:B,activeSyncState:j}){return I||j==="BUILD_READY_RELOAD"||!B&&j==="CHECKING"?"CHECKING":!B&&j==="BUILDING"?"INITIAL_BUILD":B?j==="BUILDING"?"CONTENT_STALE_REFRESHING":j==="BUILD_READY"?"CONTENT_STALE_READY":j==="ERROR"?"CONTENT_STALE_ERROR":"CONTENT_FRESH":"CONTENT_NOT_FOUND"}function c(I,B){const j={...I};switch(B.type){case"sync":B.state==="CHECKING"&&(j.buildLog=[]),j.activeSyncState=B.state,j.syncError=B.syncError;break;case"contentLoading":j.contentLoading=!0,j.contentError=void 0;break;case"content":typeof B.path=="string"&&(j.path=B.path),j.contentLoading=!1,j.content=B.content,j.contentError=B.contentError;break;case"buildLog":j.buildLog=j.buildLog.concat(B.log);break;default:throw new Error}return["BUILD_READY","BUILD_READY_RELOAD"].includes(j.activeSyncState)&&["contentLoading","content"].includes(B.type)&&(j.activeSyncState="UP_TO_DATE",j.buildLog=[]),j}function f(I,B,j,M){var ue,Re;const[b,L]=(0,r.useReducer)(c,{activeSyncState:"CHECKING",path:M,contentLoading:!0,buildLog:[]}),D=(0,u.useApi)(l.Dl),{retry:U}=(0,m.Z)(async()=>{L({type:"contentLoading"});try{const we=await D.getEntityDocs({kind:I,namespace:B,name:j},M);return L({type:"content",content:we,path:M}),we}catch(we){L({type:"content",contentError:we,path:M})}},[D,I,B,j,M]),Y=(0,r.useRef)({content:void 0,reload:()=>{}});return Y.current={content:b.content,reload:U},(0,A.default)(async()=>{L({type:"sync",state:"CHECKING"});const we=setTimeout(()=>{L({type:"sync",state:"BUILDING"})},1e3);try{switch(await D.syncEntityDocs({kind:I,namespace:B,name:j},ze=>{L({type:"buildLog",log:ze})})){case"updated":Y.current.content?L({type:"sync",state:"BUILD_READY"}):(Y.current.reload(),L({type:"sync",state:"BUILD_READY_RELOAD"}));break;case"cached":L({type:"sync",state:"UP_TO_DATE"});break;default:L({type:"sync",state:"ERROR",syncError:new Error("Unexpected return state")});break}}catch(ge){L({type:"sync",state:"ERROR",syncError:ge})}finally{clearTimeout(we)}},[I,j,B,D,L,Y]),{state:(0,r.useMemo)(()=>o({activeSyncState:b.activeSyncState,contentLoading:b.contentLoading,content:b.content}),[b.activeSyncState,b.content,b.contentLoading]),contentReload:U,path:b.path,content:b.content,contentErrorMessage:(ue=b.contentError)==null?void 0:ue.toString(),syncErrorMessage:(Re=b.syncError)==null?void 0:Re.toString(),buildLog:b.buildLog}}const y=(0,r.createContext)({}),p=()=>(0,r.useContext)(y),E=({children:I})=>{const{"*":B=""}=(0,t.UO)(),{entityRef:j}=(0,l.x1)(),{kind:M,namespace:b,name:L}=j,D=f(M,b,L,B);return r.createElement(y.Provider,{value:D},I instanceof Function?I(D):I)},T=I=>B=>r.createElement(E,null,r.createElement(I,{...B}))},96393:function(ee,s,e){"use strict";e.d(s,{Fq:function(){return u.F},SE:function(){return l.S}});var r=e(2263),t=e(26220),l=e(99954),u=e(63126),A=e(16172)},68725:function(ee,s,e){"use strict";e.d(s,{Fw:function(){return l},_Z:function(){return t},pd:function(){return u}});var r=e(36964);const t=(0,r.createRouteRef)({id:"techdocs:index-page"}),l=(0,r.createRouteRef)({id:"techdocs:reader-page",params:["namespace","kind","name"]}),u=(0,r.createRouteRef)({id:"techdocs:catalog-reader-view"})},47861:function(ee,s,e){"use strict";e.d(s,{S:function(){return Y}});var r=e(2784),t=e(79692),l=e(49378),u=e(38402),A=e(86136),m=e(85256),o=e(82339),c=e(36964),f=e(74450);const y=(0,t.Z)({flexContainer:{flexWrap:"wrap"},itemText:{width:"100%",marginBottom:"1rem"}}),p=te=>{const{result:ue,highlight:Re,rank:we,lineClamp:ge=5,asListItem:ze=!0,asLink:_e=!0,title:et,icon:st}=te,Ct=y(),yt=(0,c.useAnalytics)(),Pe=()=>{yt.captureEvent("discover",ue.title,{attributes:{to:ue.location},value:we})},ht=()=>{const de=Re!=null&&Re.fields.title?r.createElement(f.FA,{text:Re.fields.title,preTag:Re.preTag,postTag:Re.postTag}):ue.title,Ue=Re!=null&&Re.fields.entityTitle?r.createElement(f.FA,{text:Re.fields.entityTitle,preTag:Re.preTag,postTag:Re.postTag}):ue.entityTitle,Be=Re!=null&&Re.fields.name?r.createElement(f.FA,{text:Re.fields.name,preTag:Re.preTag,postTag:Re.postTag}):ue.name;return r.createElement(l.Z,{className:Ct.itemText,primaryTypographyProps:{variant:"h6"},primary:et||r.createElement(r.Fragment,null,de," | ",Ue!=null?Ue:Be," docs"),secondary:r.createElement("span",{style:{display:"-webkit-box",WebkitBoxOrient:"vertical",WebkitLineClamp:ge,overflow:"hidden"}},Re!=null&&Re.fields.text?r.createElement(f.FA,{text:Re.fields.text,preTag:Re.preTag,postTag:Re.postTag}):ue.text)})},Ve=({children:de})=>_e?r.createElement(o.Link,{noTrack:!0,to:ue.location,onClick:Pe},de):r.createElement(r.Fragment,null,de),ie=({children:de})=>ze?r.createElement(r.Fragment,null,r.createElement(u.Z,{alignItems:"flex-start"},st&&r.createElement(A.Z,null,st),r.createElement("div",{className:Ct.flexContainer},de)),r.createElement(m.Z,{component:"li"})):r.createElement(r.Fragment,null,de);return r.createElement(Ve,null,r.createElement(ie,null,r.createElement(ht,null)))};var E=e(86619),T=e(50581),I=e(61837),B=e(4614),j=e(21853),M=e(88013),b=e(10289),L=e(48760);const D=(0,t.Z)({root:{width:"100%"}}),U=te=>{const{entityId:ue,entityTitle:Re,debounceTime:we=150}=te,[ge,ze]=(0,r.useState)(!1),_e=(0,b.s0)(),{term:et,setTerm:st,setFilters:Ct,result:{loading:yt,value:Pe}}=(0,f.Rx)(),ht=D(),[Ve,ie]=(0,r.useState)([]);(0,r.useEffect)(()=>{let oe=!0;if(oe&&Pe){const fe=Pe.results.slice(0,10);ie(fe)}return()=>{oe=!1}},[yt,Pe]);const[de,Ue]=(0,r.useState)(et);(0,L.Z)(()=>st(de),we,[de]);const{kind:Be,name:Xe,namespace:mt}=ue;(0,r.useEffect)(()=>{Ct(oe=>({...oe,kind:Be,namespace:mt,name:Xe}))},[Be,mt,Xe,Ct]);const Ye=oe=>{ge||ze(!0),Ue(oe.target.value)},Et=(oe,fe)=>{if(fe!=null&&fe.document){const{location:tt}=fe.document;_e(tt)}};return r.createElement(M.ZP,{classes:{root:ht.root},"data-testid":"techdocs-search-bar",size:"small",open:ge,getOptionLabel:()=>"",filterOptions:oe=>oe,onClose:()=>{ze(!1)},onFocus:()=>{ze(!0)},onChange:Et,blurOnSelect:!0,noOptionsText:"No results found",value:null,options:Ve,renderOption:({document:oe,highlight:fe})=>r.createElement(p,{result:oe,lineClamp:3,asListItem:!1,asLink:!1,title:oe.title,highlight:fe}),loading:yt,renderInput:oe=>r.createElement(E.Z,{...oe,"data-testid":"techdocs-search-bar-input",variant:"outlined",fullWidth:!0,placeholder:`Search ${Re||ue.name} docs`,value:de,onChange:Ye,InputProps:{...oe.InputProps,startAdornment:r.createElement(T.Z,{position:"start"},r.createElement(I.Z,{"aria-label":"Query",disabled:!0},r.createElement(j.Z,null))),endAdornment:r.createElement(r.Fragment,null,yt?r.createElement(B.Z,{color:"inherit",size:20}):null,oe.InputProps.endAdornment)}})})},Y=te=>{const ue={term:"",types:["techdocs"],pageCursor:"",filters:te.entityId};return r.createElement(f.Nd,{initialState:ue},r.createElement(U,{...te}))}},98157:function(){},53260:function(){}},function(ee){var s=function(r){return ee(ee.s=r)};ee.O(0,[2370,6202,9284,2126,7012,9035,4983,3222,6816,5218,4736],function(){return s(88649),s(46054)});var e=ee.O()}]);})();
|
|
486
486
|
|
|
487
|
-
//# sourceMappingURL=main.
|
|
487
|
+
//# sourceMappingURL=main.ca83e3a7.js.map
|