@techdocs/cli 1.4.3 → 1.4.4-next.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +11 -0
- package/dist/embedded-app/index.html +1 -1
- package/dist/embedded-app/static/{1032.be408b83.chunk.js → 1032.386b1848.chunk.js} +1 -1
- package/dist/embedded-app/static/{1032.be408b83.chunk.js.map → 1032.386b1848.chunk.js.map} +1 -1
- package/dist/embedded-app/static/{1105.c65d4e64.chunk.js → 1105.209c5cde.chunk.js} +1 -1
- package/dist/embedded-app/static/{1105.c65d4e64.chunk.js.map → 1105.209c5cde.chunk.js.map} +1 -1
- package/dist/embedded-app/static/{184.a8ac59c2.chunk.js → 184.8440cd01.chunk.js} +1 -1
- package/dist/embedded-app/static/{184.a8ac59c2.chunk.js.map → 184.8440cd01.chunk.js.map} +1 -1
- package/dist/embedded-app/static/{2440.b8e50edb.chunk.js → 2440.3a9ca67a.chunk.js} +1 -1
- package/dist/embedded-app/static/{2440.b8e50edb.chunk.js.map → 2440.3a9ca67a.chunk.js.map} +1 -1
- package/dist/embedded-app/static/{5458.38a11fde.chunk.js → 5458.799ae5d6.chunk.js} +1 -1
- package/dist/embedded-app/static/{5458.38a11fde.chunk.js.map → 5458.799ae5d6.chunk.js.map} +1 -1
- package/dist/embedded-app/static/6051.e79907ed.chunk.js +4 -0
- package/dist/embedded-app/static/6051.e79907ed.chunk.js.map +1 -0
- package/dist/embedded-app/static/{732.bb820d6a.chunk.js → 732.e558c17c.chunk.js} +1 -1
- package/dist/embedded-app/static/{732.bb820d6a.chunk.js.map → 732.e558c17c.chunk.js.map} +1 -1
- package/dist/embedded-app/static/{7560.f715d7bd.chunk.js → 7560.d0f6ed99.chunk.js} +1 -1
- package/dist/embedded-app/static/7560.d0f6ed99.chunk.js.map +1 -0
- package/dist/embedded-app/static/7670.8d59317d.chunk.js +3 -0
- package/dist/embedded-app/static/7670.8d59317d.chunk.js.map +1 -0
- package/dist/embedded-app/static/{7750.5d194dad.chunk.js → 7750.fe6b6d6f.chunk.js} +3 -3
- package/dist/embedded-app/static/7750.fe6b6d6f.chunk.js.map +1 -0
- package/dist/embedded-app/static/{8951.36f657ca.chunk.js → 8951.bd3e96f5.chunk.js} +1 -1
- package/dist/embedded-app/static/{8951.36f657ca.chunk.js.map → 8951.bd3e96f5.chunk.js.map} +1 -1
- package/dist/embedded-app/static/{9323.9cac24aa.chunk.js → 9323.9b74c02c.chunk.js} +1 -1
- package/dist/embedded-app/static/9323.9b74c02c.chunk.js.map +1 -0
- package/dist/embedded-app/static/{9545.3dc1ecf9.chunk.js → 9545.af619fb2.chunk.js} +1 -1
- package/dist/embedded-app/static/{9545.3dc1ecf9.chunk.js.map → 9545.af619fb2.chunk.js.map} +1 -1
- package/dist/embedded-app/static/{9770.c98e9dad.chunk.js → 9770.961c4c09.chunk.js} +1 -1
- package/dist/embedded-app/static/{9770.c98e9dad.chunk.js.map → 9770.961c4c09.chunk.js.map} +1 -1
- package/dist/embedded-app/static/main.9303dbab.js +522 -0
- package/dist/embedded-app/static/main.9303dbab.js.map +1 -0
- package/dist/embedded-app/static/{module-octokit.a126d1a6.js → module-octokit.7416db07.js} +3 -3
- package/dist/embedded-app/static/{module-octokit.a126d1a6.js.map → module-octokit.7416db07.js.map} +1 -1
- package/dist/embedded-app/static/{runtime.6328c68d.js → runtime.9303dbab.js} +2 -2
- package/dist/embedded-app/static/{runtime.6328c68d.js.map → runtime.9303dbab.js.map} +1 -1
- package/dist/embedded-app/static/{vendor.6328c68d.js → vendor.9303dbab.js} +1 -1
- package/dist/embedded-app/static/{vendor.6328c68d.js.map → vendor.9303dbab.js.map} +1 -1
- package/dist/index.cjs.js +1 -1
- package/package.json +5 -5
- package/dist/embedded-app/static/6051.098a0af9.chunk.js +0 -4
- package/dist/embedded-app/static/6051.098a0af9.chunk.js.map +0 -1
- package/dist/embedded-app/static/7560.f715d7bd.chunk.js.map +0 -1
- package/dist/embedded-app/static/7670.f17f89be.chunk.js +0 -3
- package/dist/embedded-app/static/7670.f17f89be.chunk.js.map +0 -1
- package/dist/embedded-app/static/7750.5d194dad.chunk.js.map +0 -1
- package/dist/embedded-app/static/9323.9cac24aa.chunk.js.map +0 -1
- package/dist/embedded-app/static/main.6328c68d.js +0 -522
- package/dist/embedded-app/static/main.6328c68d.js.map +0 -1
|
@@ -1,522 +0,0 @@
|
|
|
1
|
-
(()=>{(self.webpackChunktechdocs_cli_embedded_app=self.webpackChunktechdocs_cli_embedded_app||[]).push([[179],{4791:function(wt,ke,n){"use strict";n.d(ke,{n3:function(){return g},MS:function(){return ge}});var r=n(87612),p=n(25271),z=n(23054),f=n(96279),W=n.n(f);const g=Symbol.for("CATALOG_FILTER_EXISTS_0e15b590c0b343a2bae3e787e84c2111");function u(ue){return!ue.cursor}function N(ue){return!u(ue)}class ge{async getEntityAncestors(V,ne){const{kind:L,namespace:A,name:le}=(0,p.of)(V.entityRef);return await this.requestRequired("GET",`/entities/by-name/${encodeURIComponent(L)}/${encodeURIComponent(A)}/${encodeURIComponent(le)}/ancestry`,ne)}async getLocationById(V,ne){return await this.requestOptional("GET",`/locations/${encodeURIComponent(V)}`,ne)}async getEntities(V,ne){const{filter:L=[],fields:A=[],order:le,offset:se,limit:ae,after:_}=V!=null?V:{},H=this.getParams(L);if(A.length&&H.push(`fields=${A.map(encodeURIComponent).join(",")}`),le)for(const K of[le].flat())K&&H.push(`order=${encodeURIComponent(K.order)}:${encodeURIComponent(K.field)}`);se!==void 0&&H.push(`offset=${se}`),ae!==void 0&&H.push(`limit=${ae}`),_!==void 0&&H.push(`after=${encodeURIComponent(_)}`);const T=H.length?`?${H.join("&")}`:"",R=await this.requestRequired("GET",`/entities${T}`,ne),P=(K,je)=>{var Le,Z;if(((Le=K.metadata)===null||Le===void 0?void 0:Le.name)===void 0||K.kind===void 0||((Z=je.metadata)===null||Z===void 0?void 0:Z.name)===void 0||je.kind===void 0)return 0;const Xe=(0,p.eE)(K),at=(0,p.eE)(je);return Xe<at?-1:Xe>at?1:0};return{items:R.sort(P)}}async getEntitiesByRefs(V,ne){var L;const A={entityRefs:V.entityRefs};!((L=V.fields)===null||L===void 0)&&L.length&&(A.fields=V.fields);const se=`${await this.discoveryApi.getBaseUrl("catalog")}/entities/by-refs`,ae=await this.fetchApi.fetch(se,{headers:{"Content-Type":"application/json",...(ne==null?void 0:ne.token)&&{Authorization:`Bearer ${ne==null?void 0:ne.token}`}},method:"POST",body:JSON.stringify(A)});if(!ae.ok)throw await z.VL.fromResponse(ae);const{items:_}=await ae.json();return{items:_.map(H=>H!=null?H:void 0)}}async queryEntities(V={},ne){const L=[];if(u(V)){var A,le;const{fields:ae=[],filter:_,limit:H,orderFields:T,fullTextFilter:R}=V;L.push(...this.getParams(_)),H!==void 0&&L.push(`limit=${H}`),T!==void 0&&(Array.isArray(T)?T:[T]).forEach(({field:K,order:je})=>L.push(`orderField=${K},${je}`)),ae.length&&L.push(`fields=${ae.map(encodeURIComponent).join(",")}`);const P=R==null||(A=R.term)===null||A===void 0?void 0:A.trim();P&&L.push(`fullTextFilterTerm=${P}`),!(R==null||(le=R.fields)===null||le===void 0)&&le.length&&L.push(`fullTextFilterFields=${R.fields.join(",")}`)}else{const{fields:ae=[],limit:_,cursor:H}=V;L.push(`cursor=${H}`),_!==void 0&&L.push(`limit=${_}`),ae.length&&L.push(`fields=${ae.map(encodeURIComponent).join(",")}`)}const se=L.length?`?${L.join("&")}`:"";return this.requestRequired("GET",`/entities/by-query${se}`,ne)}async getEntityByRef(V,ne){const{kind:L,namespace:A,name:le}=(0,p.of)(V);return this.requestOptional("GET",`/entities/by-name/${encodeURIComponent(L)}/${encodeURIComponent(A)}/${encodeURIComponent(le)}`,ne)}async getEntityByName(V,ne){const{kind:L,namespace:A="default",name:le}=V;return this.requestOptional("GET",`/entities/by-name/${encodeURIComponent(L)}/${encodeURIComponent(A)}/${encodeURIComponent(le)}`,ne)}async refreshEntity(V,ne){const L=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:V})});if(L.status!==200)throw new Error(await L.text())}async getEntityFacets(V,ne){const{filter:L=[],facets:A}=V,le=this.getParams(L);for(const ae of A)le.push(`facet=${encodeURIComponent(ae)}`);const se=le.length?`?${le.join("&")}`:"";return await this.requestOptional("GET",`/entity-facets${se}`,ne)}async addLocation(V,ne){const{type:L="url",target:A,dryRun:le}=V,se=await this.fetchApi.fetch(`${await this.discoveryApi.getBaseUrl("catalog")}/locations${le?"?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:L,target:A})});if(se.status!==201)throw new Error(await se.text());const{location:ae,entities:_,exists:H}=await se.json();if(!ae)throw new Error(`Location wasn't added: ${A}`);return{location:ae,entities:_,exists:H}}async getLocationByRef(V,ne){return(await this.requestRequired("GET","/locations",ne)).map(A=>A.data).find(A=>V===(0,p.NZ)(A))}async removeLocationById(V,ne){await this.requestIgnored("DELETE",`/locations/${encodeURIComponent(V)}`,ne)}async removeEntityByUid(V,ne){await this.requestIgnored("DELETE",`/entities/by-uid/${encodeURIComponent(V)}`,ne)}async validateEntity(V,ne,L){const A=await this.fetchApi.fetch(`${await this.discoveryApi.getBaseUrl("catalog")}/validate-entity`,{headers:{"Content-Type":"application/json",...(L==null?void 0:L.token)&&{Authorization:`Bearer ${L==null?void 0:L.token}`}},method:"POST",body:JSON.stringify({entity:V,location:ne})});if(A.ok)return{valid:!0};if(A.status!==400)throw await z.VL.fromResponse(A);const{errors:le=[]}=await A.json();return{valid:!1,errors:le}}async requestIgnored(V,ne,L){const A=`${await this.discoveryApi.getBaseUrl("catalog")}${ne}`,le=L!=null&&L.token?{Authorization:`Bearer ${L.token}`}:{},se=await this.fetchApi.fetch(A,{method:V,headers:le});if(!se.ok)throw await z.VL.fromResponse(se)}async requestRequired(V,ne,L){const A=`${await this.discoveryApi.getBaseUrl("catalog")}${ne}`,le=L!=null&&L.token?{Authorization:`Bearer ${L.token}`}:{},se=await this.fetchApi.fetch(A,{method:V,headers:le});if(!se.ok)throw await z.VL.fromResponse(se);return se.json()}async requestOptional(V,ne,L){const A=`${await this.discoveryApi.getBaseUrl("catalog")}${ne}`,le=L!=null&&L.token?{Authorization:`Bearer ${L.token}`}:{},se=await this.fetchApi.fetch(A,{method:V,headers:le});if(!se.ok){if(se.status===404)return;throw await z.VL.fromResponse(se)}return await se.json()}getParams(V=[]){const ne=[];for(const L of[V].flat()){const A=[];for(const[le,se]of Object.entries(L))for(const ae of[se].flat())ae===g?A.push(encodeURIComponent(le)):typeof ae=="string"&&A.push(`${encodeURIComponent(le)}=${encodeURIComponent(ae)}`);A.length&&ne.push(`filter=${A.join(",")}`)}return ne}constructor(V){(0,r._)(this,"discoveryApi",void 0),(0,r._)(this,"fetchApi",void 0),this.discoveryApi=V.discoveryApi,this.fetchApi=V.fetchApi||{fetch:W()}}}},25271:function(wt,ke,n){"use strict";n.d(ke,{Tf:function(){return z},P1:function(){return jn},q1:function(){return Fn},M6:function(){return Rn},l2:function(){return p},zG:function(){return r},w$:function(){return Xt},nP:function(){return Qt},aS:function(){return nn},S4:function(){return ut},cz:function(){return et},wI:function(){return je},iB:function(){return Zt},CV:function(){return Ie},of:function(){return Dt},Ou:function(){return Se},eE:function(){return _e},NZ:function(){return de}});const r="default",p="backstage.io/view-url",z="backstage.io/edit-url",f="kubernetes.io/api-server",W="kubernetes.io/api-server-certificate-authority",g="kubernetes.io/auth-provider";var u=n(76635),N=n.n(u);class ge{async enforce(k){return k.metadata.namespace?k:lodash.merge({metadata:{namespace:this.namespace}},k)}constructor(k=DEFAULT_NAMESPACE){_define_property(this,"namespace",void 0),this.namespace=k}}class ue{static isValidPrefixAndOrSuffix(k,ce,Pe,Ue){if(typeof k!="string")return!1;const We=k.split(ce);return We.length===1?Ue(We[0]):We.length===2?Pe(We[0])&&Ue(We[1]):!1}static isJsonSafe(k){try{return N().isEqual(k,JSON.parse(JSON.stringify(k)))}catch{return!1}}static isValidDnsSubdomain(k){return typeof k=="string"&&k.length>=1&&k.length<=253&&k.split(".").every(ue.isValidDnsLabel)}static isValidDnsLabel(k){return typeof k=="string"&&k.length>=1&&k.length<=63&&/^[a-z0-9]+(?:\-+[a-z0-9]+)*$/.test(k)}static isValidTag(k){return typeof k=="string"&&k.length>=1&&k.length<=63&&/^[a-z0-9+#]+(\-[a-z0-9+#]+)*$/.test(k)}static isValidUrl(k){if(typeof k!="string")return!1;try{return new URL(k),!0}catch{return!1}}static isValidString(k){var ce;return typeof k=="string"&&((ce=k==null?void 0:k.trim())===null||ce===void 0?void 0:ce.length)>=1}static isNonEmptyString(k){var ce;return typeof k=="string"&&((ce=k==null?void 0:k.trim())===null||ce===void 0?void 0:ce.length)>=1}}var V=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}}}}}'),ne=n(27991),L=n.n(ne),A=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"}}}`),le=JSON.parse('{"$schema":"http://json-schema.org/draft-07/schema","$id":"EntityMeta","description":"Metadata fields common to all versions/kinds of entity.","examples":[{"uid":"e01199ab-08cc-44c2-8e19-5c29ded82521","etag":"lsndfkjsndfkjnsdfkjnsd==","name":"my-component-yay","namespace":"the-namespace","labels":{"backstage.io/custom":"ValueStuff"},"annotations":{"example.com/bindings":"are-secret"},"tags":["java","data"]}],"type":"object","required":["name"],"additionalProperties":true,"properties":{"uid":{"type":"string","description":"A globally unique ID for the entity. This field can not be set by the user at creation time, and the server will reject an attempt to do so. The field will be populated in read operations. The field can (optionally) be specified when performing update or delete operations, but the server is free to reject requests that do so in such a way that it breaks semantics.","examples":["e01199ab-08cc-44c2-8e19-5c29ded82521"],"minLength":1},"etag":{"type":"string","description":"An opaque string that changes for each update operation to any part of the entity, including metadata. This field can not be set by the user at creation time, and the server will reject an attempt to do so. The field will be populated in read operations. The field can (optionally) be specified when performing update or delete operations, and the server will then reject the operation if it does not match the current stored value.","examples":["lsndfkjsndfkjnsdfkjnsd=="],"minLength":1},"name":{"type":"string","description":"The name of the entity. Must be unique within the catalog at any given point in time, for any given namespace + kind pair.","examples":["metadata-proxy"],"minLength":1},"namespace":{"type":"string","description":"The namespace that the entity belongs to.","default":"default","examples":["default","admin"],"minLength":1},"title":{"type":"string","description":"A display name of the entity, to be presented in user interfaces instead of the name property, when available.","examples":["React SSR Template"],"minLength":1},"description":{"type":"string","description":"A short (typically relatively few words, on one line) description of the entity."},"labels":{"type":"object","description":"Key/value pairs of identifying information attached to the entity.","additionalProperties":true,"patternProperties":{"^.+$":{"type":"string"}}},"annotations":{"type":"object","description":"Key/value pairs of non-identifying auxiliary information attached to the entity.","additionalProperties":true,"patternProperties":{"^.+$":{"type":"string"}}},"tags":{"type":"array","description":"A list of single-valued strings, to for example classify catalog entities in various ways.","items":{"type":"string","minLength":1}},"links":{"type":"array","description":"A list of external hyperlinks related to the entity. Links can provide additional contextual information that may be located outside of Backstage itself. For example, an admin dashboard or external CMS page.","items":{"type":"object","required":["url"],"properties":{"url":{"type":"string","description":"A url in a standard uri format.","examples":["https://admin.example-org.com"],"minLength":1},"title":{"type":"string","description":"A user friendly display name for the link.","examples":["Admin Dashboard"],"minLength":1},"icon":{"type":"string","description":"A key representing a visual icon to be displayed in the UI.","examples":["dashboard"],"minLength":1},"type":{"type":"string","description":"An optional value to categorize links into specific groups.","examples":["runbook","documentation","logs","dashboard"],"minLength":1}}}}}}'),se=JSON.parse('{"$schema":"http://json-schema.org/draft-07/schema","$id":"common","type":"object","description":"Common definitions to import from other schemas","definitions":{"reference":{"$id":"#reference","type":"object","description":"A reference by name to another entity.","required":["kind","namespace","name"],"additionalProperties":false,"properties":{"kind":{"type":"string","description":"The kind field of the entity.","minLength":1},"namespace":{"type":"string","description":"The metadata.namespace field of the entity.","minLength":1},"name":{"type":"string","description":"The metadata.name field of the entity.","minLength":1}}},"relation":{"$id":"#relation","type":"object","description":"A directed relation from one entity to another.","required":["type","targetRef"],"additionalProperties":false,"properties":{"type":{"type":"string","minLength":1,"pattern":"^\\\\w+$","description":"The type of relation."},"target":{"$ref":"#reference","deprecated":true},"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 ae=new Map,_=[V,A,le,se];function H(G){if(!(G!=null&&G.length))throw new TypeError("Unknown error");const k=G[0];throw new TypeError(`${k.instancePath||"<root>"} ${k.message}${k.params?` - ${Object.entries(k.params).map(([ce,Pe])=>`${ce}: ${Pe}`).join(", ")}`:""}`)}function T(G,k={}){var ce;const Pe=(ce=k==null?void 0:k.disableCache)!==null&&ce!==void 0?ce:!1,Ue=Pe?"":JSON.stringify(G);if(!Pe){const qt=ae.get(Ue);if(qt)return qt}const We=R(G),St=new(L())({allowUnionTypes:!0,allErrors:!0,validateSchema:!0});We.length&&St.addSchema(We,void 0,void 0,!0);const Ot=St.compile(G);return Pe||ae.set(Ue,Ot),Ot}function R(G){if(typeof G!="object")return[];const k=new Set;G.$id&&k.add(G.$id);const ce=new Array,Pe=[G];for(;Pe.length;){const Ue=Pe.pop();for(const We of P(Ue))if(!k.has(We)){k.add(We);const St=_.find(Ot=>Ot.$id===We);St&&(ce.push(St),Pe.push(St))}}return ce}function*P(G){const k=[G];for(;k.length;){const ce=k.pop();if(typeof ce=="object"&&ce)for(const[Pe,Ue]of Object.entries(ce))Pe==="$ref"&&typeof Ue=="string"?yield Ue.split("#")[0]:k.push(Ue)}}function K(G){const k=compileAjvSchema(G||entityEnvelopeSchema);return ce=>{if(k(ce)===!0)return ce;throw throwAjvError(k.errors)}}function je(G){const k=T(G);return ce=>{var Pe;if(k(ce)===!0)return ce;const We=(Pe=k.errors)===null||Pe===void 0?void 0:Pe.filter(St=>["/kind","/apiVersion"].includes(St.instancePath));if(We!=null&&We.length&&We.every(St=>St.keyword==="enum"))return!1;throw H(k.errors)}}function Le(G){const k=compileAjvSchema(G||entitySchema);return ce=>{if(k(ce)===!0)return ce;throw throwAjvError(k.errors)}}class Z{static isValidApiVersion(k){return ue.isValidPrefixAndOrSuffix(k,"/",ue.isValidDnsSubdomain,ce=>ce.length>=1&&ce.length<=63&&/^[a-z0-9A-Z]+$/.test(ce))}static isValidKind(k){return typeof k=="string"&&k.length>=1&&k.length<=63&&/^[a-zA-Z][a-z0-9A-Z]*$/.test(k)}static isValidObjectName(k){return typeof k=="string"&&k.length>=1&&k.length<=63&&/^([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9]$/.test(k)}static isValidNamespace(k){return ue.isValidDnsLabel(k)}static isValidLabelKey(k){return ue.isValidPrefixAndOrSuffix(k,"/",ue.isValidDnsSubdomain,Z.isValidObjectName)}static isValidLabelValue(k){return k===""||Z.isValidObjectName(k)}static isValidAnnotationKey(k){return ue.isValidPrefixAndOrSuffix(k,"/",ue.isValidDnsSubdomain,Z.isValidObjectName)}static isValidAnnotationValue(k){return typeof k=="string"}}const Xe={isValidApiVersion:Z.isValidApiVersion,isValidKind:Z.isValidKind,isValidEntityName:Z.isValidObjectName,isValidNamespace:Z.isValidNamespace,isValidLabelKey:Z.isValidLabelKey,isValidLabelValue:Z.isValidLabelValue,isValidAnnotationKey:Z.isValidAnnotationKey,isValidAnnotationValue:Z.isValidAnnotationValue,isValidTag:G=>typeof G=="string"&&G.length>=1&&G.length<=63&&/^[a-z0-9:+#]+(\-[a-z0-9:+#]+)*$/.test(G)};function at(G={}){return{...Xe,...G}}class Rt{async enforce(k){function ce(te,v,O){if(v==null)throw new Error(`${te} must have a value`);let Q;try{Q=O(v)}catch(M){throw new Error(`${te} could not be validated, ${M}`)}if(!Q){let M;switch(O.name){case"isValidLabelValue":case"isValidObjectName":M="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":M="a valid prefix and/or suffix";break;case"isValidNamespace":case"isValidDnsLabel":M="a string that is sequences of [a-z0-9] separated by [-], at most 63 characters in total";break;case"isValidTag":M="a string that is sequences of [a-z0-9+#] separated by [-], at most 63 characters in total";break;case"isValidAnnotationValue":M="a string";break;case"isValidKind":M="a string that is a sequence of [a-zA-Z][a-z0-9A-Z], at most 63 characters in total";break;case"isValidUrl":M="a string that is a valid url";break;case"isValidString":case"isNonEmptyString":M="a non empty string";break;default:M=void 0;break}const he=M?` expected ${M} but found "${v}".`:"";throw new Error(`"${te}" is not valid;${he} 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 Pe(te,v,O){return v===void 0||ce(te,v,O)}ce("apiVersion",k.apiVersion,this.validators.isValidApiVersion),ce("kind",k.kind,this.validators.isValidKind),ce("metadata.name",k.metadata.name,this.validators.isValidEntityName),Pe("metadata.namespace",k.metadata.namespace,this.validators.isValidNamespace);var Ue;for(const[te,v]of Object.entries((Ue=k.metadata.labels)!==null&&Ue!==void 0?Ue:[]))ce(`labels.${te}`,te,this.validators.isValidLabelKey),ce(`labels.${te}`,v,this.validators.isValidLabelValue);var We;for(const[te,v]of Object.entries((We=k.metadata.annotations)!==null&&We!==void 0?We:[]))ce(`annotations.${te}`,te,this.validators.isValidAnnotationKey),ce(`annotations.${te}`,v,this.validators.isValidAnnotationValue);var St;const Ot=(St=k.metadata.tags)!==null&&St!==void 0?St:[];for(let te=0;te<Ot.length;++te)ce(`tags.${te}`,Ot[te],this.validators.isValidTag);var qt;const Kt=(qt=k.metadata.links)!==null&&qt!==void 0?qt:[];for(let te=0;te<Kt.length;++te){var _t,ee,q;ce(`links.${te}.url`,(_t=Kt[te])===null||_t===void 0?void 0:_t.url,CommonValidatorFunctions.isValidUrl),Pe(`links.${te}.title`,(ee=Kt[te])===null||ee===void 0?void 0:ee.title,CommonValidatorFunctions.isNonEmptyString),Pe(`links.${te}.icon`,(q=Kt[te])===null||q===void 0?void 0:q.icon,KubernetesValidatorFunctions.isValidObjectName)}return k}constructor(k=makeValidator()){_define_property(this,"validators",void 0),this.validators=k}}class zt{async enforce(k){if(!this.validate){const Ue=new Ajv({allowUnionTypes:!0});this.validate=Ue.addSchema([commonSchema,entityMetaSchema],void 0,void 0,!0).compile(entitySchema)}if(this.validate(k)===!0)return k;const[Pe]=this.validate.errors||[];throw Pe?new Error(`Malformed envelope, ${Pe.instancePath||"<root>"} ${Pe.message}`):new Error("Malformed envelope, Unknown error")}constructor(){_define_property(this,"validate",void 0)}}function bt(G){let k=G.indexOf(":");const ce=G.indexOf("/");ce!==-1&&ce<k&&(k=-1);const Pe=k===-1?void 0:G.slice(0,k),Ue=ce===-1?void 0:G.slice(k+1,ce),We=G.slice(Math.max(k+1,ce+1));if(Pe===""||Ue===""||We==="")throw new TypeError(`Entity reference "${G}" was not on the form [<kind>:][<namespace>/]<name>`);return{kind:Pe,namespace:Ue,name:We}}function Zt(G){return{kind:G.kind,namespace:G.metadata.namespace||r,name:G.metadata.name}}function Dt(G,k){if(!G)throw new Error("Entity reference must not be empty");const ce=k==null?void 0:k.defaultKind,Pe=(k==null?void 0:k.defaultNamespace)||r;let Ue,We,St;if(typeof G=="string"){const ee=bt(G);var Ot;Ue=(Ot=ee.kind)!==null&&Ot!==void 0?Ot:ce;var qt;We=(qt=ee.namespace)!==null&&qt!==void 0?qt:Pe,St=ee.name}else{var Kt;Ue=(Kt=G.kind)!==null&&Kt!==void 0?Kt:ce;var _t;We=(_t=G.namespace)!==null&&_t!==void 0?_t:Pe,St=G.name}if(Ue)if(We){if(!St){const ee=JSON.stringify(G);throw new Error(`Entity reference ${ee} had missing or empty name`)}}else{const ee=JSON.stringify(G);throw new Error(`Entity reference ${ee} had missing or empty namespace`)}else{const ee=JSON.stringify(G);throw new Error(`Entity reference ${ee} had missing or empty kind (e.g. did not start with "component:" or similar)`)}return{kind:Ue,namespace:We,name:St}}function _e(G){let k,ce,Pe;if("metadata"in G){k=G.kind;var Ue;ce=(Ue=G.metadata.namespace)!==null&&Ue!==void 0?Ue:r,Pe=G.metadata.name}else{k=G.kind;var We;ce=(We=G.namespace)!==null&&We!==void 0?We:r,Pe=G.name}return`${k.toLocaleLowerCase("en-US")}:${ce.toLocaleLowerCase("en-US")}/${Pe.toLocaleLowerCase("en-US")}`}var lt=n(87612);class yt{async enforce(k){let ce=k;for(const Pe of this.policies){const Ue=await Pe.enforce(ce);if(!Ue)throw new Error(`Policy ${Pe.constructor.name} did not return a result`);ce=Ue}return ce}constructor(k){(0,lt._)(this,"policies",void 0),this.policies=k}}class qe{async enforce(k){for(const ce of this.policies){const Pe=await ce.enforce(k);if(Pe)return Pe}throw new Error("The entity did not match any known policy")}constructor(k){(0,lt._)(this,"policies",void 0),this.policies=k}}const Lt={allOf(G){return new yt(G)},oneOf(G){return new qe(G)}};var Vt=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","trpc"],"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 be(G){let k;return{async check(ce){return k||(k=je(G)),k(ce)===ce}}}const Ce=be(Vt);var Ke=JSON.parse('{"$schema":"http://json-schema.org/draft-07/schema","$id":"ComponentV1alpha1","description":"A Component describes a software component. It is typically intimately linked to the source code that constitutes the component, and should be what a developer may regard a \\"unit of software\\", usually with a distinct deployable or linkable artifact.","examples":[{"apiVersion":"backstage.io/v1alpha1","kind":"Component","metadata":{"name":"LoremService","description":"Creates Lorems like a pro.","labels":{"product_name":"Random value Generator"},"annotations":{"docs":"https://github.com/..../tree/develop/doc"}},"spec":{"type":"service","lifecycle":"production","owner":"tools"}}],"allOf":[{"$ref":"Entity"},{"type":"object","required":["spec"],"properties":{"apiVersion":{"enum":["backstage.io/v1alpha1","backstage.io/v1beta1"]},"kind":{"enum":["Component"]},"spec":{"type":"object","required":["type","lifecycle","owner"],"properties":{"type":{"type":"string","description":"The type of component.","examples":["service","website","library"],"minLength":1},"lifecycle":{"type":"string","description":"The lifecycle state of the component.","examples":["experimental","production","deprecated"],"minLength":1},"owner":{"type":"string","description":"An entity reference to the owner of the component.","examples":["artist-relations-team","user:john.johnson"],"minLength":1},"system":{"type":"string","description":"An entity reference to the system that the component belongs to.","minLength":1},"subcomponentOf":{"type":"string","description":"An entity reference to another component of which the component is a part.","minLength":1},"providesApis":{"type":"array","description":"An array of entity references to the APIs that are provided by the component.","items":{"type":"string","minLength":1}},"consumesApis":{"type":"array","description":"An array of entity references to the APIs that are consumed by the component.","items":{"type":"string","minLength":1}},"dependsOn":{"type":"array","description":"An array of references to other entities that the component depends on to function.","items":{"type":"string","minLength":1}}}}}}]}');const Be=be(Ke);var gt=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 xt=be(gt);var nt=JSON.parse(`{"$schema":"http://json-schema.org/draft-07/schema","$id":"GroupV1alpha1","description":"A group describes an organizational entity, such as for example a team, a business unit, or a loose collection of people in an interest group. Members of these groups are modeled in the catalog as kind User.","examples":[{"apiVersion":"backstage.io/v1alpha1","kind":"Group","metadata":{"name":"infrastructure","description":"The infra business unit"},"spec":{"type":"business-unit","profile":{"displayName":"Infrastructure","email":"infrastructure@example.com","picture":"https://example.com/groups/bu-infrastructure.jpeg"},"parent":"ops","children":["backstage","other"]}}],"allOf":[{"$ref":"Entity"},{"type":"object","required":["spec"],"properties":{"apiVersion":{"enum":["backstage.io/v1alpha1","backstage.io/v1beta1"]},"kind":{"enum":["Group"]},"spec":{"type":"object","required":["type","children"],"properties":{"type":{"type":"string","description":"The type of group. There is currently no enforced set of values for this field, so it is left up to the adopting organization to choose a nomenclature that matches their org hierarchy.","examples":["team","business-unit","product-area","root"],"minLength":1},"profile":{"type":"object","description":"Optional profile information about the group, mainly for display purposes. All fields of this structure are also optional. The email would be a group email of some form, that the group may wish to be used for contacting them. The picture is expected to be a URL pointing to an image that's representative of the group, and that a browser could fetch and render on a group page or similar.","properties":{"displayName":{"type":"string","description":"A simple display name to present to users.","examples":["Infrastructure"],"minLength":1},"email":{"type":"string","description":"An email where this entity can be reached.","examples":["infrastructure@example.com"],"minLength":1},"picture":{"type":"string","description":"The URL of an image that represents this entity.","examples":["https://example.com/groups/bu-infrastructure.jpeg"],"minLength":1}}},"parent":{"type":"string","description":"The immediate parent group in the hierarchy, if any. Not all groups must have a parent; the catalog supports multi-root hierarchies. Groups may however not have more than one parent. This field is an entity reference.","examples":["ops"],"minLength":1},"children":{"type":"array","description":"The immediate child groups of this group in the hierarchy (whose parent field points to this group). The list must be present, but may be empty if there are no child groups. The items are not guaranteed to be ordered in any particular way. The entries of this array are entity references.","items":{"type":"string","examples":["backstage","other"],"minLength":1}},"members":{"type":"array","description":"The users that are members of this group. The entries of this array are entity references.","items":{"type":"string","examples":["jdoe"],"minLength":1}}}}}}]}`);const Ye=be(nt);var Ge=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 ct=be(Ge),ut="ownedBy",ln="ownerOf",cn="consumesApi",dn="apiConsumedBy",Ht="providesApi",Sn="apiProvidedBy",Qt="dependsOn",Xt="dependencyOf",Cn="parentOf",tn="childOf",Tn="memberOf",$n="hasMember",et="partOf",nn="hasPart";var Gt=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 rt=be(Gt);var Dn=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 un=be(Dn);var Pn=JSON.parse(`{"$schema":"http://json-schema.org/draft-07/schema","$id":"UserV1alpha1","description":"A user describes a person, such as an employee, a contractor, or similar. Users belong to Group entities in the catalog. These catalog user entries are connected to the way that authentication within the Backstage ecosystem works. See the auth section of the docs for a discussion of these concepts.","examples":[{"apiVersion":"backstage.io/v1alpha1","kind":"User","metadata":{"name":"jdoe"},"spec":{"profile":{"displayName":"Jenny Doe","email":"jenny-doe@example.com","picture":"https://example.com/staff/jenny-with-party-hat.jpeg"},"memberOf":["team-b","employees"]}}],"allOf":[{"$ref":"Entity"},{"type":"object","required":["spec"],"properties":{"apiVersion":{"enum":["backstage.io/v1alpha1","backstage.io/v1beta1"]},"kind":{"enum":["User"]},"spec":{"type":"object","required":["memberOf"],"properties":{"profile":{"type":"object","description":"Optional profile information about the user, mainly for display purposes. All fields of this structure are also optional. The email would be a primary email of some form, that the user may wish to be used for contacting them. The picture is expected to be a URL pointing to an image that's representative of the user, and that a browser could fetch and render on a profile page or similar.","properties":{"displayName":{"type":"string","description":"A simple display name to present to users.","examples":["Jenny Doe"],"minLength":1},"email":{"type":"string","description":"An email where this user can be reached.","examples":["jenny-doe@example.com"],"minLength":1},"picture":{"type":"string","description":"The URL of an image that represents this user.","examples":["https://example.com/staff/jenny-with-party-hat.jpeg"],"minLength":1}}},"memberOf":{"type":"array","description":"The list of groups that the user is a direct member of (i.e., no transitive memberships are listed here). The list must be present, but may be empty if the user is not member of any groups. The items are not guaranteed to be ordered in any particular way. The entries of this array are entity references.","items":{"type":"string","examples":["team-b","employees"],"minLength":1}}}}}}]}`);const wn=be(Pn),jn="backstage.io/managed-by-location",Fn="backstage.io/managed-by-origin-location",Rn="backstage.io/source-location",Zn=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*\:/i;function Se(G){if(typeof G!="string")throw new TypeError(`Unable to parse location ref '${G}', unexpected argument ${typeof G}`);const k=G.indexOf(":");if(k<0)throw new TypeError(`Unable to parse location ref '${G}', expected '<type>:<target>', e.g. 'url:https://host/path'`);const ce=G.substring(0,k).trim(),Pe=G.substring(k+1).trim();if(!ce||!Pe)throw new TypeError(`Unable to parse location ref '${G}', expected '<type>:<target>', e.g. 'url:https://host/path'`);if(ce==="http"||ce==="https")throw new TypeError(`Invalid location ref '${G}', please prefix it with 'url:', e.g. 'url:${G}'`);if(Zn.test(Pe))throw new TypeError(`Invalid location ref '${G}', target is a javascript: URL`);return{type:ce,target:Pe}}function de(G){const{type:k,target:ce}=G;if(k){if(!ce)throw new TypeError("Unable to stringify location ref, empty target")}else throw new TypeError("Unable to stringify location ref, empty type");if(Zn.test(ce))throw new TypeError(`Invalid location ref '${k}:${ce}', target is a javascript: URL`);return`${k}:${ce}`}function Ie(G){var k,ce,Pe,Ue,We;const St=(We=(k=G.metadata)===null||k===void 0||(ce=k.annotations)===null||ce===void 0?void 0:ce[Rn])!==null&&We!==void 0?We:(Pe=G.metadata)===null||Pe===void 0||(Ue=Pe.annotations)===null||Ue===void 0?void 0:Ue[jn];if(!St)throw new Error(`Entity '${_e(G)}' is missing location`);return Se(St)}},15332:function(wt,ke,n){"use strict";n.d(ke,{r:function(){return R}});var r=n(52322),p=n(60871),z=n(86689),f=n(79692),W=n(90436),g=n(72779),u=n.n(g),N=n(76635),ge=n(2784),ue=n(73557),V=n(71597);function ne(){const[P]=(0,ue.is)((0,r.jsx)(ue.AW,{index:!0,element:(0,r.jsx)("div",{})}));return!P.index}const L=(0,f.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=P=>/^([a-z+.-]+):/.test(P),le=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*\:/i,se=window.open;if(se&&!se.__backstage){const P=function(...je){const Le=String(je[0]);if(le.test(Le))throw new Error("Rejected window.open() with a javascript: URL as a security precaution");return se.apply(this,je)};P.__backstage=!0,window.open=P}const ae=()=>{try{return(0,p.h_)(p.Ds).getOptionalString("app.baseUrl")}catch{return}},_=()=>{const P="http://sample.dev";var K;const je=(K=ae())!==null&&K!==void 0?K:"/",{pathname:Le}=new URL(je,P);return(0,N.trimEnd)(Le,"/")},H=P=>{let K=String(P);const je=_(),Le=A(K),Z=K.startsWith(je);return!Le&&!Z&&(K=je.concat(K)),K},T=P=>{if(P instanceof Array)return P.map(T).join(" ").trim();if(typeof P=="object"&&P){var K;return T(P==null||(K=P.props)===null||K===void 0?void 0:K.children)}return["string","number"].includes(typeof P)?String(P):""},R=ge.forwardRef(({onClick:P,noTrack:K,...je},Le)=>{const Z=L(),Xe=(0,p.z$)(),at=ne()?H(je.to):je.to,Rt=T(je.children)||at,zt=A(at),bt=zt&&!!/^https?:/.exec(at);if(le.test(at))throw new Error("Link component rejected javascript: URL as a security precaution");const Zt=Dt=>{P==null||P(Dt),K||Xe.captureEvent("click",Rt,{attributes:{to:at}})};return zt?(0,r.jsxs)(z.Z,{...bt?{target:"_blank",rel:"noopener"}:{},...je,...je["aria-label"]?{"aria-label":`${je["aria-label"]}, Opens in a new window`}:{},ref:Le,href:at,onClick:Zt,className:u()(Z.externalLink,je.className),children:[je.children,(0,r.jsx)(W.Z,{component:"span",className:Z.visuallyHidden,children:", Opens in a new window"})]}):(0,r.jsx)(z.Z,{...je,ref:Le,component:V.rU,to:at,onClick:Zt})})},53974:function(wt,ke,n){"use strict";n.d(ke,{Oi:function(){return je},VY:function(){return Ks},yW:function(){return qi},XF:function(){return at},mn:function(){return Xt},NX:function(){return yt},ub:function(){return Zn},mf:function(){return Qa},yu:function(){return st},h4:function(){return ka},M6:function(){return Hr},i9:function(){return al},aR:function(){return Ys},rJ:function(){return Ir},Oh:function(){return pl},hu:function(){return dl},rU:function(){return ue.r},Qj:function(){return ne},nU:function(){return Je},SA:function(){return Br},sk:function(){return We},Or:function(){return Dr},T3:function(){return Ba},g9:function(){return ml},Ex:function(){return vo},Gk:function(){return Yt},tn:function(){return Js},Ph:function(){return Ao},YE:function(){return Ai},v7:function(){return Ta},R6:function(){return Bi},tR:function(){return ji},uw:function(){return Hi},qt:function(){return pi},iA:function(){return Wt},GB:function(){return dt},po:function(){return br},mZ:function(){return ts},Pf:function(){return Po}});var r=n(52322),p=n(60871),z=n(19928),f=n(2784);function W(e){const[o,l]=useState([]),d=useApi(alertApiRef),{anchorOrigin:m={vertical:"top",horizontal:"center"},transientTimeoutMs:y}=e,I=y!=null?y:5e3;useEffect(()=>{const U=d.alert$().subscribe(fe=>l(pe=>pe.concat(fe)));return()=>{U.unsubscribe()}},[d]);const[$]=o;if(useEffect(()=>{if($&&$.display==="transient"){const U=setTimeout(()=>{l(fe=>{const pe=fe.filter(Te=>Te!==$);return pe.length===fe.length?fe:pe})},I);return()=>clearTimeout(U)}},[$,I]),o.length===0)return null;const J=()=>{l(U=>U.filter(fe=>fe!==$))};return _jsx(Snackbar,{open:!0,anchorOrigin:m,children:_jsx(Alert,{action:_jsx(IconButton,{color:"inherit",size:"small",onClick:J,"data-testid":"error-button-close",children:_jsx(CloseIcon,{})}),severity:$.severity,children:_jsxs(Typography,{component:"span",children:[String($.message),o.length>1&&_jsx("em",{children:` (${o.length-1} older ${pluralize("message",o.length-1)})`})]})})})}var g=n(79692);const u=(0,g.Z)(e=>({avatar:{width:"4rem",height:"4rem",color:e.palette.common.white},avatarText:{fontWeight:e.typography.fontWeightBold,letterSpacing:"1px",textTransform:"uppercase"}}),{name:"BackstageAvatar"});function N(e){const{displayName:o,picture:l,customStyles:d}=e,m=u();let y={...d};const I={fontFamily:y.fontFamily,fontSize:y.fontSize,fontWeight:y.fontWeight};return l||(y={backgroundColor:stringToColor(o||""),...d}),_jsx(MaterialAvatar,{alt:o,src:l,className:m.avatar,style:y,children:o&&_jsx(Typography,{variant:"h6",component:"span",className:m.avatarText,style:I,children:extractInitials(o)})})}var ge=n(77277),ue=n(15332);const V=f.forwardRef((e,o)=>(0,r.jsx)(ue.r,{ref:o,...e,color:"initial"})),ne=f.forwardRef((e,o)=>(0,r.jsx)(ge.Z,{ref:o,component:V,...e})),L=null;var A=n(95544),le=n(60364),se=n(83229),ae=n(26639),_=n(39595),H=n(61837),T=n(80030),R=n(19353),P=n(95074);function K(e){const{text:o,tooltipDelay:l=1e3,tooltipText:d="Text copied to clipboard","aria-label":m="Copy text"}=e,y=(0,p.h_)(p.VE),[I,$]=(0,f.useState)(!1),[{error:J},U]=(0,P.Z)();(0,f.useEffect)(()=>{J&&y.post(J)},[J,y]);const fe=pe=>{pe.stopPropagation(),$(!0),U(o)};return(0,r.jsx)(r.Fragment,{children:(0,r.jsx)(T.ZP,{id:"copy-test-tooltip",title:d,placement:"top",leaveDelay:l,onClose:()=>$(!1),open:I,children:(0,r.jsx)(H.Z,{onClick:fe,"aria-label":m,children:(0,r.jsx)(R.Z,{})})})})}function je(e){const{text:o,language:l,showLineNumbers:d=!1,highlightedNumbers:m,customStyle:y,showCopyCodeButton:I=!1}=e,$=(0,le.Z)(),J=$.palette.type==="dark"?ae.Z:_.Z,U=$.palette.type==="dark"?"#256bf3":"#e6ffed";return(0,r.jsxs)(A.Z,{position:"relative",children:[(0,r.jsx)(se.Z,{customStyle:y,language:l,style:J,showLineNumbers:d,wrapLines:!0,lineNumberStyle:{color:$.palette.textVerySubtle},lineProps:fe=>m!=null&&m.includes(fe)?{style:{backgroundColor:U}}:{},children:o}),I&&(0,r.jsx)(A.Z,{position:"absolute",top:0,right:0,children:(0,r.jsx)(K,{text:o})})]})}var Le=n(41156),Z=n(71597),Xe=n(88188);function at(e){const{title:o,to:l}=e,d=(0,Le.Z)(m=>m.breakpoints.down("xs"));return l?d?(0,r.jsx)(H.Z,{component:Z.rU,color:"primary",title:o,size:"small",to:l,children:(0,r.jsx)(Xe.Z,{})}):(0,r.jsx)(ge.Z,{component:Z.rU,variant:"contained",color:"primary",to:l,children:o}):null}var Rt=n(27397),zt=n(11105),bt=n(97963),Zt=n(46506),Dt=n.n(Zt),_e=n(54073),lt=n.n(_e),yt;(function(e){let o;(function(y){y.TOP_BOTTOM="TB",y.BOTTOM_TOP="BT",y.LEFT_RIGHT="LR",y.RIGHT_LEFT="RL"})(o=e.Direction||(e.Direction={}));let l;(function(y){y.UP_LEFT="UL",y.UP_RIGHT="UR",y.DOWN_LEFT="DL",y.DOWN_RIGHT="DR"})(l=e.Alignment||(e.Alignment={}));let d;(function(y){y.NETWORK_SIMPLEX="network-simplex",y.TIGHT_TREE="tight-tree",y.LONGEST_PATH="longest-path"})(d=e.Ranker||(e.Ranker={}));let m;(function(y){y.LEFT="l",y.RIGHT="r",y.CENTER="c"})(m=e.LabelPosition||(e.LabelPosition={}))})(yt||(yt={}));var qe=n(10368);const Lt=(0,g.Z)(e=>({node:{fill:e.palette.primary.light,stroke:e.palette.primary.light},text:{fill:e.palette.primary.contrastText}}),{name:"BackstageDependencyGraphDefaultNode"});function Vt({node:{id:e}}){const o=Lt(),[l,d]=f.useState(0),[m,y]=f.useState(0),I=f.useRef(null);f.useLayoutEffect(()=>{if(I.current){let{height:fe,width:pe}=I.current.getBBox();fe=Math.round(fe),pe=Math.round(pe),(fe!==m||pe!==l)&&(d(pe),y(fe))}},[l,m]);const $=10,J=l+$*2,U=m+$*2;return(0,r.jsxs)("g",{children:[(0,r.jsx)("rect",{className:o.node,width:J,height:U,rx:10}),(0,r.jsx)("text",{ref:I,className:o.text,y:U/2,x:J/2,textAnchor:"middle",alignmentBaseline:"middle",children:e})]})}const be="arrow-marker",Ce="node",Ke="edge",Be="label",gt=(0,qe.Z)(e=>({node:{transition:`${e.transitions.duration.shortest}ms`}}),{name:"BackstageDependencyGraphNode"}),xt=e=>(0,r.jsx)(Vt,{...e});function nt({render:e=xt,setNode:o,node:l}){const{width:d,height:m,x:y=0,y:I=0}=l,$=l,J=gt(),U=f.useRef(null);return f.useLayoutEffect(()=>{if(U.current){let{height:fe,width:pe}=U.current.getBBox();fe=Math.round(fe),pe=Math.round(pe),(fe!==m||pe!==d)&&o(l.id,{...l,height:fe,width:pe})}},[l,d,m,o]),(0,r.jsx)("g",{ref:U,"data-testid":Ce,className:J.node,transform:`translate(${y-d/2},${I-m/2})`,children:e({node:$})})}var Ye=n(76985),Ge=n(39829),ct=n(19574),ut=n.n(ct);const ln=(0,qe.Z)(e=>({text:{fill:e.palette.textContrast}}),{name:"BackstageDependencyGraphDefaultLabel"});function cn({edge:{label:e}}){const o=ln();return(0,r.jsx)("text",{className:o.text,textAnchor:"middle",children:e})}const dn=(0,qe.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"}),Ht=e=>(0,r.jsx)(cn,{...e});function Sn({render:e=Ht,setEdge:o,id:l,edge:d,curve:m}){const{x:y=0,y:I=0,width:$,height:J,points:U}=d,fe=d,pe=dn(),Te=f.useRef(null);f.useLayoutEffect(()=>{if(Te.current){let{height:it,width:It}=Te.current.getBBox();it=Math.round(it),It=Math.round(It),(it!==J||It!==$)&&o(l,{...d,height:it,width:It})}},[d,J,$,o,l]);let Ee="";const Ze=f.useMemo(()=>Ye.Z().x(it=>it.x).y(it=>it.y).curve(Ge[m]),[m]);if(U){const it=U.filter(It=>ut()(It.x)&&ut()(It.y));Ee=Ze(it)||""}return(0,r.jsxs)(r.Fragment,{children:[Ee&&(0,r.jsx)("path",{"data-testid":Ke,className:pe.path,d:Ee}),fe.label?(0,r.jsx)("g",{ref:Te,"data-testid":Be,className:pe.label,transform:`translate(${y},${I})`,children:e({edge:fe})}):null]})}const Qt="workspace";function Xt(e){var o,l;const{edges:d,nodes:m,renderNode:y,direction:I=yt.Direction.TOP_BOTTOM,align:$,nodeMargin:J=50,edgeMargin:U=10,rankMargin:fe=50,paddingX:pe=0,paddingY:Te=0,acyclicer:Ee,ranker:Ze=yt.Ranker.NETWORK_SIMPLEX,labelPosition:it=yt.LabelPosition.RIGHT,labelOffset:It=10,edgeRanks:pn=1,edgeWeight:Bn=1,renderLabel:or,defs:$t,zoom:fn="enabled",curve:gn="curveMonotoneX",fit:pr="grow",...Cr}=e,wr=(0,bt.Z)(),[jr,ms]=f.useState(100),[to,sa]=f.useState(100),an=f.useRef(new(Dt()).graphlib.Graph),[Bo,_s]=f.useState(((o=an.current.graph())===null||o===void 0?void 0:o.width)||0),[no,ia]=f.useState(((l=an.current.graph())===null||l===void 0?void 0:l.height)||0),[Vn,kr]=f.useState([]),[po,fo]=f.useState([]),En=Math.max(Bo,jr),On=Math.max(no,to),$o=Math.min(no,to),go=pr==="grow"?On:$o,vs=f.useMemo(()=>lt()(In=>{if(!In)return;const Hn=zt.Z(In),An=zt.Z(In.getElementById(Qt));function Er(){Hn.call(Rt.sP().scaleExtent([1,10]).on("zoom",Wr=>{Wr.transform.x=Math.min(0,Math.max(Wr.transform.x,En-En*Wr.transform.k)),Wr.transform.y=Math.min(0,Math.max(Wr.transform.y,On-On*Wr.transform.k)),An.attr("transform",Wr.transform)}))}fn==="enabled"?Er():fn==="enable-on-click"&&Hn.on("click",()=>Er());const{width:Ar,height:ei}=In.getBoundingClientRect();jr!==Ar&&ms(Ar),to!==ei&&sa(ei)},100),[to,jr,En,On,fn]),Ma=f.useCallback(()=>{const In=an.current.nodes(),Hn=an.current.edges();In.forEach(An=>{m.some(Ar=>Ar.id===An)||an.current.removeNode(An)}),Hn.forEach(An=>{d.some(Ar=>Ar.from===An.v&&Ar.to===An.w)||an.current.removeEdge(An.v,An.w)}),m.forEach(An=>{const Er=an.current.nodes().find(Ar=>An.id===Ar);if(Er&&an.current.node(Er)){const{width:Ar,height:ei,x:Wr,y:$l}=an.current.node(Er);an.current.setNode(Er,{...An,width:Ar,height:ei,x:Wr,y:$l})}else an.current.setNode(An.id,{...An,width:0,height:0})}),d.forEach(An=>{an.current.setEdge(An.from,An.to,{...An,label:An.label,width:0,height:0,labelpos:it,labeloffset:It,weight:Bn,minlen:pn})})},[d,m,it,It,Bn,pn]),ys=f.useMemo(()=>lt()(()=>{Dt().layout(an.current);const{height:In,width:Hn}=an.current.graph(),An=Math.max(0,In||0),Er=Math.max(0,Hn||0);_s(Er),ia(An),kr(an.current.nodes()),fo(an.current.edges())},250,{leading:!0}),[]);f.useEffect(()=>(an.current.setGraph({rankdir:I,align:$,nodesep:J,edgesep:U,ranksep:fe,marginx:pe,marginy:Te,acyclicer:Ee,ranker:Ze}),Ma(),ys(),ys.cancel),[Ee,$,I,U,pe,Te,J,fe,Ze,Ma,ys]);function kl(In,Hn){return an.current.setNode(In,Hn),ys(),an.current}function Bl(In,Hn){return an.current.setEdge(In,Hn),ys(),an.current}return(0,r.jsxs)("svg",{ref:vs,...Cr,width:"100%",height:go,viewBox:`0 0 ${En} ${On}`,children:[(0,r.jsxs)("defs",{children:[(0,r.jsx)("marker",{id:be,viewBox:"0 0 24 24",markerWidth:"14",markerHeight:"14",refX:"16",refY:"12",orient:"auto",markerUnits:"strokeWidth",children:(0,r.jsx)("path",{fill:wr.palette.textSubtle,d:"M8.59 16.59L13.17 12 8.59 7.41 10 6l6 6-6 6-1.41-1.41z"})}),$t]}),(0,r.jsx)("g",{id:Qt,children:(0,r.jsxs)("svg",{width:Bo,height:no,y:On/2-no/2,x:En/2-Bo/2,viewBox:`0 0 ${Bo} ${no}`,children:[po.map(In=>{const Hn=an.current.edge(In);return Hn?(0,r.jsx)(Sn,{id:In,setEdge:Bl,render:or,edge:Hn,curve:gn},`${In.v}-${In.w}`):null}),Vn.map(In=>{const Hn=an.current.node(In);return Hn?(0,r.jsx)(nt,{setNode:kl,render:y,node:Hn},In):null})]})})]})}var Cn=n(72779),tn=n.n(Cn),Tn,$n;const et=(0,g.Z)(e=>({root:{padding:e.spacing(0),marginBottom:e.spacing(0),marginTop:e.spacing(0),display:"flex",flexFlow:"row nowrap"},topPosition:{position:"relative",marginBottom:e.spacing(6),marginTop:-e.spacing(3),zIndex:"unset"},icon:{fontSize:e.typography.h6.fontSize},content:{width:"100%",maxWidth:"inherit",flexWrap:"nowrap",color:e.palette.banner.text},message:{display:"flex",alignItems:"center","& a":{color:e.palette.banner.link}},button:{color:(Tn=e.palette.banner.closeButtonColor)!==null&&Tn!==void 0?Tn:"inherit"},info:{backgroundColor:e.palette.banner.info},error:{backgroundColor:e.palette.banner.error},warning:{backgroundColor:($n=e.palette.banner.warning)!==null&&$n!==void 0?$n:e.palette.banner.error}}),{name:"BackstageDismissableBanner"}),nn=e=>{const{variant:o,message:l,id:d,fixed:m=!1}=e,y=et(),$=useApi(storageApiRef).forBucket("notifications");var J;const U=(J=$.snapshot("dismissedBanners").value)!==null&&J!==void 0?J:[],[fe,pe]=useState(new Set(U)),Te=useObservable($.observe$("dismissedBanners"));useEffect(()=>{if(Te!=null&&Te.value){var Ze;const it=(Ze=Te==null?void 0:Te.value)!==null&&Ze!==void 0?Ze:[];pe(new Set(it))}},[Te==null?void 0:Te.value]);const Ee=()=>{$.set("dismissedBanners",[...fe,d])};return _jsx(Snackbar,{anchorOrigin:m?{vertical:"bottom",horizontal:"center"}:{vertical:"top",horizontal:"center"},open:!fe.has(d),classes:{root:classNames(y.root,!m&&y.topPosition)},children:_jsx(SnackbarContent,{classes:{root:classNames(y.content,y[o]),message:y.message},message:l,action:[_jsx(IconButton,{title:"Permanently dismiss this message",className:y.button,onClick:Ee,children:_jsx(Close,{className:y.icon})},"dismiss")]})})};var Gt=n(60905),rt=n(90436),Dn=n.p+"static/missingAnnotation.67f79e98..svg",un=n.p+"static/noInformation.4b426325..svg",Pn=n.p+"static/createComponent.975d1e1e..svg",wn=n.p+"static/noBuild.1715fa71..svg";const jn=(0,g.Z)({generalImg:{width:"95%",zIndex:2,position:"relative",left:"50%",top:"50%",transform:"translate(-50%, 15%)"}},{name:"BackstageEmptyStateImage"}),Fn=({missing:e})=>{const o=jn();switch(e){case"field":return(0,r.jsx)("img",{src:Dn,className:o.generalImg,alt:"annotation is missing"});case"info":return(0,r.jsx)("img",{src:un,alt:"no Information",className:o.generalImg});case"content":return(0,r.jsx)("img",{src:Pn,alt:"create Component",className:o.generalImg});case"data":return(0,r.jsx)("img",{src:wn,alt:"no Build",className:o.generalImg});default:return null}},Rn=(0,g.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 Zn(e){const{title:o,description:l,missing:d,action:m}=e,y=Rn();return(0,r.jsxs)(Gt.Z,{container:!0,direction:"row",justifyContent:"space-around",alignItems:"flex-start",className:y.root,spacing:2,children:[(0,r.jsx)(Gt.Z,{item:!0,xs:12,md:6,children:(0,r.jsxs)(Gt.Z,{container:!0,direction:"column",children:[(0,r.jsx)(Gt.Z,{item:!0,xs:!0,children:(0,r.jsx)(rt.Z,{variant:"h5",children:o})}),(0,r.jsx)(Gt.Z,{item:!0,xs:!0,children:(0,r.jsx)(rt.Z,{variant:"body1",children:l})}),(0,r.jsx)(Gt.Z,{item:!0,xs:!0,className:y.action,children:m})]})}),(0,r.jsx)(Gt.Z,{item:!0,xs:12,md:6,className:y.imageContainer,children:typeof d=="string"?(0,r.jsx)(Fn,{missing:d}):d.customImage})]})}const Se=`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`,de=/^.*ANNOTATION.*$/m,Ie=Se.match(de)[0],G=Se.split(`
|
|
12
|
-
`).findIndex(e=>de.test(e)),k=(0,g.Z)(e=>({code:{borderRadius:6,margin:`${e.spacing(2)}px 0px`,background:e.palette.type==="dark"?"#444":e.palette.common.white}}),{name:"BackstageMissingAnnotationEmptyState"});function ce(e){return Array.from(Array(e+1).keys(),o=>o+G)}function Pe(e){const o=e.map(l=>Ie.replace("ANNOTATION",l)).join(`
|
|
13
|
-
`);return Se.replace(Ie,o)}function Ue(e){const o=e.length<=1;return(0,r.jsxs)(r.Fragment,{children:["The ",o?"annotation":"annotations"," ",e.map(l=>(0,r.jsx)("code",{children:l})).reduce((l,d)=>(0,r.jsxs)(r.Fragment,{children:[l,", ",d]}))," ",o?"is":"are"," missing. You need to add the"," ",o?"annotation":"annotations"," to your component if you want to enable this tool."]})}function We(e){const{annotation:o,readMoreUrl:l}=e,d=Array.isArray(o)?o:[o],m=l||"https://backstage.io/docs/features/software-catalog/well-known-annotations",y=k();return(0,r.jsx)(Zn,{missing:"field",title:"Missing Annotation",description:Ue(d),action:(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(rt.Z,{variant:"body1",children:"Add the annotation to your component YAML as shown in the highlighted example below:"}),(0,r.jsx)(A.Z,{className:y.code,children:(0,r.jsx)(je,{text:Pe(d),language:"yaml",showLineNumbers:!0,highlightedNumbers:ce(d.length),customStyle:{background:"inherit",fontSize:"115%"}})}),(0,r.jsx)(ge.Z,{color:"primary",component:ue.r,to:m,children:"Read more"})]})})}var St=n(11776),Ot=n(38402),qt=n(49378),Kt=n(41128),_t=n(27616),ee=n(8284),q=n(70660),te=n(91750),v=n(38016);const O=(e,o)=>(o.palette.type==="light"?Kt._j:Kt.$n)(o.palette[e].light,.6),Q=(e,o)=>(o.palette.type==="light"?Kt.$n:Kt._j)(o.palette[e].light,.9),M=(0,g.Z)(e=>({root:{marginRight:e.spacing(1),fill:({severity:o})=>O(o,e)}})),he=({severity:e})=>{const o=M({severity:e});return(0,r.jsx)(te.Z,{classes:o})},ye=({severity:e})=>{const o=M({severity:e});return(0,r.jsx)(v.Z,{classes:o})},Me=(0,g.Z)(e=>({panel:{backgroundColor:({severity:o})=>Q(o,e),color:({severity:o})=>O(o,e),verticalAlign:"middle"},summary:{display:"flex",flexDirection:"row"},summaryText:{color:({severity:o})=>O(o,e),fontWeight:e.typography.fontWeightBold},message:{width:"100%",display:"block",color:({severity:o})=>O(o,e),backgroundColor:({severity:o})=>Q(o,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"}),ot=e=>e.charAt(0).toLocaleUpperCase("en-US")+e.slice(1);function dt(e){const{severity:o="warning",title:l,message:d,children:m,defaultExpanded:y}=e,I=Me({severity:o}),$=ot(o)+(l?`: ${l}`:"");return(0,r.jsxs)(_t.Z,{defaultExpanded:y!=null?y:!1,className:I.panel,role:"alert",children:[(0,r.jsxs)(ee.Z,{expandIcon:(0,r.jsx)(ye,{severity:o}),className:I.summary,children:[(0,r.jsx)(he,{severity:o}),(0,r.jsx)(rt.Z,{className:I.summaryText,variant:"subtitle1",children:$})]}),(d||m)&&(0,r.jsx)(q.Z,{children:(0,r.jsxs)(Gt.Z,{container:!0,children:[d&&(0,r.jsx)(Gt.Z,{item:!0,xs:12,children:(0,r.jsx)(rt.Z,{className:I.message,variant:"body1",children:d})}),m&&(0,r.jsx)(Gt.Z,{item:!0,xs:12,className:I.details,children:m})]})})]})}const At=(0,g.Z)(e=>({text:{fontFamily:"monospace",whiteSpace:"pre",overflowX:"auto",marginRight:e.spacing(2)},divider:{margin:e.spacing(2)}}),{name:"BackstageErrorPanel"}),jt=({error:e,message:o,stack:l,children:d})=>{const m=At();return(0,r.jsxs)(St.Z,{dense:!0,children:[(0,r.jsxs)(Ot.Z,{alignItems:"flex-start",children:[(0,r.jsx)(qt.Z,{classes:{secondary:m.text},primary:"Error",secondary:e}),(0,r.jsx)(K,{text:e})]}),(0,r.jsxs)(Ot.Z,{alignItems:"flex-start",children:[(0,r.jsx)(qt.Z,{classes:{secondary:m.text},primary:"Message",secondary:o}),(0,r.jsx)(K,{text:o})]}),l&&(0,r.jsxs)(Ot.Z,{alignItems:"flex-start",children:[(0,r.jsx)(qt.Z,{classes:{secondary:m.text},primary:"Stack Trace",secondary:l}),(0,r.jsx)(K,{text:l})]}),d]})};function st(e){const{title:o,error:l,defaultExpanded:d,children:m}=e;return(0,r.jsx)(dt,{severity:"error",title:o!=null?o:l.message,defaultExpanded:d,children:(0,r.jsx)(jt,{error:l.name,message:l.message,stack:l.stack,children:m})})}var Fe=n(85256);const Ut=(0,g.Z)(e=>({text:{fontFamily:"monospace",whiteSpace:"pre",overflowX:"auto",marginRight:e.spacing(2)},divider:{margin:e.spacing(2)}}),{name:"BackstageResponseErrorPanel"});function Yt(e){var o;const{title:l,error:d,defaultExpanded:m}=e,y=Ut();if(d.name!=="ResponseError")return(0,r.jsx)(st,{title:l!=null?l:d.message,defaultExpanded:m,error:d});const{body:I,cause:$}=d,{request:J,response:U}=I,fe=`${U.statusCode}: ${$.name}`,pe=J&&`${J.method} ${J.url}`,Te=$.message.replace(/\\n/g,`
|
|
14
|
-
`),Ee=(o=$.stack)===null||o===void 0?void 0:o.replace(/\\n/g,`
|
|
15
|
-
`),Ze=JSON.stringify(I,void 0,2);return(0,r.jsxs)(st,{title:l!=null?l:d.message,defaultExpanded:m,error:{name:fe,message:Te,stack:Ee},children:[pe&&(0,r.jsxs)(Ot.Z,{alignItems:"flex-start",children:[(0,r.jsx)(qt.Z,{classes:{secondary:y.text},primary:"Request",secondary:J?`${pe}`:void 0}),(0,r.jsx)(K,{text:pe})]}),(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(Fe.Z,{component:"li",className:y.divider}),(0,r.jsx)(Ot.Z,{alignItems:"flex-start",children:(0,r.jsx)(qt.Z,{classes:{secondary:y.text},primary:"Full Error as JSON"})}),(0,r.jsx)(je,{language:"json",text:Ze,showCopyCodeButton:!0})]})]})}var Ct=n(28316);function Nt(e){const o=document.createElement("div");return o.setAttribute("id",e),o}function hn(e){document.body.insertBefore(e,document.body.lastElementChild.nextElementSibling)}function yn(e){const o=useRef(null);useEffect(function(){const m=document.querySelector(`#${e}`),y=m||Nt(e);return m||hn(y),y.appendChild(o.current),function(){o.current.remove(),y.childNodes.length===-1&&y.remove()}},[e]);function l(){return o.current||(o.current=document.createElement("div")),o.current}return l()}var mt=null;const He="core.calloutSeen";function Pt(){const[e,o]=useState(()=>{const d=localStorage.getItem(He);return d?JSON.parse(d):{}}),l=useCallback((d,m)=>{const y=localStorage.getItem(He),$={...y?JSON.parse(y):{},[d]:m};o($),localStorage.setItem(He,JSON.stringify($))},[]);return{states:e,setState:l}}function mn(e){const{states:o,setState:l}=Pt(),d=useCallback(()=>{l(e,!0)},[l,e]);return{seen:o[e]===!0,markSeen:d}}function en(e){const{seen:o,markSeen:l}=mn(e);return{show:o===!1,hide:l}}const sr=(0,g.Z)(e=>({"@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 ${e.palette.common.white}`,zIndex:2001,transformOrigin:"center center",animation:"$pulsateAndFade 872ms 1.2s cubic-bezier(0.4, 0, 0.2, 1) infinite"},text:{position:"absolute",color:e.palette.common.white,zIndex:2003}}),{name:"BackstageFeatureCalloutCircular"});function fr(e){const{featureId:o,title:l,description:d,children:m}=e,{show:y,hide:I}=useShowCallout(o),$=usePortal("core.callout"),J=useRef(null),[U,fe]=useState(),pe=sr(),Te=useCallback(()=>{if(J.current){const Ee=J.current.getBoundingClientRect(),Ze=Math.max(Ee.width,Ee.height),it=800,It=Ee.x-(Ze-Ee.width)/2-it,pn=Ee.y-(Ze-Ee.height)/2-it,Bn=Ze+2*it,or=450,$t=Ee.x+Ee.width/2-or,fn=Ee.y-(Ze-Ee.height)/2+Ze+20;fe({dotLeft:It,dotTop:pn,dotSize:Bn,borderWidth:it,textTop:fn,textLeft:$t,textWidth:or})}},[]);return useEffect(()=>(window.addEventListener("resize",Te),window.addEventListener("scroll",Te),()=>{window.removeEventListener("resize",Te),window.removeEventListener("scroll",Te)}),[Te]),useLayoutEffect(Te,[J.current,Te]),y?_jsxs(_Fragment,{children:[_jsx(Box,{className:pe.featureWrapper,ref:J,children:m}),createPortal(_jsx(Box,{className:pe.backdrop,children:_jsx(ClickAwayListener,{onClickAway:I,children:_jsxs(_Fragment,{children:[_jsx(Box,{className:pe.dot,"data-testid":"dot",style:{left:U==null?void 0:U.dotLeft,top:U==null?void 0:U.dotTop,width:U==null?void 0:U.dotSize,height:U==null?void 0:U.dotSize,borderWidth:U==null?void 0:U.borderWidth},onClick:I,onKeyDown:I,role:"button",tabIndex:0,children:_jsx(Box,{className:pe.pulseCircle})}),_jsxs(Box,{className:pe.text,"data-testid":"text",style:{left:U==null?void 0:U.textLeft,top:U==null?void 0:U.textTop,width:U==null?void 0:U.textWidth},children:[_jsx(Typography,{variant:"h2",paragraph:!0,children:l}),_jsx(Typography,{children:d})]})]})})}),$)]}):_jsx(_Fragment,{children:m})}var Gn=n(35292);const sn=(0,g.Z)(e=>({link:{display:"grid",justifyItems:"center",gridGap:4,textAlign:"center"},disabled:{color:e.palette.text.secondary,cursor:"default"},primary:{color:e.palette.primary.main},secondary:{color:e.palette.secondary.main},label:{textTransform:"uppercase",fontWeight:e.typography.fontWeightBold,letterSpacing:1.2}}),{name:"BackstageIconLinkVertical"});function ir({color:e="primary",disabled:o=!1,href:l="#",icon:d=(0,r.jsx)(Gn.Z,{}),label:m,onClick:y,title:I}){const $=sn();return o?(0,r.jsxs)(A.Z,{title:I,className:tn()($.link,$.disabled),children:[d,(0,r.jsx)(rt.Z,{variant:"caption",component:"span",className:$.label,children:m})]}):(0,r.jsxs)(ue.r,{title:I,className:tn()($.link,$[e]),to:l,onClick:y,children:[d,(0,r.jsx)(rt.Z,{variant:"caption",component:"span",className:$.label,children:m})]})}const Vr=(0,g.Z)(e=>({links:{margin:e.spacing(2,0),display:"grid",gridAutoFlow:"column",gridAutoColumns:"min-content",gridGap:e.spacing(3)}}),{name:"BackstageHeaderIconLinkRow"});function Hr(e){const{links:o}=e,l=Vr();return(0,r.jsx)("nav",{className:l.links,children:o.map((d,m)=>(0,r.jsx)(ir,{...d},m+1))})}const Kn=e=>{const o=e==="dark"?"16%":"97%";return`
|
|
16
|
-
hsl(0, 0%, ${o}) 0%,
|
|
17
|
-
hsla(0, 0%, ${o}, 0.987) 8.1%,
|
|
18
|
-
hsla(0, 0%, ${o}, 0.951) 15.5%,
|
|
19
|
-
hsla(0, 0%, ${o}, 0.896) 22.5%,
|
|
20
|
-
hsla(0, 0%, ${o}, 0.825) 29%,
|
|
21
|
-
hsla(0, 0%, ${o}, 0.741) 35.3%,
|
|
22
|
-
hsla(0, 0%, ${o}, 0.648) 41.2%,
|
|
23
|
-
hsla(0, 0%, ${o}, 0.55) 47.1%,
|
|
24
|
-
hsla(0, 0%, ${o}, 0.45) 52.9%,
|
|
25
|
-
hsla(0, 0%, ${o}, 0.352) 58.8%,
|
|
26
|
-
hsla(0, 0%, ${o}, 0.259) 64.7%,
|
|
27
|
-
hsla(0, 0%, ${o}, 0.175) 71%,
|
|
28
|
-
hsla(0, 0%, ${o}, 0.104) 77.5%,
|
|
29
|
-
hsla(0, 0%, ${o}, 0.049) 84.5%,
|
|
30
|
-
hsla(0, 0%, ${o}, 0.013) 91.9%,
|
|
31
|
-
hsla(0, 0%, ${o}, 0) 100%
|
|
32
|
-
`},Tr=100,S=10,c=(0,g.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:Tr,height:`calc(100% + ${S}px)`,transition:"opacity 300ms",pointerEvents:"none"},fadeLeft:{left:-S,background:`linear-gradient(90deg, ${Kn(e.palette.type)})`},fadeRight:{right:-S,background:`linear-gradient(270deg, ${Kn(e.palette.type)})`},fadeHidden:{opacity:0},button:{position:"absolute"},buttonLeft:{left:-e.spacing(2)},buttonRight:{right:-e.spacing(2)}}),{name:"BackstageHorizontalScrollGrid"});function b(e){const[[o,l],d]=React.useState([0,0]);return React.useLayoutEffect(()=>{const m=e.current;if(!m){d([0,0]);return}const y=()=>{const I=m.scrollLeft,$=m.scrollWidth-m.offsetWidth-m.scrollLeft;d([I,$])};return y(),m.addEventListener("scroll",y),window.addEventListener("resize",y),()=>{m.removeEventListener("scroll",y),window.removeEventListener("resize",y)}},[e]),[o,l]}function j(e,o,l){const[d,m]=React.useState(0);return React.useLayoutEffect(()=>{if(d===0)return;const y=window.performance.now(),I=requestAnimationFrame($=>{if(!e.current)return;const J=$-y,U=Math.abs(d)*J/o,pe=Math.max(l,U)*Math.sign(d);e.current.scrollBy({left:pe});const Te=d-pe;Math.sign(d)!==Math.sign(Te)?m(0):m(Te)});return()=>cancelAnimationFrame(I)},[e,d,o,l]),m}function Y(e){const{scrollStep:o=100,scrollSpeed:l=50,minScrollDistance:d=5,children:m,...y}=e,I=c(e),$=React.useRef(),[J,U]=b($),fe=j($,l,d),pe=Te=>{$.current&&fe(Te?o:-o)};return _jsxs(Box,{...y,className:I.root,children:[_jsx(Grid,{container:!0,direction:"row",wrap:"nowrap",className:I.container,ref:$,children:m}),_jsx(Box,{className:classNames(I.fade,I.fadeLeft,{[I.fadeHidden]:J===0})}),_jsx(Box,{className:classNames(I.fade,I.fadeRight,{[I.fadeHidden]:U===0})}),J>0&&_jsx(IconButton,{title:"Scroll Left",onClick:()=>pe(!1),className:classNames(I.button,I.buttonLeft,{}),children:_jsx(ChevronLeftIcon,{})}),U>0&&_jsx(IconButton,{title:"Scroll Right",onClick:()=>pe(!0),className:classNames(I.button,I.buttonRight,{}),children:_jsx(ChevronRightIcon,{})})]})}const me=(0,g.Z)(e=>({alpha:{color:e.palette.common.white,fontFamily:"serif",fontWeight:"normal",fontStyle:"italic"},beta:{color:"#4d65cc",fontFamily:"serif",fontWeight:"normal",fontStyle:"italic"}}),{name:"BackstageLifecycle"});function we(e){const o=me(e),{shorthand:l,alpha:d}=e;return l?_jsx(Typography,{component:"span",className:o[d?"alpha":"beta"],style:{fontSize:"120%"},children:d?_jsx(_Fragment,{children:"\u03B1"}):_jsx(_Fragment,{children:"\u03B2"})}):_jsx(Typography,{component:"span",className:o[d?"alpha":"beta"],children:d?"Alpha":"Beta"})}const Ne=(0,f.lazy)(()=>Promise.all([n.e(1049),n.e(6051)]).then(n.bind(n,76051)).then(e=>({default:e.RealLogViewer})));function Je(e){const{Progress:o}=(0,p.qD)().getComponents();return(0,r.jsx)(f.Suspense,{fallback:(0,r.jsx)(o,{}),children:(0,r.jsx)(Ne,{...e})})}var Mt=n(28865),xn=n(60251);const Yn=(0,g.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"}),ar=(e,o)=>o?typeof o=="string"?e+o:f.Children.toArray(o.props.children).reduce(ar,e):e,gr=({level:e,children:o})=>{const m=f.Children.toArray(o).reduce(ar,"").toLocaleLowerCase("en-US").replace(/\W/g,"-");return f.createElement(`h${e}`,{id:m},o)},bn={code:({inline:e,className:o,children:l,...d})=>{const m=String(l).replace(/\n+$/,""),y=/language-(\w+)/.exec(o||"");return!e&&y?(0,r.jsx)(je,{language:y[1],text:m}):(0,r.jsx)("code",{className:o,...d,children:l})},h1:gr,h2:gr,h3:gr,h4:gr,h5:gr,h6:gr};function Br(e){const{content:o,dialect:l="gfm",linkTarget:d,transformLinkUri:m,transformImageUri:y,className:I}=e,$=Yn();return(0,r.jsx)(Mt.D,{remarkPlugins:l==="gfm"?[xn.Z]:[],className:`${$.markdown} ${I}`,children:o,components:bn,linkTarget:d,transformLinkUri:m,transformImageUri:y})}var ro=n(23054);const mo=(0,g.Z)(e=>({root:{paddingLeft:e.spacing(3)}}),{name:"BackstageLoginRequestListItem"}),xs=({request:e,busy:o,setBusy:l})=>{const d=mo(),[m,y]=useState(),I=async()=>{l(!0);try{await e.trigger()}catch(J){y(isError(J)?J.message:"An unspecified error occurred")}finally{l(!1)}},$=e.provider.icon;return _jsxs(ListItem,{disabled:o,classes:{root:d.root},children:[_jsx(ListItemAvatar,{children:_jsx($,{fontSize:"large"})}),_jsx(ListItemText,{primary:e.provider.title,secondary:m&&_jsx(Typography,{color:"error",children:m})}),_jsx(Button,{color:"primary",variant:"contained",onClick:I,children:"Log in"})]})};var $r=null;const Do=(0,g.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 bs(e){const o=Do(),[l,d]=useState(!1),m=useApi(oauthRequestApiRef),y=useApi(configApiRef);var I;const $=(I=y.getOptionalBoolean("enableExperimentalRedirectFlow"))!==null&&I!==void 0?I:!1,J=useObservable(useMemo(()=>m.authRequest$(),[m]),[]),U=()=>{J.forEach(fe=>fe.reject())};return _jsxs(Dialog,{open:Boolean(J.length),fullWidth:!0,maxWidth:"xs",classes:{paper:o.dialog},"aria-labelledby":"oauth-req-dialog-title",children:[_jsxs("main",{children:[_jsxs(DialogTitle,{classes:{root:o.title},id:"oauth-req-dialog-title",children:[_jsx(Typography,{className:o.titleHeading,variant:"h1",variantMapping:{h1:"span"},children:"Login Required"}),$?_jsx(Typography,{children:"This will trigger a http redirect to OAuth Login."}):null]}),_jsx(DialogContent,{dividers:!0,classes:{root:o.contentList},children:_jsx(List,{children:J.map(fe=>_jsx(LoginRequestListItem,{request:fe,busy:l,setBusy:d},fe.provider.title))})})]}),_jsx(DialogActions,{classes:{root:o.actionButtons},children:_jsx(Button,{onClick:U,children:"Reject All"})})]})}var No=n(15277),Fo=n.n(No),mr=n(29862);const qn=(0,g.Z)({container:{overflow:"visible !important"}},{name:"BackstageOverflowTooltip"});function Dr(e){const[o,l]=(0,f.useState)(!1),d=(0,mr.t)(),m=qn(),y=$=>{d()&&l($)};var I;return(0,r.jsx)(T.ZP,{title:(I=e.title)!==null&&I!==void 0?I:e.text||"",placement:e.placement,disableHoverListener:!o,children:(0,r.jsx)(Fo(),{text:e.text,line:e.line,onToggled:y,containerClassName:m.container})})}var Gr=n(67358);function vo(e){const o=(0,le.Z)(),[l,d]=(0,f.useState)(!1);return(0,f.useEffect)(()=>{const m=setTimeout(()=>d(!0),o.transitions.duration.short);return()=>clearTimeout(m)},[o.transitions.duration.short]),l?(0,r.jsx)(Gr.Z,{...e,"data-testid":"progress"}):(0,r.jsx)(A.Z,{display:"none"})}var yo=n(94339),Rr=n(14503),Zo=n(24579),xo=n(32552),Ln=n(15459),_n=n(27597);const Nr=(0,g.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 Fr(e){const{link:o,title:l,onClick:d}=e,m=Nr();return(0,r.jsxs)(A.Z,{children:[(0,r.jsx)(Fe.Z,{}),(0,r.jsx)(ue.r,{to:o,onClick:d,underline:"none",children:(0,r.jsxs)(A.Z,{display:"flex",alignItems:"center",className:m.root,children:[(0,r.jsx)(A.Z,{className:m.boxTitle,fontWeight:"fontWeightBold",m:1,children:(0,r.jsx)(rt.Z,{children:(0,r.jsx)("strong",{children:l})})}),(0,r.jsx)(_n.Z,{className:m.arrow})]})})]})}const Uo=e=>{const{slackChannel:o}=e;if(o){if(typeof o=="string")return(0,r.jsxs)(rt.Z,{children:["Please contact ",o," for help."]});if(!o.href)return(0,r.jsxs)(rt.Z,{children:["Please contact ",o.name," for help."]})}else return null;return(0,r.jsx)(ne,{to:o.href,variant:"contained",children:o.name})},lr=class extends f.Component{componentDidCatch(o,l){console.error(`ErrorBoundary, error: ${o}, info: ${l}`),this.setState({error:o,errorInfo:l})}render(){const{slackChannel:o,children:l}=this.props,{error:d}=this.state;return d?(0,r.jsx)(st,{title:"Something Went Wrong",error:d,children:(0,r.jsx)(Uo,{slackChannel:o})}):l}constructor(o){super(o),this.state={error:void 0,errorInfo:void 0}}},bo=(0,g.Z)(e=>({noPadding:{padding:0,"&:last-child":{paddingBottom:0}},header:{padding:e.spacing(2,2,2,2.5)},headerTitle:{fontWeight:e.typography.fontWeightBold},headerSubheader:{paddingTop:e.spacing(1)},headerAvatar:{},headerAction:{},headerContent:{},subheader:{display:"flex"}}),{name:"BackstageInfoCard"}),So=(0,Ln.Z)(e=>({root:{display:"inline-block",padding:e.spacing(8,8,0,0),float:"right"}}),{name:"BackstageInfoCardCardActionsTopRight"})(Rr.Z),Co={card:{flex:{display:"flex",flexDirection:"column"},fullHeight:{display:"flex",flexDirection:"column",height:"100%"},gridItem:{display:"flex",flexDirection:"column",height:"calc(100% - 10px)",marginBottom:"10px",breakInside:"avoid-page","@media print":{height:"auto"}}},cardContent:{fullHeight:{flex:1},gridItem:{flex:1}}};function Ir(e){const{title:o,subheader:l,divider:d=!0,deepLink:m,slackChannel:y,errorBoundaryProps:I,variant:$,children:J,headerStyle:U,headerProps:fe,icon:pe,action:Te,actionsClassName:Ee,actions:Ze,cardClassName:it,actionsTopRight:It,className:pn,noPadding:Bn,titleTypographyProps:or}=e,$t=bo();let fn={},gn={};$&&$.split(/[\s]+/g).forEach(jr=>{fn={...fn,...Co.card[jr]},gn={...gn,...Co.cardContent[jr]}});const pr=()=>!l&&!pe?null:(0,r.jsxs)("div",{className:$t.headerSubheader,"data-testid":"info-card-subheader",children:[l&&(0,r.jsx)("div",{className:$t.subheader,children:l}),pe]}),Cr=I||(y?{slackChannel:y}:{});return(0,r.jsx)(yo.Z,{style:fn,className:pn,children:(0,r.jsxs)(lr,{...Cr,children:[o&&(0,r.jsx)(xo.Z,{classes:{root:$t.header,title:$t.headerTitle,subheader:$t.headerSubheader,avatar:$t.headerAvatar,action:$t.headerAction,content:$t.headerContent},title:o,subheader:pr(),action:Te,style:{...U},titleTypographyProps:or,...fe}),It&&(0,r.jsx)(So,{children:It}),d&&(0,r.jsx)(Fe.Z,{}),(0,r.jsx)(Zo.Z,{className:tn()(it,{[$t.noPadding]:Bn}),style:gn,children:J}),Ze&&(0,r.jsx)(Rr.Z,{className:Ee,children:Ze}),m&&(0,r.jsx)(Fr,{...m})]})})}var wo=n(39307);const Mo=(0,g.Z)(e=>({root:{position:"relative",lineHeight:0},overlay:{position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -60%)",fontSize:e.typography.pxToRem(45),fontWeight:e.typography.fontWeightBold,color:e.palette.textContrast},description:{fontSize:"100%",top:"50%",left:"50%",transform:"translate(-50%, -50%)",position:"absolute",wordBreak:"break-all",display:"inline-block"},circle:{width:"80%",transform:"translate(10%, 0)"},colorUnknown:{}}),{name:"BackstageGauge"}),oo={fractional:!0,inverse:!1,unit:"%",max:100},jo=({palette:e,value:o,inverse:l,max:d})=>{if(isNaN(o))return"#ddd";const m=d||oo.max,y=l?m-o:o;return y<m/3?e.status.error:y<m*(2/3)?e.status.warning:e.status.ok};function Ss(e){const[o,l]=useState(null),{getColor:d=jo}=e,m=Mo(e),{palette:y}=useTheme(),{value:I,fractional:$,inverse:J,unit:U,max:fe,description:pe}={...oo,...e},Te=$?Math.round(I*fe):I,Ee=fe!==100?Math.round(I):Te,[Ze,it]=useState(!1);return useEffect(()=>{const It=o,pn=()=>it(!0),Bn=()=>it(!1);return It&&pe?(It.addEventListener("mouseenter",pn),It.addEventListener("mouseleave",Bn),()=>{It.removeEventListener("mouseenter",pn),It.removeEventListener("mouseleave",Bn)}):()=>{it(!1)}},[pe,o]),_jsxs(Box,{ref:l,className:m.root,children:[_jsx(Circle,{strokeLinecap:"butt",percent:Te,strokeWidth:12,trailWidth:12,strokeColor:d({palette:y,value:Ee,inverse:J,max:fe}),className:m.circle}),pe&&Ze?_jsx(Box,{className:m.description,children:pe}):_jsx(Box,{className:m.overlay,children:isNaN(I)?"N/A":`${Ee}${U}`})]})}const Eo=(0,g.Z)({root:{height:"100%",width:250}},{name:"BackstageGaugeCard"});function er(e){const o=Eo(e),{title:l,subheader:d,progress:m,inverse:y,deepLink:I,description:$,icon:J,variant:U,getColor:fe}=e,pe={inverse:y,description:$,getColor:fe,value:m};return _jsx(Box,{className:o.root,children:_jsx(InfoCard,{title:l,subheader:d,deepLink:I,variant:U,icon:J,children:_jsx(Gauge,{...pe})})})}function ti(e){const{value:o,getColor:l=getProgressColor,width:d="thick"}=e,{palette:m}=useTheme();if(isNaN(o))return null;let y=Math.round(o*100*100)/100;y>100&&(y=100);const I=d==="thick"?4:1,$=l({palette:m,value:y,inverse:!1,max:100});return _jsx(Tooltip,{title:`${y}%`,children:_jsx(Typography,{component:"span",children:_jsx(Line,{percent:y,strokeWidth:I,trailWidth:I,strokeColor:$})})})}var zo=n(21324),Cs=n(7089),so=n(42494),Kr=n(74603),Yr=n(56939),Jr=n(12231),vr=n(73698),Jn=n(12420),io=n(72379);const Wo=(0,g.Z)(e=>(0,Jn.Z)({icon:{position:"absolute",right:e.spacing(.5),pointerEvents:"none"}}),{name:"BackstageClosedDropdown"});var Qr=()=>{const e=Wo();return(0,r.jsx)(io.Z,{className:e.icon,fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,r.jsx)("path",{d:"M7.5 8L6 9.5L12.0703 15.5703L18.1406 9.5L16.6406 8L12.0703 12.5703L7.5 8Z",fill:"#616161"})})};const Vo=(0,g.Z)(e=>(0,Jn.Z)({icon:{position:"absolute",right:e.spacing(.5),pointerEvents:"none"}}),{name:"BackstageOpenedDropdown"});var Ho=()=>{const e=Vo();return(0,r.jsx)(io.Z,{className:e.icon,fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,r.jsx)("path",{d:"M16.5 16L18 14.5L11.9297 8.42969L5.85938 14.5L7.35938 16L11.9297 11.4297L16.5 16Z",fill:"#616161"})})};const Go=(0,Ln.Z)(e=>(0,Jn.Z)({root:{"label + &":{marginTop:e.spacing(3)}},input:{borderRadius:e.shape.borderRadius,position:"relative",backgroundColor:e.palette.background.paper,border:"1px solid #ced4da",fontSize:e.typography.body1.fontSize,padding:e.spacing(1.25,3.25,1.25,1.5),transition:e.transitions.create(["border-color","box-shadow"]),fontFamily:"Helvetica Neue","&:focus":{background:e.palette.background.paper,borderRadius:e.shape.borderRadius}}}),{name:"BackstageSelectInputBase"})(Kr.Z),ao=(0,g.Z)(e=>(0,Jn.Z)({formControl:{margin:`${e.spacing(1)} 0px`,maxWidth:300},label:{transform:"initial",fontWeight:"bold",fontSize:e.typography.body2.fontSize,fontFamily:e.typography.fontFamily,color:e.palette.text.primary,"&.Mui-focused":{color:e.palette.text.primary}},formLabel:{transform:"initial",fontWeight:"bold",fontSize:e.typography.body2.fontSize,fontFamily:e.typography.fontFamily,color:e.palette.text.primary,"&.Mui-focused":{color:e.palette.text.primary}},chips:{display:"flex",flexWrap:"wrap"},chip:{margin:2},checkbox:{},root:{display:"flex",flexDirection:"column"}}),{name:"BackstageSelect"});function Ao(e){const{multiple:o,items:l,label:d,placeholder:m,selected:y,onChange:I,triggerReset:$,native:J=!1,disabled:U=!1,margin:fe}=e,pe=ao(),[Te,Ee]=(0,f.useState)(y||(o?[]:"")),[Ze,it]=(0,f.useState)(!1);(0,f.useEffect)(()=>{Ee(o?[]:"")},[$,o]),(0,f.useEffect)(()=>{Ee(y||(o?[]:""))},[y,o]);const It=$t=>{Ee($t.target.value),I($t.target.value)},pn=$t=>{if(U){$t.preventDefault();return}it(fn=>o&&!($t.target instanceof HTMLElement)?!0:!fn)},Bn=()=>{it(!1)},or=$t=>()=>{const fn=Te.filter(gn=>gn!==$t);Ee(fn),I(fn)};return(0,r.jsx)(A.Z,{className:pe.root,children:(0,r.jsxs)(so.Z,{className:pe.formControl,children:[(0,r.jsx)(Yr.Z,{className:pe.formLabel,children:d}),(0,r.jsxs)(vr.Z,{"aria-label":d,value:Te,native:J,disabled:U,"data-testid":"select",displayEmpty:!0,multiple:o,margin:fe,onChange:It,open:Ze,onOpen:pn,onClose:Bn,input:(0,r.jsx)(Go,{}),label:d,tabIndex:0,renderValue:$t=>{var fn;return o&&Te.length!==0?(0,r.jsx)(A.Z,{className:pe.chips,children:$t.map(gn=>{var pr,Cr;return(0,r.jsx)(Cs.Z,{label:(pr=l.find(wr=>wr.value===gn))===null||pr===void 0?void 0:pr.label,clickable:!0,onDelete:or(gn),className:pe.chip},(Cr=l.find(wr=>wr.value===gn))===null||Cr===void 0?void 0:Cr.value)})}):(0,r.jsx)(rt.Z,{children:Te.length===0?m||"":(fn=l.find(gn=>gn.value===$t))===null||fn===void 0?void 0:fn.label})},IconComponent:()=>Ze?(0,r.jsx)(Ho,{}):(0,r.jsx)(Qr,{}),MenuProps:{anchorOrigin:{vertical:"bottom",horizontal:"left"},transformOrigin:{vertical:"top",horizontal:"left"},getContentAnchorEl:null},children:[m&&!o&&(0,r.jsx)(Jr.Z,{value:[],children:m}),J?l&&l.map($t=>(0,r.jsx)("option",{value:$t.value,children:$t.label},$t.value)):l&&l.map($t=>(0,r.jsxs)(Jr.Z,{value:$t.value,children:[o&&(0,r.jsx)(zo.Z,{color:"primary",checked:Te.includes($t.value)||!1,className:pe.checkbox}),$t.label]},$t.value))]})]})})}const lo=()=>{},Es=f.createContext({stepperLength:0,stepIndex:0,setStepIndex:lo,stepHistory:[],setStepHistory:lo,onStepChange:lo});function ni(e){const{children:o,elevated:l,onStepChange:d,activeStep:m=0}=e,[y,I]=useState(m),[$,J]=useState([0]);useEffect(()=>{I(m)},[m]);const U=[];let fe;return Children.forEach(o,pe=>{isValidElement(pe)&&(pe.props.end?fe=pe:U.push(pe))}),_jsxs(_Fragment,{children:[_jsx(Es.Provider,{value:{stepIndex:y,setStepIndex:I,stepHistory:$,setStepHistory:J,onStepChange:d,stepperLength:Children.count(o)},children:_jsx(MuiStepper,{activeStep:y,orientation:"vertical",elevation:l?2:0,children:U})}),y>=Children.count(o)-1&&fe]})}const Ko=(0,g.Z)(e=>({root:{marginTop:e.spacing(3),"& button":{marginRight:e.spacing(1)}}}),{name:"BackstageSimpleStepperFooter"}),Yo=({text:e,handleClick:o})=>_jsx(Button,{onClick:o,children:e||"Reset"}),rn=({text:e,handleClick:o,disabled:l,last:d,stepIndex:m})=>_jsx(Button,{variant:"contained",color:"primary",disabled:l,"data-testid":`nextButton-${m}`,onClick:o,children:e||(d?"Finish":"Next")}),As=({text:e,handleClick:o,disabled:l,stepIndex:d})=>_jsx(Button,{variant:"outlined",color:"primary",disabled:l,"data-testid":`skipButton-${d}`,onClick:o,children:e||"Skip"}),x=({text:e,handleClick:o,disabled:l,stepIndex:d})=>_jsx(Button,{onClick:o,"data-testid":`backButton-${d}`,disabled:l,children:e||"Back"}),C=({actions:e={},children:o})=>{const l=Ko(),{stepperLength:d,stepIndex:m,setStepIndex:y,stepHistory:I,setStepHistory:$,onStepChange:J}=useContext(VerticalStepperContext),U=(Ee,Ze)=>{Ze&&Ze(),J&&J(m,Ee),y(Ee)},fe=()=>{const Ee=e.nextStep?e.nextStep(m,d-1):m+1;U(Ee,e.onNext),$([...I,Ee])},pe=()=>{I.pop(),U(I[I.length-1],e.onBack),$([...I])},Te=()=>{U(0,e.onRestart),$([0])};return _jsxs(Box,{className:l.root,children:[[void 0,!0].includes(e.showBack)&&m!==0&&_jsx(x,{text:e.backText,handleClick:pe,disabled:m===0,stepIndex:m}),e.showSkip&&_jsx(As,{text:e.skipText,handleClick:fe,disabled:!!d&&m>=d||!!e.canSkip&&!e.canSkip(),stepIndex:m}),[void 0,!0].includes(e.showNext)&&_jsx(rn,{text:e.nextText,handleClick:fe,disabled:!!d&&m>=d||!!e.canNext&&!e.canNext(),stepIndex:m}),e.showRestart&&m!==0&&_jsx(Yo,{text:e.restartText,handleClick:Te,stepIndex:m}),o]})},E=(0,g.Z)(e=>({end:{padding:e.spacing(3)}}),{name:"SimpleStepperStep"});function D(e){const{title:o,children:l,end:d,actions:m,...y}=e,I=E();return d?_jsxs(Box,{className:I.end,children:[_jsx(Typography,{variant:"h6",children:o}),l,_jsx(SimpleStepperFooter,{actions:{...m||{},showNext:!1}})]}):_jsxs(MuiStep,{...y,children:[_jsx(StepLabel,{children:_jsx(Typography,{variant:"h6",children:o})}),_jsxs(StepContent,{children:[l,_jsx(SimpleStepperFooter,{actions:m})]})]})}const X=(0,g.Z)(e=>({status:{fontWeight:e.typography.fontWeightMedium,"&::before":{width:"0.7em",height:"0.7em",display:"inline-block",marginRight:e.spacing(1),borderRadius:"50%",content:'""'}},ok:{"&::before":{backgroundColor:e.palette.status.ok}},warning:{"&::before":{backgroundColor:e.palette.status.warning}},error:{"&::before":{backgroundColor:e.palette.status.error}},pending:{"&::before":{backgroundColor:e.palette.status.pending}},running:{"&::before":{backgroundColor:e.palette.status.running}},aborted:{"&::before":{backgroundColor:e.palette.status.aborted}}}),{name:"BackstageStatus"});function re(e){const o=X(e);return _jsx(Typography,{component:"span",className:classNames(o.status,o.ok),"aria-label":"Status ok","aria-hidden":"true",...e})}function oe(e){const o=X(e);return _jsx(Typography,{component:"span",className:classNames(o.status,o.warning),"aria-label":"Status warning","aria-hidden":"true",...e})}function ve(e){const o=X(e);return _jsx(Typography,{component:"span",className:classNames(o.status,o.error),"aria-label":"Status error","aria-hidden":"true",...e})}function Ae(e){const o=X(e);return _jsx(Typography,{component:"span",className:classNames(o.status,o.pending),"aria-label":"Status pending","aria-hidden":"true",...e})}function Oe(e){const o=X(e);return _jsx(Typography,{component:"span",className:classNames(o.status,o.running),"aria-label":"Status running","aria-hidden":"true",...e})}function De(e){const o=X(e);return _jsx(Typography,{component:"span",className:classNames(o.status,o.aborted),"aria-label":"Status aborted","aria-hidden":"true",...e})}var $e=n(74600),tt=n(15584);const ht=e=>(0,Jn.Z)({root:{fontWeight:e.typography.fontWeightBold,whiteSpace:"nowrap",paddingRight:e.spacing(4),border:"0",verticalAlign:"top"}}),Qe={root:{border:"0",verticalAlign:"top"}},Ve=e=>(0,Jn.Z)({root:{margin:e.spacing(0,0,-1,0)}}),pt=e=>(0,Jn.Z)({root:{padding:e.spacing(0,0,1,0)},random:{}}),kt=(0,Ln.Z)(ht,{name:"BackstageMetadataTableTitleCell"})(tt.Z),vn=(0,Ln.Z)(Qe,{name:"BackstageMetadataTableCell"})(tt.Z),Tt=({dense:e,children:o})=>_jsx(Table,{size:e?"small":"medium",children:_jsx(TableBody,{children:o})}),Jt=({title:e,children:o,...l})=>_jsxs(TableRow,{children:[e&&_jsx(kt,{children:e}),_jsx(vn,{colSpan:e?1:2,...l,children:o})]}),Bt=(0,Ln.Z)(Ve,{name:"BackstageMetadataTableList"})(({classes:e,children:o})=>(0,r.jsx)(St.Z,{disablePadding:!0,className:e.root,children:o})),on=(0,Ln.Z)(pt,{name:"BackstageMetadataTableListItem"})(({classes:e,children:o})=>(0,r.jsx)(Ot.Z,{className:e.root,children:o})),kn=(0,Jn.Z)({root:{margin:"0 0",listStyleType:"none"}}),Pr=e=>(0,Jn.Z)({root:{...kn.root,paddingLeft:e.spacing(1)}}),yr=(0,Ln.Z)(kn,{name:"BackstageStructuredMetadataTableList"})(({classes:e,children:o})=>(0,r.jsx)(Bt,{classes:e,children:o})),Zr=(0,Ln.Z)(Pr,{name:"BackstageStructuredMetadataTableNestedList"})(({classes:e,children:o})=>(0,r.jsx)(Bt,{classes:e,children:o}));function Nn(e,o){const l=e.map((d,m)=>_jsx(MetadataListItem,{children:xr(d)},m));return o?_jsx(Zr,{children:l}):_jsx(yr,{children:l})}function Un(e,o,l){const d=Object.keys(e).map(m=>{const y=xr(e[m],!0),I=l&&l.titleFormat?l.titleFormat(m):startCase(m);return _jsxs(MetadataListItem,{children:[_jsx(Typography,{variant:"body2",component:"span",children:`${I}: `}),y]},m)});return o?_jsx(Zr,{children:d}):_jsx(yr,{children:d})}function xr(e,o,l){return React.isValidElement(e)?_jsx(Fragment,{children:e}):typeof e=="object"&&!Array.isArray(e)?Un(e,o,l):Array.isArray(e)?Nn(e,l):typeof e=="boolean"?_jsx(Fragment,{children:e?"\u2705":"\u274C"}):_jsx(Typography,{variant:"body2",component:"span",children:e})}const ri=({value:e,options:o})=>_jsx(Fragment,{children:xr(e,o)}),oi=({title:e,value:o,options:l})=>_jsx(MetadataTableItem,{title:l&&l.titleFormat?l.titleFormat(e):startCase(e),children:_jsx(ri,{value:o,options:l})});function Ts(e,o){return Object.keys(e).map(l=>_jsx(oi,{title:l,value:e[l],options:o},l))}function si(e){const{metadata:o,dense:l=!0,options:d}=e,m=Ts(o,d||{});return _jsx(MetadataTable,{dense:l,children:m})}var Lr=n(49429),cr=n(86136),dr=n(50758),tr=n(79784),Xr=n(76635),ii=n(19126),Rs=n.n(ii);function ai(e){return qs.stringify(e,{strictNullHandling:!0})}function Jo(e){return qs.parse(e,{ignoreQueryPrefix:!0,strictNullHandling:!0})}function qr(e,o){return Jo(e)[o]}function Is(e,o,l){const d={...Jo(e),[o]:l};return ai(d)}function li(e,o=250){const[l,d]=useSearchParams(),m=l.toString(),[y,I]=useState(qr(m,e));return useEffect(()=>{const $=qr(m,e);I(J=>isEqual($,J)?J:$)},[m,I,e]),useDebouncedEffect(()=>{const $=Is(m,e,y);m!==$&&d($,{replace:!0})},[d,y,m,e],o),[y,I]}const aa={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 co(){const o=(0,p.I_)().get(p.Ds),l=o==null?void 0:o.getOptionalConfig("app.support");if(!l)return aa;var d;return{url:l.getString("url"),items:l.getConfigArray("items").flatMap(m=>({title:m.getString("title"),icon:m.getOptionalString("icon"),links:((d=m.getOptionalConfigArray("links"))!==null&&d!==void 0?d:[]).flatMap(y=>({url:y.getString("url"),title:y.getString("title")}))}))}}var Ps=n(80079);function nr(e,o){const d=(0,p.qD)().getSystemIcon(e);return d?(0,r.jsx)(d,{...o}):(0,r.jsx)(Ps.Z,{...o})}function la(e){return nr("brokenImage",e)}function ca(e){return nr("catalog",e)}function da(e){return nr("chat",e)}function ua(e){return nr("dashboard",e)}function ha(e){return nr("docs",e)}function pa(e){return nr("email",e)}function fa(e){return nr("github",e)}function ci(e){return nr("group",e)}function To(e){return nr("help",e)}function ga(e){return nr("user",e)}function di(e){return nr("warning",e)}const ma=(0,g.Z)({popoverList:{minWidth:260,maxWidth:400}},{name:"BackstageSupportButton"}),va=({icon:e})=>{const o=(0,p.qD)();var l;const d=e&&(l=o.getSystemIcon(e))!==null&&l!==void 0?l:To;return(0,r.jsx)(d,{})};var Qo;const ui=({link:e})=>(0,r.jsx)(ue.r,{to:e.url,children:(Qo=e.title)!==null&&Qo!==void 0?Qo:e.url}),hi=({item:e})=>{var o;return(0,r.jsxs)(Jr.Z,{children:[(0,r.jsx)(cr.Z,{children:(0,r.jsx)(va,{icon:e.icon})}),(0,r.jsx)(qt.Z,{primary:e.title,secondary:(o=e.links)===null||o===void 0?void 0:o.reduce((l,d,m)=>[...l,m>0&&(0,r.jsx)("br",{},m),(0,r.jsx)(ui,{link:d},d.url)],[])})]})};function pi(e){const{title:o,items:l,children:d}=e,{items:m}=co(),[y,I]=(0,f.useState)(!1),[$,J]=(0,f.useState)(null),U=ma(),fe=(0,Le.Z)(Ee=>Ee.breakpoints.down("sm")),pe=Ee=>{J(Ee.currentTarget),I(!0)},Te=()=>{I(!1)};return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(A.Z,{display:"flex",ml:1,children:fe?(0,r.jsx)(H.Z,{color:"primary",size:"small",onClick:pe,"data-testid":"support-button","aria-label":"Support",children:(0,r.jsx)(To,{})}):(0,r.jsx)(ge.Z,{"data-testid":"support-button","aria-label":"Support",color:"primary",onClick:pe,startIcon:(0,r.jsx)(To,{}),children:"Support"})}),(0,r.jsxs)(tr.ZP,{"data-testid":"support-button-popover",open:y,anchorEl:$,anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"},onClose:Te,children:[(0,r.jsxs)(dr.Z,{className:U.popoverList,autoFocusItem:Boolean($),children:[o&&(0,r.jsx)(Jr.Z,{alignItems:"flex-start",children:(0,r.jsx)(rt.Z,{variant:"subtitle1",children:o})}),f.Children.map(d,(Ee,Ze)=>(0,r.jsx)(Jr.Z,{alignItems:"flex-start",children:Ee},`child-${Ze}`)),(l!=null?l:m).map((Ee,Ze)=>(0,r.jsx)(hi,{item:Ee},`item-${Ze}`))]}),(0,r.jsx)(Lr.Z,{children:(0,r.jsx)(ge.Z,{color:"primary",onClick:Te,"aria-label":"Close",children:"Close"})})]})]})}var _r=n(18671),rr=n(73557),Xo=n(84800);const Ro=72,fi=24,Ur=18,br={drawerWidthClosed:Ro,drawerWidthOpen:224,defaultOpenDelayMs:100,defaultCloseDelayMs:0,defaultFadeDuration:200,logoHeight:32,iconContainerWidth:Ro,iconSize:Ro-fi*2,iconPadding:fi,selectedIndicatorWidth:3,userBadgePadding:Ur,userBadgeDiameter:Ro-Ur*2,mobileSidebarHeight:56},Mn=e=>({...br,...e,iconContainerWidth:br.drawerWidthClosed,iconSize:br.drawerWidthClosed-br.iconPadding*2,userBadgeDiameter:br.drawerWidthClosed-br.userBadgePadding*2}),gi={drawerWidthClosed:0,drawerWidthOpen:202,defaultOpenDelayMs:br.defaultOpenDelayMs+200},ya=e=>({...gi,...e}),za="@backstage/core/sidebar-intro-dismissed",ur=(0,f.createContext)({sidebarConfig:br,submenuConfig:gi}),mi=(0,f.createContext)({isHoveredOn:!1,setIsHoveredOn:()=>{}});var xa=n(50023),qo=n(4190),vi=n(87685),Io=n(44882),Mr=n(51837);const uo={isOpen:!1,setOpen:()=>{}},Ls=(0,f.createContext)(uo),_o=(0,Mr.CT)("sidebar-open-state-context");function es(e){const{children:o,value:l}=e;return(0,r.jsx)(Ls.Provider,{value:l,children:(0,r.jsx)(_o.Provider,{value:(0,Mr.EI)({1:l}),children:o})})}const ts=()=>{const e=(0,f.useContext)(_o),o=(0,f.useContext)(Ls);if(e===void 0)return o||uo;const l=e.atVersion(1);if(l===void 0)throw new Error("No context found for version 1.");return l};var yi=n(57998);const Os={isPinned:!0,toggleSidebarPinState:()=>{},isMobile:!1},ks=(0,f.createContext)(Os),Bs=(0,Mr.CT)("sidebar-pin-state-context");function ba(e){const{children:o,value:l}=e;return(0,r.jsx)(ks.Provider,{value:l,children:(0,r.jsx)(Bs.Provider,{value:(0,Mr.EI)({1:l}),children:o})})}const Po=()=>{const e=(0,f.useContext)(Bs),o=(0,f.useContext)(ks);if(e===void 0)return o||Os;const l=e.atVersion(1);if(l===void 0)throw new Error("No context found for version 1.");return l},xi=(0,g.Z)(e=>({root:{flexGrow:0,margin:e.spacing(0,2),color:e.palette.navigation.color},selected:o=>({color:`${e.palette.navigation.selectedColor}!important`,borderTop:`solid ${o.sidebarConfig.selectedIndicatorWidth}px ${e.palette.navigation.indicator}`,marginTop:"-1px"}),label:{display:"none"}})),ns=e=>{const{to:o,label:l,icon:d,value:m}=e,{sidebarConfig:y}=(0,f.useContext)(ur),I=xi({sidebarConfig:y}),$=(0,rr.TH)(),{selectedMenuItemIndex:J,setSelectedMenuItemIndex:U}=(0,f.useContext)(Fs),fe=(Te,Ee)=>{U(Ee===J?-1:Ee)},pe=m===J&&J>=0||m!==J&&!(J>=0)&&o===$.pathname;return(0,r.jsx)(yi.Z,{"aria-label":l,label:l,icon:d,component:ue.r,to:o||$.pathname,onChange:fe,value:m,selected:pe,classes:I})},$s=e=>{const{children:o,to:l,label:d,icon:m,value:y}=e,{isMobile:I}=Po();return I?(0,r.jsx)(ns,{to:l,label:d,icon:m,value:y}):(0,r.jsx)(r.Fragment,{children:o})},Ds=(0,g.Z)(e=>({root:{position:"fixed",backgroundColor:e.palette.navigation.background,color:e.palette.navigation.color,bottom:0,left:0,right:0,zIndex:e.zIndex.snackbar,borderTop:"1px solid #383838","@media print":{display:"none"}},overlay:o=>({background:e.palette.navigation.background,width:"100%",bottom:`${o.sidebarConfig.mobileSidebarHeight}px`,height:`calc(100% - ${o.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:o=>({marginBottom:`${o.sidebarConfig.mobileSidebarHeight}px`})})),Ns=e=>(0,Xr.orderBy)(e,({props:{priority:o}})=>Number.isInteger(o)?o:-1,"desc"),bi=f.createElement($s).type,Si=({children:e,label:o="Menu",open:l,onClose:d})=>{const{sidebarConfig:m}=(0,f.useContext)(ur),y=Ds({sidebarConfig:m});return(0,r.jsxs)(qo.ZP,{anchor:"bottom",open:l,onClose:d,ModalProps:{BackdropProps:{classes:{root:y.marginMobileSidebar}}},classes:{root:y.marginMobileSidebar,paperAnchorBottom:y.overlay},children:[(0,r.jsxs)(A.Z,{className:y.overlayHeader,children:[(0,r.jsx)(rt.Z,{variant:"h3",children:o}),(0,r.jsx)(H.Z,{onClick:d,classes:{root:y.overlayHeaderClose},children:(0,r.jsx)(vi.Z,{})})]}),(0,r.jsx)(A.Z,{component:"nav",children:e})]})},Fs=(0,f.createContext)({selectedMenuItemIndex:-1,setSelectedMenuItemIndex:()=>{}}),Ci=e=>{const{sidebarConfig:o}=(0,f.useContext)(ur),{children:l}=e,d=Ds({sidebarConfig:o}),m=(0,rr.TH)(),[y,I]=(0,f.useState)(-1);(0,f.useEffect)(()=>{I(-1)},[m.pathname]);let $=(0,p.vJ)(l,U=>U.getElements().filter(fe=>fe.type===bi));if(l)$.length?$=Ns($):$.push((0,r.jsx)($s,{icon:(0,r.jsx)(Io.Z,{}),children:l},"default_menu"));else return null;const J=y>=0&&!$[y].props.to;return(0,r.jsx)(es,{value:{isOpen:!0,setOpen:()=>{}},children:(0,r.jsxs)(Fs.Provider,{value:{selectedMenuItemIndex:y,setSelectedMenuItemIndex:I},children:[(0,r.jsx)(Si,{label:$[y]&&$[y].props.label,open:J,onClose:()=>I(-1),children:$[y]&&$[y].props.children}),(0,r.jsx)(xa.Z,{className:d.root,"data-testid":"mobile-sidebar-root",component:"nav",children:$})]})})};var rs;(function(e){e.SIDEBAR_PIN_STATE="sidebarPinState"})(rs||(rs={}));const Zs={getSidebarPinState(){let e;try{e=JSON.parse(window.localStorage.getItem(rs.SIDEBAR_PIN_STATE)||"true")}catch{return!0}return!!e},setSidebarPinState(e){return window.localStorage.setItem(rs.SIDEBAR_PIN_STATE,JSON.stringify(e))}},wi=(0,g.Z)(e=>({root:{width:"100%",transition:"padding-left 0.1s ease-out",isolation:"isolate",[e.breakpoints.up("sm")]:{paddingLeft:o=>o.isPinned?o.sidebarConfig.drawerWidthOpen:o.sidebarConfig.drawerWidthClosed},[e.breakpoints.down("xs")]:{paddingBottom:o=>o.sidebarConfig.mobileSidebarHeight},"@media print":{padding:"0px !important"}},content:{zIndex:0,isolation:"isolate","&:focus":{outline:0}}}),{name:"BackstageSidebarPage"}),Us=(0,f.createContext)({content:{contentRef:void 0}});function ji(e){const[o,l]=(0,f.useState)(()=>Zs.getSidebarPinState()),{sidebarConfig:d}=(0,f.useContext)(ur),m=(0,f.useRef)(null),y=(0,f.useMemo)(()=>({content:{contentRef:m}}),[m]);(0,f.useEffect)(()=>{Zs.setSidebarPinState(o)},[o]);const I=(0,Le.Z)(U=>U.breakpoints.down("xs"),{noSsr:!0}),$=()=>l(!o),J=wi({isPinned:o,sidebarConfig:d});return(0,r.jsx)(ba,{value:{isPinned:o,toggleSidebarPinState:$,isMobile:I},children:(0,r.jsx)(Us.Provider,{value:y,children:(0,r.jsx)(A.Z,{className:J.root,children:e.children})})})}function os(){const{content:e}=(0,f.useContext)(Us);return{focusContent:(0,f.useCallback)(()=>{var l,d;e==null||(l=e.contentRef)===null||l===void 0||(d=l.current)===null||d===void 0||d.focus()},[e]),contentRef:e==null?void 0:e.contentRef}}const Lo=(0,g.Z)(e=>({drawer:{display:"flex",flexFlow:"column nowrap",alignItems:"flex-start",position:"fixed",left:0,top:0,bottom:0,zIndex:e.zIndex.appBar,background:e.palette.navigation.background,overflowX:"hidden",msOverflowStyle:"none",scrollbarWidth:"none",transition:e.transitions.create("width",{easing:e.transitions.easing.sharp,duration:e.transitions.duration.shortest}),"& > *":{flexShrink:0},"&::-webkit-scrollbar":{display:"none"},"@media print":{display:"none"}},drawerWidth:o=>({width:o.sidebarConfig.drawerWidthClosed}),drawerOpen:o=>({width:o.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 Qn;(function(e){e[e.Closed=0]="Closed",e[e.Idle=1]="Idle",e[e.Open=2]="Open"})(Qn||(Qn={}));const Ei=e=>{const{sidebarConfig:o}=(0,f.useContext)(ur),{openDelayMs:l=o.defaultOpenDelayMs,closeDelayMs:d=o.defaultCloseDelayMs,disableExpandOnHover:m,children:y}=e,I=Lo({sidebarConfig:o}),$=(0,Le.Z)(pn=>pn.breakpoints.down("md"),{noSsr:!0}),[J,U]=(0,f.useState)(Qn.Closed),fe=(0,f.useRef)(),{isPinned:pe,toggleSidebarPinState:Te}=Po(),Ee=()=>{pe||m||(fe.current&&(clearTimeout(fe.current),fe.current=void 0),J!==Qn.Open&&!$&&(fe.current=window.setTimeout(()=>{fe.current=void 0,U(Qn.Open)},l),U(Qn.Idle)))},Ze=()=>{pe||m||(fe.current&&(clearTimeout(fe.current),fe.current=void 0),J===Qn.Idle?U(Qn.Closed):J===Qn.Open&&(fe.current=window.setTimeout(()=>{fe.current=void 0,U(Qn.Closed)},d)))},it=J===Qn.Open&&!$||pe,It=pn=>{pn?(U(Qn.Open),Te()):(U(Qn.Closed),Te())};return(0,r.jsxs)("nav",{style:{},"aria-label":"sidebar nav",children:[(0,r.jsx)(Ti,{}),(0,r.jsx)(es,{value:{isOpen:it,setOpen:It},children:(0,r.jsx)(A.Z,{className:I.root,"data-testid":"sidebar-root",onMouseEnter:m?()=>{}:Ee,onFocus:m?()=>{}:Ee,onMouseLeave:m?()=>{}:Ze,onBlur:m?()=>{}:Ze,children:(0,r.jsx)(A.Z,{className:tn()(I.drawer,I.drawerWidth,{[I.drawerOpen]:it}),children:y})})})]})},Ai=e=>{var o;const l=Mn((o=e.sidebarOptions)!==null&&o!==void 0?o:{});var d;const m=ya((d=e.submenuOptions)!==null&&d!==void 0?d:{}),{children:y,disableExpandOnHover:I,openDelayMs:$,closeDelayMs:J}=e,{isMobile:U}=Po();return U?(0,r.jsx)(Ci,{children:y}):(0,r.jsx)(ur.Provider,{value:{sidebarConfig:l,submenuConfig:m},children:(0,r.jsx)(Ei,{openDelayMs:$,closeDelayMs:J,disableExpandOnHover:I,children:y})})};function Ti(){const{sidebarConfig:e}=(0,f.useContext)(ur),{focusContent:o,contentRef:l}=os(),d=Lo({sidebarConfig:e});return l!=null&&l.current?(0,r.jsx)(ge.Z,{onClick:o,variant:"contained",className:tn()(d.visuallyHidden),children:"Skip to content"}):null}function Ri(e,o,l=!1){const d=new URLSearchParams(o.search).toString(),m=Rs().parse(d),y=new URLSearchParams(e.search).toString(),I=Rs().parse(y),$=l?Xr.isEqual:Xr.isMatch;return(0,Xr.isEqual)(o.pathname,e.pathname)&&$(I,m)}const ho=(0,g.Z)(e=>{var o,l;return{item:{height:48,width:"100%","&:hover":{background:((o=e.palette.navigation.navItem)===null||o===void 0?void 0:o.hoverBackground)||"#6f6f6f",color:e.palette.navigation.selectedColor},display:"flex",alignItems:"center",color:e.palette.navigation.color,padding:e.spacing(2.5),cursor:"pointer",position:"relative",background:"none",border:"none"},itemContainer:{width:"100%"},selected:{background:"#6f6f6f",color:e.palette.common.white},label:{margin:e.spacing(1.75),marginLeft:e.spacing(1),fontSize:e.typography.body2.fontSize,whiteSpace:"nowrap",overflow:"hidden","text-overflow":"ellipsis",lineHeight:1},subtitle:{fontSize:10,whiteSpace:"nowrap",overflow:"hidden","text-overflow":"ellipsis"},dropdownArrow:{position:"absolute",right:21},dropdown:{display:"flex",flexDirection:"column",alignItems:"end"},dropdownItem:{width:"100%",padding:"10px 0 10px 0","&:hover":{background:((l=e.palette.navigation.navItem)===null||l===void 0?void 0:l.hoverBackground)||"#6f6f6f",color:e.palette.navigation.selectedColor}},textContent:{color:e.palette.navigation.color,paddingLeft:e.spacing(4),paddingRight:e.spacing(1),fontSize:e.typography.body2.fontSize,whiteSpace:"nowrap",overflow:"hidden","text-overflow":"ellipsis"}}},{name:"BackstageSidebarSubmenuItem"}),Wa=e=>{const{title:o,subtitle:l,to:d,icon:m,dropdownItems:y,exact:I}=e,$=ho(),{setIsHoveredOn:J}=useContext(SidebarItemWithSubmenuContext),U=()=>{J(!1)},fe=useResolvedPath(d!=null?d:""),pe=useLocation();let Te=isLocationMatch(pe,fe,I);const[Ee,Ze]=useState(!1),it=()=>{Ze(!Ee)};return y!==void 0?(y.some(It=>{const pn=resolvePath(It.to);return Te=isLocationMatch(pe,pn,I),Te}),_jsxs(Box,{className:$.itemContainer,children:[_jsx(Tooltip,{title:o,enterDelay:500,enterNextDelay:500,children:_jsxs(Button,{role:"button",onClick:it,onTouchStart:It=>It.stopPropagation(),className:classnames($.item,Te?$.selected:void 0),children:[m&&_jsx(m,{fontSize:"small"}),_jsxs(Typography,{variant:"subtitle1",component:"span",className:$.label,children:[o,_jsx("br",{}),l&&_jsx(Typography,{variant:"caption",component:"span",className:$.subtitle,children:l})]}),Ee?_jsx(ArrowDropUpIcon,{className:$.dropdownArrow}):_jsx(ArrowDropDownIcon,{className:$.dropdownArrow})]})}),y&&Ee&&_jsx(Box,{className:$.dropdown,children:y.map((It,pn)=>_jsx(Tooltip,{title:It.title,enterDelay:500,enterNextDelay:500,children:_jsx(Link,{to:It.to,underline:"none",className:$.dropdownItem,onClick:U,onTouchStart:Bn=>Bn.stopPropagation(),children:_jsx(Typography,{component:"span",className:$.textContent,children:It.title})})},pn))})]})):_jsx(Box,{className:$.itemContainer,children:_jsx(Tooltip,{title:o,enterDelay:500,enterNextDelay:500,children:_jsxs(Link,{to:d,underline:"none",className:classnames($.item,Te?$.selected:void 0),onClick:U,onTouchStart:It=>It.stopPropagation(),children:[m&&_jsx(m,{fontSize:"small"}),_jsxs(Typography,{variant:"subtitle1",component:"span",className:$.label,children:[o,_jsx("br",{}),l&&_jsx(Typography,{variant:"caption",component:"span",className:$.subtitle,children:l})]})]})})})};var Ms;const Ii=(0,g.Z)(e=>({root:{zIndex:1e3,position:"relative",overflow:"visible",width:e.spacing(7)+1},drawer:o=>{var l;return{display:"flex",flexFlow:"column nowrap",alignItems:"flex-start",position:"fixed",[e.breakpoints.up("sm")]:{marginLeft:o.left,transition:e.transitions.create("margin-left",{easing:e.transitions.easing.sharp,duration:e.transitions.duration.shortest})},top:0,bottom:0,padding:0,background:(Ms=(l=e.palette.navigation.submenu)===null||l===void 0?void 0:l.background)!==null&&Ms!==void 0?Ms:"#404040",overflowX:"hidden",msOverflowStyle:"none",scrollbarWidth:"none",cursor:"default",width:o.submenuConfig.drawerWidthClosed,transitionDelay:`${o.submenuConfig.defaultOpenDelayMs}ms`,"& > *":{flexShrink:0},"&::-webkit-scrollbar":{display:"none"}}},drawerOpen:o=>({width:o.submenuConfig.drawerWidthOpen,[e.breakpoints.down("xs")]:{width:"100%",position:"relative",paddingLeft:e.spacing(3),left:0,top:0}}),title:{fontSize:e.typography.h5.fontSize,fontWeight:e.typography.fontWeightMedium,color:e.palette.common.white,padding:e.spacing(2.5),[e.breakpoints.down("xs")]:{display:"none"}}}),{name:"BackstageSidebarSubmenu"}),Pi=e=>{const{isOpen:o}=ts(),{sidebarConfig:l,submenuConfig:d}=(0,f.useContext)(ur),m=o?l.drawerWidthOpen:l.drawerWidthClosed,y=Ii({left:m,submenuConfig:d}),{isHoveredOn:I}=(0,f.useContext)(mi),[$,J]=(0,f.useState)(!1);return(0,f.useEffect)(()=>{J(I)},[I]),(0,r.jsxs)(A.Z,{className:tn()(y.drawer,{[y.drawerOpen]:$}),children:[(0,r.jsx)(rt.Z,{variant:"h5",component:"span",className:y.title,children:e.title}),e.children]})};var zs=n(26739),ss=n(76600),Sa=n(83543),Ws=n(59797),is=n(98989);const Li=(0,g.Z)({iconContainer:{display:"flex",position:"relative",width:"100%"},arrow1:{right:"6px",position:"absolute"}}),Ca=()=>{const e=Li();return _jsxs(Box,{className:e.iconContainer,children:[_jsx(Box,{className:e.arrow1,children:_jsx(ArrowBackIosIcon,{style:{fontSize:"12px"}})}),_jsx(Box,{children:_jsx(ArrowBackIosIcon,{style:{fontSize:"12px"}})})]})};var as=null;const wa=(0,g.Z)({iconContainer:{display:"flex",position:"relative",width:"100%"},arrow1:{right:"6px",position:"absolute"}}),Va=()=>{const e=wa();return _jsxs(Box,{className:e.iconContainer,children:[_jsx(Box,{className:e.arrow1,children:_jsx(ArrowForwardIosIcon,{style:{fontSize:"12px"}})}),_jsx(Box,{children:_jsx(ArrowForwardIosIcon,{style:{fontSize:"12px"}})})]})};var Ha=null,Vs,ls;const zn=e=>(0,g.Z)(o=>{var l,d;return{root:{color:o.palette.navigation.color,display:"flex",flexFlow:"row nowrap",alignItems:"center",height:48,cursor:"pointer"},buttonItem:{background:"none",border:"none",width:"100%",margin:0,padding:0,textAlign:"inherit",font:"inherit",textTransform:"none"},closed:{width:e.drawerWidthClosed,justifyContent:"center"},open:{[o.breakpoints.up("sm")]:{width:e.drawerWidthOpen}},highlightable:{"&:hover":{background:(Vs=(l=o.palette.navigation.navItem)===null||l===void 0?void 0:l.hoverBackground)!==null&&Vs!==void 0?Vs:"#404040"}},highlighted:{background:(ls=(d=o.palette.navigation.navItem)===null||d===void 0?void 0:d.hoverBackground)!==null&&ls!==void 0?ls:"#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:-o.spacing(2),display:"flex",alignItems:"center",justifyContent:"center",lineHeight:"0"},searchRoot:{marginBottom:12},searchField:{color:"#b5b5b5",fontWeight:o.typography.fontWeightBold,fontSize:o.typography.fontSize},searchFieldHTMLInput:{padding:o.spacing(2,0,2)},searchContainer:{width:e.drawerWidthOpen-e.iconContainerWidth},secondaryAction:{width:o.spacing(6),textAlign:"center",marginRight:o.spacing(1)},closedItemIcon:{width:"100%",justifyContent:"center"},submenuArrow:{display:"flex"},expandButton:{background:"none",border:"none",color:o.palette.navigation.color,width:"100%",cursor:"pointer",position:"relative",height:48},arrows:{position:"absolute",right:10},selected:{"&$root":{borderLeft:`solid ${e.selectedIndicatorWidth}px ${o.palette.navigation.indicator}`,color:o.palette.navigation.selectedColor},"&$closed":{width:e.drawerWidthClosed},"& $closedItemIcon":{paddingRight:e.selectedIndicatorWidth},"& $iconContainer":{marginLeft:-e.selectedIndicatorWidth}}}},{name:"BackstageSidebarItem"});function cs(e){return(0,f.useMemo)(()=>zn(e),[e])()}const Oi=(e,o)=>(0,p.vJ)(e.props.children,l=>{let d=!1;return l.getElements().forEach(({props:{to:m,dropdownItems:y}})=>{if(!d){if(y!=null&&y.length){y.forEach(({to:I})=>d=d||Ri(o,(0,Xo.i3)(I)));return}m&&(d=Ri(o,(0,Xo.i3)(m)))}}),d},[o.pathname]);function Hs(e){return e.to===void 0}const ja=f.createElement(Pi).type,Ea=f.forwardRef(function({to:o,end:l,style:d,className:m,activeStyle:y,caseSensitive:I,activeClassName:$="active","aria-current":J="page",...U},fe){let{pathname:pe}=(0,rr.TH)(),{pathname:Te}=(0,rr.WU)(o);I||(pe=pe.toLocaleLowerCase("en-US"),Te=Te.toLocaleLowerCase("en-US"));let Ee=pe===Te;!Ee&&!l&&(Ee=pe.startsWith(`${Te}/`));const Ze=Ee?J:void 0;return(0,r.jsx)(Z.rU,{...U,to:o,ref:fe,"aria-current":Ze,style:{...d,...Ee?y:void 0},className:tn()([m,Ee?$:void 0])})}),ki=(0,f.forwardRef)((e,o)=>{const{icon:l,text:d,hasNotifications:m=!1,hasSubmenu:y=!1,disableHighlight:I=!1,onClick:$,noTrack:J,children:U,className:fe,...pe}=e,{sidebarConfig:Te}=(0,f.useContext)(ur),Ee=cs(Te),{isOpen:Ze}=ts(),it=!Ze&&y?{display:"flex",marginLeft:"20px"}:{lineHeight:"0"},It=(0,r.jsxs)(A.Z,{style:it,children:[(0,r.jsx)(l,{fontSize:"small"}),!Ze&&y?(0,r.jsx)(is.Z,{fontSize:"small"}):(0,r.jsx)(r.Fragment,{})]}),pn=(0,r.jsx)(zs.Z,{color:"secondary",variant:"dot",overlap:"circular",invisible:!m,className:tn()({[Ee.closedItemIcon]:!Ze}),children:It}),Bn=(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(A.Z,{"data-testid":"login-button",className:Ee.iconContainer,children:pn}),d&&(0,r.jsx)(rt.Z,{variant:"subtitle2",component:"span",className:Ee.label,children:d}),(0,r.jsx)("div",{className:Ee.secondaryAction,children:U})]}),or=Ze?Bn:pn,$t={onClick:$,className:tn()(fe,Ee.root,Ze?Ee.open:Ee.closed,Hs(e)&&Ee.buttonItem,{[Ee.highlightable]:!I})},fn=(0,p.z$)(),{pathname:gn}=(0,rr.WU)(!Hs(e)&&e.to?e.to:""),pr=(0,f.useCallback)(Cr=>{if(!J){const wr="click",jr=d!=null?d:"Sidebar Item",ms=gn?{attributes:{to:gn}}:void 0;fn.captureEvent(wr,jr,ms)}$==null||$(Cr)},[fn,d,gn,J,$]);return Hs(e)?(0,r.jsx)(ge.Z,{role:"button","aria-label":d,...$t,ref:o,onClick:pr,children:or}):(0,r.jsx)(Ea,{...$t,activeClassName:Ee.selected,to:e.to?e.to:"",ref:o,"aria-label":d||e.to,...pe,onClick:pr,children:or})}),Aa=({children:e,...o})=>{const{sidebarConfig:l}=(0,f.useContext)(ur),d=cs(l),[m,y]=(0,f.useState)(!1),I=(0,rr.TH)(),$=Oi(e,I),J=(0,Le.Z)(Te=>Te.breakpoints.down("sm")),U=()=>{y(!0)},fe=()=>{y(!1)},pe=()=>J?m?(0,r.jsx)(Ws.Z,{fontSize:"small",className:d.submenuArrow}):(0,r.jsx)(Sa.Z,{fontSize:"small",className:d.submenuArrow}):!m&&(0,r.jsx)(is.Z,{fontSize:"small",className:d.submenuArrow});return(0,r.jsx)(mi.Provider,{value:{isHoveredOn:m,setIsHoveredOn:y},children:(0,r.jsxs)("div",{"data-testid":"item-with-submenu",onMouseLeave:fe,onTouchStart:m?fe:U,onMouseEnter:U,className:tn()(m&&d.highlighted),children:[(0,r.jsx)(ki,{hasSubmenu:!0,className:$?d.selected:"",...o,children:pe()}),m&&e]})})},Bi=(0,f.forwardRef)((e,o)=>{const[l]=(0,p.vJ)(e.children,d=>d.getElements().filter(m=>m.type===ja));return l?(0,r.jsx)(Aa,{...e,children:l}):(0,r.jsx)(ki,{...e,ref:o})});function Ga(e){const{sidebarConfig:o}=useContext(SidebarConfigContext),[l,d]=useState(""),m=cs(o),y=e.icon?e.icon:SearchIcon,I=()=>{e.onSearch(l),d("")},$=pe=>{pe.key==="Enter"&&(pe.preventDefault(),I())},J=pe=>{d(pe.target.value)},U=pe=>{pe.preventDefault(),pe.stopPropagation()},fe=pe=>{I(),pe.preventDefault()};return _jsx(Box,{className:m.searchRoot,children:_jsx(Bi,{icon:y,to:e.to,onClick:fe,disableHighlight:!0,children:_jsx(TextField,{placeholder:"Search",value:l,onClick:U,onChange:J,onKeyDown:$,className:m.searchContainer,InputProps:{disableUnderline:!0,className:m.searchField},inputProps:{className:m.searchFieldHTMLInput}})})})}const Ka=(0,ss.Z)("div")({flex:1},{name:"BackstageSidebarSpace"}),Ya=(0,ss.Z)("div")({height:8},{name:"BackstageSidebarSpacer"}),Ta=(0,ss.Z)("hr")(({theme:e})=>({height:1,width:"100%",background:"#383838",border:"none",margin:e.spacing(1.2,0)}),{name:"BackstageSidebarDivider"}),Ra=e=>({overflowY:"auto","&::-webkit-scrollbar":{backgroundColor:e.palette.background.default,width:"5px",borderRadius:"5px"},"&::-webkit-scrollbar-thumb":{backgroundColor:e.palette.text.secondary,borderRadius:"5px"}}),Ja=(0,ss.Z)("div")(({theme:e})=>{const o=Ra(e);return{flex:"0 1 auto",overflowX:"hidden",width:"calc(100% - 5px)",minHeight:"48px",overflowY:"hidden","@media (hover: none)":o,"&:hover":o}}),$i=()=>{const{sidebarConfig:e}=useContext(SidebarConfigContext),o=cs(e),{isOpen:l,setOpen:d}=useSidebarOpenState();if(useMediaQuery(I=>I.breakpoints.down("md"),{noSsr:!0}))return null;const y=()=>{d(!l)};return _jsx(Button,{role:"button",onClick:y,className:o.expandButton,"aria-label":"Expand Sidebar","data-testid":"sidebar-expand-button",children:_jsx(Box,{className:o.arrows,children:l?_jsx(DoubleArrowLeft,{}):_jsx(DoubleArrowRight,{})})})},Di=(0,g.Z)(e=>({introCard:o=>({color:"#b5b5b5",fontSize:12,width:o.sidebarConfig.drawerWidthOpen,marginTop:e.spacing(2.25),marginBottom:e.spacing(1.5),paddingLeft:o.sidebarConfig.iconPadding,paddingRight:o.sidebarConfig.iconPadding}),introDismiss:{display:"flex",justifyContent:"flex-end",alignItems:"center",marginTop:e.spacing(1.5)},introDismissLink:{color:"#dddddd",display:"flex",alignItems:"center",marginBottom:e.spacing(.5),"&:hover":{color:e.palette.linkHover,transition:e.transitions.create("color",{easing:e.transitions.easing.sharp,duration:e.transitions.duration.shortest})}},introDismissText:{fontSize:"0.7rem",fontWeight:"bold",textTransform:"uppercase",letterSpacing:1},introDismissIcon:{width:18,height:18,marginRight:e.spacing(1.5)}}),{name:"BackstageSidebarIntro"});function Ni(e){const{sidebarConfig:o}=useContext(SidebarConfigContext),l=Di({sidebarConfig:o}),{text:d,onClose:m}=e,y=()=>m();return _jsxs(Box,{className:l.introCard,children:[_jsx(Typography,{variant:"subtitle2",children:d}),_jsx(Box,{className:l.introDismiss,children:_jsxs(IconButton,{onClick:y,className:l.introDismissLink,children:[_jsx(CloseIcon,{className:l.introDismissIcon}),_jsx(Typography,{component:"span",className:l.introDismissText,children:"Dismiss"})]})})]})}const Gs=e=>{const{text:o,onDismiss:l}=e,[d,m]=useState(!1),y=()=>{m(!0)};return _jsx(Collapse,{in:!d,onExited:l,children:_jsx(Ni,{text:o,onClose:y})})},Fi=null,Zi="And your recently viewed plugins will pop up here!";function Ia(e){const{isOpen:o}=useSidebarOpenState(),l={starredItemsDismissed:!1,recentlyViewedItemsDismissed:!1},{value:d,set:m}=useLocalStorageValue(SIDEBAR_INTRO_LOCAL_STORAGE),{starredItemsDismissed:y,recentlyViewedItemsDismissed:I}=d!=null?d:{},$=()=>{m(U=>({...l,...U,starredItemsDismissed:!0}))},J=()=>{m(U=>({...l,...U,recentlyViewedItemsDismissed:!0}))};return o?_jsxs(_Fragment,{children:[!y&&_jsxs(_Fragment,{children:[_jsx(Gs,{text:Fi,onDismiss:$}),_jsx(SidebarDivider,{})]}),!I&&_jsx(Gs,{text:Zi,onDismiss:J})]}):null}const Ui=(0,g.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 Ks(e){const{className:o,stretch:l,noPadding:d,children:m,...y}=e,{contentRef:I}=os(),$=Ui();return(0,r.jsx)("article",{ref:I,tabIndex:-1,...y,className:tn()($.root,o,{[$.stretch]:l,[$.noPadding]:d}),children:m})}var Mi=n(6487),Pa=n(99152);const zi=(0,g.Z)(e=>({tabsWrapper:{gridArea:"pageSubheader",backgroundColor:e.palette.background.paper,paddingLeft:e.spacing(3),minWidth:0},defaultTab:{...e.typography.caption,padding:e.spacing(3,3),textTransform:"uppercase",fontWeight:e.typography.fontWeightBold,color:e.palette.text.secondary},selected:{color:e.palette.text.primary},tabRoot:{"&:hover":{backgroundColor:e.palette.background.default,color:e.palette.text.primary}}}),{name:"BackstageHeaderTabs"});function Ys(e){const{tabs:o,onChange:l,selectedIndex:d}=e,[m,y]=(0,f.useState)(d!=null?d:0),I=zi(),$=(0,f.useCallback)((J,U)=>{d===void 0&&y(U),l&&d!==U&&l(U)},[d,l]);return(0,f.useEffect)(()=>{d!==void 0&&y(d)},[d]),(0,r.jsx)(A.Z,{className:I.tabsWrapper,children:(0,r.jsx)(Pa.Z,{selectionFollowsFocus:!0,indicatorColor:"primary",textColor:"inherit",variant:"scrollable",scrollButtons:"auto","aria-label":"tabs",onChange:$,value:m,children:o.map((J,U)=>(0,f.createElement)(Mi.Z,{...J.tabProps,"data-testid":`header-tab-${U}`,label:J.label,key:J.id,value:U,className:I.defaultTab,classes:{selected:I.selected,root:I.tabRoot}}))})})}function La(e){const o=(0,rr.UO)(),d=e.map(({path:Te,children:Ee})=>({caseSensitive:!1,path:`${Te}/*`,element:Ee})).sort((Te,Ee)=>Ee.path.replace(/\/\*$/,"").localeCompare(Te.path.replace(/\/\*$/,"")));var m;const y=(m=(0,rr.V$)(d))!==null&&m!==void 0?m:e[0].children;var I;let $=(I=o["*"])!==null&&I!==void 0?I:"";$.startsWith("/")||($=`/${$}`);var J;const[U]=(J=(0,Xo.fp)(d,$))!==null&&J!==void 0?J:[],fe=U?e.findIndex(Te=>`${Te.path}/*`===U.route.path):0;var pe;return{index:fe===-1?0:fe,element:y,route:(pe=e[fe])!==null&&pe!==void 0?pe:e[0]}}function Js(e){const{routes:o}=e,l=(0,rr.s0)(),{index:d,route:m,element:y}=La(o),I=(0,f.useMemo)(()=>o.map(J=>({id:J.path,label:J.title,tabProps:J.tabProps})),[o]),$=J=>{let{path:U}=o[J];U=U.replace(/\/\*$/,""),U=U.replace(/^\//,""),l(U)};return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(Ys,{tabs:I,selectedIndex:d,onChange:$}),(0,r.jsxs)(Ks,{children:[(0,r.jsx)(_r.q,{title:m.title}),y]})]})}const ds=()=>null;(0,p.R5)(ds,"core.gatherMountPoints",!0);function Qs(e){const o=(0,r.jsx)(ds,{path:"",title:"",children:(0,r.jsx)("div",{})}).type;return f.Children.toArray(e).flatMap(l=>{if(!(0,f.isValidElement)(l))return[];if(l.type===f.Fragment)return Qs(l.props.children);if(l.type!==o)throw new Error("Child of TabbedLayout must be an TabbedLayout.Route");const{path:d,title:m,children:y,tabProps:I}=l.props;return[{path:d,title:m,children:y,tabProps:I}]})}function Wi(e){const o=Qs(e.children);return(0,r.jsx)(Js,{routes:o})}Wi.Route=ds;const Vi=(0,g.Z)(e=>({value:{marginBottom:e.spacing(.75)},subvalue:{color:e.palette.textSubtle,fontWeight:"normal"}}),{name:"BackstageSubvalueCell"});function Hi(e){const{value:o,subvalue:l}=e,d=Vi();return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(A.Z,{className:d.value,children:o}),(0,r.jsx)(A.Z,{className:d.subvalue,children:l})]})}var Oo=n(67222),hr=n(21070),Gi=n(90324),Ki=n(98281),Yi=n(48049),us=n(51209),Xs=n(33375),Ji=n(44233),Qi=n(27604),hs=n(36444),Oa=n(37971),Xi=n(59709),i=n(17373),t=n(3702),s=n(93111);const a=(0,g.Z)(e=>({root:{height:"100%",width:"315px",display:"flex",flexDirection:"column",marginRight:e.spacing(3)},value:{fontWeight:"bold",fontSize:18},header:{display:"flex",alignItems:"center",height:e.spacing(7.5),justifyContent:"space-between",borderBottom:`1px solid ${e.palette.grey[500]}`},filters:{display:"flex",flexDirection:"column","& > *":{marginTop:e.spacing(2)}}}),{name:"BackstageTableFilters"}),h=e=>{var o;const l=a(),{onChangeFilters:d}=e,[m,y]=(0,f.useState)({...e.selectedFilters}),[I,$]=(0,f.useState)(!1),J=()=>{y({}),$(U=>!U)};return(0,f.useEffect)(()=>{d(m)},[m,d]),(0,r.jsxs)(A.Z,{className:l.root,children:[(0,r.jsxs)(A.Z,{className:l.header,children:[(0,r.jsx)(A.Z,{className:l.value,children:"Filters"}),(0,r.jsx)(ge.Z,{color:"primary",onClick:J,children:"Clear all"})]}),(0,r.jsx)(A.Z,{className:l.filters,children:((o=e.filters)===null||o===void 0?void 0:o.length)&&e.filters.map(U=>(0,r.jsx)(Ao,{triggerReset:I,...U.element,selected:m[U.element.label],onChange:fe=>y({...m,[U.element.label]:fe})},U.element.label))})]})},w={Add:(0,f.forwardRef)((e,o)=>(0,r.jsx)(hr.Z,{...e,ref:o})),Check:(0,f.forwardRef)((e,o)=>(0,r.jsx)(Ki.Z,{...e,ref:o})),Clear:(0,f.forwardRef)((e,o)=>(0,r.jsx)(Xs.Z,{...e,ref:o})),Delete:(0,f.forwardRef)((e,o)=>(0,r.jsx)(Ji.Z,{...e,ref:o})),DetailPanel:(0,f.forwardRef)((e,o)=>(0,r.jsx)(us.Z,{...e,ref:o})),Edit:(0,f.forwardRef)((e,o)=>(0,r.jsx)(Qi.Z,{...e,ref:o})),Export:(0,f.forwardRef)((e,o)=>(0,r.jsx)(t.Z,{...e,ref:o})),Filter:(0,f.forwardRef)((e,o)=>(0,r.jsx)(hs.Z,{...e,ref:o})),FirstPage:(0,f.forwardRef)((e,o)=>(0,r.jsx)(Oa.Z,{...e,ref:o})),LastPage:(0,f.forwardRef)((e,o)=>(0,r.jsx)(Xi.Z,{...e,ref:o})),NextPage:(0,f.forwardRef)((e,o)=>(0,r.jsx)(us.Z,{...e,ref:o})),PreviousPage:(0,f.forwardRef)((e,o)=>(0,r.jsx)(Yi.Z,{...e,ref:o})),ResetSearch:(0,f.forwardRef)((e,o)=>(0,r.jsx)(Xs.Z,{...e,ref:o})),Search:(0,f.forwardRef)((e,o)=>(0,r.jsx)(hs.Z,{...e,ref:o})),SortArrow:(0,f.forwardRef)((e,o)=>(0,r.jsx)(Gi.Z,{...e,ref:o})),ThirdStateCheck:(0,f.forwardRef)((e,o)=>(0,r.jsx)(i.Z,{...e,ref:o})),ViewColumn:(0,f.forwardRef)((e,o)=>(0,r.jsx)(s.Z,{...e,ref:o}))};function B(e,o){const l=o.split(".");let d=e[l[0]];for(let m=1;m<l.length;++m){if(d===void 0)return d;const y=l[m];d=d[y]}return d}const F=(0,Ln.Z)(e=>({header:{padding:e.spacing(1,2,1,2.5),borderTop:`1px solid ${e.palette.grey.A100}`,borderBottom:`1px solid ${e.palette.grey.A100}`,fontWeight:e.typography.fontWeightBold,position:"static",wordBreak:"normal"}}),{name:"BackstageTableHeader"})(Oo.W$),ie=(0,Ln.Z)(e=>({root:{padding:e.spacing(3,0,2.5,2.5)},title:{"& > h6":{fontWeight:e.typography.fontWeightBold}},searchField:{paddingRight:e.spacing(2)}}),{name:"BackstageTableToolbar"})(Oo.UW),xe=(0,g.Z)(e=>({root:{display:"flex",alignItems:"center",justifyContent:"space-between"},title:{fontWeight:e.typography.fontWeightBold,fontSize:18,whiteSpace:"nowrap"}}),{name:"BackstageTableFiltersContainer"}),Re=(0,g.Z)(()=>({root:{display:"flex",alignItems:"start"}}),{name:"BackstageTable"});function ze(e,o){return e.map(l=>{var d;const m=(d=l.headerStyle)!==null&&d!==void 0?d:{};let y=l.cellStyle||{};if(l.highlight)if(m.color=o.palette.textContrast,typeof y=="object")y.fontWeight=o.typography.fontWeightBold;else{const I=y;y=($,J,U)=>({...I($,J,U),fontWeight:o.typography.fontWeightBold})}return{...l,headerStyle:m,cellStyle:y}})}function ft(e,o){return(0,Xr.transform)(e,(l,d,m)=>{(0,Xr.isEqual)(d,o[m])||(l[m]=d)})}const Et={search:"",filtersOpen:!1,filters:{}};function vt(e){const{toolbarRef:o,setSearch:l,hasFilters:d,selectedFiltersLength:m,toggleFilters:y}=e,I=xe(),$=(0,f.useCallback)(J=>{e.onSearchChanged(J),l(J)},[e,l]);return d?(0,r.jsxs)(A.Z,{className:I.root,children:[(0,r.jsxs)(A.Z,{className:I.root,children:[(0,r.jsx)(H.Z,{onClick:y,"aria-label":"filter list",children:(0,r.jsx)(hs.Z,{})}),(0,r.jsxs)(rt.Z,{className:I.title,children:["Filters (",m,")"]})]}),(0,r.jsx)(ie,{...e,ref:o,onSearchChanged:$})]}):(0,r.jsx)(ie,{...e,ref:o,onSearchChanged:$})}function Wt(e){const{data:o,columns:l,options:d,title:m,subtitle:y,filters:I,initialState:$,emptyContent:J,onStateChange:U,components:fe,...pe}=e,Te=Re(),Ee=(0,le.Z)(),Ze={...Et,...$},[it,It]=(0,f.useState)(Ze.filtersOpen),pn=(0,f.useCallback)(()=>It(Vn=>!Vn),[It]),[Bn,or]=(0,f.useState)(0),[$t,fn]=(0,f.useState)(o),[gn,pr]=(0,f.useState)(Ze.filters),Cr=ze(l,Ee),[wr,jr]=(0,f.useState)(Ze.search);(0,f.useEffect)(()=>{if(U){const Vn=ft({search:wr,filtersOpen:it,filters:gn},Et);U(Vn)}},[wr,it,gn,U]);const ms={headerStyle:{textTransform:"uppercase"}},to=(0,f.useCallback)(Vn=>{var kr;return(kr=l.find(po=>po.title===Vn))===null||kr===void 0?void 0:kr.field},[l]);(0,f.useEffect)(()=>{if(typeof o=="function")return;if(!gn){fn(o);return}const Vn=Object.values(gn);if(o&&Vn.flat().length){const kr=o.filter(po=>!!Object.entries(gn).filter(([,fo])=>!!fo.length).every(([fo,En])=>{const On=B(po,to(fo));return Array.isArray(On)&&Array.isArray(En)?On.some($o=>En.includes($o)):Array.isArray(On)?On.includes(En):Array.isArray(En)?En.includes(On):On===En}));fn(kr)}else fn(o);or(Vn.flat().length)},[o,gn,to]);const sa=(Vn,kr)=>{const po=En=>{const On=new Set,$o=go=>{go!=null&&On.add(go)};return kr&&kr.forEach(go=>{const vs=B(go,to(En));Array.isArray(vs)?vs.forEach($o):$o(vs)}),On},fo=En=>({placeholder:"All results",label:En.column,multiple:En.type==="multiple-select",items:[...po(En.column)].sort().map(On=>({label:On,value:On}))});return Vn.map(En=>({type:En.type,element:fo(En)}))},an=!!(I!=null&&I.length),Bo=(0,f.useCallback)(Vn=>(0,r.jsx)(vt,{setSearch:jr,hasFilters:an,selectedFiltersLength:Bn,toggleFilters:pn,...Vn}),[pn,an,Bn,jr]),_s=typeof o!="function"&&o.length===0,no=l.length,ia=(0,f.useCallback)(Vn=>J&&_s?(0,r.jsx)("tbody",{children:(0,r.jsx)("tr",{children:(0,r.jsx)("td",{colSpan:no,children:J})})}):(0,r.jsx)(Oo.os,{...Vn}),[_s,J,no]);return(0,r.jsxs)(A.Z,{className:Te.root,children:[it&&o&&typeof o!="function"&&(I==null?void 0:I.length)&&(0,r.jsx)(h,{filters:sa(I,o),selectedFilters:gn,onChangeFilters:pr}),(0,r.jsx)(Oo.ZP,{components:{Header:F,Toolbar:Bo,Body:ia,...fe},options:{...ms,...d},columns:Cr,icons:w,title:(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(rt.Z,{variant:"h5",component:"h2",children:m}),y&&(0,r.jsx)(rt.Z,{color:"textSecondary",variant:"body1",children:y})]}),data:typeof o=="function"?o:$t,style:{width:"100%"},localization:{toolbar:{searchPlaceholder:"Filter",searchTooltip:"Filter"}},...pe})]})}Wt.icons=Object.freeze(w);var Ft=n(44311);function Sr(e,o){const l=e[e.length-1];if(l)return l>=.9?o.palette.status.ok:l>=.5?o.palette.status.warning:o.palette.status.error}function Wn(e){const o=useTheme();if(!e.data)return null;var l;return _jsxs(Sparklines,{width:120,height:30,min:0,max:1,...e,children:[e.title&&_jsx("title",{children:e.title}),_jsx(SparklinesLine,{color:(l=e.color)!==null&&l!==void 0?l:Sr(e.data,o)})]})}const Or=e=>(0,g.Z)(o=>({container:{width:"100%",display:"flex",flexDirection:"row",flexWrap:"wrap",justifyContent:"flex-end",alignItems:"center",marginBottom:o.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:o.spacing(1),minWidth:0,overflow:"visible"},description:{},title:{display:"inline-flex",marginBottom:0}}),{name:"BackstageContentHeader"}),zr=({title:e="Unknown page",className:o})=>(0,r.jsx)(rt.Z,{variant:"h4",component:"h2",className:o,"data-testid":"header-title",children:e});function qi(e){const{description:o,title:l,titleComponent:d=void 0,children:m,textAlign:y="left"}=e,I=Or({textAlign:y})(),$=d||(0,r.jsx)(zr,{title:l,className:I.title});return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(_r.q,{title:l}),(0,r.jsxs)(A.Z,{className:I.container,children:[(0,r.jsxs)(A.Z,{className:I.leftItemsBox,children:[$,o&&(0,r.jsx)(rt.Z,{className:I.description,variant:"body2",children:o})]}),(0,r.jsx)(A.Z,{className:I.rightItemsBox,children:m})]})]})}var _i=n.p+"static/mic-drop.fe3ef4d0..svg";const ps=(0,g.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"}),ea=()=>{const e=ps();return(0,r.jsx)("img",{src:_i,className:e.micDrop,alt:"Girl dropping mic from her hands"})},eo=(0,g.Z)(e=>({container:{padding:e.spacing(8),[e.breakpoints.down("xs")]:{padding:e.spacing(2)}},title:{paddingBottom:e.spacing(5),[e.breakpoints.down("xs")]:{paddingBottom:e.spacing(4),fontSize:e.typography.h3.fontSize}},subtitle:{color:e.palette.textSubtle}}),{name:"BackstageErrorPage"});function Qa(e){const{status:o,statusMessage:l,additionalInfo:d,supportUrl:m}=e,y=eo(),I=(0,rr.s0)(),$=co();return(0,r.jsxs)(Gt.Z,{container:!0,spacing:0,className:y.container,children:[(0,r.jsxs)(Gt.Z,{item:!0,xs:12,sm:8,md:4,children:[(0,r.jsxs)(rt.Z,{"data-testid":"error",variant:"body1",className:y.subtitle,children:["ERROR ",o,": ",l]}),(0,r.jsx)(rt.Z,{variant:"body1",className:y.subtitle,children:d}),(0,r.jsx)(rt.Z,{variant:"h2",className:y.title,children:"Looks like someone dropped the mic!"}),(0,r.jsxs)(rt.Z,{variant:"h6",children:[(0,r.jsx)(ue.r,{to:"#","data-testid":"go-back-link",onClick:()=>I(-1),children:"Go back"}),"... or please"," ",(0,r.jsx)(ue.r,{to:m||$.url,children:"contact support"})," if you think this is a bug."]})]}),(0,r.jsx)(ea,{})]})}var Xa=n(16173);const qa=(0,Ln.Z)({root:{textDecoration:"underline",cursor:"pointer"}},{name:"BackstageBreadcrumbsClickableText"})(rt.Z),ta=(0,Ln.Z)({root:{textDecoration:"underline",color:"inherit"}},{name:"BackstageBreadcrumbsStyledBox"})(A.Z);function _a(e){const{children:o,...l}=e,[d,m]=f.useState(null),y=f.Children.toArray(o),[I,$,...J]=y,U=J.length?J.pop():y[y.length-1],fe=y.length>3,pe=Ze=>{m(Ze.currentTarget)},Te=()=>{m(null)},Ee=Boolean(d);return(0,r.jsxs)(f.Fragment,{children:[(0,r.jsxs)(Xa.Z,{"aria-label":"breadcrumb",...l,children:[y.length>1&&(0,r.jsx)(ta,{clone:!0,children:I}),y.length>2&&(0,r.jsx)(ta,{clone:!0,children:$}),fe&&(0,r.jsx)(qa,{onClick:pe,children:"..."}),(0,r.jsx)(A.Z,{style:{fontStyle:"italic"},children:U})]}),(0,r.jsx)(tr.ZP,{open:Ee,anchorEl:d,onClose:Te,anchorOrigin:{vertical:"bottom",horizontal:"left"},transformOrigin:{vertical:"top",horizontal:"left"},children:(0,r.jsx)(St.Z,{children:J.map((Ze,it)=>(0,r.jsx)(Ot.Z,{button:!0,children:(0,r.jsx)(ta,{clone:!0,children:Ze})},it))})})]})}const el=(0,g.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"}),tl=({type:e,typeLink:o,classes:l,pageTitle:d})=>e?o?(0,r.jsxs)(_a,{className:l.breadcrumb,children:[(0,r.jsx)(ue.r,{to:o,children:e}),(0,r.jsx)(rt.Z,{children:d})]}):(0,r.jsx)(rt.Z,{className:l.type,children:e}):null,nl=({pageTitle:e,classes:o,tooltip:l})=>{const d=(0,r.jsx)(rt.Z,{className:o.title,variant:"h1",children:e});return l?(0,r.jsx)(T.ZP,{title:l,placement:"top-start",children:d}):d},rl=({classes:e,subtitle:o})=>o?typeof o!="string"?(0,r.jsx)(r.Fragment,{children:o}):(0,r.jsx)(rt.Z,{className:e.subtitle,variant:"subtitle2",component:"span",children:o}):null;function ka(e){const{children:o,pageTitleOverride:l,style:d,subtitle:m,title:y,tooltip:I,type:$,typeLink:J}=e,U=el(),pe=(0,p.h_)(p.Ds).getOptionalString("app.title")||"Backstage",Te=l||y,Ee=y||l,Ze=`${Te} | %s | ${pe}`,it=`${Te} | ${pe}`;return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(_r.q,{titleTemplate:Ze,defaultTitle:it}),(0,r.jsxs)("header",{style:d,className:U.header,children:[(0,r.jsxs)(A.Z,{className:U.leftItemsBox,children:[(0,r.jsx)(tl,{classes:U,type:$,typeLink:J,pageTitle:Ee}),(0,r.jsx)(nl,{classes:U,pageTitle:Ee,tooltip:I}),(0,r.jsx)(rl,{classes:U,subtitle:m})]}),(0,r.jsx)(Gt.Z,{container:!0,className:U.rightItemsBox,spacing:4,children:o})]})]})}const ol=({label:e,secondaryLabel:o,icon:l,disabled:d=!1,onClick:m})=>_jsx(Fragment,{children:_jsxs(ListItem,{"data-testid":"header-action-item",disabled:d,button:!0,onClick:y=>{m&&m(y)},children:[l&&_jsx(ListItemIcon,{children:l}),_jsx(ListItemText,{primary:e,secondary:o})]})});function Dl(e){const{palette:{common:{white:o}}}=useTheme(),{actionItems:l}=e,[d,m]=React.useState(!1),y=React.useRef(null);return _jsxs(Fragment,{children:[_jsx(IconButton,{onClick:()=>m(!0),"data-testid":"header-action-menu",ref:y,style:{color:o,height:56,width:56,marginRight:-4,padding:0},children:_jsx(MoreVert,{})}),_jsx(Popover,{open:d,anchorEl:y.current,anchorOrigin:{horizontal:"right",vertical:"bottom"},transformOrigin:{horizontal:"right",vertical:"top"},onClose:()=>m(!1),children:_jsx(List,{children:l.map((I,$)=>_jsx(ol,{...I},`header-action-menu-${$}`))})})]})}const sl=(0,g.Z)(e=>({root:{textAlign:"left"},label:{color:e.page.fontColor,fontWeight:e.typography.fontWeightBold,letterSpacing:0,fontSize:e.typography.fontSize,marginBottom:e.spacing(1)/2,lineHeight:1},value:{color:(0,Kt.Fq)(e.page.fontColor,.8),fontSize:e.typography.fontSize,lineHeight:1}}),{name:"BackstageHeaderLabel"}),il=({value:e,className:o})=>(0,r.jsx)(rt.Z,{component:typeof e=="string"?"p":"span",className:o,children:e});function al(e){const{label:o,value:l,url:d}=e,m=sl(),y=(0,r.jsx)(il,{className:m.value,value:l||"<Unknown>"});return(0,r.jsx)(Gt.Z,{item:!0,children:(0,r.jsxs)(rt.Z,{component:"span",className:m.root,children:[(0,r.jsx)(rt.Z,{className:m.label,children:o}),d?(0,r.jsx)(ue.r,{to:d,children:y}):y]})})}const ll=e=>(0,Jn.Z)({root:{color:e.palette.common.white,padding:e.spacing(2,2,3),backgroundImage:e.getPageTheme({themeId:"card"}).backgroundImage,backgroundPosition:0,backgroundSize:"inherit"}}),cl=(0,g.Z)(ll,{name:"BackstageItemCardHeader"});function dl(e){const{title:o,subtitle:l,children:d}=e,m=cl(e);return(0,r.jsxs)(A.Z,{className:m.root,children:[l&&(0,r.jsx)(rt.Z,{variant:"subtitle2",component:"h3",children:l}),o&&(0,r.jsx)(rt.Z,{variant:"h6",component:"h4",children:o}),d]})}function Nl(e){const{description:o,tags:l,title:d,type:m,subtitle:y,label:I,onClick:$,href:J}=e;return _jsxs(Card,{children:[_jsx(CardMedia,{children:_jsx(ItemCardHeader,{title:d,subtitle:y||m})}),_jsxs(CardContent,{children:[l!=null&&l.length?_jsx(Box,{children:l.map((U,fe)=>_jsx(Chip,{size:"small",label:U},fe))}):null,o]}),_jsxs(CardActions,{children:[!J&&_jsx(LinkButton,{to:"#",onClick:$,color:"primary",children:I}),J&&_jsx(LinkButton,{to:J,color:"primary",children:I})]})]})}const ul=e=>(0,Jn.Z)({root:{display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(22em, 1fr))",gridAutoRows:"1fr",gridGap:e.spacing(2)}}),hl=(0,g.Z)(ul,{name:"BackstageItemCardGrid"});function pl(e){const{children:o,...l}=e,d=hl(l);return(0,r.jsx)(A.Z,{className:d.root,...l,children:o})}var fl=n(41547);const gl=(0,g.Z)(e=>({root:{display:"grid",gridTemplateAreas:"'pageHeader pageHeader pageHeader' 'pageSubheader pageSubheader pageSubheader' 'pageNav pageContent pageSidebar'",gridTemplateRows:"max-content auto 1fr",gridTemplateColumns:"auto 1fr auto",overflowY:"auto",height:"100vh",[e.breakpoints.down("xs")]:{height:"100%"},"@media print":{display:"block",height:"auto",overflowY:"inherit"}}}),{name:"BackstagePage"});function Ba(e){const{themeId:o,children:l}=e,d=gl();return(0,r.jsx)(fl.Z,{theme:m=>({...m,page:m.getPageTheme({themeId:o})}),children:(0,r.jsx)("main",{className:d.root,children:l})})}function ml(e){const{themeId:o,children:l,...d}=e;return(0,r.jsxs)(Ba,{themeId:o,children:[(0,r.jsx)(ka,{...d}),l]})}var Xn=n(30195);const Fl=Xn.z.object({providerInfo:Xn.z.object({}).catchall(Xn.z.unknown()).optional(),profile:Xn.z.object({email:Xn.z.string().optional(),displayName:Xn.z.string().optional(),picture:Xn.z.string().optional()}),backstageIdentity:Xn.z.object({token:Xn.z.string(),identity:Xn.z.object({type:Xn.z.literal("user"),userEntityRef:Xn.z.string(),ownershipEntityRefs:Xn.z.array(Xn.z.string())})})}),$a={defaultTokenExpiryMillis:5*60*1e3,tokenExpiryMarginMillis:5*60*1e3};function vl(e){const o=new Date(Date.now()+$a.defaultTokenExpiryMillis);if(!e)return o;const[l,d,m]=e.split("."),y=JSON.parse(window.atob(d));return typeof y.exp!="number"?o:new Date(y.exp*1e3-$a.tokenExpiryMarginMillis)}class Zl{async start(){await this.getSessionAsync()}getUserId(){const{backstageIdentity:o}=this.getSessionSync(),l=o.identity.userEntityRef,d=/^([^:/]+:)?([^:/]+\/)?([^:/]+)$/.exec(l);if(!d)throw new TypeError(`Invalid user entity reference "${l}"`);return d[3]}async getIdToken(){return(await this.getSessionAsync()).backstageIdentity.token}getProfile(){return this.getSessionSync().profile}async getProfileInfo(){return(await this.getSessionAsync()).profile}async getBackstageIdentity(){return(await this.getSessionAsync()).backstageIdentity.identity}async getCredentials(){return{token:(await this.getSessionAsync()).backstageIdentity.token}}async signOut(){this.abortController.abort()}getSessionSync(){if(this.state.type==="active")return this.state.session;if(this.state.type==="fetching"&&this.state.previous)return this.state.previous;throw new Error("No session available. Try reloading your browser page.")}async getSessionAsync(){if(this.state.type==="fetching")return this.state.promise;if(this.state.type==="active"&&new Date<this.state.expiresAt)return this.state.session;const o=this.state.type==="active"?this.state.session:void 0,l=this.fetchSession().then(d=>(this.state={type:"active",session:d,expiresAt:vl(d.backstageIdentity.token)},d),d=>{throw this.state={type:"failed",error:d},d});return this.state={type:"fetching",promise:l,previous:o},l}async fetchSession(){const o=await this.options.discoveryApi.getBaseUrl("auth"),l=typeof this.options.headers=="function"?await this.options.headers():this.options.headers,d=new Headers(l);d.set("X-Requested-With","XMLHttpRequest");const m=await fetch(`${o}/${this.options.provider}/refresh`,{signal:this.abortController.signal,headers:d,credentials:"include"});if(!m.ok)throw await ResponseError.fromResponse(m);return proxiedSessionSchema.parse(await m.json())}constructor(o){_define_property(this,"options",void 0),_define_property(this,"abortController",void 0),_define_property(this,"state",void 0),this.options=o,this.abortController=new AbortController,this.state={type:"empty"}}}const Ul=e=>{const o=useApi(discoveryApiRef),[{status:l,error:d},{execute:m}]=useAsync(async()=>{const y=new ProxiedSignInIdentity({provider:e.provider,discoveryApi:o,headers:e.headers});await y.start(),e.onSignInSuccess(y)});return useMountEffect(m),l==="loading"?_jsx(Progress,{}):d?_jsx(ErrorPanel,{title:"You do not appear to be signed in. Please try reloading the browser page.",error:d}):null},yl=(0,g.Z)({container:{padding:0,listStyle:"none"},item:{display:"flex",flexDirection:"column",width:"100%",maxWidth:"400px",margin:0,padding:0}},{name:"BackstageSignInPage"}),na=({children:e})=>{const o=yl();return(0,r.jsx)(Gt.Z,{component:"li",item:!0,classes:o,children:e})};var fs=n(87612);class ra{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 o="user:default/guest";return{type:"user",userEntityRef:o,ownershipEntityRefs:[o]}}async getCredentials(){return{}}async signOut(){}}function xl(e){const[o,l,d]=e.split(".");return JSON.parse(window.atob(l))}class oa{getUserId(){return this.result.userId}static fromResult(o){return new oa(o)}async getIdToken(){var o,l;return(l=(o=this.result).getIdToken)===null||l===void 0?void 0:l.call(o)}getProfile(){return this.result.profile}async getProfileInfo(){return this.result.profile}async getBackstageIdentity(){const o=await this.getIdToken();if(!o){const m=`user:default/${this.getUserId()}`;return{type:"user",userEntityRef:m,ownershipEntityRefs:[m]}}const{sub:l,ent:d}=xl(o);return{type:"user",userEntityRef:l,ownershipEntityRefs:d!=null?d:[]}}async getCredentials(){var o,l;return{token:await((l=(o=this.result).getIdToken)===null||l===void 0?void 0:l.call(o))}}async signOut(){var o,l;return(l=(o=this.result).signOut)===null||l===void 0?void 0:l.call(o)}constructor(o){(0,fs._)(this,"result",void 0),this.result=o}}class gs{static createGuest(){return new ra}static fromLegacy(o){return oa.fromResult(o)}static create(o){return new gs(o.identity,o.authApi,o.profile)}getUserId(){const o=this.identity.userEntityRef,l=/^([^:/]+:)?([^:/]+\/)?([^:/]+)$/.exec(o);if(!l)throw new TypeError(`Invalid user entity reference "${o}"`);return l[3]}async getIdToken(){return(await this.authApi.getBackstageIdentity()).token}getProfile(){if(!this.profile)throw new Error("The identity API does not implement synchronous profile fetching, use getProfileInfo() instead");return this.profile}async getProfileInfo(){if(this.profilePromise)return await this.profilePromise;try{return this.profilePromise=this.authApi.getProfile(),await this.profilePromise}catch(o){throw this.profilePromise=void 0,o}}async getBackstageIdentity(){return this.identity}async getCredentials(){return{token:(await this.authApi.getBackstageIdentity()).token}}async signOut(){return this.authApi.signOut()}constructor(o,l,d){(0,fs._)(this,"identity",void 0),(0,fs._)(this,"authApi",void 0),(0,fs._)(this,"profile",void 0),(0,fs._)(this,"profilePromise",void 0),this.identity=o,this.authApi=l,this.profile=d}}const bl={Component:({config:e,onSignInStarted:o,onSignInSuccess:l,onSignInFailure:d})=>{const{apiRef:m,title:y,message:I}=e,$=(0,p.h_)(m),J=(0,p.h_)(p.VE),U=async()=>{try{o();const fe=await $.getBackstageIdentity({instantPopup:!0});if(!fe)throw d(),new Error(`The ${y} provider is not configured to support sign-in`);const pe=await $.getProfile();l(gs.create({identity:fe.identity,profile:pe,authApi:$}))}catch(fe){d(),J.post(new ro.SP("Login failed",fe))}};return(0,r.jsx)(na,{children:(0,r.jsx)(Ir,{variant:"fullHeight",title:y,actions:(0,r.jsx)(ge.Z,{color:"primary",variant:"outlined",onClick:U,children:"Sign In"}),children:(0,r.jsx)(rt.Z,{variant:"body1",children:I})})})},loader:async(e,o)=>{const l=e.get(o),d=await l.getBackstageIdentity({optional:!0});if(!d)return;const m=await l.getProfile();return gs.create({identity:d.identity,profile:m,authApi:l})}},Sl={Component:({onSignInStarted:e,onSignInSuccess:o})=>(0,r.jsx)(na,{children:(0,r.jsx)(Ir,{title:"Guest",variant:"fullHeight",actions:(0,r.jsx)(ge.Z,{color:"primary",variant:"outlined",onClick:()=>{e(),o(new ra)},children:"Enter"}),children:(0,r.jsxs)(rt.Z,{variant:"body1",children:["Enter as a Guest User.",(0,r.jsx)("br",{}),"You will not have a verified identity,",(0,r.jsx)("br",{}),"meaning some features might be unavailable."]})})}),loader:async()=>new ra};var Cl=n(63955),Da=n(86619),Na=n(74828),wl=n(45455),jl=n.n(wl);const El=/^[a-z0-9_\-]+\.[a-z0-9_\-]+\.[a-z0-9_\-]+$/i,Al=(0,g.Z)(e=>({form:{display:"flex",flexFlow:"column nowrap"},button:{alignSelf:"center",marginTop:e.spacing(2)}}),{name:"BackstageCustomProvider"}),Fa=e=>{const{ref:o,...l}=e;return{inputRef:o,...l}},Tl={Component:({onSignInStarted:e,onSignInSuccess:o})=>{const l=Al(),{register:d,handleSubmit:m,formState:y}=(0,Cl.cI)({mode:"onChange"}),{errors:I}=y,$=({userId:J,idToken:U})=>{e(),o(gs.fromLegacy({userId:J,getIdToken:U!==void 0?async()=>U:void 0,profile:{email:`${J}@example.com`}}))};return(0,r.jsx)(na,{children:(0,r.jsxs)(Ir,{title:"Custom User",variant:"fullHeight",children:[(0,r.jsxs)(rt.Z,{variant:"body1",children:["Enter your own User ID and credentials.",(0,r.jsx)("br",{}),"This selection will not be stored."]}),(0,r.jsxs)("form",{className:l.form,onSubmit:m($),children:[(0,r.jsxs)(so.Z,{children:[(0,r.jsx)(Da.Z,{...Fa(d("userId",{required:!0})),label:"User ID",margin:"normal",error:Boolean(I.userId)}),I.userId&&(0,r.jsx)(Na.Z,{error:!0,children:I.userId.message})]}),(0,r.jsxs)(so.Z,{children:[(0,r.jsx)(Da.Z,{...Fa(d("idToken",{required:!1,validate:J=>!J||El.test(J)||"Token is not a valid OpenID Connect JWT Token"})),label:"ID Token (optional)",margin:"normal",autoComplete:"off",error:Boolean(I.idToken)}),I.idToken&&(0,r.jsx)(Na.Z,{error:!0,children:I.idToken.message})]}),(0,r.jsx)(ge.Z,{type:"submit",color:"primary",variant:"outlined",className:l.button,disabled:!(y!=null&&y.isDirty)||!jl()(I),children:"Continue"})]})]})})},loader:async()=>{}},ko="@backstage/core:SignInPage:provider",Za={guest:Sl,custom:Tl,common:bl};function Ua(e,o){if(e in o)throw new Error(`"${e}" ID is duplicated. IDs of identity providers have to be unique.`)}function Kl(e){return e.reduce((l,d)=>{if(typeof d=="string")return Ua(d,l),l[d]={components:Za[d],id:d},l;const{id:m}=d;return Ua(m,l),l[m]={components:Za.common,id:m,config:d},l},{})}const Yl=(e,o)=>{const l=useApi(errorApiRef),d=useApiHolder(),[m,y]=useState(!0),I=useCallback(J=>{o(IdentityApiSignOutProxy.from({identityApi:J,signOut:async()=>{var U;localStorage.removeItem(ko),await((U=J.signOut)===null||U===void 0?void 0:U.call(J))}}))},[o]);useLayoutEffect(()=>{var J;if(!m)return;const U=localStorage.getItem(ko);if(U===null){y(!1);return}const fe=e[U];if(!fe){y(!1);return}let pe=!1;return fe.components.loader(d,(J=fe.config)===null||J===void 0?void 0:J.apiRef).then(Te=>{if(pe){localStorage.removeItem(ko);return}Te?I(Te):y(!1)}).catch(Te=>{localStorage.removeItem(ko),!pe&&(l.post(Te),y(!1))}),()=>{pe=!0}},[m,l,o,d,e,I]);const $=useMemo(()=>Object.keys(e).map(J=>{const U=e[J],{Component:fe}=U.components,pe=Ze=>{I(Ze)},Te=()=>{var Ze;localStorage.setItem(ko,(U==null||(Ze=U.config)===null||Ze===void 0?void 0:Ze.id)||U.id)},Ee=()=>{localStorage.removeItem(ko)};return _jsx(fe,{config:U.config,onSignInStarted:Te,onSignInSuccess:pe,onSignInFailure:Ee},U.id)}),[e,I]);return[m,$]},Rl=({onSignInSuccess:e,providers:o=[],title:l,align:d="left"})=>{const m=useApi(configApiRef),y=useStyles(),I=getSignInProviders(o),[$,J]=useSignInProviders(I,e);return $?_jsx(Progress,{}):_jsxs(Page,{themeId:"home",children:[_jsx(Header,{title:m.getString("app.title")}),_jsxs(Content,{children:[l&&_jsx(ContentHeader,{title:l,textAlign:d}),_jsx(Grid,{container:!0,justifyContent:d==="center"?d:"flex-start",spacing:2,component:"ul",classes:y,children:J})]})]})},Il=({provider:e,auto:o,onSignInSuccess:l})=>{const d=useStyles(),m=useApi(e.apiRef),y=useApi(configApiRef),[I,$]=useState(),[J,U]=useState(!1),fe=async({checkExisting:pe,showPopup:Te})=>{try{let Ee;if(pe&&(Ee=await m.getBackstageIdentity({optional:!0})),!Ee&&(Te||o)&&(U(!0),Ee=await m.getBackstageIdentity({instantPopup:!0}),!Ee))throw new Error(`The ${e.title} provider is not configured to support sign-in`);if(!Ee){U(!0);return}const Ze=await m.getProfile();l(UserIdentity.create({identity:Ee.identity,authApi:m,profile:Ze}))}catch(Ee){$(Ee),U(!0)}};return useMountEffect(()=>fe({checkExisting:!0})),J?_jsxs(Page,{themeId:"home",children:[_jsx(Header,{title:y.getString("app.title")}),_jsx(Content,{children:_jsx(Grid,{container:!0,justifyContent:"center",spacing:2,component:"ul",classes:d,children:_jsx(GridItem,{children:_jsxs(InfoCard,{variant:"fullHeight",title:e.title,actions:_jsx(Button,{color:"primary",variant:"outlined",onClick:()=>{fe({showPopup:!0})},children:"Sign In"}),children:[_jsx(Typography,{variant:"body1",children:e.message}),I&&I.name!=="PopupRejectedError"&&_jsx(Typography,{variant:"body1",color:"error",children:I.message})]})})})})]}):_jsx(Progress,{})};function Jl(e){return"provider"in e?_jsx(Il,{...e}):_jsx(Rl,{...e})}const Pl=(0,g.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"}),Ll=(0,Ln.Z)(e=>({root:{padding:e.spacing(2,2,2,2.5),display:"inline-block"},title:{fontWeight:700},subheader:{paddingTop:e.spacing(1)}}),{name:"BackstageTabbedCardBoldHeader"})(xo.Z);function Ql(e){const{slackChannel:o,errorBoundaryProps:l,children:d,title:m,deepLink:y,value:I,onChange:$}=e,J=Pl(),[U,fe]=useState(0),pe=$||((Ze,it)=>fe(it));let Te;I?React.Children.map(d,Ze=>{if(React.isValidElement(Ze)&&(Ze==null?void 0:Ze.props.value)===I){var it;Te=Ze==null||(it=Ze.props)===null||it===void 0?void 0:it.children}}):React.Children.map(d,(Ze,it)=>{React.isValidElement(Ze)&&it===U&&(Te=Ze==null?void 0:Ze.props.children)});const Ee=l||(o?{slackChannel:o}:{});return _jsx(Card,{children:_jsxs(ErrorBoundary,{...Ee,children:[m&&_jsx(Ll,{title:m}),_jsx(Tabs,{selectionFollowsFocus:!0,classes:J,value:I||U,onChange:pe,children:d}),_jsx(Divider,{}),_jsx(CardContent,{children:Te}),y&&_jsx(BottomLink,{...y})]})})}const Ol=(0,g.Z)(e=>({root:{minWidth:e.spacing(6),minHeight:e.spacing(3),margin:e.spacing(0,2,0,0),padding:e.spacing(.5,0,.5,0),textTransform:"none","&:hover":{opacity:1,backgroundColor:"transparent",color:e.palette.text.primary}},selected:{fontWeight:e.typography.fontWeightBold}}),{name:"BackstageCardTab"});function Xl(e){const{children:o,...l}=e,d=Ol();return _jsx(Tab,{disableRipple:!0,classes:d,...l})}},60871:function(wt,ke,n){"use strict";n.d(ke,{fC:function(){return g},CL:function(){return bt},sM:function(){return le},$v:function(){return Le},v_:function(){return Z},hg:function(){return Xe},uB:function(){return je},R5:function(){return xt},bq:function(){return P},Km:function(){return K},Ds:function(){return at},ni:function(){return A},T0:function(){return L},CO:function(){return un},x8:function(){return Tn},rx:function(){return Zn},YO:function(){return Pn},P4:function(){return Dn},NT:function(){return ln},NW:function(){return Rt},VE:function(){return zt},W0:function(){return Zt},gP:function(){return Dt},IY:function(){return nt},F4:function(){return ae},ux:function(){return H},Kp:function(){return se},$4:function(){return _e},p_:function(){return T},ZM:function(){return lt},D:function(){return _},gW:function(){return R},E6:function(){return yt},z$:function(){return Ce},h_:function(){return ge},I_:function(){return N},qD:function(){return Ke},vJ:function(){return Fn},tg:function(){return et},Oi:function(){return nn}});var r=n(52322),p=n(51837),z=n(2784);const f=(0,p.CT)("analytics-context"),W=()=>{const Se=(0,z.useContext)(f);if(Se===void 0)return{routeRef:"unknown",pluginId:"root",extension:"App"};const de=Se.atVersion(1);if(de===void 0)throw new Error("No context found for version 1.");return de},g=Se=>{const{attributes:de,children:Ie}=Se,k={...W(),...de},ce=(0,p.EI)({1:k});return(0,r.jsx)(f.Provider,{value:ce,children:Ie})};function u(Se,de){const Ie=G=>_jsx(g,{attributes:de,children:_jsx(Se,{...G})});return Ie.displayName=`WithAnalyticsContext(${Se.displayName||Se.name||"Component"})`,Ie}function N(){const Se=(0,p.Vt)("api-context");if(!Se)throw new Error("API context is not available");const de=Se.atVersion(1);if(!de)throw new Error("ApiContext v1 not available");return de}function ge(Se){const Ie=N().get(Se);if(!Ie)throw new Error(`No implementation available for ${Se}`);return Ie}function ue(Se){return function(Ie){const G=ce=>{const Pe=N(),Ue={};for(const We in Se)if(Se.hasOwnProperty(We)){const St=Se[We],Ot=Pe.get(St);if(!Ot)throw new Error(`No implementation available for ${St}`);Ue[We]=Ot}return _jsx(Ie,{...ce,...Ue})},k=Ie.displayName||Ie.name||"Component";return G.displayName=`withApis(${k})`,G}}var V=n(87612);class ne{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(de){if((0,V._)(this,"config",void 0),this.config=de,!de.id.split(".").flatMap(G=>G.split("-")).every(G=>G.match(/^[a-z][a-z0-9]*$/)))throw new Error(`API id must only contain period separated lowercase alphanum tokens with dashes, got '${de.id}'`)}}function L(Se){return new ne(Se)}function A(Se,de){return"id"in Se?{api:Se,deps:{},factory:()=>de}:Se}var le;(function(Se){Se.SignedIn="SignedIn",Se.SignedOut="SignedOut"})(le||(le={}));const se=L({id:"core.auth.google"}),ae=L({id:"core.auth.github"}),_=L({id:"core.auth.okta"}),H=L({id:"core.auth.gitlab"}),T=L({id:"core.auth.microsoft"}),R=L({id:"core.auth.onelogin"}),P=L({id:"core.auth.bitbucket"}),K=L({id:"core.auth.bitbucket-server"}),je=L({id:"core.auth.atlassian"}),Le=L({id:"core.alert"}),Z=L({id:"core.analytics"}),Xe=L({id:"core.apptheme"}),at=L({id:"core.config"}),Rt=L({id:"core.discovery"}),zt=L({id:"core.error"});var bt;(function(Se){Se[Se.None=0]="None",Se[Se.Active=1]="Active"})(bt||(bt={}));const Zt=L({id:"core.featureflags"}),Dt=L({id:"core.fetch"}),_e=L({id:"core.identity"}),lt=L({id:"core.oauthrequest"}),yt=L({id:"core.storage"}),qe=(0,p.uW)("core-plugin-api:analytics-tracker-events",()=>({mostRecentGatheredNavigation:void 0,mostRecentRoutableExtensionRender:void 0,beforeUnloadRegistered:!1})),Lt="_ROUTABLE-EXTENSION-RENDERED";class Vt{setContext(de){this.context=de}captureEvent(de,Ie,{value:G,attributes:k}={}){const{_routeNodeType:ce,...Pe}=this.context;if(de===Lt){qe.mostRecentGatheredNavigation&&(qe.mostRecentRoutableExtensionRender={context:{...Pe,extension:"App"}});return}if(qe.mostRecentGatheredNavigation){try{this.analyticsApi.captureEvent({...qe.mostRecentGatheredNavigation,...qe.mostRecentRoutableExtensionRender})}catch(Ue){console.warn("Error during analytics event capture. %o",Ue)}qe.mostRecentGatheredNavigation=void 0,qe.mostRecentRoutableExtensionRender=void 0}if(de==="navigate"&&ce==="gathered"&&Pe.pluginId==="root"){qe.mostRecentGatheredNavigation={action:de,subject:Ie,value:G,attributes:k,context:Pe};return}try{this.analyticsApi.captureEvent({action:de,subject:Ie,value:G,attributes:k,context:Pe})}catch(Ue){console.warn("Error during analytics event capture. %o",Ue)}}constructor(de,Ie={routeRef:"unknown",pluginId:"root",extension:"App"}){(0,V._)(this,"analyticsApi",void 0),(0,V._)(this,"context",void 0),this.analyticsApi=de,this.context=Ie,qe.beforeUnloadRegistered||(addEventListener("beforeunload",()=>{qe.mostRecentGatheredNavigation&&(this.analyticsApi.captureEvent({...qe.mostRecentGatheredNavigation,...qe.mostRecentRoutableExtensionRender}),qe.mostRecentGatheredNavigation=void 0,qe.mostRecentRoutableExtensionRender=void 0)},{once:!0,passive:!0}),qe.beforeUnloadRegistered=!0)}}function be(){try{return ge(Z)}catch{return{captureEvent:()=>{}}}}function Ce(){const Se=(0,z.useRef)(null),de=W(),Ie=be();function G(){return Se.current===null&&(Se.current=new Vt(Ie)),Se.current}const k=G();return k.setContext(de),k}const Ke=()=>{const Se=(0,p.Vt)("app-context");if(!Se)throw new Error("App context is not available");const de=Se.atVersion(1);if(!de)throw new Error("AppContext v1 not available");return de},Be=(0,p.uW)("component-data-store",()=>new WeakMap),gt="__backstage_data";function xt(Se,de,Ie){const G=Se;var k;let ce=(k=G[gt])!==null&&k!==void 0?k:Be.get(Se);if(ce||(ce={map:new Map},Object.defineProperty(G,gt,{enumerable:!1,configurable:!0,writable:!1,value:ce}),Be.set(Se,ce)),ce.map.has(de)){const Pe=Se.displayName||Se.name;throw new Error(`Attempted to attach duplicate data "${de}" to component "${Pe}"`)}ce.map.set(de,Ie)}function nt(Se,de){if(!Se)return;const Ie=Se.type;if(!Ie)return;var G;const k=(G=Ie[gt])!==null&&G!==void 0?G:Be.get(Ie);if(k)return k.map.get(de)}const Ye=(0,p.uW)("route-ref-type",()=>Symbol("route-ref-type"));let Ge=Ye,ct=Ge;class ut{get title(){return this.id}toString(){return`routeRef{type=absolute,id=${this.id}}`}constructor(de,Ie){(0,V._)(this,"id",void 0),(0,V._)(this,"params",void 0),(0,V._)(this,ct,void 0),this.id=de,this.params=Ie,this[Ge]="absolute"}}function ln(Se){var de;return new ut(Se.id,(de=Se.params)!==null&&de!==void 0?de:[])}const cn=/^\w+$/;let dn=null,Ht=null;class Sn{toString(){return`routeRef{type=sub,id=${this.id}}`}constructor(de,Ie,G,k){_define_property(this,"id",void 0),_define_property(this,"path",void 0),_define_property(this,"parent",void 0),_define_property(this,"params",void 0),_define_property(this,Ht,void 0),this.id=de,this.path=Ie,this.parent=G,this.params=k,this[dn]="sub"}}function Qt(Se){const{id:de,path:Ie,parent:G}=Se,k=Ie.split("/").filter(Ue=>Ue.startsWith(":")).map(Ue=>Ue.substring(1)),ce=[...G.params,...k];if(G.params.some(Ue=>k.includes(Ue)))throw new Error("SubRouteRef may not have params that overlap with its parent");if(!Ie.startsWith("/"))throw new Error(`SubRouteRef path must start with '/', got '${Ie}'`);if(Ie.endsWith("/"))throw new Error(`SubRouteRef path must not end with '/', got '${Ie}'`);for(const Ue of k)if(!cn.test(Ue))throw new Error(`SubRouteRef path has invalid param, got '${Ue}'`);return new Sn(de,Ie,G,ce)}let Xt=Ye,Cn=Xt;class tn{toString(){return`routeRef{type=external,id=${this.id}}`}constructor(de,Ie,G){(0,V._)(this,"id",void 0),(0,V._)(this,"params",void 0),(0,V._)(this,"optional",void 0),(0,V._)(this,Cn,void 0),this.id=de,this.params=Ie,this.optional=G,this[Xt]="external"}}function Tn(Se){var de;return new tn(Se.id,(de=Se.params)!==null&&de!==void 0?de:[],Boolean(Se.optional))}var $n=n(73557);function et(Se){const{pathname:de}=(0,$n.TH)(),Ie=(0,p.Vt)("routing-context");if(!Ie)throw new Error("Routing context is not available");const G=Ie.atVersion(1),k=(0,z.useMemo)(()=>G&&G.resolve(Se,{pathname:de}),[G,Se,de]);if(!Ie)throw new Error("useRouteRef used outside of routing context");if(!G)throw new Error("RoutingContext v1 not available");const ce="optional"in Se&&Se.optional;if(!k&&!ce)throw new Error(`No path for ${Se}`);return k}function nn(Se){return(0,$n.UO)()}class Gt extends z.Component{static getDerivedStateFromError(de){return{error:de}}render(){const{error:de}=this.state,{app:Ie,plugin:G}=this.props,{ErrorBoundaryFallback:k}=Ie.getComponents();return de?(0,r.jsx)(k,{error:de,resetError:this.handleErrorReset,plugin:G}):this.props.children}constructor(...de){super(...de),(0,V._)(this,"state",{error:void 0}),(0,V._)(this,"handleErrorReset",()=>{this.setState({error:void 0})})}}var rt=n(64355);function Dn(Se){const{component:de,mountPoint:Ie,name:G}=Se;return Pn({component:{lazy:()=>de().then(k=>{const ce=Ue=>{const We=Ce();try{et(Ie)}catch(St){if(typeof St=="object"&&St!==null){const{message:Ot}=St;if(typeof Ot=="string"&&Ot.startsWith("No path for "))throw new Error(`Routable extension component with mount point ${Ie} was not discovered in the app element tree. Routable extension components may not be rendered by other components and must be directly available as an element within the App provider component.`)}throw St}return(0,z.useEffect)(()=>{We.captureEvent(Lt,"")},[We]),(0,r.jsx)(k,{...Ue})},Pe=G||k.displayName||k.name||"LazyComponent";return ce.displayName=`RoutableExtension(${Pe})`,ce},k=>Pe=>{const Ue=Ke(),{BootErrorPage:We}=Ue.getComponents();return(0,r.jsx)(We,{step:"load-chunk",error:k})})},data:{"core.mountPoint":Ie},name:G})}function un(Se){const{component:de,name:Ie}=Se;return Pn({component:de,name:Ie})}function Pn(Se){const{data:de={},name:Ie}=Se;Ie||console.warn("Declaring extensions without name is DEPRECATED. Make sure that all usages of createReactExtension, createComponentExtension and createRoutableExtension provide a name.");let G;if("lazy"in Se.component){const ce=Se.component.lazy;G=(0,z.lazy)(()=>ce().then(Pe=>({default:Pe})))}else G=Se.component.sync;const k=Ie||G.displayName||G.name||"Component";return{expose(ce){const Pe=Ue=>{const We=Ke(),{Progress:St}=We.getComponents(),Ot=de==null?void 0:de["core.mountPoint"];return(0,r.jsx)(z.Suspense,{fallback:(0,r.jsx)(St,{}),children:(0,r.jsx)(Gt,{app:We,plugin:ce,children:(0,r.jsx)(g,{attributes:{pluginId:ce.getId(),...Ie&&{extension:Ie},...Ot&&{routeRef:Ot.id}},children:(0,r.jsx)(rt.o,{plugin:ce,children:(0,r.jsx)(G,{...Ue})})})})})};xt(Pe,"core.plugin",ce),xt(Pe,"core.extensionName",Ie);for(const[Ue,We]of Object.entries(de))xt(Pe,Ue,We);return Pe.displayName=`Extension(${k})`,Pe}}}function wn(Se,de,Ie,G){return z.Children.toArray(Se).flatMap(k=>{if(!(0,z.isValidElement)(k))return[];if(k.type===z.Fragment)return wn(k.props.children,de,Ie,G);if(nt(k,"core.featureFlagged")){const ce=k.props;return("with"in ce?de.isActive(ce.with):!de.isActive(ce.without))?wn(k.props.children,de,Ie,G):[]}if(Ie===void 0||Ie(k))return[k];if(G)throw new Error(G);return wn(k.props.children,de,Ie,G)})}class jn{selectByComponentData(de){const Ie=wn(this.node,this.featureFlagsApi,G=>nt(G,de.key)!==void 0,de.withStrictError);return new jn(Ie,this.featureFlagsApi)}findComponentData(de){return wn(this.node,this.featureFlagsApi,G=>nt(G,de.key)!==void 0).map(G=>nt(G,de.key)).filter(G=>G!==void 0)}getElements(){return wn(this.node,this.featureFlagsApi)}constructor(de,Ie){(0,V._)(this,"node",void 0),(0,V._)(this,"featureFlagsApi",void 0),this.node=de,this.featureFlagsApi=Ie}}function Fn(Se,de,Ie=[]){const G=ge(Zt),k=new jn(Se,G);return(0,z.useMemo)(()=>de(k),[Se,...Ie])}class Rn{getId(){return this.config.id}getApis(){var de;return(de=this.config.apis)!==null&&de!==void 0?de:[]}getFeatureFlags(){var de,Ie;return(Ie=(de=this.config.featureFlags)===null||de===void 0?void 0:de.slice())!==null&&Ie!==void 0?Ie:[]}get routes(){var de;return(de=this.config.routes)!==null&&de!==void 0?de:{}}get externalRoutes(){var de;return(de=this.config.externalRoutes)!==null&&de!==void 0?de:{}}provide(de){return de.expose(this)}__experimentalReconfigure(de){this.config.__experimentalConfigure&&(this.options=this.config.__experimentalConfigure(de))}getPluginOptions(){this.config.__experimentalConfigure&&!this.options&&(this.options=this.config.__experimentalConfigure());var de;return(de=this.options)!==null&&de!==void 0?de:{}}toString(){return`plugin{${this.config.id}}`}constructor(de){(0,V._)(this,"config",void 0),(0,V._)(this,"options",void 0),this.config=de,this.options=void 0}}function Zn(Se){return new Rn(Se)}},64355:function(wt,ke,n){"use strict";n.d(ke,{o:function(){return W},y:function(){return g}});var r=n(52322),p=n(51837),z=n(2784);const f="plugin-context",W=u=>{const{children:N,plugin:ge}=u,{Provider:ue}=(0,p.CT)(f);return(0,r.jsx)(ue,{value:(0,p.EI)({1:{plugin:ge}}),children:N})};function g(){const u=(0,p.Vt)(f);if(!u)throw new Error("Plugin Options context is not available");const N=u.atVersion(1);if(!N)throw new Error("Plugin Options v1 is not available");return N.plugin.getPluginOptions()}},23054:function(wt,ke,n){"use strict";n.d(ke,{SP:function(){return ae},dR:function(){return ne},VL:function(){return H},BD:function(){return p}});function r(T){if(typeof T!="object"||T===null||Array.isArray(T))return!1;const R=T;return!(typeof R.name!="string"||R.name===""||typeof R.message!="string")}function p(T){if(typeof T!="object"||T===null||Array.isArray(T))throw new Error(`Encountered invalid error, not an object, got '${T}'`);const R=T;if(typeof R.name!="string"||R.name==="")throw new Error(`Encountered error object without a name, got '${T}'`);if(typeof R.message!="string")throw new Error(`Encountered error object without a message, got '${T}'`)}var z=n(87612),f=n(24852);function W(T,R){const K={name:"Unknown",message:"<no reason given>",...serializeErrorInternal(T)};return R!=null&&R.includeStack||delete K.stack,K}function g(T){const R=(0,f.deserializeError)(T);return T.stack||(R.stack=void 0),R}function u(T){if(r(T)){const R=String(T);return R!=="[object Object]"?R:`${T.name}: ${T.message}`}return`unknown error '${T}'`}class N extends Error{constructor(R,P){var K;let je=R;if(P!==void 0){const Le=u(P);je?je+=`; caused by ${Le}`:je=`caused by ${Le}`}super(je),(0,z._)(this,"cause",void 0),(K=Error.captureStackTrace)===null||K===void 0||K.call(Error,this,this.constructor),this.name=this.constructor.name,this.cause=r(P)?P:void 0}}class ge extends null{}class ue extends null{}class V extends null{}class ne extends N{}class L extends null{}class A extends null{}class le extends null{}class se extends null{}class ae extends N{constructor(R,P){super(R,P),this.name=r(P)?P.name:"Error"}}async function _(T){try{const P=await T.text();if(P){var R;if(!((R=T.headers.get("content-type"))===null||R===void 0)&&R.startsWith("application/json"))try{const K=JSON.parse(P);if(K.error&&K.response)return K}catch{}return{error:{name:"Error",message:`Request failed with status ${T.status} ${T.statusText}, ${P}`},response:{statusCode:T.status}}}}catch{}return{error:{name:"Error",message:`Request failed with status ${T.status} ${T.statusText}`},response:{statusCode:T.status}}}class H extends Error{static async fromResponse(R){const P=await _(R),K=P.response.statusCode||R.status,je=P.error.name||R.statusText,Le=`Request failed with ${K} ${je}`,Z=g(P.error);return new H({message:Le,response:R,data:P,cause:Z})}constructor(R){super(R.message),(0,z._)(this,"response",void 0),(0,z._)(this,"body",void 0),(0,z._)(this,"cause",void 0),this.name="ResponseError",this.response=R.response,this.body=R.data,this.cause=R.cause}}},32838:function(wt,ke,n){"use strict";n.d(ke,{nW:function(){return se},ae:function(){return V},q3:function(){return ne}});var r=n(60871);const p=(0,r.T0)({id:"core.scmauth"});var z=new WeakMap;class f{async getCredentials(_){const H=new URL(_.url),T=_class_private_field_get(this,z).find(R=>R.isUrlSupported(H));if(!T)throw new Error(`No auth provider available for '${_.url}', see https://backstage.io/link?scm-auth`);return T.getCredentials(_)}constructor(_){_class_private_field_init(this,z,{writable:!0,value:void 0}),_class_private_field_set(this,z,_)}}var W=new WeakMap,g=new WeakMap,u=new WeakMap,N=new WeakMap;class ge{static createDefaultApiFactory(){return createApiFactory({api:scmAuthApiRef,deps:{github:githubAuthApiRef,gitlab:gitlabAuthApiRef,azure:microsoftAuthApiRef,bitbucket:bitbucketAuthApiRef},factory:({github:_,gitlab:H,azure:T,bitbucket:R})=>ge.merge(ge.forGithub(_),ge.forGitlab(H),ge.forAzure(T),ge.forBitbucket(R))})}static forAuthApi(_,H){return new ge("generic",_,H.host,H.scopeMapping)}static forGithub(_,H){var T;const R=(T=H==null?void 0:H.host)!==null&&T!==void 0?T:"github.com";return new ge("github",_,R,{default:["repo","read:org","read:user"],repoWrite:["gist"]})}static forGitlab(_,H){var T;const R=(T=H==null?void 0:H.host)!==null&&T!==void 0?T:"gitlab.com";return new ge("gitlab",_,R,{default:["read_user","read_api","read_repository"],repoWrite:["write_repository","api"]})}static forAzure(_,H){var T;const R=(T=H==null?void 0:H.host)!==null&&T!==void 0?T:"dev.azure.com";return new ge("azure",_,R,{default:["vso.build","vso.code","vso.graph","vso.project","vso.profile"],repoWrite:["vso.code_manage"]})}static forBitbucket(_,H){var T;const R=(T=H==null?void 0:H.host)!==null&&T!==void 0?T:"bitbucket.org";return new ge("bitbucket",_,R,{default:["account","team","pullrequest","snippet","issue"],repoWrite:["pullrequest:write","snippet:write","issue:write"]})}static merge(..._){return new f(_)}isUrlSupported(_){return _.host===_class_private_field_get(this,g)}getAdditionalScopesForProvider(_){var H;if(!(_!=null&&_.customScopes)||_class_private_field_get(this,N)==="generic")return[];var T;return(T=(H=_.customScopes)===null||H===void 0?void 0:H[_class_private_field_get(this,N)])!==null&&T!==void 0?T:[]}async getCredentials(_){const{url:H,additionalScope:T,...R}=_,P=_class_private_field_get(this,u).default.slice();T!=null&&T.repoWrite&&P.push(..._class_private_field_get(this,u).repoWrite);const K=this.getAdditionalScopesForProvider(T);K.length&&P.push(...K);const je=[...new Set(P)],Le=await _class_private_field_get(this,W).getAccessToken(je,R);return{token:Le,headers:{Authorization:`Bearer ${Le}`}}}constructor(_,H,T,R){_class_private_field_init(this,W,{writable:!0,value:void 0}),_class_private_field_init(this,g,{writable:!0,value:void 0}),_class_private_field_init(this,u,{writable:!0,value:void 0}),_class_private_field_init(this,N,{writable:!0,value:void 0}),_class_private_field_set(this,W,H),_class_private_field_set(this,g,T),_class_private_field_set(this,u,R),_class_private_field_set(this,N,_)}}var ue=n(40556);class V{static fromConfig(_){return ue.Lx.fromConfig(_)}}const ne=(0,r.T0)({id:"integration.scmintegrations"});var L=n(52322),A=n(73250),le=n(2784);const se=ae=>{const{type:_}=ae,H=(0,r.qD)(),T=A.Z;var R;const P=_&&(R=H.getSystemIcon(_))!==null&&R!==void 0?R:T;return(0,L.jsx)(P,{})}},40556:function(wt,ke,n){"use strict";n.d(ke,{Lx:function(){return Tr},BT:function(){return Ut}});var r=n(87612),p=n(82717),z=n.n(p),f=n(76635);function W(S){const c=new URL("http://example.com");return c.host=S,c.host===S}function g(S){try{return new URL(S),!0}catch{return!1}}function u(S,c){return{list(){return S},byUrl(b){try{const j=typeof b=="string"?new URL(b):b;return S.find(Y=>c(Y)===j.host)}catch{return}},byHost(b){return S.find(j=>c(j)===b)}}}function N(S){const{url:c,base:b,lineNumber:j}=S;try{return new URL(c),c}catch{}let Y;if(c.startsWith("/")){const{filepath:me}=z()(b);Y=new URL(b);const we=(0,f.trimEnd)(Y.pathname.substring(0,Y.pathname.length-me.length),"/");Y.pathname=`${we}${c}`}else Y=new URL(c,b);return Y.search=new URL(b).search,j&&(Y.hash=`L${j}`),Y.toString()}function ge(S){beforeAll(()=>S.listen({onUnhandledRequest:"error"})),afterAll(()=>S.close()),afterEach(()=>S.resetHandlers())}const ue="amazonaws.com";function V(S){const c=S.getOptionalString("endpoint");var b;const j=(b=S.getOptionalBoolean("s3ForcePathStyle"))!==null&&b!==void 0?b:!1;let Y,me;if(c){try{const xn=new URL(c);Y=xn.host,me=xn.pathname}catch{throw new Error(`invalid awsS3 integration config, endpoint '${c}' is not a valid URL`)}if(me!=="/")throw new Error(`invalid awsS3 integration config, endpoints cannot contain path, got '${c}'`)}else Y=ue;const we=S.getOptionalString("accessKeyId"),Ne=S.getOptionalString("secretAccessKey"),Je=S.getOptionalString("roleArn"),Mt=S.getOptionalString("externalId");return{host:Y,endpoint:c,s3ForcePathStyle:j,accessKeyId:we,secretAccessKey:Ne,roleArn:Je,externalId:Mt}}function ne(S){const c=S.map(V);return c.some(b=>b.host===ue)||c.push({host:ue}),c}class L{get type(){return"awsS3"}get title(){return this.integrationConfig.host}get config(){return this.integrationConfig}resolveUrl(c){return N(c)}resolveEditUrl(c){return c}constructor(c){(0,r._)(this,"integrationConfig",void 0),this.integrationConfig=c}}(0,r._)(L,"factory",({config:S})=>{var c;const b=ne((c=S.getOptionalConfigArray("integrations.awsS3"))!==null&&c!==void 0?c:[]);return u(b.map(j=>new L(j)),j=>j.config.host)});var A=n(88412),le=n(50629),se=n(80956);const ae="GB";var _=new WeakMap,H=new WeakMap,T=new WeakMap,R=new WeakMap,P=new WeakMap,K=new WeakMap,je=new WeakMap;class Le{static fromRepoUrl(c){const b=new URL(c);let j,Y,me;const we=b.pathname.split("/").map(Yn=>decodeURIComponent(Yn));if(we[2]==="_git"?(j=we[1],Y=me=we[3]):we[3]==="_git"?(j=we[1],Y=we[2],me=we[4]):we[4]==="_git"&&(j=`${we[1]}/${we[2]}`,Y=we[3],me=we[5]),!j||!Y||!me)throw new Error("Azure URL must point to a git repository");var Ne;const Je=(Ne=b.searchParams.get("path"))!==null&&Ne!==void 0?Ne:void 0;let Mt;const xn=b.searchParams.get("version");if(xn){if(xn.slice(0,2)!=="GB")throw new Error("Azure URL version must point to a git branch");Mt=xn.slice(2)}return new Le(b.origin,j,Y,me,Je,Mt)}toRepoUrl(){let c;return(0,A._)(this,T)===(0,A._)(this,R)?c=(0,A._)(this,je).call(this,(0,A._)(this,H),"_git",(0,A._)(this,R)):c=(0,A._)(this,je).call(this,(0,A._)(this,H),(0,A._)(this,T),"_git",(0,A._)(this,R)),(0,A._)(this,P)&&c.searchParams.set("path",(0,A._)(this,P)),(0,A._)(this,K)&&c.searchParams.set("version",ae+(0,A._)(this,K)),c.toString()}toFileUrl(){if(!(0,A._)(this,P))throw new Error("Azure URL must point to a specific path to be able to download a file");const c=(0,A._)(this,je).call(this,(0,A._)(this,H),(0,A._)(this,T),"_apis","git","repositories",(0,A._)(this,R),"items");return c.searchParams.set("api-version","6.0"),c.searchParams.set("path",(0,A._)(this,P)),(0,A._)(this,K)&&c.searchParams.set("version",(0,A._)(this,K)),c.toString()}toArchiveUrl(){const c=(0,A._)(this,je).call(this,(0,A._)(this,H),(0,A._)(this,T),"_apis","git","repositories",(0,A._)(this,R),"items");return c.searchParams.set("recursionLevel","full"),c.searchParams.set("download","true"),c.searchParams.set("api-version","6.0"),(0,A._)(this,P)&&c.searchParams.set("scopePath",(0,A._)(this,P)),(0,A._)(this,K)&&c.searchParams.set("version",(0,A._)(this,K)),c.toString()}toCommitsUrl(){const c=(0,A._)(this,je).call(this,(0,A._)(this,H),(0,A._)(this,T),"_apis","git","repositories",(0,A._)(this,R),"commits");return c.searchParams.set("api-version","6.0"),(0,A._)(this,K)&&c.searchParams.set("searchCriteria.itemVersion.version",(0,A._)(this,K)),c.toString()}getOwner(){return(0,A._)(this,H)}getProject(){return(0,A._)(this,T)}getRepo(){return(0,A._)(this,R)}getPath(){return(0,A._)(this,P)}getRef(){return(0,A._)(this,K)}constructor(c,b,j,Y,me,we){(0,le._)(this,_,{writable:!0,value:void 0}),(0,le._)(this,H,{writable:!0,value:void 0}),(0,le._)(this,T,{writable:!0,value:void 0}),(0,le._)(this,R,{writable:!0,value:void 0}),(0,le._)(this,P,{writable:!0,value:void 0}),(0,le._)(this,K,{writable:!0,value:void 0}),(0,le._)(this,je,{writable:!0,value:(...Ne)=>{const Je=new URL((0,A._)(this,_));return Je.pathname=Ne.map(Mt=>encodeURIComponent(Mt)).join("/"),Je}}),(0,se._)(this,_,c),(0,se._)(this,H,b),(0,se._)(this,T,j),(0,se._)(this,R,Y),(0,se._)(this,P,me),(0,se._)(this,K,we)}}const Z="dev.azure.com",Xe=S=>{const c=S;return Object.keys(S).length===3&&c.clientId!==void 0&&c.clientSecret!==void 0&&c.tenantId!==void 0},at=S=>Object.keys(S).length===1&&S.clientId!==void 0;function Rt(S){var c;const b=(c=S.getOptionalString("host"))!==null&&c!==void 0?c:Z,j=S.getOptionalString("token"),Y=S.getOptional("credential")?{tenantId:S.getOptionalString("credential.tenantId"),clientId:S.getOptionalString("credential.clientId"),clientSecret:S.getOptionalString("credential.clientSecret")}:void 0;if(!W(b))throw new Error(`Invalid Azure integration config, '${b}' is not a valid host`);if(Y&&!Xe(Y)&&!at(Y))throw new Error("Invalid Azure integration config, credential is not valid");if(Y&&b!==Z)throw new Error(`Invalid Azure integration config, credential can only be used with ${Z}`);if(Y&&j)throw new Error("Invalid Azure integration config, specify either a token or a credential but not both");return{host:b,token:j,credential:Y}}function zt(S){const c=S.map(Rt);return c.some(b=>b.host===Z)||c.push({host:Z}),c}class bt{get type(){return"azure"}get title(){return this.integrationConfig.host}get config(){return this.integrationConfig}resolveUrl(c){const{url:b,base:j}=c;if(g(b))return b;try{const me=Le.fromRepoUrl(j),we=new URL(j);var Y;const Ne=new URL(`https://a.com${(Y=me.getPath())!==null&&Y!==void 0?Y:""}`),Je=new URL(b,Ne).pathname;return we.searchParams.set("path",Je),c.lineNumber&&(we.searchParams.set("line",String(c.lineNumber)),we.searchParams.set("lineEnd",String(c.lineNumber+1)),we.searchParams.set("lineStartColumn","1"),we.searchParams.set("lineEndColumn","1")),we.toString()}catch{return new URL(b,j).toString()}}resolveEditUrl(c){return c}constructor(c){(0,r._)(this,"integrationConfig",void 0),this.integrationConfig=c}}(0,r._)(bt,"factory",({config:S})=>{var c;const b=zt((c=S.getOptionalConfigArray("integrations.azure"))!==null&&c!==void 0?c:[]);return u(b.map(j=>new bt(j)),j=>j.config.host)});var Zt=n(48834).lW;function Dt(S){return AzureUrl.fromRepoUrl(S).toFileUrl()}function _e(S){return AzureUrl.fromRepoUrl(S).toArchiveUrl()}function lt(S){return AzureUrl.fromRepoUrl(S).toCommitsUrl()}async function yt(S,c){const b="499b84ac-1321-427f-aa17-267ca6975798/.default",j=c?{...c}:{},{token:Y,credential:me}=S;if(me){if(isAzureClientSecretCredential(me)){const Ne=await new ClientSecretCredential(me.tenantId,me.clientId,me.clientSecret).getToken(b);j.Authorization=`Bearer ${Ne.token}`}else if(isAzureManagedIdentityCredential(me)){const Ne=await new ManagedIdentityCredential(me.clientId).getToken(b);j.Authorization=`Bearer ${Ne.token}`}}else if(Y){const we=Zt.from(`:${S.token}`,"utf8");j.Authorization=`Basic ${we.toString("base64")}`}return{headers:j}}const qe="bitbucket.org",Lt="https://api.bitbucket.org/2.0";function Vt(S){var c;const b=(c=S.getOptionalString("host"))!==null&&c!==void 0?c:qe;let j=S.getOptionalString("apiBaseUrl");const Y=S.getOptionalString("token"),me=S.getOptionalString("username"),we=S.getOptionalString("appPassword");if(!W(b))throw new Error(`Invalid Bitbucket integration config, '${b}' is not a valid host`);return j?j=(0,f.trimEnd)(j,"/"):b===qe?j=Lt:j=`https://${b}/rest/api/1.0`,{host:b,apiBaseUrl:j,token:Y,username:me,appPassword:we}}function be(S){const c=S.map(Vt);return c.some(b=>b.host===qe)||c.push({host:qe,apiBaseUrl:Lt}),c}class Ce{get type(){return"bitbucket"}get title(){return this.integrationConfig.host}get config(){return this.integrationConfig}resolveUrl(c){const b=N(c);if(!c.lineNumber)return b;const j=new URL(b);return this.integrationConfig.host==="bitbucket.org"?j.hash=`lines-${c.lineNumber}`:j.hash=`${c.lineNumber}`,j.toString()}resolveEditUrl(c){const b=z()(c),j=new URL(c);return j.searchParams.set("mode","edit"),j.searchParams.set("spa","0"),j.searchParams.set("at",b.ref),j.toString()}constructor(c){(0,r._)(this,"integrationConfig",void 0),this.integrationConfig=c}}(0,r._)(Ce,"factory",({config:S})=>{var c,b,j;const Y=be((j=S.getOptionalConfigArray("integrations.bitbucket"))!==null&&j!==void 0?j:[...(c=S.getOptionalConfigArray("integrations.bitbucketCloud"))!==null&&c!==void 0?c:[],...(b=S.getOptionalConfigArray("integrations.bitbucketServer"))!==null&&b!==void 0?b:[]]);return u(Y.map(me=>new Ce(me)),me=>me.config.host)});var Ke=n(96279),Be=n(48834).lW;async function gt(S,c){const{name:b,owner:j,resource:Y}=parseGitUrl(S),me=Y==="bitbucket.org";let we=me?`${c.apiBaseUrl}/repositories/${j}/${b}`:`${c.apiBaseUrl}/projects/${j}/repos/${b}/default-branch`,Ne=await fetch(we,Ye(c));if(Ne.status===404&&!me&&(we=`${c.apiBaseUrl}/projects/${j}/repos/${b}/branches/default`,Ne=await fetch(we,Ye(c))),!Ne.ok){const Mt=`Failed to retrieve default branch from ${we}, ${Ne.status} ${Ne.statusText}`;throw new Error(Mt)}let Je;if(me)Je=(await Ne.json()).mainbranch.name;else{const{displayId:Mt}=await Ne.json();Je=Mt}if(!Je)throw new Error(`Failed to read default branch from ${we}. Response ${Ne.status} ${Ne.json()}`);return Je}async function xt(S,c){const{name:b,owner:j,ref:Y,protocol:me,resource:we,filepath:Ne}=parseGitUrl(S),Je=we==="bitbucket.org";let Mt=Y;Mt||(Mt=await gt(S,c));const xn=Ne?`&path=${encodeURIComponent(decodeURIComponent(Ne))}`:"";return Je?`${me}://${we}/${j}/${b}/get/${Mt}.tar.gz`:`${c.apiBaseUrl}/projects/${j}/repos/${b}/archive?format=tgz&at=${Mt}&prefix=${j}-${b}${xn}`}function nt(S,c){try{const{owner:b,name:j,ref:Y,filepathtype:me,filepath:we}=parseGitUrl(S);if(!b||!j||me!=="browse"&&me!=="raw"&&me!=="src")throw new Error("Invalid Bitbucket URL or file path");const Ne=we.replace(/^\//,"");if(c.host==="bitbucket.org"){if(!Y)throw new Error("Invalid Bitbucket URL or file path");return`${c.apiBaseUrl}/repositories/${b}/${j}/src/${Y}/${Ne}`}return`${c.apiBaseUrl}/projects/${b}/repos/${j}/raw/${Ne}?at=${Y}`}catch(b){throw new Error(`Incorrect URL: ${S}, ${b}`)}}function Ye(S){const c={};if(S.token)c.Authorization=`Bearer ${S.token}`;else if(S.username&&S.appPassword){const b=Be.from(`${S.username}:${S.appPassword}`,"utf8");c.Authorization=`Basic ${b.toString("base64")}`}return{headers:c}}const Ge="bitbucket.org",ct="https://api.bitbucket.org/2.0";function ut(S){const c=Ge,b=ct,j=S.getString("username"),Y=S.getString("appPassword");return{host:c,apiBaseUrl:b,username:j,appPassword:Y}}function ln(S){const c=S.map(ut);return c.length===0&&c.push({host:Ge,apiBaseUrl:ct}),c}class cn{get type(){return"bitbucketCloud"}get title(){return this.integrationConfig.host}get config(){return this.integrationConfig}resolveUrl(c){const b=N(c);if(c.lineNumber){const j=new URL(b);return j.hash=`lines-${c.lineNumber}`,j.toString()}return b}resolveEditUrl(c){const b=z()(c),j=new URL(c);return j.searchParams.set("mode","edit"),j.searchParams.set("at",b.ref),j.toString()}constructor(c){(0,r._)(this,"integrationConfig",void 0),this.integrationConfig=c}}(0,r._)(cn,"factory",({config:S})=>{var c;const b=ln((c=S.getOptionalConfigArray("integrations.bitbucketCloud"))!==null&&c!==void 0?c:[]);return u(b.map(j=>new cn(j)),j=>j.config.host)});var dn=n(48834).lW;async function Ht(S,c){const{name:b,owner:j}=parseGitUrl(S),Y=`${c.apiBaseUrl}/repositories/${j}/${b}`,me=await fetch(Y,Xt(c));if(!me.ok){const Je=`Failed to retrieve default branch from ${Y}, ${me.status} ${me.statusText}`;throw new Error(Je)}const Ne=(await me.json()).mainbranch.name;if(!Ne)throw new Error(`Failed to read default branch from ${Y}. Response ${me.status} ${me.json()}`);return Ne}async function Sn(S,c){const{name:b,owner:j,ref:Y,protocol:me,resource:we}=parseGitUrl(S);let Ne=Y;return Ne||(Ne=await Ht(S,c)),`${me}://${we}/${j}/${b}/get/${Ne}.tar.gz`}function Qt(S,c){try{const{owner:b,name:j,ref:Y,filepathtype:me,filepath:we}=parseGitUrl(S);if(!b||!j||me!=="src"&&me!=="raw")throw new Error("Invalid Bitbucket Cloud URL or file path");const Ne=we.replace(/^\//,"");if(!Y)throw new Error("Invalid Bitbucket Cloud URL or file path");return`${c.apiBaseUrl}/repositories/${b}/${j}/src/${Y}/${Ne}`}catch(b){throw new Error(`Incorrect URL: ${S}, ${b}`)}}function Xt(S){const c={};if(S.username&&S.appPassword){const b=dn.from(`${S.username}:${S.appPassword}`,"utf8");c.Authorization=`Basic ${b.toString("base64")}`}return{headers:c}}function Cn(S){const c=S.getString("host");let b=S.getOptionalString("apiBaseUrl");const j=S.getOptionalString("token"),Y=S.getOptionalString("username"),me=S.getOptionalString("password");if(!W(c))throw new Error(`Invalid Bitbucket Server integration config, '${c}' is not a valid host`);return b?b=(0,f.trimEnd)(b,"/"):b=`https://${c}/rest/api/1.0`,{host:c,apiBaseUrl:b,token:j,username:Y,password:me}}function tn(S){return S.map(Cn)}class Tn{get type(){return"bitbucketServer"}get title(){return this.integrationConfig.host}get config(){return this.integrationConfig}resolveUrl(c){const b=N(c);if(c.lineNumber){const j=new URL(b);return j.hash=c.lineNumber.toString(),j.toString()}return b}resolveEditUrl(c){return c.includes("?")?c.substring(0,c.indexOf("?")):c}constructor(c){(0,r._)(this,"integrationConfig",void 0),this.integrationConfig=c}}(0,r._)(Tn,"factory",({config:S})=>{var c;const b=tn((c=S.getOptionalConfigArray("integrations.bitbucketServer"))!==null&&c!==void 0?c:[]);return u(b.map(j=>new Tn(j)),j=>j.config.host)});var $n=n(48834).lW;async function et(S,c){const{name:b,owner:j}=parseGitUrl(S);let Y=`${c.apiBaseUrl}/projects/${j}/repos/${b}/default-branch`,me=await fetch(Y,rt(c));if(me.status===404&&(Y=`${c.apiBaseUrl}/projects/${j}/repos/${b}/branches/default`,me=await fetch(Y,rt(c))),!me.ok){const Je=`Failed to retrieve default branch from ${Y}, ${me.status} ${me.statusText}`;throw new Error(Je)}const{displayId:we}=await me.json(),Ne=we;if(!Ne)throw new Error(`Failed to read default branch from ${Y}. Response ${me.status} ${me.json()}`);return Ne}async function nn(S,c){const{name:b,owner:j,ref:Y,filepath:me}=parseGitUrl(S);let we=Y;we||(we=await et(S,c));const Ne=me?`&path=${encodeURIComponent(decodeURIComponent(me))}`:"";return`${c.apiBaseUrl}/projects/${j}/repos/${b}/archive?format=tgz&at=${we}&prefix=${j}-${b}${Ne}`}function Gt(S,c){try{const{owner:b,name:j,ref:Y,filepathtype:me,filepath:we}=parseGitUrl(S);if(!b||!j||me!=="browse"&&me!=="raw"&&me!=="src")throw new Error("Invalid Bitbucket Server URL or file path");const Ne=we.replace(/^\//,"");return`${c.apiBaseUrl}/projects/${b}/repos/${j}/raw/${Ne}?at=${Y}`}catch(b){throw new Error(`Incorrect URL: ${S}, ${b}`)}}function rt(S){const c={};if(S.token)c.Authorization=`Bearer ${S.token}`;else if(S.username&&S.password){const b=$n.from(`${S.username}:${S.password}`,"utf8");c.Authorization=`Basic ${b.toString("base64")}`}return{headers:c}}function Dn(S){const c=S.getString("host");let b=S.getOptionalString("baseUrl"),j=S.getOptionalString("cloneUrl"),Y=S.getOptionalString("gitilesBaseUrl");const me=S.getOptionalString("username"),we=S.getOptionalString("password");if(W(c)){if(b&&!g(b))throw new Error(`Invalid Gerrit integration config, '${b}' is not a valid baseUrl`);if(j&&!g(j))throw new Error(`Invalid Gerrit integration config, '${j}' is not a valid cloneUrl`);if(Y&&!g(Y))throw new Error(`Invalid Gerrit integration config, '${Y}' is not a valid gitilesBaseUrl`)}else throw new Error(`Invalid Gerrit integration config, '${c}' is not a valid host`);return b?b=(0,f.trimEnd)(b,"/"):b=`https://${c}`,Y?Y=(0,f.trimEnd)(Y,"/"):Y=`https://${c}`,j?j=(0,f.trimEnd)(j,"/"):j=b,{host:c,baseUrl:b,cloneUrl:j,gitilesBaseUrl:Y,username:me,password:we}}function un(S){return S.map(Dn)}var Pn=n(48834).lW;const wn=")]}'";function jn(S,c){const j=c.replace(S.gitilesBaseUrl,"").split("/").filter(Mt=>!!Mt),Y=j.indexOf("+");if(Y<=0)throw new Error(`Unable to parse project from url: ${c}`);const me=(0,f.trimStart)(j.slice(0,Y).join("/"),"/"),we=j.indexOf("heads");if(we<=0)throw new Error(`Unable to parse branch from url: ${c}`);const Ne=j[we+1],Je=j.slice(we+2).join("/");return{branch:Ne,filePath:Je===""?"/":Je,project:me}}function Fn(S,c,b,j){return`${S.gitilesBaseUrl}/${c}/+/refs/heads/${b}/${(0,f.trimStart)(j,"/")}`}function Rn(S){return S.password?"/a/":"/"}function Zn(S,c){const{branch:b,project:j}=jn(S,c);return`${S.baseUrl}${Rn(S)}projects/${encodeURIComponent(j)}/branches/${b}`}function Se(S,c){const{project:b}=jn(S,c);return`${S.cloneUrl}${Rn(S)}${b}`}function de(S,c){const{branch:b,filePath:j,project:Y}=jn(S,c);return`${S.baseUrl}${Rn(S)}projects/${encodeURIComponent(Y)}/branches/${b}/files/${encodeURIComponent(j)}/content`}function Ie(S){return`${S.baseUrl}${Rn(S)}projects/`}function G(S){const c={};if(!S.password)return c;const b=Pn.from(`${S.username}:${S.password}`,"utf8");return c.Authorization=`Basic ${b.toString("base64")}`,{headers:c}}async function k(S){const c=await S.text();if(c.startsWith(wn))try{return JSON.parse(c.slice(wn.length))}catch(b){throw new Error(`Invalid response from Gerrit: ${c.slice(0,10)} - ${b}`)}throw new Error(`Gerrit JSON body prefix missing. Found: ${c.slice(0,10)}`)}class ce{get type(){return"gerrit"}get title(){return this.integrationConfig.host}get config(){return this.integrationConfig}resolveUrl(c){const{url:b,base:j,lineNumber:Y}=c;let me;if(b.startsWith("/")){const{branch:we,project:Ne}=jn(this.config,j);return Fn(this.config,Ne,we,b)}return b?me=new URL(b,j):me=new URL(j),Y&&(me.hash=Y.toString()),me.toString()}resolveEditUrl(c){return c}constructor(c){(0,r._)(this,"integrationConfig",void 0),this.integrationConfig=c}}(0,r._)(ce,"factory",({config:S})=>{var c;const b=un((c=S.getOptionalConfigArray("integrations.gerrit"))!==null&&c!==void 0?c:[]);return u(b.map(j=>new ce(j)),j=>j.config.host)});function Pe(S){const c=S.getString("host");let b=S.getOptionalString("baseUrl");const j=S.getOptionalString("username"),Y=S.getOptionalString("password");if(!W(c))throw new Error(`Invalid Gitea integration config, '${c}' is not a valid host`);return b?b=(0,f.trimEnd)(b,"/"):b=`https://${c}`,{host:c,baseUrl:b,username:j,password:Y}}var Ue=n(48834).lW;function We(S,c){try{var b;const j=(b=S.baseUrl)!==null&&b!==void 0?b:`https://${S.host}`,[Y,me,we,Ne,Je,Mt,...xn]=c.replace(j,"").split("/"),Yn=xn.join("/").replace(/^\//,"");return`${j}/${me}/${we}/_edit/${Mt}/${Yn}`}catch(j){throw new Error(`Incorrect URL: ${c}, ${j}`)}}function St(S,c){try{var b;const j=(b=S.baseUrl)!==null&&b!==void 0?b:`https://${S.host}`,[Y,me,we,Ne,Je,Mt,...xn]=c.replace(j,"").split("/"),Yn=xn.join("/").replace(/^\//,"");return`${j}/api/v1/repos/${me}/${we}/contents/${Yn}?ref=${Mt}`}catch(j){throw new Error(`Incorrect URL: ${c}, ${j}`)}}function Ot(S){const c={},{username:b,password:j}=S;return j?(b?c.Authorization=`basic ${Ue.from(`${b}:${j}`).toString("base64")}`:c.Authorization=`token ${j}`,{headers:c}):c}class qt{get type(){return"gitea"}get title(){return this.config.host}resolveUrl(c){return N(c)}resolveEditUrl(c){return We(this.config,c)}constructor(c){(0,r._)(this,"config",void 0),this.config=c}}(0,r._)(qt,"factory",({config:S})=>{var c;const j=((c=S.getOptionalConfigArray("integrations.gitea"))!==null&&c!==void 0?c:[]).map(Y=>Pe(Y));return u(j.map(Y=>new qt(Y)),Y=>Y.config.host)});const Kt="github.com",_t="https://api.github.com",ee="https://raw.githubusercontent.com";function q(S){var c,b;const j=(b=S.getOptionalString("host"))!==null&&b!==void 0?b:Kt;let Y=S.getOptionalString("apiBaseUrl"),me=S.getOptionalString("rawBaseUrl");const we=S.getOptionalString("token"),Ne=(c=S.getOptionalConfigArray("apps"))===null||c===void 0?void 0:c.map(Je=>({appId:Je.getNumber("appId"),clientId:Je.getString("clientId"),clientSecret:Je.getString("clientSecret"),webhookSecret:Je.getString("webhookSecret"),privateKey:Je.getString("privateKey"),allowedInstallationOwners:Je.getOptionalStringArray("allowedInstallationOwners")}));if(!W(j))throw new Error(`Invalid GitHub integration config, '${j}' is not a valid host`);return Y?Y=(0,f.trimEnd)(Y,"/"):j===Kt&&(Y=_t),me?me=(0,f.trimEnd)(me,"/"):j===Kt&&(me=ee),{host:j,apiBaseUrl:Y,rawBaseUrl:me,token:we,apps:Ne}}function te(S){const c=S.map(q);return c.some(b=>b.host===Kt)||c.push({host:Kt,apiBaseUrl:_t,rawBaseUrl:ee}),c}function v(S,c,b){try{const{owner:j,name:Y,ref:me,filepathtype:we,filepath:Ne}=parseGitUrl(S);if(!j||!Y||!me||we!=="blob"&&we!=="raw"&&we!=="tree")throw new Error("Invalid GitHub URL or file path");const Je=Ne.replace(/^\//,"");return Q(c,b)==="api"?`${c.apiBaseUrl}/repos/${j}/${Y}/contents/${Je}?ref=${me}`:`${c.rawBaseUrl}/${j}/${Y}/${me}/${Je}`}catch(j){throw new Error(`Incorrect URL: ${S}, ${j}`)}}function O(S,c){const b={};return Q(S,c)==="api"&&(b.Accept="application/vnd.github.v3.raw"),c.token&&(b.Authorization=`token ${c.token}`),{headers:b}}function Q(S,c){return S.apiBaseUrl&&(c.token||!S.rawBaseUrl)?"api":"raw"}var M=n(35355),he=n(89393),ye=n(26228);class Me{async getOrCreateToken(c,b,j){let Y=this.tokenCache.get(c);if((!Y||this.isExpired(Y.expiresAt))&&(Y=await j(),Y.expiresAt=Y.expiresAt.minus({minutes:10}),this.tokenCache.set(c,Y)),!this.appliesToRepo(Y,b))throw new Error(`The Backstage GitHub application used in the ${c} organization does not have access to a repository with the name ${b}`);return{accessToken:Y.token}}appliesToRepo(c,b){return b===void 0?!0:c.repositories!==void 0?c.repositories.includes(b):!0}constructor(){(0,r._)(this,"tokenCache",new Map),(0,r._)(this,"isExpired",c=>ye.ou.local()>c)}}const ot={Accept:"application/vnd.github.machine-man-preview+json"};class dt{async getInstallationCredentials(c,b){if(this.allowedInstallationOwners){var j;if(!(!((j=this.allowedInstallationOwners)===null||j===void 0)&&j.includes(c)))return{accessToken:void 0}}return this.cache.getOrCreateToken(c,b,async()=>{const{installationId:Y,suspended:me}=await this.getInstallationData(c);if(me)throw new Error(`The GitHub application for ${c} is suspended`);const we=await this.appClient.apps.createInstallationAccessToken({installation_id:Y,headers:ot});let Ne;if(we.data.repository_selection==="selected"){const Mt=new he.v({baseUrl:this.baseUrl,auth:we.data.token}),xn=await Mt.paginate(Mt.apps.listReposAccessibleToInstallation);var Je;Ne=((Je=xn.repositories)!==null&&Je!==void 0?Je:xn).map(ar=>ar.name)}return{token:we.data.token,expiresAt:ye.ou.fromISO(we.data.expires_at),repositories:Ne}})}getInstallations(){return this.appClient.paginate(this.appClient.apps.listInstallations)}async getInstallationData(c){const j=(await this.getInstallations()).find(me=>{var we;return me.account&&"login"in me.account&&((we=me.account.login)===null||we===void 0?void 0:we.toLocaleLowerCase("en-US"))===c.toLocaleLowerCase("en-US")});if(j)return{installationId:j.id,suspended:Boolean(j.suspended_by)};const Y=new Error(`No app installation found for ${c} in ${this.baseAuthConfig.appId}`);throw Y.name="NotFoundError",Y}constructor(c,b){(0,r._)(this,"appClient",void 0),(0,r._)(this,"baseUrl",void 0),(0,r._)(this,"baseAuthConfig",void 0),(0,r._)(this,"cache",new Me),(0,r._)(this,"allowedInstallationOwners",void 0),this.allowedInstallationOwners=c.allowedInstallationOwners,this.baseUrl=b,this.baseAuthConfig={appId:c.appId,privateKey:c.privateKey.replace(/\\n/gm,`
|
|
33
|
-
`)},this.appClient=new he.v({baseUrl:b,headers:ot,authStrategy:M.i,auth:this.baseAuthConfig})}}class At{async getAllInstallations(){return this.apps.length?(await Promise.all(this.apps.map(b=>b.getInstallations()))).flat():[]}async getAppToken(c,b){if(this.apps.length===0)return;const j=await Promise.all(this.apps.map(Ne=>Ne.getInstallationCredentials(c,b).then(Je=>({credentials:Je,error:void 0}),Je=>({credentials:void 0,error:Je})))),Y=j.find(Ne=>{var Je;return(Je=Ne.credentials)===null||Je===void 0?void 0:Je.accessToken});if(Y)return Y.credentials.accessToken;const we=j.map(Ne=>Ne.error).find(Ne=>(Ne==null?void 0:Ne.name)!=="NotFoundError");if(we)throw we}constructor(c){var b;(0,r._)(this,"apps",void 0);var j;this.apps=(j=(b=c.apps)===null||b===void 0?void 0:b.map(Y=>new dt(Y,c.apiBaseUrl)))!==null&&j!==void 0?j:[]}}class jt{async getCredentials(c){const b=z()(c.url),j=b.owner||b.name,Y=b.owner?b.name:void 0;let me="app",we=await this.githubAppCredentialsMux.getAppToken(j,Y);return we||(me="token",we=this.token),{headers:we?{Authorization:`Bearer ${we}`}:void 0,token:we,type:me}}constructor(c,b){(0,r._)(this,"githubAppCredentialsMux",void 0),(0,r._)(this,"token",void 0),this.githubAppCredentialsMux=c,this.token=b}}(0,r._)(jt,"create",S=>new jt(new At(S),S.token));class st{static fromIntegrations(c){const b=new Map;return c.github.list().forEach(j=>{const Y=SingleInstanceGithubCredentialsProvider.create(j.config);b.set(j.config.host,Y)}),new st(b)}async getCredentials(c){const b=new URL(c.url),j=this.providers.get(b.host);if(!j)throw new Error(`There is no GitHub integration that matches ${c.url}. Please add a configuration for an integration.`);return j.getCredentials(c)}constructor(c){_define_property(this,"providers",void 0),this.providers=c}}class Fe{get type(){return"github"}get title(){return this.integrationConfig.host}get config(){return this.integrationConfig}resolveUrl(c){return Ut(N(c),"tree")}resolveEditUrl(c){return Ut(c,"edit")}constructor(c){(0,r._)(this,"integrationConfig",void 0),this.integrationConfig=c}}(0,r._)(Fe,"factory",({config:S})=>{var c;const b=te((c=S.getOptionalConfigArray("integrations.github"))!==null&&c!==void 0?c:[]);return u(b.map(j=>new Fe(j)),j=>j.config.host)});function Ut(S,c){return S.replace(/\/\/([^/]+)\/([^/]+)\/([^/]+)\/(blob|tree|edit)\//,(b,j,Y,me)=>`//${j}/${Y}/${me}/${c}/`)}const Yt=null;class Ct extends Fe{get config(){return super.config}constructor(c){super(c)}}(0,r._)(Ct,"factory",Fe.factory);const Nt=null,hn=null,yn=null,mt="gitlab.com",He="https://gitlab.com/api/v4";function Pt(S){const c=S.getString("host");let b=S.getOptionalString("apiBaseUrl");const j=S.getOptionalString("token");let Y=S.getOptionalString("baseUrl");if(b?b=(0,f.trimEnd)(b,"/"):c===mt&&(b=He),Y?Y=(0,f.trimEnd)(Y,"/"):Y=`https://${c}`,W(c)){if(!b||!g(b))throw new Error(`Invalid GitLab integration config, '${b}' is not a valid apiBaseUrl`);if(!g(Y))throw new Error(`Invalid GitLab integration config, '${Y}' is not a valid baseUrl`)}else throw new Error(`Invalid GitLab integration config, '${c}' is not a valid host`);return{host:c,token:j,apiBaseUrl:b,baseUrl:Y}}function mn(S){const c=S.map(Pt);return c.some(b=>b.host===mt)||c.push({host:mt,apiBaseUrl:He,baseUrl:`https://${mt}`}),c}function en(S){let c="";return S.host!==mt&&(c=new URL(S.baseUrl).pathname),trimEnd(c,"/")}async function sr(S,c){const b=await sn(S,c);return Gn(S,b,c).toString()}function fr(S){const{token:c=""}=S;return{headers:{"PRIVATE-TOKEN":c}}}function Gn(S,c,b){try{const j=new URL(S),Y=j.pathname.split("/blob/").slice(1).join("/blob/"),[me,...we]=Y.split("/"),Ne=getGitLabIntegrationRelativePath(b);return j.pathname=[...Ne?[Ne]:[],"api/v4/projects",c,"repository/files",encodeURIComponent(decodeURIComponent(we.join("/"))),"raw"].join("/"),j.search=`?ref=${me}`,j}catch(j){throw new Error(`Incorrect url: ${S}, ${j}`)}}async function sn(S,c){const b=new URL(S);if(!b.pathname.includes("/blob/"))throw new Error("Please provide full path to yaml file from GitLab");try{let j=b.pathname.split("/-/blob/")[0].split("/blob/")[0];const Y=getGitLabIntegrationRelativePath(c);Y&&(j=j.replace(Y,""));const me=new URL(`${b.origin}${Y}/api/v4/projects/${encodeURIComponent(j.replace(/^\//,""))}`),we=await fetch(me.toString(),fr(c)),Ne=await we.json();if(!we.ok)throw new Error(`GitLab Error '${Ne.error}', ${Ne.error_description}`);return Number(Ne.id)}catch(j){throw new Error(`Could not get GitLab project ID for: ${S}, ${j}`)}}class ir{get type(){return"gitlab"}get title(){return this.integrationConfig.host}get config(){return this.integrationConfig}resolveUrl(c){return N(c)}resolveEditUrl(c){return Vr(c,"edit")}constructor(c){(0,r._)(this,"integrationConfig",void 0),this.integrationConfig=c}}(0,r._)(ir,"factory",({config:S})=>{var c;const b=mn((c=S.getOptionalConfigArray("integrations.gitlab"))!==null&&c!==void 0?c:[]);return u(b.map(j=>new ir(j)),j=>j.config.host)});function Vr(S,c){return S.replace(/\/\-\/(blob|tree|edit)\//,`/-/${c}/`)}class Hr{async getCredentials(c){return this.token?{headers:{Authorization:`Bearer ${this.token}`},token:this.token}:{}}constructor(c){(0,r._)(this,"token",void 0),this.token=c}}(0,r._)(Hr,"create",S=>new Hr(S.token));class Kn{static fromIntegrations(c){const b=new Map;return c.gitlab.list().forEach(j=>{const Y=SingleInstanceGitlabCredentialsProvider.create(j.config);b.set(j.config.host,Y)}),new Kn(b)}async getCredentials(c){const b=new URL(c.url),j=this.providers.get(b.host);if(!j)throw new Error(`There is no GitLab integration that matches ${c.url}. Please add a configuration for an integration.`);return j.getCredentials(c)}constructor(c){_define_property(this,"providers",void 0),this.providers=c}}class Tr{static fromConfig(c){return new Tr({awsS3:L.factory({config:c}),azure:bt.factory({config:c}),bitbucket:Ce.factory({config:c}),bitbucketCloud:cn.factory({config:c}),bitbucketServer:Tn.factory({config:c}),gerrit:ce.factory({config:c}),github:Fe.factory({config:c}),gitlab:ir.factory({config:c}),gitea:qt.factory({config:c})})}get awsS3(){return this.byType.awsS3}get azure(){return this.byType.azure}get bitbucket(){return this.byType.bitbucket}get bitbucketCloud(){return this.byType.bitbucketCloud}get bitbucketServer(){return this.byType.bitbucketServer}get gerrit(){return this.byType.gerrit}get github(){return this.byType.github}get gitlab(){return this.byType.gitlab}get gitea(){return this.byType.gitea}list(){return Object.values(this.byType).flatMap(c=>c.list())}byUrl(c){let b=Object.values(this.byType).map(j=>j.byUrl(c)).filter(Boolean);if(b.length>1){const j=b.filter(Y=>!(Y instanceof Ce));j.length!==0&&(b=j)}return b[0]}byHost(c){return Object.values(this.byType).map(b=>b.byHost(c)).find(Boolean)}resolveUrl(c){const b=this.byUrl(c.base);return b?b.resolveUrl(c):N(c)}resolveEditUrl(c){const b=this.byUrl(c);return b?b.resolveEditUrl(c):c}constructor(c){(0,r._)(this,"byType",void 0),this.byType=c}}},30966:function(wt,ke,n){"use strict";var r={};n.r(r),n.d(r,{TechDocsPlugin:function(){return R.s4}});var p=n(52322),z=n(2784),f=n(28316),W=n(73557),g=n(60871);const u=(0,g.T0)({id:"plugin.techdocs.storageservice"}),N=(0,g.T0)({id:"plugin.techdocs.service"});var ge=n(92077),ue=n(95481),V=n(7476),ne=n(93225),L=n(86317),A=n(65124),le=n(22478),se=n(85478),ae=n(68435),_=n(3482),H=n(42081),T=n(48431),R=n(89258),P=n(52943),K=n(61886),je=n(13980),Le=n.n(je),Z=n(87612);class Xe{get(t){for(const s of this.holders){const a=s.get(t);if(a)return a}}constructor(...t){(0,Z._)(this,"holders",void 0),this.holders=t}}var at=n(51837);const Rt=(0,at.CT)("api-context"),zt=i=>{var t;const{apis:s,children:a}=i,h=(t=(0,z.useContext)(Rt))===null||t===void 0?void 0:t.atVersion(1),w=h?new Xe(s,h):s;return(0,p.jsx)(Rt.Provider,{value:(0,at.EI)({1:w}),children:a})};zt.propTypes={apis:Le().shape({get:Le().func.isRequired}).isRequired,children:Le().node};class bt{static validateFactories(t,s){for(const a of s){const h=[a],w=new Set;for(;h.length;){const B=h.shift(),F=t.get(B);if(F)for(const ie of Object.values(F.deps)){if(ie.id===a.id)throw new Error(`Circular dependency of api factory for ${a}`);w.has(ie)||(w.add(ie),h.push(ie))}}}}get(t){return this.load(t)}load(t,s=[]){const a=this.apis.get(t.id);if(a)return a;const h=this.factories.get(t);if(!h)return;if(s.includes(h.api))throw new Error(`Circular dependency of api factory for ${h.api}`);const w=this.loadDeps(t,h.deps,[...s,h.api]),B=h.factory(w);return this.apis.set(t.id,B),B}loadDeps(t,s,a){const h={};for(const w in s)if(s.hasOwnProperty(w)){const B=s[w],F=this.load(B,a);if(!F)throw new Error(`No API factory available for dependency ${B} of dependent ${t}`);h[w]=F}return h}constructor(t){(0,Z._)(this,"factories",void 0),(0,Z._)(this,"apis",void 0),this.factories=t,this.apis=new Map}}var Zt;(function(i){i[i.default=10]="default",i[i.app=50]="app",i[i.static=100]="static"})(Zt||(Zt={}));class Dt{register(t,s){const a=Zt[t],h=this.factories.get(s.api.id);return h&&h.priority>=a?!1:(this.factories.set(s.api.id,{priority:a,factory:s}),!0)}get(t){const s=this.factories.get(t.id);if(s)return s.factory}getAllApis(){const t=new Set;for(const{factory:s}of this.factories.values())t.add(s.api);return t}constructor(){(0,Z._)(this,"factories",new Map)}}function _e(i){return new Promise((t,s)=>{const a=i.width||500,h=i.height||700,w=window.screen.width/2-a/2,B=window.screen.height/2-h/2,F=window.open(i.url,i.name,`menubar=no,location=no,resizable=no,scrollbars=no,status=no,width=${a},height=${h},top=${B},left=${w}`);let ie="";if(!F||typeof F.closed=="undefined"||F.closed){const ft=new Error("Failed to open auth popup.");ft.name="PopupRejectedError",s(ft);return}const xe=ft=>{if(ft.source!==F||ft.origin!==i.origin)return;const{data:Et}=ft;if(Et.type==="config_info"){ie=Et.targetOrigin;return}if(Et.type!=="authorization_response")return;const vt=Et;if("error"in vt){const Wt=new Error(vt.error.message);Wt.name=vt.error.name,s(Wt)}else t(vt.response);ze()},Re=setInterval(()=>{if(F.closed){const ft=`Login failed, ${ie&&ie!==window.location.origin?`Incorrect app origin, expected ${ie}`:"popup was closed"}`,Et=new Error(ft);Et.name="PopupClosedError",s(Et),ze()}},100);function ze(){window.removeEventListener("message",xe),clearInterval(Re)}window.addEventListener("message",xe)})}let lt=!1;function yt(i){return[...i].join(" ")}class qe{async createSession(t){return t.instantPopup?this.enableExperimentalRedirectFlow?this.executeRedirect(t.scopes):this.showPopup(t.scopes):this.authRequester(t.scopes)}async refreshSession(t){const s=await fetch(await this.buildUrl("/refresh",{optional:!0,...t&&{scope:this.joinScopesFunc(t)}}),{headers:{"x-requested-with":"XMLHttpRequest"},credentials:"include"}).catch(h=>{throw new Error(`Auth refresh request failed, ${h}`)});if(!s.ok){const h=new Error(`Auth refresh request failed, ${s.statusText}`);throw h.status=s.status,h}const a=await s.json();if(a.error){const h=new Error(a.error.message);throw a.error.name&&(h.name=a.error.name),h}return await this.sessionTransform(a)}async removeSession(){const t=await fetch(await this.buildUrl("/logout"),{method:"POST",headers:{"x-requested-with":"XMLHttpRequest"},credentials:"include"}).catch(s=>{throw new Error(`Logout request failed, ${s}`)});if(!t.ok){const s=new Error(`Logout request failed, ${t.statusText}`);throw s.status=t.status,s}}async showPopup(t){const s=this.joinScopesFunc(t),a=await this.buildUrl("/start",{scope:s,origin:window.location.origin,flow:"popup"}),h=await _e({url:a,name:`${this.provider.title} Login`,origin:new URL(a).origin,width:450,height:730});return await this.sessionTransform(h)}async executeRedirect(t){const s=this.joinScopesFunc(t);return window.location.href=await this.buildUrl("/start",{scope:s,origin:window.location.origin,redirectUrl:window.location.href,flow:"redirect"}),new Promise(()=>{})}async buildUrl(t,s){const a=await this.discoveryApi.getBaseUrl("auth"),h=this.buildQueryString({...s,env:this.environment});return`${a}/${this.provider.id}${t}${h}`}buildQueryString(t){if(!t)return"";const s=Object.entries(t).map(([a,h])=>{if(typeof h=="string")return`${encodeURIComponent(a)}=${encodeURIComponent(h)}`;if(h)return encodeURIComponent(a)}).filter(Boolean).join("&");return s?`?${s}`:""}constructor(t){(0,Z._)(this,"discoveryApi",void 0),(0,Z._)(this,"environment",void 0),(0,Z._)(this,"provider",void 0),(0,Z._)(this,"joinScopesFunc",void 0),(0,Z._)(this,"authRequester",void 0),(0,Z._)(this,"sessionTransform",void 0),(0,Z._)(this,"enableExperimentalRedirectFlow",void 0);const{configApi:s,discoveryApi:a,environment:h,provider:w,joinScopes:B=yt,oauthRequestApi:F,sessionTransform:ie=Re=>Re}=t;!lt&&!s&&(console.warn("DEPRECATION WARNING: Authentication providers require a configApi instance to configure the authentication flow. Please provide one to the authentication provider constructor."),lt=!0);var xe;this.enableExperimentalRedirectFlow=s&&(xe=s.getOptionalBoolean("enableExperimentalRedirectFlow"))!==null&&xe!==void 0?xe:!1,this.authRequester=F.createAuthRequester({provider:w,onAuthRequest:async Re=>this.enableExperimentalRedirectFlow?this.executeRedirect(Re):this.showPopup(Re)}),this.discoveryApi=a,this.environment=h,this.provider=w,this.joinScopesFunc=B,this.sessionTransform=ie}}function Lt(i,t){for(const s of t)if(!i.has(s))return!1;return!0}class Vt{sessionExistsAndHasScope(t,s){if(!t)return!1;if(!s||this.options.sessionScopes===void 0)return!0;const a=this.options.sessionScopes(t);return Lt(a,s)}getExtendedScope(t,s){const a=new Set(this.options.defaultScopes);if(t&&this.options.sessionScopes!==void 0){const h=this.options.sessionScopes(t);for(const w of h)a.add(w)}if(s)for(const h of s)a.add(h);return a}constructor(t){(0,Z._)(this,"options",void 0),this.options=t}}var be=n(82394),Ce=n.n(be);let Ke=Symbol.observable;class Be{[Ke](){return this}get closed(){return this.isClosed}next(t){if(this.isClosed)throw new Error("PublishSubject is closed");this.subscribers.forEach(s=>s.next(t))}error(t){if(this.isClosed)throw new Error("PublishSubject is closed");this.isClosed=!0,this.terminatingError=t,this.subscribers.forEach(s=>s.error(t))}complete(){if(this.isClosed)throw new Error("PublishSubject is closed");this.isClosed=!0,this.subscribers.forEach(t=>t.complete())}subscribe(t,s,a){const h=typeof t=="function"?{next:t,error:s,complete:a}:t;return this.observable.subscribe(h)}constructor(){(0,Z._)(this,"isClosed",!1),(0,Z._)(this,"terminatingError",void 0),(0,Z._)(this,"observable",new(Ce())(t=>this.isClosed?(this.terminatingError?t.error(this.terminatingError):t.complete(),()=>{}):(this.subscribers.add(t),()=>{this.subscribers.delete(t)}))),(0,Z._)(this,"subscribers",new Set)}}let gt=Symbol.observable;class xt{[gt](){return this}get closed(){return this.isClosed}next(t){if(this.isClosed)throw new Error("BehaviorSubject is closed");this.currentValue=t,this.subscribers.forEach(s=>s.next(t))}error(t){if(this.isClosed)throw new Error("BehaviorSubject is closed");this.isClosed=!0,this.terminatingError=t,this.subscribers.forEach(s=>s.error(t))}complete(){if(this.isClosed)throw new Error("BehaviorSubject is closed");this.isClosed=!0,this.subscribers.forEach(t=>t.complete())}subscribe(t,s,a){const h=typeof t=="function"?{next:t,error:s,complete:a}:t;return this.observable.subscribe(h)}constructor(t){(0,Z._)(this,"isClosed",void 0),(0,Z._)(this,"currentValue",void 0),(0,Z._)(this,"terminatingError",void 0),(0,Z._)(this,"observable",void 0),(0,Z._)(this,"subscribers",new Set),this.isClosed=!1,this.currentValue=t,this.terminatingError=void 0,this.observable=new(Ce())(s=>this.isClosed?(this.terminatingError?s.error(this.terminatingError):s.complete(),()=>{}):(s.next(this.currentValue),this.subscribers.add(s),()=>{this.subscribers.delete(s)}))}}class nt{setIsSignedIn(t){this.signedIn!==t&&(this.signedIn=t,this.subject.next(this.signedIn?g.sM.SignedIn:g.sM.SignedOut))}sessionState$(){return this.subject}constructor(){(0,Z._)(this,"subject",new xt(g.sM.SignedOut)),(0,Z._)(this,"signedIn",!1)}}class Ye{async getSession(t){if(this.helper.sessionExistsAndHasScope(this.currentSession,t.scopes)){if(!this.sessionShouldRefreshFunc(this.currentSession))return this.currentSession;try{const a=await this.collapsedSessionRefresh(t.scopes),h=this.sessionScopesFunc(this.currentSession),w=this.sessionScopesFunc(a);return Lt(w,h)&&(this.currentSession=a),a}catch(a){if(t.optional)return;throw a}}if(!this.currentSession&&!t.instantPopup)try{const s=await this.collapsedSessionRefresh(t.scopes);return this.currentSession=s,this.getSession(t)}catch{}if(!t.optional)return this.currentSession=await this.connector.createSession({...t,scopes:this.helper.getExtendedScope(this.currentSession,t.scopes)}),this.stateTracker.setIsSignedIn(!0),this.currentSession}async removeSession(){this.currentSession=void 0,await this.connector.removeSession(),this.stateTracker.setIsSignedIn(!1)}sessionState$(){return this.stateTracker.sessionState$()}async collapsedSessionRefresh(t){if(this.refreshPromise)return this.refreshPromise;this.refreshPromise=this.connector.refreshSession(t);try{const s=await this.refreshPromise;return this.stateTracker.setIsSignedIn(!0),s}finally{delete this.refreshPromise}}constructor(t){(0,Z._)(this,"connector",void 0),(0,Z._)(this,"helper",void 0),(0,Z._)(this,"sessionScopesFunc",void 0),(0,Z._)(this,"sessionShouldRefreshFunc",void 0),(0,Z._)(this,"stateTracker",new nt),(0,Z._)(this,"refreshPromise",void 0),(0,Z._)(this,"currentSession",void 0);const{connector:s,defaultScopes:a=new Set,sessionScopes:h,sessionShouldRefresh:w}=t;this.connector=s,this.sessionScopesFunc=h,this.sessionShouldRefreshFunc=w,this.helper=new Vt({sessionScopes:h,defaultScopes:a})}}class Ge{setSession(t){this.currentSession=t,this.stateTracker.setIsSignedIn(Boolean(t))}async getSession(t){if(this.helper.sessionExistsAndHasScope(this.currentSession,t.scopes))return this.currentSession;if(!t.optional)return this.currentSession=await this.connector.createSession({...t,scopes:this.helper.getExtendedScope(this.currentSession,t.scopes)}),this.stateTracker.setIsSignedIn(!0),this.currentSession}async removeSession(){this.currentSession=void 0,this.stateTracker.setIsSignedIn(!1)}sessionState$(){return this.stateTracker.sessionState$()}constructor(t){_define_property(this,"connector",void 0),_define_property(this,"helper",void 0),_define_property(this,"stateTracker",new SessionStateTracker),_define_property(this,"currentSession",void 0);const{connector:s,defaultScopes:a=new Set,sessionScopes:h}=t;this.connector=s,this.helper=new SessionScopeHelper({sessionScopes:h,defaultScopes:a})}}const ct={id:"oauth2",title:"Your Identity Provider",icon:()=>null};class ut{static create(t){const{configApi:s,discoveryApi:a,environment:h="development",provider:w=ct,oauthRequestApi:B,defaultScopes:F=[],scopeTransform:ie=ze=>ze}=t,xe=new qe({configApi:s,discoveryApi:a,environment:h,provider:w,oauthRequestApi:B,sessionTransform(ze){return{...ze,providerInfo:{idToken:ze.providerInfo.idToken,accessToken:ze.providerInfo.accessToken,scopes:ut.normalizeScopes(ie,ze.providerInfo.scope),expiresAt:new Date(Date.now()+ze.providerInfo.expiresInSeconds*1e3)}}}}),Re=new Ye({connector:xe,defaultScopes:new Set(F),sessionScopes:ze=>ze.providerInfo.scopes,sessionShouldRefresh:ze=>(ze.providerInfo.expiresAt.getTime()-Date.now())/1e3<60*5});return new ut({sessionManager:Re,scopeTransform:ie})}async signIn(){await this.getAccessToken()}async signOut(){await this.sessionManager.removeSession()}sessionState$(){return this.sessionManager.sessionState$()}async getAccessToken(t,s){const a=ut.normalizeScopes(this.scopeTransform,t),h=await this.sessionManager.getSession({...s,scopes:a});var w;return(w=h==null?void 0:h.providerInfo.accessToken)!==null&&w!==void 0?w:""}async getIdToken(t={}){const s=await this.sessionManager.getSession({...t,scopes:new Set(["openid"])});var a;return(a=s==null?void 0:s.providerInfo.idToken)!==null&&a!==void 0?a:""}async getBackstageIdentity(t={}){const s=await this.sessionManager.getSession(t);return s==null?void 0:s.backstageIdentity}async getProfile(t={}){const s=await this.sessionManager.getSession(t);return s==null?void 0:s.profile}static normalizeScopes(t,s){if(!s)return new Set;const a=Array.isArray(s)?s:s.split(/[\s|,]/).filter(Boolean);return new Set(t(a))}constructor(t){(0,Z._)(this,"sessionManager",void 0),(0,Z._)(this,"scopeTransform",void 0),this.sessionManager=t.sessionManager,this.scopeTransform=t.scopeTransform}}const ln={id:"github",title:"GitHub",icon:()=>null};class cn{static create(t){const{configApi:s,discoveryApi:a,environment:h="development",provider:w=ln,oauthRequestApi:B,defaultScopes:F=["read:user"]}=t;return ut.create({configApi:s,discoveryApi:a,oauthRequestApi:B,provider:w,environment:h,defaultScopes:F})}}const dn={id:"gitlab",title:"GitLab",icon:()=>null};class Ht{static create(t){const{configApi:s,discoveryApi:a,environment:h="development",provider:w=dn,oauthRequestApi:B,defaultScopes:F=["read_user"]}=t;return ut.create({configApi:s,discoveryApi:a,oauthRequestApi:B,provider:w,environment:h,defaultScopes:F})}}const Sn={id:"google",title:"Google",icon:()=>null},Qt="https://www.googleapis.com/auth/";class Xt{static create(t){const{configApi:s,discoveryApi:a,oauthRequestApi:h,environment:w="development",provider:B=Sn,defaultScopes:F=["openid",`${Qt}userinfo.email`,`${Qt}userinfo.profile`]}=t;return ut.create({configApi:s,discoveryApi:a,oauthRequestApi:h,provider:B,environment:w,defaultScopes:F,scopeTransform(ie){return ie.map(xe=>xe==="openid"?xe:xe==="profile"||xe==="email"?`${Qt}userinfo.${xe}`:xe.startsWith(Qt)?xe:`${Qt}${xe}`)}})}}const Cn={id:"okta",title:"Okta",icon:()=>null},tn=new Set(["openid","profile","email","phone","address","groups","offline_access"]),Tn="okta.";class $n{static create(t){const{configApi:s,discoveryApi:a,environment:h="development",provider:w=Cn,oauthRequestApi:B,defaultScopes:F=["openid","email","profile","offline_access"]}=t;return ut.create({configApi:s,discoveryApi:a,oauthRequestApi:B,provider:w,environment:h,defaultScopes:F,scopeTransform(ie){return ie.map(xe=>tn.has(xe)||xe.startsWith(Tn)?xe:`${Tn}${xe}`)}})}}var et=n(30195);const nn=et.z.object({profile:et.z.object({email:et.z.string().optional(),displayName:et.z.string().optional(),picture:et.z.string().optional()}),backstageIdentity:et.z.object({token:et.z.string(),identity:et.z.object({type:et.z.literal("user"),userEntityRef:et.z.string(),ownershipEntityRefs:et.z.array(et.z.string())})})}),Gt={id:"saml",title:"SAML",icon:()=>null};class rt{static create(t){const{discoveryApi:s,environment:a="development",provider:h=Gt}=t,w=new DirectAuthConnector({discoveryApi:s,environment:a,provider:h}),B=new StaticAuthSessionManager({connector:w}),F=new AuthSessionStore({manager:B,storageKey:`${h.id}Session`,schema:samlSessionSchema});return new rt(F)}sessionState$(){return this.sessionManager.sessionState$()}async signIn(){await this.getBackstageIdentity({})}async signOut(){await this.sessionManager.removeSession()}async getBackstageIdentity(t={}){const s=await this.sessionManager.getSession(t);return s==null?void 0:s.backstageIdentity}async getProfile(t={}){const s=await this.sessionManager.getSession(t);return s==null?void 0:s.profile}constructor(t){_define_property(this,"sessionManager",void 0),this.sessionManager=t}}const Dn={id:"microsoft",title:"Microsoft",icon:()=>null};class un{static create(t){return new un(t)}microsoftGraph(){return this.oauth2[un.MicrosoftGraphID]}static resourceForScopes(t){const s=[...new Set(t.split(" ").map(un.resourceForScope).filter(w=>w!=="openid"))];if(s.length>1)return Promise.reject(new Error(`Requested access token with scopes from multiple Azure resources: ${s.join(", ")}. Access tokens can only have a single audience.`));var a;const h=(a=s[0])!==null&&a!==void 0?a:un.MicrosoftGraphID;return Promise.resolve(h)}static resourceForScope(t){var s;const a=(s=t.match(RegExp("^(?<resourceURI>.*)\\/(?<scp>[^\\/]*)$")))===null||s===void 0?void 0:s.groups;if(a){const{resourceURI:h}=a;return h.replace(/^api:\/\//,"")}switch(t){case"email":case"openid":case"offline_access":case"profile":return"openid";default:return un.MicrosoftGraphID}}async getAccessToken(t,s){const a=t===void 0?un.MicrosoftGraphID:await un.resourceForScopes(Array.isArray(t)?t.join(" "):t);return a in this.oauth2||(this.oauth2[a]=ut.create({configApi:this.configApi,discoveryApi:this.discoveryApi,oauthRequestApi:this.oauthRequestApi,provider:this.provider,environment:this.environment,scopeTransform:this.scopeTransform})),this.oauth2[a].getAccessToken(t,s)}getIdToken(t){return this.microsoftGraph().getIdToken(t)}getProfile(t){return this.microsoftGraph().getProfile(t)}getBackstageIdentity(t){return this.microsoftGraph().getBackstageIdentity(t)}signIn(){return this.microsoftGraph().signIn()}signOut(){return this.microsoftGraph().signOut()}sessionState$(){return this.microsoftGraph().sessionState$()}constructor(t){(0,Z._)(this,"oauth2",void 0),(0,Z._)(this,"configApi",void 0),(0,Z._)(this,"environment",void 0),(0,Z._)(this,"provider",void 0),(0,Z._)(this,"oauthRequestApi",void 0),(0,Z._)(this,"discoveryApi",void 0),(0,Z._)(this,"scopeTransform",void 0);const{configApi:s,environment:a="development",provider:h=Dn,oauthRequestApi:w,discoveryApi:B,defaultScopes:F=["openid","offline_access","profile","email","User.Read"],scopeTransform:ie=xe=>xe.concat("offline_access")}=t;this.configApi=s,this.environment=a,this.provider=h,this.oauthRequestApi=w,this.discoveryApi=B,this.scopeTransform=ie,this.oauth2={[un.MicrosoftGraphID]:ut.create({configApi:this.configApi,discoveryApi:this.discoveryApi,oauthRequestApi:this.oauthRequestApi,provider:this.provider,environment:this.environment,scopeTransform:this.scopeTransform,defaultScopes:F})}}}(0,Z._)(un,"MicrosoftGraphID","00000003-0000-0000-c000-000000000000");const Pn={id:"onelogin",title:"onelogin",icon:()=>null},wn=new Set(["openid","profile","email","phone","address","groups","offline_access"]),jn="onelogin.";class Fn{static create(t){const{configApi:s,discoveryApi:a,environment:h="development",provider:w=Pn,oauthRequestApi:B}=t;return ut.create({configApi:s,discoveryApi:a,oauthRequestApi:B,provider:w,environment:h,defaultScopes:["openid","email","profile","offline_access"],scopeTransform(F){return F.map(ie=>wn.has(ie)||ie.startsWith(jn)?ie:`${jn}${ie}`)}})}}const Rn={id:"bitbucket",title:"Bitbucket",icon:()=>null};class Zn{static create(t){const{configApi:s,discoveryApi:a,environment:h="development",provider:w=Rn,oauthRequestApi:B,defaultScopes:F=["team"]}=t;return ut.create({configApi:s,discoveryApi:a,oauthRequestApi:B,provider:w,environment:h,defaultScopes:F})}}const Se={id:"bitbucketServer",title:"Bitbucket Server",icon:()=>null};class de{static create(t){const{configApi:s,discoveryApi:a,environment:h="development",provider:w=Se,oauthRequestApi:B,defaultScopes:F=["PROJECT_ADMIN"]}=t;return ut.create({configApi:s,discoveryApi:a,oauthRequestApi:B,provider:w,environment:h,defaultScopes:F})}}const Ie={id:"atlassian",title:"Atlassian",icon:()=>null};class G{static create(t){const{configApi:s,discoveryApi:a,environment:h="development",provider:w=Ie,oauthRequestApi:B}=t;return ut.create({configApi:s,discoveryApi:a,oauthRequestApi:B,provider:w,environment:h})}}class k{post(t){this.subject.next(t)}alert$(){return this.subject}constructor(){(0,Z._)(this,"subject",new Be)}}class ce{captureEvent(t){}}const Pe="theme";class Ue{static createWithStorage(t){const s=new Ue(t);if(!window.localStorage)return s;var a;const h=(a=window.localStorage.getItem(Pe))!==null&&a!==void 0?a:void 0;return s.setActiveThemeId(h),s.activeThemeId$().subscribe(w=>{w?window.localStorage.setItem(Pe,w):window.localStorage.removeItem(Pe)}),window.addEventListener("storage",w=>{if(w.key===Pe){var B;const F=(B=localStorage.getItem(Pe))!==null&&B!==void 0?B:void 0;s.setActiveThemeId(F)}}),s}getInstalledThemes(){return this.themes.slice()}activeThemeId$(){return this.subject}getActiveThemeId(){return this.activeThemeId}setActiveThemeId(t){this.activeThemeId=t,this.subject.next(t)}constructor(t){(0,Z._)(this,"themes",void 0),(0,Z._)(this,"activeThemeId",void 0),(0,Z._)(this,"subject",void 0),this.themes=t,this.subject=new xt(void 0)}}var We=n(9850),St=n.n(We),Ot=n(12782),qt=n.n(Ot);const Kt=/^[a-z][a-z0-9]*(?:[-_][a-z][a-z0-9]*)*$/i;function _t(i){return typeof i=="object"&&i!==null&&!Array.isArray(i)}function ee(i){if(i===null)return"null";if(Array.isArray(i))return"array";const t=typeof i;return t==="number"&&isNaN(i)?"nan":t==="string"&&i===""?"empty-string":t}const q={type(i,t,s,a){return`Invalid type in config for key '${i}' in '${t}', got ${s}, wanted ${a}`},missing(i){return`Missing required config value at '${i}'`},convert(i,t,s){return`Unable to convert config value for key '${i}' in '${t}' to a ${s}`}};class te{static fromConfigs(t){return t.length===0?new te(void 0):t.reduce((s,{data:a,context:h,filteredKeys:w,deprecatedKeys:B})=>{const F=new te(a,h,s);if(F.filteredKeys=w,B)for(const{key:ie,description:xe}of B)console.warn(`The configuration key '${ie}' of ${h} is deprecated and may be removed soon. ${xe||""}`);return F},void 0)}has(t){var s;if(this.readValue(t)!==void 0)return!0;var h;return(h=(s=this.fallback)===null||s===void 0?void 0:s.has(t))!==null&&h!==void 0?h:!1}keys(){var t;const s=this.data?Object.keys(this.data):[];var a;const h=(a=(t=this.fallback)===null||t===void 0?void 0:t.keys())!==null&&a!==void 0?a:[];return[...new Set([...s,...h])]}get(t){const s=this.getOptional(t);if(s===void 0)throw new Error(q.missing(this.fullKey(t!=null?t:"")));return s}getOptional(t){var s;const a=St()(this.readValue(t)),h=(s=this.fallback)===null||s===void 0?void 0:s.getOptional(t);if(a===void 0){if(!1)var w;return h}else if(h===void 0)return a;return qt()({},{value:h},{value:a},(B,F)=>!_t(F)||!_t(B)?F:void 0).value}getConfig(t){const s=this.getOptionalConfig(t);if(s===void 0)throw new Error(q.missing(this.fullKey(t)));return s}getOptionalConfig(t){var s;const a=this.readValue(t),h=(s=this.fallback)===null||s===void 0?void 0:s.getOptionalConfig(t);if(_t(a))return this.copy(a,t,h);if(a!==void 0)throw new TypeError(q.type(this.fullKey(t),this.context,ee(a),"object"));return h}getConfigArray(t){const s=this.getOptionalConfigArray(t);if(s===void 0)throw new Error(q.missing(this.fullKey(t)));return s}getOptionalConfigArray(t){const s=this.readConfigValue(t,h=>{if(!Array.isArray(h))return{expected:"object-array"};for(const[w,B]of h.entries())if(!_t(B))return{expected:"object-array",value:B,key:`${t}[${w}]`};return!0});if(!s){if(!1)var a;return}return s.map((h,w)=>this.copy(h,`${t}[${w}]`))}getNumber(t){const s=this.getOptionalNumber(t);if(s===void 0)throw new Error(q.missing(this.fullKey(t)));return s}getOptionalNumber(t){const s=this.readConfigValue(t,h=>typeof h=="number"||typeof h=="string"||{expected:"number"});if(typeof s=="number"||s===void 0)return s;const a=Number(s);if(!Number.isFinite(a))throw new Error(q.convert(this.fullKey(t),this.context,"number"));return a}getBoolean(t){const s=this.getOptionalBoolean(t);if(s===void 0)throw new Error(q.missing(this.fullKey(t)));return s}getOptionalBoolean(t){const s=this.readConfigValue(t,h=>typeof h=="boolean"||typeof h=="number"||typeof h=="string"||{expected:"boolean"});if(typeof s=="boolean"||s===void 0)return s;const a=String(s).trim();if(/^(?:y|yes|true|1|on)$/i.test(a))return!0;if(/^(?:n|no|false|0|off)$/i.test(a))return!1;throw new Error(q.convert(this.fullKey(t),this.context,"boolean"))}getString(t){const s=this.getOptionalString(t);if(s===void 0)throw new Error(q.missing(this.fullKey(t)));return s}getOptionalString(t){return this.readConfigValue(t,s=>typeof s=="string"&&s!==""||{expected:"string"})}getStringArray(t){const s=this.getOptionalStringArray(t);if(s===void 0)throw new Error(q.missing(this.fullKey(t)));return s}getOptionalStringArray(t){return this.readConfigValue(t,s=>{if(!Array.isArray(s))return{expected:"string-array"};for(const[a,h]of s.entries())if(typeof h!="string"||h==="")return{expected:"string-array",value:h,key:`${t}[${a}]`};return!0})}fullKey(t){return`${this.prefix}${this.prefix?".":""}${t}`}copy(t,s,a){const h=new te(t,this.context,a,this.fullKey(s));return h.filteredKeys=this.filteredKeys,h}readConfigValue(t,s){const a=this.readValue(t);if(a===void 0){var h;if(!1)var w;return(h=this.fallback)===null||h===void 0?void 0:h.readConfigValue(t,s)}const B=s(a);if(B!==!0){const{key:F=t,value:ie=a,expected:xe}=B;throw new TypeError(q.type(this.fullKey(F),this.context,ee(ie),xe))}return a}readValue(t){const s=t?t.split("."):[];for(const h of s)if(!Kt.test(h))throw new TypeError(`Invalid config key '${t}'`);if(this.data===void 0)return;let a=this.data;for(const[h,w]of s.entries())if(_t(a))a=a[w];else if(a!==void 0){const B=this.fullKey(s.slice(0,h).join("."));throw new TypeError(q.type(B,this.context,ee(a),"object"))}return a}constructor(t,s="mock-config",a,h=""){(0,Z._)(this,"data",void 0),(0,Z._)(this,"context",void 0),(0,Z._)(this,"fallback",void 0),(0,Z._)(this,"prefix",void 0),(0,Z._)(this,"filteredKeys",void 0),(0,Z._)(this,"notifiedFilteredKeys",void 0),this.data=t,this.context=s,this.fallback=a,this.prefix=h,this.notifiedFilteredKeys=new Set}}const v="Invalid discovery URL pattern,";class O{static compile(t){const s=t.split(/\{\{\s*pluginId\s*\}\}/),a=s.join("pluginId");let h;try{h=new URL(a)}catch{throw new Error(`${v} URL '${a}' is invalid`)}if(h.hash)throw new Error(`${v} URL must not have a hash`);if(h.search)throw new Error(`${v} URL must not have a query`);if(a.endsWith("/"))throw new Error(`${v} URL must not end with a slash`);return new O(s)}async getBaseUrl(t){return this.parts.join(encodeURIComponent(t))}constructor(t){(0,Z._)(this,"parts",void 0),this.parts=t}}class Q{post(t,s){return s!=null&&s.hidden||this.alertApi.post({message:t.message,severity:"error"}),this.errorApi.post(t,s)}error$(){return this.errorApi.error$()}constructor(t,s){(0,Z._)(this,"alertApi",void 0),(0,Z._)(this,"errorApi",void 0),this.alertApi=t,this.errorApi=s}}class M{post(t,s){this.subject.next({error:t,context:s})}error$(){return this.subject}constructor(){(0,Z._)(this,"subject",new Be)}}class he{static forward(t,s){window.addEventListener("unhandledrejection",a=>{t.post(a.reason,s)})}}function ye(i){if(i.length<3)throw new Error(`The '${i}' feature flag must have a minimum length of three characters.`);if(i.length>150)throw new Error(`The '${i}' feature flag must not exceed 150 characters.`);if(!i.match(/^[a-z]+[a-z0-9-]+$/))throw new Error(`The '${i}' feature flag must start with a lowercase letter and only contain lowercase letters, numbers and hyphens. Examples: feature-flag-one, alpha, release-2020`)}class Me{registerFlag(t){ye(t.name),this.registeredFeatureFlags.push(t)}getRegisteredFlags(){return this.registeredFeatureFlags.slice()}isActive(t){return this.flags||(this.flags=this.load()),this.flags.get(t)===g.CL.Active}save(t){this.flags||(this.flags=this.load()),t.merge||this.flags.clear();for(const[a,h]of Object.entries(t.states))this.flags.set(a,h);const s=Array.from(this.flags.entries()).filter(([,a])=>a===g.CL.Active);window.localStorage.setItem("featureFlags",JSON.stringify(Object.fromEntries(s)))}load(){try{const t=window.localStorage.getItem("featureFlags");if(!t)return new Map;const s=JSON.parse(t);if(typeof s!="object"||s===null||Array.isArray(s))return new Map;const a=Object.entries(s).filter(([h,w])=>(ye(h),w===g.CL.Active));return new Map(a)}catch{return new Map}}constructor(){(0,Z._)(this,"registeredFeatureFlags",[]),(0,Z._)(this,"flags",void 0)}}function ot(i){let t=i.baseImplementation||n.g.fetch;var s;const a=[(s=i.middleware)!==null&&s!==void 0?s:[]].flat().reverse();for(const h of a)t=h.apply(t);return{fetch:t}}class dt{static create(t){var s,a;const h=At(t),w=((s=t.header)===null||s===void 0?void 0:s.name)||"authorization",B=((a=t.header)===null||a===void 0?void 0:a.value)||(F=>`Bearer ${F}`);return new dt(t.identityApi,h,w,B)}apply(t){return async(s,a)=>{const h=new Request(s,a),{token:w}=await this.identityApi.getCredentials();return h.headers.get(this.headerName)||typeof w!="string"||!w||!this.allowUrl(h.url)?t(s,a):(h.headers.set(this.headerName,this.headerValue(w)),t(h))}}constructor(t,s,a,h){(0,Z._)(this,"identityApi",void 0),(0,Z._)(this,"allowUrl",void 0),(0,Z._)(this,"headerName",void 0),(0,Z._)(this,"headerValue",void 0),this.identityApi=t,this.allowUrl=s,this.headerName=a,this.headerValue=h}}function At(i){return i.allowUrl?i.allowUrl:i.urlPrefixAllowlist?jt(i.urlPrefixAllowlist):i.config?jt([i.config.getString("backend.baseUrl")]):()=>!1}function jt(i){const t=i.map(s=>s.replace(/\/$/,""));return s=>t.some(a=>s===a||s.startsWith(`${a}/`))}function st(i,t){return!t||t==="/"?i:`${i.replace(/\/$/,"")}/${t.replace(/^\//,"")}`}class Fe{apply(t){return async(s,a)=>{const h=new Request(s,a),w="plugin://";if(!h.url.startsWith(w))return t(s,a);const{hostname:B,pathname:F,search:ie,hash:xe,username:Re,password:ze}=new URL(`http://${h.url.substring(w.length)}`);let ft=await this.discoveryApi.getBaseUrl(B);if(Re||ze){const vt=new URL(ft),Wt=`${Re}${ze?`:${ze}`:""}@`;ft=`${vt.protocol}//${Wt}${vt.host}${vt.pathname}`}const Et=`${st(ft,F)}${ie}${xe}`;return t(Et,typeof s=="string"||Ut(s)?a:s)}}constructor(t){(0,Z._)(this,"discoveryApi",void 0),this.discoveryApi=t}}function Ut(i){return typeof i=="object"&&(i==null?void 0:i.constructor)===URL}class Yt{static resolvePluginProtocol(t){return new Fe(t.discoveryApi)}static injectIdentityAuth(t){return dt.create(t)}constructor(){}}function Ct(i,t){for(const s of t)if(!i.has(s))return!1;return!0}function Nt(i,...t){const s=new Set(i);for(const a of t)for(const h of a)s.add(h);return s}class hn{request(t){return new Promise((s,a)=>{this.requests.push({scopes:t,resolve:s,reject:a}),this.subject.next(this.getCurrentPending())})}resolve(t,s){this.requests=this.requests.filter(a=>Ct(t,a.scopes)?(a.resolve(s),!1):!0),this.subject.next(this.getCurrentPending())}reject(t){this.requests.forEach(s=>s.reject(t)),this.requests=[],this.subject.next(this.getCurrentPending())}pending(){return this.subject}getCurrentPending(){const t=this.requests.length===0?void 0:this.requests.slice(1).reduce((s,a)=>Nt(s,a.scopes),this.requests[0].scopes);return{scopes:t,resolve:s=>{t&&this.resolve(t,s)},reject:s=>{t&&this.reject(s)}}}constructor(){(0,Z._)(this,"requests",[]),(0,Z._)(this,"subject",new xt(this.getCurrentPending()))}}class yn{createAuthRequester(t){const s=new hn,a=this.handlerCount;return this.handlerCount++,s.pending().subscribe({next:h=>{const w=this.currentRequests.slice(),B=this.makeAuthRequest(h,t);B?w[a]=B:delete w[a],this.currentRequests=w,this.subject.next(w.filter(Boolean))}}),h=>s.request(h)}makeAuthRequest(t,s){const{scopes:a}=t;if(a)return{provider:s.provider,trigger:async()=>{const h=await s.onAuthRequest(a);t.resolve(h)},reject:()=>{const h=new Error("Login failed, rejected by user");h.name="RejectedError",t.reject(h)}}}authRequest$(){return this.subject}constructor(){(0,Z._)(this,"subject",new xt([])),(0,Z._)(this,"currentRequests",[]),(0,Z._)(this,"handlerCount",0)}}const mt=new Map;class He{static create(t){var s;return new He((s=t.namespace)!==null&&s!==void 0?s:"",t.errorApi)}static addStorageEventListener(){window.addEventListener("storage",t=>{for(const[a,h]of mt.entries()){var s;!((s=t.key)===null||s===void 0)&&s.startsWith(a)&&h.handleStorageChange(t.key)}})}get(t){return this.snapshot(t).value}snapshot(t){let s,a="absent";try{const h=localStorage.getItem(this.getKeyName(t));h&&(s=JSON.parse(h,(w,B)=>(typeof B=="object"&&B!==null&&Object.freeze(B),B)),a="present")}catch{this.errorApi.post(new Error(`Error when parsing JSON config from storage for: ${t}`))}return{key:t,value:s,presence:a}}forBucket(t){const s=`${this.namespace}/${t}`;return mt.has(s)||mt.set(s,new He(s,this.errorApi)),mt.get(s)}async set(t,s){localStorage.setItem(this.getKeyName(t),JSON.stringify(s)),this.notifyChanges(t)}async remove(t){localStorage.removeItem(this.getKeyName(t)),this.notifyChanges(t)}observe$(t){return He.hasSubscribed||(He.addStorageEventListener(),He.hasSubscribed=!0),this.observable.filter(({key:s})=>s===t)}handleStorageChange(t){if(!(t!=null&&t.startsWith(this.namespace)))return;const s=t==null?void 0:t.slice(`${this.namespace}/`.length);s.includes("/")||this.notifyChanges(decodeURIComponent(s))}getKeyName(t){return`${this.namespace}/${encodeURIComponent(t)}`}notifyChanges(t){const s=this.snapshot(t);for(const a of this.subscribers)a.next(s)}constructor(t,s){(0,Z._)(this,"namespace",void 0),(0,Z._)(this,"errorApi",void 0),(0,Z._)(this,"subscribers",void 0),(0,Z._)(this,"observable",void 0),this.namespace=t,this.errorApi=s,this.subscribers=new Set,this.observable=new(Ce())(a=>(this.subscribers.add(a),()=>{this.subscribers.delete(a)}))}}(0,Z._)(He,"hasSubscribed",!1);const Pt=(0,z.createContext)(void 0);function mn(){const[i]=(0,W.is)((0,p.jsx)(W.AW,{index:!0,element:(0,p.jsx)("div",{})}));return!i.index}var en=n(84800);const sr=(i,t)=>{try{const s=(0,en.fp)(t,{pathname:i}),a=s==null?void 0:s.filter(ie=>{var xe;return((xe=ie==null?void 0:ie.route.routeRefs)===null||xe===void 0?void 0:xe.size)>0}).pop(),h=a==null?void 0:a.route;if(!h)return;let w;h.routeRefs.size===1&&(w=h.routeRefs.values().next().value);let B;h.plugins.size===1&&(B=h.plugins.values().next().value);const F=Object.entries((a==null?void 0:a.params)||{}).reduce((ie,[xe,Re])=>(Re!==void 0&&(ie[xe]=Re),ie),{});return{extension:"App",pluginId:(B==null?void 0:B.getId())||"root",...w?{routeRef:w.id}:{},_routeNodeType:h.element,params:F}}catch{return}},fr=({pathname:i,search:t,hash:s,attributes:a})=>{const h=(0,g.z$)();return(0,z.useEffect)(()=>{h.captureEvent("navigate",`${i}${t}${s}`,{attributes:a})},[h,i,t,s,a]),null},Gn=({routeObjects:i})=>{const{pathname:t,search:s,hash:a}=(0,W.TH)(),{params:h,...w}=sr(t,i)||{params:{}};return(0,p.jsx)(g.fC,{attributes:w,children:(0,p.jsx)(fr,{pathname:t,search:s,hash:a,attributes:h})})};function sn(i){return mn()?ir(i):""}function ir(i){var t;let{pathname:s}=new URL((t=i.getOptionalString("app.baseUrl"))!==null&&t!==void 0?t:"/","http://sample.dev");return s=s.replace(/\/*$/,""),s}function Vr({component:i,appIdentityProxy:t,children:s}){const[a,h]=(0,z.useState)(),w=(0,g.h_)(g.Ds),B=sn(w);return a?(t.setTarget(a,{signOutTargetUrl:B||"/"}),(0,p.jsx)(p.Fragment,{children:s})):(0,p.jsx)(i,{onSignInSuccess:h})}function Hr(i){const{Router:t,SignInPage:s}=(0,g.qD)().getComponents(),a=(0,g.h_)(g.Ds),h=ir(a),w=`${h}/*`,B=(0,z.useContext)(Pt);if(!B)throw new Error("AppRouter must be rendered within the AppProvider");const{routeObjects:F,appIdentityProxy:ie}=B;return s?mn()?(0,p.jsxs)(t,{children:[(0,p.jsx)(Gn,{routeObjects:F}),(0,p.jsx)(Vr,{component:s,appIdentityProxy:ie,children:(0,p.jsx)(W.Z5,{children:(0,p.jsx)(W.AW,{path:w,element:(0,p.jsx)(p.Fragment,{children:i.children})})})})]}):(0,p.jsxs)(t,{basename:h,children:[(0,p.jsx)(Gn,{routeObjects:F}),(0,p.jsx)(Vr,{component:s,appIdentityProxy:ie,children:i.children})]}):(ie.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:h||"/"}),mn()?(0,p.jsxs)(t,{children:[(0,p.jsx)(Gn,{routeObjects:F}),(0,p.jsx)(W.Z5,{children:(0,p.jsx)(W.AW,{path:w,element:(0,p.jsx)(p.Fragment,{children:i.children})})})]}):(0,p.jsxs)(t,{basename:h,children:[(0,p.jsx)(Gn,{routeObjects:F}),i.children]}))}var Kn=n(88412),Tr=n(50629),S=n(80956),c=n(64279);function b(i){const t={};for(const a in i.collectors)i.collectors.hasOwnProperty(a)&&(t[a]=i.collectors[a]());const s=[{node:z.Children.toArray(i.root),parent:void 0,contexts:{}}];for(;s.length!==0;){const{node:a,parent:h,contexts:w}=s.shift();z.Children.forEach(a,B=>{if(!(0,z.isValidElement)(B))return;const F={};for(const ie in t)if(t.hasOwnProperty(ie)){const xe=t[ie];F[ie]=xe.visit(xe.accumulator,B,h,w[ie])}for(const ie of i.discoverers){const xe=ie(B);xe&&s.push({node:xe,parent:B,contexts:F})}})}return Object.fromEntries(Object.entries(t).map(([a,h])=>[a,h.accumulator]))}function j(i,t){return()=>({accumulator:i(),visit:t})}function Y(i){var t;return(t=i.props)===null||t===void 0?void 0:t.children}function me(i){var t,s;if(!((t=i.props)===null||t===void 0)&&t.path&&(!((s=i.props)===null||s===void 0)&&s.element)){var a;return(a=i.props)===null||a===void 0?void 0:a.element}}const we=j(()=>new Set,(i,t)=>{const s=(0,g.IY)(t,"core.plugin");s&&i.add(s)}),Ne=i=>{const{children:t}=i,s=(0,g.h_)(g.W0),a="with"in i?s.isActive(i.with):!s.isActive(i.without);return(0,p.jsx)(p.Fragment,{children:a?t:null})};(0,g.R5)(Ne,"core.featureFlagged",!0);const Je={caseSensitive:!1,path:"*",element:"match-all",routeRefs:new Set,plugins:new Set};function Mt(i){const t=i;if(t!=null&&t.type){var s,a;return(a=(s=t.type.displayName)!==null&&s!==void 0?s:t.type.name)!==null&&a!==void 0?a:String(t.type)}return String(t)}const xn=i=>{const t=new Set;return i&&t.add(i),t};function Yn(i,t=new Array){return z.Children.forEach(i,s=>{if(!(0,z.isValidElement)(s))return;const a=(0,g.IY)(s,"core.mountPoint");if(a){const h=(0,g.IY)(s,"core.plugin");t.push({routeRef:a,plugin:h})}Yn(s.props.children,t)}),t}const ar=j(()=>({paths:new Map,parents:new Map,objects:new Array}),(i,t,s,a)=>{var h,w;if(a!=null&&a.isElementAncestor)return a;if((s==null?void 0:s.props.element)===t)return{...a,isElementAncestor:!0};const B=(h=t.props)===null||h===void 0?void 0:h.path,F=(0,g.IY)(t,"core.mountPoint");if(F&&B)throw new Error(`Path property may not be set directly on a routable extension "${Mt(t)}"`);var ie;const xe=(ie=a==null||(w=a.obj)===null||w===void 0?void 0:w.children)!==null&&ie!==void 0?ie:i.objects;if(B!==void 0){if(typeof B!="string")throw new Error(`Element path must be a string at "${Mt(t)}"`);const vt=B.startsWith("/")?B.slice(1):B,Wt=t.props.element;if((0,g.IY)(t,"core.gatherMountPoints")){var Re;if(Wt)throw new Error(`Mount point gatherers may not have an element prop "${Mt(t)}"`);const Ft={path:vt,element:"gathered",routeRefs:new Set,caseSensitive:Boolean((Re=t.props)===null||Re===void 0?void 0:Re.caseSensitive),children:[Je],plugins:new Set};return xe.push(Ft),{obj:Ft,gatherPath:vt,routeRef:a==null?void 0:a.routeRef,gatherRouteRef:a==null?void 0:a.routeRef}}if(Wt){var ze;const[Ft,...Sr]=Yn(Wt);if(Sr.length>0)throw new Error(`Route element with path "${B}" may not contain multiple routable extensions`);if(!Ft)return a;const{routeRef:Wn,plugin:Or}=Ft,zr={path:vt,element:"mounted",routeRefs:new Set([Wn]),caseSensitive:Boolean((ze=t.props)===null||ze===void 0?void 0:ze.caseSensitive),children:[Je],plugins:xn(Or)};return xe.push(zr),i.paths.set(Wn,vt),i.parents.set(Wn,a==null?void 0:a.routeRef),{obj:zr,routeRef:Wn!=null?Wn:a==null?void 0:a.routeRef,gatherPath:vt,gatherRouteRef:a==null?void 0:a.gatherRouteRef}}}if(F){var ft;if((a==null?void 0:a.gatherPath)===void 0)throw new Error(`Routable extension "${Mt(t)}" with mount point "${F}" must be assigned a path`);a==null||(ft=a.obj)===null||ft===void 0||ft.routeRefs.add(F);const vt=(0,g.IY)(t,"core.plugin");if(vt){var Et;a==null||(Et=a.obj)===null||Et===void 0||Et.plugins.add(vt)}return i.paths.set(F,a.gatherPath),i.parents.set(F,a==null?void 0:a.gatherRouteRef),{...a,routeRef:F}}return a}),gr=j(()=>({paths:new Map,parents:new Map,objects:new Array}),(i,t,s,a)=>{var h,w,B;if((s==null?void 0:s.props.element)===t)return a;let F=a==null?void 0:a.obj,ie=a==null?void 0:a.routeRef,xe=a==null?void 0:a.sticky;const Re=(h=t.props)===null||h===void 0?void 0:h.path;var ze;const ft=(ze=F==null?void 0:F.children)!==null&&ze!==void 0?ze:i.objects,Et=Boolean((w=t.props)===null||w===void 0?void 0:w.caseSensitive);let vt=a==null?void 0:a.path;if((0,g.IY)(t,"core.gatherMountPoints")){if(!Re)throw new Error("Mount point gatherer must have a path");vt=Re}const Wt=(B=t.props)===null||B===void 0?void 0:B.element;let Ft=(0,g.IY)(t,"core.mountPoint");if(!Ft&&(0,z.isValidElement)(Wt)&&(Ft=(0,g.IY)(Wt,"core.mountPoint")),Ft){let Or=Re;if(vt&&(Or?vt=void 0:Or=vt),!Or)throw new Error("Mounted routable extension must have a path");i.paths.set(Ft,Or),ie&&xe?(i.parents.set(Ft,ie),Re&&(ie=Ft,xe=!1)):(i.parents.set(Ft,ie),ie=Ft),Re?(F={caseSensitive:Et,path:Re,element:"mounted",routeRefs:new Set([Ft]),children:[Je],plugins:xn((0,g.IY)(t.props.element,"core.plugin"))},ft.push(F)):F==null||F.routeRefs.add(Ft)}if((0,g.IY)(t,"core.gatherMountPoints")&&(xe=!0),(0,g.IY)(t,"core.gatherMountPoints")){if(!Re)throw new Error("Mount point gatherer must have a path");if(!Ft){var Wn;F={caseSensitive:Et,path:Re,element:"gathered",routeRefs:new Set,children:[Je],plugins:(a==null||(Wn=a.obj)===null||Wn===void 0?void 0:Wn.plugins)||new Set},ft.push(F)}}return{obj:F,path:vt,routeRef:ie,sticky:xe}}),bn=j(()=>new Set,(i,t)=>{if(t.type===Ne){const s=t.props;i.add("with"in s?s.with:s.without)}}),Br=(0,at.uW)("route-ref-type",()=>Symbol("route-ref-type"));function ro(i){return i[Br]==="absolute"}function mo(i){return i[Br]==="sub"}function xs(i){return i[Br]==="external"}function $r(...i){const t=i.join("/").replace(/\/\/+/g,"/");return t!=="/"&&t.endsWith("/")?t.slice(0,-1):t}function Do(i,t,s){let a,h="";if(ro(i))a=i;else if(mo(i))a=i.parent,h=i.path;else if(xs(i)){const F=s.get(i);if(!F)return[void 0,""];if(ro(F))a=F;else if(mo(F))a=F.parent,h=F.path;else throw new Error(`ExternalRouteRef was bound to invalid target, ${F}`)}else throw i[Br]?new Error(`Unknown or invalid route ref type, ${i[Br]}`):new Error(`Unknown object passed to useRouteRef, got ${i}`);if(!a)return[void 0,""];const w=t.get(a);if(w===void 0)return[void 0,""];const B=$r(w,h);return[a,B]}function bs(i,t,s,a,h){var w;const B=(w=(0,en.fp)(h,t))!==null&&w!==void 0?w:[],F=Array();let ie=-1;for(let ze=i;ze&&(ie=B.findIndex(ft=>ft.route.routeRefs.has(ze)),ie===-1);ze=a.get(ze))F.unshift(ze);F.length===0&&(ie-=1);const xe=ie===-1?"":B[ie].pathname,Re=F.slice(0,-1).map(ze=>{const ft=s.get(ze);if(ft===void 0)throw new Error(`No path for ${ze}`);if(ft.includes(":"))throw new Error(`Cannot route to ${i} with parent ${ze} as it has parameters`);return ft});return`${$r(xe,...Re)}/`}class No{resolve(t,s){const[a,h]=Do(t,this.routePaths,this.routeBindings);if(!a)return;let w;typeof s=="string"?w=this.trimPath(s):s.pathname?w={...s,pathname:this.trimPath(s.pathname)}:w=s;const B=this.appBasePath+bs(a,w,this.routePaths,this.routeParents,this.routeObjects);return(...[ie])=>$r(B,(0,en.Gn)(h,ie))}trimPath(t){return t&&(t.startsWith(this.appBasePath)?t.slice(this.appBasePath.length):t)}constructor(t,s,a,h,w){(0,Z._)(this,"routePaths",void 0),(0,Z._)(this,"routeParents",void 0),(0,Z._)(this,"routeObjects",void 0),(0,Z._)(this,"routeBindings",void 0),(0,Z._)(this,"appBasePath",void 0),this.routePaths=t,this.routeParents=s,this.routeObjects=a,this.routeBindings=h,this.appBasePath=w}}const Fo=(0,at.CT)("routing-context"),mr=({routePaths:i,routeParents:t,routeObjects:s,routeBindings:a,basePath:h="",children:w})=>{const B=new No(i,t,s,a,h),F=(0,at.EI)({1:B});return(0,p.jsx)(Fo.Provider,{value:F,children:w})};function qn(i,t){const s=new Set(t.values());s.delete(void 0);for(const a of t.keys()){if(s.has(a))continue;let h=a,w="";for(;h;){const F=i.get(h);if(F===void 0)throw new Error(`No path for ${h}`);w=$r(F,w),h=t.get(h)}const B=w.match(/:(\w+)/g);if(B){for(let F=0;F<B.length;F++)for(let ie=F+1;ie<B.length;ie++)if(B[ie]===B[F])throw new Error(`Parameter ${B[ie]} is duplicated in path ${w}`)}}}function Dr(i,t){for(const s of t)if(s.externalRoutes){for(const[a,h]of Object.entries(s.externalRoutes))if(!h.optional&&!i.has(h))throw new Error(`External route '${a}' of the '${s.getId()}' plugin must be bound to a target route. See https://backstage.io/link?bind-routes for details.`)}}const Gr=(0,at.CT)("app-context"),vo=({appContext:i,children:t})=>{const s=(0,at.EI)({1:i});return(0,p.jsx)(Gr.Provider,{value:s,children:t})};function yo(i){return new Error(`Tried to access IdentityApi ${i} before app was loaded`)}function Rr(i){console.warn(`WARNING: Call to ${i} is deprecated and will break in the future`)}class Zo{setTarget(t,s){this.target=t,this.signOutTargetUrl=s.signOutTargetUrl,this.resolveTarget(t)}getUserId(){if(!this.target)throw yo("getUserId");if(!this.target.getUserId)throw new Error("IdentityApi does not implement getUserId");return Rr("getUserId"),this.target.getUserId()}getProfile(){if(!this.target)throw yo("getProfile");if(!this.target.getProfile)throw new Error("IdentityApi does not implement getProfile");return Rr("getProfile"),this.target.getProfile()}async getProfileInfo(){return this.waitForTarget.then(t=>t.getProfileInfo())}async getBackstageIdentity(){const t=await this.waitForTarget.then(s=>s.getBackstageIdentity());return t.userEntityRef.match(/^.*:.*\/.*$/)||console.warn(`WARNING: The App IdentityApi provided an invalid userEntityRef, '${t.userEntityRef}'. It must be a full Entity Reference of the form '<kind>:<namespace>/<name>'.`),t}async getCredentials(){return this.waitForTarget.then(t=>t.getCredentials())}async getIdToken(){return this.waitForTarget.then(t=>{if(!t.getIdToken)throw new Error("IdentityApi does not implement getIdToken");return Rr("getIdToken"),t.getIdToken()})}async signOut(){await this.waitForTarget.then(t=>t.signOut()),window.location.href=this.signOutTargetUrl}constructor(){(0,Z._)(this,"target",void 0),(0,Z._)(this,"waitForTarget",void 0),(0,Z._)(this,"resolveTarget",()=>{}),(0,Z._)(this,"signOutTargetUrl","/"),this.waitForTarget=new Promise(t=>{this.resolveTarget=t})}}var xo=n(72164);function Ln(i,t,s){if(i!==void 0){const h=s.find(w=>w.id===i);if(h)return h}if(t){const h=s.find(w=>w.variant==="dark");if(h)return h}const a=s.find(h=>h.variant==="light");return a||s[0]}const _n=()=>{const i=(0,z.useMemo)(()=>window.matchMedia("(prefers-color-scheme: dark)"),[]),[t,s]=(0,z.useState)(i.matches);return(0,z.useEffect)(()=>{const a=h=>{s(h.matches)};return i.addListener(a),()=>{i.removeListener(a)}},[i]),t};function Nr({children:i}){const t=(0,g.h_)(g.hg),s=(0,xo.Z)(t.activeThemeId$(),t.getActiveThemeId()),a=Boolean(window.matchMedia)?_n():!1,h=Ln(s,a,t.getInstalledThemes());if(!h)throw new Error("App has no themes");return(0,p.jsx)(h.Provider,{children:i})}const Fr=async(i="__APP_INJECTED_RUNTIME_CONFIG__")=>{const t=[{context:"app-config.yaml",data:{app:{title:"Techdocs Preview App",baseUrl:"http://localhost:3000"},backend:{baseUrl:"http://localhost:3000"},techdocs:{builder:"external"}}}];if(!t)throw new Error("No static configuration provided");if(!Array.isArray(t))throw new Error("Static configuration has invalid format");const s=t.slice();if(i!=="__app_injected_runtime_config__".toLocaleUpperCase("en-US"))try{const h=JSON.parse(i);Array.isArray(h)?s.push(...h):s.push({data:h,context:"env"})}catch(h){throw new Error(`Failed to load runtime configuration, ${h}`)}const a=window.__APP_CONFIG__;return a&&s.push({context:"window",data:a}),s};class Uo{add(t,s){return this.apis.push([t.id,s]),s}build(){return new lr(new Map(this.apis))}constructor(){(0,Z._)(this,"apis",[])}}class lr{static builder(){return new Uo}static from(t){return new lr(new Map(t.map(([s,a])=>[s.id,a])))}static with(t,s){return new lr(new Map([[t.id,s]]))}with(t,s){return new lr(new Map([...this.apis,[t.id,s]]))}get(t){return this.apis.get(t.id)}constructor(t){(0,Z._)(this,"apis",void 0),this.apis=t}}function bo(i){const t=new Map;return i&&i({bind:(a,h)=>{for(const[w,B]of Object.entries(h)){const F=a[w];if(!F)throw new Error(`Key ${w} is not an existing external route`);if(!B&&!F.optional)throw new Error(`External route ${w} is required but was undefined`);B&&t.set(F,B)}}}),t}function So(i){const t=new URL(i);return t.protocol=document.location.protocol,t.hostname=document.location.hostname,t.port=document.location.port,t.toString().replace(/\/$/,"")}function Co(i,t,s){var a;const h=Boolean(i),w=(0,c.default)(i||(()=>Promise.resolve([])));let B;if(h&&w.loading){const{Progress:xe}=t;B=(0,p.jsx)(xe,{})}else if(w.error){const{BootErrorPage:xe}=t;B=(0,p.jsx)(xe,{step:"load-config",error:w.error})}const{ThemeProvider:F=Nr}=t;if(B)return{node:(0,p.jsx)(zt,{apis:lr.with(g.hg,s),children:(0,p.jsx)(F,{children:B})})};let ie;if(!((a=w.value)===null||a===void 0)&&a.length){const xe=te.fromConfigs(w.value),Re=xe.getOptionalString("app.baseUrl"),ze=xe.getOptionalString("backend.baseUrl");let ft=w.value;const Et={data:{},context:"relative-resolver"};if(Re&&ze){const vt=new URL(Re).origin,Wt=new URL(ze).origin;if(vt===Wt){const Ft=So(ze);ze!==Ft&&(Et.data.backend={baseUrl:Ft})}}if(Re){const vt=So(Re);Re!==vt&&(Et.data.app={baseUrl:vt})}Object.keys(Et.data).length&&(ft=ft.concat([Et])),ie=te.fromConfigs(ft)}else ie=te.fromConfigs([]);return{api:ie}}class Ir{getPlugins(){return this.app.getPlugins()}getSystemIcon(t){return this.app.getSystemIcon(t)}getSystemIcons(){return this.app.getSystemIcons()}getComponents(){return this.app.getComponents()}constructor(t){(0,Z._)(this,"app",void 0),this.app=t}}var wo=new WeakMap;class Mo{getPlugins(){return Array.from(this.plugins)}getSystemIcon(t){return this.icons[t]}getSystemIcons(){return this.icons}getComponents(){return this.components}createRoot(t){const s=this.getProvider();return()=>(0,p.jsx)(s,{children:t})}getProvider(){if((0,Kn._)(this,wo))throw new Error("app.getProvider() or app.createRoot() has already been called, and can only be called once");(0,S._)(this,wo,!0);const t=new Ir(this);let s=!1;return({children:h})=>{const w=(0,z.useRef)(!0),B=(0,z.useMemo)(()=>Ue.createWithStorage(this.themes),[]),{routing:F,featureFlags:ie,routeBindings:xe}=(0,z.useMemo)(()=>{const Et=b({root:h,discoverers:[Y,me],collectors:{routing:mn()?gr:ar,collectedPlugins:we,featureFlags:bn}});return Et.collectedPlugins.forEach(vt=>this.plugins.add(vt)),this.verifyPlugins(this.plugins),this.getApiHolder(),{...Et,routeBindings:bo(this.bindRoutes)}},[h]);s||(s=!0,qn(F.paths,F.parents),Dr(xe,this.plugins));const Re=Co(this.configLoader,this.components,B),ze="api"in Re;if(ze){const{api:Et}=Re;this.configApi=Et}if("node"in Re)return Re.node;if(ze&&w.current){w.current=!1;const Et=this.getApiHolder().get(g.W0);if(Et){for(const Ft of this.featureFlags)Et.registerFlag({...Ft,pluginId:""});for(const Ft of this.plugins.values())if("getFeatureFlags"in Ft)for(const Sr of Ft.getFeatureFlags())Et.registerFlag({name:Sr.name,pluginId:Ft.getId()});else for(const Sr of Ft.output())Sr.type==="feature-flag"&&Et.registerFlag({name:Sr.name,pluginId:Ft.getId()});const vt=Et.getRegisteredFlags(),Wt=new Set(vt.map(Ft=>Ft.name));for(const Ft of ie)Wt.has(Ft)||Et.registerFlag({name:Ft,pluginId:""})}}const{ThemeProvider:ft=Nr}=this.components;return(0,p.jsx)(zt,{apis:this.getApiHolder(),children:(0,p.jsx)(vo,{appContext:t,children:(0,p.jsx)(ft,{children:(0,p.jsx)(mr,{routePaths:F.paths,routeParents:F.parents,routeObjects:F.objects,routeBindings:xe,basePath:sn(Re.api),children:(0,p.jsx)(Pt.Provider,{value:{routeObjects:F.objects,appIdentityProxy:this.appIdentityProxy},children:h})})})})})}}getRouter(){return Hr}getApiHolder(){if(this.apiHolder){for(const t of this.plugins)for(const s of t.getApis())this.apiFactoryRegistry.get(s.api)||this.apiFactoryRegistry.register("default",s);return bt.validateFactories(this.apiFactoryRegistry,this.apiFactoryRegistry.getAllApis()),this.apiHolder}this.apiFactoryRegistry.register("static",{api:g.hg,deps:{},factory:()=>Ue.createWithStorage(this.themes)}),this.apiFactoryRegistry.register("static",{api:g.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:g.$4,deps:{},factory:()=>this.appIdentityProxy}),this.apiFactoryRegistry.register("default",{api:g.W0,deps:{},factory:()=>new Me});for(const t of this.defaultApis)this.apiFactoryRegistry.register("default",t);for(const t of this.plugins)for(const s of t.getApis())if(!this.apiFactoryRegistry.register("default",s))throw new Error(`Plugin ${t.getId()} tried to register duplicate or forbidden API factory for ${s.api}`);for(const t of this.apis)if(!this.apiFactoryRegistry.register("app",t))throw new Error(`Duplicate or forbidden API factory for ${t.api} in app`);return bt.validateFactories(this.apiFactoryRegistry,this.apiFactoryRegistry.getAllApis()),this.apiHolder=new bt(this.apiFactoryRegistry),this.apiHolder}verifyPlugins(t){const s=new Set;for(const a of t){const h=a.getId();if(s.has(h))throw new Error(`Duplicate plugin found '${h}'`);s.add(h)}}constructor(t){(0,Z._)(this,"apiHolder",void 0),(0,Z._)(this,"configApi",void 0),(0,Z._)(this,"apis",void 0),(0,Z._)(this,"icons",void 0),(0,Z._)(this,"plugins",void 0),(0,Z._)(this,"featureFlags",void 0),(0,Z._)(this,"components",void 0),(0,Z._)(this,"themes",void 0),(0,Z._)(this,"configLoader",void 0),(0,Z._)(this,"defaultApis",void 0),(0,Z._)(this,"bindRoutes",void 0),(0,Z._)(this,"appIdentityProxy",new Zo),(0,Z._)(this,"apiFactoryRegistry",void 0),(0,Tr._)(this,wo,{writable:!0,value:!1});var s;this.apis=(s=t.apis)!==null&&s!==void 0?s:[],this.icons=t.icons;var a;this.plugins=new Set((a=t.plugins)!==null&&a!==void 0?a:[]);var h;this.featureFlags=(h=t.featureFlags)!==null&&h!==void 0?h:[],this.components=t.components,this.themes=t.themes;var w;this.configLoader=(w=t.configLoader)!==null&&w!==void 0?w:Fr;var B;this.defaultApis=(B=t.defaultApis)!==null&&B!==void 0?B:[],this.bindRoutes=t.bindRoutes,this.apiFactoryRegistry=new Dt}}function oo(i){return new Mo(i)}let jo=!1;const Ss=i=>{const t=(0,g.qD)(),{NotFoundErrorPage:s}=t.getComponents(),a=(0,z.useMemo)(()=>mn(),[]),w=[...(0,g.vJ)(i.children,B=>B.getElements().flatMap(F=>{let ie=F.props.path;if(ie==="")return[];var xe;ie=(xe=ie==null?void 0:ie.replace(/\/\*$/,""))!==null&&xe!==void 0?xe:"/";let Re=a?F:F.props.element;return!a&&!Re&&(Re=F,jo||(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] />} />."),jo=!0)),[{path:ie,element:Re,children:F.props.children?[{path:ie==="/"?"/":"*",element:F.props.children}]:void 0}]}).sort((F,ie)=>ie.path.localeCompare(F.path)).map(F=>({...F,path:F.path==="/"?"/":`${F.path}/*`}))),{path:"*",element:(0,p.jsx)(s,{})}];return(0,W.V$)(w)},Eo=(0,g.T0)({id:"plugin.permission.api"});var er;(function(i){i.DENY="DENY",i.ALLOW="ALLOW",i.CONDITIONAL="CONDITIONAL"})(er||(er={}));function ti(i,t){return i.name===t.name}function zo(i,t){return"resourceType"in i?!t||i.resourceType===t:!1}function Cs(i){return i.attributes.action==="create"}function so(i){return i.attributes.action==="read"}function Kr(i){return i.attributes.action==="update"}function Yr(i){return i.attributes.action==="delete"}function Jr(i){return{authorize:async(t,s)=>await i.authorize(t,s),authorizeConditional(t,s){const a=t;return i.authorize(a,s)}}}function vr({name:i,attributes:t,resourceType:s}){return s?{type:"resource",name:i,attributes:t,resourceType:s}:{type:"basic",name:i,attributes:t}}var Jn=n(23054),io=n(96279),Wo=n.n(io),ws=n(9571);const Qr=et.z.lazy(()=>et.z.object({rule:et.z.string(),resourceType:et.z.string(),params:et.z.record(et.z.any()).optional()}).or(et.z.object({anyOf:et.z.array(Qr).nonempty()})).or(et.z.object({allOf:et.z.array(Qr).nonempty()})).or(et.z.object({not:Qr}))),Vo=et.z.object({result:et.z.literal(er.ALLOW).or(et.z.literal(er.DENY))}),js=et.z.union([et.z.object({result:et.z.literal(er.ALLOW).or(et.z.literal(er.DENY))}),et.z.object({result:et.z.literal(er.CONDITIONAL),pluginId:et.z.string(),resourceType:et.z.string(),conditions:Qr})]),Ho=(i,t)=>et.z.object({items:et.z.array(et.z.intersection(et.z.object({id:et.z.string()}),i)).refine(s=>s.length===t.size&&s.every(({id:a})=>t.has(a)),{message:"Items in response do not match request"})});class Go{async authorize(t,s){return this.makeRequest(t,Vo,s)}async authorizeConditional(t,s){return this.makeRequest(t,js,s)}async makeRequest(t,s,a){if(!this.enabled)return t.map(Re=>({result:er.ALLOW}));const h={items:t.map(Re=>({id:ws.Z(),...Re}))},w=await this.discovery.getBaseUrl("permission"),B=await Wo()(`${w}/authorize`,{method:"POST",body:JSON.stringify(h),headers:{...this.getAuthorizationHeader(a==null?void 0:a.token),"content-type":"application/json"}});if(!B.ok)throw await Jn.VL.fromResponse(B);const F=await B.json(),xe=Ho(s,new Set(h.items.map(({id:Re})=>Re))).parse(F).items.reduce((Re,ze)=>(Re[ze.id]=ze,Re),{});return h.items.map(Re=>xe[Re.id])}getAuthorizationHeader(t){return t?{Authorization:`Bearer ${t}`}:{}}constructor(t){(0,Z._)(this,"enabled",void 0),(0,Z._)(this,"discovery",void 0),this.discovery=t.discovery;var s;this.enabled=(s=t.config.getOptionalBoolean("permission.enabled"))!==null&&s!==void 0?s:!1}}class ao{static create(t){const{config:s,discovery:a,identity:h}=t,w=new Go({discovery:a,config:s});return new ao(w,h)}async authorize(t){return(await this.permissionClient.authorize([t],await this.identityApi.getCredentials()))[0]}constructor(t,s){(0,Z._)(this,"permissionClient",void 0),(0,Z._)(this,"identityApi",void 0),this.permissionClient=t,this.identityApi=s}}var Ao=n(69984);function lo(i){const t=(0,g.h_)(Eo),{data:s,error:a}=(0,Ao.ZP)(i,async h=>{if(zo(h.permission)&&!h.resourceRef)return er.DENY;const{result:w}=await t.authorize(h);return w});return a?{error:a,loading:!1,allowed:!1}:s===void 0?{loading:!0,allowed:!1}:{loading:!1,allowed:s===er.ALLOW}}const Es=i=>{const{permission:t,resourceRef:s,errorComponent:a,...h}=i,w=usePermission(isResourcePermission(t)?{permission:t,resourceRef:s}:{permission:t}),B=useApp(),{NotFoundErrorPage:F}=B.getComponents();let ie=a===void 0?_jsx(F,{}):a;return w.loading?ie=null:w.allowed&&(ie=i.element),_jsx(Route,{...h,element:ie})};function ni(i){const{permission:t,resourceRef:s}=i,a=usePermission(isResourcePermission(t)?{permission:t,resourceRef:s}:{permission:t}),h=useApp();if(a.loading)return null;if(a.allowed)return _jsx(_Fragment,{children:i.children});if(i.errorPage)return _jsx(_Fragment,{children:i.errorPage});const{NotFoundErrorPage:w}=h.getComponents();return _jsx(w,{})}const Ko=[(0,g.ni)({api:g.NW,deps:{configApi:g.Ds},factory:({configApi:i})=>O.compile(`${i.getString("backend.baseUrl")}/api/{{ pluginId }}`)}),(0,g.ni)({api:g.$v,deps:{},factory:()=>new k}),(0,g.ni)({api:g.v_,deps:{},factory:()=>new ce}),(0,g.ni)({api:g.VE,deps:{alertApi:g.$v},factory:({alertApi:i})=>{const t=new Q(i,new M);return he.forward(t,{hidden:!1}),t}}),(0,g.ni)({api:g.E6,deps:{errorApi:g.VE},factory:({errorApi:i})=>He.create({errorApi:i})}),(0,g.ni)({api:g.gP,deps:{configApi:g.Ds,identityApi:g.$4,discoveryApi:g.NW},factory:({configApi:i,identityApi:t,discoveryApi:s})=>ot({middleware:[Yt.resolvePluginProtocol({discoveryApi:s}),Yt.injectIdentityAuth({identityApi:t,config:i})]})}),(0,g.ni)({api:g.ZM,deps:{},factory:()=>new yn}),(0,g.ni)({api:g.Kp,deps:{discoveryApi:g.NW,oauthRequestApi:g.ZM,configApi:g.Ds},factory:({discoveryApi:i,oauthRequestApi:t,configApi:s})=>Xt.create({configApi:s,discoveryApi:i,oauthRequestApi:t,environment:s.getOptionalString("auth.environment")})}),(0,g.ni)({api:g.p_,deps:{discoveryApi:g.NW,oauthRequestApi:g.ZM,configApi:g.Ds},factory:({discoveryApi:i,oauthRequestApi:t,configApi:s})=>un.create({configApi:s,discoveryApi:i,oauthRequestApi:t,environment:s.getOptionalString("auth.environment")})}),(0,g.ni)({api:g.F4,deps:{discoveryApi:g.NW,oauthRequestApi:g.ZM,configApi:g.Ds},factory:({discoveryApi:i,oauthRequestApi:t,configApi:s})=>cn.create({configApi:s,discoveryApi:i,oauthRequestApi:t,defaultScopes:["read:user"],environment:s.getOptionalString("auth.environment")})}),(0,g.ni)({api:g.D,deps:{discoveryApi:g.NW,oauthRequestApi:g.ZM,configApi:g.Ds},factory:({discoveryApi:i,oauthRequestApi:t,configApi:s})=>$n.create({configApi:s,discoveryApi:i,oauthRequestApi:t,environment:s.getOptionalString("auth.environment")})}),(0,g.ni)({api:g.ux,deps:{discoveryApi:g.NW,oauthRequestApi:g.ZM,configApi:g.Ds},factory:({discoveryApi:i,oauthRequestApi:t,configApi:s})=>Ht.create({configApi:s,discoveryApi:i,oauthRequestApi:t,environment:s.getOptionalString("auth.environment")})}),(0,g.ni)({api:g.gW,deps:{discoveryApi:g.NW,oauthRequestApi:g.ZM,configApi:g.Ds},factory:({discoveryApi:i,oauthRequestApi:t,configApi:s})=>Fn.create({configApi:s,discoveryApi:i,oauthRequestApi:t,environment:s.getOptionalString("auth.environment")})}),(0,g.ni)({api:g.bq,deps:{discoveryApi:g.NW,oauthRequestApi:g.ZM,configApi:g.Ds},factory:({discoveryApi:i,oauthRequestApi:t,configApi:s})=>Zn.create({configApi:s,discoveryApi:i,oauthRequestApi:t,defaultScopes:["team"],environment:s.getOptionalString("auth.environment")})}),(0,g.ni)({api:g.Km,deps:{discoveryApi:g.NW,oauthRequestApi:g.ZM,configApi:g.Ds},factory:({discoveryApi:i,oauthRequestApi:t,configApi:s})=>de.create({configApi:s,discoveryApi:i,oauthRequestApi:t,defaultScopes:["REPO_READ"]})}),(0,g.ni)({api:g.uB,deps:{discoveryApi:g.NW,oauthRequestApi:g.ZM,configApi:g.Ds},factory:({discoveryApi:i,oauthRequestApi:t,configApi:s})=>G.create({configApi:s,discoveryApi:i,oauthRequestApi:t,environment:s.getOptionalString("auth.environment")})}),(0,g.ni)({api:Eo,deps:{discovery:g.NW,identity:g.$4,config:g.Ds},factory:({config:i,discovery:t,identity:s})=>ao.create({config:i,discovery:t,identity:s})})];var Yo=n(77277),rn=n(53974),As=n(71597);function x({children:i}){return(0,W.GV)()?(0,p.jsx)(p.Fragment,{children:i}):(0,p.jsx)(W.VA,{children:i})}const C=()=>(0,p.jsx)(rn.mf,{status:"404",statusMessage:"PAGE NOT FOUND"}),E=({step:i,error:t})=>{let s="";return i==="load-config"?s=`The configuration failed to load, someone should have a look at this error: ${t.message}`:i==="load-chunk"&&(s=`Lazy loaded chunk failed to load, try to reload the page: ${t.message}`),(0,p.jsx)(x,{children:(0,p.jsx)(rn.mf,{status:"501",statusMessage:s})})},D=({error:i,resetError:t,plugin:s})=>(0,p.jsx)(rn.yu,{title:`Error in ${s==null?void 0:s.getId()}`,defaultExpanded:!0,error:i,children:(0,p.jsx)(Yo.Z,{variant:"outlined",onClick:t,children:"Retry"})}),X={Progress:rn.Ex,Router:As.VK,NotFoundErrorPage:C,BootErrorPage:E,ErrorBoundaryFallback:D};var re=n(43642),oe=n(80079),ve=n(90941),Ae=n(32915),Oe=n(40562),De=n(21853),$e=n(60744),tt=n(66569),ht=n(30254),Qe=n(13384),Ve=n(15933),pt=n(58838),kt=n(86737),vn=n(4989),Tt=n(44407),Jt=n(18628),Bt=n(84219),on=n(98685),kn=n(39781),Pr=n(39412);const yr={brokenImage:oe.Z,catalog:Jt.Z,scaffolder:Ae.Z,techdocs:Oe.Z,search:De.Z,chat:$e.Z,dashboard:tt.Z,docs:ht.Z,email:Qe.Z,github:pt.Z,group:Bt.Z,help:kt.Z,"kind:api":Ve.Z,"kind:component":Tt.Z,"kind:domain":re.Z,"kind:group":Bt.Z,"kind:location":vn.Z,"kind:system":ve.Z,"kind:user":on.Z,"kind:resource":Pr.Z,user:on.Z,warning:kn.Z};var Zr=n(73689),Nn=n(4707);function Un(i,t){if(!t||typeof t=="string")return;const s=typeof t=="function"?t(i):t;if(s)return{"@global":s}}function xr(i,t){if(!(!t||typeof t=="string"))return typeof t=="object"?Object.fromEntries(Object.entries(t).map(([s,a])=>typeof a=="function"?[s,a({theme:i})]:[s,a])):t}const ri=/^&.Mui-([\w-]+)$/;function oi(i){let t=i;if(!i||typeof i!="object")return t;for(const s of Object.keys(i)){const a=i[s];if(!(!a||typeof a!="object"))for(const h of Object.keys(a)){const w=h,B=w.match(ri);if(B){const[,F]=B,{[w]:ie,...xe}=a;ie&&(t={...t,[s]:xe,[F]:ie})}}}return t}function Ts(i,t={}){const s={},a={};for(const h of Object.keys(t)){const w=t[h];w&&("styleOverrides"in w&&(h==="MuiCssBaseline"?s[h]=Un(i,w.styleOverrides):s[h]=oi(xr(i,w.styleOverrides))),"defaultProps"in w&&(a[h]=w.defaultProps))}return{overrides:s,props:a}}var si=n(47591);const Lr={MuiCssBaseline:{styleOverrides:i=>({html:{height:"100%",fontFamily:i.typography.fontFamily},body:{height:"100%",fontFamily:i.typography.fontFamily,overscrollBehaviorY:"none",fontSize:"0.875rem",lineHeight:1.43},a:{color:"inherit",textDecoration:"none"}})},MuiGrid:{defaultProps:{spacing:2}},MuiSwitch:{defaultProps:{color:"primary"}},MuiTableRow:{styleOverrides:{root:({theme:i})=>({"&:nth-of-type(odd)":{backgroundColor:i.palette.background.default}}),hover:{"&:hover":{cursor:"pointer"}},head:({theme:i})=>({"&:nth-of-type(odd)":{backgroundColor:i.palette.background.paper}})}},MuiTableCell:{styleOverrides:{root:({theme:i})=>({wordBreak:"break-word",overflow:"hidden",verticalAlign:"middle",lineHeight:"1",margin:0,padding:i.spacing(3,2,3,2.5),borderBottom:0}),sizeSmall:({theme:i})=>({padding:i.spacing(1.5,2,1.5,2.5)}),head:({theme:i})=>({wordBreak:"break-word",overflow:"hidden",color:i.palette.textSubtle,fontWeight:"normal",lineHeight:"1"})}},MuiTabs:{styleOverrides:{root:{minHeight:24}}},MuiTab:{styleOverrides:{root:({theme:i})=>({color:i.palette.link,minHeight:24,textTransform:"initial",letterSpacing:"0.07em","&:hover":{color:(0,si._j)(i.palette.link,.3),background:(0,si.$n)(i.palette.link,.95)},[i.breakpoints.up("md")]:{minWidth:120,fontSize:i.typography.pxToRem(14),fontWeight:500}}),textColorPrimary:({theme:i})=>({color:i.palette.link})}},MuiTableSortLabel:{styleOverrides:{root:{color:"inherit","&:hover":{color:"inherit"},"&:focus":{color:"inherit"},"&.Mui-active":{fontWeight:"bold",color:"inherit"}}}},MuiListItemText:{styleOverrides:{dense:{whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"}}},MuiButton:{styleOverrides:{text:{padding:void 0}}},MuiChip:{styleOverrides:{root:({theme:i})=>({backgroundColor:"#D9D9D9",marginRight:i.spacing(1),marginBottom:i.spacing(1),color:i.palette.grey[900]}),outlined:({theme:i})=>({color:i.palette.text.primary}),label:({theme:i})=>({lineHeight:i.spacing(2.5),fontWeight:i.typography.fontWeightMedium,fontSize:i.spacing(1.75)}),labelSmall:({theme:i})=>({fontSize:i.spacing(1.5)}),deleteIcon:({theme:i})=>({color:i.palette.grey[500],width:i.spacing(3),height:i.spacing(3),margin:`0 ${i.spacing(.75)} 0 -${i.spacing(.75)}`}),deleteIconSmall:({theme:i})=>({width:i.spacing(2),height:i.spacing(2),margin:`0 ${i.spacing(.5)} 0 -${i.spacing(.5)}`})}},MuiCard:{styleOverrides:{root:{display:"flex",flexDirection:"column"}}},MuiCardHeader:{styleOverrides:{root:{paddingBottom:0}}},MuiCardContent:{styleOverrides:{root:{flexGrow:1,"&:last-child":{paddingBottom:void 0}}}},MuiCardActions:{styleOverrides:{root:{justifyContent:"flex-end"}}}},cr={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")`},dr={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 tr(i){const{colors:t,shape:s,options:a}=i,w=`linear-gradient(90deg, ${(t.length===1?[t[0],t[0]]:t).join(", ")})`,B=`${s}, ${w}`;var F;const ie=(F=a==null?void 0:a.fontColor)!==null&&F!==void 0?F:"#FFFFFF";return{colors:t,shape:s,backgroundImage:B,fontColor:ie}}const Xr={home:tr({colors:dr.teal,shape:cr.wave}),documentation:tr({colors:dr.pinkSea,shape:cr.wave2}),tool:tr({colors:dr.purpleSky,shape:cr.round}),service:tr({colors:dr.marineBlue,shape:cr.wave}),website:tr({colors:dr.veryBlue,shape:cr.wave}),library:tr({colors:dr.rubyRed,shape:cr.wave}),other:tr({colors:dr.darkGrey,shape:cr.wave}),app:tr({colors:dr.toastyOrange,shape:cr.wave}),apis:tr({colors:dr.teal,shape:cr.wave2}),card:tr({colors:dr.greens,shape:cr.wave})},ii=16,Rs='"Helvetica Neue", Helvetica, Roboto, Arial, sans-serif',ai="home";function Jo(i){const{palette:t,htmlFontSize:s=ii,fontFamily:a=Rs,defaultPageTheme:h=ai,pageTheme:w=Xr}=i;if(!w[h])throw new Error(`${h} is not defined in pageTheme.`);var B;return{palette:t,typography:{htmlFontSize:s,fontFamily:a,h1:{fontSize:54,fontWeight:700,marginBottom:10},h2:{fontSize:40,fontWeight:700,marginBottom:8},h3:{fontSize:32,fontWeight:700,marginBottom:6},h4:{fontWeight:700,fontSize:28,marginBottom:6},h5:{fontWeight:700,fontSize:24,marginBottom:4},h6:{fontWeight:700,fontSize:20,marginBottom:2}},page:w[h],getPageTheme:({themeId:F})=>(B=w[F])!==null&&B!==void 0?B:w[h]}}var qr=new WeakMap;class Is{getTheme(t){return(0,Kn._)(this,qr).get(t)}constructor(t,s){(0,Tr._)(this,qr,{writable:!0,value:new Map}),(0,S._)(this,qr,new Map),t&&(0,Kn._)(this,qr).set("v4",t),s&&(0,Kn._)(this,qr).set("v5",s)}}function li(i){const t=Jo(i),s={...Lr,...i.components},a=(0,Nn.Z)({...t,components:s}),h=Ts(a,s),w={...(0,Zr.Z)(t),...h};return new Is(w,a)}function aa(i){const t=adaptV4Theme(i),s=createTheme(i);return new Is(s,t)}const co={light:{type:"light",mode:"light",background:{default:"#F8F8F8",paper:"#FFFFFF"},status:{ok:"#1DB954",warning:"#FF9800",error:"#E22134",running:"#1F5493",pending:"#FFED51",aborted:"#757575"},bursts:{fontColor:"#FEFEFE",slackChannelText:"#ddd",backgroundColor:{default:"#7C3699"},gradient:{linear:"linear-gradient(-137deg, #4BB8A5 0%, #187656 100%)"}},primary:{main:"#1F5493"},banner:{info:"#2E77D0",error:"#E22134",text:"#FFFFFF",link:"#000000",closeButtonColor:"#FFFFFF",warning:"#FF9800"},border:"#E6E6E6",textContrast:"#000000",textVerySubtle:"#DDD",textSubtle:"#6E6E6E",highlight:"#FFFBCC",errorBackground:"#FFEBEE",warningBackground:"#F59B23",infoBackground:"#ebf5ff",errorText:"#CA001B",infoText:"#004e8a",warningText:"#000000",linkHover:"#2196F3",link:"#0A6EBE",gold:"#FFD600",navigation:{background:"#171717",indicator:"#9BF0E1",color:"#b5b5b5",selectedColor:"#FFF",navItem:{hoverBackground:"#404040"},submenu:{background:"#404040"}},pinSidebarButton:{icon:"#181818",background:"#BDBDBD"},tabbar:{indicator:"#9BF0E1"}},dark:{type:"dark",mode:"dark",background:{default:"#333333",paper:"#424242"},status:{ok:"#71CF88",warning:"#FFB84D",error:"#F84C55",running:"#3488E3",pending:"#FEF071",aborted:"#9E9E9E"},bursts:{fontColor:"#FEFEFE",slackChannelText:"#ddd",backgroundColor:{default:"#7C3699"},gradient:{linear:"linear-gradient(-137deg, #4BB8A5 0%, #187656 100%)"}},primary:{main:"#9CC9FF",dark:"#82BAFD"},secondary:{main:"#FF88B2"},banner:{info:"#2E77D0",error:"#E22134",text:"#FFFFFF",link:"#000000",closeButtonColor:"#FFFFFF",warning:"#FF9800"},border:"#E6E6E6",textContrast:"#FFFFFF",textVerySubtle:"#727272",textSubtle:"#CCCCCC",highlight:"#FFFBCC",errorBackground:"#FFEBEE",warningBackground:"#F59B23",infoBackground:"#ebf5ff",errorText:"#CA001B",infoText:"#004e8a",warningText:"#000000",linkHover:"#82BAFD",link:"#9CC9FF",gold:"#FFD600",navigation:{background:"#424242",indicator:"#9BF0E1",color:"#b5b5b5",selectedColor:"#FFF",navItem:{hoverBackground:"#404040"},submenu:{background:"#404040"}},pinSidebarButton:{icon:"#404040",background:"#BDBDBD"},tabbar:{indicator:"#9BF0E1"}}},Ps={light:li({palette:co.light}),dark:li({palette:co.dark})};var nr=n(68542);nr.Z.configure(i=>`v5-${i}`);var la=n(12536),ca=n(19219),da=n(41547),ua=n(3493),ha=n(76919),pa=n(91994);const fa=(0,la.Z)({productionPrefix:"jss4-"});function ci(i){const{children:t,theme:s,noCssBaseline:a=!1}=i,h=s.getTheme("v4"),w=s.getTheme("v5");let B;a||(B=(0,p.jsx)(pa.ZP,{}));let F=(0,p.jsxs)(p.Fragment,{children:[B,t]});return h&&(F=(0,p.jsx)(ca.ZP,{generateClassName:fa,children:(0,p.jsx)(da.Z,{theme:h,children:F})})),w&&(F=(0,p.jsx)(ua.Z,{injectFirst:!0,children:(0,p.jsx)(ha.Z,{theme:w,children:F})})),F}function To(i){var t,s;return{props:{MuiGrid:Lr==null||(t=Lr.MuiGrid)===null||t===void 0?void 0:t.defaultProps,MuiSwitch:Lr==null||(s=Lr.MuiSwitch)===null||s===void 0?void 0:s.defaultProps},...Jo(i)}}function ga(i){return Ts(i,Lr).overrides}function di(i){const t=To(i),s=(0,Zr.Z)(t),a=ga(s);return{...s,overrides:a}}const ma=di({palette:co.light}),va=di({palette:co.dark});var Qo=n(98192),ui=n(15222);const hi=[{id:"light",title:"Light Theme",variant:"light",icon:(0,p.jsx)(ui.Z,{}),Provider:({children:i})=>(0,p.jsx)(ci,{theme:Ps.light,children:i})},{id:"dark",title:"Dark Theme",variant:"dark",icon:(0,p.jsx)(Qo.Z,{}),Provider:({children:i})=>(0,p.jsx)(ci,{theme:Ps.dark,children:i})}];function pi(i){var t,s,a,h;return oo({...i,apis:(t=i==null?void 0:i.apis)!==null&&t!==void 0?t:[],bindRoutes:i==null?void 0:i.bindRoutes,components:{...X,...i==null?void 0:i.components},configLoader:i==null?void 0:i.configLoader,defaultApis:Ko,icons:{...yr,...i==null?void 0:i.icons},plugins:(s=i==null?void 0:i.plugins)!==null&&s!==void 0?s:[],featureFlags:(a=i==null?void 0:i.featureFlags)!==null&&a!==void 0?a:[],themes:(h=i==null?void 0:i.themes)!==null&&h!==void 0?h:hi})}var _r=n(25271),rr=n(76635);async function Xo({storageApi:i}){const t=i.forBucket("settings"),s=i.forBucket("starredEntities"),a=t.snapshot("starredEntities").value;if(!(0,rr.isArray)(a))return;var h;const w=new Set((h=s.snapshot("entityRefs").value)!==null&&h!==void 0?h:[]);a.filter(rr.isString).map(B=>B.split(":")).filter(B=>B.length===4&&B[0]==="entity").map(([B,F,ie,xe])=>(0,_r.eE)({kind:F,namespace:ie,name:xe})).forEach(B=>w.add(B)),await s.set("entityRefs",Array.from(w)),await t.remove("starredEntities")}class Ro{async toggleStarred(t){this.starredEntities.has(t)?this.starredEntities.delete(t):this.starredEntities.add(t),await this.settingsStore.set("entityRefs",Array.from(this.starredEntities))}starredEntitie$(){return this.observable}notifyChanges(){for(const t of this.subscribers)t.next(new Set(this.starredEntities))}constructor(t){(0,Z._)(this,"settingsStore",void 0),(0,Z._)(this,"starredEntities",void 0),(0,Z._)(this,"subscribers",new Set),(0,Z._)(this,"observable",new(Ce())(a=>(a.next(new Set(this.starredEntities)),this.subscribers.add(a),()=>{this.subscribers.delete(a)}))),Xo(t).then(),this.settingsStore=t.storageApi.forBucket("starredEntities");var s;this.starredEntities=new Set((s=this.settingsStore.snapshot("entityRefs").value)!==null&&s!==void 0?s:[]),this.settingsStore.observe$("entityRefs").subscribe({next:a=>{var h;this.starredEntities=new Set((h=a.value)!==null&&h!==void 0?h:[]),this.notifyChanges()}})}}var fi=n(8799),Ur=n(79692),br=n(12420),Mn=n(39709),gi=n(19928);function ya(){const i=useApi(catalogApiRef),{error:t,loading:s,value:a}=useAsync(async()=>await i.getEntityFacets({facets:["kind"]}).then(w=>{var B;return((B=w.facets.kind)===null||B===void 0?void 0:B.map(F=>F.value).sort())||[]}),[i]);return{loading:s,error:t,allKinds:a!=null?a:[]}}function za(i,t,s){let a=i;return t&&(a=a.filter(w=>t.some(B=>B.toLocaleLowerCase("en-US")===w.toLocaleLowerCase("en-US")))),s&&!i.some(w=>w.toLocaleLowerCase("en-US")===s.toLocaleLowerCase("en-US"))&&(a=a.concat([s])),a.sort().reduce((w,B)=>(w[B.toLocaleLowerCase("en-US")]=B,w),{})}const ur=(0,Ur.Z)(i=>(0,br.Z)({root:{...i.typography.h4}}));function mi(i){var t;const{initialFilter:s="component",allowedKinds:a}=i,h=ur(),{allKinds:w}=useAllKinds(),{filters:B,updateFilters:F,queryParameters:{kind:ie}}=useEntityList(),xe=useMemo(()=>[ie].flat()[0],[ie]);var Re;const[ze,ft]=useState((Re=xe!=null?xe:(t=B.kind)===null||t===void 0?void 0:t.value)!==null&&Re!==void 0?Re:s);useEffect(()=>{xe&&ft(xe)},[xe]),useEffect(()=>{var vt;if(!((vt=B.kind)===null||vt===void 0)&&vt.value){var Wt;ft((Wt=B.kind)===null||Wt===void 0?void 0:Wt.value)}},[B.kind]),useEffect(()=>{F({kind:ze?new EntityKindFilter(ze):void 0})},[ze,F]);const Et=filterKinds(w,a,ze);return _jsx(Select,{input:_jsx(InputBase,{}),value:ze.toLocaleLowerCase("en-US"),onChange:vt=>ft(vt.target.value),classes:h,children:Object.keys(Et).map(vt=>_jsx(MenuItem,{value:vt,children:`${pluralize(Et[vt])}`},vt))})}var xa=n(86359),qo=n(95544),vi=n(99688),Io=n(12231),Mr=n(86136),uo=n(49378),Ls=n(85256),_o=n(80030),es=n(61837),ts=n(79784),yi=n(50758),Os=n(31654),ks=n(43054),Bs=n(65759),ba=n(49280),Po=n(96641);function xi(i){const{entity:t,loading:s,error:a}=(0,Po.ce)(),{allowed:h,loading:w,error:B}=lo({permission:i,resourceRef:t?(0,_r.eE)(t):void 0});return s||w?{loading:!0,allowed:!1}:a?{loading:!1,allowed:!1,error:a}:{loading:!1,allowed:h,error:B}}const ns="catalog-entity",$s=vr({name:"catalog.entity.read",attributes:{action:"read"},resourceType:ns}),Ds=vr({name:"catalog.entity.create",attributes:{action:"create"}}),Ns=vr({name:"catalog.entity.delete",attributes:{action:"delete"},resourceType:ns}),bi=vr({name:"catalog.entity.refresh",attributes:{action:"update"},resourceType:ns}),Si=vr({name:"catalog.location.read",attributes:{action:"read"}}),Fs=vr({name:"catalog.location.create",attributes:{action:"create"}}),Ci=vr({name:"catalog.location.delete",attributes:{action:"delete"}}),rs=[$s,Ds,Ns,bi,Si,Fs,Ci];var Zs=n(49166);function wi(i){const{unregisterEntityOptions:t,isUnregisterAllowed:s,onUnregisterEntity:a,onClose:h}=i,w=typeof(t==null?void 0:t.disableUnregister)=="boolean";var B;const F=(B=!s||(w?!!(t!=null&&t.disableUnregister):(t==null?void 0:t.disableUnregister)==="disable"))!==null&&B!==void 0?B:!1;let ie=(0,p.jsx)(p.Fragment,{});return(t==null?void 0:t.disableUnregister)!=="hidden"&&(ie=(0,p.jsxs)(Io.Z,{onClick:()=>{h(),a()},disabled:F,children:[(0,p.jsx)(Mr.Z,{children:(0,p.jsx)(Zs.Z,{fontSize:"small"})}),(0,p.jsx)(uo.Z,{primary:"Unregister entity"})]})),(0,p.jsx)(p.Fragment,{children:ie})}const Us=(0,Ur.Z)(i=>({button:{color:i.page.fontColor}}),{name:"PluginCatalogEntityContextMenu"});function ji(i){const{UNSTABLE_extraContextMenuItems:t,UNSTABLE_contextMenuOptions:s,onUnregisterEntity:a,onInspectEntity:h}=i,[w,B]=(0,z.useState)(),F=Us(),xe=xi(Ns).allowed,Re=Wt=>{B(Wt.currentTarget)},ze=()=>{B(void 0)},ft=(0,g.h_)(g.$v),Et=(0,z.useCallback)(()=>{window.navigator.clipboard.writeText(window.location.toString()).then(()=>ft.post({message:"Copied!",severity:"info",display:"transient"}))},[ft]),vt=t&&[...t.map(Wt=>(0,p.jsxs)(Io.Z,{onClick:()=>{ze(),Wt.onClick()},children:[(0,p.jsx)(Mr.Z,{children:(0,p.jsx)(Wt.Icon,{fontSize:"small"})}),(0,p.jsx)(uo.Z,{primary:Wt.title})]},Wt.title)),(0,p.jsx)(Ls.Z,{},"the divider is here!")];return(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)(_o.ZP,{title:"More",arrow:!0,children:(0,p.jsx)(es.Z,{"aria-label":"more","aria-controls":"long-menu","aria-haspopup":"true","aria-expanded":!!w,role:"button",onClick:Re,"data-testid":"menu-button",className:F.button,id:"long-menu",children:(0,p.jsx)(ks.Z,{})})}),(0,p.jsx)(ts.ZP,{open:Boolean(w),onClose:ze,anchorEl:w,anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"},"aria-labelledby":"long-menu",children:(0,p.jsxs)(yi.Z,{autoFocusItem:Boolean(w),children:[vt,(0,p.jsx)(wi,{unregisterEntityOptions:s,isUnregisterAllowed:xe,onUnregisterEntity:a,onClose:ze}),(0,p.jsxs)(Io.Z,{onClick:()=>{ze(),h()},children:[(0,p.jsx)(Mr.Z,{children:(0,p.jsx)(Os.Z,{fontSize:"small"})}),(0,p.jsx)(uo.Z,{primary:"Inspect entity"})]}),(0,p.jsxs)(Io.Z,{onClick:()=>{ze(),Et()},children:[(0,p.jsx)(Mr.Z,{children:(0,p.jsx)(Bs.Z,{fontSize:"small"})}),(0,p.jsx)(uo.Z,{primary:"Copy entity URL"})]})]})})]})}const os="plugin.catalog.entityLayoutRoute",Lo=()=>null;(0,g.R5)(Lo,os,!0),(0,g.R5)(Lo,"core.gatherMountPoints",!0);function Qn(i){const{entity:t,title:s}=i;return(0,p.jsxs)(qo.Z,{display:"inline-flex",alignItems:"center",height:"1em",maxWidth:"100%",children:[(0,p.jsx)(qo.Z,{component:"span",textOverflow:"ellipsis",whiteSpace:"nowrap",overflow:"hidden",children:s}),t&&(0,p.jsx)(Mn.LH,{entity:t})]})}function Ei(i,t,s,a){var h;const w=(h=i!=null?i:a==null?void 0:a.kind)!==null&&h!==void 0?h:"";var B;const F=(B=t!=null?t:a==null?void 0:a.metadata.namespace)!==null&&B!==void 0?B:"";var ie,xe,Re;return{headerTitle:`${(Re=(xe=(ie=a==null?void 0:a.metadata.title)!==null&&ie!==void 0?ie:s)!==null&&xe!==void 0?xe:a==null?void 0:a.metadata.name)!==null&&Re!==void 0?Re:""}${F&&F!==_r.zG?` in ${F}`:""}`,headerType:(()=>{let ft=w.toLocaleLowerCase("en-US");return a&&a.spec&&"type"in a.spec&&(ft+=" \u2014 ",ft+=a.spec.type.toLocaleLowerCase("en-US")),ft})()}}function Ai(i){var t;const{entity:s}=i,a=(0,Mn.hF)(s,_r.S4);return(0,p.jsxs)(p.Fragment,{children:[a.length>0&&(0,p.jsx)(rn.i9,{label:"Owner",value:(0,p.jsx)(Mn.rI,{entityRefs:a,defaultKind:"Group",color:"inherit"})}),((t=s.spec)===null||t===void 0?void 0:t.lifecycle)&&(0,p.jsx)(rn.i9,{label:"Lifecycle",value:s.spec.lifecycle})]})}const Ti=i=>{var t,s;const{UNSTABLE_extraContextMenuItems:a,UNSTABLE_contextMenuOptions:h,children:w,NotFoundComponent:B}=i,{kind:F,namespace:ie,name:xe}=(0,g.Oi)(Mn.wi),{entity:Re,loading:ze,error:ft}=(0,Mn.ce)(),Et=(0,W.TH)(),vt=(0,g.vJ)(w,ea=>ea.selectByComponentData({key:os,withStrictError:"Child of EntityLayout must be an EntityLayout.Route"}).getElements().flatMap(({props:eo})=>{if(Re){if(eo.if&&!eo.if(Re))return[]}else return[];return[{path:eo.path,title:eo.title,children:eo.children,tabProps:eo.tabProps}]}),[Re]),{headerTitle:Wt,headerType:Ft}=Ei(F,ie,xe,Re),[Sr,Wn]=(0,z.useState)(!1),[Or,zr]=(0,z.useState)(!1),qi=(0,W.s0)(),_i=async()=>{Wn(!1),zr(!1),qi("/")};(0,z.useEffect)(()=>{Wn(!1),zr(!1)},[Et.pathname]);var ps;return(0,p.jsxs)(rn.T3,{themeId:(ps=Re==null||(t=Re.spec)===null||t===void 0||(s=t.type)===null||s===void 0?void 0:s.toString())!==null&&ps!==void 0?ps:"home",children:[(0,p.jsx)(rn.h4,{title:(0,p.jsx)(Qn,{title:Wt,entity:Re}),pageTitleOverride:Wt,type:Ft,children:Re&&(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)(Ai,{entity:Re}),(0,p.jsx)(ji,{UNSTABLE_extraContextMenuItems:a,UNSTABLE_contextMenuOptions:h,onUnregisterEntity:()=>Wn(!0),onInspectEntity:()=>zr(!0)})]})}),ze&&(0,p.jsx)(rn.Ex,{}),Re&&(0,p.jsx)(rn.tn,{routes:vt}),ft&&(0,p.jsx)(rn.VY,{children:(0,p.jsx)(vi.Z,{severity:"error",children:ft.toString()})}),!ze&&!ft&&!Re&&(0,p.jsx)(rn.VY,{children:B||(0,p.jsxs)(rn.GB,{title:"Entity not found",children:["There is no ",F," with the requested"," ",(0,p.jsx)(rn.rU,{to:"https://backstage.io/docs/features/software-catalog/references",children:"kind, namespace, and name"}),"."]})}),(0,p.jsx)(Mn.pp,{open:Sr,entity:Re,onConfirm:_i,onClose:()=>Wn(!1)}),(0,p.jsx)(Mn.U_,{open:Or,entity:Re,onClose:()=>zr(!1)})]})};Ti.Route=Lo;function Ri(i){const{open:t,onClose:s,onConfirm:a,entity:h}=i,[w,B]=useState(!1),F=useApi(catalogApiRef),ie=useApi(alertApiRef),xe=async()=>{B(!0);try{const Re=h.metadata.uid;await F.removeEntityByUid(Re),a()}catch(Re){assertError(Re),ie.post({message:Re.message})}finally{B(!1)}};return _jsxs(Dialog,{open:t,onClose:s,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:w,onClick:xe,children:"Delete"}),_jsx(Button,{onClick:s,color:"primary",children:"Cancel"})]})]})}var ho=n(19625);function Wa(i){var t,s;return(i==null||(t=i.metadata)===null||t===void 0||(s=t.annotations)===null||s===void 0?void 0:s["backstage.io/orphan"])==="true"}function Ms(){const i=useNavigate(),t=useRouteRef(rootRouteRef),[s,a]=useState(!1),{entity:h}=useEntity(),w=async()=>{a(!1),i(t())};return _jsxs(_Fragment,{children:[_jsx(Alert,{severity:"warning",onClick:()=>a(!0),children:"This entity is not referenced by any location and is therefore not receiving updates. Click here to delete."}),_jsx(DeleteEntityDialog,{open:s,entity:h,onConfirm:w,onClose:()=>a(!1)})]})}var Ii=n(4791);const Pi=i=>i.error&&i.level==="error"&&i.type===ENTITY_STATUS_CATALOG_PROCESSING_TYPE;async function zs(i,t){return{items:(await t.getEntityAncestors({entityRef:i})).items.map(h=>{var w,B;return{errors:((B=(w=h.entity.status)===null||w===void 0?void 0:w.items)!==null&&B!==void 0?B:[]).filter(Pi).map(xe=>xe.error).filter(xe=>Boolean(xe)),entity:h.entity}}).filter(h=>h.errors.length>0)}}async function ss(i,t){const s=t.apis.get(catalogApiRef);if(!s)throw new Error(`No implementation available for ${catalogApiRef}`);return(await zs(stringifyEntityRef(i),s)).items.length>0}function Sa(){const{entity:i}=useEntity(),t=stringifyEntityRef(i),s=useApi(catalogApiRef),{loading:a,error:h,value:w}=useAsync(async()=>zs(t,s),[t,s]);return h?_jsx(Box,{mb:1,children:_jsx(ResponseErrorPanel,{error:h})}):a||!w?null:_jsx(_Fragment,{children:w.items.map((B,F)=>_jsxs(Box,{mb:1,children:[stringifyEntityRef(i)!==stringifyEntityRef(B.entity)&&_jsxs(Box,{p:1,children:["The error below originates from"," ",_jsx(EntityRefLink,{entityRef:B.entity})]}),B.errors.map((ie,xe)=>_jsx(ResponseErrorPanel,{error:ie},xe))]},F))})}const Ws="core.backstage.entitySwitch",is=i=>null;(0,g.R5)(is,Ws,!0);const Li=i=>{var t;const{entity:s,loading:a}=(0,Mn.ce)(),h=(0,g.I_)(),w=(0,g.vJ)(i.children,ie=>ie.selectByComponentData({key:Ws,withStrictError:"Child of EntitySwitch is not an EntitySwitch.Case"}).getElements().flatMap(xe=>{if(a)return[];const{if:Re,children:ze}=xe.props;return s?[{if:Re==null?void 0:Re(s,{apis:h}),children:ze}]:[{if:Re===void 0,children:ze}]}),[h,s,a]);if(w.some(ie=>typeof ie.if=="object"&&"then"in ie.if))return(0,p.jsx)(Ca,{results:w,renderMultipleMatches:i.renderMultipleMatches});if(i.renderMultipleMatches==="all"){const ie=w.filter(xe=>xe.if).map(xe=>xe.children);return ie.length===0?as(w):(0,p.jsx)(p.Fragment,{children:ie})}var F;return(F=(t=w.find(ie=>ie.if))===null||t===void 0?void 0:t.children)!==null&&F!==void 0?F:as(w)};function Ca({results:i,renderMultipleMatches:t}){const{loading:s,value:a}=(0,c.default)(async()=>{const h=i.map(async({if:B,children:F})=>{try{if(await B)return F}catch{}return null});if(t==="all"){const B=(await Promise.all(h)).filter(Boolean);return B.length===0?as(i):(0,p.jsx)(p.Fragment,{children:B})}var w;return(w=(await Promise.all(h)).find(Boolean))!==null&&w!==void 0?w:as(i)},[i]);return s||!a?null:a}function as(i){var t,s;return(s=(t=i.filter(a=>a.if===void 0)[0])===null||t===void 0?void 0:t.children)!==null&&s!==void 0?s:null}Li.Case=is;const wa=null,Va=Mn._i.Filters,Ha=Mn._i.Content;var Vs=n(85877),ls=n(15096);const zn=(0,g.rx)({id:"catalog",apis:[(0,g.ni)({api:Mn.Ah,deps:{discoveryApi:g.NW,fetchApi:g.gP},factory:({discoveryApi:i,fetchApi:t})=>new Ii.MS({discoveryApi:i,fetchApi:t})}),(0,g.ni)({api:Mn.p3,deps:{storageApi:g.E6},factory:({storageApi:i})=>new Ro({storageApi:i})})],routes:{catalogIndex:ho._Z,catalogEntity:Mn.wi},externalRoutes:{createComponent:ho.yw,viewTechDoc:ho.jU,createFromTemplate:ho.ql},__experimentalConfigure(i){return{...{createButtonTitle:"Create"},...i}}}),cs=zn.provide((0,g.P4)({name:"CatalogIndexPage",component:()=>n.e(9323).then(n.bind(n,89323)).then(i=>i.CatalogPage),mountPoint:ho._Z})),Oi=zn.provide((0,g.P4)({name:"CatalogEntityPage",component:()=>n.e(8951).then(n.bind(n,78951)).then(i=>i.CatalogEntityPage),mountPoint:Mn.wi})),Hs=zn.provide((0,g.CO)({name:"EntityAboutCard",component:{lazy:()=>Promise.resolve().then(n.bind(n,8799)).then(i=>i.AboutCard)}})),ja=zn.provide((0,g.CO)({name:"EntityLinksCard",component:{lazy:()=>n.e(7750).then(n.bind(n,17750)).then(i=>i.EntityLinksCard)}})),Ea=zn.provide((0,g.CO)({name:"EntityLabelsCard",component:{lazy:()=>Promise.resolve().then(n.bind(n,85877)).then(i=>i.EntityLabelsCard)}})),ki=zn.provide((0,g.CO)({name:"EntityHasSystemsCard",component:{lazy:()=>n.e(5458).then(n.bind(n,5458)).then(i=>i.HasSystemsCard)}})),Aa=zn.provide((0,g.CO)({name:"EntityHasComponentsCard",component:{lazy:()=>n.e(1105).then(n.bind(n,1105)).then(i=>i.HasComponentsCard)}})),Bi=zn.provide((0,g.CO)({name:"EntityHasSubcomponentsCard",component:{lazy:()=>n.e(2440).then(n.bind(n,82440)).then(i=>i.HasSubcomponentsCard)}})),Ga=zn.provide((0,g.CO)({name:"EntityHasResourcesCard",component:{lazy:()=>n.e(9770).then(n.bind(n,79770)).then(i=>i.HasResourcesCard)}})),Ka=zn.provide((0,g.CO)({name:"EntityDependsOnComponentsCard",component:{lazy:()=>n.e(9545).then(n.bind(n,19545)).then(i=>i.DependsOnComponentsCard)}})),Ya=zn.provide((0,g.CO)({name:"EntityDependencyOfComponentsCard",component:{lazy:()=>n.e(184).then(n.bind(n,40184)).then(i=>i.DependencyOfComponentsCard)}})),Ta=zn.provide((0,g.CO)({name:"EntityDependsOnResourcesCard",component:{lazy:()=>n.e(1032).then(n.bind(n,81032)).then(i=>i.DependsOnResourcesCard)}})),Ra=zn.provide((0,g.CO)({name:"RelatedEntitiesCard",component:{lazy:()=>n.e(732).then(n.bind(n,732)).then(i=>i.RelatedEntitiesCard)}})),Ja=zn.provide((0,ls.E5)({name:"CatalogSearchResultListItem",component:()=>n.e(7670).then(n.bind(n,27670)).then(i=>i.CatalogSearchResultListItem),predicate:i=>i.type==="software-catalog"}));var $i=n(32838);class Di{async getApiOrigin(){return await this.discoveryApi.getBaseUrl("techdocs")}async getStorageUrl(){return`${await this.discoveryApi.getBaseUrl("techdocs")}/static/docs`}async getBuilder(){return this.configApi.getString("techdocs.builder")}async getEntityDocs(t,s){const h=`${await this.getApiOrigin()}/${s}`,w=await fetch(`${h.endsWith("/")?h:`${h}/`}index.html`);if(w.status===404)throw new Error("Page not found");return w.text()}async syncEntityDocs(t){return"cached"}async getBaseUrl(t,s,a){const h=await this.getApiOrigin();return new URL(t,`${h}/${a}`).toString()}constructor({configApi:t,discoveryApi:s,identityApi:a}){(0,Z._)(this,"configApi",void 0),(0,Z._)(this,"discoveryApi",void 0),(0,Z._)(this,"identityApi",void 0),this.configApi=t,this.discoveryApi=s,this.identityApi=a}}class Ni{async getApiOrigin(){return await this.discoveryApi.getBaseUrl("techdocs")}async getEntityMetadata(t){return{apiVersion:"backstage.io/v1alpha1",kind:"Component",metadata:{name:"local"},spec:{owner:"test",lifecycle:"experimental"}}}async getTechDocsMetadata(t){return{site_name:"Live preview environment",site_description:""}}constructor({configApi:t,discoveryApi:s,identityApi:a}){(0,Z._)(this,"configApi",void 0),(0,Z._)(this,"discoveryApi",void 0),(0,Z._)(this,"identityApi",void 0),this.configApi=t,this.discoveryApi=s,this.identityApi=a}}const Gs=[(0,g.ni)({api:K.Dl,deps:{configApi:g.Ds,discoveryApi:g.NW,identityApi:g.$4},factory:({configApi:i,discoveryApi:t,identityApi:s})=>new Di({configApi:i,discoveryApi:t,identityApi:s})}),(0,g.ni)({api:K.gT,deps:{configApi:g.Ds,discoveryApi:g.NW,identityApi:g.$4},factory:({configApi:i,discoveryApi:t,identityApi:s})=>new Ni({configApi:i,discoveryApi:t,identityApi:s})}),(0,g.ni)({api:$i.q3,deps:{configApi:g.Ds},factory:({configApi:i})=>$i.ae.fromConfig(i)})],Fi={backend:{baseUrl:"http://localhost:3000"},techdocs:{builder:"external"}},Zi={backend:{baseUrl:"http://localhost:7007"},techdocs:{builder:"external"}};async function Ia(){const i=await fetch("/.detect");return i.ok?(await i.text()).trim()==="techdocs-cli-server":!1}async function Ui(){const i=await Fr(),t=await Ia();return[...i,{context:"detected",data:t?Fi:Zi}]}var Ks=n(58845);const Mi=(0,Ur.Z)({svg:{width:"auto",height:30},path:{fill:"#7df3e1"}});var zi=()=>{const i=Mi();return(0,p.jsx)("svg",{className:i.svg,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 2079.95 456.05",children:(0,p.jsx)("path",{className:i.path,d:"M302.9,180a80.62,80.62,0,0,0,13.44-10.37c.8-.77,1.55-1.54,2.31-2.31a81.89,81.89,0,0,0,7.92-9.37,62.37,62.37,0,0,0,6.27-10.77,48.6,48.6,0,0,0,4.36-16.4c1.49-19.39-10-38.67-35.62-54.22L198.42,14,78.16,129.22l-78.29,75,108.6,65.9a111.6,111.6,0,0,0,57.76,16.42c24.92,0,48.8-8.8,66.42-25.69,19.16-18.36,25.52-42.12,13.7-61.87a49.69,49.69,0,0,0-6.8-8.87,89.78,89.78,0,0,0,19.28,2.15H259a85.09,85.09,0,0,0,31-5.79A80.88,80.88,0,0,0,302.9,180Zm-100.59,59.8c-19.32,18.51-50.4,21.24-75.7,5.9l-75.13-45.6,67.44-64.65,76.42,46.39C222.88,198.57,221.36,221.6,202.31,239.84Zm8.94-82.21L140.6,114.74,205,53l69.37,42.11c25.94,15.73,29.31,37.05,10.55,55A60.71,60.71,0,0,1,211.25,157.63Zm29.86,190c-19.57,18.75-46.17,29.08-74.88,29.08a123.84,123.84,0,0,1-64.11-18.19L-.13,296.51v24.67l108.6,65.91a111.6,111.6,0,0,0,57.76,16.42c24.92,0,48.8-8.81,66.42-25.69,12.88-12.34,20-27.13,19.68-41.49v-1.79A87.85,87.85,0,0,1,241.11,347.67Zm0-39c-19.57,18.76-46.17,29.09-74.88,29.09a123.84,123.84,0,0,1-64.11-18.19L-.13,257.52V282.2l108.6,65.91a111.59,111.59,0,0,0,57.76,16.41c24.92,0,48.8-8.8,66.42-25.68,12.88-12.35,20-27.13,19.68-41.5v-1.79A86.86,86.86,0,0,1,241.11,308.68Zm0-39c-19.57,18.76-46.17,29.09-74.88,29.09a123.84,123.84,0,0,1-64.11-18.19L-.13,218.54v24.68l108.6,65.91a111.59,111.59,0,0,0,57.76,16.41c24.92,0,48.8-8.8,66.42-25.69,12.88-12.34,20-27.12,19.68-41.49v-1.82A87.14,87.14,0,0,1,241.11,269.7Zm83.69,25.74a94.16,94.16,0,0,1-60.19,25.86h0V348a81.6,81.6,0,0,0,51.73-22.37c14-13.38,21.15-28.11,21-42.64v-2.2A95.14,95.14,0,0,1,324.8,295.44Zm-83.69,91.21c-19.57,18.75-46.17,29.09-74.88,29.09a123.76,123.76,0,0,1-64.11-18.2L-.13,335.49v24.67l108.6,65.91a111.6,111.6,0,0,0,57.76,16.42c24.92,0,48.8-8.81,66.42-25.69,12.88-12.34,20-27.13,19.68-41.49v-1.79A87.35,87.35,0,0,1,241.11,386.65Zm85.75-210.21c-.68.69-1.35,1.38-2.06,2.05a99.19,99.19,0,0,1-22.23,15.69,94.53,94.53,0,0,1-26.24,8.71,97.84,97.84,0,0,1-14.16,1.57c.5,1.61.9,3.25,1.25,4.9a52.7,52.7,0,0,1,1.13,12V231h.05A84.48,84.48,0,0,0,290,225.47a80.83,80.83,0,0,0,26.38-16.82c.81-.77,1.51-1.56,2.27-2.34a82,82,0,0,0,7.92-9.38,62.85,62.85,0,0,0,6.29-10.78,48.5,48.5,0,0,0,4.32-16.44c.09-1.23.2-2.47.19-3.7v-2c-.72,1-1.48,2.06-2.26,3.09A98,98,0,0,1,326.86,176.44Zm0,77.92c-.68.7-1.3,1.41-2,2.1a94.09,94.09,0,0,1-60.19,25.85h0V309h0a81.65,81.65,0,0,0,51.73-22.37,73.51,73.51,0,0,0,16.48-22.49,48.56,48.56,0,0,0,4.32-16.44c.09-1.24.2-2.48.19-3.71v-2.2c-.74,1.08-1.47,2.16-2.27,3.22A95.81,95.81,0,0,1,326.82,254.36Zm0-39c-.68.7-1.3,1.41-2,2.1a92.22,92.22,0,0,1-10.62,8.65,93.53,93.53,0,0,1-11.63,7,95.63,95.63,0,0,1-37.94,10.18h-.05l0,26.67h0a81.63,81.63,0,0,0,51.73-22.37c.81-.77,1.51-1.56,2.27-2.34a82,82,0,0,0,7.92-9.38,63.16,63.16,0,0,0,6.29-10.77,48.55,48.55,0,0,0,4.32-16.45c.09-1.23.2-2.47.19-3.7v-2.2c-.74,1.08-1.47,2.16-2.27,3.22A98.19,98.19,0,0,1,326.82,215.38Zm241-88.84q7.94,0,17.09.17t18.12,1a139.3,139.3,0,0,1,16.74,2.57,42.78,42.78,0,0,1,13.3,5.14,64.27,64.27,0,0,1,20.54,19.89Q662,168,662,186.54q0,19.54-9.49,33.78t-27.1,21.09v.68q22.78,4.82,34.87,20.58t12.08,38.4a72.62,72.62,0,0,1-4.83,26.06,65.29,65.29,0,0,1-14.33,22.46,71.57,71.57,0,0,1-23.47,15.78q-14,6-32.28,6H478.38V126.54Zm9,105.27q28,0,40.21-9.78t12.26-29.31q0-13-4.14-20.58a29.47,29.47,0,0,0-11.4-11.66A45,45,0,0,0,597,155.17a161.2,161.2,0,0,0-20.19-1.2h-65.6v77.84Zm16.57,112.13q21.74,0,34-11.66T639.59,300q0-12-4.48-19.88a34.85,34.85,0,0,0-11.91-12.52,50.14,50.14,0,0,0-17.09-6.52,105,105,0,0,0-20-1.88H511.17v84.7Zm274.79,26.74q-7.61,4.45-21.06,4.46-11.4,0-18.12-6.34t-6.74-20.75a70.17,70.17,0,0,1-28.13,20.75,97.87,97.87,0,0,1-57.65,3.6,53.51,53.51,0,0,1-18.82-8.58A41.19,41.19,0,0,1,705,348.56q-4.65-9.42-4.66-22.8,0-15.09,5.18-24.69a44.92,44.92,0,0,1,13.64-15.6,62.63,62.63,0,0,1,19.33-9.09q10.88-3.08,22.27-5.14,12.08-2.4,23-3.6a128,128,0,0,0,19.16-3.43c5.53-1.48,9.89-3.65,13.12-6.51s4.83-7,4.83-12.52q0-9.6-3.62-15.43a24.94,24.94,0,0,0-9.32-8.92,38.38,38.38,0,0,0-12.78-4.11,96.54,96.54,0,0,0-14-1q-18.63,0-31.07,7T736.6,249.29H707.26q.69-16.46,6.9-27.77a52.21,52.21,0,0,1,16.57-18.35,70,70,0,0,1,23.65-10.11A125.51,125.51,0,0,1,782.86,190a168.63,168.63,0,0,1,24,1.72,63.26,63.26,0,0,1,21.58,7A41.23,41.23,0,0,1,844,213.59q5.87,9.57,5.87,25v91q0,10.26,1.21,15.05t8.11,4.79a35.57,35.57,0,0,0,9-1.37Zm-47.64-90.87c-3.69,2.74-8.52,4.72-14.5,6s-12.26,2.27-18.82,3.07-13.17,1.71-19.85,2.73a73.7,73.7,0,0,0-18,4.94,32.62,32.62,0,0,0-12.94,9.73q-5,6.32-5,17.23a23.31,23.31,0,0,0,2.94,12.11,24.11,24.11,0,0,0,7.59,8,32,32,0,0,0,10.88,4.44,60.94,60.94,0,0,0,13.11,1.36q14.5,0,24.86-3.92a52.49,52.49,0,0,0,16.91-9.9,39.1,39.1,0,0,0,9.67-13,32.53,32.53,0,0,0,3.11-13.14ZM1002.07,225q-11.05-9.25-29.69-9.26-15.89,0-26.58,5.83A47.29,47.29,0,0,0,928.71,237a64.66,64.66,0,0,0-9.15,22.12A119.83,119.83,0,0,0,916.8,285a98.22,98.22,0,0,0,2.93,24,64.18,64.18,0,0,0,9.15,20.74,46.2,46.2,0,0,0,16.23,14.58q10,5.49,23.82,5.48,21.75,0,34-11.31t15-31.89h30q-4.83,32.91-24.68,50.75t-54,17.83q-20.37,0-36.07-6.52A69.86,69.86,0,0,1,907,350.11a79.92,79.92,0,0,1-15.88-28.63A118.64,118.64,0,0,1,885.73,285a129.41,129.41,0,0,1,5.18-37.21,85.63,85.63,0,0,1,15.71-30.17A73.46,73.46,0,0,1,933,197.35Q948.91,190,970,190a108.54,108.54,0,0,1,28.48,3.6,69.59,69.59,0,0,1,23.48,11.15,61,61,0,0,1,16.74,19q6.55,11.49,8.29,27.26h-30.38Q1013.11,234.21,1002.07,225Zm109.77-98.41v145l81.47-77.49h39.36l-70.77,64.46,75.95,112.82h-37.29l-61.1-92.59-27.62,25.38v67.21H1082.5V126.54Zm170.54,205.22a31.07,31.07,0,0,0,10.87,10.63,49,49,0,0,0,15.19,5.66,87.06,87.06,0,0,0,17.44,1.71,109.18,109.18,0,0,0,14.5-1,53.22,53.22,0,0,0,14-3.78,26.27,26.27,0,0,0,10.53-8q4.14-5.32,4.14-13.55,0-11.31-8.63-17.14a73.69,73.69,0,0,0-21.58-9.43q-12.94-3.6-28.13-6.52a146,146,0,0,1-28.14-8.23A58.16,58.16,0,0,1,1261,267.13q-8.64-9.6-8.63-26.75,0-13.38,6-23a49.26,49.26,0,0,1,15.53-15.61,71.76,71.76,0,0,1,21.4-8.91A99.41,99.41,0,0,1,1319,190a141.31,141.31,0,0,1,28,2.58,64.85,64.85,0,0,1,22.62,8.91,46.16,46.16,0,0,1,15.7,17.15q5.87,10.8,6.91,26.91h-29.35q-.69-8.57-4.48-14.23a29.36,29.36,0,0,0-9.67-9.08,44.16,44.16,0,0,0-12.94-5,67.68,67.68,0,0,0-14.33-1.54,87.29,87.29,0,0,0-13.29,1,45.28,45.28,0,0,0-12.26,3.6,24.49,24.49,0,0,0-9,6.86q-3.46,4.29-3.46,11.14a16.32,16.32,0,0,0,5.36,12.52,42.75,42.75,0,0,0,13.63,8.23,120,120,0,0,0,18.64,5.48q10.37,2.24,20.72,4.63,11,2.4,21.57,5.83A70.74,70.74,0,0,1,1382,284.1a44.55,44.55,0,0,1,13.12,14.23q5,8.58,5,21.26,0,16.13-6.73,26.75a52.5,52.5,0,0,1-17.61,17.14,73.89,73.89,0,0,1-24.51,9.09,146.3,146.3,0,0,1-27.1,2.57,126.24,126.24,0,0,1-28.31-3.09A69.56,69.56,0,0,1,1272,361.94a51.74,51.74,0,0,1-16.57-18.52q-6.21-11.49-6.9-27.95h29.34A32.65,32.65,0,0,0,1282.38,331.76Zm226.46-137.67v25.72h-35.56V329.88a31.37,31.37,0,0,0,.87,8.23,8.42,8.42,0,0,0,3.28,4.8,14.61,14.61,0,0,0,6.73,2.23,99.19,99.19,0,0,0,11.22.51h13.46v25.72H1486.4a105.8,105.8,0,0,1-19.5-1.55,28.65,28.65,0,0,1-13.12-5.65,24.09,24.09,0,0,1-7.42-11.66q-2.43-7.54-2.42-19.89V219.81h-30.38V194.09h30.38V140.94h29.34v53.15ZM1699.4,370.68q-7.61,4.45-21.06,4.46-11.4,0-18.12-6.34t-6.74-20.75a70.17,70.17,0,0,1-28.13,20.75,97.87,97.87,0,0,1-57.65,3.6,53.51,53.51,0,0,1-18.82-8.58,41.19,41.19,0,0,1-12.6-15.26q-4.65-9.42-4.66-22.8,0-15.09,5.18-24.69a44.92,44.92,0,0,1,13.64-15.6,62.63,62.63,0,0,1,19.33-9.09q10.88-3.08,22.27-5.14,12.07-2.4,23-3.6a128,128,0,0,0,19.16-3.43c5.53-1.48,9.89-3.65,13.12-6.51s4.83-7,4.83-12.52q0-9.6-3.62-15.43a24.94,24.94,0,0,0-9.32-8.92,38.38,38.38,0,0,0-12.78-4.11,96.54,96.54,0,0,0-14-1q-18.63,0-31.07,7t-13.46,26.57h-29.34q.67-16.46,6.9-27.77A52.21,52.21,0,0,1,1562,203.17a70,70,0,0,1,23.65-10.11,125.51,125.51,0,0,1,28.48-3.09,168.63,168.63,0,0,1,24,1.72,63.26,63.26,0,0,1,21.58,7,41.23,41.23,0,0,1,15.53,14.89q5.87,9.57,5.87,25v91q0,10.26,1.21,15.05t8.11,4.79a35.57,35.57,0,0,0,9-1.37Zm-47.64-90.87c-3.69,2.74-8.52,4.72-14.5,6s-12.26,2.27-18.82,3.07-13.17,1.71-19.85,2.73a73.7,73.7,0,0,0-17.95,4.94,32.62,32.62,0,0,0-12.94,9.73q-5,6.32-5,17.23a23.31,23.31,0,0,0,2.94,12.11,24.11,24.11,0,0,0,7.59,8,32,32,0,0,0,10.88,4.44,60.94,60.94,0,0,0,13.11,1.36q14.51,0,24.86-3.92a52.49,52.49,0,0,0,16.91-9.9,39.1,39.1,0,0,0,9.67-13,32.53,32.53,0,0,0,3.11-13.14Zm208.85,141.62q-20,21.6-62.83,21.6a122.11,122.11,0,0,1-25.37-2.74,78,78,0,0,1-23.48-8.92,54.41,54.41,0,0,1-17.43-16.11q-6.91-10-7.6-24.35h29.35a21.47,21.47,0,0,0,5,13.38,36.67,36.67,0,0,0,11.4,8.91,55.52,55.52,0,0,0,14.67,5,79.51,79.51,0,0,0,15.19,1.55q14.49,0,24.51-5A46,46,0,0,0,1840.59,401a56.53,56.53,0,0,0,9.49-21.09,117.46,117.46,0,0,0,2.94-27.09V341.19h-.7q-7.59,16.46-23,24.18a71.8,71.8,0,0,1-32.63,7.71q-20,0-34.86-7.2A72.88,72.88,0,0,1,1737,346.51a82.13,82.13,0,0,1-15-28.46,116.62,116.62,0,0,1-5-34.47,133.92,133.92,0,0,1,4.14-32.4A88.17,88.17,0,0,1,1735,221a75.49,75.49,0,0,1,25.55-22.29q15.87-8.75,39-8.75a66.21,66.21,0,0,1,31.07,7.38,52.13,52.13,0,0,1,22.09,22.11h.35V194.09h27.61V356.28Q1880.63,399.83,1860.61,421.43Zm-37.46-79.72a47.94,47.94,0,0,0,16.4-15.78,71.89,71.89,0,0,0,9.15-22.11,106.77,106.77,0,0,0,2.93-24.69,96.71,96.71,0,0,0-2.76-23,64,64,0,0,0-8.8-20.4,45.76,45.76,0,0,0-15.71-14.57q-9.66-5.49-23.47-5.49-14.16,0-24.17,5.32a46.77,46.77,0,0,0-16.4,14.23,60.14,60.14,0,0,0-9.32,20.57,99.69,99.69,0,0,0-2.93,24.35,120.63,120.63,0,0,0,2.42,24,67.5,67.5,0,0,0,8.28,21.77,46.37,46.37,0,0,0,15.54,15.78q9.66,6,24.16,6T1823.15,341.71Zm228,18.34q-20,15.09-50.41,15.09-21.4,0-37.11-6.86a73.16,73.16,0,0,1-26.41-19.2,81.52,81.52,0,0,1-16-29.49,141.12,141.12,0,0,1-6-37.38,106.1,106.1,0,0,1,6.21-37A88.56,88.56,0,0,1,1938.8,216a79.09,79.09,0,0,1,26.58-19.2A81.66,81.66,0,0,1,1999,190q23.82,0,39.53,9.78a78,78,0,0,1,25.2,24.86,98.18,98.18,0,0,1,13.12,32.91,140.6,140.6,0,0,1,2.93,34h-133.6a70,70,0,0,0,2.76,22.12,49.9,49.9,0,0,0,10,18.51A49.1,49.1,0,0,0,1976.6,345q10.7,4.82,25.2,4.8,18.65,0,30.55-8.57t15.71-26.06h29Q2071.18,345,2051.17,360.05Zm-7.08-113.84a50,50,0,0,0-10.7-16,53.1,53.1,0,0,0-56.62-10.63,47.48,47.48,0,0,0-15.71,10.81,51.69,51.69,0,0,0-10.35,15.94,60.18,60.18,0,0,0-4.49,19.37h102.53A59.47,59.47,0,0,0,2044.09,246.21ZM302.9,180a80.62,80.62,0,0,0,13.44-10.37c.8-.77,1.55-1.54,2.31-2.31a81.89,81.89,0,0,0,7.92-9.37,62.37,62.37,0,0,0,6.27-10.77,48.6,48.6,0,0,0,4.36-16.4c1.49-19.39-10-38.67-35.62-54.22L198.42,14,78.16,129.22l-78.29,75,108.6,65.9a111.6,111.6,0,0,0,57.76,16.42c24.92,0,48.8-8.8,66.42-25.69,19.16-18.36,25.52-42.12,13.7-61.87a49.69,49.69,0,0,0-6.8-8.87,89.78,89.78,0,0,0,19.28,2.15H259a85.09,85.09,0,0,0,31-5.79A80.88,80.88,0,0,0,302.9,180Zm-100.59,59.8c-19.32,18.51-50.4,21.24-75.7,5.9l-75.13-45.6,67.44-64.65,76.42,46.39C222.88,198.57,221.36,221.6,202.31,239.84Zm8.94-82.21L140.6,114.74,205,53l69.37,42.11c25.94,15.73,29.31,37.05,10.55,55A60.71,60.71,0,0,1,211.25,157.63Zm29.86,190c-19.57,18.75-46.17,29.08-74.88,29.08a123.84,123.84,0,0,1-64.11-18.19L-.13,296.51v24.67l108.6,65.91a111.6,111.6,0,0,0,57.76,16.42c24.92,0,48.8-8.81,66.42-25.69,12.88-12.34,20-27.13,19.68-41.49v-1.79A87.85,87.85,0,0,1,241.11,347.67Zm0-39c-19.57,18.76-46.17,29.09-74.88,29.09a123.84,123.84,0,0,1-64.11-18.19L-.13,257.52V282.2l108.6,65.91a111.59,111.59,0,0,0,57.76,16.41c24.92,0,48.8-8.8,66.42-25.68,12.88-12.35,20-27.13,19.68-41.5v-1.79A86.86,86.86,0,0,1,241.11,308.68Zm0-39c-19.57,18.76-46.17,29.09-74.88,29.09a123.84,123.84,0,0,1-64.11-18.19L-.13,218.54v24.68l108.6,65.91a111.59,111.59,0,0,0,57.76,16.41c24.92,0,48.8-8.8,66.42-25.69,12.88-12.34,20-27.12,19.68-41.49v-1.82A87.14,87.14,0,0,1,241.11,269.7Zm83.69,25.74a94.16,94.16,0,0,1-60.19,25.86h0V348a81.6,81.6,0,0,0,51.73-22.37c14-13.38,21.15-28.11,21-42.64v-2.2A95.14,95.14,0,0,1,324.8,295.44Zm-83.69,91.21c-19.57,18.75-46.17,29.09-74.88,29.09a123.76,123.76,0,0,1-64.11-18.2L-.13,335.49v24.67l108.6,65.91a111.6,111.6,0,0,0,57.76,16.42c24.92,0,48.8-8.81,66.42-25.69,12.88-12.34,20-27.13,19.68-41.49v-1.79A87.35,87.35,0,0,1,241.11,386.65Zm85.75-210.21c-.68.69-1.35,1.38-2.06,2.05a99.19,99.19,0,0,1-22.23,15.69,94.53,94.53,0,0,1-26.24,8.71,97.84,97.84,0,0,1-14.16,1.57c.5,1.61.9,3.25,1.25,4.9a52.7,52.7,0,0,1,1.13,12V231h.05A84.48,84.48,0,0,0,290,225.47a80.83,80.83,0,0,0,26.38-16.82c.81-.77,1.51-1.56,2.27-2.34a82,82,0,0,0,7.92-9.38,62.85,62.85,0,0,0,6.29-10.78,48.5,48.5,0,0,0,4.32-16.44c.09-1.23.2-2.47.19-3.7v-2c-.72,1-1.48,2.06-2.26,3.09A98,98,0,0,1,326.86,176.44Zm0,77.92c-.68.7-1.3,1.41-2,2.1a94.09,94.09,0,0,1-60.19,25.85h0V309h0a81.65,81.65,0,0,0,51.73-22.37,73.51,73.51,0,0,0,16.48-22.49,48.56,48.56,0,0,0,4.32-16.44c.09-1.24.2-2.48.19-3.71v-2.2c-.74,1.08-1.47,2.16-2.27,3.22A95.81,95.81,0,0,1,326.82,254.36Zm0-39c-.68.7-1.3,1.41-2,2.1a92.22,92.22,0,0,1-10.62,8.65,93.53,93.53,0,0,1-11.63,7,95.63,95.63,0,0,1-37.94,10.18h-.05l0,26.67h0a81.63,81.63,0,0,0,51.73-22.37c.81-.77,1.51-1.56,2.27-2.34a82,82,0,0,0,7.92-9.38,63.16,63.16,0,0,0,6.29-10.77,48.55,48.55,0,0,0,4.32-16.45c.09-1.23.2-2.47.19-3.7v-2.2c-.74,1.08-1.47,2.16-2.27,3.22A98.19,98.19,0,0,1,326.82,215.38Z"})})};const Ys=(0,Ur.Z)({svg:{width:"auto",height:28},path:{fill:"#7df3e1"}});var Js=()=>{const i=Ys();return(0,p.jsx)("svg",{className:i.svg,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 337.46 428.5",children:(0,p.jsx)("path",{className:i.path,d:"M303,166.05a80.69,80.69,0,0,0,13.45-10.37c.79-.77,1.55-1.53,2.3-2.3a83.12,83.12,0,0,0,7.93-9.38A63.69,63.69,0,0,0,333,133.23a48.58,48.58,0,0,0,4.35-16.4c1.49-19.39-10-38.67-35.62-54.22L198.56,0,78.3,115.23,0,190.25l108.6,65.91a111.59,111.59,0,0,0,57.76,16.41c24.92,0,48.8-8.8,66.42-25.69,19.16-18.36,25.52-42.12,13.7-61.87a49.22,49.22,0,0,0-6.8-8.87A89.17,89.17,0,0,0,259,178.29h.15a85.08,85.08,0,0,0,31-5.79A80.88,80.88,0,0,0,303,166.05ZM202.45,225.86c-19.32,18.51-50.4,21.23-75.7,5.9L51.61,186.15l67.45-64.64,76.41,46.38C223,184.58,221.49,207.61,202.45,225.86Zm8.93-82.22-70.65-42.89L205.14,39,274.51,81.1c25.94,15.72,29.31,37,10.55,55A60.69,60.69,0,0,1,211.38,143.64Zm29.86,190c-19.57,18.75-46.17,29.09-74.88,29.09a123.73,123.73,0,0,1-64.1-18.2L0,282.52v24.67L108.6,373.1a111.6,111.6,0,0,0,57.76,16.42c24.92,0,48.8-8.81,66.42-25.69,12.88-12.34,20-27.13,19.68-41.49v-1.79A87.27,87.27,0,0,1,241.24,333.68Zm0-39c-19.57,18.75-46.17,29.08-74.88,29.08a123.81,123.81,0,0,1-64.1-18.19L0,243.53v24.68l108.6,65.91a111.6,111.6,0,0,0,57.76,16.42c24.92,0,48.8-8.81,66.42-25.69,12.88-12.34,20-27.13,19.68-41.5v-1.78A87.27,87.27,0,0,1,241.24,294.7Zm0-39c-19.57,18.76-46.17,29.09-74.88,29.09a123.81,123.81,0,0,1-64.1-18.19L0,204.55v24.68l108.6,65.91a111.59,111.59,0,0,0,57.76,16.41c24.92,0,48.8-8.8,66.42-25.68,12.88-12.35,20-27.13,19.68-41.5v-1.82A86.09,86.09,0,0,1,241.24,255.71Zm83.7,25.74a94.15,94.15,0,0,1-60.2,25.86h0V334a81.6,81.6,0,0,0,51.74-22.37c14-13.38,21.14-28.11,21-42.64v-2.19A94.92,94.92,0,0,1,324.94,281.45Zm-83.7,91.21c-19.57,18.76-46.17,29.09-74.88,29.09a123.73,123.73,0,0,1-64.1-18.2L0,321.5v24.68l108.6,65.9a111.6,111.6,0,0,0,57.76,16.42c24.92,0,48.8-8.8,66.42-25.69,12.88-12.34,20-27.13,19.68-41.49v-1.79A86.29,86.29,0,0,1,241.24,372.66ZM327,162.45c-.68.69-1.35,1.38-2.05,2.06a94.37,94.37,0,0,1-10.64,8.65,91.35,91.35,0,0,1-11.6,7,94.53,94.53,0,0,1-26.24,8.71,97.69,97.69,0,0,1-14.16,1.57c.5,1.61.9,3.25,1.25,4.9a53.27,53.27,0,0,1,1.14,12V217h.05a84.41,84.41,0,0,0,25.35-5.55,81,81,0,0,0,26.39-16.82c.8-.77,1.5-1.56,2.26-2.34a82.08,82.08,0,0,0,7.93-9.38A63.76,63.76,0,0,0,333,172.17a48.55,48.55,0,0,0,4.32-16.45c.09-1.23.2-2.47.19-3.7V150q-1.08,1.54-2.25,3.09A96.73,96.73,0,0,1,327,162.45Zm0,77.92c-.69.7-1.31,1.41-2,2.1a94.2,94.2,0,0,1-60.2,25.86h0l0,26.67h0a81.6,81.6,0,0,0,51.74-22.37A73.51,73.51,0,0,0,333,250.13a48.56,48.56,0,0,0,4.32-16.44c.09-1.24.2-2.47.19-3.71v-2.19c-.74,1.07-1.46,2.15-2.27,3.21A95.68,95.68,0,0,1,327,240.37Zm0-39c-.69.7-1.31,1.41-2,2.1a93.18,93.18,0,0,1-10.63,8.65,91.63,91.63,0,0,1-11.63,7,95.47,95.47,0,0,1-37.94,10.18h0V256h0a81.65,81.65,0,0,0,51.74-22.37c.8-.77,1.5-1.56,2.26-2.34a82.08,82.08,0,0,0,7.93-9.38A63.76,63.76,0,0,0,333,211.15a48.56,48.56,0,0,0,4.32-16.44c.09-1.24.2-2.48.19-3.71v-2.2c-.74,1.08-1.46,2.16-2.27,3.22A95.68,95.68,0,0,1,327,201.39Z"})})};const ds=(0,Ur.Z)({root:{width:rn.po.drawerWidthClosed,height:3*rn.po.logoHeight,display:"flex",flexFlow:"row nowrap",alignItems:"center",marginBottom:-14},link:{width:rn.po.drawerWidthClosed,marginLeft:24}}),Qs=()=>{const i=ds(),{isOpen:t}=(0,rn.mZ)();return(0,p.jsx)("div",{className:i.root,children:(0,p.jsx)(rn.rU,{to:"/docs/default/component/local/",underline:"none",className:i.link,children:t?(0,p.jsx)(zi,{}):(0,p.jsx)(Js,{})})})},Wi=({children:i})=>(0,p.jsxs)(rn.tR,{children:[(0,p.jsxs)(rn.YE,{children:[(0,p.jsx)(Qs,{}),(0,p.jsx)(rn.v7,{}),(0,p.jsx)(rn.R6,{icon:Ks.Z,to:"/docs/default/component/local",text:"Docs Preview"})]}),i]});var Vi=n(32388),Hi=n(4142);const Oo=(0,Ur.Z)(i=>({headerIcon:{color:i.palette.common.white,width:"32px",height:"32px"},content:{backgroundColor:i.palette.background.default},contentToolbar:{display:"flex",justifyContent:"flex-end",padding:0}}));var hr;(function(i){i.LIGHT="light",i.DARK="dark"})(hr||(hr={}));const Gi=()=>{const i=(0,g.h_)(g.hg),t=Oo(),[s,a]=(0,z.useState)(i.getActiveThemeId()===hr.DARK?hr.DARK:hr.LIGHT),h={[hr.LIGHT]:{icon:Hi.Z,title:"Dark theme"},[hr.DARK]:{icon:Vi.Z,title:"Light theme"}},{title:w,icon:B}=h[s],F=()=>{a(ie=>{const xe=ie===hr.LIGHT?hr.DARK:hr.LIGHT;return i.setActiveThemeId(xe),xe})};return(0,p.jsx)(qo.Z,{display:"flex",alignItems:"center",mr:2,children:(0,p.jsx)(_o.ZP,{title:w,arrow:!0,children:(0,p.jsx)(es.Z,{size:"small",onClick:F,children:(0,p.jsx)(B,{className:t.headerIcon})})})})},Ki=()=>(0,p.jsxs)(R.I6,{children:[(0,p.jsx)(ne.S,{}),(0,p.jsx)(L.F,{withSearch:!1})]}),Yi=(0,p.jsx)(Ki,{}),us=pi({apis:Gs,configLoader:Ui,plugins:Object.values(r)}),Xs=us.getProvider(),Ji=us.getRouter(),Qi=R.s4.provide((0,K.KY)({name:"ThemeToggleAddon",component:Gi,location:K.oZ.Header})),hs=(0,p.jsxs)(Ss,{children:[(0,p.jsx)(W.Fg,{to:"/docs/default/component/local/"},"/"),(0,p.jsx)(W.AW,{path:"/catalog/:namespace/:kind/:name",element:(0,p.jsx)(Oi,{})}),(0,p.jsx)(W.AW,{path:"/docs",element:(0,p.jsx)(R.Jl,{}),children:(0,p.jsx)(_.u,{})}),(0,p.jsxs)(W.AW,{path:"/docs/:namespace/:kind/:name/*",element:(0,p.jsx)(R.I6,{}),children:[Yi,(0,p.jsx)(K.DR,{children:(0,p.jsx)(Qi,{})})]})]});var Xi=()=>(0,p.jsx)(Xs,{children:(0,p.jsx)(Ji,{children:(0,p.jsx)(Wi,{children:hs})})});f.render((0,p.jsx)(Xi,{}),document.getElementById("root"))},51837:function(wt,ke,n){"use strict";n.d(ke,{CT:function(){return g},EI:function(){return ge},uW:function(){return f},Vt:function(){return u}});function r(){return typeof window!="undefined"&&window.Math===Math?window:typeof self!="undefined"&&self.Math===Math?self:Function("return this")()}const p=r(),z=ue=>`__@backstage/${ue}__`;function f(ue,V){const ne=z(ue);let L=p[ne];return L||(L=V(),p[ne]=L,L)}var W=n(2784);function g(ue){return f(ue,()=>(0,W.createContext)(void 0))}function u(ue){return(0,W.useContext)(g(ue))}function N(ue){return{set(V){globalThis[`__@backstage/${ue}__`]=createContext(createVersionedValueMap(V))},reset(){delete globalThis[`__@backstage/${ue}__`]}}}function ge(ue){Object.freeze(ue);const V={atVersion(ne){return ue[ne]}};return Object.defineProperty(V,"$map",{configurable:!0,enumerable:!0,get(){return ue}}),V}},96641:function(wt,ke,n){"use strict";n.d(ke,{X2:function(){return ge},ce:function(){return ue},h$:function(){return u}});var r=n(52322),p=n(25271),z=n(60871),f=n(51837),W=n(2784);const g=(0,f.CT)("entity-context"),u=V=>{const{children:ne,entity:L,loading:A,error:le,refresh:se}=V,ae={entity:L,loading:A,error:le,refresh:se};return(0,r.jsx)(g.Provider,{value:(0,f.EI)({1:ae}),children:(0,r.jsx)(z.fC,{attributes:{...L?{entityRef:(0,p.eE)(L)}:void 0},children:ne})})},N=V=>_jsx(u,{entity:V.entity,loading:!Boolean(V.entity),error:void 0,refresh:void 0,children:V.children});function ge(){const V=(0,f.Vt)("entity-context");if(!V)throw new Error("Entity context is not available");const ne=V.atVersion(1);if(!ne)throw new Error("EntityContext v1 not available");if(!ne.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:ne.entity}}function ue(){const V=(0,f.Vt)("entity-context");if(!V)throw new Error("Entity context is not available");const ne=V.atVersion(1);if(!ne)throw new Error("EntityContext v1 not available");const{entity:L,loading:A,error:le,refresh:se}=ne;return{entity:L,loading:A,error:le,refresh:se}}},39709:function(wt,ke,n){"use strict";n.d(ke,{h$:function(){return _e.h$},n3:function(){return r.n3},_i:function(){return H},tW:function(){return et},df:function(){return Ue},UO:function(){return Be},ph:function(){return rn},dq:function(){return jt},nl:function(){return Ko},dx:function(){return Ct},rI:function(){return hn},u3:function(){return Kn},xE:function(){return S},sL:function(){return c},LH:function(){return Ne},U_:function(){return Jr},pp:function(){return Qr},EW:function(){return Ao},Ah:function(){return z},wi:function(){return Fe},hF:function(){return K.hF},CV:function(){return K.CV},$3:function(){return _t},p3:function(){return f},ce:function(){return _e.ce},X2:function(){return _e.X2},wp:function(){return gt},ZW:function(){return Cn},eK:function(){return ln},CR:function(){return Ht}});var r=n(4791),p=n(60871);const z=(0,p.T0)({id:"plugin.catalog.service"}),f=(0,p.T0)({id:"catalog-react.starred-entities"});var W=n(82394);class g{async toggleStarred(C){this.starredEntities.delete(C)||this.starredEntities.add(C);for(const E of this.subscribers)E.next(new Set(this.starredEntities))}starredEntitie$(){return this.observable}constructor(){_define_property(this,"starredEntities",new Set),_define_property(this,"subscribers",new Set),_define_property(this,"observable",new ObservableImpl(C=>(C.next(new Set(this.starredEntities)),this.subscribers.add(C),()=>{this.subscribers.delete(C)})))}}var u=n(52322),N=n(2784),ge=n(41156),ue=n(60364),V=n(77277),ne=n(4190),L=n(95544),A=n(90436),le=n(60905),se=n(36444);const ae=x=>{const C=(0,ge.Z)(re=>re.breakpoints.down("md")),E=(0,ue.Z)(),[D,X]=(0,N.useState)(!1);return C?(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)(V.Z,{style:{marginTop:E.spacing(1),marginLeft:E.spacing(1)},onClick:()=>X(!0),startIcon:(0,u.jsx)(se.Z,{}),children:"Filters"}),(0,u.jsx)(ne.ZP,{open:D,onClose:()=>X(!1),anchor:"left",disableAutoFocus:!0,keepMounted:!0,variant:"temporary",children:(0,u.jsxs)(L.Z,{m:2,children:[(0,u.jsx)(A.Z,{variant:"h6",component:"h2",style:{marginBottom:E.spacing(1)},children:"Filters"}),x.children]})})]}):(0,u.jsx)(le.Z,{item:!0,lg:2,children:x.children})},_=x=>(0,u.jsx)(le.Z,{item:!0,xs:12,lg:10,children:x.children}),H=x=>(0,u.jsx)(le.Z,{container:!0,style:{position:"relative"},children:x.children});H.Filters=ae,H.Content=_;var T=n(53974),R=n(87612),P=n(25271),K=n(49280);class je{getCatalogFilters(){return{kind:this.value}}toQueryValue(){return this.value}constructor(C){(0,R._)(this,"value",void 0),this.value=C}}class Le{getTypes(){return Array.isArray(this.value)?this.value:[this.value]}getCatalogFilters(){return{"spec.type":this.getTypes()}}toQueryValue(){return this.getTypes()}constructor(C){(0,R._)(this,"value",void 0),this.value=C}}class Z{filterEntity(C){var E;return this.values.every(D=>((E=C.metadata.tags)!==null&&E!==void 0?E:[]).includes(D))}toQueryValue(){return this.values}constructor(C){(0,R._)(this,"values",void 0),this.values=C}}class Xe{filterEntity(C){const E=this.toUpperArray(this.value.split(/\s/)),D=this.toUpperArray([C.metadata.tags]),X=this.toUpperArray([C.metadata.name,C.metadata.title]);for(const re of E)if(D.every(oe=>oe!==re)&&X.every(oe=>!oe.includes(re)))return!1;return!0}toUpperArray(C){return C.flat().filter(E=>Boolean(E)).map(E=>E.toLocaleUpperCase("en-US"))}constructor(C){_define_property(this,"value",void 0),this.value=C}}class at{filterEntity(C){return this.values.some(E=>(0,K.hF)(C,P.S4).some(D=>(0,P.eE)(D)===E))}toQueryValue(){return this.values}constructor(C){(0,R._)(this,"values",void 0),this.values=C.reduce((E,D)=>{try{return E.push((0,P.eE)((0,P.of)(D,{defaultKind:"Group"}))),E}catch{return E}},[])}}class Rt{filterEntity(C){return this.values.some(E=>{var D;return((D=C.spec)===null||D===void 0?void 0:D.lifecycle)===E})}toQueryValue(){return this.values}constructor(C){(0,R._)(this,"values",void 0),this.values=C}}class zt{filterEntity(C){return this.values.some(E=>C.metadata.namespace===E)}toQueryValue(){return this.values}constructor(C){(0,R._)(this,"values",void 0),this.values=C}}class bt{filterEntity(C){switch(this.value){case"owned":return this.isOwnedEntity(C);case"starred":return this.isStarredEntity(C);default:return!0}}toQueryValue(){return this.value}constructor(C,E,D){(0,R._)(this,"value",void 0),(0,R._)(this,"isOwnedEntity",void 0),(0,R._)(this,"isStarredEntity",void 0),this.value=C,this.isOwnedEntity=E,this.isStarredEntity=D}}class Zt{filterEntity(C){var E;const D=(E=C.metadata.annotations)===null||E===void 0?void 0:E["backstage.io/orphan"];return D!==void 0&&this.value.toString()===D}constructor(C){(0,R._)(this,"value",void 0),this.value=C}}class Dt{filterEntity(C){var E,D;const X=(C==null||(E=C.status)===null||E===void 0||(D=E.items)===null||D===void 0?void 0:D.length)>0;return X!==void 0&&this.value===X}constructor(C){(0,R._)(this,"value",void 0),this.value=C}}var _e=n(96641),lt=n(76635),yt=n(19126),qe=n.n(yt),Lt=n(73557),Vt=n(69294),be=n(48760),Ce=n(90736);const Ke=(0,N.createContext)(void 0),Be=x=>{const C=(0,Ce.default)(),E=(0,p.h_)(z),[D,X]=(0,N.useState)({}),re=(0,Lt.TH)();var oe;const ve=(0,N.useMemo)(()=>(oe=qe().parse(re.search,{ignoreQueryPrefix:!0}).filters)!==null&&oe!==void 0?oe:{},[re]),[Ae,Oe]=(0,N.useState)(()=>({appliedFilters:{},entities:[],backendEntities:[]})),[{loading:De,error:$e},tt]=(0,Vt.default)(async()=>{const Ve=(0,lt.compact)(Object.values(D)),pt=(0,K.Gz)(Ve),kt=(0,K.wq)(Ve),vn=(0,K.wq)((0,lt.compact)(Object.values(Ae.appliedFilters))),Tt=Object.keys(D).reduce((Bt,on)=>{const kn=D[on];return kn!=null&&kn.toQueryValue&&(Bt[on]=kn.toQueryValue()),Bt},{});if((0,lt.isEqual)(vn,kt))Oe({appliedFilters:D,backendEntities:Ae.backendEntities,entities:Ae.backendEntities.filter(pt)});else{const Bt=await E.getEntities({filter:kt});Oe({appliedFilters:D,backendEntities:Bt.items,entities:Bt.items.filter(pt)})}if(C()){var Jt;const Bt=qe().parse(re.search,{ignoreQueryPrefix:!0}),on=qe().stringify({...Bt,filters:Tt},{addQueryPrefix:!0,arrayFormat:"repeat"}),kn=`${window.location.pathname}${on}`;(Jt=window.history)===null||Jt===void 0||Jt.replaceState(null,document.title,kn)}},[E,ve,D,Ae],{loading:!0});(0,be.Z)(tt,10,[D]);const ht=(0,N.useCallback)(Ve=>{X(pt=>{const kt=typeof Ve=="function"?Ve(pt):Ve;return{...pt,...kt}})},[]),Qe=(0,N.useMemo)(()=>({filters:Ae.appliedFilters,entities:Ae.entities,backendEntities:Ae.backendEntities,updateFilters:ht,queryParameters:ve,loading:De,error:$e}),[Ae,ht,ve,De,$e]);return(0,u.jsx)(Ke.Provider,{value:Qe,children:x.children})};function gt(){const x=(0,N.useContext)(Ke);if(!x)throw new Error("useEntityList must be used within EntityListProvider");return x}var xt=n(64279),nt=n(18149),Ye=n.n(nt),Ge=n(829),ct=n.n(Ge);function ut(){const x=(0,p.h_)(z),{filters:{kind:C,type:E},queryParameters:{type:D},updateFilters:X}=gt(),re=(0,N.useMemo)(()=>[D].flat().filter(Boolean),[D]);var oe;const[ve,Ae]=(0,N.useState)(re.length?re:(oe=E==null?void 0:E.getTypes())!==null&&oe!==void 0?oe:[]);(0,N.useEffect)(()=>{re.length&&Ae(re)},[re]);const[Oe,De]=(0,N.useState)([]),$e=(0,N.useMemo)(()=>C==null?void 0:C.value,[C]),{error:tt,loading:ht,value:Qe}=(0,xt.default)(async()=>$e?await x.getEntityFacets({filter:{kind:$e},facets:["spec.type"]}).then(kt=>kt.facets["spec.type"]||[]):[],[$e,x]),Ve=(0,N.useRef)(Qe);return(0,N.useEffect)(()=>{const pt=Ve.current;if(Ve.current=Qe,ht||!$e||pt===Qe||!Qe)return;const kt=[...new Set(ct()(Qe,Tt=>-Tt.count).map(Tt=>Tt.value.toLocaleLowerCase("en-US")))];De(kt);const vn=ve.filter(Tt=>kt.includes(Tt));Ye()(ve,vn)||Ae(vn)},[ht,$e,ve,Ae,Qe]),(0,N.useEffect)(()=>{X({type:ve.length?new Le(ve):void 0})},[ve,X]),{loading:ht,error:tt,availableTypes:Oe,selectedTypes:ve,setSelectedTypes:Ae}}function ln(x,C){var E,D;const X=C==null||(E=C.type)===null||E===void 0?void 0:E.toLocaleLowerCase("en-US"),re=C==null||(D=C.kind)===null||D===void 0?void 0:D.toLocaleLowerCase("en-US"),oe=(0,p.h_)(z),{loading:ve,value:Ae,error:Oe}=(0,xt.default)(async()=>{var De;const $e=(De=x.relations)===null||De===void 0?void 0:De.filter(ht=>(!X||ht.type.toLocaleLowerCase("en-US")===X)&&(!re||(0,P.of)(ht.targetRef).kind===re));if(!($e!=null&&$e.length))return[];const{items:tt}=await oe.getEntitiesByRefs({entityRefs:$e.map(ht=>ht.targetRef)});return tt.filter(ht=>Boolean(ht))},[x,X,re]);return{entities:Ae,loading:ve,error:Oe}}var cn=n(72164);function dn(x){return typeof x=="string"?x:(0,P.eE)(x)}function Ht(){const x=(0,p.h_)(f),C=(0,cn.Z)(x.starredEntitie$(),new Set),E=(0,N.useCallback)(X=>C.has(dn(X)),[C]),D=(0,N.useCallback)(X=>x.toggleStarred(dn(X)).then(),[x]);return{starredEntities:C,toggleStarredEntity:D,isStarredEntity:E}}function Sn(x){return typeof x=="string"?x:(0,P.eE)(x)}function Qt(x){const C=(0,p.h_)(f),[E,D]=(0,N.useState)(!1);return(0,N.useEffect)(()=>{const re=C.starredEntitie$().subscribe({next(oe){D(oe.has(Sn(x)))}});return()=>{re.unsubscribe()}},[x,C]),{toggleStarredEntity:(0,N.useCallback)(()=>C.toggleStarred(Sn(x)).then(),[x,C]),isStarredEntity:E}}var Xt=n(75435);function Cn(){const x=(0,p.h_)(p.$4),{loading:C,value:E}=(0,xt.default)(async()=>{const{ownershipEntityRefs:X}=await x.getBackstageIdentity();return X},[]),D=(0,N.useMemo)(()=>{const X=new Set(E!=null?E:[]);return re=>{const oe=(0,Xt.h)(re,P.S4).map(P.eE);for(const ve of oe)if(X.has(ve))return!0;return!1}},[E]);return(0,N.useMemo)(()=>({loading:C,isOwnedEntity:D}),[C,D])}function tn(){const x=(0,p.h_)(z),{error:C,loading:E,value:D}=(0,xt.default)(async()=>await x.getEntityFacets({facets:["kind"]}).then(re=>{var oe;return((oe=re.facets.kind)===null||oe===void 0?void 0:oe.map(ve=>ve.value).sort())||[]}),[x]);return{loading:E,error:C,allKinds:D!=null?D:[]}}function Tn(x,C,E){let D=x;return C&&(D=D.filter(re=>C.some(oe=>oe.toLocaleLowerCase("en-US")===re.toLocaleLowerCase("en-US")))),E&&!x.some(re=>re.toLocaleLowerCase("en-US")===E.toLocaleLowerCase("en-US"))&&(D=D.concat([E])),D.sort().reduce((re,oe)=>(re[oe.toLocaleLowerCase("en-US")]=oe,re),{})}function $n(x){var C;const{filters:E,queryParameters:{kind:D},updateFilters:X}=gt(),re=(0,N.useMemo)(()=>[D].flat()[0],[D]);var oe;const[ve,Ae]=(0,N.useState)((oe=re!=null?re:(C=E.kind)===null||C===void 0?void 0:C.value)!==null&&oe!==void 0?oe:x.initialFilter);(0,N.useEffect)(()=>{re&&Ae(re)},[re]),(0,N.useEffect)(()=>{var tt;if(!((tt=E.kind)===null||tt===void 0)&&tt.value){var ht;Ae((ht=E.kind)===null||ht===void 0?void 0:ht.value)}},[E.kind]),(0,N.useEffect)(()=>{X({kind:ve?new je(ve):void 0})},[ve,X]);const{allKinds:Oe,loading:De,error:$e}=tn();return{loading:De,error:$e,allKinds:Oe!=null?Oe:[],selectedKind:ve,setSelectedKind:Ae}}const et=x=>{const{allowedKinds:C,hidden:E,initialFilter:D="component"}=x,X=(0,p.h_)(p.$v),{error:re,allKinds:oe,selectedKind:ve,setSelectedKind:Ae}=$n({initialFilter:D});if((0,N.useEffect)(()=>{re&&X.post({message:"Failed to load entity kinds",severity:"error"})},[re,X]),re)return null;const Oe=Tn(oe,C,ve),De=Object.keys(Oe).map($e=>({value:$e,label:Oe[$e]}));return E?null:(0,u.jsx)(L.Z,{pb:1,pt:1,children:(0,u.jsx)(T.Ph,{label:"Kind",items:De,selected:ve.toLocaleLowerCase("en-US"),onChange:$e=>Ae(String($e))})})};var nn=n(79692),Gt=n(38016),rt=n(88013),Dn=n(21324),un=n(5806),Pn=n(19996),wn=n(25505);const jn=(0,u.jsx)(wn.Z,{fontSize:"small"}),Fn=(0,u.jsx)(Pn.Z,{fontSize:"small"});function Rn({selected:x}){return(0,u.jsx)(Dn.Z,{icon:jn,checkedIcon:Fn,checked:x})}const Zn=(0,N.memo)(x=>{const{selected:C,value:E,availableOptions:D,showCounts:X}=x,re=X?`${E} (${D==null?void 0:D[E]})`:E;return(0,u.jsx)(un.Z,{control:(0,u.jsx)(Rn,{selected:C}),label:re,onClick:oe=>oe.preventDefault()})});var Se=n(86619),de=n(72779),Ie=n.n(de);const G=(0,nn.Z)({input:{}},{name:"CatalogReactEntityAutocompletePickerInput"});function k(x){const C=G();return(0,u.jsx)(Se.Z,{variant:"outlined",...x,className:Ie()(C.input,x.className)})}function ce(x){var C;const{label:E,name:D,path:X,showCounts:re,Filter:oe,InputProps:ve,initialSelectedOptions:Ae=[]}=x,{updateFilters:Oe,filters:De,queryParameters:{[D]:$e}}=gt(),tt=(0,p.h_)(z),{value:ht}=(0,xt.default)(async()=>{var Bt;const on=X,{facets:kn}=await tt.getEntityFacets({facets:[on],filter:(Bt=De.kind)===null||Bt===void 0?void 0:Bt.getCatalogFilters()});return Object.fromEntries(kn[on].map(({value:Pr,count:yr})=>[Pr,yr]))},[De.kind]),Qe=(0,N.useMemo)(()=>[$e].flat().filter(Boolean),[$e]);var Ve;const[pt,kt]=(0,N.useState)(Qe.length?Qe:(Ve=(C=De[D])===null||C===void 0?void 0:C.values)!==null&&Ve!==void 0?Ve:Ae);(0,N.useEffect)(()=>{Qe.length&&kt(Qe)},[Qe]);const vn=Object.keys(ht!=null?ht:{}),Tt=pt.length&&vn.length;(0,N.useEffect)(()=>{Oe({[D]:Tt?new oe(pt):void 0})},[D,Tt,pt,oe,Oe]);const Jt=De[D];return Jt&&typeof Jt=="object"&&!("values"in Jt)||!vn.length||vn.length<=1?null:(0,u.jsx)(L.Z,{pb:1,pt:1,children:(0,u.jsxs)(A.Z,{variant:"button",component:"label",children:[E,(0,u.jsx)(rt.ZP,{multiple:!0,disableCloseOnSelect:!0,options:vn,value:pt,onChange:(Bt,on)=>kt(on),renderOption:(Bt,{selected:on})=>(0,u.jsx)(Zn,{selected:on,value:Bt,availableOptions:ht,showCounts:!!re}),size:"small",popupIcon:(0,u.jsx)(Gt.Z,{"data-testid":`${String(D)}-picker-expand`}),renderInput:Bt=>(0,u.jsx)(k,{...Bt,...ve})})]})})}const Pe=(0,nn.Z)({input:{}},{name:"CatalogReactEntityLifecyclePicker"}),Ue=x=>{const{initialFilter:C=[]}=x,E=Pe();return(0,u.jsx)(ce,{label:"Lifecycle",name:"lifecycles",path:"spec.lifecycle",Filter:Rt,InputProps:{className:E.input},initialSelectedOptions:C})};var We=n(6232),St=n(98685),Ot=n(62367),qt=n(72579),Kt=n.n(qt);function _t(x,C){const E=C==null?void 0:C.defaultKind;let D,X,re;return"metadata"in x?(D=x.kind,X=x.metadata.namespace,re=x.metadata.name):(D=x.kind,X=x.namespace,re=x.name),(X===void 0||X==="")&&(X=P.zG),(C==null?void 0:C.defaultNamespace)!==void 0?(C==null?void 0:C.defaultNamespace)===X&&(X=void 0):X===P.zG&&(X=void 0),D=D.toLocaleLowerCase("en-US"),D=E&&E.toLocaleLowerCase("en-US")===D?void 0:D,`${D?`${D}:`:""}${X?`${X}/`:""}${re}`}function ee(x,C){for(const E of["spec.profile.displayName","metadata.title"]){const D=Kt()(x,E);if(D&&typeof D=="string")return D}return C}function q({enabled:x}){const C=(0,p.h_)(z),[E]=(0,N.useState)(async()=>{if(!x)return[];const D="relations.ownedBy";return C.getEntityFacets({facets:[D]}).then(X=>X.facets[D].map(re=>re.value).map(re=>{const{kind:oe,name:ve,namespace:Ae}=(0,P.of)(re);return{apiVersion:"backstage.io/v1beta1",kind:oe,metadata:{name:ve,namespace:Ae}}}).sort((re,oe)=>(re.metadata.namespace||"").localeCompare(oe.metadata.namespace||"","en-US")||re.metadata.name.localeCompare(oe.metadata.name,"en-US")||re.kind.localeCompare(oe.kind,"en-US"))).catch(()=>[])});return(0,Vt.default)(async(D,X)=>{const re=await E;if(!re)return{items:[]};var oe;const ve=(oe=X==null?void 0:X.limit)!==null&&oe!==void 0?oe:20,{text:Ae,start:Oe}=te(D),De=re.filter(tt=>Q(Ae,tt)),$e=Oe+ve;return{items:De.slice(0,$e),...O({entities:De,limit:$e,payload:{text:Ae,start:$e}})}},[E],{loading:!0,value:{items:[]}})}function te(x){return v(x)&&x.cursor?JSON.parse(atob(x.cursor)):{text:x.text||"",start:0}}function v(x){return!!x.cursor}function O({entities:x,limit:C,payload:E}){return x.length>C?{cursor:btoa(JSON.stringify(E))}:{}}function Q(x,C){var E;const D=x.trim();return C.kind.includes(D)||((E=C.metadata.namespace)===null||E===void 0?void 0:E.includes(D))||C.metadata.name.includes(D)}function M(){const x=(0,p.h_)(z);return(0,Vt.default)(async(C,E)=>{const D=C,X=C;var re;const oe=(re=E==null?void 0:E.limit)!==null&&re!==void 0?re:20;if(X.cursor){const Ae=await x.queryEntities({cursor:X.cursor,limit:oe});return{cursor:Ae.pageInfo.nextCursor,items:[...X.items,...Ae.items]}}const ve=await x.queryEntities({fullTextFilter:{term:D.text||"",fields:["metadata.name","kind","spec.profile.displayname","metadata.title"]},filter:{kind:["User","Group"]},orderFields:[{field:"metadata.name",order:"asc"}],limit:oe});return{cursor:ve.pageInfo.nextCursor,items:ve.items}},[],{loading:!0})}var he=n(21638);function ye({mode:x,initialSelectedOwnersRefs:C}){const E=x==="owners-only",D=M(),X=q({enabled:E}),[re,oe]=E?X:D;return[re,oe,Me({enabled:!E,initialSelectedOwnersRefs:C})]}function Me({enabled:x,initialSelectedOwnersRefs:C}){const E=(0,N.useRef)({}),D=(0,p.h_)(z),[,X]=(0,Vt.default)(async()=>{(await D.getEntitiesByRefs({entityRefs:C})).items.forEach(oe=>{oe&&(E.current[(0,P.eE)(oe)]=oe)})},[]);return(0,he.n)(()=>{x&&C.length>0&&X()}),{getEntity:re=>E.current[re],setEntity:re=>{E.current[(0,P.eE)(re)]=re}}}const ot=(0,nn.Z)({input:{}},{name:"CatalogReactEntityOwnerPicker"}),dt=(0,u.jsx)(wn.Z,{fontSize:"small"}),At=(0,u.jsx)(Pn.Z,{fontSize:"small"}),jt=x=>{var C,E;const D=ot(),{mode:X="owners-only"}=x||{},{updateFilters:re,filters:oe,queryParameters:{owners:ve}}=gt(),[Ae,Oe]=(0,N.useState)(""),De=(0,N.useMemo)(()=>[ve].flat().filter(Boolean),[ve]);var $e;const[tt,ht]=(0,N.useState)(De.length?De:($e=(C=oe.owners)===null||C===void 0?void 0:C.values)!==null&&$e!==void 0?$e:[]),[{value:Qe,loading:Ve},pt,kt]=ye({mode:X,initialSelectedOwnersRefs:tt});(0,We.b)(()=>pt({text:Ae}),[Ae,pt],250);const vn=(Qe==null?void 0:Qe.items)||[];return(0,N.useEffect)(()=>{if(De.length){const Tt=new at(De);ht(Tt.values)}},[De]),(0,N.useEffect)(()=>{re({owners:tt.length?new at(tt):void 0})},[tt,re]),["user","group"].includes(((E=oe.kind)===null||E===void 0?void 0:E.value.toLocaleLowerCase("en-US"))||"")?null:(0,u.jsx)(L.Z,{pb:1,pt:1,children:(0,u.jsxs)(A.Z,{variant:"button",component:"label",children:["Owner",(0,u.jsx)(rt.ZP,{multiple:!0,disableCloseOnSelect:!0,loading:Ve,options:vn,value:tt,getOptionSelected:(Tt,Jt)=>typeof Jt=="string"?(0,P.eE)(Tt)===Jt:Tt===Jt,getOptionLabel:Tt=>{const Jt=typeof Tt=="string"?kt.getEntity(Tt)||(0,P.of)(Tt,{defaultKind:"group",defaultNamespace:"default"}):Tt;return ee(Jt,_t(Jt))},onChange:(Tt,Jt)=>{Oe(""),ht(Jt.map(Bt=>{const on=typeof Bt=="string"?Bt:(0,P.eE)(Bt);return typeof Bt!="string"&&kt.setEntity(Bt),on}))},filterOptions:Tt=>Tt,renderOption:(Tt,{selected:Jt})=>{const Bt=Tt.kind.toLocaleLowerCase("en-US")==="group";return(0,u.jsx)(un.Z,{control:(0,u.jsx)(Dn.Z,{icon:dt,checkedIcon:At,checked:Jt}),onClick:on=>on.preventDefault(),label:(0,u.jsxs)(L.Z,{display:"flex",flexWrap:"wrap",alignItems:"center",children:[Bt?(0,u.jsx)(Ot.Z,{fontSize:"small"}):(0,u.jsx)(St.Z,{fontSize:"small"}),"\xA0",ee(Tt,_t(Tt,{defaultKind:Tt.kind}))]})})},size:"small",popupIcon:(0,u.jsx)(Gt.Z,{"data-testid":"owner-picker-expand"}),renderInput:Tt=>(0,u.jsx)(Se.Z,{...Tt,className:D.input,onChange:Jt=>{Oe(Jt.currentTarget.value)},variant:"outlined"}),ListboxProps:{onScroll:Tt=>{const Jt=Tt.currentTarget;Math.abs(Jt.scrollHeight-Jt.clientHeight-Jt.scrollTop)<1&&(Qe!=null&&Qe.cursor)&&pt({items:Qe.items,cursor:Qe.cursor})},"data-testid":"owner-picker-listbox"}})]})})};var st=n(51837);const Fe=(0,st.uW)("catalog:entity-route-ref",()=>(0,p.NT)({id:"catalog:entity",params:["namespace","kind","name"]}));function Ut(x){var C,E;return{kind:x.kind.toLocaleLowerCase("en-US"),namespace:(E=(C=x.metadata.namespace)===null||C===void 0?void 0:C.toLocaleLowerCase("en-US"))!==null&&E!==void 0?E:DEFAULT_NAMESPACE,name:x.metadata.name}}var Yt=n(80030);const Ct=(0,N.forwardRef)((x,C)=>{const{entityRef:E,defaultKind:D,title:X,children:re,...oe}=x,ve=(0,p.tg)(Fe);let Ae,Oe,De;if(typeof E=="string"){const Ve=(0,P.of)(E);Ae=Ve.kind,Oe=Ve.namespace,De=Ve.name}else"metadata"in E?(Ae=E.kind,Oe=E.metadata.namespace,De=E.metadata.name):(Ae=E.kind,Oe=E.namespace,De=E.name);Ae=Ae.toLocaleLowerCase("en-US");var $e;Oe=($e=Oe==null?void 0:Oe.toLocaleLowerCase("en-US"))!==null&&$e!==void 0?$e:P.zG;const tt={kind:Ae,namespace:Oe,name:De},ht=_t({kind:Ae,namespace:Oe,name:De},{defaultKind:D}),Qe=(0,u.jsxs)(T.rU,{...oe,ref:C,to:ve(tt),children:[re,!re&&(X!=null?X:ht)]});return X?(0,u.jsx)(Yt.ZP,{title:ht,children:Qe}):Qe});function Nt(x){const{entityRefs:C,defaultKind:E,getTitle:D,...X}=x,re=(0,p.h_)(z),{value:oe=new Array,loading:ve,error:Ae}=(0,xt.default)(async()=>{const Oe=C.reduce(($e,tt)=>typeof tt=="object"&&"metadata"in tt?$e:[...$e,(0,P.of)(tt)],new Array),De=C.filter($e=>typeof $e=="object"&&"metadata"in $e);return Oe.length>0?[...(await re.getEntities({filter:Oe.map($e=>({kind:$e.kind,"metadata.namespace":$e.namespace,"metadata.name":$e.name}))})).items,...De]:De},[C]);return ve?(0,u.jsx)(T.Ex,{}):Ae?(0,u.jsx)(T.yu,{error:Ae}):(0,u.jsx)(u.Fragment,{children:oe.map((Oe,De)=>(0,u.jsxs)(N.Fragment,{children:[De>0&&", ",(0,u.jsx)(Ct,{...X,defaultKind:E,entityRef:Oe,title:D(Oe)})]},De))})}function hn(x){const{entityRefs:C,defaultKind:E,fetchEntities:D,getTitle:X,...re}=x;return D?(0,u.jsx)(Nt,{...re,defaultKind:E,entityRefs:C,getTitle:X}):(0,u.jsx)(u.Fragment,{children:C.map((oe,ve)=>(0,u.jsxs)(N.Fragment,{children:[ve>0&&", ",(0,u.jsx)(Ct,{...re,defaultKind:E,entityRef:oe,title:X?X(oe):void 0})]},ve))})}const yn=x=>{const C=useRouteRef(entityRouteRef);return _jsx(IconButton,{component:Link,"aria-label":"Show",title:"Show details",to:C(getCompoundEntityRef(x.entity)),children:_jsx(InfoIcon,{})})},mt=x=>_jsx(IconButton,{component:Link,"aria-label":"Email",title:`Email ${x.email}`,to:`mailto:${x.email}`,children:_jsx(EmailIcon,{})}),He=x=>{var C;const E=(C=x.entity.spec.profile)===null||C===void 0?void 0:C.email;return E?_jsx(EmailCardAction,{email:E}):null},Pt=x=>{var C;const E=(C=x.entity.spec.profile)===null||C===void 0?void 0:C.email;return E?_jsx(EmailCardAction,{email:E}):null},mn=(0,nn.Z)(()=>({popoverPaper:{width:"30em"},descriptionTypography:{overflow:"hidden",textOverflow:"ellipsis",display:"-webkit-box",WebkitLineClamp:2,WebkitBoxOrient:"vertical"}})),en=4,sr=x=>{var C,E,D;const{entityRef:X,children:re,delayTime:oe=500}=x,ve=mn(),Ae=useApiHolder(),Oe=usePopupState({variant:"popover",popupId:"entity-peek-ahead"}),[De,$e]=useState(!1),tt=useMemo(()=>debounce(()=>$e(!0),oe),[oe]),[{loading:ht,error:Qe,value:Ve},pt]=useAsyncFn(async()=>{const vn=Ae.get(catalogApiRef);if(vn){const Tt=await vn.getEntityByRef(X);if(!Tt)throw new Error(`${X} not found`);return Tt}},[Ae,X]),kt=()=>{$e(!1),tt.cancel()};return useEffect(()=>{Oe.isOpen&&!Ve&&!Qe&&!ht&&pt()},[Oe.isOpen,pt,Ve,Qe,ht]),_jsxs(_Fragment,{children:[_jsx(Typography,{component:"span",onMouseEnter:tt,children:_jsx(Typography,{component:"span","data-testid":"trigger",...bindHover(Oe),children:re})}),De&&_jsx(HoverPopover,{PaperProps:{className:ve.popoverPaper},...bindPopover(Oe),anchorOrigin:{vertical:"bottom",horizontal:"center"},transformOrigin:{vertical:"top",horizontal:"center"},onMouseLeave:kt,children:_jsxs(Card,{children:[_jsxs(CardContent,{children:[Qe&&_jsx(ResponseErrorPanel,{error:Qe}),ht&&_jsx(Progress,{}),Ve&&_jsxs(_Fragment,{children:[_jsx(Typography,{color:"textSecondary",children:Ve.metadata.namespace}),_jsx(Typography,{variant:"h5",component:"div",children:Ve.metadata.name}),_jsx(Typography,{color:"textSecondary",gutterBottom:!0,children:Ve.kind}),Ve.metadata.description&&_jsx(Typography,{className:ve.descriptionTypography,paragraph:!0,children:Ve.metadata.description}),_jsx(Typography,{children:(C=Ve.spec)===null||C===void 0?void 0:C.type}),_jsxs(Box,{marginTop:"0.5em",children:[(Ve.metadata.tags||[]).slice(0,en).map(vn=>_jsx(Chip,{size:"small",label:vn},vn)),((E=Ve.metadata.tags)===null||E===void 0?void 0:E.length)&&((D=Ve.metadata.tags)===null||D===void 0?void 0:D.length)>en&&_jsx(Tooltip,{title:"Drill into the entity to see all of the tags.",children:_jsx(Chip,{size:"small",label:"..."},"other-tags")})]})]})]}),!Qe&&Ve&&_jsx(CardActions,{children:_jsxs(_Fragment,{children:[isUserEntity(Ve)&&_jsx(UserCardActions,{entity:Ve}),isGroupEntity(Ve)&&_jsx(GroupCardActions,{entity:Ve}),_jsx(EntityCardActions,{entity:Ve})]})})]})})]})},fr=(0,nn.Z)(x=>({searchToolbar:{paddingLeft:0,paddingRight:0},input:{}}),{name:"CatalogReactEntitySearchBar"}),Gn=()=>{var x;const C=fr(),{filters:E,updateFilters:D}=useEntityList();var X;const[re,oe]=useState((X=(x=E.text)===null||x===void 0?void 0:x.value)!==null&&X!==void 0?X:"");return useDebounce(()=>{D({text:re.length?new EntityTextFilter(re):void 0})},250,[re,D]),_jsx(Toolbar,{className:C.searchToolbar,children:_jsx(FormControl,{children:_jsx(Input,{"aria-label":"search",id:"input-with-icon-adornment",className:C.input,placeholder:"Search",autoComplete:"off",onChange:ve=>oe(ve.target.value),value:re,startAdornment:_jsx(InputAdornment,{position:"start",children:_jsx(Search,{})}),endAdornment:_jsx(InputAdornment,{position:"end",children:_jsx(IconButton,{"aria-label":"clear search",onClick:()=>oe(""),edge:"end",disabled:re.length===0,children:_jsx(Clear,{})})})})})})},sn=Object.freeze({createEntityRefColumn(x){const{defaultKind:C}=x;function E(D){var X;return((X=D.metadata)===null||X===void 0?void 0:X.title)||_t(D,{defaultKind:C})}return{title:"Name",highlight:!0,customFilterAndSearch(D,X){return E(X).includes(D)},customSort(D,X){return E(D).localeCompare(E(X))},render:D=>{var X;return(0,u.jsx)(Ct,{entityRef:D,defaultKind:C,title:(X=D.metadata)===null||X===void 0?void 0:X.title})}}},createEntityRelationColumn(x){const{title:C,relation:E,defaultKind:D,filter:X}=x;function re(ve){return(0,K.hF)(ve,E,X)}function oe(ve){return re(ve).map(Ae=>_t(Ae,{defaultKind:D})).join(", ")}return{title:C,customFilterAndSearch(ve,Ae){return oe(Ae).includes(ve)},customSort(ve,Ae){return oe(ve).localeCompare(oe(Ae))},render:ve=>(0,u.jsx)(hn,{entityRefs:re(ve),defaultKind:D})}},createOwnerColumn(){return this.createEntityRelationColumn({title:"Owner",relation:P.S4,defaultKind:"group"})},createDomainColumn(){return this.createEntityRelationColumn({title:"Domain",relation:P.cz,defaultKind:"domain",filter:{kind:"domain"}})},createSystemColumn(){return this.createEntityRelationColumn({title:"System",relation:P.cz,defaultKind:"system",filter:{kind:"system"}})},createMetadataDescriptionColumn(){return{title:"Description",field:"metadata.description",render:x=>(0,u.jsx)(T.Or,{text:x.metadata.description,placement:"bottom-start",line:2})}},createSpecLifecycleColumn(){return{title:"Lifecycle",field:"spec.lifecycle"}},createSpecTypeColumn(){return{title:"Type",field:"spec.type"}}}),ir=[sn.createEntityRefColumn({defaultKind:"system"}),sn.createDomainColumn(),sn.createOwnerColumn(),sn.createMetadataDescriptionColumn()],Vr=[sn.createEntityRefColumn({defaultKind:"component"}),sn.createSystemColumn(),sn.createOwnerColumn(),sn.createSpecTypeColumn(),sn.createSpecLifecycleColumn(),sn.createMetadataDescriptionColumn()],Hr=(0,nn.Z)(x=>({empty:{padding:x.spacing(2),display:"flex",justifyContent:"center"}})),Kn=x=>{const{entities:C,title:E,emptyContent:D,variant:X="gridItem",columns:re}=x,oe=Hr(),ve={minWidth:"0",width:"100%"};return X==="gridItem"&&(ve.height="calc(100% - 10px)"),(0,u.jsx)(T.iA,{columns:re,title:E,style:ve,emptyContent:D&&(0,u.jsx)("div",{className:oe.empty,children:D}),options:{search:!1,paging:!1,actionsColumnIndex:-1,padding:"dense",draggable:!1},data:C})};Kn.columns=sn,Kn.systemEntityColumns=ir,Kn.componentEntityColumns=Vr;const Tr=(0,nn.Z)({input:{}},{name:"CatalogReactEntityTagPicker"}),S=x=>{const C=Tr();return(0,u.jsx)(ce,{label:"Tags",name:"tags",path:"metadata.tags",Filter:Z,showCounts:x.showCounts,InputProps:{className:C.input}})},c=x=>{const{hidden:C,initialFilter:E}=x,D=(0,p.h_)(p.$v),{error:X,availableTypes:re,selectedTypes:oe,setSelectedTypes:ve}=ut();if((0,N.useEffect)(()=>{X&&D.post({message:"Failed to load entity types",severity:"error"}),E&&ve([E])},[X,D,E,ve]),re.length===0||X)return null;const Ae=[{value:"all",label:"all"},...re.map(De=>({value:De,label:De}))];var Oe;return C?null:(0,u.jsx)(L.Z,{pb:1,pt:1,children:(0,u.jsx)(T.Ph,{label:"Type",items:Ae,selected:(Oe=Ae.length>1?oe[0]:void 0)!==null&&Oe!==void 0?Oe:"all",onChange:De=>ve(De==="all"?[]:[String(De)])})})};var b=n(15459),j=n(61837),Y=n(11640),me=n(28347);const we=(0,b.Z)({root:{color:"#f3ba37"}})(Y.Z),Ne=x=>{const{toggleStarredEntity:C,isStarredEntity:E}=Qt(x.entity);return(0,u.jsx)(j.Z,{"aria-label":"favorite",color:"inherit",...x,onClick:()=>C(),children:(0,u.jsx)(Yt.ZP,{title:E?"Remove from favorites":"Add to favorites",children:E?(0,u.jsx)(we,{}):(0,u.jsx)(me.Z,{})})})};var Je=n(8629),Mt=n(79249),xn=n(38724),Yn=n(99152),ar=n(6487),gr=n(49429),bn=n(55999),Br=n(39412);const ro=Br.Z;function mo(x,C){if(x)return x.toLocaleLowerCase("en-US");if(C)try{return(0,P.of)(C).kind.toLocaleLowerCase("en-US")}catch{return}}function xs(x,C){const E=(0,p.qD)(),D=mo(x,C);return D&&E.getSystemIcon(`kind:${D}`)||ro}function $r(x){const{kind:C,entityRef:E,...D}=x,X=xs(C,E);return(0,u.jsx)(X,{...D})}const Do=(0,nn.Z)(x=>({node:{fill:x.palette.grey[300],stroke:x.palette.grey[300],"&.primary":{fill:x.palette.primary.light,stroke:x.palette.primary.light},"&.secondary":{fill:x.palette.secondary.light,stroke:x.palette.secondary.light}},text:{fill:x.palette.getContrastText(x.palette.grey[300]),"&.primary":{fill:x.palette.primary.contrastText},"&.secondary":{fill:x.palette.secondary.contrastText},"&.focused":{fontWeight:"bold"}},clickable:{cursor:"pointer"}}));function bs(x){const C=(0,p.h_)(z),E=(0,P.eE)(x),{loading:D,error:X,value:re}=(0,xt.default)(async()=>{const oe=await C.getEntityAncestors({entityRef:E}),ve=new Array,Ae=new Array;for(const Oe of oe.items){const De=(0,P.eE)(Oe.entity),$e=De===oe.rootEntityRef;ve.push({id:De,root:$e,...Oe.entity});for(const tt of Oe.parentEntityRefs)Ae.push({from:De,to:tt})}return{nodes:ve,edges:Ae}},[E]);return{loading:D,error:X,nodes:(re==null?void 0:re.nodes)||[],edges:(re==null?void 0:re.edges)||[]}}function No({node:x}){const C=Do(),E=(0,Lt.s0)(),D=(0,p.tg)(Fe),[X,re]=(0,N.useState)(0),[oe,ve]=(0,N.useState)(0),Ae=(0,N.useRef)(null);(0,N.useLayoutEffect)(()=>{if(Ae.current){let{height:pt,width:kt}=Ae.current.getBBox();pt=Math.round(pt),kt=Math.round(kt),(pt!==oe||kt!==X)&&(re(kt),ve(pt))}},[X,oe]);const Oe=10,De=oe,$e=De+Oe,tt=$e+X+Oe*2,ht=oe+Oe*2,Qe=x.metadata.title||(x.kind&&x.metadata.name&&x.metadata.namespace?_t({kind:x.kind,name:x.metadata.name,namespace:x.metadata.namespace||""}):x.id),Ve=()=>{E(D({kind:x.kind,namespace:x.metadata.namespace||P.zG,name:x.metadata.name}))};return(0,u.jsxs)("g",{onClick:Ve,className:C.clickable,children:[(0,u.jsx)("rect",{className:Ie()(C.node,x.root?"secondary":"primary"),width:tt,height:ht,rx:10}),(0,u.jsx)($r,{kind:x.kind,y:Oe,x:Oe,width:De,height:De,className:Ie()(C.text,x.root?"secondary":"primary")}),(0,u.jsx)("text",{ref:Ae,className:Ie()(C.text,x.root?"secondary":"primary"),y:ht/2,x:$e+(X+Oe*2)/2,textAnchor:"middle",alignmentBaseline:"middle",children:Qe})]})}function Fo(x){const{loading:C,error:E,nodes:D,edges:X}=bs(x.entity);return C?(0,u.jsx)(T.Ex,{}):E?(0,u.jsx)(T.Gk,{error:E}):(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)(bn.Z,{variant:"h2",children:"Ancestry"}),(0,u.jsxs)(bn.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,u.jsx)(T.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,u.jsx)(L.Z,{mt:4,children:(0,u.jsx)(T.mn,{nodes:D,edges:X,renderNode:No,direction:T.NX.Direction.BOTTOM_TOP,zoom:"enable-on-click"})})]})}var mr=n(11776),qn=n(38402),Dr=n(86136),Gr=n(99688),vo=n(49378),yo=n(54506),Rr=n(94339),Zo=n(24579),xo=n(27685);const Ln=(0,nn.Z)(x=>({root:{display:"flex",flexDirection:"column"},marginTop:{marginTop:x.spacing(2)},helpIcon:{marginLeft:x.spacing(1),color:x.palette.text.disabled},monospace:{fontFamily:"monospace"}}));function _n(x){const C=Ln();return(0,u.jsx)(vo.Z,{...x,primaryTypographyProps:{className:C.monospace},secondaryTypographyProps:{className:C.monospace}})}function Nr(x){const C=Ln();return(0,u.jsx)(yo.Z,{className:C.monospace,children:x.children})}function Fr(x){return(0,u.jsx)(L.Z,{mt:2,children:(0,u.jsx)(Rr.Z,{variant:"outlined",children:(0,u.jsxs)(Zo.Z,{children:[(0,u.jsxs)(A.Z,{variant:"h6",gutterBottom:!0,children:[x.title,x.helpLink&&(0,u.jsx)(bo,{to:x.helpLink})]}),x.children]})})})}function Uo(x){if(x.match(/^url:https?:\/\//))return x.slice(4);if(x.match(/^https?:\/\//))return x}function lr(x){const[C,E]=x.entry,D=Uo(E);return(0,u.jsxs)(qn.Z,{children:[x.indent&&(0,u.jsx)(Dr.Z,{}),(0,u.jsx)(_n,{primary:C,secondary:D?(0,u.jsx)(T.rU,{to:D,children:E}):E})]})}function bo(x){const C=Ln();return(0,u.jsx)(T.rU,{to:x.to,className:C.helpIcon,children:(0,u.jsx)(xo.Z,{fontSize:"inherit"})})}const So=(0,nn.Z)({root:{display:"flex",flexDirection:"column"}});function Co(x){var C,E;const D=(0,p.h_)(z),X=(0,P.eE)(x),re=(C=x.metadata.annotations)===null||C===void 0?void 0:C[P.P1],oe=(E=x.metadata.annotations)===null||E===void 0?void 0:E[P.q1],{loading:ve,error:Ae,value:Oe}=(0,xt.default)(async()=>!re&&!oe?[]:(await D.getEntities({filter:[...re?[{[`metadata.annotations.${P.P1}`]:re}]:[],...oe?[{[`metadata.annotations.${P.q1}`]:oe}]:[]]})).items,[re,oe]);return{loading:ve,error:Ae,location:re,originLocation:oe,colocatedEntities:Oe==null?void 0:Oe.filter(De=>(0,P.eE)(De)!==X)}}function Ir(x){return(0,u.jsxs)(mr.Z,{dense:!0,children:[x.header&&(0,u.jsx)(lr,{entry:x.header},"header"),x.entities.map(C=>(0,u.jsxs)(qn.Z,{children:[(0,u.jsx)(Dr.Z,{children:(0,u.jsx)($r,{kind:C.kind})}),(0,u.jsx)(_n,{primary:(0,u.jsx)(Ct,{entityRef:C})})]},(0,P.eE)(C)))]})}function wo(x){const{entity:C}=x,{loading:E,error:D,location:X,originLocation:re,colocatedEntities:oe}=Co(C);if(E)return(0,u.jsx)(T.Ex,{});if(D)return(0,u.jsx)(T.Gk,{error:D});if(!X&&!re)return(0,u.jsx)(Gr.Z,{severity:"warning",children:"Entity had no location information."});if(!(oe!=null&&oe.length))return(0,u.jsx)(Gr.Z,{severity:"info",children:"There were no other entities on this location."});if(X===re)return(0,u.jsx)(Ir,{entities:oe});const ve=oe.filter(Oe=>{var De;return((De=Oe.metadata.annotations)===null||De===void 0?void 0:De[P.P1])===X}),Ae=oe.filter(Oe=>{var De;return((De=Oe.metadata.annotations)===null||De===void 0?void 0:De[P.q1])===re});return(0,u.jsxs)(u.Fragment,{children:[ve.length>0&&(0,u.jsx)(Ir,{entities:ve,header:["At the same location",X]}),Ae.length>0&&(0,u.jsx)(Ir,{entities:Ae,header:["At the same origin",re]})]})}function Mo(x){const C=So();return(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)(bn.Z,{variant:"h2",children:"Colocated"}),(0,u.jsx)(bn.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,u.jsx)("div",{className:C.root,children:(0,u.jsx)(wo,{entity:x.entity})})]})}function oo(x){return Object.fromEntries([...Object.entries(x)].sort((C,E)=>C[0]<E[0]?-1:1))}function jo(x){return(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)(bn.Z,{variant:"h2",children:"Entity as JSON"}),(0,u.jsx)(bn.Z,{children:"This is the raw entity data as received from the catalog, on JSON form."}),(0,u.jsx)(bn.Z,{children:(0,u.jsx)("div",{style:{fontSize:"75%"},"data-testid":"code-snippet",children:(0,u.jsx)(T.Oi,{text:JSON.stringify(oo(x.entity),void 0,2),language:"json",showCopyCodeButton:!0})})})]})}var Ss=n(3440),Eo=n.n(Ss);const er=(0,nn.Z)({root:{display:"flex",flexDirection:"column"}});function ti(x){var C,E;const D=er(),{apiVersion:X,kind:re,metadata:oe,spec:ve,relations:Ae=[],status:Oe={}}=x.entity,De=Eo()(ct()(Ae,$e=>$e.targetRef),"type");return(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)(bn.Z,{variant:"h2",children:"Overview"}),(0,u.jsxs)("div",{className:D.root,children:[(0,u.jsx)(Fr,{title:"Identity",children:(0,u.jsxs)(mr.Z,{dense:!0,children:[(0,u.jsx)(qn.Z,{children:(0,u.jsx)(_n,{primary:"apiVersion",secondary:X})}),(0,u.jsx)(qn.Z,{children:(0,u.jsx)(_n,{primary:"kind",secondary:re})}),(ve==null?void 0:ve.type)&&(0,u.jsx)(qn.Z,{children:(0,u.jsx)(_n,{primary:"spec.type",secondary:ve.type})}),oe.uid&&(0,u.jsx)(qn.Z,{children:(0,u.jsx)(_n,{primary:"uid",secondary:oe.uid})}),oe.etag&&(0,u.jsx)(qn.Z,{children:(0,u.jsx)(_n,{primary:"etag",secondary:oe.etag})})]})}),(0,u.jsxs)(Fr,{title:"Metadata",children:[!!Object.keys(oe.annotations||{}).length&&(0,u.jsx)(mr.Z,{dense:!0,subheader:(0,u.jsxs)(Nr,{children:["Annotations",(0,u.jsx)(bo,{to:"https://backstage.io/docs/features/software-catalog/well-known-annotations"})]}),children:Object.entries(oe.annotations).map($e=>(0,u.jsx)(lr,{indent:!0,entry:$e},$e[0]))}),!!Object.keys(oe.labels||{}).length&&(0,u.jsx)(mr.Z,{dense:!0,subheader:(0,u.jsx)(Nr,{children:"Labels"}),children:Object.entries(oe.labels).map($e=>(0,u.jsx)(lr,{indent:!0,entry:$e},$e[0]))}),!!(!((C=oe.tags)===null||C===void 0)&&C.length)&&(0,u.jsx)(mr.Z,{dense:!0,subheader:(0,u.jsx)(Nr,{children:"Tags"}),children:oe.tags.map(($e,tt)=>(0,u.jsxs)(qn.Z,{children:[(0,u.jsx)(Dr.Z,{}),(0,u.jsx)(_n,{primary:$e})]},`${$e}-${tt}`))})]}),!!Ae.length&&(0,u.jsx)(Fr,{title:"Relations",helpLink:"https://backstage.io/docs/features/software-catalog/well-known-relations",children:Object.entries(De).map(([$e,tt],ht)=>(0,u.jsx)("div",{children:(0,u.jsx)(mr.Z,{dense:!0,subheader:(0,u.jsx)(Nr,{children:$e}),children:tt.map(Qe=>(0,u.jsxs)(qn.Z,{children:[(0,u.jsx)(Dr.Z,{children:(0,u.jsx)($r,{entityRef:Qe.targetRef})}),(0,u.jsx)(_n,{primary:(0,u.jsx)(Ct,{entityRef:Qe.targetRef})})]},Qe.targetRef))})},ht))}),!!(!((E=Oe.items)===null||E===void 0)&&E.length)&&(0,u.jsx)(Fr,{title:"Status",helpLink:"https://backstage.io/docs/features/software-catalog/well-known-statuses",children:Oe.items.map(($e,tt)=>(0,u.jsxs)("div",{children:[(0,u.jsxs)(A.Z,{children:[$e.level,": ",$e.type]}),(0,u.jsx)(L.Z,{ml:2,children:$e.message})]},tt))})]})]})}var zo=n(72847);function Cs(x){return(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)(bn.Z,{variant:"h2",children:"Entity as YAML"}),(0,u.jsx)(bn.Z,{children:"This is the raw entity data as received from the catalog, on YAML form."}),(0,u.jsx)(bn.Z,{children:(0,u.jsx)("div",{style:{fontSize:"75%"},"data-testid":"code-snippet",children:(0,u.jsx)(T.Oi,{text:zo.ZP.stringify(oo(x.entity)),language:"yaml",showCopyCodeButton:!0})})})]})}const so=(0,nn.Z)(x=>({fullHeightDialog:{height:"calc(100% - 64px)"},root:{display:"flex",flexGrow:1,width:"100%",backgroundColor:x.palette.background.paper},tabs:{borderRight:`1px solid ${x.palette.divider}`,flexShrink:0},tabContents:{flexGrow:1,overflowX:"auto"}}));function Kr(x){const{children:C,value:E,index:D,...X}=x,re=so();return(0,u.jsx)("div",{role:"tabpanel",hidden:E!==D,id:`vertical-tabpanel-${D}`,"aria-labelledby":`vertical-tab-${D}`,className:re.tabContents,...X,children:E===D&&(0,u.jsx)(L.Z,{pl:3,pr:3,children:C})})}function Yr(x){return{id:`vertical-tab-${x}`,"aria-controls":`vertical-tabpanel-${x}`}}function Jr(x){const C=so(),[E,D]=N.useState(0);return(0,N.useEffect)(()=>{D(0)},[x.open]),x.entity?(0,u.jsxs)(Je.Z,{fullWidth:!0,maxWidth:"xl",open:x.open,onClose:x.onClose,"aria-labelledby":"entity-inspector-dialog-title",PaperProps:{className:C.fullHeightDialog},children:[(0,u.jsx)(Mt.Z,{id:"entity-inspector-dialog-title",children:"Entity Inspector"}),(0,u.jsx)(xn.Z,{dividers:!0,children:(0,u.jsxs)("div",{className:C.root,children:[(0,u.jsxs)(Yn.Z,{orientation:"vertical",variant:"scrollable",value:E,onChange:(X,re)=>D(re),"aria-label":"Inspector options",className:C.tabs,children:[(0,u.jsx)(ar.Z,{label:"Overview",...Yr(0)}),(0,u.jsx)(ar.Z,{label:"Ancestry",...Yr(1)}),(0,u.jsx)(ar.Z,{label:"Colocated",...Yr(2)}),(0,u.jsx)(ar.Z,{label:"Raw JSON",...Yr(3)}),(0,u.jsx)(ar.Z,{label:"Raw YAML",...Yr(4)})]}),(0,u.jsx)(Kr,{value:E,index:0,children:(0,u.jsx)(ti,{entity:x.entity})}),(0,u.jsx)(Kr,{value:E,index:1,children:(0,u.jsx)(Fo,{entity:x.entity})}),(0,u.jsx)(Kr,{value:E,index:2,children:(0,u.jsx)(Mo,{entity:x.entity})}),(0,u.jsx)(Kr,{value:E,index:3,children:(0,u.jsx)(jo,{entity:x.entity})}),(0,u.jsx)(Kr,{value:E,index:4,children:(0,u.jsx)(Cs,{entity:x.entity})})]})}),(0,u.jsx)(gr.Z,{children:(0,u.jsx)(V.Z,{onClick:x.onClose,color:"primary",children:"Close"})})]}):null}var vr=n(85256);function Jn(x){var C;const E=(0,p.h_)(z),D=(C=x.metadata.annotations)===null||C===void 0?void 0:C[P.q1],X=x.metadata.uid,re=D==="bootstrap:bootstrap",oe=(0,xt.default)(async()=>{const Qe=E.getLocationByRef(D);let Ve;if(!D)Ve=Promise.resolve([]);else{const pt=`metadata.annotations.${P.q1}`;Ve=E.getEntities({filter:{[pt]:D},fields:["kind","metadata.uid","metadata.name","metadata.namespace"]}).then(kt=>kt.items)}return Promise.all([Qe,Ve]).then(([pt,kt])=>({location:pt,colocatedEntities:kt}))},[E,x]),ve=(0,N.useCallback)(async function(){const{location:Ve}=oe.value;await E.removeLocationById(Ve.id)},[E,oe]),Ae=(0,N.useCallback)(async function(){await E.removeEntityByUid(X)},[E,X]);if(re)return{type:"bootstrap",location:D,deleteEntity:Ae};const{loading:Oe,error:De,value:$e}=oe;if(Oe)return{type:"loading"};if(De)return{type:"error",error:De};const{location:tt,colocatedEntities:ht}=$e;return tt?{type:"unregister",location:D,colocatedEntities:ht.map(P.iB),unregisterLocation:ve,deleteEntity:Ae}:{type:"only-delete",deleteEntity:Ae}}var io=n(23054);const Wo=(0,nn.Z)({advancedButton:{fontSize:"0.7em"},dialogActions:{display:"inline-block"}}),ws=({entity:x,onConfirm:C,onClose:E})=>{const D=(0,p.h_)(p.$v),X=(0,p.h_)(p.Ds),re=Wo(),oe=Jn(x),[ve,Ae]=(0,N.useState)(!1),[Oe,De]=(0,N.useState)(!1);var $e;const tt=($e=X.getOptionalString("app.title"))!==null&&$e!==void 0?$e:"Backstage",ht=(0,N.useCallback)(async function(){if("unregisterLocation"in oe){De(!0);try{await oe.unregisterLocation(),C()}catch(kt){(0,io.BD)(kt),D.post({message:kt.message})}finally{De(!1)}}},[D,C,oe]),Qe=(0,N.useCallback)(async function(){if("deleteEntity"in oe){De(!0);try{await oe.deleteEntity(),C()}catch(kt){(0,io.BD)(kt),D.post({message:kt.message})}finally{De(!1)}}},[D,C,oe]),Ve=()=>(0,u.jsx)(gr.Z,{className:re.dialogActions,children:(0,u.jsx)(V.Z,{onClick:E,color:"primary",children:"Cancel"})});return oe.type==="loading"?(0,u.jsx)(T.Ex,{}):oe.type==="error"?(0,u.jsx)(T.Gk,{error:oe.error}):oe.type==="bootstrap"?(0,u.jsxs)(u.Fragment,{children:[(0,u.jsxs)(Gr.Z,{severity:"info",children:['You cannot unregister this entity, since it originates from a protected Backstage configuration (location "',oe.location,'"). If you believe this is in error, please contact the ',tt," ","integrator."]}),(0,u.jsxs)(L.Z,{marginTop:2,children:[!ve&&(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)(V.Z,{variant:"text",size:"small",color:"primary",className:re.advancedButton,onClick:()=>Ae(!0),children:"Advanced Options"}),(0,u.jsx)(Ve,{})]}),ve&&(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)(bn.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,u.jsx)(V.Z,{variant:"contained",color:"secondary",disabled:Oe,onClick:Qe,children:"Delete Entity"}),(0,u.jsx)(Ve,{})]})]})]}):oe.type==="only-delete"?(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)(bn.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,u.jsx)(V.Z,{variant:"contained",color:"secondary",disabled:Oe,onClick:Qe,children:"Delete Entity"}),(0,u.jsx)(Ve,{})]}):oe.type==="unregister"?(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)(bn.Z,{children:"This action will unregister the following entities:"}),(0,u.jsx)(bn.Z,{component:"ul",children:oe.colocatedEntities.map(pt=>(0,u.jsx)("li",{children:(0,u.jsx)(Ct,{entityRef:pt})},`${pt.kind}:${pt.namespace}/${pt.name}`))}),(0,u.jsx)(bn.Z,{children:"Located at the following location:"}),(0,u.jsx)(bn.Z,{component:"ul",children:(0,u.jsx)("li",{children:oe.location})}),(0,u.jsxs)(bn.Z,{children:["To undo, just re-register the entity in ",tt,"."]}),(0,u.jsxs)(L.Z,{marginTop:2,children:[(0,u.jsx)(V.Z,{variant:"contained",color:"secondary",disabled:Oe,onClick:ht,children:"Unregister Location"}),!ve&&(0,u.jsx)(L.Z,{component:"span",marginLeft:2,children:(0,u.jsx)(V.Z,{variant:"text",size:"small",color:"primary",className:re.advancedButton,onClick:()=>Ae(!0),children:"Advanced Options"})})]}),ve&&(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)(L.Z,{paddingTop:4,paddingBottom:4,children:(0,u.jsx)(vr.Z,{})}),(0,u.jsx)(bn.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,u.jsx)(V.Z,{variant:"contained",color:"secondary",disabled:Oe,onClick:Qe,children:"Delete Entity"})]})]}):(0,u.jsx)(Gr.Z,{severity:"error",children:"Internal error: Unknown state"})},Qr=x=>{const{open:C,onConfirm:E,onClose:D,entity:X}=x;return(0,u.jsxs)(Je.Z,{open:C,onClose:D,children:[(0,u.jsx)(Mt.Z,{id:"responsive-dialog-title",children:"Are you sure you want to unregister this entity?"}),(0,u.jsx)(xn.Z,{children:(0,u.jsx)(ws,{entity:X,onConfirm:E,onClose:D})})]})};var Vo=n(12231),js=n(9520),Ho=n(47603);const Go=(0,nn.Z)(x=>({root:{backgroundColor:"rgba(0, 0, 0, .11)",boxShadow:"none",margin:x.spacing(1,0,1,0)},title:{margin:x.spacing(1,0,0,1),textTransform:"uppercase",fontSize:12,fontWeight:"bold"},listIcon:{minWidth:30,color:x.palette.text.primary},menuItem:{minHeight:x.spacing(6)},groupWrapper:{margin:x.spacing(1,1,2,1)}}),{name:"CatalogReactUserListPicker"});function ao(x){return[{name:"Personal",items:[{id:"owned",label:"Owned",icon:Ho.Z},{id:"starred",label:"Starred",icon:Y.Z}]},{name:x!=null?x:"Company",items:[{id:"all",label:"All"}]}]}const Ao=x=>{const{initialFilter:C,availableFilters:E}=x,D=Go(),X=(0,p.h_)(p.Ds);var re;const oe=(re=X.getOptionalString("organization.name"))!==null&&re!==void 0?re:"Company",{filters:ve,updateFilters:Ae,backendEntities:Oe,queryParameters:{kind:De,user:$e},loading:tt}=gt(),ht=["starred","all"],Qe=ao(oe).map(Nn=>({...Nn,items:Nn.items.filter(({id:Un})=>["group","user"].some(xr=>xr===De)?ht.includes(Un):!E||E.includes(Un))})).filter(({items:Nn})=>!!Nn.length),{isStarredEntity:Ve}=Ht(),{isOwnedEntity:pt,loading:kt}=Cn(),vn=tt||kt,Tt=(0,N.useMemo)(()=>new bt("owned",pt,Ve),[pt,Ve]),Jt=(0,N.useMemo)(()=>new bt("starred",pt,Ve),[pt,Ve]),Bt=(0,N.useMemo)(()=>[$e].flat()[0],[$e]),[on,kn]=(0,N.useState)(Bt!=null?Bt:C),Pr=(0,N.useMemo)(()=>Oe.filter((0,K.Gz)((0,lt.compact)(Object.values({...ve,user:void 0})))),[ve,Oe]),yr=(0,N.useMemo)(()=>({all:Pr.length,starred:Pr.filter(Nn=>Jt.filterEntity(Nn)).length,owned:Pr.filter(Nn=>Tt.filterEntity(Nn)).length}),[Pr,Jt,Tt]);(0,N.useEffect)(()=>{Bt&&kn(Bt)},[Bt]),(0,N.useEffect)(()=>{!vn&&on&&on!=="all"&&yr[on]===0&&kn("all")},[vn,yr,on,kn]),(0,N.useEffect)(()=>{Ae({user:on?new bt(on,pt,Ve):void 0})},[on,pt,Ve,Ae]);var Zr;return(0,u.jsx)(Rr.Z,{className:D.root,children:Qe.map(Nn=>(0,u.jsxs)(N.Fragment,{children:[(0,u.jsx)(A.Z,{variant:"subtitle2",component:"span",className:D.title,children:Nn.name}),(0,u.jsx)(Rr.Z,{className:D.groupWrapper,children:(0,u.jsx)(mr.Z,{disablePadding:!0,dense:!0,role:"menu","aria-label":Nn.name,children:Nn.items.map(Un=>{var xr;return(0,u.jsxs)(Vo.Z,{role:"none presentation",button:!0,divider:!0,onClick:()=>kn(Un.id),selected:Un.id===((xr=ve.user)===null||xr===void 0?void 0:xr.value),className:D.menuItem,disabled:yr[Un.id]===0,"data-testid":`user-picker-${Un.id}`,tabIndex:0,ContainerProps:{role:"menuitem"},children:[Un.icon&&(0,u.jsx)(Dr.Z,{className:D.listIcon,children:(0,u.jsx)(Un.icon,{fontSize:"small"})}),(0,u.jsx)(vo.Z,{children:(0,u.jsxs)(A.Z,{variant:"body1",children:[Un.label," "]})}),(0,u.jsx)(js.Z,{children:(Zr=yr[Un.id])!==null&&Zr!==void 0?Zr:"-"})]},Un.id)})})})]},Nn.name))})},lo=(0,nn.Z)({input:{}},{name:"CatalogReactEntityProcessingStatusPickerPicker"}),Es=(0,u.jsx)(wn.Z,{fontSize:"small"}),ni=(0,u.jsx)(Pn.Z,{fontSize:"small"}),Ko=()=>{const x=lo(),{updateFilters:C}=gt(),[E,D]=(0,N.useState)([]);function X(ve){C({orphan:ve?new Zt(ve):void 0})}function re(ve){C({error:ve?new Dt(ve):void 0})}const oe=["Is Orphan","Has Error"];return(0,u.jsx)(L.Z,{pb:1,pt:1,children:(0,u.jsxs)(A.Z,{variant:"button",component:"label",children:["Processing Status",(0,u.jsx)(rt.ZP,{multiple:!0,disableCloseOnSelect:!0,options:oe,value:E,onChange:(ve,Ae)=>{D(Ae),X(Ae.includes("Is Orphan")),re(Ae.includes("Has Error"))},renderOption:(ve,{selected:Ae})=>(0,u.jsx)(un.Z,{control:(0,u.jsx)(Dn.Z,{icon:Es,checkedIcon:ni,checked:Ae}),onClick:Oe=>Oe.preventDefault(),label:ve}),size:"small",popupIcon:(0,u.jsx)(Gt.Z,{"data-testid":"processing-status-picker-expand"}),renderInput:ve=>(0,u.jsx)(Se.Z,{...ve,className:x.input,variant:"outlined"})})]})})},Yo=(0,nn.Z)({input:{}},{name:"CatalogReactEntityNamespacePicker"}),rn=()=>{const x=Yo();return(0,u.jsx)(ce,{label:"Namespace",name:"namespace",path:"metadata.namespace",Filter:zt,InputProps:{className:x.input}})};function As(x){const{children:C,value:E}=x;var D;const[X,re]=useState((D=E==null?void 0:E.filters)!==null&&D!==void 0?D:{}),oe=useCallback(Qe=>{re(Ve=>{const pt=typeof Qe=="function"?Qe(Ve):Qe;return{...Ve,...pt}})},[]),ve=useMemo(()=>({entities:[],backendEntities:[],queryParameters:{}}),[]);var Ae,Oe,De,$e,tt;const ht=useMemo(()=>({entities:(Ae=E==null?void 0:E.entities)!==null&&Ae!==void 0?Ae:ve.entities,backendEntities:(Oe=E==null?void 0:E.backendEntities)!==null&&Oe!==void 0?Oe:ve.backendEntities,updateFilters:(De=E==null?void 0:E.updateFilters)!==null&&De!==void 0?De:oe,filters:X,loading:($e=E==null?void 0:E.loading)!==null&&$e!==void 0?$e:!1,queryParameters:(tt=E==null?void 0:E.queryParameters)!==null&&tt!==void 0?tt:ve.queryParameters,error:E==null?void 0:E.error}),[E,ve,X,oe]);return _jsx(EntityListContext.Provider,{value:ht,children:C})}},75435:function(wt,ke,n){"use strict";n.d(ke,{h:function(){return p}});var r=n(25271);function p(z,f,W){var g;let u=(z==null||(g=z.relations)===null||g===void 0?void 0:g.filter(N=>N.type===f).map(N=>(0,r.of)(N.targetRef)))||[];return W!=null&&W.kind&&(u=u.filter(N=>N.kind.toLocaleLowerCase("en-US")===W.kind.toLocaleLowerCase("en-US"))),u}},49280:function(wt,ke,n){"use strict";n.d(ke,{hF:function(){return z.h},CV:function(){return W},wq:function(){return r},Gz:function(){return p}});function r(u){return u.reduce((N,ge)=>({...N,...ge.getCatalogFilters?ge.getCatalogFilters():{}}),{})}function p(u){return N=>u.every(ge=>!ge.filterEntity||ge.filterEntity(N))}var z=n(75435),f=n(25271);function W(u,N){var ge;const ue=(ge=u.metadata.annotations)===null||ge===void 0?void 0:ge[f.M6];if(ue)try{const V=(0,f.Ou)(ue),ne=N.byUrl(V.target);return{locationTargetUrl:V.target,integrationType:ne==null?void 0:ne.type}}catch{return}}function g(u,N){const ge=new Set([...getEntityRelations(u,RELATION_MEMBER_OF,{kind:"group"}),...u?[getCompoundEntityRef(u)]:[]].map(stringifyEntityRef)),ue=getEntityRelations(N,RELATION_OWNED_BY).map(stringifyEntityRef);for(const V of ue)if(ge.has(V))return!0;return!1}},8799:function(wt,ke,n){"use strict";n.r(ke),n.d(ke,{AboutCard:function(){return Dt},AboutContent:function(){return bt},AboutField:function(){return Xe}});var r=n(52322),p=n(25271),z=n(53974),f=n(60871),W=n(32838),g=n(39709),u=JSON.parse('{"$schema":"http://json-schema.org/draft-07/schema","$id":"TemplateV1beta3","description":"A Template describes a scaffolding task for use with the Scaffolder. It describes the required parameters as well as a series of steps that will be taken to execute the scaffolding task.","examples":[{"apiVersion":"scaffolder.backstage.io/v1beta3","kind":"Template","metadata":{"name":"react-ssr-template","title":"React SSR Template","description":"Next.js application skeleton for creating isomorphic web applications.","tags":["recommended","react"]},"spec":{"owner":"artist-relations-team","parameters":{"required":["name","description","repoUrl"],"backstage:permissions":{"tags":["one","two"]},"properties":{"name":{"title":"Name","type":"string","description":"Unique name of the component"},"description":{"title":"Description","type":"string","description":"Description of the component"},"repoUrl":{"title":"Pick a repository","type":"string","ui:field":"RepoUrlPicker"}}},"steps":[{"id":"fetch","name":"Fetch","action":"fetch:plain","parameters":{"url":"./template"},"backstage:permissions":{"tags":["one","two"]}},{"id":"publish","name":"Publish to GitHub","action":"publish:github","parameters":{"repoUrl":"${{ parameters.repoUrl }}"},"if":"${{ parameters.repoUrl }}"}],"output":{"catalogInfoUrl":"${{ steps.publish.output.catalogInfoUrl }}"}}}],"allOf":[{"$ref":"Entity"},{"type":"object","required":["spec"],"properties":{"apiVersion":{"enum":["scaffolder.backstage.io/v1beta3"]},"kind":{"enum":["Template"]},"spec":{"type":"object","required":["type","steps"],"properties":{"type":{"type":"string","description":"The type of component created by the template. The software catalog accepts any type value, but an organization should take great care to establish a proper taxonomy for these. Tools including Backstage itself may read this field and behave differently depending on its value. For example, a website type component may present tooling in the Backstage interface that is specific to just websites.","examples":["service","website","library"],"minLength":1},"owner":{"type":"string","description":"The user (or group) owner of the template","minLength":1},"parameters":{"oneOf":[{"type":"object","description":"The JSONSchema describing the inputs for the template.","properties":{"backstage:permissions":{"type":"object","description":"Object used for authorizing the parameter","properties":{"tags":{"type":"array","items":{"type":"string"}}}}}},{"type":"array","description":"A list of separate forms to collect parameters.","items":{"type":"object","description":"The JSONSchema describing the inputs for the template.","properties":{"backstage:permissions":{"type":"object","description":"Object used for authorizing the parameter","properties":{"tags":{"type":"array","items":{"type":"string"}}}}}}}]},"steps":{"type":"array","description":"A list of steps to execute.","items":{"type":"object","description":"A description of the step to execute.","required":["action"],"properties":{"id":{"type":"string","description":"The ID of the step, which can be used to refer to its outputs."},"name":{"type":"string","description":"The name of the step, which will be displayed in the UI during the scaffolding process."},"action":{"type":"string","description":"The name of the action to execute."},"input":{"type":"object","description":"A templated object describing the inputs to the action."},"if":{"type":["string","boolean"],"description":"A templated condition that skips the step when evaluated to false. If the condition is true or not defined, the step is executed. The condition is true, if the input is not `false`, `undefined`, `null`, `\\"\\"`, `0`, or `[]`."},"backstage:permissions":{"type":"object","description":"Object used for authorizing the step","properties":{"tags":{"type":"array","items":{"type":"string"}}}}}}},"output":{"type":"object","description":"A templated object describing the outputs of the scaffolding task.","properties":{"links":{"type":"array","description":"A list of external hyperlinks, typically pointing to resources created or updated by the template","items":{"type":"object","required":[],"properties":{"url":{"type":"string","description":"A url in a standard uri format.","examples":["https://github.com/my-org/my-new-repo"],"minLength":1},"entityRef":{"type":"string","description":"An entity reference to an entity in the catalog.","examples":["Component:default/my-app"],"minLength":1},"title":{"type":"string","description":"A user friendly display name for the link.","examples":["View new repo"],"minLength":1},"icon":{"type":"string","description":"A key representing a visual icon to be displayed in the UI.","examples":["dashboard"],"minLength":1}}}},"text":{"type":"array","description":"A list of Markdown text blobs, like output data from the template.","items":{"type":"object","required":[],"properties":{"title":{"type":"string","description":"A user friendly display name for the text.","examples":["Output Content"],"minLength":1},"icon":{"type":"string","description":"A key representing a visual icon to be displayed in the UI.","examples":["dashboard"],"minLength":1},"content":{"type":"string","description":"The text blob to display in the UI, rendered as Markdown.","examples":["**hey** _I\'m_ Markdown"]}}}}},"additionalProperties":{"type":"string"}}}}}}]}');const N=(0,p.wI)(u),ge={async check(_e){return N(_e)===_e}},ue=_e=>_e.apiVersion==="scaffolder.backstage.io/v1beta3"&&_e.kind==="Template";var V=n(79692),ne=n(94339),L=n(32552),A=n(61837),le=n(85256),se=n(24579),ae=n(88188),_=n(52866),H=n(30254),T=n(27604),R=n(2784),P=n(19625),K=n(60905),je=n(7089),Le=n(90436);const Z=(0,V.Z)(_e=>({value:{fontWeight:"bold",overflow:"hidden",lineHeight:"24px",wordBreak:"break-word"},label:{color:_e.palette.text.secondary,textTransform:"uppercase",fontSize:"10px",fontWeight:"bold",letterSpacing:.5,overflow:"hidden",whiteSpace:"nowrap"}}));function Xe(_e){const{label:lt,value:yt,gridSizes:qe,children:Lt}=_e,Vt=Z(),be=(0,f.vJ)(Lt,Ke=>Ke.getElements()),Ce=be.length>0?be:(0,r.jsx)(Le.Z,{variant:"body2",className:Vt.value,children:yt||"unknown"});return(0,r.jsxs)(K.Z,{item:!0,...qe,children:[(0,r.jsx)(Le.Z,{variant:"h2",className:Vt.label,children:lt}),Ce]})}var at=n(24851);const Rt=(0,V.Z)({description:{wordBreak:"break-word"}});function zt(_e,lt,yt){if(lt==="url"||_e.includes("://"))return _e;const qe=yt.type==="file"?`file://${yt.target}`:yt.target;return lt==="file"||yt.type==="file"?new URL(_e,qe).href:qe}function bt(_e){var lt,yt,qe,Lt,Vt,be,Ce,Ke;const{entity:Be}=_e,gt=Rt(),xt=Be.kind.toLocaleLowerCase("en-US")==="system",nt=Be.kind.toLocaleLowerCase("en-US")==="resource",Ye=Be.kind.toLocaleLowerCase("en-US")==="component",Ge=Be.kind.toLocaleLowerCase("en-US")==="api",ct=Be.kind.toLocaleLowerCase("en-US")==="template",ut=Be.kind.toLocaleLowerCase("en-US")==="location",ln=Be.kind.toLocaleLowerCase("en-US")==="group",cn=(0,g.hF)(Be,p.cz,{kind:"system"}),dn=(0,g.hF)(Be,p.cz,{kind:"component"}),Ht=(0,g.hF)(Be,p.cz,{kind:"domain"}),Sn=(0,g.hF)(Be,p.S4);let Qt;try{Qt=(0,p.CV)(Be)}catch{Qt=void 0}return(0,r.jsxs)(K.Z,{container:!0,children:[(0,r.jsx)(Xe,{label:"Description",gridSizes:{xs:12},children:(0,r.jsx)(z.SA,{className:gt.description,content:(Be==null||(lt=Be.metadata)===null||lt===void 0?void 0:lt.description)||"No description"})}),(0,r.jsx)(Xe,{label:"Owner",value:"No Owner",gridSizes:{xs:12,sm:6,lg:4},children:Sn.length>0&&(0,r.jsx)(g.rI,{entityRefs:Sn,defaultKind:"group"})}),(xt||Ht.length>0)&&(0,r.jsx)(Xe,{label:"Domain",value:"No Domain",gridSizes:{xs:12,sm:6,lg:4},children:Ht.length>0&&(0,r.jsx)(g.rI,{entityRefs:Ht,defaultKind:"domain"})}),(Ge||Ye||nt||cn.length>0)&&(0,r.jsx)(Xe,{label:"System",value:"No System",gridSizes:{xs:12,sm:6,lg:4},children:cn.length>0&&(0,r.jsx)(g.rI,{entityRefs:cn,defaultKind:"system"})}),Ye&&dn.length>0&&(0,r.jsx)(Xe,{label:"Parent Component",value:"No Parent Component",gridSizes:{xs:12,sm:6,lg:4},children:(0,r.jsx)(g.rI,{entityRefs:dn,defaultKind:"component"})}),(Ge||Ye||nt||ct||ln||ut||typeof(Be==null||(yt=Be.spec)===null||yt===void 0?void 0:yt.type)=="string")&&(0,r.jsx)(Xe,{label:"Type",value:Be==null||(qe=Be.spec)===null||qe===void 0?void 0:qe.type,gridSizes:{xs:12,sm:6,lg:4}}),(Ge||Ye||typeof(Be==null||(Lt=Be.spec)===null||Lt===void 0?void 0:Lt.lifecycle)=="string")&&(0,r.jsx)(Xe,{label:"Lifecycle",value:Be==null||(Vt=Be.spec)===null||Vt===void 0?void 0:Vt.lifecycle,gridSizes:{xs:12,sm:6,lg:4}}),(0,r.jsx)(Xe,{label:"Tags",value:"No Tags",gridSizes:{xs:12,sm:6,lg:4},children:((Be==null||(be=Be.metadata)===null||be===void 0?void 0:be.tags)||[]).map(Xt=>(0,r.jsx)(je.Z,{size:"small",label:Xt},Xt))}),ut&&((Be==null||(Ce=Be.spec)===null||Ce===void 0?void 0:Ce.targets)||(Be==null||(Ke=Be.spec)===null||Ke===void 0?void 0:Ke.target))&&(0,r.jsx)(Xe,{label:"Targets",gridSizes:{xs:12},children:(0,r.jsx)(at.s,{cols:1,items:(Be.spec.targets||[Be.spec.target]).map(Xt=>Xt).map(Xt=>{var Cn;return{text:Xt,href:zt(Xt,(Be==null||(Cn=Be.spec)===null||Cn===void 0?void 0:Cn.type)||"unknown",Qt)}})})})]})}const Zt=(0,V.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 Dt(_e){var lt,yt,qe;const{variant:Lt}=_e,Vt=(0,f.qD)(),be=Zt(),{entity:Ce}=(0,g.X2)(),Ke=(0,f.h_)(W.q3),Be=(0,f.h_)(g.Ah),gt=(0,f.h_)(f.$v),xt=(0,f.h_)(f.VE),nt=(0,f.tg)(P.jU),Ye=(0,f.tg)(P.ql),Ge=(0,g.CV)(Ce,Ke),ct=(lt=Ce.metadata.annotations)===null||lt===void 0?void 0:lt[p.Tf],ut={label:"View Source",disabled:!Ge,icon:(0,r.jsx)(W.nW,{type:Ge==null?void 0:Ge.integrationType}),href:Ge==null?void 0:Ge.locationTargetUrl},ln={label:"View TechDocs",disabled:!(!((yt=Ce.metadata.annotations)===null||yt===void 0)&&yt["backstage.io/techdocs-ref"])||!nt,icon:(0,r.jsx)(H.Z,{}),href:nt&&nt({namespace:Ce.metadata.namespace||p.zG,kind:Ce.kind,name:Ce.metadata.name})},cn=[ut,ln];if(ue(Ce)){var dn;const tn=(dn=Vt.getSystemIcon("scaffolder"))!==null&&dn!==void 0?dn:ae.Z,Tn={label:"Launch Template",icon:(0,r.jsx)(tn,{}),disabled:!Ye,href:Ye&&Ye({templateName:Ce.metadata.name,namespace:Ce.metadata.namespace||p.zG})};cn.push(Tn)}let Ht="";Lt==="gridItem"?Ht=be.gridItemCard:Lt==="fullHeight"&&(Ht=be.fullHeightCard);let Sn="";Lt==="gridItem"?Sn=be.gridItemCardContent:Lt==="fullHeight"&&(Sn=be.fullHeightCardContent);const Qt=(qe=Ce.metadata.annotations)===null||qe===void 0?void 0:qe[p.P1],Xt=(Qt==null?void 0:Qt.startsWith("url:"))||(Qt==null?void 0:Qt.startsWith("file:")),Cn=(0,R.useCallback)(async()=>{try{await Be.refreshEntity((0,p.eE)(Ce)),gt.post({message:"Refresh scheduled",severity:"info",display:"transient"})}catch(tn){xt.post(tn)}},[Be,gt,xt,Ce]);return(0,r.jsxs)(ne.Z,{className:Ht,children:[(0,r.jsx)(L.Z,{title:"About",action:(0,r.jsxs)(r.Fragment,{children:[Xt&&(0,r.jsx)(A.Z,{"aria-label":"Refresh",title:"Schedule entity refresh",onClick:Cn,children:(0,r.jsx)(_.Z,{})}),(0,r.jsx)(A.Z,{component:z.rU,"aria-label":"Edit",disabled:!ct,title:"Edit Metadata",to:ct!=null?ct:"#",children:(0,r.jsx)(T.Z,{})})]}),subheader:(0,r.jsx)(z.M6,{links:cn})}),(0,r.jsx)(le.Z,{}),(0,r.jsx)(se.Z,{className:Sn,children:(0,r.jsx)(bt,{entity:Ce})})]})}},86359:function(wt,ke,n){"use strict";n.d(ke,{E:function(){return H}});var r=n(52322),p=n(25271),z=n(53974),f=n(39709),W=n(90436),g=n(15459),u=n(27604),N=n(2997),ge=n(11640),ue=n(28347),V=n(76635),ne=n(2784),L=n(7089);const A=Object.freeze({createNameColumn(T){function R(P){var K;return((K=P.metadata)===null||K===void 0?void 0:K.title)||(0,f.$3)(P,{defaultKind:T==null?void 0:T.defaultKind})}return{title:"Name",field:"resolved.name",highlight:!0,customSort({entity:P},{entity:K}){return R(P).localeCompare(R(K))},render:({entity:P})=>{var K;return(0,r.jsx)(f.dx,{entityRef:P,defaultKind:(T==null?void 0:T.defaultKind)||"Component",title:(K=P.metadata)===null||K===void 0?void 0:K.title})}}},createSystemColumn(){return{title:"System",field:"resolved.partOfSystemRelationTitle",render:({resolved:T})=>(0,r.jsx)(f.rI,{entityRefs:T.partOfSystemRelations,defaultKind:"system"})}},createOwnerColumn(){return{title:"Owner",field:"resolved.ownedByRelationsTitle",render:({resolved:T})=>(0,r.jsx)(f.rI,{entityRefs:T.ownedByRelations,defaultKind:"group"})}},createSpecTargetsColumn(){return{title:"Targets",field:"entity.spec.targets",render:({entity:T})=>{var R,P;return(0,r.jsx)(r.Fragment,{children:((T==null||(R=T.spec)===null||R===void 0?void 0:R.targets)||(T==null||(P=T.spec)===null||P===void 0?void 0:P.target))&&(0,r.jsx)(z.Or,{text:(T.spec.targets||[T.spec.target]).join(", "),placement:"bottom-start"})})}}},createSpecTypeColumn(){return{title:"Type",field:"entity.spec.type",hidden:!0,width:"auto"}},createSpecLifecycleColumn(){return{title:"Lifecycle",field:"entity.spec.lifecycle"}},createMetadataDescriptionColumn(){return{title:"Description",field:"entity.metadata.description",render:({entity:T})=>(0,r.jsx)(z.Or,{text:T.metadata.description,placement:"bottom-start"}),width:"auto"}},createTagsColumn(){return{title:"Tags",field:"entity.metadata.tags",cellStyle:{padding:"0px 16px 0px 20px"},render:({entity:T})=>(0,r.jsx)(r.Fragment,{children:T.metadata.tags&&T.metadata.tags.map(R=>(0,r.jsx)(L.Z,{label:R,size:"small",variant:"outlined",style:{marginBottom:"0px"}},R))}),width:"auto"}},createTitleColumn(T){return{title:"Title",field:"entity.metadata.title",hidden:T==null?void 0:T.hidden,searchable:!0}},createLabelColumn(T,R){return{title:(R==null?void 0:R.title)||"Label",field:"entity.metadata.labels",cellStyle:{padding:"0px 16px 0px 20px"},render:({entity:P})=>{var K;const je=(K=P.metadata)===null||K===void 0?void 0:K.labels,Le=je&&je[T]||(R==null?void 0:R.defaultValue);return(0,r.jsx)(r.Fragment,{children:Le&&(0,r.jsx)(L.Z,{label:Le,size:"small",variant:"outlined"},Le)})},width:"auto"}},createNamespaceColumn(){return{title:"Namespace",field:"entity.metadata.namespace",width:"auto"}}});var le=n(19928),se=n.n(le);const ae=(0,g.Z)({root:{color:"#f3ba37"}})(ge.Z),_=(T,R)=>{const P=K=>K.metadata.title||(0,f.$3)(K,{defaultKind:"Component"});return P(T).localeCompare(P(R))},H=T=>{var R,P,K,je;const{columns:Le,actions:Z,tableOptions:Xe,subtitle:at,emptyContent:Rt}=T,{isStarredEntity:zt,toggleStarredEntity:bt}=(0,f.CR)(),{loading:Zt,error:Dt,entities:_e,filters:lt}=(0,f.wp)(),yt=(0,ne.useMemo)(()=>{var Ye;return[A.createTitleColumn({hidden:!0}),A.createNameColumn({defaultKind:(Ye=lt.kind)===null||Ye===void 0?void 0:Ye.value}),...Ge(),A.createMetadataDescriptionColumn(),A.createTagsColumn()];function Ge(){var ct;const ut=[A.createSystemColumn(),A.createOwnerColumn(),A.createSpecTypeColumn(),A.createSpecLifecycleColumn()];switch((ct=lt.kind)===null||ct===void 0?void 0:ct.value){case"user":return[];case"domain":case"system":return[A.createOwnerColumn()];case"group":case"template":return[A.createSpecTypeColumn()];case"location":return[A.createSpecTypeColumn(),A.createSpecTargetsColumn()];default:return _e.every(ln=>ln.metadata.namespace==="default")?ut:[...ut,A.createNamespaceColumn()]}}},[(R=lt.kind)===null||R===void 0?void 0:R.value,_e]),qe=lt.type===void 0;var Lt;const Vt=(0,V.capitalize)((Lt=(P=lt.user)===null||P===void 0?void 0:P.value)!==null&&Lt!==void 0?Lt:"all");if(Dt)return(0,r.jsx)("div",{children:(0,r.jsx)(z.GB,{severity:"error",title:"Could not fetch catalog entities.",children:(0,r.jsx)(z.Oi,{language:"text",text:Dt.toString()})})});const be=[({entity:Ye})=>{var Ge;const ct=(Ge=Ye.metadata.annotations)===null||Ge===void 0?void 0:Ge[p.l2],ut="View";return{icon:()=>(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(W.Z,{variant:"srOnly",children:ut}),(0,r.jsx)(N.Z,{fontSize:"small"})]}),tooltip:ut,disabled:!ct,onClick:()=>{ct&&window.open(ct,"_blank")}}},({entity:Ye})=>{var Ge;const ct=(Ge=Ye.metadata.annotations)===null||Ge===void 0?void 0:Ge[p.Tf],ut="Edit";return{icon:()=>(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(W.Z,{variant:"srOnly",children:ut}),(0,r.jsx)(u.Z,{fontSize:"small"})]}),tooltip:ut,disabled:!ct,onClick:()=>{ct&&window.open(ct,"_blank")}}},({entity:Ye})=>{const Ge=zt(Ye),ct=Ge?"Remove from favorites":"Add to favorites";return{cellStyle:{paddingLeft:"1em"},icon:()=>(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(W.Z,{variant:"srOnly",children:ct}),Ge?(0,r.jsx)(ae,{}):(0,r.jsx)(ue.Z,{})]}),tooltip:ct,onClick:()=>bt(Ye)}}],Ce=_e.sort(_).map(Ye=>{const Ge=(0,f.hF)(Ye,p.cz,{kind:"system"}),ct=(0,f.hF)(Ye,p.S4);return{entity:Ye,resolved:{name:(0,f.$3)(Ye,{defaultKind:"Component"}),ownedByRelationsTitle:ct.map(ut=>(0,f.$3)(ut,{defaultKind:"group"})).join(", "),ownedByRelations:ct,partOfSystemRelationTitle:Ge.map(ut=>(0,f.$3)(ut,{defaultKind:"system"})).join(", "),partOfSystemRelations:Ge}}}),Ke=(Le||yt).find(Ye=>Ye.title==="Type");Ke&&(Ke.hidden=!qe);const Be=Ce.length>20,gt=((K=lt.kind)===null||K===void 0?void 0:K.value)||"",xt=((je=lt.type)===null||je===void 0?void 0:je.value)||"",nt=[Vt,xt,se()(gt)].filter(Ye=>Ye).join(" ");return(0,r.jsx)(z.iA,{isLoading:Zt,columns:Le||yt,options:{paging:Be,pageSize:20,actionsColumnIndex:-1,loadingType:"linear",showEmptyDataSourceMessage:!Zt,padding:"dense",pageSizeOptions:[20,50,100],...Xe},title:`${nt} (${_e.length})`,data:Ce,actions:Z||be,subtitle:at,emptyContent:Rt})};H.columns=A},85877:function(wt,ke,n){"use strict";n.r(ke),n.d(ke,{EntityLabelsCard:function(){return ne},hasLabels:function(){return L}});var r=n(52322),p=n(39709),z=n(2784),f=n(53974),W=n(79692),g=n(90436),u=n(77277);const N=`metadata:
|
|
34
|
-
name: example
|
|
35
|
-
labels:
|
|
36
|
-
javaVersion: 1.2.3`,ge=(0,W.Z)(A=>({code:{borderRadius:6,margin:`${A.spacing(2)}px 0px`,background:A.palette.type==="dark"?"#444":A.palette.common.white}}),{name:"PluginCatalogEntityLabelsEmptyState"});function ue(){const A=ge();return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(g.Z,{variant:"body1",children:"No labels defined for this entity. You can add labels to your entity YAML as shown in the highlighted example below:"}),(0,r.jsx)("div",{className:A.code,children:(0,r.jsx)(f.Oi,{text:N,language:"yaml",showLineNumbers:!0,highlightedNumbers:[3,4,5,6],customStyle:{background:"inherit",fontSize:"115%"}})}),(0,r.jsx)(u.Z,{variant:"contained",color:"primary",target:"_blank",href:"https://backstage.io/docs/features/software-catalog/descriptor-format#labels-optional",children:"Read more"})]})}const V=(0,W.Z)(A=>({key:{fontWeight:"bold"}})),ne=A=>{var le;const{variant:se,title:ae}=A,{entity:_}=(0,p.X2)(),H=V(),T=[{render:P=>(0,r.jsx)(g.Z,{className:H.key,variant:"body2",children:P.key})},{field:"value"}],R=_==null||(le=_.metadata)===null||le===void 0?void 0:le.labels;return(0,r.jsx)(f.rJ,{title:ae||"Labels",variant:se,children:!R||Object.keys(R).length===0?(0,r.jsx)(ue,{}):(0,r.jsx)(f.iA,{columns:T,data:Object.keys(R).map(P=>({key:P,value:R[P]})),options:{search:!1,showTitle:!0,loadingType:"linear",header:!1,padding:"dense",pageSize:5,toolbar:!1,paging:Object.keys(R).length>5}})})};function L(A){var le,se;return!(A==null||(le=A.metadata)===null||le===void 0)&&le.labels?Object.keys(A==null||(se=A.metadata)===null||se===void 0?void 0:se.labels).some(Boolean):!1}},24851:function(wt,ke,n){"use strict";n.d(ke,{s:function(){return le}});var r=n(52322),p=n(90348),z=n(11861),f=n(2784),W=n(79692),g=n(95544),u=n(90436),N=n(52160),ge=n(53974);const ue=(0,W.Z)({svgIcon:{display:"inline-block","& svg":{display:"inline-block",fontSize:"inherit",verticalAlign:"baseline"}}});function V(se){const{href:ae,text:_,Icon:H}=se,T=ue();return(0,r.jsxs)(g.Z,{display:"flex",children:[(0,r.jsx)(g.Z,{mr:1,className:T.svgIcon,children:(0,r.jsx)(u.Z,{component:"div",children:H?(0,r.jsx)(H,{}):(0,r.jsx)(N.Z,{})})}),(0,r.jsx)(g.Z,{flexGrow:"1",children:(0,r.jsx)(ge.rU,{to:ae,target:"_blank",rel:"noopener",children:_||ae})})]})}var ne=n(41156);const L={xs:1,sm:1,md:1,lg:2,xl:3};function A(se){const ae=[(0,ne.Z)(R=>R.breakpoints.up("xl"))?"xl":null,(0,ne.Z)(R=>R.breakpoints.up("lg"))?"lg":null,(0,ne.Z)(R=>R.breakpoints.up("md"))?"md":null,(0,ne.Z)(R=>R.breakpoints.up("sm"))?"sm":null,(0,ne.Z)(R=>R.breakpoints.up("xs"))?"xs":null];let _=1;if(typeof se=="number")_=se;else{var H;const R=(H=ae.find(P=>P!==null))!==null&&H!==void 0?H:"xs";var T;_=(T=se==null?void 0:se[R])!==null&&T!==void 0?T:L[R]}return _}function le(se){const{items:ae,cols:_=void 0}=se,H=A(_);return(0,r.jsx)(p.Z,{rowHeight:"auto",cols:H,children:ae.map(({text:T,href:R,Icon:P},K)=>(0,r.jsx)(z.Z,{children:(0,r.jsx)(V,{href:R,text:T!=null?T:R,Icon:P})},K))})}},19625:function(wt,ke,n){"use strict";n.d(ke,{_Z:function(){return W},jU:function(){return z},ql:function(){return f},yw:function(){return p}});var r=n(60871);const p=(0,r.x8)({id:"create-component",optional:!0}),z=(0,r.x8)({id:"view-techdoc",optional:!0,params:["namespace","kind","name"]}),f=(0,r.x8)({id:"create-from-template",optional:!0,params:["namespace","templateName"]}),W=(0,r.NT)({id:"catalog"})},15096:function(wt,ke,n){"use strict";n.d(ke,{FA:function(){return ge},qO:function(){return yt},Nd:function(){return Z},E5:function(){return qt},Rx:function(){return R}});var r=n(60871);const p=(0,r.T0)({id:"plugin.search.queryservice"});class z{query(){return Promise.resolve(this.mockedResults||{results:[]})}constructor(q){_define_property(this,"mockedResults",void 0),this.mockedResults=q}}var f=n(52322),W=n(2784),g=n(38402),u=n(79692);const N=(0,u.Z)(()=>({highlight:{}}),{name:"BackstageHighlightedSearchResultText"}),ge=ee=>{const{text:q,preTag:te,postTag:v}=ee,O=N(),Q=(0,W.useMemo)(()=>q.split(new RegExp(`(${te}.+?${v})`)),[v,te,q]);return(0,f.jsx)(f.Fragment,{children:Q.map((M,he)=>M.includes(te)?(0,f.jsx)("mark",{className:O.highlight,children:M.replace(new RegExp(`${te}|${v}`,"g"),"")},he):M)})};var ue=n(50581),V=n(61837),ne=n(86619),L=n(77277),A=n(21853),le=n(48760),se=n(76635),ae=n(64279),_=n(1849),H=n(51837);const T=(0,H.CT)("search-context"),R=()=>{const ee=(0,W.useContext)(T);if(!ee)throw new Error("useSearch must be used within a SearchContextProvider");const q=ee.atVersion(1);if(!q)throw new Error("No SearchContext v1 found");return q},P=()=>(0,W.useContext)(T)!==void 0,K={term:"",types:[],filters:{},pageLimit:void 0,pageCursor:void 0},je=(ee=K)=>{var q,te,v,O;const Q=(0,r.h_)(p),[M,he]=(0,W.useState)(ee.term),[ye,Me]=(0,W.useState)(ee.types),[ot,dt]=(0,W.useState)(ee.filters),[At,jt]=(0,W.useState)(ee.pageLimit),[st,Fe]=(0,W.useState)(ee.pageCursor),Ut=(0,_.Z)(M),Yt=(0,_.Z)(ot),Ct=(0,ae.default)(()=>Q.query({term:M,types:ye,filters:ot,pageLimit:At,pageCursor:st}),[M,ye,ot,At,st]),Nt=!Ct.loading&&!Ct.error&&((q=Ct.value)===null||q===void 0?void 0:q.nextPageCursor),hn=!Ct.loading&&!Ct.error&&((te=Ct.value)===null||te===void 0?void 0:te.previousPageCursor),yn=(0,W.useCallback)(()=>{var Pt;Fe((Pt=Ct.value)===null||Pt===void 0?void 0:Pt.nextPageCursor)},[(v=Ct.value)===null||v===void 0?void 0:v.nextPageCursor]),mt=(0,W.useCallback)(()=>{var Pt;Fe((Pt=Ct.value)===null||Pt===void 0?void 0:Pt.previousPageCursor)},[(O=Ct.value)===null||O===void 0?void 0:O.previousPageCursor]);return(0,W.useEffect)(()=>{Ut!==void 0&&M!==Ut&&Fe(void 0)},[M,Ut,Fe]),(0,W.useEffect)(()=>{Yt!==void 0&&!(0,se.isEqual)(ot,Yt)&&Fe(void 0)},[ot,Yt,Fe]),{result:Ct,term:M,setTerm:he,types:ye,setTypes:Me,filters:ot,setFilters:dt,pageLimit:At,setPageLimit:jt,pageCursor:st,setPageCursor:Fe,fetchNextPage:Nt?yn:void 0,fetchPreviousPage:hn?mt:void 0}},Le=ee=>{const{initialState:q,children:te}=ee,v=je(q);return(0,f.jsx)(r.fC,{attributes:{searchTypes:v.types.sort().join(",")},children:(0,f.jsx)(T.Provider,{value:(0,H.EI)({1:v}),children:te})})},Z=ee=>{const{initialState:q,inheritParentContextIfAvailable:te,children:v}=ee;return P()&&te?(0,f.jsx)(f.Fragment,{children:v}):(0,f.jsx)(Le,{initialState:q,children:v})},Xe=({children:ee})=>{var q;const te=ot=>(0,_.Z)(ot)!==ot,v=(0,r.z$)(),{term:O,result:Q}=R();var M;const he=(M=(q=Q.value)===null||q===void 0?void 0:q.numberOfResults)!==null&&M!==void 0?M:void 0,Me=te(Q.loading)&&!Q.loading;return(0,W.useEffect)(()=>{O&&Me&&v.captureEvent("search",O,{value:he})},[v,O,he,Me]),(0,f.jsx)(f.Fragment,{children:ee})};function at(ee){return(0,W.forwardRef)((q,te)=>(0,f.jsx)(Z,{inheritParentContextIfAvailable:!0,children:(0,f.jsx)(ee,{...q,ref:te})}))}const Rt=at((0,W.forwardRef)((ee,q)=>{const{onChange:te,onKeyDown:v=()=>{},onClear:O=()=>{},onSubmit:Q=()=>{},debounceTime:M=200,clearButton:he=!0,fullWidth:ye=!0,value:Me,label:ot,placeholder:dt,inputProps:At={},InputProps:jt={},endAdornment:st,...Fe}=ee,Ut=(0,r.h_)(r.Ds),[Yt,Ct]=(0,W.useState)("");(0,W.useEffect)(()=>{Ct(en=>en!==Me?String(Me):en)},[Me]),(0,le.Z)(()=>te(Yt),M,[Yt]);const Nt=(0,W.useCallback)(en=>{Ct(en.target.value)},[Ct]),hn=(0,W.useCallback)(en=>{v&&v(en),Q&&en.key==="Enter"&&Q()},[v,Q]),yn=(0,W.useCallback)(()=>{te(""),O&&O()},[te,O]),mt=ot?void 0:"Search",He=dt!=null?dt:`Search in ${Ut.getOptionalString("app.title")||"Backstage"}`,Pt=(0,f.jsx)(ue.Z,{position:"start",children:(0,f.jsx)(V.Z,{"aria-label":"Query",size:"small",disabled:!0,children:(0,f.jsx)(A.Z,{})})}),mn=(0,f.jsx)(ue.Z,{position:"end",children:(0,f.jsx)(L.Z,{"aria-label":"Clear",size:"small",onClick:yn,onKeyDown:en=>{en.key==="Enter"&&en.stopPropagation()},children:"Clear"})});return(0,f.jsx)(Xe,{children:(0,f.jsx)(ne.Z,{id:"search-bar-text-field","data-testid":"search-bar-next",variant:"outlined",margin:"normal",inputRef:q,value:Yt,label:ot,placeholder:He,InputProps:{startAdornment:Pt,endAdornment:he?mn:st,...jt},inputProps:{"aria-label":mt,...At},fullWidth:ye,onChange:Nt,onKeyDown:hn,...Fe})})})),zt=at((0,W.forwardRef)((ee,q)=>{const{value:te="",onChange:v,...O}=ee,{term:Q,setTerm:M}=R();(0,W.useEffect)(()=>{te&&M(String(te))},[te,M]);const he=(0,W.useCallback)(ye=>{v?v(ye):M(ye)},[v,M]);return(0,f.jsx)(r.fC,{attributes:{pluginId:"search",extension:"SearchBar"},children:(0,f.jsx)(Rt,{...O,ref:q,value:Q,onChange:he})})}));var bt=n(4614),Zt=n(88013);const Dt=(0,u.Z)(ee=>({loading:{right:ee.spacing(1),position:"absolute"}})),_e=ee=>q=>(0,f.jsx)(Z,{inheritParentContextIfAvailable:!0,children:(0,f.jsx)(ee,{...q})}),lt=()=>{const ee=Dt();return(0,f.jsx)(bt.Z,{className:ee.loading,"data-testid":"search-autocomplete-progressbar",color:"inherit",size:20})},yt=_e(function(q){const{loading:te,value:v,onChange:O=()=>{},options:Q=[],getOptionLabel:M=Nt=>String(Nt),inputPlaceholder:he,inputDebounceTime:ye,freeSolo:Me=!0,fullWidth:ot=!0,clearOnBlur:dt=!1,"data-testid":At="search-autocomplete",...jt}=q,{setTerm:st}=R(),Fe=(0,W.useCallback)(Nt=>Nt?typeof Nt=="string"?Nt:M(Nt):"",[M]),Ut=(0,W.useMemo)(()=>Fe(v),[v,Fe]),Yt=(0,W.useCallback)((Nt,hn,yn,mt)=>{st(Fe(hn)),O(Nt,hn,yn,mt)},[Fe,st,O]),Ct=(0,W.useCallback)(({InputProps:{ref:Nt,className:hn,endAdornment:yn},InputLabelProps:mt,...He})=>(0,f.jsx)(zt,{...He,ref:Nt,clearButton:!1,value:Ut,placeholder:he,debounceTime:ye,endAdornment:te?(0,f.jsx)(lt,{}):yn,InputProps:{className:hn}}),[te,Ut,he,ye]);return(0,f.jsx)(Zt.ZP,{...jt,"data-testid":At,value:v,onChange:Yt,options:Q,getOptionLabel:M,renderInput:Ct,freeSolo:Me,fullWidth:ot,clearOnBlur:dt})}),qe=ee=>{const{icon:q,primaryText:te,primaryTextTypographyProps:v,secondaryText:O,secondaryTextTypographyProps:Q,disableTextTypography:M}=ee;return _jsxs(_Fragment,{children:[q?_jsx(ListItemIcon,{children:q}):null,_jsx(ListItemText,{primary:te,primaryTypographyProps:v,secondary:O,secondaryTypographyProps:Q,disableTypography:M})]})};var Lt=n(42494),Vt=n(84899),be=n(5806),Ce=n(21324),Ke=n(56939),Be=n(73698),gt=n(12231),xt=n(90436),nt=n(7089),Ye=n(69294);const Ge=(ee,q,te=[],v=250)=>{const O=(0,W.useRef)({}),Q=ee||(()=>Promise.resolve([])),[M,he]=(0,Ye.default)(Q,[q],{loading:!0});if((0,le.Z)(()=>{O.current[q]===void 0&&(O.current[q]=he(q).then(Me=>(O.current[q]=Me,Me)))},v,[he,q]),te.length)return{loading:!1,value:te};const ye=O.current[q];return Array.isArray(ye)?{loading:!1,value:ye}:M},ct=(ee,q)=>{const{setFilters:te}=R();(0,W.useEffect)(()=>{q&&[q].flat().length>0&&te(v=>({...v,[ee]:q}))},[])},ut=ee=>{const{className:q,defaultValue:te,name:v,values:O,valuesDebounceMs:Q,label:M,filterSelectedOptions:he,limitTags:ye,multiple:Me}=ee,[ot,dt]=(0,W.useState)("");ct(v,te);const At=typeof O=="function"?O:void 0,jt=typeof O=="function"?void 0:O,{value:st,loading:Fe}=Ge(At,ot,jt,Q),{filters:Ut,setFilters:Yt}=R(),Ct=Ut[v]||(Me?[]:null),Nt=(mt,He)=>{Yt(Pt=>{const{[v]:mn,...en}=Pt;return He?{...en,[v]:He}:{...en}})},hn=mt=>(0,f.jsx)(ne.Z,{...mt,name:"search",variant:"outlined",label:M,fullWidth:!0}),yn=(mt,He)=>mt.map((Pt,mn)=>(0,f.jsx)(nt.Z,{label:Pt,color:"primary",...He({index:mn})}));return(0,f.jsx)(Zt.ZP,{filterSelectedOptions:he,limitTags:ye,multiple:Me,className:q,id:`${Me?"multi-":""}select-filter-${v}--select`,options:st||[],loading:Fe,value:Ct,onChange:Nt,onInputChange:(mt,He)=>dt(He),renderInput:hn,renderTags:yn})},ln=(0,u.Z)({label:{textTransform:"capitalize"},checkboxWrapper:{display:"flex",alignItems:"center",width:"100%"},textWrapper:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}}),cn=ee=>{const{className:q,defaultValue:te,label:v,name:O,values:Q=[],valuesDebounceMs:M}=ee,he=ln(),{filters:ye,setFilters:Me}=R();ct(O,te);const ot=typeof Q=="function"?Q:void 0,dt=typeof Q=="function"?void 0:Q,{value:At=[],loading:jt}=Ge(ot,"",dt,M),st=Ut=>{const{target:{value:Yt,checked:Ct}}=Ut;Me(Nt=>{const{[O]:hn,...yn}=Nt,mt=(hn||[]).filter(Pt=>Pt!==Yt),He=Ct?[...mt,Yt]:mt;return He.length?{...yn,[O]:He}:yn})};var Fe;return(0,f.jsxs)(Lt.Z,{className:q,disabled:jt,fullWidth:!0,"data-testid":"search-checkboxfilter-next",children:[v?(0,f.jsx)(Vt.Z,{className:he.label,children:v}):null,At.map(Ut=>(0,f.jsx)(be.Z,{classes:{root:he.checkboxWrapper,label:he.textWrapper},label:Ut,control:(0,f.jsx)(Ce.Z,{color:"primary",inputProps:{"aria-labelledby":Ut},value:Ut,name:Ut,onChange:st,checked:((Fe=ye[O])!==null&&Fe!==void 0?Fe:[]).includes(Ut)})},Ut))]})},dn=ee=>{const{className:q,defaultValue:te,label:v,name:O,values:Q,valuesDebounceMs:M}=ee,he=ln();ct(O,te);const ye=typeof Q=="function"?Q:void 0,Me=typeof Q=="function"?void 0:Q,{value:ot=[],loading:dt}=Ge(ye,"",Me,M),{filters:At,setFilters:jt}=R(),st=Fe=>{const{target:{value:Ut}}=Fe;jt(Yt=>{const{[O]:Ct,...Nt}=Yt;return Ut?{...Nt,[O]:Ut}:Nt})};return(0,f.jsxs)(Lt.Z,{disabled:dt,className:q,variant:"filled",fullWidth:!0,"data-testid":"search-selectfilter-next",children:[v?(0,f.jsx)(Ke.Z,{className:he.label,margin:"dense",children:v}):null,(0,f.jsxs)(Be.Z,{variant:"outlined",value:At[O]||"",onChange:st,children:[(0,f.jsx)(gt.Z,{value:"",children:(0,f.jsx)("em",{children:"All"})}),ot.map(Fe=>(0,f.jsx)(gt.Z,{value:Fe,children:(0,f.jsx)(xt.Z,{variant:"inherit",noWrap:!0,children:Fe})},Fe))]})]})},Ht=ee=>{const{component:q,...te}=ee;return(0,f.jsx)(q,{...te})};Ht.Checkbox=ee=>(0,f.jsx)(Ht,{...ee,component:cn}),Ht.Select=ee=>(0,f.jsx)(Ht,{...ee,component:dn}),Ht.Autocomplete=ee=>(0,f.jsx)(Ht,{...ee,component:ut});var Sn=n(48834).lW;const Qt=ee=>Sn.from(ee.toString(),"utf-8").toString("base64"),Xt=ee=>ee?Number(Sn.from(ee,"base64").toString("utf-8")):0,Cn=ee=>{const{total:q=-1,cursor:te,hasNextPage:v,onCursorChange:O,limit:Q=25,limitLabel:M="Results per page:",limitText:he=({from:st,to:Fe})=>q>0?`of ${q}`:`${st}-${Fe}`,limitOptions:ye,onLimitChange:Me,...ot}=ee,dt=useMemo(()=>Xt(te),[te]),At=useCallback((st,Fe)=>{O==null||O(Qt(Fe))},[O]),jt=useCallback(st=>{const Fe=st.target.value;Me==null||Me(parseInt(Fe,10))},[Me]);return _jsx(TablePagination,{...ot,component:"div",count:q,page:dt,nextIconButtonProps:{...v!==void 0&&{disabled:!v}},onPageChange:At,rowsPerPage:Q,labelRowsPerPage:M,labelDisplayedRows:he,rowsPerPageOptions:ye,onRowsPerPageChange:jt})},tn=ee=>{const{pageLimit:q,setPageLimit:te,pageCursor:v,setPageCursor:O,fetchNextPage:Q}=useSearch(),M=useCallback(he=>{te(he),O(void 0)},[te,O]);return _jsx(Cn,{...ee,hasNextPage:!!Q,limit:q,onLimitChange:M,cursor:v,onCursorChange:O})};var Tn=n(53974);const $n=ee=>{const{children:q}=ee,te=useSearch(),{result:v,...O}=te;return q(v,O)},et=ee=>{const{query:q,children:te}=ee,v=useApi(searchApiRef),O=useAsync(()=>{const{term:Q="",types:M=[],filters:he={},...ye}=q;return v.query({...ye,term:Q,types:M,filters:he})},[q]);return te(O,q)},nn=ee=>{const{query:q,children:te}=ee;return q?_jsx(et,{query:q,children:te}):_jsx($n,{children:te})},Gt=ee=>{const{query:q,children:te,noResultsComponent:v=_jsx(EmptyState,{missing:"data",title:"Sorry, no results were found"}),...O}=ee;return _jsx(nn,{query:q,children:({loading:Q,error:M,value:he})=>Q?_jsx(Progress,{}):M?_jsx(ResponseErrorPanel,{title:"Error encountered while fetching search results",error:M}):he!=null&&he.results.length?isFunction(te)?te(he):_jsx(SearchResultListItemExtensions,{...O,results:he.results,children:te}):v})},rt=ee=>_jsx(AnalyticsContext,{attributes:{pluginId:"search",extension:"SearchResult"},children:_jsx(Gt,{...ee})}),Dn=({result:ee,highlight:q,icon:te,secondaryAction:v,lineClamp:O=5})=>ee?_jsxs(_Fragment,{children:[te&&_jsx(ListItemIcon,{children:te}),_jsx(ListItemText,{primaryTypographyProps:{variant:"h6"},primary:_jsx(Link,{noTrack:!0,to:ee.location,children:q!=null&&q.fields.title?_jsx(HighlightedSearchResultText,{text:(q==null?void 0:q.fields.title)||"",preTag:(q==null?void 0:q.preTag)||"",postTag:(q==null?void 0:q.postTag)||""}):ee.title}),secondary:_jsx(Typography,{component:"span",style:{display:"-webkit-box",WebkitBoxOrient:"vertical",WebkitLineClamp:O,overflow:"hidden"},color:"textSecondary",variant:"body2",children:q!=null&&q.fields.text?_jsx(HighlightedSearchResultText,{text:q.fields.text,preTag:q.preTag,postTag:q.postTag}):ee.text})}),v&&_jsx(Box,{alignItems:"flex-end",children:v})]}):null,un=ee=>_jsx(AnalyticsContext,{attributes:{pluginId:"search",extension:"DefaultResultListItem"},children:_jsx(Dn,{...ee})}),Pn=ee=>{const{error:q,loading:te,resultItems:v,renderResultItem:O=ye=>_jsx(DefaultResultListItem,{result:ye.document},ye.document.location),disableRenderingWithNoResults:Q,noResultsComponent:M=Q?null:_jsx(EmptyState,{missing:"data",title:"Sorry, no results were found"}),...he}=ee;return te?_jsx(Progress,{}):q?_jsx(ResponseErrorPanel,{title:"Error encountered while fetching search results",error:q}):v!=null&&v.length?_jsx(List,{...he,children:v.map(O)}):_jsx(_Fragment,{children:M})},wn=ee=>{const{query:q,renderResultItem:te,children:v,...O}=ee,Q=useSearchResultListItemExtensions(v);return _jsx(AnalyticsContext,{attributes:{pluginId:"search",extension:"SearchResultList"},children:_jsx(SearchResultState,{query:q,children:({loading:M,error:he,value:ye})=>_jsx(Pn,{...O,error:he,loading:M,resultItems:ye==null?void 0:ye.results,renderResultItem:te!=null?te:Q})})})};var jn=n(19126);const Fn=(0,u.Z)(ee=>({listSubheader:{display:"flex",alignItems:"center"},listSubheaderName:{marginLeft:ee.spacing(1),textTransform:"uppercase"},listSubheaderChip:{color:ee.palette.text.secondary,margin:ee.spacing(0,0,0,1.5)},listSubheaderFilter:{display:"flex",color:ee.palette.text.secondary,margin:ee.spacing(0,0,0,1.5)},listSubheaderLink:{marginLeft:"auto",display:"flex",alignItems:"center"},listSubheaderLinkIcon:{fontSize:"inherit",marginLeft:ee.spacing(.5)}})),Rn=ee=>{const q=Fn(),{label:te,children:v,...O}=ee;return _jsx(Chip,{...O,className:q.listSubheaderFilter,variant:"outlined",label:_jsxs(_Fragment,{children:[te,": ",v]})})},Zn=()=>null,Se=(0,u.Z)(ee=>({root:{fontSize:"inherit","&:focus":{outline:"none",background:ee.palette.common.white},"&:not(:focus)":{cursor:"pointer",color:ee.palette.primary.main,"&:hover":{textDecoration:"underline"}}}})),de=ee=>{const q=Se(),{label:te,value:v="None",onChange:O,onDelete:Q}=ee,M=useCallback(he=>{O(he.target.value)},[O]);return _jsx(Rn,{label:te,onDelete:Q,children:_jsx(Typography,{role:"textbox",component:"span",className:q.root,onChange:M,contentEditable:!0,suppressContentEditableWarning:!0,children:v})})},Ie=(0,u.Z)(ee=>({root:{fontSize:"inherit","&:not(:focus)":{cursor:"pointer",color:ee.palette.primary.main,"&:hover":{textDecoration:"underline"}},"&:focus":{outline:"none"},"&>div:first-child":{padding:0}}})),G=ee=>{const q=Ie(),{label:te,value:v="none",onChange:O,onDelete:Q,children:M}=ee,he=useCallback(ye=>{O(ye.target.value)},[O]);return _jsx(Rn,{label:te,onDelete:Q,children:_jsxs(Select,{className:q.root,value:v,onChange:he,input:_jsx(InputBase,{}),IconComponent:Zn,children:[_jsx(MenuItem,{value:"none",children:"None"}),M]})})};function k(ee){const q=Fn(),[te,v]=useState(null),{error:O,loading:Q,icon:M,title:he,titleProps:ye={},link:Me=_jsxs(_Fragment,{children:["See all",_jsx(ArrowRightIcon,{className:q.listSubheaderLinkIcon})]}),linkProps:ot={},filterOptions:dt,renderFilterOption:At=He=>_jsx(MenuItem,{value:String(He),children:He},String(He)),filterFields:jt,renderFilterField:st,resultItems:Fe,renderResultItem:Ut=He=>_jsx(DefaultResultListItem,{result:He.document},He.document.location),disableRenderingWithNoResults:Yt,noResultsComponent:Ct=Yt?null:_jsx(EmptyState,{missing:"data",title:"Sorry, no results were found"}),...Nt}=ee,hn=useCallback(He=>{v(He.currentTarget)},[]),yn=useCallback(()=>{v(null)},[]);if(Q)return _jsx(Progress,{});if(O)return _jsx(ResponseErrorPanel,{title:"Error encountered while fetching search results",error:O});if(!(Fe!=null&&Fe.length))return _jsx(_Fragment,{children:Ct});var mt;return _jsxs(List,{...Nt,children:[_jsxs(ListSubheader,{className:q.listSubheader,children:[M,_jsx(Typography,{className:q.listSubheaderName,component:"strong",...ye,children:he}),dt?_jsx(Chip,{className:q.listSubheaderChip,component:"button",icon:_jsx(AddIcon,{}),variant:"outlined",label:"Add filter","aria-controls":"filters-menu","aria-haspopup":"true",onClick:hn}):null,dt?_jsx(Menu,{id:"filters-menu",anchorEl:te,open:Boolean(te),onClose:yn,onClick:yn,keepMounted:!0,children:dt.map(At)}):null,jt==null?void 0:jt.map(He=>(mt=st==null?void 0:st(He))!==null&&mt!==void 0?mt:null),_jsx(Link,{className:q.listSubheaderLink,to:"/search",...ot,children:Me})]}),Fe.map(Ut)]})}function ce(ee){const{query:q,children:te,renderResultItem:v,linkProps:O={},...Q}=ee,M=useSearchResultListItemExtensions(te);return _jsx(AnalyticsContext,{attributes:{pluginId:"search",extension:"SearchResultGroup"},children:_jsx(SearchResultState,{query:q,children:({loading:he,error:ye,value:Me},{term:ot,types:dt,pageCursor:At,filters:jt={}})=>{const st=`/search?${qs.stringify({term:ot,types:dt,filters:jt,pageCursor:At,query:ot},{arrayFormat:"brackets"})}`;return _jsx(k,{...Q,error:ye,loading:he,linkProps:{to:st,...O},filterFields:Object.keys(jt),resultItems:Me==null?void 0:Me.results,renderResultItem:v!=null?v:M})}})})}const Pe=(0,u.Z)(ee=>({root:{display:"flex",justifyContent:"space-between",gap:ee.spacing(2),margin:ee.spacing(2,0)}})),Ue=()=>{const{fetchNextPage:ee,fetchPreviousPage:q}=useSearch(),te=Pe();return!ee&&!q?_jsx(_Fragment,{}):_jsxs("nav",{"aria-label":"pagination navigation",className:te.root,children:[_jsx(Button,{"aria-label":"previous page",disabled:!q,onClick:q,startIcon:_jsx(ArrowBackIosIcon,{}),children:"Previous"}),_jsx(Button,{"aria-label":"next page",disabled:!ee,onClick:ee,endIcon:_jsx(ArrowForwardIosIcon,{}),children:"Next"})]})},We="search.results.list.items.extensions.v1",St=(ee,q)=>{for(const te of ee){if(!isValidElement(te))continue;const v=getComponentData(te,We);if(v!=null&&v(q))return cloneElement(te,{rank:q.rank,highlight:q.highlight,result:q.document,...te.props})}return null},Ot=ee=>{const{rank:q,result:te,noTrack:v,children:O,alignItems:Q="flex-start",...M}=ee,he=(0,r.z$)(),ye=(0,W.useCallback)(()=>{v||te&&he.captureEvent("discover",te.title,{attributes:{to:te.location},value:q})},[q,te,v,he]);return(0,f.jsx)(g.Z,{divider:!0,alignItems:Q,onClickCapture:ye,...M,children:O})},qt=ee=>{const{name:q,component:te,predicate:v=()=>!0}=ee;return(0,r.YO)({name:q,component:{lazy:()=>te().then(O=>Q=>(0,f.jsx)(Ot,{rank:Q.rank,result:Q.result,noTrack:Q.noTrack,children:(0,W.createElement)(O,Q)}))},data:{[We]:v}})},Kt=ee=>{const q=useElementFilter(ee,te=>te.selectByComponentData({key:We}).getElements(),[ee]);return useCallback((te,v)=>{const O=St(q,te);return _jsx(Fragment,{children:O!=null?O:_jsx(Ot,{rank:te.rank,result:te.document,children:_jsx(DefaultResultListItem,{rank:te.rank,highlight:te.highlight,result:te.document})})},v)},[q])},_t=ee=>{const{results:q,children:te,...v}=ee,O=Kt(te);return _jsx(List,{...v,children:q.map(O)})}},61886:function(wt,ke,n){"use strict";n.d(ke,{Ox:function(){return bt},jM:function(){return W},Zz:function(){return g},oZ:function(){return Z},DR:function(){return u},ZS:function(){return je},VA:function(){return _e},KY:function(){return ge},gT:function(){return A},Dl:function(){return le},ux:function(){return Dt},$L:function(){return L},x1:function(){return Le}});var r=n(52322),p=n(2784),z=n(73557),f=n(60871);const W="techdocs.addons.addon.v1",g="techdocs.addons.wrapper.v1",u=()=>null;(0,f.R5)(u,g,!0);const N=be=>`${W}.${be.toLocaleLowerCase("en-US")}`;function ge(be){const{name:Ce,component:Ke}=be;return(0,f.YO)({name:Ce,component:{sync:Be=>(0,r.jsx)(Ke,{...Be})},data:{[W]:be,[N(Ce)]:!0}})}const ue=(be,Ce)=>be.selectByComponentData({key:Ce}).getElements()[0],V=be=>be.selectByComponentData({key:g}).selectByComponentData({key:W}),ne=be=>be.selectByComponentData({key:g}).findComponentData({key:W}),L=()=>{const be=(0,z.pC)(),Ce=(0,f.vJ)(be,V),Ke=(0,f.vJ)(be,ne),Be=(0,p.useCallback)(nt=>{if(!Ce||!nt)return null;const Ye=N(nt.name);var Ge;return(Ge=ue(Ce,Ye))!==null&&Ge!==void 0?Ge:null},[Ce]),gt=(0,p.useCallback)(nt=>{const Ye=Ke.find(Ge=>Ge.name===nt);return Ye?Be(Ye):null},[Ke,Be]),xt=(0,p.useCallback)(nt=>{const Ye=Ke.filter(Ge=>Ge.location===nt);return Ye.length?Ye.map(Be):null},[Ke,Be]);return{renderComponentByName:gt,renderComponentsByLocation:xt}},A=(0,f.T0)({id:"plugin.techdocs.service"}),le=(0,f.T0)({id:"plugin.techdocs.storageservice"});var se=n(64279),ae=n(77446),_=n(25271),H=n(51837);function T(be,Ce){return Ce.getOptionalBoolean("techdocs.legacyUseCaseSensitiveTripletPaths")||(be.kind=be.kind.toLocaleLowerCase(),be.name=be.name.toLocaleLowerCase(),be.namespace=be.namespace.toLocaleLowerCase()),be}const R=(be,Ce)=>(0,_.eE)(be)===(0,_.eE)(Ce),P={title:"",subtitle:"",setTitle:()=>{},setSubtitle:()=>{},setShadowRoot:()=>{},metadata:{loading:!0},entityMetadata:{loading:!0},entityRef:{kind:"",name:"",namespace:""}},K=(0,H.CT)("techdocs-reader-page-context"),je=(0,p.memo)(be=>{const{entityRef:Ce,children:Ke}=be,Be=(0,f.h_)(A),gt=(0,f.h_)(f.Ds),xt=(0,se.default)(async()=>Be.getEntityMetadata(Ce),[Ce]),nt=(0,ae.Z)(async()=>Be.getTechDocsMetadata(Ce),[Ce]),[Ye,Ge]=(0,p.useState)(P.title),[ct,ut]=(0,p.useState)(P.subtitle),[ln,cn]=(0,p.useState)(P.shadowRoot);(0,p.useEffect)(()=>{ln&&!nt.value&&!nt.loading&&nt.retry()},[nt.value,nt.loading,ln,nt.retry,nt]);const dn={metadata:nt,entityRef:T(Ce,gt),entityMetadata:xt,shadowRoot:ln,setShadowRoot:cn,title:Ye,setTitle:Ge,subtitle:ct,setSubtitle:ut},Ht=(0,H.EI)({1:dn});return(0,r.jsx)(f.fC,{attributes:{entityRef:(0,_.eE)(Ce)},children:(0,r.jsx)(K.Provider,{value:Ht,children:Ke instanceof Function?Ke(dn):Ke})})},(be,Ce)=>R(be.entityRef,Ce.entityRef)),Le=()=>{const be=(0,p.useContext)(K);if(be===void 0)return P;const Ce=be.atVersion(1);if(Ce===void 0)throw new Error("No context found for version 1.");return Ce},Z=Object.freeze({Header:"Header",Subheader:"Subheader",Settings:"Settings",PrimarySidebar:"PrimarySidebar",SecondarySidebar:"SecondarySidebar",Content:"Content"});var Xe=n(70882),at=n(50236),Rt=n(19219),zt=n(53974);const bt="TECH_DOCS_SHADOW_DOM_STYLE_LOAD",Zt=be=>{(0,p.useEffect)(()=>{if(!be)return()=>{};const Ce=be.querySelectorAll('head > link[rel="stylesheet"]');var Ke;let Be=(Ke=Ce==null?void 0:Ce.length)!==null&&Ke!==void 0?Ke:0;const gt=new CustomEvent(bt);if(!Be)return be.dispatchEvent(gt),()=>{};const xt=()=>{--Be===0&&be.dispatchEvent(gt)};return Ce==null||Ce.forEach(nt=>{nt.addEventListener("load",xt)}),()=>{Ce==null||Ce.forEach(nt=>{nt.removeEventListener("load",xt)})}},[be])},Dt=be=>{const[Ce,Ke]=(0,p.useState)(!1);return(0,p.useEffect)(()=>{if(!be)return()=>{};Ke(!0);const Be=be.style;Be.setProperty("opacity","0");const gt=()=>{Ke(!1),Be.setProperty("opacity","1")};return be.addEventListener(bt,gt),()=>{be.removeEventListener(bt,gt)}},[be]),Ce},_e=be=>{const{element:Ce,onAppend:Ke,children:Be}=be,[gt,xt]=(0,p.useState)((0,Xe.Ue)({...(0,at.Z)(),insertionPoint:void 0}));Zt(Ce);const nt=Dt(Ce),Ye=(0,p.useCallback)(Ge=>{if(!Ce||!Ge)return;xt((0,Xe.Ue)({...(0,at.Z)(),insertionPoint:Ce.querySelector("head")||void 0}));let ct=Ge.shadowRoot;ct||(ct=Ge.attachShadow({mode:"open"})),ct.replaceChildren(Ce),typeof Ke=="function"&&Ke(ct)},[Ce,Ke]);return(0,r.jsxs)(r.Fragment,{children:[nt&&(0,r.jsx)(zt.Ex,{}),(0,r.jsxs)(Rt.ZP,{jss:gt,sheetsManager:new Map,children:[(0,r.jsx)("div",{ref:Ye,"data-testid":"techdocs-native-shadowroot"}),Be]})]})};var lt=n(54073);const yt=()=>{const{shadowRoot:be}=useTechDocsReaderPage();return be},qe=be=>{const Ce=yt();return Ce?be.map(Ke=>Ce==null?void 0:Ce.querySelectorAll(Ke)).filter(Ke=>Ke.length).map(Ke=>Array.from(Ke)).flat():[]},Lt=be=>be.toString()&&be.rangeCount&&be.getRangeAt(0).getBoundingClientRect().top,Vt=(be=0)=>{const Ce=yt(),[Ke,Be]=useState(null),gt=useMemo(()=>debounce(()=>{const xt=Ce,nt=xt.getSelection?xt.getSelection():document.getSelection();nt&&Lt(nt)?Be(nt):Be(null)},be),[Ce,Be,be]);return useEffect(()=>(window.document.addEventListener("selectionchange",gt),()=>{gt.cancel(),window.document.removeEventListener("selectionchange",gt)}),[gt]),Ke}},52943:function(wt,ke,n){"use strict";n.r(ke),n.d(ke,{EmbeddedDocsRouter:function(){return se},Router:function(){return le},isTechDocsAvailable:function(){return A}});var r=n(52322),p=n(2784),z=n(73557),f=n(39709),W=n(53974),g=n(25271),u=n(89258),N=n(65124),ge=n(86317);const ue=({entity:ae})=>{const _=(0,g.iB)(ae);return(0,r.jsxs)(u.I6,{entityRef:_,children:[(0,r.jsx)(N.b,{}),(0,r.jsx)(ge.F,{withSearch:!1})]})};var V=n(18662),ne=n(7476);const L="backstage.io/techdocs-ref",A=ae=>{var _,H;return Boolean(ae==null||(_=ae.metadata)===null||_===void 0||(H=_.annotations)===null||H===void 0?void 0:H[L])},le=()=>(0,r.jsxs)(z.Z5,{children:[(0,r.jsx)(z.AW,{path:"/",element:(0,r.jsx)(V.TechDocsIndexPage,{})}),(0,r.jsx)(z.AW,{path:"/:namespace/:kind/:name/*",element:(0,r.jsx)(ne.TechDocsReaderPage,{})})]}),se=ae=>{var _;const{children:H}=ae,{entity:T}=(0,f.X2)(),R=(0,z.V$)([{path:"/*",element:(0,r.jsx)(ue,{entity:T}),children:[{path:"*",element:H}]}]);return((_=T.metadata.annotations)===null||_===void 0?void 0:_[L])?R:(0,r.jsx)(W.sk,{annotation:L})}},92077:function(wt,ke,n){"use strict";n.d(ke,{k:function(){return g},p:function(){return W}});var r=n(87612),p=n(23054),z=n(54847),f=n.n(z);class W{async getApiOrigin(){return await this.discoveryApi.getBaseUrl("techdocs")}async getTechDocsMetadata(N){const{kind:ge,namespace:ue,name:V}=N,L=`${await this.getApiOrigin()}/metadata/techdocs/${ue}/${ge}/${V}`,A=await this.fetchApi.fetch(`${L}`);if(!A.ok)throw await p.VL.fromResponse(A);return await A.json()}async getEntityMetadata(N){const{kind:ge,namespace:ue,name:V}=N,L=`${await this.getApiOrigin()}/metadata/entity/${ue}/${ge}/${V}`,A=await this.fetchApi.fetch(`${L}`);if(!A.ok)throw await p.VL.fromResponse(A);return await A.json()}constructor(N){(0,r._)(this,"configApi",void 0),(0,r._)(this,"discoveryApi",void 0),(0,r._)(this,"fetchApi",void 0),this.configApi=N.configApi,this.discoveryApi=N.discoveryApi,this.fetchApi=N.fetchApi}}class g{async getApiOrigin(){return await this.discoveryApi.getBaseUrl("techdocs")}async getStorageUrl(){var N;return(N=this.configApi.getOptionalString("techdocs.storageUrl"))!==null&&N!==void 0?N:`${await this.discoveryApi.getBaseUrl("techdocs")}/static/docs`}async getBuilder(){return this.configApi.getString("techdocs.builder")}async getEntityDocs(N,ge){const{kind:ue,namespace:V,name:ne}=N,A=`${await this.getStorageUrl()}/${V}/${ue}/${ne}/${ge}`,le=await this.fetchApi.fetch(`${A.endsWith("/")?A:`${A}/`}index.html`);let se="";switch(le.status){case 404:throw se="Page not found. ",ge||(se+="This could be because there is no index.md file in the root of the docs directory of this repository."),new p.dR(se);case 500:throw se="Could not generate documentation or an error in the TechDocs backend. ",new Error(se);default:break}return le.text()}async syncEntityDocs(N,ge=()=>{}){const{kind:ue,namespace:V,name:ne}=N,A=`${await this.getApiOrigin()}/sync/${V}/${ue}/${ne}`,{token:le}=await this.identityApi.getCredentials();return new Promise((se,ae)=>{const _=new z.EventSourcePolyfill(A,{withCredentials:!0,headers:le?{Authorization:`Bearer ${le}`}:{}});_.addEventListener("log",H=>{H.data&&ge(JSON.parse(H.data))}),_.addEventListener("finish",H=>{let T=!1;H.data&&({updated:T}=JSON.parse(H.data)),se(T?"updated":"cached")}),_.onerror=H=>{switch(_.close(),H.status){case 404:ae(new p.dR(H.message));return;default:ae(new Error(H.data));return}}})}async getBaseUrl(N,ge,ue){const{kind:V,namespace:ne,name:L}=ge,le=`${await this.getApiOrigin()}/static/docs/${ne}/${V}/${L}/${ue}`;return new URL(N,le.endsWith("/")?le:`${le}/`).toString()}constructor(N){(0,r._)(this,"configApi",void 0),(0,r._)(this,"discoveryApi",void 0),(0,r._)(this,"identityApi",void 0),(0,r._)(this,"fetchApi",void 0),this.configApi=N.configApi,this.discoveryApi=N.discoveryApi,this.identityApi=N.identityApi,this.fetchApi=N.fetchApi}}},51953:function(wt,ke,n){"use strict";n.d(ke,{D:function(){return r}});function r(p,z){return z.getOptionalBoolean("techdocs.legacyUseCaseSensitiveTripletPaths")?p:p.toLocaleLowerCase("en-US")}},3482:function(wt,ke,n){"use strict";n.d(ke,{u:function(){return N}});var r=n(52322),p=n(2784),z=n(53974),f=n(39709),W=n(42081),g=n(48431),u=n(68435);const N=ge=>{const{initialFilter:ue="owned",columns:V,actions:ne}=ge;return(0,r.jsx)(W.j,{children:(0,r.jsxs)(z.VY,{children:[(0,r.jsx)(z.yW,{title:"",children:(0,r.jsx)(z.qt,{children:"Discover documentation in your ecosystem."})}),(0,r.jsx)(f.UO,{children:(0,r.jsxs)(f._i,{children:[(0,r.jsxs)(f._i.Filters,{children:[(0,r.jsx)(g.f,{}),(0,r.jsx)(f.EW,{initialFilter:ue}),(0,r.jsx)(f.dq,{}),(0,r.jsx)(f.xE,{})]}),(0,r.jsx)(f._i.Content,{children:(0,r.jsx)(u.n,{actions:ne,columns:V})})]})})]})})}},85478:function(wt,ke,n){"use strict";n.d(ke,{f:function(){return V}});var r=n(52322),p=n(95573),z=n(51953),f=n(60871),W=n(53974),g=n(94339),u=n(16111),N=n(24579),ge=n(14503),ue=n(2784);const V=se=>{const{entities:ae}=se,_=(0,f.tg)(p.Fw),H=(0,f.h_)(f.Ds);if(!ae)return null;var T,R;return(0,r.jsx)(W.Oh,{"data-testid":"docs-explore",children:ae!=null&&ae.length?ae.map((P,K)=>(0,r.jsxs)(g.Z,{children:[(0,r.jsx)(u.Z,{children:(0,r.jsx)(W.hu,{title:(T=P.metadata.title)!==null&&T!==void 0?T:P.metadata.name})}),(0,r.jsx)(N.Z,{children:P.metadata.description}),(0,r.jsx)(ge.Z,{children:(0,r.jsx)(W.Qj,{to:_({namespace:(0,z.D)((R=P.metadata.namespace)!==null&&R!==void 0?R:"default",H),kind:(0,z.D)(P.kind,H),name:(0,z.D)(P.metadata.name,H)}),color:"primary","data-testid":"read_docs",children:"Read Docs"})})]},K)):null})};var ne=n(39709);const L={title:"All Documentation",filterPredicate:()=>!0},A=se=>{const{entities:ae,group:_}=se,{loading:H,isOwnedEntity:T}=useEntityOwnership(),R=ae.filter(K=>_.filterPredicate==="ownedByUser"?H?!1:T(K):typeof _.filterPredicate=="function"&&_.filterPredicate(K)),P=(()=>typeof _.title=="string"?_jsx(ContentHeader,{title:_.title}):_.title)();return R.length===0?null:_jsxs(Content,{children:[P,_jsx(DocsCardGrid,{entities:R})]})},le=se=>{const{loading:ae,error:_,entities:H}=useEntityList();if(_)return _jsx(WarningPanel,{severity:"error",title:"Could not load available documentation.",children:_jsx(CodeSnippet,{language:"text",text:_.toString()})});if(ae)return _jsx(Progress,{});if(H.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 T,R;return H.sort((P,K)=>((T=P.metadata.title)!==null&&T!==void 0?T:P.metadata.name).localeCompare((R=K.metadata.title)!==null&&R!==void 0?R:K.metadata.name)),_jsx(Content,{children:(se.groups||[L]).map((P,K)=>_jsx(A,{entities:H,group:P},`${P.title}-${K}`))})}},68435:function(wt,ke,n){"use strict";n.d(ke,{H:function(){return H},n:function(){return T}});var r=n(52322),p=n(2784),z=n(95074),f=n(76635),W=n(53974),g=n(39709),u=n(60871),N=n(25271),ge=n(95573),ue=n(39981),V=n(2337),ne=n(11640),L=n(28347);const A=(0,V.Z)({root:{color:"#f3ba37"}})(ne.Z),le={createCopyDocsUrlAction(R){return P=>({icon:()=>(0,r.jsx)(ue.Z,{fontSize:"small"}),tooltip:"Click to copy documentation link to clipboard",onClick:()=>R(`${window.location.origin}${P.resolved.docsUrl}`)})},createStarEntityAction(R,P){return K=>{const je=K.entity,Le=R(je);return{cellStyle:{paddingLeft:"1em"},icon:()=>Le?(0,r.jsx)(A,{}):(0,r.jsx)(L.Z,{}),tooltip:Le?"Remove from favorites":"Add to favorites",onClick:()=>P(je)}}}};function se(R){return R.metadata.title||R.metadata.name}const ae={createNameColumn(){return{title:"Document",field:"entity.metadata.name",highlight:!0,render:R=>(0,r.jsx)(W.uw,{value:(0,r.jsx)(W.rU,{to:R.resolved.docsUrl,children:se(R.entity)}),subvalue:R.entity.metadata.description})}},createOwnerColumn(){return{title:"Owner",field:"resolved.ownedByRelationsTitle",render:({resolved:R})=>(0,r.jsx)(g.rI,{entityRefs:R.ownedByRelations,defaultKind:"group"})}},createTypeColumn(){return{title:"Type",field:"entity.spec.type"}}};var _=n(51953);const H=R=>{const{entities:P,title:K,loading:je,columns:Le,actions:Z,options:Xe}=R,[,at]=(0,z.Z)(),Rt=(0,u.tg)(ge.Fw),zt=(0,u.h_)(u.Ds);if(!P)return null;const bt=P.map(_e=>{const lt=(0,g.hF)(_e,N.S4);var yt;return{entity:_e,resolved:{docsUrl:Rt({namespace:(0,_.D)((yt=_e.metadata.namespace)!==null&&yt!==void 0?yt:"default",zt),kind:(0,_.D)(_e.kind,zt),name:(0,_.D)(_e.metadata.name,zt)}),ownedByRelations:lt,ownedByRelationsTitle:lt.map(qe=>(0,g.$3)(qe,{defaultKind:"group"})).join(", ")}}}),Zt=[ae.createNameColumn(),ae.createOwnerColumn(),ae.createTypeColumn()],Dt=[le.createCopyDocsUrlAction(at)];return(0,r.jsx)(r.Fragment,{children:je||bt&&bt.length>0?(0,r.jsx)(W.iA,{isLoading:je,options:{paging:!0,pageSize:20,search:!0,actionsColumnIndex:-1,...Xe},data:bt,columns:Le||Zt,actions:Z||Dt,title:K?`${K} (${bt.length})`:`All (${bt.length})`}):(0,r.jsx)(W.ub,{missing:"data",title:"No documents to show",description:"Create your own document. Check out our Getting Started Information",action:(0,r.jsx)(W.Qj,{color:"primary",to:"https://backstage.io/docs/features/techdocs/getting-started",variant:"contained",children:"DOCS"})})})};H.columns=ae,H.actions=le;const T=R=>{var P;const{columns:K,actions:je,options:Le}=R,{loading:Z,error:Xe,entities:at,filters:Rt}=(0,g.wp)(),{isStarredEntity:zt,toggleStarredEntity:bt}=(0,g.CR)(),[,Zt]=(0,z.Z)();var Dt;const _e=(0,f.capitalize)((Dt=(P=Rt.user)===null||P===void 0?void 0:P.value)!==null&&Dt!==void 0?Dt:"all"),lt=[le.createCopyDocsUrlAction(Zt),le.createStarEntityAction(zt,bt)];return Xe?(0,r.jsx)(W.GB,{severity:"error",title:"Could not load available documentation.",children:(0,r.jsx)(W.Oi,{language:"text",text:Xe.toString()})}):(0,r.jsx)(H,{title:_e,entities:at,loading:Z,actions:je||lt,columns:K,options:Le})};T.columns=ae,T.actions=le},18662:function(wt,ke,n){"use strict";n.r(ke),n.d(ke,{TechDocsIndexPage:function(){return W}});var r=n(52322),p=n(2784),z=n(73557),f=n(3482);const W=g=>(0,z.pC)()||(0,r.jsx)(f.u,{...g})},42081:function(wt,ke,n){"use strict";n.d(ke,{j:function(){return W}});var r=n(52322),p=n(2784),z=n(53974),f=n(60871);const W=g=>{const{children:u}=g,N=(0,f.h_)(f.Ds);var ge;const ue=`Documentation available in ${(ge=N.getOptionalString("organization.name"))!==null&&ge!==void 0?ge:"Backstage"}`;return(0,r.jsx)(z.g9,{title:"Documentation",subtitle:ue,themeId:"documentation",children:u})}},48431:function(wt,ke,n){"use strict";n.d(ke,{f:function(){return f}});var r=n(2784),p=n(39709);class z{getCatalogFilters(){return{"metadata.annotations.backstage.io/techdocs-ref":p.n3}}}const f=()=>{const{updateFilters:W}=(0,p.wp)();return(0,r.useEffect)(()=>{W({techdocs:new z})},[W]),null}},89258:function(wt,ke,n){"use strict";n.d(ke,{I6:function(){return V},Jl:function(){return ue},s4:function(){return g}});var r=n(61886),p=n(92077),z=n(95573),f=n(60871),W=n(15096);const g=(0,f.rx)({id:"techdocs",apis:[(0,f.ni)({api:r.Dl,deps:{configApi:f.Ds,discoveryApi:f.NW,identityApi:f.$4,fetchApi:f.gP},factory:({configApi:L,discoveryApi:A,identityApi:le,fetchApi:se})=>new p.k({configApi:L,discoveryApi:A,identityApi:le,fetchApi:se})}),(0,f.ni)({api:r.gT,deps:{configApi:f.Ds,discoveryApi:f.NW,fetchApi:f.gP},factory:({configApi:L,discoveryApi:A,fetchApi:le})=>new p.p({configApi:L,discoveryApi:A,fetchApi:le})})],routes:{root:z._Z,docRoot:z.Fw,entityContent:z.pd}}),u=g.provide((0,f.P4)({name:"TechdocsPage",component:()=>Promise.resolve().then(n.bind(n,52943)).then(L=>L.Router),mountPoint:z._Z})),N=g.provide((0,f.P4)({name:"EntityTechdocsContent",component:()=>Promise.resolve().then(n.bind(n,52943)).then(L=>L.EmbeddedDocsRouter),mountPoint:z.pd})),ge=g.provide((0,f.P4)({name:"TechDocsCustomHome",component:()=>n.e(7560).then(n.bind(n,27560)).then(L=>L.TechDocsCustomHome),mountPoint:z._Z})),ue=g.provide((0,f.P4)({name:"TechDocsIndexPage",component:()=>Promise.resolve().then(n.bind(n,18662)).then(L=>L.TechDocsIndexPage),mountPoint:z._Z})),V=g.provide((0,f.P4)({name:"TechDocsReaderPage",component:()=>Promise.resolve().then(n.bind(n,7476)).then(L=>L.TechDocsReaderPage),mountPoint:z.Fw})),ne=g.provide((0,W.E5)({name:"TechDocsSearchResultListItem",component:()=>Promise.resolve().then(n.bind(n,55511)).then(L=>L.TechDocsSearchResultListItem),predicate:L=>L.type==="techdocs"}))},7476:function(wt,ke,n){"use strict";n.r(ke),n.d(ke,{TechDocsReaderLayout:function(){return V},TechDocsReaderPage:function(){return ne}});var r=n(52322),p=n(2784),z=n(73557),f=n(53974),W=n(61886),g=n(86317),u=n(93225),N=n(65124),ge=n(95573),ue=n(60871);const V=L=>{const{withSearch:A,withHeader:le=!0}=L;return(0,r.jsxs)(f.T3,{themeId:"documentation",children:[le&&(0,r.jsx)(u.S,{}),(0,r.jsx)(N.b,{}),(0,r.jsx)(g.F,{withSearch:A})]})},ne=L=>{const{kind:A,name:le,namespace:se}=(0,ue.Oi)(ge.Fw),{children:ae,entityRef:_={kind:A,name:le,namespace:se}}=L,H=(0,z.pC)();if(!ae){const R=H?p.Children.toArray(H.props.children):[];var T;const K=R.flatMap(je=>{var Le;return(T=je==null||(Le=je.props)===null||Le===void 0?void 0:Le.children)!==null&&T!==void 0?T:[]}).find(je=>!(0,ue.IY)(je,W.Zz)&&!(0,ue.IY)(je,W.jM));return(0,r.jsx)(W.ZS,{entityRef:_,children:K||(0,r.jsx)(V,{})})}return(0,r.jsx)(W.ZS,{entityRef:_,children:({metadata:R,entityMetadata:P,onReady:K})=>(0,r.jsx)("div",{className:"techdocs-reader-page",children:(0,r.jsx)(f.T3,{themeId:"documentation",children:ae instanceof Function?ae({entityRef:_,techdocsMetadataValue:R.value,entityMetadataValue:P.value,onReady:K}):ae})})})}},86317:function(wt,ke,n){"use strict";n.d(ke,{F:function(){return q}});var r=n(52322),p=n(2784),z=n(79692),f=n(60905),W=n(61886),g=n(53974),u=n(22478),N=n(4614),ge=n(77277),ue=n(99688),V=n(12420),ne=n(90436),L=n(61837),A=n(4190),le=n(87685);const se=(0,z.Z)(v=>(0,V.Z)({paper:{width:"100%",[v.breakpoints.up("sm")]:{width:"75%"},[v.breakpoints.up("md")]:{width:"50%"},padding:v.spacing(2.5)},root:{height:"100%",overflow:"hidden"},logs:{background:v.palette.background.default}})),ae=({buildLog:v,onClose:O})=>{const Q=se(),M=v.length===0?"Waiting for logs...":v.join(`
|
|
37
|
-
`);return(0,r.jsxs)(f.Z,{container:!0,direction:"column",className:Q.root,spacing:0,wrap:"nowrap",children:[(0,r.jsxs)(f.Z,{item:!0,container:!0,justifyContent:"space-between",alignItems:"center",spacing:0,wrap:"nowrap",children:[(0,r.jsx)(ne.Z,{variant:"h5",children:"Build Details"}),(0,r.jsx)(L.Z,{title:"Close the drawer",onClick:O,color:"inherit",children:(0,r.jsx)(le.Z,{})},"dismiss")]}),(0,r.jsx)(f.Z,{item:!0,xs:!0,children:(0,r.jsx)(g.nU,{text:M,classes:{root:Q.logs}})})]})},_=({buildLog:v})=>{const O=se(),[Q,M]=(0,p.useState)(!1);return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(ge.Z,{color:"inherit",onClick:()=>M(!0),children:"Show Build Logs"}),(0,r.jsx)(A.ZP,{classes:{paper:O.paper},anchor:"right",open:Q,onClose:()=>M(!1),children:(0,r.jsx)(ae,{buildLog:v,onClose:()=>M(!1)})})]})};var H=n(60871);const T=({errorMessage:v})=>{const O=(0,H.h_)(H.Ds).getOptionalString("techdocs.builder");let Q="";return O!=="local"&&(Q="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,r.jsx)(g.mf,{status:"404",statusMessage:v||"Documentation not found",additionalInfo:Q})};var R=n(95481);const P=(0,z.Z)(v=>({root:{marginBottom:v.spacing(2)},message:{wordBreak:"break-word",overflowWrap:"anywhere"}})),K=()=>{let v=null;const O=P(),{state:Q,contentReload:M,contentErrorMessage:he,syncErrorMessage:ye,buildLog:Me}=(0,R.DK)();return Q==="INITIAL_BUILD"&&(v=(0,r.jsx)(ue.Z,{classes:{root:O.root},variant:"outlined",severity:"info",icon:(0,r.jsx)(N.Z,{size:"24px"}),action:(0,r.jsx)(_,{buildLog:Me}),children:"Documentation is accessed for the first time and is being prepared. The subsequent loads are much faster."})),Q==="CONTENT_STALE_REFRESHING"&&(v=(0,r.jsx)(ue.Z,{variant:"outlined",severity:"info",icon:(0,r.jsx)(N.Z,{size:"24px"}),action:(0,r.jsx)(_,{buildLog:Me}),classes:{root:O.root},children:"A newer version of this documentation is being prepared and will be available shortly."})),Q==="CONTENT_STALE_READY"&&(v=(0,r.jsx)(ue.Z,{variant:"outlined",severity:"success",action:(0,r.jsx)(ge.Z,{color:"inherit",onClick:()=>M(),children:"Refresh"}),classes:{root:O.root},children:"A newer version of this documentation is now available, please refresh to view."})),Q==="CONTENT_STALE_ERROR"&&(v=(0,r.jsxs)(ue.Z,{variant:"outlined",severity:"error",action:(0,r.jsx)(_,{buildLog:Me}),classes:{root:O.root,message:O.message},children:["Building a newer version of this documentation failed."," ",ye]})),Q==="CONTENT_NOT_FOUND"&&(v=(0,r.jsxs)(r.Fragment,{children:[ye&&(0,r.jsxs)(ue.Z,{variant:"outlined",severity:"error",action:(0,r.jsx)(_,{buildLog:Me}),classes:{root:O.root,message:O.message},children:["Building a newer version of this documentation failed."," ",ye]}),(0,r.jsx)(T,{errorMessage:he})]})),v};var je=n(60364),Le=n(41156),Z=n(32838),Xe=n(35368),at=n.n(Xe);const Rt=/main\.[A-Fa-f0-9]{8}\.min\.css$/,zt=/^https:\/\/fonts\.googleapis\.com/,bt=/^https:\/\/fonts\.gstatic\.com/,Zt=v=>v.nodeName==="LINK",Dt=v=>{const O=(v==null?void 0:v.getAttribute("href"))||"",Q=O.match(Rt),M=O.match(zt),he=O.match(bt);return Q||M||he},_e=v=>(Zt(v)&&!Dt(v)&&v.remove(),v),lt=v=>v.nodeName==="IFRAME",yt=(v,O)=>{const Q=v.getAttribute("src")||"";try{const{host:M}=new URL(Q);return O.includes(M)}catch{return!1}},qe=v=>O=>(lt(O)&&!yt(O,v)&&O.remove(),O),Lt=()=>{const v=(0,H.h_)(H.Ds);return(0,p.useMemo)(()=>v.getOptionalConfig("techdocs.sanitizer"),[v])},Vt=()=>{const v=Lt();return(0,p.useCallback)(async O=>{const Q=v==null?void 0:v.getOptionalStringArray("allowedIframeHosts");at().addHook("beforeSanitizeElements",_e);const M=["link"];return Q&&(M.push("iframe"),at().addHook("beforeSanitizeElements",qe(Q))),at().sanitize(O.outerHTML,{ADD_TAGS:M,FORBID_TAGS:["style"],WHOLE_DOCUMENT:!0,RETURN_DOM:!0})},[v])};var be=n(41128),Ce=({theme:v})=>`
|
|
38
|
-
/*================== Variables ==================*/
|
|
39
|
-
/*
|
|
40
|
-
As the MkDocs output is rendered in shadow DOM, the CSS variable definitions on the root selector are not applied. Instead, they have to be applied on :host.
|
|
41
|
-
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.
|
|
42
|
-
*/
|
|
43
|
-
|
|
44
|
-
:host {
|
|
45
|
-
/* FONT */
|
|
46
|
-
--md-default-fg-color: ${v.palette.text.primary};
|
|
47
|
-
--md-default-fg-color--light: ${v.palette.text.secondary};
|
|
48
|
-
--md-default-fg-color--lighter: ${(0,be.$n)(v.palette.text.secondary,.7)};
|
|
49
|
-
--md-default-fg-color--lightest: ${(0,be.$n)(v.palette.text.secondary,.3)};
|
|
50
|
-
|
|
51
|
-
/* BACKGROUND */
|
|
52
|
-
--md-default-bg-color:${v.palette.background.default};
|
|
53
|
-
--md-default-bg-color--light: ${v.palette.background.paper};
|
|
54
|
-
--md-default-bg-color--lighter: ${(0,be.$n)(v.palette.background.paper,.7)};
|
|
55
|
-
--md-default-bg-color--lightest: ${(0,be.$n)(v.palette.background.paper,.3)};
|
|
56
|
-
|
|
57
|
-
/* PRIMARY */
|
|
58
|
-
--md-primary-fg-color: ${v.palette.primary.main};
|
|
59
|
-
--md-primary-fg-color--light: ${v.palette.primary.light};
|
|
60
|
-
--md-primary-fg-color--dark: ${v.palette.primary.dark};
|
|
61
|
-
--md-primary-bg-color: ${v.palette.primary.contrastText};
|
|
62
|
-
--md-primary-bg-color--light: ${(0,be.$n)(v.palette.primary.contrastText,.7)};
|
|
63
|
-
|
|
64
|
-
/* ACCENT */
|
|
65
|
-
--md-accent-fg-color: var(--md-primary-fg-color);
|
|
66
|
-
|
|
67
|
-
/* SHADOW */
|
|
68
|
-
--md-shadow-z1: ${v.shadows[1]};
|
|
69
|
-
--md-shadow-z2: ${v.shadows[2]};
|
|
70
|
-
--md-shadow-z3: ${v.shadows[3]};
|
|
71
|
-
|
|
72
|
-
/* EXTENSIONS */
|
|
73
|
-
--md-admonition-fg-color: var(--md-default-fg-color);
|
|
74
|
-
--md-admonition-bg-color: var(--md-default-bg-color);
|
|
75
|
-
/* Admonitions and others are using SVG masks to define icons. These masks are defined as CSS variables. */
|
|
76
|
-
--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>');
|
|
77
|
-
--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>');
|
|
78
|
-
--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>');
|
|
79
|
-
--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>');
|
|
80
|
-
--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>');
|
|
81
|
-
--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>');
|
|
82
|
-
--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>');
|
|
83
|
-
--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>');
|
|
84
|
-
--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>');
|
|
85
|
-
--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>');
|
|
86
|
-
--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>');
|
|
87
|
-
--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>');
|
|
88
|
-
--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>');
|
|
89
|
-
--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>');
|
|
90
|
-
--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>');
|
|
91
|
-
--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>');
|
|
92
|
-
--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>');
|
|
93
|
-
--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>');
|
|
94
|
-
--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>');
|
|
95
|
-
--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>');
|
|
96
|
-
--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>');
|
|
97
|
-
--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>');
|
|
98
|
-
--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>');
|
|
99
|
-
--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>');
|
|
100
|
-
--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>');
|
|
101
|
-
--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>');
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
:host > * {
|
|
105
|
-
/* CODE */
|
|
106
|
-
--md-code-fg-color: ${v.palette.text.primary};
|
|
107
|
-
--md-code-bg-color: ${v.palette.background.paper};
|
|
108
|
-
--md-code-hl-color: ${(0,be.Fq)(v.palette.warning.main,.5)};
|
|
109
|
-
--md-code-hl-keyword-color: ${v.palette.type==="dark"?v.palette.primary.light:v.palette.primary.dark};
|
|
110
|
-
--md-code-hl-function-color: ${v.palette.type==="dark"?v.palette.secondary.light:v.palette.secondary.dark};
|
|
111
|
-
--md-code-hl-string-color: ${v.palette.type==="dark"?v.palette.success.light:v.palette.success.dark};
|
|
112
|
-
--md-code-hl-number-color: ${v.palette.type==="dark"?v.palette.error.light:v.palette.error.dark};
|
|
113
|
-
--md-code-hl-constant-color: var(--md-code-hl-function-color);
|
|
114
|
-
--md-code-hl-special-color: var(--md-code-hl-function-color);
|
|
115
|
-
--md-code-hl-name-color: var(--md-code-fg-color);
|
|
116
|
-
--md-code-hl-comment-color: var(--md-default-fg-color--light);
|
|
117
|
-
--md-code-hl-generic-color: var(--md-default-fg-color--light);
|
|
118
|
-
--md-code-hl-variable-color: var(--md-default-fg-color--light);
|
|
119
|
-
--md-code-hl-operator-color: var(--md-default-fg-color--light);
|
|
120
|
-
--md-code-hl-punctuation-color: var(--md-default-fg-color--light);
|
|
121
|
-
|
|
122
|
-
/* TYPESET */
|
|
123
|
-
--md-typeset-font-size: 1rem;
|
|
124
|
-
--md-typeset-color: var(--md-default-fg-color);
|
|
125
|
-
--md-typeset-a-color: ${v.palette.link};
|
|
126
|
-
--md-typeset-table-color: ${v.palette.text.primary};
|
|
127
|
-
--md-typeset-del-color: ${v.palette.type==="dark"?(0,be.Fq)(v.palette.error.dark,.5):(0,be.Fq)(v.palette.error.light,.5)};
|
|
128
|
-
--md-typeset-ins-color: ${v.palette.type==="dark"?(0,be.Fq)(v.palette.success.dark,.5):(0,be.Fq)(v.palette.success.light,.5)};
|
|
129
|
-
--md-typeset-mark-color: ${v.palette.type==="dark"?(0,be.Fq)(v.palette.warning.dark,.5):(0,be.Fq)(v.palette.warning.light,.5)};
|
|
130
|
-
}
|
|
131
|
-
|
|
132
|
-
@media screen and (max-width: 76.1875em) {
|
|
133
|
-
:host > * {
|
|
134
|
-
/* TYPESET */
|
|
135
|
-
--md-typeset-font-size: .9rem;
|
|
136
|
-
}
|
|
137
|
-
}
|
|
138
|
-
|
|
139
|
-
@media screen and (max-width: 600px) {
|
|
140
|
-
:host > * {
|
|
141
|
-
/* TYPESET */
|
|
142
|
-
--md-typeset-font-size: .7rem;
|
|
143
|
-
}
|
|
144
|
-
}
|
|
145
|
-
`,Ke=({theme:v})=>`
|
|
146
|
-
/*================== Reset ==================*/
|
|
147
|
-
|
|
148
|
-
body {
|
|
149
|
-
--md-text-color: var(--md-default-fg-color);
|
|
150
|
-
--md-text-link-color: var(--md-accent-fg-color);
|
|
151
|
-
--md-text-font-family: ${v.typography.fontFamily};
|
|
152
|
-
font-family: var(--md-text-font-family);
|
|
153
|
-
background-color: unset;
|
|
154
|
-
}
|
|
155
|
-
`;const Be="224px";var gt=({theme:v,sidebar:O})=>`
|
|
156
|
-
/*================== Layout ==================*/
|
|
157
|
-
|
|
158
|
-
/* mkdocs material v9 compat */
|
|
159
|
-
.md-nav__title {
|
|
160
|
-
color: var(--md-default-fg-color);
|
|
161
|
-
}
|
|
162
|
-
|
|
163
|
-
.md-grid {
|
|
164
|
-
max-width: 100%;
|
|
165
|
-
margin: 0;
|
|
166
|
-
}
|
|
167
|
-
|
|
168
|
-
.md-nav {
|
|
169
|
-
font-size: calc(var(--md-typeset-font-size) * 0.9);
|
|
170
|
-
}
|
|
171
|
-
.md-nav__link {
|
|
172
|
-
display: flex;
|
|
173
|
-
align-items: center;
|
|
174
|
-
justify-content: space-between;
|
|
175
|
-
}
|
|
176
|
-
.md-nav__icon {
|
|
177
|
-
height: 20px !important;
|
|
178
|
-
width: 20px !important;
|
|
179
|
-
margin-left:${v.spacing(1)}px;
|
|
180
|
-
}
|
|
181
|
-
.md-nav__icon svg {
|
|
182
|
-
margin: 0;
|
|
183
|
-
width: 20px !important;
|
|
184
|
-
height: 20px !important;
|
|
185
|
-
}
|
|
186
|
-
.md-nav__icon:after {
|
|
187
|
-
width: 20px !important;
|
|
188
|
-
height: 20px !important;
|
|
189
|
-
}
|
|
190
|
-
|
|
191
|
-
.md-nav__item--active > .md-nav__link, a.md-nav__link--active {
|
|
192
|
-
text-decoration: underline;
|
|
193
|
-
color: var(--md-typeset-a-color);
|
|
194
|
-
}
|
|
195
|
-
|
|
196
|
-
.md-main__inner {
|
|
197
|
-
margin-top: 0;
|
|
198
|
-
}
|
|
199
|
-
|
|
200
|
-
.md-sidebar {
|
|
201
|
-
bottom: 75px;
|
|
202
|
-
position: fixed;
|
|
203
|
-
width: 16rem;
|
|
204
|
-
overflow-y: auto;
|
|
205
|
-
overflow-x: hidden;
|
|
206
|
-
scrollbar-color: rgb(193, 193, 193) #eee;
|
|
207
|
-
scrollbar-width: thin;
|
|
208
|
-
}
|
|
209
|
-
.md-sidebar .md-sidebar__scrollwrap {
|
|
210
|
-
width: calc(12.1rem);
|
|
211
|
-
}
|
|
212
|
-
.md-sidebar--secondary {
|
|
213
|
-
right: ${v.spacing(3)}px;
|
|
214
|
-
}
|
|
215
|
-
.md-sidebar::-webkit-scrollbar {
|
|
216
|
-
width: 5px;
|
|
217
|
-
}
|
|
218
|
-
.md-sidebar::-webkit-scrollbar-button {
|
|
219
|
-
width: 5px;
|
|
220
|
-
height: 5px;
|
|
221
|
-
}
|
|
222
|
-
.md-sidebar::-webkit-scrollbar-track {
|
|
223
|
-
background: #eee;
|
|
224
|
-
border: 1 px solid rgb(250, 250, 250);
|
|
225
|
-
box-shadow: 0px 0px 3px #dfdfdf inset;
|
|
226
|
-
border-radius: 3px;
|
|
227
|
-
}
|
|
228
|
-
.md-sidebar::-webkit-scrollbar-thumb {
|
|
229
|
-
width: 5px;
|
|
230
|
-
background: rgb(193, 193, 193);
|
|
231
|
-
border: transparent;
|
|
232
|
-
border-radius: 3px;
|
|
233
|
-
}
|
|
234
|
-
.md-sidebar::-webkit-scrollbar-thumb:hover {
|
|
235
|
-
background: rgb(125, 125, 125);
|
|
236
|
-
}
|
|
237
|
-
|
|
238
|
-
.md-content {
|
|
239
|
-
max-width: calc(100% - 16rem * 2);
|
|
240
|
-
margin-left: 16rem;
|
|
241
|
-
margin-bottom: 50px;
|
|
242
|
-
}
|
|
243
|
-
|
|
244
|
-
.md-footer {
|
|
245
|
-
position: fixed;
|
|
246
|
-
bottom: 0px;
|
|
247
|
-
pointer-events: none;
|
|
248
|
-
}
|
|
249
|
-
|
|
250
|
-
.md-footer-nav__link, .md-footer__link {
|
|
251
|
-
pointer-events: all;
|
|
252
|
-
}
|
|
253
|
-
|
|
254
|
-
.md-footer__title {
|
|
255
|
-
background-color: unset;
|
|
256
|
-
}
|
|
257
|
-
.md-footer-nav__link {
|
|
258
|
-
width: 16rem;
|
|
259
|
-
}
|
|
260
|
-
|
|
261
|
-
.md-dialog {
|
|
262
|
-
background-color: unset;
|
|
263
|
-
}
|
|
264
|
-
|
|
265
|
-
@media screen and (min-width: 76.25em) {
|
|
266
|
-
.md-sidebar {
|
|
267
|
-
height: auto;
|
|
268
|
-
}
|
|
269
|
-
}
|
|
270
|
-
|
|
271
|
-
@media screen and (max-width: 76.1875em) {
|
|
272
|
-
.md-nav {
|
|
273
|
-
transition: none !important;
|
|
274
|
-
background-color: var(--md-default-bg-color)
|
|
275
|
-
}
|
|
276
|
-
.md-nav--primary .md-nav__title {
|
|
277
|
-
cursor: auto;
|
|
278
|
-
color: var(--md-default-fg-color);
|
|
279
|
-
font-weight: 700;
|
|
280
|
-
white-space: normal;
|
|
281
|
-
line-height: 1rem;
|
|
282
|
-
height: auto;
|
|
283
|
-
display: flex;
|
|
284
|
-
flex-flow: column;
|
|
285
|
-
row-gap: 1.6rem;
|
|
286
|
-
padding: 1.2rem .8rem .8rem;
|
|
287
|
-
background-color: var(--md-default-bg-color);
|
|
288
|
-
}
|
|
289
|
-
.md-nav--primary .md-nav__title~.md-nav__list {
|
|
290
|
-
box-shadow: none;
|
|
291
|
-
}
|
|
292
|
-
.md-nav--primary .md-nav__title ~ .md-nav__list > :first-child {
|
|
293
|
-
border-top: none;
|
|
294
|
-
}
|
|
295
|
-
.md-nav--primary .md-nav__title .md-nav__button {
|
|
296
|
-
display: none;
|
|
297
|
-
}
|
|
298
|
-
.md-nav--primary .md-nav__title .md-nav__icon {
|
|
299
|
-
color: var(--md-default-fg-color);
|
|
300
|
-
position: static;
|
|
301
|
-
height: auto;
|
|
302
|
-
margin: 0 0 0 -0.2rem;
|
|
303
|
-
}
|
|
304
|
-
.md-nav--primary > .md-nav__title [for="none"] {
|
|
305
|
-
padding-top: 0;
|
|
306
|
-
}
|
|
307
|
-
.md-nav--primary .md-nav__item {
|
|
308
|
-
border-top: none;
|
|
309
|
-
}
|
|
310
|
-
.md-nav--primary :is(.md-nav__title,.md-nav__item) {
|
|
311
|
-
font-size : var(--md-typeset-font-size);
|
|
312
|
-
}
|
|
313
|
-
.md-nav .md-source {
|
|
314
|
-
display: none;
|
|
315
|
-
}
|
|
316
|
-
|
|
317
|
-
.md-sidebar {
|
|
318
|
-
height: 100%;
|
|
319
|
-
}
|
|
320
|
-
.md-sidebar--primary {
|
|
321
|
-
width: 12.1rem !important;
|
|
322
|
-
z-index: 200;
|
|
323
|
-
left: ${O.isPinned?`calc(-12.1rem + ${Be})`:"calc(-12.1rem + 72px)"} !important;
|
|
324
|
-
}
|
|
325
|
-
.md-sidebar--secondary:not([hidden]) {
|
|
326
|
-
display: none;
|
|
327
|
-
}
|
|
328
|
-
|
|
329
|
-
.md-content {
|
|
330
|
-
max-width: 100%;
|
|
331
|
-
margin-left: 0;
|
|
332
|
-
}
|
|
333
|
-
|
|
334
|
-
.md-header__button {
|
|
335
|
-
margin: 0.4rem 0;
|
|
336
|
-
margin-left: 0.4rem;
|
|
337
|
-
padding: 0;
|
|
338
|
-
}
|
|
339
|
-
|
|
340
|
-
.md-overlay {
|
|
341
|
-
left: 0;
|
|
342
|
-
}
|
|
343
|
-
|
|
344
|
-
.md-footer {
|
|
345
|
-
position: static;
|
|
346
|
-
padding-left: 0;
|
|
347
|
-
}
|
|
348
|
-
.md-footer-nav__link {
|
|
349
|
-
/* footer links begin to overlap at small sizes without setting width */
|
|
350
|
-
width: 50%;
|
|
351
|
-
}
|
|
352
|
-
}
|
|
353
|
-
|
|
354
|
-
@media screen and (max-width: 600px) {
|
|
355
|
-
.md-sidebar--primary {
|
|
356
|
-
left: -12.1rem !important;
|
|
357
|
-
width: 12.1rem;
|
|
358
|
-
}
|
|
359
|
-
}
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
@media print {
|
|
363
|
-
.md-sidebar,
|
|
364
|
-
#toggle-sidebar {
|
|
365
|
-
display: none;
|
|
366
|
-
}
|
|
367
|
-
|
|
368
|
-
.md-content {
|
|
369
|
-
margin: 0;
|
|
370
|
-
width: 100%;
|
|
371
|
-
max-width: 100%;
|
|
372
|
-
}
|
|
373
|
-
}
|
|
374
|
-
`;const xt=["h1","h2","h3","h4","h5","h6"];var nt=({theme:v})=>`
|
|
375
|
-
/*================== Typeset ==================*/
|
|
376
|
-
|
|
377
|
-
.md-typeset {
|
|
378
|
-
font-size: var(--md-typeset-font-size);
|
|
379
|
-
}
|
|
380
|
-
|
|
381
|
-
${xt.reduce((O,Q)=>{var M;const he=(M=v.typography.htmlFontSize)!==null&&M!==void 0?M:16,ye=v.typography[Q],{lineHeight:Me,fontFamily:ot,fontWeight:dt,fontSize:At}=ye,jt=st=>{let Fe=1;return typeof st=="number"&&(Fe=st/he*.6),typeof st=="string"&&(Fe=st.replace("rem","")),`calc(${Fe} * var(--md-typeset-font-size))`};return O.concat(`
|
|
382
|
-
.md-typeset ${Q} {
|
|
383
|
-
color: var(--md-default-fg-color);
|
|
384
|
-
line-height: ${Me};
|
|
385
|
-
font-family: ${ot};
|
|
386
|
-
font-weight: ${dt};
|
|
387
|
-
font-size: ${jt(At)};
|
|
388
|
-
}
|
|
389
|
-
`)},"")}
|
|
390
|
-
|
|
391
|
-
.md-typeset .md-content__button {
|
|
392
|
-
color: var(--md-default-fg-color);
|
|
393
|
-
}
|
|
394
|
-
|
|
395
|
-
.md-typeset hr {
|
|
396
|
-
border-bottom: 0.05rem dotted ${v.palette.divider};
|
|
397
|
-
}
|
|
398
|
-
|
|
399
|
-
.md-typeset details {
|
|
400
|
-
font-size: var(--md-typeset-font-size) !important;
|
|
401
|
-
}
|
|
402
|
-
.md-typeset details summary {
|
|
403
|
-
padding-left: 2.5rem !important;
|
|
404
|
-
}
|
|
405
|
-
.md-typeset details summary:before,
|
|
406
|
-
.md-typeset details summary:after {
|
|
407
|
-
top: 50% !important;
|
|
408
|
-
width: 20px !important;
|
|
409
|
-
height: 20px !important;
|
|
410
|
-
transform: rotate(0deg) translateY(-50%) !important;
|
|
411
|
-
}
|
|
412
|
-
.md-typeset details[open] > summary:after {
|
|
413
|
-
transform: rotate(90deg) translateX(-50%) !important;
|
|
414
|
-
}
|
|
415
|
-
|
|
416
|
-
.md-typeset blockquote {
|
|
417
|
-
color: var(--md-default-fg-color--light);
|
|
418
|
-
border-left: 0.2rem solid var(--md-default-fg-color--light);
|
|
419
|
-
}
|
|
420
|
-
|
|
421
|
-
.md-typeset table:not([class]) {
|
|
422
|
-
font-size: var(--md-typeset-font-size);
|
|
423
|
-
border: 1px solid var(--md-default-fg-color);
|
|
424
|
-
border-bottom: none;
|
|
425
|
-
border-collapse: collapse;
|
|
426
|
-
}
|
|
427
|
-
.md-typeset table:not([class]) th {
|
|
428
|
-
font-weight: bold;
|
|
429
|
-
}
|
|
430
|
-
.md-typeset table:not([class]) td, .md-typeset table:not([class]) th {
|
|
431
|
-
border-bottom: 1px solid var(--md-default-fg-color);
|
|
432
|
-
}
|
|
433
|
-
|
|
434
|
-
.md-typeset pre > code::-webkit-scrollbar-thumb {
|
|
435
|
-
background-color: hsla(0, 0%, 0%, 0.32);
|
|
436
|
-
}
|
|
437
|
-
.md-typeset pre > code::-webkit-scrollbar-thumb:hover {
|
|
438
|
-
background-color: hsla(0, 0%, 0%, 0.87);
|
|
439
|
-
}
|
|
440
|
-
`,Ye=()=>`
|
|
441
|
-
/*================== Animations ==================*/
|
|
442
|
-
/*
|
|
443
|
-
Disable CSS animations on link colors as they lead to issues in dark mode.
|
|
444
|
-
The dark mode color theme is applied later and theirfore there is always an animation from light to dark mode when navigation between pages.
|
|
445
|
-
*/
|
|
446
|
-
.md-dialog, .md-nav__link, .md-footer__link, .md-typeset a, .md-typeset a::before, .md-typeset .headerlink {
|
|
447
|
-
transition: none;
|
|
448
|
-
}
|
|
449
|
-
`,Ge=({theme:v})=>`
|
|
450
|
-
/*================== Extensions ==================*/
|
|
451
|
-
|
|
452
|
-
/* HIGHLIGHT */
|
|
453
|
-
.highlight .md-clipboard:after {
|
|
454
|
-
content: unset;
|
|
455
|
-
}
|
|
456
|
-
|
|
457
|
-
.highlight .nx {
|
|
458
|
-
color: ${v.palette.type==="dark"?"#ff53a3":"#ec407a"};
|
|
459
|
-
}
|
|
460
|
-
|
|
461
|
-
/* CODE HILITE */
|
|
462
|
-
.codehilite .gd {
|
|
463
|
-
background-color: ${v.palette.type==="dark"?"rgba(248,81,73,0.65)":"#fdd"};
|
|
464
|
-
}
|
|
465
|
-
|
|
466
|
-
.codehilite .gi {
|
|
467
|
-
background-color: ${v.palette.type==="dark"?"rgba(46,160,67,0.65)":"#dfd"};
|
|
468
|
-
}
|
|
469
|
-
|
|
470
|
-
/* TABBED */
|
|
471
|
-
.tabbed-set>input:nth-child(1):checked~.tabbed-labels>:nth-child(1),
|
|
472
|
-
.tabbed-set>input:nth-child(2):checked~.tabbed-labels>:nth-child(2),
|
|
473
|
-
.tabbed-set>input:nth-child(3):checked~.tabbed-labels>:nth-child(3),
|
|
474
|
-
.tabbed-set>input:nth-child(4):checked~.tabbed-labels>:nth-child(4),
|
|
475
|
-
.tabbed-set>input:nth-child(5):checked~.tabbed-labels>:nth-child(5),
|
|
476
|
-
.tabbed-set>input:nth-child(6):checked~.tabbed-labels>:nth-child(6),
|
|
477
|
-
.tabbed-set>input:nth-child(7):checked~.tabbed-labels>:nth-child(7),
|
|
478
|
-
.tabbed-set>input:nth-child(8):checked~.tabbed-labels>:nth-child(8),
|
|
479
|
-
.tabbed-set>input:nth-child(9):checked~.tabbed-labels>:nth-child(9),
|
|
480
|
-
.tabbed-set>input:nth-child(10):checked~.tabbed-labels>:nth-child(10),
|
|
481
|
-
.tabbed-set>input:nth-child(11):checked~.tabbed-labels>:nth-child(11),
|
|
482
|
-
.tabbed-set>input:nth-child(12):checked~.tabbed-labels>:nth-child(12),
|
|
483
|
-
.tabbed-set>input:nth-child(13):checked~.tabbed-labels>:nth-child(13),
|
|
484
|
-
.tabbed-set>input:nth-child(14):checked~.tabbed-labels>:nth-child(14),
|
|
485
|
-
.tabbed-set>input:nth-child(15):checked~.tabbed-labels>:nth-child(15),
|
|
486
|
-
.tabbed-set>input:nth-child(16):checked~.tabbed-labels>:nth-child(16),
|
|
487
|
-
.tabbed-set>input:nth-child(17):checked~.tabbed-labels>:nth-child(17),
|
|
488
|
-
.tabbed-set>input:nth-child(18):checked~.tabbed-labels>:nth-child(18),
|
|
489
|
-
.tabbed-set>input:nth-child(19):checked~.tabbed-labels>:nth-child(19),
|
|
490
|
-
.tabbed-set>input:nth-child(20):checked~.tabbed-labels>:nth-child(20) {
|
|
491
|
-
color: var(--md-accent-fg-color);
|
|
492
|
-
border-color: var(--md-accent-fg-color);
|
|
493
|
-
}
|
|
494
|
-
|
|
495
|
-
/* TASK-LIST */
|
|
496
|
-
.task-list-control .task-list-indicator::before {
|
|
497
|
-
background-color: ${v.palette.action.disabledBackground};
|
|
498
|
-
}
|
|
499
|
-
.task-list-control [type="checkbox"]:checked + .task-list-indicator:before {
|
|
500
|
-
background-color: ${v.palette.success.main};
|
|
501
|
-
}
|
|
502
|
-
|
|
503
|
-
/* ADMONITION */
|
|
504
|
-
.admonition {
|
|
505
|
-
font-size: var(--md-typeset-font-size) !important;
|
|
506
|
-
}
|
|
507
|
-
.admonition .admonition-title {
|
|
508
|
-
padding-left: 2.5rem !important;
|
|
509
|
-
}
|
|
510
|
-
|
|
511
|
-
.admonition .admonition-title:before {
|
|
512
|
-
top: 50% !important;
|
|
513
|
-
width: 20px !important;
|
|
514
|
-
height: 20px !important;
|
|
515
|
-
transform: translateY(-50%) !important;
|
|
516
|
-
}
|
|
517
|
-
`;const ct=[Ce,Ke,gt,nt,Ye,Ge],ut=()=>(0,g.Pf)(),ln=()=>{const v=ut(),O=(0,je.Z)();return(0,p.useMemo)(()=>{const Q={theme:O,sidebar:v};return ct.reduce((M,he)=>M+he(Q),"")},[O,v])},cn=()=>{const v=ln();return(0,p.useCallback)(O=>(O.getElementsByTagName("head")[0].insertAdjacentHTML("beforeend",`<style>${v}</style>`),O),[v])},dn=(v,O,Q)=>{const M=v==="src"&&O.endsWith(".svg"),he=!O.match(/^([a-z]*:)?\/\//i),ye=O.startsWith(Q);return M&&(he||ye)},Ht=({techdocsStorageApi:v,entityId:O,path:Q})=>async M=>{const he=await v.getApiOrigin(),ye=async(Me,ot)=>{for(const dt of Me)if(dt.hasAttribute(ot)){const At=dt.getAttribute(ot);if(!At)return;const jt=await v.getBaseUrl(At,O,Q);if(dn(ot,At,he))try{const Fe=await(await fetch(jt,{credentials:"include"})).text();dt.setAttribute(ot,`data:image/svg+xml;base64,${btoa(unescape(encodeURIComponent(Fe)))}`)}catch{dt.setAttribute("alt",`Error: ${At}`)}else dt.setAttribute(ot,jt)}};return await Promise.all([ye(M.querySelectorAll("img"),"src"),ye(M.querySelectorAll("script"),"src"),ye(M.querySelectorAll("source"),"src"),ye(M.querySelectorAll("link"),"href"),ye(M.querySelectorAll("a[download]"),"href")]),M};var Sn=n(40556),Qt=n(67097),Xt=n(28316),Cn=n(82717),tn=n.n(Cn);const Tn=v=>O=>{var Q;const M=O.querySelector('[title="Edit this page"]');if(!M||!M.href)return O;const he=new URL(M.href),ye=v.byUrl(he);if((ye==null?void 0:ye.type)!=="github"&&(ye==null?void 0:ye.type)!=="gitlab")return O;const Me=((Q=O.querySelector("article>h1"))===null||Q===void 0?void 0:Q.childNodes[0].textContent)||"",ot=encodeURIComponent(`Documentation Feedback: ${Me}`),dt=encodeURIComponent(`Page source:
|
|
518
|
-
${M.href}
|
|
519
|
-
|
|
520
|
-
Feedback:`),At=(ye==null?void 0:ye.type)==="github"?(0,Sn.BT)(he.href,"blob"):he.href,jt=tn()(At),st=`/${jt.organization}/${jt.name}`,Fe=M.cloneNode();switch(ye==null?void 0:ye.type){case"gitlab":Fe.href=`${he.origin}${st}/issues/new?issue[title]=${ot}&issue[description]=${dt}`;break;case"github":Fe.href=`${he.origin}${st}/issues/new?title=${ot}&body=${dt}`;break;default:return O}return Xt.render(p.createElement(Qt.Z),Fe),Fe.style.paddingLeft="5px",Fe.title="Leave feedback for this page",Fe.id="git-feedback-link",M==null||M.insertAdjacentElement("beforebegin",Fe),O};var $n=n(44882);const et=()=>v=>{const O=v.querySelector('.md-header label[for="__drawer"]'),Q=v.querySelector("article");if(!O||!Q)return v;const M=O.cloneNode();return Xt.render(p.createElement($n.Z),M),M.id="toggle-sidebar",M.title="Toggle Sidebar",M.classList.add("md-content__button"),M.style.setProperty("padding","0 0 0 5px"),M.style.setProperty("margin","0.4rem 0 0.4rem 0.4rem"),Q==null||Q.prepend(M),v},nn=()=>v=>(((Q,M)=>{Array.from(Q).filter(he=>he.hasAttribute(M)).forEach(he=>{const ye=he.getAttribute(M);if(ye){ye.match(/^https?:\/\//i)&&he.setAttribute("target","_blank");try{const Me=Gt(window.location.href);he.setAttribute(M,new URL(ye,Me).toString())}catch{he.replaceWith(he.textContent||ye)}}})})(Array.from(v.getElementsByTagName("a")),"href"),v);function Gt(v){const O=new URL(v);return!O.pathname.endsWith("/")&&!O.pathname.endsWith(".html")&&(O.pathname+="/"),O.toString()}const rt=({baseUrl:v,onClick:O})=>Q=>(Array.from(Q.getElementsByTagName("a")).forEach(M=>{M.addEventListener("click",he=>{const Me=M.getAttribute("href");Me&&Me.startsWith(v)&&!M.hasAttribute("download")&&(he.preventDefault(),O(he,Me))})}),Q);var Dn=n(15459),un=n(80030),Pn=n(72379),wn=n(41547),jn=n(95074);const Fn=(0,Dn.Z)(v=>({tooltip:{fontSize:"inherit",color:v.palette.text.primary,margin:0,padding:v.spacing(.5),backgroundColor:"transparent",boxShadow:"none"}}))(un.ZP),Rn=()=>(0,r.jsx)(Pn.Z,{children:(0,r.jsx)("path",{d:"M16 1H4c-1.1 0-2 .9-2 2v14h2V3h12V1zm3 4H8c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h11c1.1 0 2-.9 2-2V7c0-1.1-.9-2-2-2zm0 16H8V7h11v14z"})}),Zn=({text:v})=>{const[O,Q]=(0,p.useState)(!1),[,M]=(0,jn.Z)(),he=(0,p.useCallback)(()=>{M(v),Q(!0)},[v,M]),ye=(0,p.useCallback)(()=>{Q(!1)},[Q]);return(0,r.jsx)(Fn,{title:"Copied to clipboard",placement:"left",open:O,onClose:ye,leaveDelay:1e3,children:(0,r.jsx)(L.Z,{style:{color:"inherit"},className:"md-clipboard md-icon",onClick:he,children:(0,r.jsx)(Rn,{})})})},Se=v=>O=>{const Q=O.querySelectorAll("pre > code");for(const he of Q){var M;const ye=he.textContent||"",Me=document.createElement("div");he==null||(M=he.parentElement)===null||M===void 0||M.prepend(Me),Xt.render((0,r.jsx)(wn.Z,{theme:v,children:(0,r.jsx)(Zn,{text:ye})}),Me)}return O},de=()=>v=>{var O;return(O=v.querySelector(".md-header"))===null||O===void 0||O.remove(),v},Ie=()=>v=>{var O,Q;return(O=v.querySelector(".md-footer .md-copyright"))===null||O===void 0||O.remove(),(Q=v.querySelector(".md-footer-copyright"))===null||Q===void 0||Q.remove(),v},G=({onLoading:v,onLoaded:O})=>Q=>(v(),Q.addEventListener(W.Ox,function M(){O(),Q.removeEventListener(W.Ox,M)}),Q),k=()=>v=>(v.addEventListener(W.Ox,function O(){if(window.location.hash){var Q;const M=window.location.hash.slice(1);(Q=v==null?void 0:v.querySelector(`[id="${M}"]`))===null||Q===void 0||Q.scrollIntoView()}v.removeEventListener(W.Ox,O)}),v),ce=()=>v=>(setTimeout(()=>{const O=v==null?void 0:v.querySelectorAll("li.md-nav__item--active");O.length!==0&&(O.forEach(M=>{const he=M==null?void 0:M.querySelector("input");he!=null&&he.checked||he==null||he.click()}),O[O.length-1].scrollIntoView())},200),v),Pe=async(v,O)=>{let Q;if(typeof v=="string")Q=new DOMParser().parseFromString(v,"text/html").documentElement;else if(v instanceof Element)Q=v;else throw new Error("dom is not a recognized type");for(const M of O)Q=await M(Q);return Q};var Ue=n(73557);function We(v,O){const Q=new URL(O),M=`${Q.origin}${Q.pathname.replace(/\/$/,"")}`,he=v.replace(M,"").replace(/^\/+/,""),ye=new URL(`http://localhost/${he}`);return`${ye.pathname}${ye.search}${ye.hash}`}function St(){const v=(0,Ue.s0)(),Q=(0,H.h_)(H.Ds).getOptionalString("app.baseUrl");return(0,p.useCallback)(he=>{let ye=he;if(Q)try{ye=We(he,Q)}catch{}v(ye)},[v,Q])}const Ot="screen and (max-width: 76.1875em)",qt=v=>{const O=St(),Q=(0,je.Z)(),M=(0,Le.Z)(Ot),he=Vt(),ye=cn(),Me=(0,H.z$)(),ot=(0,H.h_)(W.Dl),dt=(0,H.h_)(Z.q3),{state:At,path:jt,content:st}=(0,R.DK)(),[Fe,Ut]=(0,p.useState)(null),Yt=(0,W.ux)(Fe),Ct=(0,p.useCallback)(()=>{if(!Fe)return;Fe.querySelectorAll(".md-sidebar").forEach(He=>{if(M)He.style.top="0px";else{const sr=document==null?void 0:document.querySelector(".techdocs-reader-page");var Pt;const fr=(Pt=sr==null?void 0:sr.getBoundingClientRect().top)!==null&&Pt!==void 0?Pt:0;var mn;let Gn=(mn=Fe.getBoundingClientRect().top)!==null&&mn!==void 0?mn:0;const sn=Fe.querySelector(".md-container > .md-tabs");var en;const ir=(en=sn==null?void 0:sn.getBoundingClientRect().height)!==null&&en!==void 0?en:0;Gn<fr&&(Gn=fr),He.style.top=`${Math.max(Gn,0)+ir}px`}He.style.setProperty("opacity","1")})},[Fe,M]);(0,p.useEffect)(()=>(window.addEventListener("resize",Ct),window.addEventListener("scroll",Ct,!0),()=>{window.removeEventListener("resize",Ct),window.removeEventListener("scroll",Ct,!0)}),[Fe,Ct]);const Nt=(0,p.useCallback)(()=>{if(!Fe)return;const mt=Fe.querySelector(".md-footer");mt&&(mt.style.width=`${Fe.getBoundingClientRect().width}px`)},[Fe]);(0,p.useEffect)(()=>(window.addEventListener("resize",Nt),()=>{window.removeEventListener("resize",Nt)}),[Fe,Nt]),(0,p.useEffect)(()=>{Yt||(Nt(),Ct())},[At,Yt,Nt,Ct]);const hn=(0,p.useCallback)((mt,He)=>Pe(mt,[he,Ht({techdocsStorageApi:ot,entityId:v,path:He}),nn(),et(),de(),Ie(),Tn(dt),ye]),[v,dt,ot,he,ye]),yn=(0,p.useCallback)(async mt=>Pe(mt,[k(),ce(),Se(Q),rt({baseUrl:window.location.origin,onClick:(He,Pt)=>{var mn;const en=He.ctrlKey||He.metaKey,sr=new URL(Pt),fr=((mn=He.target)===null||mn===void 0?void 0:mn.innerText)||Pt,Gn=Pt.replace(window.location.origin,"");if(Me.captureEvent("click",fr,{attributes:{to:Gn}}),sr.hash)if(en)window.open(Pt,"_blank");else{var sn;O(Pt),(sn=mt==null?void 0:mt.querySelector(`[id="${sr.hash.slice(1)}"]`))===null||sn===void 0||sn.scrollIntoView()}else en?window.open(Pt,"_blank"):O(Pt)}}),G({onLoading:()=>{},onLoaded:()=>{var He;(He=mt.querySelector(".md-nav__title"))===null||He===void 0||He.removeAttribute("for")}}),G({onLoading:()=>{Array.from(mt.querySelectorAll(".md-sidebar")).forEach(Pt=>{Pt.style.setProperty("opacity","0")})},onLoaded:()=>{}})]),[Q,O,Me]);return(0,p.useEffect)(()=>{if(!st)return()=>{};let mt=!0;return hn(st,jt).then(async He=>{if(!(He!=null&&He.innerHTML)||!mt)return;window.scroll({top:0});const Pt=await yn(He);Ut(Pt)}),()=>{mt=!1}},[st,jt,hn,yn]),Fe};var Kt=n(8560);const _t=()=>{const v=(0,W.$L)(),{shadowRoot:O}=(0,W.x1)(),Q=O==null?void 0:O.querySelector('[data-md-component="content"]'),M=O==null?void 0:O.querySelector('div[data-md-component="sidebar"][data-md-type="navigation"], div[data-md-component="navigation"]');let he=M==null?void 0:M.querySelector('[data-techdocs-addons-location="primary sidebar"]');he||(he=document.createElement("div"),he.setAttribute("data-techdocs-addons-location","primary sidebar"),M==null||M.prepend(he));const ye=O==null?void 0:O.querySelector('div[data-md-component="sidebar"][data-md-type="toc"], div[data-md-component="toc"]');let Me=ye==null?void 0:ye.querySelector('[data-techdocs-addons-location="secondary sidebar"]');return Me||(Me=document.createElement("div"),Me.setAttribute("data-techdocs-addons-location","secondary sidebar"),ye==null||ye.prepend(Me)),(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(Kt.Z,{container:he,children:v.renderComponentsByLocation(W.oZ.PrimarySidebar)}),(0,r.jsx)(Kt.Z,{container:Q,children:v.renderComponentsByLocation(W.oZ.Content)}),(0,r.jsx)(Kt.Z,{container:Me,children:v.renderComponentsByLocation(W.oZ.SecondarySidebar)})]})},ee=(0,z.Z)({search:{width:"100%","@media (min-width: 76.1875em)":{width:"calc(100% - 34.4rem)",margin:"0 auto"},"@media print":{display:"none"}}}),q=(0,R.m1)(v=>{var O;const{withSearch:Q=!0,onReady:M}=v,he=ee(),{entityMetadata:{value:ye,loading:Me},entityRef:ot,setShadowRoot:dt}=(0,W.x1)(),At=qt(ot),jt=(0,p.useCallback)(st=>{dt(st),M instanceof Function&&M()},[dt,M]);return Me===!1&&!ye?(0,r.jsx)(g.mf,{status:"404",statusMessage:"PAGE NOT FOUND"}):At?(0,r.jsx)(g.VY,{children:(0,r.jsxs)(f.Z,{container:!0,children:[(0,r.jsx)(f.Z,{xs:12,item:!0,children:(0,r.jsx)(K,{})}),Q&&(0,r.jsx)(f.Z,{className:he.search,xs:"auto",item:!0,children:(0,r.jsx)(u.S,{entityId:ot,entityTitle:ye==null||(O=ye.metadata)===null||O===void 0?void 0:O.title})}),(0,r.jsx)(f.Z,{xs:12,item:!0,children:(0,r.jsx)(W.VA,{element:At,onAppend:jt,children:(0,r.jsx)(_t,{})})})]})}):(0,r.jsx)(g.VY,{children:(0,r.jsx)(f.Z,{container:!0,children:(0,r.jsx)(f.Z,{xs:12,item:!0,children:(0,r.jsx)(K,{})})})})}),te=null},93225:function(wt,ke,n){"use strict";n.d(ke,{S:function(){return se}});var r=n(52322),p=n(2784),z=n(18671),f=n(60905),W=n(98069),g=n(60364),u=n(73250),N=n(61886),ge=n(39709),ue=n(25271),V=n(53974),ne=n(60871),L=n(76635),A=n(95573);const le=(0,r.jsx)(W.Z,{animation:"wave",variant:"text",height:40}),se=ae=>{const{palette:{common:{white:_}}}=(0,g.Z)(),{children:H}=ae,T=(0,N.$L)(),R=(0,ne.h_)(ne.Ds),{title:P,setTitle:K,subtitle:je,setSubtitle:Le,entityRef:Z,metadata:{value:Xe,loading:at},entityMetadata:{value:Rt,loading:zt}}=(0,N.x1)();(0,p.useEffect)(()=>{Xe&&(K(Xe.site_name),Le(()=>{let{site_description:Ce}=Xe;return(!Ce||Ce==="None")&&(Ce=""),Ce}))},[Xe,K,Le]);const bt=R.getOptional("app.title")||"Backstage",Zt=[P,je,bt].filter(Boolean).join(" | "),{locationMetadata:Dt,spec:_e}=Rt||{},lt=_e==null?void 0:_e.lifecycle,yt=Rt?(0,ge.hF)(Rt,ue.S4):[],qe=(0,ne.tg)(A._Z)(),Lt=(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(V.i9,{label:(0,L.capitalize)((Rt==null?void 0:Rt.kind)||"entity"),value:(0,r.jsx)(ge.dx,{color:"inherit",entityRef:Z,title:Rt==null?void 0:Rt.metadata.title,defaultKind:"Component"})}),yt.length>0&&(0,r.jsx)(V.i9,{label:"Owner",value:(0,r.jsx)(ge.rI,{color:"inherit",entityRefs:yt,defaultKind:"group"})}),lt?(0,r.jsx)(V.i9,{label:"Lifecycle",value:lt}):null,Dt&&Dt.type!=="dir"&&Dt.type!=="file"?(0,r.jsx)(V.i9,{label:"",value:(0,r.jsxs)(f.Z,{container:!0,direction:"column",alignItems:"center",style:{color:_},children:[(0,r.jsx)(f.Z,{style:{padding:0},item:!0,children:(0,r.jsx)(u.Z,{style:{marginTop:"-25px"}})}),(0,r.jsx)(f.Z,{style:{padding:0},item:!0,children:"Source"})]}),url:Dt.target}):null]});return!zt&&Rt===void 0||!at&&Xe===void 0?null:(0,r.jsxs)(V.h4,{type:"Documentation",typeLink:qe,title:P||le,subtitle:je===""?void 0:je||le,children:[(0,r.jsx)(z.Z,{titleTemplate:"%s",children:(0,r.jsx)("title",{children:Zt})}),Lt,H,T.renderComponentsByLocation(N.oZ.Header)]})}},65124:function(wt,ke,n){"use strict";n.d(ke,{b:function(){return ne}});var r=n(52322),p=n(2784),z=n(79692),f=n(15223),W=n(95544),g=n(80030),u=n(61837),N=n(48348),ge=n(47603),ue=n(61886);const V=(0,z.Z)(L=>({root:{gridArea:"pageSubheader",flexDirection:"column",minHeight:"auto",padding:L.spacing(3,3,0),"@media print":{display:"none"}}})),ne=L=>{const A=V(),[le,se]=(0,p.useState)(null),ae=(0,p.useCallback)(je=>{se(je.currentTarget)},[]),_=(0,p.useCallback)(()=>{se(null)},[]),{entityMetadata:{value:H,loading:T}}=(0,ue.x1)(),R=(0,ue.$L)(),P=R.renderComponentsByLocation(ue.oZ.Subheader),K=R.renderComponentsByLocation(ue.oZ.Settings);return!P&&!K||T===!1&&!H?null:(0,r.jsx)(f.Z,{classes:A,...L.toolbarProps,children:(0,r.jsxs)(W.Z,{display:"flex",justifyContent:"flex-end",width:"100%",flexWrap:"wrap",children:[P,K?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(g.ZP,{title:"Settings",children:(0,r.jsx)(u.Z,{"aria-controls":"tech-docs-reader-page-settings","aria-haspopup":"true",onClick:ae,children:(0,r.jsx)(ge.Z,{})})}),(0,r.jsx)(N.Z,{id:"tech-docs-reader-page-settings",getContentAnchorEl:null,anchorEl:le,anchorOrigin:{vertical:"bottom",horizontal:"right"},open:Boolean(le),onClose:_,keepMounted:!0,children:(0,r.jsx)("div",{children:K})})]}):null]})})}},95481:function(wt,ke,n){"use strict";n.d(ke,{DK:function(){return ne},m1:function(){return A}});var r=n(52322),p=n(2784),z=n(73557),f=n(61886),W=n(60871),g=n(64279),u=n(77446);function N({contentLoading:le,content:se,activeSyncState:ae}){return le||ae==="BUILD_READY_RELOAD"||!se&&ae==="CHECKING"?"CHECKING":!se&&ae==="BUILDING"?"INITIAL_BUILD":se?ae==="BUILDING"?"CONTENT_STALE_REFRESHING":ae==="BUILD_READY"?"CONTENT_STALE_READY":ae==="ERROR"?"CONTENT_STALE_ERROR":"CONTENT_FRESH":"CONTENT_NOT_FOUND"}function ge(le,se){const ae={...le};switch(se.type){case"sync":se.state==="CHECKING"&&(ae.buildLog=[]),ae.activeSyncState=se.state,ae.syncError=se.syncError;break;case"contentLoading":ae.contentLoading=!0,ae.contentError=void 0;break;case"content":typeof se.path=="string"&&(ae.path=se.path),ae.contentLoading=!1,ae.content=se.content,ae.contentError=se.contentError;break;case"buildLog":ae.buildLog=ae.buildLog.concat(se.log);break;default:throw new Error}return["BUILD_READY","BUILD_READY_RELOAD"].includes(ae.activeSyncState)&&["contentLoading","content"].includes(se.type)&&(ae.activeSyncState="UP_TO_DATE",ae.buildLog=[]),ae}function ue(le,se,ae,_){var H,T;const[R,P]=(0,p.useReducer)(ge,{activeSyncState:"CHECKING",path:_,contentLoading:!0,buildLog:[]}),K=(0,W.h_)(f.Dl),{retry:je}=(0,u.Z)(async()=>{P({type:"contentLoading"});try{const Xe=await K.getEntityDocs({kind:le,namespace:se,name:ae},_);return P({type:"content",content:Xe,path:_}),Xe}catch(Xe){P({type:"content",contentError:Xe,path:_})}},[K,le,se,ae,_]),Le=(0,p.useRef)({content:void 0,reload:()=>{}});return Le.current={content:R.content,reload:je},(0,g.default)(async()=>{P({type:"sync",state:"CHECKING"});const Xe=setTimeout(()=>{P({type:"sync",state:"BUILDING"})},1e3);try{switch(await K.syncEntityDocs({kind:le,namespace:se,name:ae},Rt=>{P({type:"buildLog",log:Rt})})){case"updated":Le.current.content?P({type:"sync",state:"BUILD_READY"}):(Le.current.reload(),P({type:"sync",state:"BUILD_READY_RELOAD"}));break;case"cached":P({type:"sync",state:"UP_TO_DATE"});break;default:P({type:"sync",state:"ERROR",syncError:new Error("Unexpected return state")});break}}catch(at){P({type:"sync",state:"ERROR",syncError:at})}finally{clearTimeout(Xe)}},[le,ae,se,K,P,Le]),{state:(0,p.useMemo)(()=>N({activeSyncState:R.activeSyncState,contentLoading:R.contentLoading,content:R.content}),[R.activeSyncState,R.content,R.contentLoading]),contentReload:je,path:R.path,content:R.content,contentErrorMessage:(H=R.contentError)===null||H===void 0?void 0:H.toString(),syncErrorMessage:(T=R.syncError)===null||T===void 0?void 0:T.toString(),buildLog:R.buildLog}}const V=(0,p.createContext)({}),ne=()=>(0,p.useContext)(V),L=le=>{const{children:se}=le,{"*":ae=""}=(0,z.UO)(),{entityRef:_}=(0,f.x1)(),{kind:H,namespace:T,name:R}=_,P=ue(H,T,R,ae);return(0,r.jsx)(V.Provider,{value:P,children:se instanceof Function?se(P):se})},A=le=>se=>(0,r.jsx)(L,{children:(0,r.jsx)(le,{...se})})},95573:function(wt,ke,n){"use strict";n.d(ke,{Fw:function(){return z},_Z:function(){return p},pd:function(){return f}});var r=n(60871);const p=(0,r.NT)({id:"techdocs:index-page"}),z=(0,r.NT)({id:"techdocs:reader-page",params:["namespace","kind","name"]}),f=(0,r.NT)({id:"techdocs:catalog-reader-view"})},55511:function(wt,ke,n){"use strict";n.r(ke),n.d(ke,{TechDocsSearchResultListItem:function(){return ue}});var r=n(52322),p=n(2784),z=n(79692),f=n(49378),W=n(86136),g=n(90436),u=n(53974),N=n(15096);const ge=(0,z.Z)({flexContainer:{flexWrap:"wrap"},itemText:{width:"100%",marginBottom:"1rem"}}),ue=V=>{const{result:ne,highlight:L,lineClamp:A=5,asListItem:le=!0,asLink:se=!0,title:ae,icon:_}=V,H=ge(),T=({children:K})=>se?(0,r.jsx)(u.rU,{noTrack:!0,to:ne.location,children:K}):(0,r.jsx)(r.Fragment,{children:K}),R=()=>{const K=L!=null&&L.fields.title?(0,r.jsx)(N.FA,{text:L.fields.title,preTag:L.preTag,postTag:L.postTag}):ne.title,je=L!=null&&L.fields.entityTitle?(0,r.jsx)(N.FA,{text:L.fields.entityTitle,preTag:L.preTag,postTag:L.postTag}):ne.entityTitle,Le=L!=null&&L.fields.name?(0,r.jsx)(N.FA,{text:L.fields.name,preTag:L.preTag,postTag:L.postTag}):ne.name;return ne?(0,r.jsx)(f.Z,{className:H.itemText,primaryTypographyProps:{variant:"h6"},primary:(0,r.jsx)(T,{children:ae||(0,r.jsxs)(r.Fragment,{children:[K," | ",je!=null?je:Le," docs"]})}),secondary:(0,r.jsx)(g.Z,{component:"span",style:{display:"-webkit-box",WebkitBoxOrient:"vertical",WebkitLineClamp:A,overflow:"hidden"},color:"textSecondary",variant:"body2",children:L!=null&&L.fields.text?(0,r.jsx)(N.FA,{text:L.fields.text,preTag:L.preTag,postTag:L.postTag}):ne.text})}):null},P=({children:K})=>le?(0,r.jsxs)(r.Fragment,{children:[_&&(0,r.jsx)(W.Z,{children:typeof _=="function"?_(ne):_}),(0,r.jsx)("div",{className:H.flexContainer,children:K})]}):(0,r.jsx)(r.Fragment,{children:K});return(0,r.jsx)(P,{children:(0,r.jsx)(R,{})})}},22478:function(wt,ke,n){"use strict";n.d(ke,{S:function(){return N}});var r=n(52322),p=n(15096),z=n(2784),f=n(73557),W=n(55511);const g=ge=>ge==null?void 0:ge.document,u=ge=>{const{entityId:ue,entityTitle:V,debounceTime:ne=150}=ge,[L,A]=(0,z.useState)(!1),le=(0,f.s0)(),{setFilters:se,result:{loading:ae,value:_}}=(0,p.Rx)(),[H,T]=(0,z.useState)([]);(0,z.useEffect)(()=>{let Le=!0;if(Le&&_){const Z=_.results.slice(0,10);T(Z)}return()=>{Le=!1}},[ae,_]);const{kind:R,name:P,namespace:K}=ue;(0,z.useEffect)(()=>{se(Le=>({...Le,kind:R,namespace:K,name:P}))},[R,K,P,se]);const je=(Le,Z)=>{if(g(Z)){const{location:Xe}=Z.document;le(Xe)}};return(0,r.jsx)(p.qO,{"data-testid":"techdocs-search-bar",size:"small",open:L,getOptionLabel:()=>"",filterOptions:Le=>Le,onClose:()=>{A(!1)},onFocus:()=>{A(!0)},onChange:je,blurOnSelect:!0,noOptionsText:"No results found",value:null,options:H,renderOption:({document:Le,highlight:Z})=>(0,r.jsx)(W.TechDocsSearchResultListItem,{result:Le,lineClamp:3,asListItem:!1,asLink:!1,title:Le.title,highlight:Z}),loading:ae,inputDebounceTime:ne,inputPlaceholder:`Search ${V||ue.name} docs`,freeSolo:!1})},N=ge=>{const ue={term:"",types:["techdocs"],pageCursor:"",filters:ge.entityId};return(0,r.jsx)(p.Nd,{initialState:ue,children:(0,r.jsx)(u,{...ge})})}},53260:function(){}},function(wt){var ke=function(r){return wt(wt.s=r)};wt.O(0,[2370,6202,9284,9035,2126,7012,2194,1410,427,242,5109,6816,5218,4736],function(){return ke(30966)});var n=wt.O()}]);})();
|
|
521
|
-
|
|
522
|
-
//# sourceMappingURL=main.6328c68d.js.map
|