@techdocs/cli 1.3.1 → 1.3.2-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 +6 -3
- package/dist/embedded-app/index.html +1 -1
- package/dist/embedded-app/static/{main.6fc07bc1.js → main.0da0ba28.js} +27 -21
- package/dist/embedded-app/static/main.0da0ba28.js.map +1 -0
- package/dist/embedded-app/static/{runtime.6fc07bc1.js → runtime.0da0ba28.js} +1 -1
- package/dist/embedded-app/static/{runtime.6fc07bc1.js.map → runtime.0da0ba28.js.map} +1 -1
- package/dist/embedded-app/static/{vendor.6fc07bc1.js → vendor.0da0ba28.js} +1 -1
- package/dist/embedded-app/static/{vendor.6fc07bc1.js.map → vendor.0da0ba28.js.map} +1 -1
- package/dist/index.cjs.js +5 -5
- package/dist/index.cjs.js.map +1 -1
- package/package.json +4 -4
- package/dist/embedded-app/static/main.6fc07bc1.js.map +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
(()=>{(self.webpackChunktechdocs_cli_embedded_app=self.webpackChunktechdocs_cli_embedded_app||[]).push([[179],{29644:function(At,Fe,t){"use strict";t.d(Fe,{n3:function(){return g},MS:function(){return b}});var h=t(25271),r=t(23054),W=t(96279),k=t.n(W);const g=Symbol.for("CATALOG_FILTER_EXISTS_0e15b590c0b343a2bae3e787e84c2111");class b{async getEntityAncestors(P,te){const{kind:_,namespace:X,name:U}=(0,h.of)(P.entityRef);return await this.requestRequired("GET",`/entities/by-name/${encodeURIComponent(_)}/${encodeURIComponent(X)}/${encodeURIComponent(U)}/ancestry`,te)}async getLocationById(P,te){return await this.requestOptional("GET",`/locations/${encodeURIComponent(P)}`,te)}async getEntities(P,te){const{filter:_=[],fields:X=[],order:U,offset:F,limit:Y,after:ce}=P!=null?P:{},oe=[];for(const A of[_].flat()){const C=[];for(const[z,Le]of Object.entries(A))for(const Xe of[Le].flat())Xe===g?C.push(encodeURIComponent(z)):typeof Xe=="string"&&C.push(`${encodeURIComponent(z)}=${encodeURIComponent(Xe)}`);C.length&&oe.push(`filter=${C.join(",")}`)}if(X.length&&oe.push(`fields=${X.map(encodeURIComponent).join(",")}`),U)for(const A of[U].flat())A&&oe.push(`order=${encodeURIComponent(A.order)}:${encodeURIComponent(A.field)}`);F!==void 0&&oe.push(`offset=${F}`),Y!==void 0&&oe.push(`limit=${Y}`),ce!==void 0&&oe.push(`after=${encodeURIComponent(ce)}`);const T=oe.length?`?${oe.join("&")}`:"",R=await this.requestRequired("GET",`/entities${T}`,te),V=(A,C)=>{var z,Le;if(((z=A.metadata)===null||z===void 0?void 0:z.name)===void 0||A.kind===void 0||((Le=C.metadata)===null||Le===void 0?void 0:Le.name)===void 0||C.kind===void 0)return 0;const Xe=(0,h.eE)(A),Qe=(0,h.eE)(C);return Xe<Qe?-1:Xe>Qe?1:0};return{items:R.sort(V)}}async getEntitiesByRefs(P,te){var _;const X={entityRefs:P.entityRefs};!((_=P.fields)===null||_===void 0)&&_.length&&(X.fields=P.fields);const F=`${await this.discoveryApi.getBaseUrl("catalog")}/entities/by-refs`,Y=await this.fetchApi.fetch(F,{headers:{"Content-Type":"application/json",...(te==null?void 0:te.token)&&{Authorization:`Bearer ${te==null?void 0:te.token}`}},method:"POST",body:JSON.stringify(X)});if(!Y.ok)throw await r.VL.fromResponse(Y);const{items:ce}=await Y.json();return{items:ce}}async getEntityByRef(P,te){const{kind:_,namespace:X,name:U}=(0,h.of)(P);return this.requestOptional("GET",`/entities/by-name/${encodeURIComponent(_)}/${encodeURIComponent(X)}/${encodeURIComponent(U)}`,te)}async getEntityByName(P,te){const{kind:_,namespace:X="default",name:U}=P;return this.requestOptional("GET",`/entities/by-name/${encodeURIComponent(_)}/${encodeURIComponent(X)}/${encodeURIComponent(U)}`,te)}async refreshEntity(P,te){const _=await this.fetchApi.fetch(`${await this.discoveryApi.getBaseUrl("catalog")}/refresh`,{headers:{"Content-Type":"application/json",...(te==null?void 0:te.token)&&{Authorization:`Bearer ${te==null?void 0:te.token}`}},method:"POST",body:JSON.stringify({entityRef:P})});if(_.status!==200)throw new Error(await _.text())}async getEntityFacets(P,te){const{filter:_=[],facets:X}=P,U=[];for(const Y of[_].flat()){const ce=[];for(const[oe,T]of Object.entries(Y))for(const R of[T].flat())R===g?ce.push(encodeURIComponent(oe)):typeof R=="string"&&ce.push(`${encodeURIComponent(oe)}=${encodeURIComponent(R)}`);ce.length&&U.push(`filter=${ce.join(",")}`)}for(const Y of X)U.push(`facet=${encodeURIComponent(Y)}`);const F=U.length?`?${U.join("&")}`:"";return await this.requestOptional("GET",`/entity-facets${F}`,te)}async addLocation(P,te){const{type:_="url",target:X,dryRun:U}=P,F=await this.fetchApi.fetch(`${await this.discoveryApi.getBaseUrl("catalog")}/locations${U?"?dryRun=true":""}`,{headers:{"Content-Type":"application/json",...(te==null?void 0:te.token)&&{Authorization:`Bearer ${te==null?void 0:te.token}`}},method:"POST",body:JSON.stringify({type:_,target:X})});if(F.status!==201)throw new Error(await F.text());const{location:Y,entities:ce,exists:oe}=await F.json();if(!Y)throw new Error(`Location wasn't added: ${X}`);return{location:Y,entities:ce,exists:oe}}async getLocationByRef(P,te){return(await this.requestRequired("GET","/locations",te)).map(X=>X.data).find(X=>P===(0,h.NZ)(X))}async removeLocationById(P,te){await this.requestIgnored("DELETE",`/locations/${encodeURIComponent(P)}`,te)}async removeEntityByUid(P,te){await this.requestIgnored("DELETE",`/entities/by-uid/${encodeURIComponent(P)}`,te)}async validateEntity(P,te,_){const X=await this.fetchApi.fetch(`${await this.discoveryApi.getBaseUrl("catalog")}/validate-entity`,{headers:{"Content-Type":"application/json",...(_==null?void 0:_.token)&&{Authorization:`Bearer ${_==null?void 0:_.token}`}},method:"POST",body:JSON.stringify({entity:P,location:te})});if(X.ok)return{valid:!0};if(X.status!==400)throw await r.VL.fromResponse(X);const{errors:U=[]}=await X.json();return{valid:!1,errors:U}}async requestIgnored(P,te,_){const X=`${await this.discoveryApi.getBaseUrl("catalog")}${te}`,U=_!=null&&_.token?{Authorization:`Bearer ${_.token}`}:{},F=await this.fetchApi.fetch(X,{method:P,headers:U});if(!F.ok)throw await r.VL.fromResponse(F)}async requestRequired(P,te,_){const X=`${await this.discoveryApi.getBaseUrl("catalog")}${te}`,U=_!=null&&_.token?{Authorization:`Bearer ${_.token}`}:{},F=await this.fetchApi.fetch(X,{method:P,headers:U});if(!F.ok)throw await r.VL.fromResponse(F);return await F.json()}async requestOptional(P,te,_){const X=`${await this.discoveryApi.getBaseUrl("catalog")}${te}`,U=_!=null&&_.token?{Authorization:`Bearer ${_.token}`}:{},F=await this.fetchApi.fetch(X,{method:P,headers:U});if(!F.ok){if(F.status===404)return;throw await r.VL.fromResponse(F)}return await F.json()}constructor(P){this.discoveryApi=P.discoveryApi,this.fetchApi=P.fetchApi||{fetch:k()}}}},25271:function(At,Fe,t){"use strict";t.d(Fe,{Tf:function(){return W},P1:function(){return ge},q1:function(){return ee},M6:function(){return Re},l2:function(){return r},zG:function(){return h},w$:function(){return In},nP:function(){return Fn},aS:function(){return zn},S4:function(){return en},cz:function(){return Mn},iB:function(){return mt},CV:function(){return wt},of:function(){return ot},Ou:function(){return Ue},eE:function(){return ft},NZ:function(){return et}});const h="default",r="backstage.io/view-url",W="backstage.io/edit-url",k="kubernetes.io/api-server",g="kubernetes.io/api-server-certificate-authority",b="kubernetes.io/auth-provider";var c=t(76635),P=t.n(c);class te{async enforce(O){return O.metadata.namespace?O:lodash.merge({metadata:{namespace:this.namespace}},O)}constructor(O=DEFAULT_NAMESPACE){this.namespace=O}}class _{static isValidPrefixAndOrSuffix(O,de,Be,D){if(typeof O!="string")return!1;const M=O.split(de);return M.length===1?D(M[0]):M.length===2?Be(M[0])&&D(M[1]):!1}static isJsonSafe(O){try{return P().isEqual(O,JSON.parse(JSON.stringify(O)))}catch{return!1}}static isValidDnsSubdomain(O){return typeof O=="string"&&O.length>=1&&O.length<=253&&O.split(".").every(_.isValidDnsLabel)}static isValidDnsLabel(O){return typeof O=="string"&&O.length>=1&&O.length<=63&&/^[a-z0-9]+(\-[a-z0-9]+)*$/.test(O)}static isValidTag(O){return typeof O=="string"&&O.length>=1&&O.length<=63&&/^[a-z0-9+#]+(\-[a-z0-9+#]+)*$/.test(O)}static isValidUrl(O){if(typeof O!="string")return!1;try{return new URL(O),!0}catch{return!1}}static isValidString(O){var de;return typeof O=="string"&&((de=O==null?void 0:O.trim())===null||de===void 0?void 0:de.length)>=1}static isNonEmptyString(O){var de;return typeof O=="string"&&((de=O==null?void 0:O.trim())===null||de===void 0?void 0:de.length)>=1}}var X=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}}}}}'),U=t(27991),F=t.n(U),Y=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"}}}`),ce=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}}}}}}'),oe=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 T=new Map,R=[X,Y,ce,oe];function V(ae){if(!(ae!=null&&ae.length))throw new TypeError("Unknown error");const O=ae[0];throw new TypeError(`${O.instancePath||"<root>"} ${O.message}${O.params?` - ${Object.entries(O.params).map(([de,Be])=>`${de}: ${Be}`).join(", ")}`:""}`)}function A(ae,O={}){var de;const Be=(de=O==null?void 0:O.disableCache)!==null&&de!==void 0?de:!1,D=Be?"":JSON.stringify(ae);if(!Be){const be=T.get(D);if(be)return be}const M=C(ae),ue=new(F())({allowUnionTypes:!0,allErrors:!0,validateSchema:!0});M.length&&ue.addSchema(M,void 0,void 0,!0);const fe=ue.compile(ae);return Be||T.set(D,fe),fe}function C(ae){if(typeof ae!="object")return[];const O=new Set;ae.$id&&O.add(ae.$id);const de=new Array,Be=[ae];for(;Be.length;){const D=Be.pop();for(const M of z(D))if(!O.has(M)){O.add(M);const ue=R.find(fe=>fe.$id===M);ue&&(de.push(ue),Be.push(ue))}}return de}function*z(ae){const O=[ae];for(;O.length;){const de=O.pop();if(typeof de=="object"&&de)for(const[Be,D]of Object.entries(de))Be==="$ref"&&typeof D=="string"?yield D.split("#")[0]:O.push(D)}}function Le(ae){const O=compileAjvSchema(ae||entityEnvelopeSchema);return de=>{if(O(de)===!0)return de;throw throwAjvError(O.errors)}}function Xe(ae){const O=A(ae);return de=>{var Be;if(O(de)===!0)return de;const M=(Be=O.errors)===null||Be===void 0?void 0:Be.filter(ue=>["/kind","/apiVersion"].includes(ue.instancePath));if((M==null?void 0:M.length)&&M.every(ue=>ue.keyword==="enum"))return!1;throw V(O.errors)}}function Qe(ae){const O=compileAjvSchema(ae||entitySchema);return de=>{if(O(de)===!0)return de;throw throwAjvError(O.errors)}}class _e{static isValidApiVersion(O){return _.isValidPrefixAndOrSuffix(O,"/",_.isValidDnsSubdomain,de=>de.length>=1&&de.length<=63&&/^[a-z0-9A-Z]+$/.test(de))}static isValidKind(O){return typeof O=="string"&&O.length>=1&&O.length<=63&&/^[a-zA-Z][a-z0-9A-Z]*$/.test(O)}static isValidObjectName(O){return typeof O=="string"&&O.length>=1&&O.length<=63&&/^([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9]$/.test(O)}static isValidNamespace(O){return _.isValidDnsLabel(O)}static isValidLabelKey(O){return _.isValidPrefixAndOrSuffix(O,"/",_.isValidDnsSubdomain,_e.isValidObjectName)}static isValidLabelValue(O){return O===""||_e.isValidObjectName(O)}static isValidAnnotationKey(O){return _.isValidPrefixAndOrSuffix(O,"/",_.isValidDnsSubdomain,_e.isValidObjectName)}static isValidAnnotationValue(O){return typeof O=="string"}}const Ge={isValidApiVersion:_e.isValidApiVersion,isValidKind:_e.isValidKind,isValidEntityName:_e.isValidObjectName,isValidNamespace:_e.isValidNamespace,isValidLabelKey:_e.isValidLabelKey,isValidLabelValue:_e.isValidLabelValue,isValidAnnotationKey:_e.isValidAnnotationKey,isValidAnnotationValue:_e.isValidAnnotationValue,isValidTag:ae=>typeof ae=="string"&&ae.length>=1&&ae.length<=63&&/^[a-z0-9:+#]+(\-[a-z0-9:+#]+)*$/.test(ae)};function gt(ae={}){return{...Ge,...ae}}class Ee{async enforce(O){function de(S,G,me){if(G==null)throw new Error(`${S} must have a value`);let he;try{he=me(G)}catch(Ce){throw new Error(`${S} could not be validated, ${Ce}`)}if(!he){let Ce;switch(me.name){case"isValidLabelValue":case"isValidObjectName":Ce="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":Ce="a valid prefix and/or suffix";break;case"isValidNamespace":case"isValidDnsLabel":Ce="a string that is sequences of [a-z0-9] separated by [-], at most 63 characters in total";break;case"isValidTag":Ce="a string that is sequences of [a-z0-9+#] separated by [-], at most 63 characters in total";break;case"isValidAnnotationValue":Ce="a string";break;case"isValidKind":Ce="a string that is a sequence of [a-zA-Z][a-z0-9A-Z], at most 63 characters in total";break;case"isValidUrl":Ce="a string that is a valid url";break;case"isValidString":case"isNonEmptyString":Ce="a non empty string";break;default:Ce=void 0;break}const Oe=Ce?` expected ${Ce} but found "${G}".`:"";throw new Error(`"${S}" is not valid;${Oe} 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 Be(S,G,me){return G===void 0||de(S,G,me)}de("apiVersion",O.apiVersion,this.validators.isValidApiVersion),de("kind",O.kind,this.validators.isValidKind),de("metadata.name",O.metadata.name,this.validators.isValidEntityName),Be("metadata.namespace",O.metadata.namespace,this.validators.isValidNamespace);var D;for(const[S,G]of Object.entries((D=O.metadata.labels)!==null&&D!==void 0?D:[]))de(`labels.${S}`,S,this.validators.isValidLabelKey),de(`labels.${S}`,G,this.validators.isValidLabelValue);var M;for(const[S,G]of Object.entries((M=O.metadata.annotations)!==null&&M!==void 0?M:[]))de(`annotations.${S}`,S,this.validators.isValidAnnotationKey),de(`annotations.${S}`,G,this.validators.isValidAnnotationValue);var ue;const fe=(ue=O.metadata.tags)!==null&&ue!==void 0?ue:[];for(let S=0;S<fe.length;++S)de(`tags.${S}`,fe[S],this.validators.isValidTag);var be;const $e=(be=O.metadata.links)!==null&&be!==void 0?be:[];for(let S=0;S<$e.length;++S){var Ae,We,rt;de(`links.${S}.url`,(Ae=$e[S])===null||Ae===void 0?void 0:Ae.url,CommonValidatorFunctions.isValidUrl),Be(`links.${S}.title`,(We=$e[S])===null||We===void 0?void 0:We.title,CommonValidatorFunctions.isNonEmptyString),Be(`links.${S}.icon`,(rt=$e[S])===null||rt===void 0?void 0:rt.icon,KubernetesValidatorFunctions.isValidObjectName)}return O}constructor(O=makeValidator()){this.validators=O}}class Ke{async enforce(O){if(!this.validate){const D=new Ajv({allowUnionTypes:!0});this.validate=D.addSchema([commonSchema,entityMetaSchema],void 0,void 0,!0).compile(entitySchema)}if(this.validate(O)===!0)return O;const[Be]=this.validate.errors||[];throw Be?new Error(`Malformed envelope, ${Be.instancePath||"<root>"} ${Be.message}`):new Error("Malformed envelope, Unknown error")}}function it(ae){let O=ae.indexOf(":");const de=ae.indexOf("/");de!==-1&&de<O&&(O=-1);const Be=O===-1?void 0:ae.slice(0,O),D=de===-1?void 0:ae.slice(O+1,de),M=ae.slice(Math.max(O+1,de+1));if(Be===""||D===""||M==="")throw new TypeError(`Entity reference "${ae}" was not on the form [<kind>:][<namespace>/]<name>`);return{kind:Be,namespace:D,name:M}}function mt(ae){return{kind:ae.kind,namespace:ae.metadata.namespace||h,name:ae.metadata.name}}function ot(ae,O){if(!ae)throw new Error("Entity reference must not be empty");const de=O==null?void 0:O.defaultKind,Be=(O==null?void 0:O.defaultNamespace)||h;let D,M,ue;if(typeof ae=="string"){const We=it(ae);var fe;D=(fe=We.kind)!==null&&fe!==void 0?fe:de;var be;M=(be=We.namespace)!==null&&be!==void 0?be:Be,ue=We.name}else{var $e;D=($e=ae.kind)!==null&&$e!==void 0?$e:de;var Ae;M=(Ae=ae.namespace)!==null&&Ae!==void 0?Ae:Be,ue=ae.name}if(D)if(M){if(!ue){const We=JSON.stringify(ae);throw new Error(`Entity reference ${We} had missing or empty name`)}}else{const We=JSON.stringify(ae);throw new Error(`Entity reference ${We} had missing or empty namespace`)}else{const We=JSON.stringify(ae);throw new Error(`Entity reference ${We} had missing or empty kind (e.g. did not start with "component:" or similar)`)}return{kind:D,namespace:M,name:ue}}function ft(ae){let O,de,Be;if("metadata"in ae){O=ae.kind;var D;de=(D=ae.metadata.namespace)!==null&&D!==void 0?D:h,Be=ae.metadata.name}else{O=ae.kind;var M;de=(M=ae.namespace)!==null&&M!==void 0?M:h,Be=ae.name}return`${O.toLocaleLowerCase("en-US")}:${de.toLocaleLowerCase("en-US")}/${Be.toLocaleLowerCase("en-US")}`}class nt{async enforce(O){let de=O;for(const Be of this.policies){const D=await Be.enforce(de);if(!D)throw new Error(`Policy ${Be.constructor.name} did not return a result`);de=D}return de}constructor(O){this.policies=O}}class Lt{async enforce(O){for(const de of this.policies){const Be=await de.enforce(O);if(Be)return Be}throw new Error("The entity did not match any known policy")}constructor(O){this.policies=O}}const bt={allOf(ae){return new nt(ae)},oneOf(ae){return new Lt(ae)}};var ze=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 ne(ae){let O;return{async check(de){return O||(O=Xe(ae)),O(de)===de}}}const Pe=ne(ze);var ke=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 tt=ne(ke);var vt=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 Zt=ne(vt);var ut=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 Tt=ne(ut);var It=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 Ot=ne(It),en="ownedBy",Wt="ownerOf",Vt="consumesApi",Qt="apiConsumedBy",un="providesApi",cn="apiProvidedBy",Fn="dependsOn",In="dependencyOf",Un="parentOf",vn="childOf",hn="memberOf",Xt="hasMember",Mn="partOf",zn="hasPart";var pn=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 yn=ne(pn);var xn=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 kn=ne(xn);var On=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 bn=ne(On),ge="backstage.io/managed-by-location",ee="backstage.io/managed-by-origin-location",Re="backstage.io/source-location";function Ue(ae){if(typeof ae!="string")throw new TypeError(`Unable to parse location ref '${ae}', unexpected argument ${typeof ae}`);const O=ae.indexOf(":");if(O<0)throw new TypeError(`Unable to parse location ref '${ae}', expected '<type>:<target>', e.g. 'url:https://host/path'`);const de=ae.substring(0,O).trim(),Be=ae.substring(O+1).trim();if(!de||!Be)throw new TypeError(`Unable to parse location ref '${ae}', expected '<type>:<target>', e.g. 'url:https://host/path'`);if(de==="http"||de==="https")throw new TypeError(`Invalid location ref '${ae}', please prefix it with 'url:', e.g. 'url:${ae}'`);return{type:de,target:Be}}function et(ae){const{type:O,target:de}=ae;if(O){if(!de)throw new TypeError("Unable to stringify location ref, empty target")}else throw new TypeError("Unable to stringify location ref, empty type");return`${O}:${de}`}function wt(ae){var O,de,Be,D,M;const ue=(M=(O=ae.metadata)===null||O===void 0||(de=O.annotations)===null||de===void 0?void 0:de[Re])!==null&&M!==void 0?M:(Be=ae.metadata)===null||Be===void 0||(D=Be.annotations)===null||D===void 0?void 0:D[ge];if(!ue)throw new Error(`Entity '${ft(ae)}' is missing location`);return Ue(ue)}},93414:function(At,Fe,t){"use strict";t.d(Fe,{zx:function(){return gt},Oi:function(){return ne},VY:function(){return Mi},yW:function(){return qa},XF:function(){return tt},mn:function(){return wt},NX:function(){return h},ub:function(){return We},mf:function(){return rl},yu:function(){return fn},h4:function(){return qi},M6:function(){return hr},i9:function(){return fl},aR:function(){return zi},rJ:function(){return wr},Oh:function(){return bl},hu:function(){return vl},rU:function(){return _e},nU:function(){return fs},sk:function(){return dt},Or:function(){return Zr},T3:function(){return _i},g9:function(){return wl},Ex:function(){return Cs},Gk:function(){return w},tn:function(){return Wi},Ph:function(){return Ze},YE:function(){return qo},v7:function(){return Ar},R6:function(){return vo},tR:function(){return Qo},uw:function(){return ja},qt:function(){return Ri},iA:function(){return Xi},GB:function(){return Cn},po:function(){return lr},mZ:function(){return so},Pf:function(){return Ur}});var h={};t.r(h),t.d(h,{Nm:function(){return vt},ht:function(){return Tt},LJ:function(){return ut}});var r=t(52322),W=t(25248),k=t(19928),g=t(2784);function b(e){const[s,a]=useState([]),d=useApi(alertApiRef),{anchorOrigin:p={vertical:"top",horizontal:"center"},transientTimeoutMs:v}=e,j=v!=null?v:5e3;useEffect(()=>{const N=d.alert$().subscribe(pe=>a(ie=>ie.concat(pe)));return()=>{N.unsubscribe()}},[d]);const[$]=s;if(useEffect(()=>{if($&&$.display==="transient"){const N=setTimeout(()=>{a(pe=>{const ie=pe.filter(xe=>xe!==$);return ie.length===pe.length?pe:ie})},j);return()=>clearTimeout(N)}},[$,j]),s.length===0)return null;const K=()=>{a(N=>N.filter(pe=>pe!==$))};return _jsx(Snackbar,{open:!0,anchorOrigin:p,children:_jsx(Alert,{action:_jsx(IconButton,{color:"inherit",size:"small",onClick:K,"data-testid":"error-button-close",children:_jsx(CloseIcon,{})}),severity:$.severity,children:_jsxs(Typography,{component:"span",children:[String($.message),s.length>1&&_jsx("em",{children:` (${s.length-1} older ${pluralize("message",s.length-1)})`})]})})})}var c=t(79692),P=t(12420);const te=(0,c.Z)(e=>(0,P.Z)({avatar:{width:"4rem",height:"4rem",color:"#fff"},avatarText:{fontWeight:e.typography.fontWeightBold,letterSpacing:"1px",textTransform:"uppercase"}}),{name:"BackstageAvatar"});function _(e){const{displayName:s,picture:a,customStyles:d}=e,p=te();let v={...d};const j={fontFamily:v.fontFamily,fontSize:v.fontSize,fontWeight:v.fontWeight};return a||(v={backgroundColor:stringToColor(s||""),...d}),_jsx(MaterialAvatar,{alt:s,src:a,className:p.avatar,style:v,children:s&&_jsx(Typography,{variant:"h6",component:"span",className:p.avatarText,style:j,children:extractInitials(s)})})}var X=t(77277),U=t(86689),F=t(90436),Y=t(72779),ce=t.n(Y),oe=t(76635),T=t(79635),R=t(39857);function V(){const[e]=(0,T.is)((0,r.jsx)(T.AW,{index:!0,element:(0,r.jsx)("div",{})}));return!e.index}const A=(0,c.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"}),C=e=>/^([a-z+.-]+):/.test(e),z=()=>{try{return(0,W.h_)(W.Ds).getOptionalString("app.baseUrl")}catch{return}},Le=()=>{const e="http://sample.dev";var s;const a=(s=z())!==null&&s!==void 0?s:"/",{pathname:d}=new URL(a,e);return(0,oe.trimEnd)(d,"/")},Xe=e=>{let s=String(e);const a=Le(),d=C(s),p=s.startsWith(a);return!d&&!p&&(s=a.concat(s)),s},Qe=e=>{if(e instanceof Array)return e.map(Qe).join(" ").trim();if(typeof e=="object"&&e){var s;return Qe(e==null||(s=e.props)===null||s===void 0?void 0:s.children)}return["string","number"].includes(typeof e)?String(e):""},_e=g.forwardRef(({onClick:e,noTrack:s,...a},d)=>{const p=A(),v=(0,W.z$)(),j=V()?Xe(a.to):a.to,$=Qe(a.children)||j,K=C(j),N=K&&!!/^https?:/.exec(j),pe=ie=>{e==null||e(ie),s||v.captureEvent("click",$,{attributes:{to:j}})};return K?(0,r.jsxs)(U.Z,{...N?{target:"_blank",rel:"noopener"}:{},...a,ref:d,href:j,onClick:pe,className:ce()(p.externalLink,a.className),children:[a.children,(0,r.jsx)(F.Z,{component:"span",className:p.visuallyHidden,children:", Opens in a new window"})]}):(0,r.jsx)(U.Z,{...a,ref:d,component:R.rU,to:j,onClick:pe})}),Ge=g.forwardRef((e,s)=>(0,r.jsx)(_e,{ref:s,...e,color:"initial"})),gt=g.forwardRef((e,s)=>(0,r.jsx)(X.Z,{ref:s,component:Ge,...e}));var Ee=t(95544),Ke=t(60364),it=t(83229),mt=t(26639),ot=t(39595),ft=t(61837),nt=t(80030),Lt=t(19353),bt=t(95074);function ze(e){const{text:s,tooltipDelay:a=1e3,tooltipText:d="Text copied to clipboard","aria-label":p="Copy text"}=e,v=(0,W.h_)(W.VE),[j,$]=(0,g.useState)(!1),[{error:K},N]=(0,bt.Z)();(0,g.useEffect)(()=>{K&&v.post(K)},[K,v]);const pe=ie=>{ie.stopPropagation(),$(!0),N(s)};return(0,r.jsx)(r.Fragment,{children:(0,r.jsx)(nt.ZP,{id:"copy-test-tooltip",title:d,placement:"top",leaveDelay:a,onClose:()=>$(!1),open:j,children:(0,r.jsx)(ft.Z,{onClick:pe,"aria-label":p,children:(0,r.jsx)(Lt.Z,{})})})})}function ne(e){const{text:s,language:a,showLineNumbers:d=!1,highlightedNumbers:p,customStyle:v,showCopyCodeButton:j=!1}=e,$=(0,Ke.Z)(),K=$.palette.type==="dark"?mt.Z:ot.Z,N=$.palette.type==="dark"?"#256bf3":"#e6ffed";return(0,r.jsxs)(Ee.Z,{position:"relative",children:[(0,r.jsx)(it.Z,{customStyle:v,language:a,style:K,showLineNumbers:d,wrapLines:!0,lineNumberStyle:{color:$.palette.textVerySubtle},lineProps:pe=>p!=null&&p.includes(pe)?{style:{backgroundColor:N}}:{},children:s}),j&&(0,r.jsx)(Ee.Z,{position:"absolute",top:0,right:0,children:(0,r.jsx)(ze,{text:s})})]})}var Pe=t(41156),ke=t(88188);function tt(e){const{title:s,to:a}=e,d=(0,Pe.Z)(p=>p.breakpoints.down("xs"));return a?d?(0,r.jsx)(ft.Z,{component:R.rU,color:"primary",title:s,size:"small",to:a,children:(0,r.jsx)(ke.Z,{})}):(0,r.jsx)(X.Z,{component:R.rU,variant:"contained",color:"primary",to:a,children:s}):null}var vt;(function(e){e.TOP_BOTTOM="TB",e.BOTTOM_TOP="BT",e.LEFT_RIGHT="LR",e.RIGHT_LEFT="RL"})(vt||(vt={}));var Zt;(function(e){e.UP_LEFT="UL",e.UP_RIGHT="UR",e.DOWN_LEFT="DL",e.DOWN_RIGHT="DR"})(Zt||(Zt={}));var ut;(function(e){e.NETWORK_SIMPLEX="network-simplex",e.TIGHT_TREE="tight-tree",e.LONGEST_PATH="longest-path"})(ut||(ut={}));var Tt;(function(e){e.LEFT="l",e.RIGHT="r",e.CENTER="c"})(Tt||(Tt={}));var It=t(27397),Ot=t(11105),en=t(97963),Wt=t(46506),Vt=t.n(Wt),Qt=t(54073),un=t.n(Qt),cn=t(10368);const Fn=(0,c.Z)(e=>({node:{fill:e.palette.primary.light,stroke:e.palette.primary.light},text:{fill:e.palette.primary.contrastText}}),{name:"BackstageDependencyGraphDefaultNode"});function In({node:{id:e}}){const s=Fn(),[a,d]=g.useState(0),[p,v]=g.useState(0),j=g.useRef(null);g.useLayoutEffect(()=>{if(j.current){let{height:pe,width:ie}=j.current.getBBox();pe=Math.round(pe),ie=Math.round(ie),(pe!==p||ie!==a)&&(d(ie),v(pe))}},[a,p]);const $=10,K=a+$*2,N=p+$*2;return(0,r.jsxs)("g",{children:[(0,r.jsx)("rect",{className:s.node,width:K,height:N,rx:10}),(0,r.jsx)("text",{ref:j,className:s.text,y:N/2,x:K/2,textAnchor:"middle",alignmentBaseline:"middle",children:e})]})}const Un="arrow-marker",vn="node",hn="edge",Xt="label",Mn=(0,cn.Z)(e=>({node:{transition:`${e.transitions.duration.shortest}ms`}}),{name:"BackstageDependencyGraphNode"}),zn=e=>(0,r.jsx)(In,{...e});function pn({render:e=zn,setNode:s,node:a}){const{width:d,height:p,x:v=0,y:j=0}=a,$=a,K=Mn(),N=g.useRef(null);return g.useLayoutEffect(()=>{if(N.current){let{height:pe,width:ie}=N.current.getBBox();pe=Math.round(pe),ie=Math.round(ie),(pe!==p||ie!==d)&&s(a.id,{...a,height:pe,width:ie})}},[a,d,p,s]),(0,r.jsx)("g",{ref:N,"data-testid":vn,className:K.node,transform:`translate(${v-d/2},${j-p/2})`,children:e({node:$})})}var yn=t(76985),xn=t(39829),kn=t(19574),On=t.n(kn);const bn=(0,cn.Z)(e=>({text:{fill:e.palette.textContrast}}),{name:"BackstageDependencyGraphDefaultLabel"});function ge({edge:{label:e}}){const s=bn();return(0,r.jsx)("text",{className:s.text,textAnchor:"middle",children:e})}const ee=(0,cn.Z)(e=>({path:{strokeWidth:1,stroke:e.palette.textSubtle,fill:"none",transition:`${e.transitions.duration.shortest}ms`},label:{transition:`${e.transitions.duration.shortest}ms`}}),{name:"BackstageDependencyGraphEdge"}),Re=e=>(0,r.jsx)(ge,{...e});function Ue({render:e=Re,setEdge:s,id:a,edge:d,curve:p}){const{x:v=0,y:j=0,width:$,height:K,points:N}=d,pe=d,ie=ee(),xe=g.useRef(null);g.useLayoutEffect(()=>{if(xe.current){let{height:qe,width:Pt}=xe.current.getBBox();qe=Math.round(qe),Pt=Math.round(Pt),(qe!==K||Pt!==$)&&s(a,{...d,height:qe,width:Pt})}},[d,K,$,s,a]);let Te="";const Ye=g.useMemo(()=>yn.Z().x(qe=>qe.x).y(qe=>qe.y).curve(xn[p]),[p]);if(N){const qe=N.filter(Pt=>On()(Pt.x)&&On()(Pt.y));Te=Ye(qe)||""}return(0,r.jsxs)(r.Fragment,{children:[Te&&(0,r.jsx)("path",{"data-testid":hn,className:ie.path,d:Te}),pe.label?(0,r.jsx)("g",{ref:xe,"data-testid":Xt,className:ie.label,transform:`translate(${v},${j})`,children:e({edge:pe})}):null]})}const et="workspace";function wt(e){var s,a;const{edges:d,nodes:p,renderNode:v,direction:j=vt.TOP_BOTTOM,align:$,nodeMargin:K=50,edgeMargin:N=10,rankMargin:pe=50,paddingX:ie=0,paddingY:xe=0,acyclicer:Te,ranker:Ye=ut.NETWORK_SIMPLEX,labelPosition:qe=Tt.RIGHT,labelOffset:Pt=10,edgeRanks:Kt=1,edgeWeight:tn=1,renderLabel:nn,defs:kt,zoom:_t="enabled",curve:Yt="curveMonotoneX",fit:vr="grow",...yr}=e,xr=(0,en.Z)(),[br,ai]=g.useState(100),[Tr,li]=g.useState(100),Jt=g.useRef(new(Vt()).graphlib.Graph),[ds,So]=g.useState(((s=Jt.current.graph())===null||s===void 0?void 0:s.width)||0),[Ir,ci]=g.useState(((a=Jt.current.graph())===null||a===void 0?void 0:a.height)||0),[Dn,cr]=g.useState([]),[Mr,zr]=g.useState([]),an=Math.max(ds,br),mn=Math.max(Ir,Tr),us=Math.min(Ir,Tr),Wr=vr==="grow"?mn:us,Ns=g.useMemo(()=>un()(dn=>{if(!dn)return;const Nn=Ot.Z(dn),ln=Ot.Z(dn.getElementById(et));function rr(){Nn.call(It.sP().scaleExtent([1,10]).on("zoom",Sr=>{Sr.transform.x=Math.min(0,Math.max(Sr.transform.x,an-an*Sr.transform.k)),Sr.transform.y=Math.min(0,Math.max(Sr.transform.y,mn-mn*Sr.transform.k)),ln.attr("transform",Sr.transform)}))}_t==="enabled"?rr():_t==="enable-on-click"&&Nn.on("click",()=>rr());const{width:sr,height:Co}=dn.getBoundingClientRect();br!==sr&&ai(sr),Tr!==Co&&li(Co)},100),[Tr,br,an,mn,_t]),ia=g.useCallback(()=>{const dn=Jt.current.nodes(),Nn=Jt.current.edges();dn.forEach(ln=>{p.some(sr=>sr.id===ln)||Jt.current.removeNode(ln)}),Nn.forEach(ln=>{d.some(sr=>sr.from===ln.v&&sr.to===ln.w)||Jt.current.removeEdge(ln.v,ln.w)}),p.forEach(ln=>{const rr=Jt.current.nodes().find(sr=>ln.id===sr);if(rr&&Jt.current.node(rr)){const{width:sr,height:Co,x:Sr,y:zl}=Jt.current.node(rr);Jt.current.setNode(rr,{...ln,width:sr,height:Co,x:Sr,y:zl})}else Jt.current.setNode(ln.id,{...ln,width:0,height:0})}),d.forEach(ln=>{Jt.current.setEdge(ln.from,ln.to,{...ln,label:ln.label,width:0,height:0,labelpos:qe,labeloffset:Pt,weight:tn,minlen:Kt})})},[d,p,qe,Pt,tn,Kt]),Fs=g.useMemo(()=>un()(()=>{Vt().layout(Jt.current);const{height:dn,width:Nn}=Jt.current.graph(),ln=Math.max(0,dn||0),rr=Math.max(0,Nn||0);So(rr),ci(ln),cr(Jt.current.nodes()),zr(Jt.current.edges())},250,{leading:!0}),[]);g.useEffect(()=>(Jt.current.setGraph({rankdir:j,align:$,nodesep:K,edgesep:N,ranksep:pe,marginx:ie,marginy:xe,acyclicer:Te,ranker:Ye}),ia(),Fs(),Fs.cancel),[Te,$,j,N,ie,xe,K,pe,Ye,ia,Fs]);function Ul(dn,Nn){return Jt.current.setNode(dn,Nn),Fs(),Jt.current}function Ml(dn,Nn){return Jt.current.setEdge(dn,Nn),Fs(),Jt.current}return(0,r.jsxs)("svg",{ref:Ns,...yr,width:"100%",height:Wr,viewBox:`0 0 ${an} ${mn}`,children:[(0,r.jsxs)("defs",{children:[(0,r.jsx)("marker",{id:Un,viewBox:"0 0 24 24",markerWidth:"14",markerHeight:"14",refX:"16",refY:"12",orient:"auto",markerUnits:"strokeWidth",children:(0,r.jsx)("path",{fill:xr.palette.textSubtle,d:"M8.59 16.59L13.17 12 8.59 7.41 10 6l6 6-6 6-1.41-1.41z"})}),kt]}),(0,r.jsx)("g",{id:et,children:(0,r.jsxs)("svg",{width:ds,height:Ir,y:mn/2-Ir/2,x:an/2-ds/2,viewBox:`0 0 ${ds} ${Ir}`,children:[Mr.map(dn=>{const Nn=Jt.current.edge(dn);return Nn?(0,r.jsx)(Ue,{id:dn,setEdge:Ml,render:nn,edge:Nn,curve:Yt},`${dn.v}-${dn.w}`):null}),Dn.map(dn=>{const Nn=Jt.current.node(dn);return Nn?(0,r.jsx)(pn,{setNode:Ul,render:v,node:Nn},dn):null})]})})]})}var ae;const O=(0,c.Z)(e=>({root:{padding:e.spacing(0),marginBottom:e.spacing(0),marginTop:e.spacing(0),display:"flex",flexFlow:"row nowrap"},topPosition:{position:"relative",marginBottom:e.spacing(6),marginTop:-e.spacing(3),zIndex:"unset"},icon:{fontSize:e.typography.h6.fontSize},content:{width:"100%",maxWidth:"inherit",flexWrap:"nowrap"},message:{display:"flex",alignItems:"center",color:e.palette.banner.text,"& a":{color:e.palette.banner.link}},info:{backgroundColor:e.palette.banner.info},error:{backgroundColor:e.palette.banner.error},warning:{backgroundColor:(ae=e.palette.banner.warning)!==null&&ae!==void 0?ae:e.palette.banner.error}}),{name:"BackstageDismissableBanner"}),de=e=>{const{variant:s,message:a,id:d,fixed:p=!1}=e,v=O(),$=useApi(storageApiRef).forBucket("notifications");var K;const N=(K=$.snapshot("dismissedBanners").value)!==null&&K!==void 0?K:[],[pe,ie]=useState(new Set(N)),xe=useObservable($.observe$("dismissedBanners"));useEffect(()=>{if(xe!=null&&xe.value){var Ye;const qe=(Ye=xe==null?void 0:xe.value)!==null&&Ye!==void 0?Ye:[];ie(new Set(qe))}},[xe==null?void 0:xe.value]);const Te=()=>{$.set("dismissedBanners",[...pe,d])};return _jsx(Snackbar,{anchorOrigin:p?{vertical:"bottom",horizontal:"center"}:{vertical:"top",horizontal:"center"},open:!pe.has(d),classes:{root:classNames(v.root,!p&&v.topPosition)},children:_jsx(SnackbarContent,{classes:{root:classNames(v.content,v[s]),message:v.message},message:a,action:[_jsx(IconButton,{title:"Permanently dismiss this message",color:"inherit",onClick:Te,children:_jsx(Close,{className:v.icon})},"dismiss")]})})};var Be=t(60905),D=t.p+"static/missingAnnotation.67f79e98..svg",M=t.p+"static/noInformation.4b426325..svg",ue=t.p+"static/createComponent.975d1e1e..svg",fe=t.p+"static/noBuild.1715fa71..svg";const be=(0,c.Z)({generalImg:{width:"95%",zIndex:2,position:"relative",left:"50%",top:"50%",transform:"translate(-50%, 15%)"}},{name:"BackstageEmptyStateImage"}),$e=({missing:e})=>{const s=be();switch(e){case"field":return(0,r.jsx)("img",{src:D,className:s.generalImg,alt:"annotation is missing"});case"info":return(0,r.jsx)("img",{src:M,alt:"no Information",className:s.generalImg});case"content":return(0,r.jsx)("img",{src:ue,alt:"create Component",className:s.generalImg});case"data":return(0,r.jsx)("img",{src:fe,alt:"no Build",className:s.generalImg});default:return null}},Ae=(0,c.Z)(e=>({root:{backgroundColor:e.palette.background.default,padding:e.spacing(2,0,0,0)},action:{marginTop:e.spacing(2)},imageContainer:{position:"relative"}}),{name:"BackstageEmptyState"});function We(e){const{title:s,description:a,missing:d,action:p}=e,v=Ae();return(0,r.jsxs)(Be.Z,{container:!0,direction:"row",justifyContent:"space-around",alignItems:"flex-start",className:v.root,spacing:2,children:[(0,r.jsx)(Be.Z,{item:!0,xs:12,md:6,children:(0,r.jsxs)(Be.Z,{container:!0,direction:"column",children:[(0,r.jsx)(Be.Z,{item:!0,xs:!0,children:(0,r.jsx)(F.Z,{variant:"h5",children:s})}),(0,r.jsx)(Be.Z,{item:!0,xs:!0,children:(0,r.jsx)(F.Z,{variant:"body1",children:a})}),(0,r.jsx)(Be.Z,{item:!0,xs:!0,className:v.action,children:p})]})}),(0,r.jsx)(Be.Z,{item:!0,xs:12,md:6,className:v.imageContainer,children:typeof d=="string"?(0,r.jsx)($e,{missing:d}):d.customImage})]})}const rt=`apiVersion: backstage.io/v1alpha1
|
|
1
|
+
(()=>{(self.webpackChunktechdocs_cli_embedded_app=self.webpackChunktechdocs_cli_embedded_app||[]).push([[179],{29644:function(At,Fe,t){"use strict";t.d(Fe,{n3:function(){return g},MS:function(){return b}});var h=t(25271),r=t(23054),W=t(96279),k=t.n(W);const g=Symbol.for("CATALOG_FILTER_EXISTS_0e15b590c0b343a2bae3e787e84c2111");class b{async getEntityAncestors(P,te){const{kind:_,namespace:X,name:U}=(0,h.of)(P.entityRef);return await this.requestRequired("GET",`/entities/by-name/${encodeURIComponent(_)}/${encodeURIComponent(X)}/${encodeURIComponent(U)}/ancestry`,te)}async getLocationById(P,te){return await this.requestOptional("GET",`/locations/${encodeURIComponent(P)}`,te)}async getEntities(P,te){const{filter:_=[],fields:X=[],order:U,offset:F,limit:Y,after:ce}=P!=null?P:{},se=[];for(const A of[_].flat()){const C=[];for(const[z,Le]of Object.entries(A))for(const Xe of[Le].flat())Xe===g?C.push(encodeURIComponent(z)):typeof Xe=="string"&&C.push(`${encodeURIComponent(z)}=${encodeURIComponent(Xe)}`);C.length&&se.push(`filter=${C.join(",")}`)}if(X.length&&se.push(`fields=${X.map(encodeURIComponent).join(",")}`),U)for(const A of[U].flat())A&&se.push(`order=${encodeURIComponent(A.order)}:${encodeURIComponent(A.field)}`);F!==void 0&&se.push(`offset=${F}`),Y!==void 0&&se.push(`limit=${Y}`),ce!==void 0&&se.push(`after=${encodeURIComponent(ce)}`);const T=se.length?`?${se.join("&")}`:"",R=await this.requestRequired("GET",`/entities${T}`,te),V=(A,C)=>{var z,Le;if(((z=A.metadata)===null||z===void 0?void 0:z.name)===void 0||A.kind===void 0||((Le=C.metadata)===null||Le===void 0?void 0:Le.name)===void 0||C.kind===void 0)return 0;const Xe=(0,h.eE)(A),Qe=(0,h.eE)(C);return Xe<Qe?-1:Xe>Qe?1:0};return{items:R.sort(V)}}async getEntitiesByRefs(P,te){var _;const X={entityRefs:P.entityRefs};!((_=P.fields)===null||_===void 0)&&_.length&&(X.fields=P.fields);const F=`${await this.discoveryApi.getBaseUrl("catalog")}/entities/by-refs`,Y=await this.fetchApi.fetch(F,{headers:{"Content-Type":"application/json",...(te==null?void 0:te.token)&&{Authorization:`Bearer ${te==null?void 0:te.token}`}},method:"POST",body:JSON.stringify(X)});if(!Y.ok)throw await r.VL.fromResponse(Y);const{items:ce}=await Y.json();return{items:ce}}async getEntityByRef(P,te){const{kind:_,namespace:X,name:U}=(0,h.of)(P);return this.requestOptional("GET",`/entities/by-name/${encodeURIComponent(_)}/${encodeURIComponent(X)}/${encodeURIComponent(U)}`,te)}async getEntityByName(P,te){const{kind:_,namespace:X="default",name:U}=P;return this.requestOptional("GET",`/entities/by-name/${encodeURIComponent(_)}/${encodeURIComponent(X)}/${encodeURIComponent(U)}`,te)}async refreshEntity(P,te){const _=await this.fetchApi.fetch(`${await this.discoveryApi.getBaseUrl("catalog")}/refresh`,{headers:{"Content-Type":"application/json",...(te==null?void 0:te.token)&&{Authorization:`Bearer ${te==null?void 0:te.token}`}},method:"POST",body:JSON.stringify({entityRef:P})});if(_.status!==200)throw new Error(await _.text())}async getEntityFacets(P,te){const{filter:_=[],facets:X}=P,U=[];for(const Y of[_].flat()){const ce=[];for(const[se,T]of Object.entries(Y))for(const R of[T].flat())R===g?ce.push(encodeURIComponent(se)):typeof R=="string"&&ce.push(`${encodeURIComponent(se)}=${encodeURIComponent(R)}`);ce.length&&U.push(`filter=${ce.join(",")}`)}for(const Y of X)U.push(`facet=${encodeURIComponent(Y)}`);const F=U.length?`?${U.join("&")}`:"";return await this.requestOptional("GET",`/entity-facets${F}`,te)}async addLocation(P,te){const{type:_="url",target:X,dryRun:U}=P,F=await this.fetchApi.fetch(`${await this.discoveryApi.getBaseUrl("catalog")}/locations${U?"?dryRun=true":""}`,{headers:{"Content-Type":"application/json",...(te==null?void 0:te.token)&&{Authorization:`Bearer ${te==null?void 0:te.token}`}},method:"POST",body:JSON.stringify({type:_,target:X})});if(F.status!==201)throw new Error(await F.text());const{location:Y,entities:ce,exists:se}=await F.json();if(!Y)throw new Error(`Location wasn't added: ${X}`);return{location:Y,entities:ce,exists:se}}async getLocationByRef(P,te){return(await this.requestRequired("GET","/locations",te)).map(X=>X.data).find(X=>P===(0,h.NZ)(X))}async removeLocationById(P,te){await this.requestIgnored("DELETE",`/locations/${encodeURIComponent(P)}`,te)}async removeEntityByUid(P,te){await this.requestIgnored("DELETE",`/entities/by-uid/${encodeURIComponent(P)}`,te)}async validateEntity(P,te,_){const X=await this.fetchApi.fetch(`${await this.discoveryApi.getBaseUrl("catalog")}/validate-entity`,{headers:{"Content-Type":"application/json",...(_==null?void 0:_.token)&&{Authorization:`Bearer ${_==null?void 0:_.token}`}},method:"POST",body:JSON.stringify({entity:P,location:te})});if(X.ok)return{valid:!0};if(X.status!==400)throw await r.VL.fromResponse(X);const{errors:U=[]}=await X.json();return{valid:!1,errors:U}}async requestIgnored(P,te,_){const X=`${await this.discoveryApi.getBaseUrl("catalog")}${te}`,U=_!=null&&_.token?{Authorization:`Bearer ${_.token}`}:{},F=await this.fetchApi.fetch(X,{method:P,headers:U});if(!F.ok)throw await r.VL.fromResponse(F)}async requestRequired(P,te,_){const X=`${await this.discoveryApi.getBaseUrl("catalog")}${te}`,U=_!=null&&_.token?{Authorization:`Bearer ${_.token}`}:{},F=await this.fetchApi.fetch(X,{method:P,headers:U});if(!F.ok)throw await r.VL.fromResponse(F);return await F.json()}async requestOptional(P,te,_){const X=`${await this.discoveryApi.getBaseUrl("catalog")}${te}`,U=_!=null&&_.token?{Authorization:`Bearer ${_.token}`}:{},F=await this.fetchApi.fetch(X,{method:P,headers:U});if(!F.ok){if(F.status===404)return;throw await r.VL.fromResponse(F)}return await F.json()}constructor(P){this.discoveryApi=P.discoveryApi,this.fetchApi=P.fetchApi||{fetch:k()}}}},25271:function(At,Fe,t){"use strict";t.d(Fe,{Tf:function(){return W},P1:function(){return me},q1:function(){return ee},M6:function(){return Re},l2:function(){return r},zG:function(){return h},w$:function(){return In},nP:function(){return Fn},aS:function(){return zn},S4:function(){return en},cz:function(){return Mn},iB:function(){return vt},CV:function(){return wt},of:function(){return it},Ou:function(){return Ue},eE:function(){return gt},NZ:function(){return et}});const h="default",r="backstage.io/view-url",W="backstage.io/edit-url",k="kubernetes.io/api-server",g="kubernetes.io/api-server-certificate-authority",b="kubernetes.io/auth-provider";var c=t(76635),P=t.n(c);class te{async enforce(O){return O.metadata.namespace?O:lodash.merge({metadata:{namespace:this.namespace}},O)}constructor(O=DEFAULT_NAMESPACE){this.namespace=O}}class _{static isValidPrefixAndOrSuffix(O,ue,Be,D){if(typeof O!="string")return!1;const M=O.split(ue);return M.length===1?D(M[0]):M.length===2?Be(M[0])&&D(M[1]):!1}static isJsonSafe(O){try{return P().isEqual(O,JSON.parse(JSON.stringify(O)))}catch{return!1}}static isValidDnsSubdomain(O){return typeof O=="string"&&O.length>=1&&O.length<=253&&O.split(".").every(_.isValidDnsLabel)}static isValidDnsLabel(O){return typeof O=="string"&&O.length>=1&&O.length<=63&&/^[a-z0-9]+(\-[a-z0-9]+)*$/.test(O)}static isValidTag(O){return typeof O=="string"&&O.length>=1&&O.length<=63&&/^[a-z0-9+#]+(\-[a-z0-9+#]+)*$/.test(O)}static isValidUrl(O){if(typeof O!="string")return!1;try{return new URL(O),!0}catch{return!1}}static isValidString(O){var ue;return typeof O=="string"&&((ue=O==null?void 0:O.trim())===null||ue===void 0?void 0:ue.length)>=1}static isNonEmptyString(O){var ue;return typeof O=="string"&&((ue=O==null?void 0:O.trim())===null||ue===void 0?void 0:ue.length)>=1}}var X=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}}}}}'),U=t(27991),F=t.n(U),Y=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"}}}`),ce=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}}}}}}'),se=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 T=new Map,R=[X,Y,ce,se];function V(ae){if(!(ae!=null&&ae.length))throw new TypeError("Unknown error");const O=ae[0];throw new TypeError(`${O.instancePath||"<root>"} ${O.message}${O.params?` - ${Object.entries(O.params).map(([ue,Be])=>`${ue}: ${Be}`).join(", ")}`:""}`)}function A(ae,O={}){var ue;const Be=(ue=O==null?void 0:O.disableCache)!==null&&ue!==void 0?ue:!1,D=Be?"":JSON.stringify(ae);if(!Be){const be=T.get(D);if(be)return be}const M=C(ae),he=new(F())({allowUnionTypes:!0,allErrors:!0,validateSchema:!0});M.length&&he.addSchema(M,void 0,void 0,!0);const fe=he.compile(ae);return Be||T.set(D,fe),fe}function C(ae){if(typeof ae!="object")return[];const O=new Set;ae.$id&&O.add(ae.$id);const ue=new Array,Be=[ae];for(;Be.length;){const D=Be.pop();for(const M of z(D))if(!O.has(M)){O.add(M);const he=R.find(fe=>fe.$id===M);he&&(ue.push(he),Be.push(he))}}return ue}function*z(ae){const O=[ae];for(;O.length;){const ue=O.pop();if(typeof ue=="object"&&ue)for(const[Be,D]of Object.entries(ue))Be==="$ref"&&typeof D=="string"?yield D.split("#")[0]:O.push(D)}}function Le(ae){const O=compileAjvSchema(ae||entityEnvelopeSchema);return ue=>{if(O(ue)===!0)return ue;throw throwAjvError(O.errors)}}function Xe(ae){const O=A(ae);return ue=>{var Be;if(O(ue)===!0)return ue;const M=(Be=O.errors)===null||Be===void 0?void 0:Be.filter(he=>["/kind","/apiVersion"].includes(he.instancePath));if((M==null?void 0:M.length)&&M.every(he=>he.keyword==="enum"))return!1;throw V(O.errors)}}function Qe(ae){const O=compileAjvSchema(ae||entitySchema);return ue=>{if(O(ue)===!0)return ue;throw throwAjvError(O.errors)}}class _e{static isValidApiVersion(O){return _.isValidPrefixAndOrSuffix(O,"/",_.isValidDnsSubdomain,ue=>ue.length>=1&&ue.length<=63&&/^[a-z0-9A-Z]+$/.test(ue))}static isValidKind(O){return typeof O=="string"&&O.length>=1&&O.length<=63&&/^[a-zA-Z][a-z0-9A-Z]*$/.test(O)}static isValidObjectName(O){return typeof O=="string"&&O.length>=1&&O.length<=63&&/^([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9]$/.test(O)}static isValidNamespace(O){return _.isValidDnsLabel(O)}static isValidLabelKey(O){return _.isValidPrefixAndOrSuffix(O,"/",_.isValidDnsSubdomain,_e.isValidObjectName)}static isValidLabelValue(O){return O===""||_e.isValidObjectName(O)}static isValidAnnotationKey(O){return _.isValidPrefixAndOrSuffix(O,"/",_.isValidDnsSubdomain,_e.isValidObjectName)}static isValidAnnotationValue(O){return typeof O=="string"}}const Ge={isValidApiVersion:_e.isValidApiVersion,isValidKind:_e.isValidKind,isValidEntityName:_e.isValidObjectName,isValidNamespace:_e.isValidNamespace,isValidLabelKey:_e.isValidLabelKey,isValidLabelValue:_e.isValidLabelValue,isValidAnnotationKey:_e.isValidAnnotationKey,isValidAnnotationValue:_e.isValidAnnotationValue,isValidTag:ae=>typeof ae=="string"&&ae.length>=1&&ae.length<=63&&/^[a-z0-9:+#]+(\-[a-z0-9:+#]+)*$/.test(ae)};function mt(ae={}){return{...Ge,...ae}}class Ee{async enforce(O){function ue(S,K,ge){if(K==null)throw new Error(`${S} must have a value`);let de;try{de=ge(K)}catch(Ce){throw new Error(`${S} could not be validated, ${Ce}`)}if(!de){let Ce;switch(ge.name){case"isValidLabelValue":case"isValidObjectName":Ce="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":Ce="a valid prefix and/or suffix";break;case"isValidNamespace":case"isValidDnsLabel":Ce="a string that is sequences of [a-z0-9] separated by [-], at most 63 characters in total";break;case"isValidTag":Ce="a string that is sequences of [a-z0-9+#] separated by [-], at most 63 characters in total";break;case"isValidAnnotationValue":Ce="a string";break;case"isValidKind":Ce="a string that is a sequence of [a-zA-Z][a-z0-9A-Z], at most 63 characters in total";break;case"isValidUrl":Ce="a string that is a valid url";break;case"isValidString":case"isNonEmptyString":Ce="a non empty string";break;default:Ce=void 0;break}const Oe=Ce?` expected ${Ce} but found "${K}".`:"";throw new Error(`"${S}" is not valid;${Oe} 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 Be(S,K,ge){return K===void 0||ue(S,K,ge)}ue("apiVersion",O.apiVersion,this.validators.isValidApiVersion),ue("kind",O.kind,this.validators.isValidKind),ue("metadata.name",O.metadata.name,this.validators.isValidEntityName),Be("metadata.namespace",O.metadata.namespace,this.validators.isValidNamespace);var D;for(const[S,K]of Object.entries((D=O.metadata.labels)!==null&&D!==void 0?D:[]))ue(`labels.${S}`,S,this.validators.isValidLabelKey),ue(`labels.${S}`,K,this.validators.isValidLabelValue);var M;for(const[S,K]of Object.entries((M=O.metadata.annotations)!==null&&M!==void 0?M:[]))ue(`annotations.${S}`,S,this.validators.isValidAnnotationKey),ue(`annotations.${S}`,K,this.validators.isValidAnnotationValue);var he;const fe=(he=O.metadata.tags)!==null&&he!==void 0?he:[];for(let S=0;S<fe.length;++S)ue(`tags.${S}`,fe[S],this.validators.isValidTag);var be;const $e=(be=O.metadata.links)!==null&&be!==void 0?be:[];for(let S=0;S<$e.length;++S){var Ae,We,st;ue(`links.${S}.url`,(Ae=$e[S])===null||Ae===void 0?void 0:Ae.url,CommonValidatorFunctions.isValidUrl),Be(`links.${S}.title`,(We=$e[S])===null||We===void 0?void 0:We.title,CommonValidatorFunctions.isNonEmptyString),Be(`links.${S}.icon`,(st=$e[S])===null||st===void 0?void 0:st.icon,KubernetesValidatorFunctions.isValidObjectName)}return O}constructor(O=makeValidator()){this.validators=O}}class Ke{async enforce(O){if(!this.validate){const D=new Ajv({allowUnionTypes:!0});this.validate=D.addSchema([commonSchema,entityMetaSchema],void 0,void 0,!0).compile(entitySchema)}if(this.validate(O)===!0)return O;const[Be]=this.validate.errors||[];throw Be?new Error(`Malformed envelope, ${Be.instancePath||"<root>"} ${Be.message}`):new Error("Malformed envelope, Unknown error")}}function at(ae){let O=ae.indexOf(":");const ue=ae.indexOf("/");ue!==-1&&ue<O&&(O=-1);const Be=O===-1?void 0:ae.slice(0,O),D=ue===-1?void 0:ae.slice(O+1,ue),M=ae.slice(Math.max(O+1,ue+1));if(Be===""||D===""||M==="")throw new TypeError(`Entity reference "${ae}" was not on the form [<kind>:][<namespace>/]<name>`);return{kind:Be,namespace:D,name:M}}function vt(ae){return{kind:ae.kind,namespace:ae.metadata.namespace||h,name:ae.metadata.name}}function it(ae,O){if(!ae)throw new Error("Entity reference must not be empty");const ue=O==null?void 0:O.defaultKind,Be=(O==null?void 0:O.defaultNamespace)||h;let D,M,he;if(typeof ae=="string"){const We=at(ae);var fe;D=(fe=We.kind)!==null&&fe!==void 0?fe:ue;var be;M=(be=We.namespace)!==null&&be!==void 0?be:Be,he=We.name}else{var $e;D=($e=ae.kind)!==null&&$e!==void 0?$e:ue;var Ae;M=(Ae=ae.namespace)!==null&&Ae!==void 0?Ae:Be,he=ae.name}if(D)if(M){if(!he){const We=JSON.stringify(ae);throw new Error(`Entity reference ${We} had missing or empty name`)}}else{const We=JSON.stringify(ae);throw new Error(`Entity reference ${We} had missing or empty namespace`)}else{const We=JSON.stringify(ae);throw new Error(`Entity reference ${We} had missing or empty kind (e.g. did not start with "component:" or similar)`)}return{kind:D,namespace:M,name:he}}function gt(ae){let O,ue,Be;if("metadata"in ae){O=ae.kind;var D;ue=(D=ae.metadata.namespace)!==null&&D!==void 0?D:h,Be=ae.metadata.name}else{O=ae.kind;var M;ue=(M=ae.namespace)!==null&&M!==void 0?M:h,Be=ae.name}return`${O.toLocaleLowerCase("en-US")}:${ue.toLocaleLowerCase("en-US")}/${Be.toLocaleLowerCase("en-US")}`}class nt{async enforce(O){let ue=O;for(const Be of this.policies){const D=await Be.enforce(ue);if(!D)throw new Error(`Policy ${Be.constructor.name} did not return a result`);ue=D}return ue}constructor(O){this.policies=O}}class Lt{async enforce(O){for(const ue of this.policies){const Be=await ue.enforce(O);if(Be)return Be}throw new Error("The entity did not match any known policy")}constructor(O){this.policies=O}}const bt={allOf(ae){return new nt(ae)},oneOf(ae){return new Lt(ae)}};var ze=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 ne(ae){let O;return{async check(ue){return O||(O=Xe(ae)),O(ue)===ue}}}const Pe=ne(ze);var ke=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 tt=ne(ke);var yt=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 Zt=ne(yt);var pt=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 Tt=ne(pt);var It=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 Ot=ne(It),en="ownedBy",Wt="ownerOf",Vt="consumesApi",Qt="apiConsumedBy",un="providesApi",cn="apiProvidedBy",Fn="dependsOn",In="dependencyOf",Un="parentOf",vn="childOf",hn="memberOf",Xt="hasMember",Mn="partOf",zn="hasPart";var pn=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 yn=ne(pn);var xn=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 kn=ne(xn);var On=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 bn=ne(On),me="backstage.io/managed-by-location",ee="backstage.io/managed-by-origin-location",Re="backstage.io/source-location";function Ue(ae){if(typeof ae!="string")throw new TypeError(`Unable to parse location ref '${ae}', unexpected argument ${typeof ae}`);const O=ae.indexOf(":");if(O<0)throw new TypeError(`Unable to parse location ref '${ae}', expected '<type>:<target>', e.g. 'url:https://host/path'`);const ue=ae.substring(0,O).trim(),Be=ae.substring(O+1).trim();if(!ue||!Be)throw new TypeError(`Unable to parse location ref '${ae}', expected '<type>:<target>', e.g. 'url:https://host/path'`);if(ue==="http"||ue==="https")throw new TypeError(`Invalid location ref '${ae}', please prefix it with 'url:', e.g. 'url:${ae}'`);return{type:ue,target:Be}}function et(ae){const{type:O,target:ue}=ae;if(O){if(!ue)throw new TypeError("Unable to stringify location ref, empty target")}else throw new TypeError("Unable to stringify location ref, empty type");return`${O}:${ue}`}function wt(ae){var O,ue,Be,D,M;const he=(M=(O=ae.metadata)===null||O===void 0||(ue=O.annotations)===null||ue===void 0?void 0:ue[Re])!==null&&M!==void 0?M:(Be=ae.metadata)===null||Be===void 0||(D=Be.annotations)===null||D===void 0?void 0:D[me];if(!he)throw new Error(`Entity '${gt(ae)}' is missing location`);return Ue(he)}},93414:function(At,Fe,t){"use strict";t.d(Fe,{zx:function(){return mt},Oi:function(){return ne},VY:function(){return Mi},yW:function(){return qa},XF:function(){return tt},mn:function(){return wt},NX:function(){return h},ub:function(){return We},mf:function(){return rl},yu:function(){return fn},h4:function(){return qi},M6:function(){return hr},i9:function(){return fl},aR:function(){return zi},rJ:function(){return wr},Oh:function(){return bl},hu:function(){return vl},rU:function(){return _e},nU:function(){return fs},sk:function(){return ht},Or:function(){return Zr},T3:function(){return _i},g9:function(){return wl},Ex:function(){return Cs},Gk:function(){return w},tn:function(){return Wi},Ph:function(){return Ze},YE:function(){return qo},v7:function(){return Ar},R6:function(){return vo},tR:function(){return Qo},uw:function(){return ja},qt:function(){return Ri},iA:function(){return Xi},GB:function(){return Cn},po:function(){return lr},mZ:function(){return so},Pf:function(){return Ur}});var h={};t.r(h),t.d(h,{Nm:function(){return yt},ht:function(){return Tt},LJ:function(){return pt}});var r=t(52322),W=t(25248),k=t(19928),g=t(2784);function b(e){const[s,a]=useState([]),d=useApi(alertApiRef),{anchorOrigin:p={vertical:"top",horizontal:"center"},transientTimeoutMs:v}=e,j=v!=null?v:5e3;useEffect(()=>{const N=d.alert$().subscribe(pe=>a(oe=>oe.concat(pe)));return()=>{N.unsubscribe()}},[d]);const[$]=s;if(useEffect(()=>{if($&&$.display==="transient"){const N=setTimeout(()=>{a(pe=>{const oe=pe.filter(xe=>xe!==$);return oe.length===pe.length?pe:oe})},j);return()=>clearTimeout(N)}},[$,j]),s.length===0)return null;const G=()=>{a(N=>N.filter(pe=>pe!==$))};return _jsx(Snackbar,{open:!0,anchorOrigin:p,children:_jsx(Alert,{action:_jsx(IconButton,{color:"inherit",size:"small",onClick:G,"data-testid":"error-button-close",children:_jsx(CloseIcon,{})}),severity:$.severity,children:_jsxs(Typography,{component:"span",children:[String($.message),s.length>1&&_jsx("em",{children:` (${s.length-1} older ${pluralize("message",s.length-1)})`})]})})})}var c=t(79692),P=t(12420);const te=(0,c.Z)(e=>(0,P.Z)({avatar:{width:"4rem",height:"4rem",color:"#fff"},avatarText:{fontWeight:e.typography.fontWeightBold,letterSpacing:"1px",textTransform:"uppercase"}}),{name:"BackstageAvatar"});function _(e){const{displayName:s,picture:a,customStyles:d}=e,p=te();let v={...d};const j={fontFamily:v.fontFamily,fontSize:v.fontSize,fontWeight:v.fontWeight};return a||(v={backgroundColor:stringToColor(s||""),...d}),_jsx(MaterialAvatar,{alt:s,src:a,className:p.avatar,style:v,children:s&&_jsx(Typography,{variant:"h6",component:"span",className:p.avatarText,style:j,children:extractInitials(s)})})}var X=t(77277),U=t(86689),F=t(90436),Y=t(72779),ce=t.n(Y),se=t(76635),T=t(79635),R=t(39857);function V(){const[e]=(0,T.is)((0,r.jsx)(T.AW,{index:!0,element:(0,r.jsx)("div",{})}));return!e.index}const A=(0,c.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"}),C=e=>/^([a-z+.-]+):/.test(e),z=()=>{try{return(0,W.h_)(W.Ds).getOptionalString("app.baseUrl")}catch{return}},Le=()=>{const e="http://sample.dev";var s;const a=(s=z())!==null&&s!==void 0?s:"/",{pathname:d}=new URL(a,e);return(0,se.trimEnd)(d,"/")},Xe=e=>{let s=String(e);const a=Le(),d=C(s),p=s.startsWith(a);return!d&&!p&&(s=a.concat(s)),s},Qe=e=>{if(e instanceof Array)return e.map(Qe).join(" ").trim();if(typeof e=="object"&&e){var s;return Qe(e==null||(s=e.props)===null||s===void 0?void 0:s.children)}return["string","number"].includes(typeof e)?String(e):""},_e=g.forwardRef(({onClick:e,noTrack:s,...a},d)=>{const p=A(),v=(0,W.z$)(),j=V()?Xe(a.to):a.to,$=Qe(a.children)||j,G=C(j),N=G&&!!/^https?:/.exec(j),pe=oe=>{e==null||e(oe),s||v.captureEvent("click",$,{attributes:{to:j}})};return G?(0,r.jsxs)(U.Z,{...N?{target:"_blank",rel:"noopener"}:{},...a,ref:d,href:j,onClick:pe,className:ce()(p.externalLink,a.className),children:[a.children,(0,r.jsx)(F.Z,{component:"span",className:p.visuallyHidden,children:", Opens in a new window"})]}):(0,r.jsx)(U.Z,{...a,ref:d,component:R.rU,to:j,onClick:pe})}),Ge=g.forwardRef((e,s)=>(0,r.jsx)(_e,{ref:s,...e,color:"initial"})),mt=g.forwardRef((e,s)=>(0,r.jsx)(X.Z,{ref:s,component:Ge,...e}));var Ee=t(95544),Ke=t(60364),at=t(83229),vt=t(26639),it=t(39595),gt=t(61837),nt=t(80030),Lt=t(19353),bt=t(95074);function ze(e){const{text:s,tooltipDelay:a=1e3,tooltipText:d="Text copied to clipboard","aria-label":p="Copy text"}=e,v=(0,W.h_)(W.VE),[j,$]=(0,g.useState)(!1),[{error:G},N]=(0,bt.Z)();(0,g.useEffect)(()=>{G&&v.post(G)},[G,v]);const pe=oe=>{oe.stopPropagation(),$(!0),N(s)};return(0,r.jsx)(r.Fragment,{children:(0,r.jsx)(nt.ZP,{id:"copy-test-tooltip",title:d,placement:"top",leaveDelay:a,onClose:()=>$(!1),open:j,children:(0,r.jsx)(gt.Z,{onClick:pe,"aria-label":p,children:(0,r.jsx)(Lt.Z,{})})})})}function ne(e){const{text:s,language:a,showLineNumbers:d=!1,highlightedNumbers:p,customStyle:v,showCopyCodeButton:j=!1}=e,$=(0,Ke.Z)(),G=$.palette.type==="dark"?vt.Z:it.Z,N=$.palette.type==="dark"?"#256bf3":"#e6ffed";return(0,r.jsxs)(Ee.Z,{position:"relative",children:[(0,r.jsx)(at.Z,{customStyle:v,language:a,style:G,showLineNumbers:d,wrapLines:!0,lineNumberStyle:{color:$.palette.textVerySubtle},lineProps:pe=>p!=null&&p.includes(pe)?{style:{backgroundColor:N}}:{},children:s}),j&&(0,r.jsx)(Ee.Z,{position:"absolute",top:0,right:0,children:(0,r.jsx)(ze,{text:s})})]})}var Pe=t(41156),ke=t(88188);function tt(e){const{title:s,to:a}=e,d=(0,Pe.Z)(p=>p.breakpoints.down("xs"));return a?d?(0,r.jsx)(gt.Z,{component:R.rU,color:"primary",title:s,size:"small",to:a,children:(0,r.jsx)(ke.Z,{})}):(0,r.jsx)(X.Z,{component:R.rU,variant:"contained",color:"primary",to:a,children:s}):null}var yt;(function(e){e.TOP_BOTTOM="TB",e.BOTTOM_TOP="BT",e.LEFT_RIGHT="LR",e.RIGHT_LEFT="RL"})(yt||(yt={}));var Zt;(function(e){e.UP_LEFT="UL",e.UP_RIGHT="UR",e.DOWN_LEFT="DL",e.DOWN_RIGHT="DR"})(Zt||(Zt={}));var pt;(function(e){e.NETWORK_SIMPLEX="network-simplex",e.TIGHT_TREE="tight-tree",e.LONGEST_PATH="longest-path"})(pt||(pt={}));var Tt;(function(e){e.LEFT="l",e.RIGHT="r",e.CENTER="c"})(Tt||(Tt={}));var It=t(27397),Ot=t(11105),en=t(97963),Wt=t(46506),Vt=t.n(Wt),Qt=t(54073),un=t.n(Qt),cn=t(10368);const Fn=(0,c.Z)(e=>({node:{fill:e.palette.primary.light,stroke:e.palette.primary.light},text:{fill:e.palette.primary.contrastText}}),{name:"BackstageDependencyGraphDefaultNode"});function In({node:{id:e}}){const s=Fn(),[a,d]=g.useState(0),[p,v]=g.useState(0),j=g.useRef(null);g.useLayoutEffect(()=>{if(j.current){let{height:pe,width:oe}=j.current.getBBox();pe=Math.round(pe),oe=Math.round(oe),(pe!==p||oe!==a)&&(d(oe),v(pe))}},[a,p]);const $=10,G=a+$*2,N=p+$*2;return(0,r.jsxs)("g",{children:[(0,r.jsx)("rect",{className:s.node,width:G,height:N,rx:10}),(0,r.jsx)("text",{ref:j,className:s.text,y:N/2,x:G/2,textAnchor:"middle",alignmentBaseline:"middle",children:e})]})}const Un="arrow-marker",vn="node",hn="edge",Xt="label",Mn=(0,cn.Z)(e=>({node:{transition:`${e.transitions.duration.shortest}ms`}}),{name:"BackstageDependencyGraphNode"}),zn=e=>(0,r.jsx)(In,{...e});function pn({render:e=zn,setNode:s,node:a}){const{width:d,height:p,x:v=0,y:j=0}=a,$=a,G=Mn(),N=g.useRef(null);return g.useLayoutEffect(()=>{if(N.current){let{height:pe,width:oe}=N.current.getBBox();pe=Math.round(pe),oe=Math.round(oe),(pe!==p||oe!==d)&&s(a.id,{...a,height:pe,width:oe})}},[a,d,p,s]),(0,r.jsx)("g",{ref:N,"data-testid":vn,className:G.node,transform:`translate(${v-d/2},${j-p/2})`,children:e({node:$})})}var yn=t(76985),xn=t(39829),kn=t(19574),On=t.n(kn);const bn=(0,cn.Z)(e=>({text:{fill:e.palette.textContrast}}),{name:"BackstageDependencyGraphDefaultLabel"});function me({edge:{label:e}}){const s=bn();return(0,r.jsx)("text",{className:s.text,textAnchor:"middle",children:e})}const ee=(0,cn.Z)(e=>({path:{strokeWidth:1,stroke:e.palette.textSubtle,fill:"none",transition:`${e.transitions.duration.shortest}ms`},label:{transition:`${e.transitions.duration.shortest}ms`}}),{name:"BackstageDependencyGraphEdge"}),Re=e=>(0,r.jsx)(me,{...e});function Ue({render:e=Re,setEdge:s,id:a,edge:d,curve:p}){const{x:v=0,y:j=0,width:$,height:G,points:N}=d,pe=d,oe=ee(),xe=g.useRef(null);g.useLayoutEffect(()=>{if(xe.current){let{height:qe,width:Pt}=xe.current.getBBox();qe=Math.round(qe),Pt=Math.round(Pt),(qe!==G||Pt!==$)&&s(a,{...d,height:qe,width:Pt})}},[d,G,$,s,a]);let Ie="";const Ye=g.useMemo(()=>yn.Z().x(qe=>qe.x).y(qe=>qe.y).curve(xn[p]),[p]);if(N){const qe=N.filter(Pt=>On()(Pt.x)&&On()(Pt.y));Ie=Ye(qe)||""}return(0,r.jsxs)(r.Fragment,{children:[Ie&&(0,r.jsx)("path",{"data-testid":hn,className:oe.path,d:Ie}),pe.label?(0,r.jsx)("g",{ref:xe,"data-testid":Xt,className:oe.label,transform:`translate(${v},${j})`,children:e({edge:pe})}):null]})}const et="workspace";function wt(e){var s,a;const{edges:d,nodes:p,renderNode:v,direction:j=yt.TOP_BOTTOM,align:$,nodeMargin:G=50,edgeMargin:N=10,rankMargin:pe=50,paddingX:oe=0,paddingY:xe=0,acyclicer:Ie,ranker:Ye=pt.NETWORK_SIMPLEX,labelPosition:qe=Tt.RIGHT,labelOffset:Pt=10,edgeRanks:Kt=1,edgeWeight:tn=1,renderLabel:nn,defs:kt,zoom:_t="enabled",curve:Yt="curveMonotoneX",fit:vr="grow",...yr}=e,xr=(0,en.Z)(),[br,ai]=g.useState(100),[Tr,li]=g.useState(100),Jt=g.useRef(new(Vt()).graphlib.Graph),[ds,So]=g.useState(((s=Jt.current.graph())===null||s===void 0?void 0:s.width)||0),[Ir,ci]=g.useState(((a=Jt.current.graph())===null||a===void 0?void 0:a.height)||0),[Dn,cr]=g.useState([]),[Mr,zr]=g.useState([]),an=Math.max(ds,br),mn=Math.max(Ir,Tr),us=Math.min(Ir,Tr),Wr=vr==="grow"?mn:us,Ns=g.useMemo(()=>un()(dn=>{if(!dn)return;const Nn=Ot.Z(dn),ln=Ot.Z(dn.getElementById(et));function rr(){Nn.call(It.sP().scaleExtent([1,10]).on("zoom",Sr=>{Sr.transform.x=Math.min(0,Math.max(Sr.transform.x,an-an*Sr.transform.k)),Sr.transform.y=Math.min(0,Math.max(Sr.transform.y,mn-mn*Sr.transform.k)),ln.attr("transform",Sr.transform)}))}_t==="enabled"?rr():_t==="enable-on-click"&&Nn.on("click",()=>rr());const{width:sr,height:Co}=dn.getBoundingClientRect();br!==sr&&ai(sr),Tr!==Co&&li(Co)},100),[Tr,br,an,mn,_t]),ia=g.useCallback(()=>{const dn=Jt.current.nodes(),Nn=Jt.current.edges();dn.forEach(ln=>{p.some(sr=>sr.id===ln)||Jt.current.removeNode(ln)}),Nn.forEach(ln=>{d.some(sr=>sr.from===ln.v&&sr.to===ln.w)||Jt.current.removeEdge(ln.v,ln.w)}),p.forEach(ln=>{const rr=Jt.current.nodes().find(sr=>ln.id===sr);if(rr&&Jt.current.node(rr)){const{width:sr,height:Co,x:Sr,y:zl}=Jt.current.node(rr);Jt.current.setNode(rr,{...ln,width:sr,height:Co,x:Sr,y:zl})}else Jt.current.setNode(ln.id,{...ln,width:0,height:0})}),d.forEach(ln=>{Jt.current.setEdge(ln.from,ln.to,{...ln,label:ln.label,width:0,height:0,labelpos:qe,labeloffset:Pt,weight:tn,minlen:Kt})})},[d,p,qe,Pt,tn,Kt]),Fs=g.useMemo(()=>un()(()=>{Vt().layout(Jt.current);const{height:dn,width:Nn}=Jt.current.graph(),ln=Math.max(0,dn||0),rr=Math.max(0,Nn||0);So(rr),ci(ln),cr(Jt.current.nodes()),zr(Jt.current.edges())},250,{leading:!0}),[]);g.useEffect(()=>(Jt.current.setGraph({rankdir:j,align:$,nodesep:G,edgesep:N,ranksep:pe,marginx:oe,marginy:xe,acyclicer:Ie,ranker:Ye}),ia(),Fs(),Fs.cancel),[Ie,$,j,N,oe,xe,G,pe,Ye,ia,Fs]);function Ul(dn,Nn){return Jt.current.setNode(dn,Nn),Fs(),Jt.current}function Ml(dn,Nn){return Jt.current.setEdge(dn,Nn),Fs(),Jt.current}return(0,r.jsxs)("svg",{ref:Ns,...yr,width:"100%",height:Wr,viewBox:`0 0 ${an} ${mn}`,children:[(0,r.jsxs)("defs",{children:[(0,r.jsx)("marker",{id:Un,viewBox:"0 0 24 24",markerWidth:"14",markerHeight:"14",refX:"16",refY:"12",orient:"auto",markerUnits:"strokeWidth",children:(0,r.jsx)("path",{fill:xr.palette.textSubtle,d:"M8.59 16.59L13.17 12 8.59 7.41 10 6l6 6-6 6-1.41-1.41z"})}),kt]}),(0,r.jsx)("g",{id:et,children:(0,r.jsxs)("svg",{width:ds,height:Ir,y:mn/2-Ir/2,x:an/2-ds/2,viewBox:`0 0 ${ds} ${Ir}`,children:[Mr.map(dn=>{const Nn=Jt.current.edge(dn);return Nn?(0,r.jsx)(Ue,{id:dn,setEdge:Ml,render:nn,edge:Nn,curve:Yt},`${dn.v}-${dn.w}`):null}),Dn.map(dn=>{const Nn=Jt.current.node(dn);return Nn?(0,r.jsx)(pn,{setNode:Ul,render:v,node:Nn},dn):null})]})})]})}var ae;const O=(0,c.Z)(e=>({root:{padding:e.spacing(0),marginBottom:e.spacing(0),marginTop:e.spacing(0),display:"flex",flexFlow:"row nowrap"},topPosition:{position:"relative",marginBottom:e.spacing(6),marginTop:-e.spacing(3),zIndex:"unset"},icon:{fontSize:e.typography.h6.fontSize},content:{width:"100%",maxWidth:"inherit",flexWrap:"nowrap"},message:{display:"flex",alignItems:"center",color:e.palette.banner.text,"& a":{color:e.palette.banner.link}},info:{backgroundColor:e.palette.banner.info},error:{backgroundColor:e.palette.banner.error},warning:{backgroundColor:(ae=e.palette.banner.warning)!==null&&ae!==void 0?ae:e.palette.banner.error}}),{name:"BackstageDismissableBanner"}),ue=e=>{const{variant:s,message:a,id:d,fixed:p=!1}=e,v=O(),$=useApi(storageApiRef).forBucket("notifications");var G;const N=(G=$.snapshot("dismissedBanners").value)!==null&&G!==void 0?G:[],[pe,oe]=useState(new Set(N)),xe=useObservable($.observe$("dismissedBanners"));useEffect(()=>{if(xe!=null&&xe.value){var Ye;const qe=(Ye=xe==null?void 0:xe.value)!==null&&Ye!==void 0?Ye:[];oe(new Set(qe))}},[xe==null?void 0:xe.value]);const Ie=()=>{$.set("dismissedBanners",[...pe,d])};return _jsx(Snackbar,{anchorOrigin:p?{vertical:"bottom",horizontal:"center"}:{vertical:"top",horizontal:"center"},open:!pe.has(d),classes:{root:classNames(v.root,!p&&v.topPosition)},children:_jsx(SnackbarContent,{classes:{root:classNames(v.content,v[s]),message:v.message},message:a,action:[_jsx(IconButton,{title:"Permanently dismiss this message",color:"inherit",onClick:Ie,children:_jsx(Close,{className:v.icon})},"dismiss")]})})};var Be=t(60905),D=t.p+"static/missingAnnotation.67f79e98..svg",M=t.p+"static/noInformation.4b426325..svg",he=t.p+"static/createComponent.975d1e1e..svg",fe=t.p+"static/noBuild.1715fa71..svg";const be=(0,c.Z)({generalImg:{width:"95%",zIndex:2,position:"relative",left:"50%",top:"50%",transform:"translate(-50%, 15%)"}},{name:"BackstageEmptyStateImage"}),$e=({missing:e})=>{const s=be();switch(e){case"field":return(0,r.jsx)("img",{src:D,className:s.generalImg,alt:"annotation is missing"});case"info":return(0,r.jsx)("img",{src:M,alt:"no Information",className:s.generalImg});case"content":return(0,r.jsx)("img",{src:he,alt:"create Component",className:s.generalImg});case"data":return(0,r.jsx)("img",{src:fe,alt:"no Build",className:s.generalImg});default:return null}},Ae=(0,c.Z)(e=>({root:{backgroundColor:e.palette.background.default,padding:e.spacing(2,0,0,0)},action:{marginTop:e.spacing(2)},imageContainer:{position:"relative"}}),{name:"BackstageEmptyState"});function We(e){const{title:s,description:a,missing:d,action:p}=e,v=Ae();return(0,r.jsxs)(Be.Z,{container:!0,direction:"row",justifyContent:"space-around",alignItems:"flex-start",className:v.root,spacing:2,children:[(0,r.jsx)(Be.Z,{item:!0,xs:12,md:6,children:(0,r.jsxs)(Be.Z,{container:!0,direction:"column",children:[(0,r.jsx)(Be.Z,{item:!0,xs:!0,children:(0,r.jsx)(F.Z,{variant:"h5",children:s})}),(0,r.jsx)(Be.Z,{item:!0,xs:!0,children:(0,r.jsx)(F.Z,{variant:"body1",children:a})}),(0,r.jsx)(Be.Z,{item:!0,xs:!0,className:v.action,children:p})]})}),(0,r.jsx)(Be.Z,{item:!0,xs:12,md:6,className:v.imageContainer,children:typeof d=="string"?(0,r.jsx)($e,{missing:d}):d.customImage})]})}const st=`apiVersion: backstage.io/v1alpha1
|
|
2
2
|
kind: Component
|
|
3
3
|
metadata:
|
|
4
4
|
name: example
|
|
@@ -8,11 +8,11 @@ metadata:
|
|
|
8
8
|
spec:
|
|
9
9
|
type: website
|
|
10
10
|
lifecycle: production
|
|
11
|
-
owner: user:guest`,S=/^.*ANNOTATION.*$/m,
|
|
12
|
-
`).findIndex(e=>S.test(e)),
|
|
13
|
-
`);return
|
|
14
|
-
`),
|
|
15
|
-
`),Ye=JSON.stringify(j,void 0,2);return(0,r.jsxs)(fn,{title:a!=null?a:d.message,defaultExpanded:p,error:{name:pe,message:xe,stack:
|
|
11
|
+
owner: user:guest`,S=/^.*ANNOTATION.*$/m,K=st.match(S)[0],ge=st.split(`
|
|
12
|
+
`).findIndex(e=>S.test(e)),de=(0,c.Z)(e=>({code:{borderRadius:6,margin:`${e.spacing(2)}px 0px`,background:e.palette.type==="dark"?"#444":"#fff"}}),{name:"BackstageMissingAnnotationEmptyState"});function Ce(e){return Array.from(Array(e+1).keys(),s=>s+ge)}function Oe(e){const s=e.map(a=>K.replace("ANNOTATION",a)).join(`
|
|
13
|
+
`);return st.replace(K,s)}function Me(e){const s=e.length<=1;return(0,r.jsxs)(r.Fragment,{children:["The ",s?"annotation":"annotations"," ",e.map(a=>(0,r.jsx)("code",{children:a})).reduce((a,d)=>(0,r.jsxs)(r.Fragment,{children:[a,", ",d]}))," ",s?"is":"are"," missing. You need to add the"," ",s?"annotation":"annotations"," to your component if you want to enable this tool."]})}function ht(e){const{annotation:s,readMoreUrl:a}=e,d=Array.isArray(s)?s:[s],p=a||"https://backstage.io/docs/features/software-catalog/well-known-annotations",v=de();return(0,r.jsx)(We,{missing:"field",title:"Missing Annotation",description:Me(d),action:(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(F.Z,{variant:"body1",children:"Add the annotation to your component YAML as shown in the highlighted example below:"}),(0,r.jsx)(Ee.Z,{className:v.code,children:(0,r.jsx)(ne,{text:Oe(d),language:"yaml",showLineNumbers:!0,highlightedNumbers:Ce(d.length),customStyle:{background:"inherit",fontSize:"115%"}})}),(0,r.jsx)(X.Z,{color:"primary",component:_e,to:p,children:"Read more"})]})})}var jt=t(11776),lt=t(38402),ft=t(49378),xt=t(41128),ct=t(27616),Bt=t(8284),Mt=t(70660),zt=t(91750),qt=t(38016);const Wn=(e,s)=>(s.palette.type==="light"?xt._j:xt.$n)(s.palette[e].light,.6),Sn=(e,s)=>(s.palette.type==="light"?xt.$n:xt._j)(s.palette[e].light,.9),Dt=(0,c.Z)(e=>({root:{marginRight:e.spacing(1),fill:({severity:s})=>Wn(s,e)}})),Nt=({severity:e})=>{const s=Dt({severity:e});return(0,r.jsx)(zt.Z,{classes:s})},rn=({severity:e})=>{const s=Dt({severity:e});return(0,r.jsx)(qt.Z,{classes:s})},Bn=(0,c.Z)(e=>({panel:{backgroundColor:({severity:s})=>Sn(s,e),color:({severity:s})=>Wn(s,e),verticalAlign:"middle"},summary:{display:"flex",flexDirection:"row"},summaryText:{color:({severity:s})=>Wn(s,e),fontWeight:e.typography.fontWeightBold},message:{width:"100%",display:"block",color:({severity:s})=>Wn(s,e),backgroundColor:({severity:s})=>Sn(s,e)},details:{width:"100%",display:"block",color:e.palette.textContrast,backgroundColor:e.palette.background.default,border:`1px solid ${e.palette.border}`,padding:e.spacing(2),fontFamily:"sans-serif"}}),{name:"BackstageWarningPanel"}),Xn=e=>e.charAt(0).toLocaleUpperCase("en-US")+e.slice(1);function Cn(e){const{severity:s="warning",title:a,message:d,children:p,defaultExpanded:v}=e,j=Bn({severity:s}),$=Xn(s)+(a?`: ${a}`:"");return(0,r.jsxs)(ct.Z,{defaultExpanded:v!=null?v:!1,className:j.panel,role:"alert",children:[(0,r.jsxs)(Bt.Z,{expandIcon:(0,r.jsx)(rn,{severity:s}),className:j.summary,children:[(0,r.jsx)(Nt,{severity:s}),(0,r.jsx)(F.Z,{className:j.summaryText,variant:"subtitle1",children:$})]}),(d||p)&&(0,r.jsx)(Mt.Z,{children:(0,r.jsxs)(Be.Z,{container:!0,children:[d&&(0,r.jsx)(Be.Z,{item:!0,xs:12,children:(0,r.jsx)(F.Z,{className:j.message,variant:"body1",children:d})}),p&&(0,r.jsx)(Be.Z,{item:!0,xs:12,className:j.details,children:p})]})})]})}const wn=(0,c.Z)(e=>({text:{fontFamily:"monospace",whiteSpace:"pre",overflowX:"auto",marginRight:e.spacing(2)},divider:{margin:e.spacing(2)}}),{name:"BackstageErrorPanel"}),Yn=({error:e,message:s,stack:a,children:d})=>{const p=wn();return(0,r.jsxs)(jt.Z,{dense:!0,children:[(0,r.jsxs)(lt.Z,{alignItems:"flex-start",children:[(0,r.jsx)(ft.Z,{classes:{secondary:p.text},primary:"Error",secondary:e}),(0,r.jsx)(ze,{text:e})]}),(0,r.jsxs)(lt.Z,{alignItems:"flex-start",children:[(0,r.jsx)(ft.Z,{classes:{secondary:p.text},primary:"Message",secondary:s}),(0,r.jsx)(ze,{text:s})]}),a&&(0,r.jsxs)(lt.Z,{alignItems:"flex-start",children:[(0,r.jsx)(ft.Z,{classes:{secondary:p.text},primary:"Stack Trace",secondary:a}),(0,r.jsx)(ze,{text:a})]}),d]})};function fn(e){const{title:s,error:a,defaultExpanded:d,children:p}=e;return(0,r.jsx)(Cn,{severity:"error",title:s!=null?s:a.message,defaultExpanded:d,children:(0,r.jsx)(Yn,{error:a.name,message:a.message,stack:a.stack,children:p})})}var Rn=t(85256);const dr=(0,c.Z)(e=>({text:{fontFamily:"monospace",whiteSpace:"pre",overflowX:"auto",marginRight:e.spacing(2)},divider:{margin:e.spacing(2)}}),{name:"BackstageResponseErrorPanel"});function w(e){var s;const{title:a,error:d,defaultExpanded:p}=e,v=dr();if(d.name!=="ResponseError")return(0,r.jsx)(fn,{title:a!=null?a:d.message,defaultExpanded:p,error:d});const{body:j,cause:$}=d,{request:G,response:N}=j,pe=`${N.statusCode}: ${$.name}`,oe=G&&`${G.method} ${G.url}`,xe=$.message.replace(/\\n/g,`
|
|
14
|
+
`),Ie=(s=$.stack)===null||s===void 0?void 0:s.replace(/\\n/g,`
|
|
15
|
+
`),Ye=JSON.stringify(j,void 0,2);return(0,r.jsxs)(fn,{title:a!=null?a:d.message,defaultExpanded:p,error:{name:pe,message:xe,stack:Ie},children:[oe&&(0,r.jsxs)(lt.Z,{alignItems:"flex-start",children:[(0,r.jsx)(ft.Z,{classes:{secondary:v.text},primary:"Request",secondary:G?`${oe}`:void 0}),(0,r.jsx)(ze,{text:oe})]}),(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(Rn.Z,{component:"li",className:v.divider}),(0,r.jsx)(lt.Z,{alignItems:"flex-start",children:(0,r.jsx)(ft.Z,{classes:{secondary:v.text},primary:"Full Error as JSON"})}),(0,r.jsx)(ne,{language:"json",text:Ye,showCopyCodeButton:!0})]})]})}var u=t(28316);function x(e){const s=document.createElement("div");return s.setAttribute("id",e),s}function E(e){document.body.insertBefore(e,document.body.lastElementChild.nextElementSibling)}function q(e){const s=useRef(null);useEffect(function(){const p=document.querySelector(`#${e}`),v=p||x(e);return p||E(v),v.appendChild(s.current),function(){s.current.remove(),v.childNodes.length===-1&&v.remove()}},[e]);function a(){return s.current||(s.current=document.createElement("div")),s.current}return a()}var ve=null;const ye="core.calloutSeen";function Ne(){const[e,s]=useState(()=>{const d=localStorage.getItem(ye);return d?JSON.parse(d):{}}),a=useCallback((d,p)=>{const v=localStorage.getItem(ye),$={...v?JSON.parse(v):{},[d]:p};s($),localStorage.setItem(ye,JSON.stringify($))},[]);return{states:e,setState:a}}function Je(e){const{states:s,setState:a}=Ne(),d=useCallback(()=>{a(e,!0)},[a,e]);return{seen:s[e]===!0,markSeen:d}}function Ft(e){const{seen:s,markSeen:a}=Je(e);return{show:s===!1,hide:a}}const Ht=(0,c.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 $n(e){const{featureId:s,title:a,description:d,children:p}=e,{show:v,hide:j}=useShowCallout(s),$=usePortal("core.callout"),G=useRef(null),[N,pe]=useState(),oe=Ht(),xe=useCallback(()=>{if(G.current){const Ie=G.current.getBoundingClientRect(),Ye=Math.max(Ie.width,Ie.height),qe=800,Pt=Ie.x-(Ye-Ie.width)/2-qe,Kt=Ie.y-(Ye-Ie.height)/2-qe,tn=Ye+2*qe,nn=450,kt=Ie.x+Ie.width/2-nn,_t=Ie.y-(Ye-Ie.height)/2+Ye+20;pe({dotLeft:Pt,dotTop:Kt,dotSize:tn,borderWidth:qe,textTop:_t,textLeft:kt,textWidth:nn})}},[]);return useEffect(()=>(window.addEventListener("resize",xe),window.addEventListener("scroll",xe),()=>{window.removeEventListener("resize",xe),window.removeEventListener("scroll",xe)}),[xe]),useLayoutEffect(xe,[G.current,xe]),v?_jsxs(_Fragment,{children:[_jsx(Box,{className:oe.featureWrapper,ref:G,children:p}),createPortal(_jsx(Box,{className:oe.backdrop,children:_jsx(ClickAwayListener,{onClickAway:j,children:_jsxs(_Fragment,{children:[_jsx(Box,{className:oe.dot,"data-testid":"dot",style:{left:N==null?void 0:N.dotLeft,top:N==null?void 0:N.dotTop,width:N==null?void 0:N.dotSize,height:N==null?void 0:N.dotSize,borderWidth:N==null?void 0:N.borderWidth},onClick:j,onKeyDown:j,role:"button",tabIndex:0,children:_jsx(Box,{className:oe.pulseCircle})}),_jsxs(Box,{className:oe.text,"data-testid":"text",style:{left:N==null?void 0:N.textLeft,top:N==null?void 0:N.textTop,width:N==null?void 0:N.textWidth},children:[_jsx(Typography,{variant:"h2",paragraph:!0,children:a}),_jsx(Typography,{children:d})]})]})})}),$)]}):_jsx(_Fragment,{children:p})}var ur=t(35292);const hs=(0,c.Z)(e=>({link:{display:"grid",justifyItems:"center",gridGap:4,textAlign:"center"},disabled:{color:e.palette.text.secondary,cursor:"default"},primary:{color:e.palette.primary.main},secondary:{color:e.palette.secondary.main},label:{textTransform:"uppercase",fontWeight:e.typography.fontWeightBold,letterSpacing:1.2}}),{name:"BackstageIconLinkVertical"});function ps({color:e="primary",disabled:s=!1,href:a="#",icon:d=(0,r.jsx)(ur.Z,{}),label:p,onClick:v,title:j}){const $=hs();return s?(0,r.jsxs)(Ee.Z,{title:j,className:ce()($.link,$.disabled),children:[d,(0,r.jsx)(F.Z,{variant:"caption",component:"span",className:$.label,children:p})]}):(0,r.jsxs)(_e,{title:j,className:ce()($.link,$[e]),to:a,onClick:v,children:[d,(0,r.jsx)(F.Z,{variant:"caption",component:"span",className:$.label,children:p})]})}const Rr=(0,c.Z)(e=>({links:{margin:e.spacing(2,0),display:"grid",gridAutoFlow:"column",gridAutoColumns:"min-content",gridGap:e.spacing(3)}}),{name:"BackstageHeaderIconLinkRow"});function hr(e){const{links:s}=e,a=Rr();return(0,r.jsx)("nav",{className:a.links,children:s.map((d,p)=>(0,r.jsx)(ps,{...d},p+1))})}const Lr=e=>{const s=e==="dark"?"16%":"97%";return`
|
|
16
16
|
hsl(0, 0%, ${s}) 0%,
|
|
17
17
|
hsla(0, 0%, ${s}, 0.987) 8.1%,
|
|
18
18
|
hsla(0, 0%, ${s}, 0.951) 15.5%,
|
|
@@ -29,12 +29,12 @@ spec:
|
|
|
29
29
|
hsla(0, 0%, ${s}, 0.049) 84.5%,
|
|
30
30
|
hsla(0, 0%, ${s}, 0.013) 91.9%,
|
|
31
31
|
hsla(0, 0%, ${s}, 0) 100%
|
|
32
|
-
`},Vr=100,Pr=10,Jn=(0,c.Z)(e=>({root:{position:"relative",display:"flex",flexFlow:"row nowrap",alignItems:"center"},container:{overflow:"auto",scrollbarWidth:0,"&::-webkit-scrollbar":{display:"none"}},fade:{position:"absolute",width:Vr,height:`calc(100% + ${Pr}px)`,transition:"opacity 300ms",pointerEvents:"none"},fadeLeft:{left:-Pr,background:`linear-gradient(90deg, ${Lr(e.palette.type)})`},fadeRight:{right:-Pr,background:`linear-gradient(270deg, ${Lr(e.palette.type)})`},fadeHidden:{opacity:0},button:{position:"absolute"},buttonLeft:{left:-e.spacing(2)},buttonRight:{right:-e.spacing(2)}}),{name:"BackstageHorizontalScrollGrid"});function qn(e){const[[s,a],d]=React.useState([0,0]);return React.useLayoutEffect(()=>{const p=e.current;if(!p){d([0,0]);return}const v=()=>{const j=p.scrollLeft,$=p.scrollWidth-p.offsetWidth-p.scrollLeft;d([j,$])};return v(),p.addEventListener("scroll",v),window.addEventListener("resize",v),()=>{p.removeEventListener("scroll",v),window.removeEventListener("resize",v)}},[e]),[s,a]}function pr(e,s,a){const[d,p]=React.useState(0);return React.useLayoutEffect(()=>{if(d===0)return;const v=window.performance.now(),j=requestAnimationFrame($=>{if(!e.current)return;const K=$-v,N=Math.abs(d)*K/s,ie=Math.max(a,N)*Math.sign(d);e.current.scrollBy({left:ie});const xe=d-ie;Math.sign(d)!==Math.sign(xe)?p(0):p(xe)});return()=>cancelAnimationFrame(j)},[e,d,s,a]),p}function kr(e){const{scrollStep:s=100,scrollSpeed:a=50,minScrollDistance:d=5,children:p,...v}=e,j=Jn(e),$=React.useRef(),[K,N]=qn($),pe=pr($,a,d),ie=xe=>{!$.current||pe(xe?s:-s)};return _jsxs(Box,{...v,className:j.root,children:[_jsx(Grid,{container:!0,direction:"row",wrap:"nowrap",className:j.container,ref:$,children:p}),_jsx(Box,{className:classNames(j.fade,j.fadeLeft,{[j.fadeHidden]:K===0})}),_jsx(Box,{className:classNames(j.fade,j.fadeRight,{[j.fadeHidden]:N===0})}),K>0&&_jsx(IconButton,{title:"Scroll Left",onClick:()=>ie(!1),className:classNames(j.button,j.buttonLeft,{}),children:_jsx(ChevronLeftIcon,{})}),N>0&&_jsx(IconButton,{title:"Scroll Right",onClick:()=>ie(!0),className:classNames(j.button,j.buttonRight,{}),children:_jsx(ChevronRightIcon,{})})]})}const Hr=(0,c.Z)({alpha:{color:"#ffffff",fontFamily:"serif",fontWeight:"normal",fontStyle:"italic"},beta:{color:"#4d65cc",fontFamily:"serif",fontWeight:"normal",fontStyle:"italic"}},{name:"BackstageLifecycle"});function Us(e){const s=Hr(e),{shorthand:a,alpha:d}=e;return a?_jsx(Typography,{component:"span",className:s[d?"alpha":"beta"],style:{fontSize:"120%"},children:d?_jsx(_Fragment,{children:"\u03B1"}):_jsx(_Fragment,{children:"\u03B2"})}):_jsx(Typography,{component:"span",className:s[d?"alpha":"beta"],children:d?"Alpha":"Beta"})}const Or=(0,g.lazy)(()=>Promise.all([t.e(5869),t.e(6051)]).then(t.bind(t,76051)).then(e=>({default:e.RealLogViewer})));function fs(e){const{Progress:s}=(0,W.qD)().getComponents();return(0,r.jsx)(g.Suspense,{fallback:(0,r.jsx)(s,{}),children:(0,r.jsx)(Or,{...e})})}const gs=(0,c.Z)(e=>({markdown:{"& table":{borderCollapse:"collapse",border:`1px solid ${e.palette.border}`},"& th, & td":{border:`1px solid ${e.palette.border}`,padding:e.spacing(1)},"& td":{wordBreak:"break-word",overflow:"hidden",verticalAlign:"middle",lineHeight:"1",margin:0,padding:e.spacing(3,2,3,2.5),borderBottom:0},"& th":{backgroundColor:e.palette.background.paper},"& tr":{backgroundColor:e.palette.background.paper},"& tr:nth-child(odd)":{backgroundColor:e.palette.background.default},"& a":{color:e.palette.link},"& img":{maxWidth:"100%"}}}),{name:"BackstageMarkdownContent"}),Cr=(e,s)=>s?typeof s=="string"?e+s:g.Children.toArray(s.props.children).reduce(Cr,e):e,gn=({level:e,children:s})=>{const p=g.Children.toArray(s).reduce(Cr,"").toLocaleLowerCase("en-US").replace(/\W/g,"-");return g.createElement(`h${e}`,{id:p},s)},or={code:({inline:e,className:s,children:a,...d})=>{const p=String(a).replace(/\n+$/,""),v=/language-(\w+)/.exec(s||"");return!e&&v?(0,r.jsx)(ne,{language:v[1],text:p}):(0,r.jsx)("code",{className:s,...d,children:a})},h1:gn,h2:gn,h3:gn,h4:gn,h5:gn,h6:gn};function Br(e){const{content:s,dialect:a="gfm",linkTarget:d,transformLinkUri:p,transformImageUri:v,className:j}=e,$=gs();return _jsx(ReactMarkdown,{remarkPlugins:a==="gfm"?[gfm]:[],className:`${$.markdown} ${j}`,children:s,components:or,linkTarget:d,transformLinkUri:p,transformImageUri:v})}var ms=t(23054);const $r=(0,c.Z)(e=>({root:{paddingLeft:e.spacing(3)}}),{name:"BackstageLoginRequestListItem"}),vs=({request:e,busy:s,setBusy:a})=>{const d=$r(),[p,v]=useState(),j=async()=>{a(!0);try{await e.trigger()}catch(K){v(isError(K)?K.message:"An unspecified error occurred")}finally{a(!1)}},$=e.provider.icon;return _jsxs(ListItem,{disabled:s,classes:{root:d.root},children:[_jsx(ListItemAvatar,{children:_jsx($,{fontSize:"large"})}),_jsx(ListItemText,{primary:e.provider.title,secondary:p&&_jsx(Typography,{color:"error",children:p})}),_jsx(Button,{color:"primary",variant:"contained",onClick:j,children:"Log in"})]})};var ys=null;const Gr=(0,c.Z)(e=>({dialog:{paddingTop:e.spacing(1)},title:{minWidth:0},titleHeading:{fontSize:e.typography.h6.fontSize},contentList:{padding:0},actionButtons:{padding:e.spacing(2,0)}}),{name:"OAuthRequestDialog"});function Kr(e){const s=Gr(),[a,d]=useState(!1),p=useApi(oauthRequestApiRef),v=useObservable(useMemo(()=>p.authRequest$(),[p]),[]),j=()=>{v.forEach($=>$.reject())};return _jsxs(Dialog,{open:Boolean(v.length),fullWidth:!0,maxWidth:"xs",classes:{paper:s.dialog},"aria-labelledby":"oauth-req-dialog-title",children:[_jsxs("main",{children:[_jsx(DialogTitle,{classes:{root:s.title},id:"oauth-req-dialog-title",children:_jsx(Typography,{className:s.titleHeading,variant:"h1",children:"Login Required"})}),_jsx(DialogContent,{dividers:!0,classes:{root:s.contentList},children:_jsx(List,{children:v.map($=>_jsx(LoginRequestListItem,{request:$,busy:a,setBusy:d},$.provider.title))})})]}),_jsx(DialogActions,{classes:{root:s.actionButtons},children:_jsx(Button,{onClick:j,children:"Reject All"})})]})}var ir=t(15277),xs=t.n(ir),Yr=t(29862);const bs=(0,c.Z)({container:{overflow:"visible !important"}},{name:"BackstageOverflowTooltip"});function Zr(e){const[s,a]=(0,g.useState)(!1),d=(0,Yr.t)(),p=bs(),v=$=>{d()&&a($)};var j;return(0,r.jsx)(nt.ZP,{title:(j=e.title)!==null&&j!==void 0?j:e.text||"",placement:e.placement,disableHoverListener:!s,children:(0,r.jsx)(xs(),{text:e.text,line:e.line,onToggled:v,containerClassName:p.container})})}var Ss=t(67358);function Cs(e){const s=(0,Ke.Z)(),[a,d]=(0,g.useState)(!1);return(0,g.useEffect)(()=>{const p=setTimeout(()=>d(!0),s.transitions.duration.short);return()=>clearTimeout(p)},[s.transitions.duration.short]),a?(0,r.jsx)(Ss.Z,{...e,"data-testid":"progress"}):(0,r.jsx)(Ee.Z,{display:"none"})}var Jr=t(94339),Qr=t(14503),Xr=t(24579),Dr=t(32552),on=t(15459),Ut=t(27597);const ws=(0,c.Z)(e=>({root:{maxWidth:"fit-content",padding:e.spacing(2,2,2,2.5)},boxTitle:{margin:0,color:e.palette.textSubtle},arrow:{color:e.palette.textSubtle}}),{name:"BackstageBottomLink"});function js(e){const{link:s,title:a,onClick:d}=e,p=ws();return(0,r.jsxs)(Ee.Z,{children:[(0,r.jsx)(Rn.Z,{}),(0,r.jsx)(_e,{to:s,onClick:d,underline:"none",children:(0,r.jsxs)(Ee.Z,{display:"flex",alignItems:"center",className:p.root,children:[(0,r.jsx)(Ee.Z,{className:p.boxTitle,fontWeight:"fontWeightBold",m:1,children:(0,r.jsx)(F.Z,{children:(0,r.jsx)("strong",{children:a})})}),(0,r.jsx)(Ut.Z,{className:p.arrow})]})})]})}const Es=e=>{const{slackChannel:s}=e;if(s){if(typeof s=="string")return(0,r.jsxs)(F.Z,{children:["Please contact ",s," for help."]});if(!s.href)return(0,r.jsxs)(F.Z,{children:["Please contact ",s.name," for help."]})}else return null;return(0,r.jsx)(gt,{to:s.href,variant:"contained",children:s.name})},qr=class extends g.Component{componentDidCatch(s,a){console.error(`ErrorBoundary, error: ${s}, info: ${a}`),this.setState({error:s,errorInfo:a})}render(){const{slackChannel:s,children:a}=this.props,{error:d}=this.state;return d?(0,r.jsx)(fn,{title:"Something Went Wrong",error:d,children:(0,r.jsx)(Es,{slackChannel:s})}):a}constructor(s){super(s),this.state={error:void 0,errorInfo:void 0}}},As=(0,c.Z)(e=>({noPadding:{padding:0,"&:last-child":{paddingBottom:0}},header:{padding:e.spacing(2,2,2,2.5)},headerTitle:{fontWeight:e.typography.fontWeightBold},headerSubheader:{paddingTop:e.spacing(1)},headerAvatar:{},headerAction:{},headerContent:{},subheader:{display:"flex"}}),{name:"BackstageInfoCard"}),Ts=(0,on.Z)(e=>({root:{display:"inline-block",padding:e.spacing(8,8,0,0),float:"right"}}),{name:"BackstageInfoCardCardActionsTopRight"})(Qr.Z),_r={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 wr(e){const{title:s,subheader:a,divider:d=!0,deepLink:p,slackChannel:v,errorBoundaryProps:j,variant:$,children:K,headerStyle:N,headerProps:pe,icon:ie,action:xe,actionsClassName:Te,actions:Ye,cardClassName:qe,actionsTopRight:Pt,className:Kt,noPadding:tn,titleTypographyProps:nn}=e,kt=As();let _t={},Yt={};$&&$.split(/[\s]+/g).forEach(br=>{_t={..._t,..._r.card[br]},Yt={...Yt,..._r.cardContent[br]}});const vr=()=>!a&&!ie?null:(0,r.jsxs)("div",{className:kt.headerSubheader,"data-testid":"info-card-subheader",children:[a&&(0,r.jsx)("div",{className:kt.subheader,children:a}),ie]}),yr=j||(v?{slackChannel:v}:{});return(0,r.jsx)(Jr.Z,{style:_t,className:Kt,children:(0,r.jsxs)(qr,{...yr,children:[s&&(0,r.jsx)(Dr.Z,{classes:{root:kt.header,title:kt.headerTitle,subheader:kt.headerSubheader,avatar:kt.headerAvatar,action:kt.headerAction,content:kt.headerContent},title:s,subheader:vr(),action:xe,style:{...N},titleTypographyProps:nn,...pe}),Pt&&(0,r.jsx)(Ts,{children:Pt}),d&&(0,r.jsx)(Rn.Z,{}),(0,r.jsx)(Xr.Z,{className:ce()(qe,{[kt.noPadding]:tn}),style:Yt,children:K}),Ye&&(0,r.jsx)(Qr.Z,{className:Te,children:Ye}),p&&(0,r.jsx)(js,{...p})]})})}var Ms=t(39307);const Is=(0,c.Z)(e=>({root:{position:"relative",lineHeight:0},overlay:{position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -60%)",fontSize:e.typography.pxToRem(45),fontWeight:e.typography.fontWeightBold,color:e.palette.textContrast},description:{fontSize:"100%",top:"50%",left:"50%",transform:"translate(-50%, -50%)",position:"absolute",wordBreak:"break-all",display:"inline-block"},circle:{width:"80%",transform:"translate(10%, 0)"},colorUnknown:{}}),{name:"BackstageGauge"}),es={fractional:!0,inverse:!1,unit:"%",max:100},Rs=({palette:e,value:s,inverse:a,max:d})=>{if(isNaN(s))return"#ddd";const p=d||es.max,v=a?p-s:s;return v<p/3?e.status.error:v<p*(2/3)?e.status.warning:e.status.ok};function zs(e){const[s,a]=useState(null),{getColor:d=Rs}=e,p=Is(e),{palette:v}=useTheme(),{value:j,fractional:$,inverse:K,unit:N,max:pe,description:ie}={...es,...e},xe=$?Math.round(j*pe):j,Te=pe!==100?Math.round(j):xe,[Ye,qe]=useState(!1);return useEffect(()=>{const Pt=s,Kt=()=>qe(!0),tn=()=>qe(!1);return Pt&&ie?(Pt.addEventListener("mouseenter",Kt),Pt.addEventListener("mouseleave",tn),()=>{Pt.removeEventListener("mouseenter",Kt),Pt.removeEventListener("mouseleave",tn)}):()=>{qe(!1)}},[ie,s]),_jsxs(Box,{ref:a,className:p.root,children:[_jsx(Circle,{strokeLinecap:"butt",percent:xe,strokeWidth:12,trailWidth:12,strokeColor:d({palette:v,value:Te,inverse:K,max:pe}),className:p.circle}),ie&&Ye?_jsx(Box,{className:p.description,children:ie}):_jsx(Box,{className:p.overlay,children:isNaN(j)?"N/A":`${Te}${N}`})]})}const Ls=(0,c.Z)({root:{height:"100%",width:250}},{name:"BackstageGaugeCard"});function Ws(e){const s=Ls(e),{title:a,subheader:d,progress:p,inverse:v,deepLink:j,description:$,icon:K,variant:N,getColor:pe}=e,ie={inverse:v,description:$,getColor:pe,value:p};return _jsx(Box,{className:s.root,children:_jsx(InfoCard,{title:a,subheader:d,deepLink:j,variant:N,icon:K,children:_jsx(Gauge,{...ie})})})}function Vs(e){const{value:s,getColor:a=getProgressColor}=e,{palette:d}=useTheme();if(isNaN(s))return null;let p=Math.round(s*100*100)/100;p>100&&(p=100);const v=a({palette:d,value:p,inverse:!1,max:100});return _jsx(Tooltip,{title:`${p}%`,children:_jsx(Typography,{component:"span",children:_jsx(Line,{percent:p,strokeWidth:4,trailWidth:4,strokeColor:v})})})}var Ps=t(21324),Hs=t(7089),m=t(1292),y=t(42494),I=t(74603),B=t(56939),Q=t(12231),J=t(73698),re=t(72379);const le=(0,c.Z)(e=>(0,P.Z)({icon:{position:"absolute",right:e.spacing(.5),pointerEvents:"none"}}),{name:"BackstageClosedDropdown"});var Ie=()=>{const e=le();return(0,r.jsx)(re.Z,{className:e.icon,fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,r.jsx)("path",{d:"M7.5 8L6 9.5L12.0703 15.5703L18.1406 9.5L16.6406 8L12.0703 12.5703L7.5 8Z",fill:"#616161"})})};const je=(0,c.Z)(e=>(0,P.Z)({icon:{position:"absolute",right:e.spacing(.5),pointerEvents:"none"}}),{name:"BackstageOpenedDropdown"});var Ve=()=>{const e=je();return(0,r.jsx)(re.Z,{className:e.icon,fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,r.jsx)("path",{d:"M16.5 16L18 14.5L11.9297 8.42969L5.85938 14.5L7.35938 16L11.9297 11.4297L16.5 16Z",fill:"#616161"})})};const ht=(0,on.Z)(e=>(0,P.Z)({root:{"label + &":{marginTop:e.spacing(3)}},input:{borderRadius:e.shape.borderRadius,position:"relative",backgroundColor:e.palette.background.paper,border:"1px solid #ced4da",fontSize:e.typography.body1.fontSize,padding:e.spacing(1.25,3.25,1.25,1.5),transition:e.transitions.create(["border-color","box-shadow"]),fontFamily:"Helvetica Neue","&:focus":{background:e.palette.background.paper,borderRadius:e.shape.borderRadius}}}),{name:"BackstageSelectInputBase"})(I.Z),xt=(0,c.Z)(e=>(0,P.Z)({formControl:{margin:`${e.spacing(1)} 0px`,maxWidth:300},label:{transform:"initial",fontWeight:"bold",fontSize:e.typography.body2.fontSize,fontFamily:e.typography.fontFamily,color:e.palette.text.primary,"&.Mui-focused":{color:e.palette.text.primary}},formLabel:{transform:"initial",fontWeight:"bold",fontSize:e.typography.body2.fontSize,fontFamily:e.typography.fontFamily,color:e.palette.text.primary,"&.Mui-focused":{color:e.palette.text.primary}},chips:{display:"flex",flexWrap:"wrap"},chip:{margin:2},checkbox:{},root:{display:"flex",flexDirection:"column"}}),{name:"BackstageSelect"});function Ze(e){const{multiple:s,items:a,label:d,placeholder:p,selected:v,onChange:j,triggerReset:$,native:K=!1,disabled:N=!1,margin:pe}=e,ie=xt(),[xe,Te]=(0,g.useState)(v||(s?[]:"")),[Ye,qe]=(0,g.useState)(!1);(0,g.useEffect)(()=>{Te(s?[]:"")},[$,s]),(0,g.useEffect)(()=>{v!==void 0&&Te(v)},[v]);const Pt=kt=>{Te(kt.target.value),j(kt.target.value)},Kt=kt=>{if(N){kt.preventDefault();return}qe(_t=>s&&!(kt.target instanceof HTMLElement)?!0:!_t)},tn=()=>{qe(!1)},nn=kt=>()=>{const _t=xe.filter(Yt=>Yt!==kt);Te(_t),j(_t)};return(0,r.jsx)(Ee.Z,{className:ie.root,children:(0,r.jsx)(m.Z,{onClickAway:tn,children:(0,r.jsxs)(y.Z,{className:ie.formControl,children:[(0,r.jsx)(B.Z,{className:ie.formLabel,children:d}),(0,r.jsxs)(J.Z,{"aria-label":d,value:xe,native:K,disabled:N,"data-testid":"select",displayEmpty:!0,multiple:s,margin:pe,onChange:Pt,onClick:Kt,open:Ye,input:(0,r.jsx)(ht,{}),label:d,tabIndex:0,renderValue:kt=>{var _t;return s&&xe.length!==0?(0,r.jsx)(Ee.Z,{className:ie.chips,children:kt.map(Yt=>{var vr,yr;return(0,r.jsx)(Hs.Z,{label:(vr=a.find(xr=>xr.value===Yt))===null||vr===void 0?void 0:vr.label,clickable:!0,onDelete:nn(Yt),className:ie.chip},(yr=a.find(xr=>xr.value===Yt))===null||yr===void 0?void 0:yr.value)})}):(0,r.jsx)(F.Z,{children:xe.length===0?p||"":(_t=a.find(Yt=>Yt.value===kt))===null||_t===void 0?void 0:_t.label})},IconComponent:()=>Ye?(0,r.jsx)(Ve,{}):(0,r.jsx)(Ie,{}),MenuProps:{anchorOrigin:{vertical:"bottom",horizontal:"left"},transformOrigin:{vertical:"top",horizontal:"left"},getContentAnchorEl:null},children:[p&&!s&&(0,r.jsx)(Q.Z,{value:[],children:p}),K?a&&a.map(kt=>(0,r.jsx)("option",{value:kt.value,children:kt.label},kt.value)):a&&a.map(kt=>(0,r.jsxs)(Q.Z,{value:kt.value,children:[s&&(0,r.jsx)(Ps.Z,{color:"primary",checked:xe.includes(kt.value)||!1,className:ie.checkbox}),kt.label]},kt.value))]})]})})})}const Rt=()=>{},Gt=g.createContext({stepperLength:0,stepIndex:0,setStepIndex:Rt,stepHistory:[],setStepHistory:Rt,onStepChange:Rt});function Ln(e){const{children:s,elevated:a,onStepChange:d,activeStep:p=0}=e,[v,j]=useState(p),[$,K]=useState([0]);useEffect(()=>{j(p)},[p]);const N=[];let pe;return Children.forEach(s,ie=>{isValidElement(ie)&&(ie.props.end?pe=ie:N.push(ie))}),_jsxs(_Fragment,{children:[_jsx(Gt.Provider,{value:{stepIndex:v,setStepIndex:j,stepHistory:$,setStepHistory:K,onStepChange:d,stepperLength:Children.count(s)},children:_jsx(MuiStepper,{activeStep:v,orientation:"vertical",elevation:a?2:0,children:N})}),v>=Children.count(s)-1&&pe]})}const jn=(0,c.Z)(e=>({root:{marginTop:e.spacing(3),"& button":{marginRight:e.spacing(1)}}}),{name:"BackstageSimpleStepperFooter"}),ar=({text:e,handleClick:s})=>_jsx(Button,{onClick:s,children:e||"Reset"}),En=({text:e,handleClick:s,disabled:a,last:d,stepIndex:p})=>_jsx(Button,{variant:"contained",color:"primary",disabled:a,"data-testid":`nextButton-${p}`,onClick:s,children:e||(d?"Finish":"Next")}),Zn=({text:e,handleClick:s,disabled:a,stepIndex:d})=>_jsx(Button,{variant:"outlined",color:"primary",disabled:a,"data-testid":`skipButton-${d}`,onClick:s,children:e||"Skip"}),Vn=({text:e,handleClick:s,disabled:a,stepIndex:d})=>_jsx(Button,{onClick:s,"data-testid":`backButton-${d}`,disabled:a,children:e||"Back"}),jr=({actions:e={},children:s})=>{const a=jn(),{stepperLength:d,stepIndex:p,setStepIndex:v,stepHistory:j,setStepHistory:$,onStepChange:K}=useContext(VerticalStepperContext),N=(Te,Ye)=>{Ye&&Ye(),K&&K(p,Te),v(Te)},pe=()=>{const Te=e.nextStep?e.nextStep(p,d-1):p+1;N(Te,e.onNext),$([...j,Te])},ie=()=>{j.pop(),N(j[j.length-1],e.onBack),$([...j])},xe=()=>{N(0,e.onRestart),$([0])};return _jsxs(Box,{className:a.root,children:[[void 0,!0].includes(e.showBack)&&p!==0&&_jsx(Vn,{text:e.backText,handleClick:ie,disabled:p===0,stepIndex:p}),e.showSkip&&_jsx(Zn,{text:e.skipText,handleClick:pe,disabled:!!d&&p>=d||!!e.canSkip&&!e.canSkip(),stepIndex:p}),[void 0,!0].includes(e.showNext)&&_jsx(En,{text:e.nextText,handleClick:pe,disabled:!!d&&p>=d||!!e.canNext&&!e.canNext(),stepIndex:p}),e.showRestart&&p!==0&&_jsx(ar,{text:e.restartText,handleClick:xe,stepIndex:p}),s]})},fr=(0,c.Z)(e=>({end:{padding:e.spacing(3)}}),{name:"SimpleStepperStep"});function ts(e){const{title:s,children:a,end:d,actions:p,...v}=e,j=fr();return d?_jsxs(Box,{className:j.end,children:[_jsx(Typography,{variant:"h6",children:s}),a,_jsx(SimpleStepperFooter,{actions:{...p||{},showNext:!1}})]}):_jsxs(MuiStep,{...v,children:[_jsx(StepLabel,{children:_jsx(Typography,{variant:"h6",children:s})}),_jsxs(StepContent,{children:[a,_jsx(SimpleStepperFooter,{actions:p})]})]})}const sn=(0,c.Z)(e=>({status:{fontWeight:e.typography.fontWeightMedium,"&::before":{width:"0.7em",height:"0.7em",display:"inline-block",marginRight:e.spacing(1),borderRadius:"50%",content:'""'}},ok:{"&::before":{backgroundColor:e.palette.status.ok}},warning:{"&::before":{backgroundColor:e.palette.status.warning}},error:{"&::before":{backgroundColor:e.palette.status.error}},pending:{"&::before":{backgroundColor:e.palette.status.pending}},running:{"&::before":{backgroundColor:e.palette.status.running}},aborted:{"&::before":{backgroundColor:e.palette.status.aborted}}}),{name:"BackstageStatus"});function Pn(e){const s=sn(e);return _jsx(Typography,{component:"span",className:classNames(s.status,s.ok),"aria-label":"Status ok","aria-hidden":"true",...e})}function gr(e){const s=sn(e);return _jsx(Typography,{component:"span",className:classNames(s.status,s.warning),"aria-label":"Status warning","aria-hidden":"true",...e})}function di(e){const s=sn(e);return _jsx(Typography,{component:"span",className:classNames(s.status,s.error),"aria-label":"Status error","aria-hidden":"true",...e})}function ui(e){const s=sn(e);return _jsx(Typography,{component:"span",className:classNames(s.status,s.pending),"aria-label":"Status pending","aria-hidden":"true",...e})}function aa(e){const s=sn(e);return _jsx(Typography,{component:"span",className:classNames(s.status,s.running),"aria-label":"Status running","aria-hidden":"true",...e})}function Er(e){const s=sn(e);return _jsx(Typography,{component:"span",className:classNames(s.status,s.aborted),"aria-label":"Status aborted","aria-hidden":"true",...e})}var hi=t(74600),An=t(15584);const pi=e=>(0,P.Z)({root:{fontWeight:e.typography.fontWeightBold,whiteSpace:"nowrap",paddingRight:e.spacing(4),border:"0",verticalAlign:"top"}}),fi={root:{border:"0",verticalAlign:"top"}},gi=e=>(0,P.Z)({root:{margin:e.spacing(0,0,-1,0)}}),wo=e=>(0,P.Z)({root:{padding:e.spacing(0,0,1,0)},random:{}}),mi=(0,on.Z)(pi,{name:"BackstageMetadataTableTitleCell"})(An.Z),vi=(0,on.Z)(fi,{name:"BackstageMetadataTableCell"})(An.Z),yi=({dense:e,children:s})=>_jsx(Table,{size:e?"small":"medium",children:_jsx(TableBody,{children:s})}),la=({title:e,children:s,...a})=>_jsxs(TableRow,{children:[e&&_jsx(mi,{children:e}),_jsx(vi,{colSpan:e?1:2,...a,children:s})]}),jo=(0,on.Z)(gi,{name:"BackstageMetadataTableList"})(({classes:e,children:s})=>(0,r.jsx)(jt.Z,{disablePadding:!0,className:e.root,children:s})),Gs=(0,on.Z)(wo,{name:"BackstageMetadataTableListItem"})(({classes:e,children:s})=>(0,r.jsx)(at.Z,{className:e.root,children:s})),Ks=(0,P.Z)({root:{margin:"0 0",listStyleType:"none"}}),ns=e=>(0,P.Z)({root:{...Ks.root,paddingLeft:e.spacing(1)}}),Nr=(0,on.Z)(Ks,{name:"BackstageStructuredMetadataTableList"})(({classes:e,children:s})=>(0,r.jsx)(jo,{classes:e,children:s})),Fr=(0,on.Z)(ns,{name:"BackstageStructuredMetadataTableNestedList"})(({classes:e,children:s})=>(0,r.jsx)(jo,{classes:e,children:s}));function Eo(e,s){const a=e.map((d,p)=>_jsx(MetadataListItem,{children:rs(d)},p));return s?_jsx(Fr,{children:a}):_jsx(Nr,{children:a})}function Ys(e,s,a){const d=Object.keys(e).map(p=>{const v=rs(e[p],!0),j=a&&a.titleFormat?a.titleFormat(p):startCase(p);return _jsxs(MetadataListItem,{children:[_jsx(Typography,{variant:"body2",component:"span",children:`${j}: `}),v]},p)});return s?_jsx(Fr,{children:d}):_jsx(Nr,{children:d})}function rs(e,s,a){return React.isValidElement(e)?_jsx(Fragment,{children:e}):typeof e=="object"&&!Array.isArray(e)?Ys(e,s,a):Array.isArray(e)?Eo(e,a):typeof e=="boolean"?_jsx(Fragment,{children:e?"\u2705":"\u274C"}):_jsx(Typography,{variant:"body2",component:"span",children:e})}const Ao=({value:e,options:s})=>_jsx(Fragment,{children:rs(e,s)}),To=({title:e,value:s,options:a})=>_jsx(MetadataTableItem,{title:a&&a.titleFormat?a.titleFormat(e):startCase(e),children:_jsx(Ao,{value:s,options:a})});function Io(e,s){return Object.keys(e).map(a=>_jsx(To,{title:a,value:e[a],options:s},a))}function xi(e){const{metadata:s,dense:a=!0,options:d}=e,p=Io(s,d||{});return _jsx(MetadataTable,{dense:a,children:p})}var Ro=t(49429),mr=t(86136),ss=t(79784),Lo=t(19126),Js=t.n(Lo);function Qs(e){return qs.stringify(e,{strictNullHandling:!0})}function Xs(e){return qs.parse(e,{ignoreQueryPrefix:!0,strictNullHandling:!0})}function _s(e,s){return Xs(e)[s]}function Po(e,s,a){const d={...Xs(e),[s]:a};return Qs(d)}function bi(e,s=250){const[a,d]=useSearchParams(),p=a.toString(),[v,j]=useState(_s(p,e));return useEffect(()=>{const $=_s(p,e);j(K=>isEqual($,K)?K:$)},[p,j,e]),useDebouncedEffect(()=>{const $=Po(p,e,v);p!==$&&d($,{replace:!0})},[d,v,p,e],s),[v,j]}const Si={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 eo(){const s=(0,W.I_)().get(W.Ds),a=s==null?void 0:s.getOptionalConfig("app.support");if(!a)return Si;var d;return{url:a.getString("url"),items:a.getConfigArray("items").flatMap(p=>({title:p.getString("title"),icon:p.getOptionalString("icon"),links:((d=p.getOptionalConfigArray("links"))!==null&&d!==void 0?d:[]).flatMap(v=>({url:v.getString("url"),title:v.getString("title")}))}))}}var ko=t(80079);function _n(e,s){const d=(0,W.qD)().getSystemIcon(e);return d?(0,r.jsx)(d,{...s}):(0,r.jsx)(ko.Z,{...s})}function Ci(e){return _n("brokenImage",e)}function Oo(e){return _n("catalog",e)}function to(e){return _n("chat",e)}function wi(e){return _n("dashboard",e)}function ji(e){return _n("docs",e)}function Ei(e){return _n("email",e)}function Ai(e){return _n("github",e)}function ca(e){return _n("group",e)}function ks(e){return _n("help",e)}function Os(e){return _n("user",e)}function da(e){return _n("warning",e)}const Ti=(0,c.Z)({popoverList:{minWidth:260,maxWidth:400}},{name:"BackstageSupportButton"}),Bo=({icon:e})=>{const s=(0,W.qD)();var a;const d=e&&(a=s.getSystemIcon(e))!==null&&a!==void 0?a:ks;return(0,r.jsx)(d,{})};var Bs;const no=({link:e})=>(0,r.jsx)(_e,{to:e.url,children:(Bs=e.title)!==null&&Bs!==void 0?Bs:e.url}),Ii=({item:e})=>{var s;return(0,r.jsxs)(at.Z,{children:[(0,r.jsx)(mr.Z,{children:(0,r.jsx)(Bo,{icon:e.icon})}),(0,r.jsx)(pt.Z,{primary:e.title,secondary:(s=e.links)===null||s===void 0?void 0:s.reduce((a,d,p)=>[...a,p>0&&(0,r.jsx)("br",{},p),(0,r.jsx)(no,{link:d},d.url)],[])})]})};function Ri(e){const{title:s,items:a,children:d}=e,{items:p}=eo(),[v,j]=(0,g.useState)(!1),[$,K]=(0,g.useState)(null),N=Ti(),pe=(0,Pe.Z)(Te=>Te.breakpoints.down("sm")),ie=Te=>{K(Te.currentTarget),j(!0)},xe=()=>{j(!1)};return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(Ee.Z,{display:"flex",ml:1,children:pe?(0,r.jsx)(ft.Z,{color:"primary",size:"small",onClick:ie,"data-testid":"support-button",children:(0,r.jsx)(ks,{})}):(0,r.jsx)(X.Z,{"data-testid":"support-button","aria-label":"support",color:"primary",onClick:ie,startIcon:(0,r.jsx)(ks,{}),children:"Support"})}),(0,r.jsxs)(ss.ZP,{"data-testid":"support-button-popover",open:v,anchorEl:$,anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"},onClose:xe,children:[(0,r.jsxs)(jt.Z,{className:N.popoverList,children:[s&&(0,r.jsx)(at.Z,{alignItems:"flex-start",children:(0,r.jsx)(F.Z,{variant:"subtitle1",children:s})}),g.Children.map(d,(Te,Ye)=>(0,r.jsx)(at.Z,{alignItems:"flex-start",children:Te},`child-${Ye}`)),(a!=null?a:p).map((Te,Ye)=>(0,r.jsx)(Ii,{item:Te},`item-${Ye}`))]}),(0,r.jsx)(Ro.Z,{children:(0,r.jsx)(X.Z,{color:"primary",onClick:xe,children:"Close"})})]})]})}var os=t(18671),is=t(16060);const as=72,ro=24,$o=18,lr={drawerWidthClosed:as,drawerWidthOpen:224,defaultOpenDelayMs:100,defaultCloseDelayMs:0,defaultFadeDuration:200,logoHeight:32,iconContainerWidth:as,iconSize:as-ro*2,iconPadding:ro,selectedIndicatorWidth:3,userBadgePadding:$o,userBadgeDiameter:as-$o*2,mobileSidebarHeight:56},Li=e=>({...lr,...e,iconContainerWidth:lr.drawerWidthClosed,iconSize:lr.drawerWidthClosed-lr.iconPadding*2,userBadgeDiameter:lr.drawerWidthClosed-lr.userBadgePadding*2}),Zo={drawerWidthClosed:0,drawerWidthOpen:202,defaultOpenDelayMs:lr.defaultOpenDelayMs+200},Hn=e=>({...Zo,...e}),ua="@backstage/core/sidebar-intro-dismissed",tr=(0,g.createContext)({sidebarConfig:lr,submenuConfig:Zo}),Do=(0,g.createContext)({isHoveredOn:!1,setIsHoveredOn:()=>{}});var Pi=t(50023),ki=t(4190),Oi=t(87685),Bi=t(44882),$s=t(51837);const No={isOpen:!1,setOpen:()=>{}},Fo=(0,g.createContext)(No),Uo=(0,$s.CT)("sidebar-open-state-context");function Mo(e){const{children:s,value:a}=e;return(0,r.jsx)(Fo.Provider,{value:a,children:(0,r.jsx)(Uo.Provider,{value:(0,$s.EI)({1:a}),children:s})})}const so=()=>{const e=(0,g.useContext)(Uo),s=(0,g.useContext)(Fo);if(e===void 0)return s||No;const a=e.atVersion(1);if(a===void 0)throw new Error("No context found for version 1.");return a};var oo=t(57998);const io={isPinned:!0,toggleSidebarPinState:()=>{},isMobile:!1},ao=(0,g.createContext)(io),lo=(0,$s.CT)("sidebar-pin-state-context");function zo(e){const{children:s,value:a}=e;return(0,r.jsx)(ao.Provider,{value:a,children:(0,r.jsx)(lo.Provider,{value:(0,$s.EI)({1:a}),children:s})})}const Ur=()=>{const e=(0,g.useContext)(lo),s=(0,g.useContext)(ao);if(e===void 0)return s||io;const a=e.atVersion(1);if(a===void 0)throw new Error("No context found for version 1.");return a},Wo=(0,c.Z)(e=>({root:{flexGrow:0,margin:e.spacing(0,2),color:e.palette.navigation.color},selected:s=>({color:`${e.palette.navigation.selectedColor}!important`,borderTop:`solid ${s.sidebarConfig.selectedIndicatorWidth}px ${e.palette.navigation.indicator}`,marginTop:"-1px"}),label:{display:"none"}})),Vo=e=>{const{to:s,label:a,icon:d,value:p}=e,{sidebarConfig:v}=(0,g.useContext)(tr),j=Wo({sidebarConfig:v}),$=(0,T.TH)(),{selectedMenuItemIndex:K,setSelectedMenuItemIndex:N}=(0,g.useContext)(Ko),pe=(xe,Te)=>{N(Te===K?-1:Te)},ie=p===K&&K>=0||p!==K&&!(K>=0)&&s===$.pathname;return(0,r.jsx)(oo.Z,{label:a,icon:d,component:_e,to:s||$.pathname,onChange:pe,value:p,selected:ie,classes:j})},co=e=>{const{children:s,to:a,label:d,icon:p,value:v}=e,{isMobile:j}=Ur();return j?(0,r.jsx)(Vo,{to:a,label:d,icon:p,value:v}):(0,r.jsx)(r.Fragment,{children:s})},uo=(0,c.Z)(e=>({root:{position:"fixed",backgroundColor:e.palette.navigation.background,color:e.palette.navigation.color,bottom:0,left:0,right:0,zIndex:e.zIndex.snackbar,borderTop:"1px solid #383838"},overlay:s=>({background:e.palette.navigation.background,width:"100%",bottom:`${s.sidebarConfig.mobileSidebarHeight}px`,height:`calc(100% - ${s.sidebarConfig.mobileSidebarHeight}px)`,flex:"0 1 auto",overflow:"auto"}),overlayHeader:{display:"flex",color:e.palette.text.primary,alignItems:"center",justifyContent:"space-between",padding:e.spacing(2,3)},overlayHeaderClose:{color:e.palette.text.primary},marginMobileSidebar:s=>({marginBottom:`${s.sidebarConfig.mobileSidebarHeight}px`})})),$i=e=>(0,oe.orderBy)(e,({props:{priority:s}})=>Number.isInteger(s)?s:-1,"desc"),Ho=g.createElement(co).type,Go=({children:e,label:s="Menu",open:a,onClose:d})=>{const{sidebarConfig:p}=(0,g.useContext)(tr),v=uo({sidebarConfig:p});return(0,r.jsxs)(ki.ZP,{anchor:"bottom",open:a,onClose:d,ModalProps:{BackdropProps:{classes:{root:v.marginMobileSidebar}}},classes:{root:v.marginMobileSidebar,paperAnchorBottom:v.overlay},children:[(0,r.jsxs)(Ee.Z,{className:v.overlayHeader,children:[(0,r.jsx)(F.Z,{variant:"h3",children:s}),(0,r.jsx)(ft.Z,{onClick:d,classes:{root:v.overlayHeaderClose},children:(0,r.jsx)(Oi.Z,{})})]}),(0,r.jsx)(Ee.Z,{component:"nav",children:e})]})},Ko=(0,g.createContext)({selectedMenuItemIndex:-1,setSelectedMenuItemIndex:()=>{}}),Yo=e=>{const{sidebarConfig:s}=(0,g.useContext)(tr),{children:a}=e,d=uo({sidebarConfig:s}),p=(0,T.TH)(),[v,j]=(0,g.useState)(-1);(0,g.useEffect)(()=>{j(-1)},[p.pathname]);let $=(0,W.vJ)(a,N=>N.getElements().filter(pe=>pe.type===Ho));if(a)$.length?$=$i($):$.push((0,r.jsx)(co,{icon:(0,r.jsx)(Bi.Z,{}),children:a},"default_menu"));else return null;const K=v>=0&&!$[v].props.to;return(0,r.jsx)(Mo,{value:{isOpen:!0,setOpen:()=>{}},children:(0,r.jsxs)(Ko.Provider,{value:{selectedMenuItemIndex:v,setSelectedMenuItemIndex:j},children:[(0,r.jsx)(Go,{label:$[v]&&$[v].props.label,open:K,onClose:()=>j(-1),children:$[v]&&$[v].props.children}),(0,r.jsx)(Pi.Z,{className:d.root,"data-testid":"mobile-sidebar-root",component:"nav",children:$})]})})};var ls;(function(e){e.SIDEBAR_PIN_STATE="sidebarPinState"})(ls||(ls={}));const ho={getSidebarPinState(){let e;try{e=JSON.parse(window.localStorage.getItem(ls.SIDEBAR_PIN_STATE)||"true")}catch{return!0}return!!e},setSidebarPinState(e){return window.localStorage.setItem(ls.SIDEBAR_PIN_STATE,JSON.stringify(e))}},Jo=(0,c.Z)(e=>({root:{width:"100%",transition:"padding-left 0.1s ease-out",isolation:"isolate",[e.breakpoints.up("sm")]:{paddingLeft:s=>s.isPinned?s.sidebarConfig.drawerWidthOpen:s.sidebarConfig.drawerWidthClosed},[e.breakpoints.down("xs")]:{paddingBottom:s=>s.sidebarConfig.mobileSidebarHeight}},content:{zIndex:0,isolation:"isolate","&:focus":{outline:0}}}),{name:"BackstageSidebarPage"}),po=(0,g.createContext)({content:{contentRef:void 0}});function Qo(e){const[s,a]=(0,g.useState)(()=>ho.getSidebarPinState()),{sidebarConfig:d}=(0,g.useContext)(tr),p=(0,g.useRef)(null),v=(0,g.useMemo)(()=>({content:{contentRef:p}}),[p]);(0,g.useEffect)(()=>{ho.setSidebarPinState(s)},[s]);const j=(0,Pe.Z)(N=>N.breakpoints.down("xs"),{noSsr:!0}),$=()=>a(!s),K=Jo({isPinned:s,sidebarConfig:d});return(0,r.jsx)(zo,{value:{isPinned:s,toggleSidebarPinState:$,isMobile:j},children:(0,r.jsx)(po.Provider,{value:v,children:(0,r.jsx)(Ee.Z,{className:K.root,children:e.children})})})}function fo(){const{content:e}=(0,g.useContext)(po);return{focusContent:(0,g.useCallback)(()=>{var a,d;e==null||(a=e.contentRef)===null||a===void 0||(d=a.current)===null||d===void 0||d.focus()},[e]),contentRef:e==null?void 0:e.contentRef}}const er=(0,c.Z)(e=>({drawer:s=>({display:"flex",flexFlow:"column nowrap",alignItems:"flex-start",position:"fixed",left:0,top:0,bottom:0,zIndex:e.zIndex.appBar,background:e.palette.navigation.background,overflowX:"hidden",msOverflowStyle:"none",scrollbarWidth:"none",width:s.sidebarConfig.drawerWidthClosed,transition:e.transitions.create("width",{easing:e.transitions.easing.sharp,duration:e.transitions.duration.shortest}),"& > *":{flexShrink:0},"&::-webkit-scrollbar":{display:"none"},"& .MuiButtonBase-root":{textTransform:"none"}}),drawerOpen:s=>({width:s.sidebarConfig.drawerWidthOpen,transition:e.transitions.create("width",{easing:e.transitions.easing.sharp,duration:e.transitions.duration.shorter})}),visuallyHidden:{top:0,position:"absolute",zIndex:1e3,transform:"translateY(-200%)","&:focus":{transform:"translateY(5px)"}}}),{name:"BackstageSidebar"});var Gn;(function(e){e[e.Closed=0]="Closed",e[e.Idle=1]="Idle",e[e.Open=2]="Open"})(Gn||(Gn={}));const Xo=e=>{const{sidebarConfig:s}=(0,g.useContext)(tr),{openDelayMs:a=s.defaultOpenDelayMs,closeDelayMs:d=s.defaultCloseDelayMs,disableExpandOnHover:p,children:v}=e,j=er({sidebarConfig:s}),$=(0,Pe.Z)(Kt=>Kt.breakpoints.down("md"),{noSsr:!0}),[K,N]=(0,g.useState)(Gn.Closed),pe=(0,g.useRef)(),{isPinned:ie,toggleSidebarPinState:xe}=Ur(),Te=()=>{ie||p||(pe.current&&(clearTimeout(pe.current),pe.current=void 0),K!==Gn.Open&&!$&&(pe.current=window.setTimeout(()=>{pe.current=void 0,N(Gn.Open)},a),N(Gn.Idle)))},Ye=()=>{ie||p||(pe.current&&(clearTimeout(pe.current),pe.current=void 0),K===Gn.Idle?N(Gn.Closed):K===Gn.Open&&(pe.current=window.setTimeout(()=>{pe.current=void 0,N(Gn.Closed)},d)))},qe=K===Gn.Open&&!$||ie,Pt=Kt=>{Kt?(N(Gn.Open),xe()):(N(Gn.Closed),xe())};return(0,r.jsxs)("nav",{style:{},"aria-label":"sidebar nav",children:[(0,r.jsx)(go,{}),(0,r.jsx)(Mo,{value:{isOpen:qe,setOpen:Pt},children:(0,r.jsx)(Ee.Z,{className:j.root,"data-testid":"sidebar-root",onMouseEnter:p?()=>{}:Te,onFocus:p?()=>{}:Te,onMouseLeave:p?()=>{}:Ye,onBlur:p?()=>{}:Ye,children:(0,r.jsx)(Ee.Z,{className:ce()(j.drawer,{[j.drawerOpen]:qe}),children:v})})})]})},qo=e=>{var s;const a=Li((s=e.sidebarOptions)!==null&&s!==void 0?s:{});var d;const p=Hn((d=e.submenuOptions)!==null&&d!==void 0?d:{}),{children:v,disableExpandOnHover:j,openDelayMs:$,closeDelayMs:K}=e,{isMobile:N}=Ur();return N?(0,r.jsx)(Yo,{children:v}):(0,r.jsx)(tr.Provider,{value:{sidebarConfig:a,submenuConfig:p},children:(0,r.jsx)(Xo,{openDelayMs:$,closeDelayMs:K,disableExpandOnHover:j,children:v})})};function go(){const{sidebarConfig:e}=(0,g.useContext)(tr),{focusContent:s,contentRef:a}=fo(),d=er({sidebarConfig:e});return a!=null&&a.current?(0,r.jsx)(X.Z,{onClick:s,variant:"contained",className:ce()(d.visuallyHidden),children:"Skip to content"}):null}function mo(e,s){const a=new URLSearchParams(s.search).toString(),d=Js().parse(a),p=new URLSearchParams(e.search).toString(),v=Js().parse(p);return(0,oe.isEqual)(s.pathname,e.pathname)&&(0,oe.isMatch)(v,d)}const _o=(0,c.Z)(e=>({item:{height:48,width:"100%","&:hover":{background:"#6f6f6f",color:e.palette.navigation.selectedColor},display:"flex",alignItems:"center",color:e.palette.navigation.color,padding:e.spacing(2.5),cursor:"pointer",position:"relative",background:"none",border:"none"},itemContainer:{width:"100%"},selected:{background:"#6f6f6f",color:"#FFF"},label:{margin:e.spacing(1.75),marginLeft:e.spacing(1),fontSize:e.typography.body2.fontSize,whiteSpace:"nowrap",overflow:"hidden","text-overflow":"ellipsis",lineHeight:1},subtitle:{fontSize:10,whiteSpace:"nowrap",overflow:"hidden","text-overflow":"ellipsis"},dropdownArrow:{position:"absolute",right:21},dropdown:{display:"flex",flexDirection:"column",alignItems:"end"},dropdownItem:{width:"100%",padding:"10px 0 10px 0","&:hover":{background:"#6f6f6f",color:e.palette.navigation.selectedColor}},textContent:{color:e.palette.navigation.color,paddingLeft:e.spacing(4),paddingRight:e.spacing(1),fontSize:e.typography.body2.fontSize,whiteSpace:"nowrap",overflow:"hidden","text-overflow":"ellipsis"}}),{name:"BackstageSidebarSubmenuItem"}),Zi=e=>{const{title:s,subtitle:a,to:d,icon:p,dropdownItems:v}=e,j=_o(),{setIsHoveredOn:$}=useContext(SidebarItemWithSubmenuContext),K=()=>{$(!1)},N=useResolvedPath(d!=null?d:""),pe=useLocation();let ie=isLocationMatch(pe,N);const[xe,Te]=useState(!1),Ye=()=>{Te(!xe)};return v!==void 0?(v.some(qe=>{const Pt=resolvePath(qe.to);return ie=isLocationMatch(pe,Pt),ie}),_jsxs(Box,{className:j.itemContainer,children:[_jsx(Tooltip,{title:s,enterDelay:500,enterNextDelay:500,children:_jsxs(Button,{role:"button",onClick:Ye,onTouchStart:qe=>qe.stopPropagation(),className:classnames(j.item,ie?j.selected:void 0),children:[p&&_jsx(p,{fontSize:"small"}),_jsxs(Typography,{variant:"subtitle1",className:j.label,children:[s,_jsx("br",{}),a&&_jsx(Typography,{variant:"caption",className:j.subtitle,children:a})]}),xe?_jsx(ArrowDropUpIcon,{className:j.dropdownArrow}):_jsx(ArrowDropDownIcon,{className:j.dropdownArrow})]})}),v&&xe&&_jsx(Box,{className:j.dropdown,children:v.map((qe,Pt)=>_jsx(Tooltip,{title:qe.title,enterDelay:500,enterNextDelay:500,children:_jsx(Link,{to:qe.to,underline:"none",className:j.dropdownItem,onClick:K,onTouchStart:Kt=>Kt.stopPropagation(),children:_jsx(Typography,{className:j.textContent,children:qe.title})})},Pt))})]})):_jsx(Box,{className:j.itemContainer,children:_jsx(Tooltip,{title:s,enterDelay:500,enterNextDelay:500,children:_jsxs(Link,{to:d,underline:"none",className:classnames(j.item,ie?j.selected:void 0),onClick:K,onTouchStart:qe=>qe.stopPropagation(),children:[p&&_jsx(p,{fontSize:"small"}),_jsxs(Typography,{variant:"subtitle1",className:j.label,children:[s,_jsx("br",{}),a&&_jsx(Typography,{variant:"caption",className:j.subtitle,children:a})]})]})})})};var Zs;const Di=(0,c.Z)(e=>({root:{zIndex:1e3,position:"relative",overflow:"visible",width:e.spacing(7)+1},drawer:s=>{var a;return{display:"flex",flexFlow:"column nowrap",alignItems:"flex-start",position:"fixed",[e.breakpoints.up("sm")]:{marginLeft:s.left,transition:e.transitions.create("margin-left",{easing:e.transitions.easing.sharp,duration:e.transitions.duration.shortest})},top:0,bottom:0,padding:0,background:(Zs=(a=e.palette.navigation.submenu)===null||a===void 0?void 0:a.background)!==null&&Zs!==void 0?Zs:"#404040",overflowX:"hidden",msOverflowStyle:"none",scrollbarWidth:"none",cursor:"default",width:s.submenuConfig.drawerWidthClosed,transitionDelay:`${s.submenuConfig.defaultOpenDelayMs}ms`,"& > *":{flexShrink:0},"&::-webkit-scrollbar":{display:"none"}}},drawerOpen:s=>({width:s.submenuConfig.drawerWidthOpen,[e.breakpoints.down("xs")]:{width:"100%",position:"relative",paddingLeft:e.spacing(3),left:0,top:0}}),title:{fontSize:e.typography.h5.fontSize,fontWeight:e.typography.fontWeightMedium,color:"#FFF",padding:e.spacing(2.5),[e.breakpoints.down("xs")]:{display:"none"}}}),{name:"BackstageSidebarSubmenu"}),ei=e=>{const{isOpen:s}=so(),{sidebarConfig:a,submenuConfig:d}=(0,g.useContext)(tr),p=s?a.drawerWidthOpen:a.drawerWidthClosed,v=Di({left:p,submenuConfig:d}),{isHoveredOn:j}=(0,g.useContext)(Do),[$,K]=(0,g.useState)(!1);return(0,g.useEffect)(()=>{K(j)},[j]),(0,r.jsxs)(Ee.Z,{className:ce()(v.drawer,{[v.drawerOpen]:$}),children:[(0,r.jsx)(F.Z,{variant:"h5",className:v.title,children:e.title}),e.children]})};var i=t(26739),n=t(76600),o=t(83543),l=t(59797),f=t(98989);const L=(0,c.Z)({iconContainer:{display:"flex",position:"relative",width:"100%"},arrow1:{right:"6px",position:"absolute"}}),Z=()=>{const e=L();return _jsxs(Box,{className:e.iconContainer,children:[_jsx(Box,{className:e.arrow1,children:_jsx(ArrowBackIosIcon,{style:{fontSize:"12px"}})}),_jsx(Box,{children:_jsx(ArrowBackIosIcon,{style:{fontSize:"12px"}})})]})};var H=null;const se=(0,c.Z)({iconContainer:{display:"flex",position:"relative",width:"100%"},arrow1:{right:"6px",position:"absolute"}}),He=()=>{const e=se();return _jsxs(Box,{className:e.iconContainer,children:[_jsx(Box,{className:e.arrow1,children:_jsx(ArrowForwardIosIcon,{style:{fontSize:"12px"}})}),_jsx(Box,{children:_jsx(ArrowForwardIosIcon,{style:{fontSize:"12px"}})})]})};var De=null,ct,st;const Ct=e=>(0,c.Z)(s=>{var a,d;return{root:{color:s.palette.navigation.color,display:"flex",flexFlow:"row nowrap",alignItems:"center",height:48,cursor:"pointer"},buttonItem:{background:"none",border:"none",width:"100%",margin:0,padding:0,textAlign:"inherit",font:"inherit"},closed:{width:e.drawerWidthClosed,justifyContent:"center"},open:{[s.breakpoints.up("sm")]:{width:e.drawerWidthOpen}},highlightable:{"&:hover":{background:(ct=(a=s.palette.navigation.navItem)===null||a===void 0?void 0:a.hoverBackground)!==null&&ct!==void 0?ct:"#404040"}},highlighted:{background:(st=(d=s.palette.navigation.navItem)===null||d===void 0?void 0:d.hoverBackground)!==null&&st!==void 0?st:"#404040"},label:{fontWeight:"bold",whiteSpace:"nowrap",lineHeight:"auto",flex:"3 1 auto",width:"110px",overflow:"hidden","text-overflow":"ellipsis"},iconContainer:{boxSizing:"border-box",height:"100%",width:e.iconContainerWidth,marginRight:-s.spacing(2),display:"flex",alignItems:"center",justifyContent:"center",lineHeight:"0"},searchRoot:{marginBottom:12},searchField:{color:"#b5b5b5",fontWeight:s.typography.fontWeightBold,fontSize:s.typography.fontSize},searchFieldHTMLInput:{padding:s.spacing(2,0,2)},searchContainer:{width:e.drawerWidthOpen-e.iconContainerWidth},secondaryAction:{width:s.spacing(6),textAlign:"center",marginRight:s.spacing(1)},closedItemIcon:{width:"100%",justifyContent:"center"},submenuArrow:{display:"flex"},expandButton:{background:"none",border:"none",color:s.palette.navigation.color,width:"100%",cursor:"pointer",position:"relative",height:48},arrows:{position:"absolute",right:10},selected:{"&$root":{borderLeft:`solid ${e.selectedIndicatorWidth}px ${s.palette.navigation.indicator}`,color:s.palette.navigation.selectedColor},"&$closed":{width:e.drawerWidthClosed},"& $closedItemIcon":{paddingRight:e.selectedIndicatorWidth},"& $iconContainer":{marginLeft:-e.selectedIndicatorWidth}}}},{name:"BackstageSidebarItem"});function St(e){return(0,g.useMemo)(()=>Ct(e),[e])()}const $t=(e,s)=>(0,W.vJ)(e.props.children,a=>{let d=!1;return a.getElements().forEach(({props:{to:p,dropdownItems:v}})=>{if(!d){if(v!=null&&v.length){v.forEach(({to:j})=>d=d||mo(s,(0,is.i3)(j)));return}p&&(d=mo(s,(0,is.i3)(p)))}}),d},[s.pathname]);function Et(e){return e.to===void 0}const Tn=g.createElement(ei).type,Kn=g.forwardRef(function({to:s,end:a,style:d,className:p,activeStyle:v,caseSensitive:j,activeClassName:$="active","aria-current":K="page",...N},pe){let{pathname:ie}=(0,T.TH)(),{pathname:xe}=(0,T.WU)(s);j||(ie=ie.toLocaleLowerCase("en-US"),xe=xe.toLocaleLowerCase("en-US"));let Te=ie===xe;!Te&&!a&&(Te=ie.startsWith(`${xe}/`));const Ye=Te?K:void 0;return(0,r.jsx)(R.rU,{...N,to:s,ref:pe,"aria-current":Ye,style:{...d,...Te?v:void 0},className:ce()([p,Te?$:void 0])})}),nr=(0,g.forwardRef)((e,s)=>{const{icon:a,text:d,hasNotifications:p=!1,hasSubmenu:v=!1,disableHighlight:j=!1,onClick:$,children:K,className:N,...pe}=e,{sidebarConfig:ie}=(0,g.useContext)(tr),xe=St(ie),{isOpen:Te}=so(),Ye=!Te&&v?{display:"flex",marginLeft:"20px"}:{lineHeight:"0"},qe=(0,r.jsxs)(Ee.Z,{style:Ye,children:[(0,r.jsx)(a,{fontSize:"small"}),!Te&&v?(0,r.jsx)(f.Z,{fontSize:"small"}):(0,r.jsx)(r.Fragment,{})]}),Pt=(0,r.jsx)(i.Z,{color:"secondary",variant:"dot",overlap:"circular",invisible:!p,className:ce()({[xe.closedItemIcon]:!Te}),children:qe}),Kt=(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(Ee.Z,{"data-testid":"login-button",className:xe.iconContainer,children:Pt}),d&&(0,r.jsx)(F.Z,{variant:"subtitle2",className:xe.label,children:d}),(0,r.jsx)("div",{className:xe.secondaryAction,children:K})]}),tn=Te?Kt:Pt,nn={onClick:$,className:ce()(N,xe.root,Te?xe.open:xe.closed,Et(e)&&xe.buttonItem,{[xe.highlightable]:!j})};return Et(e)?(0,r.jsx)(X.Z,{role:"button","aria-label":d,...nn,ref:s,children:tn}):(0,r.jsx)(Kn,{...nn,activeClassName:xe.selected,to:e.to?e.to:"",ref:s,"aria-label":d||e.to,...pe,children:tn})}),cs=({children:e,...s})=>{const{sidebarConfig:a}=(0,g.useContext)(tr),d=St(a),[p,v]=(0,g.useState)(!1),j=(0,T.TH)(),$=$t(e,j),K=(0,Pe.Z)(xe=>xe.breakpoints.down("sm")),N=()=>{v(!0)},pe=()=>{v(!1)},ie=()=>K?p?(0,r.jsx)(l.Z,{fontSize:"small",className:d.submenuArrow}):(0,r.jsx)(o.Z,{fontSize:"small",className:d.submenuArrow}):!p&&(0,r.jsx)(f.Z,{fontSize:"small",className:d.submenuArrow});return(0,r.jsx)(Do.Provider,{value:{isHoveredOn:p,setIsHoveredOn:v},children:(0,r.jsxs)("div",{"data-testid":"item-with-submenu",onMouseLeave:pe,onTouchStart:p?pe:N,onMouseEnter:N,className:ce()(p&&d.highlighted),children:[(0,r.jsx)(nr,{hasSubmenu:!0,className:$?d.selected:"",...s,children:ie()}),p&&e]})})},vo=(0,g.forwardRef)((e,s)=>{const[a]=(0,W.vJ)(e.children,d=>d.getElements().filter(p=>p.type===Tn));return a?(0,r.jsx)(cs,{...e,children:a}):(0,r.jsx)(nr,{...e,ref:s})});function Ni(e){const{sidebarConfig:s}=useContext(SidebarConfigContext),[a,d]=useState(""),p=St(s),v=e.icon?e.icon:SearchIcon,j=()=>{e.onSearch(a),d("")},$=ie=>{ie.key==="Enter"&&(ie.preventDefault(),j())},K=ie=>{d(ie.target.value)},N=ie=>{ie.preventDefault(),ie.stopPropagation()},pe=ie=>{j(),ie.preventDefault()};return _jsx(Box,{className:p.searchRoot,children:_jsx(vo,{icon:v,to:e.to,onClick:pe,disableHighlight:!0,children:_jsx(TextField,{placeholder:"Search",value:a,onClick:N,onChange:K,onKeyDown:$,className:p.searchContainer,InputProps:{disableUnderline:!0,className:p.searchField},inputProps:{className:p.searchFieldHTMLInput}})})})}const yo=(0,n.Z)("div")({flex:1},{name:"BackstageSidebarSpace"}),Fi=(0,n.Z)("div")({height:8},{name:"BackstageSidebarSpacer"}),Ar=(0,n.Z)("hr")(({theme:e})=>({height:1,width:"100%",background:"#383838",border:"none",margin:e.spacing(1.2,0)}),{name:"BackstageSidebarDivider"}),ha=e=>({overflowY:"auto","&::-webkit-scrollbar":{backgroundColor:e.palette.background.default,width:"5px",borderRadius:"5px"},"&::-webkit-scrollbar-thumb":{backgroundColor:e.palette.text.hint,borderRadius:"5px"}}),Wl=(0,n.Z)("div")(({theme:e})=>{const s=ha(e);return{flex:"0 1 auto",overflowX:"hidden",width:"calc(100% - 5px)",minHeight:"48px",overflowY:"hidden","@media (hover: none)":s,"&:hover":s}}),Vl=()=>{const{sidebarConfig:e}=useContext(SidebarConfigContext),s=St(e),{isOpen:a,setOpen:d}=useSidebarOpenState();if(useMediaQuery(j=>j.breakpoints.down("md"),{noSsr:!0}))return null;const v=()=>{d(!a)};return _jsx(Button,{role:"button",onClick:v,className:s.expandButton,"aria-label":"Expand Sidebar","data-testid":"sidebar-expand-button",children:_jsx(Box,{className:s.arrows,children:a?_jsx(DoubleArrowLeft,{}):_jsx(DoubleArrowRight,{})})})},pa=(0,c.Z)(e=>({introCard:s=>({color:"#b5b5b5",fontSize:12,width:s.sidebarConfig.drawerWidthOpen,marginTop:e.spacing(2.25),marginBottom:e.spacing(1.5),paddingLeft:s.sidebarConfig.iconPadding,paddingRight:s.sidebarConfig.iconPadding}),introDismiss:{display:"flex",justifyContent:"flex-end",alignItems:"center",marginTop:e.spacing(1.5)},introDismissLink:{color:"#dddddd",display:"flex",alignItems:"center",marginBottom:e.spacing(.5),"&:hover":{color:e.palette.linkHover,transition:e.transitions.create("color",{easing:e.transitions.easing.sharp,duration:e.transitions.duration.shortest})}},introDismissText:{fontSize:"0.7rem",fontWeight:"bold",textTransform:"uppercase",letterSpacing:1},introDismissIcon:{width:18,height:18,marginRight:e.spacing(1.5)}}),{name:"BackstageSidebarIntro"});function fa(e){const{sidebarConfig:s}=useContext(SidebarConfigContext),a=pa({sidebarConfig:s}),{text:d,onClose:p}=e,v=()=>p();return _jsxs(Box,{className:a.introCard,children:[_jsx(Typography,{variant:"subtitle2",children:d}),_jsx(Box,{className:a.introDismiss,children:_jsxs(IconButton,{onClick:v,className:a.introDismissLink,children:[_jsx(CloseIcon,{className:a.introDismissIcon}),_jsx(Typography,{component:"span",className:a.introDismissText,children:"Dismiss"})]})})]})}const Ui=e=>{const{text:s,onDismiss:a}=e,[d,p]=useState(!1),v=()=>{p(!0)};return _jsx(Collapse,{in:!d,onExited:a,children:_jsx(fa,{text:s,onClose:v})})},ga=null,ma="And your recently viewed plugins will pop up here!";function Hl(e){const{isOpen:s}=useSidebarOpenState(),a={starredItemsDismissed:!1,recentlyViewedItemsDismissed:!1},{value:d,set:p}=useLocalStorageValue(SIDEBAR_INTRO_LOCAL_STORAGE),{starredItemsDismissed:v,recentlyViewedItemsDismissed:j}=d!=null?d:{},$=()=>{p(N=>({...a,...N,starredItemsDismissed:!0}))},K=()=>{p(N=>({...a,...N,recentlyViewedItemsDismissed:!0}))};return s?_jsxs(_Fragment,{children:[!v&&_jsxs(_Fragment,{children:[_jsx(Ui,{text:ga,onDismiss:$}),_jsx(SidebarDivider,{})]}),!j&&_jsx(Ui,{text:ma,onDismiss:K})]}):null}const va=(0,c.Z)(e=>({root:{gridArea:"pageContent",minWidth:0,paddingTop:e.spacing(3),paddingBottom:e.spacing(3),paddingLeft:e.spacing(2),paddingRight:e.spacing(2),[e.breakpoints.up("sm")]:{paddingLeft:e.spacing(3),paddingRight:e.spacing(3)}},stretch:{display:"flex",flexDirection:"column",flexGrow:1},noPadding:{padding:0}}),{name:"BackstageContent"});function Mi(e){const{className:s,stretch:a,noPadding:d,children:p,...v}=e,{contentRef:j}=fo(),$=va();return(0,r.jsx)("article",{ref:j,tabIndex:-1,...v,className:ce()($.root,s,{[$.stretch]:a,[$.noPadding]:d}),children:p})}var ya=t(6487),xa=t(99152);const ba=(0,c.Z)(e=>({tabsWrapper:{gridArea:"pageSubheader",backgroundColor:e.palette.background.paper,paddingLeft:e.spacing(3),minWidth:0},defaultTab:{...e.typography.caption,padding:e.spacing(3,3),textTransform:"uppercase",fontWeight:e.typography.fontWeightBold,color:e.palette.text.secondary},selected:{color:e.palette.text.primary},tabRoot:{"&:hover":{backgroundColor:e.palette.background.default,color:e.palette.text.primary}}}),{name:"BackstageHeaderTabs"});function zi(e){const{tabs:s,onChange:a,selectedIndex:d}=e,[p,v]=(0,g.useState)(d!=null?d:0),j=ba(),$=(0,g.useCallback)((K,N)=>{d===void 0&&v(N),a&&d!==N&&a(N)},[d,a]);return(0,g.useEffect)(()=>{d!==void 0&&v(d)},[d]),(0,r.jsx)(Ee.Z,{className:j.tabsWrapper,children:(0,r.jsx)(xa.Z,{selectionFollowsFocus:!0,indicatorColor:"primary",textColor:"inherit",variant:"scrollable",scrollButtons:"auto","aria-label":"scrollable auto tabs example",onChange:$,value:p,children:s.map((K,N)=>(0,g.createElement)(ya.Z,{...K.tabProps,"data-testid":`header-tab-${N}`,label:K.label,key:K.id,value:N,className:j.defaultTab,classes:{selected:j.selected,root:j.tabRoot}}))})})}function Sa(e){const s=(0,T.UO)(),d=e.map(({path:xe,children:Te})=>({caseSensitive:!1,path:`${xe}/*`,element:Te})).sort((xe,Te)=>Te.path.replace(/\/\*$/,"").localeCompare(xe.path.replace(/\/\*$/,"")));var p;const v=(p=(0,T.V$)(d))!==null&&p!==void 0?p:e[0].children;var j;let $=(j=s["*"])!==null&&j!==void 0?j:"";$.startsWith("/")||($=`/${$}`);var K;const[N]=(K=(0,is.fp)(d,$))!==null&&K!==void 0?K:[],pe=N?e.findIndex(xe=>`${xe.path}/*`===N.route.path):0;var ie;return{index:pe===-1?0:pe,element:v,route:(ie=e[pe])!==null&&ie!==void 0?ie:e[0]}}function Wi(e){const{routes:s}=e,a=(0,T.s0)(),{index:d,route:p,element:v}=Sa(s),j=(0,g.useMemo)(()=>s.map(K=>({id:K.path,label:K.title,tabProps:K.tabProps})),[s]),$=K=>{let{path:N}=s[K];N=N.replace(/\/\*$/,""),N=N.replace(/^\//,""),a(N)};return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(zi,{tabs:j,selectedIndex:d,onChange:$}),(0,r.jsxs)(Mi,{children:[(0,r.jsx)(os.q,{title:p.title}),v]})]})}const ti=()=>null;(0,W.R5)(ti,"core.gatherMountPoints",!0);function Vi(e){const s=(0,r.jsx)(ti,{path:"",title:"",children:(0,r.jsx)("div",{})}).type;return g.Children.toArray(e).flatMap(a=>{if(!(0,g.isValidElement)(a))return[];if(a.type===g.Fragment)return Vi(a.props.children);if(a.type!==s)throw new Error("Child of TabbedLayout must be an TabbedLayout.Route");const{path:d,title:p,children:v,tabProps:j}=a.props;return[{path:d,title:p,children:v,tabProps:j}]})}function Ca(e){const s=Vi(e.children);return(0,r.jsx)(Wi,{routes:s})}Ca.Route=ti;const wa=(0,c.Z)(e=>({value:{marginBottom:e.spacing(.75)},subvalue:{color:e.palette.textSubtle,fontWeight:"normal"}}),{name:"BackstageSubvalueCell"});function ja(e){const{value:s,subvalue:a}=e,d=wa();return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(Ee.Z,{className:d.value,children:s}),(0,r.jsx)(Ee.Z,{className:d.subvalue,children:a})]})}var xo=t(67222),Ea=t(21070),Aa=t(90324),Ta=t(98281),Ia=t(48049),Hi=t(51209),Gi=t(33375),Ra=t(44233),La=t(27604),ni=t(36444),Pa=t(37971),ka=t(59709),Oa=t(17373),Ba=t(3702),$a=t(93111);const Za=(0,c.Z)(e=>({root:{height:"100%",width:"315px",display:"flex",flexDirection:"column",marginRight:e.spacing(3)},value:{fontWeight:"bold",fontSize:18},header:{display:"flex",alignItems:"center",height:e.spacing(7.5),justifyContent:"space-between",borderBottom:`1px solid ${e.palette.grey[500]}`},filters:{display:"flex",flexDirection:"column","& > *":{marginTop:e.spacing(2)}}}),{name:"BackstageTableFilters"}),Da=e=>{var s;const a=Za(),{onChangeFilters:d}=e,[p,v]=(0,g.useState)({...e.selectedFilters}),[j,$]=(0,g.useState)(!1),K=()=>{v({}),$(N=>!N)};return(0,g.useEffect)(()=>{d(p)},[p,d]),(0,r.jsxs)(Ee.Z,{className:a.root,children:[(0,r.jsxs)(Ee.Z,{className:a.header,children:[(0,r.jsx)(Ee.Z,{className:a.value,children:"Filters"}),(0,r.jsx)(X.Z,{color:"primary",onClick:K,children:"Clear all"})]}),(0,r.jsx)(Ee.Z,{className:a.filters,children:((s=e.filters)===null||s===void 0?void 0:s.length)&&e.filters.map(N=>(0,r.jsx)(Ze,{triggerReset:j,...N.element,selected:p[N.element.label],onChange:pe=>v({...p,[N.element.label]:pe})},N.element.label))})]})},Ki={Add:(0,g.forwardRef)((e,s)=>(0,r.jsx)(Ea.Z,{...e,ref:s})),Check:(0,g.forwardRef)((e,s)=>(0,r.jsx)(Ta.Z,{...e,ref:s})),Clear:(0,g.forwardRef)((e,s)=>(0,r.jsx)(Gi.Z,{...e,ref:s})),Delete:(0,g.forwardRef)((e,s)=>(0,r.jsx)(Ra.Z,{...e,ref:s})),DetailPanel:(0,g.forwardRef)((e,s)=>(0,r.jsx)(Hi.Z,{...e,ref:s})),Edit:(0,g.forwardRef)((e,s)=>(0,r.jsx)(La.Z,{...e,ref:s})),Export:(0,g.forwardRef)((e,s)=>(0,r.jsx)(Ba.Z,{...e,ref:s})),Filter:(0,g.forwardRef)((e,s)=>(0,r.jsx)(ni.Z,{...e,ref:s})),FirstPage:(0,g.forwardRef)((e,s)=>(0,r.jsx)(Pa.Z,{...e,ref:s})),LastPage:(0,g.forwardRef)((e,s)=>(0,r.jsx)(ka.Z,{...e,ref:s})),NextPage:(0,g.forwardRef)((e,s)=>(0,r.jsx)(Hi.Z,{...e,ref:s})),PreviousPage:(0,g.forwardRef)((e,s)=>(0,r.jsx)(Ia.Z,{...e,ref:s})),ResetSearch:(0,g.forwardRef)((e,s)=>(0,r.jsx)(Gi.Z,{...e,ref:s})),Search:(0,g.forwardRef)((e,s)=>(0,r.jsx)(ni.Z,{...e,ref:s})),SortArrow:(0,g.forwardRef)((e,s)=>(0,r.jsx)(Aa.Z,{...e,ref:s})),ThirdStateCheck:(0,g.forwardRef)((e,s)=>(0,r.jsx)(Oa.Z,{...e,ref:s})),ViewColumn:(0,g.forwardRef)((e,s)=>(0,r.jsx)($a.Z,{...e,ref:s}))};function Yi(e,s){const a=s.split(".");let d=e[a[0]];for(let p=1;p<a.length;++p){if(d===void 0)return d;const v=a[p];d=d[v]}return d}const Na=(0,on.Z)(e=>({header:{padding:e.spacing(1,2,1,2.5),borderTop:`1px solid ${e.palette.grey.A100}`,borderBottom:`1px solid ${e.palette.grey.A100}`,color:e.palette.textSubtle,fontWeight:e.typography.fontWeightBold,position:"static",wordBreak:"normal"}}),{name:"BackstageTableHeader"})(xo.W$),Ji=(0,on.Z)(e=>({root:{padding:e.spacing(3,0,2.5,2.5)},title:{"& > h6":{fontWeight:e.typography.fontWeightBold}},searchField:{paddingRight:e.spacing(2)}}),{name:"BackstageTableToolbar"})(xo.UW),Fa=(0,c.Z)(e=>({root:{display:"flex",alignItems:"center",justifyContent:"space-between"},title:{fontWeight:e.typography.fontWeightBold,fontSize:18,whiteSpace:"nowrap"}}),{name:"BackstageTableFiltersContainer"}),Ua=(0,c.Z)(()=>({root:{display:"flex",alignItems:"start"}}),{name:"BackstageTable"});function Ma(e,s){return e.map(a=>{const d={};let p=a.cellStyle||{};if(a.highlight)if(d.color=s.palette.textContrast,typeof p=="object")p.fontWeight=s.typography.fontWeightBold;else{const v=p;p=(j,$,K)=>({...v(j,$,K),fontWeight:s.typography.fontWeightBold})}return{...a,headerStyle:d,cellStyle:p}})}function za(e,s){return(0,oe.transform)(e,(a,d,p)=>{(0,oe.isEqual)(d,s[p])||(a[p]=d)})}const Qi={search:"",filtersOpen:!1,filters:{}};function Wa(e){const{toolbarRef:s,setSearch:a,hasFilters:d,selectedFiltersLength:p,toggleFilters:v}=e,j=Fa(),$=(0,g.useCallback)(K=>{e.onSearchChanged(K),a(K)},[e,a]);return d?(0,r.jsxs)(Ee.Z,{className:j.root,children:[(0,r.jsxs)(Ee.Z,{className:j.root,children:[(0,r.jsx)(ft.Z,{onClick:v,"aria-label":"filter list",children:(0,r.jsx)(ni.Z,{})}),(0,r.jsxs)(F.Z,{className:j.title,children:["Filters (",p,")"]})]}),(0,r.jsx)(Ji,{...e,ref:s,onSearchChanged:$})]}):(0,r.jsx)(Ji,{...e,ref:s,onSearchChanged:$})}function Xi(e){const{data:s,columns:a,options:d,title:p,subtitle:v,filters:j,initialState:$,emptyContent:K,onStateChange:N,components:pe,...ie}=e,xe=Ua(),Te=(0,Ke.Z)(),Ye={...Qi,...$},[qe,Pt]=(0,g.useState)(Ye.filtersOpen),Kt=(0,g.useCallback)(()=>Pt(Dn=>!Dn),[Pt]),[tn,nn]=(0,g.useState)(0),[kt,_t]=(0,g.useState)(s),[Yt,vr]=(0,g.useState)(Ye.filters),yr=Ma(a,Te),[xr,br]=(0,g.useState)(Ye.search);(0,g.useEffect)(()=>{if(N){const Dn=za({search:xr,filtersOpen:qe,filters:Yt},Qi);N(Dn)}},[xr,qe,Yt,N]);const ai={headerStyle:{textTransform:"uppercase"}},Tr=(0,g.useCallback)(Dn=>{var cr;return(cr=a.find(Mr=>Mr.title===Dn))===null||cr===void 0?void 0:cr.field},[a]);(0,g.useEffect)(()=>{if(typeof s=="function")return;if(!Yt){_t(s);return}const Dn=Object.values(Yt);if(s&&Dn.flat().length){const cr=s.filter(Mr=>!!Object.entries(Yt).filter(([,zr])=>!!zr.length).every(([zr,an])=>{const mn=Yi(Mr,Tr(zr));return Array.isArray(mn)&&Array.isArray(an)?mn.some(us=>an.includes(us)):Array.isArray(mn)?mn.includes(an):Array.isArray(an)?an.includes(mn):mn===an}));_t(cr)}else _t(s);nn(Dn.flat().length)},[s,Yt,Tr]);const li=(Dn,cr)=>{const Mr=an=>{const mn=new Set,us=Wr=>{Wr!=null&&mn.add(Wr)};return cr&&cr.forEach(Wr=>{const Ns=Yi(Wr,Tr(an));Array.isArray(Ns)?Ns.forEach(us):us(Ns)}),mn},zr=an=>({placeholder:"All results",label:an.column,multiple:an.type==="multiple-select",items:[...Mr(an.column)].sort().map(mn=>({label:mn,value:mn}))});return Dn.map(an=>({type:an.type,element:zr(an)}))},Jt=!!(j!=null&&j.length),ds=(0,g.useCallback)(Dn=>(0,r.jsx)(Wa,{setSearch:br,hasFilters:Jt,selectedFiltersLength:tn,toggleFilters:Kt,...Dn}),[Kt,Jt,tn,br]),So=typeof s!="function"&&s.length===0,Ir=a.length,ci=(0,g.useCallback)(Dn=>K&&So?(0,r.jsx)("tbody",{children:(0,r.jsx)("tr",{children:(0,r.jsx)("td",{colSpan:Ir,children:K})})}):(0,r.jsx)(xo.os,{...Dn}),[So,K,Ir]);return(0,r.jsxs)(Ee.Z,{className:xe.root,children:[qe&&s&&typeof s!="function"&&(j==null?void 0:j.length)&&(0,r.jsx)(Da,{filters:li(j,s),selectedFilters:Yt,onChangeFilters:vr}),(0,r.jsx)(xo.ZP,{components:{Header:Na,Toolbar:ds,Body:ci,...pe},options:{...ai,...d},columns:yr,icons:Ki,title:(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(F.Z,{variant:"h5",component:"h2",children:p}),v&&(0,r.jsx)(F.Z,{color:"textSecondary",variant:"body1",children:v})]}),data:typeof s=="function"?s:kt,style:{width:"100%"},localization:{toolbar:{searchPlaceholder:"Filter",searchTooltip:"Filter"}},...ie})]})}Xi.icons=Object.freeze(Ki);const Gl=e=>{const{children:s,value:a,index:d,...p}=e;return _jsx(Box,{role:"tabpanel",hidden:a!==d,"aria-labelledby":`scrollable-auto-tab-${d}`,...p,children:a===d&&_jsx(Box,{p:3,children:s})})},Va=(0,c.Z)(e=>({root:{color:"#6E6E6E",overflow:"visible",fontSize:e.typography.h5.fontSize,textAlign:"center",borderRadius:"50%",backgroundColor:"#E6E6E6",marginLeft:s=>s.isNext?"auto":"0",marginRight:s=>s.isNext?"0":e.spacing(1.25),"&:hover":{backgroundColor:"#E6E6E6",opacity:"1"}}}),{name:"BackstageTabIcon"}),Kl=e=>{const s=Va(e),{ariaLabel:a,onClick:d}=e;return _jsx(IconButton,{onClick:d,className:s.root,size:"small",disableRipple:!0,disableFocusRipple:!0,"aria-label":a,children:e.children})},Ha=(e,s)=>s?e?"20px":"0":"40px",Ga=(0,c.Z)(e=>({root:{textTransform:"none",height:"64px",fontWeight:e.typography.fontWeightBold,fontSize:e.typography.pxToRem(13),color:e.palette.textSubtle,marginLeft:s=>Ha(s.isFirstNav,s.isFirstIndex),width:"130px",minWidth:"130px","&:hover":{outline:"none",backgroundColor:"transparent",color:e.palette.textSubtle}}}),{name:"BackstageTab"}),Yl=e=>{const s=Ga(e),{isFirstNav:a,isFirstIndex:d,...p}=e;return _jsx(Tab,{classes:s,disableRipple:!0,...p})},Ka=(0,c.Z)(e=>({indicator:{display:"flex",justifyContent:"center",backgroundColor:e.palette.tabbar.indicator,height:e.spacing(.5)},flexContainer:{alignItems:"center"},root:{"&:last-child":{marginLeft:"auto"}}}),{name:"BackstageTabBar"}),Jl=e=>{const s=Ka(e);return _jsx(Tabs,{classes:s,...e,TabIndicatorProps:{children:_jsx(Typography,{component:"span"})}})},Ya=(0,c.Z)(e=>({root:{flexGrow:1,width:"100%"},styledTabs:{backgroundColor:e.palette.background.paper},appbar:{boxShadow:"none",backgroundColor:e.palette.background.paper,paddingLeft:e.spacing(1.25),paddingRight:e.spacing(1.25)}}),{name:"BackstageTabs"});function Ql(e){const{tabs:s}=e,a=Ya(),[d,p]=useState([0,0]),[v,j]=useState(0),[$,K]=useState(0),[N,pe]=useState([[]]),ie=useRef(),{width:xe}=useWindowSize(),Te=(tn,nn)=>{p([v,nn])},Ye=()=>{j(v-1)},qe=()=>{j(v+1)},Pt=()=>v+1<N.length;useEffect(()=>{const nn=v===0?1:2,kt=ie.current.offsetWidth-20-nn*30,_t=d[0]*$+d[1],Yt=Math.floor(kt/170);K(Yt),pe(chunkArray(s,Yt)),p([Math.floor(_t/Yt),_t%Yt])},[xe,s]);const Kt=v===d[0]?d[1]:!1;return _jsxs(Box,{className:a.root,children:[_jsx(AppBar,{ref:ie,className:a.appbar,position:"static",children:_jsx(Box,{children:_jsxs(StyledTabs,{value:Kt,onChange:Te,selectionFollowsFocus:!0,children:[v!==0&&_jsx(StyledIcon,{onClick:Ye,ariaLabel:"navigate-before",children:_jsx(NavigateBeforeIcon,{})}),N[v].map((tn,nn)=>_jsx(StyledTab,{value:nn,isFirstIndex:nn===0,isFirstNav:v===0,icon:tn.icon||void 0,label:tn.label||void 0},nn)),Pt()&&_jsx(StyledIcon,{isNext:!0,onClick:qe,ariaLabel:"navigate-next",children:_jsx(NavigateNextIcon,{})})]})})}),Kt!==!1?N[v].map((tn,nn)=>_jsx(TabPanel,{value:nn,index:Kt,children:tn.content},nn)):_jsx(TabPanel,{value:d[1],index:d[1],children:N[d[0]][d[1]].content},"panel_outside_chunked_array")]})}var Xl=t(44311);function Ja(e,s){const a=e[e.length-1];if(!!a)return a>=.9?s.palette.status.ok:a>=.5?s.palette.status.warning:s.palette.status.error}function ql(e){const s=useTheme();if(!e.data)return null;var a;return _jsxs(Sparklines,{width:120,height:30,min:0,max:1,...e,children:[e.title&&_jsx("title",{children:e.title}),_jsx(SparklinesLine,{color:(a=e.color)!==null&&a!==void 0?a:Ja(e.data,s)})]})}const Qa=e=>(0,c.Z)(s=>({container:{width:"100%",display:"flex",flexDirection:"row",flexWrap:"wrap",justifyContent:"flex-end",alignItems:"center",marginBottom:s.spacing(2),textAlign:e.textAlign},leftItemsBox:{flex:"1 1 auto",minWidth:0,overflow:"visible"},rightItemsBox:{flex:"0 1 auto",display:"flex",flexDirection:"row",flexWrap:"wrap",alignItems:"center",marginLeft:s.spacing(1),minWidth:0,overflow:"visible"},description:{},title:{display:"inline-flex",marginBottom:0}}),{name:"BackstageContentHeader"}),Xa=({title:e="Unknown page",className:s})=>(0,r.jsx)(F.Z,{variant:"h4",component:"h2",className:s,"data-testid":"header-title",children:e});function qa(e){const{description:s,title:a,titleComponent:d=void 0,children:p,textAlign:v="left"}=e,j=Qa({textAlign:v})(),$=d||(0,r.jsx)(Xa,{title:a,className:j.title});return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(os.q,{title:a}),(0,r.jsxs)(Ee.Z,{className:j.container,children:[(0,r.jsxs)(Ee.Z,{className:j.leftItemsBox,children:[$,s&&(0,r.jsx)(F.Z,{className:j.description,variant:"body2",children:s})]}),(0,r.jsx)(Ee.Z,{className:j.rightItemsBox,children:p})]})]})}var _a=t.p+"static/mic-drop.fe3ef4d0..svg";const el=(0,c.Z)(e=>({micDrop:{maxWidth:"60%",bottom:e.spacing(2),right:e.spacing(2),[e.breakpoints.down("xs")]:{maxWidth:"96%",bottom:"unset",right:"unset",margin:`${e.spacing(10)}px auto ${e.spacing(4)}px`}}}),{name:"BackstageErrorPageMicDrop"}),tl=()=>{const e=el();return(0,r.jsx)("img",{src:_a,className:e.micDrop,alt:"Girl dropping mic from her hands"})},nl=(0,c.Z)(e=>({container:{padding:e.spacing(8),[e.breakpoints.down("xs")]:{padding:e.spacing(2)}},title:{paddingBottom:e.spacing(5),[e.breakpoints.down("xs")]:{paddingBottom:e.spacing(4),fontSize:e.typography.h3.fontSize}},subtitle:{color:e.palette.textSubtle}}),{name:"BackstageErrorPage"});function rl(e){const{status:s,statusMessage:a,additionalInfo:d,supportUrl:p}=e,v=nl(),j=(0,T.s0)(),$=eo();return(0,r.jsxs)(Be.Z,{container:!0,spacing:0,className:v.container,children:[(0,r.jsxs)(Be.Z,{item:!0,xs:12,sm:8,md:4,children:[(0,r.jsxs)(F.Z,{"data-testid":"error",variant:"body1",className:v.subtitle,children:["ERROR ",s,": ",a]}),(0,r.jsx)(F.Z,{variant:"body1",className:v.subtitle,children:d}),(0,r.jsx)(F.Z,{variant:"h2",className:v.title,children:"Looks like someone dropped the mic!"}),(0,r.jsxs)(F.Z,{variant:"h6",children:[(0,r.jsx)(_e,{to:"#","data-testid":"go-back-link",onClick:()=>j(-1),children:"Go back"}),"... or please"," ",(0,r.jsx)(_e,{to:p||$.url,children:"contact support"})," if you think this is a bug."]})]}),(0,r.jsx)(tl,{})]})}var sl=t(16173);const ol=(0,on.Z)({root:{textDecoration:"underline",cursor:"pointer"}},{name:"BackstageBreadcrumbsClickableText"})(F.Z),ri=(0,on.Z)({root:{textDecoration:"underline",color:"inherit"}},{name:"BackstageBreadcrumbsStyledBox"})(Ee.Z);function il(e){const{children:s,...a}=e,[d,p]=g.useState(null),v=g.Children.toArray(s),[j,$,...K]=v,N=K.length?K.pop():v[v.length-1],pe=v.length>3,ie=Ye=>{p(Ye.currentTarget)},xe=()=>{p(null)},Te=Boolean(d);return(0,r.jsxs)(g.Fragment,{children:[(0,r.jsxs)(sl.Z,{"aria-label":"breadcrumb",...a,children:[v.length>1&&(0,r.jsx)(ri,{clone:!0,children:j}),v.length>2&&(0,r.jsx)(ri,{clone:!0,children:$}),pe&&(0,r.jsx)(ol,{onClick:ie,children:"..."}),(0,r.jsx)(Ee.Z,{style:{fontStyle:"italic"},children:N})]}),(0,r.jsx)(ss.ZP,{open:Te,anchorEl:d,onClose:xe,anchorOrigin:{vertical:"bottom",horizontal:"left"},transformOrigin:{vertical:"top",horizontal:"left"},children:(0,r.jsx)(jt.Z,{children:K.map((Ye,qe)=>(0,r.jsx)(at.Z,{button:!0,children:(0,r.jsx)(ri,{clone:!0,children:Ye})},qe))})})]})}const al=(0,c.Z)(e=>({header:{gridArea:"pageHeader",padding:e.spacing(3),width:"100%",boxShadow:e.shadows[4],position:"relative",zIndex:100,display:"flex",flexDirection:"row",alignItems:"center",backgroundImage:e.page.backgroundImage,backgroundPosition:"center",backgroundSize:"cover",[e.breakpoints.down("sm")]:{flexWrap:"wrap"}},leftItemsBox:{maxWidth:"100%",flexGrow:1},rightItemsBox:{width:"auto",alignItems:"center"},title:{color:e.page.fontColor,wordBreak:"break-word",fontSize:e.typography.h3.fontSize,marginBottom:0},subtitle:{color:e.page.fontColor,opacity:.8,display:"inline-block",marginTop:e.spacing(1),maxWidth:"75ch"},type:{textTransform:"uppercase",fontSize:11,opacity:.8,marginBottom:e.spacing(1),color:e.page.fontColor},breadcrumb:{color:e.page.fontColor},breadcrumbType:{fontSize:"inherit",opacity:.7,marginRight:-e.spacing(.3),marginBottom:e.spacing(.3)},breadcrumbTitle:{fontSize:"inherit",marginLeft:-e.spacing(.3),marginBottom:e.spacing(.3)}}),{name:"BackstageHeader"}),ll=({type:e,typeLink:s,classes:a,pageTitle:d})=>e?s?(0,r.jsxs)(il,{className:a.breadcrumb,children:[(0,r.jsx)(_e,{to:s,children:e}),(0,r.jsx)(F.Z,{children:d})]}):(0,r.jsx)(F.Z,{className:a.type,children:e}):null,cl=({pageTitle:e,classes:s,tooltip:a})=>{const d=(0,r.jsx)(F.Z,{className:s.title,variant:"h1",children:e});return a?(0,r.jsx)(nt.ZP,{title:a,placement:"top-start",children:d}):d},dl=({classes:e,subtitle:s})=>s?typeof s!="string"?(0,r.jsx)(r.Fragment,{children:s}):(0,r.jsx)(F.Z,{className:e.subtitle,variant:"subtitle2",component:"span",children:s}):null;function qi(e){const{children:s,pageTitleOverride:a,style:d,subtitle:p,title:v,tooltip:j,type:$,typeLink:K}=e,N=al(),ie=(0,W.h_)(W.Ds).getOptionalString("app.title")||"Backstage",xe=a||v,Te=v||a,Ye=`${xe} | %s | ${ie}`,qe=`${xe} | ${ie}`;return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(os.q,{titleTemplate:Ye,defaultTitle:qe}),(0,r.jsxs)("header",{style:d,className:N.header,children:[(0,r.jsxs)(Ee.Z,{className:N.leftItemsBox,children:[(0,r.jsx)(ll,{classes:N,type:$,typeLink:K,pageTitle:Te}),(0,r.jsx)(cl,{classes:N,pageTitle:Te,tooltip:j}),(0,r.jsx)(dl,{classes:N,subtitle:p})]}),(0,r.jsx)(Be.Z,{container:!0,className:N.rightItemsBox,spacing:4,children:s})]})]})}const ul=({label:e,secondaryLabel:s,icon:a,disabled:d=!1,onClick:p})=>_jsx(Fragment,{children:_jsxs(ListItem,{"data-testid":"header-action-item",disabled:d,button:!0,onClick:v=>{p&&p(v)},children:[a&&_jsx(ListItemIcon,{children:a}),_jsx(ListItemText,{primary:e,secondary:s})]})});function _l(e){const{actionItems:s}=e,[a,d]=React.useState(!1),p=React.useRef(null);return _jsxs(Fragment,{children:[_jsx(IconButton,{onClick:()=>d(!0),"data-testid":"header-action-menu",ref:p,style:{color:"white",height:56,width:56,marginRight:-4,padding:0},children:_jsx(MoreVert,{})}),_jsx(Popover,{open:a,anchorEl:p.current,anchorOrigin:{horizontal:"right",vertical:"bottom"},transformOrigin:{horizontal:"right",vertical:"top"},onClose:()=>d(!1),children:_jsx(List,{children:s.map((v,j)=>_jsx(ul,{...v},`header-action-menu-${j}`))})})]})}const hl=(0,c.Z)(e=>({root:{textAlign:"left"},label:{color:e.palette.common.white,fontWeight:e.typography.fontWeightBold,letterSpacing:0,fontSize:e.typography.fontSize,marginBottom:e.spacing(1)/2,lineHeight:1},value:{color:"rgba(255, 255, 255, 0.8)",fontSize:e.typography.fontSize,lineHeight:1}}),{name:"BackstageHeaderLabel"}),pl=({value:e,className:s})=>(0,r.jsx)(F.Z,{className:s,children:e});function fl(e){const{label:s,value:a,url:d}=e,p=hl(),v=(0,r.jsx)(pl,{className:p.value,value:a||"<Unknown>"});return(0,r.jsx)(Be.Z,{item:!0,children:(0,r.jsxs)(F.Z,{component:"span",className:p.root,children:[(0,r.jsx)(F.Z,{className:p.label,children:s}),d?(0,r.jsx)(_e,{to:d,children:v}):v]})})}const gl=e=>(0,P.Z)({root:{color:e.palette.common.white,padding:e.spacing(2,2,3),backgroundImage:e.getPageTheme({themeId:"card"}).backgroundImage,backgroundPosition:0,backgroundSize:"inherit"}}),ml=(0,c.Z)(gl,{name:"BackstageItemCardHeader"});function vl(e){const{title:s,subtitle:a,children:d}=e,p=ml(e);return(0,r.jsxs)(Ee.Z,{className:p.root,children:[a&&(0,r.jsx)(F.Z,{variant:"subtitle2",component:"h3",children:a}),s&&(0,r.jsx)(F.Z,{variant:"h6",component:"h4",children:s}),d]})}function ec(e){const{description:s,tags:a,title:d,type:p,subtitle:v,label:j,onClick:$,href:K}=e;return _jsxs(Card,{children:[_jsx(CardMedia,{children:_jsx(ItemCardHeader,{title:d,subtitle:v||p})}),_jsxs(CardContent,{children:[a!=null&&a.length?_jsx(Box,{children:a.map((N,pe)=>_jsx(Chip,{size:"small",label:N},pe))}):null,s]}),_jsxs(CardActions,{children:[!K&&_jsx(Button,{to:"#",onClick:$,color:"primary",children:j}),K&&_jsx(Button,{to:K,color:"primary",children:j})]})]})}const yl=e=>(0,P.Z)({root:{display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(22em, 1fr))",gridAutoRows:"1fr",gridGap:e.spacing(2)}}),xl=(0,c.Z)(yl,{name:"BackstageItemCardGrid"});function bl(e){const{children:s,...a}=e,d=xl(a);return(0,r.jsx)(Ee.Z,{className:d.root,...a,children:s})}var Sl=t(41547);const Cl=(0,c.Z)(()=>({root:({isMobile:e})=>({display:"grid",gridTemplateAreas:"'pageHeader pageHeader pageHeader' 'pageSubheader pageSubheader pageSubheader' 'pageNav pageContent pageSidebar'",gridTemplateRows:"max-content auto 1fr",gridTemplateColumns:"auto 1fr auto",height:e?"100%":"100vh",overflowY:"auto"})}),{name:"BackstagePage"});function _i(e){const{themeId:s,children:a}=e,{isMobile:d}=Ur(),p=Cl({isMobile:d});return(0,r.jsx)(Sl.Z,{theme:v=>({...v,page:v.getPageTheme({themeId:s})}),children:(0,r.jsx)("main",{className:p.root,children:a})})}function wl(e){const{themeId:s,children:a,...d}=e;return(0,r.jsxs)(_i,{themeId:s,children:[(0,r.jsx)(qi,{...d}),a]})}var Qn=t(30195);const tc=Qn.z.object({providerInfo:Qn.z.object({}).catchall(Qn.z.unknown()).optional(),profile:Qn.z.object({email:Qn.z.string().optional(),displayName:Qn.z.string().optional(),picture:Qn.z.string().optional()}),backstageIdentity:Qn.z.object({token:Qn.z.string(),identity:Qn.z.object({type:Qn.z.literal("user"),userEntityRef:Qn.z.string(),ownershipEntityRefs:Qn.z.array(Qn.z.string())})})}),ea={defaultTokenExpiryMillis:5*60*1e3,tokenExpiryMarginMillis:5*60*1e3};function jl(e){const s=new Date(Date.now()+ea.defaultTokenExpiryMillis);if(!e)return s;const[a,d,p]=e.split("."),v=JSON.parse(window.atob(d));return typeof v.exp!="number"?s:new Date(v.exp*1e3-ea.tokenExpiryMarginMillis)}class nc{async start(){await this.getSessionAsync()}getUserId(){const{backstageIdentity:s}=this.getSessionSync(),a=s.identity.userEntityRef,d=/^([^:/]+:)?([^:/]+\/)?([^:/]+)$/.exec(a);if(!d)throw new TypeError(`Invalid user entity reference "${a}"`);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 s=this.state.type==="active"?this.state.session:void 0,a=this.fetchSession().then(d=>(this.state={type:"active",session:d,expiresAt:jl(d.backstageIdentity.token)},d),d=>{throw this.state={type:"failed",error:d},d});return this.state={type:"fetching",promise:a,previous:s},a}async fetchSession(){const s=await this.options.discoveryApi.getBaseUrl("auth"),a=typeof this.options.headers=="function"?await this.options.headers():this.options.headers,d=new Headers(a);d.set("X-Requested-With","XMLHttpRequest");const p=await fetch(`${s}/${this.options.provider}/refresh`,{signal:this.abortController.signal,headers:d,credentials:"include"});if(!p.ok)throw await ResponseError.fromResponse(p);return proxiedSessionSchema.parse(await p.json())}constructor(s){this.options=s,this.abortController=new AbortController,this.state={type:"empty"}}}const rc=e=>{const s=useApi(discoveryApiRef),[{status:a,error:d},{execute:p}]=useAsync(async()=>{const v=new ProxiedSignInIdentity({provider:e.provider,discoveryApi:s,headers:e.headers});await v.start(),e.onSignInSuccess(v)});return useMountEffect(p),a==="loading"?_jsx(Progress,{}):d?_jsx(ErrorPanel,{title:"You do not appear to be signed in. Please try reloading the browser page.",error:d}):null},El=(0,c.Z)({container:{padding:0,listStyle:"none"},item:{display:"flex",flexDirection:"column",width:"100%",maxWidth:"400px",margin:0,padding:0}},{name:"BackstageSignInPage"}),si=({children:e})=>{const s=El();return(0,r.jsx)(Be.Z,{component:"li",item:!0,classes:s,children:e})};class oi{getUserId(){return"guest"}async getIdToken(){}getProfile(){return{email:"guest@example.com",displayName:"Guest"}}async getProfileInfo(){return{email:"guest@example.com",displayName:"Guest"}}async getBackstageIdentity(){const s="user:default/guest";return{type:"user",userEntityRef:s,ownershipEntityRefs:[s]}}async getCredentials(){return{}}async signOut(){}}function Al(e){const[s,a,d]=e.split(".");return JSON.parse(window.atob(a))}class ii{getUserId(){return this.result.userId}static fromResult(s){return new ii(s)}async getIdToken(){var s,a;return(a=(s=this.result).getIdToken)===null||a===void 0?void 0:a.call(s)}getProfile(){return this.result.profile}async getProfileInfo(){return this.result.profile}async getBackstageIdentity(){const s=await this.getIdToken();if(!s){const p=`user:default/${this.getUserId()}`;return{type:"user",userEntityRef:p,ownershipEntityRefs:[p]}}const{sub:a,ent:d}=Al(s);return{type:"user",userEntityRef:a,ownershipEntityRefs:d!=null?d:[]}}async getCredentials(){var s,a;return{token:await((a=(s=this.result).getIdToken)===null||a===void 0?void 0:a.call(s))}}async signOut(){var s,a;return(a=(s=this.result).signOut)===null||a===void 0?void 0:a.call(s)}constructor(s){this.result=s}}class Ds{static createGuest(){return new oi}static fromLegacy(s){return ii.fromResult(s)}static create(s){return new Ds(s.identity,s.authApi,s.profile)}getUserId(){const s=this.identity.userEntityRef,a=/^([^:/]+:)?([^:/]+\/)?([^:/]+)$/.exec(s);if(!a)throw new TypeError(`Invalid user entity reference "${s}"`);return a[3]}async getIdToken(){return(await this.authApi.getBackstageIdentity()).token}getProfile(){if(!this.profile)throw new Error("The identity API does not implement synchronous profile fetching, use getProfileInfo() instead");return this.profile}async getProfileInfo(){if(this.profilePromise)return await this.profilePromise;try{return this.profilePromise=this.authApi.getProfile(),await this.profilePromise}catch(s){throw this.profilePromise=void 0,s}}async getBackstageIdentity(){return this.identity}async getCredentials(){return{token:(await this.authApi.getBackstageIdentity()).token}}async signOut(){return this.authApi.signOut()}constructor(s,a,d){this.identity=s,this.authApi=a,this.profile=d}}const Tl={Component:({config:e,onSignInSuccess:s})=>{const{apiRef:a,title:d,message:p}=e,v=(0,W.h_)(a),j=(0,W.h_)(W.VE),$=async()=>{try{const K=await v.getBackstageIdentity({instantPopup:!0});if(!K)throw new Error(`The ${d} provider is not configured to support sign-in`);const N=await v.getProfile();s(Ds.create({identity:K.identity,profile:N,authApi:v}))}catch(K){j.post(new ms.SP("Login failed",K))}};return(0,r.jsx)(si,{children:(0,r.jsx)(wr,{variant:"fullHeight",title:d,actions:(0,r.jsx)(X.Z,{color:"primary",variant:"outlined",onClick:$,children:"Sign In"}),children:(0,r.jsx)(F.Z,{variant:"body1",children:p})})})},loader:async(e,s)=>{const a=e.get(s),d=await a.getBackstageIdentity({optional:!0});if(!d)return;const p=await a.getProfile();return Ds.create({identity:d.identity,profile:p,authApi:a})}},Il={Component:({onSignInSuccess:e})=>(0,r.jsx)(si,{children:(0,r.jsx)(wr,{title:"Guest",variant:"fullHeight",actions:(0,r.jsx)(X.Z,{color:"primary",variant:"outlined",onClick:()=>e(new oi),children:"Enter"}),children:(0,r.jsxs)(F.Z,{variant:"body1",children:["Enter as a Guest User.",(0,r.jsx)("br",{}),"You will not have a verified identity,",(0,r.jsx)("br",{}),"meaning some features might be unavailable."]})})}),loader:async()=>new oi};var Rl=t(63955),ta=t(86619),na=t(74828),Ll=t(45455),Pl=t.n(Ll);const kl=/^[a-z0-9_\-]+\.[a-z0-9_\-]+\.[a-z0-9_\-]+$/i,Ol=(0,c.Z)(e=>({form:{display:"flex",flexFlow:"column nowrap"},button:{alignSelf:"center",marginTop:e.spacing(2)}}),{name:"BackstageCustomProvider"}),ra=e=>{const{ref:s,...a}=e;return{inputRef:s,...a}},Bl={Component:({onSignInSuccess:e})=>{const s=Ol(),{register:a,handleSubmit:d,formState:p}=(0,Rl.cI)({mode:"onChange"}),{errors:v}=p,j=({userId:$,idToken:K})=>{e(Ds.fromLegacy({userId:$,getIdToken:K!==void 0?async()=>K:void 0,profile:{email:`${$}@example.com`}}))};return(0,r.jsx)(si,{children:(0,r.jsxs)(wr,{title:"Custom User",variant:"fullHeight",children:[(0,r.jsxs)(F.Z,{variant:"body1",children:["Enter your own User ID and credentials.",(0,r.jsx)("br",{}),"This selection will not be stored."]}),(0,r.jsxs)("form",{className:s.form,onSubmit:d(j),children:[(0,r.jsxs)(y.Z,{children:[(0,r.jsx)(ta.Z,{...ra(a("userId",{required:!0})),label:"User ID",margin:"normal",error:Boolean(v.userId)}),v.userId&&(0,r.jsx)(na.Z,{error:!0,children:v.userId.message})]}),(0,r.jsxs)(y.Z,{children:[(0,r.jsx)(ta.Z,{...ra(a("idToken",{required:!1,validate:$=>!$||kl.test($)||"Token is not a valid OpenID Connect JWT Token"})),label:"ID Token (optional)",margin:"normal",autoComplete:"off",error:Boolean(v.idToken)}),v.idToken&&(0,r.jsx)(na.Z,{error:!0,children:v.idToken.message})]}),(0,r.jsx)(X.Z,{type:"submit",color:"primary",variant:"outlined",className:s.button,disabled:!(p!=null&&p.isDirty)||!Pl()(v),children:"Continue"})]})]})})},loader:async()=>{}},bo="@backstage/core:SignInPage:provider",sa={guest:Il,custom:Bl,common:Tl};function oa(e,s){if(e in s)throw new Error(`"${e}" ID is duplicated. IDs of identity providers have to be unique.`)}function dc(e){return e.reduce((a,d)=>{if(typeof d=="string")return oa(d,a),a[d]={components:sa[d],id:d},a;const{id:p}=d;return oa(p,a),a[p]={components:sa.common,id:p,config:d},a},{})}const uc=(e,s)=>{const a=useApi(errorApiRef),d=useApiHolder(),[p,v]=useState(!0),j=useCallback(K=>{s(IdentityApiSignOutProxy.from({identityApi:K,signOut:async()=>{var N;localStorage.removeItem(bo),await((N=K.signOut)===null||N===void 0?void 0:N.call(K))}}))},[s]);useLayoutEffect(()=>{var K;if(!p)return;const N=localStorage.getItem(bo);if(N===null){v(!1);return}const pe=e[N];if(!pe){v(!1);return}let ie=!1;return pe.components.loader(d,(K=pe.config)===null||K===void 0?void 0:K.apiRef).then(xe=>{ie||(xe?j(xe):v(!1))}).catch(xe=>{ie||(localStorage.removeItem(bo),a.post(xe),v(!1))}),()=>{ie=!0}},[p,a,s,d,e,j]);const $=useMemo(()=>Object.keys(e).map(K=>{const N=e[K],{Component:pe}=N.components,ie=xe=>{localStorage.setItem(bo,N.id),j(xe)};return _jsx(pe,{config:N.config,onSignInSuccess:ie},N.id)}),[e,j]);return[p,$]},$l=({onSignInSuccess:e,providers:s=[],title:a,align:d="left"})=>{const p=useApi(configApiRef),v=useStyles(),j=getSignInProviders(s),[$,K]=useSignInProviders(j,e);return $?_jsx(Progress,{}):_jsxs(Page,{themeId:"home",children:[_jsx(Header,{title:p.getString("app.title")}),_jsxs(Content,{children:[a&&_jsx(ContentHeader,{title:a,textAlign:d}),_jsx(Grid,{container:!0,justifyContent:d==="center"?d:"flex-start",spacing:2,component:"ul",classes:v,children:K})]})]})},Zl=({provider:e,auto:s,onSignInSuccess:a})=>{const d=useStyles(),p=useApi(e.apiRef),v=useApi(configApiRef),[j,$]=useState(),[K,N]=useState(!1),pe=async({checkExisting:ie,showPopup:xe})=>{try{let Te;if(ie&&(Te=await p.getBackstageIdentity({optional:!0})),!Te&&(xe||s)&&(N(!0),Te=await p.getBackstageIdentity({instantPopup:!0}),!Te))throw new Error(`The ${e.title} provider is not configured to support sign-in`);if(!Te){N(!0);return}const Ye=await p.getProfile();a(UserIdentity.create({identity:Te.identity,authApi:p,profile:Ye}))}catch(Te){$(Te),N(!0)}};return useMountEffect(()=>pe({checkExisting:!0})),K?_jsxs(Page,{themeId:"home",children:[_jsx(Header,{title:v.getString("app.title")}),_jsx(Content,{children:_jsx(Grid,{container:!0,justifyContent:"center",spacing:2,component:"ul",classes:d,children:_jsx(GridItem,{children:_jsxs(InfoCard,{variant:"fullHeight",title:e.title,actions:_jsx(Button,{color:"primary",variant:"outlined",onClick:()=>{pe({showPopup:!0})},children:"Sign In"}),children:[_jsx(Typography,{variant:"body1",children:e.message}),j&&j.name!=="PopupRejectedError"&&_jsx(Typography,{variant:"body1",color:"error",children:j.message})]})})})})]}):_jsx(Progress,{})};function hc(e){return"provider"in e?_jsx(Zl,{...e}):_jsx($l,{...e})}const Dl=(0,c.Z)(e=>({root:{padding:e.spacing(0,2,0,2.5),minHeight:e.spacing(3)},indicator:{backgroundColor:e.palette.info.main,height:e.spacing(.3)}}),{name:"BackstageTabbedCard"}),Nl=(0,on.Z)(e=>({root:{padding:e.spacing(2,2,2,2.5),display:"inline-block"},title:{fontWeight:700},subheader:{paddingTop:e.spacing(1)}}),{name:"BackstageTabbedCardBoldHeader"})(Dr.Z);function pc(e){const{slackChannel:s,errorBoundaryProps:a,children:d,title:p,deepLink:v,value:j,onChange:$}=e,K=Dl(),[N,pe]=useState(0),ie=$||((Ye,qe)=>pe(qe));let xe;j?React.Children.map(d,Ye=>{if(React.isValidElement(Ye)&&(Ye==null?void 0:Ye.props.value)===j){var qe;xe=Ye==null||(qe=Ye.props)===null||qe===void 0?void 0:qe.children}}):React.Children.map(d,(Ye,qe)=>{React.isValidElement(Ye)&&qe===N&&(xe=Ye==null?void 0:Ye.props.children)});const Te=a||(s?{slackChannel:s}:{});return _jsx(Card,{children:_jsxs(ErrorBoundary,{...Te,children:[p&&_jsx(Nl,{title:p}),_jsx(Tabs,{selectionFollowsFocus:!0,classes:K,value:j||N,onChange:ie,children:d}),_jsx(Divider,{}),_jsx(CardContent,{children:xe}),v&&_jsx(BottomLink,{...v})]})})}const Fl=(0,c.Z)(e=>({root:{minWidth:e.spacing(6),minHeight:e.spacing(3),margin:e.spacing(0,2,0,0),padding:e.spacing(.5,0,.5,0),textTransform:"none","&:hover":{opacity:1,backgroundColor:"transparent",color:e.palette.text.primary}},selected:{fontWeight:e.typography.fontWeightBold}}),{name:"BackstageCardTab"});function fc(e){const{children:s,...a}=e,d=Fl();return _jsx(Tab,{disableRipple:!0,classes:d,...a})}},25248:function(At,Fe,t){"use strict";t.d(Fe,{fC:function(){return b},CL:function(){return Ee},sM:function(){return Y},$v:function(){return Le},v_:function(){return Xe},hg:function(){return Qe},uB:function(){return z},R5:function(){return Zt},bq:function(){return C},Ds:function(){return _e},ni:function(){return F},T0:function(){return U},CO:function(){return zn},x8:function(){return In},rx:function(){return bn},YO:function(){return pn},P4:function(){return Mn},NT:function(){return en},NW:function(){return Ge},VE:function(){return gt},W0:function(){return Ke},gP:function(){return it},IY:function(){return ut},F4:function(){return oe},ux:function(){return R},Kp:function(){return ce},$4:function(){return mt},p_:function(){return V},ZM:function(){return ot},D:function(){return T},gW:function(){return A},E6:function(){return ft},z$:function(){return bt},h_:function(){return te},I_:function(){return P},qD:function(){return ke},vJ:function(){return kn},yx:function(){return Pe},tg:function(){return vn},Oi:function(){return hn}});var h=t(52322),r=t(51837),W=t(2784);const k=(0,r.CT)("analytics-context"),g=()=>{const ge=(0,W.useContext)(k);if(ge===void 0)return{routeRef:"unknown",pluginId:"root",extension:"App"};const ee=ge.atVersion(1);if(ee===void 0)throw new Error("No context found for version 1.");return ee},b=ge=>{const{attributes:ee,children:Re}=ge,et={...g(),...ee},wt=(0,r.EI)({1:et});return(0,h.jsx)(k.Provider,{value:wt,children:Re})};function c(ge,ee){const Re=Ue=>_jsx(b,{attributes:ee,children:_jsx(ge,{...Ue})});return Re.displayName=`WithAnalyticsContext(${ge.displayName||ge.name||"Component"})`,Re}function P(){const ge=(0,r.Vt)("api-context");if(!ge)throw new Error("API context is not available");const ee=ge.atVersion(1);if(!ee)throw new Error("ApiContext v1 not available");return ee}function te(ge){const Re=P().get(ge);if(!Re)throw new Error(`No implementation available for ${ge}`);return Re}function _(ge){return function(Re){const Ue=wt=>{const ae=P(),O={};for(const de in ge)if(ge.hasOwnProperty(de)){const Be=ge[de],D=ae.get(Be);if(!D)throw new Error(`No implementation available for ${Be}`);O[de]=D}return _jsx(Re,{...wt,...O})},et=Re.displayName||Re.name||"Component";return Ue.displayName=`withApis(${et})`,Ue}}class X{get id(){return this.config.id}get T(){throw new Error(`tried to read ApiRef.T of ${this}`)}toString(){return`apiRef{${this.config.id}}`}constructor(ee){if(this.config=ee,!ee.id.split(".").flatMap(Ue=>Ue.split("-")).every(Ue=>Ue.match(/^[a-z][a-z0-9]*$/)))throw new Error(`API id must only contain period separated lowercase alphanum tokens with dashes, got '${ee.id}'`)}}function U(ge){return new X(ge)}function F(ge,ee){return"id"in ge?{api:ge,deps:{},factory:()=>ee}:ge}var Y;(function(ge){ge.SignedIn="SignedIn",ge.SignedOut="SignedOut"})(Y||(Y={}));const ce=U({id:"core.auth.google"}),oe=U({id:"core.auth.github"}),T=U({id:"core.auth.okta"}),R=U({id:"core.auth.gitlab"}),V=U({id:"core.auth.microsoft"}),A=U({id:"core.auth.onelogin"}),C=U({id:"core.auth.bitbucket"}),z=U({id:"core.auth.atlassian"}),Le=U({id:"core.alert"}),Xe=U({id:"core.analytics"}),Qe=U({id:"core.apptheme"}),_e=U({id:"core.config"}),Ge=U({id:"core.discovery"}),gt=U({id:"core.error"});var Ee;(function(ge){ge[ge.None=0]="None",ge[ge.Active=1]="Active"})(Ee||(Ee={}));const Ke=U({id:"core.featureflags"}),it=U({id:"core.fetch"}),mt=U({id:"core.identity"}),ot=U({id:"core.oauthrequest"}),ft=U({id:"core.storage"});class nt{setContext(ee){this.context=ee}captureEvent(ee,Re,{value:Ue,attributes:et}={}){try{this.analyticsApi.captureEvent({action:ee,subject:Re,value:Ue,attributes:et,context:this.context})}catch(wt){console.warn("Error during analytics event capture. %o",wt)}}constructor(ee,Re={routeRef:"unknown",pluginId:"root",extension:"App"}){this.analyticsApi=ee,this.context=Re}}function Lt(){try{return te(Xe)}catch{return{captureEvent:()=>{}}}}function bt(){const ge=(0,W.useRef)(null),ee=g(),Re=Lt();function Ue(){return ge.current===null&&(ge.current=new nt(Re)),ge.current}const et=Ue();return et.setContext(ee),et}const ze="plugin-context",ne=ge=>{const{children:ee,plugin:Re}=ge,{Provider:Ue}=(0,r.CT)(ze);return(0,h.jsx)(Ue,{value:(0,r.EI)({1:{plugin:Re}}),children:ee})};function Pe(){const ge=(0,r.Vt)(ze);if(!ge)throw new Error("Plugin Options context is not available");const ee=ge.atVersion(1);if(!ee)throw new Error("Plugin Options v1 is not available");return ee.plugin.getPluginOptions()}const ke=()=>{const ge=(0,r.Vt)("app-context");if(!ge)throw new Error("App context is not available");const ee=ge.atVersion(1);if(!ee)throw new Error("AppContext v1 not available");return ee},tt=(0,r.uW)("component-data-store",()=>new WeakMap),vt="__backstage_data";function Zt(ge,ee,Re){const Ue=ge;var et;let wt=(et=Ue[vt])!==null&&et!==void 0?et:tt.get(ge);if(wt||(wt={map:new Map},Object.defineProperty(Ue,vt,{enumerable:!1,configurable:!0,writable:!1,value:wt}),tt.set(ge,wt)),wt.map.has(ee)){const ae=ge.displayName||ge.name;throw new Error(`Attempted to attach duplicate data "${ee}" to component "${ae}"`)}wt.map.set(ee,Re)}function ut(ge,ee){if(!ge)return;const Re=ge.type;if(!Re)return;var Ue;const et=(Ue=Re[vt])!==null&&Ue!==void 0?Ue:tt.get(Re);if(!!et)return et.map.get(ee)}const Tt=(0,r.uW)("route-ref-type",()=>Symbol("route-ref-type"));let It=Tt;class Ot{get title(){return this.id}toString(){return`routeRef{type=absolute,id=${this.id}}`}constructor(ee,Re){this.id=ee,this.params=Re,this[It]="absolute"}}function en(ge){var ee;return new Ot(ge.id,(ee=ge.params)!==null&&ee!==void 0?ee:[])}const Wt=/^\w+$/;let Vt=null;class Qt{toString(){return`routeRef{type=sub,id=${this.id}}`}constructor(ee,Re,Ue,et){this.id=ee,this.path=Re,this.parent=Ue,this.params=et,this[Vt]="sub"}}function un(ge){const{id:ee,path:Re,parent:Ue}=ge,et=Re.split("/").filter(O=>O.startsWith(":")).map(O=>O.substring(1)),wt=[...Ue.params,...et];if(Ue.params.some(O=>et.includes(O)))throw new Error("SubRouteRef may not have params that overlap with its parent");if(!Re.startsWith("/"))throw new Error(`SubRouteRef path must start with '/', got '${Re}'`);if(Re.endsWith("/"))throw new Error(`SubRouteRef path must not end with '/', got '${Re}'`);for(const O of et)if(!Wt.test(O))throw new Error(`SubRouteRef path has invalid param, got '${O}'`);return new Qt(ee,Re,Ue,wt)}let cn=Tt;class Fn{toString(){return`routeRef{type=external,id=${this.id}}`}constructor(ee,Re,Ue){this.id=ee,this.params=Re,this.optional=Ue,this[cn]="external"}}function In(ge){var ee;return new Fn(ge.id,(ee=ge.params)!==null&&ee!==void 0?ee:[],Boolean(ge.optional))}var Un=t(79635);function vn(ge){const{pathname:ee}=(0,Un.TH)(),Re=(0,r.Vt)("routing-context");if(!Re)throw new Error("Routing context is not available");const Ue=Re.atVersion(1),et=(0,W.useMemo)(()=>Ue&&Ue.resolve(ge,{pathname:ee}),[Ue,ge,ee]);if(!Re)throw new Error("useRouteRef used outside of routing context");if(!Ue)throw new Error("RoutingContext v1 not available");const wt="optional"in ge&&ge.optional;if(!et&&!wt)throw new Error(`No path for ${ge}`);return et}function hn(ge){return(0,Un.UO)()}class Xt extends W.Component{static getDerivedStateFromError(ee){return{error:ee}}render(){const{error:ee}=this.state,{app:Re,plugin:Ue}=this.props,{ErrorBoundaryFallback:et}=Re.getComponents();return ee?(0,h.jsx)(et,{error:ee,resetError:this.handleErrorReset,plugin:Ue}):this.props.children}constructor(...ee){super(...ee),this.state={error:void 0},this.handleErrorReset=()=>{this.setState({error:void 0})}}}function Mn(ge){const{component:ee,mountPoint:Re,name:Ue}=ge;return pn({component:{lazy:()=>ee().then(et=>{const wt=O=>{try{vn(Re)}catch(de){if(typeof de=="object"&&de!==null){const{message:Be}=de;if(typeof Be=="string"&&Be.startsWith("No path for "))throw new Error(`Routable extension component with mount point ${Re} was not discovered in the app element tree. Routable extension components may not be rendered by other components and must be directly available as an element within the App provider component.`)}throw de}return(0,h.jsx)(et,{...O})},ae=Ue||et.displayName||et.name||"LazyComponent";return wt.displayName=`RoutableExtension(${ae})`,wt},et=>ae=>{const O=ke(),{BootErrorPage:de}=O.getComponents();return(0,h.jsx)(de,{step:"load-chunk",error:et})})},data:{"core.mountPoint":Re},name:Ue})}function zn(ge){const{component:ee,name:Re}=ge;return pn({component:ee,name:Re})}function pn(ge){const{data:ee={},name:Re}=ge;Re||console.warn("Declaring extensions without name is DEPRECATED. Make sure that all usages of createReactExtension, createComponentExtension and createRoutableExtension provide a name.");let Ue;if("lazy"in ge.component){const wt=ge.component.lazy;Ue=(0,W.lazy)(()=>wt().then(ae=>({default:ae})))}else Ue=ge.component.sync;const et=Re||Ue.displayName||Ue.name||"Component";return{expose(wt){const ae=O=>{const de=ke(),{Progress:Be}=de.getComponents(),D=ee==null?void 0:ee["core.mountPoint"];return(0,h.jsx)(W.Suspense,{fallback:(0,h.jsx)(Be,{}),children:(0,h.jsx)(Xt,{app:de,plugin:wt,children:(0,h.jsx)(b,{attributes:{pluginId:wt.getId(),...Re&&{extension:Re},...D&&{routeRef:D.id}},children:(0,h.jsx)(ne,{plugin:wt,children:(0,h.jsx)(Ue,{...O})})})})})};Zt(ae,"core.plugin",wt);for(const[O,de]of Object.entries(ee))Zt(ae,O,de);return ae.displayName=`Extension(${et})`,ae}}}function yn(ge,ee,Re,Ue){return W.Children.toArray(ge).flatMap(et=>{if(!(0,W.isValidElement)(et))return[];if(et.type===W.Fragment)return yn(et.props.children,ee,Re,Ue);if(ut(et,"core.featureFlagged")){const wt=et.props;return("with"in wt?ee.isActive(wt.with):!ee.isActive(wt.without))?yn(et.props.children,ee,Re,Ue):[]}if(Re===void 0||Re(et))return[et];if(Ue)throw new Error(Ue);return yn(et.props.children,ee,Re,Ue)})}class xn{selectByComponentData(ee){const Re=yn(this.node,this.featureFlagsApi,Ue=>ut(Ue,ee.key)!==void 0,ee.withStrictError);return new xn(Re,this.featureFlagsApi)}findComponentData(ee){return yn(this.node,this.featureFlagsApi,Ue=>ut(Ue,ee.key)!==void 0).map(Ue=>ut(Ue,ee.key)).filter(Ue=>Ue!==void 0)}getElements(){return yn(this.node,this.featureFlagsApi)}constructor(ee,Re){this.node=ee,this.featureFlagsApi=Re}}function kn(ge,ee,Re=[]){const Ue=te(Ke),et=new xn(ge,Ue);return(0,W.useMemo)(()=>ee(et),[ge,...Re])}class On{getId(){return this.config.id}getApis(){var ee;return(ee=this.config.apis)!==null&&ee!==void 0?ee:[]}getFeatureFlags(){var ee,Re;return(Re=(ee=this.config.featureFlags)===null||ee===void 0?void 0:ee.slice())!==null&&Re!==void 0?Re:[]}get routes(){var ee;return(ee=this.config.routes)!==null&&ee!==void 0?ee:{}}get externalRoutes(){var ee;return(ee=this.config.externalRoutes)!==null&&ee!==void 0?ee:{}}provide(ee){return ee.expose(this)}__experimentalReconfigure(ee){this.config.__experimentalConfigure&&(this.options=this.config.__experimentalConfigure(ee))}getPluginOptions(){this.config.__experimentalConfigure&&!this.options&&(this.options=this.config.__experimentalConfigure());var ee;return(ee=this.options)!==null&&ee!==void 0?ee:{}}toString(){return`plugin{${this.config.id}}`}constructor(ee){this.config=ee,this.options=void 0}}function bn(ge){return new On(ge)}},23054:function(At,Fe,t){"use strict";t.d(Fe,{SP:function(){return Y},dR:function(){return X},VL:function(){return oe},BD:function(){return r}});function h(T){if(typeof T!="object"||T===null||Array.isArray(T))return!1;const R=T;return!(typeof R.name!="string"||R.name===""||typeof R.message!="string")}function r(T){if(typeof T!="object"||T===null||Array.isArray(T))throw new Error(`Encountered invalid error, not an object, got '${T}'`);const R=T;if(typeof R.name!="string"||R.name==="")throw new Error(`Encountered error object without a name, got '${T}'`);if(typeof R.message!="string")throw new Error(`Encountered error object without a message, got '${T}'`)}var W=t(24852);function k(T,R){const A={name:"Unknown",message:"<no reason given>",...serializeErrorInternal(T)};return R!=null&&R.includeStack||delete A.stack,A}function g(T){const R=(0,W.deserializeError)(T);return T.stack||(R.stack=void 0),R}function b(T){if(h(T)){const R=String(T);return R!=="[object Object]"?R:`${T.name}: ${T.message}`}return`unknown error '${T}'`}class c extends Error{constructor(R,V){var A;let C=R;if(V!==void 0){const z=b(V);C?C+=`; caused by ${z}`:C=`caused by ${z}`}super(C),(A=Error.captureStackTrace)===null||A===void 0||A.call(Error,this,this.constructor),this.name=this.constructor.name,this.cause=h(V)?V:void 0}}class P extends null{}class te extends null{}class _ extends null{}class X extends c{}class U extends null{}class F extends null{}class Y extends c{constructor(R,V){super(R,V),this.name=h(V)?V.name:"Error"}}async function ce(T){try{const V=await T.text();if(V){var R;if(!((R=T.headers.get("content-type"))===null||R===void 0)&&R.startsWith("application/json"))try{const A=JSON.parse(V);if(A.error&&A.response)return A}catch{}return{error:{name:"Error",message:`Request failed with status ${T.status} ${T.statusText}, ${V}`},response:{statusCode:T.status}}}}catch{}return{error:{name:"Error",message:`Request failed with status ${T.status} ${T.statusText}`},response:{statusCode:T.status}}}class oe extends Error{static async fromResponse(R){const V=await ce(R),A=V.response.statusCode||R.status,C=V.error.name||R.statusText,z=`Request failed with ${A} ${C}`,Le=g(V.error);return new oe({message:z,response:R,data:V,cause:Le})}constructor(R){super(R.message),this.name="ResponseError",this.response=R.response,this.body=R.data,this.cause=R.cause}}},32838:function(At,Fe,t){"use strict";t.d(Fe,{nW:function(){return oe},ae:function(){return X},q3:function(){return U}});var h=t(25248);const r=(0,h.T0)({id:"core.scmauth"});var W=new WeakMap;class k{async getCredentials(R){const V=new URL(R.url),A=_class_private_field_get(this,W).find(C=>C.isUrlSupported(V));if(!A)throw new Error(`No auth provider available for '${R.url}', see https://backstage.io/link?scm-auth`);return A.getCredentials(R)}constructor(R){_class_private_field_init(this,W,{writable:!0,value:void 0}),_class_private_field_set(this,W,R)}}var g=new WeakMap,b=new WeakMap,c=new WeakMap,P=new WeakMap;class te{static createDefaultApiFactory(){return createApiFactory({api:scmAuthApiRef,deps:{github:githubAuthApiRef,gitlab:gitlabAuthApiRef,azure:microsoftAuthApiRef,bitbucket:bitbucketAuthApiRef},factory:({github:R,gitlab:V,azure:A,bitbucket:C})=>te.merge(te.forGithub(R),te.forGitlab(V),te.forAzure(A),te.forBitbucket(C))})}static forAuthApi(R,V){return new te("generic",R,V.host,V.scopeMapping)}static forGithub(R,V){var A;const C=(A=V==null?void 0:V.host)!==null&&A!==void 0?A:"github.com";return new te("github",R,C,{default:["repo","read:org","read:user"],repoWrite:["gist"]})}static forGitlab(R,V){var A;const C=(A=V==null?void 0:V.host)!==null&&A!==void 0?A:"gitlab.com";return new te("gitlab",R,C,{default:["read_user","read_api","read_repository"],repoWrite:["write_repository","api"]})}static forAzure(R,V){var A;const C=(A=V==null?void 0:V.host)!==null&&A!==void 0?A:"dev.azure.com";return new te("azure",R,C,{default:["vso.build","vso.code","vso.graph","vso.project","vso.profile"],repoWrite:["vso.code_manage"]})}static forBitbucket(R,V){var A;const C=(A=V==null?void 0:V.host)!==null&&A!==void 0?A:"bitbucket.org";return new te("bitbucket",R,C,{default:["account","team","pullrequest","snippet","issue"],repoWrite:["pullrequest:write","snippet:write","issue:write"]})}static merge(...R){return new k(R)}isUrlSupported(R){return R.host===_class_private_field_get(this,b)}getAdditionalScopesForProvider(R){var V;if(!(R!=null&&R.customScopes)||_class_private_field_get(this,P)==="generic")return[];var A;return(A=(V=R.customScopes)===null||V===void 0?void 0:V[_class_private_field_get(this,P)])!==null&&A!==void 0?A:[]}async getCredentials(R){const{url:V,additionalScope:A,...C}=R,z=_class_private_field_get(this,c).default.slice();A!=null&&A.repoWrite&&z.push(..._class_private_field_get(this,c).repoWrite);const Le=this.getAdditionalScopesForProvider(A);Le.length&&z.push(...Le);const Xe=[...new Set(z)],Qe=await _class_private_field_get(this,g).getAccessToken(Xe,C);return{token:Qe,headers:{Authorization:`Bearer ${Qe}`}}}constructor(R,V,A,C){_class_private_field_init(this,g,{writable:!0,value:void 0}),_class_private_field_init(this,b,{writable:!0,value:void 0}),_class_private_field_init(this,c,{writable:!0,value:void 0}),_class_private_field_init(this,P,{writable:!0,value:void 0}),_class_private_field_set(this,g,V),_class_private_field_set(this,b,A),_class_private_field_set(this,c,C),_class_private_field_set(this,P,R)}}var _=t(79158);class X{static fromConfig(R){return _.Lx.fromConfig(R)}}const U=(0,h.T0)({id:"integration.scmintegrations"});var F=t(52322),Y=t(73250),ce=t(2784);const oe=T=>{const{type:R}=T,V=(0,h.qD)(),A=Y.Z;var C;const z=R&&(C=V.getSystemIcon(R))!==null&&C!==void 0?C:A;return(0,F.jsx)(z,{})}},79158:function(At,Fe,t){"use strict";t.d(Fe,{Lx:function(){return dr},BT:function(){return lt}});var h=t(82717),r=t.n(h),W=t(76635);function k(w){const u=new URL("http://example.com");return u.host=w,u.host===w}function g(w){try{return new URL(w),!0}catch{return!1}}function b(w,u){return{list(){return w},byUrl(x){try{const E=typeof x=="string"?new URL(x):x;return w.find(q=>u(q)===E.host)}catch{return}},byHost(x){return w.find(E=>u(E)===x)}}}function c(w){const{url:u,base:x,lineNumber:E}=w;try{return new URL(u),u}catch{}let q;if(u.startsWith("/")){const{filepath:ve}=r()(x);q=new URL(x);const ye=(0,W.trimEnd)(q.pathname.substring(0,q.pathname.length-ve.length),"/");q.pathname=`${ye}${u}`}else q=new URL(u,x);return q.search=new URL(x).search,E&&(q.hash=`L${E}`),q.toString()}const P="amazonaws.com";function te(w){const u=w.getOptionalString("endpoint");var x;const E=(x=w.getOptionalBoolean("s3ForcePathStyle"))!==null&&x!==void 0?x:!1;let q,ve;if(u){try{const Ht=new URL(u);q=Ht.host,ve=Ht.pathname}catch{throw new Error(`invalid awsS3 integration config, endpoint '${u}' is not a valid URL`)}if(ve!=="/")throw new Error(`invalid awsS3 integration config, endpoints cannot contain path, got '${u}'`)}else q=P;const ye=w.getOptionalString("accessKeyId"),Ne=w.getOptionalString("secretAccessKey"),Je=w.getOptionalString("roleArn"),Ft=w.getOptionalString("externalId");return{host:q,endpoint:u,s3ForcePathStyle:E,accessKeyId:ye,secretAccessKey:Ne,roleArn:Je,externalId:Ft}}function _(w){const u=w.map(te);return u.some(x=>x.host===P)||u.push({host:P}),u}class X{get type(){return"awsS3"}get title(){return this.integrationConfig.host}get config(){return this.integrationConfig}resolveUrl(u){return c(u)}resolveEditUrl(u){return u}constructor(u){this.integrationConfig=u}}X.factory=({config:w})=>{var u;const x=_((u=w.getOptionalConfigArray("integrations.awsS3"))!==null&&u!==void 0?u:[]);return b(x.map(E=>new X(E)),E=>E.config.host)};var U=t(90383),F=t(22504),Y=t(69866);const ce="GB";var oe=new WeakMap,T=new WeakMap,R=new WeakMap,V=new WeakMap,A=new WeakMap,C=new WeakMap,z=new WeakMap;class Le{static fromRepoUrl(u){const x=new URL(u);let E,q,ve;const ye=x.pathname.split("/").map($n=>decodeURIComponent($n));if(ye[2]==="_git"?(E=ye[1],q=ve=ye[3]):ye[3]==="_git"?(E=ye[1],q=ye[2],ve=ye[4]):ye[4]==="_git"&&(E=`${ye[1]}/${ye[2]}`,q=ye[3],ve=ye[5]),!E||!q||!ve)throw new Error("Azure URL must point to a git repository");var Ne;const Je=(Ne=x.searchParams.get("path"))!==null&&Ne!==void 0?Ne:void 0;let Ft;const Ht=x.searchParams.get("version");if(Ht){if(Ht.slice(0,2)!=="GB")throw new Error("Azure URL version must point to a git branch");Ft=Ht.slice(2)}return new Le(x.origin,E,q,ve,Je,Ft)}toRepoUrl(){let u;return(0,U.Z)(this,R)===(0,U.Z)(this,V)?u=(0,U.Z)(this,z).call(this,(0,U.Z)(this,T),"_git",(0,U.Z)(this,V)):u=(0,U.Z)(this,z).call(this,(0,U.Z)(this,T),(0,U.Z)(this,R),"_git",(0,U.Z)(this,V)),(0,U.Z)(this,A)&&u.searchParams.set("path",(0,U.Z)(this,A)),(0,U.Z)(this,C)&&u.searchParams.set("version",ce+(0,U.Z)(this,C)),u.toString()}toFileUrl(){if(!(0,U.Z)(this,A))throw new Error("Azure URL must point to a specific path to be able to download a file");const u=(0,U.Z)(this,z).call(this,(0,U.Z)(this,T),(0,U.Z)(this,R),"_apis","git","repositories",(0,U.Z)(this,V),"items");return u.searchParams.set("api-version","6.0"),u.searchParams.set("path",(0,U.Z)(this,A)),(0,U.Z)(this,C)&&u.searchParams.set("version",(0,U.Z)(this,C)),u.toString()}toArchiveUrl(){const u=(0,U.Z)(this,z).call(this,(0,U.Z)(this,T),(0,U.Z)(this,R),"_apis","git","repositories",(0,U.Z)(this,V),"items");return u.searchParams.set("recursionLevel","full"),u.searchParams.set("download","true"),u.searchParams.set("api-version","6.0"),(0,U.Z)(this,A)&&u.searchParams.set("scopePath",(0,U.Z)(this,A)),(0,U.Z)(this,C)&&u.searchParams.set("version",(0,U.Z)(this,C)),u.toString()}toCommitsUrl(){const u=(0,U.Z)(this,z).call(this,(0,U.Z)(this,T),(0,U.Z)(this,R),"_apis","git","repositories",(0,U.Z)(this,V),"commits");return u.searchParams.set("api-version","6.0"),(0,U.Z)(this,C)&&u.searchParams.set("searchCriteria.itemVersion.version",(0,U.Z)(this,C)),u.toString()}getOwner(){return(0,U.Z)(this,T)}getProject(){return(0,U.Z)(this,R)}getRepo(){return(0,U.Z)(this,V)}getPath(){return(0,U.Z)(this,A)}getRef(){return(0,U.Z)(this,C)}constructor(u,x,E,q,ve,ye){(0,F.Z)(this,oe,{writable:!0,value:void 0}),(0,F.Z)(this,T,{writable:!0,value:void 0}),(0,F.Z)(this,R,{writable:!0,value:void 0}),(0,F.Z)(this,V,{writable:!0,value:void 0}),(0,F.Z)(this,A,{writable:!0,value:void 0}),(0,F.Z)(this,C,{writable:!0,value:void 0}),(0,F.Z)(this,z,{writable:!0,value:(...Ne)=>{const Je=new URL((0,U.Z)(this,oe));return Je.pathname=Ne.map(Ft=>encodeURIComponent(Ft)).join("/"),Je}}),(0,Y.Z)(this,oe,u),(0,Y.Z)(this,T,x),(0,Y.Z)(this,R,E),(0,Y.Z)(this,V,q),(0,Y.Z)(this,A,ve),(0,Y.Z)(this,C,ye)}}const Xe="dev.azure.com";function Qe(w){var u;const x=(u=w.getOptionalString("host"))!==null&&u!==void 0?u:Xe,E=w.getOptionalString("token");if(!k(x))throw new Error(`Invalid Azure integration config, '${x}' is not a valid host`);return{host:x,token:E}}function _e(w){const u=w.map(Qe);return u.some(x=>x.host===Xe)||u.push({host:Xe}),u}class Ge{get type(){return"azure"}get title(){return this.integrationConfig.host}get config(){return this.integrationConfig}resolveUrl(u){const{url:x,base:E}=u;if(g(x))return x;try{const ve=Le.fromRepoUrl(E),ye=new URL(E);var q;const Ne=new URL(`https://a.com${(q=ve.getPath())!==null&&q!==void 0?q:""}`),Je=new URL(x,Ne).pathname;return ye.searchParams.set("path",Je),u.lineNumber&&(ye.searchParams.set("line",String(u.lineNumber)),ye.searchParams.set("lineEnd",String(u.lineNumber+1)),ye.searchParams.set("lineStartColumn","1"),ye.searchParams.set("lineEndColumn","1")),ye.toString()}catch{return new URL(x,E).toString()}}resolveEditUrl(u){return u}constructor(u){this.integrationConfig=u}}Ge.factory=({config:w})=>{var u;const x=_e((u=w.getOptionalConfigArray("integrations.azure"))!==null&&u!==void 0?u:[]);return b(x.map(E=>new Ge(E)),E=>E.config.host)};var gt=t(48834).lW;function Ee(w){return AzureUrl.fromRepoUrl(w).toFileUrl()}function Ke(w){return AzureUrl.fromRepoUrl(w).toArchiveUrl()}function it(w){return AzureUrl.fromRepoUrl(w).toCommitsUrl()}function mt(w,u){const x=u?{...u}:{};if(w.token){const E=gt.from(`:${w.token}`,"utf8");x.Authorization=`Basic ${E.toString("base64")}`}return{headers:x}}const ot="bitbucket.org",ft="https://api.bitbucket.org/2.0";function nt(w){var u;const x=(u=w.getOptionalString("host"))!==null&&u!==void 0?u:ot;let E=w.getOptionalString("apiBaseUrl");const q=w.getOptionalString("token"),ve=w.getOptionalString("username"),ye=w.getOptionalString("appPassword");if(!k(x))throw new Error(`Invalid Bitbucket integration config, '${x}' is not a valid host`);return E?E=(0,W.trimEnd)(E,"/"):x===ot?E=ft:E=`https://${x}/rest/api/1.0`,{host:x,apiBaseUrl:E,token:q,username:ve,appPassword:ye}}function Lt(w){const u=w.map(nt);return u.some(x=>x.host===ot)||u.push({host:ot,apiBaseUrl:ft}),u}class bt{get type(){return"bitbucket"}get title(){return this.integrationConfig.host}get config(){return this.integrationConfig}resolveUrl(u){const x=c(u);if(!u.lineNumber)return x;const E=new URL(x);return this.integrationConfig.host==="bitbucket.org"?E.hash=`lines-${u.lineNumber}`:E.hash=`${u.lineNumber}`,E.toString()}resolveEditUrl(u){const x=r()(u),E=new URL(u);return E.searchParams.set("mode","edit"),E.searchParams.set("spa","0"),E.searchParams.set("at",x.ref),E.toString()}constructor(u){this.integrationConfig=u}}bt.factory=({config:w})=>{var u,x,E;const q=Lt((E=w.getOptionalConfigArray("integrations.bitbucket"))!==null&&E!==void 0?E:[...(u=w.getOptionalConfigArray("integrations.bitbucketCloud"))!==null&&u!==void 0?u:[],...(x=w.getOptionalConfigArray("integrations.bitbucketServer"))!==null&&x!==void 0?x:[]]);return b(q.map(ve=>new bt(ve)),ve=>ve.config.host)};var ze=t(96279),ne=t(48834).lW;async function Pe(w,u){const{name:x,owner:E,resource:q}=parseGitUrl(w),ve=q==="bitbucket.org";let ye=ve?`${u.apiBaseUrl}/repositories/${E}/${x}`:`${u.apiBaseUrl}/projects/${E}/repos/${x}/default-branch`,Ne=await fetch(ye,vt(u));if(Ne.status===404&&!ve&&(ye=`${u.apiBaseUrl}/projects/${E}/repos/${x}/branches/default`,Ne=await fetch(ye,vt(u))),!Ne.ok){const Ft=`Failed to retrieve default branch from ${ye}, ${Ne.status} ${Ne.statusText}`;throw new Error(Ft)}let Je;if(ve)Je=(await Ne.json()).mainbranch.name;else{const{displayId:Ft}=await Ne.json();Je=Ft}if(!Je)throw new Error(`Failed to read default branch from ${ye}. Response ${Ne.status} ${Ne.json()}`);return Je}async function ke(w,u){const{name:x,owner:E,ref:q,protocol:ve,resource:ye,filepath:Ne}=parseGitUrl(w),Je=ye==="bitbucket.org";let Ft=q;Ft||(Ft=await Pe(w,u));const Ht=Ne?`&path=${encodeURIComponent(decodeURIComponent(Ne))}`:"";return Je?`${ve}://${ye}/${E}/${x}/get/${Ft}.tar.gz`:`${u.apiBaseUrl}/projects/${E}/repos/${x}/archive?format=tgz&at=${Ft}&prefix=${E}-${x}${Ht}`}function tt(w,u){try{const{owner:x,name:E,ref:q,filepathtype:ve,filepath:ye}=parseGitUrl(w);if(!x||!E||ve!=="browse"&&ve!=="raw"&&ve!=="src")throw new Error("Invalid Bitbucket URL or file path");const Ne=ye.replace(/^\//,"");if(u.host==="bitbucket.org"){if(!q)throw new Error("Invalid Bitbucket URL or file path");return`${u.apiBaseUrl}/repositories/${x}/${E}/src/${q}/${Ne}`}return`${u.apiBaseUrl}/projects/${x}/repos/${E}/raw/${Ne}?at=${q}`}catch(x){throw new Error(`Incorrect URL: ${w}, ${x}`)}}function vt(w){const u={};if(w.token)u.Authorization=`Bearer ${w.token}`;else if(w.username&&w.appPassword){const x=ne.from(`${w.username}:${w.appPassword}`,"utf8");u.Authorization=`Basic ${x.toString("base64")}`}return{headers:u}}const Zt="bitbucket.org",ut="https://api.bitbucket.org/2.0";function Tt(w){const u=Zt,x=ut,E=w.getString("username"),q=w.getString("appPassword");return{host:u,apiBaseUrl:x,username:E,appPassword:q}}function It(w){const u=w.map(Tt);return u.length===0&&u.push({host:Zt,apiBaseUrl:ut}),u}class Ot{get type(){return"bitbucketCloud"}get title(){return this.integrationConfig.host}get config(){return this.integrationConfig}resolveUrl(u){const x=c(u);if(u.lineNumber){const E=new URL(x);return E.hash=`lines-${u.lineNumber}`,E.toString()}return x}resolveEditUrl(u){const x=r()(u),E=new URL(u);return E.searchParams.set("mode","edit"),E.searchParams.set("at",x.ref),E.toString()}constructor(u){this.integrationConfig=u}}Ot.factory=({config:w})=>{var u;const x=It((u=w.getOptionalConfigArray("integrations.bitbucketCloud"))!==null&&u!==void 0?u:[]);return b(x.map(E=>new Ot(E)),E=>E.config.host)};var en=t(48834).lW;async function Wt(w,u){const{name:x,owner:E}=parseGitUrl(w),q=`${u.apiBaseUrl}/repositories/${E}/${x}`,ve=await fetch(q,un(u));if(!ve.ok){const Je=`Failed to retrieve default branch from ${q}, ${ve.status} ${ve.statusText}`;throw new Error(Je)}const Ne=(await ve.json()).mainbranch.name;if(!Ne)throw new Error(`Failed to read default branch from ${q}. Response ${ve.status} ${ve.json()}`);return Ne}async function Vt(w,u){const{name:x,owner:E,ref:q,protocol:ve,resource:ye}=parseGitUrl(w);let Ne=q;return Ne||(Ne=await Wt(w,u)),`${ve}://${ye}/${E}/${x}/get/${Ne}.tar.gz`}function Qt(w,u){try{const{owner:x,name:E,ref:q,filepathtype:ve,filepath:ye}=parseGitUrl(w);if(!x||!E||ve!=="src"&&ve!=="raw")throw new Error("Invalid Bitbucket Cloud URL or file path");const Ne=ye.replace(/^\//,"");if(!q)throw new Error("Invalid Bitbucket Cloud URL or file path");return`${u.apiBaseUrl}/repositories/${x}/${E}/src/${q}/${Ne}`}catch(x){throw new Error(`Incorrect URL: ${w}, ${x}`)}}function un(w){const u={};if(w.username&&w.appPassword){const x=en.from(`${w.username}:${w.appPassword}`,"utf8");u.Authorization=`Basic ${x.toString("base64")}`}return{headers:u}}function cn(w){const u=w.getString("host");let x=w.getOptionalString("apiBaseUrl");const E=w.getOptionalString("token"),q=w.getOptionalString("username"),ve=w.getOptionalString("password");if(!k(u))throw new Error(`Invalid Bitbucket Server integration config, '${u}' is not a valid host`);return x?x=(0,W.trimEnd)(x,"/"):x=`https://${u}/rest/api/1.0`,{host:u,apiBaseUrl:x,token:E,username:q,password:ve}}function Fn(w){return w.map(cn)}class In{get type(){return"bitbucketServer"}get title(){return this.integrationConfig.host}get config(){return this.integrationConfig}resolveUrl(u){const x=c(u);if(u.lineNumber){const E=new URL(x);return E.hash=u.lineNumber.toString(),E.toString()}return x}resolveEditUrl(u){return u.includes("?")?u.substring(0,u.indexOf("?")):u}constructor(u){this.integrationConfig=u}}In.factory=({config:w})=>{var u;const x=Fn((u=w.getOptionalConfigArray("integrations.bitbucketServer"))!==null&&u!==void 0?u:[]);return b(x.map(E=>new In(E)),E=>E.config.host)};var Un=t(48834).lW;async function vn(w,u){const{name:x,owner:E}=parseGitUrl(w);let q=`${u.apiBaseUrl}/projects/${E}/repos/${x}/default-branch`,ve=await fetch(q,Mn(u));if(ve.status===404&&(q=`${u.apiBaseUrl}/projects/${E}/repos/${x}/branches/default`,ve=await fetch(q,Mn(u))),!ve.ok){const Je=`Failed to retrieve default branch from ${q}, ${ve.status} ${ve.statusText}`;throw new Error(Je)}const{displayId:ye}=await ve.json(),Ne=ye;if(!Ne)throw new Error(`Failed to read default branch from ${q}. Response ${ve.status} ${ve.json()}`);return Ne}async function hn(w,u){const{name:x,owner:E,ref:q,filepath:ve}=parseGitUrl(w);let ye=q;ye||(ye=await vn(w,u));const Ne=ve?`&path=${encodeURIComponent(decodeURIComponent(ve))}`:"";return`${u.apiBaseUrl}/projects/${E}/repos/${x}/archive?format=tgz&at=${ye}&prefix=${E}-${x}${Ne}`}function Xt(w,u){try{const{owner:x,name:E,ref:q,filepathtype:ve,filepath:ye}=parseGitUrl(w);if(!x||!E||ve!=="browse"&&ve!=="raw"&&ve!=="src")throw new Error("Invalid Bitbucket Server URL or file path");const Ne=ye.replace(/^\//,"");return`${u.apiBaseUrl}/projects/${x}/repos/${E}/raw/${Ne}?at=${q}`}catch(x){throw new Error(`Incorrect URL: ${w}, ${x}`)}}function Mn(w){const u={};if(w.token)u.Authorization=`Bearer ${w.token}`;else if(w.username&&w.password){const x=Un.from(`${w.username}:${w.password}`,"utf8");u.Authorization=`Basic ${x.toString("base64")}`}return{headers:u}}function zn(w){const u=w.getString("host");let x=w.getOptionalString("baseUrl"),E=w.getOptionalString("cloneUrl"),q=w.getOptionalString("gitilesBaseUrl");const ve=w.getOptionalString("username"),ye=w.getOptionalString("password");if(k(u)){if(x&&!g(x))throw new Error(`Invalid Gerrit integration config, '${x}' is not a valid baseUrl`);if(E&&!g(E))throw new Error(`Invalid Gerrit integration config, '${E}' is not a valid cloneUrl`);if(q&&!g(q))throw new Error(`Invalid Gerrit integration config, '${q}' is not a valid gitilesBaseUrl`)}else throw new Error(`Invalid Gerrit integration config, '${u}' is not a valid host`);return x?x=(0,W.trimEnd)(x,"/"):x=`https://${u}`,q?q=(0,W.trimEnd)(q,"/"):q=`https://${u}`,E?E=(0,W.trimEnd)(E,"/"):E=x,{host:u,baseUrl:x,cloneUrl:E,gitilesBaseUrl:q,username:ve,password:ye}}function pn(w){return w.map(zn)}var yn=t(48834).lW;const xn=")]}'";function kn(w,u){const E=u.replace(w.gitilesBaseUrl,"").split("/").filter(Ft=>!!Ft),q=E.indexOf("+");if(q<=0)throw new Error(`Unable to parse project from url: ${u}`);const ve=(0,W.trimStart)(E.slice(0,q).join("/"),"/"),ye=E.indexOf("heads");if(ye<=0)throw new Error(`Unable to parse branch from url: ${u}`);const Ne=E[ye+1],Je=E.slice(ye+2).join("/");return{branch:Ne,filePath:Je===""?"/":Je,project:ve}}function On(w,u,x,E){return`${w.gitilesBaseUrl}/${u}/+/refs/heads/${x}/${(0,W.trimStart)(E,"/")}`}function bn(w){return w.password?"/a/":"/"}function ge(w,u){const{branch:x,project:E}=kn(w,u);return`${w.baseUrl}${bn(w)}projects/${encodeURIComponent(E)}/branches/${x}`}function ee(w,u){const{project:x}=kn(w,u);return`${w.cloneUrl}${bn(w)}${x}`}function Re(w,u){const{branch:x,filePath:E,project:q}=kn(w,u);return`${w.baseUrl}${bn(w)}projects/${encodeURIComponent(q)}/branches/${x}/files/${encodeURIComponent(E)}/content`}function Ue(w){return`${w.baseUrl}${bn(w)}projects/`}function et(w){const u={};if(!w.password)return u;const x=yn.from(`${w.username}:${w.password}`,"utf8");return u.Authorization=`Basic ${x.toString("base64")}`,{headers:u}}async function wt(w){const u=await w.text();if(u.startsWith(xn))try{return JSON.parse(u.slice(xn.length))}catch(x){throw new Error(`Invalid response from Gerrit: ${u.slice(0,10)} - ${x}`)}throw new Error(`Gerrit JSON body prefix missing. Found: ${u.slice(0,10)}`)}class ae{get type(){return"gerrit"}get title(){return this.integrationConfig.host}get config(){return this.integrationConfig}resolveUrl(u){const{url:x,base:E,lineNumber:q}=u;let ve;if(x.startsWith("/")){const{branch:ye,project:Ne}=kn(this.config,E);return On(this.config,Ne,ye,x)}return x?ve=new URL(x,E):ve=new URL(E),q&&(ve.hash=q.toString()),ve.toString()}resolveEditUrl(u){return u}constructor(u){this.integrationConfig=u}}ae.factory=({config:w})=>{var u;const x=pn((u=w.getOptionalConfigArray("integrations.gerrit"))!==null&&u!==void 0?u:[]);return b(x.map(E=>new ae(E)),E=>E.config.host)};function O(w){const u=w.getString("host");let x=w.getOptionalString("baseUrl");const E=w.getOptionalString("username"),q=w.getOptionalString("password");if(!k(u))throw new Error(`Invalid Gitea integration config, '${u}' is not a valid host`);return x?x=(0,W.trimEnd)(x,"/"):x=`https://${u}`,{host:u,baseUrl:x,username:E,password:q}}var de=t(48834).lW;function Be(w,u){try{var x;const E=(x=w.baseUrl)!==null&&x!==void 0?x:`https://${w.host}`,[q,ve,ye,Ne,Je,Ft,...Ht]=u.replace(E,"").split("/"),$n=Ht.join("/").replace(/^\//,"");return`${E}/${ve}/${ye}/_edit/${Ft}/${$n}`}catch(E){throw new Error(`Incorrect URL: ${u}, ${E}`)}}function D(w,u){try{var x;const E=(x=w.baseUrl)!==null&&x!==void 0?x:`https://${w.host}`,[q,ve,ye,Ne,Je,Ft,...Ht]=u.replace(E,"").split("/"),$n=Ht.join("/").replace(/^\//,"");return`${E}/api/v1/repos/${ve}/${ye}/contents/${$n}?ref=${Ft}`}catch(E){throw new Error(`Incorrect URL: ${u}, ${E}`)}}function M(w){const u={},{username:x,password:E}=w;return E?(x?u.Authorization=`basic ${de.from(`${x}:${E}`).toString("base64")}`:u.Authorization=`token ${E}`,{headers:u}):u}class ue{get type(){return"gitea"}get title(){return this.config.host}resolveUrl(u){return c(u)}resolveEditUrl(u){return Be(this.config,u)}constructor(u){this.config=u}}ue.factory=({config:w})=>{var u;const E=((u=w.getOptionalConfigArray("integrations.gitea"))!==null&&u!==void 0?u:[]).map(q=>O(q));return b(E.map(q=>new ue(q)),q=>q.config.host)};const fe="github.com",be="https://api.github.com",$e="https://raw.githubusercontent.com";function Ae(w){var u,x;const E=(x=w.getOptionalString("host"))!==null&&x!==void 0?x:fe;let q=w.getOptionalString("apiBaseUrl"),ve=w.getOptionalString("rawBaseUrl");const ye=w.getOptionalString("token"),Ne=(u=w.getOptionalConfigArray("apps"))===null||u===void 0?void 0:u.map(Je=>({appId:Je.getNumber("appId"),clientId:Je.getString("clientId"),clientSecret:Je.getString("clientSecret"),webhookSecret:Je.getString("webhookSecret"),privateKey:Je.getString("privateKey"),allowedInstallationOwners:Je.getOptionalStringArray("allowedInstallationOwners")}));if(!k(E))throw new Error(`Invalid GitHub integration config, '${E}' is not a valid host`);return q?q=(0,W.trimEnd)(q,"/"):E===fe&&(q=be),ve?ve=(0,W.trimEnd)(ve,"/"):E===fe&&(ve=$e),{host:E,apiBaseUrl:q,rawBaseUrl:ve,token:ye,apps:Ne}}function We(w){const u=w.map(Ae);return u.some(x=>x.host===fe)||u.push({host:fe,apiBaseUrl:be,rawBaseUrl:$e}),u}function rt(w,u,x){try{const{owner:E,name:q,ref:ve,filepathtype:ye,filepath:Ne}=parseGitUrl(w);if(!E||!q||!ve||ye!=="blob"&&ye!=="raw"&&ye!=="tree")throw new Error("Invalid GitHub URL or file path");const Je=Ne.replace(/^\//,"");return G(u,x)==="api"?`${u.apiBaseUrl}/repos/${E}/${q}/contents/${Je}?ref=${ve}`:`${u.rawBaseUrl}/${E}/${q}/${ve}/${Je}`}catch(E){throw new Error(`Incorrect URL: ${w}, ${E}`)}}function S(w,u){const x={};return G(w,u)==="api"&&(x.Accept="application/vnd.github.v3.raw"),u.token&&(x.Authorization=`token ${u.token}`),{headers:x}}function G(w,u){return w.apiBaseUrl&&(u.token||!w.rawBaseUrl)?"api":"raw"}var me=t(42822),he=t(89393),Ce=t(26228);class Oe{async getOrCreateToken(u,x,E){let q=this.tokenCache.get(u);if((!q||this.isExpired(q.expiresAt))&&(q=await E(),q.expiresAt=q.expiresAt.minus({minutes:10}),this.tokenCache.set(u,q)),!this.appliesToRepo(q,x))throw new Error(`The Backstage GitHub application used in the ${u} organization does not have access to a repository with the name ${x}`);return{accessToken:q.token}}appliesToRepo(u,x){return x===void 0?!0:u.repositories!==void 0?u.repositories.includes(x):!0}constructor(){this.tokenCache=new Map,this.isExpired=u=>Ce.ou.local()>u}}const Me={Accept:"application/vnd.github.machine-man-preview+json"};class dt{async getInstallationCredentials(u,x){if(this.allowedInstallationOwners){var E;if(!(!((E=this.allowedInstallationOwners)===null||E===void 0)&&E.includes(u)))return{accessToken:void 0}}return this.cache.getOrCreateToken(u,x,async()=>{const{installationId:q,suspended:ve}=await this.getInstallationData(u);if(ve)throw new Error(`The GitHub application for ${u} is suspended`);const ye=await this.appClient.apps.createInstallationAccessToken({installation_id:q,headers:Me});let Ne;if(ye.data.repository_selection==="selected"){const Ft=new he.v({baseUrl:this.baseUrl,auth:ye.data.token}),Ht=await Ft.paginate(Ft.apps.listReposAccessibleToInstallation);var Je;Ne=((Je=Ht.repositories)!==null&&Je!==void 0?Je:Ht).map(ur=>ur.name)}return{token:ye.data.token,expiresAt:Ce.ou.fromISO(ye.data.expires_at),repositories:Ne}})}getInstallations(){return this.appClient.paginate(this.appClient.apps.listInstallations)}async getInstallationData(u){const E=(await this.getInstallations()).find(ve=>{var ye,Ne;return((ye=ve.account)===null||ye===void 0||(Ne=ye.login)===null||Ne===void 0?void 0:Ne.toLocaleLowerCase("en-US"))===u.toLocaleLowerCase("en-US")});if(E)return{installationId:E.id,suspended:Boolean(E.suspended_by)};const q=new Error(`No app installation found for ${u} in ${this.baseAuthConfig.appId}`);throw q.name="NotFoundError",q}constructor(u,x){this.cache=new Oe,this.allowedInstallationOwners=u.allowedInstallationOwners,this.baseUrl=x,this.baseAuthConfig={appId:u.appId,privateKey:u.privateKey.replace(/\\n/gm,`
|
|
33
|
-
`)},this.appClient=new he.v({baseUrl:x,headers:Me,authStrategy:me.i,auth:this.baseAuthConfig})}}class jt{async getAllInstallations(){return this.apps.length?(await Promise.all(this.apps.map(x=>x.getInstallations()))).flat():[]}async getAppToken(u,x){if(this.apps.length===0)return;const E=await Promise.all(this.apps.map(Ne=>Ne.getInstallationCredentials(u,x).then(Je=>({credentials:Je,error:void 0}),Je=>({credentials:void 0,error:Je})))),q=E.find(Ne=>Ne.credentials);if(q)return q.credentials.accessToken;const ye=E.map(Ne=>Ne.error).find(Ne=>Ne.name!=="NotFoundError");if(ye)throw ye}constructor(u){var x,E;this.apps=(E=(x=u.apps)===null||x===void 0?void 0:x.map(q=>new dt(q,u.apiBaseUrl)))!==null&&E!==void 0?E:[]}}class at{async getCredentials(u){const x=r()(u.url),E=x.owner||x.name,q=x.owner?x.name:void 0;let ve="app",ye=await this.githubAppCredentialsMux.getAppToken(E,q);return ye||(ve="token",ye=this.token),{headers:ye?{Authorization:`Bearer ${ye}`}:void 0,token:ye,type:ve}}constructor(u,x){this.githubAppCredentialsMux=u,this.token=x}}at.create=w=>new at(new jt(w),w.token);class pt{static fromIntegrations(u){const x=new Map;return u.github.list().forEach(E=>{const q=SingleInstanceGithubCredentialsProvider.create(E.config);x.set(E.config.host,q)}),new pt(x)}async getCredentials(u){const x=new URL(u.url),E=this.providers.get(x.host);if(!E)throw new Error(`There is no GitHub integration that matches ${u.url}. Please add a configuration for an integration.`);return E.getCredentials(u)}constructor(u){this.providers=u}}class yt{get type(){return"github"}get title(){return this.integrationConfig.host}get config(){return this.integrationConfig}resolveUrl(u){return lt(c(u),"tree")}resolveEditUrl(u){return lt(u,"edit")}constructor(u){this.integrationConfig=u}}yt.factory=({config:w})=>{var u;const x=We((u=w.getOptionalConfigArray("integrations.github"))!==null&&u!==void 0?u:[]);return b(x.map(E=>new yt(E)),E=>E.config.host)};function lt(w,u){return w.replace(/\/\/([^/]+)\/([^/]+)\/([^/]+)\/(blob|tree|edit)\//,(x,E,q,ve)=>`//${E}/${q}/${ve}/${u}/`)}const Bt=null;class Mt extends yt{get config(){return super.config}constructor(u){super(u)}}Mt.factory=yt.factory;const zt=null,qt=null,Wn=null,Sn="gitlab.com",Dt="https://gitlab.com/api/v4";function Nt(w){const u=w.getString("host");let x=w.getOptionalString("apiBaseUrl");const E=w.getOptionalString("token");let q=w.getOptionalString("baseUrl");if(x?x=(0,W.trimEnd)(x,"/"):u===Sn&&(x=Dt),q?q=(0,W.trimEnd)(q,"/"):q=`https://${u}`,k(u)){if(!x||!g(x))throw new Error(`Invalid GitLab integration config, '${x}' is not a valid apiBaseUrl`);if(!g(q))throw new Error(`Invalid GitLab integration config, '${q}' is not a valid baseUrl`)}else throw new Error(`Invalid GitLab integration config, '${u}' is not a valid host`);return{host:u,token:E,apiBaseUrl:x,baseUrl:q}}function rn(w){const u=w.map(Nt);return u.some(x=>x.host===Sn)||u.push({host:Sn,apiBaseUrl:Dt,baseUrl:`https://${Sn}`}),u}function Bn(w){let u="";return w.host!==Sn&&(u=new URL(w.baseUrl).pathname),trimEnd(u,"/")}async function Xn(w,u){const x=await Yn(w,u);return wn(w,x,u).toString()}function Cn(w){const{token:u=""}=w;return{headers:{"PRIVATE-TOKEN":u}}}function wn(w,u,x){try{const E=new URL(w),q=E.pathname.split("/blob/").slice(1).join("/blob/"),[ve,...ye]=q.split("/"),Ne=getGitLabIntegrationRelativePath(x);return E.pathname=[...Ne?[Ne]:[],"api/v4/projects",u,"repository/files",encodeURIComponent(decodeURIComponent(ye.join("/"))),"raw"].join("/"),E.search=`?ref=${ve}`,E}catch(E){throw new Error(`Incorrect url: ${w}, ${E}`)}}async function Yn(w,u){const x=new URL(w);if(!x.pathname.includes("/blob/"))throw new Error("Please provide full path to yaml file from GitLab");try{let E=x.pathname.split("/-/blob/")[0].split("/blob/")[0];const q=getGitLabIntegrationRelativePath(u);q&&(E=E.replace(q,""));const ve=new URL(`${x.origin}${q}/api/v4/projects/${encodeURIComponent(E.replace(/^\//,""))}`),ye=await fetch(ve.toString(),Cn(u)),Ne=await ye.json();if(!ye.ok)throw new Error(`GitLab Error '${Ne.error}', ${Ne.error_description}`);return Number(Ne.id)}catch(E){throw new Error(`Could not get GitLab project ID for: ${w}, ${E}`)}}class fn{get type(){return"gitlab"}get title(){return this.integrationConfig.host}get config(){return this.integrationConfig}resolveUrl(u){return c(u)}resolveEditUrl(u){return Rn(u,"edit")}constructor(u){this.integrationConfig=u}}fn.factory=({config:w})=>{var u;const x=rn((u=w.getOptionalConfigArray("integrations.gitlab"))!==null&&u!==void 0?u:[]);return b(x.map(E=>new fn(E)),E=>E.config.host)};function Rn(w,u){return w.replace(/\/\-\/(blob|tree|edit)\//,`/-/${u}/`)}class dr{static fromConfig(u){return new dr({awsS3:X.factory({config:u}),azure:Ge.factory({config:u}),bitbucket:bt.factory({config:u}),bitbucketCloud:Ot.factory({config:u}),bitbucketServer:In.factory({config:u}),gerrit:ae.factory({config:u}),github:yt.factory({config:u}),gitlab:fn.factory({config:u}),gitea:ue.factory({config:u})})}get awsS3(){return this.byType.awsS3}get azure(){return this.byType.azure}get bitbucket(){return this.byType.bitbucket}get bitbucketCloud(){return this.byType.bitbucketCloud}get bitbucketServer(){return this.byType.bitbucketServer}get gerrit(){return this.byType.gerrit}get github(){return this.byType.github}get gitlab(){return this.byType.gitlab}get gitea(){return this.byType.gitea}list(){return Object.values(this.byType).flatMap(u=>u.list())}byUrl(u){let x=Object.values(this.byType).map(E=>E.byUrl(u)).filter(Boolean);if(x.length>1){const E=x.filter(q=>!(q instanceof bt));E.length!==0&&(x=E)}return x[0]}byHost(u){return Object.values(this.byType).map(x=>x.byHost(u)).find(Boolean)}resolveUrl(u){const x=this.byUrl(u.base);return x?x.resolveUrl(u):c(u)}resolveEditUrl(u){const x=this.byUrl(u);return x?x.resolveEditUrl(u):u}constructor(u){this.byType=u}}},51102:function(At,Fe,t){"use strict";var h={};t.r(h),t.d(h,{TechDocsPlugin:function(){return C.s4}});var r=t(52322),W=t(2784),k=t(28316),g=t(79635),b=t(25248);const c=(0,b.T0)({id:"plugin.techdocs.storageservice"}),P=(0,b.T0)({id:"plugin.techdocs.service"});var te=t(92077),_=t(95481),X=t(7476),U=t(93225),F=t(67896),Y=t(65124),ce=t(17339),oe=t(85478),T=t(68435),R=t(3482),V=t(42081),A=t(48431),C=t(89258),z=t(52943),Le=t(61886),Xe=t(13980),Qe=t.n(Xe);class _e{get(n){for(const o of this.holders){const l=o.get(n);if(l)return l}}constructor(...n){this.holders=n}}var Ge=t(51837);const gt=(0,Ge.CT)("api-context"),Ee=i=>{var n;const{apis:o,children:l}=i,f=(n=(0,W.useContext)(gt))===null||n===void 0?void 0:n.atVersion(1),L=f?new _e(o,f):o;return(0,r.jsx)(gt.Provider,{value:(0,Ge.EI)({1:L}),children:l})};Ee.propTypes={apis:Qe().shape({get:Qe().func.isRequired}).isRequired,children:Qe().node};class Ke{static validateFactories(n,o){for(const l of o){const f=[l],L=new Set;for(;f.length;){const Z=f.shift(),H=n.get(Z);if(!!H)for(const se of Object.values(H.deps)){if(se.id===l.id)throw new Error(`Circular dependency of api factory for ${l}`);L.has(se)||(L.add(se),f.push(se))}}}}get(n){return this.load(n)}load(n,o=[]){const l=this.apis.get(n.id);if(l)return l;const f=this.factories.get(n);if(!f)return;if(o.includes(f.api))throw new Error(`Circular dependency of api factory for ${f.api}`);const L=this.loadDeps(n,f.deps,[...o,f.api]),Z=f.factory(L);return this.apis.set(n.id,Z),Z}loadDeps(n,o,l){const f={};for(const L in o)if(o.hasOwnProperty(L)){const Z=o[L],H=this.load(Z,l);if(!H)throw new Error(`No API factory available for dependency ${Z} of dependent ${n}`);f[L]=H}return f}constructor(n){this.factories=n,this.apis=new Map}}var it;(function(i){i[i.default=10]="default",i[i.app=50]="app",i[i.static=100]="static"})(it||(it={}));class mt{register(n,o){const l=it[n],f=this.factories.get(o.api.id);return f&&f.priority>=l?!1:(this.factories.set(o.api.id,{priority:l,factory:o}),!0)}get(n){const o=this.factories.get(n.id);if(!!o)return o.factory}getAllApis(){const n=new Set;for(const{factory:o}of this.factories.values())n.add(o.api);return n}constructor(){this.factories=new Map}}function ot(i){return new Promise((n,o)=>{const l=i.width||500,f=i.height||700,L=window.screen.width/2-l/2,Z=window.screen.height/2-f/2,H=window.open(i.url,i.name,`menubar=no,location=no,resizable=no,scrollbars=no,status=no,width=${l},height=${f},top=${Z},left=${L}`);let se="";if(!H||typeof H.closed=="undefined"||H.closed){const st=new Error("Failed to open auth popup.");st.name="PopupRejectedError",o(st);return}const He=st=>{if(st.source!==H||st.origin!==i.origin)return;const{data:Ct}=st;if(Ct.type==="config_info"){se=Ct.targetOrigin;return}if(Ct.type!=="authorization_response")return;const St=Ct;if("error"in St){const $t=new Error(St.error.message);$t.name=St.error.name,o($t)}else n(St.response);ct()},De=setInterval(()=>{if(H.closed){const st=`Login failed, ${se&&se!==window.location.origin?`Incorrect app origin, expected ${se}`:"popup was closed"}`,Ct=new Error(st);Ct.name="PopupClosedError",o(Ct),ct()}},100);function ct(){window.removeEventListener("message",He),clearInterval(De)}window.addEventListener("message",He)})}function ft(i){return[...i].join(" ")}class nt{async createSession(n){return n.instantPopup?this.showPopup(n.scopes):this.authRequester(n.scopes)}async refreshSession(){const n=await fetch(await this.buildUrl("/refresh",{optional:!0}),{headers:{"x-requested-with":"XMLHttpRequest"},credentials:"include"}).catch(l=>{throw new Error(`Auth refresh request failed, ${l}`)});if(!n.ok){const l=new Error(`Auth refresh request failed, ${n.statusText}`);throw l.status=n.status,l}const o=await n.json();if(o.error){const l=new Error(o.error.message);throw o.error.name&&(l.name=o.error.name),l}return await this.sessionTransform(o)}async removeSession(){const n=await fetch(await this.buildUrl("/logout"),{method:"POST",headers:{"x-requested-with":"XMLHttpRequest"},credentials:"include"}).catch(o=>{throw new Error(`Logout request failed, ${o}`)});if(!n.ok){const o=new Error(`Logout request failed, ${n.statusText}`);throw o.status=n.status,o}}async showPopup(n){const o=this.joinScopesFunc(n),l=await this.buildUrl("/start",{scope:o,origin:window.location.origin}),f=await ot({url:l,name:`${this.provider.title} Login`,origin:new URL(l).origin,width:450,height:730});return await this.sessionTransform(f)}async buildUrl(n,o){const l=await this.discoveryApi.getBaseUrl("auth"),f=this.buildQueryString({...o,env:this.environment});return`${l}/${this.provider.id}${n}${f}`}buildQueryString(n){if(!n)return"";const o=Object.entries(n).map(([l,f])=>{if(typeof f=="string")return`${encodeURIComponent(l)}=${encodeURIComponent(f)}`;if(f)return encodeURIComponent(l)}).filter(Boolean).join("&");return o?`?${o}`:""}constructor(n){const{discoveryApi:o,environment:l,provider:f,joinScopes:L=ft,oauthRequestApi:Z,sessionTransform:H=se=>se}=n;this.authRequester=Z.createAuthRequester({provider:f,onAuthRequest:se=>this.showPopup(se)}),this.discoveryApi=o,this.environment=l,this.provider=f,this.joinScopesFunc=L,this.sessionTransform=H}}function Lt(i,n){for(const o of n)if(!i.has(o))return!1;return!0}class bt{sessionExistsAndHasScope(n,o){if(!n)return!1;if(!o||this.options.sessionScopes===void 0)return!0;const l=this.options.sessionScopes(n);return Lt(l,o)}getExtendedScope(n,o){const l=new Set(this.options.defaultScopes);if(n&&this.options.sessionScopes!==void 0){const f=this.options.sessionScopes(n);for(const L of f)l.add(L)}if(o)for(const f of o)l.add(f);return l}constructor(n){this.options=n}}var ze=t(82394),ne=t.n(ze);let Pe=Symbol.observable;class ke{[Pe](){return this}get closed(){return this.isClosed}next(n){if(this.isClosed)throw new Error("PublishSubject is closed");this.subscribers.forEach(o=>o.next(n))}error(n){if(this.isClosed)throw new Error("PublishSubject is closed");this.isClosed=!0,this.terminatingError=n,this.subscribers.forEach(o=>o.error(n))}complete(){if(this.isClosed)throw new Error("PublishSubject is closed");this.isClosed=!0,this.subscribers.forEach(n=>n.complete())}subscribe(n,o,l){const f=typeof n=="function"?{next:n,error:o,complete:l}:n;return this.observable.subscribe(f)}constructor(){this.isClosed=!1,this.observable=new(ne())(n=>this.isClosed?(this.terminatingError?n.error(this.terminatingError):n.complete(),()=>{}):(this.subscribers.add(n),()=>{this.subscribers.delete(n)})),this.subscribers=new Set}}let tt=Symbol.observable;class vt{[tt](){return this}get closed(){return this.isClosed}next(n){if(this.isClosed)throw new Error("BehaviorSubject is closed");this.currentValue=n,this.subscribers.forEach(o=>o.next(n))}error(n){if(this.isClosed)throw new Error("BehaviorSubject is closed");this.isClosed=!0,this.terminatingError=n,this.subscribers.forEach(o=>o.error(n))}complete(){if(this.isClosed)throw new Error("BehaviorSubject is closed");this.isClosed=!0,this.subscribers.forEach(n=>n.complete())}subscribe(n,o,l){const f=typeof n=="function"?{next:n,error:o,complete:l}:n;return this.observable.subscribe(f)}constructor(n){this.subscribers=new Set,this.isClosed=!1,this.currentValue=n,this.terminatingError=void 0,this.observable=new(ne())(o=>this.isClosed?(this.terminatingError?o.error(this.terminatingError):o.complete(),()=>{}):(o.next(this.currentValue),this.subscribers.add(o),()=>{this.subscribers.delete(o)}))}}class Zt{setIsSignedIn(n){this.signedIn!==n&&(this.signedIn=n,this.subject.next(this.signedIn?b.sM.SignedIn:b.sM.SignedOut))}sessionState$(){return this.subject}constructor(){this.subject=new vt(b.sM.SignedOut),this.signedIn=!1}}class ut{async getSession(n){if(this.helper.sessionExistsAndHasScope(this.currentSession,n.scopes)){if(!this.sessionShouldRefreshFunc(this.currentSession))return this.currentSession;try{const l=await this.collapsedSessionRefresh(),f=this.sessionScopesFunc(this.currentSession),L=this.sessionScopesFunc(l);return Lt(L,f)&&(this.currentSession=l),l}catch(l){if(n.optional)return;throw l}}if(!this.currentSession&&!n.instantPopup)try{const o=await this.collapsedSessionRefresh();return this.currentSession=o,this.getSession(n)}catch{}if(!n.optional)return this.currentSession=await this.connector.createSession({...n,scopes:this.helper.getExtendedScope(this.currentSession,n.scopes)}),this.stateTracker.setIsSignedIn(!0),this.currentSession}async removeSession(){this.currentSession=void 0,await this.connector.removeSession(),this.stateTracker.setIsSignedIn(!1)}sessionState$(){return this.stateTracker.sessionState$()}async collapsedSessionRefresh(){if(this.refreshPromise)return this.refreshPromise;this.refreshPromise=this.connector.refreshSession();try{const n=await this.refreshPromise;return this.stateTracker.setIsSignedIn(!0),n}finally{delete this.refreshPromise}}constructor(n){this.stateTracker=new Zt;const{connector:o,defaultScopes:l=new Set,sessionScopes:f,sessionShouldRefresh:L}=n;this.connector=o,this.sessionScopesFunc=f,this.sessionShouldRefreshFunc=L,this.helper=new bt({sessionScopes:f,defaultScopes:l})}}class Tt{setSession(n){this.currentSession=n,this.stateTracker.setIsSignedIn(Boolean(n))}async getSession(n){if(this.helper.sessionExistsAndHasScope(this.currentSession,n.scopes))return this.currentSession;if(!n.optional)return this.currentSession=await this.connector.createSession({...n,scopes:this.helper.getExtendedScope(this.currentSession,n.scopes)}),this.stateTracker.setIsSignedIn(!0),this.currentSession}async removeSession(){this.currentSession=void 0,this.stateTracker.setIsSignedIn(!1)}sessionState$(){return this.stateTracker.sessionState$()}constructor(n){this.stateTracker=new SessionStateTracker;const{connector:o,defaultScopes:l=new Set,sessionScopes:f}=n;this.connector=o,this.helper=new SessionScopeHelper({sessionScopes:f,defaultScopes:l})}}const It={id:"oauth2",title:"Your Identity Provider",icon:()=>null};class Ot{static create(n){const{discoveryApi:o,environment:l="development",provider:f=It,oauthRequestApi:L,defaultScopes:Z=[],scopeTransform:H=De=>De}=n,se=new nt({discoveryApi:o,environment:l,provider:f,oauthRequestApi:L,sessionTransform(De){return{...De,providerInfo:{idToken:De.providerInfo.idToken,accessToken:De.providerInfo.accessToken,scopes:Ot.normalizeScopes(H,De.providerInfo.scope),expiresAt:new Date(Date.now()+De.providerInfo.expiresInSeconds*1e3)}}}}),He=new ut({connector:se,defaultScopes:new Set(Z),sessionScopes:De=>De.providerInfo.scopes,sessionShouldRefresh:De=>(De.providerInfo.expiresAt.getTime()-Date.now())/1e3<60*5});return new Ot({sessionManager:He,scopeTransform:H})}async signIn(){await this.getAccessToken()}async signOut(){await this.sessionManager.removeSession()}sessionState$(){return this.sessionManager.sessionState$()}async getAccessToken(n,o){const l=Ot.normalizeScopes(this.scopeTransform,n),f=await this.sessionManager.getSession({...o,scopes:l});var L;return(L=f==null?void 0:f.providerInfo.accessToken)!==null&&L!==void 0?L:""}async getIdToken(n={}){const o=await this.sessionManager.getSession(n);var l;return(l=o==null?void 0:o.providerInfo.idToken)!==null&&l!==void 0?l:""}async getBackstageIdentity(n={}){const o=await this.sessionManager.getSession(n);return o==null?void 0:o.backstageIdentity}async getProfile(n={}){const o=await this.sessionManager.getSession(n);return o==null?void 0:o.profile}static normalizeScopes(n,o){if(!o)return new Set;const l=Array.isArray(o)?o:o.split(/[\s|,]/).filter(Boolean);return new Set(n(l))}constructor(n){this.sessionManager=n.sessionManager,this.scopeTransform=n.scopeTransform}}const en={id:"github",title:"GitHub",icon:()=>null};class Wt{static create(n){const{discoveryApi:o,environment:l="development",provider:f=en,oauthRequestApi:L,defaultScopes:Z=["read:user"]}=n;return Ot.create({discoveryApi:o,oauthRequestApi:L,provider:f,environment:l,defaultScopes:Z})}}const Vt={id:"gitlab",title:"GitLab",icon:()=>null};class Qt{static create(n){const{discoveryApi:o,environment:l="development",provider:f=Vt,oauthRequestApi:L,defaultScopes:Z=["read_user"]}=n;return Ot.create({discoveryApi:o,oauthRequestApi:L,provider:f,environment:l,defaultScopes:Z})}}const un={id:"google",title:"Google",icon:()=>null},cn="https://www.googleapis.com/auth/";class Fn{static create(n){const{discoveryApi:o,oauthRequestApi:l,environment:f="development",provider:L=un,defaultScopes:Z=["openid",`${cn}userinfo.email`,`${cn}userinfo.profile`]}=n;return Ot.create({discoveryApi:o,oauthRequestApi:l,provider:L,environment:f,defaultScopes:Z,scopeTransform(H){return H.map(se=>se==="openid"?se:se==="profile"||se==="email"?`${cn}userinfo.${se}`:se.startsWith(cn)?se:`${cn}${se}`)}})}}const In={id:"okta",title:"Okta",icon:()=>null},Un=new Set(["openid","profile","email","phone","address","groups","offline_access"]),vn="okta.";class hn{static create(n){const{discoveryApi:o,environment:l="development",provider:f=In,oauthRequestApi:L,defaultScopes:Z=["openid","email","profile","offline_access"]}=n;return Ot.create({discoveryApi:o,oauthRequestApi:L,provider:f,environment:l,defaultScopes:Z,scopeTransform(H){return H.map(se=>Un.has(se)||se.startsWith(vn)?se:`${vn}${se}`)}})}}var Xt=t(30195);const Mn=Xt.z.object({profile:Xt.z.object({email:Xt.z.string().optional(),displayName:Xt.z.string().optional(),picture:Xt.z.string().optional()}),backstageIdentity:Xt.z.object({token:Xt.z.string(),identity:Xt.z.object({type:Xt.z.literal("user"),userEntityRef:Xt.z.string(),ownershipEntityRefs:Xt.z.array(Xt.z.string())})})}),zn={id:"saml",title:"SAML",icon:()=>null};class pn{static create(n){const{discoveryApi:o,environment:l="development",provider:f=zn}=n,L=new DirectAuthConnector({discoveryApi:o,environment:l,provider:f}),Z=new StaticAuthSessionManager({connector:L}),H=new AuthSessionStore({manager:Z,storageKey:`${f.id}Session`,schema:samlSessionSchema});return new pn(H)}sessionState$(){return this.sessionManager.sessionState$()}async signIn(){await this.getBackstageIdentity({})}async signOut(){await this.sessionManager.removeSession()}async getBackstageIdentity(n={}){const o=await this.sessionManager.getSession(n);return o==null?void 0:o.backstageIdentity}async getProfile(n={}){const o=await this.sessionManager.getSession(n);return o==null?void 0:o.profile}constructor(n){this.sessionManager=n}}const yn={id:"microsoft",title:"Microsoft",icon:()=>null};class xn{static create(n){const{environment:o="development",provider:l=yn,oauthRequestApi:f,discoveryApi:L,defaultScopes:Z=["openid","offline_access","profile","email","User.Read"]}=n;return Ot.create({discoveryApi:L,oauthRequestApi:f,provider:l,environment:o,defaultScopes:Z})}}const kn={id:"onelogin",title:"onelogin",icon:()=>null},On=new Set(["openid","profile","email","phone","address","groups","offline_access"]),bn="onelogin.";class ge{static create(n){const{discoveryApi:o,environment:l="development",provider:f=kn,oauthRequestApi:L}=n;return Ot.create({discoveryApi:o,oauthRequestApi:L,provider:f,environment:l,defaultScopes:["openid","email","profile","offline_access"],scopeTransform(Z){return Z.map(H=>On.has(H)||H.startsWith(bn)?H:`${bn}${H}`)}})}}const ee={id:"bitbucket",title:"Bitbucket",icon:()=>null};class Re{static create(n){const{discoveryApi:o,environment:l="development",provider:f=ee,oauthRequestApi:L,defaultScopes:Z=["team"]}=n;return Ot.create({discoveryApi:o,oauthRequestApi:L,provider:f,environment:l,defaultScopes:Z})}}const Ue={id:"atlassian",title:"Atlassian",icon:()=>null};class et{static create(n){const{discoveryApi:o,environment:l="development",provider:f=Ue,oauthRequestApi:L}=n;return Ot.create({discoveryApi:o,oauthRequestApi:L,provider:f,environment:l})}}class wt{post(n){this.subject.next(n)}alert$(){return this.subject}constructor(){this.subject=new ke}}class ae{captureEvent(n){}}const O="theme";class de{static createWithStorage(n){const o=new de(n);if(!window.localStorage)return o;var l;const f=(l=window.localStorage.getItem(O))!==null&&l!==void 0?l:void 0;return o.setActiveThemeId(f),o.activeThemeId$().subscribe(L=>{L?window.localStorage.setItem(O,L):window.localStorage.removeItem(O)}),window.addEventListener("storage",L=>{if(L.key===O){var Z;const H=(Z=localStorage.getItem(O))!==null&&Z!==void 0?Z:void 0;o.setActiveThemeId(H)}}),o}getInstalledThemes(){return this.themes.slice()}activeThemeId$(){return this.subject}getActiveThemeId(){return this.activeThemeId}setActiveThemeId(n){this.activeThemeId=n,this.subject.next(n)}constructor(n){this.themes=n,this.subject=new vt(void 0)}}var Be=t(9850),D=t.n(Be),M=t(12782),ue=t.n(M);const fe=/^[a-z][a-z0-9]*(?:[-_][a-z][a-z0-9]*)*$/i;function be(i){return typeof i=="object"&&i!==null&&!Array.isArray(i)}function $e(i){if(i===null)return"null";if(Array.isArray(i))return"array";const n=typeof i;return n==="number"&&isNaN(i)?"nan":n==="string"&&i===""?"empty-string":n}const Ae={type(i,n,o,l){return`Invalid type in config for key '${i}' in '${n}', got ${o}, wanted ${l}`},missing(i){return`Missing required config value at '${i}'`},convert(i,n,o){return`Unable to convert config value for key '${i}' in '${n}' to a ${o}`}};class We{static fromConfigs(n){return n.length===0?new We(void 0):n.reduce((o,{data:l,context:f,filteredKeys:L,deprecatedKeys:Z})=>{const H=new We(l,f,o);if(H.filteredKeys=L,Z)for(const{key:se,description:He}of Z)console.warn(`The configuration key '${se}' of ${f} is deprecated and may be removed soon. ${He||""}`);return H},void 0)}has(n){var o;if(this.readValue(n)!==void 0)return!0;var f;return(f=(o=this.fallback)===null||o===void 0?void 0:o.has(n))!==null&&f!==void 0?f:!1}keys(){var n;const o=this.data?Object.keys(this.data):[];var l;const f=(l=(n=this.fallback)===null||n===void 0?void 0:n.keys())!==null&&l!==void 0?l:[];return[...new Set([...o,...f])]}get(n){const o=this.getOptional(n);if(o===void 0)throw new Error(Ae.missing(this.fullKey(n!=null?n:"")));return o}getOptional(n){var o;const l=D()(this.readValue(n)),f=(o=this.fallback)===null||o===void 0?void 0:o.getOptional(n);if(l===void 0){if(!1)var L;return f}else if(f===void 0)return l;return ue()({},{value:f},{value:l},(Z,H)=>!be(H)||!be(Z)?H:void 0).value}getConfig(n){const o=this.getOptionalConfig(n);if(o===void 0)throw new Error(Ae.missing(this.fullKey(n)));return o}getOptionalConfig(n){var o;const l=this.readValue(n),f=(o=this.fallback)===null||o===void 0?void 0:o.getOptionalConfig(n);if(be(l))return this.copy(l,n,f);if(l!==void 0)throw new TypeError(Ae.type(this.fullKey(n),this.context,$e(l),"object"));return f}getConfigArray(n){const o=this.getOptionalConfigArray(n);if(o===void 0)throw new Error(Ae.missing(this.fullKey(n)));return o}getOptionalConfigArray(n){const o=this.readConfigValue(n,f=>{if(!Array.isArray(f))return{expected:"object-array"};for(const[L,Z]of f.entries())if(!be(Z))return{expected:"object-array",value:Z,key:`${n}[${L}]`};return!0});if(!o){if(!1)var l;return}return o.map((f,L)=>this.copy(f,`${n}[${L}]`))}getNumber(n){const o=this.getOptionalNumber(n);if(o===void 0)throw new Error(Ae.missing(this.fullKey(n)));return o}getOptionalNumber(n){const o=this.readConfigValue(n,f=>typeof f=="number"||typeof f=="string"||{expected:"number"});if(typeof o=="number"||o===void 0)return o;const l=Number(o);if(!Number.isFinite(l))throw new Error(Ae.convert(this.fullKey(n),this.context,"number"));return l}getBoolean(n){const o=this.getOptionalBoolean(n);if(o===void 0)throw new Error(Ae.missing(this.fullKey(n)));return o}getOptionalBoolean(n){const o=this.readConfigValue(n,f=>typeof f=="boolean"||typeof f=="number"||typeof f=="string"||{expected:"boolean"});if(typeof o=="boolean"||o===void 0)return o;const l=String(o).trim();if(/^(?:y|yes|true|1|on)$/i.test(l))return!0;if(/^(?:n|no|false|0|off)$/i.test(l))return!1;throw new Error(Ae.convert(this.fullKey(n),this.context,"boolean"))}getString(n){const o=this.getOptionalString(n);if(o===void 0)throw new Error(Ae.missing(this.fullKey(n)));return o}getOptionalString(n){return this.readConfigValue(n,o=>typeof o=="string"&&o!==""||{expected:"string"})}getStringArray(n){const o=this.getOptionalStringArray(n);if(o===void 0)throw new Error(Ae.missing(this.fullKey(n)));return o}getOptionalStringArray(n){return this.readConfigValue(n,o=>{if(!Array.isArray(o))return{expected:"string-array"};for(const[l,f]of o.entries())if(typeof f!="string"||f==="")return{expected:"string-array",value:f,key:`${n}[${l}]`};return!0})}fullKey(n){return`${this.prefix}${this.prefix?".":""}${n}`}copy(n,o,l){const f=new We(n,this.context,l,this.fullKey(o));return f.filteredKeys=this.filteredKeys,f}readConfigValue(n,o){const l=this.readValue(n);if(l===void 0){var f;if(!1)var L;return(f=this.fallback)===null||f===void 0?void 0:f.readConfigValue(n,o)}const Z=o(l);if(Z!==!0){const{key:H=n,value:se=l,expected:He}=Z;throw new TypeError(Ae.type(this.fullKey(H),this.context,$e(se),He))}return l}readValue(n){const o=n?n.split("."):[];for(const f of o)if(!fe.test(f))throw new TypeError(`Invalid config key '${n}'`);if(this.data===void 0)return;let l=this.data;for(const[f,L]of o.entries())if(be(l))l=l[L];else if(l!==void 0){const Z=this.fullKey(o.slice(0,f).join("."));throw new TypeError(Ae.type(Z,this.context,$e(l),"object"))}return l}constructor(n,o="mock-config",l,f=""){this.data=n,this.context=o,this.fallback=l,this.prefix=f,this.notifiedFilteredKeys=new Set}}const rt="Invalid discovery URL pattern,";class S{static compile(n){const o=n.split(/\{\{\s*pluginId\s*\}\}/),l=o.join("pluginId");let f;try{f=new URL(l)}catch{throw new Error(`${rt} URL '${l}' is invalid`)}if(f.hash)throw new Error(`${rt} URL must not have a hash`);if(f.search)throw new Error(`${rt} URL must not have a query`);if(l.endsWith("/"))throw new Error(`${rt} URL must not end with a slash`);return new S(o)}async getBaseUrl(n){return this.parts.join(n)}constructor(n){this.parts=n}}class G{post(n,o){return o!=null&&o.hidden||this.alertApi.post({message:n.message,severity:"error"}),this.errorApi.post(n,o)}error$(){return this.errorApi.error$()}constructor(n,o){this.alertApi=n,this.errorApi=o}}class me{post(n,o){this.subject.next({error:n,context:o})}error$(){return this.subject}constructor(){this.subject=new ke}}class he{static forward(n,o){window.addEventListener("unhandledrejection",l=>{n.post(l.reason,o)})}}function Ce(i){if(i.length<3)throw new Error(`The '${i}' feature flag must have a minimum length of three characters.`);if(i.length>150)throw new Error(`The '${i}' feature flag must not exceed 150 characters.`);if(!i.match(/^[a-z]+[a-z0-9-]+$/))throw new Error(`The '${i}' feature flag must start with a lowercase letter and only contain lowercase letters, numbers and hyphens. Examples: feature-flag-one, alpha, release-2020`)}class Oe{registerFlag(n){Ce(n.name),this.registeredFeatureFlags.push(n)}getRegisteredFlags(){return this.registeredFeatureFlags.slice()}isActive(n){return this.flags||(this.flags=this.load()),this.flags.get(n)===b.CL.Active}save(n){this.flags||(this.flags=this.load()),n.merge||this.flags.clear();for(const[l,f]of Object.entries(n.states))this.flags.set(l,f);const o=Array.from(this.flags.entries()).filter(([,l])=>l===b.CL.Active);window.localStorage.setItem("featureFlags",JSON.stringify(Object.fromEntries(o)))}load(){try{const n=window.localStorage.getItem("featureFlags");if(!n)return new Map;const o=JSON.parse(n);if(typeof o!="object"||o===null||Array.isArray(o))return new Map;const l=Object.entries(o).filter(([f,L])=>(Ce(f),L===b.CL.Active));return new Map(l)}catch{return new Map}}constructor(){this.registeredFeatureFlags=[]}}function Me(i){let n=i.baseImplementation||t.g.fetch;var o;const l=[(o=i.middleware)!==null&&o!==void 0?o:[]].flat().reverse();for(const f of l)n=f.apply(n);return{fetch:n}}class dt{static create(n){var o,l;const f=jt(n),L=((o=n.header)===null||o===void 0?void 0:o.name)||"authorization",Z=((l=n.header)===null||l===void 0?void 0:l.value)||(H=>`Bearer ${H}`);return new dt(n.identityApi,f,L,Z)}apply(n){return async(o,l)=>{const f=new Request(o,l),{token:L}=await this.identityApi.getCredentials();return f.headers.get(this.headerName)||typeof L!="string"||!L||!this.allowUrl(f.url)?n(o,l):(f.headers.set(this.headerName,this.headerValue(L)),n(f))}}constructor(n,o,l,f){this.identityApi=n,this.allowUrl=o,this.headerName=l,this.headerValue=f}}function jt(i){return i.allowUrl?i.allowUrl:i.urlPrefixAllowlist?at(i.urlPrefixAllowlist):i.config?at([i.config.getString("backend.baseUrl")]):()=>!1}function at(i){const n=i.map(o=>o.replace(/\/$/,""));return o=>n.some(l=>o===l||o.startsWith(`${l}/`))}function pt(i,n){return!n||n==="/"?i:`${i.replace(/\/$/,"")}/${n.replace(/^\//,"")}`}class yt{apply(n){return async(o,l)=>{const f=new Request(o,l),L="plugin://";if(!f.url.startsWith(L))return n(o,l);const{hostname:Z,pathname:H,search:se,hash:He,username:De,password:ct}=new URL(`http://${f.url.substring(L.length)}`);let st=await this.discoveryApi.getBaseUrl(Z);if(De||ct){const St=new URL(st),$t=`${De}${ct?`:${ct}`:""}@`;st=`${St.protocol}//${$t}${St.host}${St.pathname}`}const Ct=`${pt(st,H)}${se}${He}`;return n(Ct,typeof o=="string"||lt(o)?l:o)}}constructor(n){this.discoveryApi=n}}function lt(i){return typeof i=="object"&&(i==null?void 0:i.constructor)===URL}class Bt{static resolvePluginProtocol(n){return new yt(n.discoveryApi)}static injectIdentityAuth(n){return dt.create(n)}constructor(){}}function Mt(i,n){for(const o of n)if(!i.has(o))return!1;return!0}function zt(i,...n){const o=new Set(i);for(const l of n)for(const f of l)o.add(f);return o}class qt{request(n){return new Promise((o,l)=>{this.requests.push({scopes:n,resolve:o,reject:l}),this.subject.next(this.getCurrentPending())})}resolve(n,o){this.requests=this.requests.filter(l=>Mt(n,l.scopes)?(l.resolve(o),!1):!0),this.subject.next(this.getCurrentPending())}reject(n){this.requests.forEach(o=>o.reject(n)),this.requests=[],this.subject.next(this.getCurrentPending())}pending(){return this.subject}getCurrentPending(){const n=this.requests.length===0?void 0:this.requests.slice(1).reduce((o,l)=>zt(o,l.scopes),this.requests[0].scopes);return{scopes:n,resolve:o=>{n&&this.resolve(n,o)},reject:o=>{n&&this.reject(o)}}}constructor(){this.requests=[],this.subject=new vt(this.getCurrentPending())}}class Wn{createAuthRequester(n){const o=new qt,l=this.handlerCount;return this.handlerCount++,o.pending().subscribe({next:f=>{const L=this.currentRequests.slice(),Z=this.makeAuthRequest(f,n);Z?L[l]=Z:delete L[l],this.currentRequests=L,this.subject.next(L.filter(Boolean))}}),f=>o.request(f)}makeAuthRequest(n,o){const{scopes:l}=n;if(!!l)return{provider:o.provider,trigger:async()=>{const f=await o.onAuthRequest(l);n.resolve(f)},reject:()=>{const f=new Error("Login failed, rejected by user");f.name="RejectedError",n.reject(f)}}}authRequest$(){return this.subject}constructor(){this.subject=new vt([]),this.currentRequests=[],this.handlerCount=0}}const Sn=new Map;class Dt{static create(n){var o;return new Dt((o=n.namespace)!==null&&o!==void 0?o:"",n.errorApi)}static addStorageEventListener(){window.addEventListener("storage",n=>{for(const[l,f]of Sn.entries()){var o;!((o=n.key)===null||o===void 0)&&o.startsWith(l)&&f.handleStorageChange(n.key)}})}get(n){return this.snapshot(n).value}snapshot(n){let o,l="absent";try{const f=localStorage.getItem(this.getKeyName(n));f&&(o=JSON.parse(f,(L,Z)=>(typeof Z=="object"&&Z!==null&&Object.freeze(Z),Z)),l="present")}catch{this.errorApi.post(new Error(`Error when parsing JSON config from storage for: ${n}`))}return{key:n,value:o,presence:l}}forBucket(n){const o=`${this.namespace}/${n}`;return Sn.has(o)||Sn.set(o,new Dt(o,this.errorApi)),Sn.get(o)}async set(n,o){localStorage.setItem(this.getKeyName(n),JSON.stringify(o)),this.notifyChanges(n)}async remove(n){localStorage.removeItem(this.getKeyName(n)),this.notifyChanges(n)}observe$(n){return Dt.hasSubscribed||(Dt.addStorageEventListener(),Dt.hasSubscribed=!0),this.observable.filter(({key:o})=>o===n)}handleStorageChange(n){if(!(n!=null&&n.startsWith(this.namespace)))return;const o=n==null?void 0:n.slice(`${this.namespace}/`.length);o.includes("/")||this.notifyChanges(decodeURIComponent(o))}getKeyName(n){return`${this.namespace}/${encodeURIComponent(n)}`}notifyChanges(n){const o=this.snapshot(n);for(const l of this.subscribers)l.next(o)}constructor(n,o){this.namespace=n,this.errorApi=o,this.subscribers=new Set,this.observable=new(ne())(l=>(this.subscribers.add(l),()=>{this.subscribers.delete(l)}))}}Dt.hasSubscribed=!1;const Nt=(0,W.createContext)(void 0);function rn(){const[i]=(0,g.is)((0,r.jsx)(g.AW,{index:!0,element:(0,r.jsx)("div",{})}));return!i.index}var Bn=t(16060);const Xn=(i,n)=>{try{var o,l;const f=(0,Bn.fp)(n,{pathname:i}),L=(o=f==null?void 0:f.filter(H=>{var se;return((se=H==null?void 0:H.route.routeRefs)===null||se===void 0?void 0:se.size)>0}).pop())===null||o===void 0?void 0:o.route;if(!L)return{};let Z;return L.routeRefs.size===1&&(Z=L.routeRefs.values().next().value),{extension:"App",pluginId:((l=L.plugin)===null||l===void 0?void 0:l.getId())||"root",...Z?{routeRef:Z.id}:{}}}catch{return{}}},Cn=({pathname:i,search:n,hash:o})=>{const l=(0,b.z$)();return(0,W.useEffect)(()=>{l.captureEvent("navigate",`${i}${n}${o}`)},[l,i,n,o]),null},wn=({routeObjects:i})=>{const{pathname:n,search:o,hash:l}=(0,g.TH)();return(0,r.jsx)(b.fC,{attributes:Xn(n,i),children:(0,r.jsx)(Cn,{pathname:n,search:o,hash:l})})};function Yn(i){return rn()?fn(i):""}function fn(i){var n;let{pathname:o}=new URL((n=i.getOptionalString("app.baseUrl"))!==null&&n!==void 0?n:"/","http://sample.dev");return o=o.replace(/\/*$/,""),o}function Rn({component:i,appIdentityProxy:n,children:o}){const[l,f]=(0,W.useState)(),L=(0,b.h_)(b.Ds),Z=Yn(L);return l?(n.setTarget(l,{signOutTargetUrl:Z||"/"}),(0,r.jsx)(r.Fragment,{children:o})):(0,r.jsx)(i,{onSignInSuccess:f})}function dr(i){const{Router:n,SignInPage:o}=(0,b.qD)().getComponents(),l=(0,b.h_)(b.Ds),f=fn(l),L=`${f}/*`,Z=(0,W.useContext)(Nt);if(!Z)throw new Error("AppRouter must be rendered within the AppProvider");const{routeObjects:H,appIdentityProxy:se}=Z;return o?rn()?(0,r.jsxs)(n,{children:[(0,r.jsx)(wn,{routeObjects:H}),(0,r.jsx)(Rn,{component:o,appIdentityProxy:se,children:(0,r.jsx)(g.Z5,{children:(0,r.jsx)(g.AW,{path:L,element:(0,r.jsx)(r.Fragment,{children:i.children})})})})]}):(0,r.jsxs)(n,{basename:f,children:[(0,r.jsx)(wn,{routeObjects:H}),(0,r.jsx)(Rn,{component:o,appIdentityProxy:se,children:i.children})]}):(se.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:f||"/"}),rn()?(0,r.jsxs)(n,{children:[(0,r.jsx)(wn,{routeObjects:H}),(0,r.jsx)(g.Z5,{children:(0,r.jsx)(g.AW,{path:L,element:(0,r.jsx)(r.Fragment,{children:i.children})})})]}):(0,r.jsxs)(n,{basename:f,children:[(0,r.jsx)(wn,{routeObjects:H}),i.children]}))}var w=t(90383),u=t(22504),x=t(69866),E=t(64279);function q(i){const n={};for(const l in i.collectors)i.collectors.hasOwnProperty(l)&&(n[l]=i.collectors[l]());const o=[{node:W.Children.toArray(i.root),parent:void 0,contexts:{}}];for(;o.length!==0;){const{node:l,parent:f,contexts:L}=o.shift();W.Children.forEach(l,Z=>{if(!(0,W.isValidElement)(Z))return;const H={};for(const se in n)if(n.hasOwnProperty(se)){const He=n[se];H[se]=He.visit(He.accumulator,Z,f,L[se])}for(const se of i.discoverers){const He=se(Z);He&&o.push({node:He,parent:Z,contexts:H})}})}return Object.fromEntries(Object.entries(n).map(([l,f])=>[l,f.accumulator]))}function ve(i,n){return()=>({accumulator:i(),visit:n})}function ye(i){var n;return(n=i.props)===null||n===void 0?void 0:n.children}function Ne(i){var n,o;if(((n=i.props)===null||n===void 0?void 0:n.path)&&((o=i.props)===null||o===void 0?void 0:o.element)){var l;return(l=i.props)===null||l===void 0?void 0:l.element}}const Je=ve(()=>new Set,(i,n)=>{const o=(0,b.IY)(n,"core.plugin");o&&i.add(o)}),Ft=i=>{const{children:n}=i,o=(0,b.h_)(b.W0),l="with"in i?o.isActive(i.with):!o.isActive(i.without);return(0,r.jsx)(r.Fragment,{children:l?n:null})};(0,b.R5)(Ft,"core.featureFlagged",!0);const Ht={caseSensitive:!1,path:"*",element:"match-all",routeRefs:new Set};function $n(i){const n=i;if(n!=null&&n.type){var o,l;return(l=(o=n.type.displayName)!==null&&o!==void 0?o:n.type.name)!==null&&l!==void 0?l:String(n.type)}return String(n)}function ur(i,n=new Array){return W.Children.forEach(i,o=>{if(!(0,W.isValidElement)(o))return;const l=(0,b.IY)(o,"core.mountPoint");if(l){const f=(0,b.IY)(o,"core.plugin");n.push({routeRef:l,plugin:f})}ur(o.props.children,n)}),n}const hs=ve(()=>({paths:new Map,parents:new Map,objects:new Array}),(i,n,o,l)=>{var f,L;if(l!=null&&l.isElementAncestor)return l;if((o==null?void 0:o.props.element)===n)return{...l,isElementAncestor:!0};const Z=(f=n.props)===null||f===void 0?void 0:f.path,H=(0,b.IY)(n,"core.mountPoint");if(H&&Z)throw new Error(`Path property may not be set directly on a routable extension "${$n(n)}"`);var se;const He=(se=l==null||(L=l.obj)===null||L===void 0?void 0:L.children)!==null&&se!==void 0?se:i.objects;if(Z!==void 0){if(typeof Z!="string")throw new Error(`Element path must be a string at "${$n(n)}"`);const Ct=Z.startsWith("/")?Z.slice(1):Z,St=n.props.element;if((0,b.IY)(n,"core.gatherMountPoints")){var De;if(St)throw new Error(`Mount point gatherers may not have an element prop "${$n(n)}"`);const $t={path:Ct,element:"gathered",routeRefs:new Set,caseSensitive:Boolean((De=n.props)===null||De===void 0?void 0:De.caseSensitive),children:[Ht],plugin:void 0};return He.push($t),{obj:$t,gatherPath:Ct,routeRef:l==null?void 0:l.routeRef,gatherRouteRef:l==null?void 0:l.routeRef}}if(St){var ct;const[$t,...Et]=ur(St);if(Et.length>0)throw new Error(`Route element with path "${Z}" may not contain multiple routable extensions`);if(!$t)return l;const{routeRef:Tn,plugin:Kn}=$t,nr={path:Ct,element:"mounted",routeRefs:new Set([Tn]),caseSensitive:Boolean((ct=n.props)===null||ct===void 0?void 0:ct.caseSensitive),children:[Ht],plugin:Kn};return He.push(nr),i.paths.set(Tn,Ct),i.parents.set(Tn,l==null?void 0:l.routeRef),{obj:nr,routeRef:Tn!=null?Tn:l==null?void 0:l.routeRef,gatherPath:Ct,gatherRouteRef:l==null?void 0:l.gatherRouteRef}}}if(H){var st;if((l==null?void 0:l.gatherPath)===void 0)throw new Error(`Routable extension "${$n(n)}" with mount point "${H}" must be assigned a path`);return l==null||(st=l.obj)===null||st===void 0||st.routeRefs.add(H),i.paths.set(H,l.gatherPath),i.parents.set(H,l==null?void 0:l.gatherRouteRef),{...l,routeRef:H}}return l}),ps=ve(()=>({paths:new Map,parents:new Map,objects:new Array}),(i,n,o,l)=>{var f,L,Z;if((o==null?void 0:o.props.element)===n)return l;let H=l==null?void 0:l.obj,se=l==null?void 0:l.routeRef,He=l==null?void 0:l.sticky;const De=(f=n.props)===null||f===void 0?void 0:f.path;var ct;const st=(ct=H==null?void 0:H.children)!==null&&ct!==void 0?ct:i.objects,Ct=Boolean((L=n.props)===null||L===void 0?void 0:L.caseSensitive);let St=l==null?void 0:l.path;if((0,b.IY)(n,"core.gatherMountPoints")){if(!De)throw new Error("Mount point gatherer must have a path");St=De}const $t=(Z=n.props)===null||Z===void 0?void 0:Z.element;let Et=(0,b.IY)(n,"core.mountPoint");if(!Et&&(0,W.isValidElement)($t)&&(Et=(0,b.IY)($t,"core.mountPoint")),Et){let nr=De;if(St&&(nr?St=void 0:nr=St),!nr)throw new Error("Mounted routable extension must have a path");i.paths.set(Et,nr),se&&He?(i.parents.set(Et,se),De&&(se=Et,He=!1)):(i.parents.set(Et,se),se=Et),De?(H={caseSensitive:Ct,path:De,element:"mounted",routeRefs:new Set([Et]),children:[Ht],plugin:(0,b.IY)(n.props.element,"core.plugin")},st.push(H)):H==null||H.routeRefs.add(Et)}if((0,b.IY)(n,"core.gatherMountPoints")&&(He=!0),(0,b.IY)(n,"core.gatherMountPoints")){if(!De)throw new Error("Mount point gatherer must have a path");if(!Et){var Kn;H={caseSensitive:Ct,path:De,element:"gathered",routeRefs:new Set,children:[Ht],plugin:l==null||(Kn=l.obj)===null||Kn===void 0?void 0:Kn.plugin},st.push(H)}}return{obj:H,path:St,routeRef:se,sticky:He}}),Rr=ve(()=>new Set,(i,n)=>{if(n.type===Ft){const o=n.props;i.add("with"in o?o.with:o.without)}}),hr=(0,Ge.uW)("route-ref-type",()=>Symbol("route-ref-type"));function Lr(i){return i[hr]==="absolute"}function Vr(i){return i[hr]==="sub"}function Pr(i){return i[hr]==="external"}function Jn(...i){const n=i.join("/").replace(/\/\/+/g,"/");return n!=="/"&&n.endsWith("/")?n.slice(0,-1):n}function qn(i,n,o){let l,f="";if(Lr(i))l=i;else if(Vr(i))l=i.parent,f=i.path;else if(Pr(i)){const H=o.get(i);if(!H)return[void 0,""];if(Lr(H))l=H;else if(Vr(H))l=H.parent,f=H.path;else throw new Error(`ExternalRouteRef was bound to invalid target, ${H}`)}else throw i[hr]?new Error(`Unknown or invalid route ref type, ${i[hr]}`):new Error(`Unknown object passed to useRouteRef, got ${i}`);if(!l)return[void 0,""];const L=n.get(l);if(L===void 0)return[void 0,""];const Z=Jn(L,f);return[l,Z]}function pr(i,n,o,l,f){var L;const Z=(L=(0,Bn.fp)(f,n))!==null&&L!==void 0?L:[],H=Array();let se=-1;for(let ct=i;ct&&(se=Z.findIndex(st=>st.route.routeRefs.has(ct)),se===-1);ct=l.get(ct))H.unshift(ct);H.length===0&&(se-=1);const He=se===-1?"":Z[se].pathname,De=H.slice(0,-1).map(ct=>{const st=o.get(ct);if(st===void 0)throw new Error(`No path for ${ct}`);if(st.includes(":"))throw new Error(`Cannot route to ${i} with parent ${ct} as it has parameters`);return st});return`${Jn(He,...De)}/`}class kr{resolve(n,o){const[l,f]=qn(n,this.routePaths,this.routeBindings);if(!l)return;let L;typeof o=="string"?L=this.trimPath(o):o.pathname?L={...o,pathname:this.trimPath(o.pathname)}:L=o;const Z=this.appBasePath+pr(l,L,this.routePaths,this.routeParents,this.routeObjects);return(...[se])=>Jn(Z,(0,Bn.Gn)(f,se))}trimPath(n){return n&&(n.startsWith(this.appBasePath)?n.slice(this.appBasePath.length):n)}constructor(n,o,l,f,L){this.routePaths=n,this.routeParents=o,this.routeObjects=l,this.routeBindings=f,this.appBasePath=L}}const Hr=(0,Ge.CT)("routing-context"),Us=({routePaths:i,routeParents:n,routeObjects:o,routeBindings:l,basePath:f="",children:L})=>{const Z=new kr(i,n,o,l,f),H=(0,Ge.EI)({1:Z});return(0,r.jsx)(Hr.Provider,{value:H,children:L})};function Or(i,n){const o=new Set(n.values());o.delete(void 0);for(const l of n.keys()){if(o.has(l))continue;let f=l,L="";for(;f;){const H=i.get(f);if(H===void 0)throw new Error(`No path for ${f}`);L=Jn(H,L),f=n.get(f)}const Z=L.match(/:(\w+)/g);if(Z){for(let H=0;H<Z.length;H++)for(let se=H+1;se<Z.length;se++)if(Z[se]===Z[H])throw new Error(`Parameter ${Z[se]} is duplicated in path ${L}`)}}}function fs(i,n){for(const o of n)if(!!o.externalRoutes){for(const[l,f]of Object.entries(o.externalRoutes))if(!f.optional&&!i.has(f))throw new Error(`External route '${l}' of the '${o.getId()}' plugin must be bound to a target route. See https://backstage.io/link?bind-routes for details.`)}}const gs=(0,Ge.CT)("app-context"),Cr=({appContext:i,children:n})=>{const o=(0,Ge.EI)({1:i});return(0,r.jsx)(gs.Provider,{value:o,children:n})};function gn(i){return new Error(`Tried to access IdentityApi ${i} before app was loaded`)}function or(i){console.warn(`WARNING: Call to ${i} is deprecated and will break in the future`)}class Br{setTarget(n,o){this.target=n,this.signOutTargetUrl=o.signOutTargetUrl,this.resolveTarget(n)}getUserId(){if(!this.target)throw gn("getUserId");if(!this.target.getUserId)throw new Error("IdentityApi does not implement getUserId");return or("getUserId"),this.target.getUserId()}getProfile(){if(!this.target)throw gn("getProfile");if(!this.target.getProfile)throw new Error("IdentityApi does not implement getProfile");return or("getProfile"),this.target.getProfile()}async getProfileInfo(){return this.waitForTarget.then(n=>n.getProfileInfo())}async getBackstageIdentity(){const n=await this.waitForTarget.then(o=>o.getBackstageIdentity());return n.userEntityRef.match(/^.*:.*\/.*$/)||console.warn(`WARNING: The App IdentityApi provided an invalid userEntityRef, '${n.userEntityRef}'. It must be a full Entity Reference of the form '<kind>:<namespace>/<name>'.`),n}async getCredentials(){return this.waitForTarget.then(n=>n.getCredentials())}async getIdToken(){return this.waitForTarget.then(n=>{if(!n.getIdToken)throw new Error("IdentityApi does not implement getIdToken");return or("getIdToken"),n.getIdToken()})}async signOut(){await this.waitForTarget.then(n=>n.signOut()),window.location.href=this.signOutTargetUrl}constructor(){this.resolveTarget=()=>{},this.signOutTargetUrl="/",this.waitForTarget=new Promise(n=>{this.resolveTarget=n})}}var ms=t(72164);function $r(i,n,o){if(i!==void 0){const f=o.find(L=>L.id===i);if(f)return f}if(n){const f=o.find(L=>L.variant==="dark");if(f)return f}const l=o.find(f=>f.variant==="light");return l||o[0]}const vs=()=>{const i=(0,W.useMemo)(()=>window.matchMedia("(prefers-color-scheme: dark)"),[]),[n,o]=(0,W.useState)(i.matches);return(0,W.useEffect)(()=>{const l=f=>{o(f.matches)};return i.addListener(l),()=>{i.removeListener(l)}},[i]),n};function ys({children:i}){const n=(0,b.h_)(b.hg),o=(0,ms.Z)(n.activeThemeId$(),n.getActiveThemeId()),l=Boolean(window.matchMedia)?vs():!1,f=$r(o,l,n.getInstalledThemes());if(!f)throw new Error("App has no themes");return(0,r.jsx)(f.Provider,{children:i})}const Gr=async(i="__APP_INJECTED_RUNTIME_CONFIG__")=>{const n=[{context:"app-config.yaml",data:{app:{title:"Techdocs Preview App",baseUrl:"http://localhost:3000"},backend:{baseUrl:"http://localhost:3000"},techdocs:{builder:"external"}}}];if(!n)throw new Error("No static configuration provided");if(!Array.isArray(n))throw new Error("Static configuration has invalid format");const o=n.slice();if(i!=="__app_injected_runtime_config__".toLocaleUpperCase("en-US"))try{const f=JSON.parse(i);Array.isArray(f)?o.push(...f):o.push({data:f,context:"env"})}catch(f){throw new Error(`Failed to load runtime configuration, ${f}`)}const l=window.__APP_CONFIG__;return l&&o.push({context:"window",data:l}),o};class Kr{add(n,o){return this.apis.push([n.id,o]),o}build(){return new ir(new Map(this.apis))}constructor(){this.apis=[]}}class ir{static builder(){return new Kr}static from(n){return new ir(new Map(n.map(([o,l])=>[o.id,l])))}static with(n,o){return new ir(new Map([[n.id,o]]))}with(n,o){return new ir(new Map([...this.apis,[n.id,o]]))}get(n){return this.apis.get(n.id)}constructor(n){this.apis=n}}function xs(i){const n=new Map;return i&&i({bind:(l,f)=>{for(const[L,Z]of Object.entries(f)){const H=l[L];if(!H)throw new Error(`Key ${L} is not an existing external route`);if(!Z&&!H.optional)throw new Error(`External route ${L} is required but was undefined`);Z&&n.set(H,Z)}}}),n}function Yr(i,n,o){var l;const f=Boolean(i),L=(0,E.default)(i||(()=>Promise.resolve([])));let Z;if(f&&L.loading){const{Progress:He}=n;Z=(0,r.jsx)(He,{})}else if(L.error){const{BootErrorPage:He}=n;Z=(0,r.jsx)(He,{step:"load-config",error:L.error})}const{ThemeProvider:H=ys}=n;if(Z)return{node:(0,r.jsx)(Ee,{apis:ir.with(b.hg,o),children:(0,r.jsx)(H,{children:Z})})};let se;if(!((l=L.value)===null||l===void 0)&&l.length){const He=We.fromConfigs(L.value),De=Et=>new URL(Et).origin,ct=Et=>new URL(Et.replace(De(Et),""),document.location.origin).href.replace(/\/$/,""),st=He.getOptionalString("app.baseUrl"),Ct=He.getOptionalString("backend.baseUrl");let St=L.value;const $t={data:{},context:"relative-resolver"};if(st&&Ct){const Et=De(st),Tn=De(Ct);if(Et===Tn){const Kn=ct(Ct);Ct!==Kn&&($t.data.backend={baseUrl:Kn})}}if(st){const Et=ct(st);st!==Et&&($t.data.app={baseUrl:Et})}Object.keys($t.data).length&&(St=St.concat([$t])),se=We.fromConfigs(St)}else se=We.fromConfigs([]);return{api:se}}class bs{getPlugins(){return this.app.getPlugins()}getSystemIcon(n){return this.app.getSystemIcon(n)}getSystemIcons(){return this.app.getSystemIcons()}getComponents(){return this.app.getComponents()}constructor(n){this.app=n}}var Zr=new WeakMap;class Ss{getPlugins(){return Array.from(this.plugins)}getSystemIcon(n){return this.icons[n]}getSystemIcons(){return this.icons}getComponents(){return this.components}createRoot(n){const o=this.getProvider();return()=>(0,r.jsx)(o,{children:n})}getProvider(){if((0,w.Z)(this,Zr))throw new Error("app.getProvider() or app.createRoot() has already been called, and can only be called once");(0,x.Z)(this,Zr,!0);const n=new bs(this);let o=!1;return({children:f})=>{const L=(0,W.useRef)(!0),Z=(0,W.useMemo)(()=>de.createWithStorage(this.themes),[]),{routing:H,featureFlags:se,routeBindings:He}=(0,W.useMemo)(()=>{const Ct=q({root:f,discoverers:[ye,Ne],collectors:{routing:rn()?ps:hs,collectedPlugins:Je,featureFlags:Rr}});return Ct.collectedPlugins.forEach(St=>this.plugins.add(St)),this.verifyPlugins(this.plugins),this.getApiHolder(),{...Ct,routeBindings:xs(this.bindRoutes)}},[f]);o||(o=!0,Or(H.paths,H.parents),fs(He,this.plugins));const De=Yr(this.configLoader,this.components,Z),ct="api"in De;if(ct){const{api:Ct}=De;this.configApi=Ct}if("node"in De)return De.node;if(ct&&L.current){L.current=!1;const Ct=this.getApiHolder().get(b.W0);if(Ct){for(const Et of this.featureFlags)Ct.registerFlag({...Et,pluginId:""});for(const Et of this.plugins.values())if("getFeatureFlags"in Et)for(const Tn of Et.getFeatureFlags())Ct.registerFlag({name:Tn.name,pluginId:Et.getId()});else for(const Tn of Et.output())Tn.type==="feature-flag"&&Ct.registerFlag({name:Tn.name,pluginId:Et.getId()});const St=Ct.getRegisteredFlags(),$t=new Set(St.map(Et=>Et.name));for(const Et of se)$t.has(Et)||Ct.registerFlag({name:Et,pluginId:""})}}const{ThemeProvider:st=ys}=this.components;return(0,r.jsx)(Ee,{apis:this.getApiHolder(),children:(0,r.jsx)(Cr,{appContext:n,children:(0,r.jsx)(st,{children:(0,r.jsx)(Us,{routePaths:H.paths,routeParents:H.parents,routeObjects:H.objects,routeBindings:He,basePath:Yn(De.api),children:(0,r.jsx)(Nt.Provider,{value:{routeObjects:H.objects,appIdentityProxy:this.appIdentityProxy},children:f})})})})})}}getRouter(){return dr}getApiHolder(){if(this.apiHolder){for(const n of this.plugins)for(const o of n.getApis())this.apiFactoryRegistry.get(o.api)||this.apiFactoryRegistry.register("default",o);return Ke.validateFactories(this.apiFactoryRegistry,this.apiFactoryRegistry.getAllApis()),this.apiHolder}this.apiFactoryRegistry.register("static",{api:b.hg,deps:{},factory:()=>de.createWithStorage(this.themes)}),this.apiFactoryRegistry.register("static",{api:b.Ds,deps:{},factory:()=>{if(!this.configApi)throw new Error("Tried to access config API before config was loaded");return this.configApi}}),this.apiFactoryRegistry.register("static",{api:b.$4,deps:{},factory:()=>this.appIdentityProxy}),this.apiFactoryRegistry.register("default",{api:b.W0,deps:{},factory:()=>new Oe});for(const n of this.defaultApis)this.apiFactoryRegistry.register("default",n);for(const n of this.plugins)for(const o of n.getApis())if(!this.apiFactoryRegistry.register("default",o))throw new Error(`Plugin ${n.getId()} tried to register duplicate or forbidden API factory for ${o.api}`);for(const n of this.apis)if(!this.apiFactoryRegistry.register("app",n))throw new Error(`Duplicate or forbidden API factory for ${n.api} in app`);return Ke.validateFactories(this.apiFactoryRegistry,this.apiFactoryRegistry.getAllApis()),this.apiHolder=new Ke(this.apiFactoryRegistry),this.apiHolder}verifyPlugins(n){const o=new Set;for(const l of n){const f=l.getId();if(o.has(f))throw new Error(`Duplicate plugin found '${f}'`);o.add(f)}}constructor(n){this.appIdentityProxy=new Br,(0,u.Z)(this,Zr,{writable:!0,value:!1});var o;this.apis=(o=n.apis)!==null&&o!==void 0?o:[],this.icons=n.icons;var l;this.plugins=new Set((l=n.plugins)!==null&&l!==void 0?l:[]);var f;this.featureFlags=(f=n.featureFlags)!==null&&f!==void 0?f:[],this.components=n.components,this.themes=n.themes;var L;this.configLoader=(L=n.configLoader)!==null&&L!==void 0?L:Gr;var Z;this.defaultApis=(Z=n.defaultApis)!==null&&Z!==void 0?Z:[],this.bindRoutes=n.bindRoutes,this.apiFactoryRegistry=new mt}}function Cs(i){return new Ss(i)}let Jr=!1;const Qr=i=>{const n=(0,b.qD)(),{NotFoundErrorPage:o}=n.getComponents(),l=(0,W.useMemo)(()=>rn(),[]),L=[...(0,b.vJ)(i.children,Z=>Z.getElements().flatMap(H=>{let se=H.props.path;if(se==="")return[];var He;se=(He=se==null?void 0:se.replace(/\/\*$/,""))!==null&&He!==void 0?He:"/";let De=l?H:H.props.element;return!l&&!De&&(De=H,Jr||(console.warn("DEPRECATION WARNING: All elements within <FlatRoutes> must be of type <Route> with an element prop. Existing usages of <Navigate key=[path] to=[to] /> should be replaced with <Route path=[path] element={<Navigate to=[to] />} />."),Jr=!0)),[{path:se,element:De,children:H.props.children?[{path:se==="/"?"/":"*",element:H.props.children}]:void 0}]}).sort((H,se)=>se.path.localeCompare(H.path)).map(H=>({...H,path:H.path==="/"?"/":`${H.path}/*`}))),{path:"*",element:(0,r.jsx)(o,{})}];return(0,g.V$)(L)};var Xr=t(25488);const Dr=[(0,b.ni)({api:b.NW,deps:{configApi:b.Ds},factory:({configApi:i})=>S.compile(`${i.getString("backend.baseUrl")}/api/{{ pluginId }}`)}),(0,b.ni)({api:b.$v,deps:{},factory:()=>new wt}),(0,b.ni)({api:b.v_,deps:{},factory:()=>new ae}),(0,b.ni)({api:b.VE,deps:{alertApi:b.$v},factory:({alertApi:i})=>{const n=new G(i,new me);return he.forward(n,{hidden:!1}),n}}),(0,b.ni)({api:b.E6,deps:{errorApi:b.VE},factory:({errorApi:i})=>Dt.create({errorApi:i})}),(0,b.ni)({api:b.gP,deps:{configApi:b.Ds,identityApi:b.$4,discoveryApi:b.NW},factory:({configApi:i,identityApi:n,discoveryApi:o})=>Me({middleware:[Bt.resolvePluginProtocol({discoveryApi:o}),Bt.injectIdentityAuth({identityApi:n,config:i})]})}),(0,b.ni)({api:b.ZM,deps:{},factory:()=>new Wn}),(0,b.ni)({api:b.Kp,deps:{discoveryApi:b.NW,oauthRequestApi:b.ZM,configApi:b.Ds},factory:({discoveryApi:i,oauthRequestApi:n,configApi:o})=>Fn.create({discoveryApi:i,oauthRequestApi:n,environment:o.getOptionalString("auth.environment")})}),(0,b.ni)({api:b.p_,deps:{discoveryApi:b.NW,oauthRequestApi:b.ZM,configApi:b.Ds},factory:({discoveryApi:i,oauthRequestApi:n,configApi:o})=>xn.create({discoveryApi:i,oauthRequestApi:n,environment:o.getOptionalString("auth.environment")})}),(0,b.ni)({api:b.F4,deps:{discoveryApi:b.NW,oauthRequestApi:b.ZM,configApi:b.Ds},factory:({discoveryApi:i,oauthRequestApi:n,configApi:o})=>Wt.create({discoveryApi:i,oauthRequestApi:n,defaultScopes:["read:user"],environment:o.getOptionalString("auth.environment")})}),(0,b.ni)({api:b.D,deps:{discoveryApi:b.NW,oauthRequestApi:b.ZM,configApi:b.Ds},factory:({discoveryApi:i,oauthRequestApi:n,configApi:o})=>hn.create({discoveryApi:i,oauthRequestApi:n,environment:o.getOptionalString("auth.environment")})}),(0,b.ni)({api:b.ux,deps:{discoveryApi:b.NW,oauthRequestApi:b.ZM,configApi:b.Ds},factory:({discoveryApi:i,oauthRequestApi:n,configApi:o})=>Qt.create({discoveryApi:i,oauthRequestApi:n,environment:o.getOptionalString("auth.environment")})}),(0,b.ni)({api:b.gW,deps:{discoveryApi:b.NW,oauthRequestApi:b.ZM,configApi:b.Ds},factory:({discoveryApi:i,oauthRequestApi:n,configApi:o})=>ge.create({discoveryApi:i,oauthRequestApi:n,environment:o.getOptionalString("auth.environment")})}),(0,b.ni)({api:b.bq,deps:{discoveryApi:b.NW,oauthRequestApi:b.ZM,configApi:b.Ds},factory:({discoveryApi:i,oauthRequestApi:n,configApi:o})=>Re.create({discoveryApi:i,oauthRequestApi:n,defaultScopes:["team"],environment:o.getOptionalString("auth.environment")})}),(0,b.ni)({api:b.uB,deps:{discoveryApi:b.NW,oauthRequestApi:b.ZM,configApi:b.Ds},factory:({discoveryApi:i,oauthRequestApi:n,configApi:o})=>et.create({discoveryApi:i,oauthRequestApi:n,environment:o.getOptionalString("auth.environment")})}),(0,b.ni)({api:Xr.RV,deps:{discovery:b.NW,identity:b.$4,config:b.Ds},factory:({config:i,discovery:n,identity:o})=>Xr.iM.create({config:i,discovery:n,identity:o})})];var on=t(77277),Ut=t(93414),ws=t(39857);function js({children:i}){return(0,g.GV)()?(0,r.jsx)(r.Fragment,{children:i}):(0,r.jsx)(g.VA,{children:i})}const Es=()=>(0,r.jsx)(Ut.mf,{status:"404",statusMessage:"PAGE NOT FOUND"}),qr=({step:i,error:n})=>{let o="";return i==="load-config"?o=`The configuration failed to load, someone should have a look at this error: ${n.message}`:i==="load-chunk"&&(o=`Lazy loaded chunk failed to load, try to reload the page: ${n.message}`),(0,r.jsx)(js,{children:(0,r.jsx)(Ut.mf,{status:"501",statusMessage:o})})},As=({error:i,resetError:n,plugin:o})=>(0,r.jsx)(Ut.yu,{title:`Error in ${o==null?void 0:o.getId()}`,defaultExpanded:!0,error:i,children:(0,r.jsx)(on.Z,{variant:"outlined",onClick:n,children:"Retry"})}),Ts={Progress:Ut.Ex,Router:ws.VK,NotFoundErrorPage:Es,BootErrorPage:qr,ErrorBoundaryFallback:As};var _r=t(43642),wr=t(80079),Ms=t(90941),Is=t(32915),es=t(40562),Rs=t(21853),zs=t(60744),Ls=t(66569),Ws=t(30254),Vs=t(13384),Ps=t(15933),Hs=t(58838),m=t(86737),y=t(4989),I=t(44407),B=t(18628),Q=t(84219),J=t(98685),re=t(39781);const le={brokenImage:wr.Z,catalog:B.Z,scaffolder:Is.Z,techdocs:es.Z,search:Rs.Z,chat:zs.Z,dashboard:Ls.Z,docs:Ws.Z,email:Vs.Z,github:Hs.Z,group:Q.Z,help:m.Z,"kind:api":Ps.Z,"kind:component":I.Z,"kind:domain":_r.Z,"kind:group":Q.Z,"kind:location":y.Z,"kind:system":Ms.Z,"kind:user":J.Z,user:J.Z,warning:re.Z};var Se=t(73689),Ie=t(48032);const je={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")`},we={darkGrey:["#171717","#383838"],marineBlue:["#006D8F","#0049A1"],veryBlue:["#0027AF","#270094"],rubyRed:["#98002B","#8D1134"],toastyOrange:["#BE2200","#A41D00"],purpleSky:["#8912CA","#3E00EA"],eveningSea:["#00FFF2","#035355"],teal:["#005B4B"],pinkSea:["#C8077A","#C2297D"],greens:["#4BB8A5","#187656"]};function Ve(i){const{colors:n,shape:o,options:l}=i,L=`linear-gradient(90deg, ${(n.length===1?[n[0],n[0]]:n).join(", ")})`,Z=`${o}, ${L}`;var H;const se=(H=l==null?void 0:l.fontColor)!==null&&H!==void 0?H:"#FFFFFF";return{colors:n,shape:o,backgroundImage:Z,fontColor:se}}const ht={home:Ve({colors:we.teal,shape:je.wave}),documentation:Ve({colors:we.pinkSea,shape:je.wave2}),tool:Ve({colors:we.purpleSky,shape:je.round}),service:Ve({colors:we.marineBlue,shape:je.wave}),website:Ve({colors:we.veryBlue,shape:je.wave}),library:Ve({colors:we.rubyRed,shape:je.wave}),other:Ve({colors:we.darkGrey,shape:je.wave}),app:Ve({colors:we.toastyOrange,shape:je.wave}),apis:Ve({colors:we.teal,shape:je.wave2}),card:Ve({colors:we.greens,shape:je.wave})},xt=16,Ze='"Helvetica Neue", Helvetica, Roboto, Arial, sans-serif';function Rt(i){const{palette:n,htmlFontSize:o=xt,fontFamily:l=Ze,defaultPageTheme:f,pageTheme:L=ht}=i;if(!L[f])throw new Error(`${f} is not defined in pageTheme.`);var Z;return{palette:n,props:{MuiGrid:{spacing:2},MuiSwitch:{color:"primary"}},typography:{htmlFontSize:o,fontFamily:l,h6:{fontWeight:700,fontSize:20,marginBottom:2},h5:{fontWeight:700,fontSize:24,marginBottom:4},h4:{fontWeight:700,fontSize:28,marginBottom:6},h3:{fontSize:32,fontWeight:700,marginBottom:6},h2:{fontSize:40,fontWeight:700,marginBottom:8},h1:{fontSize:54,fontWeight:700,marginBottom:10}},page:L[f],getPageTheme:({themeId:H})=>(Z=L[H])!==null&&Z!==void 0?Z:L[f]}}function Gt(i){return{MuiCssBaseline:{"@global":{html:{height:"100%",fontFamily:i.typography.fontFamily},body:{height:"100%",fontFamily:i.typography.fontFamily,"overscroll-behavior-y":"none"},a:{color:"inherit",textDecoration:"none"}}},MuiTableRow:{root:{"&:nth-of-type(odd)":{backgroundColor:i.palette.background.default}},hover:{"&:hover":{cursor:"pointer"}},head:{"&:nth-of-type(odd)":{backgroundColor:i.palette.background.paper}}},MuiTableCell:{root:{wordBreak:"break-word",overflow:"hidden",verticalAlign:"middle",lineHeight:"1",margin:0,padding:i.spacing(3,2,3,2.5),borderBottom:0},sizeSmall:{padding:i.spacing(1.5,2,1.5,2.5)},head:{wordBreak:"break-word",overflow:"hidden",color:"rgb(179, 179, 179)",fontWeight:"normal",lineHeight:"1"}},MuiTabs:{root:{minHeight:24}},MuiTab:{root:{color:i.palette.link,minHeight:24,textTransform:"initial",letterSpacing:"0.07em","&:hover":{color:(0,Ie.darken)(i.palette.link,.3),background:(0,Ie.lighten)(i.palette.link,.95)},[i.breakpoints.up("md")]:{minWidth:120,fontSize:i.typography.pxToRem(14),fontWeight:500}},textColorPrimary:{color:i.palette.link}},MuiTableSortLabel:{root:{color:"inherit","&:hover":{color:"inherit"},"&: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:i.spacing(1),marginBottom:i.spacing(1),color:i.palette.grey[900]},outlined:{color:i.palette.text.primary},label:{lineHeight:`${i.spacing(2.5)}px`,fontWeight:i.typography.fontWeightMedium,fontSize:`${i.spacing(1.75)}px`},labelSmall:{fontSize:`${i.spacing(1.5)}px`},deleteIcon:{color:i.palette.grey[500],width:`${i.spacing(3)}px`,height:`${i.spacing(3)}px`,margin:`0 ${i.spacing(.75)}px 0 -${i.spacing(.75)}px`},deleteIconSmall:{width:`${i.spacing(2)}px`,height:`${i.spacing(2)}px`,margin:`0 ${i.spacing(.5)}px 0 -${i.spacing(.5)}px`}},MuiCard:{root:{display:"flex",flexDirection:"column"}},MuiCardHeader:{root:{paddingBottom:0}},MuiCardContent:{root:{flexGrow:1,"&:last-child":{paddingBottom:void 0}}},MuiCardActions:{root:{justifyContent:"flex-end"}}}}function Ln(i){const n=Rt(i),o=(0,Se.Z)(n),l=Gt(o);return{...o,overrides:l}}var jn=t(34505);const ar=Ln({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:jn.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:ht}),En=Ln({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:jn.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:ht});var Zn=t(98192),Vn=t(15222),jr=t(41547),fr=t(87561);const ts=[{id:"light",title:"Light Theme",variant:"light",icon:(0,r.jsx)(Vn.Z,{}),Provider:({children:i})=>(0,r.jsx)(jr.Z,{theme:ar,children:(0,r.jsx)(fr.ZP,{children:i})})},{id:"dark",title:"Dark Theme",variant:"dark",icon:(0,r.jsx)(Zn.Z,{}),Provider:({children:i})=>(0,r.jsx)(jr.Z,{theme:En,children:(0,r.jsx)(fr.ZP,{children:i})})}];function sn(i){var n,o,l,f;return Cs({...i,apis:(n=i==null?void 0:i.apis)!==null&&n!==void 0?n:[],bindRoutes:i==null?void 0:i.bindRoutes,components:{...Ts,...i==null?void 0:i.components},configLoader:i==null?void 0:i.configLoader,defaultApis:Dr,icons:{...le,...i==null?void 0:i.icons},plugins:(o=i==null?void 0:i.plugins)!==null&&o!==void 0?o:[],featureFlags:(l=i==null?void 0:i.featureFlags)!==null&&l!==void 0?l:[],themes:(f=i==null?void 0:i.themes)!==null&&f!==void 0?f:ts})}var Pn=t(25271),gr=t(76635);async function di({storageApi:i}){const n=i.forBucket("settings"),o=i.forBucket("starredEntities"),l=n.snapshot("starredEntities").value;if(!(0,gr.isArray)(l))return;var f;const L=new Set((f=o.snapshot("entityRefs").value)!==null&&f!==void 0?f:[]);l.filter(gr.isString).map(Z=>Z.split(":")).filter(Z=>Z.length===4&&Z[0]==="entity").map(([Z,H,se,He])=>(0,Pn.eE)({kind:H,namespace:se,name:He})).forEach(Z=>L.add(Z)),await o.set("entityRefs",Array.from(L)),await n.remove("starredEntities")}class ui{async toggleStarred(n){this.starredEntities.has(n)?this.starredEntities.delete(n):this.starredEntities.add(n),await this.settingsStore.set("entityRefs",Array.from(this.starredEntities))}starredEntitie$(){return this.observable}notifyChanges(){for(const n of this.subscribers)n.next(new Set(this.starredEntities))}constructor(n){this.subscribers=new Set,this.observable=new(ne())(l=>(l.next(new Set(this.starredEntities)),this.subscribers.add(l),()=>{this.subscribers.delete(l)})),di(n).then(),this.settingsStore=n.storageApi.forBucket("starredEntities");var o;this.starredEntities=new Set((o=this.settingsStore.snapshot("entityRefs").value)!==null&&o!==void 0?o:[]),this.settingsStore.observe$("entityRefs").subscribe({next:l=>{var f;this.starredEntities=new Set((f=l.value)!==null&&f!==void 0?f:[]),this.notifyChanges()}})}}var aa=t(33414),Er=t(79692),hi=t(12420),An=t(56941),pi=t(19928);function fi(){const i=useApi(catalogApiRef),{error:n,loading:o,value:l}=useAsync(async()=>await i.getEntityFacets({facets:["kind"]}).then(L=>{var Z;return((Z=L.facets.kind)===null||Z===void 0?void 0:Z.map(H=>H.value).sort())||[]}),[i]);return{loading:o,error:n,allKinds:l!=null?l:[]}}function gi(i,n,o){let l=i;return n&&(l=l.filter(L=>n.some(Z=>Z.toLocaleLowerCase("en-US")===L.toLocaleLowerCase("en-US")))),o&&!i.some(L=>L.toLocaleLowerCase("en-US")===o.toLocaleLowerCase("en-US"))&&(l=l.concat([o])),l.sort().reduce((L,Z)=>(L[Z.toLocaleLowerCase("en-US")]=Z,L),{})}const wo=(0,Er.Z)(i=>(0,hi.Z)({root:{...i.typography.h4}}));function mi(i){var n;const{initialFilter:o="component",allowedKinds:l}=i,f=wo(),{allKinds:L}=useAllKinds(),{filters:Z,updateFilters:H,queryParameters:{kind:se}}=useEntityList(),He=useMemo(()=>[se].flat()[0],[se]);var De;const[ct,st]=useState((De=He!=null?He:(n=Z.kind)===null||n===void 0?void 0:n.value)!==null&&De!==void 0?De:o);useEffect(()=>{He&&st(He)},[He]),useEffect(()=>{var St;if(!((St=Z.kind)===null||St===void 0)&&St.value){var $t;st(($t=Z.kind)===null||$t===void 0?void 0:$t.value)}},[Z.kind]),useEffect(()=>{H({kind:ct?new EntityKindFilter(ct):void 0})},[ct,H]);const Ct=filterKinds(L,l,ct);return _jsx(Select,{input:_jsx(InputBase,{}),value:ct.toLocaleLowerCase("en-US"),onChange:St=>st(St.target.value),classes:f,children:Object.keys(Ct).map(St=>_jsx(MenuItem,{value:St,children:`${pluralize(Ct[St])}`},St))})}var vi=t(65826);const yi=(0,Er.Z)({flexContainer:{flexWrap:"wrap"},itemText:{width:"100%",wordBreak:"break-all",marginBottom:"1rem"}});function la(i){const n=i.result,o=i.highlight,l=yi(),f=useAnalytics(),L=()=>{f.captureEvent("discover",n.title,{attributes:{to:n.location},value:i.rank})};return _jsxs(_Fragment,{children:[_jsxs(ListItem,{alignItems:"flex-start",children:[i.icon&&_jsx(ListItemIcon,{children:i.icon}),_jsxs("div",{className:l.flexContainer,children:[_jsx(ListItemText,{className:l.itemText,primaryTypographyProps:{variant:"h6"},primary:_jsx(Link,{noTrack:!0,to:n.location,onClick:L,children:o!=null&&o.fields.title?_jsx(HighlightedSearchResultText,{text:o.fields.title,preTag:o.preTag,postTag:o.postTag}):n.title}),secondary:o!=null&&o.fields.text?_jsx(HighlightedSearchResultText,{text:o.fields.text,preTag:o.preTag,postTag:o.postTag}):n.text}),_jsxs(Box,{children:[n.kind&&_jsx(Chip,{label:`Kind: ${n.kind}`,size:"small"}),n.lifecycle&&_jsx(Chip,{label:`Lifecycle: ${n.lifecycle}`,size:"small"})]})]})]}),_jsx(Divider,{component:"li"})]})}var jo=t(86359),Gs=t(95544),Ks=t(99688),ns=t(12231),Nr=t(86136),Fr=t(49378),Eo=t(85256),Ys=t(80030),rs=t(61837),Ao=t(79784),To=t(50758),Io=t(31654),xi=t(43054),Ro=t(65759),mr=t(51666);const ss="catalog-entity",Lo=(0,mr.J$)({name:"catalog.entity.read",attributes:{action:"read"},resourceType:ss}),Js=(0,mr.J$)({name:"catalog.entity.create",attributes:{action:"create"}}),Qs=(0,mr.J$)({name:"catalog.entity.delete",attributes:{action:"delete"},resourceType:ss}),Xs=(0,mr.J$)({name:"catalog.entity.refresh",attributes:{action:"update"},resourceType:ss}),_s=(0,mr.J$)({name:"catalog.location.read",attributes:{action:"read"}}),Po=(0,mr.J$)({name:"catalog.location.create",attributes:{action:"create"}}),bi=(0,mr.J$)({name:"catalog.location.delete",attributes:{action:"delete"}}),Si=[Lo,Js,Qs,Xs,_s,Po,bi];var eo=t(49166);function ko(i){const{unregisterEntityOptions:n,isUnregisterAllowed:o,onUnregisterEntity:l,onClose:f}=i,L=typeof(n==null?void 0:n.disableUnregister)=="boolean";var Z;const H=(Z=!o||(L?!!(n!=null&&n.disableUnregister):(n==null?void 0:n.disableUnregister)==="disable"))!==null&&Z!==void 0?Z:!1;let se=(0,r.jsx)(r.Fragment,{});return(n==null?void 0:n.disableUnregister)!=="hidden"&&(se=(0,r.jsxs)(ns.Z,{onClick:()=>{f(),l()},disabled:H,children:[(0,r.jsx)(Nr.Z,{children:(0,r.jsx)(eo.Z,{fontSize:"small"})}),(0,r.jsx)(Fr.Z,{primary:"Unregister entity"})]})),(0,r.jsx)(r.Fragment,{children:se})}const _n=(0,Er.Z)(i=>({button:{color:i.page.fontColor}}),{name:"PluginCatalogEntityContextMenu"});function Ci(i){const{UNSTABLE_extraContextMenuItems:n,UNSTABLE_contextMenuOptions:o,onUnregisterEntity:l,onInspectEntity:f}=i,[L,Z]=(0,W.useState)(),H=_n(),He=(0,An.N$)(Qs).allowed,De=$t=>{Z($t.currentTarget)},ct=()=>{Z(void 0)},st=(0,b.h_)(b.$v),Ct=(0,W.useCallback)(()=>{window.navigator.clipboard.writeText(window.location.toString()).then(()=>st.post({message:"Copied!",severity:"info"}))},[st]),St=n&&[...n.map($t=>(0,r.jsxs)(ns.Z,{onClick:()=>{ct(),$t.onClick()},children:[(0,r.jsx)(Nr.Z,{children:(0,r.jsx)($t.Icon,{fontSize:"small"})}),(0,r.jsx)(Fr.Z,{primary:$t.title})]},$t.title)),(0,r.jsx)(Eo.Z,{},"the divider is here!")];return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(Ys.ZP,{title:"More",arrow:!0,children:(0,r.jsx)(rs.Z,{"aria-label":"more","aria-controls":"long-menu","aria-haspopup":"true","aria-expanded":!!L,role:"button",onClick:De,"data-testid":"menu-button",className:H.button,id:"long-menu",children:(0,r.jsx)(xi.Z,{})})}),(0,r.jsx)(Ao.ZP,{open:Boolean(L),onClose:ct,anchorEl:L,anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"},"aria-labelledby":"long-menu",children:(0,r.jsxs)(To.Z,{children:[St,(0,r.jsx)(ko,{unregisterEntityOptions:o,isUnregisterAllowed:He,onUnregisterEntity:l,onClose:ct}),(0,r.jsxs)(ns.Z,{onClick:()=>{ct(),f()},children:[(0,r.jsx)(Nr.Z,{children:(0,r.jsx)(Io.Z,{fontSize:"small"})}),(0,r.jsx)(Fr.Z,{primary:"Inspect entity"})]}),(0,r.jsxs)(ns.Z,{onClick:()=>{ct(),Ct()},children:[(0,r.jsx)(Nr.Z,{children:(0,r.jsx)(Ro.Z,{fontSize:"small"})}),(0,r.jsx)(Fr.Z,{primary:"Copy entity URL"})]})]})})]})}const Oo="plugin.catalog.entityLayoutRoute",to=()=>null;(0,b.R5)(to,Oo,!0),(0,b.R5)(to,"core.gatherMountPoints",!0);function wi(i){const{entity:n,title:o}=i;return(0,r.jsxs)(Gs.Z,{display:"inline-flex",alignItems:"center",height:"1em",maxWidth:"100%",children:[(0,r.jsx)(Gs.Z,{component:"span",textOverflow:"ellipsis",whiteSpace:"nowrap",overflow:"hidden",children:o}),n&&(0,r.jsx)(An.LH,{entity:n})]})}function ji(i,n,o,l){var f;const L=(f=i!=null?i:l==null?void 0:l.kind)!==null&&f!==void 0?f:"";var Z;const H=(Z=n!=null?n:l==null?void 0:l.metadata.namespace)!==null&&Z!==void 0?Z:"";var se,He,De;return{headerTitle:`${(De=(He=(se=l==null?void 0:l.metadata.title)!==null&&se!==void 0?se:o)!==null&&He!==void 0?He:l==null?void 0:l.metadata.name)!==null&&De!==void 0?De:""}${H&&H!==Pn.zG?` in ${H}`:""}`,headerType:(()=>{let st=L.toLocaleLowerCase("en-US");return l&&l.spec&&"type"in l.spec&&(st+=" \u2014 ",st+=l.spec.type.toLocaleLowerCase("en-US")),st})()}}function Ei(i){var n;const{entity:o}=i,l=(0,An.hF)(o,Pn.S4);return(0,r.jsxs)(r.Fragment,{children:[l.length>0&&(0,r.jsx)(Ut.i9,{label:"Owner",value:(0,r.jsx)(An.rI,{entityRefs:l,defaultKind:"Group",color:"inherit"})}),((n=o.spec)===null||n===void 0?void 0:n.lifecycle)&&(0,r.jsx)(Ut.i9,{label:"Lifecycle",value:o.spec.lifecycle})]})}const Ai=i=>{var n,o;const{UNSTABLE_extraContextMenuItems:l,UNSTABLE_contextMenuOptions:f,children:L,NotFoundComponent:Z}=i,{kind:H,namespace:se,name:He}=(0,b.Oi)(An.wi),{entity:De,loading:ct,error:st}=(0,An.ce)(),Ct=(0,g.TH)(),St=(0,b.vJ)(L,Fi=>Fi.selectByComponentData({key:Oo,withStrictError:"Child of EntityLayout must be an EntityLayout.Route"}).getElements().flatMap(({props:Ar})=>{if(De){if(Ar.if&&!Ar.if(De))return[]}else return[];return[{path:Ar.path,title:Ar.title,children:Ar.children,tabProps:Ar.tabProps}]}),[De]),{headerTitle:$t,headerType:Et}=ji(H,se,He,De),[Tn,Kn]=(0,W.useState)(!1),[nr,cs]=(0,W.useState)(!1),vo=(0,g.s0)(),Ni=async()=>{Kn(!1),cs(!1),vo("/")};(0,W.useEffect)(()=>{Kn(!1),cs(!1)},[Ct.pathname]);var yo;return(0,r.jsxs)(Ut.T3,{themeId:(yo=De==null||(n=De.spec)===null||n===void 0||(o=n.type)===null||o===void 0?void 0:o.toString())!==null&&yo!==void 0?yo:"home",children:[(0,r.jsx)(Ut.h4,{title:(0,r.jsx)(wi,{title:$t,entity:De}),pageTitleOverride:$t,type:Et,children:De&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(Ei,{entity:De}),(0,r.jsx)(Ci,{UNSTABLE_extraContextMenuItems:l,UNSTABLE_contextMenuOptions:f,onUnregisterEntity:()=>Kn(!0),onInspectEntity:()=>cs(!0)})]})}),ct&&(0,r.jsx)(Ut.Ex,{}),De&&(0,r.jsx)(Ut.tn,{routes:St}),st&&(0,r.jsx)(Ut.VY,{children:(0,r.jsx)(Ks.Z,{severity:"error",children:st.toString()})}),!ct&&!st&&!De&&(0,r.jsx)(Ut.VY,{children:Z||(0,r.jsxs)(Ut.GB,{title:"Entity not found",children:["There is no ",H," with the requested"," ",(0,r.jsx)(Ut.rU,{to:"https://backstage.io/docs/features/software-catalog/references",children:"kind, namespace, and name"}),"."]})}),(0,r.jsx)(An.pp,{open:Tn,entity:De,onConfirm:Ni,onClose:()=>Kn(!1)}),(0,r.jsx)(An.U_,{open:nr,entity:De,onClose:()=>cs(!1)})]})};Ai.Route=to;var ca=t(23054);function ks(i){const{open:n,onClose:o,onConfirm:l,entity:f}=i,[L,Z]=useState(!1),H=useApi(catalogApiRef),se=useApi(alertApiRef),He=async()=>{Z(!0);try{const De=f.metadata.uid;await H.removeEntityByUid(De),l()}catch(De){assertError(De),se.post({message:De.message})}finally{Z(!1)}};return _jsxs(Dialog,{open:n,onClose:o,children:[_jsx(DialogTitle,{id:"responsive-dialog-title",children:"Are you sure you want to delete this entity?"}),_jsxs(DialogActions,{children:[_jsx(Button,{variant:"contained",color:"secondary",disabled:L,onClick:He,children:"Delete"}),_jsx(Button,{onClick:o,color:"primary",children:"Cancel"})]})]})}var Os=t(19625);function da(i){var n,o;return(i==null||(n=i.metadata)===null||n===void 0||(o=n.annotations)===null||o===void 0?void 0:o["backstage.io/orphan"])==="true"}function Ti(){const i=useNavigate(),n=useRouteRef(rootRouteRef),[o,l]=useState(!1),{entity:f}=useEntity(),L=async()=>{l(!1),i(n())};return _jsxs(_Fragment,{children:[_jsx(Alert,{severity:"warning",onClick:()=>l(!0),children:"This entity is not referenced by any location and is therefore not receiving updates. Click here to delete."}),_jsx(DeleteEntityDialog,{open:o,entity:f,onConfirm:L,onClose:()=>l(!1)})]})}var Bo=t(29644);const Bs=i=>i.error&&i.level==="error"&&i.type===ENTITY_STATUS_CATALOG_PROCESSING_TYPE;async function no(i,n){return{items:(await n.getEntityAncestors({entityRef:i})).items.map(f=>{var L,Z;return{errors:((Z=(L=f.entity.status)===null||L===void 0?void 0:L.items)!==null&&Z!==void 0?Z:[]).filter(Bs).map(He=>He.error).filter(He=>Boolean(He)),entity:f.entity}}).filter(f=>f.errors.length>0)}}async function Ii(i,n){const o=n.apis.get(catalogApiRef);if(!o)throw new Error(`No implementation available for ${catalogApiRef}`);return(await no(stringifyEntityRef(i),o)).items.length>0}function Ri(){const{entity:i}=useEntity(),n=stringifyEntityRef(i),o=useApi(catalogApiRef),{loading:l,error:f,value:L}=useAsync(async()=>no(n,o),[n,o]);return f?_jsx(Box,{mb:1,children:_jsx(ResponseErrorPanel,{error:f})}):l||!L?null:_jsx(_Fragment,{children:L.items.map((Z,H)=>_jsxs(Box,{mb:1,children:[stringifyEntityRef(i)!==stringifyEntityRef(Z.entity)&&_jsxs(Box,{p:1,children:["The error below originates from"," ",_jsx(EntityRefLink,{entityRef:Z.entity})]}),Z.errors.map((se,He)=>_jsx(ResponseErrorPanel,{error:se},He))]},H))})}const os="core.backstage.entitySwitch",is=i=>null;(0,b.R5)(is,os,!0);const as=i=>{var n;const{entity:o,loading:l}=(0,An.ce)(),f=(0,b.I_)(),L=(0,b.vJ)(i.children,se=>se.selectByComponentData({key:os,withStrictError:"Child of EntitySwitch is not an EntitySwitch.Case"}).getElements().flatMap(He=>{if(l)return[];const{if:De,children:ct}=He.props;if(!o)return[{if:De===void 0,children:ct}];var st;return[{if:(st=De==null?void 0:De(o,{apis:f}))!==null&&st!==void 0?st:!0,children:ct}]}),[f,o,l]);if(L.some(se=>typeof se.if=="object"&&"then"in se.if))return(0,r.jsx)(ro,{results:L});var H;return(H=(n=L.find(se=>se.if))===null||n===void 0?void 0:n.children)!==null&&H!==void 0?H:null};function ro({results:i}){const{loading:n,value:o}=(0,E.default)(async()=>{const l=i.map(async({if:L,children:Z})=>{try{if(await L)return Z}catch{}return null});var f;return(f=(await Promise.all(l)).find(Boolean))!==null&&f!==void 0?f:null},[i]);return n||!o?null:o}as.Case=is;const $o=null,lr=An._i.Filters,Li=An._i.Content;var Zo=t(85877);const Hn=(0,b.rx)({id:"catalog",apis:[(0,b.ni)({api:An.Ah,deps:{discoveryApi:b.NW,fetchApi:b.gP},factory:({discoveryApi:i,fetchApi:n})=>new Bo.MS({discoveryApi:i,fetchApi:n})}),(0,b.ni)({api:An.p3,deps:{storageApi:b.E6},factory:({storageApi:i})=>new ui({storageApi:i})})],routes:{catalogIndex:Os._Z,catalogEntity:An.wi},externalRoutes:{createComponent:Os.yw,viewTechDoc:Os.jU},__experimentalConfigure(i){return{...{createButtonTitle:"Create"},...i}}}),ua=Hn.provide((0,b.P4)({name:"CatalogIndexPage",component:()=>t.e(5837).then(t.bind(t,95837)).then(i=>i.CatalogPage),mountPoint:Os._Z})),tr=Hn.provide((0,b.P4)({name:"CatalogEntityPage",component:()=>t.e(8951).then(t.bind(t,78951)).then(i=>i.CatalogEntityPage),mountPoint:An.wi})),Do=Hn.provide((0,b.CO)({name:"EntityAboutCard",component:{lazy:()=>Promise.resolve().then(t.bind(t,33414)).then(i=>i.AboutCard)}})),Pi=Hn.provide((0,b.CO)({name:"EntityLinksCard",component:{lazy:()=>t.e(7750).then(t.bind(t,17750)).then(i=>i.EntityLinksCard)}})),ki=Hn.provide((0,b.CO)({name:"EntityLabelsCard",component:{lazy:()=>Promise.resolve().then(t.bind(t,85877)).then(i=>i.EntityLabelsCard)}})),Oi=Hn.provide((0,b.CO)({name:"EntityHasSystemsCard",component:{lazy:()=>t.e(5458).then(t.bind(t,5458)).then(i=>i.HasSystemsCard)}})),Bi=Hn.provide((0,b.CO)({name:"EntityHasComponentsCard",component:{lazy:()=>t.e(1105).then(t.bind(t,1105)).then(i=>i.HasComponentsCard)}})),$s=Hn.provide((0,b.CO)({name:"EntityHasSubcomponentsCard",component:{lazy:()=>t.e(2440).then(t.bind(t,82440)).then(i=>i.HasSubcomponentsCard)}})),No=Hn.provide((0,b.CO)({name:"EntityHasResourcesCard",component:{lazy:()=>t.e(9770).then(t.bind(t,79770)).then(i=>i.HasResourcesCard)}})),Fo=Hn.provide((0,b.CO)({name:"EntityDependsOnComponentsCard",component:{lazy:()=>t.e(9545).then(t.bind(t,19545)).then(i=>i.DependsOnComponentsCard)}})),Uo=Hn.provide((0,b.CO)({name:"EntityDependencyOfComponentsCard",component:{lazy:()=>t.e(184).then(t.bind(t,40184)).then(i=>i.DependencyOfComponentsCard)}})),Mo=Hn.provide((0,b.CO)({name:"EntityDependsOnResourcesCard",component:{lazy:()=>t.e(1032).then(t.bind(t,81032)).then(i=>i.DependsOnResourcesCard)}})),so=Hn.provide((0,b.CO)({name:"RelatedEntitiesCard",component:{lazy:()=>t.e(732).then(t.bind(t,732)).then(i=>i.RelatedEntitiesCard)}}));var oo=t(32838);class io{async getApiOrigin(){return await this.discoveryApi.getBaseUrl("techdocs")}async getStorageUrl(){return`${await this.discoveryApi.getBaseUrl("techdocs")}/static/docs`}async getBuilder(){return this.configApi.getString("techdocs.builder")}async getEntityDocs(n,o){const f=`${await this.getApiOrigin()}/${o}`,L=await fetch(`${f.endsWith("/")?f:`${f}/`}index.html`);if(L.status===404)throw new Error("Page not found");return L.text()}async syncEntityDocs(n){return"cached"}async getBaseUrl(n,o,l){const f=await this.getApiOrigin();return new URL(n,`${f}/${l}`).toString()}constructor({configApi:n,discoveryApi:o,identityApi:l}){this.configApi=n,this.discoveryApi=o,this.identityApi=l}}class ao{async getApiOrigin(){return await this.discoveryApi.getBaseUrl("techdocs")}async getEntityMetadata(n){return{apiVersion:"backstage.io/v1alpha1",kind:"Component",metadata:{name:"local"},spec:{owner:"test",lifecycle:"experimental"}}}async getTechDocsMetadata(n){return{site_name:"Live preview environment",site_description:""}}constructor({configApi:n,discoveryApi:o,identityApi:l}){this.configApi=n,this.discoveryApi=o,this.identityApi=l}}const lo=[(0,b.ni)({api:Le.Dl,deps:{configApi:b.Ds,discoveryApi:b.NW,identityApi:b.$4},factory:({configApi:i,discoveryApi:n,identityApi:o})=>new io({configApi:i,discoveryApi:n,identityApi:o})}),(0,b.ni)({api:Le.gT,deps:{configApi:b.Ds,discoveryApi:b.NW,identityApi:b.$4},factory:({configApi:i,discoveryApi:n,identityApi:o})=>new ao({configApi:i,discoveryApi:n,identityApi:o})}),(0,b.ni)({api:oo.q3,deps:{configApi:b.Ds},factory:({configApi:i})=>oo.ae.fromConfig(i)})],zo={backend:{baseUrl:"http://localhost:3000"},techdocs:{builder:"external"}},Ur={backend:{baseUrl:"http://localhost:7007"},techdocs:{builder:"external"}};async function Wo(){const i=await fetch("/.detect");return i.ok?(await i.text()).trim()==="techdocs-cli-server":!1}async function Vo(){const i=await Gr(),n=await Wo();return[...i,{context:"detected",data:n?zo:Ur}]}var co=t(58845);const uo=(0,Er.Z)({svg:{width:"auto",height:30},path:{fill:"#7df3e1"}});var Ho=()=>{const i=uo();return(0,r.jsx)("svg",{className:i.svg,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 2079.95 456.05",children:(0,r.jsx)("path",{className:i.path,d:"M302.9,180a80.62,80.62,0,0,0,13.44-10.37c.8-.77,1.55-1.54,2.31-2.31a81.89,81.89,0,0,0,7.92-9.37,62.37,62.37,0,0,0,6.27-10.77,48.6,48.6,0,0,0,4.36-16.4c1.49-19.39-10-38.67-35.62-54.22L198.42,14,78.16,129.22l-78.29,75,108.6,65.9a111.6,111.6,0,0,0,57.76,16.42c24.92,0,48.8-8.8,66.42-25.69,19.16-18.36,25.52-42.12,13.7-61.87a49.69,49.69,0,0,0-6.8-8.87,89.78,89.78,0,0,0,19.28,2.15H259a85.09,85.09,0,0,0,31-5.79A80.88,80.88,0,0,0,302.9,180Zm-100.59,59.8c-19.32,18.51-50.4,21.24-75.7,5.9l-75.13-45.6,67.44-64.65,76.42,46.39C222.88,198.57,221.36,221.6,202.31,239.84Zm8.94-82.21L140.6,114.74,205,53l69.37,42.11c25.94,15.73,29.31,37.05,10.55,55A60.71,60.71,0,0,1,211.25,157.63Zm29.86,190c-19.57,18.75-46.17,29.08-74.88,29.08a123.84,123.84,0,0,1-64.11-18.19L-.13,296.51v24.67l108.6,65.91a111.6,111.6,0,0,0,57.76,16.42c24.92,0,48.8-8.81,66.42-25.69,12.88-12.34,20-27.13,19.68-41.49v-1.79A87.85,87.85,0,0,1,241.11,347.67Zm0-39c-19.57,18.76-46.17,29.09-74.88,29.09a123.84,123.84,0,0,1-64.11-18.19L-.13,257.52V282.2l108.6,65.91a111.59,111.59,0,0,0,57.76,16.41c24.92,0,48.8-8.8,66.42-25.68,12.88-12.35,20-27.13,19.68-41.5v-1.79A86.86,86.86,0,0,1,241.11,308.68Zm0-39c-19.57,18.76-46.17,29.09-74.88,29.09a123.84,123.84,0,0,1-64.11-18.19L-.13,218.54v24.68l108.6,65.91a111.59,111.59,0,0,0,57.76,16.41c24.92,0,48.8-8.8,66.42-25.69,12.88-12.34,20-27.12,19.68-41.49v-1.82A87.14,87.14,0,0,1,241.11,269.7Zm83.69,25.74a94.16,94.16,0,0,1-60.19,25.86h0V348a81.6,81.6,0,0,0,51.73-22.37c14-13.38,21.15-28.11,21-42.64v-2.2A95.14,95.14,0,0,1,324.8,295.44Zm-83.69,91.21c-19.57,18.75-46.17,29.09-74.88,29.09a123.76,123.76,0,0,1-64.11-18.2L-.13,335.49v24.67l108.6,65.91a111.6,111.6,0,0,0,57.76,16.42c24.92,0,48.8-8.81,66.42-25.69,12.88-12.34,20-27.13,19.68-41.49v-1.79A87.35,87.35,0,0,1,241.11,386.65Zm85.75-210.21c-.68.69-1.35,1.38-2.06,2.05a99.19,99.19,0,0,1-22.23,15.69,94.53,94.53,0,0,1-26.24,8.71,97.84,97.84,0,0,1-14.16,1.57c.5,1.61.9,3.25,1.25,4.9a52.7,52.7,0,0,1,1.13,12V231h.05A84.48,84.48,0,0,0,290,225.47a80.83,80.83,0,0,0,26.38-16.82c.81-.77,1.51-1.56,2.27-2.34a82,82,0,0,0,7.92-9.38,62.85,62.85,0,0,0,6.29-10.78,48.5,48.5,0,0,0,4.32-16.44c.09-1.23.2-2.47.19-3.7v-2c-.72,1-1.48,2.06-2.26,3.09A98,98,0,0,1,326.86,176.44Zm0,77.92c-.68.7-1.3,1.41-2,2.1a94.09,94.09,0,0,1-60.19,25.85h0V309h0a81.65,81.65,0,0,0,51.73-22.37,73.51,73.51,0,0,0,16.48-22.49,48.56,48.56,0,0,0,4.32-16.44c.09-1.24.2-2.48.19-3.71v-2.2c-.74,1.08-1.47,2.16-2.27,3.22A95.81,95.81,0,0,1,326.82,254.36Zm0-39c-.68.7-1.3,1.41-2,2.1a92.22,92.22,0,0,1-10.62,8.65,93.53,93.53,0,0,1-11.63,7,95.63,95.63,0,0,1-37.94,10.18h-.05l0,26.67h0a81.63,81.63,0,0,0,51.73-22.37c.81-.77,1.51-1.56,2.27-2.34a82,82,0,0,0,7.92-9.38,63.16,63.16,0,0,0,6.29-10.77,48.55,48.55,0,0,0,4.32-16.45c.09-1.23.2-2.47.19-3.7v-2.2c-.74,1.08-1.47,2.16-2.27,3.22A98.19,98.19,0,0,1,326.82,215.38Zm241-88.84q7.94,0,17.09.17t18.12,1a139.3,139.3,0,0,1,16.74,2.57,42.78,42.78,0,0,1,13.3,5.14,64.27,64.27,0,0,1,20.54,19.89Q662,168,662,186.54q0,19.54-9.49,33.78t-27.1,21.09v.68q22.78,4.82,34.87,20.58t12.08,38.4a72.62,72.62,0,0,1-4.83,26.06,65.29,65.29,0,0,1-14.33,22.46,71.57,71.57,0,0,1-23.47,15.78q-14,6-32.28,6H478.38V126.54Zm9,105.27q28,0,40.21-9.78t12.26-29.31q0-13-4.14-20.58a29.47,29.47,0,0,0-11.4-11.66A45,45,0,0,0,597,155.17a161.2,161.2,0,0,0-20.19-1.2h-65.6v77.84Zm16.57,112.13q21.74,0,34-11.66T639.59,300q0-12-4.48-19.88a34.85,34.85,0,0,0-11.91-12.52,50.14,50.14,0,0,0-17.09-6.52,105,105,0,0,0-20-1.88H511.17v84.7Zm274.79,26.74q-7.61,4.45-21.06,4.46-11.4,0-18.12-6.34t-6.74-20.75a70.17,70.17,0,0,1-28.13,20.75,97.87,97.87,0,0,1-57.65,3.6,53.51,53.51,0,0,1-18.82-8.58A41.19,41.19,0,0,1,705,348.56q-4.65-9.42-4.66-22.8,0-15.09,5.18-24.69a44.92,44.92,0,0,1,13.64-15.6,62.63,62.63,0,0,1,19.33-9.09q10.88-3.08,22.27-5.14,12.08-2.4,23-3.6a128,128,0,0,0,19.16-3.43c5.53-1.48,9.89-3.65,13.12-6.51s4.83-7,4.83-12.52q0-9.6-3.62-15.43a24.94,24.94,0,0,0-9.32-8.92,38.38,38.38,0,0,0-12.78-4.11,96.54,96.54,0,0,0-14-1q-18.63,0-31.07,7T736.6,249.29H707.26q.69-16.46,6.9-27.77a52.21,52.21,0,0,1,16.57-18.35,70,70,0,0,1,23.65-10.11A125.51,125.51,0,0,1,782.86,190a168.63,168.63,0,0,1,24,1.72,63.26,63.26,0,0,1,21.58,7A41.23,41.23,0,0,1,844,213.59q5.87,9.57,5.87,25v91q0,10.26,1.21,15.05t8.11,4.79a35.57,35.57,0,0,0,9-1.37Zm-47.64-90.87c-3.69,2.74-8.52,4.72-14.5,6s-12.26,2.27-18.82,3.07-13.17,1.71-19.85,2.73a73.7,73.7,0,0,0-18,4.94,32.62,32.62,0,0,0-12.94,9.73q-5,6.32-5,17.23a23.31,23.31,0,0,0,2.94,12.11,24.11,24.11,0,0,0,7.59,8,32,32,0,0,0,10.88,4.44,60.94,60.94,0,0,0,13.11,1.36q14.5,0,24.86-3.92a52.49,52.49,0,0,0,16.91-9.9,39.1,39.1,0,0,0,9.67-13,32.53,32.53,0,0,0,3.11-13.14ZM1002.07,225q-11.05-9.25-29.69-9.26-15.89,0-26.58,5.83A47.29,47.29,0,0,0,928.71,237a64.66,64.66,0,0,0-9.15,22.12A119.83,119.83,0,0,0,916.8,285a98.22,98.22,0,0,0,2.93,24,64.18,64.18,0,0,0,9.15,20.74,46.2,46.2,0,0,0,16.23,14.58q10,5.49,23.82,5.48,21.75,0,34-11.31t15-31.89h30q-4.83,32.91-24.68,50.75t-54,17.83q-20.37,0-36.07-6.52A69.86,69.86,0,0,1,907,350.11a79.92,79.92,0,0,1-15.88-28.63A118.64,118.64,0,0,1,885.73,285a129.41,129.41,0,0,1,5.18-37.21,85.63,85.63,0,0,1,15.71-30.17A73.46,73.46,0,0,1,933,197.35Q948.91,190,970,190a108.54,108.54,0,0,1,28.48,3.6,69.59,69.59,0,0,1,23.48,11.15,61,61,0,0,1,16.74,19q6.55,11.49,8.29,27.26h-30.38Q1013.11,234.21,1002.07,225Zm109.77-98.41v145l81.47-77.49h39.36l-70.77,64.46,75.95,112.82h-37.29l-61.1-92.59-27.62,25.38v67.21H1082.5V126.54Zm170.54,205.22a31.07,31.07,0,0,0,10.87,10.63,49,49,0,0,0,15.19,5.66,87.06,87.06,0,0,0,17.44,1.71,109.18,109.18,0,0,0,14.5-1,53.22,53.22,0,0,0,14-3.78,26.27,26.27,0,0,0,10.53-8q4.14-5.32,4.14-13.55,0-11.31-8.63-17.14a73.69,73.69,0,0,0-21.58-9.43q-12.94-3.6-28.13-6.52a146,146,0,0,1-28.14-8.23A58.16,58.16,0,0,1,1261,267.13q-8.64-9.6-8.63-26.75,0-13.38,6-23a49.26,49.26,0,0,1,15.53-15.61,71.76,71.76,0,0,1,21.4-8.91A99.41,99.41,0,0,1,1319,190a141.31,141.31,0,0,1,28,2.58,64.85,64.85,0,0,1,22.62,8.91,46.16,46.16,0,0,1,15.7,17.15q5.87,10.8,6.91,26.91h-29.35q-.69-8.57-4.48-14.23a29.36,29.36,0,0,0-9.67-9.08,44.16,44.16,0,0,0-12.94-5,67.68,67.68,0,0,0-14.33-1.54,87.29,87.29,0,0,0-13.29,1,45.28,45.28,0,0,0-12.26,3.6,24.49,24.49,0,0,0-9,6.86q-3.46,4.29-3.46,11.14a16.32,16.32,0,0,0,5.36,12.52,42.75,42.75,0,0,0,13.63,8.23,120,120,0,0,0,18.64,5.48q10.37,2.24,20.72,4.63,11,2.4,21.57,5.83A70.74,70.74,0,0,1,1382,284.1a44.55,44.55,0,0,1,13.12,14.23q5,8.58,5,21.26,0,16.13-6.73,26.75a52.5,52.5,0,0,1-17.61,17.14,73.89,73.89,0,0,1-24.51,9.09,146.3,146.3,0,0,1-27.1,2.57,126.24,126.24,0,0,1-28.31-3.09A69.56,69.56,0,0,1,1272,361.94a51.74,51.74,0,0,1-16.57-18.52q-6.21-11.49-6.9-27.95h29.34A32.65,32.65,0,0,0,1282.38,331.76Zm226.46-137.67v25.72h-35.56V329.88a31.37,31.37,0,0,0,.87,8.23,8.42,8.42,0,0,0,3.28,4.8,14.61,14.61,0,0,0,6.73,2.23,99.19,99.19,0,0,0,11.22.51h13.46v25.72H1486.4a105.8,105.8,0,0,1-19.5-1.55,28.65,28.65,0,0,1-13.12-5.65,24.09,24.09,0,0,1-7.42-11.66q-2.43-7.54-2.42-19.89V219.81h-30.38V194.09h30.38V140.94h29.34v53.15ZM1699.4,370.68q-7.61,4.45-21.06,4.46-11.4,0-18.12-6.34t-6.74-20.75a70.17,70.17,0,0,1-28.13,20.75,97.87,97.87,0,0,1-57.65,3.6,53.51,53.51,0,0,1-18.82-8.58,41.19,41.19,0,0,1-12.6-15.26q-4.65-9.42-4.66-22.8,0-15.09,5.18-24.69a44.92,44.92,0,0,1,13.64-15.6,62.63,62.63,0,0,1,19.33-9.09q10.88-3.08,22.27-5.14,12.07-2.4,23-3.6a128,128,0,0,0,19.16-3.43c5.53-1.48,9.89-3.65,13.12-6.51s4.83-7,4.83-12.52q0-9.6-3.62-15.43a24.94,24.94,0,0,0-9.32-8.92,38.38,38.38,0,0,0-12.78-4.11,96.54,96.54,0,0,0-14-1q-18.63,0-31.07,7t-13.46,26.57h-29.34q.67-16.46,6.9-27.77A52.21,52.21,0,0,1,1562,203.17a70,70,0,0,1,23.65-10.11,125.51,125.51,0,0,1,28.48-3.09,168.63,168.63,0,0,1,24,1.72,63.26,63.26,0,0,1,21.58,7,41.23,41.23,0,0,1,15.53,14.89q5.87,9.57,5.87,25v91q0,10.26,1.21,15.05t8.11,4.79a35.57,35.57,0,0,0,9-1.37Zm-47.64-90.87c-3.69,2.74-8.52,4.72-14.5,6s-12.26,2.27-18.82,3.07-13.17,1.71-19.85,2.73a73.7,73.7,0,0,0-17.95,4.94,32.62,32.62,0,0,0-12.94,9.73q-5,6.32-5,17.23a23.31,23.31,0,0,0,2.94,12.11,24.11,24.11,0,0,0,7.59,8,32,32,0,0,0,10.88,4.44,60.94,60.94,0,0,0,13.11,1.36q14.51,0,24.86-3.92a52.49,52.49,0,0,0,16.91-9.9,39.1,39.1,0,0,0,9.67-13,32.53,32.53,0,0,0,3.11-13.14Zm208.85,141.62q-20,21.6-62.83,21.6a122.11,122.11,0,0,1-25.37-2.74,78,78,0,0,1-23.48-8.92,54.41,54.41,0,0,1-17.43-16.11q-6.91-10-7.6-24.35h29.35a21.47,21.47,0,0,0,5,13.38,36.67,36.67,0,0,0,11.4,8.91,55.52,55.52,0,0,0,14.67,5,79.51,79.51,0,0,0,15.19,1.55q14.49,0,24.51-5A46,46,0,0,0,1840.59,401a56.53,56.53,0,0,0,9.49-21.09,117.46,117.46,0,0,0,2.94-27.09V341.19h-.7q-7.59,16.46-23,24.18a71.8,71.8,0,0,1-32.63,7.71q-20,0-34.86-7.2A72.88,72.88,0,0,1,1737,346.51a82.13,82.13,0,0,1-15-28.46,116.62,116.62,0,0,1-5-34.47,133.92,133.92,0,0,1,4.14-32.4A88.17,88.17,0,0,1,1735,221a75.49,75.49,0,0,1,25.55-22.29q15.87-8.75,39-8.75a66.21,66.21,0,0,1,31.07,7.38,52.13,52.13,0,0,1,22.09,22.11h.35V194.09h27.61V356.28Q1880.63,399.83,1860.61,421.43Zm-37.46-79.72a47.94,47.94,0,0,0,16.4-15.78,71.89,71.89,0,0,0,9.15-22.11,106.77,106.77,0,0,0,2.93-24.69,96.71,96.71,0,0,0-2.76-23,64,64,0,0,0-8.8-20.4,45.76,45.76,0,0,0-15.71-14.57q-9.66-5.49-23.47-5.49-14.16,0-24.17,5.32a46.77,46.77,0,0,0-16.4,14.23,60.14,60.14,0,0,0-9.32,20.57,99.69,99.69,0,0,0-2.93,24.35,120.63,120.63,0,0,0,2.42,24,67.5,67.5,0,0,0,8.28,21.77,46.37,46.37,0,0,0,15.54,15.78q9.66,6,24.16,6T1823.15,341.71Zm228,18.34q-20,15.09-50.41,15.09-21.4,0-37.11-6.86a73.16,73.16,0,0,1-26.41-19.2,81.52,81.52,0,0,1-16-29.49,141.12,141.12,0,0,1-6-37.38,106.1,106.1,0,0,1,6.21-37A88.56,88.56,0,0,1,1938.8,216a79.09,79.09,0,0,1,26.58-19.2A81.66,81.66,0,0,1,1999,190q23.82,0,39.53,9.78a78,78,0,0,1,25.2,24.86,98.18,98.18,0,0,1,13.12,32.91,140.6,140.6,0,0,1,2.93,34h-133.6a70,70,0,0,0,2.76,22.12,49.9,49.9,0,0,0,10,18.51A49.1,49.1,0,0,0,1976.6,345q10.7,4.82,25.2,4.8,18.65,0,30.55-8.57t15.71-26.06h29Q2071.18,345,2051.17,360.05Zm-7.08-113.84a50,50,0,0,0-10.7-16,53.1,53.1,0,0,0-56.62-10.63,47.48,47.48,0,0,0-15.71,10.81,51.69,51.69,0,0,0-10.35,15.94,60.18,60.18,0,0,0-4.49,19.37h102.53A59.47,59.47,0,0,0,2044.09,246.21ZM302.9,180a80.62,80.62,0,0,0,13.44-10.37c.8-.77,1.55-1.54,2.31-2.31a81.89,81.89,0,0,0,7.92-9.37,62.37,62.37,0,0,0,6.27-10.77,48.6,48.6,0,0,0,4.36-16.4c1.49-19.39-10-38.67-35.62-54.22L198.42,14,78.16,129.22l-78.29,75,108.6,65.9a111.6,111.6,0,0,0,57.76,16.42c24.92,0,48.8-8.8,66.42-25.69,19.16-18.36,25.52-42.12,13.7-61.87a49.69,49.69,0,0,0-6.8-8.87,89.78,89.78,0,0,0,19.28,2.15H259a85.09,85.09,0,0,0,31-5.79A80.88,80.88,0,0,0,302.9,180Zm-100.59,59.8c-19.32,18.51-50.4,21.24-75.7,5.9l-75.13-45.6,67.44-64.65,76.42,46.39C222.88,198.57,221.36,221.6,202.31,239.84Zm8.94-82.21L140.6,114.74,205,53l69.37,42.11c25.94,15.73,29.31,37.05,10.55,55A60.71,60.71,0,0,1,211.25,157.63Zm29.86,190c-19.57,18.75-46.17,29.08-74.88,29.08a123.84,123.84,0,0,1-64.11-18.19L-.13,296.51v24.67l108.6,65.91a111.6,111.6,0,0,0,57.76,16.42c24.92,0,48.8-8.81,66.42-25.69,12.88-12.34,20-27.13,19.68-41.49v-1.79A87.85,87.85,0,0,1,241.11,347.67Zm0-39c-19.57,18.76-46.17,29.09-74.88,29.09a123.84,123.84,0,0,1-64.11-18.19L-.13,257.52V282.2l108.6,65.91a111.59,111.59,0,0,0,57.76,16.41c24.92,0,48.8-8.8,66.42-25.68,12.88-12.35,20-27.13,19.68-41.5v-1.79A86.86,86.86,0,0,1,241.11,308.68Zm0-39c-19.57,18.76-46.17,29.09-74.88,29.09a123.84,123.84,0,0,1-64.11-18.19L-.13,218.54v24.68l108.6,65.91a111.59,111.59,0,0,0,57.76,16.41c24.92,0,48.8-8.8,66.42-25.69,12.88-12.34,20-27.12,19.68-41.49v-1.82A87.14,87.14,0,0,1,241.11,269.7Zm83.69,25.74a94.16,94.16,0,0,1-60.19,25.86h0V348a81.6,81.6,0,0,0,51.73-22.37c14-13.38,21.15-28.11,21-42.64v-2.2A95.14,95.14,0,0,1,324.8,295.44Zm-83.69,91.21c-19.57,18.75-46.17,29.09-74.88,29.09a123.76,123.76,0,0,1-64.11-18.2L-.13,335.49v24.67l108.6,65.91a111.6,111.6,0,0,0,57.76,16.42c24.92,0,48.8-8.81,66.42-25.69,12.88-12.34,20-27.13,19.68-41.49v-1.79A87.35,87.35,0,0,1,241.11,386.65Zm85.75-210.21c-.68.69-1.35,1.38-2.06,2.05a99.19,99.19,0,0,1-22.23,15.69,94.53,94.53,0,0,1-26.24,8.71,97.84,97.84,0,0,1-14.16,1.57c.5,1.61.9,3.25,1.25,4.9a52.7,52.7,0,0,1,1.13,12V231h.05A84.48,84.48,0,0,0,290,225.47a80.83,80.83,0,0,0,26.38-16.82c.81-.77,1.51-1.56,2.27-2.34a82,82,0,0,0,7.92-9.38,62.85,62.85,0,0,0,6.29-10.78,48.5,48.5,0,0,0,4.32-16.44c.09-1.23.2-2.47.19-3.7v-2c-.72,1-1.48,2.06-2.26,3.09A98,98,0,0,1,326.86,176.44Zm0,77.92c-.68.7-1.3,1.41-2,2.1a94.09,94.09,0,0,1-60.19,25.85h0V309h0a81.65,81.65,0,0,0,51.73-22.37,73.51,73.51,0,0,0,16.48-22.49,48.56,48.56,0,0,0,4.32-16.44c.09-1.24.2-2.48.19-3.71v-2.2c-.74,1.08-1.47,2.16-2.27,3.22A95.81,95.81,0,0,1,326.82,254.36Zm0-39c-.68.7-1.3,1.41-2,2.1a92.22,92.22,0,0,1-10.62,8.65,93.53,93.53,0,0,1-11.63,7,95.63,95.63,0,0,1-37.94,10.18h-.05l0,26.67h0a81.63,81.63,0,0,0,51.73-22.37c.81-.77,1.51-1.56,2.27-2.34a82,82,0,0,0,7.92-9.38,63.16,63.16,0,0,0,6.29-10.77,48.55,48.55,0,0,0,4.32-16.45c.09-1.23.2-2.47.19-3.7v-2.2c-.74,1.08-1.47,2.16-2.27,3.22A98.19,98.19,0,0,1,326.82,215.38Z"})})};const Go=(0,Er.Z)({svg:{width:"auto",height:28},path:{fill:"#7df3e1"}});var Yo=()=>{const i=Go();return(0,r.jsx)("svg",{className:i.svg,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 337.46 428.5",children:(0,r.jsx)("path",{className:i.path,d:"M303,166.05a80.69,80.69,0,0,0,13.45-10.37c.79-.77,1.55-1.53,2.3-2.3a83.12,83.12,0,0,0,7.93-9.38A63.69,63.69,0,0,0,333,133.23a48.58,48.58,0,0,0,4.35-16.4c1.49-19.39-10-38.67-35.62-54.22L198.56,0,78.3,115.23,0,190.25l108.6,65.91a111.59,111.59,0,0,0,57.76,16.41c24.92,0,48.8-8.8,66.42-25.69,19.16-18.36,25.52-42.12,13.7-61.87a49.22,49.22,0,0,0-6.8-8.87A89.17,89.17,0,0,0,259,178.29h.15a85.08,85.08,0,0,0,31-5.79A80.88,80.88,0,0,0,303,166.05ZM202.45,225.86c-19.32,18.51-50.4,21.23-75.7,5.9L51.61,186.15l67.45-64.64,76.41,46.38C223,184.58,221.49,207.61,202.45,225.86Zm8.93-82.22-70.65-42.89L205.14,39,274.51,81.1c25.94,15.72,29.31,37,10.55,55A60.69,60.69,0,0,1,211.38,143.64Zm29.86,190c-19.57,18.75-46.17,29.09-74.88,29.09a123.73,123.73,0,0,1-64.1-18.2L0,282.52v24.67L108.6,373.1a111.6,111.6,0,0,0,57.76,16.42c24.92,0,48.8-8.81,66.42-25.69,12.88-12.34,20-27.13,19.68-41.49v-1.79A87.27,87.27,0,0,1,241.24,333.68Zm0-39c-19.57,18.75-46.17,29.08-74.88,29.08a123.81,123.81,0,0,1-64.1-18.19L0,243.53v24.68l108.6,65.91a111.6,111.6,0,0,0,57.76,16.42c24.92,0,48.8-8.81,66.42-25.69,12.88-12.34,20-27.13,19.68-41.5v-1.78A87.27,87.27,0,0,1,241.24,294.7Zm0-39c-19.57,18.76-46.17,29.09-74.88,29.09a123.81,123.81,0,0,1-64.1-18.19L0,204.55v24.68l108.6,65.91a111.59,111.59,0,0,0,57.76,16.41c24.92,0,48.8-8.8,66.42-25.68,12.88-12.35,20-27.13,19.68-41.5v-1.82A86.09,86.09,0,0,1,241.24,255.71Zm83.7,25.74a94.15,94.15,0,0,1-60.2,25.86h0V334a81.6,81.6,0,0,0,51.74-22.37c14-13.38,21.14-28.11,21-42.64v-2.19A94.92,94.92,0,0,1,324.94,281.45Zm-83.7,91.21c-19.57,18.76-46.17,29.09-74.88,29.09a123.73,123.73,0,0,1-64.1-18.2L0,321.5v24.68l108.6,65.9a111.6,111.6,0,0,0,57.76,16.42c24.92,0,48.8-8.8,66.42-25.69,12.88-12.34,20-27.13,19.68-41.49v-1.79A86.29,86.29,0,0,1,241.24,372.66ZM327,162.45c-.68.69-1.35,1.38-2.05,2.06a94.37,94.37,0,0,1-10.64,8.65,91.35,91.35,0,0,1-11.6,7,94.53,94.53,0,0,1-26.24,8.71,97.69,97.69,0,0,1-14.16,1.57c.5,1.61.9,3.25,1.25,4.9a53.27,53.27,0,0,1,1.14,12V217h.05a84.41,84.41,0,0,0,25.35-5.55,81,81,0,0,0,26.39-16.82c.8-.77,1.5-1.56,2.26-2.34a82.08,82.08,0,0,0,7.93-9.38A63.76,63.76,0,0,0,333,172.17a48.55,48.55,0,0,0,4.32-16.45c.09-1.23.2-2.47.19-3.7V150q-1.08,1.54-2.25,3.09A96.73,96.73,0,0,1,327,162.45Zm0,77.92c-.69.7-1.31,1.41-2,2.1a94.2,94.2,0,0,1-60.2,25.86h0l0,26.67h0a81.6,81.6,0,0,0,51.74-22.37A73.51,73.51,0,0,0,333,250.13a48.56,48.56,0,0,0,4.32-16.44c.09-1.24.2-2.47.19-3.71v-2.19c-.74,1.07-1.46,2.15-2.27,3.21A95.68,95.68,0,0,1,327,240.37Zm0-39c-.69.7-1.31,1.41-2,2.1a93.18,93.18,0,0,1-10.63,8.65,91.63,91.63,0,0,1-11.63,7,95.47,95.47,0,0,1-37.94,10.18h0V256h0a81.65,81.65,0,0,0,51.74-22.37c.8-.77,1.5-1.56,2.26-2.34a82.08,82.08,0,0,0,7.93-9.38A63.76,63.76,0,0,0,333,211.15a48.56,48.56,0,0,0,4.32-16.44c.09-1.24.2-2.48.19-3.71v-2.2c-.74,1.08-1.46,2.16-2.27,3.22A95.68,95.68,0,0,1,327,201.39Z"})})};const ls=(0,Er.Z)({root:{width:Ut.po.drawerWidthClosed,height:3*Ut.po.logoHeight,display:"flex",flexFlow:"row nowrap",alignItems:"center",marginBottom:-14},link:{width:Ut.po.drawerWidthClosed,marginLeft:24}}),ho=()=>{const i=ls(),{isOpen:n}=(0,Ut.mZ)();return(0,r.jsx)("div",{className:i.root,children:(0,r.jsx)(Ut.rU,{to:"/docs/default/component/local/",underline:"none",className:i.link,children:n?(0,r.jsx)(Ho,{}):(0,r.jsx)(Yo,{})})})},Jo=({children:i})=>(0,r.jsxs)(Ut.tR,{children:[(0,r.jsxs)(Ut.YE,{children:[(0,r.jsx)(ho,{}),(0,r.jsx)(Ut.v7,{}),(0,r.jsx)(Ut.R6,{icon:co.Z,to:"/docs/default/component/local",text:"Docs Preview"})]}),i]});var po=t(32388),Qo=t(4142);const fo=(0,Er.Z)(i=>({headerIcon:{color:i.palette.common.white,width:"32px",height:"32px"},content:{backgroundColor:i.palette.background.default},contentToolbar:{display:"flex",justifyContent:"flex-end",padding:0}}));var er;(function(i){i.LIGHT="light",i.DARK="dark"})(er||(er={}));const Gn=()=>{const i=(0,b.h_)(b.hg),n=fo(),[o,l]=(0,W.useState)(i.getActiveThemeId()===er.DARK?er.DARK:er.LIGHT),f={[er.LIGHT]:{icon:Qo.Z,title:"Dark theme"},[er.DARK]:{icon:po.Z,title:"Light theme"}},{title:L,icon:Z}=f[o],H=()=>{l(se=>{const He=se===er.LIGHT?er.DARK:er.LIGHT;return i.setActiveThemeId(He),He})};return(0,r.jsx)(Gs.Z,{display:"flex",alignItems:"center",mr:2,children:(0,r.jsx)(Ys.ZP,{title:L,arrow:!0,children:(0,r.jsx)(rs.Z,{size:"small",onClick:H,children:(0,r.jsx)(Z,{className:n.headerIcon})})})})},Xo=()=>(0,r.jsxs)(C.I6,{children:[(0,r.jsx)(U.S,{}),(0,r.jsx)(F.F,{withSearch:!1})]}),qo=(0,r.jsx)(Xo,{}),go=sn({apis:lo,configLoader:Vo,plugins:Object.values(h)}),mo=go.getProvider(),_o=go.getRouter(),Zi=C.s4.provide((0,Le.KY)({name:"ThemeToggleAddon",component:Gn,location:Le.oZ.Header})),Zs=(0,r.jsxs)(Qr,{children:[(0,r.jsx)(g.Fg,{to:"/docs/default/component/local/"},"/"),(0,r.jsx)(g.AW,{path:"/catalog/:namespace/:kind/:name",element:(0,r.jsx)(tr,{})}),(0,r.jsx)(g.AW,{path:"/docs",element:(0,r.jsx)(C.Jl,{}),children:(0,r.jsx)(R.u,{})}),(0,r.jsxs)(g.AW,{path:"/docs/:namespace/:kind/:name/*",element:(0,r.jsx)(C.I6,{}),children:[qo,(0,r.jsx)(Le.DR,{children:(0,r.jsx)(Zi,{})})]})]});var ei=()=>(0,r.jsx)(mo,{children:(0,r.jsx)(_o,{children:(0,r.jsx)(Jo,{children:Zs})})});k.render((0,r.jsx)(ei,{}),document.getElementById("root"))},51837:function(At,Fe,t){"use strict";t.d(Fe,{CT:function(){return b},EI:function(){return te},uW:function(){return k},Vt:function(){return c}});function h(){return typeof window!="undefined"&&window.Math===Math?window:typeof self!="undefined"&&self.Math===Math?self:Function("return this")()}const r=h(),W=_=>`__@backstage/${_}__`;function k(_,X){const U=W(_);let F=r[U];return F||(F=X(),r[U]=F,F)}var g=t(2784);function b(_){return k(_,()=>(0,g.createContext)(void 0))}function c(_){return(0,g.useContext)(b(_))}function P(_){return{set(X){globalThis[`__@backstage/${_}__`]=createContext(createVersionedValueMap(X))},reset(){delete globalThis[`__@backstage/${_}__`]}}}function te(_){Object.freeze(_);const X={atVersion(U){return _[U]}};return Object.defineProperty(X,"$map",{configurable:!0,enumerable:!0,get(){return _}}),X}},56941:function(At,Fe,t){"use strict";t.d(Fe,{h$:function(){return Tt},n3:function(){return h.n3},_i:function(){return V},tW:function(){return Be},df:function(){return me},UO:function(){return vn},dq:function(){return Me},nl:function(){return Ps},dx:function(){return Ge},rI:function(){return Ke},u3:function(){return Nt},xE:function(){return Cn},sL:function(){return wn},LH:function(){return u},U_:function(){return ws},pp:function(){return _r},EW:function(){return zs},Ah:function(){return W},wi:function(){return Le},hF:function(){return ot},CV:function(){return ft},$3:function(){return Qe},p3:function(){return k},ce:function(){return en},X2:function(){return Ot},wp:function(){return hn},ZW:function(){return Ue},N$:function(){return wt},eK:function(){return kn},CR:function(){return ge}});var h=t(29644),r=t(25248);const W=(0,r.T0)({id:"plugin.catalog.service"}),k=(0,r.T0)({id:"catalog-react.starred-entities"});var g=t(82394);class b{async toggleStarred(y){this.starredEntities.delete(y)||this.starredEntities.add(y);for(const I of this.subscribers)I.next(new Set(this.starredEntities))}starredEntitie$(){return this.observable}constructor(){this.starredEntities=new Set,this.subscribers=new Set,this.observable=new ObservableImpl(y=>(y.next(new Set(this.starredEntities)),this.subscribers.add(y),()=>{this.subscribers.delete(y)}))}}var c=t(52322),P=t(2784),te=t(41156),_=t(60364),X=t(77277),U=t(4190),F=t(95544),Y=t(90436),ce=t(60905),oe=t(36444);const T=m=>{const y=(0,te.Z)(J=>J.breakpoints.down("md")),I=(0,_.Z)(),[B,Q]=(0,P.useState)(!1);return y?(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(X.Z,{style:{marginTop:I.spacing(1),marginLeft:I.spacing(1)},onClick:()=>Q(!0),startIcon:(0,c.jsx)(oe.Z,{}),children:"Filters"}),(0,c.jsx)(U.ZP,{open:B,onClose:()=>Q(!1),anchor:"left",disableAutoFocus:!0,keepMounted:!0,variant:"temporary",children:(0,c.jsxs)(F.Z,{m:2,children:[(0,c.jsx)(Y.Z,{variant:"h6",component:"h2",style:{marginBottom:I.spacing(1)},children:"Filters"}),m.children]})})]}):(0,c.jsx)(ce.Z,{item:!0,lg:2,children:m.children})},R=m=>(0,c.jsx)(ce.Z,{item:!0,xs:12,lg:10,children:m.children}),V=m=>(0,c.jsx)(ce.Z,{container:!0,style:{position:"relative"},children:m.children});V.Filters=T,V.Content=R;var A=t(93414),C=t(25271),z=t(51837);const Le=(0,z.uW)("catalog:entity-route-ref",()=>(0,r.NT)({id:"catalog:entity",params:["namespace","kind","name"]}));function Xe(m){var y,I;return{kind:m.kind.toLocaleLowerCase("en-US"),namespace:(I=(y=m.metadata.namespace)===null||y===void 0?void 0:y.toLocaleLowerCase("en-US"))!==null&&I!==void 0?I:DEFAULT_NAMESPACE,name:m.metadata.name}}function Qe(m,y){const I=y==null?void 0:y.defaultKind;let B,Q,J;return"metadata"in m?(B=m.kind,Q=m.metadata.namespace,J=m.metadata.name):(B=m.kind,Q=m.namespace,J=m.name),(Q===void 0||Q==="")&&(Q=C.zG),(y==null?void 0:y.defaultNamespace)!==void 0?(y==null?void 0:y.defaultNamespace)===Q&&(Q=void 0):Q===C.zG&&(Q=void 0),B=B.toLocaleLowerCase("en-US"),B=I&&I.toLocaleLowerCase("en-US")===B?void 0:B,`${B?`${B}:`:""}${Q?`${Q}/`:""}${J}`}var _e=t(80030);const Ge=(0,P.forwardRef)((m,y)=>{const{entityRef:I,defaultKind:B,title:Q,children:J,...re}=m,le=(0,r.tg)(Le);let Se,Ie,je;if(typeof I=="string"){const Ze=(0,C.of)(I);Se=Ze.kind,Ie=Ze.namespace,je=Ze.name}else"metadata"in I?(Se=I.kind,Ie=I.metadata.namespace,je=I.metadata.name):(Se=I.kind,Ie=I.namespace,je=I.name);Se=Se.toLocaleLowerCase("en-US");var we;Ie=(we=Ie==null?void 0:Ie.toLocaleLowerCase("en-US"))!==null&&we!==void 0?we:C.zG;const Ve={kind:Se,namespace:Ie,name:je},ht=Qe({kind:Se,namespace:Ie,name:je},{defaultKind:B}),xt=(0,c.jsxs)(A.rU,{...re,ref:y,to:le(Ve),children:[J,!J&&(Q!=null?Q:ht)]});return Q?(0,c.jsx)(_e.ZP,{title:ht,children:xt}):xt});var gt=t(64279);function Ee(m){const{entityRefs:y,defaultKind:I,getTitle:B,...Q}=m,J=(0,r.h_)(W),{value:re=new Array,loading:le,error:Se}=(0,gt.default)(async()=>{const Ie=y.reduce((we,Ve)=>"metadata"in Ve?we:[...we,(0,C.of)(Ve)],new Array),je=y.filter(we=>"metadata"in we);return Ie.length>0?[...(await J.getEntities({filter:Ie.map(we=>({kind:we.kind,"metadata.namespace":we.namespace,"metadata.name":we.name}))})).items,...je]:je},[y]);return le?(0,c.jsx)(A.Ex,{}):Se?(0,c.jsx)(A.yu,{error:Se}):(0,c.jsx)(c.Fragment,{children:re.map((Ie,je)=>(0,c.jsxs)(P.Fragment,{children:[je>0&&", ",(0,c.jsx)(Ge,{...Q,defaultKind:I,entityRef:Ie,title:B(Ie)})]},je))})}function Ke(m){const{entityRefs:y,defaultKind:I,fetchEntities:B,getTitle:Q,...J}=m;return B?(0,c.jsx)(Ee,{...J,defaultKind:I,entityRefs:y,getTitle:Q}):(0,c.jsx)(c.Fragment,{children:y.map((re,le)=>(0,c.jsxs)(P.Fragment,{children:[le>0&&", ",(0,c.jsx)(Ge,{...J,defaultKind:I,entityRef:re,title:Q?Q(re):void 0})]},le))})}function it(m){return m.reduce((y,I)=>({...y,...I.getCatalogFilters?I.getCatalogFilters():{}}),{})}function mt(m){return y=>m.every(I=>!I.filterEntity||I.filterEntity(y))}function ot(m,y,I){var B;let Q=(m==null||(B=m.relations)===null||B===void 0?void 0:B.filter(J=>J.type===y).map(J=>(0,C.of)(J.targetRef)))||[];return I!=null&&I.kind&&(Q=Q.filter(J=>J.kind.toLocaleLowerCase("en-US")===I.kind.toLocaleLowerCase("en-US"))),Q}function ft(m,y){var I;const B=(I=m.metadata.annotations)===null||I===void 0?void 0:I[C.M6];if(!!B)try{const Q=(0,C.Ou)(B),J=y.byUrl(Q.target);return{locationTargetUrl:Q.target,integrationType:J==null?void 0:J.type}}catch{return}}function nt(m,y){const I=new Set([...getEntityRelations(m,RELATION_MEMBER_OF,{kind:"group"}),...m?[getCompoundEntityRef(m)]:[]].map(stringifyEntityRef)),B=getEntityRelations(y,RELATION_OWNED_BY).map(stringifyEntityRef);for(const Q of B)if(I.has(Q))return!0;return!1}class Lt{getCatalogFilters(){return{kind:this.value}}toQueryValue(){return this.value}constructor(y){this.value=y}}class bt{getTypes(){return Array.isArray(this.value)?this.value:[this.value]}getCatalogFilters(){return{"spec.type":this.getTypes()}}toQueryValue(){return this.getTypes()}constructor(y){this.value=y}}class ze{filterEntity(y){var I;return this.values.every(B=>((I=y.metadata.tags)!==null&&I!==void 0?I:[]).includes(B))}toQueryValue(){return this.values}constructor(y){this.values=y}}class ne{filterEntity(y){const I=this.toUpperArray(this.value.split(/\s/)),B=this.toUpperArray([y.metadata.tags]),Q=this.toUpperArray([y.metadata.name,y.metadata.title]);for(const J of I)if(B.every(re=>re!==J)&&Q.every(re=>!re.includes(J)))return!1;return!0}toUpperArray(y){return y.flat().filter(I=>Boolean(I)).map(I=>I.toLocaleUpperCase("en-US"))}constructor(y){this.value=y}}class Pe{filterEntity(y){return this.values.some(I=>ot(y,C.S4).some(B=>Qe(B,{defaultKind:"group"})===I))}toQueryValue(){return this.values}constructor(y){this.values=y}}class ke{filterEntity(y){return this.values.some(I=>{var B;return((B=y.spec)===null||B===void 0?void 0:B.lifecycle)===I})}toQueryValue(){return this.values}constructor(y){this.values=y}}class tt{filterEntity(y){switch(this.value){case"owned":return this.isOwnedEntity(y);case"starred":return this.isStarredEntity(y);default:return!0}}toQueryValue(){return this.value}constructor(y,I,B){this.value=y,this.isOwnedEntity=I,this.isStarredEntity=B}}class vt{filterEntity(y){var I;const B=(I=y.metadata.annotations)===null||I===void 0?void 0:I["backstage.io/orphan"];return B!==void 0&&this.value.toString()===B}constructor(y){this.value=y}}class Zt{filterEntity(y){var I,B;const Q=(y==null||(I=y.status)===null||I===void 0||(B=I.items)===null||B===void 0?void 0:B.length)>0;return Q!==void 0&&this.value===Q}constructor(y){this.value=y}}const ut=(0,z.CT)("entity-context"),Tt=({children:m,entity:y,loading:I,error:B,refresh:Q})=>{const J={entity:y,loading:I,error:B,refresh:Q};return(0,c.jsx)(ut.Provider,{value:(0,z.EI)({1:J}),children:(0,c.jsx)(r.fC,{attributes:{...y?{entityRef:(0,C.eE)(y)}:void 0},children:m})})},It=m=>_jsx(Tt,{entity:m.entity,loading:!Boolean(m.entity),error:void 0,refresh:void 0,children:m.children});function Ot(){const m=(0,z.Vt)("entity-context");if(!m)throw new Error("Entity context is not available");const y=m.atVersion(1);if(!y)throw new Error("EntityContext v1 not available");if(!y.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:y.entity}}function en(){const m=(0,z.Vt)("entity-context");if(!m)throw new Error("Entity context is not available");const y=m.atVersion(1);if(!y)throw new Error("EntityContext v1 not available");const{entity:I,loading:B,error:Q,refresh:J}=y;return{entity:I,loading:B,error:Q,refresh:J}}var Wt=t(76635),Vt=t(19126),Qt=t.n(Vt),un=t(79635),cn=t(69294),Fn=t(48760),In=t(90736);const Un=(0,P.createContext)(void 0),vn=({children:m})=>{const y=(0,In.default)(),I=(0,r.h_)(W),[B,Q]=(0,P.useState)({}),J=(0,un.TH)();var re;const le=(0,P.useMemo)(()=>(re=Qt().parse(J.search,{ignoreQueryPrefix:!0}).filters)!==null&&re!==void 0?re:{},[J]),[Se,Ie]=(0,P.useState)(()=>({appliedFilters:{},entities:[],backendEntities:[]})),[{loading:je,error:we},Ve]=(0,cn.default)(async()=>{const Ze=(0,Wt.compact)(Object.values(B)),Rt=mt(Ze),Gt=it(Ze),Ln=it((0,Wt.compact)(Object.values(Se.appliedFilters))),jn=Object.keys(B).reduce((En,Zn)=>{const Vn=B[Zn];return Vn!=null&&Vn.toQueryValue&&(En[Zn]=Vn.toQueryValue()),En},{});if((0,Wt.isEqual)(Ln,Gt))Ie({appliedFilters:B,backendEntities:Se.backendEntities,entities:Se.backendEntities.filter(Rt)});else{const En=await I.getEntities({filter:Gt});Ie({appliedFilters:B,backendEntities:En.items,entities:En.items.filter(Rt)})}if(y()){var ar;const En=Qt().parse(J.search,{ignoreQueryPrefix:!0}),Zn=Qt().stringify({...En,filters:jn},{addQueryPrefix:!0,arrayFormat:"repeat"}),Vn=`${window.location.pathname}${Zn}`;(ar=window.history)===null||ar===void 0||ar.replaceState(null,document.title,Vn)}},[I,le,B,Se],{loading:!0});(0,Fn.Z)(Ve,10,[B]);const ht=(0,P.useCallback)(Ze=>{Q(Rt=>{const Gt=typeof Ze=="function"?Ze(Rt):Ze;return{...Rt,...Gt}})},[]),xt=(0,P.useMemo)(()=>({filters:Se.appliedFilters,entities:Se.entities,backendEntities:Se.backendEntities,updateFilters:ht,queryParameters:le,loading:je,error:we}),[Se,ht,le,je,we]);return(0,c.jsx)(Un.Provider,{value:xt,children:m})};function hn(){const m=(0,P.useContext)(Un);if(!m)throw new Error("useEntityList must be used within EntityListProvider");return m}var Xt=t(18149),Mn=t.n(Xt),zn=t(829),pn=t.n(zn);function yn(){const m=(0,r.h_)(W),{filters:{kind:y,type:I},queryParameters:{type:B},updateFilters:Q}=hn(),J=(0,P.useMemo)(()=>[B].flat().filter(Boolean),[B]);var re;const[le,Se]=(0,P.useState)(J.length?J:(re=I==null?void 0:I.getTypes())!==null&&re!==void 0?re:[]);(0,P.useEffect)(()=>{J.length&&Se(J)},[J]);const[Ie,je]=(0,P.useState)([]),we=(0,P.useMemo)(()=>y==null?void 0:y.value,[y]),{error:Ve,loading:ht,value:xt}=(0,gt.default)(async()=>we?await m.getEntityFacets({filter:{kind:we},facets:["spec.type"]}).then(Gt=>Gt.facets["spec.type"]||[]):[],[we,m]),Ze=(0,P.useRef)(xt);return(0,P.useEffect)(()=>{const Rt=Ze.current;if(Ze.current=xt,ht||!we||Rt===xt||!xt)return;const Gt=[...new Set(pn()(xt,jn=>-jn.count).map(jn=>jn.value.toLocaleLowerCase("en-US")))];je(Gt);const Ln=le.filter(jn=>Gt.includes(jn));Mn()(le,Ln)||Se(Ln)},[ht,we,le,Se,xt]),(0,P.useEffect)(()=>{Q({type:le.length?new bt(le):void 0})},[le,Q]),{loading:ht,error:Ve,availableTypes:Ie,selectedTypes:le,setSelectedTypes:Se}}const xn=20;function kn(m,y){var I,B;const Q=y==null||(I=y.type)===null||I===void 0?void 0:I.toLocaleLowerCase("en-US"),J=y==null||(B=y.kind)===null||B===void 0?void 0:B.toLocaleLowerCase("en-US"),re=(0,r.h_)(W),{loading:le,value:Se,error:Ie}=(0,gt.default)(async()=>{var je;const we=(je=m.relations)===null||je===void 0?void 0:je.map(Ze=>({type:Ze.type,target:(0,C.of)(Ze.targetRef)})).filter(Ze=>(!Q||Ze.type.toLocaleLowerCase("en-US")===Q)&&(!J||Ze.target.kind===J));if(!we)return[];const Ve=Object.values((0,Wt.groupBy)(we,({target:Ze})=>`${Ze.kind}:${Ze.namespace}`.toLocaleLowerCase("en-US"))),ht=[];for(const Ze of Ve)ht.push({kind:Ze[0].target.kind,namespace:Ze[0].target.namespace,nameBatches:(0,Wt.chunk)(Ze.map(Rt=>Rt.target.name),xn)});return(await Promise.all(ht.flatMap(Ze=>Ze.nameBatches.map(Rt=>re.getEntities({filter:{kind:Ze.kind,"metadata.namespace":Ze.namespace,"metadata.name":Rt}}))))).flatMap(Ze=>Ze.items)},[m,Q,J]);return{entities:Se,loading:le,error:Ie}}var On=t(72164);function bn(m){return typeof m=="string"?m:(0,C.eE)(m)}function ge(){const m=(0,r.h_)(k),y=(0,On.Z)(m.starredEntitie$(),new Set),I=(0,P.useCallback)(Q=>y.has(bn(Q)),[y]),B=(0,P.useCallback)(Q=>m.toggleStarred(bn(Q)).then(),[m]);return{starredEntities:y,toggleStarredEntity:B,isStarredEntity:I}}function ee(m){return typeof m=="string"?m:(0,C.eE)(m)}function Re(m){const y=(0,r.h_)(k),[I,B]=(0,P.useState)(!1);return(0,P.useEffect)(()=>{const J=y.starredEntitie$().subscribe({next(re){B(re.has(ee(m)))}});return()=>{J.unsubscribe()}},[m,y]),{toggleStarredEntity:(0,P.useCallback)(()=>y.toggleStarred(ee(m)).then(),[m,y]),isStarredEntity:I}}function Ue(){const m=(0,r.h_)(r.$4),{loading:y,value:I}=(0,gt.default)(async()=>{const{ownershipEntityRefs:Q}=await m.getBackstageIdentity();return Q},[]),B=(0,P.useMemo)(()=>{const Q=new Set(I!=null?I:[]);return J=>{const re=ot(J,C.S4).map(C.eE);for(const le of re)if(Q.has(le))return!0;return!1}},[I]);return(0,P.useMemo)(()=>({loading:y,isOwnedEntity:B}),[y,B])}var et=t(25488);function wt(m){const{entity:y,loading:I,error:B}=en(),{allowed:Q,loading:J,error:re}=(0,et.gI)({permission:m,resourceRef:y?(0,C.eE)(y):void 0});return I||J?{loading:!0,allowed:!1}:B?{loading:!1,allowed:!1,error:B}:{loading:!1,allowed:Q,error:re}}function ae(){const m=(0,r.h_)(W),{error:y,loading:I,value:B}=(0,gt.default)(async()=>await m.getEntityFacets({facets:["kind"]}).then(J=>{var re;return((re=J.facets.kind)===null||re===void 0?void 0:re.map(le=>le.value).sort())||[]}),[m]);return{loading:I,error:y,allKinds:B!=null?B:[]}}function O(m,y,I){let B=m;return y&&(B=B.filter(J=>y.some(re=>re.toLocaleLowerCase("en-US")===J.toLocaleLowerCase("en-US")))),I&&!m.some(J=>J.toLocaleLowerCase("en-US")===I.toLocaleLowerCase("en-US"))&&(B=B.concat([I])),B.sort().reduce((J,re)=>(J[re.toLocaleLowerCase("en-US")]=re,J),{})}function de(m){var y;const{filters:I,queryParameters:{kind:B},updateFilters:Q}=hn(),J=(0,P.useMemo)(()=>[B].flat()[0],[B]);var re;const[le,Se]=(0,P.useState)((re=J!=null?J:(y=I.kind)===null||y===void 0?void 0:y.value)!==null&&re!==void 0?re:m.initialFilter);(0,P.useEffect)(()=>{J&&Se(J)},[J]),(0,P.useEffect)(()=>{var Ve;if(!((Ve=I.kind)===null||Ve===void 0)&&Ve.value){var ht;Se((ht=I.kind)===null||ht===void 0?void 0:ht.value)}},[I.kind]),(0,P.useEffect)(()=>{Q({kind:le?new Lt(le):void 0})},[le,Q]);const{allKinds:Ie,loading:je,error:we}=ae();return{loading:je,error:we,allKinds:Ie!=null?Ie:[],selectedKind:le,setSelectedKind:Se}}const Be=m=>{const{allowedKinds:y,hidden:I,initialFilter:B="component"}=m,Q=(0,r.h_)(r.$v),{error:J,allKinds:re,selectedKind:le,setSelectedKind:Se}=de({initialFilter:B});if((0,P.useEffect)(()=>{J&&Q.post({message:"Failed to load entity kinds",severity:"error"})},[J,Q]),J)return null;const Ie=O(re,y,le),je=Object.keys(Ie).map(we=>({value:we,label:Ie[we]}));return I?null:(0,c.jsx)(F.Z,{pb:1,pt:1,children:(0,c.jsx)(A.Ph,{label:"Kind",items:je,selected:le.toLocaleLowerCase("en-US"),onChange:we=>Se(String(we))})})};var D=t(79692),M=t(5806),ue=t(21324),fe=t(86619),be=t(19996),$e=t(25505),Ae=t(38016),We=t(88013);const rt=(0,D.Z)({input:{}},{name:"CatalogReactEntityLifecyclePicker"}),S=(0,c.jsx)($e.Z,{fontSize:"small"}),G=(0,c.jsx)(be.Z,{fontSize:"small"}),me=()=>{var m;const y=rt(),{updateFilters:I,backendEntities:B,filters:Q,queryParameters:{lifecycles:J}}=hn(),re=(0,P.useMemo)(()=>[J].flat().filter(Boolean),[J]);var le;const[Se,Ie]=(0,P.useState)(re.length?re:(le=(m=Q.lifecycles)===null||m===void 0?void 0:m.values)!==null&&le!==void 0?le:[]);(0,P.useEffect)(()=>{re.length&&Ie(re)},[re]);const je=(0,P.useMemo)(()=>[...new Set(B.map(we=>{var Ve;return(Ve=we.spec)===null||Ve===void 0?void 0:Ve.lifecycle}).filter(Boolean))].sort(),[B]);return(0,P.useEffect)(()=>{I({lifecycles:Se.length&&je.length?new ke(Se):void 0})},[Se,I,je]),je.length?(0,c.jsx)(F.Z,{pb:1,pt:1,children:(0,c.jsxs)(Y.Z,{variant:"button",component:"label",children:["Lifecycle",(0,c.jsx)(We.ZP,{multiple:!0,options:je,value:Se,onChange:(we,Ve)=>Ie(Ve),renderOption:(we,{selected:Ve})=>(0,c.jsx)(M.Z,{control:(0,c.jsx)(ue.Z,{icon:S,checkedIcon:G,checked:Ve}),label:we}),size:"small",popupIcon:(0,c.jsx)(Ae.Z,{"data-testid":"lifecycle-picker-expand"}),renderInput:we=>(0,c.jsx)(fe.Z,{...we,className:y.input,variant:"outlined"})})]})}):null},he=(0,D.Z)({input:{}},{name:"CatalogReactEntityOwnerPicker"}),Ce=(0,c.jsx)($e.Z,{fontSize:"small"}),Oe=(0,c.jsx)(be.Z,{fontSize:"small"}),Me=()=>{var m;const y=he(),{updateFilters:I,backendEntities:B,filters:Q,queryParameters:{owners:J}}=hn(),re=(0,P.useMemo)(()=>[J].flat().filter(Boolean),[J]);var le;const[Se,Ie]=(0,P.useState)(re.length?re:(le=(m=Q.owners)===null||m===void 0?void 0:m.values)!==null&&le!==void 0?le:[]);(0,P.useEffect)(()=>{re.length&&Ie(re)},[re]);const je=(0,P.useMemo)(()=>[...new Set(B.flatMap(we=>ot(we,C.S4).map(Ve=>Qe(Ve,{defaultKind:"group"}))).filter(Boolean))].sort(),[B]);return(0,P.useEffect)(()=>{I({owners:Se.length&&je.length?new Pe(Se):void 0})},[Se,I,je]),je.length?(0,c.jsx)(F.Z,{pb:1,pt:1,children:(0,c.jsxs)(Y.Z,{variant:"button",component:"label",children:["Owner",(0,c.jsx)(We.ZP,{multiple:!0,options:je,value:Se,onChange:(we,Ve)=>Ie(Ve),renderOption:(we,{selected:Ve})=>(0,c.jsx)(M.Z,{control:(0,c.jsx)(ue.Z,{icon:Ce,checkedIcon:Oe,checked:Ve}),label:we}),size:"small",popupIcon:(0,c.jsx)(Ae.Z,{"data-testid":"owner-picker-expand"}),renderInput:we=>(0,c.jsx)(fe.Z,{...we,className:y.input,variant:"outlined"})})]})}):null},dt=m=>{const y=useRouteRef(entityRouteRef);return _jsx(IconButton,{component:Link,"aria-label":"Show",title:"Show details",to:y(getCompoundEntityRef(m.entity)),children:_jsx(InfoIcon,{})})},jt=m=>_jsx(IconButton,{component:Link,"aria-label":"Email",title:`Email ${m.email}`,to:`mailto:${m.email}`,children:_jsx(EmailIcon,{})}),at=m=>{var y;const I=(y=m.entity.spec.profile)===null||y===void 0?void 0:y.email;return I?_jsx(EmailCardAction,{email:I}):null},pt=m=>{var y;const I=(y=m.entity.spec.profile)===null||y===void 0?void 0:y.email;return I?_jsx(EmailCardAction,{email:I}):null},yt=(0,D.Z)(()=>({popoverPaper:{width:"30em"},descriptionTypography:{overflow:"hidden",textOverflow:"ellipsis",display:"-webkit-box",WebkitLineClamp:2,WebkitBoxOrient:"vertical"}})),lt=4,Bt=m=>{var y,I,B;const{entityRef:Q,children:J,delayTime:re=500}=m,le=yt(),Se=useApiHolder(),Ie=usePopupState({variant:"popover",popupId:"entity-peek-ahead"}),[je,we]=useState(!1),Ve=useMemo(()=>debounce(()=>we(!0),re),[re]),[{loading:ht,error:xt,value:Ze},Rt]=useAsyncFn(async()=>{const Ln=Se.get(catalogApiRef);if(Ln){const jn=await Ln.getEntityByRef(Q);if(!jn)throw new Error(`${Q} not found`);return jn}},[Se,Q]),Gt=()=>{we(!1),Ve.cancel()};return useEffect(()=>{Ie.isOpen&&!Ze&&!xt&&!ht&&Rt()},[Ie.isOpen,Rt,Ze,xt,ht]),_jsxs(_Fragment,{children:[_jsx(Typography,{component:"span",onMouseEnter:Ve,children:_jsx(Typography,{component:"span","data-testid":"trigger",...bindHover(Ie),children:J})}),je&&_jsx(HoverPopover,{PaperProps:{className:le.popoverPaper},...bindPopover(Ie),anchorOrigin:{vertical:"bottom",horizontal:"center"},transformOrigin:{vertical:"top",horizontal:"center"},onMouseLeave:Gt,children:_jsxs(Card,{children:[_jsxs(CardContent,{children:[xt&&_jsx(ResponseErrorPanel,{error:xt}),ht&&_jsx(Progress,{}),Ze&&_jsxs(_Fragment,{children:[_jsx(Typography,{color:"textSecondary",children:Ze.metadata.namespace}),_jsx(Typography,{variant:"h5",component:"div",children:Ze.metadata.name}),_jsx(Typography,{color:"textSecondary",gutterBottom:!0,children:Ze.kind}),Ze.metadata.description&&_jsx(Typography,{className:le.descriptionTypography,paragraph:!0,children:Ze.metadata.description}),_jsx(Typography,{children:(y=Ze.spec)===null||y===void 0?void 0:y.type}),_jsxs(Box,{marginTop:"0.5em",children:[(Ze.metadata.tags||[]).slice(0,lt).map(Ln=>_jsx(Chip,{size:"small",label:Ln},Ln)),((I=Ze.metadata.tags)===null||I===void 0?void 0:I.length)&&((B=Ze.metadata.tags)===null||B===void 0?void 0:B.length)>lt&&_jsx(Tooltip,{title:"Drill into the entity to see all of the tags.",children:_jsx(Chip,{size:"small",label:"..."},"other-tags")})]})]})]}),!xt&&Ze&&_jsx(CardActions,{children:_jsxs(_Fragment,{children:[isUserEntity(Ze)&&_jsx(UserCardActions,{entity:Ze}),isGroupEntity(Ze)&&_jsx(GroupCardActions,{entity:Ze}),_jsx(EntityCardActions,{entity:Ze})]})})]})})]})},Mt=(0,D.Z)(m=>({searchToolbar:{paddingLeft:0,paddingRight:0},input:{}}),{name:"CatalogReactEntitySearchBar"}),zt=()=>{var m;const y=Mt(),{filters:I,updateFilters:B}=useEntityList();var Q;const[J,re]=useState((Q=(m=I.text)===null||m===void 0?void 0:m.value)!==null&&Q!==void 0?Q:"");return useDebounce(()=>{B({text:J.length?new EntityTextFilter(J):void 0})},250,[J,B]),_jsx(Toolbar,{className:y.searchToolbar,children:_jsx(FormControl,{children:_jsx(Input,{"aria-label":"search",id:"input-with-icon-adornment",className:y.input,placeholder:"Search",autoComplete:"off",onChange:le=>re(le.target.value),value:J,startAdornment:_jsx(InputAdornment,{position:"start",children:_jsx(Search,{})}),endAdornment:_jsx(InputAdornment,{position:"end",children:_jsx(IconButton,{"aria-label":"clear search",onClick:()=>re(""),edge:"end",disabled:J.length===0,children:_jsx(Clear,{})})})})})})},qt=Object.freeze({createEntityRefColumn(m){const{defaultKind:y}=m;function I(B){var Q;return((Q=B.metadata)===null||Q===void 0?void 0:Q.title)||Qe(B,{defaultKind:y})}return{title:"Name",highlight:!0,customFilterAndSearch(B,Q){return I(Q).includes(B)},customSort(B,Q){return I(B).localeCompare(I(Q))},render:B=>{var Q;return(0,c.jsx)(Ge,{entityRef:B,defaultKind:y,title:(Q=B.metadata)===null||Q===void 0?void 0:Q.title})}}},createEntityRelationColumn(m){const{title:y,relation:I,defaultKind:B,filter:Q}=m;function J(le){return ot(le,I,Q)}function re(le){return J(le).map(Se=>Qe(Se,{defaultKind:B})).join(", ")}return{title:y,customFilterAndSearch(le,Se){return re(Se).includes(le)},customSort(le,Se){return re(le).localeCompare(re(Se))},render:le=>(0,c.jsx)(Ke,{entityRefs:J(le),defaultKind:B})}},createOwnerColumn(){return this.createEntityRelationColumn({title:"Owner",relation:C.S4,defaultKind:"group"})},createDomainColumn(){return this.createEntityRelationColumn({title:"Domain",relation:C.cz,defaultKind:"domain",filter:{kind:"domain"}})},createSystemColumn(){return this.createEntityRelationColumn({title:"System",relation:C.cz,defaultKind:"system",filter:{kind:"system"}})},createMetadataDescriptionColumn(){return{title:"Description",field:"metadata.description",render:m=>(0,c.jsx)(A.Or,{text:m.metadata.description,placement:"bottom-start",line:2})}},createSpecLifecycleColumn(){return{title:"Lifecycle",field:"spec.lifecycle"}},createSpecTypeColumn(){return{title:"Type",field:"spec.type"}}}),Wn=[qt.createEntityRefColumn({defaultKind:"system"}),qt.createDomainColumn(),qt.createOwnerColumn(),qt.createMetadataDescriptionColumn()],Sn=[qt.createEntityRefColumn({defaultKind:"component"}),qt.createSystemColumn(),qt.createOwnerColumn(),qt.createSpecTypeColumn(),qt.createSpecLifecycleColumn(),qt.createMetadataDescriptionColumn()],Dt=(0,D.Z)(m=>({empty:{padding:m.spacing(2),display:"flex",justifyContent:"center"}})),Nt=m=>{const{entities:y,title:I,emptyContent:B,variant:Q="gridItem",columns:J}=m,re=Dt(),le={minWidth:"0",width:"100%"};return Q==="gridItem"&&(le.height="calc(100% - 10px)"),(0,c.jsx)(A.iA,{columns:J,title:I,style:le,emptyContent:B&&(0,c.jsx)("div",{className:re.empty,children:B}),options:{search:!1,paging:!1,actionsColumnIndex:-1,padding:"dense",draggable:!1},data:y})};Nt.columns=qt,Nt.systemEntityColumns=Wn,Nt.componentEntityColumns=Sn;const rn=(0,D.Z)({input:{}},{name:"CatalogReactEntityTagPicker"}),Bn=(0,c.jsx)($e.Z,{fontSize:"small"}),Xn=(0,c.jsx)(be.Z,{fontSize:"small"}),Cn=m=>{var y;const I=rn(),{updateFilters:B,filters:Q,queryParameters:{tags:J}}=hn(),re=(0,r.h_)(W),{value:le}=(0,gt.default)(async()=>{var Ve;const ht="metadata.tags",{facets:xt}=await re.getEntityFacets({facets:[ht],filter:(Ve=Q.kind)===null||Ve===void 0?void 0:Ve.getCatalogFilters()});return Object.fromEntries(xt[ht].map(({value:Ze,count:Rt})=>[Ze,Rt]))},[Q.kind]),Se=(0,P.useMemo)(()=>[J].flat().filter(Boolean),[J]);var Ie;const[je,we]=(0,P.useState)(Se.length?Se:(Ie=(y=Q.tags)===null||y===void 0?void 0:y.values)!==null&&Ie!==void 0?Ie:[]);return(0,P.useEffect)(()=>{Se.length&&we(Se)},[Se]),(0,P.useEffect)(()=>{const Ve=Object.keys(le!=null?le:{});B({tags:je.length&&Ve.length?new ze(je):void 0})},[je,B,le]),Object.keys(le!=null?le:{}).length?(0,c.jsx)(F.Z,{pb:1,pt:1,children:(0,c.jsxs)(Y.Z,{variant:"button",component:"label",children:["Tags",(0,c.jsx)(We.ZP,{multiple:!0,options:Object.keys(le!=null?le:{}),value:je,onChange:(Ve,ht)=>we(ht),renderOption:(Ve,{selected:ht})=>(0,c.jsx)(M.Z,{control:(0,c.jsx)(ue.Z,{icon:Bn,checkedIcon:Xn,checked:ht}),label:m.showCounts?`${Ve} (${le==null?void 0:le[Ve]})`:Ve}),size:"small",popupIcon:(0,c.jsx)(Ae.Z,{"data-testid":"tag-picker-expand"}),renderInput:Ve=>(0,c.jsx)(fe.Z,{...Ve,className:I.input,variant:"outlined"})})]})}):null},wn=m=>{const{hidden:y,initialFilter:I}=m,B=(0,r.h_)(r.$v),{error:Q,availableTypes:J,selectedTypes:re,setSelectedTypes:le}=yn();if((0,P.useEffect)(()=>{Q&&B.post({message:"Failed to load entity types",severity:"error"}),I&&le([I])},[Q,B,I,le]),J.length===0||Q)return null;const Se=[{value:"all",label:"all"},...J.map(je=>({value:je,label:je}))];var Ie;return y?null:(0,c.jsx)(F.Z,{pb:1,pt:1,children:(0,c.jsx)(A.Ph,{label:"Type",items:Se,selected:(Ie=Se.length>1?re[0]:void 0)!==null&&Ie!==void 0?Ie:"all",onChange:je=>le(je==="all"?[]:[String(je)])})})};var Yn=t(15459),fn=t(61837),Rn=t(11640),dr=t(28347);const w=(0,Yn.Z)({root:{color:"#f3ba37"}})(Rn.Z),u=m=>{const{toggleStarredEntity:y,isStarredEntity:I}=Re(m.entity);return(0,c.jsx)(fn.Z,{"aria-label":"favorite",color:"inherit",...m,onClick:()=>y(),children:(0,c.jsx)(_e.ZP,{title:I?"Remove from favorites":"Add to favorites",children:I?(0,c.jsx)(w,{}):(0,c.jsx)(dr.Z,{})})})};var x=t(8629),E=t(79249),q=t(38724),ve=t(99152),ye=t(6487),Ne=t(49429),Je=t(55999),Ft=t(72779),Ht=t.n(Ft),$n=t(39412);const ur=$n.Z;function hs(m,y){if(m)return m.toLocaleLowerCase("en-US");if(y)try{return(0,C.of)(y).kind.toLocaleLowerCase("en-US")}catch{return}}function ps(m,y){const I=(0,r.qD)(),B=hs(m,y);return B&&I.getSystemIcon(`kind:${B}`)||ur}function Rr(m){const{kind:y,entityRef:I,...B}=m,Q=ps(y,I);return(0,c.jsx)(Q,{...B})}const hr=(0,D.Z)(m=>({node:{fill:m.palette.grey[300],stroke:m.palette.grey[300],"&.primary":{fill:m.palette.primary.light,stroke:m.palette.primary.light},"&.secondary":{fill:m.palette.secondary.light,stroke:m.palette.secondary.light}},text:{fill:m.palette.getContrastText(m.palette.grey[300]),"&.primary":{fill:m.palette.primary.contrastText},"&.secondary":{fill:m.palette.secondary.contrastText},"&.focused":{fontWeight:"bold"}},clickable:{cursor:"pointer"}}));function Lr(m){const y=(0,r.h_)(W),I=(0,C.eE)(m),{loading:B,error:Q,value:J}=(0,gt.default)(async()=>{const re=await y.getEntityAncestors({entityRef:I}),le=new Array,Se=new Array;for(const Ie of re.items){const je=(0,C.eE)(Ie.entity),we=je===re.rootEntityRef;le.push({id:je,root:we,...Ie.entity});for(const Ve of Ie.parentEntityRefs)Se.push({from:je,to:Ve})}return{nodes:le,edges:Se}},[I]);return{loading:B,error:Q,nodes:(J==null?void 0:J.nodes)||[],edges:(J==null?void 0:J.edges)||[]}}function Vr({node:m}){const y=hr(),I=(0,un.s0)(),B=(0,r.tg)(Le),[Q,J]=(0,P.useState)(0),[re,le]=(0,P.useState)(0),Se=(0,P.useRef)(null);(0,P.useLayoutEffect)(()=>{if(Se.current){let{height:Rt,width:Gt}=Se.current.getBBox();Rt=Math.round(Rt),Gt=Math.round(Gt),(Rt!==re||Gt!==Q)&&(J(Gt),le(Rt))}},[Q,re]);const Ie=10,je=re,we=je+Ie,Ve=we+Q+Ie*2,ht=re+Ie*2,xt=m.metadata.title||(m.kind&&m.metadata.name&&m.metadata.namespace?Qe({kind:m.kind,name:m.metadata.name,namespace:m.metadata.namespace||""}):m.id),Ze=()=>{I(B({kind:m.kind,namespace:m.metadata.namespace||C.zG,name:m.metadata.name}))};return(0,c.jsxs)("g",{onClick:Ze,className:y.clickable,children:[(0,c.jsx)("rect",{className:Ht()(y.node,m.root?"secondary":"primary"),width:Ve,height:ht,rx:10}),(0,c.jsx)(Rr,{kind:m.kind,y:Ie,x:Ie,width:je,height:je,className:Ht()(y.text,m.root?"secondary":"primary")}),(0,c.jsx)("text",{ref:Se,className:Ht()(y.text,m.root?"secondary":"primary"),y:ht/2,x:we+(Q+Ie*2)/2,textAnchor:"middle",alignmentBaseline:"middle",children:xt})]})}function Pr(m){const{loading:y,error:I,nodes:B,edges:Q}=Lr(m.entity);return y?(0,c.jsx)(A.Ex,{}):I?(0,c.jsx)(A.Gk,{error:I}):(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(Je.Z,{variant:"h2",children:"Ancestry"}),(0,c.jsxs)(Je.Z,{gutterBottom:!0,children:["This is the ancestry of entities above the current one - as in, the chain(s) of entities down to the current one, where"," ",(0,c.jsx)(A.rU,{to:"https://backstage.io/docs/features/software-catalog/life-of-an-entity",children:"processors emitted"})," ","child entities that ultimately led to the current one existing. Note that this is a completely different mechanism from relations."]}),(0,c.jsx)(F.Z,{mt:4,children:(0,c.jsx)(A.mn,{nodes:B,edges:Q,renderNode:Vr,direction:A.NX.Nm.BOTTOM_TOP,zoom:"enable-on-click"})})]})}var Jn=t(11776),qn=t(38402),pr=t(86136),kr=t(99688),Hr=t(49378),Us=t(54506),Or=t(94339),fs=t(24579),gs=t(27685);const Cr=(0,D.Z)(m=>({root:{display:"flex",flexDirection:"column"},marginTop:{marginTop:m.spacing(2)},helpIcon:{marginLeft:m.spacing(1),color:m.palette.text.disabled},monospace:{fontFamily:"monospace"}}));function gn(m){const y=Cr();return(0,c.jsx)(Hr.Z,{...m,primaryTypographyProps:{className:y.monospace},secondaryTypographyProps:{className:y.monospace}})}function or(m){const y=Cr();return(0,c.jsx)(Us.Z,{className:y.monospace,children:m.children})}function Br(m){return(0,c.jsx)(F.Z,{mt:2,children:(0,c.jsx)(Or.Z,{variant:"outlined",children:(0,c.jsxs)(fs.Z,{children:[(0,c.jsxs)(Y.Z,{variant:"h6",gutterBottom:!0,children:[m.title,m.helpLink&&(0,c.jsx)(vs,{to:m.helpLink})]}),m.children]})})})}function ms(m){if(m.match(/^url:https?:\/\//))return m.slice(4);if(m.match(/^https?:\/\//))return m}function $r(m){const[y,I]=m.entry,B=ms(I);return(0,c.jsxs)(qn.Z,{children:[m.indent&&(0,c.jsx)(pr.Z,{}),(0,c.jsx)(gn,{primary:y,secondary:B?(0,c.jsx)(A.rU,{to:B,children:I}):I})]})}function vs(m){const y=Cr();return(0,c.jsx)(A.rU,{to:m.to,className:y.helpIcon,children:(0,c.jsx)(gs.Z,{fontSize:"inherit"})})}const ys=(0,D.Z)({root:{display:"flex",flexDirection:"column"}});function Gr(m){var y,I;const B=(0,r.h_)(W),Q=(0,C.eE)(m),J=(y=m.metadata.annotations)===null||y===void 0?void 0:y[C.P1],re=(I=m.metadata.annotations)===null||I===void 0?void 0:I[C.q1],{loading:le,error:Se,value:Ie}=(0,gt.default)(async()=>!J&&!re?[]:(await B.getEntities({filter:[...J?[{[`metadata.annotations.${C.P1}`]:J}]:[],...re?[{[`metadata.annotations.${C.q1}`]:re}]:[]]})).items,[J,re]);return{loading:le,error:Se,location:J,originLocation:re,colocatedEntities:Ie==null?void 0:Ie.filter(je=>(0,C.eE)(je)!==Q)}}function Kr(m){return(0,c.jsxs)(Jn.Z,{dense:!0,children:[m.header&&(0,c.jsx)($r,{entry:m.header},"header"),m.entities.map(y=>(0,c.jsxs)(qn.Z,{children:[(0,c.jsx)(pr.Z,{children:(0,c.jsx)(Rr,{kind:y.kind})}),(0,c.jsx)(gn,{primary:(0,c.jsx)(Ge,{entityRef:y})})]},(0,C.eE)(y)))]})}function ir(m){const{entity:y}=m,{loading:I,error:B,location:Q,originLocation:J,colocatedEntities:re}=Gr(y);if(I)return(0,c.jsx)(A.Ex,{});if(B)return(0,c.jsx)(A.Gk,{error:B});if(!Q&&!J)return(0,c.jsx)(kr.Z,{severity:"warning",children:"Entity had no location information."});if(!(re!=null&&re.length))return(0,c.jsx)(kr.Z,{severity:"info",children:"There were no other entities on this location."});if(Q===J)return(0,c.jsx)(Kr,{entities:re});const le=re.filter(Ie=>{var je;return((je=Ie.metadata.annotations)===null||je===void 0?void 0:je[C.P1])===Q}),Se=re.filter(Ie=>{var je;return((je=Ie.metadata.annotations)===null||je===void 0?void 0:je[C.q1])===J});return(0,c.jsxs)(c.Fragment,{children:[le.length>0&&(0,c.jsx)(Kr,{entities:le,header:["At the same location",Q]}),Se.length>0&&(0,c.jsx)(Kr,{entities:Se,header:["At the same origin",J]})]})}function xs(m){const y=ys();return(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(Je.Z,{variant:"h2",children:"Colocated"}),(0,c.jsx)(Je.Z,{children:"These are the entities that are colocated with this entity - as in, they originated from the same data source (e.g. came from the same YAML file), or from the same origin (e.g. the originally registered URL)."}),(0,c.jsx)("div",{className:y.root,children:(0,c.jsx)(ir,{entity:m.entity})})]})}function Yr(m){return Object.fromEntries([...Object.entries(m)].sort((y,I)=>y[0]<I[0]?-1:1))}function bs(m){return(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(Je.Z,{variant:"h2",children:"Entity as JSON"}),(0,c.jsx)(Je.Z,{children:"This is the raw entity data as received from the catalog, on JSON form."}),(0,c.jsx)(Je.Z,{children:(0,c.jsx)("div",{style:{fontSize:"75%"},"data-testid":"code-snippet",children:(0,c.jsx)(A.Oi,{text:JSON.stringify(Yr(m.entity),void 0,2),language:"json",showCopyCodeButton:!0})})})]})}var Zr=t(3440),Ss=t.n(Zr);const Cs=(0,D.Z)({root:{display:"flex",flexDirection:"column"}});function Jr(m){var y,I;const B=Cs(),{apiVersion:Q,kind:J,metadata:re,spec:le,relations:Se=[],status:Ie={}}=m.entity,je=Ss()(pn()(Se,we=>we.targetRef),"type");return(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(Je.Z,{variant:"h2",children:"Overview"}),(0,c.jsxs)("div",{className:B.root,children:[(0,c.jsx)(Br,{title:"Identity",children:(0,c.jsxs)(Jn.Z,{dense:!0,children:[(0,c.jsx)(qn.Z,{children:(0,c.jsx)(gn,{primary:"apiVersion",secondary:Q})}),(0,c.jsx)(qn.Z,{children:(0,c.jsx)(gn,{primary:"kind",secondary:J})}),(le==null?void 0:le.type)&&(0,c.jsx)(qn.Z,{children:(0,c.jsx)(gn,{primary:"spec.type",secondary:le.type})}),re.uid&&(0,c.jsx)(qn.Z,{children:(0,c.jsx)(gn,{primary:"uid",secondary:re.uid})}),re.etag&&(0,c.jsx)(qn.Z,{children:(0,c.jsx)(gn,{primary:"etag",secondary:re.etag})})]})}),(0,c.jsxs)(Br,{title:"Metadata",children:[!!Object.keys(re.annotations||{}).length&&(0,c.jsx)(Jn.Z,{dense:!0,subheader:(0,c.jsxs)(or,{children:["Annotations",(0,c.jsx)(vs,{to:"https://backstage.io/docs/features/software-catalog/well-known-annotations"})]}),children:Object.entries(re.annotations).map(we=>(0,c.jsx)($r,{indent:!0,entry:we},we[0]))}),!!Object.keys(re.labels||{}).length&&(0,c.jsx)(Jn.Z,{dense:!0,subheader:(0,c.jsx)(or,{children:"Labels"}),children:Object.entries(re.labels).map(we=>(0,c.jsx)($r,{indent:!0,entry:we},we[0]))}),!!(!((y=re.tags)===null||y===void 0)&&y.length)&&(0,c.jsx)(Jn.Z,{dense:!0,subheader:(0,c.jsx)(or,{children:"Tags"}),children:re.tags.map((we,Ve)=>(0,c.jsxs)(qn.Z,{children:[(0,c.jsx)(pr.Z,{}),(0,c.jsx)(gn,{primary:we})]},`${we}-${Ve}`))})]}),!!Se.length&&(0,c.jsx)(Br,{title:"Relations",helpLink:"https://backstage.io/docs/features/software-catalog/well-known-relations",children:Object.entries(je).map(([we,Ve],ht)=>(0,c.jsx)("div",{children:(0,c.jsx)(Jn.Z,{dense:!0,subheader:(0,c.jsx)(or,{children:we}),children:Ve.map(xt=>(0,c.jsxs)(qn.Z,{children:[(0,c.jsx)(pr.Z,{children:(0,c.jsx)(Rr,{entityRef:xt.targetRef})}),(0,c.jsx)(gn,{primary:(0,c.jsx)(Ge,{entityRef:xt.targetRef})})]},xt.targetRef))})},ht))}),!!(!((I=Ie.items)===null||I===void 0)&&I.length)&&(0,c.jsx)(Br,{title:"Status",helpLink:"https://backstage.io/docs/features/software-catalog/well-known-statuses",children:Ie.items.map((we,Ve)=>(0,c.jsxs)("div",{children:[(0,c.jsxs)(Y.Z,{children:[we.level,": ",we.type]}),(0,c.jsx)(F.Z,{ml:2,children:we.message})]},Ve))})]})]})}var Qr=t(72847);function Xr(m){return(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(Je.Z,{variant:"h2",children:"Entity as YAML"}),(0,c.jsx)(Je.Z,{children:"This is the raw entity data as received from the catalog, on YAML form."}),(0,c.jsx)(Je.Z,{children:(0,c.jsx)("div",{style:{fontSize:"75%"},"data-testid":"code-snippet",children:(0,c.jsx)(A.Oi,{text:Qr.ZP.stringify(Yr(m.entity)),language:"yaml",showCopyCodeButton:!0})})})]})}const Dr=(0,D.Z)(m=>({fullHeightDialog:{height:"calc(100% - 64px)"},root:{display:"flex",flexGrow:1,width:"100%",backgroundColor:m.palette.background.paper},tabs:{borderRight:`1px solid ${m.palette.divider}`,flexShrink:0},tabContents:{flexGrow:1,overflowX:"auto"}}));function on(m){const{children:y,value:I,index:B,...Q}=m,J=Dr();return(0,c.jsx)("div",{role:"tabpanel",hidden:I!==B,id:`vertical-tabpanel-${B}`,"aria-labelledby":`vertical-tab-${B}`,className:J.tabContents,...Q,children:I===B&&(0,c.jsx)(F.Z,{pl:3,pr:3,children:y})})}function Ut(m){return{id:`vertical-tab-${m}`,"aria-controls":`vertical-tabpanel-${m}`}}function ws(m){const y=Dr(),[I,B]=P.useState(0);return(0,P.useEffect)(()=>{B(0)},[m.open]),m.entity?(0,c.jsxs)(x.Z,{fullWidth:!0,maxWidth:"xl",open:m.open,onClose:m.onClose,"aria-labelledby":"entity-inspector-dialog-title",PaperProps:{className:y.fullHeightDialog},children:[(0,c.jsx)(E.Z,{id:"entity-inspector-dialog-title",children:"Entity Inspector"}),(0,c.jsx)(q.Z,{dividers:!0,children:(0,c.jsxs)("div",{className:y.root,children:[(0,c.jsxs)(ve.Z,{orientation:"vertical",variant:"scrollable",value:I,onChange:(Q,J)=>B(J),"aria-label":"Inspector options",className:y.tabs,children:[(0,c.jsx)(ye.Z,{label:"Overview",...Ut(0)}),(0,c.jsx)(ye.Z,{label:"Ancestry",...Ut(1)}),(0,c.jsx)(ye.Z,{label:"Colocated",...Ut(2)}),(0,c.jsx)(ye.Z,{label:"Raw JSON",...Ut(3)}),(0,c.jsx)(ye.Z,{label:"Raw YAML",...Ut(4)})]}),(0,c.jsx)(on,{value:I,index:0,children:(0,c.jsx)(Jr,{entity:m.entity})}),(0,c.jsx)(on,{value:I,index:1,children:(0,c.jsx)(Pr,{entity:m.entity})}),(0,c.jsx)(on,{value:I,index:2,children:(0,c.jsx)(xs,{entity:m.entity})}),(0,c.jsx)(on,{value:I,index:3,children:(0,c.jsx)(bs,{entity:m.entity})}),(0,c.jsx)(on,{value:I,index:4,children:(0,c.jsx)(Xr,{entity:m.entity})})]})}),(0,c.jsx)(Ne.Z,{children:(0,c.jsx)(X.Z,{onClick:m.onClose,color:"primary",children:"Close"})})]}):null}var js=t(85256);function Es(m){var y;const I=(0,r.h_)(W),B=(y=m.metadata.annotations)===null||y===void 0?void 0:y[C.q1],Q=m.metadata.uid,J=B==="bootstrap:bootstrap",re=(0,gt.default)(async()=>{const xt=I.getLocationByRef(B);let Ze;if(!B)Ze=Promise.resolve([]);else{const Rt=`metadata.annotations.${C.q1}`;Ze=I.getEntities({filter:{[Rt]:B},fields:["kind","metadata.uid","metadata.name","metadata.namespace"]}).then(Gt=>Gt.items)}return Promise.all([xt,Ze]).then(([Rt,Gt])=>({location:Rt,colocatedEntities:Gt}))},[I,m]),le=(0,P.useCallback)(async function(){const{location:Ze}=re.value;await I.removeLocationById(Ze.id)},[I,re]),Se=(0,P.useCallback)(async function(){await I.removeEntityByUid(Q)},[I,Q]);if(J)return{type:"bootstrap",location:B,deleteEntity:Se};const{loading:Ie,error:je,value:we}=re;if(Ie)return{type:"loading"};if(je)return{type:"error",error:je};const{location:Ve,colocatedEntities:ht}=we;return Ve?{type:"unregister",location:B,colocatedEntities:ht.map(C.iB),unregisterLocation:le,deleteEntity:Se}:{type:"only-delete",deleteEntity:Se}}var qr=t(23054);const As=(0,D.Z)({advancedButton:{fontSize:"0.7em"}}),Ts=({entity:m,onConfirm:y})=>{const I=(0,r.h_)(r.$v),B=(0,r.h_)(r.Ds),Q=As(),J=Es(m),[re,le]=(0,P.useState)(!1),[Se,Ie]=(0,P.useState)(!1);var je;const we=(je=B.getOptionalString("app.title"))!==null&&je!==void 0?je:"Backstage",Ve=(0,P.useCallback)(async function(){if("unregisterLocation"in J){Ie(!0);try{await J.unregisterLocation(),y()}catch(Ze){(0,qr.BD)(Ze),I.post({message:Ze.message})}finally{Ie(!1)}}},[I,y,J]),ht=(0,P.useCallback)(async function(){if("deleteEntity"in J){Ie(!0);try{await J.deleteEntity(),y()}catch(Ze){(0,qr.BD)(Ze),I.post({message:Ze.message})}finally{Ie(!1)}}},[I,y,J]);return J.type==="loading"?(0,c.jsx)(A.Ex,{}):J.type==="error"?(0,c.jsx)(A.Gk,{error:J.error}):J.type==="bootstrap"?(0,c.jsxs)(c.Fragment,{children:[(0,c.jsxs)(kr.Z,{severity:"info",children:['You cannot unregister this entity, since it originates from a protected Backstage configuration (location "',J.location,'"). If you believe this is in error, please contact the ',we," ","integrator."]}),(0,c.jsxs)(F.Z,{marginTop:2,children:[!re&&(0,c.jsx)(X.Z,{variant:"text",size:"small",color:"primary",className:Q.advancedButton,onClick:()=>le(!0),children:"Advanced Options"}),re&&(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(Je.Z,{children:"You have the option to delete the entity itself from the catalog. Note that this should only be done if you know that the catalog file has been deleted at, or moved from, its origin location. If that is not the case, the entity will reappear shortly as the next refresh round is performed by the catalog."}),(0,c.jsx)(X.Z,{variant:"contained",color:"secondary",disabled:Se,onClick:ht,children:"Delete Entity"})]})]})]}):J.type==="only-delete"?(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(Je.Z,{children:"This entity does not seem to originate from a registered location. You therefore only have the option to delete it outright from the catalog."}),(0,c.jsx)(X.Z,{variant:"contained",color:"secondary",disabled:Se,onClick:ht,children:"Delete Entity"})]}):J.type==="unregister"?(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(Je.Z,{children:"This action will unregister the following entities:"}),(0,c.jsx)(Je.Z,{component:"ul",children:J.colocatedEntities.map(xt=>(0,c.jsx)("li",{children:(0,c.jsx)(Ge,{entityRef:xt})},`${xt.kind}:${xt.namespace}/${xt.name}`))}),(0,c.jsx)(Je.Z,{children:"Located at the following location:"}),(0,c.jsx)(Je.Z,{component:"ul",children:(0,c.jsx)("li",{children:J.location})}),(0,c.jsxs)(Je.Z,{children:["To undo, just re-register the entity in ",we,"."]}),(0,c.jsxs)(F.Z,{marginTop:2,children:[(0,c.jsx)(X.Z,{variant:"contained",color:"secondary",disabled:Se,onClick:Ve,children:"Unregister Location"}),!re&&(0,c.jsx)(F.Z,{component:"span",marginLeft:2,children:(0,c.jsx)(X.Z,{variant:"text",size:"small",color:"primary",className:Q.advancedButton,onClick:()=>le(!0),children:"Advanced Options"})})]}),re&&(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(F.Z,{paddingTop:4,paddingBottom:4,children:(0,c.jsx)(js.Z,{})}),(0,c.jsx)(Je.Z,{children:"You also have the option to delete the entity itself from the catalog. Note that this should only be done if you know that the catalog file has been deleted at, or moved from, its origin location. If that is not the case, the entity will reappear shortly as the next refresh round is performed by the catalog."}),(0,c.jsx)(X.Z,{variant:"contained",color:"secondary",disabled:Se,onClick:ht,children:"Delete Entity"})]})]}):(0,c.jsx)(kr.Z,{severity:"error",children:"Internal error: Unknown state"})},_r=m=>{const{open:y,onConfirm:I,onClose:B,entity:Q}=m;return(0,c.jsxs)(x.Z,{open:y,onClose:B,children:[(0,c.jsx)(E.Z,{id:"responsive-dialog-title",children:"Are you sure you want to unregister this entity?"}),(0,c.jsx)(q.Z,{children:(0,c.jsx)(Ts,{entity:Q,onConfirm:I})}),(0,c.jsx)(Ne.Z,{children:(0,c.jsx)(X.Z,{onClick:B,color:"primary",children:"Cancel"})})]})};var wr=t(12231),Ms=t(9520),Is=t(47603);const es=(0,D.Z)(m=>({root:{backgroundColor:"rgba(0, 0, 0, .11)",boxShadow:"none",margin:m.spacing(1,0,1,0)},title:{margin:m.spacing(1,0,0,1),textTransform:"uppercase",fontSize:12,fontWeight:"bold"},listIcon:{minWidth:30,color:m.palette.text.primary},menuItem:{minHeight:m.spacing(6)},groupWrapper:{margin:m.spacing(1,1,2,1)}}),{name:"CatalogReactUserListPicker"});function Rs(m){return[{name:"Personal",items:[{id:"owned",label:"Owned",icon:Is.Z},{id:"starred",label:"Starred",icon:Rn.Z}]},{name:m!=null?m:"Company",items:[{id:"all",label:"All"}]}]}const zs=m=>{const{initialFilter:y,availableFilters:I}=m,B=es(),Q=(0,r.h_)(r.Ds);var J;const re=(J=Q.getOptionalString("organization.name"))!==null&&J!==void 0?J:"Company",{filters:le,updateFilters:Se,backendEntities:Ie,queryParameters:{kind:je,user:we},loading:Ve}=hn(),ht=["starred","all"],xt=Rs(re).map(sn=>({...sn,items:sn.items.filter(({id:Pn})=>["group","user"].some(gr=>gr===je)?ht.includes(Pn):!I||I.includes(Pn))})).filter(({items:sn})=>!!sn.length),{isStarredEntity:Ze}=ge(),{isOwnedEntity:Rt,loading:Gt}=Ue(),Ln=Ve||Gt,jn=(0,P.useMemo)(()=>new tt("owned",Rt,Ze),[Rt,Ze]),ar=(0,P.useMemo)(()=>new tt("starred",Rt,Ze),[Rt,Ze]),En=(0,P.useMemo)(()=>[we].flat()[0],[we]),[Zn,Vn]=(0,P.useState)(En!=null?En:y),jr=(0,P.useMemo)(()=>Ie.filter(mt((0,Wt.compact)(Object.values({...le,user:void 0})))),[le,Ie]),fr=(0,P.useMemo)(()=>({all:jr.length,starred:jr.filter(sn=>ar.filterEntity(sn)).length,owned:jr.filter(sn=>jn.filterEntity(sn)).length}),[jr,ar,jn]);(0,P.useEffect)(()=>{En&&Vn(En)},[En]),(0,P.useEffect)(()=>{!Ln&&!!Zn&&Zn!=="all"&&fr[Zn]===0&&Vn("all")},[Ln,fr,Zn,Vn]),(0,P.useEffect)(()=>{Se({user:Zn?new tt(Zn,Rt,Ze):void 0})},[Zn,Rt,Ze,Se]);var ts;return(0,c.jsx)(Or.Z,{className:B.root,children:xt.map(sn=>(0,c.jsxs)(P.Fragment,{children:[(0,c.jsx)(Y.Z,{variant:"subtitle2",component:"span",className:B.title,children:sn.name}),(0,c.jsx)(Or.Z,{className:B.groupWrapper,children:(0,c.jsx)(Jn.Z,{disablePadding:!0,dense:!0,role:"menu","aria-label":sn.name,children:sn.items.map(Pn=>{var gr;return(0,c.jsxs)(wr.Z,{role:"none presentation",button:!0,divider:!0,onClick:()=>Vn(Pn.id),selected:Pn.id===((gr=le.user)===null||gr===void 0?void 0:gr.value),className:B.menuItem,disabled:fr[Pn.id]===0,"data-testid":`user-picker-${Pn.id}`,tabIndex:0,ContainerProps:{role:"menuitem"},children:[Pn.icon&&(0,c.jsx)(pr.Z,{className:B.listIcon,children:(0,c.jsx)(Pn.icon,{fontSize:"small"})}),(0,c.jsx)(Hr.Z,{children:(0,c.jsxs)(Y.Z,{variant:"body1",children:[Pn.label," "]})}),(0,c.jsx)(Ms.Z,{children:(ts=fr[Pn.id])!==null&&ts!==void 0?ts:"-"})]},Pn.id)})})})]},sn.name))})},Ls=(0,D.Z)({input:{}},{name:"CatalogReactEntityProcessingStatusPickerPicker"}),Ws=(0,c.jsx)($e.Z,{fontSize:"small"}),Vs=(0,c.jsx)(be.Z,{fontSize:"small"}),Ps=()=>{const m=Ls(),{updateFilters:y}=hn(),[I,B]=(0,P.useState)([]);function Q(le){y({orphan:le?new vt(le):void 0})}function J(le){y({error:le?new Zt(le):void 0})}const re=["Is Orphan","Has Error"];return(0,c.jsx)(F.Z,{pb:1,pt:1,children:(0,c.jsxs)(Y.Z,{variant:"button",component:"label",children:["Processing Status",(0,c.jsx)(We.ZP,{multiple:!0,options:re,value:I,onChange:(le,Se)=>{B(Se),Q(Se.includes("Is Orphan")),J(Se.includes("Has Error"))},renderOption:(le,{selected:Se})=>(0,c.jsx)(M.Z,{control:(0,c.jsx)(ue.Z,{icon:Ws,checkedIcon:Vs,checked:Se}),label:le}),size:"small",popupIcon:(0,c.jsx)(Ae.Z,{"data-testid":"processing-status-picker-expand"}),renderInput:le=>(0,c.jsx)(fe.Z,{...le,className:m.input,variant:"outlined"})})]})})},Hs=({children:m,value:y})=>{var I;const[B,Q]=useState((I=y==null?void 0:y.filters)!==null&&I!==void 0?I:{}),J=useCallback(ht=>{Q(xt=>{const Ze=typeof ht=="function"?ht(xt):ht;return{...xt,...Ze}})},[]),re=useMemo(()=>({entities:[],backendEntities:[],queryParameters:{}}),[]);var le,Se,Ie,je,we;const Ve=useMemo(()=>({entities:(le=y==null?void 0:y.entities)!==null&&le!==void 0?le:re.entities,backendEntities:(Se=y==null?void 0:y.backendEntities)!==null&&Se!==void 0?Se:re.backendEntities,updateFilters:(Ie=y==null?void 0:y.updateFilters)!==null&&Ie!==void 0?Ie:J,filters:B,loading:(je=y==null?void 0:y.loading)!==null&&je!==void 0?je:!1,queryParameters:(we=y==null?void 0:y.queryParameters)!==null&&we!==void 0?we:re.queryParameters,error:y==null?void 0:y.error}),[y,re,B,J]);return _jsx(EntityListContext.Provider,{value:Ve,children:m})}},33414:function(At,Fe,t){"use strict";t.r(Fe),t.d(Fe,{AboutCard:function(){return gt},AboutContent:function(){return _e},AboutField:function(){return z}});var h=t(52322),r=t(25271),W=t(93414),k=t(25248),g=t(32838),b=t(56941),c=t(79692),P=t(94339),te=t(32552),_=t(61837),X=t(85256),U=t(24579),F=t(52866),Y=t(30254),ce=t(27604),oe=t(2784),T=t(19625),R=t(60905),V=t(90436),A=t(7089);const C=(0,c.Z)(Ee=>({value:{fontWeight:"bold",overflow:"hidden",lineHeight:"24px",wordBreak:"break-word"},label:{color:Ee.palette.text.secondary,textTransform:"uppercase",fontSize:"10px",fontWeight:"bold",letterSpacing:.5,overflow:"hidden",whiteSpace:"nowrap"}}));function z(Ee){const{label:Ke,value:it,gridSizes:mt,children:ot}=Ee,ft=C(),nt=(0,k.vJ)(ot,bt=>bt.getElements()),Lt=nt.length>0?nt:(0,h.jsx)(V.Z,{variant:"body2",className:ft.value,children:it||"unknown"});return(0,h.jsxs)(R.Z,{item:!0,...mt,children:[(0,h.jsx)(V.Z,{variant:"h2",className:ft.label,children:Ke}),Lt]})}var Le=t(24851);const Xe=(0,c.Z)({description:{wordBreak:"break-word"}});function Qe(Ee,Ke,it){if(Ke==="url"||Ee.includes("://"))return Ee;const mt=it.type==="file"?`file://${it.target}`:it.target;return Ke==="file"||it.type==="file"?new URL(Ee,mt).href:mt}function _e(Ee){var Ke,it,mt,ot,ft,nt,Lt,bt;const{entity:ze}=Ee,ne=Xe(),Pe=ze.kind.toLocaleLowerCase("en-US")==="system",ke=ze.kind.toLocaleLowerCase("en-US")==="resource",tt=ze.kind.toLocaleLowerCase("en-US")==="component",vt=ze.kind.toLocaleLowerCase("en-US")==="api",Zt=ze.kind.toLocaleLowerCase("en-US")==="template",ut=ze.kind.toLocaleLowerCase("en-US")==="location",Tt=ze.kind.toLocaleLowerCase("en-US")==="group",It=(0,b.hF)(ze,r.cz,{kind:"system"}),Ot=(0,b.hF)(ze,r.cz,{kind:"component"}),en=(0,b.hF)(ze,r.cz,{kind:"domain"}),Wt=(0,b.hF)(ze,r.S4);let Vt;try{Vt=(0,r.CV)(ze)}catch{Vt=void 0}return(0,h.jsxs)(R.Z,{container:!0,children:[(0,h.jsx)(z,{label:"Description",gridSizes:{xs:12},children:(0,h.jsx)(V.Z,{variant:"body2",paragraph:!0,className:ne.description,children:(ze==null||(Ke=ze.metadata)===null||Ke===void 0?void 0:Ke.description)||"No description"})}),(0,h.jsx)(z,{label:"Owner",value:"No Owner",gridSizes:{xs:12,sm:6,lg:4},children:Wt.length>0&&(0,h.jsx)(b.rI,{entityRefs:Wt,defaultKind:"group"})}),(Pe||en.length>0)&&(0,h.jsx)(z,{label:"Domain",value:"No Domain",gridSizes:{xs:12,sm:6,lg:4},children:en.length>0&&(0,h.jsx)(b.rI,{entityRefs:en,defaultKind:"domain"})}),(vt||tt||ke||It.length>0)&&(0,h.jsx)(z,{label:"System",value:"No System",gridSizes:{xs:12,sm:6,lg:4},children:It.length>0&&(0,h.jsx)(b.rI,{entityRefs:It,defaultKind:"system"})}),tt&&Ot.length>0&&(0,h.jsx)(z,{label:"Parent Component",value:"No Parent Component",gridSizes:{xs:12,sm:6,lg:4},children:(0,h.jsx)(b.rI,{entityRefs:Ot,defaultKind:"component"})}),(vt||tt||ke||Zt||Tt||ut||typeof(ze==null||(it=ze.spec)===null||it===void 0?void 0:it.type)=="string")&&(0,h.jsx)(z,{label:"Type",value:ze==null||(mt=ze.spec)===null||mt===void 0?void 0:mt.type,gridSizes:{xs:12,sm:6,lg:4}}),(vt||tt||typeof(ze==null||(ot=ze.spec)===null||ot===void 0?void 0:ot.lifecycle)=="string")&&(0,h.jsx)(z,{label:"Lifecycle",value:ze==null||(ft=ze.spec)===null||ft===void 0?void 0:ft.lifecycle,gridSizes:{xs:12,sm:6,lg:4}}),(0,h.jsx)(z,{label:"Tags",value:"No Tags",gridSizes:{xs:12,sm:6,lg:4},children:((ze==null||(nt=ze.metadata)===null||nt===void 0?void 0:nt.tags)||[]).map(Qt=>(0,h.jsx)(A.Z,{size:"small",label:Qt},Qt))}),ut&&((ze==null||(Lt=ze.spec)===null||Lt===void 0?void 0:Lt.targets)||(ze==null||(bt=ze.spec)===null||bt===void 0?void 0:bt.target))&&(0,h.jsx)(z,{label:"Targets",gridSizes:{xs:12},children:(0,h.jsx)(Le.s,{cols:1,items:(ze.spec.targets||[ze.spec.target]).map(Qt=>Qt).map(Qt=>{var un;return{text:Qt,href:Qe(Qt,(ze==null||(un=ze.spec)===null||un===void 0?void 0:un.type)||"unknown",Vt)}})})})]})}const Ge=(0,c.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 gt(Ee){var Ke,it,mt;const{variant:ot}=Ee,ft=Ge(),{entity:nt}=(0,b.X2)(),Lt=(0,k.h_)(g.q3),bt=(0,k.h_)(b.Ah),ze=(0,k.h_)(k.$v),ne=(0,k.h_)(k.VE),Pe=(0,k.tg)(T.jU),ke=(0,b.CV)(nt,Lt),tt=(Ke=nt.metadata.annotations)===null||Ke===void 0?void 0:Ke[r.Tf],vt={label:"View Source",disabled:!ke,icon:(0,h.jsx)(g.nW,{type:ke==null?void 0:ke.integrationType}),href:ke==null?void 0:ke.locationTargetUrl},Zt={label:"View TechDocs",disabled:!(!((it=nt.metadata.annotations)===null||it===void 0)&&it["backstage.io/techdocs-ref"])||!Pe,icon:(0,h.jsx)(Y.Z,{}),href:Pe&&Pe({namespace:nt.metadata.namespace||r.zG,kind:nt.kind,name:nt.metadata.name})};let ut="";ot==="gridItem"?ut=ft.gridItemCard:ot==="fullHeight"&&(ut=ft.fullHeightCard);let Tt="";ot==="gridItem"?Tt=ft.gridItemCardContent:ot==="fullHeight"&&(Tt=ft.fullHeightCardContent);const It=(mt=nt.metadata.annotations)===null||mt===void 0?void 0:mt[r.P1],Ot=(It==null?void 0:It.startsWith("url:"))||(It==null?void 0:It.startsWith("file:")),en=(0,oe.useCallback)(async()=>{try{await bt.refreshEntity((0,r.eE)(nt)),ze.post({message:"Refresh scheduled",severity:"info"})}catch(Wt){ne.post(Wt)}},[bt,ze,ne,nt]);return(0,h.jsxs)(P.Z,{className:ut,children:[(0,h.jsx)(te.Z,{title:"About",action:(0,h.jsxs)(h.Fragment,{children:[Ot&&(0,h.jsx)(_.Z,{"aria-label":"Refresh",title:"Schedule entity refresh",onClick:en,children:(0,h.jsx)(F.Z,{})}),(0,h.jsx)(_.Z,{component:W.rU,"aria-label":"Edit",disabled:!tt,title:"Edit Metadata",to:tt!=null?tt:"#",children:(0,h.jsx)(ce.Z,{})})]}),subheader:(0,h.jsx)(W.M6,{links:[vt,Zt]})}),(0,h.jsx)(X.Z,{}),(0,h.jsx)(U.Z,{className:Tt,children:(0,h.jsx)(_e,{entity:nt})})]})}},86359:function(At,Fe,t){"use strict";t.d(Fe,{E:function(){return oe}});var h=t(52322),r=t(25271),W=t(93414),k=t(56941),g=t(90436),b=t(15459),c=t(27604),P=t(2997),te=t(11640),_=t(28347),X=t(76635),U=t(2784),F=t(7089);const Y=Object.freeze({createNameColumn(T){function R(V){var A;return((A=V.metadata)===null||A===void 0?void 0:A.title)||(0,k.$3)(V,{defaultKind:T==null?void 0:T.defaultKind})}return{title:"Name",field:"resolved.name",highlight:!0,customSort({entity:V},{entity:A}){return R(V).localeCompare(R(A))},render:({entity:V})=>{var A;return(0,h.jsx)(k.dx,{entityRef:V,defaultKind:(T==null?void 0:T.defaultKind)||"Component",title:(A=V.metadata)===null||A===void 0?void 0:A.title})}}},createSystemColumn(){return{title:"System",field:"resolved.partOfSystemRelationTitle",render:({resolved:T})=>(0,h.jsx)(k.rI,{entityRefs:T.partOfSystemRelations,defaultKind:"system"})}},createOwnerColumn(){return{title:"Owner",field:"resolved.ownedByRelationsTitle",render:({resolved:T})=>(0,h.jsx)(k.rI,{entityRefs:T.ownedByRelations,defaultKind:"group"})}},createSpecTargetsColumn(){return{title:"Targets",field:"entity.spec.targets",render:({entity:T})=>{var R,V;return(0,h.jsx)(h.Fragment,{children:((T==null||(R=T.spec)===null||R===void 0?void 0:R.targets)||(T==null||(V=T.spec)===null||V===void 0?void 0:V.target))&&(0,h.jsx)(W.Or,{text:(T.spec.targets||[T.spec.target]).join(", "),placement:"bottom-start"})})}}},createSpecTypeColumn(){return{title:"Type",field:"entity.spec.type",hidden:!0,width:"auto"}},createSpecLifecycleColumn(){return{title:"Lifecycle",field:"entity.spec.lifecycle"}},createMetadataDescriptionColumn(){return{title:"Description",field:"entity.metadata.description",render:({entity:T})=>(0,h.jsx)(W.Or,{text:T.metadata.description,placement:"bottom-start"}),width:"auto"}},createTagsColumn(){return{title:"Tags",field:"entity.metadata.tags",cellStyle:{padding:"0px 16px 0px 20px"},render:({entity:T})=>(0,h.jsx)(h.Fragment,{children:T.metadata.tags&&T.metadata.tags.map(R=>(0,h.jsx)(F.Z,{label:R,size:"small",variant:"outlined",style:{marginBottom:"0px"}},R))}),width:"auto"}},createTitleColumn(T){return{title:"Title",field:"entity.metadata.title",hidden:T==null?void 0:T.hidden,searchable:!0}},createLabelColumn(T,R){return{title:(R==null?void 0:R.title)||"Label",field:"entity.metadata.labels",cellStyle:{padding:"0px 16px 0px 20px"},render:({entity:V})=>{var A;const C=(A=V.metadata)===null||A===void 0?void 0:A.labels,z=C&&C[T]||(R==null?void 0:R.defaultValue);return(0,h.jsx)(h.Fragment,{children:z&&(0,h.jsx)(F.Z,{label:z,size:"small",variant:"outlined"},z)})},width:"auto"}}}),ce=(0,b.Z)({root:{color:"#f3ba37"}})(te.Z),oe=T=>{var R,V;const{columns:A,actions:C,tableOptions:z,subtitle:Le,emptyContent:Xe}=T,{isStarredEntity:Qe,toggleStarredEntity:_e}=(0,k.CR)(),{loading:Ge,error:gt,entities:Ee,filters:Ke}=(0,k.wp)(),it=(0,U.useMemo)(()=>{var ne;return[Y.createTitleColumn({hidden:!0}),Y.createNameColumn({defaultKind:(ne=Ke.kind)===null||ne===void 0?void 0:ne.value}),...Pe(),Y.createMetadataDescriptionColumn(),Y.createTagsColumn()];function Pe(){var ke;switch((ke=Ke.kind)===null||ke===void 0?void 0:ke.value){case"user":return[];case"domain":case"system":return[Y.createOwnerColumn()];case"group":case"template":return[Y.createSpecTypeColumn()];case"location":return[Y.createSpecTypeColumn(),Y.createSpecTargetsColumn()];default:return[Y.createSystemColumn(),Y.createOwnerColumn(),Y.createSpecTypeColumn(),Y.createSpecLifecycleColumn()]}}},[(R=Ke.kind)===null||R===void 0?void 0:R.value]),mt=Ke.type===void 0;var ot;const ft=(0,X.capitalize)((ot=(V=Ke.user)===null||V===void 0?void 0:V.value)!==null&&ot!==void 0?ot:"all");if(gt)return(0,h.jsx)("div",{children:(0,h.jsx)(W.GB,{severity:"error",title:"Could not fetch catalog entities.",children:(0,h.jsx)(W.Oi,{language:"text",text:gt.toString()})})});const nt=[({entity:ne})=>{var Pe;const ke=(Pe=ne.metadata.annotations)===null||Pe===void 0?void 0:Pe[r.l2],tt="View";return{icon:()=>(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(g.Z,{variant:"srOnly",children:tt}),(0,h.jsx)(P.Z,{fontSize:"small"})]}),tooltip:tt,disabled:!ke,onClick:()=>{!ke||window.open(ke,"_blank")}}},({entity:ne})=>{var Pe;const ke=(Pe=ne.metadata.annotations)===null||Pe===void 0?void 0:Pe[r.Tf],tt="Edit";return{icon:()=>(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(g.Z,{variant:"srOnly",children:tt}),(0,h.jsx)(c.Z,{fontSize:"small"})]}),tooltip:tt,disabled:!ke,onClick:()=>{!ke||window.open(ke,"_blank")}}},({entity:ne})=>{const Pe=Qe(ne),ke=Pe?"Remove from favorites":"Add to favorites";return{cellStyle:{paddingLeft:"1em"},icon:()=>(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(g.Z,{variant:"srOnly",children:ke}),Pe?(0,h.jsx)(ce,{}):(0,h.jsx)(_.Z,{})]}),tooltip:ke,onClick:()=>_e(ne)}}],Lt=Ee.map(ne=>{const Pe=(0,k.hF)(ne,r.cz,{kind:"system"}),ke=(0,k.hF)(ne,r.S4);return{entity:ne,resolved:{name:(0,k.$3)(ne,{defaultKind:"Component"}),ownedByRelationsTitle:ke.map(tt=>(0,k.$3)(tt,{defaultKind:"group"})).join(", "),ownedByRelations:ke,partOfSystemRelationTitle:Pe.map(tt=>(0,k.$3)(tt,{defaultKind:"system"})).join(", "),partOfSystemRelations:Pe}}}),bt=(A||it).find(ne=>ne.title==="Type");bt&&(bt.hidden=!mt);const ze=Lt.length>20;return(0,h.jsx)(W.iA,{isLoading:Ge,columns:A||it,options:{paging:ze,pageSize:20,actionsColumnIndex:-1,loadingType:"linear",showEmptyDataSourceMessage:!Ge,padding:"dense",pageSizeOptions:[20,50,100],...z},title:`${ft} (${Ee.length})`,data:Lt,actions:C||nt,subtitle:Le,emptyContent:Xe})};oe.columns=Y},85877:function(At,Fe,t){"use strict";t.r(Fe),t.d(Fe,{EntityLabelsCard:function(){return U},hasLabels:function(){return F}});var h=t(52322),r=t(56941),W=t(2784),k=t(93414),g=t(79692),b=t(90436),c=t(77277);const P=`metadata:
|
|
32
|
+
`},Vr=100,Pr=10,Jn=(0,c.Z)(e=>({root:{position:"relative",display:"flex",flexFlow:"row nowrap",alignItems:"center"},container:{overflow:"auto",scrollbarWidth:0,"&::-webkit-scrollbar":{display:"none"}},fade:{position:"absolute",width:Vr,height:`calc(100% + ${Pr}px)`,transition:"opacity 300ms",pointerEvents:"none"},fadeLeft:{left:-Pr,background:`linear-gradient(90deg, ${Lr(e.palette.type)})`},fadeRight:{right:-Pr,background:`linear-gradient(270deg, ${Lr(e.palette.type)})`},fadeHidden:{opacity:0},button:{position:"absolute"},buttonLeft:{left:-e.spacing(2)},buttonRight:{right:-e.spacing(2)}}),{name:"BackstageHorizontalScrollGrid"});function qn(e){const[[s,a],d]=React.useState([0,0]);return React.useLayoutEffect(()=>{const p=e.current;if(!p){d([0,0]);return}const v=()=>{const j=p.scrollLeft,$=p.scrollWidth-p.offsetWidth-p.scrollLeft;d([j,$])};return v(),p.addEventListener("scroll",v),window.addEventListener("resize",v),()=>{p.removeEventListener("scroll",v),window.removeEventListener("resize",v)}},[e]),[s,a]}function pr(e,s,a){const[d,p]=React.useState(0);return React.useLayoutEffect(()=>{if(d===0)return;const v=window.performance.now(),j=requestAnimationFrame($=>{if(!e.current)return;const G=$-v,N=Math.abs(d)*G/s,oe=Math.max(a,N)*Math.sign(d);e.current.scrollBy({left:oe});const xe=d-oe;Math.sign(d)!==Math.sign(xe)?p(0):p(xe)});return()=>cancelAnimationFrame(j)},[e,d,s,a]),p}function kr(e){const{scrollStep:s=100,scrollSpeed:a=50,minScrollDistance:d=5,children:p,...v}=e,j=Jn(e),$=React.useRef(),[G,N]=qn($),pe=pr($,a,d),oe=xe=>{!$.current||pe(xe?s:-s)};return _jsxs(Box,{...v,className:j.root,children:[_jsx(Grid,{container:!0,direction:"row",wrap:"nowrap",className:j.container,ref:$,children:p}),_jsx(Box,{className:classNames(j.fade,j.fadeLeft,{[j.fadeHidden]:G===0})}),_jsx(Box,{className:classNames(j.fade,j.fadeRight,{[j.fadeHidden]:N===0})}),G>0&&_jsx(IconButton,{title:"Scroll Left",onClick:()=>oe(!1),className:classNames(j.button,j.buttonLeft,{}),children:_jsx(ChevronLeftIcon,{})}),N>0&&_jsx(IconButton,{title:"Scroll Right",onClick:()=>oe(!0),className:classNames(j.button,j.buttonRight,{}),children:_jsx(ChevronRightIcon,{})})]})}const Hr=(0,c.Z)({alpha:{color:"#ffffff",fontFamily:"serif",fontWeight:"normal",fontStyle:"italic"},beta:{color:"#4d65cc",fontFamily:"serif",fontWeight:"normal",fontStyle:"italic"}},{name:"BackstageLifecycle"});function Us(e){const s=Hr(e),{shorthand:a,alpha:d}=e;return a?_jsx(Typography,{component:"span",className:s[d?"alpha":"beta"],style:{fontSize:"120%"},children:d?_jsx(_Fragment,{children:"\u03B1"}):_jsx(_Fragment,{children:"\u03B2"})}):_jsx(Typography,{component:"span",className:s[d?"alpha":"beta"],children:d?"Alpha":"Beta"})}const Or=(0,g.lazy)(()=>Promise.all([t.e(5869),t.e(6051)]).then(t.bind(t,76051)).then(e=>({default:e.RealLogViewer})));function fs(e){const{Progress:s}=(0,W.qD)().getComponents();return(0,r.jsx)(g.Suspense,{fallback:(0,r.jsx)(s,{}),children:(0,r.jsx)(Or,{...e})})}const gs=(0,c.Z)(e=>({markdown:{"& table":{borderCollapse:"collapse",border:`1px solid ${e.palette.border}`},"& th, & td":{border:`1px solid ${e.palette.border}`,padding:e.spacing(1)},"& td":{wordBreak:"break-word",overflow:"hidden",verticalAlign:"middle",lineHeight:"1",margin:0,padding:e.spacing(3,2,3,2.5),borderBottom:0},"& th":{backgroundColor:e.palette.background.paper},"& tr":{backgroundColor:e.palette.background.paper},"& tr:nth-child(odd)":{backgroundColor:e.palette.background.default},"& a":{color:e.palette.link},"& img":{maxWidth:"100%"}}}),{name:"BackstageMarkdownContent"}),Cr=(e,s)=>s?typeof s=="string"?e+s:g.Children.toArray(s.props.children).reduce(Cr,e):e,gn=({level:e,children:s})=>{const p=g.Children.toArray(s).reduce(Cr,"").toLocaleLowerCase("en-US").replace(/\W/g,"-");return g.createElement(`h${e}`,{id:p},s)},or={code:({inline:e,className:s,children:a,...d})=>{const p=String(a).replace(/\n+$/,""),v=/language-(\w+)/.exec(s||"");return!e&&v?(0,r.jsx)(ne,{language:v[1],text:p}):(0,r.jsx)("code",{className:s,...d,children:a})},h1:gn,h2:gn,h3:gn,h4:gn,h5:gn,h6:gn};function Br(e){const{content:s,dialect:a="gfm",linkTarget:d,transformLinkUri:p,transformImageUri:v,className:j}=e,$=gs();return _jsx(ReactMarkdown,{remarkPlugins:a==="gfm"?[gfm]:[],className:`${$.markdown} ${j}`,children:s,components:or,linkTarget:d,transformLinkUri:p,transformImageUri:v})}var ms=t(23054);const $r=(0,c.Z)(e=>({root:{paddingLeft:e.spacing(3)}}),{name:"BackstageLoginRequestListItem"}),vs=({request:e,busy:s,setBusy:a})=>{const d=$r(),[p,v]=useState(),j=async()=>{a(!0);try{await e.trigger()}catch(G){v(isError(G)?G.message:"An unspecified error occurred")}finally{a(!1)}},$=e.provider.icon;return _jsxs(ListItem,{disabled:s,classes:{root:d.root},children:[_jsx(ListItemAvatar,{children:_jsx($,{fontSize:"large"})}),_jsx(ListItemText,{primary:e.provider.title,secondary:p&&_jsx(Typography,{color:"error",children:p})}),_jsx(Button,{color:"primary",variant:"contained",onClick:j,children:"Log in"})]})};var ys=null;const Gr=(0,c.Z)(e=>({dialog:{paddingTop:e.spacing(1)},title:{minWidth:0},titleHeading:{fontSize:e.typography.h6.fontSize},contentList:{padding:0},actionButtons:{padding:e.spacing(2,0)}}),{name:"OAuthRequestDialog"});function Kr(e){const s=Gr(),[a,d]=useState(!1),p=useApi(oauthRequestApiRef),v=useObservable(useMemo(()=>p.authRequest$(),[p]),[]),j=()=>{v.forEach($=>$.reject())};return _jsxs(Dialog,{open:Boolean(v.length),fullWidth:!0,maxWidth:"xs",classes:{paper:s.dialog},"aria-labelledby":"oauth-req-dialog-title",children:[_jsxs("main",{children:[_jsx(DialogTitle,{classes:{root:s.title},id:"oauth-req-dialog-title",children:_jsx(Typography,{className:s.titleHeading,variant:"h1",children:"Login Required"})}),_jsx(DialogContent,{dividers:!0,classes:{root:s.contentList},children:_jsx(List,{children:v.map($=>_jsx(LoginRequestListItem,{request:$,busy:a,setBusy:d},$.provider.title))})})]}),_jsx(DialogActions,{classes:{root:s.actionButtons},children:_jsx(Button,{onClick:j,children:"Reject All"})})]})}var ir=t(15277),xs=t.n(ir),Yr=t(29862);const bs=(0,c.Z)({container:{overflow:"visible !important"}},{name:"BackstageOverflowTooltip"});function Zr(e){const[s,a]=(0,g.useState)(!1),d=(0,Yr.t)(),p=bs(),v=$=>{d()&&a($)};var j;return(0,r.jsx)(nt.ZP,{title:(j=e.title)!==null&&j!==void 0?j:e.text||"",placement:e.placement,disableHoverListener:!s,children:(0,r.jsx)(xs(),{text:e.text,line:e.line,onToggled:v,containerClassName:p.container})})}var Ss=t(67358);function Cs(e){const s=(0,Ke.Z)(),[a,d]=(0,g.useState)(!1);return(0,g.useEffect)(()=>{const p=setTimeout(()=>d(!0),s.transitions.duration.short);return()=>clearTimeout(p)},[s.transitions.duration.short]),a?(0,r.jsx)(Ss.Z,{...e,"data-testid":"progress"}):(0,r.jsx)(Ee.Z,{display:"none"})}var Jr=t(94339),Qr=t(14503),Xr=t(24579),Dr=t(32552),on=t(15459),Ut=t(27597);const ws=(0,c.Z)(e=>({root:{maxWidth:"fit-content",padding:e.spacing(2,2,2,2.5)},boxTitle:{margin:0,color:e.palette.textSubtle},arrow:{color:e.palette.textSubtle}}),{name:"BackstageBottomLink"});function js(e){const{link:s,title:a,onClick:d}=e,p=ws();return(0,r.jsxs)(Ee.Z,{children:[(0,r.jsx)(Rn.Z,{}),(0,r.jsx)(_e,{to:s,onClick:d,underline:"none",children:(0,r.jsxs)(Ee.Z,{display:"flex",alignItems:"center",className:p.root,children:[(0,r.jsx)(Ee.Z,{className:p.boxTitle,fontWeight:"fontWeightBold",m:1,children:(0,r.jsx)(F.Z,{children:(0,r.jsx)("strong",{children:a})})}),(0,r.jsx)(Ut.Z,{className:p.arrow})]})})]})}const Es=e=>{const{slackChannel:s}=e;if(s){if(typeof s=="string")return(0,r.jsxs)(F.Z,{children:["Please contact ",s," for help."]});if(!s.href)return(0,r.jsxs)(F.Z,{children:["Please contact ",s.name," for help."]})}else return null;return(0,r.jsx)(mt,{to:s.href,variant:"contained",children:s.name})},qr=class extends g.Component{componentDidCatch(s,a){console.error(`ErrorBoundary, error: ${s}, info: ${a}`),this.setState({error:s,errorInfo:a})}render(){const{slackChannel:s,children:a}=this.props,{error:d}=this.state;return d?(0,r.jsx)(fn,{title:"Something Went Wrong",error:d,children:(0,r.jsx)(Es,{slackChannel:s})}):a}constructor(s){super(s),this.state={error:void 0,errorInfo:void 0}}},As=(0,c.Z)(e=>({noPadding:{padding:0,"&:last-child":{paddingBottom:0}},header:{padding:e.spacing(2,2,2,2.5)},headerTitle:{fontWeight:e.typography.fontWeightBold},headerSubheader:{paddingTop:e.spacing(1)},headerAvatar:{},headerAction:{},headerContent:{},subheader:{display:"flex"}}),{name:"BackstageInfoCard"}),Ts=(0,on.Z)(e=>({root:{display:"inline-block",padding:e.spacing(8,8,0,0),float:"right"}}),{name:"BackstageInfoCardCardActionsTopRight"})(Qr.Z),_r={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 wr(e){const{title:s,subheader:a,divider:d=!0,deepLink:p,slackChannel:v,errorBoundaryProps:j,variant:$,children:G,headerStyle:N,headerProps:pe,icon:oe,action:xe,actionsClassName:Ie,actions:Ye,cardClassName:qe,actionsTopRight:Pt,className:Kt,noPadding:tn,titleTypographyProps:nn}=e,kt=As();let _t={},Yt={};$&&$.split(/[\s]+/g).forEach(br=>{_t={..._t,..._r.card[br]},Yt={...Yt,..._r.cardContent[br]}});const vr=()=>!a&&!oe?null:(0,r.jsxs)("div",{className:kt.headerSubheader,"data-testid":"info-card-subheader",children:[a&&(0,r.jsx)("div",{className:kt.subheader,children:a}),oe]}),yr=j||(v?{slackChannel:v}:{});return(0,r.jsx)(Jr.Z,{style:_t,className:Kt,children:(0,r.jsxs)(qr,{...yr,children:[s&&(0,r.jsx)(Dr.Z,{classes:{root:kt.header,title:kt.headerTitle,subheader:kt.headerSubheader,avatar:kt.headerAvatar,action:kt.headerAction,content:kt.headerContent},title:s,subheader:vr(),action:xe,style:{...N},titleTypographyProps:nn,...pe}),Pt&&(0,r.jsx)(Ts,{children:Pt}),d&&(0,r.jsx)(Rn.Z,{}),(0,r.jsx)(Xr.Z,{className:ce()(qe,{[kt.noPadding]:tn}),style:Yt,children:G}),Ye&&(0,r.jsx)(Qr.Z,{className:Ie,children:Ye}),p&&(0,r.jsx)(js,{...p})]})})}var Ms=t(39307);const Is=(0,c.Z)(e=>({root:{position:"relative",lineHeight:0},overlay:{position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -60%)",fontSize:e.typography.pxToRem(45),fontWeight:e.typography.fontWeightBold,color:e.palette.textContrast},description:{fontSize:"100%",top:"50%",left:"50%",transform:"translate(-50%, -50%)",position:"absolute",wordBreak:"break-all",display:"inline-block"},circle:{width:"80%",transform:"translate(10%, 0)"},colorUnknown:{}}),{name:"BackstageGauge"}),es={fractional:!0,inverse:!1,unit:"%",max:100},Rs=({palette:e,value:s,inverse:a,max:d})=>{if(isNaN(s))return"#ddd";const p=d||es.max,v=a?p-s:s;return v<p/3?e.status.error:v<p*(2/3)?e.status.warning:e.status.ok};function zs(e){const[s,a]=useState(null),{getColor:d=Rs}=e,p=Is(e),{palette:v}=useTheme(),{value:j,fractional:$,inverse:G,unit:N,max:pe,description:oe}={...es,...e},xe=$?Math.round(j*pe):j,Ie=pe!==100?Math.round(j):xe,[Ye,qe]=useState(!1);return useEffect(()=>{const Pt=s,Kt=()=>qe(!0),tn=()=>qe(!1);return Pt&&oe?(Pt.addEventListener("mouseenter",Kt),Pt.addEventListener("mouseleave",tn),()=>{Pt.removeEventListener("mouseenter",Kt),Pt.removeEventListener("mouseleave",tn)}):()=>{qe(!1)}},[oe,s]),_jsxs(Box,{ref:a,className:p.root,children:[_jsx(Circle,{strokeLinecap:"butt",percent:xe,strokeWidth:12,trailWidth:12,strokeColor:d({palette:v,value:Ie,inverse:G,max:pe}),className:p.circle}),oe&&Ye?_jsx(Box,{className:p.description,children:oe}):_jsx(Box,{className:p.overlay,children:isNaN(j)?"N/A":`${Ie}${N}`})]})}const Ls=(0,c.Z)({root:{height:"100%",width:250}},{name:"BackstageGaugeCard"});function Ws(e){const s=Ls(e),{title:a,subheader:d,progress:p,inverse:v,deepLink:j,description:$,icon:G,variant:N,getColor:pe}=e,oe={inverse:v,description:$,getColor:pe,value:p};return _jsx(Box,{className:s.root,children:_jsx(InfoCard,{title:a,subheader:d,deepLink:j,variant:N,icon:G,children:_jsx(Gauge,{...oe})})})}function Vs(e){const{value:s,getColor:a=getProgressColor}=e,{palette:d}=useTheme();if(isNaN(s))return null;let p=Math.round(s*100*100)/100;p>100&&(p=100);const v=a({palette:d,value:p,inverse:!1,max:100});return _jsx(Tooltip,{title:`${p}%`,children:_jsx(Typography,{component:"span",children:_jsx(Line,{percent:p,strokeWidth:4,trailWidth:4,strokeColor:v})})})}var Ps=t(21324),Hs=t(7089),m=t(1292),y=t(42494),I=t(74603),B=t(56939),Q=t(12231),J=t(73698),ie=t(72379);const le=(0,c.Z)(e=>(0,P.Z)({icon:{position:"absolute",right:e.spacing(.5),pointerEvents:"none"}}),{name:"BackstageClosedDropdown"});var Te=()=>{const e=le();return(0,r.jsx)(ie.Z,{className:e.icon,fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,r.jsx)("path",{d:"M7.5 8L6 9.5L12.0703 15.5703L18.1406 9.5L16.6406 8L12.0703 12.5703L7.5 8Z",fill:"#616161"})})};const we=(0,c.Z)(e=>(0,P.Z)({icon:{position:"absolute",right:e.spacing(.5),pointerEvents:"none"}}),{name:"BackstageOpenedDropdown"});var Ve=()=>{const e=we();return(0,r.jsx)(ie.Z,{className:e.icon,fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,r.jsx)("path",{d:"M16.5 16L18 14.5L11.9297 8.42969L5.85938 14.5L7.35938 16L11.9297 11.4297L16.5 16Z",fill:"#616161"})})};const rt=(0,on.Z)(e=>(0,P.Z)({root:{"label + &":{marginTop:e.spacing(3)}},input:{borderRadius:e.shape.borderRadius,position:"relative",backgroundColor:e.palette.background.paper,border:"1px solid #ced4da",fontSize:e.typography.body1.fontSize,padding:e.spacing(1.25,3.25,1.25,1.5),transition:e.transitions.create(["border-color","box-shadow"]),fontFamily:"Helvetica Neue","&:focus":{background:e.palette.background.paper,borderRadius:e.shape.borderRadius}}}),{name:"BackstageSelectInputBase"})(I.Z),dt=(0,c.Z)(e=>(0,P.Z)({formControl:{margin:`${e.spacing(1)} 0px`,maxWidth:300},label:{transform:"initial",fontWeight:"bold",fontSize:e.typography.body2.fontSize,fontFamily:e.typography.fontFamily,color:e.palette.text.primary,"&.Mui-focused":{color:e.palette.text.primary}},formLabel:{transform:"initial",fontWeight:"bold",fontSize:e.typography.body2.fontSize,fontFamily:e.typography.fontFamily,color:e.palette.text.primary,"&.Mui-focused":{color:e.palette.text.primary}},chips:{display:"flex",flexWrap:"wrap"},chip:{margin:2},checkbox:{},root:{display:"flex",flexDirection:"column"}}),{name:"BackstageSelect"});function Ze(e){const{multiple:s,items:a,label:d,placeholder:p,selected:v,onChange:j,triggerReset:$,native:G=!1,disabled:N=!1,margin:pe}=e,oe=dt(),[xe,Ie]=(0,g.useState)(v||(s?[]:"")),[Ye,qe]=(0,g.useState)(!1);(0,g.useEffect)(()=>{Ie(s?[]:"")},[$,s]),(0,g.useEffect)(()=>{v!==void 0&&Ie(v)},[v]);const Pt=kt=>{Ie(kt.target.value),j(kt.target.value)},Kt=kt=>{if(N){kt.preventDefault();return}qe(_t=>s&&!(kt.target instanceof HTMLElement)?!0:!_t)},tn=()=>{qe(!1)},nn=kt=>()=>{const _t=xe.filter(Yt=>Yt!==kt);Ie(_t),j(_t)};return(0,r.jsx)(Ee.Z,{className:oe.root,children:(0,r.jsx)(m.Z,{onClickAway:tn,children:(0,r.jsxs)(y.Z,{className:oe.formControl,children:[(0,r.jsx)(B.Z,{className:oe.formLabel,children:d}),(0,r.jsxs)(J.Z,{"aria-label":d,value:xe,native:G,disabled:N,"data-testid":"select",displayEmpty:!0,multiple:s,margin:pe,onChange:Pt,onClick:Kt,open:Ye,input:(0,r.jsx)(rt,{}),label:d,tabIndex:0,renderValue:kt=>{var _t;return s&&xe.length!==0?(0,r.jsx)(Ee.Z,{className:oe.chips,children:kt.map(Yt=>{var vr,yr;return(0,r.jsx)(Hs.Z,{label:(vr=a.find(xr=>xr.value===Yt))===null||vr===void 0?void 0:vr.label,clickable:!0,onDelete:nn(Yt),className:oe.chip},(yr=a.find(xr=>xr.value===Yt))===null||yr===void 0?void 0:yr.value)})}):(0,r.jsx)(F.Z,{children:xe.length===0?p||"":(_t=a.find(Yt=>Yt.value===kt))===null||_t===void 0?void 0:_t.label})},IconComponent:()=>Ye?(0,r.jsx)(Ve,{}):(0,r.jsx)(Te,{}),MenuProps:{anchorOrigin:{vertical:"bottom",horizontal:"left"},transformOrigin:{vertical:"top",horizontal:"left"},getContentAnchorEl:null},children:[p&&!s&&(0,r.jsx)(Q.Z,{value:[],children:p}),G?a&&a.map(kt=>(0,r.jsx)("option",{value:kt.value,children:kt.label},kt.value)):a&&a.map(kt=>(0,r.jsxs)(Q.Z,{value:kt.value,children:[s&&(0,r.jsx)(Ps.Z,{color:"primary",checked:xe.includes(kt.value)||!1,className:oe.checkbox}),kt.label]},kt.value))]})]})})})}const Rt=()=>{},Gt=g.createContext({stepperLength:0,stepIndex:0,setStepIndex:Rt,stepHistory:[],setStepHistory:Rt,onStepChange:Rt});function Ln(e){const{children:s,elevated:a,onStepChange:d,activeStep:p=0}=e,[v,j]=useState(p),[$,G]=useState([0]);useEffect(()=>{j(p)},[p]);const N=[];let pe;return Children.forEach(s,oe=>{isValidElement(oe)&&(oe.props.end?pe=oe:N.push(oe))}),_jsxs(_Fragment,{children:[_jsx(Gt.Provider,{value:{stepIndex:v,setStepIndex:j,stepHistory:$,setStepHistory:G,onStepChange:d,stepperLength:Children.count(s)},children:_jsx(MuiStepper,{activeStep:v,orientation:"vertical",elevation:a?2:0,children:N})}),v>=Children.count(s)-1&&pe]})}const jn=(0,c.Z)(e=>({root:{marginTop:e.spacing(3),"& button":{marginRight:e.spacing(1)}}}),{name:"BackstageSimpleStepperFooter"}),ar=({text:e,handleClick:s})=>_jsx(Button,{onClick:s,children:e||"Reset"}),En=({text:e,handleClick:s,disabled:a,last:d,stepIndex:p})=>_jsx(Button,{variant:"contained",color:"primary",disabled:a,"data-testid":`nextButton-${p}`,onClick:s,children:e||(d?"Finish":"Next")}),Zn=({text:e,handleClick:s,disabled:a,stepIndex:d})=>_jsx(Button,{variant:"outlined",color:"primary",disabled:a,"data-testid":`skipButton-${d}`,onClick:s,children:e||"Skip"}),Vn=({text:e,handleClick:s,disabled:a,stepIndex:d})=>_jsx(Button,{onClick:s,"data-testid":`backButton-${d}`,disabled:a,children:e||"Back"}),jr=({actions:e={},children:s})=>{const a=jn(),{stepperLength:d,stepIndex:p,setStepIndex:v,stepHistory:j,setStepHistory:$,onStepChange:G}=useContext(VerticalStepperContext),N=(Ie,Ye)=>{Ye&&Ye(),G&&G(p,Ie),v(Ie)},pe=()=>{const Ie=e.nextStep?e.nextStep(p,d-1):p+1;N(Ie,e.onNext),$([...j,Ie])},oe=()=>{j.pop(),N(j[j.length-1],e.onBack),$([...j])},xe=()=>{N(0,e.onRestart),$([0])};return _jsxs(Box,{className:a.root,children:[[void 0,!0].includes(e.showBack)&&p!==0&&_jsx(Vn,{text:e.backText,handleClick:oe,disabled:p===0,stepIndex:p}),e.showSkip&&_jsx(Zn,{text:e.skipText,handleClick:pe,disabled:!!d&&p>=d||!!e.canSkip&&!e.canSkip(),stepIndex:p}),[void 0,!0].includes(e.showNext)&&_jsx(En,{text:e.nextText,handleClick:pe,disabled:!!d&&p>=d||!!e.canNext&&!e.canNext(),stepIndex:p}),e.showRestart&&p!==0&&_jsx(ar,{text:e.restartText,handleClick:xe,stepIndex:p}),s]})},fr=(0,c.Z)(e=>({end:{padding:e.spacing(3)}}),{name:"SimpleStepperStep"});function ts(e){const{title:s,children:a,end:d,actions:p,...v}=e,j=fr();return d?_jsxs(Box,{className:j.end,children:[_jsx(Typography,{variant:"h6",children:s}),a,_jsx(SimpleStepperFooter,{actions:{...p||{},showNext:!1}})]}):_jsxs(MuiStep,{...v,children:[_jsx(StepLabel,{children:_jsx(Typography,{variant:"h6",children:s})}),_jsxs(StepContent,{children:[a,_jsx(SimpleStepperFooter,{actions:p})]})]})}const sn=(0,c.Z)(e=>({status:{fontWeight:e.typography.fontWeightMedium,"&::before":{width:"0.7em",height:"0.7em",display:"inline-block",marginRight:e.spacing(1),borderRadius:"50%",content:'""'}},ok:{"&::before":{backgroundColor:e.palette.status.ok}},warning:{"&::before":{backgroundColor:e.palette.status.warning}},error:{"&::before":{backgroundColor:e.palette.status.error}},pending:{"&::before":{backgroundColor:e.palette.status.pending}},running:{"&::before":{backgroundColor:e.palette.status.running}},aborted:{"&::before":{backgroundColor:e.palette.status.aborted}}}),{name:"BackstageStatus"});function Pn(e){const s=sn(e);return _jsx(Typography,{component:"span",className:classNames(s.status,s.ok),"aria-label":"Status ok","aria-hidden":"true",...e})}function gr(e){const s=sn(e);return _jsx(Typography,{component:"span",className:classNames(s.status,s.warning),"aria-label":"Status warning","aria-hidden":"true",...e})}function di(e){const s=sn(e);return _jsx(Typography,{component:"span",className:classNames(s.status,s.error),"aria-label":"Status error","aria-hidden":"true",...e})}function ui(e){const s=sn(e);return _jsx(Typography,{component:"span",className:classNames(s.status,s.pending),"aria-label":"Status pending","aria-hidden":"true",...e})}function aa(e){const s=sn(e);return _jsx(Typography,{component:"span",className:classNames(s.status,s.running),"aria-label":"Status running","aria-hidden":"true",...e})}function Er(e){const s=sn(e);return _jsx(Typography,{component:"span",className:classNames(s.status,s.aborted),"aria-label":"Status aborted","aria-hidden":"true",...e})}var hi=t(74600),An=t(15584);const pi=e=>(0,P.Z)({root:{fontWeight:e.typography.fontWeightBold,whiteSpace:"nowrap",paddingRight:e.spacing(4),border:"0",verticalAlign:"top"}}),fi={root:{border:"0",verticalAlign:"top"}},gi=e=>(0,P.Z)({root:{margin:e.spacing(0,0,-1,0)}}),wo=e=>(0,P.Z)({root:{padding:e.spacing(0,0,1,0)},random:{}}),mi=(0,on.Z)(pi,{name:"BackstageMetadataTableTitleCell"})(An.Z),vi=(0,on.Z)(fi,{name:"BackstageMetadataTableCell"})(An.Z),yi=({dense:e,children:s})=>_jsx(Table,{size:e?"small":"medium",children:_jsx(TableBody,{children:s})}),la=({title:e,children:s,...a})=>_jsxs(TableRow,{children:[e&&_jsx(mi,{children:e}),_jsx(vi,{colSpan:e?1:2,...a,children:s})]}),jo=(0,on.Z)(gi,{name:"BackstageMetadataTableList"})(({classes:e,children:s})=>(0,r.jsx)(jt.Z,{disablePadding:!0,className:e.root,children:s})),Gs=(0,on.Z)(wo,{name:"BackstageMetadataTableListItem"})(({classes:e,children:s})=>(0,r.jsx)(lt.Z,{className:e.root,children:s})),Ks=(0,P.Z)({root:{margin:"0 0",listStyleType:"none"}}),ns=e=>(0,P.Z)({root:{...Ks.root,paddingLeft:e.spacing(1)}}),Nr=(0,on.Z)(Ks,{name:"BackstageStructuredMetadataTableList"})(({classes:e,children:s})=>(0,r.jsx)(jo,{classes:e,children:s})),Fr=(0,on.Z)(ns,{name:"BackstageStructuredMetadataTableNestedList"})(({classes:e,children:s})=>(0,r.jsx)(jo,{classes:e,children:s}));function Eo(e,s){const a=e.map((d,p)=>_jsx(MetadataListItem,{children:rs(d)},p));return s?_jsx(Fr,{children:a}):_jsx(Nr,{children:a})}function Ys(e,s,a){const d=Object.keys(e).map(p=>{const v=rs(e[p],!0),j=a&&a.titleFormat?a.titleFormat(p):startCase(p);return _jsxs(MetadataListItem,{children:[_jsx(Typography,{variant:"body2",component:"span",children:`${j}: `}),v]},p)});return s?_jsx(Fr,{children:d}):_jsx(Nr,{children:d})}function rs(e,s,a){return React.isValidElement(e)?_jsx(Fragment,{children:e}):typeof e=="object"&&!Array.isArray(e)?Ys(e,s,a):Array.isArray(e)?Eo(e,a):typeof e=="boolean"?_jsx(Fragment,{children:e?"\u2705":"\u274C"}):_jsx(Typography,{variant:"body2",component:"span",children:e})}const Ao=({value:e,options:s})=>_jsx(Fragment,{children:rs(e,s)}),To=({title:e,value:s,options:a})=>_jsx(MetadataTableItem,{title:a&&a.titleFormat?a.titleFormat(e):startCase(e),children:_jsx(Ao,{value:s,options:a})});function Io(e,s){return Object.keys(e).map(a=>_jsx(To,{title:a,value:e[a],options:s},a))}function xi(e){const{metadata:s,dense:a=!0,options:d}=e,p=Io(s,d||{});return _jsx(MetadataTable,{dense:a,children:p})}var Ro=t(49429),mr=t(86136),ss=t(79784),Lo=t(19126),Js=t.n(Lo);function Qs(e){return qs.stringify(e,{strictNullHandling:!0})}function Xs(e){return qs.parse(e,{ignoreQueryPrefix:!0,strictNullHandling:!0})}function _s(e,s){return Xs(e)[s]}function Po(e,s,a){const d={...Xs(e),[s]:a};return Qs(d)}function bi(e,s=250){const[a,d]=useSearchParams(),p=a.toString(),[v,j]=useState(_s(p,e));return useEffect(()=>{const $=_s(p,e);j(G=>isEqual($,G)?G:$)},[p,j,e]),useDebouncedEffect(()=>{const $=Po(p,e,v);p!==$&&d($,{replace:!0})},[d,v,p,e],s),[v,j]}const Si={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 eo(){const s=(0,W.I_)().get(W.Ds),a=s==null?void 0:s.getOptionalConfig("app.support");if(!a)return Si;var d;return{url:a.getString("url"),items:a.getConfigArray("items").flatMap(p=>({title:p.getString("title"),icon:p.getOptionalString("icon"),links:((d=p.getOptionalConfigArray("links"))!==null&&d!==void 0?d:[]).flatMap(v=>({url:v.getString("url"),title:v.getString("title")}))}))}}var ko=t(80079);function _n(e,s){const d=(0,W.qD)().getSystemIcon(e);return d?(0,r.jsx)(d,{...s}):(0,r.jsx)(ko.Z,{...s})}function Ci(e){return _n("brokenImage",e)}function Oo(e){return _n("catalog",e)}function to(e){return _n("chat",e)}function wi(e){return _n("dashboard",e)}function ji(e){return _n("docs",e)}function Ei(e){return _n("email",e)}function Ai(e){return _n("github",e)}function ca(e){return _n("group",e)}function ks(e){return _n("help",e)}function Os(e){return _n("user",e)}function da(e){return _n("warning",e)}const Ti=(0,c.Z)({popoverList:{minWidth:260,maxWidth:400}},{name:"BackstageSupportButton"}),Bo=({icon:e})=>{const s=(0,W.qD)();var a;const d=e&&(a=s.getSystemIcon(e))!==null&&a!==void 0?a:ks;return(0,r.jsx)(d,{})};var Bs;const no=({link:e})=>(0,r.jsx)(_e,{to:e.url,children:(Bs=e.title)!==null&&Bs!==void 0?Bs:e.url}),Ii=({item:e})=>{var s;return(0,r.jsxs)(lt.Z,{children:[(0,r.jsx)(mr.Z,{children:(0,r.jsx)(Bo,{icon:e.icon})}),(0,r.jsx)(ft.Z,{primary:e.title,secondary:(s=e.links)===null||s===void 0?void 0:s.reduce((a,d,p)=>[...a,p>0&&(0,r.jsx)("br",{},p),(0,r.jsx)(no,{link:d},d.url)],[])})]})};function Ri(e){const{title:s,items:a,children:d}=e,{items:p}=eo(),[v,j]=(0,g.useState)(!1),[$,G]=(0,g.useState)(null),N=Ti(),pe=(0,Pe.Z)(Ie=>Ie.breakpoints.down("sm")),oe=Ie=>{G(Ie.currentTarget),j(!0)},xe=()=>{j(!1)};return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(Ee.Z,{display:"flex",ml:1,children:pe?(0,r.jsx)(gt.Z,{color:"primary",size:"small",onClick:oe,"data-testid":"support-button",children:(0,r.jsx)(ks,{})}):(0,r.jsx)(X.Z,{"data-testid":"support-button","aria-label":"support",color:"primary",onClick:oe,startIcon:(0,r.jsx)(ks,{}),children:"Support"})}),(0,r.jsxs)(ss.ZP,{"data-testid":"support-button-popover",open:v,anchorEl:$,anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"},onClose:xe,children:[(0,r.jsxs)(jt.Z,{className:N.popoverList,children:[s&&(0,r.jsx)(lt.Z,{alignItems:"flex-start",children:(0,r.jsx)(F.Z,{variant:"subtitle1",children:s})}),g.Children.map(d,(Ie,Ye)=>(0,r.jsx)(lt.Z,{alignItems:"flex-start",children:Ie},`child-${Ye}`)),(a!=null?a:p).map((Ie,Ye)=>(0,r.jsx)(Ii,{item:Ie},`item-${Ye}`))]}),(0,r.jsx)(Ro.Z,{children:(0,r.jsx)(X.Z,{color:"primary",onClick:xe,children:"Close"})})]})]})}var os=t(18671),is=t(16060);const as=72,ro=24,$o=18,lr={drawerWidthClosed:as,drawerWidthOpen:224,defaultOpenDelayMs:100,defaultCloseDelayMs:0,defaultFadeDuration:200,logoHeight:32,iconContainerWidth:as,iconSize:as-ro*2,iconPadding:ro,selectedIndicatorWidth:3,userBadgePadding:$o,userBadgeDiameter:as-$o*2,mobileSidebarHeight:56},Li=e=>({...lr,...e,iconContainerWidth:lr.drawerWidthClosed,iconSize:lr.drawerWidthClosed-lr.iconPadding*2,userBadgeDiameter:lr.drawerWidthClosed-lr.userBadgePadding*2}),Zo={drawerWidthClosed:0,drawerWidthOpen:202,defaultOpenDelayMs:lr.defaultOpenDelayMs+200},Hn=e=>({...Zo,...e}),ua="@backstage/core/sidebar-intro-dismissed",tr=(0,g.createContext)({sidebarConfig:lr,submenuConfig:Zo}),Do=(0,g.createContext)({isHoveredOn:!1,setIsHoveredOn:()=>{}});var Pi=t(50023),ki=t(4190),Oi=t(87685),Bi=t(44882),$s=t(51837);const No={isOpen:!1,setOpen:()=>{}},Fo=(0,g.createContext)(No),Uo=(0,$s.CT)("sidebar-open-state-context");function Mo(e){const{children:s,value:a}=e;return(0,r.jsx)(Fo.Provider,{value:a,children:(0,r.jsx)(Uo.Provider,{value:(0,$s.EI)({1:a}),children:s})})}const so=()=>{const e=(0,g.useContext)(Uo),s=(0,g.useContext)(Fo);if(e===void 0)return s||No;const a=e.atVersion(1);if(a===void 0)throw new Error("No context found for version 1.");return a};var oo=t(57998);const io={isPinned:!0,toggleSidebarPinState:()=>{},isMobile:!1},ao=(0,g.createContext)(io),lo=(0,$s.CT)("sidebar-pin-state-context");function zo(e){const{children:s,value:a}=e;return(0,r.jsx)(ao.Provider,{value:a,children:(0,r.jsx)(lo.Provider,{value:(0,$s.EI)({1:a}),children:s})})}const Ur=()=>{const e=(0,g.useContext)(lo),s=(0,g.useContext)(ao);if(e===void 0)return s||io;const a=e.atVersion(1);if(a===void 0)throw new Error("No context found for version 1.");return a},Wo=(0,c.Z)(e=>({root:{flexGrow:0,margin:e.spacing(0,2),color:e.palette.navigation.color},selected:s=>({color:`${e.palette.navigation.selectedColor}!important`,borderTop:`solid ${s.sidebarConfig.selectedIndicatorWidth}px ${e.palette.navigation.indicator}`,marginTop:"-1px"}),label:{display:"none"}})),Vo=e=>{const{to:s,label:a,icon:d,value:p}=e,{sidebarConfig:v}=(0,g.useContext)(tr),j=Wo({sidebarConfig:v}),$=(0,T.TH)(),{selectedMenuItemIndex:G,setSelectedMenuItemIndex:N}=(0,g.useContext)(Ko),pe=(xe,Ie)=>{N(Ie===G?-1:Ie)},oe=p===G&&G>=0||p!==G&&!(G>=0)&&s===$.pathname;return(0,r.jsx)(oo.Z,{label:a,icon:d,component:_e,to:s||$.pathname,onChange:pe,value:p,selected:oe,classes:j})},co=e=>{const{children:s,to:a,label:d,icon:p,value:v}=e,{isMobile:j}=Ur();return j?(0,r.jsx)(Vo,{to:a,label:d,icon:p,value:v}):(0,r.jsx)(r.Fragment,{children:s})},uo=(0,c.Z)(e=>({root:{position:"fixed",backgroundColor:e.palette.navigation.background,color:e.palette.navigation.color,bottom:0,left:0,right:0,zIndex:e.zIndex.snackbar,borderTop:"1px solid #383838"},overlay:s=>({background:e.palette.navigation.background,width:"100%",bottom:`${s.sidebarConfig.mobileSidebarHeight}px`,height:`calc(100% - ${s.sidebarConfig.mobileSidebarHeight}px)`,flex:"0 1 auto",overflow:"auto"}),overlayHeader:{display:"flex",color:e.palette.text.primary,alignItems:"center",justifyContent:"space-between",padding:e.spacing(2,3)},overlayHeaderClose:{color:e.palette.text.primary},marginMobileSidebar:s=>({marginBottom:`${s.sidebarConfig.mobileSidebarHeight}px`})})),$i=e=>(0,se.orderBy)(e,({props:{priority:s}})=>Number.isInteger(s)?s:-1,"desc"),Ho=g.createElement(co).type,Go=({children:e,label:s="Menu",open:a,onClose:d})=>{const{sidebarConfig:p}=(0,g.useContext)(tr),v=uo({sidebarConfig:p});return(0,r.jsxs)(ki.ZP,{anchor:"bottom",open:a,onClose:d,ModalProps:{BackdropProps:{classes:{root:v.marginMobileSidebar}}},classes:{root:v.marginMobileSidebar,paperAnchorBottom:v.overlay},children:[(0,r.jsxs)(Ee.Z,{className:v.overlayHeader,children:[(0,r.jsx)(F.Z,{variant:"h3",children:s}),(0,r.jsx)(gt.Z,{onClick:d,classes:{root:v.overlayHeaderClose},children:(0,r.jsx)(Oi.Z,{})})]}),(0,r.jsx)(Ee.Z,{component:"nav",children:e})]})},Ko=(0,g.createContext)({selectedMenuItemIndex:-1,setSelectedMenuItemIndex:()=>{}}),Yo=e=>{const{sidebarConfig:s}=(0,g.useContext)(tr),{children:a}=e,d=uo({sidebarConfig:s}),p=(0,T.TH)(),[v,j]=(0,g.useState)(-1);(0,g.useEffect)(()=>{j(-1)},[p.pathname]);let $=(0,W.vJ)(a,N=>N.getElements().filter(pe=>pe.type===Ho));if(a)$.length?$=$i($):$.push((0,r.jsx)(co,{icon:(0,r.jsx)(Bi.Z,{}),children:a},"default_menu"));else return null;const G=v>=0&&!$[v].props.to;return(0,r.jsx)(Mo,{value:{isOpen:!0,setOpen:()=>{}},children:(0,r.jsxs)(Ko.Provider,{value:{selectedMenuItemIndex:v,setSelectedMenuItemIndex:j},children:[(0,r.jsx)(Go,{label:$[v]&&$[v].props.label,open:G,onClose:()=>j(-1),children:$[v]&&$[v].props.children}),(0,r.jsx)(Pi.Z,{className:d.root,"data-testid":"mobile-sidebar-root",component:"nav",children:$})]})})};var ls;(function(e){e.SIDEBAR_PIN_STATE="sidebarPinState"})(ls||(ls={}));const ho={getSidebarPinState(){let e;try{e=JSON.parse(window.localStorage.getItem(ls.SIDEBAR_PIN_STATE)||"true")}catch{return!0}return!!e},setSidebarPinState(e){return window.localStorage.setItem(ls.SIDEBAR_PIN_STATE,JSON.stringify(e))}},Jo=(0,c.Z)(e=>({root:{width:"100%",transition:"padding-left 0.1s ease-out",isolation:"isolate",[e.breakpoints.up("sm")]:{paddingLeft:s=>s.isPinned?s.sidebarConfig.drawerWidthOpen:s.sidebarConfig.drawerWidthClosed},[e.breakpoints.down("xs")]:{paddingBottom:s=>s.sidebarConfig.mobileSidebarHeight}},content:{zIndex:0,isolation:"isolate","&:focus":{outline:0}}}),{name:"BackstageSidebarPage"}),po=(0,g.createContext)({content:{contentRef:void 0}});function Qo(e){const[s,a]=(0,g.useState)(()=>ho.getSidebarPinState()),{sidebarConfig:d}=(0,g.useContext)(tr),p=(0,g.useRef)(null),v=(0,g.useMemo)(()=>({content:{contentRef:p}}),[p]);(0,g.useEffect)(()=>{ho.setSidebarPinState(s)},[s]);const j=(0,Pe.Z)(N=>N.breakpoints.down("xs"),{noSsr:!0}),$=()=>a(!s),G=Jo({isPinned:s,sidebarConfig:d});return(0,r.jsx)(zo,{value:{isPinned:s,toggleSidebarPinState:$,isMobile:j},children:(0,r.jsx)(po.Provider,{value:v,children:(0,r.jsx)(Ee.Z,{className:G.root,children:e.children})})})}function fo(){const{content:e}=(0,g.useContext)(po);return{focusContent:(0,g.useCallback)(()=>{var a,d;e==null||(a=e.contentRef)===null||a===void 0||(d=a.current)===null||d===void 0||d.focus()},[e]),contentRef:e==null?void 0:e.contentRef}}const er=(0,c.Z)(e=>({drawer:s=>({display:"flex",flexFlow:"column nowrap",alignItems:"flex-start",position:"fixed",left:0,top:0,bottom:0,zIndex:e.zIndex.appBar,background:e.palette.navigation.background,overflowX:"hidden",msOverflowStyle:"none",scrollbarWidth:"none",width:s.sidebarConfig.drawerWidthClosed,transition:e.transitions.create("width",{easing:e.transitions.easing.sharp,duration:e.transitions.duration.shortest}),"& > *":{flexShrink:0},"&::-webkit-scrollbar":{display:"none"},"& .MuiButtonBase-root":{textTransform:"none"}}),drawerOpen:s=>({width:s.sidebarConfig.drawerWidthOpen,transition:e.transitions.create("width",{easing:e.transitions.easing.sharp,duration:e.transitions.duration.shorter})}),visuallyHidden:{top:0,position:"absolute",zIndex:1e3,transform:"translateY(-200%)","&:focus":{transform:"translateY(5px)"}}}),{name:"BackstageSidebar"});var Gn;(function(e){e[e.Closed=0]="Closed",e[e.Idle=1]="Idle",e[e.Open=2]="Open"})(Gn||(Gn={}));const Xo=e=>{const{sidebarConfig:s}=(0,g.useContext)(tr),{openDelayMs:a=s.defaultOpenDelayMs,closeDelayMs:d=s.defaultCloseDelayMs,disableExpandOnHover:p,children:v}=e,j=er({sidebarConfig:s}),$=(0,Pe.Z)(Kt=>Kt.breakpoints.down("md"),{noSsr:!0}),[G,N]=(0,g.useState)(Gn.Closed),pe=(0,g.useRef)(),{isPinned:oe,toggleSidebarPinState:xe}=Ur(),Ie=()=>{oe||p||(pe.current&&(clearTimeout(pe.current),pe.current=void 0),G!==Gn.Open&&!$&&(pe.current=window.setTimeout(()=>{pe.current=void 0,N(Gn.Open)},a),N(Gn.Idle)))},Ye=()=>{oe||p||(pe.current&&(clearTimeout(pe.current),pe.current=void 0),G===Gn.Idle?N(Gn.Closed):G===Gn.Open&&(pe.current=window.setTimeout(()=>{pe.current=void 0,N(Gn.Closed)},d)))},qe=G===Gn.Open&&!$||oe,Pt=Kt=>{Kt?(N(Gn.Open),xe()):(N(Gn.Closed),xe())};return(0,r.jsxs)("nav",{style:{},"aria-label":"sidebar nav",children:[(0,r.jsx)(go,{}),(0,r.jsx)(Mo,{value:{isOpen:qe,setOpen:Pt},children:(0,r.jsx)(Ee.Z,{className:j.root,"data-testid":"sidebar-root",onMouseEnter:p?()=>{}:Ie,onFocus:p?()=>{}:Ie,onMouseLeave:p?()=>{}:Ye,onBlur:p?()=>{}:Ye,children:(0,r.jsx)(Ee.Z,{className:ce()(j.drawer,{[j.drawerOpen]:qe}),children:v})})})]})},qo=e=>{var s;const a=Li((s=e.sidebarOptions)!==null&&s!==void 0?s:{});var d;const p=Hn((d=e.submenuOptions)!==null&&d!==void 0?d:{}),{children:v,disableExpandOnHover:j,openDelayMs:$,closeDelayMs:G}=e,{isMobile:N}=Ur();return N?(0,r.jsx)(Yo,{children:v}):(0,r.jsx)(tr.Provider,{value:{sidebarConfig:a,submenuConfig:p},children:(0,r.jsx)(Xo,{openDelayMs:$,closeDelayMs:G,disableExpandOnHover:j,children:v})})};function go(){const{sidebarConfig:e}=(0,g.useContext)(tr),{focusContent:s,contentRef:a}=fo(),d=er({sidebarConfig:e});return a!=null&&a.current?(0,r.jsx)(X.Z,{onClick:s,variant:"contained",className:ce()(d.visuallyHidden),children:"Skip to content"}):null}function mo(e,s){const a=new URLSearchParams(s.search).toString(),d=Js().parse(a),p=new URLSearchParams(e.search).toString(),v=Js().parse(p);return(0,se.isEqual)(s.pathname,e.pathname)&&(0,se.isMatch)(v,d)}const _o=(0,c.Z)(e=>({item:{height:48,width:"100%","&:hover":{background:"#6f6f6f",color:e.palette.navigation.selectedColor},display:"flex",alignItems:"center",color:e.palette.navigation.color,padding:e.spacing(2.5),cursor:"pointer",position:"relative",background:"none",border:"none"},itemContainer:{width:"100%"},selected:{background:"#6f6f6f",color:"#FFF"},label:{margin:e.spacing(1.75),marginLeft:e.spacing(1),fontSize:e.typography.body2.fontSize,whiteSpace:"nowrap",overflow:"hidden","text-overflow":"ellipsis",lineHeight:1},subtitle:{fontSize:10,whiteSpace:"nowrap",overflow:"hidden","text-overflow":"ellipsis"},dropdownArrow:{position:"absolute",right:21},dropdown:{display:"flex",flexDirection:"column",alignItems:"end"},dropdownItem:{width:"100%",padding:"10px 0 10px 0","&:hover":{background:"#6f6f6f",color:e.palette.navigation.selectedColor}},textContent:{color:e.palette.navigation.color,paddingLeft:e.spacing(4),paddingRight:e.spacing(1),fontSize:e.typography.body2.fontSize,whiteSpace:"nowrap",overflow:"hidden","text-overflow":"ellipsis"}}),{name:"BackstageSidebarSubmenuItem"}),Zi=e=>{const{title:s,subtitle:a,to:d,icon:p,dropdownItems:v}=e,j=_o(),{setIsHoveredOn:$}=useContext(SidebarItemWithSubmenuContext),G=()=>{$(!1)},N=useResolvedPath(d!=null?d:""),pe=useLocation();let oe=isLocationMatch(pe,N);const[xe,Ie]=useState(!1),Ye=()=>{Ie(!xe)};return v!==void 0?(v.some(qe=>{const Pt=resolvePath(qe.to);return oe=isLocationMatch(pe,Pt),oe}),_jsxs(Box,{className:j.itemContainer,children:[_jsx(Tooltip,{title:s,enterDelay:500,enterNextDelay:500,children:_jsxs(Button,{role:"button",onClick:Ye,onTouchStart:qe=>qe.stopPropagation(),className:classnames(j.item,oe?j.selected:void 0),children:[p&&_jsx(p,{fontSize:"small"}),_jsxs(Typography,{variant:"subtitle1",className:j.label,children:[s,_jsx("br",{}),a&&_jsx(Typography,{variant:"caption",className:j.subtitle,children:a})]}),xe?_jsx(ArrowDropUpIcon,{className:j.dropdownArrow}):_jsx(ArrowDropDownIcon,{className:j.dropdownArrow})]})}),v&&xe&&_jsx(Box,{className:j.dropdown,children:v.map((qe,Pt)=>_jsx(Tooltip,{title:qe.title,enterDelay:500,enterNextDelay:500,children:_jsx(Link,{to:qe.to,underline:"none",className:j.dropdownItem,onClick:G,onTouchStart:Kt=>Kt.stopPropagation(),children:_jsx(Typography,{className:j.textContent,children:qe.title})})},Pt))})]})):_jsx(Box,{className:j.itemContainer,children:_jsx(Tooltip,{title:s,enterDelay:500,enterNextDelay:500,children:_jsxs(Link,{to:d,underline:"none",className:classnames(j.item,oe?j.selected:void 0),onClick:G,onTouchStart:qe=>qe.stopPropagation(),children:[p&&_jsx(p,{fontSize:"small"}),_jsxs(Typography,{variant:"subtitle1",className:j.label,children:[s,_jsx("br",{}),a&&_jsx(Typography,{variant:"caption",className:j.subtitle,children:a})]})]})})})};var Zs;const Di=(0,c.Z)(e=>({root:{zIndex:1e3,position:"relative",overflow:"visible",width:e.spacing(7)+1},drawer:s=>{var a;return{display:"flex",flexFlow:"column nowrap",alignItems:"flex-start",position:"fixed",[e.breakpoints.up("sm")]:{marginLeft:s.left,transition:e.transitions.create("margin-left",{easing:e.transitions.easing.sharp,duration:e.transitions.duration.shortest})},top:0,bottom:0,padding:0,background:(Zs=(a=e.palette.navigation.submenu)===null||a===void 0?void 0:a.background)!==null&&Zs!==void 0?Zs:"#404040",overflowX:"hidden",msOverflowStyle:"none",scrollbarWidth:"none",cursor:"default",width:s.submenuConfig.drawerWidthClosed,transitionDelay:`${s.submenuConfig.defaultOpenDelayMs}ms`,"& > *":{flexShrink:0},"&::-webkit-scrollbar":{display:"none"}}},drawerOpen:s=>({width:s.submenuConfig.drawerWidthOpen,[e.breakpoints.down("xs")]:{width:"100%",position:"relative",paddingLeft:e.spacing(3),left:0,top:0}}),title:{fontSize:e.typography.h5.fontSize,fontWeight:e.typography.fontWeightMedium,color:"#FFF",padding:e.spacing(2.5),[e.breakpoints.down("xs")]:{display:"none"}}}),{name:"BackstageSidebarSubmenu"}),ei=e=>{const{isOpen:s}=so(),{sidebarConfig:a,submenuConfig:d}=(0,g.useContext)(tr),p=s?a.drawerWidthOpen:a.drawerWidthClosed,v=Di({left:p,submenuConfig:d}),{isHoveredOn:j}=(0,g.useContext)(Do),[$,G]=(0,g.useState)(!1);return(0,g.useEffect)(()=>{G(j)},[j]),(0,r.jsxs)(Ee.Z,{className:ce()(v.drawer,{[v.drawerOpen]:$}),children:[(0,r.jsx)(F.Z,{variant:"h5",className:v.title,children:e.title}),e.children]})};var i=t(26739),n=t(76600),o=t(83543),l=t(59797),f=t(98989);const L=(0,c.Z)({iconContainer:{display:"flex",position:"relative",width:"100%"},arrow1:{right:"6px",position:"absolute"}}),Z=()=>{const e=L();return _jsxs(Box,{className:e.iconContainer,children:[_jsx(Box,{className:e.arrow1,children:_jsx(ArrowBackIosIcon,{style:{fontSize:"12px"}})}),_jsx(Box,{children:_jsx(ArrowBackIosIcon,{style:{fontSize:"12px"}})})]})};var H=null;const re=(0,c.Z)({iconContainer:{display:"flex",position:"relative",width:"100%"},arrow1:{right:"6px",position:"absolute"}}),He=()=>{const e=re();return _jsxs(Box,{className:e.iconContainer,children:[_jsx(Box,{className:e.arrow1,children:_jsx(ArrowForwardIosIcon,{style:{fontSize:"12px"}})}),_jsx(Box,{children:_jsx(ArrowForwardIosIcon,{style:{fontSize:"12px"}})})]})};var De=null,ut,ot;const Ct=e=>(0,c.Z)(s=>{var a,d;return{root:{color:s.palette.navigation.color,display:"flex",flexFlow:"row nowrap",alignItems:"center",height:48,cursor:"pointer"},buttonItem:{background:"none",border:"none",width:"100%",margin:0,padding:0,textAlign:"inherit",font:"inherit"},closed:{width:e.drawerWidthClosed,justifyContent:"center"},open:{[s.breakpoints.up("sm")]:{width:e.drawerWidthOpen}},highlightable:{"&:hover":{background:(ut=(a=s.palette.navigation.navItem)===null||a===void 0?void 0:a.hoverBackground)!==null&&ut!==void 0?ut:"#404040"}},highlighted:{background:(ot=(d=s.palette.navigation.navItem)===null||d===void 0?void 0:d.hoverBackground)!==null&&ot!==void 0?ot:"#404040"},label:{fontWeight:"bold",whiteSpace:"nowrap",lineHeight:"auto",flex:"3 1 auto",width:"110px",overflow:"hidden","text-overflow":"ellipsis"},iconContainer:{boxSizing:"border-box",height:"100%",width:e.iconContainerWidth,marginRight:-s.spacing(2),display:"flex",alignItems:"center",justifyContent:"center",lineHeight:"0"},searchRoot:{marginBottom:12},searchField:{color:"#b5b5b5",fontWeight:s.typography.fontWeightBold,fontSize:s.typography.fontSize},searchFieldHTMLInput:{padding:s.spacing(2,0,2)},searchContainer:{width:e.drawerWidthOpen-e.iconContainerWidth},secondaryAction:{width:s.spacing(6),textAlign:"center",marginRight:s.spacing(1)},closedItemIcon:{width:"100%",justifyContent:"center"},submenuArrow:{display:"flex"},expandButton:{background:"none",border:"none",color:s.palette.navigation.color,width:"100%",cursor:"pointer",position:"relative",height:48},arrows:{position:"absolute",right:10},selected:{"&$root":{borderLeft:`solid ${e.selectedIndicatorWidth}px ${s.palette.navigation.indicator}`,color:s.palette.navigation.selectedColor},"&$closed":{width:e.drawerWidthClosed},"& $closedItemIcon":{paddingRight:e.selectedIndicatorWidth},"& $iconContainer":{marginLeft:-e.selectedIndicatorWidth}}}},{name:"BackstageSidebarItem"});function St(e){return(0,g.useMemo)(()=>Ct(e),[e])()}const $t=(e,s)=>(0,W.vJ)(e.props.children,a=>{let d=!1;return a.getElements().forEach(({props:{to:p,dropdownItems:v}})=>{if(!d){if(v!=null&&v.length){v.forEach(({to:j})=>d=d||mo(s,(0,is.i3)(j)));return}p&&(d=mo(s,(0,is.i3)(p)))}}),d},[s.pathname]);function Et(e){return e.to===void 0}const Tn=g.createElement(ei).type,Kn=g.forwardRef(function({to:s,end:a,style:d,className:p,activeStyle:v,caseSensitive:j,activeClassName:$="active","aria-current":G="page",...N},pe){let{pathname:oe}=(0,T.TH)(),{pathname:xe}=(0,T.WU)(s);j||(oe=oe.toLocaleLowerCase("en-US"),xe=xe.toLocaleLowerCase("en-US"));let Ie=oe===xe;!Ie&&!a&&(Ie=oe.startsWith(`${xe}/`));const Ye=Ie?G:void 0;return(0,r.jsx)(R.rU,{...N,to:s,ref:pe,"aria-current":Ye,style:{...d,...Ie?v:void 0},className:ce()([p,Ie?$:void 0])})}),nr=(0,g.forwardRef)((e,s)=>{const{icon:a,text:d,hasNotifications:p=!1,hasSubmenu:v=!1,disableHighlight:j=!1,onClick:$,children:G,className:N,...pe}=e,{sidebarConfig:oe}=(0,g.useContext)(tr),xe=St(oe),{isOpen:Ie}=so(),Ye=!Ie&&v?{display:"flex",marginLeft:"20px"}:{lineHeight:"0"},qe=(0,r.jsxs)(Ee.Z,{style:Ye,children:[(0,r.jsx)(a,{fontSize:"small"}),!Ie&&v?(0,r.jsx)(f.Z,{fontSize:"small"}):(0,r.jsx)(r.Fragment,{})]}),Pt=(0,r.jsx)(i.Z,{color:"secondary",variant:"dot",overlap:"circular",invisible:!p,className:ce()({[xe.closedItemIcon]:!Ie}),children:qe}),Kt=(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(Ee.Z,{"data-testid":"login-button",className:xe.iconContainer,children:Pt}),d&&(0,r.jsx)(F.Z,{variant:"subtitle2",className:xe.label,children:d}),(0,r.jsx)("div",{className:xe.secondaryAction,children:G})]}),tn=Ie?Kt:Pt,nn={onClick:$,className:ce()(N,xe.root,Ie?xe.open:xe.closed,Et(e)&&xe.buttonItem,{[xe.highlightable]:!j})};return Et(e)?(0,r.jsx)(X.Z,{role:"button","aria-label":d,...nn,ref:s,children:tn}):(0,r.jsx)(Kn,{...nn,activeClassName:xe.selected,to:e.to?e.to:"",ref:s,"aria-label":d||e.to,...pe,children:tn})}),cs=({children:e,...s})=>{const{sidebarConfig:a}=(0,g.useContext)(tr),d=St(a),[p,v]=(0,g.useState)(!1),j=(0,T.TH)(),$=$t(e,j),G=(0,Pe.Z)(xe=>xe.breakpoints.down("sm")),N=()=>{v(!0)},pe=()=>{v(!1)},oe=()=>G?p?(0,r.jsx)(l.Z,{fontSize:"small",className:d.submenuArrow}):(0,r.jsx)(o.Z,{fontSize:"small",className:d.submenuArrow}):!p&&(0,r.jsx)(f.Z,{fontSize:"small",className:d.submenuArrow});return(0,r.jsx)(Do.Provider,{value:{isHoveredOn:p,setIsHoveredOn:v},children:(0,r.jsxs)("div",{"data-testid":"item-with-submenu",onMouseLeave:pe,onTouchStart:p?pe:N,onMouseEnter:N,className:ce()(p&&d.highlighted),children:[(0,r.jsx)(nr,{hasSubmenu:!0,className:$?d.selected:"",...s,children:oe()}),p&&e]})})},vo=(0,g.forwardRef)((e,s)=>{const[a]=(0,W.vJ)(e.children,d=>d.getElements().filter(p=>p.type===Tn));return a?(0,r.jsx)(cs,{...e,children:a}):(0,r.jsx)(nr,{...e,ref:s})});function Ni(e){const{sidebarConfig:s}=useContext(SidebarConfigContext),[a,d]=useState(""),p=St(s),v=e.icon?e.icon:SearchIcon,j=()=>{e.onSearch(a),d("")},$=oe=>{oe.key==="Enter"&&(oe.preventDefault(),j())},G=oe=>{d(oe.target.value)},N=oe=>{oe.preventDefault(),oe.stopPropagation()},pe=oe=>{j(),oe.preventDefault()};return _jsx(Box,{className:p.searchRoot,children:_jsx(vo,{icon:v,to:e.to,onClick:pe,disableHighlight:!0,children:_jsx(TextField,{placeholder:"Search",value:a,onClick:N,onChange:G,onKeyDown:$,className:p.searchContainer,InputProps:{disableUnderline:!0,className:p.searchField},inputProps:{className:p.searchFieldHTMLInput}})})})}const yo=(0,n.Z)("div")({flex:1},{name:"BackstageSidebarSpace"}),Fi=(0,n.Z)("div")({height:8},{name:"BackstageSidebarSpacer"}),Ar=(0,n.Z)("hr")(({theme:e})=>({height:1,width:"100%",background:"#383838",border:"none",margin:e.spacing(1.2,0)}),{name:"BackstageSidebarDivider"}),ha=e=>({overflowY:"auto","&::-webkit-scrollbar":{backgroundColor:e.palette.background.default,width:"5px",borderRadius:"5px"},"&::-webkit-scrollbar-thumb":{backgroundColor:e.palette.text.hint,borderRadius:"5px"}}),Wl=(0,n.Z)("div")(({theme:e})=>{const s=ha(e);return{flex:"0 1 auto",overflowX:"hidden",width:"calc(100% - 5px)",minHeight:"48px",overflowY:"hidden","@media (hover: none)":s,"&:hover":s}}),Vl=()=>{const{sidebarConfig:e}=useContext(SidebarConfigContext),s=St(e),{isOpen:a,setOpen:d}=useSidebarOpenState();if(useMediaQuery(j=>j.breakpoints.down("md"),{noSsr:!0}))return null;const v=()=>{d(!a)};return _jsx(Button,{role:"button",onClick:v,className:s.expandButton,"aria-label":"Expand Sidebar","data-testid":"sidebar-expand-button",children:_jsx(Box,{className:s.arrows,children:a?_jsx(DoubleArrowLeft,{}):_jsx(DoubleArrowRight,{})})})},pa=(0,c.Z)(e=>({introCard:s=>({color:"#b5b5b5",fontSize:12,width:s.sidebarConfig.drawerWidthOpen,marginTop:e.spacing(2.25),marginBottom:e.spacing(1.5),paddingLeft:s.sidebarConfig.iconPadding,paddingRight:s.sidebarConfig.iconPadding}),introDismiss:{display:"flex",justifyContent:"flex-end",alignItems:"center",marginTop:e.spacing(1.5)},introDismissLink:{color:"#dddddd",display:"flex",alignItems:"center",marginBottom:e.spacing(.5),"&:hover":{color:e.palette.linkHover,transition:e.transitions.create("color",{easing:e.transitions.easing.sharp,duration:e.transitions.duration.shortest})}},introDismissText:{fontSize:"0.7rem",fontWeight:"bold",textTransform:"uppercase",letterSpacing:1},introDismissIcon:{width:18,height:18,marginRight:e.spacing(1.5)}}),{name:"BackstageSidebarIntro"});function fa(e){const{sidebarConfig:s}=useContext(SidebarConfigContext),a=pa({sidebarConfig:s}),{text:d,onClose:p}=e,v=()=>p();return _jsxs(Box,{className:a.introCard,children:[_jsx(Typography,{variant:"subtitle2",children:d}),_jsx(Box,{className:a.introDismiss,children:_jsxs(IconButton,{onClick:v,className:a.introDismissLink,children:[_jsx(CloseIcon,{className:a.introDismissIcon}),_jsx(Typography,{component:"span",className:a.introDismissText,children:"Dismiss"})]})})]})}const Ui=e=>{const{text:s,onDismiss:a}=e,[d,p]=useState(!1),v=()=>{p(!0)};return _jsx(Collapse,{in:!d,onExited:a,children:_jsx(fa,{text:s,onClose:v})})},ga=null,ma="And your recently viewed plugins will pop up here!";function Hl(e){const{isOpen:s}=useSidebarOpenState(),a={starredItemsDismissed:!1,recentlyViewedItemsDismissed:!1},{value:d,set:p}=useLocalStorageValue(SIDEBAR_INTRO_LOCAL_STORAGE),{starredItemsDismissed:v,recentlyViewedItemsDismissed:j}=d!=null?d:{},$=()=>{p(N=>({...a,...N,starredItemsDismissed:!0}))},G=()=>{p(N=>({...a,...N,recentlyViewedItemsDismissed:!0}))};return s?_jsxs(_Fragment,{children:[!v&&_jsxs(_Fragment,{children:[_jsx(Ui,{text:ga,onDismiss:$}),_jsx(SidebarDivider,{})]}),!j&&_jsx(Ui,{text:ma,onDismiss:G})]}):null}const va=(0,c.Z)(e=>({root:{gridArea:"pageContent",minWidth:0,paddingTop:e.spacing(3),paddingBottom:e.spacing(3),paddingLeft:e.spacing(2),paddingRight:e.spacing(2),[e.breakpoints.up("sm")]:{paddingLeft:e.spacing(3),paddingRight:e.spacing(3)}},stretch:{display:"flex",flexDirection:"column",flexGrow:1},noPadding:{padding:0}}),{name:"BackstageContent"});function Mi(e){const{className:s,stretch:a,noPadding:d,children:p,...v}=e,{contentRef:j}=fo(),$=va();return(0,r.jsx)("article",{ref:j,tabIndex:-1,...v,className:ce()($.root,s,{[$.stretch]:a,[$.noPadding]:d}),children:p})}var ya=t(6487),xa=t(99152);const ba=(0,c.Z)(e=>({tabsWrapper:{gridArea:"pageSubheader",backgroundColor:e.palette.background.paper,paddingLeft:e.spacing(3),minWidth:0},defaultTab:{...e.typography.caption,padding:e.spacing(3,3),textTransform:"uppercase",fontWeight:e.typography.fontWeightBold,color:e.palette.text.secondary},selected:{color:e.palette.text.primary},tabRoot:{"&:hover":{backgroundColor:e.palette.background.default,color:e.palette.text.primary}}}),{name:"BackstageHeaderTabs"});function zi(e){const{tabs:s,onChange:a,selectedIndex:d}=e,[p,v]=(0,g.useState)(d!=null?d:0),j=ba(),$=(0,g.useCallback)((G,N)=>{d===void 0&&v(N),a&&d!==N&&a(N)},[d,a]);return(0,g.useEffect)(()=>{d!==void 0&&v(d)},[d]),(0,r.jsx)(Ee.Z,{className:j.tabsWrapper,children:(0,r.jsx)(xa.Z,{selectionFollowsFocus:!0,indicatorColor:"primary",textColor:"inherit",variant:"scrollable",scrollButtons:"auto","aria-label":"scrollable auto tabs example",onChange:$,value:p,children:s.map((G,N)=>(0,g.createElement)(ya.Z,{...G.tabProps,"data-testid":`header-tab-${N}`,label:G.label,key:G.id,value:N,className:j.defaultTab,classes:{selected:j.selected,root:j.tabRoot}}))})})}function Sa(e){const s=(0,T.UO)(),d=e.map(({path:xe,children:Ie})=>({caseSensitive:!1,path:`${xe}/*`,element:Ie})).sort((xe,Ie)=>Ie.path.replace(/\/\*$/,"").localeCompare(xe.path.replace(/\/\*$/,"")));var p;const v=(p=(0,T.V$)(d))!==null&&p!==void 0?p:e[0].children;var j;let $=(j=s["*"])!==null&&j!==void 0?j:"";$.startsWith("/")||($=`/${$}`);var G;const[N]=(G=(0,is.fp)(d,$))!==null&&G!==void 0?G:[],pe=N?e.findIndex(xe=>`${xe.path}/*`===N.route.path):0;var oe;return{index:pe===-1?0:pe,element:v,route:(oe=e[pe])!==null&&oe!==void 0?oe:e[0]}}function Wi(e){const{routes:s}=e,a=(0,T.s0)(),{index:d,route:p,element:v}=Sa(s),j=(0,g.useMemo)(()=>s.map(G=>({id:G.path,label:G.title,tabProps:G.tabProps})),[s]),$=G=>{let{path:N}=s[G];N=N.replace(/\/\*$/,""),N=N.replace(/^\//,""),a(N)};return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(zi,{tabs:j,selectedIndex:d,onChange:$}),(0,r.jsxs)(Mi,{children:[(0,r.jsx)(os.q,{title:p.title}),v]})]})}const ti=()=>null;(0,W.R5)(ti,"core.gatherMountPoints",!0);function Vi(e){const s=(0,r.jsx)(ti,{path:"",title:"",children:(0,r.jsx)("div",{})}).type;return g.Children.toArray(e).flatMap(a=>{if(!(0,g.isValidElement)(a))return[];if(a.type===g.Fragment)return Vi(a.props.children);if(a.type!==s)throw new Error("Child of TabbedLayout must be an TabbedLayout.Route");const{path:d,title:p,children:v,tabProps:j}=a.props;return[{path:d,title:p,children:v,tabProps:j}]})}function Ca(e){const s=Vi(e.children);return(0,r.jsx)(Wi,{routes:s})}Ca.Route=ti;const wa=(0,c.Z)(e=>({value:{marginBottom:e.spacing(.75)},subvalue:{color:e.palette.textSubtle,fontWeight:"normal"}}),{name:"BackstageSubvalueCell"});function ja(e){const{value:s,subvalue:a}=e,d=wa();return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(Ee.Z,{className:d.value,children:s}),(0,r.jsx)(Ee.Z,{className:d.subvalue,children:a})]})}var xo=t(67222),Ea=t(21070),Aa=t(90324),Ta=t(98281),Ia=t(48049),Hi=t(51209),Gi=t(33375),Ra=t(44233),La=t(27604),ni=t(36444),Pa=t(37971),ka=t(59709),Oa=t(17373),Ba=t(3702),$a=t(93111);const Za=(0,c.Z)(e=>({root:{height:"100%",width:"315px",display:"flex",flexDirection:"column",marginRight:e.spacing(3)},value:{fontWeight:"bold",fontSize:18},header:{display:"flex",alignItems:"center",height:e.spacing(7.5),justifyContent:"space-between",borderBottom:`1px solid ${e.palette.grey[500]}`},filters:{display:"flex",flexDirection:"column","& > *":{marginTop:e.spacing(2)}}}),{name:"BackstageTableFilters"}),Da=e=>{var s;const a=Za(),{onChangeFilters:d}=e,[p,v]=(0,g.useState)({...e.selectedFilters}),[j,$]=(0,g.useState)(!1),G=()=>{v({}),$(N=>!N)};return(0,g.useEffect)(()=>{d(p)},[p,d]),(0,r.jsxs)(Ee.Z,{className:a.root,children:[(0,r.jsxs)(Ee.Z,{className:a.header,children:[(0,r.jsx)(Ee.Z,{className:a.value,children:"Filters"}),(0,r.jsx)(X.Z,{color:"primary",onClick:G,children:"Clear all"})]}),(0,r.jsx)(Ee.Z,{className:a.filters,children:((s=e.filters)===null||s===void 0?void 0:s.length)&&e.filters.map(N=>(0,r.jsx)(Ze,{triggerReset:j,...N.element,selected:p[N.element.label],onChange:pe=>v({...p,[N.element.label]:pe})},N.element.label))})]})},Ki={Add:(0,g.forwardRef)((e,s)=>(0,r.jsx)(Ea.Z,{...e,ref:s})),Check:(0,g.forwardRef)((e,s)=>(0,r.jsx)(Ta.Z,{...e,ref:s})),Clear:(0,g.forwardRef)((e,s)=>(0,r.jsx)(Gi.Z,{...e,ref:s})),Delete:(0,g.forwardRef)((e,s)=>(0,r.jsx)(Ra.Z,{...e,ref:s})),DetailPanel:(0,g.forwardRef)((e,s)=>(0,r.jsx)(Hi.Z,{...e,ref:s})),Edit:(0,g.forwardRef)((e,s)=>(0,r.jsx)(La.Z,{...e,ref:s})),Export:(0,g.forwardRef)((e,s)=>(0,r.jsx)(Ba.Z,{...e,ref:s})),Filter:(0,g.forwardRef)((e,s)=>(0,r.jsx)(ni.Z,{...e,ref:s})),FirstPage:(0,g.forwardRef)((e,s)=>(0,r.jsx)(Pa.Z,{...e,ref:s})),LastPage:(0,g.forwardRef)((e,s)=>(0,r.jsx)(ka.Z,{...e,ref:s})),NextPage:(0,g.forwardRef)((e,s)=>(0,r.jsx)(Hi.Z,{...e,ref:s})),PreviousPage:(0,g.forwardRef)((e,s)=>(0,r.jsx)(Ia.Z,{...e,ref:s})),ResetSearch:(0,g.forwardRef)((e,s)=>(0,r.jsx)(Gi.Z,{...e,ref:s})),Search:(0,g.forwardRef)((e,s)=>(0,r.jsx)(ni.Z,{...e,ref:s})),SortArrow:(0,g.forwardRef)((e,s)=>(0,r.jsx)(Aa.Z,{...e,ref:s})),ThirdStateCheck:(0,g.forwardRef)((e,s)=>(0,r.jsx)(Oa.Z,{...e,ref:s})),ViewColumn:(0,g.forwardRef)((e,s)=>(0,r.jsx)($a.Z,{...e,ref:s}))};function Yi(e,s){const a=s.split(".");let d=e[a[0]];for(let p=1;p<a.length;++p){if(d===void 0)return d;const v=a[p];d=d[v]}return d}const Na=(0,on.Z)(e=>({header:{padding:e.spacing(1,2,1,2.5),borderTop:`1px solid ${e.palette.grey.A100}`,borderBottom:`1px solid ${e.palette.grey.A100}`,color:e.palette.textSubtle,fontWeight:e.typography.fontWeightBold,position:"static",wordBreak:"normal"}}),{name:"BackstageTableHeader"})(xo.W$),Ji=(0,on.Z)(e=>({root:{padding:e.spacing(3,0,2.5,2.5)},title:{"& > h6":{fontWeight:e.typography.fontWeightBold}},searchField:{paddingRight:e.spacing(2)}}),{name:"BackstageTableToolbar"})(xo.UW),Fa=(0,c.Z)(e=>({root:{display:"flex",alignItems:"center",justifyContent:"space-between"},title:{fontWeight:e.typography.fontWeightBold,fontSize:18,whiteSpace:"nowrap"}}),{name:"BackstageTableFiltersContainer"}),Ua=(0,c.Z)(()=>({root:{display:"flex",alignItems:"start"}}),{name:"BackstageTable"});function Ma(e,s){return e.map(a=>{const d={};let p=a.cellStyle||{};if(a.highlight)if(d.color=s.palette.textContrast,typeof p=="object")p.fontWeight=s.typography.fontWeightBold;else{const v=p;p=(j,$,G)=>({...v(j,$,G),fontWeight:s.typography.fontWeightBold})}return{...a,headerStyle:d,cellStyle:p}})}function za(e,s){return(0,se.transform)(e,(a,d,p)=>{(0,se.isEqual)(d,s[p])||(a[p]=d)})}const Qi={search:"",filtersOpen:!1,filters:{}};function Wa(e){const{toolbarRef:s,setSearch:a,hasFilters:d,selectedFiltersLength:p,toggleFilters:v}=e,j=Fa(),$=(0,g.useCallback)(G=>{e.onSearchChanged(G),a(G)},[e,a]);return d?(0,r.jsxs)(Ee.Z,{className:j.root,children:[(0,r.jsxs)(Ee.Z,{className:j.root,children:[(0,r.jsx)(gt.Z,{onClick:v,"aria-label":"filter list",children:(0,r.jsx)(ni.Z,{})}),(0,r.jsxs)(F.Z,{className:j.title,children:["Filters (",p,")"]})]}),(0,r.jsx)(Ji,{...e,ref:s,onSearchChanged:$})]}):(0,r.jsx)(Ji,{...e,ref:s,onSearchChanged:$})}function Xi(e){const{data:s,columns:a,options:d,title:p,subtitle:v,filters:j,initialState:$,emptyContent:G,onStateChange:N,components:pe,...oe}=e,xe=Ua(),Ie=(0,Ke.Z)(),Ye={...Qi,...$},[qe,Pt]=(0,g.useState)(Ye.filtersOpen),Kt=(0,g.useCallback)(()=>Pt(Dn=>!Dn),[Pt]),[tn,nn]=(0,g.useState)(0),[kt,_t]=(0,g.useState)(s),[Yt,vr]=(0,g.useState)(Ye.filters),yr=Ma(a,Ie),[xr,br]=(0,g.useState)(Ye.search);(0,g.useEffect)(()=>{if(N){const Dn=za({search:xr,filtersOpen:qe,filters:Yt},Qi);N(Dn)}},[xr,qe,Yt,N]);const ai={headerStyle:{textTransform:"uppercase"}},Tr=(0,g.useCallback)(Dn=>{var cr;return(cr=a.find(Mr=>Mr.title===Dn))===null||cr===void 0?void 0:cr.field},[a]);(0,g.useEffect)(()=>{if(typeof s=="function")return;if(!Yt){_t(s);return}const Dn=Object.values(Yt);if(s&&Dn.flat().length){const cr=s.filter(Mr=>!!Object.entries(Yt).filter(([,zr])=>!!zr.length).every(([zr,an])=>{const mn=Yi(Mr,Tr(zr));return Array.isArray(mn)&&Array.isArray(an)?mn.some(us=>an.includes(us)):Array.isArray(mn)?mn.includes(an):Array.isArray(an)?an.includes(mn):mn===an}));_t(cr)}else _t(s);nn(Dn.flat().length)},[s,Yt,Tr]);const li=(Dn,cr)=>{const Mr=an=>{const mn=new Set,us=Wr=>{Wr!=null&&mn.add(Wr)};return cr&&cr.forEach(Wr=>{const Ns=Yi(Wr,Tr(an));Array.isArray(Ns)?Ns.forEach(us):us(Ns)}),mn},zr=an=>({placeholder:"All results",label:an.column,multiple:an.type==="multiple-select",items:[...Mr(an.column)].sort().map(mn=>({label:mn,value:mn}))});return Dn.map(an=>({type:an.type,element:zr(an)}))},Jt=!!(j!=null&&j.length),ds=(0,g.useCallback)(Dn=>(0,r.jsx)(Wa,{setSearch:br,hasFilters:Jt,selectedFiltersLength:tn,toggleFilters:Kt,...Dn}),[Kt,Jt,tn,br]),So=typeof s!="function"&&s.length===0,Ir=a.length,ci=(0,g.useCallback)(Dn=>G&&So?(0,r.jsx)("tbody",{children:(0,r.jsx)("tr",{children:(0,r.jsx)("td",{colSpan:Ir,children:G})})}):(0,r.jsx)(xo.os,{...Dn}),[So,G,Ir]);return(0,r.jsxs)(Ee.Z,{className:xe.root,children:[qe&&s&&typeof s!="function"&&(j==null?void 0:j.length)&&(0,r.jsx)(Da,{filters:li(j,s),selectedFilters:Yt,onChangeFilters:vr}),(0,r.jsx)(xo.ZP,{components:{Header:Na,Toolbar:ds,Body:ci,...pe},options:{...ai,...d},columns:yr,icons:Ki,title:(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(F.Z,{variant:"h5",component:"h2",children:p}),v&&(0,r.jsx)(F.Z,{color:"textSecondary",variant:"body1",children:v})]}),data:typeof s=="function"?s:kt,style:{width:"100%"},localization:{toolbar:{searchPlaceholder:"Filter",searchTooltip:"Filter"}},...oe})]})}Xi.icons=Object.freeze(Ki);const Gl=e=>{const{children:s,value:a,index:d,...p}=e;return _jsx(Box,{role:"tabpanel",hidden:a!==d,"aria-labelledby":`scrollable-auto-tab-${d}`,...p,children:a===d&&_jsx(Box,{p:3,children:s})})},Va=(0,c.Z)(e=>({root:{color:"#6E6E6E",overflow:"visible",fontSize:e.typography.h5.fontSize,textAlign:"center",borderRadius:"50%",backgroundColor:"#E6E6E6",marginLeft:s=>s.isNext?"auto":"0",marginRight:s=>s.isNext?"0":e.spacing(1.25),"&:hover":{backgroundColor:"#E6E6E6",opacity:"1"}}}),{name:"BackstageTabIcon"}),Kl=e=>{const s=Va(e),{ariaLabel:a,onClick:d}=e;return _jsx(IconButton,{onClick:d,className:s.root,size:"small",disableRipple:!0,disableFocusRipple:!0,"aria-label":a,children:e.children})},Ha=(e,s)=>s?e?"20px":"0":"40px",Ga=(0,c.Z)(e=>({root:{textTransform:"none",height:"64px",fontWeight:e.typography.fontWeightBold,fontSize:e.typography.pxToRem(13),color:e.palette.textSubtle,marginLeft:s=>Ha(s.isFirstNav,s.isFirstIndex),width:"130px",minWidth:"130px","&:hover":{outline:"none",backgroundColor:"transparent",color:e.palette.textSubtle}}}),{name:"BackstageTab"}),Yl=e=>{const s=Ga(e),{isFirstNav:a,isFirstIndex:d,...p}=e;return _jsx(Tab,{classes:s,disableRipple:!0,...p})},Ka=(0,c.Z)(e=>({indicator:{display:"flex",justifyContent:"center",backgroundColor:e.palette.tabbar.indicator,height:e.spacing(.5)},flexContainer:{alignItems:"center"},root:{"&:last-child":{marginLeft:"auto"}}}),{name:"BackstageTabBar"}),Jl=e=>{const s=Ka(e);return _jsx(Tabs,{classes:s,...e,TabIndicatorProps:{children:_jsx(Typography,{component:"span"})}})},Ya=(0,c.Z)(e=>({root:{flexGrow:1,width:"100%"},styledTabs:{backgroundColor:e.palette.background.paper},appbar:{boxShadow:"none",backgroundColor:e.palette.background.paper,paddingLeft:e.spacing(1.25),paddingRight:e.spacing(1.25)}}),{name:"BackstageTabs"});function Ql(e){const{tabs:s}=e,a=Ya(),[d,p]=useState([0,0]),[v,j]=useState(0),[$,G]=useState(0),[N,pe]=useState([[]]),oe=useRef(),{width:xe}=useWindowSize(),Ie=(tn,nn)=>{p([v,nn])},Ye=()=>{j(v-1)},qe=()=>{j(v+1)},Pt=()=>v+1<N.length;useEffect(()=>{const nn=v===0?1:2,kt=oe.current.offsetWidth-20-nn*30,_t=d[0]*$+d[1],Yt=Math.floor(kt/170);G(Yt),pe(chunkArray(s,Yt)),p([Math.floor(_t/Yt),_t%Yt])},[xe,s]);const Kt=v===d[0]?d[1]:!1;return _jsxs(Box,{className:a.root,children:[_jsx(AppBar,{ref:oe,className:a.appbar,position:"static",children:_jsx(Box,{children:_jsxs(StyledTabs,{value:Kt,onChange:Ie,selectionFollowsFocus:!0,children:[v!==0&&_jsx(StyledIcon,{onClick:Ye,ariaLabel:"navigate-before",children:_jsx(NavigateBeforeIcon,{})}),N[v].map((tn,nn)=>_jsx(StyledTab,{value:nn,isFirstIndex:nn===0,isFirstNav:v===0,icon:tn.icon||void 0,label:tn.label||void 0},nn)),Pt()&&_jsx(StyledIcon,{isNext:!0,onClick:qe,ariaLabel:"navigate-next",children:_jsx(NavigateNextIcon,{})})]})})}),Kt!==!1?N[v].map((tn,nn)=>_jsx(TabPanel,{value:nn,index:Kt,children:tn.content},nn)):_jsx(TabPanel,{value:d[1],index:d[1],children:N[d[0]][d[1]].content},"panel_outside_chunked_array")]})}var Xl=t(44311);function Ja(e,s){const a=e[e.length-1];if(!!a)return a>=.9?s.palette.status.ok:a>=.5?s.palette.status.warning:s.palette.status.error}function ql(e){const s=useTheme();if(!e.data)return null;var a;return _jsxs(Sparklines,{width:120,height:30,min:0,max:1,...e,children:[e.title&&_jsx("title",{children:e.title}),_jsx(SparklinesLine,{color:(a=e.color)!==null&&a!==void 0?a:Ja(e.data,s)})]})}const Qa=e=>(0,c.Z)(s=>({container:{width:"100%",display:"flex",flexDirection:"row",flexWrap:"wrap",justifyContent:"flex-end",alignItems:"center",marginBottom:s.spacing(2),textAlign:e.textAlign},leftItemsBox:{flex:"1 1 auto",minWidth:0,overflow:"visible"},rightItemsBox:{flex:"0 1 auto",display:"flex",flexDirection:"row",flexWrap:"wrap",alignItems:"center",marginLeft:s.spacing(1),minWidth:0,overflow:"visible"},description:{},title:{display:"inline-flex",marginBottom:0}}),{name:"BackstageContentHeader"}),Xa=({title:e="Unknown page",className:s})=>(0,r.jsx)(F.Z,{variant:"h4",component:"h2",className:s,"data-testid":"header-title",children:e});function qa(e){const{description:s,title:a,titleComponent:d=void 0,children:p,textAlign:v="left"}=e,j=Qa({textAlign:v})(),$=d||(0,r.jsx)(Xa,{title:a,className:j.title});return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(os.q,{title:a}),(0,r.jsxs)(Ee.Z,{className:j.container,children:[(0,r.jsxs)(Ee.Z,{className:j.leftItemsBox,children:[$,s&&(0,r.jsx)(F.Z,{className:j.description,variant:"body2",children:s})]}),(0,r.jsx)(Ee.Z,{className:j.rightItemsBox,children:p})]})]})}var _a=t.p+"static/mic-drop.fe3ef4d0..svg";const el=(0,c.Z)(e=>({micDrop:{maxWidth:"60%",bottom:e.spacing(2),right:e.spacing(2),[e.breakpoints.down("xs")]:{maxWidth:"96%",bottom:"unset",right:"unset",margin:`${e.spacing(10)}px auto ${e.spacing(4)}px`}}}),{name:"BackstageErrorPageMicDrop"}),tl=()=>{const e=el();return(0,r.jsx)("img",{src:_a,className:e.micDrop,alt:"Girl dropping mic from her hands"})},nl=(0,c.Z)(e=>({container:{padding:e.spacing(8),[e.breakpoints.down("xs")]:{padding:e.spacing(2)}},title:{paddingBottom:e.spacing(5),[e.breakpoints.down("xs")]:{paddingBottom:e.spacing(4),fontSize:e.typography.h3.fontSize}},subtitle:{color:e.palette.textSubtle}}),{name:"BackstageErrorPage"});function rl(e){const{status:s,statusMessage:a,additionalInfo:d,supportUrl:p}=e,v=nl(),j=(0,T.s0)(),$=eo();return(0,r.jsxs)(Be.Z,{container:!0,spacing:0,className:v.container,children:[(0,r.jsxs)(Be.Z,{item:!0,xs:12,sm:8,md:4,children:[(0,r.jsxs)(F.Z,{"data-testid":"error",variant:"body1",className:v.subtitle,children:["ERROR ",s,": ",a]}),(0,r.jsx)(F.Z,{variant:"body1",className:v.subtitle,children:d}),(0,r.jsx)(F.Z,{variant:"h2",className:v.title,children:"Looks like someone dropped the mic!"}),(0,r.jsxs)(F.Z,{variant:"h6",children:[(0,r.jsx)(_e,{to:"#","data-testid":"go-back-link",onClick:()=>j(-1),children:"Go back"}),"... or please"," ",(0,r.jsx)(_e,{to:p||$.url,children:"contact support"})," if you think this is a bug."]})]}),(0,r.jsx)(tl,{})]})}var sl=t(16173);const ol=(0,on.Z)({root:{textDecoration:"underline",cursor:"pointer"}},{name:"BackstageBreadcrumbsClickableText"})(F.Z),ri=(0,on.Z)({root:{textDecoration:"underline",color:"inherit"}},{name:"BackstageBreadcrumbsStyledBox"})(Ee.Z);function il(e){const{children:s,...a}=e,[d,p]=g.useState(null),v=g.Children.toArray(s),[j,$,...G]=v,N=G.length?G.pop():v[v.length-1],pe=v.length>3,oe=Ye=>{p(Ye.currentTarget)},xe=()=>{p(null)},Ie=Boolean(d);return(0,r.jsxs)(g.Fragment,{children:[(0,r.jsxs)(sl.Z,{"aria-label":"breadcrumb",...a,children:[v.length>1&&(0,r.jsx)(ri,{clone:!0,children:j}),v.length>2&&(0,r.jsx)(ri,{clone:!0,children:$}),pe&&(0,r.jsx)(ol,{onClick:oe,children:"..."}),(0,r.jsx)(Ee.Z,{style:{fontStyle:"italic"},children:N})]}),(0,r.jsx)(ss.ZP,{open:Ie,anchorEl:d,onClose:xe,anchorOrigin:{vertical:"bottom",horizontal:"left"},transformOrigin:{vertical:"top",horizontal:"left"},children:(0,r.jsx)(jt.Z,{children:G.map((Ye,qe)=>(0,r.jsx)(lt.Z,{button:!0,children:(0,r.jsx)(ri,{clone:!0,children:Ye})},qe))})})]})}const al=(0,c.Z)(e=>({header:{gridArea:"pageHeader",padding:e.spacing(3),width:"100%",boxShadow:e.shadows[4],position:"relative",zIndex:100,display:"flex",flexDirection:"row",alignItems:"center",backgroundImage:e.page.backgroundImage,backgroundPosition:"center",backgroundSize:"cover",[e.breakpoints.down("sm")]:{flexWrap:"wrap"}},leftItemsBox:{maxWidth:"100%",flexGrow:1},rightItemsBox:{width:"auto",alignItems:"center"},title:{color:e.page.fontColor,wordBreak:"break-word",fontSize:e.typography.h3.fontSize,marginBottom:0},subtitle:{color:e.page.fontColor,opacity:.8,display:"inline-block",marginTop:e.spacing(1),maxWidth:"75ch"},type:{textTransform:"uppercase",fontSize:11,opacity:.8,marginBottom:e.spacing(1),color:e.page.fontColor},breadcrumb:{color:e.page.fontColor},breadcrumbType:{fontSize:"inherit",opacity:.7,marginRight:-e.spacing(.3),marginBottom:e.spacing(.3)},breadcrumbTitle:{fontSize:"inherit",marginLeft:-e.spacing(.3),marginBottom:e.spacing(.3)}}),{name:"BackstageHeader"}),ll=({type:e,typeLink:s,classes:a,pageTitle:d})=>e?s?(0,r.jsxs)(il,{className:a.breadcrumb,children:[(0,r.jsx)(_e,{to:s,children:e}),(0,r.jsx)(F.Z,{children:d})]}):(0,r.jsx)(F.Z,{className:a.type,children:e}):null,cl=({pageTitle:e,classes:s,tooltip:a})=>{const d=(0,r.jsx)(F.Z,{className:s.title,variant:"h1",children:e});return a?(0,r.jsx)(nt.ZP,{title:a,placement:"top-start",children:d}):d},dl=({classes:e,subtitle:s})=>s?typeof s!="string"?(0,r.jsx)(r.Fragment,{children:s}):(0,r.jsx)(F.Z,{className:e.subtitle,variant:"subtitle2",component:"span",children:s}):null;function qi(e){const{children:s,pageTitleOverride:a,style:d,subtitle:p,title:v,tooltip:j,type:$,typeLink:G}=e,N=al(),oe=(0,W.h_)(W.Ds).getOptionalString("app.title")||"Backstage",xe=a||v,Ie=v||a,Ye=`${xe} | %s | ${oe}`,qe=`${xe} | ${oe}`;return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(os.q,{titleTemplate:Ye,defaultTitle:qe}),(0,r.jsxs)("header",{style:d,className:N.header,children:[(0,r.jsxs)(Ee.Z,{className:N.leftItemsBox,children:[(0,r.jsx)(ll,{classes:N,type:$,typeLink:G,pageTitle:Ie}),(0,r.jsx)(cl,{classes:N,pageTitle:Ie,tooltip:j}),(0,r.jsx)(dl,{classes:N,subtitle:p})]}),(0,r.jsx)(Be.Z,{container:!0,className:N.rightItemsBox,spacing:4,children:s})]})]})}const ul=({label:e,secondaryLabel:s,icon:a,disabled:d=!1,onClick:p})=>_jsx(Fragment,{children:_jsxs(ListItem,{"data-testid":"header-action-item",disabled:d,button:!0,onClick:v=>{p&&p(v)},children:[a&&_jsx(ListItemIcon,{children:a}),_jsx(ListItemText,{primary:e,secondary:s})]})});function _l(e){const{actionItems:s}=e,[a,d]=React.useState(!1),p=React.useRef(null);return _jsxs(Fragment,{children:[_jsx(IconButton,{onClick:()=>d(!0),"data-testid":"header-action-menu",ref:p,style:{color:"white",height:56,width:56,marginRight:-4,padding:0},children:_jsx(MoreVert,{})}),_jsx(Popover,{open:a,anchorEl:p.current,anchorOrigin:{horizontal:"right",vertical:"bottom"},transformOrigin:{horizontal:"right",vertical:"top"},onClose:()=>d(!1),children:_jsx(List,{children:s.map((v,j)=>_jsx(ul,{...v},`header-action-menu-${j}`))})})]})}const hl=(0,c.Z)(e=>({root:{textAlign:"left"},label:{color:e.palette.common.white,fontWeight:e.typography.fontWeightBold,letterSpacing:0,fontSize:e.typography.fontSize,marginBottom:e.spacing(1)/2,lineHeight:1},value:{color:"rgba(255, 255, 255, 0.8)",fontSize:e.typography.fontSize,lineHeight:1}}),{name:"BackstageHeaderLabel"}),pl=({value:e,className:s})=>(0,r.jsx)(F.Z,{className:s,children:e});function fl(e){const{label:s,value:a,url:d}=e,p=hl(),v=(0,r.jsx)(pl,{className:p.value,value:a||"<Unknown>"});return(0,r.jsx)(Be.Z,{item:!0,children:(0,r.jsxs)(F.Z,{component:"span",className:p.root,children:[(0,r.jsx)(F.Z,{className:p.label,children:s}),d?(0,r.jsx)(_e,{to:d,children:v}):v]})})}const gl=e=>(0,P.Z)({root:{color:e.palette.common.white,padding:e.spacing(2,2,3),backgroundImage:e.getPageTheme({themeId:"card"}).backgroundImage,backgroundPosition:0,backgroundSize:"inherit"}}),ml=(0,c.Z)(gl,{name:"BackstageItemCardHeader"});function vl(e){const{title:s,subtitle:a,children:d}=e,p=ml(e);return(0,r.jsxs)(Ee.Z,{className:p.root,children:[a&&(0,r.jsx)(F.Z,{variant:"subtitle2",component:"h3",children:a}),s&&(0,r.jsx)(F.Z,{variant:"h6",component:"h4",children:s}),d]})}function ec(e){const{description:s,tags:a,title:d,type:p,subtitle:v,label:j,onClick:$,href:G}=e;return _jsxs(Card,{children:[_jsx(CardMedia,{children:_jsx(ItemCardHeader,{title:d,subtitle:v||p})}),_jsxs(CardContent,{children:[a!=null&&a.length?_jsx(Box,{children:a.map((N,pe)=>_jsx(Chip,{size:"small",label:N},pe))}):null,s]}),_jsxs(CardActions,{children:[!G&&_jsx(Button,{to:"#",onClick:$,color:"primary",children:j}),G&&_jsx(Button,{to:G,color:"primary",children:j})]})]})}const yl=e=>(0,P.Z)({root:{display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(22em, 1fr))",gridAutoRows:"1fr",gridGap:e.spacing(2)}}),xl=(0,c.Z)(yl,{name:"BackstageItemCardGrid"});function bl(e){const{children:s,...a}=e,d=xl(a);return(0,r.jsx)(Ee.Z,{className:d.root,...a,children:s})}var Sl=t(41547);const Cl=(0,c.Z)(()=>({root:({isMobile:e})=>({display:"grid",gridTemplateAreas:"'pageHeader pageHeader pageHeader' 'pageSubheader pageSubheader pageSubheader' 'pageNav pageContent pageSidebar'",gridTemplateRows:"max-content auto 1fr",gridTemplateColumns:"auto 1fr auto",height:e?"100%":"100vh",overflowY:"auto"})}),{name:"BackstagePage"});function _i(e){const{themeId:s,children:a}=e,{isMobile:d}=Ur(),p=Cl({isMobile:d});return(0,r.jsx)(Sl.Z,{theme:v=>({...v,page:v.getPageTheme({themeId:s})}),children:(0,r.jsx)("main",{className:p.root,children:a})})}function wl(e){const{themeId:s,children:a,...d}=e;return(0,r.jsxs)(_i,{themeId:s,children:[(0,r.jsx)(qi,{...d}),a]})}var Qn=t(30195);const tc=Qn.z.object({providerInfo:Qn.z.object({}).catchall(Qn.z.unknown()).optional(),profile:Qn.z.object({email:Qn.z.string().optional(),displayName:Qn.z.string().optional(),picture:Qn.z.string().optional()}),backstageIdentity:Qn.z.object({token:Qn.z.string(),identity:Qn.z.object({type:Qn.z.literal("user"),userEntityRef:Qn.z.string(),ownershipEntityRefs:Qn.z.array(Qn.z.string())})})}),ea={defaultTokenExpiryMillis:5*60*1e3,tokenExpiryMarginMillis:5*60*1e3};function jl(e){const s=new Date(Date.now()+ea.defaultTokenExpiryMillis);if(!e)return s;const[a,d,p]=e.split("."),v=JSON.parse(window.atob(d));return typeof v.exp!="number"?s:new Date(v.exp*1e3-ea.tokenExpiryMarginMillis)}class nc{async start(){await this.getSessionAsync()}getUserId(){const{backstageIdentity:s}=this.getSessionSync(),a=s.identity.userEntityRef,d=/^([^:/]+:)?([^:/]+\/)?([^:/]+)$/.exec(a);if(!d)throw new TypeError(`Invalid user entity reference "${a}"`);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 s=this.state.type==="active"?this.state.session:void 0,a=this.fetchSession().then(d=>(this.state={type:"active",session:d,expiresAt:jl(d.backstageIdentity.token)},d),d=>{throw this.state={type:"failed",error:d},d});return this.state={type:"fetching",promise:a,previous:s},a}async fetchSession(){const s=await this.options.discoveryApi.getBaseUrl("auth"),a=typeof this.options.headers=="function"?await this.options.headers():this.options.headers,d=new Headers(a);d.set("X-Requested-With","XMLHttpRequest");const p=await fetch(`${s}/${this.options.provider}/refresh`,{signal:this.abortController.signal,headers:d,credentials:"include"});if(!p.ok)throw await ResponseError.fromResponse(p);return proxiedSessionSchema.parse(await p.json())}constructor(s){this.options=s,this.abortController=new AbortController,this.state={type:"empty"}}}const rc=e=>{const s=useApi(discoveryApiRef),[{status:a,error:d},{execute:p}]=useAsync(async()=>{const v=new ProxiedSignInIdentity({provider:e.provider,discoveryApi:s,headers:e.headers});await v.start(),e.onSignInSuccess(v)});return useMountEffect(p),a==="loading"?_jsx(Progress,{}):d?_jsx(ErrorPanel,{title:"You do not appear to be signed in. Please try reloading the browser page.",error:d}):null},El=(0,c.Z)({container:{padding:0,listStyle:"none"},item:{display:"flex",flexDirection:"column",width:"100%",maxWidth:"400px",margin:0,padding:0}},{name:"BackstageSignInPage"}),si=({children:e})=>{const s=El();return(0,r.jsx)(Be.Z,{component:"li",item:!0,classes:s,children:e})};class oi{getUserId(){return"guest"}async getIdToken(){}getProfile(){return{email:"guest@example.com",displayName:"Guest"}}async getProfileInfo(){return{email:"guest@example.com",displayName:"Guest"}}async getBackstageIdentity(){const s="user:default/guest";return{type:"user",userEntityRef:s,ownershipEntityRefs:[s]}}async getCredentials(){return{}}async signOut(){}}function Al(e){const[s,a,d]=e.split(".");return JSON.parse(window.atob(a))}class ii{getUserId(){return this.result.userId}static fromResult(s){return new ii(s)}async getIdToken(){var s,a;return(a=(s=this.result).getIdToken)===null||a===void 0?void 0:a.call(s)}getProfile(){return this.result.profile}async getProfileInfo(){return this.result.profile}async getBackstageIdentity(){const s=await this.getIdToken();if(!s){const p=`user:default/${this.getUserId()}`;return{type:"user",userEntityRef:p,ownershipEntityRefs:[p]}}const{sub:a,ent:d}=Al(s);return{type:"user",userEntityRef:a,ownershipEntityRefs:d!=null?d:[]}}async getCredentials(){var s,a;return{token:await((a=(s=this.result).getIdToken)===null||a===void 0?void 0:a.call(s))}}async signOut(){var s,a;return(a=(s=this.result).signOut)===null||a===void 0?void 0:a.call(s)}constructor(s){this.result=s}}class Ds{static createGuest(){return new oi}static fromLegacy(s){return ii.fromResult(s)}static create(s){return new Ds(s.identity,s.authApi,s.profile)}getUserId(){const s=this.identity.userEntityRef,a=/^([^:/]+:)?([^:/]+\/)?([^:/]+)$/.exec(s);if(!a)throw new TypeError(`Invalid user entity reference "${s}"`);return a[3]}async getIdToken(){return(await this.authApi.getBackstageIdentity()).token}getProfile(){if(!this.profile)throw new Error("The identity API does not implement synchronous profile fetching, use getProfileInfo() instead");return this.profile}async getProfileInfo(){if(this.profilePromise)return await this.profilePromise;try{return this.profilePromise=this.authApi.getProfile(),await this.profilePromise}catch(s){throw this.profilePromise=void 0,s}}async getBackstageIdentity(){return this.identity}async getCredentials(){return{token:(await this.authApi.getBackstageIdentity()).token}}async signOut(){return this.authApi.signOut()}constructor(s,a,d){this.identity=s,this.authApi=a,this.profile=d}}const Tl={Component:({config:e,onSignInSuccess:s})=>{const{apiRef:a,title:d,message:p}=e,v=(0,W.h_)(a),j=(0,W.h_)(W.VE),$=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 N=await v.getProfile();s(Ds.create({identity:G.identity,profile:N,authApi:v}))}catch(G){j.post(new ms.SP("Login failed",G))}};return(0,r.jsx)(si,{children:(0,r.jsx)(wr,{variant:"fullHeight",title:d,actions:(0,r.jsx)(X.Z,{color:"primary",variant:"outlined",onClick:$,children:"Sign In"}),children:(0,r.jsx)(F.Z,{variant:"body1",children:p})})})},loader:async(e,s)=>{const a=e.get(s),d=await a.getBackstageIdentity({optional:!0});if(!d)return;const p=await a.getProfile();return Ds.create({identity:d.identity,profile:p,authApi:a})}},Il={Component:({onSignInSuccess:e})=>(0,r.jsx)(si,{children:(0,r.jsx)(wr,{title:"Guest",variant:"fullHeight",actions:(0,r.jsx)(X.Z,{color:"primary",variant:"outlined",onClick:()=>e(new oi),children:"Enter"}),children:(0,r.jsxs)(F.Z,{variant:"body1",children:["Enter as a Guest User.",(0,r.jsx)("br",{}),"You will not have a verified identity,",(0,r.jsx)("br",{}),"meaning some features might be unavailable."]})})}),loader:async()=>new oi};var Rl=t(63955),ta=t(86619),na=t(74828),Ll=t(45455),Pl=t.n(Ll);const kl=/^[a-z0-9_\-]+\.[a-z0-9_\-]+\.[a-z0-9_\-]+$/i,Ol=(0,c.Z)(e=>({form:{display:"flex",flexFlow:"column nowrap"},button:{alignSelf:"center",marginTop:e.spacing(2)}}),{name:"BackstageCustomProvider"}),ra=e=>{const{ref:s,...a}=e;return{inputRef:s,...a}},Bl={Component:({onSignInSuccess:e})=>{const s=Ol(),{register:a,handleSubmit:d,formState:p}=(0,Rl.cI)({mode:"onChange"}),{errors:v}=p,j=({userId:$,idToken:G})=>{e(Ds.fromLegacy({userId:$,getIdToken:G!==void 0?async()=>G:void 0,profile:{email:`${$}@example.com`}}))};return(0,r.jsx)(si,{children:(0,r.jsxs)(wr,{title:"Custom User",variant:"fullHeight",children:[(0,r.jsxs)(F.Z,{variant:"body1",children:["Enter your own User ID and credentials.",(0,r.jsx)("br",{}),"This selection will not be stored."]}),(0,r.jsxs)("form",{className:s.form,onSubmit:d(j),children:[(0,r.jsxs)(y.Z,{children:[(0,r.jsx)(ta.Z,{...ra(a("userId",{required:!0})),label:"User ID",margin:"normal",error:Boolean(v.userId)}),v.userId&&(0,r.jsx)(na.Z,{error:!0,children:v.userId.message})]}),(0,r.jsxs)(y.Z,{children:[(0,r.jsx)(ta.Z,{...ra(a("idToken",{required:!1,validate:$=>!$||kl.test($)||"Token is not a valid OpenID Connect JWT Token"})),label:"ID Token (optional)",margin:"normal",autoComplete:"off",error:Boolean(v.idToken)}),v.idToken&&(0,r.jsx)(na.Z,{error:!0,children:v.idToken.message})]}),(0,r.jsx)(X.Z,{type:"submit",color:"primary",variant:"outlined",className:s.button,disabled:!(p!=null&&p.isDirty)||!Pl()(v),children:"Continue"})]})]})})},loader:async()=>{}},bo="@backstage/core:SignInPage:provider",sa={guest:Il,custom:Bl,common:Tl};function oa(e,s){if(e in s)throw new Error(`"${e}" ID is duplicated. IDs of identity providers have to be unique.`)}function dc(e){return e.reduce((a,d)=>{if(typeof d=="string")return oa(d,a),a[d]={components:sa[d],id:d},a;const{id:p}=d;return oa(p,a),a[p]={components:sa.common,id:p,config:d},a},{})}const uc=(e,s)=>{const a=useApi(errorApiRef),d=useApiHolder(),[p,v]=useState(!0),j=useCallback(G=>{s(IdentityApiSignOutProxy.from({identityApi:G,signOut:async()=>{var N;localStorage.removeItem(bo),await((N=G.signOut)===null||N===void 0?void 0:N.call(G))}}))},[s]);useLayoutEffect(()=>{var G;if(!p)return;const N=localStorage.getItem(bo);if(N===null){v(!1);return}const pe=e[N];if(!pe){v(!1);return}let oe=!1;return pe.components.loader(d,(G=pe.config)===null||G===void 0?void 0:G.apiRef).then(xe=>{oe||(xe?j(xe):v(!1))}).catch(xe=>{oe||(localStorage.removeItem(bo),a.post(xe),v(!1))}),()=>{oe=!0}},[p,a,s,d,e,j]);const $=useMemo(()=>Object.keys(e).map(G=>{const N=e[G],{Component:pe}=N.components,oe=xe=>{localStorage.setItem(bo,N.id),j(xe)};return _jsx(pe,{config:N.config,onSignInSuccess:oe},N.id)}),[e,j]);return[p,$]},$l=({onSignInSuccess:e,providers:s=[],title:a,align:d="left"})=>{const p=useApi(configApiRef),v=useStyles(),j=getSignInProviders(s),[$,G]=useSignInProviders(j,e);return $?_jsx(Progress,{}):_jsxs(Page,{themeId:"home",children:[_jsx(Header,{title:p.getString("app.title")}),_jsxs(Content,{children:[a&&_jsx(ContentHeader,{title:a,textAlign:d}),_jsx(Grid,{container:!0,justifyContent:d==="center"?d:"flex-start",spacing:2,component:"ul",classes:v,children:G})]})]})},Zl=({provider:e,auto:s,onSignInSuccess:a})=>{const d=useStyles(),p=useApi(e.apiRef),v=useApi(configApiRef),[j,$]=useState(),[G,N]=useState(!1),pe=async({checkExisting:oe,showPopup:xe})=>{try{let Ie;if(oe&&(Ie=await p.getBackstageIdentity({optional:!0})),!Ie&&(xe||s)&&(N(!0),Ie=await p.getBackstageIdentity({instantPopup:!0}),!Ie))throw new Error(`The ${e.title} provider is not configured to support sign-in`);if(!Ie){N(!0);return}const Ye=await p.getProfile();a(UserIdentity.create({identity:Ie.identity,authApi:p,profile:Ye}))}catch(Ie){$(Ie),N(!0)}};return useMountEffect(()=>pe({checkExisting:!0})),G?_jsxs(Page,{themeId:"home",children:[_jsx(Header,{title:v.getString("app.title")}),_jsx(Content,{children:_jsx(Grid,{container:!0,justifyContent:"center",spacing:2,component:"ul",classes:d,children:_jsx(GridItem,{children:_jsxs(InfoCard,{variant:"fullHeight",title:e.title,actions:_jsx(Button,{color:"primary",variant:"outlined",onClick:()=>{pe({showPopup:!0})},children:"Sign In"}),children:[_jsx(Typography,{variant:"body1",children:e.message}),j&&j.name!=="PopupRejectedError"&&_jsx(Typography,{variant:"body1",color:"error",children:j.message})]})})})})]}):_jsx(Progress,{})};function hc(e){return"provider"in e?_jsx(Zl,{...e}):_jsx($l,{...e})}const Dl=(0,c.Z)(e=>({root:{padding:e.spacing(0,2,0,2.5),minHeight:e.spacing(3)},indicator:{backgroundColor:e.palette.info.main,height:e.spacing(.3)}}),{name:"BackstageTabbedCard"}),Nl=(0,on.Z)(e=>({root:{padding:e.spacing(2,2,2,2.5),display:"inline-block"},title:{fontWeight:700},subheader:{paddingTop:e.spacing(1)}}),{name:"BackstageTabbedCardBoldHeader"})(Dr.Z);function pc(e){const{slackChannel:s,errorBoundaryProps:a,children:d,title:p,deepLink:v,value:j,onChange:$}=e,G=Dl(),[N,pe]=useState(0),oe=$||((Ye,qe)=>pe(qe));let xe;j?React.Children.map(d,Ye=>{if(React.isValidElement(Ye)&&(Ye==null?void 0:Ye.props.value)===j){var qe;xe=Ye==null||(qe=Ye.props)===null||qe===void 0?void 0:qe.children}}):React.Children.map(d,(Ye,qe)=>{React.isValidElement(Ye)&&qe===N&&(xe=Ye==null?void 0:Ye.props.children)});const Ie=a||(s?{slackChannel:s}:{});return _jsx(Card,{children:_jsxs(ErrorBoundary,{...Ie,children:[p&&_jsx(Nl,{title:p}),_jsx(Tabs,{selectionFollowsFocus:!0,classes:G,value:j||N,onChange:oe,children:d}),_jsx(Divider,{}),_jsx(CardContent,{children:xe}),v&&_jsx(BottomLink,{...v})]})})}const Fl=(0,c.Z)(e=>({root:{minWidth:e.spacing(6),minHeight:e.spacing(3),margin:e.spacing(0,2,0,0),padding:e.spacing(.5,0,.5,0),textTransform:"none","&:hover":{opacity:1,backgroundColor:"transparent",color:e.palette.text.primary}},selected:{fontWeight:e.typography.fontWeightBold}}),{name:"BackstageCardTab"});function fc(e){const{children:s,...a}=e,d=Fl();return _jsx(Tab,{disableRipple:!0,classes:d,...a})}},25248:function(At,Fe,t){"use strict";t.d(Fe,{fC:function(){return b},CL:function(){return Ee},sM:function(){return Y},$v:function(){return Le},v_:function(){return Xe},hg:function(){return Qe},uB:function(){return z},R5:function(){return Zt},bq:function(){return C},Ds:function(){return _e},ni:function(){return F},T0:function(){return U},CO:function(){return zn},x8:function(){return In},rx:function(){return bn},YO:function(){return pn},P4:function(){return Mn},NT:function(){return en},NW:function(){return Ge},VE:function(){return mt},W0:function(){return Ke},gP:function(){return at},IY:function(){return pt},F4:function(){return se},ux:function(){return R},Kp:function(){return ce},$4:function(){return vt},p_:function(){return V},ZM:function(){return it},D:function(){return T},gW:function(){return A},E6:function(){return gt},z$:function(){return bt},h_:function(){return te},I_:function(){return P},qD:function(){return ke},vJ:function(){return kn},yx:function(){return Pe},tg:function(){return vn},Oi:function(){return hn}});var h=t(52322),r=t(51837),W=t(2784);const k=(0,r.CT)("analytics-context"),g=()=>{const me=(0,W.useContext)(k);if(me===void 0)return{routeRef:"unknown",pluginId:"root",extension:"App"};const ee=me.atVersion(1);if(ee===void 0)throw new Error("No context found for version 1.");return ee},b=me=>{const{attributes:ee,children:Re}=me,et={...g(),...ee},wt=(0,r.EI)({1:et});return(0,h.jsx)(k.Provider,{value:wt,children:Re})};function c(me,ee){const Re=Ue=>_jsx(b,{attributes:ee,children:_jsx(me,{...Ue})});return Re.displayName=`WithAnalyticsContext(${me.displayName||me.name||"Component"})`,Re}function P(){const me=(0,r.Vt)("api-context");if(!me)throw new Error("API context is not available");const ee=me.atVersion(1);if(!ee)throw new Error("ApiContext v1 not available");return ee}function te(me){const Re=P().get(me);if(!Re)throw new Error(`No implementation available for ${me}`);return Re}function _(me){return function(Re){const Ue=wt=>{const ae=P(),O={};for(const ue in me)if(me.hasOwnProperty(ue)){const Be=me[ue],D=ae.get(Be);if(!D)throw new Error(`No implementation available for ${Be}`);O[ue]=D}return _jsx(Re,{...wt,...O})},et=Re.displayName||Re.name||"Component";return Ue.displayName=`withApis(${et})`,Ue}}class X{get id(){return this.config.id}get T(){throw new Error(`tried to read ApiRef.T of ${this}`)}toString(){return`apiRef{${this.config.id}}`}constructor(ee){if(this.config=ee,!ee.id.split(".").flatMap(Ue=>Ue.split("-")).every(Ue=>Ue.match(/^[a-z][a-z0-9]*$/)))throw new Error(`API id must only contain period separated lowercase alphanum tokens with dashes, got '${ee.id}'`)}}function U(me){return new X(me)}function F(me,ee){return"id"in me?{api:me,deps:{},factory:()=>ee}:me}var Y;(function(me){me.SignedIn="SignedIn",me.SignedOut="SignedOut"})(Y||(Y={}));const ce=U({id:"core.auth.google"}),se=U({id:"core.auth.github"}),T=U({id:"core.auth.okta"}),R=U({id:"core.auth.gitlab"}),V=U({id:"core.auth.microsoft"}),A=U({id:"core.auth.onelogin"}),C=U({id:"core.auth.bitbucket"}),z=U({id:"core.auth.atlassian"}),Le=U({id:"core.alert"}),Xe=U({id:"core.analytics"}),Qe=U({id:"core.apptheme"}),_e=U({id:"core.config"}),Ge=U({id:"core.discovery"}),mt=U({id:"core.error"});var Ee;(function(me){me[me.None=0]="None",me[me.Active=1]="Active"})(Ee||(Ee={}));const Ke=U({id:"core.featureflags"}),at=U({id:"core.fetch"}),vt=U({id:"core.identity"}),it=U({id:"core.oauthrequest"}),gt=U({id:"core.storage"});class nt{setContext(ee){this.context=ee}captureEvent(ee,Re,{value:Ue,attributes:et}={}){try{this.analyticsApi.captureEvent({action:ee,subject:Re,value:Ue,attributes:et,context:this.context})}catch(wt){console.warn("Error during analytics event capture. %o",wt)}}constructor(ee,Re={routeRef:"unknown",pluginId:"root",extension:"App"}){this.analyticsApi=ee,this.context=Re}}function Lt(){try{return te(Xe)}catch{return{captureEvent:()=>{}}}}function bt(){const me=(0,W.useRef)(null),ee=g(),Re=Lt();function Ue(){return me.current===null&&(me.current=new nt(Re)),me.current}const et=Ue();return et.setContext(ee),et}const ze="plugin-context",ne=me=>{const{children:ee,plugin:Re}=me,{Provider:Ue}=(0,r.CT)(ze);return(0,h.jsx)(Ue,{value:(0,r.EI)({1:{plugin:Re}}),children:ee})};function Pe(){const me=(0,r.Vt)(ze);if(!me)throw new Error("Plugin Options context is not available");const ee=me.atVersion(1);if(!ee)throw new Error("Plugin Options v1 is not available");return ee.plugin.getPluginOptions()}const ke=()=>{const me=(0,r.Vt)("app-context");if(!me)throw new Error("App context is not available");const ee=me.atVersion(1);if(!ee)throw new Error("AppContext v1 not available");return ee},tt=(0,r.uW)("component-data-store",()=>new WeakMap),yt="__backstage_data";function Zt(me,ee,Re){const Ue=me;var et;let wt=(et=Ue[yt])!==null&&et!==void 0?et:tt.get(me);if(wt||(wt={map:new Map},Object.defineProperty(Ue,yt,{enumerable:!1,configurable:!0,writable:!1,value:wt}),tt.set(me,wt)),wt.map.has(ee)){const ae=me.displayName||me.name;throw new Error(`Attempted to attach duplicate data "${ee}" to component "${ae}"`)}wt.map.set(ee,Re)}function pt(me,ee){if(!me)return;const Re=me.type;if(!Re)return;var Ue;const et=(Ue=Re[yt])!==null&&Ue!==void 0?Ue:tt.get(Re);if(!!et)return et.map.get(ee)}const Tt=(0,r.uW)("route-ref-type",()=>Symbol("route-ref-type"));let It=Tt;class Ot{get title(){return this.id}toString(){return`routeRef{type=absolute,id=${this.id}}`}constructor(ee,Re){this.id=ee,this.params=Re,this[It]="absolute"}}function en(me){var ee;return new Ot(me.id,(ee=me.params)!==null&&ee!==void 0?ee:[])}const Wt=/^\w+$/;let Vt=null;class Qt{toString(){return`routeRef{type=sub,id=${this.id}}`}constructor(ee,Re,Ue,et){this.id=ee,this.path=Re,this.parent=Ue,this.params=et,this[Vt]="sub"}}function un(me){const{id:ee,path:Re,parent:Ue}=me,et=Re.split("/").filter(O=>O.startsWith(":")).map(O=>O.substring(1)),wt=[...Ue.params,...et];if(Ue.params.some(O=>et.includes(O)))throw new Error("SubRouteRef may not have params that overlap with its parent");if(!Re.startsWith("/"))throw new Error(`SubRouteRef path must start with '/', got '${Re}'`);if(Re.endsWith("/"))throw new Error(`SubRouteRef path must not end with '/', got '${Re}'`);for(const O of et)if(!Wt.test(O))throw new Error(`SubRouteRef path has invalid param, got '${O}'`);return new Qt(ee,Re,Ue,wt)}let cn=Tt;class Fn{toString(){return`routeRef{type=external,id=${this.id}}`}constructor(ee,Re,Ue){this.id=ee,this.params=Re,this.optional=Ue,this[cn]="external"}}function In(me){var ee;return new Fn(me.id,(ee=me.params)!==null&&ee!==void 0?ee:[],Boolean(me.optional))}var Un=t(79635);function vn(me){const{pathname:ee}=(0,Un.TH)(),Re=(0,r.Vt)("routing-context");if(!Re)throw new Error("Routing context is not available");const Ue=Re.atVersion(1),et=(0,W.useMemo)(()=>Ue&&Ue.resolve(me,{pathname:ee}),[Ue,me,ee]);if(!Re)throw new Error("useRouteRef used outside of routing context");if(!Ue)throw new Error("RoutingContext v1 not available");const wt="optional"in me&&me.optional;if(!et&&!wt)throw new Error(`No path for ${me}`);return et}function hn(me){return(0,Un.UO)()}class Xt extends W.Component{static getDerivedStateFromError(ee){return{error:ee}}render(){const{error:ee}=this.state,{app:Re,plugin:Ue}=this.props,{ErrorBoundaryFallback:et}=Re.getComponents();return ee?(0,h.jsx)(et,{error:ee,resetError:this.handleErrorReset,plugin:Ue}):this.props.children}constructor(...ee){super(...ee),this.state={error:void 0},this.handleErrorReset=()=>{this.setState({error:void 0})}}}function Mn(me){const{component:ee,mountPoint:Re,name:Ue}=me;return pn({component:{lazy:()=>ee().then(et=>{const wt=O=>{try{vn(Re)}catch(ue){if(typeof ue=="object"&&ue!==null){const{message:Be}=ue;if(typeof Be=="string"&&Be.startsWith("No path for "))throw new Error(`Routable extension component with mount point ${Re} was not discovered in the app element tree. Routable extension components may not be rendered by other components and must be directly available as an element within the App provider component.`)}throw ue}return(0,h.jsx)(et,{...O})},ae=Ue||et.displayName||et.name||"LazyComponent";return wt.displayName=`RoutableExtension(${ae})`,wt},et=>ae=>{const O=ke(),{BootErrorPage:ue}=O.getComponents();return(0,h.jsx)(ue,{step:"load-chunk",error:et})})},data:{"core.mountPoint":Re},name:Ue})}function zn(me){const{component:ee,name:Re}=me;return pn({component:ee,name:Re})}function pn(me){const{data:ee={},name:Re}=me;Re||console.warn("Declaring extensions without name is DEPRECATED. Make sure that all usages of createReactExtension, createComponentExtension and createRoutableExtension provide a name.");let Ue;if("lazy"in me.component){const wt=me.component.lazy;Ue=(0,W.lazy)(()=>wt().then(ae=>({default:ae})))}else Ue=me.component.sync;const et=Re||Ue.displayName||Ue.name||"Component";return{expose(wt){const ae=O=>{const ue=ke(),{Progress:Be}=ue.getComponents(),D=ee==null?void 0:ee["core.mountPoint"];return(0,h.jsx)(W.Suspense,{fallback:(0,h.jsx)(Be,{}),children:(0,h.jsx)(Xt,{app:ue,plugin:wt,children:(0,h.jsx)(b,{attributes:{pluginId:wt.getId(),...Re&&{extension:Re},...D&&{routeRef:D.id}},children:(0,h.jsx)(ne,{plugin:wt,children:(0,h.jsx)(Ue,{...O})})})})})};Zt(ae,"core.plugin",wt);for(const[O,ue]of Object.entries(ee))Zt(ae,O,ue);return ae.displayName=`Extension(${et})`,ae}}}function yn(me,ee,Re,Ue){return W.Children.toArray(me).flatMap(et=>{if(!(0,W.isValidElement)(et))return[];if(et.type===W.Fragment)return yn(et.props.children,ee,Re,Ue);if(pt(et,"core.featureFlagged")){const wt=et.props;return("with"in wt?ee.isActive(wt.with):!ee.isActive(wt.without))?yn(et.props.children,ee,Re,Ue):[]}if(Re===void 0||Re(et))return[et];if(Ue)throw new Error(Ue);return yn(et.props.children,ee,Re,Ue)})}class xn{selectByComponentData(ee){const Re=yn(this.node,this.featureFlagsApi,Ue=>pt(Ue,ee.key)!==void 0,ee.withStrictError);return new xn(Re,this.featureFlagsApi)}findComponentData(ee){return yn(this.node,this.featureFlagsApi,Ue=>pt(Ue,ee.key)!==void 0).map(Ue=>pt(Ue,ee.key)).filter(Ue=>Ue!==void 0)}getElements(){return yn(this.node,this.featureFlagsApi)}constructor(ee,Re){this.node=ee,this.featureFlagsApi=Re}}function kn(me,ee,Re=[]){const Ue=te(Ke),et=new xn(me,Ue);return(0,W.useMemo)(()=>ee(et),[me,...Re])}class On{getId(){return this.config.id}getApis(){var ee;return(ee=this.config.apis)!==null&&ee!==void 0?ee:[]}getFeatureFlags(){var ee,Re;return(Re=(ee=this.config.featureFlags)===null||ee===void 0?void 0:ee.slice())!==null&&Re!==void 0?Re:[]}get routes(){var ee;return(ee=this.config.routes)!==null&&ee!==void 0?ee:{}}get externalRoutes(){var ee;return(ee=this.config.externalRoutes)!==null&&ee!==void 0?ee:{}}provide(ee){return ee.expose(this)}__experimentalReconfigure(ee){this.config.__experimentalConfigure&&(this.options=this.config.__experimentalConfigure(ee))}getPluginOptions(){this.config.__experimentalConfigure&&!this.options&&(this.options=this.config.__experimentalConfigure());var ee;return(ee=this.options)!==null&&ee!==void 0?ee:{}}toString(){return`plugin{${this.config.id}}`}constructor(ee){this.config=ee,this.options=void 0}}function bn(me){return new On(me)}},23054:function(At,Fe,t){"use strict";t.d(Fe,{SP:function(){return Y},dR:function(){return X},VL:function(){return se},BD:function(){return r}});function h(T){if(typeof T!="object"||T===null||Array.isArray(T))return!1;const R=T;return!(typeof R.name!="string"||R.name===""||typeof R.message!="string")}function r(T){if(typeof T!="object"||T===null||Array.isArray(T))throw new Error(`Encountered invalid error, not an object, got '${T}'`);const R=T;if(typeof R.name!="string"||R.name==="")throw new Error(`Encountered error object without a name, got '${T}'`);if(typeof R.message!="string")throw new Error(`Encountered error object without a message, got '${T}'`)}var W=t(24852);function k(T,R){const A={name:"Unknown",message:"<no reason given>",...serializeErrorInternal(T)};return R!=null&&R.includeStack||delete A.stack,A}function g(T){const R=(0,W.deserializeError)(T);return T.stack||(R.stack=void 0),R}function b(T){if(h(T)){const R=String(T);return R!=="[object Object]"?R:`${T.name}: ${T.message}`}return`unknown error '${T}'`}class c extends Error{constructor(R,V){var A;let C=R;if(V!==void 0){const z=b(V);C?C+=`; caused by ${z}`:C=`caused by ${z}`}super(C),(A=Error.captureStackTrace)===null||A===void 0||A.call(Error,this,this.constructor),this.name=this.constructor.name,this.cause=h(V)?V:void 0}}class P extends null{}class te extends null{}class _ extends null{}class X extends c{}class U extends null{}class F extends null{}class Y extends c{constructor(R,V){super(R,V),this.name=h(V)?V.name:"Error"}}async function ce(T){try{const V=await T.text();if(V){var R;if(!((R=T.headers.get("content-type"))===null||R===void 0)&&R.startsWith("application/json"))try{const A=JSON.parse(V);if(A.error&&A.response)return A}catch{}return{error:{name:"Error",message:`Request failed with status ${T.status} ${T.statusText}, ${V}`},response:{statusCode:T.status}}}}catch{}return{error:{name:"Error",message:`Request failed with status ${T.status} ${T.statusText}`},response:{statusCode:T.status}}}class se extends Error{static async fromResponse(R){const V=await ce(R),A=V.response.statusCode||R.status,C=V.error.name||R.statusText,z=`Request failed with ${A} ${C}`,Le=g(V.error);return new se({message:z,response:R,data:V,cause:Le})}constructor(R){super(R.message),this.name="ResponseError",this.response=R.response,this.body=R.data,this.cause=R.cause}}},32838:function(At,Fe,t){"use strict";t.d(Fe,{nW:function(){return se},ae:function(){return X},q3:function(){return U}});var h=t(25248);const r=(0,h.T0)({id:"core.scmauth"});var W=new WeakMap;class k{async getCredentials(R){const V=new URL(R.url),A=_class_private_field_get(this,W).find(C=>C.isUrlSupported(V));if(!A)throw new Error(`No auth provider available for '${R.url}', see https://backstage.io/link?scm-auth`);return A.getCredentials(R)}constructor(R){_class_private_field_init(this,W,{writable:!0,value:void 0}),_class_private_field_set(this,W,R)}}var g=new WeakMap,b=new WeakMap,c=new WeakMap,P=new WeakMap;class te{static createDefaultApiFactory(){return createApiFactory({api:scmAuthApiRef,deps:{github:githubAuthApiRef,gitlab:gitlabAuthApiRef,azure:microsoftAuthApiRef,bitbucket:bitbucketAuthApiRef},factory:({github:R,gitlab:V,azure:A,bitbucket:C})=>te.merge(te.forGithub(R),te.forGitlab(V),te.forAzure(A),te.forBitbucket(C))})}static forAuthApi(R,V){return new te("generic",R,V.host,V.scopeMapping)}static forGithub(R,V){var A;const C=(A=V==null?void 0:V.host)!==null&&A!==void 0?A:"github.com";return new te("github",R,C,{default:["repo","read:org","read:user"],repoWrite:["gist"]})}static forGitlab(R,V){var A;const C=(A=V==null?void 0:V.host)!==null&&A!==void 0?A:"gitlab.com";return new te("gitlab",R,C,{default:["read_user","read_api","read_repository"],repoWrite:["write_repository","api"]})}static forAzure(R,V){var A;const C=(A=V==null?void 0:V.host)!==null&&A!==void 0?A:"dev.azure.com";return new te("azure",R,C,{default:["vso.build","vso.code","vso.graph","vso.project","vso.profile"],repoWrite:["vso.code_manage"]})}static forBitbucket(R,V){var A;const C=(A=V==null?void 0:V.host)!==null&&A!==void 0?A:"bitbucket.org";return new te("bitbucket",R,C,{default:["account","team","pullrequest","snippet","issue"],repoWrite:["pullrequest:write","snippet:write","issue:write"]})}static merge(...R){return new k(R)}isUrlSupported(R){return R.host===_class_private_field_get(this,b)}getAdditionalScopesForProvider(R){var V;if(!(R!=null&&R.customScopes)||_class_private_field_get(this,P)==="generic")return[];var A;return(A=(V=R.customScopes)===null||V===void 0?void 0:V[_class_private_field_get(this,P)])!==null&&A!==void 0?A:[]}async getCredentials(R){const{url:V,additionalScope:A,...C}=R,z=_class_private_field_get(this,c).default.slice();A!=null&&A.repoWrite&&z.push(..._class_private_field_get(this,c).repoWrite);const Le=this.getAdditionalScopesForProvider(A);Le.length&&z.push(...Le);const Xe=[...new Set(z)],Qe=await _class_private_field_get(this,g).getAccessToken(Xe,C);return{token:Qe,headers:{Authorization:`Bearer ${Qe}`}}}constructor(R,V,A,C){_class_private_field_init(this,g,{writable:!0,value:void 0}),_class_private_field_init(this,b,{writable:!0,value:void 0}),_class_private_field_init(this,c,{writable:!0,value:void 0}),_class_private_field_init(this,P,{writable:!0,value:void 0}),_class_private_field_set(this,g,V),_class_private_field_set(this,b,A),_class_private_field_set(this,c,C),_class_private_field_set(this,P,R)}}var _=t(79158);class X{static fromConfig(R){return _.Lx.fromConfig(R)}}const U=(0,h.T0)({id:"integration.scmintegrations"});var F=t(52322),Y=t(73250),ce=t(2784);const se=T=>{const{type:R}=T,V=(0,h.qD)(),A=Y.Z;var C;const z=R&&(C=V.getSystemIcon(R))!==null&&C!==void 0?C:A;return(0,F.jsx)(z,{})}},79158:function(At,Fe,t){"use strict";t.d(Fe,{Lx:function(){return dr},BT:function(){return ct}});var h=t(82717),r=t.n(h),W=t(76635);function k(w){const u=new URL("http://example.com");return u.host=w,u.host===w}function g(w){try{return new URL(w),!0}catch{return!1}}function b(w,u){return{list(){return w},byUrl(x){try{const E=typeof x=="string"?new URL(x):x;return w.find(q=>u(q)===E.host)}catch{return}},byHost(x){return w.find(E=>u(E)===x)}}}function c(w){const{url:u,base:x,lineNumber:E}=w;try{return new URL(u),u}catch{}let q;if(u.startsWith("/")){const{filepath:ve}=r()(x);q=new URL(x);const ye=(0,W.trimEnd)(q.pathname.substring(0,q.pathname.length-ve.length),"/");q.pathname=`${ye}${u}`}else q=new URL(u,x);return q.search=new URL(x).search,E&&(q.hash=`L${E}`),q.toString()}const P="amazonaws.com";function te(w){const u=w.getOptionalString("endpoint");var x;const E=(x=w.getOptionalBoolean("s3ForcePathStyle"))!==null&&x!==void 0?x:!1;let q,ve;if(u){try{const Ht=new URL(u);q=Ht.host,ve=Ht.pathname}catch{throw new Error(`invalid awsS3 integration config, endpoint '${u}' is not a valid URL`)}if(ve!=="/")throw new Error(`invalid awsS3 integration config, endpoints cannot contain path, got '${u}'`)}else q=P;const ye=w.getOptionalString("accessKeyId"),Ne=w.getOptionalString("secretAccessKey"),Je=w.getOptionalString("roleArn"),Ft=w.getOptionalString("externalId");return{host:q,endpoint:u,s3ForcePathStyle:E,accessKeyId:ye,secretAccessKey:Ne,roleArn:Je,externalId:Ft}}function _(w){const u=w.map(te);return u.some(x=>x.host===P)||u.push({host:P}),u}class X{get type(){return"awsS3"}get title(){return this.integrationConfig.host}get config(){return this.integrationConfig}resolveUrl(u){return c(u)}resolveEditUrl(u){return u}constructor(u){this.integrationConfig=u}}X.factory=({config:w})=>{var u;const x=_((u=w.getOptionalConfigArray("integrations.awsS3"))!==null&&u!==void 0?u:[]);return b(x.map(E=>new X(E)),E=>E.config.host)};var U=t(90383),F=t(22504),Y=t(69866);const ce="GB";var se=new WeakMap,T=new WeakMap,R=new WeakMap,V=new WeakMap,A=new WeakMap,C=new WeakMap,z=new WeakMap;class Le{static fromRepoUrl(u){const x=new URL(u);let E,q,ve;const ye=x.pathname.split("/").map($n=>decodeURIComponent($n));if(ye[2]==="_git"?(E=ye[1],q=ve=ye[3]):ye[3]==="_git"?(E=ye[1],q=ye[2],ve=ye[4]):ye[4]==="_git"&&(E=`${ye[1]}/${ye[2]}`,q=ye[3],ve=ye[5]),!E||!q||!ve)throw new Error("Azure URL must point to a git repository");var Ne;const Je=(Ne=x.searchParams.get("path"))!==null&&Ne!==void 0?Ne:void 0;let Ft;const Ht=x.searchParams.get("version");if(Ht){if(Ht.slice(0,2)!=="GB")throw new Error("Azure URL version must point to a git branch");Ft=Ht.slice(2)}return new Le(x.origin,E,q,ve,Je,Ft)}toRepoUrl(){let u;return(0,U.Z)(this,R)===(0,U.Z)(this,V)?u=(0,U.Z)(this,z).call(this,(0,U.Z)(this,T),"_git",(0,U.Z)(this,V)):u=(0,U.Z)(this,z).call(this,(0,U.Z)(this,T),(0,U.Z)(this,R),"_git",(0,U.Z)(this,V)),(0,U.Z)(this,A)&&u.searchParams.set("path",(0,U.Z)(this,A)),(0,U.Z)(this,C)&&u.searchParams.set("version",ce+(0,U.Z)(this,C)),u.toString()}toFileUrl(){if(!(0,U.Z)(this,A))throw new Error("Azure URL must point to a specific path to be able to download a file");const u=(0,U.Z)(this,z).call(this,(0,U.Z)(this,T),(0,U.Z)(this,R),"_apis","git","repositories",(0,U.Z)(this,V),"items");return u.searchParams.set("api-version","6.0"),u.searchParams.set("path",(0,U.Z)(this,A)),(0,U.Z)(this,C)&&u.searchParams.set("version",(0,U.Z)(this,C)),u.toString()}toArchiveUrl(){const u=(0,U.Z)(this,z).call(this,(0,U.Z)(this,T),(0,U.Z)(this,R),"_apis","git","repositories",(0,U.Z)(this,V),"items");return u.searchParams.set("recursionLevel","full"),u.searchParams.set("download","true"),u.searchParams.set("api-version","6.0"),(0,U.Z)(this,A)&&u.searchParams.set("scopePath",(0,U.Z)(this,A)),(0,U.Z)(this,C)&&u.searchParams.set("version",(0,U.Z)(this,C)),u.toString()}toCommitsUrl(){const u=(0,U.Z)(this,z).call(this,(0,U.Z)(this,T),(0,U.Z)(this,R),"_apis","git","repositories",(0,U.Z)(this,V),"commits");return u.searchParams.set("api-version","6.0"),(0,U.Z)(this,C)&&u.searchParams.set("searchCriteria.itemVersion.version",(0,U.Z)(this,C)),u.toString()}getOwner(){return(0,U.Z)(this,T)}getProject(){return(0,U.Z)(this,R)}getRepo(){return(0,U.Z)(this,V)}getPath(){return(0,U.Z)(this,A)}getRef(){return(0,U.Z)(this,C)}constructor(u,x,E,q,ve,ye){(0,F.Z)(this,se,{writable:!0,value:void 0}),(0,F.Z)(this,T,{writable:!0,value:void 0}),(0,F.Z)(this,R,{writable:!0,value:void 0}),(0,F.Z)(this,V,{writable:!0,value:void 0}),(0,F.Z)(this,A,{writable:!0,value:void 0}),(0,F.Z)(this,C,{writable:!0,value:void 0}),(0,F.Z)(this,z,{writable:!0,value:(...Ne)=>{const Je=new URL((0,U.Z)(this,se));return Je.pathname=Ne.map(Ft=>encodeURIComponent(Ft)).join("/"),Je}}),(0,Y.Z)(this,se,u),(0,Y.Z)(this,T,x),(0,Y.Z)(this,R,E),(0,Y.Z)(this,V,q),(0,Y.Z)(this,A,ve),(0,Y.Z)(this,C,ye)}}const Xe="dev.azure.com";function Qe(w){var u;const x=(u=w.getOptionalString("host"))!==null&&u!==void 0?u:Xe,E=w.getOptionalString("token");if(!k(x))throw new Error(`Invalid Azure integration config, '${x}' is not a valid host`);return{host:x,token:E}}function _e(w){const u=w.map(Qe);return u.some(x=>x.host===Xe)||u.push({host:Xe}),u}class Ge{get type(){return"azure"}get title(){return this.integrationConfig.host}get config(){return this.integrationConfig}resolveUrl(u){const{url:x,base:E}=u;if(g(x))return x;try{const ve=Le.fromRepoUrl(E),ye=new URL(E);var q;const Ne=new URL(`https://a.com${(q=ve.getPath())!==null&&q!==void 0?q:""}`),Je=new URL(x,Ne).pathname;return ye.searchParams.set("path",Je),u.lineNumber&&(ye.searchParams.set("line",String(u.lineNumber)),ye.searchParams.set("lineEnd",String(u.lineNumber+1)),ye.searchParams.set("lineStartColumn","1"),ye.searchParams.set("lineEndColumn","1")),ye.toString()}catch{return new URL(x,E).toString()}}resolveEditUrl(u){return u}constructor(u){this.integrationConfig=u}}Ge.factory=({config:w})=>{var u;const x=_e((u=w.getOptionalConfigArray("integrations.azure"))!==null&&u!==void 0?u:[]);return b(x.map(E=>new Ge(E)),E=>E.config.host)};var mt=t(48834).lW;function Ee(w){return AzureUrl.fromRepoUrl(w).toFileUrl()}function Ke(w){return AzureUrl.fromRepoUrl(w).toArchiveUrl()}function at(w){return AzureUrl.fromRepoUrl(w).toCommitsUrl()}function vt(w,u){const x=u?{...u}:{};if(w.token){const E=mt.from(`:${w.token}`,"utf8");x.Authorization=`Basic ${E.toString("base64")}`}return{headers:x}}const it="bitbucket.org",gt="https://api.bitbucket.org/2.0";function nt(w){var u;const x=(u=w.getOptionalString("host"))!==null&&u!==void 0?u:it;let E=w.getOptionalString("apiBaseUrl");const q=w.getOptionalString("token"),ve=w.getOptionalString("username"),ye=w.getOptionalString("appPassword");if(!k(x))throw new Error(`Invalid Bitbucket integration config, '${x}' is not a valid host`);return E?E=(0,W.trimEnd)(E,"/"):x===it?E=gt:E=`https://${x}/rest/api/1.0`,{host:x,apiBaseUrl:E,token:q,username:ve,appPassword:ye}}function Lt(w){const u=w.map(nt);return u.some(x=>x.host===it)||u.push({host:it,apiBaseUrl:gt}),u}class bt{get type(){return"bitbucket"}get title(){return this.integrationConfig.host}get config(){return this.integrationConfig}resolveUrl(u){const x=c(u);if(!u.lineNumber)return x;const E=new URL(x);return this.integrationConfig.host==="bitbucket.org"?E.hash=`lines-${u.lineNumber}`:E.hash=`${u.lineNumber}`,E.toString()}resolveEditUrl(u){const x=r()(u),E=new URL(u);return E.searchParams.set("mode","edit"),E.searchParams.set("spa","0"),E.searchParams.set("at",x.ref),E.toString()}constructor(u){this.integrationConfig=u}}bt.factory=({config:w})=>{var u,x,E;const q=Lt((E=w.getOptionalConfigArray("integrations.bitbucket"))!==null&&E!==void 0?E:[...(u=w.getOptionalConfigArray("integrations.bitbucketCloud"))!==null&&u!==void 0?u:[],...(x=w.getOptionalConfigArray("integrations.bitbucketServer"))!==null&&x!==void 0?x:[]]);return b(q.map(ve=>new bt(ve)),ve=>ve.config.host)};var ze=t(96279),ne=t(48834).lW;async function Pe(w,u){const{name:x,owner:E,resource:q}=parseGitUrl(w),ve=q==="bitbucket.org";let ye=ve?`${u.apiBaseUrl}/repositories/${E}/${x}`:`${u.apiBaseUrl}/projects/${E}/repos/${x}/default-branch`,Ne=await fetch(ye,yt(u));if(Ne.status===404&&!ve&&(ye=`${u.apiBaseUrl}/projects/${E}/repos/${x}/branches/default`,Ne=await fetch(ye,yt(u))),!Ne.ok){const Ft=`Failed to retrieve default branch from ${ye}, ${Ne.status} ${Ne.statusText}`;throw new Error(Ft)}let Je;if(ve)Je=(await Ne.json()).mainbranch.name;else{const{displayId:Ft}=await Ne.json();Je=Ft}if(!Je)throw new Error(`Failed to read default branch from ${ye}. Response ${Ne.status} ${Ne.json()}`);return Je}async function ke(w,u){const{name:x,owner:E,ref:q,protocol:ve,resource:ye,filepath:Ne}=parseGitUrl(w),Je=ye==="bitbucket.org";let Ft=q;Ft||(Ft=await Pe(w,u));const Ht=Ne?`&path=${encodeURIComponent(decodeURIComponent(Ne))}`:"";return Je?`${ve}://${ye}/${E}/${x}/get/${Ft}.tar.gz`:`${u.apiBaseUrl}/projects/${E}/repos/${x}/archive?format=tgz&at=${Ft}&prefix=${E}-${x}${Ht}`}function tt(w,u){try{const{owner:x,name:E,ref:q,filepathtype:ve,filepath:ye}=parseGitUrl(w);if(!x||!E||ve!=="browse"&&ve!=="raw"&&ve!=="src")throw new Error("Invalid Bitbucket URL or file path");const Ne=ye.replace(/^\//,"");if(u.host==="bitbucket.org"){if(!q)throw new Error("Invalid Bitbucket URL or file path");return`${u.apiBaseUrl}/repositories/${x}/${E}/src/${q}/${Ne}`}return`${u.apiBaseUrl}/projects/${x}/repos/${E}/raw/${Ne}?at=${q}`}catch(x){throw new Error(`Incorrect URL: ${w}, ${x}`)}}function yt(w){const u={};if(w.token)u.Authorization=`Bearer ${w.token}`;else if(w.username&&w.appPassword){const x=ne.from(`${w.username}:${w.appPassword}`,"utf8");u.Authorization=`Basic ${x.toString("base64")}`}return{headers:u}}const Zt="bitbucket.org",pt="https://api.bitbucket.org/2.0";function Tt(w){const u=Zt,x=pt,E=w.getString("username"),q=w.getString("appPassword");return{host:u,apiBaseUrl:x,username:E,appPassword:q}}function It(w){const u=w.map(Tt);return u.length===0&&u.push({host:Zt,apiBaseUrl:pt}),u}class Ot{get type(){return"bitbucketCloud"}get title(){return this.integrationConfig.host}get config(){return this.integrationConfig}resolveUrl(u){const x=c(u);if(u.lineNumber){const E=new URL(x);return E.hash=`lines-${u.lineNumber}`,E.toString()}return x}resolveEditUrl(u){const x=r()(u),E=new URL(u);return E.searchParams.set("mode","edit"),E.searchParams.set("at",x.ref),E.toString()}constructor(u){this.integrationConfig=u}}Ot.factory=({config:w})=>{var u;const x=It((u=w.getOptionalConfigArray("integrations.bitbucketCloud"))!==null&&u!==void 0?u:[]);return b(x.map(E=>new Ot(E)),E=>E.config.host)};var en=t(48834).lW;async function Wt(w,u){const{name:x,owner:E}=parseGitUrl(w),q=`${u.apiBaseUrl}/repositories/${E}/${x}`,ve=await fetch(q,un(u));if(!ve.ok){const Je=`Failed to retrieve default branch from ${q}, ${ve.status} ${ve.statusText}`;throw new Error(Je)}const Ne=(await ve.json()).mainbranch.name;if(!Ne)throw new Error(`Failed to read default branch from ${q}. Response ${ve.status} ${ve.json()}`);return Ne}async function Vt(w,u){const{name:x,owner:E,ref:q,protocol:ve,resource:ye}=parseGitUrl(w);let Ne=q;return Ne||(Ne=await Wt(w,u)),`${ve}://${ye}/${E}/${x}/get/${Ne}.tar.gz`}function Qt(w,u){try{const{owner:x,name:E,ref:q,filepathtype:ve,filepath:ye}=parseGitUrl(w);if(!x||!E||ve!=="src"&&ve!=="raw")throw new Error("Invalid Bitbucket Cloud URL or file path");const Ne=ye.replace(/^\//,"");if(!q)throw new Error("Invalid Bitbucket Cloud URL or file path");return`${u.apiBaseUrl}/repositories/${x}/${E}/src/${q}/${Ne}`}catch(x){throw new Error(`Incorrect URL: ${w}, ${x}`)}}function un(w){const u={};if(w.username&&w.appPassword){const x=en.from(`${w.username}:${w.appPassword}`,"utf8");u.Authorization=`Basic ${x.toString("base64")}`}return{headers:u}}function cn(w){const u=w.getString("host");let x=w.getOptionalString("apiBaseUrl");const E=w.getOptionalString("token"),q=w.getOptionalString("username"),ve=w.getOptionalString("password");if(!k(u))throw new Error(`Invalid Bitbucket Server integration config, '${u}' is not a valid host`);return x?x=(0,W.trimEnd)(x,"/"):x=`https://${u}/rest/api/1.0`,{host:u,apiBaseUrl:x,token:E,username:q,password:ve}}function Fn(w){return w.map(cn)}class In{get type(){return"bitbucketServer"}get title(){return this.integrationConfig.host}get config(){return this.integrationConfig}resolveUrl(u){const x=c(u);if(u.lineNumber){const E=new URL(x);return E.hash=u.lineNumber.toString(),E.toString()}return x}resolveEditUrl(u){return u.includes("?")?u.substring(0,u.indexOf("?")):u}constructor(u){this.integrationConfig=u}}In.factory=({config:w})=>{var u;const x=Fn((u=w.getOptionalConfigArray("integrations.bitbucketServer"))!==null&&u!==void 0?u:[]);return b(x.map(E=>new In(E)),E=>E.config.host)};var Un=t(48834).lW;async function vn(w,u){const{name:x,owner:E}=parseGitUrl(w);let q=`${u.apiBaseUrl}/projects/${E}/repos/${x}/default-branch`,ve=await fetch(q,Mn(u));if(ve.status===404&&(q=`${u.apiBaseUrl}/projects/${E}/repos/${x}/branches/default`,ve=await fetch(q,Mn(u))),!ve.ok){const Je=`Failed to retrieve default branch from ${q}, ${ve.status} ${ve.statusText}`;throw new Error(Je)}const{displayId:ye}=await ve.json(),Ne=ye;if(!Ne)throw new Error(`Failed to read default branch from ${q}. Response ${ve.status} ${ve.json()}`);return Ne}async function hn(w,u){const{name:x,owner:E,ref:q,filepath:ve}=parseGitUrl(w);let ye=q;ye||(ye=await vn(w,u));const Ne=ve?`&path=${encodeURIComponent(decodeURIComponent(ve))}`:"";return`${u.apiBaseUrl}/projects/${E}/repos/${x}/archive?format=tgz&at=${ye}&prefix=${E}-${x}${Ne}`}function Xt(w,u){try{const{owner:x,name:E,ref:q,filepathtype:ve,filepath:ye}=parseGitUrl(w);if(!x||!E||ve!=="browse"&&ve!=="raw"&&ve!=="src")throw new Error("Invalid Bitbucket Server URL or file path");const Ne=ye.replace(/^\//,"");return`${u.apiBaseUrl}/projects/${x}/repos/${E}/raw/${Ne}?at=${q}`}catch(x){throw new Error(`Incorrect URL: ${w}, ${x}`)}}function Mn(w){const u={};if(w.token)u.Authorization=`Bearer ${w.token}`;else if(w.username&&w.password){const x=Un.from(`${w.username}:${w.password}`,"utf8");u.Authorization=`Basic ${x.toString("base64")}`}return{headers:u}}function zn(w){const u=w.getString("host");let x=w.getOptionalString("baseUrl"),E=w.getOptionalString("cloneUrl"),q=w.getOptionalString("gitilesBaseUrl");const ve=w.getOptionalString("username"),ye=w.getOptionalString("password");if(k(u)){if(x&&!g(x))throw new Error(`Invalid Gerrit integration config, '${x}' is not a valid baseUrl`);if(E&&!g(E))throw new Error(`Invalid Gerrit integration config, '${E}' is not a valid cloneUrl`);if(q&&!g(q))throw new Error(`Invalid Gerrit integration config, '${q}' is not a valid gitilesBaseUrl`)}else throw new Error(`Invalid Gerrit integration config, '${u}' is not a valid host`);return x?x=(0,W.trimEnd)(x,"/"):x=`https://${u}`,q?q=(0,W.trimEnd)(q,"/"):q=`https://${u}`,E?E=(0,W.trimEnd)(E,"/"):E=x,{host:u,baseUrl:x,cloneUrl:E,gitilesBaseUrl:q,username:ve,password:ye}}function pn(w){return w.map(zn)}var yn=t(48834).lW;const xn=")]}'";function kn(w,u){const E=u.replace(w.gitilesBaseUrl,"").split("/").filter(Ft=>!!Ft),q=E.indexOf("+");if(q<=0)throw new Error(`Unable to parse project from url: ${u}`);const ve=(0,W.trimStart)(E.slice(0,q).join("/"),"/"),ye=E.indexOf("heads");if(ye<=0)throw new Error(`Unable to parse branch from url: ${u}`);const Ne=E[ye+1],Je=E.slice(ye+2).join("/");return{branch:Ne,filePath:Je===""?"/":Je,project:ve}}function On(w,u,x,E){return`${w.gitilesBaseUrl}/${u}/+/refs/heads/${x}/${(0,W.trimStart)(E,"/")}`}function bn(w){return w.password?"/a/":"/"}function me(w,u){const{branch:x,project:E}=kn(w,u);return`${w.baseUrl}${bn(w)}projects/${encodeURIComponent(E)}/branches/${x}`}function ee(w,u){const{project:x}=kn(w,u);return`${w.cloneUrl}${bn(w)}${x}`}function Re(w,u){const{branch:x,filePath:E,project:q}=kn(w,u);return`${w.baseUrl}${bn(w)}projects/${encodeURIComponent(q)}/branches/${x}/files/${encodeURIComponent(E)}/content`}function Ue(w){return`${w.baseUrl}${bn(w)}projects/`}function et(w){const u={};if(!w.password)return u;const x=yn.from(`${w.username}:${w.password}`,"utf8");return u.Authorization=`Basic ${x.toString("base64")}`,{headers:u}}async function wt(w){const u=await w.text();if(u.startsWith(xn))try{return JSON.parse(u.slice(xn.length))}catch(x){throw new Error(`Invalid response from Gerrit: ${u.slice(0,10)} - ${x}`)}throw new Error(`Gerrit JSON body prefix missing. Found: ${u.slice(0,10)}`)}class ae{get type(){return"gerrit"}get title(){return this.integrationConfig.host}get config(){return this.integrationConfig}resolveUrl(u){const{url:x,base:E,lineNumber:q}=u;let ve;if(x.startsWith("/")){const{branch:ye,project:Ne}=kn(this.config,E);return On(this.config,Ne,ye,x)}return x?ve=new URL(x,E):ve=new URL(E),q&&(ve.hash=q.toString()),ve.toString()}resolveEditUrl(u){return u}constructor(u){this.integrationConfig=u}}ae.factory=({config:w})=>{var u;const x=pn((u=w.getOptionalConfigArray("integrations.gerrit"))!==null&&u!==void 0?u:[]);return b(x.map(E=>new ae(E)),E=>E.config.host)};function O(w){const u=w.getString("host");let x=w.getOptionalString("baseUrl");const E=w.getOptionalString("username"),q=w.getOptionalString("password");if(!k(u))throw new Error(`Invalid Gitea integration config, '${u}' is not a valid host`);return x?x=(0,W.trimEnd)(x,"/"):x=`https://${u}`,{host:u,baseUrl:x,username:E,password:q}}var ue=t(48834).lW;function Be(w,u){try{var x;const E=(x=w.baseUrl)!==null&&x!==void 0?x:`https://${w.host}`,[q,ve,ye,Ne,Je,Ft,...Ht]=u.replace(E,"").split("/"),$n=Ht.join("/").replace(/^\//,"");return`${E}/${ve}/${ye}/_edit/${Ft}/${$n}`}catch(E){throw new Error(`Incorrect URL: ${u}, ${E}`)}}function D(w,u){try{var x;const E=(x=w.baseUrl)!==null&&x!==void 0?x:`https://${w.host}`,[q,ve,ye,Ne,Je,Ft,...Ht]=u.replace(E,"").split("/"),$n=Ht.join("/").replace(/^\//,"");return`${E}/api/v1/repos/${ve}/${ye}/contents/${$n}?ref=${Ft}`}catch(E){throw new Error(`Incorrect URL: ${u}, ${E}`)}}function M(w){const u={},{username:x,password:E}=w;return E?(x?u.Authorization=`basic ${ue.from(`${x}:${E}`).toString("base64")}`:u.Authorization=`token ${E}`,{headers:u}):u}class he{get type(){return"gitea"}get title(){return this.config.host}resolveUrl(u){return c(u)}resolveEditUrl(u){return Be(this.config,u)}constructor(u){this.config=u}}he.factory=({config:w})=>{var u;const E=((u=w.getOptionalConfigArray("integrations.gitea"))!==null&&u!==void 0?u:[]).map(q=>O(q));return b(E.map(q=>new he(q)),q=>q.config.host)};const fe="github.com",be="https://api.github.com",$e="https://raw.githubusercontent.com";function Ae(w){var u,x;const E=(x=w.getOptionalString("host"))!==null&&x!==void 0?x:fe;let q=w.getOptionalString("apiBaseUrl"),ve=w.getOptionalString("rawBaseUrl");const ye=w.getOptionalString("token"),Ne=(u=w.getOptionalConfigArray("apps"))===null||u===void 0?void 0:u.map(Je=>({appId:Je.getNumber("appId"),clientId:Je.getString("clientId"),clientSecret:Je.getString("clientSecret"),webhookSecret:Je.getString("webhookSecret"),privateKey:Je.getString("privateKey"),allowedInstallationOwners:Je.getOptionalStringArray("allowedInstallationOwners")}));if(!k(E))throw new Error(`Invalid GitHub integration config, '${E}' is not a valid host`);return q?q=(0,W.trimEnd)(q,"/"):E===fe&&(q=be),ve?ve=(0,W.trimEnd)(ve,"/"):E===fe&&(ve=$e),{host:E,apiBaseUrl:q,rawBaseUrl:ve,token:ye,apps:Ne}}function We(w){const u=w.map(Ae);return u.some(x=>x.host===fe)||u.push({host:fe,apiBaseUrl:be,rawBaseUrl:$e}),u}function st(w,u,x){try{const{owner:E,name:q,ref:ve,filepathtype:ye,filepath:Ne}=parseGitUrl(w);if(!E||!q||!ve||ye!=="blob"&&ye!=="raw"&&ye!=="tree")throw new Error("Invalid GitHub URL or file path");const Je=Ne.replace(/^\//,"");return K(u,x)==="api"?`${u.apiBaseUrl}/repos/${E}/${q}/contents/${Je}?ref=${ve}`:`${u.rawBaseUrl}/${E}/${q}/${ve}/${Je}`}catch(E){throw new Error(`Incorrect URL: ${w}, ${E}`)}}function S(w,u){const x={};return K(w,u)==="api"&&(x.Accept="application/vnd.github.v3.raw"),u.token&&(x.Authorization=`token ${u.token}`),{headers:x}}function K(w,u){return w.apiBaseUrl&&(u.token||!w.rawBaseUrl)?"api":"raw"}var ge=t(42822),de=t(89393),Ce=t(26228);class Oe{async getOrCreateToken(u,x,E){let q=this.tokenCache.get(u);if((!q||this.isExpired(q.expiresAt))&&(q=await E(),q.expiresAt=q.expiresAt.minus({minutes:10}),this.tokenCache.set(u,q)),!this.appliesToRepo(q,x))throw new Error(`The Backstage GitHub application used in the ${u} organization does not have access to a repository with the name ${x}`);return{accessToken:q.token}}appliesToRepo(u,x){return x===void 0?!0:u.repositories!==void 0?u.repositories.includes(x):!0}constructor(){this.tokenCache=new Map,this.isExpired=u=>Ce.ou.local()>u}}const Me={Accept:"application/vnd.github.machine-man-preview+json"};class ht{async getInstallationCredentials(u,x){if(this.allowedInstallationOwners){var E;if(!(!((E=this.allowedInstallationOwners)===null||E===void 0)&&E.includes(u)))return{accessToken:void 0}}return this.cache.getOrCreateToken(u,x,async()=>{const{installationId:q,suspended:ve}=await this.getInstallationData(u);if(ve)throw new Error(`The GitHub application for ${u} is suspended`);const ye=await this.appClient.apps.createInstallationAccessToken({installation_id:q,headers:Me});let Ne;if(ye.data.repository_selection==="selected"){const Ft=new de.v({baseUrl:this.baseUrl,auth:ye.data.token}),Ht=await Ft.paginate(Ft.apps.listReposAccessibleToInstallation);var Je;Ne=((Je=Ht.repositories)!==null&&Je!==void 0?Je:Ht).map(ur=>ur.name)}return{token:ye.data.token,expiresAt:Ce.ou.fromISO(ye.data.expires_at),repositories:Ne}})}getInstallations(){return this.appClient.paginate(this.appClient.apps.listInstallations)}async getInstallationData(u){const E=(await this.getInstallations()).find(ve=>{var ye,Ne;return((ye=ve.account)===null||ye===void 0||(Ne=ye.login)===null||Ne===void 0?void 0:Ne.toLocaleLowerCase("en-US"))===u.toLocaleLowerCase("en-US")});if(E)return{installationId:E.id,suspended:Boolean(E.suspended_by)};const q=new Error(`No app installation found for ${u} in ${this.baseAuthConfig.appId}`);throw q.name="NotFoundError",q}constructor(u,x){this.cache=new Oe,this.allowedInstallationOwners=u.allowedInstallationOwners,this.baseUrl=x,this.baseAuthConfig={appId:u.appId,privateKey:u.privateKey.replace(/\\n/gm,`
|
|
33
|
+
`)},this.appClient=new de.v({baseUrl:x,headers:Me,authStrategy:ge.i,auth:this.baseAuthConfig})}}class jt{async getAllInstallations(){return this.apps.length?(await Promise.all(this.apps.map(x=>x.getInstallations()))).flat():[]}async getAppToken(u,x){if(this.apps.length===0)return;const E=await Promise.all(this.apps.map(Ne=>Ne.getInstallationCredentials(u,x).then(Je=>({credentials:Je,error:void 0}),Je=>({credentials:void 0,error:Je})))),q=E.find(Ne=>Ne.credentials);if(q)return q.credentials.accessToken;const ye=E.map(Ne=>Ne.error).find(Ne=>Ne.name!=="NotFoundError");if(ye)throw ye}constructor(u){var x,E;this.apps=(E=(x=u.apps)===null||x===void 0?void 0:x.map(q=>new ht(q,u.apiBaseUrl)))!==null&&E!==void 0?E:[]}}class lt{async getCredentials(u){const x=r()(u.url),E=x.owner||x.name,q=x.owner?x.name:void 0;let ve="app",ye=await this.githubAppCredentialsMux.getAppToken(E,q);return ye||(ve="token",ye=this.token),{headers:ye?{Authorization:`Bearer ${ye}`}:void 0,token:ye,type:ve}}constructor(u,x){this.githubAppCredentialsMux=u,this.token=x}}lt.create=w=>new lt(new jt(w),w.token);class ft{static fromIntegrations(u){const x=new Map;return u.github.list().forEach(E=>{const q=SingleInstanceGithubCredentialsProvider.create(E.config);x.set(E.config.host,q)}),new ft(x)}async getCredentials(u){const x=new URL(u.url),E=this.providers.get(x.host);if(!E)throw new Error(`There is no GitHub integration that matches ${u.url}. Please add a configuration for an integration.`);return E.getCredentials(u)}constructor(u){this.providers=u}}class xt{get type(){return"github"}get title(){return this.integrationConfig.host}get config(){return this.integrationConfig}resolveUrl(u){return ct(c(u),"tree")}resolveEditUrl(u){return ct(u,"edit")}constructor(u){this.integrationConfig=u}}xt.factory=({config:w})=>{var u;const x=We((u=w.getOptionalConfigArray("integrations.github"))!==null&&u!==void 0?u:[]);return b(x.map(E=>new xt(E)),E=>E.config.host)};function ct(w,u){return w.replace(/\/\/([^/]+)\/([^/]+)\/([^/]+)\/(blob|tree|edit)\//,(x,E,q,ve)=>`//${E}/${q}/${ve}/${u}/`)}const Bt=null;class Mt extends xt{get config(){return super.config}constructor(u){super(u)}}Mt.factory=xt.factory;const zt=null,qt=null,Wn=null,Sn="gitlab.com",Dt="https://gitlab.com/api/v4";function Nt(w){const u=w.getString("host");let x=w.getOptionalString("apiBaseUrl");const E=w.getOptionalString("token");let q=w.getOptionalString("baseUrl");if(x?x=(0,W.trimEnd)(x,"/"):u===Sn&&(x=Dt),q?q=(0,W.trimEnd)(q,"/"):q=`https://${u}`,k(u)){if(!x||!g(x))throw new Error(`Invalid GitLab integration config, '${x}' is not a valid apiBaseUrl`);if(!g(q))throw new Error(`Invalid GitLab integration config, '${q}' is not a valid baseUrl`)}else throw new Error(`Invalid GitLab integration config, '${u}' is not a valid host`);return{host:u,token:E,apiBaseUrl:x,baseUrl:q}}function rn(w){const u=w.map(Nt);return u.some(x=>x.host===Sn)||u.push({host:Sn,apiBaseUrl:Dt,baseUrl:`https://${Sn}`}),u}function Bn(w){let u="";return w.host!==Sn&&(u=new URL(w.baseUrl).pathname),trimEnd(u,"/")}async function Xn(w,u){const x=await Yn(w,u);return wn(w,x,u).toString()}function Cn(w){const{token:u=""}=w;return{headers:{"PRIVATE-TOKEN":u}}}function wn(w,u,x){try{const E=new URL(w),q=E.pathname.split("/blob/").slice(1).join("/blob/"),[ve,...ye]=q.split("/"),Ne=getGitLabIntegrationRelativePath(x);return E.pathname=[...Ne?[Ne]:[],"api/v4/projects",u,"repository/files",encodeURIComponent(decodeURIComponent(ye.join("/"))),"raw"].join("/"),E.search=`?ref=${ve}`,E}catch(E){throw new Error(`Incorrect url: ${w}, ${E}`)}}async function Yn(w,u){const x=new URL(w);if(!x.pathname.includes("/blob/"))throw new Error("Please provide full path to yaml file from GitLab");try{let E=x.pathname.split("/-/blob/")[0].split("/blob/")[0];const q=getGitLabIntegrationRelativePath(u);q&&(E=E.replace(q,""));const ve=new URL(`${x.origin}${q}/api/v4/projects/${encodeURIComponent(E.replace(/^\//,""))}`),ye=await fetch(ve.toString(),Cn(u)),Ne=await ye.json();if(!ye.ok)throw new Error(`GitLab Error '${Ne.error}', ${Ne.error_description}`);return Number(Ne.id)}catch(E){throw new Error(`Could not get GitLab project ID for: ${w}, ${E}`)}}class fn{get type(){return"gitlab"}get title(){return this.integrationConfig.host}get config(){return this.integrationConfig}resolveUrl(u){return c(u)}resolveEditUrl(u){return Rn(u,"edit")}constructor(u){this.integrationConfig=u}}fn.factory=({config:w})=>{var u;const x=rn((u=w.getOptionalConfigArray("integrations.gitlab"))!==null&&u!==void 0?u:[]);return b(x.map(E=>new fn(E)),E=>E.config.host)};function Rn(w,u){return w.replace(/\/\-\/(blob|tree|edit)\//,`/-/${u}/`)}class dr{static fromConfig(u){return new dr({awsS3:X.factory({config:u}),azure:Ge.factory({config:u}),bitbucket:bt.factory({config:u}),bitbucketCloud:Ot.factory({config:u}),bitbucketServer:In.factory({config:u}),gerrit:ae.factory({config:u}),github:xt.factory({config:u}),gitlab:fn.factory({config:u}),gitea:he.factory({config:u})})}get awsS3(){return this.byType.awsS3}get azure(){return this.byType.azure}get bitbucket(){return this.byType.bitbucket}get bitbucketCloud(){return this.byType.bitbucketCloud}get bitbucketServer(){return this.byType.bitbucketServer}get gerrit(){return this.byType.gerrit}get github(){return this.byType.github}get gitlab(){return this.byType.gitlab}get gitea(){return this.byType.gitea}list(){return Object.values(this.byType).flatMap(u=>u.list())}byUrl(u){let x=Object.values(this.byType).map(E=>E.byUrl(u)).filter(Boolean);if(x.length>1){const E=x.filter(q=>!(q instanceof bt));E.length!==0&&(x=E)}return x[0]}byHost(u){return Object.values(this.byType).map(x=>x.byHost(u)).find(Boolean)}resolveUrl(u){const x=this.byUrl(u.base);return x?x.resolveUrl(u):c(u)}resolveEditUrl(u){const x=this.byUrl(u);return x?x.resolveEditUrl(u):u}constructor(u){this.byType=u}}},51102:function(At,Fe,t){"use strict";var h={};t.r(h),t.d(h,{TechDocsPlugin:function(){return C.s4}});var r=t(52322),W=t(2784),k=t(28316),g=t(79635),b=t(25248);const c=(0,b.T0)({id:"plugin.techdocs.storageservice"}),P=(0,b.T0)({id:"plugin.techdocs.service"});var te=t(92077),_=t(95481),X=t(7476),U=t(93225),F=t(67896),Y=t(65124),ce=t(17339),se=t(85478),T=t(68435),R=t(3482),V=t(42081),A=t(48431),C=t(89258),z=t(52943),Le=t(61886),Xe=t(13980),Qe=t.n(Xe);class _e{get(n){for(const o of this.holders){const l=o.get(n);if(l)return l}}constructor(...n){this.holders=n}}var Ge=t(51837);const mt=(0,Ge.CT)("api-context"),Ee=i=>{var n;const{apis:o,children:l}=i,f=(n=(0,W.useContext)(mt))===null||n===void 0?void 0:n.atVersion(1),L=f?new _e(o,f):o;return(0,r.jsx)(mt.Provider,{value:(0,Ge.EI)({1:L}),children:l})};Ee.propTypes={apis:Qe().shape({get:Qe().func.isRequired}).isRequired,children:Qe().node};class Ke{static validateFactories(n,o){for(const l of o){const f=[l],L=new Set;for(;f.length;){const Z=f.shift(),H=n.get(Z);if(!!H)for(const re of Object.values(H.deps)){if(re.id===l.id)throw new Error(`Circular dependency of api factory for ${l}`);L.has(re)||(L.add(re),f.push(re))}}}}get(n){return this.load(n)}load(n,o=[]){const l=this.apis.get(n.id);if(l)return l;const f=this.factories.get(n);if(!f)return;if(o.includes(f.api))throw new Error(`Circular dependency of api factory for ${f.api}`);const L=this.loadDeps(n,f.deps,[...o,f.api]),Z=f.factory(L);return this.apis.set(n.id,Z),Z}loadDeps(n,o,l){const f={};for(const L in o)if(o.hasOwnProperty(L)){const Z=o[L],H=this.load(Z,l);if(!H)throw new Error(`No API factory available for dependency ${Z} of dependent ${n}`);f[L]=H}return f}constructor(n){this.factories=n,this.apis=new Map}}var at;(function(i){i[i.default=10]="default",i[i.app=50]="app",i[i.static=100]="static"})(at||(at={}));class vt{register(n,o){const l=at[n],f=this.factories.get(o.api.id);return f&&f.priority>=l?!1:(this.factories.set(o.api.id,{priority:l,factory:o}),!0)}get(n){const o=this.factories.get(n.id);if(!!o)return o.factory}getAllApis(){const n=new Set;for(const{factory:o}of this.factories.values())n.add(o.api);return n}constructor(){this.factories=new Map}}function it(i){return new Promise((n,o)=>{const l=i.width||500,f=i.height||700,L=window.screen.width/2-l/2,Z=window.screen.height/2-f/2,H=window.open(i.url,i.name,`menubar=no,location=no,resizable=no,scrollbars=no,status=no,width=${l},height=${f},top=${Z},left=${L}`);let re="";if(!H||typeof H.closed=="undefined"||H.closed){const ot=new Error("Failed to open auth popup.");ot.name="PopupRejectedError",o(ot);return}const He=ot=>{if(ot.source!==H||ot.origin!==i.origin)return;const{data:Ct}=ot;if(Ct.type==="config_info"){re=Ct.targetOrigin;return}if(Ct.type!=="authorization_response")return;const St=Ct;if("error"in St){const $t=new Error(St.error.message);$t.name=St.error.name,o($t)}else n(St.response);ut()},De=setInterval(()=>{if(H.closed){const ot=`Login failed, ${re&&re!==window.location.origin?`Incorrect app origin, expected ${re}`:"popup was closed"}`,Ct=new Error(ot);Ct.name="PopupClosedError",o(Ct),ut()}},100);function ut(){window.removeEventListener("message",He),clearInterval(De)}window.addEventListener("message",He)})}function gt(i){return[...i].join(" ")}class nt{async createSession(n){return n.instantPopup?this.showPopup(n.scopes):this.authRequester(n.scopes)}async refreshSession(){const n=await fetch(await this.buildUrl("/refresh",{optional:!0}),{headers:{"x-requested-with":"XMLHttpRequest"},credentials:"include"}).catch(l=>{throw new Error(`Auth refresh request failed, ${l}`)});if(!n.ok){const l=new Error(`Auth refresh request failed, ${n.statusText}`);throw l.status=n.status,l}const o=await n.json();if(o.error){const l=new Error(o.error.message);throw o.error.name&&(l.name=o.error.name),l}return await this.sessionTransform(o)}async removeSession(){const n=await fetch(await this.buildUrl("/logout"),{method:"POST",headers:{"x-requested-with":"XMLHttpRequest"},credentials:"include"}).catch(o=>{throw new Error(`Logout request failed, ${o}`)});if(!n.ok){const o=new Error(`Logout request failed, ${n.statusText}`);throw o.status=n.status,o}}async showPopup(n){const o=this.joinScopesFunc(n),l=await this.buildUrl("/start",{scope:o,origin:window.location.origin}),f=await it({url:l,name:`${this.provider.title} Login`,origin:new URL(l).origin,width:450,height:730});return await this.sessionTransform(f)}async buildUrl(n,o){const l=await this.discoveryApi.getBaseUrl("auth"),f=this.buildQueryString({...o,env:this.environment});return`${l}/${this.provider.id}${n}${f}`}buildQueryString(n){if(!n)return"";const o=Object.entries(n).map(([l,f])=>{if(typeof f=="string")return`${encodeURIComponent(l)}=${encodeURIComponent(f)}`;if(f)return encodeURIComponent(l)}).filter(Boolean).join("&");return o?`?${o}`:""}constructor(n){const{discoveryApi:o,environment:l,provider:f,joinScopes:L=gt,oauthRequestApi:Z,sessionTransform:H=re=>re}=n;this.authRequester=Z.createAuthRequester({provider:f,onAuthRequest:re=>this.showPopup(re)}),this.discoveryApi=o,this.environment=l,this.provider=f,this.joinScopesFunc=L,this.sessionTransform=H}}function Lt(i,n){for(const o of n)if(!i.has(o))return!1;return!0}class bt{sessionExistsAndHasScope(n,o){if(!n)return!1;if(!o||this.options.sessionScopes===void 0)return!0;const l=this.options.sessionScopes(n);return Lt(l,o)}getExtendedScope(n,o){const l=new Set(this.options.defaultScopes);if(n&&this.options.sessionScopes!==void 0){const f=this.options.sessionScopes(n);for(const L of f)l.add(L)}if(o)for(const f of o)l.add(f);return l}constructor(n){this.options=n}}var ze=t(82394),ne=t.n(ze);let Pe=Symbol.observable;class ke{[Pe](){return this}get closed(){return this.isClosed}next(n){if(this.isClosed)throw new Error("PublishSubject is closed");this.subscribers.forEach(o=>o.next(n))}error(n){if(this.isClosed)throw new Error("PublishSubject is closed");this.isClosed=!0,this.terminatingError=n,this.subscribers.forEach(o=>o.error(n))}complete(){if(this.isClosed)throw new Error("PublishSubject is closed");this.isClosed=!0,this.subscribers.forEach(n=>n.complete())}subscribe(n,o,l){const f=typeof n=="function"?{next:n,error:o,complete:l}:n;return this.observable.subscribe(f)}constructor(){this.isClosed=!1,this.observable=new(ne())(n=>this.isClosed?(this.terminatingError?n.error(this.terminatingError):n.complete(),()=>{}):(this.subscribers.add(n),()=>{this.subscribers.delete(n)})),this.subscribers=new Set}}let tt=Symbol.observable;class yt{[tt](){return this}get closed(){return this.isClosed}next(n){if(this.isClosed)throw new Error("BehaviorSubject is closed");this.currentValue=n,this.subscribers.forEach(o=>o.next(n))}error(n){if(this.isClosed)throw new Error("BehaviorSubject is closed");this.isClosed=!0,this.terminatingError=n,this.subscribers.forEach(o=>o.error(n))}complete(){if(this.isClosed)throw new Error("BehaviorSubject is closed");this.isClosed=!0,this.subscribers.forEach(n=>n.complete())}subscribe(n,o,l){const f=typeof n=="function"?{next:n,error:o,complete:l}:n;return this.observable.subscribe(f)}constructor(n){this.subscribers=new Set,this.isClosed=!1,this.currentValue=n,this.terminatingError=void 0,this.observable=new(ne())(o=>this.isClosed?(this.terminatingError?o.error(this.terminatingError):o.complete(),()=>{}):(o.next(this.currentValue),this.subscribers.add(o),()=>{this.subscribers.delete(o)}))}}class Zt{setIsSignedIn(n){this.signedIn!==n&&(this.signedIn=n,this.subject.next(this.signedIn?b.sM.SignedIn:b.sM.SignedOut))}sessionState$(){return this.subject}constructor(){this.subject=new yt(b.sM.SignedOut),this.signedIn=!1}}class pt{async getSession(n){if(this.helper.sessionExistsAndHasScope(this.currentSession,n.scopes)){if(!this.sessionShouldRefreshFunc(this.currentSession))return this.currentSession;try{const l=await this.collapsedSessionRefresh(),f=this.sessionScopesFunc(this.currentSession),L=this.sessionScopesFunc(l);return Lt(L,f)&&(this.currentSession=l),l}catch(l){if(n.optional)return;throw l}}if(!this.currentSession&&!n.instantPopup)try{const o=await this.collapsedSessionRefresh();return this.currentSession=o,this.getSession(n)}catch{}if(!n.optional)return this.currentSession=await this.connector.createSession({...n,scopes:this.helper.getExtendedScope(this.currentSession,n.scopes)}),this.stateTracker.setIsSignedIn(!0),this.currentSession}async removeSession(){this.currentSession=void 0,await this.connector.removeSession(),this.stateTracker.setIsSignedIn(!1)}sessionState$(){return this.stateTracker.sessionState$()}async collapsedSessionRefresh(){if(this.refreshPromise)return this.refreshPromise;this.refreshPromise=this.connector.refreshSession();try{const n=await this.refreshPromise;return this.stateTracker.setIsSignedIn(!0),n}finally{delete this.refreshPromise}}constructor(n){this.stateTracker=new Zt;const{connector:o,defaultScopes:l=new Set,sessionScopes:f,sessionShouldRefresh:L}=n;this.connector=o,this.sessionScopesFunc=f,this.sessionShouldRefreshFunc=L,this.helper=new bt({sessionScopes:f,defaultScopes:l})}}class Tt{setSession(n){this.currentSession=n,this.stateTracker.setIsSignedIn(Boolean(n))}async getSession(n){if(this.helper.sessionExistsAndHasScope(this.currentSession,n.scopes))return this.currentSession;if(!n.optional)return this.currentSession=await this.connector.createSession({...n,scopes:this.helper.getExtendedScope(this.currentSession,n.scopes)}),this.stateTracker.setIsSignedIn(!0),this.currentSession}async removeSession(){this.currentSession=void 0,this.stateTracker.setIsSignedIn(!1)}sessionState$(){return this.stateTracker.sessionState$()}constructor(n){this.stateTracker=new SessionStateTracker;const{connector:o,defaultScopes:l=new Set,sessionScopes:f}=n;this.connector=o,this.helper=new SessionScopeHelper({sessionScopes:f,defaultScopes:l})}}const It={id:"oauth2",title:"Your Identity Provider",icon:()=>null};class Ot{static create(n){const{discoveryApi:o,environment:l="development",provider:f=It,oauthRequestApi:L,defaultScopes:Z=[],scopeTransform:H=De=>De}=n,re=new nt({discoveryApi:o,environment:l,provider:f,oauthRequestApi:L,sessionTransform(De){return{...De,providerInfo:{idToken:De.providerInfo.idToken,accessToken:De.providerInfo.accessToken,scopes:Ot.normalizeScopes(H,De.providerInfo.scope),expiresAt:new Date(Date.now()+De.providerInfo.expiresInSeconds*1e3)}}}}),He=new pt({connector:re,defaultScopes:new Set(Z),sessionScopes:De=>De.providerInfo.scopes,sessionShouldRefresh:De=>(De.providerInfo.expiresAt.getTime()-Date.now())/1e3<60*5});return new Ot({sessionManager:He,scopeTransform:H})}async signIn(){await this.getAccessToken()}async signOut(){await this.sessionManager.removeSession()}sessionState$(){return this.sessionManager.sessionState$()}async getAccessToken(n,o){const l=Ot.normalizeScopes(this.scopeTransform,n),f=await this.sessionManager.getSession({...o,scopes:l});var L;return(L=f==null?void 0:f.providerInfo.accessToken)!==null&&L!==void 0?L:""}async getIdToken(n={}){const o=await this.sessionManager.getSession(n);var l;return(l=o==null?void 0:o.providerInfo.idToken)!==null&&l!==void 0?l:""}async getBackstageIdentity(n={}){const o=await this.sessionManager.getSession(n);return o==null?void 0:o.backstageIdentity}async getProfile(n={}){const o=await this.sessionManager.getSession(n);return o==null?void 0:o.profile}static normalizeScopes(n,o){if(!o)return new Set;const l=Array.isArray(o)?o:o.split(/[\s|,]/).filter(Boolean);return new Set(n(l))}constructor(n){this.sessionManager=n.sessionManager,this.scopeTransform=n.scopeTransform}}const en={id:"github",title:"GitHub",icon:()=>null};class Wt{static create(n){const{discoveryApi:o,environment:l="development",provider:f=en,oauthRequestApi:L,defaultScopes:Z=["read:user"]}=n;return Ot.create({discoveryApi:o,oauthRequestApi:L,provider:f,environment:l,defaultScopes:Z})}}const Vt={id:"gitlab",title:"GitLab",icon:()=>null};class Qt{static create(n){const{discoveryApi:o,environment:l="development",provider:f=Vt,oauthRequestApi:L,defaultScopes:Z=["read_user"]}=n;return Ot.create({discoveryApi:o,oauthRequestApi:L,provider:f,environment:l,defaultScopes:Z})}}const un={id:"google",title:"Google",icon:()=>null},cn="https://www.googleapis.com/auth/";class Fn{static create(n){const{discoveryApi:o,oauthRequestApi:l,environment:f="development",provider:L=un,defaultScopes:Z=["openid",`${cn}userinfo.email`,`${cn}userinfo.profile`]}=n;return Ot.create({discoveryApi:o,oauthRequestApi:l,provider:L,environment:f,defaultScopes:Z,scopeTransform(H){return H.map(re=>re==="openid"?re:re==="profile"||re==="email"?`${cn}userinfo.${re}`:re.startsWith(cn)?re:`${cn}${re}`)}})}}const In={id:"okta",title:"Okta",icon:()=>null},Un=new Set(["openid","profile","email","phone","address","groups","offline_access"]),vn="okta.";class hn{static create(n){const{discoveryApi:o,environment:l="development",provider:f=In,oauthRequestApi:L,defaultScopes:Z=["openid","email","profile","offline_access"]}=n;return Ot.create({discoveryApi:o,oauthRequestApi:L,provider:f,environment:l,defaultScopes:Z,scopeTransform(H){return H.map(re=>Un.has(re)||re.startsWith(vn)?re:`${vn}${re}`)}})}}var Xt=t(30195);const Mn=Xt.z.object({profile:Xt.z.object({email:Xt.z.string().optional(),displayName:Xt.z.string().optional(),picture:Xt.z.string().optional()}),backstageIdentity:Xt.z.object({token:Xt.z.string(),identity:Xt.z.object({type:Xt.z.literal("user"),userEntityRef:Xt.z.string(),ownershipEntityRefs:Xt.z.array(Xt.z.string())})})}),zn={id:"saml",title:"SAML",icon:()=>null};class pn{static create(n){const{discoveryApi:o,environment:l="development",provider:f=zn}=n,L=new DirectAuthConnector({discoveryApi:o,environment:l,provider:f}),Z=new StaticAuthSessionManager({connector:L}),H=new AuthSessionStore({manager:Z,storageKey:`${f.id}Session`,schema:samlSessionSchema});return new pn(H)}sessionState$(){return this.sessionManager.sessionState$()}async signIn(){await this.getBackstageIdentity({})}async signOut(){await this.sessionManager.removeSession()}async getBackstageIdentity(n={}){const o=await this.sessionManager.getSession(n);return o==null?void 0:o.backstageIdentity}async getProfile(n={}){const o=await this.sessionManager.getSession(n);return o==null?void 0:o.profile}constructor(n){this.sessionManager=n}}const yn={id:"microsoft",title:"Microsoft",icon:()=>null};class xn{static create(n){const{environment:o="development",provider:l=yn,oauthRequestApi:f,discoveryApi:L,defaultScopes:Z=["openid","offline_access","profile","email","User.Read"]}=n;return Ot.create({discoveryApi:L,oauthRequestApi:f,provider:l,environment:o,defaultScopes:Z})}}const kn={id:"onelogin",title:"onelogin",icon:()=>null},On=new Set(["openid","profile","email","phone","address","groups","offline_access"]),bn="onelogin.";class me{static create(n){const{discoveryApi:o,environment:l="development",provider:f=kn,oauthRequestApi:L}=n;return Ot.create({discoveryApi:o,oauthRequestApi:L,provider:f,environment:l,defaultScopes:["openid","email","profile","offline_access"],scopeTransform(Z){return Z.map(H=>On.has(H)||H.startsWith(bn)?H:`${bn}${H}`)}})}}const ee={id:"bitbucket",title:"Bitbucket",icon:()=>null};class Re{static create(n){const{discoveryApi:o,environment:l="development",provider:f=ee,oauthRequestApi:L,defaultScopes:Z=["team"]}=n;return Ot.create({discoveryApi:o,oauthRequestApi:L,provider:f,environment:l,defaultScopes:Z})}}const Ue={id:"atlassian",title:"Atlassian",icon:()=>null};class et{static create(n){const{discoveryApi:o,environment:l="development",provider:f=Ue,oauthRequestApi:L}=n;return Ot.create({discoveryApi:o,oauthRequestApi:L,provider:f,environment:l})}}class wt{post(n){this.subject.next(n)}alert$(){return this.subject}constructor(){this.subject=new ke}}class ae{captureEvent(n){}}const O="theme";class ue{static createWithStorage(n){const o=new ue(n);if(!window.localStorage)return o;var l;const f=(l=window.localStorage.getItem(O))!==null&&l!==void 0?l:void 0;return o.setActiveThemeId(f),o.activeThemeId$().subscribe(L=>{L?window.localStorage.setItem(O,L):window.localStorage.removeItem(O)}),window.addEventListener("storage",L=>{if(L.key===O){var Z;const H=(Z=localStorage.getItem(O))!==null&&Z!==void 0?Z:void 0;o.setActiveThemeId(H)}}),o}getInstalledThemes(){return this.themes.slice()}activeThemeId$(){return this.subject}getActiveThemeId(){return this.activeThemeId}setActiveThemeId(n){this.activeThemeId=n,this.subject.next(n)}constructor(n){this.themes=n,this.subject=new yt(void 0)}}var Be=t(9850),D=t.n(Be),M=t(12782),he=t.n(M);const fe=/^[a-z][a-z0-9]*(?:[-_][a-z][a-z0-9]*)*$/i;function be(i){return typeof i=="object"&&i!==null&&!Array.isArray(i)}function $e(i){if(i===null)return"null";if(Array.isArray(i))return"array";const n=typeof i;return n==="number"&&isNaN(i)?"nan":n==="string"&&i===""?"empty-string":n}const Ae={type(i,n,o,l){return`Invalid type in config for key '${i}' in '${n}', got ${o}, wanted ${l}`},missing(i){return`Missing required config value at '${i}'`},convert(i,n,o){return`Unable to convert config value for key '${i}' in '${n}' to a ${o}`}};class We{static fromConfigs(n){return n.length===0?new We(void 0):n.reduce((o,{data:l,context:f,filteredKeys:L,deprecatedKeys:Z})=>{const H=new We(l,f,o);if(H.filteredKeys=L,Z)for(const{key:re,description:He}of Z)console.warn(`The configuration key '${re}' of ${f} is deprecated and may be removed soon. ${He||""}`);return H},void 0)}has(n){var o;if(this.readValue(n)!==void 0)return!0;var f;return(f=(o=this.fallback)===null||o===void 0?void 0:o.has(n))!==null&&f!==void 0?f:!1}keys(){var n;const o=this.data?Object.keys(this.data):[];var l;const f=(l=(n=this.fallback)===null||n===void 0?void 0:n.keys())!==null&&l!==void 0?l:[];return[...new Set([...o,...f])]}get(n){const o=this.getOptional(n);if(o===void 0)throw new Error(Ae.missing(this.fullKey(n!=null?n:"")));return o}getOptional(n){var o;const l=D()(this.readValue(n)),f=(o=this.fallback)===null||o===void 0?void 0:o.getOptional(n);if(l===void 0){if(!1)var L;return f}else if(f===void 0)return l;return he()({},{value:f},{value:l},(Z,H)=>!be(H)||!be(Z)?H:void 0).value}getConfig(n){const o=this.getOptionalConfig(n);if(o===void 0)throw new Error(Ae.missing(this.fullKey(n)));return o}getOptionalConfig(n){var o;const l=this.readValue(n),f=(o=this.fallback)===null||o===void 0?void 0:o.getOptionalConfig(n);if(be(l))return this.copy(l,n,f);if(l!==void 0)throw new TypeError(Ae.type(this.fullKey(n),this.context,$e(l),"object"));return f}getConfigArray(n){const o=this.getOptionalConfigArray(n);if(o===void 0)throw new Error(Ae.missing(this.fullKey(n)));return o}getOptionalConfigArray(n){const o=this.readConfigValue(n,f=>{if(!Array.isArray(f))return{expected:"object-array"};for(const[L,Z]of f.entries())if(!be(Z))return{expected:"object-array",value:Z,key:`${n}[${L}]`};return!0});if(!o){if(!1)var l;return}return o.map((f,L)=>this.copy(f,`${n}[${L}]`))}getNumber(n){const o=this.getOptionalNumber(n);if(o===void 0)throw new Error(Ae.missing(this.fullKey(n)));return o}getOptionalNumber(n){const o=this.readConfigValue(n,f=>typeof f=="number"||typeof f=="string"||{expected:"number"});if(typeof o=="number"||o===void 0)return o;const l=Number(o);if(!Number.isFinite(l))throw new Error(Ae.convert(this.fullKey(n),this.context,"number"));return l}getBoolean(n){const o=this.getOptionalBoolean(n);if(o===void 0)throw new Error(Ae.missing(this.fullKey(n)));return o}getOptionalBoolean(n){const o=this.readConfigValue(n,f=>typeof f=="boolean"||typeof f=="number"||typeof f=="string"||{expected:"boolean"});if(typeof o=="boolean"||o===void 0)return o;const l=String(o).trim();if(/^(?:y|yes|true|1|on)$/i.test(l))return!0;if(/^(?:n|no|false|0|off)$/i.test(l))return!1;throw new Error(Ae.convert(this.fullKey(n),this.context,"boolean"))}getString(n){const o=this.getOptionalString(n);if(o===void 0)throw new Error(Ae.missing(this.fullKey(n)));return o}getOptionalString(n){return this.readConfigValue(n,o=>typeof o=="string"&&o!==""||{expected:"string"})}getStringArray(n){const o=this.getOptionalStringArray(n);if(o===void 0)throw new Error(Ae.missing(this.fullKey(n)));return o}getOptionalStringArray(n){return this.readConfigValue(n,o=>{if(!Array.isArray(o))return{expected:"string-array"};for(const[l,f]of o.entries())if(typeof f!="string"||f==="")return{expected:"string-array",value:f,key:`${n}[${l}]`};return!0})}fullKey(n){return`${this.prefix}${this.prefix?".":""}${n}`}copy(n,o,l){const f=new We(n,this.context,l,this.fullKey(o));return f.filteredKeys=this.filteredKeys,f}readConfigValue(n,o){const l=this.readValue(n);if(l===void 0){var f;if(!1)var L;return(f=this.fallback)===null||f===void 0?void 0:f.readConfigValue(n,o)}const Z=o(l);if(Z!==!0){const{key:H=n,value:re=l,expected:He}=Z;throw new TypeError(Ae.type(this.fullKey(H),this.context,$e(re),He))}return l}readValue(n){const o=n?n.split("."):[];for(const f of o)if(!fe.test(f))throw new TypeError(`Invalid config key '${n}'`);if(this.data===void 0)return;let l=this.data;for(const[f,L]of o.entries())if(be(l))l=l[L];else if(l!==void 0){const Z=this.fullKey(o.slice(0,f).join("."));throw new TypeError(Ae.type(Z,this.context,$e(l),"object"))}return l}constructor(n,o="mock-config",l,f=""){this.data=n,this.context=o,this.fallback=l,this.prefix=f,this.notifiedFilteredKeys=new Set}}const st="Invalid discovery URL pattern,";class S{static compile(n){const o=n.split(/\{\{\s*pluginId\s*\}\}/),l=o.join("pluginId");let f;try{f=new URL(l)}catch{throw new Error(`${st} URL '${l}' is invalid`)}if(f.hash)throw new Error(`${st} URL must not have a hash`);if(f.search)throw new Error(`${st} URL must not have a query`);if(l.endsWith("/"))throw new Error(`${st} URL must not end with a slash`);return new S(o)}async getBaseUrl(n){return this.parts.join(n)}constructor(n){this.parts=n}}class K{post(n,o){return o!=null&&o.hidden||this.alertApi.post({message:n.message,severity:"error"}),this.errorApi.post(n,o)}error$(){return this.errorApi.error$()}constructor(n,o){this.alertApi=n,this.errorApi=o}}class ge{post(n,o){this.subject.next({error:n,context:o})}error$(){return this.subject}constructor(){this.subject=new ke}}class de{static forward(n,o){window.addEventListener("unhandledrejection",l=>{n.post(l.reason,o)})}}function Ce(i){if(i.length<3)throw new Error(`The '${i}' feature flag must have a minimum length of three characters.`);if(i.length>150)throw new Error(`The '${i}' feature flag must not exceed 150 characters.`);if(!i.match(/^[a-z]+[a-z0-9-]+$/))throw new Error(`The '${i}' feature flag must start with a lowercase letter and only contain lowercase letters, numbers and hyphens. Examples: feature-flag-one, alpha, release-2020`)}class Oe{registerFlag(n){Ce(n.name),this.registeredFeatureFlags.push(n)}getRegisteredFlags(){return this.registeredFeatureFlags.slice()}isActive(n){return this.flags||(this.flags=this.load()),this.flags.get(n)===b.CL.Active}save(n){this.flags||(this.flags=this.load()),n.merge||this.flags.clear();for(const[l,f]of Object.entries(n.states))this.flags.set(l,f);const o=Array.from(this.flags.entries()).filter(([,l])=>l===b.CL.Active);window.localStorage.setItem("featureFlags",JSON.stringify(Object.fromEntries(o)))}load(){try{const n=window.localStorage.getItem("featureFlags");if(!n)return new Map;const o=JSON.parse(n);if(typeof o!="object"||o===null||Array.isArray(o))return new Map;const l=Object.entries(o).filter(([f,L])=>(Ce(f),L===b.CL.Active));return new Map(l)}catch{return new Map}}constructor(){this.registeredFeatureFlags=[]}}function Me(i){let n=i.baseImplementation||t.g.fetch;var o;const l=[(o=i.middleware)!==null&&o!==void 0?o:[]].flat().reverse();for(const f of l)n=f.apply(n);return{fetch:n}}class ht{static create(n){var o,l;const f=jt(n),L=((o=n.header)===null||o===void 0?void 0:o.name)||"authorization",Z=((l=n.header)===null||l===void 0?void 0:l.value)||(H=>`Bearer ${H}`);return new ht(n.identityApi,f,L,Z)}apply(n){return async(o,l)=>{const f=new Request(o,l),{token:L}=await this.identityApi.getCredentials();return f.headers.get(this.headerName)||typeof L!="string"||!L||!this.allowUrl(f.url)?n(o,l):(f.headers.set(this.headerName,this.headerValue(L)),n(f))}}constructor(n,o,l,f){this.identityApi=n,this.allowUrl=o,this.headerName=l,this.headerValue=f}}function jt(i){return i.allowUrl?i.allowUrl:i.urlPrefixAllowlist?lt(i.urlPrefixAllowlist):i.config?lt([i.config.getString("backend.baseUrl")]):()=>!1}function lt(i){const n=i.map(o=>o.replace(/\/$/,""));return o=>n.some(l=>o===l||o.startsWith(`${l}/`))}function ft(i,n){return!n||n==="/"?i:`${i.replace(/\/$/,"")}/${n.replace(/^\//,"")}`}class xt{apply(n){return async(o,l)=>{const f=new Request(o,l),L="plugin://";if(!f.url.startsWith(L))return n(o,l);const{hostname:Z,pathname:H,search:re,hash:He,username:De,password:ut}=new URL(`http://${f.url.substring(L.length)}`);let ot=await this.discoveryApi.getBaseUrl(Z);if(De||ut){const St=new URL(ot),$t=`${De}${ut?`:${ut}`:""}@`;ot=`${St.protocol}//${$t}${St.host}${St.pathname}`}const Ct=`${ft(ot,H)}${re}${He}`;return n(Ct,typeof o=="string"||ct(o)?l:o)}}constructor(n){this.discoveryApi=n}}function ct(i){return typeof i=="object"&&(i==null?void 0:i.constructor)===URL}class Bt{static resolvePluginProtocol(n){return new xt(n.discoveryApi)}static injectIdentityAuth(n){return ht.create(n)}constructor(){}}function Mt(i,n){for(const o of n)if(!i.has(o))return!1;return!0}function zt(i,...n){const o=new Set(i);for(const l of n)for(const f of l)o.add(f);return o}class qt{request(n){return new Promise((o,l)=>{this.requests.push({scopes:n,resolve:o,reject:l}),this.subject.next(this.getCurrentPending())})}resolve(n,o){this.requests=this.requests.filter(l=>Mt(n,l.scopes)?(l.resolve(o),!1):!0),this.subject.next(this.getCurrentPending())}reject(n){this.requests.forEach(o=>o.reject(n)),this.requests=[],this.subject.next(this.getCurrentPending())}pending(){return this.subject}getCurrentPending(){const n=this.requests.length===0?void 0:this.requests.slice(1).reduce((o,l)=>zt(o,l.scopes),this.requests[0].scopes);return{scopes:n,resolve:o=>{n&&this.resolve(n,o)},reject:o=>{n&&this.reject(o)}}}constructor(){this.requests=[],this.subject=new yt(this.getCurrentPending())}}class Wn{createAuthRequester(n){const o=new qt,l=this.handlerCount;return this.handlerCount++,o.pending().subscribe({next:f=>{const L=this.currentRequests.slice(),Z=this.makeAuthRequest(f,n);Z?L[l]=Z:delete L[l],this.currentRequests=L,this.subject.next(L.filter(Boolean))}}),f=>o.request(f)}makeAuthRequest(n,o){const{scopes:l}=n;if(!!l)return{provider:o.provider,trigger:async()=>{const f=await o.onAuthRequest(l);n.resolve(f)},reject:()=>{const f=new Error("Login failed, rejected by user");f.name="RejectedError",n.reject(f)}}}authRequest$(){return this.subject}constructor(){this.subject=new yt([]),this.currentRequests=[],this.handlerCount=0}}const Sn=new Map;class Dt{static create(n){var o;return new Dt((o=n.namespace)!==null&&o!==void 0?o:"",n.errorApi)}static addStorageEventListener(){window.addEventListener("storage",n=>{for(const[l,f]of Sn.entries()){var o;!((o=n.key)===null||o===void 0)&&o.startsWith(l)&&f.handleStorageChange(n.key)}})}get(n){return this.snapshot(n).value}snapshot(n){let o,l="absent";try{const f=localStorage.getItem(this.getKeyName(n));f&&(o=JSON.parse(f,(L,Z)=>(typeof Z=="object"&&Z!==null&&Object.freeze(Z),Z)),l="present")}catch{this.errorApi.post(new Error(`Error when parsing JSON config from storage for: ${n}`))}return{key:n,value:o,presence:l}}forBucket(n){const o=`${this.namespace}/${n}`;return Sn.has(o)||Sn.set(o,new Dt(o,this.errorApi)),Sn.get(o)}async set(n,o){localStorage.setItem(this.getKeyName(n),JSON.stringify(o)),this.notifyChanges(n)}async remove(n){localStorage.removeItem(this.getKeyName(n)),this.notifyChanges(n)}observe$(n){return Dt.hasSubscribed||(Dt.addStorageEventListener(),Dt.hasSubscribed=!0),this.observable.filter(({key:o})=>o===n)}handleStorageChange(n){if(!(n!=null&&n.startsWith(this.namespace)))return;const o=n==null?void 0:n.slice(`${this.namespace}/`.length);o.includes("/")||this.notifyChanges(decodeURIComponent(o))}getKeyName(n){return`${this.namespace}/${encodeURIComponent(n)}`}notifyChanges(n){const o=this.snapshot(n);for(const l of this.subscribers)l.next(o)}constructor(n,o){this.namespace=n,this.errorApi=o,this.subscribers=new Set,this.observable=new(ne())(l=>(this.subscribers.add(l),()=>{this.subscribers.delete(l)}))}}Dt.hasSubscribed=!1;const Nt=(0,W.createContext)(void 0);function rn(){const[i]=(0,g.is)((0,r.jsx)(g.AW,{index:!0,element:(0,r.jsx)("div",{})}));return!i.index}var Bn=t(16060);const Xn=(i,n)=>{try{var o,l;const f=(0,Bn.fp)(n,{pathname:i}),L=(o=f==null?void 0:f.filter(H=>{var re;return((re=H==null?void 0:H.route.routeRefs)===null||re===void 0?void 0:re.size)>0}).pop())===null||o===void 0?void 0:o.route;if(!L)return{};let Z;return L.routeRefs.size===1&&(Z=L.routeRefs.values().next().value),{extension:"App",pluginId:((l=L.plugin)===null||l===void 0?void 0:l.getId())||"root",...Z?{routeRef:Z.id}:{}}}catch{return{}}},Cn=({pathname:i,search:n,hash:o})=>{const l=(0,b.z$)();return(0,W.useEffect)(()=>{l.captureEvent("navigate",`${i}${n}${o}`)},[l,i,n,o]),null},wn=({routeObjects:i})=>{const{pathname:n,search:o,hash:l}=(0,g.TH)();return(0,r.jsx)(b.fC,{attributes:Xn(n,i),children:(0,r.jsx)(Cn,{pathname:n,search:o,hash:l})})};function Yn(i){return rn()?fn(i):""}function fn(i){var n;let{pathname:o}=new URL((n=i.getOptionalString("app.baseUrl"))!==null&&n!==void 0?n:"/","http://sample.dev");return o=o.replace(/\/*$/,""),o}function Rn({component:i,appIdentityProxy:n,children:o}){const[l,f]=(0,W.useState)(),L=(0,b.h_)(b.Ds),Z=Yn(L);return l?(n.setTarget(l,{signOutTargetUrl:Z||"/"}),(0,r.jsx)(r.Fragment,{children:o})):(0,r.jsx)(i,{onSignInSuccess:f})}function dr(i){const{Router:n,SignInPage:o}=(0,b.qD)().getComponents(),l=(0,b.h_)(b.Ds),f=fn(l),L=`${f}/*`,Z=(0,W.useContext)(Nt);if(!Z)throw new Error("AppRouter must be rendered within the AppProvider");const{routeObjects:H,appIdentityProxy:re}=Z;return o?rn()?(0,r.jsxs)(n,{children:[(0,r.jsx)(wn,{routeObjects:H}),(0,r.jsx)(Rn,{component:o,appIdentityProxy:re,children:(0,r.jsx)(g.Z5,{children:(0,r.jsx)(g.AW,{path:L,element:(0,r.jsx)(r.Fragment,{children:i.children})})})})]}):(0,r.jsxs)(n,{basename:f,children:[(0,r.jsx)(wn,{routeObjects:H}),(0,r.jsx)(Rn,{component:o,appIdentityProxy:re,children:i.children})]}):(re.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:f||"/"}),rn()?(0,r.jsxs)(n,{children:[(0,r.jsx)(wn,{routeObjects:H}),(0,r.jsx)(g.Z5,{children:(0,r.jsx)(g.AW,{path:L,element:(0,r.jsx)(r.Fragment,{children:i.children})})})]}):(0,r.jsxs)(n,{basename:f,children:[(0,r.jsx)(wn,{routeObjects:H}),i.children]}))}var w=t(90383),u=t(22504),x=t(69866),E=t(64279);function q(i){const n={};for(const l in i.collectors)i.collectors.hasOwnProperty(l)&&(n[l]=i.collectors[l]());const o=[{node:W.Children.toArray(i.root),parent:void 0,contexts:{}}];for(;o.length!==0;){const{node:l,parent:f,contexts:L}=o.shift();W.Children.forEach(l,Z=>{if(!(0,W.isValidElement)(Z))return;const H={};for(const re in n)if(n.hasOwnProperty(re)){const He=n[re];H[re]=He.visit(He.accumulator,Z,f,L[re])}for(const re of i.discoverers){const He=re(Z);He&&o.push({node:He,parent:Z,contexts:H})}})}return Object.fromEntries(Object.entries(n).map(([l,f])=>[l,f.accumulator]))}function ve(i,n){return()=>({accumulator:i(),visit:n})}function ye(i){var n;return(n=i.props)===null||n===void 0?void 0:n.children}function Ne(i){var n,o;if(((n=i.props)===null||n===void 0?void 0:n.path)&&((o=i.props)===null||o===void 0?void 0:o.element)){var l;return(l=i.props)===null||l===void 0?void 0:l.element}}const Je=ve(()=>new Set,(i,n)=>{const o=(0,b.IY)(n,"core.plugin");o&&i.add(o)}),Ft=i=>{const{children:n}=i,o=(0,b.h_)(b.W0),l="with"in i?o.isActive(i.with):!o.isActive(i.without);return(0,r.jsx)(r.Fragment,{children:l?n:null})};(0,b.R5)(Ft,"core.featureFlagged",!0);const Ht={caseSensitive:!1,path:"*",element:"match-all",routeRefs:new Set};function $n(i){const n=i;if(n!=null&&n.type){var o,l;return(l=(o=n.type.displayName)!==null&&o!==void 0?o:n.type.name)!==null&&l!==void 0?l:String(n.type)}return String(n)}function ur(i,n=new Array){return W.Children.forEach(i,o=>{if(!(0,W.isValidElement)(o))return;const l=(0,b.IY)(o,"core.mountPoint");if(l){const f=(0,b.IY)(o,"core.plugin");n.push({routeRef:l,plugin:f})}ur(o.props.children,n)}),n}const hs=ve(()=>({paths:new Map,parents:new Map,objects:new Array}),(i,n,o,l)=>{var f,L;if(l!=null&&l.isElementAncestor)return l;if((o==null?void 0:o.props.element)===n)return{...l,isElementAncestor:!0};const Z=(f=n.props)===null||f===void 0?void 0:f.path,H=(0,b.IY)(n,"core.mountPoint");if(H&&Z)throw new Error(`Path property may not be set directly on a routable extension "${$n(n)}"`);var re;const He=(re=l==null||(L=l.obj)===null||L===void 0?void 0:L.children)!==null&&re!==void 0?re:i.objects;if(Z!==void 0){if(typeof Z!="string")throw new Error(`Element path must be a string at "${$n(n)}"`);const Ct=Z.startsWith("/")?Z.slice(1):Z,St=n.props.element;if((0,b.IY)(n,"core.gatherMountPoints")){var De;if(St)throw new Error(`Mount point gatherers may not have an element prop "${$n(n)}"`);const $t={path:Ct,element:"gathered",routeRefs:new Set,caseSensitive:Boolean((De=n.props)===null||De===void 0?void 0:De.caseSensitive),children:[Ht],plugin:void 0};return He.push($t),{obj:$t,gatherPath:Ct,routeRef:l==null?void 0:l.routeRef,gatherRouteRef:l==null?void 0:l.routeRef}}if(St){var ut;const[$t,...Et]=ur(St);if(Et.length>0)throw new Error(`Route element with path "${Z}" may not contain multiple routable extensions`);if(!$t)return l;const{routeRef:Tn,plugin:Kn}=$t,nr={path:Ct,element:"mounted",routeRefs:new Set([Tn]),caseSensitive:Boolean((ut=n.props)===null||ut===void 0?void 0:ut.caseSensitive),children:[Ht],plugin:Kn};return He.push(nr),i.paths.set(Tn,Ct),i.parents.set(Tn,l==null?void 0:l.routeRef),{obj:nr,routeRef:Tn!=null?Tn:l==null?void 0:l.routeRef,gatherPath:Ct,gatherRouteRef:l==null?void 0:l.gatherRouteRef}}}if(H){var ot;if((l==null?void 0:l.gatherPath)===void 0)throw new Error(`Routable extension "${$n(n)}" with mount point "${H}" must be assigned a path`);return l==null||(ot=l.obj)===null||ot===void 0||ot.routeRefs.add(H),i.paths.set(H,l.gatherPath),i.parents.set(H,l==null?void 0:l.gatherRouteRef),{...l,routeRef:H}}return l}),ps=ve(()=>({paths:new Map,parents:new Map,objects:new Array}),(i,n,o,l)=>{var f,L,Z;if((o==null?void 0:o.props.element)===n)return l;let H=l==null?void 0:l.obj,re=l==null?void 0:l.routeRef,He=l==null?void 0:l.sticky;const De=(f=n.props)===null||f===void 0?void 0:f.path;var ut;const ot=(ut=H==null?void 0:H.children)!==null&&ut!==void 0?ut:i.objects,Ct=Boolean((L=n.props)===null||L===void 0?void 0:L.caseSensitive);let St=l==null?void 0:l.path;if((0,b.IY)(n,"core.gatherMountPoints")){if(!De)throw new Error("Mount point gatherer must have a path");St=De}const $t=(Z=n.props)===null||Z===void 0?void 0:Z.element;let Et=(0,b.IY)(n,"core.mountPoint");if(!Et&&(0,W.isValidElement)($t)&&(Et=(0,b.IY)($t,"core.mountPoint")),Et){let nr=De;if(St&&(nr?St=void 0:nr=St),!nr)throw new Error("Mounted routable extension must have a path");i.paths.set(Et,nr),re&&He?(i.parents.set(Et,re),De&&(re=Et,He=!1)):(i.parents.set(Et,re),re=Et),De?(H={caseSensitive:Ct,path:De,element:"mounted",routeRefs:new Set([Et]),children:[Ht],plugin:(0,b.IY)(n.props.element,"core.plugin")},ot.push(H)):H==null||H.routeRefs.add(Et)}if((0,b.IY)(n,"core.gatherMountPoints")&&(He=!0),(0,b.IY)(n,"core.gatherMountPoints")){if(!De)throw new Error("Mount point gatherer must have a path");if(!Et){var Kn;H={caseSensitive:Ct,path:De,element:"gathered",routeRefs:new Set,children:[Ht],plugin:l==null||(Kn=l.obj)===null||Kn===void 0?void 0:Kn.plugin},ot.push(H)}}return{obj:H,path:St,routeRef:re,sticky:He}}),Rr=ve(()=>new Set,(i,n)=>{if(n.type===Ft){const o=n.props;i.add("with"in o?o.with:o.without)}}),hr=(0,Ge.uW)("route-ref-type",()=>Symbol("route-ref-type"));function Lr(i){return i[hr]==="absolute"}function Vr(i){return i[hr]==="sub"}function Pr(i){return i[hr]==="external"}function Jn(...i){const n=i.join("/").replace(/\/\/+/g,"/");return n!=="/"&&n.endsWith("/")?n.slice(0,-1):n}function qn(i,n,o){let l,f="";if(Lr(i))l=i;else if(Vr(i))l=i.parent,f=i.path;else if(Pr(i)){const H=o.get(i);if(!H)return[void 0,""];if(Lr(H))l=H;else if(Vr(H))l=H.parent,f=H.path;else throw new Error(`ExternalRouteRef was bound to invalid target, ${H}`)}else throw i[hr]?new Error(`Unknown or invalid route ref type, ${i[hr]}`):new Error(`Unknown object passed to useRouteRef, got ${i}`);if(!l)return[void 0,""];const L=n.get(l);if(L===void 0)return[void 0,""];const Z=Jn(L,f);return[l,Z]}function pr(i,n,o,l,f){var L;const Z=(L=(0,Bn.fp)(f,n))!==null&&L!==void 0?L:[],H=Array();let re=-1;for(let ut=i;ut&&(re=Z.findIndex(ot=>ot.route.routeRefs.has(ut)),re===-1);ut=l.get(ut))H.unshift(ut);H.length===0&&(re-=1);const He=re===-1?"":Z[re].pathname,De=H.slice(0,-1).map(ut=>{const ot=o.get(ut);if(ot===void 0)throw new Error(`No path for ${ut}`);if(ot.includes(":"))throw new Error(`Cannot route to ${i} with parent ${ut} as it has parameters`);return ot});return`${Jn(He,...De)}/`}class kr{resolve(n,o){const[l,f]=qn(n,this.routePaths,this.routeBindings);if(!l)return;let L;typeof o=="string"?L=this.trimPath(o):o.pathname?L={...o,pathname:this.trimPath(o.pathname)}:L=o;const Z=this.appBasePath+pr(l,L,this.routePaths,this.routeParents,this.routeObjects);return(...[re])=>Jn(Z,(0,Bn.Gn)(f,re))}trimPath(n){return n&&(n.startsWith(this.appBasePath)?n.slice(this.appBasePath.length):n)}constructor(n,o,l,f,L){this.routePaths=n,this.routeParents=o,this.routeObjects=l,this.routeBindings=f,this.appBasePath=L}}const Hr=(0,Ge.CT)("routing-context"),Us=({routePaths:i,routeParents:n,routeObjects:o,routeBindings:l,basePath:f="",children:L})=>{const Z=new kr(i,n,o,l,f),H=(0,Ge.EI)({1:Z});return(0,r.jsx)(Hr.Provider,{value:H,children:L})};function Or(i,n){const o=new Set(n.values());o.delete(void 0);for(const l of n.keys()){if(o.has(l))continue;let f=l,L="";for(;f;){const H=i.get(f);if(H===void 0)throw new Error(`No path for ${f}`);L=Jn(H,L),f=n.get(f)}const Z=L.match(/:(\w+)/g);if(Z){for(let H=0;H<Z.length;H++)for(let re=H+1;re<Z.length;re++)if(Z[re]===Z[H])throw new Error(`Parameter ${Z[re]} is duplicated in path ${L}`)}}}function fs(i,n){for(const o of n)if(!!o.externalRoutes){for(const[l,f]of Object.entries(o.externalRoutes))if(!f.optional&&!i.has(f))throw new Error(`External route '${l}' of the '${o.getId()}' plugin must be bound to a target route. See https://backstage.io/link?bind-routes for details.`)}}const gs=(0,Ge.CT)("app-context"),Cr=({appContext:i,children:n})=>{const o=(0,Ge.EI)({1:i});return(0,r.jsx)(gs.Provider,{value:o,children:n})};function gn(i){return new Error(`Tried to access IdentityApi ${i} before app was loaded`)}function or(i){console.warn(`WARNING: Call to ${i} is deprecated and will break in the future`)}class Br{setTarget(n,o){this.target=n,this.signOutTargetUrl=o.signOutTargetUrl,this.resolveTarget(n)}getUserId(){if(!this.target)throw gn("getUserId");if(!this.target.getUserId)throw new Error("IdentityApi does not implement getUserId");return or("getUserId"),this.target.getUserId()}getProfile(){if(!this.target)throw gn("getProfile");if(!this.target.getProfile)throw new Error("IdentityApi does not implement getProfile");return or("getProfile"),this.target.getProfile()}async getProfileInfo(){return this.waitForTarget.then(n=>n.getProfileInfo())}async getBackstageIdentity(){const n=await this.waitForTarget.then(o=>o.getBackstageIdentity());return n.userEntityRef.match(/^.*:.*\/.*$/)||console.warn(`WARNING: The App IdentityApi provided an invalid userEntityRef, '${n.userEntityRef}'. It must be a full Entity Reference of the form '<kind>:<namespace>/<name>'.`),n}async getCredentials(){return this.waitForTarget.then(n=>n.getCredentials())}async getIdToken(){return this.waitForTarget.then(n=>{if(!n.getIdToken)throw new Error("IdentityApi does not implement getIdToken");return or("getIdToken"),n.getIdToken()})}async signOut(){await this.waitForTarget.then(n=>n.signOut()),window.location.href=this.signOutTargetUrl}constructor(){this.resolveTarget=()=>{},this.signOutTargetUrl="/",this.waitForTarget=new Promise(n=>{this.resolveTarget=n})}}var ms=t(72164);function $r(i,n,o){if(i!==void 0){const f=o.find(L=>L.id===i);if(f)return f}if(n){const f=o.find(L=>L.variant==="dark");if(f)return f}const l=o.find(f=>f.variant==="light");return l||o[0]}const vs=()=>{const i=(0,W.useMemo)(()=>window.matchMedia("(prefers-color-scheme: dark)"),[]),[n,o]=(0,W.useState)(i.matches);return(0,W.useEffect)(()=>{const l=f=>{o(f.matches)};return i.addListener(l),()=>{i.removeListener(l)}},[i]),n};function ys({children:i}){const n=(0,b.h_)(b.hg),o=(0,ms.Z)(n.activeThemeId$(),n.getActiveThemeId()),l=Boolean(window.matchMedia)?vs():!1,f=$r(o,l,n.getInstalledThemes());if(!f)throw new Error("App has no themes");return(0,r.jsx)(f.Provider,{children:i})}const Gr=async(i="__APP_INJECTED_RUNTIME_CONFIG__")=>{const n=[{context:"app-config.yaml",data:{app:{title:"Techdocs Preview App",baseUrl:"http://localhost:3000"},backend:{baseUrl:"http://localhost:3000"},techdocs:{builder:"external"}}}];if(!n)throw new Error("No static configuration provided");if(!Array.isArray(n))throw new Error("Static configuration has invalid format");const o=n.slice();if(i!=="__app_injected_runtime_config__".toLocaleUpperCase("en-US"))try{const f=JSON.parse(i);Array.isArray(f)?o.push(...f):o.push({data:f,context:"env"})}catch(f){throw new Error(`Failed to load runtime configuration, ${f}`)}const l=window.__APP_CONFIG__;return l&&o.push({context:"window",data:l}),o};class Kr{add(n,o){return this.apis.push([n.id,o]),o}build(){return new ir(new Map(this.apis))}constructor(){this.apis=[]}}class ir{static builder(){return new Kr}static from(n){return new ir(new Map(n.map(([o,l])=>[o.id,l])))}static with(n,o){return new ir(new Map([[n.id,o]]))}with(n,o){return new ir(new Map([...this.apis,[n.id,o]]))}get(n){return this.apis.get(n.id)}constructor(n){this.apis=n}}function xs(i){const n=new Map;return i&&i({bind:(l,f)=>{for(const[L,Z]of Object.entries(f)){const H=l[L];if(!H)throw new Error(`Key ${L} is not an existing external route`);if(!Z&&!H.optional)throw new Error(`External route ${L} is required but was undefined`);Z&&n.set(H,Z)}}}),n}function Yr(i,n,o){var l;const f=Boolean(i),L=(0,E.default)(i||(()=>Promise.resolve([])));let Z;if(f&&L.loading){const{Progress:He}=n;Z=(0,r.jsx)(He,{})}else if(L.error){const{BootErrorPage:He}=n;Z=(0,r.jsx)(He,{step:"load-config",error:L.error})}const{ThemeProvider:H=ys}=n;if(Z)return{node:(0,r.jsx)(Ee,{apis:ir.with(b.hg,o),children:(0,r.jsx)(H,{children:Z})})};let re;if(!((l=L.value)===null||l===void 0)&&l.length){const He=We.fromConfigs(L.value),De=Et=>new URL(Et).origin,ut=Et=>new URL(Et.replace(De(Et),""),document.location.origin).href.replace(/\/$/,""),ot=He.getOptionalString("app.baseUrl"),Ct=He.getOptionalString("backend.baseUrl");let St=L.value;const $t={data:{},context:"relative-resolver"};if(ot&&Ct){const Et=De(ot),Tn=De(Ct);if(Et===Tn){const Kn=ut(Ct);Ct!==Kn&&($t.data.backend={baseUrl:Kn})}}if(ot){const Et=ut(ot);ot!==Et&&($t.data.app={baseUrl:Et})}Object.keys($t.data).length&&(St=St.concat([$t])),re=We.fromConfigs(St)}else re=We.fromConfigs([]);return{api:re}}class bs{getPlugins(){return this.app.getPlugins()}getSystemIcon(n){return this.app.getSystemIcon(n)}getSystemIcons(){return this.app.getSystemIcons()}getComponents(){return this.app.getComponents()}constructor(n){this.app=n}}var Zr=new WeakMap;class Ss{getPlugins(){return Array.from(this.plugins)}getSystemIcon(n){return this.icons[n]}getSystemIcons(){return this.icons}getComponents(){return this.components}createRoot(n){const o=this.getProvider();return()=>(0,r.jsx)(o,{children:n})}getProvider(){if((0,w.Z)(this,Zr))throw new Error("app.getProvider() or app.createRoot() has already been called, and can only be called once");(0,x.Z)(this,Zr,!0);const n=new bs(this);let o=!1;return({children:f})=>{const L=(0,W.useRef)(!0),Z=(0,W.useMemo)(()=>ue.createWithStorage(this.themes),[]),{routing:H,featureFlags:re,routeBindings:He}=(0,W.useMemo)(()=>{const Ct=q({root:f,discoverers:[ye,Ne],collectors:{routing:rn()?ps:hs,collectedPlugins:Je,featureFlags:Rr}});return Ct.collectedPlugins.forEach(St=>this.plugins.add(St)),this.verifyPlugins(this.plugins),this.getApiHolder(),{...Ct,routeBindings:xs(this.bindRoutes)}},[f]);o||(o=!0,Or(H.paths,H.parents),fs(He,this.plugins));const De=Yr(this.configLoader,this.components,Z),ut="api"in De;if(ut){const{api:Ct}=De;this.configApi=Ct}if("node"in De)return De.node;if(ut&&L.current){L.current=!1;const Ct=this.getApiHolder().get(b.W0);if(Ct){for(const Et of this.featureFlags)Ct.registerFlag({...Et,pluginId:""});for(const Et of this.plugins.values())if("getFeatureFlags"in Et)for(const Tn of Et.getFeatureFlags())Ct.registerFlag({name:Tn.name,pluginId:Et.getId()});else for(const Tn of Et.output())Tn.type==="feature-flag"&&Ct.registerFlag({name:Tn.name,pluginId:Et.getId()});const St=Ct.getRegisteredFlags(),$t=new Set(St.map(Et=>Et.name));for(const Et of re)$t.has(Et)||Ct.registerFlag({name:Et,pluginId:""})}}const{ThemeProvider:ot=ys}=this.components;return(0,r.jsx)(Ee,{apis:this.getApiHolder(),children:(0,r.jsx)(Cr,{appContext:n,children:(0,r.jsx)(ot,{children:(0,r.jsx)(Us,{routePaths:H.paths,routeParents:H.parents,routeObjects:H.objects,routeBindings:He,basePath:Yn(De.api),children:(0,r.jsx)(Nt.Provider,{value:{routeObjects:H.objects,appIdentityProxy:this.appIdentityProxy},children:f})})})})})}}getRouter(){return dr}getApiHolder(){if(this.apiHolder){for(const n of this.plugins)for(const o of n.getApis())this.apiFactoryRegistry.get(o.api)||this.apiFactoryRegistry.register("default",o);return Ke.validateFactories(this.apiFactoryRegistry,this.apiFactoryRegistry.getAllApis()),this.apiHolder}this.apiFactoryRegistry.register("static",{api:b.hg,deps:{},factory:()=>ue.createWithStorage(this.themes)}),this.apiFactoryRegistry.register("static",{api:b.Ds,deps:{},factory:()=>{if(!this.configApi)throw new Error("Tried to access config API before config was loaded");return this.configApi}}),this.apiFactoryRegistry.register("static",{api:b.$4,deps:{},factory:()=>this.appIdentityProxy}),this.apiFactoryRegistry.register("default",{api:b.W0,deps:{},factory:()=>new Oe});for(const n of this.defaultApis)this.apiFactoryRegistry.register("default",n);for(const n of this.plugins)for(const o of n.getApis())if(!this.apiFactoryRegistry.register("default",o))throw new Error(`Plugin ${n.getId()} tried to register duplicate or forbidden API factory for ${o.api}`);for(const n of this.apis)if(!this.apiFactoryRegistry.register("app",n))throw new Error(`Duplicate or forbidden API factory for ${n.api} in app`);return Ke.validateFactories(this.apiFactoryRegistry,this.apiFactoryRegistry.getAllApis()),this.apiHolder=new Ke(this.apiFactoryRegistry),this.apiHolder}verifyPlugins(n){const o=new Set;for(const l of n){const f=l.getId();if(o.has(f))throw new Error(`Duplicate plugin found '${f}'`);o.add(f)}}constructor(n){this.appIdentityProxy=new Br,(0,u.Z)(this,Zr,{writable:!0,value:!1});var o;this.apis=(o=n.apis)!==null&&o!==void 0?o:[],this.icons=n.icons;var l;this.plugins=new Set((l=n.plugins)!==null&&l!==void 0?l:[]);var f;this.featureFlags=(f=n.featureFlags)!==null&&f!==void 0?f:[],this.components=n.components,this.themes=n.themes;var L;this.configLoader=(L=n.configLoader)!==null&&L!==void 0?L:Gr;var Z;this.defaultApis=(Z=n.defaultApis)!==null&&Z!==void 0?Z:[],this.bindRoutes=n.bindRoutes,this.apiFactoryRegistry=new vt}}function Cs(i){return new Ss(i)}let Jr=!1;const Qr=i=>{const n=(0,b.qD)(),{NotFoundErrorPage:o}=n.getComponents(),l=(0,W.useMemo)(()=>rn(),[]),L=[...(0,b.vJ)(i.children,Z=>Z.getElements().flatMap(H=>{let re=H.props.path;if(re==="")return[];var He;re=(He=re==null?void 0:re.replace(/\/\*$/,""))!==null&&He!==void 0?He:"/";let De=l?H:H.props.element;return!l&&!De&&(De=H,Jr||(console.warn("DEPRECATION WARNING: All elements within <FlatRoutes> must be of type <Route> with an element prop. Existing usages of <Navigate key=[path] to=[to] /> should be replaced with <Route path=[path] element={<Navigate to=[to] />} />."),Jr=!0)),[{path:re,element:De,children:H.props.children?[{path:re==="/"?"/":"*",element:H.props.children}]:void 0}]}).sort((H,re)=>re.path.localeCompare(H.path)).map(H=>({...H,path:H.path==="/"?"/":`${H.path}/*`}))),{path:"*",element:(0,r.jsx)(o,{})}];return(0,g.V$)(L)};var Xr=t(25488);const Dr=[(0,b.ni)({api:b.NW,deps:{configApi:b.Ds},factory:({configApi:i})=>S.compile(`${i.getString("backend.baseUrl")}/api/{{ pluginId }}`)}),(0,b.ni)({api:b.$v,deps:{},factory:()=>new wt}),(0,b.ni)({api:b.v_,deps:{},factory:()=>new ae}),(0,b.ni)({api:b.VE,deps:{alertApi:b.$v},factory:({alertApi:i})=>{const n=new K(i,new ge);return de.forward(n,{hidden:!1}),n}}),(0,b.ni)({api:b.E6,deps:{errorApi:b.VE},factory:({errorApi:i})=>Dt.create({errorApi:i})}),(0,b.ni)({api:b.gP,deps:{configApi:b.Ds,identityApi:b.$4,discoveryApi:b.NW},factory:({configApi:i,identityApi:n,discoveryApi:o})=>Me({middleware:[Bt.resolvePluginProtocol({discoveryApi:o}),Bt.injectIdentityAuth({identityApi:n,config:i})]})}),(0,b.ni)({api:b.ZM,deps:{},factory:()=>new Wn}),(0,b.ni)({api:b.Kp,deps:{discoveryApi:b.NW,oauthRequestApi:b.ZM,configApi:b.Ds},factory:({discoveryApi:i,oauthRequestApi:n,configApi:o})=>Fn.create({discoveryApi:i,oauthRequestApi:n,environment:o.getOptionalString("auth.environment")})}),(0,b.ni)({api:b.p_,deps:{discoveryApi:b.NW,oauthRequestApi:b.ZM,configApi:b.Ds},factory:({discoveryApi:i,oauthRequestApi:n,configApi:o})=>xn.create({discoveryApi:i,oauthRequestApi:n,environment:o.getOptionalString("auth.environment")})}),(0,b.ni)({api:b.F4,deps:{discoveryApi:b.NW,oauthRequestApi:b.ZM,configApi:b.Ds},factory:({discoveryApi:i,oauthRequestApi:n,configApi:o})=>Wt.create({discoveryApi:i,oauthRequestApi:n,defaultScopes:["read:user"],environment:o.getOptionalString("auth.environment")})}),(0,b.ni)({api:b.D,deps:{discoveryApi:b.NW,oauthRequestApi:b.ZM,configApi:b.Ds},factory:({discoveryApi:i,oauthRequestApi:n,configApi:o})=>hn.create({discoveryApi:i,oauthRequestApi:n,environment:o.getOptionalString("auth.environment")})}),(0,b.ni)({api:b.ux,deps:{discoveryApi:b.NW,oauthRequestApi:b.ZM,configApi:b.Ds},factory:({discoveryApi:i,oauthRequestApi:n,configApi:o})=>Qt.create({discoveryApi:i,oauthRequestApi:n,environment:o.getOptionalString("auth.environment")})}),(0,b.ni)({api:b.gW,deps:{discoveryApi:b.NW,oauthRequestApi:b.ZM,configApi:b.Ds},factory:({discoveryApi:i,oauthRequestApi:n,configApi:o})=>me.create({discoveryApi:i,oauthRequestApi:n,environment:o.getOptionalString("auth.environment")})}),(0,b.ni)({api:b.bq,deps:{discoveryApi:b.NW,oauthRequestApi:b.ZM,configApi:b.Ds},factory:({discoveryApi:i,oauthRequestApi:n,configApi:o})=>Re.create({discoveryApi:i,oauthRequestApi:n,defaultScopes:["team"],environment:o.getOptionalString("auth.environment")})}),(0,b.ni)({api:b.uB,deps:{discoveryApi:b.NW,oauthRequestApi:b.ZM,configApi:b.Ds},factory:({discoveryApi:i,oauthRequestApi:n,configApi:o})=>et.create({discoveryApi:i,oauthRequestApi:n,environment:o.getOptionalString("auth.environment")})}),(0,b.ni)({api:Xr.RV,deps:{discovery:b.NW,identity:b.$4,config:b.Ds},factory:({config:i,discovery:n,identity:o})=>Xr.iM.create({config:i,discovery:n,identity:o})})];var on=t(77277),Ut=t(93414),ws=t(39857);function js({children:i}){return(0,g.GV)()?(0,r.jsx)(r.Fragment,{children:i}):(0,r.jsx)(g.VA,{children:i})}const Es=()=>(0,r.jsx)(Ut.mf,{status:"404",statusMessage:"PAGE NOT FOUND"}),qr=({step:i,error:n})=>{let o="";return i==="load-config"?o=`The configuration failed to load, someone should have a look at this error: ${n.message}`:i==="load-chunk"&&(o=`Lazy loaded chunk failed to load, try to reload the page: ${n.message}`),(0,r.jsx)(js,{children:(0,r.jsx)(Ut.mf,{status:"501",statusMessage:o})})},As=({error:i,resetError:n,plugin:o})=>(0,r.jsx)(Ut.yu,{title:`Error in ${o==null?void 0:o.getId()}`,defaultExpanded:!0,error:i,children:(0,r.jsx)(on.Z,{variant:"outlined",onClick:n,children:"Retry"})}),Ts={Progress:Ut.Ex,Router:ws.VK,NotFoundErrorPage:Es,BootErrorPage:qr,ErrorBoundaryFallback:As};var _r=t(43642),wr=t(80079),Ms=t(90941),Is=t(32915),es=t(40562),Rs=t(21853),zs=t(60744),Ls=t(66569),Ws=t(30254),Vs=t(13384),Ps=t(15933),Hs=t(58838),m=t(86737),y=t(4989),I=t(44407),B=t(18628),Q=t(84219),J=t(98685),ie=t(39781);const le={brokenImage:wr.Z,catalog:B.Z,scaffolder:Is.Z,techdocs:es.Z,search:Rs.Z,chat:zs.Z,dashboard:Ls.Z,docs:Ws.Z,email:Vs.Z,github:Hs.Z,group:Q.Z,help:m.Z,"kind:api":Ps.Z,"kind:component":I.Z,"kind:domain":_r.Z,"kind:group":Q.Z,"kind:location":y.Z,"kind:system":Ms.Z,"kind:user":J.Z,user:J.Z,warning:ie.Z};var Se=t(73689),Te=t(48032);const we={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")`},je={darkGrey:["#171717","#383838"],marineBlue:["#006D8F","#0049A1"],veryBlue:["#0027AF","#270094"],rubyRed:["#98002B","#8D1134"],toastyOrange:["#BE2200","#A41D00"],purpleSky:["#8912CA","#3E00EA"],eveningSea:["#00FFF2","#035355"],teal:["#005B4B"],pinkSea:["#C8077A","#C2297D"],greens:["#4BB8A5","#187656"]};function Ve(i){const{colors:n,shape:o,options:l}=i,L=`linear-gradient(90deg, ${(n.length===1?[n[0],n[0]]:n).join(", ")})`,Z=`${o}, ${L}`;var H;const re=(H=l==null?void 0:l.fontColor)!==null&&H!==void 0?H:"#FFFFFF";return{colors:n,shape:o,backgroundImage:Z,fontColor:re}}const rt={home:Ve({colors:je.teal,shape:we.wave}),documentation:Ve({colors:je.pinkSea,shape:we.wave2}),tool:Ve({colors:je.purpleSky,shape:we.round}),service:Ve({colors:je.marineBlue,shape:we.wave}),website:Ve({colors:je.veryBlue,shape:we.wave}),library:Ve({colors:je.rubyRed,shape:we.wave}),other:Ve({colors:je.darkGrey,shape:we.wave}),app:Ve({colors:je.toastyOrange,shape:we.wave}),apis:Ve({colors:je.teal,shape:we.wave2}),card:Ve({colors:je.greens,shape:we.wave})},dt=16,Ze='"Helvetica Neue", Helvetica, Roboto, Arial, sans-serif';function Rt(i){const{palette:n,htmlFontSize:o=dt,fontFamily:l=Ze,defaultPageTheme:f,pageTheme:L=rt}=i;if(!L[f])throw new Error(`${f} is not defined in pageTheme.`);var Z;return{palette:n,props:{MuiGrid:{spacing:2},MuiSwitch:{color:"primary"}},typography:{htmlFontSize:o,fontFamily:l,h6:{fontWeight:700,fontSize:20,marginBottom:2},h5:{fontWeight:700,fontSize:24,marginBottom:4},h4:{fontWeight:700,fontSize:28,marginBottom:6},h3:{fontSize:32,fontWeight:700,marginBottom:6},h2:{fontSize:40,fontWeight:700,marginBottom:8},h1:{fontSize:54,fontWeight:700,marginBottom:10}},page:L[f],getPageTheme:({themeId:H})=>(Z=L[H])!==null&&Z!==void 0?Z:L[f]}}function Gt(i){return{MuiCssBaseline:{"@global":{html:{height:"100%",fontFamily:i.typography.fontFamily},body:{height:"100%",fontFamily:i.typography.fontFamily,"overscroll-behavior-y":"none"},a:{color:"inherit",textDecoration:"none"}}},MuiTableRow:{root:{"&:nth-of-type(odd)":{backgroundColor:i.palette.background.default}},hover:{"&:hover":{cursor:"pointer"}},head:{"&:nth-of-type(odd)":{backgroundColor:i.palette.background.paper}}},MuiTableCell:{root:{wordBreak:"break-word",overflow:"hidden",verticalAlign:"middle",lineHeight:"1",margin:0,padding:i.spacing(3,2,3,2.5),borderBottom:0},sizeSmall:{padding:i.spacing(1.5,2,1.5,2.5)},head:{wordBreak:"break-word",overflow:"hidden",color:"rgb(179, 179, 179)",fontWeight:"normal",lineHeight:"1"}},MuiTabs:{root:{minHeight:24}},MuiTab:{root:{color:i.palette.link,minHeight:24,textTransform:"initial",letterSpacing:"0.07em","&:hover":{color:(0,Te.darken)(i.palette.link,.3),background:(0,Te.lighten)(i.palette.link,.95)},[i.breakpoints.up("md")]:{minWidth:120,fontSize:i.typography.pxToRem(14),fontWeight:500}},textColorPrimary:{color:i.palette.link}},MuiTableSortLabel:{root:{color:"inherit","&:hover":{color:"inherit"},"&: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:i.spacing(1),marginBottom:i.spacing(1),color:i.palette.grey[900]},outlined:{color:i.palette.text.primary},label:{lineHeight:`${i.spacing(2.5)}px`,fontWeight:i.typography.fontWeightMedium,fontSize:`${i.spacing(1.75)}px`},labelSmall:{fontSize:`${i.spacing(1.5)}px`},deleteIcon:{color:i.palette.grey[500],width:`${i.spacing(3)}px`,height:`${i.spacing(3)}px`,margin:`0 ${i.spacing(.75)}px 0 -${i.spacing(.75)}px`},deleteIconSmall:{width:`${i.spacing(2)}px`,height:`${i.spacing(2)}px`,margin:`0 ${i.spacing(.5)}px 0 -${i.spacing(.5)}px`}},MuiCard:{root:{display:"flex",flexDirection:"column"}},MuiCardHeader:{root:{paddingBottom:0}},MuiCardContent:{root:{flexGrow:1,"&:last-child":{paddingBottom:void 0}}},MuiCardActions:{root:{justifyContent:"flex-end"}}}}function Ln(i){const n=Rt(i),o=(0,Se.Z)(n),l=Gt(o);return{...o,overrides:l}}var jn=t(34505);const ar=Ln({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:jn.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:rt}),En=Ln({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:jn.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:rt});var Zn=t(98192),Vn=t(15222),jr=t(41547),fr=t(87561);const ts=[{id:"light",title:"Light Theme",variant:"light",icon:(0,r.jsx)(Vn.Z,{}),Provider:({children:i})=>(0,r.jsx)(jr.Z,{theme:ar,children:(0,r.jsx)(fr.ZP,{children:i})})},{id:"dark",title:"Dark Theme",variant:"dark",icon:(0,r.jsx)(Zn.Z,{}),Provider:({children:i})=>(0,r.jsx)(jr.Z,{theme:En,children:(0,r.jsx)(fr.ZP,{children:i})})}];function sn(i){var n,o,l,f;return Cs({...i,apis:(n=i==null?void 0:i.apis)!==null&&n!==void 0?n:[],bindRoutes:i==null?void 0:i.bindRoutes,components:{...Ts,...i==null?void 0:i.components},configLoader:i==null?void 0:i.configLoader,defaultApis:Dr,icons:{...le,...i==null?void 0:i.icons},plugins:(o=i==null?void 0:i.plugins)!==null&&o!==void 0?o:[],featureFlags:(l=i==null?void 0:i.featureFlags)!==null&&l!==void 0?l:[],themes:(f=i==null?void 0:i.themes)!==null&&f!==void 0?f:ts})}var Pn=t(25271),gr=t(76635);async function di({storageApi:i}){const n=i.forBucket("settings"),o=i.forBucket("starredEntities"),l=n.snapshot("starredEntities").value;if(!(0,gr.isArray)(l))return;var f;const L=new Set((f=o.snapshot("entityRefs").value)!==null&&f!==void 0?f:[]);l.filter(gr.isString).map(Z=>Z.split(":")).filter(Z=>Z.length===4&&Z[0]==="entity").map(([Z,H,re,He])=>(0,Pn.eE)({kind:H,namespace:re,name:He})).forEach(Z=>L.add(Z)),await o.set("entityRefs",Array.from(L)),await n.remove("starredEntities")}class ui{async toggleStarred(n){this.starredEntities.has(n)?this.starredEntities.delete(n):this.starredEntities.add(n),await this.settingsStore.set("entityRefs",Array.from(this.starredEntities))}starredEntitie$(){return this.observable}notifyChanges(){for(const n of this.subscribers)n.next(new Set(this.starredEntities))}constructor(n){this.subscribers=new Set,this.observable=new(ne())(l=>(l.next(new Set(this.starredEntities)),this.subscribers.add(l),()=>{this.subscribers.delete(l)})),di(n).then(),this.settingsStore=n.storageApi.forBucket("starredEntities");var o;this.starredEntities=new Set((o=this.settingsStore.snapshot("entityRefs").value)!==null&&o!==void 0?o:[]),this.settingsStore.observe$("entityRefs").subscribe({next:l=>{var f;this.starredEntities=new Set((f=l.value)!==null&&f!==void 0?f:[]),this.notifyChanges()}})}}var aa=t(33414),Er=t(79692),hi=t(12420),An=t(56941),pi=t(19928);function fi(){const i=useApi(catalogApiRef),{error:n,loading:o,value:l}=useAsync(async()=>await i.getEntityFacets({facets:["kind"]}).then(L=>{var Z;return((Z=L.facets.kind)===null||Z===void 0?void 0:Z.map(H=>H.value).sort())||[]}),[i]);return{loading:o,error:n,allKinds:l!=null?l:[]}}function gi(i,n,o){let l=i;return n&&(l=l.filter(L=>n.some(Z=>Z.toLocaleLowerCase("en-US")===L.toLocaleLowerCase("en-US")))),o&&!i.some(L=>L.toLocaleLowerCase("en-US")===o.toLocaleLowerCase("en-US"))&&(l=l.concat([o])),l.sort().reduce((L,Z)=>(L[Z.toLocaleLowerCase("en-US")]=Z,L),{})}const wo=(0,Er.Z)(i=>(0,hi.Z)({root:{...i.typography.h4}}));function mi(i){var n;const{initialFilter:o="component",allowedKinds:l}=i,f=wo(),{allKinds:L}=useAllKinds(),{filters:Z,updateFilters:H,queryParameters:{kind:re}}=useEntityList(),He=useMemo(()=>[re].flat()[0],[re]);var De;const[ut,ot]=useState((De=He!=null?He:(n=Z.kind)===null||n===void 0?void 0:n.value)!==null&&De!==void 0?De:o);useEffect(()=>{He&&ot(He)},[He]),useEffect(()=>{var St;if(!((St=Z.kind)===null||St===void 0)&&St.value){var $t;ot(($t=Z.kind)===null||$t===void 0?void 0:$t.value)}},[Z.kind]),useEffect(()=>{H({kind:ut?new EntityKindFilter(ut):void 0})},[ut,H]);const Ct=filterKinds(L,l,ut);return _jsx(Select,{input:_jsx(InputBase,{}),value:ut.toLocaleLowerCase("en-US"),onChange:St=>ot(St.target.value),classes:f,children:Object.keys(Ct).map(St=>_jsx(MenuItem,{value:St,children:`${pluralize(Ct[St])}`},St))})}var vi=t(65826);const yi=(0,Er.Z)({flexContainer:{flexWrap:"wrap"},itemText:{width:"100%",wordBreak:"break-all",marginBottom:"1rem"}});function la(i){const n=i.result,o=i.highlight,l=yi(),f=useAnalytics(),L=()=>{f.captureEvent("discover",n.title,{attributes:{to:n.location},value:i.rank})};return _jsxs(_Fragment,{children:[_jsxs(ListItem,{alignItems:"flex-start",children:[i.icon&&_jsx(ListItemIcon,{children:i.icon}),_jsxs("div",{className:l.flexContainer,children:[_jsx(ListItemText,{className:l.itemText,primaryTypographyProps:{variant:"h6"},primary:_jsx(Link,{noTrack:!0,to:n.location,onClick:L,children:o!=null&&o.fields.title?_jsx(HighlightedSearchResultText,{text:o.fields.title,preTag:o.preTag,postTag:o.postTag}):n.title}),secondary:o!=null&&o.fields.text?_jsx(HighlightedSearchResultText,{text:o.fields.text,preTag:o.preTag,postTag:o.postTag}):n.text}),_jsxs(Box,{children:[n.kind&&_jsx(Chip,{label:`Kind: ${n.kind}`,size:"small"}),n.lifecycle&&_jsx(Chip,{label:`Lifecycle: ${n.lifecycle}`,size:"small"})]})]})]}),_jsx(Divider,{component:"li"})]})}var jo=t(86359),Gs=t(95544),Ks=t(99688),ns=t(12231),Nr=t(86136),Fr=t(49378),Eo=t(85256),Ys=t(80030),rs=t(61837),Ao=t(79784),To=t(50758),Io=t(31654),xi=t(43054),Ro=t(65759),mr=t(51666);const ss="catalog-entity",Lo=(0,mr.J$)({name:"catalog.entity.read",attributes:{action:"read"},resourceType:ss}),Js=(0,mr.J$)({name:"catalog.entity.create",attributes:{action:"create"}}),Qs=(0,mr.J$)({name:"catalog.entity.delete",attributes:{action:"delete"},resourceType:ss}),Xs=(0,mr.J$)({name:"catalog.entity.refresh",attributes:{action:"update"},resourceType:ss}),_s=(0,mr.J$)({name:"catalog.location.read",attributes:{action:"read"}}),Po=(0,mr.J$)({name:"catalog.location.create",attributes:{action:"create"}}),bi=(0,mr.J$)({name:"catalog.location.delete",attributes:{action:"delete"}}),Si=[Lo,Js,Qs,Xs,_s,Po,bi];var eo=t(49166);function ko(i){const{unregisterEntityOptions:n,isUnregisterAllowed:o,onUnregisterEntity:l,onClose:f}=i,L=typeof(n==null?void 0:n.disableUnregister)=="boolean";var Z;const H=(Z=!o||(L?!!(n!=null&&n.disableUnregister):(n==null?void 0:n.disableUnregister)==="disable"))!==null&&Z!==void 0?Z:!1;let re=(0,r.jsx)(r.Fragment,{});return(n==null?void 0:n.disableUnregister)!=="hidden"&&(re=(0,r.jsxs)(ns.Z,{onClick:()=>{f(),l()},disabled:H,children:[(0,r.jsx)(Nr.Z,{children:(0,r.jsx)(eo.Z,{fontSize:"small"})}),(0,r.jsx)(Fr.Z,{primary:"Unregister entity"})]})),(0,r.jsx)(r.Fragment,{children:re})}const _n=(0,Er.Z)(i=>({button:{color:i.page.fontColor}}),{name:"PluginCatalogEntityContextMenu"});function Ci(i){const{UNSTABLE_extraContextMenuItems:n,UNSTABLE_contextMenuOptions:o,onUnregisterEntity:l,onInspectEntity:f}=i,[L,Z]=(0,W.useState)(),H=_n(),He=(0,An.N$)(Qs).allowed,De=$t=>{Z($t.currentTarget)},ut=()=>{Z(void 0)},ot=(0,b.h_)(b.$v),Ct=(0,W.useCallback)(()=>{window.navigator.clipboard.writeText(window.location.toString()).then(()=>ot.post({message:"Copied!",severity:"info"}))},[ot]),St=n&&[...n.map($t=>(0,r.jsxs)(ns.Z,{onClick:()=>{ut(),$t.onClick()},children:[(0,r.jsx)(Nr.Z,{children:(0,r.jsx)($t.Icon,{fontSize:"small"})}),(0,r.jsx)(Fr.Z,{primary:$t.title})]},$t.title)),(0,r.jsx)(Eo.Z,{},"the divider is here!")];return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(Ys.ZP,{title:"More",arrow:!0,children:(0,r.jsx)(rs.Z,{"aria-label":"more","aria-controls":"long-menu","aria-haspopup":"true","aria-expanded":!!L,role:"button",onClick:De,"data-testid":"menu-button",className:H.button,id:"long-menu",children:(0,r.jsx)(xi.Z,{})})}),(0,r.jsx)(Ao.ZP,{open:Boolean(L),onClose:ut,anchorEl:L,anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"},"aria-labelledby":"long-menu",children:(0,r.jsxs)(To.Z,{children:[St,(0,r.jsx)(ko,{unregisterEntityOptions:o,isUnregisterAllowed:He,onUnregisterEntity:l,onClose:ut}),(0,r.jsxs)(ns.Z,{onClick:()=>{ut(),f()},children:[(0,r.jsx)(Nr.Z,{children:(0,r.jsx)(Io.Z,{fontSize:"small"})}),(0,r.jsx)(Fr.Z,{primary:"Inspect entity"})]}),(0,r.jsxs)(ns.Z,{onClick:()=>{ut(),Ct()},children:[(0,r.jsx)(Nr.Z,{children:(0,r.jsx)(Ro.Z,{fontSize:"small"})}),(0,r.jsx)(Fr.Z,{primary:"Copy entity URL"})]})]})})]})}const Oo="plugin.catalog.entityLayoutRoute",to=()=>null;(0,b.R5)(to,Oo,!0),(0,b.R5)(to,"core.gatherMountPoints",!0);function wi(i){const{entity:n,title:o}=i;return(0,r.jsxs)(Gs.Z,{display:"inline-flex",alignItems:"center",height:"1em",maxWidth:"100%",children:[(0,r.jsx)(Gs.Z,{component:"span",textOverflow:"ellipsis",whiteSpace:"nowrap",overflow:"hidden",children:o}),n&&(0,r.jsx)(An.LH,{entity:n})]})}function ji(i,n,o,l){var f;const L=(f=i!=null?i:l==null?void 0:l.kind)!==null&&f!==void 0?f:"";var Z;const H=(Z=n!=null?n:l==null?void 0:l.metadata.namespace)!==null&&Z!==void 0?Z:"";var re,He,De;return{headerTitle:`${(De=(He=(re=l==null?void 0:l.metadata.title)!==null&&re!==void 0?re:o)!==null&&He!==void 0?He:l==null?void 0:l.metadata.name)!==null&&De!==void 0?De:""}${H&&H!==Pn.zG?` in ${H}`:""}`,headerType:(()=>{let ot=L.toLocaleLowerCase("en-US");return l&&l.spec&&"type"in l.spec&&(ot+=" \u2014 ",ot+=l.spec.type.toLocaleLowerCase("en-US")),ot})()}}function Ei(i){var n;const{entity:o}=i,l=(0,An.hF)(o,Pn.S4);return(0,r.jsxs)(r.Fragment,{children:[l.length>0&&(0,r.jsx)(Ut.i9,{label:"Owner",value:(0,r.jsx)(An.rI,{entityRefs:l,defaultKind:"Group",color:"inherit"})}),((n=o.spec)===null||n===void 0?void 0:n.lifecycle)&&(0,r.jsx)(Ut.i9,{label:"Lifecycle",value:o.spec.lifecycle})]})}const Ai=i=>{var n,o;const{UNSTABLE_extraContextMenuItems:l,UNSTABLE_contextMenuOptions:f,children:L,NotFoundComponent:Z}=i,{kind:H,namespace:re,name:He}=(0,b.Oi)(An.wi),{entity:De,loading:ut,error:ot}=(0,An.ce)(),Ct=(0,g.TH)(),St=(0,b.vJ)(L,Fi=>Fi.selectByComponentData({key:Oo,withStrictError:"Child of EntityLayout must be an EntityLayout.Route"}).getElements().flatMap(({props:Ar})=>{if(De){if(Ar.if&&!Ar.if(De))return[]}else return[];return[{path:Ar.path,title:Ar.title,children:Ar.children,tabProps:Ar.tabProps}]}),[De]),{headerTitle:$t,headerType:Et}=ji(H,re,He,De),[Tn,Kn]=(0,W.useState)(!1),[nr,cs]=(0,W.useState)(!1),vo=(0,g.s0)(),Ni=async()=>{Kn(!1),cs(!1),vo("/")};(0,W.useEffect)(()=>{Kn(!1),cs(!1)},[Ct.pathname]);var yo;return(0,r.jsxs)(Ut.T3,{themeId:(yo=De==null||(n=De.spec)===null||n===void 0||(o=n.type)===null||o===void 0?void 0:o.toString())!==null&&yo!==void 0?yo:"home",children:[(0,r.jsx)(Ut.h4,{title:(0,r.jsx)(wi,{title:$t,entity:De}),pageTitleOverride:$t,type:Et,children:De&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(Ei,{entity:De}),(0,r.jsx)(Ci,{UNSTABLE_extraContextMenuItems:l,UNSTABLE_contextMenuOptions:f,onUnregisterEntity:()=>Kn(!0),onInspectEntity:()=>cs(!0)})]})}),ut&&(0,r.jsx)(Ut.Ex,{}),De&&(0,r.jsx)(Ut.tn,{routes:St}),ot&&(0,r.jsx)(Ut.VY,{children:(0,r.jsx)(Ks.Z,{severity:"error",children:ot.toString()})}),!ut&&!ot&&!De&&(0,r.jsx)(Ut.VY,{children:Z||(0,r.jsxs)(Ut.GB,{title:"Entity not found",children:["There is no ",H," with the requested"," ",(0,r.jsx)(Ut.rU,{to:"https://backstage.io/docs/features/software-catalog/references",children:"kind, namespace, and name"}),"."]})}),(0,r.jsx)(An.pp,{open:Tn,entity:De,onConfirm:Ni,onClose:()=>Kn(!1)}),(0,r.jsx)(An.U_,{open:nr,entity:De,onClose:()=>cs(!1)})]})};Ai.Route=to;var ca=t(23054);function ks(i){const{open:n,onClose:o,onConfirm:l,entity:f}=i,[L,Z]=useState(!1),H=useApi(catalogApiRef),re=useApi(alertApiRef),He=async()=>{Z(!0);try{const De=f.metadata.uid;await H.removeEntityByUid(De),l()}catch(De){assertError(De),re.post({message:De.message})}finally{Z(!1)}};return _jsxs(Dialog,{open:n,onClose:o,children:[_jsx(DialogTitle,{id:"responsive-dialog-title",children:"Are you sure you want to delete this entity?"}),_jsxs(DialogActions,{children:[_jsx(Button,{variant:"contained",color:"secondary",disabled:L,onClick:He,children:"Delete"}),_jsx(Button,{onClick:o,color:"primary",children:"Cancel"})]})]})}var Os=t(19625);function da(i){var n,o;return(i==null||(n=i.metadata)===null||n===void 0||(o=n.annotations)===null||o===void 0?void 0:o["backstage.io/orphan"])==="true"}function Ti(){const i=useNavigate(),n=useRouteRef(rootRouteRef),[o,l]=useState(!1),{entity:f}=useEntity(),L=async()=>{l(!1),i(n())};return _jsxs(_Fragment,{children:[_jsx(Alert,{severity:"warning",onClick:()=>l(!0),children:"This entity is not referenced by any location and is therefore not receiving updates. Click here to delete."}),_jsx(DeleteEntityDialog,{open:o,entity:f,onConfirm:L,onClose:()=>l(!1)})]})}var Bo=t(29644);const Bs=i=>i.error&&i.level==="error"&&i.type===ENTITY_STATUS_CATALOG_PROCESSING_TYPE;async function no(i,n){return{items:(await n.getEntityAncestors({entityRef:i})).items.map(f=>{var L,Z;return{errors:((Z=(L=f.entity.status)===null||L===void 0?void 0:L.items)!==null&&Z!==void 0?Z:[]).filter(Bs).map(He=>He.error).filter(He=>Boolean(He)),entity:f.entity}}).filter(f=>f.errors.length>0)}}async function Ii(i,n){const o=n.apis.get(catalogApiRef);if(!o)throw new Error(`No implementation available for ${catalogApiRef}`);return(await no(stringifyEntityRef(i),o)).items.length>0}function Ri(){const{entity:i}=useEntity(),n=stringifyEntityRef(i),o=useApi(catalogApiRef),{loading:l,error:f,value:L}=useAsync(async()=>no(n,o),[n,o]);return f?_jsx(Box,{mb:1,children:_jsx(ResponseErrorPanel,{error:f})}):l||!L?null:_jsx(_Fragment,{children:L.items.map((Z,H)=>_jsxs(Box,{mb:1,children:[stringifyEntityRef(i)!==stringifyEntityRef(Z.entity)&&_jsxs(Box,{p:1,children:["The error below originates from"," ",_jsx(EntityRefLink,{entityRef:Z.entity})]}),Z.errors.map((re,He)=>_jsx(ResponseErrorPanel,{error:re},He))]},H))})}const os="core.backstage.entitySwitch",is=i=>null;(0,b.R5)(is,os,!0);const as=i=>{var n;const{entity:o,loading:l}=(0,An.ce)(),f=(0,b.I_)(),L=(0,b.vJ)(i.children,re=>re.selectByComponentData({key:os,withStrictError:"Child of EntitySwitch is not an EntitySwitch.Case"}).getElements().flatMap(He=>{if(l)return[];const{if:De,children:ut}=He.props;if(!o)return[{if:De===void 0,children:ut}];var ot;return[{if:(ot=De==null?void 0:De(o,{apis:f}))!==null&&ot!==void 0?ot:!0,children:ut}]}),[f,o,l]);if(L.some(re=>typeof re.if=="object"&&"then"in re.if))return(0,r.jsx)(ro,{results:L});var H;return(H=(n=L.find(re=>re.if))===null||n===void 0?void 0:n.children)!==null&&H!==void 0?H:null};function ro({results:i}){const{loading:n,value:o}=(0,E.default)(async()=>{const l=i.map(async({if:L,children:Z})=>{try{if(await L)return Z}catch{}return null});var f;return(f=(await Promise.all(l)).find(Boolean))!==null&&f!==void 0?f:null},[i]);return n||!o?null:o}as.Case=is;const $o=null,lr=An._i.Filters,Li=An._i.Content;var Zo=t(85877);const Hn=(0,b.rx)({id:"catalog",apis:[(0,b.ni)({api:An.Ah,deps:{discoveryApi:b.NW,fetchApi:b.gP},factory:({discoveryApi:i,fetchApi:n})=>new Bo.MS({discoveryApi:i,fetchApi:n})}),(0,b.ni)({api:An.p3,deps:{storageApi:b.E6},factory:({storageApi:i})=>new ui({storageApi:i})})],routes:{catalogIndex:Os._Z,catalogEntity:An.wi},externalRoutes:{createComponent:Os.yw,viewTechDoc:Os.jU},__experimentalConfigure(i){return{...{createButtonTitle:"Create"},...i}}}),ua=Hn.provide((0,b.P4)({name:"CatalogIndexPage",component:()=>t.e(5837).then(t.bind(t,95837)).then(i=>i.CatalogPage),mountPoint:Os._Z})),tr=Hn.provide((0,b.P4)({name:"CatalogEntityPage",component:()=>t.e(8951).then(t.bind(t,78951)).then(i=>i.CatalogEntityPage),mountPoint:An.wi})),Do=Hn.provide((0,b.CO)({name:"EntityAboutCard",component:{lazy:()=>Promise.resolve().then(t.bind(t,33414)).then(i=>i.AboutCard)}})),Pi=Hn.provide((0,b.CO)({name:"EntityLinksCard",component:{lazy:()=>t.e(7750).then(t.bind(t,17750)).then(i=>i.EntityLinksCard)}})),ki=Hn.provide((0,b.CO)({name:"EntityLabelsCard",component:{lazy:()=>Promise.resolve().then(t.bind(t,85877)).then(i=>i.EntityLabelsCard)}})),Oi=Hn.provide((0,b.CO)({name:"EntityHasSystemsCard",component:{lazy:()=>t.e(5458).then(t.bind(t,5458)).then(i=>i.HasSystemsCard)}})),Bi=Hn.provide((0,b.CO)({name:"EntityHasComponentsCard",component:{lazy:()=>t.e(1105).then(t.bind(t,1105)).then(i=>i.HasComponentsCard)}})),$s=Hn.provide((0,b.CO)({name:"EntityHasSubcomponentsCard",component:{lazy:()=>t.e(2440).then(t.bind(t,82440)).then(i=>i.HasSubcomponentsCard)}})),No=Hn.provide((0,b.CO)({name:"EntityHasResourcesCard",component:{lazy:()=>t.e(9770).then(t.bind(t,79770)).then(i=>i.HasResourcesCard)}})),Fo=Hn.provide((0,b.CO)({name:"EntityDependsOnComponentsCard",component:{lazy:()=>t.e(9545).then(t.bind(t,19545)).then(i=>i.DependsOnComponentsCard)}})),Uo=Hn.provide((0,b.CO)({name:"EntityDependencyOfComponentsCard",component:{lazy:()=>t.e(184).then(t.bind(t,40184)).then(i=>i.DependencyOfComponentsCard)}})),Mo=Hn.provide((0,b.CO)({name:"EntityDependsOnResourcesCard",component:{lazy:()=>t.e(1032).then(t.bind(t,81032)).then(i=>i.DependsOnResourcesCard)}})),so=Hn.provide((0,b.CO)({name:"RelatedEntitiesCard",component:{lazy:()=>t.e(732).then(t.bind(t,732)).then(i=>i.RelatedEntitiesCard)}}));var oo=t(32838);class io{async getApiOrigin(){return await this.discoveryApi.getBaseUrl("techdocs")}async getStorageUrl(){return`${await this.discoveryApi.getBaseUrl("techdocs")}/static/docs`}async getBuilder(){return this.configApi.getString("techdocs.builder")}async getEntityDocs(n,o){const f=`${await this.getApiOrigin()}/${o}`,L=await fetch(`${f.endsWith("/")?f:`${f}/`}index.html`);if(L.status===404)throw new Error("Page not found");return L.text()}async syncEntityDocs(n){return"cached"}async getBaseUrl(n,o,l){const f=await this.getApiOrigin();return new URL(n,`${f}/${l}`).toString()}constructor({configApi:n,discoveryApi:o,identityApi:l}){this.configApi=n,this.discoveryApi=o,this.identityApi=l}}class ao{async getApiOrigin(){return await this.discoveryApi.getBaseUrl("techdocs")}async getEntityMetadata(n){return{apiVersion:"backstage.io/v1alpha1",kind:"Component",metadata:{name:"local"},spec:{owner:"test",lifecycle:"experimental"}}}async getTechDocsMetadata(n){return{site_name:"Live preview environment",site_description:""}}constructor({configApi:n,discoveryApi:o,identityApi:l}){this.configApi=n,this.discoveryApi=o,this.identityApi=l}}const lo=[(0,b.ni)({api:Le.Dl,deps:{configApi:b.Ds,discoveryApi:b.NW,identityApi:b.$4},factory:({configApi:i,discoveryApi:n,identityApi:o})=>new io({configApi:i,discoveryApi:n,identityApi:o})}),(0,b.ni)({api:Le.gT,deps:{configApi:b.Ds,discoveryApi:b.NW,identityApi:b.$4},factory:({configApi:i,discoveryApi:n,identityApi:o})=>new ao({configApi:i,discoveryApi:n,identityApi:o})}),(0,b.ni)({api:oo.q3,deps:{configApi:b.Ds},factory:({configApi:i})=>oo.ae.fromConfig(i)})],zo={backend:{baseUrl:"http://localhost:3000"},techdocs:{builder:"external"}},Ur={backend:{baseUrl:"http://localhost:7007"},techdocs:{builder:"external"}};async function Wo(){const i=await fetch("/.detect");return i.ok?(await i.text()).trim()==="techdocs-cli-server":!1}async function Vo(){const i=await Gr(),n=await Wo();return[...i,{context:"detected",data:n?zo:Ur}]}var co=t(58845);const uo=(0,Er.Z)({svg:{width:"auto",height:30},path:{fill:"#7df3e1"}});var Ho=()=>{const i=uo();return(0,r.jsx)("svg",{className:i.svg,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 2079.95 456.05",children:(0,r.jsx)("path",{className:i.path,d:"M302.9,180a80.62,80.62,0,0,0,13.44-10.37c.8-.77,1.55-1.54,2.31-2.31a81.89,81.89,0,0,0,7.92-9.37,62.37,62.37,0,0,0,6.27-10.77,48.6,48.6,0,0,0,4.36-16.4c1.49-19.39-10-38.67-35.62-54.22L198.42,14,78.16,129.22l-78.29,75,108.6,65.9a111.6,111.6,0,0,0,57.76,16.42c24.92,0,48.8-8.8,66.42-25.69,19.16-18.36,25.52-42.12,13.7-61.87a49.69,49.69,0,0,0-6.8-8.87,89.78,89.78,0,0,0,19.28,2.15H259a85.09,85.09,0,0,0,31-5.79A80.88,80.88,0,0,0,302.9,180Zm-100.59,59.8c-19.32,18.51-50.4,21.24-75.7,5.9l-75.13-45.6,67.44-64.65,76.42,46.39C222.88,198.57,221.36,221.6,202.31,239.84Zm8.94-82.21L140.6,114.74,205,53l69.37,42.11c25.94,15.73,29.31,37.05,10.55,55A60.71,60.71,0,0,1,211.25,157.63Zm29.86,190c-19.57,18.75-46.17,29.08-74.88,29.08a123.84,123.84,0,0,1-64.11-18.19L-.13,296.51v24.67l108.6,65.91a111.6,111.6,0,0,0,57.76,16.42c24.92,0,48.8-8.81,66.42-25.69,12.88-12.34,20-27.13,19.68-41.49v-1.79A87.85,87.85,0,0,1,241.11,347.67Zm0-39c-19.57,18.76-46.17,29.09-74.88,29.09a123.84,123.84,0,0,1-64.11-18.19L-.13,257.52V282.2l108.6,65.91a111.59,111.59,0,0,0,57.76,16.41c24.92,0,48.8-8.8,66.42-25.68,12.88-12.35,20-27.13,19.68-41.5v-1.79A86.86,86.86,0,0,1,241.11,308.68Zm0-39c-19.57,18.76-46.17,29.09-74.88,29.09a123.84,123.84,0,0,1-64.11-18.19L-.13,218.54v24.68l108.6,65.91a111.59,111.59,0,0,0,57.76,16.41c24.92,0,48.8-8.8,66.42-25.69,12.88-12.34,20-27.12,19.68-41.49v-1.82A87.14,87.14,0,0,1,241.11,269.7Zm83.69,25.74a94.16,94.16,0,0,1-60.19,25.86h0V348a81.6,81.6,0,0,0,51.73-22.37c14-13.38,21.15-28.11,21-42.64v-2.2A95.14,95.14,0,0,1,324.8,295.44Zm-83.69,91.21c-19.57,18.75-46.17,29.09-74.88,29.09a123.76,123.76,0,0,1-64.11-18.2L-.13,335.49v24.67l108.6,65.91a111.6,111.6,0,0,0,57.76,16.42c24.92,0,48.8-8.81,66.42-25.69,12.88-12.34,20-27.13,19.68-41.49v-1.79A87.35,87.35,0,0,1,241.11,386.65Zm85.75-210.21c-.68.69-1.35,1.38-2.06,2.05a99.19,99.19,0,0,1-22.23,15.69,94.53,94.53,0,0,1-26.24,8.71,97.84,97.84,0,0,1-14.16,1.57c.5,1.61.9,3.25,1.25,4.9a52.7,52.7,0,0,1,1.13,12V231h.05A84.48,84.48,0,0,0,290,225.47a80.83,80.83,0,0,0,26.38-16.82c.81-.77,1.51-1.56,2.27-2.34a82,82,0,0,0,7.92-9.38,62.85,62.85,0,0,0,6.29-10.78,48.5,48.5,0,0,0,4.32-16.44c.09-1.23.2-2.47.19-3.7v-2c-.72,1-1.48,2.06-2.26,3.09A98,98,0,0,1,326.86,176.44Zm0,77.92c-.68.7-1.3,1.41-2,2.1a94.09,94.09,0,0,1-60.19,25.85h0V309h0a81.65,81.65,0,0,0,51.73-22.37,73.51,73.51,0,0,0,16.48-22.49,48.56,48.56,0,0,0,4.32-16.44c.09-1.24.2-2.48.19-3.71v-2.2c-.74,1.08-1.47,2.16-2.27,3.22A95.81,95.81,0,0,1,326.82,254.36Zm0-39c-.68.7-1.3,1.41-2,2.1a92.22,92.22,0,0,1-10.62,8.65,93.53,93.53,0,0,1-11.63,7,95.63,95.63,0,0,1-37.94,10.18h-.05l0,26.67h0a81.63,81.63,0,0,0,51.73-22.37c.81-.77,1.51-1.56,2.27-2.34a82,82,0,0,0,7.92-9.38,63.16,63.16,0,0,0,6.29-10.77,48.55,48.55,0,0,0,4.32-16.45c.09-1.23.2-2.47.19-3.7v-2.2c-.74,1.08-1.47,2.16-2.27,3.22A98.19,98.19,0,0,1,326.82,215.38Zm241-88.84q7.94,0,17.09.17t18.12,1a139.3,139.3,0,0,1,16.74,2.57,42.78,42.78,0,0,1,13.3,5.14,64.27,64.27,0,0,1,20.54,19.89Q662,168,662,186.54q0,19.54-9.49,33.78t-27.1,21.09v.68q22.78,4.82,34.87,20.58t12.08,38.4a72.62,72.62,0,0,1-4.83,26.06,65.29,65.29,0,0,1-14.33,22.46,71.57,71.57,0,0,1-23.47,15.78q-14,6-32.28,6H478.38V126.54Zm9,105.27q28,0,40.21-9.78t12.26-29.31q0-13-4.14-20.58a29.47,29.47,0,0,0-11.4-11.66A45,45,0,0,0,597,155.17a161.2,161.2,0,0,0-20.19-1.2h-65.6v77.84Zm16.57,112.13q21.74,0,34-11.66T639.59,300q0-12-4.48-19.88a34.85,34.85,0,0,0-11.91-12.52,50.14,50.14,0,0,0-17.09-6.52,105,105,0,0,0-20-1.88H511.17v84.7Zm274.79,26.74q-7.61,4.45-21.06,4.46-11.4,0-18.12-6.34t-6.74-20.75a70.17,70.17,0,0,1-28.13,20.75,97.87,97.87,0,0,1-57.65,3.6,53.51,53.51,0,0,1-18.82-8.58A41.19,41.19,0,0,1,705,348.56q-4.65-9.42-4.66-22.8,0-15.09,5.18-24.69a44.92,44.92,0,0,1,13.64-15.6,62.63,62.63,0,0,1,19.33-9.09q10.88-3.08,22.27-5.14,12.08-2.4,23-3.6a128,128,0,0,0,19.16-3.43c5.53-1.48,9.89-3.65,13.12-6.51s4.83-7,4.83-12.52q0-9.6-3.62-15.43a24.94,24.94,0,0,0-9.32-8.92,38.38,38.38,0,0,0-12.78-4.11,96.54,96.54,0,0,0-14-1q-18.63,0-31.07,7T736.6,249.29H707.26q.69-16.46,6.9-27.77a52.21,52.21,0,0,1,16.57-18.35,70,70,0,0,1,23.65-10.11A125.51,125.51,0,0,1,782.86,190a168.63,168.63,0,0,1,24,1.72,63.26,63.26,0,0,1,21.58,7A41.23,41.23,0,0,1,844,213.59q5.87,9.57,5.87,25v91q0,10.26,1.21,15.05t8.11,4.79a35.57,35.57,0,0,0,9-1.37Zm-47.64-90.87c-3.69,2.74-8.52,4.72-14.5,6s-12.26,2.27-18.82,3.07-13.17,1.71-19.85,2.73a73.7,73.7,0,0,0-18,4.94,32.62,32.62,0,0,0-12.94,9.73q-5,6.32-5,17.23a23.31,23.31,0,0,0,2.94,12.11,24.11,24.11,0,0,0,7.59,8,32,32,0,0,0,10.88,4.44,60.94,60.94,0,0,0,13.11,1.36q14.5,0,24.86-3.92a52.49,52.49,0,0,0,16.91-9.9,39.1,39.1,0,0,0,9.67-13,32.53,32.53,0,0,0,3.11-13.14ZM1002.07,225q-11.05-9.25-29.69-9.26-15.89,0-26.58,5.83A47.29,47.29,0,0,0,928.71,237a64.66,64.66,0,0,0-9.15,22.12A119.83,119.83,0,0,0,916.8,285a98.22,98.22,0,0,0,2.93,24,64.18,64.18,0,0,0,9.15,20.74,46.2,46.2,0,0,0,16.23,14.58q10,5.49,23.82,5.48,21.75,0,34-11.31t15-31.89h30q-4.83,32.91-24.68,50.75t-54,17.83q-20.37,0-36.07-6.52A69.86,69.86,0,0,1,907,350.11a79.92,79.92,0,0,1-15.88-28.63A118.64,118.64,0,0,1,885.73,285a129.41,129.41,0,0,1,5.18-37.21,85.63,85.63,0,0,1,15.71-30.17A73.46,73.46,0,0,1,933,197.35Q948.91,190,970,190a108.54,108.54,0,0,1,28.48,3.6,69.59,69.59,0,0,1,23.48,11.15,61,61,0,0,1,16.74,19q6.55,11.49,8.29,27.26h-30.38Q1013.11,234.21,1002.07,225Zm109.77-98.41v145l81.47-77.49h39.36l-70.77,64.46,75.95,112.82h-37.29l-61.1-92.59-27.62,25.38v67.21H1082.5V126.54Zm170.54,205.22a31.07,31.07,0,0,0,10.87,10.63,49,49,0,0,0,15.19,5.66,87.06,87.06,0,0,0,17.44,1.71,109.18,109.18,0,0,0,14.5-1,53.22,53.22,0,0,0,14-3.78,26.27,26.27,0,0,0,10.53-8q4.14-5.32,4.14-13.55,0-11.31-8.63-17.14a73.69,73.69,0,0,0-21.58-9.43q-12.94-3.6-28.13-6.52a146,146,0,0,1-28.14-8.23A58.16,58.16,0,0,1,1261,267.13q-8.64-9.6-8.63-26.75,0-13.38,6-23a49.26,49.26,0,0,1,15.53-15.61,71.76,71.76,0,0,1,21.4-8.91A99.41,99.41,0,0,1,1319,190a141.31,141.31,0,0,1,28,2.58,64.85,64.85,0,0,1,22.62,8.91,46.16,46.16,0,0,1,15.7,17.15q5.87,10.8,6.91,26.91h-29.35q-.69-8.57-4.48-14.23a29.36,29.36,0,0,0-9.67-9.08,44.16,44.16,0,0,0-12.94-5,67.68,67.68,0,0,0-14.33-1.54,87.29,87.29,0,0,0-13.29,1,45.28,45.28,0,0,0-12.26,3.6,24.49,24.49,0,0,0-9,6.86q-3.46,4.29-3.46,11.14a16.32,16.32,0,0,0,5.36,12.52,42.75,42.75,0,0,0,13.63,8.23,120,120,0,0,0,18.64,5.48q10.37,2.24,20.72,4.63,11,2.4,21.57,5.83A70.74,70.74,0,0,1,1382,284.1a44.55,44.55,0,0,1,13.12,14.23q5,8.58,5,21.26,0,16.13-6.73,26.75a52.5,52.5,0,0,1-17.61,17.14,73.89,73.89,0,0,1-24.51,9.09,146.3,146.3,0,0,1-27.1,2.57,126.24,126.24,0,0,1-28.31-3.09A69.56,69.56,0,0,1,1272,361.94a51.74,51.74,0,0,1-16.57-18.52q-6.21-11.49-6.9-27.95h29.34A32.65,32.65,0,0,0,1282.38,331.76Zm226.46-137.67v25.72h-35.56V329.88a31.37,31.37,0,0,0,.87,8.23,8.42,8.42,0,0,0,3.28,4.8,14.61,14.61,0,0,0,6.73,2.23,99.19,99.19,0,0,0,11.22.51h13.46v25.72H1486.4a105.8,105.8,0,0,1-19.5-1.55,28.65,28.65,0,0,1-13.12-5.65,24.09,24.09,0,0,1-7.42-11.66q-2.43-7.54-2.42-19.89V219.81h-30.38V194.09h30.38V140.94h29.34v53.15ZM1699.4,370.68q-7.61,4.45-21.06,4.46-11.4,0-18.12-6.34t-6.74-20.75a70.17,70.17,0,0,1-28.13,20.75,97.87,97.87,0,0,1-57.65,3.6,53.51,53.51,0,0,1-18.82-8.58,41.19,41.19,0,0,1-12.6-15.26q-4.65-9.42-4.66-22.8,0-15.09,5.18-24.69a44.92,44.92,0,0,1,13.64-15.6,62.63,62.63,0,0,1,19.33-9.09q10.88-3.08,22.27-5.14,12.07-2.4,23-3.6a128,128,0,0,0,19.16-3.43c5.53-1.48,9.89-3.65,13.12-6.51s4.83-7,4.83-12.52q0-9.6-3.62-15.43a24.94,24.94,0,0,0-9.32-8.92,38.38,38.38,0,0,0-12.78-4.11,96.54,96.54,0,0,0-14-1q-18.63,0-31.07,7t-13.46,26.57h-29.34q.67-16.46,6.9-27.77A52.21,52.21,0,0,1,1562,203.17a70,70,0,0,1,23.65-10.11,125.51,125.51,0,0,1,28.48-3.09,168.63,168.63,0,0,1,24,1.72,63.26,63.26,0,0,1,21.58,7,41.23,41.23,0,0,1,15.53,14.89q5.87,9.57,5.87,25v91q0,10.26,1.21,15.05t8.11,4.79a35.57,35.57,0,0,0,9-1.37Zm-47.64-90.87c-3.69,2.74-8.52,4.72-14.5,6s-12.26,2.27-18.82,3.07-13.17,1.71-19.85,2.73a73.7,73.7,0,0,0-17.95,4.94,32.62,32.62,0,0,0-12.94,9.73q-5,6.32-5,17.23a23.31,23.31,0,0,0,2.94,12.11,24.11,24.11,0,0,0,7.59,8,32,32,0,0,0,10.88,4.44,60.94,60.94,0,0,0,13.11,1.36q14.51,0,24.86-3.92a52.49,52.49,0,0,0,16.91-9.9,39.1,39.1,0,0,0,9.67-13,32.53,32.53,0,0,0,3.11-13.14Zm208.85,141.62q-20,21.6-62.83,21.6a122.11,122.11,0,0,1-25.37-2.74,78,78,0,0,1-23.48-8.92,54.41,54.41,0,0,1-17.43-16.11q-6.91-10-7.6-24.35h29.35a21.47,21.47,0,0,0,5,13.38,36.67,36.67,0,0,0,11.4,8.91,55.52,55.52,0,0,0,14.67,5,79.51,79.51,0,0,0,15.19,1.55q14.49,0,24.51-5A46,46,0,0,0,1840.59,401a56.53,56.53,0,0,0,9.49-21.09,117.46,117.46,0,0,0,2.94-27.09V341.19h-.7q-7.59,16.46-23,24.18a71.8,71.8,0,0,1-32.63,7.71q-20,0-34.86-7.2A72.88,72.88,0,0,1,1737,346.51a82.13,82.13,0,0,1-15-28.46,116.62,116.62,0,0,1-5-34.47,133.92,133.92,0,0,1,4.14-32.4A88.17,88.17,0,0,1,1735,221a75.49,75.49,0,0,1,25.55-22.29q15.87-8.75,39-8.75a66.21,66.21,0,0,1,31.07,7.38,52.13,52.13,0,0,1,22.09,22.11h.35V194.09h27.61V356.28Q1880.63,399.83,1860.61,421.43Zm-37.46-79.72a47.94,47.94,0,0,0,16.4-15.78,71.89,71.89,0,0,0,9.15-22.11,106.77,106.77,0,0,0,2.93-24.69,96.71,96.71,0,0,0-2.76-23,64,64,0,0,0-8.8-20.4,45.76,45.76,0,0,0-15.71-14.57q-9.66-5.49-23.47-5.49-14.16,0-24.17,5.32a46.77,46.77,0,0,0-16.4,14.23,60.14,60.14,0,0,0-9.32,20.57,99.69,99.69,0,0,0-2.93,24.35,120.63,120.63,0,0,0,2.42,24,67.5,67.5,0,0,0,8.28,21.77,46.37,46.37,0,0,0,15.54,15.78q9.66,6,24.16,6T1823.15,341.71Zm228,18.34q-20,15.09-50.41,15.09-21.4,0-37.11-6.86a73.16,73.16,0,0,1-26.41-19.2,81.52,81.52,0,0,1-16-29.49,141.12,141.12,0,0,1-6-37.38,106.1,106.1,0,0,1,6.21-37A88.56,88.56,0,0,1,1938.8,216a79.09,79.09,0,0,1,26.58-19.2A81.66,81.66,0,0,1,1999,190q23.82,0,39.53,9.78a78,78,0,0,1,25.2,24.86,98.18,98.18,0,0,1,13.12,32.91,140.6,140.6,0,0,1,2.93,34h-133.6a70,70,0,0,0,2.76,22.12,49.9,49.9,0,0,0,10,18.51A49.1,49.1,0,0,0,1976.6,345q10.7,4.82,25.2,4.8,18.65,0,30.55-8.57t15.71-26.06h29Q2071.18,345,2051.17,360.05Zm-7.08-113.84a50,50,0,0,0-10.7-16,53.1,53.1,0,0,0-56.62-10.63,47.48,47.48,0,0,0-15.71,10.81,51.69,51.69,0,0,0-10.35,15.94,60.18,60.18,0,0,0-4.49,19.37h102.53A59.47,59.47,0,0,0,2044.09,246.21ZM302.9,180a80.62,80.62,0,0,0,13.44-10.37c.8-.77,1.55-1.54,2.31-2.31a81.89,81.89,0,0,0,7.92-9.37,62.37,62.37,0,0,0,6.27-10.77,48.6,48.6,0,0,0,4.36-16.4c1.49-19.39-10-38.67-35.62-54.22L198.42,14,78.16,129.22l-78.29,75,108.6,65.9a111.6,111.6,0,0,0,57.76,16.42c24.92,0,48.8-8.8,66.42-25.69,19.16-18.36,25.52-42.12,13.7-61.87a49.69,49.69,0,0,0-6.8-8.87,89.78,89.78,0,0,0,19.28,2.15H259a85.09,85.09,0,0,0,31-5.79A80.88,80.88,0,0,0,302.9,180Zm-100.59,59.8c-19.32,18.51-50.4,21.24-75.7,5.9l-75.13-45.6,67.44-64.65,76.42,46.39C222.88,198.57,221.36,221.6,202.31,239.84Zm8.94-82.21L140.6,114.74,205,53l69.37,42.11c25.94,15.73,29.31,37.05,10.55,55A60.71,60.71,0,0,1,211.25,157.63Zm29.86,190c-19.57,18.75-46.17,29.08-74.88,29.08a123.84,123.84,0,0,1-64.11-18.19L-.13,296.51v24.67l108.6,65.91a111.6,111.6,0,0,0,57.76,16.42c24.92,0,48.8-8.81,66.42-25.69,12.88-12.34,20-27.13,19.68-41.49v-1.79A87.85,87.85,0,0,1,241.11,347.67Zm0-39c-19.57,18.76-46.17,29.09-74.88,29.09a123.84,123.84,0,0,1-64.11-18.19L-.13,257.52V282.2l108.6,65.91a111.59,111.59,0,0,0,57.76,16.41c24.92,0,48.8-8.8,66.42-25.68,12.88-12.35,20-27.13,19.68-41.5v-1.79A86.86,86.86,0,0,1,241.11,308.68Zm0-39c-19.57,18.76-46.17,29.09-74.88,29.09a123.84,123.84,0,0,1-64.11-18.19L-.13,218.54v24.68l108.6,65.91a111.59,111.59,0,0,0,57.76,16.41c24.92,0,48.8-8.8,66.42-25.69,12.88-12.34,20-27.12,19.68-41.49v-1.82A87.14,87.14,0,0,1,241.11,269.7Zm83.69,25.74a94.16,94.16,0,0,1-60.19,25.86h0V348a81.6,81.6,0,0,0,51.73-22.37c14-13.38,21.15-28.11,21-42.64v-2.2A95.14,95.14,0,0,1,324.8,295.44Zm-83.69,91.21c-19.57,18.75-46.17,29.09-74.88,29.09a123.76,123.76,0,0,1-64.11-18.2L-.13,335.49v24.67l108.6,65.91a111.6,111.6,0,0,0,57.76,16.42c24.92,0,48.8-8.81,66.42-25.69,12.88-12.34,20-27.13,19.68-41.49v-1.79A87.35,87.35,0,0,1,241.11,386.65Zm85.75-210.21c-.68.69-1.35,1.38-2.06,2.05a99.19,99.19,0,0,1-22.23,15.69,94.53,94.53,0,0,1-26.24,8.71,97.84,97.84,0,0,1-14.16,1.57c.5,1.61.9,3.25,1.25,4.9a52.7,52.7,0,0,1,1.13,12V231h.05A84.48,84.48,0,0,0,290,225.47a80.83,80.83,0,0,0,26.38-16.82c.81-.77,1.51-1.56,2.27-2.34a82,82,0,0,0,7.92-9.38,62.85,62.85,0,0,0,6.29-10.78,48.5,48.5,0,0,0,4.32-16.44c.09-1.23.2-2.47.19-3.7v-2c-.72,1-1.48,2.06-2.26,3.09A98,98,0,0,1,326.86,176.44Zm0,77.92c-.68.7-1.3,1.41-2,2.1a94.09,94.09,0,0,1-60.19,25.85h0V309h0a81.65,81.65,0,0,0,51.73-22.37,73.51,73.51,0,0,0,16.48-22.49,48.56,48.56,0,0,0,4.32-16.44c.09-1.24.2-2.48.19-3.71v-2.2c-.74,1.08-1.47,2.16-2.27,3.22A95.81,95.81,0,0,1,326.82,254.36Zm0-39c-.68.7-1.3,1.41-2,2.1a92.22,92.22,0,0,1-10.62,8.65,93.53,93.53,0,0,1-11.63,7,95.63,95.63,0,0,1-37.94,10.18h-.05l0,26.67h0a81.63,81.63,0,0,0,51.73-22.37c.81-.77,1.51-1.56,2.27-2.34a82,82,0,0,0,7.92-9.38,63.16,63.16,0,0,0,6.29-10.77,48.55,48.55,0,0,0,4.32-16.45c.09-1.23.2-2.47.19-3.7v-2.2c-.74,1.08-1.47,2.16-2.27,3.22A98.19,98.19,0,0,1,326.82,215.38Z"})})};const Go=(0,Er.Z)({svg:{width:"auto",height:28},path:{fill:"#7df3e1"}});var Yo=()=>{const i=Go();return(0,r.jsx)("svg",{className:i.svg,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 337.46 428.5",children:(0,r.jsx)("path",{className:i.path,d:"M303,166.05a80.69,80.69,0,0,0,13.45-10.37c.79-.77,1.55-1.53,2.3-2.3a83.12,83.12,0,0,0,7.93-9.38A63.69,63.69,0,0,0,333,133.23a48.58,48.58,0,0,0,4.35-16.4c1.49-19.39-10-38.67-35.62-54.22L198.56,0,78.3,115.23,0,190.25l108.6,65.91a111.59,111.59,0,0,0,57.76,16.41c24.92,0,48.8-8.8,66.42-25.69,19.16-18.36,25.52-42.12,13.7-61.87a49.22,49.22,0,0,0-6.8-8.87A89.17,89.17,0,0,0,259,178.29h.15a85.08,85.08,0,0,0,31-5.79A80.88,80.88,0,0,0,303,166.05ZM202.45,225.86c-19.32,18.51-50.4,21.23-75.7,5.9L51.61,186.15l67.45-64.64,76.41,46.38C223,184.58,221.49,207.61,202.45,225.86Zm8.93-82.22-70.65-42.89L205.14,39,274.51,81.1c25.94,15.72,29.31,37,10.55,55A60.69,60.69,0,0,1,211.38,143.64Zm29.86,190c-19.57,18.75-46.17,29.09-74.88,29.09a123.73,123.73,0,0,1-64.1-18.2L0,282.52v24.67L108.6,373.1a111.6,111.6,0,0,0,57.76,16.42c24.92,0,48.8-8.81,66.42-25.69,12.88-12.34,20-27.13,19.68-41.49v-1.79A87.27,87.27,0,0,1,241.24,333.68Zm0-39c-19.57,18.75-46.17,29.08-74.88,29.08a123.81,123.81,0,0,1-64.1-18.19L0,243.53v24.68l108.6,65.91a111.6,111.6,0,0,0,57.76,16.42c24.92,0,48.8-8.81,66.42-25.69,12.88-12.34,20-27.13,19.68-41.5v-1.78A87.27,87.27,0,0,1,241.24,294.7Zm0-39c-19.57,18.76-46.17,29.09-74.88,29.09a123.81,123.81,0,0,1-64.1-18.19L0,204.55v24.68l108.6,65.91a111.59,111.59,0,0,0,57.76,16.41c24.92,0,48.8-8.8,66.42-25.68,12.88-12.35,20-27.13,19.68-41.5v-1.82A86.09,86.09,0,0,1,241.24,255.71Zm83.7,25.74a94.15,94.15,0,0,1-60.2,25.86h0V334a81.6,81.6,0,0,0,51.74-22.37c14-13.38,21.14-28.11,21-42.64v-2.19A94.92,94.92,0,0,1,324.94,281.45Zm-83.7,91.21c-19.57,18.76-46.17,29.09-74.88,29.09a123.73,123.73,0,0,1-64.1-18.2L0,321.5v24.68l108.6,65.9a111.6,111.6,0,0,0,57.76,16.42c24.92,0,48.8-8.8,66.42-25.69,12.88-12.34,20-27.13,19.68-41.49v-1.79A86.29,86.29,0,0,1,241.24,372.66ZM327,162.45c-.68.69-1.35,1.38-2.05,2.06a94.37,94.37,0,0,1-10.64,8.65,91.35,91.35,0,0,1-11.6,7,94.53,94.53,0,0,1-26.24,8.71,97.69,97.69,0,0,1-14.16,1.57c.5,1.61.9,3.25,1.25,4.9a53.27,53.27,0,0,1,1.14,12V217h.05a84.41,84.41,0,0,0,25.35-5.55,81,81,0,0,0,26.39-16.82c.8-.77,1.5-1.56,2.26-2.34a82.08,82.08,0,0,0,7.93-9.38A63.76,63.76,0,0,0,333,172.17a48.55,48.55,0,0,0,4.32-16.45c.09-1.23.2-2.47.19-3.7V150q-1.08,1.54-2.25,3.09A96.73,96.73,0,0,1,327,162.45Zm0,77.92c-.69.7-1.31,1.41-2,2.1a94.2,94.2,0,0,1-60.2,25.86h0l0,26.67h0a81.6,81.6,0,0,0,51.74-22.37A73.51,73.51,0,0,0,333,250.13a48.56,48.56,0,0,0,4.32-16.44c.09-1.24.2-2.47.19-3.71v-2.19c-.74,1.07-1.46,2.15-2.27,3.21A95.68,95.68,0,0,1,327,240.37Zm0-39c-.69.7-1.31,1.41-2,2.1a93.18,93.18,0,0,1-10.63,8.65,91.63,91.63,0,0,1-11.63,7,95.47,95.47,0,0,1-37.94,10.18h0V256h0a81.65,81.65,0,0,0,51.74-22.37c.8-.77,1.5-1.56,2.26-2.34a82.08,82.08,0,0,0,7.93-9.38A63.76,63.76,0,0,0,333,211.15a48.56,48.56,0,0,0,4.32-16.44c.09-1.24.2-2.48.19-3.71v-2.2c-.74,1.08-1.46,2.16-2.27,3.22A95.68,95.68,0,0,1,327,201.39Z"})})};const ls=(0,Er.Z)({root:{width:Ut.po.drawerWidthClosed,height:3*Ut.po.logoHeight,display:"flex",flexFlow:"row nowrap",alignItems:"center",marginBottom:-14},link:{width:Ut.po.drawerWidthClosed,marginLeft:24}}),ho=()=>{const i=ls(),{isOpen:n}=(0,Ut.mZ)();return(0,r.jsx)("div",{className:i.root,children:(0,r.jsx)(Ut.rU,{to:"/docs/default/component/local/",underline:"none",className:i.link,children:n?(0,r.jsx)(Ho,{}):(0,r.jsx)(Yo,{})})})},Jo=({children:i})=>(0,r.jsxs)(Ut.tR,{children:[(0,r.jsxs)(Ut.YE,{children:[(0,r.jsx)(ho,{}),(0,r.jsx)(Ut.v7,{}),(0,r.jsx)(Ut.R6,{icon:co.Z,to:"/docs/default/component/local",text:"Docs Preview"})]}),i]});var po=t(32388),Qo=t(4142);const fo=(0,Er.Z)(i=>({headerIcon:{color:i.palette.common.white,width:"32px",height:"32px"},content:{backgroundColor:i.palette.background.default},contentToolbar:{display:"flex",justifyContent:"flex-end",padding:0}}));var er;(function(i){i.LIGHT="light",i.DARK="dark"})(er||(er={}));const Gn=()=>{const i=(0,b.h_)(b.hg),n=fo(),[o,l]=(0,W.useState)(i.getActiveThemeId()===er.DARK?er.DARK:er.LIGHT),f={[er.LIGHT]:{icon:Qo.Z,title:"Dark theme"},[er.DARK]:{icon:po.Z,title:"Light theme"}},{title:L,icon:Z}=f[o],H=()=>{l(re=>{const He=re===er.LIGHT?er.DARK:er.LIGHT;return i.setActiveThemeId(He),He})};return(0,r.jsx)(Gs.Z,{display:"flex",alignItems:"center",mr:2,children:(0,r.jsx)(Ys.ZP,{title:L,arrow:!0,children:(0,r.jsx)(rs.Z,{size:"small",onClick:H,children:(0,r.jsx)(Z,{className:n.headerIcon})})})})},Xo=()=>(0,r.jsxs)(C.I6,{children:[(0,r.jsx)(U.S,{}),(0,r.jsx)(F.F,{withSearch:!1})]}),qo=(0,r.jsx)(Xo,{}),go=sn({apis:lo,configLoader:Vo,plugins:Object.values(h)}),mo=go.getProvider(),_o=go.getRouter(),Zi=C.s4.provide((0,Le.KY)({name:"ThemeToggleAddon",component:Gn,location:Le.oZ.Header})),Zs=(0,r.jsxs)(Qr,{children:[(0,r.jsx)(g.Fg,{to:"/docs/default/component/local/"},"/"),(0,r.jsx)(g.AW,{path:"/catalog/:namespace/:kind/:name",element:(0,r.jsx)(tr,{})}),(0,r.jsx)(g.AW,{path:"/docs",element:(0,r.jsx)(C.Jl,{}),children:(0,r.jsx)(R.u,{})}),(0,r.jsxs)(g.AW,{path:"/docs/:namespace/:kind/:name/*",element:(0,r.jsx)(C.I6,{}),children:[qo,(0,r.jsx)(Le.DR,{children:(0,r.jsx)(Zi,{})})]})]});var ei=()=>(0,r.jsx)(mo,{children:(0,r.jsx)(_o,{children:(0,r.jsx)(Jo,{children:Zs})})});k.render((0,r.jsx)(ei,{}),document.getElementById("root"))},51837:function(At,Fe,t){"use strict";t.d(Fe,{CT:function(){return b},EI:function(){return te},uW:function(){return k},Vt:function(){return c}});function h(){return typeof window!="undefined"&&window.Math===Math?window:typeof self!="undefined"&&self.Math===Math?self:Function("return this")()}const r=h(),W=_=>`__@backstage/${_}__`;function k(_,X){const U=W(_);let F=r[U];return F||(F=X(),r[U]=F,F)}var g=t(2784);function b(_){return k(_,()=>(0,g.createContext)(void 0))}function c(_){return(0,g.useContext)(b(_))}function P(_){return{set(X){globalThis[`__@backstage/${_}__`]=createContext(createVersionedValueMap(X))},reset(){delete globalThis[`__@backstage/${_}__`]}}}function te(_){Object.freeze(_);const X={atVersion(U){return _[U]}};return Object.defineProperty(X,"$map",{configurable:!0,enumerable:!0,get(){return _}}),X}},56941:function(At,Fe,t){"use strict";t.d(Fe,{h$:function(){return Tt},n3:function(){return h.n3},_i:function(){return V},tW:function(){return Be},df:function(){return ge},UO:function(){return vn},dq:function(){return Me},nl:function(){return Ps},dx:function(){return Ge},rI:function(){return Ke},u3:function(){return Nt},xE:function(){return Cn},sL:function(){return wn},LH:function(){return u},U_:function(){return ws},pp:function(){return _r},EW:function(){return zs},Ah:function(){return W},wi:function(){return Le},hF:function(){return it},CV:function(){return gt},$3:function(){return Qe},p3:function(){return k},ce:function(){return en},X2:function(){return Ot},wp:function(){return hn},ZW:function(){return Ue},N$:function(){return wt},eK:function(){return kn},CR:function(){return me}});var h=t(29644),r=t(25248);const W=(0,r.T0)({id:"plugin.catalog.service"}),k=(0,r.T0)({id:"catalog-react.starred-entities"});var g=t(82394);class b{async toggleStarred(y){this.starredEntities.delete(y)||this.starredEntities.add(y);for(const I of this.subscribers)I.next(new Set(this.starredEntities))}starredEntitie$(){return this.observable}constructor(){this.starredEntities=new Set,this.subscribers=new Set,this.observable=new ObservableImpl(y=>(y.next(new Set(this.starredEntities)),this.subscribers.add(y),()=>{this.subscribers.delete(y)}))}}var c=t(52322),P=t(2784),te=t(41156),_=t(60364),X=t(77277),U=t(4190),F=t(95544),Y=t(90436),ce=t(60905),se=t(36444);const T=m=>{const y=(0,te.Z)(J=>J.breakpoints.down("md")),I=(0,_.Z)(),[B,Q]=(0,P.useState)(!1);return y?(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(X.Z,{style:{marginTop:I.spacing(1),marginLeft:I.spacing(1)},onClick:()=>Q(!0),startIcon:(0,c.jsx)(se.Z,{}),children:"Filters"}),(0,c.jsx)(U.ZP,{open:B,onClose:()=>Q(!1),anchor:"left",disableAutoFocus:!0,keepMounted:!0,variant:"temporary",children:(0,c.jsxs)(F.Z,{m:2,children:[(0,c.jsx)(Y.Z,{variant:"h6",component:"h2",style:{marginBottom:I.spacing(1)},children:"Filters"}),m.children]})})]}):(0,c.jsx)(ce.Z,{item:!0,lg:2,children:m.children})},R=m=>(0,c.jsx)(ce.Z,{item:!0,xs:12,lg:10,children:m.children}),V=m=>(0,c.jsx)(ce.Z,{container:!0,style:{position:"relative"},children:m.children});V.Filters=T,V.Content=R;var A=t(93414),C=t(25271),z=t(51837);const Le=(0,z.uW)("catalog:entity-route-ref",()=>(0,r.NT)({id:"catalog:entity",params:["namespace","kind","name"]}));function Xe(m){var y,I;return{kind:m.kind.toLocaleLowerCase("en-US"),namespace:(I=(y=m.metadata.namespace)===null||y===void 0?void 0:y.toLocaleLowerCase("en-US"))!==null&&I!==void 0?I:DEFAULT_NAMESPACE,name:m.metadata.name}}function Qe(m,y){const I=y==null?void 0:y.defaultKind;let B,Q,J;return"metadata"in m?(B=m.kind,Q=m.metadata.namespace,J=m.metadata.name):(B=m.kind,Q=m.namespace,J=m.name),(Q===void 0||Q==="")&&(Q=C.zG),(y==null?void 0:y.defaultNamespace)!==void 0?(y==null?void 0:y.defaultNamespace)===Q&&(Q=void 0):Q===C.zG&&(Q=void 0),B=B.toLocaleLowerCase("en-US"),B=I&&I.toLocaleLowerCase("en-US")===B?void 0:B,`${B?`${B}:`:""}${Q?`${Q}/`:""}${J}`}var _e=t(80030);const Ge=(0,P.forwardRef)((m,y)=>{const{entityRef:I,defaultKind:B,title:Q,children:J,...ie}=m,le=(0,r.tg)(Le);let Se,Te,we;if(typeof I=="string"){const Ze=(0,C.of)(I);Se=Ze.kind,Te=Ze.namespace,we=Ze.name}else"metadata"in I?(Se=I.kind,Te=I.metadata.namespace,we=I.metadata.name):(Se=I.kind,Te=I.namespace,we=I.name);Se=Se.toLocaleLowerCase("en-US");var je;Te=(je=Te==null?void 0:Te.toLocaleLowerCase("en-US"))!==null&&je!==void 0?je:C.zG;const Ve={kind:Se,namespace:Te,name:we},rt=Qe({kind:Se,namespace:Te,name:we},{defaultKind:B}),dt=(0,c.jsxs)(A.rU,{...ie,ref:y,to:le(Ve),children:[J,!J&&(Q!=null?Q:rt)]});return Q?(0,c.jsx)(_e.ZP,{title:rt,children:dt}):dt});var mt=t(64279);function Ee(m){const{entityRefs:y,defaultKind:I,getTitle:B,...Q}=m,J=(0,r.h_)(W),{value:ie=new Array,loading:le,error:Se}=(0,mt.default)(async()=>{const Te=y.reduce((je,Ve)=>"metadata"in Ve?je:[...je,(0,C.of)(Ve)],new Array),we=y.filter(je=>"metadata"in je);return Te.length>0?[...(await J.getEntities({filter:Te.map(je=>({kind:je.kind,"metadata.namespace":je.namespace,"metadata.name":je.name}))})).items,...we]:we},[y]);return le?(0,c.jsx)(A.Ex,{}):Se?(0,c.jsx)(A.yu,{error:Se}):(0,c.jsx)(c.Fragment,{children:ie.map((Te,we)=>(0,c.jsxs)(P.Fragment,{children:[we>0&&", ",(0,c.jsx)(Ge,{...Q,defaultKind:I,entityRef:Te,title:B(Te)})]},we))})}function Ke(m){const{entityRefs:y,defaultKind:I,fetchEntities:B,getTitle:Q,...J}=m;return B?(0,c.jsx)(Ee,{...J,defaultKind:I,entityRefs:y,getTitle:Q}):(0,c.jsx)(c.Fragment,{children:y.map((ie,le)=>(0,c.jsxs)(P.Fragment,{children:[le>0&&", ",(0,c.jsx)(Ge,{...J,defaultKind:I,entityRef:ie,title:Q?Q(ie):void 0})]},le))})}function at(m){return m.reduce((y,I)=>({...y,...I.getCatalogFilters?I.getCatalogFilters():{}}),{})}function vt(m){return y=>m.every(I=>!I.filterEntity||I.filterEntity(y))}function it(m,y,I){var B;let Q=(m==null||(B=m.relations)===null||B===void 0?void 0:B.filter(J=>J.type===y).map(J=>(0,C.of)(J.targetRef)))||[];return I!=null&&I.kind&&(Q=Q.filter(J=>J.kind.toLocaleLowerCase("en-US")===I.kind.toLocaleLowerCase("en-US"))),Q}function gt(m,y){var I;const B=(I=m.metadata.annotations)===null||I===void 0?void 0:I[C.M6];if(!!B)try{const Q=(0,C.Ou)(B),J=y.byUrl(Q.target);return{locationTargetUrl:Q.target,integrationType:J==null?void 0:J.type}}catch{return}}function nt(m,y){const I=new Set([...getEntityRelations(m,RELATION_MEMBER_OF,{kind:"group"}),...m?[getCompoundEntityRef(m)]:[]].map(stringifyEntityRef)),B=getEntityRelations(y,RELATION_OWNED_BY).map(stringifyEntityRef);for(const Q of B)if(I.has(Q))return!0;return!1}class Lt{getCatalogFilters(){return{kind:this.value}}toQueryValue(){return this.value}constructor(y){this.value=y}}class bt{getTypes(){return Array.isArray(this.value)?this.value:[this.value]}getCatalogFilters(){return{"spec.type":this.getTypes()}}toQueryValue(){return this.getTypes()}constructor(y){this.value=y}}class ze{filterEntity(y){var I;return this.values.every(B=>((I=y.metadata.tags)!==null&&I!==void 0?I:[]).includes(B))}toQueryValue(){return this.values}constructor(y){this.values=y}}class ne{filterEntity(y){const I=this.toUpperArray(this.value.split(/\s/)),B=this.toUpperArray([y.metadata.tags]),Q=this.toUpperArray([y.metadata.name,y.metadata.title]);for(const J of I)if(B.every(ie=>ie!==J)&&Q.every(ie=>!ie.includes(J)))return!1;return!0}toUpperArray(y){return y.flat().filter(I=>Boolean(I)).map(I=>I.toLocaleUpperCase("en-US"))}constructor(y){this.value=y}}class Pe{filterEntity(y){return this.values.some(I=>it(y,C.S4).some(B=>Qe(B,{defaultKind:"group"})===I))}toQueryValue(){return this.values}constructor(y){this.values=y}}class ke{filterEntity(y){return this.values.some(I=>{var B;return((B=y.spec)===null||B===void 0?void 0:B.lifecycle)===I})}toQueryValue(){return this.values}constructor(y){this.values=y}}class tt{filterEntity(y){switch(this.value){case"owned":return this.isOwnedEntity(y);case"starred":return this.isStarredEntity(y);default:return!0}}toQueryValue(){return this.value}constructor(y,I,B){this.value=y,this.isOwnedEntity=I,this.isStarredEntity=B}}class yt{filterEntity(y){var I;const B=(I=y.metadata.annotations)===null||I===void 0?void 0:I["backstage.io/orphan"];return B!==void 0&&this.value.toString()===B}constructor(y){this.value=y}}class Zt{filterEntity(y){var I,B;const Q=(y==null||(I=y.status)===null||I===void 0||(B=I.items)===null||B===void 0?void 0:B.length)>0;return Q!==void 0&&this.value===Q}constructor(y){this.value=y}}const pt=(0,z.CT)("entity-context"),Tt=({children:m,entity:y,loading:I,error:B,refresh:Q})=>{const J={entity:y,loading:I,error:B,refresh:Q};return(0,c.jsx)(pt.Provider,{value:(0,z.EI)({1:J}),children:(0,c.jsx)(r.fC,{attributes:{...y?{entityRef:(0,C.eE)(y)}:void 0},children:m})})},It=m=>_jsx(Tt,{entity:m.entity,loading:!Boolean(m.entity),error:void 0,refresh:void 0,children:m.children});function Ot(){const m=(0,z.Vt)("entity-context");if(!m)throw new Error("Entity context is not available");const y=m.atVersion(1);if(!y)throw new Error("EntityContext v1 not available");if(!y.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:y.entity}}function en(){const m=(0,z.Vt)("entity-context");if(!m)throw new Error("Entity context is not available");const y=m.atVersion(1);if(!y)throw new Error("EntityContext v1 not available");const{entity:I,loading:B,error:Q,refresh:J}=y;return{entity:I,loading:B,error:Q,refresh:J}}var Wt=t(76635),Vt=t(19126),Qt=t.n(Vt),un=t(79635),cn=t(69294),Fn=t(48760),In=t(90736);const Un=(0,P.createContext)(void 0),vn=({children:m})=>{const y=(0,In.default)(),I=(0,r.h_)(W),[B,Q]=(0,P.useState)({}),J=(0,un.TH)();var ie;const le=(0,P.useMemo)(()=>(ie=Qt().parse(J.search,{ignoreQueryPrefix:!0}).filters)!==null&&ie!==void 0?ie:{},[J]),[Se,Te]=(0,P.useState)(()=>({appliedFilters:{},entities:[],backendEntities:[]})),[{loading:we,error:je},Ve]=(0,cn.default)(async()=>{const Ze=(0,Wt.compact)(Object.values(B)),Rt=vt(Ze),Gt=at(Ze),Ln=at((0,Wt.compact)(Object.values(Se.appliedFilters))),jn=Object.keys(B).reduce((En,Zn)=>{const Vn=B[Zn];return Vn!=null&&Vn.toQueryValue&&(En[Zn]=Vn.toQueryValue()),En},{});if((0,Wt.isEqual)(Ln,Gt))Te({appliedFilters:B,backendEntities:Se.backendEntities,entities:Se.backendEntities.filter(Rt)});else{const En=await I.getEntities({filter:Gt});Te({appliedFilters:B,backendEntities:En.items,entities:En.items.filter(Rt)})}if(y()){var ar;const En=Qt().parse(J.search,{ignoreQueryPrefix:!0}),Zn=Qt().stringify({...En,filters:jn},{addQueryPrefix:!0,arrayFormat:"repeat"}),Vn=`${window.location.pathname}${Zn}`;(ar=window.history)===null||ar===void 0||ar.replaceState(null,document.title,Vn)}},[I,le,B,Se],{loading:!0});(0,Fn.Z)(Ve,10,[B]);const rt=(0,P.useCallback)(Ze=>{Q(Rt=>{const Gt=typeof Ze=="function"?Ze(Rt):Ze;return{...Rt,...Gt}})},[]),dt=(0,P.useMemo)(()=>({filters:Se.appliedFilters,entities:Se.entities,backendEntities:Se.backendEntities,updateFilters:rt,queryParameters:le,loading:we,error:je}),[Se,rt,le,we,je]);return(0,c.jsx)(Un.Provider,{value:dt,children:m})};function hn(){const m=(0,P.useContext)(Un);if(!m)throw new Error("useEntityList must be used within EntityListProvider");return m}var Xt=t(18149),Mn=t.n(Xt),zn=t(829),pn=t.n(zn);function yn(){const m=(0,r.h_)(W),{filters:{kind:y,type:I},queryParameters:{type:B},updateFilters:Q}=hn(),J=(0,P.useMemo)(()=>[B].flat().filter(Boolean),[B]);var ie;const[le,Se]=(0,P.useState)(J.length?J:(ie=I==null?void 0:I.getTypes())!==null&&ie!==void 0?ie:[]);(0,P.useEffect)(()=>{J.length&&Se(J)},[J]);const[Te,we]=(0,P.useState)([]),je=(0,P.useMemo)(()=>y==null?void 0:y.value,[y]),{error:Ve,loading:rt,value:dt}=(0,mt.default)(async()=>je?await m.getEntityFacets({filter:{kind:je},facets:["spec.type"]}).then(Gt=>Gt.facets["spec.type"]||[]):[],[je,m]),Ze=(0,P.useRef)(dt);return(0,P.useEffect)(()=>{const Rt=Ze.current;if(Ze.current=dt,rt||!je||Rt===dt||!dt)return;const Gt=[...new Set(pn()(dt,jn=>-jn.count).map(jn=>jn.value.toLocaleLowerCase("en-US")))];we(Gt);const Ln=le.filter(jn=>Gt.includes(jn));Mn()(le,Ln)||Se(Ln)},[rt,je,le,Se,dt]),(0,P.useEffect)(()=>{Q({type:le.length?new bt(le):void 0})},[le,Q]),{loading:rt,error:Ve,availableTypes:Te,selectedTypes:le,setSelectedTypes:Se}}const xn=20;function kn(m,y){var I,B;const Q=y==null||(I=y.type)===null||I===void 0?void 0:I.toLocaleLowerCase("en-US"),J=y==null||(B=y.kind)===null||B===void 0?void 0:B.toLocaleLowerCase("en-US"),ie=(0,r.h_)(W),{loading:le,value:Se,error:Te}=(0,mt.default)(async()=>{var we;const je=(we=m.relations)===null||we===void 0?void 0:we.map(Ze=>({type:Ze.type,target:(0,C.of)(Ze.targetRef)})).filter(Ze=>(!Q||Ze.type.toLocaleLowerCase("en-US")===Q)&&(!J||Ze.target.kind===J));if(!je)return[];const Ve=Object.values((0,Wt.groupBy)(je,({target:Ze})=>`${Ze.kind}:${Ze.namespace}`.toLocaleLowerCase("en-US"))),rt=[];for(const Ze of Ve)rt.push({kind:Ze[0].target.kind,namespace:Ze[0].target.namespace,nameBatches:(0,Wt.chunk)(Ze.map(Rt=>Rt.target.name),xn)});return(await Promise.all(rt.flatMap(Ze=>Ze.nameBatches.map(Rt=>ie.getEntities({filter:{kind:Ze.kind,"metadata.namespace":Ze.namespace,"metadata.name":Rt}}))))).flatMap(Ze=>Ze.items)},[m,Q,J]);return{entities:Se,loading:le,error:Te}}var On=t(72164);function bn(m){return typeof m=="string"?m:(0,C.eE)(m)}function me(){const m=(0,r.h_)(k),y=(0,On.Z)(m.starredEntitie$(),new Set),I=(0,P.useCallback)(Q=>y.has(bn(Q)),[y]),B=(0,P.useCallback)(Q=>m.toggleStarred(bn(Q)).then(),[m]);return{starredEntities:y,toggleStarredEntity:B,isStarredEntity:I}}function ee(m){return typeof m=="string"?m:(0,C.eE)(m)}function Re(m){const y=(0,r.h_)(k),[I,B]=(0,P.useState)(!1);return(0,P.useEffect)(()=>{const J=y.starredEntitie$().subscribe({next(ie){B(ie.has(ee(m)))}});return()=>{J.unsubscribe()}},[m,y]),{toggleStarredEntity:(0,P.useCallback)(()=>y.toggleStarred(ee(m)).then(),[m,y]),isStarredEntity:I}}function Ue(){const m=(0,r.h_)(r.$4),{loading:y,value:I}=(0,mt.default)(async()=>{const{ownershipEntityRefs:Q}=await m.getBackstageIdentity();return Q},[]),B=(0,P.useMemo)(()=>{const Q=new Set(I!=null?I:[]);return J=>{const ie=it(J,C.S4).map(C.eE);for(const le of ie)if(Q.has(le))return!0;return!1}},[I]);return(0,P.useMemo)(()=>({loading:y,isOwnedEntity:B}),[y,B])}var et=t(25488);function wt(m){const{entity:y,loading:I,error:B}=en(),{allowed:Q,loading:J,error:ie}=(0,et.gI)({permission:m,resourceRef:y?(0,C.eE)(y):void 0});return I||J?{loading:!0,allowed:!1}:B?{loading:!1,allowed:!1,error:B}:{loading:!1,allowed:Q,error:ie}}function ae(){const m=(0,r.h_)(W),{error:y,loading:I,value:B}=(0,mt.default)(async()=>await m.getEntityFacets({facets:["kind"]}).then(J=>{var ie;return((ie=J.facets.kind)===null||ie===void 0?void 0:ie.map(le=>le.value).sort())||[]}),[m]);return{loading:I,error:y,allKinds:B!=null?B:[]}}function O(m,y,I){let B=m;return y&&(B=B.filter(J=>y.some(ie=>ie.toLocaleLowerCase("en-US")===J.toLocaleLowerCase("en-US")))),I&&!m.some(J=>J.toLocaleLowerCase("en-US")===I.toLocaleLowerCase("en-US"))&&(B=B.concat([I])),B.sort().reduce((J,ie)=>(J[ie.toLocaleLowerCase("en-US")]=ie,J),{})}function ue(m){var y;const{filters:I,queryParameters:{kind:B},updateFilters:Q}=hn(),J=(0,P.useMemo)(()=>[B].flat()[0],[B]);var ie;const[le,Se]=(0,P.useState)((ie=J!=null?J:(y=I.kind)===null||y===void 0?void 0:y.value)!==null&&ie!==void 0?ie:m.initialFilter);(0,P.useEffect)(()=>{J&&Se(J)},[J]),(0,P.useEffect)(()=>{var Ve;if(!((Ve=I.kind)===null||Ve===void 0)&&Ve.value){var rt;Se((rt=I.kind)===null||rt===void 0?void 0:rt.value)}},[I.kind]),(0,P.useEffect)(()=>{Q({kind:le?new Lt(le):void 0})},[le,Q]);const{allKinds:Te,loading:we,error:je}=ae();return{loading:we,error:je,allKinds:Te!=null?Te:[],selectedKind:le,setSelectedKind:Se}}const Be=m=>{const{allowedKinds:y,hidden:I,initialFilter:B="component"}=m,Q=(0,r.h_)(r.$v),{error:J,allKinds:ie,selectedKind:le,setSelectedKind:Se}=ue({initialFilter:B});if((0,P.useEffect)(()=>{J&&Q.post({message:"Failed to load entity kinds",severity:"error"})},[J,Q]),J)return null;const Te=O(ie,y,le),we=Object.keys(Te).map(je=>({value:je,label:Te[je]}));return I?null:(0,c.jsx)(F.Z,{pb:1,pt:1,children:(0,c.jsx)(A.Ph,{label:"Kind",items:we,selected:le.toLocaleLowerCase("en-US"),onChange:je=>Se(String(je))})})};var D=t(79692),M=t(5806),he=t(21324),fe=t(86619),be=t(19996),$e=t(25505),Ae=t(38016),We=t(88013);const st=(0,D.Z)({input:{}},{name:"CatalogReactEntityLifecyclePicker"}),S=(0,c.jsx)($e.Z,{fontSize:"small"}),K=(0,c.jsx)(be.Z,{fontSize:"small"}),ge=m=>{var y;const{initialFilter:I=[]}=m,B=st(),{updateFilters:Q,backendEntities:J,filters:ie,queryParameters:{lifecycles:le}}=hn(),Se=(0,P.useMemo)(()=>[le].flat().filter(Boolean),[le]);var Te;const[we,je]=(0,P.useState)(Se.length?Se:(Te=(y=ie.lifecycles)===null||y===void 0?void 0:y.values)!==null&&Te!==void 0?Te:I);(0,P.useEffect)(()=>{Se.length&&je(Se)},[Se]);const Ve=(0,P.useMemo)(()=>[...new Set(J.map(rt=>{var dt;return(dt=rt.spec)===null||dt===void 0?void 0:dt.lifecycle}).filter(Boolean))].sort(),[J]);return(0,P.useEffect)(()=>{Q({lifecycles:we.length&&Ve.length?new ke(we):void 0})},[we,Q,Ve]),Ve.length?(0,c.jsx)(F.Z,{pb:1,pt:1,children:(0,c.jsxs)(Y.Z,{variant:"button",component:"label",children:["Lifecycle",(0,c.jsx)(We.ZP,{multiple:!0,options:Ve,value:we,onChange:(rt,dt)=>je(dt),renderOption:(rt,{selected:dt})=>(0,c.jsx)(M.Z,{control:(0,c.jsx)(he.Z,{icon:S,checkedIcon:K,checked:dt}),label:rt}),size:"small",popupIcon:(0,c.jsx)(Ae.Z,{"data-testid":"lifecycle-picker-expand"}),renderInput:rt=>(0,c.jsx)(fe.Z,{...rt,className:B.input,variant:"outlined"})})]})}):null},de=(0,D.Z)({input:{}},{name:"CatalogReactEntityOwnerPicker"}),Ce=(0,c.jsx)($e.Z,{fontSize:"small"}),Oe=(0,c.jsx)(be.Z,{fontSize:"small"}),Me=()=>{var m;const y=de(),{updateFilters:I,backendEntities:B,filters:Q,queryParameters:{owners:J}}=hn(),ie=(0,P.useMemo)(()=>[J].flat().filter(Boolean),[J]);var le;const[Se,Te]=(0,P.useState)(ie.length?ie:(le=(m=Q.owners)===null||m===void 0?void 0:m.values)!==null&&le!==void 0?le:[]);(0,P.useEffect)(()=>{ie.length&&Te(ie)},[ie]);const we=(0,P.useMemo)(()=>[...new Set(B.flatMap(je=>it(je,C.S4).map(Ve=>Qe(Ve,{defaultKind:"group"}))).filter(Boolean))].sort(),[B]);return(0,P.useEffect)(()=>{I({owners:Se.length&&we.length?new Pe(Se):void 0})},[Se,I,we]),we.length?(0,c.jsx)(F.Z,{pb:1,pt:1,children:(0,c.jsxs)(Y.Z,{variant:"button",component:"label",children:["Owner",(0,c.jsx)(We.ZP,{multiple:!0,options:we,value:Se,onChange:(je,Ve)=>Te(Ve),renderOption:(je,{selected:Ve})=>(0,c.jsx)(M.Z,{control:(0,c.jsx)(he.Z,{icon:Ce,checkedIcon:Oe,checked:Ve}),label:je}),size:"small",popupIcon:(0,c.jsx)(Ae.Z,{"data-testid":"owner-picker-expand"}),renderInput:je=>(0,c.jsx)(fe.Z,{...je,className:y.input,variant:"outlined"})})]})}):null},ht=m=>{const y=useRouteRef(entityRouteRef);return _jsx(IconButton,{component:Link,"aria-label":"Show",title:"Show details",to:y(getCompoundEntityRef(m.entity)),children:_jsx(InfoIcon,{})})},jt=m=>_jsx(IconButton,{component:Link,"aria-label":"Email",title:`Email ${m.email}`,to:`mailto:${m.email}`,children:_jsx(EmailIcon,{})}),lt=m=>{var y;const I=(y=m.entity.spec.profile)===null||y===void 0?void 0:y.email;return I?_jsx(EmailCardAction,{email:I}):null},ft=m=>{var y;const I=(y=m.entity.spec.profile)===null||y===void 0?void 0:y.email;return I?_jsx(EmailCardAction,{email:I}):null},xt=(0,D.Z)(()=>({popoverPaper:{width:"30em"},descriptionTypography:{overflow:"hidden",textOverflow:"ellipsis",display:"-webkit-box",WebkitLineClamp:2,WebkitBoxOrient:"vertical"}})),ct=4,Bt=m=>{var y,I,B;const{entityRef:Q,children:J,delayTime:ie=500}=m,le=xt(),Se=useApiHolder(),Te=usePopupState({variant:"popover",popupId:"entity-peek-ahead"}),[we,je]=useState(!1),Ve=useMemo(()=>debounce(()=>je(!0),ie),[ie]),[{loading:rt,error:dt,value:Ze},Rt]=useAsyncFn(async()=>{const Ln=Se.get(catalogApiRef);if(Ln){const jn=await Ln.getEntityByRef(Q);if(!jn)throw new Error(`${Q} not found`);return jn}},[Se,Q]),Gt=()=>{je(!1),Ve.cancel()};return useEffect(()=>{Te.isOpen&&!Ze&&!dt&&!rt&&Rt()},[Te.isOpen,Rt,Ze,dt,rt]),_jsxs(_Fragment,{children:[_jsx(Typography,{component:"span",onMouseEnter:Ve,children:_jsx(Typography,{component:"span","data-testid":"trigger",...bindHover(Te),children:J})}),we&&_jsx(HoverPopover,{PaperProps:{className:le.popoverPaper},...bindPopover(Te),anchorOrigin:{vertical:"bottom",horizontal:"center"},transformOrigin:{vertical:"top",horizontal:"center"},onMouseLeave:Gt,children:_jsxs(Card,{children:[_jsxs(CardContent,{children:[dt&&_jsx(ResponseErrorPanel,{error:dt}),rt&&_jsx(Progress,{}),Ze&&_jsxs(_Fragment,{children:[_jsx(Typography,{color:"textSecondary",children:Ze.metadata.namespace}),_jsx(Typography,{variant:"h5",component:"div",children:Ze.metadata.name}),_jsx(Typography,{color:"textSecondary",gutterBottom:!0,children:Ze.kind}),Ze.metadata.description&&_jsx(Typography,{className:le.descriptionTypography,paragraph:!0,children:Ze.metadata.description}),_jsx(Typography,{children:(y=Ze.spec)===null||y===void 0?void 0:y.type}),_jsxs(Box,{marginTop:"0.5em",children:[(Ze.metadata.tags||[]).slice(0,ct).map(Ln=>_jsx(Chip,{size:"small",label:Ln},Ln)),((I=Ze.metadata.tags)===null||I===void 0?void 0:I.length)&&((B=Ze.metadata.tags)===null||B===void 0?void 0:B.length)>ct&&_jsx(Tooltip,{title:"Drill into the entity to see all of the tags.",children:_jsx(Chip,{size:"small",label:"..."},"other-tags")})]})]})]}),!dt&&Ze&&_jsx(CardActions,{children:_jsxs(_Fragment,{children:[isUserEntity(Ze)&&_jsx(UserCardActions,{entity:Ze}),isGroupEntity(Ze)&&_jsx(GroupCardActions,{entity:Ze}),_jsx(EntityCardActions,{entity:Ze})]})})]})})]})},Mt=(0,D.Z)(m=>({searchToolbar:{paddingLeft:0,paddingRight:0},input:{}}),{name:"CatalogReactEntitySearchBar"}),zt=()=>{var m;const y=Mt(),{filters:I,updateFilters:B}=useEntityList();var Q;const[J,ie]=useState((Q=(m=I.text)===null||m===void 0?void 0:m.value)!==null&&Q!==void 0?Q:"");return useDebounce(()=>{B({text:J.length?new EntityTextFilter(J):void 0})},250,[J,B]),_jsx(Toolbar,{className:y.searchToolbar,children:_jsx(FormControl,{children:_jsx(Input,{"aria-label":"search",id:"input-with-icon-adornment",className:y.input,placeholder:"Search",autoComplete:"off",onChange:le=>ie(le.target.value),value:J,startAdornment:_jsx(InputAdornment,{position:"start",children:_jsx(Search,{})}),endAdornment:_jsx(InputAdornment,{position:"end",children:_jsx(IconButton,{"aria-label":"clear search",onClick:()=>ie(""),edge:"end",disabled:J.length===0,children:_jsx(Clear,{})})})})})})},qt=Object.freeze({createEntityRefColumn(m){const{defaultKind:y}=m;function I(B){var Q;return((Q=B.metadata)===null||Q===void 0?void 0:Q.title)||Qe(B,{defaultKind:y})}return{title:"Name",highlight:!0,customFilterAndSearch(B,Q){return I(Q).includes(B)},customSort(B,Q){return I(B).localeCompare(I(Q))},render:B=>{var Q;return(0,c.jsx)(Ge,{entityRef:B,defaultKind:y,title:(Q=B.metadata)===null||Q===void 0?void 0:Q.title})}}},createEntityRelationColumn(m){const{title:y,relation:I,defaultKind:B,filter:Q}=m;function J(le){return it(le,I,Q)}function ie(le){return J(le).map(Se=>Qe(Se,{defaultKind:B})).join(", ")}return{title:y,customFilterAndSearch(le,Se){return ie(Se).includes(le)},customSort(le,Se){return ie(le).localeCompare(ie(Se))},render:le=>(0,c.jsx)(Ke,{entityRefs:J(le),defaultKind:B})}},createOwnerColumn(){return this.createEntityRelationColumn({title:"Owner",relation:C.S4,defaultKind:"group"})},createDomainColumn(){return this.createEntityRelationColumn({title:"Domain",relation:C.cz,defaultKind:"domain",filter:{kind:"domain"}})},createSystemColumn(){return this.createEntityRelationColumn({title:"System",relation:C.cz,defaultKind:"system",filter:{kind:"system"}})},createMetadataDescriptionColumn(){return{title:"Description",field:"metadata.description",render:m=>(0,c.jsx)(A.Or,{text:m.metadata.description,placement:"bottom-start",line:2})}},createSpecLifecycleColumn(){return{title:"Lifecycle",field:"spec.lifecycle"}},createSpecTypeColumn(){return{title:"Type",field:"spec.type"}}}),Wn=[qt.createEntityRefColumn({defaultKind:"system"}),qt.createDomainColumn(),qt.createOwnerColumn(),qt.createMetadataDescriptionColumn()],Sn=[qt.createEntityRefColumn({defaultKind:"component"}),qt.createSystemColumn(),qt.createOwnerColumn(),qt.createSpecTypeColumn(),qt.createSpecLifecycleColumn(),qt.createMetadataDescriptionColumn()],Dt=(0,D.Z)(m=>({empty:{padding:m.spacing(2),display:"flex",justifyContent:"center"}})),Nt=m=>{const{entities:y,title:I,emptyContent:B,variant:Q="gridItem",columns:J}=m,ie=Dt(),le={minWidth:"0",width:"100%"};return Q==="gridItem"&&(le.height="calc(100% - 10px)"),(0,c.jsx)(A.iA,{columns:J,title:I,style:le,emptyContent:B&&(0,c.jsx)("div",{className:ie.empty,children:B}),options:{search:!1,paging:!1,actionsColumnIndex:-1,padding:"dense",draggable:!1},data:y})};Nt.columns=qt,Nt.systemEntityColumns=Wn,Nt.componentEntityColumns=Sn;const rn=(0,D.Z)({input:{}},{name:"CatalogReactEntityTagPicker"}),Bn=(0,c.jsx)($e.Z,{fontSize:"small"}),Xn=(0,c.jsx)(be.Z,{fontSize:"small"}),Cn=m=>{var y;const I=rn(),{updateFilters:B,filters:Q,queryParameters:{tags:J}}=hn(),ie=(0,r.h_)(W),{value:le}=(0,mt.default)(async()=>{var Ve;const rt="metadata.tags",{facets:dt}=await ie.getEntityFacets({facets:[rt],filter:(Ve=Q.kind)===null||Ve===void 0?void 0:Ve.getCatalogFilters()});return Object.fromEntries(dt[rt].map(({value:Ze,count:Rt})=>[Ze,Rt]))},[Q.kind]),Se=(0,P.useMemo)(()=>[J].flat().filter(Boolean),[J]);var Te;const[we,je]=(0,P.useState)(Se.length?Se:(Te=(y=Q.tags)===null||y===void 0?void 0:y.values)!==null&&Te!==void 0?Te:[]);return(0,P.useEffect)(()=>{Se.length&&je(Se)},[Se]),(0,P.useEffect)(()=>{const Ve=Object.keys(le!=null?le:{});B({tags:we.length&&Ve.length?new ze(we):void 0})},[we,B,le]),Object.keys(le!=null?le:{}).length?(0,c.jsx)(F.Z,{pb:1,pt:1,children:(0,c.jsxs)(Y.Z,{variant:"button",component:"label",children:["Tags",(0,c.jsx)(We.ZP,{multiple:!0,options:Object.keys(le!=null?le:{}),value:we,onChange:(Ve,rt)=>je(rt),renderOption:(Ve,{selected:rt})=>(0,c.jsx)(M.Z,{control:(0,c.jsx)(he.Z,{icon:Bn,checkedIcon:Xn,checked:rt}),label:m.showCounts?`${Ve} (${le==null?void 0:le[Ve]})`:Ve}),size:"small",popupIcon:(0,c.jsx)(Ae.Z,{"data-testid":"tag-picker-expand"}),renderInput:Ve=>(0,c.jsx)(fe.Z,{...Ve,className:I.input,variant:"outlined"})})]})}):null},wn=m=>{const{hidden:y,initialFilter:I}=m,B=(0,r.h_)(r.$v),{error:Q,availableTypes:J,selectedTypes:ie,setSelectedTypes:le}=yn();if((0,P.useEffect)(()=>{Q&&B.post({message:"Failed to load entity types",severity:"error"}),I&&le([I])},[Q,B,I,le]),J.length===0||Q)return null;const Se=[{value:"all",label:"all"},...J.map(we=>({value:we,label:we}))];var Te;return y?null:(0,c.jsx)(F.Z,{pb:1,pt:1,children:(0,c.jsx)(A.Ph,{label:"Type",items:Se,selected:(Te=Se.length>1?ie[0]:void 0)!==null&&Te!==void 0?Te:"all",onChange:we=>le(we==="all"?[]:[String(we)])})})};var Yn=t(15459),fn=t(61837),Rn=t(11640),dr=t(28347);const w=(0,Yn.Z)({root:{color:"#f3ba37"}})(Rn.Z),u=m=>{const{toggleStarredEntity:y,isStarredEntity:I}=Re(m.entity);return(0,c.jsx)(fn.Z,{"aria-label":"favorite",color:"inherit",...m,onClick:()=>y(),children:(0,c.jsx)(_e.ZP,{title:I?"Remove from favorites":"Add to favorites",children:I?(0,c.jsx)(w,{}):(0,c.jsx)(dr.Z,{})})})};var x=t(8629),E=t(79249),q=t(38724),ve=t(99152),ye=t(6487),Ne=t(49429),Je=t(55999),Ft=t(72779),Ht=t.n(Ft),$n=t(39412);const ur=$n.Z;function hs(m,y){if(m)return m.toLocaleLowerCase("en-US");if(y)try{return(0,C.of)(y).kind.toLocaleLowerCase("en-US")}catch{return}}function ps(m,y){const I=(0,r.qD)(),B=hs(m,y);return B&&I.getSystemIcon(`kind:${B}`)||ur}function Rr(m){const{kind:y,entityRef:I,...B}=m,Q=ps(y,I);return(0,c.jsx)(Q,{...B})}const hr=(0,D.Z)(m=>({node:{fill:m.palette.grey[300],stroke:m.palette.grey[300],"&.primary":{fill:m.palette.primary.light,stroke:m.palette.primary.light},"&.secondary":{fill:m.palette.secondary.light,stroke:m.palette.secondary.light}},text:{fill:m.palette.getContrastText(m.palette.grey[300]),"&.primary":{fill:m.palette.primary.contrastText},"&.secondary":{fill:m.palette.secondary.contrastText},"&.focused":{fontWeight:"bold"}},clickable:{cursor:"pointer"}}));function Lr(m){const y=(0,r.h_)(W),I=(0,C.eE)(m),{loading:B,error:Q,value:J}=(0,mt.default)(async()=>{const ie=await y.getEntityAncestors({entityRef:I}),le=new Array,Se=new Array;for(const Te of ie.items){const we=(0,C.eE)(Te.entity),je=we===ie.rootEntityRef;le.push({id:we,root:je,...Te.entity});for(const Ve of Te.parentEntityRefs)Se.push({from:we,to:Ve})}return{nodes:le,edges:Se}},[I]);return{loading:B,error:Q,nodes:(J==null?void 0:J.nodes)||[],edges:(J==null?void 0:J.edges)||[]}}function Vr({node:m}){const y=hr(),I=(0,un.s0)(),B=(0,r.tg)(Le),[Q,J]=(0,P.useState)(0),[ie,le]=(0,P.useState)(0),Se=(0,P.useRef)(null);(0,P.useLayoutEffect)(()=>{if(Se.current){let{height:Rt,width:Gt}=Se.current.getBBox();Rt=Math.round(Rt),Gt=Math.round(Gt),(Rt!==ie||Gt!==Q)&&(J(Gt),le(Rt))}},[Q,ie]);const Te=10,we=ie,je=we+Te,Ve=je+Q+Te*2,rt=ie+Te*2,dt=m.metadata.title||(m.kind&&m.metadata.name&&m.metadata.namespace?Qe({kind:m.kind,name:m.metadata.name,namespace:m.metadata.namespace||""}):m.id),Ze=()=>{I(B({kind:m.kind,namespace:m.metadata.namespace||C.zG,name:m.metadata.name}))};return(0,c.jsxs)("g",{onClick:Ze,className:y.clickable,children:[(0,c.jsx)("rect",{className:Ht()(y.node,m.root?"secondary":"primary"),width:Ve,height:rt,rx:10}),(0,c.jsx)(Rr,{kind:m.kind,y:Te,x:Te,width:we,height:we,className:Ht()(y.text,m.root?"secondary":"primary")}),(0,c.jsx)("text",{ref:Se,className:Ht()(y.text,m.root?"secondary":"primary"),y:rt/2,x:je+(Q+Te*2)/2,textAnchor:"middle",alignmentBaseline:"middle",children:dt})]})}function Pr(m){const{loading:y,error:I,nodes:B,edges:Q}=Lr(m.entity);return y?(0,c.jsx)(A.Ex,{}):I?(0,c.jsx)(A.Gk,{error:I}):(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(Je.Z,{variant:"h2",children:"Ancestry"}),(0,c.jsxs)(Je.Z,{gutterBottom:!0,children:["This is the ancestry of entities above the current one - as in, the chain(s) of entities down to the current one, where"," ",(0,c.jsx)(A.rU,{to:"https://backstage.io/docs/features/software-catalog/life-of-an-entity",children:"processors emitted"})," ","child entities that ultimately led to the current one existing. Note that this is a completely different mechanism from relations."]}),(0,c.jsx)(F.Z,{mt:4,children:(0,c.jsx)(A.mn,{nodes:B,edges:Q,renderNode:Vr,direction:A.NX.Nm.BOTTOM_TOP,zoom:"enable-on-click"})})]})}var Jn=t(11776),qn=t(38402),pr=t(86136),kr=t(99688),Hr=t(49378),Us=t(54506),Or=t(94339),fs=t(24579),gs=t(27685);const Cr=(0,D.Z)(m=>({root:{display:"flex",flexDirection:"column"},marginTop:{marginTop:m.spacing(2)},helpIcon:{marginLeft:m.spacing(1),color:m.palette.text.disabled},monospace:{fontFamily:"monospace"}}));function gn(m){const y=Cr();return(0,c.jsx)(Hr.Z,{...m,primaryTypographyProps:{className:y.monospace},secondaryTypographyProps:{className:y.monospace}})}function or(m){const y=Cr();return(0,c.jsx)(Us.Z,{className:y.monospace,children:m.children})}function Br(m){return(0,c.jsx)(F.Z,{mt:2,children:(0,c.jsx)(Or.Z,{variant:"outlined",children:(0,c.jsxs)(fs.Z,{children:[(0,c.jsxs)(Y.Z,{variant:"h6",gutterBottom:!0,children:[m.title,m.helpLink&&(0,c.jsx)(vs,{to:m.helpLink})]}),m.children]})})})}function ms(m){if(m.match(/^url:https?:\/\//))return m.slice(4);if(m.match(/^https?:\/\//))return m}function $r(m){const[y,I]=m.entry,B=ms(I);return(0,c.jsxs)(qn.Z,{children:[m.indent&&(0,c.jsx)(pr.Z,{}),(0,c.jsx)(gn,{primary:y,secondary:B?(0,c.jsx)(A.rU,{to:B,children:I}):I})]})}function vs(m){const y=Cr();return(0,c.jsx)(A.rU,{to:m.to,className:y.helpIcon,children:(0,c.jsx)(gs.Z,{fontSize:"inherit"})})}const ys=(0,D.Z)({root:{display:"flex",flexDirection:"column"}});function Gr(m){var y,I;const B=(0,r.h_)(W),Q=(0,C.eE)(m),J=(y=m.metadata.annotations)===null||y===void 0?void 0:y[C.P1],ie=(I=m.metadata.annotations)===null||I===void 0?void 0:I[C.q1],{loading:le,error:Se,value:Te}=(0,mt.default)(async()=>!J&&!ie?[]:(await B.getEntities({filter:[...J?[{[`metadata.annotations.${C.P1}`]:J}]:[],...ie?[{[`metadata.annotations.${C.q1}`]:ie}]:[]]})).items,[J,ie]);return{loading:le,error:Se,location:J,originLocation:ie,colocatedEntities:Te==null?void 0:Te.filter(we=>(0,C.eE)(we)!==Q)}}function Kr(m){return(0,c.jsxs)(Jn.Z,{dense:!0,children:[m.header&&(0,c.jsx)($r,{entry:m.header},"header"),m.entities.map(y=>(0,c.jsxs)(qn.Z,{children:[(0,c.jsx)(pr.Z,{children:(0,c.jsx)(Rr,{kind:y.kind})}),(0,c.jsx)(gn,{primary:(0,c.jsx)(Ge,{entityRef:y})})]},(0,C.eE)(y)))]})}function ir(m){const{entity:y}=m,{loading:I,error:B,location:Q,originLocation:J,colocatedEntities:ie}=Gr(y);if(I)return(0,c.jsx)(A.Ex,{});if(B)return(0,c.jsx)(A.Gk,{error:B});if(!Q&&!J)return(0,c.jsx)(kr.Z,{severity:"warning",children:"Entity had no location information."});if(!(ie!=null&&ie.length))return(0,c.jsx)(kr.Z,{severity:"info",children:"There were no other entities on this location."});if(Q===J)return(0,c.jsx)(Kr,{entities:ie});const le=ie.filter(Te=>{var we;return((we=Te.metadata.annotations)===null||we===void 0?void 0:we[C.P1])===Q}),Se=ie.filter(Te=>{var we;return((we=Te.metadata.annotations)===null||we===void 0?void 0:we[C.q1])===J});return(0,c.jsxs)(c.Fragment,{children:[le.length>0&&(0,c.jsx)(Kr,{entities:le,header:["At the same location",Q]}),Se.length>0&&(0,c.jsx)(Kr,{entities:Se,header:["At the same origin",J]})]})}function xs(m){const y=ys();return(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(Je.Z,{variant:"h2",children:"Colocated"}),(0,c.jsx)(Je.Z,{children:"These are the entities that are colocated with this entity - as in, they originated from the same data source (e.g. came from the same YAML file), or from the same origin (e.g. the originally registered URL)."}),(0,c.jsx)("div",{className:y.root,children:(0,c.jsx)(ir,{entity:m.entity})})]})}function Yr(m){return Object.fromEntries([...Object.entries(m)].sort((y,I)=>y[0]<I[0]?-1:1))}function bs(m){return(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(Je.Z,{variant:"h2",children:"Entity as JSON"}),(0,c.jsx)(Je.Z,{children:"This is the raw entity data as received from the catalog, on JSON form."}),(0,c.jsx)(Je.Z,{children:(0,c.jsx)("div",{style:{fontSize:"75%"},"data-testid":"code-snippet",children:(0,c.jsx)(A.Oi,{text:JSON.stringify(Yr(m.entity),void 0,2),language:"json",showCopyCodeButton:!0})})})]})}var Zr=t(3440),Ss=t.n(Zr);const Cs=(0,D.Z)({root:{display:"flex",flexDirection:"column"}});function Jr(m){var y,I;const B=Cs(),{apiVersion:Q,kind:J,metadata:ie,spec:le,relations:Se=[],status:Te={}}=m.entity,we=Ss()(pn()(Se,je=>je.targetRef),"type");return(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(Je.Z,{variant:"h2",children:"Overview"}),(0,c.jsxs)("div",{className:B.root,children:[(0,c.jsx)(Br,{title:"Identity",children:(0,c.jsxs)(Jn.Z,{dense:!0,children:[(0,c.jsx)(qn.Z,{children:(0,c.jsx)(gn,{primary:"apiVersion",secondary:Q})}),(0,c.jsx)(qn.Z,{children:(0,c.jsx)(gn,{primary:"kind",secondary:J})}),(le==null?void 0:le.type)&&(0,c.jsx)(qn.Z,{children:(0,c.jsx)(gn,{primary:"spec.type",secondary:le.type})}),ie.uid&&(0,c.jsx)(qn.Z,{children:(0,c.jsx)(gn,{primary:"uid",secondary:ie.uid})}),ie.etag&&(0,c.jsx)(qn.Z,{children:(0,c.jsx)(gn,{primary:"etag",secondary:ie.etag})})]})}),(0,c.jsxs)(Br,{title:"Metadata",children:[!!Object.keys(ie.annotations||{}).length&&(0,c.jsx)(Jn.Z,{dense:!0,subheader:(0,c.jsxs)(or,{children:["Annotations",(0,c.jsx)(vs,{to:"https://backstage.io/docs/features/software-catalog/well-known-annotations"})]}),children:Object.entries(ie.annotations).map(je=>(0,c.jsx)($r,{indent:!0,entry:je},je[0]))}),!!Object.keys(ie.labels||{}).length&&(0,c.jsx)(Jn.Z,{dense:!0,subheader:(0,c.jsx)(or,{children:"Labels"}),children:Object.entries(ie.labels).map(je=>(0,c.jsx)($r,{indent:!0,entry:je},je[0]))}),!!(!((y=ie.tags)===null||y===void 0)&&y.length)&&(0,c.jsx)(Jn.Z,{dense:!0,subheader:(0,c.jsx)(or,{children:"Tags"}),children:ie.tags.map((je,Ve)=>(0,c.jsxs)(qn.Z,{children:[(0,c.jsx)(pr.Z,{}),(0,c.jsx)(gn,{primary:je})]},`${je}-${Ve}`))})]}),!!Se.length&&(0,c.jsx)(Br,{title:"Relations",helpLink:"https://backstage.io/docs/features/software-catalog/well-known-relations",children:Object.entries(we).map(([je,Ve],rt)=>(0,c.jsx)("div",{children:(0,c.jsx)(Jn.Z,{dense:!0,subheader:(0,c.jsx)(or,{children:je}),children:Ve.map(dt=>(0,c.jsxs)(qn.Z,{children:[(0,c.jsx)(pr.Z,{children:(0,c.jsx)(Rr,{entityRef:dt.targetRef})}),(0,c.jsx)(gn,{primary:(0,c.jsx)(Ge,{entityRef:dt.targetRef})})]},dt.targetRef))})},rt))}),!!(!((I=Te.items)===null||I===void 0)&&I.length)&&(0,c.jsx)(Br,{title:"Status",helpLink:"https://backstage.io/docs/features/software-catalog/well-known-statuses",children:Te.items.map((je,Ve)=>(0,c.jsxs)("div",{children:[(0,c.jsxs)(Y.Z,{children:[je.level,": ",je.type]}),(0,c.jsx)(F.Z,{ml:2,children:je.message})]},Ve))})]})]})}var Qr=t(72847);function Xr(m){return(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(Je.Z,{variant:"h2",children:"Entity as YAML"}),(0,c.jsx)(Je.Z,{children:"This is the raw entity data as received from the catalog, on YAML form."}),(0,c.jsx)(Je.Z,{children:(0,c.jsx)("div",{style:{fontSize:"75%"},"data-testid":"code-snippet",children:(0,c.jsx)(A.Oi,{text:Qr.ZP.stringify(Yr(m.entity)),language:"yaml",showCopyCodeButton:!0})})})]})}const Dr=(0,D.Z)(m=>({fullHeightDialog:{height:"calc(100% - 64px)"},root:{display:"flex",flexGrow:1,width:"100%",backgroundColor:m.palette.background.paper},tabs:{borderRight:`1px solid ${m.palette.divider}`,flexShrink:0},tabContents:{flexGrow:1,overflowX:"auto"}}));function on(m){const{children:y,value:I,index:B,...Q}=m,J=Dr();return(0,c.jsx)("div",{role:"tabpanel",hidden:I!==B,id:`vertical-tabpanel-${B}`,"aria-labelledby":`vertical-tab-${B}`,className:J.tabContents,...Q,children:I===B&&(0,c.jsx)(F.Z,{pl:3,pr:3,children:y})})}function Ut(m){return{id:`vertical-tab-${m}`,"aria-controls":`vertical-tabpanel-${m}`}}function ws(m){const y=Dr(),[I,B]=P.useState(0);return(0,P.useEffect)(()=>{B(0)},[m.open]),m.entity?(0,c.jsxs)(x.Z,{fullWidth:!0,maxWidth:"xl",open:m.open,onClose:m.onClose,"aria-labelledby":"entity-inspector-dialog-title",PaperProps:{className:y.fullHeightDialog},children:[(0,c.jsx)(E.Z,{id:"entity-inspector-dialog-title",children:"Entity Inspector"}),(0,c.jsx)(q.Z,{dividers:!0,children:(0,c.jsxs)("div",{className:y.root,children:[(0,c.jsxs)(ve.Z,{orientation:"vertical",variant:"scrollable",value:I,onChange:(Q,J)=>B(J),"aria-label":"Inspector options",className:y.tabs,children:[(0,c.jsx)(ye.Z,{label:"Overview",...Ut(0)}),(0,c.jsx)(ye.Z,{label:"Ancestry",...Ut(1)}),(0,c.jsx)(ye.Z,{label:"Colocated",...Ut(2)}),(0,c.jsx)(ye.Z,{label:"Raw JSON",...Ut(3)}),(0,c.jsx)(ye.Z,{label:"Raw YAML",...Ut(4)})]}),(0,c.jsx)(on,{value:I,index:0,children:(0,c.jsx)(Jr,{entity:m.entity})}),(0,c.jsx)(on,{value:I,index:1,children:(0,c.jsx)(Pr,{entity:m.entity})}),(0,c.jsx)(on,{value:I,index:2,children:(0,c.jsx)(xs,{entity:m.entity})}),(0,c.jsx)(on,{value:I,index:3,children:(0,c.jsx)(bs,{entity:m.entity})}),(0,c.jsx)(on,{value:I,index:4,children:(0,c.jsx)(Xr,{entity:m.entity})})]})}),(0,c.jsx)(Ne.Z,{children:(0,c.jsx)(X.Z,{onClick:m.onClose,color:"primary",children:"Close"})})]}):null}var js=t(85256);function Es(m){var y;const I=(0,r.h_)(W),B=(y=m.metadata.annotations)===null||y===void 0?void 0:y[C.q1],Q=m.metadata.uid,J=B==="bootstrap:bootstrap",ie=(0,mt.default)(async()=>{const dt=I.getLocationByRef(B);let Ze;if(!B)Ze=Promise.resolve([]);else{const Rt=`metadata.annotations.${C.q1}`;Ze=I.getEntities({filter:{[Rt]:B},fields:["kind","metadata.uid","metadata.name","metadata.namespace"]}).then(Gt=>Gt.items)}return Promise.all([dt,Ze]).then(([Rt,Gt])=>({location:Rt,colocatedEntities:Gt}))},[I,m]),le=(0,P.useCallback)(async function(){const{location:Ze}=ie.value;await I.removeLocationById(Ze.id)},[I,ie]),Se=(0,P.useCallback)(async function(){await I.removeEntityByUid(Q)},[I,Q]);if(J)return{type:"bootstrap",location:B,deleteEntity:Se};const{loading:Te,error:we,value:je}=ie;if(Te)return{type:"loading"};if(we)return{type:"error",error:we};const{location:Ve,colocatedEntities:rt}=je;return Ve?{type:"unregister",location:B,colocatedEntities:rt.map(C.iB),unregisterLocation:le,deleteEntity:Se}:{type:"only-delete",deleteEntity:Se}}var qr=t(23054);const As=(0,D.Z)({advancedButton:{fontSize:"0.7em"}}),Ts=({entity:m,onConfirm:y})=>{const I=(0,r.h_)(r.$v),B=(0,r.h_)(r.Ds),Q=As(),J=Es(m),[ie,le]=(0,P.useState)(!1),[Se,Te]=(0,P.useState)(!1);var we;const je=(we=B.getOptionalString("app.title"))!==null&&we!==void 0?we:"Backstage",Ve=(0,P.useCallback)(async function(){if("unregisterLocation"in J){Te(!0);try{await J.unregisterLocation(),y()}catch(Ze){(0,qr.BD)(Ze),I.post({message:Ze.message})}finally{Te(!1)}}},[I,y,J]),rt=(0,P.useCallback)(async function(){if("deleteEntity"in J){Te(!0);try{await J.deleteEntity(),y()}catch(Ze){(0,qr.BD)(Ze),I.post({message:Ze.message})}finally{Te(!1)}}},[I,y,J]);return J.type==="loading"?(0,c.jsx)(A.Ex,{}):J.type==="error"?(0,c.jsx)(A.Gk,{error:J.error}):J.type==="bootstrap"?(0,c.jsxs)(c.Fragment,{children:[(0,c.jsxs)(kr.Z,{severity:"info",children:['You cannot unregister this entity, since it originates from a protected Backstage configuration (location "',J.location,'"). If you believe this is in error, please contact the ',je," ","integrator."]}),(0,c.jsxs)(F.Z,{marginTop:2,children:[!ie&&(0,c.jsx)(X.Z,{variant:"text",size:"small",color:"primary",className:Q.advancedButton,onClick:()=>le(!0),children:"Advanced Options"}),ie&&(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(Je.Z,{children:"You have the option to delete the entity itself from the catalog. Note that this should only be done if you know that the catalog file has been deleted at, or moved from, its origin location. If that is not the case, the entity will reappear shortly as the next refresh round is performed by the catalog."}),(0,c.jsx)(X.Z,{variant:"contained",color:"secondary",disabled:Se,onClick:rt,children:"Delete Entity"})]})]})]}):J.type==="only-delete"?(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(Je.Z,{children:"This entity does not seem to originate from a registered location. You therefore only have the option to delete it outright from the catalog."}),(0,c.jsx)(X.Z,{variant:"contained",color:"secondary",disabled:Se,onClick:rt,children:"Delete Entity"})]}):J.type==="unregister"?(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(Je.Z,{children:"This action will unregister the following entities:"}),(0,c.jsx)(Je.Z,{component:"ul",children:J.colocatedEntities.map(dt=>(0,c.jsx)("li",{children:(0,c.jsx)(Ge,{entityRef:dt})},`${dt.kind}:${dt.namespace}/${dt.name}`))}),(0,c.jsx)(Je.Z,{children:"Located at the following location:"}),(0,c.jsx)(Je.Z,{component:"ul",children:(0,c.jsx)("li",{children:J.location})}),(0,c.jsxs)(Je.Z,{children:["To undo, just re-register the entity in ",je,"."]}),(0,c.jsxs)(F.Z,{marginTop:2,children:[(0,c.jsx)(X.Z,{variant:"contained",color:"secondary",disabled:Se,onClick:Ve,children:"Unregister Location"}),!ie&&(0,c.jsx)(F.Z,{component:"span",marginLeft:2,children:(0,c.jsx)(X.Z,{variant:"text",size:"small",color:"primary",className:Q.advancedButton,onClick:()=>le(!0),children:"Advanced Options"})})]}),ie&&(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(F.Z,{paddingTop:4,paddingBottom:4,children:(0,c.jsx)(js.Z,{})}),(0,c.jsx)(Je.Z,{children:"You also have the option to delete the entity itself from the catalog. Note that this should only be done if you know that the catalog file has been deleted at, or moved from, its origin location. If that is not the case, the entity will reappear shortly as the next refresh round is performed by the catalog."}),(0,c.jsx)(X.Z,{variant:"contained",color:"secondary",disabled:Se,onClick:rt,children:"Delete Entity"})]})]}):(0,c.jsx)(kr.Z,{severity:"error",children:"Internal error: Unknown state"})},_r=m=>{const{open:y,onConfirm:I,onClose:B,entity:Q}=m;return(0,c.jsxs)(x.Z,{open:y,onClose:B,children:[(0,c.jsx)(E.Z,{id:"responsive-dialog-title",children:"Are you sure you want to unregister this entity?"}),(0,c.jsx)(q.Z,{children:(0,c.jsx)(Ts,{entity:Q,onConfirm:I})}),(0,c.jsx)(Ne.Z,{children:(0,c.jsx)(X.Z,{onClick:B,color:"primary",children:"Cancel"})})]})};var wr=t(12231),Ms=t(9520),Is=t(47603);const es=(0,D.Z)(m=>({root:{backgroundColor:"rgba(0, 0, 0, .11)",boxShadow:"none",margin:m.spacing(1,0,1,0)},title:{margin:m.spacing(1,0,0,1),textTransform:"uppercase",fontSize:12,fontWeight:"bold"},listIcon:{minWidth:30,color:m.palette.text.primary},menuItem:{minHeight:m.spacing(6)},groupWrapper:{margin:m.spacing(1,1,2,1)}}),{name:"CatalogReactUserListPicker"});function Rs(m){return[{name:"Personal",items:[{id:"owned",label:"Owned",icon:Is.Z},{id:"starred",label:"Starred",icon:Rn.Z}]},{name:m!=null?m:"Company",items:[{id:"all",label:"All"}]}]}const zs=m=>{const{initialFilter:y,availableFilters:I}=m,B=es(),Q=(0,r.h_)(r.Ds);var J;const ie=(J=Q.getOptionalString("organization.name"))!==null&&J!==void 0?J:"Company",{filters:le,updateFilters:Se,backendEntities:Te,queryParameters:{kind:we,user:je},loading:Ve}=hn(),rt=["starred","all"],dt=Rs(ie).map(sn=>({...sn,items:sn.items.filter(({id:Pn})=>["group","user"].some(gr=>gr===we)?rt.includes(Pn):!I||I.includes(Pn))})).filter(({items:sn})=>!!sn.length),{isStarredEntity:Ze}=me(),{isOwnedEntity:Rt,loading:Gt}=Ue(),Ln=Ve||Gt,jn=(0,P.useMemo)(()=>new tt("owned",Rt,Ze),[Rt,Ze]),ar=(0,P.useMemo)(()=>new tt("starred",Rt,Ze),[Rt,Ze]),En=(0,P.useMemo)(()=>[je].flat()[0],[je]),[Zn,Vn]=(0,P.useState)(En!=null?En:y),jr=(0,P.useMemo)(()=>Te.filter(vt((0,Wt.compact)(Object.values({...le,user:void 0})))),[le,Te]),fr=(0,P.useMemo)(()=>({all:jr.length,starred:jr.filter(sn=>ar.filterEntity(sn)).length,owned:jr.filter(sn=>jn.filterEntity(sn)).length}),[jr,ar,jn]);(0,P.useEffect)(()=>{En&&Vn(En)},[En]),(0,P.useEffect)(()=>{!Ln&&!!Zn&&Zn!=="all"&&fr[Zn]===0&&Vn("all")},[Ln,fr,Zn,Vn]),(0,P.useEffect)(()=>{Se({user:Zn?new tt(Zn,Rt,Ze):void 0})},[Zn,Rt,Ze,Se]);var ts;return(0,c.jsx)(Or.Z,{className:B.root,children:dt.map(sn=>(0,c.jsxs)(P.Fragment,{children:[(0,c.jsx)(Y.Z,{variant:"subtitle2",component:"span",className:B.title,children:sn.name}),(0,c.jsx)(Or.Z,{className:B.groupWrapper,children:(0,c.jsx)(Jn.Z,{disablePadding:!0,dense:!0,role:"menu","aria-label":sn.name,children:sn.items.map(Pn=>{var gr;return(0,c.jsxs)(wr.Z,{role:"none presentation",button:!0,divider:!0,onClick:()=>Vn(Pn.id),selected:Pn.id===((gr=le.user)===null||gr===void 0?void 0:gr.value),className:B.menuItem,disabled:fr[Pn.id]===0,"data-testid":`user-picker-${Pn.id}`,tabIndex:0,ContainerProps:{role:"menuitem"},children:[Pn.icon&&(0,c.jsx)(pr.Z,{className:B.listIcon,children:(0,c.jsx)(Pn.icon,{fontSize:"small"})}),(0,c.jsx)(Hr.Z,{children:(0,c.jsxs)(Y.Z,{variant:"body1",children:[Pn.label," "]})}),(0,c.jsx)(Ms.Z,{children:(ts=fr[Pn.id])!==null&&ts!==void 0?ts:"-"})]},Pn.id)})})})]},sn.name))})},Ls=(0,D.Z)({input:{}},{name:"CatalogReactEntityProcessingStatusPickerPicker"}),Ws=(0,c.jsx)($e.Z,{fontSize:"small"}),Vs=(0,c.jsx)(be.Z,{fontSize:"small"}),Ps=()=>{const m=Ls(),{updateFilters:y}=hn(),[I,B]=(0,P.useState)([]);function Q(le){y({orphan:le?new yt(le):void 0})}function J(le){y({error:le?new Zt(le):void 0})}const ie=["Is Orphan","Has Error"];return(0,c.jsx)(F.Z,{pb:1,pt:1,children:(0,c.jsxs)(Y.Z,{variant:"button",component:"label",children:["Processing Status",(0,c.jsx)(We.ZP,{multiple:!0,options:ie,value:I,onChange:(le,Se)=>{B(Se),Q(Se.includes("Is Orphan")),J(Se.includes("Has Error"))},renderOption:(le,{selected:Se})=>(0,c.jsx)(M.Z,{control:(0,c.jsx)(he.Z,{icon:Ws,checkedIcon:Vs,checked:Se}),label:le}),size:"small",popupIcon:(0,c.jsx)(Ae.Z,{"data-testid":"processing-status-picker-expand"}),renderInput:le=>(0,c.jsx)(fe.Z,{...le,className:m.input,variant:"outlined"})})]})})},Hs=({children:m,value:y})=>{var I;const[B,Q]=useState((I=y==null?void 0:y.filters)!==null&&I!==void 0?I:{}),J=useCallback(rt=>{Q(dt=>{const Ze=typeof rt=="function"?rt(dt):rt;return{...dt,...Ze}})},[]),ie=useMemo(()=>({entities:[],backendEntities:[],queryParameters:{}}),[]);var le,Se,Te,we,je;const Ve=useMemo(()=>({entities:(le=y==null?void 0:y.entities)!==null&&le!==void 0?le:ie.entities,backendEntities:(Se=y==null?void 0:y.backendEntities)!==null&&Se!==void 0?Se:ie.backendEntities,updateFilters:(Te=y==null?void 0:y.updateFilters)!==null&&Te!==void 0?Te:J,filters:B,loading:(we=y==null?void 0:y.loading)!==null&&we!==void 0?we:!1,queryParameters:(je=y==null?void 0:y.queryParameters)!==null&&je!==void 0?je:ie.queryParameters,error:y==null?void 0:y.error}),[y,ie,B,J]);return _jsx(EntityListContext.Provider,{value:Ve,children:m})}},33414:function(At,Fe,t){"use strict";t.r(Fe),t.d(Fe,{AboutCard:function(){return mt},AboutContent:function(){return _e},AboutField:function(){return z}});var h=t(52322),r=t(25271),W=t(93414),k=t(25248),g=t(32838),b=t(56941),c=t(79692),P=t(94339),te=t(32552),_=t(61837),X=t(85256),U=t(24579),F=t(52866),Y=t(30254),ce=t(27604),se=t(2784),T=t(19625),R=t(60905),V=t(90436),A=t(7089);const C=(0,c.Z)(Ee=>({value:{fontWeight:"bold",overflow:"hidden",lineHeight:"24px",wordBreak:"break-word"},label:{color:Ee.palette.text.secondary,textTransform:"uppercase",fontSize:"10px",fontWeight:"bold",letterSpacing:.5,overflow:"hidden",whiteSpace:"nowrap"}}));function z(Ee){const{label:Ke,value:at,gridSizes:vt,children:it}=Ee,gt=C(),nt=(0,k.vJ)(it,bt=>bt.getElements()),Lt=nt.length>0?nt:(0,h.jsx)(V.Z,{variant:"body2",className:gt.value,children:at||"unknown"});return(0,h.jsxs)(R.Z,{item:!0,...vt,children:[(0,h.jsx)(V.Z,{variant:"h2",className:gt.label,children:Ke}),Lt]})}var Le=t(24851);const Xe=(0,c.Z)({description:{wordBreak:"break-word"}});function Qe(Ee,Ke,at){if(Ke==="url"||Ee.includes("://"))return Ee;const vt=at.type==="file"?`file://${at.target}`:at.target;return Ke==="file"||at.type==="file"?new URL(Ee,vt).href:vt}function _e(Ee){var Ke,at,vt,it,gt,nt,Lt,bt;const{entity:ze}=Ee,ne=Xe(),Pe=ze.kind.toLocaleLowerCase("en-US")==="system",ke=ze.kind.toLocaleLowerCase("en-US")==="resource",tt=ze.kind.toLocaleLowerCase("en-US")==="component",yt=ze.kind.toLocaleLowerCase("en-US")==="api",Zt=ze.kind.toLocaleLowerCase("en-US")==="template",pt=ze.kind.toLocaleLowerCase("en-US")==="location",Tt=ze.kind.toLocaleLowerCase("en-US")==="group",It=(0,b.hF)(ze,r.cz,{kind:"system"}),Ot=(0,b.hF)(ze,r.cz,{kind:"component"}),en=(0,b.hF)(ze,r.cz,{kind:"domain"}),Wt=(0,b.hF)(ze,r.S4);let Vt;try{Vt=(0,r.CV)(ze)}catch{Vt=void 0}return(0,h.jsxs)(R.Z,{container:!0,children:[(0,h.jsx)(z,{label:"Description",gridSizes:{xs:12},children:(0,h.jsx)(V.Z,{variant:"body2",paragraph:!0,className:ne.description,children:(ze==null||(Ke=ze.metadata)===null||Ke===void 0?void 0:Ke.description)||"No description"})}),(0,h.jsx)(z,{label:"Owner",value:"No Owner",gridSizes:{xs:12,sm:6,lg:4},children:Wt.length>0&&(0,h.jsx)(b.rI,{entityRefs:Wt,defaultKind:"group"})}),(Pe||en.length>0)&&(0,h.jsx)(z,{label:"Domain",value:"No Domain",gridSizes:{xs:12,sm:6,lg:4},children:en.length>0&&(0,h.jsx)(b.rI,{entityRefs:en,defaultKind:"domain"})}),(yt||tt||ke||It.length>0)&&(0,h.jsx)(z,{label:"System",value:"No System",gridSizes:{xs:12,sm:6,lg:4},children:It.length>0&&(0,h.jsx)(b.rI,{entityRefs:It,defaultKind:"system"})}),tt&&Ot.length>0&&(0,h.jsx)(z,{label:"Parent Component",value:"No Parent Component",gridSizes:{xs:12,sm:6,lg:4},children:(0,h.jsx)(b.rI,{entityRefs:Ot,defaultKind:"component"})}),(yt||tt||ke||Zt||Tt||pt||typeof(ze==null||(at=ze.spec)===null||at===void 0?void 0:at.type)=="string")&&(0,h.jsx)(z,{label:"Type",value:ze==null||(vt=ze.spec)===null||vt===void 0?void 0:vt.type,gridSizes:{xs:12,sm:6,lg:4}}),(yt||tt||typeof(ze==null||(it=ze.spec)===null||it===void 0?void 0:it.lifecycle)=="string")&&(0,h.jsx)(z,{label:"Lifecycle",value:ze==null||(gt=ze.spec)===null||gt===void 0?void 0:gt.lifecycle,gridSizes:{xs:12,sm:6,lg:4}}),(0,h.jsx)(z,{label:"Tags",value:"No Tags",gridSizes:{xs:12,sm:6,lg:4},children:((ze==null||(nt=ze.metadata)===null||nt===void 0?void 0:nt.tags)||[]).map(Qt=>(0,h.jsx)(A.Z,{size:"small",label:Qt},Qt))}),pt&&((ze==null||(Lt=ze.spec)===null||Lt===void 0?void 0:Lt.targets)||(ze==null||(bt=ze.spec)===null||bt===void 0?void 0:bt.target))&&(0,h.jsx)(z,{label:"Targets",gridSizes:{xs:12},children:(0,h.jsx)(Le.s,{cols:1,items:(ze.spec.targets||[ze.spec.target]).map(Qt=>Qt).map(Qt=>{var un;return{text:Qt,href:Qe(Qt,(ze==null||(un=ze.spec)===null||un===void 0?void 0:un.type)||"unknown",Vt)}})})})]})}const Ge=(0,c.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 mt(Ee){var Ke,at,vt;const{variant:it}=Ee,gt=Ge(),{entity:nt}=(0,b.X2)(),Lt=(0,k.h_)(g.q3),bt=(0,k.h_)(b.Ah),ze=(0,k.h_)(k.$v),ne=(0,k.h_)(k.VE),Pe=(0,k.tg)(T.jU),ke=(0,b.CV)(nt,Lt),tt=(Ke=nt.metadata.annotations)===null||Ke===void 0?void 0:Ke[r.Tf],yt={label:"View Source",disabled:!ke,icon:(0,h.jsx)(g.nW,{type:ke==null?void 0:ke.integrationType}),href:ke==null?void 0:ke.locationTargetUrl},Zt={label:"View TechDocs",disabled:!(!((at=nt.metadata.annotations)===null||at===void 0)&&at["backstage.io/techdocs-ref"])||!Pe,icon:(0,h.jsx)(Y.Z,{}),href:Pe&&Pe({namespace:nt.metadata.namespace||r.zG,kind:nt.kind,name:nt.metadata.name})};let pt="";it==="gridItem"?pt=gt.gridItemCard:it==="fullHeight"&&(pt=gt.fullHeightCard);let Tt="";it==="gridItem"?Tt=gt.gridItemCardContent:it==="fullHeight"&&(Tt=gt.fullHeightCardContent);const It=(vt=nt.metadata.annotations)===null||vt===void 0?void 0:vt[r.P1],Ot=(It==null?void 0:It.startsWith("url:"))||(It==null?void 0:It.startsWith("file:")),en=(0,se.useCallback)(async()=>{try{await bt.refreshEntity((0,r.eE)(nt)),ze.post({message:"Refresh scheduled",severity:"info"})}catch(Wt){ne.post(Wt)}},[bt,ze,ne,nt]);return(0,h.jsxs)(P.Z,{className:pt,children:[(0,h.jsx)(te.Z,{title:"About",action:(0,h.jsxs)(h.Fragment,{children:[Ot&&(0,h.jsx)(_.Z,{"aria-label":"Refresh",title:"Schedule entity refresh",onClick:en,children:(0,h.jsx)(F.Z,{})}),(0,h.jsx)(_.Z,{component:W.rU,"aria-label":"Edit",disabled:!tt,title:"Edit Metadata",to:tt!=null?tt:"#",children:(0,h.jsx)(ce.Z,{})})]}),subheader:(0,h.jsx)(W.M6,{links:[yt,Zt]})}),(0,h.jsx)(X.Z,{}),(0,h.jsx)(U.Z,{className:Tt,children:(0,h.jsx)(_e,{entity:nt})})]})}},86359:function(At,Fe,t){"use strict";t.d(Fe,{E:function(){return se}});var h=t(52322),r=t(25271),W=t(93414),k=t(56941),g=t(90436),b=t(15459),c=t(27604),P=t(2997),te=t(11640),_=t(28347),X=t(76635),U=t(2784),F=t(7089);const Y=Object.freeze({createNameColumn(T){function R(V){var A;return((A=V.metadata)===null||A===void 0?void 0:A.title)||(0,k.$3)(V,{defaultKind:T==null?void 0:T.defaultKind})}return{title:"Name",field:"resolved.name",highlight:!0,customSort({entity:V},{entity:A}){return R(V).localeCompare(R(A))},render:({entity:V})=>{var A;return(0,h.jsx)(k.dx,{entityRef:V,defaultKind:(T==null?void 0:T.defaultKind)||"Component",title:(A=V.metadata)===null||A===void 0?void 0:A.title})}}},createSystemColumn(){return{title:"System",field:"resolved.partOfSystemRelationTitle",render:({resolved:T})=>(0,h.jsx)(k.rI,{entityRefs:T.partOfSystemRelations,defaultKind:"system"})}},createOwnerColumn(){return{title:"Owner",field:"resolved.ownedByRelationsTitle",render:({resolved:T})=>(0,h.jsx)(k.rI,{entityRefs:T.ownedByRelations,defaultKind:"group"})}},createSpecTargetsColumn(){return{title:"Targets",field:"entity.spec.targets",render:({entity:T})=>{var R,V;return(0,h.jsx)(h.Fragment,{children:((T==null||(R=T.spec)===null||R===void 0?void 0:R.targets)||(T==null||(V=T.spec)===null||V===void 0?void 0:V.target))&&(0,h.jsx)(W.Or,{text:(T.spec.targets||[T.spec.target]).join(", "),placement:"bottom-start"})})}}},createSpecTypeColumn(){return{title:"Type",field:"entity.spec.type",hidden:!0,width:"auto"}},createSpecLifecycleColumn(){return{title:"Lifecycle",field:"entity.spec.lifecycle"}},createMetadataDescriptionColumn(){return{title:"Description",field:"entity.metadata.description",render:({entity:T})=>(0,h.jsx)(W.Or,{text:T.metadata.description,placement:"bottom-start"}),width:"auto"}},createTagsColumn(){return{title:"Tags",field:"entity.metadata.tags",cellStyle:{padding:"0px 16px 0px 20px"},render:({entity:T})=>(0,h.jsx)(h.Fragment,{children:T.metadata.tags&&T.metadata.tags.map(R=>(0,h.jsx)(F.Z,{label:R,size:"small",variant:"outlined",style:{marginBottom:"0px"}},R))}),width:"auto"}},createTitleColumn(T){return{title:"Title",field:"entity.metadata.title",hidden:T==null?void 0:T.hidden,searchable:!0}},createLabelColumn(T,R){return{title:(R==null?void 0:R.title)||"Label",field:"entity.metadata.labels",cellStyle:{padding:"0px 16px 0px 20px"},render:({entity:V})=>{var A;const C=(A=V.metadata)===null||A===void 0?void 0:A.labels,z=C&&C[T]||(R==null?void 0:R.defaultValue);return(0,h.jsx)(h.Fragment,{children:z&&(0,h.jsx)(F.Z,{label:z,size:"small",variant:"outlined"},z)})},width:"auto"}}}),ce=(0,b.Z)({root:{color:"#f3ba37"}})(te.Z),se=T=>{var R,V;const{columns:A,actions:C,tableOptions:z,subtitle:Le,emptyContent:Xe}=T,{isStarredEntity:Qe,toggleStarredEntity:_e}=(0,k.CR)(),{loading:Ge,error:mt,entities:Ee,filters:Ke}=(0,k.wp)(),at=(0,U.useMemo)(()=>{var ne;return[Y.createTitleColumn({hidden:!0}),Y.createNameColumn({defaultKind:(ne=Ke.kind)===null||ne===void 0?void 0:ne.value}),...Pe(),Y.createMetadataDescriptionColumn(),Y.createTagsColumn()];function Pe(){var ke;switch((ke=Ke.kind)===null||ke===void 0?void 0:ke.value){case"user":return[];case"domain":case"system":return[Y.createOwnerColumn()];case"group":case"template":return[Y.createSpecTypeColumn()];case"location":return[Y.createSpecTypeColumn(),Y.createSpecTargetsColumn()];default:return[Y.createSystemColumn(),Y.createOwnerColumn(),Y.createSpecTypeColumn(),Y.createSpecLifecycleColumn()]}}},[(R=Ke.kind)===null||R===void 0?void 0:R.value]),vt=Ke.type===void 0;var it;const gt=(0,X.capitalize)((it=(V=Ke.user)===null||V===void 0?void 0:V.value)!==null&&it!==void 0?it:"all");if(mt)return(0,h.jsx)("div",{children:(0,h.jsx)(W.GB,{severity:"error",title:"Could not fetch catalog entities.",children:(0,h.jsx)(W.Oi,{language:"text",text:mt.toString()})})});const nt=[({entity:ne})=>{var Pe;const ke=(Pe=ne.metadata.annotations)===null||Pe===void 0?void 0:Pe[r.l2],tt="View";return{icon:()=>(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(g.Z,{variant:"srOnly",children:tt}),(0,h.jsx)(P.Z,{fontSize:"small"})]}),tooltip:tt,disabled:!ke,onClick:()=>{!ke||window.open(ke,"_blank")}}},({entity:ne})=>{var Pe;const ke=(Pe=ne.metadata.annotations)===null||Pe===void 0?void 0:Pe[r.Tf],tt="Edit";return{icon:()=>(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(g.Z,{variant:"srOnly",children:tt}),(0,h.jsx)(c.Z,{fontSize:"small"})]}),tooltip:tt,disabled:!ke,onClick:()=>{!ke||window.open(ke,"_blank")}}},({entity:ne})=>{const Pe=Qe(ne),ke=Pe?"Remove from favorites":"Add to favorites";return{cellStyle:{paddingLeft:"1em"},icon:()=>(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(g.Z,{variant:"srOnly",children:ke}),Pe?(0,h.jsx)(ce,{}):(0,h.jsx)(_.Z,{})]}),tooltip:ke,onClick:()=>_e(ne)}}],Lt=Ee.map(ne=>{const Pe=(0,k.hF)(ne,r.cz,{kind:"system"}),ke=(0,k.hF)(ne,r.S4);return{entity:ne,resolved:{name:(0,k.$3)(ne,{defaultKind:"Component"}),ownedByRelationsTitle:ke.map(tt=>(0,k.$3)(tt,{defaultKind:"group"})).join(", "),ownedByRelations:ke,partOfSystemRelationTitle:Pe.map(tt=>(0,k.$3)(tt,{defaultKind:"system"})).join(", "),partOfSystemRelations:Pe}}}),bt=(A||at).find(ne=>ne.title==="Type");bt&&(bt.hidden=!vt);const ze=Lt.length>20;return(0,h.jsx)(W.iA,{isLoading:Ge,columns:A||at,options:{paging:ze,pageSize:20,actionsColumnIndex:-1,loadingType:"linear",showEmptyDataSourceMessage:!Ge,padding:"dense",pageSizeOptions:[20,50,100],...z},title:`${gt} (${Ee.length})`,data:Lt,actions:C||nt,subtitle:Le,emptyContent:Xe})};se.columns=Y},85877:function(At,Fe,t){"use strict";t.r(Fe),t.d(Fe,{EntityLabelsCard:function(){return U},hasLabels:function(){return F}});var h=t(52322),r=t(56941),W=t(2784),k=t(93414),g=t(79692),b=t(90436),c=t(77277);const P=`metadata:
|
|
34
34
|
name: example
|
|
35
35
|
labels:
|
|
36
|
-
javaVersion: 1.2.3`,te=(0,g.Z)(Y=>({code:{borderRadius:6,margin:`${Y.spacing(2)}px 0px`,background:Y.palette.type==="dark"?"#444":"#fff"}}),{name:"PluginCatalogEntityLabelsEmptyState"});function _(){const Y=te();return(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(b.Z,{variant:"body1",children:"No labels defined for this entity. You can add labels to your entity YAML as shown in the highlighted example below:"}),(0,h.jsx)("div",{className:Y.code,children:(0,h.jsx)(k.Oi,{text:P,language:"yaml",showLineNumbers:!0,highlightedNumbers:[3,4,5,6],customStyle:{background:"inherit",fontSize:"115%"}})}),(0,h.jsx)(c.Z,{variant:"contained",color:"primary",target:"_blank",href:"https://backstage.io/docs/features/software-catalog/descriptor-format#labels-optional",children:"Read more"})]})}const X=(0,g.Z)(Y=>({key:{fontWeight:"bold"}})),U=Y=>{var ce;const{variant:oe,title:T}=Y,{entity:R}=(0,r.X2)(),V=X(),A=[{render:z=>(0,h.jsx)(b.Z,{className:V.key,variant:"body2",children:z.key})},{field:"value"}],C=R==null||(ce=R.metadata)===null||ce===void 0?void 0:ce.labels;return(0,h.jsx)(k.rJ,{title:T||"Labels",variant:oe,children:!C||Object.keys(C).length===0?(0,h.jsx)(_,{}):(0,h.jsx)(k.iA,{columns:A,data:Object.keys(C).map(z=>({key:z,value:C[z]})),options:{search:!1,showTitle:!0,loadingType:"linear",header:!1,padding:"dense",pageSize:5,toolbar:!1,paging:Object.keys(C).length>5}})})};function F(Y){var ce,oe;return!(Y==null||(ce=Y.metadata)===null||ce===void 0)&&ce.labels?Object.keys(Y==null||(oe=Y.metadata)===null||oe===void 0?void 0:oe.labels).some(Boolean):!1}},24851:function(At,Fe,t){"use strict";t.d(Fe,{s:function(){return ce}});var h=t(52322),r=t(90348),W=t(11861),k=t(2784),g=t(79692),b=t(95544),c=t(90436),P=t(52160),te=t(93414);const _=(0,g.Z)({svgIcon:{display:"inline-block","& svg":{display:"inline-block",fontSize:"inherit",verticalAlign:"baseline"}}});function X(oe){const{href:T,text:R,Icon:V}=oe,A=_();return(0,h.jsxs)(b.Z,{display:"flex",children:[(0,h.jsx)(b.Z,{mr:1,className:A.svgIcon,children:(0,h.jsx)(c.Z,{component:"div",children:V?(0,h.jsx)(V,{}):(0,h.jsx)(P.Z,{})})}),(0,h.jsx)(b.Z,{flexGrow:"1",children:(0,h.jsx)(te.rU,{to:T,target:"_blank",rel:"noopener",children:R||T})})]})}var U=t(41156);const F={xs:1,sm:1,md:1,lg:2,xl:3};function Y(oe){const T=[(0,U.Z)(C=>C.breakpoints.up("xl"))?"xl":null,(0,U.Z)(C=>C.breakpoints.up("lg"))?"lg":null,(0,U.Z)(C=>C.breakpoints.up("md"))?"md":null,(0,U.Z)(C=>C.breakpoints.up("sm"))?"sm":null,(0,U.Z)(C=>C.breakpoints.up("xs"))?"xs":null];let R=1;if(typeof oe=="number")R=oe;else{var V;const C=(V=T.find(z=>z!==null))!==null&&V!==void 0?V:"xs";var A;R=(A=oe==null?void 0:oe[C])!==null&&A!==void 0?A:F[C]}return R}function ce(oe){const{items:T,cols:R=void 0}=oe,V=Y(R);return(0,h.jsx)(r.Z,{rowHeight:"auto",cols:V,children:T.map(({text:A,href:C,Icon:z},Le)=>(0,h.jsx)(W.Z,{children:(0,h.jsx)(X,{href:C,text:A!=null?A:C,Icon:z})},Le))})}},19625:function(At,Fe,t){"use strict";t.d(Fe,{_Z:function(){return k},jU:function(){return W},yw:function(){return r}});var h=t(25248);const r=(0,h.x8)({id:"create-component",optional:!0}),W=(0,h.x8)({id:"view-techdoc",optional:!0,params:["namespace","kind","name"]}),k=(0,h.NT)({id:"catalog"})},51666:function(At,Fe,t){"use strict";t.d(Fe,{rG:function(){return h},Y2:function(){return V},J$:function(){return te},g2:function(){return W}});var h;(function(A){A.DENY="DENY",A.ALLOW="ALLOW",A.CONDITIONAL="CONDITIONAL"})(h||(h={}));function r(A,C){return A.name===C.name}function W(A,C){return"resourceType"in A?!C||A.resourceType===C:!1}function k(A){return A.attributes.action==="create"}function g(A){return A.attributes.action==="read"}function b(A){return A.attributes.action==="update"}function c(A){return A.attributes.action==="delete"}function P(A){return{authorize:async(C,z)=>await A.authorize(C,z),authorizeConditional(C,z){const Le=C;return A.authorize(Le,z)}}}function te({name:A,attributes:C,resourceType:z}){return z?{type:"resource",name:A,attributes:C,resourceType:z}:{type:"basic",name:A,attributes:C}}var _=t(23054),X=t(96279),U=t.n(X),F=t(9571),Y=t(30195);const ce=Y.z.lazy(()=>Y.z.object({rule:Y.z.string(),resourceType:Y.z.string(),params:Y.z.record(Y.z.any()).optional()}).or(Y.z.object({anyOf:Y.z.array(ce).nonempty()})).or(Y.z.object({allOf:Y.z.array(ce).nonempty()})).or(Y.z.object({not:ce}))),oe=Y.z.object({result:Y.z.literal(h.ALLOW).or(Y.z.literal(h.DENY))}),T=Y.z.union([Y.z.object({result:Y.z.literal(h.ALLOW).or(Y.z.literal(h.DENY))}),Y.z.object({result:Y.z.literal(h.CONDITIONAL),pluginId:Y.z.string(),resourceType:Y.z.string(),conditions:ce})]),R=(A,C)=>Y.z.object({items:Y.z.array(Y.z.intersection(Y.z.object({id:Y.z.string()}),A)).refine(z=>z.length===C.size&&z.every(({id:Le})=>C.has(Le)),{message:"Items in response do not match request"})});class V{async authorize(C,z){return this.makeRequest(C,oe,z)}async authorizeConditional(C,z){return this.makeRequest(C,T,z)}async makeRequest(C,z,Le){if(!this.enabled)return C.map(Ke=>({result:h.ALLOW}));const Xe={items:C.map(Ke=>({id:F.Z(),...Ke}))},Qe=await this.discovery.getBaseUrl("permission"),_e=await U()(`${Qe}/authorize`,{method:"POST",body:JSON.stringify(Xe),headers:{...this.getAuthorizationHeader(Le==null?void 0:Le.token),"content-type":"application/json"}});if(!_e.ok)throw await _.VL.fromResponse(_e);const Ge=await _e.json(),Ee=R(z,new Set(Xe.items.map(({id:Ke})=>Ke))).parse(Ge).items.reduce((Ke,it)=>(Ke[it.id]=it,Ke),{});return Xe.items.map(Ke=>Ee[Ke.id])}getAuthorizationHeader(C){return C?{Authorization:`Bearer ${C}`}:{}}constructor(C){this.discovery=C.discovery;var z;this.enabled=(z=C.config.getOptionalBoolean("permission.enabled"))!==null&&z!==void 0?z:!1}}},25488:function(At,Fe,t){"use strict";t.d(Fe,{iM:function(){return b},RV:function(){return k},gI:function(){return P}});var h=t(52322),r=t(2784),W=t(25248);const k=(0,W.T0)({id:"plugin.permission.api"});var g=t(51666);class b{static create(U){const{config:F,discovery:Y,identity:ce}=U,oe=new g.Y2({discovery:Y,config:F});return new b(oe,ce)}async authorize(U){return(await this.permissionClient.authorize([U],await this.identityApi.getCredentials()))[0]}constructor(U,F){this.permissionClient=U,this.identityApi=F}}var c=t(69984);function P(X){const U=(0,W.h_)(k),{data:F,error:Y}=(0,c.ZP)(X,async ce=>{if((0,g.g2)(ce.permission)&&!ce.resourceRef)return g.rG.DENY;const{result:oe}=await U.authorize(ce);return oe});return Y?{error:Y,loading:!1,allowed:!1}:F===void 0?{loading:!0,allowed:!1}:{loading:!1,allowed:F===g.rG.ALLOW}}const te=X=>{const{permission:U,resourceRef:F,errorComponent:Y,...ce}=X,oe=usePermission(isResourcePermission(U)?{permission:U,resourceRef:F}:{permission:U}),T=useApp(),{NotFoundErrorPage:R}=T.getComponents();let V=Y===void 0?_jsx(R,{}):Y;return oe.loading?V=null:oe.allowed&&(V=X.element),_jsx(Route,{...ce,element:V})};function _(X){const{permission:U,resourceRef:F}=X,Y=usePermission(isResourcePermission(U)?{permission:U,resourceRef:F}:{permission:U}),ce=useApp();if(Y.loading)return null;if(Y.allowed)return _jsx(_Fragment,{children:X.children});if(X.errorPage)return _jsx(_Fragment,{children:X.errorPage});const{NotFoundErrorPage:oe}=ce.getComponents();return _jsx(oe,{})}},65826:function(At,Fe,t){"use strict";t.d(Fe,{FA:function(){return P},qO:function(){return ot},Nd:function(){return Qe},Rx:function(){return A}});var h=t(25248);const r=(0,h.T0)({id:"plugin.search.queryservice"});class W{query(){return Promise.resolve(this.mockedResults||{results:[]})}constructor(M){this.mockedResults=M}}var k=t(52322),g=t(2784),b=t(79692);const c=(0,b.Z)(()=>({highlight:{}}),{name:"BackstageHighlightedSearchResultText"}),P=({text:D,preTag:M,postTag:ue})=>{const fe=c(),be=(0,g.useMemo)(()=>D.split(new RegExp(`(${M}.+?${ue})`)),[ue,M,D]);return(0,k.jsx)(k.Fragment,{children:be.map(($e,Ae)=>$e.includes(M)?(0,k.jsx)("mark",{className:fe.highlight,children:$e.replace(new RegExp(`${M}|${ue}`,"g"),"")},Ae):$e)})};var te=t(48760),_=t(50581),X=t(61837),U=t(74603),F=t(21853),Y=t(33375),ce=t(76635),oe=t(64279),T=t(1849),R=t(51837);const V=(0,R.CT)("search-context"),A=()=>{const D=(0,g.useContext)(V);if(!D)throw new Error("useSearch must be used within a SearchContextProvider");const M=D.atVersion(1);if(!M)throw new Error("No SearchContext v1 found");return M},C=()=>(0,g.useContext)(V)!==void 0,z={term:"",types:[],filters:{},pageLimit:void 0,pageCursor:void 0},Le=(D=z)=>{var M,ue,fe,be;const $e=(0,h.h_)(r),[Ae,We]=(0,g.useState)(D.term),[rt,S]=(0,g.useState)(D.types),[G,me]=(0,g.useState)(D.filters),[he,Ce]=(0,g.useState)(D.pageLimit),[Oe,Me]=(0,g.useState)(D.pageCursor),dt=(0,T.Z)(Ae),jt=(0,T.Z)(G),at=(0,oe.default)(()=>$e.query({term:Ae,types:rt,filters:G,pageLimit:he,pageCursor:Oe}),[Ae,rt,G,he,Oe]),pt=!at.loading&&!at.error&&((M=at.value)===null||M===void 0?void 0:M.nextPageCursor),yt=!at.loading&&!at.error&&((ue=at.value)===null||ue===void 0?void 0:ue.previousPageCursor),lt=(0,g.useCallback)(()=>{var zt;Me((zt=at.value)===null||zt===void 0?void 0:zt.nextPageCursor)},[(fe=at.value)===null||fe===void 0?void 0:fe.nextPageCursor]),Bt=(0,g.useCallback)(()=>{var zt;Me((zt=at.value)===null||zt===void 0?void 0:zt.previousPageCursor)},[(be=at.value)===null||be===void 0?void 0:be.previousPageCursor]);return(0,g.useEffect)(()=>{dt!==void 0&&Ae!==dt&&Me(void 0)},[Ae,dt,Me]),(0,g.useEffect)(()=>{jt!==void 0&&!(0,ce.isEqual)(G,jt)&&Me(void 0)},[G,jt,Me]),{result:at,term:Ae,setTerm:We,types:rt,setTypes:S,filters:G,setFilters:me,pageLimit:he,setPageLimit:Ce,pageCursor:Oe,setPageCursor:Me,fetchNextPage:pt?lt:void 0,fetchPreviousPage:yt?Bt:void 0}},Xe=D=>{const{initialState:M,children:ue}=D,fe=Le(M);return(0,k.jsx)(h.fC,{attributes:{searchTypes:fe.types.sort().join(",")},children:(0,k.jsx)(V.Provider,{value:(0,R.EI)({1:fe}),children:ue})})},Qe=D=>{const{initialState:M,inheritParentContextIfAvailable:ue,children:fe}=D;return C()&&ue?(0,k.jsx)(k.Fragment,{children:fe}):(0,k.jsx)(Xe,{initialState:M,children:fe})},_e=({children:D})=>{var M;const ue=G=>(0,T.Z)(G)!==G,fe=(0,h.z$)(),{term:be,result:$e}=A();var Ae;const We=(Ae=(M=$e.value)===null||M===void 0?void 0:M.numberOfResults)!==null&&Ae!==void 0?Ae:void 0,S=ue($e.loading)&&!$e.loading;return(0,g.useEffect)(()=>{be&&S&&fe.captureEvent("search",be,{value:We})},[fe,be,We,S]),(0,k.jsx)(k.Fragment,{children:D})};function Ge(D){return(0,g.forwardRef)((M,ue)=>(0,k.jsx)(Qe,{inheritParentContextIfAvailable:!0,children:(0,k.jsx)(D,{...M,ref:ue})}))}const gt=Ge((0,g.forwardRef)((D,M)=>{const{onChange:ue,onKeyDown:fe=()=>{},onClear:be=()=>{},onSubmit:$e=()=>{},debounceTime:Ae=200,clearButton:We=!0,fullWidth:rt=!0,value:S,placeholder:G,inputProps:me={},endAdornment:he,...Ce}=D,Oe=(0,h.h_)(h.Ds),[Me,dt]=(0,g.useState)("");(0,g.useEffect)(()=>{dt(Mt=>Mt!==S?String(S):Mt)},[S]),(0,te.Z)(()=>ue(Me),Ae,[Me]);const jt=(0,g.useCallback)(Mt=>{dt(Mt.target.value)},[dt]),at=(0,g.useCallback)(Mt=>{fe&&fe(Mt),$e&&Mt.key==="Enter"&&$e()},[fe,$e]),pt=(0,g.useCallback)(()=>{ue(""),be&&be()},[ue,be]),yt=G!=null?G:`Search in ${Oe.getOptionalString("app.title")||"Backstage"}`,lt=(0,k.jsx)(_.Z,{position:"start",children:(0,k.jsx)(X.Z,{"aria-label":"Query",size:"small",disabled:!0,children:(0,k.jsx)(F.Z,{})})}),Bt=(0,k.jsx)(_.Z,{position:"end",children:(0,k.jsx)(X.Z,{"aria-label":"Clear",size:"small",onClick:pt,children:(0,k.jsx)(Y.Z,{})})});return(0,k.jsx)(_e,{children:(0,k.jsx)(U.Z,{"data-testid":"search-bar-next",ref:M,value:Me,placeholder:yt,startAdornment:lt,endAdornment:We?Bt:he,inputProps:{"aria-label":"Search",...me},fullWidth:rt,onChange:jt,onKeyDown:at,...Ce})})})),Ee=Ge((0,g.forwardRef)((D,M)=>{const{value:ue="",onChange:fe,...be}=D,{term:$e,setTerm:Ae}=A();(0,g.useEffect)(()=>{ue&&Ae(String(ue))},[ue,Ae]);const We=(0,g.useCallback)(rt=>{fe?fe(rt):Ae(rt)},[fe,Ae]);return(0,k.jsx)(h.fC,{attributes:{pluginId:"search",extension:"SearchBar"},children:(0,k.jsx)(gt,{...be,ref:M,value:$e,onChange:We})})}));var Ke=t(4614),it=t(88013);const ot=(D=>M=>(0,k.jsx)(Qe,{inheritParentContextIfAvailable:!0,children:(0,k.jsx)(D,{...M})}))(function(M){const{loading:ue,value:fe,onChange:be=()=>{},options:$e=[],getOptionLabel:Ae=pt=>String(pt),inputPlaceholder:We,inputDebounceTime:rt,freeSolo:S=!0,fullWidth:G=!0,clearOnBlur:me=!1,"data-testid":he="search-autocomplete",...Ce}=M,{setTerm:Oe}=A(),Me=(0,g.useCallback)(pt=>pt?typeof pt=="string"?pt:Ae(pt):"",[Ae]),dt=(0,g.useMemo)(()=>Me(fe),[fe,Me]),jt=(0,g.useCallback)((pt,yt,lt,Bt)=>{Oe(Me(yt)),be(pt,yt,lt,Bt)},[Me,Oe,be]),at=(0,g.useCallback)(({InputProps:{ref:pt,endAdornment:yt},InputLabelProps:lt,...Bt})=>(0,k.jsx)(Ee,{...Bt,ref:pt,clearButton:!1,value:dt,placeholder:We,debounceTime:rt,endAdornment:ue?(0,k.jsx)(Ke.Z,{"data-testid":"search-autocomplete-progressbar",color:"inherit",size:20}):yt}),[ue,dt,We,rt]);return(0,k.jsx)(it.ZP,{...Ce,"data-testid":he,value:fe,onChange:jt,options:$e,getOptionLabel:Ae,renderInput:at,freeSolo:S,fullWidth:G,clearOnBlur:me})}),ft=({icon:D,primaryText:M,primaryTextTypographyProps:ue,secondaryText:fe,secondaryTextTypographyProps:be,disableTextTypography:$e})=>_jsxs(_Fragment,{children:[D?_jsx(ListItemIcon,{children:D}):null,_jsx(ListItemText,{primary:M,primaryTypographyProps:ue,secondary:fe,secondaryTypographyProps:be,disableTypography:$e})]});var nt=t(42494),Lt=t(84899),bt=t(5806),ze=t(21324),ne=t(56939),Pe=t(73698),ke=t(12231),tt=t(86619),vt=t(7089),Zt=t(69294);const ut=(D,M,ue=[],fe=250)=>{const be=(0,g.useRef)({}),$e=D||(()=>Promise.resolve([])),[Ae,We]=(0,Zt.default)($e,[M],{loading:!0});if((0,te.Z)(()=>{be.current[M]===void 0&&(be.current[M]=We(M).then(S=>(be.current[M]=S,S)))},fe,[We,M]),ue.length)return{loading:!1,value:ue};const rt=be.current[M];return Array.isArray(rt)?{loading:!1,value:rt}:Ae},Tt=(D,M)=>{const{setFilters:ue}=A();(0,g.useEffect)(()=>{M&&[M].flat().length>0&&ue(fe=>({...fe,[D]:M}))},[])},It=D=>{const{className:M,defaultValue:ue,name:fe,values:be,valuesDebounceMs:$e,label:Ae,filterSelectedOptions:We,limitTags:rt,multiple:S}=D,[G,me]=(0,g.useState)("");Tt(fe,ue);const he=typeof be=="function"?be:void 0,Ce=typeof be=="function"?void 0:be,{value:Oe,loading:Me}=ut(he,G,Ce,$e),{filters:dt,setFilters:jt}=A(),at=dt[fe]||(S?[]:null),pt=(Bt,Mt)=>{jt(zt=>{const{[fe]:qt,...Wn}=zt;return Mt?{...Wn,[fe]:Mt}:{...Wn}})},yt=Bt=>(0,k.jsx)(tt.Z,{...Bt,name:"search",variant:"outlined",label:Ae,fullWidth:!0}),lt=(Bt,Mt)=>Bt.map((zt,qt)=>(0,k.jsx)(vt.Z,{label:zt,color:"primary",...Mt({index:qt})}));return(0,k.jsx)(it.ZP,{filterSelectedOptions:We,limitTags:rt,multiple:S,className:M,id:`${S?"multi-":""}select-filter-${fe}--select`,options:Oe||[],loading:Me,value:at,onChange:pt,onInputChange:(Bt,Mt)=>me(Mt),renderInput:yt,renderTags:lt})},Ot=(0,b.Z)({label:{textTransform:"capitalize"}}),en=D=>{const{className:M,defaultValue:ue,label:fe,name:be,values:$e=[],valuesDebounceMs:Ae}=D,We=Ot(),{filters:rt,setFilters:S}=A();Tt(be,ue);const G=typeof $e=="function"?$e:void 0,me=typeof $e=="function"?void 0:$e,{value:he=[],loading:Ce}=ut(G,"",me,Ae),Oe=dt=>{const{target:{value:jt,checked:at}}=dt;S(pt=>{const{[be]:yt,...lt}=pt,Bt=(yt||[]).filter(zt=>zt!==jt),Mt=at?[...Bt,jt]:Bt;return Mt.length?{...lt,[be]:Mt}:lt})};var Me;return(0,k.jsxs)(nt.Z,{className:M,disabled:Ce,fullWidth:!0,"data-testid":"search-checkboxfilter-next",children:[fe?(0,k.jsx)(Lt.Z,{className:We.label,children:fe}):null,he.map(dt=>(0,k.jsx)(bt.Z,{control:(0,k.jsx)(ze.Z,{color:"primary",tabIndex:-1,inputProps:{"aria-labelledby":dt},value:dt,name:dt,onChange:Oe,checked:((Me=rt[be])!==null&&Me!==void 0?Me:[]).includes(dt)}),label:dt},dt))]})},Wt=D=>{const{className:M,defaultValue:ue,label:fe,name:be,values:$e,valuesDebounceMs:Ae}=D,We=Ot();Tt(be,ue);const rt=typeof $e=="function"?$e:void 0,S=typeof $e=="function"?void 0:$e,{value:G=[],loading:me}=ut(rt,"",S,Ae),{filters:he,setFilters:Ce}=A(),Oe=Me=>{const{target:{value:dt}}=Me;Ce(jt=>{const{[be]:at,...pt}=jt;return dt?{...pt,[be]:dt}:pt})};return(0,k.jsxs)(nt.Z,{disabled:me,className:M,variant:"filled",fullWidth:!0,"data-testid":"search-selectfilter-next",children:[fe?(0,k.jsx)(ne.Z,{className:We.label,margin:"dense",children:fe}):null,(0,k.jsxs)(Pe.Z,{variant:"outlined",value:he[be]||"",onChange:Oe,children:[(0,k.jsx)(ke.Z,{value:"",children:(0,k.jsx)("em",{children:"All"})}),G.map(Me=>(0,k.jsx)(ke.Z,{value:Me,children:Me},Me))]})]})},Vt=({component:D,...M})=>(0,k.jsx)(D,{...M});Vt.Checkbox=D=>(0,k.jsx)(Vt,{...D,component:en}),Vt.Select=D=>(0,k.jsx)(Vt,{...D,component:Wt}),Vt.Autocomplete=D=>(0,k.jsx)(Vt,{...D,component:It});var Qt=t(93414);const un=D=>{const{children:M}=D,fe=useSearch().result;return M(fe)},cn=D=>{const{query:M,children:ue}=D,fe=useApi(searchApiRef),be=useAsync(()=>{const{term:$e="",types:Ae=[],filters:We={},...rt}=M;return fe.query({...rt,term:$e,types:Ae,filters:We})},[M]);return ue(be)},Fn=D=>{const{query:M,children:ue}=D;return M?_jsx(cn,{query:M,children:ue}):_jsx(un,{children:ue})},In=D=>{const{query:M,children:ue,noResultsComponent:fe=_jsx(EmptyState,{missing:"data",title:"Sorry, no results were found"})}=D;return _jsx(Fn,{query:M,children:({loading:be,error:$e,value:Ae})=>be?_jsx(Progress,{}):$e?_jsx(ResponseErrorPanel,{title:"Error encountered while fetching search results",error:$e}):Ae!=null&&Ae.results.length?ue(Ae):fe})},Un=D=>_jsx(AnalyticsContext,{attributes:{pluginId:"search",extension:"SearchResult"},children:_jsx(In,{...D})}),vn=(0,b.Z)(D=>({root:{display:"flex",justifyContent:"space-between",gap:D.spacing(2),margin:D.spacing(2,0)}})),hn=()=>{const{fetchNextPage:D,fetchPreviousPage:M}=useSearch(),ue=vn();return!D&&!M?_jsx(_Fragment,{}):_jsxs("nav",{"aria-label":"pagination navigation",className:ue.root,children:[_jsx(Button,{"aria-label":"previous page",disabled:!M,onClick:M,startIcon:_jsx(ArrowBackIosIcon,{}),children:"Previous"}),_jsx(Button,{"aria-label":"next page",disabled:!D,onClick:D,endIcon:_jsx(ArrowForwardIosIcon,{}),children:"Next"})]})};var Xt=t(48834).lW;const Mn=D=>Xt.from(D.toString(),"utf-8").toString("base64"),zn=D=>D?Number(Xt.from(D,"base64").toString("utf-8")):0,pn=D=>{const{total:M=-1,cursor:ue,onCursorChange:fe,limit:be=25,limitLabel:$e="Results per page:",limitText:Ae=({from:Ce,to:Oe})=>M>0?`of ${M}`:`${Ce}-${Oe}`,limitOptions:We,onLimitChange:rt,...S}=D,G=useMemo(()=>zn(ue),[ue]),me=useCallback((Ce,Oe)=>{fe==null||fe(Mn(Oe))},[fe]),he=useCallback(Ce=>{const Oe=Ce.target.value;rt==null||rt(parseInt(Oe,10))},[rt]);return _jsx(TablePagination,{...S,component:"div",count:M,page:G,onPageChange:me,rowsPerPage:be,labelRowsPerPage:$e,labelDisplayedRows:Ae,rowsPerPageOptions:We,onRowsPerPageChange:he})},yn=D=>{const{pageLimit:M,setPageLimit:ue,pageCursor:fe,setPageCursor:be}=useSearch();return _jsx(pn,{...D,limit:M,onLimitChange:ue,cursor:fe,onCursorChange:be})},xn=({result:D,highlight:M,rank:ue,icon:fe,secondaryAction:be,lineClamp:$e=5})=>{const Ae=useAnalytics(),We=()=>{Ae.captureEvent("discover",D.title,{attributes:{to:D.location},value:ue})};return _jsxs(_Fragment,{children:[_jsxs(ListItem,{alignItems:"center",children:[fe&&_jsx(ListItemIcon,{children:fe}),_jsx(ListItemText,{primaryTypographyProps:{variant:"h6"},primary:_jsx(Link,{noTrack:!0,to:D.location,onClick:We,children:M!=null&&M.fields.title?_jsx(HighlightedSearchResultText,{text:(M==null?void 0:M.fields.title)||"",preTag:(M==null?void 0:M.preTag)||"",postTag:(M==null?void 0:M.postTag)||""}):D.title}),secondary:_jsx(Typography,{component:"span",style:{display:"-webkit-box",WebkitBoxOrient:"vertical",WebkitLineClamp:$e,overflow:"hidden"},children:M!=null&&M.fields.text?_jsx(HighlightedSearchResultText,{text:M.fields.text,preTag:M.preTag,postTag:M.postTag}):D.text})}),be&&_jsx(Box,{alignItems:"flex-end",children:be})]}),_jsx(Divider,{})]})},kn=D=>_jsx(AnalyticsContext,{attributes:{pluginId:"search",extension:"DefaultResultListItem"},children:_jsx(xn,{...D})}),On=D=>{const{loading:M,error:ue,resultItems:fe,renderResultItem:be=We=>_jsx(DefaultResultListItem,{result:We.document},We.document.location),noResultsComponent:$e=_jsx(EmptyState,{missing:"data",title:"Sorry, no results were found"}),...Ae}=D;return _jsxs(List,{...Ae,children:[M?_jsx(Progress,{}):null,!M&&ue?_jsx(ResponseErrorPanel,{title:"Error encountered while fetching search results",error:ue}):null,!M&&!ue&&(fe==null?void 0:fe.length)?fe.map(be):null,!M&&!ue&&!(fe!=null&&fe.length)?_jsx(ListItem,{children:$e}):null]})},bn=D=>{const{query:M,disableRenderingWithNoResults:ue,...fe}=D;return _jsx(AnalyticsContext,{attributes:{pluginId:"search",extension:"SearchResultList"},children:_jsx(SearchResultState,{query:M,children:({loading:be,error:$e,value:Ae})=>{var We;return!(!(Ae==null||(We=Ae.results)===null||We===void 0)&&We.length)&&ue?null:_jsx(On,{...fe,loading:be,error:$e,resultItems:Ae==null?void 0:Ae.results})}})})};var ge=t(19126);const ee=(0,b.Z)(D=>({listSubheader:{display:"flex",alignItems:"center"},listSubheaderName:{marginLeft:D.spacing(1),textTransform:"uppercase"},listSubheaderChip:{color:D.palette.text.secondary,margin:D.spacing(0,0,0,1.5)},listSubheaderFilter:{display:"flex",color:D.palette.text.secondary,margin:D.spacing(0,0,0,1.5)},listSubheaderLink:{marginLeft:"auto",display:"flex",alignItems:"center"},listSubheaderLinkIcon:{fontSize:"inherit",marginLeft:D.spacing(.5)}})),Re=D=>{const M=ee(),{label:ue,children:fe,...be}=D;return _jsx(Chip,{...be,className:M.listSubheaderFilter,variant:"outlined",label:_jsxs(_Fragment,{children:[ue,": ",fe]})})},Ue=()=>null,et=(0,b.Z)(D=>({root:{fontSize:"inherit","&:focus":{outline:"none",background:D.palette.common.white},"&:not(:focus)":{cursor:"pointer",color:D.palette.primary.main,"&:hover":{textDecoration:"underline"}}}})),wt=D=>{const M=et(),{label:ue,value:fe="None",onChange:be,onDelete:$e}=D,Ae=useCallback(We=>{be(We.target.value)},[be]);return _jsx(Re,{label:ue,onDelete:$e,children:_jsx(Typography,{role:"textbox",component:"span",className:M.root,onChange:Ae,contentEditable:!0,suppressContentEditableWarning:!0,children:fe})})},ae=(0,b.Z)(D=>({root:{fontSize:"inherit","&:not(:focus)":{cursor:"pointer",color:D.palette.primary.main,"&:hover":{textDecoration:"underline"}},"&:focus":{outline:"none"},"&>div:first-child":{padding:0}}})),O=D=>{const M=ae(),{label:ue,value:fe="none",onChange:be,onDelete:$e,children:Ae}=D,We=useCallback(rt=>{be(rt.target.value)},[be]);return _jsx(Re,{label:ue,onDelete:$e,children:_jsxs(Select,{className:M.root,value:fe,onChange:We,input:_jsx(InputBase,{}),IconComponent:Ue,children:[_jsx(MenuItem,{value:"none",children:"None"}),Ae]})})};function de(D){const M=ee(),[ue,fe]=useState(null),{loading:be,error:$e,icon:Ae,title:We,titleProps:rt={},link:S=_jsxs(_Fragment,{children:["See all",_jsx(ArrowRightIcon,{className:M.listSubheaderLinkIcon})]}),linkProps:G={},filterOptions:me,renderFilterOption:he=Bt=>_jsx(MenuItem,{value:String(Bt),children:Bt},String(Bt)),filterFields:Ce,renderFilterField:Oe,resultItems:Me,renderResultItem:dt=Bt=>_jsx(DefaultResultListItem,{result:Bt.document},Bt.document.location),noResultsComponent:jt=_jsx(EmptyState,{missing:"data",title:"Sorry, no results were found"}),...at}=D,pt=useCallback(Bt=>{fe(Bt.currentTarget)},[]),yt=useCallback(()=>{fe(null)},[]);var lt;return _jsxs(List,{...at,children:[_jsxs(ListSubheader,{className:M.listSubheader,children:[Ae,_jsx(Typography,{className:M.listSubheaderName,component:"strong",...rt,children:We}),me?_jsx(Chip,{className:M.listSubheaderChip,component:"button",icon:_jsx(AddIcon,{}),variant:"outlined",label:"Add filter","aria-controls":"filters-menu","aria-haspopup":"true",onClick:pt}):null,me?_jsx(Menu,{id:"filters-menu",anchorEl:ue,open:Boolean(ue),onClose:yt,onClick:yt,keepMounted:!0,children:me.map(he)}):null,Ce==null?void 0:Ce.map(Bt=>(lt=Oe==null?void 0:Oe(Bt))!==null&<!==void 0?lt:null),_jsx(Link,{className:M.listSubheaderLink,to:"/search",...G,children:S})]}),be?_jsx(Progress,{}):null,!be&&$e?_jsx(ResponseErrorPanel,{title:"Error encountered while fetching search results",error:$e}):null,!be&&!$e&&(Me==null?void 0:Me.length)?Me.map(dt):null,!be&&!$e&&!(Me!=null&&Me.length)?_jsx(ListItem,{children:jt}):null]})}function Be(D){const{query:M,linkProps:ue={},disableRenderingWithNoResults:fe,...be}=D,$e=`/search?${qs.stringify({query:M.term,types:M.types,filters:M.filters,pageCursor:M.pageCursor},{arrayFormat:"brackets"})}`;return _jsx(AnalyticsContext,{attributes:{pluginId:"search",extension:"SearchResultGroup"},children:_jsx(SearchResultState,{query:M,children:({loading:Ae,error:We,value:rt})=>{var S;if(!(!(rt==null||(S=rt.results)===null||S===void 0)&&S.length)&&fe)return null;var G;return _jsx(de,{...be,loading:Ae,error:We,linkProps:{to:$e,...ue},resultItems:rt==null?void 0:rt.results,filterFields:Object.keys((G=M.filters)!==null&&G!==void 0?G:{})})}})})}},61886:function(At,Fe,t){"use strict";t.d(Fe,{Ox:function(){return Ke},jM:function(){return g},Zz:function(){return b},oZ:function(){return Qe},DR:function(){return c},ZS:function(){return Le},VA:function(){return ot},KY:function(){return te},gT:function(){return Y},Dl:function(){return ce},ux:function(){return mt},$L:function(){return F},x1:function(){return Xe}});var h=t(52322),r=t(2784),W=t(79635),k=t(25248);const g="techdocs.addons.addon.v1",b="techdocs.addons.wrapper.v1",c=()=>null;(0,k.R5)(c,b,!0);const P=ne=>`${g}.${ne.toLocaleLowerCase("en-US")}`;function te(ne){const{name:Pe,component:ke}=ne;return(0,k.YO)({name:Pe,component:{sync:tt=>(0,h.jsx)(ke,{...tt})},data:{[g]:ne,[P(Pe)]:!0}})}const _=(ne,Pe)=>ne.selectByComponentData({key:Pe}).getElements()[0],X=ne=>ne.selectByComponentData({key:b}).selectByComponentData({key:g}),U=ne=>ne.selectByComponentData({key:b}).findComponentData({key:g}),F=()=>{const ne=(0,W.pC)(),Pe=(0,k.vJ)(ne,X),ke=(0,k.vJ)(ne,U),tt=(0,r.useCallback)(ut=>{if(!Pe||!ut)return null;const Tt=P(ut.name);var It;return(It=_(Pe,Tt))!==null&&It!==void 0?It:null},[Pe]),vt=(0,r.useCallback)(ut=>{const Tt=ke.find(It=>It.name===ut);return Tt?tt(Tt):null},[ke,tt]),Zt=(0,r.useCallback)(ut=>{const Tt=ke.filter(It=>It.location===ut);return Tt.length?Tt.map(tt):null},[ke,tt]);return{renderComponentByName:vt,renderComponentsByLocation:Zt}},Y=(0,k.T0)({id:"plugin.techdocs.service"}),ce=(0,k.T0)({id:"plugin.techdocs.storageservice"});var oe=t(64279),T=t(25271),R=t(51837);function V(ne,Pe){return Pe.getOptionalBoolean("techdocs.legacyUseCaseSensitiveTripletPaths")||(ne.kind=ne.kind.toLocaleLowerCase(),ne.name=ne.name.toLocaleLowerCase(),ne.namespace=ne.namespace.toLocaleLowerCase()),ne}const A=(ne,Pe)=>(0,T.eE)(ne)===(0,T.eE)(Pe),C={title:"",subtitle:"",setTitle:()=>{},setSubtitle:()=>{},setShadowRoot:()=>{},metadata:{loading:!0},entityMetadata:{loading:!0},entityRef:{kind:"",name:"",namespace:""}},z=(0,R.CT)("techdocs-reader-page-context"),Le=(0,r.memo)(({entityRef:ne,children:Pe})=>{const ke=(0,k.h_)(Y),tt=(0,k.h_)(k.Ds),vt=(0,oe.default)(async()=>ke.getTechDocsMetadata(ne),[ne]),Zt=(0,oe.default)(async()=>ke.getEntityMetadata(ne),[ne]),[ut,Tt]=(0,r.useState)(C.title),[It,Ot]=(0,r.useState)(C.subtitle),[en,Wt]=(0,r.useState)(C.shadowRoot),Vt={metadata:vt,entityRef:V(ne,tt),entityMetadata:Zt,shadowRoot:en,setShadowRoot:Wt,title:ut,setTitle:Tt,subtitle:It,setSubtitle:Ot},Qt=(0,R.EI)({1:Vt});return(0,h.jsx)(k.fC,{attributes:{entityRef:(0,T.eE)(ne)},children:(0,h.jsx)(z.Provider,{value:Qt,children:Pe instanceof Function?Pe(Vt):Pe})})},(ne,Pe)=>A(ne.entityRef,Pe.entityRef)),Xe=()=>{const ne=(0,r.useContext)(z);if(ne===void 0)return C;const Pe=ne.atVersion(1);if(Pe===void 0)throw new Error("No context found for version 1.");return Pe},Qe=Object.freeze({Header:"Header",Subheader:"Subheader",Settings:"Settings",PrimarySidebar:"PrimarySidebar",SecondarySidebar:"SecondarySidebar",Content:"Content"});var _e=t(70882),Ge=t(50236),gt=t(19219),Ee=t(93414);const Ke="TECH_DOCS_SHADOW_DOM_STYLE_LOAD",it=ne=>{(0,r.useEffect)(()=>{if(!ne)return()=>{};const Pe=ne.querySelectorAll('head > link[rel="stylesheet"]');var ke;let tt=(ke=Pe==null?void 0:Pe.length)!==null&&ke!==void 0?ke:0;const vt=new CustomEvent(Ke);if(!tt)return ne.dispatchEvent(vt),()=>{};const Zt=()=>{--tt===0&&ne.dispatchEvent(vt)};return Pe==null||Pe.forEach(ut=>{ut.addEventListener("load",Zt)}),()=>{Pe==null||Pe.forEach(ut=>{ut.removeEventListener("load",Zt)})}},[ne])},mt=ne=>{const[Pe,ke]=(0,r.useState)(!1);return(0,r.useEffect)(()=>{if(!ne)return()=>{};ke(!0);const tt=ne.style;tt.setProperty("opacity","0");const vt=()=>{ke(!1),tt.setProperty("opacity","1")};return ne.addEventListener(Ke,vt),()=>{ne.removeEventListener(Ke,vt)}},[ne]),Pe},ot=({element:ne,onAppend:Pe,children:ke})=>{const[tt,vt]=(0,r.useState)((0,_e.Ue)({...(0,Ge.Z)(),insertionPoint:void 0}));it(ne);const Zt=mt(ne),ut=(0,r.useCallback)(Tt=>{if(!ne||!Tt)return;vt((0,_e.Ue)({...(0,Ge.Z)(),insertionPoint:ne.querySelector("head")||void 0}));let It=Tt.shadowRoot;It||(It=Tt.attachShadow({mode:"open"})),It.replaceChildren(ne),typeof Pe=="function"&&Pe(It)},[ne,Pe]);return(0,h.jsxs)(h.Fragment,{children:[Zt&&(0,h.jsx)(Ee.Ex,{}),(0,h.jsxs)(gt.ZP,{jss:tt,sheetsManager:new Map,children:[(0,h.jsx)("div",{ref:ut,"data-testid":"techdocs-native-shadowroot"}),ke]})]})};var ft=t(54073);const nt=()=>{const{shadowRoot:ne}=useTechDocsReaderPage();return ne},Lt=ne=>{const Pe=nt();return Pe?ne.map(ke=>Pe==null?void 0:Pe.querySelectorAll(ke)).filter(ke=>ke.length).map(ke=>Array.from(ke)).flat():[]},bt=ne=>ne.toString()&&ne.rangeCount&&ne.getRangeAt(0).getBoundingClientRect().top,ze=(ne=0)=>{const Pe=nt(),[ke,tt]=useState(null),vt=useMemo(()=>debounce(()=>{const Zt=Pe,ut=Zt.getSelection?Zt.getSelection():document.getSelection();ut&&bt(ut)?tt(ut):tt(null)},ne),[Pe,tt,ne]);return useEffect(()=>(window.document.addEventListener("selectionchange",vt),()=>window.document.removeEventListener("selectionchange",vt)),[vt]),ke}},52943:function(At,Fe,t){"use strict";t.r(Fe),t.d(Fe,{EmbeddedDocsRouter:function(){return oe},Router:function(){return ce},isTechDocsAvailable:function(){return Y}});var h=t(52322),r=t(2784),W=t(79635),k=t(56941),g=t(93414),b=t(25271),c=t(89258),P=t(65124),te=t(67896);const _=({entity:T})=>{const R=(0,b.iB)(T);return(0,h.jsxs)(c.I6,{entityRef:R,children:[(0,h.jsx)(P.b,{}),(0,h.jsx)(te.F,{withSearch:!1})]})};var X=t(18662),U=t(7476);const F="backstage.io/techdocs-ref",Y=T=>{var R,V;return Boolean(T==null||(R=T.metadata)===null||R===void 0||(V=R.annotations)===null||V===void 0?void 0:V[F])},ce=()=>(0,h.jsxs)(W.Z5,{children:[(0,h.jsx)(W.AW,{path:"/",element:(0,h.jsx)(X.TechDocsIndexPage,{})}),(0,h.jsx)(W.AW,{path:"/:namespace/:kind/:name/*",element:(0,h.jsx)(U.TechDocsReaderPage,{})})]}),oe=T=>{var R;const{children:V}=T,{entity:A}=(0,k.X2)(),C=(0,W.V$)([{path:"/*",element:(0,h.jsx)(_,{entity:A}),children:[{path:"*",element:V}]}]);return((R=A.metadata.annotations)===null||R===void 0?void 0:R[F])?C:(0,h.jsx)(g.sk,{annotation:F})}},92077:function(At,Fe,t){"use strict";t.d(Fe,{k:function(){return g},p:function(){return k}});var h=t(23054),r=t(76372),W=t.n(r);class k{async getApiOrigin(){return await this.discoveryApi.getBaseUrl("techdocs")}async getTechDocsMetadata(c){const{kind:P,namespace:te,name:_}=c,U=`${await this.getApiOrigin()}/metadata/techdocs/${te}/${P}/${_}`,F=await this.fetchApi.fetch(`${U}`);if(!F.ok)throw await h.VL.fromResponse(F);return await F.json()}async getEntityMetadata(c){const{kind:P,namespace:te,name:_}=c,U=`${await this.getApiOrigin()}/metadata/entity/${te}/${P}/${_}`,F=await this.fetchApi.fetch(`${U}`);if(!F.ok)throw await h.VL.fromResponse(F);return await F.json()}constructor(c){this.configApi=c.configApi,this.discoveryApi=c.discoveryApi,this.fetchApi=c.fetchApi}}class g{async getApiOrigin(){return await this.discoveryApi.getBaseUrl("techdocs")}async getStorageUrl(){var c;return(c=this.configApi.getOptionalString("techdocs.storageUrl"))!==null&&c!==void 0?c:`${await this.discoveryApi.getBaseUrl("techdocs")}/static/docs`}async getBuilder(){return this.configApi.getString("techdocs.builder")}async getEntityDocs(c,P){const{kind:te,namespace:_,name:X}=c,F=`${await this.getStorageUrl()}/${_}/${te}/${X}/${P}`,Y=await this.fetchApi.fetch(`${F.endsWith("/")?F:`${F}/`}index.html`);let ce="";switch(Y.status){case 404:throw ce="Page not found. ",P||(ce+="This could be because there is no index.md file in the root of the docs directory of this repository."),new h.dR(ce);case 500:throw ce="Could not generate documentation or an error in the TechDocs backend. ",new Error(ce);default:break}return Y.text()}async syncEntityDocs(c,P=()=>{}){const{kind:te,namespace:_,name:X}=c,F=`${await this.getApiOrigin()}/sync/${_}/${te}/${X}`,{token:Y}=await this.identityApi.getCredentials();return new Promise((ce,oe)=>{const T=new r.EventSourcePolyfill(F,{withCredentials:!0,headers:Y?{Authorization:`Bearer ${Y}`}:{}});T.addEventListener("log",R=>{R.data&&P(JSON.parse(R.data))}),T.addEventListener("finish",R=>{let V=!1;R.data&&({updated:V}=JSON.parse(R.data)),ce(V?"updated":"cached")}),T.onerror=R=>{switch(T.close(),R.status){case 404:oe(new h.dR(R.message));return;default:oe(new Error(R.data));return}}})}async getBaseUrl(c,P,te){const{kind:_,namespace:X,name:U}=P,Y=`${await this.getApiOrigin()}/static/docs/${X}/${_}/${U}/${te}`;return new URL(c,Y.endsWith("/")?Y:`${Y}/`).toString()}constructor(c){this.configApi=c.configApi,this.discoveryApi=c.discoveryApi,this.identityApi=c.identityApi,this.fetchApi=c.fetchApi}}},51953:function(At,Fe,t){"use strict";t.d(Fe,{D:function(){return h}});function h(r,W){return W.getOptionalBoolean("techdocs.legacyUseCaseSensitiveTripletPaths")?r:r.toLocaleLowerCase("en-US")}},3482:function(At,Fe,t){"use strict";t.d(Fe,{u:function(){return P}});var h=t(52322),r=t(2784),W=t(93414),k=t(56941),g=t(42081),b=t(48431),c=t(68435);const P=te=>{const{initialFilter:_="owned",columns:X,actions:U}=te;return(0,h.jsx)(g.j,{children:(0,h.jsxs)(W.VY,{children:[(0,h.jsx)(W.yW,{title:"",children:(0,h.jsx)(W.qt,{children:"Discover documentation in your ecosystem."})}),(0,h.jsx)(k.UO,{children:(0,h.jsxs)(k._i,{children:[(0,h.jsxs)(k._i.Filters,{children:[(0,h.jsx)(b.f,{}),(0,h.jsx)(k.EW,{initialFilter:_}),(0,h.jsx)(k.dq,{}),(0,h.jsx)(k.xE,{})]}),(0,h.jsx)(k._i.Content,{children:(0,h.jsx)(c.n,{actions:U,columns:X})})]})})]})})}},85478:function(At,Fe,t){"use strict";t.d(Fe,{f:function(){return X}});var h=t(52322),r=t(95573),W=t(51953),k=t(25248),g=t(93414),b=t(94339),c=t(16111),P=t(24579),te=t(14503),_=t(2784);const X=oe=>{const{entities:T}=oe,R=(0,k.tg)(r.Fw),V=(0,k.h_)(k.Ds);if(!T)return null;var A,C;return(0,h.jsx)(g.Oh,{"data-testid":"docs-explore",children:T!=null&&T.length?T.map((z,Le)=>(0,h.jsxs)(b.Z,{children:[(0,h.jsx)(c.Z,{children:(0,h.jsx)(g.hu,{title:(A=z.metadata.title)!==null&&A!==void 0?A:z.metadata.name})}),(0,h.jsx)(P.Z,{children:z.metadata.description}),(0,h.jsx)(te.Z,{children:(0,h.jsx)(g.zx,{to:R({namespace:(0,W.D)((C=z.metadata.namespace)!==null&&C!==void 0?C:"default",V),kind:(0,W.D)(z.kind,V),name:(0,W.D)(z.metadata.name,V)}),color:"primary","data-testid":"read_docs",children:"Read Docs"})})]},Le)):null})};var U=t(56941);const F={title:"All Documentation",filterPredicate:()=>!0},Y=({entities:oe,group:T})=>{const{loading:R,isOwnedEntity:V}=useEntityOwnership(),A=oe.filter(z=>T.filterPredicate==="ownedByUser"?R?!1:V(z):typeof T.filterPredicate=="function"&&T.filterPredicate(z)),C=(()=>typeof T.title=="string"?_jsx(ContentHeader,{title:T.title}):T.title)();return A.length===0?null:_jsxs(Content,{children:[C,_jsx(DocsCardGrid,{entities:A})]})},ce=({groups:oe})=>{const{loading:T,error:R,entities:V}=useEntityList();if(R)return _jsx(WarningPanel,{severity:"error",title:"Could not load available documentation.",children:_jsx(CodeSnippet,{language:"text",text:R.toString()})});if(T)return _jsx(Progress,{});if(V.length===0)return _jsx("div",{"data-testid":"doc-not-found",children:_jsxs(Typography,{variant:"body2",children:["No documentation found that match your filter. Learn more about"," ",_jsx(Link,{to:"https://backstage.io/docs/features/techdocs/creating-and-publishing",children:"publishing documentation"}),"."]})});var A,C;return V.sort((z,Le)=>((A=z.metadata.title)!==null&&A!==void 0?A:z.metadata.name).localeCompare((C=Le.metadata.title)!==null&&C!==void 0?C:Le.metadata.name)),_jsx(Content,{children:(oe||[F]).map((z,Le)=>_jsx(Y,{entities:V,group:z},`${z.title}-${Le}`))})}},68435:function(At,Fe,t){"use strict";t.d(Fe,{H:function(){return V},n:function(){return A}});var h=t(52322),r=t(2784),W=t(95074),k=t(76635),g=t(93414),b=t(56941),c=t(25248),P=t(25271),te=t(95573),_=t(39981),X=t(2337),U=t(11640),F=t(28347);const Y=(0,X.Z)({root:{color:"#f3ba37"}})(U.Z),ce={createCopyDocsUrlAction(C){return z=>({icon:()=>(0,h.jsx)(_.Z,{fontSize:"small"}),tooltip:"Click to copy documentation link to clipboard",onClick:()=>C(`${window.location.origin}${z.resolved.docsUrl}`)})},createStarEntityAction(C,z){return({entity:Le})=>{const Xe=C(Le);return{cellStyle:{paddingLeft:"1em"},icon:()=>Xe?(0,h.jsx)(Y,{}):(0,h.jsx)(F.Z,{}),tooltip:Xe?"Remove from favorites":"Add to favorites",onClick:()=>z(Le)}}}};function oe(C){return C.metadata.title||C.metadata.name}const T={createNameColumn(){return{title:"Document",field:"entity.metadata.name",highlight:!0,render:C=>(0,h.jsx)(g.uw,{value:(0,h.jsx)(g.rU,{to:C.resolved.docsUrl,children:oe(C.entity)}),subvalue:C.entity.metadata.description})}},createOwnerColumn(){return{title:"Owner",field:"resolved.ownedByRelationsTitle",render:({resolved:C})=>(0,h.jsx)(b.rI,{entityRefs:C.ownedByRelations,defaultKind:"group"})}},createTypeColumn(){return{title:"Type",field:"entity.spec.type"}}};var R=t(51953);const V=C=>{const{entities:z,title:Le,loading:Xe,columns:Qe,actions:_e}=C,[,Ge]=(0,W.Z)(),gt=(0,c.tg)(te.Fw),Ee=(0,c.h_)(c.Ds);if(!z)return null;const Ke=z.map(ot=>{const ft=(0,b.hF)(ot,P.S4);var nt;return{entity:ot,resolved:{docsUrl:gt({namespace:(0,R.D)((nt=ot.metadata.namespace)!==null&&nt!==void 0?nt:"default",Ee),kind:(0,R.D)(ot.kind,Ee),name:(0,R.D)(ot.metadata.name,Ee)}),ownedByRelations:ft,ownedByRelationsTitle:ft.map(Lt=>(0,b.$3)(Lt,{defaultKind:"group"})).join(", ")}}}),it=[T.createNameColumn(),T.createOwnerColumn(),T.createTypeColumn()],mt=[ce.createCopyDocsUrlAction(Ge)];return(0,h.jsx)(h.Fragment,{children:Xe||Ke&&Ke.length>0?(0,h.jsx)(g.iA,{isLoading:Xe,options:{paging:!0,pageSize:20,search:!0,actionsColumnIndex:-1},data:Ke,columns:Qe||it,actions:_e||mt,title:Le?`${Le} (${Ke.length})`:`All (${Ke.length})`}):(0,h.jsx)(g.ub,{missing:"data",title:"No documents to show",description:"Create your own document. Check out our Getting Started Information",action:(0,h.jsx)(g.zx,{color:"primary",to:"https://backstage.io/docs/features/techdocs/getting-started",variant:"contained",children:"DOCS"})})})};V.columns=T,V.actions=ce;const A=C=>{var z;const{columns:Le,actions:Xe}=C,{loading:Qe,error:_e,entities:Ge,filters:gt}=(0,b.wp)(),{isStarredEntity:Ee,toggleStarredEntity:Ke}=(0,b.CR)(),[,it]=(0,W.Z)();var mt;const ot=(0,k.capitalize)((mt=(z=gt.user)===null||z===void 0?void 0:z.value)!==null&&mt!==void 0?mt:"all"),ft=[ce.createCopyDocsUrlAction(it),ce.createStarEntityAction(Ee,Ke)];return _e?(0,h.jsx)(g.GB,{severity:"error",title:"Could not load available documentation.",children:(0,h.jsx)(g.Oi,{language:"text",text:_e.toString()})}):(0,h.jsx)(V,{title:ot,entities:Ge,loading:Qe,actions:Xe||ft,columns:Le})};A.columns=T,A.actions=ce},18662:function(At,Fe,t){"use strict";t.r(Fe),t.d(Fe,{TechDocsIndexPage:function(){return g}});var h=t(52322),r=t(2784),W=t(79635),k=t(3482);const g=b=>(0,W.pC)()||(0,h.jsx)(k.u,{...b})},42081:function(At,Fe,t){"use strict";t.d(Fe,{j:function(){return g}});var h=t(52322),r=t(2784),W=t(93414),k=t(25248);const g=b=>{const{children:c}=b,P=(0,k.h_)(k.Ds);var te;const _=`Documentation available in ${(te=P.getOptionalString("organization.name"))!==null&&te!==void 0?te:"Backstage"}`;return(0,h.jsx)(W.g9,{title:"Documentation",subtitle:_,themeId:"documentation",children:c})}},48431:function(At,Fe,t){"use strict";t.d(Fe,{f:function(){return k}});var h=t(2784),r=t(56941);class W{getCatalogFilters(){return{"metadata.annotations.backstage.io/techdocs-ref":r.n3}}}const k=()=>{const{updateFilters:g}=(0,r.wp)();return(0,h.useEffect)(()=>{g({techdocs:new W})},[g]),null}},89258:function(At,Fe,t){"use strict";t.d(Fe,{I6:function(){return _},Jl:function(){return te},s4:function(){return g}});var h=t(61886),r=t(92077),W=t(95573),k=t(25248);const g=(0,k.rx)({id:"techdocs",apis:[(0,k.ni)({api:h.Dl,deps:{configApi:k.Ds,discoveryApi:k.NW,identityApi:k.$4,fetchApi:k.gP},factory:({configApi:X,discoveryApi:U,identityApi:F,fetchApi:Y})=>new r.k({configApi:X,discoveryApi:U,identityApi:F,fetchApi:Y})}),(0,k.ni)({api:h.gT,deps:{configApi:k.Ds,discoveryApi:k.NW,fetchApi:k.gP},factory:({configApi:X,discoveryApi:U,fetchApi:F})=>new r.p({configApi:X,discoveryApi:U,fetchApi:F})})],routes:{root:W._Z,docRoot:W.Fw,entityContent:W.pd}}),b=g.provide((0,k.P4)({name:"TechdocsPage",component:()=>Promise.resolve().then(t.bind(t,52943)).then(X=>X.Router),mountPoint:W._Z})),c=g.provide((0,k.P4)({name:"EntityTechdocsContent",component:()=>Promise.resolve().then(t.bind(t,52943)).then(X=>X.EmbeddedDocsRouter),mountPoint:W.pd})),P=g.provide((0,k.P4)({name:"TechDocsCustomHome",component:()=>t.e(7560).then(t.bind(t,27560)).then(X=>X.TechDocsCustomHome),mountPoint:W._Z})),te=g.provide((0,k.P4)({name:"TechDocsIndexPage",component:()=>Promise.resolve().then(t.bind(t,18662)).then(X=>X.TechDocsIndexPage),mountPoint:W._Z})),_=g.provide((0,k.P4)({name:"TechDocsReaderPage",component:()=>Promise.resolve().then(t.bind(t,7476)).then(X=>X.TechDocsReaderPage),mountPoint:W.Fw}))},7476:function(At,Fe,t){"use strict";t.r(Fe),t.d(Fe,{TechDocsReaderLayout:function(){return X},TechDocsReaderPage:function(){return U}});var h=t(52322),r=t(2784),W=t(79635),k=t(93414),g=t(61886),b=t(67896),c=t(93225),P=t(65124),te=t(95573),_=t(25248);const X=({withSearch:F,withHeader:Y=!0})=>(0,h.jsxs)(k.T3,{themeId:"documentation",children:[Y&&(0,h.jsx)(c.S,{}),(0,h.jsx)(P.b,{}),(0,h.jsx)(b.F,{withSearch:F})]}),U=F=>{const{kind:Y,name:ce,namespace:oe}=(0,_.Oi)(te.Fw),{children:T,entityRef:R={kind:Y,name:ce,namespace:oe}}=F,V=(0,W.pC)();if(!T){const C=V?r.Children.toArray(V.props.children):[];var A;const Le=C.flatMap(Xe=>{var Qe;return(A=Xe==null||(Qe=Xe.props)===null||Qe===void 0?void 0:Qe.children)!==null&&A!==void 0?A:[]}).find(Xe=>!(0,_.IY)(Xe,g.Zz)&&!(0,_.IY)(Xe,g.jM));return(0,h.jsx)(g.ZS,{entityRef:R,children:Le||(0,h.jsx)(X,{})})}return(0,h.jsx)(g.ZS,{entityRef:R,children:({metadata:C,entityMetadata:z,onReady:Le})=>(0,h.jsx)("div",{className:"techdocs-reader-page",children:(0,h.jsx)(k.T3,{themeId:"documentation",children:T instanceof Function?T({entityRef:R,techdocsMetadataValue:C.value,entityMetadataValue:z.value,onReady:Le}):T})})})}},67896:function(At,Fe,t){"use strict";t.d(Fe,{F:function(){return We}});var h=t(52322),r=t(2784),W=t(79692),k=t(60905),g=t(61886),b=t(93414),c=t(17339),P=t(4614),te=t(77277),_=t(99688),X=t(12420),U=t(90436),F=t(61837),Y=t(4190),ce=t(87685);const oe=(0,W.Z)(S=>(0,X.Z)({paper:{width:"100%",[S.breakpoints.up("sm")]:{width:"75%"},[S.breakpoints.up("md")]:{width:"50%"},padding:S.spacing(2.5)},root:{height:"100%",overflow:"hidden"},logs:{background:S.palette.background.default}})),T=({buildLog:S,onClose:G})=>{const me=oe(),he=S.length===0?"Waiting for logs...":S.join(`
|
|
37
|
-
`);return(0,h.jsxs)(k.Z,{container:!0,direction:"column",className:
|
|
36
|
+
javaVersion: 1.2.3`,te=(0,g.Z)(Y=>({code:{borderRadius:6,margin:`${Y.spacing(2)}px 0px`,background:Y.palette.type==="dark"?"#444":"#fff"}}),{name:"PluginCatalogEntityLabelsEmptyState"});function _(){const Y=te();return(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(b.Z,{variant:"body1",children:"No labels defined for this entity. You can add labels to your entity YAML as shown in the highlighted example below:"}),(0,h.jsx)("div",{className:Y.code,children:(0,h.jsx)(k.Oi,{text:P,language:"yaml",showLineNumbers:!0,highlightedNumbers:[3,4,5,6],customStyle:{background:"inherit",fontSize:"115%"}})}),(0,h.jsx)(c.Z,{variant:"contained",color:"primary",target:"_blank",href:"https://backstage.io/docs/features/software-catalog/descriptor-format#labels-optional",children:"Read more"})]})}const X=(0,g.Z)(Y=>({key:{fontWeight:"bold"}})),U=Y=>{var ce;const{variant:se,title:T}=Y,{entity:R}=(0,r.X2)(),V=X(),A=[{render:z=>(0,h.jsx)(b.Z,{className:V.key,variant:"body2",children:z.key})},{field:"value"}],C=R==null||(ce=R.metadata)===null||ce===void 0?void 0:ce.labels;return(0,h.jsx)(k.rJ,{title:T||"Labels",variant:se,children:!C||Object.keys(C).length===0?(0,h.jsx)(_,{}):(0,h.jsx)(k.iA,{columns:A,data:Object.keys(C).map(z=>({key:z,value:C[z]})),options:{search:!1,showTitle:!0,loadingType:"linear",header:!1,padding:"dense",pageSize:5,toolbar:!1,paging:Object.keys(C).length>5}})})};function F(Y){var ce,se;return!(Y==null||(ce=Y.metadata)===null||ce===void 0)&&ce.labels?Object.keys(Y==null||(se=Y.metadata)===null||se===void 0?void 0:se.labels).some(Boolean):!1}},24851:function(At,Fe,t){"use strict";t.d(Fe,{s:function(){return ce}});var h=t(52322),r=t(90348),W=t(11861),k=t(2784),g=t(79692),b=t(95544),c=t(90436),P=t(52160),te=t(93414);const _=(0,g.Z)({svgIcon:{display:"inline-block","& svg":{display:"inline-block",fontSize:"inherit",verticalAlign:"baseline"}}});function X(se){const{href:T,text:R,Icon:V}=se,A=_();return(0,h.jsxs)(b.Z,{display:"flex",children:[(0,h.jsx)(b.Z,{mr:1,className:A.svgIcon,children:(0,h.jsx)(c.Z,{component:"div",children:V?(0,h.jsx)(V,{}):(0,h.jsx)(P.Z,{})})}),(0,h.jsx)(b.Z,{flexGrow:"1",children:(0,h.jsx)(te.rU,{to:T,target:"_blank",rel:"noopener",children:R||T})})]})}var U=t(41156);const F={xs:1,sm:1,md:1,lg:2,xl:3};function Y(se){const T=[(0,U.Z)(C=>C.breakpoints.up("xl"))?"xl":null,(0,U.Z)(C=>C.breakpoints.up("lg"))?"lg":null,(0,U.Z)(C=>C.breakpoints.up("md"))?"md":null,(0,U.Z)(C=>C.breakpoints.up("sm"))?"sm":null,(0,U.Z)(C=>C.breakpoints.up("xs"))?"xs":null];let R=1;if(typeof se=="number")R=se;else{var V;const C=(V=T.find(z=>z!==null))!==null&&V!==void 0?V:"xs";var A;R=(A=se==null?void 0:se[C])!==null&&A!==void 0?A:F[C]}return R}function ce(se){const{items:T,cols:R=void 0}=se,V=Y(R);return(0,h.jsx)(r.Z,{rowHeight:"auto",cols:V,children:T.map(({text:A,href:C,Icon:z},Le)=>(0,h.jsx)(W.Z,{children:(0,h.jsx)(X,{href:C,text:A!=null?A:C,Icon:z})},Le))})}},19625:function(At,Fe,t){"use strict";t.d(Fe,{_Z:function(){return k},jU:function(){return W},yw:function(){return r}});var h=t(25248);const r=(0,h.x8)({id:"create-component",optional:!0}),W=(0,h.x8)({id:"view-techdoc",optional:!0,params:["namespace","kind","name"]}),k=(0,h.NT)({id:"catalog"})},51666:function(At,Fe,t){"use strict";t.d(Fe,{rG:function(){return h},Y2:function(){return V},J$:function(){return te},g2:function(){return W}});var h;(function(A){A.DENY="DENY",A.ALLOW="ALLOW",A.CONDITIONAL="CONDITIONAL"})(h||(h={}));function r(A,C){return A.name===C.name}function W(A,C){return"resourceType"in A?!C||A.resourceType===C:!1}function k(A){return A.attributes.action==="create"}function g(A){return A.attributes.action==="read"}function b(A){return A.attributes.action==="update"}function c(A){return A.attributes.action==="delete"}function P(A){return{authorize:async(C,z)=>await A.authorize(C,z),authorizeConditional(C,z){const Le=C;return A.authorize(Le,z)}}}function te({name:A,attributes:C,resourceType:z}){return z?{type:"resource",name:A,attributes:C,resourceType:z}:{type:"basic",name:A,attributes:C}}var _=t(23054),X=t(96279),U=t.n(X),F=t(9571),Y=t(30195);const ce=Y.z.lazy(()=>Y.z.object({rule:Y.z.string(),resourceType:Y.z.string(),params:Y.z.record(Y.z.any()).optional()}).or(Y.z.object({anyOf:Y.z.array(ce).nonempty()})).or(Y.z.object({allOf:Y.z.array(ce).nonempty()})).or(Y.z.object({not:ce}))),se=Y.z.object({result:Y.z.literal(h.ALLOW).or(Y.z.literal(h.DENY))}),T=Y.z.union([Y.z.object({result:Y.z.literal(h.ALLOW).or(Y.z.literal(h.DENY))}),Y.z.object({result:Y.z.literal(h.CONDITIONAL),pluginId:Y.z.string(),resourceType:Y.z.string(),conditions:ce})]),R=(A,C)=>Y.z.object({items:Y.z.array(Y.z.intersection(Y.z.object({id:Y.z.string()}),A)).refine(z=>z.length===C.size&&z.every(({id:Le})=>C.has(Le)),{message:"Items in response do not match request"})});class V{async authorize(C,z){return this.makeRequest(C,se,z)}async authorizeConditional(C,z){return this.makeRequest(C,T,z)}async makeRequest(C,z,Le){if(!this.enabled)return C.map(Ke=>({result:h.ALLOW}));const Xe={items:C.map(Ke=>({id:F.Z(),...Ke}))},Qe=await this.discovery.getBaseUrl("permission"),_e=await U()(`${Qe}/authorize`,{method:"POST",body:JSON.stringify(Xe),headers:{...this.getAuthorizationHeader(Le==null?void 0:Le.token),"content-type":"application/json"}});if(!_e.ok)throw await _.VL.fromResponse(_e);const Ge=await _e.json(),Ee=R(z,new Set(Xe.items.map(({id:Ke})=>Ke))).parse(Ge).items.reduce((Ke,at)=>(Ke[at.id]=at,Ke),{});return Xe.items.map(Ke=>Ee[Ke.id])}getAuthorizationHeader(C){return C?{Authorization:`Bearer ${C}`}:{}}constructor(C){this.discovery=C.discovery;var z;this.enabled=(z=C.config.getOptionalBoolean("permission.enabled"))!==null&&z!==void 0?z:!1}}},25488:function(At,Fe,t){"use strict";t.d(Fe,{iM:function(){return b},RV:function(){return k},gI:function(){return P}});var h=t(52322),r=t(2784),W=t(25248);const k=(0,W.T0)({id:"plugin.permission.api"});var g=t(51666);class b{static create(U){const{config:F,discovery:Y,identity:ce}=U,se=new g.Y2({discovery:Y,config:F});return new b(se,ce)}async authorize(U){return(await this.permissionClient.authorize([U],await this.identityApi.getCredentials()))[0]}constructor(U,F){this.permissionClient=U,this.identityApi=F}}var c=t(69984);function P(X){const U=(0,W.h_)(k),{data:F,error:Y}=(0,c.ZP)(X,async ce=>{if((0,g.g2)(ce.permission)&&!ce.resourceRef)return g.rG.DENY;const{result:se}=await U.authorize(ce);return se});return Y?{error:Y,loading:!1,allowed:!1}:F===void 0?{loading:!0,allowed:!1}:{loading:!1,allowed:F===g.rG.ALLOW}}const te=X=>{const{permission:U,resourceRef:F,errorComponent:Y,...ce}=X,se=usePermission(isResourcePermission(U)?{permission:U,resourceRef:F}:{permission:U}),T=useApp(),{NotFoundErrorPage:R}=T.getComponents();let V=Y===void 0?_jsx(R,{}):Y;return se.loading?V=null:se.allowed&&(V=X.element),_jsx(Route,{...ce,element:V})};function _(X){const{permission:U,resourceRef:F}=X,Y=usePermission(isResourcePermission(U)?{permission:U,resourceRef:F}:{permission:U}),ce=useApp();if(Y.loading)return null;if(Y.allowed)return _jsx(_Fragment,{children:X.children});if(X.errorPage)return _jsx(_Fragment,{children:X.errorPage});const{NotFoundErrorPage:se}=ce.getComponents();return _jsx(se,{})}},65826:function(At,Fe,t){"use strict";t.d(Fe,{FA:function(){return P},qO:function(){return it},Nd:function(){return Qe},Rx:function(){return A}});var h=t(25248);const r=(0,h.T0)({id:"plugin.search.queryservice"});class W{query(){return Promise.resolve(this.mockedResults||{results:[]})}constructor(M){this.mockedResults=M}}var k=t(52322),g=t(2784),b=t(79692);const c=(0,b.Z)(()=>({highlight:{}}),{name:"BackstageHighlightedSearchResultText"}),P=({text:D,preTag:M,postTag:he})=>{const fe=c(),be=(0,g.useMemo)(()=>D.split(new RegExp(`(${M}.+?${he})`)),[he,M,D]);return(0,k.jsx)(k.Fragment,{children:be.map(($e,Ae)=>$e.includes(M)?(0,k.jsx)("mark",{className:fe.highlight,children:$e.replace(new RegExp(`${M}|${he}`,"g"),"")},Ae):$e)})};var te=t(48760),_=t(50581),X=t(61837),U=t(74603),F=t(21853),Y=t(33375),ce=t(76635),se=t(64279),T=t(1849),R=t(51837);const V=(0,R.CT)("search-context"),A=()=>{const D=(0,g.useContext)(V);if(!D)throw new Error("useSearch must be used within a SearchContextProvider");const M=D.atVersion(1);if(!M)throw new Error("No SearchContext v1 found");return M},C=()=>(0,g.useContext)(V)!==void 0,z={term:"",types:[],filters:{},pageLimit:void 0,pageCursor:void 0},Le=(D=z)=>{var M,he,fe,be;const $e=(0,h.h_)(r),[Ae,We]=(0,g.useState)(D.term),[st,S]=(0,g.useState)(D.types),[K,ge]=(0,g.useState)(D.filters),[de,Ce]=(0,g.useState)(D.pageLimit),[Oe,Me]=(0,g.useState)(D.pageCursor),ht=(0,T.Z)(Ae),jt=(0,T.Z)(K),lt=(0,se.default)(()=>$e.query({term:Ae,types:st,filters:K,pageLimit:de,pageCursor:Oe}),[Ae,st,K,de,Oe]),ft=!lt.loading&&!lt.error&&((M=lt.value)===null||M===void 0?void 0:M.nextPageCursor),xt=!lt.loading&&!lt.error&&((he=lt.value)===null||he===void 0?void 0:he.previousPageCursor),ct=(0,g.useCallback)(()=>{var zt;Me((zt=lt.value)===null||zt===void 0?void 0:zt.nextPageCursor)},[(fe=lt.value)===null||fe===void 0?void 0:fe.nextPageCursor]),Bt=(0,g.useCallback)(()=>{var zt;Me((zt=lt.value)===null||zt===void 0?void 0:zt.previousPageCursor)},[(be=lt.value)===null||be===void 0?void 0:be.previousPageCursor]);return(0,g.useEffect)(()=>{ht!==void 0&&Ae!==ht&&Me(void 0)},[Ae,ht,Me]),(0,g.useEffect)(()=>{jt!==void 0&&!(0,ce.isEqual)(K,jt)&&Me(void 0)},[K,jt,Me]),{result:lt,term:Ae,setTerm:We,types:st,setTypes:S,filters:K,setFilters:ge,pageLimit:de,setPageLimit:Ce,pageCursor:Oe,setPageCursor:Me,fetchNextPage:ft?ct:void 0,fetchPreviousPage:xt?Bt:void 0}},Xe=D=>{const{initialState:M,children:he}=D,fe=Le(M);return(0,k.jsx)(h.fC,{attributes:{searchTypes:fe.types.sort().join(",")},children:(0,k.jsx)(V.Provider,{value:(0,R.EI)({1:fe}),children:he})})},Qe=D=>{const{initialState:M,inheritParentContextIfAvailable:he,children:fe}=D;return C()&&he?(0,k.jsx)(k.Fragment,{children:fe}):(0,k.jsx)(Xe,{initialState:M,children:fe})},_e=({children:D})=>{var M;const he=K=>(0,T.Z)(K)!==K,fe=(0,h.z$)(),{term:be,result:$e}=A();var Ae;const We=(Ae=(M=$e.value)===null||M===void 0?void 0:M.numberOfResults)!==null&&Ae!==void 0?Ae:void 0,S=he($e.loading)&&!$e.loading;return(0,g.useEffect)(()=>{be&&S&&fe.captureEvent("search",be,{value:We})},[fe,be,We,S]),(0,k.jsx)(k.Fragment,{children:D})};function Ge(D){return(0,g.forwardRef)((M,he)=>(0,k.jsx)(Qe,{inheritParentContextIfAvailable:!0,children:(0,k.jsx)(D,{...M,ref:he})}))}const mt=Ge((0,g.forwardRef)((D,M)=>{const{onChange:he,onKeyDown:fe=()=>{},onClear:be=()=>{},onSubmit:$e=()=>{},debounceTime:Ae=200,clearButton:We=!0,fullWidth:st=!0,value:S,placeholder:K,inputProps:ge={},endAdornment:de,...Ce}=D,Oe=(0,h.h_)(h.Ds),[Me,ht]=(0,g.useState)("");(0,g.useEffect)(()=>{ht(Mt=>Mt!==S?String(S):Mt)},[S]),(0,te.Z)(()=>he(Me),Ae,[Me]);const jt=(0,g.useCallback)(Mt=>{ht(Mt.target.value)},[ht]),lt=(0,g.useCallback)(Mt=>{fe&&fe(Mt),$e&&Mt.key==="Enter"&&$e()},[fe,$e]),ft=(0,g.useCallback)(()=>{he(""),be&&be()},[he,be]),xt=K!=null?K:`Search in ${Oe.getOptionalString("app.title")||"Backstage"}`,ct=(0,k.jsx)(_.Z,{position:"start",children:(0,k.jsx)(X.Z,{"aria-label":"Query",size:"small",disabled:!0,children:(0,k.jsx)(F.Z,{})})}),Bt=(0,k.jsx)(_.Z,{position:"end",children:(0,k.jsx)(X.Z,{"aria-label":"Clear",size:"small",onClick:ft,children:(0,k.jsx)(Y.Z,{})})});return(0,k.jsx)(_e,{children:(0,k.jsx)(U.Z,{"data-testid":"search-bar-next",ref:M,value:Me,placeholder:xt,startAdornment:ct,endAdornment:We?Bt:de,inputProps:{"aria-label":"Search",...ge},fullWidth:st,onChange:jt,onKeyDown:lt,...Ce})})})),Ee=Ge((0,g.forwardRef)((D,M)=>{const{value:he="",onChange:fe,...be}=D,{term:$e,setTerm:Ae}=A();(0,g.useEffect)(()=>{he&&Ae(String(he))},[he,Ae]);const We=(0,g.useCallback)(st=>{fe?fe(st):Ae(st)},[fe,Ae]);return(0,k.jsx)(h.fC,{attributes:{pluginId:"search",extension:"SearchBar"},children:(0,k.jsx)(mt,{...be,ref:M,value:$e,onChange:We})})}));var Ke=t(4614),at=t(88013);const it=(D=>M=>(0,k.jsx)(Qe,{inheritParentContextIfAvailable:!0,children:(0,k.jsx)(D,{...M})}))(function(M){const{loading:he,value:fe,onChange:be=()=>{},options:$e=[],getOptionLabel:Ae=ft=>String(ft),inputPlaceholder:We,inputDebounceTime:st,freeSolo:S=!0,fullWidth:K=!0,clearOnBlur:ge=!1,"data-testid":de="search-autocomplete",...Ce}=M,{setTerm:Oe}=A(),Me=(0,g.useCallback)(ft=>ft?typeof ft=="string"?ft:Ae(ft):"",[Ae]),ht=(0,g.useMemo)(()=>Me(fe),[fe,Me]),jt=(0,g.useCallback)((ft,xt,ct,Bt)=>{Oe(Me(xt)),be(ft,xt,ct,Bt)},[Me,Oe,be]),lt=(0,g.useCallback)(({InputProps:{ref:ft,endAdornment:xt},InputLabelProps:ct,...Bt})=>(0,k.jsx)(Ee,{...Bt,ref:ft,clearButton:!1,value:ht,placeholder:We,debounceTime:st,endAdornment:he?(0,k.jsx)(Ke.Z,{"data-testid":"search-autocomplete-progressbar",color:"inherit",size:20}):xt}),[he,ht,We,st]);return(0,k.jsx)(at.ZP,{...Ce,"data-testid":de,value:fe,onChange:jt,options:$e,getOptionLabel:Ae,renderInput:lt,freeSolo:S,fullWidth:K,clearOnBlur:ge})}),gt=({icon:D,primaryText:M,primaryTextTypographyProps:he,secondaryText:fe,secondaryTextTypographyProps:be,disableTextTypography:$e})=>_jsxs(_Fragment,{children:[D?_jsx(ListItemIcon,{children:D}):null,_jsx(ListItemText,{primary:M,primaryTypographyProps:he,secondary:fe,secondaryTypographyProps:be,disableTypography:$e})]});var nt=t(42494),Lt=t(84899),bt=t(5806),ze=t(21324),ne=t(56939),Pe=t(73698),ke=t(12231),tt=t(86619),yt=t(7089),Zt=t(69294);const pt=(D,M,he=[],fe=250)=>{const be=(0,g.useRef)({}),$e=D||(()=>Promise.resolve([])),[Ae,We]=(0,Zt.default)($e,[M],{loading:!0});if((0,te.Z)(()=>{be.current[M]===void 0&&(be.current[M]=We(M).then(S=>(be.current[M]=S,S)))},fe,[We,M]),he.length)return{loading:!1,value:he};const st=be.current[M];return Array.isArray(st)?{loading:!1,value:st}:Ae},Tt=(D,M)=>{const{setFilters:he}=A();(0,g.useEffect)(()=>{M&&[M].flat().length>0&&he(fe=>({...fe,[D]:M}))},[])},It=D=>{const{className:M,defaultValue:he,name:fe,values:be,valuesDebounceMs:$e,label:Ae,filterSelectedOptions:We,limitTags:st,multiple:S}=D,[K,ge]=(0,g.useState)("");Tt(fe,he);const de=typeof be=="function"?be:void 0,Ce=typeof be=="function"?void 0:be,{value:Oe,loading:Me}=pt(de,K,Ce,$e),{filters:ht,setFilters:jt}=A(),lt=ht[fe]||(S?[]:null),ft=(Bt,Mt)=>{jt(zt=>{const{[fe]:qt,...Wn}=zt;return Mt?{...Wn,[fe]:Mt}:{...Wn}})},xt=Bt=>(0,k.jsx)(tt.Z,{...Bt,name:"search",variant:"outlined",label:Ae,fullWidth:!0}),ct=(Bt,Mt)=>Bt.map((zt,qt)=>(0,k.jsx)(yt.Z,{label:zt,color:"primary",...Mt({index:qt})}));return(0,k.jsx)(at.ZP,{filterSelectedOptions:We,limitTags:st,multiple:S,className:M,id:`${S?"multi-":""}select-filter-${fe}--select`,options:Oe||[],loading:Me,value:lt,onChange:ft,onInputChange:(Bt,Mt)=>ge(Mt),renderInput:xt,renderTags:ct})},Ot=(0,b.Z)({label:{textTransform:"capitalize"}}),en=D=>{const{className:M,defaultValue:he,label:fe,name:be,values:$e=[],valuesDebounceMs:Ae}=D,We=Ot(),{filters:st,setFilters:S}=A();Tt(be,he);const K=typeof $e=="function"?$e:void 0,ge=typeof $e=="function"?void 0:$e,{value:de=[],loading:Ce}=pt(K,"",ge,Ae),Oe=ht=>{const{target:{value:jt,checked:lt}}=ht;S(ft=>{const{[be]:xt,...ct}=ft,Bt=(xt||[]).filter(zt=>zt!==jt),Mt=lt?[...Bt,jt]:Bt;return Mt.length?{...ct,[be]:Mt}:ct})};var Me;return(0,k.jsxs)(nt.Z,{className:M,disabled:Ce,fullWidth:!0,"data-testid":"search-checkboxfilter-next",children:[fe?(0,k.jsx)(Lt.Z,{className:We.label,children:fe}):null,de.map(ht=>(0,k.jsx)(bt.Z,{control:(0,k.jsx)(ze.Z,{color:"primary",tabIndex:-1,inputProps:{"aria-labelledby":ht},value:ht,name:ht,onChange:Oe,checked:((Me=st[be])!==null&&Me!==void 0?Me:[]).includes(ht)}),label:ht},ht))]})},Wt=D=>{const{className:M,defaultValue:he,label:fe,name:be,values:$e,valuesDebounceMs:Ae}=D,We=Ot();Tt(be,he);const st=typeof $e=="function"?$e:void 0,S=typeof $e=="function"?void 0:$e,{value:K=[],loading:ge}=pt(st,"",S,Ae),{filters:de,setFilters:Ce}=A(),Oe=Me=>{const{target:{value:ht}}=Me;Ce(jt=>{const{[be]:lt,...ft}=jt;return ht?{...ft,[be]:ht}:ft})};return(0,k.jsxs)(nt.Z,{disabled:ge,className:M,variant:"filled",fullWidth:!0,"data-testid":"search-selectfilter-next",children:[fe?(0,k.jsx)(ne.Z,{className:We.label,margin:"dense",children:fe}):null,(0,k.jsxs)(Pe.Z,{variant:"outlined",value:de[be]||"",onChange:Oe,children:[(0,k.jsx)(ke.Z,{value:"",children:(0,k.jsx)("em",{children:"All"})}),K.map(Me=>(0,k.jsx)(ke.Z,{value:Me,children:Me},Me))]})]})},Vt=({component:D,...M})=>(0,k.jsx)(D,{...M});Vt.Checkbox=D=>(0,k.jsx)(Vt,{...D,component:en}),Vt.Select=D=>(0,k.jsx)(Vt,{...D,component:Wt}),Vt.Autocomplete=D=>(0,k.jsx)(Vt,{...D,component:It});var Qt=t(93414);const un=D=>{const{children:M}=D,fe=useSearch().result;return M(fe)},cn=D=>{const{query:M,children:he}=D,fe=useApi(searchApiRef),be=useAsync(()=>{const{term:$e="",types:Ae=[],filters:We={},...st}=M;return fe.query({...st,term:$e,types:Ae,filters:We})},[M]);return he(be)},Fn=D=>{const{query:M,children:he}=D;return M?_jsx(cn,{query:M,children:he}):_jsx(un,{children:he})},In=D=>{const{query:M,children:he,noResultsComponent:fe=_jsx(EmptyState,{missing:"data",title:"Sorry, no results were found"})}=D;return _jsx(Fn,{query:M,children:({loading:be,error:$e,value:Ae})=>be?_jsx(Progress,{}):$e?_jsx(ResponseErrorPanel,{title:"Error encountered while fetching search results",error:$e}):Ae!=null&&Ae.results.length?he(Ae):fe})},Un=D=>_jsx(AnalyticsContext,{attributes:{pluginId:"search",extension:"SearchResult"},children:_jsx(In,{...D})}),vn=(0,b.Z)(D=>({root:{display:"flex",justifyContent:"space-between",gap:D.spacing(2),margin:D.spacing(2,0)}})),hn=()=>{const{fetchNextPage:D,fetchPreviousPage:M}=useSearch(),he=vn();return!D&&!M?_jsx(_Fragment,{}):_jsxs("nav",{"aria-label":"pagination navigation",className:he.root,children:[_jsx(Button,{"aria-label":"previous page",disabled:!M,onClick:M,startIcon:_jsx(ArrowBackIosIcon,{}),children:"Previous"}),_jsx(Button,{"aria-label":"next page",disabled:!D,onClick:D,endIcon:_jsx(ArrowForwardIosIcon,{}),children:"Next"})]})};var Xt=t(48834).lW;const Mn=D=>Xt.from(D.toString(),"utf-8").toString("base64"),zn=D=>D?Number(Xt.from(D,"base64").toString("utf-8")):0,pn=D=>{const{total:M=-1,cursor:he,onCursorChange:fe,limit:be=25,limitLabel:$e="Results per page:",limitText:Ae=({from:Ce,to:Oe})=>M>0?`of ${M}`:`${Ce}-${Oe}`,limitOptions:We,onLimitChange:st,...S}=D,K=useMemo(()=>zn(he),[he]),ge=useCallback((Ce,Oe)=>{fe==null||fe(Mn(Oe))},[fe]),de=useCallback(Ce=>{const Oe=Ce.target.value;st==null||st(parseInt(Oe,10))},[st]);return _jsx(TablePagination,{...S,component:"div",count:M,page:K,onPageChange:ge,rowsPerPage:be,labelRowsPerPage:$e,labelDisplayedRows:Ae,rowsPerPageOptions:We,onRowsPerPageChange:de})},yn=D=>{const{pageLimit:M,setPageLimit:he,pageCursor:fe,setPageCursor:be}=useSearch();return _jsx(pn,{...D,limit:M,onLimitChange:he,cursor:fe,onCursorChange:be})},xn=({result:D,highlight:M,rank:he,icon:fe,secondaryAction:be,lineClamp:$e=5})=>{const Ae=useAnalytics(),We=()=>{Ae.captureEvent("discover",D.title,{attributes:{to:D.location},value:he})};return _jsxs(_Fragment,{children:[_jsxs(ListItem,{alignItems:"center",children:[fe&&_jsx(ListItemIcon,{children:fe}),_jsx(ListItemText,{primaryTypographyProps:{variant:"h6"},primary:_jsx(Link,{noTrack:!0,to:D.location,onClick:We,children:M!=null&&M.fields.title?_jsx(HighlightedSearchResultText,{text:(M==null?void 0:M.fields.title)||"",preTag:(M==null?void 0:M.preTag)||"",postTag:(M==null?void 0:M.postTag)||""}):D.title}),secondary:_jsx(Typography,{component:"span",style:{display:"-webkit-box",WebkitBoxOrient:"vertical",WebkitLineClamp:$e,overflow:"hidden"},children:M!=null&&M.fields.text?_jsx(HighlightedSearchResultText,{text:M.fields.text,preTag:M.preTag,postTag:M.postTag}):D.text})}),be&&_jsx(Box,{alignItems:"flex-end",children:be})]}),_jsx(Divider,{})]})},kn=D=>_jsx(AnalyticsContext,{attributes:{pluginId:"search",extension:"DefaultResultListItem"},children:_jsx(xn,{...D})}),On=D=>{const{loading:M,error:he,resultItems:fe,renderResultItem:be=We=>_jsx(DefaultResultListItem,{result:We.document},We.document.location),noResultsComponent:$e=_jsx(EmptyState,{missing:"data",title:"Sorry, no results were found"}),...Ae}=D;return _jsxs(List,{...Ae,children:[M?_jsx(Progress,{}):null,!M&&he?_jsx(ResponseErrorPanel,{title:"Error encountered while fetching search results",error:he}):null,!M&&!he&&(fe==null?void 0:fe.length)?fe.map(be):null,!M&&!he&&!(fe!=null&&fe.length)?_jsx(ListItem,{children:$e}):null]})},bn=D=>{const{query:M,disableRenderingWithNoResults:he,...fe}=D;return _jsx(AnalyticsContext,{attributes:{pluginId:"search",extension:"SearchResultList"},children:_jsx(SearchResultState,{query:M,children:({loading:be,error:$e,value:Ae})=>{var We;return!(!(Ae==null||(We=Ae.results)===null||We===void 0)&&We.length)&&he?null:_jsx(On,{...fe,loading:be,error:$e,resultItems:Ae==null?void 0:Ae.results})}})})};var me=t(19126);const ee=(0,b.Z)(D=>({listSubheader:{display:"flex",alignItems:"center"},listSubheaderName:{marginLeft:D.spacing(1),textTransform:"uppercase"},listSubheaderChip:{color:D.palette.text.secondary,margin:D.spacing(0,0,0,1.5)},listSubheaderFilter:{display:"flex",color:D.palette.text.secondary,margin:D.spacing(0,0,0,1.5)},listSubheaderLink:{marginLeft:"auto",display:"flex",alignItems:"center"},listSubheaderLinkIcon:{fontSize:"inherit",marginLeft:D.spacing(.5)}})),Re=D=>{const M=ee(),{label:he,children:fe,...be}=D;return _jsx(Chip,{...be,className:M.listSubheaderFilter,variant:"outlined",label:_jsxs(_Fragment,{children:[he,": ",fe]})})},Ue=()=>null,et=(0,b.Z)(D=>({root:{fontSize:"inherit","&:focus":{outline:"none",background:D.palette.common.white},"&:not(:focus)":{cursor:"pointer",color:D.palette.primary.main,"&:hover":{textDecoration:"underline"}}}})),wt=D=>{const M=et(),{label:he,value:fe="None",onChange:be,onDelete:$e}=D,Ae=useCallback(We=>{be(We.target.value)},[be]);return _jsx(Re,{label:he,onDelete:$e,children:_jsx(Typography,{role:"textbox",component:"span",className:M.root,onChange:Ae,contentEditable:!0,suppressContentEditableWarning:!0,children:fe})})},ae=(0,b.Z)(D=>({root:{fontSize:"inherit","&:not(:focus)":{cursor:"pointer",color:D.palette.primary.main,"&:hover":{textDecoration:"underline"}},"&:focus":{outline:"none"},"&>div:first-child":{padding:0}}})),O=D=>{const M=ae(),{label:he,value:fe="none",onChange:be,onDelete:$e,children:Ae}=D,We=useCallback(st=>{be(st.target.value)},[be]);return _jsx(Re,{label:he,onDelete:$e,children:_jsxs(Select,{className:M.root,value:fe,onChange:We,input:_jsx(InputBase,{}),IconComponent:Ue,children:[_jsx(MenuItem,{value:"none",children:"None"}),Ae]})})};function ue(D){const M=ee(),[he,fe]=useState(null),{loading:be,error:$e,icon:Ae,title:We,titleProps:st={},link:S=_jsxs(_Fragment,{children:["See all",_jsx(ArrowRightIcon,{className:M.listSubheaderLinkIcon})]}),linkProps:K={},filterOptions:ge,renderFilterOption:de=Bt=>_jsx(MenuItem,{value:String(Bt),children:Bt},String(Bt)),filterFields:Ce,renderFilterField:Oe,resultItems:Me,renderResultItem:ht=Bt=>_jsx(DefaultResultListItem,{result:Bt.document},Bt.document.location),noResultsComponent:jt=_jsx(EmptyState,{missing:"data",title:"Sorry, no results were found"}),...lt}=D,ft=useCallback(Bt=>{fe(Bt.currentTarget)},[]),xt=useCallback(()=>{fe(null)},[]);var ct;return _jsxs(List,{...lt,children:[_jsxs(ListSubheader,{className:M.listSubheader,children:[Ae,_jsx(Typography,{className:M.listSubheaderName,component:"strong",...st,children:We}),ge?_jsx(Chip,{className:M.listSubheaderChip,component:"button",icon:_jsx(AddIcon,{}),variant:"outlined",label:"Add filter","aria-controls":"filters-menu","aria-haspopup":"true",onClick:ft}):null,ge?_jsx(Menu,{id:"filters-menu",anchorEl:he,open:Boolean(he),onClose:xt,onClick:xt,keepMounted:!0,children:ge.map(de)}):null,Ce==null?void 0:Ce.map(Bt=>(ct=Oe==null?void 0:Oe(Bt))!==null&&ct!==void 0?ct:null),_jsx(Link,{className:M.listSubheaderLink,to:"/search",...K,children:S})]}),be?_jsx(Progress,{}):null,!be&&$e?_jsx(ResponseErrorPanel,{title:"Error encountered while fetching search results",error:$e}):null,!be&&!$e&&(Me==null?void 0:Me.length)?Me.map(ht):null,!be&&!$e&&!(Me!=null&&Me.length)?_jsx(ListItem,{children:jt}):null]})}function Be(D){const{query:M,linkProps:he={},disableRenderingWithNoResults:fe,...be}=D,$e=`/search?${qs.stringify({query:M.term,types:M.types,filters:M.filters,pageCursor:M.pageCursor},{arrayFormat:"brackets"})}`;return _jsx(AnalyticsContext,{attributes:{pluginId:"search",extension:"SearchResultGroup"},children:_jsx(SearchResultState,{query:M,children:({loading:Ae,error:We,value:st})=>{var S;if(!(!(st==null||(S=st.results)===null||S===void 0)&&S.length)&&fe)return null;var K;return _jsx(ue,{...be,loading:Ae,error:We,linkProps:{to:$e,...he},resultItems:st==null?void 0:st.results,filterFields:Object.keys((K=M.filters)!==null&&K!==void 0?K:{})})}})})}},61886:function(At,Fe,t){"use strict";t.d(Fe,{Ox:function(){return Ke},jM:function(){return g},Zz:function(){return b},oZ:function(){return Qe},DR:function(){return c},ZS:function(){return Le},VA:function(){return it},KY:function(){return te},gT:function(){return Y},Dl:function(){return ce},ux:function(){return vt},$L:function(){return F},x1:function(){return Xe}});var h=t(52322),r=t(2784),W=t(79635),k=t(25248);const g="techdocs.addons.addon.v1",b="techdocs.addons.wrapper.v1",c=()=>null;(0,k.R5)(c,b,!0);const P=ne=>`${g}.${ne.toLocaleLowerCase("en-US")}`;function te(ne){const{name:Pe,component:ke}=ne;return(0,k.YO)({name:Pe,component:{sync:tt=>(0,h.jsx)(ke,{...tt})},data:{[g]:ne,[P(Pe)]:!0}})}const _=(ne,Pe)=>ne.selectByComponentData({key:Pe}).getElements()[0],X=ne=>ne.selectByComponentData({key:b}).selectByComponentData({key:g}),U=ne=>ne.selectByComponentData({key:b}).findComponentData({key:g}),F=()=>{const ne=(0,W.pC)(),Pe=(0,k.vJ)(ne,X),ke=(0,k.vJ)(ne,U),tt=(0,r.useCallback)(pt=>{if(!Pe||!pt)return null;const Tt=P(pt.name);var It;return(It=_(Pe,Tt))!==null&&It!==void 0?It:null},[Pe]),yt=(0,r.useCallback)(pt=>{const Tt=ke.find(It=>It.name===pt);return Tt?tt(Tt):null},[ke,tt]),Zt=(0,r.useCallback)(pt=>{const Tt=ke.filter(It=>It.location===pt);return Tt.length?Tt.map(tt):null},[ke,tt]);return{renderComponentByName:yt,renderComponentsByLocation:Zt}},Y=(0,k.T0)({id:"plugin.techdocs.service"}),ce=(0,k.T0)({id:"plugin.techdocs.storageservice"});var se=t(64279),T=t(25271),R=t(51837);function V(ne,Pe){return Pe.getOptionalBoolean("techdocs.legacyUseCaseSensitiveTripletPaths")||(ne.kind=ne.kind.toLocaleLowerCase(),ne.name=ne.name.toLocaleLowerCase(),ne.namespace=ne.namespace.toLocaleLowerCase()),ne}const A=(ne,Pe)=>(0,T.eE)(ne)===(0,T.eE)(Pe),C={title:"",subtitle:"",setTitle:()=>{},setSubtitle:()=>{},setShadowRoot:()=>{},metadata:{loading:!0},entityMetadata:{loading:!0},entityRef:{kind:"",name:"",namespace:""}},z=(0,R.CT)("techdocs-reader-page-context"),Le=(0,r.memo)(({entityRef:ne,children:Pe})=>{const ke=(0,k.h_)(Y),tt=(0,k.h_)(k.Ds),yt=(0,se.default)(async()=>ke.getTechDocsMetadata(ne),[ne]),Zt=(0,se.default)(async()=>ke.getEntityMetadata(ne),[ne]),[pt,Tt]=(0,r.useState)(C.title),[It,Ot]=(0,r.useState)(C.subtitle),[en,Wt]=(0,r.useState)(C.shadowRoot),Vt={metadata:yt,entityRef:V(ne,tt),entityMetadata:Zt,shadowRoot:en,setShadowRoot:Wt,title:pt,setTitle:Tt,subtitle:It,setSubtitle:Ot},Qt=(0,R.EI)({1:Vt});return(0,h.jsx)(k.fC,{attributes:{entityRef:(0,T.eE)(ne)},children:(0,h.jsx)(z.Provider,{value:Qt,children:Pe instanceof Function?Pe(Vt):Pe})})},(ne,Pe)=>A(ne.entityRef,Pe.entityRef)),Xe=()=>{const ne=(0,r.useContext)(z);if(ne===void 0)return C;const Pe=ne.atVersion(1);if(Pe===void 0)throw new Error("No context found for version 1.");return Pe},Qe=Object.freeze({Header:"Header",Subheader:"Subheader",Settings:"Settings",PrimarySidebar:"PrimarySidebar",SecondarySidebar:"SecondarySidebar",Content:"Content"});var _e=t(70882),Ge=t(50236),mt=t(19219),Ee=t(93414);const Ke="TECH_DOCS_SHADOW_DOM_STYLE_LOAD",at=ne=>{(0,r.useEffect)(()=>{if(!ne)return()=>{};const Pe=ne.querySelectorAll('head > link[rel="stylesheet"]');var ke;let tt=(ke=Pe==null?void 0:Pe.length)!==null&&ke!==void 0?ke:0;const yt=new CustomEvent(Ke);if(!tt)return ne.dispatchEvent(yt),()=>{};const Zt=()=>{--tt===0&&ne.dispatchEvent(yt)};return Pe==null||Pe.forEach(pt=>{pt.addEventListener("load",Zt)}),()=>{Pe==null||Pe.forEach(pt=>{pt.removeEventListener("load",Zt)})}},[ne])},vt=ne=>{const[Pe,ke]=(0,r.useState)(!1);return(0,r.useEffect)(()=>{if(!ne)return()=>{};ke(!0);const tt=ne.style;tt.setProperty("opacity","0");const yt=()=>{ke(!1),tt.setProperty("opacity","1")};return ne.addEventListener(Ke,yt),()=>{ne.removeEventListener(Ke,yt)}},[ne]),Pe},it=({element:ne,onAppend:Pe,children:ke})=>{const[tt,yt]=(0,r.useState)((0,_e.Ue)({...(0,Ge.Z)(),insertionPoint:void 0}));at(ne);const Zt=vt(ne),pt=(0,r.useCallback)(Tt=>{if(!ne||!Tt)return;yt((0,_e.Ue)({...(0,Ge.Z)(),insertionPoint:ne.querySelector("head")||void 0}));let It=Tt.shadowRoot;It||(It=Tt.attachShadow({mode:"open"})),It.replaceChildren(ne),typeof Pe=="function"&&Pe(It)},[ne,Pe]);return(0,h.jsxs)(h.Fragment,{children:[Zt&&(0,h.jsx)(Ee.Ex,{}),(0,h.jsxs)(mt.ZP,{jss:tt,sheetsManager:new Map,children:[(0,h.jsx)("div",{ref:pt,"data-testid":"techdocs-native-shadowroot"}),ke]})]})};var gt=t(54073);const nt=()=>{const{shadowRoot:ne}=useTechDocsReaderPage();return ne},Lt=ne=>{const Pe=nt();return Pe?ne.map(ke=>Pe==null?void 0:Pe.querySelectorAll(ke)).filter(ke=>ke.length).map(ke=>Array.from(ke)).flat():[]},bt=ne=>ne.toString()&&ne.rangeCount&&ne.getRangeAt(0).getBoundingClientRect().top,ze=(ne=0)=>{const Pe=nt(),[ke,tt]=useState(null),yt=useMemo(()=>debounce(()=>{const Zt=Pe,pt=Zt.getSelection?Zt.getSelection():document.getSelection();pt&&bt(pt)?tt(pt):tt(null)},ne),[Pe,tt,ne]);return useEffect(()=>(window.document.addEventListener("selectionchange",yt),()=>window.document.removeEventListener("selectionchange",yt)),[yt]),ke}},52943:function(At,Fe,t){"use strict";t.r(Fe),t.d(Fe,{EmbeddedDocsRouter:function(){return se},Router:function(){return ce},isTechDocsAvailable:function(){return Y}});var h=t(52322),r=t(2784),W=t(79635),k=t(56941),g=t(93414),b=t(25271),c=t(89258),P=t(65124),te=t(67896);const _=({entity:T})=>{const R=(0,b.iB)(T);return(0,h.jsxs)(c.I6,{entityRef:R,children:[(0,h.jsx)(P.b,{}),(0,h.jsx)(te.F,{withSearch:!1})]})};var X=t(18662),U=t(7476);const F="backstage.io/techdocs-ref",Y=T=>{var R,V;return Boolean(T==null||(R=T.metadata)===null||R===void 0||(V=R.annotations)===null||V===void 0?void 0:V[F])},ce=()=>(0,h.jsxs)(W.Z5,{children:[(0,h.jsx)(W.AW,{path:"/",element:(0,h.jsx)(X.TechDocsIndexPage,{})}),(0,h.jsx)(W.AW,{path:"/:namespace/:kind/:name/*",element:(0,h.jsx)(U.TechDocsReaderPage,{})})]}),se=T=>{var R;const{children:V}=T,{entity:A}=(0,k.X2)(),C=(0,W.V$)([{path:"/*",element:(0,h.jsx)(_,{entity:A}),children:[{path:"*",element:V}]}]);return((R=A.metadata.annotations)===null||R===void 0?void 0:R[F])?C:(0,h.jsx)(g.sk,{annotation:F})}},92077:function(At,Fe,t){"use strict";t.d(Fe,{k:function(){return g},p:function(){return k}});var h=t(23054),r=t(76372),W=t.n(r);class k{async getApiOrigin(){return await this.discoveryApi.getBaseUrl("techdocs")}async getTechDocsMetadata(c){const{kind:P,namespace:te,name:_}=c,U=`${await this.getApiOrigin()}/metadata/techdocs/${te}/${P}/${_}`,F=await this.fetchApi.fetch(`${U}`);if(!F.ok)throw await h.VL.fromResponse(F);return await F.json()}async getEntityMetadata(c){const{kind:P,namespace:te,name:_}=c,U=`${await this.getApiOrigin()}/metadata/entity/${te}/${P}/${_}`,F=await this.fetchApi.fetch(`${U}`);if(!F.ok)throw await h.VL.fromResponse(F);return await F.json()}constructor(c){this.configApi=c.configApi,this.discoveryApi=c.discoveryApi,this.fetchApi=c.fetchApi}}class g{async getApiOrigin(){return await this.discoveryApi.getBaseUrl("techdocs")}async getStorageUrl(){var c;return(c=this.configApi.getOptionalString("techdocs.storageUrl"))!==null&&c!==void 0?c:`${await this.discoveryApi.getBaseUrl("techdocs")}/static/docs`}async getBuilder(){return this.configApi.getString("techdocs.builder")}async getEntityDocs(c,P){const{kind:te,namespace:_,name:X}=c,F=`${await this.getStorageUrl()}/${_}/${te}/${X}/${P}`,Y=await this.fetchApi.fetch(`${F.endsWith("/")?F:`${F}/`}index.html`);let ce="";switch(Y.status){case 404:throw ce="Page not found. ",P||(ce+="This could be because there is no index.md file in the root of the docs directory of this repository."),new h.dR(ce);case 500:throw ce="Could not generate documentation or an error in the TechDocs backend. ",new Error(ce);default:break}return Y.text()}async syncEntityDocs(c,P=()=>{}){const{kind:te,namespace:_,name:X}=c,F=`${await this.getApiOrigin()}/sync/${_}/${te}/${X}`,{token:Y}=await this.identityApi.getCredentials();return new Promise((ce,se)=>{const T=new r.EventSourcePolyfill(F,{withCredentials:!0,headers:Y?{Authorization:`Bearer ${Y}`}:{}});T.addEventListener("log",R=>{R.data&&P(JSON.parse(R.data))}),T.addEventListener("finish",R=>{let V=!1;R.data&&({updated:V}=JSON.parse(R.data)),ce(V?"updated":"cached")}),T.onerror=R=>{switch(T.close(),R.status){case 404:se(new h.dR(R.message));return;default:se(new Error(R.data));return}}})}async getBaseUrl(c,P,te){const{kind:_,namespace:X,name:U}=P,Y=`${await this.getApiOrigin()}/static/docs/${X}/${_}/${U}/${te}`;return new URL(c,Y.endsWith("/")?Y:`${Y}/`).toString()}constructor(c){this.configApi=c.configApi,this.discoveryApi=c.discoveryApi,this.identityApi=c.identityApi,this.fetchApi=c.fetchApi}}},51953:function(At,Fe,t){"use strict";t.d(Fe,{D:function(){return h}});function h(r,W){return W.getOptionalBoolean("techdocs.legacyUseCaseSensitiveTripletPaths")?r:r.toLocaleLowerCase("en-US")}},3482:function(At,Fe,t){"use strict";t.d(Fe,{u:function(){return P}});var h=t(52322),r=t(2784),W=t(93414),k=t(56941),g=t(42081),b=t(48431),c=t(68435);const P=te=>{const{initialFilter:_="owned",columns:X,actions:U}=te;return(0,h.jsx)(g.j,{children:(0,h.jsxs)(W.VY,{children:[(0,h.jsx)(W.yW,{title:"",children:(0,h.jsx)(W.qt,{children:"Discover documentation in your ecosystem."})}),(0,h.jsx)(k.UO,{children:(0,h.jsxs)(k._i,{children:[(0,h.jsxs)(k._i.Filters,{children:[(0,h.jsx)(b.f,{}),(0,h.jsx)(k.EW,{initialFilter:_}),(0,h.jsx)(k.dq,{}),(0,h.jsx)(k.xE,{})]}),(0,h.jsx)(k._i.Content,{children:(0,h.jsx)(c.n,{actions:U,columns:X})})]})})]})})}},85478:function(At,Fe,t){"use strict";t.d(Fe,{f:function(){return X}});var h=t(52322),r=t(95573),W=t(51953),k=t(25248),g=t(93414),b=t(94339),c=t(16111),P=t(24579),te=t(14503),_=t(2784);const X=se=>{const{entities:T}=se,R=(0,k.tg)(r.Fw),V=(0,k.h_)(k.Ds);if(!T)return null;var A,C;return(0,h.jsx)(g.Oh,{"data-testid":"docs-explore",children:T!=null&&T.length?T.map((z,Le)=>(0,h.jsxs)(b.Z,{children:[(0,h.jsx)(c.Z,{children:(0,h.jsx)(g.hu,{title:(A=z.metadata.title)!==null&&A!==void 0?A:z.metadata.name})}),(0,h.jsx)(P.Z,{children:z.metadata.description}),(0,h.jsx)(te.Z,{children:(0,h.jsx)(g.zx,{to:R({namespace:(0,W.D)((C=z.metadata.namespace)!==null&&C!==void 0?C:"default",V),kind:(0,W.D)(z.kind,V),name:(0,W.D)(z.metadata.name,V)}),color:"primary","data-testid":"read_docs",children:"Read Docs"})})]},Le)):null})};var U=t(56941);const F={title:"All Documentation",filterPredicate:()=>!0},Y=({entities:se,group:T})=>{const{loading:R,isOwnedEntity:V}=useEntityOwnership(),A=se.filter(z=>T.filterPredicate==="ownedByUser"?R?!1:V(z):typeof T.filterPredicate=="function"&&T.filterPredicate(z)),C=(()=>typeof T.title=="string"?_jsx(ContentHeader,{title:T.title}):T.title)();return A.length===0?null:_jsxs(Content,{children:[C,_jsx(DocsCardGrid,{entities:A})]})},ce=({groups:se})=>{const{loading:T,error:R,entities:V}=useEntityList();if(R)return _jsx(WarningPanel,{severity:"error",title:"Could not load available documentation.",children:_jsx(CodeSnippet,{language:"text",text:R.toString()})});if(T)return _jsx(Progress,{});if(V.length===0)return _jsx("div",{"data-testid":"doc-not-found",children:_jsxs(Typography,{variant:"body2",children:["No documentation found that match your filter. Learn more about"," ",_jsx(Link,{to:"https://backstage.io/docs/features/techdocs/creating-and-publishing",children:"publishing documentation"}),"."]})});var A,C;return V.sort((z,Le)=>((A=z.metadata.title)!==null&&A!==void 0?A:z.metadata.name).localeCompare((C=Le.metadata.title)!==null&&C!==void 0?C:Le.metadata.name)),_jsx(Content,{children:(se||[F]).map((z,Le)=>_jsx(Y,{entities:V,group:z},`${z.title}-${Le}`))})}},68435:function(At,Fe,t){"use strict";t.d(Fe,{H:function(){return V},n:function(){return A}});var h=t(52322),r=t(2784),W=t(95074),k=t(76635),g=t(93414),b=t(56941),c=t(25248),P=t(25271),te=t(95573),_=t(39981),X=t(2337),U=t(11640),F=t(28347);const Y=(0,X.Z)({root:{color:"#f3ba37"}})(U.Z),ce={createCopyDocsUrlAction(C){return z=>({icon:()=>(0,h.jsx)(_.Z,{fontSize:"small"}),tooltip:"Click to copy documentation link to clipboard",onClick:()=>C(`${window.location.origin}${z.resolved.docsUrl}`)})},createStarEntityAction(C,z){return({entity:Le})=>{const Xe=C(Le);return{cellStyle:{paddingLeft:"1em"},icon:()=>Xe?(0,h.jsx)(Y,{}):(0,h.jsx)(F.Z,{}),tooltip:Xe?"Remove from favorites":"Add to favorites",onClick:()=>z(Le)}}}};function se(C){return C.metadata.title||C.metadata.name}const T={createNameColumn(){return{title:"Document",field:"entity.metadata.name",highlight:!0,render:C=>(0,h.jsx)(g.uw,{value:(0,h.jsx)(g.rU,{to:C.resolved.docsUrl,children:se(C.entity)}),subvalue:C.entity.metadata.description})}},createOwnerColumn(){return{title:"Owner",field:"resolved.ownedByRelationsTitle",render:({resolved:C})=>(0,h.jsx)(b.rI,{entityRefs:C.ownedByRelations,defaultKind:"group"})}},createTypeColumn(){return{title:"Type",field:"entity.spec.type"}}};var R=t(51953);const V=C=>{const{entities:z,title:Le,loading:Xe,columns:Qe,actions:_e}=C,[,Ge]=(0,W.Z)(),mt=(0,c.tg)(te.Fw),Ee=(0,c.h_)(c.Ds);if(!z)return null;const Ke=z.map(it=>{const gt=(0,b.hF)(it,P.S4);var nt;return{entity:it,resolved:{docsUrl:mt({namespace:(0,R.D)((nt=it.metadata.namespace)!==null&&nt!==void 0?nt:"default",Ee),kind:(0,R.D)(it.kind,Ee),name:(0,R.D)(it.metadata.name,Ee)}),ownedByRelations:gt,ownedByRelationsTitle:gt.map(Lt=>(0,b.$3)(Lt,{defaultKind:"group"})).join(", ")}}}),at=[T.createNameColumn(),T.createOwnerColumn(),T.createTypeColumn()],vt=[ce.createCopyDocsUrlAction(Ge)];return(0,h.jsx)(h.Fragment,{children:Xe||Ke&&Ke.length>0?(0,h.jsx)(g.iA,{isLoading:Xe,options:{paging:!0,pageSize:20,search:!0,actionsColumnIndex:-1},data:Ke,columns:Qe||at,actions:_e||vt,title:Le?`${Le} (${Ke.length})`:`All (${Ke.length})`}):(0,h.jsx)(g.ub,{missing:"data",title:"No documents to show",description:"Create your own document. Check out our Getting Started Information",action:(0,h.jsx)(g.zx,{color:"primary",to:"https://backstage.io/docs/features/techdocs/getting-started",variant:"contained",children:"DOCS"})})})};V.columns=T,V.actions=ce;const A=C=>{var z;const{columns:Le,actions:Xe}=C,{loading:Qe,error:_e,entities:Ge,filters:mt}=(0,b.wp)(),{isStarredEntity:Ee,toggleStarredEntity:Ke}=(0,b.CR)(),[,at]=(0,W.Z)();var vt;const it=(0,k.capitalize)((vt=(z=mt.user)===null||z===void 0?void 0:z.value)!==null&&vt!==void 0?vt:"all"),gt=[ce.createCopyDocsUrlAction(at),ce.createStarEntityAction(Ee,Ke)];return _e?(0,h.jsx)(g.GB,{severity:"error",title:"Could not load available documentation.",children:(0,h.jsx)(g.Oi,{language:"text",text:_e.toString()})}):(0,h.jsx)(V,{title:it,entities:Ge,loading:Qe,actions:Xe||gt,columns:Le})};A.columns=T,A.actions=ce},18662:function(At,Fe,t){"use strict";t.r(Fe),t.d(Fe,{TechDocsIndexPage:function(){return g}});var h=t(52322),r=t(2784),W=t(79635),k=t(3482);const g=b=>(0,W.pC)()||(0,h.jsx)(k.u,{...b})},42081:function(At,Fe,t){"use strict";t.d(Fe,{j:function(){return g}});var h=t(52322),r=t(2784),W=t(93414),k=t(25248);const g=b=>{const{children:c}=b,P=(0,k.h_)(k.Ds);var te;const _=`Documentation available in ${(te=P.getOptionalString("organization.name"))!==null&&te!==void 0?te:"Backstage"}`;return(0,h.jsx)(W.g9,{title:"Documentation",subtitle:_,themeId:"documentation",children:c})}},48431:function(At,Fe,t){"use strict";t.d(Fe,{f:function(){return k}});var h=t(2784),r=t(56941);class W{getCatalogFilters(){return{"metadata.annotations.backstage.io/techdocs-ref":r.n3}}}const k=()=>{const{updateFilters:g}=(0,r.wp)();return(0,h.useEffect)(()=>{g({techdocs:new W})},[g]),null}},89258:function(At,Fe,t){"use strict";t.d(Fe,{I6:function(){return _},Jl:function(){return te},s4:function(){return g}});var h=t(61886),r=t(92077),W=t(95573),k=t(25248);const g=(0,k.rx)({id:"techdocs",apis:[(0,k.ni)({api:h.Dl,deps:{configApi:k.Ds,discoveryApi:k.NW,identityApi:k.$4,fetchApi:k.gP},factory:({configApi:X,discoveryApi:U,identityApi:F,fetchApi:Y})=>new r.k({configApi:X,discoveryApi:U,identityApi:F,fetchApi:Y})}),(0,k.ni)({api:h.gT,deps:{configApi:k.Ds,discoveryApi:k.NW,fetchApi:k.gP},factory:({configApi:X,discoveryApi:U,fetchApi:F})=>new r.p({configApi:X,discoveryApi:U,fetchApi:F})})],routes:{root:W._Z,docRoot:W.Fw,entityContent:W.pd}}),b=g.provide((0,k.P4)({name:"TechdocsPage",component:()=>Promise.resolve().then(t.bind(t,52943)).then(X=>X.Router),mountPoint:W._Z})),c=g.provide((0,k.P4)({name:"EntityTechdocsContent",component:()=>Promise.resolve().then(t.bind(t,52943)).then(X=>X.EmbeddedDocsRouter),mountPoint:W.pd})),P=g.provide((0,k.P4)({name:"TechDocsCustomHome",component:()=>t.e(7560).then(t.bind(t,27560)).then(X=>X.TechDocsCustomHome),mountPoint:W._Z})),te=g.provide((0,k.P4)({name:"TechDocsIndexPage",component:()=>Promise.resolve().then(t.bind(t,18662)).then(X=>X.TechDocsIndexPage),mountPoint:W._Z})),_=g.provide((0,k.P4)({name:"TechDocsReaderPage",component:()=>Promise.resolve().then(t.bind(t,7476)).then(X=>X.TechDocsReaderPage),mountPoint:W.Fw}))},7476:function(At,Fe,t){"use strict";t.r(Fe),t.d(Fe,{TechDocsReaderLayout:function(){return X},TechDocsReaderPage:function(){return U}});var h=t(52322),r=t(2784),W=t(79635),k=t(93414),g=t(61886),b=t(67896),c=t(93225),P=t(65124),te=t(95573),_=t(25248);const X=({withSearch:F,withHeader:Y=!0})=>(0,h.jsxs)(k.T3,{themeId:"documentation",children:[Y&&(0,h.jsx)(c.S,{}),(0,h.jsx)(P.b,{}),(0,h.jsx)(b.F,{withSearch:F})]}),U=F=>{const{kind:Y,name:ce,namespace:se}=(0,_.Oi)(te.Fw),{children:T,entityRef:R={kind:Y,name:ce,namespace:se}}=F,V=(0,W.pC)();if(!T){const C=V?r.Children.toArray(V.props.children):[];var A;const Le=C.flatMap(Xe=>{var Qe;return(A=Xe==null||(Qe=Xe.props)===null||Qe===void 0?void 0:Qe.children)!==null&&A!==void 0?A:[]}).find(Xe=>!(0,_.IY)(Xe,g.Zz)&&!(0,_.IY)(Xe,g.jM));return(0,h.jsx)(g.ZS,{entityRef:R,children:Le||(0,h.jsx)(X,{})})}return(0,h.jsx)(g.ZS,{entityRef:R,children:({metadata:C,entityMetadata:z,onReady:Le})=>(0,h.jsx)("div",{className:"techdocs-reader-page",children:(0,h.jsx)(k.T3,{themeId:"documentation",children:T instanceof Function?T({entityRef:R,techdocsMetadataValue:C.value,entityMetadataValue:z.value,onReady:Le}):T})})})}},67896:function(At,Fe,t){"use strict";t.d(Fe,{F:function(){return We}});var h=t(52322),r=t(2784),W=t(79692),k=t(60905),g=t(61886),b=t(93414),c=t(17339),P=t(4614),te=t(77277),_=t(99688),X=t(12420),U=t(90436),F=t(61837),Y=t(4190),ce=t(87685);const se=(0,W.Z)(S=>(0,X.Z)({paper:{width:"100%",[S.breakpoints.up("sm")]:{width:"75%"},[S.breakpoints.up("md")]:{width:"50%"},padding:S.spacing(2.5)},root:{height:"100%",overflow:"hidden"},logs:{background:S.palette.background.default}})),T=({buildLog:S,onClose:K})=>{const ge=se(),de=S.length===0?"Waiting for logs...":S.join(`
|
|
37
|
+
`);return(0,h.jsxs)(k.Z,{container:!0,direction:"column",className:ge.root,spacing:0,wrap:"nowrap",children:[(0,h.jsxs)(k.Z,{item:!0,container:!0,justifyContent:"space-between",alignItems:"center",spacing:0,wrap:"nowrap",children:[(0,h.jsx)(U.Z,{variant:"h5",children:"Build Details"}),(0,h.jsx)(F.Z,{title:"Close the drawer",onClick:K,color:"inherit",children:(0,h.jsx)(ce.Z,{})},"dismiss")]}),(0,h.jsx)(k.Z,{item:!0,xs:!0,children:(0,h.jsx)(b.nU,{text:de,classes:{root:ge.logs}})})]})},R=({buildLog:S})=>{const K=se(),[ge,de]=(0,r.useState)(!1);return(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(te.Z,{color:"inherit",onClick:()=>de(!0),children:"Show Build Logs"}),(0,h.jsx)(Y.ZP,{classes:{paper:K.paper},anchor:"right",open:ge,onClose:()=>de(!1),children:(0,h.jsx)(T,{buildLog:S,onClose:()=>de(!1)})})]})};var V=t(25248);const A=({errorMessage:S})=>{const K=(0,V.h_)(V.Ds).getOptionalString("techdocs.builder");let ge="";return K!=="local"&&(ge="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."),(0,h.jsx)(b.mf,{status:"404",statusMessage:S||"Documentation not found",additionalInfo:ge})};var C=t(95481);const z=(0,W.Z)(S=>({root:{marginBottom:S.spacing(2)},message:{wordBreak:"break-word",overflowWrap:"anywhere"}})),Le=()=>{let S=null;const K=z(),{state:ge,contentReload:de,contentErrorMessage:Ce,syncErrorMessage:Oe,buildLog:Me}=(0,C.DK)();return ge==="INITIAL_BUILD"&&(S=(0,h.jsx)(_.Z,{classes:{root:K.root},variant:"outlined",severity:"info",icon:(0,h.jsx)(P.Z,{size:"24px"}),action:(0,h.jsx)(R,{buildLog:Me}),children:"Documentation is accessed for the first time and is being prepared. The subsequent loads are much faster."})),ge==="CONTENT_STALE_REFRESHING"&&(S=(0,h.jsx)(_.Z,{variant:"outlined",severity:"info",icon:(0,h.jsx)(P.Z,{size:"24px"}),action:(0,h.jsx)(R,{buildLog:Me}),classes:{root:K.root},children:"A newer version of this documentation is being prepared and will be available shortly."})),ge==="CONTENT_STALE_READY"&&(S=(0,h.jsx)(_.Z,{variant:"outlined",severity:"success",action:(0,h.jsx)(te.Z,{color:"inherit",onClick:()=>de(),children:"Refresh"}),classes:{root:K.root},children:"A newer version of this documentation is now available, please refresh to view."})),ge==="CONTENT_STALE_ERROR"&&(S=(0,h.jsxs)(_.Z,{variant:"outlined",severity:"error",action:(0,h.jsx)(R,{buildLog:Me}),classes:{root:K.root,message:K.message},children:["Building a newer version of this documentation failed."," ",Oe]})),ge==="CONTENT_NOT_FOUND"&&(S=(0,h.jsxs)(h.Fragment,{children:[Oe&&(0,h.jsxs)(_.Z,{variant:"outlined",severity:"error",action:(0,h.jsx)(R,{buildLog:Me}),classes:{root:K.root,message:K.message},children:["Building a newer version of this documentation failed."," ",Oe]}),(0,h.jsx)(A,{errorMessage:Ce})]})),S};var Xe=t(79635),Qe=t(60364),_e=t(41156),Ge=t(32838),mt=t(35368),Ee=t.n(mt);const Ke=/main\.[A-Fa-f0-9]{8}\.min\.css$/,at=/^https:\/\/fonts\.googleapis\.com/,vt=/^https:\/\/fonts\.gstatic\.com/,it=S=>S.nodeName==="LINK",gt=S=>{const K=(S==null?void 0:S.getAttribute("href"))||"",ge=K.match(Ke),de=K.match(at),Ce=K.match(vt);return ge||de||Ce},nt=S=>(it(S)&&!gt(S)&&S.remove(),S),Lt=S=>S.nodeName==="IFRAME",bt=(S,K)=>{const ge=S.getAttribute("src")||"";try{const{host:de}=new URL(ge);return K.includes(de)}catch{return!1}},ze=S=>K=>(Lt(K)&&!bt(K,S)&&K.remove(),K),ne=()=>{const S=(0,V.h_)(V.Ds);return(0,r.useMemo)(()=>S.getOptionalConfig("techdocs.sanitizer"),[S])},Pe=()=>{const S=ne();return(0,r.useCallback)(async K=>{const ge=S==null?void 0:S.getOptionalStringArray("allowedIframeHosts");Ee().addHook("beforeSanitizeElements",nt);const de=["link"];return ge&&(de.push("iframe"),Ee().addHook("beforeSanitizeElements",ze(ge))),Ee().sanitize(K.innerHTML,{ADD_TAGS:de,FORBID_TAGS:["style"],WHOLE_DOCUMENT:!0,RETURN_DOM:!0})},[S])};var ke=t(41128),tt=({theme:S})=>`
|
|
38
38
|
/*================== Variables ==================*/
|
|
39
39
|
/*
|
|
40
40
|
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.
|
|
@@ -142,7 +142,7 @@ spec:
|
|
|
142
142
|
--md-typeset-font-size: .7rem;
|
|
143
143
|
}
|
|
144
144
|
}
|
|
145
|
-
`,
|
|
145
|
+
`,yt=({theme:S})=>`
|
|
146
146
|
/*================== Reset ==================*/
|
|
147
147
|
|
|
148
148
|
body {
|
|
@@ -152,7 +152,7 @@ body {
|
|
|
152
152
|
font-family: var(--md-text-font-family);
|
|
153
153
|
background-color: unset;
|
|
154
154
|
}
|
|
155
|
-
`;const Zt="224px";var
|
|
155
|
+
`;const Zt="224px";var pt=({theme:S,sidebar:K})=>`
|
|
156
156
|
/*================== Layout ==================*/
|
|
157
157
|
|
|
158
158
|
.md-grid {
|
|
@@ -239,7 +239,13 @@ body {
|
|
|
239
239
|
.md-footer {
|
|
240
240
|
position: fixed;
|
|
241
241
|
bottom: 0px;
|
|
242
|
+
pointer-events: none;
|
|
242
243
|
}
|
|
244
|
+
|
|
245
|
+
.md-footer-nav__link {
|
|
246
|
+
pointer-events: all;
|
|
247
|
+
}
|
|
248
|
+
|
|
243
249
|
.md-footer__title {
|
|
244
250
|
background-color: unset;
|
|
245
251
|
}
|
|
@@ -309,7 +315,7 @@ body {
|
|
|
309
315
|
.md-sidebar--primary {
|
|
310
316
|
width: 12.1rem !important;
|
|
311
317
|
z-index: 200;
|
|
312
|
-
left: ${
|
|
318
|
+
left: ${K.isPinned?`calc(-12.1rem + ${Zt})`:"calc(-12.1rem + 72px)"} !important;
|
|
313
319
|
}
|
|
314
320
|
.md-sidebar--secondary:not([hidden]) {
|
|
315
321
|
display: none;
|
|
@@ -353,13 +359,13 @@ body {
|
|
|
353
359
|
font-size: var(--md-typeset-font-size);
|
|
354
360
|
}
|
|
355
361
|
|
|
356
|
-
${Tt.reduce((
|
|
357
|
-
.md-typeset ${
|
|
362
|
+
${Tt.reduce((K,ge)=>{var de;const Ce=(de=S.typography.htmlFontSize)!==null&&de!==void 0?de:16,Oe=S.typography[ge],{lineHeight:Me,fontFamily:ht,fontWeight:jt,fontSize:lt}=Oe,ft=xt=>{let ct=1;return typeof xt=="number"&&(ct=xt/Ce*.6),typeof xt=="string"&&(ct=xt.replace("rem","")),`calc(${ct} * var(--md-typeset-font-size))`};return K.concat(`
|
|
363
|
+
.md-typeset ${ge} {
|
|
358
364
|
color: var(--md-default-fg-color);
|
|
359
365
|
line-height: ${Me};
|
|
360
|
-
font-family: ${
|
|
366
|
+
font-family: ${ht};
|
|
361
367
|
font-weight: ${jt};
|
|
362
|
-
font-size: ${
|
|
368
|
+
font-size: ${ft(lt)};
|
|
363
369
|
}
|
|
364
370
|
`)},"")}
|
|
365
371
|
|
|
@@ -489,9 +495,9 @@ ${Tt.reduce((G,me)=>{var he;const Ce=(he=S.typography.htmlFontSize)!==null&&he!=
|
|
|
489
495
|
height: 20px !important;
|
|
490
496
|
transform: translateY(-50%) !important;
|
|
491
497
|
}
|
|
492
|
-
`;const Wt=[tt,
|
|
493
|
-
${
|
|
498
|
+
`;const Wt=[tt,yt,pt,It,Ot,en],Vt=()=>(0,b.Pf)(),Qt=()=>{const S=Vt(),K=(0,Qe.Z)();return(0,r.useMemo)(()=>{const ge={theme:K,sidebar:S};return Wt.reduce((de,Ce)=>de+Ce(ge),"")},[K,S])},un=()=>{const S=Qt();return(0,r.useCallback)(K=>(K.getElementsByTagName("head")[0].insertAdjacentHTML("beforeend",`<style>${S}</style>`),K),[S])},cn=(S,K,ge)=>{const de=S==="src"&&K.endsWith(".svg"),Ce=!K.match(/^([a-z]*:)?\/\//i),Oe=K.startsWith(ge);return de&&(Ce||Oe)},Fn=({techdocsStorageApi:S,entityId:K,path:ge})=>async de=>{const Ce=await S.getApiOrigin(),Oe=async(Me,ht)=>{for(const jt of Me)if(jt.hasAttribute(ht)){const lt=jt.getAttribute(ht);if(!lt)return;const ft=await S.getBaseUrl(lt,K,ge);if(cn(ht,lt,Ce))try{const ct=await(await fetch(ft,{credentials:"include"})).text();jt.setAttribute(ht,`data:image/svg+xml;base64,${btoa(unescape(encodeURIComponent(ct)))}`)}catch{jt.setAttribute("alt",`Error: ${lt}`)}else jt.setAttribute(ht,ft)}};return await Promise.all([Oe(de.querySelectorAll("img"),"src"),Oe(de.querySelectorAll("script"),"src"),Oe(de.querySelectorAll("source"),"src"),Oe(de.querySelectorAll("link"),"href"),Oe(de.querySelectorAll("a[download]"),"href")]),de};var In=t(79158),Un=t(67097),vn=t(28316),hn=t(82717),Xt=t.n(hn);const Mn=S=>K=>{var ge;const de=K.querySelector('[title="Edit this page"]');if(!de||!de.href)return K;const Ce=new URL(de.href),Oe=S.byUrl(Ce);if((Oe==null?void 0:Oe.type)!=="github"&&(Oe==null?void 0:Oe.type)!=="gitlab")return K;const Me=((ge=K.querySelector("article>h1"))===null||ge===void 0?void 0:ge.childNodes[0].textContent)||"",ht=encodeURIComponent(`Documentation Feedback: ${Me}`),jt=encodeURIComponent(`Page source:
|
|
499
|
+
${de.href}
|
|
494
500
|
|
|
495
|
-
Feedback:`),at=(Oe==null?void 0:Oe.type)==="github"?(0,In.BT)(Ce.href,"blob"):Ce.href,pt=Xt()(at),yt=`/${pt.organization}/${pt.name}`,lt=he.cloneNode();switch(Oe==null?void 0:Oe.type){case"gitlab":lt.href=`${Ce.origin}${yt}/issues/new?issue[title]=${dt}&issue[description]=${jt}`;break;case"github":lt.href=`${Ce.origin}${yt}/issues/new?title=${dt}&body=${jt}`;break;default:return G}return vn.render(r.createElement(Un.Z),lt),lt.style.paddingLeft="5px",lt.title="Leave feedback for this page",lt.id="git-feedback-link",he==null||he.insertAdjacentElement("beforebegin",lt),G};var zn=t(44882);const pn=()=>S=>{const G=S.querySelector('.md-header label[for="__drawer"]'),me=S.querySelector("article");if(!G||!me)return S;const he=G.cloneNode();return vn.render(r.createElement(zn.Z),he),he.id="toggle-sidebar",he.title="Toggle Sidebar",he.classList.add("md-content__button"),he.style.setProperty("padding","0 0 0 5px"),he.style.setProperty("margin","0.4rem 0 0.4rem 0.4rem"),me==null||me.prepend(he),S},yn=()=>S=>(((me,he)=>{Array.from(me).filter(Ce=>Ce.hasAttribute(he)).forEach(Ce=>{const Oe=Ce.getAttribute(he);if(Oe){Oe.match(/^https?:\/\//i)&&Ce.setAttribute("target","_blank");try{const Me=xn(window.location.href);Ce.setAttribute(he,new URL(Oe,Me).toString())}catch{Ce.replaceWith(Ce.textContent||Oe)}}})})(Array.from(S.getElementsByTagName("a")),"href"),S);function xn(S){const G=new URL(S);return!G.pathname.endsWith("/")&&!G.pathname.endsWith(".html")&&(G.pathname+="/"),G.toString()}const kn=({baseUrl:S,onClick:G})=>me=>(Array.from(me.getElementsByTagName("a")).forEach(he=>{he.addEventListener("click",Ce=>{const Me=he.getAttribute("href");!Me||Me.startsWith(S)&&!he.hasAttribute("download")&&(Ce.preventDefault(),G(Ce,Me))})}),me);var On=t(15459),bn=t(80030),ge=t(72379),ee=t(41547);const Re=(0,On.Z)(S=>({tooltip:{fontSize:"inherit",color:S.palette.text.primary,margin:0,padding:S.spacing(.5),backgroundColor:"transparent",boxShadow:"none"}}))(bn.ZP),Ue=()=>(0,h.jsx)(ge.Z,{children:(0,h.jsx)("path",{d:"M16 1H4c-1.1 0-2 .9-2 2v14h2V3h12V1zm3 4H8c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h11c1.1 0 2-.9 2-2V7c0-1.1-.9-2-2-2zm0 16H8V7h11v14z"})}),et=({text:S})=>{const[G,me]=(0,r.useState)(!1),he=(0,r.useCallback)(()=>{window.navigator.clipboard.writeText(S),me(!0)},[S]),Ce=(0,r.useCallback)(()=>{me(!1)},[me]);return(0,h.jsx)(Re,{title:"Copied to clipboard",placement:"left",open:G,onClose:Ce,leaveDelay:1e3,children:(0,h.jsx)(te.Z,{className:"md-clipboard md-icon",onClick:he,children:(0,h.jsx)(Ue,{})})})},wt=S=>G=>{const me=G.querySelectorAll("pre > code");for(const Ce of me){var he;const Oe=Ce.textContent||"",Me=document.createElement("div");Ce==null||(he=Ce.parentElement)===null||he===void 0||he.prepend(Me),vn.render((0,h.jsx)(ee.Z,{theme:S,children:(0,h.jsx)(et,{text:Oe})}),Me)}return G},ae=()=>S=>{var G;return(G=S.querySelector(".md-header"))===null||G===void 0||G.remove(),S},O=()=>S=>{var G,me;return(G=S.querySelector(".md-footer .md-copyright"))===null||G===void 0||G.remove(),(me=S.querySelector(".md-footer-copyright"))===null||me===void 0||me.remove(),S},de=({onLoading:S,onLoaded:G})=>me=>(S(),me.addEventListener(g.Ox,function he(){G(),me.removeEventListener(g.Ox,he)}),me),Be=()=>S=>(setTimeout(()=>{if(window.location.hash){var G;const me=window.location.hash.slice(1);(G=S==null?void 0:S.querySelector(`[id="${me}"]`))===null||G===void 0||G.scrollIntoView()}},200),S),D=()=>S=>(setTimeout(()=>{const G=S==null?void 0:S.querySelectorAll("li.md-nav__item--active");G.length!==0&&(G.forEach(he=>{const Ce=he==null?void 0:he.querySelector("input");Ce!=null&&Ce.checked||Ce==null||Ce.click()}),G[G.length-1].scrollIntoView())},200),S),M=async(S,G)=>{let me;if(typeof S=="string")me=new DOMParser().parseFromString(S,"text/html").documentElement;else if(S instanceof Element)me=S;else throw new Error("dom is not a recognized type");for(const he of G)me=await he(me);return me},ue="screen and (max-width: 76.1875em)",fe=S=>{const G=(0,Xe.s0)(),me=(0,Qe.Z)(),he=(0,_e.Z)(ue),Ce=Pe(),Oe=un(),Me=(0,V.z$)(),dt=(0,V.h_)(g.Dl),jt=(0,V.h_)(Ge.q3),{state:at,path:pt,content:yt}=(0,C.DK)(),[lt,Bt]=(0,r.useState)(null),Mt=(0,g.ux)(lt),zt=(0,r.useCallback)(()=>{if(!lt)return;lt.querySelectorAll(".md-sidebar").forEach(Nt=>{if(he)Nt.style.top="0px";else{const Cn=document==null?void 0:document.querySelector(".techdocs-reader-page");var rn;const wn=(rn=Cn==null?void 0:Cn.getBoundingClientRect().top)!==null&&rn!==void 0?rn:0;var Bn;let Yn=(Bn=lt.getBoundingClientRect().top)!==null&&Bn!==void 0?Bn:0;const fn=lt.querySelector(".md-container > .md-tabs");var Xn;const Rn=(Xn=fn==null?void 0:fn.getBoundingClientRect().height)!==null&&Xn!==void 0?Xn:0;Yn<wn&&(Yn=wn),Nt.style.top=`${Math.max(Yn,0)+Rn}px`}Nt.style.setProperty("opacity","1")})},[lt,he]);(0,r.useEffect)(()=>(window.addEventListener("resize",zt),window.addEventListener("scroll",zt,!0),()=>{window.removeEventListener("resize",zt),window.removeEventListener("scroll",zt,!0)}),[lt,zt]);const qt=(0,r.useCallback)(()=>{if(!lt)return;const Dt=lt.querySelector(".md-footer");Dt&&(Dt.style.width=`${lt.getBoundingClientRect().width}px`)},[lt]);(0,r.useEffect)(()=>(window.addEventListener("resize",qt),()=>{window.removeEventListener("resize",qt)}),[lt,qt]),(0,r.useEffect)(()=>{Mt||(qt(),zt())},[at,Mt,qt,zt]);const Wn=(0,r.useCallback)((Dt,Nt)=>M(Dt,[Ce,Fn({techdocsStorageApi:dt,entityId:S,path:Nt}),yn(),pn(),ae(),O(),Mn(jt),Oe]),[S,jt,dt,Ce,Oe]),Sn=(0,r.useCallback)(async Dt=>M(Dt,[Be(),D(),wt(me),kn({baseUrl:window.location.origin,onClick:(Nt,rn)=>{var Bn;const Xn=Nt.ctrlKey||Nt.metaKey,Cn=new URL(rn),wn=`${Cn.pathname}${Cn.search}${Cn.hash}`,Yn=((Bn=Nt.target)===null||Bn===void 0?void 0:Bn.innerText)||rn,fn=rn.replace(window.location.origin,"");if(Me.captureEvent("click",Yn,{attributes:{to:fn}}),Cn.hash)if(Xn)window.open(wn,"_blank");else{var Rn;G(wn),(Rn=Dt==null?void 0:Dt.querySelector(`[id="${Cn.hash.slice(1)}"]`))===null||Rn===void 0||Rn.scrollIntoView()}else Xn?window.open(wn,"_blank"):G(wn)}}),de({onLoading:()=>{},onLoaded:()=>{var Nt;(Nt=Dt.querySelector(".md-nav__title"))===null||Nt===void 0||Nt.removeAttribute("for")}}),de({onLoading:()=>{Array.from(Dt.querySelectorAll(".md-sidebar")).forEach(rn=>{rn.style.setProperty("opacity","0")})},onLoaded:()=>{}})]),[me,G,Me]);return(0,r.useEffect)(()=>{if(!yt)return()=>{};let Dt=!0;return Wn(yt,pt).then(async Nt=>{if(!(Nt!=null&&Nt.innerHTML)||!Dt)return;window.scroll({top:0});const rn=await Sn(Nt);Bt(rn)}),()=>{Dt=!1}},[yt,pt,Wn,Sn]),lt};var be=t(8560);const $e=()=>{const S=(0,g.$L)(),{shadowRoot:G}=(0,g.x1)(),me=G==null?void 0:G.querySelector('[data-md-component="content"]'),he=G==null?void 0:G.querySelector('div[data-md-component="sidebar"][data-md-type="navigation"], div[data-md-component="navigation"]');let Ce=he==null?void 0:he.querySelector('[data-techdocs-addons-location="primary sidebar"]');Ce||(Ce=document.createElement("div"),Ce.setAttribute("data-techdocs-addons-location","primary sidebar"),he==null||he.prepend(Ce));const Oe=G==null?void 0:G.querySelector('div[data-md-component="sidebar"][data-md-type="toc"], div[data-md-component="toc"]');let Me=Oe==null?void 0:Oe.querySelector('[data-techdocs-addons-location="secondary sidebar"]');return Me||(Me=document.createElement("div"),Me.setAttribute("data-techdocs-addons-location","secondary sidebar"),Oe==null||Oe.prepend(Me)),(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(be.Z,{container:Ce,children:S.renderComponentsByLocation(g.oZ.PrimarySidebar)}),(0,h.jsx)(be.Z,{container:me,children:S.renderComponentsByLocation(g.oZ.Content)}),(0,h.jsx)(be.Z,{container:Me,children:S.renderComponentsByLocation(g.oZ.SecondarySidebar)})]})},Ae=(0,W.Z)({search:{width:"100%","@media (min-width: 76.1875em)":{width:"calc(100% - 34.4rem)",margin:"0 auto"}}}),We=(0,C.m1)(S=>{var G;const{withSearch:me=!0,onReady:he}=S,Ce=Ae(),{entityMetadata:{value:Oe,loading:Me},entityRef:dt,setShadowRoot:jt}=(0,g.x1)(),at=fe(dt),pt=(0,r.useCallback)(yt=>{jt(yt),he instanceof Function&&he()},[jt,he]);return Me===!1&&!Oe?(0,h.jsx)(b.mf,{status:"404",statusMessage:"PAGE NOT FOUND"}):at?(0,h.jsx)(b.VY,{children:(0,h.jsxs)(k.Z,{container:!0,children:[(0,h.jsx)(k.Z,{xs:12,item:!0,children:(0,h.jsx)(Le,{})}),me&&(0,h.jsx)(k.Z,{className:Ce.search,xs:"auto",item:!0,children:(0,h.jsx)(c.S,{entityId:dt,entityTitle:Oe==null||(G=Oe.metadata)===null||G===void 0?void 0:G.title})}),(0,h.jsx)(k.Z,{xs:12,item:!0,children:(0,h.jsx)(g.VA,{element:at,onAppend:pt,children:(0,h.jsx)($e,{})})})]})}):(0,h.jsx)(b.VY,{children:(0,h.jsx)(k.Z,{container:!0,children:(0,h.jsx)(k.Z,{xs:12,item:!0,children:(0,h.jsx)(Le,{})})})})}),rt=null},93225:function(At,Fe,t){"use strict";t.d(Fe,{S:function(){return ce}});var h=t(52322),r=t(2784),W=t(18671),k=t(60905),g=t(98069),b=t(73250),c=t(61886),P=t(56941),te=t(25271),_=t(93414),X=t(25248),U=t(76635),F=t(95573);const Y=(0,h.jsx)(g.Z,{animation:"wave",variant:"text",height:40}),ce=oe=>{const{children:T}=oe,R=(0,c.$L)(),V=(0,X.h_)(X.Ds),{title:A,setTitle:C,subtitle:z,setSubtitle:Le,entityRef:Xe,metadata:{value:Qe,loading:_e},entityMetadata:{value:Ge,loading:gt}}=(0,c.x1)();(0,r.useEffect)(()=>{!Qe||(C(Qe.site_name),Le(()=>{let{site_description:ne}=Qe;return(!ne||ne==="None")&&(ne=""),ne}))},[Qe,C,Le]);const Ee=V.getOptional("app.title")||"Backstage",Ke=[A,z,Ee].filter(Boolean).join(" | "),{locationMetadata:it,spec:mt}=Ge||{},ot=mt==null?void 0:mt.lifecycle,ft=Ge?(0,P.hF)(Ge,te.S4):[],nt=(0,X.tg)(F._Z)(),Lt=(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(_.i9,{label:(0,U.capitalize)((Ge==null?void 0:Ge.kind)||"entity"),value:(0,h.jsx)(P.dx,{color:"inherit",entityRef:Xe,title:Ge==null?void 0:Ge.metadata.title,defaultKind:"Component"})}),ft.length>0&&(0,h.jsx)(_.i9,{label:"Owner",value:(0,h.jsx)(P.rI,{color:"inherit",entityRefs:ft,defaultKind:"group"})}),ot?(0,h.jsx)(_.i9,{label:"Lifecycle",value:ot}):null,it&&it.type!=="dir"&&it.type!=="file"?(0,h.jsx)(_.i9,{label:"",value:(0,h.jsxs)(k.Z,{container:!0,direction:"column",alignItems:"center",style:{color:"#fff"},children:[(0,h.jsx)(k.Z,{style:{padding:0},item:!0,children:(0,h.jsx)(b.Z,{style:{marginTop:"-25px"}})}),(0,h.jsx)(k.Z,{style:{padding:0},item:!0,children:"Source"})]}),url:it.target}):null]});return!gt&&Ge===void 0||!_e&&Qe===void 0?null:(0,h.jsxs)(_.h4,{type:"Documentation",typeLink:nt,title:A||Y,subtitle:z===""?void 0:z||Y,children:[(0,h.jsx)(W.Z,{titleTemplate:"%s",children:(0,h.jsx)("title",{children:Ke})}),Lt,T,R.renderComponentsByLocation(c.oZ.Header)]})}},65124:function(At,Fe,t){"use strict";t.d(Fe,{b:function(){return U}});var h=t(52322),r=t(2784),W=t(79692),k=t(15223),g=t(95544),b=t(80030),c=t(61837),P=t(48348),te=t(47603),_=t(61886);const X=(0,W.Z)(F=>({root:{gridArea:"pageSubheader",flexDirection:"column",minHeight:"auto",padding:F.spacing(3,3,0)}})),U=F=>{const Y=X(),[ce,oe]=(0,r.useState)(null),T=(0,r.useCallback)(Xe=>{oe(Xe.currentTarget)},[]),R=(0,r.useCallback)(()=>{oe(null)},[]),{entityMetadata:{value:V,loading:A}}=(0,_.x1)(),C=(0,_.$L)(),z=C.renderComponentsByLocation(_.oZ.Subheader),Le=C.renderComponentsByLocation(_.oZ.Settings);return!z&&!Le||A===!1&&!V?null:(0,h.jsx)(k.Z,{classes:Y,...F.toolbarProps,children:(0,h.jsxs)(g.Z,{display:"flex",justifyContent:"flex-end",width:"100%",flexWrap:"wrap",children:[z,Le?(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(b.ZP,{title:"Settings",children:(0,h.jsx)(c.Z,{"aria-controls":"tech-docs-reader-page-settings","aria-haspopup":"true",onClick:T,children:(0,h.jsx)(te.Z,{})})}),(0,h.jsx)(P.Z,{id:"tech-docs-reader-page-settings",getContentAnchorEl:null,anchorEl:ce,anchorOrigin:{vertical:"bottom",horizontal:"right"},open:Boolean(ce),onClose:R,keepMounted:!0,children:Le})]}):null]})})}},95481:function(At,Fe,t){"use strict";t.d(Fe,{DK:function(){return U},m1:function(){return Y}});var h=t(52322),r=t(2784),W=t(79635),k=t(61886),g=t(25248),b=t(64279),c=t(77446);function P({contentLoading:ce,content:oe,activeSyncState:T}){return ce||T==="BUILD_READY_RELOAD"||!oe&&T==="CHECKING"?"CHECKING":!oe&&T==="BUILDING"?"INITIAL_BUILD":oe?T==="BUILDING"?"CONTENT_STALE_REFRESHING":T==="BUILD_READY"?"CONTENT_STALE_READY":T==="ERROR"?"CONTENT_STALE_ERROR":"CONTENT_FRESH":"CONTENT_NOT_FOUND"}function te(ce,oe){const T={...ce};switch(oe.type){case"sync":oe.state==="CHECKING"&&(T.buildLog=[]),T.activeSyncState=oe.state,T.syncError=oe.syncError;break;case"contentLoading":T.contentLoading=!0,T.contentError=void 0;break;case"content":typeof oe.path=="string"&&(T.path=oe.path),T.contentLoading=!1,T.content=oe.content,T.contentError=oe.contentError;break;case"buildLog":T.buildLog=T.buildLog.concat(oe.log);break;default:throw new Error}return["BUILD_READY","BUILD_READY_RELOAD"].includes(T.activeSyncState)&&["contentLoading","content"].includes(oe.type)&&(T.activeSyncState="UP_TO_DATE",T.buildLog=[]),T}function _(ce,oe,T,R){var V,A;const[C,z]=(0,r.useReducer)(te,{activeSyncState:"CHECKING",path:R,contentLoading:!0,buildLog:[]}),Le=(0,g.h_)(k.Dl),{retry:Xe}=(0,c.Z)(async()=>{z({type:"contentLoading"});try{const Ge=await Le.getEntityDocs({kind:ce,namespace:oe,name:T},R);return z({type:"content",content:Ge,path:R}),Ge}catch(Ge){z({type:"content",contentError:Ge,path:R})}},[Le,ce,oe,T,R]),Qe=(0,r.useRef)({content:void 0,reload:()=>{}});return Qe.current={content:C.content,reload:Xe},(0,b.default)(async()=>{z({type:"sync",state:"CHECKING"});const Ge=setTimeout(()=>{z({type:"sync",state:"BUILDING"})},1e3);try{switch(await Le.syncEntityDocs({kind:ce,namespace:oe,name:T},Ee=>{z({type:"buildLog",log:Ee})})){case"updated":Qe.current.content?z({type:"sync",state:"BUILD_READY"}):(Qe.current.reload(),z({type:"sync",state:"BUILD_READY_RELOAD"}));break;case"cached":z({type:"sync",state:"UP_TO_DATE"});break;default:z({type:"sync",state:"ERROR",syncError:new Error("Unexpected return state")});break}}catch(gt){z({type:"sync",state:"ERROR",syncError:gt})}finally{clearTimeout(Ge)}},[ce,T,oe,Le,z,Qe]),{state:(0,r.useMemo)(()=>P({activeSyncState:C.activeSyncState,contentLoading:C.contentLoading,content:C.content}),[C.activeSyncState,C.content,C.contentLoading]),contentReload:Xe,path:C.path,content:C.content,contentErrorMessage:(V=C.contentError)===null||V===void 0?void 0:V.toString(),syncErrorMessage:(A=C.syncError)===null||A===void 0?void 0:A.toString(),buildLog:C.buildLog}}const X=(0,r.createContext)({}),U=()=>(0,r.useContext)(X),F=({children:ce})=>{const{"*":oe=""}=(0,W.UO)(),{entityRef:T}=(0,k.x1)(),{kind:R,namespace:V,name:A}=T,C=_(R,V,A,oe);return(0,h.jsx)(X.Provider,{value:C,children:ce instanceof Function?ce(C):ce})},Y=ce=>oe=>(0,h.jsx)(F,{children:(0,h.jsx)(ce,{...oe})})},95573:function(At,Fe,t){"use strict";t.d(Fe,{Fw:function(){return W},_Z:function(){return r},pd:function(){return k}});var h=t(25248);const r=(0,h.NT)({id:"techdocs:index-page"}),W=(0,h.NT)({id:"techdocs:reader-page",params:["namespace","kind","name"]}),k=(0,h.NT)({id:"techdocs:catalog-reader-view"})},17339:function(At,Fe,t){"use strict";t.d(Fe,{S:function(){return V}});var h=t(52322),r=t(2784),W=t(79692),k=t(49378),g=t(38402),b=t(86136),c=t(85256),P=t(90436),te=t(93414),_=t(25248),X=t(65826);const U=(0,W.Z)({flexContainer:{flexWrap:"wrap"},itemText:{width:"100%",marginBottom:"1rem"}}),F=A=>{const{result:C,highlight:z,rank:Le,lineClamp:Xe=5,asListItem:Qe=!0,asLink:_e=!0,title:Ge,icon:gt}=A,Ee=U(),Ke=(0,_.z$)(),it=()=>{Ke.captureEvent("discover",C.title,{attributes:{to:C.location},value:Le})},mt=({children:nt})=>_e?(0,h.jsx)(te.rU,{noTrack:!0,to:C.location,onClick:it,children:nt}):(0,h.jsx)(h.Fragment,{children:nt}),ot=()=>{const nt=z!=null&&z.fields.title?(0,h.jsx)(X.FA,{text:z.fields.title,preTag:z.preTag,postTag:z.postTag}):C.title,Lt=z!=null&&z.fields.entityTitle?(0,h.jsx)(X.FA,{text:z.fields.entityTitle,preTag:z.preTag,postTag:z.postTag}):C.entityTitle,bt=z!=null&&z.fields.name?(0,h.jsx)(X.FA,{text:z.fields.name,preTag:z.preTag,postTag:z.postTag}):C.name;return(0,h.jsx)(k.Z,{className:Ee.itemText,primaryTypographyProps:{variant:"h6"},primary:(0,h.jsx)(mt,{children:Ge||(0,h.jsxs)(h.Fragment,{children:[nt," | ",Lt!=null?Lt:bt," docs"]})}),secondary:(0,h.jsx)(P.Z,{component:"span",style:{display:"-webkit-box",WebkitBoxOrient:"vertical",WebkitLineClamp:Xe,overflow:"hidden"},children:z!=null&&z.fields.text?(0,h.jsx)(X.FA,{text:z.fields.text,preTag:z.preTag,postTag:z.postTag}):C.text})})},ft=({children:nt})=>Qe?(0,h.jsxs)(h.Fragment,{children:[(0,h.jsxs)(g.Z,{alignItems:"flex-start",children:[gt&&(0,h.jsx)(b.Z,{children:gt}),(0,h.jsx)("div",{className:Ee.flexContainer,children:nt})]}),(0,h.jsx)(c.Z,{component:"li"})]}):(0,h.jsx)(h.Fragment,{children:nt});return(0,h.jsx)(ft,{children:(0,h.jsx)(ot,{})})};var Y=t(27556),ce=t(79635);const oe=(0,W.Z)(A=>({root:{width:"100%"},bar:{padding:A.spacing(1)}})),T=A=>A==null?void 0:A.document,R=A=>{const{entityId:C,entityTitle:z,debounceTime:Le=150}=A,[Xe,Qe]=(0,r.useState)(!1),_e=(0,ce.s0)(),{setFilters:Ge,result:{loading:gt,value:Ee}}=(0,X.Rx)(),Ke=oe(),[it,mt]=(0,r.useState)([]);(0,r.useEffect)(()=>{let bt=!0;if(bt&&Ee){const ze=Ee.results.slice(0,10);mt(ze)}return()=>{bt=!1}},[gt,Ee]);const{kind:ot,name:ft,namespace:nt}=C;(0,r.useEffect)(()=>{Ge(bt=>({...bt,kind:ot,namespace:nt,name:ft}))},[ot,nt,ft,Ge]);const Lt=(bt,ze)=>{if(T(ze)){const{location:ne}=ze.document;_e(ne)}};return(0,h.jsx)(Y.Z,{className:Ke.bar,variant:"outlined",children:(0,h.jsx)(X.qO,{classes:{root:Ke.root},"data-testid":"techdocs-search-bar",size:"small",open:Xe,getOptionLabel:()=>"",filterOptions:bt=>bt,onClose:()=>{Qe(!1)},onFocus:()=>{Qe(!0)},onChange:Lt,blurOnSelect:!0,noOptionsText:"No results found",value:null,options:it,renderOption:({document:bt,highlight:ze})=>(0,h.jsx)(F,{result:bt,lineClamp:3,asListItem:!1,asLink:!1,title:bt.title,highlight:ze}),loading:gt,inputDebounceTime:Le,inputPlaceholder:`Search ${z||C.name} docs`,freeSolo:!1})})},V=A=>{const C={term:"",types:["techdocs"],pageCursor:"",filters:A.entityId};return(0,h.jsx)(X.Nd,{initialState:C,children:(0,h.jsx)(R,{...A})})}},53260:function(){}},function(At){var Fe=function(h){return At(At.s=h)};At.O(0,[2370,6202,9284,9035,2126,7012,2194,1410,427,6816,5218,5924,4736],function(){return Fe(51102)});var t=At.O()}]);})();
|
|
501
|
+
Feedback:`),lt=(Oe==null?void 0:Oe.type)==="github"?(0,In.BT)(Ce.href,"blob"):Ce.href,ft=Xt()(lt),xt=`/${ft.organization}/${ft.name}`,ct=de.cloneNode();switch(Oe==null?void 0:Oe.type){case"gitlab":ct.href=`${Ce.origin}${xt}/issues/new?issue[title]=${ht}&issue[description]=${jt}`;break;case"github":ct.href=`${Ce.origin}${xt}/issues/new?title=${ht}&body=${jt}`;break;default:return K}return vn.render(r.createElement(Un.Z),ct),ct.style.paddingLeft="5px",ct.title="Leave feedback for this page",ct.id="git-feedback-link",de==null||de.insertAdjacentElement("beforebegin",ct),K};var zn=t(44882);const pn=()=>S=>{const K=S.querySelector('.md-header label[for="__drawer"]'),ge=S.querySelector("article");if(!K||!ge)return S;const de=K.cloneNode();return vn.render(r.createElement(zn.Z),de),de.id="toggle-sidebar",de.title="Toggle Sidebar",de.classList.add("md-content__button"),de.style.setProperty("padding","0 0 0 5px"),de.style.setProperty("margin","0.4rem 0 0.4rem 0.4rem"),ge==null||ge.prepend(de),S},yn=()=>S=>(((ge,de)=>{Array.from(ge).filter(Ce=>Ce.hasAttribute(de)).forEach(Ce=>{const Oe=Ce.getAttribute(de);if(Oe){Oe.match(/^https?:\/\//i)&&Ce.setAttribute("target","_blank");try{const Me=xn(window.location.href);Ce.setAttribute(de,new URL(Oe,Me).toString())}catch{Ce.replaceWith(Ce.textContent||Oe)}}})})(Array.from(S.getElementsByTagName("a")),"href"),S);function xn(S){const K=new URL(S);return!K.pathname.endsWith("/")&&!K.pathname.endsWith(".html")&&(K.pathname+="/"),K.toString()}const kn=({baseUrl:S,onClick:K})=>ge=>(Array.from(ge.getElementsByTagName("a")).forEach(de=>{de.addEventListener("click",Ce=>{const Me=de.getAttribute("href");!Me||Me.startsWith(S)&&!de.hasAttribute("download")&&(Ce.preventDefault(),K(Ce,Me))})}),ge);var On=t(15459),bn=t(80030),me=t(72379),ee=t(41547);const Re=(0,On.Z)(S=>({tooltip:{fontSize:"inherit",color:S.palette.text.primary,margin:0,padding:S.spacing(.5),backgroundColor:"transparent",boxShadow:"none"}}))(bn.ZP),Ue=()=>(0,h.jsx)(me.Z,{children:(0,h.jsx)("path",{d:"M16 1H4c-1.1 0-2 .9-2 2v14h2V3h12V1zm3 4H8c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h11c1.1 0 2-.9 2-2V7c0-1.1-.9-2-2-2zm0 16H8V7h11v14z"})}),et=({text:S})=>{const[K,ge]=(0,r.useState)(!1),de=(0,r.useCallback)(()=>{window.navigator.clipboard.writeText(S),ge(!0)},[S]),Ce=(0,r.useCallback)(()=>{ge(!1)},[ge]);return(0,h.jsx)(Re,{title:"Copied to clipboard",placement:"left",open:K,onClose:Ce,leaveDelay:1e3,children:(0,h.jsx)(te.Z,{className:"md-clipboard md-icon",onClick:de,children:(0,h.jsx)(Ue,{})})})},wt=S=>K=>{const ge=K.querySelectorAll("pre > code");for(const Ce of ge){var de;const Oe=Ce.textContent||"",Me=document.createElement("div");Ce==null||(de=Ce.parentElement)===null||de===void 0||de.prepend(Me),vn.render((0,h.jsx)(ee.Z,{theme:S,children:(0,h.jsx)(et,{text:Oe})}),Me)}return K},ae=()=>S=>{var K;return(K=S.querySelector(".md-header"))===null||K===void 0||K.remove(),S},O=()=>S=>{var K,ge;return(K=S.querySelector(".md-footer .md-copyright"))===null||K===void 0||K.remove(),(ge=S.querySelector(".md-footer-copyright"))===null||ge===void 0||ge.remove(),S},ue=({onLoading:S,onLoaded:K})=>ge=>(S(),ge.addEventListener(g.Ox,function de(){K(),ge.removeEventListener(g.Ox,de)}),ge),Be=()=>S=>(S.addEventListener(g.Ox,function K(){if(window.location.hash){var ge;const de=window.location.hash.slice(1);(ge=S==null?void 0:S.querySelector(`[id="${de}"]`))===null||ge===void 0||ge.scrollIntoView()}S.removeEventListener(g.Ox,K)}),S),D=()=>S=>(setTimeout(()=>{const K=S==null?void 0:S.querySelectorAll("li.md-nav__item--active");K.length!==0&&(K.forEach(de=>{const Ce=de==null?void 0:de.querySelector("input");Ce!=null&&Ce.checked||Ce==null||Ce.click()}),K[K.length-1].scrollIntoView())},200),S),M=async(S,K)=>{let ge;if(typeof S=="string")ge=new DOMParser().parseFromString(S,"text/html").documentElement;else if(S instanceof Element)ge=S;else throw new Error("dom is not a recognized type");for(const de of K)ge=await de(ge);return ge},he="screen and (max-width: 76.1875em)",fe=S=>{const K=(0,Xe.s0)(),ge=(0,Qe.Z)(),de=(0,_e.Z)(he),Ce=Pe(),Oe=un(),Me=(0,V.z$)(),ht=(0,V.h_)(g.Dl),jt=(0,V.h_)(Ge.q3),{state:lt,path:ft,content:xt}=(0,C.DK)(),[ct,Bt]=(0,r.useState)(null),Mt=(0,g.ux)(ct),zt=(0,r.useCallback)(()=>{if(!ct)return;ct.querySelectorAll(".md-sidebar").forEach(Nt=>{if(de)Nt.style.top="0px";else{const Cn=document==null?void 0:document.querySelector(".techdocs-reader-page");var rn;const wn=(rn=Cn==null?void 0:Cn.getBoundingClientRect().top)!==null&&rn!==void 0?rn:0;var Bn;let Yn=(Bn=ct.getBoundingClientRect().top)!==null&&Bn!==void 0?Bn:0;const fn=ct.querySelector(".md-container > .md-tabs");var Xn;const Rn=(Xn=fn==null?void 0:fn.getBoundingClientRect().height)!==null&&Xn!==void 0?Xn:0;Yn<wn&&(Yn=wn),Nt.style.top=`${Math.max(Yn,0)+Rn}px`}Nt.style.setProperty("opacity","1")})},[ct,de]);(0,r.useEffect)(()=>(window.addEventListener("resize",zt),window.addEventListener("scroll",zt,!0),()=>{window.removeEventListener("resize",zt),window.removeEventListener("scroll",zt,!0)}),[ct,zt]);const qt=(0,r.useCallback)(()=>{if(!ct)return;const Dt=ct.querySelector(".md-footer");Dt&&(Dt.style.width=`${ct.getBoundingClientRect().width}px`)},[ct]);(0,r.useEffect)(()=>(window.addEventListener("resize",qt),()=>{window.removeEventListener("resize",qt)}),[ct,qt]),(0,r.useEffect)(()=>{Mt||(qt(),zt())},[lt,Mt,qt,zt]);const Wn=(0,r.useCallback)((Dt,Nt)=>M(Dt,[Ce,Fn({techdocsStorageApi:ht,entityId:S,path:Nt}),yn(),pn(),ae(),O(),Mn(jt),Oe]),[S,jt,ht,Ce,Oe]),Sn=(0,r.useCallback)(async Dt=>M(Dt,[Be(),D(),wt(ge),kn({baseUrl:window.location.origin,onClick:(Nt,rn)=>{var Bn;const Xn=Nt.ctrlKey||Nt.metaKey,Cn=new URL(rn),wn=`${Cn.pathname}${Cn.search}${Cn.hash}`,Yn=((Bn=Nt.target)===null||Bn===void 0?void 0:Bn.innerText)||rn,fn=rn.replace(window.location.origin,"");if(Me.captureEvent("click",Yn,{attributes:{to:fn}}),Cn.hash)if(Xn)window.open(wn,"_blank");else{var Rn;K(wn),(Rn=Dt==null?void 0:Dt.querySelector(`[id="${Cn.hash.slice(1)}"]`))===null||Rn===void 0||Rn.scrollIntoView()}else Xn?window.open(wn,"_blank"):K(wn)}}),ue({onLoading:()=>{},onLoaded:()=>{var Nt;(Nt=Dt.querySelector(".md-nav__title"))===null||Nt===void 0||Nt.removeAttribute("for")}}),ue({onLoading:()=>{Array.from(Dt.querySelectorAll(".md-sidebar")).forEach(rn=>{rn.style.setProperty("opacity","0")})},onLoaded:()=>{}})]),[ge,K,Me]);return(0,r.useEffect)(()=>{if(!xt)return()=>{};let Dt=!0;return Wn(xt,ft).then(async Nt=>{if(!(Nt!=null&&Nt.innerHTML)||!Dt)return;window.scroll({top:0});const rn=await Sn(Nt);Bt(rn)}),()=>{Dt=!1}},[xt,ft,Wn,Sn]),ct};var be=t(8560);const $e=()=>{const S=(0,g.$L)(),{shadowRoot:K}=(0,g.x1)(),ge=K==null?void 0:K.querySelector('[data-md-component="content"]'),de=K==null?void 0:K.querySelector('div[data-md-component="sidebar"][data-md-type="navigation"], div[data-md-component="navigation"]');let Ce=de==null?void 0:de.querySelector('[data-techdocs-addons-location="primary sidebar"]');Ce||(Ce=document.createElement("div"),Ce.setAttribute("data-techdocs-addons-location","primary sidebar"),de==null||de.prepend(Ce));const Oe=K==null?void 0:K.querySelector('div[data-md-component="sidebar"][data-md-type="toc"], div[data-md-component="toc"]');let Me=Oe==null?void 0:Oe.querySelector('[data-techdocs-addons-location="secondary sidebar"]');return Me||(Me=document.createElement("div"),Me.setAttribute("data-techdocs-addons-location","secondary sidebar"),Oe==null||Oe.prepend(Me)),(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(be.Z,{container:Ce,children:S.renderComponentsByLocation(g.oZ.PrimarySidebar)}),(0,h.jsx)(be.Z,{container:ge,children:S.renderComponentsByLocation(g.oZ.Content)}),(0,h.jsx)(be.Z,{container:Me,children:S.renderComponentsByLocation(g.oZ.SecondarySidebar)})]})},Ae=(0,W.Z)({search:{width:"100%","@media (min-width: 76.1875em)":{width:"calc(100% - 34.4rem)",margin:"0 auto"}}}),We=(0,C.m1)(S=>{var K;const{withSearch:ge=!0,onReady:de}=S,Ce=Ae(),{entityMetadata:{value:Oe,loading:Me},entityRef:ht,setShadowRoot:jt}=(0,g.x1)(),lt=fe(ht),ft=(0,r.useCallback)(xt=>{jt(xt),de instanceof Function&&de()},[jt,de]);return Me===!1&&!Oe?(0,h.jsx)(b.mf,{status:"404",statusMessage:"PAGE NOT FOUND"}):lt?(0,h.jsx)(b.VY,{children:(0,h.jsxs)(k.Z,{container:!0,children:[(0,h.jsx)(k.Z,{xs:12,item:!0,children:(0,h.jsx)(Le,{})}),ge&&(0,h.jsx)(k.Z,{className:Ce.search,xs:"auto",item:!0,children:(0,h.jsx)(c.S,{entityId:ht,entityTitle:Oe==null||(K=Oe.metadata)===null||K===void 0?void 0:K.title})}),(0,h.jsx)(k.Z,{xs:12,item:!0,children:(0,h.jsx)(g.VA,{element:lt,onAppend:ft,children:(0,h.jsx)($e,{})})})]})}):(0,h.jsx)(b.VY,{children:(0,h.jsx)(k.Z,{container:!0,children:(0,h.jsx)(k.Z,{xs:12,item:!0,children:(0,h.jsx)(Le,{})})})})}),st=null},93225:function(At,Fe,t){"use strict";t.d(Fe,{S:function(){return ce}});var h=t(52322),r=t(2784),W=t(18671),k=t(60905),g=t(98069),b=t(73250),c=t(61886),P=t(56941),te=t(25271),_=t(93414),X=t(25248),U=t(76635),F=t(95573);const Y=(0,h.jsx)(g.Z,{animation:"wave",variant:"text",height:40}),ce=se=>{const{children:T}=se,R=(0,c.$L)(),V=(0,X.h_)(X.Ds),{title:A,setTitle:C,subtitle:z,setSubtitle:Le,entityRef:Xe,metadata:{value:Qe,loading:_e},entityMetadata:{value:Ge,loading:mt}}=(0,c.x1)();(0,r.useEffect)(()=>{!Qe||(C(Qe.site_name),Le(()=>{let{site_description:ne}=Qe;return(!ne||ne==="None")&&(ne=""),ne}))},[Qe,C,Le]);const Ee=V.getOptional("app.title")||"Backstage",Ke=[A,z,Ee].filter(Boolean).join(" | "),{locationMetadata:at,spec:vt}=Ge||{},it=vt==null?void 0:vt.lifecycle,gt=Ge?(0,P.hF)(Ge,te.S4):[],nt=(0,X.tg)(F._Z)(),Lt=(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(_.i9,{label:(0,U.capitalize)((Ge==null?void 0:Ge.kind)||"entity"),value:(0,h.jsx)(P.dx,{color:"inherit",entityRef:Xe,title:Ge==null?void 0:Ge.metadata.title,defaultKind:"Component"})}),gt.length>0&&(0,h.jsx)(_.i9,{label:"Owner",value:(0,h.jsx)(P.rI,{color:"inherit",entityRefs:gt,defaultKind:"group"})}),it?(0,h.jsx)(_.i9,{label:"Lifecycle",value:it}):null,at&&at.type!=="dir"&&at.type!=="file"?(0,h.jsx)(_.i9,{label:"",value:(0,h.jsxs)(k.Z,{container:!0,direction:"column",alignItems:"center",style:{color:"#fff"},children:[(0,h.jsx)(k.Z,{style:{padding:0},item:!0,children:(0,h.jsx)(b.Z,{style:{marginTop:"-25px"}})}),(0,h.jsx)(k.Z,{style:{padding:0},item:!0,children:"Source"})]}),url:at.target}):null]});return!mt&&Ge===void 0||!_e&&Qe===void 0?null:(0,h.jsxs)(_.h4,{type:"Documentation",typeLink:nt,title:A||Y,subtitle:z===""?void 0:z||Y,children:[(0,h.jsx)(W.Z,{titleTemplate:"%s",children:(0,h.jsx)("title",{children:Ke})}),Lt,T,R.renderComponentsByLocation(c.oZ.Header)]})}},65124:function(At,Fe,t){"use strict";t.d(Fe,{b:function(){return U}});var h=t(52322),r=t(2784),W=t(79692),k=t(15223),g=t(95544),b=t(80030),c=t(61837),P=t(48348),te=t(47603),_=t(61886);const X=(0,W.Z)(F=>({root:{gridArea:"pageSubheader",flexDirection:"column",minHeight:"auto",padding:F.spacing(3,3,0)}})),U=F=>{const Y=X(),[ce,se]=(0,r.useState)(null),T=(0,r.useCallback)(Xe=>{se(Xe.currentTarget)},[]),R=(0,r.useCallback)(()=>{se(null)},[]),{entityMetadata:{value:V,loading:A}}=(0,_.x1)(),C=(0,_.$L)(),z=C.renderComponentsByLocation(_.oZ.Subheader),Le=C.renderComponentsByLocation(_.oZ.Settings);return!z&&!Le||A===!1&&!V?null:(0,h.jsx)(k.Z,{classes:Y,...F.toolbarProps,children:(0,h.jsxs)(g.Z,{display:"flex",justifyContent:"flex-end",width:"100%",flexWrap:"wrap",children:[z,Le?(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(b.ZP,{title:"Settings",children:(0,h.jsx)(c.Z,{"aria-controls":"tech-docs-reader-page-settings","aria-haspopup":"true",onClick:T,children:(0,h.jsx)(te.Z,{})})}),(0,h.jsx)(P.Z,{id:"tech-docs-reader-page-settings",getContentAnchorEl:null,anchorEl:ce,anchorOrigin:{vertical:"bottom",horizontal:"right"},open:Boolean(ce),onClose:R,keepMounted:!0,children:Le})]}):null]})})}},95481:function(At,Fe,t){"use strict";t.d(Fe,{DK:function(){return U},m1:function(){return Y}});var h=t(52322),r=t(2784),W=t(79635),k=t(61886),g=t(25248),b=t(64279),c=t(77446);function P({contentLoading:ce,content:se,activeSyncState:T}){return ce||T==="BUILD_READY_RELOAD"||!se&&T==="CHECKING"?"CHECKING":!se&&T==="BUILDING"?"INITIAL_BUILD":se?T==="BUILDING"?"CONTENT_STALE_REFRESHING":T==="BUILD_READY"?"CONTENT_STALE_READY":T==="ERROR"?"CONTENT_STALE_ERROR":"CONTENT_FRESH":"CONTENT_NOT_FOUND"}function te(ce,se){const T={...ce};switch(se.type){case"sync":se.state==="CHECKING"&&(T.buildLog=[]),T.activeSyncState=se.state,T.syncError=se.syncError;break;case"contentLoading":T.contentLoading=!0,T.contentError=void 0;break;case"content":typeof se.path=="string"&&(T.path=se.path),T.contentLoading=!1,T.content=se.content,T.contentError=se.contentError;break;case"buildLog":T.buildLog=T.buildLog.concat(se.log);break;default:throw new Error}return["BUILD_READY","BUILD_READY_RELOAD"].includes(T.activeSyncState)&&["contentLoading","content"].includes(se.type)&&(T.activeSyncState="UP_TO_DATE",T.buildLog=[]),T}function _(ce,se,T,R){var V,A;const[C,z]=(0,r.useReducer)(te,{activeSyncState:"CHECKING",path:R,contentLoading:!0,buildLog:[]}),Le=(0,g.h_)(k.Dl),{retry:Xe}=(0,c.Z)(async()=>{z({type:"contentLoading"});try{const Ge=await Le.getEntityDocs({kind:ce,namespace:se,name:T},R);return z({type:"content",content:Ge,path:R}),Ge}catch(Ge){z({type:"content",contentError:Ge,path:R})}},[Le,ce,se,T,R]),Qe=(0,r.useRef)({content:void 0,reload:()=>{}});return Qe.current={content:C.content,reload:Xe},(0,b.default)(async()=>{z({type:"sync",state:"CHECKING"});const Ge=setTimeout(()=>{z({type:"sync",state:"BUILDING"})},1e3);try{switch(await Le.syncEntityDocs({kind:ce,namespace:se,name:T},Ee=>{z({type:"buildLog",log:Ee})})){case"updated":Qe.current.content?z({type:"sync",state:"BUILD_READY"}):(Qe.current.reload(),z({type:"sync",state:"BUILD_READY_RELOAD"}));break;case"cached":z({type:"sync",state:"UP_TO_DATE"});break;default:z({type:"sync",state:"ERROR",syncError:new Error("Unexpected return state")});break}}catch(mt){z({type:"sync",state:"ERROR",syncError:mt})}finally{clearTimeout(Ge)}},[ce,T,se,Le,z,Qe]),{state:(0,r.useMemo)(()=>P({activeSyncState:C.activeSyncState,contentLoading:C.contentLoading,content:C.content}),[C.activeSyncState,C.content,C.contentLoading]),contentReload:Xe,path:C.path,content:C.content,contentErrorMessage:(V=C.contentError)===null||V===void 0?void 0:V.toString(),syncErrorMessage:(A=C.syncError)===null||A===void 0?void 0:A.toString(),buildLog:C.buildLog}}const X=(0,r.createContext)({}),U=()=>(0,r.useContext)(X),F=({children:ce})=>{const{"*":se=""}=(0,W.UO)(),{entityRef:T}=(0,k.x1)(),{kind:R,namespace:V,name:A}=T,C=_(R,V,A,se);return(0,h.jsx)(X.Provider,{value:C,children:ce instanceof Function?ce(C):ce})},Y=ce=>se=>(0,h.jsx)(F,{children:(0,h.jsx)(ce,{...se})})},95573:function(At,Fe,t){"use strict";t.d(Fe,{Fw:function(){return W},_Z:function(){return r},pd:function(){return k}});var h=t(25248);const r=(0,h.NT)({id:"techdocs:index-page"}),W=(0,h.NT)({id:"techdocs:reader-page",params:["namespace","kind","name"]}),k=(0,h.NT)({id:"techdocs:catalog-reader-view"})},17339:function(At,Fe,t){"use strict";t.d(Fe,{S:function(){return V}});var h=t(52322),r=t(2784),W=t(79692),k=t(49378),g=t(38402),b=t(86136),c=t(85256),P=t(90436),te=t(93414),_=t(25248),X=t(65826);const U=(0,W.Z)({flexContainer:{flexWrap:"wrap"},itemText:{width:"100%",marginBottom:"1rem"}}),F=A=>{const{result:C,highlight:z,rank:Le,lineClamp:Xe=5,asListItem:Qe=!0,asLink:_e=!0,title:Ge,icon:mt}=A,Ee=U(),Ke=(0,_.z$)(),at=()=>{Ke.captureEvent("discover",C.title,{attributes:{to:C.location},value:Le})},vt=({children:nt})=>_e?(0,h.jsx)(te.rU,{noTrack:!0,to:C.location,onClick:at,children:nt}):(0,h.jsx)(h.Fragment,{children:nt}),it=()=>{const nt=z!=null&&z.fields.title?(0,h.jsx)(X.FA,{text:z.fields.title,preTag:z.preTag,postTag:z.postTag}):C.title,Lt=z!=null&&z.fields.entityTitle?(0,h.jsx)(X.FA,{text:z.fields.entityTitle,preTag:z.preTag,postTag:z.postTag}):C.entityTitle,bt=z!=null&&z.fields.name?(0,h.jsx)(X.FA,{text:z.fields.name,preTag:z.preTag,postTag:z.postTag}):C.name;return(0,h.jsx)(k.Z,{className:Ee.itemText,primaryTypographyProps:{variant:"h6"},primary:(0,h.jsx)(vt,{children:Ge||(0,h.jsxs)(h.Fragment,{children:[nt," | ",Lt!=null?Lt:bt," docs"]})}),secondary:(0,h.jsx)(P.Z,{component:"span",style:{display:"-webkit-box",WebkitBoxOrient:"vertical",WebkitLineClamp:Xe,overflow:"hidden"},children:z!=null&&z.fields.text?(0,h.jsx)(X.FA,{text:z.fields.text,preTag:z.preTag,postTag:z.postTag}):C.text})})},gt=({children:nt})=>Qe?(0,h.jsxs)(h.Fragment,{children:[(0,h.jsxs)(g.Z,{alignItems:"flex-start",children:[mt&&(0,h.jsx)(b.Z,{children:mt}),(0,h.jsx)("div",{className:Ee.flexContainer,children:nt})]}),(0,h.jsx)(c.Z,{component:"li"})]}):(0,h.jsx)(h.Fragment,{children:nt});return(0,h.jsx)(gt,{children:(0,h.jsx)(it,{})})};var Y=t(27556),ce=t(79635);const se=(0,W.Z)(A=>({root:{width:"100%"},bar:{padding:A.spacing(1)}})),T=A=>A==null?void 0:A.document,R=A=>{const{entityId:C,entityTitle:z,debounceTime:Le=150}=A,[Xe,Qe]=(0,r.useState)(!1),_e=(0,ce.s0)(),{setFilters:Ge,result:{loading:mt,value:Ee}}=(0,X.Rx)(),Ke=se(),[at,vt]=(0,r.useState)([]);(0,r.useEffect)(()=>{let bt=!0;if(bt&&Ee){const ze=Ee.results.slice(0,10);vt(ze)}return()=>{bt=!1}},[mt,Ee]);const{kind:it,name:gt,namespace:nt}=C;(0,r.useEffect)(()=>{Ge(bt=>({...bt,kind:it,namespace:nt,name:gt}))},[it,nt,gt,Ge]);const Lt=(bt,ze)=>{if(T(ze)){const{location:ne}=ze.document;_e(ne)}};return(0,h.jsx)(Y.Z,{className:Ke.bar,variant:"outlined",children:(0,h.jsx)(X.qO,{classes:{root:Ke.root},"data-testid":"techdocs-search-bar",size:"small",open:Xe,getOptionLabel:()=>"",filterOptions:bt=>bt,onClose:()=>{Qe(!1)},onFocus:()=>{Qe(!0)},onChange:Lt,blurOnSelect:!0,noOptionsText:"No results found",value:null,options:at,renderOption:({document:bt,highlight:ze})=>(0,h.jsx)(F,{result:bt,lineClamp:3,asListItem:!1,asLink:!1,title:bt.title,highlight:ze}),loading:mt,inputDebounceTime:Le,inputPlaceholder:`Search ${z||C.name} docs`,freeSolo:!1})})},V=A=>{const C={term:"",types:["techdocs"],pageCursor:"",filters:A.entityId};return(0,h.jsx)(X.Nd,{initialState:C,children:(0,h.jsx)(R,{...A})})}},53260:function(){}},function(At){var Fe=function(h){return At(At.s=h)};At.O(0,[2370,6202,9284,9035,2126,7012,2194,1410,427,6816,5218,5924,4736],function(){return Fe(51102)});var t=At.O()}]);})();
|
|
496
502
|
|
|
497
|
-
//# sourceMappingURL=main.
|
|
503
|
+
//# sourceMappingURL=main.0da0ba28.js.map
|