@techdocs/cli 1.2.4-next.0 → 1.2.4-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.
Files changed (30) hide show
  1. package/CHANGELOG.md +11 -0
  2. package/dist/embedded-app/index.html +1 -1
  3. package/dist/embedded-app/static/5837.f53a69b0.chunk.js +3 -0
  4. package/dist/embedded-app/static/{5837.45e6ec1d.chunk.js.map → 5837.f53a69b0.chunk.js.map} +1 -1
  5. package/dist/embedded-app/static/{6051.3f1d6d7c.chunk.js → 6051.d2e9db23.chunk.js} +2 -2
  6. package/dist/embedded-app/static/{6051.3f1d6d7c.chunk.js.map → 6051.d2e9db23.chunk.js.map} +1 -1
  7. package/dist/embedded-app/static/{8951.b74cd97a.chunk.js → 8951.131e35ed.chunk.js} +2 -2
  8. package/dist/embedded-app/static/{8951.b74cd97a.chunk.js.map → 8951.131e35ed.chunk.js.map} +1 -1
  9. package/dist/embedded-app/static/main.8e467e32.js +494 -0
  10. package/dist/embedded-app/static/main.8e467e32.js.map +1 -0
  11. package/dist/embedded-app/static/module-luxon.8ea19264.js +3 -0
  12. package/dist/embedded-app/static/module-luxon.8ea19264.js.map +1 -0
  13. package/dist/embedded-app/static/module-remix-run.df834241.js +12 -0
  14. package/dist/embedded-app/static/module-remix-run.df834241.js.map +1 -0
  15. package/dist/embedded-app/static/{module-yaml.b5c4d531.js → module-yaml.cb32d5ca.js} +58 -58
  16. package/dist/embedded-app/static/module-yaml.cb32d5ca.js.map +1 -0
  17. package/dist/embedded-app/static/{runtime.4fdcff32.js → runtime.8e467e32.js} +2 -2
  18. package/dist/embedded-app/static/{runtime.4fdcff32.js.map → runtime.8e467e32.js.map} +1 -1
  19. package/dist/embedded-app/static/vendor.8e467e32.js +236 -0
  20. package/dist/embedded-app/static/vendor.8e467e32.js.map +1 -0
  21. package/dist/index.cjs.js +1 -1
  22. package/package.json +6 -6
  23. package/dist/embedded-app/static/5837.45e6ec1d.chunk.js +0 -3
  24. package/dist/embedded-app/static/main.4fdcff32.js +0 -494
  25. package/dist/embedded-app/static/main.4fdcff32.js.map +0 -1
  26. package/dist/embedded-app/static/module-luxon.1ec72e86.js +0 -3
  27. package/dist/embedded-app/static/module-luxon.1ec72e86.js.map +0 -1
  28. package/dist/embedded-app/static/module-yaml.b5c4d531.js.map +0 -1
  29. package/dist/embedded-app/static/vendor.4fdcff32.js +0 -236
  30. package/dist/embedded-app/static/vendor.4fdcff32.js.map +0 -1
@@ -1,494 +0,0 @@
1
- (()=>{(self.webpackChunktechdocs_cli_embedded_app=self.webpackChunktechdocs_cli_embedded_app||[]).push([[179],{29644:function(jt,Fe,t){"use strict";t.d(Fe,{n3:function(){return V},MS:function(){return x}});var h=t(25271),n=t(23054),g=t(96279),R=t.n(g);const V=Symbol.for("CATALOG_FILTER_EXISTS_0e15b590c0b343a2bae3e787e84c2111");class x{async getEntityAncestors(I,ne){const{kind:J,namespace:Q,name:D}=(0,h.of)(I.entityRef);return await this.requestRequired("GET",`/entities/by-name/${encodeURIComponent(J)}/${encodeURIComponent(Q)}/${encodeURIComponent(D)}/ancestry`,ne)}async getLocationById(I,ne){return await this.requestOptional("GET",`/locations/${encodeURIComponent(I)}`,ne)}async getEntities(I,ne){const{filter:J=[],fields:Q=[],offset:D,limit:X,after:_}=I!=null?I:{},he=[];for(const $ of[J].flat()){const A=[];for(const[T,ee]of Object.entries($))for(const Ie of[ee].flat())Ie===V?A.push(encodeURIComponent(T)):typeof Ie=="string"&&A.push(`${encodeURIComponent(T)}=${encodeURIComponent(Ie)}`);A.length&&he.push(`filter=${A.join(",")}`)}Q.length&&he.push(`fields=${Q.map(encodeURIComponent).join(",")}`),D!==void 0&&he.push(`offset=${D}`),X!==void 0&&he.push(`limit=${X}`),_!==void 0&&he.push(`after=${encodeURIComponent(_)}`);const ie=he.length?`?${he.join("&")}`:"",E=await this.requestRequired("GET",`/entities${ie}`,ne),L=($,A)=>{var T,ee;if(((T=$.metadata)===null||T===void 0?void 0:T.name)===void 0||$.kind===void 0||((ee=A.metadata)===null||ee===void 0?void 0:ee.name)===void 0||A.kind===void 0)return 0;const Ie=(0,h.eE)($),Je=(0,h.eE)(A);return Ie<Je?-1:Ie>Je?1:0};return{items:E.sort(L)}}async getEntitiesByRefs(I,ne){var J;const Q=[];!((J=I.fields)===null||J===void 0)&&J.length&&Q.push(`fields=${I.fields.map(encodeURIComponent).join(",")}`);const D=await this.discoveryApi.getBaseUrl("catalog"),X=Q.length?`?${Q.join("&")}`:"",_=`${D}/entities/by-refs${X}`,he=await this.fetchApi.fetch(_,{headers:{"Content-Type":"application/json",...(ne==null?void 0:ne.token)&&{Authorization:`Bearer ${ne==null?void 0:ne.token}`}},method:"POST",body:JSON.stringify({entityRefs:I.entityRefs})});if(!he.ok)throw await n.VL.fromResponse(he);const{items:ie}=await he.json();return{items:ie}}async getEntityByRef(I,ne){const{kind:J,namespace:Q,name:D}=(0,h.of)(I);return this.requestOptional("GET",`/entities/by-name/${encodeURIComponent(J)}/${encodeURIComponent(Q)}/${encodeURIComponent(D)}`,ne)}async getEntityByName(I,ne){const{kind:J,namespace:Q="default",name:D}=I;return this.requestOptional("GET",`/entities/by-name/${encodeURIComponent(J)}/${encodeURIComponent(Q)}/${encodeURIComponent(D)}`,ne)}async refreshEntity(I,ne){const J=await this.fetchApi.fetch(`${await this.discoveryApi.getBaseUrl("catalog")}/refresh`,{headers:{"Content-Type":"application/json",...(ne==null?void 0:ne.token)&&{Authorization:`Bearer ${ne==null?void 0:ne.token}`}},method:"POST",body:JSON.stringify({entityRef:I})});if(J.status!==200)throw new Error(await J.text())}async getEntityFacets(I,ne){const{filter:J=[],facets:Q}=I,D=[];for(const _ of[J].flat()){const he=[];for(const[ie,E]of Object.entries(_))for(const L of[E].flat())L===V?he.push(encodeURIComponent(ie)):typeof L=="string"&&he.push(`${encodeURIComponent(ie)}=${encodeURIComponent(L)}`);he.length&&D.push(`filter=${he.join(",")}`)}for(const _ of Q)D.push(`facet=${encodeURIComponent(_)}`);const X=D.length?`?${D.join("&")}`:"";return await this.requestOptional("GET",`/entity-facets${X}`,ne)}async addLocation(I,ne){const{type:J="url",target:Q,dryRun:D}=I,X=await this.fetchApi.fetch(`${await this.discoveryApi.getBaseUrl("catalog")}/locations${D?"?dryRun=true":""}`,{headers:{"Content-Type":"application/json",...(ne==null?void 0:ne.token)&&{Authorization:`Bearer ${ne==null?void 0:ne.token}`}},method:"POST",body:JSON.stringify({type:J,target:Q})});if(X.status!==201)throw new Error(await X.text());const{location:_,entities:he,exists:ie}=await X.json();if(!_)throw new Error(`Location wasn't added: ${Q}`);return{location:_,entities:he,exists:ie}}async getLocationByRef(I,ne){return(await this.requestRequired("GET","/locations",ne)).map(Q=>Q.data).find(Q=>I===(0,h.NZ)(Q))}async removeLocationById(I,ne){await this.requestIgnored("DELETE",`/locations/${encodeURIComponent(I)}`,ne)}async removeEntityByUid(I,ne){await this.requestIgnored("DELETE",`/entities/by-uid/${encodeURIComponent(I)}`,ne)}async validateEntity(I,ne,J){const Q=await this.fetchApi.fetch(`${await this.discoveryApi.getBaseUrl("catalog")}/validate-entity`,{headers:{"Content-Type":"application/json",...(J==null?void 0:J.token)&&{Authorization:`Bearer ${J==null?void 0:J.token}`}},method:"POST",body:JSON.stringify({entity:I,location:ne})});if(Q.ok)return{valid:!0};if(Q.status!==400)throw await n.VL.fromResponse(Q);const{errors:D=[]}=await Q.json();return{valid:!1,errors:D}}async requestIgnored(I,ne,J){const Q=`${await this.discoveryApi.getBaseUrl("catalog")}${ne}`,D=J!=null&&J.token?{Authorization:`Bearer ${J.token}`}:{},X=await this.fetchApi.fetch(Q,{method:I,headers:D});if(!X.ok)throw await n.VL.fromResponse(X)}async requestRequired(I,ne,J){const Q=`${await this.discoveryApi.getBaseUrl("catalog")}${ne}`,D=J!=null&&J.token?{Authorization:`Bearer ${J.token}`}:{},X=await this.fetchApi.fetch(Q,{method:I,headers:D});if(!X.ok)throw await n.VL.fromResponse(X);return await X.json()}async requestOptional(I,ne,J){const Q=`${await this.discoveryApi.getBaseUrl("catalog")}${ne}`,D=J!=null&&J.token?{Authorization:`Bearer ${J.token}`}:{},X=await this.fetchApi.fetch(Q,{method:I,headers:D});if(!X.ok){if(X.status===404)return;throw await n.VL.fromResponse(X)}return await X.json()}constructor(I){this.discoveryApi=I.discoveryApi,this.fetchApi=I.fetchApi||{fetch:R()}}}},25271:function(jt,Fe,t){"use strict";t.d(Fe,{Tf:function(){return g},P1:function(){return ge},q1:function(){return te},M6:function(){return Ee},l2:function(){return n},zG:function(){return h},w$:function(){return ln},nP:function(){return Zn},aS:function(){return Nn},S4:function(){return en},cz:function(){return In},iB:function(){return Qe},CV:function(){return xt},of:function(){return rt},Ou:function(){return De},eE:function(){return ct},NZ:function(){return qe}});const h="default",n="backstage.io/view-url",g="backstage.io/edit-url",R="kubernetes.io/api-server",V="kubernetes.io/api-server-certificate-authority",x="kubernetes.io/auth-provider";var l=t(76635),I=t.n(l);class ne{async enforce(P){return P.metadata.namespace?P:lodash.merge({metadata:{namespace:this.namespace}},P)}constructor(P=DEFAULT_NAMESPACE){this.namespace=P}}class J{static isValidPrefixAndOrSuffix(P,q,Ke,U){if(typeof P!="string")return!1;const Z=P.split(q);return Z.length===1?U(Z[0]):Z.length===2?Ke(Z[0])&&U(Z[1]):!1}static isJsonSafe(P){try{return I().isEqual(P,JSON.parse(JSON.stringify(P)))}catch{return!1}}static isValidDnsSubdomain(P){return typeof P=="string"&&P.length>=1&&P.length<=253&&P.split(".").every(J.isValidDnsLabel)}static isValidDnsLabel(P){return typeof P=="string"&&P.length>=1&&P.length<=63&&/^[a-z0-9]+(\-[a-z0-9]+)*$/.test(P)}static isValidTag(P){return typeof P=="string"&&P.length>=1&&P.length<=63&&/^[a-z0-9+#]+(\-[a-z0-9+#]+)*$/.test(P)}static isValidUrl(P){if(typeof P!="string")return!1;try{return new URL(P),!0}catch{return!1}}static isValidString(P){var q;return typeof P=="string"&&((q=P==null?void 0:P.trim())===null||q===void 0?void 0:q.length)>=1}static isNonEmptyString(P){var q;return typeof P=="string"&&((q=P==null?void 0:P.trim())===null||q===void 0?void 0:q.length)>=1}}var Q=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}}}}}'),D=t(27991),X=t.n(D),_=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"}}}`),he=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 E=new Map,L=[Q,_,he,ie];function $(ae){if(!(ae!=null&&ae.length))throw new TypeError("Unknown error");const P=ae[0];throw new TypeError(`${P.instancePath||"<root>"} ${P.message}${P.params?` - ${Object.entries(P.params).map(([q,Ke])=>`${q}: ${Ke}`).join(", ")}`:""}`)}function A(ae,P={}){var q;const Ke=(q=P==null?void 0:P.disableCache)!==null&&q!==void 0?q:!1,U=Ke?"":JSON.stringify(ae);if(!Ke){const be=E.get(U);if(be)return be}const Z=T(ae),ce=new(X())({allowUnionTypes:!0,allErrors:!0,validateSchema:!0});Z.length&&ce.addSchema(Z,void 0,void 0,!0);const pe=ce.compile(ae);return Ke||E.set(U,pe),pe}function T(ae){if(typeof ae!="object")return[];const P=new Set;ae.$id&&P.add(ae.$id);const q=new Array,Ke=[ae];for(;Ke.length;){const U=Ke.pop();for(const Z of ee(U))if(!P.has(Z)){P.add(Z);const ce=L.find(pe=>pe.$id===Z);ce&&(q.push(ce),Ke.push(ce))}}return q}function*ee(ae){const P=[ae];for(;P.length;){const q=P.pop();if(typeof q=="object"&&q)for(const[Ke,U]of Object.entries(q))Ke==="$ref"&&typeof U=="string"?yield U.split("#")[0]:P.push(U)}}function Ie(ae){const P=compileAjvSchema(ae||entityEnvelopeSchema);return q=>{if(P(q)===!0)return q;throw throwAjvError(P.errors)}}function Je(ae){const P=A(ae);return q=>{var Ke;if(P(q)===!0)return q;const Z=(Ke=P.errors)===null||Ke===void 0?void 0:Ke.filter(ce=>["/kind","/apiVersion"].includes(ce.instancePath));if((Z==null?void 0:Z.length)&&Z.every(ce=>ce.keyword==="enum"))return!1;throw $(P.errors)}}function Ze(ae){const P=compileAjvSchema(ae||entitySchema);return q=>{if(P(q)===!0)return q;throw throwAjvError(P.errors)}}class je{static isValidApiVersion(P){return J.isValidPrefixAndOrSuffix(P,"/",J.isValidDnsSubdomain,q=>q.length>=1&&q.length<=63&&/^[a-z0-9A-Z]+$/.test(q))}static isValidKind(P){return typeof P=="string"&&P.length>=1&&P.length<=63&&/^[a-zA-Z][a-z0-9A-Z]*$/.test(P)}static isValidObjectName(P){return typeof P=="string"&&P.length>=1&&P.length<=63&&/^([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9]$/.test(P)}static isValidNamespace(P){return J.isValidDnsLabel(P)}static isValidLabelKey(P){return J.isValidPrefixAndOrSuffix(P,"/",J.isValidDnsSubdomain,je.isValidObjectName)}static isValidLabelValue(P){return P===""||je.isValidObjectName(P)}static isValidAnnotationKey(P){return J.isValidPrefixAndOrSuffix(P,"/",J.isValidDnsSubdomain,je.isValidObjectName)}static isValidAnnotationValue(P){return typeof P=="string"}}const We={isValidApiVersion:je.isValidApiVersion,isValidKind:je.isValidKind,isValidEntityName:je.isValidObjectName,isValidNamespace:je.isValidNamespace,isValidLabelKey:je.isValidLabelKey,isValidLabelValue:je.isValidLabelValue,isValidAnnotationKey:je.isValidAnnotationKey,isValidAnnotationValue:je.isValidAnnotationValue,isValidTag:ae=>typeof ae=="string"&&ae.length>=1&&ae.length<=63&&/^[a-z0-9:+#]+(\-[a-z0-9:+#]+)*$/.test(ae)};function gt(ae={}){return{...We,...ae}}class nt{async enforce(P){function q(S,H,me){if(H==null)throw new Error(`${S} must have a value`);let ue;try{ue=me(H)}catch(Ce){throw new Error(`${S} could not be validated, ${Ce}`)}if(!ue){let Ce;switch(me.name){case"isValidLabelValue":case"isValidObjectName":Ce="a string that is sequences of [a-zA-Z0-9] separated by any of [-_.], at most 63 characters in total";break;case"isValidLabelKey":case"isValidApiVersion":case"isValidAnnotationKey":Ce="a valid prefix and/or suffix";break;case"isValidNamespace":case"isValidDnsLabel":Ce="a string that is sequences of [a-z0-9] separated by [-], at most 63 characters in total";break;case"isValidTag":Ce="a string that is sequences of [a-z0-9+#] separated by [-], at most 63 characters in total";break;case"isValidAnnotationValue":Ce="a string";break;case"isValidKind":Ce="a string that is a sequence of [a-zA-Z][a-z0-9A-Z], at most 63 characters in total";break;case"isValidUrl":Ce="a string that is a valid url";break;case"isValidString":case"isNonEmptyString":Ce="a non empty string";break;default:Ce=void 0;break}const ke=Ce?` expected ${Ce} but found "${H}".`:"";throw new Error(`"${S}" 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 Ke(S,H,me){return H===void 0||q(S,H,me)}q("apiVersion",P.apiVersion,this.validators.isValidApiVersion),q("kind",P.kind,this.validators.isValidKind),q("metadata.name",P.metadata.name,this.validators.isValidEntityName),Ke("metadata.namespace",P.metadata.namespace,this.validators.isValidNamespace);var U;for(const[S,H]of Object.entries((U=P.metadata.labels)!==null&&U!==void 0?U:[]))q(`labels.${S}`,S,this.validators.isValidLabelKey),q(`labels.${S}`,H,this.validators.isValidLabelValue);var Z;for(const[S,H]of Object.entries((Z=P.metadata.annotations)!==null&&Z!==void 0?Z:[]))q(`annotations.${S}`,S,this.validators.isValidAnnotationKey),q(`annotations.${S}`,H,this.validators.isValidAnnotationValue);var ce;const pe=(ce=P.metadata.tags)!==null&&ce!==void 0?ce:[];for(let S=0;S<pe.length;++S)q(`tags.${S}`,pe[S],this.validators.isValidTag);var be;const Be=(be=P.metadata.links)!==null&&be!==void 0?be:[];for(let S=0;S<Be.length;++S){var Oe,He,st;q(`links.${S}.url`,(Oe=Be[S])===null||Oe===void 0?void 0:Oe.url,CommonValidatorFunctions.isValidUrl),Ke(`links.${S}.title`,(He=Be[S])===null||He===void 0?void 0:He.title,CommonValidatorFunctions.isNonEmptyString),Ke(`links.${S}.icon`,(st=Be[S])===null||st===void 0?void 0:st.icon,KubernetesValidatorFunctions.isValidObjectName)}return P}constructor(P=makeValidator()){this.validators=P}}class Me{async enforce(P){if(!this.validate){const U=new Ajv({allowUnionTypes:!0});this.validate=U.addSchema([commonSchema,entityMetaSchema],void 0,void 0,!0).compile(entitySchema)}if(this.validate(P)===!0)return P;const[Ke]=this.validate.errors||[];throw Ke?new Error(`Malformed envelope, ${Ke.instancePath||"<root>"} ${Ke.message}`):new Error("Malformed envelope, Unknown error")}}function ze(ae){let P=ae.indexOf(":");const q=ae.indexOf("/");q!==-1&&q<P&&(P=-1);const Ke=P===-1?void 0:ae.slice(0,P),U=q===-1?void 0:ae.slice(P+1,q),Z=ae.slice(Math.max(P+1,q+1));if(Ke===""||U===""||Z==="")throw new TypeError(`Entity reference "${ae}" was not on the form [<kind>:][<namespace>/]<name>`);return{kind:Ke,namespace:U,name:Z}}function Qe(ae){return{kind:ae.kind,namespace:ae.metadata.namespace||h,name:ae.metadata.name}}function rt(ae,P){if(!ae)throw new Error("Entity reference must not be empty");const q=P==null?void 0:P.defaultKind,Ke=(P==null?void 0:P.defaultNamespace)||h;let U,Z,ce;if(typeof ae=="string"){const He=ze(ae);var pe;U=(pe=He.kind)!==null&&pe!==void 0?pe:q;var be;Z=(be=He.namespace)!==null&&be!==void 0?be:Ke,ce=He.name}else{var Be;U=(Be=ae.kind)!==null&&Be!==void 0?Be:q;var Oe;Z=(Oe=ae.namespace)!==null&&Oe!==void 0?Oe:Ke,ce=ae.name}if(U)if(Z){if(!ce){const He=JSON.stringify(ae);throw new Error(`Entity reference ${He} had missing or empty name`)}}else{const He=JSON.stringify(ae);throw new Error(`Entity reference ${He} had missing or empty namespace`)}else{const He=JSON.stringify(ae);throw new Error(`Entity reference ${He} had missing or empty kind (e.g. did not start with "component:" or similar)`)}return{kind:U,namespace:Z,name:ce}}function ct(ae){let P,q,Ke;if("metadata"in ae){P=ae.kind;var U;q=(U=ae.metadata.namespace)!==null&&U!==void 0?U:h,Ke=ae.metadata.name}else{P=ae.kind;var Z;q=(Z=ae.namespace)!==null&&Z!==void 0?Z:h,Ke=ae.name}return`${P.toLocaleLowerCase("en-US")}:${q.toLocaleLowerCase("en-US")}/${Ke.toLocaleLowerCase("en-US")}`}class lt{async enforce(P){let q=P;for(const Ke of this.policies){const U=await Ke.enforce(q);if(!U)throw new Error(`Policy ${Ke.constructor.name} did not return a result`);q=U}return q}constructor(P){this.policies=P}}class mt{async enforce(P){for(const q of this.policies){const Ke=await q.enforce(P);if(Ke)return Ke}throw new Error("The entity did not match any known policy")}constructor(P){this.policies=P}}const vt={allOf(ae){return new lt(ae)},oneOf(ae){return new mt(ae)}};var Ge=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 re(ae){let P;return{async check(q){return P||(P=Je(ae)),P(q)===q}}}const Re=re(Ge);var Pe=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 it=re(Pe);var yt=JSON.parse('{"$schema":"http://json-schema.org/draft-07/schema","$id":"DomainV1alpha1","description":"A Domain groups a collection of systems that share terminology, domain models, business purpose, or documentation, i.e. form a bounded context.","examples":[{"apiVersion":"backstage.io/v1alpha1","kind":"Domain","metadata":{"name":"artists","description":"Everything about artists"},"spec":{"owner":"artist-relations-team"}}],"allOf":[{"$ref":"Entity"},{"type":"object","required":["spec"],"properties":{"apiVersion":{"enum":["backstage.io/v1alpha1","backstage.io/v1beta1"]},"kind":{"enum":["Domain"]},"spec":{"type":"object","required":["owner"],"properties":{"owner":{"type":"string","description":"An entity reference to the owner of the component.","examples":["artist-relations-team","user:john.johnson"],"minLength":1}}}}}]}');const At=re(yt);var pt=JSON.parse(`{"$schema":"http://json-schema.org/draft-07/schema","$id":"GroupV1alpha1","description":"A group describes an organizational entity, such as for example a team, a business unit, or a loose collection of people in an interest group. Members of these groups are modeled in the catalog as kind User.","examples":[{"apiVersion":"backstage.io/v1alpha1","kind":"Group","metadata":{"name":"infrastructure","description":"The infra business unit"},"spec":{"type":"business-unit","profile":{"displayName":"Infrastructure","email":"infrastructure@example.com","picture":"https://example.com/groups/bu-infrastructure.jpeg"},"parent":"ops","children":["backstage","other"]}}],"allOf":[{"$ref":"Entity"},{"type":"object","required":["spec"],"properties":{"apiVersion":{"enum":["backstage.io/v1alpha1","backstage.io/v1beta1"]},"kind":{"enum":["Group"]},"spec":{"type":"object","required":["type","children"],"properties":{"type":{"type":"string","description":"The type of group. There is currently no enforced set of values for this field, so it is left up to the adopting organization to choose a nomenclature that matches their org hierarchy.","examples":["team","business-unit","product-area","root"],"minLength":1},"profile":{"type":"object","description":"Optional profile information about the group, mainly for display purposes. All fields of this structure are also optional. The email would be a group email of some form, that the group may wish to be used for contacting them. The picture is expected to be a URL pointing to an image that's representative of the group, and that a browser could fetch and render on a group page or similar.","properties":{"displayName":{"type":"string","description":"A simple display name to present to users.","examples":["Infrastructure"],"minLength":1},"email":{"type":"string","description":"An email where this entity can be reached.","examples":["infrastructure@example.com"],"minLength":1},"picture":{"type":"string","description":"The URL of an image that represents this entity.","examples":["https://example.com/groups/bu-infrastructure.jpeg"],"minLength":1}}},"parent":{"type":"string","description":"The immediate parent group in the hierarchy, if any. Not all groups must have a parent; the catalog supports multi-root hierarchies. Groups may however not have more than one parent. This field is an entity reference.","examples":["ops"],"minLength":1},"children":{"type":"array","description":"The immediate child groups of this group in the hierarchy (whose parent field points to this group). The list must be present, but may be empty if there are no child groups. The items are not guaranteed to be ordered in any particular way. The entries of this array are entity references.","items":{"type":"string","examples":["backstage","other"],"minLength":1}},"members":{"type":"array","description":"The users that are members of this group. The entries of this array are entity references.","items":{"type":"string","examples":["jdoe"],"minLength":1}}}}}}]}`);const Ct=re(pt);var Pt=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 kt=re(Pt),en="ownedBy",sn="ownerOf",Ht="consumesApi",Gt="apiConsumedBy",fn="providesApi",_t="apiProvidedBy",Zn="dependsOn",ln="dependencyOf",Dn="parentOf",gn="childOf",Jn="memberOf",Kt="hasMember",In="partOf",Nn="hasPart";var Yt=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 mn=re(Yt);var cn=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 Rn=re(cn);var Fn=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 Cn=re(Fn),ge="backstage.io/managed-by-location",te="backstage.io/managed-by-origin-location",Ee="backstage.io/source-location";function De(ae){if(typeof ae!="string")throw new TypeError(`Unable to parse location ref '${ae}', unexpected argument ${typeof ae}`);const P=ae.indexOf(":");if(P<0)throw new TypeError(`Unable to parse location ref '${ae}', expected '<type>:<target>', e.g. 'url:https://host/path'`);const q=ae.substring(0,P).trim(),Ke=ae.substring(P+1).trim();if(!q||!Ke)throw new TypeError(`Unable to parse location ref '${ae}', expected '<type>:<target>', e.g. 'url:https://host/path'`);if(q==="http"||q==="https")throw new TypeError(`Invalid location ref '${ae}', please prefix it with 'url:', e.g. 'url:${ae}'`);return{type:q,target:Ke}}function qe(ae){const{type:P,target:q}=ae;if(P){if(!q)throw new TypeError("Unable to stringify location ref, empty target")}else throw new TypeError("Unable to stringify location ref, empty type");return`${P}:${q}`}function xt(ae){var P,q,Ke,U,Z;const ce=(Z=(P=ae.metadata)===null||P===void 0||(q=P.annotations)===null||q===void 0?void 0:q[Ee])!==null&&Z!==void 0?Z:(Ke=ae.metadata)===null||Ke===void 0||(U=Ke.annotations)===null||U===void 0?void 0:U[ge];if(!ce)throw new Error(`Entity '${ct(ae)}' is missing location`);return De(ce)}},93414:function(jt,Fe,t){"use strict";t.d(Fe,{zx:function(){return We},Oi:function(){return vt},VY:function(){return Ti},yW:function(){return Ya},XF:function(){return Re},mn:function(){return De},NX:function(){return h},ub:function(){return Oe},mf:function(){return _a},yu:function(){return xn},h4:function(){return Ni},M6:function(){return Ln},i9:function(){return dl},aR:function(){return Ii},rJ:function(){return Ir},Oh:function(){return ml},hu:function(){return pl},rU:function(){return Ze},nU:function(){return pr},sk:function(){return Ne},Or:function(){return fs},T3:function(){return Fi},g9:function(){return xl},Ex:function(){return Zt},Gk:function(){return ir},tn:function(){return Ri},Ph:function(){return un},YE:function(){return O},v7:function(){return aa},R6:function(){return Ei},tR:function(){return Do},uw:function(){return ba},qt:function(){return vi},iA:function(){return Di},GB:function(){return Mn},po:function(){return cr},mZ:function(){return Ps},Pf:function(){return Fr}});var h={};t.r(h),t.d(h,{Nm:function(){return Pe},ht:function(){return At},LJ:function(){return yt}});var n=t(52322),g=t(2784),R=t(25248),V=t(19928);function x(e){const[s,i]=useState([]),u=useApi(alertApiRef),{anchorOrigin:p={vertical:"top",horizontal:"center"}}=e;if(useEffect(()=>{const B=u.alert$().subscribe(W=>i(F=>F.concat(W)));return()=>{B.unsubscribe()}},[u]),s.length===0)return null;const[v]=s,j=()=>{i(B=>B.filter(W=>W!==v))};return _jsx(Snackbar,{open:!0,anchorOrigin:p,children:_jsx(Alert,{action:_jsx(IconButton,{color:"inherit",size:"small",onClick:j,"data-testid":"error-button-close",children:_jsx(CloseIcon,{})}),severity:v.severity,children:_jsxs("span",{children:[v.message.toString(),s.length>1&&_jsx("em",{children:` (${s.length-1} older ${pluralize("message",s.length-1)})`})]})})})}var l=t(79692),I=t(12420);const ne=(0,l.Z)(e=>(0,I.Z)({avatar:{width:"4rem",height:"4rem",color:"#fff",fontWeight:e.typography.fontWeightBold,letterSpacing:"1px",textTransform:"uppercase"}}),{name:"BackstageAvatar"});function J(e){const{displayName:s,picture:i,customStyles:u}=e,p=ne();let v={...u};return i||(v={backgroundColor:stringToColor(s||""),...u}),_jsx(MaterialAvatar,{alt:s,src:i,className:p.avatar,style:v,children:s&&extractInitials(s)})}var Q=t(77277),D=t(72779),X=t.n(D),_=t(86689),he=t(62833),ie=t(76635),E=t(10289);function L(){const[e]=(0,E.is)((0,n.jsx)(E.AW,{index:!0,element:(0,n.jsx)("div",{})}));return!e.index}const $=(0,l.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"}),A=e=>/^([a-z+.-]+):/.test(e),T=()=>{try{return(0,R.h_)(R.Ds).getOptionalString("app.baseUrl")}catch{return}},ee=()=>{const e="http://dummy.dev";var s;const i=(s=T())!==null&&s!==void 0?s:"/",{pathname:u}=new URL(i,e);return(0,ie.trimEnd)(u,"/")},Ie=e=>{let s=String(e);const i=ee(),u=A(s),p=s.startsWith(i);return!u&&!p&&(s=i.concat(s)),s},Je=e=>{if(e instanceof Array)return e.map(Je).join(" ").trim();if(typeof e=="object"&&e){var s;return Je(e==null||(s=e.props)===null||s===void 0?void 0:s.children)}return["string","number"].includes(typeof e)?String(e):""},Ze=g.forwardRef(({onClick:e,noTrack:s,...i},u)=>{const p=$(),v=(0,R.z$)(),j=L()?Ie(i.to):i.to,B=Je(i.children)||j,W=A(j),F=W&&!!/^https?:/.exec(j),ve=oe=>{e==null||e(oe),s||v.captureEvent("click",B,{attributes:{to:j}})};return W?(0,n.jsxs)(_.Z,{...F?{target:"_blank",rel:"noopener"}:{},...i,ref:u,href:j,onClick:ve,className:X()(p.externalLink,i.className),children:[i.children,(0,n.jsx)("span",{className:p.visuallyHidden,children:", Opens in a new window"})]}):(0,n.jsx)(_.Z,{...i,ref:u,component:he.rU,to:j,onClick:ve})}),je=g.forwardRef((e,s)=>(0,n.jsx)(Ze,{ref:s,...e,color:"initial"})),We=g.forwardRef((e,s)=>(0,n.jsx)(Q.Z,{ref:s,component:je,...e}));var gt=t(60364),nt=t(61837),Me=t(80030),ze=t(19353),Qe=t(95074);function rt(e){const{text:s,tooltipDelay:i=1e3,tooltipText:u="Text copied to clipboard","aria-label":p="Copy text"}=e,v=(0,R.h_)(R.VE),[j,B]=(0,g.useState)(!1),[{error:W},F]=(0,Qe.Z)();(0,g.useEffect)(()=>{W&&v.post(W)},[W,v]);const ve=oe=>{oe.stopPropagation(),B(!0),F(s)};return(0,n.jsx)(n.Fragment,{children:(0,n.jsx)(Me.ZP,{id:"copy-test-tooltip",title:u,placement:"top",leaveDelay:i,onClose:()=>B(!1),open:j,children:(0,n.jsx)(nt.Z,{onClick:ve,"aria-label":p,children:(0,n.jsx)(ze.Z,{})})})})}var ct=t(83229),lt=t(26639),mt=t(39595);function vt(e){const{text:s,language:i,showLineNumbers:u=!1,highlightedNumbers:p,customStyle:v,showCopyCodeButton:j=!1}=e,B=(0,gt.Z)(),W=B.palette.type==="dark"?lt.Z:mt.Z,F=B.palette.type==="dark"?"#256bf3":"#e6ffed";return(0,n.jsxs)("div",{style:{position:"relative"},children:[(0,n.jsx)(ct.Z,{customStyle:v,language:i,style:W,showLineNumbers:u,wrapLines:!0,lineNumberStyle:{color:B.palette.textVerySubtle},lineProps:ve=>p!=null&&p.includes(ve)?{style:{backgroundColor:F}}:{},children:s}),j&&(0,n.jsx)("div",{style:{position:"absolute",top:0,right:0},children:(0,n.jsx)(rt,{text:s})})]})}var Ge=t(41156),re=t(88188);function Re(e){const{title:s,to:i}=e,u=(0,Ge.Z)(p=>p.breakpoints.down("xs"));return i?u?(0,n.jsx)(nt.Z,{component:he.rU,color:"primary",title:s,size:"small",to:i,children:(0,n.jsx)(re.Z,{})}):(0,n.jsx)(Q.Z,{component:he.rU,variant:"contained",color:"primary",to:i,children:s}):null}var Pe;(function(e){e.TOP_BOTTOM="TB",e.BOTTOM_TOP="BT",e.LEFT_RIGHT="LR",e.RIGHT_LEFT="RL"})(Pe||(Pe={}));var it;(function(e){e.UP_LEFT="UL",e.UP_RIGHT="UR",e.DOWN_LEFT="DL",e.DOWN_RIGHT="DR"})(it||(it={}));var yt;(function(e){e.NETWORK_SIMPLEX="network-simplex",e.TIGHT_TREE="tight-tree",e.LONGEST_PATH="longest-path"})(yt||(yt={}));var At;(function(e){e.LEFT="l",e.RIGHT="r",e.CENTER="c"})(At||(At={}));var pt=t(27397),Ct=t(11105),Pt=t(97963),kt=t(46506),en=t.n(kt),sn=t(54073),Ht=t.n(sn),Gt=t(10368);const fn=(0,l.Z)(e=>({node:{fill:e.palette.primary.light,stroke:e.palette.primary.light},text:{fill:e.palette.primary.contrastText}}),{name:"BackstageDependencyGraphDefaultNode"});function _t({node:{id:e}}){const s=fn(),[i,u]=g.useState(0),[p,v]=g.useState(0),j=g.useRef(null);g.useLayoutEffect(()=>{if(j.current){let{height:ve,width:oe}=j.current.getBBox();ve=Math.round(ve),oe=Math.round(oe),(ve!==p||oe!==i)&&(u(oe),v(ve))}},[i,p]);const B=10,W=i+B*2,F=p+B*2;return(0,n.jsxs)("g",{children:[(0,n.jsx)("rect",{className:s.node,width:W,height:F,rx:10}),(0,n.jsx)("text",{ref:j,className:s.text,y:F/2,x:W/2,textAnchor:"middle",alignmentBaseline:"middle",children:e})]})}const Zn="arrow-marker",ln="node",Dn="edge",gn="label",Jn=(0,Gt.Z)(e=>({node:{transition:`${e.transitions.duration.shortest}ms`}}),{name:"BackstageDependencyGraphNode"}),Kt=e=>(0,n.jsx)(_t,{...e});function In({render:e=Kt,setNode:s,node:i}){const{width:u,height:p,x:v=0,y:j=0}=i,B=i,W=Jn(),F=g.useRef(null);return g.useLayoutEffect(()=>{if(F.current){let{height:ve,width:oe}=F.current.getBBox();ve=Math.round(ve),oe=Math.round(oe),(ve!==p||oe!==u)&&s(i.id,{...i,height:ve,width:oe})}},[i,u,p,s]),(0,n.jsx)("g",{ref:F,"data-testid":ln,className:W.node,transform:`translate(${v-u/2},${j-p/2})`,children:e({node:B})})}var Nn=t(76985),Yt=t(27916),mn=t(19574),cn=t.n(mn);const Rn=(0,Gt.Z)(e=>({text:{fill:e.palette.textContrast}}),{name:"BackstageDependencyGraphDefaultLabel"});function Fn({edge:{label:e}}){const s=Rn();return(0,n.jsx)("text",{className:s.text,textAnchor:"middle",children:e})}const Cn=(0,Gt.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"}),ge=e=>(0,n.jsx)(Fn,{...e});function te({render:e=ge,setEdge:s,id:i,edge:u,curve:p}){const{x:v=0,y:j=0,width:B,height:W,points:F}=u,ve=u,oe=Cn(),xe=g.useRef(null);g.useLayoutEffect(()=>{if(xe.current){let{height:tt,width:Rt}=xe.current.getBBox();tt=Math.round(tt),Rt=Math.round(Rt),(tt!==W||Rt!==B)&&s(i,{...u,height:tt,width:Rt})}},[u,W,B,s,i]);let Te="";const Ye=g.useMemo(()=>Nn.Z().x(tt=>tt.x).y(tt=>tt.y).curve(Yt[p]),[p]);if(F){const tt=F.filter(Rt=>cn()(Rt.x)&&cn()(Rt.y));Te=Ye(tt)||""}return(0,n.jsxs)(n.Fragment,{children:[Te&&(0,n.jsx)("path",{"data-testid":Dn,className:oe.path,d:Te}),ve.label?(0,n.jsx)("g",{ref:xe,"data-testid":gn,className:oe.label,transform:`translate(${v},${j})`,children:e({edge:ve})}):null]})}const Ee="workspace";function De(e){var s,i;const{edges:u,nodes:p,renderNode:v,direction:j=Pe.TOP_BOTTOM,align:B,nodeMargin:W=50,edgeMargin:F=10,rankMargin:ve=50,paddingX:oe=0,paddingY:xe=0,acyclicer:Te,ranker:Ye=yt.NETWORK_SIMPLEX,labelPosition:tt=At.RIGHT,labelOffset:Rt=10,edgeRanks:zt=1,edgeWeight:Xt=1,renderLabel:qt,defs:Lt,zoom:Jt="enabled",curve:Vt="curveMonotoneX",fit:mr="grow",...vr}=e,yr=(0,Pt.Z)(),[xr,qo]=g.useState(100),[kr,_o]=g.useState(100),Wt=g.useRef(new(en()).graphlib.Graph),[ss,go]=g.useState(((s=Wt.current.graph())===null||s===void 0?void 0:s.width)||0),[Or,ei]=g.useState(((i=Wt.current.graph())===null||i===void 0?void 0:i.height)||0),[$n,hr]=g.useState([]),[Ur,Mr]=g.useState([]),nn=Math.max(ss,xr),pn=Math.max(Or,kr),os=Math.min(Or,kr),zr=mr==="grow"?pn:os,Bs=g.useMemo(()=>Ht()(an=>{if(!an)return;const Bn=Ct.Z(an),rn=Ct.Z(an.getElementById(Ee));function sr(){Bn.call(pt.sP().scaleExtent([1,10]).on("zoom",br=>{br.transform.x=Math.min(0,Math.max(br.transform.x,nn-nn*br.transform.k)),br.transform.y=Math.min(0,Math.max(br.transform.y,pn-pn*br.transform.k)),rn.attr("transform",br.transform)}))}Jt==="enabled"?sr():Jt==="enable-on-click"&&Bn.on("click",()=>sr());const{width:or,height:mo}=an.getBoundingClientRect();xr!==or&&qo(or),kr!==mo&&_o(mo)},100),[kr,xr,nn,pn,Jt]),Gi=g.useCallback(()=>{const an=Wt.current.nodes(),Bn=Wt.current.edges();an.forEach(rn=>{p.some(or=>or.id===rn)||Wt.current.removeNode(rn)}),Bn.forEach(rn=>{u.some(or=>or.from===rn.v&&or.to===rn.w)||Wt.current.removeEdge(rn.v,rn.w)}),p.forEach(rn=>{const sr=Wt.current.nodes().find(or=>rn.id===or);if(sr&&Wt.current.node(sr)){const{width:or,height:mo,x:br,y:Nl}=Wt.current.node(sr);Wt.current.setNode(sr,{...rn,width:or,height:mo,x:br,y:Nl})}else Wt.current.setNode(rn.id,{...rn,width:0,height:0})}),u.forEach(rn=>{Wt.current.setEdge(rn.from,rn.to,{...rn,label:rn.label,width:0,height:0,labelpos:tt,labeloffset:Rt,weight:Xt,minlen:zt})})},[u,p,tt,Rt,Xt,zt]),Zs=g.useMemo(()=>Ht()(()=>{en().layout(Wt.current);const{height:an,width:Bn}=Wt.current.graph(),rn=Math.max(0,an||0),sr=Math.max(0,Bn||0);go(sr),ei(rn),hr(Wt.current.nodes()),Mr(Wt.current.edges())},250,{leading:!0}),[]);g.useEffect(()=>(Wt.current.setGraph({rankdir:j,align:B,nodesep:W,edgesep:F,ranksep:ve,marginx:oe,marginy:xe,acyclicer:Te,ranker:Ye}),Gi(),Zs(),Zs.cancel),[Te,B,j,F,oe,xe,W,ve,Ye,Gi,Zs]);function Zl(an,Bn){return Wt.current.setNode(an,Bn),Zs(),Wt.current}function Dl(an,Bn){return Wt.current.setEdge(an,Bn),Zs(),Wt.current}return(0,n.jsxs)("svg",{ref:Bs,...vr,width:"100%",height:zr,viewBox:`0 0 ${nn} ${pn}`,children:[(0,n.jsxs)("defs",{children:[(0,n.jsx)("marker",{id:Zn,viewBox:"0 0 24 24",markerWidth:"14",markerHeight:"14",refX:"16",refY:"12",orient:"auto",markerUnits:"strokeWidth",children:(0,n.jsx)("path",{fill:yr.palette.textSubtle,d:"M8.59 16.59L13.17 12 8.59 7.41 10 6l6 6-6 6-1.41-1.41z"})}),Lt]}),(0,n.jsx)("g",{id:Ee,children:(0,n.jsxs)("svg",{width:ss,height:Or,y:pn/2-Or/2,x:nn/2-ss/2,viewBox:`0 0 ${ss} ${Or}`,children:[Ur.map(an=>{const Bn=Wt.current.edge(an);return Bn?(0,n.jsx)(te,{id:an,setEdge:Dl,render:qt,edge:Bn,curve:Vt},`${an.v}-${an.w}`):null}),$n.map(an=>{const Bn=Wt.current.node(an);return Bn?(0,n.jsx)(In,{setNode:Zl,render:v,node:Bn},an):null})]})})]})}var qe;const xt=(0,l.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:20},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:(qe=e.palette.banner.warning)!==null&&qe!==void 0?qe:e.palette.banner.error}}),{name:"BackstageDismissableBanner"}),ae=e=>{const{variant:s,message:i,id:u,fixed:p=!1}=e,v=xt(),B=useApi(storageApiRef).forBucket("notifications");var W;const F=(W=B.snapshot("dismissedBanners").value)!==null&&W!==void 0?W:[],[ve,oe]=useState(new Set(F)),xe=useObservable(B.observe$("dismissedBanners"));useEffect(()=>{if(xe!=null&&xe.value){var Ye;const tt=(Ye=xe==null?void 0:xe.value)!==null&&Ye!==void 0?Ye:[];oe(new Set(tt))}},[xe==null?void 0:xe.value]);const Te=()=>{B.set("dismissedBanners",[...ve,u])};return _jsx(Snackbar,{anchorOrigin:p?{vertical:"bottom",horizontal:"center"}:{vertical:"top",horizontal:"center"},open:!ve.has(u),classes:{root:classNames(v.root,!p&&v.topPosition)},children:_jsx(SnackbarContent,{classes:{root:classNames(v.content,v[s]),message:v.message},message:i,action:[_jsx(IconButton,{title:"Permanently dismiss this message",color:"inherit",onClick:Te,children:_jsx(Close,{className:v.icon})},"dismiss")]})})};var P=t(60905),q=t(90436),Ke=t.p+"static/missingAnnotation.67f79e98..svg",U=t.p+"static/noInformation.4b426325..svg",Z=t.p+"static/createComponent.975d1e1e..svg",ce=t.p+"static/noBuild.1715fa71..svg";const pe=(0,l.Z)({generalImg:{width:"95%",zIndex:2,position:"relative",left:"50%",top:"50%",transform:"translate(-50%, 15%)"}},{name:"BackstageEmptyStateImage"}),be=({missing:e})=>{const s=pe();switch(e){case"field":return(0,n.jsx)("img",{src:Ke,className:s.generalImg,alt:"annotation is missing"});case"info":return(0,n.jsx)("img",{src:U,alt:"no Information",className:s.generalImg});case"content":return(0,n.jsx)("img",{src:Z,alt:"create Component",className:s.generalImg});case"data":return(0,n.jsx)("img",{src:ce,alt:"no Build",className:s.generalImg});default:return null}},Be=(0,l.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 Oe(e){const{title:s,description:i,missing:u,action:p}=e,v=Be();return(0,n.jsxs)(P.Z,{container:!0,direction:"row",justifyContent:"space-around",alignItems:"flex-start",className:v.root,spacing:2,children:[(0,n.jsx)(P.Z,{item:!0,xs:12,md:6,children:(0,n.jsxs)(P.Z,{container:!0,direction:"column",children:[(0,n.jsx)(P.Z,{item:!0,xs:!0,children:(0,n.jsx)(q.Z,{variant:"h5",children:s})}),(0,n.jsx)(P.Z,{item:!0,xs:!0,children:(0,n.jsx)(q.Z,{variant:"body1",children:i})}),(0,n.jsx)(P.Z,{item:!0,xs:!0,className:v.action,children:p})]})}),(0,n.jsx)(P.Z,{item:!0,xs:12,md:6,className:v.imageContainer,children:typeof u=="string"?(0,n.jsx)(be,{missing:u}):u.customImage})]})}const He=`apiVersion: backstage.io/v1alpha1
2
- kind: Component
3
- metadata:
4
- name: example
5
- description: example.com
6
- annotations:
7
- ANNOTATION: value
8
- spec:
9
- type: website
10
- lifecycle: production
11
- owner: user:guest`,st=/^.*ANNOTATION.*$/m,S=He.match(st)[0],H=He.split(`
12
- `).findIndex(e=>st.test(e)),me=(0,l.Z)(e=>({code:{borderRadius:6,margin:`${e.spacing(2)}px 0px`,background:e.palette.type==="dark"?"#444":"#fff"}}),{name:"BackstageMissingAnnotationEmptyState"});function ue(e){return Array.from(Array(e+1).keys(),s=>s+H)}function Ce(e){const s=e.map(i=>S.replace("ANNOTATION",i)).join(`
13
- `);return He.replace(S,s)}function ke(e){const s=e.length<=1;return(0,n.jsxs)(n.Fragment,{children:["The ",s?"annotation":"annotations"," ",e.map(i=>(0,n.jsx)("code",{children:i})).reduce((i,u)=>(0,n.jsxs)(n.Fragment,{children:[i,", ",u]}))," ",s?"is":"are"," missing. You need to add the"," ",s?"annotation":"annotations"," to your component if you want to enable this tool."]})}function Ne(e){const{annotation:s,readMoreUrl:i}=e,u=Array.isArray(s)?s:[s],p=i||"https://backstage.io/docs/features/software-catalog/well-known-annotations",v=me();return(0,n.jsx)(Oe,{missing:"field",title:"Missing Annotation",description:ke(u),action:(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(q.Z,{variant:"body1",children:"Add the annotation to your component YAML as shown in the highlighted example below:"}),(0,n.jsx)("div",{className:v.code,children:(0,n.jsx)(vt,{text:Ce(u),language:"yaml",showLineNumbers:!0,highlightedNumbers:ue(u.length),customStyle:{background:"inherit",fontSize:"115%"}})}),(0,n.jsx)(Q.Z,{color:"primary",component:Ze,to:p,children:"Read more"})]})})}var ot=t(11776),ht=t(38402),ut=t(49378),et=t(41128),St=t(27616),at=t(8284),Tt=t(70660),Bt=t(91750),Nt=t(38016);const vn=(e,s)=>(s.palette.type==="light"?et._j:et.$n)(s.palette[e].light,.6),Gn=(e,s)=>(s.palette.type==="light"?et.$n:et._j)(s.palette[e].light,.9),wn=(0,l.Z)(e=>({root:{marginRight:e.spacing(1),fill:({severity:s})=>vn(s,e)}})),Ut=({severity:e})=>{const s=wn({severity:e});return(0,n.jsx)(Bt.Z,{classes:s})},Ft=({severity:e})=>{const s=wn({severity:e});return(0,n.jsx)(Nt.Z,{classes:s})},dn=(0,l.Z)(e=>({panel:{backgroundColor:({severity:s})=>Gn(s,e),color:({severity:s})=>vn(s,e),verticalAlign:"middle"},summary:{display:"flex",flexDirection:"row"},summaryText:{color:({severity:s})=>vn(s,e),fontWeight:"bold"},message:{width:"100%",display:"block",color:({severity:s})=>vn(s,e),backgroundColor:({severity:s})=>Gn(s,e)},details:{width:"100%",display:"block",color:e.palette.textContrast,backgroundColor:e.palette.background.default,border:`1px solid ${e.palette.border}`,padding:e.spacing(2),fontFamily:"sans-serif"}}),{name:"BackstageWarningPanel"}),yn=e=>e.charAt(0).toLocaleUpperCase("en-US")+e.slice(1);function Mn(e){const{severity:s="warning",title:i,message:u,children:p,defaultExpanded:v}=e,j=dn({severity:s}),B=yn(s)+(i?`: ${i}`:"");return(0,n.jsxs)(St.Z,{defaultExpanded:v!=null?v:!1,className:j.panel,role:"alert",children:[(0,n.jsxs)(at.Z,{expandIcon:(0,n.jsx)(Ft,{severity:s}),className:j.summary,children:[(0,n.jsx)(Ut,{severity:s}),(0,n.jsx)(q.Z,{className:j.summaryText,variant:"subtitle1",children:B})]}),(u||p)&&(0,n.jsx)(Tt.Z,{children:(0,n.jsxs)(P.Z,{container:!0,children:[u&&(0,n.jsx)(P.Z,{item:!0,xs:12,children:(0,n.jsx)(q.Z,{className:j.message,variant:"body1",children:u})}),p&&(0,n.jsx)(P.Z,{item:!0,xs:12,className:j.details,children:p})]})})]})}const jn=(0,l.Z)(e=>({text:{fontFamily:"monospace",whiteSpace:"pre",overflowX:"auto",marginRight:e.spacing(2)},divider:{margin:e.spacing(2)}}),{name:"BackstageErrorPanel"}),Un=({error:e,message:s,stack:i,children:u})=>{const p=jn();return(0,n.jsxs)(ot.Z,{dense:!0,children:[(0,n.jsxs)(ht.Z,{alignItems:"flex-start",children:[(0,n.jsx)(ut.Z,{classes:{secondary:p.text},primary:"Error",secondary:e}),(0,n.jsx)(rt,{text:e})]}),(0,n.jsxs)(ht.Z,{alignItems:"flex-start",children:[(0,n.jsx)(ut.Z,{classes:{secondary:p.text},primary:"Message",secondary:s}),(0,n.jsx)(rt,{text:s})]}),i&&(0,n.jsxs)(ht.Z,{alignItems:"flex-start",children:[(0,n.jsx)(ut.Z,{classes:{secondary:p.text},primary:"Stack Trace",secondary:i}),(0,n.jsx)(rt,{text:i})]}),u]})};function xn(e){const{title:s,error:i,defaultExpanded:u,children:p}=e;return(0,n.jsx)(Mn,{severity:"error",title:s!=null?s:i.message,defaultExpanded:u,children:(0,n.jsx)(Un,{error:i.name,message:i.message,stack:i.stack,children:p})})}var tn=t(85256);const En=(0,l.Z)(e=>({text:{fontFamily:"monospace",whiteSpace:"pre",overflowX:"auto",marginRight:e.spacing(2)},divider:{margin:e.spacing(2)}}),{name:"BackstageResponseErrorPanel"});function ir(e){var s;const{title:i,error:u,defaultExpanded:p}=e,v=En();if(u.name!=="ResponseError")return(0,n.jsx)(xn,{title:i!=null?i:u.message,defaultExpanded:p,error:u});const{body:j,cause:B}=u,{request:W,response:F}=j,ve=`${F.statusCode}: ${B.name}`,oe=W&&`${W.method} ${W.url}`,xe=B.message.replace(/\\n/g,`
14
- `),Te=(s=B.stack)===null||s===void 0?void 0:s.replace(/\\n/g,`
15
- `),Ye=JSON.stringify(j,void 0,2);return(0,n.jsxs)(xn,{title:i!=null?i:u.message,defaultExpanded:p,error:{name:ve,message:xe,stack:Te},children:[oe&&(0,n.jsxs)(ht.Z,{alignItems:"flex-start",children:[(0,n.jsx)(ut.Z,{classes:{secondary:v.text},primary:"Request",secondary:W?`${oe}`:void 0}),(0,n.jsx)(rt,{text:oe})]}),(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(tn.Z,{component:"li",className:v.divider}),(0,n.jsx)(ht.Z,{alignItems:"flex-start",children:(0,n.jsx)(ut.Z,{classes:{secondary:v.text},primary:"Full Error as JSON"})}),(0,n.jsx)(vt,{language:"json",text:Ye,showCopyCodeButton:!0})]})]})}var C=t(28316);function d(e){const s=document.createElement("div");return s.setAttribute("id",e),s}function m(e){document.body.insertBefore(e,document.body.lastElementChild.nextElementSibling)}function w(e){const s=useRef(null);useEffect(function(){const p=document.querySelector(`#${e}`),v=p||d(e);return p||m(v),v.appendChild(s.current),function(){s.current.remove(),v.childNodes.length===-1&&v.remove()}},[e]);function i(){return s.current||(s.current=document.createElement("div")),s.current}return i()}var Y=null;const fe="core.calloutSeen";function Se(){const[e,s]=useState(()=>{const u=localStorage.getItem(fe);return u?JSON.parse(u):{}}),i=useCallback((u,p)=>{const v=localStorage.getItem(fe),B={...v?JSON.parse(v):{},[u]:p};s(B),localStorage.setItem(fe,JSON.stringify(B))},[]);return{states:e,setState:i}}function $e(e){const{states:s,setState:i}=Se(),u=useCallback(()=>{i(e,!0)},[i,e]);return{seen:s[e]===!0,markSeen:u}}function ft(e){const{seen:s,markSeen:i}=$e(e);return{show:s===!1,hide:i}}const $t=(0,l.Z)({"@keyframes pulsateSlightly":{"0%":{transform:"scale(1.0)"},"100%":{transform:"scale(1.1)"}},"@keyframes pulsateAndFade":{"0%":{transform:"scale(1.0)",opacity:.9},"100%":{transform:"scale(1.5)",opacity:0}},featureWrapper:{position:"relative"},backdrop:{zIndex:2e3,position:"fixed",overflow:"hidden",left:0,right:0,top:0,bottom:0},dot:{position:"absolute",backgroundColor:"transparent",borderRadius:"100%",border:"1px solid rgba(103, 146, 180, 0.98)",boxShadow:"0px 0px 0px 20000px rgba(0, 0, 0, 0.5)",zIndex:2001,transformOrigin:"center center",animation:"$pulsateSlightly 1744ms 1.2s cubic-bezier(0.4, 0, 0.2, 1) alternate infinite"},pulseCircle:{width:"100%",height:"100%",backgroundColor:"transparent",borderRadius:"100%",border:"2px solid white",zIndex:2001,transformOrigin:"center center",animation:"$pulsateAndFade 872ms 1.2s cubic-bezier(0.4, 0, 0.2, 1) infinite"},text:{position:"absolute",color:"white",zIndex:2003}},{name:"BackstageFeatureCalloutCircular"});function on(e){const{featureId:s,title:i,description:u,children:p}=e,{show:v,hide:j}=useShowCallout(s),B=usePortal("core.callout"),W=useRef(null),[F,ve]=useState(),oe=$t(),xe=useCallback(()=>{if(W.current){const Te=W.current.getBoundingClientRect(),Ye=Math.max(Te.width,Te.height),tt=800,Rt=Te.x-(Ye-Te.width)/2-tt,zt=Te.y-(Ye-Te.height)/2-tt,Xt=Ye+2*tt,qt=450,Lt=Te.x+Te.width/2-qt,Jt=Te.y-(Ye-Te.height)/2+Ye+20;ve({dotLeft:Rt,dotTop:zt,dotSize:Xt,borderWidth:tt,textTop:Jt,textLeft:Lt,textWidth:qt})}},[]);return useEffect(()=>(window.addEventListener("resize",xe),window.addEventListener("scroll",xe),()=>{window.removeEventListener("resize",xe),window.removeEventListener("scroll",xe)}),[xe]),useLayoutEffect(xe,[W.current,xe]),v?_jsxs(_Fragment,{children:[_jsx("div",{className:oe.featureWrapper,ref:W,children:p}),createPortal(_jsx("div",{className:oe.backdrop,children:_jsx(ClickAwayListener,{onClickAway:j,children:_jsxs(_Fragment,{children:[_jsx("div",{className:oe.dot,"data-testid":"dot",style:{left:F==null?void 0:F.dotLeft,top:F==null?void 0:F.dotTop,width:F==null?void 0:F.dotSize,height:F==null?void 0:F.dotSize,borderWidth:F==null?void 0:F.borderWidth},onClick:j,onKeyDown:j,role:"button",tabIndex:0,children:_jsx("div",{className:oe.pulseCircle})}),_jsxs("div",{className:oe.text,"data-testid":"text",style:{left:F==null?void 0:F.textLeft,top:F==null?void 0:F.textTop,width:F==null?void 0:F.textWidth},children:[_jsx(Typography,{variant:"h2",paragraph:!0,children:i}),_jsx(Typography,{children:u})]})]})})}),B)]}):_jsx(_Fragment,{children:p})}var zn=t(35292);const $r=(0,l.Z)(e=>({link:{display:"grid",justifyItems:"center",gridGap:4,textAlign:"center"},disabled:{color:e.palette.text.secondary,cursor:"default"},primary:{color:e.palette.primary.main},secondary:{color:e.palette.secondary.main},label:{fontSize:"0.7rem",textTransform:"uppercase",fontWeight:600,letterSpacing:1.2}}),{name:"BackstageIconLinkVertical"});function is({color:e="primary",disabled:s=!1,href:i="#",icon:u=(0,n.jsx)(zn.Z,{}),label:p,onClick:v,title:j}){const B=$r();return s?(0,n.jsxs)("div",{title:j,className:X()(B.link,B.disabled),children:[u,(0,n.jsx)("span",{className:B.label,children:p})]}):(0,n.jsxs)(Ze,{title:j,className:X()(B.link,B[e]),to:i,onClick:v,children:[u,(0,n.jsx)("span",{className:B.label,children:p})]})}const nr=(0,l.Z)(e=>({links:{margin:e.spacing(2,0),display:"grid",gridAutoFlow:"column",gridAutoColumns:"min-content",gridGap:e.spacing(3)}}),{name:"BackstageHeaderIconLinkRow"});function Ln(e){const{links:s}=e,i=nr();return(0,n.jsx)("nav",{className:i.links,children:s.map((u,p)=>(0,n.jsx)(is,{...u},p+1))})}const ar=e=>{const s=e==="dark"?"16%":"97%";return`
16
- hsl(0, 0%, ${s}) 0%,
17
- hsla(0, 0%, ${s}, 0.987) 8.1%,
18
- hsla(0, 0%, ${s}, 0.951) 15.5%,
19
- hsla(0, 0%, ${s}, 0.896) 22.5%,
20
- hsla(0, 0%, ${s}, 0.825) 29%,
21
- hsla(0, 0%, ${s}, 0.741) 35.3%,
22
- hsla(0, 0%, ${s}, 0.648) 41.2%,
23
- hsla(0, 0%, ${s}, 0.55) 47.1%,
24
- hsla(0, 0%, ${s}, 0.45) 52.9%,
25
- hsla(0, 0%, ${s}, 0.352) 58.8%,
26
- hsla(0, 0%, ${s}, 0.259) 64.7%,
27
- hsla(0, 0%, ${s}, 0.175) 71%,
28
- hsla(0, 0%, ${s}, 0.104) 77.5%,
29
- hsla(0, 0%, ${s}, 0.049) 84.5%,
30
- hsla(0, 0%, ${s}, 0.013) 91.9%,
31
- hsla(0, 0%, ${s}, 0) 100%
32
- `},Sr=100,Cr=10,as=(0,l.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:Sr,height:`calc(100% + ${Cr}px)`,transition:"opacity 300ms",pointerEvents:"none"},fadeLeft:{left:-Cr,background:`linear-gradient(90deg, ${ar(e.palette.type)})`},fadeRight:{right:-Cr,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 wr(e){const[[s,i],u]=React.useState([0,0]);return React.useLayoutEffect(()=>{const p=e.current;if(!p){u([0,0]);return}const v=()=>{const j=p.scrollLeft,B=p.scrollWidth-p.offsetWidth-p.scrollLeft;u([j,B])};return v(),p.addEventListener("scroll",v),window.addEventListener("resize",v),()=>{p.removeEventListener("scroll",v),window.removeEventListener("resize",v)}},[e]),[s,i]}function Br(e,s,i){const[u,p]=React.useState(0);return React.useLayoutEffect(()=>{if(u===0)return;const v=performance.now(),j=requestAnimationFrame(B=>{if(!e.current)return;const W=B-v,F=Math.abs(u)*W/s,oe=Math.max(i,F)*Math.sign(u);e.current.scrollBy({left:oe});const xe=u-oe;Math.sign(u)!==Math.sign(xe)?p(0):p(xe)});return()=>cancelAnimationFrame(j)},[e,u,s,i]),p}function Ds(e){const{scrollStep:s=100,scrollSpeed:i=50,minScrollDistance:u=5,children:p,...v}=e,j=as(e),B=React.useRef(),[W,F]=wr(B),ve=Br(B,i,u),oe=xe=>{!B.current||ve(xe?s:-s)};return _jsxs("div",{...v,className:j.root,children:[_jsx(Grid,{container:!0,direction:"row",wrap:"nowrap",className:j.container,ref:B,children:p}),_jsx("div",{className:classNames(j.fade,j.fadeLeft,{[j.fadeHidden]:W===0})}),_jsx("div",{className:classNames(j.fade,j.fadeRight,{[j.fadeHidden]:F===0})}),W>0&&_jsx(IconButton,{title:"Scroll Left",onClick:()=>oe(!1),className:classNames(j.button,j.buttonLeft,{}),children:_jsx(ChevronLeftIcon,{})}),F>0&&_jsx(IconButton,{title:"Scroll Right",onClick:()=>oe(!0),className:classNames(j.button,j.buttonRight,{}),children:_jsx(ChevronRightIcon,{})})]})}const Zr=(0,l.Z)({alpha:{color:"#ffffff",fontFamily:"serif",fontWeight:"normal",fontStyle:"italic"},beta:{color:"#4d65cc",fontFamily:"serif",fontWeight:"normal",fontStyle:"italic"}},{name:"BackstageLifecycle"});function Qn(e){const s=Zr(e),{shorthand:i,alpha:u}=e;return i?_jsx("span",{className:s[u?"alpha":"beta"],style:{fontSize:"120%"},children:u?_jsx(_Fragment,{children:"\u03B1"}):_jsx(_Fragment,{children:"\u03B2"})}):_jsx("span",{className:s[u?"alpha":"beta"],children:u?"Alpha":"Beta"})}const jr=(0,g.lazy)(()=>Promise.all([t.e(5869),t.e(6051)]).then(t.bind(t,76051)).then(e=>({default:e.RealLogViewer})));function pr(e){const{Progress:s}=(0,R.qD)().getComponents();return(0,n.jsx)(g.Suspense,{fallback:(0,n.jsx)(s,{}),children:(0,n.jsx)(jr,{...e})})}const Vr=(0,l.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"}),Er=(e,s)=>s?typeof s=="string"?e+s:g.Children.toArray(s.props.children).reduce(Er,e):e,Pn=({level:e,children:s})=>{const p=g.Children.toArray(s).reduce(Er,"").toLocaleLowerCase("en-US").replace(/\W/g,"-");return g.createElement(`h${e}`,{id:p},s)},ls={code:({inline:e,className:s,children:i,...u})=>{const p=String(i).replace(/\n+$/,""),v=/language-(\w+)/.exec(s||"");return!e&&v?(0,n.jsx)(vt,{language:v[1],text:p}):(0,n.jsx)("code",{className:s,...u,children:i})},h1:Pn,h2:Pn,h3:Pn,h4:Pn,h5:Pn,h6:Pn};function Ar(e){const{content:s,dialect:i="gfm",linkTarget:u,transformLinkUri:p,transformImageUri:v,className:j}=e,B=Vr();return _jsx(ReactMarkdown,{remarkPlugins:i==="gfm"?[gfm]:[],className:`${B.markdown} ${j}`,children:s,components:ls,linkTarget:u,transformLinkUri:p,transformImageUri:v})}var Tr=t(23054);const Wr=(0,l.Z)(e=>({root:{paddingLeft:e.spacing(3)}}),{name:"BackstageLoginRequestListItem"}),cs=({request:e,busy:s,setBusy:i})=>{const u=Wr(),[p,v]=useState(),j=async()=>{i(!0);try{await e.trigger()}catch(W){v(isError(W)?W.message:"An unspecified error occurred")}finally{i(!1)}},B=e.provider.icon;return _jsxs(ListItem,{disabled:s,classes:{root:u.root},children:[_jsx(ListItemAvatar,{children:_jsx(B,{fontSize:"large"})}),_jsx(ListItemText,{primary:e.provider.title,secondary:p&&_jsx(Typography,{color:"error",children:p})}),_jsx(Button,{color:"primary",variant:"contained",onClick:j,children:"Log in"})]})};var ds=null;const us=(0,l.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 Ns(e){const s=us(),[i,u]=useState(!1),p=useApi(oauthRequestApiRef),v=useObservable(useMemo(()=>p.authRequest$(),[p]),[]),j=()=>{v.forEach(B=>B.reject())};return _jsxs(Dialog,{open:Boolean(v.length),fullWidth:!0,maxWidth:"xs",classes:{paper:s.dialog},"aria-labelledby":"oauth-req-dialog-title",children:[_jsxs("main",{children:[_jsx(DialogTitle,{classes:{root:s.title},id:"oauth-req-dialog-title",children:_jsx(Typography,{className:s.titleHeading,variant:"h1",children:"Login Required"})}),_jsx(DialogContent,{dividers:!0,classes:{root:s.contentList},children:_jsx(List,{children:v.map(B=>_jsx(LoginRequestListItem,{request:B,busy:i,setBusy:u},B.provider.title))})})]}),_jsx(DialogActions,{classes:{root:s.actionButtons},children:_jsx(Button,{onClick:j,children:"Reject All"})})]})}var hs=t(15277),Hr=t.n(hs),ps=t(29862);const Gr=(0,l.Z)({container:{overflow:"visible !important"}},{name:"BackstageOverflowTooltip"});function fs(e){const[s,i]=(0,g.useState)(!1),u=(0,ps.t)(),p=Gr(),v=B=>{u()&&i(B)};var j;return(0,n.jsx)(Me.ZP,{title:(j=e.title)!==null&&j!==void 0?j:e.text||"",placement:e.placement,disableHoverListener:!s,children:(0,n.jsx)(Hr(),{text:e.text,line:e.line,onToggled:v,containerClassName:p.container})})}var Kr=t(67358);function Zt(e){const[s,i]=(0,g.useState)(!1);return(0,g.useEffect)(()=>{const u=setTimeout(()=>i(!0),250);return()=>clearTimeout(u)},[]),s?(0,n.jsx)(Kr.Z,{...e,"data-testid":"progress"}):(0,n.jsx)("div",{style:{display:"none"}})}var fr=t(94339),Yr=t(14503),gs=t(24579),Jr=t(32552),bn=t(15459),Xn=t(95544),ms=t(27597);const vs=(0,l.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 ys(e){const{link:s,title:i,onClick:u}=e,p=vs();return(0,n.jsxs)("div",{children:[(0,n.jsx)(tn.Z,{}),(0,n.jsx)(Ze,{to:s,onClick:u,underline:"none",children:(0,n.jsxs)(Xn.Z,{display:"flex",alignItems:"center",className:p.root,children:[(0,n.jsx)(Xn.Z,{className:p.boxTitle,fontWeight:"fontWeightBold",m:1,children:(0,n.jsx)(q.Z,{children:(0,n.jsx)("strong",{children:i})})}),(0,n.jsx)(ms.Z,{className:p.arrow})]})})]})}const xs=e=>{const{slackChannel:s}=e;if(s){if(typeof s=="string")return(0,n.jsxs)(n.Fragment,{children:["Please contact ",s," for help."]});if(!s.href)return(0,n.jsxs)(n.Fragment,{children:["Please contact ",s.name," for help."]})}else return null;return(0,n.jsx)(We,{to:s.href,variant:"contained",children:s.name})},bs=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,n.jsx)(xn,{title:"Something Went Wrong",error:u,children:(0,n.jsx)(xs,{slackChannel:s})}):i}constructor(s){super(s),this.state={error:void 0,errorInfo:void 0}}},Ss=(0,l.Z)(e=>({noPadding:{padding:0,"&:last-child":{paddingBottom:0}},header:{padding:e.spacing(2,2,2,2.5)},headerTitle:{fontWeight:700},headerSubheader:{paddingTop:e.spacing(1)},headerAvatar:{},headerAction:{},headerContent:{},subheader:{display:"flex"}}),{name:"BackstageInfoCard"}),Cs=(0,bn.Z)(e=>({root:{display:"inline-block",padding:e.spacing(8,8,0,0),float:"right"}}),{name:"BackstageInfoCardCardActionsTopRight"})(Yr.Z),Qr={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 Ir(e){const{title:s,subheader:i,divider:u=!0,deepLink:p,slackChannel:v,errorBoundaryProps:j,variant:B,children:W,headerStyle:F,headerProps:ve,icon:oe,action:xe,actionsClassName:Te,actions:Ye,cardClassName:tt,actionsTopRight:Rt,className:zt,noPadding:Xt,titleTypographyProps:qt}=e,Lt=Ss();let Jt={},Vt={};B&&B.split(/[\s]+/g).forEach(xr=>{Jt={...Jt,...Qr.card[xr]},Vt={...Vt,...Qr.cardContent[xr]}});const mr=()=>(0,n.jsxs)("div",{className:Lt.headerSubheader,children:[i&&(0,n.jsx)("div",{className:Lt.subheader,children:i}),oe]}),vr=j||(v?{slackChannel:v}:{});return(0,n.jsx)(fr.Z,{style:Jt,className:zt,children:(0,n.jsxs)(bs,{...vr,children:[s&&(0,n.jsx)(Jr.Z,{classes:{root:Lt.header,title:Lt.headerTitle,subheader:Lt.headerSubheader,avatar:Lt.headerAvatar,action:Lt.headerAction,content:Lt.headerContent},title:s,subheader:mr(),action:xe,style:{...F},titleTypographyProps:qt,...ve}),Rt&&(0,n.jsx)(Cs,{children:Rt}),u&&(0,n.jsx)(tn.Z,{}),(0,n.jsx)(gs.Z,{className:X()(tt,{[Lt.noPadding]:Xt}),style:Vt,children:W}),Ye&&(0,n.jsx)(Yr.Z,{className:Te,children:Ye}),p&&(0,n.jsx)(ys,{...p})]})})}var Fs=t(39307);const ws=(0,l.Z)(e=>({root:{position:"relative",lineHeight:0},overlay:{position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -60%)",fontSize:45,fontWeight:"bold",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"}),Xr={fractional:!0,inverse:!1,unit:"%",max:100},Us=({palette:e,value:s,inverse:i,max:u})=>{if(isNaN(s))return"#ddd";const p=u||Xr.max,v=i?p-s:s;return v<p/3?e.status.error:v<p*(2/3)?e.status.warning:e.status.ok};function y(e){const[s,i]=useState(null),{getColor:u=Us}=e,p=ws(e),{palette:v}=useTheme(),{value:j,fractional:B,inverse:W,unit:F,max:ve,description:oe}={...Xr,...e},xe=B?Math.round(j*ve):j,Te=ve!==100?Math.round(j):xe,[Ye,tt]=useState(!1);return useEffect(()=>{const Rt=s,zt=()=>tt(!0),Xt=()=>tt(!1);return Rt&&oe?(Rt.addEventListener("mouseenter",zt),Rt.addEventListener("mouseleave",Xt),()=>{Rt.removeEventListener("mouseenter",zt),Rt.removeEventListener("mouseleave",Xt)}):()=>{tt(!1)}},[oe,s]),_jsxs("div",{ref:i,className:p.root,children:[_jsx(Circle,{strokeLinecap:"butt",percent:xe,strokeWidth:12,trailWidth:12,strokeColor:u({palette:v,value:Te,inverse:W,max:ve}),className:p.circle}),oe&&Ye?_jsx("div",{className:p.description,children:oe}):_jsx("div",{className:p.overlay,children:isNaN(j)?"N/A":`${Te}${F}`})]})}const b=(0,l.Z)({root:{height:"100%",width:250}},{name:"BackstageGaugeCard"});function k(e){const s=b(e),{title:i,subheader:u,progress:p,inverse:v,deepLink:j,description:B,icon:W,variant:F,getColor:ve}=e,oe={inverse:v,description:B,getColor:ve,value:p};return _jsx("div",{className:s.root,children:_jsx(InfoCard,{title:i,subheader:u,deepLink:j,variant:F,icon:W,children:_jsx(Gauge,{...oe})})})}function N(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 v=i({palette:u,value:p,inverse:!1,max:100});return _jsx(Tooltip,{title:`${p}%`,children:_jsx("span",{children:_jsx(Line,{percent:p,strokeWidth:4,trailWidth:4,strokeColor:v})})})}var G=t(21324),K=t(7089),de=t(1292),le=t(42494),ye=t(74603),we=t(56939),Le=t(12231),Ae=t(73698),Xe=t(72379);const bt=(0,l.Z)(()=>(0,I.Z)({icon:{position:"absolute",right:"4px",pointerEvents:"none"}}),{name:"BackstageClosedDropdown"});var _e=()=>{const e=bt();return(0,n.jsx)(Xe.Z,{className:e.icon,fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,n.jsx)("path",{d:"M7.5 8L6 9.5L12.0703 15.5703L18.1406 9.5L16.6406 8L12.0703 12.5703L7.5 8Z",fill:"#616161"})})};const Ot=(0,l.Z)(()=>(0,I.Z)({icon:{position:"absolute",right:"4px",pointerEvents:"none"}}),{name:"BackstageOpenedDropdown"});var qn=()=>{const e=Ot();return(0,n.jsx)(Xe.Z,{className:e.icon,fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,n.jsx)("path",{d:"M16.5 16L18 14.5L11.9297 8.42969L5.85938 14.5L7.35938 16L11.9297 11.4297L16.5 16Z",fill:"#616161"})})};const Vn=(0,bn.Z)(e=>(0,I.Z)({root:{"label + &":{marginTop:e.spacing(3)}},input:{borderRadius:4,position:"relative",backgroundColor:e.palette.background.paper,border:"1px solid #ced4da",fontSize:16,padding:"10px 26px 10px 12px",transition:e.transitions.create(["border-color","box-shadow"]),fontFamily:"Helvetica Neue","&:focus":{background:e.palette.background.paper,borderRadius:4}}}),{name:"BackstageSelectInputBase"})(ye.Z),lr=(0,l.Z)(e=>(0,I.Z)({formControl:{margin:`${e.spacing(1)} 0px`,maxWidth:300},label:{transform:"initial",fontWeight:"bold",fontSize:14,fontFamily:e.typography.fontFamily,color:e.palette.text.primary,"&.Mui-focused":{color:e.palette.text.primary}},formLabel:{transform:"initial",fontWeight:"bold",fontSize:14,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 un(e){const{multiple:s,items:i,label:u,placeholder:p,selected:v,onChange:j,triggerReset:B,native:W=!1,disabled:F=!1,margin:ve}=e,oe=lr(),[xe,Te]=(0,g.useState)(v||(s?[]:"")),[Ye,tt]=(0,g.useState)(!1);(0,g.useEffect)(()=>{Te(s?[]:"")},[B,s]),(0,g.useEffect)(()=>{v!==void 0&&Te(v)},[v]);const Rt=Lt=>{Te(Lt.target.value),j(Lt.target.value)},zt=Lt=>{if(F){Lt.preventDefault();return}tt(Jt=>s&&!(Lt.target instanceof HTMLElement)?!0:!Jt)},Xt=()=>{tt(!1)},qt=Lt=>()=>{const Jt=xe.filter(Vt=>Vt!==Lt);Te(Jt),j(Jt)};return(0,n.jsx)("div",{className:oe.root,children:(0,n.jsx)(de.Z,{onClickAway:Xt,children:(0,n.jsxs)(le.Z,{className:oe.formControl,children:[(0,n.jsx)(we.Z,{className:oe.formLabel,children:u}),(0,n.jsxs)(Ae.Z,{"aria-label":u,value:xe,native:W,disabled:F,"data-testid":"select",displayEmpty:!0,multiple:s,margin:ve,onChange:Rt,onClick:zt,open:Ye,input:(0,n.jsx)(Vn,{}),label:u,tabIndex:0,renderValue:Lt=>{var Jt;return s&&xe.length!==0?(0,n.jsx)("div",{className:oe.chips,children:Lt.map(Vt=>{var mr,vr;return(0,n.jsx)(K.Z,{label:(mr=i.find(yr=>yr.value===Vt))===null||mr===void 0?void 0:mr.label,clickable:!0,onDelete:qt(Vt),className:oe.chip},(vr=i.find(yr=>yr.value===Vt))===null||vr===void 0?void 0:vr.value)})}):(0,n.jsx)(q.Z,{children:xe.length===0?p||"":(Jt=i.find(Vt=>Vt.value===Lt))===null||Jt===void 0?void 0:Jt.label})},IconComponent:()=>Ye?(0,n.jsx)(qn,{}):(0,n.jsx)(_e,{}),MenuProps:{anchorOrigin:{vertical:"bottom",horizontal:"left"},transformOrigin:{vertical:"top",horizontal:"left"},getContentAnchorEl:null},children:[p&&!s&&(0,n.jsx)(Le.Z,{value:[],children:p}),W?i&&i.map(Lt=>(0,n.jsx)("option",{value:Lt.value,children:Lt.label},Lt.value)):i&&i.map(Lt=>(0,n.jsxs)(Le.Z,{value:Lt.value,children:[s&&(0,n.jsx)(G.Z,{color:"primary",checked:xe.includes(Lt.value)||!1,className:oe.checkbox}),Lt.label]},Lt.value))]})]})})})}const Sn=()=>{},kn=g.createContext({stepperLength:0,stepIndex:0,setStepIndex:Sn,stepHistory:[],setStepHistory:Sn,onStepChange:Sn});function Rr(e){const{children:s,elevated:i,onStepChange:u,activeStep:p=0}=e,[v,j]=useState(p),[B,W]=useState([0]);useEffect(()=>{j(p)},[p]);const F=[];let ve;return Children.forEach(s,oe=>{isValidElement(oe)&&(oe.props.end?ve=oe:F.push(oe))}),_jsxs(_Fragment,{children:[_jsx(kn.Provider,{value:{stepIndex:v,setStepIndex:j,stepHistory:B,setStepHistory:W,onStepChange:u,stepperLength:Children.count(s)},children:_jsx(MuiStepper,{activeStep:v,orientation:"vertical",elevation:i?2:0,children:F})}),v>=Children.count(s)-1&&ve]})}const Lr=(0,l.Z)(e=>({root:{marginTop:e.spacing(3),"& button":{marginRight:e.spacing(1)}}}),{name:"BackstageSimpleStepperFooter"}),Dr=({text:e,handleClick:s})=>_jsx(Button,{onClick:s,children:e||"Reset"}),hn=({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")}),An=({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"}),gr=({text:e,handleClick:s,disabled:i,stepIndex:u})=>_jsx(Button,{onClick:s,"data-testid":`backButton-${u}`,disabled:i,children:e||"Back"}),ti=({actions:e={},children:s})=>{const i=Lr(),{stepperLength:u,stepIndex:p,setStepIndex:v,stepHistory:j,setStepHistory:B,onStepChange:W}=useContext(VerticalStepperContext),F=(Te,Ye)=>{Ye&&Ye(),W&&W(p,Te),v(Te)},ve=()=>{const Te=e.nextStep?e.nextStep(p,u-1):p+1;F(Te,e.onNext),B([...j,Te])},oe=()=>{j.pop(),F(j[j.length-1],e.onBack),B([...j])},xe=()=>{F(0,e.onRestart),B([0])};return _jsxs("div",{className:i.root,children:[[void 0,!0].includes(e.showBack)&&p!==0&&_jsx(gr,{text:e.backText,handleClick:oe,disabled:p===0,stepIndex:p}),e.showSkip&&_jsx(An,{text:e.skipText,handleClick:ve,disabled:!!u&&p>=u||!!e.canSkip&&!e.canSkip(),stepIndex:p}),[void 0,!0].includes(e.showNext)&&_jsx(hn,{text:e.nextText,handleClick:ve,disabled:!!u&&p>=u||!!e.canNext&&!e.canNext(),stepIndex:p}),e.showRestart&&p!==0&&_jsx(Dr,{text:e.restartText,handleClick:xe,stepIndex:p}),s]})},ni=(0,l.Z)(e=>({end:{padding:e.spacing(3)}}),{name:"SimpleStepperStep"});function Ki(e){const{title:s,children:i,end:u,actions:p,...v}=e,j=ni();return u?_jsxs("div",{className:j.end,children:[_jsx(Typography,{variant:"h6",children:s}),i,_jsx(SimpleStepperFooter,{actions:{...p||{},showNext:!1}})]}):_jsxs(MuiStep,{...v,children:[_jsx(StepLabel,{children:_jsx(Typography,{variant:"h6",children:s})}),_jsxs(StepContent,{children:[i,_jsx(SimpleStepperFooter,{actions:p})]})]})}const Kn=(0,l.Z)(e=>({status:{fontWeight:500,"&::before":{width:"0.7em",height:"0.7em",display:"inline-block",marginRight:8,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 Yi(e){const s=Kn(e);return _jsx("span",{className:classNames(s.status,s.ok),"aria-label":"Status ok","aria-hidden":"true",...e})}function ri(e){const s=Kn(e);return _jsx("span",{className:classNames(s.status,s.warning),"aria-label":"Status warning","aria-hidden":"true",...e})}function Ji(e){const s=Kn(e);return _jsx("span",{className:classNames(s.status,s.error),"aria-label":"Status error","aria-hidden":"true",...e})}function Qi(e){const s=Kn(e);return _jsx("span",{className:classNames(s.status,s.pending),"aria-label":"Status pending","aria-hidden":"true",...e})}function On(e){const s=Kn(e);return _jsx("span",{className:classNames(s.status,s.running),"aria-label":"Status running","aria-hidden":"true",...e})}function Ms(e){const s=Kn(e);return _jsx("span",{className:classNames(s.status,s.aborted),"aria-label":"Status aborted","aria-hidden":"true",...e})}var si=t(74600),Nr=t(15584);const qr=e=>(0,I.Z)({root:{fontWeight:"bolder",whiteSpace:"nowrap",paddingRight:e.spacing(4),border:"0",verticalAlign:"top"}}),_r={root:{border:"0",verticalAlign:"top"}},vo=e=>(0,I.Z)({root:{listStyle:"none",margin:e.spacing(0,0,-1,0),padding:"0"}}),zs=e=>(0,I.Z)({root:{padding:e.spacing(0,0,1,0)},random:{}}),yo=(0,bn.Z)(qr,{name:"BackstageMetadataTableTitleCell"})(Nr.Z),xo=(0,bn.Z)(_r,{name:"BackstageMetadataTableCell"})(Nr.Z),oi=({dense:e,children:s})=>_jsx(Table,{size:e?"small":"medium",children:_jsx(TableBody,{children:s})}),ii=({title:e,children:s,...i})=>_jsxs(TableRow,{children:[e&&_jsx(yo,{children:e}),_jsx(xo,{colSpan:e?1:2,...i,children:s})]}),Vs=(0,bn.Z)(vo,{name:"BackstageMetadataTableList"})(({classes:e,children:s})=>(0,n.jsx)("ul",{className:e.root,children:s})),Pr=(0,bn.Z)(zs,{name:"BackstageMetadataTableListItem"})(({classes:e,children:s})=>(0,n.jsx)("li",{className:e.root,children:s})),es=(0,I.Z)({root:{margin:"0 0",listStyleType:"none"}}),bo=e=>(0,I.Z)({root:{...es.root,paddingLeft:e.spacing(1)}}),Ws=(0,bn.Z)(es,{name:"BackstageStructuredMetadataTableList"})(({classes:e,children:s})=>(0,n.jsx)(Vs,{classes:e,children:s})),js=(0,bn.Z)(bo,{name:"BackstageStructuredMetadataTableNestedList"})(({classes:e,children:s})=>(0,n.jsx)(Vs,{classes:e,children:s}));function So(e,s){const i=e.map((u,p)=>_jsx(MetadataListItem,{children:Es(u)},p));return s?_jsx(js,{children:i}):_jsx(Ws,{children:i})}function Co(e,s,i){const u=Object.keys(e).map(p=>{const v=Es(e[p],!0),j=i&&i.titleFormat?i.titleFormat(p):startCase(p);return _jsxs(MetadataListItem,{children:[`${j}: `,v]},p)});return s?_jsx(js,{children:u}):_jsx(Ws,{children:u})}function Es(e,s,i){return React.isValidElement(e)?_jsx(Fragment,{children:e}):typeof e=="object"&&!Array.isArray(e)?Co(e,s,i):Array.isArray(e)?So(e,i):typeof e=="boolean"?_jsx(Fragment,{children:e?"\u2705":"\u274C"}):_jsx(Fragment,{children:e})}const wo=({value:e,options:s})=>_jsx(Fragment,{children:Es(e,s)}),ai=({title:e,value:s,options:i})=>_jsx(MetadataTableItem,{title:i&&i.titleFormat?i.titleFormat(e):startCase(e),children:_jsx(wo,{value:s,options:i})});function jo(e,s){return Object.keys(e).map(i=>_jsx(ai,{title:i,value:e[i],options:s},i))}function li(e){const{metadata:s,dense:i=!0,options:u}=e,p=jo(s,u||{});return _jsx(MetadataTable,{dense:i,children:p})}var Eo=t(49429),Ao=t(86136),As=t(79784),Ts=t(19126),Hs=t.n(Ts);function To(e){return qs.stringify(e,{strictNullHandling:!0})}function Gs(e){return qs.parse(e,{ignoreQueryPrefix:!0,strictNullHandling:!0})}function Ks(e,s){return Gs(e)[s]}function ci(e,s,i){const u={...Gs(e),[s]:i};return To(u)}function Xi(e,s=250){const[i,u]=useSearchParams(),p=i.toString(),[v,j]=useState(Ks(p,e));return useEffect(()=>{const B=Ks(p,e);j(W=>isEqual(B,W)?W:B)},[p,j,e]),useDebouncedEffect(()=>{const B=ci(p,e,v);p!==B&&u(B,{replace:!0})},[u,v,p,e],s),[v,j]}const ts={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 Io(){const s=(0,R.I_)().get(R.Ds),i=s==null?void 0:s.getOptionalConfig("app.support");if(!i)return ts;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(v=>({url:v.getString("url"),title:v.getString("title")}))}))}}var di=t(80079);function Yn(e,s){const u=(0,R.qD)().getSystemIcon(e);return u?(0,n.jsx)(u,{...s}):(0,n.jsx)(di.Z,{...s})}function ui(e){return Yn("brokenImage",e)}function Ro(e){return Yn("catalog",e)}function qi(e){return Yn("chat",e)}function _i(e){return Yn("dashboard",e)}function Lo(e){return Yn("docs",e)}function Po(e){return Yn("email",e)}function hi(e){return Yn("github",e)}function pi(e){return Yn("group",e)}function Is(e){return Yn("help",e)}function ea(e){return Yn("user",e)}function ta(e){return Yn("warning",e)}const Wn=(0,l.Z)({popoverList:{minWidth:260,maxWidth:400}},{name:"BackstageSupportButton"}),fi=({icon:e})=>{const s=(0,R.qD)();var i;const u=e&&(i=s.getSystemIcon(e))!==null&&i!==void 0?i:Is;return(0,n.jsx)(u,{})};var Rs;const gi=({link:e})=>(0,n.jsx)(Ze,{to:e.url,children:(Rs=e.title)!==null&&Rs!==void 0?Rs:e.url}),mi=({item:e})=>{var s;return(0,n.jsxs)(ht.Z,{children:[(0,n.jsx)(Ao.Z,{children:(0,n.jsx)(fi,{icon:e.icon})}),(0,n.jsx)(ut.Z,{primary:e.title,secondary:(s=e.links)===null||s===void 0?void 0:s.reduce((i,u,p)=>[...i,p>0&&(0,n.jsx)("br",{},p),(0,n.jsx)(gi,{link:u},u.url)],[])})]})};function vi(e){const{title:s,items:i,children:u}=e,{items:p}=Io(),[v,j]=(0,g.useState)(!1),[B,W]=(0,g.useState)(null),F=Wn(),ve=(0,Ge.Z)(Te=>Te.breakpoints.down("sm")),oe=Te=>{W(Te.currentTarget),j(!0)},xe=()=>{j(!1)};return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(Xn.Z,{display:"flex",ml:1,children:ve?(0,n.jsx)(nt.Z,{color:"primary",size:"small",onClick:oe,"data-testid":"support-button",children:(0,n.jsx)(Is,{})}):(0,n.jsx)(Q.Z,{"data-testid":"support-button","aria-label":"support",color:"primary",onClick:oe,startIcon:(0,n.jsx)(Is,{}),children:"Support"})}),(0,n.jsxs)(As.ZP,{"data-testid":"support-button-popover",open:v,anchorEl:B,anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"},onClose:xe,children:[(0,n.jsxs)(ot.Z,{className:F.popoverList,children:[s&&(0,n.jsx)(ht.Z,{alignItems:"flex-start",children:(0,n.jsx)(q.Z,{variant:"subtitle1",children:s})}),g.Children.map(u,(Te,Ye)=>(0,n.jsx)(ht.Z,{alignItems:"flex-start",children:Te},`child-${Ye}`)),(i!=null?i:p).map((Te,Ye)=>(0,n.jsx)(mi,{item:Te},`item-${Ye}`))]}),(0,n.jsx)(Eo.Z,{children:(0,n.jsx)(Q.Z,{color:"primary",onClick:xe,children:"Close"})})]})]})}var Ys=t(18671);const Ls=72,ko=24,Oo=18,cr={drawerWidthClosed:Ls,drawerWidthOpen:224,defaultOpenDelayMs:100,defaultCloseDelayMs:0,defaultFadeDuration:200,logoHeight:32,iconContainerWidth:Ls,iconSize:Ls-ko*2,iconPadding:ko,selectedIndicatorWidth:3,userBadgePadding:Oo,userBadgeDiameter:Ls-Oo*2,mobileSidebarHeight:56},yi=e=>({...cr,...e,iconContainerWidth:cr.drawerWidthClosed,iconSize:cr.drawerWidthClosed-cr.iconPadding*2,userBadgeDiameter:cr.drawerWidthClosed-cr.userBadgePadding*2}),$o={drawerWidthClosed:0,drawerWidthOpen:202,defaultOpenDelayMs:cr.defaultOpenDelayMs+200},Js=e=>({...$o,...e}),xi="@backstage/core/sidebar-intro-dismissed",_n=(0,g.createContext)({sidebarConfig:cr,submenuConfig:$o}),Qs=(0,g.createContext)({isHoveredOn:!1,setIsHoveredOn:()=>{}});var ns;(function(e){e.SIDEBAR_PIN_STATE="sidebarPinState"})(ns||(ns={}));const Xs={getSidebarPinState(){let e;try{e=JSON.parse(window.localStorage.getItem(ns.SIDEBAR_PIN_STATE)||"true")}catch{return!0}return!!e},setSidebarPinState(e){return window.localStorage.setItem(ns.SIDEBAR_PIN_STATE,JSON.stringify(e))}};var rs=t(51837);const _s={isPinned:!0,toggleSidebarPinState:()=>{},isMobile:!1},eo=(0,g.createContext)(_s),to=(0,rs.CT)("sidebar-pin-state-context");function bi(e){const{children:s,value:i}=e;return(0,n.jsx)(eo.Provider,{value:i,children:(0,n.jsx)(to.Provider,{value:(0,rs.EI)({1:i}),children:s})})}const Fr=()=>{const e=(0,g.useContext)(to),s=(0,g.useContext)(eo);if(e===void 0)return s||_s;const i=e.atVersion(1);if(i===void 0)throw new Error("No context found for version 1.");return i},Bo=(0,l.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"}),Zo=(0,g.createContext)({content:{contentRef:void 0}});function Do(e){const[s,i]=(0,g.useState)(()=>Xs.getSidebarPinState()),{sidebarConfig:u}=(0,g.useContext)(_n),p=(0,g.useRef)(null),v=(0,g.useMemo)(()=>({content:{contentRef:p}}),[p]);(0,g.useEffect)(()=>{Xs.setSidebarPinState(s)},[s]);const j=(0,Ge.Z)(F=>F.breakpoints.down("xs"),{noSsr:!0}),B=()=>i(!s),W=Bo({isPinned:s,sidebarConfig:u});return(0,n.jsx)(bi,{value:{isPinned:s,toggleSidebarPinState:B,isMobile:j},children:(0,n.jsx)(Zo.Provider,{value:v,children:(0,n.jsx)("div",{className:W.root,children:e.children})})})}function no(){const{content:e}=(0,g.useContext)(Zo);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 ro={isOpen:!1,setOpen:()=>{}},so=(0,g.createContext)(ro),oo=(0,rs.CT)("sidebar-open-state-context");function io(e){const{children:s,value:i}=e;return(0,n.jsx)(so.Provider,{value:i,children:(0,n.jsx)(oo.Provider,{value:(0,rs.EI)({1:i}),children:s})})}const Ps=()=>{const e=(0,g.useContext)(oo),s=(0,g.useContext)(so);if(e===void 0)return s||ro;const i=e.atVersion(1);if(i===void 0)throw new Error("No context found for version 1.");return i};var No=t(50023),er=t(4190),Fo=t(87685),Uo=t(44882),Mo=t(57998);const ao=(0,l.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"}})),zo=e=>{const{to:s,label:i,icon:u,value:p}=e,{sidebarConfig:v}=(0,g.useContext)(_n),j=ao({sidebarConfig:v}),B=(0,E.TH)(),{selectedMenuItemIndex:W,setSelectedMenuItemIndex:F}=(0,g.useContext)(a),ve=(xe,Te)=>{F(Te===W?-1:Te)},oe=p===W&&W>=0||p!==W&&!(W>=0)&&s===B.pathname;return(0,n.jsx)(Mo.Z,{label:i,icon:u,component:Ze,to:s||B.pathname,onChange:ve,value:p,selected:oe,classes:j})},lo=e=>{const{children:s,to:i,label:u,icon:p,value:v}=e,{isMobile:j}=Fr();return j?(0,n.jsx)(zo,{to:i,label:u,icon:p,value:v}):(0,n.jsx)(n.Fragment,{children:s})},co=(0,l.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`})})),Vo=e=>(0,ie.orderBy)(e,({props:{priority:s}})=>Number.isInteger(s)?s:-1,"desc"),Si=g.createElement(lo).type,Wo=({children:e,label:s="Menu",open:i,onClose:u})=>{const{sidebarConfig:p}=(0,g.useContext)(_n),v=co({sidebarConfig:p});return(0,n.jsxs)(er.ZP,{anchor:"bottom",open:i,onClose:u,ModalProps:{BackdropProps:{classes:{root:v.marginMobileSidebar}}},classes:{root:v.marginMobileSidebar,paperAnchorBottom:v.overlay},children:[(0,n.jsxs)(Xn.Z,{className:v.overlayHeader,children:[(0,n.jsx)(q.Z,{variant:"h3",children:s}),(0,n.jsx)(nt.Z,{onClick:u,classes:{root:v.overlayHeaderClose},children:(0,n.jsx)(Fo.Z,{})})]}),(0,n.jsx)(Xn.Z,{component:"nav",children:e})]})},a=(0,g.createContext)({selectedMenuItemIndex:-1,setSelectedMenuItemIndex:()=>{}}),r=e=>{const{sidebarConfig:s}=(0,g.useContext)(_n),{children:i}=e,u=co({sidebarConfig:s}),p=(0,E.TH)(),[v,j]=(0,g.useState)(-1);(0,g.useEffect)(()=>{j(-1)},[p.pathname]);let B=(0,R.vJ)(i,F=>F.getElements().filter(ve=>ve.type===Si));if(i)B.length?B=Vo(B):B.push((0,n.jsx)(lo,{icon:(0,n.jsx)(Uo.Z,{}),children:i},"default_menu"));else return null;const W=v>=0&&!B[v].props.to;return(0,n.jsx)(io,{value:{isOpen:!0,setOpen:()=>{}},children:(0,n.jsxs)(a.Provider,{value:{selectedMenuItemIndex:v,setSelectedMenuItemIndex:j},children:[(0,n.jsx)(Wo,{label:B[v]&&B[v].props.label,open:W,onClose:()=>j(-1),children:B[v]&&B[v].props.children}),(0,n.jsx)(No.Z,{className:u.root,"data-testid":"mobile-sidebar-root",component:"nav",children:B})]})})},o=(0,l.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"}}),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 c;(function(e){e[e.Closed=0]="Closed",e[e.Idle=1]="Idle",e[e.Open=2]="Open"})(c||(c={}));const f=e=>{const{sidebarConfig:s}=(0,g.useContext)(_n),{openDelayMs:i=s.defaultOpenDelayMs,closeDelayMs:u=s.defaultCloseDelayMs,disableExpandOnHover:p,children:v}=e,j=o({sidebarConfig:s}),B=(0,Ge.Z)(zt=>zt.breakpoints.down("md"),{noSsr:!0}),[W,F]=(0,g.useState)(c.Closed),ve=(0,g.useRef)(),{isPinned:oe,toggleSidebarPinState:xe}=Fr(),Te=()=>{oe||p||(ve.current&&(clearTimeout(ve.current),ve.current=void 0),W!==c.Open&&!B&&(ve.current=window.setTimeout(()=>{ve.current=void 0,F(c.Open)},i),F(c.Idle)))},Ye=()=>{oe||p||(ve.current&&(clearTimeout(ve.current),ve.current=void 0),W===c.Idle?F(c.Closed):W===c.Open&&(ve.current=window.setTimeout(()=>{ve.current=void 0,F(c.Closed)},u)))},tt=W===c.Open&&!B||oe,Rt=zt=>{zt?(F(c.Open),xe()):(F(c.Closed),xe())};return(0,n.jsxs)("nav",{style:{},"aria-label":"sidebar nav",children:[(0,n.jsx)(M,{}),(0,n.jsx)(io,{value:{isOpen:tt,setOpen:Rt},children:(0,n.jsx)("div",{className:j.root,"data-testid":"sidebar-root",onMouseEnter:p?()=>{}:Te,onFocus:p?()=>{}:Te,onMouseLeave:p?()=>{}:Ye,onBlur:p?()=>{}:Ye,children:(0,n.jsx)("div",{className:X()(j.drawer,{[j.drawerOpen]:tt}),children:v})})})]})},O=e=>{var s;const i=yi((s=e.sidebarOptions)!==null&&s!==void 0?s:{});var u;const p=Js((u=e.submenuOptions)!==null&&u!==void 0?u:{}),{children:v,disableExpandOnHover:j,openDelayMs:B,closeDelayMs:W}=e,{isMobile:F}=Fr();return F?(0,n.jsx)(r,{children:v}):(0,n.jsx)(_n.Provider,{value:{sidebarConfig:i,submenuConfig:p},children:(0,n.jsx)(f,{openDelayMs:B,closeDelayMs:W,disableExpandOnHover:j,children:v})})};function M(){const{sidebarConfig:e}=(0,g.useContext)(_n),{focusContent:s,contentRef:i}=no(),u=o({sidebarConfig:e});return i!=null&&i.current?(0,n.jsx)(Q.Z,{onClick:s,variant:"contained",className:X()(u.visuallyHidden),children:"Skip to content"}):null}function z(e,s){const i=new URLSearchParams(s.search).toString(),u=Hs().parse(i),p=new URLSearchParams(e.search).toString(),v=Hs().parse(p);return(0,ie.isEqual)(s.pathname,e.pathname)&&(0,ie.isMatch)(v,u)}const se=(0,l.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:20,cursor:"pointer",position:"relative",background:"none",border:"none"},itemContainer:{width:"100%"},selected:{background:"#6f6f6f",color:"#FFF"},label:{margin:14,marginLeft:7,fontSize:14,whiteSpace:"nowrap",overflow:"hidden","text-overflow":"ellipsis",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:"14px",whiteSpace:"nowrap",overflow:"hidden","text-overflow":"ellipsis"}}),{name:"BackstageSidebarSubmenuItem"}),Ve=e=>{const{title:s,subtitle:i,to:u,icon:p,dropdownItems:v}=e,j=se(),{setIsHoveredOn:B}=useContext(SidebarItemWithSubmenuContext),W=()=>{B(!1)},F=useResolvedPath(u!=null?u:""),ve=useLocation();let oe=isLocationMatch(ve,F);const[xe,Te]=useState(!1),Ye=()=>{Te(!xe)};return v!==void 0?(v.some(tt=>{const Rt=resolvePath(tt.to);return oe=isLocationMatch(ve,Rt),oe}),_jsxs("div",{className:j.itemContainer,children:[_jsx(Tooltip,{title:s,enterDelay:500,enterNextDelay:500,children:_jsxs("button",{onClick:Ye,onTouchStart:tt=>tt.stopPropagation(),className:classnames(j.item,oe?j.selected:void 0),children:[p&&_jsx(p,{fontSize:"small"}),_jsxs(Typography,{variant:"subtitle1",className:j.label,children:[s,_jsx("br",{}),i&&_jsx(Typography,{variant:"caption",className:j.subtitle,children:i})]}),xe?_jsx(ArrowDropUpIcon,{className:j.dropdownArrow}):_jsx(ArrowDropDownIcon,{className:j.dropdownArrow})]})}),v&&xe&&_jsx("div",{className:j.dropdown,children:v.map((tt,Rt)=>_jsx(Tooltip,{title:tt.title,enterDelay:500,enterNextDelay:500,children:_jsx(Link,{to:tt.to,underline:"none",className:j.dropdownItem,onClick:W,onTouchStart:zt=>zt.stopPropagation(),children:_jsx(Typography,{className:j.textContent,children:tt.title})})},Rt))})]})):_jsx("div",{className:j.itemContainer,children:_jsx(Tooltip,{title:s,enterDelay:500,enterNextDelay:500,children:_jsxs(Link,{to:u,underline:"none",className:classnames(j.item,oe?j.selected:void 0),onClick:W,onTouchStart:tt=>tt.stopPropagation(),children:[p&&_jsx(p,{fontSize:"small"}),_jsxs(Typography,{variant:"subtitle1",className:j.label,children:[s,_jsx("br",{}),i&&_jsx(Typography,{variant:"caption",className:j.subtitle,children:i})]})]})})})};var Ue;const wt=(0,l.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:(Ue=(i=e.palette.navigation.submenu)===null||i===void 0?void 0:i.background)!==null&&Ue!==void 0?Ue:"#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:24,fontWeight:500,color:"#FFF",padding:20,[e.breakpoints.down("xs")]:{display:"none"}}}),{name:"BackstageSidebarSubmenu"}),dt=e=>{const{isOpen:s}=Ps(),{sidebarConfig:i,submenuConfig:u}=(0,g.useContext)(_n),p=s?i.drawerWidthOpen:i.drawerWidthClosed,v=wt({left:p,submenuConfig:u}),{isHoveredOn:j}=(0,g.useContext)(Qs),[B,W]=(0,g.useState)(!1);return(0,g.useEffect)(()=>{W(j)},[j]),(0,n.jsxs)("div",{className:X()(v.drawer,{[v.drawerOpen]:B}),children:[(0,n.jsx)(q.Z,{variant:"h5",className:v.title,children:e.title}),e.children]})};var It=t(76600),Dt=t(26739),Mt=t(98989),Tn=t(59797),rr=t(83543);const tr=(0,l.Z)({iconContainer:{display:"flex",position:"relative",width:"100%"},arrow1:{right:"6px",position:"absolute"}}),dr=()=>{const e=tr();return _jsxs("div",{className:e.iconContainer,children:[_jsx("div",{className:e.arrow1,children:_jsx(ArrowBackIosIcon,{style:{fontSize:"12px"}})}),_jsx("div",{children:_jsx(ArrowBackIosIcon,{style:{fontSize:"12px"}})})]})};var ks=null;const Ho=(0,l.Z)({iconContainer:{display:"flex",position:"relative",width:"100%"},arrow1:{right:"6px",position:"absolute"}}),Ci=()=>{const e=Ho();return _jsxs("div",{className:e.iconContainer,children:[_jsx("div",{className:e.arrow1,children:_jsx(ArrowForwardIosIcon,{style:{fontSize:"12px"}})}),_jsx("div",{children:_jsx(ArrowForwardIosIcon,{style:{fontSize:"12px"}})})]})};var uo=null,Os,ur;const na=e=>(0,l.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:(Os=(i=s.palette.navigation.navItem)===null||i===void 0?void 0:i.hoverBackground)!==null&&Os!==void 0?Os:"#404040"}},highlighted:{background:(ur=(u=s.palette.navigation.navItem)===null||u===void 0?void 0:u.hoverBackground)!==null&&ur!==void 0?ur:"#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"},searchRoot:{marginBottom:12},searchField:{color:"#b5b5b5",fontWeight:"bold",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 ho(e){return(0,g.useMemo)(()=>na(e),[e])()}const ra=(e,s)=>(0,R.vJ)(e.props.children,i=>{let u=!1;return i.getElements().forEach(({props:{to:p,dropdownItems:v}})=>{if(!u){if(v!=null&&v.length){v.forEach(({to:j})=>u=u||z(s,(0,E.i3)(j)));return}p&&(u=z(s,(0,E.i3)(p)))}}),u},[s.pathname]);function wi(e){return e.to===void 0}const sa=g.createElement(dt).type,oa=g.forwardRef(function({to:s,end:i,style:u,className:p,activeStyle:v,caseSensitive:j,activeClassName:B="active","aria-current":W="page",...F},ve){let{pathname:oe}=(0,E.TH)(),{pathname:xe}=(0,E.WU)(s);j||(oe=oe.toLocaleLowerCase("en-US"),xe=xe.toLocaleLowerCase("en-US"));let Te=oe===xe;!Te&&!i&&(Te=oe.startsWith(`${xe}/`));const Ye=Te?W:void 0;return(0,n.jsx)(he.rU,{...F,to:s,ref:ve,"aria-current":Ye,style:{...u,...Te?v:void 0},className:X()([p,Te?B:void 0])})}),ji=(0,g.forwardRef)((e,s)=>{const{icon:i,text:u,hasNotifications:p=!1,hasSubmenu:v=!1,disableHighlight:j=!1,onClick:B,children:W,className:F,...ve}=e,{sidebarConfig:oe}=(0,g.useContext)(_n),xe=ho(oe),{isOpen:Te}=Ps(),Ye=!Te&&v?{display:"flex",marginLeft:"24px"}:{},tt=(0,n.jsxs)("div",{style:Ye,children:[(0,n.jsx)(i,{fontSize:"small"}),!Te&&v?(0,n.jsx)(Mt.Z,{}):(0,n.jsx)(n.Fragment,{})]}),Rt=(0,n.jsx)(Dt.Z,{color:"secondary",variant:"dot",overlap:"circular",invisible:!p,className:X()({[xe.closedItemIcon]:!Te}),children:tt}),zt=(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("div",{"data-testid":"login-button",className:xe.iconContainer,children:Rt}),u&&(0,n.jsx)(q.Z,{variant:"subtitle2",className:xe.label,children:u}),(0,n.jsx)("div",{className:xe.secondaryAction,children:W})]}),Xt=Te?zt:Rt,qt={onClick:B,className:X()(F,xe.root,Te?xe.open:xe.closed,wi(e)&&xe.buttonItem,{[xe.highlightable]:!j})};return wi(e)?(0,n.jsx)("button",{"aria-label":u,...qt,ref:s,children:Xt}):(0,n.jsx)(oa,{...qt,activeClassName:xe.selected,to:e.to?e.to:"",ref:s,"aria-label":u||e.to,...ve,children:Xt})}),ia=({children:e,...s})=>{const{sidebarConfig:i}=(0,g.useContext)(_n),u=ho(i),[p,v]=(0,g.useState)(!1),j=(0,E.TH)(),B=ra(e,j),W=(0,Ge.Z)(xe=>xe.breakpoints.down("sm")),F=()=>{v(!0)},ve=()=>{v(!1)},oe=()=>W?p?(0,n.jsx)(Tn.Z,{fontSize:"small",className:u.submenuArrow}):(0,n.jsx)(rr.Z,{fontSize:"small",className:u.submenuArrow}):!p&&(0,n.jsx)(Mt.Z,{fontSize:"small",className:u.submenuArrow});return(0,n.jsx)(Qs.Provider,{value:{isHoveredOn:p,setIsHoveredOn:v},children:(0,n.jsxs)("div",{"data-testid":"item-with-submenu",onMouseLeave:ve,onTouchStart:p?ve:F,onMouseEnter:F,className:X()(p&&u.highlighted),children:[(0,n.jsx)(ji,{hasSubmenu:!0,className:B?u.selected:"",...s,children:oe()}),p&&e]})})},Ei=(0,g.forwardRef)((e,s)=>{const[i]=(0,R.vJ)(e.children,u=>u.getElements().filter(p=>p.type===sa));return i?(0,n.jsx)(ia,{...e,children:i}):(0,n.jsx)(ji,{...e,ref:s})});function Fl(e){const{sidebarConfig:s}=useContext(SidebarConfigContext),[i,u]=useState(""),p=ho(s),v=e.icon?e.icon:SearchIcon,j=()=>{e.onSearch(i),u("")},B=oe=>{oe.key==="Enter"&&(oe.preventDefault(),j())},W=oe=>{u(oe.target.value)},F=oe=>{oe.preventDefault(),oe.stopPropagation()},ve=oe=>{j(),oe.preventDefault()};return _jsx("div",{className:p.searchRoot,children:_jsx(Ei,{icon:v,to:e.to,onClick:ve,disableHighlight:!0,children:_jsx(TextField,{placeholder:"Search",value:i,onClick:F,onChange:W,onKeyDown:B,className:p.searchContainer,InputProps:{disableUnderline:!0,className:p.searchField},inputProps:{className:p.searchFieldHTMLInput}})})})}const Ul=(0,It.Z)("div")({flex:1},{name:"BackstageSidebarSpace"}),Ml=(0,It.Z)("div")({height:8},{name:"BackstageSidebarSpacer"}),aa=(0,It.Z)("hr")({height:1,width:"100%",background:"#383838",border:"none",margin:"12px 0px"},{name:"BackstageSidebarDivider"}),la=e=>({overflowY:"auto","&::-webkit-scrollbar":{backgroundColor:e.palette.background.default,width:"5px",borderRadius:"5px"},"&::-webkit-scrollbar-thumb":{backgroundColor:e.palette.text.hint,borderRadius:"5px"}}),zl=(0,It.Z)("div")(({theme:e})=>{const s=la(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=ho(e),{isOpen:i,setOpen:u}=useSidebarOpenState();if(useMediaQuery(j=>j.breakpoints.down("md"),{noSsr:!0}))return null;const v=()=>{u(!i)};return _jsx("button",{onClick:v,className:s.expandButton,"aria-label":"Expand Sidebar","data-testid":"sidebar-expand-button",children:_jsx("div",{className:s.arrows,children:i?_jsx(DoubleArrowLeft,{}):_jsx(DoubleArrowRight,{})})})},ca=(0,l.Z)(e=>({introCard:s=>({color:"#b5b5b5",fontSize:12,width:s.sidebarConfig.drawerWidthOpen,marginTop:18,marginBottom:12,paddingLeft:s.sidebarConfig.iconPadding,paddingRight:s.sidebarConfig.iconPadding}),introDismiss:{display:"flex",justifyContent:"flex-end",alignItems:"center",marginTop:12},introDismissLink:{color:"#dddddd",display:"flex",alignItems:"center",marginBottom:4,"&: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:12}}),{name:"BackstageSidebarIntro"});function da(e){const{sidebarConfig:s}=useContext(SidebarConfigContext),i=ca({sidebarConfig:s}),{text:u,onClose:p}=e,v=()=>p();return _jsxs("div",{className:i.introCard,children:[_jsx(Typography,{variant:"subtitle2",children:u}),_jsx("div",{className:i.introDismiss,children:_jsxs(IconButton,{onClick:v,className:i.introDismissLink,children:[_jsx(CloseIcon,{className:i.introDismissIcon}),_jsx(Typography,{component:"span",className:i.introDismissText,children:"Dismiss"})]})})]})}const Ai=e=>{const{text:s,onDismiss:i}=e,[u,p]=useState(!1),v=()=>{p(!0)};return _jsx(Collapse,{in:!u,onExited:i,children:_jsx(da,{text:s,onClose:v})})},ua=null,ha="And your recently viewed plugins will pop up here!";function Wl(e){const{isOpen:s}=useSidebarOpenState(),i={starredItemsDismissed:!1,recentlyViewedItemsDismissed:!1},[u,p]=useLocalStorageValue(SIDEBAR_INTRO_LOCAL_STORAGE),{starredItemsDismissed:v,recentlyViewedItemsDismissed:j}=u!=null?u:{},B=()=>{p(F=>({...i,...F,starredItemsDismissed:!0}))},W=()=>{p(F=>({...i,...F,recentlyViewedItemsDismissed:!0}))};return s?_jsxs(_Fragment,{children:[!v&&_jsxs(_Fragment,{children:[_jsx(Ai,{text:ua,onDismiss:B}),_jsx(SidebarDivider,{})]}),!j&&_jsx(Ai,{text:ha,onDismiss:W})]}):null}const pa=(0,l.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 Ti(e){const{className:s,stretch:i,noPadding:u,children:p,...v}=e,{contentRef:j}=no(),B=pa();return(0,n.jsx)("article",{ref:j,tabIndex:-1,...v,className:X()(B.root,s,{[B.stretch]:i,[B.noPadding]:u}),children:p})}var fa=t(6487),ga=t(99152);const ma=(0,l.Z)(e=>({tabsWrapper:{gridArea:"pageSubheader",backgroundColor:e.palette.background.paper,paddingLeft:e.spacing(3),minWidth:0},defaultTab:{padding:e.spacing(3,3),...e.typography.caption,textTransform:"uppercase",fontWeight:"bold",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 Ii(e){const{tabs:s,onChange:i,selectedIndex:u}=e,[p,v]=(0,g.useState)(u!=null?u:0),j=ma(),B=(0,g.useCallback)((W,F)=>{u===void 0&&v(F),i&&u!==F&&i(F)},[u,i]);return(0,g.useEffect)(()=>{u!==void 0&&v(u)},[u]),(0,n.jsx)("div",{className:j.tabsWrapper,children:(0,n.jsx)(ga.Z,{selectionFollowsFocus:!0,indicatorColor:"primary",textColor:"inherit",variant:"scrollable",scrollButtons:"auto","aria-label":"scrollable auto tabs example",onChange:B,value:p,children:s.map((W,F)=>(0,g.createElement)(fa.Z,{...W.tabProps,"data-testid":`header-tab-${F}`,label:W.label,key:W.id,value:F,className:j.defaultTab,classes:{selected:j.selected,root:j.tabRoot}}))})})}function va(e){const s=(0,E.UO)(),u=e.map(({path:xe,children:Te})=>({caseSensitive:!1,path:`${xe}/*`,element:Te})).sort((xe,Te)=>Te.path.replace(/\/\*$/,"").localeCompare(xe.path.replace(/\/\*$/,"")));var p;const v=(p=(0,E.V$)(u))!==null&&p!==void 0?p:e[0].children;var j;let B=(j=s["*"])!==null&&j!==void 0?j:"";B.startsWith("/")||(B=`/${B}`);var W;const[F]=(W=(0,E.fp)(u,B))!==null&&W!==void 0?W:[],ve=F?e.findIndex(xe=>`${xe.path}/*`===F.route.path):0;var oe;return{index:ve===-1?0:ve,element:v,route:(oe=e[ve])!==null&&oe!==void 0?oe:e[0]}}function Ri(e){const{routes:s}=e,i=(0,E.s0)(),{index:u,route:p,element:v}=va(s),j=(0,g.useMemo)(()=>s.map(W=>({id:W.path,label:W.title,tabProps:W.tabProps})),[s]),B=W=>{let{path:F}=s[W];F=F.replace(/\/\*$/,""),F=F.replace(/^\//,""),i(F)};return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(Ii,{tabs:j,selectedIndex:u,onChange:B}),(0,n.jsxs)(Ti,{children:[(0,n.jsx)(Ys.q,{title:p.title}),v]})]})}const Go=()=>null;(0,R.R5)(Go,"core.gatherMountPoints",!0);function Li(e){const s=(0,n.jsx)(Go,{path:"",title:"",children:(0,n.jsx)("div",{})}).type;return g.Children.toArray(e).flatMap(i=>{if(!(0,g.isValidElement)(i))return[];if(i.type===g.Fragment)return Li(i.props.children);if(i.type!==s)throw new Error("Child of TabbedLayout must be an TabbedLayout.Route");const{path:u,title:p,children:v,tabProps:j}=i.props;return[{path:u,title:p,children:v,tabProps:j}]})}function ya(e){const s=Li(e.children);return(0,n.jsx)(Ri,{routes:s})}ya.Route=Go;const xa=(0,l.Z)(e=>({value:{marginBottom:"6px"},subvalue:{color:e.palette.textSubtle,fontWeight:"normal"}}),{name:"BackstageSubvalueCell"});function ba(e){const{value:s,subvalue:i}=e,u=xa();return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("div",{className:u.value,children:s}),(0,n.jsx)("div",{className:u.subvalue,children:i})]})}var Sa=t(21070),Ca=t(90324),wa=t(98281),ja=t(48049),Pi=t(51209),ki=t(33375),Ea=t(44233),Aa=t(27604),Ko=t(36444),Ta=t(37971),Ia=t(59709),Ra=t(17373),La=t(3702),Pa=t(93111),po=t(67222);const ka=(0,l.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:"60px",justifyContent:"space-between",borderBottom:`1px solid ${e.palette.grey[500]}`},filters:{display:"flex",flexDirection:"column","& > *":{marginTop:e.spacing(2)}}}),{name:"BackstageTableFilters"}),Oa=e=>{var s;const i=ka(),{onChangeFilters:u}=e,[p,v]=(0,g.useState)({...e.selectedFilters}),[j,B]=(0,g.useState)(!1),W=()=>{v({}),B(F=>!F)};return(0,g.useEffect)(()=>{u(p)},[p,u]),(0,n.jsxs)("div",{className:i.root,children:[(0,n.jsxs)("div",{className:i.header,children:[(0,n.jsx)("div",{className:i.value,children:"Filters"}),(0,n.jsx)(Q.Z,{color:"primary",onClick:W,children:"Clear all"})]}),(0,n.jsx)("div",{className:i.filters,children:((s=e.filters)===null||s===void 0?void 0:s.length)&&e.filters.map(F=>(0,n.jsx)(un,{triggerReset:j,...F.element,selected:p[F.element.label],onChange:ve=>v({...p,[F.element.label]:ve})},F.element.label))})]})},Oi={Add:(0,g.forwardRef)((e,s)=>(0,n.jsx)(Sa.Z,{...e,ref:s})),Check:(0,g.forwardRef)((e,s)=>(0,n.jsx)(wa.Z,{...e,ref:s})),Clear:(0,g.forwardRef)((e,s)=>(0,n.jsx)(ki.Z,{...e,ref:s})),Delete:(0,g.forwardRef)((e,s)=>(0,n.jsx)(Ea.Z,{...e,ref:s})),DetailPanel:(0,g.forwardRef)((e,s)=>(0,n.jsx)(Pi.Z,{...e,ref:s})),Edit:(0,g.forwardRef)((e,s)=>(0,n.jsx)(Aa.Z,{...e,ref:s})),Export:(0,g.forwardRef)((e,s)=>(0,n.jsx)(La.Z,{...e,ref:s})),Filter:(0,g.forwardRef)((e,s)=>(0,n.jsx)(Ko.Z,{...e,ref:s})),FirstPage:(0,g.forwardRef)((e,s)=>(0,n.jsx)(Ta.Z,{...e,ref:s})),LastPage:(0,g.forwardRef)((e,s)=>(0,n.jsx)(Ia.Z,{...e,ref:s})),NextPage:(0,g.forwardRef)((e,s)=>(0,n.jsx)(Pi.Z,{...e,ref:s})),PreviousPage:(0,g.forwardRef)((e,s)=>(0,n.jsx)(ja.Z,{...e,ref:s})),ResetSearch:(0,g.forwardRef)((e,s)=>(0,n.jsx)(ki.Z,{...e,ref:s})),Search:(0,g.forwardRef)((e,s)=>(0,n.jsx)(Ko.Z,{...e,ref:s})),SortArrow:(0,g.forwardRef)((e,s)=>(0,n.jsx)(Ca.Z,{...e,ref:s})),ThirdStateCheck:(0,g.forwardRef)((e,s)=>(0,n.jsx)(Ra.Z,{...e,ref:s})),ViewColumn:(0,g.forwardRef)((e,s)=>(0,n.jsx)(Pa.Z,{...e,ref:s}))};function $i(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 v=i[p];u=u[v]}return u}const $a=(0,bn.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"})(po.W$),Bi=(0,bn.Z)(e=>({root:{padding:e.spacing(3,0,2.5,2.5)},title:{"& > h6":{fontWeight:"bold"}},searchField:{paddingRight:e.spacing(2)}}),{name:"BackstageTableToolbar"})(po.UW),Ba=(0,l.Z)(()=>({root:{display:"flex",alignItems:"center",justifyContent:"space-between"},title:{fontWeight:"bold",fontSize:18,whiteSpace:"nowrap"}}),{name:"BackstageTableFiltersContainer"}),Za=(0,l.Z)(()=>({root:{display:"flex",alignItems:"start"}}),{name:"BackstageTable"});function Da(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 v=p;p=(j,B,W)=>({...v(j,B,W),fontWeight:s.typography.fontWeightBold})}return{...i,headerStyle:u,cellStyle:p}})}function Na(e,s){return(0,ie.transform)(e,(i,u,p)=>{(0,ie.isEqual)(u,s[p])||(i[p]=u)})}const Zi={search:"",filtersOpen:!1,filters:{}};function Fa(e){const{toolbarRef:s,setSearch:i,hasFilters:u,selectedFiltersLength:p,toggleFilters:v}=e,j=Ba(),B=(0,g.useCallback)(W=>{e.onSearchChanged(W),i(W)},[e,i]);return u?(0,n.jsxs)("div",{className:j.root,children:[(0,n.jsxs)("div",{className:j.root,children:[(0,n.jsx)(nt.Z,{onClick:v,"aria-label":"filter list",children:(0,n.jsx)(Ko.Z,{})}),(0,n.jsxs)(q.Z,{className:j.title,children:["Filters (",p,")"]})]}),(0,n.jsx)(Bi,{...e,ref:s,onSearchChanged:B})]}):(0,n.jsx)(Bi,{...e,ref:s,onSearchChanged:B})}function Di(e){const{data:s,columns:i,options:u,title:p,subtitle:v,filters:j,initialState:B,emptyContent:W,onStateChange:F,components:ve,...oe}=e,xe=Za(),Te=(0,gt.Z)(),Ye={...Zi,...B},[tt,Rt]=(0,g.useState)(Ye.filtersOpen),zt=(0,g.useCallback)(()=>Rt($n=>!$n),[Rt]),[Xt,qt]=(0,g.useState)(0),[Lt,Jt]=(0,g.useState)(s),[Vt,mr]=(0,g.useState)(Ye.filters),vr=Da(i,Te),[yr,xr]=(0,g.useState)(Ye.search);(0,g.useEffect)(()=>{if(F){const $n=Na({search:yr,filtersOpen:tt,filters:Vt},Zi);F($n)}},[yr,tt,Vt,F]);const qo={headerStyle:{textTransform:"uppercase"}},kr=(0,g.useCallback)($n=>{var hr;return(hr=i.find(Ur=>Ur.title===$n))===null||hr===void 0?void 0:hr.field},[i]);(0,g.useEffect)(()=>{if(typeof s=="function")return;if(!Vt){Jt(s);return}const $n=Object.values(Vt);if(s&&$n.flat().length){const hr=s.filter(Ur=>!!Object.entries(Vt).filter(([,Mr])=>!!Mr.length).every(([Mr,nn])=>{const pn=$i(Ur,kr(Mr));return Array.isArray(pn)&&Array.isArray(nn)?pn.some(os=>nn.includes(os)):Array.isArray(pn)?pn.includes(nn):Array.isArray(nn)?nn.includes(pn):pn===nn}));Jt(hr)}else Jt(s);qt($n.flat().length)},[s,Vt,kr]);const _o=($n,hr)=>{const Ur=nn=>{const pn=new Set,os=zr=>{zr!=null&&pn.add(zr)};return hr&&hr.forEach(zr=>{const Bs=$i(zr,kr(nn));Array.isArray(Bs)?Bs.forEach(os):os(Bs)}),pn},Mr=nn=>({placeholder:"All results",label:nn.column,multiple:nn.type==="multiple-select",items:[...Ur(nn.column)].sort().map(pn=>({label:pn,value:pn}))});return $n.map(nn=>({type:nn.type,element:Mr(nn)}))},Wt=!!(j!=null&&j.length),ss=(0,g.useCallback)($n=>(0,n.jsx)(Fa,{setSearch:xr,hasFilters:Wt,selectedFiltersLength:Xt,toggleFilters:zt,...$n}),[zt,Wt,Xt,xr]),go=typeof s!="function"&&s.length===0,Or=i.length,ei=(0,g.useCallback)($n=>W&&go?(0,n.jsx)("tbody",{children:(0,n.jsx)("tr",{children:(0,n.jsx)("td",{colSpan:Or,children:W})})}):(0,n.jsx)(po.os,{...$n}),[go,W,Or]);return(0,n.jsxs)("div",{className:xe.root,children:[tt&&s&&typeof s!="function"&&(j==null?void 0:j.length)&&(0,n.jsx)(Oa,{filters:_o(j,s),selectedFilters:Vt,onChangeFilters:mr}),(0,n.jsx)(po.ZP,{components:{Header:$a,Toolbar:ss,Body:ei,...ve},options:{...qo,...u},columns:vr,icons:Oi,title:(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(q.Z,{variant:"h5",component:"h2",children:p}),v&&(0,n.jsx)(q.Z,{color:"textSecondary",variant:"body1",children:v})]}),data:typeof s=="function"?s:Lt,style:{width:"100%"},localization:{toolbar:{searchPlaceholder:"Filter",searchTooltip:"Filter"}},...oe})]})}Di.icons=Object.freeze(Oi);const Hl=e=>{const{children:s,value:i,index:u,...p}=e;return _jsx("div",{role:"tabpanel",hidden:i!==u,"aria-labelledby":`scrollable-auto-tab-${u}`,...p,children:i===u&&_jsx(Box,{p:3,children:s})})},Ua=(0,l.Z)(()=>({root:{color:"#6E6E6E",overflow:"visible",fontSize:"1.5rem",textAlign:"center",borderRadius:"50%",backgroundColor:"#E6E6E6",marginLeft:e=>e.isNext?"auto":"0",marginRight:e=>e.isNext?"0":"10px","&:hover":{backgroundColor:"#E6E6E6",opacity:"1"}}}),{name:"BackstageTabIcon"}),Gl=e=>{const s=Ua(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})},Ma=(e,s)=>s?e?"20px":"0":"40px",za=(0,l.Z)(e=>({root:{textTransform:"none",height:"64px",fontWeight:e.typography.fontWeightBold,fontSize:e.typography.pxToRem(13),color:e.palette.textSubtle,marginLeft:s=>Ma(s.isFirstNav,s.isFirstIndex),width:"130px",minWidth:"130px","&:hover":{outline:"none",backgroundColor:"transparent",color:e.palette.textSubtle}}}),{name:"BackstageTab"}),Kl=e=>{const s=za(e),{isFirstNav:i,isFirstIndex:u,...p}=e;return _jsx(Tab,{classes:s,disableRipple:!0,...p})},Va=(0,l.Z)(e=>({indicator:{display:"flex",justifyContent:"center",backgroundColor:e.palette.tabbar.indicator,height:"4px"},flexContainer:{alignItems:"center"},root:{"&:last-child":{marginLeft:"auto"}}}),{name:"BackstageTabBar"}),Yl=e=>{const s=Va(e);return _jsx(Tabs,{classes:s,...e,TabIndicatorProps:{children:_jsx("span",{})}})},Wa=(0,l.Z)(e=>({root:{flexGrow:1,width:"100%"},styledTabs:{backgroundColor:e.palette.background.paper},appbar:{boxShadow:"none",backgroundColor:e.palette.background.paper,paddingLeft:"10px",paddingRight:"10px"}}),{name:"BackstageTabs"});function Jl(e){const{tabs:s}=e,i=Wa(),[u,p]=useState([0,0]),[v,j]=useState(0),[B,W]=useState(0),[F,ve]=useState([[]]),oe=useRef(),{width:xe}=useWindowSize(),Te=(Xt,qt)=>{p([v,qt])},Ye=()=>{j(v-1)},tt=()=>{j(v+1)},Rt=()=>v+1<F.length;useEffect(()=>{const qt=v===0?1:2,Lt=oe.current.offsetWidth-20-qt*30,Jt=u[0]*B+u[1],Vt=Math.floor(Lt/170);W(Vt),ve(chunkArray(s,Vt)),p([Math.floor(Jt/Vt),Jt%Vt])},[xe,s]);const zt=v===u[0]?u[1]:!1;return _jsxs("div",{className:i.root,children:[_jsx(AppBar,{ref:oe,className:i.appbar,position:"static",children:_jsx("div",{children:_jsxs(StyledTabs,{value:zt,onChange:Te,selectionFollowsFocus:!0,children:[v!==0&&_jsx(StyledIcon,{onClick:Ye,ariaLabel:"navigate-before",children:_jsx(NavigateBeforeIcon,{})}),F[v].map((Xt,qt)=>_jsx(StyledTab,{value:qt,isFirstIndex:qt===0,isFirstNav:v===0,icon:Xt.icon||void 0,label:Xt.label||void 0},qt)),Rt()&&_jsx(StyledIcon,{isNext:!0,onClick:tt,ariaLabel:"navigate-next",children:_jsx(NavigateNextIcon,{})})]})})}),zt!==!1?F[v].map((Xt,qt)=>_jsx(TabPanel,{value:qt,index:zt,children:Xt.content},qt)):_jsx(TabPanel,{value:u[1],index:u[1],children:F[u[0]][u[1]].content},"panel_outside_chunked_array")]})}var Ql=t(44311);function Ha(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 Xl(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:Ha(e.data,s)})]})}const Ga=e=>(0,l.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"}),Ka=({title:e="Unknown page",className:s})=>(0,n.jsx)(q.Z,{variant:"h4",component:"h2",className:s,"data-testid":"header-title",children:e});function Ya(e){const{description:s,title:i,titleComponent:u=void 0,children:p,textAlign:v="left"}=e,j=Ga({textAlign:v})(),B=u||(0,n.jsx)(Ka,{title:i,className:j.title});return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(Ys.q,{title:i}),(0,n.jsxs)("div",{className:j.container,children:[(0,n.jsxs)("div",{className:j.leftItemsBox,children:[B,s&&(0,n.jsx)(q.Z,{className:j.description,variant:"body2",children:s})]}),(0,n.jsx)("div",{className:j.rightItemsBox,children:p})]})]})}var Ja=t.p+"static/mic-drop.fe3ef4d0..svg";const Qa=(0,l.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"}),Xa=()=>{const e=Qa();return(0,n.jsx)("img",{src:Ja,className:e.micDrop,alt:"Girl dropping mic from her hands"})},qa=(0,l.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:32}},subtitle:{color:e.palette.textSubtle}}),{name:"BackstageErrorPage"});function _a(e){const{status:s,statusMessage:i,additionalInfo:u,supportUrl:p}=e,v=qa(),j=(0,E.s0)(),B=Io();return(0,n.jsxs)(P.Z,{container:!0,spacing:0,className:v.container,children:[(0,n.jsxs)(P.Z,{item:!0,xs:12,sm:8,md:4,children:[(0,n.jsxs)(q.Z,{"data-testid":"error",variant:"body1",className:v.subtitle,children:["ERROR ",s,": ",i]}),(0,n.jsx)(q.Z,{variant:"body1",className:v.subtitle,children:u}),(0,n.jsx)(q.Z,{variant:"h2",className:v.title,children:"Looks like someone dropped the mic!"}),(0,n.jsxs)(q.Z,{variant:"h6",children:[(0,n.jsx)(Ze,{to:"#","data-testid":"go-back-link",onClick:()=>j(-1),children:"Go back"}),"... or please"," ",(0,n.jsx)(Ze,{to:p||B.url,children:"contact support"})," if you think this is a bug."]})]}),(0,n.jsx)(Xa,{})]})}var el=t(16173);const tl=(0,bn.Z)({root:{textDecoration:"underline",cursor:"pointer"}},{name:"BackstageBreadcrumbsClickableText"})(q.Z),Yo=(0,bn.Z)({root:{textDecoration:"underline",color:"inherit"}},{name:"BackstageBreadcrumbsStyledBox"})(Xn.Z);function nl(e){const{children:s,...i}=e,[u,p]=g.useState(null),v=g.Children.toArray(s),[j,B,...W]=v,F=W.length?W.pop():v[v.length-1],ve=v.length>3,oe=Ye=>{p(Ye.currentTarget)},xe=()=>{p(null)},Te=Boolean(u);return(0,n.jsxs)(g.Fragment,{children:[(0,n.jsxs)(el.Z,{"aria-label":"breadcrumb",...i,children:[v.length>1&&(0,n.jsx)(Yo,{clone:!0,children:j}),v.length>2&&(0,n.jsx)(Yo,{clone:!0,children:B}),ve&&(0,n.jsx)(tl,{onClick:oe,children:"..."}),(0,n.jsx)(Xn.Z,{style:{fontStyle:"italic"},children:F})]}),(0,n.jsx)(As.ZP,{open:Te,anchorEl:u,onClose:xe,anchorOrigin:{vertical:"bottom",horizontal:"left"},transformOrigin:{vertical:"top",horizontal:"left"},children:(0,n.jsx)(ot.Z,{children:W.map((Ye,tt)=>(0,n.jsx)(ht.Z,{button:!0,children:(0,n.jsx)(Yo,{clone:!0,children:Ye})},tt))})})]})}const rl=(0,l.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"}),sl=({type:e,typeLink:s,classes:i,pageTitle:u})=>e?s?(0,n.jsxs)(nl,{className:i.breadcrumb,children:[(0,n.jsx)(Ze,{to:s,children:e}),(0,n.jsx)(q.Z,{children:u})]}):(0,n.jsx)(q.Z,{className:i.type,children:e}):null,ol=({pageTitle:e,classes:s,tooltip:i})=>{const u=(0,n.jsx)(q.Z,{className:s.title,variant:"h1",children:e});return i?(0,n.jsx)(Me.ZP,{title:i,placement:"top-start",children:u}):u},il=({classes:e,subtitle:s})=>s?typeof s!="string"?(0,n.jsx)(n.Fragment,{children:s}):(0,n.jsx)(q.Z,{className:e.subtitle,variant:"subtitle2",component:"span",children:s}):null;function Ni(e){const{children:s,pageTitleOverride:i,style:u,subtitle:p,title:v,tooltip:j,type:B,typeLink:W}=e,F=rl(),oe=(0,R.h_)(R.Ds).getOptionalString("app.title")||"Backstage",xe=i||v,Te=v||i,Ye=`${xe} | %s | ${oe}`,tt=`${xe} | ${oe}`;return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(Ys.q,{titleTemplate:Ye,defaultTitle:tt}),(0,n.jsxs)("header",{style:u,className:F.header,children:[(0,n.jsxs)(Xn.Z,{className:F.leftItemsBox,children:[(0,n.jsx)(sl,{classes:F,type:B,typeLink:W,pageTitle:Te}),(0,n.jsx)(ol,{classes:F,pageTitle:Te,tooltip:j}),(0,n.jsx)(il,{classes:F,subtitle:p})]}),(0,n.jsx)(P.Z,{container:!0,className:F.rightItemsBox,spacing:4,children:s})]})]})}const al=({label:e,secondaryLabel:s,icon:i,disabled:u=!1,onClick:p})=>_jsx(React.Fragment,{children:_jsxs(ListItem,{"data-testid":"header-action-item",disabled:u,button:!0,onClick:v=>{p&&p(v)},children:[i&&_jsx(ListItemIcon,{children:i}),_jsx(ListItemText,{primary:e,secondary:s})]})});function ql(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((v,j)=>_jsx(al,{...v},`header-action-menu-${j}`))})})]})}const ll=(0,l.Z)(e=>({root:{textAlign:"left"},label:{color:e.palette.common.white,fontWeight:"bold",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"}),cl=({value:e,className:s})=>(0,n.jsx)(q.Z,{className:s,children:e});function dl(e){const{label:s,value:i,url:u}=e,p=ll(),v=(0,n.jsx)(cl,{className:p.value,value:i||"<Unknown>"});return(0,n.jsx)(P.Z,{item:!0,children:(0,n.jsxs)("span",{className:p.root,children:[(0,n.jsx)(q.Z,{className:p.label,children:s}),u?(0,n.jsx)(Ze,{to:u,children:v}):v]})})}const ul=e=>(0,I.Z)({root:{color:e.palette.common.white,padding:e.spacing(2,2,3),backgroundImage:e.getPageTheme({themeId:"card"}).backgroundImage,backgroundPosition:0,backgroundSize:"inherit"}}),hl=(0,l.Z)(ul,{name:"BackstageItemCardHeader"});function pl(e){const{title:s,subtitle:i,children:u}=e,p=hl(e);return(0,n.jsxs)("div",{className:p.root,children:[i&&(0,n.jsx)(q.Z,{variant:"subtitle2",component:"h3",children:i}),s&&(0,n.jsx)(q.Z,{variant:"h6",component:"h4",children:s}),u]})}function _l(e){const{description:s,tags:i,title:u,type:p,subtitle:v,label:j,onClick:B,href:W}=e;return _jsxs(Card,{children:[_jsx(CardMedia,{children:_jsx(ItemCardHeader,{title:u,subtitle:v||p})}),_jsxs(CardContent,{children:[i!=null&&i.length?_jsx(Box,{children:i.map((F,ve)=>_jsx(Chip,{size:"small",label:F},ve))}):null,s]}),_jsxs(CardActions,{children:[!W&&_jsx(Button,{to:"#",onClick:B,color:"primary",children:j}),W&&_jsx(Button,{to:W,color:"primary",children:j})]})]})}const fl=e=>(0,I.Z)({root:{display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(22em, 1fr))",gridAutoRows:"1fr",gridGap:e.spacing(2)}}),gl=(0,l.Z)(fl,{name:"BackstageItemCardGrid"});function ml(e){const{children:s,...i}=e,u=gl(i);return(0,n.jsx)("div",{className:u.root,...i,children:s})}var vl=t(41547);const yl=(0,l.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 Fi(e){const{themeId:s,children:i}=e,{isMobile:u}=Fr(),p=yl({isMobile:u});return(0,n.jsx)(vl.Z,{theme:v=>({...v,page:v.getPageTheme({themeId:s})}),children:(0,n.jsx)("main",{className:p.root,children:i})})}function xl(e){const{themeId:s,children:i,...u}=e;return(0,n.jsxs)(Fi,{themeId:s,children:[(0,n.jsx)(Ni,{...u}),i]})}var Hn=t(30195);const ec=Hn.z.object({providerInfo:Hn.z.object({}).catchall(Hn.z.unknown()).optional(),profile:Hn.z.object({email:Hn.z.string().optional(),displayName:Hn.z.string().optional(),picture:Hn.z.string().optional()}),backstageIdentity:Hn.z.object({token:Hn.z.string(),identity:Hn.z.object({type:Hn.z.literal("user"),userEntityRef:Hn.z.string(),ownershipEntityRefs:Hn.z.array(Hn.z.string())})})}),Ui={defaultTokenExpiryMillis:5*60*1e3,tokenExpiryMarginMillis:5*60*1e3};function bl(e){const s=new Date(Date.now()+Ui.defaultTokenExpiryMillis);if(!e)return s;const[i,u,p]=e.split("."),v=JSON.parse(atob(u));return typeof v.exp!="number"?s:new Date(v.exp*1e3-Ui.tokenExpiryMarginMillis)}class tc{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:bl(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=await fetch(`${s}/${this.options.provider}/refresh`,{signal:this.abortController.signal,headers:{"x-requested-with":"XMLHttpRequest"},credentials:"include"});if(!i.ok)throw await ResponseError.fromResponse(i);return proxiedSessionSchema.parse(await i.json())}constructor(s){this.options=s,this.abortController=new AbortController,this.state={type:"empty"}}}const nc=e=>{const s=useApi(discoveryApiRef),[{status:i,error:u},{execute:p}]=useAsync(async()=>{const v=new ProxiedSignInIdentity({provider:e.provider,discoveryApi:s});await v.start(),e.onSignInSuccess(v)});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},Sl=(0,l.Z)({container:{padding:0,listStyle:"none"},item:{display:"flex",flexDirection:"column",width:"100%",maxWidth:"400px",margin:0,padding:0}},{name:"BackstageSignInPage"}),Jo=({children:e})=>{const s=Sl();return(0,n.jsx)(P.Z,{component:"li",item:!0,classes:s,children:e})};class Qo{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 Cl(e){const[s,i,u]=e.split(".");return JSON.parse(atob(i))}class Xo{getUserId(){return this.result.userId}static fromResult(s){return new Xo(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}=Cl(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 $s{static createGuest(){return new Qo}static fromLegacy(s){return Xo.fromResult(s)}static create(s){return new $s(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 wl={Component:({config:e,onSignInSuccess:s})=>{const{apiRef:i,title:u,message:p}=e,v=(0,R.h_)(i),j=(0,R.h_)(R.VE),B=async()=>{try{const W=await v.getBackstageIdentity({instantPopup:!0});if(!W)throw new Error(`The ${u} provider is not configured to support sign-in`);const F=await v.getProfile();s($s.create({identity:W.identity,profile:F,authApi:v}))}catch(W){j.post(new Tr.SP("Login failed",W))}};return(0,n.jsx)(Jo,{children:(0,n.jsx)(Ir,{variant:"fullHeight",title:u,actions:(0,n.jsx)(Q.Z,{color:"primary",variant:"outlined",onClick:B,children:"Sign In"}),children:(0,n.jsx)(q.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 $s.create({identity:u.identity,profile:p,authApi:i})}},jl={Component:({onSignInSuccess:e})=>(0,n.jsx)(Jo,{children:(0,n.jsx)(Ir,{title:"Guest",variant:"fullHeight",actions:(0,n.jsx)(Q.Z,{color:"primary",variant:"outlined",onClick:()=>e(new Qo),children:"Enter"}),children:(0,n.jsxs)(q.Z,{variant:"body1",children:["Enter as a Guest User.",(0,n.jsx)("br",{}),"You will not have a verified identity,",(0,n.jsx)("br",{}),"meaning some features might be unavailable."]})})}),loader:async()=>new Qo};var El=t(63955),Mi=t(86619),zi=t(74828),Al=t(45455),Tl=t.n(Al);const Il=/^[a-z0-9_\-]+\.[a-z0-9_\-]+\.[a-z0-9_\-]+$/i,Rl=(0,l.Z)(e=>({form:{display:"flex",flexFlow:"column nowrap"},button:{alignSelf:"center",marginTop:e.spacing(2)}}),{name:"BackstageCustomProvider"}),Vi=e=>{const{ref:s,...i}=e;return{inputRef:s,...i}},Ll={Component:({onSignInSuccess:e})=>{const s=Rl(),{register:i,handleSubmit:u,formState:p}=(0,El.cI)({mode:"onChange"}),{errors:v}=p,j=({userId:B})=>{e($s.fromLegacy({userId:B,profile:{email:`${B}@example.com`}}))};return(0,n.jsx)(Jo,{children:(0,n.jsxs)(Ir,{title:"Custom User",variant:"fullHeight",children:[(0,n.jsxs)(q.Z,{variant:"body1",children:["Enter your own User ID and credentials.",(0,n.jsx)("br",{}),"This selection will not be stored."]}),(0,n.jsxs)("form",{className:s.form,onSubmit:u(j),children:[(0,n.jsxs)(le.Z,{children:[(0,n.jsx)(Mi.Z,{...Vi(i("userId",{required:!0})),label:"User ID",margin:"normal",error:Boolean(v.userId)}),v.userId&&(0,n.jsx)(zi.Z,{error:!0,children:v.userId.message})]}),(0,n.jsxs)(le.Z,{children:[(0,n.jsx)(Mi.Z,{...Vi(i("idToken",{required:!1,validate:B=>!B||Il.test(B)||"Token is not a valid OpenID Connect JWT Token"})),label:"ID Token (optional)",margin:"normal",autoComplete:"off",error:Boolean(v.idToken)}),v.idToken&&(0,n.jsx)(zi.Z,{error:!0,children:v.idToken.message})]}),(0,n.jsx)(Q.Z,{type:"submit",color:"primary",variant:"outlined",className:s.button,disabled:!(p!=null&&p.isDirty)||!Tl()(v),children:"Continue"})]})]})})},loader:async()=>{}},fo="@backstage/core:SignInPage:provider",Wi={guest:jl,custom:Ll,common:wl};function Hi(e,s){if(e in s)throw new Error(`"${e}" ID is duplicated. IDs of identity providers have to be unique.`)}function cc(e){return e.reduce((i,u)=>{if(typeof u=="string")return Hi(u,i),i[u]={components:Wi[u],id:u},i;const{id:p}=u;return Hi(p,i),i[p]={components:Wi.common,id:p,config:u},i},{})}const dc=(e,s)=>{const i=useApi(errorApiRef),u=useApiHolder(),[p,v]=useState(!0),j=useCallback(W=>{s(IdentityApiSignOutProxy.from({identityApi:W,signOut:async()=>{var F;localStorage.removeItem(fo),await((F=W.signOut)===null||F===void 0?void 0:F.call(W))}}))},[s]);useLayoutEffect(()=>{var W;if(!p)return;const F=localStorage.getItem(fo);if(F===null){v(!1);return}const ve=e[F];if(!ve){v(!1);return}let oe=!1;return ve.components.loader(u,(W=ve.config)===null||W===void 0?void 0:W.apiRef).then(xe=>{oe||(xe?j(xe):v(!1))}).catch(xe=>{oe||(localStorage.removeItem(fo),i.post(xe),v(!1))}),()=>{oe=!0}},[p,i,s,u,e,j]);const B=useMemo(()=>Object.keys(e).map(W=>{const F=e[W],{Component:ve}=F.components,oe=xe=>{localStorage.setItem(fo,F.id),j(xe)};return _jsx(ve,{config:F.config,onSignInSuccess:oe},F.id)}),[e,j]);return[p,B]},Pl=({onSignInSuccess:e,providers:s=[],title:i,align:u="left"})=>{const p=useApi(configApiRef),v=useStyles(),j=getSignInProviders(s),[B,W]=useSignInProviders(j,e);return B?_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:v,children:W})]})]})},kl=({provider:e,auto:s,onSignInSuccess:i})=>{const u=useStyles(),p=useApi(e.apiRef),v=useApi(configApiRef),[j,B]=useState(),[W,F]=useState(!1),ve=async({checkExisting:oe,showPopup:xe})=>{try{let Te;if(oe&&(Te=await p.getBackstageIdentity({optional:!0})),!Te&&(xe||s)&&(F(!0),Te=await p.getBackstageIdentity({instantPopup:!0}),!Te))throw new Error(`The ${e.title} provider is not configured to support sign-in`);if(!Te){F(!0);return}const Ye=await p.getProfile();i(UserIdentity.create({identity:Te.identity,authApi:p,profile:Ye}))}catch(Te){B(Te),F(!0)}};return useMountEffect(()=>ve({checkExisting:!0})),W?_jsxs(Page,{themeId:"home",children:[_jsx(Header,{title:v.getString("app.title")}),_jsx(Content,{children:_jsx(Grid,{container:!0,justifyContent:"center",spacing:2,component:"ul",classes:u,children:_jsx(GridItem,{children:_jsxs(InfoCard,{variant:"fullHeight",title:e.title,actions:_jsx(Button,{color:"primary",variant:"outlined",onClick:()=>{ve({showPopup:!0})},children:"Sign In"}),children:[_jsx(Typography,{variant:"body1",children:e.message}),j&&j.name!=="PopupRejectedError"&&_jsx(Typography,{variant:"body1",color:"error",children:j.message})]})})})})]}):_jsx(Progress,{})};function uc(e){return"provider"in e?_jsx(kl,{...e}):_jsx(Pl,{...e})}const Ol=(0,l.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"}),$l=(0,bn.Z)(e=>({root:{padding:e.spacing(2,2,2,2.5),display:"inline-block"},title:{fontWeight:700},subheader:{paddingTop:e.spacing(1)}}),{name:"BackstageTabbedCardBoldHeader"})(Jr.Z);function hc(e){const{slackChannel:s,errorBoundaryProps:i,children:u,title:p,deepLink:v,value:j,onChange:B}=e,W=Ol(),[F,ve]=useState(0),oe=B||((Ye,tt)=>ve(tt));let xe;j?React.Children.map(u,Ye=>{React.isValidElement(Ye)&&(Ye==null?void 0:Ye.props.value)===j&&(xe=Ye==null?void 0:Ye.props.children)}):React.Children.map(u,(Ye,tt)=>{React.isValidElement(Ye)&&tt===F&&(xe=Ye==null?void 0:Ye.props.children)});const Te=i||(s?{slackChannel:s}:{});return _jsx(Card,{children:_jsxs(ErrorBoundary,{...Te,children:[p&&_jsx($l,{title:p}),_jsx(Tabs,{selectionFollowsFocus:!0,classes:W,value:j||F,onChange:oe,children:u}),_jsx(Divider,{}),_jsx(CardContent,{children:xe}),v&&_jsx(BottomLink,{...v})]})})}const Bl=(0,l.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:"bold"}}),{name:"BackstageCardTab"});function pc(e){const{children:s,...i}=e,u=Bl();return _jsx(Tab,{disableRipple:!0,classes:u,...i})}},25248:function(jt,Fe,t){"use strict";t.d(Fe,{fC:function(){return x},CL:function(){return nt},sM:function(){return _},$v:function(){return Ie},v_:function(){return Je},hg:function(){return Ze},uB:function(){return ee},R5:function(){return At},bq:function(){return T},Ds:function(){return je},ni:function(){return X},T0:function(){return D},CO:function(){return Nn},x8:function(){return ln},rx:function(){return Cn},YO:function(){return Yt},P4:function(){return In},NT:function(){return en},NW:function(){return We},VE:function(){return gt},W0:function(){return Me},gP:function(){return ze},IY:function(){return pt},F4:function(){return ie},ux:function(){return L},Kp:function(){return he},$4:function(){return Qe},p_:function(){return $},ZM:function(){return rt},D:function(){return E},gW:function(){return A},E6:function(){return ct},z$:function(){return vt},h_:function(){return ne},I_:function(){return I},qD:function(){return Pe},vJ:function(){return Rn},yx:function(){return Re},tg:function(){return gn},Oi:function(){return Jn}});var h=t(52322),n=t(51837),g=t(2784);const R=(0,n.CT)("analytics-context"),V=()=>{const ge=(0,g.useContext)(R);if(ge===void 0)return{routeRef:"unknown",pluginId:"root",extension:"App"};const te=ge.atVersion(1);if(te===void 0)throw new Error("No context found for version 1.");return te},x=ge=>{const{attributes:te,children:Ee}=ge,qe={...V(),...te},xt=(0,n.EI)({1:qe});return(0,h.jsx)(R.Provider,{value:xt,children:Ee})};function l(ge,te){const Ee=De=>_jsx(x,{attributes:te,children:_jsx(ge,{...De})});return Ee.displayName=`WithAnalyticsContext(${ge.displayName||ge.name||"Component"})`,Ee}function I(){const ge=(0,n.Vt)("api-context");if(!ge)throw new Error("API context is not available");const te=ge.atVersion(1);if(!te)throw new Error("ApiContext v1 not available");return te}function ne(ge){const Ee=I().get(ge);if(!Ee)throw new Error(`No implementation available for ${ge}`);return Ee}function J(ge){return function(Ee){const De=xt=>{const ae=I(),P={};for(const q in ge)if(ge.hasOwnProperty(q)){const Ke=ge[q],U=ae.get(Ke);if(!U)throw new Error(`No implementation available for ${Ke}`);P[q]=U}return _jsx(Ee,{...xt,...P})},qe=Ee.displayName||Ee.name||"Component";return De.displayName=`withApis(${qe})`,De}}class Q{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(te){if(this.config=te,!te.id.split(".").flatMap(De=>De.split("-")).every(De=>De.match(/^[a-z][a-z0-9]*$/)))throw new Error(`API id must only contain period separated lowercase alphanum tokens with dashes, got '${te.id}'`)}}function D(ge){return new Q(ge)}function X(ge,te){return"id"in ge?{api:ge,deps:{},factory:()=>te}:ge}var _;(function(ge){ge.SignedIn="SignedIn",ge.SignedOut="SignedOut"})(_||(_={}));const he=D({id:"core.auth.google"}),ie=D({id:"core.auth.github"}),E=D({id:"core.auth.okta"}),L=D({id:"core.auth.gitlab"}),$=D({id:"core.auth.microsoft"}),A=D({id:"core.auth.onelogin"}),T=D({id:"core.auth.bitbucket"}),ee=D({id:"core.auth.atlassian"}),Ie=D({id:"core.alert"}),Je=D({id:"core.analytics"}),Ze=D({id:"core.apptheme"}),je=D({id:"core.config"}),We=D({id:"core.discovery"}),gt=D({id:"core.error"});var nt;(function(ge){ge[ge.None=0]="None",ge[ge.Active=1]="Active"})(nt||(nt={}));const Me=D({id:"core.featureflags"}),ze=D({id:"core.fetch"}),Qe=D({id:"core.identity"}),rt=D({id:"core.oauthrequest"}),ct=D({id:"core.storage"});class lt{setContext(te){this.context=te}captureEvent(te,Ee,{value:De,attributes:qe}={}){try{this.analyticsApi.captureEvent({action:te,subject:Ee,value:De,attributes:qe,context:this.context})}catch(xt){console.warn("Error during analytics event capture. %o",xt)}}constructor(te,Ee={routeRef:"unknown",pluginId:"root",extension:"App"}){this.analyticsApi=te,this.context=Ee}}function mt(){try{return ne(Je)}catch{return{captureEvent:()=>{}}}}function vt(){const ge=(0,g.useRef)(null),te=V(),Ee=mt();function De(){return ge.current===null&&(ge.current=new lt(Ee)),ge.current}const qe=De();return qe.setContext(te),qe}const Ge="plugin-context",re=ge=>{const{children:te,plugin:Ee}=ge,{Provider:De}=(0,n.CT)(Ge);return(0,h.jsx)(De,{value:(0,n.EI)({1:{plugin:Ee}}),children:te})};function Re(){const ge=(0,n.Vt)(Ge);if(!ge)throw new Error("Plugin Options context is not available");const te=ge.atVersion(1);if(!te)throw new Error("Plugin Options v1 is not available");return te.plugin.getPluginOptions()}const Pe=()=>{const ge=(0,n.Vt)("app-context");if(!ge)throw new Error("App context is not available");const te=ge.atVersion(1);if(!te)throw new Error("AppContext v1 not available");return te},it=(0,n.uW)("component-data-store",()=>new WeakMap),yt="__backstage_data";function At(ge,te,Ee){const De=ge;var qe;let xt=(qe=De[yt])!==null&&qe!==void 0?qe:it.get(ge);if(xt||(xt={map:new Map},Object.defineProperty(De,yt,{enumerable:!1,configurable:!0,writable:!1,value:xt}),it.set(ge,xt)),xt.map.has(te)){const ae=ge.displayName||ge.name;throw new Error(`Attempted to attach duplicate data "${te}" to component "${ae}"`)}xt.map.set(te,Ee)}function pt(ge,te){if(!ge)return;const Ee=ge.type;if(!Ee)return;var De;const qe=(De=Ee[yt])!==null&&De!==void 0?De:it.get(Ee);if(!!qe)return qe.map.get(te)}const Ct=(0,n.uW)("route-ref-type",()=>Symbol("route-ref-type"));let Pt=Ct;class kt{get title(){return this.id}toString(){return`routeRef{type=absolute,id=${this.id}}`}constructor(te,Ee){this.id=te,this.params=Ee,this[Pt]="absolute"}}function en(ge){var te;return new kt(ge.id,(te=ge.params)!==null&&te!==void 0?te:[])}const sn=/^\w+$/;let Ht=null;class Gt{toString(){return`routeRef{type=sub,id=${this.id}}`}constructor(te,Ee,De,qe){this.id=te,this.path=Ee,this.parent=De,this.params=qe,this[Ht]="sub"}}function fn(ge){const{id:te,path:Ee,parent:De}=ge,qe=Ee.split("/").filter(P=>P.startsWith(":")).map(P=>P.substring(1)),xt=[...De.params,...qe];if(De.params.some(P=>qe.includes(P)))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 P of qe)if(!sn.test(P))throw new Error(`SubRouteRef path has invalid param, got '${P}'`);return new Gt(te,Ee,De,xt)}let _t=Ct;class Zn{toString(){return`routeRef{type=external,id=${this.id}}`}constructor(te,Ee,De){this.id=te,this.params=Ee,this.optional=De,this[_t]="external"}}function ln(ge){var te;return new Zn(ge.id,(te=ge.params)!==null&&te!==void 0?te:[],Boolean(ge.optional))}var Dn=t(10289);function gn(ge){const te=(0,Dn.TH)(),Ee=(0,n.Vt)("routing-context");if(!Ee)throw new Error("Routing context is not available");const De=Ee.atVersion(1),qe=(0,g.useMemo)(()=>De&&De.resolve(ge,te),[De,ge,te]);if(!Ee)throw new Error("useRouteRef used outside of routing context");if(!De)throw new Error("RoutingContext v1 not available");const xt="optional"in ge&&ge.optional;if(!qe&&!xt)throw new Error(`No path for ${ge}`);return qe}function Jn(ge){return(0,Dn.UO)()}class Kt extends g.Component{static getDerivedStateFromError(te){return{error:te}}render(){const{error:te}=this.state,{app:Ee,plugin:De}=this.props,{ErrorBoundaryFallback:qe}=Ee.getComponents();return te?(0,h.jsx)(qe,{error:te,resetError:this.handleErrorReset,plugin:De}):this.props.children}constructor(...te){super(...te),this.state={error:void 0},this.handleErrorReset=()=>{this.setState({error:void 0})}}}function In(ge){const{component:te,mountPoint:Ee,name:De}=ge;return Yt({component:{lazy:()=>te().then(qe=>{const xt=P=>{try{gn(Ee)}catch(q){if(typeof q=="object"&&q!==null){const{message:Ke}=q;if(typeof Ke=="string"&&Ke.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 q}return(0,h.jsx)(qe,{...P})},ae=De||qe.displayName||qe.name||"LazyComponent";return xt.displayName=`RoutableExtension(${ae})`,xt},qe=>ae=>{const P=Pe(),{BootErrorPage:q}=P.getComponents();return(0,h.jsx)(q,{step:"load-chunk",error:qe})})},data:{"core.mountPoint":Ee},name:De})}function Nn(ge){const{component:te,name:Ee}=ge;return Yt({component:te,name:Ee})}function Yt(ge){const{data:te={},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 De;if("lazy"in ge.component){const xt=ge.component.lazy;De=(0,g.lazy)(()=>xt().then(ae=>({default:ae})))}else De=ge.component.sync;const qe=Ee||De.displayName||De.name||"Component";return{expose(xt){const ae=P=>{const q=Pe(),{Progress:Ke}=q.getComponents(),U=te==null?void 0:te["core.mountPoint"];return(0,h.jsx)(g.Suspense,{fallback:(0,h.jsx)(Ke,{}),children:(0,h.jsx)(Kt,{app:q,plugin:xt,children:(0,h.jsx)(x,{attributes:{pluginId:xt.getId(),...Ee&&{extension:Ee},...U&&{routeRef:U.id}},children:(0,h.jsx)(re,{plugin:xt,children:(0,h.jsx)(De,{...P})})})})})};At(ae,"core.plugin",xt);for(const[P,q]of Object.entries(te))At(ae,P,q);return ae.displayName=`Extension(${qe})`,ae}}}function mn(ge,te,Ee,De){return g.Children.toArray(ge).flatMap(qe=>{if(!(0,g.isValidElement)(qe))return[];if(qe.type===g.Fragment)return mn(qe.props.children,te,Ee,De);if(pt(qe,"core.featureFlagged")){const xt=qe.props;return("with"in xt?te.isActive(xt.with):!te.isActive(xt.without))?mn(qe.props.children,te,Ee,De):[]}if(Ee===void 0||Ee(qe))return[qe];if(De)throw new Error(De);return mn(qe.props.children,te,Ee,De)})}class cn{selectByComponentData(te){const Ee=mn(this.node,this.featureFlagsApi,De=>pt(De,te.key)!==void 0,te.withStrictError);return new cn(Ee,this.featureFlagsApi)}findComponentData(te){return mn(this.node,this.featureFlagsApi,De=>pt(De,te.key)!==void 0).map(De=>pt(De,te.key)).filter(De=>De!==void 0)}getElements(){return mn(this.node,this.featureFlagsApi)}constructor(te,Ee){this.node=te,this.featureFlagsApi=Ee}}function Rn(ge,te,Ee=[]){const De=ne(Me),qe=new cn(ge,De);return(0,g.useMemo)(()=>te(qe),[ge,...Ee])}class Fn{getId(){return this.config.id}getApis(){var te;return(te=this.config.apis)!==null&&te!==void 0?te:[]}getFeatureFlags(){var te,Ee;return(Ee=(te=this.config.featureFlags)===null||te===void 0?void 0:te.slice())!==null&&Ee!==void 0?Ee:[]}get routes(){var te;return(te=this.config.routes)!==null&&te!==void 0?te:{}}get externalRoutes(){var te;return(te=this.config.externalRoutes)!==null&&te!==void 0?te:{}}provide(te){return te.expose(this)}__experimentalReconfigure(te){this.config.__experimentalConfigure&&(this.options=this.config.__experimentalConfigure(te))}getPluginOptions(){this.config.__experimentalConfigure&&!this.options&&(this.options=this.config.__experimentalConfigure());var te;return(te=this.options)!==null&&te!==void 0?te:{}}toString(){return`plugin{${this.config.id}}`}constructor(te){this.config=te,this.options=void 0}}function Cn(ge){return new Fn(ge)}},23054:function(jt,Fe,t){"use strict";t.d(Fe,{SP:function(){return _},dR:function(){return Q},VL:function(){return ie},BD:function(){return n}});function h(E){if(typeof E!="object"||E===null||Array.isArray(E))return!1;const L=E;return!(typeof L.name!="string"||L.name===""||typeof L.message!="string")}function n(E){if(typeof E!="object"||E===null||Array.isArray(E))throw new Error(`Encountered invalid error, not an object, got '${E}'`);const L=E;if(typeof L.name!="string"||L.name==="")throw new Error(`Encountered error object without a name, got '${E}'`);if(typeof L.message!="string")throw new Error(`Encountered error object without a message, got '${E}'`)}var g=t(24852);function R(E,L){const A={name:"Unknown",message:"<no reason given>",...serializeErrorInternal(E)};return L!=null&&L.includeStack||delete A.stack,A}function V(E){const L=(0,g.deserializeError)(E);return E.stack||(L.stack=void 0),L}function x(E){if(h(E)){const L=String(E);return L!=="[object Object]"?L:`${E.name}: ${E.message}`}return`unknown error '${E}'`}class l extends Error{constructor(L,$){var A;let T=L;if($!==void 0){const ee=x($);T?T+=`; caused by ${ee}`:T=`caused by ${ee}`}super(T),(A=Error.captureStackTrace)===null||A===void 0||A.call(Error,this,this.constructor),this.name=this.constructor.name,this.cause=h($)?$:void 0}}class I extends null{}class ne extends null{}class J extends null{}class Q extends l{}class D extends null{}class X extends null{}class _ extends l{constructor(L,$){super(L,$),this.name=h($)?$.name:"Error"}}async function he(E){try{const $=await E.text();if($){var L;if(!((L=E.headers.get("content-type"))===null||L===void 0)&&L.startsWith("application/json"))try{const A=JSON.parse($);if(A.error&&A.response)return A}catch{}return{error:{name:"Error",message:`Request failed with status ${E.status} ${E.statusText}, ${$}`},response:{statusCode:E.status}}}}catch{}return{error:{name:"Error",message:`Request failed with status ${E.status} ${E.statusText}`},response:{statusCode:E.status}}}class ie extends Error{static async fromResponse(L){const $=await he(L),A=$.response.statusCode||L.status,T=$.error.name||L.statusText,ee=`Request failed with ${A} ${T}`,Ie=V($.error);return new ie({message:ee,response:L,data:$,cause:Ie})}constructor(L){super(L.message),this.name="ResponseError",this.response=L.response,this.body=L.data,this.cause=L.cause}}},32838:function(jt,Fe,t){"use strict";t.d(Fe,{nW:function(){return ie},ae:function(){return Q},q3:function(){return D}});var h=t(25248);const n=(0,h.T0)({id:"core.scmauth"});var g=new WeakMap;class R{async getCredentials(L){const $=new URL(L.url),A=_class_private_field_get(this,g).find(T=>T.isUrlSupported($));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,g,{writable:!0,value:void 0}),_class_private_field_set(this,g,L)}}var V=new WeakMap,x=new WeakMap,l=new WeakMap,I=new WeakMap;class ne{static createDefaultApiFactory(){return createApiFactory({api:scmAuthApiRef,deps:{github:githubAuthApiRef,gitlab:gitlabAuthApiRef,azure:microsoftAuthApiRef,bitbucket:bitbucketAuthApiRef},factory:({github:L,gitlab:$,azure:A,bitbucket:T})=>ne.merge(ne.forGithub(L),ne.forGitlab($),ne.forAzure(A),ne.forBitbucket(T))})}static forAuthApi(L,$){return new ne("generic",L,$.host,$.scopeMapping)}static forGithub(L,$){var A;const T=(A=$==null?void 0:$.host)!==null&&A!==void 0?A:"github.com";return new ne("github",L,T,{default:["repo","read:org","read:user"],repoWrite:["gist"]})}static forGitlab(L,$){var A;const T=(A=$==null?void 0:$.host)!==null&&A!==void 0?A:"gitlab.com";return new ne("gitlab",L,T,{default:["read_user","read_api","read_repository"],repoWrite:["write_repository","api"]})}static forAzure(L,$){var A;const T=(A=$==null?void 0:$.host)!==null&&A!==void 0?A:"dev.azure.com";return new ne("azure",L,T,{default:["vso.build","vso.code","vso.graph","vso.project","vso.profile"],repoWrite:["vso.code_manage"]})}static forBitbucket(L,$){var A;const T=(A=$==null?void 0:$.host)!==null&&A!==void 0?A:"bitbucket.org";return new ne("bitbucket",L,T,{default:["account","team","pullrequest","snippet","issue"],repoWrite:["pullrequest:write","snippet:write","issue:write"]})}static merge(...L){return new R(L)}isUrlSupported(L){return L.host===_class_private_field_get(this,x)}getAdditionalScopesForProvider(L){var $;if(!(L!=null&&L.customScopes)||_class_private_field_get(this,I)==="generic")return[];var A;return(A=($=L.customScopes)===null||$===void 0?void 0:$[_class_private_field_get(this,I)])!==null&&A!==void 0?A:[]}async getCredentials(L){const{url:$,additionalScope:A,...T}=L,ee=_class_private_field_get(this,l).default.slice();A!=null&&A.repoWrite&&ee.push(..._class_private_field_get(this,l).repoWrite);const Ie=this.getAdditionalScopesForProvider(A);Ie.length&&ee.push(...Ie);const Je=[...new Set(ee)],Ze=await _class_private_field_get(this,V).getAccessToken(Je,T);return{token:Ze,headers:{Authorization:`Bearer ${Ze}`}}}constructor(L,$,A,T){_class_private_field_init(this,V,{writable:!0,value:void 0}),_class_private_field_init(this,x,{writable:!0,value:void 0}),_class_private_field_init(this,l,{writable:!0,value:void 0}),_class_private_field_init(this,I,{writable:!0,value:void 0}),_class_private_field_set(this,V,$),_class_private_field_set(this,x,A),_class_private_field_set(this,l,T),_class_private_field_set(this,I,L)}}var J=t(79158);class Q{static fromConfig(L){return J.Lx.fromConfig(L)}}const D=(0,h.T0)({id:"integration.scmintegrations"});var X=t(52322),_=t(73250),he=t(2784);const ie=E=>{const{type:L}=E,$=(0,h.qD)(),A=_.Z;var T;const ee=L&&(T=$.getSystemIcon(L))!==null&&T!==void 0?T:A;return(0,X.jsx)(ee,{})}},79158:function(jt,Fe,t){"use strict";t.d(Fe,{Lx:function(){return ir},BT:function(){return at}});var h=t(82717),n=t.n(h),g=t(76635);function R(C){const d=new URL("http://example.com");return d.host=C,d.host===C}function V(C){try{return new URL(C),!0}catch{return!1}}function x(C,d){return{list(){return C},byUrl(m){try{const w=typeof m=="string"?new URL(m):m;return C.find(Y=>d(Y)===w.host)}catch{return}},byHost(m){return C.find(w=>d(w)===m)}}}function l(C){const{url:d,base:m,lineNumber:w}=C;try{return new URL(d),d}catch{}let Y;if(d.startsWith("/")){const{filepath:fe}=n()(m);Y=new URL(m);const Se=(0,g.trimEnd)(Y.pathname.substring(0,Y.pathname.length-fe.length),"/");Y.pathname=`${Se}${d}`}else Y=new URL(d,m);return Y.search=new URL(m).search,w&&(Y.hash=`L${w}`),Y.toString()}const I="amazonaws.com";function ne(C){const d=C.getOptionalString("endpoint");var m;const w=(m=C.getOptionalBoolean("s3ForcePathStyle"))!==null&&m!==void 0?m:!1;let Y,fe;if(d){try{const on=new URL(d);Y=on.host,fe=on.pathname}catch{throw new Error(`invalid awsS3 integration config, endpoint '${d}' is not a valid URL`)}if(fe!=="/")throw new Error(`invalid awsS3 integration config, endpoints cannot contain path, got '${d}'`)}else Y=I;const Se=C.getOptionalString("accessKeyId"),$e=C.getOptionalString("secretAccessKey"),ft=C.getOptionalString("roleArn"),$t=C.getOptionalString("externalId");return{host:Y,endpoint:d,s3ForcePathStyle:w,accessKeyId:Se,secretAccessKey:$e,roleArn:ft,externalId:$t}}function J(C){const d=C.map(ne);return d.some(m=>m.host===I)||d.push({host:I}),d}class Q{get type(){return"awsS3"}get title(){return this.integrationConfig.host}get config(){return this.integrationConfig}resolveUrl(d){return l(d)}resolveEditUrl(d){return d}constructor(d){this.integrationConfig=d}}Q.factory=({config:C})=>{var d;const m=J((d=C.getOptionalConfigArray("integrations.awsS3"))!==null&&d!==void 0?d:[]);return x(m.map(w=>new Q(w)),w=>w.config.host)};var D=t(90383),X=t(22504),_=t(69866);const he="GB";var ie=new WeakMap,E=new WeakMap,L=new WeakMap,$=new WeakMap,A=new WeakMap,T=new WeakMap,ee=new WeakMap;class Ie{static fromRepoUrl(d){const m=new URL(d);let w,Y,fe;const Se=m.pathname.split("/").map(zn=>decodeURIComponent(zn));if(Se[2]==="_git"?(w=Se[1],Y=fe=Se[3]):Se[3]==="_git"?(w=Se[1],Y=Se[2],fe=Se[4]):Se[4]==="_git"&&(w=`${Se[1]}/${Se[2]}`,Y=Se[3],fe=Se[5]),!w||!Y||!fe)throw new Error("Azure URL must point to a git repository");var $e;const ft=($e=m.searchParams.get("path"))!==null&&$e!==void 0?$e:void 0;let $t;const on=m.searchParams.get("version");if(on){if(on.slice(0,2)!=="GB")throw new Error("Azure URL version must point to a git branch");$t=on.slice(2)}return new Ie(m.origin,w,Y,fe,ft,$t)}toRepoUrl(){let d;return(0,D.Z)(this,L)===(0,D.Z)(this,$)?d=(0,D.Z)(this,ee).call(this,(0,D.Z)(this,E),"_git",(0,D.Z)(this,$)):d=(0,D.Z)(this,ee).call(this,(0,D.Z)(this,E),(0,D.Z)(this,L),"_git",(0,D.Z)(this,$)),(0,D.Z)(this,A)&&d.searchParams.set("path",(0,D.Z)(this,A)),(0,D.Z)(this,T)&&d.searchParams.set("version",he+(0,D.Z)(this,T)),d.toString()}toFileUrl(){if(!(0,D.Z)(this,A))throw new Error("Azure URL must point to a specific path to be able to download a file");const d=(0,D.Z)(this,ee).call(this,(0,D.Z)(this,E),(0,D.Z)(this,L),"_apis","git","repositories",(0,D.Z)(this,$),"items");return d.searchParams.set("api-version","6.0"),d.searchParams.set("path",(0,D.Z)(this,A)),(0,D.Z)(this,T)&&d.searchParams.set("version",(0,D.Z)(this,T)),d.toString()}toArchiveUrl(){const d=(0,D.Z)(this,ee).call(this,(0,D.Z)(this,E),(0,D.Z)(this,L),"_apis","git","repositories",(0,D.Z)(this,$),"items");return d.searchParams.set("recursionLevel","full"),d.searchParams.set("download","true"),d.searchParams.set("api-version","6.0"),(0,D.Z)(this,A)&&d.searchParams.set("scopePath",(0,D.Z)(this,A)),(0,D.Z)(this,T)&&d.searchParams.set("version",(0,D.Z)(this,T)),d.toString()}toCommitsUrl(){const d=(0,D.Z)(this,ee).call(this,(0,D.Z)(this,E),(0,D.Z)(this,L),"_apis","git","repositories",(0,D.Z)(this,$),"commits");return d.searchParams.set("api-version","6.0"),(0,D.Z)(this,T)&&d.searchParams.set("searchCriteria.itemVersion.version",(0,D.Z)(this,T)),d.toString()}getOwner(){return(0,D.Z)(this,E)}getProject(){return(0,D.Z)(this,L)}getRepo(){return(0,D.Z)(this,$)}getPath(){return(0,D.Z)(this,A)}getRef(){return(0,D.Z)(this,T)}constructor(d,m,w,Y,fe,Se){(0,X.Z)(this,ie,{writable:!0,value:void 0}),(0,X.Z)(this,E,{writable:!0,value:void 0}),(0,X.Z)(this,L,{writable:!0,value:void 0}),(0,X.Z)(this,$,{writable:!0,value:void 0}),(0,X.Z)(this,A,{writable:!0,value:void 0}),(0,X.Z)(this,T,{writable:!0,value:void 0}),(0,X.Z)(this,ee,{writable:!0,value:(...$e)=>{const ft=new URL((0,D.Z)(this,ie));return ft.pathname=$e.map($t=>encodeURIComponent($t)).join("/"),ft}}),(0,_.Z)(this,ie,d),(0,_.Z)(this,E,m),(0,_.Z)(this,L,w),(0,_.Z)(this,$,Y),(0,_.Z)(this,A,fe),(0,_.Z)(this,T,Se)}}const Je="dev.azure.com";function Ze(C){var d;const m=(d=C.getOptionalString("host"))!==null&&d!==void 0?d:Je,w=C.getOptionalString("token");if(!R(m))throw new Error(`Invalid Azure integration config, '${m}' is not a valid host`);return{host:m,token:w}}function je(C){const d=C.map(Ze);return d.some(m=>m.host===Je)||d.push({host:Je}),d}class We{get type(){return"azure"}get title(){return this.integrationConfig.host}get config(){return this.integrationConfig}resolveUrl(d){const{url:m,base:w}=d;if(V(m))return m;try{const fe=Ie.fromRepoUrl(w),Se=new URL(w);var Y;const $e=new URL(`https://a.com${(Y=fe.getPath())!==null&&Y!==void 0?Y:""}`),ft=new URL(m,$e).pathname;return Se.searchParams.set("path",ft),d.lineNumber&&(Se.searchParams.set("line",String(d.lineNumber)),Se.searchParams.set("lineEnd",String(d.lineNumber+1)),Se.searchParams.set("lineStartColumn","1"),Se.searchParams.set("lineEndColumn","1")),Se.toString()}catch{return new URL(m,w).toString()}}resolveEditUrl(d){return d}constructor(d){this.integrationConfig=d}}We.factory=({config:C})=>{var d;const m=je((d=C.getOptionalConfigArray("integrations.azure"))!==null&&d!==void 0?d:[]);return x(m.map(w=>new We(w)),w=>w.config.host)};var gt=t(48834).lW;function nt(C){return AzureUrl.fromRepoUrl(C).toFileUrl()}function Me(C){return AzureUrl.fromRepoUrl(C).toArchiveUrl()}function ze(C){return AzureUrl.fromRepoUrl(C).toCommitsUrl()}function Qe(C,d){const m=d?{...d}:{};if(C.token){const w=gt.from(`:${C.token}`,"utf8");m.Authorization=`Basic ${w.toString("base64")}`}return{headers:m}}const rt="bitbucket.org",ct="https://api.bitbucket.org/2.0";function lt(C){var d;const m=(d=C.getOptionalString("host"))!==null&&d!==void 0?d:rt;let w=C.getOptionalString("apiBaseUrl");const Y=C.getOptionalString("token"),fe=C.getOptionalString("username"),Se=C.getOptionalString("appPassword");if(!R(m))throw new Error(`Invalid Bitbucket integration config, '${m}' is not a valid host`);return w?w=(0,g.trimEnd)(w,"/"):m===rt?w=ct:w=`https://${m}/rest/api/1.0`,{host:m,apiBaseUrl:w,token:Y,username:fe,appPassword:Se}}function mt(C){const d=C.map(lt);return d.some(m=>m.host===rt)||d.push({host:rt,apiBaseUrl:ct}),d}class vt{get type(){return"bitbucket"}get title(){return this.integrationConfig.host}get config(){return this.integrationConfig}resolveUrl(d){const m=l(d);if(!d.lineNumber)return m;const w=new URL(m);return this.integrationConfig.host==="bitbucket.org"?w.hash=`lines-${d.lineNumber}`:w.hash=`${d.lineNumber}`,w.toString()}resolveEditUrl(d){const m=n()(d),w=new URL(d);return w.searchParams.set("mode","edit"),w.searchParams.set("spa","0"),w.searchParams.set("at",m.ref),w.toString()}constructor(d){this.integrationConfig=d}}vt.factory=({config:C})=>{var d,m,w;const Y=mt((w=C.getOptionalConfigArray("integrations.bitbucket"))!==null&&w!==void 0?w:[...(d=C.getOptionalConfigArray("integrations.bitbucketCloud"))!==null&&d!==void 0?d:[],...(m=C.getOptionalConfigArray("integrations.bitbucketServer"))!==null&&m!==void 0?m:[]]);return x(Y.map(fe=>new vt(fe)),fe=>fe.config.host)};var Ge=t(96279),re=t(48834).lW;async function Re(C,d){const{name:m,owner:w,resource:Y}=parseGitUrl(C),fe=Y==="bitbucket.org";let Se=fe?`${d.apiBaseUrl}/repositories/${w}/${m}`:`${d.apiBaseUrl}/projects/${w}/repos/${m}/default-branch`,$e=await fetch(Se,yt(d));if($e.status===404&&!fe&&(Se=`${d.apiBaseUrl}/projects/${w}/repos/${m}/branches/default`,$e=await fetch(Se,yt(d))),!$e.ok){const $t=`Failed to retrieve default branch from ${Se}, ${$e.status} ${$e.statusText}`;throw new Error($t)}let ft;if(fe)ft=(await $e.json()).mainbranch.name;else{const{displayId:$t}=await $e.json();ft=$t}if(!ft)throw new Error(`Failed to read default branch from ${Se}. Response ${$e.status} ${$e.json()}`);return ft}async function Pe(C,d){const{name:m,owner:w,ref:Y,protocol:fe,resource:Se,filepath:$e}=parseGitUrl(C),ft=Se==="bitbucket.org";let $t=Y;$t||($t=await Re(C,d));const on=$e?`&path=${encodeURIComponent(decodeURIComponent($e))}`:"";return ft?`${fe}://${Se}/${w}/${m}/get/${$t}.tar.gz`:`${d.apiBaseUrl}/projects/${w}/repos/${m}/archive?format=tgz&at=${$t}&prefix=${w}-${m}${on}`}function it(C,d){try{const{owner:m,name:w,ref:Y,filepathtype:fe,filepath:Se}=parseGitUrl(C);if(!m||!w||fe!=="browse"&&fe!=="raw"&&fe!=="src")throw new Error("Invalid Bitbucket URL or file path");const $e=Se.replace(/^\//,"");if(d.host==="bitbucket.org"){if(!Y)throw new Error("Invalid Bitbucket URL or file path");return`${d.apiBaseUrl}/repositories/${m}/${w}/src/${Y}/${$e}`}return`${d.apiBaseUrl}/projects/${m}/repos/${w}/raw/${$e}?at=${Y}`}catch(m){throw new Error(`Incorrect URL: ${C}, ${m}`)}}function yt(C){const d={};if(C.token)d.Authorization=`Bearer ${C.token}`;else if(C.username&&C.appPassword){const m=re.from(`${C.username}:${C.appPassword}`,"utf8");d.Authorization=`Basic ${m.toString("base64")}`}return{headers:d}}const At="bitbucket.org",pt="https://api.bitbucket.org/2.0";function Ct(C){const d=At,m=pt,w=C.getString("username"),Y=C.getString("appPassword");return{host:d,apiBaseUrl:m,username:w,appPassword:Y}}function Pt(C){const d=C.map(Ct);return d.length===0&&d.push({host:At,apiBaseUrl:pt}),d}class kt{get type(){return"bitbucketCloud"}get title(){return this.integrationConfig.host}get config(){return this.integrationConfig}resolveUrl(d){const m=l(d);if(d.lineNumber){const w=new URL(m);return w.hash=`lines-${d.lineNumber}`,w.toString()}return m}resolveEditUrl(d){const m=n()(d),w=new URL(d);return w.searchParams.set("mode","edit"),w.searchParams.set("at",m.ref),w.toString()}constructor(d){this.integrationConfig=d}}kt.factory=({config:C})=>{var d;const m=Pt((d=C.getOptionalConfigArray("integrations.bitbucketCloud"))!==null&&d!==void 0?d:[]);return x(m.map(w=>new kt(w)),w=>w.config.host)};var en=t(48834).lW;async function sn(C,d){const{name:m,owner:w}=parseGitUrl(C),Y=`${d.apiBaseUrl}/repositories/${w}/${m}`,fe=await fetch(Y,fn(d));if(!fe.ok){const ft=`Failed to retrieve default branch from ${Y}, ${fe.status} ${fe.statusText}`;throw new Error(ft)}const $e=(await fe.json()).mainbranch.name;if(!$e)throw new Error(`Failed to read default branch from ${Y}. Response ${fe.status} ${fe.json()}`);return $e}async function Ht(C,d){const{name:m,owner:w,ref:Y,protocol:fe,resource:Se}=parseGitUrl(C);let $e=Y;return $e||($e=await sn(C,d)),`${fe}://${Se}/${w}/${m}/get/${$e}.tar.gz`}function Gt(C,d){try{const{owner:m,name:w,ref:Y,filepathtype:fe,filepath:Se}=parseGitUrl(C);if(!m||!w||fe!=="src"&&fe!=="raw")throw new Error("Invalid Bitbucket Cloud URL or file path");const $e=Se.replace(/^\//,"");if(!Y)throw new Error("Invalid Bitbucket Cloud URL or file path");return`${d.apiBaseUrl}/repositories/${m}/${w}/src/${Y}/${$e}`}catch(m){throw new Error(`Incorrect URL: ${C}, ${m}`)}}function fn(C){const d={};if(C.username&&C.appPassword){const m=en.from(`${C.username}:${C.appPassword}`,"utf8");d.Authorization=`Basic ${m.toString("base64")}`}return{headers:d}}function _t(C){const d=C.getString("host");let m=C.getOptionalString("apiBaseUrl");const w=C.getOptionalString("token"),Y=C.getOptionalString("username"),fe=C.getOptionalString("password");if(!R(d))throw new Error(`Invalid Bitbucket Server integration config, '${d}' is not a valid host`);return m?m=(0,g.trimEnd)(m,"/"):m=`https://${d}/rest/api/1.0`,{host:d,apiBaseUrl:m,token:w,username:Y,password:fe}}function Zn(C){return C.map(_t)}class ln{get type(){return"bitbucketServer"}get title(){return this.integrationConfig.host}get config(){return this.integrationConfig}resolveUrl(d){const m=l(d);if(d.lineNumber){const w=new URL(m);return w.hash=d.lineNumber.toString(),w.toString()}return m}resolveEditUrl(d){return d.includes("?")?d.substring(0,d.indexOf("?")):d}constructor(d){this.integrationConfig=d}}ln.factory=({config:C})=>{var d;const m=Zn((d=C.getOptionalConfigArray("integrations.bitbucketServer"))!==null&&d!==void 0?d:[]);return x(m.map(w=>new ln(w)),w=>w.config.host)};var Dn=t(48834).lW;async function gn(C,d){const{name:m,owner:w}=parseGitUrl(C);let Y=`${d.apiBaseUrl}/projects/${w}/repos/${m}/default-branch`,fe=await fetch(Y,In(d));if(fe.status===404&&(Y=`${d.apiBaseUrl}/projects/${w}/repos/${m}/branches/default`,fe=await fetch(Y,In(d))),!fe.ok){const ft=`Failed to retrieve default branch from ${Y}, ${fe.status} ${fe.statusText}`;throw new Error(ft)}const{displayId:Se}=await fe.json(),$e=Se;if(!$e)throw new Error(`Failed to read default branch from ${Y}. Response ${fe.status} ${fe.json()}`);return $e}async function Jn(C,d){const{name:m,owner:w,ref:Y,filepath:fe}=parseGitUrl(C);let Se=Y;Se||(Se=await gn(C,d));const $e=fe?`&path=${encodeURIComponent(decodeURIComponent(fe))}`:"";return`${d.apiBaseUrl}/projects/${w}/repos/${m}/archive?format=tgz&at=${Se}&prefix=${w}-${m}${$e}`}function Kt(C,d){try{const{owner:m,name:w,ref:Y,filepathtype:fe,filepath:Se}=parseGitUrl(C);if(!m||!w||fe!=="browse"&&fe!=="raw"&&fe!=="src")throw new Error("Invalid Bitbucket Server URL or file path");const $e=Se.replace(/^\//,"");return`${d.apiBaseUrl}/projects/${m}/repos/${w}/raw/${$e}?at=${Y}`}catch(m){throw new Error(`Incorrect URL: ${C}, ${m}`)}}function In(C){const d={};if(C.token)d.Authorization=`Bearer ${C.token}`;else if(C.username&&C.password){const m=Dn.from(`${C.username}:${C.password}`,"utf8");d.Authorization=`Basic ${m.toString("base64")}`}return{headers:d}}function Nn(C){const d=C.getString("host");let m=C.getOptionalString("baseUrl"),w=C.getOptionalString("cloneUrl"),Y=C.getOptionalString("gitilesBaseUrl");const fe=C.getOptionalString("username"),Se=C.getOptionalString("password");if(R(d)){if(m&&!V(m))throw new Error(`Invalid Gerrit integration config, '${m}' is not a valid baseUrl`);if(w&&!V(w))throw new Error(`Invalid Gerrit integration config, '${w}' is not a valid cloneUrl`);if(Y&&!V(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 m?m=(0,g.trimEnd)(m,"/"):m=`https://${d}`,Y?Y=(0,g.trimEnd)(Y,"/"):Y=`https://${d}`,w?w=(0,g.trimEnd)(w,"/"):w=m,{host:d,baseUrl:m,cloneUrl:w,gitilesBaseUrl:Y,username:fe,password:Se}}function Yt(C){return C.map(Nn)}var mn=t(48834).lW;const cn=")]}'";function Rn(C,d){const w=d.replace(C.gitilesBaseUrl,"").split("/").filter($t=>!!$t),Y=w.indexOf("+");if(Y<=0)throw new Error(`Unable to parse project from url: ${d}`);const fe=(0,g.trimStart)(w.slice(0,Y).join("/"),"/"),Se=w.indexOf("heads");if(Se<=0)throw new Error(`Unable to parse branch from url: ${d}`);const $e=w[Se+1],ft=w.slice(Se+2).join("/");return{branch:$e,filePath:ft===""?"/":ft,project:fe}}function Fn(C,d,m,w){return`${C.gitilesBaseUrl}/${d}/+/refs/heads/${m}/${(0,g.trimStart)(w,"/")}`}function Cn(C){return C.password?"/a/":"/"}function ge(C,d){const{branch:m,project:w}=Rn(C,d);return`${C.baseUrl}${Cn(C)}projects/${encodeURIComponent(w)}/branches/${m}`}function te(C,d){const{project:m}=Rn(C,d);return`${C.cloneUrl}${Cn(C)}${m}`}function Ee(C,d){const{branch:m,filePath:w,project:Y}=Rn(C,d);return`${C.baseUrl}${Cn(C)}projects/${encodeURIComponent(Y)}/branches/${m}/files/${encodeURIComponent(w)}/content`}function De(C){return`${C.baseUrl}${Cn(C)}projects/`}function qe(C){const d={};if(!C.password)return d;const m=mn.from(`${C.username}:${C.password}`,"utf8");return d.Authorization=`Basic ${m.toString("base64")}`,{headers:d}}async function xt(C){const d=await C.text();if(d.startsWith(cn))try{return JSON.parse(d.slice(cn.length))}catch(m){throw new Error(`Invalid response from Gerrit: ${d.slice(0,10)} - ${m}`)}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:m,base:w,lineNumber:Y}=d;let fe;if(m.startsWith("/")){const{branch:Se,project:$e}=Rn(this.config,w);return Fn(this.config,$e,Se,m)}return m?fe=new URL(m,w):fe=new URL(w),Y&&(fe.hash=Y.toString()),fe.toString()}resolveEditUrl(d){return d}constructor(d){this.integrationConfig=d}}ae.factory=({config:C})=>{var d;const m=Yt((d=C.getOptionalConfigArray("integrations.gerrit"))!==null&&d!==void 0?d:[]);return x(m.map(w=>new ae(w)),w=>w.config.host)};function P(C){const d=C.getString("host");let m=C.getOptionalString("baseUrl");const w=C.getOptionalString("username"),Y=C.getOptionalString("password");if(!R(d))throw new Error(`Invalid Gitea integration config, '${d}' is not a valid host`);return m?m=(0,g.trimEnd)(m,"/"):m=`https://${d}`,{host:d,baseUrl:m,username:w,password:Y}}var q=t(48834).lW;function Ke(C,d){try{var m;const w=(m=C.baseUrl)!==null&&m!==void 0?m:`https://${C.host}`,[Y,fe,Se,$e,ft,$t,...on]=d.replace(w,"").split("/"),zn=on.join("/").replace(/^\//,"");return`${w}/${fe}/${Se}/_edit/${$t}/${zn}`}catch(w){throw new Error(`Incorrect URL: ${d}, ${w}`)}}function U(C,d){try{var m;const w=(m=C.baseUrl)!==null&&m!==void 0?m:`https://${C.host}`,[Y,fe,Se,$e,ft,$t,...on]=d.replace(w,"").split("/"),zn=on.join("/").replace(/^\//,"");return`${w}/api/v1/repos/${fe}/${Se}/contents/${zn}?ref=${$t}`}catch(w){throw new Error(`Incorrect URL: ${d}, ${w}`)}}function Z(C){const d={},{username:m,password:w}=C;return w?(m?d.Authorization=`basic ${q.from(`${m}:${w}`).toString("base64")}`:d.Authorization=`token ${w}`,{headers:d}):d}class ce{get type(){return"gitea"}get title(){return this.config.host}resolveUrl(d){return l(d)}resolveEditUrl(d){return Ke(this.config,d)}constructor(d){this.config=d}}ce.factory=({config:C})=>{var d;const w=((d=C.getOptionalConfigArray("integrations.gitea"))!==null&&d!==void 0?d:[]).map(Y=>P(Y));return x(w.map(Y=>new ce(Y)),Y=>Y.config.host)};const pe="github.com",be="https://api.github.com",Be="https://raw.githubusercontent.com";function Oe(C){var d,m;const w=(m=C.getOptionalString("host"))!==null&&m!==void 0?m:pe;let Y=C.getOptionalString("apiBaseUrl"),fe=C.getOptionalString("rawBaseUrl");const Se=C.getOptionalString("token"),$e=(d=C.getOptionalConfigArray("apps"))===null||d===void 0?void 0:d.map(ft=>({appId:ft.getNumber("appId"),clientId:ft.getString("clientId"),clientSecret:ft.getString("clientSecret"),webhookSecret:ft.getString("webhookSecret"),privateKey:ft.getString("privateKey"),allowedInstallationOwners:ft.getOptionalStringArray("allowedInstallationOwners")}));if(!R(w))throw new Error(`Invalid GitHub integration config, '${w}' is not a valid host`);return Y?Y=(0,g.trimEnd)(Y,"/"):w===pe&&(Y=be),fe?fe=(0,g.trimEnd)(fe,"/"):w===pe&&(fe=Be),{host:w,apiBaseUrl:Y,rawBaseUrl:fe,token:Se,apps:$e}}function He(C){const d=C.map(Oe);return d.some(m=>m.host===pe)||d.push({host:pe,apiBaseUrl:be,rawBaseUrl:Be}),d}function st(C,d,m){try{const{owner:w,name:Y,ref:fe,filepathtype:Se,filepath:$e}=parseGitUrl(C);if(!w||!Y||!fe||Se!=="blob"&&Se!=="raw"&&Se!=="tree")throw new Error("Invalid GitHub URL or file path");const ft=$e.replace(/^\//,"");return H(d,m)==="api"?`${d.apiBaseUrl}/repos/${w}/${Y}/contents/${ft}?ref=${fe}`:`${d.rawBaseUrl}/${w}/${Y}/${fe}/${ft}`}catch(w){throw new Error(`Incorrect URL: ${C}, ${w}`)}}function S(C,d){const m={};return H(C,d)==="api"&&(m.Accept="application/vnd.github.v3.raw"),d.token&&(m.Authorization=`token ${d.token}`),{headers:m}}function H(C,d){return C.apiBaseUrl&&(d.token||!C.rawBaseUrl)?"api":"raw"}var me=t(42822),ue=t(89393),Ce=t(26228);class ke{async getOrCreateToken(d,m,w){let Y=this.tokenCache.get(d);if((!Y||this.isExpired(Y.expiresAt))&&(Y=await w(),Y.expiresAt=Y.expiresAt.minus({minutes:10}),this.tokenCache.set(d,Y)),!this.appliesToRepo(Y,m))throw new Error(`The Backstage GitHub application used in the ${d} organization does not have access to a repository with the name ${m}`);return{accessToken:Y.token}}appliesToRepo(d,m){return m===void 0?!0:d.repositories!==void 0?d.repositories.includes(m):!0}constructor(){this.tokenCache=new Map,this.isExpired=d=>Ce.ou.local()>d}}const Ne={Accept:"application/vnd.github.machine-man-preview+json"};class ot{async getInstallationCredentials(d,m){if(this.allowedInstallationOwners){var w;if(!(!((w=this.allowedInstallationOwners)===null||w===void 0)&&w.includes(d)))return{accessToken:void 0}}return this.cache.getOrCreateToken(d,m,async()=>{const{installationId:Y,suspended:fe}=await this.getInstallationData(d);if(fe)throw new Error(`The GitHub application for ${d} is suspended`);const Se=await this.appClient.apps.createInstallationAccessToken({installation_id:Y,headers:Ne});let $e;if(Se.data.repository_selection==="selected"){const $t=new ue.v({baseUrl:this.baseUrl,auth:Se.data.token}),on=await $t.paginate($t.apps.listReposAccessibleToInstallation);var ft;$e=((ft=on.repositories)!==null&&ft!==void 0?ft:on).map($r=>$r.name)}return{token:Se.data.token,expiresAt:Ce.ou.fromISO(Se.data.expires_at),repositories:$e}})}getInstallations(){return this.appClient.paginate(this.appClient.apps.listInstallations)}async getInstallationData(d){const w=(await this.getInstallations()).find(fe=>{var Se,$e;return((Se=fe.account)===null||Se===void 0||($e=Se.login)===null||$e===void 0?void 0:$e.toLocaleLowerCase("en-US"))===d.toLocaleLowerCase("en-US")});if(w)return{installationId:w.id,suspended:Boolean(w.suspended_by)};const Y=new Error(`No app installation found for ${d} in ${this.baseAuthConfig.appId}`);throw Y.name="NotFoundError",Y}constructor(d,m){this.cache=new ke,this.allowedInstallationOwners=d.allowedInstallationOwners,this.baseUrl=m,this.baseAuthConfig={appId:d.appId,privateKey:d.privateKey.replace(/\\n/gm,`
33
- `)},this.appClient=new ue.v({baseUrl:m,headers:Ne,authStrategy:me.i,auth:this.baseAuthConfig})}}class ht{async getAllInstallations(){return this.apps.length?(await Promise.all(this.apps.map(m=>m.getInstallations()))).flat():[]}async getAppToken(d,m){if(this.apps.length===0)return;const w=await Promise.all(this.apps.map($e=>$e.getInstallationCredentials(d,m).then(ft=>({credentials:ft,error:void 0}),ft=>({credentials:void 0,error:ft})))),Y=w.find($e=>$e.credentials);if(Y)return Y.credentials.accessToken;const Se=w.map($e=>$e.error).find($e=>$e.name!=="NotFoundError");if(Se)throw Se}constructor(d){var m,w;this.apps=(w=(m=d.apps)===null||m===void 0?void 0:m.map(Y=>new ot(Y,d.apiBaseUrl)))!==null&&w!==void 0?w:[]}}class ut{async getCredentials(d){const m=n()(d.url),w=m.owner||m.name,Y=m.owner?m.name:void 0;let fe="app",Se=await this.githubAppCredentialsMux.getAppToken(w,Y);return Se||(fe="token",Se=this.token),{headers:Se?{Authorization:`Bearer ${Se}`}:void 0,token:Se,type:fe}}constructor(d,m){this.githubAppCredentialsMux=d,this.token=m}}ut.create=C=>new ut(new ht(C),C.token);class et{static fromIntegrations(d){const m=new Map;return d.github.list().forEach(w=>{const Y=SingleInstanceGithubCredentialsProvider.create(w.config);m.set(w.config.host,Y)}),new et(m)}async getCredentials(d){const m=new URL(d.url),w=this.providers.get(m.host);if(!w)throw new Error(`There is no GitHub integration that matches ${d.url}. Please add a configuration for an integration.`);return w.getCredentials(d)}constructor(d){this.providers=d}}class St{get type(){return"github"}get title(){return this.integrationConfig.host}get config(){return this.integrationConfig}resolveUrl(d){return at(l(d),"tree")}resolveEditUrl(d){return at(d,"edit")}constructor(d){this.integrationConfig=d}}St.factory=({config:C})=>{var d;const m=He((d=C.getOptionalConfigArray("integrations.github"))!==null&&d!==void 0?d:[]);return x(m.map(w=>new St(w)),w=>w.config.host)};function at(C,d){return C.replace(/\/\/([^/]+)\/([^/]+)\/([^/]+)\/(blob|tree|edit)\//,(m,w,Y,fe)=>`//${w}/${Y}/${fe}/${d}/`)}const Tt=null;class Bt extends St{get config(){return super.config}constructor(d){super(d)}}Bt.factory=St.factory;const Nt=null,vn=null,Gn=null,wn="gitlab.com",Ut="https://gitlab.com/api/v4";function Ft(C){const d=C.getString("host");let m=C.getOptionalString("apiBaseUrl");const w=C.getOptionalString("token");let Y=C.getOptionalString("baseUrl");if(m?m=(0,g.trimEnd)(m,"/"):d===wn&&(m=Ut),Y?Y=(0,g.trimEnd)(Y,"/"):Y=`https://${d}`,R(d)){if(!m||!V(m))throw new Error(`Invalid GitLab integration config, '${m}' is not a valid apiBaseUrl`);if(!V(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:w,apiBaseUrl:m,baseUrl:Y}}function dn(C){const d=C.map(Ft);return d.some(m=>m.host===wn)||d.push({host:wn,apiBaseUrl:Ut,baseUrl:`https://${wn}`}),d}function yn(C){let d="";return C.host!==wn&&(d=new URL(C.baseUrl).pathname),trimEnd(d,"/")}async function Mn(C,d){const m=await xn(C,d);return Un(C,m,d).toString()}function jn(C){const{token:d=""}=C;return{headers:{"PRIVATE-TOKEN":d}}}function Un(C,d,m){try{const w=new URL(C),Y=w.pathname.split("/blob/").slice(1).join("/blob/"),[fe,...Se]=Y.split("/"),$e=getGitLabIntegrationRelativePath(m);return w.pathname=[...$e?[$e]:[],"api/v4/projects",d,"repository/files",encodeURIComponent(decodeURIComponent(Se.join("/"))),"raw"].join("/"),w.search=`?ref=${fe}`,w}catch(w){throw new Error(`Incorrect url: ${C}, ${w}`)}}async function xn(C,d){const m=new URL(C);if(!m.pathname.includes("/blob/"))throw new Error("Please provide full path to yaml file from GitLab");try{let w=m.pathname.split("/-/blob/")[0].split("/blob/")[0];const Y=getGitLabIntegrationRelativePath(d);Y&&(w=w.replace(Y,""));const fe=new URL(`${m.origin}${Y}/api/v4/projects/${encodeURIComponent(w.replace(/^\//,""))}`),Se=await fetch(fe.toString(),jn(d)),$e=await Se.json();if(!Se.ok)throw new Error(`GitLab Error '${$e.error}', ${$e.error_description}`);return Number($e.id)}catch(w){throw new Error(`Could not get GitLab project ID for: ${C}, ${w}`)}}class tn{get type(){return"gitlab"}get title(){return this.integrationConfig.host}get config(){return this.integrationConfig}resolveUrl(d){return l(d)}resolveEditUrl(d){return En(d,"edit")}constructor(d){this.integrationConfig=d}}tn.factory=({config:C})=>{var d;const m=dn((d=C.getOptionalConfigArray("integrations.gitlab"))!==null&&d!==void 0?d:[]);return x(m.map(w=>new tn(w)),w=>w.config.host)};function En(C,d){return C.replace(/\/\-\/(blob|tree|edit)\//,`/-/${d}/`)}class ir{static fromConfig(d){return new ir({awsS3:Q.factory({config:d}),azure:We.factory({config:d}),bitbucket:vt.factory({config:d}),bitbucketCloud:kt.factory({config:d}),bitbucketServer:ln.factory({config:d}),gerrit:ae.factory({config:d}),github:St.factory({config:d}),gitlab:tn.factory({config:d}),gitea:ce.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 m=Object.values(this.byType).map(w=>w.byUrl(d)).filter(Boolean);if(m.length>1){const w=m.filter(Y=>!(Y instanceof vt));w.length!==0&&(m=w)}return m[0]}byHost(d){return Object.values(this.byType).map(m=>m.byHost(d)).find(Boolean)}resolveUrl(d){const m=this.byUrl(d.base);return m?m.resolveUrl(d):l(d)}resolveEditUrl(d){const m=this.byUrl(d);return m?m.resolveEditUrl(d):d}constructor(d){this.byType=d}}},96215:function(jt,Fe,t){"use strict";var h={};t.r(h),t.d(h,{TechDocsPlugin:function(){return T.s4}});var n=t(52322),g=t(2784),R=t(28316),V=t(10289),x=t(25248);const l=(0,x.T0)({id:"plugin.techdocs.storageservice"}),I=(0,x.T0)({id:"plugin.techdocs.service"});var ne=t(92077),J=t(95481),Q=t(7476),D=t(93225),X=t(67896),_=t(65124),he=t(17339),ie=t(85478),E=t(68435),L=t(3482),$=t(42081),A=t(48431),T=t(89258),ee=t(52943),Ie=t(61886),Je=t(13980),Ze=t.n(Je);class je{get(r){for(const o of this.holders){const c=o.get(r);if(c)return c}}constructor(...r){this.holders=r}}var We=t(51837);const gt=(0,We.CT)("api-context"),nt=a=>{var r;const{apis:o,children:c}=a,f=(r=(0,g.useContext)(gt))===null||r===void 0?void 0:r.atVersion(1),O=f?new je(o,f):o;return(0,n.jsx)(gt.Provider,{value:(0,We.EI)({1:O}),children:c})};nt.propTypes={apis:Ze().shape({get:Ze().func.isRequired}).isRequired,children:Ze().node};class Me{static validateFactories(r,o){for(const c of o){const f=[c],O=new Set;for(;f.length;){const M=f.shift(),z=r.get(M);if(!!z)for(const se of Object.values(z.deps)){if(se.id===c.id)throw new Error(`Circular dependency of api factory for ${c}`);O.has(se)||(O.add(se),f.push(se))}}}}get(r){return this.load(r)}load(r,o=[]){const c=this.apis.get(r.id);if(c)return c;const f=this.factories.get(r);if(!f)return;if(o.includes(f.api))throw new Error(`Circular dependency of api factory for ${f.api}`);const O=this.loadDeps(r,f.deps,[...o,f.api]),M=f.factory(O);return this.apis.set(r.id,M),M}loadDeps(r,o,c){const f={};for(const O in o)if(o.hasOwnProperty(O)){const M=o[O],z=this.load(M,c);if(!z)throw new Error(`No API factory available for dependency ${M} of dependent ${r}`);f[O]=z}return f}constructor(r){this.factories=r,this.apis=new Map}}var ze;(function(a){a[a.default=10]="default",a[a.app=50]="app",a[a.static=100]="static"})(ze||(ze={}));class Qe{register(r,o){const c=ze[r],f=this.factories.get(o.api.id);return f&&f.priority>=c?!1:(this.factories.set(o.api.id,{priority:c,factory:o}),!0)}get(r){const o=this.factories.get(r.id);if(!!o)return o.factory}getAllApis(){const r=new Set;for(const{factory:o}of this.factories.values())r.add(o.api);return r}constructor(){this.factories=new Map}}function rt(a){return new Promise((r,o)=>{const c=a.width||500,f=a.height||700,O=window.screen.width/2-c/2,M=window.screen.height/2-f/2,z=window.open(a.url,a.name,`menubar=no,location=no,resizable=no,scrollbars=no,status=no,width=${c},height=${f},top=${M},left=${O}`);let se="";if(!z||typeof z.closed=="undefined"||z.closed){const dt=new Error("Failed to open auth popup.");dt.name="PopupRejectedError",o(dt);return}const Ve=dt=>{if(dt.source!==z||dt.origin!==a.origin)return;const{data:It}=dt;if(It.type==="config_info"){se=It.targetOrigin;return}if(It.type!=="authorization_response")return;const Dt=It;if("error"in Dt){const Mt=new Error(Dt.error.message);Mt.name=Dt.error.name,o(Mt)}else r(Dt.response);wt()},Ue=setInterval(()=>{if(z.closed){const dt=`Login failed, ${se&&se!==window.location.origin?`Incorrect app origin, expected ${se}`:"popup was closed"}`,It=new Error(dt);It.name="PopupClosedError",o(It),wt()}},100);function wt(){window.removeEventListener("message",Ve),clearInterval(Ue)}window.addEventListener("message",Ve)})}function ct(a){return[...a].join(" ")}class lt{async createSession(r){return r.instantPopup?this.showPopup(r.scopes):this.authRequester(r.scopes)}async refreshSession(){const r=await fetch(await this.buildUrl("/refresh",{optional:!0}),{headers:{"x-requested-with":"XMLHttpRequest"},credentials:"include"}).catch(c=>{throw new Error(`Auth refresh request failed, ${c}`)});if(!r.ok){const c=new Error(`Auth refresh request failed, ${r.statusText}`);throw c.status=r.status,c}const o=await r.json();if(o.error){const c=new Error(o.error.message);throw o.error.name&&(c.name=o.error.name),c}return await this.sessionTransform(o)}async removeSession(){const r=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(!r.ok){const o=new Error(`Logout request failed, ${r.statusText}`);throw o.status=r.status,o}}async showPopup(r){const o=this.joinScopesFunc(r),c=await this.buildUrl("/start",{scope:o,origin:location.origin}),f=await rt({url:c,name:`${this.provider.title} Login`,origin:new URL(c).origin,width:450,height:730});return await this.sessionTransform(f)}async buildUrl(r,o){const c=await this.discoveryApi.getBaseUrl("auth"),f=this.buildQueryString({...o,env:this.environment});return`${c}/${this.provider.id}${r}${f}`}buildQueryString(r){if(!r)return"";const o=Object.entries(r).map(([c,f])=>{if(typeof f=="string")return`${encodeURIComponent(c)}=${encodeURIComponent(f)}`;if(f)return encodeURIComponent(c)}).filter(Boolean).join("&");return o?`?${o}`:""}constructor(r){const{discoveryApi:o,environment:c,provider:f,joinScopes:O=ct,oauthRequestApi:M,sessionTransform:z=se=>se}=r;this.authRequester=M.createAuthRequester({provider:f,onAuthRequest:se=>this.showPopup(se)}),this.discoveryApi=o,this.environment=c,this.provider=f,this.joinScopesFunc=O,this.sessionTransform=z}}function mt(a,r){for(const o of r)if(!a.has(o))return!1;return!0}class vt{sessionExistsAndHasScope(r,o){if(!r)return!1;if(!o||this.options.sessionScopes===void 0)return!0;const c=this.options.sessionScopes(r);return mt(c,o)}getExtendedScope(r,o){const c=new Set(this.options.defaultScopes);if(r&&this.options.sessionScopes!==void 0){const f=this.options.sessionScopes(r);for(const O of f)c.add(O)}if(o)for(const f of o)c.add(f);return c}constructor(r){this.options=r}}var Ge=t(82394),re=t.n(Ge);let Re=Symbol.observable;class Pe{[Re](){return this}get closed(){return this.isClosed}next(r){if(this.isClosed)throw new Error("PublishSubject is closed");this.subscribers.forEach(o=>o.next(r))}error(r){if(this.isClosed)throw new Error("PublishSubject is closed");this.isClosed=!0,this.terminatingError=r,this.subscribers.forEach(o=>o.error(r))}complete(){if(this.isClosed)throw new Error("PublishSubject is closed");this.isClosed=!0,this.subscribers.forEach(r=>r.complete())}subscribe(r,o,c){const f=typeof r=="function"?{next:r,error:o,complete:c}:r;return this.observable.subscribe(f)}constructor(){this.isClosed=!1,this.observable=new(re())(r=>this.isClosed?(this.terminatingError?r.error(this.terminatingError):r.complete(),()=>{}):(this.subscribers.add(r),()=>{this.subscribers.delete(r)})),this.subscribers=new Set}}let it=Symbol.observable;class yt{[it](){return this}get closed(){return this.isClosed}next(r){if(this.isClosed)throw new Error("BehaviorSubject is closed");this.currentValue=r,this.subscribers.forEach(o=>o.next(r))}error(r){if(this.isClosed)throw new Error("BehaviorSubject is closed");this.isClosed=!0,this.terminatingError=r,this.subscribers.forEach(o=>o.error(r))}complete(){if(this.isClosed)throw new Error("BehaviorSubject is closed");this.isClosed=!0,this.subscribers.forEach(r=>r.complete())}subscribe(r,o,c){const f=typeof r=="function"?{next:r,error:o,complete:c}:r;return this.observable.subscribe(f)}constructor(r){this.subscribers=new Set,this.isClosed=!1,this.currentValue=r,this.terminatingError=void 0,this.observable=new(re())(o=>this.isClosed?(this.terminatingError?o.error(this.terminatingError):o.complete(),()=>{}):(o.next(this.currentValue),this.subscribers.add(o),()=>{this.subscribers.delete(o)}))}}class At{setIsSignedIn(r){this.signedIn!==r&&(this.signedIn=r,this.subject.next(this.signedIn?x.sM.SignedIn:x.sM.SignedOut))}sessionState$(){return this.subject}constructor(){this.subject=new yt(x.sM.SignedOut),this.signedIn=!1}}class pt{async getSession(r){if(this.helper.sessionExistsAndHasScope(this.currentSession,r.scopes)){if(!this.sessionShouldRefreshFunc(this.currentSession))return this.currentSession;try{const c=await this.collapsedSessionRefresh(),f=this.sessionScopesFunc(this.currentSession),O=this.sessionScopesFunc(c);return mt(O,f)&&(this.currentSession=c),c}catch(c){if(r.optional)return;throw c}}if(!this.currentSession&&!r.instantPopup)try{const o=await this.collapsedSessionRefresh();return this.currentSession=o,this.getSession(r)}catch{}if(!r.optional)return this.currentSession=await this.connector.createSession({...r,scopes:this.helper.getExtendedScope(this.currentSession,r.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 r=await this.refreshPromise;return this.stateTracker.setIsSignedIn(!0),r}finally{delete this.refreshPromise}}constructor(r){this.stateTracker=new At;const{connector:o,defaultScopes:c=new Set,sessionScopes:f,sessionShouldRefresh:O}=r;this.connector=o,this.sessionScopesFunc=f,this.sessionShouldRefreshFunc=O,this.helper=new vt({sessionScopes:f,defaultScopes:c})}}class Ct{setSession(r){this.currentSession=r,this.stateTracker.setIsSignedIn(Boolean(r))}async getSession(r){if(this.helper.sessionExistsAndHasScope(this.currentSession,r.scopes))return this.currentSession;if(!r.optional)return this.currentSession=await this.connector.createSession({...r,scopes:this.helper.getExtendedScope(this.currentSession,r.scopes)}),this.stateTracker.setIsSignedIn(!0),this.currentSession}async removeSession(){this.currentSession=void 0,this.stateTracker.setIsSignedIn(!1)}sessionState$(){return this.stateTracker.sessionState$()}constructor(r){this.stateTracker=new SessionStateTracker;const{connector:o,defaultScopes:c=new Set,sessionScopes:f}=r;this.connector=o,this.helper=new SessionScopeHelper({sessionScopes:f,defaultScopes:c})}}const Pt={id:"oauth2",title:"Your Identity Provider",icon:()=>null};class kt{static create(r){const{discoveryApi:o,environment:c="development",provider:f=Pt,oauthRequestApi:O,defaultScopes:M=[],scopeTransform:z=Ue=>Ue}=r,se=new lt({discoveryApi:o,environment:c,provider:f,oauthRequestApi:O,sessionTransform(Ue){return{...Ue,providerInfo:{idToken:Ue.providerInfo.idToken,accessToken:Ue.providerInfo.accessToken,scopes:kt.normalizeScopes(z,Ue.providerInfo.scope),expiresAt:new Date(Date.now()+Ue.providerInfo.expiresInSeconds*1e3)}}}}),Ve=new pt({connector:se,defaultScopes:new Set(M),sessionScopes:Ue=>Ue.providerInfo.scopes,sessionShouldRefresh:Ue=>(Ue.providerInfo.expiresAt.getTime()-Date.now())/1e3<60*5});return new kt({sessionManager:Ve,scopeTransform:z})}async signIn(){await this.getAccessToken()}async signOut(){await this.sessionManager.removeSession()}sessionState$(){return this.sessionManager.sessionState$()}async getAccessToken(r,o){const c=kt.normalizeScopes(this.scopeTransform,r),f=await this.sessionManager.getSession({...o,scopes:c});var O;return(O=f==null?void 0:f.providerInfo.accessToken)!==null&&O!==void 0?O:""}async getIdToken(r={}){const o=await this.sessionManager.getSession(r);var c;return(c=o==null?void 0:o.providerInfo.idToken)!==null&&c!==void 0?c:""}async getBackstageIdentity(r={}){const o=await this.sessionManager.getSession(r);return o==null?void 0:o.backstageIdentity}async getProfile(r={}){const o=await this.sessionManager.getSession(r);return o==null?void 0:o.profile}static normalizeScopes(r,o){if(!o)return new Set;const c=Array.isArray(o)?o:o.split(/[\s|,]/).filter(Boolean);return new Set(r(c))}constructor(r){this.sessionManager=r.sessionManager,this.scopeTransform=r.scopeTransform}}const en={id:"github",title:"GitHub",icon:()=>null};class sn{static create(r){const{discoveryApi:o,environment:c="development",provider:f=en,oauthRequestApi:O,defaultScopes:M=["read:user"]}=r;return kt.create({discoveryApi:o,oauthRequestApi:O,provider:f,environment:c,defaultScopes:M})}}const Ht={id:"gitlab",title:"GitLab",icon:()=>null};class Gt{static create(r){const{discoveryApi:o,environment:c="development",provider:f=Ht,oauthRequestApi:O,defaultScopes:M=["read_user"]}=r;return kt.create({discoveryApi:o,oauthRequestApi:O,provider:f,environment:c,defaultScopes:M})}}const fn={id:"google",title:"Google",icon:()=>null},_t="https://www.googleapis.com/auth/";class Zn{static create(r){const{discoveryApi:o,oauthRequestApi:c,environment:f="development",provider:O=fn,defaultScopes:M=["openid",`${_t}userinfo.email`,`${_t}userinfo.profile`]}=r;return kt.create({discoveryApi:o,oauthRequestApi:c,provider:O,environment:f,defaultScopes:M,scopeTransform(z){return z.map(se=>se==="openid"?se:se==="profile"||se==="email"?`${_t}userinfo.${se}`:se.startsWith(_t)?se:`${_t}${se}`)}})}}const ln={id:"okta",title:"Okta",icon:()=>null},Dn=new Set(["openid","profile","email","phone","address","groups","offline_access"]),gn="okta.";class Jn{static create(r){const{discoveryApi:o,environment:c="development",provider:f=ln,oauthRequestApi:O,defaultScopes:M=["openid","email","profile","offline_access"]}=r;return kt.create({discoveryApi:o,oauthRequestApi:O,provider:f,environment:c,defaultScopes:M,scopeTransform(z){return z.map(se=>Dn.has(se)||se.startsWith(gn)?se:`${gn}${se}`)}})}}var Kt=t(30195);const In=Kt.z.object({profile:Kt.z.object({email:Kt.z.string().optional(),displayName:Kt.z.string().optional(),picture:Kt.z.string().optional()}),backstageIdentity:Kt.z.object({token:Kt.z.string(),identity:Kt.z.object({type:Kt.z.literal("user"),userEntityRef:Kt.z.string(),ownershipEntityRefs:Kt.z.array(Kt.z.string())})})}),Nn={id:"saml",title:"SAML",icon:()=>null};class Yt{static create(r){const{discoveryApi:o,environment:c="development",provider:f=Nn}=r,O=new DirectAuthConnector({discoveryApi:o,environment:c,provider:f}),M=new StaticAuthSessionManager({connector:O}),z=new AuthSessionStore({manager:M,storageKey:`${f.id}Session`,schema:samlSessionSchema});return new Yt(z)}sessionState$(){return this.sessionManager.sessionState$()}async signIn(){await this.getBackstageIdentity({})}async signOut(){await this.sessionManager.removeSession()}async getBackstageIdentity(r={}){const o=await this.sessionManager.getSession(r);return o==null?void 0:o.backstageIdentity}async getProfile(r={}){const o=await this.sessionManager.getSession(r);return o==null?void 0:o.profile}constructor(r){this.sessionManager=r}}const mn={id:"microsoft",title:"Microsoft",icon:()=>null};class cn{static create(r){const{environment:o="development",provider:c=mn,oauthRequestApi:f,discoveryApi:O,defaultScopes:M=["openid","offline_access","profile","email","User.Read"]}=r;return kt.create({discoveryApi:O,oauthRequestApi:f,provider:c,environment:o,defaultScopes:M})}}const Rn={id:"onelogin",title:"onelogin",icon:()=>null},Fn=new Set(["openid","profile","email","phone","address","groups","offline_access"]),Cn="onelogin.";class ge{static create(r){const{discoveryApi:o,environment:c="development",provider:f=Rn,oauthRequestApi:O}=r;return kt.create({discoveryApi:o,oauthRequestApi:O,provider:f,environment:c,defaultScopes:["openid","email","profile","offline_access"],scopeTransform(M){return M.map(z=>Fn.has(z)||z.startsWith(Cn)?z:`${Cn}${z}`)}})}}const te={id:"bitbucket",title:"Bitbucket",icon:()=>null};class Ee{static create(r){const{discoveryApi:o,environment:c="development",provider:f=te,oauthRequestApi:O,defaultScopes:M=["team"]}=r;return kt.create({discoveryApi:o,oauthRequestApi:O,provider:f,environment:c,defaultScopes:M})}}const De={id:"atlassian",title:"Atlassian",icon:()=>null};class qe{static create(r){const{discoveryApi:o,environment:c="development",provider:f=De,oauthRequestApi:O}=r;return kt.create({discoveryApi:o,oauthRequestApi:O,provider:f,environment:c})}}class xt{post(r){this.subject.next(r)}alert$(){return this.subject}constructor(){this.subject=new Pe}}class ae{captureEvent(r){}}const P="theme";class q{static createWithStorage(r){const o=new q(r);if(!window.localStorage)return o;var c;const f=(c=window.localStorage.getItem(P))!==null&&c!==void 0?c:void 0;return o.setActiveThemeId(f),o.activeThemeId$().subscribe(O=>{O?window.localStorage.setItem(P,O):window.localStorage.removeItem(P)}),window.addEventListener("storage",O=>{if(O.key===P){var M;const z=(M=localStorage.getItem(P))!==null&&M!==void 0?M:void 0;o.setActiveThemeId(z)}}),o}getInstalledThemes(){return this.themes.slice()}activeThemeId$(){return this.subject}getActiveThemeId(){return this.activeThemeId}setActiveThemeId(r){this.activeThemeId=r,this.subject.next(r)}constructor(r){this.themes=r,this.subject=new yt(void 0)}}var Ke=t(9850),U=t.n(Ke),Z=t(12782),ce=t.n(Z);const pe=/^[a-z][a-z0-9]*(?:[-_][a-z][a-z0-9]*)*$/i;function be(a){return typeof a=="object"&&a!==null&&!Array.isArray(a)}function Be(a){if(a===null)return"null";if(Array.isArray(a))return"array";const r=typeof a;return r==="number"&&isNaN(a)?"nan":r==="string"&&a===""?"empty-string":r}const Oe={type(a,r,o,c){return`Invalid type in config for key '${a}' in '${r}', got ${o}, wanted ${c}`},missing(a){return`Missing required config value at '${a}'`},convert(a,r,o){return`Unable to convert config value for key '${a}' in '${r}' to a ${o}`}};class He{static fromConfigs(r){return r.length===0?new He(void 0):r.reduce((o,{data:c,context:f,filteredKeys:O,deprecatedKeys:M})=>{const z=new He(c,f,o);if(z.filteredKeys=O,M)for(const{key:se,description:Ve}of M)console.warn(`The configuration key '${se}' of ${f} is deprecated and may be removed soon. ${Ve||""}`);return z},void 0)}has(r){var o;if(this.readValue(r)!==void 0)return!0;var f;return(f=(o=this.fallback)===null||o===void 0?void 0:o.has(r))!==null&&f!==void 0?f:!1}keys(){var r;const o=this.data?Object.keys(this.data):[];var c;const f=(c=(r=this.fallback)===null||r===void 0?void 0:r.keys())!==null&&c!==void 0?c:[];return[...new Set([...o,...f])]}get(r){const o=this.getOptional(r);if(o===void 0)throw new Error(Oe.missing(this.fullKey(r!=null?r:"")));return o}getOptional(r){var o;const c=U()(this.readValue(r)),f=(o=this.fallback)===null||o===void 0?void 0:o.getOptional(r);if(c===void 0){if(!1)var O;return f}else if(f===void 0)return c;return ce()({},{value:f},{value:c},(M,z)=>!be(z)||!be(M)?z:void 0).value}getConfig(r){const o=this.getOptionalConfig(r);if(o===void 0)throw new Error(Oe.missing(this.fullKey(r)));return o}getOptionalConfig(r){var o;const c=this.readValue(r),f=(o=this.fallback)===null||o===void 0?void 0:o.getOptionalConfig(r);if(be(c))return this.copy(c,r,f);if(c!==void 0)throw new TypeError(Oe.type(this.fullKey(r),this.context,Be(c),"object"));return f}getConfigArray(r){const o=this.getOptionalConfigArray(r);if(o===void 0)throw new Error(Oe.missing(this.fullKey(r)));return o}getOptionalConfigArray(r){const o=this.readConfigValue(r,f=>{if(!Array.isArray(f))return{expected:"object-array"};for(const[O,M]of f.entries())if(!be(M))return{expected:"object-array",value:M,key:`${r}[${O}]`};return!0});if(!o){if(!1)var c;return}return o.map((f,O)=>this.copy(f,`${r}[${O}]`))}getNumber(r){const o=this.getOptionalNumber(r);if(o===void 0)throw new Error(Oe.missing(this.fullKey(r)));return o}getOptionalNumber(r){const o=this.readConfigValue(r,f=>typeof f=="number"||typeof f=="string"||{expected:"number"});if(typeof o=="number"||o===void 0)return o;const c=Number(o);if(!Number.isFinite(c))throw new Error(Oe.convert(this.fullKey(r),this.context,"number"));return c}getBoolean(r){const o=this.getOptionalBoolean(r);if(o===void 0)throw new Error(Oe.missing(this.fullKey(r)));return o}getOptionalBoolean(r){return this.readConfigValue(r,o=>typeof o=="boolean"||{expected:"boolean"})}getString(r){const o=this.getOptionalString(r);if(o===void 0)throw new Error(Oe.missing(this.fullKey(r)));return o}getOptionalString(r){return this.readConfigValue(r,o=>typeof o=="string"&&o!==""||{expected:"string"})}getStringArray(r){const o=this.getOptionalStringArray(r);if(o===void 0)throw new Error(Oe.missing(this.fullKey(r)));return o}getOptionalStringArray(r){return this.readConfigValue(r,o=>{if(!Array.isArray(o))return{expected:"string-array"};for(const[c,f]of o.entries())if(typeof f!="string"||f==="")return{expected:"string-array",value:f,key:`${r}[${c}]`};return!0})}fullKey(r){return`${this.prefix}${this.prefix?".":""}${r}`}copy(r,o,c){const f=new He(r,this.context,c,this.fullKey(o));return f.filteredKeys=this.filteredKeys,f}readConfigValue(r,o){const c=this.readValue(r);if(c===void 0){var f;if(!1)var O;return(f=this.fallback)===null||f===void 0?void 0:f.readConfigValue(r,o)}const M=o(c);if(M!==!0){const{key:z=r,value:se=c,expected:Ve}=M;throw new TypeError(Oe.type(this.fullKey(z),this.context,Be(se),Ve))}return c}readValue(r){const o=r?r.split("."):[];for(const f of o)if(!pe.test(f))throw new TypeError(`Invalid config key '${r}'`);if(this.data===void 0)return;let c=this.data;for(const[f,O]of o.entries())if(be(c))c=c[O];else if(c!==void 0){const M=this.fullKey(o.slice(0,f).join("."));throw new TypeError(Oe.type(M,this.context,Be(c),"object"))}return c}constructor(r,o="mock-config",c,f=""){this.data=r,this.context=o,this.fallback=c,this.prefix=f,this.notifiedFilteredKeys=new Set}}const st="Invalid discovery URL pattern,";class S{static compile(r){const o=r.split(/\{\{\s*pluginId\s*\}\}/),c=o.join("pluginId");let f;try{f=new URL(c)}catch{throw new Error(`${st} URL '${c}' is invalid`)}if(f.hash)throw new Error(`${st} URL must not have a hash`);if(f.search)throw new Error(`${st} URL must not have a query`);if(c.endsWith("/"))throw new Error(`${st} URL must not end with a slash`);return new S(o)}async getBaseUrl(r){return this.parts.join(r)}constructor(r){this.parts=r}}class H{post(r,o){return o!=null&&o.hidden||this.alertApi.post({message:r.message,severity:"error"}),this.errorApi.post(r,o)}error$(){return this.errorApi.error$()}constructor(r,o){this.alertApi=r,this.errorApi=o}}class me{post(r,o){this.subject.next({error:r,context:o})}error$(){return this.subject}constructor(){this.subject=new Pe}}class ue{static forward(r,o){window.addEventListener("unhandledrejection",c=>{r.post(c.reason,o)})}}function Ce(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(r){Ce(r.name),this.registeredFeatureFlags.push(r)}getRegisteredFlags(){return this.registeredFeatureFlags.slice()}isActive(r){return this.flags||(this.flags=this.load()),this.flags.get(r)===x.CL.Active}save(r){this.flags||(this.flags=this.load()),r.merge||this.flags.clear();for(const[c,f]of Object.entries(r.states))this.flags.set(c,f);const o=Array.from(this.flags.entries()).filter(([,c])=>c===x.CL.Active);window.localStorage.setItem("featureFlags",JSON.stringify(Object.fromEntries(o)))}load(){try{const r=window.localStorage.getItem("featureFlags");if(!r)return new Map;const o=JSON.parse(r);if(typeof o!="object"||o===null||Array.isArray(o))return new Map;const c=Object.entries(o).filter(([f,O])=>(Ce(f),O===x.CL.Active));return new Map(c)}catch{return new Map}}constructor(){this.registeredFeatureFlags=[]}}function Ne(a){let r=a.baseImplementation||t.g.fetch;var o;const c=[(o=a.middleware)!==null&&o!==void 0?o:[]].flat().reverse();for(const f of c)r=f.apply(r);return{fetch:r}}class ot{static create(r){var o,c;const f=ht(r),O=((o=r.header)===null||o===void 0?void 0:o.name)||"authorization",M=((c=r.header)===null||c===void 0?void 0:c.value)||(z=>`Bearer ${z}`);return new ot(r.identityApi,f,O,M)}apply(r){return async(o,c)=>{const f=new Request(o,c),{token:O}=await this.identityApi.getCredentials();return f.headers.get(this.headerName)||typeof O!="string"||!O||!this.allowUrl(f.url)?r(o,c):(f.headers.set(this.headerName,this.headerValue(O)),r(f))}}constructor(r,o,c,f){this.identityApi=r,this.allowUrl=o,this.headerName=c,this.headerValue=f}}function ht(a){return a.allowUrl?a.allowUrl:a.urlPrefixAllowlist?ut(a.urlPrefixAllowlist):a.config?ut([a.config.getString("backend.baseUrl")]):()=>!1}function ut(a){const r=a.map(o=>o.replace(/\/$/,""));return o=>r.some(c=>o===c||o.startsWith(`${c}/`))}function et(a,r){return!r||r==="/"?a:`${a.replace(/\/$/,"")}/${r.replace(/^\//,"")}`}class St{apply(r){return async(o,c)=>{const f=new Request(o,c),O="plugin://";if(!f.url.startsWith(O))return r(o,c);const{hostname:M,pathname:z,search:se,hash:Ve,username:Ue,password:wt}=new URL(`http://${f.url.substring(O.length)}`);let dt=await this.discoveryApi.getBaseUrl(M);if(Ue||wt){const Dt=new URL(dt),Mt=`${Ue}${wt?`:${wt}`:""}@`;dt=`${Dt.protocol}//${Mt}${Dt.host}${Dt.pathname}`}const It=`${et(dt,z)}${se}${Ve}`;return r(It,typeof o=="string"||at(o)?c:o)}}constructor(r){this.discoveryApi=r}}function at(a){return typeof a=="object"&&(a==null?void 0:a.constructor)===URL}class Tt{static resolvePluginProtocol(r){return new St(r.discoveryApi)}static injectIdentityAuth(r){return ot.create(r)}constructor(){}}function Bt(a,r){for(const o of r)if(!a.has(o))return!1;return!0}function Nt(a,...r){const o=new Set(a);for(const c of r)for(const f of c)o.add(f);return o}class vn{request(r){return new Promise((o,c)=>{this.requests.push({scopes:r,resolve:o,reject:c}),this.subject.next(this.getCurrentPending())})}resolve(r,o){this.requests=this.requests.filter(c=>Bt(r,c.scopes)?(c.resolve(o),!1):!0),this.subject.next(this.getCurrentPending())}reject(r){this.requests.forEach(o=>o.reject(r)),this.requests=[],this.subject.next(this.getCurrentPending())}pending(){return this.subject}getCurrentPending(){const r=this.requests.length===0?void 0:this.requests.slice(1).reduce((o,c)=>Nt(o,c.scopes),this.requests[0].scopes);return{scopes:r,resolve:o=>{r&&this.resolve(r,o)},reject:o=>{r&&this.reject(o)}}}constructor(){this.requests=[],this.subject=new yt(this.getCurrentPending())}}class Gn{createAuthRequester(r){const o=new vn,c=this.handlerCount;return this.handlerCount++,o.pending().subscribe({next:f=>{const O=this.currentRequests.slice(),M=this.makeAuthRequest(f,r);M?O[c]=M:delete O[c],this.currentRequests=O,this.subject.next(O.filter(Boolean))}}),f=>o.request(f)}makeAuthRequest(r,o){const{scopes:c}=r;if(!!c)return{provider:o.provider,trigger:async()=>{const f=await o.onAuthRequest(c);r.resolve(f)},reject:()=>{const f=new Error("Login failed, rejected by user");f.name="RejectedError",r.reject(f)}}}authRequest$(){return this.subject}constructor(){this.subject=new yt([]),this.currentRequests=[],this.handlerCount=0}}const wn=new Map;class Ut{static create(r){var o;return new Ut((o=r.namespace)!==null&&o!==void 0?o:"",r.errorApi)}get(r){return this.snapshot(r).value}snapshot(r){let o,c="absent";try{const f=localStorage.getItem(this.getKeyName(r));f&&(o=JSON.parse(f,(O,M)=>(typeof M=="object"&&M!==null&&Object.freeze(M),M)),c="present")}catch{this.errorApi.post(new Error(`Error when parsing JSON config from storage for: ${r}`))}return{key:r,value:o,presence:c}}forBucket(r){const o=`${this.namespace}/${r}`;return wn.has(o)||wn.set(o,new Ut(o,this.errorApi)),wn.get(o)}async set(r,o){localStorage.setItem(this.getKeyName(r),JSON.stringify(o)),this.notifyChanges(r)}async remove(r){localStorage.removeItem(this.getKeyName(r)),this.notifyChanges(r)}observe$(r){return this.observable.filter(({key:o})=>o===r)}getKeyName(r){return`${this.namespace}/${encodeURIComponent(r)}`}notifyChanges(r){const o=this.snapshot(r);for(const c of this.subscribers)c.next(o)}constructor(r,o){this.namespace=r,this.errorApi=o,this.subscribers=new Set,this.observable=new(re())(c=>(this.subscribers.add(c),()=>{this.subscribers.delete(c)}))}}var Ft=t(64279);function dn(a){const r={};for(const c in a.collectors)a.collectors.hasOwnProperty(c)&&(r[c]=a.collectors[c]());const o=[{node:g.Children.toArray(a.root),parent:void 0,contexts:{}}];for(;o.length!==0;){const{node:c,parent:f,contexts:O}=o.shift();g.Children.forEach(c,M=>{if(!(0,g.isValidElement)(M))return;const z={};for(const se in r)if(r.hasOwnProperty(se)){const Ve=r[se];z[se]=Ve.visit(Ve.accumulator,M,f,O[se])}for(const se of a.discoverers){const Ve=se(M);Ve&&o.push({node:Ve,parent:M,contexts:z})}})}return Object.fromEntries(Object.entries(r).map(([c,f])=>[c,f.accumulator]))}function yn(a,r){return()=>({accumulator:a(),visit:r})}function Mn(a){var r;return(r=a.props)===null||r===void 0?void 0:r.children}function jn(a){var r,o;if(((r=a.props)===null||r===void 0?void 0:r.path)&&((o=a.props)===null||o===void 0?void 0:o.element)){var c;return(c=a.props)===null||c===void 0?void 0:c.element}}const Un=yn(()=>new Set,(a,r)=>{const o=(0,x.IY)(r,"core.plugin");o&&a.add(o)}),xn=a=>{const{children:r}=a,o=(0,x.h_)(x.W0),c="with"in a?o.isActive(a.with):!o.isActive(a.without);return(0,n.jsx)(n.Fragment,{children:c?r:null})};(0,x.R5)(xn,"core.featureFlagged",!0);const tn={caseSensitive:!1,path:"*",element:"match-all",routeRefs:new Set};function En(a){const r=a;if(r!=null&&r.type){var o,c;return(c=(o=r.type.displayName)!==null&&o!==void 0?o:r.type.name)!==null&&c!==void 0?c:String(r.type)}return String(r)}function ir(a,r=new Array){return g.Children.forEach(a,o=>{if(!(0,g.isValidElement)(o))return;const c=(0,x.IY)(o,"core.mountPoint");if(c){const f=(0,x.IY)(o,"core.plugin");r.push({routeRef:c,plugin:f})}ir(o.props.children,r)}),r}const C=yn(()=>({paths:new Map,parents:new Map,objects:new Array}),(a,r,o,c)=>{var f,O;if(c!=null&&c.isElementAncestor)return c;if((o==null?void 0:o.props.element)===r)return{...c,isElementAncestor:!0};const M=(f=r.props)===null||f===void 0?void 0:f.path,z=(0,x.IY)(r,"core.mountPoint");if(z&&M)throw new Error(`Path property may not be set directly on a routable extension "${En(r)}"`);var se;const Ve=(se=c==null||(O=c.obj)===null||O===void 0?void 0:O.children)!==null&&se!==void 0?se:a.objects;if(M!==void 0){if(typeof M!="string")throw new Error(`Element path must be a string at "${En(r)}"`);const It=M.startsWith("/")?M.slice(1):M,Dt=r.props.element;if((0,x.IY)(r,"core.gatherMountPoints")){var Ue;if(Dt)throw new Error(`Mount point gatherers may not have an element prop "${En(r)}"`);const Mt={path:It,element:"gathered",routeRefs:new Set,caseSensitive:Boolean((Ue=r.props)===null||Ue===void 0?void 0:Ue.caseSensitive),children:[tn],plugin:void 0};return Ve.push(Mt),{obj:Mt,gatherPath:It,routeRef:c==null?void 0:c.routeRef,gatherRouteRef:c==null?void 0:c.routeRef}}if(Dt){var wt;const[Mt,...Tn]=ir(Dt);if(Tn.length>0)throw new Error(`Route element with path "${M}" may not contain multiple routable extensions`);if(!Mt)return c;const{routeRef:rr,plugin:tr}=Mt,dr={path:It,element:"mounted",routeRefs:new Set([rr]),caseSensitive:Boolean((wt=r.props)===null||wt===void 0?void 0:wt.caseSensitive),children:[tn],plugin:tr};return Ve.push(dr),a.paths.set(rr,It),a.parents.set(rr,c==null?void 0:c.routeRef),{obj:dr,routeRef:rr!=null?rr:c==null?void 0:c.routeRef,gatherPath:It,gatherRouteRef:c==null?void 0:c.gatherRouteRef}}}if(z){var dt;if((c==null?void 0:c.gatherPath)===void 0)throw new Error(`Routable extension "${En(r)}" with mount point "${z}" must be assigned a path`);return c==null||(dt=c.obj)===null||dt===void 0||dt.routeRefs.add(z),a.paths.set(z,c.gatherPath),a.parents.set(z,c==null?void 0:c.gatherRouteRef),{...c,routeRef:z}}return c}),d=yn(()=>({paths:new Map,parents:new Map,objects:new Array}),(a,r,o,c)=>{var f,O,M;if((o==null?void 0:o.props.element)===r)return c;let z=c==null?void 0:c.obj,se=c==null?void 0:c.routeRef,Ve=c==null?void 0:c.sticky;const Ue=(f=r.props)===null||f===void 0?void 0:f.path;var wt;const dt=(wt=z==null?void 0:z.children)!==null&&wt!==void 0?wt:a.objects,It=Boolean((O=r.props)===null||O===void 0?void 0:O.caseSensitive);let Dt=c==null?void 0:c.path;if((0,x.IY)(r,"core.gatherMountPoints")){if(!Ue)throw new Error("Mount point gatherer must have a path");Dt=Ue}const Mt=(M=r.props)===null||M===void 0?void 0:M.element;let Tn=(0,x.IY)(r,"core.mountPoint");if(!Tn&&(0,g.isValidElement)(Mt)&&(Tn=(0,x.IY)(Mt,"core.mountPoint")),Tn){let dr=Ue;if(Dt&&(dr?Dt=void 0:dr=Dt),!dr)throw new Error("Mounted routable extension must have a path");a.paths.set(Tn,dr),se&&Ve?(a.parents.set(Tn,se),Ue&&(se=Tn,Ve=!1)):(a.parents.set(Tn,se),se=Tn),Ue?(z={caseSensitive:It,path:Ue,element:"mounted",routeRefs:new Set([Tn]),children:[tn],plugin:(0,x.IY)(r.props.element,"core.plugin")},dt.push(z)):z==null||z.routeRefs.add(Tn)}if((0,x.IY)(r,"core.gatherMountPoints")&&(Ve=!0),(0,x.IY)(r,"core.gatherMountPoints")){if(!Ue)throw new Error("Mount point gatherer must have a path");if(!Tn){var tr;z={caseSensitive:It,path:Ue,element:"gathered",routeRefs:new Set,children:[tn],plugin:c==null||(tr=c.obj)===null||tr===void 0?void 0:tr.plugin},dt.push(z)}}return{obj:z,path:Dt,routeRef:se,sticky:Ve}}),m=yn(()=>new Set,(a,r)=>{if(r.type===xn){const o=r.props;a.add("with"in o?o.with:o.without)}}),w=(0,We.uW)("route-ref-type",()=>Symbol("route-ref-type"));function Y(a){return a[w]==="absolute"}function fe(a){return a[w]==="sub"}function Se(a){return a[w]==="external"}function $e(...a){const r=a.join("/").replace(/\/\/+/g,"/");return r!=="/"&&r.endsWith("/")?r.slice(0,-1):r}function ft(a,r,o){let c,f="";if(Y(a))c=a;else if(fe(a))c=a.parent,f=a.path;else if(Se(a)){const z=o.get(a);if(!z)return[void 0,""];if(Y(z))c=z;else if(fe(z))c=z.parent,f=z.path;else throw new Error(`ExternalRouteRef was bound to invalid target, ${z}`)}else throw a[w]?new Error(`Unknown or invalid route ref type, ${a[w]}`):new Error(`Unknown object passed to useRouteRef, got ${a}`);if(!c)return[void 0,""];const O=r.get(c);if(O===void 0)return[void 0,""];const M=$e(O,f);return[c,M]}function $t(a,r,o,c,f){var O;const M=(O=(0,V.fp)(f,r))!==null&&O!==void 0?O:[],z=Array();let se=-1;for(let wt=a;wt&&(se=M.findIndex(dt=>dt.route.routeRefs.has(wt)),se===-1);wt=c.get(wt))z.unshift(wt);z.length===0&&(se-=1);const Ve=se===-1?"":M[se].pathname,Ue=z.slice(0,-1).map(wt=>{const dt=o.get(wt);if(dt===void 0)throw new Error(`No path for ${wt}`);if(dt.includes(":"))throw new Error(`Cannot route to ${a} with parent ${wt} as it has parameters`);return dt});return`${$e(Ve,...Ue)}/`}class on{resolve(r,o){const[c,f]=ft(r,this.routePaths,this.routeBindings);if(!c)return;let O;typeof o=="string"?O=this.trimPath(o):o.pathname?O={...o,pathname:this.trimPath(o.pathname)}:O=o;const M=this.appBasePath+$t(c,O,this.routePaths,this.routeParents,this.routeObjects);return(...[se])=>$e(M,(0,V.Gn)(f,se))}trimPath(r){return r&&(r.startsWith(this.appBasePath)?r.slice(this.appBasePath.length):r)}constructor(r,o,c,f,O){this.routePaths=r,this.routeParents=o,this.routeObjects=c,this.routeBindings=f,this.appBasePath=O}}const zn=(0,We.CT)("routing-context"),$r=({routePaths:a,routeParents:r,routeObjects:o,routeBindings:c,basePath:f="",children:O})=>{const M=new on(a,r,o,c,f),z=(0,We.EI)({1:M});return(0,n.jsx)(zn.Provider,{value:z,children:O})},is=(a,r)=>{try{var o,c;const f=(0,V.fp)(r,{pathname:a}),O=(o=f==null?void 0:f.filter(z=>{var se;return((se=z==null?void 0:z.route.routeRefs)===null||se===void 0?void 0:se.size)>0}).pop())===null||o===void 0?void 0:o.route;if(!O)return{};let M;return O.routeRefs.size===1&&(M=O.routeRefs.values().next().value),{extension:"App",pluginId:((c=O.plugin)===null||c===void 0?void 0:c.getId())||"root",...M?{routeRef:M.id}:{}}}catch{return{}}},nr=({pathname:a,search:r,hash:o})=>{const c=(0,x.z$)();return(0,g.useEffect)(()=>{c.captureEvent("navigate",`${a}${r}${o}`)},[c,a,r,o]),null},Ln=({routeObjects:a})=>{const{pathname:r,search:o,hash:c}=(0,V.TH)();return(0,n.jsx)(x.fC,{attributes:is(r,a),children:(0,n.jsx)(nr,{pathname:r,search:o,hash:c})})};function ar(a,r){const o=new Set(r.values());o.delete(void 0);for(const c of r.keys()){if(o.has(c))continue;let f=c,O="";for(;f;){const z=a.get(f);if(z===void 0)throw new Error(`No path for ${f}`);O=$e(z,O),f=r.get(f)}const M=O.match(/:(\w+)/g);if(M){for(let z=0;z<M.length;z++)for(let se=z+1;se<M.length;se++)if(M[se]===M[z])throw new Error(`Parameter ${M[se]} is duplicated in path ${O}`)}}}function Sr(a,r){for(const o of r)if(!!o.externalRoutes){for(const[c,f]of Object.entries(o.externalRoutes))if(!f.optional&&!a.has(f))throw new Error(`External route '${c}' of the '${o.getId()}' plugin must be bound to a target route. See https://backstage.io/link?bind-routes for details.`)}}const Cr=(0,We.CT)("app-context"),as=({appContext:a,children:r})=>{const o=(0,We.EI)({1:a});return(0,n.jsx)(Cr.Provider,{value:o,children:r})};function wr(a){return new Error(`Tried to access IdentityApi ${a} before app was loaded`)}function Br(a){console.warn(`WARNING: Call to ${a} is deprecated and will break in the future`)}class Ds{setTarget(r,o){this.target=r,this.signOutTargetUrl=o.signOutTargetUrl,this.resolveTarget(r)}getUserId(){if(!this.target)throw wr("getUserId");if(!this.target.getUserId)throw new Error("IdentityApi does not implement getUserId");return Br("getUserId"),this.target.getUserId()}getProfile(){if(!this.target)throw wr("getProfile");if(!this.target.getProfile)throw new Error("IdentityApi does not implement getProfile");return Br("getProfile"),this.target.getProfile()}async getProfileInfo(){return this.waitForTarget.then(r=>r.getProfileInfo())}async getBackstageIdentity(){const r=await this.waitForTarget.then(o=>o.getBackstageIdentity());return r.userEntityRef.match(/^.*:.*\/.*$/)||console.warn(`WARNING: The App IdentityApi provided an invalid userEntityRef, '${r.userEntityRef}'. It must be a full Entity Reference of the form '<kind>:<namespace>/<name>'.`),r}async getCredentials(){return this.waitForTarget.then(r=>r.getCredentials())}async getIdToken(){return this.waitForTarget.then(r=>{if(!r.getIdToken)throw new Error("IdentityApi does not implement getIdToken");return Br("getIdToken"),r.getIdToken()})}async signOut(){await this.waitForTarget.then(r=>r.signOut()),location.href=this.signOutTargetUrl}constructor(){this.resolveTarget=()=>{},this.signOutTargetUrl="/",this.waitForTarget=new Promise(r=>{this.resolveTarget=r})}}var Zr=t(72164);function Qn(a,r,o){if(a!==void 0){const f=o.find(O=>O.id===a);if(f)return f}if(r){const f=o.find(O=>O.variant==="dark");if(f)return f}const c=o.find(f=>f.variant==="light");return c||o[0]}const jr=()=>{const a=(0,g.useMemo)(()=>window.matchMedia("(prefers-color-scheme: dark)"),[]),[r,o]=(0,g.useState)(a.matches);return(0,g.useEffect)(()=>{const c=f=>{o(f.matches)};return a.addListener(c),()=>{a.removeListener(c)}},[a]),r};function pr({children:a}){const r=(0,x.h_)(x.hg),o=(0,Zr.Z)(r.activeThemeId$(),r.getActiveThemeId()),c=Boolean(window.matchMedia)?jr():!1,f=Qn(o,c,r.getInstalledThemes());if(!f)throw new Error("App has no themes");return(0,n.jsx)(f.Provider,{children:a})}const Vr=async(a="__APP_INJECTED_RUNTIME_CONFIG__")=>{const r=[{context:"app-config.yaml",data:{app:{title:"Techdocs Preview App",baseUrl:"http://localhost:3000"},backend:{baseUrl:"http://localhost:3000"},techdocs:{builder:"external"}}}];if(!r)throw new Error("No static configuration provided");if(!Array.isArray(r))throw new Error("Static configuration has invalid format");const o=r.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 c=window.__APP_CONFIG__;return c&&o.push({context:"window",data:c}),o};class Er{add(r,o){return this.apis.push([r.id,o]),o}build(){return new Pn(new Map(this.apis))}constructor(){this.apis=[]}}class Pn{static builder(){return new Er}static from(r){return new Pn(new Map(r.map(([o,c])=>[o.id,c])))}static with(r,o){return new Pn(new Map([[r.id,o]]))}with(r,o){return new Pn(new Map([...this.apis,[r.id,o]]))}get(r){return this.apis.get(r.id)}constructor(r){this.apis=r}}function ls(a){const r=new Map;return a&&a({bind:(c,f)=>{for(const[O,M]of Object.entries(f)){const z=c[O];if(!z)throw new Error(`Key ${O} is not an existing external route`);if(!M&&!z.optional)throw new Error(`External route ${O} is required but was undefined`);M&&r.set(z,M)}}}),r}function Ar(){const[a]=(0,V.is)((0,n.jsx)(V.AW,{index:!0,element:(0,n.jsx)("div",{})}));return!a.index}const Tr=(0,g.createContext)({routeObjects:[]});function Wr(a){return Ar()?cs(a):""}function cs(a){var r;let{pathname:o}=new URL((r=a.getOptionalString("app.baseUrl"))!==null&&r!==void 0?r:"/","http://dummy.dev");return o=o.replace(/\/*$/,""),o}function ds(a,r,o){const c=Boolean(a),f=(0,Ft.default)(a||(()=>Promise.resolve([])));let O;if(c&&f.loading){const{Progress:Ve}=r;O=(0,n.jsx)(Ve,{})}else if(f.error){const{BootErrorPage:Ve}=r;O=(0,n.jsx)(Ve,{step:"load-config",error:f.error})}const{ThemeProvider:M=pr}=r;if(O)return{node:(0,n.jsx)(nt,{apis:Pn.with(x.hg,o),children:(0,n.jsx)(M,{children:O})})};var z;return{api:He.fromConfigs((z=f.value)!==null&&z!==void 0?z:[])}}class us{getPlugins(){return this.app.getPlugins()}getSystemIcon(r){return this.app.getSystemIcon(r)}getSystemIcons(){return this.app.getSystemIcons()}getComponents(){return this.app.getComponents()}constructor(r){this.app=r}}class Ns{getPlugins(){return Array.from(this.plugins)}getSystemIcon(r){return this.icons[r]}getSystemIcons(){return this.icons}getComponents(){return this.components}getProvider(){const r=new us(this);let o=!1;return({children:f})=>{const O=(0,g.useMemo)(()=>q.createWithStorage(this.themes),[]),{routing:M,featureFlags:z,routeBindings:se}=(0,g.useMemo)(()=>{const dt=dn({root:f,discoverers:[Mn,jn],collectors:{routing:Ar()?d:C,collectedPlugins:Un,featureFlags:m}});return dt.collectedPlugins.forEach(It=>this.plugins.add(It)),this.verifyPlugins(this.plugins),this.getApiHolder(),{...dt,routeBindings:ls(this.bindRoutes)}},[f]);o||(o=!0,ar(M.paths,M.parents),Sr(se,this.plugins));const Ve=ds(this.configLoader,this.components,O),Ue="api"in Ve;if(Ue){const{api:dt}=Ve;this.configApi=dt}if((0,g.useEffect)(()=>{if(Ue){const dt=this.getApiHolder().get(x.W0);for(const It of this.plugins.values())if("getFeatureFlags"in It)for(const Dt of It.getFeatureFlags())dt.registerFlag({name:Dt.name,pluginId:It.getId()});else for(const Dt of It.output())Dt.type==="feature-flag"&&dt.registerFlag({name:Dt.name,pluginId:It.getId()});for(const It of z)dt.registerFlag({name:It,pluginId:""})}},[Ue,Ve,z]),"node"in Ve)return Ve.node;const{ThemeProvider:wt=pr}=this.components;return(0,n.jsx)(nt,{apis:this.getApiHolder(),children:(0,n.jsx)(as,{appContext:r,children:(0,n.jsx)(wt,{children:(0,n.jsx)($r,{routePaths:M.paths,routeParents:M.parents,routeObjects:M.objects,routeBindings:se,basePath:Wr(Ve.api),children:(0,n.jsx)(Tr.Provider,{value:{routeObjects:M.objects},children:f})})})})})}}getRouter(){const{Router:r,SignInPage:o}=this.components,c=({component:O,children:M})=>{const[z,se]=(0,g.useState)(),Ve=(0,x.h_)(x.Ds),Ue=Wr(Ve);return z?(this.appIdentityProxy.setTarget(z,{signOutTargetUrl:Ue||"/"}),M):(0,n.jsx)(O,{onSignInSuccess:se})};return({children:O})=>{const M=(0,x.h_)(x.Ds),z=cs(M),se=`${z}/*`,{routeObjects:Ve}=(0,g.useContext)(Tr);return o?Ar()?(0,n.jsxs)(r,{children:[(0,n.jsx)(Ln,{routeObjects:Ve}),(0,n.jsx)(c,{component:o,children:(0,n.jsx)(V.Z5,{children:(0,n.jsx)(V.AW,{path:se,element:(0,n.jsx)(n.Fragment,{children:O})})})})]}):(0,n.jsxs)(r,{basename:z,children:[(0,n.jsx)(Ln,{routeObjects:Ve}),(0,n.jsx)(c,{component:o,children:(0,n.jsx)(n.Fragment,{children:O})})]}):(this.appIdentityProxy.setTarget({getUserId:()=>"guest",getIdToken:async()=>{},getProfile:()=>({email:"guest@example.com",displayName:"Guest"}),getProfileInfo:async()=>({email:"guest@example.com",displayName:"Guest"}),getBackstageIdentity:async()=>({type:"user",userEntityRef:"user:default/guest",ownershipEntityRefs:["user:default/guest"]}),getCredentials:async()=>({}),signOut:async()=>{}},{signOutTargetUrl:z||"/"}),Ar()?(0,n.jsxs)(r,{children:[(0,n.jsx)(Ln,{routeObjects:Ve}),(0,n.jsx)(V.Z5,{children:(0,n.jsx)(V.AW,{path:se,element:(0,n.jsx)(n.Fragment,{children:O})})})]}):(0,n.jsxs)(r,{basename:z,children:[(0,n.jsx)(Ln,{routeObjects:Ve}),O]}))}}getApiHolder(){if(this.apiHolder){for(const r of this.plugins)for(const o of r.getApis())this.apiFactoryRegistry.get(o.api)||this.apiFactoryRegistry.register("default",o);return Me.validateFactories(this.apiFactoryRegistry,this.apiFactoryRegistry.getAllApis()),this.apiHolder}this.apiFactoryRegistry.register("static",{api:x.hg,deps:{},factory:()=>q.createWithStorage(this.themes)}),this.apiFactoryRegistry.register("static",{api:x.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:x.$4,deps:{},factory:()=>this.appIdentityProxy}),this.apiFactoryRegistry.register("default",{api:x.W0,deps:{},factory:()=>new ke});for(const r of this.defaultApis)this.apiFactoryRegistry.register("default",r);for(const r of this.plugins)for(const o of r.getApis())if(!this.apiFactoryRegistry.register("default",o))throw new Error(`Plugin ${r.getId()} tried to register duplicate or forbidden API factory for ${o.api}`);for(const r of this.apis)if(!this.apiFactoryRegistry.register("app",r))throw new Error(`Duplicate or forbidden API factory for ${r.api} in app`);return Me.validateFactories(this.apiFactoryRegistry,this.apiFactoryRegistry.getAllApis()),this.apiHolder=new Me(this.apiFactoryRegistry),this.apiHolder}verifyPlugins(r){const o=new Set;for(const c of r){const f=c.getId();if(o.has(f))throw new Error(`Duplicate plugin found '${f}'`);o.add(f)}}constructor(r){this.appIdentityProxy=new Ds;var o;this.apis=(o=r.apis)!==null&&o!==void 0?o:[],this.icons=r.icons;var c;this.plugins=new Set((c=r.plugins)!==null&&c!==void 0?c:[]),this.components=r.components,this.themes=r.themes;var f;this.configLoader=(f=r.configLoader)!==null&&f!==void 0?f:Vr;var O;this.defaultApis=(O=r.defaultApis)!==null&&O!==void 0?O:[],this.bindRoutes=r.bindRoutes,this.apiFactoryRegistry=new Qe}}function hs(a){return new Ns(a)}let Hr=!1;const ps=a=>{const r=(0,x.qD)(),{NotFoundErrorPage:o}=r.getComponents(),c=(0,g.useMemo)(()=>Ar(),[]),O=[...(0,x.vJ)(a.children,M=>M.getElements().flatMap(z=>{let se=z.props.path;if(se==="")return[];var Ve;se=(Ve=se==null?void 0:se.replace(/\/\*$/,""))!==null&&Ve!==void 0?Ve:"/";let Ue=c?z:z.props.element;return!c&&!Ue&&(Ue=z,Hr||(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] />} />."),Hr=!0)),[{path:se,element:Ue,children:z.props.children?[{path:se==="/"?"/":"*",element:z.props.children}]:void 0}]}).sort((z,se)=>se.path.localeCompare(z.path)).map(z=>({...z,path:z.path==="/"?"/":`${z.path}/*`}))),{path:"*",element:(0,n.jsx)(o,{})}];return(0,V.V$)(O)};var Gr=t(25488);const fs=[(0,x.ni)({api:x.NW,deps:{configApi:x.Ds},factory:({configApi:a})=>S.compile(`${a.getString("backend.baseUrl")}/api/{{ pluginId }}`)}),(0,x.ni)({api:x.$v,deps:{},factory:()=>new xt}),(0,x.ni)({api:x.v_,deps:{},factory:()=>new ae}),(0,x.ni)({api:x.VE,deps:{alertApi:x.$v},factory:({alertApi:a})=>{const r=new H(a,new me);return ue.forward(r,{hidden:!1}),r}}),(0,x.ni)({api:x.E6,deps:{errorApi:x.VE},factory:({errorApi:a})=>Ut.create({errorApi:a})}),(0,x.ni)({api:x.gP,deps:{configApi:x.Ds,identityApi:x.$4,discoveryApi:x.NW},factory:({configApi:a,identityApi:r,discoveryApi:o})=>Ne({middleware:[Tt.resolvePluginProtocol({discoveryApi:o}),Tt.injectIdentityAuth({identityApi:r,config:a})]})}),(0,x.ni)({api:x.ZM,deps:{},factory:()=>new Gn}),(0,x.ni)({api:x.Kp,deps:{discoveryApi:x.NW,oauthRequestApi:x.ZM,configApi:x.Ds},factory:({discoveryApi:a,oauthRequestApi:r,configApi:o})=>Zn.create({discoveryApi:a,oauthRequestApi:r,environment:o.getOptionalString("auth.environment")})}),(0,x.ni)({api:x.p_,deps:{discoveryApi:x.NW,oauthRequestApi:x.ZM,configApi:x.Ds},factory:({discoveryApi:a,oauthRequestApi:r,configApi:o})=>cn.create({discoveryApi:a,oauthRequestApi:r,environment:o.getOptionalString("auth.environment")})}),(0,x.ni)({api:x.F4,deps:{discoveryApi:x.NW,oauthRequestApi:x.ZM,configApi:x.Ds},factory:({discoveryApi:a,oauthRequestApi:r,configApi:o})=>sn.create({discoveryApi:a,oauthRequestApi:r,defaultScopes:["read:user"],environment:o.getOptionalString("auth.environment")})}),(0,x.ni)({api:x.D,deps:{discoveryApi:x.NW,oauthRequestApi:x.ZM,configApi:x.Ds},factory:({discoveryApi:a,oauthRequestApi:r,configApi:o})=>Jn.create({discoveryApi:a,oauthRequestApi:r,environment:o.getOptionalString("auth.environment")})}),(0,x.ni)({api:x.ux,deps:{discoveryApi:x.NW,oauthRequestApi:x.ZM,configApi:x.Ds},factory:({discoveryApi:a,oauthRequestApi:r,configApi:o})=>Gt.create({discoveryApi:a,oauthRequestApi:r,environment:o.getOptionalString("auth.environment")})}),(0,x.ni)({api:x.gW,deps:{discoveryApi:x.NW,oauthRequestApi:x.ZM,configApi:x.Ds},factory:({discoveryApi:a,oauthRequestApi:r,configApi:o})=>ge.create({discoveryApi:a,oauthRequestApi:r,environment:o.getOptionalString("auth.environment")})}),(0,x.ni)({api:x.bq,deps:{discoveryApi:x.NW,oauthRequestApi:x.ZM,configApi:x.Ds},factory:({discoveryApi:a,oauthRequestApi:r,configApi:o})=>Ee.create({discoveryApi:a,oauthRequestApi:r,defaultScopes:["team"],environment:o.getOptionalString("auth.environment")})}),(0,x.ni)({api:x.uB,deps:{discoveryApi:x.NW,oauthRequestApi:x.ZM,configApi:x.Ds},factory:({discoveryApi:a,oauthRequestApi:r,configApi:o})=>qe.create({discoveryApi:a,oauthRequestApi:r,environment:o.getOptionalString("auth.environment")})}),(0,x.ni)({api:Gr.RV,deps:{discovery:x.NW,identity:x.$4,config:x.Ds},factory:({config:a,discovery:r,identity:o})=>Gr.iM.create({config:a,discovery:r,identity:o})})];var Kr=t(77277),Zt=t(93414),fr=t(62833);function Yr({children:a}){return(0,V.GV)()?(0,n.jsx)(n.Fragment,{children:a}):(0,n.jsx)(V.VA,{children:a})}const gs=()=>(0,n.jsx)(Zt.mf,{status:"404",statusMessage:"PAGE NOT FOUND"}),Jr=({step:a,error:r})=>{let o="";return a==="load-config"?o=`The configuration failed to load, someone should have a look at this error: ${r.message}`:a==="load-chunk"&&(o=`Lazy loaded chunk failed to load, try to reload the page: ${r.message}`),(0,n.jsx)(Yr,{children:(0,n.jsx)(Zt.mf,{status:"501",statusMessage:o})})},bn=({error:a,resetError:r,plugin:o})=>(0,n.jsx)(Zt.yu,{title:`Error in ${o==null?void 0:o.getId()}`,defaultExpanded:!0,error:a,children:(0,n.jsx)(Kr.Z,{variant:"outlined",onClick:r,children:"Retry"})}),Xn={Progress:Zt.Ex,Router:fr.VK,NotFoundErrorPage:gs,BootErrorPage:Jr,ErrorBoundaryFallback:bn};var ms=t(43642),vs=t(80079),ys=t(90941),xs=t(32915),bs=t(40562),Ss=t(21853),Cs=t(60744),Qr=t(66569),Ir=t(30254),Fs=t(13384),ws=t(15933),Xr=t(58838),Us=t(86737),y=t(4989),b=t(44407),k=t(18628),N=t(84219),G=t(98685),K=t(39781);const de={brokenImage:vs.Z,catalog:k.Z,scaffolder:xs.Z,techdocs:bs.Z,search:Ss.Z,chat:Cs.Z,dashboard:Qr.Z,docs:Ir.Z,email:Fs.Z,github:Xr.Z,group:N.Z,help:Us.Z,"kind:api":ws.Z,"kind:component":b.Z,"kind:domain":ms.Z,"kind:group":N.Z,"kind:location":y.Z,"kind:system":ys.Z,"kind:user":G.Z,user:G.Z,warning:K.Z};var le=t(73689),ye=t(48032);const we={wave:`url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='1368' height='400' fill='none'%3e%3cmask id='a' width='1368' height='401' x='0' y='0' maskUnits='userSpaceOnUse'%3e%3cpath fill='url(%23paint0_linear)' d='M437 116C223 116 112 0 112 0h1256v400c-82 0-225-21-282-109-112-175-436-175-649-175z'/%3e%3cpath fill='url(%23paint1_linear)' d='M1368 400V282C891-29 788 40 711 161 608 324 121 372 0 361v39h1368z'/%3e%3cpath fill='url(%23paint2_linear)' d='M1368 244v156H0V94c92-24 198-46 375 0l135 41c176 51 195 109 858 109z'/%3e%3cpath fill='url(%23paint3_linear)' d='M1252 400h116c-14-7-35-14-116-16-663-14-837-128-1013-258l-85-61C98 28 46 8 0 0v400h1252z'/%3e%3c/mask%3e%3cg mask='url(%23a)'%3e%3cpath fill='white' d='M-172-98h1671v601H-172z'/%3e%3c/g%3e%3cdefs%3e%3clinearGradient id='paint0_linear' x1='602' x2='1093.5' y1='-960.5' y2='272' gradientUnits='userSpaceOnUse'%3e%3cstop stop-color='white'/%3e%3cstop offset='1' stop-color='white' stop-opacity='0'/%3e%3c/linearGradient%3e%3clinearGradient id='paint1_linear' x1='482' x2='480' y1='1058.5' y2='70.5' gradientUnits='userSpaceOnUse'%3e%3cstop stop-color='white'/%3e%3cstop offset='1' stop-color='white' stop-opacity='0'/%3e%3c/linearGradient%3e%3clinearGradient id='paint2_linear' x1='424' x2='446.1' y1='-587.5' y2='274.6' gradientUnits='userSpaceOnUse'%3e%3cstop stop-color='white'/%3e%3cstop offset='1' stop-color='white' stop-opacity='0'/%3e%3c/linearGradient%3e%3clinearGradient id='paint3_linear' x1='587' x2='349' y1='-1120.5' y2='341' gradientUnits='userSpaceOnUse'%3e%3cstop stop-color='white'/%3e%3cstop offset='1' stop-color='white' stop-opacity='0'/%3e%3c/linearGradient%3e%3c/defs%3e%3c/svg%3e")`,wave2:`url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='1368' height='400' fill='none'%3e%3cmask id='a' width='1764' height='479' x='-229' y='-6' maskUnits='userSpaceOnUse'%3e%3cpath fill='url(%23paint0_linear)' d='M0 400h1350C1321 336 525 33 179-2c-345-34-395 236-408 402H0z'/%3e%3cpath fill='url(%23paint1_linear)' d='M1378 177v223H0V217s219 75 327 52C436 246 717-35 965 45s254 144 413 132z'/%3e%3cpath fill='url(%23paint2_linear)' d='M26 400l-78-16c-170 205-44-6-137-30l-4-1 4 1 137 30c37-45 89-110 159-201 399-514-45 238 1176-50 275-65 354-39 91 267H26z'/%3e%3c/mask%3e%3cg mask='url(%23a)'%3e%3cpath fill='white' d='M0 0h1368v400H0z'/%3e%3c/g%3e%3cdefs%3e%3clinearGradient id='paint0_linear' x1='431' x2='397.3' y1='-599' y2='372.8' gradientUnits='userSpaceOnUse'%3e%3cstop stop-color='white'/%3e%3cstop offset='1' stop-color='white' stop-opacity='0'/%3e%3c/linearGradient%3e%3clinearGradient id='paint1_linear' x1='236.5' x2='446.6' y1='-586' y2='381.5' gradientUnits='userSpaceOnUse'%3e%3cstop stop-color='white'/%3e%3cstop offset='1' stop-color='white' stop-opacity='0'/%3e%3c/linearGradient%3e%3clinearGradient id='paint2_linear' x1='851.8' x2='640.4' y1='-867.2' y2='363.7' gradientUnits='userSpaceOnUse'%3e%3cstop stop-color='white'/%3e%3cstop offset='1' stop-color='white' stop-opacity='0'/%3e%3c/linearGradient%3e%3c/defs%3e%3c/svg%3e")`,round:`url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='1368' height='400' fill='none'%3e%3cmask id='a' width='2269' height='1408' x='-610' y='-509' maskUnits='userSpaceOnUse'%3e%3ccircle cx='1212.8' cy='74.8' r='317.5' fill='url(%23paint0_linear)' transform='rotate(-52 1213 75)'/%3e%3ccircle cx='737.8' cy='445.8' r='317.5' fill='url(%23paint1_linear)' transform='rotate(-116 738 446)'/%3e%3ccircle cx='601.8' cy='52.8' r='418.6' fill='url(%23paint2_linear)' transform='rotate(-117 602 53)'/%3e%3ccircle cx='999.8' cy='364' r='389.1' fill='url(%23paint3_linear)' transform='rotate(31 1000 364)'/%3e%3cellipse cx='-109.2' cy='263.5' fill='url(%23paint4_linear)' rx='429.2' ry='465.8' transform='rotate(-85 -109 264)'/%3e%3c/mask%3e%3cg mask='url(%23a)'%3e%3cpath fill='white' d='M0 0h1368v400H0z'/%3e%3c/g%3e%3cdefs%3e%3clinearGradient id='paint0_linear' x1='1301.2' x2='161.4' y1='-1879.7' y2='-969.6' gradientUnits='userSpaceOnUse'%3e%3cstop stop-color='white'/%3e%3cstop offset='1' stop-color='white' stop-opacity='0'/%3e%3c/linearGradient%3e%3clinearGradient id='paint1_linear' x1='826.2' x2='-313.6' y1='-1508.7' y2='-598.6' gradientUnits='userSpaceOnUse'%3e%3cstop stop-color='white'/%3e%3cstop offset='1' stop-color='white' stop-opacity='0'/%3e%3c/linearGradient%3e%3clinearGradient id='paint2_linear' x1='718.4' x2='-784.3' y1='-2524' y2='-1324.2' gradientUnits='userSpaceOnUse'%3e%3cstop stop-color='white'/%3e%3cstop offset='1' stop-color='white' stop-opacity='0'/%3e%3c/linearGradient%3e%3clinearGradient id='paint3_linear' x1='1108.2' x2='-288.6' y1='-2031.1' y2='-915.9' gradientUnits='userSpaceOnUse'%3e%3cstop stop-color='white'/%3e%3cstop offset='1' stop-color='white' stop-opacity='0'/%3e%3c/linearGradient%3e%3clinearGradient id='paint4_linear' x1='10.4' x2='-1626.5' y1='-2603.8' y2='-1399.5' gradientUnits='userSpaceOnUse'%3e%3cstop stop-color='white'/%3e%3cstop offset='1' stop-color='white' stop-opacity='0'/%3e%3c/linearGradient%3e%3c/defs%3e%3c/svg%3e")`},Le={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 Ae(a){const{colors:r,shape:o,options:c}=a,O=`linear-gradient(90deg, ${(r.length===1?[r[0],r[0]]:r).join(", ")})`,M=`${o}, ${O}`;var z;const se=(z=c==null?void 0:c.fontColor)!==null&&z!==void 0?z:"#FFFFFF";return{colors:r,shape:o,backgroundImage:M,fontColor:se}}const Xe={home:Ae({colors:Le.teal,shape:we.wave}),documentation:Ae({colors:Le.pinkSea,shape:we.wave2}),tool:Ae({colors:Le.purpleSky,shape:we.round}),service:Ae({colors:Le.marineBlue,shape:we.wave}),website:Ae({colors:Le.veryBlue,shape:we.wave}),library:Ae({colors:Le.rubyRed,shape:we.wave}),other:Ae({colors:Le.darkGrey,shape:we.wave}),app:Ae({colors:Le.toastyOrange,shape:we.wave}),apis:Ae({colors:Le.teal,shape:we.wave2}),card:Ae({colors:Le.greens,shape:we.wave})},bt=16,Et='"Helvetica Neue", Helvetica, Roboto, Arial, sans-serif';function _e(a){const{palette:r,htmlFontSize:o=bt,fontFamily:c=Et,defaultPageTheme:f,pageTheme:O=Xe}=a;if(!O[f])throw new Error(`${f} is not defined in pageTheme.`);var M;return{palette:r,props:{MuiGrid:{spacing:2},MuiSwitch:{color:"primary"}},typography:{htmlFontSize:o,fontFamily:c,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:O[f],getPageTheme:({themeId:z})=>(M=O[z])!==null&&M!==void 0?M:O[f]}}function Ot(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,ye.darken)(a.palette.link,.3),background:(0,ye.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 Qt(a){const r=_e(a),o=(0,le.Z)(r),c=Ot(o);return{...o,overrides:c}}var qn=t(34505);const Vn=Qt({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:qn.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:Xe}),lr=Qt({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:qn.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:Xe});var un=t(98192),Sn=t(15222),kn=t(41547),Rr=t(87561);const Lr=[{id:"light",title:"Light Theme",variant:"light",icon:(0,n.jsx)(Sn.Z,{}),Provider:({children:a})=>(0,n.jsx)(kn.Z,{theme:Vn,children:(0,n.jsx)(Rr.ZP,{children:a})})},{id:"dark",title:"Dark Theme",variant:"dark",icon:(0,n.jsx)(un.Z,{}),Provider:({children:a})=>(0,n.jsx)(kn.Z,{theme:lr,children:(0,n.jsx)(Rr.ZP,{children:a})})}];function Dr(a){var r,o,c;return hs({...a,apis:(r=a==null?void 0:a.apis)!==null&&r!==void 0?r:[],bindRoutes:a==null?void 0:a.bindRoutes,components:{...Xn,...a==null?void 0:a.components},configLoader:a==null?void 0:a.configLoader,defaultApis:fs,icons:{...de,...a==null?void 0:a.icons},plugins:(o=a==null?void 0:a.plugins)!==null&&o!==void 0?o:[],themes:(c=a==null?void 0:a.themes)!==null&&c!==void 0?c:Lr})}var hn=t(25271),An=t(76635);async function gr({storageApi:a}){const r=a.forBucket("settings"),o=a.forBucket("starredEntities"),c=r.snapshot("starredEntities").value;if(!(0,An.isArray)(c))return;var f;const O=new Set((f=o.snapshot("entityRefs").value)!==null&&f!==void 0?f:[]);c.filter(An.isString).map(M=>M.split(":")).filter(M=>M.length===4&&M[0]==="entity").map(([M,z,se,Ve])=>(0,hn.eE)({kind:z,namespace:se,name:Ve})).forEach(M=>O.add(M)),await o.set("entityRefs",Array.from(O)),await r.remove("starredEntities")}class ti{async toggleStarred(r){this.starredEntities.has(r)?this.starredEntities.delete(r):this.starredEntities.add(r),await this.settingsStore.set("entityRefs",Array.from(this.starredEntities))}starredEntitie$(){return this.observable}notifyChanges(){for(const r of this.subscribers)r.next(new Set(this.starredEntities))}constructor(r){this.subscribers=new Set,this.observable=new(re())(c=>(c.next(new Set(this.starredEntities)),this.subscribers.add(c),()=>{this.subscribers.delete(c)})),gr(r).then(),this.settingsStore=r.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:c=>{var f;this.starredEntities=new Set((f=c.value)!==null&&f!==void 0?f:[]),this.notifyChanges()}})}}var ni=t(33414),Ki=t(79324),Kn=t(79692),Yi=t(65826);const ri=(0,Kn.Z)({flexContainer:{flexWrap:"wrap"},itemText:{width:"100%",wordBreak:"break-all",marginBottom:"1rem"}});function Ji(a){var r,o;const c=a.result,f=ri(),O=useAnalytics(),M=()=>{O.captureEvent("discover",c.title,{attributes:{to:c.location},value:a.rank})};return _jsxs(Link,{noTrack:!0,to:c.location,onClick:M,children:[_jsxs(ListItem,{alignItems:"flex-start",children:[a.icon&&_jsx(ListItemIcon,{children:a.icon}),_jsxs("div",{className:f.flexContainer,children:[_jsx(ListItemText,{className:f.itemText,primaryTypographyProps:{variant:"h6"},primary:!((r=a.highlight)===null||r===void 0)&&r.fields.title?_jsx(HighlightedSearchResultText,{text:a.highlight.fields.title,preTag:a.highlight.preTag,postTag:a.highlight.postTag}):c.title,secondary:!((o=a.highlight)===null||o===void 0)&&o.fields.text?_jsx(HighlightedSearchResultText,{text:a.highlight.fields.text,preTag:a.highlight.preTag,postTag:a.highlight.postTag}):c.text}),_jsxs(Box,{children:[c.kind&&_jsx(Chip,{label:`Kind: ${c.kind}`,size:"small"}),c.lifecycle&&_jsx(Chip,{label:`Lifecycle: ${c.lifecycle}`,size:"small"})]})]})]}),_jsx(Divider,{component:"li"})]})}var Qi=t(86359),On=t(43297),Ms=t(95544),si=t(99688),Nr=t(12231),qr=t(86136),_r=t(49378),vo=t(85256),zs=t(61837),yo=t(79784),xo=t(50758),oi=t(31654),ii=t(43054),Vs=t(65759),Pr=t(51666);const es="catalog-entity",bo=(0,Pr.J$)({name:"catalog.entity.read",attributes:{action:"read"},resourceType:es}),Ws=(0,Pr.J$)({name:"catalog.entity.create",attributes:{action:"create"}}),js=(0,Pr.J$)({name:"catalog.entity.delete",attributes:{action:"delete"},resourceType:es}),So=(0,Pr.J$)({name:"catalog.entity.refresh",attributes:{action:"update"},resourceType:es}),Co=(0,Pr.J$)({name:"catalog.location.read",attributes:{action:"read"}}),Es=(0,Pr.J$)({name:"catalog.location.create",attributes:{action:"create"}}),wo=(0,Pr.J$)({name:"catalog.location.delete",attributes:{action:"delete"}}),ai=[bo,Ws,js,So,Co,Es,wo];var jo=t(49166);function li(a){const{unregisterEntityOptions:r,isUnregisterAllowed:o,onUnregisterEntity:c,onClose:f}=a,O=typeof(r==null?void 0:r.disableUnregister)=="boolean";var M;const z=(M=!o||(O?!!(r!=null&&r.disableUnregister):(r==null?void 0:r.disableUnregister)==="disable"))!==null&&M!==void 0?M:!1;let se=(0,n.jsx)(n.Fragment,{});return(r==null?void 0:r.disableUnregister)!=="hidden"&&(se=(0,n.jsxs)(Nr.Z,{onClick:()=>{f(),c()},disabled:z,children:[(0,n.jsx)(qr.Z,{children:(0,n.jsx)(jo.Z,{fontSize:"small"})}),(0,n.jsx)(_r.Z,{primary:"Unregister entity"})]})),(0,n.jsx)(n.Fragment,{children:se})}const Eo=(0,Kn.Z)(a=>({button:{color:a.page.fontColor}}),{name:"PluginCatalogEntityContextMenu"});function Ao(a){const{UNSTABLE_extraContextMenuItems:r,UNSTABLE_contextMenuOptions:o,onUnregisterEntity:c,onInspectEntity:f}=a,[O,M]=(0,g.useState)(),z=Eo(),Ve=(0,On.N$)(js).allowed,Ue=Mt=>{M(Mt.currentTarget)},wt=()=>{M(void 0)},dt=(0,x.h_)(x.$v),It=(0,g.useCallback)(()=>{navigator.clipboard.writeText(window.location.toString()).then(()=>dt.post({message:"Copied!",severity:"info"}))},[dt]),Dt=r&&[...r.map(Mt=>(0,n.jsxs)(Nr.Z,{onClick:()=>{wt(),Mt.onClick()},children:[(0,n.jsx)(qr.Z,{children:(0,n.jsx)(Mt.Icon,{fontSize:"small"})}),(0,n.jsx)(_r.Z,{primary:Mt.title})]},Mt.title)),(0,n.jsx)(vo.Z,{},"the divider is here!")];return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(zs.Z,{"aria-label":"more","aria-controls":"long-menu","aria-haspopup":"true","aria-expanded":!!O,role:"button",onClick:Ue,"data-testid":"menu-button",className:z.button,id:"long-menu",children:(0,n.jsx)(ii.Z,{})}),(0,n.jsx)(yo.ZP,{open:Boolean(O),onClose:wt,anchorEl:O,anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"},"aria-labelledby":"long-menu",children:(0,n.jsxs)(xo.Z,{children:[Dt,(0,n.jsx)(li,{unregisterEntityOptions:o,isUnregisterAllowed:Ve,onUnregisterEntity:c,onClose:wt}),(0,n.jsxs)(Nr.Z,{onClick:()=>{wt(),f()},children:[(0,n.jsx)(qr.Z,{children:(0,n.jsx)(oi.Z,{fontSize:"small"})}),(0,n.jsx)(_r.Z,{primary:"Inspect entity"})]}),(0,n.jsxs)(Nr.Z,{onClick:()=>{wt(),It()},children:[(0,n.jsx)(qr.Z,{children:(0,n.jsx)(Vs.Z,{fontSize:"small"})}),(0,n.jsx)(_r.Z,{primary:"Copy entity URL"})]})]})})]})}const As="plugin.catalog.entityLayoutRoute",Ts=()=>null;(0,x.R5)(Ts,As,!0),(0,x.R5)(Ts,"core.gatherMountPoints",!0);function Hs(a){const{entity:r,title:o}=a;return(0,n.jsxs)(Ms.Z,{display:"inline-flex",alignItems:"center",height:"1em",maxWidth:"100%",children:[(0,n.jsx)(Ms.Z,{component:"span",textOverflow:"ellipsis",whiteSpace:"nowrap",overflow:"hidden",children:o}),r&&(0,n.jsx)(On.LH,{entity:r})]})}function To(a,r,o,c){var f;const O=(f=a!=null?a:c==null?void 0:c.kind)!==null&&f!==void 0?f:"";var M;const z=(M=r!=null?r:c==null?void 0:c.metadata.namespace)!==null&&M!==void 0?M:"";var se,Ve,Ue;return{headerTitle:`${(Ue=(Ve=(se=c==null?void 0:c.metadata.title)!==null&&se!==void 0?se:o)!==null&&Ve!==void 0?Ve:c==null?void 0:c.metadata.name)!==null&&Ue!==void 0?Ue:""}${z&&z!==hn.zG?` in ${z}`:""}`,headerType:(()=>{let dt=O.toLocaleLowerCase("en-US");return c&&c.spec&&"type"in c.spec&&(dt+=" \u2014 ",dt+=c.spec.type.toLocaleLowerCase("en-US")),dt})()}}function Gs(a){var r;const{entity:o}=a,c=(0,On.hF)(o,hn.S4);return(0,n.jsxs)(n.Fragment,{children:[c.length>0&&(0,n.jsx)(Zt.i9,{label:"Owner",value:(0,n.jsx)(On.rI,{entityRefs:c,defaultKind:"Group",color:"inherit"})}),((r=o.spec)===null||r===void 0?void 0:r.lifecycle)&&(0,n.jsx)(Zt.i9,{label:"Lifecycle",value:o.spec.lifecycle})]})}const Ks=a=>{var r,o;const{UNSTABLE_extraContextMenuItems:c,UNSTABLE_contextMenuOptions:f,children:O,NotFoundComponent:M}=a,{kind:z,namespace:se,name:Ve}=(0,x.Oi)(On.wi),{entity:Ue,loading:wt,error:dt}=(0,On.ce)(),It=(0,V.TH)(),Dt=(0,x.vJ)(O,Os=>Os.selectByComponentData({key:As,withStrictError:"Child of EntityLayout must be an EntityLayout.Route"}).getElements().flatMap(({props:ur})=>{if(Ue){if(ur.if&&!ur.if(Ue))return[]}else return[];return[{path:ur.path,title:ur.title,children:ur.children,tabProps:ur.tabProps}]}),[Ue]),{headerTitle:Mt,headerType:Tn}=To(z,se,Ve,Ue),[rr,tr]=(0,g.useState)(!1),[dr,ks]=(0,g.useState)(!1),Ho=(0,V.s0)(),Ci=async()=>{tr(!1),ks(!1),Ho("/")};(0,g.useEffect)(()=>{tr(!1),ks(!1)},[It.pathname]);var uo;return(0,n.jsxs)(Zt.T3,{themeId:(uo=Ue==null||(r=Ue.spec)===null||r===void 0||(o=r.type)===null||o===void 0?void 0:o.toString())!==null&&uo!==void 0?uo:"home",children:[(0,n.jsx)(Zt.h4,{title:(0,n.jsx)(Hs,{title:Mt,entity:Ue}),pageTitleOverride:Mt,type:Tn,children:Ue&&(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(Gs,{entity:Ue}),(0,n.jsx)(Ao,{UNSTABLE_extraContextMenuItems:c,UNSTABLE_contextMenuOptions:f,onUnregisterEntity:()=>tr(!0),onInspectEntity:()=>ks(!0)})]})}),wt&&(0,n.jsx)(Zt.Ex,{}),Ue&&(0,n.jsx)(Zt.tn,{routes:Dt}),dt&&(0,n.jsx)(Zt.VY,{children:(0,n.jsx)(si.Z,{severity:"error",children:dt.toString()})}),!wt&&!dt&&!Ue&&(0,n.jsx)(Zt.VY,{children:M||(0,n.jsxs)(Zt.GB,{title:"Entity not found",children:["There is no ",z," with the requested"," ",(0,n.jsx)(Zt.rU,{to:"https://backstage.io/docs/features/software-catalog/references",children:"kind, namespace, and name"}),"."]})}),(0,n.jsx)(On.pp,{open:rr,entity:Ue,onConfirm:Ci,onClose:()=>tr(!1)}),(0,n.jsx)(On.U_,{open:dr,entity:Ue,onClose:()=>ks(!1)})]})};Ks.Route=Ts;var ci=t(23054);function Xi(a){const{open:r,onClose:o,onConfirm:c,entity:f}=a,[O,M]=useState(!1),z=useApi(catalogApiRef),se=useApi(alertApiRef),Ve=async()=>{M(!0);try{const Ue=f.metadata.uid;await z.removeEntityByUid(Ue),c()}catch(Ue){assertError(Ue),se.post({message:Ue.message})}finally{M(!1)}};return _jsxs(Dialog,{open:r,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:O,onClick:Ve,children:"Delete"}),_jsx(Button,{onClick:o,color:"primary",children:"Cancel"})]})]})}var ts=t(19625);function Io(a){var r,o;return(a==null||(r=a.metadata)===null||r===void 0||(o=r.annotations)===null||o===void 0?void 0:o["backstage.io/orphan"])==="true"}function di(){const a=useNavigate(),r=useRouteRef(rootRouteRef),[o,c]=useState(!1),{entity:f}=useEntity(),O=async()=>{c(!1),a(r())};return _jsxs(_Fragment,{children:[_jsx(Alert,{severity:"warning",onClick:()=>c(!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:O,onClose:()=>c(!1)})]})}var Yn=t(29644);const ui=a=>a.error&&a.level==="error"&&a.type===ENTITY_STATUS_CATALOG_PROCESSING_TYPE;async function Ro(a,r){return{items:(await r.getEntityAncestors({entityRef:a})).items.map(f=>{var O,M;return{errors:((M=(O=f.entity.status)===null||O===void 0?void 0:O.items)!==null&&M!==void 0?M:[]).filter(ui).map(Ve=>Ve.error).filter(Ve=>Boolean(Ve)),entity:f.entity}}).filter(f=>f.errors.length>0)}}async function qi(a,r){const o=r.apis.get(catalogApiRef);if(!o)throw new Error(`No implementation available for ${catalogApiRef}`);return(await Ro(stringifyEntityRef(a),o)).items.length>0}function _i(){const{entity:a}=useEntity(),r=stringifyEntityRef(a),o=useApi(catalogApiRef),{loading:c,error:f,value:O}=useAsync(async()=>Ro(r,o),[r,o]);return f?_jsx(Box,{mb:1,children:_jsx(ResponseErrorPanel,{error:f})}):c||!O?null:_jsx(_Fragment,{children:O.items.map((M,z)=>_jsxs(Box,{mb:1,children:[stringifyEntityRef(a)!==stringifyEntityRef(M.entity)&&_jsxs(Box,{p:1,children:["The error below originates from"," ",_jsx(EntityRefLink,{entityRef:M.entity})]}),M.errors.map((se,Ve)=>_jsx(ResponseErrorPanel,{error:se},Ve))]},z))})}const Lo="core.backstage.entitySwitch",Po=a=>null;(0,x.R5)(Po,Lo,!0);const hi=a=>{var r;const{entity:o,loading:c}=(0,On.ce)(),f=(0,x.I_)(),O=(0,x.vJ)(a.children,se=>se.selectByComponentData({key:Lo,withStrictError:"Child of EntitySwitch is not an EntitySwitch.Case"}).getElements().flatMap(Ve=>{if(c)return[];const{if:Ue,children:wt}=Ve.props;if(!o)return[{if:Ue===void 0,children:wt}];var dt;return[{if:(dt=Ue==null?void 0:Ue(o,{apis:f}))!==null&&dt!==void 0?dt:!0,children:wt}]}),[f,o,c]);if(O.some(se=>typeof se.if=="object"&&"then"in se.if))return(0,n.jsx)(pi,{results:O});var z;return(z=(r=O.find(se=>se.if))===null||r===void 0?void 0:r.children)!==null&&z!==void 0?z:null};function pi({results:a}){const{loading:r,value:o}=(0,Ft.default)(async()=>{const c=a.map(async({if:O,children:M})=>{try{if(await O)return M}catch{}return null});var f;return(f=(await Promise.all(c)).find(Boolean))!==null&&f!==void 0?f:null},[a]);return r||!o?null:o}hi.Case=Po;const Is=null,ea=On._i.Filters,ta=On._i.Content,Wn=(0,x.rx)({id:"catalog",apis:[(0,x.ni)({api:On.Ah,deps:{discoveryApi:x.NW,fetchApi:x.gP},factory:({discoveryApi:a,fetchApi:r})=>new Yn.MS({discoveryApi:a,fetchApi:r})}),(0,x.ni)({api:On.p3,deps:{storageApi:x.E6},factory:({storageApi:a})=>new ti({storageApi:a})})],routes:{catalogIndex:ts._Z,catalogEntity:On.wi},externalRoutes:{createComponent:ts.yw,viewTechDoc:ts.jU},__experimentalConfigure(a){return{...{createButtonTitle:"Create"},...a}}}),fi=Wn.provide((0,x.P4)({name:"CatalogIndexPage",component:()=>t.e(5837).then(t.bind(t,95837)).then(a=>a.CatalogPage),mountPoint:ts._Z})),Rs=Wn.provide((0,x.P4)({name:"CatalogEntityPage",component:()=>t.e(8951).then(t.bind(t,78951)).then(a=>a.CatalogEntityPage),mountPoint:On.wi})),gi=Wn.provide((0,x.CO)({name:"EntityAboutCard",component:{lazy:()=>Promise.resolve().then(t.bind(t,33414)).then(a=>a.AboutCard)}})),mi=Wn.provide((0,x.CO)({name:"EntityLinksCard",component:{lazy:()=>t.e(7750).then(t.bind(t,17750)).then(a=>a.EntityLinksCard)}})),vi=Wn.provide((0,x.CO)({name:"EntityHasSystemsCard",component:{lazy:()=>t.e(5458).then(t.bind(t,5458)).then(a=>a.HasSystemsCard)}})),Ys=Wn.provide((0,x.CO)({name:"EntityHasComponentsCard",component:{lazy:()=>t.e(1105).then(t.bind(t,1105)).then(a=>a.HasComponentsCard)}})),Ls=Wn.provide((0,x.CO)({name:"EntityHasSubcomponentsCard",component:{lazy:()=>t.e(2440).then(t.bind(t,82440)).then(a=>a.HasSubcomponentsCard)}})),ko=Wn.provide((0,x.CO)({name:"EntityHasResourcesCard",component:{lazy:()=>t.e(9770).then(t.bind(t,79770)).then(a=>a.HasResourcesCard)}})),Oo=Wn.provide((0,x.CO)({name:"EntityDependsOnComponentsCard",component:{lazy:()=>t.e(9545).then(t.bind(t,19545)).then(a=>a.DependsOnComponentsCard)}})),cr=Wn.provide((0,x.CO)({name:"EntityDependencyOfComponentsCard",component:{lazy:()=>t.e(184).then(t.bind(t,40184)).then(a=>a.DependencyOfComponentsCard)}})),yi=Wn.provide((0,x.CO)({name:"EntityDependsOnResourcesCard",component:{lazy:()=>t.e(1032).then(t.bind(t,81032)).then(a=>a.DependsOnResourcesCard)}})),$o=Wn.provide((0,x.CO)({name:"RelatedEntitiesCard",component:{lazy:()=>t.e(732).then(t.bind(t,732)).then(a=>a.RelatedEntitiesCard)}}));var Js=t(32838);class xi{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(r,o){const f=`${await this.getApiOrigin()}/${o}`,O=await fetch(`${f.endsWith("/")?f:`${f}/`}index.html`);if(O.status===404)throw new Error("Page not found");return O.text()}async syncEntityDocs(r){return"cached"}async getBaseUrl(r,o,c){const f=await this.getApiOrigin();return new URL(r,`${f}/${c}`).toString()}constructor({configApi:r,discoveryApi:o,identityApi:c}){this.configApi=r,this.discoveryApi=o,this.identityApi=c}}class _n{async getApiOrigin(){return await this.discoveryApi.getBaseUrl("techdocs")}async getEntityMetadata(r){return{apiVersion:"backstage.io/v1alpha1",kind:"Component",metadata:{name:"local"},spec:{owner:"test",lifecycle:"experimental"}}}async getTechDocsMetadata(r){return{site_name:"Live preview environment",site_description:""}}constructor({configApi:r,discoveryApi:o,identityApi:c}){this.configApi=r,this.discoveryApi=o,this.identityApi=c}}const Qs=[(0,x.ni)({api:Ie.Dl,deps:{configApi:x.Ds,discoveryApi:x.NW,identityApi:x.$4},factory:({configApi:a,discoveryApi:r,identityApi:o})=>new xi({configApi:a,discoveryApi:r,identityApi:o})}),(0,x.ni)({api:Ie.gT,deps:{configApi:x.Ds,discoveryApi:x.NW,identityApi:x.$4},factory:({configApi:a,discoveryApi:r,identityApi:o})=>new _n({configApi:a,discoveryApi:r,identityApi:o})}),(0,x.ni)({api:Js.q3,deps:{configApi:x.Ds},factory:({configApi:a})=>Js.ae.fromConfig(a)})],ns={backend:{baseUrl:"http://localhost:3000"},techdocs:{builder:"external"}},Xs={backend:{baseUrl:"http://localhost:7007"},techdocs:{builder:"external"}};async function rs(){const a=await fetch("/.detect");return a.ok?(await a.text()).trim()==="techdocs-cli-server":!1}async function _s(){const a=await Vr(),r=await rs();return[...a,{context:"detected",data:r?ns:Xs}]}var eo=t(58845);const to=(0,Kn.Z)({svg:{width:"auto",height:30},path:{fill:"#7df3e1"}});var Fr=()=>{const a=to();return(0,n.jsx)("svg",{className:a.svg,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 2079.95 456.05",children:(0,n.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 Bo=(0,Kn.Z)({svg:{width:"auto",height:28},path:{fill:"#7df3e1"}});var Do=()=>{const a=Bo();return(0,n.jsx)("svg",{className:a.svg,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 337.46 428.5",children:(0,n.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 no=(0,Kn.Z)({root:{width:Zt.po.drawerWidthClosed,height:3*Zt.po.logoHeight,display:"flex",flexFlow:"row nowrap",alignItems:"center",marginBottom:-14},link:{width:Zt.po.drawerWidthClosed,marginLeft:24}}),ro=()=>{const a=no(),{isOpen:r}=(0,Zt.mZ)();return(0,n.jsx)("div",{className:a.root,children:(0,n.jsx)(Zt.rU,{to:"/docs/default/component/local/",underline:"none",className:a.link,children:r?(0,n.jsx)(Fr,{}):(0,n.jsx)(Do,{})})})},so=({children:a})=>(0,n.jsxs)(Zt.tR,{children:[(0,n.jsxs)(Zt.YE,{children:[(0,n.jsx)(ro,{}),(0,n.jsx)(Zt.v7,{}),(0,n.jsx)(Zt.R6,{icon:eo.Z,to:"/docs/default/component/local",text:"Docs Preview"})]}),a]});var oo=t(80030),io=t(32388),Ps=t(4142);const No=(0,Kn.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 er;(function(a){a.LIGHT="light",a.DARK="dark"})(er||(er={}));const Fo=()=>{const a=(0,x.h_)(x.hg),r=No(),[o,c]=(0,g.useState)(a.getActiveThemeId()===er.DARK?er.DARK:er.LIGHT),f={[er.LIGHT]:{icon:Ps.Z,title:"Dark theme"},[er.DARK]:{icon:io.Z,title:"Light theme"}},{title:O,icon:M}=f[o],z=()=>{c(se=>{const Ve=se===er.LIGHT?er.DARK:er.LIGHT;return a.setActiveThemeId(Ve),Ve})};return(0,n.jsx)(Ms.Z,{display:"flex",alignItems:"center",mr:2,children:(0,n.jsx)(oo.ZP,{title:O,arrow:!0,children:(0,n.jsx)(zs.Z,{size:"small",onClick:z,children:(0,n.jsx)(M,{className:r.headerIcon})})})})},Uo=()=>(0,n.jsxs)(T.I6,{children:[(0,n.jsx)(D.S,{}),(0,n.jsx)(X.F,{withSearch:!1})]}),Mo=(0,n.jsx)(Uo,{}),ao=Dr({apis:Qs,configLoader:_s,plugins:Object.values(h)}),zo=ao.getProvider(),lo=ao.getRouter(),co=T.s4.provide((0,Ie.KY)({name:"ThemeToggleAddon",component:Fo,location:Ie.oZ.Header})),Vo=(0,n.jsxs)(ps,{children:[(0,n.jsx)(V.Fg,{to:"/docs/default/component/local/"},"/"),(0,n.jsx)(V.AW,{path:"/catalog/:namespace/:kind/:name",element:(0,n.jsx)(Rs,{})}),(0,n.jsx)(V.AW,{path:"/docs",element:(0,n.jsx)(T.Jl,{}),children:(0,n.jsx)(L.u,{})}),(0,n.jsxs)(V.AW,{path:"/docs/:namespace/:kind/:name/*",element:(0,n.jsx)(T.I6,{}),children:[Mo,(0,n.jsx)(Ie.DR,{children:(0,n.jsx)(co,{})})]})]});var Wo=()=>(0,n.jsx)(zo,{children:(0,n.jsx)(lo,{children:(0,n.jsx)(so,{children:Vo})})});R.render((0,n.jsx)(Wo,{}),document.getElementById("root"))},51837:function(jt,Fe,t){"use strict";t.d(Fe,{CT:function(){return x},EI:function(){return ne},uW:function(){return R},Vt:function(){return l}});function h(){return typeof window!="undefined"&&window.Math===Math?window:typeof self!="undefined"&&self.Math===Math?self:Function("return this")()}const n=h(),g=J=>`__@backstage/${J}__`;function R(J,Q){const D=g(J);let X=n[D];return X||(X=Q(),n[D]=X,X)}var V=t(2784);function x(J){return R(J,()=>(0,V.createContext)(void 0))}function l(J){return(0,V.useContext)(x(J))}function I(J){return{set(Q){globalThis[`__@backstage/${J}__`]=createContext(createVersionedValueMap(Q))},reset(){delete globalThis[`__@backstage/${J}__`]}}}function ne(J){Object.freeze(J);const Q={atVersion(D){return J[D]}};return Object.defineProperty(Q,"$map",{configurable:!0,enumerable:!0,get(){return J}}),Q}},43297:function(jt,Fe,t){"use strict";t.d(Fe,{h$:function(){return sn},n3:function(){return h.n3},_i:function(){return $},zo:function(){return Re},tW:function(){return U},df:function(){return ue},UO:function(){return Nn},dq:function(){return ot},nl:function(){return Xr},dx:function(){return Qe},rI:function(){return ct},u3:function(){return Bt},xE:function(){return wn},sL:function(){return Ut},LH:function(){return Un},U_:function(){return Yr},pp:function(){return vs},EW:function(){return Qr},Ah:function(){return g},wi:function(){return gt},hF:function(){return vt},CV:function(){return Ge},$3:function(){return Me},p3:function(){return R},ce:function(){return fn},X2:function(){return Gt},wp:function(){return Yt},ZW:function(){return xt},N$:function(){return P},eK:function(){return Cn},CR:function(){return Ee}});var h=t(29644),n=t(25248);const g=(0,n.T0)({id:"plugin.catalog.service"}),R=(0,n.T0)({id:"catalog-react.starred-entities"});var V=t(82394);class x{async toggleStarred(b){this.starredEntities.delete(b)||this.starredEntities.add(b);for(const k of this.subscribers)k.next(new Set(this.starredEntities))}starredEntitie$(){return this.observable}constructor(){this.starredEntities=new Set,this.subscribers=new Set,this.observable=new ObservableImpl(b=>(b.next(new Set(this.starredEntities)),this.subscribers.add(b),()=>{this.subscribers.delete(b)}))}}var l=t(52322),I=t(2784),ne=t(41156),J=t(60364),Q=t(77277),D=t(4190),X=t(95544),_=t(90436),he=t(60905),ie=t(36444);const E=y=>{const b=(0,ne.Z)(K=>K.breakpoints.down("md")),k=(0,J.Z)(),[N,G]=(0,I.useState)(!1);return b?(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(Q.Z,{style:{marginTop:k.spacing(1),marginLeft:k.spacing(1)},onClick:()=>G(!0),startIcon:(0,l.jsx)(ie.Z,{}),children:"Filters"}),(0,l.jsx)(D.ZP,{open:N,onClose:()=>G(!1),anchor:"left",disableAutoFocus:!0,keepMounted:!0,variant:"temporary",children:(0,l.jsxs)(X.Z,{m:2,children:[(0,l.jsx)(_.Z,{variant:"h6",component:"h2",style:{marginBottom:k.spacing(1)},children:"Filters"}),y.children]})})]}):(0,l.jsx)(he.Z,{item:!0,lg:2,children:y.children})},L=y=>(0,l.jsx)(he.Z,{item:!0,xs:12,lg:10,children:y.children}),$=y=>(0,l.jsx)(he.Z,{container:!0,style:{position:"relative"},children:y.children});$.Filters=E,$.Content=L;var A=t(93414),T=t(82108),ee=t.n(T),Ie=t(829),Je=t.n(Ie),Ze=t(64279),je=t(25271),We=t(51837);const gt=(0,We.uW)("catalog:entity-route-ref",()=>(0,n.NT)({id:"catalog:entity",params:["namespace","kind","name"]}));function nt(y){var b,k;return{kind:y.kind.toLocaleLowerCase("en-US"),namespace:(k=(b=y.metadata.namespace)===null||b===void 0?void 0:b.toLocaleLowerCase("en-US"))!==null&&k!==void 0?k:DEFAULT_NAMESPACE,name:y.metadata.name}}function Me(y,b){const k=b==null?void 0:b.defaultKind;let N,G,K;return"metadata"in y?(N=y.kind,G=y.metadata.namespace,K=y.metadata.name):(N=y.kind,G=y.namespace,K=y.name),(G===void 0||G==="")&&(G=je.zG),(b==null?void 0:b.defaultNamespace)!==void 0?(b==null?void 0:b.defaultNamespace)===G&&(G=void 0):G===je.zG&&(G=void 0),N=N.toLocaleLowerCase("en-US"),N=k&&k.toLocaleLowerCase("en-US")===N?void 0:N,`${N?`${N}:`:""}${G?`${G}/`:""}${K}`}var ze=t(80030);const Qe=(0,I.forwardRef)((y,b)=>{const{entityRef:k,defaultKind:N,title:G,children:K,...de}=y,le=(0,n.tg)(gt);let ye,we,Le;if(typeof k=="string"){const _e=(0,je.of)(k);ye=_e.kind,we=_e.namespace,Le=_e.name}else"metadata"in k?(ye=k.kind,we=k.metadata.namespace,Le=k.metadata.name):(ye=k.kind,we=k.namespace,Le=k.name);ye=ye.toLocaleLowerCase("en-US");var Ae;we=(Ae=we==null?void 0:we.toLocaleLowerCase("en-US"))!==null&&Ae!==void 0?Ae:je.zG;const Xe={kind:ye,namespace:we,name:Le},bt=Me({kind:ye,namespace:we,name:Le},{defaultKind:N}),Et=(0,l.jsxs)(A.rU,{...de,ref:b,to:le(Xe),children:[K,!K&&(G!=null?G:bt)]});return G?(0,l.jsx)(ze.ZP,{title:bt,children:Et}):Et});function rt(y){const{entityRefs:b,defaultKind:k,getTitle:N,...G}=y,K=(0,n.h_)(g),{value:de=new Array,loading:le,error:ye}=(0,Ze.default)(async()=>{const we=b.reduce((Ae,Xe)=>"metadata"in Xe?Ae:[...Ae,(0,je.of)(Xe)],new Array),Le=b.filter(Ae=>"metadata"in Ae);return we.length>0?[...(await K.getEntities({filter:we.map(Ae=>({kind:Ae.kind,"metadata.namespace":Ae.namespace,"metadata.name":Ae.name}))})).items,...Le]:Le},[b]);return le?(0,l.jsx)(A.Ex,{}):ye?(0,l.jsx)(A.yu,{error:ye}):(0,l.jsx)(l.Fragment,{children:de.map((we,Le)=>(0,l.jsxs)(I.Fragment,{children:[Le>0&&", ",(0,l.jsx)(Qe,{...G,defaultKind:k,entityRef:we,title:N(we)})]},Le))})}function ct(y){const{entityRefs:b,defaultKind:k,fetchEntities:N,getTitle:G,...K}=y;return N?(0,l.jsx)(rt,{...K,defaultKind:k,entityRefs:b,getTitle:G}):(0,l.jsx)(l.Fragment,{children:b.map((de,le)=>(0,l.jsxs)(I.Fragment,{children:[le>0&&", ",(0,l.jsx)(Qe,{...K,defaultKind:k,entityRef:de,title:G?G(de):void 0})]},le))})}function lt(y){return y.reduce((b,k)=>({...b,...k.getCatalogFilters?k.getCatalogFilters():{}}),{})}function mt(y){return b=>y.every(k=>!k.filterEntity||k.filterEntity(b))}function vt(y,b,k){var N;let G=(y==null||(N=y.relations)===null||N===void 0?void 0:N.filter(K=>K.type===b).map(K=>(0,je.of)(K.targetRef)))||[];return k!=null&&k.kind&&(G=G.filter(K=>K.kind.toLocaleLowerCase("en-US")===k.kind.toLocaleLowerCase("en-US"))),G}function Ge(y,b){var k;const N=(k=y.metadata.annotations)===null||k===void 0?void 0:k[je.M6];if(!!N)try{const G=(0,je.Ou)(N),K=b.byUrl(G.target);return{locationTargetUrl:G.target,integrationType:K==null?void 0:K.type}}catch{return}}function re(y,b){const k=new Set([...getEntityRelations(y,RELATION_MEMBER_OF,{kind:"group"}),...y?[getCompoundEntityRef(y)]:[]].map(stringifyEntityRef)),N=getEntityRelations(b,RELATION_OWNED_BY).map(stringifyEntityRef);for(const G of N)if(k.has(G))return!0;return!1}class Re{getCatalogFilters(){return{kind:this.value}}toQueryValue(){return this.value}constructor(b){this.value=b}}class Pe{getTypes(){return Array.isArray(this.value)?this.value:[this.value]}getCatalogFilters(){return{"spec.type":this.getTypes()}}toQueryValue(){return this.getTypes()}constructor(b){this.value=b}}class it{filterEntity(b){var k;return this.values.every(N=>((k=b.metadata.tags)!==null&&k!==void 0?k:[]).includes(N))}toQueryValue(){return this.values}constructor(b){this.values=b}}class yt{filterEntity(b){const k=this.toUpperArray(this.value.split(/\s/)),N=this.toUpperArray([b.metadata.tags]),G=this.toUpperArray([b.metadata.name,b.metadata.title]);for(const K of k)if(N.every(de=>de!==K)&&G.every(de=>!de.includes(K)))return!1;return!0}toUpperArray(b){return b.flat().filter(k=>Boolean(k)).map(k=>k.toLocaleUpperCase("en-US"))}constructor(b){this.value=b}}class At{filterEntity(b){return this.values.some(k=>vt(b,je.S4).some(N=>Me(N,{defaultKind:"group"})===k))}toQueryValue(){return this.values}constructor(b){this.values=b}}class pt{filterEntity(b){return this.values.some(k=>{var N;return((N=b.spec)===null||N===void 0?void 0:N.lifecycle)===k})}toQueryValue(){return this.values}constructor(b){this.values=b}}class Ct{filterEntity(b){switch(this.value){case"owned":return this.isOwnedEntity(b);case"starred":return this.isStarredEntity(b);default:return!0}}toQueryValue(){return this.value}constructor(b,k,N){this.value=b,this.isOwnedEntity=k,this.isStarredEntity=N}}class Pt{filterEntity(b){var k;const N=(k=b.metadata.annotations)===null||k===void 0?void 0:k["backstage.io/orphan"];return N!==void 0&&this.value.toString()===N}constructor(b){this.value=b}}class kt{filterEntity(b){var k,N;const G=(b==null||(k=b.status)===null||k===void 0||(N=k.items)===null||N===void 0?void 0:N.length)>0;return G!==void 0&&this.value===G}constructor(b){this.value=b}}const en=(0,We.CT)("entity-context"),sn=({children:y,entity:b,loading:k,error:N,refresh:G})=>{const K={entity:b,loading:k,error:N,refresh:G};return(0,l.jsx)(en.Provider,{value:(0,We.EI)({1:K}),children:(0,l.jsx)(n.fC,{attributes:{...b?{entityRef:(0,je.eE)(b)}:void 0},children:y})})},Ht=y=>_jsx(sn,{entity:y.entity,loading:!Boolean(y.entity),error:void 0,refresh:void 0,children:y.children});function Gt(){const y=(0,We.Vt)("entity-context");if(!y)throw new Error("Entity context is not available");const b=y.atVersion(1);if(!b)throw new Error("EntityContext v1 not available");if(!b.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:b.entity}}function fn(){const y=(0,We.Vt)("entity-context");if(!y)throw new Error("Entity context is not available");const b=y.atVersion(1);if(!b)throw new Error("EntityContext v1 not available");const{entity:k,loading:N,error:G,refresh:K}=b;return{entity:k,loading:N,error:G,refresh:K}}var _t=t(76635),Zn=t(19126),ln=t.n(Zn),Dn=t(10289),gn=t(69294),Jn=t(48760),Kt=t(90736);const In=(0,I.createContext)(void 0),Nn=({children:y})=>{const b=(0,Kt.default)(),k=(0,n.h_)(g),[N,G]=(0,I.useState)({}),K=(0,Dn.TH)();var de;const le=(0,I.useMemo)(()=>(de=ln().parse(K.search,{ignoreQueryPrefix:!0}).filters)!==null&&de!==void 0?de:{},[K]),[ye,we]=(0,I.useState)(()=>({appliedFilters:{},entities:[],backendEntities:[]})),[{loading:Le,error:Ae},Xe]=(0,gn.default)(async()=>{const _e=(0,_t.compact)(Object.values(N)),Ot=mt(_e),Qt=lt(_e),qn=lt((0,_t.compact)(Object.values(ye.appliedFilters))),Vn=Object.keys(N).reduce((un,Sn)=>{const kn=N[Sn];return kn!=null&&kn.toQueryValue&&(un[Sn]=kn.toQueryValue()),un},{});if((0,_t.isEqual)(qn,Qt))we({appliedFilters:N,backendEntities:ye.backendEntities,entities:ye.backendEntities.filter(Ot)});else{const un=await k.getEntities({filter:Qt});we({appliedFilters:N,backendEntities:un.items,entities:un.items.filter(Ot)})}if(b()){var lr;const un=ln().parse(K.search,{ignoreQueryPrefix:!0}),Sn=ln().stringify({...un,filters:Vn},{addQueryPrefix:!0,arrayFormat:"repeat"}),kn=`${window.location.pathname}${Sn}`;(lr=window.history)===null||lr===void 0||lr.replaceState(null,document.title,kn)}},[k,le,N,ye],{loading:!0});(0,Jn.Z)(Xe,10,[N]);const bt=(0,I.useCallback)(_e=>{G(Ot=>{const Qt=typeof _e=="function"?_e(Ot):_e;return{...Ot,...Qt}})},[]),Et=(0,I.useMemo)(()=>({filters:ye.appliedFilters,entities:ye.entities,backendEntities:ye.backendEntities,updateFilters:bt,queryParameters:le,loading:Le,error:Ae}),[ye,bt,le,Le,Ae]);return(0,l.jsx)(In.Provider,{value:Et,children:y})};function Yt(){const y=(0,I.useContext)(In);if(!y)throw new Error("useEntityList must be used within EntityListProvider");return y}var mn=t(18149),cn=t.n(mn);function Rn(){const y=(0,n.h_)(g),{filters:{kind:b,type:k},queryParameters:{type:N},updateFilters:G}=Yt(),K=(0,I.useMemo)(()=>[N].flat().filter(Boolean),[N]);var de;const[le,ye]=(0,I.useState)(K.length?K:(de=k==null?void 0:k.getTypes())!==null&&de!==void 0?de:[]);(0,I.useEffect)(()=>{K.length&&ye(K)},[K]);const[we,Le]=(0,I.useState)([]),Ae=(0,I.useMemo)(()=>b==null?void 0:b.value,[b]),{error:Xe,loading:bt,value:Et}=(0,Ze.default)(async()=>Ae?await y.getEntityFacets({filter:{kind:Ae},facets:["spec.type"]}).then(Qt=>Qt.facets["spec.type"]||[]):[],[Ae,y]),_e=(0,I.useRef)(Et);return(0,I.useEffect)(()=>{const Ot=_e.current;if(_e.current=Et,bt||!Ae||Ot===Et||!Et)return;const Qt=[...new Set(Je()(Et,Vn=>-Vn.count).map(Vn=>Vn.value.toLocaleLowerCase("en-US")))];Le(Qt);const qn=le.filter(Vn=>Qt.includes(Vn));cn()(le,qn)||ye(qn)},[bt,Ae,le,ye,Et]),(0,I.useEffect)(()=>{G({type:le.length?new Pe(le):void 0})},[le,G]),{loading:bt,error:Xe,availableTypes:we,selectedTypes:le,setSelectedTypes:ye}}const Fn=20;function Cn(y,b){var k,N;const G=b==null||(k=b.type)===null||k===void 0?void 0:k.toLocaleLowerCase("en-US"),K=b==null||(N=b.kind)===null||N===void 0?void 0:N.toLocaleLowerCase("en-US"),de=(0,n.h_)(g),{loading:le,value:ye,error:we}=(0,Ze.default)(async()=>{var Le;const Ae=(Le=y.relations)===null||Le===void 0?void 0:Le.map(_e=>({type:_e.type,target:(0,je.of)(_e.targetRef)})).filter(_e=>(!G||_e.type.toLocaleLowerCase("en-US")===G)&&(!K||_e.target.kind===K));if(!Ae)return[];const Xe=Object.values((0,_t.groupBy)(Ae,({target:_e})=>`${_e.kind}:${_e.namespace}`.toLocaleLowerCase("en-US"))),bt=[];for(const _e of Xe)bt.push({kind:_e[0].target.kind,namespace:_e[0].target.namespace,nameBatches:(0,_t.chunk)(_e.map(Ot=>Ot.target.name),Fn)});return(await Promise.all(bt.flatMap(_e=>_e.nameBatches.map(Ot=>de.getEntities({filter:{kind:_e.kind,"metadata.namespace":_e.namespace,"metadata.name":Ot}}))))).flatMap(_e=>_e.items)},[y,G,K]);return{entities:ye,loading:le,error:we}}var ge=t(72164);function te(y){return typeof y=="string"?y:(0,je.eE)(y)}function Ee(){const y=(0,n.h_)(R),b=(0,ge.Z)(y.starredEntitie$(),new Set),k=(0,I.useCallback)(G=>b.has(te(G)),[b]),N=(0,I.useCallback)(G=>y.toggleStarred(te(G)).then(),[y]);return{starredEntities:b,toggleStarredEntity:N,isStarredEntity:k}}function De(y){return typeof y=="string"?y:(0,je.eE)(y)}function qe(y){const b=(0,n.h_)(R),[k,N]=(0,I.useState)(!1);return(0,I.useEffect)(()=>{const K=b.starredEntitie$().subscribe({next(de){N(de.has(De(y)))}});return()=>{K.unsubscribe()}},[y,b]),{toggleStarredEntity:(0,I.useCallback)(()=>b.toggleStarred(De(y)).then(),[y,b]),isStarredEntity:k}}function xt(){const y=(0,n.h_)(n.$4),{loading:b,value:k}=(0,Ze.default)(async()=>{const{ownershipEntityRefs:G}=await y.getBackstageIdentity();return G},[]),N=(0,I.useMemo)(()=>{const G=new Set(k!=null?k:[]);return K=>{const de=vt(K,je.S4).map(je.eE);for(const le of de)if(G.has(le))return!0;return!1}},[k]);return(0,I.useMemo)(()=>({loading:b,isOwnedEntity:N}),[b,N])}var ae=t(25488);function P(y){const{entity:b,loading:k,error:N}=fn(),{allowed:G,loading:K,error:de}=(0,ae.gI)({permission:y,resourceRef:b?(0,je.eE)(b):void 0});return k||K?{loading:!0,allowed:!1}:N?{loading:!1,allowed:!1,error:N}:{loading:!1,allowed:G,error:de}}function q(){const y=(0,n.h_)(g),[b,k]=(0,I.useState)([]),{error:N,loading:G,value:K}=(0,Ze.default)(async()=>{const le="kind";return await y.getEntityFacets({facets:[le]}).then(we=>we.facets[le]||[])},[y]),de=(0,I.useRef)(K);return(0,I.useEffect)(()=>{const le=de.current;if(de.current=K,G||le===K||!K)return;const ye=[...new Set(Je()(K,we=>we.value).map(we=>we.value.toLocaleLowerCase("en-US")))];k(ye)},[G,K,k]),{loading:G,error:N,availableKinds:b}}function Ke(y){var b;const{filters:k,queryParameters:{kind:N},updateFilters:G}=Yt(),K=(0,I.useMemo)(()=>[N].flat()[0],[N]);var de;const[le,ye]=(0,I.useState)((de=K!=null?K:(b=k.kind)===null||b===void 0?void 0:b.value)!==null&&de!==void 0?de:y.initialFilter);(0,I.useEffect)(()=>{K&&ye(K)},[K]),(0,I.useEffect)(()=>{var Xe;if(!((Xe=k.kind)===null||Xe===void 0)&&Xe.value){var bt;ye((bt=k.kind)===null||bt===void 0?void 0:bt.value)}},[k.kind]);const{availableKinds:we,loading:Le,error:Ae}=q();return(0,I.useEffect)(()=>{G({kind:le?new Re(le):void 0})},[le,G]),{loading:Le,error:Ae,availableKinds:we,selectedKind:le,setSelectedKind:ye}}const U=y=>{const{hidden:b,initialFilter:k="component"}=y,N=(0,n.h_)(n.$v),{error:G,availableKinds:K,selectedKind:de,setSelectedKind:le}=Ke({initialFilter:k});if((0,I.useEffect)(()=>{G&&N.post({message:"Failed to load entity kinds",severity:"error"})},[G,N]),(K==null?void 0:K.length)===0||G)return null;const ye=[...K.map(we=>({value:we,label:ee()(we)}))];return b?null:(0,l.jsx)(X.Z,{pb:1,pt:1,children:(0,l.jsx)(A.Ph,{label:"Kind",items:ye,selected:de,onChange:we=>le(String(we))})})};var Z=t(79692),ce=t(5806),pe=t(21324),be=t(86619),Be=t(19996),Oe=t(25505),He=t(38016),st=t(88013);const S=(0,Z.Z)({input:{}},{name:"CatalogReactEntityLifecyclePicker"}),H=(0,l.jsx)(Oe.Z,{fontSize:"small"}),me=(0,l.jsx)(Be.Z,{fontSize:"small"}),ue=()=>{var y;const b=S(),{updateFilters:k,backendEntities:N,filters:G,queryParameters:{lifecycles:K}}=Yt(),de=(0,I.useMemo)(()=>[K].flat().filter(Boolean),[K]);var le;const[ye,we]=(0,I.useState)(de.length?de:(le=(y=G.lifecycles)===null||y===void 0?void 0:y.values)!==null&&le!==void 0?le:[]);(0,I.useEffect)(()=>{de.length&&we(de)},[de]),(0,I.useEffect)(()=>{k({lifecycles:ye.length?new pt(ye):void 0})},[ye,k]);const Le=(0,I.useMemo)(()=>[...new Set(N.map(Ae=>{var Xe;return(Xe=Ae.spec)===null||Xe===void 0?void 0:Xe.lifecycle}).filter(Boolean))].sort(),[N]);return Le.length?(0,l.jsx)(X.Z,{pb:1,pt:1,children:(0,l.jsxs)(_.Z,{variant:"button",component:"label",children:["Lifecycle",(0,l.jsx)(st.ZP,{multiple:!0,options:Le,value:ye,onChange:(Ae,Xe)=>we(Xe),renderOption:(Ae,{selected:Xe})=>(0,l.jsx)(ce.Z,{control:(0,l.jsx)(pe.Z,{icon:H,checkedIcon:me,checked:Xe}),label:Ae}),size:"small",popupIcon:(0,l.jsx)(He.Z,{"data-testid":"lifecycle-picker-expand"}),renderInput:Ae=>(0,l.jsx)(be.Z,{...Ae,className:b.input,variant:"outlined"})})]})}):null},Ce=(0,Z.Z)({input:{}},{name:"CatalogReactEntityOwnerPicker"}),ke=(0,l.jsx)(Oe.Z,{fontSize:"small"}),Ne=(0,l.jsx)(Be.Z,{fontSize:"small"}),ot=()=>{var y;const b=Ce(),{updateFilters:k,backendEntities:N,filters:G,queryParameters:{owners:K}}=Yt(),de=(0,I.useMemo)(()=>[K].flat().filter(Boolean),[K]);var le;const[ye,we]=(0,I.useState)(de.length?de:(le=(y=G.owners)===null||y===void 0?void 0:y.values)!==null&&le!==void 0?le:[]);(0,I.useEffect)(()=>{de.length&&we(de)},[de]),(0,I.useEffect)(()=>{k({owners:ye.length?new At(ye):void 0})},[ye,k]);const Le=(0,I.useMemo)(()=>[...new Set(N.flatMap(Ae=>vt(Ae,je.S4).map(Xe=>Me(Xe,{defaultKind:"group"}))).filter(Boolean))].sort(),[N]);return Le.length?(0,l.jsx)(X.Z,{pb:1,pt:1,children:(0,l.jsxs)(_.Z,{variant:"button",component:"label",children:["Owner",(0,l.jsx)(st.ZP,{multiple:!0,options:Le,value:ye,onChange:(Ae,Xe)=>we(Xe),renderOption:(Ae,{selected:Xe})=>(0,l.jsx)(ce.Z,{control:(0,l.jsx)(pe.Z,{icon:ke,checkedIcon:Ne,checked:Xe}),label:Ae}),size:"small",popupIcon:(0,l.jsx)(He.Z,{"data-testid":"owner-picker-expand"}),renderInput:Ae=>(0,l.jsx)(be.Z,{...Ae,className:b.input,variant:"outlined"})})]})}):null},ht=(0,Z.Z)(y=>({searchToolbar:{paddingLeft:0,paddingRight:0},input:{}}),{name:"CatalogReactEntitySearchBar"}),ut=()=>{var y;const b=ht(),{filters:k,updateFilters:N}=useEntityList();var G;const[K,de]=useState((G=(y=k.text)===null||y===void 0?void 0:y.value)!==null&&G!==void 0?G:"");return useDebounce(()=>{N({text:K.length?new EntityTextFilter(K):void 0})},250,[K,N]),_jsx(Toolbar,{className:b.searchToolbar,children:_jsx(FormControl,{children:_jsx(Input,{"aria-label":"search",id:"input-with-icon-adornment",className:b.input,placeholder:"Search",autoComplete:"off",onChange:le=>de(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:()=>de(""),edge:"end",disabled:K.length===0,children:_jsx(Clear,{})})})})})})},et=Object.freeze({createEntityRefColumn(y){const{defaultKind:b}=y;function k(N){var G;return((G=N.metadata)===null||G===void 0?void 0:G.title)||Me(N,{defaultKind:b})}return{title:"Name",highlight:!0,customFilterAndSearch(N,G){return k(G).includes(N)},customSort(N,G){return k(N).localeCompare(k(G))},render:N=>{var G;return(0,l.jsx)(Qe,{entityRef:N,defaultKind:b,title:(G=N.metadata)===null||G===void 0?void 0:G.title})}}},createEntityRelationColumn(y){const{title:b,relation:k,defaultKind:N,filter:G}=y;function K(le){return vt(le,k,G)}function de(le){return K(le).map(ye=>Me(ye,{defaultKind:N})).join(", ")}return{title:b,customFilterAndSearch(le,ye){return de(ye).includes(le)},customSort(le,ye){return de(le).localeCompare(de(ye))},render:le=>(0,l.jsx)(ct,{entityRefs:K(le),defaultKind:N})}},createOwnerColumn(){return this.createEntityRelationColumn({title:"Owner",relation:je.S4,defaultKind:"group"})},createDomainColumn(){return this.createEntityRelationColumn({title:"Domain",relation:je.cz,defaultKind:"domain",filter:{kind:"domain"}})},createSystemColumn(){return this.createEntityRelationColumn({title:"System",relation:je.cz,defaultKind:"system",filter:{kind:"system"}})},createMetadataDescriptionColumn(){return{title:"Description",field:"metadata.description",render:y=>(0,l.jsx)(A.Or,{text:y.metadata.description,placement:"bottom-start",line:2})}},createSpecLifecycleColumn(){return{title:"Lifecycle",field:"spec.lifecycle"}},createSpecTypeColumn(){return{title:"Type",field:"spec.type"}}}),St=[et.createEntityRefColumn({defaultKind:"system"}),et.createDomainColumn(),et.createOwnerColumn(),et.createMetadataDescriptionColumn()],at=[et.createEntityRefColumn({defaultKind:"component"}),et.createSystemColumn(),et.createOwnerColumn(),et.createSpecTypeColumn(),et.createSpecLifecycleColumn(),et.createMetadataDescriptionColumn()],Tt=(0,Z.Z)(y=>({empty:{padding:y.spacing(2),display:"flex",justifyContent:"center"}})),Bt=y=>{const{entities:b,title:k,emptyContent:N,variant:G="gridItem",columns:K}=y,de=Tt(),le={minWidth:"0",width:"100%"};return G==="gridItem"&&(le.height="calc(100% - 10px)"),(0,l.jsx)(A.iA,{columns:K,title:k,style:le,emptyContent:N&&(0,l.jsx)("div",{className:de.empty,children:N}),options:{search:!1,paging:!1,actionsColumnIndex:-1,padding:"dense",draggable:!1},data:b})};Bt.columns=et,Bt.systemEntityColumns=St,Bt.componentEntityColumns=at;const Nt=(0,Z.Z)({input:{}},{name:"CatalogReactEntityTagPicker"}),vn=(0,l.jsx)(Oe.Z,{fontSize:"small"}),Gn=(0,l.jsx)(Be.Z,{fontSize:"small"}),wn=y=>{var b;const k=Nt(),{updateFilters:N,filters:G,queryParameters:{tags:K}}=Yt(),de=(0,n.h_)(g),{value:le}=(0,Ze.default)(async()=>{var Xe;const bt="metadata.tags",{facets:Et}=await de.getEntityFacets({facets:[bt],filter:(Xe=G.kind)===null||Xe===void 0?void 0:Xe.getCatalogFilters()});return Object.fromEntries(Et[bt].map(({value:_e,count:Ot})=>[_e,Ot]))},[G.kind]),ye=(0,I.useMemo)(()=>[K].flat().filter(Boolean),[K]);var we;const[Le,Ae]=(0,I.useState)(ye.length?ye:(we=(b=G.tags)===null||b===void 0?void 0:b.values)!==null&&we!==void 0?we:[]);return(0,I.useEffect)(()=>{ye.length&&Ae(ye)},[ye]),(0,I.useEffect)(()=>{N({tags:Le.length?new it(Le):void 0})},[Le,N]),Object.keys(le!=null?le:{}).length?(0,l.jsx)(X.Z,{pb:1,pt:1,children:(0,l.jsxs)(_.Z,{variant:"button",component:"label",children:["Tags",(0,l.jsx)(st.ZP,{multiple:!0,options:Object.keys(le!=null?le:{}),value:Le,onChange:(Xe,bt)=>Ae(bt),renderOption:(Xe,{selected:bt})=>(0,l.jsx)(ce.Z,{control:(0,l.jsx)(pe.Z,{icon:vn,checkedIcon:Gn,checked:bt}),label:y.showCounts?`${Xe} (${le==null?void 0:le[Xe]})`:Xe}),size:"small",popupIcon:(0,l.jsx)(He.Z,{"data-testid":"tag-picker-expand"}),renderInput:Xe=>(0,l.jsx)(be.Z,{...Xe,className:k.input,variant:"outlined"})})]})}):null},Ut=y=>{const{hidden:b,initialFilter:k}=y,N=(0,n.h_)(n.$v),{error:G,availableTypes:K,selectedTypes:de,setSelectedTypes:le}=Rn();if((0,I.useEffect)(()=>{G&&N.post({message:"Failed to load entity types",severity:"error"}),k&&le([k])},[G,N,k,le]),K.length===0||G)return null;const ye=[{value:"all",label:"all"},...K.map(Le=>({value:Le,label:Le}))];var we;return b?null:(0,l.jsx)(X.Z,{pb:1,pt:1,children:(0,l.jsx)(A.Ph,{label:"Type",items:ye,selected:(we=ye.length>1?de[0]:void 0)!==null&&we!==void 0?we:"all",onChange:Le=>le(Le==="all"?[]:[String(Le)])})})};var Ft=t(15459),dn=t(61837),yn=t(11640),Mn=t(28347);const jn=(0,Ft.Z)({root:{color:"#f3ba37"}})(yn.Z),Un=y=>{const{toggleStarredEntity:b,isStarredEntity:k}=qe(y.entity);return(0,l.jsx)(dn.Z,{"aria-label":"favorite",color:"inherit",...y,onClick:()=>b(),children:(0,l.jsx)(ze.ZP,{title:k?"Remove from favorites":"Add to favorites",children:k?(0,l.jsx)(jn,{}):(0,l.jsx)(Mn.Z,{})})})};var xn=t(8629),tn=t(79249),En=t(38724),ir=t(99152),C=t(6487),d=t(49429),m=t(55999),w=t(72779),Y=t.n(w),fe=t(39412);const Se=fe.Z;function $e(y,b){if(y)return y.toLocaleLowerCase("en-US");if(b)try{return(0,je.of)(b).kind.toLocaleLowerCase("en-US")}catch{return}}function ft(y,b){const k=(0,n.qD)(),N=$e(y,b);return N&&k.getSystemIcon(`kind:${N}`)||Se}function $t(y){const{kind:b,entityRef:k,...N}=y,G=ft(b,k);return(0,l.jsx)(G,{...N})}const on=(0,Z.Z)(y=>({node:{fill:y.palette.grey[300],stroke:y.palette.grey[300],"&.primary":{fill:y.palette.primary.light,stroke:y.palette.primary.light},"&.secondary":{fill:y.palette.secondary.light,stroke:y.palette.secondary.light}},text:{fill:y.palette.getContrastText(y.palette.grey[300]),"&.primary":{fill:y.palette.primary.contrastText},"&.secondary":{fill:y.palette.secondary.contrastText},"&.focused":{fontWeight:"bold"}},clickable:{cursor:"pointer"}}));function zn(y){const b=(0,n.h_)(g),k=(0,je.eE)(y),{loading:N,error:G,value:K}=(0,Ze.default)(async()=>{const de=await b.getEntityAncestors({entityRef:k}),le=new Array,ye=new Array;for(const we of de.items){const Le=(0,je.eE)(we.entity),Ae=Le===de.rootEntityRef;le.push({id:Le,root:Ae,...we.entity});for(const Xe of we.parentEntityRefs)ye.push({from:Le,to:Xe})}return{nodes:le,edges:ye}},[k]);return{loading:N,error:G,nodes:(K==null?void 0:K.nodes)||[],edges:(K==null?void 0:K.edges)||[]}}function $r({node:y}){const b=on(),k=(0,Dn.s0)(),N=(0,n.tg)(gt),[G,K]=(0,I.useState)(0),[de,le]=(0,I.useState)(0),ye=(0,I.useRef)(null);(0,I.useLayoutEffect)(()=>{if(ye.current){let{height:Ot,width:Qt}=ye.current.getBBox();Ot=Math.round(Ot),Qt=Math.round(Qt),(Ot!==de||Qt!==G)&&(K(Qt),le(Ot))}},[G,de]);const we=10,Le=de,Ae=Le+we,Xe=Ae+G+we*2,bt=de+we*2,Et=y.metadata.title||(y.kind&&y.metadata.name&&y.metadata.namespace?Me({kind:y.kind,name:y.metadata.name,namespace:y.metadata.namespace||""}):y.id),_e=()=>{k(N({kind:y.kind,namespace:y.metadata.namespace||je.zG,name:y.metadata.name}))};return(0,l.jsxs)("g",{onClick:_e,className:b.clickable,children:[(0,l.jsx)("rect",{className:Y()(b.node,y.root?"secondary":"primary"),width:Xe,height:bt,rx:10}),(0,l.jsx)($t,{kind:y.kind,y:we,x:we,width:Le,height:Le,className:Y()(b.text,y.root?"secondary":"primary")}),(0,l.jsx)("text",{ref:ye,className:Y()(b.text,y.root?"secondary":"primary"),y:bt/2,x:Ae+(G+we*2)/2,textAnchor:"middle",alignmentBaseline:"middle",children:Et})]})}function is(y){const{loading:b,error:k,nodes:N,edges:G}=zn(y.entity);return b?(0,l.jsx)(A.Ex,{}):k?(0,l.jsx)(A.Gk,{error:k}):(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(m.Z,{variant:"h2",children:"Ancestry"}),(0,l.jsxs)(m.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,l.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,l.jsx)(X.Z,{mt:4,children:(0,l.jsx)(A.mn,{nodes:N,edges:G,renderNode:$r,direction:A.NX.Nm.BOTTOM_TOP,zoom:"enable-on-click"})})]})}var nr=t(11776),Ln=t(38402),ar=t(86136),Sr=t(99688),Cr=t(49378),as=t(54506),wr=t(94339),Br=t(24579),Ds=t(27685);const Zr=(0,Z.Z)(y=>({root:{display:"flex",flexDirection:"column"},marginTop:{marginTop:y.spacing(2)},helpIcon:{marginLeft:y.spacing(1),color:y.palette.text.disabled},monospace:{fontFamily:"monospace"}}));function Qn(y){const b=Zr();return(0,l.jsx)(Cr.Z,{...y,primaryTypographyProps:{className:b.monospace},secondaryTypographyProps:{className:b.monospace}})}function jr(y){const b=Zr();return(0,l.jsx)(as.Z,{className:b.monospace,children:y.children})}function pr(y){return(0,l.jsx)(X.Z,{mt:2,children:(0,l.jsx)(wr.Z,{variant:"outlined",children:(0,l.jsxs)(Br.Z,{children:[(0,l.jsxs)(_.Z,{variant:"h6",gutterBottom:!0,children:[y.title,y.helpLink&&(0,l.jsx)(Pn,{to:y.helpLink})]}),y.children]})})})}function Vr(y){if(y.match(/^url:https?:\/\//))return y.slice(4);if(y.match(/^https?:\/\//))return y}function Er(y){const[b,k]=y.entry,N=Vr(k);return(0,l.jsxs)(Ln.Z,{children:[y.indent&&(0,l.jsx)(ar.Z,{}),(0,l.jsx)(Qn,{primary:b,secondary:N?(0,l.jsx)(A.rU,{to:N,children:k}):k})]})}function Pn(y){const b=Zr();return(0,l.jsx)(A.rU,{to:y.to,className:b.helpIcon,children:(0,l.jsx)(Ds.Z,{fontSize:"inherit"})})}const ls=(0,Z.Z)({root:{display:"flex",flexDirection:"column"}});function Ar(y){var b,k;const N=(0,n.h_)(g),G=(0,je.eE)(y),K=(b=y.metadata.annotations)===null||b===void 0?void 0:b[je.P1],de=(k=y.metadata.annotations)===null||k===void 0?void 0:k[je.q1],{loading:le,error:ye,value:we}=(0,Ze.default)(async()=>!K&&!de?[]:(await N.getEntities({filter:[...K?[{[`metadata.annotations.${je.P1}`]:K}]:[],...de?[{[`metadata.annotations.${je.q1}`]:de}]:[]]})).items,[K,de]);return{loading:le,error:ye,location:K,originLocation:de,colocatedEntities:we==null?void 0:we.filter(Le=>(0,je.eE)(Le)!==G)}}function Tr(y){return(0,l.jsxs)(nr.Z,{dense:!0,children:[y.header&&(0,l.jsx)(Er,{entry:y.header},"header"),y.entities.map(b=>(0,l.jsxs)(Ln.Z,{children:[(0,l.jsx)(ar.Z,{children:(0,l.jsx)($t,{kind:b.kind})}),(0,l.jsx)(Qn,{primary:(0,l.jsx)(Qe,{entityRef:b})})]},(0,je.eE)(b)))]})}function Wr(y){const{entity:b}=y,{loading:k,error:N,location:G,originLocation:K,colocatedEntities:de}=Ar(b);if(k)return(0,l.jsx)(A.Ex,{});if(N)return(0,l.jsx)(A.Gk,{error:N});if(!G&&!K)return(0,l.jsx)(Sr.Z,{severity:"warning",children:"Entity had no location information."});if(!(de!=null&&de.length))return(0,l.jsx)(Sr.Z,{severity:"info",children:"There were no other entities on this location."});if(G===K)return(0,l.jsx)(Tr,{entities:de});const le=de.filter(we=>{var Le;return((Le=we.metadata.annotations)===null||Le===void 0?void 0:Le[je.P1])===G}),ye=de.filter(we=>{var Le;return((Le=we.metadata.annotations)===null||Le===void 0?void 0:Le[je.q1])===K});return(0,l.jsxs)(l.Fragment,{children:[le.length>0&&(0,l.jsx)(Tr,{entities:le,header:["At the same location",G]}),ye.length>0&&(0,l.jsx)(Tr,{entities:ye,header:["At the same origin",K]})]})}function cs(y){const b=ls();return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(m.Z,{variant:"h2",children:"Colocated"}),(0,l.jsx)(m.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,l.jsx)("div",{className:b.root,children:(0,l.jsx)(Wr,{entity:y.entity})})]})}function ds(y){return Object.fromEntries([...Object.entries(y)].sort((b,k)=>b[0]<k[0]?-1:1))}function us(y){return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(m.Z,{variant:"h2",children:"Entity as JSON"}),(0,l.jsx)(m.Z,{children:"This is the raw entity data as received from the catalog, on JSON form."}),(0,l.jsx)(m.Z,{children:(0,l.jsx)("div",{style:{fontSize:"75%"},"data-testid":"code-snippet",children:(0,l.jsx)(A.Oi,{text:JSON.stringify(ds(y.entity),void 0,2),language:"json",showCopyCodeButton:!0})})})]})}var Ns=t(3440),hs=t.n(Ns);const Hr=(0,Z.Z)({root:{display:"flex",flexDirection:"column"}});function ps(y){var b,k;const N=Hr(),{apiVersion:G,kind:K,metadata:de,spec:le,relations:ye=[],status:we={}}=y.entity,Le=hs()(Je()(ye,Ae=>Ae.targetRef),"type");return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(m.Z,{variant:"h2",children:"Overview"}),(0,l.jsxs)("div",{className:N.root,children:[(0,l.jsx)(pr,{title:"Identity",children:(0,l.jsxs)(nr.Z,{dense:!0,children:[(0,l.jsx)(Ln.Z,{children:(0,l.jsx)(Qn,{primary:"apiVersion",secondary:G})}),(0,l.jsx)(Ln.Z,{children:(0,l.jsx)(Qn,{primary:"kind",secondary:K})}),(le==null?void 0:le.type)&&(0,l.jsx)(Ln.Z,{children:(0,l.jsx)(Qn,{primary:"spec.type",secondary:le.type})}),de.uid&&(0,l.jsx)(Ln.Z,{children:(0,l.jsx)(Qn,{primary:"uid",secondary:de.uid})}),de.etag&&(0,l.jsx)(Ln.Z,{children:(0,l.jsx)(Qn,{primary:"etag",secondary:de.etag})})]})}),(0,l.jsxs)(pr,{title:"Metadata",children:[!!Object.keys(de.annotations||{}).length&&(0,l.jsx)(nr.Z,{dense:!0,subheader:(0,l.jsxs)(jr,{children:["Annotations",(0,l.jsx)(Pn,{to:"https://backstage.io/docs/features/software-catalog/well-known-annotations"})]}),children:Object.entries(de.annotations).map(Ae=>(0,l.jsx)(Er,{indent:!0,entry:Ae},Ae[0]))}),!!Object.keys(de.labels||{}).length&&(0,l.jsx)(nr.Z,{dense:!0,subheader:(0,l.jsx)(jr,{children:"Labels"}),children:Object.entries(de.labels).map(Ae=>(0,l.jsx)(Er,{indent:!0,entry:Ae},Ae[0]))}),!!(!((b=de.tags)===null||b===void 0)&&b.length)&&(0,l.jsx)(nr.Z,{dense:!0,subheader:(0,l.jsx)(jr,{children:"Tags"}),children:de.tags.map((Ae,Xe)=>(0,l.jsxs)(Ln.Z,{children:[(0,l.jsx)(ar.Z,{}),(0,l.jsx)(Qn,{primary:Ae})]},`${Ae}-${Xe}`))})]}),!!ye.length&&(0,l.jsx)(pr,{title:"Relations",helpLink:"https://backstage.io/docs/features/software-catalog/well-known-relations",children:Object.entries(Le).map(([Ae,Xe],bt)=>(0,l.jsx)("div",{children:(0,l.jsx)(nr.Z,{dense:!0,subheader:(0,l.jsx)(jr,{children:Ae}),children:Xe.map(Et=>(0,l.jsxs)(Ln.Z,{children:[(0,l.jsx)(ar.Z,{children:(0,l.jsx)($t,{entityRef:Et.targetRef})}),(0,l.jsx)(Qn,{primary:(0,l.jsx)(Qe,{entityRef:Et.targetRef})})]},Et.targetRef))})},bt))}),!!(!((k=we.items)===null||k===void 0)&&k.length)&&(0,l.jsx)(pr,{title:"Status",helpLink:"https://backstage.io/docs/features/software-catalog/well-known-statuses",children:we.items.map((Ae,Xe)=>(0,l.jsxs)("div",{children:[(0,l.jsxs)(_.Z,{children:[Ae.level,": ",Ae.type]}),(0,l.jsx)(X.Z,{ml:2,children:Ae.message})]},Xe))})]})]})}var Gr=t(72847);function fs(y){return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(m.Z,{variant:"h2",children:"Entity as YAML"}),(0,l.jsx)(m.Z,{children:"This is the raw entity data as received from the catalog, on YAML form."}),(0,l.jsx)(m.Z,{children:(0,l.jsx)("div",{style:{fontSize:"75%"},"data-testid":"code-snippet",children:(0,l.jsx)(A.Oi,{text:Gr.ZP.stringify(ds(y.entity)),language:"yaml",showCopyCodeButton:!0})})})]})}const Kr=(0,Z.Z)(y=>({fullHeightDialog:{height:"calc(100% - 64px)"},root:{display:"flex",flexGrow:1,width:"100%",backgroundColor:y.palette.background.paper},tabs:{borderRight:`1px solid ${y.palette.divider}`,flexShrink:0},tabContents:{flexGrow:1,overflowX:"auto"}}));function Zt(y){const{children:b,value:k,index:N,...G}=y,K=Kr();return(0,l.jsx)("div",{role:"tabpanel",hidden:k!==N,id:`vertical-tabpanel-${N}`,"aria-labelledby":`vertical-tab-${N}`,className:K.tabContents,...G,children:k===N&&(0,l.jsx)(X.Z,{pl:3,pr:3,children:b})})}function fr(y){return{id:`vertical-tab-${y}`,"aria-controls":`vertical-tabpanel-${y}`}}function Yr(y){const b=Kr(),[k,N]=I.useState(0);return(0,I.useEffect)(()=>{N(0)},[y.open]),y.entity?(0,l.jsxs)(xn.Z,{fullWidth:!0,maxWidth:"xl",open:y.open,onClose:y.onClose,"aria-labelledby":"entity-inspector-dialog-title",PaperProps:{className:b.fullHeightDialog},children:[(0,l.jsx)(tn.Z,{id:"entity-inspector-dialog-title",children:"Entity Inspector"}),(0,l.jsx)(En.Z,{dividers:!0,children:(0,l.jsxs)("div",{className:b.root,children:[(0,l.jsxs)(ir.Z,{orientation:"vertical",variant:"scrollable",value:k,onChange:(G,K)=>N(K),"aria-label":"Inspector options",className:b.tabs,children:[(0,l.jsx)(C.Z,{label:"Overview",...fr(0)}),(0,l.jsx)(C.Z,{label:"Ancestry",...fr(1)}),(0,l.jsx)(C.Z,{label:"Colocated",...fr(2)}),(0,l.jsx)(C.Z,{label:"Raw JSON",...fr(3)}),(0,l.jsx)(C.Z,{label:"Raw YAML",...fr(4)})]}),(0,l.jsx)(Zt,{value:k,index:0,children:(0,l.jsx)(ps,{entity:y.entity})}),(0,l.jsx)(Zt,{value:k,index:1,children:(0,l.jsx)(is,{entity:y.entity})}),(0,l.jsx)(Zt,{value:k,index:2,children:(0,l.jsx)(cs,{entity:y.entity})}),(0,l.jsx)(Zt,{value:k,index:3,children:(0,l.jsx)(us,{entity:y.entity})}),(0,l.jsx)(Zt,{value:k,index:4,children:(0,l.jsx)(fs,{entity:y.entity})})]})}),(0,l.jsx)(d.Z,{children:(0,l.jsx)(Q.Z,{onClick:y.onClose,color:"primary",children:"Close"})})]}):null}var gs=t(85256);function Jr(y){var b;const k=(0,n.h_)(g),N=(b=y.metadata.annotations)===null||b===void 0?void 0:b[je.q1],G=y.metadata.uid,K=N==="bootstrap:bootstrap",de=(0,Ze.default)(async()=>{const Et=k.getLocationByRef(N);let _e;if(!N)_e=Promise.resolve([]);else{const Ot=`metadata.annotations.${je.q1}`;_e=k.getEntities({filter:{[Ot]:N},fields:["kind","metadata.uid","metadata.name","metadata.namespace"]}).then(Qt=>Qt.items)}return Promise.all([Et,_e]).then(([Ot,Qt])=>({location:Ot,colocatedEntities:Qt}))},[k,y]),le=(0,I.useCallback)(async function(){const{location:_e}=de.value;await k.removeLocationById(_e.id)},[k,de]),ye=(0,I.useCallback)(async function(){await k.removeEntityByUid(G)},[k,G]);if(K)return{type:"bootstrap",location:N,deleteEntity:ye};const{loading:we,error:Le,value:Ae}=de;if(we)return{type:"loading"};if(Le)return{type:"error",error:Le};const{location:Xe,colocatedEntities:bt}=Ae;return Xe?{type:"unregister",location:N,colocatedEntities:bt.map(je.iB),unregisterLocation:le,deleteEntity:ye}:{type:"only-delete",deleteEntity:ye}}var bn=t(23054);const Xn=(0,Z.Z)({advancedButton:{fontSize:"0.7em"}}),ms=({entity:y,onConfirm:b})=>{const k=(0,n.h_)(n.$v),N=(0,n.h_)(n.Ds),G=Xn(),K=Jr(y),[de,le]=(0,I.useState)(!1),[ye,we]=(0,I.useState)(!1);var Le;const Ae=(Le=N.getOptionalString("app.title"))!==null&&Le!==void 0?Le:"Backstage",Xe=(0,I.useCallback)(async function(){if("unregisterLocation"in K){we(!0);try{await K.unregisterLocation(),b()}catch(_e){(0,bn.BD)(_e),k.post({message:_e.message})}finally{we(!1)}}},[k,b,K]),bt=(0,I.useCallback)(async function(){if("deleteEntity"in K){we(!0);try{await K.deleteEntity(),b()}catch(_e){(0,bn.BD)(_e),k.post({message:_e.message})}finally{we(!1)}}},[k,b,K]);return K.type==="loading"?(0,l.jsx)(A.Ex,{}):K.type==="error"?(0,l.jsx)(A.Gk,{error:K.error}):K.type==="bootstrap"?(0,l.jsxs)(l.Fragment,{children:[(0,l.jsxs)(Sr.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,l.jsxs)(X.Z,{marginTop:2,children:[!de&&(0,l.jsx)(Q.Z,{variant:"text",size:"small",color:"primary",className:G.advancedButton,onClick:()=>le(!0),children:"Advanced Options"}),de&&(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(m.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,l.jsx)(Q.Z,{variant:"contained",color:"secondary",disabled:ye,onClick:bt,children:"Delete Entity"})]})]})]}):K.type==="only-delete"?(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(m.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,l.jsx)(Q.Z,{variant:"contained",color:"secondary",disabled:ye,onClick:bt,children:"Delete Entity"})]}):K.type==="unregister"?(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(m.Z,{children:"This action will unregister the following entities:"}),(0,l.jsx)(m.Z,{component:"ul",children:K.colocatedEntities.map(Et=>(0,l.jsx)("li",{children:(0,l.jsx)(Qe,{entityRef:Et})},`${Et.kind}:${Et.namespace}/${Et.name}`))}),(0,l.jsx)(m.Z,{children:"Located at the following location:"}),(0,l.jsx)(m.Z,{component:"ul",children:(0,l.jsx)("li",{children:K.location})}),(0,l.jsxs)(m.Z,{children:["To undo, just re-register the entity in ",Ae,"."]}),(0,l.jsxs)(X.Z,{marginTop:2,children:[(0,l.jsx)(Q.Z,{variant:"contained",color:"secondary",disabled:ye,onClick:Xe,children:"Unregister Location"}),!de&&(0,l.jsx)(X.Z,{component:"span",marginLeft:2,children:(0,l.jsx)(Q.Z,{variant:"text",size:"small",color:"primary",className:G.advancedButton,onClick:()=>le(!0),children:"Advanced Options"})})]}),de&&(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(X.Z,{paddingTop:4,paddingBottom:4,children:(0,l.jsx)(gs.Z,{})}),(0,l.jsx)(m.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,l.jsx)(Q.Z,{variant:"contained",color:"secondary",disabled:ye,onClick:bt,children:"Delete Entity"})]})]}):(0,l.jsx)(Sr.Z,{severity:"error",children:"Internal error: Unknown state"})},vs=y=>{const{open:b,onConfirm:k,onClose:N,entity:G}=y;return(0,l.jsxs)(xn.Z,{open:b,onClose:N,children:[(0,l.jsx)(tn.Z,{id:"responsive-dialog-title",children:"Are you sure you want to unregister this entity?"}),(0,l.jsx)(En.Z,{children:(0,l.jsx)(ms,{entity:G,onConfirm:k})}),(0,l.jsx)(d.Z,{children:(0,l.jsx)(Q.Z,{onClick:N,color:"primary",children:"Cancel"})})]})};var ys=t(12231),xs=t(9520),bs=t(47603);const Ss=(0,Z.Z)(y=>({root:{backgroundColor:"rgba(0, 0, 0, .11)",boxShadow:"none",margin:y.spacing(1,0,1,0)},title:{margin:y.spacing(1,0,0,1),textTransform:"uppercase",fontSize:12,fontWeight:"bold"},listIcon:{minWidth:30,color:y.palette.text.primary},menuItem:{minHeight:y.spacing(6)},groupWrapper:{margin:y.spacing(1,1,2,1)}}),{name:"CatalogReactUserListPicker"});function Cs(y){return[{name:"Personal",items:[{id:"owned",label:"Owned",icon:bs.Z},{id:"starred",label:"Starred",icon:yn.Z}]},{name:y!=null?y:"Company",items:[{id:"all",label:"All"}]}]}const Qr=y=>{const{initialFilter:b,availableFilters:k}=y,N=Ss(),G=(0,n.h_)(n.Ds);var K;const de=(K=G.getOptionalString("organization.name"))!==null&&K!==void 0?K:"Company",{filters:le,updateFilters:ye,backendEntities:we,queryParameters:{kind:Le,user:Ae},loading:Xe}=Yt(),bt=["starred","all"],Et=Cs(de).map(hn=>({...hn,items:hn.items.filter(({id:An})=>["group","user"].some(gr=>gr===Le)?bt.includes(An):!k||k.includes(An))})).filter(({items:hn})=>!!hn.length),{isStarredEntity:_e}=Ee(),{isOwnedEntity:Ot,loading:Qt}=xt(),qn=Xe||Qt,Vn=(0,I.useMemo)(()=>new Ct("owned",Ot,_e),[Ot,_e]),lr=(0,I.useMemo)(()=>new Ct("starred",Ot,_e),[Ot,_e]),un=(0,I.useMemo)(()=>[Ae].flat()[0],[Ae]),[Sn,kn]=(0,I.useState)(un!=null?un:b),Rr=(0,I.useMemo)(()=>we.filter(mt((0,_t.compact)(Object.values({...le,user:void 0})))),[le,we]),Lr=(0,I.useMemo)(()=>({all:Rr.length,starred:Rr.filter(hn=>lr.filterEntity(hn)).length,owned:Rr.filter(hn=>Vn.filterEntity(hn)).length}),[Rr,lr,Vn]);(0,I.useEffect)(()=>{un&&kn(un)},[un]),(0,I.useEffect)(()=>{!qn&&!!Sn&&Sn!=="all"&&Lr[Sn]===0&&kn("all")},[qn,Lr,Sn,kn]),(0,I.useEffect)(()=>{ye({user:Sn?new Ct(Sn,Ot,_e):void 0})},[Sn,Ot,_e,ye]);var Dr;return(0,l.jsx)(wr.Z,{className:N.root,children:Et.map(hn=>(0,l.jsxs)(I.Fragment,{children:[(0,l.jsx)(_.Z,{variant:"subtitle2",component:"span",className:N.title,children:hn.name}),(0,l.jsx)(wr.Z,{className:N.groupWrapper,children:(0,l.jsx)(nr.Z,{disablePadding:!0,dense:!0,role:"menu","aria-label":hn.name,children:hn.items.map(An=>{var gr;return(0,l.jsxs)(ys.Z,{role:"none presentation",button:!0,divider:!0,onClick:()=>kn(An.id),selected:An.id===((gr=le.user)===null||gr===void 0?void 0:gr.value),className:N.menuItem,disabled:Lr[An.id]===0,"data-testid":`user-picker-${An.id}`,tabIndex:0,ContainerProps:{role:"menuitem"},children:[An.icon&&(0,l.jsx)(ar.Z,{className:N.listIcon,children:(0,l.jsx)(An.icon,{fontSize:"small"})}),(0,l.jsx)(Cr.Z,{children:(0,l.jsxs)(_.Z,{variant:"body1",children:[An.label," "]})}),(0,l.jsx)(xs.Z,{children:(Dr=Lr[An.id])!==null&&Dr!==void 0?Dr:"-"})]},An.id)})})})]},hn.name))})},Ir=(0,Z.Z)({input:{}},{name:"CatalogReactEntityProcessingStatusPickerPicker"}),Fs=(0,l.jsx)(Oe.Z,{fontSize:"small"}),ws=(0,l.jsx)(Be.Z,{fontSize:"small"}),Xr=()=>{const y=Ir(),{updateFilters:b}=Yt(),[k,N]=(0,I.useState)([]);function G(le){b({orphan:le?new Pt(le):void 0})}function K(le){b({error:le?new kt(le):void 0})}const de=["Is Orphan","Has Error"];return(0,l.jsx)(X.Z,{pb:1,pt:1,children:(0,l.jsxs)(_.Z,{variant:"button",component:"label",children:["Processing Status",(0,l.jsx)(st.ZP,{multiple:!0,options:de,value:k,onChange:(le,ye)=>{N(ye),G(ye.includes("Is Orphan")),K(ye.includes("Has Error"))},renderOption:(le,{selected:ye})=>(0,l.jsx)(ce.Z,{control:(0,l.jsx)(pe.Z,{icon:Fs,checkedIcon:ws,checked:ye}),label:le}),size:"small",popupIcon:(0,l.jsx)(He.Z,{"data-testid":"processing-status-picker-expand"}),renderInput:le=>(0,l.jsx)(be.Z,{...le,className:y.input,variant:"outlined"})})]})})},Us=({children:y,value:b})=>{var k;const[N,G]=useState((k=b==null?void 0:b.filters)!==null&&k!==void 0?k:{}),K=useCallback(bt=>{G(Et=>{const _e=typeof bt=="function"?bt(Et):bt;return{...Et,..._e}})},[]),de=useMemo(()=>({entities:[],backendEntities:[],queryParameters:{}}),[]);var le,ye,we,Le,Ae;const Xe=useMemo(()=>({entities:(le=b==null?void 0:b.entities)!==null&&le!==void 0?le:de.entities,backendEntities:(ye=b==null?void 0:b.backendEntities)!==null&&ye!==void 0?ye:de.backendEntities,updateFilters:(we=b==null?void 0:b.updateFilters)!==null&&we!==void 0?we:K,filters:N,loading:(Le=b==null?void 0:b.loading)!==null&&Le!==void 0?Le:!1,queryParameters:(Ae=b==null?void 0:b.queryParameters)!==null&&Ae!==void 0?Ae:de.queryParameters,error:b==null?void 0:b.error}),[b,de,N,K]);return _jsx(EntityListContext.Provider,{value:Xe,children:y})}},33414:function(jt,Fe,t){"use strict";t.r(Fe),t.d(Fe,{AboutCard:function(){return gt},AboutContent:function(){return je},AboutField:function(){return ee}});var h=t(52322),n=t(25271),g=t(93414),R=t(25248),V=t(32838),x=t(43297),l=t(79692),I=t(94339),ne=t(32552),J=t(61837),Q=t(85256),D=t(24579),X=t(52866),_=t(30254),he=t(27604),ie=t(2784),E=t(19625),L=t(60905),$=t(90436),A=t(7089);const T=(0,l.Z)(nt=>({value:{fontWeight:"bold",overflow:"hidden",lineHeight:"24px",wordBreak:"break-word"},label:{color:nt.palette.text.secondary,textTransform:"uppercase",fontSize:"10px",fontWeight:"bold",letterSpacing:.5,overflow:"hidden",whiteSpace:"nowrap"}}));function ee(nt){const{label:Me,value:ze,gridSizes:Qe,children:rt}=nt,ct=T(),lt=(0,R.vJ)(rt,vt=>vt.getElements()),mt=lt.length>0?lt:(0,h.jsx)($.Z,{variant:"body2",className:ct.value,children:ze||"unknown"});return(0,h.jsxs)(L.Z,{item:!0,...Qe,children:[(0,h.jsx)($.Z,{variant:"h2",className:ct.label,children:Me}),mt]})}var Ie=t(24851);const Je=(0,l.Z)({description:{wordBreak:"break-word"}});function Ze(nt,Me,ze){if(Me==="url"||nt.includes("://"))return nt;const Qe=ze.type==="file"?`file://${ze.target}`:ze.target;return Me==="file"||ze.type==="file"?new URL(nt,Qe).href:Qe}function je(nt){var Me,ze,Qe,rt,ct,lt,mt,vt;const{entity:Ge}=nt,re=Je(),Re=Ge.kind.toLocaleLowerCase("en-US")==="system",Pe=Ge.kind.toLocaleLowerCase("en-US")==="resource",it=Ge.kind.toLocaleLowerCase("en-US")==="component",yt=Ge.kind.toLocaleLowerCase("en-US")==="api",At=Ge.kind.toLocaleLowerCase("en-US")==="template",pt=Ge.kind.toLocaleLowerCase("en-US")==="location",Ct=Ge.kind.toLocaleLowerCase("en-US")==="group",Pt=(0,x.hF)(Ge,n.cz,{kind:"system"}),kt=(0,x.hF)(Ge,n.cz,{kind:"component"}),en=(0,x.hF)(Ge,n.cz,{kind:"domain"}),sn=(0,x.hF)(Ge,n.S4);let Ht;try{Ht=(0,n.CV)(Ge)}catch{Ht=void 0}return(0,h.jsxs)(L.Z,{container:!0,children:[(0,h.jsx)(ee,{label:"Description",gridSizes:{xs:12},children:(0,h.jsx)($.Z,{variant:"body2",paragraph:!0,className:re.description,children:(Ge==null||(Me=Ge.metadata)===null||Me===void 0?void 0:Me.description)||"No description"})}),(0,h.jsx)(ee,{label:"Owner",value:"No Owner",gridSizes:{xs:12,sm:6,lg:4},children:sn.length>0&&(0,h.jsx)(x.rI,{entityRefs:sn,defaultKind:"group"})}),(Re||en.length>0)&&(0,h.jsx)(ee,{label:"Domain",value:"No Domain",gridSizes:{xs:12,sm:6,lg:4},children:en.length>0&&(0,h.jsx)(x.rI,{entityRefs:en,defaultKind:"domain"})}),(yt||it||Pe||Pt.length>0)&&(0,h.jsx)(ee,{label:"System",value:"No System",gridSizes:{xs:12,sm:6,lg:4},children:Pt.length>0&&(0,h.jsx)(x.rI,{entityRefs:Pt,defaultKind:"system"})}),it&&kt.length>0&&(0,h.jsx)(ee,{label:"Parent Component",value:"No Parent Component",gridSizes:{xs:12,sm:6,lg:4},children:(0,h.jsx)(x.rI,{entityRefs:kt,defaultKind:"component"})}),(yt||it||Pe||At||Ct||pt||typeof(Ge==null||(ze=Ge.spec)===null||ze===void 0?void 0:ze.type)=="string")&&(0,h.jsx)(ee,{label:"Type",value:Ge==null||(Qe=Ge.spec)===null||Qe===void 0?void 0:Qe.type,gridSizes:{xs:12,sm:6,lg:4}}),(yt||it||typeof(Ge==null||(rt=Ge.spec)===null||rt===void 0?void 0:rt.lifecycle)=="string")&&(0,h.jsx)(ee,{label:"Lifecycle",value:Ge==null||(ct=Ge.spec)===null||ct===void 0?void 0:ct.lifecycle,gridSizes:{xs:12,sm:6,lg:4}}),(0,h.jsx)(ee,{label:"Tags",value:"No Tags",gridSizes:{xs:12,sm:6,lg:4},children:((Ge==null||(lt=Ge.metadata)===null||lt===void 0?void 0:lt.tags)||[]).map(Gt=>(0,h.jsx)(A.Z,{size:"small",label:Gt},Gt))}),pt&&((Ge==null||(mt=Ge.spec)===null||mt===void 0?void 0:mt.targets)||(Ge==null||(vt=Ge.spec)===null||vt===void 0?void 0:vt.target))&&(0,h.jsx)(ee,{label:"Targets",gridSizes:{xs:12},children:(0,h.jsx)(Ie.s,{cols:1,items:(Ge.spec.targets||[Ge.spec.target]).map(Gt=>Gt).map(Gt=>{var fn;return{text:Gt,href:Ze(Gt,(Ge==null||(fn=Ge.spec)===null||fn===void 0?void 0:fn.type)||"unknown",Ht)}})})})]})}const We=(0,l.Z)({gridItemCard:{display:"flex",flexDirection:"column",height:"calc(100% - 10px)",marginBottom:"10px"},fullHeightCard:{display:"flex",flexDirection:"column",height:"100%"},gridItemCardContent:{flex:1},fullHeightCardContent:{flex:1}});function gt(nt){var Me,ze,Qe;const{variant:rt}=nt,ct=We(),{entity:lt}=(0,x.X2)(),mt=(0,R.h_)(V.q3),vt=(0,R.h_)(x.Ah),Ge=(0,R.h_)(R.$v),re=(0,R.tg)(E.jU),Re=(0,x.CV)(lt,mt),Pe=(Me=lt.metadata.annotations)===null||Me===void 0?void 0:Me[n.Tf],it={label:"View Source",disabled:!Re,icon:(0,h.jsx)(V.nW,{type:Re==null?void 0:Re.integrationType}),href:Re==null?void 0:Re.locationTargetUrl},yt={label:"View TechDocs",disabled:!(!((ze=lt.metadata.annotations)===null||ze===void 0)&&ze["backstage.io/techdocs-ref"])||!re,icon:(0,h.jsx)(_.Z,{}),href:re&&re({namespace:lt.metadata.namespace||n.zG,kind:lt.kind,name:lt.metadata.name})};let At="";rt==="gridItem"?At=ct.gridItemCard:rt==="fullHeight"&&(At=ct.fullHeightCard);let pt="";rt==="gridItem"?pt=ct.gridItemCardContent:rt==="fullHeight"&&(pt=ct.fullHeightCardContent);const Ct=(Qe=lt.metadata.annotations)===null||Qe===void 0?void 0:Qe[n.P1],Pt=(Ct==null?void 0:Ct.startsWith("url:"))||(Ct==null?void 0:Ct.startsWith("file:")),kt=(0,ie.useCallback)(async()=>{await vt.refreshEntity((0,n.eE)(lt)),Ge.post({message:"Refresh scheduled",severity:"info"})},[vt,Ge,lt]);return(0,h.jsxs)(I.Z,{className:At,children:[(0,h.jsx)(ne.Z,{title:"About",action:(0,h.jsxs)(h.Fragment,{children:[Pt&&(0,h.jsx)(J.Z,{"aria-label":"Refresh",title:"Schedule entity refresh",onClick:kt,children:(0,h.jsx)(X.Z,{})}),(0,h.jsx)(J.Z,{component:g.rU,"aria-label":"Edit",disabled:!Pe,title:"Edit Metadata",to:Pe!=null?Pe:"#",children:(0,h.jsx)(he.Z,{})})]}),subheader:(0,h.jsx)(g.M6,{links:[it,yt]})}),(0,h.jsx)(Q.Z,{}),(0,h.jsx)(D.Z,{className:pt,children:(0,h.jsx)(je,{entity:lt})})]})}},79324:function(jt,Fe,t){"use strict";t.d(Fe,{K:function(){return he}});var h=t(52322),n=t(2784),g=t(79692),R=t(12420),V=t(97580),x=t(73698),l=t(74603),I=t(12231),ne=t(43297),J=t(64279),Q=t(25248),D=t(19928),X=t.n(D);const _=(0,g.Z)(ie=>(0,R.Z)({root:{...ie.typography.h4}}));function he(ie){const{initialFilter:E="component",allowedKinds:L}=ie,$=_(),A=(0,Q.h_)(ne.Ah),{value:T}=(0,J.default)(async()=>await A.getEntityFacets({facets:["kind"]}).then(ze=>{var Qe;return((Qe=ze.facets.kind)===null||Qe===void 0?void 0:Qe.map(rt=>rt.value).sort())||[]})),{filters:ee,updateFilters:Ie,queryParameters:{kind:Je}}=(0,ne.wp)(),Ze=(0,n.useMemo)(()=>{var ze;return(ze=[Je].flat()[0])===null||ze===void 0?void 0:ze.toLocaleLowerCase("en-US")},[Je]),[je,We]=(0,n.useState)(Ze!=null?Ze:E);(0,n.useEffect)(()=>{var ze;if(!((ze=ee.kind)===null||ze===void 0)&&ze.value){var Qe;We((Qe=ee.kind)===null||Qe===void 0?void 0:Qe.value)}},[ee.kind]),(0,n.useEffect)(()=>{Ie({kind:je?new ne.zo(je):void 0})},[je,Ie]),(0,n.useEffect)(()=>{Ze&&We(Ze)},[Ze]);var gt;const Me=[(0,V.Z)(je)].concat((gt=T==null?void 0:T.filter(ze=>L?L.some(Qe=>Qe.toLocaleLowerCase("en-US")===ze.toLocaleLowerCase("en-US")):!0))!==null&&gt!==void 0?gt:[]).sort().reduce((ze,Qe)=>(ze[Qe.toLocaleLowerCase("en-US")]=Qe,ze),{});return(0,h.jsx)(x.Z,{input:(0,h.jsx)(l.Z,{value:je}),value:je,onChange:ze=>We(ze.target.value),classes:$,children:Object.keys(Me).map(ze=>(0,h.jsx)(I.Z,{value:ze,children:`${X()(Me[ze])}`},ze))})}},86359:function(jt,Fe,t){"use strict";t.d(Fe,{E:function(){return ie}});var h=t(52322),n=t(25271),g=t(93414),R=t(43297),V=t(90436),x=t(15459),l=t(27604),I=t(2997),ne=t(11640),J=t(28347),Q=t(76635),D=t(2784),X=t(7089);const _=Object.freeze({createNameColumn(E){function L($){var A;return((A=$.metadata)===null||A===void 0?void 0:A.title)||(0,R.$3)($,{defaultKind:E==null?void 0:E.defaultKind})}return{title:"Name",field:"resolved.name",highlight:!0,customSort({entity:$},{entity:A}){return L($).localeCompare(L(A))},render:({entity:$})=>{var A;return(0,h.jsx)(R.dx,{entityRef:$,defaultKind:(E==null?void 0:E.defaultKind)||"Component",title:(A=$.metadata)===null||A===void 0?void 0:A.title})}}},createSystemColumn(){return{title:"System",field:"resolved.partOfSystemRelationTitle",render:({resolved:E})=>(0,h.jsx)(R.rI,{entityRefs:E.partOfSystemRelations,defaultKind:"system"})}},createOwnerColumn(){return{title:"Owner",field:"resolved.ownedByRelationsTitle",render:({resolved:E})=>(0,h.jsx)(R.rI,{entityRefs:E.ownedByRelations,defaultKind:"group"})}},createSpecTargetsColumn(){return{title:"Targets",field:"entity.spec.targets",render:({entity:E})=>{var L,$;return(0,h.jsx)(h.Fragment,{children:((E==null||(L=E.spec)===null||L===void 0?void 0:L.targets)||(E==null||($=E.spec)===null||$===void 0?void 0:$.target))&&(0,h.jsx)(g.Or,{text:(E.spec.targets||[E.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:E})=>(0,h.jsx)(g.Or,{text:E.metadata.description,placement:"bottom-start"}),width:"auto"}},createTagsColumn(){return{title:"Tags",field:"entity.metadata.tags",cellStyle:{padding:"0px 16px 0px 20px"},render:({entity:E})=>(0,h.jsx)(h.Fragment,{children:E.metadata.tags&&E.metadata.tags.map(L=>(0,h.jsx)(X.Z,{label:L,size:"small",variant:"outlined",style:{marginBottom:"0px"}},L))}),width:"auto"}},createTitleColumn(E){return{title:"Title",field:"entity.metadata.title",hidden:E==null?void 0:E.hidden,searchable:!0}},createLabelColumn(E,L){return{title:(L==null?void 0:L.title)||"Label",field:"entity.metadata.labels",cellStyle:{padding:"0px 16px 0px 20px"},render:({entity:$})=>{var A;const T=(A=$.metadata)===null||A===void 0?void 0:A.labels,ee=T&&T[E]||(L==null?void 0:L.defaultValue);return(0,h.jsx)(h.Fragment,{children:ee&&(0,h.jsx)(X.Z,{label:ee,size:"small",variant:"outlined"},ee)})},width:"auto"}}}),he=(0,x.Z)({root:{color:"#f3ba37"}})(ne.Z),ie=E=>{var L,$;const{columns:A,actions:T,tableOptions:ee,subtitle:Ie,emptyContent:Je}=E,{isStarredEntity:Ze,toggleStarredEntity:je}=(0,R.CR)(),{loading:We,error:gt,entities:nt,filters:Me}=(0,R.wp)(),ze=(0,D.useMemo)(()=>{var re;return[_.createTitleColumn({hidden:!0}),_.createNameColumn({defaultKind:(re=Me.kind)===null||re===void 0?void 0:re.value}),...Re(),_.createMetadataDescriptionColumn(),_.createTagsColumn()];function Re(){var Pe;switch((Pe=Me.kind)===null||Pe===void 0?void 0:Pe.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=Me.kind)===null||L===void 0?void 0:L.value]),Qe=Me.type===void 0;var rt;const ct=(0,Q.capitalize)((rt=($=Me.user)===null||$===void 0?void 0:$.value)!==null&&rt!==void 0?rt:"all");if(gt)return(0,h.jsx)("div",{children:(0,h.jsx)(g.GB,{severity:"error",title:"Could not fetch catalog entities.",children:(0,h.jsx)(g.Oi,{language:"text",text:gt.toString()})})});const lt=[({entity:re})=>{var Re;const Pe=(Re=re.metadata.annotations)===null||Re===void 0?void 0:Re[n.l2],it="View";return{icon:()=>(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(V.Z,{variant:"srOnly",children:it}),(0,h.jsx)(I.Z,{fontSize:"small"})]}),tooltip:it,disabled:!Pe,onClick:()=>{!Pe||window.open(Pe,"_blank")}}},({entity:re})=>{var Re;const Pe=(Re=re.metadata.annotations)===null||Re===void 0?void 0:Re[n.Tf],it="Edit";return{icon:()=>(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(V.Z,{variant:"srOnly",children:it}),(0,h.jsx)(l.Z,{fontSize:"small"})]}),tooltip:it,disabled:!Pe,onClick:()=>{!Pe||window.open(Pe,"_blank")}}},({entity:re})=>{const Re=Ze(re),Pe=Re?"Remove from favorites":"Add to favorites";return{cellStyle:{paddingLeft:"1em"},icon:()=>(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(V.Z,{variant:"srOnly",children:Pe}),Re?(0,h.jsx)(he,{}):(0,h.jsx)(J.Z,{})]}),tooltip:Pe,onClick:()=>je(re)}}],mt=nt.map(re=>{const Re=(0,R.hF)(re,n.cz,{kind:"system"}),Pe=(0,R.hF)(re,n.S4);return{entity:re,resolved:{name:(0,R.$3)(re,{defaultKind:"Component"}),ownedByRelationsTitle:Pe.map(it=>(0,R.$3)(it,{defaultKind:"group"})).join(", "),ownedByRelations:Pe,partOfSystemRelationTitle:Re.map(it=>(0,R.$3)(it,{defaultKind:"system"})).join(", "),partOfSystemRelations:Re}}}),vt=(A||ze).find(re=>re.title==="Type");vt&&(vt.hidden=!Qe);const Ge=mt.length>20;return(0,h.jsx)(g.iA,{isLoading:We,columns:A||ze,options:{paging:Ge,pageSize:20,actionsColumnIndex:-1,loadingType:"linear",showEmptyDataSourceMessage:!We,padding:"dense",pageSizeOptions:[20,50,100],...ee},title:`${ct} (${nt.length})`,data:mt,actions:T||lt,subtitle:Ie,emptyContent:Je})};ie.columns=_},24851:function(jt,Fe,t){"use strict";t.d(Fe,{s:function(){return he}});var h=t(52322),n=t(90348),g=t(11861),R=t(2784),V=t(79692),x=t(95544),l=t(90436),I=t(52160),ne=t(93414);const J=(0,V.Z)({svgIcon:{display:"inline-block","& svg":{display:"inline-block",fontSize:"inherit",verticalAlign:"baseline"}}});function Q(ie){const{href:E,text:L,Icon:$}=ie,A=J();return(0,h.jsxs)(x.Z,{display:"flex",children:[(0,h.jsx)(x.Z,{mr:1,className:A.svgIcon,children:(0,h.jsx)(l.Z,{component:"div",children:$?(0,h.jsx)($,{}):(0,h.jsx)(I.Z,{})})}),(0,h.jsx)(x.Z,{flexGrow:"1",children:(0,h.jsx)(ne.rU,{to:E,target:"_blank",rel:"noopener",children:L||E})})]})}var D=t(41156);const X={xs:1,sm:1,md:1,lg:2,xl:3};function _(ie){const E=[(0,D.Z)(T=>T.breakpoints.up("xl"))?"xl":null,(0,D.Z)(T=>T.breakpoints.up("lg"))?"lg":null,(0,D.Z)(T=>T.breakpoints.up("md"))?"md":null,(0,D.Z)(T=>T.breakpoints.up("sm"))?"sm":null,(0,D.Z)(T=>T.breakpoints.up("xs"))?"xs":null];let L=1;if(typeof ie=="number")L=ie;else{var $;const T=($=E.find(ee=>ee!==null))!==null&&$!==void 0?$:"xs";var A;L=(A=ie==null?void 0:ie[T])!==null&&A!==void 0?A:X[T]}return L}function he(ie){const{items:E,cols:L=void 0}=ie,$=_(L);return(0,h.jsx)(n.Z,{rowHeight:"auto",cols:$,children:E.map(({text:A,href:T,Icon:ee},Ie)=>(0,h.jsx)(g.Z,{children:(0,h.jsx)(Q,{href:T,text:A!=null?A:T,Icon:ee})},Ie))})}},19625:function(jt,Fe,t){"use strict";t.d(Fe,{_Z:function(){return R},jU:function(){return g},yw:function(){return n}});var h=t(25248);const n=(0,h.x8)({id:"create-component",optional:!0}),g=(0,h.x8)({id:"view-techdoc",optional:!0,params:["namespace","kind","name"]}),R=(0,h.NT)({id:"catalog"})},51666:function(jt,Fe,t){"use strict";t.d(Fe,{rG:function(){return h},Y2:function(){return $},J$:function(){return ne},g2:function(){return g}});var h;(function(A){A.DENY="DENY",A.ALLOW="ALLOW",A.CONDITIONAL="CONDITIONAL"})(h||(h={}));function n(A,T){return A.name===T.name}function g(A,T){return"resourceType"in A?!T||A.resourceType===T:!1}function R(A){return A.attributes.action==="create"}function V(A){return A.attributes.action==="read"}function x(A){return A.attributes.action==="update"}function l(A){return A.attributes.action==="delete"}function I(A){return{authorize:async(T,ee)=>await A.authorize(T,ee),authorizeConditional(T,ee){const Ie=T;return A.authorize(Ie,ee)}}}function ne({name:A,attributes:T,resourceType:ee}){return ee?{type:"resource",name:A,attributes:T,resourceType:ee}:{type:"basic",name:A,attributes:T}}var J=t(23054),Q=t(96279),D=t.n(Q),X=t(9571),_=t(30195);const he=_.z.lazy(()=>_.z.object({rule:_.z.string(),resourceType:_.z.string(),params:_.z.record(_.z.any()).optional()}).or(_.z.object({anyOf:_.z.array(he).nonempty()})).or(_.z.object({allOf:_.z.array(he).nonempty()})).or(_.z.object({not:he}))),ie=_.z.object({result:_.z.literal(h.ALLOW).or(_.z.literal(h.DENY))}),E=_.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:he})]),L=(A,T)=>_.z.object({items:_.z.array(_.z.intersection(_.z.object({id:_.z.string()}),A)).refine(ee=>ee.length===T.size&&ee.every(({id:Ie})=>T.has(Ie)),{message:"Items in response do not match request"})});class ${async authorize(T,ee){return this.makeRequest(T,ie,ee)}async authorizeConditional(T,ee){return this.makeRequest(T,E,ee)}async makeRequest(T,ee,Ie){if(!this.enabled)return T.map(Me=>({result:h.ALLOW}));const Je={items:T.map(Me=>({id:X.Z(),...Me}))},Ze=await this.discovery.getBaseUrl("permission"),je=await D()(`${Ze}/authorize`,{method:"POST",body:JSON.stringify(Je),headers:{...this.getAuthorizationHeader(Ie==null?void 0:Ie.token),"content-type":"application/json"}});if(!je.ok)throw await J.VL.fromResponse(je);const We=await je.json(),nt=L(ee,new Set(Je.items.map(({id:Me})=>Me))).parse(We).items.reduce((Me,ze)=>(Me[ze.id]=ze,Me),{});return Je.items.map(Me=>nt[Me.id])}getAuthorizationHeader(T){return T?{Authorization:`Bearer ${T}`}:{}}constructor(T){this.discovery=T.discovery;var ee;this.enabled=(ee=T.config.getOptionalBoolean("permission.enabled"))!==null&&ee!==void 0?ee:!1}}},25488:function(jt,Fe,t){"use strict";t.d(Fe,{iM:function(){return x},RV:function(){return R},gI:function(){return I}});var h=t(52322),n=t(2784),g=t(25248);const R=(0,g.T0)({id:"plugin.permission.api"});var V=t(51666);class x{static create(D){const{config:X,discovery:_,identity:he}=D,ie=new V.Y2({discovery:_,config:X});return new x(ie,he)}async authorize(D){return(await this.permissionClient.authorize([D],await this.identityApi.getCredentials()))[0]}constructor(D,X){this.permissionClient=D,this.identityApi=X}}var l=t(49857);function I(Q){const D=(0,g.h_)(R),{data:X,error:_}=(0,l.ZP)(Q,async he=>{if((0,V.g2)(he.permission)&&!he.resourceRef)return V.rG.DENY;const{result:ie}=await D.authorize(he);return ie});return _?{error:_,loading:!1,allowed:!1}:X===void 0?{loading:!0,allowed:!1}:{loading:!1,allowed:X===V.rG.ALLOW}}const ne=Q=>{const{permission:D,resourceRef:X,errorComponent:_,...he}=Q,ie=usePermission(isResourcePermission(D)?{permission:D,resourceRef:X}:{permission:D}),E=useApp(),{NotFoundErrorPage:L}=E.getComponents();let $=_===void 0?_jsx(L,{}):_;return ie.loading?$=null:ie.allowed&&($=Q.element),_jsx(Route,{...he,element:$})};function J(Q){const{permission:D,resourceRef:X}=Q,_=usePermission(isResourcePermission(D)?{permission:D,resourceRef:X}:{permission:D}),he=useApp();if(_.loading)return null;if(_.allowed)return _jsx(_Fragment,{children:Q.children});if(Q.errorPage)return _jsx(_Fragment,{children:Q.errorPage});const{NotFoundErrorPage:ie}=he.getComponents();return _jsx(ie,{})}},65826:function(jt,Fe,t){"use strict";t.d(Fe,{FA:function(){return I},qO:function(){return rt},Nd:function(){return Ze},Rx:function(){return A}});var h=t(25248);const n=(0,h.T0)({id:"plugin.search.queryservice"});class g{query(){return Promise.resolve(this.mockedResults||{results:[]})}constructor(Z){this.mockedResults=Z}}var R=t(52322),V=t(2784),x=t(79692);const l=(0,x.Z)(()=>({highlight:{}}),{name:"BackstageHighlightedSearchResultText"}),I=({text:U,preTag:Z,postTag:ce})=>{const pe=l(),be=(0,V.useMemo)(()=>U.split(new RegExp(`(${Z}.+?${ce})`)),[ce,Z,U]);return(0,R.jsx)(R.Fragment,{children:be.map((Be,Oe)=>Be.includes(Z)?(0,R.jsx)("mark",{className:pe.highlight,children:Be.replace(new RegExp(`${Z}|${ce}`,"g"),"")},Oe):Be)})};var ne=t(48760),J=t(50581),Q=t(61837),D=t(74603),X=t(21853),_=t(33375),he=t(76635),ie=t(64279),E=t(1849),L=t(51837);const $=(0,L.CT)("search-context"),A=()=>{const U=(0,V.useContext)($);if(!U)throw new Error("useSearch must be used within a SearchContextProvider");const Z=U.atVersion(1);if(!Z)throw new Error("No SearchContext v1 found");return Z},T=()=>(0,V.useContext)($)!==void 0,ee={term:"",types:[],filters:{},pageLimit:void 0,pageCursor:void 0},Ie=(U=ee)=>{var Z,ce,pe,be;const Be=(0,h.h_)(n),[Oe,He]=(0,V.useState)(U.term),[st,S]=(0,V.useState)(U.types),[H,me]=(0,V.useState)(U.filters),[ue,Ce]=(0,V.useState)(U.pageLimit),[ke,Ne]=(0,V.useState)(U.pageCursor),ot=(0,E.Z)(Oe),ht=(0,E.Z)(H),ut=(0,ie.default)(()=>Be.query({term:Oe,types:st,filters:H,pageLimit:ue,pageCursor:ke}),[Oe,st,H,ue,ke]),et=!ut.loading&&!ut.error&&((Z=ut.value)===null||Z===void 0?void 0:Z.nextPageCursor),St=!ut.loading&&!ut.error&&((ce=ut.value)===null||ce===void 0?void 0:ce.previousPageCursor),at=(0,V.useCallback)(()=>{var Nt;Ne((Nt=ut.value)===null||Nt===void 0?void 0:Nt.nextPageCursor)},[(pe=ut.value)===null||pe===void 0?void 0:pe.nextPageCursor]),Tt=(0,V.useCallback)(()=>{var Nt;Ne((Nt=ut.value)===null||Nt===void 0?void 0:Nt.previousPageCursor)},[(be=ut.value)===null||be===void 0?void 0:be.previousPageCursor]);return(0,V.useEffect)(()=>{ot!==void 0&&Oe!==ot&&Ne(void 0)},[Oe,ot,Ne]),(0,V.useEffect)(()=>{ht!==void 0&&!(0,he.isEqual)(H,ht)&&Ne(void 0)},[H,ht,Ne]),{result:ut,term:Oe,setTerm:He,types:st,setTypes:S,filters:H,setFilters:me,pageLimit:ue,setPageLimit:Ce,pageCursor:ke,setPageCursor:Ne,fetchNextPage:et?at:void 0,fetchPreviousPage:St?Tt:void 0}},Je=U=>{const{initialState:Z,children:ce}=U,pe=Ie(Z);return(0,R.jsx)(h.fC,{attributes:{searchTypes:pe.types.sort().join(",")},children:(0,R.jsx)($.Provider,{value:(0,L.EI)({1:pe}),children:ce})})},Ze=U=>{const{initialState:Z,inheritParentContextIfAvailable:ce,children:pe}=U;return T()&&ce?(0,R.jsx)(R.Fragment,{children:pe}):(0,R.jsx)(Je,{initialState:Z,children:pe})},je=({children:U})=>{const Z=(0,h.z$)(),{term:ce}=A();return(0,V.useEffect)(()=>{ce&&Z.captureEvent("search",ce)},[Z,ce]),(0,R.jsx)(R.Fragment,{children:U})};function We(U){return(0,V.forwardRef)((Z,ce)=>(0,R.jsx)(Ze,{inheritParentContextIfAvailable:!0,children:(0,R.jsx)(U,{...Z,ref:ce})}))}const gt=We((0,V.forwardRef)((U,Z)=>{const{onChange:ce,onKeyDown:pe=()=>{},onClear:be=()=>{},onSubmit:Be=()=>{},debounceTime:Oe=200,clearButton:He=!0,fullWidth:st=!0,value:S,placeholder:H,inputProps:me={},endAdornment:ue,...Ce}=U,ke=(0,h.h_)(h.Ds),[Ne,ot]=(0,V.useState)("");(0,V.useEffect)(()=>{ot(Bt=>Bt!==S?String(S):Bt)},[S]),(0,ne.Z)(()=>ce(Ne),Oe,[Ne]);const ht=(0,V.useCallback)(Bt=>{ot(Bt.target.value)},[ot]),ut=(0,V.useCallback)(Bt=>{pe&&pe(Bt),Be&&Bt.key==="Enter"&&Be()},[pe,Be]),et=(0,V.useCallback)(()=>{ce(""),be&&be()},[ce,be]),St=H!=null?H:`Search in ${ke.getOptionalString("app.title")||"Backstage"}`,at=(0,R.jsx)(J.Z,{position:"start",children:(0,R.jsx)(Q.Z,{"aria-label":"Query",size:"small",disabled:!0,children:(0,R.jsx)(X.Z,{})})}),Tt=(0,R.jsx)(J.Z,{position:"end",children:(0,R.jsx)(Q.Z,{"aria-label":"Clear",size:"small",onClick:et,children:(0,R.jsx)(_.Z,{})})});return(0,R.jsx)(je,{children:(0,R.jsx)(D.Z,{"data-testid":"search-bar-next",ref:Z,value:Ne,placeholder:St,startAdornment:at,endAdornment:He?Tt:ue,inputProps:{"aria-label":"Search",...me},fullWidth:st,onChange:ht,onKeyDown:ut,...Ce})})})),nt=We((0,V.forwardRef)((U,Z)=>{const{value:ce="",onChange:pe,...be}=U,{term:Be,setTerm:Oe}=A();(0,V.useEffect)(()=>{ce&&Oe(String(ce))},[ce,Oe]);const He=(0,V.useCallback)(st=>{pe?pe(st):Oe(st)},[pe,Oe]);return(0,R.jsx)(h.fC,{attributes:{pluginId:"search",extension:"SearchBar"},children:(0,R.jsx)(gt,{...be,ref:Z,value:Be,onChange:He})})}));var Me=t(4614),ze=t(88013);const rt=(U=>Z=>(0,R.jsx)(Ze,{inheritParentContextIfAvailable:!0,children:(0,R.jsx)(U,{...Z})}))(function(Z){const{loading:ce,value:pe,onChange:be=()=>{},options:Be=[],getOptionLabel:Oe=et=>String(et),inputPlaceholder:He,inputDebounceTime:st,freeSolo:S=!0,fullWidth:H=!0,clearOnBlur:me=!1,"data-testid":ue="search-autocomplete",...Ce}=Z,{setTerm:ke}=A(),Ne=(0,V.useCallback)(et=>et?typeof et=="string"?et:Oe(et):"",[Oe]),ot=(0,V.useMemo)(()=>Ne(pe),[pe,Ne]),ht=(0,V.useCallback)((et,St,at,Tt)=>{ke(Ne(St)),be(et,St,at,Tt)},[Ne,ke,be]),ut=(0,V.useCallback)(({InputProps:{ref:et,endAdornment:St},InputLabelProps:at,...Tt})=>(0,R.jsx)(nt,{...Tt,ref:et,clearButton:!1,value:ot,placeholder:He,debounceTime:st,endAdornment:ce?(0,R.jsx)(Me.Z,{"data-testid":"search-autocomplete-progressbar",color:"inherit",size:20}):St}),[ce,ot,He,st]);return(0,R.jsx)(ze.ZP,{...Ce,"data-testid":ue,value:pe,onChange:ht,options:Be,getOptionLabel:Oe,renderInput:ut,freeSolo:S,fullWidth:H,clearOnBlur:me})}),ct=({icon:U,primaryText:Z,primaryTextTypographyProps:ce,secondaryText:pe,secondaryTextTypographyProps:be,disableTextTypography:Be})=>_jsxs(_Fragment,{children:[U?_jsx(ListItemIcon,{children:U}):null,_jsx(ListItemText,{primary:Z,primaryTypographyProps:ce,secondary:pe,secondaryTypographyProps:be,disableTypography:Be})]});var lt=t(42494),mt=t(84899),vt=t(5806),Ge=t(21324),re=t(56939),Re=t(73698),Pe=t(12231),it=t(86619),yt=t(7089),At=t(69294);const pt=(U,Z,ce=[],pe=250)=>{const be=(0,V.useRef)({}),Be=U||(()=>Promise.resolve([])),[Oe,He]=(0,At.default)(Be,[Z],{loading:!0});if((0,ne.Z)(()=>{be.current[Z]===void 0&&(be.current[Z]=He(Z).then(S=>(be.current[Z]=S,S)))},pe,[He,Z]),ce.length)return{loading:!1,value:ce};const st=be.current[Z];return Array.isArray(st)?{loading:!1,value:st}:Oe},Ct=(U,Z)=>{const{setFilters:ce}=A();(0,V.useEffect)(()=>{Z&&[Z].flat().length>0&&ce(pe=>({...pe,[U]:Z}))},[])},Pt=U=>{const{className:Z,defaultValue:ce,name:pe,values:be,valuesDebounceMs:Be,label:Oe,filterSelectedOptions:He,limitTags:st,multiple:S}=U,[H,me]=(0,V.useState)("");Ct(pe,ce);const ue=typeof be=="function"?be:void 0,Ce=typeof be=="function"?void 0:be,{value:ke,loading:Ne}=pt(ue,H,Ce,Be),{filters:ot,setFilters:ht}=A(),ut=ot[pe]||(S?[]:null),et=(Tt,Bt)=>{ht(Nt=>{const{[pe]:vn,...Gn}=Nt;return Bt?{...Gn,[pe]:Bt}:{...Gn}})},St=Tt=>(0,R.jsx)(it.Z,{...Tt,name:"search",variant:"outlined",label:Oe,fullWidth:!0}),at=(Tt,Bt)=>Tt.map((Nt,vn)=>(0,R.jsx)(yt.Z,{label:Nt,color:"primary",...Bt({index:vn})}));return(0,R.jsx)(ze.ZP,{filterSelectedOptions:He,limitTags:st,multiple:S,className:Z,id:`${S?"multi-":""}select-filter-${pe}--select`,options:ke||[],loading:Ne,value:ut,onChange:et,onInputChange:(Tt,Bt)=>me(Bt),renderInput:St,renderTags:at})},kt=(0,x.Z)({label:{textTransform:"capitalize"}}),en=U=>{const{className:Z,defaultValue:ce,label:pe,name:be,values:Be=[],valuesDebounceMs:Oe}=U,He=kt(),{filters:st,setFilters:S}=A();Ct(be,ce);const H=typeof Be=="function"?Be:void 0,me=typeof Be=="function"?void 0:Be,{value:ue=[],loading:Ce}=pt(H,"",me,Oe),ke=ot=>{const{target:{value:ht,checked:ut}}=ot;S(et=>{const{[be]:St,...at}=et,Tt=(St||[]).filter(Nt=>Nt!==ht),Bt=ut?[...Tt,ht]:Tt;return Bt.length?{...at,[be]:Bt}:at})};var Ne;return(0,R.jsxs)(lt.Z,{className:Z,disabled:Ce,fullWidth:!0,"data-testid":"search-checkboxfilter-next",children:[pe?(0,R.jsx)(mt.Z,{className:He.label,children:pe}):null,ue.map(ot=>(0,R.jsx)(vt.Z,{control:(0,R.jsx)(Ge.Z,{color:"primary",tabIndex:-1,inputProps:{"aria-labelledby":ot},value:ot,name:ot,onChange:ke,checked:((Ne=st[be])!==null&&Ne!==void 0?Ne:[]).includes(ot)}),label:ot},ot))]})},sn=U=>{const{className:Z,defaultValue:ce,label:pe,name:be,values:Be,valuesDebounceMs:Oe}=U,He=kt();Ct(be,ce);const st=typeof Be=="function"?Be:void 0,S=typeof Be=="function"?void 0:Be,{value:H=[],loading:me}=pt(st,"",S,Oe),{filters:ue,setFilters:Ce}=A(),ke=Ne=>{const{target:{value:ot}}=Ne;Ce(ht=>{const{[be]:ut,...et}=ht;return ot?{...et,[be]:ot}:et})};return(0,R.jsxs)(lt.Z,{disabled:me,className:Z,variant:"filled",fullWidth:!0,"data-testid":"search-selectfilter-next",children:[pe?(0,R.jsx)(re.Z,{className:He.label,margin:"dense",children:pe}):null,(0,R.jsxs)(Re.Z,{variant:"outlined",value:ue[be]||"",onChange:ke,children:[(0,R.jsx)(Pe.Z,{value:"",children:(0,R.jsx)("em",{children:"All"})}),H.map(Ne=>(0,R.jsx)(Pe.Z,{value:Ne,children:Ne},Ne))]})]})},Ht=({component:U,...Z})=>(0,R.jsx)(U,{...Z});Ht.Checkbox=U=>(0,R.jsx)(Ht,{...U,component:en}),Ht.Select=U=>(0,R.jsx)(Ht,{...U,component:sn}),Ht.Autocomplete=U=>(0,R.jsx)(Ht,{...U,component:Pt});var Gt=t(93414);const fn=U=>{const{children:Z}=U,pe=useSearch().result;return Z(pe)},_t=U=>{const{query:Z,children:ce}=U,pe=useApi(searchApiRef),be=useAsync(()=>{const{term:Be="",types:Oe=[],filters:He={},...st}=Z;return pe.query({...st,term:Be,types:Oe,filters:He})},[Z]);return ce(be)},Zn=U=>{const{query:Z,children:ce}=U;return Z?_jsx(_t,{query:Z,children:ce}):_jsx(fn,{children:ce})},ln=U=>{const{query:Z,children:ce}=U;return _jsx(Zn,{query:Z,children:({loading:pe,error:be,value:Be})=>pe?_jsx(Progress,{}):be?_jsx(ResponseErrorPanel,{title:"Error encountered while fetching search results",error:be}):Be!=null&&Be.results.length?ce(Be):_jsx(EmptyState,{missing:"data",title:"Sorry, no results were found"})})},Dn=U=>_jsx(AnalyticsContext,{attributes:{pluginId:"search",extension:"SearchResult"},children:_jsx(ln,{...U})}),gn=(0,x.Z)(U=>({root:{display:"flex",justifyContent:"space-between",gap:U.spacing(2),margin:U.spacing(2,0)}})),Jn=()=>{const{fetchNextPage:U,fetchPreviousPage:Z}=useSearch(),ce=gn();return!U&&!Z?_jsx(_Fragment,{}):_jsxs("nav",{"aria-label":"pagination navigation",className:ce.root,children:[_jsx(Button,{"aria-label":"previous page",disabled:!Z,onClick:Z,startIcon:_jsx(ArrowBackIosIcon,{}),children:"Previous"}),_jsx(Button,{"aria-label":"next page",disabled:!U,onClick:U,endIcon:_jsx(ArrowForwardIosIcon,{}),children:"Next"})]})};var Kt=t(48834).lW;const In=U=>Kt.from(U.toString(),"utf-8").toString("base64"),Nn=U=>U?Number(Kt.from(U,"base64").toString("utf-8")):0,Yt=U=>{const{total:Z=-1,cursor:ce,onCursorChange:pe,limit:be=25,limitLabel:Be="Results per page:",limitText:Oe=({from:Ce,to:ke})=>Z>0?`of ${Z}`:`${Ce}-${ke}`,limitOptions:He,onLimitChange:st,...S}=U,H=useMemo(()=>Nn(ce),[ce]),me=useCallback((Ce,ke)=>{pe==null||pe(In(ke))},[pe]),ue=useCallback(Ce=>{const ke=Ce.target.value;st==null||st(parseInt(ke,10))},[st]);return _jsx(TablePagination,{...S,component:"div",count:Z,page:H,onPageChange:me,rowsPerPage:be,labelRowsPerPage:Be,labelDisplayedRows:Oe,rowsPerPageOptions:He,onRowsPerPageChange:ue})},mn=U=>{const{pageLimit:Z,setPageLimit:ce,pageCursor:pe,setPageCursor:be}=useSearch();return _jsx(Yt,{...U,limit:Z,onLimitChange:ce,cursor:pe,onCursorChange:be})},cn=({result:U,highlight:Z,rank:ce,icon:pe,secondaryAction:be,lineClamp:Be=5})=>{const Oe=useAnalytics(),He=()=>{Oe.captureEvent("discover",U.title,{attributes:{to:U.location},value:ce})};return _jsxs(Link,{noTrack:!0,to:U.location,onClick:He,children:[_jsxs(ListItem,{alignItems:"center",children:[pe&&_jsx(ListItemIcon,{children:pe}),_jsx(ListItemText,{primaryTypographyProps:{variant:"h6"},primary:Z!=null&&Z.fields.title?_jsx(HighlightedSearchResultText,{text:Z.fields.title,preTag:Z.preTag,postTag:Z.postTag}):U.title,secondary:_jsx("span",{style:{display:"-webkit-box",WebkitBoxOrient:"vertical",WebkitLineClamp:Be,overflow:"hidden"},children:Z!=null&&Z.fields.text?_jsx(HighlightedSearchResultText,{text:Z.fields.text,preTag:Z.preTag,postTag:Z.postTag}):U.text})}),be&&_jsx(Box,{alignItems:"flex-end",children:be})]}),_jsx(Divider,{})]})},Rn=U=>_jsx(AnalyticsContext,{attributes:{pluginId:"search",extension:"DefaultResultListItem"},children:_jsx(cn,{...U})}),Fn=U=>{const{loading:Z,error:ce,resultItems:pe,renderResultItem:be=He=>_jsx(DefaultResultListItem,{result:He.document},He.document.location),noResultsComponent:Be=_jsx(EmptyState,{missing:"data",title:"Sorry, no results were found"}),...Oe}=U;return _jsxs(List,{...Oe,children:[Z?_jsx(Progress,{}):null,!Z&&ce?_jsx(ResponseErrorPanel,{title:"Error encountered while fetching search results",error:ce}):null,!Z&&!ce&&(pe==null?void 0:pe.length)?pe.map(be):null,!Z&&!ce&&!(pe!=null&&pe.length)?_jsx(ListItem,{children:Be}):null]})},Cn=U=>{const{query:Z,disableRenderingWithNoResults:ce,...pe}=U;return _jsx(AnalyticsContext,{attributes:{pluginId:"search",extension:"SearchResultList"},children:_jsx(SearchResultState,{query:Z,children:({loading:be,error:Be,value:Oe})=>{var He;return!(!(Oe==null||(He=Oe.results)===null||He===void 0)&&He.length)&&ce?null:_jsx(Fn,{...pe,loading:be,error:Be,resultItems:Oe==null?void 0:Oe.results})}})})};var ge=t(19126);const te=(0,x.Z)(U=>({listSubheader:{display:"flex",alignItems:"center"},listSubheaderName:{marginLeft:U.spacing(1),textTransform:"uppercase"},listSubheaderChip:{color:U.palette.text.secondary,margin:U.spacing(0,0,0,1.5)},listSubheaderFilter:{display:"flex",color:U.palette.text.secondary,margin:U.spacing(0,0,0,1.5)},listSubheaderLink:{marginLeft:"auto",display:"flex",alignItems:"center"},listSubheaderLinkIcon:{fontSize:"inherit",marginLeft:U.spacing(.5)}})),Ee=U=>{const Z=te(),{label:ce,children:pe,...be}=U;return _jsx(Chip,{...be,className:Z.listSubheaderFilter,variant:"outlined",label:_jsxs(_Fragment,{children:[ce,": ",pe]})})},De=()=>null,qe=(0,x.Z)(U=>({root:{fontSize:"inherit","&:focus":{outline:"none",background:U.palette.common.white},"&:not(:focus)":{cursor:"pointer",color:U.palette.primary.main,"&:hover":{textDecoration:"underline"}}}})),xt=U=>{const Z=qe(),{label:ce,value:pe="None",onChange:be,onDelete:Be}=U,Oe=useCallback(He=>{be(He.target.value)},[be]);return _jsx(Ee,{label:ce,onDelete:Be,children:_jsx(Typography,{role:"textbox",component:"span",className:Z.root,onChange:Oe,contentEditable:!0,suppressContentEditableWarning:!0,children:pe})})},ae=(0,x.Z)(U=>({root:{fontSize:"inherit","&:not(:focus)":{cursor:"pointer",color:U.palette.primary.main,"&:hover":{textDecoration:"underline"}},"&:focus":{outline:"none"},"&>div:first-child":{padding:0}}})),P=U=>{const Z=ae(),{label:ce,value:pe="none",onChange:be,onDelete:Be,children:Oe}=U,He=useCallback(st=>{be(st.target.value)},[be]);return _jsx(Ee,{label:ce,onDelete:Be,children:_jsxs(Select,{className:Z.root,value:pe,onChange:He,input:_jsx(InputBase,{}),IconComponent:De,children:[_jsx(MenuItem,{value:"none",children:"None"}),Oe]})})};function q(U){const Z=te(),[ce,pe]=useState(null),{loading:be,error:Be,icon:Oe,title:He,titleProps:st={},link:S=_jsxs(_Fragment,{children:["See all",_jsx(ArrowRightIcon,{className:Z.listSubheaderLinkIcon})]}),linkProps:H={},filterOptions:me,renderFilterOption:ue=Tt=>_jsx(MenuItem,{value:String(Tt),children:Tt},String(Tt)),filterFields:Ce,renderFilterField:ke,resultItems:Ne,renderResultItem:ot=Tt=>_jsx(DefaultResultListItem,{result:Tt.document},Tt.document.location),noResultsComponent:ht=_jsx(EmptyState,{missing:"data",title:"Sorry, no results were found"}),...ut}=U,et=useCallback(Tt=>{pe(Tt.currentTarget)},[]),St=useCallback(()=>{pe(null)},[]);var at;return _jsxs(List,{...ut,children:[_jsxs(ListSubheader,{className:Z.listSubheader,children:[Oe,_jsx(Typography,{className:Z.listSubheaderName,component:"strong",...st,children:He}),me?_jsx(Chip,{className:Z.listSubheaderChip,component:"button",icon:_jsx(AddIcon,{}),variant:"outlined",label:"Add filter","aria-controls":"filters-menu","aria-haspopup":"true",onClick:et}):null,me?_jsx(Menu,{id:"filters-menu",anchorEl:ce,open:Boolean(ce),onClose:St,onClick:St,keepMounted:!0,children:me.map(ue)}):null,Ce==null?void 0:Ce.map(Tt=>(at=ke==null?void 0:ke(Tt))!==null&&at!==void 0?at:null),_jsx(Link,{className:Z.listSubheaderLink,to:"/search",...H,children:S})]}),be?_jsx(Progress,{}):null,!be&&Be?_jsx(ResponseErrorPanel,{title:"Error encountered while fetching search results",error:Be}):null,!be&&!Be&&(Ne==null?void 0:Ne.length)?Ne.map(ot):null,!be&&!Be&&!(Ne!=null&&Ne.length)?_jsx(ListItem,{children:ht}):null]})}function Ke(U){const{query:Z,linkProps:ce={},disableRenderingWithNoResults:pe,...be}=U,Be=`/search?${qs.stringify({query:Z.term,types:Z.types,filters:Z.filters,pageCursor:Z.pageCursor},{arrayFormat:"brackets"})}`;return _jsx(AnalyticsContext,{attributes:{pluginId:"search",extension:"SearchResultGroup"},children:_jsx(SearchResultState,{query:Z,children:({loading:Oe,error:He,value:st})=>{var S;if(!(!(st==null||(S=st.results)===null||S===void 0)&&S.length)&&pe)return null;var H;return _jsx(q,{...be,loading:Oe,error:He,linkProps:{to:Be,...ce},resultItems:st==null?void 0:st.results,filterFields:Object.keys((H=Z.filters)!==null&&H!==void 0?H:{})})}})})}},61886:function(jt,Fe,t){"use strict";t.d(Fe,{Ox:function(){return Me},Zz:function(){return x},oZ:function(){return Ze},DR:function(){return l},ZS:function(){return Ie},VA:function(){return rt},KY:function(){return ne},gT:function(){return _},Dl:function(){return he},ux:function(){return Qe},$L:function(){return X},x1:function(){return Je}});var h=t(52322),n=t(2784),g=t(10289),R=t(25248);const V="techdocs.addons.addon.v1",x="techdocs.addons.wrapper.v1",l=()=>null;(0,R.R5)(l,x,!0);const I=re=>`${V}.${re.toLocaleLowerCase("en-US")}`;function ne(re){const{name:Re,component:Pe}=re;return(0,R.YO)({name:Re,component:{sync:it=>(0,h.jsx)(Pe,{...it})},data:{[V]:re,[I(Re)]:!0}})}const J=(re,Re)=>re.selectByComponentData({key:Re}).getElements()[0],Q=re=>re.selectByComponentData({key:x}).selectByComponentData({key:V}),D=re=>re.selectByComponentData({key:x}).findComponentData({key:V}),X=()=>{const re=(0,g.pC)(),Re=(0,R.vJ)(re,Q),Pe=(0,R.vJ)(re,D),it=(0,n.useCallback)(pt=>{if(!Re||!pt)return null;const Ct=I(pt.name);var Pt;return(Pt=J(Re,Ct))!==null&&Pt!==void 0?Pt:null},[Re]),yt=(0,n.useCallback)(pt=>{const Ct=Pe.find(Pt=>Pt.name===pt);return Ct?it(Ct):null},[Pe,it]),At=(0,n.useCallback)(pt=>{const Ct=Pe.filter(Pt=>Pt.location===pt);return Ct.length?Ct.map(it):null},[Pe,it]);return{renderComponentByName:yt,renderComponentsByLocation:At}},_=(0,R.T0)({id:"plugin.techdocs.service"}),he=(0,R.T0)({id:"plugin.techdocs.storageservice"});var ie=t(64279),E=t(25271),L=t(51837);function $(re,Re){return Re.getOptionalBoolean("techdocs.legacyUseCaseSensitiveTripletPaths")||(re.kind=re.kind.toLocaleLowerCase(),re.name=re.name.toLocaleLowerCase(),re.namespace=re.namespace.toLocaleLowerCase()),re}const A=(re,Re)=>(0,E.eE)(re)===(0,E.eE)(Re),T={title:"",subtitle:"",setTitle:()=>{},setSubtitle:()=>{},setShadowRoot:()=>{},metadata:{loading:!0},entityMetadata:{loading:!0},entityRef:{kind:"",name:"",namespace:""}},ee=(0,L.CT)("techdocs-reader-page-context"),Ie=(0,n.memo)(({entityRef:re,children:Re})=>{const Pe=(0,R.h_)(_),it=(0,R.h_)(R.Ds),yt=(0,ie.default)(async()=>Pe.getTechDocsMetadata(re),[re]),At=(0,ie.default)(async()=>Pe.getEntityMetadata(re),[re]),[pt,Ct]=(0,n.useState)(T.title),[Pt,kt]=(0,n.useState)(T.subtitle),[en,sn]=(0,n.useState)(T.shadowRoot),Ht={metadata:yt,entityRef:$(re,it),entityMetadata:At,shadowRoot:en,setShadowRoot:sn,title:pt,setTitle:Ct,subtitle:Pt,setSubtitle:kt},Gt=(0,L.EI)({1:Ht});return(0,h.jsx)(R.fC,{attributes:{entityRef:(0,E.eE)(re)},children:(0,h.jsx)(ee.Provider,{value:Gt,children:Re instanceof Function?Re(Ht):Re})})},(re,Re)=>A(re.entityRef,Re.entityRef)),Je=()=>{const re=(0,n.useContext)(ee);if(re===void 0)return T;const Re=re.atVersion(1);if(Re===void 0)throw new Error("No context found for version 1.");return Re},Ze=Object.freeze({Header:"Header",Subheader:"Subheader",Settings:"Settings",PrimarySidebar:"PrimarySidebar",SecondarySidebar:"SecondarySidebar",Content:"Content"});var je=t(70882),We=t(50236),gt=t(19219),nt=t(93414);const Me="TECH_DOCS_SHADOW_DOM_STYLE_LOAD",ze=re=>{(0,n.useEffect)(()=>{if(!re)return()=>{};const Re=re.querySelectorAll('head > link[rel="stylesheet"]');var Pe;let it=(Pe=Re==null?void 0:Re.length)!==null&&Pe!==void 0?Pe:0;const yt=new CustomEvent(Me);if(!it)return re.dispatchEvent(yt),()=>{};const At=()=>{--it===0&&re.dispatchEvent(yt)};return Re==null||Re.forEach(pt=>{pt.addEventListener("load",At)}),()=>{Re==null||Re.forEach(pt=>{pt.removeEventListener("load",At)})}},[re])},Qe=re=>{const[Re,Pe]=(0,n.useState)(!1);return(0,n.useEffect)(()=>{if(!re)return()=>{};Pe(!0);const it=re.style;it.setProperty("opacity","0");const yt=()=>{Pe(!1),it.setProperty("opacity","1")};return re.addEventListener(Me,yt),()=>{re.removeEventListener(Me,yt)}},[re]),Re},rt=({element:re,onAppend:Re,children:Pe})=>{const[it,yt]=(0,n.useState)((0,je.Ue)({...(0,We.Z)(),insertionPoint:void 0}));ze(re);const At=Qe(re),pt=(0,n.useCallback)(Ct=>{if(!re||!Ct)return;yt((0,je.Ue)({...(0,We.Z)(),insertionPoint:re.querySelector("head")||void 0}));let Pt=Ct.shadowRoot;Pt||(Pt=Ct.attachShadow({mode:"open"})),Pt.replaceChildren(re),typeof Re=="function"&&Re(Pt)},[re,Re]);return(0,h.jsxs)(h.Fragment,{children:[At&&(0,h.jsx)(nt.Ex,{}),(0,h.jsxs)(gt.ZP,{jss:it,sheetsManager:new Map,children:[(0,h.jsx)("div",{ref:pt,"data-testid":"techdocs-native-shadowroot"}),Pe]})]})};var ct=t(54073);const lt=()=>{const{shadowRoot:re}=useTechDocsReaderPage();return re},mt=re=>{const Re=lt();return Re?re.map(Pe=>Re==null?void 0:Re.querySelectorAll(Pe)).filter(Pe=>Pe.length).map(Pe=>Array.from(Pe)).flat():[]},vt=re=>re.toString()&&re.rangeCount&&re.getRangeAt(0).getBoundingClientRect().top,Ge=(re=0)=>{const Re=lt(),[Pe,it]=useState(null),yt=useMemo(()=>debounce(()=>{const At=Re,pt=At.getSelection?At.getSelection():document.getSelection();pt&&vt(pt)?it(pt):it(null)},re),[Re,it,re]);return useEffect(()=>(window.document.addEventListener("selectionchange",yt),()=>window.document.removeEventListener("selectionchange",yt)),[yt]),Pe}},52943:function(jt,Fe,t){"use strict";t.r(Fe),t.d(Fe,{EmbeddedDocsRouter:function(){return ie},Router:function(){return he},isTechDocsAvailable:function(){return _}});var h=t(52322),n=t(2784),g=t(10289),R=t(43297),V=t(93414),x=t(25271),l=t(89258),I=t(65124),ne=t(67896);const J=({entity:E})=>{const L=(0,x.iB)(E);return(0,h.jsxs)(l.I6,{entityRef:L,children:[(0,h.jsx)(I.b,{}),(0,h.jsx)(ne.F,{withSearch:!1})]})};var Q=t(18662),D=t(7476);const X="backstage.io/techdocs-ref",_=E=>{var L,$;return Boolean(E==null||(L=E.metadata)===null||L===void 0||($=L.annotations)===null||$===void 0?void 0:$[X])},he=()=>(0,h.jsxs)(g.Z5,{children:[(0,h.jsx)(g.AW,{path:"/",element:(0,h.jsx)(Q.TechDocsIndexPage,{})}),(0,h.jsx)(g.AW,{path:"/:namespace/:kind/:name/*",element:(0,h.jsx)(D.TechDocsReaderPage,{})})]}),ie=E=>{var L;const{children:$}=E,{entity:A}=(0,R.X2)(),T=(0,g.V$)([{path:"/*",element:(0,h.jsx)(J,{entity:A}),children:[{path:"*",element:$}]}]);return((L=A.metadata.annotations)===null||L===void 0?void 0:L[X])?T:(0,h.jsx)(V.sk,{annotation:X})}},92077:function(jt,Fe,t){"use strict";t.d(Fe,{k:function(){return V},p:function(){return R}});var h=t(23054),n=t(76372),g=t.n(n);class R{async getApiOrigin(){return await this.discoveryApi.getBaseUrl("techdocs")}async getTechDocsMetadata(l){const{kind:I,namespace:ne,name:J}=l,D=`${await this.getApiOrigin()}/metadata/techdocs/${ne}/${I}/${J}`,X=await this.fetchApi.fetch(`${D}`);if(!X.ok)throw await h.VL.fromResponse(X);return await X.json()}async getEntityMetadata(l){const{kind:I,namespace:ne,name:J}=l,D=`${await this.getApiOrigin()}/metadata/entity/${ne}/${I}/${J}`,X=await this.fetchApi.fetch(`${D}`);if(!X.ok)throw await h.VL.fromResponse(X);return await X.json()}constructor(l){this.configApi=l.configApi,this.discoveryApi=l.discoveryApi,this.fetchApi=l.fetchApi}}class V{async getApiOrigin(){return await this.discoveryApi.getBaseUrl("techdocs")}async getStorageUrl(){var l;return(l=this.configApi.getOptionalString("techdocs.storageUrl"))!==null&&l!==void 0?l:`${await this.discoveryApi.getBaseUrl("techdocs")}/static/docs`}async getBuilder(){return this.configApi.getString("techdocs.builder")}async getEntityDocs(l,I){const{kind:ne,namespace:J,name:Q}=l,X=`${await this.getStorageUrl()}/${J}/${ne}/${Q}/${I}`,_=await this.fetchApi.fetch(`${X.endsWith("/")?X:`${X}/`}index.html`);let he="";switch(_.status){case 404:throw he="Page not found. ",I||(he+="This could be because there is no index.md file in the root of the docs directory of this repository."),new h.dR(he);case 500:throw he="Could not generate documentation or an error in the TechDocs backend. ",new Error(he);default:break}return _.text()}async syncEntityDocs(l,I=()=>{}){const{kind:ne,namespace:J,name:Q}=l,X=`${await this.getApiOrigin()}/sync/${J}/${ne}/${Q}`,{token:_}=await this.identityApi.getCredentials();return new Promise((he,ie)=>{const E=new n.EventSourcePolyfill(X,{withCredentials:!0,headers:_?{Authorization:`Bearer ${_}`}:{}});E.addEventListener("log",L=>{L.data&&I(JSON.parse(L.data))}),E.addEventListener("finish",L=>{let $=!1;L.data&&({updated:$}=JSON.parse(L.data)),he($?"updated":"cached")}),E.onerror=L=>{switch(E.close(),L.status){case 404:ie(new h.dR(L.message));return;default:ie(new Error(L.data));return}}})}async getBaseUrl(l,I,ne){const{kind:J,namespace:Q,name:D}=I,_=`${await this.getApiOrigin()}/static/docs/${Q}/${J}/${D}/${ne}`;return new URL(l,_.endsWith("/")?_:`${_}/`).toString()}constructor(l){this.configApi=l.configApi,this.discoveryApi=l.discoveryApi,this.identityApi=l.identityApi,this.fetchApi=l.fetchApi}}},51953:function(jt,Fe,t){"use strict";t.d(Fe,{D:function(){return h}});function h(n,g){return g.getOptionalBoolean("techdocs.legacyUseCaseSensitiveTripletPaths")?n:n.toLocaleLowerCase("en-US")}},3482:function(jt,Fe,t){"use strict";t.d(Fe,{u:function(){return I}});var h=t(52322),n=t(2784),g=t(93414),R=t(43297),V=t(42081),x=t(48431),l=t(68435);const I=ne=>{const{initialFilter:J="owned",columns:Q,actions:D}=ne;return(0,h.jsx)(V.j,{children:(0,h.jsxs)(g.VY,{children:[(0,h.jsx)(g.yW,{title:"",children:(0,h.jsx)(g.qt,{children:"Discover documentation in your ecosystem."})}),(0,h.jsx)(R.UO,{children:(0,h.jsxs)(R._i,{children:[(0,h.jsxs)(R._i.Filters,{children:[(0,h.jsx)(x.f,{}),(0,h.jsx)(R.EW,{initialFilter:J}),(0,h.jsx)(R.dq,{}),(0,h.jsx)(R.xE,{})]}),(0,h.jsx)(R._i.Content,{children:(0,h.jsx)(l.n,{actions:D,columns:Q})})]})})]})})}},85478:function(jt,Fe,t){"use strict";t.d(Fe,{f:function(){return Q}});var h=t(52322),n=t(95573),g=t(51953),R=t(25248),V=t(93414),x=t(94339),l=t(16111),I=t(24579),ne=t(14503),J=t(2784);const Q=ie=>{const{entities:E}=ie,L=(0,R.tg)(n.Fw),$=(0,R.h_)(R.Ds);if(!E)return null;var A,T;return(0,h.jsx)(V.Oh,{"data-testid":"docs-explore",children:E!=null&&E.length?E.map((ee,Ie)=>(0,h.jsxs)(x.Z,{children:[(0,h.jsx)(l.Z,{children:(0,h.jsx)(V.hu,{title:(A=ee.metadata.title)!==null&&A!==void 0?A:ee.metadata.name})}),(0,h.jsx)(I.Z,{children:ee.metadata.description}),(0,h.jsx)(ne.Z,{children:(0,h.jsx)(V.zx,{to:L({namespace:(0,g.D)((T=ee.metadata.namespace)!==null&&T!==void 0?T:"default",$),kind:(0,g.D)(ee.kind,$),name:(0,g.D)(ee.metadata.name,$)}),color:"primary","data-testid":"read_docs",children:"Read Docs"})})]},Ie)):null})};var D=t(43297);const X={title:"All Documentation",filterPredicate:()=>!0},_=({entities:ie,group:E})=>{const{loading:L,isOwnedEntity:$}=useEntityOwnership(),A=ie.filter(ee=>E.filterPredicate==="ownedByUser"?L?!1:$(ee):typeof E.filterPredicate=="function"&&E.filterPredicate(ee)),T=(()=>typeof E.title=="string"?_jsx(ContentHeader,{title:E.title}):E.title)();return A.length===0?null:_jsxs(Content,{children:[T,_jsx(DocsCardGrid,{entities:A})]})},he=({groups:ie})=>{const{loading:E,error:L,entities:$}=useEntityList();if(L)return _jsx(WarningPanel,{severity:"error",title:"Could not load available documentation.",children:_jsx(CodeSnippet,{language:"text",text:L.toString()})});if(E)return _jsx(Progress,{});if($.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,T;return $.sort((ee,Ie)=>((A=ee.metadata.title)!==null&&A!==void 0?A:ee.metadata.name).localeCompare((T=Ie.metadata.title)!==null&&T!==void 0?T:Ie.metadata.name)),_jsx(Content,{children:(ie||[X]).map((ee,Ie)=>_jsx(_,{entities:$,group:ee},`${ee.title}-${Ie}`))})}},68435:function(jt,Fe,t){"use strict";t.d(Fe,{H:function(){return $},n:function(){return A}});var h=t(52322),n=t(2784),g=t(95074),R=t(76635),V=t(93414),x=t(43297),l=t(25248),I=t(25271),ne=t(95573),J=t(39981),Q=t(2337),D=t(11640),X=t(28347);const _=(0,Q.Z)({root:{color:"#f3ba37"}})(D.Z),he={createCopyDocsUrlAction(T){return ee=>({icon:()=>(0,h.jsx)(J.Z,{fontSize:"small"}),tooltip:"Click to copy documentation link to clipboard",onClick:()=>T(`${window.location.origin}${ee.resolved.docsUrl}`)})},createStarEntityAction(T,ee){return({entity:Ie})=>{const Je=T(Ie);return{cellStyle:{paddingLeft:"1em"},icon:()=>Je?(0,h.jsx)(_,{}):(0,h.jsx)(X.Z,{}),tooltip:Je?"Remove from favorites":"Add to favorites",onClick:()=>ee(Ie)}}}};function ie(T){return T.metadata.title||T.metadata.name}const E={createNameColumn(){return{title:"Document",field:"entity.metadata.name",highlight:!0,render:T=>(0,h.jsx)(V.uw,{value:(0,h.jsx)(V.rU,{to:T.resolved.docsUrl,children:ie(T.entity)}),subvalue:T.entity.metadata.description})}},createOwnerColumn(){return{title:"Owner",field:"resolved.ownedByRelationsTitle",render:({resolved:T})=>(0,h.jsx)(x.rI,{entityRefs:T.ownedByRelations,defaultKind:"group"})}},createTypeColumn(){return{title:"Type",field:"entity.spec.type"}}};var L=t(51953);const $=T=>{const{entities:ee,title:Ie,loading:Je,columns:Ze,actions:je}=T,[,We]=(0,g.Z)(),gt=(0,l.tg)(ne.Fw),nt=(0,l.h_)(l.Ds);if(!ee)return null;const Me=ee.map(rt=>{const ct=(0,x.hF)(rt,I.S4);var lt;return{entity:rt,resolved:{docsUrl:gt({namespace:(0,L.D)((lt=rt.metadata.namespace)!==null&&lt!==void 0?lt:"default",nt),kind:(0,L.D)(rt.kind,nt),name:(0,L.D)(rt.metadata.name,nt)}),ownedByRelations:ct,ownedByRelationsTitle:ct.map(mt=>(0,x.$3)(mt,{defaultKind:"group"})).join(", ")}}}),ze=[E.createNameColumn(),E.createOwnerColumn(),E.createTypeColumn()],Qe=[he.createCopyDocsUrlAction(We)];return(0,h.jsx)(h.Fragment,{children:Je||Me&&Me.length>0?(0,h.jsx)(V.iA,{isLoading:Je,options:{paging:!0,pageSize:20,search:!0,actionsColumnIndex:-1},data:Me,columns:Ze||ze,actions:je||Qe,title:Ie?`${Ie} (${Me.length})`:`All (${Me.length})`}):(0,h.jsx)(V.ub,{missing:"data",title:"No documents to show",description:"Create your own document. Check out our Getting Started Information",action:(0,h.jsx)(V.zx,{color:"primary",to:"https://backstage.io/docs/features/techdocs/getting-started",variant:"contained",children:"DOCS"})})})};$.columns=E,$.actions=he;const A=T=>{var ee;const{columns:Ie,actions:Je}=T,{loading:Ze,error:je,entities:We,filters:gt}=(0,x.wp)(),{isStarredEntity:nt,toggleStarredEntity:Me}=(0,x.CR)(),[,ze]=(0,g.Z)();var Qe;const rt=(0,R.capitalize)((Qe=(ee=gt.user)===null||ee===void 0?void 0:ee.value)!==null&&Qe!==void 0?Qe:"all"),ct=[he.createCopyDocsUrlAction(ze),he.createStarEntityAction(nt,Me)];return je?(0,h.jsx)(V.GB,{severity:"error",title:"Could not load available documentation.",children:(0,h.jsx)(V.Oi,{language:"text",text:je.toString()})}):(0,h.jsx)($,{title:rt,entities:We,loading:Ze,actions:Je||ct,columns:Ie})};A.columns=E,A.actions=he},18662:function(jt,Fe,t){"use strict";t.r(Fe),t.d(Fe,{TechDocsIndexPage:function(){return V}});var h=t(52322),n=t(2784),g=t(10289),R=t(3482);const V=x=>(0,g.pC)()||(0,h.jsx)(R.u,{...x})},42081:function(jt,Fe,t){"use strict";t.d(Fe,{j:function(){return V}});var h=t(52322),n=t(2784),g=t(93414),R=t(25248);const V=x=>{const{children:l}=x,I=(0,R.h_)(R.Ds);var ne;const J=`Documentation available in ${(ne=I.getOptionalString("organization.name"))!==null&&ne!==void 0?ne:"Backstage"}`;return(0,h.jsx)(g.g9,{title:"Documentation",subtitle:J,themeId:"documentation",children:l})}},48431:function(jt,Fe,t){"use strict";t.d(Fe,{f:function(){return R}});var h=t(2784),n=t(43297);class g{getCatalogFilters(){return{"metadata.annotations.backstage.io/techdocs-ref":n.n3}}}const R=()=>{const{updateFilters:V}=(0,n.wp)();return(0,h.useEffect)(()=>{V({techdocs:new g})},[V]),null}},89258:function(jt,Fe,t){"use strict";t.d(Fe,{I6:function(){return J},Jl:function(){return ne},s4:function(){return V}});var h=t(61886),n=t(92077),g=t(95573),R=t(25248);const V=(0,R.rx)({id:"techdocs",apis:[(0,R.ni)({api:h.Dl,deps:{configApi:R.Ds,discoveryApi:R.NW,identityApi:R.$4,fetchApi:R.gP},factory:({configApi:Q,discoveryApi:D,identityApi:X,fetchApi:_})=>new n.k({configApi:Q,discoveryApi:D,identityApi:X,fetchApi:_})}),(0,R.ni)({api:h.gT,deps:{configApi:R.Ds,discoveryApi:R.NW,fetchApi:R.gP},factory:({configApi:Q,discoveryApi:D,fetchApi:X})=>new n.p({configApi:Q,discoveryApi:D,fetchApi:X})})],routes:{root:g._Z,docRoot:g.Fw,entityContent:g.pd}}),x=V.provide((0,R.P4)({name:"TechdocsPage",component:()=>Promise.resolve().then(t.bind(t,52943)).then(Q=>Q.Router),mountPoint:g._Z})),l=V.provide((0,R.P4)({name:"EntityTechdocsContent",component:()=>Promise.resolve().then(t.bind(t,52943)).then(Q=>Q.EmbeddedDocsRouter),mountPoint:g.pd})),I=V.provide((0,R.P4)({name:"TechDocsCustomHome",component:()=>t.e(7560).then(t.bind(t,27560)).then(Q=>Q.TechDocsCustomHome),mountPoint:g._Z})),ne=V.provide((0,R.P4)({name:"TechDocsIndexPage",component:()=>Promise.resolve().then(t.bind(t,18662)).then(Q=>Q.TechDocsIndexPage),mountPoint:g._Z})),J=V.provide((0,R.P4)({name:"TechDocsReaderPage",component:()=>Promise.resolve().then(t.bind(t,7476)).then(Q=>Q.TechDocsReaderPage),mountPoint:g.Fw}))},7476:function(jt,Fe,t){"use strict";t.r(Fe),t.d(Fe,{TechDocsReaderLayout:function(){return Q},TechDocsReaderPage:function(){return D}});var h=t(52322),n=t(2784),g=t(10289),R=t(93414),V=t(61886),x=t(67896),l=t(93225),I=t(65124),ne=t(95573),J=t(25248);const Q=({withSearch:X,withHeader:_=!0})=>(0,h.jsxs)(R.T3,{themeId:"documentation",children:[_&&(0,h.jsx)(l.S,{}),(0,h.jsx)(I.b,{}),(0,h.jsx)(x.F,{withSearch:X})]}),D=X=>{const{kind:_,name:he,namespace:ie}=(0,J.Oi)(ne.Fw),{children:E,entityRef:L={kind:_,name:he,namespace:ie}}=X,$=(0,g.pC)();if(!E){const T=$?n.Children.toArray($.props.children):[];var A;const Ie=T.flatMap(Je=>{var Ze;return(A=Je==null||(Ze=Je.props)===null||Ze===void 0?void 0:Ze.children)!==null&&A!==void 0?A:[]}).find(Je=>!(0,J.IY)(Je,V.Zz));return(0,h.jsx)(V.ZS,{entityRef:L,children:Ie||(0,h.jsx)(Q,{})})}return(0,h.jsx)(V.ZS,{entityRef:L,children:({metadata:T,entityMetadata:ee,onReady:Ie})=>(0,h.jsx)("div",{className:"techdocs-reader-page",children:(0,h.jsx)(R.T3,{themeId:"documentation",children:E instanceof Function?E({entityRef:L,techdocsMetadataValue:T.value,entityMetadataValue:ee.value,onReady:Ie}):E})})})}},67896:function(jt,Fe,t){"use strict";t.d(Fe,{F:function(){return He}});var h=t(52322),n=t(2784),g=t(79692),R=t(60905),V=t(61886),x=t(93414),l=t(17339),I=t(4614),ne=t(77277),J=t(99688),Q=t(12420),D=t(90436),X=t(61837),_=t(4190),he=t(87685);const ie=(0,g.Z)(S=>(0,Q.Z)({paper:{width:"100%",[S.breakpoints.up("sm")]:{width:"75%"},[S.breakpoints.up("md")]:{width:"50%"},padding:S.spacing(2.5)},root:{height:"100%",overflow:"hidden"},logs:{background:S.palette.background.default}})),E=({buildLog:S,onClose:H})=>{const me=ie(),ue=S.length===0?"Waiting for logs...":S.join(`
34
- `);return(0,h.jsxs)(R.Z,{container:!0,direction:"column",className:me.root,spacing:0,wrap:"nowrap",children:[(0,h.jsxs)(R.Z,{item:!0,container:!0,justifyContent:"space-between",alignItems:"center",spacing:0,wrap:"nowrap",children:[(0,h.jsx)(D.Z,{variant:"h5",children:"Build Details"}),(0,h.jsx)(X.Z,{title:"Close the drawer",onClick:H,color:"inherit",children:(0,h.jsx)(he.Z,{})},"dismiss")]}),(0,h.jsx)(x.nU,{text:ue,classes:{root:me.logs}})]})},L=({buildLog:S})=>{const H=ie(),[me,ue]=(0,n.useState)(!1);return(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(ne.Z,{color:"inherit",onClick:()=>ue(!0),children:"Show Build Logs"}),(0,h.jsx)(_.ZP,{classes:{paper:H.paper},anchor:"right",open:me,onClose:()=>ue(!1),children:(0,h.jsx)(E,{buildLog:S,onClose:()=>ue(!1)})})]})};var $=t(25248);const A=({errorMessage:S})=>{const H=(0,$.h_)($.Ds).getOptionalString("techdocs.builder");let me="";return H!=="local"&&(me="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)(x.mf,{status:"404",statusMessage:S||"Documentation not found",additionalInfo:me})};var T=t(95481);const ee=(0,g.Z)(S=>({root:{marginBottom:S.spacing(2)},message:{wordBreak:"break-word",overflowWrap:"anywhere"}})),Ie=()=>{let S=null;const H=ee(),{state:me,contentReload:ue,contentErrorMessage:Ce,syncErrorMessage:ke,buildLog:Ne}=(0,T.DK)();return me==="INITIAL_BUILD"&&(S=(0,h.jsx)(J.Z,{classes:{root:H.root},variant:"outlined",severity:"info",icon:(0,h.jsx)(I.Z,{size:"24px"}),action:(0,h.jsx)(L,{buildLog:Ne}),children:"Documentation is accessed for the first time and is being prepared. The subsequent loads are much faster."})),me==="CONTENT_STALE_REFRESHING"&&(S=(0,h.jsx)(J.Z,{variant:"outlined",severity:"info",icon:(0,h.jsx)(I.Z,{size:"24px"}),action:(0,h.jsx)(L,{buildLog:Ne}),classes:{root:H.root},children:"A newer version of this documentation is being prepared and will be available shortly."})),me==="CONTENT_STALE_READY"&&(S=(0,h.jsx)(J.Z,{variant:"outlined",severity:"success",action:(0,h.jsx)(ne.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."})),me==="CONTENT_STALE_ERROR"&&(S=(0,h.jsxs)(J.Z,{variant:"outlined",severity:"error",action:(0,h.jsx)(L,{buildLog:Ne}),classes:{root:H.root,message:H.message},children:["Building a newer version of this documentation failed."," ",ke]})),me==="CONTENT_NOT_FOUND"&&(S=(0,h.jsxs)(h.Fragment,{children:[ke&&(0,h.jsxs)(J.Z,{variant:"outlined",severity:"error",action:(0,h.jsx)(L,{buildLog:Ne}),classes:{root:H.root,message:H.message},children:["Building a newer version of this documentation failed."," ",ke]}),(0,h.jsx)(A,{errorMessage:Ce})]})),S};var Je=t(10289),Ze=t(60364),je=t(41156),We=t(32838),gt=t(35368),nt=t.n(gt);const Me=/main\.[A-Fa-f0-9]{8}\.min\.css$/,ze=/^https:\/\/fonts\.googleapis\.com/,Qe=/^https:\/\/fonts\.gstatic\.com/,rt=S=>S.nodeName==="LINK",ct=S=>{const H=(S==null?void 0:S.getAttribute("href"))||"",me=H.match(Me),ue=H.match(ze),Ce=H.match(Qe);return me||ue||Ce},lt=S=>(rt(S)&&!ct(S)&&S.remove(),S),mt=S=>S.nodeName==="IFRAME",vt=(S,H)=>{const me=S.getAttribute("src")||"";try{const{host:ue}=new URL(me);return H.includes(ue)}catch{return!1}},Ge=S=>H=>(mt(H)&&!vt(H,S)&&H.remove(),H),re=()=>{const S=(0,$.h_)($.Ds);return(0,n.useMemo)(()=>S.getOptionalConfig("techdocs.sanitizer"),[S])},Re=()=>{const S=re();return(0,n.useCallback)(async H=>{const me=S==null?void 0:S.getOptionalStringArray("allowedIframeHosts");nt().addHook("beforeSanitizeElements",lt);const ue=["link"];return me&&(ue.push("iframe"),nt().addHook("beforeSanitizeElements",Ge(me))),nt().sanitize(H.innerHTML,{ADD_TAGS:ue,FORBID_TAGS:["style"],WHOLE_DOCUMENT:!0,RETURN_DOM:!0})},[S])};var Pe=t(41128),it=({theme:S})=>`
35
- /*================== Variables ==================*/
36
- /*
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.
38
- As there is no way to transform the served main*.css yet (for example in the backend), we have to copy from main*.css and modify them.
39
- */
40
-
41
- :host {
42
- /* FONT */
43
- --md-default-fg-color: ${S.palette.text.primary};
44
- --md-default-fg-color--light: ${S.palette.text.secondary};
45
- --md-default-fg-color--lighter: ${(0,Pe.$n)(S.palette.text.secondary,.7)};
46
- --md-default-fg-color--lightest: ${(0,Pe.$n)(S.palette.text.secondary,.3)};
47
-
48
- /* BACKGROUND */
49
- --md-default-bg-color:${S.palette.background.default};
50
- --md-default-bg-color--light: ${S.palette.background.paper};
51
- --md-default-bg-color--lighter: ${(0,Pe.$n)(S.palette.background.paper,.7)};
52
- --md-default-bg-color--lightest: ${(0,Pe.$n)(S.palette.background.paper,.3)};
53
-
54
- /* PRIMARY */
55
- --md-primary-fg-color: ${S.palette.primary.main};
56
- --md-primary-fg-color--light: ${S.palette.primary.light};
57
- --md-primary-fg-color--dark: ${S.palette.primary.dark};
58
- --md-primary-bg-color: ${S.palette.primary.contrastText};
59
- --md-primary-bg-color--light: ${(0,Pe.$n)(S.palette.primary.contrastText,.7)};
60
-
61
- /* ACCENT */
62
- --md-accent-fg-color: var(--md-primary-fg-color);
63
-
64
- /* SHADOW */
65
- --md-shadow-z1: ${S.shadows[1]};
66
- --md-shadow-z2: ${S.shadows[2]};
67
- --md-shadow-z3: ${S.shadows[3]};
68
-
69
- /* EXTENSIONS */
70
- --md-admonition-fg-color: var(--md-default-fg-color);
71
- --md-admonition-bg-color: var(--md-default-bg-color);
72
- /* Admonitions and others are using SVG masks to define icons. These masks are defined as CSS variables. */
73
- --md-admonition-icon--note: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M20.71 7.04c.39-.39.39-1.04 0-1.41l-2.34-2.34c-.37-.39-1.02-.39-1.41 0l-1.84 1.83 3.75 3.75M3 17.25V21h3.75L17.81 9.93l-3.75-3.75L3 17.25z"/></svg>');
74
- --md-admonition-icon--abstract: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M4 5h16v2H4V5m0 4h16v2H4V9m0 4h16v2H4v-2m0 4h10v2H4v-2z"/></svg>');
75
- --md-admonition-icon--info: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M13 9h-2V7h2m0 10h-2v-6h2m-1-9A10 10 0 002 12a10 10 0 0010 10 10 10 0 0010-10A10 10 0 0012 2z"/></svg>');
76
- --md-admonition-icon--tip: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M17.55 11.2c-.23-.3-.5-.56-.76-.82-.65-.6-1.4-1.03-2.03-1.66C13.3 7.26 13 4.85 13.91 3c-.91.23-1.75.75-2.45 1.32-2.54 2.08-3.54 5.75-2.34 8.9.04.1.08.2.08.33 0 .22-.15.42-.35.5-.22.1-.46.04-.64-.12a.83.83 0 01-.15-.17c-1.1-1.43-1.28-3.48-.53-5.12C5.89 10 5 12.3 5.14 14.47c.04.5.1 1 .27 1.5.14.6.4 1.2.72 1.73 1.04 1.73 2.87 2.97 4.84 3.22 2.1.27 4.35-.12 5.96-1.6 1.8-1.66 2.45-4.32 1.5-6.6l-.13-.26c-.2-.46-.47-.87-.8-1.25l.05-.01m-3.1 6.3c-.28.24-.73.5-1.08.6-1.1.4-2.2-.16-2.87-.82 1.19-.28 1.89-1.16 2.09-2.05.17-.8-.14-1.46-.27-2.23-.12-.74-.1-1.37.18-2.06.17.38.37.76.6 1.06.76 1 1.95 1.44 2.2 2.8.04.14.06.28.06.43.03.82-.32 1.72-.92 2.27h.01z"/></svg>');
77
- --md-admonition-icon--success: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M12 2C6.5 2 2 6.5 2 12s4.5 10 10 10 10-4.5 10-10S17.5 2 12 2m-2 15l-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8l-9 9z"/></svg>');
78
- --md-admonition-icon--question: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M15.07 11.25l-.9.92C13.45 12.89 13 13.5 13 15h-2v-.5c0-1.11.45-2.11 1.17-2.83l1.24-1.26c.37-.36.59-.86.59-1.41a2 2 0 00-2-2 2 2 0 00-2 2H8a4 4 0 014-4 4 4 0 014 4 3.2 3.2 0 01-.93 2.25M13 19h-2v-2h2M12 2A10 10 0 002 12a10 10 0 0010 10 10 10 0 0010-10c0-5.53-4.5-10-10-10z"/></svg>');
79
- --md-admonition-icon--warning: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M13 14h-2v-4h2m0 8h-2v-2h2M1 21h22L12 2 1 21z"/></svg>');
80
- --md-admonition-icon--failure: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M12 2c5.53 0 10 4.47 10 10s-4.47 10-10 10S2 17.53 2 12 6.47 2 12 2m3.59 5L12 10.59 8.41 7 7 8.41 10.59 12 7 15.59 8.41 17 12 13.41 15.59 17 17 15.59 13.41 12 17 8.41 15.59 7z"/></svg>');
81
- --md-admonition-icon--danger: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M11.5 20l4.86-9.73H13V4l-5 9.73h3.5V20M12 2c2.75 0 5.1 1 7.05 2.95C21 6.9 22 9.25 22 12s-1 5.1-2.95 7.05C17.1 21 14.75 22 12 22s-5.1-1-7.05-2.95C3 17.1 2 14.75 2 12s1-5.1 2.95-7.05C6.9 3 9.25 2 12 2z"/></svg>');
82
- --md-admonition-icon--bug: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M14 12h-4v-2h4m0 6h-4v-2h4m6-6h-2.81a5.985 5.985 0 00-1.82-1.96L17 4.41 15.59 3l-2.17 2.17a6.002 6.002 0 00-2.83 0L8.41 3 7 4.41l1.62 1.63C7.88 6.55 7.26 7.22 6.81 8H4v2h2.09c-.05.33-.09.66-.09 1v1H4v2h2v1c0 .34.04.67.09 1H4v2h2.81c1.04 1.79 2.97 3 5.19 3s4.15-1.21 5.19-3H20v-2h-2.09c.05-.33.09-.66.09-1v-1h2v-2h-2v-1c0-.34-.04-.67-.09-1H20V8z"/></svg>');
83
- --md-admonition-icon--example: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M7 13v-2h14v2H7m0 6v-2h14v2H7M7 7V5h14v2H7M3 8V5H2V4h2v4H3m-1 9v-1h3v4H2v-1h2v-.5H3v-1h1V17H2m2.25-7a.75.75 0 01.75.75c0 .2-.08.39-.21.52L3.12 13H5v1H2v-.92L4 11H2v-1h2.25z"/></svg>');
84
- --md-admonition-icon--quote: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M14 17h3l2-4V7h-6v6h3M6 17h3l2-4V7H5v6h3l-2 4z"/></svg>');
85
- --md-footnotes-icon: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M19 7v4H5.83l3.58-3.59L8 6l-6 6 6 6 1.41-1.42L5.83 13H21V7h-2z"/></svg>');
86
- --md-details-icon: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M8.59 16.58 13.17 12 8.59 7.41 10 6l6 6-6 6-1.41-1.42z"/></svg>');
87
- --md-tasklist-icon: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M0 0h24v24H0z" fill="none"/><path d="M19 5v14H5V5h14m0-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2z"/></svg>');
88
- --md-tasklist-icon--checked: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M0 0h24v24H0z" fill="none"/><path d="M19 3H5c-1.11 0-2 .9-2 2v14c0 1.1.89 2 2 2h14c1.11 0 2-.9 2-2V5c0-1.1-.89-2-2-2zm-9 14l-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8l-9 9z"/></svg>');
89
- --md-nav-icon--prev: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M20 11v2H8l5.5 5.5-1.42 1.42L4.16 12l7.92-7.92L13.5 5.5 8 11h12z"/></svg>');
90
- --md-nav-icon--next: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M8.59 16.58 13.17 12 8.59 7.41 10 6l6 6-6 6-1.41-1.42z"/></svg>');
91
- --md-toc-icon: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M3 9h14V7H3v2m0 4h14v-2H3v2m0 4h14v-2H3v2m16 0h2v-2h-2v2m0-10v2h2V7h-2m0 6h2v-2h-2v2z"/></svg>');
92
- --md-clipboard-icon: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M19 21H8V7h11m0-2H8a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h11a2 2 0 0 0 2-2V7a2 2 0 0 0-2-2m-3-4H4a2 2 0 0 0-2 2v14h2V3h12V1z"/></svg>');
93
- --md-search-result-icon: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h7c-.41-.25-.8-.56-1.14-.9-.33-.33-.61-.7-.86-1.1H6V4h7v5h5v1.18c.71.16 1.39.43 2 .82V8l-6-6m6.31 16.9c1.33-2.11.69-4.9-1.4-6.22-2.11-1.33-4.91-.68-6.22 1.4-1.34 2.11-.69 4.89 1.4 6.22 1.46.93 3.32.93 4.79.02L22 23.39 23.39 22l-3.08-3.1m-3.81.1a2.5 2.5 0 0 1-2.5-2.5 2.5 2.5 0 0 1 2.5-2.5 2.5 2.5 0 0 1 2.5 2.5 2.5 2.5 0 0 1-2.5 2.5z"/></svg>');
94
- --md-source-forks-icon: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><path fill-rule="evenodd" d="M5 3.25a.75.75 0 1 1-1.5 0 .75.75 0 0 1 1.5 0zm0 2.122a2.25 2.25 0 1 0-1.5 0v.878A2.25 2.25 0 0 0 5.75 8.5h1.5v2.128a2.251 2.251 0 1 0 1.5 0V8.5h1.5a2.25 2.25 0 0 0 2.25-2.25v-.878a2.25 2.25 0 1 0-1.5 0v.878a.75.75 0 0 1-.75.75h-4.5A.75.75 0 0 1 5 6.25v-.878zm3.75 7.378a.75.75 0 1 1-1.5 0 .75.75 0 0 1 1.5 0zm3-8.75a.75.75 0 1 0 0-1.5.75.75 0 0 0 0 1.5z"/></svg>');
95
- --md-source-repositories-icon: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><path fill-rule="evenodd" d="M2 2.5A2.5 2.5 0 0 1 4.5 0h8.75a.75.75 0 0 1 .75.75v12.5a.75.75 0 0 1-.75.75h-2.5a.75.75 0 1 1 0-1.5h1.75v-2h-8a1 1 0 0 0-.714 1.7.75.75 0 0 1-1.072 1.05A2.495 2.495 0 0 1 2 11.5v-9zm10.5-1V9h-8c-.356 0-.694.074-1 .208V2.5a1 1 0 0 1 1-1h8zM5 12.25v3.25a.25.25 0 0 0 .4.2l1.45-1.087a.25.25 0 0 1 .3 0L8.6 15.7a.25.25 0 0 0 .4-.2v-3.25a.25.25 0 0 0-.25-.25h-3.5a.25.25 0 0 0-.25.25z"/></svg>');
96
- --md-source-stars-icon: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><path fill-rule="evenodd" d="M8 .25a.75.75 0 0 1 .673.418l1.882 3.815 4.21.612a.75.75 0 0 1 .416 1.279l-3.046 2.97.719 4.192a.75.75 0 0 1-1.088.791L8 12.347l-3.766 1.98a.75.75 0 0 1-1.088-.79l.72-4.194L.818 6.374a.75.75 0 0 1 .416-1.28l4.21-.611L7.327.668A.75.75 0 0 1 8 .25zm0 2.445L6.615 5.5a.75.75 0 0 1-.564.41l-3.097.45 2.24 2.184a.75.75 0 0 1 .216.664l-.528 3.084 2.769-1.456a.75.75 0 0 1 .698 0l2.77 1.456-.53-3.084a.75.75 0 0 1 .216-.664l2.24-2.183-3.096-.45a.75.75 0 0 1-.564-.41L8 2.694v.001z"/></svg>');
97
- --md-source-version-icon: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><path fill-rule="evenodd" d="M2.5 7.775V2.75a.25.25 0 0 1 .25-.25h5.025a.25.25 0 0 1 .177.073l6.25 6.25a.25.25 0 0 1 0 .354l-5.025 5.025a.25.25 0 0 1-.354 0l-6.25-6.25a.25.25 0 0 1-.073-.177zm-1.5 0V2.75C1 1.784 1.784 1 2.75 1h5.025c.464 0 .91.184 1.238.513l6.25 6.25a1.75 1.75 0 0 1 0 2.474l-5.026 5.026a1.75 1.75 0 0 1-2.474 0l-6.25-6.25A1.75 1.75 0 0 1 1 7.775zM6 5a1 1 0 1 0 0 2 1 1 0 0 0 0-2z"/></svg>');
98
- --md-version-icon: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 320 512"><!--! Font Awesome Free 6.0.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) Copyright 2022 Fonticons, Inc.--><path d="m310.6 246.6-127.1 128c-7.1 6.3-15.3 9.4-23.5 9.4s-16.38-3.125-22.63-9.375l-127.1-128C.224 237.5-2.516 223.7 2.438 211.8S19.07 192 32 192h255.1c12.94 0 24.62 7.781 29.58 19.75s3.12 25.75-6.08 34.85z"/></svg>');
99
- }
100
-
101
- :host > * {
102
- /* CODE */
103
- --md-code-fg-color: ${S.palette.text.primary};
104
- --md-code-bg-color: ${S.palette.background.paper};
105
- --md-code-hl-color: ${(0,Pe.Fq)(S.palette.warning.main,.5)};
106
- --md-code-hl-keyword-color: ${S.palette.type==="dark"?S.palette.primary.light:S.palette.primary.dark};
107
- --md-code-hl-function-color: ${S.palette.type==="dark"?S.palette.secondary.light:S.palette.secondary.dark};
108
- --md-code-hl-string-color: ${S.palette.type==="dark"?S.palette.success.light:S.palette.success.dark};
109
- --md-code-hl-number-color: ${S.palette.type==="dark"?S.palette.error.light:S.palette.error.dark};
110
- --md-code-hl-constant-color: var(--md-code-hl-function-color);
111
- --md-code-hl-special-color: var(--md-code-hl-function-color);
112
- --md-code-hl-name-color: var(--md-code-fg-color);
113
- --md-code-hl-comment-color: var(--md-default-fg-color--light);
114
- --md-code-hl-generic-color: var(--md-default-fg-color--light);
115
- --md-code-hl-variable-color: var(--md-default-fg-color--light);
116
- --md-code-hl-operator-color: var(--md-default-fg-color--light);
117
- --md-code-hl-punctuation-color: var(--md-default-fg-color--light);
118
-
119
- /* TYPESET */
120
- --md-typeset-font-size: 1rem;
121
- --md-typeset-color: var(--md-default-fg-color);
122
- --md-typeset-a-color: var(--md-accent-fg-color);
123
- --md-typeset-table-color: ${S.palette.text.primary};
124
- --md-typeset-del-color: ${S.palette.type==="dark"?(0,Pe.Fq)(S.palette.error.dark,.5):(0,Pe.Fq)(S.palette.error.light,.5)};
125
- --md-typeset-ins-color: ${S.palette.type==="dark"?(0,Pe.Fq)(S.palette.success.dark,.5):(0,Pe.Fq)(S.palette.success.light,.5)};
126
- --md-typeset-mark-color: ${S.palette.type==="dark"?(0,Pe.Fq)(S.palette.warning.dark,.5):(0,Pe.Fq)(S.palette.warning.light,.5)};
127
- }
128
-
129
- @media screen and (max-width: 76.1875em) {
130
- :host > * {
131
- /* TYPESET */
132
- --md-typeset-font-size: .9rem;
133
- }
134
- }
135
-
136
- @media screen and (max-width: 600px) {
137
- :host > * {
138
- /* TYPESET */
139
- --md-typeset-font-size: .7rem;
140
- }
141
- }
142
- `,yt=({theme:S})=>`
143
- /*================== Reset ==================*/
144
-
145
- body {
146
- --md-text-color: var(--md-default-fg-color);
147
- --md-text-link-color: var(--md-accent-fg-color);
148
- --md-text-font-family: ${S.typography.fontFamily};
149
- font-family: var(--md-text-font-family);
150
- background-color: unset;
151
- }
152
- `;const At="224px";var pt=({theme:S,sidebar:H})=>`
153
- /*================== Layout ==================*/
154
-
155
- .md-grid {
156
- max-width: 100%;
157
- margin: 0;
158
- }
159
-
160
- .md-nav {
161
- font-size: calc(var(--md-typeset-font-size) * 0.9);
162
- }
163
- .md-nav__link {
164
- display: flex;
165
- align-items: center;
166
- justify-content: space-between;
167
- }
168
- .md-nav__icon {
169
- height: 20px !important;
170
- width: 20px !important;
171
- margin-left:${S.spacing(1)}px;
172
- }
173
- .md-nav__icon svg {
174
- margin: 0;
175
- width: 20px !important;
176
- height: 20px !important;
177
- }
178
- .md-nav__icon:after {
179
- width: 20px !important;
180
- height: 20px !important;
181
- }
182
-
183
- .md-nav__item--active > .md-nav__link, a.md-nav__link--active {
184
- text-decoration: underline;
185
- color: var(--md-typeset-a-color);
186
- }
187
-
188
- .md-main__inner {
189
- margin-top: 0;
190
- }
191
-
192
- .md-sidebar {
193
- bottom: 75px;
194
- position: fixed;
195
- width: 16rem;
196
- overflow-y: auto;
197
- overflow-x: hidden;
198
- scrollbar-color: rgb(193, 193, 193) #eee;
199
- scrollbar-width: thin;
200
- }
201
- .md-sidebar .md-sidebar__scrollwrap {
202
- width: calc(12.1rem);
203
- }
204
- .md-sidebar--secondary {
205
- right: ${S.spacing(3)}px;
206
- }
207
- .md-sidebar::-webkit-scrollbar {
208
- width: 5px;
209
- }
210
- .md-sidebar::-webkit-scrollbar-button {
211
- width: 5px;
212
- height: 5px;
213
- }
214
- .md-sidebar::-webkit-scrollbar-track {
215
- background: #eee;
216
- border: 1 px solid rgb(250, 250, 250);
217
- box-shadow: 0px 0px 3px #dfdfdf inset;
218
- border-radius: 3px;
219
- }
220
- .md-sidebar::-webkit-scrollbar-thumb {
221
- width: 5px;
222
- background: rgb(193, 193, 193);
223
- border: transparent;
224
- border-radius: 3px;
225
- }
226
- .md-sidebar::-webkit-scrollbar-thumb:hover {
227
- background: rgb(125, 125, 125);
228
- }
229
-
230
- .md-content {
231
- max-width: calc(100% - 16rem * 2);
232
- margin-left: 16rem;
233
- margin-bottom: 50px;
234
- }
235
-
236
- .md-footer {
237
- position: fixed;
238
- bottom: 0px;
239
- }
240
- .md-footer__title {
241
- background-color: unset;
242
- }
243
- .md-footer-nav__link {
244
- width: 16rem;
245
- }
246
-
247
- .md-dialog {
248
- background-color: unset;
249
- }
250
-
251
- @media screen and (min-width: 76.25em) {
252
- .md-sidebar {
253
- height: auto;
254
- }
255
- }
256
-
257
- @media screen and (max-width: 76.1875em) {
258
- .md-nav {
259
- transition: none !important;
260
- background-color: var(--md-default-bg-color)
261
- }
262
- .md-nav--primary .md-nav__title {
263
- cursor: auto;
264
- color: var(--md-default-fg-color);
265
- font-weight: 700;
266
- white-space: normal;
267
- line-height: 1rem;
268
- height: auto;
269
- display: flex;
270
- flex-flow: column;
271
- row-gap: 1.6rem;
272
- padding: 1.2rem .8rem .8rem;
273
- background-color: var(--md-default-bg-color);
274
- }
275
- .md-nav--primary .md-nav__title~.md-nav__list {
276
- box-shadow: none;
277
- }
278
- .md-nav--primary .md-nav__title ~ .md-nav__list > :first-child {
279
- border-top: none;
280
- }
281
- .md-nav--primary .md-nav__title .md-nav__button {
282
- display: none;
283
- }
284
- .md-nav--primary .md-nav__title .md-nav__icon {
285
- color: var(--md-default-fg-color);
286
- position: static;
287
- height: auto;
288
- margin: 0 0 0 -0.2rem;
289
- }
290
- .md-nav--primary > .md-nav__title [for="none"] {
291
- padding-top: 0;
292
- }
293
- .md-nav--primary .md-nav__item {
294
- border-top: none;
295
- }
296
- .md-nav--primary :is(.md-nav__title,.md-nav__item) {
297
- font-size : var(--md-typeset-font-size);
298
- }
299
- .md-nav .md-source {
300
- display: none;
301
- }
302
-
303
- .md-sidebar {
304
- height: 100%;
305
- }
306
- .md-sidebar--primary {
307
- width: 12.1rem !important;
308
- z-index: 200;
309
- left: ${H.isPinned?`calc(-12.1rem + ${At})`:"calc(-12.1rem + 72px)"} !important;
310
- }
311
- .md-sidebar--secondary:not([hidden]) {
312
- display: none;
313
- }
314
-
315
- .md-content {
316
- max-width: 100%;
317
- margin-left: 0;
318
- }
319
-
320
- .md-header__button {
321
- margin: 0.4rem 0;
322
- margin-left: 0.4rem;
323
- padding: 0;
324
- }
325
-
326
- .md-overlay {
327
- left: 0;
328
- }
329
-
330
- .md-footer {
331
- position: static;
332
- padding-left: 0;
333
- }
334
- .md-footer-nav__link {
335
- /* footer links begin to overlap at small sizes without setting width */
336
- width: 50%;
337
- }
338
- }
339
-
340
- @media screen and (max-width: 600px) {
341
- .md-sidebar--primary {
342
- left: -12.1rem !important;
343
- width: 12.1rem;
344
- }
345
- }
346
- `;const Ct=["h1","h2","h3","h4","h5","h6"];var Pt=({theme:S})=>`
347
- /*================== Typeset ==================*/
348
-
349
- .md-typeset {
350
- font-size: var(--md-typeset-font-size);
351
- }
352
-
353
- ${Ct.reduce((H,me)=>{var ue;const Ce=(ue=S.typography.htmlFontSize)!==null&&ue!==void 0?ue:16,ke=S.typography[me],{lineHeight:Ne,fontFamily:ot,fontWeight:ht,fontSize:ut}=ke,et=St=>{let at=1;return typeof St=="number"&&(at=St/Ce*.6),typeof St=="string"&&(at=St.replace("rem","")),`calc(${at} * var(--md-typeset-font-size))`};return H.concat(`
354
- .md-typeset ${me} {
355
- color: var(--md-default-fg-color);
356
- line-height: ${Ne};
357
- font-family: ${ot};
358
- font-weight: ${ht};
359
- font-size: ${et(ut)};
360
- }
361
- `)},"")}
362
-
363
- .md-typeset .md-content__button {
364
- color: var(--md-default-fg-color);
365
- }
366
-
367
- .md-typeset hr {
368
- border-bottom: 0.05rem dotted ${S.palette.divider};
369
- }
370
-
371
- .md-typeset details {
372
- font-size: var(--md-typeset-font-size) !important;
373
- }
374
- .md-typeset details summary {
375
- padding-left: 2.5rem !important;
376
- }
377
- .md-typeset details summary:before,
378
- .md-typeset details summary:after {
379
- top: 50% !important;
380
- width: 20px !important;
381
- height: 20px !important;
382
- transform: rotate(0deg) translateY(-50%) !important;
383
- }
384
- .md-typeset details[open] > summary:after {
385
- transform: rotate(90deg) translateX(-50%) !important;
386
- }
387
-
388
- .md-typeset blockquote {
389
- color: var(--md-default-fg-color--light);
390
- border-left: 0.2rem solid var(--md-default-fg-color--light);
391
- }
392
-
393
- .md-typeset table:not([class]) {
394
- font-size: var(--md-typeset-font-size);
395
- border: 1px solid var(--md-default-fg-color);
396
- border-bottom: none;
397
- border-collapse: collapse;
398
- }
399
- .md-typeset table:not([class]) th {
400
- font-weight: bold;
401
- }
402
- .md-typeset table:not([class]) td, .md-typeset table:not([class]) th {
403
- border-bottom: 1px solid var(--md-default-fg-color);
404
- }
405
-
406
- .md-typeset pre > code::-webkit-scrollbar-thumb {
407
- background-color: hsla(0, 0%, 0%, 0.32);
408
- }
409
- .md-typeset pre > code::-webkit-scrollbar-thumb:hover {
410
- background-color: hsla(0, 0%, 0%, 0.87);
411
- }
412
- `,kt=()=>`
413
- /*================== Animations ==================*/
414
- /*
415
- Disable CSS animations on link colors as they lead to issues in dark mode.
416
- The dark mode color theme is applied later and theirfore there is always an animation from light to dark mode when navigation between pages.
417
- */
418
- .md-dialog, .md-nav__link, .md-footer__link, .md-typeset a, .md-typeset a::before, .md-typeset .headerlink {
419
- transition: none;
420
- }
421
- `,en=({theme:S})=>`
422
- /*================== Extensions ==================*/
423
-
424
- /* HIGHLIGHT */
425
- .highlight .md-clipboard:after {
426
- content: unset;
427
- }
428
-
429
- .highlight .nx {
430
- color: ${S.palette.type==="dark"?"#ff53a3":"#ec407a"};
431
- }
432
-
433
- /* CODE HILITE */
434
- .codehilite .gd {
435
- background-color: ${S.palette.type==="dark"?"rgba(248,81,73,0.65)":"#fdd"};
436
- }
437
-
438
- .codehilite .gi {
439
- background-color: ${S.palette.type==="dark"?"rgba(46,160,67,0.65)":"#dfd"};
440
- }
441
-
442
- /* TABBED */
443
- .tabbed-set>input:nth-child(1):checked~.tabbed-labels>:nth-child(1),
444
- .tabbed-set>input:nth-child(2):checked~.tabbed-labels>:nth-child(2),
445
- .tabbed-set>input:nth-child(3):checked~.tabbed-labels>:nth-child(3),
446
- .tabbed-set>input:nth-child(4):checked~.tabbed-labels>:nth-child(4),
447
- .tabbed-set>input:nth-child(5):checked~.tabbed-labels>:nth-child(5),
448
- .tabbed-set>input:nth-child(6):checked~.tabbed-labels>:nth-child(6),
449
- .tabbed-set>input:nth-child(7):checked~.tabbed-labels>:nth-child(7),
450
- .tabbed-set>input:nth-child(8):checked~.tabbed-labels>:nth-child(8),
451
- .tabbed-set>input:nth-child(9):checked~.tabbed-labels>:nth-child(9),
452
- .tabbed-set>input:nth-child(10):checked~.tabbed-labels>:nth-child(10),
453
- .tabbed-set>input:nth-child(11):checked~.tabbed-labels>:nth-child(11),
454
- .tabbed-set>input:nth-child(12):checked~.tabbed-labels>:nth-child(12),
455
- .tabbed-set>input:nth-child(13):checked~.tabbed-labels>:nth-child(13),
456
- .tabbed-set>input:nth-child(14):checked~.tabbed-labels>:nth-child(14),
457
- .tabbed-set>input:nth-child(15):checked~.tabbed-labels>:nth-child(15),
458
- .tabbed-set>input:nth-child(16):checked~.tabbed-labels>:nth-child(16),
459
- .tabbed-set>input:nth-child(17):checked~.tabbed-labels>:nth-child(17),
460
- .tabbed-set>input:nth-child(18):checked~.tabbed-labels>:nth-child(18),
461
- .tabbed-set>input:nth-child(19):checked~.tabbed-labels>:nth-child(19),
462
- .tabbed-set>input:nth-child(20):checked~.tabbed-labels>:nth-child(20) {
463
- color: var(--md-accent-fg-color);
464
- border-color: var(--md-accent-fg-color);
465
- }
466
-
467
- /* TASK-LIST */
468
- .task-list-control .task-list-indicator::before {
469
- background-color: ${S.palette.action.disabledBackground};
470
- }
471
- .task-list-control [type="checkbox"]:checked + .task-list-indicator:before {
472
- background-color: ${S.palette.success.main};
473
- }
474
-
475
- /* ADMONITION */
476
- .admonition {
477
- font-size: var(--md-typeset-font-size) !important;
478
- }
479
- .admonition .admonition-title {
480
- padding-left: 2.5rem !important;
481
- }
482
-
483
- .admonition .admonition-title:before {
484
- top: 50% !important;
485
- width: 20px !important;
486
- height: 20px !important;
487
- transform: translateY(-50%) !important;
488
- }
489
- `;const sn=[it,yt,pt,Pt,kt,en],Ht=()=>(0,x.Pf)(),Gt=()=>{const S=Ht(),H=(0,Ze.Z)();return(0,n.useMemo)(()=>{const me={theme:H,sidebar:S};return sn.reduce((ue,Ce)=>ue+Ce(me),"")},[H,S])},fn=()=>{const S=Gt();return(0,n.useCallback)(H=>(H.getElementsByTagName("head")[0].insertAdjacentHTML("beforeend",`<style>${S}</style>`),H),[S])},_t=(S,H,me)=>{const ue=S==="src"&&H.endsWith(".svg"),Ce=!H.match(/^([a-z]*:)?\/\//i),ke=H.startsWith(me);return ue&&(Ce||ke)},Zn=({techdocsStorageApi:S,entityId:H,path:me})=>async ue=>{const Ce=await S.getApiOrigin(),ke=async(Ne,ot)=>{for(const ht of Ne)if(ht.hasAttribute(ot)){const ut=ht.getAttribute(ot);if(!ut)return;const et=await S.getBaseUrl(ut,H,me);if(_t(ot,ut,Ce))try{const at=await(await fetch(et,{credentials:"include"})).text();ht.setAttribute(ot,`data:image/svg+xml;base64,${btoa(unescape(encodeURIComponent(at)))}`)}catch{ht.setAttribute("alt",`Error: ${ut}`)}else ht.setAttribute(ot,et)}};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 ln=t(79158),Dn=t(67097),gn=t(28316),Jn=t(82717),Kt=t.n(Jn);const In=S=>H=>{var me;const ue=H.querySelector('[title="Edit this page"]');if(!ue||!ue.href)return H;const Ce=new URL(ue.href),ke=S.byUrl(Ce);if((ke==null?void 0:ke.type)!=="github"&&(ke==null?void 0:ke.type)!=="gitlab")return H;const Ne=((me=H.querySelector("article>h1"))===null||me===void 0?void 0:me.childNodes[0].textContent)||"",ot=encodeURIComponent(`Documentation Feedback: ${Ne}`),ht=encodeURIComponent(`Page source:
490
- ${ue.href}
491
-
492
- Feedback:`),ut=(ke==null?void 0:ke.type)==="github"?(0,ln.BT)(Ce.href,"blob"):Ce.href,et=Kt()(ut),St=`/${et.organization}/${et.name}`,at=ue.cloneNode();switch(ke==null?void 0:ke.type){case"gitlab":at.href=`${Ce.origin}${St}/issues/new?issue[title]=${ot}&issue[description]=${ht}`;break;case"github":at.href=`${Ce.origin}${St}/issues/new?title=${ot}&body=${ht}`;break;default:return H}return gn.render(n.createElement(Dn.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 Nn=t(44882);const Yt=()=>S=>{const H=S.querySelector('.md-header label[for="__drawer"]'),me=S.querySelector("article");if(!H||!me)return S;const ue=H.cloneNode();return gn.render(n.createElement(Nn.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"),me==null||me.prepend(ue),S},mn=()=>S=>(((me,ue)=>{Array.from(me).filter(Ce=>Ce.hasAttribute(ue)).forEach(Ce=>{const ke=Ce.getAttribute(ue);if(ke){ke.match(/^https?:\/\//i)&&Ce.setAttribute("target","_blank");try{const Ne=cn(window.location.href);Ce.setAttribute(ue,new URL(ke,Ne).toString())}catch{Ce.replaceWith(Ce.textContent||ke)}}})})(Array.from(S.getElementsByTagName("a")),"href"),S);function cn(S){const H=new URL(S);return!H.pathname.endsWith("/")&&!H.pathname.endsWith(".html")&&(H.pathname+="/"),H.toString()}const Rn=({baseUrl:S,onClick:H})=>me=>(Array.from(me.getElementsByTagName("a")).forEach(ue=>{ue.addEventListener("click",Ce=>{const Ne=ue.getAttribute("href");!Ne||Ne.startsWith(S)&&!ue.hasAttribute("download")&&(Ce.preventDefault(),H(Ce,Ne))})}),me);var Fn=t(15459),Cn=t(80030),ge=t(72379),te=t(41547);const Ee=(0,Fn.Z)(S=>({tooltip:{fontSize:"inherit",color:S.palette.text.primary,margin:0,padding:S.spacing(.5),backgroundColor:"transparent",boxShadow:"none"}}))(Cn.ZP),De=()=>(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"})}),qe=({text:S})=>{const[H,me]=(0,n.useState)(!1),ue=(0,n.useCallback)(()=>{navigator.clipboard.writeText(S),me(!0)},[S]),Ce=(0,n.useCallback)(()=>{me(!1)},[me]);return(0,h.jsx)(Ee,{title:"Copied to clipboard",placement:"left",open:H,onClose:Ce,leaveDelay:1e3,children:(0,h.jsx)("button",{className:"md-clipboard md-icon",onClick:ue,children:(0,h.jsx)(De,{})})})},xt=S=>H=>{const me=H.querySelectorAll("pre > code");for(const Ce of me){var ue;const ke=Ce.textContent||"",Ne=document.createElement("div");Ce==null||(ue=Ce.parentElement)===null||ue===void 0||ue.prepend(Ne),gn.render((0,h.jsx)(te.Z,{theme:S,children:(0,h.jsx)(qe,{text:ke})}),Ne)}return H},ae=()=>S=>{var H;return(H=S.querySelector(".md-header"))===null||H===void 0||H.remove(),S},P=()=>S=>{var H,me;return(H=S.querySelector(".md-footer .md-copyright"))===null||H===void 0||H.remove(),(me=S.querySelector(".md-footer-copyright"))===null||me===void 0||me.remove(),S},q=({onLoading:S,onLoaded:H})=>me=>(S(),me.addEventListener(V.Ox,function ue(){H(),me.removeEventListener(V.Ox,ue)}),me),Ke=()=>S=>(setTimeout(()=>{if(window.location.hash){var H;const me=window.location.hash.slice(1);(H=S==null?void 0:S.querySelector(`[id="${me}"]`))===null||H===void 0||H.scrollIntoView()}},200),S),U=()=>S=>(setTimeout(()=>{const H=S==null?void 0:S.querySelectorAll("li.md-nav__item--active");H.length!==0&&(H.forEach(ue=>{const Ce=ue==null?void 0:ue.querySelector("input");Ce!=null&&Ce.checked||Ce==null||Ce.click()}),H[H.length-1].scrollIntoView())},200),S),Z=async(S,H)=>{let me;if(typeof S=="string")me=new DOMParser().parseFromString(S,"text/html").documentElement;else if(S instanceof Element)me=S;else throw new Error("dom is not a recognized type");for(const ue of H)me=await ue(me);return me},ce="screen and (max-width: 76.1875em)",pe=S=>{const H=(0,Je.s0)(),me=(0,Ze.Z)(),ue=(0,je.Z)(ce),Ce=Re(),ke=fn(),Ne=(0,$.z$)(),ot=(0,$.h_)(V.Dl),ht=(0,$.h_)(We.q3),{state:ut,path:et,content:St}=(0,T.DK)(),[at,Tt]=(0,n.useState)(null),Bt=(0,V.ux)(at),Nt=(0,n.useCallback)(()=>{if(!at)return;at.querySelectorAll(".md-sidebar").forEach(Ft=>{if(ue)Ft.style.top="0px";else{const jn=document==null?void 0:document.querySelector(".techdocs-reader-page");var dn;const Un=(dn=jn==null?void 0:jn.getBoundingClientRect().top)!==null&&dn!==void 0?dn:0;var yn;let xn=(yn=at.getBoundingClientRect().top)!==null&&yn!==void 0?yn:0;const tn=at.querySelector(".md-container > .md-tabs");var Mn;const En=(Mn=tn==null?void 0:tn.getBoundingClientRect().height)!==null&&Mn!==void 0?Mn:0;xn<Un&&(xn=Un),Ft.style.top=`${Math.max(xn,0)+En}px`}Ft.style.setProperty("opacity","1")})},[at,ue]);(0,n.useEffect)(()=>(window.addEventListener("resize",Nt),window.addEventListener("scroll",Nt,!0),()=>{window.removeEventListener("resize",Nt),window.removeEventListener("scroll",Nt,!0)}),[at,Nt]);const vn=(0,n.useCallback)(()=>{if(!at)return;const Ut=at.querySelector(".md-footer");Ut&&(Ut.style.width=`${at.getBoundingClientRect().width}px`)},[at]);(0,n.useEffect)(()=>(window.addEventListener("resize",vn),()=>{window.removeEventListener("resize",vn)}),[at,vn]),(0,n.useEffect)(()=>{Bt||(vn(),Nt())},[ut,Bt,vn,Nt]);const Gn=(0,n.useCallback)((Ut,Ft)=>Z(Ut,[Ce,Zn({techdocsStorageApi:ot,entityId:S,path:Ft}),mn(),Yt(),ae(),P(),In(ht),ke]),[S,ht,ot,Ce,ke]),wn=(0,n.useCallback)(async Ut=>Z(Ut,[Ke(),U(),xt(me),Rn({baseUrl:window.location.origin,onClick:(Ft,dn)=>{var yn;const Mn=Ft.ctrlKey||Ft.metaKey,jn=new URL(dn),Un=`${jn.pathname}${jn.search}${jn.hash}`,xn=((yn=Ft.target)===null||yn===void 0?void 0:yn.innerText)||dn,tn=dn.replace(window.location.origin,"");if(Ne.captureEvent("click",xn,{attributes:{to:tn}}),jn.hash)if(Mn)window.open(Un,"_blank");else{var En;H(Un),(En=Ut==null?void 0:Ut.querySelector(`[id="${jn.hash.slice(1)}"]`))===null||En===void 0||En.scrollIntoView()}else Mn?window.open(Un,"_blank"):H(Un)}}),q({onLoading:()=>{},onLoaded:()=>{var Ft;(Ft=Ut.querySelector(".md-nav__title"))===null||Ft===void 0||Ft.removeAttribute("for")}}),q({onLoading:()=>{Array.from(Ut.querySelectorAll(".md-sidebar")).forEach(dn=>{dn.style.setProperty("opacity","0")})},onLoaded:()=>{}})]),[me,H,Ne]);return(0,n.useEffect)(()=>{if(!St)return()=>{};let Ut=!0;return Gn(St,et).then(async Ft=>{if(!(Ft!=null&&Ft.innerHTML)||!Ut)return;window.scroll({top:0});const dn=await wn(Ft);Tt(dn)}),()=>{Ut=!1}},[St,et,Gn,wn]),at};var be=t(8560);const Be=()=>{const S=(0,V.$L)(),{shadowRoot:H}=(0,V.x1)(),me=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 Ce=ue==null?void 0:ue.querySelector('[data-techdocs-addons-location="primary sidebar"]');Ce||(Ce=document.createElement("div"),Ce.setAttribute("data-techdocs-addons-location","primary sidebar"),ue==null||ue.prepend(Ce));const ke=H==null?void 0:H.querySelector('div[data-md-component="sidebar"][data-md-type="toc"], div[data-md-component="toc"]');let Ne=ke==null?void 0:ke.querySelector('[data-techdocs-addons-location="secondary sidebar"]');return Ne||(Ne=document.createElement("div"),Ne.setAttribute("data-techdocs-addons-location","secondary sidebar"),ke==null||ke.prepend(Ne)),(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(be.Z,{container:Ce,children:S.renderComponentsByLocation(V.oZ.PrimarySidebar)}),(0,h.jsx)(be.Z,{container:me,children:S.renderComponentsByLocation(V.oZ.Content)}),(0,h.jsx)(be.Z,{container:Ne,children:S.renderComponentsByLocation(V.oZ.SecondarySidebar)})]})},Oe=(0,g.Z)({search:{width:"100%","@media (min-width: 76.1875em)":{width:"calc(100% - 34.4rem)",margin:"0 auto"}}}),He=(0,T.m1)(S=>{var H;const{withSearch:me=!0,onReady:ue}=S,Ce=Oe(),{entityMetadata:{value:ke,loading:Ne},entityRef:ot,setShadowRoot:ht}=(0,V.x1)(),ut=pe(ot),et=(0,n.useCallback)(St=>{ht(St),ue instanceof Function&&ue()},[ht,ue]);return Ne===!1&&!ke?(0,h.jsx)(x.mf,{status:"404",statusMessage:"PAGE NOT FOUND"}):ut?(0,h.jsx)(x.VY,{children:(0,h.jsxs)(R.Z,{container:!0,children:[(0,h.jsx)(R.Z,{xs:12,item:!0,children:(0,h.jsx)(Ie,{})}),me&&(0,h.jsx)(R.Z,{className:Ce.search,xs:"auto",item:!0,children:(0,h.jsx)(l.S,{entityId:ot,entityTitle:ke==null||(H=ke.metadata)===null||H===void 0?void 0:H.title})}),(0,h.jsx)(R.Z,{xs:12,item:!0,children:(0,h.jsx)(V.VA,{element:ut,onAppend:et,children:(0,h.jsx)(Be,{})})})]})}):(0,h.jsx)(x.VY,{children:(0,h.jsx)(R.Z,{container:!0,children:(0,h.jsx)(R.Z,{xs:12,item:!0,children:(0,h.jsx)(Ie,{})})})})}),st=null},93225:function(jt,Fe,t){"use strict";t.d(Fe,{S:function(){return he}});var h=t(52322),n=t(2784),g=t(18671),R=t(60905),V=t(98069),x=t(73250),l=t(61886),I=t(43297),ne=t(25271),J=t(93414),Q=t(25248),D=t(76635),X=t(95573);const _=(0,h.jsx)(V.Z,{animation:"wave",variant:"text",height:40}),he=ie=>{const{children:E}=ie,L=(0,l.$L)(),$=(0,Q.h_)(Q.Ds),{title:A,setTitle:T,subtitle:ee,setSubtitle:Ie,entityRef:Je,metadata:{value:Ze,loading:je},entityMetadata:{value:We,loading:gt}}=(0,l.x1)();(0,n.useEffect)(()=>{!Ze||(T(Ze.site_name),Ie(()=>{let{site_description:re}=Ze;return(!re||re==="None")&&(re=""),re}))},[Ze,T,Ie]);const nt=$.getOptional("app.title")||"Backstage",Me=[A,ee,nt].filter(Boolean).join(" | "),{locationMetadata:ze,spec:Qe}=We||{},rt=Qe==null?void 0:Qe.lifecycle,ct=We?(0,I.hF)(We,ne.S4):[],lt=(0,Q.tg)(X._Z)(),mt=(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(J.i9,{label:(0,D.capitalize)((We==null?void 0:We.kind)||"entity"),value:(0,h.jsx)(I.dx,{color:"inherit",entityRef:Je,title:We==null?void 0:We.metadata.title,defaultKind:"Component"})}),ct.length>0&&(0,h.jsx)(J.i9,{label:"Owner",value:(0,h.jsx)(I.rI,{color:"inherit",entityRefs:ct,defaultKind:"group"})}),rt?(0,h.jsx)(J.i9,{label:"Lifecycle",value:rt}):null,ze&&ze.type!=="dir"&&ze.type!=="file"?(0,h.jsx)(J.i9,{label:"",value:(0,h.jsxs)(R.Z,{container:!0,direction:"column",alignItems:"center",style:{color:"#fff"},children:[(0,h.jsx)(R.Z,{style:{padding:0},item:!0,children:(0,h.jsx)(x.Z,{style:{marginTop:"-25px"}})}),(0,h.jsx)(R.Z,{style:{padding:0},item:!0,children:"Source"})]}),url:ze.target}):null]});return!gt&&We===void 0||!je&&Ze===void 0?null:(0,h.jsxs)(J.h4,{type:"Documentation",typeLink:lt,title:A||_,subtitle:ee===""?void 0:ee||_,children:[(0,h.jsx)(g.Z,{titleTemplate:"%s",children:(0,h.jsx)("title",{children:Me})}),mt,E,L.renderComponentsByLocation(l.oZ.Header)]})}},65124:function(jt,Fe,t){"use strict";t.d(Fe,{b:function(){return D}});var h=t(52322),n=t(2784),g=t(79692),R=t(15223),V=t(95544),x=t(80030),l=t(61837),I=t(48348),ne=t(47603),J=t(61886);const Q=(0,g.Z)(X=>({root:{gridArea:"pageSubheader",flexDirection:"column",minHeight:"auto",padding:X.spacing(3,3,0)}})),D=X=>{const _=Q(),[he,ie]=(0,n.useState)(null),E=(0,n.useCallback)(Je=>{ie(Je.currentTarget)},[]),L=(0,n.useCallback)(()=>{ie(null)},[]),{entityMetadata:{value:$,loading:A}}=(0,J.x1)(),T=(0,J.$L)(),ee=T.renderComponentsByLocation(J.oZ.Subheader),Ie=T.renderComponentsByLocation(J.oZ.Settings);return!ee&&!Ie||A===!1&&!$?null:(0,h.jsx)(R.Z,{classes:_,...X.toolbarProps,children:(0,h.jsxs)(V.Z,{display:"flex",justifyContent:"flex-end",width:"100%",flexWrap:"wrap",children:[ee,Ie?(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(x.ZP,{title:"Settings",children:(0,h.jsx)(l.Z,{"aria-controls":"tech-docs-reader-page-settings","aria-haspopup":"true",onClick:E,children:(0,h.jsx)(ne.Z,{})})}),(0,h.jsx)(I.Z,{id:"tech-docs-reader-page-settings",getContentAnchorEl:null,anchorEl:he,anchorOrigin:{vertical:"bottom",horizontal:"right"},open:Boolean(he),onClose:L,keepMounted:!0,children:Ie})]}):null]})})}},95481:function(jt,Fe,t){"use strict";t.d(Fe,{DK:function(){return D},m1:function(){return _}});var h=t(52322),n=t(2784),g=t(10289),R=t(61886),V=t(25248),x=t(64279),l=t(77446);function I({contentLoading:he,content:ie,activeSyncState:E}){return he||E==="BUILD_READY_RELOAD"||!ie&&E==="CHECKING"?"CHECKING":!ie&&E==="BUILDING"?"INITIAL_BUILD":ie?E==="BUILDING"?"CONTENT_STALE_REFRESHING":E==="BUILD_READY"?"CONTENT_STALE_READY":E==="ERROR"?"CONTENT_STALE_ERROR":"CONTENT_FRESH":"CONTENT_NOT_FOUND"}function ne(he,ie){const E={...he};switch(ie.type){case"sync":ie.state==="CHECKING"&&(E.buildLog=[]),E.activeSyncState=ie.state,E.syncError=ie.syncError;break;case"contentLoading":E.contentLoading=!0,E.contentError=void 0;break;case"content":typeof ie.path=="string"&&(E.path=ie.path),E.contentLoading=!1,E.content=ie.content,E.contentError=ie.contentError;break;case"buildLog":E.buildLog=E.buildLog.concat(ie.log);break;default:throw new Error}return["BUILD_READY","BUILD_READY_RELOAD"].includes(E.activeSyncState)&&["contentLoading","content"].includes(ie.type)&&(E.activeSyncState="UP_TO_DATE",E.buildLog=[]),E}function J(he,ie,E,L){var $,A;const[T,ee]=(0,n.useReducer)(ne,{activeSyncState:"CHECKING",path:L,contentLoading:!0,buildLog:[]}),Ie=(0,V.h_)(R.Dl),{retry:Je}=(0,l.Z)(async()=>{ee({type:"contentLoading"});try{const We=await Ie.getEntityDocs({kind:he,namespace:ie,name:E},L);return ee({type:"content",content:We,path:L}),We}catch(We){ee({type:"content",contentError:We,path:L})}},[Ie,he,ie,E,L]),Ze=(0,n.useRef)({content:void 0,reload:()=>{}});return Ze.current={content:T.content,reload:Je},(0,x.default)(async()=>{ee({type:"sync",state:"CHECKING"});const We=setTimeout(()=>{ee({type:"sync",state:"BUILDING"})},1e3);try{switch(await Ie.syncEntityDocs({kind:he,namespace:ie,name:E},nt=>{ee({type:"buildLog",log:nt})})){case"updated":Ze.current.content?ee({type:"sync",state:"BUILD_READY"}):(Ze.current.reload(),ee({type:"sync",state:"BUILD_READY_RELOAD"}));break;case"cached":ee({type:"sync",state:"UP_TO_DATE"});break;default:ee({type:"sync",state:"ERROR",syncError:new Error("Unexpected return state")});break}}catch(gt){ee({type:"sync",state:"ERROR",syncError:gt})}finally{clearTimeout(We)}},[he,E,ie,Ie,ee,Ze]),{state:(0,n.useMemo)(()=>I({activeSyncState:T.activeSyncState,contentLoading:T.contentLoading,content:T.content}),[T.activeSyncState,T.content,T.contentLoading]),contentReload:Je,path:T.path,content:T.content,contentErrorMessage:($=T.contentError)===null||$===void 0?void 0:$.toString(),syncErrorMessage:(A=T.syncError)===null||A===void 0?void 0:A.toString(),buildLog:T.buildLog}}const Q=(0,n.createContext)({}),D=()=>(0,n.useContext)(Q),X=({children:he})=>{const{"*":ie=""}=(0,g.UO)(),{entityRef:E}=(0,R.x1)(),{kind:L,namespace:$,name:A}=E,T=J(L,$,A,ie);return(0,h.jsx)(Q.Provider,{value:T,children:he instanceof Function?he(T):he})},_=he=>ie=>(0,h.jsx)(X,{children:(0,h.jsx)(he,{...ie})})},95573:function(jt,Fe,t){"use strict";t.d(Fe,{Fw:function(){return g},_Z:function(){return n},pd:function(){return R}});var h=t(25248);const n=(0,h.NT)({id:"techdocs:index-page"}),g=(0,h.NT)({id:"techdocs:reader-page",params:["namespace","kind","name"]}),R=(0,h.NT)({id:"techdocs:catalog-reader-view"})},17339:function(jt,Fe,t){"use strict";t.d(Fe,{S:function(){return L}});var h=t(52322),n=t(2784),g=t(79692),R=t(49378),V=t(38402),x=t(86136),l=t(85256),I=t(93414),ne=t(25248),J=t(65826);const Q=(0,g.Z)({flexContainer:{flexWrap:"wrap"},itemText:{width:"100%",marginBottom:"1rem"}}),D=$=>{const{result:A,highlight:T,rank:ee,lineClamp:Ie=5,asListItem:Je=!0,asLink:Ze=!0,title:je,icon:We}=$,gt=Q(),nt=(0,ne.z$)(),Me=()=>{nt.captureEvent("discover",A.title,{attributes:{to:A.location},value:ee})},ze=()=>{const ct=T!=null&&T.fields.title?(0,h.jsx)(J.FA,{text:T.fields.title,preTag:T.preTag,postTag:T.postTag}):A.title,lt=T!=null&&T.fields.entityTitle?(0,h.jsx)(J.FA,{text:T.fields.entityTitle,preTag:T.preTag,postTag:T.postTag}):A.entityTitle,mt=T!=null&&T.fields.name?(0,h.jsx)(J.FA,{text:T.fields.name,preTag:T.preTag,postTag:T.postTag}):A.name;return(0,h.jsx)(R.Z,{className:gt.itemText,primaryTypographyProps:{variant:"h6"},primary:je||(0,h.jsxs)(h.Fragment,{children:[ct," | ",lt!=null?lt:mt," docs"]}),secondary:(0,h.jsx)("span",{style:{display:"-webkit-box",WebkitBoxOrient:"vertical",WebkitLineClamp:Ie,overflow:"hidden"},children:T!=null&&T.fields.text?(0,h.jsx)(J.FA,{text:T.fields.text,preTag:T.preTag,postTag:T.postTag}):A.text})})},Qe=({children:ct})=>Ze?(0,h.jsx)(I.rU,{noTrack:!0,to:A.location,onClick:Me,children:ct}):(0,h.jsx)(h.Fragment,{children:ct}),rt=({children:ct})=>Je?(0,h.jsxs)(h.Fragment,{children:[(0,h.jsxs)(V.Z,{alignItems:"flex-start",children:[We&&(0,h.jsx)(x.Z,{children:We}),(0,h.jsx)("div",{className:gt.flexContainer,children:ct})]}),(0,h.jsx)(l.Z,{component:"li"})]}):(0,h.jsx)(h.Fragment,{children:ct});return(0,h.jsx)(Qe,{children:(0,h.jsx)(rt,{children:(0,h.jsx)(ze,{})})})};var X=t(27556),_=t(10289);const he=(0,g.Z)($=>({root:{width:"100%"},bar:{padding:$.spacing(1)}})),ie=$=>$==null?void 0:$.document,E=$=>{const{entityId:A,entityTitle:T,debounceTime:ee=150}=$,[Ie,Je]=(0,n.useState)(!1),Ze=(0,_.s0)(),{setFilters:je,result:{loading:We,value:gt}}=(0,J.Rx)(),nt=he(),[Me,ze]=(0,n.useState)([]);(0,n.useEffect)(()=>{let mt=!0;if(mt&&gt){const vt=gt.results.slice(0,10);ze(vt)}return()=>{mt=!1}},[We,gt]);const{kind:Qe,name:rt,namespace:ct}=A;(0,n.useEffect)(()=>{je(mt=>({...mt,kind:Qe,namespace:ct,name:rt}))},[Qe,ct,rt,je]);const lt=(mt,vt)=>{if(ie(vt)){const{location:Ge}=vt.document;Ze(Ge)}};return(0,h.jsx)(X.Z,{className:nt.bar,variant:"outlined",children:(0,h.jsx)(J.qO,{classes:{root:nt.root},"data-testid":"techdocs-search-bar",size:"small",open:Ie,getOptionLabel:()=>"",filterOptions:mt=>mt,onClose:()=>{Je(!1)},onFocus:()=>{Je(!0)},onChange:lt,blurOnSelect:!0,noOptionsText:"No results found",value:null,options:Me,renderOption:({document:mt,highlight:vt})=>(0,h.jsx)(D,{result:mt,lineClamp:3,asListItem:!1,asLink:!1,title:mt.title,highlight:vt}),loading:We,inputDebounceTime:ee,inputPlaceholder:`Search ${T||A.name} docs`,freeSolo:!1})})},L=$=>{const A={term:"",types:["techdocs"],pageCursor:"",filters:$.entityId};return(0,h.jsx)(J.Nd,{initialState:A,children:(0,h.jsx)(E,{...$})})}},53260:function(){}},function(jt){var Fe=function(h){return jt(jt.s=h)};jt.O(0,[2370,6202,9284,9035,2126,7012,2194,1410,427,6816,5218,4736],function(){return Fe(96215)});var t=jt.O()}]);})();
493
-
494
- //# sourceMappingURL=main.4fdcff32.js.map