@techdocs/cli 1.2.5-next.0 → 1.2.5-next.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +11 -0
- package/dist/embedded-app/index.html +1 -1
- package/dist/embedded-app/static/{main.8a4e56e6.js → main.cba21e8e.js} +15 -15
- package/dist/embedded-app/static/main.cba21e8e.js.map +1 -0
- package/dist/embedded-app/static/module-luxon.4cf2fdd7.js +3 -0
- package/dist/embedded-app/static/module-luxon.4cf2fdd7.js.map +1 -0
- package/dist/embedded-app/static/{runtime.8a4e56e6.js → runtime.cba21e8e.js} +1 -1
- package/dist/embedded-app/static/{runtime.8a4e56e6.js.map → runtime.cba21e8e.js.map} +1 -1
- package/dist/embedded-app/static/{vendor.8a4e56e6.js → vendor.cba21e8e.js} +1 -1
- package/dist/embedded-app/static/{vendor.8a4e56e6.js.map → vendor.cba21e8e.js.map} +1 -1
- package/dist/index.cjs.js +1 -1
- package/package.json +6 -6
- package/dist/embedded-app/static/main.8a4e56e6.js.map +0 -1
- package/dist/embedded-app/static/module-luxon.8ea19264.js +0 -3
- package/dist/embedded-app/static/module-luxon.8ea19264.js.map +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
(()=>{(self.webpackChunktechdocs_cli_embedded_app=self.webpackChunktechdocs_cli_embedded_app||[]).push([[179],{29644:function(Rt,Me,t){"use strict";t.d(Me,{n3:function(){return g},MS:function(){return b}});var h=t(25271),r=t(23054),W=t(96279),B=t.n(W);const g=Symbol.for("CATALOG_FILTER_EXISTS_0e15b590c0b343a2bae3e787e84c2111");class b{async getEntityAncestors(P,te){const{kind:Q,namespace:X,name:M}=(0,h.of)(P.entityRef);return await this.requestRequired("GET",`/entities/by-name/${encodeURIComponent(Q)}/${encodeURIComponent(X)}/${encodeURIComponent(M)}/ancestry`,te)}async getLocationById(P,te){return await this.requestOptional("GET",`/locations/${encodeURIComponent(P)}`,te)}async getEntities(P,te){const{filter:Q=[],fields:X=[],order:M,offset:z,limit:_,after:fe}=P!=null?P:{},ie=[];for(const A of[Q].flat()){const S=[];for(const[q,Te]of Object.entries(A))for(const Qe of[Te].flat())Qe===g?S.push(encodeURIComponent(q)):typeof Qe=="string"&&S.push(`${encodeURIComponent(q)}=${encodeURIComponent(Qe)}`);S.length&&ie.push(`filter=${S.join(",")}`)}if(X.length&&ie.push(`fields=${X.map(encodeURIComponent).join(",")}`),M)for(const A of[M].flat())A&&ie.push(`order=${encodeURIComponent(A.order)}:${encodeURIComponent(A.field)}`);z!==void 0&&ie.push(`offset=${z}`),_!==void 0&&ie.push(`limit=${_}`),fe!==void 0&&ie.push(`after=${encodeURIComponent(fe)}`);const T=ie.length?`?${ie.join("&")}`:"",L=await this.requestRequired("GET",`/entities${T}`,te),Z=(A,S)=>{var q,Te;if(((q=A.metadata)===null||q===void 0?void 0:q.name)===void 0||A.kind===void 0||((Te=S.metadata)===null||Te===void 0?void 0:Te.name)===void 0||S.kind===void 0)return 0;const Qe=(0,h.eE)(A),Ye=(0,h.eE)(S);return Qe<Ye?-1:Qe>Ye?1:0};return{items:L.sort(Z)}}async getEntitiesByRefs(P,te){var Q;const X=[];!((Q=P.fields)===null||Q===void 0)&&Q.length&&X.push(`fields=${P.fields.map(encodeURIComponent).join(",")}`);const M=await this.discoveryApi.getBaseUrl("catalog"),z=X.length?`?${X.join("&")}`:"",_=`${M}/entities/by-refs${z}`,fe=await this.fetchApi.fetch(_,{headers:{"Content-Type":"application/json",...(te==null?void 0:te.token)&&{Authorization:`Bearer ${te==null?void 0:te.token}`}},method:"POST",body:JSON.stringify({entityRefs:P.entityRefs})});if(!fe.ok)throw await r.VL.fromResponse(fe);const{items:ie}=await fe.json();return{items:ie}}async getEntityByRef(P,te){const{kind:Q,namespace:X,name:M}=(0,h.of)(P);return this.requestOptional("GET",`/entities/by-name/${encodeURIComponent(Q)}/${encodeURIComponent(X)}/${encodeURIComponent(M)}`,te)}async getEntityByName(P,te){const{kind:Q,namespace:X="default",name:M}=P;return this.requestOptional("GET",`/entities/by-name/${encodeURIComponent(Q)}/${encodeURIComponent(X)}/${encodeURIComponent(M)}`,te)}async refreshEntity(P,te){const Q=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(Q.status!==200)throw new Error(await Q.text())}async getEntityFacets(P,te){const{filter:Q=[],facets:X}=P,M=[];for(const _ of[Q].flat()){const fe=[];for(const[ie,T]of Object.entries(_))for(const L of[T].flat())L===g?fe.push(encodeURIComponent(ie)):typeof L=="string"&&fe.push(`${encodeURIComponent(ie)}=${encodeURIComponent(L)}`);fe.length&&M.push(`filter=${fe.join(",")}`)}for(const _ of X)M.push(`facet=${encodeURIComponent(_)}`);const z=M.length?`?${M.join("&")}`:"";return await this.requestOptional("GET",`/entity-facets${z}`,te)}async addLocation(P,te){const{type:Q="url",target:X,dryRun:M}=P,z=await this.fetchApi.fetch(`${await this.discoveryApi.getBaseUrl("catalog")}/locations${M?"?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:Q,target:X})});if(z.status!==201)throw new Error(await z.text());const{location:_,entities:fe,exists:ie}=await z.json();if(!_)throw new Error(`Location wasn't added: ${X}`);return{location:_,entities:fe,exists:ie}}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,Q){const X=await this.fetchApi.fetch(`${await this.discoveryApi.getBaseUrl("catalog")}/validate-entity`,{headers:{"Content-Type":"application/json",...(Q==null?void 0:Q.token)&&{Authorization:`Bearer ${Q==null?void 0:Q.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:M=[]}=await X.json();return{valid:!1,errors:M}}async requestIgnored(P,te,Q){const X=`${await this.discoveryApi.getBaseUrl("catalog")}${te}`,M=Q!=null&&Q.token?{Authorization:`Bearer ${Q.token}`}:{},z=await this.fetchApi.fetch(X,{method:P,headers:M});if(!z.ok)throw await r.VL.fromResponse(z)}async requestRequired(P,te,Q){const X=`${await this.discoveryApi.getBaseUrl("catalog")}${te}`,M=Q!=null&&Q.token?{Authorization:`Bearer ${Q.token}`}:{},z=await this.fetchApi.fetch(X,{method:P,headers:M});if(!z.ok)throw await r.VL.fromResponse(z);return await z.json()}async requestOptional(P,te,Q){const X=`${await this.discoveryApi.getBaseUrl("catalog")}${te}`,M=Q!=null&&Q.token?{Authorization:`Bearer ${Q.token}`}:{},z=await this.fetchApi.fetch(X,{method:P,headers:M});if(!z.ok){if(z.status===404)return;throw await r.VL.fromResponse(z)}return await z.json()}constructor(P){this.discoveryApi=P.discoveryApi,this.fetchApi=P.fetchApi||{fetch:B()}}}},25271:function(Rt,Me,t){"use strict";t.d(Me,{Tf:function(){return W},P1:function(){return ge},q1:function(){return ee},M6:function(){return Ee},l2:function(){return r},zG:function(){return h},w$:function(){return En},nP:function(){return Fn},aS:function(){return zn},S4:function(){return qt},cz:function(){return Mn},iB:function(){return gt},CV:function(){return wt},of:function(){return rt},Ou:function(){return Ne},eE:function(){return ot},NZ:function(){return _e}});const h="default",r="backstage.io/view-url",W="backstage.io/edit-url",B="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(k){return k.metadata.namespace?k:lodash.merge({metadata:{namespace:this.namespace}},k)}constructor(k=DEFAULT_NAMESPACE){this.namespace=k}}class Q{static isValidPrefixAndOrSuffix(k,ce,Oe,D){if(typeof k!="string")return!1;const U=k.split(ce);return U.length===1?D(U[0]):U.length===2?Oe(U[0])&&D(U[1]):!1}static isJsonSafe(k){try{return P().isEqual(k,JSON.parse(JSON.stringify(k)))}catch{return!1}}static isValidDnsSubdomain(k){return typeof k=="string"&&k.length>=1&&k.length<=253&&k.split(".").every(Q.isValidDnsLabel)}static isValidDnsLabel(k){return typeof k=="string"&&k.length>=1&&k.length<=63&&/^[a-z0-9]+(\-[a-z0-9]+)*$/.test(k)}static isValidTag(k){return typeof k=="string"&&k.length>=1&&k.length<=63&&/^[a-z0-9+#]+(\-[a-z0-9+#]+)*$/.test(k)}static isValidUrl(k){if(typeof k!="string")return!1;try{return new URL(k),!0}catch{return!1}}static isValidString(k){var ce;return typeof k=="string"&&((ce=k==null?void 0:k.trim())===null||ce===void 0?void 0:ce.length)>=1}static isNonEmptyString(k){var ce;return typeof k=="string"&&((ce=k==null?void 0:k.trim())===null||ce===void 0?void 0:ce.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}}}}}'),M=t(27991),z=t.n(M),_=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"}}}`),fe=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}}}}}}'),ie=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,L=[X,_,fe,ie];function Z(ae){if(!(ae!=null&&ae.length))throw new TypeError("Unknown error");const k=ae[0];throw new TypeError(`${k.instancePath||"<root>"} ${k.message}${k.params?` - ${Object.entries(k.params).map(([ce,Oe])=>`${ce}: ${Oe}`).join(", ")}`:""}`)}function A(ae,k={}){var ce;const Oe=(ce=k==null?void 0:k.disableCache)!==null&&ce!==void 0?ce:!1,D=Oe?"":JSON.stringify(ae);if(!Oe){const ye=T.get(D);if(ye)return ye}const U=S(ae),de=new(z())({allowUnionTypes:!0,allErrors:!0,validateSchema:!0});U.length&&de.addSchema(U,void 0,void 0,!0);const pe=de.compile(ae);return Oe||T.set(D,pe),pe}function S(ae){if(typeof ae!="object")return[];const k=new Set;ae.$id&&k.add(ae.$id);const ce=new Array,Oe=[ae];for(;Oe.length;){const D=Oe.pop();for(const U of q(D))if(!k.has(U)){k.add(U);const de=L.find(pe=>pe.$id===U);de&&(ce.push(de),Oe.push(de))}}return ce}function*q(ae){const k=[ae];for(;k.length;){const ce=k.pop();if(typeof ce=="object"&&ce)for(const[Oe,D]of Object.entries(ce))Oe==="$ref"&&typeof D=="string"?yield D.split("#")[0]:k.push(D)}}function Te(ae){const k=compileAjvSchema(ae||entityEnvelopeSchema);return ce=>{if(k(ce)===!0)return ce;throw throwAjvError(k.errors)}}function Qe(ae){const k=A(ae);return ce=>{var Oe;if(k(ce)===!0)return ce;const U=(Oe=k.errors)===null||Oe===void 0?void 0:Oe.filter(de=>["/kind","/apiVersion"].includes(de.instancePath));if((U==null?void 0:U.length)&&U.every(de=>de.keyword==="enum"))return!1;throw Z(k.errors)}}function Ye(ae){const k=compileAjvSchema(ae||entitySchema);return ce=>{if(k(ce)===!0)return ce;throw throwAjvError(k.errors)}}class Xe{static isValidApiVersion(k){return Q.isValidPrefixAndOrSuffix(k,"/",Q.isValidDnsSubdomain,ce=>ce.length>=1&&ce.length<=63&&/^[a-z0-9A-Z]+$/.test(ce))}static isValidKind(k){return typeof k=="string"&&k.length>=1&&k.length<=63&&/^[a-zA-Z][a-z0-9A-Z]*$/.test(k)}static isValidObjectName(k){return typeof k=="string"&&k.length>=1&&k.length<=63&&/^([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9]$/.test(k)}static isValidNamespace(k){return Q.isValidDnsLabel(k)}static isValidLabelKey(k){return Q.isValidPrefixAndOrSuffix(k,"/",Q.isValidDnsSubdomain,Xe.isValidObjectName)}static isValidLabelValue(k){return k===""||Xe.isValidObjectName(k)}static isValidAnnotationKey(k){return Q.isValidPrefixAndOrSuffix(k,"/",Q.isValidDnsSubdomain,Xe.isValidObjectName)}static isValidAnnotationValue(k){return typeof k=="string"}}const Ve={isValidApiVersion:Xe.isValidApiVersion,isValidKind:Xe.isValidKind,isValidEntityName:Xe.isValidObjectName,isValidNamespace:Xe.isValidNamespace,isValidLabelKey:Xe.isValidLabelKey,isValidLabelValue:Xe.isValidLabelValue,isValidAnnotationKey:Xe.isValidAnnotationKey,isValidAnnotationValue:Xe.isValidAnnotationValue,isValidTag:ae=>typeof ae=="string"&&ae.length>=1&&ae.length<=63&&/^[a-z0-9:+#]+(\-[a-z0-9:+#]+)*$/.test(ae)};function ft(ae={}){return{...Ve,...ae}}class je{async enforce(k){function ce(w,H,ve){if(H==null)throw new Error(`${w} must have a value`);let ue;try{ue=ve(H)}catch(we){throw new Error(`${w} could not be validated, ${we}`)}if(!ue){let we;switch(ve.name){case"isValidLabelValue":case"isValidObjectName":we="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":we="a valid prefix and/or suffix";break;case"isValidNamespace":case"isValidDnsLabel":we="a string that is sequences of [a-z0-9] separated by [-], at most 63 characters in total";break;case"isValidTag":we="a string that is sequences of [a-z0-9+#] separated by [-], at most 63 characters in total";break;case"isValidAnnotationValue":we="a string";break;case"isValidKind":we="a string that is a sequence of [a-zA-Z][a-z0-9A-Z], at most 63 characters in total";break;case"isValidUrl":we="a string that is a valid url";break;case"isValidString":case"isNonEmptyString":we="a non empty string";break;default:we=void 0;break}const ke=we?` expected ${we} but found "${H}".`:"";throw new Error(`"${w}" is not valid;${ke} 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 Oe(w,H,ve){return H===void 0||ce(w,H,ve)}ce("apiVersion",k.apiVersion,this.validators.isValidApiVersion),ce("kind",k.kind,this.validators.isValidKind),ce("metadata.name",k.metadata.name,this.validators.isValidEntityName),Oe("metadata.namespace",k.metadata.namespace,this.validators.isValidNamespace);var D;for(const[w,H]of Object.entries((D=k.metadata.labels)!==null&&D!==void 0?D:[]))ce(`labels.${w}`,w,this.validators.isValidLabelKey),ce(`labels.${w}`,H,this.validators.isValidLabelValue);var U;for(const[w,H]of Object.entries((U=k.metadata.annotations)!==null&&U!==void 0?U:[]))ce(`annotations.${w}`,w,this.validators.isValidAnnotationKey),ce(`annotations.${w}`,H,this.validators.isValidAnnotationValue);var de;const pe=(de=k.metadata.tags)!==null&&de!==void 0?de:[];for(let w=0;w<pe.length;++w)ce(`tags.${w}`,pe[w],this.validators.isValidTag);var ye;const Pe=(ye=k.metadata.links)!==null&&ye!==void 0?ye:[];for(let w=0;w<Pe.length;++w){var Le,Ue,nt;ce(`links.${w}.url`,(Le=Pe[w])===null||Le===void 0?void 0:Le.url,CommonValidatorFunctions.isValidUrl),Oe(`links.${w}.title`,(Ue=Pe[w])===null||Ue===void 0?void 0:Ue.title,CommonValidatorFunctions.isNonEmptyString),Oe(`links.${w}.icon`,(nt=Pe[w])===null||nt===void 0?void 0:nt.icon,KubernetesValidatorFunctions.isValidObjectName)}return k}constructor(k=makeValidator()){this.validators=k}}class Ge{async enforce(k){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(k)===!0)return k;const[Oe]=this.validate.errors||[];throw Oe?new Error(`Malformed envelope, ${Oe.instancePath||"<root>"} ${Oe.message}`):new Error("Malformed envelope, Unknown error")}}function st(ae){let k=ae.indexOf(":");const ce=ae.indexOf("/");ce!==-1&&ce<k&&(k=-1);const Oe=k===-1?void 0:ae.slice(0,k),D=ce===-1?void 0:ae.slice(k+1,ce),U=ae.slice(Math.max(k+1,ce+1));if(Oe===""||D===""||U==="")throw new TypeError(`Entity reference "${ae}" was not on the form [<kind>:][<namespace>/]<name>`);return{kind:Oe,namespace:D,name:U}}function gt(ae){return{kind:ae.kind,namespace:ae.metadata.namespace||h,name:ae.metadata.name}}function rt(ae,k){if(!ae)throw new Error("Entity reference must not be empty");const ce=k==null?void 0:k.defaultKind,Oe=(k==null?void 0:k.defaultNamespace)||h;let D,U,de;if(typeof ae=="string"){const Ue=st(ae);var pe;D=(pe=Ue.kind)!==null&&pe!==void 0?pe:ce;var ye;U=(ye=Ue.namespace)!==null&&ye!==void 0?ye:Oe,de=Ue.name}else{var Pe;D=(Pe=ae.kind)!==null&&Pe!==void 0?Pe:ce;var Le;U=(Le=ae.namespace)!==null&&Le!==void 0?Le:Oe,de=ae.name}if(D)if(U){if(!de){const Ue=JSON.stringify(ae);throw new Error(`Entity reference ${Ue} had missing or empty name`)}}else{const Ue=JSON.stringify(ae);throw new Error(`Entity reference ${Ue} had missing or empty namespace`)}else{const Ue=JSON.stringify(ae);throw new Error(`Entity reference ${Ue} had missing or empty kind (e.g. did not start with "component:" or similar)`)}return{kind:D,namespace:U,name:de}}function ot(ae){let k,ce,Oe;if("metadata"in ae){k=ae.kind;var D;ce=(D=ae.metadata.namespace)!==null&&D!==void 0?D:h,Oe=ae.metadata.name}else{k=ae.kind;var U;ce=(U=ae.namespace)!==null&&U!==void 0?U:h,Oe=ae.name}return`${k.toLocaleLowerCase("en-US")}:${ce.toLocaleLowerCase("en-US")}/${Oe.toLocaleLowerCase("en-US")}`}class ct{async enforce(k){let ce=k;for(const Oe of this.policies){const D=await Oe.enforce(ce);if(!D)throw new Error(`Policy ${Oe.constructor.name} did not return a result`);ce=D}return ce}constructor(k){this.policies=k}}class yt{async enforce(k){for(const ce of this.policies){const Oe=await ce.enforce(k);if(Oe)return Oe}throw new Error("The entity did not match any known policy")}constructor(k){this.policies=k}}const Lt={allOf(ae){return new ct(ae)},oneOf(ae){return new yt(ae)}};var We=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 se(ae){let k;return{async check(ce){return k||(k=Qe(ae)),k(ce)===ce}}}const Ie=se(We);var Re=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=se(Re);var mt=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=se(mt);var dt=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 Et=se(dt);var At=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=se(At),qt="ownedBy",Vt="ownerOf",Ht="consumesApi",Jt="apiConsumedBy",dn="providesApi",an="apiProvidedBy",Fn="dependsOn",En="dependencyOf",Un="parentOf",mn="childOf",un="memberOf",Qt="hasMember",Mn="partOf",zn="hasPart";var hn=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 vn=se(hn);var yn=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 Ln=se(yn);var Pn=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 xn=se(Pn),ge="backstage.io/managed-by-location",ee="backstage.io/managed-by-origin-location",Ee="backstage.io/source-location";function Ne(ae){if(typeof ae!="string")throw new TypeError(`Unable to parse location ref '${ae}', unexpected argument ${typeof ae}`);const k=ae.indexOf(":");if(k<0)throw new TypeError(`Unable to parse location ref '${ae}', expected '<type>:<target>', e.g. 'url:https://host/path'`);const ce=ae.substring(0,k).trim(),Oe=ae.substring(k+1).trim();if(!ce||!Oe)throw new TypeError(`Unable to parse location ref '${ae}', expected '<type>:<target>', e.g. 'url:https://host/path'`);if(ce==="http"||ce==="https")throw new TypeError(`Invalid location ref '${ae}', please prefix it with 'url:', e.g. 'url:${ae}'`);return{type:ce,target:Oe}}function _e(ae){const{type:k,target:ce}=ae;if(k){if(!ce)throw new TypeError("Unable to stringify location ref, empty target")}else throw new TypeError("Unable to stringify location ref, empty type");return`${k}:${ce}`}function wt(ae){var k,ce,Oe,D,U;const de=(U=(k=ae.metadata)===null||k===void 0||(ce=k.annotations)===null||ce===void 0?void 0:ce[Ee])!==null&&U!==void 0?U:(Oe=ae.metadata)===null||Oe===void 0||(D=Oe.annotations)===null||D===void 0?void 0:D[ge];if(!de)throw new Error(`Entity '${ot(ae)}' is missing location`);return Ne(de)}},93414:function(Rt,Me,t){"use strict";t.d(Me,{zx:function(){return ft},Oi:function(){return se},VY:function(){return $i},yW:function(){return Xa},XF:function(){return tt},mn:function(){return wt},NX:function(){return h},ub:function(){return Ue},mf:function(){return nl},yu:function(){return ln},h4:function(){return Gi},M6:function(){return _n},i9:function(){return pl},aR:function(){return Zi},rJ:function(){return Rr},Oh:function(){return xl},hu:function(){return ml},rU:function(){return Xe},nU:function(){return Fr},sk:function(){return it},Or:function(){return or},T3:function(){return Ki},g9:function(){return wl},Ex:function(){return xs},Gk:function(){return C},tn:function(){return Di},Ph:function(){return Tn},YE:function(){return Xo},v7:function(){return da},R6:function(){return ds},tR:function(){return nr},uw:function(){return Ca},qt:function(){return eo},iA:function(){return Hi},GB:function(){return Sn},po:function(){return ur},mZ:function(){return Bs},Pf:function(){return Wr}});var h={};t.r(h),t.d(h,{Nm:function(){return mt},ht:function(){return Et},LJ:function(){return dt}});var r=t(52322),W=t(25248),B=t(19928),g=t(2784);function b(e){const[s,i]=useState([]),u=useApi(alertApiRef),{anchorOrigin:p={vertical:"top",horizontal:"center"},transientTimeoutMs:m}=e,E=m!=null?m:5e3;useEffect(()=>{const F=u.alert$().subscribe(he=>i(re=>re.concat(he)));return()=>{F.unsubscribe()}},[u]);const[O]=s;if(useEffect(()=>{if(O&&O.display==="transient"){const F=setTimeout(()=>{i(he=>{const re=he.filter(xe=>xe!==O);return re.length===he.length?he:re})},E);return()=>clearTimeout(F)}},[O,E]),s.length===0)return null;const G=()=>{i(F=>F.filter(he=>he!==O))};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:O.severity,children:_jsxs(Typography,{component:"span",children:[String(O.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 Q(e){const{displayName:s,picture:i,customStyles:u}=e,p=te();let m={...u};const E={fontFamily:m.fontFamily,fontSize:m.fontSize,fontWeight:m.fontWeight};return i||(m={backgroundColor:stringToColor(s||""),...u}),_jsx(MaterialAvatar,{alt:s,src:i,className:p.avatar,style:m,children:s&&_jsx(Typography,{variant:"h6",component:"span",className:p.avatarText,style:E,children:extractInitials(s)})})}var X=t(77277),M=t(86689),z=t(90436),_=t(72779),fe=t.n(_),ie=t(76635),T=t(79635),L=t(39857);function Z(){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"}),S=e=>/^([a-z+.-]+):/.test(e),q=()=>{try{return(0,W.h_)(W.Ds).getOptionalString("app.baseUrl")}catch{return}},Te=()=>{const e="http://sample.dev";var s;const i=(s=q())!==null&&s!==void 0?s:"/",{pathname:u}=new URL(i,e);return(0,ie.trimEnd)(u,"/")},Qe=e=>{let s=String(e);const i=Te(),u=S(s),p=s.startsWith(i);return!u&&!p&&(s=i.concat(s)),s},Ye=e=>{if(e instanceof Array)return e.map(Ye).join(" ").trim();if(typeof e=="object"&&e){var s;return Ye(e==null||(s=e.props)===null||s===void 0?void 0:s.children)}return["string","number"].includes(typeof e)?String(e):""},Xe=g.forwardRef(({onClick:e,noTrack:s,...i},u)=>{const p=A(),m=(0,W.z$)(),E=Z()?Qe(i.to):i.to,O=Ye(i.children)||E,G=S(E),F=G&&!!/^https?:/.exec(E),he=re=>{e==null||e(re),s||m.captureEvent("click",O,{attributes:{to:E}})};return G?(0,r.jsxs)(M.Z,{...F?{target:"_blank",rel:"noopener"}:{},...i,ref:u,href:E,onClick:he,className:fe()(p.externalLink,i.className),children:[i.children,(0,r.jsx)(z.Z,{component:"span",className:p.visuallyHidden,children:", Opens in a new window"})]}):(0,r.jsx)(M.Z,{...i,ref:u,component:L.rU,to:E,onClick:he})}),Ve=g.forwardRef((e,s)=>(0,r.jsx)(Xe,{ref:s,...e,color:"initial"})),ft=g.forwardRef((e,s)=>(0,r.jsx)(X.Z,{ref:s,component:Ve,...e}));var je=t(95544),Ge=t(60364),st=t(83229),gt=t(26639),rt=t(39595),ot=t(61837),ct=t(80030),yt=t(19353),Lt=t(95074);function We(e){const{text:s,tooltipDelay:i=1e3,tooltipText:u="Text copied to clipboard","aria-label":p="Copy text"}=e,m=(0,W.h_)(W.VE),[E,O]=(0,g.useState)(!1),[{error:G},F]=(0,Lt.Z)();(0,g.useEffect)(()=>{G&&m.post(G)},[G,m]);const he=re=>{re.stopPropagation(),O(!0),F(s)};return(0,r.jsx)(r.Fragment,{children:(0,r.jsx)(ct.ZP,{id:"copy-test-tooltip",title:u,placement:"top",leaveDelay:i,onClose:()=>O(!1),open:E,children:(0,r.jsx)(ot.Z,{onClick:he,"aria-label":p,children:(0,r.jsx)(yt.Z,{})})})})}function se(e){const{text:s,language:i,showLineNumbers:u=!1,highlightedNumbers:p,customStyle:m,showCopyCodeButton:E=!1}=e,O=(0,Ge.Z)(),G=O.palette.type==="dark"?gt.Z:rt.Z,F=O.palette.type==="dark"?"#256bf3":"#e6ffed";return(0,r.jsxs)(je.Z,{position:"relative",children:[(0,r.jsx)(st.Z,{customStyle:m,language:i,style:G,showLineNumbers:u,wrapLines:!0,lineNumberStyle:{color:O.palette.textVerySubtle},lineProps:he=>p!=null&&p.includes(he)?{style:{backgroundColor:F}}:{},children:s}),E&&(0,r.jsx)(je.Z,{position:"absolute",top:0,right:0,children:(0,r.jsx)(We,{text:s})})]})}var Ie=t(41156),Re=t(88188);function tt(e){const{title:s,to:i}=e,u=(0,Ie.Z)(p=>p.breakpoints.down("xs"));return i?u?(0,r.jsx)(ot.Z,{component:L.rU,color:"primary",title:s,size:"small",to:i,children:(0,r.jsx)(Re.Z,{})}):(0,r.jsx)(X.Z,{component:L.rU,variant:"contained",color:"primary",to:i,children:s}):null}var mt;(function(e){e.TOP_BOTTOM="TB",e.BOTTOM_TOP="BT",e.LEFT_RIGHT="LR",e.RIGHT_LEFT="RL"})(mt||(mt={}));var Zt;(function(e){e.UP_LEFT="UL",e.UP_RIGHT="UR",e.DOWN_LEFT="DL",e.DOWN_RIGHT="DR"})(Zt||(Zt={}));var dt;(function(e){e.NETWORK_SIMPLEX="network-simplex",e.TIGHT_TREE="tight-tree",e.LONGEST_PATH="longest-path"})(dt||(dt={}));var Et;(function(e){e.LEFT="l",e.RIGHT="r",e.CENTER="c"})(Et||(Et={}));var At=t(27397),Ot=t(11105),qt=t(97963),Vt=t(46506),Ht=t.n(Vt),Jt=t(54073),dn=t.n(Jt),an=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 En({node:{id:e}}){const s=Fn(),[i,u]=g.useState(0),[p,m]=g.useState(0),E=g.useRef(null);g.useLayoutEffect(()=>{if(E.current){let{height:he,width:re}=E.current.getBBox();he=Math.round(he),re=Math.round(re),(he!==p||re!==i)&&(u(re),m(he))}},[i,p]);const O=10,G=i+O*2,F=p+O*2;return(0,r.jsxs)("g",{children:[(0,r.jsx)("rect",{className:s.node,width:G,height:F,rx:10}),(0,r.jsx)("text",{ref:E,className:s.text,y:F/2,x:G/2,textAnchor:"middle",alignmentBaseline:"middle",children:e})]})}const Un="arrow-marker",mn="node",un="edge",Qt="label",Mn=(0,an.Z)(e=>({node:{transition:`${e.transitions.duration.shortest}ms`}}),{name:"BackstageDependencyGraphNode"}),zn=e=>(0,r.jsx)(En,{...e});function hn({render:e=zn,setNode:s,node:i}){const{width:u,height:p,x:m=0,y:E=0}=i,O=i,G=Mn(),F=g.useRef(null);return g.useLayoutEffect(()=>{if(F.current){let{height:he,width:re}=F.current.getBBox();he=Math.round(he),re=Math.round(re),(he!==p||re!==u)&&s(i.id,{...i,height:he,width:re})}},[i,u,p,s]),(0,r.jsx)("g",{ref:F,"data-testid":mn,className:G.node,transform:`translate(${m-u/2},${E-p/2})`,children:e({node:O})})}var vn=t(76985),yn=t(39829),Ln=t(19574),Pn=t.n(Ln);const xn=(0,an.Z)(e=>({text:{fill:e.palette.textContrast}}),{name:"BackstageDependencyGraphDefaultLabel"});function ge({edge:{label:e}}){const s=xn();return(0,r.jsx)("text",{className:s.text,textAnchor:"middle",children:e})}const ee=(0,an.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"}),Ee=e=>(0,r.jsx)(ge,{...e});function Ne({render:e=Ee,setEdge:s,id:i,edge:u,curve:p}){const{x:m=0,y:E=0,width:O,height:G,points:F}=u,he=u,re=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!==O)&&s(i,{...u,height:qe,width:Pt})}},[u,G,O,s,i]);let Ce="";const He=g.useMemo(()=>vn.Z().x(qe=>qe.x).y(qe=>qe.y).curve(yn[p]),[p]);if(F){const qe=F.filter(Pt=>Pn()(Pt.x)&&Pn()(Pt.y));Ce=He(qe)||""}return(0,r.jsxs)(r.Fragment,{children:[Ce&&(0,r.jsx)("path",{"data-testid":un,className:re.path,d:Ce}),he.label?(0,r.jsx)("g",{ref:xe,"data-testid":Qt,className:re.label,transform:`translate(${m},${E})`,children:e({edge:he})}):null]})}const _e="workspace";function wt(e){var s,i;const{edges:u,nodes:p,renderNode:m,direction:E=mt.TOP_BOTTOM,align:O,nodeMargin:G=50,edgeMargin:F=10,rankMargin:he=50,paddingX:re=0,paddingY:xe=0,acyclicer:Ce,ranker:He=dt.NETWORK_SIMPLEX,labelPosition:qe=Et.RIGHT,labelOffset:Pt=10,edgeRanks:Gt=1,edgeWeight:tn=1,renderLabel:nn,defs:kt,zoom:Xt="enabled",curve:Kt="curveMonotoneX",fit:br="grow",...Sr}=e,wr=(0,qt.Z)(),[Cr,ai]=g.useState(100),[$r,li]=g.useState(100),Yt=g.useRef(new(Ht()).graphlib.Graph),[us,yo]=g.useState(((s=Yt.current.graph())===null||s===void 0?void 0:s.width)||0),[Zr,ci]=g.useState(((i=Yt.current.graph())===null||i===void 0?void 0:i.height)||0),[Dn,hr]=g.useState([]),[Hr,Gr]=g.useState([]),sn=Math.max(us,Cr),gn=Math.max(Zr,$r),hs=Math.min(Zr,$r),Kr=br==="grow"?gn:hs,Ds=g.useMemo(()=>dn()(cn=>{if(!cn)return;const Nn=Ot.Z(cn),on=Ot.Z(cn.getElementById(_e));function lr(){Nn.call(At.sP().scaleExtent([1,10]).on("zoom",jr=>{jr.transform.x=Math.min(0,Math.max(jr.transform.x,sn-sn*jr.transform.k)),jr.transform.y=Math.min(0,Math.max(jr.transform.y,gn-gn*jr.transform.k)),on.attr("transform",jr.transform)}))}Xt==="enabled"?lr():Xt==="enable-on-click"&&Nn.on("click",()=>lr());const{width:cr,height:xo}=cn.getBoundingClientRect();Cr!==cr&&ai(cr),$r!==xo&&li(xo)},100),[$r,Cr,sn,gn,Xt]),ea=g.useCallback(()=>{const cn=Yt.current.nodes(),Nn=Yt.current.edges();cn.forEach(on=>{p.some(cr=>cr.id===on)||Yt.current.removeNode(on)}),Nn.forEach(on=>{u.some(cr=>cr.from===on.v&&cr.to===on.w)||Yt.current.removeEdge(on.v,on.w)}),p.forEach(on=>{const lr=Yt.current.nodes().find(cr=>on.id===cr);if(lr&&Yt.current.node(lr)){const{width:cr,height:xo,x:jr,y:Ml}=Yt.current.node(lr);Yt.current.setNode(lr,{...on,width:cr,height:xo,x:jr,y:Ml})}else Yt.current.setNode(on.id,{...on,width:0,height:0})}),u.forEach(on=>{Yt.current.setEdge(on.from,on.to,{...on,label:on.label,width:0,height:0,labelpos:qe,labeloffset:Pt,weight:tn,minlen:Gt})})},[u,p,qe,Pt,tn,Gt]),Ns=g.useMemo(()=>dn()(()=>{Ht().layout(Yt.current);const{height:cn,width:Nn}=Yt.current.graph(),on=Math.max(0,cn||0),lr=Math.max(0,Nn||0);yo(lr),ci(on),hr(Yt.current.nodes()),Gr(Yt.current.edges())},250,{leading:!0}),[]);g.useEffect(()=>(Yt.current.setGraph({rankdir:E,align:O,nodesep:G,edgesep:F,ranksep:he,marginx:re,marginy:xe,acyclicer:Ce,ranker:He}),ea(),Ns(),Ns.cancel),[Ce,O,E,F,re,xe,G,he,He,ea,Ns]);function Fl(cn,Nn){return Yt.current.setNode(cn,Nn),Ns(),Yt.current}function Ul(cn,Nn){return Yt.current.setEdge(cn,Nn),Ns(),Yt.current}return(0,r.jsxs)("svg",{ref:Ds,...Sr,width:"100%",height:Kr,viewBox:`0 0 ${sn} ${gn}`,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:wr.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:_e,children:(0,r.jsxs)("svg",{width:us,height:Zr,y:gn/2-Zr/2,x:sn/2-us/2,viewBox:`0 0 ${us} ${Zr}`,children:[Hr.map(cn=>{const Nn=Yt.current.edge(cn);return Nn?(0,r.jsx)(Ne,{id:cn,setEdge:Ul,render:nn,edge:Nn,curve:Kt},`${cn.v}-${cn.w}`):null}),Dn.map(cn=>{const Nn=Yt.current.node(cn);return Nn?(0,r.jsx)(hn,{setNode:Fl,render:m,node:Nn},cn):null})]})})]})}var ae;const k=(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"}),ce=e=>{const{variant:s,message:i,id:u,fixed:p=!1}=e,m=k(),O=useApi(storageApiRef).forBucket("notifications");var G;const F=(G=O.snapshot("dismissedBanners").value)!==null&&G!==void 0?G:[],[he,re]=useState(new Set(F)),xe=useObservable(O.observe$("dismissedBanners"));useEffect(()=>{if(xe!=null&&xe.value){var He;const qe=(He=xe==null?void 0:xe.value)!==null&&He!==void 0?He:[];re(new Set(qe))}},[xe==null?void 0:xe.value]);const Ce=()=>{O.set("dismissedBanners",[...he,u])};return _jsx(Snackbar,{anchorOrigin:p?{vertical:"bottom",horizontal:"center"}:{vertical:"top",horizontal:"center"},open:!he.has(u),classes:{root:classNames(m.root,!p&&m.topPosition)},children:_jsx(SnackbarContent,{classes:{root:classNames(m.content,m[s]),message:m.message},message:i,action:[_jsx(IconButton,{title:"Permanently dismiss this message",color:"inherit",onClick:Ce,children:_jsx(Close,{className:m.icon})},"dismiss")]})})};var Oe=t(60905),D=t.p+"static/missingAnnotation.67f79e98..svg",U=t.p+"static/noInformation.4b426325..svg",de=t.p+"static/createComponent.975d1e1e..svg",pe=t.p+"static/noBuild.1715fa71..svg";const ye=(0,c.Z)({generalImg:{width:"95%",zIndex:2,position:"relative",left:"50%",top:"50%",transform:"translate(-50%, 15%)"}},{name:"BackstageEmptyStateImage"}),Pe=({missing:e})=>{const s=ye();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:U,alt:"no Information",className:s.generalImg});case"content":return(0,r.jsx)("img",{src:de,alt:"create Component",className:s.generalImg});case"data":return(0,r.jsx)("img",{src:pe,alt:"no Build",className:s.generalImg});default:return null}},Le=(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 Ue(e){const{title:s,description:i,missing:u,action:p}=e,m=Le();return(0,r.jsxs)(Oe.Z,{container:!0,direction:"row",justifyContent:"space-around",alignItems:"flex-start",className:m.root,spacing:2,children:[(0,r.jsx)(Oe.Z,{item:!0,xs:12,md:6,children:(0,r.jsxs)(Oe.Z,{container:!0,direction:"column",children:[(0,r.jsx)(Oe.Z,{item:!0,xs:!0,children:(0,r.jsx)(z.Z,{variant:"h5",children:s})}),(0,r.jsx)(Oe.Z,{item:!0,xs:!0,children:(0,r.jsx)(z.Z,{variant:"body1",children:i})}),(0,r.jsx)(Oe.Z,{item:!0,xs:!0,className:m.action,children:p})]})}),(0,r.jsx)(Oe.Z,{item:!0,xs:12,md:6,className:m.imageContainer,children:typeof u=="string"?(0,r.jsx)(Pe,{missing:u}):u.customImage})]})}const nt=`apiVersion: backstage.io/v1alpha1
|
|
1
|
+
(()=>{(self.webpackChunktechdocs_cli_embedded_app=self.webpackChunktechdocs_cli_embedded_app||[]).push([[179],{29644:function(Rt,Me,t){"use strict";t.d(Me,{n3:function(){return g},MS:function(){return b}});var h=t(25271),r=t(23054),W=t(96279),B=t.n(W);const g=Symbol.for("CATALOG_FILTER_EXISTS_0e15b590c0b343a2bae3e787e84c2111");class b{async getEntityAncestors(P,te){const{kind:Q,namespace:X,name:M}=(0,h.of)(P.entityRef);return await this.requestRequired("GET",`/entities/by-name/${encodeURIComponent(Q)}/${encodeURIComponent(X)}/${encodeURIComponent(M)}/ancestry`,te)}async getLocationById(P,te){return await this.requestOptional("GET",`/locations/${encodeURIComponent(P)}`,te)}async getEntities(P,te){const{filter:Q=[],fields:X=[],order:M,offset:z,limit:_,after:fe}=P!=null?P:{},ie=[];for(const A of[Q].flat()){const S=[];for(const[q,Te]of Object.entries(A))for(const Qe of[Te].flat())Qe===g?S.push(encodeURIComponent(q)):typeof Qe=="string"&&S.push(`${encodeURIComponent(q)}=${encodeURIComponent(Qe)}`);S.length&&ie.push(`filter=${S.join(",")}`)}if(X.length&&ie.push(`fields=${X.map(encodeURIComponent).join(",")}`),M)for(const A of[M].flat())A&&ie.push(`order=${encodeURIComponent(A.order)}:${encodeURIComponent(A.field)}`);z!==void 0&&ie.push(`offset=${z}`),_!==void 0&&ie.push(`limit=${_}`),fe!==void 0&&ie.push(`after=${encodeURIComponent(fe)}`);const T=ie.length?`?${ie.join("&")}`:"",L=await this.requestRequired("GET",`/entities${T}`,te),Z=(A,S)=>{var q,Te;if(((q=A.metadata)===null||q===void 0?void 0:q.name)===void 0||A.kind===void 0||((Te=S.metadata)===null||Te===void 0?void 0:Te.name)===void 0||S.kind===void 0)return 0;const Qe=(0,h.eE)(A),Ye=(0,h.eE)(S);return Qe<Ye?-1:Qe>Ye?1:0};return{items:L.sort(Z)}}async getEntitiesByRefs(P,te){var Q;const X=[];!((Q=P.fields)===null||Q===void 0)&&Q.length&&X.push(`fields=${P.fields.map(encodeURIComponent).join(",")}`);const M=await this.discoveryApi.getBaseUrl("catalog"),z=X.length?`?${X.join("&")}`:"",_=`${M}/entities/by-refs${z}`,fe=await this.fetchApi.fetch(_,{headers:{"Content-Type":"application/json",...(te==null?void 0:te.token)&&{Authorization:`Bearer ${te==null?void 0:te.token}`}},method:"POST",body:JSON.stringify({entityRefs:P.entityRefs})});if(!fe.ok)throw await r.VL.fromResponse(fe);const{items:ie}=await fe.json();return{items:ie}}async getEntityByRef(P,te){const{kind:Q,namespace:X,name:M}=(0,h.of)(P);return this.requestOptional("GET",`/entities/by-name/${encodeURIComponent(Q)}/${encodeURIComponent(X)}/${encodeURIComponent(M)}`,te)}async getEntityByName(P,te){const{kind:Q,namespace:X="default",name:M}=P;return this.requestOptional("GET",`/entities/by-name/${encodeURIComponent(Q)}/${encodeURIComponent(X)}/${encodeURIComponent(M)}`,te)}async refreshEntity(P,te){const Q=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(Q.status!==200)throw new Error(await Q.text())}async getEntityFacets(P,te){const{filter:Q=[],facets:X}=P,M=[];for(const _ of[Q].flat()){const fe=[];for(const[ie,T]of Object.entries(_))for(const L of[T].flat())L===g?fe.push(encodeURIComponent(ie)):typeof L=="string"&&fe.push(`${encodeURIComponent(ie)}=${encodeURIComponent(L)}`);fe.length&&M.push(`filter=${fe.join(",")}`)}for(const _ of X)M.push(`facet=${encodeURIComponent(_)}`);const z=M.length?`?${M.join("&")}`:"";return await this.requestOptional("GET",`/entity-facets${z}`,te)}async addLocation(P,te){const{type:Q="url",target:X,dryRun:M}=P,z=await this.fetchApi.fetch(`${await this.discoveryApi.getBaseUrl("catalog")}/locations${M?"?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:Q,target:X})});if(z.status!==201)throw new Error(await z.text());const{location:_,entities:fe,exists:ie}=await z.json();if(!_)throw new Error(`Location wasn't added: ${X}`);return{location:_,entities:fe,exists:ie}}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,Q){const X=await this.fetchApi.fetch(`${await this.discoveryApi.getBaseUrl("catalog")}/validate-entity`,{headers:{"Content-Type":"application/json",...(Q==null?void 0:Q.token)&&{Authorization:`Bearer ${Q==null?void 0:Q.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:M=[]}=await X.json();return{valid:!1,errors:M}}async requestIgnored(P,te,Q){const X=`${await this.discoveryApi.getBaseUrl("catalog")}${te}`,M=Q!=null&&Q.token?{Authorization:`Bearer ${Q.token}`}:{},z=await this.fetchApi.fetch(X,{method:P,headers:M});if(!z.ok)throw await r.VL.fromResponse(z)}async requestRequired(P,te,Q){const X=`${await this.discoveryApi.getBaseUrl("catalog")}${te}`,M=Q!=null&&Q.token?{Authorization:`Bearer ${Q.token}`}:{},z=await this.fetchApi.fetch(X,{method:P,headers:M});if(!z.ok)throw await r.VL.fromResponse(z);return await z.json()}async requestOptional(P,te,Q){const X=`${await this.discoveryApi.getBaseUrl("catalog")}${te}`,M=Q!=null&&Q.token?{Authorization:`Bearer ${Q.token}`}:{},z=await this.fetchApi.fetch(X,{method:P,headers:M});if(!z.ok){if(z.status===404)return;throw await r.VL.fromResponse(z)}return await z.json()}constructor(P){this.discoveryApi=P.discoveryApi,this.fetchApi=P.fetchApi||{fetch:B()}}}},25271:function(Rt,Me,t){"use strict";t.d(Me,{Tf:function(){return W},P1:function(){return ge},q1:function(){return ee},M6:function(){return Ee},l2:function(){return r},zG:function(){return h},w$:function(){return En},nP:function(){return Fn},aS:function(){return zn},S4:function(){return qt},cz:function(){return Mn},iB:function(){return gt},CV:function(){return wt},of:function(){return rt},Ou:function(){return Ne},eE:function(){return ot},NZ:function(){return _e}});const h="default",r="backstage.io/view-url",W="backstage.io/edit-url",B="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(k){return k.metadata.namespace?k:lodash.merge({metadata:{namespace:this.namespace}},k)}constructor(k=DEFAULT_NAMESPACE){this.namespace=k}}class Q{static isValidPrefixAndOrSuffix(k,ce,Oe,D){if(typeof k!="string")return!1;const U=k.split(ce);return U.length===1?D(U[0]):U.length===2?Oe(U[0])&&D(U[1]):!1}static isJsonSafe(k){try{return P().isEqual(k,JSON.parse(JSON.stringify(k)))}catch{return!1}}static isValidDnsSubdomain(k){return typeof k=="string"&&k.length>=1&&k.length<=253&&k.split(".").every(Q.isValidDnsLabel)}static isValidDnsLabel(k){return typeof k=="string"&&k.length>=1&&k.length<=63&&/^[a-z0-9]+(\-[a-z0-9]+)*$/.test(k)}static isValidTag(k){return typeof k=="string"&&k.length>=1&&k.length<=63&&/^[a-z0-9+#]+(\-[a-z0-9+#]+)*$/.test(k)}static isValidUrl(k){if(typeof k!="string")return!1;try{return new URL(k),!0}catch{return!1}}static isValidString(k){var ce;return typeof k=="string"&&((ce=k==null?void 0:k.trim())===null||ce===void 0?void 0:ce.length)>=1}static isNonEmptyString(k){var ce;return typeof k=="string"&&((ce=k==null?void 0:k.trim())===null||ce===void 0?void 0:ce.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}}}}}'),M=t(27991),z=t.n(M),_=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"}}}`),fe=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}}}}}}'),ie=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,L=[X,_,fe,ie];function Z(ae){if(!(ae!=null&&ae.length))throw new TypeError("Unknown error");const k=ae[0];throw new TypeError(`${k.instancePath||"<root>"} ${k.message}${k.params?` - ${Object.entries(k.params).map(([ce,Oe])=>`${ce}: ${Oe}`).join(", ")}`:""}`)}function A(ae,k={}){var ce;const Oe=(ce=k==null?void 0:k.disableCache)!==null&&ce!==void 0?ce:!1,D=Oe?"":JSON.stringify(ae);if(!Oe){const ye=T.get(D);if(ye)return ye}const U=S(ae),de=new(z())({allowUnionTypes:!0,allErrors:!0,validateSchema:!0});U.length&&de.addSchema(U,void 0,void 0,!0);const pe=de.compile(ae);return Oe||T.set(D,pe),pe}function S(ae){if(typeof ae!="object")return[];const k=new Set;ae.$id&&k.add(ae.$id);const ce=new Array,Oe=[ae];for(;Oe.length;){const D=Oe.pop();for(const U of q(D))if(!k.has(U)){k.add(U);const de=L.find(pe=>pe.$id===U);de&&(ce.push(de),Oe.push(de))}}return ce}function*q(ae){const k=[ae];for(;k.length;){const ce=k.pop();if(typeof ce=="object"&&ce)for(const[Oe,D]of Object.entries(ce))Oe==="$ref"&&typeof D=="string"?yield D.split("#")[0]:k.push(D)}}function Te(ae){const k=compileAjvSchema(ae||entityEnvelopeSchema);return ce=>{if(k(ce)===!0)return ce;throw throwAjvError(k.errors)}}function Qe(ae){const k=A(ae);return ce=>{var Oe;if(k(ce)===!0)return ce;const U=(Oe=k.errors)===null||Oe===void 0?void 0:Oe.filter(de=>["/kind","/apiVersion"].includes(de.instancePath));if((U==null?void 0:U.length)&&U.every(de=>de.keyword==="enum"))return!1;throw Z(k.errors)}}function Ye(ae){const k=compileAjvSchema(ae||entitySchema);return ce=>{if(k(ce)===!0)return ce;throw throwAjvError(k.errors)}}class Xe{static isValidApiVersion(k){return Q.isValidPrefixAndOrSuffix(k,"/",Q.isValidDnsSubdomain,ce=>ce.length>=1&&ce.length<=63&&/^[a-z0-9A-Z]+$/.test(ce))}static isValidKind(k){return typeof k=="string"&&k.length>=1&&k.length<=63&&/^[a-zA-Z][a-z0-9A-Z]*$/.test(k)}static isValidObjectName(k){return typeof k=="string"&&k.length>=1&&k.length<=63&&/^([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9]$/.test(k)}static isValidNamespace(k){return Q.isValidDnsLabel(k)}static isValidLabelKey(k){return Q.isValidPrefixAndOrSuffix(k,"/",Q.isValidDnsSubdomain,Xe.isValidObjectName)}static isValidLabelValue(k){return k===""||Xe.isValidObjectName(k)}static isValidAnnotationKey(k){return Q.isValidPrefixAndOrSuffix(k,"/",Q.isValidDnsSubdomain,Xe.isValidObjectName)}static isValidAnnotationValue(k){return typeof k=="string"}}const Ve={isValidApiVersion:Xe.isValidApiVersion,isValidKind:Xe.isValidKind,isValidEntityName:Xe.isValidObjectName,isValidNamespace:Xe.isValidNamespace,isValidLabelKey:Xe.isValidLabelKey,isValidLabelValue:Xe.isValidLabelValue,isValidAnnotationKey:Xe.isValidAnnotationKey,isValidAnnotationValue:Xe.isValidAnnotationValue,isValidTag:ae=>typeof ae=="string"&&ae.length>=1&&ae.length<=63&&/^[a-z0-9:+#]+(\-[a-z0-9:+#]+)*$/.test(ae)};function ft(ae={}){return{...Ve,...ae}}class je{async enforce(k){function ce(w,H,ve){if(H==null)throw new Error(`${w} must have a value`);let ue;try{ue=ve(H)}catch(we){throw new Error(`${w} could not be validated, ${we}`)}if(!ue){let we;switch(ve.name){case"isValidLabelValue":case"isValidObjectName":we="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":we="a valid prefix and/or suffix";break;case"isValidNamespace":case"isValidDnsLabel":we="a string that is sequences of [a-z0-9] separated by [-], at most 63 characters in total";break;case"isValidTag":we="a string that is sequences of [a-z0-9+#] separated by [-], at most 63 characters in total";break;case"isValidAnnotationValue":we="a string";break;case"isValidKind":we="a string that is a sequence of [a-zA-Z][a-z0-9A-Z], at most 63 characters in total";break;case"isValidUrl":we="a string that is a valid url";break;case"isValidString":case"isNonEmptyString":we="a non empty string";break;default:we=void 0;break}const ke=we?` expected ${we} but found "${H}".`:"";throw new Error(`"${w}" is not valid;${ke} 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 Oe(w,H,ve){return H===void 0||ce(w,H,ve)}ce("apiVersion",k.apiVersion,this.validators.isValidApiVersion),ce("kind",k.kind,this.validators.isValidKind),ce("metadata.name",k.metadata.name,this.validators.isValidEntityName),Oe("metadata.namespace",k.metadata.namespace,this.validators.isValidNamespace);var D;for(const[w,H]of Object.entries((D=k.metadata.labels)!==null&&D!==void 0?D:[]))ce(`labels.${w}`,w,this.validators.isValidLabelKey),ce(`labels.${w}`,H,this.validators.isValidLabelValue);var U;for(const[w,H]of Object.entries((U=k.metadata.annotations)!==null&&U!==void 0?U:[]))ce(`annotations.${w}`,w,this.validators.isValidAnnotationKey),ce(`annotations.${w}`,H,this.validators.isValidAnnotationValue);var de;const pe=(de=k.metadata.tags)!==null&&de!==void 0?de:[];for(let w=0;w<pe.length;++w)ce(`tags.${w}`,pe[w],this.validators.isValidTag);var ye;const Pe=(ye=k.metadata.links)!==null&&ye!==void 0?ye:[];for(let w=0;w<Pe.length;++w){var Re,Ue,nt;ce(`links.${w}.url`,(Re=Pe[w])===null||Re===void 0?void 0:Re.url,CommonValidatorFunctions.isValidUrl),Oe(`links.${w}.title`,(Ue=Pe[w])===null||Ue===void 0?void 0:Ue.title,CommonValidatorFunctions.isNonEmptyString),Oe(`links.${w}.icon`,(nt=Pe[w])===null||nt===void 0?void 0:nt.icon,KubernetesValidatorFunctions.isValidObjectName)}return k}constructor(k=makeValidator()){this.validators=k}}class Ge{async enforce(k){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(k)===!0)return k;const[Oe]=this.validate.errors||[];throw Oe?new Error(`Malformed envelope, ${Oe.instancePath||"<root>"} ${Oe.message}`):new Error("Malformed envelope, Unknown error")}}function st(ae){let k=ae.indexOf(":");const ce=ae.indexOf("/");ce!==-1&&ce<k&&(k=-1);const Oe=k===-1?void 0:ae.slice(0,k),D=ce===-1?void 0:ae.slice(k+1,ce),U=ae.slice(Math.max(k+1,ce+1));if(Oe===""||D===""||U==="")throw new TypeError(`Entity reference "${ae}" was not on the form [<kind>:][<namespace>/]<name>`);return{kind:Oe,namespace:D,name:U}}function gt(ae){return{kind:ae.kind,namespace:ae.metadata.namespace||h,name:ae.metadata.name}}function rt(ae,k){if(!ae)throw new Error("Entity reference must not be empty");const ce=k==null?void 0:k.defaultKind,Oe=(k==null?void 0:k.defaultNamespace)||h;let D,U,de;if(typeof ae=="string"){const Ue=st(ae);var pe;D=(pe=Ue.kind)!==null&&pe!==void 0?pe:ce;var ye;U=(ye=Ue.namespace)!==null&&ye!==void 0?ye:Oe,de=Ue.name}else{var Pe;D=(Pe=ae.kind)!==null&&Pe!==void 0?Pe:ce;var Re;U=(Re=ae.namespace)!==null&&Re!==void 0?Re:Oe,de=ae.name}if(D)if(U){if(!de){const Ue=JSON.stringify(ae);throw new Error(`Entity reference ${Ue} had missing or empty name`)}}else{const Ue=JSON.stringify(ae);throw new Error(`Entity reference ${Ue} had missing or empty namespace`)}else{const Ue=JSON.stringify(ae);throw new Error(`Entity reference ${Ue} had missing or empty kind (e.g. did not start with "component:" or similar)`)}return{kind:D,namespace:U,name:de}}function ot(ae){let k,ce,Oe;if("metadata"in ae){k=ae.kind;var D;ce=(D=ae.metadata.namespace)!==null&&D!==void 0?D:h,Oe=ae.metadata.name}else{k=ae.kind;var U;ce=(U=ae.namespace)!==null&&U!==void 0?U:h,Oe=ae.name}return`${k.toLocaleLowerCase("en-US")}:${ce.toLocaleLowerCase("en-US")}/${Oe.toLocaleLowerCase("en-US")}`}class ct{async enforce(k){let ce=k;for(const Oe of this.policies){const D=await Oe.enforce(ce);if(!D)throw new Error(`Policy ${Oe.constructor.name} did not return a result`);ce=D}return ce}constructor(k){this.policies=k}}class yt{async enforce(k){for(const ce of this.policies){const Oe=await ce.enforce(k);if(Oe)return Oe}throw new Error("The entity did not match any known policy")}constructor(k){this.policies=k}}const Lt={allOf(ae){return new ct(ae)},oneOf(ae){return new yt(ae)}};var We=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 se(ae){let k;return{async check(ce){return k||(k=Qe(ae)),k(ce)===ce}}}const Ie=se(We);var Le=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=se(Le);var mt=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=se(mt);var dt=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 Et=se(dt);var At=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=se(At),qt="ownedBy",Vt="ownerOf",Ht="consumesApi",Jt="apiConsumedBy",dn="providesApi",an="apiProvidedBy",Fn="dependsOn",En="dependencyOf",Un="parentOf",mn="childOf",un="memberOf",Qt="hasMember",Mn="partOf",zn="hasPart";var hn=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 vn=se(hn);var yn=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 Ln=se(yn);var Pn=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 xn=se(Pn),ge="backstage.io/managed-by-location",ee="backstage.io/managed-by-origin-location",Ee="backstage.io/source-location";function Ne(ae){if(typeof ae!="string")throw new TypeError(`Unable to parse location ref '${ae}', unexpected argument ${typeof ae}`);const k=ae.indexOf(":");if(k<0)throw new TypeError(`Unable to parse location ref '${ae}', expected '<type>:<target>', e.g. 'url:https://host/path'`);const ce=ae.substring(0,k).trim(),Oe=ae.substring(k+1).trim();if(!ce||!Oe)throw new TypeError(`Unable to parse location ref '${ae}', expected '<type>:<target>', e.g. 'url:https://host/path'`);if(ce==="http"||ce==="https")throw new TypeError(`Invalid location ref '${ae}', please prefix it with 'url:', e.g. 'url:${ae}'`);return{type:ce,target:Oe}}function _e(ae){const{type:k,target:ce}=ae;if(k){if(!ce)throw new TypeError("Unable to stringify location ref, empty target")}else throw new TypeError("Unable to stringify location ref, empty type");return`${k}:${ce}`}function wt(ae){var k,ce,Oe,D,U;const de=(U=(k=ae.metadata)===null||k===void 0||(ce=k.annotations)===null||ce===void 0?void 0:ce[Ee])!==null&&U!==void 0?U:(Oe=ae.metadata)===null||Oe===void 0||(D=Oe.annotations)===null||D===void 0?void 0:D[ge];if(!de)throw new Error(`Entity '${ot(ae)}' is missing location`);return Ne(de)}},93414:function(Rt,Me,t){"use strict";t.d(Me,{zx:function(){return ft},Oi:function(){return se},VY:function(){return $i},yW:function(){return Xa},XF:function(){return tt},mn:function(){return wt},NX:function(){return h},ub:function(){return Ue},mf:function(){return nl},yu:function(){return ln},h4:function(){return Gi},M6:function(){return _n},i9:function(){return pl},aR:function(){return Zi},rJ:function(){return Rr},Oh:function(){return xl},hu:function(){return ml},rU:function(){return Xe},nU:function(){return Fr},sk:function(){return it},Or:function(){return or},T3:function(){return Ki},g9:function(){return wl},Ex:function(){return xs},Gk:function(){return C},tn:function(){return Di},Ph:function(){return Tn},YE:function(){return Xo},v7:function(){return da},R6:function(){return ds},tR:function(){return nr},uw:function(){return Ca},qt:function(){return eo},iA:function(){return Hi},GB:function(){return Sn},po:function(){return ur},mZ:function(){return Bs},Pf:function(){return Wr}});var h={};t.r(h),t.d(h,{Nm:function(){return mt},ht:function(){return Et},LJ:function(){return dt}});var r=t(52322),W=t(25248),B=t(19928),g=t(2784);function b(e){const[s,i]=useState([]),u=useApi(alertApiRef),{anchorOrigin:p={vertical:"top",horizontal:"center"},transientTimeoutMs:m}=e,E=m!=null?m:5e3;useEffect(()=>{const F=u.alert$().subscribe(he=>i(re=>re.concat(he)));return()=>{F.unsubscribe()}},[u]);const[O]=s;if(useEffect(()=>{if(O&&O.display==="transient"){const F=setTimeout(()=>{i(he=>{const re=he.filter(xe=>xe!==O);return re.length===he.length?he:re})},E);return()=>clearTimeout(F)}},[O,E]),s.length===0)return null;const G=()=>{i(F=>F.filter(he=>he!==O))};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:O.severity,children:_jsxs(Typography,{component:"span",children:[String(O.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 Q(e){const{displayName:s,picture:i,customStyles:u}=e,p=te();let m={...u};const E={fontFamily:m.fontFamily,fontSize:m.fontSize,fontWeight:m.fontWeight};return i||(m={backgroundColor:stringToColor(s||""),...u}),_jsx(MaterialAvatar,{alt:s,src:i,className:p.avatar,style:m,children:s&&_jsx(Typography,{variant:"h6",component:"span",className:p.avatarText,style:E,children:extractInitials(s)})})}var X=t(77277),M=t(86689),z=t(90436),_=t(72779),fe=t.n(_),ie=t(76635),T=t(79635),L=t(39857);function Z(){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"}),S=e=>/^([a-z+.-]+):/.test(e),q=()=>{try{return(0,W.h_)(W.Ds).getOptionalString("app.baseUrl")}catch{return}},Te=()=>{const e="http://sample.dev";var s;const i=(s=q())!==null&&s!==void 0?s:"/",{pathname:u}=new URL(i,e);return(0,ie.trimEnd)(u,"/")},Qe=e=>{let s=String(e);const i=Te(),u=S(s),p=s.startsWith(i);return!u&&!p&&(s=i.concat(s)),s},Ye=e=>{if(e instanceof Array)return e.map(Ye).join(" ").trim();if(typeof e=="object"&&e){var s;return Ye(e==null||(s=e.props)===null||s===void 0?void 0:s.children)}return["string","number"].includes(typeof e)?String(e):""},Xe=g.forwardRef(({onClick:e,noTrack:s,...i},u)=>{const p=A(),m=(0,W.z$)(),E=Z()?Qe(i.to):i.to,O=Ye(i.children)||E,G=S(E),F=G&&!!/^https?:/.exec(E),he=re=>{e==null||e(re),s||m.captureEvent("click",O,{attributes:{to:E}})};return G?(0,r.jsxs)(M.Z,{...F?{target:"_blank",rel:"noopener"}:{},...i,ref:u,href:E,onClick:he,className:fe()(p.externalLink,i.className),children:[i.children,(0,r.jsx)(z.Z,{component:"span",className:p.visuallyHidden,children:", Opens in a new window"})]}):(0,r.jsx)(M.Z,{...i,ref:u,component:L.rU,to:E,onClick:he})}),Ve=g.forwardRef((e,s)=>(0,r.jsx)(Xe,{ref:s,...e,color:"initial"})),ft=g.forwardRef((e,s)=>(0,r.jsx)(X.Z,{ref:s,component:Ve,...e}));var je=t(95544),Ge=t(60364),st=t(83229),gt=t(26639),rt=t(39595),ot=t(61837),ct=t(80030),yt=t(19353),Lt=t(95074);function We(e){const{text:s,tooltipDelay:i=1e3,tooltipText:u="Text copied to clipboard","aria-label":p="Copy text"}=e,m=(0,W.h_)(W.VE),[E,O]=(0,g.useState)(!1),[{error:G},F]=(0,Lt.Z)();(0,g.useEffect)(()=>{G&&m.post(G)},[G,m]);const he=re=>{re.stopPropagation(),O(!0),F(s)};return(0,r.jsx)(r.Fragment,{children:(0,r.jsx)(ct.ZP,{id:"copy-test-tooltip",title:u,placement:"top",leaveDelay:i,onClose:()=>O(!1),open:E,children:(0,r.jsx)(ot.Z,{onClick:he,"aria-label":p,children:(0,r.jsx)(yt.Z,{})})})})}function se(e){const{text:s,language:i,showLineNumbers:u=!1,highlightedNumbers:p,customStyle:m,showCopyCodeButton:E=!1}=e,O=(0,Ge.Z)(),G=O.palette.type==="dark"?gt.Z:rt.Z,F=O.palette.type==="dark"?"#256bf3":"#e6ffed";return(0,r.jsxs)(je.Z,{position:"relative",children:[(0,r.jsx)(st.Z,{customStyle:m,language:i,style:G,showLineNumbers:u,wrapLines:!0,lineNumberStyle:{color:O.palette.textVerySubtle},lineProps:he=>p!=null&&p.includes(he)?{style:{backgroundColor:F}}:{},children:s}),E&&(0,r.jsx)(je.Z,{position:"absolute",top:0,right:0,children:(0,r.jsx)(We,{text:s})})]})}var Ie=t(41156),Le=t(88188);function tt(e){const{title:s,to:i}=e,u=(0,Ie.Z)(p=>p.breakpoints.down("xs"));return i?u?(0,r.jsx)(ot.Z,{component:L.rU,color:"primary",title:s,size:"small",to:i,children:(0,r.jsx)(Le.Z,{})}):(0,r.jsx)(X.Z,{component:L.rU,variant:"contained",color:"primary",to:i,children:s}):null}var mt;(function(e){e.TOP_BOTTOM="TB",e.BOTTOM_TOP="BT",e.LEFT_RIGHT="LR",e.RIGHT_LEFT="RL"})(mt||(mt={}));var Zt;(function(e){e.UP_LEFT="UL",e.UP_RIGHT="UR",e.DOWN_LEFT="DL",e.DOWN_RIGHT="DR"})(Zt||(Zt={}));var dt;(function(e){e.NETWORK_SIMPLEX="network-simplex",e.TIGHT_TREE="tight-tree",e.LONGEST_PATH="longest-path"})(dt||(dt={}));var Et;(function(e){e.LEFT="l",e.RIGHT="r",e.CENTER="c"})(Et||(Et={}));var At=t(27397),Ot=t(11105),qt=t(97963),Vt=t(46506),Ht=t.n(Vt),Jt=t(54073),dn=t.n(Jt),an=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 En({node:{id:e}}){const s=Fn(),[i,u]=g.useState(0),[p,m]=g.useState(0),E=g.useRef(null);g.useLayoutEffect(()=>{if(E.current){let{height:he,width:re}=E.current.getBBox();he=Math.round(he),re=Math.round(re),(he!==p||re!==i)&&(u(re),m(he))}},[i,p]);const O=10,G=i+O*2,F=p+O*2;return(0,r.jsxs)("g",{children:[(0,r.jsx)("rect",{className:s.node,width:G,height:F,rx:10}),(0,r.jsx)("text",{ref:E,className:s.text,y:F/2,x:G/2,textAnchor:"middle",alignmentBaseline:"middle",children:e})]})}const Un="arrow-marker",mn="node",un="edge",Qt="label",Mn=(0,an.Z)(e=>({node:{transition:`${e.transitions.duration.shortest}ms`}}),{name:"BackstageDependencyGraphNode"}),zn=e=>(0,r.jsx)(En,{...e});function hn({render:e=zn,setNode:s,node:i}){const{width:u,height:p,x:m=0,y:E=0}=i,O=i,G=Mn(),F=g.useRef(null);return g.useLayoutEffect(()=>{if(F.current){let{height:he,width:re}=F.current.getBBox();he=Math.round(he),re=Math.round(re),(he!==p||re!==u)&&s(i.id,{...i,height:he,width:re})}},[i,u,p,s]),(0,r.jsx)("g",{ref:F,"data-testid":mn,className:G.node,transform:`translate(${m-u/2},${E-p/2})`,children:e({node:O})})}var vn=t(76985),yn=t(39829),Ln=t(19574),Pn=t.n(Ln);const xn=(0,an.Z)(e=>({text:{fill:e.palette.textContrast}}),{name:"BackstageDependencyGraphDefaultLabel"});function ge({edge:{label:e}}){const s=xn();return(0,r.jsx)("text",{className:s.text,textAnchor:"middle",children:e})}const ee=(0,an.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"}),Ee=e=>(0,r.jsx)(ge,{...e});function Ne({render:e=Ee,setEdge:s,id:i,edge:u,curve:p}){const{x:m=0,y:E=0,width:O,height:G,points:F}=u,he=u,re=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!==O)&&s(i,{...u,height:qe,width:Pt})}},[u,G,O,s,i]);let Ce="";const He=g.useMemo(()=>vn.Z().x(qe=>qe.x).y(qe=>qe.y).curve(yn[p]),[p]);if(F){const qe=F.filter(Pt=>Pn()(Pt.x)&&Pn()(Pt.y));Ce=He(qe)||""}return(0,r.jsxs)(r.Fragment,{children:[Ce&&(0,r.jsx)("path",{"data-testid":un,className:re.path,d:Ce}),he.label?(0,r.jsx)("g",{ref:xe,"data-testid":Qt,className:re.label,transform:`translate(${m},${E})`,children:e({edge:he})}):null]})}const _e="workspace";function wt(e){var s,i;const{edges:u,nodes:p,renderNode:m,direction:E=mt.TOP_BOTTOM,align:O,nodeMargin:G=50,edgeMargin:F=10,rankMargin:he=50,paddingX:re=0,paddingY:xe=0,acyclicer:Ce,ranker:He=dt.NETWORK_SIMPLEX,labelPosition:qe=Et.RIGHT,labelOffset:Pt=10,edgeRanks:Gt=1,edgeWeight:tn=1,renderLabel:nn,defs:kt,zoom:Xt="enabled",curve:Kt="curveMonotoneX",fit:br="grow",...Sr}=e,wr=(0,qt.Z)(),[Cr,ai]=g.useState(100),[$r,li]=g.useState(100),Yt=g.useRef(new(Ht()).graphlib.Graph),[us,yo]=g.useState(((s=Yt.current.graph())===null||s===void 0?void 0:s.width)||0),[Zr,ci]=g.useState(((i=Yt.current.graph())===null||i===void 0?void 0:i.height)||0),[Dn,hr]=g.useState([]),[Hr,Gr]=g.useState([]),sn=Math.max(us,Cr),gn=Math.max(Zr,$r),hs=Math.min(Zr,$r),Kr=br==="grow"?gn:hs,Ds=g.useMemo(()=>dn()(cn=>{if(!cn)return;const Nn=Ot.Z(cn),on=Ot.Z(cn.getElementById(_e));function lr(){Nn.call(At.sP().scaleExtent([1,10]).on("zoom",jr=>{jr.transform.x=Math.min(0,Math.max(jr.transform.x,sn-sn*jr.transform.k)),jr.transform.y=Math.min(0,Math.max(jr.transform.y,gn-gn*jr.transform.k)),on.attr("transform",jr.transform)}))}Xt==="enabled"?lr():Xt==="enable-on-click"&&Nn.on("click",()=>lr());const{width:cr,height:xo}=cn.getBoundingClientRect();Cr!==cr&&ai(cr),$r!==xo&&li(xo)},100),[$r,Cr,sn,gn,Xt]),ea=g.useCallback(()=>{const cn=Yt.current.nodes(),Nn=Yt.current.edges();cn.forEach(on=>{p.some(cr=>cr.id===on)||Yt.current.removeNode(on)}),Nn.forEach(on=>{u.some(cr=>cr.from===on.v&&cr.to===on.w)||Yt.current.removeEdge(on.v,on.w)}),p.forEach(on=>{const lr=Yt.current.nodes().find(cr=>on.id===cr);if(lr&&Yt.current.node(lr)){const{width:cr,height:xo,x:jr,y:Ml}=Yt.current.node(lr);Yt.current.setNode(lr,{...on,width:cr,height:xo,x:jr,y:Ml})}else Yt.current.setNode(on.id,{...on,width:0,height:0})}),u.forEach(on=>{Yt.current.setEdge(on.from,on.to,{...on,label:on.label,width:0,height:0,labelpos:qe,labeloffset:Pt,weight:tn,minlen:Gt})})},[u,p,qe,Pt,tn,Gt]),Ns=g.useMemo(()=>dn()(()=>{Ht().layout(Yt.current);const{height:cn,width:Nn}=Yt.current.graph(),on=Math.max(0,cn||0),lr=Math.max(0,Nn||0);yo(lr),ci(on),hr(Yt.current.nodes()),Gr(Yt.current.edges())},250,{leading:!0}),[]);g.useEffect(()=>(Yt.current.setGraph({rankdir:E,align:O,nodesep:G,edgesep:F,ranksep:he,marginx:re,marginy:xe,acyclicer:Ce,ranker:He}),ea(),Ns(),Ns.cancel),[Ce,O,E,F,re,xe,G,he,He,ea,Ns]);function Fl(cn,Nn){return Yt.current.setNode(cn,Nn),Ns(),Yt.current}function Ul(cn,Nn){return Yt.current.setEdge(cn,Nn),Ns(),Yt.current}return(0,r.jsxs)("svg",{ref:Ds,...Sr,width:"100%",height:Kr,viewBox:`0 0 ${sn} ${gn}`,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:wr.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:_e,children:(0,r.jsxs)("svg",{width:us,height:Zr,y:gn/2-Zr/2,x:sn/2-us/2,viewBox:`0 0 ${us} ${Zr}`,children:[Hr.map(cn=>{const Nn=Yt.current.edge(cn);return Nn?(0,r.jsx)(Ne,{id:cn,setEdge:Ul,render:nn,edge:Nn,curve:Kt},`${cn.v}-${cn.w}`):null}),Dn.map(cn=>{const Nn=Yt.current.node(cn);return Nn?(0,r.jsx)(hn,{setNode:Fl,render:m,node:Nn},cn):null})]})})]})}var ae;const k=(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"}),ce=e=>{const{variant:s,message:i,id:u,fixed:p=!1}=e,m=k(),O=useApi(storageApiRef).forBucket("notifications");var G;const F=(G=O.snapshot("dismissedBanners").value)!==null&&G!==void 0?G:[],[he,re]=useState(new Set(F)),xe=useObservable(O.observe$("dismissedBanners"));useEffect(()=>{if(xe!=null&&xe.value){var He;const qe=(He=xe==null?void 0:xe.value)!==null&&He!==void 0?He:[];re(new Set(qe))}},[xe==null?void 0:xe.value]);const Ce=()=>{O.set("dismissedBanners",[...he,u])};return _jsx(Snackbar,{anchorOrigin:p?{vertical:"bottom",horizontal:"center"}:{vertical:"top",horizontal:"center"},open:!he.has(u),classes:{root:classNames(m.root,!p&&m.topPosition)},children:_jsx(SnackbarContent,{classes:{root:classNames(m.content,m[s]),message:m.message},message:i,action:[_jsx(IconButton,{title:"Permanently dismiss this message",color:"inherit",onClick:Ce,children:_jsx(Close,{className:m.icon})},"dismiss")]})})};var Oe=t(60905),D=t.p+"static/missingAnnotation.67f79e98..svg",U=t.p+"static/noInformation.4b426325..svg",de=t.p+"static/createComponent.975d1e1e..svg",pe=t.p+"static/noBuild.1715fa71..svg";const ye=(0,c.Z)({generalImg:{width:"95%",zIndex:2,position:"relative",left:"50%",top:"50%",transform:"translate(-50%, 15%)"}},{name:"BackstageEmptyStateImage"}),Pe=({missing:e})=>{const s=ye();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:U,alt:"no Information",className:s.generalImg});case"content":return(0,r.jsx)("img",{src:de,alt:"create Component",className:s.generalImg});case"data":return(0,r.jsx)("img",{src:pe,alt:"no Build",className:s.generalImg});default:return null}},Re=(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 Ue(e){const{title:s,description:i,missing:u,action:p}=e,m=Re();return(0,r.jsxs)(Oe.Z,{container:!0,direction:"row",justifyContent:"space-around",alignItems:"flex-start",className:m.root,spacing:2,children:[(0,r.jsx)(Oe.Z,{item:!0,xs:12,md:6,children:(0,r.jsxs)(Oe.Z,{container:!0,direction:"column",children:[(0,r.jsx)(Oe.Z,{item:!0,xs:!0,children:(0,r.jsx)(z.Z,{variant:"h5",children:s})}),(0,r.jsx)(Oe.Z,{item:!0,xs:!0,children:(0,r.jsx)(z.Z,{variant:"body1",children:i})}),(0,r.jsx)(Oe.Z,{item:!0,xs:!0,className:m.action,children:p})]})}),(0,r.jsx)(Oe.Z,{item:!0,xs:12,md:6,className:m.imageContainer,children:typeof u=="string"?(0,r.jsx)(Pe,{missing:u}):u.customImage})]})}const nt=`apiVersion: backstage.io/v1alpha1
|
|
2
2
|
kind: Component
|
|
3
3
|
metadata:
|
|
4
4
|
name: example
|
|
@@ -29,9 +29,9 @@ 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
|
-
`},Yr=100,fr=10,Tr=(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:Yr,height:`calc(100% + ${fr}px)`,transition:"opacity 300ms",pointerEvents:"none"},fadeLeft:{left:-fr,background:`linear-gradient(90deg, ${Ar(e.palette.type)})`},fadeRight:{right:-fr,background:`linear-gradient(270deg, ${Ar(e.palette.type)})`},fadeHidden:{opacity:0},button:{position:"absolute"},buttonLeft:{left:-e.spacing(2)},buttonRight:{right:-e.spacing(2)}}),{name:"BackstageHorizontalScrollGrid"});function ps(e){const[[s,i],u]=React.useState([0,0]);return React.useLayoutEffect(()=>{const p=e.current;if(!p){u([0,0]);return}const m=()=>{const E=p.scrollLeft,O=p.scrollWidth-p.offsetWidth-p.scrollLeft;u([E,O])};return m(),p.addEventListener("scroll",m),window.addEventListener("resize",m),()=>{p.removeEventListener("scroll",m),window.removeEventListener("resize",m)}},[e]),[s,i]}function Dr(e,s,i){const[u,p]=React.useState(0);return React.useLayoutEffect(()=>{if(u===0)return;const m=window.performance.now(),E=requestAnimationFrame(O=>{if(!e.current)return;const G=O-m,F=Math.abs(u)*G/s,re=Math.max(i,F)*Math.sign(u);e.current.scrollBy({left:re});const xe=u-re;Math.sign(u)!==Math.sign(xe)?p(0):p(xe)});return()=>cancelAnimationFrame(E)},[e,u,s,i]),p}function er(e){const{scrollStep:s=100,scrollSpeed:i=50,minScrollDistance:u=5,children:p,...m}=e,E=Tr(e),O=React.useRef(),[G,F]=ps(O),he=Dr(O,i,u),re=xe=>{!O.current||he(xe?s:-s)};return _jsxs(Box,{...m,className:E.root,children:[_jsx(Grid,{container:!0,direction:"row",wrap:"nowrap",className:E.container,ref:O,children:p}),_jsx(Box,{className:classNames(E.fade,E.fadeLeft,{[E.fadeHidden]:G===0})}),_jsx(Box,{className:classNames(E.fade,E.fadeRight,{[E.fadeHidden]:F===0})}),G>0&&_jsx(IconButton,{title:"Scroll Left",onClick:()=>re(!1),className:classNames(E.button,E.buttonLeft,{}),children:_jsx(ChevronLeftIcon,{})}),F>0&&_jsx(IconButton,{title:"Scroll Right",onClick:()=>re(!0),className:classNames(E.button,E.buttonRight,{}),children:_jsx(ChevronRightIcon,{})})]})}const Ir=(0,c.Z)({alpha:{color:"#ffffff",fontFamily:"serif",fontWeight:"normal",fontStyle:"italic"},beta:{color:"#4d65cc",fontFamily:"serif",fontWeight:"normal",fontStyle:"italic"}},{name:"BackstageLifecycle"});function Nr(e){const s=Ir(e),{shorthand:i,alpha:u}=e;return i?_jsx(Typography,{component:"span",className:s[u?"alpha":"beta"],style:{fontSize:"120%"},children:u?_jsx(_Fragment,{children:"\u03B1"}):_jsx(_Fragment,{children:"\u03B2"})}):_jsx(Typography,{component:"span",className:s[u?"alpha":"beta"],children:u?"Alpha":"Beta"})}const fs=(0,g.lazy)(()=>Promise.all([t.e(5869),t.e(6051)]).then(t.bind(t,76051)).then(e=>({default:e.RealLogViewer})));function Fr(e){const{Progress:s}=(0,W.qD)().getComponents();return(0,r.jsx)(g.Suspense,{fallback:(0,r.jsx)(s,{}),children:(0,r.jsx)(fs,{...e})})}const Jr=(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"}),Qr=(e,s)=>s?typeof s=="string"?e+s:g.Children.toArray(s.props.children).reduce(Qr,e):e,sr=({level:e,children:s})=>{const p=g.Children.toArray(s).reduce(Qr,"").toLocaleLowerCase("en-US").replace(/\W/g,"-");return g.createElement(`h${e}`,{id:p},s)},gr={code:({inline:e,className:s,children:i,...u})=>{const p=String(i).replace(/\n+$/,""),m=/language-(\w+)/.exec(s||"");return!e&&m?(0,r.jsx)(se,{language:m[1],text:p}):(0,r.jsx)("code",{className:s,...u,children:i})},h1:sr,h2:sr,h3:sr,h4:sr,h5:sr,h6:sr};function Fs(e){const{content:s,dialect:i="gfm",linkTarget:u,transformLinkUri:p,transformImageUri:m,className:E}=e,O=Jr();return _jsx(ReactMarkdown,{remarkPlugins:i==="gfm"?[gfm]:[],className:`${O.markdown} ${E}`,children:s,components:gr,linkTarget:u,transformLinkUri:p,transformImageUri:m})}var gs=t(23054);const Xr=(0,c.Z)(e=>({root:{paddingLeft:e.spacing(3)}}),{name:"BackstageLoginRequestListItem"}),Us=({request:e,busy:s,setBusy:i})=>{const u=Xr(),[p,m]=useState(),E=async()=>{i(!0);try{await e.trigger()}catch(G){m(isError(G)?G.message:"An unspecified error occurred")}finally{i(!1)}},O=e.provider.icon;return _jsxs(ListItem,{disabled:s,classes:{root:u.root},children:[_jsx(ListItemAvatar,{children:_jsx(O,{fontSize:"large"})}),_jsx(ListItemText,{primary:e.provider.title,secondary:p&&_jsx(Typography,{color:"error",children:p})}),_jsx(Button,{color:"primary",variant:"contained",onClick:E,children:"Log in"})]})};var ms=null;const qr=(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 Ms(e){const s=qr(),[i,u]=useState(!1),p=useApi(oauthRequestApiRef),m=useObservable(useMemo(()=>p.authRequest$(),[p]),[]),E=()=>{m.forEach(O=>O.reject())};return _jsxs(Dialog,{open:Boolean(m.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:m.map(O=>_jsx(LoginRequestListItem,{request:O,busy:i,setBusy:u},O.provider.title))})})]}),_jsx(DialogActions,{classes:{root:s.actionButtons},children:_jsx(Button,{onClick:E,children:"Reject All"})})]})}var dr=t(15277),vs=t.n(dr),ys=t(29862);const _r=(0,c.Z)({container:{overflow:"visible !important"}},{name:"BackstageOverflowTooltip"});function or(e){const[s,i]=(0,g.useState)(!1),u=(0,ys.t)(),p=_r(),m=O=>{u()&&i(O)};var E;return(0,r.jsx)(ct.ZP,{title:(E=e.title)!==null&&E!==void 0?E:e.text||"",placement:e.placement,disableHoverListener:!s,children:(0,r.jsx)(vs(),{text:e.text,line:e.line,onToggled:m,containerClassName:p.container})})}var mr=t(67358);function xs(e){const s=(0,Ge.Z)(),[i,u]=(0,g.useState)(!1);return(0,g.useEffect)(()=>{const p=setTimeout(()=>u(!0),s.transitions.duration.short);return()=>clearTimeout(p)},[s.transitions.duration.short]),i?(0,r.jsx)(mr.Z,{...e,"data-testid":"progress"}):(0,r.jsx)(je.Z,{display:"none"})}var es=t(94339),ts=t(14503),Ur=t(24579),ns=t(32552),An=t(15459),Wt=t(27597);const bs=(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 Ss(e){const{link:s,title:i,onClick:u}=e,p=bs();return(0,r.jsxs)(je.Z,{children:[(0,r.jsx)(On.Z,{}),(0,r.jsx)(Xe,{to:s,onClick:u,underline:"none",children:(0,r.jsxs)(je.Z,{display:"flex",alignItems:"center",className:p.root,children:[(0,r.jsx)(je.Z,{className:p.boxTitle,fontWeight:"fontWeightBold",m:1,children:(0,r.jsx)(z.Z,{children:(0,r.jsx)("strong",{children:i})})}),(0,r.jsx)(Wt.Z,{className:p.arrow})]})})]})}const ws=e=>{const{slackChannel:s}=e;if(s){if(typeof s=="string")return(0,r.jsxs)(z.Z,{children:["Please contact ",s," for help."]});if(!s.href)return(0,r.jsxs)(z.Z,{children:["Please contact ",s.name," for help."]})}else return null;return(0,r.jsx)(ft,{to:s.href,variant:"contained",children:s.name})},Cs=class extends g.Component{componentDidCatch(s,i){console.error(`ErrorBoundary, error: ${s}, info: ${i}`),this.setState({error:s,errorInfo:i})}render(){const{slackChannel:s,children:i}=this.props,{error:u}=this.state;return u?(0,r.jsx)(ln,{title:"Something Went Wrong",error:u,children:(0,r.jsx)(ws,{slackChannel:s})}):i}constructor(s){super(s),this.state={error:void 0,errorInfo:void 0}}},js=(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"}),Es=(0,An.Z)(e=>({root:{display:"inline-block",padding:e.spacing(8,8,0,0),float:"right"}}),{name:"BackstageInfoCardCardActionsTopRight"})(ts.Z),rs={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 Rr(e){const{title:s,subheader:i,divider:u=!0,deepLink:p,slackChannel:m,errorBoundaryProps:E,variant:O,children:G,headerStyle:F,headerProps:he,icon:re,action:xe,actionsClassName:Ce,actions:He,cardClassName:qe,actionsTopRight:Pt,className:Gt,noPadding:tn,titleTypographyProps:nn}=e,kt=js();let Xt={},Kt={};O&&O.split(/[\s]+/g).forEach(Cr=>{Xt={...Xt,...rs.card[Cr]},Kt={...Kt,...rs.cardContent[Cr]}});const br=()=>!i&&!re?null:(0,r.jsxs)("div",{className:kt.headerSubheader,"data-testid":"info-card-subheader",children:[i&&(0,r.jsx)("div",{className:kt.subheader,children:i}),re]}),Sr=E||(m?{slackChannel:m}:{});return(0,r.jsx)(es.Z,{style:Xt,className:Gt,children:(0,r.jsxs)(Cs,{...Sr,children:[s&&(0,r.jsx)(ns.Z,{classes:{root:kt.header,title:kt.headerTitle,subheader:kt.headerSubheader,avatar:kt.headerAvatar,action:kt.headerAction,content:kt.headerContent},title:s,subheader:br(),action:xe,style:{...F},titleTypographyProps:nn,...he}),Pt&&(0,r.jsx)(Es,{children:Pt}),u&&(0,r.jsx)(On.Z,{}),(0,r.jsx)(Ur.Z,{className:fe()(qe,{[kt.noPadding]:tn}),style:Kt,children:G}),He&&(0,r.jsx)(ts.Z,{className:Ce,children:He}),p&&(0,r.jsx)(Ss,{...p})]})})}var zs=t(39307);const As=(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"}),Ts={fractional:!0,inverse:!1,unit:"%",max:100},v=({palette:e,value:s,inverse:i,max:u})=>{if(isNaN(s))return"#ddd";const p=u||Ts.max,m=i?p-s:s;return m<p/3?e.status.error:m<p*(2/3)?e.status.warning:e.status.ok};function x(e){const[s,i]=useState(null),{getColor:u=v}=e,p=As(e),{palette:m}=useTheme(),{value:E,fractional:O,inverse:G,unit:F,max:he,description:re}={...Ts,...e},xe=O?Math.round(E*he):E,Ce=he!==100?Math.round(E):xe,[He,qe]=useState(!1);return useEffect(()=>{const Pt=s,Gt=()=>qe(!0),tn=()=>qe(!1);return Pt&&re?(Pt.addEventListener("mouseenter",Gt),Pt.addEventListener("mouseleave",tn),()=>{Pt.removeEventListener("mouseenter",Gt),Pt.removeEventListener("mouseleave",tn)}):()=>{qe(!1)}},[re,s]),_jsxs(Box,{ref:i,className:p.root,children:[_jsx(Circle,{strokeLinecap:"butt",percent:xe,strokeWidth:12,trailWidth:12,strokeColor:u({palette:m,value:Ce,inverse:G,max:he}),className:p.circle}),re&&He?_jsx(Box,{className:p.description,children:re}):_jsx(Box,{className:p.overlay,children:isNaN(E)?"N/A":`${Ce}${F}`})]})}const I=(0,c.Z)({root:{height:"100%",width:250}},{name:"BackstageGaugeCard"});function $(e){const s=I(e),{title:i,subheader:u,progress:p,inverse:m,deepLink:E,description:O,icon:G,variant:F,getColor:he}=e,re={inverse:m,description:O,getColor:he,value:p};return _jsx(Box,{className:s.root,children:_jsx(InfoCard,{title:i,subheader:u,deepLink:E,variant:F,icon:G,children:_jsx(Gauge,{...re})})})}function J(e){const{value:s,getColor:i=getProgressColor}=e,{palette:u}=useTheme();if(isNaN(s))return null;let p=Math.round(s*100*100)/100;p>100&&(p=100);const m=i({palette:u,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:m})})})}var K=t(21324),oe=t(7089),le=t(1292),Se=t(42494),Be=t(74603),$e=t(56939),Ae=t(12231),Je=t(73698),xt=t(72379);const It=(0,c.Z)(e=>(0,P.Z)({icon:{position:"absolute",right:e.spacing(.5),pointerEvents:"none"}}),{name:"BackstageClosedDropdown"});var $t=()=>{const e=It();return(0,r.jsx)(xt.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 Dt=(0,c.Z)(e=>(0,P.Z)({icon:{position:"absolute",right:e.spacing(.5),pointerEvents:"none"}}),{name:"BackstageOpenedDropdown"});var rn=()=>{const e=Dt();return(0,r.jsx)(xt.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 tr=(0,An.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"})(Be.Z),wn=(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 Tn(e){const{multiple:s,items:i,label:u,placeholder:p,selected:m,onChange:E,triggerReset:O,native:G=!1,disabled:F=!1,margin:he}=e,re=wn(),[xe,Ce]=(0,g.useState)(m||(s?[]:"")),[He,qe]=(0,g.useState)(!1);(0,g.useEffect)(()=>{Ce(s?[]:"")},[O,s]),(0,g.useEffect)(()=>{m!==void 0&&Ce(m)},[m]);const Pt=kt=>{Ce(kt.target.value),E(kt.target.value)},Gt=kt=>{if(F){kt.preventDefault();return}qe(Xt=>s&&!(kt.target instanceof HTMLElement)?!0:!Xt)},tn=()=>{qe(!1)},nn=kt=>()=>{const Xt=xe.filter(Kt=>Kt!==kt);Ce(Xt),E(Xt)};return(0,r.jsx)(je.Z,{className:re.root,children:(0,r.jsx)(le.Z,{onClickAway:tn,children:(0,r.jsxs)(Se.Z,{className:re.formControl,children:[(0,r.jsx)($e.Z,{className:re.formLabel,children:u}),(0,r.jsxs)(Je.Z,{"aria-label":u,value:xe,native:G,disabled:F,"data-testid":"select",displayEmpty:!0,multiple:s,margin:he,onChange:Pt,onClick:Gt,open:He,input:(0,r.jsx)(tr,{}),label:u,tabIndex:0,renderValue:kt=>{var Xt;return s&&xe.length!==0?(0,r.jsx)(je.Z,{className:re.chips,children:kt.map(Kt=>{var br,Sr;return(0,r.jsx)(oe.Z,{label:(br=i.find(wr=>wr.value===Kt))===null||br===void 0?void 0:br.label,clickable:!0,onDelete:nn(Kt),className:re.chip},(Sr=i.find(wr=>wr.value===Kt))===null||Sr===void 0?void 0:Sr.value)})}):(0,r.jsx)(z.Z,{children:xe.length===0?p||"":(Xt=i.find(Kt=>Kt.value===kt))===null||Xt===void 0?void 0:Xt.label})},IconComponent:()=>He?(0,r.jsx)(rn,{}):(0,r.jsx)($t,{}),MenuProps:{anchorOrigin:{vertical:"bottom",horizontal:"left"},transformOrigin:{vertical:"top",horizontal:"left"},getContentAnchorEl:null},children:[p&&!s&&(0,r.jsx)(Ae.Z,{value:[],children:p}),G?i&&i.map(kt=>(0,r.jsx)("option",{value:kt.value,children:kt.label},kt.value)):i&&i.map(kt=>(0,r.jsxs)(Ae.Z,{value:kt.value,children:[s&&(0,r.jsx)(K.Z,{color:"primary",checked:xe.includes(kt.value)||!1,className:re.checkbox}),kt.label]},kt.value))]})]})})})}const In=()=>{},Lr=g.createContext({stepperLength:0,stepIndex:0,setStepIndex:In,stepHistory:[],setStepHistory:In,onStepChange:In});function Pr(e){const{children:s,elevated:i,onStepChange:u,activeStep:p=0}=e,[m,E]=useState(p),[O,G]=useState([0]);useEffect(()=>{E(p)},[p]);const F=[];let he;return Children.forEach(s,re=>{isValidElement(re)&&(re.props.end?he=re:F.push(re))}),_jsxs(_Fragment,{children:[_jsx(Lr.Provider,{value:{stepIndex:m,setStepIndex:E,stepHistory:O,setStepHistory:G,onStepChange:u,stepperLength:Children.count(s)},children:_jsx(MuiStepper,{activeStep:m,orientation:"vertical",elevation:i?2:0,children:F})}),m>=Children.count(s)-1&&he]})}const kr=(0,c.Z)(e=>({root:{marginTop:e.spacing(3),"& button":{marginRight:e.spacing(1)}}}),{name:"BackstageSimpleStepperFooter"}),Rn=({text:e,handleClick:s})=>_jsx(Button,{onClick:s,children:e||"Reset"}),$n=({text:e,handleClick:s,disabled:i,last:u,stepIndex:p})=>_jsx(Button,{variant:"contained",color:"primary",disabled:i,"data-testid":`nextButton-${p}`,onClick:s,children:e||(u?"Finish":"Next")}),vr=({text:e,handleClick:s,disabled:i,stepIndex:u})=>_jsx(Button,{variant:"outlined",color:"primary",disabled:i,"data-testid":`skipButton-${u}`,onClick:s,children:e||"Skip"}),bo=({text:e,handleClick:s,disabled:i,stepIndex:u})=>_jsx(Button,{onClick:s,"data-testid":`backButton-${u}`,disabled:i,children:e||"Back"}),So=({actions:e={},children:s})=>{const i=kr(),{stepperLength:u,stepIndex:p,setStepIndex:m,stepHistory:E,setStepHistory:O,onStepChange:G}=useContext(VerticalStepperContext),F=(Ce,He)=>{He&&He(),G&&G(p,Ce),m(Ce)},he=()=>{const Ce=e.nextStep?e.nextStep(p,u-1):p+1;F(Ce,e.onNext),O([...E,Ce])},re=()=>{E.pop(),F(E[E.length-1],e.onBack),O([...E])},xe=()=>{F(0,e.onRestart),O([0])};return _jsxs(Box,{className:i.root,children:[[void 0,!0].includes(e.showBack)&&p!==0&&_jsx(bo,{text:e.backText,handleClick:re,disabled:p===0,stepIndex:p}),e.showSkip&&_jsx(vr,{text:e.skipText,handleClick:he,disabled:!!u&&p>=u||!!e.canSkip&&!e.canSkip(),stepIndex:p}),[void 0,!0].includes(e.showNext)&&_jsx($n,{text:e.nextText,handleClick:he,disabled:!!u&&p>=u||!!e.canNext&&!e.canNext(),stepIndex:p}),e.showRestart&&p!==0&&_jsx(Rn,{text:e.restartText,handleClick:xe,stepIndex:p}),s]})},Ws=(0,c.Z)(e=>({end:{padding:e.spacing(3)}}),{name:"SimpleStepperStep"});function di(e){const{title:s,children:i,end:u,actions:p,...m}=e,E=Ws();return u?_jsxs(Box,{className:E.end,children:[_jsx(Typography,{variant:"h6",children:s}),i,_jsx(SimpleStepperFooter,{actions:{...p||{},showNext:!1}})]}):_jsxs(MuiStep,{...m,children:[_jsx(StepLabel,{children:_jsx(Typography,{variant:"h6",children:s})}),_jsxs(StepContent,{children:[i,_jsx(SimpleStepperFooter,{actions:p})]})]})}const Or=(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 Vs(e){const s=Or(e);return _jsx(Typography,{component:"span",className:classNames(s.status,s.ok),"aria-label":"Status ok","aria-hidden":"true",...e})}function wo(e){const s=Or(e);return _jsx(Typography,{component:"span",className:classNames(s.status,s.warning),"aria-label":"Status warning","aria-hidden":"true",...e})}function ui(e){const s=Or(e);return _jsx(Typography,{component:"span",className:classNames(s.status,s.error),"aria-label":"Status error","aria-hidden":"true",...e})}function hi(e){const s=Or(e);return _jsx(Typography,{component:"span",className:classNames(s.status,s.pending),"aria-label":"Status pending","aria-hidden":"true",...e})}function ta(e){const s=Or(e);return _jsx(Typography,{component:"span",className:classNames(s.status,s.running),"aria-label":"Status running","aria-hidden":"true",...e})}function Br(e){const s=Or(e);return _jsx(Typography,{component:"span",className:classNames(s.status,s.aborted),"aria-label":"Status aborted","aria-hidden":"true",...e})}var pi=t(74600),Cn=t(15584);const fi=e=>(0,P.Z)({root:{fontWeight:e.typography.fontWeightBold,whiteSpace:"nowrap",paddingRight:e.spacing(4),border:"0",verticalAlign:"top"}}),gi={root:{border:"0",verticalAlign:"top"}},mi=e=>(0,P.Z)({root:{margin:e.spacing(0,0,-1,0)}}),Co=e=>(0,P.Z)({root:{padding:e.spacing(0,0,1,0)},random:{}}),vi=(0,An.Z)(fi,{name:"BackstageMetadataTableTitleCell"})(Cn.Z),yi=(0,An.Z)(gi,{name:"BackstageMetadataTableCell"})(Cn.Z),xi=({dense:e,children:s})=>_jsx(Table,{size:e?"small":"medium",children:_jsx(TableBody,{children:s})}),na=({title:e,children:s,...i})=>_jsxs(TableRow,{children:[e&&_jsx(vi,{children:e}),_jsx(yi,{colSpan:e?1:2,...i,children:s})]}),jo=(0,An.Z)(mi,{name:"BackstageMetadataTableList"})(({classes:e,children:s})=>(0,r.jsx)(Ct.Z,{disablePadding:!0,className:e.root,children:s})),Hs=(0,An.Z)(Co,{name:"BackstageMetadataTableListItem"})(({classes:e,children:s})=>(0,r.jsx)(Ke.Z,{className:e.root,children:s})),Gs=(0,P.Z)({root:{margin:"0 0",listStyleType:"none"}}),ss=e=>(0,P.Z)({root:{...Gs.root,paddingLeft:e.spacing(1)}}),Mr=(0,An.Z)(Gs,{name:"BackstageStructuredMetadataTableList"})(({classes:e,children:s})=>(0,r.jsx)(jo,{classes:e,children:s})),zr=(0,An.Z)(ss,{name:"BackstageStructuredMetadataTableNestedList"})(({classes:e,children:s})=>(0,r.jsx)(jo,{classes:e,children:s}));function Eo(e,s){const i=e.map((u,p)=>_jsx(MetadataListItem,{children:Is(u)},p));return s?_jsx(zr,{children:i}):_jsx(Mr,{children:i})}function Ks(e,s,i){const u=Object.keys(e).map(p=>{const m=Is(e[p],!0),E=i&&i.titleFormat?i.titleFormat(p):startCase(p);return _jsxs(MetadataListItem,{children:[_jsx(Typography,{variant:"body2",component:"span",children:`${E}: `}),m]},p)});return s?_jsx(zr,{children:u}):_jsx(Mr,{children:u})}function Is(e,s,i){return React.isValidElement(e)?_jsx(Fragment,{children:e}):typeof e=="object"&&!Array.isArray(e)?Ks(e,s,i):Array.isArray(e)?Eo(e,i):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:Is(e,s)}),To=({title:e,value:s,options:i})=>_jsx(MetadataTableItem,{title:i&&i.titleFormat?i.titleFormat(e):startCase(e),children:_jsx(Ao,{value:s,options:i})});function Io(e,s){return Object.keys(e).map(i=>_jsx(To,{title:i,value:e[i],options:s},i))}function bi(e){const{metadata:s,dense:i=!0,options:u}=e,p=Io(s,u||{});return _jsx(MetadataTable,{dense:i,children:p})}var yr=t(49429),Rs=t(86136),Ys=t(79784),Ro=t(19126),Ls=t.n(Ro);function Lo(e){return qs.stringify(e,{strictNullHandling:!0})}function Js(e){return qs.parse(e,{ignoreQueryPrefix:!0,strictNullHandling:!0})}function Qs(e,s){return Js(e)[s]}function Po(e,s,i){const u={...Js(e),[s]:i};return Lo(u)}function ra(e,s=250){const[i,u]=useSearchParams(),p=i.toString(),[m,E]=useState(Qs(p,e));return useEffect(()=>{const O=Qs(p,e);E(G=>isEqual(O,G)?G:O)},[p,E,e]),useDebouncedEffect(()=>{const O=Po(p,e,m);p!==O&&u(O,{replace:!0})},[u,m,p,e],s),[m,E]}const ko={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 Xs(){const s=(0,W.I_)().get(W.Ds),i=s==null?void 0:s.getOptionalConfig("app.support");if(!i)return ko;var u;return{url:i.getString("url"),items:i.getConfigArray("items").flatMap(p=>({title:p.getString("title"),icon:p.getOptionalString("icon"),links:((u=p.getOptionalConfigArray("links"))!==null&&u!==void 0?u:[]).flatMap(m=>({url:m.getString("url"),title:m.getString("title")}))}))}}var Oo=t(80079);function qn(e,s){const u=(0,W.qD)().getSystemIcon(e);return u?(0,r.jsx)(u,{...s}):(0,r.jsx)(Oo.Z,{...s})}function Bo(e){return qn("brokenImage",e)}function _s(e){return qn("catalog",e)}function Si(e){return qn("chat",e)}function wi(e){return qn("dashboard",e)}function Ci(e){return qn("docs",e)}function ji(e){return qn("email",e)}function sa(e){return qn("github",e)}function oa(e){return qn("group",e)}function xr(e){return qn("help",e)}function ia(e){return qn("user",e)}function aa(e){return qn("warning",e)}const $o=(0,c.Z)({popoverList:{minWidth:260,maxWidth:400}},{name:"BackstageSupportButton"}),Zo=({icon:e})=>{const s=(0,W.qD)();var i;const u=e&&(i=s.getSystemIcon(e))!==null&&i!==void 0?i:xr;return(0,r.jsx)(u,{})};var os;const Ei=({link:e})=>(0,r.jsx)(Xe,{to:e.url,children:(os=e.title)!==null&&os!==void 0?os:e.url}),Ai=({item:e})=>{var s;return(0,r.jsxs)(Ke.Z,{children:[(0,r.jsx)(Rs.Z,{children:(0,r.jsx)(Zo,{icon:e.icon})}),(0,r.jsx)(ht.Z,{primary:e.title,secondary:(s=e.links)===null||s===void 0?void 0:s.reduce((i,u,p)=>[...i,p>0&&(0,r.jsx)("br",{},p),(0,r.jsx)(Ei,{link:u},u.url)],[])})]})};function eo(e){const{title:s,items:i,children:u}=e,{items:p}=Xs(),[m,E]=(0,g.useState)(!1),[O,G]=(0,g.useState)(null),F=$o(),he=(0,Ie.Z)(Ce=>Ce.breakpoints.down("sm")),re=Ce=>{G(Ce.currentTarget),E(!0)},xe=()=>{E(!1)};return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(je.Z,{display:"flex",ml:1,children:he?(0,r.jsx)(ot.Z,{color:"primary",size:"small",onClick:re,"data-testid":"support-button",children:(0,r.jsx)(xr,{})}):(0,r.jsx)(X.Z,{"data-testid":"support-button","aria-label":"support",color:"primary",onClick:re,startIcon:(0,r.jsx)(xr,{}),children:"Support"})}),(0,r.jsxs)(Ys.ZP,{"data-testid":"support-button-popover",open:m,anchorEl:O,anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"},onClose:xe,children:[(0,r.jsxs)(Ct.Z,{className:F.popoverList,children:[s&&(0,r.jsx)(Ke.Z,{alignItems:"flex-start",children:(0,r.jsx)(z.Z,{variant:"subtitle1",children:s})}),g.Children.map(u,(Ce,He)=>(0,r.jsx)(Ke.Z,{alignItems:"flex-start",children:Ce},`child-${He}`)),(i!=null?i:p).map((Ce,He)=>(0,r.jsx)(Ai,{item:Ce},`item-${He}`))]}),(0,r.jsx)(yr.Z,{children:(0,r.jsx)(X.Z,{color:"primary",onClick:xe,children:"Close"})})]})]})}var is=t(18671),Ps=t(16060);const as=72,Do=24,No=18,ur={drawerWidthClosed:as,drawerWidthOpen:224,defaultOpenDelayMs:100,defaultCloseDelayMs:0,defaultFadeDuration:200,logoHeight:32,iconContainerWidth:as,iconSize:as-Do*2,iconPadding:Do,selectedIndicatorWidth:3,userBadgePadding:No,userBadgeDiameter:as-No*2,mobileSidebarHeight:56},Kn=e=>({...ur,...e,iconContainerWidth:ur.drawerWidthClosed,iconSize:ur.drawerWidthClosed-ur.iconPadding*2,userBadgeDiameter:ur.drawerWidthClosed-ur.userBadgePadding*2}),Fo={drawerWidthClosed:0,drawerWidthOpen:202,defaultOpenDelayMs:ur.defaultOpenDelayMs+200},Uo=e=>({...Fo,...e}),la="@backstage/core/sidebar-intro-dismissed",ir=(0,g.createContext)({sidebarConfig:ur,submenuConfig:Fo}),Mo=(0,g.createContext)({isHoveredOn:!1,setIsHoveredOn:()=>{}});var Ti=t(50023),Ii=t(4190),Ri=t(87685),Li=t(44882),ks=t(51837);const zo={isOpen:!1,setOpen:()=>{}},Wo=(0,g.createContext)(zo),Os=(0,ks.CT)("sidebar-open-state-context");function to(e){const{children:s,value:i}=e;return(0,r.jsx)(Wo.Provider,{value:i,children:(0,r.jsx)(Os.Provider,{value:(0,ks.EI)({1:i}),children:s})})}const Bs=()=>{const e=(0,g.useContext)(Os),s=(0,g.useContext)(Wo);if(e===void 0)return s||zo;const i=e.atVersion(1);if(i===void 0)throw new Error("No context found for version 1.");return i};var Vo=t(57998);const no={isPinned:!0,toggleSidebarPinState:()=>{},isMobile:!1},ro=(0,g.createContext)(no),so=(0,ks.CT)("sidebar-pin-state-context");function Ho(e){const{children:s,value:i}=e;return(0,r.jsx)(ro.Provider,{value:i,children:(0,r.jsx)(so.Provider,{value:(0,ks.EI)({1:i}),children:s})})}const Wr=()=>{const e=(0,g.useContext)(so),s=(0,g.useContext)(ro);if(e===void 0)return s||no;const i=e.atVersion(1);if(i===void 0)throw new Error("No context found for version 1.");return i},Go=(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"}})),Pi=e=>{const{to:s,label:i,icon:u,value:p}=e,{sidebarConfig:m}=(0,g.useContext)(ir),E=Go({sidebarConfig:m}),O=(0,T.TH)(),{selectedMenuItemIndex:G,setSelectedMenuItemIndex:F}=(0,g.useContext)(ao),he=(xe,Ce)=>{F(Ce===G?-1:Ce)},re=p===G&&G>=0||p!==G&&!(G>=0)&&s===O.pathname;return(0,r.jsx)(Vo.Z,{label:i,icon:u,component:Xe,to:s||O.pathname,onChange:he,value:p,selected:re,classes:E})},oo=e=>{const{children:s,to:i,label:u,icon:p,value:m}=e,{isMobile:E}=Wr();return E?(0,r.jsx)(Pi,{to:i,label:u,icon:p,value:m}):(0,r.jsx)(r.Fragment,{children:s})},io=(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`})})),ki=e=>(0,ie.orderBy)(e,({props:{priority:s}})=>Number.isInteger(s)?s:-1,"desc"),Ko=g.createElement(oo).type,Yo=({children:e,label:s="Menu",open:i,onClose:u})=>{const{sidebarConfig:p}=(0,g.useContext)(ir),m=io({sidebarConfig:p});return(0,r.jsxs)(Ii.ZP,{anchor:"bottom",open:i,onClose:u,ModalProps:{BackdropProps:{classes:{root:m.marginMobileSidebar}}},classes:{root:m.marginMobileSidebar,paperAnchorBottom:m.overlay},children:[(0,r.jsxs)(je.Z,{className:m.overlayHeader,children:[(0,r.jsx)(z.Z,{variant:"h3",children:s}),(0,r.jsx)(ot.Z,{onClick:u,classes:{root:m.overlayHeaderClose},children:(0,r.jsx)(Ri.Z,{})})]}),(0,r.jsx)(je.Z,{component:"nav",children:e})]})},ao=(0,g.createContext)({selectedMenuItemIndex:-1,setSelectedMenuItemIndex:()=>{}}),Jo=e=>{const{sidebarConfig:s}=(0,g.useContext)(ir),{children:i}=e,u=io({sidebarConfig:s}),p=(0,T.TH)(),[m,E]=(0,g.useState)(-1);(0,g.useEffect)(()=>{E(-1)},[p.pathname]);let O=(0,W.vJ)(i,F=>F.getElements().filter(he=>he.type===Ko));if(i)O.length?O=ki(O):O.push((0,r.jsx)(oo,{icon:(0,r.jsx)(Li.Z,{}),children:i},"default_menu"));else return null;const G=m>=0&&!O[m].props.to;return(0,r.jsx)(to,{value:{isOpen:!0,setOpen:()=>{}},children:(0,r.jsxs)(ao.Provider,{value:{selectedMenuItemIndex:m,setSelectedMenuItemIndex:E},children:[(0,r.jsx)(Yo,{label:O[m]&&O[m].props.label,open:G,onClose:()=>E(-1),children:O[m]&&O[m].props.children}),(0,r.jsx)(Ti.Z,{className:u.root,"data-testid":"mobile-sidebar-root",component:"nav",children:O})]})})};var ls;(function(e){e.SIDEBAR_PIN_STATE="sidebarPinState"})(ls||(ls={}));const lo={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))}},Qo=(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"}),co=(0,g.createContext)({content:{contentRef:void 0}});function nr(e){const[s,i]=(0,g.useState)(()=>lo.getSidebarPinState()),{sidebarConfig:u}=(0,g.useContext)(ir),p=(0,g.useRef)(null),m=(0,g.useMemo)(()=>({content:{contentRef:p}}),[p]);(0,g.useEffect)(()=>{lo.setSidebarPinState(s)},[s]);const E=(0,Ie.Z)(F=>F.breakpoints.down("xs"),{noSsr:!0}),O=()=>i(!s),G=Qo({isPinned:s,sidebarConfig:u});return(0,r.jsx)(Ho,{value:{isPinned:s,toggleSidebarPinState:O,isMobile:E},children:(0,r.jsx)(co.Provider,{value:m,children:(0,r.jsx)(je.Z,{className:G.root,children:e.children})})})}function uo(){const{content:e}=(0,g.useContext)(co);return{focusContent:(0,g.useCallback)(()=>{var i,u;e==null||(i=e.contentRef)===null||i===void 0||(u=i.current)===null||u===void 0||u.focus()},[e]),contentRef:e==null?void 0:e.contentRef}}const ho=(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 po=e=>{const{sidebarConfig:s}=(0,g.useContext)(ir),{openDelayMs:i=s.defaultOpenDelayMs,closeDelayMs:u=s.defaultCloseDelayMs,disableExpandOnHover:p,children:m}=e,E=ho({sidebarConfig:s}),O=(0,Ie.Z)(Gt=>Gt.breakpoints.down("md"),{noSsr:!0}),[G,F]=(0,g.useState)(Gn.Closed),he=(0,g.useRef)(),{isPinned:re,toggleSidebarPinState:xe}=Wr(),Ce=()=>{re||p||(he.current&&(clearTimeout(he.current),he.current=void 0),G!==Gn.Open&&!O&&(he.current=window.setTimeout(()=>{he.current=void 0,F(Gn.Open)},i),F(Gn.Idle)))},He=()=>{re||p||(he.current&&(clearTimeout(he.current),he.current=void 0),G===Gn.Idle?F(Gn.Closed):G===Gn.Open&&(he.current=window.setTimeout(()=>{he.current=void 0,F(Gn.Closed)},u)))},qe=G===Gn.Open&&!O||re,Pt=Gt=>{Gt?(F(Gn.Open),xe()):(F(Gn.Closed),xe())};return(0,r.jsxs)("nav",{style:{},"aria-label":"sidebar nav",children:[(0,r.jsx)(qo,{}),(0,r.jsx)(to,{value:{isOpen:qe,setOpen:Pt},children:(0,r.jsx)(je.Z,{className:E.root,"data-testid":"sidebar-root",onMouseEnter:p?()=>{}:Ce,onFocus:p?()=>{}:Ce,onMouseLeave:p?()=>{}:He,onBlur:p?()=>{}:He,children:(0,r.jsx)(je.Z,{className:fe()(E.drawer,{[E.drawerOpen]:qe}),children:m})})})]})},Xo=e=>{var s;const i=Kn((s=e.sidebarOptions)!==null&&s!==void 0?s:{});var u;const p=Uo((u=e.submenuOptions)!==null&&u!==void 0?u:{}),{children:m,disableExpandOnHover:E,openDelayMs:O,closeDelayMs:G}=e,{isMobile:F}=Wr();return F?(0,r.jsx)(Jo,{children:m}):(0,r.jsx)(ir.Provider,{value:{sidebarConfig:i,submenuConfig:p},children:(0,r.jsx)(po,{openDelayMs:O,closeDelayMs:G,disableExpandOnHover:E,children:m})})};function qo(){const{sidebarConfig:e}=(0,g.useContext)(ir),{focusContent:s,contentRef:i}=uo(),u=ho({sidebarConfig:e});return i!=null&&i.current?(0,r.jsx)(X.Z,{onClick:s,variant:"contained",className:fe()(u.visuallyHidden),children:"Skip to content"}):null}function fo(e,s){const i=new URLSearchParams(s.search).toString(),u=Ls().parse(i),p=new URLSearchParams(e.search).toString(),m=Ls().parse(p);return(0,ie.isEqual)(s.pathname,e.pathname)&&(0,ie.isMatch)(m,u)}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"}),ca=e=>{const{title:s,subtitle:i,to:u,icon:p,dropdownItems:m}=e,E=_o(),{setIsHoveredOn:O}=useContext(SidebarItemWithSubmenuContext),G=()=>{O(!1)},F=useResolvedPath(u!=null?u:""),he=useLocation();let re=isLocationMatch(he,F);const[xe,Ce]=useState(!1),He=()=>{Ce(!xe)};return m!==void 0?(m.some(qe=>{const Pt=resolvePath(qe.to);return re=isLocationMatch(he,Pt),re}),_jsxs(Box,{className:E.itemContainer,children:[_jsx(Tooltip,{title:s,enterDelay:500,enterNextDelay:500,children:_jsxs(Button,{role:"button",onClick:He,onTouchStart:qe=>qe.stopPropagation(),className:classnames(E.item,re?E.selected:void 0),children:[p&&_jsx(p,{fontSize:"small"}),_jsxs(Typography,{variant:"subtitle1",className:E.label,children:[s,_jsx("br",{}),i&&_jsx(Typography,{variant:"caption",className:E.subtitle,children:i})]}),xe?_jsx(ArrowDropUpIcon,{className:E.dropdownArrow}):_jsx(ArrowDropDownIcon,{className:E.dropdownArrow})]})}),m&&xe&&_jsx(Box,{className:E.dropdown,children:m.map((qe,Pt)=>_jsx(Tooltip,{title:qe.title,enterDelay:500,enterNextDelay:500,children:_jsx(Link,{to:qe.to,underline:"none",className:E.dropdownItem,onClick:G,onTouchStart:Gt=>Gt.stopPropagation(),children:_jsx(Typography,{className:E.textContent,children:qe.title})})},Pt))})]})):_jsx(Box,{className:E.itemContainer,children:_jsx(Tooltip,{title:s,enterDelay:500,enterNextDelay:500,children:_jsxs(Link,{to:u,underline:"none",className:classnames(E.item,re?E.selected:void 0),onClick:G,onTouchStart:qe=>qe.stopPropagation(),children:[p&&_jsx(p,{fontSize:"small"}),_jsxs(Typography,{variant:"subtitle1",className:E.label,children:[s,_jsx("br",{}),i&&_jsx(Typography,{variant:"caption",className:E.subtitle,children:i})]})]})})})};var $s;const a=(0,c.Z)(e=>({root:{zIndex:1e3,position:"relative",overflow:"visible",width:e.spacing(7)+1},drawer:s=>{var i;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:($s=(i=e.palette.navigation.submenu)===null||i===void 0?void 0:i.background)!==null&&$s!==void 0?$s:"#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"}),n=e=>{const{isOpen:s}=Bs(),{sidebarConfig:i,submenuConfig:u}=(0,g.useContext)(ir),p=s?i.drawerWidthOpen:i.drawerWidthClosed,m=a({left:p,submenuConfig:u}),{isHoveredOn:E}=(0,g.useContext)(Mo),[O,G]=(0,g.useState)(!1);return(0,g.useEffect)(()=>{G(E)},[E]),(0,r.jsxs)(je.Z,{className:fe()(m.drawer,{[m.drawerOpen]:O}),children:[(0,r.jsx)(z.Z,{variant:"h5",className:m.title,children:e.title}),e.children]})};var o=t(26739),l=t(76600),f=t(83543),R=t(59797),N=t(98989);const V=(0,c.Z)({iconContainer:{display:"flex",position:"relative",width:"100%"},arrow1:{right:"6px",position:"absolute"}}),ne=()=>{const e=V();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 ze=null;const Ze=(0,c.Z)({iconContainer:{display:"flex",position:"relative",width:"100%"},arrow1:{right:"6px",position:"absolute"}}),ut=()=>{const e=Ze();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 lt=null,bt,St;const Bt=e=>(0,c.Z)(s=>{var i,u;return{root:{color:s.palette.navigation.color,display:"flex",flexFlow:"row nowrap",alignItems:"center",height:48,cursor:"pointer"},buttonItem:{background:"none",border:"none",width:"100%",margin:0,padding:0,textAlign:"inherit",font:"inherit"},closed:{width:e.drawerWidthClosed,justifyContent:"center"},open:{[s.breakpoints.up("sm")]:{width:e.drawerWidthOpen}},highlightable:{"&:hover":{background:(bt=(i=s.palette.navigation.navItem)===null||i===void 0?void 0:i.hoverBackground)!==null&&bt!==void 0?bt:"#404040"}},highlighted:{background:(St=(u=s.palette.navigation.navItem)===null||u===void 0?void 0:u.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 jt(e){return(0,g.useMemo)(()=>Bt(e),[e])()}const jn=(e,s)=>(0,W.vJ)(e.props.children,i=>{let u=!1;return i.getElements().forEach(({props:{to:p,dropdownItems:m}})=>{if(!u){if(m!=null&&m.length){m.forEach(({to:E})=>u=u||fo(s,(0,Ps.i3)(E)));return}p&&(u=fo(s,(0,Ps.i3)(p)))}}),u},[s.pathname]);function Zn(e){return e.to===void 0}const ar=g.createElement(n).type,cs=g.forwardRef(function({to:s,end:i,style:u,className:p,activeStyle:m,caseSensitive:E,activeClassName:O="active","aria-current":G="page",...F},he){let{pathname:re}=(0,T.TH)(),{pathname:xe}=(0,T.WU)(s);E||(re=re.toLocaleLowerCase("en-US"),xe=xe.toLocaleLowerCase("en-US"));let Ce=re===xe;!Ce&&!i&&(Ce=re.startsWith(`${xe}/`));const He=Ce?G:void 0;return(0,r.jsx)(L.rU,{...F,to:s,ref:he,"aria-current":He,style:{...u,...Ce?m:void 0},className:fe()([p,Ce?O:void 0])})}),go=(0,g.forwardRef)((e,s)=>{const{icon:i,text:u,hasNotifications:p=!1,hasSubmenu:m=!1,disableHighlight:E=!1,onClick:O,children:G,className:F,...he}=e,{sidebarConfig:re}=(0,g.useContext)(ir),xe=jt(re),{isOpen:Ce}=Bs(),He=!Ce&&m?{display:"flex",marginLeft:"20px"}:{lineHeight:"0"},qe=(0,r.jsxs)(je.Z,{style:He,children:[(0,r.jsx)(i,{fontSize:"small"}),!Ce&&m?(0,r.jsx)(N.Z,{fontSize:"small"}):(0,r.jsx)(r.Fragment,{})]}),Pt=(0,r.jsx)(o.Z,{color:"secondary",variant:"dot",overlap:"circular",invisible:!p,className:fe()({[xe.closedItemIcon]:!Ce}),children:qe}),Gt=(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(je.Z,{"data-testid":"login-button",className:xe.iconContainer,children:Pt}),u&&(0,r.jsx)(z.Z,{variant:"subtitle2",className:xe.label,children:u}),(0,r.jsx)("div",{className:xe.secondaryAction,children:G})]}),tn=Ce?Gt:Pt,nn={onClick:O,className:fe()(F,xe.root,Ce?xe.open:xe.closed,Zn(e)&&xe.buttonItem,{[xe.highlightable]:!E})};return Zn(e)?(0,r.jsx)(X.Z,{role:"button","aria-label":u,...nn,ref:s,children:tn}):(0,r.jsx)(cs,{...nn,activeClassName:xe.selected,to:e.to?e.to:"",ref:s,"aria-label":u||e.to,...he,children:tn})}),ei=({children:e,...s})=>{const{sidebarConfig:i}=(0,g.useContext)(ir),u=jt(i),[p,m]=(0,g.useState)(!1),E=(0,T.TH)(),O=jn(e,E),G=(0,Ie.Z)(xe=>xe.breakpoints.down("sm")),F=()=>{m(!0)},he=()=>{m(!1)},re=()=>G?p?(0,r.jsx)(R.Z,{fontSize:"small",className:u.submenuArrow}):(0,r.jsx)(f.Z,{fontSize:"small",className:u.submenuArrow}):!p&&(0,r.jsx)(N.Z,{fontSize:"small",className:u.submenuArrow});return(0,r.jsx)(Mo.Provider,{value:{isHoveredOn:p,setIsHoveredOn:m},children:(0,r.jsxs)("div",{"data-testid":"item-with-submenu",onMouseLeave:he,onTouchStart:p?he:F,onMouseEnter:F,className:fe()(p&&u.highlighted),children:[(0,r.jsx)(go,{hasSubmenu:!0,className:O?u.selected:"",...s,children:re()}),p&&e]})})},ds=(0,g.forwardRef)((e,s)=>{const[i]=(0,W.vJ)(e.children,u=>u.getElements().filter(p=>p.type===ar));return i?(0,r.jsx)(ei,{...e,children:i}):(0,r.jsx)(go,{...e,ref:s})});function Oi(e){const{sidebarConfig:s}=useContext(SidebarConfigContext),[i,u]=useState(""),p=jt(s),m=e.icon?e.icon:SearchIcon,E=()=>{e.onSearch(i),u("")},O=re=>{re.key==="Enter"&&(re.preventDefault(),E())},G=re=>{u(re.target.value)},F=re=>{re.preventDefault(),re.stopPropagation()},he=re=>{E(),re.preventDefault()};return _jsx(Box,{className:p.searchRoot,children:_jsx(ds,{icon:m,to:e.to,onClick:he,disableHighlight:!0,children:_jsx(TextField,{placeholder:"Search",value:i,onClick:F,onChange:G,onKeyDown:O,className:p.searchContainer,InputProps:{disableUnderline:!0,className:p.searchField},inputProps:{className:p.searchFieldHTMLInput}})})})}const Vr=(0,l.Z)("div")({flex:1},{name:"BackstageSidebarSpace"}),zl=(0,l.Z)("div")({height:8},{name:"BackstageSidebarSpacer"}),da=(0,l.Z)("hr")(({theme:e})=>({height:1,width:"100%",background:"#383838",border:"none",margin:e.spacing(1.2,0)}),{name:"BackstageSidebarDivider"}),ua=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,l.Z)("div")(({theme:e})=>{const s=ua(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=jt(e),{isOpen:i,setOpen:u}=useSidebarOpenState();if(useMediaQuery(E=>E.breakpoints.down("md"),{noSsr:!0}))return null;const m=()=>{u(!i)};return _jsx(Button,{role:"button",onClick:m,className:s.expandButton,"aria-label":"Expand Sidebar","data-testid":"sidebar-expand-button",children:_jsx(Box,{className:s.arrows,children:i?_jsx(DoubleArrowLeft,{}):_jsx(DoubleArrowRight,{})})})},ha=(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 pa(e){const{sidebarConfig:s}=useContext(SidebarConfigContext),i=ha({sidebarConfig:s}),{text:u,onClose:p}=e,m=()=>p();return _jsxs(Box,{className:i.introCard,children:[_jsx(Typography,{variant:"subtitle2",children:u}),_jsx(Box,{className:i.introDismiss,children:_jsxs(IconButton,{onClick:m,className:i.introDismissLink,children:[_jsx(CloseIcon,{className:i.introDismissIcon}),_jsx(Typography,{component:"span",className:i.introDismissText,children:"Dismiss"})]})})]})}const Bi=e=>{const{text:s,onDismiss:i}=e,[u,p]=useState(!1),m=()=>{p(!0)};return _jsx(Collapse,{in:!u,onExited:i,children:_jsx(pa,{text:s,onClose:m})})},fa=null,ga="And your recently viewed plugins will pop up here!";function Hl(e){const{isOpen:s}=useSidebarOpenState(),i={starredItemsDismissed:!1,recentlyViewedItemsDismissed:!1},{value:u,set:p}=useLocalStorageValue(SIDEBAR_INTRO_LOCAL_STORAGE),{starredItemsDismissed:m,recentlyViewedItemsDismissed:E}=u!=null?u:{},O=()=>{p(F=>({...i,...F,starredItemsDismissed:!0}))},G=()=>{p(F=>({...i,...F,recentlyViewedItemsDismissed:!0}))};return s?_jsxs(_Fragment,{children:[!m&&_jsxs(_Fragment,{children:[_jsx(Bi,{text:fa,onDismiss:O}),_jsx(SidebarDivider,{})]}),!E&&_jsx(Bi,{text:ga,onDismiss:G})]}):null}const ma=(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 $i(e){const{className:s,stretch:i,noPadding:u,children:p,...m}=e,{contentRef:E}=uo(),O=ma();return(0,r.jsx)("article",{ref:E,tabIndex:-1,...m,className:fe()(O.root,s,{[O.stretch]:i,[O.noPadding]:u}),children:p})}var va=t(6487),ya=t(99152);const xa=(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:i,selectedIndex:u}=e,[p,m]=(0,g.useState)(u!=null?u:0),E=xa(),O=(0,g.useCallback)((G,F)=>{u===void 0&&m(F),i&&u!==F&&i(F)},[u,i]);return(0,g.useEffect)(()=>{u!==void 0&&m(u)},[u]),(0,r.jsx)(je.Z,{className:E.tabsWrapper,children:(0,r.jsx)(ya.Z,{selectionFollowsFocus:!0,indicatorColor:"primary",textColor:"inherit",variant:"scrollable",scrollButtons:"auto","aria-label":"scrollable auto tabs example",onChange:O,value:p,children:s.map((G,F)=>(0,g.createElement)(va.Z,{...G.tabProps,"data-testid":`header-tab-${F}`,label:G.label,key:G.id,value:F,className:E.defaultTab,classes:{selected:E.selected,root:E.tabRoot}}))})})}function ba(e){const s=(0,T.UO)(),u=e.map(({path:xe,children:Ce})=>({caseSensitive:!1,path:`${xe}/*`,element:Ce})).sort((xe,Ce)=>Ce.path.replace(/\/\*$/,"").localeCompare(xe.path.replace(/\/\*$/,"")));var p;const m=(p=(0,T.V$)(u))!==null&&p!==void 0?p:e[0].children;var E;let O=(E=s["*"])!==null&&E!==void 0?E:"";O.startsWith("/")||(O=`/${O}`);var G;const[F]=(G=(0,Ps.fp)(u,O))!==null&&G!==void 0?G:[],he=F?e.findIndex(xe=>`${xe.path}/*`===F.route.path):0;var re;return{index:he===-1?0:he,element:m,route:(re=e[he])!==null&&re!==void 0?re:e[0]}}function Di(e){const{routes:s}=e,i=(0,T.s0)(),{index:u,route:p,element:m}=ba(s),E=(0,g.useMemo)(()=>s.map(G=>({id:G.path,label:G.title,tabProps:G.tabProps})),[s]),O=G=>{let{path:F}=s[G];F=F.replace(/\/\*$/,""),F=F.replace(/^\//,""),i(F)};return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(Zi,{tabs:E,selectedIndex:u,onChange:O}),(0,r.jsxs)($i,{children:[(0,r.jsx)(is.q,{title:p.title}),m]})]})}const ti=()=>null;(0,W.R5)(ti,"core.gatherMountPoints",!0);function Ni(e){const s=(0,r.jsx)(ti,{path:"",title:"",children:(0,r.jsx)("div",{})}).type;return g.Children.toArray(e).flatMap(i=>{if(!(0,g.isValidElement)(i))return[];if(i.type===g.Fragment)return Ni(i.props.children);if(i.type!==s)throw new Error("Child of TabbedLayout must be an TabbedLayout.Route");const{path:u,title:p,children:m,tabProps:E}=i.props;return[{path:u,title:p,children:m,tabProps:E}]})}function Sa(e){const s=Ni(e.children);return(0,r.jsx)(Di,{routes:s})}Sa.Route=ti;const wa=(0,c.Z)(e=>({value:{marginBottom:e.spacing(.75)},subvalue:{color:e.palette.textSubtle,fontWeight:"normal"}}),{name:"BackstageSubvalueCell"});function Ca(e){const{value:s,subvalue:i}=e,u=wa();return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(je.Z,{className:u.value,children:s}),(0,r.jsx)(je.Z,{className:u.subvalue,children:i})]})}var mo=t(67222),ja=t(21070),Ea=t(90324),Aa=t(98281),Ta=t(48049),Fi=t(51209),Ui=t(33375),Ia=t(44233),Ra=t(27604),ni=t(36444),La=t(37971),Pa=t(59709),ka=t(17373),Oa=t(3702),Ba=t(93111);const $a=(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"}),Za=e=>{var s;const i=$a(),{onChangeFilters:u}=e,[p,m]=(0,g.useState)({...e.selectedFilters}),[E,O]=(0,g.useState)(!1),G=()=>{m({}),O(F=>!F)};return(0,g.useEffect)(()=>{u(p)},[p,u]),(0,r.jsxs)(je.Z,{className:i.root,children:[(0,r.jsxs)(je.Z,{className:i.header,children:[(0,r.jsx)(je.Z,{className:i.value,children:"Filters"}),(0,r.jsx)(X.Z,{color:"primary",onClick:G,children:"Clear all"})]}),(0,r.jsx)(je.Z,{className:i.filters,children:((s=e.filters)===null||s===void 0?void 0:s.length)&&e.filters.map(F=>(0,r.jsx)(Tn,{triggerReset:E,...F.element,selected:p[F.element.label],onChange:he=>m({...p,[F.element.label]:he})},F.element.label))})]})},Mi={Add:(0,g.forwardRef)((e,s)=>(0,r.jsx)(ja.Z,{...e,ref:s})),Check:(0,g.forwardRef)((e,s)=>(0,r.jsx)(Aa.Z,{...e,ref:s})),Clear:(0,g.forwardRef)((e,s)=>(0,r.jsx)(Ui.Z,{...e,ref:s})),Delete:(0,g.forwardRef)((e,s)=>(0,r.jsx)(Ia.Z,{...e,ref:s})),DetailPanel:(0,g.forwardRef)((e,s)=>(0,r.jsx)(Fi.Z,{...e,ref:s})),Edit:(0,g.forwardRef)((e,s)=>(0,r.jsx)(Ra.Z,{...e,ref:s})),Export:(0,g.forwardRef)((e,s)=>(0,r.jsx)(Oa.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)(La.Z,{...e,ref:s})),LastPage:(0,g.forwardRef)((e,s)=>(0,r.jsx)(Pa.Z,{...e,ref:s})),NextPage:(0,g.forwardRef)((e,s)=>(0,r.jsx)(Fi.Z,{...e,ref:s})),PreviousPage:(0,g.forwardRef)((e,s)=>(0,r.jsx)(Ta.Z,{...e,ref:s})),ResetSearch:(0,g.forwardRef)((e,s)=>(0,r.jsx)(Ui.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)(Ea.Z,{...e,ref:s})),ThirdStateCheck:(0,g.forwardRef)((e,s)=>(0,r.jsx)(ka.Z,{...e,ref:s})),ViewColumn:(0,g.forwardRef)((e,s)=>(0,r.jsx)(Ba.Z,{...e,ref:s}))};function zi(e,s){const i=s.split(".");let u=e[i[0]];for(let p=1;p<i.length;++p){if(u===void 0)return u;const m=i[p];u=u[m]}return u}const Da=(0,An.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"})(mo.W$),Wi=(0,An.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"})(mo.UW),Na=(0,c.Z)(e=>({root:{display:"flex",alignItems:"center",justifyContent:"space-between"},title:{fontWeight:e.typography.fontWeightBold,fontSize:18,whiteSpace:"nowrap"}}),{name:"BackstageTableFiltersContainer"}),Fa=(0,c.Z)(()=>({root:{display:"flex",alignItems:"start"}}),{name:"BackstageTable"});function Ua(e,s){return e.map(i=>{const u={};let p=i.cellStyle||{};if(i.highlight)if(u.color=s.palette.textContrast,typeof p=="object")p.fontWeight=s.typography.fontWeightBold;else{const m=p;p=(E,O,G)=>({...m(E,O,G),fontWeight:s.typography.fontWeightBold})}return{...i,headerStyle:u,cellStyle:p}})}function Ma(e,s){return(0,ie.transform)(e,(i,u,p)=>{(0,ie.isEqual)(u,s[p])||(i[p]=u)})}const Vi={search:"",filtersOpen:!1,filters:{}};function za(e){const{toolbarRef:s,setSearch:i,hasFilters:u,selectedFiltersLength:p,toggleFilters:m}=e,E=Na(),O=(0,g.useCallback)(G=>{e.onSearchChanged(G),i(G)},[e,i]);return u?(0,r.jsxs)(je.Z,{className:E.root,children:[(0,r.jsxs)(je.Z,{className:E.root,children:[(0,r.jsx)(ot.Z,{onClick:m,"aria-label":"filter list",children:(0,r.jsx)(ni.Z,{})}),(0,r.jsxs)(z.Z,{className:E.title,children:["Filters (",p,")"]})]}),(0,r.jsx)(Wi,{...e,ref:s,onSearchChanged:O})]}):(0,r.jsx)(Wi,{...e,ref:s,onSearchChanged:O})}function Hi(e){const{data:s,columns:i,options:u,title:p,subtitle:m,filters:E,initialState:O,emptyContent:G,onStateChange:F,components:he,...re}=e,xe=Fa(),Ce=(0,Ge.Z)(),He={...Vi,...O},[qe,Pt]=(0,g.useState)(He.filtersOpen),Gt=(0,g.useCallback)(()=>Pt(Dn=>!Dn),[Pt]),[tn,nn]=(0,g.useState)(0),[kt,Xt]=(0,g.useState)(s),[Kt,br]=(0,g.useState)(He.filters),Sr=Ua(i,Ce),[wr,Cr]=(0,g.useState)(He.search);(0,g.useEffect)(()=>{if(F){const Dn=Ma({search:wr,filtersOpen:qe,filters:Kt},Vi);F(Dn)}},[wr,qe,Kt,F]);const ai={headerStyle:{textTransform:"uppercase"}},$r=(0,g.useCallback)(Dn=>{var hr;return(hr=i.find(Hr=>Hr.title===Dn))===null||hr===void 0?void 0:hr.field},[i]);(0,g.useEffect)(()=>{if(typeof s=="function")return;if(!Kt){Xt(s);return}const Dn=Object.values(Kt);if(s&&Dn.flat().length){const hr=s.filter(Hr=>!!Object.entries(Kt).filter(([,Gr])=>!!Gr.length).every(([Gr,sn])=>{const gn=zi(Hr,$r(Gr));return Array.isArray(gn)&&Array.isArray(sn)?gn.some(hs=>sn.includes(hs)):Array.isArray(gn)?gn.includes(sn):Array.isArray(sn)?sn.includes(gn):gn===sn}));Xt(hr)}else Xt(s);nn(Dn.flat().length)},[s,Kt,$r]);const li=(Dn,hr)=>{const Hr=sn=>{const gn=new Set,hs=Kr=>{Kr!=null&&gn.add(Kr)};return hr&&hr.forEach(Kr=>{const Ds=zi(Kr,$r(sn));Array.isArray(Ds)?Ds.forEach(hs):hs(Ds)}),gn},Gr=sn=>({placeholder:"All results",label:sn.column,multiple:sn.type==="multiple-select",items:[...Hr(sn.column)].sort().map(gn=>({label:gn,value:gn}))});return Dn.map(sn=>({type:sn.type,element:Gr(sn)}))},Yt=!!(E!=null&&E.length),us=(0,g.useCallback)(Dn=>(0,r.jsx)(za,{setSearch:Cr,hasFilters:Yt,selectedFiltersLength:tn,toggleFilters:Gt,...Dn}),[Gt,Yt,tn,Cr]),yo=typeof s!="function"&&s.length===0,Zr=i.length,ci=(0,g.useCallback)(Dn=>G&&yo?(0,r.jsx)("tbody",{children:(0,r.jsx)("tr",{children:(0,r.jsx)("td",{colSpan:Zr,children:G})})}):(0,r.jsx)(mo.os,{...Dn}),[yo,G,Zr]);return(0,r.jsxs)(je.Z,{className:xe.root,children:[qe&&s&&typeof s!="function"&&(E==null?void 0:E.length)&&(0,r.jsx)(Za,{filters:li(E,s),selectedFilters:Kt,onChangeFilters:br}),(0,r.jsx)(mo.ZP,{components:{Header:Da,Toolbar:us,Body:ci,...he},options:{...ai,...u},columns:Sr,icons:Mi,title:(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(z.Z,{variant:"h5",component:"h2",children:p}),m&&(0,r.jsx)(z.Z,{color:"textSecondary",variant:"body1",children:m})]}),data:typeof s=="function"?s:kt,style:{width:"100%"},localization:{toolbar:{searchPlaceholder:"Filter",searchTooltip:"Filter"}},...re})]})}Hi.icons=Object.freeze(Mi);const Gl=e=>{const{children:s,value:i,index:u,...p}=e;return _jsx(Box,{role:"tabpanel",hidden:i!==u,"aria-labelledby":`scrollable-auto-tab-${u}`,...p,children:i===u&&_jsx(Box,{p:3,children:s})})},Wa=(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=Wa(e),{ariaLabel:i,onClick:u}=e;return _jsx(IconButton,{onClick:u,className:s.root,size:"small",disableRipple:!0,disableFocusRipple:!0,"aria-label":i,children:e.children})},Va=(e,s)=>s?e?"20px":"0":"40px",Ha=(0,c.Z)(e=>({root:{textTransform:"none",height:"64px",fontWeight:e.typography.fontWeightBold,fontSize:e.typography.pxToRem(13),color:e.palette.textSubtle,marginLeft:s=>Va(s.isFirstNav,s.isFirstIndex),width:"130px",minWidth:"130px","&:hover":{outline:"none",backgroundColor:"transparent",color:e.palette.textSubtle}}}),{name:"BackstageTab"}),Yl=e=>{const s=Ha(e),{isFirstNav:i,isFirstIndex:u,...p}=e;return _jsx(Tab,{classes:s,disableRipple:!0,...p})},Ga=(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=Ga(e);return _jsx(Tabs,{classes:s,...e,TabIndicatorProps:{children:_jsx("span",{})}})},Ka=(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,i=Ka(),[u,p]=useState([0,0]),[m,E]=useState(0),[O,G]=useState(0),[F,he]=useState([[]]),re=useRef(),{width:xe}=useWindowSize(),Ce=(tn,nn)=>{p([m,nn])},He=()=>{E(m-1)},qe=()=>{E(m+1)},Pt=()=>m+1<F.length;useEffect(()=>{const nn=m===0?1:2,kt=re.current.offsetWidth-20-nn*30,Xt=u[0]*O+u[1],Kt=Math.floor(kt/170);G(Kt),he(chunkArray(s,Kt)),p([Math.floor(Xt/Kt),Xt%Kt])},[xe,s]);const Gt=m===u[0]?u[1]:!1;return _jsxs(Box,{className:i.root,children:[_jsx(AppBar,{ref:re,className:i.appbar,position:"static",children:_jsx(Box,{children:_jsxs(StyledTabs,{value:Gt,onChange:Ce,selectionFollowsFocus:!0,children:[m!==0&&_jsx(StyledIcon,{onClick:He,ariaLabel:"navigate-before",children:_jsx(NavigateBeforeIcon,{})}),F[m].map((tn,nn)=>_jsx(StyledTab,{value:nn,isFirstIndex:nn===0,isFirstNav:m===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,{})})]})})}),Gt!==!1?F[m].map((tn,nn)=>_jsx(TabPanel,{value:nn,index:Gt,children:tn.content},nn)):_jsx(TabPanel,{value:u[1],index:u[1],children:F[u[0]][u[1]].content},"panel_outside_chunked_array")]})}var Xl=t(44311);function Ya(e,s){const i=e[e.length-1];if(!!i)return i>=.9?s.palette.status.ok:i>=.5?s.palette.status.warning:s.palette.status.error}function ql(e){const s=useTheme();if(!e.data)return null;var i;return _jsxs(Sparklines,{width:120,height:30,min:0,max:1,...e,children:[e.title&&_jsx("title",{children:e.title}),_jsx(SparklinesLine,{color:(i=e.color)!==null&&i!==void 0?i:Ya(e.data,s)})]})}const Ja=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"}),Qa=({title:e="Unknown page",className:s})=>(0,r.jsx)(z.Z,{variant:"h4",component:"h2",className:s,"data-testid":"header-title",children:e});function Xa(e){const{description:s,title:i,titleComponent:u=void 0,children:p,textAlign:m="left"}=e,E=Ja({textAlign:m})(),O=u||(0,r.jsx)(Qa,{title:i,className:E.title});return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(is.q,{title:i}),(0,r.jsxs)(je.Z,{className:E.container,children:[(0,r.jsxs)(je.Z,{className:E.leftItemsBox,children:[O,s&&(0,r.jsx)(z.Z,{className:E.description,variant:"body2",children:s})]}),(0,r.jsx)(je.Z,{className:E.rightItemsBox,children:p})]})]})}var qa=t.p+"static/mic-drop.fe3ef4d0..svg";const _a=(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"}),el=()=>{const e=_a();return(0,r.jsx)("img",{src:qa,className:e.micDrop,alt:"Girl dropping mic from her hands"})},tl=(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 nl(e){const{status:s,statusMessage:i,additionalInfo:u,supportUrl:p}=e,m=tl(),E=(0,T.s0)(),O=Xs();return(0,r.jsxs)(Oe.Z,{container:!0,spacing:0,className:m.container,children:[(0,r.jsxs)(Oe.Z,{item:!0,xs:12,sm:8,md:4,children:[(0,r.jsxs)(z.Z,{"data-testid":"error",variant:"body1",className:m.subtitle,children:["ERROR ",s,": ",i]}),(0,r.jsx)(z.Z,{variant:"body1",className:m.subtitle,children:u}),(0,r.jsx)(z.Z,{variant:"h2",className:m.title,children:"Looks like someone dropped the mic!"}),(0,r.jsxs)(z.Z,{variant:"h6",children:[(0,r.jsx)(Xe,{to:"#","data-testid":"go-back-link",onClick:()=>E(-1),children:"Go back"}),"... or please"," ",(0,r.jsx)(Xe,{to:p||O.url,children:"contact support"})," if you think this is a bug."]})]}),(0,r.jsx)(el,{})]})}var rl=t(16173);const sl=(0,An.Z)({root:{textDecoration:"underline",cursor:"pointer"}},{name:"BackstageBreadcrumbsClickableText"})(z.Z),ri=(0,An.Z)({root:{textDecoration:"underline",color:"inherit"}},{name:"BackstageBreadcrumbsStyledBox"})(je.Z);function ol(e){const{children:s,...i}=e,[u,p]=g.useState(null),m=g.Children.toArray(s),[E,O,...G]=m,F=G.length?G.pop():m[m.length-1],he=m.length>3,re=He=>{p(He.currentTarget)},xe=()=>{p(null)},Ce=Boolean(u);return(0,r.jsxs)(g.Fragment,{children:[(0,r.jsxs)(rl.Z,{"aria-label":"breadcrumb",...i,children:[m.length>1&&(0,r.jsx)(ri,{clone:!0,children:E}),m.length>2&&(0,r.jsx)(ri,{clone:!0,children:O}),he&&(0,r.jsx)(sl,{onClick:re,children:"..."}),(0,r.jsx)(je.Z,{style:{fontStyle:"italic"},children:F})]}),(0,r.jsx)(Ys.ZP,{open:Ce,anchorEl:u,onClose:xe,anchorOrigin:{vertical:"bottom",horizontal:"left"},transformOrigin:{vertical:"top",horizontal:"left"},children:(0,r.jsx)(Ct.Z,{children:G.map((He,qe)=>(0,r.jsx)(Ke.Z,{button:!0,children:(0,r.jsx)(ri,{clone:!0,children:He})},qe))})})]})}const il=(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"}),al=({type:e,typeLink:s,classes:i,pageTitle:u})=>e?s?(0,r.jsxs)(ol,{className:i.breadcrumb,children:[(0,r.jsx)(Xe,{to:s,children:e}),(0,r.jsx)(z.Z,{children:u})]}):(0,r.jsx)(z.Z,{className:i.type,children:e}):null,ll=({pageTitle:e,classes:s,tooltip:i})=>{const u=(0,r.jsx)(z.Z,{className:s.title,variant:"h1",children:e});return i?(0,r.jsx)(ct.ZP,{title:i,placement:"top-start",children:u}):u},cl=({classes:e,subtitle:s})=>s?typeof s!="string"?(0,r.jsx)(r.Fragment,{children:s}):(0,r.jsx)(z.Z,{className:e.subtitle,variant:"subtitle2",component:"span",children:s}):null;function Gi(e){const{children:s,pageTitleOverride:i,style:u,subtitle:p,title:m,tooltip:E,type:O,typeLink:G}=e,F=il(),re=(0,W.h_)(W.Ds).getOptionalString("app.title")||"Backstage",xe=i||m,Ce=m||i,He=`${xe} | %s | ${re}`,qe=`${xe} | ${re}`;return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(is.q,{titleTemplate:He,defaultTitle:qe}),(0,r.jsxs)("header",{style:u,className:F.header,children:[(0,r.jsxs)(je.Z,{className:F.leftItemsBox,children:[(0,r.jsx)(al,{classes:F,type:O,typeLink:G,pageTitle:Ce}),(0,r.jsx)(ll,{classes:F,pageTitle:Ce,tooltip:E}),(0,r.jsx)(cl,{classes:F,subtitle:p})]}),(0,r.jsx)(Oe.Z,{container:!0,className:F.rightItemsBox,spacing:4,children:s})]})]})}const dl=({label:e,secondaryLabel:s,icon:i,disabled:u=!1,onClick:p})=>_jsx(Fragment,{children:_jsxs(ListItem,{"data-testid":"header-action-item",disabled:u,button:!0,onClick:m=>{p&&p(m)},children:[i&&_jsx(ListItemIcon,{children:i}),_jsx(ListItemText,{primary:e,secondary:s})]})});function _l(e){const{actionItems:s}=e,[i,u]=React.useState(!1),p=React.useRef(null);return _jsxs(Fragment,{children:[_jsx(IconButton,{onClick:()=>u(!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:i,anchorEl:p.current,anchorOrigin:{horizontal:"right",vertical:"bottom"},transformOrigin:{horizontal:"right",vertical:"top"},onClose:()=>u(!1),children:_jsx(List,{children:s.map((m,E)=>_jsx(dl,{...m},`header-action-menu-${E}`))})})]})}const ul=(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"}),hl=({value:e,className:s})=>(0,r.jsx)(z.Z,{className:s,children:e});function pl(e){const{label:s,value:i,url:u}=e,p=ul(),m=(0,r.jsx)(hl,{className:p.value,value:i||"<Unknown>"});return(0,r.jsx)(Oe.Z,{item:!0,children:(0,r.jsxs)(z.Z,{component:"span",className:p.root,children:[(0,r.jsx)(z.Z,{className:p.label,children:s}),u?(0,r.jsx)(Xe,{to:u,children:m}):m]})})}const fl=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"}}),gl=(0,c.Z)(fl,{name:"BackstageItemCardHeader"});function ml(e){const{title:s,subtitle:i,children:u}=e,p=gl(e);return(0,r.jsxs)(je.Z,{className:p.root,children:[i&&(0,r.jsx)(z.Z,{variant:"subtitle2",component:"h3",children:i}),s&&(0,r.jsx)(z.Z,{variant:"h6",component:"h4",children:s}),u]})}function ec(e){const{description:s,tags:i,title:u,type:p,subtitle:m,label:E,onClick:O,href:G}=e;return _jsxs(Card,{children:[_jsx(CardMedia,{children:_jsx(ItemCardHeader,{title:u,subtitle:m||p})}),_jsxs(CardContent,{children:[i!=null&&i.length?_jsx(Box,{children:i.map((F,he)=>_jsx(Chip,{size:"small",label:F},he))}):null,s]}),_jsxs(CardActions,{children:[!G&&_jsx(Button,{to:"#",onClick:O,color:"primary",children:E}),G&&_jsx(Button,{to:G,color:"primary",children:E})]})]})}const vl=e=>(0,P.Z)({root:{display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(22em, 1fr))",gridAutoRows:"1fr",gridGap:e.spacing(2)}}),yl=(0,c.Z)(vl,{name:"BackstageItemCardGrid"});function xl(e){const{children:s,...i}=e,u=yl(i);return(0,r.jsx)(je.Z,{className:u.root,...i,children:s})}var bl=t(41547);const Sl=(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 Ki(e){const{themeId:s,children:i}=e,{isMobile:u}=Wr(),p=Sl({isMobile:u});return(0,r.jsx)(bl.Z,{theme:m=>({...m,page:m.getPageTheme({themeId:s})}),children:(0,r.jsx)("main",{className:p.root,children:i})})}function wl(e){const{themeId:s,children:i,...u}=e;return(0,r.jsxs)(Ki,{themeId:s,children:[(0,r.jsx)(Gi,{...u}),i]})}var Yn=t(30195);const tc=Yn.z.object({providerInfo:Yn.z.object({}).catchall(Yn.z.unknown()).optional(),profile:Yn.z.object({email:Yn.z.string().optional(),displayName:Yn.z.string().optional(),picture:Yn.z.string().optional()}),backstageIdentity:Yn.z.object({token:Yn.z.string(),identity:Yn.z.object({type:Yn.z.literal("user"),userEntityRef:Yn.z.string(),ownershipEntityRefs:Yn.z.array(Yn.z.string())})})}),Yi={defaultTokenExpiryMillis:5*60*1e3,tokenExpiryMarginMillis:5*60*1e3};function Cl(e){const s=new Date(Date.now()+Yi.defaultTokenExpiryMillis);if(!e)return s;const[i,u,p]=e.split("."),m=JSON.parse(window.atob(u));return typeof m.exp!="number"?s:new Date(m.exp*1e3-Yi.tokenExpiryMarginMillis)}class nc{async start(){await this.getSessionAsync()}getUserId(){const{backstageIdentity:s}=this.getSessionSync(),i=s.identity.userEntityRef,u=/^([^:/]+:)?([^:/]+\/)?([^:/]+)$/.exec(i);if(!u)throw new TypeError(`Invalid user entity reference "${i}"`);return u[3]}async getIdToken(){return(await this.getSessionAsync()).backstageIdentity.token}getProfile(){return this.getSessionSync().profile}async getProfileInfo(){return(await this.getSessionAsync()).profile}async getBackstageIdentity(){return(await this.getSessionAsync()).backstageIdentity.identity}async getCredentials(){return{token:(await this.getSessionAsync()).backstageIdentity.token}}async signOut(){this.abortController.abort()}getSessionSync(){if(this.state.type==="active")return this.state.session;if(this.state.type==="fetching"&&this.state.previous)return this.state.previous;throw new Error("No session available. Try reloading your browser page.")}async getSessionAsync(){if(this.state.type==="fetching")return this.state.promise;if(this.state.type==="active"&&new Date<this.state.expiresAt)return this.state.session;const s=this.state.type==="active"?this.state.session:void 0,i=this.fetchSession().then(u=>(this.state={type:"active",session:u,expiresAt:Cl(u.backstageIdentity.token)},u),u=>{throw this.state={type:"failed",error:u},u});return this.state={type:"fetching",promise:i,previous:s},i}async fetchSession(){const s=await this.options.discoveryApi.getBaseUrl("auth"),i=typeof this.options.headers=="function"?await this.options.headers():this.options.headers,u=new Headers(i);u.set("X-Requested-With","XMLHttpRequest");const p=await fetch(`${s}/${this.options.provider}/refresh`,{signal:this.abortController.signal,headers:u,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:i,error:u},{execute:p}]=useAsync(async()=>{const m=new ProxiedSignInIdentity({provider:e.provider,discoveryApi:s,headers:e.headers});await m.start(),e.onSignInSuccess(m)});return useMountEffect(p),i==="loading"?_jsx(Progress,{}):u?_jsx(ErrorPanel,{title:"You do not appear to be signed in. Please try reloading the browser page.",error:u}):null},jl=(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=jl();return(0,r.jsx)(Oe.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 El(e){const[s,i,u]=e.split(".");return JSON.parse(window.atob(i))}class ii{getUserId(){return this.result.userId}static fromResult(s){return new ii(s)}async getIdToken(){var s,i;return(i=(s=this.result).getIdToken)===null||i===void 0?void 0:i.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:i,ent:u}=El(s);return{type:"user",userEntityRef:i,ownershipEntityRefs:u!=null?u:[]}}async getCredentials(){var s,i;return{token:await((i=(s=this.result).getIdToken)===null||i===void 0?void 0:i.call(s))}}async signOut(){var s,i;return(i=(s=this.result).signOut)===null||i===void 0?void 0:i.call(s)}constructor(s){this.result=s}}class Zs{static createGuest(){return new oi}static fromLegacy(s){return ii.fromResult(s)}static create(s){return new Zs(s.identity,s.authApi,s.profile)}getUserId(){const s=this.identity.userEntityRef,i=/^([^:/]+:)?([^:/]+\/)?([^:/]+)$/.exec(s);if(!i)throw new TypeError(`Invalid user entity reference "${s}"`);return i[3]}async getIdToken(){return(await this.authApi.getBackstageIdentity()).token}getProfile(){if(!this.profile)throw new Error("The identity API does not implement synchronous profile fetching, use getProfileInfo() instead");return this.profile}async getProfileInfo(){if(this.profilePromise)return await this.profilePromise;try{return this.profilePromise=this.authApi.getProfile(),await this.profilePromise}catch(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,i,u){this.identity=s,this.authApi=i,this.profile=u}}const Al={Component:({config:e,onSignInSuccess:s})=>{const{apiRef:i,title:u,message:p}=e,m=(0,W.h_)(i),E=(0,W.h_)(W.VE),O=async()=>{try{const G=await m.getBackstageIdentity({instantPopup:!0});if(!G)throw new Error(`The ${u} provider is not configured to support sign-in`);const F=await m.getProfile();s(Zs.create({identity:G.identity,profile:F,authApi:m}))}catch(G){E.post(new gs.SP("Login failed",G))}};return(0,r.jsx)(si,{children:(0,r.jsx)(Rr,{variant:"fullHeight",title:u,actions:(0,r.jsx)(X.Z,{color:"primary",variant:"outlined",onClick:O,children:"Sign In"}),children:(0,r.jsx)(z.Z,{variant:"body1",children:p})})})},loader:async(e,s)=>{const i=e.get(s),u=await i.getBackstageIdentity({optional:!0});if(!u)return;const p=await i.getProfile();return Zs.create({identity:u.identity,profile:p,authApi:i})}},Tl={Component:({onSignInSuccess:e})=>(0,r.jsx)(si,{children:(0,r.jsx)(Rr,{title:"Guest",variant:"fullHeight",actions:(0,r.jsx)(X.Z,{color:"primary",variant:"outlined",onClick:()=>e(new oi),children:"Enter"}),children:(0,r.jsxs)(z.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 Il=t(63955),Ji=t(86619),Qi=t(74828),Rl=t(45455),Ll=t.n(Rl);const Pl=/^[a-z0-9_\-]+\.[a-z0-9_\-]+\.[a-z0-9_\-]+$/i,kl=(0,c.Z)(e=>({form:{display:"flex",flexFlow:"column nowrap"},button:{alignSelf:"center",marginTop:e.spacing(2)}}),{name:"BackstageCustomProvider"}),Xi=e=>{const{ref:s,...i}=e;return{inputRef:s,...i}},Ol={Component:({onSignInSuccess:e})=>{const s=kl(),{register:i,handleSubmit:u,formState:p}=(0,Il.cI)({mode:"onChange"}),{errors:m}=p,E=({userId:O})=>{e(Zs.fromLegacy({userId:O,profile:{email:`${O}@example.com`}}))};return(0,r.jsx)(si,{children:(0,r.jsxs)(Rr,{title:"Custom User",variant:"fullHeight",children:[(0,r.jsxs)(z.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:u(E),children:[(0,r.jsxs)(Se.Z,{children:[(0,r.jsx)(Ji.Z,{...Xi(i("userId",{required:!0})),label:"User ID",margin:"normal",error:Boolean(m.userId)}),m.userId&&(0,r.jsx)(Qi.Z,{error:!0,children:m.userId.message})]}),(0,r.jsxs)(Se.Z,{children:[(0,r.jsx)(Ji.Z,{...Xi(i("idToken",{required:!1,validate:O=>!O||Pl.test(O)||"Token is not a valid OpenID Connect JWT Token"})),label:"ID Token (optional)",margin:"normal",autoComplete:"off",error:Boolean(m.idToken)}),m.idToken&&(0,r.jsx)(Qi.Z,{error:!0,children:m.idToken.message})]}),(0,r.jsx)(X.Z,{type:"submit",color:"primary",variant:"outlined",className:s.button,disabled:!(p!=null&&p.isDirty)||!Ll()(m),children:"Continue"})]})]})})},loader:async()=>{}},vo="@backstage/core:SignInPage:provider",qi={guest:Tl,custom:Ol,common:Al};function _i(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((i,u)=>{if(typeof u=="string")return _i(u,i),i[u]={components:qi[u],id:u},i;const{id:p}=u;return _i(p,i),i[p]={components:qi.common,id:p,config:u},i},{})}const uc=(e,s)=>{const i=useApi(errorApiRef),u=useApiHolder(),[p,m]=useState(!0),E=useCallback(G=>{s(IdentityApiSignOutProxy.from({identityApi:G,signOut:async()=>{var F;localStorage.removeItem(vo),await((F=G.signOut)===null||F===void 0?void 0:F.call(G))}}))},[s]);useLayoutEffect(()=>{var G;if(!p)return;const F=localStorage.getItem(vo);if(F===null){m(!1);return}const he=e[F];if(!he){m(!1);return}let re=!1;return he.components.loader(u,(G=he.config)===null||G===void 0?void 0:G.apiRef).then(xe=>{re||(xe?E(xe):m(!1))}).catch(xe=>{re||(localStorage.removeItem(vo),i.post(xe),m(!1))}),()=>{re=!0}},[p,i,s,u,e,E]);const O=useMemo(()=>Object.keys(e).map(G=>{const F=e[G],{Component:he}=F.components,re=xe=>{localStorage.setItem(vo,F.id),E(xe)};return _jsx(he,{config:F.config,onSignInSuccess:re},F.id)}),[e,E]);return[p,O]},Bl=({onSignInSuccess:e,providers:s=[],title:i,align:u="left"})=>{const p=useApi(configApiRef),m=useStyles(),E=getSignInProviders(s),[O,G]=useSignInProviders(E,e);return O?_jsx(Progress,{}):_jsxs(Page,{themeId:"home",children:[_jsx(Header,{title:p.getString("app.title")}),_jsxs(Content,{children:[i&&_jsx(ContentHeader,{title:i,textAlign:u}),_jsx(Grid,{container:!0,justifyContent:u==="center"?u:"flex-start",spacing:2,component:"ul",classes:m,children:G})]})]})},$l=({provider:e,auto:s,onSignInSuccess:i})=>{const u=useStyles(),p=useApi(e.apiRef),m=useApi(configApiRef),[E,O]=useState(),[G,F]=useState(!1),he=async({checkExisting:re,showPopup:xe})=>{try{let Ce;if(re&&(Ce=await p.getBackstageIdentity({optional:!0})),!Ce&&(xe||s)&&(F(!0),Ce=await p.getBackstageIdentity({instantPopup:!0}),!Ce))throw new Error(`The ${e.title} provider is not configured to support sign-in`);if(!Ce){F(!0);return}const He=await p.getProfile();i(UserIdentity.create({identity:Ce.identity,authApi:p,profile:He}))}catch(Ce){O(Ce),F(!0)}};return useMountEffect(()=>he({checkExisting:!0})),G?_jsxs(Page,{themeId:"home",children:[_jsx(Header,{title:m.getString("app.title")}),_jsx(Content,{children:_jsx(Grid,{container:!0,justifyContent:"center",spacing:2,component:"ul",classes:u,children:_jsx(GridItem,{children:_jsxs(InfoCard,{variant:"fullHeight",title:e.title,actions:_jsx(Button,{color:"primary",variant:"outlined",onClick:()=>{he({showPopup:!0})},children:"Sign In"}),children:[_jsx(Typography,{variant:"body1",children:e.message}),E&&E.name!=="PopupRejectedError"&&_jsx(Typography,{variant:"body1",color:"error",children:E.message})]})})})})]}):_jsx(Progress,{})};function hc(e){return"provider"in e?_jsx($l,{...e}):_jsx(Bl,{...e})}const Zl=(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"}),Dl=(0,An.Z)(e=>({root:{padding:e.spacing(2,2,2,2.5),display:"inline-block"},title:{fontWeight:700},subheader:{paddingTop:e.spacing(1)}}),{name:"BackstageTabbedCardBoldHeader"})(ns.Z);function pc(e){const{slackChannel:s,errorBoundaryProps:i,children:u,title:p,deepLink:m,value:E,onChange:O}=e,G=Zl(),[F,he]=useState(0),re=O||((He,qe)=>he(qe));let xe;E?React.Children.map(u,He=>{if(React.isValidElement(He)&&(He==null?void 0:He.props.value)===E){var qe;xe=He==null||(qe=He.props)===null||qe===void 0?void 0:qe.children}}):React.Children.map(u,(He,qe)=>{React.isValidElement(He)&&qe===F&&(xe=He==null?void 0:He.props.children)});const Ce=i||(s?{slackChannel:s}:{});return _jsx(Card,{children:_jsxs(ErrorBoundary,{...Ce,children:[p&&_jsx(Dl,{title:p}),_jsx(Tabs,{selectionFollowsFocus:!0,classes:G,value:E||F,onChange:re,children:u}),_jsx(Divider,{}),_jsx(CardContent,{children:xe}),m&&_jsx(BottomLink,{...m})]})})}const Nl=(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,...i}=e,u=Nl();return _jsx(Tab,{disableRipple:!0,classes:u,...i})}},25248:function(Rt,Me,t){"use strict";t.d(Me,{fC:function(){return b},CL:function(){return je},sM:function(){return _},$v:function(){return Te},v_:function(){return Qe},hg:function(){return Ye},uB:function(){return q},R5:function(){return Zt},bq:function(){return S},Ds:function(){return Xe},ni:function(){return z},T0:function(){return M},CO:function(){return zn},x8:function(){return En},rx:function(){return xn},YO:function(){return hn},P4:function(){return Mn},NT:function(){return qt},NW:function(){return Ve},VE:function(){return ft},W0:function(){return Ge},gP:function(){return st},IY:function(){return dt},F4:function(){return ie},ux:function(){return L},Kp:function(){return fe},$4:function(){return gt},p_:function(){return Z},ZM:function(){return rt},D:function(){return T},gW:function(){return A},E6:function(){return ot},z$:function(){return Lt},h_:function(){return te},I_:function(){return P},qD:function(){return Re},vJ:function(){return Ln},yx:function(){return Ie},tg:function(){return mn},Oi:function(){return un}});var h=t(52322),r=t(51837),W=t(2784);const B=(0,r.CT)("analytics-context"),g=()=>{const ge=(0,W.useContext)(B);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:Ee}=ge,_e={...g(),...ee},wt=(0,r.EI)({1:_e});return(0,h.jsx)(B.Provider,{value:wt,children:Ee})};function c(ge,ee){const Ee=Ne=>_jsx(b,{attributes:ee,children:_jsx(ge,{...Ne})});return Ee.displayName=`WithAnalyticsContext(${ge.displayName||ge.name||"Component"})`,Ee}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 Ee=P().get(ge);if(!Ee)throw new Error(`No implementation available for ${ge}`);return Ee}function Q(ge){return function(Ee){const Ne=wt=>{const ae=P(),k={};for(const ce in ge)if(ge.hasOwnProperty(ce)){const Oe=ge[ce],D=ae.get(Oe);if(!D)throw new Error(`No implementation available for ${Oe}`);k[ce]=D}return _jsx(Ee,{...wt,...k})},_e=Ee.displayName||Ee.name||"Component";return Ne.displayName=`withApis(${_e})`,Ne}}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(Ne=>Ne.split("-")).every(Ne=>Ne.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 M(ge){return new X(ge)}function z(ge,ee){return"id"in ge?{api:ge,deps:{},factory:()=>ee}:ge}var _;(function(ge){ge.SignedIn="SignedIn",ge.SignedOut="SignedOut"})(_||(_={}));const fe=M({id:"core.auth.google"}),ie=M({id:"core.auth.github"}),T=M({id:"core.auth.okta"}),L=M({id:"core.auth.gitlab"}),Z=M({id:"core.auth.microsoft"}),A=M({id:"core.auth.onelogin"}),S=M({id:"core.auth.bitbucket"}),q=M({id:"core.auth.atlassian"}),Te=M({id:"core.alert"}),Qe=M({id:"core.analytics"}),Ye=M({id:"core.apptheme"}),Xe=M({id:"core.config"}),Ve=M({id:"core.discovery"}),ft=M({id:"core.error"});var je;(function(ge){ge[ge.None=0]="None",ge[ge.Active=1]="Active"})(je||(je={}));const Ge=M({id:"core.featureflags"}),st=M({id:"core.fetch"}),gt=M({id:"core.identity"}),rt=M({id:"core.oauthrequest"}),ot=M({id:"core.storage"});class ct{setContext(ee){this.context=ee}captureEvent(ee,Ee,{value:Ne,attributes:_e}={}){try{this.analyticsApi.captureEvent({action:ee,subject:Ee,value:Ne,attributes:_e,context:this.context})}catch(wt){console.warn("Error during analytics event capture. %o",wt)}}constructor(ee,Ee={routeRef:"unknown",pluginId:"root",extension:"App"}){this.analyticsApi=ee,this.context=Ee}}function yt(){try{return te(Qe)}catch{return{captureEvent:()=>{}}}}function Lt(){const ge=(0,W.useRef)(null),ee=g(),Ee=yt();function Ne(){return ge.current===null&&(ge.current=new ct(Ee)),ge.current}const _e=Ne();return _e.setContext(ee),_e}const We="plugin-context",se=ge=>{const{children:ee,plugin:Ee}=ge,{Provider:Ne}=(0,r.CT)(We);return(0,h.jsx)(Ne,{value:(0,r.EI)({1:{plugin:Ee}}),children:ee})};function Ie(){const ge=(0,r.Vt)(We);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 Re=()=>{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),mt="__backstage_data";function Zt(ge,ee,Ee){const Ne=ge;var _e;let wt=(_e=Ne[mt])!==null&&_e!==void 0?_e:tt.get(ge);if(wt||(wt={map:new Map},Object.defineProperty(Ne,mt,{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,Ee)}function dt(ge,ee){if(!ge)return;const Ee=ge.type;if(!Ee)return;var Ne;const _e=(Ne=Ee[mt])!==null&&Ne!==void 0?Ne:tt.get(Ee);if(!!_e)return _e.map.get(ee)}const Et=(0,r.uW)("route-ref-type",()=>Symbol("route-ref-type"));let At=Et;class Ot{get title(){return this.id}toString(){return`routeRef{type=absolute,id=${this.id}}`}constructor(ee,Ee){this.id=ee,this.params=Ee,this[At]="absolute"}}function qt(ge){var ee;return new Ot(ge.id,(ee=ge.params)!==null&&ee!==void 0?ee:[])}const Vt=/^\w+$/;let Ht=null;class Jt{toString(){return`routeRef{type=sub,id=${this.id}}`}constructor(ee,Ee,Ne,_e){this.id=ee,this.path=Ee,this.parent=Ne,this.params=_e,this[Ht]="sub"}}function dn(ge){const{id:ee,path:Ee,parent:Ne}=ge,_e=Ee.split("/").filter(k=>k.startsWith(":")).map(k=>k.substring(1)),wt=[...Ne.params,..._e];if(Ne.params.some(k=>_e.includes(k)))throw new Error("SubRouteRef may not have params that overlap with its parent");if(!Ee.startsWith("/"))throw new Error(`SubRouteRef path must start with '/', got '${Ee}'`);if(Ee.endsWith("/"))throw new Error(`SubRouteRef path must not end with '/', got '${Ee}'`);for(const k of _e)if(!Vt.test(k))throw new Error(`SubRouteRef path has invalid param, got '${k}'`);return new Jt(ee,Ee,Ne,wt)}let an=Et;class Fn{toString(){return`routeRef{type=external,id=${this.id}}`}constructor(ee,Ee,Ne){this.id=ee,this.params=Ee,this.optional=Ne,this[an]="external"}}function En(ge){var ee;return new Fn(ge.id,(ee=ge.params)!==null&&ee!==void 0?ee:[],Boolean(ge.optional))}var Un=t(79635);function mn(ge){const{pathname:ee}=(0,Un.TH)(),Ee=(0,r.Vt)("routing-context");if(!Ee)throw new Error("Routing context is not available");const Ne=Ee.atVersion(1),_e=(0,W.useMemo)(()=>Ne&&Ne.resolve(ge,{pathname:ee}),[Ne,ge,ee]);if(!Ee)throw new Error("useRouteRef used outside of routing context");if(!Ne)throw new Error("RoutingContext v1 not available");const wt="optional"in ge&&ge.optional;if(!_e&&!wt)throw new Error(`No path for ${ge}`);return _e}function un(ge){return(0,Un.UO)()}class Qt extends W.Component{static getDerivedStateFromError(ee){return{error:ee}}render(){const{error:ee}=this.state,{app:Ee,plugin:Ne}=this.props,{ErrorBoundaryFallback:_e}=Ee.getComponents();return ee?(0,h.jsx)(_e,{error:ee,resetError:this.handleErrorReset,plugin:Ne}):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:Ee,name:Ne}=ge;return hn({component:{lazy:()=>ee().then(_e=>{const wt=k=>{try{mn(Ee)}catch(ce){if(typeof ce=="object"&&ce!==null){const{message:Oe}=ce;if(typeof Oe=="string"&&Oe.startsWith("No path for "))throw new Error(`Routable extension component with mount point ${Ee} 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 ce}return(0,h.jsx)(_e,{...k})},ae=Ne||_e.displayName||_e.name||"LazyComponent";return wt.displayName=`RoutableExtension(${ae})`,wt},_e=>ae=>{const k=Re(),{BootErrorPage:ce}=k.getComponents();return(0,h.jsx)(ce,{step:"load-chunk",error:_e})})},data:{"core.mountPoint":Ee},name:Ne})}function zn(ge){const{component:ee,name:Ee}=ge;return hn({component:ee,name:Ee})}function hn(ge){const{data:ee={},name:Ee}=ge;Ee||console.warn("Declaring extensions without name is DEPRECATED. Make sure that all usages of createReactExtension, createComponentExtension and createRoutableExtension provide a name.");let Ne;if("lazy"in ge.component){const wt=ge.component.lazy;Ne=(0,W.lazy)(()=>wt().then(ae=>({default:ae})))}else Ne=ge.component.sync;const _e=Ee||Ne.displayName||Ne.name||"Component";return{expose(wt){const ae=k=>{const ce=Re(),{Progress:Oe}=ce.getComponents(),D=ee==null?void 0:ee["core.mountPoint"];return(0,h.jsx)(W.Suspense,{fallback:(0,h.jsx)(Oe,{}),children:(0,h.jsx)(Qt,{app:ce,plugin:wt,children:(0,h.jsx)(b,{attributes:{pluginId:wt.getId(),...Ee&&{extension:Ee},...D&&{routeRef:D.id}},children:(0,h.jsx)(se,{plugin:wt,children:(0,h.jsx)(Ne,{...k})})})})})};Zt(ae,"core.plugin",wt);for(const[k,ce]of Object.entries(ee))Zt(ae,k,ce);return ae.displayName=`Extension(${_e})`,ae}}}function vn(ge,ee,Ee,Ne){return W.Children.toArray(ge).flatMap(_e=>{if(!(0,W.isValidElement)(_e))return[];if(_e.type===W.Fragment)return vn(_e.props.children,ee,Ee,Ne);if(dt(_e,"core.featureFlagged")){const wt=_e.props;return("with"in wt?ee.isActive(wt.with):!ee.isActive(wt.without))?vn(_e.props.children,ee,Ee,Ne):[]}if(Ee===void 0||Ee(_e))return[_e];if(Ne)throw new Error(Ne);return vn(_e.props.children,ee,Ee,Ne)})}class yn{selectByComponentData(ee){const Ee=vn(this.node,this.featureFlagsApi,Ne=>dt(Ne,ee.key)!==void 0,ee.withStrictError);return new yn(Ee,this.featureFlagsApi)}findComponentData(ee){return vn(this.node,this.featureFlagsApi,Ne=>dt(Ne,ee.key)!==void 0).map(Ne=>dt(Ne,ee.key)).filter(Ne=>Ne!==void 0)}getElements(){return vn(this.node,this.featureFlagsApi)}constructor(ee,Ee){this.node=ee,this.featureFlagsApi=Ee}}function Ln(ge,ee,Ee=[]){const Ne=te(Ge),_e=new yn(ge,Ne);return(0,W.useMemo)(()=>ee(_e),[ge,...Ee])}class Pn{getId(){return this.config.id}getApis(){var ee;return(ee=this.config.apis)!==null&&ee!==void 0?ee:[]}getFeatureFlags(){var ee,Ee;return(Ee=(ee=this.config.featureFlags)===null||ee===void 0?void 0:ee.slice())!==null&&Ee!==void 0?Ee:[]}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 xn(ge){return new Pn(ge)}},23054:function(Rt,Me,t){"use strict";t.d(Me,{SP:function(){return _},dR:function(){return X},VL:function(){return ie},BD:function(){return r}});function h(T){if(typeof T!="object"||T===null||Array.isArray(T))return!1;const L=T;return!(typeof L.name!="string"||L.name===""||typeof L.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 L=T;if(typeof L.name!="string"||L.name==="")throw new Error(`Encountered error object without a name, got '${T}'`);if(typeof L.message!="string")throw new Error(`Encountered error object without a message, got '${T}'`)}var W=t(24852);function B(T,L){const A={name:"Unknown",message:"<no reason given>",...serializeErrorInternal(T)};return L!=null&&L.includeStack||delete A.stack,A}function g(T){const L=(0,W.deserializeError)(T);return T.stack||(L.stack=void 0),L}function b(T){if(h(T)){const L=String(T);return L!=="[object Object]"?L:`${T.name}: ${T.message}`}return`unknown error '${T}'`}class c extends Error{constructor(L,Z){var A;let S=L;if(Z!==void 0){const q=b(Z);S?S+=`; caused by ${q}`:S=`caused by ${q}`}super(S),(A=Error.captureStackTrace)===null||A===void 0||A.call(Error,this,this.constructor),this.name=this.constructor.name,this.cause=h(Z)?Z:void 0}}class P extends null{}class te extends null{}class Q extends null{}class X extends c{}class M extends null{}class z extends null{}class _ extends c{constructor(L,Z){super(L,Z),this.name=h(Z)?Z.name:"Error"}}async function fe(T){try{const Z=await T.text();if(Z){var L;if(!((L=T.headers.get("content-type"))===null||L===void 0)&&L.startsWith("application/json"))try{const A=JSON.parse(Z);if(A.error&&A.response)return A}catch{}return{error:{name:"Error",message:`Request failed with status ${T.status} ${T.statusText}, ${Z}`},response:{statusCode:T.status}}}}catch{}return{error:{name:"Error",message:`Request failed with status ${T.status} ${T.statusText}`},response:{statusCode:T.status}}}class ie extends Error{static async fromResponse(L){const Z=await fe(L),A=Z.response.statusCode||L.status,S=Z.error.name||L.statusText,q=`Request failed with ${A} ${S}`,Te=g(Z.error);return new ie({message:q,response:L,data:Z,cause:Te})}constructor(L){super(L.message),this.name="ResponseError",this.response=L.response,this.body=L.data,this.cause=L.cause}}},32838:function(Rt,Me,t){"use strict";t.d(Me,{nW:function(){return ie},ae:function(){return X},q3:function(){return M}});var h=t(25248);const r=(0,h.T0)({id:"core.scmauth"});var W=new WeakMap;class B{async getCredentials(L){const Z=new URL(L.url),A=_class_private_field_get(this,W).find(S=>S.isUrlSupported(Z));if(!A)throw new Error(`No auth provider available for '${L.url}', see https://backstage.io/link?scm-auth`);return A.getCredentials(L)}constructor(L){_class_private_field_init(this,W,{writable:!0,value:void 0}),_class_private_field_set(this,W,L)}}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:L,gitlab:Z,azure:A,bitbucket:S})=>te.merge(te.forGithub(L),te.forGitlab(Z),te.forAzure(A),te.forBitbucket(S))})}static forAuthApi(L,Z){return new te("generic",L,Z.host,Z.scopeMapping)}static forGithub(L,Z){var A;const S=(A=Z==null?void 0:Z.host)!==null&&A!==void 0?A:"github.com";return new te("github",L,S,{default:["repo","read:org","read:user"],repoWrite:["gist"]})}static forGitlab(L,Z){var A;const S=(A=Z==null?void 0:Z.host)!==null&&A!==void 0?A:"gitlab.com";return new te("gitlab",L,S,{default:["read_user","read_api","read_repository"],repoWrite:["write_repository","api"]})}static forAzure(L,Z){var A;const S=(A=Z==null?void 0:Z.host)!==null&&A!==void 0?A:"dev.azure.com";return new te("azure",L,S,{default:["vso.build","vso.code","vso.graph","vso.project","vso.profile"],repoWrite:["vso.code_manage"]})}static forBitbucket(L,Z){var A;const S=(A=Z==null?void 0:Z.host)!==null&&A!==void 0?A:"bitbucket.org";return new te("bitbucket",L,S,{default:["account","team","pullrequest","snippet","issue"],repoWrite:["pullrequest:write","snippet:write","issue:write"]})}static merge(...L){return new B(L)}isUrlSupported(L){return L.host===_class_private_field_get(this,b)}getAdditionalScopesForProvider(L){var Z;if(!(L!=null&&L.customScopes)||_class_private_field_get(this,P)==="generic")return[];var A;return(A=(Z=L.customScopes)===null||Z===void 0?void 0:Z[_class_private_field_get(this,P)])!==null&&A!==void 0?A:[]}async getCredentials(L){const{url:Z,additionalScope:A,...S}=L,q=_class_private_field_get(this,c).default.slice();A!=null&&A.repoWrite&&q.push(..._class_private_field_get(this,c).repoWrite);const Te=this.getAdditionalScopesForProvider(A);Te.length&&q.push(...Te);const Qe=[...new Set(q)],Ye=await _class_private_field_get(this,g).getAccessToken(Qe,S);return{token:Ye,headers:{Authorization:`Bearer ${Ye}`}}}constructor(L,Z,A,S){_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,Z),_class_private_field_set(this,b,A),_class_private_field_set(this,c,S),_class_private_field_set(this,P,L)}}var Q=t(79158);class X{static fromConfig(L){return Q.Lx.fromConfig(L)}}const M=(0,h.T0)({id:"integration.scmintegrations"});var z=t(52322),_=t(73250),fe=t(2784);const ie=T=>{const{type:L}=T,Z=(0,h.qD)(),A=_.Z;var S;const q=L&&(S=Z.getSystemIcon(L))!==null&&S!==void 0?S:A;return(0,z.jsx)(q,{})}},79158:function(Rt,Me,t){"use strict";t.d(Me,{Lx:function(){return Qn},BT:function(){return at}});var h=t(82717),r=t.n(h),W=t(76635);function B(C){const d=new URL("http://example.com");return d.host=C,d.host===C}function g(C){try{return new URL(C),!0}catch{return!1}}function b(C,d){return{list(){return C},byUrl(y){try{const j=typeof y=="string"?new URL(y):y;return C.find(Y=>d(Y)===j.host)}catch{return}},byHost(y){return C.find(j=>d(j)===y)}}}function c(C){const{url:d,base:y,lineNumber:j}=C;try{return new URL(d),d}catch{}let Y;if(d.startsWith("/")){const{filepath:me}=r()(y);Y=new URL(y);const be=(0,W.trimEnd)(Y.pathname.substring(0,Y.pathname.length-me.length),"/");Y.pathname=`${be}${d}`}else Y=new URL(d,y);return Y.search=new URL(y).search,j&&(Y.hash=`L${j}`),Y.toString()}const P="amazonaws.com";function te(C){const d=C.getOptionalString("endpoint");var y;const j=(y=C.getOptionalBoolean("s3ForcePathStyle"))!==null&&y!==void 0?y:!1;let Y,me;if(d){try{const en=new URL(d);Y=en.host,me=en.pathname}catch{throw new Error(`invalid awsS3 integration config, endpoint '${d}' is not a valid URL`)}if(me!=="/")throw new Error(`invalid awsS3 integration config, endpoints cannot contain path, got '${d}'`)}else Y=P;const be=C.getOptionalString("accessKeyId"),De=C.getOptionalString("secretAccessKey"),pt=C.getOptionalString("roleArn"),Ft=C.getOptionalString("externalId");return{host:Y,endpoint:d,s3ForcePathStyle:j,accessKeyId:be,secretAccessKey:De,roleArn:pt,externalId:Ft}}function Q(C){const d=C.map(te);return d.some(y=>y.host===P)||d.push({host:P}),d}class X{get type(){return"awsS3"}get title(){return this.integrationConfig.host}get config(){return this.integrationConfig}resolveUrl(d){return c(d)}resolveEditUrl(d){return d}constructor(d){this.integrationConfig=d}}X.factory=({config:C})=>{var d;const y=Q((d=C.getOptionalConfigArray("integrations.awsS3"))!==null&&d!==void 0?d:[]);return b(y.map(j=>new X(j)),j=>j.config.host)};var M=t(90383),z=t(22504),_=t(69866);const fe="GB";var ie=new WeakMap,T=new WeakMap,L=new WeakMap,Z=new WeakMap,A=new WeakMap,S=new WeakMap,q=new WeakMap;class Te{static fromRepoUrl(d){const y=new URL(d);let j,Y,me;const be=y.pathname.split("/").map(Bn=>decodeURIComponent(Bn));if(be[2]==="_git"?(j=be[1],Y=me=be[3]):be[3]==="_git"?(j=be[1],Y=be[2],me=be[4]):be[4]==="_git"&&(j=`${be[1]}/${be[2]}`,Y=be[3],me=be[5]),!j||!Y||!me)throw new Error("Azure URL must point to a git repository");var De;const pt=(De=y.searchParams.get("path"))!==null&&De!==void 0?De:void 0;let Ft;const en=y.searchParams.get("version");if(en){if(en.slice(0,2)!=="GB")throw new Error("Azure URL version must point to a git branch");Ft=en.slice(2)}return new Te(y.origin,j,Y,me,pt,Ft)}toRepoUrl(){let d;return(0,M.Z)(this,L)===(0,M.Z)(this,Z)?d=(0,M.Z)(this,q).call(this,(0,M.Z)(this,T),"_git",(0,M.Z)(this,Z)):d=(0,M.Z)(this,q).call(this,(0,M.Z)(this,T),(0,M.Z)(this,L),"_git",(0,M.Z)(this,Z)),(0,M.Z)(this,A)&&d.searchParams.set("path",(0,M.Z)(this,A)),(0,M.Z)(this,S)&&d.searchParams.set("version",fe+(0,M.Z)(this,S)),d.toString()}toFileUrl(){if(!(0,M.Z)(this,A))throw new Error("Azure URL must point to a specific path to be able to download a file");const d=(0,M.Z)(this,q).call(this,(0,M.Z)(this,T),(0,M.Z)(this,L),"_apis","git","repositories",(0,M.Z)(this,Z),"items");return d.searchParams.set("api-version","6.0"),d.searchParams.set("path",(0,M.Z)(this,A)),(0,M.Z)(this,S)&&d.searchParams.set("version",(0,M.Z)(this,S)),d.toString()}toArchiveUrl(){const d=(0,M.Z)(this,q).call(this,(0,M.Z)(this,T),(0,M.Z)(this,L),"_apis","git","repositories",(0,M.Z)(this,Z),"items");return d.searchParams.set("recursionLevel","full"),d.searchParams.set("download","true"),d.searchParams.set("api-version","6.0"),(0,M.Z)(this,A)&&d.searchParams.set("scopePath",(0,M.Z)(this,A)),(0,M.Z)(this,S)&&d.searchParams.set("version",(0,M.Z)(this,S)),d.toString()}toCommitsUrl(){const d=(0,M.Z)(this,q).call(this,(0,M.Z)(this,T),(0,M.Z)(this,L),"_apis","git","repositories",(0,M.Z)(this,Z),"commits");return d.searchParams.set("api-version","6.0"),(0,M.Z)(this,S)&&d.searchParams.set("searchCriteria.itemVersion.version",(0,M.Z)(this,S)),d.toString()}getOwner(){return(0,M.Z)(this,T)}getProject(){return(0,M.Z)(this,L)}getRepo(){return(0,M.Z)(this,Z)}getPath(){return(0,M.Z)(this,A)}getRef(){return(0,M.Z)(this,S)}constructor(d,y,j,Y,me,be){(0,z.Z)(this,ie,{writable:!0,value:void 0}),(0,z.Z)(this,T,{writable:!0,value:void 0}),(0,z.Z)(this,L,{writable:!0,value:void 0}),(0,z.Z)(this,Z,{writable:!0,value:void 0}),(0,z.Z)(this,A,{writable:!0,value:void 0}),(0,z.Z)(this,S,{writable:!0,value:void 0}),(0,z.Z)(this,q,{writable:!0,value:(...De)=>{const pt=new URL((0,M.Z)(this,ie));return pt.pathname=De.map(Ft=>encodeURIComponent(Ft)).join("/"),pt}}),(0,_.Z)(this,ie,d),(0,_.Z)(this,T,y),(0,_.Z)(this,L,j),(0,_.Z)(this,Z,Y),(0,_.Z)(this,A,me),(0,_.Z)(this,S,be)}}const Qe="dev.azure.com";function Ye(C){var d;const y=(d=C.getOptionalString("host"))!==null&&d!==void 0?d:Qe,j=C.getOptionalString("token");if(!B(y))throw new Error(`Invalid Azure integration config, '${y}' is not a valid host`);return{host:y,token:j}}function Xe(C){const d=C.map(Ye);return d.some(y=>y.host===Qe)||d.push({host:Qe}),d}class Ve{get type(){return"azure"}get title(){return this.integrationConfig.host}get config(){return this.integrationConfig}resolveUrl(d){const{url:y,base:j}=d;if(g(y))return y;try{const me=Te.fromRepoUrl(j),be=new URL(j);var Y;const De=new URL(`https://a.com${(Y=me.getPath())!==null&&Y!==void 0?Y:""}`),pt=new URL(y,De).pathname;return be.searchParams.set("path",pt),d.lineNumber&&(be.searchParams.set("line",String(d.lineNumber)),be.searchParams.set("lineEnd",String(d.lineNumber+1)),be.searchParams.set("lineStartColumn","1"),be.searchParams.set("lineEndColumn","1")),be.toString()}catch{return new URL(y,j).toString()}}resolveEditUrl(d){return d}constructor(d){this.integrationConfig=d}}Ve.factory=({config:C})=>{var d;const y=Xe((d=C.getOptionalConfigArray("integrations.azure"))!==null&&d!==void 0?d:[]);return b(y.map(j=>new Ve(j)),j=>j.config.host)};var ft=t(48834).lW;function je(C){return AzureUrl.fromRepoUrl(C).toFileUrl()}function Ge(C){return AzureUrl.fromRepoUrl(C).toArchiveUrl()}function st(C){return AzureUrl.fromRepoUrl(C).toCommitsUrl()}function gt(C,d){const y=d?{...d}:{};if(C.token){const j=ft.from(`:${C.token}`,"utf8");y.Authorization=`Basic ${j.toString("base64")}`}return{headers:y}}const rt="bitbucket.org",ot="https://api.bitbucket.org/2.0";function ct(C){var d;const y=(d=C.getOptionalString("host"))!==null&&d!==void 0?d:rt;let j=C.getOptionalString("apiBaseUrl");const Y=C.getOptionalString("token"),me=C.getOptionalString("username"),be=C.getOptionalString("appPassword");if(!B(y))throw new Error(`Invalid Bitbucket integration config, '${y}' is not a valid host`);return j?j=(0,W.trimEnd)(j,"/"):y===rt?j=ot:j=`https://${y}/rest/api/1.0`,{host:y,apiBaseUrl:j,token:Y,username:me,appPassword:be}}function yt(C){const d=C.map(ct);return d.some(y=>y.host===rt)||d.push({host:rt,apiBaseUrl:ot}),d}class Lt{get type(){return"bitbucket"}get title(){return this.integrationConfig.host}get config(){return this.integrationConfig}resolveUrl(d){const y=c(d);if(!d.lineNumber)return y;const j=new URL(y);return this.integrationConfig.host==="bitbucket.org"?j.hash=`lines-${d.lineNumber}`:j.hash=`${d.lineNumber}`,j.toString()}resolveEditUrl(d){const y=r()(d),j=new URL(d);return j.searchParams.set("mode","edit"),j.searchParams.set("spa","0"),j.searchParams.set("at",y.ref),j.toString()}constructor(d){this.integrationConfig=d}}Lt.factory=({config:C})=>{var d,y,j;const Y=yt((j=C.getOptionalConfigArray("integrations.bitbucket"))!==null&&j!==void 0?j:[...(d=C.getOptionalConfigArray("integrations.bitbucketCloud"))!==null&&d!==void 0?d:[],...(y=C.getOptionalConfigArray("integrations.bitbucketServer"))!==null&&y!==void 0?y:[]]);return b(Y.map(me=>new Lt(me)),me=>me.config.host)};var We=t(96279),se=t(48834).lW;async function Ie(C,d){const{name:y,owner:j,resource:Y}=parseGitUrl(C),me=Y==="bitbucket.org";let be=me?`${d.apiBaseUrl}/repositories/${j}/${y}`:`${d.apiBaseUrl}/projects/${j}/repos/${y}/default-branch`,De=await fetch(be,mt(d));if(De.status===404&&!me&&(be=`${d.apiBaseUrl}/projects/${j}/repos/${y}/branches/default`,De=await fetch(be,mt(d))),!De.ok){const Ft=`Failed to retrieve default branch from ${be}, ${De.status} ${De.statusText}`;throw new Error(Ft)}let pt;if(me)pt=(await De.json()).mainbranch.name;else{const{displayId:Ft}=await De.json();pt=Ft}if(!pt)throw new Error(`Failed to read default branch from ${be}. Response ${De.status} ${De.json()}`);return pt}async function Re(C,d){const{name:y,owner:j,ref:Y,protocol:me,resource:be,filepath:De}=parseGitUrl(C),pt=be==="bitbucket.org";let Ft=Y;Ft||(Ft=await Ie(C,d));const en=De?`&path=${encodeURIComponent(decodeURIComponent(De))}`:"";return pt?`${me}://${be}/${j}/${y}/get/${Ft}.tar.gz`:`${d.apiBaseUrl}/projects/${j}/repos/${y}/archive?format=tgz&at=${Ft}&prefix=${j}-${y}${en}`}function tt(C,d){try{const{owner:y,name:j,ref:Y,filepathtype:me,filepath:be}=parseGitUrl(C);if(!y||!j||me!=="browse"&&me!=="raw"&&me!=="src")throw new Error("Invalid Bitbucket URL or file path");const De=be.replace(/^\//,"");if(d.host==="bitbucket.org"){if(!Y)throw new Error("Invalid Bitbucket URL or file path");return`${d.apiBaseUrl}/repositories/${y}/${j}/src/${Y}/${De}`}return`${d.apiBaseUrl}/projects/${y}/repos/${j}/raw/${De}?at=${Y}`}catch(y){throw new Error(`Incorrect URL: ${C}, ${y}`)}}function mt(C){const d={};if(C.token)d.Authorization=`Bearer ${C.token}`;else if(C.username&&C.appPassword){const y=se.from(`${C.username}:${C.appPassword}`,"utf8");d.Authorization=`Basic ${y.toString("base64")}`}return{headers:d}}const Zt="bitbucket.org",dt="https://api.bitbucket.org/2.0";function Et(C){const d=Zt,y=dt,j=C.getString("username"),Y=C.getString("appPassword");return{host:d,apiBaseUrl:y,username:j,appPassword:Y}}function At(C){const d=C.map(Et);return d.length===0&&d.push({host:Zt,apiBaseUrl:dt}),d}class Ot{get type(){return"bitbucketCloud"}get title(){return this.integrationConfig.host}get config(){return this.integrationConfig}resolveUrl(d){const y=c(d);if(d.lineNumber){const j=new URL(y);return j.hash=`lines-${d.lineNumber}`,j.toString()}return y}resolveEditUrl(d){const y=r()(d),j=new URL(d);return j.searchParams.set("mode","edit"),j.searchParams.set("at",y.ref),j.toString()}constructor(d){this.integrationConfig=d}}Ot.factory=({config:C})=>{var d;const y=At((d=C.getOptionalConfigArray("integrations.bitbucketCloud"))!==null&&d!==void 0?d:[]);return b(y.map(j=>new Ot(j)),j=>j.config.host)};var qt=t(48834).lW;async function Vt(C,d){const{name:y,owner:j}=parseGitUrl(C),Y=`${d.apiBaseUrl}/repositories/${j}/${y}`,me=await fetch(Y,dn(d));if(!me.ok){const pt=`Failed to retrieve default branch from ${Y}, ${me.status} ${me.statusText}`;throw new Error(pt)}const De=(await me.json()).mainbranch.name;if(!De)throw new Error(`Failed to read default branch from ${Y}. Response ${me.status} ${me.json()}`);return De}async function Ht(C,d){const{name:y,owner:j,ref:Y,protocol:me,resource:be}=parseGitUrl(C);let De=Y;return De||(De=await Vt(C,d)),`${me}://${be}/${j}/${y}/get/${De}.tar.gz`}function Jt(C,d){try{const{owner:y,name:j,ref:Y,filepathtype:me,filepath:be}=parseGitUrl(C);if(!y||!j||me!=="src"&&me!=="raw")throw new Error("Invalid Bitbucket Cloud URL or file path");const De=be.replace(/^\//,"");if(!Y)throw new Error("Invalid Bitbucket Cloud URL or file path");return`${d.apiBaseUrl}/repositories/${y}/${j}/src/${Y}/${De}`}catch(y){throw new Error(`Incorrect URL: ${C}, ${y}`)}}function dn(C){const d={};if(C.username&&C.appPassword){const y=qt.from(`${C.username}:${C.appPassword}`,"utf8");d.Authorization=`Basic ${y.toString("base64")}`}return{headers:d}}function an(C){const d=C.getString("host");let y=C.getOptionalString("apiBaseUrl");const j=C.getOptionalString("token"),Y=C.getOptionalString("username"),me=C.getOptionalString("password");if(!B(d))throw new Error(`Invalid Bitbucket Server integration config, '${d}' is not a valid host`);return y?y=(0,W.trimEnd)(y,"/"):y=`https://${d}/rest/api/1.0`,{host:d,apiBaseUrl:y,token:j,username:Y,password:me}}function Fn(C){return C.map(an)}class En{get type(){return"bitbucketServer"}get title(){return this.integrationConfig.host}get config(){return this.integrationConfig}resolveUrl(d){const y=c(d);if(d.lineNumber){const j=new URL(y);return j.hash=d.lineNumber.toString(),j.toString()}return y}resolveEditUrl(d){return d.includes("?")?d.substring(0,d.indexOf("?")):d}constructor(d){this.integrationConfig=d}}En.factory=({config:C})=>{var d;const y=Fn((d=C.getOptionalConfigArray("integrations.bitbucketServer"))!==null&&d!==void 0?d:[]);return b(y.map(j=>new En(j)),j=>j.config.host)};var Un=t(48834).lW;async function mn(C,d){const{name:y,owner:j}=parseGitUrl(C);let Y=`${d.apiBaseUrl}/projects/${j}/repos/${y}/default-branch`,me=await fetch(Y,Mn(d));if(me.status===404&&(Y=`${d.apiBaseUrl}/projects/${j}/repos/${y}/branches/default`,me=await fetch(Y,Mn(d))),!me.ok){const pt=`Failed to retrieve default branch from ${Y}, ${me.status} ${me.statusText}`;throw new Error(pt)}const{displayId:be}=await me.json(),De=be;if(!De)throw new Error(`Failed to read default branch from ${Y}. Response ${me.status} ${me.json()}`);return De}async function un(C,d){const{name:y,owner:j,ref:Y,filepath:me}=parseGitUrl(C);let be=Y;be||(be=await mn(C,d));const De=me?`&path=${encodeURIComponent(decodeURIComponent(me))}`:"";return`${d.apiBaseUrl}/projects/${j}/repos/${y}/archive?format=tgz&at=${be}&prefix=${j}-${y}${De}`}function Qt(C,d){try{const{owner:y,name:j,ref:Y,filepathtype:me,filepath:be}=parseGitUrl(C);if(!y||!j||me!=="browse"&&me!=="raw"&&me!=="src")throw new Error("Invalid Bitbucket Server URL or file path");const De=be.replace(/^\//,"");return`${d.apiBaseUrl}/projects/${y}/repos/${j}/raw/${De}?at=${Y}`}catch(y){throw new Error(`Incorrect URL: ${C}, ${y}`)}}function Mn(C){const d={};if(C.token)d.Authorization=`Bearer ${C.token}`;else if(C.username&&C.password){const y=Un.from(`${C.username}:${C.password}`,"utf8");d.Authorization=`Basic ${y.toString("base64")}`}return{headers:d}}function zn(C){const d=C.getString("host");let y=C.getOptionalString("baseUrl"),j=C.getOptionalString("cloneUrl"),Y=C.getOptionalString("gitilesBaseUrl");const me=C.getOptionalString("username"),be=C.getOptionalString("password");if(B(d)){if(y&&!g(y))throw new Error(`Invalid Gerrit integration config, '${y}' is not a valid baseUrl`);if(j&&!g(j))throw new Error(`Invalid Gerrit integration config, '${j}' is not a valid cloneUrl`);if(Y&&!g(Y))throw new Error(`Invalid Gerrit integration config, '${Y}' is not a valid gitilesBaseUrl`)}else throw new Error(`Invalid Gerrit integration config, '${d}' is not a valid host`);return y?y=(0,W.trimEnd)(y,"/"):y=`https://${d}`,Y?Y=(0,W.trimEnd)(Y,"/"):Y=`https://${d}`,j?j=(0,W.trimEnd)(j,"/"):j=y,{host:d,baseUrl:y,cloneUrl:j,gitilesBaseUrl:Y,username:me,password:be}}function hn(C){return C.map(zn)}var vn=t(48834).lW;const yn=")]}'";function Ln(C,d){const j=d.replace(C.gitilesBaseUrl,"").split("/").filter(Ft=>!!Ft),Y=j.indexOf("+");if(Y<=0)throw new Error(`Unable to parse project from url: ${d}`);const me=(0,W.trimStart)(j.slice(0,Y).join("/"),"/"),be=j.indexOf("heads");if(be<=0)throw new Error(`Unable to parse branch from url: ${d}`);const De=j[be+1],pt=j.slice(be+2).join("/");return{branch:De,filePath:pt===""?"/":pt,project:me}}function Pn(C,d,y,j){return`${C.gitilesBaseUrl}/${d}/+/refs/heads/${y}/${(0,W.trimStart)(j,"/")}`}function xn(C){return C.password?"/a/":"/"}function ge(C,d){const{branch:y,project:j}=Ln(C,d);return`${C.baseUrl}${xn(C)}projects/${encodeURIComponent(j)}/branches/${y}`}function ee(C,d){const{project:y}=Ln(C,d);return`${C.cloneUrl}${xn(C)}${y}`}function Ee(C,d){const{branch:y,filePath:j,project:Y}=Ln(C,d);return`${C.baseUrl}${xn(C)}projects/${encodeURIComponent(Y)}/branches/${y}/files/${encodeURIComponent(j)}/content`}function Ne(C){return`${C.baseUrl}${xn(C)}projects/`}function _e(C){const d={};if(!C.password)return d;const y=vn.from(`${C.username}:${C.password}`,"utf8");return d.Authorization=`Basic ${y.toString("base64")}`,{headers:d}}async function wt(C){const d=await C.text();if(d.startsWith(yn))try{return JSON.parse(d.slice(yn.length))}catch(y){throw new Error(`Invalid response from Gerrit: ${d.slice(0,10)} - ${y}`)}throw new Error(`Gerrit JSON body prefix missing. Found: ${d.slice(0,10)}`)}class ae{get type(){return"gerrit"}get title(){return this.integrationConfig.host}get config(){return this.integrationConfig}resolveUrl(d){const{url:y,base:j,lineNumber:Y}=d;let me;if(y.startsWith("/")){const{branch:be,project:De}=Ln(this.config,j);return Pn(this.config,De,be,y)}return y?me=new URL(y,j):me=new URL(j),Y&&(me.hash=Y.toString()),me.toString()}resolveEditUrl(d){return d}constructor(d){this.integrationConfig=d}}ae.factory=({config:C})=>{var d;const y=hn((d=C.getOptionalConfigArray("integrations.gerrit"))!==null&&d!==void 0?d:[]);return b(y.map(j=>new ae(j)),j=>j.config.host)};function k(C){const d=C.getString("host");let y=C.getOptionalString("baseUrl");const j=C.getOptionalString("username"),Y=C.getOptionalString("password");if(!B(d))throw new Error(`Invalid Gitea integration config, '${d}' is not a valid host`);return y?y=(0,W.trimEnd)(y,"/"):y=`https://${d}`,{host:d,baseUrl:y,username:j,password:Y}}var ce=t(48834).lW;function Oe(C,d){try{var y;const j=(y=C.baseUrl)!==null&&y!==void 0?y:`https://${C.host}`,[Y,me,be,De,pt,Ft,...en]=d.replace(j,"").split("/"),Bn=en.join("/").replace(/^\//,"");return`${j}/${me}/${be}/_edit/${Ft}/${Bn}`}catch(j){throw new Error(`Incorrect URL: ${d}, ${j}`)}}function D(C,d){try{var y;const j=(y=C.baseUrl)!==null&&y!==void 0?y:`https://${C.host}`,[Y,me,be,De,pt,Ft,...en]=d.replace(j,"").split("/"),Bn=en.join("/").replace(/^\//,"");return`${j}/api/v1/repos/${me}/${be}/contents/${Bn}?ref=${Ft}`}catch(j){throw new Error(`Incorrect URL: ${d}, ${j}`)}}function U(C){const d={},{username:y,password:j}=C;return j?(y?d.Authorization=`basic ${ce.from(`${y}:${j}`).toString("base64")}`:d.Authorization=`token ${j}`,{headers:d}):d}class de{get type(){return"gitea"}get title(){return this.config.host}resolveUrl(d){return c(d)}resolveEditUrl(d){return Oe(this.config,d)}constructor(d){this.config=d}}de.factory=({config:C})=>{var d;const j=((d=C.getOptionalConfigArray("integrations.gitea"))!==null&&d!==void 0?d:[]).map(Y=>k(Y));return b(j.map(Y=>new de(Y)),Y=>Y.config.host)};const pe="github.com",ye="https://api.github.com",Pe="https://raw.githubusercontent.com";function Le(C){var d,y;const j=(y=C.getOptionalString("host"))!==null&&y!==void 0?y:pe;let Y=C.getOptionalString("apiBaseUrl"),me=C.getOptionalString("rawBaseUrl");const be=C.getOptionalString("token"),De=(d=C.getOptionalConfigArray("apps"))===null||d===void 0?void 0:d.map(pt=>({appId:pt.getNumber("appId"),clientId:pt.getString("clientId"),clientSecret:pt.getString("clientSecret"),webhookSecret:pt.getString("webhookSecret"),privateKey:pt.getString("privateKey"),allowedInstallationOwners:pt.getOptionalStringArray("allowedInstallationOwners")}));if(!B(j))throw new Error(`Invalid GitHub integration config, '${j}' is not a valid host`);return Y?Y=(0,W.trimEnd)(Y,"/"):j===pe&&(Y=ye),me?me=(0,W.trimEnd)(me,"/"):j===pe&&(me=Pe),{host:j,apiBaseUrl:Y,rawBaseUrl:me,token:be,apps:De}}function Ue(C){const d=C.map(Le);return d.some(y=>y.host===pe)||d.push({host:pe,apiBaseUrl:ye,rawBaseUrl:Pe}),d}function nt(C,d,y){try{const{owner:j,name:Y,ref:me,filepathtype:be,filepath:De}=parseGitUrl(C);if(!j||!Y||!me||be!=="blob"&&be!=="raw"&&be!=="tree")throw new Error("Invalid GitHub URL or file path");const pt=De.replace(/^\//,"");return H(d,y)==="api"?`${d.apiBaseUrl}/repos/${j}/${Y}/contents/${pt}?ref=${me}`:`${d.rawBaseUrl}/${j}/${Y}/${me}/${pt}`}catch(j){throw new Error(`Incorrect URL: ${C}, ${j}`)}}function w(C,d){const y={};return H(C,d)==="api"&&(y.Accept="application/vnd.github.v3.raw"),d.token&&(y.Authorization=`token ${d.token}`),{headers:y}}function H(C,d){return C.apiBaseUrl&&(d.token||!C.rawBaseUrl)?"api":"raw"}var ve=t(42822),ue=t(89393),we=t(26228);class ke{async getOrCreateToken(d,y,j){let Y=this.tokenCache.get(d);if((!Y||this.isExpired(Y.expiresAt))&&(Y=await j(),Y.expiresAt=Y.expiresAt.minus({minutes:10}),this.tokenCache.set(d,Y)),!this.appliesToRepo(Y,y))throw new Error(`The Backstage GitHub application used in the ${d} organization does not have access to a repository with the name ${y}`);return{accessToken:Y.token}}appliesToRepo(d,y){return y===void 0?!0:d.repositories!==void 0?d.repositories.includes(y):!0}constructor(){this.tokenCache=new Map,this.isExpired=d=>we.ou.local()>d}}const Fe={Accept:"application/vnd.github.machine-man-preview+json"};class it{async getInstallationCredentials(d,y){if(this.allowedInstallationOwners){var j;if(!(!((j=this.allowedInstallationOwners)===null||j===void 0)&&j.includes(d)))return{accessToken:void 0}}return this.cache.getOrCreateToken(d,y,async()=>{const{installationId:Y,suspended:me}=await this.getInstallationData(d);if(me)throw new Error(`The GitHub application for ${d} is suspended`);const be=await this.appClient.apps.createInstallationAccessToken({installation_id:Y,headers:Fe});let De;if(be.data.repository_selection==="selected"){const Ft=new ue.v({baseUrl:this.baseUrl,auth:be.data.token}),en=await Ft.paginate(Ft.apps.listReposAccessibleToInstallation);var pt;De=((pt=en.repositories)!==null&&pt!==void 0?pt:en).map(Er=>Er.name)}return{token:be.data.token,expiresAt:we.ou.fromISO(be.data.expires_at),repositories:De}})}getInstallations(){return this.appClient.paginate(this.appClient.apps.listInstallations)}async getInstallationData(d){const j=(await this.getInstallations()).find(me=>{var be,De;return((be=me.account)===null||be===void 0||(De=be.login)===null||De===void 0?void 0:De.toLocaleLowerCase("en-US"))===d.toLocaleLowerCase("en-US")});if(j)return{installationId:j.id,suspended:Boolean(j.suspended_by)};const Y=new Error(`No app installation found for ${d} in ${this.baseAuthConfig.appId}`);throw Y.name="NotFoundError",Y}constructor(d,y){this.cache=new ke,this.allowedInstallationOwners=d.allowedInstallationOwners,this.baseUrl=y,this.baseAuthConfig={appId:d.appId,privateKey:d.privateKey.replace(/\\n/gm,`
|
|
33
|
-
`)},this.appClient=new ue.v({baseUrl:y,headers:Fe,authStrategy:ve.i,auth:this.baseAuthConfig})}}class Ct{async getAllInstallations(){return this.apps.length?(await Promise.all(this.apps.map(y=>y.getInstallations()))).flat():[]}async getAppToken(d,y){if(this.apps.length===0)return;const j=await Promise.all(this.apps.map(De=>De.getInstallationCredentials(d,y).then(pt=>({credentials:pt,error:void 0}),pt=>({credentials:void 0,error:pt})))),Y=j.find(De=>De.credentials);if(Y)return Y.credentials.accessToken;const be=j.map(De=>De.error).find(De=>De.name!=="NotFoundError");if(be)throw be}constructor(d){var y,j;this.apps=(j=(y=d.apps)===null||y===void 0?void 0:y.map(Y=>new it(Y,d.apiBaseUrl)))!==null&&j!==void 0?j:[]}}class Ke{async getCredentials(d){const y=r()(d.url),j=y.owner||y.name,Y=y.owner?y.name:void 0;let me="app",be=await this.githubAppCredentialsMux.getAppToken(j,Y);return be||(me="token",be=this.token),{headers:be?{Authorization:`Bearer ${be}`}:void 0,token:be,type:me}}constructor(d,y){this.githubAppCredentialsMux=d,this.token=y}}Ke.create=C=>new Ke(new Ct(C),C.token);class ht{static fromIntegrations(d){const y=new Map;return d.github.list().forEach(j=>{const Y=SingleInstanceGithubCredentialsProvider.create(j.config);y.set(j.config.host,Y)}),new ht(y)}async getCredentials(d){const y=new URL(d.url),j=this.providers.get(y.host);if(!j)throw new Error(`There is no GitHub integration that matches ${d.url}. Please add a configuration for an integration.`);return j.getCredentials(d)}constructor(d){this.providers=d}}class vt{get type(){return"github"}get title(){return this.integrationConfig.host}get config(){return this.integrationConfig}resolveUrl(d){return at(c(d),"tree")}resolveEditUrl(d){return at(d,"edit")}constructor(d){this.integrationConfig=d}}vt.factory=({config:C})=>{var d;const y=Ue((d=C.getOptionalConfigArray("integrations.github"))!==null&&d!==void 0?d:[]);return b(y.map(j=>new vt(j)),j=>j.config.host)};function at(C,d){return C.replace(/\/\/([^/]+)\/([^/]+)\/([^/]+)\/(blob|tree|edit)\//,(y,j,Y,me)=>`//${j}/${Y}/${me}/${d}/`)}const Tt=null;class Ut extends vt{get config(){return super.config}constructor(d){super(d)}}Ut.factory=vt.factory;const Mt=null,Wn=null,Vn=null,bn="gitlab.com",Nt="https://gitlab.com/api/v4";function zt(C){const d=C.getString("host");let y=C.getOptionalString("apiBaseUrl");const j=C.getOptionalString("token");let Y=C.getOptionalString("baseUrl");if(y?y=(0,W.trimEnd)(y,"/"):d===bn&&(y=Nt),Y?Y=(0,W.trimEnd)(Y,"/"):Y=`https://${d}`,B(d)){if(!y||!g(y))throw new Error(`Invalid GitLab integration config, '${y}' is not a valid apiBaseUrl`);if(!g(Y))throw new Error(`Invalid GitLab integration config, '${Y}' is not a valid baseUrl`)}else throw new Error(`Invalid GitLab integration config, '${d}' is not a valid host`);return{host:d,token:j,apiBaseUrl:y,baseUrl:Y}}function _t(C){const d=C.map(zt);return d.some(y=>y.host===bn)||d.push({host:bn,apiBaseUrl:Nt,baseUrl:`https://${bn}`}),d}function kn(C){let d="";return C.host!==bn&&(d=new URL(C.baseUrl).pathname),trimEnd(d,"/")}async function Jn(C,d){const y=await Hn(C,d);return pn(C,y,d).toString()}function Sn(C){const{token:d=""}=C;return{headers:{"PRIVATE-TOKEN":d}}}function pn(C,d,y){try{const j=new URL(C),Y=j.pathname.split("/blob/").slice(1).join("/blob/"),[me,...be]=Y.split("/"),De=getGitLabIntegrationRelativePath(y);return j.pathname=[...De?[De]:[],"api/v4/projects",d,"repository/files",encodeURIComponent(decodeURIComponent(be.join("/"))),"raw"].join("/"),j.search=`?ref=${me}`,j}catch(j){throw new Error(`Incorrect url: ${C}, ${j}`)}}async function Hn(C,d){const y=new URL(C);if(!y.pathname.includes("/blob/"))throw new Error("Please provide full path to yaml file from GitLab");try{let j=y.pathname.split("/-/blob/")[0].split("/blob/")[0];const Y=getGitLabIntegrationRelativePath(d);Y&&(j=j.replace(Y,""));const me=new URL(`${y.origin}${Y}/api/v4/projects/${encodeURIComponent(j.replace(/^\//,""))}`),be=await fetch(me.toString(),Sn(d)),De=await be.json();if(!be.ok)throw new Error(`GitLab Error '${De.error}', ${De.error_description}`);return Number(De.id)}catch(j){throw new Error(`Could not get GitLab project ID for: ${C}, ${j}`)}}class ln{get type(){return"gitlab"}get title(){return this.integrationConfig.host}get config(){return this.integrationConfig}resolveUrl(d){return c(d)}resolveEditUrl(d){return On(d,"edit")}constructor(d){this.integrationConfig=d}}ln.factory=({config:C})=>{var d;const y=_t((d=C.getOptionalConfigArray("integrations.gitlab"))!==null&&d!==void 0?d:[]);return b(y.map(j=>new ln(j)),j=>j.config.host)};function On(C,d){return C.replace(/\/\-\/(blob|tree|edit)\//,`/-/${d}/`)}class Qn{static fromConfig(d){return new Qn({awsS3:X.factory({config:d}),azure:Ve.factory({config:d}),bitbucket:Lt.factory({config:d}),bitbucketCloud:Ot.factory({config:d}),bitbucketServer:En.factory({config:d}),gerrit:ae.factory({config:d}),github:vt.factory({config:d}),gitlab:ln.factory({config:d}),gitea:de.factory({config:d})})}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(d=>d.list())}byUrl(d){let y=Object.values(this.byType).map(j=>j.byUrl(d)).filter(Boolean);if(y.length>1){const j=y.filter(Y=>!(Y instanceof Lt));j.length!==0&&(y=j)}return y[0]}byHost(d){return Object.values(this.byType).map(y=>y.byHost(d)).find(Boolean)}resolveUrl(d){const y=this.byUrl(d.base);return y?y.resolveUrl(d):c(d)}resolveEditUrl(d){const y=this.byUrl(d);return y?y.resolveEditUrl(d):d}constructor(d){this.byType=d}}},51102:function(Rt,Me,t){"use strict";var h={};t.r(h),t.d(h,{TechDocsPlugin:function(){return S.s4}});var r=t(52322),W=t(2784),B=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),Q=t(95481),X=t(7476),M=t(93225),z=t(67896),_=t(65124),fe=t(17339),ie=t(85478),T=t(68435),L=t(3482),Z=t(42081),A=t(48431),S=t(89258),q=t(52943),Te=t(61886),Qe=t(13980),Ye=t.n(Qe);class Xe{get(n){for(const o of this.holders){const l=o.get(n);if(l)return l}}constructor(...n){this.holders=n}}var Ve=t(51837);const ft=(0,Ve.CT)("api-context"),je=a=>{var n;const{apis:o,children:l}=a,f=(n=(0,W.useContext)(ft))===null||n===void 0?void 0:n.atVersion(1),R=f?new Xe(o,f):o;return(0,r.jsx)(ft.Provider,{value:(0,Ve.EI)({1:R}),children:l})};je.propTypes={apis:Ye().shape({get:Ye().func.isRequired}).isRequired,children:Ye().node};class Ge{static validateFactories(n,o){for(const l of o){const f=[l],R=new Set;for(;f.length;){const N=f.shift(),V=n.get(N);if(!!V)for(const ne of Object.values(V.deps)){if(ne.id===l.id)throw new Error(`Circular dependency of api factory for ${l}`);R.has(ne)||(R.add(ne),f.push(ne))}}}}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 R=this.loadDeps(n,f.deps,[...o,f.api]),N=f.factory(R);return this.apis.set(n.id,N),N}loadDeps(n,o,l){const f={};for(const R in o)if(o.hasOwnProperty(R)){const N=o[R],V=this.load(N,l);if(!V)throw new Error(`No API factory available for dependency ${N} of dependent ${n}`);f[R]=V}return f}constructor(n){this.factories=n,this.apis=new Map}}var st;(function(a){a[a.default=10]="default",a[a.app=50]="app",a[a.static=100]="static"})(st||(st={}));class gt{register(n,o){const l=st[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 rt(a){return new Promise((n,o)=>{const l=a.width||500,f=a.height||700,R=window.screen.width/2-l/2,N=window.screen.height/2-f/2,V=window.open(a.url,a.name,`menubar=no,location=no,resizable=no,scrollbars=no,status=no,width=${l},height=${f},top=${N},left=${R}`);let ne="";if(!V||typeof V.closed=="undefined"||V.closed){const lt=new Error("Failed to open auth popup.");lt.name="PopupRejectedError",o(lt);return}const ze=lt=>{if(lt.source!==V||lt.origin!==a.origin)return;const{data:bt}=lt;if(bt.type==="config_info"){ne=bt.targetOrigin;return}if(bt.type!=="authorization_response")return;const St=bt;if("error"in St){const Bt=new Error(St.error.message);Bt.name=St.error.name,o(Bt)}else n(St.response);ut()},Ze=setInterval(()=>{if(V.closed){const lt=`Login failed, ${ne&&ne!==window.location.origin?`Incorrect app origin, expected ${ne}`:"popup was closed"}`,bt=new Error(lt);bt.name="PopupClosedError",o(bt),ut()}},100);function ut(){window.removeEventListener("message",ze),clearInterval(Ze)}window.addEventListener("message",ze)})}function ot(a){return[...a].join(" ")}class ct{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 rt({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:R=ot,oauthRequestApi:N,sessionTransform:V=ne=>ne}=n;this.authRequester=N.createAuthRequester({provider:f,onAuthRequest:ne=>this.showPopup(ne)}),this.discoveryApi=o,this.environment=l,this.provider=f,this.joinScopesFunc=R,this.sessionTransform=V}}function yt(a,n){for(const o of n)if(!a.has(o))return!1;return!0}class Lt{sessionExistsAndHasScope(n,o){if(!n)return!1;if(!o||this.options.sessionScopes===void 0)return!0;const l=this.options.sessionScopes(n);return yt(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 R of f)l.add(R)}if(o)for(const f of o)l.add(f);return l}constructor(n){this.options=n}}var We=t(82394),se=t.n(We);let Ie=Symbol.observable;class Re{[Ie](){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(se())(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 mt{[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(se())(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 mt(b.sM.SignedOut),this.signedIn=!1}}class dt{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),R=this.sessionScopesFunc(l);return yt(R,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:R}=n;this.connector=o,this.sessionScopesFunc=f,this.sessionShouldRefreshFunc=R,this.helper=new Lt({sessionScopes:f,defaultScopes:l})}}class Et{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 At={id:"oauth2",title:"Your Identity Provider",icon:()=>null};class Ot{static create(n){const{discoveryApi:o,environment:l="development",provider:f=At,oauthRequestApi:R,defaultScopes:N=[],scopeTransform:V=Ze=>Ze}=n,ne=new ct({discoveryApi:o,environment:l,provider:f,oauthRequestApi:R,sessionTransform(Ze){return{...Ze,providerInfo:{idToken:Ze.providerInfo.idToken,accessToken:Ze.providerInfo.accessToken,scopes:Ot.normalizeScopes(V,Ze.providerInfo.scope),expiresAt:new Date(Date.now()+Ze.providerInfo.expiresInSeconds*1e3)}}}}),ze=new dt({connector:ne,defaultScopes:new Set(N),sessionScopes:Ze=>Ze.providerInfo.scopes,sessionShouldRefresh:Ze=>(Ze.providerInfo.expiresAt.getTime()-Date.now())/1e3<60*5});return new Ot({sessionManager:ze,scopeTransform:V})}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 R;return(R=f==null?void 0:f.providerInfo.accessToken)!==null&&R!==void 0?R:""}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 qt={id:"github",title:"GitHub",icon:()=>null};class Vt{static create(n){const{discoveryApi:o,environment:l="development",provider:f=qt,oauthRequestApi:R,defaultScopes:N=["read:user"]}=n;return Ot.create({discoveryApi:o,oauthRequestApi:R,provider:f,environment:l,defaultScopes:N})}}const Ht={id:"gitlab",title:"GitLab",icon:()=>null};class Jt{static create(n){const{discoveryApi:o,environment:l="development",provider:f=Ht,oauthRequestApi:R,defaultScopes:N=["read_user"]}=n;return Ot.create({discoveryApi:o,oauthRequestApi:R,provider:f,environment:l,defaultScopes:N})}}const dn={id:"google",title:"Google",icon:()=>null},an="https://www.googleapis.com/auth/";class Fn{static create(n){const{discoveryApi:o,oauthRequestApi:l,environment:f="development",provider:R=dn,defaultScopes:N=["openid",`${an}userinfo.email`,`${an}userinfo.profile`]}=n;return Ot.create({discoveryApi:o,oauthRequestApi:l,provider:R,environment:f,defaultScopes:N,scopeTransform(V){return V.map(ne=>ne==="openid"?ne:ne==="profile"||ne==="email"?`${an}userinfo.${ne}`:ne.startsWith(an)?ne:`${an}${ne}`)}})}}const En={id:"okta",title:"Okta",icon:()=>null},Un=new Set(["openid","profile","email","phone","address","groups","offline_access"]),mn="okta.";class un{static create(n){const{discoveryApi:o,environment:l="development",provider:f=En,oauthRequestApi:R,defaultScopes:N=["openid","email","profile","offline_access"]}=n;return Ot.create({discoveryApi:o,oauthRequestApi:R,provider:f,environment:l,defaultScopes:N,scopeTransform(V){return V.map(ne=>Un.has(ne)||ne.startsWith(mn)?ne:`${mn}${ne}`)}})}}var Qt=t(30195);const Mn=Qt.z.object({profile:Qt.z.object({email:Qt.z.string().optional(),displayName:Qt.z.string().optional(),picture:Qt.z.string().optional()}),backstageIdentity:Qt.z.object({token:Qt.z.string(),identity:Qt.z.object({type:Qt.z.literal("user"),userEntityRef:Qt.z.string(),ownershipEntityRefs:Qt.z.array(Qt.z.string())})})}),zn={id:"saml",title:"SAML",icon:()=>null};class hn{static create(n){const{discoveryApi:o,environment:l="development",provider:f=zn}=n,R=new DirectAuthConnector({discoveryApi:o,environment:l,provider:f}),N=new StaticAuthSessionManager({connector:R}),V=new AuthSessionStore({manager:N,storageKey:`${f.id}Session`,schema:samlSessionSchema});return new hn(V)}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 vn={id:"microsoft",title:"Microsoft",icon:()=>null};class yn{static create(n){const{environment:o="development",provider:l=vn,oauthRequestApi:f,discoveryApi:R,defaultScopes:N=["openid","offline_access","profile","email","User.Read"]}=n;return Ot.create({discoveryApi:R,oauthRequestApi:f,provider:l,environment:o,defaultScopes:N})}}const Ln={id:"onelogin",title:"onelogin",icon:()=>null},Pn=new Set(["openid","profile","email","phone","address","groups","offline_access"]),xn="onelogin.";class ge{static create(n){const{discoveryApi:o,environment:l="development",provider:f=Ln,oauthRequestApi:R}=n;return Ot.create({discoveryApi:o,oauthRequestApi:R,provider:f,environment:l,defaultScopes:["openid","email","profile","offline_access"],scopeTransform(N){return N.map(V=>Pn.has(V)||V.startsWith(xn)?V:`${xn}${V}`)}})}}const ee={id:"bitbucket",title:"Bitbucket",icon:()=>null};class Ee{static create(n){const{discoveryApi:o,environment:l="development",provider:f=ee,oauthRequestApi:R,defaultScopes:N=["team"]}=n;return Ot.create({discoveryApi:o,oauthRequestApi:R,provider:f,environment:l,defaultScopes:N})}}const Ne={id:"atlassian",title:"Atlassian",icon:()=>null};class _e{static create(n){const{discoveryApi:o,environment:l="development",provider:f=Ne,oauthRequestApi:R}=n;return Ot.create({discoveryApi:o,oauthRequestApi:R,provider:f,environment:l})}}class wt{post(n){this.subject.next(n)}alert$(){return this.subject}constructor(){this.subject=new Re}}class ae{captureEvent(n){}}const k="theme";class ce{static createWithStorage(n){const o=new ce(n);if(!window.localStorage)return o;var l;const f=(l=window.localStorage.getItem(k))!==null&&l!==void 0?l:void 0;return o.setActiveThemeId(f),o.activeThemeId$().subscribe(R=>{R?window.localStorage.setItem(k,R):window.localStorage.removeItem(k)}),window.addEventListener("storage",R=>{if(R.key===k){var N;const V=(N=localStorage.getItem(k))!==null&&N!==void 0?N:void 0;o.setActiveThemeId(V)}}),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 mt(void 0)}}var Oe=t(9850),D=t.n(Oe),U=t(12782),de=t.n(U);const pe=/^[a-z][a-z0-9]*(?:[-_][a-z][a-z0-9]*)*$/i;function ye(a){return typeof a=="object"&&a!==null&&!Array.isArray(a)}function Pe(a){if(a===null)return"null";if(Array.isArray(a))return"array";const n=typeof a;return n==="number"&&isNaN(a)?"nan":n==="string"&&a===""?"empty-string":n}const Le={type(a,n,o,l){return`Invalid type in config for key '${a}' in '${n}', got ${o}, wanted ${l}`},missing(a){return`Missing required config value at '${a}'`},convert(a,n,o){return`Unable to convert config value for key '${a}' in '${n}' to a ${o}`}};class Ue{static fromConfigs(n){return n.length===0?new Ue(void 0):n.reduce((o,{data:l,context:f,filteredKeys:R,deprecatedKeys:N})=>{const V=new Ue(l,f,o);if(V.filteredKeys=R,N)for(const{key:ne,description:ze}of N)console.warn(`The configuration key '${ne}' of ${f} is deprecated and may be removed soon. ${ze||""}`);return V},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(Le.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 R;return f}else if(f===void 0)return l;return de()({},{value:f},{value:l},(N,V)=>!ye(V)||!ye(N)?V:void 0).value}getConfig(n){const o=this.getOptionalConfig(n);if(o===void 0)throw new Error(Le.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(ye(l))return this.copy(l,n,f);if(l!==void 0)throw new TypeError(Le.type(this.fullKey(n),this.context,Pe(l),"object"));return f}getConfigArray(n){const o=this.getOptionalConfigArray(n);if(o===void 0)throw new Error(Le.missing(this.fullKey(n)));return o}getOptionalConfigArray(n){const o=this.readConfigValue(n,f=>{if(!Array.isArray(f))return{expected:"object-array"};for(const[R,N]of f.entries())if(!ye(N))return{expected:"object-array",value:N,key:`${n}[${R}]`};return!0});if(!o){if(!1)var l;return}return o.map((f,R)=>this.copy(f,`${n}[${R}]`))}getNumber(n){const o=this.getOptionalNumber(n);if(o===void 0)throw new Error(Le.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(Le.convert(this.fullKey(n),this.context,"number"));return l}getBoolean(n){const o=this.getOptionalBoolean(n);if(o===void 0)throw new Error(Le.missing(this.fullKey(n)));return o}getOptionalBoolean(n){return this.readConfigValue(n,o=>typeof o=="boolean"||{expected:"boolean"})}getString(n){const o=this.getOptionalString(n);if(o===void 0)throw new Error(Le.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(Le.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 Ue(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 R;return(f=this.fallback)===null||f===void 0?void 0:f.readConfigValue(n,o)}const N=o(l);if(N!==!0){const{key:V=n,value:ne=l,expected:ze}=N;throw new TypeError(Le.type(this.fullKey(V),this.context,Pe(ne),ze))}return l}readValue(n){const o=n?n.split("."):[];for(const f of o)if(!pe.test(f))throw new TypeError(`Invalid config key '${n}'`);if(this.data===void 0)return;let l=this.data;for(const[f,R]of o.entries())if(ye(l))l=l[R];else if(l!==void 0){const N=this.fullKey(o.slice(0,f).join("."));throw new TypeError(Le.type(N,this.context,Pe(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 nt="Invalid discovery URL pattern,";class w{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(`${nt} URL '${l}' is invalid`)}if(f.hash)throw new Error(`${nt} URL must not have a hash`);if(f.search)throw new Error(`${nt} URL must not have a query`);if(l.endsWith("/"))throw new Error(`${nt} URL must not end with a slash`);return new w(o)}async getBaseUrl(n){return this.parts.join(n)}constructor(n){this.parts=n}}class H{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 ve{post(n,o){this.subject.next({error:n,context:o})}error$(){return this.subject}constructor(){this.subject=new Re}}class ue{static forward(n,o){window.addEventListener("unhandledrejection",l=>{n.post(l.reason,o)})}}function we(a){if(a.length<3)throw new Error(`The '${a}' feature flag must have a minimum length of three characters.`);if(a.length>150)throw new Error(`The '${a}' feature flag must not exceed 150 characters.`);if(!a.match(/^[a-z]+[a-z0-9-]+$/))throw new Error(`The '${a}' feature flag must start with a lowercase letter and only contain lowercase letters, numbers and hyphens. Examples: feature-flag-one, alpha, release-2020`)}class ke{registerFlag(n){we(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,R])=>(we(f),R===b.CL.Active));return new Map(l)}catch{return new Map}}constructor(){this.registeredFeatureFlags=[]}}function Fe(a){let n=a.baseImplementation||t.g.fetch;var o;const l=[(o=a.middleware)!==null&&o!==void 0?o:[]].flat().reverse();for(const f of l)n=f.apply(n);return{fetch:n}}class it{static create(n){var o,l;const f=Ct(n),R=((o=n.header)===null||o===void 0?void 0:o.name)||"authorization",N=((l=n.header)===null||l===void 0?void 0:l.value)||(V=>`Bearer ${V}`);return new it(n.identityApi,f,R,N)}apply(n){return async(o,l)=>{const f=new Request(o,l),{token:R}=await this.identityApi.getCredentials();return f.headers.get(this.headerName)||typeof R!="string"||!R||!this.allowUrl(f.url)?n(o,l):(f.headers.set(this.headerName,this.headerValue(R)),n(f))}}constructor(n,o,l,f){this.identityApi=n,this.allowUrl=o,this.headerName=l,this.headerValue=f}}function Ct(a){return a.allowUrl?a.allowUrl:a.urlPrefixAllowlist?Ke(a.urlPrefixAllowlist):a.config?Ke([a.config.getString("backend.baseUrl")]):()=>!1}function Ke(a){const n=a.map(o=>o.replace(/\/$/,""));return o=>n.some(l=>o===l||o.startsWith(`${l}/`))}function ht(a,n){return!n||n==="/"?a:`${a.replace(/\/$/,"")}/${n.replace(/^\//,"")}`}class vt{apply(n){return async(o,l)=>{const f=new Request(o,l),R="plugin://";if(!f.url.startsWith(R))return n(o,l);const{hostname:N,pathname:V,search:ne,hash:ze,username:Ze,password:ut}=new URL(`http://${f.url.substring(R.length)}`);let lt=await this.discoveryApi.getBaseUrl(N);if(Ze||ut){const St=new URL(lt),Bt=`${Ze}${ut?`:${ut}`:""}@`;lt=`${St.protocol}//${Bt}${St.host}${St.pathname}`}const bt=`${ht(lt,V)}${ne}${ze}`;return n(bt,typeof o=="string"||at(o)?l:o)}}constructor(n){this.discoveryApi=n}}function at(a){return typeof a=="object"&&(a==null?void 0:a.constructor)===URL}class Tt{static resolvePluginProtocol(n){return new vt(n.discoveryApi)}static injectIdentityAuth(n){return it.create(n)}constructor(){}}function Ut(a,n){for(const o of n)if(!a.has(o))return!1;return!0}function Mt(a,...n){const o=new Set(a);for(const l of n)for(const f of l)o.add(f);return o}class Wn{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=>Ut(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)=>Mt(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 mt(this.getCurrentPending())}}class Vn{createAuthRequester(n){const o=new Wn,l=this.handlerCount;return this.handlerCount++,o.pending().subscribe({next:f=>{const R=this.currentRequests.slice(),N=this.makeAuthRequest(f,n);N?R[l]=N:delete R[l],this.currentRequests=R,this.subject.next(R.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 mt([]),this.currentRequests=[],this.handlerCount=0}}const bn=new Map;class Nt{static create(n){var o;return new Nt((o=n.namespace)!==null&&o!==void 0?o:"",n.errorApi)}static addStorageEventListener(){window.addEventListener("storage",n=>{for(const[l,f]of bn.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,(R,N)=>(typeof N=="object"&&N!==null&&Object.freeze(N),N)),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 bn.has(o)||bn.set(o,new Nt(o,this.errorApi)),bn.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 Nt.hasSubscribed||(Nt.addStorageEventListener(),Nt.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(se())(l=>(this.subscribers.add(l),()=>{this.subscribers.delete(l)}))}}Nt.hasSubscribed=!1;const zt=(0,W.createContext)(void 0);function _t(){const[a]=(0,g.is)((0,r.jsx)(g.AW,{index:!0,element:(0,r.jsx)("div",{})}));return!a.index}var kn=t(16060);const Jn=(a,n)=>{try{var o,l;const f=(0,kn.fp)(n,{pathname:a}),R=(o=f==null?void 0:f.filter(V=>{var ne;return((ne=V==null?void 0:V.route.routeRefs)===null||ne===void 0?void 0:ne.size)>0}).pop())===null||o===void 0?void 0:o.route;if(!R)return{};let N;return R.routeRefs.size===1&&(N=R.routeRefs.values().next().value),{extension:"App",pluginId:((l=R.plugin)===null||l===void 0?void 0:l.getId())||"root",...N?{routeRef:N.id}:{}}}catch{return{}}},Sn=({pathname:a,search:n,hash:o})=>{const l=(0,b.z$)();return(0,W.useEffect)(()=>{l.captureEvent("navigate",`${a}${n}${o}`)},[l,a,n,o]),null},pn=({routeObjects:a})=>{const{pathname:n,search:o,hash:l}=(0,g.TH)();return(0,r.jsx)(b.fC,{attributes:Jn(n,a),children:(0,r.jsx)(Sn,{pathname:n,search:o,hash:l})})};function Hn(a){return _t()?ln(a):""}function ln(a){var n;let{pathname:o}=new URL((n=a.getOptionalString("app.baseUrl"))!==null&&n!==void 0?n:"/","http://sample.dev");return o=o.replace(/\/*$/,""),o}function On({component:a,appIdentityProxy:n,children:o}){const[l,f]=(0,W.useState)(),R=(0,b.h_)(b.Ds),N=Hn(R);return l?(n.setTarget(l,{signOutTargetUrl:N||"/"}),(0,r.jsx)(r.Fragment,{children:o})):(0,r.jsx)(a,{onSignInSuccess:f})}function Qn(a){const{Router:n,SignInPage:o}=(0,b.qD)().getComponents(),l=(0,b.h_)(b.Ds),f=ln(l),R=`${f}/*`,N=(0,W.useContext)(zt);if(!N)throw new Error("AppRouter must be rendered within the AppProvider");const{routeObjects:V,appIdentityProxy:ne}=N;return o?_t()?(0,r.jsxs)(n,{children:[(0,r.jsx)(pn,{routeObjects:V}),(0,r.jsx)(On,{component:o,appIdentityProxy:ne,children:(0,r.jsx)(g.Z5,{children:(0,r.jsx)(g.AW,{path:R,element:(0,r.jsx)(r.Fragment,{children:a.children})})})})]}):(0,r.jsxs)(n,{basename:f,children:[(0,r.jsx)(pn,{routeObjects:V}),(0,r.jsx)(On,{component:o,appIdentityProxy:ne,children:a.children})]}):(ne.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||"/"}),_t()?(0,r.jsxs)(n,{children:[(0,r.jsx)(pn,{routeObjects:V}),(0,r.jsx)(g.Z5,{children:(0,r.jsx)(g.AW,{path:R,element:(0,r.jsx)(r.Fragment,{children:a.children})})})]}):(0,r.jsxs)(n,{basename:f,children:[(0,r.jsx)(pn,{routeObjects:V}),a.children]}))}var C=t(90383),d=t(22504),y=t(69866),j=t(64279);function Y(a){const n={};for(const l in a.collectors)a.collectors.hasOwnProperty(l)&&(n[l]=a.collectors[l]());const o=[{node:W.Children.toArray(a.root),parent:void 0,contexts:{}}];for(;o.length!==0;){const{node:l,parent:f,contexts:R}=o.shift();W.Children.forEach(l,N=>{if(!(0,W.isValidElement)(N))return;const V={};for(const ne in n)if(n.hasOwnProperty(ne)){const ze=n[ne];V[ne]=ze.visit(ze.accumulator,N,f,R[ne])}for(const ne of a.discoverers){const ze=ne(N);ze&&o.push({node:ze,parent:N,contexts:V})}})}return Object.fromEntries(Object.entries(n).map(([l,f])=>[l,f.accumulator]))}function me(a,n){return()=>({accumulator:a(),visit:n})}function be(a){var n;return(n=a.props)===null||n===void 0?void 0:n.children}function De(a){var n,o;if(((n=a.props)===null||n===void 0?void 0:n.path)&&((o=a.props)===null||o===void 0?void 0:o.element)){var l;return(l=a.props)===null||l===void 0?void 0:l.element}}const pt=me(()=>new Set,(a,n)=>{const o=(0,b.IY)(n,"core.plugin");o&&a.add(o)}),Ft=a=>{const{children:n}=a,o=(0,b.h_)(b.W0),l="with"in a?o.isActive(a.with):!o.isActive(a.without);return(0,r.jsx)(r.Fragment,{children:l?n:null})};(0,b.R5)(Ft,"core.featureFlagged",!0);const en={caseSensitive:!1,path:"*",element:"match-all",routeRefs:new Set};function Bn(a){const n=a;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 Er(a,n=new Array){return W.Children.forEach(a,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})}Er(o.props.children,n)}),n}const rr=me(()=>({paths:new Map,parents:new Map,objects:new Array}),(a,n,o,l)=>{var f,R;if(l!=null&&l.isElementAncestor)return l;if((o==null?void 0:o.props.element)===n)return{...l,isElementAncestor:!0};const N=(f=n.props)===null||f===void 0?void 0:f.path,V=(0,b.IY)(n,"core.mountPoint");if(V&&N)throw new Error(`Path property may not be set directly on a routable extension "${Bn(n)}"`);var ne;const ze=(ne=l==null||(R=l.obj)===null||R===void 0?void 0:R.children)!==null&&ne!==void 0?ne:a.objects;if(N!==void 0){if(typeof N!="string")throw new Error(`Element path must be a string at "${Bn(n)}"`);const bt=N.startsWith("/")?N.slice(1):N,St=n.props.element;if((0,b.IY)(n,"core.gatherMountPoints")){var Ze;if(St)throw new Error(`Mount point gatherers may not have an element prop "${Bn(n)}"`);const Bt={path:bt,element:"gathered",routeRefs:new Set,caseSensitive:Boolean((Ze=n.props)===null||Ze===void 0?void 0:Ze.caseSensitive),children:[en],plugin:void 0};return ze.push(Bt),{obj:Bt,gatherPath:bt,routeRef:l==null?void 0:l.routeRef,gatherRouteRef:l==null?void 0:l.routeRef}}if(St){var ut;const[Bt,...jt]=Er(St);if(jt.length>0)throw new Error(`Route element with path "${N}" may not contain multiple routable extensions`);if(!Bt)return l;const{routeRef:jn,plugin:Zn}=Bt,ar={path:bt,element:"mounted",routeRefs:new Set([jn]),caseSensitive:Boolean((ut=n.props)===null||ut===void 0?void 0:ut.caseSensitive),children:[en],plugin:Zn};return ze.push(ar),a.paths.set(jn,bt),a.parents.set(jn,l==null?void 0:l.routeRef),{obj:ar,routeRef:jn!=null?jn:l==null?void 0:l.routeRef,gatherPath:bt,gatherRouteRef:l==null?void 0:l.gatherRouteRef}}}if(V){var lt;if((l==null?void 0:l.gatherPath)===void 0)throw new Error(`Routable extension "${Bn(n)}" with mount point "${V}" must be assigned a path`);return l==null||(lt=l.obj)===null||lt===void 0||lt.routeRefs.add(V),a.paths.set(V,l.gatherPath),a.parents.set(V,l==null?void 0:l.gatherRouteRef),{...l,routeRef:V}}return l}),Xn=me(()=>({paths:new Map,parents:new Map,objects:new Array}),(a,n,o,l)=>{var f,R,N;if((o==null?void 0:o.props.element)===n)return l;let V=l==null?void 0:l.obj,ne=l==null?void 0:l.routeRef,ze=l==null?void 0:l.sticky;const Ze=(f=n.props)===null||f===void 0?void 0:f.path;var ut;const lt=(ut=V==null?void 0:V.children)!==null&&ut!==void 0?ut:a.objects,bt=Boolean((R=n.props)===null||R===void 0?void 0:R.caseSensitive);let St=l==null?void 0:l.path;if((0,b.IY)(n,"core.gatherMountPoints")){if(!Ze)throw new Error("Mount point gatherer must have a path");St=Ze}const Bt=(N=n.props)===null||N===void 0?void 0:N.element;let jt=(0,b.IY)(n,"core.mountPoint");if(!jt&&(0,W.isValidElement)(Bt)&&(jt=(0,b.IY)(Bt,"core.mountPoint")),jt){let ar=Ze;if(St&&(ar?St=void 0:ar=St),!ar)throw new Error("Mounted routable extension must have a path");a.paths.set(jt,ar),ne&&ze?(a.parents.set(jt,ne),Ze&&(ne=jt,ze=!1)):(a.parents.set(jt,ne),ne=jt),Ze?(V={caseSensitive:bt,path:Ze,element:"mounted",routeRefs:new Set([jt]),children:[en],plugin:(0,b.IY)(n.props.element,"core.plugin")},lt.push(V)):V==null||V.routeRefs.add(jt)}if((0,b.IY)(n,"core.gatherMountPoints")&&(ze=!0),(0,b.IY)(n,"core.gatherMountPoints")){if(!Ze)throw new Error("Mount point gatherer must have a path");if(!jt){var Zn;V={caseSensitive:bt,path:Ze,element:"gathered",routeRefs:new Set,children:[en],plugin:l==null||(Zn=l.obj)===null||Zn===void 0?void 0:Zn.plugin},lt.push(V)}}return{obj:V,path:St,routeRef:ne,sticky:ze}}),pr=me(()=>new Set,(a,n)=>{if(n.type===Ft){const o=n.props;a.add("with"in o?o.with:o.without)}}),_n=(0,Ve.uW)("route-ref-type",()=>Symbol("route-ref-type"));function Ar(a){return a[_n]==="absolute"}function Yr(a){return a[_n]==="sub"}function fr(a){return a[_n]==="external"}function Tr(...a){const n=a.join("/").replace(/\/\/+/g,"/");return n!=="/"&&n.endsWith("/")?n.slice(0,-1):n}function ps(a,n,o){let l,f="";if(Ar(a))l=a;else if(Yr(a))l=a.parent,f=a.path;else if(fr(a)){const V=o.get(a);if(!V)return[void 0,""];if(Ar(V))l=V;else if(Yr(V))l=V.parent,f=V.path;else throw new Error(`ExternalRouteRef was bound to invalid target, ${V}`)}else throw a[_n]?new Error(`Unknown or invalid route ref type, ${a[_n]}`):new Error(`Unknown object passed to useRouteRef, got ${a}`);if(!l)return[void 0,""];const R=n.get(l);if(R===void 0)return[void 0,""];const N=Tr(R,f);return[l,N]}function Dr(a,n,o,l,f){var R;const N=(R=(0,kn.fp)(f,n))!==null&&R!==void 0?R:[],V=Array();let ne=-1;for(let ut=a;ut&&(ne=N.findIndex(lt=>lt.route.routeRefs.has(ut)),ne===-1);ut=l.get(ut))V.unshift(ut);V.length===0&&(ne-=1);const ze=ne===-1?"":N[ne].pathname,Ze=V.slice(0,-1).map(ut=>{const lt=o.get(ut);if(lt===void 0)throw new Error(`No path for ${ut}`);if(lt.includes(":"))throw new Error(`Cannot route to ${a} with parent ${ut} as it has parameters`);return lt});return`${Tr(ze,...Ze)}/`}class er{resolve(n,o){const[l,f]=ps(n,this.routePaths,this.routeBindings);if(!l)return;let R;typeof o=="string"?R=this.trimPath(o):o.pathname?R={...o,pathname:this.trimPath(o.pathname)}:R=o;const N=this.appBasePath+Dr(l,R,this.routePaths,this.routeParents,this.routeObjects);return(...[ne])=>Tr(N,(0,kn.Gn)(f,ne))}trimPath(n){return n&&(n.startsWith(this.appBasePath)?n.slice(this.appBasePath.length):n)}constructor(n,o,l,f,R){this.routePaths=n,this.routeParents=o,this.routeObjects=l,this.routeBindings=f,this.appBasePath=R}}const Ir=(0,Ve.CT)("routing-context"),Nr=({routePaths:a,routeParents:n,routeObjects:o,routeBindings:l,basePath:f="",children:R})=>{const N=new er(a,n,o,l,f),V=(0,Ve.EI)({1:N});return(0,r.jsx)(Ir.Provider,{value:V,children:R})};function fs(a,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,R="";for(;f;){const V=a.get(f);if(V===void 0)throw new Error(`No path for ${f}`);R=Tr(V,R),f=n.get(f)}const N=R.match(/:(\w+)/g);if(N){for(let V=0;V<N.length;V++)for(let ne=V+1;ne<N.length;ne++)if(N[ne]===N[V])throw new Error(`Parameter ${N[ne]} is duplicated in path ${R}`)}}}function Fr(a,n){for(const o of n)if(!!o.externalRoutes){for(const[l,f]of Object.entries(o.externalRoutes))if(!f.optional&&!a.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 Jr=(0,Ve.CT)("app-context"),Qr=({appContext:a,children:n})=>{const o=(0,Ve.EI)({1:a});return(0,r.jsx)(Jr.Provider,{value:o,children:n})};function sr(a){return new Error(`Tried to access IdentityApi ${a} before app was loaded`)}function gr(a){console.warn(`WARNING: Call to ${a} is deprecated and will break in the future`)}class Fs{setTarget(n,o){this.target=n,this.signOutTargetUrl=o.signOutTargetUrl,this.resolveTarget(n)}getUserId(){if(!this.target)throw sr("getUserId");if(!this.target.getUserId)throw new Error("IdentityApi does not implement getUserId");return gr("getUserId"),this.target.getUserId()}getProfile(){if(!this.target)throw sr("getProfile");if(!this.target.getProfile)throw new Error("IdentityApi does not implement getProfile");return gr("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 gr("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 gs=t(72164);function Xr(a,n,o){if(a!==void 0){const f=o.find(R=>R.id===a);if(f)return f}if(n){const f=o.find(R=>R.variant==="dark");if(f)return f}const l=o.find(f=>f.variant==="light");return l||o[0]}const Us=()=>{const a=(0,W.useMemo)(()=>window.matchMedia("(prefers-color-scheme: dark)"),[]),[n,o]=(0,W.useState)(a.matches);return(0,W.useEffect)(()=>{const l=f=>{o(f.matches)};return a.addListener(l),()=>{a.removeListener(l)}},[a]),n};function ms({children:a}){const n=(0,b.h_)(b.hg),o=(0,gs.Z)(n.activeThemeId$(),n.getActiveThemeId()),l=Boolean(window.matchMedia)?Us():!1,f=Xr(o,l,n.getInstalledThemes());if(!f)throw new Error("App has no themes");return(0,r.jsx)(f.Provider,{children:a})}const qr=async(a="__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(a!=="__app_injected_runtime_config__".toLocaleUpperCase("en-US"))try{const f=JSON.parse(a);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 Ms{add(n,o){return this.apis.push([n.id,o]),o}build(){return new dr(new Map(this.apis))}constructor(){this.apis=[]}}class dr{static builder(){return new Ms}static from(n){return new dr(new Map(n.map(([o,l])=>[o.id,l])))}static with(n,o){return new dr(new Map([[n.id,o]]))}with(n,o){return new dr(new Map([...this.apis,[n.id,o]]))}get(n){return this.apis.get(n.id)}constructor(n){this.apis=n}}function vs(a){const n=new Map;return a&&a({bind:(l,f)=>{for(const[R,N]of Object.entries(f)){const V=l[R];if(!V)throw new Error(`Key ${R} is not an existing external route`);if(!N&&!V.optional)throw new Error(`External route ${R} is required but was undefined`);N&&n.set(V,N)}}}),n}function ys(a,n,o){var l;const f=Boolean(a),R=(0,j.default)(a||(()=>Promise.resolve([])));let N;if(f&&R.loading){const{Progress:ze}=n;N=(0,r.jsx)(ze,{})}else if(R.error){const{BootErrorPage:ze}=n;N=(0,r.jsx)(ze,{step:"load-config",error:R.error})}const{ThemeProvider:V=ms}=n;if(N)return{node:(0,r.jsx)(je,{apis:dr.with(b.hg,o),children:(0,r.jsx)(V,{children:N})})};let ne;if(!((l=R.value)===null||l===void 0)&&l.length){const ze=Ue.fromConfigs(R.value),Ze=jt=>new URL(jt).origin,ut=jt=>new URL(jt.replace(Ze(jt),""),document.location.origin).href.replace(/\/$/,""),lt=ze.getOptionalString("app.baseUrl"),bt=ze.getOptionalString("backend.baseUrl");let St=R.value;const Bt={data:{},context:"relative-resolver"};if(lt&&bt){const jt=Ze(lt),jn=Ze(bt);if(jt===jn){const Zn=ut(bt);bt!==Zn&&(Bt.data.backend={baseUrl:Zn})}}if(lt){const jt=ut(lt);lt!==jt&&(Bt.data.app={baseUrl:jt})}Object.keys(Bt.data).length&&(St=St.concat([Bt])),ne=Ue.fromConfigs(St)}else ne=Ue.fromConfigs([]);return{api:ne}}class _r{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 or=new WeakMap;class mr{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,C.Z)(this,or))throw new Error("app.getProvider() or app.createRoot() has already been called, and can only be called once");(0,y.Z)(this,or,!0);const n=new _r(this);let o=!1;return({children:f})=>{const R=(0,W.useRef)(!0),N=(0,W.useMemo)(()=>ce.createWithStorage(this.themes),[]),{routing:V,featureFlags:ne,routeBindings:ze}=(0,W.useMemo)(()=>{const bt=Y({root:f,discoverers:[be,De],collectors:{routing:_t()?Xn:rr,collectedPlugins:pt,featureFlags:pr}});return bt.collectedPlugins.forEach(St=>this.plugins.add(St)),this.verifyPlugins(this.plugins),this.getApiHolder(),{...bt,routeBindings:vs(this.bindRoutes)}},[f]);o||(o=!0,fs(V.paths,V.parents),Fr(ze,this.plugins));const Ze=ys(this.configLoader,this.components,N),ut="api"in Ze;if(ut){const{api:bt}=Ze;this.configApi=bt}if("node"in Ze)return Ze.node;if(ut&&R.current){R.current=!1;const bt=this.getApiHolder().get(b.W0);if(bt){for(const jt of this.plugins.values())if("getFeatureFlags"in jt)for(const jn of jt.getFeatureFlags())bt.registerFlag({name:jn.name,pluginId:jt.getId()});else for(const jn of jt.output())jn.type==="feature-flag"&&bt.registerFlag({name:jn.name,pluginId:jt.getId()});const St=bt.getRegisteredFlags(),Bt=new Set(St.map(jt=>jt.name));for(const jt of ne)Bt.has(jt)||bt.registerFlag({name:jt,pluginId:""})}}const{ThemeProvider:lt=ms}=this.components;return(0,r.jsx)(je,{apis:this.getApiHolder(),children:(0,r.jsx)(Qr,{appContext:n,children:(0,r.jsx)(lt,{children:(0,r.jsx)(Nr,{routePaths:V.paths,routeParents:V.parents,routeObjects:V.objects,routeBindings:ze,basePath:Hn(Ze.api),children:(0,r.jsx)(zt.Provider,{value:{routeObjects:V.objects,appIdentityProxy:this.appIdentityProxy},children:f})})})})})}}getRouter(){return Qn}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 Ge.validateFactories(this.apiFactoryRegistry,this.apiFactoryRegistry.getAllApis()),this.apiHolder}this.apiFactoryRegistry.register("static",{api:b.hg,deps:{},factory:()=>ce.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 ke});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 Ge.validateFactories(this.apiFactoryRegistry,this.apiFactoryRegistry.getAllApis()),this.apiHolder=new Ge(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 Fs,(0,d.Z)(this,or,{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:[]),this.components=n.components,this.themes=n.themes;var f;this.configLoader=(f=n.configLoader)!==null&&f!==void 0?f:qr;var R;this.defaultApis=(R=n.defaultApis)!==null&&R!==void 0?R:[],this.bindRoutes=n.bindRoutes,this.apiFactoryRegistry=new gt}}function xs(a){return new mr(a)}let es=!1;const ts=a=>{const n=(0,b.qD)(),{NotFoundErrorPage:o}=n.getComponents(),l=(0,W.useMemo)(()=>_t(),[]),R=[...(0,b.vJ)(a.children,N=>N.getElements().flatMap(V=>{let ne=V.props.path;if(ne==="")return[];var ze;ne=(ze=ne==null?void 0:ne.replace(/\/\*$/,""))!==null&&ze!==void 0?ze:"/";let Ze=l?V:V.props.element;return!l&&!Ze&&(Ze=V,es||(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] />} />."),es=!0)),[{path:ne,element:Ze,children:V.props.children?[{path:ne==="/"?"/":"*",element:V.props.children}]:void 0}]}).sort((V,ne)=>ne.path.localeCompare(V.path)).map(V=>({...V,path:V.path==="/"?"/":`${V.path}/*`}))),{path:"*",element:(0,r.jsx)(o,{})}];return(0,g.V$)(R)};var Ur=t(25488);const ns=[(0,b.ni)({api:b.NW,deps:{configApi:b.Ds},factory:({configApi:a})=>w.compile(`${a.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:a})=>{const n=new H(a,new ve);return ue.forward(n,{hidden:!1}),n}}),(0,b.ni)({api:b.E6,deps:{errorApi:b.VE},factory:({errorApi:a})=>Nt.create({errorApi:a})}),(0,b.ni)({api:b.gP,deps:{configApi:b.Ds,identityApi:b.$4,discoveryApi:b.NW},factory:({configApi:a,identityApi:n,discoveryApi:o})=>Fe({middleware:[Tt.resolvePluginProtocol({discoveryApi:o}),Tt.injectIdentityAuth({identityApi:n,config:a})]})}),(0,b.ni)({api:b.ZM,deps:{},factory:()=>new Vn}),(0,b.ni)({api:b.Kp,deps:{discoveryApi:b.NW,oauthRequestApi:b.ZM,configApi:b.Ds},factory:({discoveryApi:a,oauthRequestApi:n,configApi:o})=>Fn.create({discoveryApi:a,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:a,oauthRequestApi:n,configApi:o})=>yn.create({discoveryApi:a,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:a,oauthRequestApi:n,configApi:o})=>Vt.create({discoveryApi:a,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:a,oauthRequestApi:n,configApi:o})=>un.create({discoveryApi:a,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:a,oauthRequestApi:n,configApi:o})=>Jt.create({discoveryApi:a,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:a,oauthRequestApi:n,configApi:o})=>ge.create({discoveryApi:a,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:a,oauthRequestApi:n,configApi:o})=>Ee.create({discoveryApi:a,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:a,oauthRequestApi:n,configApi:o})=>_e.create({discoveryApi:a,oauthRequestApi:n,environment:o.getOptionalString("auth.environment")})}),(0,b.ni)({api:Ur.RV,deps:{discovery:b.NW,identity:b.$4,config:b.Ds},factory:({config:a,discovery:n,identity:o})=>Ur.iM.create({config:a,discovery:n,identity:o})})];var An=t(77277),Wt=t(93414),bs=t(39857);function Ss({children:a}){return(0,g.GV)()?(0,r.jsx)(r.Fragment,{children:a}):(0,r.jsx)(g.VA,{children:a})}const ws=()=>(0,r.jsx)(Wt.mf,{status:"404",statusMessage:"PAGE NOT FOUND"}),Cs=({step:a,error:n})=>{let o="";return a==="load-config"?o=`The configuration failed to load, someone should have a look at this error: ${n.message}`:a==="load-chunk"&&(o=`Lazy loaded chunk failed to load, try to reload the page: ${n.message}`),(0,r.jsx)(Ss,{children:(0,r.jsx)(Wt.mf,{status:"501",statusMessage:o})})},js=({error:a,resetError:n,plugin:o})=>(0,r.jsx)(Wt.yu,{title:`Error in ${o==null?void 0:o.getId()}`,defaultExpanded:!0,error:a,children:(0,r.jsx)(An.Z,{variant:"outlined",onClick:n,children:"Retry"})}),Es={Progress:Wt.Ex,Router:bs.VK,NotFoundErrorPage:ws,BootErrorPage:Cs,ErrorBoundaryFallback:js};var rs=t(43642),Rr=t(80079),zs=t(90941),As=t(32915),Ts=t(40562),v=t(21853),x=t(60744),I=t(66569),$=t(30254),J=t(13384),K=t(15933),oe=t(58838),le=t(86737),Se=t(4989),Be=t(44407),$e=t(18628),Ae=t(84219),Je=t(98685),xt=t(39781);const It={brokenImage:Rr.Z,catalog:$e.Z,scaffolder:As.Z,techdocs:Ts.Z,search:v.Z,chat:x.Z,dashboard:I.Z,docs:$.Z,email:J.Z,github:oe.Z,group:Ae.Z,help:le.Z,"kind:api":K.Z,"kind:component":Be.Z,"kind:domain":rs.Z,"kind:group":Ae.Z,"kind:location":Se.Z,"kind:system":zs.Z,"kind:user":Je.Z,user:Je.Z,warning:xt.Z};var et=t(73689),$t=t(48032);const Dt={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")`},fn={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 rn(a){const{colors:n,shape:o,options:l}=a,R=`linear-gradient(90deg, ${(n.length===1?[n[0],n[0]]:n).join(", ")})`,N=`${o}, ${R}`;var V;const ne=(V=l==null?void 0:l.fontColor)!==null&&V!==void 0?V:"#FFFFFF";return{colors:n,shape:o,backgroundImage:N,fontColor:ne}}const tr={home:rn({colors:fn.teal,shape:Dt.wave}),documentation:rn({colors:fn.pinkSea,shape:Dt.wave2}),tool:rn({colors:fn.purpleSky,shape:Dt.round}),service:rn({colors:fn.marineBlue,shape:Dt.wave}),website:rn({colors:fn.veryBlue,shape:Dt.wave}),library:rn({colors:fn.rubyRed,shape:Dt.wave}),other:rn({colors:fn.darkGrey,shape:Dt.wave}),app:rn({colors:fn.toastyOrange,shape:Dt.wave}),apis:rn({colors:fn.teal,shape:Dt.wave2}),card:rn({colors:fn.greens,shape:Dt.wave})},wn=16,Tn='"Helvetica Neue", Helvetica, Roboto, Arial, sans-serif';function In(a){const{palette:n,htmlFontSize:o=wn,fontFamily:l=Tn,defaultPageTheme:f,pageTheme:R=tr}=a;if(!R[f])throw new Error(`${f} is not defined in pageTheme.`);var N;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:R[f],getPageTheme:({themeId:V})=>(N=R[V])!==null&&N!==void 0?N:R[f]}}function Lr(a){return{MuiCssBaseline:{"@global":{html:{height:"100%",fontFamily:a.typography.fontFamily},body:{height:"100%",fontFamily:a.typography.fontFamily,"overscroll-behavior-y":"none"},a:{color:"inherit",textDecoration:"none"}}},MuiTableRow:{root:{"&:nth-of-type(odd)":{backgroundColor:a.palette.background.default}},hover:{"&:hover":{cursor:"pointer"}},head:{"&:nth-of-type(odd)":{backgroundColor:a.palette.background.paper}}},MuiTableCell:{root:{wordBreak:"break-word",overflow:"hidden",verticalAlign:"middle",lineHeight:"1",margin:0,padding:a.spacing(3,2,3,2.5),borderBottom:0},sizeSmall:{padding:a.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:a.palette.link,minHeight:24,textTransform:"initial",letterSpacing:"0.07em","&:hover":{color:(0,$t.darken)(a.palette.link,.3),background:(0,$t.lighten)(a.palette.link,.95)},[a.breakpoints.up("md")]:{minWidth:120,fontSize:a.typography.pxToRem(14),fontWeight:500}},textColorPrimary:{color:a.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:a.spacing(1),marginBottom:a.spacing(1),color:a.palette.grey[900]},outlined:{color:a.palette.text.primary},label:{lineHeight:`${a.spacing(2.5)}px`,fontWeight:a.typography.fontWeightMedium,fontSize:`${a.spacing(1.75)}px`},labelSmall:{fontSize:`${a.spacing(1.5)}px`},deleteIcon:{color:a.palette.grey[500],width:`${a.spacing(3)}px`,height:`${a.spacing(3)}px`,margin:`0 ${a.spacing(.75)}px 0 -${a.spacing(.75)}px`},deleteIconSmall:{width:`${a.spacing(2)}px`,height:`${a.spacing(2)}px`,margin:`0 ${a.spacing(.5)}px 0 -${a.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 Pr(a){const n=In(a),o=(0,et.Z)(n),l=Lr(o);return{...o,overrides:l}}var kr=t(34505);const Rn=Pr({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:kr.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:tr}),$n=Pr({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:kr.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:tr});var vr=t(98192),bo=t(15222),So=t(41547),Ws=t(87561);const di=[{id:"light",title:"Light Theme",variant:"light",icon:(0,r.jsx)(bo.Z,{}),Provider:({children:a})=>(0,r.jsx)(So.Z,{theme:Rn,children:(0,r.jsx)(Ws.ZP,{children:a})})},{id:"dark",title:"Dark Theme",variant:"dark",icon:(0,r.jsx)(vr.Z,{}),Provider:({children:a})=>(0,r.jsx)(So.Z,{theme:$n,children:(0,r.jsx)(Ws.ZP,{children:a})})}];function Or(a){var n,o,l;return xs({...a,apis:(n=a==null?void 0:a.apis)!==null&&n!==void 0?n:[],bindRoutes:a==null?void 0:a.bindRoutes,components:{...Es,...a==null?void 0:a.components},configLoader:a==null?void 0:a.configLoader,defaultApis:ns,icons:{...It,...a==null?void 0:a.icons},plugins:(o=a==null?void 0:a.plugins)!==null&&o!==void 0?o:[],themes:(l=a==null?void 0:a.themes)!==null&&l!==void 0?l:di})}var Vs=t(25271),wo=t(76635);async function ui({storageApi:a}){const n=a.forBucket("settings"),o=a.forBucket("starredEntities"),l=n.snapshot("starredEntities").value;if(!(0,wo.isArray)(l))return;var f;const R=new Set((f=o.snapshot("entityRefs").value)!==null&&f!==void 0?f:[]);l.filter(wo.isString).map(N=>N.split(":")).filter(N=>N.length===4&&N[0]==="entity").map(([N,V,ne,ze])=>(0,Vs.eE)({kind:V,namespace:ne,name:ze})).forEach(N=>R.add(N)),await o.set("entityRefs",Array.from(R)),await n.remove("starredEntities")}class hi{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(se())(l=>(l.next(new Set(this.starredEntities)),this.subscribers.add(l),()=>{this.subscribers.delete(l)})),ui(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 ta=t(33414),Br=t(79692),pi=t(12420),Cn=t(92848),fi=t(19928);function gi(){const a=useApi(catalogApiRef),{error:n,loading:o,value:l}=useAsync(async()=>await a.getEntityFacets({facets:["kind"]}).then(R=>{var N;return((N=R.facets.kind)===null||N===void 0?void 0:N.map(V=>V.value).sort())||[]}),[a]);return{loading:o,error:n,allKinds:l!=null?l:[]}}function mi(a,n,o){let l=a;return n&&(l=l.filter(R=>n.some(N=>N.toLocaleLowerCase("en-US")===R.toLocaleLowerCase("en-US")))),o&&!a.some(R=>R.toLocaleLowerCase("en-US")===o.toLocaleLowerCase("en-US"))&&(l=l.concat([o])),l.sort().reduce((R,N)=>(R[N.toLocaleLowerCase("en-US")]=N,R),{})}const Co=(0,Br.Z)(a=>(0,pi.Z)({root:{...a.typography.h4}}));function vi(a){var n;const{initialFilter:o="component",allowedKinds:l}=a,f=Co(),{allKinds:R}=useAllKinds(),{filters:N,updateFilters:V,queryParameters:{kind:ne}}=useEntityList(),ze=useMemo(()=>[ne].flat()[0],[ne]);var Ze;const[ut,lt]=useState((Ze=ze!=null?ze:(n=N.kind)===null||n===void 0?void 0:n.value)!==null&&Ze!==void 0?Ze:o);useEffect(()=>{ze&<(ze)},[ze]),useEffect(()=>{var St;if(!((St=N.kind)===null||St===void 0)&&St.value){var Bt;lt((Bt=N.kind)===null||Bt===void 0?void 0:Bt.value)}},[N.kind]),useEffect(()=>{V({kind:ut?new EntityKindFilter(ut):void 0})},[ut,V]);const bt=filterKinds(R,l,ut);return _jsx(Select,{input:_jsx(InputBase,{}),value:ut.toLocaleLowerCase("en-US"),onChange:St=>lt(St.target.value),classes:f,children:Object.keys(bt).map(St=>_jsx(MenuItem,{value:St,children:`${pluralize(bt[St])}`},St))})}var yi=t(65826);const xi=(0,Br.Z)({flexContainer:{flexWrap:"wrap"},itemText:{width:"100%",wordBreak:"break-all",marginBottom:"1rem"}});function na(a){const n=a.result,o=a.highlight,l=xi(),f=useAnalytics(),R=()=>{f.captureEvent("discover",n.title,{attributes:{to:n.location},value:a.rank})};return _jsxs(_Fragment,{children:[_jsxs(ListItem,{alignItems:"flex-start",children:[a.icon&&_jsx(ListItemIcon,{children:a.icon}),_jsxs("div",{className:l.flexContainer,children:[_jsx(ListItemText,{className:l.itemText,primaryTypographyProps:{variant:"h6"},primary:_jsx(Link,{noTrack:!0,to:n.location,onClick:R,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),Hs=t(95544),Gs=t(99688),ss=t(12231),Mr=t(86136),zr=t(49378),Eo=t(85256),Ks=t(61837),Is=t(79784),Ao=t(50758),To=t(31654),Io=t(43054),bi=t(65759),yr=t(51666);const Rs="catalog-entity",Ys=(0,yr.J$)({name:"catalog.entity.read",attributes:{action:"read"},resourceType:Rs}),Ro=(0,yr.J$)({name:"catalog.entity.create",attributes:{action:"create"}}),Ls=(0,yr.J$)({name:"catalog.entity.delete",attributes:{action:"delete"},resourceType:Rs}),Lo=(0,yr.J$)({name:"catalog.entity.refresh",attributes:{action:"update"},resourceType:Rs}),Js=(0,yr.J$)({name:"catalog.location.read",attributes:{action:"read"}}),Qs=(0,yr.J$)({name:"catalog.location.create",attributes:{action:"create"}}),Po=(0,yr.J$)({name:"catalog.location.delete",attributes:{action:"delete"}}),ra=[Ys,Ro,Ls,Lo,Js,Qs,Po];var ko=t(49166);function Xs(a){const{unregisterEntityOptions:n,isUnregisterAllowed:o,onUnregisterEntity:l,onClose:f}=a,R=typeof(n==null?void 0:n.disableUnregister)=="boolean";var N;const V=(N=!o||(R?!!(n!=null&&n.disableUnregister):(n==null?void 0:n.disableUnregister)==="disable"))!==null&&N!==void 0?N:!1;let ne=(0,r.jsx)(r.Fragment,{});return(n==null?void 0:n.disableUnregister)!=="hidden"&&(ne=(0,r.jsxs)(ss.Z,{onClick:()=>{f(),l()},disabled:V,children:[(0,r.jsx)(Mr.Z,{children:(0,r.jsx)(ko.Z,{fontSize:"small"})}),(0,r.jsx)(zr.Z,{primary:"Unregister entity"})]})),(0,r.jsx)(r.Fragment,{children:ne})}const Oo=(0,Br.Z)(a=>({button:{color:a.page.fontColor}}),{name:"PluginCatalogEntityContextMenu"});function qn(a){const{UNSTABLE_extraContextMenuItems:n,UNSTABLE_contextMenuOptions:o,onUnregisterEntity:l,onInspectEntity:f}=a,[R,N]=(0,W.useState)(),V=Oo(),ze=(0,Cn.N$)(Ls).allowed,Ze=Bt=>{N(Bt.currentTarget)},ut=()=>{N(void 0)},lt=(0,b.h_)(b.$v),bt=(0,W.useCallback)(()=>{window.navigator.clipboard.writeText(window.location.toString()).then(()=>lt.post({message:"Copied!",severity:"info"}))},[lt]),St=n&&[...n.map(Bt=>(0,r.jsxs)(ss.Z,{onClick:()=>{ut(),Bt.onClick()},children:[(0,r.jsx)(Mr.Z,{children:(0,r.jsx)(Bt.Icon,{fontSize:"small"})}),(0,r.jsx)(zr.Z,{primary:Bt.title})]},Bt.title)),(0,r.jsx)(Eo.Z,{},"the divider is here!")];return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(Ks.Z,{"aria-label":"more","aria-controls":"long-menu","aria-haspopup":"true","aria-expanded":!!R,role:"button",onClick:Ze,"data-testid":"menu-button",className:V.button,id:"long-menu",children:(0,r.jsx)(Io.Z,{})}),(0,r.jsx)(Is.ZP,{open:Boolean(R),onClose:ut,anchorEl:R,anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"},"aria-labelledby":"long-menu",children:(0,r.jsxs)(Ao.Z,{children:[St,(0,r.jsx)(Xs,{unregisterEntityOptions:o,isUnregisterAllowed:ze,onUnregisterEntity:l,onClose:ut}),(0,r.jsxs)(ss.Z,{onClick:()=>{ut(),f()},children:[(0,r.jsx)(Mr.Z,{children:(0,r.jsx)(To.Z,{fontSize:"small"})}),(0,r.jsx)(zr.Z,{primary:"Inspect entity"})]}),(0,r.jsxs)(ss.Z,{onClick:()=>{ut(),bt()},children:[(0,r.jsx)(Mr.Z,{children:(0,r.jsx)(bi.Z,{fontSize:"small"})}),(0,r.jsx)(zr.Z,{primary:"Copy entity URL"})]})]})})]})}const Bo="plugin.catalog.entityLayoutRoute",_s=()=>null;(0,b.R5)(_s,Bo,!0),(0,b.R5)(_s,"core.gatherMountPoints",!0);function Si(a){const{entity:n,title:o}=a;return(0,r.jsxs)(Hs.Z,{display:"inline-flex",alignItems:"center",height:"1em",maxWidth:"100%",children:[(0,r.jsx)(Hs.Z,{component:"span",textOverflow:"ellipsis",whiteSpace:"nowrap",overflow:"hidden",children:o}),n&&(0,r.jsx)(Cn.LH,{entity:n})]})}function wi(a,n,o,l){var f;const R=(f=a!=null?a:l==null?void 0:l.kind)!==null&&f!==void 0?f:"";var N;const V=(N=n!=null?n:l==null?void 0:l.metadata.namespace)!==null&&N!==void 0?N:"";var ne,ze,Ze;return{headerTitle:`${(Ze=(ze=(ne=l==null?void 0:l.metadata.title)!==null&&ne!==void 0?ne:o)!==null&&ze!==void 0?ze:l==null?void 0:l.metadata.name)!==null&&Ze!==void 0?Ze:""}${V&&V!==Vs.zG?` in ${V}`:""}`,headerType:(()=>{let lt=R.toLocaleLowerCase("en-US");return l&&l.spec&&"type"in l.spec&&(lt+=" \u2014 ",lt+=l.spec.type.toLocaleLowerCase("en-US")),lt})()}}function Ci(a){var n;const{entity:o}=a,l=(0,Cn.hF)(o,Vs.S4);return(0,r.jsxs)(r.Fragment,{children:[l.length>0&&(0,r.jsx)(Wt.i9,{label:"Owner",value:(0,r.jsx)(Cn.rI,{entityRefs:l,defaultKind:"Group",color:"inherit"})}),((n=o.spec)===null||n===void 0?void 0:n.lifecycle)&&(0,r.jsx)(Wt.i9,{label:"Lifecycle",value:o.spec.lifecycle})]})}const ji=a=>{var n,o;const{UNSTABLE_extraContextMenuItems:l,UNSTABLE_contextMenuOptions:f,children:R,NotFoundComponent:N}=a,{kind:V,namespace:ne,name:ze}=(0,b.Oi)(Cn.wi),{entity:Ze,loading:ut,error:lt}=(0,Cn.ce)(),bt=(0,g.TH)(),St=(0,b.vJ)(R,Oi=>Oi.selectByComponentData({key:Bo,withStrictError:"Child of EntityLayout must be an EntityLayout.Route"}).getElements().flatMap(({props:Vr})=>{if(Ze){if(Vr.if&&!Vr.if(Ze))return[]}else return[];return[{path:Vr.path,title:Vr.title,children:Vr.children,tabProps:Vr.tabProps}]}),[Ze]),{headerTitle:Bt,headerType:jt}=wi(V,ne,ze,Ze),[jn,Zn]=(0,W.useState)(!1),[ar,cs]=(0,W.useState)(!1),go=(0,g.s0)(),ei=async()=>{Zn(!1),cs(!1),go("/")};(0,W.useEffect)(()=>{Zn(!1),cs(!1)},[bt.pathname]);var ds;return(0,r.jsxs)(Wt.T3,{themeId:(ds=Ze==null||(n=Ze.spec)===null||n===void 0||(o=n.type)===null||o===void 0?void 0:o.toString())!==null&&ds!==void 0?ds:"home",children:[(0,r.jsx)(Wt.h4,{title:(0,r.jsx)(Si,{title:Bt,entity:Ze}),pageTitleOverride:Bt,type:jt,children:Ze&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(Ci,{entity:Ze}),(0,r.jsx)(qn,{UNSTABLE_extraContextMenuItems:l,UNSTABLE_contextMenuOptions:f,onUnregisterEntity:()=>Zn(!0),onInspectEntity:()=>cs(!0)})]})}),ut&&(0,r.jsx)(Wt.Ex,{}),Ze&&(0,r.jsx)(Wt.tn,{routes:St}),lt&&(0,r.jsx)(Wt.VY,{children:(0,r.jsx)(Gs.Z,{severity:"error",children:lt.toString()})}),!ut&&!lt&&!Ze&&(0,r.jsx)(Wt.VY,{children:N||(0,r.jsxs)(Wt.GB,{title:"Entity not found",children:["There is no ",V," with the requested"," ",(0,r.jsx)(Wt.rU,{to:"https://backstage.io/docs/features/software-catalog/references",children:"kind, namespace, and name"}),"."]})}),(0,r.jsx)(Cn.pp,{open:jn,entity:Ze,onConfirm:ei,onClose:()=>Zn(!1)}),(0,r.jsx)(Cn.U_,{open:ar,entity:Ze,onClose:()=>cs(!1)})]})};ji.Route=_s;var sa=t(23054);function oa(a){const{open:n,onClose:o,onConfirm:l,entity:f}=a,[R,N]=useState(!1),V=useApi(catalogApiRef),ne=useApi(alertApiRef),ze=async()=>{N(!0);try{const Ze=f.metadata.uid;await V.removeEntityByUid(Ze),l()}catch(Ze){assertError(Ze),ne.post({message:Ze.message})}finally{N(!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:R,onClick:ze,children:"Delete"}),_jsx(Button,{onClick:o,color:"primary",children:"Cancel"})]})]})}var xr=t(19625);function ia(a){var n,o;return(a==null||(n=a.metadata)===null||n===void 0||(o=n.annotations)===null||o===void 0?void 0:o["backstage.io/orphan"])==="true"}function aa(){const a=useNavigate(),n=useRouteRef(rootRouteRef),[o,l]=useState(!1),{entity:f}=useEntity(),R=async()=>{l(!1),a(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:R,onClose:()=>l(!1)})]})}var $o=t(29644);const Zo=a=>a.error&&a.level==="error"&&a.type===ENTITY_STATUS_CATALOG_PROCESSING_TYPE;async function os(a,n){return{items:(await n.getEntityAncestors({entityRef:a})).items.map(f=>{var R,N;return{errors:((N=(R=f.entity.status)===null||R===void 0?void 0:R.items)!==null&&N!==void 0?N:[]).filter(Zo).map(ze=>ze.error).filter(ze=>Boolean(ze)),entity:f.entity}}).filter(f=>f.errors.length>0)}}async function Ei(a,n){const o=n.apis.get(catalogApiRef);if(!o)throw new Error(`No implementation available for ${catalogApiRef}`);return(await os(stringifyEntityRef(a),o)).items.length>0}function Ai(){const{entity:a}=useEntity(),n=stringifyEntityRef(a),o=useApi(catalogApiRef),{loading:l,error:f,value:R}=useAsync(async()=>os(n,o),[n,o]);return f?_jsx(Box,{mb:1,children:_jsx(ResponseErrorPanel,{error:f})}):l||!R?null:_jsx(_Fragment,{children:R.items.map((N,V)=>_jsxs(Box,{mb:1,children:[stringifyEntityRef(a)!==stringifyEntityRef(N.entity)&&_jsxs(Box,{p:1,children:["The error below originates from"," ",_jsx(EntityRefLink,{entityRef:N.entity})]}),N.errors.map((ne,ze)=>_jsx(ResponseErrorPanel,{error:ne},ze))]},V))})}const eo="core.backstage.entitySwitch",is=a=>null;(0,b.R5)(is,eo,!0);const Ps=a=>{var n;const{entity:o,loading:l}=(0,Cn.ce)(),f=(0,b.I_)(),R=(0,b.vJ)(a.children,ne=>ne.selectByComponentData({key:eo,withStrictError:"Child of EntitySwitch is not an EntitySwitch.Case"}).getElements().flatMap(ze=>{if(l)return[];const{if:Ze,children:ut}=ze.props;if(!o)return[{if:Ze===void 0,children:ut}];var lt;return[{if:(lt=Ze==null?void 0:Ze(o,{apis:f}))!==null&<!==void 0?lt:!0,children:ut}]}),[f,o,l]);if(R.some(ne=>typeof ne.if=="object"&&"then"in ne.if))return(0,r.jsx)(as,{results:R});var V;return(V=(n=R.find(ne=>ne.if))===null||n===void 0?void 0:n.children)!==null&&V!==void 0?V:null};function as({results:a}){const{loading:n,value:o}=(0,j.default)(async()=>{const l=a.map(async({if:R,children:N})=>{try{if(await R)return N}catch{}return null});var f;return(f=(await Promise.all(l)).find(Boolean))!==null&&f!==void 0?f:null},[a]);return n||!o?null:o}Ps.Case=is;const Do=null,No=Cn._i.Filters,ur=Cn._i.Content,Kn=(0,b.rx)({id:"catalog",apis:[(0,b.ni)({api:Cn.Ah,deps:{discoveryApi:b.NW,fetchApi:b.gP},factory:({discoveryApi:a,fetchApi:n})=>new $o.MS({discoveryApi:a,fetchApi:n})}),(0,b.ni)({api:Cn.p3,deps:{storageApi:b.E6},factory:({storageApi:a})=>new hi({storageApi:a})})],routes:{catalogIndex:xr._Z,catalogEntity:Cn.wi},externalRoutes:{createComponent:xr.yw,viewTechDoc:xr.jU},__experimentalConfigure(a){return{...{createButtonTitle:"Create"},...a}}}),Fo=Kn.provide((0,b.P4)({name:"CatalogIndexPage",component:()=>t.e(5837).then(t.bind(t,95837)).then(a=>a.CatalogPage),mountPoint:xr._Z})),Uo=Kn.provide((0,b.P4)({name:"CatalogEntityPage",component:()=>t.e(8951).then(t.bind(t,78951)).then(a=>a.CatalogEntityPage),mountPoint:Cn.wi})),la=Kn.provide((0,b.CO)({name:"EntityAboutCard",component:{lazy:()=>Promise.resolve().then(t.bind(t,33414)).then(a=>a.AboutCard)}})),ir=Kn.provide((0,b.CO)({name:"EntityLinksCard",component:{lazy:()=>t.e(7750).then(t.bind(t,17750)).then(a=>a.EntityLinksCard)}})),Mo=Kn.provide((0,b.CO)({name:"EntityHasSystemsCard",component:{lazy:()=>t.e(5458).then(t.bind(t,5458)).then(a=>a.HasSystemsCard)}})),Ti=Kn.provide((0,b.CO)({name:"EntityHasComponentsCard",component:{lazy:()=>t.e(1105).then(t.bind(t,1105)).then(a=>a.HasComponentsCard)}})),Ii=Kn.provide((0,b.CO)({name:"EntityHasSubcomponentsCard",component:{lazy:()=>t.e(2440).then(t.bind(t,82440)).then(a=>a.HasSubcomponentsCard)}})),Ri=Kn.provide((0,b.CO)({name:"EntityHasResourcesCard",component:{lazy:()=>t.e(9770).then(t.bind(t,79770)).then(a=>a.HasResourcesCard)}})),Li=Kn.provide((0,b.CO)({name:"EntityDependsOnComponentsCard",component:{lazy:()=>t.e(9545).then(t.bind(t,19545)).then(a=>a.DependsOnComponentsCard)}})),ks=Kn.provide((0,b.CO)({name:"EntityDependencyOfComponentsCard",component:{lazy:()=>t.e(184).then(t.bind(t,40184)).then(a=>a.DependencyOfComponentsCard)}})),zo=Kn.provide((0,b.CO)({name:"EntityDependsOnResourcesCard",component:{lazy:()=>t.e(1032).then(t.bind(t,81032)).then(a=>a.DependsOnResourcesCard)}})),Wo=Kn.provide((0,b.CO)({name:"RelatedEntitiesCard",component:{lazy:()=>t.e(732).then(t.bind(t,732)).then(a=>a.RelatedEntitiesCard)}}));var Os=t(32838);class to{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}`,R=await fetch(`${f.endsWith("/")?f:`${f}/`}index.html`);if(R.status===404)throw new Error("Page not found");return R.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 Bs{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 Vo=[(0,b.ni)({api:Te.Dl,deps:{configApi:b.Ds,discoveryApi:b.NW,identityApi:b.$4},factory:({configApi:a,discoveryApi:n,identityApi:o})=>new to({configApi:a,discoveryApi:n,identityApi:o})}),(0,b.ni)({api:Te.gT,deps:{configApi:b.Ds,discoveryApi:b.NW,identityApi:b.$4},factory:({configApi:a,discoveryApi:n,identityApi:o})=>new Bs({configApi:a,discoveryApi:n,identityApi:o})}),(0,b.ni)({api:Os.q3,deps:{configApi:b.Ds},factory:({configApi:a})=>Os.ae.fromConfig(a)})],no={backend:{baseUrl:"http://localhost:3000"},techdocs:{builder:"external"}},ro={backend:{baseUrl:"http://localhost:7007"},techdocs:{builder:"external"}};async function so(){const a=await fetch("/.detect");return a.ok?(await a.text()).trim()==="techdocs-cli-server":!1}async function Ho(){const a=await qr(),n=await so();return[...a,{context:"detected",data:n?no:ro}]}var Wr=t(58845);const Go=(0,Br.Z)({svg:{width:"auto",height:30},path:{fill:"#7df3e1"}});var oo=()=>{const a=Go();return(0,r.jsx)("svg",{className:a.svg,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 2079.95 456.05",children:(0,r.jsx)("path",{className:a.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 io=(0,Br.Z)({svg:{width:"auto",height:28},path:{fill:"#7df3e1"}});var Ko=()=>{const a=io();return(0,r.jsx)("svg",{className:a.svg,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 337.46 428.5",children:(0,r.jsx)("path",{className:a.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 Yo=(0,Br.Z)({root:{width:Wt.po.drawerWidthClosed,height:3*Wt.po.logoHeight,display:"flex",flexFlow:"row nowrap",alignItems:"center",marginBottom:-14},link:{width:Wt.po.drawerWidthClosed,marginLeft:24}}),ao=()=>{const a=Yo(),{isOpen:n}=(0,Wt.mZ)();return(0,r.jsx)("div",{className:a.root,children:(0,r.jsx)(Wt.rU,{to:"/docs/default/component/local/",underline:"none",className:a.link,children:n?(0,r.jsx)(oo,{}):(0,r.jsx)(Ko,{})})})},Jo=({children:a})=>(0,r.jsxs)(Wt.tR,{children:[(0,r.jsxs)(Wt.YE,{children:[(0,r.jsx)(ao,{}),(0,r.jsx)(Wt.v7,{}),(0,r.jsx)(Wt.R6,{icon:Wr.Z,to:"/docs/default/component/local",text:"Docs Preview"})]}),a]});var ls=t(80030),lo=t(32388),Qo=t(4142);const co=(0,Br.Z)(a=>({headerIcon:{color:a.palette.common.white,width:"32px",height:"32px"},content:{backgroundColor:a.palette.background.default},contentToolbar:{display:"flex",justifyContent:"flex-end",padding:0}}));var nr;(function(a){a.LIGHT="light",a.DARK="dark"})(nr||(nr={}));const uo=()=>{const a=(0,b.h_)(b.hg),n=co(),[o,l]=(0,W.useState)(a.getActiveThemeId()===nr.DARK?nr.DARK:nr.LIGHT),f={[nr.LIGHT]:{icon:Qo.Z,title:"Dark theme"},[nr.DARK]:{icon:lo.Z,title:"Light theme"}},{title:R,icon:N}=f[o],V=()=>{l(ne=>{const ze=ne===nr.LIGHT?nr.DARK:nr.LIGHT;return a.setActiveThemeId(ze),ze})};return(0,r.jsx)(Hs.Z,{display:"flex",alignItems:"center",mr:2,children:(0,r.jsx)(ls.ZP,{title:R,arrow:!0,children:(0,r.jsx)(Ks.Z,{size:"small",onClick:V,children:(0,r.jsx)(N,{className:n.headerIcon})})})})},ho=()=>(0,r.jsxs)(S.I6,{children:[(0,r.jsx)(M.S,{}),(0,r.jsx)(z.F,{withSearch:!1})]}),Gn=(0,r.jsx)(ho,{}),po=Or({apis:Vo,configLoader:Ho,plugins:Object.values(h)}),Xo=po.getProvider(),qo=po.getRouter(),fo=S.s4.provide((0,Te.KY)({name:"ThemeToggleAddon",component:uo,location:Te.oZ.Header})),_o=(0,r.jsxs)(ts,{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)(Uo,{})}),(0,r.jsx)(g.AW,{path:"/docs",element:(0,r.jsx)(S.Jl,{}),children:(0,r.jsx)(L.u,{})}),(0,r.jsxs)(g.AW,{path:"/docs/:namespace/:kind/:name/*",element:(0,r.jsx)(S.I6,{}),children:[Gn,(0,r.jsx)(Te.DR,{children:(0,r.jsx)(fo,{})})]})]});var $s=()=>(0,r.jsx)(Xo,{children:(0,r.jsx)(qo,{children:(0,r.jsx)(Jo,{children:_o})})});B.render((0,r.jsx)($s,{}),document.getElementById("root"))},51837:function(Rt,Me,t){"use strict";t.d(Me,{CT:function(){return b},EI:function(){return te},uW:function(){return B},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=Q=>`__@backstage/${Q}__`;function B(Q,X){const M=W(Q);let z=r[M];return z||(z=X(),r[M]=z,z)}var g=t(2784);function b(Q){return B(Q,()=>(0,g.createContext)(void 0))}function c(Q){return(0,g.useContext)(b(Q))}function P(Q){return{set(X){globalThis[`__@backstage/${Q}__`]=createContext(createVersionedValueMap(X))},reset(){delete globalThis[`__@backstage/${Q}__`]}}}function te(Q){Object.freeze(Q);const X={atVersion(M){return Q[M]}};return Object.defineProperty(X,"$map",{configurable:!0,enumerable:!0,get(){return Q}}),X}},92848:function(Rt,Me,t){"use strict";t.d(Me,{h$:function(){return Et},n3:function(){return h.n3},_i:function(){return Z},tW:function(){return Oe},df:function(){return ve},UO:function(){return mn},dq:function(){return Fe},nl:function(){return As},dx:function(){return Ve},rI:function(){return Ge},u3:function(){return Tt},xE:function(){return Vn},sL:function(){return bn},LH:function(){return Sn},U_:function(){return xs},pp:function(){return Wt},EW:function(){return Es},Ah:function(){return W},wi:function(){return Te},hF:function(){return rt},CV:function(){return ot},$3:function(){return Ye},p3:function(){return B},ce:function(){return qt},X2:function(){return Ot},wp:function(){return un},ZW:function(){return Ne},N$:function(){return wt},eK:function(){return Ln},CR:function(){return ge}});var h=t(29644),r=t(25248);const W=(0,r.T0)({id:"plugin.catalog.service"}),B=(0,r.T0)({id:"catalog-react.starred-entities"});var g=t(82394);class b{async toggleStarred(x){this.starredEntities.delete(x)||this.starredEntities.add(x);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(x=>(x.next(new Set(this.starredEntities)),this.subscribers.add(x),()=>{this.subscribers.delete(x)}))}}var c=t(52322),P=t(2784),te=t(41156),Q=t(60364),X=t(77277),M=t(4190),z=t(95544),_=t(90436),fe=t(60905),ie=t(36444);const T=v=>{const x=(0,te.Z)(K=>K.breakpoints.down("md")),I=(0,Q.Z)(),[$,J]=(0,P.useState)(!1);return x?(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(X.Z,{style:{marginTop:I.spacing(1),marginLeft:I.spacing(1)},onClick:()=>J(!0),startIcon:(0,c.jsx)(ie.Z,{}),children:"Filters"}),(0,c.jsx)(M.ZP,{open:$,onClose:()=>J(!1),anchor:"left",disableAutoFocus:!0,keepMounted:!0,variant:"temporary",children:(0,c.jsxs)(z.Z,{m:2,children:[(0,c.jsx)(_.Z,{variant:"h6",component:"h2",style:{marginBottom:I.spacing(1)},children:"Filters"}),v.children]})})]}):(0,c.jsx)(fe.Z,{item:!0,lg:2,children:v.children})},L=v=>(0,c.jsx)(fe.Z,{item:!0,xs:12,lg:10,children:v.children}),Z=v=>(0,c.jsx)(fe.Z,{container:!0,style:{position:"relative"},children:v.children});Z.Filters=T,Z.Content=L;var A=t(93414),S=t(25271),q=t(51837);const Te=(0,q.uW)("catalog:entity-route-ref",()=>(0,r.NT)({id:"catalog:entity",params:["namespace","kind","name"]}));function Qe(v){var x,I;return{kind:v.kind.toLocaleLowerCase("en-US"),namespace:(I=(x=v.metadata.namespace)===null||x===void 0?void 0:x.toLocaleLowerCase("en-US"))!==null&&I!==void 0?I:DEFAULT_NAMESPACE,name:v.metadata.name}}function Ye(v,x){const I=x==null?void 0:x.defaultKind;let $,J,K;return"metadata"in v?($=v.kind,J=v.metadata.namespace,K=v.metadata.name):($=v.kind,J=v.namespace,K=v.name),(J===void 0||J==="")&&(J=S.zG),(x==null?void 0:x.defaultNamespace)!==void 0?(x==null?void 0:x.defaultNamespace)===J&&(J=void 0):J===S.zG&&(J=void 0),$=$.toLocaleLowerCase("en-US"),$=I&&I.toLocaleLowerCase("en-US")===$?void 0:$,`${$?`${$}:`:""}${J?`${J}/`:""}${K}`}var Xe=t(80030);const Ve=(0,P.forwardRef)((v,x)=>{const{entityRef:I,defaultKind:$,title:J,children:K,...oe}=v,le=(0,r.tg)(Te);let Se,Be,$e;if(typeof I=="string"){const et=(0,S.of)(I);Se=et.kind,Be=et.namespace,$e=et.name}else"metadata"in I?(Se=I.kind,Be=I.metadata.namespace,$e=I.metadata.name):(Se=I.kind,Be=I.namespace,$e=I.name);Se=Se.toLocaleLowerCase("en-US");var Ae;Be=(Ae=Be==null?void 0:Be.toLocaleLowerCase("en-US"))!==null&&Ae!==void 0?Ae:S.zG;const Je={kind:Se,namespace:Be,name:$e},xt=Ye({kind:Se,namespace:Be,name:$e},{defaultKind:$}),It=(0,c.jsxs)(A.rU,{...oe,ref:x,to:le(Je),children:[K,!K&&(J!=null?J:xt)]});return J?(0,c.jsx)(Xe.ZP,{title:xt,children:It}):It});var ft=t(64279);function je(v){const{entityRefs:x,defaultKind:I,getTitle:$,...J}=v,K=(0,r.h_)(W),{value:oe=new Array,loading:le,error:Se}=(0,ft.default)(async()=>{const Be=x.reduce((Ae,Je)=>"metadata"in Je?Ae:[...Ae,(0,S.of)(Je)],new Array),$e=x.filter(Ae=>"metadata"in Ae);return Be.length>0?[...(await K.getEntities({filter:Be.map(Ae=>({kind:Ae.kind,"metadata.namespace":Ae.namespace,"metadata.name":Ae.name}))})).items,...$e]:$e},[x]);return le?(0,c.jsx)(A.Ex,{}):Se?(0,c.jsx)(A.yu,{error:Se}):(0,c.jsx)(c.Fragment,{children:oe.map((Be,$e)=>(0,c.jsxs)(P.Fragment,{children:[$e>0&&", ",(0,c.jsx)(Ve,{...J,defaultKind:I,entityRef:Be,title:$(Be)})]},$e))})}function Ge(v){const{entityRefs:x,defaultKind:I,fetchEntities:$,getTitle:J,...K}=v;return $?(0,c.jsx)(je,{...K,defaultKind:I,entityRefs:x,getTitle:J}):(0,c.jsx)(c.Fragment,{children:x.map((oe,le)=>(0,c.jsxs)(P.Fragment,{children:[le>0&&", ",(0,c.jsx)(Ve,{...K,defaultKind:I,entityRef:oe,title:J?J(oe):void 0})]},le))})}function st(v){return v.reduce((x,I)=>({...x,...I.getCatalogFilters?I.getCatalogFilters():{}}),{})}function gt(v){return x=>v.every(I=>!I.filterEntity||I.filterEntity(x))}function rt(v,x,I){var $;let J=(v==null||($=v.relations)===null||$===void 0?void 0:$.filter(K=>K.type===x).map(K=>(0,S.of)(K.targetRef)))||[];return I!=null&&I.kind&&(J=J.filter(K=>K.kind.toLocaleLowerCase("en-US")===I.kind.toLocaleLowerCase("en-US"))),J}function ot(v,x){var I;const $=(I=v.metadata.annotations)===null||I===void 0?void 0:I[S.M6];if(!!$)try{const J=(0,S.Ou)($),K=x.byUrl(J.target);return{locationTargetUrl:J.target,integrationType:K==null?void 0:K.type}}catch{return}}function ct(v,x){const I=new Set([...getEntityRelations(v,RELATION_MEMBER_OF,{kind:"group"}),...v?[getCompoundEntityRef(v)]:[]].map(stringifyEntityRef)),$=getEntityRelations(x,RELATION_OWNED_BY).map(stringifyEntityRef);for(const J of $)if(I.has(J))return!0;return!1}class yt{getCatalogFilters(){return{kind:this.value}}toQueryValue(){return this.value}constructor(x){this.value=x}}class Lt{getTypes(){return Array.isArray(this.value)?this.value:[this.value]}getCatalogFilters(){return{"spec.type":this.getTypes()}}toQueryValue(){return this.getTypes()}constructor(x){this.value=x}}class We{filterEntity(x){var I;return this.values.every($=>((I=x.metadata.tags)!==null&&I!==void 0?I:[]).includes($))}toQueryValue(){return this.values}constructor(x){this.values=x}}class se{filterEntity(x){const I=this.toUpperArray(this.value.split(/\s/)),$=this.toUpperArray([x.metadata.tags]),J=this.toUpperArray([x.metadata.name,x.metadata.title]);for(const K of I)if($.every(oe=>oe!==K)&&J.every(oe=>!oe.includes(K)))return!1;return!0}toUpperArray(x){return x.flat().filter(I=>Boolean(I)).map(I=>I.toLocaleUpperCase("en-US"))}constructor(x){this.value=x}}class Ie{filterEntity(x){return this.values.some(I=>rt(x,S.S4).some($=>Ye($,{defaultKind:"group"})===I))}toQueryValue(){return this.values}constructor(x){this.values=x}}class Re{filterEntity(x){return this.values.some(I=>{var $;return(($=x.spec)===null||$===void 0?void 0:$.lifecycle)===I})}toQueryValue(){return this.values}constructor(x){this.values=x}}class tt{filterEntity(x){switch(this.value){case"owned":return this.isOwnedEntity(x);case"starred":return this.isStarredEntity(x);default:return!0}}toQueryValue(){return this.value}constructor(x,I,$){this.value=x,this.isOwnedEntity=I,this.isStarredEntity=$}}class mt{filterEntity(x){var I;const $=(I=x.metadata.annotations)===null||I===void 0?void 0:I["backstage.io/orphan"];return $!==void 0&&this.value.toString()===$}constructor(x){this.value=x}}class Zt{filterEntity(x){var I,$;const J=(x==null||(I=x.status)===null||I===void 0||($=I.items)===null||$===void 0?void 0:$.length)>0;return J!==void 0&&this.value===J}constructor(x){this.value=x}}const dt=(0,q.CT)("entity-context"),Et=({children:v,entity:x,loading:I,error:$,refresh:J})=>{const K={entity:x,loading:I,error:$,refresh:J};return(0,c.jsx)(dt.Provider,{value:(0,q.EI)({1:K}),children:(0,c.jsx)(r.fC,{attributes:{...x?{entityRef:(0,S.eE)(x)}:void 0},children:v})})},At=v=>_jsx(Et,{entity:v.entity,loading:!Boolean(v.entity),error:void 0,refresh:void 0,children:v.children});function Ot(){const v=(0,q.Vt)("entity-context");if(!v)throw new Error("Entity context is not available");const x=v.atVersion(1);if(!x)throw new Error("EntityContext v1 not available");if(!x.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:x.entity}}function qt(){const v=(0,q.Vt)("entity-context");if(!v)throw new Error("Entity context is not available");const x=v.atVersion(1);if(!x)throw new Error("EntityContext v1 not available");const{entity:I,loading:$,error:J,refresh:K}=x;return{entity:I,loading:$,error:J,refresh:K}}var Vt=t(76635),Ht=t(19126),Jt=t.n(Ht),dn=t(79635),an=t(69294),Fn=t(48760),En=t(90736);const Un=(0,P.createContext)(void 0),mn=({children:v})=>{const x=(0,En.default)(),I=(0,r.h_)(W),[$,J]=(0,P.useState)({}),K=(0,dn.TH)();var oe;const le=(0,P.useMemo)(()=>(oe=Jt().parse(K.search,{ignoreQueryPrefix:!0}).filters)!==null&&oe!==void 0?oe:{},[K]),[Se,Be]=(0,P.useState)(()=>({appliedFilters:{},entities:[],backendEntities:[]})),[{loading:$e,error:Ae},Je]=(0,an.default)(async()=>{const et=(0,Vt.compact)(Object.values($)),$t=gt(et),Dt=st(et),fn=st((0,Vt.compact)(Object.values(Se.appliedFilters))),rn=Object.keys($).reduce((wn,Tn)=>{const In=$[Tn];return In!=null&&In.toQueryValue&&(wn[Tn]=In.toQueryValue()),wn},{});if((0,Vt.isEqual)(fn,Dt))Be({appliedFilters:$,backendEntities:Se.backendEntities,entities:Se.backendEntities.filter($t)});else{const wn=await I.getEntities({filter:Dt});Be({appliedFilters:$,backendEntities:wn.items,entities:wn.items.filter($t)})}if(x()){var tr;const wn=Jt().parse(K.search,{ignoreQueryPrefix:!0}),Tn=Jt().stringify({...wn,filters:rn},{addQueryPrefix:!0,arrayFormat:"repeat"}),In=`${window.location.pathname}${Tn}`;(tr=window.history)===null||tr===void 0||tr.replaceState(null,document.title,In)}},[I,le,$,Se],{loading:!0});(0,Fn.Z)(Je,10,[$]);const xt=(0,P.useCallback)(et=>{J($t=>{const Dt=typeof et=="function"?et($t):et;return{...$t,...Dt}})},[]),It=(0,P.useMemo)(()=>({filters:Se.appliedFilters,entities:Se.entities,backendEntities:Se.backendEntities,updateFilters:xt,queryParameters:le,loading:$e,error:Ae}),[Se,xt,le,$e,Ae]);return(0,c.jsx)(Un.Provider,{value:It,children:v})};function un(){const v=(0,P.useContext)(Un);if(!v)throw new Error("useEntityList must be used within EntityListProvider");return v}var Qt=t(18149),Mn=t.n(Qt),zn=t(829),hn=t.n(zn);function vn(){const v=(0,r.h_)(W),{filters:{kind:x,type:I},queryParameters:{type:$},updateFilters:J}=un(),K=(0,P.useMemo)(()=>[$].flat().filter(Boolean),[$]);var oe;const[le,Se]=(0,P.useState)(K.length?K:(oe=I==null?void 0:I.getTypes())!==null&&oe!==void 0?oe:[]);(0,P.useEffect)(()=>{K.length&&Se(K)},[K]);const[Be,$e]=(0,P.useState)([]),Ae=(0,P.useMemo)(()=>x==null?void 0:x.value,[x]),{error:Je,loading:xt,value:It}=(0,ft.default)(async()=>Ae?await v.getEntityFacets({filter:{kind:Ae},facets:["spec.type"]}).then(Dt=>Dt.facets["spec.type"]||[]):[],[Ae,v]),et=(0,P.useRef)(It);return(0,P.useEffect)(()=>{const $t=et.current;if(et.current=It,xt||!Ae||$t===It||!It)return;const Dt=[...new Set(hn()(It,rn=>-rn.count).map(rn=>rn.value.toLocaleLowerCase("en-US")))];$e(Dt);const fn=le.filter(rn=>Dt.includes(rn));Mn()(le,fn)||Se(fn)},[xt,Ae,le,Se,It]),(0,P.useEffect)(()=>{J({type:le.length?new Lt(le):void 0})},[le,J]),{loading:xt,error:Je,availableTypes:Be,selectedTypes:le,setSelectedTypes:Se}}const yn=20;function Ln(v,x){var I,$;const J=x==null||(I=x.type)===null||I===void 0?void 0:I.toLocaleLowerCase("en-US"),K=x==null||($=x.kind)===null||$===void 0?void 0:$.toLocaleLowerCase("en-US"),oe=(0,r.h_)(W),{loading:le,value:Se,error:Be}=(0,ft.default)(async()=>{var $e;const Ae=($e=v.relations)===null||$e===void 0?void 0:$e.map(et=>({type:et.type,target:(0,S.of)(et.targetRef)})).filter(et=>(!J||et.type.toLocaleLowerCase("en-US")===J)&&(!K||et.target.kind===K));if(!Ae)return[];const Je=Object.values((0,Vt.groupBy)(Ae,({target:et})=>`${et.kind}:${et.namespace}`.toLocaleLowerCase("en-US"))),xt=[];for(const et of Je)xt.push({kind:et[0].target.kind,namespace:et[0].target.namespace,nameBatches:(0,Vt.chunk)(et.map($t=>$t.target.name),yn)});return(await Promise.all(xt.flatMap(et=>et.nameBatches.map($t=>oe.getEntities({filter:{kind:et.kind,"metadata.namespace":et.namespace,"metadata.name":$t}}))))).flatMap(et=>et.items)},[v,J,K]);return{entities:Se,loading:le,error:Be}}var Pn=t(72164);function xn(v){return typeof v=="string"?v:(0,S.eE)(v)}function ge(){const v=(0,r.h_)(B),x=(0,Pn.Z)(v.starredEntitie$(),new Set),I=(0,P.useCallback)(J=>x.has(xn(J)),[x]),$=(0,P.useCallback)(J=>v.toggleStarred(xn(J)).then(),[v]);return{starredEntities:x,toggleStarredEntity:$,isStarredEntity:I}}function ee(v){return typeof v=="string"?v:(0,S.eE)(v)}function Ee(v){const x=(0,r.h_)(B),[I,$]=(0,P.useState)(!1);return(0,P.useEffect)(()=>{const K=x.starredEntitie$().subscribe({next(oe){$(oe.has(ee(v)))}});return()=>{K.unsubscribe()}},[v,x]),{toggleStarredEntity:(0,P.useCallback)(()=>x.toggleStarred(ee(v)).then(),[v,x]),isStarredEntity:I}}function Ne(){const v=(0,r.h_)(r.$4),{loading:x,value:I}=(0,ft.default)(async()=>{const{ownershipEntityRefs:J}=await v.getBackstageIdentity();return J},[]),$=(0,P.useMemo)(()=>{const J=new Set(I!=null?I:[]);return K=>{const oe=rt(K,S.S4).map(S.eE);for(const le of oe)if(J.has(le))return!0;return!1}},[I]);return(0,P.useMemo)(()=>({loading:x,isOwnedEntity:$}),[x,$])}var _e=t(25488);function wt(v){const{entity:x,loading:I,error:$}=qt(),{allowed:J,loading:K,error:oe}=(0,_e.gI)({permission:v,resourceRef:x?(0,S.eE)(x):void 0});return I||K?{loading:!0,allowed:!1}:$?{loading:!1,allowed:!1,error:$}:{loading:!1,allowed:J,error:oe}}function ae(){const v=(0,r.h_)(W),{error:x,loading:I,value:$}=(0,ft.default)(async()=>await v.getEntityFacets({facets:["kind"]}).then(K=>{var oe;return((oe=K.facets.kind)===null||oe===void 0?void 0:oe.map(le=>le.value).sort())||[]}),[v]);return{loading:I,error:x,allKinds:$!=null?$:[]}}function k(v,x,I){let $=v;return x&&($=$.filter(K=>x.some(oe=>oe.toLocaleLowerCase("en-US")===K.toLocaleLowerCase("en-US")))),I&&!v.some(K=>K.toLocaleLowerCase("en-US")===I.toLocaleLowerCase("en-US"))&&($=$.concat([I])),$.sort().reduce((K,oe)=>(K[oe.toLocaleLowerCase("en-US")]=oe,K),{})}function ce(v){var x;const{filters:I,queryParameters:{kind:$},updateFilters:J}=un(),K=(0,P.useMemo)(()=>[$].flat()[0],[$]);var oe;const[le,Se]=(0,P.useState)((oe=K!=null?K:(x=I.kind)===null||x===void 0?void 0:x.value)!==null&&oe!==void 0?oe:v.initialFilter);(0,P.useEffect)(()=>{K&&Se(K)},[K]),(0,P.useEffect)(()=>{var Je;if(!((Je=I.kind)===null||Je===void 0)&&Je.value){var xt;Se((xt=I.kind)===null||xt===void 0?void 0:xt.value)}},[I.kind]),(0,P.useEffect)(()=>{J({kind:le?new yt(le):void 0})},[le,J]);const{allKinds:Be,loading:$e,error:Ae}=ae();return{loading:$e,error:Ae,allKinds:Be!=null?Be:[],selectedKind:le,setSelectedKind:Se}}const Oe=v=>{const{allowedKinds:x,hidden:I,initialFilter:$="component"}=v,J=(0,r.h_)(r.$v),{error:K,allKinds:oe,selectedKind:le,setSelectedKind:Se}=ce({initialFilter:$});if((0,P.useEffect)(()=>{K&&J.post({message:"Failed to load entity kinds",severity:"error"})},[K,J]),K)return null;const Be=k(oe,x,le),$e=Object.keys(Be).map(Ae=>({value:Ae,label:Be[Ae]}));return I?null:(0,c.jsx)(z.Z,{pb:1,pt:1,children:(0,c.jsx)(A.Ph,{label:"Kind",items:$e,selected:le.toLocaleLowerCase("en-US"),onChange:Ae=>Se(String(Ae))})})};var D=t(79692),U=t(5806),de=t(21324),pe=t(86619),ye=t(19996),Pe=t(25505),Le=t(38016),Ue=t(88013);const nt=(0,D.Z)({input:{}},{name:"CatalogReactEntityLifecyclePicker"}),w=(0,c.jsx)(Pe.Z,{fontSize:"small"}),H=(0,c.jsx)(ye.Z,{fontSize:"small"}),ve=()=>{var v;const x=nt(),{updateFilters:I,backendEntities:$,filters:J,queryParameters:{lifecycles:K}}=un(),oe=(0,P.useMemo)(()=>[K].flat().filter(Boolean),[K]);var le;const[Se,Be]=(0,P.useState)(oe.length?oe:(le=(v=J.lifecycles)===null||v===void 0?void 0:v.values)!==null&&le!==void 0?le:[]);(0,P.useEffect)(()=>{oe.length&&Be(oe)},[oe]);const $e=(0,P.useMemo)(()=>[...new Set($.map(Ae=>{var Je;return(Je=Ae.spec)===null||Je===void 0?void 0:Je.lifecycle}).filter(Boolean))].sort(),[$]);return(0,P.useEffect)(()=>{I({lifecycles:Se.length&&$e.length?new Re(Se):void 0})},[Se,I,$e]),$e.length?(0,c.jsx)(z.Z,{pb:1,pt:1,children:(0,c.jsxs)(_.Z,{variant:"button",component:"label",children:["Lifecycle",(0,c.jsx)(Ue.ZP,{multiple:!0,options:$e,value:Se,onChange:(Ae,Je)=>Be(Je),renderOption:(Ae,{selected:Je})=>(0,c.jsx)(U.Z,{control:(0,c.jsx)(de.Z,{icon:w,checkedIcon:H,checked:Je}),label:Ae}),size:"small",popupIcon:(0,c.jsx)(Le.Z,{"data-testid":"lifecycle-picker-expand"}),renderInput:Ae=>(0,c.jsx)(pe.Z,{...Ae,className:x.input,variant:"outlined"})})]})}):null},ue=(0,D.Z)({input:{}},{name:"CatalogReactEntityOwnerPicker"}),we=(0,c.jsx)(Pe.Z,{fontSize:"small"}),ke=(0,c.jsx)(ye.Z,{fontSize:"small"}),Fe=()=>{var v;const x=ue(),{updateFilters:I,backendEntities:$,filters:J,queryParameters:{owners:K}}=un(),oe=(0,P.useMemo)(()=>[K].flat().filter(Boolean),[K]);var le;const[Se,Be]=(0,P.useState)(oe.length?oe:(le=(v=J.owners)===null||v===void 0?void 0:v.values)!==null&&le!==void 0?le:[]);(0,P.useEffect)(()=>{oe.length&&Be(oe)},[oe]);const $e=(0,P.useMemo)(()=>[...new Set($.flatMap(Ae=>rt(Ae,S.S4).map(Je=>Ye(Je,{defaultKind:"group"}))).filter(Boolean))].sort(),[$]);return(0,P.useEffect)(()=>{I({owners:Se.length&&$e.length?new Ie(Se):void 0})},[Se,I,$e]),$e.length?(0,c.jsx)(z.Z,{pb:1,pt:1,children:(0,c.jsxs)(_.Z,{variant:"button",component:"label",children:["Owner",(0,c.jsx)(Ue.ZP,{multiple:!0,options:$e,value:Se,onChange:(Ae,Je)=>Be(Je),renderOption:(Ae,{selected:Je})=>(0,c.jsx)(U.Z,{control:(0,c.jsx)(de.Z,{icon:we,checkedIcon:ke,checked:Je}),label:Ae}),size:"small",popupIcon:(0,c.jsx)(Le.Z,{"data-testid":"owner-picker-expand"}),renderInput:Ae=>(0,c.jsx)(pe.Z,{...Ae,className:x.input,variant:"outlined"})})]})}):null},it=(0,D.Z)(v=>({searchToolbar:{paddingLeft:0,paddingRight:0},input:{}}),{name:"CatalogReactEntitySearchBar"}),Ct=()=>{var v;const x=it(),{filters:I,updateFilters:$}=useEntityList();var J;const[K,oe]=useState((J=(v=I.text)===null||v===void 0?void 0:v.value)!==null&&J!==void 0?J:"");return useDebounce(()=>{$({text:K.length?new EntityTextFilter(K):void 0})},250,[K,$]),_jsx(Toolbar,{className:x.searchToolbar,children:_jsx(FormControl,{children:_jsx(Input,{"aria-label":"search",id:"input-with-icon-adornment",className:x.input,placeholder:"Search",autoComplete:"off",onChange:le=>oe(le.target.value),value:K,startAdornment:_jsx(InputAdornment,{position:"start",children:_jsx(Search,{})}),endAdornment:_jsx(InputAdornment,{position:"end",children:_jsx(IconButton,{"aria-label":"clear search",onClick:()=>oe(""),edge:"end",disabled:K.length===0,children:_jsx(Clear,{})})})})})})},Ke=Object.freeze({createEntityRefColumn(v){const{defaultKind:x}=v;function I($){var J;return((J=$.metadata)===null||J===void 0?void 0:J.title)||Ye($,{defaultKind:x})}return{title:"Name",highlight:!0,customFilterAndSearch($,J){return I(J).includes($)},customSort($,J){return I($).localeCompare(I(J))},render:$=>{var J;return(0,c.jsx)(Ve,{entityRef:$,defaultKind:x,title:(J=$.metadata)===null||J===void 0?void 0:J.title})}}},createEntityRelationColumn(v){const{title:x,relation:I,defaultKind:$,filter:J}=v;function K(le){return rt(le,I,J)}function oe(le){return K(le).map(Se=>Ye(Se,{defaultKind:$})).join(", ")}return{title:x,customFilterAndSearch(le,Se){return oe(Se).includes(le)},customSort(le,Se){return oe(le).localeCompare(oe(Se))},render:le=>(0,c.jsx)(Ge,{entityRefs:K(le),defaultKind:$})}},createOwnerColumn(){return this.createEntityRelationColumn({title:"Owner",relation:S.S4,defaultKind:"group"})},createDomainColumn(){return this.createEntityRelationColumn({title:"Domain",relation:S.cz,defaultKind:"domain",filter:{kind:"domain"}})},createSystemColumn(){return this.createEntityRelationColumn({title:"System",relation:S.cz,defaultKind:"system",filter:{kind:"system"}})},createMetadataDescriptionColumn(){return{title:"Description",field:"metadata.description",render:v=>(0,c.jsx)(A.Or,{text:v.metadata.description,placement:"bottom-start",line:2})}},createSpecLifecycleColumn(){return{title:"Lifecycle",field:"spec.lifecycle"}},createSpecTypeColumn(){return{title:"Type",field:"spec.type"}}}),ht=[Ke.createEntityRefColumn({defaultKind:"system"}),Ke.createDomainColumn(),Ke.createOwnerColumn(),Ke.createMetadataDescriptionColumn()],vt=[Ke.createEntityRefColumn({defaultKind:"component"}),Ke.createSystemColumn(),Ke.createOwnerColumn(),Ke.createSpecTypeColumn(),Ke.createSpecLifecycleColumn(),Ke.createMetadataDescriptionColumn()],at=(0,D.Z)(v=>({empty:{padding:v.spacing(2),display:"flex",justifyContent:"center"}})),Tt=v=>{const{entities:x,title:I,emptyContent:$,variant:J="gridItem",columns:K}=v,oe=at(),le={minWidth:"0",width:"100%"};return J==="gridItem"&&(le.height="calc(100% - 10px)"),(0,c.jsx)(A.iA,{columns:K,title:I,style:le,emptyContent:$&&(0,c.jsx)("div",{className:oe.empty,children:$}),options:{search:!1,paging:!1,actionsColumnIndex:-1,padding:"dense",draggable:!1},data:x})};Tt.columns=Ke,Tt.systemEntityColumns=ht,Tt.componentEntityColumns=vt;const Ut=(0,D.Z)({input:{}},{name:"CatalogReactEntityTagPicker"}),Mt=(0,c.jsx)(Pe.Z,{fontSize:"small"}),Wn=(0,c.jsx)(ye.Z,{fontSize:"small"}),Vn=v=>{var x;const I=Ut(),{updateFilters:$,filters:J,queryParameters:{tags:K}}=un(),oe=(0,r.h_)(W),{value:le}=(0,ft.default)(async()=>{var Je;const xt="metadata.tags",{facets:It}=await oe.getEntityFacets({facets:[xt],filter:(Je=J.kind)===null||Je===void 0?void 0:Je.getCatalogFilters()});return Object.fromEntries(It[xt].map(({value:et,count:$t})=>[et,$t]))},[J.kind]),Se=(0,P.useMemo)(()=>[K].flat().filter(Boolean),[K]);var Be;const[$e,Ae]=(0,P.useState)(Se.length?Se:(Be=(x=J.tags)===null||x===void 0?void 0:x.values)!==null&&Be!==void 0?Be:[]);return(0,P.useEffect)(()=>{Se.length&&Ae(Se)},[Se]),(0,P.useEffect)(()=>{const Je=Object.keys(le!=null?le:{});$({tags:$e.length&&Je.length?new We($e):void 0})},[$e,$,le]),Object.keys(le!=null?le:{}).length?(0,c.jsx)(z.Z,{pb:1,pt:1,children:(0,c.jsxs)(_.Z,{variant:"button",component:"label",children:["Tags",(0,c.jsx)(Ue.ZP,{multiple:!0,options:Object.keys(le!=null?le:{}),value:$e,onChange:(Je,xt)=>Ae(xt),renderOption:(Je,{selected:xt})=>(0,c.jsx)(U.Z,{control:(0,c.jsx)(de.Z,{icon:Mt,checkedIcon:Wn,checked:xt}),label:v.showCounts?`${Je} (${le==null?void 0:le[Je]})`:Je}),size:"small",popupIcon:(0,c.jsx)(Le.Z,{"data-testid":"tag-picker-expand"}),renderInput:Je=>(0,c.jsx)(pe.Z,{...Je,className:I.input,variant:"outlined"})})]})}):null},bn=v=>{const{hidden:x,initialFilter:I}=v,$=(0,r.h_)(r.$v),{error:J,availableTypes:K,selectedTypes:oe,setSelectedTypes:le}=vn();if((0,P.useEffect)(()=>{J&&$.post({message:"Failed to load entity types",severity:"error"}),I&&le([I])},[J,$,I,le]),K.length===0||J)return null;const Se=[{value:"all",label:"all"},...K.map($e=>({value:$e,label:$e}))];var Be;return x?null:(0,c.jsx)(z.Z,{pb:1,pt:1,children:(0,c.jsx)(A.Ph,{label:"Type",items:Se,selected:(Be=Se.length>1?oe[0]:void 0)!==null&&Be!==void 0?Be:"all",onChange:$e=>le($e==="all"?[]:[String($e)])})})};var Nt=t(15459),zt=t(61837),_t=t(11640),kn=t(28347);const Jn=(0,Nt.Z)({root:{color:"#f3ba37"}})(_t.Z),Sn=v=>{const{toggleStarredEntity:x,isStarredEntity:I}=Ee(v.entity);return(0,c.jsx)(zt.Z,{"aria-label":"favorite",color:"inherit",...v,onClick:()=>x(),children:(0,c.jsx)(Xe.ZP,{title:I?"Remove from favorites":"Add to favorites",children:I?(0,c.jsx)(Jn,{}):(0,c.jsx)(kn.Z,{})})})};var pn=t(8629),Hn=t(79249),ln=t(38724),On=t(99152),Qn=t(6487),C=t(49429),d=t(55999),y=t(72779),j=t.n(y),Y=t(39412);const me=Y.Z;function be(v,x){if(v)return v.toLocaleLowerCase("en-US");if(x)try{return(0,S.of)(x).kind.toLocaleLowerCase("en-US")}catch{return}}function De(v,x){const I=(0,r.qD)(),$=be(v,x);return $&&I.getSystemIcon(`kind:${$}`)||me}function pt(v){const{kind:x,entityRef:I,...$}=v,J=De(x,I);return(0,c.jsx)(J,{...$})}const Ft=(0,D.Z)(v=>({node:{fill:v.palette.grey[300],stroke:v.palette.grey[300],"&.primary":{fill:v.palette.primary.light,stroke:v.palette.primary.light},"&.secondary":{fill:v.palette.secondary.light,stroke:v.palette.secondary.light}},text:{fill:v.palette.getContrastText(v.palette.grey[300]),"&.primary":{fill:v.palette.primary.contrastText},"&.secondary":{fill:v.palette.secondary.contrastText},"&.focused":{fontWeight:"bold"}},clickable:{cursor:"pointer"}}));function en(v){const x=(0,r.h_)(W),I=(0,S.eE)(v),{loading:$,error:J,value:K}=(0,ft.default)(async()=>{const oe=await x.getEntityAncestors({entityRef:I}),le=new Array,Se=new Array;for(const Be of oe.items){const $e=(0,S.eE)(Be.entity),Ae=$e===oe.rootEntityRef;le.push({id:$e,root:Ae,...Be.entity});for(const Je of Be.parentEntityRefs)Se.push({from:$e,to:Je})}return{nodes:le,edges:Se}},[I]);return{loading:$,error:J,nodes:(K==null?void 0:K.nodes)||[],edges:(K==null?void 0:K.edges)||[]}}function Bn({node:v}){const x=Ft(),I=(0,dn.s0)(),$=(0,r.tg)(Te),[J,K]=(0,P.useState)(0),[oe,le]=(0,P.useState)(0),Se=(0,P.useRef)(null);(0,P.useLayoutEffect)(()=>{if(Se.current){let{height:$t,width:Dt}=Se.current.getBBox();$t=Math.round($t),Dt=Math.round(Dt),($t!==oe||Dt!==J)&&(K(Dt),le($t))}},[J,oe]);const Be=10,$e=oe,Ae=$e+Be,Je=Ae+J+Be*2,xt=oe+Be*2,It=v.metadata.title||(v.kind&&v.metadata.name&&v.metadata.namespace?Ye({kind:v.kind,name:v.metadata.name,namespace:v.metadata.namespace||""}):v.id),et=()=>{I($({kind:v.kind,namespace:v.metadata.namespace||S.zG,name:v.metadata.name}))};return(0,c.jsxs)("g",{onClick:et,className:x.clickable,children:[(0,c.jsx)("rect",{className:j()(x.node,v.root?"secondary":"primary"),width:Je,height:xt,rx:10}),(0,c.jsx)(pt,{kind:v.kind,y:Be,x:Be,width:$e,height:$e,className:j()(x.text,v.root?"secondary":"primary")}),(0,c.jsx)("text",{ref:Se,className:j()(x.text,v.root?"secondary":"primary"),y:xt/2,x:Ae+(J+Be*2)/2,textAnchor:"middle",alignmentBaseline:"middle",children:It})]})}function Er(v){const{loading:x,error:I,nodes:$,edges:J}=en(v.entity);return x?(0,c.jsx)(A.Ex,{}):I?(0,c.jsx)(A.Gk,{error:I}):(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(d.Z,{variant:"h2",children:"Ancestry"}),(0,c.jsxs)(d.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)(z.Z,{mt:4,children:(0,c.jsx)(A.mn,{nodes:$,edges:J,renderNode:Bn,direction:A.NX.Nm.BOTTOM_TOP,zoom:"enable-on-click"})})]})}var rr=t(11776),Xn=t(38402),pr=t(86136),_n=t(99688),Ar=t(49378),Yr=t(54506),fr=t(94339),Tr=t(24579),ps=t(27685);const Dr=(0,D.Z)(v=>({root:{display:"flex",flexDirection:"column"},marginTop:{marginTop:v.spacing(2)},helpIcon:{marginLeft:v.spacing(1),color:v.palette.text.disabled},monospace:{fontFamily:"monospace"}}));function er(v){const x=Dr();return(0,c.jsx)(Ar.Z,{...v,primaryTypographyProps:{className:x.monospace},secondaryTypographyProps:{className:x.monospace}})}function Ir(v){const x=Dr();return(0,c.jsx)(Yr.Z,{className:x.monospace,children:v.children})}function Nr(v){return(0,c.jsx)(z.Z,{mt:2,children:(0,c.jsx)(fr.Z,{variant:"outlined",children:(0,c.jsxs)(Tr.Z,{children:[(0,c.jsxs)(_.Z,{variant:"h6",gutterBottom:!0,children:[v.title,v.helpLink&&(0,c.jsx)(Jr,{to:v.helpLink})]}),v.children]})})})}function fs(v){if(v.match(/^url:https?:\/\//))return v.slice(4);if(v.match(/^https?:\/\//))return v}function Fr(v){const[x,I]=v.entry,$=fs(I);return(0,c.jsxs)(Xn.Z,{children:[v.indent&&(0,c.jsx)(pr.Z,{}),(0,c.jsx)(er,{primary:x,secondary:$?(0,c.jsx)(A.rU,{to:$,children:I}):I})]})}function Jr(v){const x=Dr();return(0,c.jsx)(A.rU,{to:v.to,className:x.helpIcon,children:(0,c.jsx)(ps.Z,{fontSize:"inherit"})})}const Qr=(0,D.Z)({root:{display:"flex",flexDirection:"column"}});function sr(v){var x,I;const $=(0,r.h_)(W),J=(0,S.eE)(v),K=(x=v.metadata.annotations)===null||x===void 0?void 0:x[S.P1],oe=(I=v.metadata.annotations)===null||I===void 0?void 0:I[S.q1],{loading:le,error:Se,value:Be}=(0,ft.default)(async()=>!K&&!oe?[]:(await $.getEntities({filter:[...K?[{[`metadata.annotations.${S.P1}`]:K}]:[],...oe?[{[`metadata.annotations.${S.q1}`]:oe}]:[]]})).items,[K,oe]);return{loading:le,error:Se,location:K,originLocation:oe,colocatedEntities:Be==null?void 0:Be.filter($e=>(0,S.eE)($e)!==J)}}function gr(v){return(0,c.jsxs)(rr.Z,{dense:!0,children:[v.header&&(0,c.jsx)(Fr,{entry:v.header},"header"),v.entities.map(x=>(0,c.jsxs)(Xn.Z,{children:[(0,c.jsx)(pr.Z,{children:(0,c.jsx)(pt,{kind:x.kind})}),(0,c.jsx)(er,{primary:(0,c.jsx)(Ve,{entityRef:x})})]},(0,S.eE)(x)))]})}function Fs(v){const{entity:x}=v,{loading:I,error:$,location:J,originLocation:K,colocatedEntities:oe}=sr(x);if(I)return(0,c.jsx)(A.Ex,{});if($)return(0,c.jsx)(A.Gk,{error:$});if(!J&&!K)return(0,c.jsx)(_n.Z,{severity:"warning",children:"Entity had no location information."});if(!(oe!=null&&oe.length))return(0,c.jsx)(_n.Z,{severity:"info",children:"There were no other entities on this location."});if(J===K)return(0,c.jsx)(gr,{entities:oe});const le=oe.filter(Be=>{var $e;return(($e=Be.metadata.annotations)===null||$e===void 0?void 0:$e[S.P1])===J}),Se=oe.filter(Be=>{var $e;return(($e=Be.metadata.annotations)===null||$e===void 0?void 0:$e[S.q1])===K});return(0,c.jsxs)(c.Fragment,{children:[le.length>0&&(0,c.jsx)(gr,{entities:le,header:["At the same location",J]}),Se.length>0&&(0,c.jsx)(gr,{entities:Se,header:["At the same origin",K]})]})}function gs(v){const x=Qr();return(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(d.Z,{variant:"h2",children:"Colocated"}),(0,c.jsx)(d.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:x.root,children:(0,c.jsx)(Fs,{entity:v.entity})})]})}function Xr(v){return Object.fromEntries([...Object.entries(v)].sort((x,I)=>x[0]<I[0]?-1:1))}function Us(v){return(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(d.Z,{variant:"h2",children:"Entity as JSON"}),(0,c.jsx)(d.Z,{children:"This is the raw entity data as received from the catalog, on JSON form."}),(0,c.jsx)(d.Z,{children:(0,c.jsx)("div",{style:{fontSize:"75%"},"data-testid":"code-snippet",children:(0,c.jsx)(A.Oi,{text:JSON.stringify(Xr(v.entity),void 0,2),language:"json",showCopyCodeButton:!0})})})]})}var ms=t(3440),qr=t.n(ms);const Ms=(0,D.Z)({root:{display:"flex",flexDirection:"column"}});function dr(v){var x,I;const $=Ms(),{apiVersion:J,kind:K,metadata:oe,spec:le,relations:Se=[],status:Be={}}=v.entity,$e=qr()(hn()(Se,Ae=>Ae.targetRef),"type");return(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(d.Z,{variant:"h2",children:"Overview"}),(0,c.jsxs)("div",{className:$.root,children:[(0,c.jsx)(Nr,{title:"Identity",children:(0,c.jsxs)(rr.Z,{dense:!0,children:[(0,c.jsx)(Xn.Z,{children:(0,c.jsx)(er,{primary:"apiVersion",secondary:J})}),(0,c.jsx)(Xn.Z,{children:(0,c.jsx)(er,{primary:"kind",secondary:K})}),(le==null?void 0:le.type)&&(0,c.jsx)(Xn.Z,{children:(0,c.jsx)(er,{primary:"spec.type",secondary:le.type})}),oe.uid&&(0,c.jsx)(Xn.Z,{children:(0,c.jsx)(er,{primary:"uid",secondary:oe.uid})}),oe.etag&&(0,c.jsx)(Xn.Z,{children:(0,c.jsx)(er,{primary:"etag",secondary:oe.etag})})]})}),(0,c.jsxs)(Nr,{title:"Metadata",children:[!!Object.keys(oe.annotations||{}).length&&(0,c.jsx)(rr.Z,{dense:!0,subheader:(0,c.jsxs)(Ir,{children:["Annotations",(0,c.jsx)(Jr,{to:"https://backstage.io/docs/features/software-catalog/well-known-annotations"})]}),children:Object.entries(oe.annotations).map(Ae=>(0,c.jsx)(Fr,{indent:!0,entry:Ae},Ae[0]))}),!!Object.keys(oe.labels||{}).length&&(0,c.jsx)(rr.Z,{dense:!0,subheader:(0,c.jsx)(Ir,{children:"Labels"}),children:Object.entries(oe.labels).map(Ae=>(0,c.jsx)(Fr,{indent:!0,entry:Ae},Ae[0]))}),!!(!((x=oe.tags)===null||x===void 0)&&x.length)&&(0,c.jsx)(rr.Z,{dense:!0,subheader:(0,c.jsx)(Ir,{children:"Tags"}),children:oe.tags.map((Ae,Je)=>(0,c.jsxs)(Xn.Z,{children:[(0,c.jsx)(pr.Z,{}),(0,c.jsx)(er,{primary:Ae})]},`${Ae}-${Je}`))})]}),!!Se.length&&(0,c.jsx)(Nr,{title:"Relations",helpLink:"https://backstage.io/docs/features/software-catalog/well-known-relations",children:Object.entries($e).map(([Ae,Je],xt)=>(0,c.jsx)("div",{children:(0,c.jsx)(rr.Z,{dense:!0,subheader:(0,c.jsx)(Ir,{children:Ae}),children:Je.map(It=>(0,c.jsxs)(Xn.Z,{children:[(0,c.jsx)(pr.Z,{children:(0,c.jsx)(pt,{entityRef:It.targetRef})}),(0,c.jsx)(er,{primary:(0,c.jsx)(Ve,{entityRef:It.targetRef})})]},It.targetRef))})},xt))}),!!(!((I=Be.items)===null||I===void 0)&&I.length)&&(0,c.jsx)(Nr,{title:"Status",helpLink:"https://backstage.io/docs/features/software-catalog/well-known-statuses",children:Be.items.map((Ae,Je)=>(0,c.jsxs)("div",{children:[(0,c.jsxs)(_.Z,{children:[Ae.level,": ",Ae.type]}),(0,c.jsx)(z.Z,{ml:2,children:Ae.message})]},Je))})]})]})}var vs=t(72847);function ys(v){return(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(d.Z,{variant:"h2",children:"Entity as YAML"}),(0,c.jsx)(d.Z,{children:"This is the raw entity data as received from the catalog, on YAML form."}),(0,c.jsx)(d.Z,{children:(0,c.jsx)("div",{style:{fontSize:"75%"},"data-testid":"code-snippet",children:(0,c.jsx)(A.Oi,{text:vs.ZP.stringify(Xr(v.entity)),language:"yaml",showCopyCodeButton:!0})})})]})}const _r=(0,D.Z)(v=>({fullHeightDialog:{height:"calc(100% - 64px)"},root:{display:"flex",flexGrow:1,width:"100%",backgroundColor:v.palette.background.paper},tabs:{borderRight:`1px solid ${v.palette.divider}`,flexShrink:0},tabContents:{flexGrow:1,overflowX:"auto"}}));function or(v){const{children:x,value:I,index:$,...J}=v,K=_r();return(0,c.jsx)("div",{role:"tabpanel",hidden:I!==$,id:`vertical-tabpanel-${$}`,"aria-labelledby":`vertical-tab-${$}`,className:K.tabContents,...J,children:I===$&&(0,c.jsx)(z.Z,{pl:3,pr:3,children:x})})}function mr(v){return{id:`vertical-tab-${v}`,"aria-controls":`vertical-tabpanel-${v}`}}function xs(v){const x=_r(),[I,$]=P.useState(0);return(0,P.useEffect)(()=>{$(0)},[v.open]),v.entity?(0,c.jsxs)(pn.Z,{fullWidth:!0,maxWidth:"xl",open:v.open,onClose:v.onClose,"aria-labelledby":"entity-inspector-dialog-title",PaperProps:{className:x.fullHeightDialog},children:[(0,c.jsx)(Hn.Z,{id:"entity-inspector-dialog-title",children:"Entity Inspector"}),(0,c.jsx)(ln.Z,{dividers:!0,children:(0,c.jsxs)("div",{className:x.root,children:[(0,c.jsxs)(On.Z,{orientation:"vertical",variant:"scrollable",value:I,onChange:(J,K)=>$(K),"aria-label":"Inspector options",className:x.tabs,children:[(0,c.jsx)(Qn.Z,{label:"Overview",...mr(0)}),(0,c.jsx)(Qn.Z,{label:"Ancestry",...mr(1)}),(0,c.jsx)(Qn.Z,{label:"Colocated",...mr(2)}),(0,c.jsx)(Qn.Z,{label:"Raw JSON",...mr(3)}),(0,c.jsx)(Qn.Z,{label:"Raw YAML",...mr(4)})]}),(0,c.jsx)(or,{value:I,index:0,children:(0,c.jsx)(dr,{entity:v.entity})}),(0,c.jsx)(or,{value:I,index:1,children:(0,c.jsx)(Er,{entity:v.entity})}),(0,c.jsx)(or,{value:I,index:2,children:(0,c.jsx)(gs,{entity:v.entity})}),(0,c.jsx)(or,{value:I,index:3,children:(0,c.jsx)(Us,{entity:v.entity})}),(0,c.jsx)(or,{value:I,index:4,children:(0,c.jsx)(ys,{entity:v.entity})})]})}),(0,c.jsx)(C.Z,{children:(0,c.jsx)(X.Z,{onClick:v.onClose,color:"primary",children:"Close"})})]}):null}var es=t(85256);function ts(v){var x;const I=(0,r.h_)(W),$=(x=v.metadata.annotations)===null||x===void 0?void 0:x[S.q1],J=v.metadata.uid,K=$==="bootstrap:bootstrap",oe=(0,ft.default)(async()=>{const It=I.getLocationByRef($);let et;if(!$)et=Promise.resolve([]);else{const $t=`metadata.annotations.${S.q1}`;et=I.getEntities({filter:{[$t]:$},fields:["kind","metadata.uid","metadata.name","metadata.namespace"]}).then(Dt=>Dt.items)}return Promise.all([It,et]).then(([$t,Dt])=>({location:$t,colocatedEntities:Dt}))},[I,v]),le=(0,P.useCallback)(async function(){const{location:et}=oe.value;await I.removeLocationById(et.id)},[I,oe]),Se=(0,P.useCallback)(async function(){await I.removeEntityByUid(J)},[I,J]);if(K)return{type:"bootstrap",location:$,deleteEntity:Se};const{loading:Be,error:$e,value:Ae}=oe;if(Be)return{type:"loading"};if($e)return{type:"error",error:$e};const{location:Je,colocatedEntities:xt}=Ae;return Je?{type:"unregister",location:$,colocatedEntities:xt.map(S.iB),unregisterLocation:le,deleteEntity:Se}:{type:"only-delete",deleteEntity:Se}}var Ur=t(23054);const ns=(0,D.Z)({advancedButton:{fontSize:"0.7em"}}),An=({entity:v,onConfirm:x})=>{const I=(0,r.h_)(r.$v),$=(0,r.h_)(r.Ds),J=ns(),K=ts(v),[oe,le]=(0,P.useState)(!1),[Se,Be]=(0,P.useState)(!1);var $e;const Ae=($e=$.getOptionalString("app.title"))!==null&&$e!==void 0?$e:"Backstage",Je=(0,P.useCallback)(async function(){if("unregisterLocation"in K){Be(!0);try{await K.unregisterLocation(),x()}catch(et){(0,Ur.BD)(et),I.post({message:et.message})}finally{Be(!1)}}},[I,x,K]),xt=(0,P.useCallback)(async function(){if("deleteEntity"in K){Be(!0);try{await K.deleteEntity(),x()}catch(et){(0,Ur.BD)(et),I.post({message:et.message})}finally{Be(!1)}}},[I,x,K]);return K.type==="loading"?(0,c.jsx)(A.Ex,{}):K.type==="error"?(0,c.jsx)(A.Gk,{error:K.error}):K.type==="bootstrap"?(0,c.jsxs)(c.Fragment,{children:[(0,c.jsxs)(_n.Z,{severity:"info",children:['You cannot unregister this entity, since it originates from a protected Backstage configuration (location "',K.location,'"). If you believe this is in error, please contact the ',Ae," ","integrator."]}),(0,c.jsxs)(z.Z,{marginTop:2,children:[!oe&&(0,c.jsx)(X.Z,{variant:"text",size:"small",color:"primary",className:J.advancedButton,onClick:()=>le(!0),children:"Advanced Options"}),oe&&(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(d.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:xt,children:"Delete Entity"})]})]})]}):K.type==="only-delete"?(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(d.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:xt,children:"Delete Entity"})]}):K.type==="unregister"?(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(d.Z,{children:"This action will unregister the following entities:"}),(0,c.jsx)(d.Z,{component:"ul",children:K.colocatedEntities.map(It=>(0,c.jsx)("li",{children:(0,c.jsx)(Ve,{entityRef:It})},`${It.kind}:${It.namespace}/${It.name}`))}),(0,c.jsx)(d.Z,{children:"Located at the following location:"}),(0,c.jsx)(d.Z,{component:"ul",children:(0,c.jsx)("li",{children:K.location})}),(0,c.jsxs)(d.Z,{children:["To undo, just re-register the entity in ",Ae,"."]}),(0,c.jsxs)(z.Z,{marginTop:2,children:[(0,c.jsx)(X.Z,{variant:"contained",color:"secondary",disabled:Se,onClick:Je,children:"Unregister Location"}),!oe&&(0,c.jsx)(z.Z,{component:"span",marginLeft:2,children:(0,c.jsx)(X.Z,{variant:"text",size:"small",color:"primary",className:J.advancedButton,onClick:()=>le(!0),children:"Advanced Options"})})]}),oe&&(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(z.Z,{paddingTop:4,paddingBottom:4,children:(0,c.jsx)(es.Z,{})}),(0,c.jsx)(d.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:xt,children:"Delete Entity"})]})]}):(0,c.jsx)(_n.Z,{severity:"error",children:"Internal error: Unknown state"})},Wt=v=>{const{open:x,onConfirm:I,onClose:$,entity:J}=v;return(0,c.jsxs)(pn.Z,{open:x,onClose:$,children:[(0,c.jsx)(Hn.Z,{id:"responsive-dialog-title",children:"Are you sure you want to unregister this entity?"}),(0,c.jsx)(ln.Z,{children:(0,c.jsx)(An,{entity:J,onConfirm:I})}),(0,c.jsx)(C.Z,{children:(0,c.jsx)(X.Z,{onClick:$,color:"primary",children:"Cancel"})})]})};var bs=t(12231),Ss=t(9520),ws=t(47603);const Cs=(0,D.Z)(v=>({root:{backgroundColor:"rgba(0, 0, 0, .11)",boxShadow:"none",margin:v.spacing(1,0,1,0)},title:{margin:v.spacing(1,0,0,1),textTransform:"uppercase",fontSize:12,fontWeight:"bold"},listIcon:{minWidth:30,color:v.palette.text.primary},menuItem:{minHeight:v.spacing(6)},groupWrapper:{margin:v.spacing(1,1,2,1)}}),{name:"CatalogReactUserListPicker"});function js(v){return[{name:"Personal",items:[{id:"owned",label:"Owned",icon:ws.Z},{id:"starred",label:"Starred",icon:_t.Z}]},{name:v!=null?v:"Company",items:[{id:"all",label:"All"}]}]}const Es=v=>{const{initialFilter:x,availableFilters:I}=v,$=Cs(),J=(0,r.h_)(r.Ds);var K;const oe=(K=J.getOptionalString("organization.name"))!==null&&K!==void 0?K:"Company",{filters:le,updateFilters:Se,backendEntities:Be,queryParameters:{kind:$e,user:Ae},loading:Je}=un(),xt=["starred","all"],It=js(oe).map(Rn=>({...Rn,items:Rn.items.filter(({id:$n})=>["group","user"].some(vr=>vr===$e)?xt.includes($n):!I||I.includes($n))})).filter(({items:Rn})=>!!Rn.length),{isStarredEntity:et}=ge(),{isOwnedEntity:$t,loading:Dt}=Ne(),fn=Je||Dt,rn=(0,P.useMemo)(()=>new tt("owned",$t,et),[$t,et]),tr=(0,P.useMemo)(()=>new tt("starred",$t,et),[$t,et]),wn=(0,P.useMemo)(()=>[Ae].flat()[0],[Ae]),[Tn,In]=(0,P.useState)(wn!=null?wn:x),Lr=(0,P.useMemo)(()=>Be.filter(gt((0,Vt.compact)(Object.values({...le,user:void 0})))),[le,Be]),Pr=(0,P.useMemo)(()=>({all:Lr.length,starred:Lr.filter(Rn=>tr.filterEntity(Rn)).length,owned:Lr.filter(Rn=>rn.filterEntity(Rn)).length}),[Lr,tr,rn]);(0,P.useEffect)(()=>{wn&&In(wn)},[wn]),(0,P.useEffect)(()=>{!fn&&!!Tn&&Tn!=="all"&&Pr[Tn]===0&&In("all")},[fn,Pr,Tn,In]),(0,P.useEffect)(()=>{Se({user:Tn?new tt(Tn,$t,et):void 0})},[Tn,$t,et,Se]);var kr;return(0,c.jsx)(fr.Z,{className:$.root,children:It.map(Rn=>(0,c.jsxs)(P.Fragment,{children:[(0,c.jsx)(_.Z,{variant:"subtitle2",component:"span",className:$.title,children:Rn.name}),(0,c.jsx)(fr.Z,{className:$.groupWrapper,children:(0,c.jsx)(rr.Z,{disablePadding:!0,dense:!0,role:"menu","aria-label":Rn.name,children:Rn.items.map($n=>{var vr;return(0,c.jsxs)(bs.Z,{role:"none presentation",button:!0,divider:!0,onClick:()=>In($n.id),selected:$n.id===((vr=le.user)===null||vr===void 0?void 0:vr.value),className:$.menuItem,disabled:Pr[$n.id]===0,"data-testid":`user-picker-${$n.id}`,tabIndex:0,ContainerProps:{role:"menuitem"},children:[$n.icon&&(0,c.jsx)(pr.Z,{className:$.listIcon,children:(0,c.jsx)($n.icon,{fontSize:"small"})}),(0,c.jsx)(Ar.Z,{children:(0,c.jsxs)(_.Z,{variant:"body1",children:[$n.label," "]})}),(0,c.jsx)(Ss.Z,{children:(kr=Pr[$n.id])!==null&&kr!==void 0?kr:"-"})]},$n.id)})})})]},Rn.name))})},rs=(0,D.Z)({input:{}},{name:"CatalogReactEntityProcessingStatusPickerPicker"}),Rr=(0,c.jsx)(Pe.Z,{fontSize:"small"}),zs=(0,c.jsx)(ye.Z,{fontSize:"small"}),As=()=>{const v=rs(),{updateFilters:x}=un(),[I,$]=(0,P.useState)([]);function J(le){x({orphan:le?new mt(le):void 0})}function K(le){x({error:le?new Zt(le):void 0})}const oe=["Is Orphan","Has Error"];return(0,c.jsx)(z.Z,{pb:1,pt:1,children:(0,c.jsxs)(_.Z,{variant:"button",component:"label",children:["Processing Status",(0,c.jsx)(Ue.ZP,{multiple:!0,options:oe,value:I,onChange:(le,Se)=>{$(Se),J(Se.includes("Is Orphan")),K(Se.includes("Has Error"))},renderOption:(le,{selected:Se})=>(0,c.jsx)(U.Z,{control:(0,c.jsx)(de.Z,{icon:Rr,checkedIcon:zs,checked:Se}),label:le}),size:"small",popupIcon:(0,c.jsx)(Le.Z,{"data-testid":"processing-status-picker-expand"}),renderInput:le=>(0,c.jsx)(pe.Z,{...le,className:v.input,variant:"outlined"})})]})})},Ts=({children:v,value:x})=>{var I;const[$,J]=useState((I=x==null?void 0:x.filters)!==null&&I!==void 0?I:{}),K=useCallback(xt=>{J(It=>{const et=typeof xt=="function"?xt(It):xt;return{...It,...et}})},[]),oe=useMemo(()=>({entities:[],backendEntities:[],queryParameters:{}}),[]);var le,Se,Be,$e,Ae;const Je=useMemo(()=>({entities:(le=x==null?void 0:x.entities)!==null&&le!==void 0?le:oe.entities,backendEntities:(Se=x==null?void 0:x.backendEntities)!==null&&Se!==void 0?Se:oe.backendEntities,updateFilters:(Be=x==null?void 0:x.updateFilters)!==null&&Be!==void 0?Be:K,filters:$,loading:($e=x==null?void 0:x.loading)!==null&&$e!==void 0?$e:!1,queryParameters:(Ae=x==null?void 0:x.queryParameters)!==null&&Ae!==void 0?Ae:oe.queryParameters,error:x==null?void 0:x.error}),[x,oe,$,K]);return _jsx(EntityListContext.Provider,{value:Je,children:v})}},33414:function(Rt,Me,t){"use strict";t.r(Me),t.d(Me,{AboutCard:function(){return ft},AboutContent:function(){return Xe},AboutField:function(){return q}});var h=t(52322),r=t(25271),W=t(93414),B=t(25248),g=t(32838),b=t(92848),c=t(79692),P=t(94339),te=t(32552),Q=t(61837),X=t(85256),M=t(24579),z=t(52866),_=t(30254),fe=t(27604),ie=t(2784),T=t(19625),L=t(60905),Z=t(90436),A=t(7089);const S=(0,c.Z)(je=>({value:{fontWeight:"bold",overflow:"hidden",lineHeight:"24px",wordBreak:"break-word"},label:{color:je.palette.text.secondary,textTransform:"uppercase",fontSize:"10px",fontWeight:"bold",letterSpacing:.5,overflow:"hidden",whiteSpace:"nowrap"}}));function q(je){const{label:Ge,value:st,gridSizes:gt,children:rt}=je,ot=S(),ct=(0,B.vJ)(rt,Lt=>Lt.getElements()),yt=ct.length>0?ct:(0,h.jsx)(Z.Z,{variant:"body2",className:ot.value,children:st||"unknown"});return(0,h.jsxs)(L.Z,{item:!0,...gt,children:[(0,h.jsx)(Z.Z,{variant:"h2",className:ot.label,children:Ge}),yt]})}var Te=t(24851);const Qe=(0,c.Z)({description:{wordBreak:"break-word"}});function Ye(je,Ge,st){if(Ge==="url"||je.includes("://"))return je;const gt=st.type==="file"?`file://${st.target}`:st.target;return Ge==="file"||st.type==="file"?new URL(je,gt).href:gt}function Xe(je){var Ge,st,gt,rt,ot,ct,yt,Lt;const{entity:We}=je,se=Qe(),Ie=We.kind.toLocaleLowerCase("en-US")==="system",Re=We.kind.toLocaleLowerCase("en-US")==="resource",tt=We.kind.toLocaleLowerCase("en-US")==="component",mt=We.kind.toLocaleLowerCase("en-US")==="api",Zt=We.kind.toLocaleLowerCase("en-US")==="template",dt=We.kind.toLocaleLowerCase("en-US")==="location",Et=We.kind.toLocaleLowerCase("en-US")==="group",At=(0,b.hF)(We,r.cz,{kind:"system"}),Ot=(0,b.hF)(We,r.cz,{kind:"component"}),qt=(0,b.hF)(We,r.cz,{kind:"domain"}),Vt=(0,b.hF)(We,r.S4);let Ht;try{Ht=(0,r.CV)(We)}catch{Ht=void 0}return(0,h.jsxs)(L.Z,{container:!0,children:[(0,h.jsx)(q,{label:"Description",gridSizes:{xs:12},children:(0,h.jsx)(Z.Z,{variant:"body2",paragraph:!0,className:se.description,children:(We==null||(Ge=We.metadata)===null||Ge===void 0?void 0:Ge.description)||"No description"})}),(0,h.jsx)(q,{label:"Owner",value:"No Owner",gridSizes:{xs:12,sm:6,lg:4},children:Vt.length>0&&(0,h.jsx)(b.rI,{entityRefs:Vt,defaultKind:"group"})}),(Ie||qt.length>0)&&(0,h.jsx)(q,{label:"Domain",value:"No Domain",gridSizes:{xs:12,sm:6,lg:4},children:qt.length>0&&(0,h.jsx)(b.rI,{entityRefs:qt,defaultKind:"domain"})}),(mt||tt||Re||At.length>0)&&(0,h.jsx)(q,{label:"System",value:"No System",gridSizes:{xs:12,sm:6,lg:4},children:At.length>0&&(0,h.jsx)(b.rI,{entityRefs:At,defaultKind:"system"})}),tt&&Ot.length>0&&(0,h.jsx)(q,{label:"Parent Component",value:"No Parent Component",gridSizes:{xs:12,sm:6,lg:4},children:(0,h.jsx)(b.rI,{entityRefs:Ot,defaultKind:"component"})}),(mt||tt||Re||Zt||Et||dt||typeof(We==null||(st=We.spec)===null||st===void 0?void 0:st.type)=="string")&&(0,h.jsx)(q,{label:"Type",value:We==null||(gt=We.spec)===null||gt===void 0?void 0:gt.type,gridSizes:{xs:12,sm:6,lg:4}}),(mt||tt||typeof(We==null||(rt=We.spec)===null||rt===void 0?void 0:rt.lifecycle)=="string")&&(0,h.jsx)(q,{label:"Lifecycle",value:We==null||(ot=We.spec)===null||ot===void 0?void 0:ot.lifecycle,gridSizes:{xs:12,sm:6,lg:4}}),(0,h.jsx)(q,{label:"Tags",value:"No Tags",gridSizes:{xs:12,sm:6,lg:4},children:((We==null||(ct=We.metadata)===null||ct===void 0?void 0:ct.tags)||[]).map(Jt=>(0,h.jsx)(A.Z,{size:"small",label:Jt},Jt))}),dt&&((We==null||(yt=We.spec)===null||yt===void 0?void 0:yt.targets)||(We==null||(Lt=We.spec)===null||Lt===void 0?void 0:Lt.target))&&(0,h.jsx)(q,{label:"Targets",gridSizes:{xs:12},children:(0,h.jsx)(Te.s,{cols:1,items:(We.spec.targets||[We.spec.target]).map(Jt=>Jt).map(Jt=>{var dn;return{text:Jt,href:Ye(Jt,(We==null||(dn=We.spec)===null||dn===void 0?void 0:dn.type)||"unknown",Ht)}})})})]})}const Ve=(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 ft(je){var Ge,st,gt;const{variant:rt}=je,ot=Ve(),{entity:ct}=(0,b.X2)(),yt=(0,B.h_)(g.q3),Lt=(0,B.h_)(b.Ah),We=(0,B.h_)(B.$v),se=(0,B.h_)(B.VE),Ie=(0,B.tg)(T.jU),Re=(0,b.CV)(ct,yt),tt=(Ge=ct.metadata.annotations)===null||Ge===void 0?void 0:Ge[r.Tf],mt={label:"View Source",disabled:!Re,icon:(0,h.jsx)(g.nW,{type:Re==null?void 0:Re.integrationType}),href:Re==null?void 0:Re.locationTargetUrl},Zt={label:"View TechDocs",disabled:!(!((st=ct.metadata.annotations)===null||st===void 0)&&st["backstage.io/techdocs-ref"])||!Ie,icon:(0,h.jsx)(_.Z,{}),href:Ie&&Ie({namespace:ct.metadata.namespace||r.zG,kind:ct.kind,name:ct.metadata.name})};let dt="";rt==="gridItem"?dt=ot.gridItemCard:rt==="fullHeight"&&(dt=ot.fullHeightCard);let Et="";rt==="gridItem"?Et=ot.gridItemCardContent:rt==="fullHeight"&&(Et=ot.fullHeightCardContent);const At=(gt=ct.metadata.annotations)===null||gt===void 0?void 0:gt[r.P1],Ot=(At==null?void 0:At.startsWith("url:"))||(At==null?void 0:At.startsWith("file:")),qt=(0,ie.useCallback)(async()=>{try{await Lt.refreshEntity((0,r.eE)(ct)),We.post({message:"Refresh scheduled",severity:"info"})}catch(Vt){se.post(Vt)}},[Lt,We,se,ct]);return(0,h.jsxs)(P.Z,{className:dt,children:[(0,h.jsx)(te.Z,{title:"About",action:(0,h.jsxs)(h.Fragment,{children:[Ot&&(0,h.jsx)(Q.Z,{"aria-label":"Refresh",title:"Schedule entity refresh",onClick:qt,children:(0,h.jsx)(z.Z,{})}),(0,h.jsx)(Q.Z,{component:W.rU,"aria-label":"Edit",disabled:!tt,title:"Edit Metadata",to:tt!=null?tt:"#",children:(0,h.jsx)(fe.Z,{})})]}),subheader:(0,h.jsx)(W.M6,{links:[mt,Zt]})}),(0,h.jsx)(X.Z,{}),(0,h.jsx)(M.Z,{className:Et,children:(0,h.jsx)(Xe,{entity:ct})})]})}},86359:function(Rt,Me,t){"use strict";t.d(Me,{E:function(){return ie}});var h=t(52322),r=t(25271),W=t(93414),B=t(92848),g=t(90436),b=t(15459),c=t(27604),P=t(2997),te=t(11640),Q=t(28347),X=t(76635),M=t(2784),z=t(7089);const _=Object.freeze({createNameColumn(T){function L(Z){var A;return((A=Z.metadata)===null||A===void 0?void 0:A.title)||(0,B.$3)(Z,{defaultKind:T==null?void 0:T.defaultKind})}return{title:"Name",field:"resolved.name",highlight:!0,customSort({entity:Z},{entity:A}){return L(Z).localeCompare(L(A))},render:({entity:Z})=>{var A;return(0,h.jsx)(B.dx,{entityRef:Z,defaultKind:(T==null?void 0:T.defaultKind)||"Component",title:(A=Z.metadata)===null||A===void 0?void 0:A.title})}}},createSystemColumn(){return{title:"System",field:"resolved.partOfSystemRelationTitle",render:({resolved:T})=>(0,h.jsx)(B.rI,{entityRefs:T.partOfSystemRelations,defaultKind:"system"})}},createOwnerColumn(){return{title:"Owner",field:"resolved.ownedByRelationsTitle",render:({resolved:T})=>(0,h.jsx)(B.rI,{entityRefs:T.ownedByRelations,defaultKind:"group"})}},createSpecTargetsColumn(){return{title:"Targets",field:"entity.spec.targets",render:({entity:T})=>{var L,Z;return(0,h.jsx)(h.Fragment,{children:((T==null||(L=T.spec)===null||L===void 0?void 0:L.targets)||(T==null||(Z=T.spec)===null||Z===void 0?void 0:Z.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(L=>(0,h.jsx)(z.Z,{label:L,size:"small",variant:"outlined",style:{marginBottom:"0px"}},L))}),width:"auto"}},createTitleColumn(T){return{title:"Title",field:"entity.metadata.title",hidden:T==null?void 0:T.hidden,searchable:!0}},createLabelColumn(T,L){return{title:(L==null?void 0:L.title)||"Label",field:"entity.metadata.labels",cellStyle:{padding:"0px 16px 0px 20px"},render:({entity:Z})=>{var A;const S=(A=Z.metadata)===null||A===void 0?void 0:A.labels,q=S&&S[T]||(L==null?void 0:L.defaultValue);return(0,h.jsx)(h.Fragment,{children:q&&(0,h.jsx)(z.Z,{label:q,size:"small",variant:"outlined"},q)})},width:"auto"}}}),fe=(0,b.Z)({root:{color:"#f3ba37"}})(te.Z),ie=T=>{var L,Z;const{columns:A,actions:S,tableOptions:q,subtitle:Te,emptyContent:Qe}=T,{isStarredEntity:Ye,toggleStarredEntity:Xe}=(0,B.CR)(),{loading:Ve,error:ft,entities:je,filters:Ge}=(0,B.wp)(),st=(0,M.useMemo)(()=>{var se;return[_.createTitleColumn({hidden:!0}),_.createNameColumn({defaultKind:(se=Ge.kind)===null||se===void 0?void 0:se.value}),...Ie(),_.createMetadataDescriptionColumn(),_.createTagsColumn()];function Ie(){var Re;switch((Re=Ge.kind)===null||Re===void 0?void 0:Re.value){case"user":return[];case"domain":case"system":return[_.createOwnerColumn()];case"group":case"template":return[_.createSpecTypeColumn()];case"location":return[_.createSpecTypeColumn(),_.createSpecTargetsColumn()];default:return[_.createSystemColumn(),_.createOwnerColumn(),_.createSpecTypeColumn(),_.createSpecLifecycleColumn()]}}},[(L=Ge.kind)===null||L===void 0?void 0:L.value]),gt=Ge.type===void 0;var rt;const ot=(0,X.capitalize)((rt=(Z=Ge.user)===null||Z===void 0?void 0:Z.value)!==null&&rt!==void 0?rt:"all");if(ft)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:ft.toString()})})});const ct=[({entity:se})=>{var Ie;const Re=(Ie=se.metadata.annotations)===null||Ie===void 0?void 0:Ie[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:!Re,onClick:()=>{!Re||window.open(Re,"_blank")}}},({entity:se})=>{var Ie;const Re=(Ie=se.metadata.annotations)===null||Ie===void 0?void 0:Ie[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:!Re,onClick:()=>{!Re||window.open(Re,"_blank")}}},({entity:se})=>{const Ie=Ye(se),Re=Ie?"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:Re}),Ie?(0,h.jsx)(fe,{}):(0,h.jsx)(Q.Z,{})]}),tooltip:Re,onClick:()=>Xe(se)}}],yt=je.map(se=>{const Ie=(0,B.hF)(se,r.cz,{kind:"system"}),Re=(0,B.hF)(se,r.S4);return{entity:se,resolved:{name:(0,B.$3)(se,{defaultKind:"Component"}),ownedByRelationsTitle:Re.map(tt=>(0,B.$3)(tt,{defaultKind:"group"})).join(", "),ownedByRelations:Re,partOfSystemRelationTitle:Ie.map(tt=>(0,B.$3)(tt,{defaultKind:"system"})).join(", "),partOfSystemRelations:Ie}}}),Lt=(A||st).find(se=>se.title==="Type");Lt&&(Lt.hidden=!gt);const We=yt.length>20;return(0,h.jsx)(W.iA,{isLoading:Ve,columns:A||st,options:{paging:We,pageSize:20,actionsColumnIndex:-1,loadingType:"linear",showEmptyDataSourceMessage:!Ve,padding:"dense",pageSizeOptions:[20,50,100],...q},title:`${ot} (${je.length})`,data:yt,actions:S||ct,subtitle:Te,emptyContent:Qe})};ie.columns=_},24851:function(Rt,Me,t){"use strict";t.d(Me,{s:function(){return fe}});var h=t(52322),r=t(90348),W=t(11861),B=t(2784),g=t(79692),b=t(95544),c=t(90436),P=t(52160),te=t(93414);const Q=(0,g.Z)({svgIcon:{display:"inline-block","& svg":{display:"inline-block",fontSize:"inherit",verticalAlign:"baseline"}}});function X(ie){const{href:T,text:L,Icon:Z}=ie,A=Q();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:Z?(0,h.jsx)(Z,{}):(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:L||T})})]})}var M=t(41156);const z={xs:1,sm:1,md:1,lg:2,xl:3};function _(ie){const T=[(0,M.Z)(S=>S.breakpoints.up("xl"))?"xl":null,(0,M.Z)(S=>S.breakpoints.up("lg"))?"lg":null,(0,M.Z)(S=>S.breakpoints.up("md"))?"md":null,(0,M.Z)(S=>S.breakpoints.up("sm"))?"sm":null,(0,M.Z)(S=>S.breakpoints.up("xs"))?"xs":null];let L=1;if(typeof ie=="number")L=ie;else{var Z;const S=(Z=T.find(q=>q!==null))!==null&&Z!==void 0?Z:"xs";var A;L=(A=ie==null?void 0:ie[S])!==null&&A!==void 0?A:z[S]}return L}function fe(ie){const{items:T,cols:L=void 0}=ie,Z=_(L);return(0,h.jsx)(r.Z,{rowHeight:"auto",cols:Z,children:T.map(({text:A,href:S,Icon:q},Te)=>(0,h.jsx)(W.Z,{children:(0,h.jsx)(X,{href:S,text:A!=null?A:S,Icon:q})},Te))})}},19625:function(Rt,Me,t){"use strict";t.d(Me,{_Z:function(){return B},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"]}),B=(0,h.NT)({id:"catalog"})},51666:function(Rt,Me,t){"use strict";t.d(Me,{rG:function(){return h},Y2:function(){return Z},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,S){return A.name===S.name}function W(A,S){return"resourceType"in A?!S||A.resourceType===S:!1}function B(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(S,q)=>await A.authorize(S,q),authorizeConditional(S,q){const Te=S;return A.authorize(Te,q)}}}function te({name:A,attributes:S,resourceType:q}){return q?{type:"resource",name:A,attributes:S,resourceType:q}:{type:"basic",name:A,attributes:S}}var Q=t(23054),X=t(96279),M=t.n(X),z=t(9571),_=t(30195);const fe=_.z.lazy(()=>_.z.object({rule:_.z.string(),resourceType:_.z.string(),params:_.z.record(_.z.any()).optional()}).or(_.z.object({anyOf:_.z.array(fe).nonempty()})).or(_.z.object({allOf:_.z.array(fe).nonempty()})).or(_.z.object({not:fe}))),ie=_.z.object({result:_.z.literal(h.ALLOW).or(_.z.literal(h.DENY))}),T=_.z.union([_.z.object({result:_.z.literal(h.ALLOW).or(_.z.literal(h.DENY))}),_.z.object({result:_.z.literal(h.CONDITIONAL),pluginId:_.z.string(),resourceType:_.z.string(),conditions:fe})]),L=(A,S)=>_.z.object({items:_.z.array(_.z.intersection(_.z.object({id:_.z.string()}),A)).refine(q=>q.length===S.size&&q.every(({id:Te})=>S.has(Te)),{message:"Items in response do not match request"})});class Z{async authorize(S,q){return this.makeRequest(S,ie,q)}async authorizeConditional(S,q){return this.makeRequest(S,T,q)}async makeRequest(S,q,Te){if(!this.enabled)return S.map(Ge=>({result:h.ALLOW}));const Qe={items:S.map(Ge=>({id:z.Z(),...Ge}))},Ye=await this.discovery.getBaseUrl("permission"),Xe=await M()(`${Ye}/authorize`,{method:"POST",body:JSON.stringify(Qe),headers:{...this.getAuthorizationHeader(Te==null?void 0:Te.token),"content-type":"application/json"}});if(!Xe.ok)throw await Q.VL.fromResponse(Xe);const Ve=await Xe.json(),je=L(q,new Set(Qe.items.map(({id:Ge})=>Ge))).parse(Ve).items.reduce((Ge,st)=>(Ge[st.id]=st,Ge),{});return Qe.items.map(Ge=>je[Ge.id])}getAuthorizationHeader(S){return S?{Authorization:`Bearer ${S}`}:{}}constructor(S){this.discovery=S.discovery;var q;this.enabled=(q=S.config.getOptionalBoolean("permission.enabled"))!==null&&q!==void 0?q:!1}}},25488:function(Rt,Me,t){"use strict";t.d(Me,{iM:function(){return b},RV:function(){return B},gI:function(){return P}});var h=t(52322),r=t(2784),W=t(25248);const B=(0,W.T0)({id:"plugin.permission.api"});var g=t(51666);class b{static create(M){const{config:z,discovery:_,identity:fe}=M,ie=new g.Y2({discovery:_,config:z});return new b(ie,fe)}async authorize(M){return(await this.permissionClient.authorize([M],await this.identityApi.getCredentials()))[0]}constructor(M,z){this.permissionClient=M,this.identityApi=z}}var c=t(49857);function P(X){const M=(0,W.h_)(B),{data:z,error:_}=(0,c.ZP)(X,async fe=>{if((0,g.g2)(fe.permission)&&!fe.resourceRef)return g.rG.DENY;const{result:ie}=await M.authorize(fe);return ie});return _?{error:_,loading:!1,allowed:!1}:z===void 0?{loading:!0,allowed:!1}:{loading:!1,allowed:z===g.rG.ALLOW}}const te=X=>{const{permission:M,resourceRef:z,errorComponent:_,...fe}=X,ie=usePermission(isResourcePermission(M)?{permission:M,resourceRef:z}:{permission:M}),T=useApp(),{NotFoundErrorPage:L}=T.getComponents();let Z=_===void 0?_jsx(L,{}):_;return ie.loading?Z=null:ie.allowed&&(Z=X.element),_jsx(Route,{...fe,element:Z})};function Q(X){const{permission:M,resourceRef:z}=X,_=usePermission(isResourcePermission(M)?{permission:M,resourceRef:z}:{permission:M}),fe=useApp();if(_.loading)return null;if(_.allowed)return _jsx(_Fragment,{children:X.children});if(X.errorPage)return _jsx(_Fragment,{children:X.errorPage});const{NotFoundErrorPage:ie}=fe.getComponents();return _jsx(ie,{})}},65826:function(Rt,Me,t){"use strict";t.d(Me,{FA:function(){return P},qO:function(){return rt},Nd:function(){return Ye},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(U){this.mockedResults=U}}var B=t(52322),g=t(2784),b=t(79692);const c=(0,b.Z)(()=>({highlight:{}}),{name:"BackstageHighlightedSearchResultText"}),P=({text:D,preTag:U,postTag:de})=>{const pe=c(),ye=(0,g.useMemo)(()=>D.split(new RegExp(`(${U}.+?${de})`)),[de,U,D]);return(0,B.jsx)(B.Fragment,{children:ye.map((Pe,Le)=>Pe.includes(U)?(0,B.jsx)("mark",{className:pe.highlight,children:Pe.replace(new RegExp(`${U}|${de}`,"g"),"")},Le):Pe)})};var te=t(48760),Q=t(50581),X=t(61837),M=t(74603),z=t(21853),_=t(33375),fe=t(76635),ie=t(64279),T=t(1849),L=t(51837);const Z=(0,L.CT)("search-context"),A=()=>{const D=(0,g.useContext)(Z);if(!D)throw new Error("useSearch must be used within a SearchContextProvider");const U=D.atVersion(1);if(!U)throw new Error("No SearchContext v1 found");return U},S=()=>(0,g.useContext)(Z)!==void 0,q={term:"",types:[],filters:{},pageLimit:void 0,pageCursor:void 0},Te=(D=q)=>{var U,de,pe,ye;const Pe=(0,h.h_)(r),[Le,Ue]=(0,g.useState)(D.term),[nt,w]=(0,g.useState)(D.types),[H,ve]=(0,g.useState)(D.filters),[ue,we]=(0,g.useState)(D.pageLimit),[ke,Fe]=(0,g.useState)(D.pageCursor),it=(0,T.Z)(Le),Ct=(0,T.Z)(H),Ke=(0,ie.default)(()=>Pe.query({term:Le,types:nt,filters:H,pageLimit:ue,pageCursor:ke}),[Le,nt,H,ue,ke]),ht=!Ke.loading&&!Ke.error&&((U=Ke.value)===null||U===void 0?void 0:U.nextPageCursor),vt=!Ke.loading&&!Ke.error&&((de=Ke.value)===null||de===void 0?void 0:de.previousPageCursor),at=(0,g.useCallback)(()=>{var Mt;Fe((Mt=Ke.value)===null||Mt===void 0?void 0:Mt.nextPageCursor)},[(pe=Ke.value)===null||pe===void 0?void 0:pe.nextPageCursor]),Tt=(0,g.useCallback)(()=>{var Mt;Fe((Mt=Ke.value)===null||Mt===void 0?void 0:Mt.previousPageCursor)},[(ye=Ke.value)===null||ye===void 0?void 0:ye.previousPageCursor]);return(0,g.useEffect)(()=>{it!==void 0&&Le!==it&&Fe(void 0)},[Le,it,Fe]),(0,g.useEffect)(()=>{Ct!==void 0&&!(0,fe.isEqual)(H,Ct)&&Fe(void 0)},[H,Ct,Fe]),{result:Ke,term:Le,setTerm:Ue,types:nt,setTypes:w,filters:H,setFilters:ve,pageLimit:ue,setPageLimit:we,pageCursor:ke,setPageCursor:Fe,fetchNextPage:ht?at:void 0,fetchPreviousPage:vt?Tt:void 0}},Qe=D=>{const{initialState:U,children:de}=D,pe=Te(U);return(0,B.jsx)(h.fC,{attributes:{searchTypes:pe.types.sort().join(",")},children:(0,B.jsx)(Z.Provider,{value:(0,L.EI)({1:pe}),children:de})})},Ye=D=>{const{initialState:U,inheritParentContextIfAvailable:de,children:pe}=D;return S()&&de?(0,B.jsx)(B.Fragment,{children:pe}):(0,B.jsx)(Qe,{initialState:U,children:pe})},Xe=({children:D})=>{var U;const de=H=>(0,T.Z)(H)!==H,pe=(0,h.z$)(),{term:ye,result:Pe}=A();var Le;const Ue=(Le=(U=Pe.value)===null||U===void 0?void 0:U.numberOfResults)!==null&&Le!==void 0?Le:void 0,w=de(Pe.loading)&&!Pe.loading;return(0,g.useEffect)(()=>{ye&&w&&pe.captureEvent("search",ye,{value:Ue})},[pe,ye,Ue,w]),(0,B.jsx)(B.Fragment,{children:D})};function Ve(D){return(0,g.forwardRef)((U,de)=>(0,B.jsx)(Ye,{inheritParentContextIfAvailable:!0,children:(0,B.jsx)(D,{...U,ref:de})}))}const ft=Ve((0,g.forwardRef)((D,U)=>{const{onChange:de,onKeyDown:pe=()=>{},onClear:ye=()=>{},onSubmit:Pe=()=>{},debounceTime:Le=200,clearButton:Ue=!0,fullWidth:nt=!0,value:w,placeholder:H,inputProps:ve={},endAdornment:ue,...we}=D,ke=(0,h.h_)(h.Ds),[Fe,it]=(0,g.useState)("");(0,g.useEffect)(()=>{it(Ut=>Ut!==w?String(w):Ut)},[w]),(0,te.Z)(()=>de(Fe),Le,[Fe]);const Ct=(0,g.useCallback)(Ut=>{it(Ut.target.value)},[it]),Ke=(0,g.useCallback)(Ut=>{pe&&pe(Ut),Pe&&Ut.key==="Enter"&&Pe()},[pe,Pe]),ht=(0,g.useCallback)(()=>{de(""),ye&&ye()},[de,ye]),vt=H!=null?H:`Search in ${ke.getOptionalString("app.title")||"Backstage"}`,at=(0,B.jsx)(Q.Z,{position:"start",children:(0,B.jsx)(X.Z,{"aria-label":"Query",size:"small",disabled:!0,children:(0,B.jsx)(z.Z,{})})}),Tt=(0,B.jsx)(Q.Z,{position:"end",children:(0,B.jsx)(X.Z,{"aria-label":"Clear",size:"small",onClick:ht,children:(0,B.jsx)(_.Z,{})})});return(0,B.jsx)(Xe,{children:(0,B.jsx)(M.Z,{"data-testid":"search-bar-next",ref:U,value:Fe,placeholder:vt,startAdornment:at,endAdornment:Ue?Tt:ue,inputProps:{"aria-label":"Search",...ve},fullWidth:nt,onChange:Ct,onKeyDown:Ke,...we})})})),je=Ve((0,g.forwardRef)((D,U)=>{const{value:de="",onChange:pe,...ye}=D,{term:Pe,setTerm:Le}=A();(0,g.useEffect)(()=>{de&&Le(String(de))},[de,Le]);const Ue=(0,g.useCallback)(nt=>{pe?pe(nt):Le(nt)},[pe,Le]);return(0,B.jsx)(h.fC,{attributes:{pluginId:"search",extension:"SearchBar"},children:(0,B.jsx)(ft,{...ye,ref:U,value:Pe,onChange:Ue})})}));var Ge=t(4614),st=t(88013);const rt=(D=>U=>(0,B.jsx)(Ye,{inheritParentContextIfAvailable:!0,children:(0,B.jsx)(D,{...U})}))(function(U){const{loading:de,value:pe,onChange:ye=()=>{},options:Pe=[],getOptionLabel:Le=ht=>String(ht),inputPlaceholder:Ue,inputDebounceTime:nt,freeSolo:w=!0,fullWidth:H=!0,clearOnBlur:ve=!1,"data-testid":ue="search-autocomplete",...we}=U,{setTerm:ke}=A(),Fe=(0,g.useCallback)(ht=>ht?typeof ht=="string"?ht:Le(ht):"",[Le]),it=(0,g.useMemo)(()=>Fe(pe),[pe,Fe]),Ct=(0,g.useCallback)((ht,vt,at,Tt)=>{ke(Fe(vt)),ye(ht,vt,at,Tt)},[Fe,ke,ye]),Ke=(0,g.useCallback)(({InputProps:{ref:ht,endAdornment:vt},InputLabelProps:at,...Tt})=>(0,B.jsx)(je,{...Tt,ref:ht,clearButton:!1,value:it,placeholder:Ue,debounceTime:nt,endAdornment:de?(0,B.jsx)(Ge.Z,{"data-testid":"search-autocomplete-progressbar",color:"inherit",size:20}):vt}),[de,it,Ue,nt]);return(0,B.jsx)(st.ZP,{...we,"data-testid":ue,value:pe,onChange:Ct,options:Pe,getOptionLabel:Le,renderInput:Ke,freeSolo:w,fullWidth:H,clearOnBlur:ve})}),ot=({icon:D,primaryText:U,primaryTextTypographyProps:de,secondaryText:pe,secondaryTextTypographyProps:ye,disableTextTypography:Pe})=>_jsxs(_Fragment,{children:[D?_jsx(ListItemIcon,{children:D}):null,_jsx(ListItemText,{primary:U,primaryTypographyProps:de,secondary:pe,secondaryTypographyProps:ye,disableTypography:Pe})]});var ct=t(42494),yt=t(84899),Lt=t(5806),We=t(21324),se=t(56939),Ie=t(73698),Re=t(12231),tt=t(86619),mt=t(7089),Zt=t(69294);const dt=(D,U,de=[],pe=250)=>{const ye=(0,g.useRef)({}),Pe=D||(()=>Promise.resolve([])),[Le,Ue]=(0,Zt.default)(Pe,[U],{loading:!0});if((0,te.Z)(()=>{ye.current[U]===void 0&&(ye.current[U]=Ue(U).then(w=>(ye.current[U]=w,w)))},pe,[Ue,U]),de.length)return{loading:!1,value:de};const nt=ye.current[U];return Array.isArray(nt)?{loading:!1,value:nt}:Le},Et=(D,U)=>{const{setFilters:de}=A();(0,g.useEffect)(()=>{U&&[U].flat().length>0&&de(pe=>({...pe,[D]:U}))},[])},At=D=>{const{className:U,defaultValue:de,name:pe,values:ye,valuesDebounceMs:Pe,label:Le,filterSelectedOptions:Ue,limitTags:nt,multiple:w}=D,[H,ve]=(0,g.useState)("");Et(pe,de);const ue=typeof ye=="function"?ye:void 0,we=typeof ye=="function"?void 0:ye,{value:ke,loading:Fe}=dt(ue,H,we,Pe),{filters:it,setFilters:Ct}=A(),Ke=it[pe]||(w?[]:null),ht=(Tt,Ut)=>{Ct(Mt=>{const{[pe]:Wn,...Vn}=Mt;return Ut?{...Vn,[pe]:Ut}:{...Vn}})},vt=Tt=>(0,B.jsx)(tt.Z,{...Tt,name:"search",variant:"outlined",label:Le,fullWidth:!0}),at=(Tt,Ut)=>Tt.map((Mt,Wn)=>(0,B.jsx)(mt.Z,{label:Mt,color:"primary",...Ut({index:Wn})}));return(0,B.jsx)(st.ZP,{filterSelectedOptions:Ue,limitTags:nt,multiple:w,className:U,id:`${w?"multi-":""}select-filter-${pe}--select`,options:ke||[],loading:Fe,value:Ke,onChange:ht,onInputChange:(Tt,Ut)=>ve(Ut),renderInput:vt,renderTags:at})},Ot=(0,b.Z)({label:{textTransform:"capitalize"}}),qt=D=>{const{className:U,defaultValue:de,label:pe,name:ye,values:Pe=[],valuesDebounceMs:Le}=D,Ue=Ot(),{filters:nt,setFilters:w}=A();Et(ye,de);const H=typeof Pe=="function"?Pe:void 0,ve=typeof Pe=="function"?void 0:Pe,{value:ue=[],loading:we}=dt(H,"",ve,Le),ke=it=>{const{target:{value:Ct,checked:Ke}}=it;w(ht=>{const{[ye]:vt,...at}=ht,Tt=(vt||[]).filter(Mt=>Mt!==Ct),Ut=Ke?[...Tt,Ct]:Tt;return Ut.length?{...at,[ye]:Ut}:at})};var Fe;return(0,B.jsxs)(ct.Z,{className:U,disabled:we,fullWidth:!0,"data-testid":"search-checkboxfilter-next",children:[pe?(0,B.jsx)(yt.Z,{className:Ue.label,children:pe}):null,ue.map(it=>(0,B.jsx)(Lt.Z,{control:(0,B.jsx)(We.Z,{color:"primary",tabIndex:-1,inputProps:{"aria-labelledby":it},value:it,name:it,onChange:ke,checked:((Fe=nt[ye])!==null&&Fe!==void 0?Fe:[]).includes(it)}),label:it},it))]})},Vt=D=>{const{className:U,defaultValue:de,label:pe,name:ye,values:Pe,valuesDebounceMs:Le}=D,Ue=Ot();Et(ye,de);const nt=typeof Pe=="function"?Pe:void 0,w=typeof Pe=="function"?void 0:Pe,{value:H=[],loading:ve}=dt(nt,"",w,Le),{filters:ue,setFilters:we}=A(),ke=Fe=>{const{target:{value:it}}=Fe;we(Ct=>{const{[ye]:Ke,...ht}=Ct;return it?{...ht,[ye]:it}:ht})};return(0,B.jsxs)(ct.Z,{disabled:ve,className:U,variant:"filled",fullWidth:!0,"data-testid":"search-selectfilter-next",children:[pe?(0,B.jsx)(se.Z,{className:Ue.label,margin:"dense",children:pe}):null,(0,B.jsxs)(Ie.Z,{variant:"outlined",value:ue[ye]||"",onChange:ke,children:[(0,B.jsx)(Re.Z,{value:"",children:(0,B.jsx)("em",{children:"All"})}),H.map(Fe=>(0,B.jsx)(Re.Z,{value:Fe,children:Fe},Fe))]})]})},Ht=({component:D,...U})=>(0,B.jsx)(D,{...U});Ht.Checkbox=D=>(0,B.jsx)(Ht,{...D,component:qt}),Ht.Select=D=>(0,B.jsx)(Ht,{...D,component:Vt}),Ht.Autocomplete=D=>(0,B.jsx)(Ht,{...D,component:At});var Jt=t(93414);const dn=D=>{const{children:U}=D,pe=useSearch().result;return U(pe)},an=D=>{const{query:U,children:de}=D,pe=useApi(searchApiRef),ye=useAsync(()=>{const{term:Pe="",types:Le=[],filters:Ue={},...nt}=U;return pe.query({...nt,term:Pe,types:Le,filters:Ue})},[U]);return de(ye)},Fn=D=>{const{query:U,children:de}=D;return U?_jsx(an,{query:U,children:de}):_jsx(dn,{children:de})},En=D=>{const{query:U,children:de}=D;return _jsx(Fn,{query:U,children:({loading:pe,error:ye,value:Pe})=>pe?_jsx(Progress,{}):ye?_jsx(ResponseErrorPanel,{title:"Error encountered while fetching search results",error:ye}):Pe!=null&&Pe.results.length?de(Pe):_jsx(EmptyState,{missing:"data",title:"Sorry, no results were found"})})},Un=D=>_jsx(AnalyticsContext,{attributes:{pluginId:"search",extension:"SearchResult"},children:_jsx(En,{...D})}),mn=(0,b.Z)(D=>({root:{display:"flex",justifyContent:"space-between",gap:D.spacing(2),margin:D.spacing(2,0)}})),un=()=>{const{fetchNextPage:D,fetchPreviousPage:U}=useSearch(),de=mn();return!D&&!U?_jsx(_Fragment,{}):_jsxs("nav",{"aria-label":"pagination navigation",className:de.root,children:[_jsx(Button,{"aria-label":"previous page",disabled:!U,onClick:U,startIcon:_jsx(ArrowBackIosIcon,{}),children:"Previous"}),_jsx(Button,{"aria-label":"next page",disabled:!D,onClick:D,endIcon:_jsx(ArrowForwardIosIcon,{}),children:"Next"})]})};var Qt=t(48834).lW;const Mn=D=>Qt.from(D.toString(),"utf-8").toString("base64"),zn=D=>D?Number(Qt.from(D,"base64").toString("utf-8")):0,hn=D=>{const{total:U=-1,cursor:de,onCursorChange:pe,limit:ye=25,limitLabel:Pe="Results per page:",limitText:Le=({from:we,to:ke})=>U>0?`of ${U}`:`${we}-${ke}`,limitOptions:Ue,onLimitChange:nt,...w}=D,H=useMemo(()=>zn(de),[de]),ve=useCallback((we,ke)=>{pe==null||pe(Mn(ke))},[pe]),ue=useCallback(we=>{const ke=we.target.value;nt==null||nt(parseInt(ke,10))},[nt]);return _jsx(TablePagination,{...w,component:"div",count:U,page:H,onPageChange:ve,rowsPerPage:ye,labelRowsPerPage:Pe,labelDisplayedRows:Le,rowsPerPageOptions:Ue,onRowsPerPageChange:ue})},vn=D=>{const{pageLimit:U,setPageLimit:de,pageCursor:pe,setPageCursor:ye}=useSearch();return _jsx(hn,{...D,limit:U,onLimitChange:de,cursor:pe,onCursorChange:ye})},yn=({result:D,highlight:U,rank:de,icon:pe,secondaryAction:ye,lineClamp:Pe=5})=>{const Le=useAnalytics(),Ue=()=>{Le.captureEvent("discover",D.title,{attributes:{to:D.location},value:de})};return _jsxs(_Fragment,{children:[_jsxs(ListItem,{alignItems:"center",children:[pe&&_jsx(ListItemIcon,{children:pe}),_jsx(ListItemText,{primaryTypographyProps:{variant:"h6"},primary:_jsx(Link,{noTrack:!0,to:D.location,onClick:Ue,children:U!=null&&U.fields.title?_jsx(HighlightedSearchResultText,{text:(U==null?void 0:U.fields.title)||"",preTag:(U==null?void 0:U.preTag)||"",postTag:(U==null?void 0:U.postTag)||""}):D.title}),secondary:_jsx("span",{style:{display:"-webkit-box",WebkitBoxOrient:"vertical",WebkitLineClamp:Pe,overflow:"hidden"},children:U!=null&&U.fields.text?_jsx(HighlightedSearchResultText,{text:U.fields.text,preTag:U.preTag,postTag:U.postTag}):D.text})}),ye&&_jsx(Box,{alignItems:"flex-end",children:ye})]}),_jsx(Divider,{})]})},Ln=D=>_jsx(AnalyticsContext,{attributes:{pluginId:"search",extension:"DefaultResultListItem"},children:_jsx(yn,{...D})}),Pn=D=>{const{loading:U,error:de,resultItems:pe,renderResultItem:ye=Ue=>_jsx(DefaultResultListItem,{result:Ue.document},Ue.document.location),noResultsComponent:Pe=_jsx(EmptyState,{missing:"data",title:"Sorry, no results were found"}),...Le}=D;return _jsxs(List,{...Le,children:[U?_jsx(Progress,{}):null,!U&&de?_jsx(ResponseErrorPanel,{title:"Error encountered while fetching search results",error:de}):null,!U&&!de&&(pe==null?void 0:pe.length)?pe.map(ye):null,!U&&!de&&!(pe!=null&&pe.length)?_jsx(ListItem,{children:Pe}):null]})},xn=D=>{const{query:U,disableRenderingWithNoResults:de,...pe}=D;return _jsx(AnalyticsContext,{attributes:{pluginId:"search",extension:"SearchResultList"},children:_jsx(SearchResultState,{query:U,children:({loading:ye,error:Pe,value:Le})=>{var Ue;return!(!(Le==null||(Ue=Le.results)===null||Ue===void 0)&&Ue.length)&&de?null:_jsx(Pn,{...pe,loading:ye,error:Pe,resultItems:Le==null?void 0:Le.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)}})),Ee=D=>{const U=ee(),{label:de,children:pe,...ye}=D;return _jsx(Chip,{...ye,className:U.listSubheaderFilter,variant:"outlined",label:_jsxs(_Fragment,{children:[de,": ",pe]})})},Ne=()=>null,_e=(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 U=_e(),{label:de,value:pe="None",onChange:ye,onDelete:Pe}=D,Le=useCallback(Ue=>{ye(Ue.target.value)},[ye]);return _jsx(Ee,{label:de,onDelete:Pe,children:_jsx(Typography,{role:"textbox",component:"span",className:U.root,onChange:Le,contentEditable:!0,suppressContentEditableWarning:!0,children:pe})})},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}}})),k=D=>{const U=ae(),{label:de,value:pe="none",onChange:ye,onDelete:Pe,children:Le}=D,Ue=useCallback(nt=>{ye(nt.target.value)},[ye]);return _jsx(Ee,{label:de,onDelete:Pe,children:_jsxs(Select,{className:U.root,value:pe,onChange:Ue,input:_jsx(InputBase,{}),IconComponent:Ne,children:[_jsx(MenuItem,{value:"none",children:"None"}),Le]})})};function ce(D){const U=ee(),[de,pe]=useState(null),{loading:ye,error:Pe,icon:Le,title:Ue,titleProps:nt={},link:w=_jsxs(_Fragment,{children:["See all",_jsx(ArrowRightIcon,{className:U.listSubheaderLinkIcon})]}),linkProps:H={},filterOptions:ve,renderFilterOption:ue=Tt=>_jsx(MenuItem,{value:String(Tt),children:Tt},String(Tt)),filterFields:we,renderFilterField:ke,resultItems:Fe,renderResultItem:it=Tt=>_jsx(DefaultResultListItem,{result:Tt.document},Tt.document.location),noResultsComponent:Ct=_jsx(EmptyState,{missing:"data",title:"Sorry, no results were found"}),...Ke}=D,ht=useCallback(Tt=>{pe(Tt.currentTarget)},[]),vt=useCallback(()=>{pe(null)},[]);var at;return _jsxs(List,{...Ke,children:[_jsxs(ListSubheader,{className:U.listSubheader,children:[Le,_jsx(Typography,{className:U.listSubheaderName,component:"strong",...nt,children:Ue}),ve?_jsx(Chip,{className:U.listSubheaderChip,component:"button",icon:_jsx(AddIcon,{}),variant:"outlined",label:"Add filter","aria-controls":"filters-menu","aria-haspopup":"true",onClick:ht}):null,ve?_jsx(Menu,{id:"filters-menu",anchorEl:de,open:Boolean(de),onClose:vt,onClick:vt,keepMounted:!0,children:ve.map(ue)}):null,we==null?void 0:we.map(Tt=>(at=ke==null?void 0:ke(Tt))!==null&&at!==void 0?at:null),_jsx(Link,{className:U.listSubheaderLink,to:"/search",...H,children:w})]}),ye?_jsx(Progress,{}):null,!ye&&Pe?_jsx(ResponseErrorPanel,{title:"Error encountered while fetching search results",error:Pe}):null,!ye&&!Pe&&(Fe==null?void 0:Fe.length)?Fe.map(it):null,!ye&&!Pe&&!(Fe!=null&&Fe.length)?_jsx(ListItem,{children:Ct}):null]})}function Oe(D){const{query:U,linkProps:de={},disableRenderingWithNoResults:pe,...ye}=D,Pe=`/search?${qs.stringify({query:U.term,types:U.types,filters:U.filters,pageCursor:U.pageCursor},{arrayFormat:"brackets"})}`;return _jsx(AnalyticsContext,{attributes:{pluginId:"search",extension:"SearchResultGroup"},children:_jsx(SearchResultState,{query:U,children:({loading:Le,error:Ue,value:nt})=>{var w;if(!(!(nt==null||(w=nt.results)===null||w===void 0)&&w.length)&&pe)return null;var H;return _jsx(ce,{...ye,loading:Le,error:Ue,linkProps:{to:Pe,...de},resultItems:nt==null?void 0:nt.results,filterFields:Object.keys((H=U.filters)!==null&&H!==void 0?H:{})})}})})}},61886:function(Rt,Me,t){"use strict";t.d(Me,{Ox:function(){return Ge},jM:function(){return g},Zz:function(){return b},oZ:function(){return Ye},DR:function(){return c},ZS:function(){return Te},VA:function(){return rt},KY:function(){return te},gT:function(){return _},Dl:function(){return fe},ux:function(){return gt},$L:function(){return z},x1:function(){return Qe}});var h=t(52322),r=t(2784),W=t(79635),B=t(25248);const g="techdocs.addons.addon.v1",b="techdocs.addons.wrapper.v1",c=()=>null;(0,B.R5)(c,b,!0);const P=se=>`${g}.${se.toLocaleLowerCase("en-US")}`;function te(se){const{name:Ie,component:Re}=se;return(0,B.YO)({name:Ie,component:{sync:tt=>(0,h.jsx)(Re,{...tt})},data:{[g]:se,[P(Ie)]:!0}})}const Q=(se,Ie)=>se.selectByComponentData({key:Ie}).getElements()[0],X=se=>se.selectByComponentData({key:b}).selectByComponentData({key:g}),M=se=>se.selectByComponentData({key:b}).findComponentData({key:g}),z=()=>{const se=(0,W.pC)(),Ie=(0,B.vJ)(se,X),Re=(0,B.vJ)(se,M),tt=(0,r.useCallback)(dt=>{if(!Ie||!dt)return null;const Et=P(dt.name);var At;return(At=Q(Ie,Et))!==null&&At!==void 0?At:null},[Ie]),mt=(0,r.useCallback)(dt=>{const Et=Re.find(At=>At.name===dt);return Et?tt(Et):null},[Re,tt]),Zt=(0,r.useCallback)(dt=>{const Et=Re.filter(At=>At.location===dt);return Et.length?Et.map(tt):null},[Re,tt]);return{renderComponentByName:mt,renderComponentsByLocation:Zt}},_=(0,B.T0)({id:"plugin.techdocs.service"}),fe=(0,B.T0)({id:"plugin.techdocs.storageservice"});var ie=t(64279),T=t(25271),L=t(51837);function Z(se,Ie){return Ie.getOptionalBoolean("techdocs.legacyUseCaseSensitiveTripletPaths")||(se.kind=se.kind.toLocaleLowerCase(),se.name=se.name.toLocaleLowerCase(),se.namespace=se.namespace.toLocaleLowerCase()),se}const A=(se,Ie)=>(0,T.eE)(se)===(0,T.eE)(Ie),S={title:"",subtitle:"",setTitle:()=>{},setSubtitle:()=>{},setShadowRoot:()=>{},metadata:{loading:!0},entityMetadata:{loading:!0},entityRef:{kind:"",name:"",namespace:""}},q=(0,L.CT)("techdocs-reader-page-context"),Te=(0,r.memo)(({entityRef:se,children:Ie})=>{const Re=(0,B.h_)(_),tt=(0,B.h_)(B.Ds),mt=(0,ie.default)(async()=>Re.getTechDocsMetadata(se),[se]),Zt=(0,ie.default)(async()=>Re.getEntityMetadata(se),[se]),[dt,Et]=(0,r.useState)(S.title),[At,Ot]=(0,r.useState)(S.subtitle),[qt,Vt]=(0,r.useState)(S.shadowRoot),Ht={metadata:mt,entityRef:Z(se,tt),entityMetadata:Zt,shadowRoot:qt,setShadowRoot:Vt,title:dt,setTitle:Et,subtitle:At,setSubtitle:Ot},Jt=(0,L.EI)({1:Ht});return(0,h.jsx)(B.fC,{attributes:{entityRef:(0,T.eE)(se)},children:(0,h.jsx)(q.Provider,{value:Jt,children:Ie instanceof Function?Ie(Ht):Ie})})},(se,Ie)=>A(se.entityRef,Ie.entityRef)),Qe=()=>{const se=(0,r.useContext)(q);if(se===void 0)return S;const Ie=se.atVersion(1);if(Ie===void 0)throw new Error("No context found for version 1.");return Ie},Ye=Object.freeze({Header:"Header",Subheader:"Subheader",Settings:"Settings",PrimarySidebar:"PrimarySidebar",SecondarySidebar:"SecondarySidebar",Content:"Content"});var Xe=t(70882),Ve=t(50236),ft=t(19219),je=t(93414);const Ge="TECH_DOCS_SHADOW_DOM_STYLE_LOAD",st=se=>{(0,r.useEffect)(()=>{if(!se)return()=>{};const Ie=se.querySelectorAll('head > link[rel="stylesheet"]');var Re;let tt=(Re=Ie==null?void 0:Ie.length)!==null&&Re!==void 0?Re:0;const mt=new CustomEvent(Ge);if(!tt)return se.dispatchEvent(mt),()=>{};const Zt=()=>{--tt===0&&se.dispatchEvent(mt)};return Ie==null||Ie.forEach(dt=>{dt.addEventListener("load",Zt)}),()=>{Ie==null||Ie.forEach(dt=>{dt.removeEventListener("load",Zt)})}},[se])},gt=se=>{const[Ie,Re]=(0,r.useState)(!1);return(0,r.useEffect)(()=>{if(!se)return()=>{};Re(!0);const tt=se.style;tt.setProperty("opacity","0");const mt=()=>{Re(!1),tt.setProperty("opacity","1")};return se.addEventListener(Ge,mt),()=>{se.removeEventListener(Ge,mt)}},[se]),Ie},rt=({element:se,onAppend:Ie,children:Re})=>{const[tt,mt]=(0,r.useState)((0,Xe.Ue)({...(0,Ve.Z)(),insertionPoint:void 0}));st(se);const Zt=gt(se),dt=(0,r.useCallback)(Et=>{if(!se||!Et)return;mt((0,Xe.Ue)({...(0,Ve.Z)(),insertionPoint:se.querySelector("head")||void 0}));let At=Et.shadowRoot;At||(At=Et.attachShadow({mode:"open"})),At.replaceChildren(se),typeof Ie=="function"&&Ie(At)},[se,Ie]);return(0,h.jsxs)(h.Fragment,{children:[Zt&&(0,h.jsx)(je.Ex,{}),(0,h.jsxs)(ft.ZP,{jss:tt,sheetsManager:new Map,children:[(0,h.jsx)("div",{ref:dt,"data-testid":"techdocs-native-shadowroot"}),Re]})]})};var ot=t(54073);const ct=()=>{const{shadowRoot:se}=useTechDocsReaderPage();return se},yt=se=>{const Ie=ct();return Ie?se.map(Re=>Ie==null?void 0:Ie.querySelectorAll(Re)).filter(Re=>Re.length).map(Re=>Array.from(Re)).flat():[]},Lt=se=>se.toString()&&se.rangeCount&&se.getRangeAt(0).getBoundingClientRect().top,We=(se=0)=>{const Ie=ct(),[Re,tt]=useState(null),mt=useMemo(()=>debounce(()=>{const Zt=Ie,dt=Zt.getSelection?Zt.getSelection():document.getSelection();dt&&Lt(dt)?tt(dt):tt(null)},se),[Ie,tt,se]);return useEffect(()=>(window.document.addEventListener("selectionchange",mt),()=>window.document.removeEventListener("selectionchange",mt)),[mt]),Re}},52943:function(Rt,Me,t){"use strict";t.r(Me),t.d(Me,{EmbeddedDocsRouter:function(){return ie},Router:function(){return fe},isTechDocsAvailable:function(){return _}});var h=t(52322),r=t(2784),W=t(79635),B=t(92848),g=t(93414),b=t(25271),c=t(89258),P=t(65124),te=t(67896);const Q=({entity:T})=>{const L=(0,b.iB)(T);return(0,h.jsxs)(c.I6,{entityRef:L,children:[(0,h.jsx)(P.b,{}),(0,h.jsx)(te.F,{withSearch:!1})]})};var X=t(18662),M=t(7476);const z="backstage.io/techdocs-ref",_=T=>{var L,Z;return Boolean(T==null||(L=T.metadata)===null||L===void 0||(Z=L.annotations)===null||Z===void 0?void 0:Z[z])},fe=()=>(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)(M.TechDocsReaderPage,{})})]}),ie=T=>{var L;const{children:Z}=T,{entity:A}=(0,B.X2)(),S=(0,W.V$)([{path:"/*",element:(0,h.jsx)(Q,{entity:A}),children:[{path:"*",element:Z}]}]);return((L=A.metadata.annotations)===null||L===void 0?void 0:L[z])?S:(0,h.jsx)(g.sk,{annotation:z})}},92077:function(Rt,Me,t){"use strict";t.d(Me,{k:function(){return g},p:function(){return B}});var h=t(23054),r=t(76372),W=t.n(r);class B{async getApiOrigin(){return await this.discoveryApi.getBaseUrl("techdocs")}async getTechDocsMetadata(c){const{kind:P,namespace:te,name:Q}=c,M=`${await this.getApiOrigin()}/metadata/techdocs/${te}/${P}/${Q}`,z=await this.fetchApi.fetch(`${M}`);if(!z.ok)throw await h.VL.fromResponse(z);return await z.json()}async getEntityMetadata(c){const{kind:P,namespace:te,name:Q}=c,M=`${await this.getApiOrigin()}/metadata/entity/${te}/${P}/${Q}`,z=await this.fetchApi.fetch(`${M}`);if(!z.ok)throw await h.VL.fromResponse(z);return await z.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:Q,name:X}=c,z=`${await this.getStorageUrl()}/${Q}/${te}/${X}/${P}`,_=await this.fetchApi.fetch(`${z.endsWith("/")?z:`${z}/`}index.html`);let fe="";switch(_.status){case 404:throw fe="Page not found. ",P||(fe+="This could be because there is no index.md file in the root of the docs directory of this repository."),new h.dR(fe);case 500:throw fe="Could not generate documentation or an error in the TechDocs backend. ",new Error(fe);default:break}return _.text()}async syncEntityDocs(c,P=()=>{}){const{kind:te,namespace:Q,name:X}=c,z=`${await this.getApiOrigin()}/sync/${Q}/${te}/${X}`,{token:_}=await this.identityApi.getCredentials();return new Promise((fe,ie)=>{const T=new r.EventSourcePolyfill(z,{withCredentials:!0,headers:_?{Authorization:`Bearer ${_}`}:{}});T.addEventListener("log",L=>{L.data&&P(JSON.parse(L.data))}),T.addEventListener("finish",L=>{let Z=!1;L.data&&({updated:Z}=JSON.parse(L.data)),fe(Z?"updated":"cached")}),T.onerror=L=>{switch(T.close(),L.status){case 404:ie(new h.dR(L.message));return;default:ie(new Error(L.data));return}}})}async getBaseUrl(c,P,te){const{kind:Q,namespace:X,name:M}=P,_=`${await this.getApiOrigin()}/static/docs/${X}/${Q}/${M}/${te}`;return new URL(c,_.endsWith("/")?_:`${_}/`).toString()}constructor(c){this.configApi=c.configApi,this.discoveryApi=c.discoveryApi,this.identityApi=c.identityApi,this.fetchApi=c.fetchApi}}},51953:function(Rt,Me,t){"use strict";t.d(Me,{D:function(){return h}});function h(r,W){return W.getOptionalBoolean("techdocs.legacyUseCaseSensitiveTripletPaths")?r:r.toLocaleLowerCase("en-US")}},3482:function(Rt,Me,t){"use strict";t.d(Me,{u:function(){return P}});var h=t(52322),r=t(2784),W=t(93414),B=t(92848),g=t(42081),b=t(48431),c=t(68435);const P=te=>{const{initialFilter:Q="owned",columns:X,actions:M}=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)(B.UO,{children:(0,h.jsxs)(B._i,{children:[(0,h.jsxs)(B._i.Filters,{children:[(0,h.jsx)(b.f,{}),(0,h.jsx)(B.EW,{initialFilter:Q}),(0,h.jsx)(B.dq,{}),(0,h.jsx)(B.xE,{})]}),(0,h.jsx)(B._i.Content,{children:(0,h.jsx)(c.n,{actions:M,columns:X})})]})})]})})}},85478:function(Rt,Me,t){"use strict";t.d(Me,{f:function(){return X}});var h=t(52322),r=t(95573),W=t(51953),B=t(25248),g=t(93414),b=t(94339),c=t(16111),P=t(24579),te=t(14503),Q=t(2784);const X=ie=>{const{entities:T}=ie,L=(0,B.tg)(r.Fw),Z=(0,B.h_)(B.Ds);if(!T)return null;var A,S;return(0,h.jsx)(g.Oh,{"data-testid":"docs-explore",children:T!=null&&T.length?T.map((q,Te)=>(0,h.jsxs)(b.Z,{children:[(0,h.jsx)(c.Z,{children:(0,h.jsx)(g.hu,{title:(A=q.metadata.title)!==null&&A!==void 0?A:q.metadata.name})}),(0,h.jsx)(P.Z,{children:q.metadata.description}),(0,h.jsx)(te.Z,{children:(0,h.jsx)(g.zx,{to:L({namespace:(0,W.D)((S=q.metadata.namespace)!==null&&S!==void 0?S:"default",Z),kind:(0,W.D)(q.kind,Z),name:(0,W.D)(q.metadata.name,Z)}),color:"primary","data-testid":"read_docs",children:"Read Docs"})})]},Te)):null})};var M=t(92848);const z={title:"All Documentation",filterPredicate:()=>!0},_=({entities:ie,group:T})=>{const{loading:L,isOwnedEntity:Z}=useEntityOwnership(),A=ie.filter(q=>T.filterPredicate==="ownedByUser"?L?!1:Z(q):typeof T.filterPredicate=="function"&&T.filterPredicate(q)),S=(()=>typeof T.title=="string"?_jsx(ContentHeader,{title:T.title}):T.title)();return A.length===0?null:_jsxs(Content,{children:[S,_jsx(DocsCardGrid,{entities:A})]})},fe=({groups:ie})=>{const{loading:T,error:L,entities:Z}=useEntityList();if(L)return _jsx(WarningPanel,{severity:"error",title:"Could not load available documentation.",children:_jsx(CodeSnippet,{language:"text",text:L.toString()})});if(T)return _jsx(Progress,{});if(Z.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,S;return Z.sort((q,Te)=>((A=q.metadata.title)!==null&&A!==void 0?A:q.metadata.name).localeCompare((S=Te.metadata.title)!==null&&S!==void 0?S:Te.metadata.name)),_jsx(Content,{children:(ie||[z]).map((q,Te)=>_jsx(_,{entities:Z,group:q},`${q.title}-${Te}`))})}},68435:function(Rt,Me,t){"use strict";t.d(Me,{H:function(){return Z},n:function(){return A}});var h=t(52322),r=t(2784),W=t(95074),B=t(76635),g=t(93414),b=t(92848),c=t(25248),P=t(25271),te=t(95573),Q=t(39981),X=t(2337),M=t(11640),z=t(28347);const _=(0,X.Z)({root:{color:"#f3ba37"}})(M.Z),fe={createCopyDocsUrlAction(S){return q=>({icon:()=>(0,h.jsx)(Q.Z,{fontSize:"small"}),tooltip:"Click to copy documentation link to clipboard",onClick:()=>S(`${window.location.origin}${q.resolved.docsUrl}`)})},createStarEntityAction(S,q){return({entity:Te})=>{const Qe=S(Te);return{cellStyle:{paddingLeft:"1em"},icon:()=>Qe?(0,h.jsx)(_,{}):(0,h.jsx)(z.Z,{}),tooltip:Qe?"Remove from favorites":"Add to favorites",onClick:()=>q(Te)}}}};function ie(S){return S.metadata.title||S.metadata.name}const T={createNameColumn(){return{title:"Document",field:"entity.metadata.name",highlight:!0,render:S=>(0,h.jsx)(g.uw,{value:(0,h.jsx)(g.rU,{to:S.resolved.docsUrl,children:ie(S.entity)}),subvalue:S.entity.metadata.description})}},createOwnerColumn(){return{title:"Owner",field:"resolved.ownedByRelationsTitle",render:({resolved:S})=>(0,h.jsx)(b.rI,{entityRefs:S.ownedByRelations,defaultKind:"group"})}},createTypeColumn(){return{title:"Type",field:"entity.spec.type"}}};var L=t(51953);const Z=S=>{const{entities:q,title:Te,loading:Qe,columns:Ye,actions:Xe}=S,[,Ve]=(0,W.Z)(),ft=(0,c.tg)(te.Fw),je=(0,c.h_)(c.Ds);if(!q)return null;const Ge=q.map(rt=>{const ot=(0,b.hF)(rt,P.S4);var ct;return{entity:rt,resolved:{docsUrl:ft({namespace:(0,L.D)((ct=rt.metadata.namespace)!==null&&ct!==void 0?ct:"default",je),kind:(0,L.D)(rt.kind,je),name:(0,L.D)(rt.metadata.name,je)}),ownedByRelations:ot,ownedByRelationsTitle:ot.map(yt=>(0,b.$3)(yt,{defaultKind:"group"})).join(", ")}}}),st=[T.createNameColumn(),T.createOwnerColumn(),T.createTypeColumn()],gt=[fe.createCopyDocsUrlAction(Ve)];return(0,h.jsx)(h.Fragment,{children:Qe||Ge&&Ge.length>0?(0,h.jsx)(g.iA,{isLoading:Qe,options:{paging:!0,pageSize:20,search:!0,actionsColumnIndex:-1},data:Ge,columns:Ye||st,actions:Xe||gt,title:Te?`${Te} (${Ge.length})`:`All (${Ge.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"})})})};Z.columns=T,Z.actions=fe;const A=S=>{var q;const{columns:Te,actions:Qe}=S,{loading:Ye,error:Xe,entities:Ve,filters:ft}=(0,b.wp)(),{isStarredEntity:je,toggleStarredEntity:Ge}=(0,b.CR)(),[,st]=(0,W.Z)();var gt;const rt=(0,B.capitalize)((gt=(q=ft.user)===null||q===void 0?void 0:q.value)!==null&>!==void 0?gt:"all"),ot=[fe.createCopyDocsUrlAction(st),fe.createStarEntityAction(je,Ge)];return Xe?(0,h.jsx)(g.GB,{severity:"error",title:"Could not load available documentation.",children:(0,h.jsx)(g.Oi,{language:"text",text:Xe.toString()})}):(0,h.jsx)(Z,{title:rt,entities:Ve,loading:Ye,actions:Qe||ot,columns:Te})};A.columns=T,A.actions=fe},18662:function(Rt,Me,t){"use strict";t.r(Me),t.d(Me,{TechDocsIndexPage:function(){return g}});var h=t(52322),r=t(2784),W=t(79635),B=t(3482);const g=b=>(0,W.pC)()||(0,h.jsx)(B.u,{...b})},42081:function(Rt,Me,t){"use strict";t.d(Me,{j:function(){return g}});var h=t(52322),r=t(2784),W=t(93414),B=t(25248);const g=b=>{const{children:c}=b,P=(0,B.h_)(B.Ds);var te;const Q=`Documentation available in ${(te=P.getOptionalString("organization.name"))!==null&&te!==void 0?te:"Backstage"}`;return(0,h.jsx)(W.g9,{title:"Documentation",subtitle:Q,themeId:"documentation",children:c})}},48431:function(Rt,Me,t){"use strict";t.d(Me,{f:function(){return B}});var h=t(2784),r=t(92848);class W{getCatalogFilters(){return{"metadata.annotations.backstage.io/techdocs-ref":r.n3}}}const B=()=>{const{updateFilters:g}=(0,r.wp)();return(0,h.useEffect)(()=>{g({techdocs:new W})},[g]),null}},89258:function(Rt,Me,t){"use strict";t.d(Me,{I6:function(){return Q},Jl:function(){return te},s4:function(){return g}});var h=t(61886),r=t(92077),W=t(95573),B=t(25248);const g=(0,B.rx)({id:"techdocs",apis:[(0,B.ni)({api:h.Dl,deps:{configApi:B.Ds,discoveryApi:B.NW,identityApi:B.$4,fetchApi:B.gP},factory:({configApi:X,discoveryApi:M,identityApi:z,fetchApi:_})=>new r.k({configApi:X,discoveryApi:M,identityApi:z,fetchApi:_})}),(0,B.ni)({api:h.gT,deps:{configApi:B.Ds,discoveryApi:B.NW,fetchApi:B.gP},factory:({configApi:X,discoveryApi:M,fetchApi:z})=>new r.p({configApi:X,discoveryApi:M,fetchApi:z})})],routes:{root:W._Z,docRoot:W.Fw,entityContent:W.pd}}),b=g.provide((0,B.P4)({name:"TechdocsPage",component:()=>Promise.resolve().then(t.bind(t,52943)).then(X=>X.Router),mountPoint:W._Z})),c=g.provide((0,B.P4)({name:"EntityTechdocsContent",component:()=>Promise.resolve().then(t.bind(t,52943)).then(X=>X.EmbeddedDocsRouter),mountPoint:W.pd})),P=g.provide((0,B.P4)({name:"TechDocsCustomHome",component:()=>t.e(7560).then(t.bind(t,27560)).then(X=>X.TechDocsCustomHome),mountPoint:W._Z})),te=g.provide((0,B.P4)({name:"TechDocsIndexPage",component:()=>Promise.resolve().then(t.bind(t,18662)).then(X=>X.TechDocsIndexPage),mountPoint:W._Z})),Q=g.provide((0,B.P4)({name:"TechDocsReaderPage",component:()=>Promise.resolve().then(t.bind(t,7476)).then(X=>X.TechDocsReaderPage),mountPoint:W.Fw}))},7476:function(Rt,Me,t){"use strict";t.r(Me),t.d(Me,{TechDocsReaderLayout:function(){return X},TechDocsReaderPage:function(){return M}});var h=t(52322),r=t(2784),W=t(79635),B=t(93414),g=t(61886),b=t(67896),c=t(93225),P=t(65124),te=t(95573),Q=t(25248);const X=({withSearch:z,withHeader:_=!0})=>(0,h.jsxs)(B.T3,{themeId:"documentation",children:[_&&(0,h.jsx)(c.S,{}),(0,h.jsx)(P.b,{}),(0,h.jsx)(b.F,{withSearch:z})]}),M=z=>{const{kind:_,name:fe,namespace:ie}=(0,Q.Oi)(te.Fw),{children:T,entityRef:L={kind:_,name:fe,namespace:ie}}=z,Z=(0,W.pC)();if(!T){const S=Z?r.Children.toArray(Z.props.children):[];var A;const Te=S.flatMap(Qe=>{var Ye;return(A=Qe==null||(Ye=Qe.props)===null||Ye===void 0?void 0:Ye.children)!==null&&A!==void 0?A:[]}).find(Qe=>!(0,Q.IY)(Qe,g.Zz)&&!(0,Q.IY)(Qe,g.jM));return(0,h.jsx)(g.ZS,{entityRef:L,children:Te||(0,h.jsx)(X,{})})}return(0,h.jsx)(g.ZS,{entityRef:L,children:({metadata:S,entityMetadata:q,onReady:Te})=>(0,h.jsx)("div",{className:"techdocs-reader-page",children:(0,h.jsx)(B.T3,{themeId:"documentation",children:T instanceof Function?T({entityRef:L,techdocsMetadataValue:S.value,entityMetadataValue:q.value,onReady:Te}):T})})})}},67896:function(Rt,Me,t){"use strict";t.d(Me,{F:function(){return Ue}});var h=t(52322),r=t(2784),W=t(79692),B=t(60905),g=t(61886),b=t(93414),c=t(17339),P=t(4614),te=t(77277),Q=t(99688),X=t(12420),M=t(90436),z=t(61837),_=t(4190),fe=t(87685);const ie=(0,W.Z)(w=>(0,X.Z)({paper:{width:"100%",[w.breakpoints.up("sm")]:{width:"75%"},[w.breakpoints.up("md")]:{width:"50%"},padding:w.spacing(2.5)},root:{height:"100%",overflow:"hidden"},logs:{background:w.palette.background.default}})),T=({buildLog:w,onClose:H})=>{const ve=ie(),ue=w.length===0?"Waiting for logs...":w.join(`
|
|
34
|
-
`);return(0,h.jsxs)(B.Z,{container:!0,direction:"column",className:ve.root,spacing:0,wrap:"nowrap",children:[(0,h.jsxs)(B.Z,{item:!0,container:!0,justifyContent:"space-between",alignItems:"center",spacing:0,wrap:"nowrap",children:[(0,h.jsx)(M.Z,{variant:"h5",children:"Build Details"}),(0,h.jsx)(z.Z,{title:"Close the drawer",onClick:H,color:"inherit",children:(0,h.jsx)(fe.Z,{})},"dismiss")]}),(0,h.jsx)(b.nU,{text:ue,classes:{root:ve.logs}})]})},L=({buildLog:w})=>{const H=ie(),[ve,ue]=(0,r.useState)(!1);return(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(te.Z,{color:"inherit",onClick:()=>ue(!0),children:"Show Build Logs"}),(0,h.jsx)(_.ZP,{classes:{paper:H.paper},anchor:"right",open:ve,onClose:()=>ue(!1),children:(0,h.jsx)(T,{buildLog:w,onClose:()=>ue(!1)})})]})};var Z=t(25248);const A=({errorMessage:w})=>{const H=(0,Z.h_)(Z.Ds).getOptionalString("techdocs.builder");let ve="";return H!=="local"&&(ve="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:w||"Documentation not found",additionalInfo:ve})};var S=t(95481);const q=(0,W.Z)(w=>({root:{marginBottom:w.spacing(2)},message:{wordBreak:"break-word",overflowWrap:"anywhere"}})),Te=()=>{let w=null;const H=q(),{state:ve,contentReload:ue,contentErrorMessage:we,syncErrorMessage:ke,buildLog:Fe}=(0,S.DK)();return ve==="INITIAL_BUILD"&&(w=(0,h.jsx)(Q.Z,{classes:{root:H.root},variant:"outlined",severity:"info",icon:(0,h.jsx)(P.Z,{size:"24px"}),action:(0,h.jsx)(L,{buildLog:Fe}),children:"Documentation is accessed for the first time and is being prepared. The subsequent loads are much faster."})),ve==="CONTENT_STALE_REFRESHING"&&(w=(0,h.jsx)(Q.Z,{variant:"outlined",severity:"info",icon:(0,h.jsx)(P.Z,{size:"24px"}),action:(0,h.jsx)(L,{buildLog:Fe}),classes:{root:H.root},children:"A newer version of this documentation is being prepared and will be available shortly."})),ve==="CONTENT_STALE_READY"&&(w=(0,h.jsx)(Q.Z,{variant:"outlined",severity:"success",action:(0,h.jsx)(te.Z,{color:"inherit",onClick:()=>ue(),children:"Refresh"}),classes:{root:H.root},children:"A newer version of this documentation is now available, please refresh to view."})),ve==="CONTENT_STALE_ERROR"&&(w=(0,h.jsxs)(Q.Z,{variant:"outlined",severity:"error",action:(0,h.jsx)(L,{buildLog:Fe}),classes:{root:H.root,message:H.message},children:["Building a newer version of this documentation failed."," ",ke]})),ve==="CONTENT_NOT_FOUND"&&(w=(0,h.jsxs)(h.Fragment,{children:[ke&&(0,h.jsxs)(Q.Z,{variant:"outlined",severity:"error",action:(0,h.jsx)(L,{buildLog:Fe}),classes:{root:H.root,message:H.message},children:["Building a newer version of this documentation failed."," ",ke]}),(0,h.jsx)(A,{errorMessage:we})]})),w};var Qe=t(79635),Ye=t(60364),Xe=t(41156),Ve=t(32838),ft=t(35368),je=t.n(ft);const Ge=/main\.[A-Fa-f0-9]{8}\.min\.css$/,st=/^https:\/\/fonts\.googleapis\.com/,gt=/^https:\/\/fonts\.gstatic\.com/,rt=w=>w.nodeName==="LINK",ot=w=>{const H=(w==null?void 0:w.getAttribute("href"))||"",ve=H.match(Ge),ue=H.match(st),we=H.match(gt);return ve||ue||we},ct=w=>(rt(w)&&!ot(w)&&w.remove(),w),yt=w=>w.nodeName==="IFRAME",Lt=(w,H)=>{const ve=w.getAttribute("src")||"";try{const{host:ue}=new URL(ve);return H.includes(ue)}catch{return!1}},We=w=>H=>(yt(H)&&!Lt(H,w)&&H.remove(),H),se=()=>{const w=(0,Z.h_)(Z.Ds);return(0,r.useMemo)(()=>w.getOptionalConfig("techdocs.sanitizer"),[w])},Ie=()=>{const w=se();return(0,r.useCallback)(async H=>{const ve=w==null?void 0:w.getOptionalStringArray("allowedIframeHosts");je().addHook("beforeSanitizeElements",ct);const ue=["link"];return ve&&(ue.push("iframe"),je().addHook("beforeSanitizeElements",We(ve))),je().sanitize(H.innerHTML,{ADD_TAGS:ue,FORBID_TAGS:["style"],WHOLE_DOCUMENT:!0,RETURN_DOM:!0})},[w])};var
|
|
32
|
+
`},Yr=100,fr=10,Tr=(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:Yr,height:`calc(100% + ${fr}px)`,transition:"opacity 300ms",pointerEvents:"none"},fadeLeft:{left:-fr,background:`linear-gradient(90deg, ${Ar(e.palette.type)})`},fadeRight:{right:-fr,background:`linear-gradient(270deg, ${Ar(e.palette.type)})`},fadeHidden:{opacity:0},button:{position:"absolute"},buttonLeft:{left:-e.spacing(2)},buttonRight:{right:-e.spacing(2)}}),{name:"BackstageHorizontalScrollGrid"});function ps(e){const[[s,i],u]=React.useState([0,0]);return React.useLayoutEffect(()=>{const p=e.current;if(!p){u([0,0]);return}const m=()=>{const E=p.scrollLeft,O=p.scrollWidth-p.offsetWidth-p.scrollLeft;u([E,O])};return m(),p.addEventListener("scroll",m),window.addEventListener("resize",m),()=>{p.removeEventListener("scroll",m),window.removeEventListener("resize",m)}},[e]),[s,i]}function Dr(e,s,i){const[u,p]=React.useState(0);return React.useLayoutEffect(()=>{if(u===0)return;const m=window.performance.now(),E=requestAnimationFrame(O=>{if(!e.current)return;const G=O-m,F=Math.abs(u)*G/s,re=Math.max(i,F)*Math.sign(u);e.current.scrollBy({left:re});const xe=u-re;Math.sign(u)!==Math.sign(xe)?p(0):p(xe)});return()=>cancelAnimationFrame(E)},[e,u,s,i]),p}function er(e){const{scrollStep:s=100,scrollSpeed:i=50,minScrollDistance:u=5,children:p,...m}=e,E=Tr(e),O=React.useRef(),[G,F]=ps(O),he=Dr(O,i,u),re=xe=>{!O.current||he(xe?s:-s)};return _jsxs(Box,{...m,className:E.root,children:[_jsx(Grid,{container:!0,direction:"row",wrap:"nowrap",className:E.container,ref:O,children:p}),_jsx(Box,{className:classNames(E.fade,E.fadeLeft,{[E.fadeHidden]:G===0})}),_jsx(Box,{className:classNames(E.fade,E.fadeRight,{[E.fadeHidden]:F===0})}),G>0&&_jsx(IconButton,{title:"Scroll Left",onClick:()=>re(!1),className:classNames(E.button,E.buttonLeft,{}),children:_jsx(ChevronLeftIcon,{})}),F>0&&_jsx(IconButton,{title:"Scroll Right",onClick:()=>re(!0),className:classNames(E.button,E.buttonRight,{}),children:_jsx(ChevronRightIcon,{})})]})}const Ir=(0,c.Z)({alpha:{color:"#ffffff",fontFamily:"serif",fontWeight:"normal",fontStyle:"italic"},beta:{color:"#4d65cc",fontFamily:"serif",fontWeight:"normal",fontStyle:"italic"}},{name:"BackstageLifecycle"});function Nr(e){const s=Ir(e),{shorthand:i,alpha:u}=e;return i?_jsx(Typography,{component:"span",className:s[u?"alpha":"beta"],style:{fontSize:"120%"},children:u?_jsx(_Fragment,{children:"\u03B1"}):_jsx(_Fragment,{children:"\u03B2"})}):_jsx(Typography,{component:"span",className:s[u?"alpha":"beta"],children:u?"Alpha":"Beta"})}const fs=(0,g.lazy)(()=>Promise.all([t.e(5869),t.e(6051)]).then(t.bind(t,76051)).then(e=>({default:e.RealLogViewer})));function Fr(e){const{Progress:s}=(0,W.qD)().getComponents();return(0,r.jsx)(g.Suspense,{fallback:(0,r.jsx)(s,{}),children:(0,r.jsx)(fs,{...e})})}const Jr=(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"}),Qr=(e,s)=>s?typeof s=="string"?e+s:g.Children.toArray(s.props.children).reduce(Qr,e):e,sr=({level:e,children:s})=>{const p=g.Children.toArray(s).reduce(Qr,"").toLocaleLowerCase("en-US").replace(/\W/g,"-");return g.createElement(`h${e}`,{id:p},s)},gr={code:({inline:e,className:s,children:i,...u})=>{const p=String(i).replace(/\n+$/,""),m=/language-(\w+)/.exec(s||"");return!e&&m?(0,r.jsx)(se,{language:m[1],text:p}):(0,r.jsx)("code",{className:s,...u,children:i})},h1:sr,h2:sr,h3:sr,h4:sr,h5:sr,h6:sr};function Fs(e){const{content:s,dialect:i="gfm",linkTarget:u,transformLinkUri:p,transformImageUri:m,className:E}=e,O=Jr();return _jsx(ReactMarkdown,{remarkPlugins:i==="gfm"?[gfm]:[],className:`${O.markdown} ${E}`,children:s,components:gr,linkTarget:u,transformLinkUri:p,transformImageUri:m})}var gs=t(23054);const Xr=(0,c.Z)(e=>({root:{paddingLeft:e.spacing(3)}}),{name:"BackstageLoginRequestListItem"}),Us=({request:e,busy:s,setBusy:i})=>{const u=Xr(),[p,m]=useState(),E=async()=>{i(!0);try{await e.trigger()}catch(G){m(isError(G)?G.message:"An unspecified error occurred")}finally{i(!1)}},O=e.provider.icon;return _jsxs(ListItem,{disabled:s,classes:{root:u.root},children:[_jsx(ListItemAvatar,{children:_jsx(O,{fontSize:"large"})}),_jsx(ListItemText,{primary:e.provider.title,secondary:p&&_jsx(Typography,{color:"error",children:p})}),_jsx(Button,{color:"primary",variant:"contained",onClick:E,children:"Log in"})]})};var ms=null;const qr=(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 Ms(e){const s=qr(),[i,u]=useState(!1),p=useApi(oauthRequestApiRef),m=useObservable(useMemo(()=>p.authRequest$(),[p]),[]),E=()=>{m.forEach(O=>O.reject())};return _jsxs(Dialog,{open:Boolean(m.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:m.map(O=>_jsx(LoginRequestListItem,{request:O,busy:i,setBusy:u},O.provider.title))})})]}),_jsx(DialogActions,{classes:{root:s.actionButtons},children:_jsx(Button,{onClick:E,children:"Reject All"})})]})}var dr=t(15277),vs=t.n(dr),ys=t(29862);const _r=(0,c.Z)({container:{overflow:"visible !important"}},{name:"BackstageOverflowTooltip"});function or(e){const[s,i]=(0,g.useState)(!1),u=(0,ys.t)(),p=_r(),m=O=>{u()&&i(O)};var E;return(0,r.jsx)(ct.ZP,{title:(E=e.title)!==null&&E!==void 0?E:e.text||"",placement:e.placement,disableHoverListener:!s,children:(0,r.jsx)(vs(),{text:e.text,line:e.line,onToggled:m,containerClassName:p.container})})}var mr=t(67358);function xs(e){const s=(0,Ge.Z)(),[i,u]=(0,g.useState)(!1);return(0,g.useEffect)(()=>{const p=setTimeout(()=>u(!0),s.transitions.duration.short);return()=>clearTimeout(p)},[s.transitions.duration.short]),i?(0,r.jsx)(mr.Z,{...e,"data-testid":"progress"}):(0,r.jsx)(je.Z,{display:"none"})}var es=t(94339),ts=t(14503),Ur=t(24579),ns=t(32552),An=t(15459),Wt=t(27597);const bs=(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 Ss(e){const{link:s,title:i,onClick:u}=e,p=bs();return(0,r.jsxs)(je.Z,{children:[(0,r.jsx)(On.Z,{}),(0,r.jsx)(Xe,{to:s,onClick:u,underline:"none",children:(0,r.jsxs)(je.Z,{display:"flex",alignItems:"center",className:p.root,children:[(0,r.jsx)(je.Z,{className:p.boxTitle,fontWeight:"fontWeightBold",m:1,children:(0,r.jsx)(z.Z,{children:(0,r.jsx)("strong",{children:i})})}),(0,r.jsx)(Wt.Z,{className:p.arrow})]})})]})}const ws=e=>{const{slackChannel:s}=e;if(s){if(typeof s=="string")return(0,r.jsxs)(z.Z,{children:["Please contact ",s," for help."]});if(!s.href)return(0,r.jsxs)(z.Z,{children:["Please contact ",s.name," for help."]})}else return null;return(0,r.jsx)(ft,{to:s.href,variant:"contained",children:s.name})},Cs=class extends g.Component{componentDidCatch(s,i){console.error(`ErrorBoundary, error: ${s}, info: ${i}`),this.setState({error:s,errorInfo:i})}render(){const{slackChannel:s,children:i}=this.props,{error:u}=this.state;return u?(0,r.jsx)(ln,{title:"Something Went Wrong",error:u,children:(0,r.jsx)(ws,{slackChannel:s})}):i}constructor(s){super(s),this.state={error:void 0,errorInfo:void 0}}},js=(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"}),Es=(0,An.Z)(e=>({root:{display:"inline-block",padding:e.spacing(8,8,0,0),float:"right"}}),{name:"BackstageInfoCardCardActionsTopRight"})(ts.Z),rs={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 Rr(e){const{title:s,subheader:i,divider:u=!0,deepLink:p,slackChannel:m,errorBoundaryProps:E,variant:O,children:G,headerStyle:F,headerProps:he,icon:re,action:xe,actionsClassName:Ce,actions:He,cardClassName:qe,actionsTopRight:Pt,className:Gt,noPadding:tn,titleTypographyProps:nn}=e,kt=js();let Xt={},Kt={};O&&O.split(/[\s]+/g).forEach(Cr=>{Xt={...Xt,...rs.card[Cr]},Kt={...Kt,...rs.cardContent[Cr]}});const br=()=>!i&&!re?null:(0,r.jsxs)("div",{className:kt.headerSubheader,"data-testid":"info-card-subheader",children:[i&&(0,r.jsx)("div",{className:kt.subheader,children:i}),re]}),Sr=E||(m?{slackChannel:m}:{});return(0,r.jsx)(es.Z,{style:Xt,className:Gt,children:(0,r.jsxs)(Cs,{...Sr,children:[s&&(0,r.jsx)(ns.Z,{classes:{root:kt.header,title:kt.headerTitle,subheader:kt.headerSubheader,avatar:kt.headerAvatar,action:kt.headerAction,content:kt.headerContent},title:s,subheader:br(),action:xe,style:{...F},titleTypographyProps:nn,...he}),Pt&&(0,r.jsx)(Es,{children:Pt}),u&&(0,r.jsx)(On.Z,{}),(0,r.jsx)(Ur.Z,{className:fe()(qe,{[kt.noPadding]:tn}),style:Kt,children:G}),He&&(0,r.jsx)(ts.Z,{className:Ce,children:He}),p&&(0,r.jsx)(Ss,{...p})]})})}var zs=t(39307);const As=(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"}),Ts={fractional:!0,inverse:!1,unit:"%",max:100},v=({palette:e,value:s,inverse:i,max:u})=>{if(isNaN(s))return"#ddd";const p=u||Ts.max,m=i?p-s:s;return m<p/3?e.status.error:m<p*(2/3)?e.status.warning:e.status.ok};function x(e){const[s,i]=useState(null),{getColor:u=v}=e,p=As(e),{palette:m}=useTheme(),{value:E,fractional:O,inverse:G,unit:F,max:he,description:re}={...Ts,...e},xe=O?Math.round(E*he):E,Ce=he!==100?Math.round(E):xe,[He,qe]=useState(!1);return useEffect(()=>{const Pt=s,Gt=()=>qe(!0),tn=()=>qe(!1);return Pt&&re?(Pt.addEventListener("mouseenter",Gt),Pt.addEventListener("mouseleave",tn),()=>{Pt.removeEventListener("mouseenter",Gt),Pt.removeEventListener("mouseleave",tn)}):()=>{qe(!1)}},[re,s]),_jsxs(Box,{ref:i,className:p.root,children:[_jsx(Circle,{strokeLinecap:"butt",percent:xe,strokeWidth:12,trailWidth:12,strokeColor:u({palette:m,value:Ce,inverse:G,max:he}),className:p.circle}),re&&He?_jsx(Box,{className:p.description,children:re}):_jsx(Box,{className:p.overlay,children:isNaN(E)?"N/A":`${Ce}${F}`})]})}const I=(0,c.Z)({root:{height:"100%",width:250}},{name:"BackstageGaugeCard"});function $(e){const s=I(e),{title:i,subheader:u,progress:p,inverse:m,deepLink:E,description:O,icon:G,variant:F,getColor:he}=e,re={inverse:m,description:O,getColor:he,value:p};return _jsx(Box,{className:s.root,children:_jsx(InfoCard,{title:i,subheader:u,deepLink:E,variant:F,icon:G,children:_jsx(Gauge,{...re})})})}function J(e){const{value:s,getColor:i=getProgressColor}=e,{palette:u}=useTheme();if(isNaN(s))return null;let p=Math.round(s*100*100)/100;p>100&&(p=100);const m=i({palette:u,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:m})})})}var K=t(21324),oe=t(7089),le=t(1292),Se=t(42494),Be=t(74603),$e=t(56939),Ae=t(12231),Je=t(73698),xt=t(72379);const It=(0,c.Z)(e=>(0,P.Z)({icon:{position:"absolute",right:e.spacing(.5),pointerEvents:"none"}}),{name:"BackstageClosedDropdown"});var $t=()=>{const e=It();return(0,r.jsx)(xt.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 Dt=(0,c.Z)(e=>(0,P.Z)({icon:{position:"absolute",right:e.spacing(.5),pointerEvents:"none"}}),{name:"BackstageOpenedDropdown"});var rn=()=>{const e=Dt();return(0,r.jsx)(xt.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 tr=(0,An.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"})(Be.Z),wn=(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 Tn(e){const{multiple:s,items:i,label:u,placeholder:p,selected:m,onChange:E,triggerReset:O,native:G=!1,disabled:F=!1,margin:he}=e,re=wn(),[xe,Ce]=(0,g.useState)(m||(s?[]:"")),[He,qe]=(0,g.useState)(!1);(0,g.useEffect)(()=>{Ce(s?[]:"")},[O,s]),(0,g.useEffect)(()=>{m!==void 0&&Ce(m)},[m]);const Pt=kt=>{Ce(kt.target.value),E(kt.target.value)},Gt=kt=>{if(F){kt.preventDefault();return}qe(Xt=>s&&!(kt.target instanceof HTMLElement)?!0:!Xt)},tn=()=>{qe(!1)},nn=kt=>()=>{const Xt=xe.filter(Kt=>Kt!==kt);Ce(Xt),E(Xt)};return(0,r.jsx)(je.Z,{className:re.root,children:(0,r.jsx)(le.Z,{onClickAway:tn,children:(0,r.jsxs)(Se.Z,{className:re.formControl,children:[(0,r.jsx)($e.Z,{className:re.formLabel,children:u}),(0,r.jsxs)(Je.Z,{"aria-label":u,value:xe,native:G,disabled:F,"data-testid":"select",displayEmpty:!0,multiple:s,margin:he,onChange:Pt,onClick:Gt,open:He,input:(0,r.jsx)(tr,{}),label:u,tabIndex:0,renderValue:kt=>{var Xt;return s&&xe.length!==0?(0,r.jsx)(je.Z,{className:re.chips,children:kt.map(Kt=>{var br,Sr;return(0,r.jsx)(oe.Z,{label:(br=i.find(wr=>wr.value===Kt))===null||br===void 0?void 0:br.label,clickable:!0,onDelete:nn(Kt),className:re.chip},(Sr=i.find(wr=>wr.value===Kt))===null||Sr===void 0?void 0:Sr.value)})}):(0,r.jsx)(z.Z,{children:xe.length===0?p||"":(Xt=i.find(Kt=>Kt.value===kt))===null||Xt===void 0?void 0:Xt.label})},IconComponent:()=>He?(0,r.jsx)(rn,{}):(0,r.jsx)($t,{}),MenuProps:{anchorOrigin:{vertical:"bottom",horizontal:"left"},transformOrigin:{vertical:"top",horizontal:"left"},getContentAnchorEl:null},children:[p&&!s&&(0,r.jsx)(Ae.Z,{value:[],children:p}),G?i&&i.map(kt=>(0,r.jsx)("option",{value:kt.value,children:kt.label},kt.value)):i&&i.map(kt=>(0,r.jsxs)(Ae.Z,{value:kt.value,children:[s&&(0,r.jsx)(K.Z,{color:"primary",checked:xe.includes(kt.value)||!1,className:re.checkbox}),kt.label]},kt.value))]})]})})})}const In=()=>{},Lr=g.createContext({stepperLength:0,stepIndex:0,setStepIndex:In,stepHistory:[],setStepHistory:In,onStepChange:In});function Pr(e){const{children:s,elevated:i,onStepChange:u,activeStep:p=0}=e,[m,E]=useState(p),[O,G]=useState([0]);useEffect(()=>{E(p)},[p]);const F=[];let he;return Children.forEach(s,re=>{isValidElement(re)&&(re.props.end?he=re:F.push(re))}),_jsxs(_Fragment,{children:[_jsx(Lr.Provider,{value:{stepIndex:m,setStepIndex:E,stepHistory:O,setStepHistory:G,onStepChange:u,stepperLength:Children.count(s)},children:_jsx(MuiStepper,{activeStep:m,orientation:"vertical",elevation:i?2:0,children:F})}),m>=Children.count(s)-1&&he]})}const kr=(0,c.Z)(e=>({root:{marginTop:e.spacing(3),"& button":{marginRight:e.spacing(1)}}}),{name:"BackstageSimpleStepperFooter"}),Rn=({text:e,handleClick:s})=>_jsx(Button,{onClick:s,children:e||"Reset"}),$n=({text:e,handleClick:s,disabled:i,last:u,stepIndex:p})=>_jsx(Button,{variant:"contained",color:"primary",disabled:i,"data-testid":`nextButton-${p}`,onClick:s,children:e||(u?"Finish":"Next")}),vr=({text:e,handleClick:s,disabled:i,stepIndex:u})=>_jsx(Button,{variant:"outlined",color:"primary",disabled:i,"data-testid":`skipButton-${u}`,onClick:s,children:e||"Skip"}),bo=({text:e,handleClick:s,disabled:i,stepIndex:u})=>_jsx(Button,{onClick:s,"data-testid":`backButton-${u}`,disabled:i,children:e||"Back"}),So=({actions:e={},children:s})=>{const i=kr(),{stepperLength:u,stepIndex:p,setStepIndex:m,stepHistory:E,setStepHistory:O,onStepChange:G}=useContext(VerticalStepperContext),F=(Ce,He)=>{He&&He(),G&&G(p,Ce),m(Ce)},he=()=>{const Ce=e.nextStep?e.nextStep(p,u-1):p+1;F(Ce,e.onNext),O([...E,Ce])},re=()=>{E.pop(),F(E[E.length-1],e.onBack),O([...E])},xe=()=>{F(0,e.onRestart),O([0])};return _jsxs(Box,{className:i.root,children:[[void 0,!0].includes(e.showBack)&&p!==0&&_jsx(bo,{text:e.backText,handleClick:re,disabled:p===0,stepIndex:p}),e.showSkip&&_jsx(vr,{text:e.skipText,handleClick:he,disabled:!!u&&p>=u||!!e.canSkip&&!e.canSkip(),stepIndex:p}),[void 0,!0].includes(e.showNext)&&_jsx($n,{text:e.nextText,handleClick:he,disabled:!!u&&p>=u||!!e.canNext&&!e.canNext(),stepIndex:p}),e.showRestart&&p!==0&&_jsx(Rn,{text:e.restartText,handleClick:xe,stepIndex:p}),s]})},Ws=(0,c.Z)(e=>({end:{padding:e.spacing(3)}}),{name:"SimpleStepperStep"});function di(e){const{title:s,children:i,end:u,actions:p,...m}=e,E=Ws();return u?_jsxs(Box,{className:E.end,children:[_jsx(Typography,{variant:"h6",children:s}),i,_jsx(SimpleStepperFooter,{actions:{...p||{},showNext:!1}})]}):_jsxs(MuiStep,{...m,children:[_jsx(StepLabel,{children:_jsx(Typography,{variant:"h6",children:s})}),_jsxs(StepContent,{children:[i,_jsx(SimpleStepperFooter,{actions:p})]})]})}const Or=(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 Vs(e){const s=Or(e);return _jsx(Typography,{component:"span",className:classNames(s.status,s.ok),"aria-label":"Status ok","aria-hidden":"true",...e})}function wo(e){const s=Or(e);return _jsx(Typography,{component:"span",className:classNames(s.status,s.warning),"aria-label":"Status warning","aria-hidden":"true",...e})}function ui(e){const s=Or(e);return _jsx(Typography,{component:"span",className:classNames(s.status,s.error),"aria-label":"Status error","aria-hidden":"true",...e})}function hi(e){const s=Or(e);return _jsx(Typography,{component:"span",className:classNames(s.status,s.pending),"aria-label":"Status pending","aria-hidden":"true",...e})}function ta(e){const s=Or(e);return _jsx(Typography,{component:"span",className:classNames(s.status,s.running),"aria-label":"Status running","aria-hidden":"true",...e})}function Br(e){const s=Or(e);return _jsx(Typography,{component:"span",className:classNames(s.status,s.aborted),"aria-label":"Status aborted","aria-hidden":"true",...e})}var pi=t(74600),Cn=t(15584);const fi=e=>(0,P.Z)({root:{fontWeight:e.typography.fontWeightBold,whiteSpace:"nowrap",paddingRight:e.spacing(4),border:"0",verticalAlign:"top"}}),gi={root:{border:"0",verticalAlign:"top"}},mi=e=>(0,P.Z)({root:{margin:e.spacing(0,0,-1,0)}}),Co=e=>(0,P.Z)({root:{padding:e.spacing(0,0,1,0)},random:{}}),vi=(0,An.Z)(fi,{name:"BackstageMetadataTableTitleCell"})(Cn.Z),yi=(0,An.Z)(gi,{name:"BackstageMetadataTableCell"})(Cn.Z),xi=({dense:e,children:s})=>_jsx(Table,{size:e?"small":"medium",children:_jsx(TableBody,{children:s})}),na=({title:e,children:s,...i})=>_jsxs(TableRow,{children:[e&&_jsx(vi,{children:e}),_jsx(yi,{colSpan:e?1:2,...i,children:s})]}),jo=(0,An.Z)(mi,{name:"BackstageMetadataTableList"})(({classes:e,children:s})=>(0,r.jsx)(Ct.Z,{disablePadding:!0,className:e.root,children:s})),Hs=(0,An.Z)(Co,{name:"BackstageMetadataTableListItem"})(({classes:e,children:s})=>(0,r.jsx)(Ke.Z,{className:e.root,children:s})),Gs=(0,P.Z)({root:{margin:"0 0",listStyleType:"none"}}),ss=e=>(0,P.Z)({root:{...Gs.root,paddingLeft:e.spacing(1)}}),Mr=(0,An.Z)(Gs,{name:"BackstageStructuredMetadataTableList"})(({classes:e,children:s})=>(0,r.jsx)(jo,{classes:e,children:s})),zr=(0,An.Z)(ss,{name:"BackstageStructuredMetadataTableNestedList"})(({classes:e,children:s})=>(0,r.jsx)(jo,{classes:e,children:s}));function Eo(e,s){const i=e.map((u,p)=>_jsx(MetadataListItem,{children:Is(u)},p));return s?_jsx(zr,{children:i}):_jsx(Mr,{children:i})}function Ks(e,s,i){const u=Object.keys(e).map(p=>{const m=Is(e[p],!0),E=i&&i.titleFormat?i.titleFormat(p):startCase(p);return _jsxs(MetadataListItem,{children:[_jsx(Typography,{variant:"body2",component:"span",children:`${E}: `}),m]},p)});return s?_jsx(zr,{children:u}):_jsx(Mr,{children:u})}function Is(e,s,i){return React.isValidElement(e)?_jsx(Fragment,{children:e}):typeof e=="object"&&!Array.isArray(e)?Ks(e,s,i):Array.isArray(e)?Eo(e,i):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:Is(e,s)}),To=({title:e,value:s,options:i})=>_jsx(MetadataTableItem,{title:i&&i.titleFormat?i.titleFormat(e):startCase(e),children:_jsx(Ao,{value:s,options:i})});function Io(e,s){return Object.keys(e).map(i=>_jsx(To,{title:i,value:e[i],options:s},i))}function bi(e){const{metadata:s,dense:i=!0,options:u}=e,p=Io(s,u||{});return _jsx(MetadataTable,{dense:i,children:p})}var yr=t(49429),Rs=t(86136),Ys=t(79784),Ro=t(19126),Ls=t.n(Ro);function Lo(e){return qs.stringify(e,{strictNullHandling:!0})}function Js(e){return qs.parse(e,{ignoreQueryPrefix:!0,strictNullHandling:!0})}function Qs(e,s){return Js(e)[s]}function Po(e,s,i){const u={...Js(e),[s]:i};return Lo(u)}function ra(e,s=250){const[i,u]=useSearchParams(),p=i.toString(),[m,E]=useState(Qs(p,e));return useEffect(()=>{const O=Qs(p,e);E(G=>isEqual(O,G)?G:O)},[p,E,e]),useDebouncedEffect(()=>{const O=Po(p,e,m);p!==O&&u(O,{replace:!0})},[u,m,p,e],s),[m,E]}const ko={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 Xs(){const s=(0,W.I_)().get(W.Ds),i=s==null?void 0:s.getOptionalConfig("app.support");if(!i)return ko;var u;return{url:i.getString("url"),items:i.getConfigArray("items").flatMap(p=>({title:p.getString("title"),icon:p.getOptionalString("icon"),links:((u=p.getOptionalConfigArray("links"))!==null&&u!==void 0?u:[]).flatMap(m=>({url:m.getString("url"),title:m.getString("title")}))}))}}var Oo=t(80079);function qn(e,s){const u=(0,W.qD)().getSystemIcon(e);return u?(0,r.jsx)(u,{...s}):(0,r.jsx)(Oo.Z,{...s})}function Bo(e){return qn("brokenImage",e)}function _s(e){return qn("catalog",e)}function Si(e){return qn("chat",e)}function wi(e){return qn("dashboard",e)}function Ci(e){return qn("docs",e)}function ji(e){return qn("email",e)}function sa(e){return qn("github",e)}function oa(e){return qn("group",e)}function xr(e){return qn("help",e)}function ia(e){return qn("user",e)}function aa(e){return qn("warning",e)}const $o=(0,c.Z)({popoverList:{minWidth:260,maxWidth:400}},{name:"BackstageSupportButton"}),Zo=({icon:e})=>{const s=(0,W.qD)();var i;const u=e&&(i=s.getSystemIcon(e))!==null&&i!==void 0?i:xr;return(0,r.jsx)(u,{})};var os;const Ei=({link:e})=>(0,r.jsx)(Xe,{to:e.url,children:(os=e.title)!==null&&os!==void 0?os:e.url}),Ai=({item:e})=>{var s;return(0,r.jsxs)(Ke.Z,{children:[(0,r.jsx)(Rs.Z,{children:(0,r.jsx)(Zo,{icon:e.icon})}),(0,r.jsx)(ht.Z,{primary:e.title,secondary:(s=e.links)===null||s===void 0?void 0:s.reduce((i,u,p)=>[...i,p>0&&(0,r.jsx)("br",{},p),(0,r.jsx)(Ei,{link:u},u.url)],[])})]})};function eo(e){const{title:s,items:i,children:u}=e,{items:p}=Xs(),[m,E]=(0,g.useState)(!1),[O,G]=(0,g.useState)(null),F=$o(),he=(0,Ie.Z)(Ce=>Ce.breakpoints.down("sm")),re=Ce=>{G(Ce.currentTarget),E(!0)},xe=()=>{E(!1)};return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(je.Z,{display:"flex",ml:1,children:he?(0,r.jsx)(ot.Z,{color:"primary",size:"small",onClick:re,"data-testid":"support-button",children:(0,r.jsx)(xr,{})}):(0,r.jsx)(X.Z,{"data-testid":"support-button","aria-label":"support",color:"primary",onClick:re,startIcon:(0,r.jsx)(xr,{}),children:"Support"})}),(0,r.jsxs)(Ys.ZP,{"data-testid":"support-button-popover",open:m,anchorEl:O,anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"},onClose:xe,children:[(0,r.jsxs)(Ct.Z,{className:F.popoverList,children:[s&&(0,r.jsx)(Ke.Z,{alignItems:"flex-start",children:(0,r.jsx)(z.Z,{variant:"subtitle1",children:s})}),g.Children.map(u,(Ce,He)=>(0,r.jsx)(Ke.Z,{alignItems:"flex-start",children:Ce},`child-${He}`)),(i!=null?i:p).map((Ce,He)=>(0,r.jsx)(Ai,{item:Ce},`item-${He}`))]}),(0,r.jsx)(yr.Z,{children:(0,r.jsx)(X.Z,{color:"primary",onClick:xe,children:"Close"})})]})]})}var is=t(18671),Ps=t(16060);const as=72,Do=24,No=18,ur={drawerWidthClosed:as,drawerWidthOpen:224,defaultOpenDelayMs:100,defaultCloseDelayMs:0,defaultFadeDuration:200,logoHeight:32,iconContainerWidth:as,iconSize:as-Do*2,iconPadding:Do,selectedIndicatorWidth:3,userBadgePadding:No,userBadgeDiameter:as-No*2,mobileSidebarHeight:56},Kn=e=>({...ur,...e,iconContainerWidth:ur.drawerWidthClosed,iconSize:ur.drawerWidthClosed-ur.iconPadding*2,userBadgeDiameter:ur.drawerWidthClosed-ur.userBadgePadding*2}),Fo={drawerWidthClosed:0,drawerWidthOpen:202,defaultOpenDelayMs:ur.defaultOpenDelayMs+200},Uo=e=>({...Fo,...e}),la="@backstage/core/sidebar-intro-dismissed",ir=(0,g.createContext)({sidebarConfig:ur,submenuConfig:Fo}),Mo=(0,g.createContext)({isHoveredOn:!1,setIsHoveredOn:()=>{}});var Ti=t(50023),Ii=t(4190),Ri=t(87685),Li=t(44882),ks=t(51837);const zo={isOpen:!1,setOpen:()=>{}},Wo=(0,g.createContext)(zo),Os=(0,ks.CT)("sidebar-open-state-context");function to(e){const{children:s,value:i}=e;return(0,r.jsx)(Wo.Provider,{value:i,children:(0,r.jsx)(Os.Provider,{value:(0,ks.EI)({1:i}),children:s})})}const Bs=()=>{const e=(0,g.useContext)(Os),s=(0,g.useContext)(Wo);if(e===void 0)return s||zo;const i=e.atVersion(1);if(i===void 0)throw new Error("No context found for version 1.");return i};var Vo=t(57998);const no={isPinned:!0,toggleSidebarPinState:()=>{},isMobile:!1},ro=(0,g.createContext)(no),so=(0,ks.CT)("sidebar-pin-state-context");function Ho(e){const{children:s,value:i}=e;return(0,r.jsx)(ro.Provider,{value:i,children:(0,r.jsx)(so.Provider,{value:(0,ks.EI)({1:i}),children:s})})}const Wr=()=>{const e=(0,g.useContext)(so),s=(0,g.useContext)(ro);if(e===void 0)return s||no;const i=e.atVersion(1);if(i===void 0)throw new Error("No context found for version 1.");return i},Go=(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"}})),Pi=e=>{const{to:s,label:i,icon:u,value:p}=e,{sidebarConfig:m}=(0,g.useContext)(ir),E=Go({sidebarConfig:m}),O=(0,T.TH)(),{selectedMenuItemIndex:G,setSelectedMenuItemIndex:F}=(0,g.useContext)(ao),he=(xe,Ce)=>{F(Ce===G?-1:Ce)},re=p===G&&G>=0||p!==G&&!(G>=0)&&s===O.pathname;return(0,r.jsx)(Vo.Z,{label:i,icon:u,component:Xe,to:s||O.pathname,onChange:he,value:p,selected:re,classes:E})},oo=e=>{const{children:s,to:i,label:u,icon:p,value:m}=e,{isMobile:E}=Wr();return E?(0,r.jsx)(Pi,{to:i,label:u,icon:p,value:m}):(0,r.jsx)(r.Fragment,{children:s})},io=(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`})})),ki=e=>(0,ie.orderBy)(e,({props:{priority:s}})=>Number.isInteger(s)?s:-1,"desc"),Ko=g.createElement(oo).type,Yo=({children:e,label:s="Menu",open:i,onClose:u})=>{const{sidebarConfig:p}=(0,g.useContext)(ir),m=io({sidebarConfig:p});return(0,r.jsxs)(Ii.ZP,{anchor:"bottom",open:i,onClose:u,ModalProps:{BackdropProps:{classes:{root:m.marginMobileSidebar}}},classes:{root:m.marginMobileSidebar,paperAnchorBottom:m.overlay},children:[(0,r.jsxs)(je.Z,{className:m.overlayHeader,children:[(0,r.jsx)(z.Z,{variant:"h3",children:s}),(0,r.jsx)(ot.Z,{onClick:u,classes:{root:m.overlayHeaderClose},children:(0,r.jsx)(Ri.Z,{})})]}),(0,r.jsx)(je.Z,{component:"nav",children:e})]})},ao=(0,g.createContext)({selectedMenuItemIndex:-1,setSelectedMenuItemIndex:()=>{}}),Jo=e=>{const{sidebarConfig:s}=(0,g.useContext)(ir),{children:i}=e,u=io({sidebarConfig:s}),p=(0,T.TH)(),[m,E]=(0,g.useState)(-1);(0,g.useEffect)(()=>{E(-1)},[p.pathname]);let O=(0,W.vJ)(i,F=>F.getElements().filter(he=>he.type===Ko));if(i)O.length?O=ki(O):O.push((0,r.jsx)(oo,{icon:(0,r.jsx)(Li.Z,{}),children:i},"default_menu"));else return null;const G=m>=0&&!O[m].props.to;return(0,r.jsx)(to,{value:{isOpen:!0,setOpen:()=>{}},children:(0,r.jsxs)(ao.Provider,{value:{selectedMenuItemIndex:m,setSelectedMenuItemIndex:E},children:[(0,r.jsx)(Yo,{label:O[m]&&O[m].props.label,open:G,onClose:()=>E(-1),children:O[m]&&O[m].props.children}),(0,r.jsx)(Ti.Z,{className:u.root,"data-testid":"mobile-sidebar-root",component:"nav",children:O})]})})};var ls;(function(e){e.SIDEBAR_PIN_STATE="sidebarPinState"})(ls||(ls={}));const lo={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))}},Qo=(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"}),co=(0,g.createContext)({content:{contentRef:void 0}});function nr(e){const[s,i]=(0,g.useState)(()=>lo.getSidebarPinState()),{sidebarConfig:u}=(0,g.useContext)(ir),p=(0,g.useRef)(null),m=(0,g.useMemo)(()=>({content:{contentRef:p}}),[p]);(0,g.useEffect)(()=>{lo.setSidebarPinState(s)},[s]);const E=(0,Ie.Z)(F=>F.breakpoints.down("xs"),{noSsr:!0}),O=()=>i(!s),G=Qo({isPinned:s,sidebarConfig:u});return(0,r.jsx)(Ho,{value:{isPinned:s,toggleSidebarPinState:O,isMobile:E},children:(0,r.jsx)(co.Provider,{value:m,children:(0,r.jsx)(je.Z,{className:G.root,children:e.children})})})}function uo(){const{content:e}=(0,g.useContext)(co);return{focusContent:(0,g.useCallback)(()=>{var i,u;e==null||(i=e.contentRef)===null||i===void 0||(u=i.current)===null||u===void 0||u.focus()},[e]),contentRef:e==null?void 0:e.contentRef}}const ho=(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 po=e=>{const{sidebarConfig:s}=(0,g.useContext)(ir),{openDelayMs:i=s.defaultOpenDelayMs,closeDelayMs:u=s.defaultCloseDelayMs,disableExpandOnHover:p,children:m}=e,E=ho({sidebarConfig:s}),O=(0,Ie.Z)(Gt=>Gt.breakpoints.down("md"),{noSsr:!0}),[G,F]=(0,g.useState)(Gn.Closed),he=(0,g.useRef)(),{isPinned:re,toggleSidebarPinState:xe}=Wr(),Ce=()=>{re||p||(he.current&&(clearTimeout(he.current),he.current=void 0),G!==Gn.Open&&!O&&(he.current=window.setTimeout(()=>{he.current=void 0,F(Gn.Open)},i),F(Gn.Idle)))},He=()=>{re||p||(he.current&&(clearTimeout(he.current),he.current=void 0),G===Gn.Idle?F(Gn.Closed):G===Gn.Open&&(he.current=window.setTimeout(()=>{he.current=void 0,F(Gn.Closed)},u)))},qe=G===Gn.Open&&!O||re,Pt=Gt=>{Gt?(F(Gn.Open),xe()):(F(Gn.Closed),xe())};return(0,r.jsxs)("nav",{style:{},"aria-label":"sidebar nav",children:[(0,r.jsx)(qo,{}),(0,r.jsx)(to,{value:{isOpen:qe,setOpen:Pt},children:(0,r.jsx)(je.Z,{className:E.root,"data-testid":"sidebar-root",onMouseEnter:p?()=>{}:Ce,onFocus:p?()=>{}:Ce,onMouseLeave:p?()=>{}:He,onBlur:p?()=>{}:He,children:(0,r.jsx)(je.Z,{className:fe()(E.drawer,{[E.drawerOpen]:qe}),children:m})})})]})},Xo=e=>{var s;const i=Kn((s=e.sidebarOptions)!==null&&s!==void 0?s:{});var u;const p=Uo((u=e.submenuOptions)!==null&&u!==void 0?u:{}),{children:m,disableExpandOnHover:E,openDelayMs:O,closeDelayMs:G}=e,{isMobile:F}=Wr();return F?(0,r.jsx)(Jo,{children:m}):(0,r.jsx)(ir.Provider,{value:{sidebarConfig:i,submenuConfig:p},children:(0,r.jsx)(po,{openDelayMs:O,closeDelayMs:G,disableExpandOnHover:E,children:m})})};function qo(){const{sidebarConfig:e}=(0,g.useContext)(ir),{focusContent:s,contentRef:i}=uo(),u=ho({sidebarConfig:e});return i!=null&&i.current?(0,r.jsx)(X.Z,{onClick:s,variant:"contained",className:fe()(u.visuallyHidden),children:"Skip to content"}):null}function fo(e,s){const i=new URLSearchParams(s.search).toString(),u=Ls().parse(i),p=new URLSearchParams(e.search).toString(),m=Ls().parse(p);return(0,ie.isEqual)(s.pathname,e.pathname)&&(0,ie.isMatch)(m,u)}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"}),ca=e=>{const{title:s,subtitle:i,to:u,icon:p,dropdownItems:m}=e,E=_o(),{setIsHoveredOn:O}=useContext(SidebarItemWithSubmenuContext),G=()=>{O(!1)},F=useResolvedPath(u!=null?u:""),he=useLocation();let re=isLocationMatch(he,F);const[xe,Ce]=useState(!1),He=()=>{Ce(!xe)};return m!==void 0?(m.some(qe=>{const Pt=resolvePath(qe.to);return re=isLocationMatch(he,Pt),re}),_jsxs(Box,{className:E.itemContainer,children:[_jsx(Tooltip,{title:s,enterDelay:500,enterNextDelay:500,children:_jsxs(Button,{role:"button",onClick:He,onTouchStart:qe=>qe.stopPropagation(),className:classnames(E.item,re?E.selected:void 0),children:[p&&_jsx(p,{fontSize:"small"}),_jsxs(Typography,{variant:"subtitle1",className:E.label,children:[s,_jsx("br",{}),i&&_jsx(Typography,{variant:"caption",className:E.subtitle,children:i})]}),xe?_jsx(ArrowDropUpIcon,{className:E.dropdownArrow}):_jsx(ArrowDropDownIcon,{className:E.dropdownArrow})]})}),m&&xe&&_jsx(Box,{className:E.dropdown,children:m.map((qe,Pt)=>_jsx(Tooltip,{title:qe.title,enterDelay:500,enterNextDelay:500,children:_jsx(Link,{to:qe.to,underline:"none",className:E.dropdownItem,onClick:G,onTouchStart:Gt=>Gt.stopPropagation(),children:_jsx(Typography,{className:E.textContent,children:qe.title})})},Pt))})]})):_jsx(Box,{className:E.itemContainer,children:_jsx(Tooltip,{title:s,enterDelay:500,enterNextDelay:500,children:_jsxs(Link,{to:u,underline:"none",className:classnames(E.item,re?E.selected:void 0),onClick:G,onTouchStart:qe=>qe.stopPropagation(),children:[p&&_jsx(p,{fontSize:"small"}),_jsxs(Typography,{variant:"subtitle1",className:E.label,children:[s,_jsx("br",{}),i&&_jsx(Typography,{variant:"caption",className:E.subtitle,children:i})]})]})})})};var $s;const a=(0,c.Z)(e=>({root:{zIndex:1e3,position:"relative",overflow:"visible",width:e.spacing(7)+1},drawer:s=>{var i;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:($s=(i=e.palette.navigation.submenu)===null||i===void 0?void 0:i.background)!==null&&$s!==void 0?$s:"#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"}),n=e=>{const{isOpen:s}=Bs(),{sidebarConfig:i,submenuConfig:u}=(0,g.useContext)(ir),p=s?i.drawerWidthOpen:i.drawerWidthClosed,m=a({left:p,submenuConfig:u}),{isHoveredOn:E}=(0,g.useContext)(Mo),[O,G]=(0,g.useState)(!1);return(0,g.useEffect)(()=>{G(E)},[E]),(0,r.jsxs)(je.Z,{className:fe()(m.drawer,{[m.drawerOpen]:O}),children:[(0,r.jsx)(z.Z,{variant:"h5",className:m.title,children:e.title}),e.children]})};var o=t(26739),l=t(76600),f=t(83543),R=t(59797),N=t(98989);const V=(0,c.Z)({iconContainer:{display:"flex",position:"relative",width:"100%"},arrow1:{right:"6px",position:"absolute"}}),ne=()=>{const e=V();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 ze=null;const Ze=(0,c.Z)({iconContainer:{display:"flex",position:"relative",width:"100%"},arrow1:{right:"6px",position:"absolute"}}),ut=()=>{const e=Ze();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 lt=null,bt,St;const Bt=e=>(0,c.Z)(s=>{var i,u;return{root:{color:s.palette.navigation.color,display:"flex",flexFlow:"row nowrap",alignItems:"center",height:48,cursor:"pointer"},buttonItem:{background:"none",border:"none",width:"100%",margin:0,padding:0,textAlign:"inherit",font:"inherit"},closed:{width:e.drawerWidthClosed,justifyContent:"center"},open:{[s.breakpoints.up("sm")]:{width:e.drawerWidthOpen}},highlightable:{"&:hover":{background:(bt=(i=s.palette.navigation.navItem)===null||i===void 0?void 0:i.hoverBackground)!==null&&bt!==void 0?bt:"#404040"}},highlighted:{background:(St=(u=s.palette.navigation.navItem)===null||u===void 0?void 0:u.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 jt(e){return(0,g.useMemo)(()=>Bt(e),[e])()}const jn=(e,s)=>(0,W.vJ)(e.props.children,i=>{let u=!1;return i.getElements().forEach(({props:{to:p,dropdownItems:m}})=>{if(!u){if(m!=null&&m.length){m.forEach(({to:E})=>u=u||fo(s,(0,Ps.i3)(E)));return}p&&(u=fo(s,(0,Ps.i3)(p)))}}),u},[s.pathname]);function Zn(e){return e.to===void 0}const ar=g.createElement(n).type,cs=g.forwardRef(function({to:s,end:i,style:u,className:p,activeStyle:m,caseSensitive:E,activeClassName:O="active","aria-current":G="page",...F},he){let{pathname:re}=(0,T.TH)(),{pathname:xe}=(0,T.WU)(s);E||(re=re.toLocaleLowerCase("en-US"),xe=xe.toLocaleLowerCase("en-US"));let Ce=re===xe;!Ce&&!i&&(Ce=re.startsWith(`${xe}/`));const He=Ce?G:void 0;return(0,r.jsx)(L.rU,{...F,to:s,ref:he,"aria-current":He,style:{...u,...Ce?m:void 0},className:fe()([p,Ce?O:void 0])})}),go=(0,g.forwardRef)((e,s)=>{const{icon:i,text:u,hasNotifications:p=!1,hasSubmenu:m=!1,disableHighlight:E=!1,onClick:O,children:G,className:F,...he}=e,{sidebarConfig:re}=(0,g.useContext)(ir),xe=jt(re),{isOpen:Ce}=Bs(),He=!Ce&&m?{display:"flex",marginLeft:"20px"}:{lineHeight:"0"},qe=(0,r.jsxs)(je.Z,{style:He,children:[(0,r.jsx)(i,{fontSize:"small"}),!Ce&&m?(0,r.jsx)(N.Z,{fontSize:"small"}):(0,r.jsx)(r.Fragment,{})]}),Pt=(0,r.jsx)(o.Z,{color:"secondary",variant:"dot",overlap:"circular",invisible:!p,className:fe()({[xe.closedItemIcon]:!Ce}),children:qe}),Gt=(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(je.Z,{"data-testid":"login-button",className:xe.iconContainer,children:Pt}),u&&(0,r.jsx)(z.Z,{variant:"subtitle2",className:xe.label,children:u}),(0,r.jsx)("div",{className:xe.secondaryAction,children:G})]}),tn=Ce?Gt:Pt,nn={onClick:O,className:fe()(F,xe.root,Ce?xe.open:xe.closed,Zn(e)&&xe.buttonItem,{[xe.highlightable]:!E})};return Zn(e)?(0,r.jsx)(X.Z,{role:"button","aria-label":u,...nn,ref:s,children:tn}):(0,r.jsx)(cs,{...nn,activeClassName:xe.selected,to:e.to?e.to:"",ref:s,"aria-label":u||e.to,...he,children:tn})}),ei=({children:e,...s})=>{const{sidebarConfig:i}=(0,g.useContext)(ir),u=jt(i),[p,m]=(0,g.useState)(!1),E=(0,T.TH)(),O=jn(e,E),G=(0,Ie.Z)(xe=>xe.breakpoints.down("sm")),F=()=>{m(!0)},he=()=>{m(!1)},re=()=>G?p?(0,r.jsx)(R.Z,{fontSize:"small",className:u.submenuArrow}):(0,r.jsx)(f.Z,{fontSize:"small",className:u.submenuArrow}):!p&&(0,r.jsx)(N.Z,{fontSize:"small",className:u.submenuArrow});return(0,r.jsx)(Mo.Provider,{value:{isHoveredOn:p,setIsHoveredOn:m},children:(0,r.jsxs)("div",{"data-testid":"item-with-submenu",onMouseLeave:he,onTouchStart:p?he:F,onMouseEnter:F,className:fe()(p&&u.highlighted),children:[(0,r.jsx)(go,{hasSubmenu:!0,className:O?u.selected:"",...s,children:re()}),p&&e]})})},ds=(0,g.forwardRef)((e,s)=>{const[i]=(0,W.vJ)(e.children,u=>u.getElements().filter(p=>p.type===ar));return i?(0,r.jsx)(ei,{...e,children:i}):(0,r.jsx)(go,{...e,ref:s})});function Oi(e){const{sidebarConfig:s}=useContext(SidebarConfigContext),[i,u]=useState(""),p=jt(s),m=e.icon?e.icon:SearchIcon,E=()=>{e.onSearch(i),u("")},O=re=>{re.key==="Enter"&&(re.preventDefault(),E())},G=re=>{u(re.target.value)},F=re=>{re.preventDefault(),re.stopPropagation()},he=re=>{E(),re.preventDefault()};return _jsx(Box,{className:p.searchRoot,children:_jsx(ds,{icon:m,to:e.to,onClick:he,disableHighlight:!0,children:_jsx(TextField,{placeholder:"Search",value:i,onClick:F,onChange:G,onKeyDown:O,className:p.searchContainer,InputProps:{disableUnderline:!0,className:p.searchField},inputProps:{className:p.searchFieldHTMLInput}})})})}const Vr=(0,l.Z)("div")({flex:1},{name:"BackstageSidebarSpace"}),zl=(0,l.Z)("div")({height:8},{name:"BackstageSidebarSpacer"}),da=(0,l.Z)("hr")(({theme:e})=>({height:1,width:"100%",background:"#383838",border:"none",margin:e.spacing(1.2,0)}),{name:"BackstageSidebarDivider"}),ua=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,l.Z)("div")(({theme:e})=>{const s=ua(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=jt(e),{isOpen:i,setOpen:u}=useSidebarOpenState();if(useMediaQuery(E=>E.breakpoints.down("md"),{noSsr:!0}))return null;const m=()=>{u(!i)};return _jsx(Button,{role:"button",onClick:m,className:s.expandButton,"aria-label":"Expand Sidebar","data-testid":"sidebar-expand-button",children:_jsx(Box,{className:s.arrows,children:i?_jsx(DoubleArrowLeft,{}):_jsx(DoubleArrowRight,{})})})},ha=(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 pa(e){const{sidebarConfig:s}=useContext(SidebarConfigContext),i=ha({sidebarConfig:s}),{text:u,onClose:p}=e,m=()=>p();return _jsxs(Box,{className:i.introCard,children:[_jsx(Typography,{variant:"subtitle2",children:u}),_jsx(Box,{className:i.introDismiss,children:_jsxs(IconButton,{onClick:m,className:i.introDismissLink,children:[_jsx(CloseIcon,{className:i.introDismissIcon}),_jsx(Typography,{component:"span",className:i.introDismissText,children:"Dismiss"})]})})]})}const Bi=e=>{const{text:s,onDismiss:i}=e,[u,p]=useState(!1),m=()=>{p(!0)};return _jsx(Collapse,{in:!u,onExited:i,children:_jsx(pa,{text:s,onClose:m})})},fa=null,ga="And your recently viewed plugins will pop up here!";function Hl(e){const{isOpen:s}=useSidebarOpenState(),i={starredItemsDismissed:!1,recentlyViewedItemsDismissed:!1},{value:u,set:p}=useLocalStorageValue(SIDEBAR_INTRO_LOCAL_STORAGE),{starredItemsDismissed:m,recentlyViewedItemsDismissed:E}=u!=null?u:{},O=()=>{p(F=>({...i,...F,starredItemsDismissed:!0}))},G=()=>{p(F=>({...i,...F,recentlyViewedItemsDismissed:!0}))};return s?_jsxs(_Fragment,{children:[!m&&_jsxs(_Fragment,{children:[_jsx(Bi,{text:fa,onDismiss:O}),_jsx(SidebarDivider,{})]}),!E&&_jsx(Bi,{text:ga,onDismiss:G})]}):null}const ma=(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 $i(e){const{className:s,stretch:i,noPadding:u,children:p,...m}=e,{contentRef:E}=uo(),O=ma();return(0,r.jsx)("article",{ref:E,tabIndex:-1,...m,className:fe()(O.root,s,{[O.stretch]:i,[O.noPadding]:u}),children:p})}var va=t(6487),ya=t(99152);const xa=(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:i,selectedIndex:u}=e,[p,m]=(0,g.useState)(u!=null?u:0),E=xa(),O=(0,g.useCallback)((G,F)=>{u===void 0&&m(F),i&&u!==F&&i(F)},[u,i]);return(0,g.useEffect)(()=>{u!==void 0&&m(u)},[u]),(0,r.jsx)(je.Z,{className:E.tabsWrapper,children:(0,r.jsx)(ya.Z,{selectionFollowsFocus:!0,indicatorColor:"primary",textColor:"inherit",variant:"scrollable",scrollButtons:"auto","aria-label":"scrollable auto tabs example",onChange:O,value:p,children:s.map((G,F)=>(0,g.createElement)(va.Z,{...G.tabProps,"data-testid":`header-tab-${F}`,label:G.label,key:G.id,value:F,className:E.defaultTab,classes:{selected:E.selected,root:E.tabRoot}}))})})}function ba(e){const s=(0,T.UO)(),u=e.map(({path:xe,children:Ce})=>({caseSensitive:!1,path:`${xe}/*`,element:Ce})).sort((xe,Ce)=>Ce.path.replace(/\/\*$/,"").localeCompare(xe.path.replace(/\/\*$/,"")));var p;const m=(p=(0,T.V$)(u))!==null&&p!==void 0?p:e[0].children;var E;let O=(E=s["*"])!==null&&E!==void 0?E:"";O.startsWith("/")||(O=`/${O}`);var G;const[F]=(G=(0,Ps.fp)(u,O))!==null&&G!==void 0?G:[],he=F?e.findIndex(xe=>`${xe.path}/*`===F.route.path):0;var re;return{index:he===-1?0:he,element:m,route:(re=e[he])!==null&&re!==void 0?re:e[0]}}function Di(e){const{routes:s}=e,i=(0,T.s0)(),{index:u,route:p,element:m}=ba(s),E=(0,g.useMemo)(()=>s.map(G=>({id:G.path,label:G.title,tabProps:G.tabProps})),[s]),O=G=>{let{path:F}=s[G];F=F.replace(/\/\*$/,""),F=F.replace(/^\//,""),i(F)};return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(Zi,{tabs:E,selectedIndex:u,onChange:O}),(0,r.jsxs)($i,{children:[(0,r.jsx)(is.q,{title:p.title}),m]})]})}const ti=()=>null;(0,W.R5)(ti,"core.gatherMountPoints",!0);function Ni(e){const s=(0,r.jsx)(ti,{path:"",title:"",children:(0,r.jsx)("div",{})}).type;return g.Children.toArray(e).flatMap(i=>{if(!(0,g.isValidElement)(i))return[];if(i.type===g.Fragment)return Ni(i.props.children);if(i.type!==s)throw new Error("Child of TabbedLayout must be an TabbedLayout.Route");const{path:u,title:p,children:m,tabProps:E}=i.props;return[{path:u,title:p,children:m,tabProps:E}]})}function Sa(e){const s=Ni(e.children);return(0,r.jsx)(Di,{routes:s})}Sa.Route=ti;const wa=(0,c.Z)(e=>({value:{marginBottom:e.spacing(.75)},subvalue:{color:e.palette.textSubtle,fontWeight:"normal"}}),{name:"BackstageSubvalueCell"});function Ca(e){const{value:s,subvalue:i}=e,u=wa();return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(je.Z,{className:u.value,children:s}),(0,r.jsx)(je.Z,{className:u.subvalue,children:i})]})}var mo=t(67222),ja=t(21070),Ea=t(90324),Aa=t(98281),Ta=t(48049),Fi=t(51209),Ui=t(33375),Ia=t(44233),Ra=t(27604),ni=t(36444),La=t(37971),Pa=t(59709),ka=t(17373),Oa=t(3702),Ba=t(93111);const $a=(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"}),Za=e=>{var s;const i=$a(),{onChangeFilters:u}=e,[p,m]=(0,g.useState)({...e.selectedFilters}),[E,O]=(0,g.useState)(!1),G=()=>{m({}),O(F=>!F)};return(0,g.useEffect)(()=>{u(p)},[p,u]),(0,r.jsxs)(je.Z,{className:i.root,children:[(0,r.jsxs)(je.Z,{className:i.header,children:[(0,r.jsx)(je.Z,{className:i.value,children:"Filters"}),(0,r.jsx)(X.Z,{color:"primary",onClick:G,children:"Clear all"})]}),(0,r.jsx)(je.Z,{className:i.filters,children:((s=e.filters)===null||s===void 0?void 0:s.length)&&e.filters.map(F=>(0,r.jsx)(Tn,{triggerReset:E,...F.element,selected:p[F.element.label],onChange:he=>m({...p,[F.element.label]:he})},F.element.label))})]})},Mi={Add:(0,g.forwardRef)((e,s)=>(0,r.jsx)(ja.Z,{...e,ref:s})),Check:(0,g.forwardRef)((e,s)=>(0,r.jsx)(Aa.Z,{...e,ref:s})),Clear:(0,g.forwardRef)((e,s)=>(0,r.jsx)(Ui.Z,{...e,ref:s})),Delete:(0,g.forwardRef)((e,s)=>(0,r.jsx)(Ia.Z,{...e,ref:s})),DetailPanel:(0,g.forwardRef)((e,s)=>(0,r.jsx)(Fi.Z,{...e,ref:s})),Edit:(0,g.forwardRef)((e,s)=>(0,r.jsx)(Ra.Z,{...e,ref:s})),Export:(0,g.forwardRef)((e,s)=>(0,r.jsx)(Oa.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)(La.Z,{...e,ref:s})),LastPage:(0,g.forwardRef)((e,s)=>(0,r.jsx)(Pa.Z,{...e,ref:s})),NextPage:(0,g.forwardRef)((e,s)=>(0,r.jsx)(Fi.Z,{...e,ref:s})),PreviousPage:(0,g.forwardRef)((e,s)=>(0,r.jsx)(Ta.Z,{...e,ref:s})),ResetSearch:(0,g.forwardRef)((e,s)=>(0,r.jsx)(Ui.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)(Ea.Z,{...e,ref:s})),ThirdStateCheck:(0,g.forwardRef)((e,s)=>(0,r.jsx)(ka.Z,{...e,ref:s})),ViewColumn:(0,g.forwardRef)((e,s)=>(0,r.jsx)(Ba.Z,{...e,ref:s}))};function zi(e,s){const i=s.split(".");let u=e[i[0]];for(let p=1;p<i.length;++p){if(u===void 0)return u;const m=i[p];u=u[m]}return u}const Da=(0,An.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"})(mo.W$),Wi=(0,An.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"})(mo.UW),Na=(0,c.Z)(e=>({root:{display:"flex",alignItems:"center",justifyContent:"space-between"},title:{fontWeight:e.typography.fontWeightBold,fontSize:18,whiteSpace:"nowrap"}}),{name:"BackstageTableFiltersContainer"}),Fa=(0,c.Z)(()=>({root:{display:"flex",alignItems:"start"}}),{name:"BackstageTable"});function Ua(e,s){return e.map(i=>{const u={};let p=i.cellStyle||{};if(i.highlight)if(u.color=s.palette.textContrast,typeof p=="object")p.fontWeight=s.typography.fontWeightBold;else{const m=p;p=(E,O,G)=>({...m(E,O,G),fontWeight:s.typography.fontWeightBold})}return{...i,headerStyle:u,cellStyle:p}})}function Ma(e,s){return(0,ie.transform)(e,(i,u,p)=>{(0,ie.isEqual)(u,s[p])||(i[p]=u)})}const Vi={search:"",filtersOpen:!1,filters:{}};function za(e){const{toolbarRef:s,setSearch:i,hasFilters:u,selectedFiltersLength:p,toggleFilters:m}=e,E=Na(),O=(0,g.useCallback)(G=>{e.onSearchChanged(G),i(G)},[e,i]);return u?(0,r.jsxs)(je.Z,{className:E.root,children:[(0,r.jsxs)(je.Z,{className:E.root,children:[(0,r.jsx)(ot.Z,{onClick:m,"aria-label":"filter list",children:(0,r.jsx)(ni.Z,{})}),(0,r.jsxs)(z.Z,{className:E.title,children:["Filters (",p,")"]})]}),(0,r.jsx)(Wi,{...e,ref:s,onSearchChanged:O})]}):(0,r.jsx)(Wi,{...e,ref:s,onSearchChanged:O})}function Hi(e){const{data:s,columns:i,options:u,title:p,subtitle:m,filters:E,initialState:O,emptyContent:G,onStateChange:F,components:he,...re}=e,xe=Fa(),Ce=(0,Ge.Z)(),He={...Vi,...O},[qe,Pt]=(0,g.useState)(He.filtersOpen),Gt=(0,g.useCallback)(()=>Pt(Dn=>!Dn),[Pt]),[tn,nn]=(0,g.useState)(0),[kt,Xt]=(0,g.useState)(s),[Kt,br]=(0,g.useState)(He.filters),Sr=Ua(i,Ce),[wr,Cr]=(0,g.useState)(He.search);(0,g.useEffect)(()=>{if(F){const Dn=Ma({search:wr,filtersOpen:qe,filters:Kt},Vi);F(Dn)}},[wr,qe,Kt,F]);const ai={headerStyle:{textTransform:"uppercase"}},$r=(0,g.useCallback)(Dn=>{var hr;return(hr=i.find(Hr=>Hr.title===Dn))===null||hr===void 0?void 0:hr.field},[i]);(0,g.useEffect)(()=>{if(typeof s=="function")return;if(!Kt){Xt(s);return}const Dn=Object.values(Kt);if(s&&Dn.flat().length){const hr=s.filter(Hr=>!!Object.entries(Kt).filter(([,Gr])=>!!Gr.length).every(([Gr,sn])=>{const gn=zi(Hr,$r(Gr));return Array.isArray(gn)&&Array.isArray(sn)?gn.some(hs=>sn.includes(hs)):Array.isArray(gn)?gn.includes(sn):Array.isArray(sn)?sn.includes(gn):gn===sn}));Xt(hr)}else Xt(s);nn(Dn.flat().length)},[s,Kt,$r]);const li=(Dn,hr)=>{const Hr=sn=>{const gn=new Set,hs=Kr=>{Kr!=null&&gn.add(Kr)};return hr&&hr.forEach(Kr=>{const Ds=zi(Kr,$r(sn));Array.isArray(Ds)?Ds.forEach(hs):hs(Ds)}),gn},Gr=sn=>({placeholder:"All results",label:sn.column,multiple:sn.type==="multiple-select",items:[...Hr(sn.column)].sort().map(gn=>({label:gn,value:gn}))});return Dn.map(sn=>({type:sn.type,element:Gr(sn)}))},Yt=!!(E!=null&&E.length),us=(0,g.useCallback)(Dn=>(0,r.jsx)(za,{setSearch:Cr,hasFilters:Yt,selectedFiltersLength:tn,toggleFilters:Gt,...Dn}),[Gt,Yt,tn,Cr]),yo=typeof s!="function"&&s.length===0,Zr=i.length,ci=(0,g.useCallback)(Dn=>G&&yo?(0,r.jsx)("tbody",{children:(0,r.jsx)("tr",{children:(0,r.jsx)("td",{colSpan:Zr,children:G})})}):(0,r.jsx)(mo.os,{...Dn}),[yo,G,Zr]);return(0,r.jsxs)(je.Z,{className:xe.root,children:[qe&&s&&typeof s!="function"&&(E==null?void 0:E.length)&&(0,r.jsx)(Za,{filters:li(E,s),selectedFilters:Kt,onChangeFilters:br}),(0,r.jsx)(mo.ZP,{components:{Header:Da,Toolbar:us,Body:ci,...he},options:{...ai,...u},columns:Sr,icons:Mi,title:(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(z.Z,{variant:"h5",component:"h2",children:p}),m&&(0,r.jsx)(z.Z,{color:"textSecondary",variant:"body1",children:m})]}),data:typeof s=="function"?s:kt,style:{width:"100%"},localization:{toolbar:{searchPlaceholder:"Filter",searchTooltip:"Filter"}},...re})]})}Hi.icons=Object.freeze(Mi);const Gl=e=>{const{children:s,value:i,index:u,...p}=e;return _jsx(Box,{role:"tabpanel",hidden:i!==u,"aria-labelledby":`scrollable-auto-tab-${u}`,...p,children:i===u&&_jsx(Box,{p:3,children:s})})},Wa=(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=Wa(e),{ariaLabel:i,onClick:u}=e;return _jsx(IconButton,{onClick:u,className:s.root,size:"small",disableRipple:!0,disableFocusRipple:!0,"aria-label":i,children:e.children})},Va=(e,s)=>s?e?"20px":"0":"40px",Ha=(0,c.Z)(e=>({root:{textTransform:"none",height:"64px",fontWeight:e.typography.fontWeightBold,fontSize:e.typography.pxToRem(13),color:e.palette.textSubtle,marginLeft:s=>Va(s.isFirstNav,s.isFirstIndex),width:"130px",minWidth:"130px","&:hover":{outline:"none",backgroundColor:"transparent",color:e.palette.textSubtle}}}),{name:"BackstageTab"}),Yl=e=>{const s=Ha(e),{isFirstNav:i,isFirstIndex:u,...p}=e;return _jsx(Tab,{classes:s,disableRipple:!0,...p})},Ga=(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=Ga(e);return _jsx(Tabs,{classes:s,...e,TabIndicatorProps:{children:_jsx("span",{})}})},Ka=(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,i=Ka(),[u,p]=useState([0,0]),[m,E]=useState(0),[O,G]=useState(0),[F,he]=useState([[]]),re=useRef(),{width:xe}=useWindowSize(),Ce=(tn,nn)=>{p([m,nn])},He=()=>{E(m-1)},qe=()=>{E(m+1)},Pt=()=>m+1<F.length;useEffect(()=>{const nn=m===0?1:2,kt=re.current.offsetWidth-20-nn*30,Xt=u[0]*O+u[1],Kt=Math.floor(kt/170);G(Kt),he(chunkArray(s,Kt)),p([Math.floor(Xt/Kt),Xt%Kt])},[xe,s]);const Gt=m===u[0]?u[1]:!1;return _jsxs(Box,{className:i.root,children:[_jsx(AppBar,{ref:re,className:i.appbar,position:"static",children:_jsx(Box,{children:_jsxs(StyledTabs,{value:Gt,onChange:Ce,selectionFollowsFocus:!0,children:[m!==0&&_jsx(StyledIcon,{onClick:He,ariaLabel:"navigate-before",children:_jsx(NavigateBeforeIcon,{})}),F[m].map((tn,nn)=>_jsx(StyledTab,{value:nn,isFirstIndex:nn===0,isFirstNav:m===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,{})})]})})}),Gt!==!1?F[m].map((tn,nn)=>_jsx(TabPanel,{value:nn,index:Gt,children:tn.content},nn)):_jsx(TabPanel,{value:u[1],index:u[1],children:F[u[0]][u[1]].content},"panel_outside_chunked_array")]})}var Xl=t(44311);function Ya(e,s){const i=e[e.length-1];if(!!i)return i>=.9?s.palette.status.ok:i>=.5?s.palette.status.warning:s.palette.status.error}function ql(e){const s=useTheme();if(!e.data)return null;var i;return _jsxs(Sparklines,{width:120,height:30,min:0,max:1,...e,children:[e.title&&_jsx("title",{children:e.title}),_jsx(SparklinesLine,{color:(i=e.color)!==null&&i!==void 0?i:Ya(e.data,s)})]})}const Ja=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"}),Qa=({title:e="Unknown page",className:s})=>(0,r.jsx)(z.Z,{variant:"h4",component:"h2",className:s,"data-testid":"header-title",children:e});function Xa(e){const{description:s,title:i,titleComponent:u=void 0,children:p,textAlign:m="left"}=e,E=Ja({textAlign:m})(),O=u||(0,r.jsx)(Qa,{title:i,className:E.title});return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(is.q,{title:i}),(0,r.jsxs)(je.Z,{className:E.container,children:[(0,r.jsxs)(je.Z,{className:E.leftItemsBox,children:[O,s&&(0,r.jsx)(z.Z,{className:E.description,variant:"body2",children:s})]}),(0,r.jsx)(je.Z,{className:E.rightItemsBox,children:p})]})]})}var qa=t.p+"static/mic-drop.fe3ef4d0..svg";const _a=(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"}),el=()=>{const e=_a();return(0,r.jsx)("img",{src:qa,className:e.micDrop,alt:"Girl dropping mic from her hands"})},tl=(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 nl(e){const{status:s,statusMessage:i,additionalInfo:u,supportUrl:p}=e,m=tl(),E=(0,T.s0)(),O=Xs();return(0,r.jsxs)(Oe.Z,{container:!0,spacing:0,className:m.container,children:[(0,r.jsxs)(Oe.Z,{item:!0,xs:12,sm:8,md:4,children:[(0,r.jsxs)(z.Z,{"data-testid":"error",variant:"body1",className:m.subtitle,children:["ERROR ",s,": ",i]}),(0,r.jsx)(z.Z,{variant:"body1",className:m.subtitle,children:u}),(0,r.jsx)(z.Z,{variant:"h2",className:m.title,children:"Looks like someone dropped the mic!"}),(0,r.jsxs)(z.Z,{variant:"h6",children:[(0,r.jsx)(Xe,{to:"#","data-testid":"go-back-link",onClick:()=>E(-1),children:"Go back"}),"... or please"," ",(0,r.jsx)(Xe,{to:p||O.url,children:"contact support"})," if you think this is a bug."]})]}),(0,r.jsx)(el,{})]})}var rl=t(16173);const sl=(0,An.Z)({root:{textDecoration:"underline",cursor:"pointer"}},{name:"BackstageBreadcrumbsClickableText"})(z.Z),ri=(0,An.Z)({root:{textDecoration:"underline",color:"inherit"}},{name:"BackstageBreadcrumbsStyledBox"})(je.Z);function ol(e){const{children:s,...i}=e,[u,p]=g.useState(null),m=g.Children.toArray(s),[E,O,...G]=m,F=G.length?G.pop():m[m.length-1],he=m.length>3,re=He=>{p(He.currentTarget)},xe=()=>{p(null)},Ce=Boolean(u);return(0,r.jsxs)(g.Fragment,{children:[(0,r.jsxs)(rl.Z,{"aria-label":"breadcrumb",...i,children:[m.length>1&&(0,r.jsx)(ri,{clone:!0,children:E}),m.length>2&&(0,r.jsx)(ri,{clone:!0,children:O}),he&&(0,r.jsx)(sl,{onClick:re,children:"..."}),(0,r.jsx)(je.Z,{style:{fontStyle:"italic"},children:F})]}),(0,r.jsx)(Ys.ZP,{open:Ce,anchorEl:u,onClose:xe,anchorOrigin:{vertical:"bottom",horizontal:"left"},transformOrigin:{vertical:"top",horizontal:"left"},children:(0,r.jsx)(Ct.Z,{children:G.map((He,qe)=>(0,r.jsx)(Ke.Z,{button:!0,children:(0,r.jsx)(ri,{clone:!0,children:He})},qe))})})]})}const il=(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"}),al=({type:e,typeLink:s,classes:i,pageTitle:u})=>e?s?(0,r.jsxs)(ol,{className:i.breadcrumb,children:[(0,r.jsx)(Xe,{to:s,children:e}),(0,r.jsx)(z.Z,{children:u})]}):(0,r.jsx)(z.Z,{className:i.type,children:e}):null,ll=({pageTitle:e,classes:s,tooltip:i})=>{const u=(0,r.jsx)(z.Z,{className:s.title,variant:"h1",children:e});return i?(0,r.jsx)(ct.ZP,{title:i,placement:"top-start",children:u}):u},cl=({classes:e,subtitle:s})=>s?typeof s!="string"?(0,r.jsx)(r.Fragment,{children:s}):(0,r.jsx)(z.Z,{className:e.subtitle,variant:"subtitle2",component:"span",children:s}):null;function Gi(e){const{children:s,pageTitleOverride:i,style:u,subtitle:p,title:m,tooltip:E,type:O,typeLink:G}=e,F=il(),re=(0,W.h_)(W.Ds).getOptionalString("app.title")||"Backstage",xe=i||m,Ce=m||i,He=`${xe} | %s | ${re}`,qe=`${xe} | ${re}`;return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(is.q,{titleTemplate:He,defaultTitle:qe}),(0,r.jsxs)("header",{style:u,className:F.header,children:[(0,r.jsxs)(je.Z,{className:F.leftItemsBox,children:[(0,r.jsx)(al,{classes:F,type:O,typeLink:G,pageTitle:Ce}),(0,r.jsx)(ll,{classes:F,pageTitle:Ce,tooltip:E}),(0,r.jsx)(cl,{classes:F,subtitle:p})]}),(0,r.jsx)(Oe.Z,{container:!0,className:F.rightItemsBox,spacing:4,children:s})]})]})}const dl=({label:e,secondaryLabel:s,icon:i,disabled:u=!1,onClick:p})=>_jsx(Fragment,{children:_jsxs(ListItem,{"data-testid":"header-action-item",disabled:u,button:!0,onClick:m=>{p&&p(m)},children:[i&&_jsx(ListItemIcon,{children:i}),_jsx(ListItemText,{primary:e,secondary:s})]})});function _l(e){const{actionItems:s}=e,[i,u]=React.useState(!1),p=React.useRef(null);return _jsxs(Fragment,{children:[_jsx(IconButton,{onClick:()=>u(!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:i,anchorEl:p.current,anchorOrigin:{horizontal:"right",vertical:"bottom"},transformOrigin:{horizontal:"right",vertical:"top"},onClose:()=>u(!1),children:_jsx(List,{children:s.map((m,E)=>_jsx(dl,{...m},`header-action-menu-${E}`))})})]})}const ul=(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"}),hl=({value:e,className:s})=>(0,r.jsx)(z.Z,{className:s,children:e});function pl(e){const{label:s,value:i,url:u}=e,p=ul(),m=(0,r.jsx)(hl,{className:p.value,value:i||"<Unknown>"});return(0,r.jsx)(Oe.Z,{item:!0,children:(0,r.jsxs)(z.Z,{component:"span",className:p.root,children:[(0,r.jsx)(z.Z,{className:p.label,children:s}),u?(0,r.jsx)(Xe,{to:u,children:m}):m]})})}const fl=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"}}),gl=(0,c.Z)(fl,{name:"BackstageItemCardHeader"});function ml(e){const{title:s,subtitle:i,children:u}=e,p=gl(e);return(0,r.jsxs)(je.Z,{className:p.root,children:[i&&(0,r.jsx)(z.Z,{variant:"subtitle2",component:"h3",children:i}),s&&(0,r.jsx)(z.Z,{variant:"h6",component:"h4",children:s}),u]})}function ec(e){const{description:s,tags:i,title:u,type:p,subtitle:m,label:E,onClick:O,href:G}=e;return _jsxs(Card,{children:[_jsx(CardMedia,{children:_jsx(ItemCardHeader,{title:u,subtitle:m||p})}),_jsxs(CardContent,{children:[i!=null&&i.length?_jsx(Box,{children:i.map((F,he)=>_jsx(Chip,{size:"small",label:F},he))}):null,s]}),_jsxs(CardActions,{children:[!G&&_jsx(Button,{to:"#",onClick:O,color:"primary",children:E}),G&&_jsx(Button,{to:G,color:"primary",children:E})]})]})}const vl=e=>(0,P.Z)({root:{display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(22em, 1fr))",gridAutoRows:"1fr",gridGap:e.spacing(2)}}),yl=(0,c.Z)(vl,{name:"BackstageItemCardGrid"});function xl(e){const{children:s,...i}=e,u=yl(i);return(0,r.jsx)(je.Z,{className:u.root,...i,children:s})}var bl=t(41547);const Sl=(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 Ki(e){const{themeId:s,children:i}=e,{isMobile:u}=Wr(),p=Sl({isMobile:u});return(0,r.jsx)(bl.Z,{theme:m=>({...m,page:m.getPageTheme({themeId:s})}),children:(0,r.jsx)("main",{className:p.root,children:i})})}function wl(e){const{themeId:s,children:i,...u}=e;return(0,r.jsxs)(Ki,{themeId:s,children:[(0,r.jsx)(Gi,{...u}),i]})}var Yn=t(30195);const tc=Yn.z.object({providerInfo:Yn.z.object({}).catchall(Yn.z.unknown()).optional(),profile:Yn.z.object({email:Yn.z.string().optional(),displayName:Yn.z.string().optional(),picture:Yn.z.string().optional()}),backstageIdentity:Yn.z.object({token:Yn.z.string(),identity:Yn.z.object({type:Yn.z.literal("user"),userEntityRef:Yn.z.string(),ownershipEntityRefs:Yn.z.array(Yn.z.string())})})}),Yi={defaultTokenExpiryMillis:5*60*1e3,tokenExpiryMarginMillis:5*60*1e3};function Cl(e){const s=new Date(Date.now()+Yi.defaultTokenExpiryMillis);if(!e)return s;const[i,u,p]=e.split("."),m=JSON.parse(window.atob(u));return typeof m.exp!="number"?s:new Date(m.exp*1e3-Yi.tokenExpiryMarginMillis)}class nc{async start(){await this.getSessionAsync()}getUserId(){const{backstageIdentity:s}=this.getSessionSync(),i=s.identity.userEntityRef,u=/^([^:/]+:)?([^:/]+\/)?([^:/]+)$/.exec(i);if(!u)throw new TypeError(`Invalid user entity reference "${i}"`);return u[3]}async getIdToken(){return(await this.getSessionAsync()).backstageIdentity.token}getProfile(){return this.getSessionSync().profile}async getProfileInfo(){return(await this.getSessionAsync()).profile}async getBackstageIdentity(){return(await this.getSessionAsync()).backstageIdentity.identity}async getCredentials(){return{token:(await this.getSessionAsync()).backstageIdentity.token}}async signOut(){this.abortController.abort()}getSessionSync(){if(this.state.type==="active")return this.state.session;if(this.state.type==="fetching"&&this.state.previous)return this.state.previous;throw new Error("No session available. Try reloading your browser page.")}async getSessionAsync(){if(this.state.type==="fetching")return this.state.promise;if(this.state.type==="active"&&new Date<this.state.expiresAt)return this.state.session;const s=this.state.type==="active"?this.state.session:void 0,i=this.fetchSession().then(u=>(this.state={type:"active",session:u,expiresAt:Cl(u.backstageIdentity.token)},u),u=>{throw this.state={type:"failed",error:u},u});return this.state={type:"fetching",promise:i,previous:s},i}async fetchSession(){const s=await this.options.discoveryApi.getBaseUrl("auth"),i=typeof this.options.headers=="function"?await this.options.headers():this.options.headers,u=new Headers(i);u.set("X-Requested-With","XMLHttpRequest");const p=await fetch(`${s}/${this.options.provider}/refresh`,{signal:this.abortController.signal,headers:u,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:i,error:u},{execute:p}]=useAsync(async()=>{const m=new ProxiedSignInIdentity({provider:e.provider,discoveryApi:s,headers:e.headers});await m.start(),e.onSignInSuccess(m)});return useMountEffect(p),i==="loading"?_jsx(Progress,{}):u?_jsx(ErrorPanel,{title:"You do not appear to be signed in. Please try reloading the browser page.",error:u}):null},jl=(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=jl();return(0,r.jsx)(Oe.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 El(e){const[s,i,u]=e.split(".");return JSON.parse(window.atob(i))}class ii{getUserId(){return this.result.userId}static fromResult(s){return new ii(s)}async getIdToken(){var s,i;return(i=(s=this.result).getIdToken)===null||i===void 0?void 0:i.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:i,ent:u}=El(s);return{type:"user",userEntityRef:i,ownershipEntityRefs:u!=null?u:[]}}async getCredentials(){var s,i;return{token:await((i=(s=this.result).getIdToken)===null||i===void 0?void 0:i.call(s))}}async signOut(){var s,i;return(i=(s=this.result).signOut)===null||i===void 0?void 0:i.call(s)}constructor(s){this.result=s}}class Zs{static createGuest(){return new oi}static fromLegacy(s){return ii.fromResult(s)}static create(s){return new Zs(s.identity,s.authApi,s.profile)}getUserId(){const s=this.identity.userEntityRef,i=/^([^:/]+:)?([^:/]+\/)?([^:/]+)$/.exec(s);if(!i)throw new TypeError(`Invalid user entity reference "${s}"`);return i[3]}async getIdToken(){return(await this.authApi.getBackstageIdentity()).token}getProfile(){if(!this.profile)throw new Error("The identity API does not implement synchronous profile fetching, use getProfileInfo() instead");return this.profile}async getProfileInfo(){if(this.profilePromise)return await this.profilePromise;try{return this.profilePromise=this.authApi.getProfile(),await this.profilePromise}catch(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,i,u){this.identity=s,this.authApi=i,this.profile=u}}const Al={Component:({config:e,onSignInSuccess:s})=>{const{apiRef:i,title:u,message:p}=e,m=(0,W.h_)(i),E=(0,W.h_)(W.VE),O=async()=>{try{const G=await m.getBackstageIdentity({instantPopup:!0});if(!G)throw new Error(`The ${u} provider is not configured to support sign-in`);const F=await m.getProfile();s(Zs.create({identity:G.identity,profile:F,authApi:m}))}catch(G){E.post(new gs.SP("Login failed",G))}};return(0,r.jsx)(si,{children:(0,r.jsx)(Rr,{variant:"fullHeight",title:u,actions:(0,r.jsx)(X.Z,{color:"primary",variant:"outlined",onClick:O,children:"Sign In"}),children:(0,r.jsx)(z.Z,{variant:"body1",children:p})})})},loader:async(e,s)=>{const i=e.get(s),u=await i.getBackstageIdentity({optional:!0});if(!u)return;const p=await i.getProfile();return Zs.create({identity:u.identity,profile:p,authApi:i})}},Tl={Component:({onSignInSuccess:e})=>(0,r.jsx)(si,{children:(0,r.jsx)(Rr,{title:"Guest",variant:"fullHeight",actions:(0,r.jsx)(X.Z,{color:"primary",variant:"outlined",onClick:()=>e(new oi),children:"Enter"}),children:(0,r.jsxs)(z.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 Il=t(63955),Ji=t(86619),Qi=t(74828),Rl=t(45455),Ll=t.n(Rl);const Pl=/^[a-z0-9_\-]+\.[a-z0-9_\-]+\.[a-z0-9_\-]+$/i,kl=(0,c.Z)(e=>({form:{display:"flex",flexFlow:"column nowrap"},button:{alignSelf:"center",marginTop:e.spacing(2)}}),{name:"BackstageCustomProvider"}),Xi=e=>{const{ref:s,...i}=e;return{inputRef:s,...i}},Ol={Component:({onSignInSuccess:e})=>{const s=kl(),{register:i,handleSubmit:u,formState:p}=(0,Il.cI)({mode:"onChange"}),{errors:m}=p,E=({userId:O})=>{e(Zs.fromLegacy({userId:O,profile:{email:`${O}@example.com`}}))};return(0,r.jsx)(si,{children:(0,r.jsxs)(Rr,{title:"Custom User",variant:"fullHeight",children:[(0,r.jsxs)(z.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:u(E),children:[(0,r.jsxs)(Se.Z,{children:[(0,r.jsx)(Ji.Z,{...Xi(i("userId",{required:!0})),label:"User ID",margin:"normal",error:Boolean(m.userId)}),m.userId&&(0,r.jsx)(Qi.Z,{error:!0,children:m.userId.message})]}),(0,r.jsxs)(Se.Z,{children:[(0,r.jsx)(Ji.Z,{...Xi(i("idToken",{required:!1,validate:O=>!O||Pl.test(O)||"Token is not a valid OpenID Connect JWT Token"})),label:"ID Token (optional)",margin:"normal",autoComplete:"off",error:Boolean(m.idToken)}),m.idToken&&(0,r.jsx)(Qi.Z,{error:!0,children:m.idToken.message})]}),(0,r.jsx)(X.Z,{type:"submit",color:"primary",variant:"outlined",className:s.button,disabled:!(p!=null&&p.isDirty)||!Ll()(m),children:"Continue"})]})]})})},loader:async()=>{}},vo="@backstage/core:SignInPage:provider",qi={guest:Tl,custom:Ol,common:Al};function _i(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((i,u)=>{if(typeof u=="string")return _i(u,i),i[u]={components:qi[u],id:u},i;const{id:p}=u;return _i(p,i),i[p]={components:qi.common,id:p,config:u},i},{})}const uc=(e,s)=>{const i=useApi(errorApiRef),u=useApiHolder(),[p,m]=useState(!0),E=useCallback(G=>{s(IdentityApiSignOutProxy.from({identityApi:G,signOut:async()=>{var F;localStorage.removeItem(vo),await((F=G.signOut)===null||F===void 0?void 0:F.call(G))}}))},[s]);useLayoutEffect(()=>{var G;if(!p)return;const F=localStorage.getItem(vo);if(F===null){m(!1);return}const he=e[F];if(!he){m(!1);return}let re=!1;return he.components.loader(u,(G=he.config)===null||G===void 0?void 0:G.apiRef).then(xe=>{re||(xe?E(xe):m(!1))}).catch(xe=>{re||(localStorage.removeItem(vo),i.post(xe),m(!1))}),()=>{re=!0}},[p,i,s,u,e,E]);const O=useMemo(()=>Object.keys(e).map(G=>{const F=e[G],{Component:he}=F.components,re=xe=>{localStorage.setItem(vo,F.id),E(xe)};return _jsx(he,{config:F.config,onSignInSuccess:re},F.id)}),[e,E]);return[p,O]},Bl=({onSignInSuccess:e,providers:s=[],title:i,align:u="left"})=>{const p=useApi(configApiRef),m=useStyles(),E=getSignInProviders(s),[O,G]=useSignInProviders(E,e);return O?_jsx(Progress,{}):_jsxs(Page,{themeId:"home",children:[_jsx(Header,{title:p.getString("app.title")}),_jsxs(Content,{children:[i&&_jsx(ContentHeader,{title:i,textAlign:u}),_jsx(Grid,{container:!0,justifyContent:u==="center"?u:"flex-start",spacing:2,component:"ul",classes:m,children:G})]})]})},$l=({provider:e,auto:s,onSignInSuccess:i})=>{const u=useStyles(),p=useApi(e.apiRef),m=useApi(configApiRef),[E,O]=useState(),[G,F]=useState(!1),he=async({checkExisting:re,showPopup:xe})=>{try{let Ce;if(re&&(Ce=await p.getBackstageIdentity({optional:!0})),!Ce&&(xe||s)&&(F(!0),Ce=await p.getBackstageIdentity({instantPopup:!0}),!Ce))throw new Error(`The ${e.title} provider is not configured to support sign-in`);if(!Ce){F(!0);return}const He=await p.getProfile();i(UserIdentity.create({identity:Ce.identity,authApi:p,profile:He}))}catch(Ce){O(Ce),F(!0)}};return useMountEffect(()=>he({checkExisting:!0})),G?_jsxs(Page,{themeId:"home",children:[_jsx(Header,{title:m.getString("app.title")}),_jsx(Content,{children:_jsx(Grid,{container:!0,justifyContent:"center",spacing:2,component:"ul",classes:u,children:_jsx(GridItem,{children:_jsxs(InfoCard,{variant:"fullHeight",title:e.title,actions:_jsx(Button,{color:"primary",variant:"outlined",onClick:()=>{he({showPopup:!0})},children:"Sign In"}),children:[_jsx(Typography,{variant:"body1",children:e.message}),E&&E.name!=="PopupRejectedError"&&_jsx(Typography,{variant:"body1",color:"error",children:E.message})]})})})})]}):_jsx(Progress,{})};function hc(e){return"provider"in e?_jsx($l,{...e}):_jsx(Bl,{...e})}const Zl=(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"}),Dl=(0,An.Z)(e=>({root:{padding:e.spacing(2,2,2,2.5),display:"inline-block"},title:{fontWeight:700},subheader:{paddingTop:e.spacing(1)}}),{name:"BackstageTabbedCardBoldHeader"})(ns.Z);function pc(e){const{slackChannel:s,errorBoundaryProps:i,children:u,title:p,deepLink:m,value:E,onChange:O}=e,G=Zl(),[F,he]=useState(0),re=O||((He,qe)=>he(qe));let xe;E?React.Children.map(u,He=>{if(React.isValidElement(He)&&(He==null?void 0:He.props.value)===E){var qe;xe=He==null||(qe=He.props)===null||qe===void 0?void 0:qe.children}}):React.Children.map(u,(He,qe)=>{React.isValidElement(He)&&qe===F&&(xe=He==null?void 0:He.props.children)});const Ce=i||(s?{slackChannel:s}:{});return _jsx(Card,{children:_jsxs(ErrorBoundary,{...Ce,children:[p&&_jsx(Dl,{title:p}),_jsx(Tabs,{selectionFollowsFocus:!0,classes:G,value:E||F,onChange:re,children:u}),_jsx(Divider,{}),_jsx(CardContent,{children:xe}),m&&_jsx(BottomLink,{...m})]})})}const Nl=(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,...i}=e,u=Nl();return _jsx(Tab,{disableRipple:!0,classes:u,...i})}},25248:function(Rt,Me,t){"use strict";t.d(Me,{fC:function(){return b},CL:function(){return je},sM:function(){return _},$v:function(){return Te},v_:function(){return Qe},hg:function(){return Ye},uB:function(){return q},R5:function(){return Zt},bq:function(){return S},Ds:function(){return Xe},ni:function(){return z},T0:function(){return M},CO:function(){return zn},x8:function(){return En},rx:function(){return xn},YO:function(){return hn},P4:function(){return Mn},NT:function(){return qt},NW:function(){return Ve},VE:function(){return ft},W0:function(){return Ge},gP:function(){return st},IY:function(){return dt},F4:function(){return ie},ux:function(){return L},Kp:function(){return fe},$4:function(){return gt},p_:function(){return Z},ZM:function(){return rt},D:function(){return T},gW:function(){return A},E6:function(){return ot},z$:function(){return Lt},h_:function(){return te},I_:function(){return P},qD:function(){return Le},vJ:function(){return Ln},yx:function(){return Ie},tg:function(){return mn},Oi:function(){return un}});var h=t(52322),r=t(51837),W=t(2784);const B=(0,r.CT)("analytics-context"),g=()=>{const ge=(0,W.useContext)(B);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:Ee}=ge,_e={...g(),...ee},wt=(0,r.EI)({1:_e});return(0,h.jsx)(B.Provider,{value:wt,children:Ee})};function c(ge,ee){const Ee=Ne=>_jsx(b,{attributes:ee,children:_jsx(ge,{...Ne})});return Ee.displayName=`WithAnalyticsContext(${ge.displayName||ge.name||"Component"})`,Ee}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 Ee=P().get(ge);if(!Ee)throw new Error(`No implementation available for ${ge}`);return Ee}function Q(ge){return function(Ee){const Ne=wt=>{const ae=P(),k={};for(const ce in ge)if(ge.hasOwnProperty(ce)){const Oe=ge[ce],D=ae.get(Oe);if(!D)throw new Error(`No implementation available for ${Oe}`);k[ce]=D}return _jsx(Ee,{...wt,...k})},_e=Ee.displayName||Ee.name||"Component";return Ne.displayName=`withApis(${_e})`,Ne}}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(Ne=>Ne.split("-")).every(Ne=>Ne.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 M(ge){return new X(ge)}function z(ge,ee){return"id"in ge?{api:ge,deps:{},factory:()=>ee}:ge}var _;(function(ge){ge.SignedIn="SignedIn",ge.SignedOut="SignedOut"})(_||(_={}));const fe=M({id:"core.auth.google"}),ie=M({id:"core.auth.github"}),T=M({id:"core.auth.okta"}),L=M({id:"core.auth.gitlab"}),Z=M({id:"core.auth.microsoft"}),A=M({id:"core.auth.onelogin"}),S=M({id:"core.auth.bitbucket"}),q=M({id:"core.auth.atlassian"}),Te=M({id:"core.alert"}),Qe=M({id:"core.analytics"}),Ye=M({id:"core.apptheme"}),Xe=M({id:"core.config"}),Ve=M({id:"core.discovery"}),ft=M({id:"core.error"});var je;(function(ge){ge[ge.None=0]="None",ge[ge.Active=1]="Active"})(je||(je={}));const Ge=M({id:"core.featureflags"}),st=M({id:"core.fetch"}),gt=M({id:"core.identity"}),rt=M({id:"core.oauthrequest"}),ot=M({id:"core.storage"});class ct{setContext(ee){this.context=ee}captureEvent(ee,Ee,{value:Ne,attributes:_e}={}){try{this.analyticsApi.captureEvent({action:ee,subject:Ee,value:Ne,attributes:_e,context:this.context})}catch(wt){console.warn("Error during analytics event capture. %o",wt)}}constructor(ee,Ee={routeRef:"unknown",pluginId:"root",extension:"App"}){this.analyticsApi=ee,this.context=Ee}}function yt(){try{return te(Qe)}catch{return{captureEvent:()=>{}}}}function Lt(){const ge=(0,W.useRef)(null),ee=g(),Ee=yt();function Ne(){return ge.current===null&&(ge.current=new ct(Ee)),ge.current}const _e=Ne();return _e.setContext(ee),_e}const We="plugin-context",se=ge=>{const{children:ee,plugin:Ee}=ge,{Provider:Ne}=(0,r.CT)(We);return(0,h.jsx)(Ne,{value:(0,r.EI)({1:{plugin:Ee}}),children:ee})};function Ie(){const ge=(0,r.Vt)(We);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 Le=()=>{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),mt="__backstage_data";function Zt(ge,ee,Ee){const Ne=ge;var _e;let wt=(_e=Ne[mt])!==null&&_e!==void 0?_e:tt.get(ge);if(wt||(wt={map:new Map},Object.defineProperty(Ne,mt,{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,Ee)}function dt(ge,ee){if(!ge)return;const Ee=ge.type;if(!Ee)return;var Ne;const _e=(Ne=Ee[mt])!==null&&Ne!==void 0?Ne:tt.get(Ee);if(!!_e)return _e.map.get(ee)}const Et=(0,r.uW)("route-ref-type",()=>Symbol("route-ref-type"));let At=Et;class Ot{get title(){return this.id}toString(){return`routeRef{type=absolute,id=${this.id}}`}constructor(ee,Ee){this.id=ee,this.params=Ee,this[At]="absolute"}}function qt(ge){var ee;return new Ot(ge.id,(ee=ge.params)!==null&&ee!==void 0?ee:[])}const Vt=/^\w+$/;let Ht=null;class Jt{toString(){return`routeRef{type=sub,id=${this.id}}`}constructor(ee,Ee,Ne,_e){this.id=ee,this.path=Ee,this.parent=Ne,this.params=_e,this[Ht]="sub"}}function dn(ge){const{id:ee,path:Ee,parent:Ne}=ge,_e=Ee.split("/").filter(k=>k.startsWith(":")).map(k=>k.substring(1)),wt=[...Ne.params,..._e];if(Ne.params.some(k=>_e.includes(k)))throw new Error("SubRouteRef may not have params that overlap with its parent");if(!Ee.startsWith("/"))throw new Error(`SubRouteRef path must start with '/', got '${Ee}'`);if(Ee.endsWith("/"))throw new Error(`SubRouteRef path must not end with '/', got '${Ee}'`);for(const k of _e)if(!Vt.test(k))throw new Error(`SubRouteRef path has invalid param, got '${k}'`);return new Jt(ee,Ee,Ne,wt)}let an=Et;class Fn{toString(){return`routeRef{type=external,id=${this.id}}`}constructor(ee,Ee,Ne){this.id=ee,this.params=Ee,this.optional=Ne,this[an]="external"}}function En(ge){var ee;return new Fn(ge.id,(ee=ge.params)!==null&&ee!==void 0?ee:[],Boolean(ge.optional))}var Un=t(79635);function mn(ge){const{pathname:ee}=(0,Un.TH)(),Ee=(0,r.Vt)("routing-context");if(!Ee)throw new Error("Routing context is not available");const Ne=Ee.atVersion(1),_e=(0,W.useMemo)(()=>Ne&&Ne.resolve(ge,{pathname:ee}),[Ne,ge,ee]);if(!Ee)throw new Error("useRouteRef used outside of routing context");if(!Ne)throw new Error("RoutingContext v1 not available");const wt="optional"in ge&&ge.optional;if(!_e&&!wt)throw new Error(`No path for ${ge}`);return _e}function un(ge){return(0,Un.UO)()}class Qt extends W.Component{static getDerivedStateFromError(ee){return{error:ee}}render(){const{error:ee}=this.state,{app:Ee,plugin:Ne}=this.props,{ErrorBoundaryFallback:_e}=Ee.getComponents();return ee?(0,h.jsx)(_e,{error:ee,resetError:this.handleErrorReset,plugin:Ne}):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:Ee,name:Ne}=ge;return hn({component:{lazy:()=>ee().then(_e=>{const wt=k=>{try{mn(Ee)}catch(ce){if(typeof ce=="object"&&ce!==null){const{message:Oe}=ce;if(typeof Oe=="string"&&Oe.startsWith("No path for "))throw new Error(`Routable extension component with mount point ${Ee} 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 ce}return(0,h.jsx)(_e,{...k})},ae=Ne||_e.displayName||_e.name||"LazyComponent";return wt.displayName=`RoutableExtension(${ae})`,wt},_e=>ae=>{const k=Le(),{BootErrorPage:ce}=k.getComponents();return(0,h.jsx)(ce,{step:"load-chunk",error:_e})})},data:{"core.mountPoint":Ee},name:Ne})}function zn(ge){const{component:ee,name:Ee}=ge;return hn({component:ee,name:Ee})}function hn(ge){const{data:ee={},name:Ee}=ge;Ee||console.warn("Declaring extensions without name is DEPRECATED. Make sure that all usages of createReactExtension, createComponentExtension and createRoutableExtension provide a name.");let Ne;if("lazy"in ge.component){const wt=ge.component.lazy;Ne=(0,W.lazy)(()=>wt().then(ae=>({default:ae})))}else Ne=ge.component.sync;const _e=Ee||Ne.displayName||Ne.name||"Component";return{expose(wt){const ae=k=>{const ce=Le(),{Progress:Oe}=ce.getComponents(),D=ee==null?void 0:ee["core.mountPoint"];return(0,h.jsx)(W.Suspense,{fallback:(0,h.jsx)(Oe,{}),children:(0,h.jsx)(Qt,{app:ce,plugin:wt,children:(0,h.jsx)(b,{attributes:{pluginId:wt.getId(),...Ee&&{extension:Ee},...D&&{routeRef:D.id}},children:(0,h.jsx)(se,{plugin:wt,children:(0,h.jsx)(Ne,{...k})})})})})};Zt(ae,"core.plugin",wt);for(const[k,ce]of Object.entries(ee))Zt(ae,k,ce);return ae.displayName=`Extension(${_e})`,ae}}}function vn(ge,ee,Ee,Ne){return W.Children.toArray(ge).flatMap(_e=>{if(!(0,W.isValidElement)(_e))return[];if(_e.type===W.Fragment)return vn(_e.props.children,ee,Ee,Ne);if(dt(_e,"core.featureFlagged")){const wt=_e.props;return("with"in wt?ee.isActive(wt.with):!ee.isActive(wt.without))?vn(_e.props.children,ee,Ee,Ne):[]}if(Ee===void 0||Ee(_e))return[_e];if(Ne)throw new Error(Ne);return vn(_e.props.children,ee,Ee,Ne)})}class yn{selectByComponentData(ee){const Ee=vn(this.node,this.featureFlagsApi,Ne=>dt(Ne,ee.key)!==void 0,ee.withStrictError);return new yn(Ee,this.featureFlagsApi)}findComponentData(ee){return vn(this.node,this.featureFlagsApi,Ne=>dt(Ne,ee.key)!==void 0).map(Ne=>dt(Ne,ee.key)).filter(Ne=>Ne!==void 0)}getElements(){return vn(this.node,this.featureFlagsApi)}constructor(ee,Ee){this.node=ee,this.featureFlagsApi=Ee}}function Ln(ge,ee,Ee=[]){const Ne=te(Ge),_e=new yn(ge,Ne);return(0,W.useMemo)(()=>ee(_e),[ge,...Ee])}class Pn{getId(){return this.config.id}getApis(){var ee;return(ee=this.config.apis)!==null&&ee!==void 0?ee:[]}getFeatureFlags(){var ee,Ee;return(Ee=(ee=this.config.featureFlags)===null||ee===void 0?void 0:ee.slice())!==null&&Ee!==void 0?Ee:[]}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 xn(ge){return new Pn(ge)}},23054:function(Rt,Me,t){"use strict";t.d(Me,{SP:function(){return _},dR:function(){return X},VL:function(){return ie},BD:function(){return r}});function h(T){if(typeof T!="object"||T===null||Array.isArray(T))return!1;const L=T;return!(typeof L.name!="string"||L.name===""||typeof L.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 L=T;if(typeof L.name!="string"||L.name==="")throw new Error(`Encountered error object without a name, got '${T}'`);if(typeof L.message!="string")throw new Error(`Encountered error object without a message, got '${T}'`)}var W=t(24852);function B(T,L){const A={name:"Unknown",message:"<no reason given>",...serializeErrorInternal(T)};return L!=null&&L.includeStack||delete A.stack,A}function g(T){const L=(0,W.deserializeError)(T);return T.stack||(L.stack=void 0),L}function b(T){if(h(T)){const L=String(T);return L!=="[object Object]"?L:`${T.name}: ${T.message}`}return`unknown error '${T}'`}class c extends Error{constructor(L,Z){var A;let S=L;if(Z!==void 0){const q=b(Z);S?S+=`; caused by ${q}`:S=`caused by ${q}`}super(S),(A=Error.captureStackTrace)===null||A===void 0||A.call(Error,this,this.constructor),this.name=this.constructor.name,this.cause=h(Z)?Z:void 0}}class P extends null{}class te extends null{}class Q extends null{}class X extends c{}class M extends null{}class z extends null{}class _ extends c{constructor(L,Z){super(L,Z),this.name=h(Z)?Z.name:"Error"}}async function fe(T){try{const Z=await T.text();if(Z){var L;if(!((L=T.headers.get("content-type"))===null||L===void 0)&&L.startsWith("application/json"))try{const A=JSON.parse(Z);if(A.error&&A.response)return A}catch{}return{error:{name:"Error",message:`Request failed with status ${T.status} ${T.statusText}, ${Z}`},response:{statusCode:T.status}}}}catch{}return{error:{name:"Error",message:`Request failed with status ${T.status} ${T.statusText}`},response:{statusCode:T.status}}}class ie extends Error{static async fromResponse(L){const Z=await fe(L),A=Z.response.statusCode||L.status,S=Z.error.name||L.statusText,q=`Request failed with ${A} ${S}`,Te=g(Z.error);return new ie({message:q,response:L,data:Z,cause:Te})}constructor(L){super(L.message),this.name="ResponseError",this.response=L.response,this.body=L.data,this.cause=L.cause}}},32838:function(Rt,Me,t){"use strict";t.d(Me,{nW:function(){return ie},ae:function(){return X},q3:function(){return M}});var h=t(25248);const r=(0,h.T0)({id:"core.scmauth"});var W=new WeakMap;class B{async getCredentials(L){const Z=new URL(L.url),A=_class_private_field_get(this,W).find(S=>S.isUrlSupported(Z));if(!A)throw new Error(`No auth provider available for '${L.url}', see https://backstage.io/link?scm-auth`);return A.getCredentials(L)}constructor(L){_class_private_field_init(this,W,{writable:!0,value:void 0}),_class_private_field_set(this,W,L)}}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:L,gitlab:Z,azure:A,bitbucket:S})=>te.merge(te.forGithub(L),te.forGitlab(Z),te.forAzure(A),te.forBitbucket(S))})}static forAuthApi(L,Z){return new te("generic",L,Z.host,Z.scopeMapping)}static forGithub(L,Z){var A;const S=(A=Z==null?void 0:Z.host)!==null&&A!==void 0?A:"github.com";return new te("github",L,S,{default:["repo","read:org","read:user"],repoWrite:["gist"]})}static forGitlab(L,Z){var A;const S=(A=Z==null?void 0:Z.host)!==null&&A!==void 0?A:"gitlab.com";return new te("gitlab",L,S,{default:["read_user","read_api","read_repository"],repoWrite:["write_repository","api"]})}static forAzure(L,Z){var A;const S=(A=Z==null?void 0:Z.host)!==null&&A!==void 0?A:"dev.azure.com";return new te("azure",L,S,{default:["vso.build","vso.code","vso.graph","vso.project","vso.profile"],repoWrite:["vso.code_manage"]})}static forBitbucket(L,Z){var A;const S=(A=Z==null?void 0:Z.host)!==null&&A!==void 0?A:"bitbucket.org";return new te("bitbucket",L,S,{default:["account","team","pullrequest","snippet","issue"],repoWrite:["pullrequest:write","snippet:write","issue:write"]})}static merge(...L){return new B(L)}isUrlSupported(L){return L.host===_class_private_field_get(this,b)}getAdditionalScopesForProvider(L){var Z;if(!(L!=null&&L.customScopes)||_class_private_field_get(this,P)==="generic")return[];var A;return(A=(Z=L.customScopes)===null||Z===void 0?void 0:Z[_class_private_field_get(this,P)])!==null&&A!==void 0?A:[]}async getCredentials(L){const{url:Z,additionalScope:A,...S}=L,q=_class_private_field_get(this,c).default.slice();A!=null&&A.repoWrite&&q.push(..._class_private_field_get(this,c).repoWrite);const Te=this.getAdditionalScopesForProvider(A);Te.length&&q.push(...Te);const Qe=[...new Set(q)],Ye=await _class_private_field_get(this,g).getAccessToken(Qe,S);return{token:Ye,headers:{Authorization:`Bearer ${Ye}`}}}constructor(L,Z,A,S){_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,Z),_class_private_field_set(this,b,A),_class_private_field_set(this,c,S),_class_private_field_set(this,P,L)}}var Q=t(79158);class X{static fromConfig(L){return Q.Lx.fromConfig(L)}}const M=(0,h.T0)({id:"integration.scmintegrations"});var z=t(52322),_=t(73250),fe=t(2784);const ie=T=>{const{type:L}=T,Z=(0,h.qD)(),A=_.Z;var S;const q=L&&(S=Z.getSystemIcon(L))!==null&&S!==void 0?S:A;return(0,z.jsx)(q,{})}},79158:function(Rt,Me,t){"use strict";t.d(Me,{Lx:function(){return Qn},BT:function(){return at}});var h=t(82717),r=t.n(h),W=t(76635);function B(C){const d=new URL("http://example.com");return d.host=C,d.host===C}function g(C){try{return new URL(C),!0}catch{return!1}}function b(C,d){return{list(){return C},byUrl(y){try{const j=typeof y=="string"?new URL(y):y;return C.find(Y=>d(Y)===j.host)}catch{return}},byHost(y){return C.find(j=>d(j)===y)}}}function c(C){const{url:d,base:y,lineNumber:j}=C;try{return new URL(d),d}catch{}let Y;if(d.startsWith("/")){const{filepath:me}=r()(y);Y=new URL(y);const be=(0,W.trimEnd)(Y.pathname.substring(0,Y.pathname.length-me.length),"/");Y.pathname=`${be}${d}`}else Y=new URL(d,y);return Y.search=new URL(y).search,j&&(Y.hash=`L${j}`),Y.toString()}const P="amazonaws.com";function te(C){const d=C.getOptionalString("endpoint");var y;const j=(y=C.getOptionalBoolean("s3ForcePathStyle"))!==null&&y!==void 0?y:!1;let Y,me;if(d){try{const en=new URL(d);Y=en.host,me=en.pathname}catch{throw new Error(`invalid awsS3 integration config, endpoint '${d}' is not a valid URL`)}if(me!=="/")throw new Error(`invalid awsS3 integration config, endpoints cannot contain path, got '${d}'`)}else Y=P;const be=C.getOptionalString("accessKeyId"),De=C.getOptionalString("secretAccessKey"),pt=C.getOptionalString("roleArn"),Ft=C.getOptionalString("externalId");return{host:Y,endpoint:d,s3ForcePathStyle:j,accessKeyId:be,secretAccessKey:De,roleArn:pt,externalId:Ft}}function Q(C){const d=C.map(te);return d.some(y=>y.host===P)||d.push({host:P}),d}class X{get type(){return"awsS3"}get title(){return this.integrationConfig.host}get config(){return this.integrationConfig}resolveUrl(d){return c(d)}resolveEditUrl(d){return d}constructor(d){this.integrationConfig=d}}X.factory=({config:C})=>{var d;const y=Q((d=C.getOptionalConfigArray("integrations.awsS3"))!==null&&d!==void 0?d:[]);return b(y.map(j=>new X(j)),j=>j.config.host)};var M=t(90383),z=t(22504),_=t(69866);const fe="GB";var ie=new WeakMap,T=new WeakMap,L=new WeakMap,Z=new WeakMap,A=new WeakMap,S=new WeakMap,q=new WeakMap;class Te{static fromRepoUrl(d){const y=new URL(d);let j,Y,me;const be=y.pathname.split("/").map(Bn=>decodeURIComponent(Bn));if(be[2]==="_git"?(j=be[1],Y=me=be[3]):be[3]==="_git"?(j=be[1],Y=be[2],me=be[4]):be[4]==="_git"&&(j=`${be[1]}/${be[2]}`,Y=be[3],me=be[5]),!j||!Y||!me)throw new Error("Azure URL must point to a git repository");var De;const pt=(De=y.searchParams.get("path"))!==null&&De!==void 0?De:void 0;let Ft;const en=y.searchParams.get("version");if(en){if(en.slice(0,2)!=="GB")throw new Error("Azure URL version must point to a git branch");Ft=en.slice(2)}return new Te(y.origin,j,Y,me,pt,Ft)}toRepoUrl(){let d;return(0,M.Z)(this,L)===(0,M.Z)(this,Z)?d=(0,M.Z)(this,q).call(this,(0,M.Z)(this,T),"_git",(0,M.Z)(this,Z)):d=(0,M.Z)(this,q).call(this,(0,M.Z)(this,T),(0,M.Z)(this,L),"_git",(0,M.Z)(this,Z)),(0,M.Z)(this,A)&&d.searchParams.set("path",(0,M.Z)(this,A)),(0,M.Z)(this,S)&&d.searchParams.set("version",fe+(0,M.Z)(this,S)),d.toString()}toFileUrl(){if(!(0,M.Z)(this,A))throw new Error("Azure URL must point to a specific path to be able to download a file");const d=(0,M.Z)(this,q).call(this,(0,M.Z)(this,T),(0,M.Z)(this,L),"_apis","git","repositories",(0,M.Z)(this,Z),"items");return d.searchParams.set("api-version","6.0"),d.searchParams.set("path",(0,M.Z)(this,A)),(0,M.Z)(this,S)&&d.searchParams.set("version",(0,M.Z)(this,S)),d.toString()}toArchiveUrl(){const d=(0,M.Z)(this,q).call(this,(0,M.Z)(this,T),(0,M.Z)(this,L),"_apis","git","repositories",(0,M.Z)(this,Z),"items");return d.searchParams.set("recursionLevel","full"),d.searchParams.set("download","true"),d.searchParams.set("api-version","6.0"),(0,M.Z)(this,A)&&d.searchParams.set("scopePath",(0,M.Z)(this,A)),(0,M.Z)(this,S)&&d.searchParams.set("version",(0,M.Z)(this,S)),d.toString()}toCommitsUrl(){const d=(0,M.Z)(this,q).call(this,(0,M.Z)(this,T),(0,M.Z)(this,L),"_apis","git","repositories",(0,M.Z)(this,Z),"commits");return d.searchParams.set("api-version","6.0"),(0,M.Z)(this,S)&&d.searchParams.set("searchCriteria.itemVersion.version",(0,M.Z)(this,S)),d.toString()}getOwner(){return(0,M.Z)(this,T)}getProject(){return(0,M.Z)(this,L)}getRepo(){return(0,M.Z)(this,Z)}getPath(){return(0,M.Z)(this,A)}getRef(){return(0,M.Z)(this,S)}constructor(d,y,j,Y,me,be){(0,z.Z)(this,ie,{writable:!0,value:void 0}),(0,z.Z)(this,T,{writable:!0,value:void 0}),(0,z.Z)(this,L,{writable:!0,value:void 0}),(0,z.Z)(this,Z,{writable:!0,value:void 0}),(0,z.Z)(this,A,{writable:!0,value:void 0}),(0,z.Z)(this,S,{writable:!0,value:void 0}),(0,z.Z)(this,q,{writable:!0,value:(...De)=>{const pt=new URL((0,M.Z)(this,ie));return pt.pathname=De.map(Ft=>encodeURIComponent(Ft)).join("/"),pt}}),(0,_.Z)(this,ie,d),(0,_.Z)(this,T,y),(0,_.Z)(this,L,j),(0,_.Z)(this,Z,Y),(0,_.Z)(this,A,me),(0,_.Z)(this,S,be)}}const Qe="dev.azure.com";function Ye(C){var d;const y=(d=C.getOptionalString("host"))!==null&&d!==void 0?d:Qe,j=C.getOptionalString("token");if(!B(y))throw new Error(`Invalid Azure integration config, '${y}' is not a valid host`);return{host:y,token:j}}function Xe(C){const d=C.map(Ye);return d.some(y=>y.host===Qe)||d.push({host:Qe}),d}class Ve{get type(){return"azure"}get title(){return this.integrationConfig.host}get config(){return this.integrationConfig}resolveUrl(d){const{url:y,base:j}=d;if(g(y))return y;try{const me=Te.fromRepoUrl(j),be=new URL(j);var Y;const De=new URL(`https://a.com${(Y=me.getPath())!==null&&Y!==void 0?Y:""}`),pt=new URL(y,De).pathname;return be.searchParams.set("path",pt),d.lineNumber&&(be.searchParams.set("line",String(d.lineNumber)),be.searchParams.set("lineEnd",String(d.lineNumber+1)),be.searchParams.set("lineStartColumn","1"),be.searchParams.set("lineEndColumn","1")),be.toString()}catch{return new URL(y,j).toString()}}resolveEditUrl(d){return d}constructor(d){this.integrationConfig=d}}Ve.factory=({config:C})=>{var d;const y=Xe((d=C.getOptionalConfigArray("integrations.azure"))!==null&&d!==void 0?d:[]);return b(y.map(j=>new Ve(j)),j=>j.config.host)};var ft=t(48834).lW;function je(C){return AzureUrl.fromRepoUrl(C).toFileUrl()}function Ge(C){return AzureUrl.fromRepoUrl(C).toArchiveUrl()}function st(C){return AzureUrl.fromRepoUrl(C).toCommitsUrl()}function gt(C,d){const y=d?{...d}:{};if(C.token){const j=ft.from(`:${C.token}`,"utf8");y.Authorization=`Basic ${j.toString("base64")}`}return{headers:y}}const rt="bitbucket.org",ot="https://api.bitbucket.org/2.0";function ct(C){var d;const y=(d=C.getOptionalString("host"))!==null&&d!==void 0?d:rt;let j=C.getOptionalString("apiBaseUrl");const Y=C.getOptionalString("token"),me=C.getOptionalString("username"),be=C.getOptionalString("appPassword");if(!B(y))throw new Error(`Invalid Bitbucket integration config, '${y}' is not a valid host`);return j?j=(0,W.trimEnd)(j,"/"):y===rt?j=ot:j=`https://${y}/rest/api/1.0`,{host:y,apiBaseUrl:j,token:Y,username:me,appPassword:be}}function yt(C){const d=C.map(ct);return d.some(y=>y.host===rt)||d.push({host:rt,apiBaseUrl:ot}),d}class Lt{get type(){return"bitbucket"}get title(){return this.integrationConfig.host}get config(){return this.integrationConfig}resolveUrl(d){const y=c(d);if(!d.lineNumber)return y;const j=new URL(y);return this.integrationConfig.host==="bitbucket.org"?j.hash=`lines-${d.lineNumber}`:j.hash=`${d.lineNumber}`,j.toString()}resolveEditUrl(d){const y=r()(d),j=new URL(d);return j.searchParams.set("mode","edit"),j.searchParams.set("spa","0"),j.searchParams.set("at",y.ref),j.toString()}constructor(d){this.integrationConfig=d}}Lt.factory=({config:C})=>{var d,y,j;const Y=yt((j=C.getOptionalConfigArray("integrations.bitbucket"))!==null&&j!==void 0?j:[...(d=C.getOptionalConfigArray("integrations.bitbucketCloud"))!==null&&d!==void 0?d:[],...(y=C.getOptionalConfigArray("integrations.bitbucketServer"))!==null&&y!==void 0?y:[]]);return b(Y.map(me=>new Lt(me)),me=>me.config.host)};var We=t(96279),se=t(48834).lW;async function Ie(C,d){const{name:y,owner:j,resource:Y}=parseGitUrl(C),me=Y==="bitbucket.org";let be=me?`${d.apiBaseUrl}/repositories/${j}/${y}`:`${d.apiBaseUrl}/projects/${j}/repos/${y}/default-branch`,De=await fetch(be,mt(d));if(De.status===404&&!me&&(be=`${d.apiBaseUrl}/projects/${j}/repos/${y}/branches/default`,De=await fetch(be,mt(d))),!De.ok){const Ft=`Failed to retrieve default branch from ${be}, ${De.status} ${De.statusText}`;throw new Error(Ft)}let pt;if(me)pt=(await De.json()).mainbranch.name;else{const{displayId:Ft}=await De.json();pt=Ft}if(!pt)throw new Error(`Failed to read default branch from ${be}. Response ${De.status} ${De.json()}`);return pt}async function Le(C,d){const{name:y,owner:j,ref:Y,protocol:me,resource:be,filepath:De}=parseGitUrl(C),pt=be==="bitbucket.org";let Ft=Y;Ft||(Ft=await Ie(C,d));const en=De?`&path=${encodeURIComponent(decodeURIComponent(De))}`:"";return pt?`${me}://${be}/${j}/${y}/get/${Ft}.tar.gz`:`${d.apiBaseUrl}/projects/${j}/repos/${y}/archive?format=tgz&at=${Ft}&prefix=${j}-${y}${en}`}function tt(C,d){try{const{owner:y,name:j,ref:Y,filepathtype:me,filepath:be}=parseGitUrl(C);if(!y||!j||me!=="browse"&&me!=="raw"&&me!=="src")throw new Error("Invalid Bitbucket URL or file path");const De=be.replace(/^\//,"");if(d.host==="bitbucket.org"){if(!Y)throw new Error("Invalid Bitbucket URL or file path");return`${d.apiBaseUrl}/repositories/${y}/${j}/src/${Y}/${De}`}return`${d.apiBaseUrl}/projects/${y}/repos/${j}/raw/${De}?at=${Y}`}catch(y){throw new Error(`Incorrect URL: ${C}, ${y}`)}}function mt(C){const d={};if(C.token)d.Authorization=`Bearer ${C.token}`;else if(C.username&&C.appPassword){const y=se.from(`${C.username}:${C.appPassword}`,"utf8");d.Authorization=`Basic ${y.toString("base64")}`}return{headers:d}}const Zt="bitbucket.org",dt="https://api.bitbucket.org/2.0";function Et(C){const d=Zt,y=dt,j=C.getString("username"),Y=C.getString("appPassword");return{host:d,apiBaseUrl:y,username:j,appPassword:Y}}function At(C){const d=C.map(Et);return d.length===0&&d.push({host:Zt,apiBaseUrl:dt}),d}class Ot{get type(){return"bitbucketCloud"}get title(){return this.integrationConfig.host}get config(){return this.integrationConfig}resolveUrl(d){const y=c(d);if(d.lineNumber){const j=new URL(y);return j.hash=`lines-${d.lineNumber}`,j.toString()}return y}resolveEditUrl(d){const y=r()(d),j=new URL(d);return j.searchParams.set("mode","edit"),j.searchParams.set("at",y.ref),j.toString()}constructor(d){this.integrationConfig=d}}Ot.factory=({config:C})=>{var d;const y=At((d=C.getOptionalConfigArray("integrations.bitbucketCloud"))!==null&&d!==void 0?d:[]);return b(y.map(j=>new Ot(j)),j=>j.config.host)};var qt=t(48834).lW;async function Vt(C,d){const{name:y,owner:j}=parseGitUrl(C),Y=`${d.apiBaseUrl}/repositories/${j}/${y}`,me=await fetch(Y,dn(d));if(!me.ok){const pt=`Failed to retrieve default branch from ${Y}, ${me.status} ${me.statusText}`;throw new Error(pt)}const De=(await me.json()).mainbranch.name;if(!De)throw new Error(`Failed to read default branch from ${Y}. Response ${me.status} ${me.json()}`);return De}async function Ht(C,d){const{name:y,owner:j,ref:Y,protocol:me,resource:be}=parseGitUrl(C);let De=Y;return De||(De=await Vt(C,d)),`${me}://${be}/${j}/${y}/get/${De}.tar.gz`}function Jt(C,d){try{const{owner:y,name:j,ref:Y,filepathtype:me,filepath:be}=parseGitUrl(C);if(!y||!j||me!=="src"&&me!=="raw")throw new Error("Invalid Bitbucket Cloud URL or file path");const De=be.replace(/^\//,"");if(!Y)throw new Error("Invalid Bitbucket Cloud URL or file path");return`${d.apiBaseUrl}/repositories/${y}/${j}/src/${Y}/${De}`}catch(y){throw new Error(`Incorrect URL: ${C}, ${y}`)}}function dn(C){const d={};if(C.username&&C.appPassword){const y=qt.from(`${C.username}:${C.appPassword}`,"utf8");d.Authorization=`Basic ${y.toString("base64")}`}return{headers:d}}function an(C){const d=C.getString("host");let y=C.getOptionalString("apiBaseUrl");const j=C.getOptionalString("token"),Y=C.getOptionalString("username"),me=C.getOptionalString("password");if(!B(d))throw new Error(`Invalid Bitbucket Server integration config, '${d}' is not a valid host`);return y?y=(0,W.trimEnd)(y,"/"):y=`https://${d}/rest/api/1.0`,{host:d,apiBaseUrl:y,token:j,username:Y,password:me}}function Fn(C){return C.map(an)}class En{get type(){return"bitbucketServer"}get title(){return this.integrationConfig.host}get config(){return this.integrationConfig}resolveUrl(d){const y=c(d);if(d.lineNumber){const j=new URL(y);return j.hash=d.lineNumber.toString(),j.toString()}return y}resolveEditUrl(d){return d.includes("?")?d.substring(0,d.indexOf("?")):d}constructor(d){this.integrationConfig=d}}En.factory=({config:C})=>{var d;const y=Fn((d=C.getOptionalConfigArray("integrations.bitbucketServer"))!==null&&d!==void 0?d:[]);return b(y.map(j=>new En(j)),j=>j.config.host)};var Un=t(48834).lW;async function mn(C,d){const{name:y,owner:j}=parseGitUrl(C);let Y=`${d.apiBaseUrl}/projects/${j}/repos/${y}/default-branch`,me=await fetch(Y,Mn(d));if(me.status===404&&(Y=`${d.apiBaseUrl}/projects/${j}/repos/${y}/branches/default`,me=await fetch(Y,Mn(d))),!me.ok){const pt=`Failed to retrieve default branch from ${Y}, ${me.status} ${me.statusText}`;throw new Error(pt)}const{displayId:be}=await me.json(),De=be;if(!De)throw new Error(`Failed to read default branch from ${Y}. Response ${me.status} ${me.json()}`);return De}async function un(C,d){const{name:y,owner:j,ref:Y,filepath:me}=parseGitUrl(C);let be=Y;be||(be=await mn(C,d));const De=me?`&path=${encodeURIComponent(decodeURIComponent(me))}`:"";return`${d.apiBaseUrl}/projects/${j}/repos/${y}/archive?format=tgz&at=${be}&prefix=${j}-${y}${De}`}function Qt(C,d){try{const{owner:y,name:j,ref:Y,filepathtype:me,filepath:be}=parseGitUrl(C);if(!y||!j||me!=="browse"&&me!=="raw"&&me!=="src")throw new Error("Invalid Bitbucket Server URL or file path");const De=be.replace(/^\//,"");return`${d.apiBaseUrl}/projects/${y}/repos/${j}/raw/${De}?at=${Y}`}catch(y){throw new Error(`Incorrect URL: ${C}, ${y}`)}}function Mn(C){const d={};if(C.token)d.Authorization=`Bearer ${C.token}`;else if(C.username&&C.password){const y=Un.from(`${C.username}:${C.password}`,"utf8");d.Authorization=`Basic ${y.toString("base64")}`}return{headers:d}}function zn(C){const d=C.getString("host");let y=C.getOptionalString("baseUrl"),j=C.getOptionalString("cloneUrl"),Y=C.getOptionalString("gitilesBaseUrl");const me=C.getOptionalString("username"),be=C.getOptionalString("password");if(B(d)){if(y&&!g(y))throw new Error(`Invalid Gerrit integration config, '${y}' is not a valid baseUrl`);if(j&&!g(j))throw new Error(`Invalid Gerrit integration config, '${j}' is not a valid cloneUrl`);if(Y&&!g(Y))throw new Error(`Invalid Gerrit integration config, '${Y}' is not a valid gitilesBaseUrl`)}else throw new Error(`Invalid Gerrit integration config, '${d}' is not a valid host`);return y?y=(0,W.trimEnd)(y,"/"):y=`https://${d}`,Y?Y=(0,W.trimEnd)(Y,"/"):Y=`https://${d}`,j?j=(0,W.trimEnd)(j,"/"):j=y,{host:d,baseUrl:y,cloneUrl:j,gitilesBaseUrl:Y,username:me,password:be}}function hn(C){return C.map(zn)}var vn=t(48834).lW;const yn=")]}'";function Ln(C,d){const j=d.replace(C.gitilesBaseUrl,"").split("/").filter(Ft=>!!Ft),Y=j.indexOf("+");if(Y<=0)throw new Error(`Unable to parse project from url: ${d}`);const me=(0,W.trimStart)(j.slice(0,Y).join("/"),"/"),be=j.indexOf("heads");if(be<=0)throw new Error(`Unable to parse branch from url: ${d}`);const De=j[be+1],pt=j.slice(be+2).join("/");return{branch:De,filePath:pt===""?"/":pt,project:me}}function Pn(C,d,y,j){return`${C.gitilesBaseUrl}/${d}/+/refs/heads/${y}/${(0,W.trimStart)(j,"/")}`}function xn(C){return C.password?"/a/":"/"}function ge(C,d){const{branch:y,project:j}=Ln(C,d);return`${C.baseUrl}${xn(C)}projects/${encodeURIComponent(j)}/branches/${y}`}function ee(C,d){const{project:y}=Ln(C,d);return`${C.cloneUrl}${xn(C)}${y}`}function Ee(C,d){const{branch:y,filePath:j,project:Y}=Ln(C,d);return`${C.baseUrl}${xn(C)}projects/${encodeURIComponent(Y)}/branches/${y}/files/${encodeURIComponent(j)}/content`}function Ne(C){return`${C.baseUrl}${xn(C)}projects/`}function _e(C){const d={};if(!C.password)return d;const y=vn.from(`${C.username}:${C.password}`,"utf8");return d.Authorization=`Basic ${y.toString("base64")}`,{headers:d}}async function wt(C){const d=await C.text();if(d.startsWith(yn))try{return JSON.parse(d.slice(yn.length))}catch(y){throw new Error(`Invalid response from Gerrit: ${d.slice(0,10)} - ${y}`)}throw new Error(`Gerrit JSON body prefix missing. Found: ${d.slice(0,10)}`)}class ae{get type(){return"gerrit"}get title(){return this.integrationConfig.host}get config(){return this.integrationConfig}resolveUrl(d){const{url:y,base:j,lineNumber:Y}=d;let me;if(y.startsWith("/")){const{branch:be,project:De}=Ln(this.config,j);return Pn(this.config,De,be,y)}return y?me=new URL(y,j):me=new URL(j),Y&&(me.hash=Y.toString()),me.toString()}resolveEditUrl(d){return d}constructor(d){this.integrationConfig=d}}ae.factory=({config:C})=>{var d;const y=hn((d=C.getOptionalConfigArray("integrations.gerrit"))!==null&&d!==void 0?d:[]);return b(y.map(j=>new ae(j)),j=>j.config.host)};function k(C){const d=C.getString("host");let y=C.getOptionalString("baseUrl");const j=C.getOptionalString("username"),Y=C.getOptionalString("password");if(!B(d))throw new Error(`Invalid Gitea integration config, '${d}' is not a valid host`);return y?y=(0,W.trimEnd)(y,"/"):y=`https://${d}`,{host:d,baseUrl:y,username:j,password:Y}}var ce=t(48834).lW;function Oe(C,d){try{var y;const j=(y=C.baseUrl)!==null&&y!==void 0?y:`https://${C.host}`,[Y,me,be,De,pt,Ft,...en]=d.replace(j,"").split("/"),Bn=en.join("/").replace(/^\//,"");return`${j}/${me}/${be}/_edit/${Ft}/${Bn}`}catch(j){throw new Error(`Incorrect URL: ${d}, ${j}`)}}function D(C,d){try{var y;const j=(y=C.baseUrl)!==null&&y!==void 0?y:`https://${C.host}`,[Y,me,be,De,pt,Ft,...en]=d.replace(j,"").split("/"),Bn=en.join("/").replace(/^\//,"");return`${j}/api/v1/repos/${me}/${be}/contents/${Bn}?ref=${Ft}`}catch(j){throw new Error(`Incorrect URL: ${d}, ${j}`)}}function U(C){const d={},{username:y,password:j}=C;return j?(y?d.Authorization=`basic ${ce.from(`${y}:${j}`).toString("base64")}`:d.Authorization=`token ${j}`,{headers:d}):d}class de{get type(){return"gitea"}get title(){return this.config.host}resolveUrl(d){return c(d)}resolveEditUrl(d){return Oe(this.config,d)}constructor(d){this.config=d}}de.factory=({config:C})=>{var d;const j=((d=C.getOptionalConfigArray("integrations.gitea"))!==null&&d!==void 0?d:[]).map(Y=>k(Y));return b(j.map(Y=>new de(Y)),Y=>Y.config.host)};const pe="github.com",ye="https://api.github.com",Pe="https://raw.githubusercontent.com";function Re(C){var d,y;const j=(y=C.getOptionalString("host"))!==null&&y!==void 0?y:pe;let Y=C.getOptionalString("apiBaseUrl"),me=C.getOptionalString("rawBaseUrl");const be=C.getOptionalString("token"),De=(d=C.getOptionalConfigArray("apps"))===null||d===void 0?void 0:d.map(pt=>({appId:pt.getNumber("appId"),clientId:pt.getString("clientId"),clientSecret:pt.getString("clientSecret"),webhookSecret:pt.getString("webhookSecret"),privateKey:pt.getString("privateKey"),allowedInstallationOwners:pt.getOptionalStringArray("allowedInstallationOwners")}));if(!B(j))throw new Error(`Invalid GitHub integration config, '${j}' is not a valid host`);return Y?Y=(0,W.trimEnd)(Y,"/"):j===pe&&(Y=ye),me?me=(0,W.trimEnd)(me,"/"):j===pe&&(me=Pe),{host:j,apiBaseUrl:Y,rawBaseUrl:me,token:be,apps:De}}function Ue(C){const d=C.map(Re);return d.some(y=>y.host===pe)||d.push({host:pe,apiBaseUrl:ye,rawBaseUrl:Pe}),d}function nt(C,d,y){try{const{owner:j,name:Y,ref:me,filepathtype:be,filepath:De}=parseGitUrl(C);if(!j||!Y||!me||be!=="blob"&&be!=="raw"&&be!=="tree")throw new Error("Invalid GitHub URL or file path");const pt=De.replace(/^\//,"");return H(d,y)==="api"?`${d.apiBaseUrl}/repos/${j}/${Y}/contents/${pt}?ref=${me}`:`${d.rawBaseUrl}/${j}/${Y}/${me}/${pt}`}catch(j){throw new Error(`Incorrect URL: ${C}, ${j}`)}}function w(C,d){const y={};return H(C,d)==="api"&&(y.Accept="application/vnd.github.v3.raw"),d.token&&(y.Authorization=`token ${d.token}`),{headers:y}}function H(C,d){return C.apiBaseUrl&&(d.token||!C.rawBaseUrl)?"api":"raw"}var ve=t(42822),ue=t(89393),we=t(26228);class ke{async getOrCreateToken(d,y,j){let Y=this.tokenCache.get(d);if((!Y||this.isExpired(Y.expiresAt))&&(Y=await j(),Y.expiresAt=Y.expiresAt.minus({minutes:10}),this.tokenCache.set(d,Y)),!this.appliesToRepo(Y,y))throw new Error(`The Backstage GitHub application used in the ${d} organization does not have access to a repository with the name ${y}`);return{accessToken:Y.token}}appliesToRepo(d,y){return y===void 0?!0:d.repositories!==void 0?d.repositories.includes(y):!0}constructor(){this.tokenCache=new Map,this.isExpired=d=>we.ou.local()>d}}const Fe={Accept:"application/vnd.github.machine-man-preview+json"};class it{async getInstallationCredentials(d,y){if(this.allowedInstallationOwners){var j;if(!(!((j=this.allowedInstallationOwners)===null||j===void 0)&&j.includes(d)))return{accessToken:void 0}}return this.cache.getOrCreateToken(d,y,async()=>{const{installationId:Y,suspended:me}=await this.getInstallationData(d);if(me)throw new Error(`The GitHub application for ${d} is suspended`);const be=await this.appClient.apps.createInstallationAccessToken({installation_id:Y,headers:Fe});let De;if(be.data.repository_selection==="selected"){const Ft=new ue.v({baseUrl:this.baseUrl,auth:be.data.token}),en=await Ft.paginate(Ft.apps.listReposAccessibleToInstallation);var pt;De=((pt=en.repositories)!==null&&pt!==void 0?pt:en).map(Er=>Er.name)}return{token:be.data.token,expiresAt:we.ou.fromISO(be.data.expires_at),repositories:De}})}getInstallations(){return this.appClient.paginate(this.appClient.apps.listInstallations)}async getInstallationData(d){const j=(await this.getInstallations()).find(me=>{var be,De;return((be=me.account)===null||be===void 0||(De=be.login)===null||De===void 0?void 0:De.toLocaleLowerCase("en-US"))===d.toLocaleLowerCase("en-US")});if(j)return{installationId:j.id,suspended:Boolean(j.suspended_by)};const Y=new Error(`No app installation found for ${d} in ${this.baseAuthConfig.appId}`);throw Y.name="NotFoundError",Y}constructor(d,y){this.cache=new ke,this.allowedInstallationOwners=d.allowedInstallationOwners,this.baseUrl=y,this.baseAuthConfig={appId:d.appId,privateKey:d.privateKey.replace(/\\n/gm,`
|
|
33
|
+
`)},this.appClient=new ue.v({baseUrl:y,headers:Fe,authStrategy:ve.i,auth:this.baseAuthConfig})}}class Ct{async getAllInstallations(){return this.apps.length?(await Promise.all(this.apps.map(y=>y.getInstallations()))).flat():[]}async getAppToken(d,y){if(this.apps.length===0)return;const j=await Promise.all(this.apps.map(De=>De.getInstallationCredentials(d,y).then(pt=>({credentials:pt,error:void 0}),pt=>({credentials:void 0,error:pt})))),Y=j.find(De=>De.credentials);if(Y)return Y.credentials.accessToken;const be=j.map(De=>De.error).find(De=>De.name!=="NotFoundError");if(be)throw be}constructor(d){var y,j;this.apps=(j=(y=d.apps)===null||y===void 0?void 0:y.map(Y=>new it(Y,d.apiBaseUrl)))!==null&&j!==void 0?j:[]}}class Ke{async getCredentials(d){const y=r()(d.url),j=y.owner||y.name,Y=y.owner?y.name:void 0;let me="app",be=await this.githubAppCredentialsMux.getAppToken(j,Y);return be||(me="token",be=this.token),{headers:be?{Authorization:`Bearer ${be}`}:void 0,token:be,type:me}}constructor(d,y){this.githubAppCredentialsMux=d,this.token=y}}Ke.create=C=>new Ke(new Ct(C),C.token);class ht{static fromIntegrations(d){const y=new Map;return d.github.list().forEach(j=>{const Y=SingleInstanceGithubCredentialsProvider.create(j.config);y.set(j.config.host,Y)}),new ht(y)}async getCredentials(d){const y=new URL(d.url),j=this.providers.get(y.host);if(!j)throw new Error(`There is no GitHub integration that matches ${d.url}. Please add a configuration for an integration.`);return j.getCredentials(d)}constructor(d){this.providers=d}}class vt{get type(){return"github"}get title(){return this.integrationConfig.host}get config(){return this.integrationConfig}resolveUrl(d){return at(c(d),"tree")}resolveEditUrl(d){return at(d,"edit")}constructor(d){this.integrationConfig=d}}vt.factory=({config:C})=>{var d;const y=Ue((d=C.getOptionalConfigArray("integrations.github"))!==null&&d!==void 0?d:[]);return b(y.map(j=>new vt(j)),j=>j.config.host)};function at(C,d){return C.replace(/\/\/([^/]+)\/([^/]+)\/([^/]+)\/(blob|tree|edit)\//,(y,j,Y,me)=>`//${j}/${Y}/${me}/${d}/`)}const Tt=null;class Ut extends vt{get config(){return super.config}constructor(d){super(d)}}Ut.factory=vt.factory;const Mt=null,Wn=null,Vn=null,bn="gitlab.com",Nt="https://gitlab.com/api/v4";function zt(C){const d=C.getString("host");let y=C.getOptionalString("apiBaseUrl");const j=C.getOptionalString("token");let Y=C.getOptionalString("baseUrl");if(y?y=(0,W.trimEnd)(y,"/"):d===bn&&(y=Nt),Y?Y=(0,W.trimEnd)(Y,"/"):Y=`https://${d}`,B(d)){if(!y||!g(y))throw new Error(`Invalid GitLab integration config, '${y}' is not a valid apiBaseUrl`);if(!g(Y))throw new Error(`Invalid GitLab integration config, '${Y}' is not a valid baseUrl`)}else throw new Error(`Invalid GitLab integration config, '${d}' is not a valid host`);return{host:d,token:j,apiBaseUrl:y,baseUrl:Y}}function _t(C){const d=C.map(zt);return d.some(y=>y.host===bn)||d.push({host:bn,apiBaseUrl:Nt,baseUrl:`https://${bn}`}),d}function kn(C){let d="";return C.host!==bn&&(d=new URL(C.baseUrl).pathname),trimEnd(d,"/")}async function Jn(C,d){const y=await Hn(C,d);return pn(C,y,d).toString()}function Sn(C){const{token:d=""}=C;return{headers:{"PRIVATE-TOKEN":d}}}function pn(C,d,y){try{const j=new URL(C),Y=j.pathname.split("/blob/").slice(1).join("/blob/"),[me,...be]=Y.split("/"),De=getGitLabIntegrationRelativePath(y);return j.pathname=[...De?[De]:[],"api/v4/projects",d,"repository/files",encodeURIComponent(decodeURIComponent(be.join("/"))),"raw"].join("/"),j.search=`?ref=${me}`,j}catch(j){throw new Error(`Incorrect url: ${C}, ${j}`)}}async function Hn(C,d){const y=new URL(C);if(!y.pathname.includes("/blob/"))throw new Error("Please provide full path to yaml file from GitLab");try{let j=y.pathname.split("/-/blob/")[0].split("/blob/")[0];const Y=getGitLabIntegrationRelativePath(d);Y&&(j=j.replace(Y,""));const me=new URL(`${y.origin}${Y}/api/v4/projects/${encodeURIComponent(j.replace(/^\//,""))}`),be=await fetch(me.toString(),Sn(d)),De=await be.json();if(!be.ok)throw new Error(`GitLab Error '${De.error}', ${De.error_description}`);return Number(De.id)}catch(j){throw new Error(`Could not get GitLab project ID for: ${C}, ${j}`)}}class ln{get type(){return"gitlab"}get title(){return this.integrationConfig.host}get config(){return this.integrationConfig}resolveUrl(d){return c(d)}resolveEditUrl(d){return On(d,"edit")}constructor(d){this.integrationConfig=d}}ln.factory=({config:C})=>{var d;const y=_t((d=C.getOptionalConfigArray("integrations.gitlab"))!==null&&d!==void 0?d:[]);return b(y.map(j=>new ln(j)),j=>j.config.host)};function On(C,d){return C.replace(/\/\-\/(blob|tree|edit)\//,`/-/${d}/`)}class Qn{static fromConfig(d){return new Qn({awsS3:X.factory({config:d}),azure:Ve.factory({config:d}),bitbucket:Lt.factory({config:d}),bitbucketCloud:Ot.factory({config:d}),bitbucketServer:En.factory({config:d}),gerrit:ae.factory({config:d}),github:vt.factory({config:d}),gitlab:ln.factory({config:d}),gitea:de.factory({config:d})})}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(d=>d.list())}byUrl(d){let y=Object.values(this.byType).map(j=>j.byUrl(d)).filter(Boolean);if(y.length>1){const j=y.filter(Y=>!(Y instanceof Lt));j.length!==0&&(y=j)}return y[0]}byHost(d){return Object.values(this.byType).map(y=>y.byHost(d)).find(Boolean)}resolveUrl(d){const y=this.byUrl(d.base);return y?y.resolveUrl(d):c(d)}resolveEditUrl(d){const y=this.byUrl(d);return y?y.resolveEditUrl(d):d}constructor(d){this.byType=d}}},51102:function(Rt,Me,t){"use strict";var h={};t.r(h),t.d(h,{TechDocsPlugin:function(){return S.s4}});var r=t(52322),W=t(2784),B=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),Q=t(95481),X=t(7476),M=t(93225),z=t(67896),_=t(65124),fe=t(17339),ie=t(85478),T=t(68435),L=t(3482),Z=t(42081),A=t(48431),S=t(89258),q=t(52943),Te=t(61886),Qe=t(13980),Ye=t.n(Qe);class Xe{get(n){for(const o of this.holders){const l=o.get(n);if(l)return l}}constructor(...n){this.holders=n}}var Ve=t(51837);const ft=(0,Ve.CT)("api-context"),je=a=>{var n;const{apis:o,children:l}=a,f=(n=(0,W.useContext)(ft))===null||n===void 0?void 0:n.atVersion(1),R=f?new Xe(o,f):o;return(0,r.jsx)(ft.Provider,{value:(0,Ve.EI)({1:R}),children:l})};je.propTypes={apis:Ye().shape({get:Ye().func.isRequired}).isRequired,children:Ye().node};class Ge{static validateFactories(n,o){for(const l of o){const f=[l],R=new Set;for(;f.length;){const N=f.shift(),V=n.get(N);if(!!V)for(const ne of Object.values(V.deps)){if(ne.id===l.id)throw new Error(`Circular dependency of api factory for ${l}`);R.has(ne)||(R.add(ne),f.push(ne))}}}}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 R=this.loadDeps(n,f.deps,[...o,f.api]),N=f.factory(R);return this.apis.set(n.id,N),N}loadDeps(n,o,l){const f={};for(const R in o)if(o.hasOwnProperty(R)){const N=o[R],V=this.load(N,l);if(!V)throw new Error(`No API factory available for dependency ${N} of dependent ${n}`);f[R]=V}return f}constructor(n){this.factories=n,this.apis=new Map}}var st;(function(a){a[a.default=10]="default",a[a.app=50]="app",a[a.static=100]="static"})(st||(st={}));class gt{register(n,o){const l=st[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 rt(a){return new Promise((n,o)=>{const l=a.width||500,f=a.height||700,R=window.screen.width/2-l/2,N=window.screen.height/2-f/2,V=window.open(a.url,a.name,`menubar=no,location=no,resizable=no,scrollbars=no,status=no,width=${l},height=${f},top=${N},left=${R}`);let ne="";if(!V||typeof V.closed=="undefined"||V.closed){const lt=new Error("Failed to open auth popup.");lt.name="PopupRejectedError",o(lt);return}const ze=lt=>{if(lt.source!==V||lt.origin!==a.origin)return;const{data:bt}=lt;if(bt.type==="config_info"){ne=bt.targetOrigin;return}if(bt.type!=="authorization_response")return;const St=bt;if("error"in St){const Bt=new Error(St.error.message);Bt.name=St.error.name,o(Bt)}else n(St.response);ut()},Ze=setInterval(()=>{if(V.closed){const lt=`Login failed, ${ne&&ne!==window.location.origin?`Incorrect app origin, expected ${ne}`:"popup was closed"}`,bt=new Error(lt);bt.name="PopupClosedError",o(bt),ut()}},100);function ut(){window.removeEventListener("message",ze),clearInterval(Ze)}window.addEventListener("message",ze)})}function ot(a){return[...a].join(" ")}class ct{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 rt({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:R=ot,oauthRequestApi:N,sessionTransform:V=ne=>ne}=n;this.authRequester=N.createAuthRequester({provider:f,onAuthRequest:ne=>this.showPopup(ne)}),this.discoveryApi=o,this.environment=l,this.provider=f,this.joinScopesFunc=R,this.sessionTransform=V}}function yt(a,n){for(const o of n)if(!a.has(o))return!1;return!0}class Lt{sessionExistsAndHasScope(n,o){if(!n)return!1;if(!o||this.options.sessionScopes===void 0)return!0;const l=this.options.sessionScopes(n);return yt(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 R of f)l.add(R)}if(o)for(const f of o)l.add(f);return l}constructor(n){this.options=n}}var We=t(82394),se=t.n(We);let Ie=Symbol.observable;class Le{[Ie](){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(se())(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 mt{[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(se())(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 mt(b.sM.SignedOut),this.signedIn=!1}}class dt{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),R=this.sessionScopesFunc(l);return yt(R,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:R}=n;this.connector=o,this.sessionScopesFunc=f,this.sessionShouldRefreshFunc=R,this.helper=new Lt({sessionScopes:f,defaultScopes:l})}}class Et{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 At={id:"oauth2",title:"Your Identity Provider",icon:()=>null};class Ot{static create(n){const{discoveryApi:o,environment:l="development",provider:f=At,oauthRequestApi:R,defaultScopes:N=[],scopeTransform:V=Ze=>Ze}=n,ne=new ct({discoveryApi:o,environment:l,provider:f,oauthRequestApi:R,sessionTransform(Ze){return{...Ze,providerInfo:{idToken:Ze.providerInfo.idToken,accessToken:Ze.providerInfo.accessToken,scopes:Ot.normalizeScopes(V,Ze.providerInfo.scope),expiresAt:new Date(Date.now()+Ze.providerInfo.expiresInSeconds*1e3)}}}}),ze=new dt({connector:ne,defaultScopes:new Set(N),sessionScopes:Ze=>Ze.providerInfo.scopes,sessionShouldRefresh:Ze=>(Ze.providerInfo.expiresAt.getTime()-Date.now())/1e3<60*5});return new Ot({sessionManager:ze,scopeTransform:V})}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 R;return(R=f==null?void 0:f.providerInfo.accessToken)!==null&&R!==void 0?R:""}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 qt={id:"github",title:"GitHub",icon:()=>null};class Vt{static create(n){const{discoveryApi:o,environment:l="development",provider:f=qt,oauthRequestApi:R,defaultScopes:N=["read:user"]}=n;return Ot.create({discoveryApi:o,oauthRequestApi:R,provider:f,environment:l,defaultScopes:N})}}const Ht={id:"gitlab",title:"GitLab",icon:()=>null};class Jt{static create(n){const{discoveryApi:o,environment:l="development",provider:f=Ht,oauthRequestApi:R,defaultScopes:N=["read_user"]}=n;return Ot.create({discoveryApi:o,oauthRequestApi:R,provider:f,environment:l,defaultScopes:N})}}const dn={id:"google",title:"Google",icon:()=>null},an="https://www.googleapis.com/auth/";class Fn{static create(n){const{discoveryApi:o,oauthRequestApi:l,environment:f="development",provider:R=dn,defaultScopes:N=["openid",`${an}userinfo.email`,`${an}userinfo.profile`]}=n;return Ot.create({discoveryApi:o,oauthRequestApi:l,provider:R,environment:f,defaultScopes:N,scopeTransform(V){return V.map(ne=>ne==="openid"?ne:ne==="profile"||ne==="email"?`${an}userinfo.${ne}`:ne.startsWith(an)?ne:`${an}${ne}`)}})}}const En={id:"okta",title:"Okta",icon:()=>null},Un=new Set(["openid","profile","email","phone","address","groups","offline_access"]),mn="okta.";class un{static create(n){const{discoveryApi:o,environment:l="development",provider:f=En,oauthRequestApi:R,defaultScopes:N=["openid","email","profile","offline_access"]}=n;return Ot.create({discoveryApi:o,oauthRequestApi:R,provider:f,environment:l,defaultScopes:N,scopeTransform(V){return V.map(ne=>Un.has(ne)||ne.startsWith(mn)?ne:`${mn}${ne}`)}})}}var Qt=t(30195);const Mn=Qt.z.object({profile:Qt.z.object({email:Qt.z.string().optional(),displayName:Qt.z.string().optional(),picture:Qt.z.string().optional()}),backstageIdentity:Qt.z.object({token:Qt.z.string(),identity:Qt.z.object({type:Qt.z.literal("user"),userEntityRef:Qt.z.string(),ownershipEntityRefs:Qt.z.array(Qt.z.string())})})}),zn={id:"saml",title:"SAML",icon:()=>null};class hn{static create(n){const{discoveryApi:o,environment:l="development",provider:f=zn}=n,R=new DirectAuthConnector({discoveryApi:o,environment:l,provider:f}),N=new StaticAuthSessionManager({connector:R}),V=new AuthSessionStore({manager:N,storageKey:`${f.id}Session`,schema:samlSessionSchema});return new hn(V)}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 vn={id:"microsoft",title:"Microsoft",icon:()=>null};class yn{static create(n){const{environment:o="development",provider:l=vn,oauthRequestApi:f,discoveryApi:R,defaultScopes:N=["openid","offline_access","profile","email","User.Read"]}=n;return Ot.create({discoveryApi:R,oauthRequestApi:f,provider:l,environment:o,defaultScopes:N})}}const Ln={id:"onelogin",title:"onelogin",icon:()=>null},Pn=new Set(["openid","profile","email","phone","address","groups","offline_access"]),xn="onelogin.";class ge{static create(n){const{discoveryApi:o,environment:l="development",provider:f=Ln,oauthRequestApi:R}=n;return Ot.create({discoveryApi:o,oauthRequestApi:R,provider:f,environment:l,defaultScopes:["openid","email","profile","offline_access"],scopeTransform(N){return N.map(V=>Pn.has(V)||V.startsWith(xn)?V:`${xn}${V}`)}})}}const ee={id:"bitbucket",title:"Bitbucket",icon:()=>null};class Ee{static create(n){const{discoveryApi:o,environment:l="development",provider:f=ee,oauthRequestApi:R,defaultScopes:N=["team"]}=n;return Ot.create({discoveryApi:o,oauthRequestApi:R,provider:f,environment:l,defaultScopes:N})}}const Ne={id:"atlassian",title:"Atlassian",icon:()=>null};class _e{static create(n){const{discoveryApi:o,environment:l="development",provider:f=Ne,oauthRequestApi:R}=n;return Ot.create({discoveryApi:o,oauthRequestApi:R,provider:f,environment:l})}}class wt{post(n){this.subject.next(n)}alert$(){return this.subject}constructor(){this.subject=new Le}}class ae{captureEvent(n){}}const k="theme";class ce{static createWithStorage(n){const o=new ce(n);if(!window.localStorage)return o;var l;const f=(l=window.localStorage.getItem(k))!==null&&l!==void 0?l:void 0;return o.setActiveThemeId(f),o.activeThemeId$().subscribe(R=>{R?window.localStorage.setItem(k,R):window.localStorage.removeItem(k)}),window.addEventListener("storage",R=>{if(R.key===k){var N;const V=(N=localStorage.getItem(k))!==null&&N!==void 0?N:void 0;o.setActiveThemeId(V)}}),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 mt(void 0)}}var Oe=t(9850),D=t.n(Oe),U=t(12782),de=t.n(U);const pe=/^[a-z][a-z0-9]*(?:[-_][a-z][a-z0-9]*)*$/i;function ye(a){return typeof a=="object"&&a!==null&&!Array.isArray(a)}function Pe(a){if(a===null)return"null";if(Array.isArray(a))return"array";const n=typeof a;return n==="number"&&isNaN(a)?"nan":n==="string"&&a===""?"empty-string":n}const Re={type(a,n,o,l){return`Invalid type in config for key '${a}' in '${n}', got ${o}, wanted ${l}`},missing(a){return`Missing required config value at '${a}'`},convert(a,n,o){return`Unable to convert config value for key '${a}' in '${n}' to a ${o}`}};class Ue{static fromConfigs(n){return n.length===0?new Ue(void 0):n.reduce((o,{data:l,context:f,filteredKeys:R,deprecatedKeys:N})=>{const V=new Ue(l,f,o);if(V.filteredKeys=R,N)for(const{key:ne,description:ze}of N)console.warn(`The configuration key '${ne}' of ${f} is deprecated and may be removed soon. ${ze||""}`);return V},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(Re.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 R;return f}else if(f===void 0)return l;return de()({},{value:f},{value:l},(N,V)=>!ye(V)||!ye(N)?V:void 0).value}getConfig(n){const o=this.getOptionalConfig(n);if(o===void 0)throw new Error(Re.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(ye(l))return this.copy(l,n,f);if(l!==void 0)throw new TypeError(Re.type(this.fullKey(n),this.context,Pe(l),"object"));return f}getConfigArray(n){const o=this.getOptionalConfigArray(n);if(o===void 0)throw new Error(Re.missing(this.fullKey(n)));return o}getOptionalConfigArray(n){const o=this.readConfigValue(n,f=>{if(!Array.isArray(f))return{expected:"object-array"};for(const[R,N]of f.entries())if(!ye(N))return{expected:"object-array",value:N,key:`${n}[${R}]`};return!0});if(!o){if(!1)var l;return}return o.map((f,R)=>this.copy(f,`${n}[${R}]`))}getNumber(n){const o=this.getOptionalNumber(n);if(o===void 0)throw new Error(Re.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(Re.convert(this.fullKey(n),this.context,"number"));return l}getBoolean(n){const o=this.getOptionalBoolean(n);if(o===void 0)throw new Error(Re.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(Re.convert(this.fullKey(n),this.context,"boolean"))}getString(n){const o=this.getOptionalString(n);if(o===void 0)throw new Error(Re.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(Re.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 Ue(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 R;return(f=this.fallback)===null||f===void 0?void 0:f.readConfigValue(n,o)}const N=o(l);if(N!==!0){const{key:V=n,value:ne=l,expected:ze}=N;throw new TypeError(Re.type(this.fullKey(V),this.context,Pe(ne),ze))}return l}readValue(n){const o=n?n.split("."):[];for(const f of o)if(!pe.test(f))throw new TypeError(`Invalid config key '${n}'`);if(this.data===void 0)return;let l=this.data;for(const[f,R]of o.entries())if(ye(l))l=l[R];else if(l!==void 0){const N=this.fullKey(o.slice(0,f).join("."));throw new TypeError(Re.type(N,this.context,Pe(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 nt="Invalid discovery URL pattern,";class w{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(`${nt} URL '${l}' is invalid`)}if(f.hash)throw new Error(`${nt} URL must not have a hash`);if(f.search)throw new Error(`${nt} URL must not have a query`);if(l.endsWith("/"))throw new Error(`${nt} URL must not end with a slash`);return new w(o)}async getBaseUrl(n){return this.parts.join(n)}constructor(n){this.parts=n}}class H{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 ve{post(n,o){this.subject.next({error:n,context:o})}error$(){return this.subject}constructor(){this.subject=new Le}}class ue{static forward(n,o){window.addEventListener("unhandledrejection",l=>{n.post(l.reason,o)})}}function we(a){if(a.length<3)throw new Error(`The '${a}' feature flag must have a minimum length of three characters.`);if(a.length>150)throw new Error(`The '${a}' feature flag must not exceed 150 characters.`);if(!a.match(/^[a-z]+[a-z0-9-]+$/))throw new Error(`The '${a}' feature flag must start with a lowercase letter and only contain lowercase letters, numbers and hyphens. Examples: feature-flag-one, alpha, release-2020`)}class ke{registerFlag(n){we(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,R])=>(we(f),R===b.CL.Active));return new Map(l)}catch{return new Map}}constructor(){this.registeredFeatureFlags=[]}}function Fe(a){let n=a.baseImplementation||t.g.fetch;var o;const l=[(o=a.middleware)!==null&&o!==void 0?o:[]].flat().reverse();for(const f of l)n=f.apply(n);return{fetch:n}}class it{static create(n){var o,l;const f=Ct(n),R=((o=n.header)===null||o===void 0?void 0:o.name)||"authorization",N=((l=n.header)===null||l===void 0?void 0:l.value)||(V=>`Bearer ${V}`);return new it(n.identityApi,f,R,N)}apply(n){return async(o,l)=>{const f=new Request(o,l),{token:R}=await this.identityApi.getCredentials();return f.headers.get(this.headerName)||typeof R!="string"||!R||!this.allowUrl(f.url)?n(o,l):(f.headers.set(this.headerName,this.headerValue(R)),n(f))}}constructor(n,o,l,f){this.identityApi=n,this.allowUrl=o,this.headerName=l,this.headerValue=f}}function Ct(a){return a.allowUrl?a.allowUrl:a.urlPrefixAllowlist?Ke(a.urlPrefixAllowlist):a.config?Ke([a.config.getString("backend.baseUrl")]):()=>!1}function Ke(a){const n=a.map(o=>o.replace(/\/$/,""));return o=>n.some(l=>o===l||o.startsWith(`${l}/`))}function ht(a,n){return!n||n==="/"?a:`${a.replace(/\/$/,"")}/${n.replace(/^\//,"")}`}class vt{apply(n){return async(o,l)=>{const f=new Request(o,l),R="plugin://";if(!f.url.startsWith(R))return n(o,l);const{hostname:N,pathname:V,search:ne,hash:ze,username:Ze,password:ut}=new URL(`http://${f.url.substring(R.length)}`);let lt=await this.discoveryApi.getBaseUrl(N);if(Ze||ut){const St=new URL(lt),Bt=`${Ze}${ut?`:${ut}`:""}@`;lt=`${St.protocol}//${Bt}${St.host}${St.pathname}`}const bt=`${ht(lt,V)}${ne}${ze}`;return n(bt,typeof o=="string"||at(o)?l:o)}}constructor(n){this.discoveryApi=n}}function at(a){return typeof a=="object"&&(a==null?void 0:a.constructor)===URL}class Tt{static resolvePluginProtocol(n){return new vt(n.discoveryApi)}static injectIdentityAuth(n){return it.create(n)}constructor(){}}function Ut(a,n){for(const o of n)if(!a.has(o))return!1;return!0}function Mt(a,...n){const o=new Set(a);for(const l of n)for(const f of l)o.add(f);return o}class Wn{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=>Ut(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)=>Mt(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 mt(this.getCurrentPending())}}class Vn{createAuthRequester(n){const o=new Wn,l=this.handlerCount;return this.handlerCount++,o.pending().subscribe({next:f=>{const R=this.currentRequests.slice(),N=this.makeAuthRequest(f,n);N?R[l]=N:delete R[l],this.currentRequests=R,this.subject.next(R.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 mt([]),this.currentRequests=[],this.handlerCount=0}}const bn=new Map;class Nt{static create(n){var o;return new Nt((o=n.namespace)!==null&&o!==void 0?o:"",n.errorApi)}static addStorageEventListener(){window.addEventListener("storage",n=>{for(const[l,f]of bn.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,(R,N)=>(typeof N=="object"&&N!==null&&Object.freeze(N),N)),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 bn.has(o)||bn.set(o,new Nt(o,this.errorApi)),bn.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 Nt.hasSubscribed||(Nt.addStorageEventListener(),Nt.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(se())(l=>(this.subscribers.add(l),()=>{this.subscribers.delete(l)}))}}Nt.hasSubscribed=!1;const zt=(0,W.createContext)(void 0);function _t(){const[a]=(0,g.is)((0,r.jsx)(g.AW,{index:!0,element:(0,r.jsx)("div",{})}));return!a.index}var kn=t(16060);const Jn=(a,n)=>{try{var o,l;const f=(0,kn.fp)(n,{pathname:a}),R=(o=f==null?void 0:f.filter(V=>{var ne;return((ne=V==null?void 0:V.route.routeRefs)===null||ne===void 0?void 0:ne.size)>0}).pop())===null||o===void 0?void 0:o.route;if(!R)return{};let N;return R.routeRefs.size===1&&(N=R.routeRefs.values().next().value),{extension:"App",pluginId:((l=R.plugin)===null||l===void 0?void 0:l.getId())||"root",...N?{routeRef:N.id}:{}}}catch{return{}}},Sn=({pathname:a,search:n,hash:o})=>{const l=(0,b.z$)();return(0,W.useEffect)(()=>{l.captureEvent("navigate",`${a}${n}${o}`)},[l,a,n,o]),null},pn=({routeObjects:a})=>{const{pathname:n,search:o,hash:l}=(0,g.TH)();return(0,r.jsx)(b.fC,{attributes:Jn(n,a),children:(0,r.jsx)(Sn,{pathname:n,search:o,hash:l})})};function Hn(a){return _t()?ln(a):""}function ln(a){var n;let{pathname:o}=new URL((n=a.getOptionalString("app.baseUrl"))!==null&&n!==void 0?n:"/","http://sample.dev");return o=o.replace(/\/*$/,""),o}function On({component:a,appIdentityProxy:n,children:o}){const[l,f]=(0,W.useState)(),R=(0,b.h_)(b.Ds),N=Hn(R);return l?(n.setTarget(l,{signOutTargetUrl:N||"/"}),(0,r.jsx)(r.Fragment,{children:o})):(0,r.jsx)(a,{onSignInSuccess:f})}function Qn(a){const{Router:n,SignInPage:o}=(0,b.qD)().getComponents(),l=(0,b.h_)(b.Ds),f=ln(l),R=`${f}/*`,N=(0,W.useContext)(zt);if(!N)throw new Error("AppRouter must be rendered within the AppProvider");const{routeObjects:V,appIdentityProxy:ne}=N;return o?_t()?(0,r.jsxs)(n,{children:[(0,r.jsx)(pn,{routeObjects:V}),(0,r.jsx)(On,{component:o,appIdentityProxy:ne,children:(0,r.jsx)(g.Z5,{children:(0,r.jsx)(g.AW,{path:R,element:(0,r.jsx)(r.Fragment,{children:a.children})})})})]}):(0,r.jsxs)(n,{basename:f,children:[(0,r.jsx)(pn,{routeObjects:V}),(0,r.jsx)(On,{component:o,appIdentityProxy:ne,children:a.children})]}):(ne.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||"/"}),_t()?(0,r.jsxs)(n,{children:[(0,r.jsx)(pn,{routeObjects:V}),(0,r.jsx)(g.Z5,{children:(0,r.jsx)(g.AW,{path:R,element:(0,r.jsx)(r.Fragment,{children:a.children})})})]}):(0,r.jsxs)(n,{basename:f,children:[(0,r.jsx)(pn,{routeObjects:V}),a.children]}))}var C=t(90383),d=t(22504),y=t(69866),j=t(64279);function Y(a){const n={};for(const l in a.collectors)a.collectors.hasOwnProperty(l)&&(n[l]=a.collectors[l]());const o=[{node:W.Children.toArray(a.root),parent:void 0,contexts:{}}];for(;o.length!==0;){const{node:l,parent:f,contexts:R}=o.shift();W.Children.forEach(l,N=>{if(!(0,W.isValidElement)(N))return;const V={};for(const ne in n)if(n.hasOwnProperty(ne)){const ze=n[ne];V[ne]=ze.visit(ze.accumulator,N,f,R[ne])}for(const ne of a.discoverers){const ze=ne(N);ze&&o.push({node:ze,parent:N,contexts:V})}})}return Object.fromEntries(Object.entries(n).map(([l,f])=>[l,f.accumulator]))}function me(a,n){return()=>({accumulator:a(),visit:n})}function be(a){var n;return(n=a.props)===null||n===void 0?void 0:n.children}function De(a){var n,o;if(((n=a.props)===null||n===void 0?void 0:n.path)&&((o=a.props)===null||o===void 0?void 0:o.element)){var l;return(l=a.props)===null||l===void 0?void 0:l.element}}const pt=me(()=>new Set,(a,n)=>{const o=(0,b.IY)(n,"core.plugin");o&&a.add(o)}),Ft=a=>{const{children:n}=a,o=(0,b.h_)(b.W0),l="with"in a?o.isActive(a.with):!o.isActive(a.without);return(0,r.jsx)(r.Fragment,{children:l?n:null})};(0,b.R5)(Ft,"core.featureFlagged",!0);const en={caseSensitive:!1,path:"*",element:"match-all",routeRefs:new Set};function Bn(a){const n=a;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 Er(a,n=new Array){return W.Children.forEach(a,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})}Er(o.props.children,n)}),n}const rr=me(()=>({paths:new Map,parents:new Map,objects:new Array}),(a,n,o,l)=>{var f,R;if(l!=null&&l.isElementAncestor)return l;if((o==null?void 0:o.props.element)===n)return{...l,isElementAncestor:!0};const N=(f=n.props)===null||f===void 0?void 0:f.path,V=(0,b.IY)(n,"core.mountPoint");if(V&&N)throw new Error(`Path property may not be set directly on a routable extension "${Bn(n)}"`);var ne;const ze=(ne=l==null||(R=l.obj)===null||R===void 0?void 0:R.children)!==null&&ne!==void 0?ne:a.objects;if(N!==void 0){if(typeof N!="string")throw new Error(`Element path must be a string at "${Bn(n)}"`);const bt=N.startsWith("/")?N.slice(1):N,St=n.props.element;if((0,b.IY)(n,"core.gatherMountPoints")){var Ze;if(St)throw new Error(`Mount point gatherers may not have an element prop "${Bn(n)}"`);const Bt={path:bt,element:"gathered",routeRefs:new Set,caseSensitive:Boolean((Ze=n.props)===null||Ze===void 0?void 0:Ze.caseSensitive),children:[en],plugin:void 0};return ze.push(Bt),{obj:Bt,gatherPath:bt,routeRef:l==null?void 0:l.routeRef,gatherRouteRef:l==null?void 0:l.routeRef}}if(St){var ut;const[Bt,...jt]=Er(St);if(jt.length>0)throw new Error(`Route element with path "${N}" may not contain multiple routable extensions`);if(!Bt)return l;const{routeRef:jn,plugin:Zn}=Bt,ar={path:bt,element:"mounted",routeRefs:new Set([jn]),caseSensitive:Boolean((ut=n.props)===null||ut===void 0?void 0:ut.caseSensitive),children:[en],plugin:Zn};return ze.push(ar),a.paths.set(jn,bt),a.parents.set(jn,l==null?void 0:l.routeRef),{obj:ar,routeRef:jn!=null?jn:l==null?void 0:l.routeRef,gatherPath:bt,gatherRouteRef:l==null?void 0:l.gatherRouteRef}}}if(V){var lt;if((l==null?void 0:l.gatherPath)===void 0)throw new Error(`Routable extension "${Bn(n)}" with mount point "${V}" must be assigned a path`);return l==null||(lt=l.obj)===null||lt===void 0||lt.routeRefs.add(V),a.paths.set(V,l.gatherPath),a.parents.set(V,l==null?void 0:l.gatherRouteRef),{...l,routeRef:V}}return l}),Xn=me(()=>({paths:new Map,parents:new Map,objects:new Array}),(a,n,o,l)=>{var f,R,N;if((o==null?void 0:o.props.element)===n)return l;let V=l==null?void 0:l.obj,ne=l==null?void 0:l.routeRef,ze=l==null?void 0:l.sticky;const Ze=(f=n.props)===null||f===void 0?void 0:f.path;var ut;const lt=(ut=V==null?void 0:V.children)!==null&&ut!==void 0?ut:a.objects,bt=Boolean((R=n.props)===null||R===void 0?void 0:R.caseSensitive);let St=l==null?void 0:l.path;if((0,b.IY)(n,"core.gatherMountPoints")){if(!Ze)throw new Error("Mount point gatherer must have a path");St=Ze}const Bt=(N=n.props)===null||N===void 0?void 0:N.element;let jt=(0,b.IY)(n,"core.mountPoint");if(!jt&&(0,W.isValidElement)(Bt)&&(jt=(0,b.IY)(Bt,"core.mountPoint")),jt){let ar=Ze;if(St&&(ar?St=void 0:ar=St),!ar)throw new Error("Mounted routable extension must have a path");a.paths.set(jt,ar),ne&&ze?(a.parents.set(jt,ne),Ze&&(ne=jt,ze=!1)):(a.parents.set(jt,ne),ne=jt),Ze?(V={caseSensitive:bt,path:Ze,element:"mounted",routeRefs:new Set([jt]),children:[en],plugin:(0,b.IY)(n.props.element,"core.plugin")},lt.push(V)):V==null||V.routeRefs.add(jt)}if((0,b.IY)(n,"core.gatherMountPoints")&&(ze=!0),(0,b.IY)(n,"core.gatherMountPoints")){if(!Ze)throw new Error("Mount point gatherer must have a path");if(!jt){var Zn;V={caseSensitive:bt,path:Ze,element:"gathered",routeRefs:new Set,children:[en],plugin:l==null||(Zn=l.obj)===null||Zn===void 0?void 0:Zn.plugin},lt.push(V)}}return{obj:V,path:St,routeRef:ne,sticky:ze}}),pr=me(()=>new Set,(a,n)=>{if(n.type===Ft){const o=n.props;a.add("with"in o?o.with:o.without)}}),_n=(0,Ve.uW)("route-ref-type",()=>Symbol("route-ref-type"));function Ar(a){return a[_n]==="absolute"}function Yr(a){return a[_n]==="sub"}function fr(a){return a[_n]==="external"}function Tr(...a){const n=a.join("/").replace(/\/\/+/g,"/");return n!=="/"&&n.endsWith("/")?n.slice(0,-1):n}function ps(a,n,o){let l,f="";if(Ar(a))l=a;else if(Yr(a))l=a.parent,f=a.path;else if(fr(a)){const V=o.get(a);if(!V)return[void 0,""];if(Ar(V))l=V;else if(Yr(V))l=V.parent,f=V.path;else throw new Error(`ExternalRouteRef was bound to invalid target, ${V}`)}else throw a[_n]?new Error(`Unknown or invalid route ref type, ${a[_n]}`):new Error(`Unknown object passed to useRouteRef, got ${a}`);if(!l)return[void 0,""];const R=n.get(l);if(R===void 0)return[void 0,""];const N=Tr(R,f);return[l,N]}function Dr(a,n,o,l,f){var R;const N=(R=(0,kn.fp)(f,n))!==null&&R!==void 0?R:[],V=Array();let ne=-1;for(let ut=a;ut&&(ne=N.findIndex(lt=>lt.route.routeRefs.has(ut)),ne===-1);ut=l.get(ut))V.unshift(ut);V.length===0&&(ne-=1);const ze=ne===-1?"":N[ne].pathname,Ze=V.slice(0,-1).map(ut=>{const lt=o.get(ut);if(lt===void 0)throw new Error(`No path for ${ut}`);if(lt.includes(":"))throw new Error(`Cannot route to ${a} with parent ${ut} as it has parameters`);return lt});return`${Tr(ze,...Ze)}/`}class er{resolve(n,o){const[l,f]=ps(n,this.routePaths,this.routeBindings);if(!l)return;let R;typeof o=="string"?R=this.trimPath(o):o.pathname?R={...o,pathname:this.trimPath(o.pathname)}:R=o;const N=this.appBasePath+Dr(l,R,this.routePaths,this.routeParents,this.routeObjects);return(...[ne])=>Tr(N,(0,kn.Gn)(f,ne))}trimPath(n){return n&&(n.startsWith(this.appBasePath)?n.slice(this.appBasePath.length):n)}constructor(n,o,l,f,R){this.routePaths=n,this.routeParents=o,this.routeObjects=l,this.routeBindings=f,this.appBasePath=R}}const Ir=(0,Ve.CT)("routing-context"),Nr=({routePaths:a,routeParents:n,routeObjects:o,routeBindings:l,basePath:f="",children:R})=>{const N=new er(a,n,o,l,f),V=(0,Ve.EI)({1:N});return(0,r.jsx)(Ir.Provider,{value:V,children:R})};function fs(a,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,R="";for(;f;){const V=a.get(f);if(V===void 0)throw new Error(`No path for ${f}`);R=Tr(V,R),f=n.get(f)}const N=R.match(/:(\w+)/g);if(N){for(let V=0;V<N.length;V++)for(let ne=V+1;ne<N.length;ne++)if(N[ne]===N[V])throw new Error(`Parameter ${N[ne]} is duplicated in path ${R}`)}}}function Fr(a,n){for(const o of n)if(!!o.externalRoutes){for(const[l,f]of Object.entries(o.externalRoutes))if(!f.optional&&!a.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 Jr=(0,Ve.CT)("app-context"),Qr=({appContext:a,children:n})=>{const o=(0,Ve.EI)({1:a});return(0,r.jsx)(Jr.Provider,{value:o,children:n})};function sr(a){return new Error(`Tried to access IdentityApi ${a} before app was loaded`)}function gr(a){console.warn(`WARNING: Call to ${a} is deprecated and will break in the future`)}class Fs{setTarget(n,o){this.target=n,this.signOutTargetUrl=o.signOutTargetUrl,this.resolveTarget(n)}getUserId(){if(!this.target)throw sr("getUserId");if(!this.target.getUserId)throw new Error("IdentityApi does not implement getUserId");return gr("getUserId"),this.target.getUserId()}getProfile(){if(!this.target)throw sr("getProfile");if(!this.target.getProfile)throw new Error("IdentityApi does not implement getProfile");return gr("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 gr("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 gs=t(72164);function Xr(a,n,o){if(a!==void 0){const f=o.find(R=>R.id===a);if(f)return f}if(n){const f=o.find(R=>R.variant==="dark");if(f)return f}const l=o.find(f=>f.variant==="light");return l||o[0]}const Us=()=>{const a=(0,W.useMemo)(()=>window.matchMedia("(prefers-color-scheme: dark)"),[]),[n,o]=(0,W.useState)(a.matches);return(0,W.useEffect)(()=>{const l=f=>{o(f.matches)};return a.addListener(l),()=>{a.removeListener(l)}},[a]),n};function ms({children:a}){const n=(0,b.h_)(b.hg),o=(0,gs.Z)(n.activeThemeId$(),n.getActiveThemeId()),l=Boolean(window.matchMedia)?Us():!1,f=Xr(o,l,n.getInstalledThemes());if(!f)throw new Error("App has no themes");return(0,r.jsx)(f.Provider,{children:a})}const qr=async(a="__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(a!=="__app_injected_runtime_config__".toLocaleUpperCase("en-US"))try{const f=JSON.parse(a);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 Ms{add(n,o){return this.apis.push([n.id,o]),o}build(){return new dr(new Map(this.apis))}constructor(){this.apis=[]}}class dr{static builder(){return new Ms}static from(n){return new dr(new Map(n.map(([o,l])=>[o.id,l])))}static with(n,o){return new dr(new Map([[n.id,o]]))}with(n,o){return new dr(new Map([...this.apis,[n.id,o]]))}get(n){return this.apis.get(n.id)}constructor(n){this.apis=n}}function vs(a){const n=new Map;return a&&a({bind:(l,f)=>{for(const[R,N]of Object.entries(f)){const V=l[R];if(!V)throw new Error(`Key ${R} is not an existing external route`);if(!N&&!V.optional)throw new Error(`External route ${R} is required but was undefined`);N&&n.set(V,N)}}}),n}function ys(a,n,o){var l;const f=Boolean(a),R=(0,j.default)(a||(()=>Promise.resolve([])));let N;if(f&&R.loading){const{Progress:ze}=n;N=(0,r.jsx)(ze,{})}else if(R.error){const{BootErrorPage:ze}=n;N=(0,r.jsx)(ze,{step:"load-config",error:R.error})}const{ThemeProvider:V=ms}=n;if(N)return{node:(0,r.jsx)(je,{apis:dr.with(b.hg,o),children:(0,r.jsx)(V,{children:N})})};let ne;if(!((l=R.value)===null||l===void 0)&&l.length){const ze=Ue.fromConfigs(R.value),Ze=jt=>new URL(jt).origin,ut=jt=>new URL(jt.replace(Ze(jt),""),document.location.origin).href.replace(/\/$/,""),lt=ze.getOptionalString("app.baseUrl"),bt=ze.getOptionalString("backend.baseUrl");let St=R.value;const Bt={data:{},context:"relative-resolver"};if(lt&&bt){const jt=Ze(lt),jn=Ze(bt);if(jt===jn){const Zn=ut(bt);bt!==Zn&&(Bt.data.backend={baseUrl:Zn})}}if(lt){const jt=ut(lt);lt!==jt&&(Bt.data.app={baseUrl:jt})}Object.keys(Bt.data).length&&(St=St.concat([Bt])),ne=Ue.fromConfigs(St)}else ne=Ue.fromConfigs([]);return{api:ne}}class _r{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 or=new WeakMap;class mr{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,C.Z)(this,or))throw new Error("app.getProvider() or app.createRoot() has already been called, and can only be called once");(0,y.Z)(this,or,!0);const n=new _r(this);let o=!1;return({children:f})=>{const R=(0,W.useRef)(!0),N=(0,W.useMemo)(()=>ce.createWithStorage(this.themes),[]),{routing:V,featureFlags:ne,routeBindings:ze}=(0,W.useMemo)(()=>{const bt=Y({root:f,discoverers:[be,De],collectors:{routing:_t()?Xn:rr,collectedPlugins:pt,featureFlags:pr}});return bt.collectedPlugins.forEach(St=>this.plugins.add(St)),this.verifyPlugins(this.plugins),this.getApiHolder(),{...bt,routeBindings:vs(this.bindRoutes)}},[f]);o||(o=!0,fs(V.paths,V.parents),Fr(ze,this.plugins));const Ze=ys(this.configLoader,this.components,N),ut="api"in Ze;if(ut){const{api:bt}=Ze;this.configApi=bt}if("node"in Ze)return Ze.node;if(ut&&R.current){R.current=!1;const bt=this.getApiHolder().get(b.W0);if(bt){for(const jt of this.plugins.values())if("getFeatureFlags"in jt)for(const jn of jt.getFeatureFlags())bt.registerFlag({name:jn.name,pluginId:jt.getId()});else for(const jn of jt.output())jn.type==="feature-flag"&&bt.registerFlag({name:jn.name,pluginId:jt.getId()});const St=bt.getRegisteredFlags(),Bt=new Set(St.map(jt=>jt.name));for(const jt of ne)Bt.has(jt)||bt.registerFlag({name:jt,pluginId:""})}}const{ThemeProvider:lt=ms}=this.components;return(0,r.jsx)(je,{apis:this.getApiHolder(),children:(0,r.jsx)(Qr,{appContext:n,children:(0,r.jsx)(lt,{children:(0,r.jsx)(Nr,{routePaths:V.paths,routeParents:V.parents,routeObjects:V.objects,routeBindings:ze,basePath:Hn(Ze.api),children:(0,r.jsx)(zt.Provider,{value:{routeObjects:V.objects,appIdentityProxy:this.appIdentityProxy},children:f})})})})})}}getRouter(){return Qn}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 Ge.validateFactories(this.apiFactoryRegistry,this.apiFactoryRegistry.getAllApis()),this.apiHolder}this.apiFactoryRegistry.register("static",{api:b.hg,deps:{},factory:()=>ce.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 ke});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 Ge.validateFactories(this.apiFactoryRegistry,this.apiFactoryRegistry.getAllApis()),this.apiHolder=new Ge(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 Fs,(0,d.Z)(this,or,{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:[]),this.components=n.components,this.themes=n.themes;var f;this.configLoader=(f=n.configLoader)!==null&&f!==void 0?f:qr;var R;this.defaultApis=(R=n.defaultApis)!==null&&R!==void 0?R:[],this.bindRoutes=n.bindRoutes,this.apiFactoryRegistry=new gt}}function xs(a){return new mr(a)}let es=!1;const ts=a=>{const n=(0,b.qD)(),{NotFoundErrorPage:o}=n.getComponents(),l=(0,W.useMemo)(()=>_t(),[]),R=[...(0,b.vJ)(a.children,N=>N.getElements().flatMap(V=>{let ne=V.props.path;if(ne==="")return[];var ze;ne=(ze=ne==null?void 0:ne.replace(/\/\*$/,""))!==null&&ze!==void 0?ze:"/";let Ze=l?V:V.props.element;return!l&&!Ze&&(Ze=V,es||(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] />} />."),es=!0)),[{path:ne,element:Ze,children:V.props.children?[{path:ne==="/"?"/":"*",element:V.props.children}]:void 0}]}).sort((V,ne)=>ne.path.localeCompare(V.path)).map(V=>({...V,path:V.path==="/"?"/":`${V.path}/*`}))),{path:"*",element:(0,r.jsx)(o,{})}];return(0,g.V$)(R)};var Ur=t(25488);const ns=[(0,b.ni)({api:b.NW,deps:{configApi:b.Ds},factory:({configApi:a})=>w.compile(`${a.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:a})=>{const n=new H(a,new ve);return ue.forward(n,{hidden:!1}),n}}),(0,b.ni)({api:b.E6,deps:{errorApi:b.VE},factory:({errorApi:a})=>Nt.create({errorApi:a})}),(0,b.ni)({api:b.gP,deps:{configApi:b.Ds,identityApi:b.$4,discoveryApi:b.NW},factory:({configApi:a,identityApi:n,discoveryApi:o})=>Fe({middleware:[Tt.resolvePluginProtocol({discoveryApi:o}),Tt.injectIdentityAuth({identityApi:n,config:a})]})}),(0,b.ni)({api:b.ZM,deps:{},factory:()=>new Vn}),(0,b.ni)({api:b.Kp,deps:{discoveryApi:b.NW,oauthRequestApi:b.ZM,configApi:b.Ds},factory:({discoveryApi:a,oauthRequestApi:n,configApi:o})=>Fn.create({discoveryApi:a,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:a,oauthRequestApi:n,configApi:o})=>yn.create({discoveryApi:a,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:a,oauthRequestApi:n,configApi:o})=>Vt.create({discoveryApi:a,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:a,oauthRequestApi:n,configApi:o})=>un.create({discoveryApi:a,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:a,oauthRequestApi:n,configApi:o})=>Jt.create({discoveryApi:a,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:a,oauthRequestApi:n,configApi:o})=>ge.create({discoveryApi:a,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:a,oauthRequestApi:n,configApi:o})=>Ee.create({discoveryApi:a,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:a,oauthRequestApi:n,configApi:o})=>_e.create({discoveryApi:a,oauthRequestApi:n,environment:o.getOptionalString("auth.environment")})}),(0,b.ni)({api:Ur.RV,deps:{discovery:b.NW,identity:b.$4,config:b.Ds},factory:({config:a,discovery:n,identity:o})=>Ur.iM.create({config:a,discovery:n,identity:o})})];var An=t(77277),Wt=t(93414),bs=t(39857);function Ss({children:a}){return(0,g.GV)()?(0,r.jsx)(r.Fragment,{children:a}):(0,r.jsx)(g.VA,{children:a})}const ws=()=>(0,r.jsx)(Wt.mf,{status:"404",statusMessage:"PAGE NOT FOUND"}),Cs=({step:a,error:n})=>{let o="";return a==="load-config"?o=`The configuration failed to load, someone should have a look at this error: ${n.message}`:a==="load-chunk"&&(o=`Lazy loaded chunk failed to load, try to reload the page: ${n.message}`),(0,r.jsx)(Ss,{children:(0,r.jsx)(Wt.mf,{status:"501",statusMessage:o})})},js=({error:a,resetError:n,plugin:o})=>(0,r.jsx)(Wt.yu,{title:`Error in ${o==null?void 0:o.getId()}`,defaultExpanded:!0,error:a,children:(0,r.jsx)(An.Z,{variant:"outlined",onClick:n,children:"Retry"})}),Es={Progress:Wt.Ex,Router:bs.VK,NotFoundErrorPage:ws,BootErrorPage:Cs,ErrorBoundaryFallback:js};var rs=t(43642),Rr=t(80079),zs=t(90941),As=t(32915),Ts=t(40562),v=t(21853),x=t(60744),I=t(66569),$=t(30254),J=t(13384),K=t(15933),oe=t(58838),le=t(86737),Se=t(4989),Be=t(44407),$e=t(18628),Ae=t(84219),Je=t(98685),xt=t(39781);const It={brokenImage:Rr.Z,catalog:$e.Z,scaffolder:As.Z,techdocs:Ts.Z,search:v.Z,chat:x.Z,dashboard:I.Z,docs:$.Z,email:J.Z,github:oe.Z,group:Ae.Z,help:le.Z,"kind:api":K.Z,"kind:component":Be.Z,"kind:domain":rs.Z,"kind:group":Ae.Z,"kind:location":Se.Z,"kind:system":zs.Z,"kind:user":Je.Z,user:Je.Z,warning:xt.Z};var et=t(73689),$t=t(48032);const Dt={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")`},fn={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 rn(a){const{colors:n,shape:o,options:l}=a,R=`linear-gradient(90deg, ${(n.length===1?[n[0],n[0]]:n).join(", ")})`,N=`${o}, ${R}`;var V;const ne=(V=l==null?void 0:l.fontColor)!==null&&V!==void 0?V:"#FFFFFF";return{colors:n,shape:o,backgroundImage:N,fontColor:ne}}const tr={home:rn({colors:fn.teal,shape:Dt.wave}),documentation:rn({colors:fn.pinkSea,shape:Dt.wave2}),tool:rn({colors:fn.purpleSky,shape:Dt.round}),service:rn({colors:fn.marineBlue,shape:Dt.wave}),website:rn({colors:fn.veryBlue,shape:Dt.wave}),library:rn({colors:fn.rubyRed,shape:Dt.wave}),other:rn({colors:fn.darkGrey,shape:Dt.wave}),app:rn({colors:fn.toastyOrange,shape:Dt.wave}),apis:rn({colors:fn.teal,shape:Dt.wave2}),card:rn({colors:fn.greens,shape:Dt.wave})},wn=16,Tn='"Helvetica Neue", Helvetica, Roboto, Arial, sans-serif';function In(a){const{palette:n,htmlFontSize:o=wn,fontFamily:l=Tn,defaultPageTheme:f,pageTheme:R=tr}=a;if(!R[f])throw new Error(`${f} is not defined in pageTheme.`);var N;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:R[f],getPageTheme:({themeId:V})=>(N=R[V])!==null&&N!==void 0?N:R[f]}}function Lr(a){return{MuiCssBaseline:{"@global":{html:{height:"100%",fontFamily:a.typography.fontFamily},body:{height:"100%",fontFamily:a.typography.fontFamily,"overscroll-behavior-y":"none"},a:{color:"inherit",textDecoration:"none"}}},MuiTableRow:{root:{"&:nth-of-type(odd)":{backgroundColor:a.palette.background.default}},hover:{"&:hover":{cursor:"pointer"}},head:{"&:nth-of-type(odd)":{backgroundColor:a.palette.background.paper}}},MuiTableCell:{root:{wordBreak:"break-word",overflow:"hidden",verticalAlign:"middle",lineHeight:"1",margin:0,padding:a.spacing(3,2,3,2.5),borderBottom:0},sizeSmall:{padding:a.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:a.palette.link,minHeight:24,textTransform:"initial",letterSpacing:"0.07em","&:hover":{color:(0,$t.darken)(a.palette.link,.3),background:(0,$t.lighten)(a.palette.link,.95)},[a.breakpoints.up("md")]:{minWidth:120,fontSize:a.typography.pxToRem(14),fontWeight:500}},textColorPrimary:{color:a.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:a.spacing(1),marginBottom:a.spacing(1),color:a.palette.grey[900]},outlined:{color:a.palette.text.primary},label:{lineHeight:`${a.spacing(2.5)}px`,fontWeight:a.typography.fontWeightMedium,fontSize:`${a.spacing(1.75)}px`},labelSmall:{fontSize:`${a.spacing(1.5)}px`},deleteIcon:{color:a.palette.grey[500],width:`${a.spacing(3)}px`,height:`${a.spacing(3)}px`,margin:`0 ${a.spacing(.75)}px 0 -${a.spacing(.75)}px`},deleteIconSmall:{width:`${a.spacing(2)}px`,height:`${a.spacing(2)}px`,margin:`0 ${a.spacing(.5)}px 0 -${a.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 Pr(a){const n=In(a),o=(0,et.Z)(n),l=Lr(o);return{...o,overrides:l}}var kr=t(34505);const Rn=Pr({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:kr.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:tr}),$n=Pr({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:kr.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:tr});var vr=t(98192),bo=t(15222),So=t(41547),Ws=t(87561);const di=[{id:"light",title:"Light Theme",variant:"light",icon:(0,r.jsx)(bo.Z,{}),Provider:({children:a})=>(0,r.jsx)(So.Z,{theme:Rn,children:(0,r.jsx)(Ws.ZP,{children:a})})},{id:"dark",title:"Dark Theme",variant:"dark",icon:(0,r.jsx)(vr.Z,{}),Provider:({children:a})=>(0,r.jsx)(So.Z,{theme:$n,children:(0,r.jsx)(Ws.ZP,{children:a})})}];function Or(a){var n,o,l;return xs({...a,apis:(n=a==null?void 0:a.apis)!==null&&n!==void 0?n:[],bindRoutes:a==null?void 0:a.bindRoutes,components:{...Es,...a==null?void 0:a.components},configLoader:a==null?void 0:a.configLoader,defaultApis:ns,icons:{...It,...a==null?void 0:a.icons},plugins:(o=a==null?void 0:a.plugins)!==null&&o!==void 0?o:[],themes:(l=a==null?void 0:a.themes)!==null&&l!==void 0?l:di})}var Vs=t(25271),wo=t(76635);async function ui({storageApi:a}){const n=a.forBucket("settings"),o=a.forBucket("starredEntities"),l=n.snapshot("starredEntities").value;if(!(0,wo.isArray)(l))return;var f;const R=new Set((f=o.snapshot("entityRefs").value)!==null&&f!==void 0?f:[]);l.filter(wo.isString).map(N=>N.split(":")).filter(N=>N.length===4&&N[0]==="entity").map(([N,V,ne,ze])=>(0,Vs.eE)({kind:V,namespace:ne,name:ze})).forEach(N=>R.add(N)),await o.set("entityRefs",Array.from(R)),await n.remove("starredEntities")}class hi{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(se())(l=>(l.next(new Set(this.starredEntities)),this.subscribers.add(l),()=>{this.subscribers.delete(l)})),ui(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 ta=t(33414),Br=t(79692),pi=t(12420),Cn=t(92848),fi=t(19928);function gi(){const a=useApi(catalogApiRef),{error:n,loading:o,value:l}=useAsync(async()=>await a.getEntityFacets({facets:["kind"]}).then(R=>{var N;return((N=R.facets.kind)===null||N===void 0?void 0:N.map(V=>V.value).sort())||[]}),[a]);return{loading:o,error:n,allKinds:l!=null?l:[]}}function mi(a,n,o){let l=a;return n&&(l=l.filter(R=>n.some(N=>N.toLocaleLowerCase("en-US")===R.toLocaleLowerCase("en-US")))),o&&!a.some(R=>R.toLocaleLowerCase("en-US")===o.toLocaleLowerCase("en-US"))&&(l=l.concat([o])),l.sort().reduce((R,N)=>(R[N.toLocaleLowerCase("en-US")]=N,R),{})}const Co=(0,Br.Z)(a=>(0,pi.Z)({root:{...a.typography.h4}}));function vi(a){var n;const{initialFilter:o="component",allowedKinds:l}=a,f=Co(),{allKinds:R}=useAllKinds(),{filters:N,updateFilters:V,queryParameters:{kind:ne}}=useEntityList(),ze=useMemo(()=>[ne].flat()[0],[ne]);var Ze;const[ut,lt]=useState((Ze=ze!=null?ze:(n=N.kind)===null||n===void 0?void 0:n.value)!==null&&Ze!==void 0?Ze:o);useEffect(()=>{ze&<(ze)},[ze]),useEffect(()=>{var St;if(!((St=N.kind)===null||St===void 0)&&St.value){var Bt;lt((Bt=N.kind)===null||Bt===void 0?void 0:Bt.value)}},[N.kind]),useEffect(()=>{V({kind:ut?new EntityKindFilter(ut):void 0})},[ut,V]);const bt=filterKinds(R,l,ut);return _jsx(Select,{input:_jsx(InputBase,{}),value:ut.toLocaleLowerCase("en-US"),onChange:St=>lt(St.target.value),classes:f,children:Object.keys(bt).map(St=>_jsx(MenuItem,{value:St,children:`${pluralize(bt[St])}`},St))})}var yi=t(65826);const xi=(0,Br.Z)({flexContainer:{flexWrap:"wrap"},itemText:{width:"100%",wordBreak:"break-all",marginBottom:"1rem"}});function na(a){const n=a.result,o=a.highlight,l=xi(),f=useAnalytics(),R=()=>{f.captureEvent("discover",n.title,{attributes:{to:n.location},value:a.rank})};return _jsxs(_Fragment,{children:[_jsxs(ListItem,{alignItems:"flex-start",children:[a.icon&&_jsx(ListItemIcon,{children:a.icon}),_jsxs("div",{className:l.flexContainer,children:[_jsx(ListItemText,{className:l.itemText,primaryTypographyProps:{variant:"h6"},primary:_jsx(Link,{noTrack:!0,to:n.location,onClick:R,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),Hs=t(95544),Gs=t(99688),ss=t(12231),Mr=t(86136),zr=t(49378),Eo=t(85256),Ks=t(61837),Is=t(79784),Ao=t(50758),To=t(31654),Io=t(43054),bi=t(65759),yr=t(51666);const Rs="catalog-entity",Ys=(0,yr.J$)({name:"catalog.entity.read",attributes:{action:"read"},resourceType:Rs}),Ro=(0,yr.J$)({name:"catalog.entity.create",attributes:{action:"create"}}),Ls=(0,yr.J$)({name:"catalog.entity.delete",attributes:{action:"delete"},resourceType:Rs}),Lo=(0,yr.J$)({name:"catalog.entity.refresh",attributes:{action:"update"},resourceType:Rs}),Js=(0,yr.J$)({name:"catalog.location.read",attributes:{action:"read"}}),Qs=(0,yr.J$)({name:"catalog.location.create",attributes:{action:"create"}}),Po=(0,yr.J$)({name:"catalog.location.delete",attributes:{action:"delete"}}),ra=[Ys,Ro,Ls,Lo,Js,Qs,Po];var ko=t(49166);function Xs(a){const{unregisterEntityOptions:n,isUnregisterAllowed:o,onUnregisterEntity:l,onClose:f}=a,R=typeof(n==null?void 0:n.disableUnregister)=="boolean";var N;const V=(N=!o||(R?!!(n!=null&&n.disableUnregister):(n==null?void 0:n.disableUnregister)==="disable"))!==null&&N!==void 0?N:!1;let ne=(0,r.jsx)(r.Fragment,{});return(n==null?void 0:n.disableUnregister)!=="hidden"&&(ne=(0,r.jsxs)(ss.Z,{onClick:()=>{f(),l()},disabled:V,children:[(0,r.jsx)(Mr.Z,{children:(0,r.jsx)(ko.Z,{fontSize:"small"})}),(0,r.jsx)(zr.Z,{primary:"Unregister entity"})]})),(0,r.jsx)(r.Fragment,{children:ne})}const Oo=(0,Br.Z)(a=>({button:{color:a.page.fontColor}}),{name:"PluginCatalogEntityContextMenu"});function qn(a){const{UNSTABLE_extraContextMenuItems:n,UNSTABLE_contextMenuOptions:o,onUnregisterEntity:l,onInspectEntity:f}=a,[R,N]=(0,W.useState)(),V=Oo(),ze=(0,Cn.N$)(Ls).allowed,Ze=Bt=>{N(Bt.currentTarget)},ut=()=>{N(void 0)},lt=(0,b.h_)(b.$v),bt=(0,W.useCallback)(()=>{window.navigator.clipboard.writeText(window.location.toString()).then(()=>lt.post({message:"Copied!",severity:"info"}))},[lt]),St=n&&[...n.map(Bt=>(0,r.jsxs)(ss.Z,{onClick:()=>{ut(),Bt.onClick()},children:[(0,r.jsx)(Mr.Z,{children:(0,r.jsx)(Bt.Icon,{fontSize:"small"})}),(0,r.jsx)(zr.Z,{primary:Bt.title})]},Bt.title)),(0,r.jsx)(Eo.Z,{},"the divider is here!")];return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(Ks.Z,{"aria-label":"more","aria-controls":"long-menu","aria-haspopup":"true","aria-expanded":!!R,role:"button",onClick:Ze,"data-testid":"menu-button",className:V.button,id:"long-menu",children:(0,r.jsx)(Io.Z,{})}),(0,r.jsx)(Is.ZP,{open:Boolean(R),onClose:ut,anchorEl:R,anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"},"aria-labelledby":"long-menu",children:(0,r.jsxs)(Ao.Z,{children:[St,(0,r.jsx)(Xs,{unregisterEntityOptions:o,isUnregisterAllowed:ze,onUnregisterEntity:l,onClose:ut}),(0,r.jsxs)(ss.Z,{onClick:()=>{ut(),f()},children:[(0,r.jsx)(Mr.Z,{children:(0,r.jsx)(To.Z,{fontSize:"small"})}),(0,r.jsx)(zr.Z,{primary:"Inspect entity"})]}),(0,r.jsxs)(ss.Z,{onClick:()=>{ut(),bt()},children:[(0,r.jsx)(Mr.Z,{children:(0,r.jsx)(bi.Z,{fontSize:"small"})}),(0,r.jsx)(zr.Z,{primary:"Copy entity URL"})]})]})})]})}const Bo="plugin.catalog.entityLayoutRoute",_s=()=>null;(0,b.R5)(_s,Bo,!0),(0,b.R5)(_s,"core.gatherMountPoints",!0);function Si(a){const{entity:n,title:o}=a;return(0,r.jsxs)(Hs.Z,{display:"inline-flex",alignItems:"center",height:"1em",maxWidth:"100%",children:[(0,r.jsx)(Hs.Z,{component:"span",textOverflow:"ellipsis",whiteSpace:"nowrap",overflow:"hidden",children:o}),n&&(0,r.jsx)(Cn.LH,{entity:n})]})}function wi(a,n,o,l){var f;const R=(f=a!=null?a:l==null?void 0:l.kind)!==null&&f!==void 0?f:"";var N;const V=(N=n!=null?n:l==null?void 0:l.metadata.namespace)!==null&&N!==void 0?N:"";var ne,ze,Ze;return{headerTitle:`${(Ze=(ze=(ne=l==null?void 0:l.metadata.title)!==null&&ne!==void 0?ne:o)!==null&&ze!==void 0?ze:l==null?void 0:l.metadata.name)!==null&&Ze!==void 0?Ze:""}${V&&V!==Vs.zG?` in ${V}`:""}`,headerType:(()=>{let lt=R.toLocaleLowerCase("en-US");return l&&l.spec&&"type"in l.spec&&(lt+=" \u2014 ",lt+=l.spec.type.toLocaleLowerCase("en-US")),lt})()}}function Ci(a){var n;const{entity:o}=a,l=(0,Cn.hF)(o,Vs.S4);return(0,r.jsxs)(r.Fragment,{children:[l.length>0&&(0,r.jsx)(Wt.i9,{label:"Owner",value:(0,r.jsx)(Cn.rI,{entityRefs:l,defaultKind:"Group",color:"inherit"})}),((n=o.spec)===null||n===void 0?void 0:n.lifecycle)&&(0,r.jsx)(Wt.i9,{label:"Lifecycle",value:o.spec.lifecycle})]})}const ji=a=>{var n,o;const{UNSTABLE_extraContextMenuItems:l,UNSTABLE_contextMenuOptions:f,children:R,NotFoundComponent:N}=a,{kind:V,namespace:ne,name:ze}=(0,b.Oi)(Cn.wi),{entity:Ze,loading:ut,error:lt}=(0,Cn.ce)(),bt=(0,g.TH)(),St=(0,b.vJ)(R,Oi=>Oi.selectByComponentData({key:Bo,withStrictError:"Child of EntityLayout must be an EntityLayout.Route"}).getElements().flatMap(({props:Vr})=>{if(Ze){if(Vr.if&&!Vr.if(Ze))return[]}else return[];return[{path:Vr.path,title:Vr.title,children:Vr.children,tabProps:Vr.tabProps}]}),[Ze]),{headerTitle:Bt,headerType:jt}=wi(V,ne,ze,Ze),[jn,Zn]=(0,W.useState)(!1),[ar,cs]=(0,W.useState)(!1),go=(0,g.s0)(),ei=async()=>{Zn(!1),cs(!1),go("/")};(0,W.useEffect)(()=>{Zn(!1),cs(!1)},[bt.pathname]);var ds;return(0,r.jsxs)(Wt.T3,{themeId:(ds=Ze==null||(n=Ze.spec)===null||n===void 0||(o=n.type)===null||o===void 0?void 0:o.toString())!==null&&ds!==void 0?ds:"home",children:[(0,r.jsx)(Wt.h4,{title:(0,r.jsx)(Si,{title:Bt,entity:Ze}),pageTitleOverride:Bt,type:jt,children:Ze&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(Ci,{entity:Ze}),(0,r.jsx)(qn,{UNSTABLE_extraContextMenuItems:l,UNSTABLE_contextMenuOptions:f,onUnregisterEntity:()=>Zn(!0),onInspectEntity:()=>cs(!0)})]})}),ut&&(0,r.jsx)(Wt.Ex,{}),Ze&&(0,r.jsx)(Wt.tn,{routes:St}),lt&&(0,r.jsx)(Wt.VY,{children:(0,r.jsx)(Gs.Z,{severity:"error",children:lt.toString()})}),!ut&&!lt&&!Ze&&(0,r.jsx)(Wt.VY,{children:N||(0,r.jsxs)(Wt.GB,{title:"Entity not found",children:["There is no ",V," with the requested"," ",(0,r.jsx)(Wt.rU,{to:"https://backstage.io/docs/features/software-catalog/references",children:"kind, namespace, and name"}),"."]})}),(0,r.jsx)(Cn.pp,{open:jn,entity:Ze,onConfirm:ei,onClose:()=>Zn(!1)}),(0,r.jsx)(Cn.U_,{open:ar,entity:Ze,onClose:()=>cs(!1)})]})};ji.Route=_s;var sa=t(23054);function oa(a){const{open:n,onClose:o,onConfirm:l,entity:f}=a,[R,N]=useState(!1),V=useApi(catalogApiRef),ne=useApi(alertApiRef),ze=async()=>{N(!0);try{const Ze=f.metadata.uid;await V.removeEntityByUid(Ze),l()}catch(Ze){assertError(Ze),ne.post({message:Ze.message})}finally{N(!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:R,onClick:ze,children:"Delete"}),_jsx(Button,{onClick:o,color:"primary",children:"Cancel"})]})]})}var xr=t(19625);function ia(a){var n,o;return(a==null||(n=a.metadata)===null||n===void 0||(o=n.annotations)===null||o===void 0?void 0:o["backstage.io/orphan"])==="true"}function aa(){const a=useNavigate(),n=useRouteRef(rootRouteRef),[o,l]=useState(!1),{entity:f}=useEntity(),R=async()=>{l(!1),a(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:R,onClose:()=>l(!1)})]})}var $o=t(29644);const Zo=a=>a.error&&a.level==="error"&&a.type===ENTITY_STATUS_CATALOG_PROCESSING_TYPE;async function os(a,n){return{items:(await n.getEntityAncestors({entityRef:a})).items.map(f=>{var R,N;return{errors:((N=(R=f.entity.status)===null||R===void 0?void 0:R.items)!==null&&N!==void 0?N:[]).filter(Zo).map(ze=>ze.error).filter(ze=>Boolean(ze)),entity:f.entity}}).filter(f=>f.errors.length>0)}}async function Ei(a,n){const o=n.apis.get(catalogApiRef);if(!o)throw new Error(`No implementation available for ${catalogApiRef}`);return(await os(stringifyEntityRef(a),o)).items.length>0}function Ai(){const{entity:a}=useEntity(),n=stringifyEntityRef(a),o=useApi(catalogApiRef),{loading:l,error:f,value:R}=useAsync(async()=>os(n,o),[n,o]);return f?_jsx(Box,{mb:1,children:_jsx(ResponseErrorPanel,{error:f})}):l||!R?null:_jsx(_Fragment,{children:R.items.map((N,V)=>_jsxs(Box,{mb:1,children:[stringifyEntityRef(a)!==stringifyEntityRef(N.entity)&&_jsxs(Box,{p:1,children:["The error below originates from"," ",_jsx(EntityRefLink,{entityRef:N.entity})]}),N.errors.map((ne,ze)=>_jsx(ResponseErrorPanel,{error:ne},ze))]},V))})}const eo="core.backstage.entitySwitch",is=a=>null;(0,b.R5)(is,eo,!0);const Ps=a=>{var n;const{entity:o,loading:l}=(0,Cn.ce)(),f=(0,b.I_)(),R=(0,b.vJ)(a.children,ne=>ne.selectByComponentData({key:eo,withStrictError:"Child of EntitySwitch is not an EntitySwitch.Case"}).getElements().flatMap(ze=>{if(l)return[];const{if:Ze,children:ut}=ze.props;if(!o)return[{if:Ze===void 0,children:ut}];var lt;return[{if:(lt=Ze==null?void 0:Ze(o,{apis:f}))!==null&<!==void 0?lt:!0,children:ut}]}),[f,o,l]);if(R.some(ne=>typeof ne.if=="object"&&"then"in ne.if))return(0,r.jsx)(as,{results:R});var V;return(V=(n=R.find(ne=>ne.if))===null||n===void 0?void 0:n.children)!==null&&V!==void 0?V:null};function as({results:a}){const{loading:n,value:o}=(0,j.default)(async()=>{const l=a.map(async({if:R,children:N})=>{try{if(await R)return N}catch{}return null});var f;return(f=(await Promise.all(l)).find(Boolean))!==null&&f!==void 0?f:null},[a]);return n||!o?null:o}Ps.Case=is;const Do=null,No=Cn._i.Filters,ur=Cn._i.Content,Kn=(0,b.rx)({id:"catalog",apis:[(0,b.ni)({api:Cn.Ah,deps:{discoveryApi:b.NW,fetchApi:b.gP},factory:({discoveryApi:a,fetchApi:n})=>new $o.MS({discoveryApi:a,fetchApi:n})}),(0,b.ni)({api:Cn.p3,deps:{storageApi:b.E6},factory:({storageApi:a})=>new hi({storageApi:a})})],routes:{catalogIndex:xr._Z,catalogEntity:Cn.wi},externalRoutes:{createComponent:xr.yw,viewTechDoc:xr.jU},__experimentalConfigure(a){return{...{createButtonTitle:"Create"},...a}}}),Fo=Kn.provide((0,b.P4)({name:"CatalogIndexPage",component:()=>t.e(5837).then(t.bind(t,95837)).then(a=>a.CatalogPage),mountPoint:xr._Z})),Uo=Kn.provide((0,b.P4)({name:"CatalogEntityPage",component:()=>t.e(8951).then(t.bind(t,78951)).then(a=>a.CatalogEntityPage),mountPoint:Cn.wi})),la=Kn.provide((0,b.CO)({name:"EntityAboutCard",component:{lazy:()=>Promise.resolve().then(t.bind(t,33414)).then(a=>a.AboutCard)}})),ir=Kn.provide((0,b.CO)({name:"EntityLinksCard",component:{lazy:()=>t.e(7750).then(t.bind(t,17750)).then(a=>a.EntityLinksCard)}})),Mo=Kn.provide((0,b.CO)({name:"EntityHasSystemsCard",component:{lazy:()=>t.e(5458).then(t.bind(t,5458)).then(a=>a.HasSystemsCard)}})),Ti=Kn.provide((0,b.CO)({name:"EntityHasComponentsCard",component:{lazy:()=>t.e(1105).then(t.bind(t,1105)).then(a=>a.HasComponentsCard)}})),Ii=Kn.provide((0,b.CO)({name:"EntityHasSubcomponentsCard",component:{lazy:()=>t.e(2440).then(t.bind(t,82440)).then(a=>a.HasSubcomponentsCard)}})),Ri=Kn.provide((0,b.CO)({name:"EntityHasResourcesCard",component:{lazy:()=>t.e(9770).then(t.bind(t,79770)).then(a=>a.HasResourcesCard)}})),Li=Kn.provide((0,b.CO)({name:"EntityDependsOnComponentsCard",component:{lazy:()=>t.e(9545).then(t.bind(t,19545)).then(a=>a.DependsOnComponentsCard)}})),ks=Kn.provide((0,b.CO)({name:"EntityDependencyOfComponentsCard",component:{lazy:()=>t.e(184).then(t.bind(t,40184)).then(a=>a.DependencyOfComponentsCard)}})),zo=Kn.provide((0,b.CO)({name:"EntityDependsOnResourcesCard",component:{lazy:()=>t.e(1032).then(t.bind(t,81032)).then(a=>a.DependsOnResourcesCard)}})),Wo=Kn.provide((0,b.CO)({name:"RelatedEntitiesCard",component:{lazy:()=>t.e(732).then(t.bind(t,732)).then(a=>a.RelatedEntitiesCard)}}));var Os=t(32838);class to{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}`,R=await fetch(`${f.endsWith("/")?f:`${f}/`}index.html`);if(R.status===404)throw new Error("Page not found");return R.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 Bs{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 Vo=[(0,b.ni)({api:Te.Dl,deps:{configApi:b.Ds,discoveryApi:b.NW,identityApi:b.$4},factory:({configApi:a,discoveryApi:n,identityApi:o})=>new to({configApi:a,discoveryApi:n,identityApi:o})}),(0,b.ni)({api:Te.gT,deps:{configApi:b.Ds,discoveryApi:b.NW,identityApi:b.$4},factory:({configApi:a,discoveryApi:n,identityApi:o})=>new Bs({configApi:a,discoveryApi:n,identityApi:o})}),(0,b.ni)({api:Os.q3,deps:{configApi:b.Ds},factory:({configApi:a})=>Os.ae.fromConfig(a)})],no={backend:{baseUrl:"http://localhost:3000"},techdocs:{builder:"external"}},ro={backend:{baseUrl:"http://localhost:7007"},techdocs:{builder:"external"}};async function so(){const a=await fetch("/.detect");return a.ok?(await a.text()).trim()==="techdocs-cli-server":!1}async function Ho(){const a=await qr(),n=await so();return[...a,{context:"detected",data:n?no:ro}]}var Wr=t(58845);const Go=(0,Br.Z)({svg:{width:"auto",height:30},path:{fill:"#7df3e1"}});var oo=()=>{const a=Go();return(0,r.jsx)("svg",{className:a.svg,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 2079.95 456.05",children:(0,r.jsx)("path",{className:a.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 io=(0,Br.Z)({svg:{width:"auto",height:28},path:{fill:"#7df3e1"}});var Ko=()=>{const a=io();return(0,r.jsx)("svg",{className:a.svg,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 337.46 428.5",children:(0,r.jsx)("path",{className:a.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 Yo=(0,Br.Z)({root:{width:Wt.po.drawerWidthClosed,height:3*Wt.po.logoHeight,display:"flex",flexFlow:"row nowrap",alignItems:"center",marginBottom:-14},link:{width:Wt.po.drawerWidthClosed,marginLeft:24}}),ao=()=>{const a=Yo(),{isOpen:n}=(0,Wt.mZ)();return(0,r.jsx)("div",{className:a.root,children:(0,r.jsx)(Wt.rU,{to:"/docs/default/component/local/",underline:"none",className:a.link,children:n?(0,r.jsx)(oo,{}):(0,r.jsx)(Ko,{})})})},Jo=({children:a})=>(0,r.jsxs)(Wt.tR,{children:[(0,r.jsxs)(Wt.YE,{children:[(0,r.jsx)(ao,{}),(0,r.jsx)(Wt.v7,{}),(0,r.jsx)(Wt.R6,{icon:Wr.Z,to:"/docs/default/component/local",text:"Docs Preview"})]}),a]});var ls=t(80030),lo=t(32388),Qo=t(4142);const co=(0,Br.Z)(a=>({headerIcon:{color:a.palette.common.white,width:"32px",height:"32px"},content:{backgroundColor:a.palette.background.default},contentToolbar:{display:"flex",justifyContent:"flex-end",padding:0}}));var nr;(function(a){a.LIGHT="light",a.DARK="dark"})(nr||(nr={}));const uo=()=>{const a=(0,b.h_)(b.hg),n=co(),[o,l]=(0,W.useState)(a.getActiveThemeId()===nr.DARK?nr.DARK:nr.LIGHT),f={[nr.LIGHT]:{icon:Qo.Z,title:"Dark theme"},[nr.DARK]:{icon:lo.Z,title:"Light theme"}},{title:R,icon:N}=f[o],V=()=>{l(ne=>{const ze=ne===nr.LIGHT?nr.DARK:nr.LIGHT;return a.setActiveThemeId(ze),ze})};return(0,r.jsx)(Hs.Z,{display:"flex",alignItems:"center",mr:2,children:(0,r.jsx)(ls.ZP,{title:R,arrow:!0,children:(0,r.jsx)(Ks.Z,{size:"small",onClick:V,children:(0,r.jsx)(N,{className:n.headerIcon})})})})},ho=()=>(0,r.jsxs)(S.I6,{children:[(0,r.jsx)(M.S,{}),(0,r.jsx)(z.F,{withSearch:!1})]}),Gn=(0,r.jsx)(ho,{}),po=Or({apis:Vo,configLoader:Ho,plugins:Object.values(h)}),Xo=po.getProvider(),qo=po.getRouter(),fo=S.s4.provide((0,Te.KY)({name:"ThemeToggleAddon",component:uo,location:Te.oZ.Header})),_o=(0,r.jsxs)(ts,{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)(Uo,{})}),(0,r.jsx)(g.AW,{path:"/docs",element:(0,r.jsx)(S.Jl,{}),children:(0,r.jsx)(L.u,{})}),(0,r.jsxs)(g.AW,{path:"/docs/:namespace/:kind/:name/*",element:(0,r.jsx)(S.I6,{}),children:[Gn,(0,r.jsx)(Te.DR,{children:(0,r.jsx)(fo,{})})]})]});var $s=()=>(0,r.jsx)(Xo,{children:(0,r.jsx)(qo,{children:(0,r.jsx)(Jo,{children:_o})})});B.render((0,r.jsx)($s,{}),document.getElementById("root"))},51837:function(Rt,Me,t){"use strict";t.d(Me,{CT:function(){return b},EI:function(){return te},uW:function(){return B},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=Q=>`__@backstage/${Q}__`;function B(Q,X){const M=W(Q);let z=r[M];return z||(z=X(),r[M]=z,z)}var g=t(2784);function b(Q){return B(Q,()=>(0,g.createContext)(void 0))}function c(Q){return(0,g.useContext)(b(Q))}function P(Q){return{set(X){globalThis[`__@backstage/${Q}__`]=createContext(createVersionedValueMap(X))},reset(){delete globalThis[`__@backstage/${Q}__`]}}}function te(Q){Object.freeze(Q);const X={atVersion(M){return Q[M]}};return Object.defineProperty(X,"$map",{configurable:!0,enumerable:!0,get(){return Q}}),X}},92848:function(Rt,Me,t){"use strict";t.d(Me,{h$:function(){return Et},n3:function(){return h.n3},_i:function(){return Z},tW:function(){return Oe},df:function(){return ve},UO:function(){return mn},dq:function(){return Fe},nl:function(){return As},dx:function(){return Ve},rI:function(){return Ge},u3:function(){return Tt},xE:function(){return Vn},sL:function(){return bn},LH:function(){return Sn},U_:function(){return xs},pp:function(){return Wt},EW:function(){return Es},Ah:function(){return W},wi:function(){return Te},hF:function(){return rt},CV:function(){return ot},$3:function(){return Ye},p3:function(){return B},ce:function(){return qt},X2:function(){return Ot},wp:function(){return un},ZW:function(){return Ne},N$:function(){return wt},eK:function(){return Ln},CR:function(){return ge}});var h=t(29644),r=t(25248);const W=(0,r.T0)({id:"plugin.catalog.service"}),B=(0,r.T0)({id:"catalog-react.starred-entities"});var g=t(82394);class b{async toggleStarred(x){this.starredEntities.delete(x)||this.starredEntities.add(x);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(x=>(x.next(new Set(this.starredEntities)),this.subscribers.add(x),()=>{this.subscribers.delete(x)}))}}var c=t(52322),P=t(2784),te=t(41156),Q=t(60364),X=t(77277),M=t(4190),z=t(95544),_=t(90436),fe=t(60905),ie=t(36444);const T=v=>{const x=(0,te.Z)(K=>K.breakpoints.down("md")),I=(0,Q.Z)(),[$,J]=(0,P.useState)(!1);return x?(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(X.Z,{style:{marginTop:I.spacing(1),marginLeft:I.spacing(1)},onClick:()=>J(!0),startIcon:(0,c.jsx)(ie.Z,{}),children:"Filters"}),(0,c.jsx)(M.ZP,{open:$,onClose:()=>J(!1),anchor:"left",disableAutoFocus:!0,keepMounted:!0,variant:"temporary",children:(0,c.jsxs)(z.Z,{m:2,children:[(0,c.jsx)(_.Z,{variant:"h6",component:"h2",style:{marginBottom:I.spacing(1)},children:"Filters"}),v.children]})})]}):(0,c.jsx)(fe.Z,{item:!0,lg:2,children:v.children})},L=v=>(0,c.jsx)(fe.Z,{item:!0,xs:12,lg:10,children:v.children}),Z=v=>(0,c.jsx)(fe.Z,{container:!0,style:{position:"relative"},children:v.children});Z.Filters=T,Z.Content=L;var A=t(93414),S=t(25271),q=t(51837);const Te=(0,q.uW)("catalog:entity-route-ref",()=>(0,r.NT)({id:"catalog:entity",params:["namespace","kind","name"]}));function Qe(v){var x,I;return{kind:v.kind.toLocaleLowerCase("en-US"),namespace:(I=(x=v.metadata.namespace)===null||x===void 0?void 0:x.toLocaleLowerCase("en-US"))!==null&&I!==void 0?I:DEFAULT_NAMESPACE,name:v.metadata.name}}function Ye(v,x){const I=x==null?void 0:x.defaultKind;let $,J,K;return"metadata"in v?($=v.kind,J=v.metadata.namespace,K=v.metadata.name):($=v.kind,J=v.namespace,K=v.name),(J===void 0||J==="")&&(J=S.zG),(x==null?void 0:x.defaultNamespace)!==void 0?(x==null?void 0:x.defaultNamespace)===J&&(J=void 0):J===S.zG&&(J=void 0),$=$.toLocaleLowerCase("en-US"),$=I&&I.toLocaleLowerCase("en-US")===$?void 0:$,`${$?`${$}:`:""}${J?`${J}/`:""}${K}`}var Xe=t(80030);const Ve=(0,P.forwardRef)((v,x)=>{const{entityRef:I,defaultKind:$,title:J,children:K,...oe}=v,le=(0,r.tg)(Te);let Se,Be,$e;if(typeof I=="string"){const et=(0,S.of)(I);Se=et.kind,Be=et.namespace,$e=et.name}else"metadata"in I?(Se=I.kind,Be=I.metadata.namespace,$e=I.metadata.name):(Se=I.kind,Be=I.namespace,$e=I.name);Se=Se.toLocaleLowerCase("en-US");var Ae;Be=(Ae=Be==null?void 0:Be.toLocaleLowerCase("en-US"))!==null&&Ae!==void 0?Ae:S.zG;const Je={kind:Se,namespace:Be,name:$e},xt=Ye({kind:Se,namespace:Be,name:$e},{defaultKind:$}),It=(0,c.jsxs)(A.rU,{...oe,ref:x,to:le(Je),children:[K,!K&&(J!=null?J:xt)]});return J?(0,c.jsx)(Xe.ZP,{title:xt,children:It}):It});var ft=t(64279);function je(v){const{entityRefs:x,defaultKind:I,getTitle:$,...J}=v,K=(0,r.h_)(W),{value:oe=new Array,loading:le,error:Se}=(0,ft.default)(async()=>{const Be=x.reduce((Ae,Je)=>"metadata"in Je?Ae:[...Ae,(0,S.of)(Je)],new Array),$e=x.filter(Ae=>"metadata"in Ae);return Be.length>0?[...(await K.getEntities({filter:Be.map(Ae=>({kind:Ae.kind,"metadata.namespace":Ae.namespace,"metadata.name":Ae.name}))})).items,...$e]:$e},[x]);return le?(0,c.jsx)(A.Ex,{}):Se?(0,c.jsx)(A.yu,{error:Se}):(0,c.jsx)(c.Fragment,{children:oe.map((Be,$e)=>(0,c.jsxs)(P.Fragment,{children:[$e>0&&", ",(0,c.jsx)(Ve,{...J,defaultKind:I,entityRef:Be,title:$(Be)})]},$e))})}function Ge(v){const{entityRefs:x,defaultKind:I,fetchEntities:$,getTitle:J,...K}=v;return $?(0,c.jsx)(je,{...K,defaultKind:I,entityRefs:x,getTitle:J}):(0,c.jsx)(c.Fragment,{children:x.map((oe,le)=>(0,c.jsxs)(P.Fragment,{children:[le>0&&", ",(0,c.jsx)(Ve,{...K,defaultKind:I,entityRef:oe,title:J?J(oe):void 0})]},le))})}function st(v){return v.reduce((x,I)=>({...x,...I.getCatalogFilters?I.getCatalogFilters():{}}),{})}function gt(v){return x=>v.every(I=>!I.filterEntity||I.filterEntity(x))}function rt(v,x,I){var $;let J=(v==null||($=v.relations)===null||$===void 0?void 0:$.filter(K=>K.type===x).map(K=>(0,S.of)(K.targetRef)))||[];return I!=null&&I.kind&&(J=J.filter(K=>K.kind.toLocaleLowerCase("en-US")===I.kind.toLocaleLowerCase("en-US"))),J}function ot(v,x){var I;const $=(I=v.metadata.annotations)===null||I===void 0?void 0:I[S.M6];if(!!$)try{const J=(0,S.Ou)($),K=x.byUrl(J.target);return{locationTargetUrl:J.target,integrationType:K==null?void 0:K.type}}catch{return}}function ct(v,x){const I=new Set([...getEntityRelations(v,RELATION_MEMBER_OF,{kind:"group"}),...v?[getCompoundEntityRef(v)]:[]].map(stringifyEntityRef)),$=getEntityRelations(x,RELATION_OWNED_BY).map(stringifyEntityRef);for(const J of $)if(I.has(J))return!0;return!1}class yt{getCatalogFilters(){return{kind:this.value}}toQueryValue(){return this.value}constructor(x){this.value=x}}class Lt{getTypes(){return Array.isArray(this.value)?this.value:[this.value]}getCatalogFilters(){return{"spec.type":this.getTypes()}}toQueryValue(){return this.getTypes()}constructor(x){this.value=x}}class We{filterEntity(x){var I;return this.values.every($=>((I=x.metadata.tags)!==null&&I!==void 0?I:[]).includes($))}toQueryValue(){return this.values}constructor(x){this.values=x}}class se{filterEntity(x){const I=this.toUpperArray(this.value.split(/\s/)),$=this.toUpperArray([x.metadata.tags]),J=this.toUpperArray([x.metadata.name,x.metadata.title]);for(const K of I)if($.every(oe=>oe!==K)&&J.every(oe=>!oe.includes(K)))return!1;return!0}toUpperArray(x){return x.flat().filter(I=>Boolean(I)).map(I=>I.toLocaleUpperCase("en-US"))}constructor(x){this.value=x}}class Ie{filterEntity(x){return this.values.some(I=>rt(x,S.S4).some($=>Ye($,{defaultKind:"group"})===I))}toQueryValue(){return this.values}constructor(x){this.values=x}}class Le{filterEntity(x){return this.values.some(I=>{var $;return(($=x.spec)===null||$===void 0?void 0:$.lifecycle)===I})}toQueryValue(){return this.values}constructor(x){this.values=x}}class tt{filterEntity(x){switch(this.value){case"owned":return this.isOwnedEntity(x);case"starred":return this.isStarredEntity(x);default:return!0}}toQueryValue(){return this.value}constructor(x,I,$){this.value=x,this.isOwnedEntity=I,this.isStarredEntity=$}}class mt{filterEntity(x){var I;const $=(I=x.metadata.annotations)===null||I===void 0?void 0:I["backstage.io/orphan"];return $!==void 0&&this.value.toString()===$}constructor(x){this.value=x}}class Zt{filterEntity(x){var I,$;const J=(x==null||(I=x.status)===null||I===void 0||($=I.items)===null||$===void 0?void 0:$.length)>0;return J!==void 0&&this.value===J}constructor(x){this.value=x}}const dt=(0,q.CT)("entity-context"),Et=({children:v,entity:x,loading:I,error:$,refresh:J})=>{const K={entity:x,loading:I,error:$,refresh:J};return(0,c.jsx)(dt.Provider,{value:(0,q.EI)({1:K}),children:(0,c.jsx)(r.fC,{attributes:{...x?{entityRef:(0,S.eE)(x)}:void 0},children:v})})},At=v=>_jsx(Et,{entity:v.entity,loading:!Boolean(v.entity),error:void 0,refresh:void 0,children:v.children});function Ot(){const v=(0,q.Vt)("entity-context");if(!v)throw new Error("Entity context is not available");const x=v.atVersion(1);if(!x)throw new Error("EntityContext v1 not available");if(!x.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:x.entity}}function qt(){const v=(0,q.Vt)("entity-context");if(!v)throw new Error("Entity context is not available");const x=v.atVersion(1);if(!x)throw new Error("EntityContext v1 not available");const{entity:I,loading:$,error:J,refresh:K}=x;return{entity:I,loading:$,error:J,refresh:K}}var Vt=t(76635),Ht=t(19126),Jt=t.n(Ht),dn=t(79635),an=t(69294),Fn=t(48760),En=t(90736);const Un=(0,P.createContext)(void 0),mn=({children:v})=>{const x=(0,En.default)(),I=(0,r.h_)(W),[$,J]=(0,P.useState)({}),K=(0,dn.TH)();var oe;const le=(0,P.useMemo)(()=>(oe=Jt().parse(K.search,{ignoreQueryPrefix:!0}).filters)!==null&&oe!==void 0?oe:{},[K]),[Se,Be]=(0,P.useState)(()=>({appliedFilters:{},entities:[],backendEntities:[]})),[{loading:$e,error:Ae},Je]=(0,an.default)(async()=>{const et=(0,Vt.compact)(Object.values($)),$t=gt(et),Dt=st(et),fn=st((0,Vt.compact)(Object.values(Se.appliedFilters))),rn=Object.keys($).reduce((wn,Tn)=>{const In=$[Tn];return In!=null&&In.toQueryValue&&(wn[Tn]=In.toQueryValue()),wn},{});if((0,Vt.isEqual)(fn,Dt))Be({appliedFilters:$,backendEntities:Se.backendEntities,entities:Se.backendEntities.filter($t)});else{const wn=await I.getEntities({filter:Dt});Be({appliedFilters:$,backendEntities:wn.items,entities:wn.items.filter($t)})}if(x()){var tr;const wn=Jt().parse(K.search,{ignoreQueryPrefix:!0}),Tn=Jt().stringify({...wn,filters:rn},{addQueryPrefix:!0,arrayFormat:"repeat"}),In=`${window.location.pathname}${Tn}`;(tr=window.history)===null||tr===void 0||tr.replaceState(null,document.title,In)}},[I,le,$,Se],{loading:!0});(0,Fn.Z)(Je,10,[$]);const xt=(0,P.useCallback)(et=>{J($t=>{const Dt=typeof et=="function"?et($t):et;return{...$t,...Dt}})},[]),It=(0,P.useMemo)(()=>({filters:Se.appliedFilters,entities:Se.entities,backendEntities:Se.backendEntities,updateFilters:xt,queryParameters:le,loading:$e,error:Ae}),[Se,xt,le,$e,Ae]);return(0,c.jsx)(Un.Provider,{value:It,children:v})};function un(){const v=(0,P.useContext)(Un);if(!v)throw new Error("useEntityList must be used within EntityListProvider");return v}var Qt=t(18149),Mn=t.n(Qt),zn=t(829),hn=t.n(zn);function vn(){const v=(0,r.h_)(W),{filters:{kind:x,type:I},queryParameters:{type:$},updateFilters:J}=un(),K=(0,P.useMemo)(()=>[$].flat().filter(Boolean),[$]);var oe;const[le,Se]=(0,P.useState)(K.length?K:(oe=I==null?void 0:I.getTypes())!==null&&oe!==void 0?oe:[]);(0,P.useEffect)(()=>{K.length&&Se(K)},[K]);const[Be,$e]=(0,P.useState)([]),Ae=(0,P.useMemo)(()=>x==null?void 0:x.value,[x]),{error:Je,loading:xt,value:It}=(0,ft.default)(async()=>Ae?await v.getEntityFacets({filter:{kind:Ae},facets:["spec.type"]}).then(Dt=>Dt.facets["spec.type"]||[]):[],[Ae,v]),et=(0,P.useRef)(It);return(0,P.useEffect)(()=>{const $t=et.current;if(et.current=It,xt||!Ae||$t===It||!It)return;const Dt=[...new Set(hn()(It,rn=>-rn.count).map(rn=>rn.value.toLocaleLowerCase("en-US")))];$e(Dt);const fn=le.filter(rn=>Dt.includes(rn));Mn()(le,fn)||Se(fn)},[xt,Ae,le,Se,It]),(0,P.useEffect)(()=>{J({type:le.length?new Lt(le):void 0})},[le,J]),{loading:xt,error:Je,availableTypes:Be,selectedTypes:le,setSelectedTypes:Se}}const yn=20;function Ln(v,x){var I,$;const J=x==null||(I=x.type)===null||I===void 0?void 0:I.toLocaleLowerCase("en-US"),K=x==null||($=x.kind)===null||$===void 0?void 0:$.toLocaleLowerCase("en-US"),oe=(0,r.h_)(W),{loading:le,value:Se,error:Be}=(0,ft.default)(async()=>{var $e;const Ae=($e=v.relations)===null||$e===void 0?void 0:$e.map(et=>({type:et.type,target:(0,S.of)(et.targetRef)})).filter(et=>(!J||et.type.toLocaleLowerCase("en-US")===J)&&(!K||et.target.kind===K));if(!Ae)return[];const Je=Object.values((0,Vt.groupBy)(Ae,({target:et})=>`${et.kind}:${et.namespace}`.toLocaleLowerCase("en-US"))),xt=[];for(const et of Je)xt.push({kind:et[0].target.kind,namespace:et[0].target.namespace,nameBatches:(0,Vt.chunk)(et.map($t=>$t.target.name),yn)});return(await Promise.all(xt.flatMap(et=>et.nameBatches.map($t=>oe.getEntities({filter:{kind:et.kind,"metadata.namespace":et.namespace,"metadata.name":$t}}))))).flatMap(et=>et.items)},[v,J,K]);return{entities:Se,loading:le,error:Be}}var Pn=t(72164);function xn(v){return typeof v=="string"?v:(0,S.eE)(v)}function ge(){const v=(0,r.h_)(B),x=(0,Pn.Z)(v.starredEntitie$(),new Set),I=(0,P.useCallback)(J=>x.has(xn(J)),[x]),$=(0,P.useCallback)(J=>v.toggleStarred(xn(J)).then(),[v]);return{starredEntities:x,toggleStarredEntity:$,isStarredEntity:I}}function ee(v){return typeof v=="string"?v:(0,S.eE)(v)}function Ee(v){const x=(0,r.h_)(B),[I,$]=(0,P.useState)(!1);return(0,P.useEffect)(()=>{const K=x.starredEntitie$().subscribe({next(oe){$(oe.has(ee(v)))}});return()=>{K.unsubscribe()}},[v,x]),{toggleStarredEntity:(0,P.useCallback)(()=>x.toggleStarred(ee(v)).then(),[v,x]),isStarredEntity:I}}function Ne(){const v=(0,r.h_)(r.$4),{loading:x,value:I}=(0,ft.default)(async()=>{const{ownershipEntityRefs:J}=await v.getBackstageIdentity();return J},[]),$=(0,P.useMemo)(()=>{const J=new Set(I!=null?I:[]);return K=>{const oe=rt(K,S.S4).map(S.eE);for(const le of oe)if(J.has(le))return!0;return!1}},[I]);return(0,P.useMemo)(()=>({loading:x,isOwnedEntity:$}),[x,$])}var _e=t(25488);function wt(v){const{entity:x,loading:I,error:$}=qt(),{allowed:J,loading:K,error:oe}=(0,_e.gI)({permission:v,resourceRef:x?(0,S.eE)(x):void 0});return I||K?{loading:!0,allowed:!1}:$?{loading:!1,allowed:!1,error:$}:{loading:!1,allowed:J,error:oe}}function ae(){const v=(0,r.h_)(W),{error:x,loading:I,value:$}=(0,ft.default)(async()=>await v.getEntityFacets({facets:["kind"]}).then(K=>{var oe;return((oe=K.facets.kind)===null||oe===void 0?void 0:oe.map(le=>le.value).sort())||[]}),[v]);return{loading:I,error:x,allKinds:$!=null?$:[]}}function k(v,x,I){let $=v;return x&&($=$.filter(K=>x.some(oe=>oe.toLocaleLowerCase("en-US")===K.toLocaleLowerCase("en-US")))),I&&!v.some(K=>K.toLocaleLowerCase("en-US")===I.toLocaleLowerCase("en-US"))&&($=$.concat([I])),$.sort().reduce((K,oe)=>(K[oe.toLocaleLowerCase("en-US")]=oe,K),{})}function ce(v){var x;const{filters:I,queryParameters:{kind:$},updateFilters:J}=un(),K=(0,P.useMemo)(()=>[$].flat()[0],[$]);var oe;const[le,Se]=(0,P.useState)((oe=K!=null?K:(x=I.kind)===null||x===void 0?void 0:x.value)!==null&&oe!==void 0?oe:v.initialFilter);(0,P.useEffect)(()=>{K&&Se(K)},[K]),(0,P.useEffect)(()=>{var Je;if(!((Je=I.kind)===null||Je===void 0)&&Je.value){var xt;Se((xt=I.kind)===null||xt===void 0?void 0:xt.value)}},[I.kind]),(0,P.useEffect)(()=>{J({kind:le?new yt(le):void 0})},[le,J]);const{allKinds:Be,loading:$e,error:Ae}=ae();return{loading:$e,error:Ae,allKinds:Be!=null?Be:[],selectedKind:le,setSelectedKind:Se}}const Oe=v=>{const{allowedKinds:x,hidden:I,initialFilter:$="component"}=v,J=(0,r.h_)(r.$v),{error:K,allKinds:oe,selectedKind:le,setSelectedKind:Se}=ce({initialFilter:$});if((0,P.useEffect)(()=>{K&&J.post({message:"Failed to load entity kinds",severity:"error"})},[K,J]),K)return null;const Be=k(oe,x,le),$e=Object.keys(Be).map(Ae=>({value:Ae,label:Be[Ae]}));return I?null:(0,c.jsx)(z.Z,{pb:1,pt:1,children:(0,c.jsx)(A.Ph,{label:"Kind",items:$e,selected:le.toLocaleLowerCase("en-US"),onChange:Ae=>Se(String(Ae))})})};var D=t(79692),U=t(5806),de=t(21324),pe=t(86619),ye=t(19996),Pe=t(25505),Re=t(38016),Ue=t(88013);const nt=(0,D.Z)({input:{}},{name:"CatalogReactEntityLifecyclePicker"}),w=(0,c.jsx)(Pe.Z,{fontSize:"small"}),H=(0,c.jsx)(ye.Z,{fontSize:"small"}),ve=()=>{var v;const x=nt(),{updateFilters:I,backendEntities:$,filters:J,queryParameters:{lifecycles:K}}=un(),oe=(0,P.useMemo)(()=>[K].flat().filter(Boolean),[K]);var le;const[Se,Be]=(0,P.useState)(oe.length?oe:(le=(v=J.lifecycles)===null||v===void 0?void 0:v.values)!==null&&le!==void 0?le:[]);(0,P.useEffect)(()=>{oe.length&&Be(oe)},[oe]);const $e=(0,P.useMemo)(()=>[...new Set($.map(Ae=>{var Je;return(Je=Ae.spec)===null||Je===void 0?void 0:Je.lifecycle}).filter(Boolean))].sort(),[$]);return(0,P.useEffect)(()=>{I({lifecycles:Se.length&&$e.length?new Le(Se):void 0})},[Se,I,$e]),$e.length?(0,c.jsx)(z.Z,{pb:1,pt:1,children:(0,c.jsxs)(_.Z,{variant:"button",component:"label",children:["Lifecycle",(0,c.jsx)(Ue.ZP,{multiple:!0,options:$e,value:Se,onChange:(Ae,Je)=>Be(Je),renderOption:(Ae,{selected:Je})=>(0,c.jsx)(U.Z,{control:(0,c.jsx)(de.Z,{icon:w,checkedIcon:H,checked:Je}),label:Ae}),size:"small",popupIcon:(0,c.jsx)(Re.Z,{"data-testid":"lifecycle-picker-expand"}),renderInput:Ae=>(0,c.jsx)(pe.Z,{...Ae,className:x.input,variant:"outlined"})})]})}):null},ue=(0,D.Z)({input:{}},{name:"CatalogReactEntityOwnerPicker"}),we=(0,c.jsx)(Pe.Z,{fontSize:"small"}),ke=(0,c.jsx)(ye.Z,{fontSize:"small"}),Fe=()=>{var v;const x=ue(),{updateFilters:I,backendEntities:$,filters:J,queryParameters:{owners:K}}=un(),oe=(0,P.useMemo)(()=>[K].flat().filter(Boolean),[K]);var le;const[Se,Be]=(0,P.useState)(oe.length?oe:(le=(v=J.owners)===null||v===void 0?void 0:v.values)!==null&&le!==void 0?le:[]);(0,P.useEffect)(()=>{oe.length&&Be(oe)},[oe]);const $e=(0,P.useMemo)(()=>[...new Set($.flatMap(Ae=>rt(Ae,S.S4).map(Je=>Ye(Je,{defaultKind:"group"}))).filter(Boolean))].sort(),[$]);return(0,P.useEffect)(()=>{I({owners:Se.length&&$e.length?new Ie(Se):void 0})},[Se,I,$e]),$e.length?(0,c.jsx)(z.Z,{pb:1,pt:1,children:(0,c.jsxs)(_.Z,{variant:"button",component:"label",children:["Owner",(0,c.jsx)(Ue.ZP,{multiple:!0,options:$e,value:Se,onChange:(Ae,Je)=>Be(Je),renderOption:(Ae,{selected:Je})=>(0,c.jsx)(U.Z,{control:(0,c.jsx)(de.Z,{icon:we,checkedIcon:ke,checked:Je}),label:Ae}),size:"small",popupIcon:(0,c.jsx)(Re.Z,{"data-testid":"owner-picker-expand"}),renderInput:Ae=>(0,c.jsx)(pe.Z,{...Ae,className:x.input,variant:"outlined"})})]})}):null},it=(0,D.Z)(v=>({searchToolbar:{paddingLeft:0,paddingRight:0},input:{}}),{name:"CatalogReactEntitySearchBar"}),Ct=()=>{var v;const x=it(),{filters:I,updateFilters:$}=useEntityList();var J;const[K,oe]=useState((J=(v=I.text)===null||v===void 0?void 0:v.value)!==null&&J!==void 0?J:"");return useDebounce(()=>{$({text:K.length?new EntityTextFilter(K):void 0})},250,[K,$]),_jsx(Toolbar,{className:x.searchToolbar,children:_jsx(FormControl,{children:_jsx(Input,{"aria-label":"search",id:"input-with-icon-adornment",className:x.input,placeholder:"Search",autoComplete:"off",onChange:le=>oe(le.target.value),value:K,startAdornment:_jsx(InputAdornment,{position:"start",children:_jsx(Search,{})}),endAdornment:_jsx(InputAdornment,{position:"end",children:_jsx(IconButton,{"aria-label":"clear search",onClick:()=>oe(""),edge:"end",disabled:K.length===0,children:_jsx(Clear,{})})})})})})},Ke=Object.freeze({createEntityRefColumn(v){const{defaultKind:x}=v;function I($){var J;return((J=$.metadata)===null||J===void 0?void 0:J.title)||Ye($,{defaultKind:x})}return{title:"Name",highlight:!0,customFilterAndSearch($,J){return I(J).includes($)},customSort($,J){return I($).localeCompare(I(J))},render:$=>{var J;return(0,c.jsx)(Ve,{entityRef:$,defaultKind:x,title:(J=$.metadata)===null||J===void 0?void 0:J.title})}}},createEntityRelationColumn(v){const{title:x,relation:I,defaultKind:$,filter:J}=v;function K(le){return rt(le,I,J)}function oe(le){return K(le).map(Se=>Ye(Se,{defaultKind:$})).join(", ")}return{title:x,customFilterAndSearch(le,Se){return oe(Se).includes(le)},customSort(le,Se){return oe(le).localeCompare(oe(Se))},render:le=>(0,c.jsx)(Ge,{entityRefs:K(le),defaultKind:$})}},createOwnerColumn(){return this.createEntityRelationColumn({title:"Owner",relation:S.S4,defaultKind:"group"})},createDomainColumn(){return this.createEntityRelationColumn({title:"Domain",relation:S.cz,defaultKind:"domain",filter:{kind:"domain"}})},createSystemColumn(){return this.createEntityRelationColumn({title:"System",relation:S.cz,defaultKind:"system",filter:{kind:"system"}})},createMetadataDescriptionColumn(){return{title:"Description",field:"metadata.description",render:v=>(0,c.jsx)(A.Or,{text:v.metadata.description,placement:"bottom-start",line:2})}},createSpecLifecycleColumn(){return{title:"Lifecycle",field:"spec.lifecycle"}},createSpecTypeColumn(){return{title:"Type",field:"spec.type"}}}),ht=[Ke.createEntityRefColumn({defaultKind:"system"}),Ke.createDomainColumn(),Ke.createOwnerColumn(),Ke.createMetadataDescriptionColumn()],vt=[Ke.createEntityRefColumn({defaultKind:"component"}),Ke.createSystemColumn(),Ke.createOwnerColumn(),Ke.createSpecTypeColumn(),Ke.createSpecLifecycleColumn(),Ke.createMetadataDescriptionColumn()],at=(0,D.Z)(v=>({empty:{padding:v.spacing(2),display:"flex",justifyContent:"center"}})),Tt=v=>{const{entities:x,title:I,emptyContent:$,variant:J="gridItem",columns:K}=v,oe=at(),le={minWidth:"0",width:"100%"};return J==="gridItem"&&(le.height="calc(100% - 10px)"),(0,c.jsx)(A.iA,{columns:K,title:I,style:le,emptyContent:$&&(0,c.jsx)("div",{className:oe.empty,children:$}),options:{search:!1,paging:!1,actionsColumnIndex:-1,padding:"dense",draggable:!1},data:x})};Tt.columns=Ke,Tt.systemEntityColumns=ht,Tt.componentEntityColumns=vt;const Ut=(0,D.Z)({input:{}},{name:"CatalogReactEntityTagPicker"}),Mt=(0,c.jsx)(Pe.Z,{fontSize:"small"}),Wn=(0,c.jsx)(ye.Z,{fontSize:"small"}),Vn=v=>{var x;const I=Ut(),{updateFilters:$,filters:J,queryParameters:{tags:K}}=un(),oe=(0,r.h_)(W),{value:le}=(0,ft.default)(async()=>{var Je;const xt="metadata.tags",{facets:It}=await oe.getEntityFacets({facets:[xt],filter:(Je=J.kind)===null||Je===void 0?void 0:Je.getCatalogFilters()});return Object.fromEntries(It[xt].map(({value:et,count:$t})=>[et,$t]))},[J.kind]),Se=(0,P.useMemo)(()=>[K].flat().filter(Boolean),[K]);var Be;const[$e,Ae]=(0,P.useState)(Se.length?Se:(Be=(x=J.tags)===null||x===void 0?void 0:x.values)!==null&&Be!==void 0?Be:[]);return(0,P.useEffect)(()=>{Se.length&&Ae(Se)},[Se]),(0,P.useEffect)(()=>{const Je=Object.keys(le!=null?le:{});$({tags:$e.length&&Je.length?new We($e):void 0})},[$e,$,le]),Object.keys(le!=null?le:{}).length?(0,c.jsx)(z.Z,{pb:1,pt:1,children:(0,c.jsxs)(_.Z,{variant:"button",component:"label",children:["Tags",(0,c.jsx)(Ue.ZP,{multiple:!0,options:Object.keys(le!=null?le:{}),value:$e,onChange:(Je,xt)=>Ae(xt),renderOption:(Je,{selected:xt})=>(0,c.jsx)(U.Z,{control:(0,c.jsx)(de.Z,{icon:Mt,checkedIcon:Wn,checked:xt}),label:v.showCounts?`${Je} (${le==null?void 0:le[Je]})`:Je}),size:"small",popupIcon:(0,c.jsx)(Re.Z,{"data-testid":"tag-picker-expand"}),renderInput:Je=>(0,c.jsx)(pe.Z,{...Je,className:I.input,variant:"outlined"})})]})}):null},bn=v=>{const{hidden:x,initialFilter:I}=v,$=(0,r.h_)(r.$v),{error:J,availableTypes:K,selectedTypes:oe,setSelectedTypes:le}=vn();if((0,P.useEffect)(()=>{J&&$.post({message:"Failed to load entity types",severity:"error"}),I&&le([I])},[J,$,I,le]),K.length===0||J)return null;const Se=[{value:"all",label:"all"},...K.map($e=>({value:$e,label:$e}))];var Be;return x?null:(0,c.jsx)(z.Z,{pb:1,pt:1,children:(0,c.jsx)(A.Ph,{label:"Type",items:Se,selected:(Be=Se.length>1?oe[0]:void 0)!==null&&Be!==void 0?Be:"all",onChange:$e=>le($e==="all"?[]:[String($e)])})})};var Nt=t(15459),zt=t(61837),_t=t(11640),kn=t(28347);const Jn=(0,Nt.Z)({root:{color:"#f3ba37"}})(_t.Z),Sn=v=>{const{toggleStarredEntity:x,isStarredEntity:I}=Ee(v.entity);return(0,c.jsx)(zt.Z,{"aria-label":"favorite",color:"inherit",...v,onClick:()=>x(),children:(0,c.jsx)(Xe.ZP,{title:I?"Remove from favorites":"Add to favorites",children:I?(0,c.jsx)(Jn,{}):(0,c.jsx)(kn.Z,{})})})};var pn=t(8629),Hn=t(79249),ln=t(38724),On=t(99152),Qn=t(6487),C=t(49429),d=t(55999),y=t(72779),j=t.n(y),Y=t(39412);const me=Y.Z;function be(v,x){if(v)return v.toLocaleLowerCase("en-US");if(x)try{return(0,S.of)(x).kind.toLocaleLowerCase("en-US")}catch{return}}function De(v,x){const I=(0,r.qD)(),$=be(v,x);return $&&I.getSystemIcon(`kind:${$}`)||me}function pt(v){const{kind:x,entityRef:I,...$}=v,J=De(x,I);return(0,c.jsx)(J,{...$})}const Ft=(0,D.Z)(v=>({node:{fill:v.palette.grey[300],stroke:v.palette.grey[300],"&.primary":{fill:v.palette.primary.light,stroke:v.palette.primary.light},"&.secondary":{fill:v.palette.secondary.light,stroke:v.palette.secondary.light}},text:{fill:v.palette.getContrastText(v.palette.grey[300]),"&.primary":{fill:v.palette.primary.contrastText},"&.secondary":{fill:v.palette.secondary.contrastText},"&.focused":{fontWeight:"bold"}},clickable:{cursor:"pointer"}}));function en(v){const x=(0,r.h_)(W),I=(0,S.eE)(v),{loading:$,error:J,value:K}=(0,ft.default)(async()=>{const oe=await x.getEntityAncestors({entityRef:I}),le=new Array,Se=new Array;for(const Be of oe.items){const $e=(0,S.eE)(Be.entity),Ae=$e===oe.rootEntityRef;le.push({id:$e,root:Ae,...Be.entity});for(const Je of Be.parentEntityRefs)Se.push({from:$e,to:Je})}return{nodes:le,edges:Se}},[I]);return{loading:$,error:J,nodes:(K==null?void 0:K.nodes)||[],edges:(K==null?void 0:K.edges)||[]}}function Bn({node:v}){const x=Ft(),I=(0,dn.s0)(),$=(0,r.tg)(Te),[J,K]=(0,P.useState)(0),[oe,le]=(0,P.useState)(0),Se=(0,P.useRef)(null);(0,P.useLayoutEffect)(()=>{if(Se.current){let{height:$t,width:Dt}=Se.current.getBBox();$t=Math.round($t),Dt=Math.round(Dt),($t!==oe||Dt!==J)&&(K(Dt),le($t))}},[J,oe]);const Be=10,$e=oe,Ae=$e+Be,Je=Ae+J+Be*2,xt=oe+Be*2,It=v.metadata.title||(v.kind&&v.metadata.name&&v.metadata.namespace?Ye({kind:v.kind,name:v.metadata.name,namespace:v.metadata.namespace||""}):v.id),et=()=>{I($({kind:v.kind,namespace:v.metadata.namespace||S.zG,name:v.metadata.name}))};return(0,c.jsxs)("g",{onClick:et,className:x.clickable,children:[(0,c.jsx)("rect",{className:j()(x.node,v.root?"secondary":"primary"),width:Je,height:xt,rx:10}),(0,c.jsx)(pt,{kind:v.kind,y:Be,x:Be,width:$e,height:$e,className:j()(x.text,v.root?"secondary":"primary")}),(0,c.jsx)("text",{ref:Se,className:j()(x.text,v.root?"secondary":"primary"),y:xt/2,x:Ae+(J+Be*2)/2,textAnchor:"middle",alignmentBaseline:"middle",children:It})]})}function Er(v){const{loading:x,error:I,nodes:$,edges:J}=en(v.entity);return x?(0,c.jsx)(A.Ex,{}):I?(0,c.jsx)(A.Gk,{error:I}):(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(d.Z,{variant:"h2",children:"Ancestry"}),(0,c.jsxs)(d.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)(z.Z,{mt:4,children:(0,c.jsx)(A.mn,{nodes:$,edges:J,renderNode:Bn,direction:A.NX.Nm.BOTTOM_TOP,zoom:"enable-on-click"})})]})}var rr=t(11776),Xn=t(38402),pr=t(86136),_n=t(99688),Ar=t(49378),Yr=t(54506),fr=t(94339),Tr=t(24579),ps=t(27685);const Dr=(0,D.Z)(v=>({root:{display:"flex",flexDirection:"column"},marginTop:{marginTop:v.spacing(2)},helpIcon:{marginLeft:v.spacing(1),color:v.palette.text.disabled},monospace:{fontFamily:"monospace"}}));function er(v){const x=Dr();return(0,c.jsx)(Ar.Z,{...v,primaryTypographyProps:{className:x.monospace},secondaryTypographyProps:{className:x.monospace}})}function Ir(v){const x=Dr();return(0,c.jsx)(Yr.Z,{className:x.monospace,children:v.children})}function Nr(v){return(0,c.jsx)(z.Z,{mt:2,children:(0,c.jsx)(fr.Z,{variant:"outlined",children:(0,c.jsxs)(Tr.Z,{children:[(0,c.jsxs)(_.Z,{variant:"h6",gutterBottom:!0,children:[v.title,v.helpLink&&(0,c.jsx)(Jr,{to:v.helpLink})]}),v.children]})})})}function fs(v){if(v.match(/^url:https?:\/\//))return v.slice(4);if(v.match(/^https?:\/\//))return v}function Fr(v){const[x,I]=v.entry,$=fs(I);return(0,c.jsxs)(Xn.Z,{children:[v.indent&&(0,c.jsx)(pr.Z,{}),(0,c.jsx)(er,{primary:x,secondary:$?(0,c.jsx)(A.rU,{to:$,children:I}):I})]})}function Jr(v){const x=Dr();return(0,c.jsx)(A.rU,{to:v.to,className:x.helpIcon,children:(0,c.jsx)(ps.Z,{fontSize:"inherit"})})}const Qr=(0,D.Z)({root:{display:"flex",flexDirection:"column"}});function sr(v){var x,I;const $=(0,r.h_)(W),J=(0,S.eE)(v),K=(x=v.metadata.annotations)===null||x===void 0?void 0:x[S.P1],oe=(I=v.metadata.annotations)===null||I===void 0?void 0:I[S.q1],{loading:le,error:Se,value:Be}=(0,ft.default)(async()=>!K&&!oe?[]:(await $.getEntities({filter:[...K?[{[`metadata.annotations.${S.P1}`]:K}]:[],...oe?[{[`metadata.annotations.${S.q1}`]:oe}]:[]]})).items,[K,oe]);return{loading:le,error:Se,location:K,originLocation:oe,colocatedEntities:Be==null?void 0:Be.filter($e=>(0,S.eE)($e)!==J)}}function gr(v){return(0,c.jsxs)(rr.Z,{dense:!0,children:[v.header&&(0,c.jsx)(Fr,{entry:v.header},"header"),v.entities.map(x=>(0,c.jsxs)(Xn.Z,{children:[(0,c.jsx)(pr.Z,{children:(0,c.jsx)(pt,{kind:x.kind})}),(0,c.jsx)(er,{primary:(0,c.jsx)(Ve,{entityRef:x})})]},(0,S.eE)(x)))]})}function Fs(v){const{entity:x}=v,{loading:I,error:$,location:J,originLocation:K,colocatedEntities:oe}=sr(x);if(I)return(0,c.jsx)(A.Ex,{});if($)return(0,c.jsx)(A.Gk,{error:$});if(!J&&!K)return(0,c.jsx)(_n.Z,{severity:"warning",children:"Entity had no location information."});if(!(oe!=null&&oe.length))return(0,c.jsx)(_n.Z,{severity:"info",children:"There were no other entities on this location."});if(J===K)return(0,c.jsx)(gr,{entities:oe});const le=oe.filter(Be=>{var $e;return(($e=Be.metadata.annotations)===null||$e===void 0?void 0:$e[S.P1])===J}),Se=oe.filter(Be=>{var $e;return(($e=Be.metadata.annotations)===null||$e===void 0?void 0:$e[S.q1])===K});return(0,c.jsxs)(c.Fragment,{children:[le.length>0&&(0,c.jsx)(gr,{entities:le,header:["At the same location",J]}),Se.length>0&&(0,c.jsx)(gr,{entities:Se,header:["At the same origin",K]})]})}function gs(v){const x=Qr();return(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(d.Z,{variant:"h2",children:"Colocated"}),(0,c.jsx)(d.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:x.root,children:(0,c.jsx)(Fs,{entity:v.entity})})]})}function Xr(v){return Object.fromEntries([...Object.entries(v)].sort((x,I)=>x[0]<I[0]?-1:1))}function Us(v){return(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(d.Z,{variant:"h2",children:"Entity as JSON"}),(0,c.jsx)(d.Z,{children:"This is the raw entity data as received from the catalog, on JSON form."}),(0,c.jsx)(d.Z,{children:(0,c.jsx)("div",{style:{fontSize:"75%"},"data-testid":"code-snippet",children:(0,c.jsx)(A.Oi,{text:JSON.stringify(Xr(v.entity),void 0,2),language:"json",showCopyCodeButton:!0})})})]})}var ms=t(3440),qr=t.n(ms);const Ms=(0,D.Z)({root:{display:"flex",flexDirection:"column"}});function dr(v){var x,I;const $=Ms(),{apiVersion:J,kind:K,metadata:oe,spec:le,relations:Se=[],status:Be={}}=v.entity,$e=qr()(hn()(Se,Ae=>Ae.targetRef),"type");return(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(d.Z,{variant:"h2",children:"Overview"}),(0,c.jsxs)("div",{className:$.root,children:[(0,c.jsx)(Nr,{title:"Identity",children:(0,c.jsxs)(rr.Z,{dense:!0,children:[(0,c.jsx)(Xn.Z,{children:(0,c.jsx)(er,{primary:"apiVersion",secondary:J})}),(0,c.jsx)(Xn.Z,{children:(0,c.jsx)(er,{primary:"kind",secondary:K})}),(le==null?void 0:le.type)&&(0,c.jsx)(Xn.Z,{children:(0,c.jsx)(er,{primary:"spec.type",secondary:le.type})}),oe.uid&&(0,c.jsx)(Xn.Z,{children:(0,c.jsx)(er,{primary:"uid",secondary:oe.uid})}),oe.etag&&(0,c.jsx)(Xn.Z,{children:(0,c.jsx)(er,{primary:"etag",secondary:oe.etag})})]})}),(0,c.jsxs)(Nr,{title:"Metadata",children:[!!Object.keys(oe.annotations||{}).length&&(0,c.jsx)(rr.Z,{dense:!0,subheader:(0,c.jsxs)(Ir,{children:["Annotations",(0,c.jsx)(Jr,{to:"https://backstage.io/docs/features/software-catalog/well-known-annotations"})]}),children:Object.entries(oe.annotations).map(Ae=>(0,c.jsx)(Fr,{indent:!0,entry:Ae},Ae[0]))}),!!Object.keys(oe.labels||{}).length&&(0,c.jsx)(rr.Z,{dense:!0,subheader:(0,c.jsx)(Ir,{children:"Labels"}),children:Object.entries(oe.labels).map(Ae=>(0,c.jsx)(Fr,{indent:!0,entry:Ae},Ae[0]))}),!!(!((x=oe.tags)===null||x===void 0)&&x.length)&&(0,c.jsx)(rr.Z,{dense:!0,subheader:(0,c.jsx)(Ir,{children:"Tags"}),children:oe.tags.map((Ae,Je)=>(0,c.jsxs)(Xn.Z,{children:[(0,c.jsx)(pr.Z,{}),(0,c.jsx)(er,{primary:Ae})]},`${Ae}-${Je}`))})]}),!!Se.length&&(0,c.jsx)(Nr,{title:"Relations",helpLink:"https://backstage.io/docs/features/software-catalog/well-known-relations",children:Object.entries($e).map(([Ae,Je],xt)=>(0,c.jsx)("div",{children:(0,c.jsx)(rr.Z,{dense:!0,subheader:(0,c.jsx)(Ir,{children:Ae}),children:Je.map(It=>(0,c.jsxs)(Xn.Z,{children:[(0,c.jsx)(pr.Z,{children:(0,c.jsx)(pt,{entityRef:It.targetRef})}),(0,c.jsx)(er,{primary:(0,c.jsx)(Ve,{entityRef:It.targetRef})})]},It.targetRef))})},xt))}),!!(!((I=Be.items)===null||I===void 0)&&I.length)&&(0,c.jsx)(Nr,{title:"Status",helpLink:"https://backstage.io/docs/features/software-catalog/well-known-statuses",children:Be.items.map((Ae,Je)=>(0,c.jsxs)("div",{children:[(0,c.jsxs)(_.Z,{children:[Ae.level,": ",Ae.type]}),(0,c.jsx)(z.Z,{ml:2,children:Ae.message})]},Je))})]})]})}var vs=t(72847);function ys(v){return(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(d.Z,{variant:"h2",children:"Entity as YAML"}),(0,c.jsx)(d.Z,{children:"This is the raw entity data as received from the catalog, on YAML form."}),(0,c.jsx)(d.Z,{children:(0,c.jsx)("div",{style:{fontSize:"75%"},"data-testid":"code-snippet",children:(0,c.jsx)(A.Oi,{text:vs.ZP.stringify(Xr(v.entity)),language:"yaml",showCopyCodeButton:!0})})})]})}const _r=(0,D.Z)(v=>({fullHeightDialog:{height:"calc(100% - 64px)"},root:{display:"flex",flexGrow:1,width:"100%",backgroundColor:v.palette.background.paper},tabs:{borderRight:`1px solid ${v.palette.divider}`,flexShrink:0},tabContents:{flexGrow:1,overflowX:"auto"}}));function or(v){const{children:x,value:I,index:$,...J}=v,K=_r();return(0,c.jsx)("div",{role:"tabpanel",hidden:I!==$,id:`vertical-tabpanel-${$}`,"aria-labelledby":`vertical-tab-${$}`,className:K.tabContents,...J,children:I===$&&(0,c.jsx)(z.Z,{pl:3,pr:3,children:x})})}function mr(v){return{id:`vertical-tab-${v}`,"aria-controls":`vertical-tabpanel-${v}`}}function xs(v){const x=_r(),[I,$]=P.useState(0);return(0,P.useEffect)(()=>{$(0)},[v.open]),v.entity?(0,c.jsxs)(pn.Z,{fullWidth:!0,maxWidth:"xl",open:v.open,onClose:v.onClose,"aria-labelledby":"entity-inspector-dialog-title",PaperProps:{className:x.fullHeightDialog},children:[(0,c.jsx)(Hn.Z,{id:"entity-inspector-dialog-title",children:"Entity Inspector"}),(0,c.jsx)(ln.Z,{dividers:!0,children:(0,c.jsxs)("div",{className:x.root,children:[(0,c.jsxs)(On.Z,{orientation:"vertical",variant:"scrollable",value:I,onChange:(J,K)=>$(K),"aria-label":"Inspector options",className:x.tabs,children:[(0,c.jsx)(Qn.Z,{label:"Overview",...mr(0)}),(0,c.jsx)(Qn.Z,{label:"Ancestry",...mr(1)}),(0,c.jsx)(Qn.Z,{label:"Colocated",...mr(2)}),(0,c.jsx)(Qn.Z,{label:"Raw JSON",...mr(3)}),(0,c.jsx)(Qn.Z,{label:"Raw YAML",...mr(4)})]}),(0,c.jsx)(or,{value:I,index:0,children:(0,c.jsx)(dr,{entity:v.entity})}),(0,c.jsx)(or,{value:I,index:1,children:(0,c.jsx)(Er,{entity:v.entity})}),(0,c.jsx)(or,{value:I,index:2,children:(0,c.jsx)(gs,{entity:v.entity})}),(0,c.jsx)(or,{value:I,index:3,children:(0,c.jsx)(Us,{entity:v.entity})}),(0,c.jsx)(or,{value:I,index:4,children:(0,c.jsx)(ys,{entity:v.entity})})]})}),(0,c.jsx)(C.Z,{children:(0,c.jsx)(X.Z,{onClick:v.onClose,color:"primary",children:"Close"})})]}):null}var es=t(85256);function ts(v){var x;const I=(0,r.h_)(W),$=(x=v.metadata.annotations)===null||x===void 0?void 0:x[S.q1],J=v.metadata.uid,K=$==="bootstrap:bootstrap",oe=(0,ft.default)(async()=>{const It=I.getLocationByRef($);let et;if(!$)et=Promise.resolve([]);else{const $t=`metadata.annotations.${S.q1}`;et=I.getEntities({filter:{[$t]:$},fields:["kind","metadata.uid","metadata.name","metadata.namespace"]}).then(Dt=>Dt.items)}return Promise.all([It,et]).then(([$t,Dt])=>({location:$t,colocatedEntities:Dt}))},[I,v]),le=(0,P.useCallback)(async function(){const{location:et}=oe.value;await I.removeLocationById(et.id)},[I,oe]),Se=(0,P.useCallback)(async function(){await I.removeEntityByUid(J)},[I,J]);if(K)return{type:"bootstrap",location:$,deleteEntity:Se};const{loading:Be,error:$e,value:Ae}=oe;if(Be)return{type:"loading"};if($e)return{type:"error",error:$e};const{location:Je,colocatedEntities:xt}=Ae;return Je?{type:"unregister",location:$,colocatedEntities:xt.map(S.iB),unregisterLocation:le,deleteEntity:Se}:{type:"only-delete",deleteEntity:Se}}var Ur=t(23054);const ns=(0,D.Z)({advancedButton:{fontSize:"0.7em"}}),An=({entity:v,onConfirm:x})=>{const I=(0,r.h_)(r.$v),$=(0,r.h_)(r.Ds),J=ns(),K=ts(v),[oe,le]=(0,P.useState)(!1),[Se,Be]=(0,P.useState)(!1);var $e;const Ae=($e=$.getOptionalString("app.title"))!==null&&$e!==void 0?$e:"Backstage",Je=(0,P.useCallback)(async function(){if("unregisterLocation"in K){Be(!0);try{await K.unregisterLocation(),x()}catch(et){(0,Ur.BD)(et),I.post({message:et.message})}finally{Be(!1)}}},[I,x,K]),xt=(0,P.useCallback)(async function(){if("deleteEntity"in K){Be(!0);try{await K.deleteEntity(),x()}catch(et){(0,Ur.BD)(et),I.post({message:et.message})}finally{Be(!1)}}},[I,x,K]);return K.type==="loading"?(0,c.jsx)(A.Ex,{}):K.type==="error"?(0,c.jsx)(A.Gk,{error:K.error}):K.type==="bootstrap"?(0,c.jsxs)(c.Fragment,{children:[(0,c.jsxs)(_n.Z,{severity:"info",children:['You cannot unregister this entity, since it originates from a protected Backstage configuration (location "',K.location,'"). If you believe this is in error, please contact the ',Ae," ","integrator."]}),(0,c.jsxs)(z.Z,{marginTop:2,children:[!oe&&(0,c.jsx)(X.Z,{variant:"text",size:"small",color:"primary",className:J.advancedButton,onClick:()=>le(!0),children:"Advanced Options"}),oe&&(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(d.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:xt,children:"Delete Entity"})]})]})]}):K.type==="only-delete"?(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(d.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:xt,children:"Delete Entity"})]}):K.type==="unregister"?(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(d.Z,{children:"This action will unregister the following entities:"}),(0,c.jsx)(d.Z,{component:"ul",children:K.colocatedEntities.map(It=>(0,c.jsx)("li",{children:(0,c.jsx)(Ve,{entityRef:It})},`${It.kind}:${It.namespace}/${It.name}`))}),(0,c.jsx)(d.Z,{children:"Located at the following location:"}),(0,c.jsx)(d.Z,{component:"ul",children:(0,c.jsx)("li",{children:K.location})}),(0,c.jsxs)(d.Z,{children:["To undo, just re-register the entity in ",Ae,"."]}),(0,c.jsxs)(z.Z,{marginTop:2,children:[(0,c.jsx)(X.Z,{variant:"contained",color:"secondary",disabled:Se,onClick:Je,children:"Unregister Location"}),!oe&&(0,c.jsx)(z.Z,{component:"span",marginLeft:2,children:(0,c.jsx)(X.Z,{variant:"text",size:"small",color:"primary",className:J.advancedButton,onClick:()=>le(!0),children:"Advanced Options"})})]}),oe&&(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(z.Z,{paddingTop:4,paddingBottom:4,children:(0,c.jsx)(es.Z,{})}),(0,c.jsx)(d.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:xt,children:"Delete Entity"})]})]}):(0,c.jsx)(_n.Z,{severity:"error",children:"Internal error: Unknown state"})},Wt=v=>{const{open:x,onConfirm:I,onClose:$,entity:J}=v;return(0,c.jsxs)(pn.Z,{open:x,onClose:$,children:[(0,c.jsx)(Hn.Z,{id:"responsive-dialog-title",children:"Are you sure you want to unregister this entity?"}),(0,c.jsx)(ln.Z,{children:(0,c.jsx)(An,{entity:J,onConfirm:I})}),(0,c.jsx)(C.Z,{children:(0,c.jsx)(X.Z,{onClick:$,color:"primary",children:"Cancel"})})]})};var bs=t(12231),Ss=t(9520),ws=t(47603);const Cs=(0,D.Z)(v=>({root:{backgroundColor:"rgba(0, 0, 0, .11)",boxShadow:"none",margin:v.spacing(1,0,1,0)},title:{margin:v.spacing(1,0,0,1),textTransform:"uppercase",fontSize:12,fontWeight:"bold"},listIcon:{minWidth:30,color:v.palette.text.primary},menuItem:{minHeight:v.spacing(6)},groupWrapper:{margin:v.spacing(1,1,2,1)}}),{name:"CatalogReactUserListPicker"});function js(v){return[{name:"Personal",items:[{id:"owned",label:"Owned",icon:ws.Z},{id:"starred",label:"Starred",icon:_t.Z}]},{name:v!=null?v:"Company",items:[{id:"all",label:"All"}]}]}const Es=v=>{const{initialFilter:x,availableFilters:I}=v,$=Cs(),J=(0,r.h_)(r.Ds);var K;const oe=(K=J.getOptionalString("organization.name"))!==null&&K!==void 0?K:"Company",{filters:le,updateFilters:Se,backendEntities:Be,queryParameters:{kind:$e,user:Ae},loading:Je}=un(),xt=["starred","all"],It=js(oe).map(Rn=>({...Rn,items:Rn.items.filter(({id:$n})=>["group","user"].some(vr=>vr===$e)?xt.includes($n):!I||I.includes($n))})).filter(({items:Rn})=>!!Rn.length),{isStarredEntity:et}=ge(),{isOwnedEntity:$t,loading:Dt}=Ne(),fn=Je||Dt,rn=(0,P.useMemo)(()=>new tt("owned",$t,et),[$t,et]),tr=(0,P.useMemo)(()=>new tt("starred",$t,et),[$t,et]),wn=(0,P.useMemo)(()=>[Ae].flat()[0],[Ae]),[Tn,In]=(0,P.useState)(wn!=null?wn:x),Lr=(0,P.useMemo)(()=>Be.filter(gt((0,Vt.compact)(Object.values({...le,user:void 0})))),[le,Be]),Pr=(0,P.useMemo)(()=>({all:Lr.length,starred:Lr.filter(Rn=>tr.filterEntity(Rn)).length,owned:Lr.filter(Rn=>rn.filterEntity(Rn)).length}),[Lr,tr,rn]);(0,P.useEffect)(()=>{wn&&In(wn)},[wn]),(0,P.useEffect)(()=>{!fn&&!!Tn&&Tn!=="all"&&Pr[Tn]===0&&In("all")},[fn,Pr,Tn,In]),(0,P.useEffect)(()=>{Se({user:Tn?new tt(Tn,$t,et):void 0})},[Tn,$t,et,Se]);var kr;return(0,c.jsx)(fr.Z,{className:$.root,children:It.map(Rn=>(0,c.jsxs)(P.Fragment,{children:[(0,c.jsx)(_.Z,{variant:"subtitle2",component:"span",className:$.title,children:Rn.name}),(0,c.jsx)(fr.Z,{className:$.groupWrapper,children:(0,c.jsx)(rr.Z,{disablePadding:!0,dense:!0,role:"menu","aria-label":Rn.name,children:Rn.items.map($n=>{var vr;return(0,c.jsxs)(bs.Z,{role:"none presentation",button:!0,divider:!0,onClick:()=>In($n.id),selected:$n.id===((vr=le.user)===null||vr===void 0?void 0:vr.value),className:$.menuItem,disabled:Pr[$n.id]===0,"data-testid":`user-picker-${$n.id}`,tabIndex:0,ContainerProps:{role:"menuitem"},children:[$n.icon&&(0,c.jsx)(pr.Z,{className:$.listIcon,children:(0,c.jsx)($n.icon,{fontSize:"small"})}),(0,c.jsx)(Ar.Z,{children:(0,c.jsxs)(_.Z,{variant:"body1",children:[$n.label," "]})}),(0,c.jsx)(Ss.Z,{children:(kr=Pr[$n.id])!==null&&kr!==void 0?kr:"-"})]},$n.id)})})})]},Rn.name))})},rs=(0,D.Z)({input:{}},{name:"CatalogReactEntityProcessingStatusPickerPicker"}),Rr=(0,c.jsx)(Pe.Z,{fontSize:"small"}),zs=(0,c.jsx)(ye.Z,{fontSize:"small"}),As=()=>{const v=rs(),{updateFilters:x}=un(),[I,$]=(0,P.useState)([]);function J(le){x({orphan:le?new mt(le):void 0})}function K(le){x({error:le?new Zt(le):void 0})}const oe=["Is Orphan","Has Error"];return(0,c.jsx)(z.Z,{pb:1,pt:1,children:(0,c.jsxs)(_.Z,{variant:"button",component:"label",children:["Processing Status",(0,c.jsx)(Ue.ZP,{multiple:!0,options:oe,value:I,onChange:(le,Se)=>{$(Se),J(Se.includes("Is Orphan")),K(Se.includes("Has Error"))},renderOption:(le,{selected:Se})=>(0,c.jsx)(U.Z,{control:(0,c.jsx)(de.Z,{icon:Rr,checkedIcon:zs,checked:Se}),label:le}),size:"small",popupIcon:(0,c.jsx)(Re.Z,{"data-testid":"processing-status-picker-expand"}),renderInput:le=>(0,c.jsx)(pe.Z,{...le,className:v.input,variant:"outlined"})})]})})},Ts=({children:v,value:x})=>{var I;const[$,J]=useState((I=x==null?void 0:x.filters)!==null&&I!==void 0?I:{}),K=useCallback(xt=>{J(It=>{const et=typeof xt=="function"?xt(It):xt;return{...It,...et}})},[]),oe=useMemo(()=>({entities:[],backendEntities:[],queryParameters:{}}),[]);var le,Se,Be,$e,Ae;const Je=useMemo(()=>({entities:(le=x==null?void 0:x.entities)!==null&&le!==void 0?le:oe.entities,backendEntities:(Se=x==null?void 0:x.backendEntities)!==null&&Se!==void 0?Se:oe.backendEntities,updateFilters:(Be=x==null?void 0:x.updateFilters)!==null&&Be!==void 0?Be:K,filters:$,loading:($e=x==null?void 0:x.loading)!==null&&$e!==void 0?$e:!1,queryParameters:(Ae=x==null?void 0:x.queryParameters)!==null&&Ae!==void 0?Ae:oe.queryParameters,error:x==null?void 0:x.error}),[x,oe,$,K]);return _jsx(EntityListContext.Provider,{value:Je,children:v})}},33414:function(Rt,Me,t){"use strict";t.r(Me),t.d(Me,{AboutCard:function(){return ft},AboutContent:function(){return Xe},AboutField:function(){return q}});var h=t(52322),r=t(25271),W=t(93414),B=t(25248),g=t(32838),b=t(92848),c=t(79692),P=t(94339),te=t(32552),Q=t(61837),X=t(85256),M=t(24579),z=t(52866),_=t(30254),fe=t(27604),ie=t(2784),T=t(19625),L=t(60905),Z=t(90436),A=t(7089);const S=(0,c.Z)(je=>({value:{fontWeight:"bold",overflow:"hidden",lineHeight:"24px",wordBreak:"break-word"},label:{color:je.palette.text.secondary,textTransform:"uppercase",fontSize:"10px",fontWeight:"bold",letterSpacing:.5,overflow:"hidden",whiteSpace:"nowrap"}}));function q(je){const{label:Ge,value:st,gridSizes:gt,children:rt}=je,ot=S(),ct=(0,B.vJ)(rt,Lt=>Lt.getElements()),yt=ct.length>0?ct:(0,h.jsx)(Z.Z,{variant:"body2",className:ot.value,children:st||"unknown"});return(0,h.jsxs)(L.Z,{item:!0,...gt,children:[(0,h.jsx)(Z.Z,{variant:"h2",className:ot.label,children:Ge}),yt]})}var Te=t(24851);const Qe=(0,c.Z)({description:{wordBreak:"break-word"}});function Ye(je,Ge,st){if(Ge==="url"||je.includes("://"))return je;const gt=st.type==="file"?`file://${st.target}`:st.target;return Ge==="file"||st.type==="file"?new URL(je,gt).href:gt}function Xe(je){var Ge,st,gt,rt,ot,ct,yt,Lt;const{entity:We}=je,se=Qe(),Ie=We.kind.toLocaleLowerCase("en-US")==="system",Le=We.kind.toLocaleLowerCase("en-US")==="resource",tt=We.kind.toLocaleLowerCase("en-US")==="component",mt=We.kind.toLocaleLowerCase("en-US")==="api",Zt=We.kind.toLocaleLowerCase("en-US")==="template",dt=We.kind.toLocaleLowerCase("en-US")==="location",Et=We.kind.toLocaleLowerCase("en-US")==="group",At=(0,b.hF)(We,r.cz,{kind:"system"}),Ot=(0,b.hF)(We,r.cz,{kind:"component"}),qt=(0,b.hF)(We,r.cz,{kind:"domain"}),Vt=(0,b.hF)(We,r.S4);let Ht;try{Ht=(0,r.CV)(We)}catch{Ht=void 0}return(0,h.jsxs)(L.Z,{container:!0,children:[(0,h.jsx)(q,{label:"Description",gridSizes:{xs:12},children:(0,h.jsx)(Z.Z,{variant:"body2",paragraph:!0,className:se.description,children:(We==null||(Ge=We.metadata)===null||Ge===void 0?void 0:Ge.description)||"No description"})}),(0,h.jsx)(q,{label:"Owner",value:"No Owner",gridSizes:{xs:12,sm:6,lg:4},children:Vt.length>0&&(0,h.jsx)(b.rI,{entityRefs:Vt,defaultKind:"group"})}),(Ie||qt.length>0)&&(0,h.jsx)(q,{label:"Domain",value:"No Domain",gridSizes:{xs:12,sm:6,lg:4},children:qt.length>0&&(0,h.jsx)(b.rI,{entityRefs:qt,defaultKind:"domain"})}),(mt||tt||Le||At.length>0)&&(0,h.jsx)(q,{label:"System",value:"No System",gridSizes:{xs:12,sm:6,lg:4},children:At.length>0&&(0,h.jsx)(b.rI,{entityRefs:At,defaultKind:"system"})}),tt&&Ot.length>0&&(0,h.jsx)(q,{label:"Parent Component",value:"No Parent Component",gridSizes:{xs:12,sm:6,lg:4},children:(0,h.jsx)(b.rI,{entityRefs:Ot,defaultKind:"component"})}),(mt||tt||Le||Zt||Et||dt||typeof(We==null||(st=We.spec)===null||st===void 0?void 0:st.type)=="string")&&(0,h.jsx)(q,{label:"Type",value:We==null||(gt=We.spec)===null||gt===void 0?void 0:gt.type,gridSizes:{xs:12,sm:6,lg:4}}),(mt||tt||typeof(We==null||(rt=We.spec)===null||rt===void 0?void 0:rt.lifecycle)=="string")&&(0,h.jsx)(q,{label:"Lifecycle",value:We==null||(ot=We.spec)===null||ot===void 0?void 0:ot.lifecycle,gridSizes:{xs:12,sm:6,lg:4}}),(0,h.jsx)(q,{label:"Tags",value:"No Tags",gridSizes:{xs:12,sm:6,lg:4},children:((We==null||(ct=We.metadata)===null||ct===void 0?void 0:ct.tags)||[]).map(Jt=>(0,h.jsx)(A.Z,{size:"small",label:Jt},Jt))}),dt&&((We==null||(yt=We.spec)===null||yt===void 0?void 0:yt.targets)||(We==null||(Lt=We.spec)===null||Lt===void 0?void 0:Lt.target))&&(0,h.jsx)(q,{label:"Targets",gridSizes:{xs:12},children:(0,h.jsx)(Te.s,{cols:1,items:(We.spec.targets||[We.spec.target]).map(Jt=>Jt).map(Jt=>{var dn;return{text:Jt,href:Ye(Jt,(We==null||(dn=We.spec)===null||dn===void 0?void 0:dn.type)||"unknown",Ht)}})})})]})}const Ve=(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 ft(je){var Ge,st,gt;const{variant:rt}=je,ot=Ve(),{entity:ct}=(0,b.X2)(),yt=(0,B.h_)(g.q3),Lt=(0,B.h_)(b.Ah),We=(0,B.h_)(B.$v),se=(0,B.h_)(B.VE),Ie=(0,B.tg)(T.jU),Le=(0,b.CV)(ct,yt),tt=(Ge=ct.metadata.annotations)===null||Ge===void 0?void 0:Ge[r.Tf],mt={label:"View Source",disabled:!Le,icon:(0,h.jsx)(g.nW,{type:Le==null?void 0:Le.integrationType}),href:Le==null?void 0:Le.locationTargetUrl},Zt={label:"View TechDocs",disabled:!(!((st=ct.metadata.annotations)===null||st===void 0)&&st["backstage.io/techdocs-ref"])||!Ie,icon:(0,h.jsx)(_.Z,{}),href:Ie&&Ie({namespace:ct.metadata.namespace||r.zG,kind:ct.kind,name:ct.metadata.name})};let dt="";rt==="gridItem"?dt=ot.gridItemCard:rt==="fullHeight"&&(dt=ot.fullHeightCard);let Et="";rt==="gridItem"?Et=ot.gridItemCardContent:rt==="fullHeight"&&(Et=ot.fullHeightCardContent);const At=(gt=ct.metadata.annotations)===null||gt===void 0?void 0:gt[r.P1],Ot=(At==null?void 0:At.startsWith("url:"))||(At==null?void 0:At.startsWith("file:")),qt=(0,ie.useCallback)(async()=>{try{await Lt.refreshEntity((0,r.eE)(ct)),We.post({message:"Refresh scheduled",severity:"info"})}catch(Vt){se.post(Vt)}},[Lt,We,se,ct]);return(0,h.jsxs)(P.Z,{className:dt,children:[(0,h.jsx)(te.Z,{title:"About",action:(0,h.jsxs)(h.Fragment,{children:[Ot&&(0,h.jsx)(Q.Z,{"aria-label":"Refresh",title:"Schedule entity refresh",onClick:qt,children:(0,h.jsx)(z.Z,{})}),(0,h.jsx)(Q.Z,{component:W.rU,"aria-label":"Edit",disabled:!tt,title:"Edit Metadata",to:tt!=null?tt:"#",children:(0,h.jsx)(fe.Z,{})})]}),subheader:(0,h.jsx)(W.M6,{links:[mt,Zt]})}),(0,h.jsx)(X.Z,{}),(0,h.jsx)(M.Z,{className:Et,children:(0,h.jsx)(Xe,{entity:ct})})]})}},86359:function(Rt,Me,t){"use strict";t.d(Me,{E:function(){return ie}});var h=t(52322),r=t(25271),W=t(93414),B=t(92848),g=t(90436),b=t(15459),c=t(27604),P=t(2997),te=t(11640),Q=t(28347),X=t(76635),M=t(2784),z=t(7089);const _=Object.freeze({createNameColumn(T){function L(Z){var A;return((A=Z.metadata)===null||A===void 0?void 0:A.title)||(0,B.$3)(Z,{defaultKind:T==null?void 0:T.defaultKind})}return{title:"Name",field:"resolved.name",highlight:!0,customSort({entity:Z},{entity:A}){return L(Z).localeCompare(L(A))},render:({entity:Z})=>{var A;return(0,h.jsx)(B.dx,{entityRef:Z,defaultKind:(T==null?void 0:T.defaultKind)||"Component",title:(A=Z.metadata)===null||A===void 0?void 0:A.title})}}},createSystemColumn(){return{title:"System",field:"resolved.partOfSystemRelationTitle",render:({resolved:T})=>(0,h.jsx)(B.rI,{entityRefs:T.partOfSystemRelations,defaultKind:"system"})}},createOwnerColumn(){return{title:"Owner",field:"resolved.ownedByRelationsTitle",render:({resolved:T})=>(0,h.jsx)(B.rI,{entityRefs:T.ownedByRelations,defaultKind:"group"})}},createSpecTargetsColumn(){return{title:"Targets",field:"entity.spec.targets",render:({entity:T})=>{var L,Z;return(0,h.jsx)(h.Fragment,{children:((T==null||(L=T.spec)===null||L===void 0?void 0:L.targets)||(T==null||(Z=T.spec)===null||Z===void 0?void 0:Z.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(L=>(0,h.jsx)(z.Z,{label:L,size:"small",variant:"outlined",style:{marginBottom:"0px"}},L))}),width:"auto"}},createTitleColumn(T){return{title:"Title",field:"entity.metadata.title",hidden:T==null?void 0:T.hidden,searchable:!0}},createLabelColumn(T,L){return{title:(L==null?void 0:L.title)||"Label",field:"entity.metadata.labels",cellStyle:{padding:"0px 16px 0px 20px"},render:({entity:Z})=>{var A;const S=(A=Z.metadata)===null||A===void 0?void 0:A.labels,q=S&&S[T]||(L==null?void 0:L.defaultValue);return(0,h.jsx)(h.Fragment,{children:q&&(0,h.jsx)(z.Z,{label:q,size:"small",variant:"outlined"},q)})},width:"auto"}}}),fe=(0,b.Z)({root:{color:"#f3ba37"}})(te.Z),ie=T=>{var L,Z;const{columns:A,actions:S,tableOptions:q,subtitle:Te,emptyContent:Qe}=T,{isStarredEntity:Ye,toggleStarredEntity:Xe}=(0,B.CR)(),{loading:Ve,error:ft,entities:je,filters:Ge}=(0,B.wp)(),st=(0,M.useMemo)(()=>{var se;return[_.createTitleColumn({hidden:!0}),_.createNameColumn({defaultKind:(se=Ge.kind)===null||se===void 0?void 0:se.value}),...Ie(),_.createMetadataDescriptionColumn(),_.createTagsColumn()];function Ie(){var Le;switch((Le=Ge.kind)===null||Le===void 0?void 0:Le.value){case"user":return[];case"domain":case"system":return[_.createOwnerColumn()];case"group":case"template":return[_.createSpecTypeColumn()];case"location":return[_.createSpecTypeColumn(),_.createSpecTargetsColumn()];default:return[_.createSystemColumn(),_.createOwnerColumn(),_.createSpecTypeColumn(),_.createSpecLifecycleColumn()]}}},[(L=Ge.kind)===null||L===void 0?void 0:L.value]),gt=Ge.type===void 0;var rt;const ot=(0,X.capitalize)((rt=(Z=Ge.user)===null||Z===void 0?void 0:Z.value)!==null&&rt!==void 0?rt:"all");if(ft)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:ft.toString()})})});const ct=[({entity:se})=>{var Ie;const Le=(Ie=se.metadata.annotations)===null||Ie===void 0?void 0:Ie[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:!Le,onClick:()=>{!Le||window.open(Le,"_blank")}}},({entity:se})=>{var Ie;const Le=(Ie=se.metadata.annotations)===null||Ie===void 0?void 0:Ie[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:!Le,onClick:()=>{!Le||window.open(Le,"_blank")}}},({entity:se})=>{const Ie=Ye(se),Le=Ie?"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:Le}),Ie?(0,h.jsx)(fe,{}):(0,h.jsx)(Q.Z,{})]}),tooltip:Le,onClick:()=>Xe(se)}}],yt=je.map(se=>{const Ie=(0,B.hF)(se,r.cz,{kind:"system"}),Le=(0,B.hF)(se,r.S4);return{entity:se,resolved:{name:(0,B.$3)(se,{defaultKind:"Component"}),ownedByRelationsTitle:Le.map(tt=>(0,B.$3)(tt,{defaultKind:"group"})).join(", "),ownedByRelations:Le,partOfSystemRelationTitle:Ie.map(tt=>(0,B.$3)(tt,{defaultKind:"system"})).join(", "),partOfSystemRelations:Ie}}}),Lt=(A||st).find(se=>se.title==="Type");Lt&&(Lt.hidden=!gt);const We=yt.length>20;return(0,h.jsx)(W.iA,{isLoading:Ve,columns:A||st,options:{paging:We,pageSize:20,actionsColumnIndex:-1,loadingType:"linear",showEmptyDataSourceMessage:!Ve,padding:"dense",pageSizeOptions:[20,50,100],...q},title:`${ot} (${je.length})`,data:yt,actions:S||ct,subtitle:Te,emptyContent:Qe})};ie.columns=_},24851:function(Rt,Me,t){"use strict";t.d(Me,{s:function(){return fe}});var h=t(52322),r=t(90348),W=t(11861),B=t(2784),g=t(79692),b=t(95544),c=t(90436),P=t(52160),te=t(93414);const Q=(0,g.Z)({svgIcon:{display:"inline-block","& svg":{display:"inline-block",fontSize:"inherit",verticalAlign:"baseline"}}});function X(ie){const{href:T,text:L,Icon:Z}=ie,A=Q();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:Z?(0,h.jsx)(Z,{}):(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:L||T})})]})}var M=t(41156);const z={xs:1,sm:1,md:1,lg:2,xl:3};function _(ie){const T=[(0,M.Z)(S=>S.breakpoints.up("xl"))?"xl":null,(0,M.Z)(S=>S.breakpoints.up("lg"))?"lg":null,(0,M.Z)(S=>S.breakpoints.up("md"))?"md":null,(0,M.Z)(S=>S.breakpoints.up("sm"))?"sm":null,(0,M.Z)(S=>S.breakpoints.up("xs"))?"xs":null];let L=1;if(typeof ie=="number")L=ie;else{var Z;const S=(Z=T.find(q=>q!==null))!==null&&Z!==void 0?Z:"xs";var A;L=(A=ie==null?void 0:ie[S])!==null&&A!==void 0?A:z[S]}return L}function fe(ie){const{items:T,cols:L=void 0}=ie,Z=_(L);return(0,h.jsx)(r.Z,{rowHeight:"auto",cols:Z,children:T.map(({text:A,href:S,Icon:q},Te)=>(0,h.jsx)(W.Z,{children:(0,h.jsx)(X,{href:S,text:A!=null?A:S,Icon:q})},Te))})}},19625:function(Rt,Me,t){"use strict";t.d(Me,{_Z:function(){return B},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"]}),B=(0,h.NT)({id:"catalog"})},51666:function(Rt,Me,t){"use strict";t.d(Me,{rG:function(){return h},Y2:function(){return Z},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,S){return A.name===S.name}function W(A,S){return"resourceType"in A?!S||A.resourceType===S:!1}function B(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(S,q)=>await A.authorize(S,q),authorizeConditional(S,q){const Te=S;return A.authorize(Te,q)}}}function te({name:A,attributes:S,resourceType:q}){return q?{type:"resource",name:A,attributes:S,resourceType:q}:{type:"basic",name:A,attributes:S}}var Q=t(23054),X=t(96279),M=t.n(X),z=t(9571),_=t(30195);const fe=_.z.lazy(()=>_.z.object({rule:_.z.string(),resourceType:_.z.string(),params:_.z.record(_.z.any()).optional()}).or(_.z.object({anyOf:_.z.array(fe).nonempty()})).or(_.z.object({allOf:_.z.array(fe).nonempty()})).or(_.z.object({not:fe}))),ie=_.z.object({result:_.z.literal(h.ALLOW).or(_.z.literal(h.DENY))}),T=_.z.union([_.z.object({result:_.z.literal(h.ALLOW).or(_.z.literal(h.DENY))}),_.z.object({result:_.z.literal(h.CONDITIONAL),pluginId:_.z.string(),resourceType:_.z.string(),conditions:fe})]),L=(A,S)=>_.z.object({items:_.z.array(_.z.intersection(_.z.object({id:_.z.string()}),A)).refine(q=>q.length===S.size&&q.every(({id:Te})=>S.has(Te)),{message:"Items in response do not match request"})});class Z{async authorize(S,q){return this.makeRequest(S,ie,q)}async authorizeConditional(S,q){return this.makeRequest(S,T,q)}async makeRequest(S,q,Te){if(!this.enabled)return S.map(Ge=>({result:h.ALLOW}));const Qe={items:S.map(Ge=>({id:z.Z(),...Ge}))},Ye=await this.discovery.getBaseUrl("permission"),Xe=await M()(`${Ye}/authorize`,{method:"POST",body:JSON.stringify(Qe),headers:{...this.getAuthorizationHeader(Te==null?void 0:Te.token),"content-type":"application/json"}});if(!Xe.ok)throw await Q.VL.fromResponse(Xe);const Ve=await Xe.json(),je=L(q,new Set(Qe.items.map(({id:Ge})=>Ge))).parse(Ve).items.reduce((Ge,st)=>(Ge[st.id]=st,Ge),{});return Qe.items.map(Ge=>je[Ge.id])}getAuthorizationHeader(S){return S?{Authorization:`Bearer ${S}`}:{}}constructor(S){this.discovery=S.discovery;var q;this.enabled=(q=S.config.getOptionalBoolean("permission.enabled"))!==null&&q!==void 0?q:!1}}},25488:function(Rt,Me,t){"use strict";t.d(Me,{iM:function(){return b},RV:function(){return B},gI:function(){return P}});var h=t(52322),r=t(2784),W=t(25248);const B=(0,W.T0)({id:"plugin.permission.api"});var g=t(51666);class b{static create(M){const{config:z,discovery:_,identity:fe}=M,ie=new g.Y2({discovery:_,config:z});return new b(ie,fe)}async authorize(M){return(await this.permissionClient.authorize([M],await this.identityApi.getCredentials()))[0]}constructor(M,z){this.permissionClient=M,this.identityApi=z}}var c=t(49857);function P(X){const M=(0,W.h_)(B),{data:z,error:_}=(0,c.ZP)(X,async fe=>{if((0,g.g2)(fe.permission)&&!fe.resourceRef)return g.rG.DENY;const{result:ie}=await M.authorize(fe);return ie});return _?{error:_,loading:!1,allowed:!1}:z===void 0?{loading:!0,allowed:!1}:{loading:!1,allowed:z===g.rG.ALLOW}}const te=X=>{const{permission:M,resourceRef:z,errorComponent:_,...fe}=X,ie=usePermission(isResourcePermission(M)?{permission:M,resourceRef:z}:{permission:M}),T=useApp(),{NotFoundErrorPage:L}=T.getComponents();let Z=_===void 0?_jsx(L,{}):_;return ie.loading?Z=null:ie.allowed&&(Z=X.element),_jsx(Route,{...fe,element:Z})};function Q(X){const{permission:M,resourceRef:z}=X,_=usePermission(isResourcePermission(M)?{permission:M,resourceRef:z}:{permission:M}),fe=useApp();if(_.loading)return null;if(_.allowed)return _jsx(_Fragment,{children:X.children});if(X.errorPage)return _jsx(_Fragment,{children:X.errorPage});const{NotFoundErrorPage:ie}=fe.getComponents();return _jsx(ie,{})}},65826:function(Rt,Me,t){"use strict";t.d(Me,{FA:function(){return P},qO:function(){return rt},Nd:function(){return Ye},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(U){this.mockedResults=U}}var B=t(52322),g=t(2784),b=t(79692);const c=(0,b.Z)(()=>({highlight:{}}),{name:"BackstageHighlightedSearchResultText"}),P=({text:D,preTag:U,postTag:de})=>{const pe=c(),ye=(0,g.useMemo)(()=>D.split(new RegExp(`(${U}.+?${de})`)),[de,U,D]);return(0,B.jsx)(B.Fragment,{children:ye.map((Pe,Re)=>Pe.includes(U)?(0,B.jsx)("mark",{className:pe.highlight,children:Pe.replace(new RegExp(`${U}|${de}`,"g"),"")},Re):Pe)})};var te=t(48760),Q=t(50581),X=t(61837),M=t(74603),z=t(21853),_=t(33375),fe=t(76635),ie=t(64279),T=t(1849),L=t(51837);const Z=(0,L.CT)("search-context"),A=()=>{const D=(0,g.useContext)(Z);if(!D)throw new Error("useSearch must be used within a SearchContextProvider");const U=D.atVersion(1);if(!U)throw new Error("No SearchContext v1 found");return U},S=()=>(0,g.useContext)(Z)!==void 0,q={term:"",types:[],filters:{},pageLimit:void 0,pageCursor:void 0},Te=(D=q)=>{var U,de,pe,ye;const Pe=(0,h.h_)(r),[Re,Ue]=(0,g.useState)(D.term),[nt,w]=(0,g.useState)(D.types),[H,ve]=(0,g.useState)(D.filters),[ue,we]=(0,g.useState)(D.pageLimit),[ke,Fe]=(0,g.useState)(D.pageCursor),it=(0,T.Z)(Re),Ct=(0,T.Z)(H),Ke=(0,ie.default)(()=>Pe.query({term:Re,types:nt,filters:H,pageLimit:ue,pageCursor:ke}),[Re,nt,H,ue,ke]),ht=!Ke.loading&&!Ke.error&&((U=Ke.value)===null||U===void 0?void 0:U.nextPageCursor),vt=!Ke.loading&&!Ke.error&&((de=Ke.value)===null||de===void 0?void 0:de.previousPageCursor),at=(0,g.useCallback)(()=>{var Mt;Fe((Mt=Ke.value)===null||Mt===void 0?void 0:Mt.nextPageCursor)},[(pe=Ke.value)===null||pe===void 0?void 0:pe.nextPageCursor]),Tt=(0,g.useCallback)(()=>{var Mt;Fe((Mt=Ke.value)===null||Mt===void 0?void 0:Mt.previousPageCursor)},[(ye=Ke.value)===null||ye===void 0?void 0:ye.previousPageCursor]);return(0,g.useEffect)(()=>{it!==void 0&&Re!==it&&Fe(void 0)},[Re,it,Fe]),(0,g.useEffect)(()=>{Ct!==void 0&&!(0,fe.isEqual)(H,Ct)&&Fe(void 0)},[H,Ct,Fe]),{result:Ke,term:Re,setTerm:Ue,types:nt,setTypes:w,filters:H,setFilters:ve,pageLimit:ue,setPageLimit:we,pageCursor:ke,setPageCursor:Fe,fetchNextPage:ht?at:void 0,fetchPreviousPage:vt?Tt:void 0}},Qe=D=>{const{initialState:U,children:de}=D,pe=Te(U);return(0,B.jsx)(h.fC,{attributes:{searchTypes:pe.types.sort().join(",")},children:(0,B.jsx)(Z.Provider,{value:(0,L.EI)({1:pe}),children:de})})},Ye=D=>{const{initialState:U,inheritParentContextIfAvailable:de,children:pe}=D;return S()&&de?(0,B.jsx)(B.Fragment,{children:pe}):(0,B.jsx)(Qe,{initialState:U,children:pe})},Xe=({children:D})=>{var U;const de=H=>(0,T.Z)(H)!==H,pe=(0,h.z$)(),{term:ye,result:Pe}=A();var Re;const Ue=(Re=(U=Pe.value)===null||U===void 0?void 0:U.numberOfResults)!==null&&Re!==void 0?Re:void 0,w=de(Pe.loading)&&!Pe.loading;return(0,g.useEffect)(()=>{ye&&w&&pe.captureEvent("search",ye,{value:Ue})},[pe,ye,Ue,w]),(0,B.jsx)(B.Fragment,{children:D})};function Ve(D){return(0,g.forwardRef)((U,de)=>(0,B.jsx)(Ye,{inheritParentContextIfAvailable:!0,children:(0,B.jsx)(D,{...U,ref:de})}))}const ft=Ve((0,g.forwardRef)((D,U)=>{const{onChange:de,onKeyDown:pe=()=>{},onClear:ye=()=>{},onSubmit:Pe=()=>{},debounceTime:Re=200,clearButton:Ue=!0,fullWidth:nt=!0,value:w,placeholder:H,inputProps:ve={},endAdornment:ue,...we}=D,ke=(0,h.h_)(h.Ds),[Fe,it]=(0,g.useState)("");(0,g.useEffect)(()=>{it(Ut=>Ut!==w?String(w):Ut)},[w]),(0,te.Z)(()=>de(Fe),Re,[Fe]);const Ct=(0,g.useCallback)(Ut=>{it(Ut.target.value)},[it]),Ke=(0,g.useCallback)(Ut=>{pe&&pe(Ut),Pe&&Ut.key==="Enter"&&Pe()},[pe,Pe]),ht=(0,g.useCallback)(()=>{de(""),ye&&ye()},[de,ye]),vt=H!=null?H:`Search in ${ke.getOptionalString("app.title")||"Backstage"}`,at=(0,B.jsx)(Q.Z,{position:"start",children:(0,B.jsx)(X.Z,{"aria-label":"Query",size:"small",disabled:!0,children:(0,B.jsx)(z.Z,{})})}),Tt=(0,B.jsx)(Q.Z,{position:"end",children:(0,B.jsx)(X.Z,{"aria-label":"Clear",size:"small",onClick:ht,children:(0,B.jsx)(_.Z,{})})});return(0,B.jsx)(Xe,{children:(0,B.jsx)(M.Z,{"data-testid":"search-bar-next",ref:U,value:Fe,placeholder:vt,startAdornment:at,endAdornment:Ue?Tt:ue,inputProps:{"aria-label":"Search",...ve},fullWidth:nt,onChange:Ct,onKeyDown:Ke,...we})})})),je=Ve((0,g.forwardRef)((D,U)=>{const{value:de="",onChange:pe,...ye}=D,{term:Pe,setTerm:Re}=A();(0,g.useEffect)(()=>{de&&Re(String(de))},[de,Re]);const Ue=(0,g.useCallback)(nt=>{pe?pe(nt):Re(nt)},[pe,Re]);return(0,B.jsx)(h.fC,{attributes:{pluginId:"search",extension:"SearchBar"},children:(0,B.jsx)(ft,{...ye,ref:U,value:Pe,onChange:Ue})})}));var Ge=t(4614),st=t(88013);const rt=(D=>U=>(0,B.jsx)(Ye,{inheritParentContextIfAvailable:!0,children:(0,B.jsx)(D,{...U})}))(function(U){const{loading:de,value:pe,onChange:ye=()=>{},options:Pe=[],getOptionLabel:Re=ht=>String(ht),inputPlaceholder:Ue,inputDebounceTime:nt,freeSolo:w=!0,fullWidth:H=!0,clearOnBlur:ve=!1,"data-testid":ue="search-autocomplete",...we}=U,{setTerm:ke}=A(),Fe=(0,g.useCallback)(ht=>ht?typeof ht=="string"?ht:Re(ht):"",[Re]),it=(0,g.useMemo)(()=>Fe(pe),[pe,Fe]),Ct=(0,g.useCallback)((ht,vt,at,Tt)=>{ke(Fe(vt)),ye(ht,vt,at,Tt)},[Fe,ke,ye]),Ke=(0,g.useCallback)(({InputProps:{ref:ht,endAdornment:vt},InputLabelProps:at,...Tt})=>(0,B.jsx)(je,{...Tt,ref:ht,clearButton:!1,value:it,placeholder:Ue,debounceTime:nt,endAdornment:de?(0,B.jsx)(Ge.Z,{"data-testid":"search-autocomplete-progressbar",color:"inherit",size:20}):vt}),[de,it,Ue,nt]);return(0,B.jsx)(st.ZP,{...we,"data-testid":ue,value:pe,onChange:Ct,options:Pe,getOptionLabel:Re,renderInput:Ke,freeSolo:w,fullWidth:H,clearOnBlur:ve})}),ot=({icon:D,primaryText:U,primaryTextTypographyProps:de,secondaryText:pe,secondaryTextTypographyProps:ye,disableTextTypography:Pe})=>_jsxs(_Fragment,{children:[D?_jsx(ListItemIcon,{children:D}):null,_jsx(ListItemText,{primary:U,primaryTypographyProps:de,secondary:pe,secondaryTypographyProps:ye,disableTypography:Pe})]});var ct=t(42494),yt=t(84899),Lt=t(5806),We=t(21324),se=t(56939),Ie=t(73698),Le=t(12231),tt=t(86619),mt=t(7089),Zt=t(69294);const dt=(D,U,de=[],pe=250)=>{const ye=(0,g.useRef)({}),Pe=D||(()=>Promise.resolve([])),[Re,Ue]=(0,Zt.default)(Pe,[U],{loading:!0});if((0,te.Z)(()=>{ye.current[U]===void 0&&(ye.current[U]=Ue(U).then(w=>(ye.current[U]=w,w)))},pe,[Ue,U]),de.length)return{loading:!1,value:de};const nt=ye.current[U];return Array.isArray(nt)?{loading:!1,value:nt}:Re},Et=(D,U)=>{const{setFilters:de}=A();(0,g.useEffect)(()=>{U&&[U].flat().length>0&&de(pe=>({...pe,[D]:U}))},[])},At=D=>{const{className:U,defaultValue:de,name:pe,values:ye,valuesDebounceMs:Pe,label:Re,filterSelectedOptions:Ue,limitTags:nt,multiple:w}=D,[H,ve]=(0,g.useState)("");Et(pe,de);const ue=typeof ye=="function"?ye:void 0,we=typeof ye=="function"?void 0:ye,{value:ke,loading:Fe}=dt(ue,H,we,Pe),{filters:it,setFilters:Ct}=A(),Ke=it[pe]||(w?[]:null),ht=(Tt,Ut)=>{Ct(Mt=>{const{[pe]:Wn,...Vn}=Mt;return Ut?{...Vn,[pe]:Ut}:{...Vn}})},vt=Tt=>(0,B.jsx)(tt.Z,{...Tt,name:"search",variant:"outlined",label:Re,fullWidth:!0}),at=(Tt,Ut)=>Tt.map((Mt,Wn)=>(0,B.jsx)(mt.Z,{label:Mt,color:"primary",...Ut({index:Wn})}));return(0,B.jsx)(st.ZP,{filterSelectedOptions:Ue,limitTags:nt,multiple:w,className:U,id:`${w?"multi-":""}select-filter-${pe}--select`,options:ke||[],loading:Fe,value:Ke,onChange:ht,onInputChange:(Tt,Ut)=>ve(Ut),renderInput:vt,renderTags:at})},Ot=(0,b.Z)({label:{textTransform:"capitalize"}}),qt=D=>{const{className:U,defaultValue:de,label:pe,name:ye,values:Pe=[],valuesDebounceMs:Re}=D,Ue=Ot(),{filters:nt,setFilters:w}=A();Et(ye,de);const H=typeof Pe=="function"?Pe:void 0,ve=typeof Pe=="function"?void 0:Pe,{value:ue=[],loading:we}=dt(H,"",ve,Re),ke=it=>{const{target:{value:Ct,checked:Ke}}=it;w(ht=>{const{[ye]:vt,...at}=ht,Tt=(vt||[]).filter(Mt=>Mt!==Ct),Ut=Ke?[...Tt,Ct]:Tt;return Ut.length?{...at,[ye]:Ut}:at})};var Fe;return(0,B.jsxs)(ct.Z,{className:U,disabled:we,fullWidth:!0,"data-testid":"search-checkboxfilter-next",children:[pe?(0,B.jsx)(yt.Z,{className:Ue.label,children:pe}):null,ue.map(it=>(0,B.jsx)(Lt.Z,{control:(0,B.jsx)(We.Z,{color:"primary",tabIndex:-1,inputProps:{"aria-labelledby":it},value:it,name:it,onChange:ke,checked:((Fe=nt[ye])!==null&&Fe!==void 0?Fe:[]).includes(it)}),label:it},it))]})},Vt=D=>{const{className:U,defaultValue:de,label:pe,name:ye,values:Pe,valuesDebounceMs:Re}=D,Ue=Ot();Et(ye,de);const nt=typeof Pe=="function"?Pe:void 0,w=typeof Pe=="function"?void 0:Pe,{value:H=[],loading:ve}=dt(nt,"",w,Re),{filters:ue,setFilters:we}=A(),ke=Fe=>{const{target:{value:it}}=Fe;we(Ct=>{const{[ye]:Ke,...ht}=Ct;return it?{...ht,[ye]:it}:ht})};return(0,B.jsxs)(ct.Z,{disabled:ve,className:U,variant:"filled",fullWidth:!0,"data-testid":"search-selectfilter-next",children:[pe?(0,B.jsx)(se.Z,{className:Ue.label,margin:"dense",children:pe}):null,(0,B.jsxs)(Ie.Z,{variant:"outlined",value:ue[ye]||"",onChange:ke,children:[(0,B.jsx)(Le.Z,{value:"",children:(0,B.jsx)("em",{children:"All"})}),H.map(Fe=>(0,B.jsx)(Le.Z,{value:Fe,children:Fe},Fe))]})]})},Ht=({component:D,...U})=>(0,B.jsx)(D,{...U});Ht.Checkbox=D=>(0,B.jsx)(Ht,{...D,component:qt}),Ht.Select=D=>(0,B.jsx)(Ht,{...D,component:Vt}),Ht.Autocomplete=D=>(0,B.jsx)(Ht,{...D,component:At});var Jt=t(93414);const dn=D=>{const{children:U}=D,pe=useSearch().result;return U(pe)},an=D=>{const{query:U,children:de}=D,pe=useApi(searchApiRef),ye=useAsync(()=>{const{term:Pe="",types:Re=[],filters:Ue={},...nt}=U;return pe.query({...nt,term:Pe,types:Re,filters:Ue})},[U]);return de(ye)},Fn=D=>{const{query:U,children:de}=D;return U?_jsx(an,{query:U,children:de}):_jsx(dn,{children:de})},En=D=>{const{query:U,children:de}=D;return _jsx(Fn,{query:U,children:({loading:pe,error:ye,value:Pe})=>pe?_jsx(Progress,{}):ye?_jsx(ResponseErrorPanel,{title:"Error encountered while fetching search results",error:ye}):Pe!=null&&Pe.results.length?de(Pe):_jsx(EmptyState,{missing:"data",title:"Sorry, no results were found"})})},Un=D=>_jsx(AnalyticsContext,{attributes:{pluginId:"search",extension:"SearchResult"},children:_jsx(En,{...D})}),mn=(0,b.Z)(D=>({root:{display:"flex",justifyContent:"space-between",gap:D.spacing(2),margin:D.spacing(2,0)}})),un=()=>{const{fetchNextPage:D,fetchPreviousPage:U}=useSearch(),de=mn();return!D&&!U?_jsx(_Fragment,{}):_jsxs("nav",{"aria-label":"pagination navigation",className:de.root,children:[_jsx(Button,{"aria-label":"previous page",disabled:!U,onClick:U,startIcon:_jsx(ArrowBackIosIcon,{}),children:"Previous"}),_jsx(Button,{"aria-label":"next page",disabled:!D,onClick:D,endIcon:_jsx(ArrowForwardIosIcon,{}),children:"Next"})]})};var Qt=t(48834).lW;const Mn=D=>Qt.from(D.toString(),"utf-8").toString("base64"),zn=D=>D?Number(Qt.from(D,"base64").toString("utf-8")):0,hn=D=>{const{total:U=-1,cursor:de,onCursorChange:pe,limit:ye=25,limitLabel:Pe="Results per page:",limitText:Re=({from:we,to:ke})=>U>0?`of ${U}`:`${we}-${ke}`,limitOptions:Ue,onLimitChange:nt,...w}=D,H=useMemo(()=>zn(de),[de]),ve=useCallback((we,ke)=>{pe==null||pe(Mn(ke))},[pe]),ue=useCallback(we=>{const ke=we.target.value;nt==null||nt(parseInt(ke,10))},[nt]);return _jsx(TablePagination,{...w,component:"div",count:U,page:H,onPageChange:ve,rowsPerPage:ye,labelRowsPerPage:Pe,labelDisplayedRows:Re,rowsPerPageOptions:Ue,onRowsPerPageChange:ue})},vn=D=>{const{pageLimit:U,setPageLimit:de,pageCursor:pe,setPageCursor:ye}=useSearch();return _jsx(hn,{...D,limit:U,onLimitChange:de,cursor:pe,onCursorChange:ye})},yn=({result:D,highlight:U,rank:de,icon:pe,secondaryAction:ye,lineClamp:Pe=5})=>{const Re=useAnalytics(),Ue=()=>{Re.captureEvent("discover",D.title,{attributes:{to:D.location},value:de})};return _jsxs(_Fragment,{children:[_jsxs(ListItem,{alignItems:"center",children:[pe&&_jsx(ListItemIcon,{children:pe}),_jsx(ListItemText,{primaryTypographyProps:{variant:"h6"},primary:_jsx(Link,{noTrack:!0,to:D.location,onClick:Ue,children:U!=null&&U.fields.title?_jsx(HighlightedSearchResultText,{text:(U==null?void 0:U.fields.title)||"",preTag:(U==null?void 0:U.preTag)||"",postTag:(U==null?void 0:U.postTag)||""}):D.title}),secondary:_jsx("span",{style:{display:"-webkit-box",WebkitBoxOrient:"vertical",WebkitLineClamp:Pe,overflow:"hidden"},children:U!=null&&U.fields.text?_jsx(HighlightedSearchResultText,{text:U.fields.text,preTag:U.preTag,postTag:U.postTag}):D.text})}),ye&&_jsx(Box,{alignItems:"flex-end",children:ye})]}),_jsx(Divider,{})]})},Ln=D=>_jsx(AnalyticsContext,{attributes:{pluginId:"search",extension:"DefaultResultListItem"},children:_jsx(yn,{...D})}),Pn=D=>{const{loading:U,error:de,resultItems:pe,renderResultItem:ye=Ue=>_jsx(DefaultResultListItem,{result:Ue.document},Ue.document.location),noResultsComponent:Pe=_jsx(EmptyState,{missing:"data",title:"Sorry, no results were found"}),...Re}=D;return _jsxs(List,{...Re,children:[U?_jsx(Progress,{}):null,!U&&de?_jsx(ResponseErrorPanel,{title:"Error encountered while fetching search results",error:de}):null,!U&&!de&&(pe==null?void 0:pe.length)?pe.map(ye):null,!U&&!de&&!(pe!=null&&pe.length)?_jsx(ListItem,{children:Pe}):null]})},xn=D=>{const{query:U,disableRenderingWithNoResults:de,...pe}=D;return _jsx(AnalyticsContext,{attributes:{pluginId:"search",extension:"SearchResultList"},children:_jsx(SearchResultState,{query:U,children:({loading:ye,error:Pe,value:Re})=>{var Ue;return!(!(Re==null||(Ue=Re.results)===null||Ue===void 0)&&Ue.length)&&de?null:_jsx(Pn,{...pe,loading:ye,error:Pe,resultItems:Re==null?void 0:Re.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)}})),Ee=D=>{const U=ee(),{label:de,children:pe,...ye}=D;return _jsx(Chip,{...ye,className:U.listSubheaderFilter,variant:"outlined",label:_jsxs(_Fragment,{children:[de,": ",pe]})})},Ne=()=>null,_e=(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 U=_e(),{label:de,value:pe="None",onChange:ye,onDelete:Pe}=D,Re=useCallback(Ue=>{ye(Ue.target.value)},[ye]);return _jsx(Ee,{label:de,onDelete:Pe,children:_jsx(Typography,{role:"textbox",component:"span",className:U.root,onChange:Re,contentEditable:!0,suppressContentEditableWarning:!0,children:pe})})},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}}})),k=D=>{const U=ae(),{label:de,value:pe="none",onChange:ye,onDelete:Pe,children:Re}=D,Ue=useCallback(nt=>{ye(nt.target.value)},[ye]);return _jsx(Ee,{label:de,onDelete:Pe,children:_jsxs(Select,{className:U.root,value:pe,onChange:Ue,input:_jsx(InputBase,{}),IconComponent:Ne,children:[_jsx(MenuItem,{value:"none",children:"None"}),Re]})})};function ce(D){const U=ee(),[de,pe]=useState(null),{loading:ye,error:Pe,icon:Re,title:Ue,titleProps:nt={},link:w=_jsxs(_Fragment,{children:["See all",_jsx(ArrowRightIcon,{className:U.listSubheaderLinkIcon})]}),linkProps:H={},filterOptions:ve,renderFilterOption:ue=Tt=>_jsx(MenuItem,{value:String(Tt),children:Tt},String(Tt)),filterFields:we,renderFilterField:ke,resultItems:Fe,renderResultItem:it=Tt=>_jsx(DefaultResultListItem,{result:Tt.document},Tt.document.location),noResultsComponent:Ct=_jsx(EmptyState,{missing:"data",title:"Sorry, no results were found"}),...Ke}=D,ht=useCallback(Tt=>{pe(Tt.currentTarget)},[]),vt=useCallback(()=>{pe(null)},[]);var at;return _jsxs(List,{...Ke,children:[_jsxs(ListSubheader,{className:U.listSubheader,children:[Re,_jsx(Typography,{className:U.listSubheaderName,component:"strong",...nt,children:Ue}),ve?_jsx(Chip,{className:U.listSubheaderChip,component:"button",icon:_jsx(AddIcon,{}),variant:"outlined",label:"Add filter","aria-controls":"filters-menu","aria-haspopup":"true",onClick:ht}):null,ve?_jsx(Menu,{id:"filters-menu",anchorEl:de,open:Boolean(de),onClose:vt,onClick:vt,keepMounted:!0,children:ve.map(ue)}):null,we==null?void 0:we.map(Tt=>(at=ke==null?void 0:ke(Tt))!==null&&at!==void 0?at:null),_jsx(Link,{className:U.listSubheaderLink,to:"/search",...H,children:w})]}),ye?_jsx(Progress,{}):null,!ye&&Pe?_jsx(ResponseErrorPanel,{title:"Error encountered while fetching search results",error:Pe}):null,!ye&&!Pe&&(Fe==null?void 0:Fe.length)?Fe.map(it):null,!ye&&!Pe&&!(Fe!=null&&Fe.length)?_jsx(ListItem,{children:Ct}):null]})}function Oe(D){const{query:U,linkProps:de={},disableRenderingWithNoResults:pe,...ye}=D,Pe=`/search?${qs.stringify({query:U.term,types:U.types,filters:U.filters,pageCursor:U.pageCursor},{arrayFormat:"brackets"})}`;return _jsx(AnalyticsContext,{attributes:{pluginId:"search",extension:"SearchResultGroup"},children:_jsx(SearchResultState,{query:U,children:({loading:Re,error:Ue,value:nt})=>{var w;if(!(!(nt==null||(w=nt.results)===null||w===void 0)&&w.length)&&pe)return null;var H;return _jsx(ce,{...ye,loading:Re,error:Ue,linkProps:{to:Pe,...de},resultItems:nt==null?void 0:nt.results,filterFields:Object.keys((H=U.filters)!==null&&H!==void 0?H:{})})}})})}},61886:function(Rt,Me,t){"use strict";t.d(Me,{Ox:function(){return Ge},jM:function(){return g},Zz:function(){return b},oZ:function(){return Ye},DR:function(){return c},ZS:function(){return Te},VA:function(){return rt},KY:function(){return te},gT:function(){return _},Dl:function(){return fe},ux:function(){return gt},$L:function(){return z},x1:function(){return Qe}});var h=t(52322),r=t(2784),W=t(79635),B=t(25248);const g="techdocs.addons.addon.v1",b="techdocs.addons.wrapper.v1",c=()=>null;(0,B.R5)(c,b,!0);const P=se=>`${g}.${se.toLocaleLowerCase("en-US")}`;function te(se){const{name:Ie,component:Le}=se;return(0,B.YO)({name:Ie,component:{sync:tt=>(0,h.jsx)(Le,{...tt})},data:{[g]:se,[P(Ie)]:!0}})}const Q=(se,Ie)=>se.selectByComponentData({key:Ie}).getElements()[0],X=se=>se.selectByComponentData({key:b}).selectByComponentData({key:g}),M=se=>se.selectByComponentData({key:b}).findComponentData({key:g}),z=()=>{const se=(0,W.pC)(),Ie=(0,B.vJ)(se,X),Le=(0,B.vJ)(se,M),tt=(0,r.useCallback)(dt=>{if(!Ie||!dt)return null;const Et=P(dt.name);var At;return(At=Q(Ie,Et))!==null&&At!==void 0?At:null},[Ie]),mt=(0,r.useCallback)(dt=>{const Et=Le.find(At=>At.name===dt);return Et?tt(Et):null},[Le,tt]),Zt=(0,r.useCallback)(dt=>{const Et=Le.filter(At=>At.location===dt);return Et.length?Et.map(tt):null},[Le,tt]);return{renderComponentByName:mt,renderComponentsByLocation:Zt}},_=(0,B.T0)({id:"plugin.techdocs.service"}),fe=(0,B.T0)({id:"plugin.techdocs.storageservice"});var ie=t(64279),T=t(25271),L=t(51837);function Z(se,Ie){return Ie.getOptionalBoolean("techdocs.legacyUseCaseSensitiveTripletPaths")||(se.kind=se.kind.toLocaleLowerCase(),se.name=se.name.toLocaleLowerCase(),se.namespace=se.namespace.toLocaleLowerCase()),se}const A=(se,Ie)=>(0,T.eE)(se)===(0,T.eE)(Ie),S={title:"",subtitle:"",setTitle:()=>{},setSubtitle:()=>{},setShadowRoot:()=>{},metadata:{loading:!0},entityMetadata:{loading:!0},entityRef:{kind:"",name:"",namespace:""}},q=(0,L.CT)("techdocs-reader-page-context"),Te=(0,r.memo)(({entityRef:se,children:Ie})=>{const Le=(0,B.h_)(_),tt=(0,B.h_)(B.Ds),mt=(0,ie.default)(async()=>Le.getTechDocsMetadata(se),[se]),Zt=(0,ie.default)(async()=>Le.getEntityMetadata(se),[se]),[dt,Et]=(0,r.useState)(S.title),[At,Ot]=(0,r.useState)(S.subtitle),[qt,Vt]=(0,r.useState)(S.shadowRoot),Ht={metadata:mt,entityRef:Z(se,tt),entityMetadata:Zt,shadowRoot:qt,setShadowRoot:Vt,title:dt,setTitle:Et,subtitle:At,setSubtitle:Ot},Jt=(0,L.EI)({1:Ht});return(0,h.jsx)(B.fC,{attributes:{entityRef:(0,T.eE)(se)},children:(0,h.jsx)(q.Provider,{value:Jt,children:Ie instanceof Function?Ie(Ht):Ie})})},(se,Ie)=>A(se.entityRef,Ie.entityRef)),Qe=()=>{const se=(0,r.useContext)(q);if(se===void 0)return S;const Ie=se.atVersion(1);if(Ie===void 0)throw new Error("No context found for version 1.");return Ie},Ye=Object.freeze({Header:"Header",Subheader:"Subheader",Settings:"Settings",PrimarySidebar:"PrimarySidebar",SecondarySidebar:"SecondarySidebar",Content:"Content"});var Xe=t(70882),Ve=t(50236),ft=t(19219),je=t(93414);const Ge="TECH_DOCS_SHADOW_DOM_STYLE_LOAD",st=se=>{(0,r.useEffect)(()=>{if(!se)return()=>{};const Ie=se.querySelectorAll('head > link[rel="stylesheet"]');var Le;let tt=(Le=Ie==null?void 0:Ie.length)!==null&&Le!==void 0?Le:0;const mt=new CustomEvent(Ge);if(!tt)return se.dispatchEvent(mt),()=>{};const Zt=()=>{--tt===0&&se.dispatchEvent(mt)};return Ie==null||Ie.forEach(dt=>{dt.addEventListener("load",Zt)}),()=>{Ie==null||Ie.forEach(dt=>{dt.removeEventListener("load",Zt)})}},[se])},gt=se=>{const[Ie,Le]=(0,r.useState)(!1);return(0,r.useEffect)(()=>{if(!se)return()=>{};Le(!0);const tt=se.style;tt.setProperty("opacity","0");const mt=()=>{Le(!1),tt.setProperty("opacity","1")};return se.addEventListener(Ge,mt),()=>{se.removeEventListener(Ge,mt)}},[se]),Ie},rt=({element:se,onAppend:Ie,children:Le})=>{const[tt,mt]=(0,r.useState)((0,Xe.Ue)({...(0,Ve.Z)(),insertionPoint:void 0}));st(se);const Zt=gt(se),dt=(0,r.useCallback)(Et=>{if(!se||!Et)return;mt((0,Xe.Ue)({...(0,Ve.Z)(),insertionPoint:se.querySelector("head")||void 0}));let At=Et.shadowRoot;At||(At=Et.attachShadow({mode:"open"})),At.replaceChildren(se),typeof Ie=="function"&&Ie(At)},[se,Ie]);return(0,h.jsxs)(h.Fragment,{children:[Zt&&(0,h.jsx)(je.Ex,{}),(0,h.jsxs)(ft.ZP,{jss:tt,sheetsManager:new Map,children:[(0,h.jsx)("div",{ref:dt,"data-testid":"techdocs-native-shadowroot"}),Le]})]})};var ot=t(54073);const ct=()=>{const{shadowRoot:se}=useTechDocsReaderPage();return se},yt=se=>{const Ie=ct();return Ie?se.map(Le=>Ie==null?void 0:Ie.querySelectorAll(Le)).filter(Le=>Le.length).map(Le=>Array.from(Le)).flat():[]},Lt=se=>se.toString()&&se.rangeCount&&se.getRangeAt(0).getBoundingClientRect().top,We=(se=0)=>{const Ie=ct(),[Le,tt]=useState(null),mt=useMemo(()=>debounce(()=>{const Zt=Ie,dt=Zt.getSelection?Zt.getSelection():document.getSelection();dt&&Lt(dt)?tt(dt):tt(null)},se),[Ie,tt,se]);return useEffect(()=>(window.document.addEventListener("selectionchange",mt),()=>window.document.removeEventListener("selectionchange",mt)),[mt]),Le}},52943:function(Rt,Me,t){"use strict";t.r(Me),t.d(Me,{EmbeddedDocsRouter:function(){return ie},Router:function(){return fe},isTechDocsAvailable:function(){return _}});var h=t(52322),r=t(2784),W=t(79635),B=t(92848),g=t(93414),b=t(25271),c=t(89258),P=t(65124),te=t(67896);const Q=({entity:T})=>{const L=(0,b.iB)(T);return(0,h.jsxs)(c.I6,{entityRef:L,children:[(0,h.jsx)(P.b,{}),(0,h.jsx)(te.F,{withSearch:!1})]})};var X=t(18662),M=t(7476);const z="backstage.io/techdocs-ref",_=T=>{var L,Z;return Boolean(T==null||(L=T.metadata)===null||L===void 0||(Z=L.annotations)===null||Z===void 0?void 0:Z[z])},fe=()=>(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)(M.TechDocsReaderPage,{})})]}),ie=T=>{var L;const{children:Z}=T,{entity:A}=(0,B.X2)(),S=(0,W.V$)([{path:"/*",element:(0,h.jsx)(Q,{entity:A}),children:[{path:"*",element:Z}]}]);return((L=A.metadata.annotations)===null||L===void 0?void 0:L[z])?S:(0,h.jsx)(g.sk,{annotation:z})}},92077:function(Rt,Me,t){"use strict";t.d(Me,{k:function(){return g},p:function(){return B}});var h=t(23054),r=t(76372),W=t.n(r);class B{async getApiOrigin(){return await this.discoveryApi.getBaseUrl("techdocs")}async getTechDocsMetadata(c){const{kind:P,namespace:te,name:Q}=c,M=`${await this.getApiOrigin()}/metadata/techdocs/${te}/${P}/${Q}`,z=await this.fetchApi.fetch(`${M}`);if(!z.ok)throw await h.VL.fromResponse(z);return await z.json()}async getEntityMetadata(c){const{kind:P,namespace:te,name:Q}=c,M=`${await this.getApiOrigin()}/metadata/entity/${te}/${P}/${Q}`,z=await this.fetchApi.fetch(`${M}`);if(!z.ok)throw await h.VL.fromResponse(z);return await z.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:Q,name:X}=c,z=`${await this.getStorageUrl()}/${Q}/${te}/${X}/${P}`,_=await this.fetchApi.fetch(`${z.endsWith("/")?z:`${z}/`}index.html`);let fe="";switch(_.status){case 404:throw fe="Page not found. ",P||(fe+="This could be because there is no index.md file in the root of the docs directory of this repository."),new h.dR(fe);case 500:throw fe="Could not generate documentation or an error in the TechDocs backend. ",new Error(fe);default:break}return _.text()}async syncEntityDocs(c,P=()=>{}){const{kind:te,namespace:Q,name:X}=c,z=`${await this.getApiOrigin()}/sync/${Q}/${te}/${X}`,{token:_}=await this.identityApi.getCredentials();return new Promise((fe,ie)=>{const T=new r.EventSourcePolyfill(z,{withCredentials:!0,headers:_?{Authorization:`Bearer ${_}`}:{}});T.addEventListener("log",L=>{L.data&&P(JSON.parse(L.data))}),T.addEventListener("finish",L=>{let Z=!1;L.data&&({updated:Z}=JSON.parse(L.data)),fe(Z?"updated":"cached")}),T.onerror=L=>{switch(T.close(),L.status){case 404:ie(new h.dR(L.message));return;default:ie(new Error(L.data));return}}})}async getBaseUrl(c,P,te){const{kind:Q,namespace:X,name:M}=P,_=`${await this.getApiOrigin()}/static/docs/${X}/${Q}/${M}/${te}`;return new URL(c,_.endsWith("/")?_:`${_}/`).toString()}constructor(c){this.configApi=c.configApi,this.discoveryApi=c.discoveryApi,this.identityApi=c.identityApi,this.fetchApi=c.fetchApi}}},51953:function(Rt,Me,t){"use strict";t.d(Me,{D:function(){return h}});function h(r,W){return W.getOptionalBoolean("techdocs.legacyUseCaseSensitiveTripletPaths")?r:r.toLocaleLowerCase("en-US")}},3482:function(Rt,Me,t){"use strict";t.d(Me,{u:function(){return P}});var h=t(52322),r=t(2784),W=t(93414),B=t(92848),g=t(42081),b=t(48431),c=t(68435);const P=te=>{const{initialFilter:Q="owned",columns:X,actions:M}=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)(B.UO,{children:(0,h.jsxs)(B._i,{children:[(0,h.jsxs)(B._i.Filters,{children:[(0,h.jsx)(b.f,{}),(0,h.jsx)(B.EW,{initialFilter:Q}),(0,h.jsx)(B.dq,{}),(0,h.jsx)(B.xE,{})]}),(0,h.jsx)(B._i.Content,{children:(0,h.jsx)(c.n,{actions:M,columns:X})})]})})]})})}},85478:function(Rt,Me,t){"use strict";t.d(Me,{f:function(){return X}});var h=t(52322),r=t(95573),W=t(51953),B=t(25248),g=t(93414),b=t(94339),c=t(16111),P=t(24579),te=t(14503),Q=t(2784);const X=ie=>{const{entities:T}=ie,L=(0,B.tg)(r.Fw),Z=(0,B.h_)(B.Ds);if(!T)return null;var A,S;return(0,h.jsx)(g.Oh,{"data-testid":"docs-explore",children:T!=null&&T.length?T.map((q,Te)=>(0,h.jsxs)(b.Z,{children:[(0,h.jsx)(c.Z,{children:(0,h.jsx)(g.hu,{title:(A=q.metadata.title)!==null&&A!==void 0?A:q.metadata.name})}),(0,h.jsx)(P.Z,{children:q.metadata.description}),(0,h.jsx)(te.Z,{children:(0,h.jsx)(g.zx,{to:L({namespace:(0,W.D)((S=q.metadata.namespace)!==null&&S!==void 0?S:"default",Z),kind:(0,W.D)(q.kind,Z),name:(0,W.D)(q.metadata.name,Z)}),color:"primary","data-testid":"read_docs",children:"Read Docs"})})]},Te)):null})};var M=t(92848);const z={title:"All Documentation",filterPredicate:()=>!0},_=({entities:ie,group:T})=>{const{loading:L,isOwnedEntity:Z}=useEntityOwnership(),A=ie.filter(q=>T.filterPredicate==="ownedByUser"?L?!1:Z(q):typeof T.filterPredicate=="function"&&T.filterPredicate(q)),S=(()=>typeof T.title=="string"?_jsx(ContentHeader,{title:T.title}):T.title)();return A.length===0?null:_jsxs(Content,{children:[S,_jsx(DocsCardGrid,{entities:A})]})},fe=({groups:ie})=>{const{loading:T,error:L,entities:Z}=useEntityList();if(L)return _jsx(WarningPanel,{severity:"error",title:"Could not load available documentation.",children:_jsx(CodeSnippet,{language:"text",text:L.toString()})});if(T)return _jsx(Progress,{});if(Z.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,S;return Z.sort((q,Te)=>((A=q.metadata.title)!==null&&A!==void 0?A:q.metadata.name).localeCompare((S=Te.metadata.title)!==null&&S!==void 0?S:Te.metadata.name)),_jsx(Content,{children:(ie||[z]).map((q,Te)=>_jsx(_,{entities:Z,group:q},`${q.title}-${Te}`))})}},68435:function(Rt,Me,t){"use strict";t.d(Me,{H:function(){return Z},n:function(){return A}});var h=t(52322),r=t(2784),W=t(95074),B=t(76635),g=t(93414),b=t(92848),c=t(25248),P=t(25271),te=t(95573),Q=t(39981),X=t(2337),M=t(11640),z=t(28347);const _=(0,X.Z)({root:{color:"#f3ba37"}})(M.Z),fe={createCopyDocsUrlAction(S){return q=>({icon:()=>(0,h.jsx)(Q.Z,{fontSize:"small"}),tooltip:"Click to copy documentation link to clipboard",onClick:()=>S(`${window.location.origin}${q.resolved.docsUrl}`)})},createStarEntityAction(S,q){return({entity:Te})=>{const Qe=S(Te);return{cellStyle:{paddingLeft:"1em"},icon:()=>Qe?(0,h.jsx)(_,{}):(0,h.jsx)(z.Z,{}),tooltip:Qe?"Remove from favorites":"Add to favorites",onClick:()=>q(Te)}}}};function ie(S){return S.metadata.title||S.metadata.name}const T={createNameColumn(){return{title:"Document",field:"entity.metadata.name",highlight:!0,render:S=>(0,h.jsx)(g.uw,{value:(0,h.jsx)(g.rU,{to:S.resolved.docsUrl,children:ie(S.entity)}),subvalue:S.entity.metadata.description})}},createOwnerColumn(){return{title:"Owner",field:"resolved.ownedByRelationsTitle",render:({resolved:S})=>(0,h.jsx)(b.rI,{entityRefs:S.ownedByRelations,defaultKind:"group"})}},createTypeColumn(){return{title:"Type",field:"entity.spec.type"}}};var L=t(51953);const Z=S=>{const{entities:q,title:Te,loading:Qe,columns:Ye,actions:Xe}=S,[,Ve]=(0,W.Z)(),ft=(0,c.tg)(te.Fw),je=(0,c.h_)(c.Ds);if(!q)return null;const Ge=q.map(rt=>{const ot=(0,b.hF)(rt,P.S4);var ct;return{entity:rt,resolved:{docsUrl:ft({namespace:(0,L.D)((ct=rt.metadata.namespace)!==null&&ct!==void 0?ct:"default",je),kind:(0,L.D)(rt.kind,je),name:(0,L.D)(rt.metadata.name,je)}),ownedByRelations:ot,ownedByRelationsTitle:ot.map(yt=>(0,b.$3)(yt,{defaultKind:"group"})).join(", ")}}}),st=[T.createNameColumn(),T.createOwnerColumn(),T.createTypeColumn()],gt=[fe.createCopyDocsUrlAction(Ve)];return(0,h.jsx)(h.Fragment,{children:Qe||Ge&&Ge.length>0?(0,h.jsx)(g.iA,{isLoading:Qe,options:{paging:!0,pageSize:20,search:!0,actionsColumnIndex:-1},data:Ge,columns:Ye||st,actions:Xe||gt,title:Te?`${Te} (${Ge.length})`:`All (${Ge.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"})})})};Z.columns=T,Z.actions=fe;const A=S=>{var q;const{columns:Te,actions:Qe}=S,{loading:Ye,error:Xe,entities:Ve,filters:ft}=(0,b.wp)(),{isStarredEntity:je,toggleStarredEntity:Ge}=(0,b.CR)(),[,st]=(0,W.Z)();var gt;const rt=(0,B.capitalize)((gt=(q=ft.user)===null||q===void 0?void 0:q.value)!==null&>!==void 0?gt:"all"),ot=[fe.createCopyDocsUrlAction(st),fe.createStarEntityAction(je,Ge)];return Xe?(0,h.jsx)(g.GB,{severity:"error",title:"Could not load available documentation.",children:(0,h.jsx)(g.Oi,{language:"text",text:Xe.toString()})}):(0,h.jsx)(Z,{title:rt,entities:Ve,loading:Ye,actions:Qe||ot,columns:Te})};A.columns=T,A.actions=fe},18662:function(Rt,Me,t){"use strict";t.r(Me),t.d(Me,{TechDocsIndexPage:function(){return g}});var h=t(52322),r=t(2784),W=t(79635),B=t(3482);const g=b=>(0,W.pC)()||(0,h.jsx)(B.u,{...b})},42081:function(Rt,Me,t){"use strict";t.d(Me,{j:function(){return g}});var h=t(52322),r=t(2784),W=t(93414),B=t(25248);const g=b=>{const{children:c}=b,P=(0,B.h_)(B.Ds);var te;const Q=`Documentation available in ${(te=P.getOptionalString("organization.name"))!==null&&te!==void 0?te:"Backstage"}`;return(0,h.jsx)(W.g9,{title:"Documentation",subtitle:Q,themeId:"documentation",children:c})}},48431:function(Rt,Me,t){"use strict";t.d(Me,{f:function(){return B}});var h=t(2784),r=t(92848);class W{getCatalogFilters(){return{"metadata.annotations.backstage.io/techdocs-ref":r.n3}}}const B=()=>{const{updateFilters:g}=(0,r.wp)();return(0,h.useEffect)(()=>{g({techdocs:new W})},[g]),null}},89258:function(Rt,Me,t){"use strict";t.d(Me,{I6:function(){return Q},Jl:function(){return te},s4:function(){return g}});var h=t(61886),r=t(92077),W=t(95573),B=t(25248);const g=(0,B.rx)({id:"techdocs",apis:[(0,B.ni)({api:h.Dl,deps:{configApi:B.Ds,discoveryApi:B.NW,identityApi:B.$4,fetchApi:B.gP},factory:({configApi:X,discoveryApi:M,identityApi:z,fetchApi:_})=>new r.k({configApi:X,discoveryApi:M,identityApi:z,fetchApi:_})}),(0,B.ni)({api:h.gT,deps:{configApi:B.Ds,discoveryApi:B.NW,fetchApi:B.gP},factory:({configApi:X,discoveryApi:M,fetchApi:z})=>new r.p({configApi:X,discoveryApi:M,fetchApi:z})})],routes:{root:W._Z,docRoot:W.Fw,entityContent:W.pd}}),b=g.provide((0,B.P4)({name:"TechdocsPage",component:()=>Promise.resolve().then(t.bind(t,52943)).then(X=>X.Router),mountPoint:W._Z})),c=g.provide((0,B.P4)({name:"EntityTechdocsContent",component:()=>Promise.resolve().then(t.bind(t,52943)).then(X=>X.EmbeddedDocsRouter),mountPoint:W.pd})),P=g.provide((0,B.P4)({name:"TechDocsCustomHome",component:()=>t.e(7560).then(t.bind(t,27560)).then(X=>X.TechDocsCustomHome),mountPoint:W._Z})),te=g.provide((0,B.P4)({name:"TechDocsIndexPage",component:()=>Promise.resolve().then(t.bind(t,18662)).then(X=>X.TechDocsIndexPage),mountPoint:W._Z})),Q=g.provide((0,B.P4)({name:"TechDocsReaderPage",component:()=>Promise.resolve().then(t.bind(t,7476)).then(X=>X.TechDocsReaderPage),mountPoint:W.Fw}))},7476:function(Rt,Me,t){"use strict";t.r(Me),t.d(Me,{TechDocsReaderLayout:function(){return X},TechDocsReaderPage:function(){return M}});var h=t(52322),r=t(2784),W=t(79635),B=t(93414),g=t(61886),b=t(67896),c=t(93225),P=t(65124),te=t(95573),Q=t(25248);const X=({withSearch:z,withHeader:_=!0})=>(0,h.jsxs)(B.T3,{themeId:"documentation",children:[_&&(0,h.jsx)(c.S,{}),(0,h.jsx)(P.b,{}),(0,h.jsx)(b.F,{withSearch:z})]}),M=z=>{const{kind:_,name:fe,namespace:ie}=(0,Q.Oi)(te.Fw),{children:T,entityRef:L={kind:_,name:fe,namespace:ie}}=z,Z=(0,W.pC)();if(!T){const S=Z?r.Children.toArray(Z.props.children):[];var A;const Te=S.flatMap(Qe=>{var Ye;return(A=Qe==null||(Ye=Qe.props)===null||Ye===void 0?void 0:Ye.children)!==null&&A!==void 0?A:[]}).find(Qe=>!(0,Q.IY)(Qe,g.Zz)&&!(0,Q.IY)(Qe,g.jM));return(0,h.jsx)(g.ZS,{entityRef:L,children:Te||(0,h.jsx)(X,{})})}return(0,h.jsx)(g.ZS,{entityRef:L,children:({metadata:S,entityMetadata:q,onReady:Te})=>(0,h.jsx)("div",{className:"techdocs-reader-page",children:(0,h.jsx)(B.T3,{themeId:"documentation",children:T instanceof Function?T({entityRef:L,techdocsMetadataValue:S.value,entityMetadataValue:q.value,onReady:Te}):T})})})}},67896:function(Rt,Me,t){"use strict";t.d(Me,{F:function(){return Ue}});var h=t(52322),r=t(2784),W=t(79692),B=t(60905),g=t(61886),b=t(93414),c=t(17339),P=t(4614),te=t(77277),Q=t(99688),X=t(12420),M=t(90436),z=t(61837),_=t(4190),fe=t(87685);const ie=(0,W.Z)(w=>(0,X.Z)({paper:{width:"100%",[w.breakpoints.up("sm")]:{width:"75%"},[w.breakpoints.up("md")]:{width:"50%"},padding:w.spacing(2.5)},root:{height:"100%",overflow:"hidden"},logs:{background:w.palette.background.default}})),T=({buildLog:w,onClose:H})=>{const ve=ie(),ue=w.length===0?"Waiting for logs...":w.join(`
|
|
34
|
+
`);return(0,h.jsxs)(B.Z,{container:!0,direction:"column",className:ve.root,spacing:0,wrap:"nowrap",children:[(0,h.jsxs)(B.Z,{item:!0,container:!0,justifyContent:"space-between",alignItems:"center",spacing:0,wrap:"nowrap",children:[(0,h.jsx)(M.Z,{variant:"h5",children:"Build Details"}),(0,h.jsx)(z.Z,{title:"Close the drawer",onClick:H,color:"inherit",children:(0,h.jsx)(fe.Z,{})},"dismiss")]}),(0,h.jsx)(B.Z,{item:!0,xs:!0,children:(0,h.jsx)(b.nU,{text:ue,classes:{root:ve.logs}})})]})},L=({buildLog:w})=>{const H=ie(),[ve,ue]=(0,r.useState)(!1);return(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(te.Z,{color:"inherit",onClick:()=>ue(!0),children:"Show Build Logs"}),(0,h.jsx)(_.ZP,{classes:{paper:H.paper},anchor:"right",open:ve,onClose:()=>ue(!1),children:(0,h.jsx)(T,{buildLog:w,onClose:()=>ue(!1)})})]})};var Z=t(25248);const A=({errorMessage:w})=>{const H=(0,Z.h_)(Z.Ds).getOptionalString("techdocs.builder");let ve="";return H!=="local"&&(ve="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:w||"Documentation not found",additionalInfo:ve})};var S=t(95481);const q=(0,W.Z)(w=>({root:{marginBottom:w.spacing(2)},message:{wordBreak:"break-word",overflowWrap:"anywhere"}})),Te=()=>{let w=null;const H=q(),{state:ve,contentReload:ue,contentErrorMessage:we,syncErrorMessage:ke,buildLog:Fe}=(0,S.DK)();return ve==="INITIAL_BUILD"&&(w=(0,h.jsx)(Q.Z,{classes:{root:H.root},variant:"outlined",severity:"info",icon:(0,h.jsx)(P.Z,{size:"24px"}),action:(0,h.jsx)(L,{buildLog:Fe}),children:"Documentation is accessed for the first time and is being prepared. The subsequent loads are much faster."})),ve==="CONTENT_STALE_REFRESHING"&&(w=(0,h.jsx)(Q.Z,{variant:"outlined",severity:"info",icon:(0,h.jsx)(P.Z,{size:"24px"}),action:(0,h.jsx)(L,{buildLog:Fe}),classes:{root:H.root},children:"A newer version of this documentation is being prepared and will be available shortly."})),ve==="CONTENT_STALE_READY"&&(w=(0,h.jsx)(Q.Z,{variant:"outlined",severity:"success",action:(0,h.jsx)(te.Z,{color:"inherit",onClick:()=>ue(),children:"Refresh"}),classes:{root:H.root},children:"A newer version of this documentation is now available, please refresh to view."})),ve==="CONTENT_STALE_ERROR"&&(w=(0,h.jsxs)(Q.Z,{variant:"outlined",severity:"error",action:(0,h.jsx)(L,{buildLog:Fe}),classes:{root:H.root,message:H.message},children:["Building a newer version of this documentation failed."," ",ke]})),ve==="CONTENT_NOT_FOUND"&&(w=(0,h.jsxs)(h.Fragment,{children:[ke&&(0,h.jsxs)(Q.Z,{variant:"outlined",severity:"error",action:(0,h.jsx)(L,{buildLog:Fe}),classes:{root:H.root,message:H.message},children:["Building a newer version of this documentation failed."," ",ke]}),(0,h.jsx)(A,{errorMessage:we})]})),w};var Qe=t(79635),Ye=t(60364),Xe=t(41156),Ve=t(32838),ft=t(35368),je=t.n(ft);const Ge=/main\.[A-Fa-f0-9]{8}\.min\.css$/,st=/^https:\/\/fonts\.googleapis\.com/,gt=/^https:\/\/fonts\.gstatic\.com/,rt=w=>w.nodeName==="LINK",ot=w=>{const H=(w==null?void 0:w.getAttribute("href"))||"",ve=H.match(Ge),ue=H.match(st),we=H.match(gt);return ve||ue||we},ct=w=>(rt(w)&&!ot(w)&&w.remove(),w),yt=w=>w.nodeName==="IFRAME",Lt=(w,H)=>{const ve=w.getAttribute("src")||"";try{const{host:ue}=new URL(ve);return H.includes(ue)}catch{return!1}},We=w=>H=>(yt(H)&&!Lt(H,w)&&H.remove(),H),se=()=>{const w=(0,Z.h_)(Z.Ds);return(0,r.useMemo)(()=>w.getOptionalConfig("techdocs.sanitizer"),[w])},Ie=()=>{const w=se();return(0,r.useCallback)(async H=>{const ve=w==null?void 0:w.getOptionalStringArray("allowedIframeHosts");je().addHook("beforeSanitizeElements",ct);const ue=["link"];return ve&&(ue.push("iframe"),je().addHook("beforeSanitizeElements",We(ve))),je().sanitize(H.innerHTML,{ADD_TAGS:ue,FORBID_TAGS:["style"],WHOLE_DOCUMENT:!0,RETURN_DOM:!0})},[w])};var Le=t(41128),tt=({theme:w})=>`
|
|
35
35
|
/*================== Variables ==================*/
|
|
36
36
|
/*
|
|
37
37
|
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.
|
|
@@ -42,21 +42,21 @@ spec:
|
|
|
42
42
|
/* FONT */
|
|
43
43
|
--md-default-fg-color: ${w.palette.text.primary};
|
|
44
44
|
--md-default-fg-color--light: ${w.palette.text.secondary};
|
|
45
|
-
--md-default-fg-color--lighter: ${(0,
|
|
46
|
-
--md-default-fg-color--lightest: ${(0,
|
|
45
|
+
--md-default-fg-color--lighter: ${(0,Le.$n)(w.palette.text.secondary,.7)};
|
|
46
|
+
--md-default-fg-color--lightest: ${(0,Le.$n)(w.palette.text.secondary,.3)};
|
|
47
47
|
|
|
48
48
|
/* BACKGROUND */
|
|
49
49
|
--md-default-bg-color:${w.palette.background.default};
|
|
50
50
|
--md-default-bg-color--light: ${w.palette.background.paper};
|
|
51
|
-
--md-default-bg-color--lighter: ${(0,
|
|
52
|
-
--md-default-bg-color--lightest: ${(0,
|
|
51
|
+
--md-default-bg-color--lighter: ${(0,Le.$n)(w.palette.background.paper,.7)};
|
|
52
|
+
--md-default-bg-color--lightest: ${(0,Le.$n)(w.palette.background.paper,.3)};
|
|
53
53
|
|
|
54
54
|
/* PRIMARY */
|
|
55
55
|
--md-primary-fg-color: ${w.palette.primary.main};
|
|
56
56
|
--md-primary-fg-color--light: ${w.palette.primary.light};
|
|
57
57
|
--md-primary-fg-color--dark: ${w.palette.primary.dark};
|
|
58
58
|
--md-primary-bg-color: ${w.palette.primary.contrastText};
|
|
59
|
-
--md-primary-bg-color--light: ${(0,
|
|
59
|
+
--md-primary-bg-color--light: ${(0,Le.$n)(w.palette.primary.contrastText,.7)};
|
|
60
60
|
|
|
61
61
|
/* ACCENT */
|
|
62
62
|
--md-accent-fg-color: var(--md-primary-fg-color);
|
|
@@ -102,7 +102,7 @@ spec:
|
|
|
102
102
|
/* CODE */
|
|
103
103
|
--md-code-fg-color: ${w.palette.text.primary};
|
|
104
104
|
--md-code-bg-color: ${w.palette.background.paper};
|
|
105
|
-
--md-code-hl-color: ${(0,
|
|
105
|
+
--md-code-hl-color: ${(0,Le.Fq)(w.palette.warning.main,.5)};
|
|
106
106
|
--md-code-hl-keyword-color: ${w.palette.type==="dark"?w.palette.primary.light:w.palette.primary.dark};
|
|
107
107
|
--md-code-hl-function-color: ${w.palette.type==="dark"?w.palette.secondary.light:w.palette.secondary.dark};
|
|
108
108
|
--md-code-hl-string-color: ${w.palette.type==="dark"?w.palette.success.light:w.palette.success.dark};
|
|
@@ -121,9 +121,9 @@ spec:
|
|
|
121
121
|
--md-typeset-color: var(--md-default-fg-color);
|
|
122
122
|
--md-typeset-a-color: var(--md-accent-fg-color);
|
|
123
123
|
--md-typeset-table-color: ${w.palette.text.primary};
|
|
124
|
-
--md-typeset-del-color: ${w.palette.type==="dark"?(0,
|
|
125
|
-
--md-typeset-ins-color: ${w.palette.type==="dark"?(0,
|
|
126
|
-
--md-typeset-mark-color: ${w.palette.type==="dark"?(0,
|
|
124
|
+
--md-typeset-del-color: ${w.palette.type==="dark"?(0,Le.Fq)(w.palette.error.dark,.5):(0,Le.Fq)(w.palette.error.light,.5)};
|
|
125
|
+
--md-typeset-ins-color: ${w.palette.type==="dark"?(0,Le.Fq)(w.palette.success.dark,.5):(0,Le.Fq)(w.palette.success.light,.5)};
|
|
126
|
+
--md-typeset-mark-color: ${w.palette.type==="dark"?(0,Le.Fq)(w.palette.warning.dark,.5):(0,Le.Fq)(w.palette.warning.light,.5)};
|
|
127
127
|
}
|
|
128
128
|
|
|
129
129
|
@media screen and (max-width: 76.1875em) {
|
|
@@ -489,6 +489,6 @@ ${Et.reduce((H,ve)=>{var ue;const we=(ue=w.typography.htmlFontSize)!==null&&ue!=
|
|
|
489
489
|
`;const Vt=[tt,mt,dt,At,Ot,qt],Ht=()=>(0,b.Pf)(),Jt=()=>{const w=Ht(),H=(0,Ye.Z)();return(0,r.useMemo)(()=>{const ve={theme:H,sidebar:w};return Vt.reduce((ue,we)=>ue+we(ve),"")},[H,w])},dn=()=>{const w=Jt();return(0,r.useCallback)(H=>(H.getElementsByTagName("head")[0].insertAdjacentHTML("beforeend",`<style>${w}</style>`),H),[w])},an=(w,H,ve)=>{const ue=w==="src"&&H.endsWith(".svg"),we=!H.match(/^([a-z]*:)?\/\//i),ke=H.startsWith(ve);return ue&&(we||ke)},Fn=({techdocsStorageApi:w,entityId:H,path:ve})=>async ue=>{const we=await w.getApiOrigin(),ke=async(Fe,it)=>{for(const Ct of Fe)if(Ct.hasAttribute(it)){const Ke=Ct.getAttribute(it);if(!Ke)return;const ht=await w.getBaseUrl(Ke,H,ve);if(an(it,Ke,we))try{const at=await(await fetch(ht,{credentials:"include"})).text();Ct.setAttribute(it,`data:image/svg+xml;base64,${btoa(unescape(encodeURIComponent(at)))}`)}catch{Ct.setAttribute("alt",`Error: ${Ke}`)}else Ct.setAttribute(it,ht)}};return await Promise.all([ke(ue.querySelectorAll("img"),"src"),ke(ue.querySelectorAll("script"),"src"),ke(ue.querySelectorAll("source"),"src"),ke(ue.querySelectorAll("link"),"href"),ke(ue.querySelectorAll("a[download]"),"href")]),ue};var En=t(79158),Un=t(67097),mn=t(28316),un=t(82717),Qt=t.n(un);const Mn=w=>H=>{var ve;const ue=H.querySelector('[title="Edit this page"]');if(!ue||!ue.href)return H;const we=new URL(ue.href),ke=w.byUrl(we);if((ke==null?void 0:ke.type)!=="github"&&(ke==null?void 0:ke.type)!=="gitlab")return H;const Fe=((ve=H.querySelector("article>h1"))===null||ve===void 0?void 0:ve.childNodes[0].textContent)||"",it=encodeURIComponent(`Documentation Feedback: ${Fe}`),Ct=encodeURIComponent(`Page source:
|
|
490
490
|
${ue.href}
|
|
491
491
|
|
|
492
|
-
Feedback:`),Ke=(ke==null?void 0:ke.type)==="github"?(0,En.BT)(we.href,"blob"):we.href,ht=Qt()(Ke),vt=`/${ht.organization}/${ht.name}`,at=ue.cloneNode();switch(ke==null?void 0:ke.type){case"gitlab":at.href=`${we.origin}${vt}/issues/new?issue[title]=${it}&issue[description]=${Ct}`;break;case"github":at.href=`${we.origin}${vt}/issues/new?title=${it}&body=${Ct}`;break;default:return H}return mn.render(r.createElement(Un.Z),at),at.style.paddingLeft="5px",at.title="Leave feedback for this page",at.id="git-feedback-link",ue==null||ue.insertAdjacentElement("beforebegin",at),H};var zn=t(44882);const hn=()=>w=>{const H=w.querySelector('.md-header label[for="__drawer"]'),ve=w.querySelector("article");if(!H||!ve)return w;const ue=H.cloneNode();return mn.render(r.createElement(zn.Z),ue),ue.id="toggle-sidebar",ue.title="Toggle Sidebar",ue.classList.add("md-content__button"),ue.style.setProperty("padding","0 0 0 5px"),ue.style.setProperty("margin","0.4rem 0 0.4rem 0.4rem"),ve==null||ve.prepend(ue),w},vn=()=>w=>(((ve,ue)=>{Array.from(ve).filter(we=>we.hasAttribute(ue)).forEach(we=>{const ke=we.getAttribute(ue);if(ke){ke.match(/^https?:\/\//i)&&we.setAttribute("target","_blank");try{const Fe=yn(window.location.href);we.setAttribute(ue,new URL(ke,Fe).toString())}catch{we.replaceWith(we.textContent||ke)}}})})(Array.from(w.getElementsByTagName("a")),"href"),w);function yn(w){const H=new URL(w);return!H.pathname.endsWith("/")&&!H.pathname.endsWith(".html")&&(H.pathname+="/"),H.toString()}const Ln=({baseUrl:w,onClick:H})=>ve=>(Array.from(ve.getElementsByTagName("a")).forEach(ue=>{ue.addEventListener("click",we=>{const Fe=ue.getAttribute("href");!Fe||Fe.startsWith(w)&&!ue.hasAttribute("download")&&(we.preventDefault(),H(we,Fe))})}),ve);var Pn=t(15459),xn=t(80030),ge=t(72379),ee=t(41547);const Ee=(0,Pn.Z)(w=>({tooltip:{fontSize:"inherit",color:w.palette.text.primary,margin:0,padding:w.spacing(.5),backgroundColor:"transparent",boxShadow:"none"}}))(xn.ZP),Ne=()=>(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"})}),_e=({text:w})=>{const[H,ve]=(0,r.useState)(!1),ue=(0,r.useCallback)(()=>{window.navigator.clipboard.writeText(w),ve(!0)},[w]),we=(0,r.useCallback)(()=>{ve(!1)},[ve]);return(0,h.jsx)(Ee,{title:"Copied to clipboard",placement:"left",open:H,onClose:we,leaveDelay:1e3,children:(0,h.jsx)(te.Z,{className:"md-clipboard md-icon",onClick:ue,children:(0,h.jsx)(Ne,{})})})},wt=w=>H=>{const ve=H.querySelectorAll("pre > code");for(const we of ve){var ue;const ke=we.textContent||"",Fe=document.createElement("div");we==null||(ue=we.parentElement)===null||ue===void 0||ue.prepend(Fe),mn.render((0,h.jsx)(ee.Z,{theme:w,children:(0,h.jsx)(_e,{text:ke})}),Fe)}return H},ae=()=>w=>{var H;return(H=w.querySelector(".md-header"))===null||H===void 0||H.remove(),w},k=()=>w=>{var H,ve;return(H=w.querySelector(".md-footer .md-copyright"))===null||H===void 0||H.remove(),(ve=w.querySelector(".md-footer-copyright"))===null||ve===void 0||ve.remove(),w},ce=({onLoading:w,onLoaded:H})=>ve=>(w(),ve.addEventListener(g.Ox,function ue(){H(),ve.removeEventListener(g.Ox,ue)}),ve),Oe=()=>w=>(setTimeout(()=>{if(window.location.hash){var H;const ve=window.location.hash.slice(1);(H=w==null?void 0:w.querySelector(`[id="${ve}"]`))===null||H===void 0||H.scrollIntoView()}},200),w),D=()=>w=>(setTimeout(()=>{const H=w==null?void 0:w.querySelectorAll("li.md-nav__item--active");H.length!==0&&(H.forEach(ue=>{const we=ue==null?void 0:ue.querySelector("input");we!=null&&we.checked||we==null||we.click()}),H[H.length-1].scrollIntoView())},200),w),U=async(w,H)=>{let ve;if(typeof w=="string")ve=new DOMParser().parseFromString(w,"text/html").documentElement;else if(w instanceof Element)ve=w;else throw new Error("dom is not a recognized type");for(const ue of H)ve=await ue(ve);return ve},de="screen and (max-width: 76.1875em)",pe=w=>{const H=(0,Qe.s0)(),ve=(0,Ye.Z)(),ue=(0,Xe.Z)(de),we=Ie(),ke=dn(),Fe=(0,Z.z$)(),it=(0,Z.h_)(g.Dl),Ct=(0,Z.h_)(Ve.q3),{state:Ke,path:ht,content:vt}=(0,S.DK)(),[at,Tt]=(0,r.useState)(null),Ut=(0,g.ux)(at),Mt=(0,r.useCallback)(()=>{if(!at)return;at.querySelectorAll(".md-sidebar").forEach(zt=>{if(ue)zt.style.top="0px";else{const Sn=document==null?void 0:document.querySelector(".techdocs-reader-page");var _t;const pn=(_t=Sn==null?void 0:Sn.getBoundingClientRect().top)!==null&&_t!==void 0?_t:0;var kn;let Hn=(kn=at.getBoundingClientRect().top)!==null&&kn!==void 0?kn:0;const ln=at.querySelector(".md-container > .md-tabs");var Jn;const On=(Jn=ln==null?void 0:ln.getBoundingClientRect().height)!==null&&Jn!==void 0?Jn:0;Hn<pn&&(Hn=pn),zt.style.top=`${Math.max(Hn,0)+On}px`}zt.style.setProperty("opacity","1")})},[at,ue]);(0,r.useEffect)(()=>(window.addEventListener("resize",Mt),window.addEventListener("scroll",Mt,!0),()=>{window.removeEventListener("resize",Mt),window.removeEventListener("scroll",Mt,!0)}),[at,Mt]);const Wn=(0,r.useCallback)(()=>{if(!at)return;const Nt=at.querySelector(".md-footer");Nt&&(Nt.style.width=`${at.getBoundingClientRect().width}px`)},[at]);(0,r.useEffect)(()=>(window.addEventListener("resize",Wn),()=>{window.removeEventListener("resize",Wn)}),[at,Wn]),(0,r.useEffect)(()=>{Ut||(Wn(),Mt())},[Ke,Ut,Wn,Mt]);const Vn=(0,r.useCallback)((Nt,zt)=>U(Nt,[we,Fn({techdocsStorageApi:it,entityId:w,path:zt}),vn(),hn(),ae(),k(),Mn(Ct),ke]),[w,Ct,it,we,ke]),bn=(0,r.useCallback)(async Nt=>U(Nt,[Oe(),D(),wt(ve),Ln({baseUrl:window.location.origin,onClick:(zt,_t)=>{var kn;const Jn=zt.ctrlKey||zt.metaKey,Sn=new URL(_t),pn=`${Sn.pathname}${Sn.search}${Sn.hash}`,Hn=((kn=zt.target)===null||kn===void 0?void 0:kn.innerText)||_t,ln=_t.replace(window.location.origin,"");if(Fe.captureEvent("click",Hn,{attributes:{to:ln}}),Sn.hash)if(Jn)window.open(pn,"_blank");else{var On;H(pn),(On=Nt==null?void 0:Nt.querySelector(`[id="${Sn.hash.slice(1)}"]`))===null||On===void 0||On.scrollIntoView()}else Jn?window.open(pn,"_blank"):H(pn)}}),ce({onLoading:()=>{},onLoaded:()=>{var zt;(zt=Nt.querySelector(".md-nav__title"))===null||zt===void 0||zt.removeAttribute("for")}}),ce({onLoading:()=>{Array.from(Nt.querySelectorAll(".md-sidebar")).forEach(_t=>{_t.style.setProperty("opacity","0")})},onLoaded:()=>{}})]),[ve,H,Fe]);return(0,r.useEffect)(()=>{if(!vt)return()=>{};let Nt=!0;return Vn(vt,ht).then(async zt=>{if(!(zt!=null&&zt.innerHTML)||!Nt)return;window.scroll({top:0});const _t=await bn(zt);Tt(_t)}),()=>{Nt=!1}},[vt,ht,Vn,bn]),at};var ye=t(8560);const Pe=()=>{const w=(0,g.$L)(),{shadowRoot:H}=(0,g.x1)(),ve=H==null?void 0:H.querySelector('[data-md-component="content"]'),ue=H==null?void 0:H.querySelector('div[data-md-component="sidebar"][data-md-type="navigation"], div[data-md-component="navigation"]');let we=ue==null?void 0:ue.querySelector('[data-techdocs-addons-location="primary sidebar"]');we||(we=document.createElement("div"),we.setAttribute("data-techdocs-addons-location","primary sidebar"),ue==null||ue.prepend(we));const ke=H==null?void 0:H.querySelector('div[data-md-component="sidebar"][data-md-type="toc"], div[data-md-component="toc"]');let Fe=ke==null?void 0:ke.querySelector('[data-techdocs-addons-location="secondary sidebar"]');return Fe||(Fe=document.createElement("div"),Fe.setAttribute("data-techdocs-addons-location","secondary sidebar"),ke==null||ke.prepend(Fe)),(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(ye.Z,{container:we,children:w.renderComponentsByLocation(g.oZ.PrimarySidebar)}),(0,h.jsx)(ye.Z,{container:ve,children:w.renderComponentsByLocation(g.oZ.Content)}),(0,h.jsx)(ye.Z,{container:Fe,children:w.renderComponentsByLocation(g.oZ.SecondarySidebar)})]})},Le=(0,W.Z)({search:{width:"100%","@media (min-width: 76.1875em)":{width:"calc(100% - 34.4rem)",margin:"0 auto"}}}),Ue=(0,S.m1)(w=>{var H;const{withSearch:ve=!0,onReady:ue}=w,we=Le(),{entityMetadata:{value:ke,loading:Fe},entityRef:it,setShadowRoot:Ct}=(0,g.x1)(),Ke=pe(it),ht=(0,r.useCallback)(vt=>{Ct(vt),ue instanceof Function&&ue()},[Ct,ue]);return Fe===!1&&!ke?(0,h.jsx)(b.mf,{status:"404",statusMessage:"PAGE NOT FOUND"}):Ke?(0,h.jsx)(b.VY,{children:(0,h.jsxs)(B.Z,{container:!0,children:[(0,h.jsx)(B.Z,{xs:12,item:!0,children:(0,h.jsx)(Te,{})}),ve&&(0,h.jsx)(B.Z,{className:we.search,xs:"auto",item:!0,children:(0,h.jsx)(c.S,{entityId:it,entityTitle:ke==null||(H=ke.metadata)===null||H===void 0?void 0:H.title})}),(0,h.jsx)(B.Z,{xs:12,item:!0,children:(0,h.jsx)(g.VA,{element:Ke,onAppend:ht,children:(0,h.jsx)(Pe,{})})})]})}):(0,h.jsx)(b.VY,{children:(0,h.jsx)(B.Z,{container:!0,children:(0,h.jsx)(B.Z,{xs:12,item:!0,children:(0,h.jsx)(Te,{})})})})}),nt=null},93225:function(Rt,Me,t){"use strict";t.d(Me,{S:function(){return fe}});var h=t(52322),r=t(2784),W=t(18671),B=t(60905),g=t(98069),b=t(73250),c=t(61886),P=t(92848),te=t(25271),Q=t(93414),X=t(25248),M=t(76635),z=t(95573);const _=(0,h.jsx)(g.Z,{animation:"wave",variant:"text",height:40}),fe=ie=>{const{children:T}=ie,L=(0,c.$L)(),Z=(0,X.h_)(X.Ds),{title:A,setTitle:S,subtitle:q,setSubtitle:Te,entityRef:Qe,metadata:{value:Ye,loading:Xe},entityMetadata:{value:Ve,loading:ft}}=(0,c.x1)();(0,r.useEffect)(()=>{!Ye||(S(Ye.site_name),Te(()=>{let{site_description:se}=Ye;return(!se||se==="None")&&(se=""),se}))},[Ye,S,Te]);const je=Z.getOptional("app.title")||"Backstage",Ge=[A,q,je].filter(Boolean).join(" | "),{locationMetadata:st,spec:gt}=Ve||{},rt=gt==null?void 0:gt.lifecycle,ot=Ve?(0,P.hF)(Ve,te.S4):[],ct=(0,X.tg)(z._Z)(),yt=(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(Q.i9,{label:(0,M.capitalize)((Ve==null?void 0:Ve.kind)||"entity"),value:(0,h.jsx)(P.dx,{color:"inherit",entityRef:Qe,title:Ve==null?void 0:Ve.metadata.title,defaultKind:"Component"})}),ot.length>0&&(0,h.jsx)(Q.i9,{label:"Owner",value:(0,h.jsx)(P.rI,{color:"inherit",entityRefs:ot,defaultKind:"group"})}),rt?(0,h.jsx)(Q.i9,{label:"Lifecycle",value:rt}):null,st&&st.type!=="dir"&&st.type!=="file"?(0,h.jsx)(Q.i9,{label:"",value:(0,h.jsxs)(B.Z,{container:!0,direction:"column",alignItems:"center",style:{color:"#fff"},children:[(0,h.jsx)(B.Z,{style:{padding:0},item:!0,children:(0,h.jsx)(b.Z,{style:{marginTop:"-25px"}})}),(0,h.jsx)(B.Z,{style:{padding:0},item:!0,children:"Source"})]}),url:st.target}):null]});return!ft&&Ve===void 0||!Xe&&Ye===void 0?null:(0,h.jsxs)(Q.h4,{type:"Documentation",typeLink:ct,title:A||_,subtitle:q===""?void 0:q||_,children:[(0,h.jsx)(W.Z,{titleTemplate:"%s",children:(0,h.jsx)("title",{children:Ge})}),yt,T,L.renderComponentsByLocation(c.oZ.Header)]})}},65124:function(Rt,Me,t){"use strict";t.d(Me,{b:function(){return M}});var h=t(52322),r=t(2784),W=t(79692),B=t(15223),g=t(95544),b=t(80030),c=t(61837),P=t(48348),te=t(47603),Q=t(61886);const X=(0,W.Z)(z=>({root:{gridArea:"pageSubheader",flexDirection:"column",minHeight:"auto",padding:z.spacing(3,3,0)}})),M=z=>{const _=X(),[fe,ie]=(0,r.useState)(null),T=(0,r.useCallback)(Qe=>{ie(Qe.currentTarget)},[]),L=(0,r.useCallback)(()=>{ie(null)},[]),{entityMetadata:{value:Z,loading:A}}=(0,Q.x1)(),S=(0,Q.$L)(),q=S.renderComponentsByLocation(Q.oZ.Subheader),Te=S.renderComponentsByLocation(Q.oZ.Settings);return!q&&!Te||A===!1&&!Z?null:(0,h.jsx)(B.Z,{classes:_,...z.toolbarProps,children:(0,h.jsxs)(g.Z,{display:"flex",justifyContent:"flex-end",width:"100%",flexWrap:"wrap",children:[q,Te?(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:fe,anchorOrigin:{vertical:"bottom",horizontal:"right"},open:Boolean(fe),onClose:L,keepMounted:!0,children:Te})]}):null]})})}},95481:function(Rt,Me,t){"use strict";t.d(Me,{DK:function(){return M},m1:function(){return _}});var h=t(52322),r=t(2784),W=t(79635),B=t(61886),g=t(25248),b=t(64279),c=t(77446);function P({contentLoading:fe,content:ie,activeSyncState:T}){return fe||T==="BUILD_READY_RELOAD"||!ie&&T==="CHECKING"?"CHECKING":!ie&&T==="BUILDING"?"INITIAL_BUILD":ie?T==="BUILDING"?"CONTENT_STALE_REFRESHING":T==="BUILD_READY"?"CONTENT_STALE_READY":T==="ERROR"?"CONTENT_STALE_ERROR":"CONTENT_FRESH":"CONTENT_NOT_FOUND"}function te(fe,ie){const T={...fe};switch(ie.type){case"sync":ie.state==="CHECKING"&&(T.buildLog=[]),T.activeSyncState=ie.state,T.syncError=ie.syncError;break;case"contentLoading":T.contentLoading=!0,T.contentError=void 0;break;case"content":typeof ie.path=="string"&&(T.path=ie.path),T.contentLoading=!1,T.content=ie.content,T.contentError=ie.contentError;break;case"buildLog":T.buildLog=T.buildLog.concat(ie.log);break;default:throw new Error}return["BUILD_READY","BUILD_READY_RELOAD"].includes(T.activeSyncState)&&["contentLoading","content"].includes(ie.type)&&(T.activeSyncState="UP_TO_DATE",T.buildLog=[]),T}function Q(fe,ie,T,L){var Z,A;const[S,q]=(0,r.useReducer)(te,{activeSyncState:"CHECKING",path:L,contentLoading:!0,buildLog:[]}),Te=(0,g.h_)(B.Dl),{retry:Qe}=(0,c.Z)(async()=>{q({type:"contentLoading"});try{const Ve=await Te.getEntityDocs({kind:fe,namespace:ie,name:T},L);return q({type:"content",content:Ve,path:L}),Ve}catch(Ve){q({type:"content",contentError:Ve,path:L})}},[Te,fe,ie,T,L]),Ye=(0,r.useRef)({content:void 0,reload:()=>{}});return Ye.current={content:S.content,reload:Qe},(0,b.default)(async()=>{q({type:"sync",state:"CHECKING"});const Ve=setTimeout(()=>{q({type:"sync",state:"BUILDING"})},1e3);try{switch(await Te.syncEntityDocs({kind:fe,namespace:ie,name:T},je=>{q({type:"buildLog",log:je})})){case"updated":Ye.current.content?q({type:"sync",state:"BUILD_READY"}):(Ye.current.reload(),q({type:"sync",state:"BUILD_READY_RELOAD"}));break;case"cached":q({type:"sync",state:"UP_TO_DATE"});break;default:q({type:"sync",state:"ERROR",syncError:new Error("Unexpected return state")});break}}catch(ft){q({type:"sync",state:"ERROR",syncError:ft})}finally{clearTimeout(Ve)}},[fe,T,ie,Te,q,Ye]),{state:(0,r.useMemo)(()=>P({activeSyncState:S.activeSyncState,contentLoading:S.contentLoading,content:S.content}),[S.activeSyncState,S.content,S.contentLoading]),contentReload:Qe,path:S.path,content:S.content,contentErrorMessage:(Z=S.contentError)===null||Z===void 0?void 0:Z.toString(),syncErrorMessage:(A=S.syncError)===null||A===void 0?void 0:A.toString(),buildLog:S.buildLog}}const X=(0,r.createContext)({}),M=()=>(0,r.useContext)(X),z=({children:fe})=>{const{"*":ie=""}=(0,W.UO)(),{entityRef:T}=(0,B.x1)(),{kind:L,namespace:Z,name:A}=T,S=Q(L,Z,A,ie);return(0,h.jsx)(X.Provider,{value:S,children:fe instanceof Function?fe(S):fe})},_=fe=>ie=>(0,h.jsx)(z,{children:(0,h.jsx)(fe,{...ie})})},95573:function(Rt,Me,t){"use strict";t.d(Me,{Fw:function(){return W},_Z:function(){return r},pd:function(){return B}});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"]}),B=(0,h.NT)({id:"techdocs:catalog-reader-view"})},17339:function(Rt,Me,t){"use strict";t.d(Me,{S:function(){return L}});var h=t(52322),r=t(2784),W=t(79692),B=t(49378),g=t(38402),b=t(86136),c=t(85256),P=t(93414),te=t(25248),Q=t(65826);const X=(0,W.Z)({flexContainer:{flexWrap:"wrap"},itemText:{width:"100%",marginBottom:"1rem"}}),M=Z=>{const{result:A,highlight:S,rank:q,lineClamp:Te=5,asListItem:Qe=!0,asLink:Ye=!0,title:Xe,icon:Ve}=Z,ft=X(),je=(0,te.z$)(),Ge=()=>{je.captureEvent("discover",A.title,{attributes:{to:A.location},value:q})},st=({children:ot})=>Ye?(0,h.jsx)(P.rU,{noTrack:!0,to:A.location,onClick:Ge,children:ot}):(0,h.jsx)(h.Fragment,{children:ot}),gt=()=>{const ot=S!=null&&S.fields.title?(0,h.jsx)(Q.FA,{text:S.fields.title,preTag:S.preTag,postTag:S.postTag}):A.title,ct=S!=null&&S.fields.entityTitle?(0,h.jsx)(Q.FA,{text:S.fields.entityTitle,preTag:S.preTag,postTag:S.postTag}):A.entityTitle,yt=S!=null&&S.fields.name?(0,h.jsx)(Q.FA,{text:S.fields.name,preTag:S.preTag,postTag:S.postTag}):A.name;return(0,h.jsx)(B.Z,{className:ft.itemText,primaryTypographyProps:{variant:"h6"},primary:(0,h.jsx)(st,{children:Xe||(0,h.jsxs)(h.Fragment,{children:[ot," | ",ct!=null?ct:yt," docs"]})}),secondary:(0,h.jsx)("span",{style:{display:"-webkit-box",WebkitBoxOrient:"vertical",WebkitLineClamp:Te,overflow:"hidden"},children:S!=null&&S.fields.text?(0,h.jsx)(Q.FA,{text:S.fields.text,preTag:S.preTag,postTag:S.postTag}):A.text})})},rt=({children:ot})=>Qe?(0,h.jsxs)(h.Fragment,{children:[(0,h.jsxs)(g.Z,{alignItems:"flex-start",children:[Ve&&(0,h.jsx)(b.Z,{children:Ve}),(0,h.jsx)("div",{className:ft.flexContainer,children:ot})]}),(0,h.jsx)(c.Z,{component:"li"})]}):(0,h.jsx)(h.Fragment,{children:ot});return(0,h.jsx)(rt,{children:(0,h.jsx)(gt,{})})};var z=t(27556),_=t(79635);const fe=(0,W.Z)(Z=>({root:{width:"100%"},bar:{padding:Z.spacing(1)}})),ie=Z=>Z==null?void 0:Z.document,T=Z=>{const{entityId:A,entityTitle:S,debounceTime:q=150}=Z,[Te,Qe]=(0,r.useState)(!1),Ye=(0,_.s0)(),{setFilters:Xe,result:{loading:Ve,value:ft}}=(0,Q.Rx)(),je=fe(),[Ge,st]=(0,r.useState)([]);(0,r.useEffect)(()=>{let yt=!0;if(yt&&ft){const Lt=ft.results.slice(0,10);st(Lt)}return()=>{yt=!1}},[Ve,ft]);const{kind:gt,name:rt,namespace:ot}=A;(0,r.useEffect)(()=>{Xe(yt=>({...yt,kind:gt,namespace:ot,name:rt}))},[gt,ot,rt,Xe]);const ct=(yt,Lt)=>{if(ie(Lt)){const{location:We}=Lt.document;Ye(We)}};return(0,h.jsx)(z.Z,{className:je.bar,variant:"outlined",children:(0,h.jsx)(Q.qO,{classes:{root:je.root},"data-testid":"techdocs-search-bar",size:"small",open:Te,getOptionLabel:()=>"",filterOptions:yt=>yt,onClose:()=>{Qe(!1)},onFocus:()=>{Qe(!0)},onChange:ct,blurOnSelect:!0,noOptionsText:"No results found",value:null,options:Ge,renderOption:({document:yt,highlight:Lt})=>(0,h.jsx)(M,{result:yt,lineClamp:3,asListItem:!1,asLink:!1,title:yt.title,highlight:Lt}),loading:Ve,inputDebounceTime:q,inputPlaceholder:`Search ${S||A.name} docs`,freeSolo:!1})})},L=Z=>{const A={term:"",types:["techdocs"],pageCursor:"",filters:Z.entityId};return(0,h.jsx)(Q.Nd,{initialState:A,children:(0,h.jsx)(T,{...Z})})}},53260:function(){}},function(Rt){var Me=function(h){return Rt(Rt.s=h)};Rt.O(0,[2370,6202,9284,9035,2126,7012,2194,1410,427,6816,5218,5924,4736],function(){return Me(51102)});var t=Rt.O()}]);})();
|
|
492
|
+
Feedback:`),Ke=(ke==null?void 0:ke.type)==="github"?(0,En.BT)(we.href,"blob"):we.href,ht=Qt()(Ke),vt=`/${ht.organization}/${ht.name}`,at=ue.cloneNode();switch(ke==null?void 0:ke.type){case"gitlab":at.href=`${we.origin}${vt}/issues/new?issue[title]=${it}&issue[description]=${Ct}`;break;case"github":at.href=`${we.origin}${vt}/issues/new?title=${it}&body=${Ct}`;break;default:return H}return mn.render(r.createElement(Un.Z),at),at.style.paddingLeft="5px",at.title="Leave feedback for this page",at.id="git-feedback-link",ue==null||ue.insertAdjacentElement("beforebegin",at),H};var zn=t(44882);const hn=()=>w=>{const H=w.querySelector('.md-header label[for="__drawer"]'),ve=w.querySelector("article");if(!H||!ve)return w;const ue=H.cloneNode();return mn.render(r.createElement(zn.Z),ue),ue.id="toggle-sidebar",ue.title="Toggle Sidebar",ue.classList.add("md-content__button"),ue.style.setProperty("padding","0 0 0 5px"),ue.style.setProperty("margin","0.4rem 0 0.4rem 0.4rem"),ve==null||ve.prepend(ue),w},vn=()=>w=>(((ve,ue)=>{Array.from(ve).filter(we=>we.hasAttribute(ue)).forEach(we=>{const ke=we.getAttribute(ue);if(ke){ke.match(/^https?:\/\//i)&&we.setAttribute("target","_blank");try{const Fe=yn(window.location.href);we.setAttribute(ue,new URL(ke,Fe).toString())}catch{we.replaceWith(we.textContent||ke)}}})})(Array.from(w.getElementsByTagName("a")),"href"),w);function yn(w){const H=new URL(w);return!H.pathname.endsWith("/")&&!H.pathname.endsWith(".html")&&(H.pathname+="/"),H.toString()}const Ln=({baseUrl:w,onClick:H})=>ve=>(Array.from(ve.getElementsByTagName("a")).forEach(ue=>{ue.addEventListener("click",we=>{const Fe=ue.getAttribute("href");!Fe||Fe.startsWith(w)&&!ue.hasAttribute("download")&&(we.preventDefault(),H(we,Fe))})}),ve);var Pn=t(15459),xn=t(80030),ge=t(72379),ee=t(41547);const Ee=(0,Pn.Z)(w=>({tooltip:{fontSize:"inherit",color:w.palette.text.primary,margin:0,padding:w.spacing(.5),backgroundColor:"transparent",boxShadow:"none"}}))(xn.ZP),Ne=()=>(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"})}),_e=({text:w})=>{const[H,ve]=(0,r.useState)(!1),ue=(0,r.useCallback)(()=>{window.navigator.clipboard.writeText(w),ve(!0)},[w]),we=(0,r.useCallback)(()=>{ve(!1)},[ve]);return(0,h.jsx)(Ee,{title:"Copied to clipboard",placement:"left",open:H,onClose:we,leaveDelay:1e3,children:(0,h.jsx)(te.Z,{className:"md-clipboard md-icon",onClick:ue,children:(0,h.jsx)(Ne,{})})})},wt=w=>H=>{const ve=H.querySelectorAll("pre > code");for(const we of ve){var ue;const ke=we.textContent||"",Fe=document.createElement("div");we==null||(ue=we.parentElement)===null||ue===void 0||ue.prepend(Fe),mn.render((0,h.jsx)(ee.Z,{theme:w,children:(0,h.jsx)(_e,{text:ke})}),Fe)}return H},ae=()=>w=>{var H;return(H=w.querySelector(".md-header"))===null||H===void 0||H.remove(),w},k=()=>w=>{var H,ve;return(H=w.querySelector(".md-footer .md-copyright"))===null||H===void 0||H.remove(),(ve=w.querySelector(".md-footer-copyright"))===null||ve===void 0||ve.remove(),w},ce=({onLoading:w,onLoaded:H})=>ve=>(w(),ve.addEventListener(g.Ox,function ue(){H(),ve.removeEventListener(g.Ox,ue)}),ve),Oe=()=>w=>(setTimeout(()=>{if(window.location.hash){var H;const ve=window.location.hash.slice(1);(H=w==null?void 0:w.querySelector(`[id="${ve}"]`))===null||H===void 0||H.scrollIntoView()}},200),w),D=()=>w=>(setTimeout(()=>{const H=w==null?void 0:w.querySelectorAll("li.md-nav__item--active");H.length!==0&&(H.forEach(ue=>{const we=ue==null?void 0:ue.querySelector("input");we!=null&&we.checked||we==null||we.click()}),H[H.length-1].scrollIntoView())},200),w),U=async(w,H)=>{let ve;if(typeof w=="string")ve=new DOMParser().parseFromString(w,"text/html").documentElement;else if(w instanceof Element)ve=w;else throw new Error("dom is not a recognized type");for(const ue of H)ve=await ue(ve);return ve},de="screen and (max-width: 76.1875em)",pe=w=>{const H=(0,Qe.s0)(),ve=(0,Ye.Z)(),ue=(0,Xe.Z)(de),we=Ie(),ke=dn(),Fe=(0,Z.z$)(),it=(0,Z.h_)(g.Dl),Ct=(0,Z.h_)(Ve.q3),{state:Ke,path:ht,content:vt}=(0,S.DK)(),[at,Tt]=(0,r.useState)(null),Ut=(0,g.ux)(at),Mt=(0,r.useCallback)(()=>{if(!at)return;at.querySelectorAll(".md-sidebar").forEach(zt=>{if(ue)zt.style.top="0px";else{const Sn=document==null?void 0:document.querySelector(".techdocs-reader-page");var _t;const pn=(_t=Sn==null?void 0:Sn.getBoundingClientRect().top)!==null&&_t!==void 0?_t:0;var kn;let Hn=(kn=at.getBoundingClientRect().top)!==null&&kn!==void 0?kn:0;const ln=at.querySelector(".md-container > .md-tabs");var Jn;const On=(Jn=ln==null?void 0:ln.getBoundingClientRect().height)!==null&&Jn!==void 0?Jn:0;Hn<pn&&(Hn=pn),zt.style.top=`${Math.max(Hn,0)+On}px`}zt.style.setProperty("opacity","1")})},[at,ue]);(0,r.useEffect)(()=>(window.addEventListener("resize",Mt),window.addEventListener("scroll",Mt,!0),()=>{window.removeEventListener("resize",Mt),window.removeEventListener("scroll",Mt,!0)}),[at,Mt]);const Wn=(0,r.useCallback)(()=>{if(!at)return;const Nt=at.querySelector(".md-footer");Nt&&(Nt.style.width=`${at.getBoundingClientRect().width}px`)},[at]);(0,r.useEffect)(()=>(window.addEventListener("resize",Wn),()=>{window.removeEventListener("resize",Wn)}),[at,Wn]),(0,r.useEffect)(()=>{Ut||(Wn(),Mt())},[Ke,Ut,Wn,Mt]);const Vn=(0,r.useCallback)((Nt,zt)=>U(Nt,[we,Fn({techdocsStorageApi:it,entityId:w,path:zt}),vn(),hn(),ae(),k(),Mn(Ct),ke]),[w,Ct,it,we,ke]),bn=(0,r.useCallback)(async Nt=>U(Nt,[Oe(),D(),wt(ve),Ln({baseUrl:window.location.origin,onClick:(zt,_t)=>{var kn;const Jn=zt.ctrlKey||zt.metaKey,Sn=new URL(_t),pn=`${Sn.pathname}${Sn.search}${Sn.hash}`,Hn=((kn=zt.target)===null||kn===void 0?void 0:kn.innerText)||_t,ln=_t.replace(window.location.origin,"");if(Fe.captureEvent("click",Hn,{attributes:{to:ln}}),Sn.hash)if(Jn)window.open(pn,"_blank");else{var On;H(pn),(On=Nt==null?void 0:Nt.querySelector(`[id="${Sn.hash.slice(1)}"]`))===null||On===void 0||On.scrollIntoView()}else Jn?window.open(pn,"_blank"):H(pn)}}),ce({onLoading:()=>{},onLoaded:()=>{var zt;(zt=Nt.querySelector(".md-nav__title"))===null||zt===void 0||zt.removeAttribute("for")}}),ce({onLoading:()=>{Array.from(Nt.querySelectorAll(".md-sidebar")).forEach(_t=>{_t.style.setProperty("opacity","0")})},onLoaded:()=>{}})]),[ve,H,Fe]);return(0,r.useEffect)(()=>{if(!vt)return()=>{};let Nt=!0;return Vn(vt,ht).then(async zt=>{if(!(zt!=null&&zt.innerHTML)||!Nt)return;window.scroll({top:0});const _t=await bn(zt);Tt(_t)}),()=>{Nt=!1}},[vt,ht,Vn,bn]),at};var ye=t(8560);const Pe=()=>{const w=(0,g.$L)(),{shadowRoot:H}=(0,g.x1)(),ve=H==null?void 0:H.querySelector('[data-md-component="content"]'),ue=H==null?void 0:H.querySelector('div[data-md-component="sidebar"][data-md-type="navigation"], div[data-md-component="navigation"]');let we=ue==null?void 0:ue.querySelector('[data-techdocs-addons-location="primary sidebar"]');we||(we=document.createElement("div"),we.setAttribute("data-techdocs-addons-location","primary sidebar"),ue==null||ue.prepend(we));const ke=H==null?void 0:H.querySelector('div[data-md-component="sidebar"][data-md-type="toc"], div[data-md-component="toc"]');let Fe=ke==null?void 0:ke.querySelector('[data-techdocs-addons-location="secondary sidebar"]');return Fe||(Fe=document.createElement("div"),Fe.setAttribute("data-techdocs-addons-location","secondary sidebar"),ke==null||ke.prepend(Fe)),(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(ye.Z,{container:we,children:w.renderComponentsByLocation(g.oZ.PrimarySidebar)}),(0,h.jsx)(ye.Z,{container:ve,children:w.renderComponentsByLocation(g.oZ.Content)}),(0,h.jsx)(ye.Z,{container:Fe,children:w.renderComponentsByLocation(g.oZ.SecondarySidebar)})]})},Re=(0,W.Z)({search:{width:"100%","@media (min-width: 76.1875em)":{width:"calc(100% - 34.4rem)",margin:"0 auto"}}}),Ue=(0,S.m1)(w=>{var H;const{withSearch:ve=!0,onReady:ue}=w,we=Re(),{entityMetadata:{value:ke,loading:Fe},entityRef:it,setShadowRoot:Ct}=(0,g.x1)(),Ke=pe(it),ht=(0,r.useCallback)(vt=>{Ct(vt),ue instanceof Function&&ue()},[Ct,ue]);return Fe===!1&&!ke?(0,h.jsx)(b.mf,{status:"404",statusMessage:"PAGE NOT FOUND"}):Ke?(0,h.jsx)(b.VY,{children:(0,h.jsxs)(B.Z,{container:!0,children:[(0,h.jsx)(B.Z,{xs:12,item:!0,children:(0,h.jsx)(Te,{})}),ve&&(0,h.jsx)(B.Z,{className:we.search,xs:"auto",item:!0,children:(0,h.jsx)(c.S,{entityId:it,entityTitle:ke==null||(H=ke.metadata)===null||H===void 0?void 0:H.title})}),(0,h.jsx)(B.Z,{xs:12,item:!0,children:(0,h.jsx)(g.VA,{element:Ke,onAppend:ht,children:(0,h.jsx)(Pe,{})})})]})}):(0,h.jsx)(b.VY,{children:(0,h.jsx)(B.Z,{container:!0,children:(0,h.jsx)(B.Z,{xs:12,item:!0,children:(0,h.jsx)(Te,{})})})})}),nt=null},93225:function(Rt,Me,t){"use strict";t.d(Me,{S:function(){return fe}});var h=t(52322),r=t(2784),W=t(18671),B=t(60905),g=t(98069),b=t(73250),c=t(61886),P=t(92848),te=t(25271),Q=t(93414),X=t(25248),M=t(76635),z=t(95573);const _=(0,h.jsx)(g.Z,{animation:"wave",variant:"text",height:40}),fe=ie=>{const{children:T}=ie,L=(0,c.$L)(),Z=(0,X.h_)(X.Ds),{title:A,setTitle:S,subtitle:q,setSubtitle:Te,entityRef:Qe,metadata:{value:Ye,loading:Xe},entityMetadata:{value:Ve,loading:ft}}=(0,c.x1)();(0,r.useEffect)(()=>{!Ye||(S(Ye.site_name),Te(()=>{let{site_description:se}=Ye;return(!se||se==="None")&&(se=""),se}))},[Ye,S,Te]);const je=Z.getOptional("app.title")||"Backstage",Ge=[A,q,je].filter(Boolean).join(" | "),{locationMetadata:st,spec:gt}=Ve||{},rt=gt==null?void 0:gt.lifecycle,ot=Ve?(0,P.hF)(Ve,te.S4):[],ct=(0,X.tg)(z._Z)(),yt=(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(Q.i9,{label:(0,M.capitalize)((Ve==null?void 0:Ve.kind)||"entity"),value:(0,h.jsx)(P.dx,{color:"inherit",entityRef:Qe,title:Ve==null?void 0:Ve.metadata.title,defaultKind:"Component"})}),ot.length>0&&(0,h.jsx)(Q.i9,{label:"Owner",value:(0,h.jsx)(P.rI,{color:"inherit",entityRefs:ot,defaultKind:"group"})}),rt?(0,h.jsx)(Q.i9,{label:"Lifecycle",value:rt}):null,st&&st.type!=="dir"&&st.type!=="file"?(0,h.jsx)(Q.i9,{label:"",value:(0,h.jsxs)(B.Z,{container:!0,direction:"column",alignItems:"center",style:{color:"#fff"},children:[(0,h.jsx)(B.Z,{style:{padding:0},item:!0,children:(0,h.jsx)(b.Z,{style:{marginTop:"-25px"}})}),(0,h.jsx)(B.Z,{style:{padding:0},item:!0,children:"Source"})]}),url:st.target}):null]});return!ft&&Ve===void 0||!Xe&&Ye===void 0?null:(0,h.jsxs)(Q.h4,{type:"Documentation",typeLink:ct,title:A||_,subtitle:q===""?void 0:q||_,children:[(0,h.jsx)(W.Z,{titleTemplate:"%s",children:(0,h.jsx)("title",{children:Ge})}),yt,T,L.renderComponentsByLocation(c.oZ.Header)]})}},65124:function(Rt,Me,t){"use strict";t.d(Me,{b:function(){return M}});var h=t(52322),r=t(2784),W=t(79692),B=t(15223),g=t(95544),b=t(80030),c=t(61837),P=t(48348),te=t(47603),Q=t(61886);const X=(0,W.Z)(z=>({root:{gridArea:"pageSubheader",flexDirection:"column",minHeight:"auto",padding:z.spacing(3,3,0)}})),M=z=>{const _=X(),[fe,ie]=(0,r.useState)(null),T=(0,r.useCallback)(Qe=>{ie(Qe.currentTarget)},[]),L=(0,r.useCallback)(()=>{ie(null)},[]),{entityMetadata:{value:Z,loading:A}}=(0,Q.x1)(),S=(0,Q.$L)(),q=S.renderComponentsByLocation(Q.oZ.Subheader),Te=S.renderComponentsByLocation(Q.oZ.Settings);return!q&&!Te||A===!1&&!Z?null:(0,h.jsx)(B.Z,{classes:_,...z.toolbarProps,children:(0,h.jsxs)(g.Z,{display:"flex",justifyContent:"flex-end",width:"100%",flexWrap:"wrap",children:[q,Te?(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:fe,anchorOrigin:{vertical:"bottom",horizontal:"right"},open:Boolean(fe),onClose:L,keepMounted:!0,children:Te})]}):null]})})}},95481:function(Rt,Me,t){"use strict";t.d(Me,{DK:function(){return M},m1:function(){return _}});var h=t(52322),r=t(2784),W=t(79635),B=t(61886),g=t(25248),b=t(64279),c=t(77446);function P({contentLoading:fe,content:ie,activeSyncState:T}){return fe||T==="BUILD_READY_RELOAD"||!ie&&T==="CHECKING"?"CHECKING":!ie&&T==="BUILDING"?"INITIAL_BUILD":ie?T==="BUILDING"?"CONTENT_STALE_REFRESHING":T==="BUILD_READY"?"CONTENT_STALE_READY":T==="ERROR"?"CONTENT_STALE_ERROR":"CONTENT_FRESH":"CONTENT_NOT_FOUND"}function te(fe,ie){const T={...fe};switch(ie.type){case"sync":ie.state==="CHECKING"&&(T.buildLog=[]),T.activeSyncState=ie.state,T.syncError=ie.syncError;break;case"contentLoading":T.contentLoading=!0,T.contentError=void 0;break;case"content":typeof ie.path=="string"&&(T.path=ie.path),T.contentLoading=!1,T.content=ie.content,T.contentError=ie.contentError;break;case"buildLog":T.buildLog=T.buildLog.concat(ie.log);break;default:throw new Error}return["BUILD_READY","BUILD_READY_RELOAD"].includes(T.activeSyncState)&&["contentLoading","content"].includes(ie.type)&&(T.activeSyncState="UP_TO_DATE",T.buildLog=[]),T}function Q(fe,ie,T,L){var Z,A;const[S,q]=(0,r.useReducer)(te,{activeSyncState:"CHECKING",path:L,contentLoading:!0,buildLog:[]}),Te=(0,g.h_)(B.Dl),{retry:Qe}=(0,c.Z)(async()=>{q({type:"contentLoading"});try{const Ve=await Te.getEntityDocs({kind:fe,namespace:ie,name:T},L);return q({type:"content",content:Ve,path:L}),Ve}catch(Ve){q({type:"content",contentError:Ve,path:L})}},[Te,fe,ie,T,L]),Ye=(0,r.useRef)({content:void 0,reload:()=>{}});return Ye.current={content:S.content,reload:Qe},(0,b.default)(async()=>{q({type:"sync",state:"CHECKING"});const Ve=setTimeout(()=>{q({type:"sync",state:"BUILDING"})},1e3);try{switch(await Te.syncEntityDocs({kind:fe,namespace:ie,name:T},je=>{q({type:"buildLog",log:je})})){case"updated":Ye.current.content?q({type:"sync",state:"BUILD_READY"}):(Ye.current.reload(),q({type:"sync",state:"BUILD_READY_RELOAD"}));break;case"cached":q({type:"sync",state:"UP_TO_DATE"});break;default:q({type:"sync",state:"ERROR",syncError:new Error("Unexpected return state")});break}}catch(ft){q({type:"sync",state:"ERROR",syncError:ft})}finally{clearTimeout(Ve)}},[fe,T,ie,Te,q,Ye]),{state:(0,r.useMemo)(()=>P({activeSyncState:S.activeSyncState,contentLoading:S.contentLoading,content:S.content}),[S.activeSyncState,S.content,S.contentLoading]),contentReload:Qe,path:S.path,content:S.content,contentErrorMessage:(Z=S.contentError)===null||Z===void 0?void 0:Z.toString(),syncErrorMessage:(A=S.syncError)===null||A===void 0?void 0:A.toString(),buildLog:S.buildLog}}const X=(0,r.createContext)({}),M=()=>(0,r.useContext)(X),z=({children:fe})=>{const{"*":ie=""}=(0,W.UO)(),{entityRef:T}=(0,B.x1)(),{kind:L,namespace:Z,name:A}=T,S=Q(L,Z,A,ie);return(0,h.jsx)(X.Provider,{value:S,children:fe instanceof Function?fe(S):fe})},_=fe=>ie=>(0,h.jsx)(z,{children:(0,h.jsx)(fe,{...ie})})},95573:function(Rt,Me,t){"use strict";t.d(Me,{Fw:function(){return W},_Z:function(){return r},pd:function(){return B}});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"]}),B=(0,h.NT)({id:"techdocs:catalog-reader-view"})},17339:function(Rt,Me,t){"use strict";t.d(Me,{S:function(){return L}});var h=t(52322),r=t(2784),W=t(79692),B=t(49378),g=t(38402),b=t(86136),c=t(85256),P=t(93414),te=t(25248),Q=t(65826);const X=(0,W.Z)({flexContainer:{flexWrap:"wrap"},itemText:{width:"100%",marginBottom:"1rem"}}),M=Z=>{const{result:A,highlight:S,rank:q,lineClamp:Te=5,asListItem:Qe=!0,asLink:Ye=!0,title:Xe,icon:Ve}=Z,ft=X(),je=(0,te.z$)(),Ge=()=>{je.captureEvent("discover",A.title,{attributes:{to:A.location},value:q})},st=({children:ot})=>Ye?(0,h.jsx)(P.rU,{noTrack:!0,to:A.location,onClick:Ge,children:ot}):(0,h.jsx)(h.Fragment,{children:ot}),gt=()=>{const ot=S!=null&&S.fields.title?(0,h.jsx)(Q.FA,{text:S.fields.title,preTag:S.preTag,postTag:S.postTag}):A.title,ct=S!=null&&S.fields.entityTitle?(0,h.jsx)(Q.FA,{text:S.fields.entityTitle,preTag:S.preTag,postTag:S.postTag}):A.entityTitle,yt=S!=null&&S.fields.name?(0,h.jsx)(Q.FA,{text:S.fields.name,preTag:S.preTag,postTag:S.postTag}):A.name;return(0,h.jsx)(B.Z,{className:ft.itemText,primaryTypographyProps:{variant:"h6"},primary:(0,h.jsx)(st,{children:Xe||(0,h.jsxs)(h.Fragment,{children:[ot," | ",ct!=null?ct:yt," docs"]})}),secondary:(0,h.jsx)("span",{style:{display:"-webkit-box",WebkitBoxOrient:"vertical",WebkitLineClamp:Te,overflow:"hidden"},children:S!=null&&S.fields.text?(0,h.jsx)(Q.FA,{text:S.fields.text,preTag:S.preTag,postTag:S.postTag}):A.text})})},rt=({children:ot})=>Qe?(0,h.jsxs)(h.Fragment,{children:[(0,h.jsxs)(g.Z,{alignItems:"flex-start",children:[Ve&&(0,h.jsx)(b.Z,{children:Ve}),(0,h.jsx)("div",{className:ft.flexContainer,children:ot})]}),(0,h.jsx)(c.Z,{component:"li"})]}):(0,h.jsx)(h.Fragment,{children:ot});return(0,h.jsx)(rt,{children:(0,h.jsx)(gt,{})})};var z=t(27556),_=t(79635);const fe=(0,W.Z)(Z=>({root:{width:"100%"},bar:{padding:Z.spacing(1)}})),ie=Z=>Z==null?void 0:Z.document,T=Z=>{const{entityId:A,entityTitle:S,debounceTime:q=150}=Z,[Te,Qe]=(0,r.useState)(!1),Ye=(0,_.s0)(),{setFilters:Xe,result:{loading:Ve,value:ft}}=(0,Q.Rx)(),je=fe(),[Ge,st]=(0,r.useState)([]);(0,r.useEffect)(()=>{let yt=!0;if(yt&&ft){const Lt=ft.results.slice(0,10);st(Lt)}return()=>{yt=!1}},[Ve,ft]);const{kind:gt,name:rt,namespace:ot}=A;(0,r.useEffect)(()=>{Xe(yt=>({...yt,kind:gt,namespace:ot,name:rt}))},[gt,ot,rt,Xe]);const ct=(yt,Lt)=>{if(ie(Lt)){const{location:We}=Lt.document;Ye(We)}};return(0,h.jsx)(z.Z,{className:je.bar,variant:"outlined",children:(0,h.jsx)(Q.qO,{classes:{root:je.root},"data-testid":"techdocs-search-bar",size:"small",open:Te,getOptionLabel:()=>"",filterOptions:yt=>yt,onClose:()=>{Qe(!1)},onFocus:()=>{Qe(!0)},onChange:ct,blurOnSelect:!0,noOptionsText:"No results found",value:null,options:Ge,renderOption:({document:yt,highlight:Lt})=>(0,h.jsx)(M,{result:yt,lineClamp:3,asListItem:!1,asLink:!1,title:yt.title,highlight:Lt}),loading:Ve,inputDebounceTime:q,inputPlaceholder:`Search ${S||A.name} docs`,freeSolo:!1})})},L=Z=>{const A={term:"",types:["techdocs"],pageCursor:"",filters:Z.entityId};return(0,h.jsx)(Q.Nd,{initialState:A,children:(0,h.jsx)(T,{...Z})})}},53260:function(){}},function(Rt){var Me=function(h){return Rt(Rt.s=h)};Rt.O(0,[2370,6202,9284,9035,2126,7012,2194,1410,427,6816,5218,5924,4736],function(){return Me(51102)});var t=Rt.O()}]);})();
|
|
493
493
|
|
|
494
|
-
//# sourceMappingURL=main.
|
|
494
|
+
//# sourceMappingURL=main.cba21e8e.js.map
|