@techdocs/cli 1.4.7 → 1.5.0-next.2
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 +23 -8
- package/dist/cjs/{generate-d9c4c0d9.cjs.js → generate-5fb2bc8c.cjs.js} +4 -2
- package/dist/cjs/generate-5fb2bc8c.cjs.js.map +1 -0
- package/dist/embedded-app/.config-schema.json +43 -0
- package/dist/embedded-app/index.html +1 -1
- package/dist/embedded-app/static/{1032.5be56bbf.chunk.js → 1032.f8378b05.chunk.js} +1 -1
- package/dist/embedded-app/static/{1032.5be56bbf.chunk.js.map → 1032.f8378b05.chunk.js.map} +1 -1
- package/dist/embedded-app/static/1093.317a4f39.chunk.js +7 -0
- package/dist/embedded-app/static/1093.317a4f39.chunk.js.map +1 -0
- package/dist/embedded-app/static/1105.a5f2c603.chunk.js +3 -0
- package/dist/embedded-app/static/1105.a5f2c603.chunk.js.map +1 -0
- package/dist/embedded-app/static/{184.78d680e0.chunk.js → 184.2d07d6cf.chunk.js} +1 -1
- package/dist/embedded-app/static/{184.78d680e0.chunk.js.map → 184.2d07d6cf.chunk.js.map} +1 -1
- package/dist/embedded-app/static/2440.c513a311.chunk.js +3 -0
- package/dist/embedded-app/static/2440.c513a311.chunk.js.map +1 -0
- package/dist/embedded-app/static/5458.f60ece35.chunk.js +3 -0
- package/dist/embedded-app/static/5458.f60ece35.chunk.js.map +1 -0
- package/dist/embedded-app/static/5837.d9697f2a.chunk.js +3 -0
- package/dist/embedded-app/static/{9323.61727faa.chunk.js.map → 5837.d9697f2a.chunk.js.map} +1 -1
- package/dist/embedded-app/static/6051.9a397327.chunk.js +4 -0
- package/dist/embedded-app/static/{6051.e6ab645f.chunk.js.map → 6051.9a397327.chunk.js.map} +1 -1
- package/dist/embedded-app/static/{732.fb0762a2.chunk.js → 732.b079cbc6.chunk.js} +1 -1
- package/dist/embedded-app/static/{732.fb0762a2.chunk.js.map → 732.b079cbc6.chunk.js.map} +1 -1
- package/dist/embedded-app/static/{7560.8ef9e30a.chunk.js → 7560.f82352d7.chunk.js} +2 -2
- package/dist/embedded-app/static/{7560.8ef9e30a.chunk.js.map → 7560.f82352d7.chunk.js.map} +1 -1
- package/dist/embedded-app/static/{7750.c1a4c4df.chunk.js → 7750.da1a67d5.chunk.js} +2 -2
- package/dist/embedded-app/static/{7750.c1a4c4df.chunk.js.map → 7750.da1a67d5.chunk.js.map} +1 -1
- package/dist/embedded-app/static/{8951.fea20091.chunk.js → 8951.d0edcfcb.chunk.js} +2 -2
- package/dist/embedded-app/static/{8951.fea20091.chunk.js.map → 8951.d0edcfcb.chunk.js.map} +1 -1
- package/dist/embedded-app/static/{9545.dea948d9.chunk.js → 9545.24f95d89.chunk.js} +1 -1
- package/dist/embedded-app/static/{9545.dea948d9.chunk.js.map → 9545.24f95d89.chunk.js.map} +1 -1
- package/dist/embedded-app/static/9770.2fa7c11e.chunk.js +3 -0
- package/dist/embedded-app/static/9770.2fa7c11e.chunk.js.map +1 -0
- package/dist/embedded-app/static/main.2d4c0606.js +522 -0
- package/dist/embedded-app/static/main.2d4c0606.js.map +1 -0
- package/dist/embedded-app/static/module-i18next.3eb80014.js +3 -0
- package/dist/embedded-app/static/module-i18next.3eb80014.js.map +1 -0
- package/dist/embedded-app/static/module-luxon.b1d74b2d.js +3 -0
- package/dist/embedded-app/static/module-luxon.b1d74b2d.js.map +1 -0
- package/dist/embedded-app/static/{module-yaml.aace0584.js → module-yaml.00a97896.js} +6 -5
- package/dist/embedded-app/static/module-yaml.00a97896.js.map +1 -0
- package/dist/embedded-app/static/{runtime.4b61d1bd.js → runtime.2d4c0606.js} +2 -2
- package/dist/embedded-app/static/{runtime.4b61d1bd.js.map → runtime.2d4c0606.js.map} +1 -1
- package/dist/embedded-app/static/vendor.2d4c0606.js +213 -0
- package/dist/embedded-app/static/vendor.2d4c0606.js.map +1 -0
- package/dist/index.cjs.js +6 -2
- package/dist/index.cjs.js.map +1 -1
- package/package.json +6 -6
- package/dist/cjs/generate-d9c4c0d9.cjs.js.map +0 -1
- package/dist/embedded-app/static/1049.e59b8f46.chunk.js +0 -7
- package/dist/embedded-app/static/1049.e59b8f46.chunk.js.map +0 -1
- package/dist/embedded-app/static/1105.cbd84f5c.chunk.js +0 -3
- package/dist/embedded-app/static/1105.cbd84f5c.chunk.js.map +0 -1
- package/dist/embedded-app/static/2440.8f7574d6.chunk.js +0 -3
- package/dist/embedded-app/static/2440.8f7574d6.chunk.js.map +0 -1
- package/dist/embedded-app/static/5458.4a158b26.chunk.js +0 -3
- package/dist/embedded-app/static/5458.4a158b26.chunk.js.map +0 -1
- package/dist/embedded-app/static/6051.e6ab645f.chunk.js +0 -4
- package/dist/embedded-app/static/9323.61727faa.chunk.js +0 -3
- package/dist/embedded-app/static/9770.1e5df227.chunk.js +0 -3
- package/dist/embedded-app/static/9770.1e5df227.chunk.js.map +0 -1
- package/dist/embedded-app/static/main.4b61d1bd.js +0 -522
- package/dist/embedded-app/static/main.4b61d1bd.js.map +0 -1
- package/dist/embedded-app/static/module-luxon.a1854eb9.js +0 -3
- package/dist/embedded-app/static/module-luxon.a1854eb9.js.map +0 -1
- package/dist/embedded-app/static/module-yaml.aace0584.js.map +0 -1
- package/dist/embedded-app/static/vendor.4b61d1bd.js +0 -213
- package/dist/embedded-app/static/vendor.4b61d1bd.js.map +0 -1
|
@@ -0,0 +1,522 @@
|
|
|
1
|
+
(()=>{(self.webpackChunktechdocs_cli_embedded_app=self.webpackChunktechdocs_cli_embedded_app||[]).push([[179],{4791:function(wt,Ie,n){"use strict";n.d(Ie,{n3:function(){return m},MS:function(){return q}});var r=n(87612),p=n(25271),V=n(23054),f=n(96279),H=n.n(f);const m=Symbol.for("CATALOG_FILTER_EXISTS_0e15b590c0b343a2bae3e787e84c2111");function h(_){return!_.cursor}function P(_){return!h(_)}class q{async getEntityAncestors(Q,se){const{kind:Z,namespace:j,name:re}=(0,p.of)(Q.entityRef);return await this.requestRequired("GET",`/entities/by-name/${encodeURIComponent(Z)}/${encodeURIComponent(j)}/${encodeURIComponent(re)}/ancestry`,se)}async getLocationById(Q,se){return await this.requestOptional("GET",`/locations/${encodeURIComponent(Q)}`,se)}async getEntities(Q,se){const{filter:Z=[],fields:j=[],order:re,offset:ae,limit:oe,after:ee}=Q!=null?Q:{},U=this.getParams(Z);if(j.length&&U.push(`fields=${j.map(encodeURIComponent).join(",")}`),re)for(const F of[re].flat())F&&U.push(`order=${encodeURIComponent(F.order)}:${encodeURIComponent(F.field)}`);ae!==void 0&&U.push(`offset=${ae}`),oe!==void 0&&U.push(`limit=${oe}`),ee!==void 0&&U.push(`after=${encodeURIComponent(ee)}`);const T=U.length?`?${U.join("&")}`:"",w=await this.requestRequired("GET",`/entities${T}`,se),R=(F,ve)=>{var be,k;if(((be=F.metadata)===null||be===void 0?void 0:be.name)===void 0||F.kind===void 0||((k=ve.metadata)===null||k===void 0?void 0:k.name)===void 0||ve.kind===void 0)return 0;const rt=(0,p.eE)(F),ht=(0,p.eE)(ve);return rt<ht?-1:rt>ht?1:0};return{items:w.sort(R)}}async getEntitiesByRefs(Q,se){var Z,j,re;const ae={entityRefs:Q.entityRefs};!((Z=Q.fields)===null||Z===void 0)&&Z.length&&(ae.fields=Q.fields);const ee=`${await this.discoveryApi.getBaseUrl("catalog")}/entities/by-refs`,U=await this.fetchApi.fetch(ee,{headers:{"Content-Type":"application/json",...((j=se)===null||j===void 0?void 0:j.token)&&{Authorization:`Bearer ${(re=se)===null||re===void 0?void 0:re.token}`}},method:"POST",body:JSON.stringify(ae)});if(!U.ok)throw await V.VL.fromResponse(U);const{items:T}=await U.json();return{items:T.map(w=>w!=null?w:void 0)}}async queryEntities(Q={},se){const Z=[];if(h(Q)){var j,re,ae,oe;const{fields:U=[],filter:T,limit:w,orderFields:R,fullTextFilter:F}=Q;Z.push(...this.getParams(T)),w!==void 0&&Z.push(`limit=${w}`),R!==void 0&&(Array.isArray(R)?R:[R]).forEach(({field:be,order:k})=>Z.push(`orderField=${be},${k}`)),U.length&&Z.push(`fields=${U.map(encodeURIComponent).join(",")}`);const ve=(re=F)===null||re===void 0||(j=re.term)===null||j===void 0?void 0:j.trim();ve&&Z.push(`fullTextFilterTerm=${ve}`),!((oe=F)===null||oe===void 0||(ae=oe.fields)===null||ae===void 0)&&ae.length&&Z.push(`fullTextFilterFields=${F.fields.join(",")}`)}else{const{fields:U=[],limit:T,cursor:w}=Q;Z.push(`cursor=${w}`),T!==void 0&&Z.push(`limit=${T}`),U.length&&Z.push(`fields=${U.map(encodeURIComponent).join(",")}`)}const ee=Z.length?`?${Z.join("&")}`:"";return this.requestRequired("GET",`/entities/by-query${ee}`,se)}async getEntityByRef(Q,se){const{kind:Z,namespace:j,name:re}=(0,p.of)(Q);return this.requestOptional("GET",`/entities/by-name/${encodeURIComponent(Z)}/${encodeURIComponent(j)}/${encodeURIComponent(re)}`,se)}async getEntityByName(Q,se){const{kind:Z,namespace:j="default",name:re}=Q;return this.requestOptional("GET",`/entities/by-name/${encodeURIComponent(Z)}/${encodeURIComponent(j)}/${encodeURIComponent(re)}`,se)}async refreshEntity(Q,se){var Z,j;const re=await this.fetchApi.fetch(`${await this.discoveryApi.getBaseUrl("catalog")}/refresh`,{headers:{"Content-Type":"application/json",...((Z=se)===null||Z===void 0?void 0:Z.token)&&{Authorization:`Bearer ${(j=se)===null||j===void 0?void 0:j.token}`}},method:"POST",body:JSON.stringify({entityRef:Q})});if(re.status!==200)throw new Error(await re.text())}async getEntityFacets(Q,se){const{filter:Z=[],facets:j}=Q,re=this.getParams(Z);for(const oe of j)re.push(`facet=${encodeURIComponent(oe)}`);const ae=re.length?`?${re.join("&")}`:"";return await this.requestOptional("GET",`/entity-facets${ae}`,se)}async addLocation(Q,se){var Z,j;const{type:re="url",target:ae,dryRun:oe}=Q,ee=await this.fetchApi.fetch(`${await this.discoveryApi.getBaseUrl("catalog")}/locations${oe?"?dryRun=true":""}`,{headers:{"Content-Type":"application/json",...((Z=se)===null||Z===void 0?void 0:Z.token)&&{Authorization:`Bearer ${(j=se)===null||j===void 0?void 0:j.token}`}},method:"POST",body:JSON.stringify({type:re,target:ae})});if(ee.status!==201)throw new Error(await ee.text());const{location:U,entities:T,exists:w}=await ee.json();if(!U)throw new Error(`Location wasn't added: ${ae}`);return{location:U,entities:T,exists:w}}async getLocationByRef(Q,se){return(await this.requestRequired("GET","/locations",se)).map(j=>j.data).find(j=>Q===(0,p.NZ)(j))}async removeLocationById(Q,se){await this.requestIgnored("DELETE",`/locations/${encodeURIComponent(Q)}`,se)}async removeEntityByUid(Q,se){await this.requestIgnored("DELETE",`/entities/by-uid/${encodeURIComponent(Q)}`,se)}async validateEntity(Q,se,Z){var j,re;const ae=await this.fetchApi.fetch(`${await this.discoveryApi.getBaseUrl("catalog")}/validate-entity`,{headers:{"Content-Type":"application/json",...((j=Z)===null||j===void 0?void 0:j.token)&&{Authorization:`Bearer ${(re=Z)===null||re===void 0?void 0:re.token}`}},method:"POST",body:JSON.stringify({entity:Q,location:se})});if(ae.ok)return{valid:!0};if(ae.status!==400)throw await V.VL.fromResponse(ae);const{errors:oe=[]}=await ae.json();return{valid:!1,errors:oe}}async requestIgnored(Q,se,Z){var j;const re=`${await this.discoveryApi.getBaseUrl("catalog")}${se}`,ae=!((j=Z)===null||j===void 0)&&j.token?{Authorization:`Bearer ${Z.token}`}:{},oe=await this.fetchApi.fetch(re,{method:Q,headers:ae});if(!oe.ok)throw await V.VL.fromResponse(oe)}async requestRequired(Q,se,Z){var j;const re=`${await this.discoveryApi.getBaseUrl("catalog")}${se}`,ae=!((j=Z)===null||j===void 0)&&j.token?{Authorization:`Bearer ${Z.token}`}:{},oe=await this.fetchApi.fetch(re,{method:Q,headers:ae});if(!oe.ok)throw await V.VL.fromResponse(oe);return oe.json()}async requestOptional(Q,se,Z){var j;const re=`${await this.discoveryApi.getBaseUrl("catalog")}${se}`,ae=!((j=Z)===null||j===void 0)&&j.token?{Authorization:`Bearer ${Z.token}`}:{},oe=await this.fetchApi.fetch(re,{method:Q,headers:ae});if(!oe.ok){if(oe.status===404)return;throw await V.VL.fromResponse(oe)}return await oe.json()}getParams(Q=[]){const se=[];for(const Z of[Q].flat()){const j=[];for(const[re,ae]of Object.entries(Z))for(const oe of[ae].flat())oe===m?j.push(encodeURIComponent(re)):typeof oe=="string"&&j.push(`${encodeURIComponent(re)}=${encodeURIComponent(oe)}`);j.length&&se.push(`filter=${j.join(",")}`)}return se}constructor(Q){(0,r._)(this,"discoveryApi",void 0),(0,r._)(this,"fetchApi",void 0),this.discoveryApi=Q.discoveryApi,this.fetchApi=Q.fetchApi||{fetch:H()}}}},25271:function(wt,Ie,n){"use strict";n.d(Ie,{Tf:function(){return V},P1:function(){return Hn},q1:function(){return fr},M6:function(){return $n},l2:function(){return p},zG:function(){return r},w$:function(){return ln},nP:function(){return tn},aS:function(){return on},S4:function(){return Ee},cz:function(){return ot},wI:function(){return ve},iB:function(){return Dt},CV:function(){return Gn},of:function(){return _e},Ou:function(){return Zn},eE:function(){return yt},NZ:function(){return Cr}});const r="default",p="backstage.io/view-url",V="backstage.io/edit-url",f="kubernetes.io/api-server",H="kubernetes.io/api-server-certificate-authority",m="kubernetes.io/auth-provider";var h=n(76635),P=n.n(h);class q{async enforce(ne){return ne.metadata.namespace?ne:lodash.merge({metadata:{namespace:this.namespace}},ne)}constructor(ne=DEFAULT_NAMESPACE){_define_property(this,"namespace",void 0),this.namespace=ne}}class _{static isValidPrefixAndOrSuffix(ne,Te,ze,ct){if(typeof ne!="string")return!1;const Rt=ne.split(Te);return Rt.length===1?ct(Rt[0]):Rt.length===2?ze(Rt[0])&&ct(Rt[1]):!1}static isJsonSafe(ne){try{return P().isEqual(ne,JSON.parse(JSON.stringify(ne)))}catch{return!1}}static isValidDnsSubdomain(ne){return typeof ne=="string"&&ne.length>=1&&ne.length<=253&&ne.split(".").every(_.isValidDnsLabel)}static isValidDnsLabel(ne){return typeof ne=="string"&&ne.length>=1&&ne.length<=63&&/^[a-z0-9]+(?:\-+[a-z0-9]+)*$/.test(ne)}static isValidTag(ne){return typeof ne=="string"&&ne.length>=1&&ne.length<=63&&/^[a-z0-9+#]+(\-[a-z0-9+#]+)*$/.test(ne)}static isValidUrl(ne){if(typeof ne!="string")return!1;try{return new URL(ne),!0}catch{return!1}}static isValidString(ne){var Te,ze;return typeof ne=="string"&&((ze=ne)===null||ze===void 0||(Te=ze.trim())===null||Te===void 0?void 0:Te.length)>=1}static isNonEmptyString(ne){var Te,ze;return typeof ne=="string"&&((ze=ne)===null||ze===void 0||(Te=ze.trim())===null||Te===void 0?void 0:Te.length)>=1}}var Q=JSON.parse('{"$schema":"http://json-schema.org/draft-07/schema","$id":"EntityEnvelope","description":"The envelope skeleton parts of an entity - whatever is necessary to be able to give it a ref and pass to further validation / policy checking.","examples":[{"apiVersion":"backstage.io/v1alpha1","kind":"Component","metadata":{"name":"LoremService"}}],"type":"object","required":["apiVersion","kind","metadata"],"additionalProperties":true,"properties":{"apiVersion":{"type":"string","description":"The version of specification format for this particular entity that this is written against.","minLength":1,"examples":["backstage.io/v1alpha1","my-company.net/v1","1.0"]},"kind":{"type":"string","description":"The high level entity type being described.","minLength":1,"examples":["API","Component","Domain","Group","Location","Resource","System","Template","User"]},"metadata":{"type":"object","required":["name"],"additionalProperties":true,"properties":{"name":{"type":"string","description":"The name of the entity. Must be unique within the catalog at any given point in time, for any given namespace + kind pair.","examples":["metadata-proxy"],"minLength":1},"namespace":{"type":"string","description":"The namespace that the entity belongs to.","default":"default","examples":["default","admin"],"minLength":1}}}}}'),se=n(27991),Z=n.n(se),j=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"}}}`),re=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}}}}}}'),ae=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 oe=new Map,ee=[Q,j,re,ae];function U(Re){var ne;if(!(!((ne=Re)===null||ne===void 0)&&ne.length))throw new TypeError("Unknown error");const Te=Re[0];throw new TypeError(`${Te.instancePath||"<root>"} ${Te.message}${Te.params?` - ${Object.entries(Te.params).map(([ze,ct])=>`${ze}: ${ct}`).join(", ")}`:""}`)}function T(Re,ne={}){var Te,ze;const ct=(ze=(Te=ne)===null||Te===void 0?void 0:Te.disableCache)!==null&&ze!==void 0?ze:!1,Rt=ct?"":JSON.stringify(Re);if(!ct){const sn=oe.get(Rt);if(sn)return sn}const Ht=w(Re),nn=new(Z())({allowUnionTypes:!0,allErrors:!0,validateSchema:!0});Ht.length&&nn.addSchema(Ht,void 0,void 0,!0);const gn=nn.compile(Re);return ct||oe.set(Rt,gn),gn}function w(Re){if(typeof Re!="object")return[];const ne=new Set;Re.$id&&ne.add(Re.$id);const Te=new Array,ze=[Re];for(;ze.length;){const ct=ze.pop();for(const Rt of R(ct))if(!ne.has(Rt)){ne.add(Rt);const Ht=ee.find(nn=>nn.$id===Rt);Ht&&(Te.push(Ht),ze.push(Ht))}}return Te}function*R(Re){const ne=[Re];for(;ne.length;){const Te=ne.pop();if(typeof Te=="object"&&Te)for(const[ze,ct]of Object.entries(Te))ze==="$ref"&&typeof ct=="string"?yield ct.split("#")[0]:ne.push(ct)}}function F(Re){const ne=compileAjvSchema(Re||entityEnvelopeSchema);return Te=>{if(ne(Te)===!0)return Te;throw throwAjvError(ne.errors)}}function ve(Re){const ne=T(Re);return Te=>{var ze,ct;if(ne(Te)===!0)return Te;const Ht=(ze=ne.errors)===null||ze===void 0?void 0:ze.filter(nn=>["/kind","/apiVersion"].includes(nn.instancePath));if(!((ct=Ht)===null||ct===void 0)&&ct.length&&Ht.every(nn=>nn.keyword==="enum"))return!1;throw U(ne.errors)}}function be(Re){const ne=compileAjvSchema(Re||entitySchema);return Te=>{if(ne(Te)===!0)return Te;throw throwAjvError(ne.errors)}}class k{static isValidApiVersion(ne){return _.isValidPrefixAndOrSuffix(ne,"/",_.isValidDnsSubdomain,Te=>Te.length>=1&&Te.length<=63&&/^[a-z0-9A-Z]+$/.test(Te))}static isValidKind(ne){return typeof ne=="string"&&ne.length>=1&&ne.length<=63&&/^[a-zA-Z][a-z0-9A-Z]*$/.test(ne)}static isValidObjectName(ne){return typeof ne=="string"&&ne.length>=1&&ne.length<=63&&/^([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9]$/.test(ne)}static isValidNamespace(ne){return _.isValidDnsLabel(ne)}static isValidLabelKey(ne){return _.isValidPrefixAndOrSuffix(ne,"/",_.isValidDnsSubdomain,k.isValidObjectName)}static isValidLabelValue(ne){return ne===""||k.isValidObjectName(ne)}static isValidAnnotationKey(ne){return _.isValidPrefixAndOrSuffix(ne,"/",_.isValidDnsSubdomain,k.isValidObjectName)}static isValidAnnotationValue(ne){return typeof ne=="string"}}const rt={isValidApiVersion:k.isValidApiVersion,isValidKind:k.isValidKind,isValidEntityName:k.isValidObjectName,isValidNamespace:k.isValidNamespace,isValidLabelKey:k.isValidLabelKey,isValidLabelValue:k.isValidLabelValue,isValidAnnotationKey:k.isValidAnnotationKey,isValidAnnotationValue:k.isValidAnnotationValue,isValidTag:Re=>typeof Re=="string"&&Re.length>=1&&Re.length<=63&&/^[a-z0-9:+#]+(\-[a-z0-9:+#]+)*$/.test(Re)};function ht(Re={}){return{...rt,...Re}}class Nt{async enforce(ne){function Te(Y,v,L){if(v==null)throw new Error(`${Y} must have a value`);let M;try{M=L(v)}catch(W){throw new Error(`${Y} could not be validated, ${W}`)}if(!M){let W;switch(L.name){case"isValidLabelValue":case"isValidObjectName":W="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":W="a valid prefix and/or suffix";break;case"isValidNamespace":case"isValidDnsLabel":W="a string that is sequences of [a-z0-9] separated by [-], at most 63 characters in total";break;case"isValidTag":W="a string that is sequences of [a-z0-9+#] separated by [-], at most 63 characters in total";break;case"isValidAnnotationValue":W="a string";break;case"isValidKind":W="a string that is a sequence of [a-zA-Z][a-z0-9A-Z], at most 63 characters in total";break;case"isValidUrl":W="a string that is a valid url";break;case"isValidString":case"isNonEmptyString":W="a non empty string";break;default:W=void 0;break}const ue=W?` expected ${W} but found "${v}".`:"";throw new Error(`"${Y}" is not valid;${ue} 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 ze(Y,v,L){return v===void 0||Te(Y,v,L)}Te("apiVersion",ne.apiVersion,this.validators.isValidApiVersion),Te("kind",ne.kind,this.validators.isValidKind),Te("metadata.name",ne.metadata.name,this.validators.isValidEntityName),ze("metadata.namespace",ne.metadata.namespace,this.validators.isValidNamespace);var ct;for(const[Y,v]of Object.entries((ct=ne.metadata.labels)!==null&&ct!==void 0?ct:[]))Te(`labels.${Y}`,Y,this.validators.isValidLabelKey),Te(`labels.${Y}`,v,this.validators.isValidLabelValue);var Rt;for(const[Y,v]of Object.entries((Rt=ne.metadata.annotations)!==null&&Rt!==void 0?Rt:[]))Te(`annotations.${Y}`,Y,this.validators.isValidAnnotationKey),Te(`annotations.${Y}`,v,this.validators.isValidAnnotationValue);var Ht;const nn=(Ht=ne.metadata.tags)!==null&&Ht!==void 0?Ht:[];for(let Y=0;Y<nn.length;++Y)Te(`tags.${Y}`,nn[Y],this.validators.isValidTag);var gn;const sn=(gn=ne.metadata.links)!==null&&gn!==void 0?gn:[];for(let Y=0;Y<sn.length;++Y){var hn,le,de;Te(`links.${Y}.url`,(hn=sn[Y])===null||hn===void 0?void 0:hn.url,CommonValidatorFunctions.isValidUrl),ze(`links.${Y}.title`,(le=sn[Y])===null||le===void 0?void 0:le.title,CommonValidatorFunctions.isNonEmptyString),ze(`links.${Y}.icon`,(de=sn[Y])===null||de===void 0?void 0:de.icon,KubernetesValidatorFunctions.isValidObjectName)}return ne}constructor(ne=makeValidator()){_define_property(this,"validators",void 0),this.validators=ne}}class Ut{async enforce(ne){if(!this.validate){const ct=new Ajv({allowUnionTypes:!0});this.validate=ct.addSchema([commonSchema,entityMetaSchema],void 0,void 0,!0).compile(entitySchema)}if(this.validate(ne)===!0)return ne;const[ze]=this.validate.errors||[];throw ze?new Error(`Malformed envelope, ${ze.instancePath||"<root>"} ${ze.message}`):new Error("Malformed envelope, Unknown error")}constructor(){_define_property(this,"validate",void 0)}}function Bt(Re){let ne=Re.indexOf(":");const Te=Re.indexOf("/");Te!==-1&&Te<ne&&(ne=-1);const ze=ne===-1?void 0:Re.slice(0,ne),ct=Te===-1?void 0:Re.slice(ne+1,Te),Rt=Re.slice(Math.max(ne+1,Te+1));if(ze===""||ct===""||Rt==="")throw new TypeError(`Entity reference "${Re}" was not on the form [<kind>:][<namespace>/]<name>`);return{kind:ze,namespace:ct,name:Rt}}function Dt(Re){return{kind:Re.kind,namespace:Re.metadata.namespace||r,name:Re.metadata.name}}function _e(Re,ne){var Te,ze;if(!Re)throw new Error("Entity reference must not be empty");const ct=(Te=ne)===null||Te===void 0?void 0:Te.defaultKind,Rt=((ze=ne)===null||ze===void 0?void 0:ze.defaultNamespace)||r;let Ht,nn,gn;if(typeof Re=="string"){const Y=Bt(Re);var sn;Ht=(sn=Y.kind)!==null&&sn!==void 0?sn:ct;var hn;nn=(hn=Y.namespace)!==null&&hn!==void 0?hn:Rt,gn=Y.name}else{var le;Ht=(le=Re.kind)!==null&&le!==void 0?le:ct;var de;nn=(de=Re.namespace)!==null&&de!==void 0?de:Rt,gn=Re.name}if(Ht)if(nn){if(!gn){const Y=JSON.stringify(Re);throw new Error(`Entity reference ${Y} had missing or empty name`)}}else{const Y=JSON.stringify(Re);throw new Error(`Entity reference ${Y} had missing or empty namespace`)}else{const Y=JSON.stringify(Re);throw new Error(`Entity reference ${Y} had missing or empty kind (e.g. did not start with "component:" or similar)`)}return{kind:Ht,namespace:nn,name:gn}}function yt(Re){let ne,Te,ze;if("metadata"in Re){ne=Re.kind;var ct;Te=(ct=Re.metadata.namespace)!==null&&ct!==void 0?ct:r,ze=Re.metadata.name}else{ne=Re.kind;var Rt;Te=(Rt=Re.namespace)!==null&&Rt!==void 0?Rt:r,ze=Re.name}return`${ne.toLocaleLowerCase("en-US")}:${Te.toLocaleLowerCase("en-US")}/${ze.toLocaleLowerCase("en-US")}`}var ft=n(87612);class Je{async enforce(ne){let Te=ne;for(const ze of this.policies){const ct=await ze.enforce(Te);if(!ct)throw new Error(`Policy ${ze.constructor.name} did not return a result`);Te=ct}return Te}constructor(ne){(0,ft._)(this,"policies",void 0),this.policies=ne}}class Ft{async enforce(ne){for(const Te of this.policies){const ze=await Te.enforce(ne);if(ze)return ze}throw new Error("The entity did not match any known policy")}constructor(ne){(0,ft._)(this,"policies",void 0),this.policies=ne}}const $t={allOf(Re){return new Je(Re)},oneOf(Re){return new Ft(Re)}};var Mt=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 Se(Re){let ne;return{async check(Te){return ne||(ne=ve(Re)),ne(Te)===Te}}}const Be=Se(Mt);var Ge=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 et=Se(Ge);var at=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 Tt=Se(at);var pt=JSON.parse(`{"$schema":"http://json-schema.org/draft-07/schema","$id":"GroupV1alpha1","description":"A group describes an organizational entity, such as for example a team, a business unit, or a loose collection of people in an interest group. Members of these groups are modeled in the catalog as kind User.","examples":[{"apiVersion":"backstage.io/v1alpha1","kind":"Group","metadata":{"name":"infrastructure","description":"The infra business unit"},"spec":{"type":"business-unit","profile":{"displayName":"Infrastructure","email":"infrastructure@example.com","picture":"https://example.com/groups/bu-infrastructure.jpeg"},"parent":"ops","children":["backstage","other"]}}],"allOf":[{"$ref":"Entity"},{"type":"object","required":["spec"],"properties":{"apiVersion":{"enum":["backstage.io/v1alpha1","backstage.io/v1beta1"]},"kind":{"enum":["Group"]},"spec":{"type":"object","required":["type","children"],"properties":{"type":{"type":"string","description":"The type of group. There is currently no enforced set of values for this field, so it is left up to the adopting organization to choose a nomenclature that matches their org hierarchy.","examples":["team","business-unit","product-area","root"],"minLength":1},"profile":{"type":"object","description":"Optional profile information about the group, mainly for display purposes. All fields of this structure are also optional. The email would be a group email of some form, that the group may wish to be used for contacting them. The picture is expected to be a URL pointing to an image that's representative of the group, and that a browser could fetch and render on a group page or similar.","properties":{"displayName":{"type":"string","description":"A simple display name to present to users.","examples":["Infrastructure"],"minLength":1},"email":{"type":"string","description":"An email where this entity can be reached.","examples":["infrastructure@example.com"],"minLength":1},"picture":{"type":"string","description":"The URL of an image that represents this entity.","examples":["https://example.com/groups/bu-infrastructure.jpeg"],"minLength":1}}},"parent":{"type":"string","description":"The immediate parent group in the hierarchy, if any. Not all groups must have a parent; the catalog supports multi-root hierarchies. Groups may however not have more than one parent. This field is an entity reference.","examples":["ops"],"minLength":1},"children":{"type":"array","description":"The immediate child groups of this group in the hierarchy (whose parent field points to this group). The list must be present, but may be empty if there are no child groups. The items are not guaranteed to be ordered in any particular way. The entries of this array are entity references.","items":{"type":"string","examples":["backstage","other"],"minLength":1}},"members":{"type":"array","description":"The users that are members of this group. The entries of this array are entity references.","items":{"type":"string","examples":["jdoe"],"minLength":1}}}}}}]}`);const xe=Se(pt);var G=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 pe=Se(G),Ee="ownedBy",He="ownerOf",gt="consumesApi",Qe="apiConsumedBy",jt="providesApi",an="apiProvidedBy",tn="dependsOn",ln="dependencyOf",fn="parentOf",dn="childOf",Bn="memberOf",Fn="hasMember",ot="partOf",on="hasPart";var Vt=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 st=Se(Vt);var Sn=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 qt=Se(Sn);var Cn=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 yn=Se(Cn),Hn="backstage.io/managed-by-location",fr="backstage.io/managed-by-origin-location",$n="backstage.io/source-location",_n=/^[\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 Zn(Re){if(typeof Re!="string")throw new TypeError(`Unable to parse location ref '${Re}', unexpected argument ${typeof Re}`);const ne=Re.indexOf(":");if(ne<0)throw new TypeError(`Unable to parse location ref '${Re}', expected '<type>:<target>', e.g. 'url:https://host/path'`);const Te=Re.substring(0,ne).trim(),ze=Re.substring(ne+1).trim();if(!Te||!ze)throw new TypeError(`Unable to parse location ref '${Re}', expected '<type>:<target>', e.g. 'url:https://host/path'`);if(Te==="http"||Te==="https")throw new TypeError(`Invalid location ref '${Re}', please prefix it with 'url:', e.g. 'url:${Re}'`);if(_n.test(ze))throw new TypeError(`Invalid location ref '${Re}', target is a javascript: URL`);return{type:Te,target:ze}}function Cr(Re){const{type:ne,target:Te}=Re;if(ne){if(!Te)throw new TypeError("Unable to stringify location ref, empty target")}else throw new TypeError("Unable to stringify location ref, empty type");if(_n.test(Te))throw new TypeError(`Invalid location ref '${ne}:${Te}', target is a javascript: URL`);return`${ne}:${Te}`}function Gn(Re){var ne,Te,ze,ct,Rt;const Ht=(Rt=(Te=Re.metadata)===null||Te===void 0||(ne=Te.annotations)===null||ne===void 0?void 0:ne[$n])!==null&&Rt!==void 0?Rt:(ct=Re.metadata)===null||ct===void 0||(ze=ct.annotations)===null||ze===void 0?void 0:ze[Hn];if(!Ht)throw new Error(`Entity '${yt(Re)}' is missing location`);return Zn(Ht)}},98864:function(wt,Ie,n){"use strict";n.d(Ie,{rU:function(){return R}});var r=n(52322),p=n(97456),V=n(86689),f=n(79692),H=n(90436),m=n(72779),h=n.n(m),P=n(76635),q=n.n(P),_=n(2784),Q=n(73557),se=n(71597);function Z(){const[F]=(0,Q.is)((0,r.jsx)(Q.AW,{index:!0,element:(0,r.jsx)("div",{})}));return!F.index}const j=(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"}),re=F=>/^([a-z+.-]+):/.test(F),ae=/^[\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,oe=window.open;if(oe&&!oe.__backstage){const F=function(...be){const k=String(be[0]);if(ae.test(k))throw new Error("Rejected window.open() with a javascript: URL as a security precaution");return oe.apply(this,be)};F.__backstage=!0,window.open=F}const ee=()=>{try{return(0,p.h_)(p.Ds).getOptionalString("app.baseUrl")}catch{return}},U=()=>{const F="http://sample.dev";var ve;const be=(ve=ee())!==null&&ve!==void 0?ve:"/",{pathname:k}=new URL(be,F);return(0,P.trimEnd)(k,"/")},T=F=>{let ve=String(F);const be=U(),k=re(ve),rt=ve.startsWith(be);return!k&&!rt&&(ve=be.concat(ve)),ve},w=F=>{if(F instanceof Array)return F.map(w).join(" ").trim();if(typeof F=="object"&&F){var ve,be;return w((be=F)===null||be===void 0||(ve=be.props)===null||ve===void 0?void 0:ve.children)}return["string","number"].includes(typeof F)?String(F):""},R=_.forwardRef(({onClick:F,noTrack:ve,...be},k)=>{const rt=j(),ht=(0,p.z$)(),Nt=Z()?T(be.to):be.to,Ut=w(be.children)||Nt,Bt=re(Nt),Dt=Bt&&!!/^https?:/.exec(Nt);if(ae.test(Nt))throw new Error("Link component rejected javascript: URL as a security precaution");const _e=yt=>{var ft;(ft=F)===null||ft===void 0||ft(yt),ve||ht.captureEvent("click",Ut,{attributes:{to:Nt}})};return Bt?(0,r.jsxs)(V.Z,{...Dt?{target:"_blank",rel:"noopener"}:{},...be,...be["aria-label"]?{"aria-label":`${be["aria-label"]}, Opens in a new window`}:{},ref:k,href:Nt,onClick:_e,className:h()(rt.externalLink,be.className),children:[be.children,(0,r.jsx)(H.Z,{component:"span",className:rt.visuallyHidden,children:", Opens in a new window"})]}):(0,r.jsx)(V.Z,{...be,ref:k,component:se.rU,to:Nt,onClick:_e})})},43909:function(wt,Ie,n){"use strict";n.d(Ie,{r:function(){return r.rU}});var r=n(98864)},53974:function(wt,Ie,n){"use strict";n.d(Ie,{Oi:function(){return ve},VY:function(){return Ti},yW:function(){return Ki},XF:function(){return ht},mn:function(){return ln},NX:function(){return Je},ub:function(){return _n},mf:function(){return Qi},yu:function(){return it},h4:function(){return Ir},M6:function(){return zr},i9:function(){return co},aR:function(){return Fs},rJ:function(){return rr},Oh:function(){return vl},hu:function(){return fl},rU:function(){return _.r},Qj:function(){return se},nU:function(){return Ze},SA:function(){return un},sk:function(){return Rt},Or:function(){return Kr},T3:function(){return sl},g9:function(){return bl},Ex:function(){return Eo},Gk:function(){return Xt},tn:function(){return ls},Ph:function(){return Oo},YE:function(){return _a},v7:function(){return je},R6:function(){return N},tR:function(){return ga},uw:function(){return Li},qt:function(){return Ns},iA:function(){return Hs},GB:function(){return nt},po:function(){return Vr},mZ:function(){return ms},Pf:function(){return vs}});var r=n(52322),p=n(97456),V=n(19928),f=n(2784);function H(e){const[s,l]=useState([]),u=useApi(alertApiRef),{anchorOrigin:g={vertical:"top",horizontal:"center"},transientTimeoutMs:b}=e,I=b!=null?b:5e3;useEffect(()=>{const X=u.alert$().subscribe(ge=>l(me=>me.concat(ge)));return()=>{X.unsubscribe()}},[u]);const[D]=s;if(useEffect(()=>{if(D&&D.display==="transient"){const X=setTimeout(()=>{l(ge=>{const me=ge.filter(Me=>Me!==D);return me.length===ge.length?ge:me})},I);return()=>clearTimeout(X)}},[D,I]),s.length===0)return null;const te=()=>{l(X=>X.filter(ge=>ge!==D))};return _jsx(Snackbar,{open:!0,anchorOrigin:g,children:_jsx(Alert,{action:_jsx(IconButton,{color:"inherit",size:"small",onClick:te,"data-testid":"error-button-close",children:_jsx(CloseIcon,{})}),severity:D.severity,children:_jsxs(Typography,{component:"span",children:[String(D.message),s.length>1&&_jsx("em",{children:` (${s.length-1} older ${pluralize("message",s.length-1)})`})]})})})}var m=n(79692);const h=(0,m.Z)(e=>({avatar:{width:"4rem",height:"4rem",color:e.palette.common.white},avatarText:{fontWeight:e.typography.fontWeightBold,letterSpacing:"1px",textTransform:"uppercase"}}),{name:"BackstageAvatar"});function P(e){const{displayName:s,picture:l,customStyles:u}=e,g=h();let b={...u};const I={fontFamily:b.fontFamily,fontSize:b.fontSize,fontWeight:b.fontWeight};return l||(b={backgroundColor:stringToColor(s||""),...u}),_jsx(MaterialAvatar,{alt:s,src:l,className:g.avatar,style:b,children:s&&_jsx(Typography,{variant:"h6",component:"span",className:g.avatarText,style:I,children:extractInitials(s)})})}var q=n(77277),_=n(43909);const Q=f.forwardRef((e,s)=>(0,r.jsx)(_.r,{ref:s,...e,color:"initial"})),se=f.forwardRef((e,s)=>(0,r.jsx)(q.Z,{ref:s,component:Q,...e})),Z=null;var j=n(95544),re=n(60364),ae=n(83229),oe=n(26639),ee=n(39595),U=n(61837),T=n(80030),w=n(19353),R=n(95074);function F(e){const{text:s,tooltipDelay:l=1e3,tooltipText:u="Text copied to clipboard","aria-label":g="Copy text"}=e,b=(0,p.h_)(p.VE),[I,D]=(0,f.useState)(!1),[{error:te},X]=(0,R.Z)();(0,f.useEffect)(()=>{te&&b.post(te)},[te,b]);const ge=me=>{me.stopPropagation(),D(!0),X(s)};return(0,r.jsx)(r.Fragment,{children:(0,r.jsx)(T.ZP,{id:"copy-test-tooltip",title:u,placement:"top",leaveDelay:l,onClose:()=>D(!1),open:I,children:(0,r.jsx)(U.Z,{onClick:ge,"aria-label":g,children:(0,r.jsx)(w.Z,{})})})})}function ve(e){const{text:s,language:l,showLineNumbers:u=!1,highlightedNumbers:g,customStyle:b,showCopyCodeButton:I=!1}=e,D=(0,re.Z)(),te=D.palette.type==="dark"?oe.Z:ee.Z,X=D.palette.type==="dark"?"#256bf3":"#e6ffed";return(0,r.jsxs)(j.Z,{position:"relative",children:[(0,r.jsx)(ae.Z,{customStyle:b,language:l,style:te,showLineNumbers:u,wrapLines:!0,lineNumberStyle:{color:D.palette.textVerySubtle},lineProps:ge=>{var me;return!((me=g)===null||me===void 0)&&me.includes(ge)?{style:{backgroundColor:X}}:{}},children:s}),I&&(0,r.jsx)(j.Z,{position:"absolute",top:0,right:0,children:(0,r.jsx)(F,{text:s})})]})}var be=n(41156),k=n(71597),rt=n(88188);function ht(e){const{title:s,to:l}=e,u=(0,be.Z)(g=>g.breakpoints.down("xs"));return l?u?(0,r.jsx)(U.Z,{component:k.rU,color:"primary",title:s,size:"small",to:l,children:(0,r.jsx)(rt.Z,{})}):(0,r.jsx)(q.Z,{component:k.rU,variant:"contained",color:"primary",to:l,children:s}):null}var Nt=n(27397),Ut=n(11105),Bt=n(97963),Dt=n(46506),_e=n.n(Dt),yt=n(54073),ft=n.n(yt),Je;(function(e){let s;(function(b){b.TOP_BOTTOM="TB",b.BOTTOM_TOP="BT",b.LEFT_RIGHT="LR",b.RIGHT_LEFT="RL"})(s=e.Direction||(e.Direction={}));let l;(function(b){b.UP_LEFT="UL",b.UP_RIGHT="UR",b.DOWN_LEFT="DL",b.DOWN_RIGHT="DR"})(l=e.Alignment||(e.Alignment={}));let u;(function(b){b.NETWORK_SIMPLEX="network-simplex",b.TIGHT_TREE="tight-tree",b.LONGEST_PATH="longest-path"})(u=e.Ranker||(e.Ranker={}));let g;(function(b){b.LEFT="l",b.RIGHT="r",b.CENTER="c"})(g=e.LabelPosition||(e.LabelPosition={}))})(Je||(Je={}));var Ft=n(10368);const $t=(0,m.Z)(e=>({node:{fill:e.palette.primary.light,stroke:e.palette.primary.light},text:{fill:e.palette.primary.contrastText}}),{name:"BackstageDependencyGraphDefaultNode"});function Mt({node:{id:e}}){const s=$t(),[l,u]=f.useState(0),[g,b]=f.useState(0),I=f.useRef(null);f.useLayoutEffect(()=>{if(I.current){let{height:ge,width:me}=I.current.getBBox();ge=Math.round(ge),me=Math.round(me),(ge!==g||me!==l)&&(u(me),b(ge))}},[l,g]);const D=10,te=l+D*2,X=g+D*2;return(0,r.jsxs)("g",{children:[(0,r.jsx)("rect",{className:s.node,width:te,height:X,rx:10}),(0,r.jsx)("text",{ref:I,className:s.text,y:X/2,x:te/2,textAnchor:"middle",alignmentBaseline:"middle",children:e})]})}const Se="arrow-marker",Be="node",Ge="edge",et="label",at=(0,Ft.Z)(e=>({node:{transition:`${e.transitions.duration.shortest}ms`}}),{name:"BackstageDependencyGraphNode"}),Tt=e=>(0,r.jsx)(Mt,{...e});function pt({render:e=Tt,setNode:s,node:l}){const{width:u,height:g,x:b=0,y:I=0}=l,D=l,te=at(),X=f.useRef(null);return f.useLayoutEffect(()=>{if(X.current){let{height:ge,width:me}=X.current.getBBox();ge=Math.round(ge),me=Math.round(me),(ge!==g||me!==u)&&s(l.id,{...l,height:ge,width:me})}},[l,u,g,s]),(0,r.jsx)("g",{ref:X,"data-testid":Be,className:te.node,transform:`translate(${b-u/2},${I-g/2})`,children:e({node:D})})}var xe=n(76985),G=n(39829),pe=n(19574),Ee=n.n(pe);const He=(0,Ft.Z)(e=>({text:{fill:e.palette.textContrast}}),{name:"BackstageDependencyGraphDefaultLabel"});function gt({edge:{label:e}}){const s=He();return(0,r.jsx)("text",{className:s.text,textAnchor:"middle",children:e})}const Qe=(0,Ft.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"}),jt=e=>(0,r.jsx)(gt,{...e});function an({render:e=jt,setEdge:s,id:l,edge:u,curve:g}){const{x:b=0,y:I=0,width:D,height:te,points:X}=u,ge=u,me=Qe(),Me=f.useRef(null);f.useLayoutEffect(()=>{if(Me.current){let{height:ut,width:dt}=Me.current.getBBox();ut=Math.round(ut),dt=Math.round(dt),(ut!==te||dt!==D)&&s(l,{...u,height:ut,width:dt})}},[u,te,D,s,l]);let Le="";const Ye=f.useMemo(()=>xe.Z().x(ut=>ut.x).y(ut=>ut.y).curve(G[g]),[g]);if(X){const ut=X.filter(dt=>Ee()(dt.x)&&Ee()(dt.y));Le=Ye(ut)||""}return(0,r.jsxs)(r.Fragment,{children:[Le&&(0,r.jsx)("path",{"data-testid":Ge,className:me.path,d:Le}),ge.label?(0,r.jsx)("g",{ref:Me,"data-testid":et,className:me.label,transform:`translate(${b},${I})`,children:e({edge:ge})}):null]})}const tn="workspace";function ln(e){var s,l;const{edges:u,nodes:g,renderNode:b,direction:I=Je.Direction.TOP_BOTTOM,align:D,nodeMargin:te=50,edgeMargin:X=10,rankMargin:ge=50,paddingX:me=0,paddingY:Me=0,acyclicer:Le,ranker:Ye=Je.Ranker.NETWORK_SIMPLEX,labelPosition:ut=Je.LabelPosition.RIGHT,labelOffset:dt=10,edgeRanks:Gt=1,edgeWeight:Tn=1,renderLabel:zn,defs:Ot,zoom:rn="enabled",curve:mn="curveMonotoneX",fit:Wn="grow",...sr}=e,On=(0,Bt.Z)(),[Pr,uo]=f.useState(100),[Fr,Wo]=f.useState(100),vn=f.useRef(new(_e()).graphlib.Graph),[ho,La]=f.useState(((s=vn.current.graph())===null||s===void 0?void 0:s.width)||0),[po,Oa]=f.useState(((l=vn.current.graph())===null||l===void 0?void 0:l.height)||0),[li,Cs]=f.useState([]),[ka,Xn]=f.useState([]),hr=Math.max(ho,Pr),Lr=Math.max(po,Fr),Co=Math.min(po,Fr),Vn=Wn==="grow"?Lr:Co,pr=f.useMemo(()=>ft()(kn=>{if(!kn)return;const qn=Ut.Z(kn),Rn=Ut.Z(kn.getElementById(tn));function Ur(){qn.call(Nt.sP().scaleExtent([1,1/0]).on("zoom",qr=>{qr.transform.x=Math.min(0,Math.max(qr.transform.x,hr-hr*qr.transform.k)),qr.transform.y=Math.min(0,Math.max(qr.transform.y,Lr-Lr*qr.transform.k)),Rn.attr("transform",qr.transform)}))}rn==="enabled"?Ur():rn==="enable-on-click"&&qn.on("click",()=>Ur());const{width:Mr,height:ci}=kn.getBoundingClientRect();Pr!==Mr&&uo(Mr),Fr!==ci&&Wo(ci)},100),[Fr,Pr,hr,Lr,rn]),wo=f.useCallback(()=>{const kn=vn.current.nodes(),qn=vn.current.edges();kn.forEach(Rn=>{g.some(Mr=>Mr.id===Rn)||vn.current.removeNode(Rn)}),qn.forEach(Rn=>{u.some(Mr=>Mr.from===Rn.v&&Mr.to===Rn.w)||vn.current.removeEdge(Rn.v,Rn.w)}),g.forEach(Rn=>{const Ur=vn.current.nodes().find(Mr=>Rn.id===Mr);if(Ur&&vn.current.node(Ur)){const{width:Mr,height:ci,x:qr,y:Fl}=vn.current.node(Ur);vn.current.setNode(Ur,{...Rn,width:Mr,height:ci,x:qr,y:Fl})}else vn.current.setNode(Rn.id,{...Rn,width:0,height:0})}),u.forEach(Rn=>{vn.current.setEdge(Rn.from,Rn.to,{...Rn,label:Rn.label,width:0,height:0,labelpos:ut,labeloffset:dt,weight:Tn,minlen:Gt})})},[u,g,ut,dt,Tn,Gt]),Zr=f.useMemo(()=>ft()(()=>{_e().layout(vn.current);const{height:kn,width:qn}=vn.current.graph(),Rn=Math.max(0,kn||0),Ur=Math.max(0,qn||0);La(Ur),Oa(Rn),Cs(vn.current.nodes()),Xn(vn.current.edges())},250,{leading:!0}),[]);f.useEffect(()=>(vn.current.setGraph({rankdir:I,align:D,nodesep:te,edgesep:X,ranksep:ge,marginx:me,marginy:Me,acyclicer:Le,ranker:Ye}),wo(),Zr(),Zr.cancel),[Le,D,I,X,me,Me,te,ge,Ye,wo,Zr]);function ws(kn,qn){return vn.current.setNode(kn,qn),Zr(),vn.current}function Nl(kn,qn){return vn.current.setEdge(kn,qn),Zr(),vn.current}return(0,r.jsxs)("svg",{ref:pr,...sr,width:"100%",height:Vn,viewBox:`0 0 ${hr} ${Lr}`,children:[(0,r.jsxs)("defs",{children:[(0,r.jsx)("marker",{id:Se,viewBox:"0 0 24 24",markerWidth:"14",markerHeight:"14",refX:"16",refY:"12",orient:"auto",markerUnits:"strokeWidth",children:(0,r.jsx)("path",{fill:On.palette.textSubtle,d:"M8.59 16.59L13.17 12 8.59 7.41 10 6l6 6-6 6-1.41-1.41z"})}),Ot]}),(0,r.jsx)("g",{id:tn,children:(0,r.jsxs)("svg",{width:ho,height:po,y:Lr/2-po/2,x:hr/2-ho/2,viewBox:`0 0 ${ho} ${po}`,children:[ka.map(kn=>{const qn=vn.current.edge(kn);return qn?(0,r.jsx)(an,{id:kn,setEdge:Nl,render:zn,edge:qn,curve:mn},`${kn.v}-${kn.w}`):null}),li.map(kn=>{const qn=vn.current.node(kn);return qn?(0,r.jsx)(pt,{setNode:ws,render:b,node:qn},kn):null})]})})]})}var fn=n(72779),dn=n.n(fn),Bn,Fn;const ot=(0,m.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:(Bn=e.palette.banner.closeButtonColor)!==null&&Bn!==void 0?Bn:"inherit"},info:{backgroundColor:e.palette.banner.info},error:{backgroundColor:e.palette.banner.error},warning:{backgroundColor:(Fn=e.palette.banner.warning)!==null&&Fn!==void 0?Fn:e.palette.banner.error}}),{name:"BackstageDismissableBanner"}),on=e=>{var s;const{variant:l,message:u,id:g,fixed:b=!1}=e,I=ot(),te=useApi(storageApiRef).forBucket("notifications");var X;const ge=(X=te.snapshot("dismissedBanners").value)!==null&&X!==void 0?X:[],[me,Me]=useState(new Set(ge)),Le=useObservable(te.observe$("dismissedBanners"));useEffect(()=>{var ut;if(!((ut=Le)===null||ut===void 0)&&ut.value){var dt,Gt;const Tn=(Gt=(dt=Le)===null||dt===void 0?void 0:dt.value)!==null&&Gt!==void 0?Gt:[];Me(new Set(Tn))}},[(s=Le)===null||s===void 0?void 0:s.value]);const Ye=()=>{te.set("dismissedBanners",[...me,g])};return _jsx(Snackbar,{anchorOrigin:b?{vertical:"bottom",horizontal:"center"}:{vertical:"top",horizontal:"center"},open:!me.has(g),classes:{root:classNames(I.root,!b&&I.topPosition)},children:_jsx(SnackbarContent,{classes:{root:classNames(I.content,I[l]),message:I.message},message:u,action:[_jsx(IconButton,{title:"Permanently dismiss this message",className:I.button,onClick:Ye,children:_jsx(Close,{className:I.icon})},"dismiss")]})})};var Vt=n(60905),st=n(90436),Sn=n.p+"static/missingAnnotation.67f79e98..svg",qt=n.p+"static/noInformation.4b426325..svg",Cn=n.p+"static/createComponent.975d1e1e..svg",yn=n.p+"static/noBuild.1715fa71..svg";const Hn=(0,m.Z)({generalImg:{width:"95%",zIndex:2,position:"relative",left:"50%",top:"50%",transform:"translate(-50%, 15%)"}},{name:"BackstageEmptyStateImage"}),fr=({missing:e})=>{const s=Hn();switch(e){case"field":return(0,r.jsx)("img",{src:Sn,className:s.generalImg,alt:"annotation is missing"});case"info":return(0,r.jsx)("img",{src:qt,alt:"no Information",className:s.generalImg});case"content":return(0,r.jsx)("img",{src:Cn,alt:"create Component",className:s.generalImg});case"data":return(0,r.jsx)("img",{src:yn,alt:"no Build",className:s.generalImg});default:return null}},$n=(0,m.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 _n(e){const{title:s,description:l,missing:u,action:g}=e,b=$n();return(0,r.jsxs)(Vt.Z,{container:!0,direction:"row",justifyContent:"space-around",alignItems:"flex-start",className:b.root,spacing:2,children:[(0,r.jsx)(Vt.Z,{item:!0,xs:12,md:6,children:(0,r.jsxs)(Vt.Z,{container:!0,direction:"column",children:[(0,r.jsx)(Vt.Z,{item:!0,xs:!0,children:(0,r.jsx)(st.Z,{variant:"h5",children:s})}),(0,r.jsx)(Vt.Z,{item:!0,xs:!0,children:(0,r.jsx)(st.Z,{variant:"body1",children:l})}),(0,r.jsx)(Vt.Z,{item:!0,xs:!0,className:b.action,children:g})]})}),(0,r.jsx)(Vt.Z,{item:!0,xs:12,md:6,className:b.imageContainer,children:typeof u=="string"?(0,r.jsx)(fr,{missing:u}):u.customImage})]})}const Zn=`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`,Cr=/^.*ANNOTATION.*$/m,Gn=Zn.match(Cr)[0],Re=Zn.split(`
|
|
12
|
+
`).findIndex(e=>Cr.test(e)),ne=(0,m.Z)(e=>({code:{borderRadius:6,margin:e.spacing(2,0),background:e.palette.type==="dark"?"#444":e.palette.common.white}}),{name:"BackstageMissingAnnotationEmptyState"});function Te(e){return Array.from(Array(e+1).keys(),s=>s+Re)}function ze(e){const s=e.map(l=>Gn.replace("ANNOTATION",l)).join(`
|
|
13
|
+
`);return Zn.replace(Gn,s)}function ct(e){const s=e.length<=1;return(0,r.jsxs)(r.Fragment,{children:["The ",s?"annotation":"annotations"," ",e.map(l=>(0,r.jsx)("code",{children:l})).reduce((l,u)=>(0,r.jsxs)(r.Fragment,{children:[l,", ",u]}))," ",s?"is":"are"," missing. You need to add the"," ",s?"annotation":"annotations"," to your component if you want to enable this tool."]})}function Rt(e){const{annotation:s,readMoreUrl:l}=e,u=Array.isArray(s)?s:[s],g=l||"https://backstage.io/docs/features/software-catalog/well-known-annotations",b=ne();return(0,r.jsx)(_n,{missing:"field",title:"Missing Annotation",description:ct(u),action:(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(st.Z,{variant:"body1",children:"Add the annotation to your component YAML as shown in the highlighted example below:"}),(0,r.jsx)(j.Z,{className:b.code,children:(0,r.jsx)(ve,{text:ze(u),language:"yaml",showLineNumbers:!0,highlightedNumbers:Te(u.length),customStyle:{background:"inherit",fontSize:"115%"}})}),(0,r.jsx)(q.Z,{color:"primary",component:_.r,to:g,children:"Read more"})]})})}var Ht=n(11776),nn=n(38402),gn=n(49378),sn=n(41128),hn=n(27616),le=n(8284),de=n(70660),Y=n(91750),v=n(38016);const L=(e,s)=>(s.palette.type==="light"?sn._j:sn.$n)(s.palette[e].light,.6),M=(e,s)=>(s.palette.type==="light"?sn.$n:sn._j)(s.palette[e].light,.9),W=(0,m.Z)(e=>({root:{marginRight:e.spacing(1),fill:({severity:s})=>L(s,e)}})),ue=({severity:e})=>{const s=W({severity:e});return(0,r.jsx)(Y.Z,{classes:s})},Ce=({severity:e})=>{const s=W({severity:e});return(0,r.jsx)(v.Z,{classes:s})},Oe=(0,m.Z)(e=>({panel:{backgroundColor:({severity:s})=>M(s,e),color:({severity:s})=>L(s,e),verticalAlign:"middle"},summary:{display:"flex",flexDirection:"row"},summaryText:{color:({severity:s})=>L(s,e),fontWeight:e.typography.fontWeightBold},message:{width:"100%",display:"block",color:({severity:s})=>L(s,e),backgroundColor:({severity:s})=>M(s,e)},details:{width:"100%",display:"block",color:e.palette.textContrast,backgroundColor:e.palette.background.default,border:`1px solid ${e.palette.border}`,padding:e.spacing(2),fontFamily:"sans-serif"}}),{name:"BackstageWarningPanel"}),tt=e=>e.charAt(0).toLocaleUpperCase("en-US")+e.slice(1);function nt(e){const{severity:s="warning",title:l,message:u,children:g,defaultExpanded:b}=e,I=Oe({severity:s}),D=tt(s)+(l?`: ${l}`:"");return(0,r.jsxs)(hn.Z,{defaultExpanded:b!=null?b:!1,className:I.panel,role:"alert",children:[(0,r.jsxs)(le.Z,{expandIcon:(0,r.jsx)(Ce,{severity:s}),className:I.summary,children:[(0,r.jsx)(ue,{severity:s}),(0,r.jsx)(st.Z,{className:I.summaryText,variant:"subtitle1",children:D})]}),(u||g)&&(0,r.jsx)(de.Z,{children:(0,r.jsxs)(Vt.Z,{container:!0,children:[u&&(0,r.jsx)(Vt.Z,{item:!0,xs:12,children:(0,r.jsx)(st.Z,{className:I.message,variant:"body1",children:u})}),g&&(0,r.jsx)(Vt.Z,{item:!0,xs:12,className:I.details,children:g})]})})]})}const mt=(0,m.Z)(e=>({text:{fontFamily:"monospace",whiteSpace:"pre",overflowX:"auto",marginRight:e.spacing(2)},divider:{margin:e.spacing(2)}}),{name:"BackstageErrorPanel"}),xt=({error:e,message:s,stack:l,children:u})=>{const g=mt();return(0,r.jsxs)(Ht.Z,{dense:!0,children:[(0,r.jsxs)(nn.Z,{alignItems:"flex-start",children:[(0,r.jsx)(gn.Z,{classes:{secondary:g.text},primary:"Error",secondary:e}),(0,r.jsx)(F,{text:e})]}),(0,r.jsxs)(nn.Z,{alignItems:"flex-start",children:[(0,r.jsx)(gn.Z,{classes:{secondary:g.text},primary:"Message",secondary:s}),(0,r.jsx)(F,{text:s})]}),l&&(0,r.jsxs)(nn.Z,{alignItems:"flex-start",children:[(0,r.jsx)(gn.Z,{classes:{secondary:g.text},primary:"Stack Trace",secondary:l}),(0,r.jsx)(F,{text:l})]}),u]})};function it(e){const{title:s,error:l,defaultExpanded:u,children:g}=e;return(0,r.jsx)(nt,{severity:"error",title:s!=null?s:l.message,defaultExpanded:u,children:(0,r.jsx)(xt,{error:l.name,message:l.message,stack:l.stack,children:g})})}var $e=n(85256);const vt=(0,m.Z)(e=>({text:{fontFamily:"monospace",whiteSpace:"pre",overflowX:"auto",marginRight:e.spacing(2)},divider:{margin:e.spacing(2)}}),{name:"BackstageResponseErrorPanel"});function Xt(e){var s;const{title:l,error:u,defaultExpanded:g}=e,b=vt();if(u.name!=="ResponseError")return(0,r.jsx)(it,{title:l!=null?l:u.message,defaultExpanded:g,error:u});const{body:I,cause:D}=u,{request:te,response:X}=I,ge=`${X.statusCode}: ${D.name}`,me=te&&`${te.method} ${te.url}`,Me=D.message.replace(/\\n/g,`
|
|
14
|
+
`),Le=(s=D.stack)===null||s===void 0?void 0:s.replace(/\\n/g,`
|
|
15
|
+
`),Ye=JSON.stringify(I,void 0,2);return(0,r.jsxs)(it,{title:l!=null?l:u.message,defaultExpanded:g,error:{name:ge,message:Me,stack:Le},children:[me&&(0,r.jsxs)(nn.Z,{alignItems:"flex-start",children:[(0,r.jsx)(gn.Z,{classes:{secondary:b.text},primary:"Request",secondary:te?`${me}`:void 0}),(0,r.jsx)(F,{text:me})]}),(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)($e.Z,{component:"li",className:b.divider}),(0,r.jsx)(nn.Z,{alignItems:"flex-start",children:(0,r.jsx)(gn.Z,{classes:{secondary:b.text},primary:"Full Error as JSON"})}),(0,r.jsx)(ve,{language:"json",text:Ye,showCopyCodeButton:!0})]})]})}var Et=n(28316);function Zt(e){const s=document.createElement("div");return s.setAttribute("id",e),s}function _t(e){document.body.insertBefore(e,document.body.lastElementChild.nextElementSibling)}function wn(e){const s=useRef(null);useEffect(function(){const g=document.querySelector(`#${e}`),b=g||Zt(e);return g||_t(b),b.appendChild(s.current),function(){s.current.remove(),b.childNodes.length===-1&&b.remove()}},[e]);function l(){return s.current||(s.current=document.createElement("div")),s.current}return l()}var Kt=null;const bt="core.calloutSeen";function It(){const[e,s]=useState(()=>{const u=localStorage.getItem(bt);return u?JSON.parse(u):{}}),l=useCallback((u,g)=>{const b=localStorage.getItem(bt),D={...b?JSON.parse(b):{},[u]:g};s(D),localStorage.setItem(bt,JSON.stringify(D))},[]);return{states:e,setState:l}}function Yt(e){const{states:s,setState:l}=It(),u=useCallback(()=>{l(e,!0)},[l,e]);return{seen:s[e]===!0,markSeen:u}}function zt(e){const{seen:s,markSeen:l}=Yt(e);return{show:s===!1,hide:l}}const gr=(0,m.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 er(e){var s,l,u,g,b,I,D,te;const{featureId:X,title:ge,description:me,children:Me}=e,{show:Le,hide:Ye}=useShowCallout(X),ut=usePortal("core.callout"),dt=useRef(null),[Gt,Tn]=useState(),zn=gr(),Ot=useCallback(()=>{if(dt.current){const rn=dt.current.getBoundingClientRect(),mn=Math.max(rn.width,rn.height),Wn=800,sr=rn.x-(mn-rn.width)/2-Wn,On=rn.y-(mn-rn.height)/2-Wn,Pr=mn+2*Wn,uo=450,Fr=rn.x+rn.width/2-uo,Wo=rn.y-(mn-rn.height)/2+mn+20;Tn({dotLeft:sr,dotTop:On,dotSize:Pr,borderWidth:Wn,textTop:Wo,textLeft:Fr,textWidth:uo})}},[]);return useEffect(()=>(window.addEventListener("resize",Ot),window.addEventListener("scroll",Ot),()=>{window.removeEventListener("resize",Ot),window.removeEventListener("scroll",Ot)}),[Ot]),useLayoutEffect(Ot,[dt.current,Ot]),Le?_jsxs(_Fragment,{children:[_jsx(Box,{className:zn.featureWrapper,ref:dt,children:Me}),createPortal(_jsx(Box,{className:zn.backdrop,children:_jsx(ClickAwayListener,{onClickAway:Ye,children:_jsxs(_Fragment,{children:[_jsx(Box,{className:zn.dot,"data-testid":"dot",style:{left:(s=Gt)===null||s===void 0?void 0:s.dotLeft,top:(l=Gt)===null||l===void 0?void 0:l.dotTop,width:(u=Gt)===null||u===void 0?void 0:u.dotSize,height:(g=Gt)===null||g===void 0?void 0:g.dotSize,borderWidth:(b=Gt)===null||b===void 0?void 0:b.borderWidth},onClick:Ye,onKeyDown:Ye,role:"button",tabIndex:0,children:_jsx(Box,{className:zn.pulseCircle})}),_jsxs(Box,{className:zn.text,"data-testid":"text",style:{left:(I=Gt)===null||I===void 0?void 0:I.textLeft,top:(D=Gt)===null||D===void 0?void 0:D.textTop,width:(te=Gt)===null||te===void 0?void 0:te.textWidth},children:[_jsx(Typography,{variant:"h2",paragraph:!0,children:ge}),_jsx(Typography,{children:me})]})]})})}),ut)]}):_jsx(_Fragment,{children:Me})}var ir=n(35292);const bn=(0,m.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 ar({color:e="primary",disabled:s=!1,href:l="#",icon:u=(0,r.jsx)(ir.Z,{}),label:g,onClick:b,title:I}){const D=bn();return s?(0,r.jsxs)(j.Z,{title:I,className:dn()(D.link,D.disabled),children:[u,(0,r.jsx)(st.Z,{variant:"caption",component:"span",className:D.label,children:g})]}):(0,r.jsxs)(_.r,{title:I,className:dn()(D.link,D[e]),to:l,onClick:b,children:[u,(0,r.jsx)(st.Z,{variant:"caption",component:"span",className:D.label,children:g})]})}const Kn=(0,m.Z)(e=>({links:{margin:e.spacing(2,0),display:"grid",gridAutoFlow:"column",gridAutoColumns:"min-content",gridGap:e.spacing(3)}}),{name:"BackstageHeaderIconLinkRow"});function zr(e){const{links:s}=e,l=Kn();return(0,r.jsx)("nav",{className:l.links,children:s.map((u,g)=>(0,r.jsx)(ar,{...u},g+1))})}const tr=e=>{const s=e==="dark"?"16%":"97%";return`
|
|
16
|
+
hsl(0, 0%, ${s}) 0%,
|
|
17
|
+
hsla(0, 0%, ${s}, 0.987) 8.1%,
|
|
18
|
+
hsla(0, 0%, ${s}, 0.951) 15.5%,
|
|
19
|
+
hsla(0, 0%, ${s}, 0.896) 22.5%,
|
|
20
|
+
hsla(0, 0%, ${s}, 0.825) 29%,
|
|
21
|
+
hsla(0, 0%, ${s}, 0.741) 35.3%,
|
|
22
|
+
hsla(0, 0%, ${s}, 0.648) 41.2%,
|
|
23
|
+
hsla(0, 0%, ${s}, 0.55) 47.1%,
|
|
24
|
+
hsla(0, 0%, ${s}, 0.45) 52.9%,
|
|
25
|
+
hsla(0, 0%, ${s}, 0.352) 58.8%,
|
|
26
|
+
hsla(0, 0%, ${s}, 0.259) 64.7%,
|
|
27
|
+
hsla(0, 0%, ${s}, 0.175) 71%,
|
|
28
|
+
hsla(0, 0%, ${s}, 0.104) 77.5%,
|
|
29
|
+
hsla(0, 0%, ${s}, 0.049) 84.5%,
|
|
30
|
+
hsla(0, 0%, ${s}, 0.013) 91.9%,
|
|
31
|
+
hsla(0, 0%, ${s}, 0) 100%
|
|
32
|
+
`},Gr=100,Or=10,S=(0,m.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:Gr,height:`calc(100% + ${Or}px)`,transition:"opacity 300ms",pointerEvents:"none"},fadeLeft:{left:-Or,background:`linear-gradient(90deg, ${tr(e.palette.type)})`},fadeRight:{right:-Or,background:`linear-gradient(270deg, ${tr(e.palette.type)})`},fadeHidden:{opacity:0},button:{position:"absolute"},buttonLeft:{left:-e.spacing(2)},buttonRight:{right:-e.spacing(2)}}),{name:"BackstageHorizontalScrollGrid"});function d(e){const[[s,l],u]=React.useState([0,0]);return React.useLayoutEffect(()=>{const g=e.current;if(!g){u([0,0]);return}const b=()=>{const I=g.scrollLeft,D=g.scrollWidth-g.offsetWidth-g.scrollLeft;u([I,D])};return b(),g.addEventListener("scroll",b),window.addEventListener("resize",b),()=>{g.removeEventListener("scroll",b),window.removeEventListener("resize",b)}},[e]),[s,l]}function C(e,s,l){const[u,g]=React.useState(0);return React.useLayoutEffect(()=>{if(u===0)return;const b=window.performance.now(),I=requestAnimationFrame(D=>{if(!e.current)return;const te=D-b,X=Math.abs(u)*te/s,me=Math.max(l,X)*Math.sign(u);e.current.scrollBy({left:me});const Me=u-me;Math.sign(u)!==Math.sign(Me)?g(0):g(Me)});return()=>cancelAnimationFrame(I)},[e,u,s,l]),g}function A(e){const{scrollStep:s=100,scrollSpeed:l=50,minScrollDistance:u=5,children:g,...b}=e,I=S(e),D=React.useRef(),[te,X]=d(D),ge=C(D,l,u),me=Me=>{D.current&&ge(Me?s:-s)};return _jsxs(Box,{...b,className:I.root,children:[_jsx(Grid,{container:!0,direction:"row",wrap:"nowrap",className:I.container,ref:D,children:g}),_jsx(Box,{className:classNames(I.fade,I.fadeLeft,{[I.fadeHidden]:te===0})}),_jsx(Box,{className:classNames(I.fade,I.fadeRight,{[I.fadeHidden]:X===0})}),te>0&&_jsx(IconButton,{title:"Scroll Left",onClick:()=>me(!1),className:classNames(I.button,I.buttonLeft,{}),children:_jsx(ChevronLeftIcon,{})}),X>0&&_jsx(IconButton,{title:"Scroll Right",onClick:()=>me(!0),className:classNames(I.button,I.buttonRight,{}),children:_jsx(ChevronRightIcon,{})})]})}const K=(0,m.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 ye(e){const s=K(e),{shorthand:l,alpha:u}=e;return l?_jsx(Typography,{component:"span",className:s[u?"alpha":"beta"],style:{fontSize:"120%"},children:u?_jsx(_Fragment,{children:"\u03B1"}):_jsx(_Fragment,{children:"\u03B2"})}):_jsx(Typography,{component:"span",className:s[u?"alpha":"beta"],children:u?"Alpha":"Beta"})}const we=(0,f.lazy)(()=>Promise.all([n.e(1093),n.e(6051)]).then(n.bind(n,76051)).then(e=>({default:e.RealLogViewer})));function Ze(e){const{Progress:s}=(0,p.qD)().getComponents();return(0,r.jsx)(f.Suspense,{fallback:(0,r.jsx)(s,{}),children:(0,r.jsx)(we,{...e})})}var qe=n(28865),Jt=n(60251);const cn=(0,m.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"}),pn=(e,s)=>s?typeof s=="string"?e+s:f.Children.toArray(s.props.children).reduce(pn,e):e,In=({level:e,children:s})=>{const g=f.Children.toArray(s).reduce(pn,"").toLocaleLowerCase("en-US").replace(/\W/g,"-");return f.createElement(`h${e}`,{id:g},s)},Wt={code:({inline:e,className:s,children:l,...u})=>{const g=String(l).replace(/\n+$/,""),b=/language-(\w+)/.exec(s||"");return!e&&b?(0,r.jsx)(ve,{language:b[1],text:g}):(0,r.jsx)("code",{className:s,...u,children:l})},h1:In,h2:In,h3:In,h4:In,h5:In,h6:In};function un(e){const{content:s,dialect:l="gfm",linkTarget:u,transformLinkUri:g,transformImageUri:b,className:I}=e,D=cn();return(0,r.jsx)(qe.D,{remarkPlugins:l==="gfm"?[Jt.Z]:[],className:`${D.markdown} ${I}`,children:s,components:Wt,linkTarget:u,transformLinkUri:g,transformImageUri:b})}var lr=n(23054);const cr=(0,m.Z)(e=>({root:{paddingLeft:e.spacing(3)}}),{name:"BackstageLoginRequestListItem"}),wr=({request:e,busy:s,setBusy:l})=>{const u=cr(),[g,b]=useState(),I=async()=>{l(!0);try{await e.trigger()}catch(te){b(isError(te)?te.message:"An unspecified error occurred")}finally{l(!1)}},D=e.provider.icon;return _jsxs(ListItem,{disabled:s,classes:{root:u.root},children:[_jsx(ListItemAvatar,{children:_jsx(D,{fontSize:"large"})}),_jsx(ListItemText,{primary:e.provider.title,secondary:g&&_jsx(Typography,{color:"error",children:g})}),_jsx(Button,{color:"primary",variant:"contained",onClick:I,children:"Log in"})]})};var Yn=null;const jo=(0,m.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 Vo(e){const s=jo(),[l,u]=useState(!1),g=useApi(oauthRequestApiRef),b=useApi(configApiRef);var I;const D=(I=b.getOptionalBoolean("enableExperimentalRedirectFlow"))!==null&&I!==void 0?I:!1,te=useObservable(useMemo(()=>g.authRequest$(),[g]),[]),X=()=>{te.forEach(ge=>ge.reject())};return _jsxs(Dialog,{open:Boolean(te.length),fullWidth:!0,maxWidth:"xs",classes:{paper:s.dialog},"aria-labelledby":"oauth-req-dialog-title",children:[_jsxs("main",{children:[_jsxs(DialogTitle,{classes:{root:s.title},id:"oauth-req-dialog-title",children:[_jsx(Typography,{className:s.titleHeading,variant:"h1",variantMapping:{h1:"span"},children:"Login Required"}),D?_jsx(Typography,{children:"This will trigger a http redirect to OAuth Login."}):null]}),_jsx(DialogContent,{dividers:!0,classes:{root:s.contentList},children:_jsx(List,{children:te.map(ge=>_jsx(LoginRequestListItem,{request:ge,busy:l,setBusy:u},ge.provider.title))})})]}),_jsx(DialogActions,{classes:{root:s.actionButtons},children:_jsx(Button,{onClick:X,children:"Reject All"})})]})}var Ho=n(15277),_r=n.n(Ho),kr=n(29862);const mr=(0,m.Z)({container:{overflow:"visible !important"}},{name:"BackstageOverflowTooltip"});function Kr(e){const[s,l]=(0,f.useState)(!1),u=(0,kr.t)(),g=mr(),b=D=>{u()&&l(D)};var I;return(0,r.jsx)(T.ZP,{title:(I=e.title)!==null&&I!==void 0?I:e.text||"",placement:e.placement,disableHoverListener:!s,children:(0,r.jsx)(_r(),{text:e.text,line:e.line,onToggled:b,containerClassName:g.container})})}var eo=n(67358);function Eo(e){const s=(0,re.Z)(),[l,u]=(0,f.useState)(!1);return(0,f.useEffect)(()=>{const g=setTimeout(()=>u(!0),s.transitions.duration.short);return()=>clearTimeout(g)},[s.transitions.duration.short]),l?(0,r.jsx)(eo.Z,{...e,"data-testid":"progress"}):(0,r.jsx)(j.Z,{display:"none"})}var Go=n(94339),to=n(14503),Ko=n(24579),Ao=n(32552),Pn=n(15459),nr=n(27597);const no=(0,m.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 ro(e){const{link:s,title:l,onClick:u}=e,g=no();return(0,r.jsxs)(j.Z,{children:[(0,r.jsx)($e.Z,{}),(0,r.jsx)(_.r,{to:s,onClick:u,underline:"none",children:(0,r.jsxs)(j.Z,{display:"flex",alignItems:"center",className:g.root,children:[(0,r.jsx)(j.Z,{className:g.boxTitle,fontWeight:"fontWeightBold",m:1,children:(0,r.jsx)(st.Z,{children:(0,r.jsx)("strong",{children:l})})}),(0,r.jsx)(nr.Z,{className:g.arrow})]})})]})}const Yo=e=>{const{slackChannel:s}=e;if(s){if(typeof s=="string")return(0,r.jsxs)(st.Z,{children:["Please contact ",s," for help."]});if(!s.href)return(0,r.jsxs)(st.Z,{children:["Please contact ",s.name," for help."]})}else return null;return(0,r.jsx)(se,{to:s.href,variant:"contained",children:s.name})},fo=class extends f.Component{componentDidCatch(s,l){console.error(`ErrorBoundary, error: ${s}, info: ${l}`),this.setState({error:s,errorInfo:l})}render(){const{slackChannel:s,children:l}=this.props,{error:u}=this.state;return u?(0,r.jsx)(it,{title:"Something Went Wrong",error:u,children:(0,r.jsx)(Yo,{slackChannel:s})}):l}constructor(s){super(s),this.state={error:void 0,errorInfo:void 0}}},go=(0,m.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"}),To=(0,Pn.Z)(e=>({root:{display:"inline-block",padding:e.spacing(8,8,0,0),float:"right"}}),{name:"BackstageInfoCardCardActionsTopRight"})(to.Z),Ro={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 rr(e){const{title:s,subheader:l,divider:u=!0,deepLink:g,slackChannel:b,errorBoundaryProps:I,variant:D,children:te,headerStyle:X,headerProps:ge,icon:me,action:Me,actionsClassName:Le,actions:Ye,cardClassName:ut,actionsTopRight:dt,className:Gt,noPadding:Tn,titleTypographyProps:zn}=e,Ot=go();let rn={},mn={};D&&D.split(/[\s]+/g).forEach(Pr=>{rn={...rn,...Ro.card[Pr]},mn={...mn,...Ro.cardContent[Pr]}});const Wn=()=>!l&&!me?null:(0,r.jsxs)("div",{className:Ot.headerSubheader,"data-testid":"info-card-subheader",children:[l&&(0,r.jsx)("div",{className:Ot.subheader,children:l}),me]}),sr=I||(b?{slackChannel:b}:{});return(0,r.jsx)(Go.Z,{style:rn,className:Gt,children:(0,r.jsxs)(fo,{...sr,children:[s&&(0,r.jsx)(Ao.Z,{classes:{root:Ot.header,title:Ot.headerTitle,subheader:Ot.headerSubheader,avatar:Ot.headerAvatar,action:Ot.headerAction,content:Ot.headerContent},title:s,subheader:Wn(),action:Me,style:{...X},titleTypographyProps:zn,...ge}),dt&&(0,r.jsx)(To,{children:dt}),u&&(0,r.jsx)($e.Z,{}),(0,r.jsx)(Ko.Z,{className:dn()(ut,{[Ot.noPadding]:Tn}),style:mn,children:te}),Ye&&(0,r.jsx)(to.Z,{className:Le,children:Ye}),g&&(0,r.jsx)(ro,{...g})]})})}var js=n(35585);const Io=(0,m.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"}),mo={fractional:!0,inverse:!1,unit:"%",max:100},Jo=({palette:e,value:s,inverse:l,max:u})=>{if(isNaN(s))return"#ddd";const g=u||mo.max,b=l?g-s:s;return b<g/3?e.status.error:b<g*(2/3)?e.status.warning:e.status.ok};function Es(e){const[s,l]=useState(null),{getColor:u=Jo}=e,g=Io(e),{palette:b}=useTheme(),{value:I,fractional:D,inverse:te,unit:X,max:ge,description:me}={...mo,...e},Me=D?Math.round(I*ge):I,Le=ge!==100?Math.round(I):Me,[Ye,ut]=useState(!1);return useEffect(()=>{const dt=s,Gt=()=>ut(!0),Tn=()=>ut(!1);return dt&&me?(dt.addEventListener("mouseenter",Gt),dt.addEventListener("mouseleave",Tn),()=>{dt.removeEventListener("mouseenter",Gt),dt.removeEventListener("mouseleave",Tn)}):()=>{ut(!1)}},[me,s]),_jsxs(Box,{ref:l,className:g.root,children:[_jsx(Circle,{strokeLinecap:"butt",percent:Me,strokeWidth:12,trailWidth:12,strokeColor:u({palette:b,value:Le,inverse:te,max:ge}),className:g.circle}),me&&Ye?_jsx(Box,{className:g.description,children:me}):_jsx(Box,{className:g.overlay,children:isNaN(I)?"N/A":`${Le}${X}`})]})}const vo=(0,m.Z)({root:{height:"100%",width:250}},{name:"BackstageGaugeCard"});function Qo(e){const s=vo(e),{title:l,subheader:u,progress:g,inverse:b,deepLink:I,description:D,icon:te,variant:X,getColor:ge}=e,me={inverse:b,description:D,getColor:ge,value:g};return _jsx(Box,{className:s.root,children:_jsx(InfoCard,{title:l,subheader:u,deepLink:I,variant:X,icon:te,children:_jsx(Gauge,{...me})})})}function As(e){const{value:s,getColor:l=getProgressColor,width:u="thick"}=e,{palette:g}=useTheme();if(isNaN(s))return null;let b=Math.round(s*100*100)/100;b>100&&(b=100);const I=u==="thick"?4:1,D=l({palette:g,value:b,inverse:!1,max:100});return _jsx(Tooltip,{title:`${b}%`,children:_jsx(Typography,{component:"span",children:_jsx(Line,{percent:b,strokeWidth:I,trailWidth:I,strokeColor:D})})})}var Xo=n(21324),yo=n(7089),oo=n(42494),Yr=n(74603),Wr=n(56939),Jr=n(12231),Po=n(73698),xn=n(12420),Lo=n(72379);const qo=(0,m.Z)(e=>(0,xn.Z)({icon:{position:"absolute",right:e.spacing(.5),pointerEvents:"none"}}),{name:"BackstageClosedDropdown"});var Ts=()=>{const e=qo();return(0,r.jsx)(Lo.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 Rs=(0,m.Z)(e=>(0,xn.Z)({icon:{position:"absolute",right:e.spacing(.5),pointerEvents:"none"}}),{name:"BackstageOpenedDropdown"});var Is=()=>{const e=Rs();return(0,r.jsx)(Lo.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 Br=(0,Pn.Z)(e=>(0,xn.Z)({root:{"label + &":{marginTop:e.spacing(3)},"&.Mui-focused > div[role=button]":{borderColor:e.palette.primary.main}},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"})(Yr.Z),_o=(0,m.Z)(e=>(0,xn.Z)({formControl:{margin:e.spacing(1,0),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 Oo(e){const{multiple:s,items:l,label:u,placeholder:g,selected:b,onChange:I,triggerReset:D,native:te=!1,disabled:X=!1,margin:ge}=e,me=_o(),[Me,Le]=(0,f.useState)(b||(s?[]:"")),[Ye,ut]=(0,f.useState)(!1);(0,f.useEffect)(()=>{Le(s?[]:"")},[D,s]),(0,f.useEffect)(()=>{Le(b||(s?[]:""))},[b,s]);const dt=Ot=>{Le(Ot.target.value),I(Ot.target.value)},Gt=Ot=>{if(X){Ot.preventDefault();return}ut(rn=>s&&!(Ot.target instanceof HTMLElement)?!0:!rn)},Tn=()=>{ut(!1)},zn=Ot=>()=>{const rn=Me.filter(mn=>mn!==Ot);Le(rn),I(rn)};return(0,r.jsx)(j.Z,{className:me.root,children:(0,r.jsxs)(oo.Z,{className:me.formControl,children:[(0,r.jsx)(Wr.Z,{className:me.formLabel,children:u}),(0,r.jsxs)(Po.Z,{"aria-label":u,value:Me,native:te,disabled:X,"data-testid":"select",displayEmpty:!0,multiple:s,margin:ge,onChange:dt,open:Ye,onOpen:Gt,onClose:Tn,input:(0,r.jsx)(Br,{}),label:u,renderValue:Ot=>{var rn;return s&&Me.length!==0?(0,r.jsx)(j.Z,{className:me.chips,children:Ot.map(mn=>{var Wn,sr;return(0,r.jsx)(yo.Z,{label:(Wn=l.find(On=>On.value===mn))===null||Wn===void 0?void 0:Wn.label,clickable:!0,onDelete:zn(mn),className:me.chip},(sr=l.find(On=>On.value===mn))===null||sr===void 0?void 0:sr.value)})}):(0,r.jsx)(st.Z,{children:Me.length===0?g||"":(rn=l.find(mn=>mn.value===Ot))===null||rn===void 0?void 0:rn.label})},IconComponent:()=>Ye?(0,r.jsx)(Is,{}):(0,r.jsx)(Ts,{}),MenuProps:{anchorOrigin:{vertical:"bottom",horizontal:"left"},transformOrigin:{vertical:"top",horizontal:"left"},getContentAnchorEl:null},children:[g&&!s&&(0,r.jsx)(Jr.Z,{value:[],children:g}),te?l&&l.map(Ot=>(0,r.jsx)("option",{value:Ot.value,children:Ot.label},Ot.value)):l&&l.map(Ot=>(0,r.jsxs)(Jr.Z,{value:Ot.value,children:[s&&(0,r.jsx)(Xo.Z,{color:"primary",checked:Me.includes(Ot.value)||!1,className:me.checkbox}),Ot.label]},Ot.value))]})]})})}const xo=()=>{},so=f.createContext({stepperLength:0,stepIndex:0,setStepIndex:xo,stepHistory:[],setStepHistory:xo,onStepChange:xo});function Ps(e){const{children:s,elevated:l,onStepChange:u,activeStep:g=0}=e,[b,I]=useState(g),[D,te]=useState([0]);useEffect(()=>{I(g)},[g]);const X=[];let ge;return Children.forEach(s,me=>{isValidElement(me)&&(me.props.end?ge=me:X.push(me))}),_jsxs(_Fragment,{children:[_jsx(so.Provider,{value:{stepIndex:b,setStepIndex:I,stepHistory:D,setStepHistory:te,onStepChange:u,stepperLength:Children.count(s)},children:_jsx(MuiStepper,{activeStep:b,orientation:"vertical",elevation:l?2:0,children:X})}),b>=Children.count(s)-1&&ge]})}const es=(0,m.Z)(e=>({root:{marginTop:e.spacing(3),"& button":{marginRight:e.spacing(1)}}}),{name:"BackstageSimpleStepperFooter"}),ts=({text:e,handleClick:s})=>_jsx(Button,{onClick:s,children:e||"Reset"}),ns=({text:e,handleClick:s,disabled:l,last:u,stepIndex:g})=>_jsx(Button,{variant:"contained",color:"primary",disabled:l,"data-testid":`nextButton-${g}`,onClick:s,children:e||(u?"Finish":"Next")}),ko=({text:e,handleClick:s,disabled:l,stepIndex:u})=>_jsx(Button,{variant:"outlined",color:"primary",disabled:l,"data-testid":`skipButton-${u}`,onClick:s,children:e||"Skip"}),y=({text:e,handleClick:s,disabled:l,stepIndex:u})=>_jsx(Button,{onClick:s,"data-testid":`backButton-${u}`,disabled:l,children:e||"Back"}),E=({actions:e={},children:s})=>{const l=es(),{stepperLength:u,stepIndex:g,setStepIndex:b,stepHistory:I,setStepHistory:D,onStepChange:te}=useContext(VerticalStepperContext),X=(Le,Ye)=>{Ye&&Ye(),te&&te(g,Le),b(Le)},ge=()=>{const Le=e.nextStep?e.nextStep(g,u-1):g+1;X(Le,e.onNext),D([...I,Le])},me=()=>{I.pop(),X(I[I.length-1],e.onBack),D([...I])},Me=()=>{X(0,e.onRestart),D([0])};return _jsxs(Box,{className:l.root,children:[[void 0,!0].includes(e.showBack)&&g!==0&&_jsx(y,{text:e.backText,handleClick:me,disabled:g===0,stepIndex:g}),e.showSkip&&_jsx(ko,{text:e.skipText,handleClick:ge,disabled:!!u&&g>=u||!!e.canSkip&&!e.canSkip(),stepIndex:g}),[void 0,!0].includes(e.showNext)&&_jsx(ns,{text:e.nextText,handleClick:ge,disabled:!!u&&g>=u||!!e.canNext&&!e.canNext(),stepIndex:g}),e.showRestart&&g!==0&&_jsx(ts,{text:e.restartText,handleClick:Me,stepIndex:g}),s]})},$=(0,m.Z)(e=>({end:{padding:e.spacing(3)}}),{name:"SimpleStepperStep"});function B(e){const{title:s,children:l,end:u,actions:g,...b}=e,I=$();return u?_jsxs(Box,{className:I.end,children:[_jsx(Typography,{variant:"h6",children:s}),l,_jsx(SimpleStepperFooter,{actions:{...g||{},showNext:!1}})]}):_jsxs(MuiStep,{...b,children:[_jsx(StepLabel,{children:_jsx(Typography,{variant:"h6",children:s})}),_jsxs(StepContent,{children:[l,_jsx(SimpleStepperFooter,{actions:g})]})]})}const ce=(0,m.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 ie(e){const s=ce(e);return _jsx(Typography,{component:"span",className:classNames(s.status,s.ok),"aria-label":"Status ok","aria-hidden":"true",...e})}function z(e){const s=ce(e);return _jsx(Typography,{component:"span",className:classNames(s.status,s.warning),"aria-label":"Status warning","aria-hidden":"true",...e})}function he(e){const s=ce(e);return _jsx(Typography,{component:"span",className:classNames(s.status,s.error),"aria-label":"Status error","aria-hidden":"true",...e})}function Ae(e){const s=ce(e);return _jsx(Typography,{component:"span",className:classNames(s.status,s.pending),"aria-label":"Status pending","aria-hidden":"true",...e})}function Pe(e){const s=ce(e);return _jsx(Typography,{component:"span",className:classNames(s.status,s.running),"aria-label":"Status running","aria-hidden":"true",...e})}function We(e){const s=ce(e);return _jsx(Typography,{component:"span",className:classNames(s.status,s.aborted),"aria-label":"Status aborted","aria-hidden":"true",...e})}var Ue=n(74600),Ve=n(15584);const lt=e=>(0,xn.Z)({root:{fontWeight:e.typography.fontWeightBold,whiteSpace:"nowrap",paddingRight:e.spacing(4),border:"0",verticalAlign:"top"}}),St={root:{border:"0",verticalAlign:"top"}},De=e=>(0,xn.Z)({root:{margin:e.spacing(0,0,-1,0)}}),Xe=e=>(0,xn.Z)({root:{padding:e.spacing(0,0,1,0)},random:{}}),Ct=(0,Pn.Z)(lt,{name:"BackstageMetadataTableTitleCell"})(Ve.Z),Qt=(0,Pn.Z)(St,{name:"BackstageMetadataTableCell"})(Ve.Z),jn=({dense:e,children:s})=>_jsx(Table,{size:e?"small":"medium",children:_jsx(TableBody,{children:s})}),Pt=({title:e,children:s,...l})=>_jsxs(TableRow,{children:[e&&_jsx(Ct,{children:e}),_jsx(Qt,{colSpan:e?1:2,...l,children:s})]}),Lt=(0,Pn.Z)(De,{name:"BackstageMetadataTableList"})(({classes:e,children:s})=>(0,r.jsx)(Ht.Z,{disablePadding:!0,className:e.root,children:s})),en=(0,Pn.Z)(Xe,{name:"BackstageMetadataTableListItem"})(({classes:e,children:s})=>(0,r.jsx)(nn.Z,{className:e.root,children:s})),En=(0,xn.Z)({root:{margin:"0 0",listStyleType:"none"}}),vr=e=>(0,xn.Z)({root:{...En.root,paddingLeft:e.spacing(1)}}),$r=(0,Pn.Z)(En,{name:"BackstageStructuredMetadataTableList"})(({classes:e,children:s})=>(0,r.jsx)(Lt,{classes:e,children:s})),io=(0,Pn.Z)(vr,{name:"BackstageStructuredMetadataTableNestedList"})(({classes:e,children:s})=>(0,r.jsx)(Lt,{classes:e,children:s}));function Un(e,s){const l=e.map((u,g)=>_jsx(MetadataListItem,{children:jr(u)},g));return s?_jsx(io,{children:l}):_jsx($r,{children:l})}function Jn(e,s,l){const u=Object.keys(e).map(g=>{const b=jr(e[g],!0),I=l&&l.titleFormat?l.titleFormat(g):startCase(g);return _jsxs(MetadataListItem,{children:[_jsx(Typography,{variant:"body2",component:"span",children:`${I}: `}),b]},g)});return s?_jsx(io,{children:u}):_jsx($r,{children:u})}function jr(e,s,l){return React.isValidElement(e)?_jsx(Fragment,{children:e}):e!==null&&typeof e=="object"&&!Array.isArray(e)?Jn(e,s,l):Array.isArray(e)?Un(e,l):typeof e=="boolean"?_jsx(Fragment,{children:e?"\u2705":"\u274C"}):_jsx(Typography,{variant:"body2",component:"span",children:e})}const Ls=({value:e,options:s})=>_jsx(Fragment,{children:jr(e,s)}),hi=({title:e,value:s,options:l})=>_jsx(MetadataTableItem,{title:l&&l.titleFormat?l.titleFormat(e):startCase(e),children:_jsx(Ls,{value:s,options:l})});function pi(e,s){return Object.keys(e).map(l=>_jsx(hi,{title:l,value:e[l],options:s},l))}function Ba(e){const{metadata:s,dense:l=!0,options:u}=e,g=pi(s,u||{});return _jsx(MetadataTable,{dense:l,children:g})}var Os=n(49429),fi=n(86136),Er=n(50758),yr=n(79784),Mn=n(76635),gi=n(19126),ks=n.n(gi);function mi(e){return qs.stringify(e,{strictNullHandling:!0})}function Bs(e){return qs.parse(e,{ignoreQueryPrefix:!0,strictNullHandling:!0})}function rs(e,s){return Bs(e)[s]}function $s(e,s,l){const u={...Bs(e),[s]:l};return mi(u)}function os(e,s=250){const[l,u]=useSearchParams(),g=l.toString(),[b,I]=useState(rs(g,e));return useEffect(()=>{const D=rs(g,e);I(te=>isEqual(D,te)?te:D)},[g,I,e]),useDebouncedEffect(()=>{const D=$s(g,e,b);g!==D&&u(D,{replace:!0})},[u,b,g,e],s),[b,I]}const vi={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 Ds(){var e;const u=(e=(0,p.I_)().get(p.Ds))===null||e===void 0?void 0:e.getOptionalConfig("app.support");if(!u)return vi;var g;return{url:u.getString("url"),items:u.getConfigArray("items").flatMap(b=>({title:b.getString("title"),icon:b.getOptionalString("icon"),links:((g=b.getOptionalConfigArray("links"))!==null&&g!==void 0?g:[]).flatMap(I=>({url:I.getString("url"),title:I.getString("title")}))}))}}var yi=n(80079);function xr(e,s){const u=(0,p.qD)().getSystemIcon(e);return u?(0,r.jsx)(u,{...s}):(0,r.jsx)(yi.Z,{...s})}function $a(e){return xr("brokenImage",e)}function xi(e){return xr("catalog",e)}function Bo(e){return xr("chat",e)}function bi(e){return xr("dashboard",e)}function Si(e){return xr("docs",e)}function hl(e){return xr("email",e)}function ss(e){return xr("github",e)}function Ci(e){return xr("group",e)}function $o(e){return xr("help",e)}function Da(e){return xr("user",e)}function Na(e){return xr("warning",e)}const wi=(0,m.Z)({popoverList:{minWidth:260,maxWidth:400}},{name:"BackstageSupportButton"}),ji=({icon:e})=>{const s=(0,p.qD)();var l;const u=e&&(l=s.getSystemIcon(e))!==null&&l!==void 0?l:$o;return(0,r.jsx)(u,{})};var is;const Ei=({link:e})=>(0,r.jsx)(_.r,{to:e.url,children:(is=e.title)!==null&&is!==void 0?is:e.url}),Ai=({item:e})=>{var s;return(0,r.jsxs)(Jr.Z,{children:[(0,r.jsx)(fi.Z,{children:(0,r.jsx)(ji,{icon:e.icon})}),(0,r.jsx)(gn.Z,{primary:e.title,secondary:(s=e.links)===null||s===void 0?void 0:s.reduce((l,u,g)=>[...l,g>0&&(0,r.jsx)("br",{},g),(0,r.jsx)(Ei,{link:u},u.url)],[])})]})};function Ns(e){const{title:s,items:l,children:u}=e,{items:g}=Ds(),[b,I]=(0,f.useState)(!1),[D,te]=(0,f.useState)(null),X=wi(),ge=(0,be.Z)(Le=>Le.breakpoints.down("sm")),me=Le=>{te(Le.currentTarget),I(!0)},Me=()=>{I(!1)};return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(j.Z,{display:"flex",ml:1,children:ge?(0,r.jsx)(U.Z,{color:"primary",size:"small",onClick:me,"data-testid":"support-button","aria-label":"Support",children:(0,r.jsx)($o,{})}):(0,r.jsx)(q.Z,{"data-testid":"support-button","aria-label":"Support",color:"primary",onClick:me,startIcon:(0,r.jsx)($o,{}),children:"Support"})}),(0,r.jsxs)(yr.ZP,{"data-testid":"support-button-popover",open:b,anchorEl:D,anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"},onClose:Me,children:[(0,r.jsxs)(Er.Z,{className:X.popoverList,autoFocusItem:Boolean(D),children:[s&&(0,r.jsx)(Jr.Z,{alignItems:"flex-start",children:(0,r.jsx)(st.Z,{variant:"subtitle1",children:s})}),f.Children.map(u,(Le,Ye)=>(0,r.jsx)(Jr.Z,{alignItems:"flex-start",children:Le},`child-${Ye}`)),(l!=null?l:g).map((Le,Ye)=>(0,r.jsx)(Ai,{item:Le},`item-${Ye}`))]}),(0,r.jsx)(Os.Z,{children:(0,r.jsx)(q.Z,{color:"primary",onClick:Me,"aria-label":"Close",children:"Close"})})]})]})}var as=n(18671),Ar=n(73557),Do=n(84800);const Fa=(0,m.Z)(e=>({root:{gridArea:"pageContent",minWidth:0,paddingTop:e.spacing(3),paddingBottom:e.spacing(3),paddingLeft:e.spacing(2),paddingRight:e.spacing(2),[e.breakpoints.up("sm")]:{paddingLeft:e.spacing(3),paddingRight:e.spacing(3)}},stretch:{display:"flex",flexDirection:"column",flexGrow:1},noPadding:{padding:0}}),{name:"BackstageContent"});function Ti(e){const{className:s,stretch:l,noPadding:u,children:g,...b}=e,I=Fa();return(0,r.jsx)("article",{...b,className:dn()(I.root,s,{[I.stretch]:l,[I.noPadding]:u}),children:g})}var Ri=n(6487),Ii=n(99152);const Pi=(0,m.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 Fs(e){const{tabs:s,onChange:l,selectedIndex:u}=e,[g,b]=(0,f.useState)(u!=null?u:0),I=Pi(),D=(0,f.useCallback)((te,X)=>{u===void 0&&b(X),l&&u!==X&&l(X)},[u,l]);return(0,f.useEffect)(()=>{u!==void 0&&b(u)},[u]),(0,r.jsx)(j.Z,{className:I.tabsWrapper,children:(0,r.jsx)(Ii.Z,{selectionFollowsFocus:!0,indicatorColor:"primary",textColor:"inherit",variant:"scrollable",scrollButtons:"auto","aria-label":"tabs",onChange:D,value:g,children:s.map((te,X)=>(0,f.createElement)(Ri.Z,{...te.tabProps,"data-testid":`header-tab-${X}`,label:te.label,key:te.id,value:X,className:I.defaultTab,classes:{selected:I.selected,root:I.tabRoot}}))})})}function No(e){const s=(0,Ar.UO)(),u=e.map(({path:Me,children:Le})=>({caseSensitive:!1,path:`${Me}/*`,element:Le})).sort((Me,Le)=>Le.path.replace(/\/\*$/,"").localeCompare(Me.path.replace(/\/\*$/,"")));var g;const b=(g=(0,Ar.V$)(u))!==null&&g!==void 0?g:e[0].children;var I;let D=(I=s["*"])!==null&&I!==void 0?I:"";D.startsWith("/")||(D=`/${D}`);var te;const[X]=(te=(0,Do.fp)(u,D))!==null&&te!==void 0?te:[],ge=X?e.findIndex(Me=>`${Me.path}/*`===X.route.path):0;var me;return{index:ge===-1?0:ge,element:b,route:(me=e[ge])!==null&&me!==void 0?me:e[0]}}function ls(e){const{routes:s}=e,l=(0,Ar.s0)(),{index:u,route:g,element:b}=No(s),I=(0,f.useMemo)(()=>s.map(te=>({id:te.path,label:te.title,tabProps:te.tabProps})),[s]),D=te=>{let{path:X}=s[te];X=X.replace(/\/\*$/,""),X=X.replace(/^\//,""),l(X)};return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(Fs,{tabs:I,selectedIndex:u,onChange:D}),(0,r.jsxs)(Ti,{children:[(0,r.jsx)(as.q,{title:g.title}),b]})]})}const cs=()=>null;(0,p.R5)(cs,"core.gatherMountPoints",!0);function Zs(e){const s=(0,r.jsx)(cs,{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 Zs(l.props.children);if(l.type!==s)throw new Error("Child of TabbedLayout must be an TabbedLayout.Route");const{path:u,title:g,children:b,tabProps:I}=l.props;return[{path:u,title:g,children:b,tabProps:I}]})}function Za(e){const s=Zs(e.children);return(0,r.jsx)(ls,{routes:s})}Za.Route=cs;const ao=(0,m.Z)(e=>({value:{marginBottom:e.spacing(.75)},subvalue:{color:e.palette.textSubtle,fontWeight:"normal"}}),{name:"BackstageSubvalueCell"});function Li(e){const{value:s,subvalue:l}=e,u=ao();return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(j.Z,{className:u.value,children:s}),(0,r.jsx)(j.Z,{className:u.subvalue,children:l})]})}var Dn=n(67222),Ua=n(21070),Ma=n(90324),za=n(98281),Oi=n(48049),ki=n(51209),Bi=n(33375),ds=n(44233),$i=n(27604),lo=n(36444),Fo=n(37971),Zo=n(59709),Di=n(17373),Us=n(3702),Ms=n(93111);const Ni=(0,m.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"}),Fi=e=>{var s;const l=Ni(),{onChangeFilters:u}=e,[g,b]=(0,f.useState)({...e.selectedFilters}),[I,D]=(0,f.useState)(!1),te=()=>{b({}),D(X=>!X)};return(0,f.useEffect)(()=>{u(g)},[g,u]),(0,r.jsxs)(j.Z,{className:l.root,children:[(0,r.jsxs)(j.Z,{className:l.header,children:[(0,r.jsx)(j.Z,{className:l.value,children:"Filters"}),(0,r.jsx)(q.Z,{color:"primary",onClick:te,children:"Clear all"})]}),(0,r.jsx)(j.Z,{className:l.filters,children:((s=e.filters)===null||s===void 0?void 0:s.length)&&e.filters.map(X=>(0,r.jsx)(Oo,{triggerReset:I,...X.element,selected:g[X.element.label],onChange:ge=>b({...g,[X.element.label]:ge})},X.element.label))})]})};var Zi=n(4614);const zs={Add:(0,f.forwardRef)((e,s)=>(0,r.jsx)(Ua.Z,{...e,ref:s})),Check:(0,f.forwardRef)((e,s)=>(0,r.jsx)(za.Z,{...e,ref:s})),Clear:(0,f.forwardRef)((e,s)=>(0,r.jsx)(Bi.Z,{...e,ref:s})),Delete:(0,f.forwardRef)((e,s)=>(0,r.jsx)(ds.Z,{...e,ref:s})),DetailPanel:(0,f.forwardRef)((e,s)=>(0,r.jsx)(ki.Z,{...e,ref:s})),Edit:(0,f.forwardRef)((e,s)=>(0,r.jsx)($i.Z,{...e,ref:s})),Export:(0,f.forwardRef)((e,s)=>(0,r.jsx)(Us.Z,{...e,ref:s})),Filter:(0,f.forwardRef)((e,s)=>(0,r.jsx)(lo.Z,{...e,ref:s})),FirstPage:(0,f.forwardRef)((e,s)=>(0,r.jsx)(Fo.Z,{...e,ref:s})),LastPage:(0,f.forwardRef)((e,s)=>(0,r.jsx)(Zo.Z,{...e,ref:s})),NextPage:(0,f.forwardRef)((e,s)=>(0,r.jsx)(ki.Z,{...e,ref:s})),PreviousPage:(0,f.forwardRef)((e,s)=>(0,r.jsx)(Oi.Z,{...e,ref:s})),ResetSearch:(0,f.forwardRef)((e,s)=>(0,r.jsx)(Bi.Z,{...e,ref:s})),Search:(0,f.forwardRef)((e,s)=>(0,r.jsx)(lo.Z,{...e,ref:s})),SortArrow:(0,f.forwardRef)((e,s)=>(0,r.jsx)(Ma.Z,{...e,ref:s})),ThirdStateCheck:(0,f.forwardRef)((e,s)=>(0,r.jsx)(Di.Z,{...e,ref:s})),ViewColumn:(0,f.forwardRef)((e,s)=>(0,r.jsx)(Ms.Z,{...e,ref:s}))};function Ws(e,s){const l=s.split(".");let u=e[l[0]];for(let g=1;g<l.length;++g){if(u===void 0)return u;const b=l[g];u=u[b]}return u}const Wa=(0,Pn.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"})(Dn.W$),Vs=(0,Pn.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"})(Dn.UW),Ui=(0,m.Z)(e=>({root:{display:"flex",alignItems:"center",justifyContent:"space-between"},title:{fontWeight:e.typography.fontWeightBold,fontSize:18,whiteSpace:"nowrap"}}),{name:"BackstageTableFiltersContainer"}),us=(0,m.Z)(()=>({root:{display:"flex",alignItems:"start"}}),{name:"BackstageTable"});function Mi(e,s){return e.map(l=>{var u;const g=(u=l.headerStyle)!==null&&u!==void 0?u:{};let b=l.cellStyle||{};if(l.highlight)if(g.color=s.palette.textContrast,typeof b=="object")b.fontWeight=s.typography.fontWeightBold;else{const I=b;b=(D,te,X)=>({...I(D,te,X),fontWeight:s.typography.fontWeightBold})}return{...l,headerStyle:g,cellStyle:b}})}function zi(e,s){return(0,Mn.transform)(e,(l,u,g)=>{(0,Mn.isEqual)(u,s[g])||(l[g]=u)})}const hs={search:"",filtersOpen:!1,filters:{}};function Wi(e){const{toolbarRef:s,setSearch:l,hasFilters:u,selectedFiltersLength:g,toggleFilters:b}=e,I=Ui(),D=(0,f.useCallback)(te=>{e.onSearchChanged(te),l(te)},[e,l]);return u?(0,r.jsxs)(j.Z,{className:I.root,children:[(0,r.jsxs)(j.Z,{className:I.root,children:[(0,r.jsx)(U.Z,{onClick:b,"aria-label":"filter list",children:(0,r.jsx)(lo.Z,{})}),(0,r.jsxs)(st.Z,{className:I.title,children:["Filters (",g,")"]})]}),(0,r.jsx)(Vs,{...e,ref:s,onSearchChanged:D})]}):(0,r.jsx)(Vs,{...e,ref:s,onSearchChanged:D})}function Hs(e){var s,l;const{data:u,columns:g,options:b,title:I,subtitle:D,filters:te,initialState:X,emptyContent:ge,onStateChange:me,components:Me,isLoading:Le,...Ye}=e,ut=us(),dt=(0,re.Z)(),Gt={...hs,...X},[Tn,zn]=(0,f.useState)(Gt.filtersOpen),Ot=(0,f.useCallback)(()=>zn(Xn=>!Xn),[zn]),[rn,mn]=(0,f.useState)(0),[Wn,sr]=(0,f.useState)(u),[On,Pr]=(0,f.useState)(Gt.filters),uo=Mi(g,dt),[Fr,Wo]=(0,f.useState)(Gt.search);(0,f.useEffect)(()=>{if(me){const Xn=zi({search:Fr,filtersOpen:Tn,filters:On},hs);me(Xn)}},[Fr,Tn,On,me]);const vn={headerStyle:{textTransform:"uppercase"}},ho=(0,f.useCallback)(Xn=>{var hr;return(hr=g.find(Lr=>Lr.title===Xn))===null||hr===void 0?void 0:hr.field},[g]);(0,f.useEffect)(()=>{if(typeof u=="function")return;if(!On){sr(u);return}const Xn=Object.values(On);if(u&&Xn.flat().length){const hr=u.filter(Lr=>!!Object.entries(On).filter(([,Co])=>!!Co.length).every(([Co,Vn])=>{const pr=Ws(Lr,ho(Co));return Array.isArray(pr)&&Array.isArray(Vn)?pr.some(wo=>Vn.includes(wo)):Array.isArray(pr)?pr.includes(Vn):Array.isArray(Vn)?Vn.includes(pr):pr===Vn}));sr(hr)}else sr(u);mn(Xn.flat().length)},[u,On,ho]);const La=(Xn,hr)=>{const Lr=Vn=>{const pr=new Set,wo=Zr=>{Zr!=null&&pr.add(Zr)};return hr&&hr.forEach(Zr=>{const ws=Ws(Zr,ho(Vn));Array.isArray(ws)?ws.forEach(wo):wo(ws)}),pr},Co=Vn=>({placeholder:"All results",label:Vn.column,multiple:Vn.type==="multiple-select",items:[...Lr(Vn.column)].sort().map(pr=>({label:pr,value:pr}))});return Xn.map(Vn=>({type:Vn.type,element:Co(Vn)}))},po=!!(!((s=te)===null||s===void 0)&&s.length),Oa=(0,f.useCallback)(Xn=>(0,r.jsx)(Wi,{setSearch:Wo,hasFilters:po,selectedFiltersLength:rn,toggleFilters:Ot,...Xn}),[Ot,po,rn,Wo]),li=typeof u!="function"&&u.length===0,Cs=g.length,ka=(0,f.useCallback)(Xn=>Le?(0,r.jsx)("tbody",{"data-testid":"loading-indicator",children:(0,r.jsx)("tr",{children:(0,r.jsx)("td",{colSpan:Cs,children:(0,r.jsx)(j.Z,{sx:{display:"flex",justifyContent:"center",alignItems:"center",width:"100%",minHeight:"15rem"},children:(0,r.jsx)(Zi.Z,{size:"5rem"})})})})}):ge&&li?(0,r.jsx)("tbody",{children:(0,r.jsx)("tr",{children:(0,r.jsx)("td",{colSpan:Cs,children:ge})})}):(0,r.jsx)(Dn.os,{...Xn}),[li,ge,Cs,Le]);return(0,r.jsxs)(j.Z,{className:ut.root,children:[Tn&&u&&typeof u!="function"&&((l=te)===null||l===void 0?void 0:l.length)&&(0,r.jsx)(Fi,{filters:La(te,u),selectedFilters:On,onChangeFilters:Pr}),(0,r.jsx)(Dn.ZP,{components:{Header:Wa,Toolbar:Oa,Body:ka,...Me},options:{...vn,...b},columns:uo,icons:zs,title:(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(st.Z,{variant:"h5",component:"h2",children:I}),D&&(0,r.jsx)(st.Z,{color:"textSecondary",variant:"body1",children:D})]}),data:typeof u=="function"?u:Wn,style:{width:"100%"},localization:{toolbar:{searchPlaceholder:"Filter",searchTooltip:"Filter"}},...Ye})]})}Hs.icons=Object.freeze(zs);var Va=n(44311);function Vi(e,s){const l=e[e.length-1];if(l)return l>=.9?s.palette.status.ok:l>=.5?s.palette.status.warning:s.palette.status.error}function pl(e){const s=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:Vi(e.data,s)})]})}const Hi=e=>(0,m.Z)(s=>({container:{width:"100%",display:"flex",flexDirection:"row",flexWrap:"wrap",justifyContent:"flex-end",alignItems:"center",marginBottom:s.spacing(2),textAlign:e.textAlign},leftItemsBox:{flex:"1 1 auto",minWidth:0,overflow:"visible"},rightItemsBox:{flex:"0 1 auto",display:"flex",flexDirection:"row",flexWrap:"wrap",alignItems:"center",marginLeft:s.spacing(1),minWidth:0,overflow:"visible"},description:{},title:{display:"inline-flex",marginBottom:0}}),{name:"BackstageContentHeader"}),Gi=({title:e="Unknown page",className:s})=>(0,r.jsx)(st.Z,{variant:"h4",component:"h2",className:s,"data-testid":"header-title",children:e});function Ki(e){const{description:s,title:l,titleComponent:u=void 0,children:g,textAlign:b="left"}=e,I=Hi({textAlign:b})(),D=u||(0,r.jsx)(Gi,{title:l,className:I.title});return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(as.q,{title:l}),(0,r.jsxs)(j.Z,{className:I.container,children:[(0,r.jsxs)(j.Z,{className:I.leftItemsBox,children:[D,s&&(0,r.jsx)(st.Z,{className:I.description,variant:"body2",children:s})]}),(0,r.jsx)(j.Z,{className:I.rightItemsBox,children:g})]})]})}var Yi=n.p+"static/mic-drop.fe3ef4d0..svg";const Gs=(0,m.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,"auto",4)}}}),{name:"BackstageErrorPageMicDrop"}),ps=()=>{const e=Gs();return(0,r.jsx)("img",{src:Yi,className:e.micDrop,alt:"Girl dropping mic from her hands"})},Ji=(0,m.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 Qi(e){const{status:s,statusMessage:l,additionalInfo:u,supportUrl:g}=e,b=Ji(),I=(0,Ar.s0)(),D=Ds();return(0,r.jsxs)(Vt.Z,{container:!0,spacing:0,className:b.container,children:[(0,r.jsxs)(Vt.Z,{item:!0,xs:12,sm:8,md:4,children:[(0,r.jsxs)(st.Z,{"data-testid":"error",variant:"body1",className:b.subtitle,children:["ERROR ",s,": ",l]}),(0,r.jsx)(st.Z,{variant:"body1",className:b.subtitle,children:u}),(0,r.jsx)(st.Z,{variant:"h2",className:b.title,children:"Looks like someone dropped the mic!"}),(0,r.jsxs)(st.Z,{variant:"h6",children:[(0,r.jsx)(_.r,{to:"#","data-testid":"go-back-link",onClick:()=>I(-1),children:"Go back"}),"... or please"," ",(0,r.jsx)(_.r,{to:g||D.url,children:"contact support"})," if you think this is a bug."]})]}),(0,r.jsx)(ps,{})]})}var Xi=n(16173);const qi=(0,Pn.Z)({root:{textDecoration:"underline",cursor:"pointer"}},{name:"BackstageBreadcrumbsClickableText"})(st.Z),Ks=(0,Pn.Z)({root:{textDecoration:"underline",color:"inherit"}},{name:"BackstageBreadcrumbsStyledBox"})(j.Z);function bo(e){const{children:s,...l}=e,[u,g]=f.useState(null),b=f.Children.toArray(s),[I,D,...te]=b,X=te.length?te.pop():b[b.length-1],ge=b.length>3,me=Ye=>{g(Ye.currentTarget)},Me=()=>{g(null)},Le=Boolean(u);return(0,r.jsxs)(f.Fragment,{children:[(0,r.jsxs)(Xi.Z,{"aria-label":"breadcrumb",...l,children:[b.length>1&&(0,r.jsx)(Ks,{clone:!0,children:I}),b.length>2&&(0,r.jsx)(Ks,{clone:!0,children:D}),ge&&(0,r.jsx)(qi,{onClick:me,children:"..."}),(0,r.jsx)(j.Z,{style:{fontStyle:"italic"},children:X})]}),(0,r.jsx)(yr.ZP,{open:Le,anchorEl:u,onClose:Me,anchorOrigin:{vertical:"bottom",horizontal:"left"},transformOrigin:{vertical:"top",horizontal:"left"},children:(0,r.jsx)(Ht.Z,{children:te.map((Ye,ut)=>(0,r.jsx)(nn.Z,{button:!0,children:(0,r.jsx)(Ks,{clone:!0,children:Ye})},ut))})})]})}const fs=72,_i=24,gs=18,Vr={drawerWidthClosed:fs,drawerWidthOpen:224,defaultOpenDelayMs:100,defaultCloseDelayMs:0,defaultFadeDuration:200,logoHeight:32,iconContainerWidth:fs,iconSize:fs-_i*2,iconPadding:_i,selectedIndicatorWidth:3,userBadgePadding:gs,userBadgeDiameter:fs-gs*2,mobileSidebarHeight:56},Ha=e=>({...Vr,...e,iconContainerWidth:Vr.drawerWidthClosed,iconSize:Vr.drawerWidthClosed-Vr.iconPadding*2,userBadgeDiameter:Vr.drawerWidthClosed-Vr.userBadgePadding*2}),Ys={drawerWidthClosed:0,drawerWidthOpen:202,defaultOpenDelayMs:Vr.defaultOpenDelayMs+200},ea=e=>({...Ys,...e}),ta="@backstage/core/sidebar-intro-dismissed",Dr=(0,f.createContext)({sidebarConfig:Vr,submenuConfig:Ys}),na=(0,f.createContext)({isHoveredOn:!1,setIsHoveredOn:()=>{}});var Js=n(50023),Qs=n(4190),ra=n(87685),oa=n(44882),Qr=n(51837);const sa={isOpen:!1,setOpen:()=>{}},ia=(0,f.createContext)(sa),aa=(0,Qr.CT)("sidebar-open-state-context");function la(e){const{children:s,value:l}=e;return(0,r.jsx)(ia.Provider,{value:l,children:(0,r.jsx)(aa.Provider,{value:(0,Qr.EI)({1:l}),children:s})})}const ms=()=>{const e=(0,f.useContext)(aa),s=(0,f.useContext)(ia);if(e===void 0)return s||sa;const l=e.atVersion(1);if(l===void 0)throw new Error("No context found for version 1.");return l};var Qn=n(57998),Ga=n(98864);const Xs={isPinned:!0,toggleSidebarPinState:()=>{},isMobile:!1},ca=(0,f.createContext)(Xs),da=(0,Qr.CT)("sidebar-pin-state-context");function Ka(e){const{children:s,value:l}=e;return(0,r.jsx)(ca.Provider,{value:l,children:(0,r.jsx)(da.Provider,{value:(0,Qr.EI)({1:l}),children:s})})}const vs=()=>{const e=(0,f.useContext)(da),s=(0,f.useContext)(ca);if(e===void 0)return s||Xs;const l=e.atVersion(1);if(l===void 0)throw new Error("No context found for version 1.");return l},Ya=(0,m.Z)(e=>({root:{flexGrow:0,margin:e.spacing(0,2),color:e.palette.navigation.color},selected:s=>({color:`${e.palette.navigation.selectedColor}!important`,borderTop:`solid ${s.sidebarConfig.selectedIndicatorWidth}px ${e.palette.navigation.indicator}`,marginTop:"-1px"}),label:{display:"none"}})),Ja=e=>{const{to:s,label:l,icon:u,value:g}=e,{sidebarConfig:b}=(0,f.useContext)(Dr),I=Ya({sidebarConfig:b}),D=(0,Ar.TH)(),{selectedMenuItemIndex:te,setSelectedMenuItemIndex:X}=(0,f.useContext)(pa),ge=(Me,Le)=>{X(Le===te?-1:Le)},me=g===te&&te>=0||g!==te&&!(te>=0)&&s===D.pathname;return(0,r.jsx)(Qn.Z,{"aria-label":l,label:l,icon:u,component:Ga.rU,to:s||D.pathname,onChange:ge,value:g,selected:me,classes:I})},ua=e=>{const{children:s,to:l,label:u,icon:g,value:b}=e,{isMobile:I}=vs();return I?(0,r.jsx)(Ja,{to:l,label:u,icon:g,value:b}):(0,r.jsx)(r.Fragment,{children:s})},ha=(0,m.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:s=>({background:e.palette.navigation.background,width:"100%",bottom:`${s.sidebarConfig.mobileSidebarHeight}px`,height:`calc(100% - ${s.sidebarConfig.mobileSidebarHeight}px)`,flex:"0 1 auto",overflow:"auto"}),overlayHeader:{display:"flex",color:e.palette.text.primary,alignItems:"center",justifyContent:"space-between",padding:e.spacing(2,3)},overlayHeaderClose:{color:e.palette.text.primary},marginMobileSidebar:s=>({marginBottom:`${s.sidebarConfig.mobileSidebarHeight}px`})})),Qa=e=>(0,Mn.orderBy)(e,({props:{priority:s}})=>Number.isInteger(s)?s:-1,"desc"),Xa=f.createElement(ua).type,qa=({children:e,label:s="Menu",open:l,onClose:u})=>{const{sidebarConfig:g}=(0,f.useContext)(Dr),b=ha({sidebarConfig:g});return(0,r.jsxs)(Qs.ZP,{anchor:"bottom",open:l,onClose:u,ModalProps:{BackdropProps:{classes:{root:b.marginMobileSidebar}}},classes:{root:b.marginMobileSidebar,paperAnchorBottom:b.overlay},children:[(0,r.jsxs)(j.Z,{className:b.overlayHeader,children:[(0,r.jsx)(st.Z,{variant:"h3",children:s}),(0,r.jsx)(U.Z,{onClick:u,classes:{root:b.overlayHeaderClose},children:(0,r.jsx)(ra.Z,{})})]}),(0,r.jsx)(j.Z,{component:"nav",children:e})]})},pa=(0,f.createContext)({selectedMenuItemIndex:-1,setSelectedMenuItemIndex:()=>{}}),_s=e=>{const{sidebarConfig:s}=(0,f.useContext)(Dr),{children:l}=e,u=ha({sidebarConfig:s}),g=(0,Ar.TH)(),[b,I]=(0,f.useState)(-1);(0,f.useEffect)(()=>{I(-1)},[g.pathname]);let D=(0,p.vJ)(l,X=>X.getElements().filter(ge=>ge.type===Xa));if(l)D.length?D=Qa(D):D.push((0,r.jsx)(ua,{icon:(0,r.jsx)(oa.Z,{}),children:l},"default_menu"));else return null;const te=b>=0&&!D[b].props.to;return(0,r.jsx)(la,{value:{isOpen:!0,setOpen:()=>{}},children:(0,r.jsxs)(pa.Provider,{value:{selectedMenuItemIndex:b,setSelectedMenuItemIndex:I},children:[(0,r.jsx)(qa,{label:D[b]&&D[b].props.label,open:te,onClose:()=>I(-1),children:D[b]&&D[b].props.children}),(0,r.jsx)(Js.Z,{className:u.root,"data-testid":"mobile-sidebar-root",component:"nav",children:D})]})})};var Uo;(function(e){e.SIDEBAR_PIN_STATE="sidebarPinState"})(Uo||(Uo={}));const ei={getSidebarPinState(){let e;try{e=JSON.parse(window.localStorage.getItem(Uo.SIDEBAR_PIN_STATE)||"true")}catch{return!0}return!!e},setSidebarPinState(e){return window.localStorage.setItem(Uo.SIDEBAR_PIN_STATE,JSON.stringify(e))}},fa=(0,m.Z)(e=>({root:{width:"100%",transition:"padding-left 0.1s ease-out",isolation:"isolate",[e.breakpoints.up("sm")]:{paddingLeft:s=>s.isPinned?s.sidebarConfig.drawerWidthOpen:s.sidebarConfig.drawerWidthClosed},[e.breakpoints.down("xs")]:{paddingBottom:s=>s.sidebarConfig.mobileSidebarHeight},"@media print":{padding:"0px !important"}},content:{zIndex:0,isolation:"isolate","&:focus":{outline:0}}}),{name:"BackstageSidebarPage"}),ti=(0,f.createContext)({content:{contentRef:void 0}});function ga(e){const[s,l]=(0,f.useState)(()=>ei.getSidebarPinState()),{sidebarConfig:u}=(0,f.useContext)(Dr),g=(0,f.useRef)(null),b=(0,f.useMemo)(()=>({content:{contentRef:g}}),[g]);(0,f.useEffect)(()=>{ei.setSidebarPinState(s)},[s]);const I=(0,be.Z)(X=>X.breakpoints.down("xs"),{noSsr:!0}),D=()=>l(!s),te=fa({isPinned:s,sidebarConfig:u});return(0,r.jsx)(Ka,{value:{isPinned:s,toggleSidebarPinState:D,isMobile:I},children:(0,r.jsx)(ti.Provider,{value:b,children:(0,r.jsx)(j.Z,{className:te.root,children:e.children})})})}function ni(){var e;const{content:s}=(0,f.useContext)(ti);return{focusContent:(0,f.useCallback)(()=>{var u,g,b;(b=s)===null||b===void 0||(g=b.contentRef)===null||g===void 0||(u=g.current)===null||u===void 0||u.focus()},[s]),contentRef:(e=s)===null||e===void 0?void 0:e.contentRef}}const ri=(0,m.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:s=>({width:s.sidebarConfig.drawerWidthClosed}),drawerOpen:s=>({width:s.sidebarConfig.drawerWidthOpen,transition:e.transitions.create("width",{easing:e.transitions.easing.sharp,duration:e.transitions.duration.shorter})}),visuallyHidden:{top:0,position:"absolute",zIndex:1e3,transform:"translateY(-200%)","&:focus":{transform:"translateY(5px)"}}}),{name:"BackstageSidebar"});var or;(function(e){e[e.Closed=0]="Closed",e[e.Idle=1]="Idle",e[e.Open=2]="Open"})(or||(or={}));const ma=e=>{const{sidebarConfig:s}=(0,f.useContext)(Dr),{openDelayMs:l=s.defaultOpenDelayMs,closeDelayMs:u=s.defaultCloseDelayMs,disableExpandOnHover:g,children:b}=e,I=ri({sidebarConfig:s}),D=(0,be.Z)(Gt=>Gt.breakpoints.down("md"),{noSsr:!0}),[te,X]=(0,f.useState)(or.Closed),ge=(0,f.useRef)(),{isPinned:me,toggleSidebarPinState:Me}=vs(),Le=()=>{me||g||(ge.current&&(clearTimeout(ge.current),ge.current=void 0),te!==or.Open&&!D&&(ge.current=window.setTimeout(()=>{ge.current=void 0,X(or.Open)},l),X(or.Idle)))},Ye=()=>{me||g||(ge.current&&(clearTimeout(ge.current),ge.current=void 0),te===or.Idle?X(or.Closed):te===or.Open&&(ge.current=window.setTimeout(()=>{ge.current=void 0,X(or.Closed)},u)))},ut=te===or.Open&&!D||me,dt=Gt=>{Gt?(X(or.Open),Me()):(X(or.Closed),Me())};return(0,r.jsxs)("nav",{style:{},"aria-label":"sidebar nav",children:[(0,r.jsx)(va,{}),(0,r.jsx)(la,{value:{isOpen:ut,setOpen:dt},children:(0,r.jsx)(j.Z,{className:I.root,"data-testid":"sidebar-root",onMouseEnter:g?()=>{}:Le,onFocus:g?()=>{}:Le,onMouseLeave:g?()=>{}:Ye,onBlur:g?()=>{}:Ye,children:(0,r.jsx)(j.Z,{className:dn()(I.drawer,I.drawerWidth,{[I.drawerOpen]:ut}),children:b})})})]})},_a=e=>{var s;const l=Ha((s=e.sidebarOptions)!==null&&s!==void 0?s:{});var u;const g=ea((u=e.submenuOptions)!==null&&u!==void 0?u:{}),{children:b,disableExpandOnHover:I,openDelayMs:D,closeDelayMs:te}=e,{isMobile:X}=vs();return X?(0,r.jsx)(_s,{children:b}):(0,r.jsx)(Dr.Provider,{value:{sidebarConfig:l,submenuConfig:g},children:(0,r.jsx)(ma,{openDelayMs:D,closeDelayMs:te,disableExpandOnHover:I,children:b})})};function va(){var e;const{sidebarConfig:s}=(0,f.useContext)(Dr),{focusContent:l,contentRef:u}=ni(),g=ri({sidebarConfig:s});return!((e=u)===null||e===void 0)&&e.current?(0,r.jsx)(q.Z,{onClick:l,variant:"contained",className:dn()(g.visuallyHidden),children:"Skip to content"}):null}function oi(e,s,l=!1){const u=new URLSearchParams(s.search).toString(),g=ks().parse(u),b=new URLSearchParams(e.search).toString(),I=ks().parse(b),D=l?Mn.isEqual:Mn.isMatch;return(0,Mn.isEqual)(s.pathname,e.pathname)&&D(I,g)}const el=(0,m.Z)(e=>{var s,l;return{item:{height:48,width:"100%","&:hover":{background:((s=e.palette.navigation.navItem)===null||s===void 0?void 0:s.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"}),tl=e=>{const{title:s,subtitle:l,to:u,icon:g,dropdownItems:b,exact:I}=e,D=el(),{setIsHoveredOn:te}=useContext(SidebarItemWithSubmenuContext),X=()=>{te(!1)},ge=useResolvedPath(u!=null?u:""),me=useLocation();let Me=isLocationMatch(me,ge,I);const[Le,Ye]=useState(!1),ut=()=>{Ye(!Le)};return b!==void 0?(b.some(dt=>{const Gt=resolvePath(dt.to);return Me=isLocationMatch(me,Gt,I),Me}),_jsxs(Box,{className:D.itemContainer,children:[_jsx(Tooltip,{title:s,enterDelay:500,enterNextDelay:500,children:_jsxs(Button,{role:"button",onClick:ut,onTouchStart:dt=>dt.stopPropagation(),className:classnames(D.item,Me?D.selected:void 0),children:[g&&_jsx(g,{fontSize:"small"}),_jsxs(Typography,{variant:"subtitle1",component:"span",className:D.label,children:[s,_jsx("br",{}),l&&_jsx(Typography,{variant:"caption",component:"span",className:D.subtitle,children:l})]}),Le?_jsx(ArrowDropUpIcon,{className:D.dropdownArrow}):_jsx(ArrowDropDownIcon,{className:D.dropdownArrow})]})}),b&&Le&&_jsx(Box,{className:D.dropdown,children:b.map((dt,Gt)=>_jsx(Tooltip,{title:dt.title,enterDelay:500,enterNextDelay:500,children:_jsx(Link,{to:dt.to,underline:"none",className:D.dropdownItem,onClick:X,onTouchStart:Tn=>Tn.stopPropagation(),children:_jsx(Typography,{component:"span",className:D.textContent,children:dt.title})})},Gt))})]})):_jsx(Box,{className:D.itemContainer,children:_jsx(Tooltip,{title:s,enterDelay:500,enterNextDelay:500,children:_jsxs(Link,{to:u,underline:"none",className:classnames(D.item,Me?D.selected:void 0),onClick:X,onTouchStart:dt=>dt.stopPropagation(),children:[g&&_jsx(g,{fontSize:"small"}),_jsxs(Typography,{variant:"subtitle1",component:"span",className:D.label,children:[s,_jsx("br",{}),l&&_jsx(Typography,{variant:"caption",component:"span",className:D.subtitle,children:l})]})]})})})};var ys;const ya=(0,m.Z)(e=>({root:{zIndex:1e3,position:"relative",overflow:"visible",width:e.spacing(7)+1},drawer:s=>{var l;return{display:"flex",flexFlow:"column nowrap",alignItems:"flex-start",position:"fixed",[e.breakpoints.up("sm")]:{marginLeft:s.left,transition:e.transitions.create("margin-left",{easing:e.transitions.easing.sharp,duration:e.transitions.duration.shortest})},top:0,bottom:0,padding:0,background:(ys=(l=e.palette.navigation.submenu)===null||l===void 0?void 0:l.background)!==null&&ys!==void 0?ys:"#404040",overflowX:"hidden",msOverflowStyle:"none",scrollbarWidth:"none",cursor:"default",width:s.submenuConfig.drawerWidthClosed,transitionDelay:`${s.submenuConfig.defaultOpenDelayMs}ms`,"& > *":{flexShrink:0},"&::-webkit-scrollbar":{display:"none"}}},drawerOpen:s=>({width:s.submenuConfig.drawerWidthOpen,[e.breakpoints.down("xs")]:{width:"100%",position:"relative",paddingLeft:e.spacing(3),left:0,top:0}}),title:{fontSize:e.typography.h5.fontSize,fontWeight:e.typography.fontWeightMedium,color:e.palette.common.white,padding:e.spacing(2.5),[e.breakpoints.down("xs")]:{display:"none"}}}),{name:"BackstageSidebarSubmenu"}),xa=e=>{const{isOpen:s}=ms(),{sidebarConfig:l,submenuConfig:u}=(0,f.useContext)(Dr),g=s?l.drawerWidthOpen:l.drawerWidthClosed,b=ya({left:g,submenuConfig:u}),{isHoveredOn:I}=(0,f.useContext)(na),[D,te]=(0,f.useState)(!1);return(0,f.useEffect)(()=>{te(I)},[I]),(0,r.jsxs)(j.Z,{className:dn()(b.drawer,{[b.drawerOpen]:D}),children:[(0,r.jsx)(st.Z,{variant:"h5",component:"span",className:b.title,children:e.title}),e.children]})};var ba=n(26739),Mo=n(76600),Sa=n(83543),Tr=n(59797),si=n(98989);const Ca=(0,m.Z)({iconContainer:{display:"flex",position:"relative",width:"100%"},arrow1:{right:"6px",position:"absolute"}}),nl=()=>{const e=Ca();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 wa=null;const ja=(0,m.Z)({iconContainer:{display:"flex",position:"relative",width:"100%"},arrow1:{right:"6px",position:"absolute"}}),rl=()=>{const e=ja();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 ol=null,xs,ii;const Ea=e=>(0,m.Z)(s=>{var l,u;return{root:{color:s.palette.navigation.color,display:"flex",flexFlow:"row nowrap",alignItems:"center",height:48,cursor:"pointer"},buttonItem:{background:"none",border:"none",width:"100%",margin:0,padding:0,textAlign:"inherit",font:"inherit",textTransform:"none"},closed:{width:e.drawerWidthClosed,justifyContent:"center"},open:{[s.breakpoints.up("sm")]:{width:e.drawerWidthOpen}},highlightable:{"&:hover":{background:(xs=(l=s.palette.navigation.navItem)===null||l===void 0?void 0:l.hoverBackground)!==null&&xs!==void 0?xs:"#404040"}},highlighted:{background:(ii=(u=s.palette.navigation.navItem)===null||u===void 0?void 0:u.hoverBackground)!==null&&ii!==void 0?ii:"#404040"},label:{fontWeight:"bold",whiteSpace:"nowrap",lineHeight:"auto",flex:"3 1 auto",width:"110px",overflow:"hidden","text-overflow":"ellipsis"},iconContainer:{boxSizing:"border-box",height:"100%",width:e.iconContainerWidth,marginRight:-s.spacing(2),display:"flex",alignItems:"center",justifyContent:"center",lineHeight:"0"},searchRoot:{marginBottom:12},searchField:{color:"#b5b5b5",fontWeight:s.typography.fontWeightBold,fontSize:s.typography.fontSize},searchFieldHTMLInput:{padding:s.spacing(2,0,2)},searchContainer:{width:e.drawerWidthOpen-e.iconContainerWidth},secondaryAction:{width:s.spacing(6),textAlign:"center",marginRight:s.spacing(1)},closedItemIcon:{width:"100%",justifyContent:"center"},submenuArrow:{display:"flex"},expandButton:{background:"none",border:"none",color:s.palette.navigation.color,width:"100%",cursor:"pointer",position:"relative",height:48},arrows:{position:"absolute",right:10},selected:{"&$root":{borderLeft:`solid ${e.selectedIndicatorWidth}px ${s.palette.navigation.indicator}`,color:s.palette.navigation.selectedColor},"&$closed":{width:e.drawerWidthClosed},"& $closedItemIcon":{paddingRight:e.selectedIndicatorWidth},"& $iconContainer":{marginLeft:-e.selectedIndicatorWidth}}}},{name:"BackstageSidebarItem"});function i(e){return(0,f.useMemo)(()=>Ea(e),[e])()}const t=(e,s)=>(0,p.vJ)(e.props.children,l=>{let u=!1;return l.getElements().forEach(({props:{to:g,dropdownItems:b}})=>{if(!u){var I;if(!((I=b)===null||I===void 0)&&I.length){b.forEach(({to:D})=>u=u||oi(s,(0,Do.i3)(D)));return}g&&(u=oi(s,(0,Do.i3)(g)))}}),u},[s.pathname]);function o(e){return e.to===void 0}const a=f.createElement(xa).type,c=f.forwardRef(function({to:s,end:l,style:u,className:g,activeStyle:b,caseSensitive:I,activeClassName:D="active","aria-current":te="page",...X},ge){let{pathname:me}=(0,Ar.TH)(),{pathname:Me}=(0,Ar.WU)(s);I||(me=me.toLocaleLowerCase("en-US"),Me=Me.toLocaleLowerCase("en-US"));let Le=me===Me;!Le&&!l&&(Le=me.startsWith(`${Me}/`));const Ye=Le?te:void 0;return(0,r.jsx)(k.rU,{...X,to:s,ref:ge,"aria-current":Ye,style:{...u,...Le?b:void 0},className:dn()([g,Le?D:void 0])})}),x=(0,f.forwardRef)((e,s)=>{const{icon:l,text:u,hasNotifications:g=!1,hasSubmenu:b=!1,disableHighlight:I=!1,onClick:D,noTrack:te,children:X,className:ge,...me}=e,{sidebarConfig:Me}=(0,f.useContext)(Dr),Le=i(Me),{isOpen:Ye}=ms(),ut=!Ye&&b?{display:"flex",marginLeft:"20px"}:{lineHeight:"0"},dt=(0,r.jsxs)(j.Z,{style:ut,children:[(0,r.jsx)(l,{fontSize:"small"}),!Ye&&b?(0,r.jsx)(si.Z,{fontSize:"small"}):(0,r.jsx)(r.Fragment,{})]}),Gt=(0,r.jsx)(ba.Z,{color:"secondary",variant:"dot",overlap:"circular",invisible:!g,className:dn()({[Le.closedItemIcon]:!Ye}),children:dt}),Tn=(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(j.Z,{"data-testid":"login-button",className:Le.iconContainer,children:Gt}),u&&(0,r.jsx)(st.Z,{variant:"subtitle2",component:"span",className:Le.label,children:u}),(0,r.jsx)("div",{className:Le.secondaryAction,children:X})]}),zn=Ye?Tn:Gt,Ot={onClick:D,className:dn()(ge,Le.root,Ye?Le.open:Le.closed,o(e)&&Le.buttonItem,{[Le.highlightable]:!I})},rn=(0,p.z$)(),{pathname:mn}=(0,Ar.WU)(!o(e)&&e.to?e.to:""),Wn=(0,f.useCallback)(sr=>{var On;if(!te){const Pr="click",uo=u!=null?u:"Sidebar Item",Fr=mn?{attributes:{to:mn}}:void 0;rn.captureEvent(Pr,uo,Fr)}(On=D)===null||On===void 0||On(sr)},[rn,u,mn,te,D]);return o(e)?(0,r.jsx)(q.Z,{role:"button","aria-label":u,...Ot,ref:s,onClick:Wn,children:zn}):(0,r.jsx)(c,{...Ot,activeClassName:Le.selected,to:e.to?e.to:"",ref:s,"aria-label":u||e.to,...me,onClick:Wn,children:zn})}),O=({children:e,...s})=>{const{sidebarConfig:l}=(0,f.useContext)(Dr),u=i(l),[g,b]=(0,f.useState)(!1),I=(0,Ar.TH)(),D=t(e,I),te=(0,be.Z)(Me=>Me.breakpoints.down("sm")),X=()=>{b(!0)},ge=()=>{b(!1)},me=()=>te?g?(0,r.jsx)(Tr.Z,{fontSize:"small",className:u.submenuArrow}):(0,r.jsx)(Sa.Z,{fontSize:"small",className:u.submenuArrow}):!g&&(0,r.jsx)(si.Z,{fontSize:"small",className:u.submenuArrow});return(0,r.jsx)(na.Provider,{value:{isHoveredOn:g,setIsHoveredOn:b},children:(0,r.jsxs)("div",{"data-testid":"item-with-submenu",onMouseLeave:ge,onTouchStart:g?ge:X,onMouseEnter:X,className:dn()(g&&u.highlighted),children:[(0,r.jsx)(x,{hasSubmenu:!0,className:D?u.selected:"",...s,children:me()}),g&&e]})})},N=(0,f.forwardRef)((e,s)=>{const[l]=(0,p.vJ)(e.children,u=>u.getElements().filter(g=>g.type===a));return l?(0,r.jsx)(O,{...e,children:l}):(0,r.jsx)(x,{...e,ref:s})});function J(e){const{sidebarConfig:s}=useContext(SidebarConfigContext),[l,u]=useState(""),g=i(s),b=e.icon?e.icon:SearchIcon,I=()=>{e.onSearch(l),u("")},D=me=>{me.key==="Enter"&&(me.preventDefault(),I())},te=me=>{u(me.target.value)},X=me=>{me.preventDefault(),me.stopPropagation()},ge=me=>{I(),me.preventDefault()};return _jsx(Box,{className:g.searchRoot,children:_jsx(N,{icon:b,to:e.to,onClick:ge,disableHighlight:!0,children:_jsx(TextField,{placeholder:"Search",value:l,onClick:X,onChange:te,onKeyDown:D,className:g.searchContainer,InputProps:{disableUnderline:!0,className:g.searchField},inputProps:{className:g.searchFieldHTMLInput}})})})}const fe=(0,Mo.Z)("div")({flex:1},{name:"BackstageSidebarSpace"}),Ne=(0,Mo.Z)("div")({height:8},{name:"BackstageSidebarSpacer"}),je=(0,Mo.Z)("hr")(({theme:e})=>({height:1,width:"100%",background:"#383838",border:"none",margin:e.spacing(1.2,0)}),{name:"BackstageSidebarDivider"}),ke=e=>({overflowY:"auto","&::-webkit-scrollbar":{backgroundColor:e.palette.background.default,width:"5px",borderRadius:"5px"},"&::-webkit-scrollbar-thumb":{backgroundColor:e.palette.text.secondary,borderRadius:"5px"}}),Fe=(0,Mo.Z)("div")(({theme:e})=>{const s=ke(e);return{flex:"0 1 auto",overflowX:"hidden",width:"calc(100% - 5px)",minHeight:"48px",overflowY:"hidden","@media (hover: none)":s,"&:hover":s}}),Ke=()=>{const{sidebarConfig:e}=useContext(SidebarConfigContext),s=i(e),{isOpen:l,setOpen:u}=useSidebarOpenState();if(useMediaQuery(I=>I.breakpoints.down("md"),{noSsr:!0}))return null;const b=()=>{u(!l)};return _jsx(Button,{role:"button",onClick:b,className:s.expandButton,"aria-label":"Expand Sidebar","data-testid":"sidebar-expand-button",children:_jsx(Box,{className:s.arrows,children:l?_jsx(DoubleArrowLeft,{}):_jsx(DoubleArrowRight,{})})})},At=(0,m.Z)(e=>({introCard:s=>({color:"#b5b5b5",fontSize:12,width:s.sidebarConfig.drawerWidthOpen,marginTop:e.spacing(2.25),marginBottom:e.spacing(1.5),paddingLeft:s.sidebarConfig.iconPadding,paddingRight:s.sidebarConfig.iconPadding}),introDismiss:{display:"flex",justifyContent:"flex-end",alignItems:"center",marginTop:e.spacing(1.5)},introDismissLink:{color:"#dddddd",display:"flex",alignItems:"center",marginBottom:e.spacing(.5),"&:hover":{color:e.palette.linkHover,transition:e.transitions.create("color",{easing:e.transitions.easing.sharp,duration:e.transitions.duration.shortest})}},introDismissText:{fontSize:"0.7rem",fontWeight:"bold",textTransform:"uppercase",letterSpacing:1},introDismissIcon:{width:18,height:18,marginRight:e.spacing(1.5)}}),{name:"BackstageSidebarIntro"});function kt(e){const{sidebarConfig:s}=useContext(SidebarConfigContext),l=At({sidebarConfig:s}),{text:u,onClose:g}=e,b=()=>g();return _jsxs(Box,{className:l.introCard,children:[_jsx(Typography,{variant:"subtitle2",children:u}),_jsx(Box,{className:l.introDismiss,children:_jsxs(IconButton,{onClick:b,className:l.introDismissLink,children:[_jsx(CloseIcon,{className:l.introDismissIcon}),_jsx(Typography,{component:"span",className:l.introDismissText,children:"Dismiss"})]})})]})}const Ln=e=>{const{text:s,onDismiss:l}=e,[u,g]=useState(!1),b=()=>{g(!0)};return _jsx(Collapse,{in:!u,onExited:l,children:_jsx(kt,{text:s,onClose:b})})},dr=null,br="And your recently viewed plugins will pop up here!";function Rr(e){const{isOpen:s}=useSidebarOpenState(),l={starredItemsDismissed:!1,recentlyViewedItemsDismissed:!1},{value:u,set:g}=useLocalStorageValue(SIDEBAR_INTRO_LOCAL_STORAGE),{starredItemsDismissed:b,recentlyViewedItemsDismissed:I}=u!=null?u:{},D=()=>{g(X=>({...l,...X,starredItemsDismissed:!0}))},te=()=>{g(X=>({...l,...X,recentlyViewedItemsDismissed:!0}))};return s?_jsxs(_Fragment,{children:[!b&&_jsxs(_Fragment,{children:[_jsx(Ln,{text:dr,onDismiss:D}),_jsx(SidebarDivider,{})]}),!I&&_jsx(Ln,{text:br,onDismiss:te})]}):null}const Sr=(0,m.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"}),Nn=({type:e,typeLink:s,classes:l,pageTitle:u})=>e?s?(0,r.jsxs)(bo,{className:l.breadcrumb,children:[(0,r.jsx)(_.r,{to:s,children:e}),(0,r.jsx)(st.Z,{children:u})]}):(0,r.jsx)(st.Z,{className:l.type,children:e}):null,Nr=({pageTitle:e,classes:s,tooltip:l})=>{const{contentRef:u}=ni(),g=(0,r.jsx)(st.Z,{ref:u,tabIndex:-1,className:s.title,variant:"h1",children:e});return l?(0,r.jsx)(T.ZP,{title:l,placement:"top-start",children:g}):g},Hr=({classes:e,subtitle:s})=>s?typeof s!="string"?(0,r.jsx)(r.Fragment,{children:s}):(0,r.jsx)(st.Z,{className:e.subtitle,variant:"subtitle2",component:"span",children:s}):null;function Ir(e){const{children:s,pageTitleOverride:l,style:u,subtitle:g,title:b,tooltip:I,type:D,typeLink:te}=e,X=Sr(),me=(0,p.h_)(p.Ds).getOptionalString("app.title")||"Backstage",Me=l||b,Le=b||l,Ye=`${Me} | %s | ${me}`,ut=`${Me} | ${me}`;return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(as.q,{titleTemplate:Ye,defaultTitle:ut}),(0,r.jsxs)("header",{style:u,className:X.header,children:[(0,r.jsxs)(j.Z,{className:X.leftItemsBox,children:[(0,r.jsx)(Nn,{classes:X,type:D,typeLink:te,pageTitle:Le}),(0,r.jsx)(Nr,{classes:X,pageTitle:Le,tooltip:I}),(0,r.jsx)(Hr,{classes:X,subtitle:g})]}),(0,r.jsx)(Vt.Z,{container:!0,className:X.rightItemsBox,spacing:4,children:s})]})]})}const An=({label:e,secondaryLabel:s,icon:l,disabled:u=!1,onClick:g})=>_jsx(Fragment,{children:_jsxs(ListItem,{"data-testid":"header-action-item",disabled:u,button:!0,onClick:b=>{g&&g(b)},children:[l&&_jsx(ListItemIcon,{children:l}),_jsx(ListItemText,{primary:e,secondary:s})]})});function Xr(e){const{palette:{common:{white:s}}}=useTheme(),{actionItems:l}=e,[u,g]=React.useState(!1),b=React.useRef(null);return _jsxs(Fragment,{children:[_jsx(IconButton,{onClick:()=>g(!0),"data-testid":"header-action-menu",ref:b,style:{color:s,height:56,width:56,marginRight:-4,padding:0},children:_jsx(MoreVert,{})}),_jsx(Popover,{open:u,anchorEl:b.current,anchorOrigin:{horizontal:"right",vertical:"bottom"},transformOrigin:{horizontal:"right",vertical:"top"},onClose:()=>g(!1),children:_jsx(List,{children:l.map((I,D)=>_jsx(An,{...I},`header-action-menu-${D}`))})})]})}const So=(0,m.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,sn.Fq)(e.page.fontColor,.8),fontSize:e.typography.fontSize,lineHeight:1}}),{name:"BackstageHeaderLabel"}),Aa=({value:e,className:s})=>(0,r.jsx)(st.Z,{component:typeof e=="string"?"p":"span",className:s,children:e});function co(e){const{label:s,value:l,url:u}=e,g=So(),b=(0,r.jsx)(Aa,{className:g.value,value:l||"<Unknown>"});return(0,r.jsx)(Vt.Z,{item:!0,children:(0,r.jsxs)(st.Z,{component:"span",className:g.root,children:[(0,r.jsx)(st.Z,{className:g.label,children:s}),u?(0,r.jsx)(_.r,{to:u,children:b}):b]})})}const Ta=e=>(0,xn.Z)({root:{color:e.palette.common.white,padding:e.spacing(2,2,3),backgroundImage:e.getPageTheme({themeId:"card"}).backgroundImage,backgroundPosition:0,backgroundSize:"inherit"}}),ai=(0,m.Z)(Ta,{name:"BackstageItemCardHeader"});function fl(e){const{title:s,subtitle:l,children:u}=e,g=ai(e);return(0,r.jsxs)(j.Z,{className:g.root,children:[l&&(0,r.jsx)(st.Z,{variant:"subtitle2",component:"h3",children:l}),s&&(0,r.jsx)(st.Z,{variant:"h6",component:"h4",children:s}),u]})}function Zl(e){var s;const{description:l,tags:u,title:g,type:b,subtitle:I,label:D,onClick:te,href:X}=e;return _jsxs(Card,{children:[_jsx(CardMedia,{children:_jsx(ItemCardHeader,{title:g,subtitle:I||b})}),_jsxs(CardContent,{children:[!((s=u)===null||s===void 0)&&s.length?_jsx(Box,{children:u.map((ge,me)=>_jsx(Chip,{size:"small",label:ge},me))}):null,l]}),_jsxs(CardActions,{children:[!X&&_jsx(LinkButton,{to:"#",onClick:te,color:"primary",children:D}),X&&_jsx(LinkButton,{to:X,color:"primary",children:D})]})]})}const gl=e=>(0,xn.Z)({root:{display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(22em, 1fr))",gridAutoRows:"1fr",gridGap:e.spacing(2)}}),ml=(0,m.Z)(gl,{name:"BackstageItemCardGrid"});function vl(e){const{children:s,...l}=e,u=ml(l);return(0,r.jsx)(j.Z,{className:u.root,...l,children:s})}var yl=n(41547);const xl=(0,m.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 sl(e){const{themeId:s,children:l}=e,u=xl();return(0,r.jsx)(yl.Z,{theme:g=>({...g,page:g.getPageTheme({themeId:s})}),children:(0,r.jsx)("main",{className:u.root,children:l})})}function bl(e){const{themeId:s,children:l,...u}=e;return(0,r.jsxs)(sl,{themeId:s,children:[(0,r.jsx)(Ir,{...u}),l]})}var ur=n(30195);const Ul=ur.z.object({providerInfo:ur.z.object({}).catchall(ur.z.unknown()).optional(),profile:ur.z.object({email:ur.z.string().optional(),displayName:ur.z.string().optional(),picture:ur.z.string().optional()}),backstageIdentity:ur.z.object({token:ur.z.string(),identity:ur.z.object({type:ur.z.literal("user"),userEntityRef:ur.z.string(),ownershipEntityRefs:ur.z.array(ur.z.string())})})}),il={defaultTokenExpiryMillis:5*60*1e3,tokenExpiryMarginMillis:5*60*1e3};function Sl(e){const s=new Date(Date.now()+il.defaultTokenExpiryMillis);if(!e)return s;const[l,u,g]=e.split("."),b=JSON.parse(window.atob(u));return typeof b.exp!="number"?s:new Date(b.exp*1e3-il.tokenExpiryMarginMillis)}class Ml{async start(){await this.getSessionAsync()}getUserId(){const{backstageIdentity:s}=this.getSessionSync(),l=s.identity.userEntityRef,u=/^([^:/]+:)?([^:/]+\/)?([^:/]+)$/.exec(l);if(!u)throw new TypeError(`Invalid user entity reference "${l}"`);return u[3]}async getIdToken(){return(await this.getSessionAsync()).backstageIdentity.token}getProfile(){return this.getSessionSync().profile}async getProfileInfo(){return(await this.getSessionAsync()).profile}async getBackstageIdentity(){return(await this.getSessionAsync()).backstageIdentity.identity}async getCredentials(){return{token:(await this.getSessionAsync()).backstageIdentity.token}}async signOut(){this.abortController.abort()}getSessionSync(){if(this.state.type==="active")return this.state.session;if(this.state.type==="fetching"&&this.state.previous)return this.state.previous;throw new Error("No session available. Try reloading your browser page.")}async getSessionAsync(){if(this.state.type==="fetching")return this.state.promise;if(this.state.type==="active"&&new Date<this.state.expiresAt)return this.state.session;const s=this.state.type==="active"?this.state.session:void 0,l=this.fetchSession().then(u=>(this.state={type:"active",session:u,expiresAt:Sl(u.backstageIdentity.token)},u),u=>{throw this.state={type:"failed",error:u},u});return this.state={type:"fetching",promise:l,previous:s},l}async fetchSession(){const s=await this.options.discoveryApi.getBaseUrl("auth"),l=typeof this.options.headers=="function"?await this.options.headers():this.options.headers,u=new Headers(l);u.set("X-Requested-With","XMLHttpRequest");const g=await fetch(`${s}/${this.options.provider}/refresh`,{signal:this.abortController.signal,headers:u,credentials:"include"});if(!g.ok)throw await ResponseError.fromResponse(g);return proxiedSessionSchema.parse(await g.json())}constructor(s){_define_property(this,"options",void 0),_define_property(this,"abortController",void 0),_define_property(this,"state",void 0),this.options=s,this.abortController=new AbortController,this.state={type:"empty"}}}const zl=e=>{const s=useApi(discoveryApiRef),[{status:l,error:u},{execute:g}]=useAsync(async()=>{const b=new ProxiedSignInIdentity({provider:e.provider,discoveryApi:s,headers:e.headers});await b.start(),e.onSignInSuccess(b)});return useMountEffect(g),l==="loading"?_jsx(Progress,{}):u?_jsx(ErrorPanel,{title:"You do not appear to be signed in. Please try reloading the browser page.",error:u}):null},Cl=(0,m.Z)({container:{padding:0,listStyle:"none"},item:{display:"flex",flexDirection:"column",width:"100%",maxWidth:"400px",margin:0,padding:0}},{name:"BackstageSignInPage"}),Ra=({children:e})=>{const s=Cl();return(0,r.jsx)(Vt.Z,{component:"li",item:!0,classes:s,children:e})};var bs=n(87612);class Ia{getUserId(){return"guest"}async getIdToken(){}getProfile(){return{email:"guest@example.com",displayName:"Guest"}}async getProfileInfo(){return{email:"guest@example.com",displayName:"Guest"}}async getBackstageIdentity(){const s="user:default/guest";return{type:"user",userEntityRef:s,ownershipEntityRefs:[s]}}async getCredentials(){return{}}async signOut(){}}function wl(e){const[s,l,u]=e.split(".");return JSON.parse(window.atob(l))}class Pa{getUserId(){return this.result.userId}static fromResult(s){return new Pa(s)}async getIdToken(){var s,l;return(s=(l=this.result).getIdToken)===null||s===void 0?void 0:s.call(l)}getProfile(){return this.result.profile}async getProfileInfo(){return this.result.profile}async getBackstageIdentity(){const s=await this.getIdToken();if(!s){const g=`user:default/${this.getUserId()}`;return{type:"user",userEntityRef:g,ownershipEntityRefs:[g]}}const{sub:l,ent:u}=wl(s);return{type:"user",userEntityRef:l,ownershipEntityRefs:u!=null?u:[]}}async getCredentials(){var s,l;return{token:await((s=(l=this.result).getIdToken)===null||s===void 0?void 0:s.call(l))}}async signOut(){var s,l;return(s=(l=this.result).signOut)===null||s===void 0?void 0:s.call(l)}constructor(s){(0,bs._)(this,"result",void 0),this.result=s}}class Ss{static createGuest(){return new Ia}static fromLegacy(s){return Pa.fromResult(s)}static create(s){return new Ss(s.identity,s.authApi,s.profile)}getUserId(){const s=this.identity.userEntityRef,l=/^([^:/]+:)?([^:/]+\/)?([^:/]+)$/.exec(s);if(!l)throw new TypeError(`Invalid user entity reference "${s}"`);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(s){throw this.profilePromise=void 0,s}}async getBackstageIdentity(){return this.identity}async getCredentials(){return{token:(await this.authApi.getBackstageIdentity()).token}}async signOut(){return this.authApi.signOut()}constructor(s,l,u){(0,bs._)(this,"identity",void 0),(0,bs._)(this,"authApi",void 0),(0,bs._)(this,"profile",void 0),(0,bs._)(this,"profilePromise",void 0),this.identity=s,this.authApi=l,this.profile=u}}const jl={Component:({config:e,onSignInStarted:s,onSignInSuccess:l,onSignInFailure:u})=>{const{apiRef:g,title:b,message:I}=e,D=(0,p.h_)(g),te=(0,p.h_)(p.VE),X=async()=>{try{s();const ge=await D.getBackstageIdentity({instantPopup:!0});if(!ge)throw u(),new Error(`The ${b} provider is not configured to support sign-in`);const me=await D.getProfile();l(Ss.create({identity:ge.identity,profile:me,authApi:D}))}catch(ge){u(),te.post(new lr.SP("Login failed",ge))}};return(0,r.jsx)(Ra,{children:(0,r.jsx)(rr,{variant:"fullHeight",title:b,actions:(0,r.jsx)(q.Z,{color:"primary",variant:"outlined",onClick:X,children:"Sign In"}),children:(0,r.jsx)(st.Z,{variant:"body1",children:I})})})},loader:async(e,s)=>{const l=e.get(s),u=await l.getBackstageIdentity({optional:!0});if(!u)return;const g=await l.getProfile();return Ss.create({identity:u.identity,profile:g,authApi:l})}},El={Component:({onSignInStarted:e,onSignInSuccess:s})=>(0,r.jsx)(Ra,{children:(0,r.jsx)(rr,{title:"Guest",variant:"fullHeight",actions:(0,r.jsx)(q.Z,{color:"primary",variant:"outlined",onClick:()=>{e(),s(new Ia)},children:"Enter"}),children:(0,r.jsxs)(st.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 Ia};var Al=n(63955),al=n(86619),ll=n(74828),Tl=n(45455),Rl=n.n(Tl);const Il=/^[a-z0-9_\-]+\.[a-z0-9_\-]+\.[a-z0-9_\-]+$/i,Pl=(0,m.Z)(e=>({form:{display:"flex",flexFlow:"column nowrap"},button:{alignSelf:"center",marginTop:e.spacing(2)}}),{name:"BackstageCustomProvider"}),cl=e=>{const{ref:s,...l}=e;return{inputRef:s,...l}},Ll={Component:({onSignInStarted:e,onSignInSuccess:s})=>{var l;const u=Pl(),{register:g,handleSubmit:b,formState:I}=(0,Al.cI)({mode:"onChange"}),{errors:D}=I,te=({userId:X,idToken:ge})=>{e(),s(Ss.fromLegacy({userId:X,getIdToken:ge!==void 0?async()=>ge:void 0,profile:{email:`${X}@example.com`}}))};return(0,r.jsx)(Ra,{children:(0,r.jsxs)(rr,{title:"Custom User",variant:"fullHeight",children:[(0,r.jsxs)(st.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:u.form,onSubmit:b(te),children:[(0,r.jsxs)(oo.Z,{children:[(0,r.jsx)(al.Z,{...cl(g("userId",{required:!0})),label:"User ID",margin:"normal",error:Boolean(D.userId)}),D.userId&&(0,r.jsx)(ll.Z,{error:!0,children:D.userId.message})]}),(0,r.jsxs)(oo.Z,{children:[(0,r.jsx)(al.Z,{...cl(g("idToken",{required:!1,validate:X=>!X||Il.test(X)||"Token is not a valid OpenID Connect JWT Token"})),label:"ID Token (optional)",margin:"normal",autoComplete:"off",error:Boolean(D.idToken)}),D.idToken&&(0,r.jsx)(ll.Z,{error:!0,children:D.idToken.message})]}),(0,r.jsx)(q.Z,{type:"submit",color:"primary",variant:"outlined",className:u.button,disabled:!(!((l=I)===null||l===void 0)&&l.isDirty)||!Rl()(D),children:"Continue"})]})]})})},loader:async()=>{}},zo="@backstage/core:SignInPage:provider",dl={guest:El,custom:Ll,common:jl};function ul(e,s){if(e in s)throw new Error(`"${e}" ID is duplicated. IDs of identity providers have to be unique.`)}function Jl(e){return e.reduce((l,u)=>{if(typeof u=="string")return ul(u,l),l[u]={components:dl[u],id:u},l;const{id:g}=u;return ul(g,l),l[g]={components:dl.common,id:g,config:u},l},{})}const Ql=(e,s)=>{const l=useApi(errorApiRef),u=useApiHolder(),[g,b]=useState(!0),I=useCallback(te=>{s(IdentityApiSignOutProxy.from({identityApi:te,signOut:async()=>{var X,ge;localStorage.removeItem(zo),await((X=(ge=te).signOut)===null||X===void 0?void 0:X.call(ge))}}))},[s]);useLayoutEffect(()=>{var te;if(!g)return;const X=localStorage.getItem(zo);if(X===null){b(!1);return}const ge=e[X];if(!ge){b(!1);return}let me=!1;return ge.components.loader(u,(te=ge.config)===null||te===void 0?void 0:te.apiRef).then(Me=>{if(me){localStorage.removeItem(zo);return}Me?I(Me):b(!1)}).catch(Me=>{localStorage.removeItem(zo),!me&&(l.post(Me),b(!1))}),()=>{me=!0}},[g,l,s,u,e,I]);const D=useMemo(()=>Object.keys(e).map(te=>{const X=e[te],{Component:ge}=X.components,me=Ye=>{I(Ye)},Me=()=>{var Ye,ut;localStorage.setItem(zo,((ut=X)===null||ut===void 0||(Ye=ut.config)===null||Ye===void 0?void 0:Ye.id)||X.id)},Le=()=>{localStorage.removeItem(zo)};return _jsx(ge,{config:X.config,onSignInStarted:Me,onSignInSuccess:me,onSignInFailure:Le},X.id)}),[e,I]);return[g,D]},Ol=({onSignInSuccess:e,providers:s=[],title:l,align:u="left"})=>{const g=useApi(configApiRef),b=useStyles(),I=getSignInProviders(s),[D,te]=useSignInProviders(I,e);return D?_jsx(Progress,{}):_jsxs(Page,{themeId:"home",children:[_jsx(Header,{title:g.getString("app.title")}),_jsxs(Content,{children:[l&&_jsx(ContentHeader,{title:l,textAlign:u}),_jsx(Grid,{container:!0,justifyContent:u==="center"?u:"flex-start",spacing:2,component:"ul",classes:b,children:te})]})]})},kl=({provider:e,auto:s,onSignInSuccess:l})=>{const u=useStyles(),g=useApi(e.apiRef),b=useApi(configApiRef),[I,D]=useState(),[te,X]=useState(!1),ge=async({checkExisting:me,showPopup:Me})=>{try{let Le;if(me&&(Le=await g.getBackstageIdentity({optional:!0})),!Le&&(Me||s)&&(X(!0),Le=await g.getBackstageIdentity({instantPopup:!0}),!Le))throw new Error(`The ${e.title} provider is not configured to support sign-in`);if(!Le){X(!0);return}const Ye=await g.getProfile();l(UserIdentity.create({identity:Le.identity,authApi:g,profile:Ye}))}catch(Le){D(Le),X(!0)}};return useMountEffect(()=>ge({checkExisting:!0})),te?_jsxs(Page,{themeId:"home",children:[_jsx(Header,{title:b.getString("app.title")}),_jsx(Content,{children:_jsx(Grid,{container:!0,justifyContent:"center",spacing:2,component:"ul",classes:u,children:_jsx(GridItem,{children:_jsxs(InfoCard,{variant:"fullHeight",title:e.title,actions:_jsx(Button,{color:"primary",variant:"outlined",onClick:()=>{ge({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 Xl(e){return"provider"in e?_jsx(kl,{...e}):_jsx(Ol,{...e})}const Bl=(0,m.Z)(e=>({root:{padding:e.spacing(0,2,0,2.5),minHeight:e.spacing(3)},indicator:{backgroundColor:e.palette.info.main,height:e.spacing(.3)}}),{name:"BackstageTabbedCard"}),$l=(0,Pn.Z)(e=>({root:{padding:e.spacing(2,2,2,2.5),display:"inline-block"},title:{fontWeight:700},subheader:{paddingTop:e.spacing(1)}}),{name:"BackstageTabbedCardBoldHeader"})(Ao.Z);function ql(e){const{slackChannel:s,errorBoundaryProps:l,children:u,title:g,deepLink:b,value:I,onChange:D}=e,te=Bl(),[X,ge]=useState(0),me=D||((Ye,ut)=>ge(ut));let Me;I?React.Children.map(u,Ye=>{var ut;if(React.isValidElement(Ye)&&((ut=Ye)===null||ut===void 0?void 0:ut.props.value)===I){var dt;Me=(dt=Ye)===null||dt===void 0?void 0:dt.props.children}}):React.Children.map(u,(Ye,ut)=>{if(React.isValidElement(Ye)&&ut===X){var dt;Me=(dt=Ye)===null||dt===void 0?void 0:dt.props.children}});const Le=l||(s?{slackChannel:s}:{});return _jsx(Card,{children:_jsxs(ErrorBoundary,{...Le,children:[g&&_jsx($l,{title:g}),_jsx(Tabs,{selectionFollowsFocus:!0,classes:te,value:I||X,onChange:me,children:u}),_jsx(Divider,{}),_jsx(CardContent,{children:Me}),b&&_jsx(BottomLink,{...b})]})})}const Dl=(0,m.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 _l(e){const{children:s,...l}=e,u=Dl();return _jsx(Tab,{disableRipple:!0,classes:u,...l})}},98527:function(wt,Ie,n){"use strict";n.d(Ie,{vP:function(){return H},yx:function(){return r.y}});var r=n(64355),p=n(68588),V=n(66341),f=n(97456);const H=(0,f.T0)({id:"core.apptranslation"}),m=h=>{useApi(appTranslationApiRef).addResourcesByRef(h);const{t:q}=useTranslation(h.getId()),_=h.getDefaultMessages();return(Q,se)=>q(Q,_[Q],se)}},66341:function(wt,Ie,n){"use strict";n.d(Ie,{CL:function(){return rt},sM:function(){return Q},$v:function(){return w},v_:function(){return R},hg:function(){return F},uB:function(){return T},bq:function(){return ee},Km:function(){return U},Ds:function(){return ve},ni:function(){return _},T0:function(){return q},NW:function(){return be},VE:function(){return k},W0:function(){return ht},gP:function(){return Nt},F4:function(){return Z},ux:function(){return re},Kp:function(){return se},$4:function(){return Ut},p_:function(){return ae},ZM:function(){return Bt},D:function(){return j},gW:function(){return oe},E6:function(){return Dt},h_:function(){return H},I_:function(){return f}});var r=n(52322),p=n(2784),V=n(51837);function f(){const _e=(0,V.Vt)("api-context");if(!_e)throw new Error("API context is not available");const yt=_e.atVersion(1);if(!yt)throw new Error("ApiContext v1 not available");return yt}function H(_e){const ft=f().get(_e);if(!ft)throw new Error(`No implementation available for ${_e}`);return ft}function m(_e){return function(ft){const Je=$t=>{const Mt=f(),Se={};for(const Be in _e)if(_e.hasOwnProperty(Be)){const Ge=_e[Be],et=Mt.get(Ge);if(!et)throw new Error(`No implementation available for ${Ge}`);Se[Be]=et}return _jsx(ft,{...$t,...Se})},Ft=ft.displayName||ft.name||"Component";return Je.displayName=`withApis(${Ft})`,Je}}var h=n(87612);class P{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(yt){if((0,h._)(this,"config",void 0),this.config=yt,!yt.id.split(".").flatMap(Je=>Je.split("-")).every(Je=>Je.match(/^[a-z][a-z0-9]*$/)))throw new Error(`API id must only contain period separated lowercase alphanum tokens with dashes, got '${yt.id}'`)}}function q(_e){return new P(_e)}function _(_e,yt){return"id"in _e?{api:_e,deps:{},factory:()=>yt}:_e}var Q;(function(_e){_e.SignedIn="SignedIn",_e.SignedOut="SignedOut"})(Q||(Q={}));const se=q({id:"core.auth.google"}),Z=q({id:"core.auth.github"}),j=q({id:"core.auth.okta"}),re=q({id:"core.auth.gitlab"}),ae=q({id:"core.auth.microsoft"}),oe=q({id:"core.auth.onelogin"}),ee=q({id:"core.auth.bitbucket"}),U=q({id:"core.auth.bitbucket-server"}),T=q({id:"core.auth.atlassian"}),w=q({id:"core.alert"}),R=q({id:"core.analytics"}),F=q({id:"core.apptheme"}),ve=q({id:"core.config"}),be=q({id:"core.discovery"}),k=q({id:"core.error"});var rt;(function(_e){_e[_e.None=0]="None",_e[_e.Active=1]="Active"})(rt||(rt={}));const ht=q({id:"core.featureflags"}),Nt=q({id:"core.fetch"}),Ut=q({id:"core.identity"}),Bt=q({id:"core.oauthrequest"}),Dt=q({id:"core.storage"})},97456:function(wt,Ie,n){"use strict";n.d(Ie,{fC:function(){return m},CL:function(){return P.CL},sM:function(){return P.sM},$v:function(){return P.$v},v_:function(){return P.v_},hg:function(){return P.hg},uB:function(){return P.uB},R5:function(){return ee},bq:function(){return P.bq},Km:function(){return P.Km},Ds:function(){return P.Ds},ni:function(){return P.ni},T0:function(){return P.T0},CO:function(){return Se},x8:function(){return _e},rx:function(){return pt},YO:function(){return Be},P4:function(){return Mt},NT:function(){return ve},NW:function(){return P.NW},VE:function(){return P.VE},W0:function(){return P.W0},gP:function(){return P.gP},IY:function(){return U},F4:function(){return P.F4},ux:function(){return P.ux},Kp:function(){return P.Kp},$4:function(){return P.$4},p_:function(){return P.p_},ZM:function(){return P.ZM},D:function(){return P.D},gW:function(){return P.gW},E6:function(){return P.E6},z$:function(){return j},h_:function(){return P.h_},I_:function(){return P.I_},qD:function(){return re},vJ:function(){return at},tg:function(){return ft},Oi:function(){return Je}});var r=n(52322),p=n(51837),V=n(2784);const f=(0,p.CT)("analytics-context"),H=()=>{const xe=(0,V.useContext)(f);if(xe===void 0)return{routeRef:"unknown",pluginId:"root",extension:"App"};const G=xe.atVersion(1);if(G===void 0)throw new Error("No context found for version 1.");return G},m=xe=>{const{attributes:G,children:pe}=xe,He={...H(),...G},gt=(0,p.EI)({1:He});return(0,r.jsx)(f.Provider,{value:gt,children:pe})};function h(xe,G){const pe=Ee=>_jsx(m,{attributes:G,children:_jsx(xe,{...Ee})});return pe.displayName=`WithAnalyticsContext(${xe.displayName||xe.name||"Component"})`,pe}var P=n(66341),q=n(87612);const _=(0,p.uW)("core-plugin-api:analytics-tracker-events",()=>({mostRecentGatheredNavigation:void 0,mostRecentRoutableExtensionRender:void 0,beforeUnloadRegistered:!1})),Q="_ROUTABLE-EXTENSION-RENDERED";class se{setContext(G){this.context=G}captureEvent(G,pe,{value:Ee,attributes:He}={}){const{_routeNodeType:gt,...Qe}=this.context;if(G===Q){_.mostRecentGatheredNavigation&&(_.mostRecentRoutableExtensionRender={context:{...Qe,extension:"App"}});return}if(_.mostRecentGatheredNavigation){try{this.analyticsApi.captureEvent({..._.mostRecentGatheredNavigation,..._.mostRecentRoutableExtensionRender})}catch(jt){console.warn("Error during analytics event capture. %o",jt)}_.mostRecentGatheredNavigation=void 0,_.mostRecentRoutableExtensionRender=void 0}if(G==="navigate"&>==="gathered"&&Qe.pluginId==="root"){_.mostRecentGatheredNavigation={action:G,subject:pe,value:Ee,attributes:He,context:Qe};return}try{this.analyticsApi.captureEvent({action:G,subject:pe,value:Ee,attributes:He,context:Qe})}catch(jt){console.warn("Error during analytics event capture. %o",jt)}}constructor(G,pe={routeRef:"unknown",pluginId:"root",extension:"App"}){(0,q._)(this,"analyticsApi",void 0),(0,q._)(this,"context",void 0),this.analyticsApi=G,this.context=pe,_.beforeUnloadRegistered||(addEventListener("beforeunload",()=>{_.mostRecentGatheredNavigation&&(this.analyticsApi.captureEvent({..._.mostRecentGatheredNavigation,..._.mostRecentRoutableExtensionRender}),_.mostRecentGatheredNavigation=void 0,_.mostRecentRoutableExtensionRender=void 0)},{once:!0,passive:!0}),_.beforeUnloadRegistered=!0)}}function Z(){try{return(0,P.h_)(P.v_)}catch{return{captureEvent:()=>{}}}}function j(){const xe=(0,V.useRef)(null),G=H(),pe=Z();function Ee(){return xe.current===null&&(xe.current=new se(pe)),xe.current}const He=Ee();return He.setContext(G),He}const re=()=>{const xe=(0,p.Vt)("app-context");if(!xe)throw new Error("App context is not available");const G=xe.atVersion(1);if(!G)throw new Error("AppContext v1 not available");return G},ae=(0,p.uW)("component-data-store",()=>new WeakMap),oe="__backstage_data";function ee(xe,G,pe){const Ee=xe;var He;let gt=(He=Ee[oe])!==null&&He!==void 0?He:ae.get(xe);if(gt||(gt={map:new Map},Object.defineProperty(Ee,oe,{enumerable:!1,configurable:!0,writable:!1,value:gt}),ae.set(xe,gt)),gt.map.has(G)){const Qe=xe.displayName||xe.name;throw new Error(`Attempted to attach duplicate data "${G}" to component "${Qe}"`)}gt.map.set(G,pe)}function U(xe,G){if(!xe)return;const pe=xe.type;if(!pe)return;var Ee;const He=(Ee=pe[oe])!==null&&Ee!==void 0?Ee:ae.get(pe);if(He)return He.map.get(G)}const T=(0,p.uW)("route-ref-type",()=>Symbol("route-ref-type"));let w=T,R=w;class F{get title(){return this.id}toString(){return`routeRef{type=absolute,id=${this.id}}`}constructor(G,pe){(0,q._)(this,"id",void 0),(0,q._)(this,"params",void 0),(0,q._)(this,R,void 0),this.id=G,this.params=pe,this[w]="absolute"}}function ve(xe){var G;return new F(xe.id,(G=xe.params)!==null&&G!==void 0?G:[])}const be=/^\w+$/;let k=null,rt=null;class ht{toString(){return`routeRef{type=sub,id=${this.id}}`}constructor(G,pe,Ee,He){_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,rt,void 0),this.id=G,this.path=pe,this.parent=Ee,this.params=He,this[k]="sub"}}function Nt(xe){const{id:G,path:pe,parent:Ee}=xe,He=pe.split("/").filter(jt=>jt.startsWith(":")).map(jt=>jt.substring(1)),gt=[...Ee.params,...He];if(Ee.params.some(jt=>He.includes(jt)))throw new Error("SubRouteRef may not have params that overlap with its parent");if(!pe.startsWith("/"))throw new Error(`SubRouteRef path must start with '/', got '${pe}'`);if(pe.endsWith("/"))throw new Error(`SubRouteRef path must not end with '/', got '${pe}'`);for(const jt of He)if(!be.test(jt))throw new Error(`SubRouteRef path has invalid param, got '${jt}'`);return new ht(G,pe,Ee,gt)}let Ut=T,Bt=Ut;class Dt{toString(){return`routeRef{type=external,id=${this.id}}`}constructor(G,pe,Ee){(0,q._)(this,"id",void 0),(0,q._)(this,"params",void 0),(0,q._)(this,"optional",void 0),(0,q._)(this,Bt,void 0),this.id=G,this.params=pe,this.optional=Ee,this[Ut]="external"}}function _e(xe){var G;return new Dt(xe.id,(G=xe.params)!==null&&G!==void 0?G:[],Boolean(xe.optional))}var yt=n(73557);function ft(xe){const{pathname:G}=(0,yt.TH)(),pe=(0,p.Vt)("routing-context");if(!pe)throw new Error("Routing context is not available");const Ee=pe.atVersion(1),He=(0,V.useMemo)(()=>Ee&&Ee.resolve(xe,{pathname:G}),[Ee,xe,G]);if(!pe)throw new Error("useRouteRef used outside of routing context");if(!Ee)throw new Error("RoutingContext v1 not available");const gt="optional"in xe&&xe.optional;if(!He&&!gt)throw new Error(`No path for ${xe}`);return He}function Je(xe){return(0,yt.UO)()}class Ft extends V.Component{static getDerivedStateFromError(G){return{error:G}}render(){const{error:G}=this.state,{app:pe,plugin:Ee}=this.props,{ErrorBoundaryFallback:He}=pe.getComponents();return G?(0,r.jsx)(He,{error:G,resetError:this.handleErrorReset,plugin:Ee}):this.props.children}constructor(...G){super(...G),(0,q._)(this,"state",{error:void 0}),(0,q._)(this,"handleErrorReset",()=>{this.setState({error:void 0})})}}var $t=n(64355);function Mt(xe){const{component:G,mountPoint:pe,name:Ee}=xe;return Be({component:{lazy:()=>G().then(He=>{const gt=jt=>{const an=j();try{ft(pe)}catch(tn){if(typeof tn=="object"&&tn!==null){const{message:ln}=tn;if(typeof ln=="string"&&ln.startsWith("No path for "))throw new Error(`Routable extension component with mount point ${pe} 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 tn}return(0,V.useEffect)(()=>{an.captureEvent(Q,"")},[an]),(0,r.jsx)(He,{...jt})},Qe=Ee||He.displayName||He.name||"LazyComponent";return gt.displayName=`RoutableExtension(${Qe})`,gt},He=>Qe=>{const jt=re(),{BootErrorPage:an}=jt.getComponents();return(0,r.jsx)(an,{step:"load-chunk",error:He})})},data:{"core.mountPoint":pe},name:Ee})}function Se(xe){const{component:G,name:pe}=xe;return Be({component:G,name:pe})}function Be(xe){const{data:G={},name:pe}=xe;pe||console.warn("Declaring extensions without name is DEPRECATED. Make sure that all usages of createReactExtension, createComponentExtension and createRoutableExtension provide a name.");let Ee;if("lazy"in xe.component){const gt=xe.component.lazy;Ee=(0,V.lazy)(()=>gt().then(Qe=>({default:Qe})))}else Ee=xe.component.sync;const He=pe||Ee.displayName||Ee.name||"Component";return{expose(gt){const Qe=jt=>{var an;const tn=re(),{Progress:ln}=tn.getComponents(),fn=(an=G)===null||an===void 0?void 0:an["core.mountPoint"];return(0,r.jsx)(V.Suspense,{fallback:(0,r.jsx)(ln,{}),children:(0,r.jsx)(Ft,{app:tn,plugin:gt,children:(0,r.jsx)(m,{attributes:{pluginId:gt.getId(),...pe&&{extension:pe},...fn&&{routeRef:fn.id}},children:(0,r.jsx)($t.o,{plugin:gt,children:(0,r.jsx)(Ee,{...jt})})})})})};ee(Qe,"core.plugin",gt),ee(Qe,"core.extensionName",pe);for(const[jt,an]of Object.entries(G))ee(Qe,jt,an);return Qe.displayName=`Extension(${He})`,Qe}}}function Ge(xe,G,pe,Ee){return V.Children.toArray(xe).flatMap(He=>{if(!(0,V.isValidElement)(He))return[];if(He.type===V.Fragment)return Ge(He.props.children,G,pe,Ee);if(U(He,"core.featureFlagged")){const gt=He.props;return("with"in gt?G.isActive(gt.with):!G.isActive(gt.without))?Ge(He.props.children,G,pe,Ee):[]}if(pe===void 0||pe(He))return[He];if(Ee)throw new Error(Ee);return Ge(He.props.children,G,pe,Ee)})}class et{selectByComponentData(G){const pe=Ge(this.node,this.featureFlagsApi,Ee=>U(Ee,G.key)!==void 0,G.withStrictError);return new et(pe,this.featureFlagsApi)}findComponentData(G){return Ge(this.node,this.featureFlagsApi,Ee=>U(Ee,G.key)!==void 0).map(Ee=>U(Ee,G.key)).filter(Ee=>Ee!==void 0)}getElements(){return Ge(this.node,this.featureFlagsApi)}constructor(G,pe){(0,q._)(this,"node",void 0),(0,q._)(this,"featureFlagsApi",void 0),this.node=G,this.featureFlagsApi=pe}}function at(xe,G,pe=[]){const Ee=(0,P.h_)(P.W0),He=new et(xe,Ee);return(0,V.useMemo)(()=>G(He),[xe,...pe])}class Tt{getId(){return this.config.id}getApis(){var G;return(G=this.config.apis)!==null&&G!==void 0?G:[]}getFeatureFlags(){var G,pe;return(pe=(G=this.config.featureFlags)===null||G===void 0?void 0:G.slice())!==null&&pe!==void 0?pe:[]}get routes(){var G;return(G=this.config.routes)!==null&&G!==void 0?G:{}}get externalRoutes(){var G;return(G=this.config.externalRoutes)!==null&&G!==void 0?G:{}}provide(G){return G.expose(this)}__experimentalReconfigure(G){this.config.__experimentalConfigure&&(this.options=this.config.__experimentalConfigure(G))}getPluginOptions(){this.config.__experimentalConfigure&&!this.options&&(this.options=this.config.__experimentalConfigure());var G;return(G=this.options)!==null&&G!==void 0?G:{}}toString(){return`plugin{${this.config.id}}`}constructor(G){(0,q._)(this,"config",void 0),(0,q._)(this,"options",void 0),this.config=G,this.options=void 0}}function pt(xe){return new Tt(xe)}},64355:function(wt,Ie,n){"use strict";n.d(Ie,{o:function(){return H},y:function(){return m}});var r=n(52322),p=n(51837),V=n(2784);const f="plugin-context",H=h=>{const{children:P,plugin:q}=h,{Provider:_}=(0,p.CT)(f);return(0,r.jsx)(_,{value:(0,p.EI)({1:{plugin:q}}),children:P})};function m(){const h=(0,p.Vt)(f);if(!h)throw new Error("Plugin Options context is not available");const P=h.atVersion(1);if(!P)throw new Error("Plugin Options v1 is not available");return P.plugin.getPluginOptions()}},23054:function(wt,Ie,n){"use strict";n.d(Ie,{SP:function(){return oe},dR:function(){return se},VL:function(){return U},BD:function(){return p}});function r(T){if(typeof T!="object"||T===null||Array.isArray(T))return!1;const w=T;return!(typeof w.name!="string"||w.name===""||typeof w.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 w=T;if(typeof w.name!="string"||w.name==="")throw new Error(`Encountered error object without a name, got '${T}'`);if(typeof w.message!="string")throw new Error(`Encountered error object without a message, got '${T}'`)}var V=n(87612),f=n(24852);function H(T,w){var R;const ve={name:"Unknown",message:"<no reason given>",...serializeErrorInternal(T)};return!((R=w)===null||R===void 0)&&R.includeStack||delete ve.stack,ve}function m(T){const w=(0,f.deserializeError)(T);return T.stack||(w.stack=void 0),w}function h(T){if(r(T)){const w=String(T);return w!=="[object Object]"?w:`${T.name}: ${T.message}`}return`unknown error '${T}'`}class P extends Error{constructor(w,R){var F,ve;let be=w;if(R!==void 0){const k=h(R);be?be+=`; caused by ${k}`:be=`caused by ${k}`}super(be),(0,V._)(this,"cause",void 0),(F=(ve=Error).captureStackTrace)===null||F===void 0||F.call(ve,this,this.constructor),(!this.name||this.name==="Error")&&this.constructor.name!=="Error"&&(this.name=this.constructor.name),this.cause=r(R)?R:void 0}}class q extends null{constructor(...w){super(...w),_define_property(this,"name","InputError")}}class _ extends null{constructor(...w){super(...w),_define_property(this,"name","AuthenticationError")}}class Q extends null{constructor(...w){super(...w),_define_property(this,"name","NotAllowedError")}}class se extends P{constructor(...w){super(...w),(0,V._)(this,"name","NotFoundError")}}class Z extends null{constructor(...w){super(...w),_define_property(this,"name","ConflictError")}}class j extends null{constructor(...w){super(...w),_define_property(this,"name","NotModifiedError")}}class re extends null{constructor(...w){super(...w),_define_property(this,"name","NotImplementedError")}}class ae extends null{}class oe extends P{constructor(w,R){super(w,R),this.name=r(R)?R.name:"Error"}}async function ee(T){try{const R=await T.text();if(R){var w;if(!((w=T.headers.get("content-type"))===null||w===void 0)&&w.startsWith("application/json"))try{const F=JSON.parse(R);if(F.error&&F.response)return F}catch{}return{error:{name:"Error",message:`Request failed with status ${T.status} ${T.statusText}, ${R}`},response:{statusCode:T.status}}}}catch{}return{error:{name:"Error",message:`Request failed with status ${T.status} ${T.statusText}`},response:{statusCode:T.status}}}class U extends Error{static async fromResponse(w){const R=await ee(w),F=R.response.statusCode||w.status,ve=R.error.name||w.statusText,be=`Request failed with ${F} ${ve}`,k=m(R.error);return new U({message:be,response:w,data:R,cause:k})}constructor(w){super(w.message),(0,V._)(this,"response",void 0),(0,V._)(this,"body",void 0),(0,V._)(this,"cause",void 0),this.name="ResponseError",this.response=w.response,this.body=w.data,this.cause=w.cause}}},32838:function(wt,Ie,n){"use strict";n.d(Ie,{nW:function(){return ae},ae:function(){return Q},q3:function(){return se}});var r=n(97456);const p=(0,r.T0)({id:"core.scmauth"});var V=new WeakMap;class f{async getCredentials(ee){const U=new URL(ee.url),T=_class_private_field_get(this,V).find(w=>w.isUrlSupported(U));if(!T)throw new Error(`No auth provider available for '${ee.url}', see https://backstage.io/link?scm-auth`);return T.getCredentials(ee)}constructor(ee){_class_private_field_init(this,V,{writable:!0,value:void 0}),_class_private_field_set(this,V,ee)}}var H=new WeakMap,m=new WeakMap,h=new WeakMap,P=new WeakMap;class q{static createDefaultApiFactory(){return createApiFactory({api:scmAuthApiRef,deps:{github:githubAuthApiRef,gitlab:gitlabAuthApiRef,azure:microsoftAuthApiRef,bitbucket:bitbucketAuthApiRef},factory:({github:ee,gitlab:U,azure:T,bitbucket:w})=>q.merge(q.forGithub(ee),q.forGitlab(U),q.forAzure(T),q.forBitbucket(w))})}static forAuthApi(ee,U){return new q("generic",ee,U.host,U.scopeMapping)}static forGithub(ee,U){var T,w;const R=(w=(T=U)===null||T===void 0?void 0:T.host)!==null&&w!==void 0?w:"github.com";return new q("github",ee,R,{default:["repo","read:org","read:user"],repoWrite:["gist"]})}static forGitlab(ee,U){var T,w;const R=(w=(T=U)===null||T===void 0?void 0:T.host)!==null&&w!==void 0?w:"gitlab.com";return new q("gitlab",ee,R,{default:["read_user","read_api","read_repository"],repoWrite:["write_repository","api"]})}static forAzure(ee,U){var T,w;const R=(w=(T=U)===null||T===void 0?void 0:T.host)!==null&&w!==void 0?w:"dev.azure.com";return new q("azure",ee,R,{default:["vso.build","vso.code","vso.graph","vso.project","vso.profile"],repoWrite:["vso.code_manage"]})}static forBitbucket(ee,U){var T,w;const R=(w=(T=U)===null||T===void 0?void 0:T.host)!==null&&w!==void 0?w:"bitbucket.org";return new q("bitbucket",ee,R,{default:["account","team","pullrequest","snippet","issue"],repoWrite:["pullrequest:write","snippet:write","issue:write"]})}static merge(...ee){return new f(ee)}isUrlSupported(ee){return ee.host===_class_private_field_get(this,m)}getAdditionalScopesForProvider(ee){var U,T;if(!(!((U=ee)===null||U===void 0)&&U.customScopes)||_class_private_field_get(this,P)==="generic")return[];var w;return(w=(T=ee.customScopes)===null||T===void 0?void 0:T[_class_private_field_get(this,P)])!==null&&w!==void 0?w:[]}async getCredentials(ee){var U;const{url:T,additionalScope:w,...R}=ee,F=_class_private_field_get(this,h).default.slice();!((U=w)===null||U===void 0)&&U.repoWrite&&F.push(..._class_private_field_get(this,h).repoWrite);const ve=this.getAdditionalScopesForProvider(w);ve.length&&F.push(...ve);const be=[...new Set(F)],k=await _class_private_field_get(this,H).getAccessToken(be,R);return{token:k,headers:{Authorization:`Bearer ${k}`}}}constructor(ee,U,T,w){_class_private_field_init(this,H,{writable:!0,value:void 0}),_class_private_field_init(this,m,{writable:!0,value:void 0}),_class_private_field_init(this,h,{writable:!0,value:void 0}),_class_private_field_init(this,P,{writable:!0,value:void 0}),_class_private_field_set(this,H,U),_class_private_field_set(this,m,T),_class_private_field_set(this,h,w),_class_private_field_set(this,P,ee)}}var _=n(40556);class Q{static fromConfig(ee){return _.Lx.fromConfig(ee)}}const se=(0,r.T0)({id:"integration.scmintegrations"});var Z=n(52322),j=n(73250),re=n(2784);const ae=oe=>{const{type:ee}=oe,U=(0,r.qD)(),T=j.Z;var w;const R=ee&&(w=U.getSystemIcon(ee))!==null&&w!==void 0?w:T;return(0,Z.jsx)(R,{})}},40556:function(wt,Ie,n){"use strict";n.d(Ie,{Lx:function(){return Or},BT:function(){return Xt}});var r=n(87612),p=n(82717),V=n.n(p),f=n(76635);function H(S){const d=new URL("http://example.com");return d.host=S,d.host===S}function m(S){try{return new URL(S),!0}catch{return!1}}function h(S,d){return{list(){return S},byUrl(C){try{const A=typeof C=="string"?new URL(C):C;return S.find(K=>d(K)===A.host)}catch{return}},byHost(C){return S.find(A=>d(A)===C)}}}function P(S){const{url:d,base:C,lineNumber:A}=S;try{return new URL(d),d}catch{}let K;if(d.startsWith("/")){const{filepath:ye}=V()(C);K=new URL(C);const we=(0,f.trimEnd)(K.pathname.substring(0,K.pathname.length-ye.length),"/");K.pathname=`${we}${d}`}else K=new URL(d,C);return K.search=new URL(C).search,A&&(K.hash=`L${A}`),K.toString()}function q(S){beforeAll(()=>S.listen({onUnhandledRequest:"error"})),afterAll(()=>S.close()),afterEach(()=>S.resetHandlers())}const _="amazonaws.com";function Q(S){const d=S.getOptionalString("endpoint");var C;const A=(C=S.getOptionalBoolean("s3ForcePathStyle"))!==null&&C!==void 0?C:!1;let K,ye;if(d){try{const cn=new URL(d);K=cn.host,ye=cn.pathname}catch{throw new Error(`invalid awsS3 integration config, endpoint '${d}' is not a valid URL`)}if(ye!=="/")throw new Error(`invalid awsS3 integration config, endpoints cannot contain path, got '${d}'`)}else K=_;const we=S.getOptionalString("accessKeyId"),Ze=S.getOptionalString("secretAccessKey"),qe=S.getOptionalString("roleArn"),Jt=S.getOptionalString("externalId");return{host:K,endpoint:d,s3ForcePathStyle:A,accessKeyId:we,secretAccessKey:Ze,roleArn:qe,externalId:Jt}}function se(S){const d=S.map(Q);return d.some(C=>C.host===_)||d.push({host:_}),d}class Z{get type(){return"awsS3"}get title(){return this.integrationConfig.host}get config(){return this.integrationConfig}resolveUrl(d){return P(d)}resolveEditUrl(d){return d}constructor(d){(0,r._)(this,"integrationConfig",void 0),this.integrationConfig=d}}(0,r._)(Z,"factory",({config:S})=>{var d;const C=se((d=S.getOptionalConfigArray("integrations.awsS3"))!==null&&d!==void 0?d:[]);return h(C.map(A=>new Z(A)),A=>A.config.host)});var j=n(88412),re=n(50629),ae=n(80956);const oe="GB";var ee=new WeakMap,U=new WeakMap,T=new WeakMap,w=new WeakMap,R=new WeakMap,F=new WeakMap,ve=new WeakMap;class be{static fromRepoUrl(d){const C=new URL(d);let A,K,ye;const we=C.pathname.split("/").map(pn=>decodeURIComponent(pn));if(we[2]==="_git"?(A=we[1],K=ye=we[3]):we[3]==="_git"?(A=we[1],K=we[2],ye=we[4]):we[4]==="_git"&&(A=`${we[1]}/${we[2]}`,K=we[3],ye=we[5]),!A||!K||!ye)throw new Error("Azure URL must point to a git repository");var Ze;const qe=(Ze=C.searchParams.get("path"))!==null&&Ze!==void 0?Ze:void 0;let Jt;const cn=C.searchParams.get("version");if(cn){if(cn.slice(0,2)!=="GB")throw new Error("Azure URL version must point to a git branch");Jt=cn.slice(2)}return new be(C.origin,A,K,ye,qe,Jt)}toRepoUrl(){let d;return(0,j._)(this,T)===(0,j._)(this,w)?d=(0,j._)(this,ve).call(this,(0,j._)(this,U),"_git",(0,j._)(this,w)):d=(0,j._)(this,ve).call(this,(0,j._)(this,U),(0,j._)(this,T),"_git",(0,j._)(this,w)),(0,j._)(this,R)&&d.searchParams.set("path",(0,j._)(this,R)),(0,j._)(this,F)&&d.searchParams.set("version",oe+(0,j._)(this,F)),d.toString()}toFileUrl(){if(!(0,j._)(this,R))throw new Error("Azure URL must point to a specific path to be able to download a file");const d=(0,j._)(this,ve).call(this,(0,j._)(this,U),(0,j._)(this,T),"_apis","git","repositories",(0,j._)(this,w),"items");return d.searchParams.set("api-version","6.0"),d.searchParams.set("path",(0,j._)(this,R)),(0,j._)(this,F)&&d.searchParams.set("version",(0,j._)(this,F)),d.toString()}toArchiveUrl(){const d=(0,j._)(this,ve).call(this,(0,j._)(this,U),(0,j._)(this,T),"_apis","git","repositories",(0,j._)(this,w),"items");return d.searchParams.set("recursionLevel","full"),d.searchParams.set("download","true"),d.searchParams.set("api-version","6.0"),(0,j._)(this,R)&&d.searchParams.set("scopePath",(0,j._)(this,R)),(0,j._)(this,F)&&d.searchParams.set("version",(0,j._)(this,F)),d.toString()}toCommitsUrl(){const d=(0,j._)(this,ve).call(this,(0,j._)(this,U),(0,j._)(this,T),"_apis","git","repositories",(0,j._)(this,w),"commits");return d.searchParams.set("api-version","6.0"),(0,j._)(this,F)&&d.searchParams.set("searchCriteria.itemVersion.version",(0,j._)(this,F)),d.toString()}getOwner(){return(0,j._)(this,U)}getProject(){return(0,j._)(this,T)}getRepo(){return(0,j._)(this,w)}getPath(){return(0,j._)(this,R)}getRef(){return(0,j._)(this,F)}constructor(d,C,A,K,ye,we){(0,re._)(this,ee,{writable:!0,value:void 0}),(0,re._)(this,U,{writable:!0,value:void 0}),(0,re._)(this,T,{writable:!0,value:void 0}),(0,re._)(this,w,{writable:!0,value:void 0}),(0,re._)(this,R,{writable:!0,value:void 0}),(0,re._)(this,F,{writable:!0,value:void 0}),(0,re._)(this,ve,{writable:!0,value:(...Ze)=>{const qe=new URL((0,j._)(this,ee));return qe.pathname=Ze.map(Jt=>encodeURIComponent(Jt)).join("/"),qe}}),(0,ae._)(this,ee,d),(0,ae._)(this,U,C),(0,ae._)(this,T,A),(0,ae._)(this,w,K),(0,ae._)(this,R,ye),(0,ae._)(this,F,we)}}const k="dev.azure.com",rt=["clientId","clientSecret","tenantId","personalAccessToken"],ht=new Map([["ClientSecret",["clientId","clientSecret","tenantId"]],["ManagedIdentity",["clientId"]],["PersonalAccessToken",["personalAccessToken"]]]);function Nt(S){for(const d of ht.entries()){const[C,A]=d,K=rt.filter(ye=>!A.includes(ye));if(A.every(ye=>S[ye]!==void 0)&&K.every(ye=>S[ye]===void 0))return{kind:C,organizations:S.organizations,...A.reduce((ye,we)=>(ye[we]=S[we],ye),{})}}throw new Error("is not a valid credential")}function Ut(S){var d,C;const A=(C=S.getOptionalString("host"))!==null&&C!==void 0?C:k;let K=(d=S.getOptionalConfigArray("credentials"))===null||d===void 0?void 0:d.map(Wt=>({organizations:Wt.getOptionalStringArray("organizations"),personalAccessToken:Wt.getOptionalString("personalAccessToken"),tenantId:Wt.getOptionalString("tenantId"),clientId:Wt.getOptionalString("clientId"),clientSecret:Wt.getOptionalString("clientSecret")}));const ye=S.getOptionalString("token");if(S.getOptional("credential")!==void 0&&S.getOptional("credentials")!==void 0)throw new Error("Invalid Azure integration config, 'credential' and 'credentials' cannot be used together. Use 'credentials' instead.");if(S.getOptional("token")!==void 0&&S.getOptional("credentials")!==void 0)throw new Error("Invalid Azure integration config, 'token' and 'credentials' cannot be used together. Use 'credentials' instead.");if(ye!==void 0){var we;const Wt=[{personalAccessToken:ye}];var Ze;K=(Ze=(we=K)===null||we===void 0?void 0:we.concat(Wt))!==null&&Ze!==void 0?Ze:Wt}if(S.getOptional("credential")!==void 0){var qe;const Wt=[{organizations:S.getOptionalStringArray("credential.organizations"),token:S.getOptionalString("credential.token"),tenantId:S.getOptionalString("credential.tenantId"),clientId:S.getOptionalString("credential.clientId"),clientSecret:S.getOptionalString("credential.clientSecret")}];var Jt;K=(Jt=(qe=K)===null||qe===void 0?void 0:qe.concat(Wt))!==null&&Jt!==void 0?Jt:Wt}if(!H(A))throw new Error(`Invalid Azure integration config, '${A}' is not a valid host`);let cn;if(K!==void 0){var pn,In;const Wt=(pn=K)===null||pn===void 0?void 0:pn.reduce((un,lr,cr)=>{let wr;try{Nt(lr)}catch(Yn){wr=Yn.message}return wr!==void 0&&un.push(`credential at position ${cr+1} ${wr}`),un},Array.of()).concat(Object.entries(K.filter(un=>un.organizations!==void 0&&un.organizations.length>0).reduce((un,lr,cr)=>{var wr;return(wr=lr.organizations)===null||wr===void 0||wr.forEach(Yn=>{un[Yn]||(un[Yn]=[]),un[Yn].push(cr+1)}),un},{})).filter(([un,lr])=>lr.length>1).reduce((un,[lr,cr])=>(un.push(`organization ${lr} is specified multiple times in credentials at positions ${cr.slice(0,cr.length-1).join(", ")} and ${cr[cr.length-1]}`),un),Array.of()));if(((In=Wt)===null||In===void 0?void 0:In.length)>0)throw new Error(`Invalid Azure integration config for ${A}: ${Wt.join("; ")}`);if(cn=K.map(un=>Nt(un)),cn.some(un=>un.kind!=="PersonalAccessToken")&&A!==k)throw new Error(`Invalid Azure integration config for ${A}, only personal access tokens can be used with hosts other than ${k}`);if(cn.filter(un=>un.organizations===void 0||un.organizations.length===0).length>1)throw new Error(`Invalid Azure integration config for ${A}, you cannot specify multiple credentials without organizations`)}return{host:A,credentials:cn}}function Bt(S){const d=S.map(Ut);return d.some(C=>C.host===k)||d.push({host:k}),d}class Dt{get type(){return"azure"}get title(){return this.integrationConfig.host}get config(){return this.integrationConfig}resolveUrl(d){const{url:C,base:A}=d;if(m(C))return C;try{const ye=be.fromRepoUrl(A),we=new URL(A);var K;const Ze=new URL(`https://a.com${(K=ye.getPath())!==null&&K!==void 0?K:""}`),qe=new URL(C,Ze).pathname;return we.searchParams.set("path",qe),d.lineNumber&&(we.searchParams.set("line",String(d.lineNumber)),we.searchParams.set("lineEnd",String(d.lineNumber+1)),we.searchParams.set("lineStartColumn","1"),we.searchParams.set("lineEndColumn","1")),we.toString()}catch{return new URL(C,A).toString()}}resolveEditUrl(d){return d}constructor(d){(0,r._)(this,"integrationConfig",void 0),this.integrationConfig=d}}(0,r._)(Dt,"factory",({config:S})=>{var d;const C=Bt((d=S.getOptionalConfigArray("integrations.azure"))!==null&&d!==void 0?d:[]);return h(C.map(A=>new Dt(A)),A=>A.config.host)});function _e(S){return AzureUrl.fromRepoUrl(S).toFileUrl()}function yt(S){return AzureUrl.fromRepoUrl(S).toArchiveUrl()}function ft(S){return AzureUrl.fromRepoUrl(S).toCommitsUrl()}const Je="bitbucket.org",Ft="https://api.bitbucket.org/2.0";function $t(S){var d;const C=(d=S.getOptionalString("host"))!==null&&d!==void 0?d:Je;let A=S.getOptionalString("apiBaseUrl");const K=S.getOptionalString("token"),ye=S.getOptionalString("username"),we=S.getOptionalString("appPassword");if(!H(C))throw new Error(`Invalid Bitbucket integration config, '${C}' is not a valid host`);return A?A=(0,f.trimEnd)(A,"/"):C===Je?A=Ft:A=`https://${C}/rest/api/1.0`,{host:C,apiBaseUrl:A,token:K,username:ye,appPassword:we}}function Mt(S){const d=S.map($t);return d.some(C=>C.host===Je)||d.push({host:Je,apiBaseUrl:Ft}),d}class Se{get type(){return"bitbucket"}get title(){return this.integrationConfig.host}get config(){return this.integrationConfig}resolveUrl(d){const C=P(d);if(!d.lineNumber)return C;const A=new URL(C);return this.integrationConfig.host==="bitbucket.org"?A.hash=`lines-${d.lineNumber}`:A.hash=`${d.lineNumber}`,A.toString()}resolveEditUrl(d){const C=V()(d),A=new URL(d);return A.searchParams.set("mode","edit"),A.searchParams.set("spa","0"),A.searchParams.set("at",C.ref),A.toString()}constructor(d){(0,r._)(this,"integrationConfig",void 0),this.integrationConfig=d}}(0,r._)(Se,"factory",({config:S})=>{var d,C,A;const K=Mt((A=S.getOptionalConfigArray("integrations.bitbucket"))!==null&&A!==void 0?A:[...(d=S.getOptionalConfigArray("integrations.bitbucketCloud"))!==null&&d!==void 0?d:[],...(C=S.getOptionalConfigArray("integrations.bitbucketServer"))!==null&&C!==void 0?C:[]]);return h(K.map(ye=>new Se(ye)),ye=>ye.config.host)});var Be=n(96279),Ge=n(48834).lW;async function et(S,d){const{name:C,owner:A,resource:K}=parseGitUrl(S),ye=K==="bitbucket.org";let we=ye?`${d.apiBaseUrl}/repositories/${A}/${C}`:`${d.apiBaseUrl}/projects/${A}/repos/${C}/default-branch`,Ze=await fetch(we,pt(d));if(Ze.status===404&&!ye&&(we=`${d.apiBaseUrl}/projects/${A}/repos/${C}/branches/default`,Ze=await fetch(we,pt(d))),!Ze.ok){const Jt=`Failed to retrieve default branch from ${we}, ${Ze.status} ${Ze.statusText}`;throw new Error(Jt)}let qe;if(ye)qe=(await Ze.json()).mainbranch.name;else{const{displayId:Jt}=await Ze.json();qe=Jt}if(!qe)throw new Error(`Failed to read default branch from ${we}. Response ${Ze.status} ${Ze.json()}`);return qe}async function at(S,d){const{name:C,owner:A,ref:K,protocol:ye,resource:we,filepath:Ze}=parseGitUrl(S),qe=we==="bitbucket.org";let Jt=K;Jt||(Jt=await et(S,d));const cn=Ze?`&path=${encodeURIComponent(decodeURIComponent(Ze))}`:"";return qe?`${ye}://${we}/${A}/${C}/get/${Jt}.tar.gz`:`${d.apiBaseUrl}/projects/${A}/repos/${C}/archive?format=tgz&at=${Jt}&prefix=${A}-${C}${cn}`}function Tt(S,d){try{const{owner:C,name:A,ref:K,filepathtype:ye,filepath:we}=parseGitUrl(S);if(!C||!A||ye!=="browse"&&ye!=="raw"&&ye!=="src")throw new Error("Invalid Bitbucket URL or file path");const Ze=we.replace(/^\//,"");if(d.host==="bitbucket.org"){if(!K)throw new Error("Invalid Bitbucket URL or file path");return`${d.apiBaseUrl}/repositories/${C}/${A}/src/${K}/${Ze}`}return`${d.apiBaseUrl}/projects/${C}/repos/${A}/raw/${Ze}?at=${K}`}catch(C){throw new Error(`Incorrect URL: ${S}, ${C}`)}}function pt(S){const d={};if(S.token)d.Authorization=`Bearer ${S.token}`;else if(S.username&&S.appPassword){const C=Ge.from(`${S.username}:${S.appPassword}`,"utf8");d.Authorization=`Basic ${C.toString("base64")}`}return{headers:d}}const xe="bitbucket.org",G="https://api.bitbucket.org/2.0";function pe(S){const d=xe,C=G,A=S.getString("username"),K=S.getString("appPassword");return{host:d,apiBaseUrl:C,username:A,appPassword:K}}function Ee(S){const d=S.map(pe);return d.length===0&&d.push({host:xe,apiBaseUrl:G}),d}class He{get type(){return"bitbucketCloud"}get title(){return this.integrationConfig.host}get config(){return this.integrationConfig}resolveUrl(d){const C=P(d);if(d.lineNumber){const A=new URL(C);return A.hash=`lines-${d.lineNumber}`,A.toString()}return C}resolveEditUrl(d){const C=V()(d),A=new URL(d);return A.searchParams.set("mode","edit"),A.searchParams.set("at",C.ref),A.toString()}constructor(d){(0,r._)(this,"integrationConfig",void 0),this.integrationConfig=d}}(0,r._)(He,"factory",({config:S})=>{var d;const C=Ee((d=S.getOptionalConfigArray("integrations.bitbucketCloud"))!==null&&d!==void 0?d:[]);return h(C.map(A=>new He(A)),A=>A.config.host)});var gt=n(48834).lW;async function Qe(S,d){const{name:C,owner:A}=parseGitUrl(S),K=`${d.apiBaseUrl}/repositories/${A}/${C}`,ye=await fetch(K,tn(d));if(!ye.ok){const qe=`Failed to retrieve default branch from ${K}, ${ye.status} ${ye.statusText}`;throw new Error(qe)}const Ze=(await ye.json()).mainbranch.name;if(!Ze)throw new Error(`Failed to read default branch from ${K}. Response ${ye.status} ${ye.json()}`);return Ze}async function jt(S,d){const{name:C,owner:A,ref:K,protocol:ye,resource:we}=parseGitUrl(S);let Ze=K;return Ze||(Ze=await Qe(S,d)),`${ye}://${we}/${A}/${C}/get/${Ze}.tar.gz`}function an(S,d){try{const{owner:C,name:A,ref:K,filepathtype:ye,filepath:we}=parseGitUrl(S);if(!C||!A||ye!=="src"&&ye!=="raw")throw new Error("Invalid Bitbucket Cloud URL or file path");const Ze=we.replace(/^\//,"");if(!K)throw new Error("Invalid Bitbucket Cloud URL or file path");return`${d.apiBaseUrl}/repositories/${C}/${A}/src/${K}/${Ze}`}catch(C){throw new Error(`Incorrect URL: ${S}, ${C}`)}}function tn(S){const d={};if(S.username&&S.appPassword){const C=gt.from(`${S.username}:${S.appPassword}`,"utf8");d.Authorization=`Basic ${C.toString("base64")}`}return{headers:d}}function ln(S){const d=S.getString("host");let C=S.getOptionalString("apiBaseUrl");const A=S.getOptionalString("token"),K=S.getOptionalString("username"),ye=S.getOptionalString("password");if(!H(d))throw new Error(`Invalid Bitbucket Server integration config, '${d}' is not a valid host`);return C?C=(0,f.trimEnd)(C,"/"):C=`https://${d}/rest/api/1.0`,{host:d,apiBaseUrl:C,token:A,username:K,password:ye}}function fn(S){return S.map(ln)}class dn{get type(){return"bitbucketServer"}get title(){return this.integrationConfig.host}get config(){return this.integrationConfig}resolveUrl(d){const C=P(d);if(d.lineNumber){const A=new URL(C);return A.hash=d.lineNumber.toString(),A.toString()}return C}resolveEditUrl(d){return d.includes("?")?d.substring(0,d.indexOf("?")):d}constructor(d){(0,r._)(this,"integrationConfig",void 0),this.integrationConfig=d}}(0,r._)(dn,"factory",({config:S})=>{var d;const C=fn((d=S.getOptionalConfigArray("integrations.bitbucketServer"))!==null&&d!==void 0?d:[]);return h(C.map(A=>new dn(A)),A=>A.config.host)});var Bn=n(48834).lW;async function Fn(S,d){const{name:C,owner:A}=parseGitUrl(S);let K=`${d.apiBaseUrl}/projects/${A}/repos/${C}/default-branch`,ye=await fetch(K,Vt(d));if(ye.status===404&&(K=`${d.apiBaseUrl}/projects/${A}/repos/${C}/branches/default`,ye=await fetch(K,Vt(d))),!ye.ok){const qe=`Failed to retrieve default branch from ${K}, ${ye.status} ${ye.statusText}`;throw new Error(qe)}const{displayId:we}=await ye.json(),Ze=we;if(!Ze)throw new Error(`Failed to read default branch from ${K}. Response ${ye.status} ${ye.json()}`);return Ze}async function ot(S,d){const{name:C,owner:A,ref:K,filepath:ye}=parseGitUrl(S);let we=K;we||(we=await Fn(S,d));const Ze=ye?`&path=${encodeURIComponent(decodeURIComponent(ye))}`:"";return`${d.apiBaseUrl}/projects/${A}/repos/${C}/archive?format=tgz&at=${we}&prefix=${A}-${C}${Ze}`}function on(S,d){try{const{owner:C,name:A,ref:K,filepathtype:ye,filepath:we}=parseGitUrl(S);if(!C||!A||ye!=="browse"&&ye!=="raw"&&ye!=="src")throw new Error("Invalid Bitbucket Server URL or file path");const Ze=we.replace(/^\//,"");return`${d.apiBaseUrl}/projects/${C}/repos/${A}/raw/${Ze}?at=${K}`}catch(C){throw new Error(`Incorrect URL: ${S}, ${C}`)}}function Vt(S){const d={};if(S.token)d.Authorization=`Bearer ${S.token}`;else if(S.username&&S.password){const C=Bn.from(`${S.username}:${S.password}`,"utf8");d.Authorization=`Basic ${C.toString("base64")}`}return{headers:d}}function st(S){const d=S.getString("host");let C=S.getOptionalString("baseUrl"),A=S.getOptionalString("cloneUrl"),K=S.getOptionalString("gitilesBaseUrl");const ye=S.getOptionalString("username"),we=S.getOptionalString("password");if(H(d)){if(C&&!m(C))throw new Error(`Invalid Gerrit integration config, '${C}' is not a valid baseUrl`);if(A&&!m(A))throw new Error(`Invalid Gerrit integration config, '${A}' is not a valid cloneUrl`);if(K&&!m(K))throw new Error(`Invalid Gerrit integration config, '${K}' is not a valid gitilesBaseUrl`)}else throw new Error(`Invalid Gerrit integration config, '${d}' is not a valid host`);return C?C=(0,f.trimEnd)(C,"/"):C=`https://${d}`,K?K=(0,f.trimEnd)(K,"/"):K=`https://${d}`,A?A=(0,f.trimEnd)(A,"/"):A=C,{host:d,baseUrl:C,cloneUrl:A,gitilesBaseUrl:K,username:ye,password:we}}function Sn(S){return S.map(st)}var qt=n(48834).lW;const Cn=")]}'";function yn(S,d){const C=new URL(S.gitilesBaseUrl),A=new URL(d),ye=A.pathname.substring(A.pathname.startsWith("/a/")?2:0).replace(C.pathname,"").split("/").filter(pn=>!!pn),we=ye.indexOf("+");if(we<=0)throw new Error(`Unable to parse project from url: ${d}`);const Ze=(0,f.trimStart)(ye.slice(0,we).join("/"),"/"),qe=ye.indexOf("heads");if(qe<=0)throw new Error(`Unable to parse branch from url: ${d}`);const Jt=ye[qe+1],cn=ye.slice(qe+2).join("/");return{branch:Jt,filePath:cn===""?"/":cn,project:Ze}}function Hn(S,d,C,A){return`${S.gitilesBaseUrl}/${d}/+/refs/heads/${C}/${(0,f.trimStart)(A,"/")}`}function fr(S,d,C,A){const K=A==="/"||A===""?".tar.gz":`/${A}.tar.gz`;return`${_n(S)}/${d}/+archive/refs/heads/${C}${K}`}function $n(S){return S.password?"/a/":"/"}function _n(S){if(!S.baseUrl||!S.gitilesBaseUrl)throw new Error("Unexpected Gerrit config values. baseUrl or gitilesBaseUrl not set.");if(S.gitilesBaseUrl.startsWith(S.baseUrl))return S.gitilesBaseUrl.replace(S.baseUrl.concat("/"),S.baseUrl.concat($n(S)));if(S.password)throw new Error("Since the baseUrl (Gerrit) is not part of the gitilesBaseUrl, an authentication URL could not be constructed.");return S.gitilesBaseUrl}function Zn(S,d){const{branch:C,project:A}=yn(S,d);return`${S.baseUrl}${$n(S)}projects/${encodeURIComponent(A)}/branches/${C}`}function Cr(S,d){const{project:C}=yn(S,d);return`${S.cloneUrl}${$n(S)}${C}`}function Gn(S,d){const{branch:C,filePath:A,project:K}=yn(S,d);return`${S.baseUrl}${$n(S)}projects/${encodeURIComponent(K)}/branches/${C}/files/${encodeURIComponent(A)}/content`}function Re(S){return`${S.baseUrl}${$n(S)}projects/`}function ne(S){const d={};if(!S.password)return d;const C=qt.from(`${S.username}:${S.password}`,"utf8");return d.Authorization=`Basic ${C.toString("base64")}`,{headers:d}}async function Te(S){const d=await S.text();if(d.startsWith(Cn))try{return JSON.parse(d.slice(Cn.length))}catch(C){throw new Error(`Invalid response from Gerrit: ${d.slice(0,10)} - ${C}`)}throw new Error(`Gerrit JSON body prefix missing. Found: ${d.slice(0,10)}`)}class ze{get type(){return"gerrit"}get title(){return this.integrationConfig.host}get config(){return this.integrationConfig}resolveUrl(d){const{url:C,base:A,lineNumber:K}=d;let ye;if(C.startsWith("/")){const{branch:we,project:Ze}=yn(this.config,A);return Hn(this.config,Ze,we,C)}return C?ye=new URL(C,A):ye=new URL(A),K&&(ye.hash=K.toString()),ye.toString()}resolveEditUrl(d){return d}constructor(d){(0,r._)(this,"integrationConfig",void 0),this.integrationConfig=d}}(0,r._)(ze,"factory",({config:S})=>{var d;const C=Sn((d=S.getOptionalConfigArray("integrations.gerrit"))!==null&&d!==void 0?d:[]);return h(C.map(A=>new ze(A)),A=>A.config.host)});function ct(S){const d=S.getString("host");let C=S.getOptionalString("baseUrl");const A=S.getOptionalString("username"),K=S.getOptionalString("password");if(!H(d))throw new Error(`Invalid Gitea integration config, '${d}' is not a valid host`);return C?C=(0,f.trimEnd)(C,"/"):C=`https://${d}`,{host:d,baseUrl:C,username:A,password:K}}var Rt=n(48834).lW;function Ht(S,d){try{var C;const A=(C=S.baseUrl)!==null&&C!==void 0?C:`https://${S.host}`,[K,ye,we,Ze,qe,Jt,...cn]=d.replace(A,"").split("/"),pn=cn.join("/").replace(/^\//,"");return`${A}/${ye}/${we}/_edit/${Jt}/${pn}`}catch(A){throw new Error(`Incorrect URL: ${d}, ${A}`)}}function nn(S,d){try{var C;const A=(C=S.baseUrl)!==null&&C!==void 0?C:`https://${S.host}`,[K,ye,we,Ze,qe,Jt,...cn]=d.replace(A,"").split("/"),pn=cn.join("/").replace(/^\//,"");return`${A}/api/v1/repos/${ye}/${we}/contents/${pn}?ref=${Jt}`}catch(A){throw new Error(`Incorrect URL: ${d}, ${A}`)}}function gn(S){const d={},{username:C,password:A}=S;return A?(C?d.Authorization=`basic ${Rt.from(`${C}:${A}`).toString("base64")}`:d.Authorization=`token ${A}`,{headers:d}):d}class sn{get type(){return"gitea"}get title(){return this.config.host}resolveUrl(d){return P(d)}resolveEditUrl(d){return Ht(this.config,d)}constructor(d){(0,r._)(this,"config",void 0),this.config=d}}(0,r._)(sn,"factory",({config:S})=>{var d;const A=((d=S.getOptionalConfigArray("integrations.gitea"))!==null&&d!==void 0?d:[]).map(K=>ct(K));return h(A.map(K=>new sn(K)),K=>K.config.host)});const hn="github.com",le="https://api.github.com",de="https://raw.githubusercontent.com";function Y(S){var d,C;const A=(C=S.getOptionalString("host"))!==null&&C!==void 0?C:hn;let K=S.getOptionalString("apiBaseUrl"),ye=S.getOptionalString("rawBaseUrl");const we=S.getOptionalString("token"),Ze=(d=S.getOptionalConfigArray("apps"))===null||d===void 0?void 0:d.map(qe=>({appId:qe.getNumber("appId"),clientId:qe.getString("clientId"),clientSecret:qe.getString("clientSecret"),webhookSecret:qe.getString("webhookSecret"),privateKey:qe.getString("privateKey"),allowedInstallationOwners:qe.getOptionalStringArray("allowedInstallationOwners")}));if(!H(A))throw new Error(`Invalid GitHub integration config, '${A}' is not a valid host`);return K?K=(0,f.trimEnd)(K,"/"):A===hn&&(K=le),ye?ye=(0,f.trimEnd)(ye,"/"):A===hn&&(ye=de),{host:A,apiBaseUrl:K,rawBaseUrl:ye,token:we,apps:Ze}}function v(S){const d=S.map(Y);return d.some(C=>C.host===hn)||d.push({host:hn,apiBaseUrl:le,rawBaseUrl:de}),d}function L(S,d,C){try{const{owner:A,name:K,ref:ye,filepathtype:we,filepath:Ze}=parseGitUrl(S);if(!A||!K||!ye||we!=="blob"&&we!=="raw"&&we!=="tree")throw new Error("Invalid GitHub URL or file path");const qe=Ze.replace(/^\//,"");return W(d,C)==="api"?`${d.apiBaseUrl}/repos/${A}/${K}/contents/${qe}?ref=${ye}`:`${d.rawBaseUrl}/${A}/${K}/${ye}/${qe}`}catch(A){throw new Error(`Incorrect URL: ${S}, ${A}`)}}function M(S,d){const C={};return W(S,d)==="api"&&(C.Accept="application/vnd.github.v3.raw"),d.token&&(C.Authorization=`token ${d.token}`),{headers:C}}function W(S,d){return S.apiBaseUrl&&(d.token||!S.rawBaseUrl)?"api":"raw"}var ue=n(35355),Ce=n(89393),Oe=n(26228);class tt{async getOrCreateToken(d,C,A){let K=this.tokenCache.get(d);if((!K||this.isExpired(K.expiresAt))&&(K=await A(),K.expiresAt=K.expiresAt.minus({minutes:10}),this.tokenCache.set(d,K)),!this.appliesToRepo(K,C))throw new Error(`The Backstage GitHub application used in the ${d} organization does not have access to a repository with the name ${C}`);return{accessToken:K.token}}appliesToRepo(d,C){return C===void 0?!0:d.repositories!==void 0?d.repositories.includes(C):!0}constructor(){(0,r._)(this,"tokenCache",new Map),(0,r._)(this,"isExpired",d=>Oe.ou.local()>d)}}const nt={Accept:"application/vnd.github.machine-man-preview+json"};class mt{async getInstallationCredentials(d,C){if(this.allowedInstallationOwners){var A;if(!(!((A=this.allowedInstallationOwners)===null||A===void 0)&&A.includes(d)))return{accessToken:void 0}}return this.cache.getOrCreateToken(d,C,async()=>{const{installationId:K,suspended:ye}=await this.getInstallationData(d);if(ye)throw new Error(`The GitHub application for ${d} is suspended`);const we=await this.appClient.apps.createInstallationAccessToken({installation_id:K,headers:nt});let Ze;if(we.data.repository_selection==="selected"){const Jt=new Ce.v({baseUrl:this.baseUrl,auth:we.data.token}),cn=await Jt.paginate(Jt.apps.listReposAccessibleToInstallation);var qe;Ze=((qe=cn.repositories)!==null&&qe!==void 0?qe:cn).map(In=>In.name)}return{token:we.data.token,expiresAt:Oe.ou.fromISO(we.data.expires_at),repositories:Ze}})}getInstallations(){return this.appClient.paginate(this.appClient.apps.listInstallations)}async getInstallationData(d){const A=(await this.getInstallations()).find(ye=>{var we;return ye.account&&"login"in ye.account&&((we=ye.account.login)===null||we===void 0?void 0:we.toLocaleLowerCase("en-US"))===d.toLocaleLowerCase("en-US")});if(A)return{installationId:A.id,suspended:Boolean(A.suspended_by)};const K=new Error(`No app installation found for ${d} in ${this.baseAuthConfig.appId}`);throw K.name="NotFoundError",K}constructor(d,C){(0,r._)(this,"appClient",void 0),(0,r._)(this,"baseUrl",void 0),(0,r._)(this,"baseAuthConfig",void 0),(0,r._)(this,"cache",new tt),(0,r._)(this,"allowedInstallationOwners",void 0),this.allowedInstallationOwners=d.allowedInstallationOwners,this.baseUrl=C,this.baseAuthConfig={appId:d.appId,privateKey:d.privateKey.replace(/\\n/gm,`
|
|
33
|
+
`)},this.appClient=new Ce.v({baseUrl:C,headers:nt,authStrategy:ue.i,auth:this.baseAuthConfig})}}class xt{async getAllInstallations(){return this.apps.length?(await Promise.all(this.apps.map(C=>C.getInstallations()))).flat():[]}async getAppToken(d,C){if(this.apps.length===0)return;const A=await Promise.all(this.apps.map(Ze=>Ze.getInstallationCredentials(d,C).then(qe=>({credentials:qe,error:void 0}),qe=>({credentials:void 0,error:qe})))),K=A.find(Ze=>{var qe;return(qe=Ze.credentials)===null||qe===void 0?void 0:qe.accessToken});if(K)return K.credentials.accessToken;const we=A.map(Ze=>Ze.error).find(Ze=>{var qe;return((qe=Ze)===null||qe===void 0?void 0:qe.name)!=="NotFoundError"});if(we)throw we}constructor(d){var C;(0,r._)(this,"apps",void 0);var A;this.apps=(A=(C=d.apps)===null||C===void 0?void 0:C.map(K=>new mt(K,d.apiBaseUrl)))!==null&&A!==void 0?A:[]}}class it{async getCredentials(d){const C=V()(d.url),A=C.owner||C.name,K=C.owner?C.name:void 0;let ye="app",we=await this.githubAppCredentialsMux.getAppToken(A,K);return we||(ye="token",we=this.token),{headers:we?{Authorization:`Bearer ${we}`}:void 0,token:we,type:ye}}constructor(d,C){(0,r._)(this,"githubAppCredentialsMux",void 0),(0,r._)(this,"token",void 0),this.githubAppCredentialsMux=d,this.token=C}}(0,r._)(it,"create",S=>new it(new xt(S),S.token));class $e{static fromIntegrations(d){const C=new Map;return d.github.list().forEach(A=>{const K=SingleInstanceGithubCredentialsProvider.create(A.config);C.set(A.config.host,K)}),new $e(C)}async getCredentials(d){const C=new URL(d.url),A=this.providers.get(C.host);if(!A)throw new Error(`There is no GitHub integration that matches ${d.url}. Please add a configuration for an integration.`);return A.getCredentials(d)}constructor(d){_define_property(this,"providers",void 0),this.providers=d}}class vt{get type(){return"github"}get title(){return this.integrationConfig.host}get config(){return this.integrationConfig}resolveUrl(d){return Xt(P(d),"tree")}resolveEditUrl(d){return Xt(d,"edit")}constructor(d){(0,r._)(this,"integrationConfig",void 0),this.integrationConfig=d}}(0,r._)(vt,"factory",({config:S})=>{var d;const C=v((d=S.getOptionalConfigArray("integrations.github"))!==null&&d!==void 0?d:[]);return h(C.map(A=>new vt(A)),A=>A.config.host)});function Xt(S,d){return S.replace(/\/\/([^/]+)\/([^/]+)\/([^/]+)\/(blob|tree|edit)\//,(C,A,K,ye)=>`//${A}/${K}/${ye}/${d}/`)}const Et=null;class Zt extends vt{get config(){return super.config}constructor(d){super(d)}}(0,r._)(Zt,"factory",vt.factory);const _t=null,wn=null,Kt=null,bt="gitlab.com",It="https://gitlab.com/api/v4";function Yt(S){const d=S.getString("host");let C=S.getOptionalString("apiBaseUrl");const A=S.getOptionalString("token");let K=S.getOptionalString("baseUrl");if(C?C=(0,f.trimEnd)(C,"/"):d===bt&&(C=It),K?K=(0,f.trimEnd)(K,"/"):K=`https://${d}`,H(d)){if(!C||!m(C))throw new Error(`Invalid GitLab integration config, '${C}' is not a valid apiBaseUrl`);if(!m(K))throw new Error(`Invalid GitLab integration config, '${K}' is not a valid baseUrl`)}else throw new Error(`Invalid GitLab integration config, '${d}' is not a valid host`);return{host:d,token:A,apiBaseUrl:C,baseUrl:K}}function zt(S){const d=S.map(Yt);return d.some(C=>C.host===bt)||d.push({host:bt,apiBaseUrl:It,baseUrl:`https://${bt}`}),d}function gr(S){let d="";return S.host!==bt&&(d=new URL(S.baseUrl).pathname),trimEnd(d,"/")}async function er(S,d){const C=await ar(S,d);return bn(S,C,d).toString()}function ir(S){const{token:d=""}=S;return{headers:{"PRIVATE-TOKEN":d}}}function bn(S,d,C){try{const A=new URL(S),K=A.pathname.split("/blob/").slice(1).join("/blob/"),[ye,...we]=K.split("/"),Ze=getGitLabIntegrationRelativePath(C);return A.pathname=[...Ze?[Ze]:[],"api/v4/projects",d,"repository/files",encodeURIComponent(decodeURIComponent(we.join("/"))),"raw"].join("/"),A.search=`?ref=${ye}`,A}catch(A){throw new Error(`Incorrect url: ${S}, ${A}`)}}async function ar(S,d){const C=new URL(S);if(!C.pathname.includes("/blob/"))throw new Error("Please provide full path to yaml file from GitLab");try{let A=C.pathname.split("/-/blob/")[0].split("/blob/")[0];const K=getGitLabIntegrationRelativePath(d);K&&(A=A.replace(K,""));const ye=new URL(`${C.origin}${K}/api/v4/projects/${encodeURIComponent(A.replace(/^\//,""))}`),we=await fetch(ye.toString(),ir(d)),Ze=await we.json();if(!we.ok)throw new Error(`GitLab Error '${Ze.error}', ${Ze.error_description}`);return Number(Ze.id)}catch(A){throw new Error(`Could not get GitLab project ID for: ${S}, ${A}`)}}class Kn{get type(){return"gitlab"}get title(){return this.integrationConfig.host}get config(){return this.integrationConfig}resolveUrl(d){return P(d)}resolveEditUrl(d){return zr(d,"edit")}constructor(d){(0,r._)(this,"integrationConfig",void 0),this.integrationConfig=d}}(0,r._)(Kn,"factory",({config:S})=>{var d;const C=zt((d=S.getOptionalConfigArray("integrations.gitlab"))!==null&&d!==void 0?d:[]);return h(C.map(A=>new Kn(A)),A=>A.config.host)});function zr(S,d){return S.replace(/\/\-\/(blob|tree|edit)\//,`/-/${d}/`)}class tr{async getCredentials(d){return this.token?{headers:{Authorization:`Bearer ${this.token}`},token:this.token}:{}}constructor(d){(0,r._)(this,"token",void 0),this.token=d}}(0,r._)(tr,"create",S=>new tr(S.token));class Gr{static fromIntegrations(d){const C=new Map;return d.gitlab.list().forEach(A=>{const K=SingleInstanceGitlabCredentialsProvider.create(A.config);C.set(A.config.host,K)}),new Gr(C)}async getCredentials(d){const C=new URL(d.url),A=this.providers.get(C.host);if(!A)throw new Error(`There is no GitLab integration that matches ${d.url}. Please add a configuration for an integration.`);return A.getCredentials(d)}constructor(d){_define_property(this,"providers",void 0),this.providers=d}}class Or{static fromConfig(d){return new Or({awsS3:Z.factory({config:d}),azure:Dt.factory({config:d}),bitbucket:Se.factory({config:d}),bitbucketCloud:He.factory({config:d}),bitbucketServer:dn.factory({config:d}),gerrit:ze.factory({config:d}),github:vt.factory({config:d}),gitlab:Kn.factory({config:d}),gitea:sn.factory({config:d})})}get awsS3(){return this.byType.awsS3}get azure(){return this.byType.azure}get bitbucket(){return this.byType.bitbucket}get bitbucketCloud(){return this.byType.bitbucketCloud}get bitbucketServer(){return this.byType.bitbucketServer}get gerrit(){return this.byType.gerrit}get github(){return this.byType.github}get gitlab(){return this.byType.gitlab}get gitea(){return this.byType.gitea}list(){return Object.values(this.byType).flatMap(d=>d.list())}byUrl(d){let C=Object.values(this.byType).map(A=>A.byUrl(d)).filter(Boolean);if(C.length>1){const A=C.filter(K=>!(K instanceof Se));A.length!==0&&(C=A)}return C[0]}byHost(d){return Object.values(this.byType).map(C=>C.byHost(d)).find(Boolean)}resolveUrl(d){const C=this.byUrl(d.base);return C?C.resolveUrl(d):P(d)}resolveEditUrl(d){const C=this.byUrl(d);return C?C.resolveEditUrl(d):d}constructor(d){(0,r._)(this,"byType",void 0),this.byType=d}}},72171:function(wt,Ie,n){"use strict";var r={};n.r(r),n.d(r,{TechDocsPlugin:function(){return w.s4}});var p=n(52322),V=n(2784),f=n(28316),H=n(73557),m=n(97456);const h=(0,m.T0)({id:"plugin.techdocs.storageservice"}),P=(0,m.T0)({id:"plugin.techdocs.service"});var q=n(92077),_=n(95481),Q=n(7476),se=n(93225),Z=n(86317),j=n(65124),re=n(22478),ae=n(85478),oe=n(68435),ee=n(3482),U=n(42081),T=n(48431),w=n(89258),R=n(52943),F=n(61886),ve=n(13980),be=n.n(ve),k=n(87612);class rt{get(t){for(const o of this.holders){const a=o.get(t);if(a)return a}}constructor(...t){(0,k._)(this,"holders",void 0),this.holders=t}}var ht=n(51837);const Nt=(0,ht.CT)("api-context"),Ut=i=>{var t;const{apis:o,children:a}=i,c=(t=(0,V.useContext)(Nt))===null||t===void 0?void 0:t.atVersion(1),x=c?new rt(o,c):o;return(0,p.jsx)(Nt.Provider,{value:(0,ht.EI)({1:x}),children:a})};Ut.propTypes={apis:be().shape({get:be().func.isRequired}).isRequired,children:be().node};class Bt{static validateFactories(t,o){for(const a of o){const c=[a],x=new Set;for(;c.length;){const O=c.shift(),N=t.get(O);if(N)for(const J of Object.values(N.deps)){if(J.id===a.id)throw new Error(`Circular dependency of api factory for ${a}`);x.has(J)||(x.add(J),c.push(J))}}}}get(t){return this.load(t)}load(t,o=[]){const a=this.apis.get(t.id);if(a)return a;const c=this.factories.get(t);if(!c)return;if(o.includes(c.api))throw new Error(`Circular dependency of api factory for ${c.api}`);const x=this.loadDeps(t,c.deps,[...o,c.api]),O=c.factory(x);return this.apis.set(t.id,O),O}loadDeps(t,o,a){const c={};for(const x in o)if(o.hasOwnProperty(x)){const O=o[x],N=this.load(O,a);if(!N)throw new Error(`No API factory available for dependency ${O} of dependent ${t}`);c[x]=N}return c}constructor(t){(0,k._)(this,"factories",void 0),(0,k._)(this,"apis",void 0),this.factories=t,this.apis=new Map}}var Dt;(function(i){i[i.default=10]="default",i[i.app=50]="app",i[i.static=100]="static"})(Dt||(Dt={}));class _e{register(t,o){const a=Dt[t],c=this.factories.get(o.api.id);return c&&c.priority>=a?!1:(this.factories.set(o.api.id,{priority:a,factory:o}),!0)}get(t){const o=this.factories.get(t.id);if(o)return o.factory}getAllApis(){const t=new Set;for(const{factory:o}of this.factories.values())t.add(o.api);return t}constructor(){(0,k._)(this,"factories",new Map)}}function yt(i){return new Promise((t,o)=>{const a=i.width||500,c=i.height||700,x=window.screen.width/2-a/2,O=window.screen.height/2-c/2,N=window.open(i.url,i.name,`menubar=no,location=no,resizable=no,scrollbars=no,status=no,width=${a},height=${c},top=${O},left=${x}`);let J="";if(!N||typeof N.closed=="undefined"||N.closed){const ke=new Error("Failed to open auth popup.");ke.name="PopupRejectedError",o(ke);return}const fe=ke=>{if(ke.source!==N||ke.origin!==i.origin)return;const{data:Fe}=ke;if(Fe.type==="config_info"){J=Fe.targetOrigin;return}if(Fe.type!=="authorization_response")return;const Ke=Fe;if("error"in Ke){const At=new Error(Ke.error.message);At.name=Ke.error.name,o(At)}else t(Ke.response);je()},Ne=setInterval(()=>{if(N.closed){const ke=`Login failed, ${J&&J!==window.location.origin?`Incorrect app origin, expected ${J}`:"popup was closed"}`,Fe=new Error(ke);Fe.name="PopupClosedError",o(Fe),je()}},100);function je(){window.removeEventListener("message",fe),clearInterval(Ne)}window.addEventListener("message",fe)})}let ft=!1;function Je(i){return[...i].join(" ")}class Ft{async createSession(t){return t.instantPopup?this.enableExperimentalRedirectFlow?this.executeRedirect(t.scopes):this.showPopup(t.scopes):this.authRequester(t.scopes)}async refreshSession(t){const o=await fetch(await this.buildUrl("/refresh",{optional:!0,...t&&{scope:this.joinScopesFunc(t)}}),{headers:{"x-requested-with":"XMLHttpRequest"},credentials:"include"}).catch(c=>{throw new Error(`Auth refresh request failed, ${c}`)});if(!o.ok){const c=new Error(`Auth refresh request failed, ${o.statusText}`);throw c.status=o.status,c}const a=await o.json();if(a.error){const c=new Error(a.error.message);throw a.error.name&&(c.name=a.error.name),c}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(o=>{throw new Error(`Logout request failed, ${o}`)});if(!t.ok){const o=new Error(`Logout request failed, ${t.statusText}`);throw o.status=t.status,o}}async showPopup(t){var o,a,c,x,O,N,J,fe;const Ne=this.joinScopesFunc(t),je=await this.buildUrl("/start",{scope:Ne,origin:window.location.origin,flow:"popup"}),ke=!((a=this.popupOptions)===null||a===void 0||(o=a.size)===null||o===void 0)&&o.fullscreen?window.screen.width:((x=this.popupOptions)===null||x===void 0||(c=x.size)===null||c===void 0?void 0:c.width)||450,Fe=!((N=this.popupOptions)===null||N===void 0||(O=N.size)===null||O===void 0)&&O.fullscreen?window.screen.height:((fe=this.popupOptions)===null||fe===void 0||(J=fe.size)===null||J===void 0?void 0:J.height)||730,Ke=await yt({url:je,name:`${this.provider.title} Login`,origin:new URL(je).origin,width:ke,height:Fe});return await this.sessionTransform(Ke)}async executeRedirect(t){const o=this.joinScopesFunc(t);return window.location.href=await this.buildUrl("/start",{scope:o,origin:window.location.origin,redirectUrl:window.location.href,flow:"redirect"}),new Promise(()=>{})}async buildUrl(t,o){const a=await this.discoveryApi.getBaseUrl("auth"),c=this.buildQueryString({...o,env:this.environment});return`${a}/${this.provider.id}${t}${c}`}buildQueryString(t){if(!t)return"";const o=Object.entries(t).map(([a,c])=>{if(typeof c=="string")return`${encodeURIComponent(a)}=${encodeURIComponent(c)}`;if(c)return encodeURIComponent(a)}).filter(Boolean).join("&");return o?`?${o}`:""}constructor(t){(0,k._)(this,"discoveryApi",void 0),(0,k._)(this,"environment",void 0),(0,k._)(this,"provider",void 0),(0,k._)(this,"joinScopesFunc",void 0),(0,k._)(this,"authRequester",void 0),(0,k._)(this,"sessionTransform",void 0),(0,k._)(this,"enableExperimentalRedirectFlow",void 0),(0,k._)(this,"popupOptions",void 0);const{configApi:o,discoveryApi:a,environment:c,provider:x,joinScopes:O=Je,oauthRequestApi:N,sessionTransform:J=je=>je,popupOptions:fe}=t;!ft&&!o&&(console.warn("DEPRECATION WARNING: Authentication providers require a configApi instance to configure the authentication flow. Please provide one to the authentication provider constructor."),ft=!0);var Ne;this.enableExperimentalRedirectFlow=o&&(Ne=o.getOptionalBoolean("enableExperimentalRedirectFlow"))!==null&&Ne!==void 0?Ne:!1,this.authRequester=N.createAuthRequester({provider:x,onAuthRequest:async je=>this.enableExperimentalRedirectFlow?this.executeRedirect(je):this.showPopup(je)}),this.discoveryApi=a,this.environment=c,this.provider=x,this.joinScopesFunc=O,this.sessionTransform=J,this.popupOptions=fe}}function $t(i,t){for(const o of t)if(!i.has(o))return!1;return!0}class Mt{sessionExistsAndHasScope(t,o){if(!t)return!1;if(!o||this.options.sessionScopes===void 0)return!0;const a=this.options.sessionScopes(t);return $t(a,o)}getExtendedScope(t,o){const a=new Set(this.options.defaultScopes);if(t&&this.options.sessionScopes!==void 0){const c=this.options.sessionScopes(t);for(const x of c)a.add(x)}if(o)for(const c of o)a.add(c);return a}constructor(t){(0,k._)(this,"options",void 0),this.options=t}}var Se=n(82394),Be=n.n(Se);let Ge=Symbol.observable;class et{[Ge](){return this}get closed(){return this.isClosed}next(t){if(this.isClosed)throw new Error("PublishSubject is closed");this.subscribers.forEach(o=>o.next(t))}error(t){if(this.isClosed)throw new Error("PublishSubject is closed");this.isClosed=!0,this.terminatingError=t,this.subscribers.forEach(o=>o.error(t))}complete(){if(this.isClosed)throw new Error("PublishSubject is closed");this.isClosed=!0,this.subscribers.forEach(t=>t.complete())}subscribe(t,o,a){const c=typeof t=="function"?{next:t,error:o,complete:a}:t;return this.observable.subscribe(c)}constructor(){(0,k._)(this,"isClosed",!1),(0,k._)(this,"terminatingError",void 0),(0,k._)(this,"observable",new(Be())(t=>this.isClosed?(this.terminatingError?t.error(this.terminatingError):t.complete(),()=>{}):(this.subscribers.add(t),()=>{this.subscribers.delete(t)}))),(0,k._)(this,"subscribers",new Set)}}let at=Symbol.observable;class Tt{[at](){return this}get closed(){return this.isClosed}next(t){if(this.isClosed)throw new Error("BehaviorSubject is closed");this.currentValue=t,this.subscribers.forEach(o=>o.next(t))}error(t){if(this.isClosed)throw new Error("BehaviorSubject is closed");this.isClosed=!0,this.terminatingError=t,this.subscribers.forEach(o=>o.error(t))}complete(){if(this.isClosed)throw new Error("BehaviorSubject is closed");this.isClosed=!0,this.subscribers.forEach(t=>t.complete())}subscribe(t,o,a){const c=typeof t=="function"?{next:t,error:o,complete:a}:t;return this.observable.subscribe(c)}constructor(t){(0,k._)(this,"isClosed",void 0),(0,k._)(this,"currentValue",void 0),(0,k._)(this,"terminatingError",void 0),(0,k._)(this,"observable",void 0),(0,k._)(this,"subscribers",new Set),this.isClosed=!1,this.currentValue=t,this.terminatingError=void 0,this.observable=new(Be())(o=>this.isClosed?(this.terminatingError?o.error(this.terminatingError):o.complete(),()=>{}):(o.next(this.currentValue),this.subscribers.add(o),()=>{this.subscribers.delete(o)}))}}class pt{setIsSignedIn(t){this.signedIn!==t&&(this.signedIn=t,this.subject.next(this.signedIn?m.sM.SignedIn:m.sM.SignedOut))}sessionState$(){return this.subject}constructor(){(0,k._)(this,"subject",new Tt(m.sM.SignedOut)),(0,k._)(this,"signedIn",!1)}}class xe{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),c=this.sessionScopesFunc(this.currentSession),x=this.sessionScopesFunc(a);return $t(x,c)&&(this.currentSession=a),a}catch(a){if(t.optional)return;throw a}}if(!this.currentSession&&!t.instantPopup)try{const o=await this.collapsedSessionRefresh(t.scopes);return this.currentSession=o,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 o=await this.refreshPromise;return this.stateTracker.setIsSignedIn(!0),o}finally{delete this.refreshPromise}}constructor(t){(0,k._)(this,"connector",void 0),(0,k._)(this,"helper",void 0),(0,k._)(this,"sessionScopesFunc",void 0),(0,k._)(this,"sessionShouldRefreshFunc",void 0),(0,k._)(this,"stateTracker",new pt),(0,k._)(this,"refreshPromise",void 0),(0,k._)(this,"currentSession",void 0);const{connector:o,defaultScopes:a=new Set,sessionScopes:c,sessionShouldRefresh:x}=t;this.connector=o,this.sessionScopesFunc=c,this.sessionShouldRefreshFunc=x,this.helper=new Mt({sessionScopes:c,defaultScopes:a})}}class G{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:o,defaultScopes:a=new Set,sessionScopes:c}=t;this.connector=o,this.helper=new SessionScopeHelper({sessionScopes:c,defaultScopes:a})}}const pe={id:"oauth2",title:"Your Identity Provider",icon:()=>null};class Ee{static create(t){const{configApi:o,discoveryApi:a,environment:c="development",provider:x=pe,oauthRequestApi:O,defaultScopes:N=[],scopeTransform:J=ke=>ke,popupOptions:fe}=t,Ne=new Ft({configApi:o,discoveryApi:a,environment:c,provider:x,oauthRequestApi:O,sessionTransform({backstageIdentity:ke,...Fe}){const Ke={...Fe,providerInfo:{idToken:Fe.providerInfo.idToken,accessToken:Fe.providerInfo.accessToken,scopes:Ee.normalizeScopes(J,Fe.providerInfo.scope),expiresAt:Fe.providerInfo.expiresInSeconds?new Date(Date.now()+Fe.providerInfo.expiresInSeconds*1e3):void 0}};if(ke){var At;const kt=(At=ke.expiresInSeconds)!==null&&At!==void 0?At:Fe.providerInfo.expiresInSeconds;Ke.backstageIdentity={token:ke.token,identity:ke.identity,expiresAt:kt?new Date(Date.now()+kt*1e3):void 0}}return Ke},popupOptions:fe}),je=new xe({connector:Ne,defaultScopes:new Set(N),sessionScopes:ke=>ke.providerInfo.scopes,sessionShouldRefresh:ke=>{var Fe,Ke;let At=1/0;return!((Fe=ke.providerInfo)===null||Fe===void 0)&&Fe.expiresAt&&(At=Math.min(At,(ke.providerInfo.expiresAt.getTime()-Date.now())/1e3)),!((Ke=ke.backstageIdentity)===null||Ke===void 0)&&Ke.expiresAt&&(At=Math.min(At,(ke.backstageIdentity.expiresAt.getTime()-Date.now())/1e3)),At<60*5}});return new Ee({sessionManager:je,scopeTransform:J})}async signIn(){await this.getAccessToken()}async signOut(){await this.sessionManager.removeSession()}sessionState$(){return this.sessionManager.sessionState$()}async getAccessToken(t,o){var a;const c=Ee.normalizeScopes(this.scopeTransform,t),x=await this.sessionManager.getSession({...o,scopes:c});var O;return(O=(a=x)===null||a===void 0?void 0:a.providerInfo.accessToken)!==null&&O!==void 0?O:""}async getIdToken(t={}){var o;const a=await this.sessionManager.getSession({...t,scopes:new Set(["openid"])});var c;return(c=(o=a)===null||o===void 0?void 0:o.providerInfo.idToken)!==null&&c!==void 0?c:""}async getBackstageIdentity(t={}){var o;return(o=await this.sessionManager.getSession(t))===null||o===void 0?void 0:o.backstageIdentity}async getProfile(t={}){var o;return(o=await this.sessionManager.getSession(t))===null||o===void 0?void 0:o.profile}static normalizeScopes(t,o){if(!o)return new Set;const a=Array.isArray(o)?o:o.split(/[\s|,]/).filter(Boolean);return new Set(t(a))}constructor(t){(0,k._)(this,"sessionManager",void 0),(0,k._)(this,"scopeTransform",void 0),this.sessionManager=t.sessionManager,this.scopeTransform=t.scopeTransform}}const He={id:"github",title:"GitHub",icon:()=>null};class gt{static create(t){const{configApi:o,discoveryApi:a,environment:c="development",provider:x=He,oauthRequestApi:O,defaultScopes:N=["read:user"]}=t;return Ee.create({configApi:o,discoveryApi:a,oauthRequestApi:O,provider:x,environment:c,defaultScopes:N})}}const Qe={id:"gitlab",title:"GitLab",icon:()=>null};class jt{static create(t){const{configApi:o,discoveryApi:a,environment:c="development",provider:x=Qe,oauthRequestApi:O,defaultScopes:N=["read_user"]}=t;return Ee.create({configApi:o,discoveryApi:a,oauthRequestApi:O,provider:x,environment:c,defaultScopes:N})}}const an={id:"google",title:"Google",icon:()=>null},tn="https://www.googleapis.com/auth/";class ln{static create(t){const{configApi:o,discoveryApi:a,oauthRequestApi:c,environment:x="development",provider:O=an,defaultScopes:N=["openid",`${tn}userinfo.email`,`${tn}userinfo.profile`]}=t;return Ee.create({configApi:o,discoveryApi:a,oauthRequestApi:c,provider:O,environment:x,defaultScopes:N,scopeTransform(J){return J.map(fe=>fe==="openid"?fe:fe==="profile"||fe==="email"?`${tn}userinfo.${fe}`:fe.startsWith(tn)?fe:`${tn}${fe}`)}})}}const fn={id:"okta",title:"Okta",icon:()=>null},dn=new Set(["openid","profile","email","phone","address","groups","offline_access"]),Bn="okta.";class Fn{static create(t){const{configApi:o,discoveryApi:a,environment:c="development",provider:x=fn,oauthRequestApi:O,defaultScopes:N=["openid","email","profile","offline_access"]}=t;return Ee.create({configApi:o,discoveryApi:a,oauthRequestApi:O,provider:x,environment:c,defaultScopes:N,scopeTransform(J){return J.map(fe=>dn.has(fe)||fe.startsWith(Bn)?fe:`${Bn}${fe}`)}})}}var ot=n(30195);const on=ot.z.object({profile:ot.z.object({email:ot.z.string().optional(),displayName:ot.z.string().optional(),picture:ot.z.string().optional()}),backstageIdentity:ot.z.object({token:ot.z.string(),identity:ot.z.object({type:ot.z.literal("user"),userEntityRef:ot.z.string(),ownershipEntityRefs:ot.z.array(ot.z.string())})})}),Vt={id:"saml",title:"SAML",icon:()=>null};class st{static create(t){const{discoveryApi:o,environment:a="development",provider:c=Vt}=t,x=new DirectAuthConnector({discoveryApi:o,environment:a,provider:c}),O=new StaticAuthSessionManager({connector:x}),N=new AuthSessionStore({manager:O,storageKey:`${c.id}Session`,schema:samlSessionSchema});return new st(N)}sessionState$(){return this.sessionManager.sessionState$()}async signIn(){await this.getBackstageIdentity({})}async signOut(){await this.sessionManager.removeSession()}async getBackstageIdentity(t={}){var o;return(o=await this.sessionManager.getSession(t))===null||o===void 0?void 0:o.backstageIdentity}async getProfile(t={}){var o;return(o=await this.sessionManager.getSession(t))===null||o===void 0?void 0:o.profile}constructor(t){_define_property(this,"sessionManager",void 0),this.sessionManager=t}}const Sn={id:"microsoft",title:"Microsoft",icon:()=>null};class qt{static create(t){return new qt(t)}microsoftGraph(){return this.oauth2[qt.MicrosoftGraphID]}static resourceForScopes(t){const o=[...new Set(t.split(" ").map(qt.resourceForScope).filter(x=>x!=="openid"))];if(o.length>1)return Promise.reject(new Error(`Requested access token with scopes from multiple Azure resources: ${o.join(", ")}. Access tokens can only have a single audience.`));var a;const c=(a=o[0])!==null&&a!==void 0?a:qt.MicrosoftGraphID;return Promise.resolve(c)}static resourceForScope(t){var o;const a=(o=t.match(RegExp("^(?<resourceURI>.*)\\/(?<scp>[^\\/]*)$")))===null||o===void 0?void 0:o.groups;if(a){const{resourceURI:c}=a;return c.replace(/^api:\/\//,"")}switch(t){case"email":case"openid":case"offline_access":case"profile":return"openid";default:return qt.MicrosoftGraphID}}async getAccessToken(t,o){const a=t===void 0?qt.MicrosoftGraphID:await qt.resourceForScopes(Array.isArray(t)?t.join(" "):t);return a in this.oauth2||(this.oauth2[a]=Ee.create({configApi:this.configApi,discoveryApi:this.discoveryApi,oauthRequestApi:this.oauthRequestApi,provider:this.provider,environment:this.environment,scopeTransform:this.scopeTransform})),this.oauth2[a].getAccessToken(t,o)}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,k._)(this,"oauth2",void 0),(0,k._)(this,"configApi",void 0),(0,k._)(this,"environment",void 0),(0,k._)(this,"provider",void 0),(0,k._)(this,"oauthRequestApi",void 0),(0,k._)(this,"discoveryApi",void 0),(0,k._)(this,"scopeTransform",void 0);const{configApi:o,environment:a="development",provider:c=Sn,oauthRequestApi:x,discoveryApi:O,defaultScopes:N=["openid","offline_access","profile","email","User.Read"],scopeTransform:J=fe=>fe.concat("offline_access")}=t;this.configApi=o,this.environment=a,this.provider=c,this.oauthRequestApi=x,this.discoveryApi=O,this.scopeTransform=J,this.oauth2={[qt.MicrosoftGraphID]:Ee.create({configApi:this.configApi,discoveryApi:this.discoveryApi,oauthRequestApi:this.oauthRequestApi,provider:this.provider,environment:this.environment,scopeTransform:this.scopeTransform,defaultScopes:N})}}}(0,k._)(qt,"MicrosoftGraphID","00000003-0000-0000-c000-000000000000");const Cn={id:"onelogin",title:"onelogin",icon:()=>null},yn=new Set(["openid","profile","email","phone","address","groups","offline_access"]),Hn="onelogin.";class fr{static create(t){const{configApi:o,discoveryApi:a,environment:c="development",provider:x=Cn,oauthRequestApi:O}=t;return Ee.create({configApi:o,discoveryApi:a,oauthRequestApi:O,provider:x,environment:c,defaultScopes:["openid","email","profile","offline_access"],scopeTransform(N){return N.map(J=>yn.has(J)||J.startsWith(Hn)?J:`${Hn}${J}`)}})}}const $n={id:"bitbucket",title:"Bitbucket",icon:()=>null};class _n{static create(t){const{configApi:o,discoveryApi:a,environment:c="development",provider:x=$n,oauthRequestApi:O,defaultScopes:N=["team"]}=t;return Ee.create({configApi:o,discoveryApi:a,oauthRequestApi:O,provider:x,environment:c,defaultScopes:N})}}const Zn={id:"bitbucketServer",title:"Bitbucket Server",icon:()=>null};class Cr{static create(t){const{configApi:o,discoveryApi:a,environment:c="development",provider:x=Zn,oauthRequestApi:O,defaultScopes:N=["PROJECT_ADMIN"]}=t;return Ee.create({configApi:o,discoveryApi:a,oauthRequestApi:O,provider:x,environment:c,defaultScopes:N})}}const Gn={id:"atlassian",title:"Atlassian",icon:()=>null};class Re{static create(t){const{configApi:o,discoveryApi:a,environment:c="development",provider:x=Gn,oauthRequestApi:O}=t;return Ee.create({configApi:o,discoveryApi:a,oauthRequestApi:O,provider:x,environment:c})}}class ne{post(t){this.subject.next(t)}alert$(){return this.subject}constructor(){(0,k._)(this,"subject",new et)}}class Te{captureEvent(t){}}const ze="theme";class ct{static createWithStorage(t){const o=new ct(t);if(!window.localStorage)return o;var a;const c=(a=window.localStorage.getItem(ze))!==null&&a!==void 0?a:void 0;return o.setActiveThemeId(c),o.activeThemeId$().subscribe(x=>{x?window.localStorage.setItem(ze,x):window.localStorage.removeItem(ze)}),window.addEventListener("storage",x=>{if(x.key===ze){var O;const N=(O=localStorage.getItem(ze))!==null&&O!==void 0?O:void 0;o.setActiveThemeId(N)}}),o}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,k._)(this,"themes",void 0),(0,k._)(this,"activeThemeId",void 0),(0,k._)(this,"subject",void 0),this.themes=t,this.subject=new Tt(void 0)}}var Rt=n(23054);const Ht=null;function nn(i,t){let o,a=!1;const c={};try{var x;o=!((x=t)===null||x===void 0)&&x.key?i.getConfig(t.key):i;for(const N of Ht){const J=o.getOptionalNumber(N);J!==void 0&&(c[N]=J,a=!0)}}catch(N){throw new InputError(`Failed to read duration from config, ${N}`)}try{if(!a){const J=Ht.map(fe=>`'${fe}'`).join(", ");throw new Error(`Needs one or more of ${J}`)}const N=o.keys().filter(J=>!Ht.includes(J));if(N.length){const J=N.length===1?"property":"properties",fe=N.map(je=>`'${je}'`).join(", "),Ne=Ht.map(je=>`'${je}'`).join(", ");throw new Error(`Unknown ${J} ${fe}; expected one or more of ${Ne}`)}}catch(N){var O;let J="Failed to read duration from config";throw!((O=t)===null||O===void 0)&&O.key&&(J+=` at '${t.key}'`),new InputError(`${J}, ${N}`)}return c}var gn=n(9850),sn=n.n(gn),hn=n(12782),le=n.n(hn);const de=/^[a-z][a-z0-9]*(?:[-_][a-z][a-z0-9]*)*$/i;function Y(i){return typeof i=="object"&&i!==null&&!Array.isArray(i)}function v(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 L={type(i,t,o,a){return`Invalid type in config for key '${i}' in '${t}', got ${o}, wanted ${a}`},missing(i){return`Missing required config value at '${i}'`},convert(i,t,o){return`Unable to convert config value for key '${i}' in '${t}' to a ${o}`}};class M{static fromConfigs(t){return t.length===0?new M(void 0):t.reduce((o,{data:a,context:c,filteredKeys:x,deprecatedKeys:O})=>{const N=new M(a,c,o);if(N.filteredKeys=x,O)for(const{key:J,description:fe}of O)console.warn(`The configuration key '${J}' of ${c} is deprecated and may be removed soon. ${fe||""}`);return N},void 0)}has(t){var o;if(this.readValue(t)!==void 0)return!0;var c;return(c=(o=this.fallback)===null||o===void 0?void 0:o.has(t))!==null&&c!==void 0?c:!1}keys(){var t;const o=this.data?Object.keys(this.data):[];var a;const c=(a=(t=this.fallback)===null||t===void 0?void 0:t.keys())!==null&&a!==void 0?a:[];return[...new Set([...o,...c])]}get(t){const o=this.getOptional(t);if(o===void 0)throw new Error(L.missing(this.fullKey(t!=null?t:"")));return o}getOptional(t){var o;const a=sn()(this.readValue(t)),c=(o=this.fallback)===null||o===void 0?void 0:o.getOptional(t);if(a===void 0){if(!1)var x;return c}else if(c===void 0)return a;return le()({},{value:c},{value:a},(O,N)=>!Y(N)||!Y(O)?N:void 0).value}getConfig(t){const o=this.getOptionalConfig(t);if(o===void 0)throw new Error(L.missing(this.fullKey(t)));return o}getOptionalConfig(t){var o;const a=this.readValue(t),c=(o=this.fallback)===null||o===void 0?void 0:o.getOptionalConfig(t);if(Y(a))return this.copy(a,t,c);if(a!==void 0)throw new TypeError(L.type(this.fullKey(t),this.context,v(a),"object"));return c}getConfigArray(t){const o=this.getOptionalConfigArray(t);if(o===void 0)throw new Error(L.missing(this.fullKey(t)));return o}getOptionalConfigArray(t){const o=this.readConfigValue(t,c=>{if(!Array.isArray(c))return{expected:"object-array"};for(const[x,O]of c.entries())if(!Y(O))return{expected:"object-array",value:O,key:`${t}[${x}]`};return!0});if(!o){if(!1)var a;return}return o.map((c,x)=>this.copy(c,`${t}[${x}]`))}getNumber(t){const o=this.getOptionalNumber(t);if(o===void 0)throw new Error(L.missing(this.fullKey(t)));return o}getOptionalNumber(t){const o=this.readConfigValue(t,c=>typeof c=="number"||typeof c=="string"||{expected:"number"});if(typeof o=="number"||o===void 0)return o;const a=Number(o);if(!Number.isFinite(a))throw new Error(L.convert(this.fullKey(t),this.context,"number"));return a}getBoolean(t){const o=this.getOptionalBoolean(t);if(o===void 0)throw new Error(L.missing(this.fullKey(t)));return o}getOptionalBoolean(t){const o=this.readConfigValue(t,c=>typeof c=="boolean"||typeof c=="number"||typeof c=="string"||{expected:"boolean"});if(typeof o=="boolean"||o===void 0)return o;const a=String(o).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(L.convert(this.fullKey(t),this.context,"boolean"))}getString(t){const o=this.getOptionalString(t);if(o===void 0)throw new Error(L.missing(this.fullKey(t)));return o}getOptionalString(t){return this.readConfigValue(t,o=>typeof o=="string"&&o!==""||{expected:"string"})}getStringArray(t){const o=this.getOptionalStringArray(t);if(o===void 0)throw new Error(L.missing(this.fullKey(t)));return o}getOptionalStringArray(t){return this.readConfigValue(t,o=>{if(!Array.isArray(o))return{expected:"string-array"};for(const[a,c]of o.entries())if(typeof c!="string"||c==="")return{expected:"string-array",value:c,key:`${t}[${a}]`};return!0})}fullKey(t){return`${this.prefix}${this.prefix?".":""}${t}`}copy(t,o,a){const c=new M(t,this.context,a,this.fullKey(o));return c.filteredKeys=this.filteredKeys,c}readConfigValue(t,o){const a=this.readValue(t);if(a===void 0){var c;if(!1)var x;return(c=this.fallback)===null||c===void 0?void 0:c.readConfigValue(t,o)}const O=o(a);if(O!==!0){const{key:N=t,value:J=a,expected:fe}=O;throw new TypeError(L.type(this.fullKey(N),this.context,v(J),fe))}return a}readValue(t){const o=t?t.split("."):[];for(const c of o)if(!de.test(c))throw new TypeError(`Invalid config key '${t}'`);if(this.data===void 0)return;let a=this.data;for(const[c,x]of o.entries())if(Y(a))a=a[x];else if(a!==void 0){const O=this.fullKey(o.slice(0,c).join("."));throw new TypeError(L.type(O,this.context,v(a),"object"))}return a}constructor(t,o="mock-config",a,c=""){(0,k._)(this,"data",void 0),(0,k._)(this,"context",void 0),(0,k._)(this,"fallback",void 0),(0,k._)(this,"prefix",void 0),(0,k._)(this,"filteredKeys",void 0),(0,k._)(this,"notifiedFilteredKeys",void 0),this.data=t,this.context=o,this.fallback=a,this.prefix=c,this.notifiedFilteredKeys=new Set}}const W="Invalid discovery URL pattern,";class ue{static compile(t){const o=t.split(/\{\{\s*pluginId\s*\}\}/),a=o.join("pluginId");let c;try{c=new URL(a)}catch{throw new Error(`${W} URL '${a}' is invalid`)}if(c.hash)throw new Error(`${W} URL must not have a hash`);if(c.search)throw new Error(`${W} URL must not have a query`);if(a.endsWith("/"))throw new Error(`${W} URL must not end with a slash`);return new ue(o)}async getBaseUrl(t){return this.parts.join(encodeURIComponent(t))}constructor(t){(0,k._)(this,"parts",void 0),this.parts=t}}class Ce{post(t,o){var a;return!((a=o)===null||a===void 0)&&a.hidden||this.alertApi.post({message:t.message,severity:"error"}),this.errorApi.post(t,o)}error$(){return this.errorApi.error$()}constructor(t,o){(0,k._)(this,"alertApi",void 0),(0,k._)(this,"errorApi",void 0),this.alertApi=t,this.errorApi=o}}class Oe{post(t,o){this.subject.next({error:t,context:o})}error$(){return this.subject}constructor(){(0,k._)(this,"subject",new et)}}class tt{static forward(t,o){window.addEventListener("unhandledrejection",a=>{t.post(a.reason,o)})}}function nt(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 mt{registerFlag(t){nt(t.name),this.registeredFeatureFlags.push(t)}getRegisteredFlags(){return this.registeredFeatureFlags.slice()}isActive(t){return this.flags||(this.flags=this.load()),this.flags.get(t)===m.CL.Active}save(t){this.flags||(this.flags=this.load()),t.merge||this.flags.clear();for(const[a,c]of Object.entries(t.states))this.flags.set(a,c);const o=Array.from(this.flags.entries()).filter(([,a])=>a===m.CL.Active);window.localStorage.setItem("featureFlags",JSON.stringify(Object.fromEntries(o)))}load(){try{const t=window.localStorage.getItem("featureFlags");if(!t)return new Map;const o=JSON.parse(t);if(typeof o!="object"||o===null||Array.isArray(o))return new Map;const a=Object.entries(o).filter(([c,x])=>(nt(c),x===m.CL.Active));return new Map(a)}catch{return new Map}}constructor(){(0,k._)(this,"registeredFeatureFlags",[]),(0,k._)(this,"flags",void 0)}}function xt(i){let t=i.baseImplementation||n.g.fetch;var o;const a=[(o=i.middleware)!==null&&o!==void 0?o:[]].flat().reverse();for(const c of a)t=c.apply(t);return{fetch:t}}class it{static create(t){var o,a;const c=$e(t),x=((o=t.header)===null||o===void 0?void 0:o.name)||"authorization",O=((a=t.header)===null||a===void 0?void 0:a.value)||(N=>`Bearer ${N}`);return new it(t.identityApi,c,x,O)}apply(t){return async(o,a)=>{const c=new Request(o,a),{token:x}=await this.identityApi.getCredentials();return c.headers.get(this.headerName)||typeof x!="string"||!x||!this.allowUrl(c.url)?t(o,a):(c.headers.set(this.headerName,this.headerValue(x)),t(c))}}constructor(t,o,a,c){(0,k._)(this,"identityApi",void 0),(0,k._)(this,"allowUrl",void 0),(0,k._)(this,"headerName",void 0),(0,k._)(this,"headerValue",void 0),this.identityApi=t,this.allowUrl=o,this.headerName=a,this.headerValue=c}}function $e(i){return i.allowUrl?i.allowUrl:i.urlPrefixAllowlist?vt(i.urlPrefixAllowlist):i.config?vt([i.config.getString("backend.baseUrl")]):()=>!1}function vt(i){const t=i.map(o=>o.replace(/\/$/,""));return o=>t.some(a=>o===a||o.startsWith(`${a}/`))}function Xt(i,t){return!t||t==="/"?i:`${i.replace(/\/$/,"")}/${t.replace(/^\//,"")}`}class Et{apply(t){return async(o,a)=>{const c=new Request(o,a),x="plugin://";if(!c.url.startsWith(x))return t(o,a);const{hostname:O,pathname:N,search:J,hash:fe,username:Ne,password:je}=new URL(`http://${c.url.substring(x.length)}`);let ke=await this.discoveryApi.getBaseUrl(O);if(Ne||je){const Ke=new URL(ke),At=`${Ne}${je?`:${je}`:""}@`;ke=`${Ke.protocol}//${At}${Ke.host}${Ke.pathname}`}const Fe=`${Xt(ke,N)}${J}${fe}`;return t(Fe,typeof o=="string"||Zt(o)?a:o)}}constructor(t){(0,k._)(this,"discoveryApi",void 0),this.discoveryApi=t}}function Zt(i){var t;return typeof i=="object"&&((t=i)===null||t===void 0?void 0:t.constructor)===URL}class _t{static resolvePluginProtocol(t){return new Et(t.discoveryApi)}static injectIdentityAuth(t){return it.create(t)}constructor(){}}function wn(i,t){for(const o of t)if(!i.has(o))return!1;return!0}function Kt(i,...t){const o=new Set(i);for(const a of t)for(const c of a)o.add(c);return o}class bt{request(t){return new Promise((o,a)=>{this.requests.push({scopes:t,resolve:o,reject:a}),this.subject.next(this.getCurrentPending())})}resolve(t,o){this.requests=this.requests.filter(a=>wn(t,a.scopes)?(a.resolve(o),!1):!0),this.subject.next(this.getCurrentPending())}reject(t){this.requests.forEach(o=>o.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((o,a)=>Kt(o,a.scopes),this.requests[0].scopes);return{scopes:t,resolve:o=>{t&&this.resolve(t,o)},reject:o=>{t&&this.reject(o)}}}constructor(){(0,k._)(this,"requests",[]),(0,k._)(this,"subject",new Tt(this.getCurrentPending()))}}class It{createAuthRequester(t){const o=new bt,a=this.handlerCount;return this.handlerCount++,o.pending().subscribe({next:c=>{const x=this.currentRequests.slice(),O=this.makeAuthRequest(c,t);O?x[a]=O:delete x[a],this.currentRequests=x,this.subject.next(x.filter(Boolean))}}),c=>o.request(c)}makeAuthRequest(t,o){const{scopes:a}=t;if(a)return{provider:o.provider,trigger:async()=>{const c=await o.onAuthRequest(a);t.resolve(c)},reject:()=>{const c=new Error("Login failed, rejected by user");c.name="RejectedError",t.reject(c)}}}authRequest$(){return this.subject}constructor(){(0,k._)(this,"subject",new Tt([])),(0,k._)(this,"currentRequests",[]),(0,k._)(this,"handlerCount",0)}}const Yt=new Map;class zt{static create(t){var o;return new zt((o=t.namespace)!==null&&o!==void 0?o:"",t.errorApi)}static addStorageEventListener(){window.addEventListener("storage",t=>{for(const[a,c]of Yt.entries()){var o;!((o=t.key)===null||o===void 0)&&o.startsWith(a)&&c.handleStorageChange(t.key)}})}get(t){return this.snapshot(t).value}snapshot(t){let o,a="absent";try{const c=localStorage.getItem(this.getKeyName(t));c&&(o=JSON.parse(c,(x,O)=>(typeof O=="object"&&O!==null&&Object.freeze(O),O)),a="present")}catch{this.errorApi.post(new Error(`Error when parsing JSON config from storage for: ${t}`))}return{key:t,value:o,presence:a}}forBucket(t){const o=`${this.namespace}/${t}`;return Yt.has(o)||Yt.set(o,new zt(o,this.errorApi)),Yt.get(o)}async set(t,o){localStorage.setItem(this.getKeyName(t),JSON.stringify(o)),this.notifyChanges(t)}async remove(t){localStorage.removeItem(this.getKeyName(t)),this.notifyChanges(t)}observe$(t){return zt.hasSubscribed||(zt.addStorageEventListener(),zt.hasSubscribed=!0),this.observable.filter(({key:o})=>o===t)}handleStorageChange(t){var o,a;if(!(!((o=t)===null||o===void 0)&&o.startsWith(this.namespace)))return;const c=(a=t)===null||a===void 0?void 0:a.slice(`${this.namespace}/`.length);c.includes("/")||this.notifyChanges(decodeURIComponent(c))}getKeyName(t){return`${this.namespace}/${encodeURIComponent(t)}`}notifyChanges(t){const o=this.snapshot(t);for(const a of this.subscribers)a.next(o)}constructor(t,o){(0,k._)(this,"namespace",void 0),(0,k._)(this,"errorApi",void 0),(0,k._)(this,"subscribers",void 0),(0,k._)(this,"observable",void 0),this.namespace=t,this.errorApi=o,this.subscribers=new Set,this.observable=new(Be())(a=>(this.subscribers.add(a),()=>{this.subscribers.delete(a)}))}}(0,k._)(zt,"hasSubscribed",!1);const gr=(0,V.createContext)(void 0);function er(){const[i]=(0,H.is)((0,p.jsx)(H.AW,{index:!0,element:(0,p.jsx)("div",{})}));return!i.index}var ir=n(84800);const bn=(i,t)=>{try{var o,a,c,x;const N=(o=(0,ir.fp)(t,{pathname:i}))===null||o===void 0?void 0:o.filter(ke=>{var Fe,Ke;return((Ke=ke)===null||Ke===void 0||(Fe=Ke.route.routeRefs)===null||Fe===void 0?void 0:Fe.size)>0}).pop(),J=(a=N)===null||a===void 0?void 0:a.route;if(!J||J.path===""&&i!=="/")return;let fe;J.routeRefs.size===1&&(fe=J.routeRefs.values().next().value);let Ne;J.plugins.size===1&&(Ne=J.plugins.values().next().value);const je=Object.entries(((c=N)===null||c===void 0?void 0:c.params)||{}).reduce((ke,[Fe,Ke])=>(Ke!==void 0&&Fe!=="*"&&(ke[Fe]=Ke),ke),{});return{extension:"App",pluginId:((x=Ne)===null||x===void 0?void 0:x.getId())||"root",...fe?{routeRef:fe.id}:{},_routeNodeType:J.element,params:je}}catch{return}},ar=({pathname:i,search:t,hash:o,attributes:a})=>{const c=(0,m.z$)();return(0,V.useEffect)(()=>{c.captureEvent("navigate",`${i}${t}${o}`,{attributes:a})},[c,i,t,o,a]),null},Kn=({routeObjects:i})=>{const{pathname:t,search:o,hash:a}=(0,H.TH)(),{params:c,...x}=bn(t,i)||{params:{}};return(0,p.jsx)(m.fC,{attributes:x,children:(0,p.jsx)(ar,{pathname:t,search:o,hash:a,attributes:c})})};function zr(i){return er()?tr(i):""}function tr(i){var t;let{pathname:o}=new URL((t=i.getOptionalString("app.baseUrl"))!==null&&t!==void 0?t:"/","http://sample.dev");return o=o.replace(/\/*$/,""),o}function Gr({component:i,appIdentityProxy:t,children:o}){const[a,c]=(0,V.useState)(),x=(0,m.h_)(m.Ds),O=zr(x);return a?(t.setTarget(a,{signOutTargetUrl:O||"/"}),(0,p.jsx)(p.Fragment,{children:o})):(0,p.jsx)(i,{onSignInSuccess:c})}function Or(i){const{Router:t,SignInPage:o}=(0,m.qD)().getComponents(),a=(0,m.h_)(m.Ds),c=tr(a),x=`${c}/*`,O=(0,V.useContext)(gr);if(!O)throw new Error("AppRouter must be rendered within the AppProvider");const{routeObjects:N,appIdentityProxy:J}=O;return o?er()?(0,p.jsxs)(t,{children:[(0,p.jsx)(Kn,{routeObjects:N}),(0,p.jsx)(Gr,{component:o,appIdentityProxy:J,children:(0,p.jsx)(H.Z5,{children:(0,p.jsx)(H.AW,{path:x,element:(0,p.jsx)(p.Fragment,{children:i.children})})})})]}):(0,p.jsxs)(t,{basename:c,children:[(0,p.jsx)(Kn,{routeObjects:N}),(0,p.jsx)(Gr,{component:o,appIdentityProxy:J,children:i.children})]}):(J.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:c||"/"}),er()?(0,p.jsxs)(t,{children:[(0,p.jsx)(Kn,{routeObjects:N}),(0,p.jsx)(H.Z5,{children:(0,p.jsx)(H.AW,{path:x,element:(0,p.jsx)(p.Fragment,{children:i.children})})})]}):(0,p.jsxs)(t,{basename:c,children:[(0,p.jsx)(Kn,{routeObjects:N}),i.children]}))}var S=n(88412),d=n(50629),C=n(80956),A=n(64279),K=n(98527);function ye(i){const t={};for(const a in i.collectors)i.collectors.hasOwnProperty(a)&&(t[a]=i.collectors[a]());const o=[{node:V.Children.toArray(i.root),parent:void 0,contexts:{}}];for(;o.length!==0;){const{node:a,parent:c,contexts:x}=o.shift();V.Children.forEach(a,O=>{if(!(0,V.isValidElement)(O))return;const N={};for(const J in t)if(t.hasOwnProperty(J)){const fe=t[J];N[J]=fe.visit(fe.accumulator,O,c,x[J])}for(const J of i.discoverers){const fe=J(O);fe&&o.push({node:fe,parent:O,contexts:N})}})}return Object.fromEntries(Object.entries(t).map(([a,c])=>[a,c.accumulator]))}function we(i,t){return()=>({accumulator:i(),visit:t})}function Ze(i){var t;return(t=i.props)===null||t===void 0?void 0:t.children}function qe(i){var t,o;if(!((t=i.props)===null||t===void 0)&&t.path&&(!((o=i.props)===null||o===void 0)&&o.element)){var a;return(a=i.props)===null||a===void 0?void 0:a.element}}const Jt=we(()=>new Set,(i,t)=>{const o=(0,m.IY)(t,"core.plugin");o&&i.add(o)}),cn=i=>{const{children:t}=i,o=(0,m.h_)(m.W0),a="with"in i?o.isActive(i.with):!o.isActive(i.without);return(0,p.jsx)(p.Fragment,{children:a?t:null})};(0,m.R5)(cn,"core.featureFlagged",!0);const pn={caseSensitive:!1,path:"*",element:"match-all",routeRefs:new Set,plugins:new Set};function In(i){var t;const o=i;if(!((t=o)===null||t===void 0)&&t.type){var a,c;return(c=(a=o.type.displayName)!==null&&a!==void 0?a:o.type.name)!==null&&c!==void 0?c:String(o.type)}return String(o)}const Wt=i=>{const t=new Set;return i&&t.add(i),t};function un(i,t=new Array){return V.Children.forEach(i,o=>{if(!(0,V.isValidElement)(o))return;const a=(0,m.IY)(o,"core.mountPoint");if(a){const c=(0,m.IY)(o,"core.plugin");t.push({routeRef:a,plugin:c})}un(o.props.children,t)}),t}const lr=we(()=>({paths:new Map,parents:new Map,objects:new Array}),(i,t,o,a)=>{var c,x,O,N,J;if(!((c=a)===null||c===void 0)&&c.isElementAncestor)return a;if(((x=o)===null||x===void 0?void 0:x.props.element)===t)return{...a,isElementAncestor:!0};const fe=(O=t.props)===null||O===void 0?void 0:O.path,Ne=(0,m.IY)(t,"core.mountPoint");if(Ne&&fe)throw new Error(`Path property may not be set directly on a routable extension "${In(t)}"`);var je;const ke=(je=(J=a)===null||J===void 0||(N=J.obj)===null||N===void 0?void 0:N.children)!==null&&je!==void 0?je:i.objects;if(fe!==void 0){if(typeof fe!="string")throw new Error(`Element path must be a string at "${In(t)}"`);const An=fe.startsWith("/")?fe.slice(1):fe,Xr=t.props.element;if((0,m.IY)(t,"core.gatherMountPoints")){var Fe,Ke,At;if(Xr)throw new Error(`Mount point gatherers may not have an element prop "${In(t)}"`);const So={path:An,element:"gathered",routeRefs:new Set,caseSensitive:Boolean((Fe=t.props)===null||Fe===void 0?void 0:Fe.caseSensitive),children:[pn],plugins:new Set};return ke.push(So),{obj:So,gatherPath:An,routeRef:(Ke=a)===null||Ke===void 0?void 0:Ke.routeRef,gatherRouteRef:(At=a)===null||At===void 0?void 0:At.routeRef}}if(Xr){var kt,Ln,dr,br;const[So,...Aa]=un(Xr);if(Aa.length>0)throw new Error(`Route element with path "${fe}" may not contain multiple routable extensions`);if(!So)return a;const{routeRef:co,plugin:Ta}=So,ai={path:An,element:"mounted",routeRefs:new Set([co]),caseSensitive:Boolean((kt=t.props)===null||kt===void 0?void 0:kt.caseSensitive),children:[pn],plugins:Wt(Ta)};return ke.push(ai),i.paths.set(co,An),i.parents.set(co,(Ln=a)===null||Ln===void 0?void 0:Ln.routeRef),{obj:ai,routeRef:co!=null?co:(dr=a)===null||dr===void 0?void 0:dr.routeRef,gatherPath:An,gatherRouteRef:(br=a)===null||br===void 0?void 0:br.gatherRouteRef}}}if(Ne){var Rr,Sr,Nn,Nr;if(((Rr=a)===null||Rr===void 0?void 0:Rr.gatherPath)===void 0)throw new Error(`Routable extension "${In(t)}" with mount point "${Ne}" must be assigned a path`);(Nn=a)===null||Nn===void 0||(Sr=Nn.obj)===null||Sr===void 0||Sr.routeRefs.add(Ne);const An=(0,m.IY)(t,"core.plugin");if(An){var Hr,Ir;(Ir=a)===null||Ir===void 0||(Hr=Ir.obj)===null||Hr===void 0||Hr.plugins.add(An)}return i.paths.set(Ne,a.gatherPath),i.parents.set(Ne,(Nr=a)===null||Nr===void 0?void 0:Nr.gatherRouteRef),{...a,routeRef:Ne}}return a}),cr=we(()=>({paths:new Map,parents:new Map,objects:new Array}),(i,t,o,a)=>{var c,x,O,N,J,fe,Ne,je,ke;if(((c=o)===null||c===void 0?void 0:c.props.element)===t)return a;let Fe=(x=a)===null||x===void 0?void 0:x.obj,Ke=(O=a)===null||O===void 0?void 0:O.routeRef,At=(N=a)===null||N===void 0?void 0:N.sticky;const kt=(J=t.props)===null||J===void 0?void 0:J.path;var Ln;const dr=(Ln=(fe=Fe)===null||fe===void 0?void 0:fe.children)!==null&&Ln!==void 0?Ln:i.objects,br=Boolean((Ne=t.props)===null||Ne===void 0?void 0:Ne.caseSensitive);let Rr=(je=a)===null||je===void 0?void 0:je.path;if((0,m.IY)(t,"core.gatherMountPoints")){if(!kt)throw new Error("Mount point gatherer must have a path");Rr=kt}const Sr=(ke=t.props)===null||ke===void 0?void 0:ke.element;let Nn=(0,m.IY)(t,"core.mountPoint");if(!Nn&&(0,V.isValidElement)(Sr)&&(Nn=(0,m.IY)(Sr,"core.mountPoint")),Nn){let Xr=kt;if(Rr&&(Xr?Rr=void 0:Xr=Rr),!Xr)throw new Error("Mounted routable extension must have a path");if(i.paths.set(Nn,Xr),Ke&&At?(i.parents.set(Nn,Ke),kt&&(Ke=Nn,At=!1)):(i.parents.set(Nn,Ke),Ke=Nn),kt)Fe={caseSensitive:br,path:kt,element:"mounted",routeRefs:new Set([Nn]),children:[pn],plugins:Wt((0,m.IY)(t.props.element,"core.plugin"))},dr.push(Fe);else{var Nr;(Nr=Fe)===null||Nr===void 0||Nr.routeRefs.add(Nn)}}if((0,m.IY)(t,"core.gatherMountPoints")&&(At=!0),(0,m.IY)(t,"core.gatherMountPoints")){if(!kt)throw new Error("Mount point gatherer must have a path");if(!Nn){var Ir,An;Fe={caseSensitive:br,path:kt,element:"gathered",routeRefs:new Set,children:[pn],plugins:((An=a)===null||An===void 0||(Ir=An.obj)===null||Ir===void 0?void 0:Ir.plugins)||new Set},dr.push(Fe)}}return{obj:Fe,path:Rr,routeRef:Ke,sticky:At}}),wr=we(()=>new Set,(i,t)=>{if(t.type===cn){const o=t.props;i.add("with"in o?o.with:o.without)}}),Yn=(0,ht.uW)("route-ref-type",()=>Symbol("route-ref-type"));function jo(i){return i[Yn]==="absolute"}function Vo(i){return i[Yn]==="sub"}function Ho(i){return i[Yn]==="external"}function _r(...i){const t=i.join("/").replace(/\/\/+/g,"/");return t!=="/"&&t.endsWith("/")?t.slice(0,-1):t}function kr(i,t,o){let a,c="";if(jo(i))a=i;else if(Vo(i))a=i.parent,c=i.path;else if(Ho(i)){const N=o.get(i);if(!N)return[void 0,""];if(jo(N))a=N;else if(Vo(N))a=N.parent,c=N.path;else throw new Error(`ExternalRouteRef was bound to invalid target, ${N}`)}else throw i[Yn]?new Error(`Unknown or invalid route ref type, ${i[Yn]}`):new Error(`Unknown object passed to useRouteRef, got ${i}`);if(!a)return[void 0,""];const x=t.get(a);if(x===void 0)return[void 0,""];const O=_r(x,c);return[a,O]}function mr(i,t,o,a,c){var x;const O=(x=(0,ir.fp)(c,t))!==null&&x!==void 0?x:[],N=Array();let J=-1;for(let je=i;je&&(J=O.findIndex(ke=>ke.route.routeRefs.has(je)),J===-1);je=a.get(je))N.unshift(je);N.length===0&&(J-=1);const fe=J===-1?"":O[J].pathname,Ne=N.slice(0,-1).map(je=>{const ke=o.get(je);if(ke===void 0)throw new Error(`No path for ${je}`);if(ke.includes(":"))throw new Error(`Cannot route to ${i} with parent ${je} as it has parameters`);return ke});return`${_r(fe,...Ne)}/`}class Kr{resolve(t,o){const[a,c]=kr(t,this.routePaths,this.routeBindings);if(!a)return;let x;typeof o=="string"?x=this.trimPath(o):o.pathname?x={...o,pathname:this.trimPath(o.pathname)}:x=o;const O=this.appBasePath+mr(a,x,this.routePaths,this.routeParents,this.routeObjects);return(...[J])=>_r(O,(0,ir.Gn)(c,J))}trimPath(t){return t&&(t.startsWith(this.appBasePath)?t.slice(this.appBasePath.length):t)}constructor(t,o,a,c,x){(0,k._)(this,"routePaths",void 0),(0,k._)(this,"routeParents",void 0),(0,k._)(this,"routeObjects",void 0),(0,k._)(this,"routeBindings",void 0),(0,k._)(this,"appBasePath",void 0),this.routePaths=t,this.routeParents=o,this.routeObjects=a,this.routeBindings=c,this.appBasePath=x}}const eo=(0,ht.CT)("routing-context"),Eo=({routePaths:i,routeParents:t,routeObjects:o,routeBindings:a,basePath:c="",children:x})=>{const O=new Kr(i,t,o,a,c),N=(0,ht.EI)({1:O});return(0,p.jsx)(eo.Provider,{value:N,children:x})};function Go(i,t){const o=new Set(t.values());o.delete(void 0);for(const a of t.keys()){if(o.has(a))continue;let c=a,x="";for(;c;){const N=i.get(c);if(N===void 0)throw new Error(`No path for ${c}`);x=_r(N,x),c=t.get(c)}const O=x.match(/:(\w+)/g);if(O){for(let N=0;N<O.length;N++)for(let J=N+1;J<O.length;J++)if(O[J]===O[N])throw new Error(`Parameter ${O[J]} is duplicated in path ${x}`)}}}function to(i,t){for(const o of t)if(o.externalRoutes){for(const[a,c]of Object.entries(o.externalRoutes))if(!c.optional&&!i.has(c))throw new Error(`External route '${a}' of the '${o.getId()}' plugin must be bound to a target route. See https://backstage.io/link?bind-routes for details.`)}}const Ko=(0,ht.CT)("app-context"),Ao=({appContext:i,children:t})=>{const o=(0,ht.EI)({1:i});return(0,p.jsx)(Ko.Provider,{value:o,children:t})};function Pn(i){return new Error(`Tried to access IdentityApi ${i} before app was loaded`)}function nr(i){console.warn(`WARNING: Call to ${i} is deprecated and will break in the future`)}class no{setTarget(t,o){this.target=t,this.signOutTargetUrl=o.signOutTargetUrl,this.resolveTarget(t)}getUserId(){if(!this.target)throw Pn("getUserId");if(!this.target.getUserId)throw new Error("IdentityApi does not implement getUserId");return nr("getUserId"),this.target.getUserId()}getProfile(){if(!this.target)throw Pn("getProfile");if(!this.target.getProfile)throw new Error("IdentityApi does not implement getProfile");return nr("getProfile"),this.target.getProfile()}async getProfileInfo(){return this.waitForTarget.then(t=>t.getProfileInfo())}async getBackstageIdentity(){const t=await this.waitForTarget.then(o=>o.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 nr("getIdToken"),t.getIdToken()})}async signOut(){await this.waitForTarget.then(t=>t.signOut()),window.location.href=this.signOutTargetUrl}constructor(){(0,k._)(this,"target",void 0),(0,k._)(this,"waitForTarget",void 0),(0,k._)(this,"resolveTarget",()=>{}),(0,k._)(this,"signOutTargetUrl","/"),this.waitForTarget=new Promise(t=>{this.resolveTarget=t})}}var ro=n(72164);function Yo(i,t,o){if(i!==void 0){const c=o.find(x=>x.id===i);if(c)return c}if(t){const c=o.find(x=>x.variant==="dark");if(c)return c}const a=o.find(c=>c.variant==="light");return a||o[0]}const fo=()=>{const i=(0,V.useMemo)(()=>window.matchMedia("(prefers-color-scheme: dark)"),[]),[t,o]=(0,V.useState)(i.matches);return(0,V.useEffect)(()=>{const a=c=>{o(c.matches)};return i.addListener(a),()=>{i.removeListener(a)}},[i]),t};function go({children:i}){const t=(0,m.h_)(m.hg),o=(0,ro.Z)(t.activeThemeId$(),t.getActiveThemeId()),a=Boolean(window.matchMedia)?fo():!1,c=Yo(o,a,t.getInstalledThemes());if(!c)throw new Error("App has no themes");return(0,p.jsx)(c.Provider,{children:i})}const To=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 o=t.slice();if(i!=="__app_injected_runtime_config__".toLocaleUpperCase("en-US"))try{const c=JSON.parse(i);Array.isArray(c)?o.push(...c):o.push({data:c,context:"env"})}catch(c){throw new Error(`Failed to load runtime configuration, ${c}`)}const a=window.__APP_CONFIG__;return a&&o.push({context:"window",data:a}),o};class Ro{add(t,o){return this.apis.push([t.id,o]),o}build(){return new rr(new Map(this.apis))}constructor(){(0,k._)(this,"apis",[])}}class rr{static builder(){return new Ro}static from(t){return new rr(new Map(t.map(([o,a])=>[o.id,a])))}static with(t,o){return new rr(new Map([[t.id,o]]))}with(t,o){return new rr(new Map([...this.apis,[t.id,o]]))}get(t){return this.apis.get(t.id)}constructor(t){(0,k._)(this,"apis",void 0),this.apis=t}}function js(i){const t=new Map;return i&&i({bind:(a,c)=>{for(const[x,O]of Object.entries(c)){const N=a[x];if(!N)throw new Error(`Key ${x} is not an existing external route`);if(!O&&!N.optional)throw new Error(`External route ${x} is required but was undefined`);O&&t.set(N,O)}}}),t}var Io=n(68588);function mo({children:i}){const o=(0,m.h_)(K.vP).getI18n();return(0,p.jsx)(Io.a3,{i18n:o,children:i})}var Jo=n(24991),Es=n(42754);class vo{static create(t){var o,a;const c=Jo.ZP.createInstance().use(Io.Db);return c.use(Es.Z),c.init({fallbackLng:((o=t)===null||o===void 0?void 0:o.fallbackLanguage)||"en",supportedLngs:((a=t)===null||a===void 0?void 0:a.supportedLanguages)||["en"],interpolation:{escapeValue:!1},react:{bindI18n:"loaded languageChanged"}}),new vo(c,t)}getI18n(){return this.i18n}initMessages(t){var o,a;!((a=t)===null||a===void 0||(o=a.messages)===null||o===void 0)&&o.length&&t.messages.forEach(c=>{c.messages&&this.addResources(c.ref,c.messages),c.lazyMessages&&this.addLazyResources(c.ref,c.lazyMessages)})}addResourcesByRef(t){this.addResources(t),this.addLazyResources(t)}addResources(t,o){const a=o||t.getResources();!a||this.cache.has(t)||(this.cache.add(t),Object.entries(a).forEach(([c,x])=>{this.i18n.addResourceBundle(c,t.getId(),x,!0,!1)}))}addLazyResources(t,o){let a=this.lazyCache.get(t);a||(a=new Set,this.lazyCache.set(t,a));const{language:c,services:x,options:O,addResourceBundle:N,reloadResources:J}=this.i18n;if(a.has(c))return;const fe=t.getId(),Ne=o||t.getLazyResources(),je=x.languageUtils.getFallbackCodes(O.fallbackLng,c);Promise.allSettled([...je,c].map(ke)).then(Fe=>{Fe.some(Ke=>Ke.status==="fulfilled")&&this.i18n.emit("loaded")});async function ke(Fe){var Ke,At;if(a.has(Fe))return;a.add(Fe);let kt;!((Ke=x.backendConnector)===null||Ke===void 0)&&Ke.backend&&(kt=J([Fe],[fe]));const Ln=(At=Ne)===null||At===void 0?void 0:At[Fe];if(!Ln){await kt;return}const[dr]=await Promise.allSettled([Ln(),kt]);if(dr.status==="rejected")throw dr.reason;N(Fe,fe,dr.value.messages,!0,!1)}}constructor(t,o){(0,k._)(this,"i18n",void 0),(0,k._)(this,"cache",void 0),(0,k._)(this,"lazyCache",void 0),this.i18n=t,this.cache=new WeakSet,this.lazyCache=new WeakMap,this.initMessages(o)}}function Qo(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 As(i,t,o){var a;const c=Boolean(i),x=(0,A.default)(i||(()=>Promise.resolve([])));let O;if(c&&x.loading){const{Progress:fe}=t;O=(0,p.jsx)(fe,{})}else if(x.error){const{BootErrorPage:fe}=t;O=(0,p.jsx)(fe,{step:"load-config",error:x.error})}const{ThemeProvider:N=go}=t;if(O)return{node:(0,p.jsx)(Ut,{apis:rr.with(m.hg,o),children:(0,p.jsx)(N,{children:O})})};let J;if(!((a=x.value)===null||a===void 0)&&a.length){const fe=M.fromConfigs(x.value),Ne=fe.getOptionalString("app.baseUrl"),je=fe.getOptionalString("backend.baseUrl");let ke=x.value;const Fe={data:{},context:"relative-resolver"};if(Ne&&je){const Ke=new URL(Ne).origin,At=new URL(je).origin;if(Ke===At){const kt=Qo(je);je!==kt&&(Fe.data.backend={baseUrl:kt})}}if(Ne){const Ke=Qo(Ne);Ne!==Ke&&(Fe.data.app={baseUrl:Ke})}Object.keys(Fe.data).length&&(ke=ke.concat([Fe])),J=M.fromConfigs(ke)}else J=M.fromConfigs([]);return{api:J}}class Xo{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,k._)(this,"app",void 0),this.app=t}}var yo=new WeakMap;class oo{getPlugins(){return Array.from(this.plugins)}getSystemIcon(t){return this.icons[t]}getSystemIcons(){return this.icons}getComponents(){return this.components}createRoot(t){const o=this.getProvider();return()=>(0,p.jsx)(o,{children:t})}getProvider(){if((0,S._)(this,yo))throw new Error("app.getProvider() or app.createRoot() has already been called, and can only be called once");(0,C._)(this,yo,!0);const t=new Xo(this);let o=!1;return({children:c})=>{const x=(0,V.useRef)(!0),O=(0,V.useMemo)(()=>ct.createWithStorage(this.themes),[]),{routing:N,featureFlags:J,routeBindings:fe}=(0,V.useMemo)(()=>{const Fe=ye({root:c,discoverers:[Ze,qe],collectors:{routing:er()?cr:lr,collectedPlugins:Jt,featureFlags:wr}});return Fe.collectedPlugins.forEach(Ke=>this.plugins.add(Ke)),this.verifyPlugins(this.plugins),this.getApiHolder(),{...Fe,routeBindings:js(this.bindRoutes)}},[c]);o||(o=!0,Go(N.paths,N.parents),to(fe,this.plugins));const Ne=As(this.configLoader,this.components,O),je="api"in Ne;if(je){const{api:Fe}=Ne;this.configApi=Fe}if("node"in Ne)return Ne.node;if(je&&x.current){x.current=!1;const Fe=this.getApiHolder().get(m.W0);if(Fe){for(const kt of this.featureFlags)Fe.registerFlag({...kt,pluginId:""});for(const kt of this.plugins.values())if("getFeatureFlags"in kt)for(const Ln of kt.getFeatureFlags())Fe.registerFlag({name:Ln.name,pluginId:kt.getId()});else for(const Ln of kt.output())Ln.type==="feature-flag"&&Fe.registerFlag({name:Ln.name,pluginId:kt.getId()});const Ke=Fe.getRegisteredFlags(),At=new Set(Ke.map(kt=>kt.name));for(const kt of J)At.has(kt)||Fe.registerFlag({name:kt,pluginId:""})}}const{ThemeProvider:ke=go}=this.components;return(0,p.jsx)(Ut,{apis:this.getApiHolder(),children:(0,p.jsx)(Ao,{appContext:t,children:(0,p.jsx)(mo,{children:(0,p.jsx)(ke,{children:(0,p.jsx)(Eo,{routePaths:N.paths,routeParents:N.parents,routeObjects:N.objects,routeBindings:fe,basePath:zr(Ne.api),children:(0,p.jsx)(gr.Provider,{value:{routeObjects:N.objects,appIdentityProxy:this.appIdentityProxy},children:c})})})})})})}}getRouter(){return Or}getApiHolder(){if(this.apiHolder){for(const t of this.plugins)for(const o of t.getApis())this.apiFactoryRegistry.get(o.api)||this.apiFactoryRegistry.register("default",o);return Bt.validateFactories(this.apiFactoryRegistry,this.apiFactoryRegistry.getAllApis()),this.apiHolder}this.apiFactoryRegistry.register("static",{api:m.hg,deps:{},factory:()=>ct.createWithStorage(this.themes)}),this.apiFactoryRegistry.register("static",{api:m.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:m.$4,deps:{},factory:()=>this.appIdentityProxy}),this.apiFactoryRegistry.register("static",{api:K.vP,deps:{},factory:()=>this.appTranslationApi}),this.apiFactoryRegistry.register("default",{api:m.W0,deps:{},factory:()=>new mt});for(const t of this.defaultApis)this.apiFactoryRegistry.register("default",t);for(const t of this.plugins)for(const o of t.getApis())if(!this.apiFactoryRegistry.register("default",o))throw new Error(`Plugin ${t.getId()} tried to register duplicate or forbidden API factory for ${o.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 o=new Set;for(const a of t){const c=a.getId();if(o.has(c))throw new Error(`Duplicate plugin found '${c}'`);o.add(c)}}constructor(t){(0,k._)(this,"apiHolder",void 0),(0,k._)(this,"configApi",void 0),(0,k._)(this,"apis",void 0),(0,k._)(this,"icons",void 0),(0,k._)(this,"plugins",void 0),(0,k._)(this,"featureFlags",void 0),(0,k._)(this,"components",void 0),(0,k._)(this,"themes",void 0),(0,k._)(this,"configLoader",void 0),(0,k._)(this,"defaultApis",void 0),(0,k._)(this,"bindRoutes",void 0),(0,k._)(this,"appTranslationApi",void 0),(0,k._)(this,"appIdentityProxy",new no),(0,k._)(this,"apiFactoryRegistry",void 0),(0,d._)(this,yo,{writable:!0,value:!1});var o;this.apis=(o=t.apis)!==null&&o!==void 0?o:[],this.icons=t.icons;var a;this.plugins=new Set((a=t.plugins)!==null&&a!==void 0?a:[]);var c;this.featureFlags=(c=t.featureFlags)!==null&&c!==void 0?c:[],this.components=t.components,this.themes=t.themes;var x;this.configLoader=(x=t.configLoader)!==null&&x!==void 0?x:To;var O;this.defaultApis=(O=t.defaultApis)!==null&&O!==void 0?O:[],this.bindRoutes=t.bindRoutes,this.apiFactoryRegistry=new _e,this.appTranslationApi=vo.create(t.__experimentalI18n)}}function Yr(i){return new oo(i)}let Wr=!1;const Jr=i=>{const t=(0,m.qD)(),{NotFoundErrorPage:o}=t.getComponents(),a=(0,V.useMemo)(()=>er(),[]),x=[...(0,m.vJ)(i.children,O=>O.getElements().flatMap(N=>{var J;let fe=N.props.path;if(fe==="")return[];var Ne;fe=(Ne=(J=fe)===null||J===void 0?void 0:J.replace(/\/\*$/,""))!==null&&Ne!==void 0?Ne:"/";let je=a?N:N.props.element;return!a&&!je&&(je=N,Wr||(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] />} />."),Wr=!0)),[{path:fe,element:je,children:N.props.children?[{path:fe==="/"?"/":"*",element:N.props.children}]:void 0}]}).sort((N,J)=>J.path.localeCompare(N.path)).map(N=>({...N,path:N.path==="/"?"/":`${N.path}/*`}))),{path:"*",element:(0,p.jsx)(o,{})}];return(0,H.V$)(x)},Po=(0,m.T0)({id:"plugin.permission.api"});var xn;(function(i){i.DENY="DENY",i.ALLOW="ALLOW",i.CONDITIONAL="CONDITIONAL"})(xn||(xn={}));function Lo(i,t){return i.name===t.name}function qo(i,t){return"resourceType"in i?!t||i.resourceType===t:!1}function di(i){return i.attributes.action==="create"}function Ts(i){return i.attributes.action==="read"}function Rs(i){return i.attributes.action==="update"}function ui(i){return i.attributes.action==="delete"}function Is(i){return{authorize:async(t,o)=>await i.authorize(t,o),authorizeConditional(t,o){const a=t;return i.authorize(a,o)}}}function Br({name:i,attributes:t,resourceType:o}){return o?{type:"resource",name:i,attributes:t,resourceType:o}:{type:"basic",name:i,attributes:t}}var _o=n(96279),Oo=n.n(_o),xo=n(9571);const so=ot.z.lazy(()=>ot.z.object({rule:ot.z.string(),resourceType:ot.z.string(),params:ot.z.record(ot.z.any()).optional()}).or(ot.z.object({anyOf:ot.z.array(so).nonempty()})).or(ot.z.object({allOf:ot.z.array(so).nonempty()})).or(ot.z.object({not:so}))),Ps=ot.z.object({result:ot.z.literal(xn.ALLOW).or(ot.z.literal(xn.DENY))}),es=ot.z.union([ot.z.object({result:ot.z.literal(xn.ALLOW).or(ot.z.literal(xn.DENY))}),ot.z.object({result:ot.z.literal(xn.CONDITIONAL),pluginId:ot.z.string(),resourceType:ot.z.string(),conditions:so})]),ts=(i,t)=>ot.z.object({items:ot.z.array(ot.z.intersection(ot.z.object({id:ot.z.string()}),i)).refine(o=>o.length===t.size&&o.every(({id:a})=>t.has(a)),{message:"Items in response do not match request"})});class ns{async authorize(t,o){return this.makeRequest(t,Ps,o)}async authorizeConditional(t,o){return this.makeRequest(t,es,o)}async makeRequest(t,o,a){var c;if(!this.enabled)return t.map(je=>({result:xn.ALLOW}));const x={items:t.map(je=>({id:xo.Z(),...je}))},O=await this.discovery.getBaseUrl("permission"),N=await Oo()(`${O}/authorize`,{method:"POST",body:JSON.stringify(x),headers:{...this.getAuthorizationHeader((c=a)===null||c===void 0?void 0:c.token),"content-type":"application/json"}});if(!N.ok)throw await Rt.VL.fromResponse(N);const J=await N.json(),Ne=ts(o,new Set(x.items.map(({id:je})=>je))).parse(J).items.reduce((je,ke)=>(je[ke.id]=ke,je),{});return x.items.map(je=>Ne[je.id])}getAuthorizationHeader(t){return t?{Authorization:`Bearer ${t}`}:{}}constructor(t){(0,k._)(this,"enabled",void 0),(0,k._)(this,"discovery",void 0),this.discovery=t.discovery;var o;this.enabled=(o=t.config.getOptionalBoolean("permission.enabled"))!==null&&o!==void 0?o:!1}}class ko{static create(t){const{config:o,discovery:a,identity:c}=t,x=new ns({discovery:a,config:o});return new ko(x,c)}async authorize(t){return(await this.permissionClient.authorize([t],await this.identityApi.getCredentials()))[0]}constructor(t,o){(0,k._)(this,"permissionClient",void 0),(0,k._)(this,"identityApi",void 0),this.permissionClient=t,this.identityApi=o}}var y=n(69984);function E(i){const t=(0,m.h_)(Po),{data:o,error:a}=(0,y.ZP)(i,async c=>{if(qo(c.permission)&&!c.resourceRef)return xn.DENY;const{result:x}=await t.authorize(c);return x});return a?{error:a,loading:!1,allowed:!1}:o===void 0?{loading:!0,allowed:!1}:{loading:!1,allowed:o===xn.ALLOW}}const $=i=>{const{permission:t,resourceRef:o,errorComponent:a,...c}=i,x=usePermission(isResourcePermission(t)?{permission:t,resourceRef:o}:{permission:t}),O=useApp(),{NotFoundErrorPage:N}=O.getComponents();let J=a===void 0?_jsx(N,{}):a;return x.loading?J=null:x.allowed&&(J=i.element),_jsx(Route,{...c,element:J})};function B(i){const{permission:t,resourceRef:o}=i,a=usePermission(isResourcePermission(t)?{permission:t,resourceRef:o}:{permission:t}),c=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:x}=c.getComponents();return _jsx(x,{})}const ce=[(0,m.ni)({api:m.NW,deps:{configApi:m.Ds},factory:({configApi:i})=>ue.compile(`${i.getString("backend.baseUrl")}/api/{{ pluginId }}`)}),(0,m.ni)({api:m.$v,deps:{},factory:()=>new ne}),(0,m.ni)({api:m.v_,deps:{},factory:()=>new Te}),(0,m.ni)({api:m.VE,deps:{alertApi:m.$v},factory:({alertApi:i})=>{const t=new Ce(i,new Oe);return tt.forward(t,{hidden:!1}),t}}),(0,m.ni)({api:m.E6,deps:{errorApi:m.VE},factory:({errorApi:i})=>zt.create({errorApi:i})}),(0,m.ni)({api:m.gP,deps:{configApi:m.Ds,identityApi:m.$4,discoveryApi:m.NW},factory:({configApi:i,identityApi:t,discoveryApi:o})=>xt({middleware:[_t.resolvePluginProtocol({discoveryApi:o}),_t.injectIdentityAuth({identityApi:t,config:i})]})}),(0,m.ni)({api:m.ZM,deps:{},factory:()=>new It}),(0,m.ni)({api:m.Kp,deps:{discoveryApi:m.NW,oauthRequestApi:m.ZM,configApi:m.Ds},factory:({discoveryApi:i,oauthRequestApi:t,configApi:o})=>ln.create({configApi:o,discoveryApi:i,oauthRequestApi:t,environment:o.getOptionalString("auth.environment")})}),(0,m.ni)({api:m.p_,deps:{discoveryApi:m.NW,oauthRequestApi:m.ZM,configApi:m.Ds},factory:({discoveryApi:i,oauthRequestApi:t,configApi:o})=>qt.create({configApi:o,discoveryApi:i,oauthRequestApi:t,environment:o.getOptionalString("auth.environment")})}),(0,m.ni)({api:m.F4,deps:{discoveryApi:m.NW,oauthRequestApi:m.ZM,configApi:m.Ds},factory:({discoveryApi:i,oauthRequestApi:t,configApi:o})=>gt.create({configApi:o,discoveryApi:i,oauthRequestApi:t,defaultScopes:["read:user"],environment:o.getOptionalString("auth.environment")})}),(0,m.ni)({api:m.D,deps:{discoveryApi:m.NW,oauthRequestApi:m.ZM,configApi:m.Ds},factory:({discoveryApi:i,oauthRequestApi:t,configApi:o})=>Fn.create({configApi:o,discoveryApi:i,oauthRequestApi:t,environment:o.getOptionalString("auth.environment")})}),(0,m.ni)({api:m.ux,deps:{discoveryApi:m.NW,oauthRequestApi:m.ZM,configApi:m.Ds},factory:({discoveryApi:i,oauthRequestApi:t,configApi:o})=>jt.create({configApi:o,discoveryApi:i,oauthRequestApi:t,environment:o.getOptionalString("auth.environment")})}),(0,m.ni)({api:m.gW,deps:{discoveryApi:m.NW,oauthRequestApi:m.ZM,configApi:m.Ds},factory:({discoveryApi:i,oauthRequestApi:t,configApi:o})=>fr.create({configApi:o,discoveryApi:i,oauthRequestApi:t,environment:o.getOptionalString("auth.environment")})}),(0,m.ni)({api:m.bq,deps:{discoveryApi:m.NW,oauthRequestApi:m.ZM,configApi:m.Ds},factory:({discoveryApi:i,oauthRequestApi:t,configApi:o})=>_n.create({configApi:o,discoveryApi:i,oauthRequestApi:t,defaultScopes:["team"],environment:o.getOptionalString("auth.environment")})}),(0,m.ni)({api:m.Km,deps:{discoveryApi:m.NW,oauthRequestApi:m.ZM,configApi:m.Ds},factory:({discoveryApi:i,oauthRequestApi:t,configApi:o})=>Cr.create({configApi:o,discoveryApi:i,oauthRequestApi:t,defaultScopes:["REPO_READ"]})}),(0,m.ni)({api:m.uB,deps:{discoveryApi:m.NW,oauthRequestApi:m.ZM,configApi:m.Ds},factory:({discoveryApi:i,oauthRequestApi:t,configApi:o})=>Re.create({configApi:o,discoveryApi:i,oauthRequestApi:t,environment:o.getOptionalString("auth.environment")})}),(0,m.ni)({api:Po,deps:{discovery:m.NW,identity:m.$4,config:m.Ds},factory:({config:i,discovery:t,identity:o})=>ko.create({config:i,discovery:t,identity:o})})];var ie=n(77277),z=n(53974),he=n(71597);function Ae({children:i}){return(0,H.GV)()?(0,p.jsx)(p.Fragment,{children:i}):(0,p.jsx)(H.VA,{children:i})}const Pe=()=>(0,p.jsx)(z.mf,{status:"404",statusMessage:"PAGE NOT FOUND"}),We=({step:i,error:t})=>{let o="";return i==="load-config"?o=`The configuration failed to load, someone should have a look at this error: ${t.message}`:i==="load-chunk"&&(o=`Lazy loaded chunk failed to load, try to reload the page: ${t.message}`),(0,p.jsx)(Ae,{children:(0,p.jsx)(z.mf,{status:"501",statusMessage:o})})},Ue=({error:i,resetError:t,plugin:o})=>{var a;return(0,p.jsx)(z.yu,{title:`Error in ${(a=o)===null||a===void 0?void 0:a.getId()}`,defaultExpanded:!0,error:i,children:(0,p.jsx)(ie.Z,{variant:"outlined",onClick:t,children:"Retry"})})},Ve={Progress:z.Ex,Router:he.VK,NotFoundErrorPage:Pe,BootErrorPage:We,ErrorBoundaryFallback:Ue};var lt=n(43642),St=n(80079),De=n(90941),Xe=n(32915),Ct=n(40562),Qt=n(21853),jn=n(60744),Pt=n(66569),Lt=n(30254),en=n(13384),En=n(15933),vr=n(58838),$r=n(86737),io=n(4989),Un=n(44407),Jn=n(18628),jr=n(84219),Ls=n(98685),hi=n(39781),pi=n(39412);const Ba={brokenImage:St.Z,catalog:Jn.Z,scaffolder:Xe.Z,techdocs:Ct.Z,search:Qt.Z,chat:jn.Z,dashboard:Pt.Z,docs:Lt.Z,email:en.Z,github:vr.Z,group:jr.Z,help:$r.Z,"kind:api":En.Z,"kind:component":Un.Z,"kind:domain":lt.Z,"kind:group":jr.Z,"kind:location":io.Z,"kind:system":De.Z,"kind:user":Ls.Z,"kind:resource":pi.Z,user:Ls.Z,warning:hi.Z};var Os=n(73689),fi=n(93606);const Er={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")`},yr={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 Mn(i){var t;const{colors:o,shape:a,options:c}=i,O=`linear-gradient(90deg, ${(o.length===1?[o[0],o[0]]:o).join(", ")})`,N=`${a}, ${O}`;var J;const fe=(J=(t=c)===null||t===void 0?void 0:t.fontColor)!==null&&J!==void 0?J:"#FFFFFF";return{colors:o,shape:a,backgroundImage:N,fontColor:fe}}const gi={home:Mn({colors:yr.teal,shape:Er.wave}),documentation:Mn({colors:yr.pinkSea,shape:Er.wave2}),tool:Mn({colors:yr.purpleSky,shape:Er.round}),service:Mn({colors:yr.marineBlue,shape:Er.wave}),website:Mn({colors:yr.veryBlue,shape:Er.wave}),library:Mn({colors:yr.rubyRed,shape:Er.wave}),other:Mn({colors:yr.darkGrey,shape:Er.wave}),app:Mn({colors:yr.toastyOrange,shape:Er.wave}),apis:Mn({colors:yr.teal,shape:Er.wave2}),card:Mn({colors:yr.greens,shape:Er.wave})},ks=16,mi='"Helvetica Neue", Helvetica, Roboto, Arial, sans-serif',Bs="home";function rs(i){const{palette:t,htmlFontSize:o=ks,fontFamily:a=mi,defaultPageTheme:c=Bs,pageTheme:x=gi,typography:O}=i;if(!x[c])throw new Error(`${c} is not defined in pageTheme.`);const N={htmlFontSize:o,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}};var J;return{palette:t,typography:O!=null?O:N,page:x[c],getPageTheme:({themeId:fe})=>(J=x[fe])!==null&&J!==void 0?J:x[c]}}var $s=n(47591);const os={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,$s._j)(i.palette.link,.3),background:(0,$s.$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})=>({marginRight:i.spacing(1),marginBottom:i.spacing(1)}),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})=>({width:i.spacing(3),height:i.spacing(3),margin:i.spacing(0,.75,0,-.75)}),deleteIconSmall:({theme:i})=>({width:i.spacing(2),height:i.spacing(2),margin:i.spacing(0,.5,0,-.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"}}},MuiLink:{defaultProps:{underline:"hover"}}},vi=i=>(...t)=>{const o=t.length===0?[1]:t,a=(c,x)=>typeof c=="string"?c:x*c;return o.map(c=>{const x=a(c,i);return typeof x=="number"?`${x}px`:x}).join(" ")};function Ds(i,t){if(!t||typeof t=="string")return;const o=typeof t=="function"?t(i):t;if(o)return{"@global":o}}function yi(i,t){if(!(!t||typeof t=="string")){if(typeof t=="object"){const o={...i},a=i.spacing(1);return typeof a=="number"&&(o.spacing=vi(a)),Object.fromEntries(Object.entries(t).map(([c,x])=>typeof x=="function"?[c,x({theme:o})]:[c,x]))}return t}}const xr=/^&.Mui-([\w-]+)$/;function $a(i){let t=i;if(!i||typeof i!="object")return t;for(const o of Object.keys(i)){const a=i[o];if(!(!a||typeof a!="object"))for(const c of Object.keys(a)){const x=c,O=x.match(xr);if(O){const[,N]=O,{[x]:J,...fe}=a;J&&(t={...t,[o]:fe,[N]:J})}}}return t}function xi(i,t={}){const o={},a={};for(const c of Object.keys(t)){const x=t[c];x&&("styleOverrides"in x&&(c==="MuiCssBaseline"?o[c]=Ds(i,x.styleOverrides):o[c]=$a(yi(i,x.styleOverrides))),"defaultProps"in x&&(a[c]=x.defaultProps))}return{overrides:o,props:a}}var Bo=new WeakMap;class bi{getTheme(t){return(0,S._)(this,Bo).get(t)}constructor(t,o){(0,d._)(this,Bo,{writable:!0,value:new Map}),(0,C._)(this,Bo,new Map),t&&(0,S._)(this,Bo).set("v4",t),o&&(0,S._)(this,Bo).set("v5",o)}}function Si(i){const t=rs(i),o={...os,...i.components},a=(0,fi.Z)({...t,components:o}),c=xi(a,o),x={...(0,Os.Z)(t),...c};return new bi(x,a)}function hl(i){const t=adaptV4Theme(i),o=createTheme(i);return new bi(o,t)}const ss={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"}}},Ci={light:Si({palette:ss.light}),dark:Si({palette:ss.dark})};var $o=n(68542);$o.Z.configure(i=>`v5-${i}`);var Da=n(87561),Na=n(12536),wi=n(19219),ji=n(41547),is=n(3493),Ei=n(81887);const Ai=(0,Na.Z)({productionPrefix:"jss4-"});function Ns(i){const{children:t,theme:o,noCssBaseline:a=!1}=i,c=o.getTheme("v4"),x=o.getTheme("v5");let O;a||(O=(0,p.jsx)(Da.ZP,{}));let N=(0,p.jsxs)(p.Fragment,{children:[O,t]});return c&&(N=(0,p.jsx)(wi.ZP,{generateClassName:Ai,children:(0,p.jsx)(ji.Z,{theme:c,children:N})})),x&&(N=(0,p.jsx)(is.Z,{injectFirst:!0,children:(0,p.jsx)(Ei.Z,{theme:x,children:N})})),N}function as(i){var t,o,a,c;return{props:{MuiGrid:(o=os)===null||o===void 0||(t=o.MuiGrid)===null||t===void 0?void 0:t.defaultProps,MuiSwitch:(c=os)===null||c===void 0||(a=c.MuiSwitch)===null||a===void 0?void 0:a.defaultProps},...rs(i)}}function Ar(i){return xi(i,os).overrides}function Do(i){const t=as(i),o=(0,Os.Z)(t),a=Ar(o);return{...o,overrides:a}}const Fa=Do({palette:ss.light}),Ti=Do({palette:ss.dark});var Ri=n(98192),Ii=n(15222);const Pi=[{id:"light",title:"Light Theme",variant:"light",icon:(0,p.jsx)(Ii.Z,{}),Provider:({children:i})=>(0,p.jsx)(Ns,{theme:Ci.light,children:i})},{id:"dark",title:"Dark Theme",variant:"dark",icon:(0,p.jsx)(Ri.Z,{}),Provider:({children:i})=>(0,p.jsx)(Ns,{theme:Ci.dark,children:i})}];function Fs(i){var t,o,a,c,x,O,N,J,fe,Ne,je,ke;return Yr({...i,apis:(fe=(t=i)===null||t===void 0?void 0:t.apis)!==null&&fe!==void 0?fe:[],bindRoutes:(o=i)===null||o===void 0?void 0:o.bindRoutes,components:{...Ve,...(a=i)===null||a===void 0?void 0:a.components},configLoader:(c=i)===null||c===void 0?void 0:c.configLoader,defaultApis:ce,icons:{...Ba,...(x=i)===null||x===void 0?void 0:x.icons},plugins:(Ne=(O=i)===null||O===void 0?void 0:O.plugins)!==null&&Ne!==void 0?Ne:[],featureFlags:(je=(N=i)===null||N===void 0?void 0:N.featureFlags)!==null&&je!==void 0?je:[],themes:(ke=(J=i)===null||J===void 0?void 0:J.themes)!==null&&ke!==void 0?ke:Pi})}var No=n(25271),ls=n(76635);async function cs({storageApi:i}){const t=i.forBucket("settings"),o=i.forBucket("starredEntities"),a=t.snapshot("starredEntities").value;if(!(0,ls.isArray)(a))return;var c;const x=new Set((c=o.snapshot("entityRefs").value)!==null&&c!==void 0?c:[]);a.filter(ls.isString).map(O=>O.split(":")).filter(O=>O.length===4&&O[0]==="entity").map(([O,N,J,fe])=>(0,No.eE)({kind:N,namespace:J,name:fe})).forEach(O=>x.add(O)),await o.set("entityRefs",Array.from(x)),await t.remove("starredEntities")}class Zs{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,k._)(this,"settingsStore",void 0),(0,k._)(this,"starredEntities",void 0),(0,k._)(this,"subscribers",new Set),(0,k._)(this,"observable",new(Be())(a=>(a.next(new Set(this.starredEntities)),this.subscribers.add(a),()=>{this.subscribers.delete(a)}))),cs(t).then(),this.settingsStore=t.storageApi.forBucket("starredEntities");var o;this.starredEntities=new Set((o=this.settingsStore.snapshot("entityRefs").value)!==null&&o!==void 0?o:[]),this.settingsStore.observe$("entityRefs").subscribe({next:a=>{var c;this.starredEntities=new Set((c=a.value)!==null&&c!==void 0?c:[]),this.notifyChanges()}})}}var Za=n(8799),ao=n(79692),Li=n(12420),Dn=n(39709),Ua=n(19928);function Ma(){const i=useApi(catalogApiRef),{error:t,loading:o,value:a}=useAsync(async()=>await i.getEntityFacets({facets:["kind"]}).then(x=>{var O;return((O=x.facets.kind)===null||O===void 0?void 0:O.map(N=>N.value).sort())||[]}),[i]);return{loading:o,error:t,allKinds:a!=null?a:[]}}function za(i,t,o){let a=i;return t&&(a=a.filter(x=>t.some(O=>O.toLocaleLowerCase("en-US")===x.toLocaleLowerCase("en-US")))),o&&!i.some(x=>x.toLocaleLowerCase("en-US")===o.toLocaleLowerCase("en-US"))&&(a=a.concat([o])),a.sort().reduce((x,O)=>(x[O.toLocaleLowerCase("en-US")]=O,x),{})}const Oi=(0,ao.Z)(i=>(0,Li.Z)({root:{...i.typography.h4}}));function ki(i){var t;const{initialFilter:o="component",allowedKinds:a}=i,c=Oi(),{allKinds:x}=useAllKinds(),{filters:O,updateFilters:N,queryParameters:{kind:J}}=useEntityList(),fe=useMemo(()=>[J].flat()[0],[J]);var Ne;const[je,ke]=useState((Ne=fe!=null?fe:(t=O.kind)===null||t===void 0?void 0:t.value)!==null&&Ne!==void 0?Ne:o);useEffect(()=>{fe&&ke(fe)},[fe]),useEffect(()=>{var Ke;if(!((Ke=O.kind)===null||Ke===void 0)&&Ke.value){var At;ke((At=O.kind)===null||At===void 0?void 0:At.value)}},[O.kind]),useEffect(()=>{N({kind:je?new EntityKindFilter(je):void 0})},[je,N]);const Fe=filterKinds(x,a,je);return _jsx(Select,{input:_jsx(InputBase,{}),value:je.toLocaleLowerCase("en-US"),onChange:Ke=>ke(Ke.target.value),classes:c,children:Object.keys(Fe).map(Ke=>_jsx(MenuItem,{value:Ke,children:`${pluralize(Fe[Ke])}`},Ke))})}var Bi=n(86359),ds=n(95544),$i=n(99688),lo=n(12231),Fo=n(86136),Zo=n(49378),Di=n(85256),Us=n(80030),Ms=n(61837),Ni=n(79784),Fi=n(50758),Zi=n(31654),zs=n(43054),Ws=n(65759),Wa=n(49280),Vs=n(96641);function Ui(i){const{entity:t,loading:o,error:a}=(0,Vs.ce)(),{allowed:c,loading:x,error:O}=E({permission:i,resourceRef:t?(0,No.eE)(t):void 0});return o||x?{loading:!0,allowed:!1}:a?{loading:!1,allowed:!1,error:a}:{loading:!1,allowed:c,error:O}}const us="catalog-entity",Mi=Br({name:"catalog.entity.read",attributes:{action:"read"},resourceType:us}),zi=Br({name:"catalog.entity.create",attributes:{action:"create"}}),hs=Br({name:"catalog.entity.delete",attributes:{action:"delete"},resourceType:us}),Wi=Br({name:"catalog.entity.refresh",attributes:{action:"update"},resourceType:us}),Hs=Br({name:"catalog.location.read",attributes:{action:"read"}}),Va=Br({name:"catalog.location.create",attributes:{action:"create"}}),Vi=Br({name:"catalog.location.delete",attributes:{action:"delete"}}),pl=[Mi,zi,hs,Wi,Hs,Va,Vi];var Hi=n(49166);function Gi(i){var t,o,a,c;const{unregisterEntityOptions:x,isUnregisterAllowed:O,onUnregisterEntity:N,onClose:J}=i,fe=typeof((t=x)===null||t===void 0?void 0:t.disableUnregister)=="boolean";var Ne;const je=(Ne=!O||(fe?!!(!((o=x)===null||o===void 0)&&o.disableUnregister):((a=x)===null||a===void 0?void 0:a.disableUnregister)==="disable"))!==null&&Ne!==void 0?Ne:!1;let ke=(0,p.jsx)(p.Fragment,{});return((c=x)===null||c===void 0?void 0:c.disableUnregister)!=="hidden"&&(ke=(0,p.jsxs)(lo.Z,{onClick:()=>{J(),N()},disabled:je,children:[(0,p.jsx)(Fo.Z,{children:(0,p.jsx)(Hi.Z,{fontSize:"small"})}),(0,p.jsx)(Zo.Z,{primary:"Unregister entity"})]})),(0,p.jsx)(p.Fragment,{children:ke})}const Ki=(0,ao.Z)(i=>({button:{color:i.page.fontColor}}),{name:"PluginCatalogEntityContextMenu"});function Yi(i){const{UNSTABLE_extraContextMenuItems:t,UNSTABLE_contextMenuOptions:o,onUnregisterEntity:a,onInspectEntity:c}=i,[x,O]=(0,V.useState)(),N=Ki(),fe=Ui(hs).allowed,Ne=At=>{O(At.currentTarget)},je=()=>{O(void 0)},ke=(0,m.h_)(m.$v),Fe=(0,V.useCallback)(()=>{window.navigator.clipboard.writeText(window.location.toString()).then(()=>ke.post({message:"Copied!",severity:"info",display:"transient"}))},[ke]),Ke=t&&[...t.map(At=>(0,p.jsxs)(lo.Z,{onClick:()=>{je(),At.onClick()},children:[(0,p.jsx)(Fo.Z,{children:(0,p.jsx)(At.Icon,{fontSize:"small"})}),(0,p.jsx)(Zo.Z,{primary:At.title})]},At.title)),(0,p.jsx)(Di.Z,{},"the divider is here!")];return(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)(Us.ZP,{title:"More",arrow:!0,children:(0,p.jsx)(Ms.Z,{"aria-label":"more","aria-controls":"long-menu","aria-haspopup":"true","aria-expanded":!!x,role:"button",onClick:Ne,"data-testid":"menu-button",className:N.button,id:"long-menu",children:(0,p.jsx)(zs.Z,{})})}),(0,p.jsx)(Ni.ZP,{open:Boolean(x),onClose:je,anchorEl:x,anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"},"aria-labelledby":"long-menu",children:(0,p.jsxs)(Fi.Z,{autoFocusItem:Boolean(x),children:[Ke,(0,p.jsx)(Gi,{unregisterEntityOptions:o,isUnregisterAllowed:fe,onUnregisterEntity:a,onClose:je}),(0,p.jsxs)(lo.Z,{onClick:()=>{je(),c()},children:[(0,p.jsx)(Fo.Z,{children:(0,p.jsx)(Zi.Z,{fontSize:"small"})}),(0,p.jsx)(Zo.Z,{primary:"Inspect entity"})]}),(0,p.jsxs)(lo.Z,{onClick:()=>{je(),Fe()},children:[(0,p.jsx)(Fo.Z,{children:(0,p.jsx)(Ws.Z,{fontSize:"small"})}),(0,p.jsx)(Zo.Z,{primary:"Copy entity URL"})]})]})})]})}const Gs="plugin.catalog.entityLayoutRoute",ps=()=>null;(0,m.R5)(ps,Gs,!0),(0,m.R5)(ps,"core.gatherMountPoints",!0);function Ji(i){const{entity:t,title:o}=i;return(0,p.jsxs)(ds.Z,{display:"inline-flex",alignItems:"center",height:"1em",maxWidth:"100%",children:[(0,p.jsx)(ds.Z,{component:"span",textOverflow:"ellipsis",whiteSpace:"nowrap",overflow:"hidden",children:o}),t&&(0,p.jsx)(Dn.LH,{entity:t})]})}function Qi(i,t,o,a){var c,x,O,N,J;const fe=(J=i!=null?i:(c=a)===null||c===void 0?void 0:c.kind)!==null&&J!==void 0?J:"";var Ne;const je=(Ne=t!=null?t:(x=a)===null||x===void 0?void 0:x.metadata.namespace)!==null&&Ne!==void 0?Ne:"";var ke,Fe,Ke;return{headerTitle:`${(Ke=(Fe=(ke=(O=a)===null||O===void 0?void 0:O.metadata.title)!==null&&ke!==void 0?ke:o)!==null&&Fe!==void 0?Fe:(N=a)===null||N===void 0?void 0:N.metadata.name)!==null&&Ke!==void 0?Ke:""}${je&&je!==No.zG?` in ${je}`:""}`,headerType:(()=>{let kt=fe.toLocaleLowerCase("en-US");return a&&a.spec&&"type"in a.spec&&(kt+=" \u2014 ",kt+=a.spec.type.toLocaleLowerCase("en-US")),kt})()}}function Xi(i){var t;const{entity:o}=i,a=(0,Dn.hF)(o,No.S4);return(0,p.jsxs)(p.Fragment,{children:[a.length>0&&(0,p.jsx)(z.i9,{label:"Owner",value:(0,p.jsx)(Dn.rI,{entityRefs:a,defaultKind:"Group",color:"inherit"})}),((t=o.spec)===null||t===void 0?void 0:t.lifecycle)&&(0,p.jsx)(z.i9,{label:"Lifecycle",value:o.spec.lifecycle})]})}const qi=i=>{var t,o,a;const{UNSTABLE_extraContextMenuItems:c,UNSTABLE_contextMenuOptions:x,children:O,NotFoundComponent:N}=i,{kind:J,namespace:fe,name:Ne}=(0,m.Oi)(Dn.wi),{entity:je,loading:ke,error:Fe}=(0,Dn.ce)(),Ke=(0,H.TH)(),At=(0,m.vJ)(O,Ir=>Ir.selectByComponentData({key:Gs,withStrictError:"Child of EntityLayout must be an EntityLayout.Route"}).getElements().flatMap(({props:An})=>{if(je){if(An.if&&!An.if(je))return[]}else return[];return[{path:An.path,title:An.title,children:An.children,tabProps:An.tabProps}]}),[je]),{headerTitle:kt,headerType:Ln}=Qi(J,fe,Ne,je),[dr,br]=(0,V.useState)(!1),[Rr,Sr]=(0,V.useState)(!1),Nn=(0,H.s0)(),Nr=async()=>{br(!1),Sr(!1),Nn("/")};(0,V.useEffect)(()=>{br(!1),Sr(!1)},[Ke.pathname]);var Hr;return(0,p.jsxs)(z.T3,{themeId:(Hr=(a=je)===null||a===void 0||(o=a.spec)===null||o===void 0||(t=o.type)===null||t===void 0?void 0:t.toString())!==null&&Hr!==void 0?Hr:"home",children:[(0,p.jsx)(z.h4,{title:(0,p.jsx)(Ji,{title:kt,entity:je}),pageTitleOverride:kt,type:Ln,children:je&&(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)(Xi,{entity:je}),(0,p.jsx)(Yi,{UNSTABLE_extraContextMenuItems:c,UNSTABLE_contextMenuOptions:x,onUnregisterEntity:()=>br(!0),onInspectEntity:()=>Sr(!0)})]})}),ke&&(0,p.jsx)(z.Ex,{}),je&&(0,p.jsx)(z.tn,{routes:At}),Fe&&(0,p.jsx)(z.VY,{children:(0,p.jsx)($i.Z,{severity:"error",children:Fe.toString()})}),!ke&&!Fe&&!je&&(0,p.jsx)(z.VY,{children:N||(0,p.jsxs)(z.GB,{title:"Entity not found",children:["There is no ",J," with the requested"," ",(0,p.jsx)(z.rU,{to:"https://backstage.io/docs/features/software-catalog/references",children:"kind, namespace, and name"}),"."]})}),(0,p.jsx)(Dn.pp,{open:dr,entity:je,onConfirm:Nr,onClose:()=>br(!1)}),(0,p.jsx)(Dn.U_,{open:Rr,entity:je,onClose:()=>Sr(!1)})]})};qi.Route=ps;function Ks(i){const{open:t,onClose:o,onConfirm:a,entity:c}=i,[x,O]=useState(!1),N=useApi(catalogApiRef),J=useApi(alertApiRef),fe=async()=>{O(!0);try{const Ne=c.metadata.uid;await N.removeEntityByUid(Ne),a()}catch(Ne){assertError(Ne),J.post({message:Ne.message})}finally{O(!1)}};return _jsxs(Dialog,{open:t,onClose:o,children:[_jsx(DialogTitle,{id:"responsive-dialog-title",children:"Are you sure you want to delete this entity?"}),_jsxs(DialogActions,{children:[_jsx(Button,{variant:"contained",color:"secondary",disabled:x,onClick:fe,children:"Delete"}),_jsx(Button,{onClick:o,color:"primary",children:"Cancel"})]})]})}var bo=n(19625);function fs(i){var t,o,a;return((a=i)===null||a===void 0||(o=a.metadata)===null||o===void 0||(t=o.annotations)===null||t===void 0?void 0:t["backstage.io/orphan"])==="true"}function _i(){const i=useNavigate(),t=useRouteRef(rootRouteRef),[o,a]=useState(!1),{entity:c}=useEntity(),x=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:o,entity:c,onConfirm:x,onClose:()=>a(!1)})]})}async function gs(i,t){var o,a;const c=(o=i.relations)===null||o===void 0?void 0:o.map(O=>O.targetRef);if(!c||((a=c)===null||a===void 0?void 0:a.length)<1||c.length>1e3)return[];const x=await t.getEntitiesByRefs({entityRefs:c,fields:["kind","metadata.name","metadata.namespace"]});return c.filter((O,N)=>x.items[N]===void 0)}async function Vr(i,t){const o=t.apis.get(catalogApiRef);if(!o)throw new Error(`No implementation available for ${catalogApiRef}`);return(await gs(i,o)).length>0}function Ha(){const{entity:i}=useEntity(),t=useApi(catalogApiRef),{loading:o,error:a,value:c}=useAsync(async()=>gs(i,t),[i,t]);return a?_jsx(Box,{mb:1,children:_jsx(ResponseErrorPanel,{error:a})}):o||!c||c.length===0?null:_jsx(_Fragment,{children:_jsxs(Alert,{severity:"warning",children:["This entity has relations to other entities, which can't be found in the catalog. ",_jsx("br",{}),"Entities not found are: ",c.join(", ")]})})}var Ys=n(4791);const ea=i=>i.error&&i.level==="error"&&i.type===ENTITY_STATUS_CATALOG_PROCESSING_TYPE;async function ta(i,t){return{items:(await t.getEntityAncestors({entityRef:i})).items.map(c=>{var x,O;return{errors:((O=(x=c.entity.status)===null||x===void 0?void 0:x.items)!==null&&O!==void 0?O:[]).filter(ea).map(fe=>fe.error).filter(fe=>Boolean(fe)),entity:c.entity}}).filter(c=>c.errors.length>0)}}async function Dr(i,t){const o=t.apis.get(catalogApiRef);if(!o)throw new Error(`No implementation available for ${catalogApiRef}`);return(await ta(stringifyEntityRef(i),o)).items.length>0}function na(){const{entity:i}=useEntity(),t=stringifyEntityRef(i),o=useApi(catalogApiRef),{loading:a,error:c,value:x}=useAsync(async()=>ta(t,o),[t,o]);return c?_jsx(Box,{mb:1,children:_jsx(ResponseErrorPanel,{error:c})}):a||!x?null:_jsx(_Fragment,{children:x.items.map((O,N)=>_jsxs(Box,{mb:1,children:[stringifyEntityRef(i)!==stringifyEntityRef(O.entity)&&_jsxs(Box,{p:1,children:["The error below originates from"," ",_jsx(EntityRefLink,{entityRef:O.entity})]}),O.errors.map((J,fe)=>_jsx(ResponseErrorPanel,{error:J},fe))]},N))})}const Js="core.backstage.entitySwitch",Qs=i=>null;(0,m.R5)(Qs,Js,!0);const ra=i=>{var t;const{entity:o,loading:a}=(0,Dn.ce)(),c=(0,m.I_)(),x=(0,m.vJ)(i.children,J=>J.selectByComponentData({key:Js,withStrictError:"Child of EntitySwitch is not an EntitySwitch.Case"}).getElements().flatMap(fe=>{var Ne;if(a&&!o)return[];const{if:je,children:ke}=fe.props;return o?[{if:(Ne=je)===null||Ne===void 0?void 0:Ne(o,{apis:c}),children:ke}]:[{if:je===void 0,children:ke}]}),[c,o,a]);if(x.some(J=>typeof J.if=="object"&&"then"in J.if))return(0,p.jsx)(oa,{results:x,renderMultipleMatches:i.renderMultipleMatches});if(i.renderMultipleMatches==="all"){const J=x.filter(fe=>fe.if).map(fe=>fe.children);return J.length===0?Qr(x):(0,p.jsx)(p.Fragment,{children:J})}var N;return(N=(t=x.find(J=>J.if))===null||t===void 0?void 0:t.children)!==null&&N!==void 0?N:Qr(x)};function oa({results:i,renderMultipleMatches:t}){const{loading:o,value:a}=(0,A.default)(async()=>{const c=i.map(async({if:O,children:N})=>{try{if(await O)return N}catch{}return null});if(t==="all"){const O=(await Promise.all(c)).filter(Boolean);return O.length===0?Qr(i):(0,p.jsx)(p.Fragment,{children:O})}var x;return(x=(await Promise.all(c)).find(Boolean))!==null&&x!==void 0?x:Qr(i)},[i]);return o||!a?null:a}function Qr(i){var t,o;return(o=(t=i.filter(a=>a.if===void 0)[0])===null||t===void 0?void 0:t.children)!==null&&o!==void 0?o:null}ra.Case=Qs;const sa=null,ia=Dn._i.Filters,aa=Dn._i.Content;var la=n(85877),ms=n(15096);const Qn=(0,m.rx)({id:"catalog",apis:[(0,m.ni)({api:Dn.Ah,deps:{discoveryApi:m.NW,fetchApi:m.gP},factory:({discoveryApi:i,fetchApi:t})=>new Ys.MS({discoveryApi:i,fetchApi:t})}),(0,m.ni)({api:Dn.p3,deps:{storageApi:m.E6},factory:({storageApi:i})=>new Zs({storageApi:i})})],routes:{catalogIndex:bo._Z,catalogEntity:Dn.wi},externalRoutes:{createComponent:bo.yw,viewTechDoc:bo.jU,createFromTemplate:bo.ql},__experimentalConfigure(i){return{...{createButtonTitle:"Create"},...i}}}),Ga=Qn.provide((0,m.P4)({name:"CatalogIndexPage",component:()=>n.e(5837).then(n.bind(n,95837)).then(i=>i.CatalogPage),mountPoint:bo._Z})),Xs=Qn.provide((0,m.P4)({name:"CatalogEntityPage",component:()=>n.e(8951).then(n.bind(n,78951)).then(i=>i.CatalogEntityPage),mountPoint:Dn.wi})),ca=Qn.provide((0,m.CO)({name:"EntityAboutCard",component:{lazy:()=>Promise.resolve().then(n.bind(n,8799)).then(i=>i.AboutCard)}})),da=Qn.provide((0,m.CO)({name:"EntityLinksCard",component:{lazy:()=>n.e(7750).then(n.bind(n,17750)).then(i=>i.EntityLinksCard)}})),Ka=Qn.provide((0,m.CO)({name:"EntityLabelsCard",component:{lazy:()=>Promise.resolve().then(n.bind(n,85877)).then(i=>i.EntityLabelsCard)}})),vs=Qn.provide((0,m.CO)({name:"EntityHasSystemsCard",component:{lazy:()=>n.e(5458).then(n.bind(n,5458)).then(i=>i.HasSystemsCard)}})),Ya=Qn.provide((0,m.CO)({name:"EntityHasComponentsCard",component:{lazy:()=>n.e(1105).then(n.bind(n,1105)).then(i=>i.HasComponentsCard)}})),Ja=Qn.provide((0,m.CO)({name:"EntityHasSubcomponentsCard",component:{lazy:()=>n.e(2440).then(n.bind(n,82440)).then(i=>i.HasSubcomponentsCard)}})),ua=Qn.provide((0,m.CO)({name:"EntityHasResourcesCard",component:{lazy:()=>n.e(9770).then(n.bind(n,79770)).then(i=>i.HasResourcesCard)}})),ha=Qn.provide((0,m.CO)({name:"EntityDependsOnComponentsCard",component:{lazy:()=>n.e(9545).then(n.bind(n,19545)).then(i=>i.DependsOnComponentsCard)}})),Qa=Qn.provide((0,m.CO)({name:"EntityDependencyOfComponentsCard",component:{lazy:()=>n.e(184).then(n.bind(n,40184)).then(i=>i.DependencyOfComponentsCard)}})),Xa=Qn.provide((0,m.CO)({name:"EntityDependsOnResourcesCard",component:{lazy:()=>n.e(1032).then(n.bind(n,81032)).then(i=>i.DependsOnResourcesCard)}})),qa=Qn.provide((0,m.CO)({name:"RelatedEntitiesCard",component:{lazy:()=>n.e(732).then(n.bind(n,732)).then(i=>i.RelatedEntitiesCard)}})),pa=Qn.provide((0,ms.E5)({name:"CatalogSearchResultListItem",component:()=>n.e(7670).then(n.bind(n,27670)).then(i=>i.CatalogSearchResultListItem),predicate:i=>i.type==="software-catalog"}));var _s=n(32838);class Uo{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,o){const c=`${await this.getApiOrigin()}/${o}`,x=await fetch(`${c.endsWith("/")?c:`${c}/`}index.html`);if(x.status===404)throw new Error("Page not found");return x.text()}async syncEntityDocs(t){return"cached"}async getBaseUrl(t,o,a){const c=await this.getApiOrigin();return new URL(t,`${c}/${a}`).toString()}constructor({configApi:t,discoveryApi:o,identityApi:a}){(0,k._)(this,"configApi",void 0),(0,k._)(this,"discoveryApi",void 0),(0,k._)(this,"identityApi",void 0),this.configApi=t,this.discoveryApi=o,this.identityApi=a}}class ei{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:o,identityApi:a}){(0,k._)(this,"configApi",void 0),(0,k._)(this,"discoveryApi",void 0),(0,k._)(this,"identityApi",void 0),this.configApi=t,this.discoveryApi=o,this.identityApi=a}}const fa=[(0,m.ni)({api:F.Dl,deps:{configApi:m.Ds,discoveryApi:m.NW,identityApi:m.$4},factory:({configApi:i,discoveryApi:t,identityApi:o})=>new Uo({configApi:i,discoveryApi:t,identityApi:o})}),(0,m.ni)({api:F.gT,deps:{configApi:m.Ds,discoveryApi:m.NW,identityApi:m.$4},factory:({configApi:i,discoveryApi:t,identityApi:o})=>new ei({configApi:i,discoveryApi:t,identityApi:o})}),(0,m.ni)({api:_s.q3,deps:{configApi:m.Ds},factory:({configApi:i})=>_s.ae.fromConfig(i)})],ti={backend:{baseUrl:"http://localhost:3000"},techdocs:{builder:"external"}},ga={backend:{baseUrl:"http://localhost:7007"},techdocs:{builder:"external"}};async function ni(){const i=await fetch("/.detect");return i.ok?(await i.text()).trim()==="techdocs-cli-server":!1}async function ri(){const i=await To(),t=await ni();return[...i,{context:"detected",data:t?ti:ga}]}var or=n(58845);const ma=(0,ao.Z)({svg:{width:"auto",height:30},path:{fill:"#7df3e1"}});var va=()=>{const i=ma();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 oi=(0,ao.Z)({svg:{width:"auto",height:28},path:{fill:"#7df3e1"}});var tl=()=>{const i=oi();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 ys=(0,ao.Z)({root:{width:z.po.drawerWidthClosed,height:3*z.po.logoHeight,display:"flex",flexFlow:"row nowrap",alignItems:"center",marginBottom:-14},link:{width:z.po.drawerWidthClosed,marginLeft:24}}),ya=()=>{const i=ys(),{isOpen:t}=(0,z.mZ)();return(0,p.jsx)("div",{className:i.root,children:(0,p.jsx)(z.rU,{to:"/docs/default/component/local/",underline:"none",className:i.link,children:t?(0,p.jsx)(va,{}):(0,p.jsx)(tl,{})})})},xa=({children:i})=>(0,p.jsxs)(z.tR,{children:[(0,p.jsxs)(z.YE,{children:[(0,p.jsx)(ya,{}),(0,p.jsx)(z.v7,{}),(0,p.jsx)(z.R6,{icon:or.Z,to:"/docs/default/component/local",text:"Docs Preview"})]}),i]});var ba=n(32388),Mo=n(4142);const Sa=(0,ao.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 Tr;(function(i){i.LIGHT="light",i.DARK="dark"})(Tr||(Tr={}));const si=()=>{const i=(0,m.h_)(m.hg),t=Sa(),[o,a]=(0,V.useState)(i.getActiveThemeId()===Tr.DARK?Tr.DARK:Tr.LIGHT),c={[Tr.LIGHT]:{icon:Mo.Z,title:"Dark theme"},[Tr.DARK]:{icon:ba.Z,title:"Light theme"}},{title:x,icon:O}=c[o],N=()=>{a(J=>{const fe=J===Tr.LIGHT?Tr.DARK:Tr.LIGHT;return i.setActiveThemeId(fe),fe})};return(0,p.jsx)(ds.Z,{display:"flex",alignItems:"center",mr:2,children:(0,p.jsx)(Us.ZP,{title:x,arrow:!0,children:(0,p.jsx)(Ms.Z,{size:"small",onClick:N,children:(0,p.jsx)(O,{className:t.headerIcon})})})})},Ca=()=>(0,p.jsxs)(w.I6,{children:[(0,p.jsx)(se.S,{}),(0,p.jsx)(Z.F,{withSearch:!1})]}),nl=(0,p.jsx)(Ca,{}),wa=Fs({apis:fa,configLoader:ri,plugins:Object.values(r)}),ja=wa.getProvider(),rl=wa.getRouter(),ol=w.s4.provide((0,F.KY)({name:"ThemeToggleAddon",component:si,location:F.oZ.Header})),xs=(0,p.jsxs)(Jr,{children:[(0,p.jsx)(H.Fg,{to:"/docs/default/component/local/"},"/"),(0,p.jsx)(H.AW,{path:"/catalog/:namespace/:kind/:name",element:(0,p.jsx)(Xs,{})}),(0,p.jsx)(H.AW,{path:"/docs",element:(0,p.jsx)(w.Jl,{}),children:(0,p.jsx)(ee.u,{})}),(0,p.jsxs)(H.AW,{path:"/docs/:namespace/:kind/:name/*",element:(0,p.jsx)(w.I6,{}),children:[nl,(0,p.jsx)(F.DR,{children:(0,p.jsx)(ol,{})})]})]});var Ea=()=>(0,p.jsx)(ja,{children:(0,p.jsx)(rl,{children:(0,p.jsx)(xa,{children:xs})})});f.render((0,p.jsx)(Ea,{}),document.getElementById("root"))},51837:function(wt,Ie,n){"use strict";n.d(Ie,{CT:function(){return m},EI:function(){return q},uW:function(){return f},Vt:function(){return h}});function r(){return typeof window!="undefined"&&window.Math===Math?window:typeof self!="undefined"&&self.Math===Math?self:Function("return this")()}const p=r(),V=_=>`__@backstage/${_}__`;function f(_,Q){const se=V(_);let Z=p[se];return Z||(Z=Q(),p[se]=Z,Z)}var H=n(2784);function m(_){return f(_,()=>(0,H.createContext)(void 0))}function h(_){return(0,H.useContext)(m(_))}function P(_){return{set(Q){globalThis[`__@backstage/${_}__`]=createContext(createVersionedValueMap(Q))},reset(){delete globalThis[`__@backstage/${_}__`]}}}function q(_){Object.freeze(_);const Q={atVersion(se){return _[se]}};return Object.defineProperty(Q,"$map",{configurable:!0,enumerable:!0,get(){return _}}),Q}},96641:function(wt,Ie,n){"use strict";n.d(Ie,{X2:function(){return q},ce:function(){return _},h$:function(){return h}});var r=n(52322),p=n(25271),V=n(97456),f=n(51837),H=n(2784);const m=(0,f.CT)("entity-context"),h=Q=>{const{children:se,entity:Z,loading:j,error:re,refresh:ae}=Q,oe={entity:Z,loading:j,error:re,refresh:ae};return(0,r.jsx)(m.Provider,{value:(0,f.EI)({1:oe}),children:(0,r.jsx)(V.fC,{attributes:{...Z?{entityRef:(0,p.eE)(Z)}:void 0},children:se})})},P=Q=>_jsx(h,{entity:Q.entity,loading:!Boolean(Q.entity),error:void 0,refresh:void 0,children:Q.children});function q(){const Q=(0,f.Vt)("entity-context");if(!Q)throw new Error("Entity context is not available");const se=Q.atVersion(1);if(!se)throw new Error("EntityContext v1 not available");if(!se.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:se.entity}}function _(){const Q=(0,f.Vt)("entity-context");if(!Q)throw new Error("Entity context is not available");const se=Q.atVersion(1);if(!se)throw new Error("EntityContext v1 not available");const{entity:Z,loading:j,error:re,refresh:ae}=se;return{entity:Z,loading:j,error:re,refresh:ae}}},39709:function(wt,Ie,n){"use strict";n.d(Ie,{h$:function(){return yt.h$},n3:function(){return r.n3},_i:function(){return U},tW:function(){return ot},df:function(){return ct},UO:function(){return et},ph:function(){return ns},dq:function(){return xt},nl:function(){return es},dx:function(){return Et},rI:function(){return _t},u3:function(){return tr},xE:function(){return Or},sL:function(){return S},LH:function(){return we},U_:function(){return Jr},pp:function(){return Ts},EW:function(){return Oo},Ah:function(){return V},wi:function(){return $e},hF:function(){return F.hF},CV:function(){return F.CV},$3:function(){return hn},p3:function(){return f},ce:function(){return yt.ce},X2:function(){return yt.X2},wp:function(){return at},ZW:function(){return fn},eK:function(){return He},CR:function(){return jt}});var r=n(4791),p=n(97456);const V=(0,p.T0)({id:"plugin.catalog.service"}),f=(0,p.T0)({id:"catalog-react.starred-entities"});var H=n(82394);class m{async toggleStarred(E){this.starredEntities.delete(E)||this.starredEntities.add(E);for(const $ of this.subscribers)$.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(E=>(E.next(new Set(this.starredEntities)),this.subscribers.add(E),()=>{this.subscribers.delete(E)})))}}var h=n(52322),P=n(2784),q=n(41156),_=n(60364),Q=n(77277),se=n(4190),Z=n(95544),j=n(90436),re=n(60905),ae=n(36444);const oe=y=>{var E,$;const B=(0,q.Z)(Ae=>{var Pe;return Ae.breakpoints.down(($=(Pe=y.options)===null||Pe===void 0?void 0:Pe.drawerBreakpoint)!==null&&$!==void 0?$:"md")}),ce=(0,_.Z)(),[ie,z]=(0,P.useState)(!1);var he;return B?(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(Q.Z,{style:{marginTop:ce.spacing(1),marginLeft:ce.spacing(1)},onClick:()=>z(!0),startIcon:(0,h.jsx)(ae.Z,{}),children:"Filters"}),(0,h.jsx)(se.ZP,{open:ie,onClose:()=>z(!1),anchor:(he=(E=y.options)===null||E===void 0?void 0:E.drawerAnchor)!==null&&he!==void 0?he:"left",disableAutoFocus:!0,keepMounted:!0,variant:"temporary",children:(0,h.jsxs)(Z.Z,{m:2,children:[(0,h.jsx)(j.Z,{variant:"h6",component:"h2",style:{marginBottom:ce.spacing(1)},children:"Filters"}),y.children]})})]}):(0,h.jsx)(re.Z,{item:!0,lg:2,children:y.children})},ee=y=>(0,h.jsx)(re.Z,{item:!0,xs:12,lg:10,children:y.children}),U=y=>(0,h.jsx)(re.Z,{container:!0,style:{position:"relative"},children:y.children});U.Filters=oe,U.Content=ee;var T=n(53974),w=n(87612),R=n(25271),F=n(49280);class ve{getCatalogFilters(){return{kind:this.value}}toQueryValue(){return this.value}constructor(E){(0,w._)(this,"value",void 0),this.value=E}}class be{getTypes(){return Array.isArray(this.value)?this.value:[this.value]}getCatalogFilters(){return{"spec.type":this.getTypes()}}toQueryValue(){return this.getTypes()}constructor(E){(0,w._)(this,"value",void 0),this.value=E}}class k{filterEntity(E){var $;return this.values.every(B=>(($=E.metadata.tags)!==null&&$!==void 0?$:[]).includes(B))}toQueryValue(){return this.values}constructor(E){(0,w._)(this,"values",void 0),this.values=E}}class rt{filterEntity(E){const $=this.toUpperArray(this.value.split(/\s/)),B=this.toUpperArray([E.metadata.tags]),ce=this.toUpperArray([E.metadata.name,E.metadata.title]);for(const ie of $)if(B.every(z=>z!==ie)&&ce.every(z=>!z.includes(ie)))return!1;return!0}toUpperArray(E){return E.flat().filter($=>Boolean($)).map($=>$.toLocaleUpperCase("en-US"))}constructor(E){_define_property(this,"value",void 0),this.value=E}}class ht{filterEntity(E){return this.values.some($=>(0,F.hF)(E,R.S4).some(B=>(0,R.eE)(B)===$))}toQueryValue(){return this.values}constructor(E){(0,w._)(this,"values",void 0),this.values=E.reduce(($,B)=>{try{return $.push((0,R.eE)((0,R.of)(B,{defaultKind:"Group"}))),$}catch{return $}},[])}}class Nt{filterEntity(E){return this.values.some($=>{var B;return((B=E.spec)===null||B===void 0?void 0:B.lifecycle)===$})}toQueryValue(){return this.values}constructor(E){(0,w._)(this,"values",void 0),this.values=E}}class Ut{filterEntity(E){return this.values.some($=>E.metadata.namespace===$)}toQueryValue(){return this.values}constructor(E){(0,w._)(this,"values",void 0),this.values=E}}class Bt{filterEntity(E){switch(this.value){case"owned":return this.isOwnedEntity(E);case"starred":return this.isStarredEntity(E);default:return!0}}toQueryValue(){return this.value}constructor(E,$,B){(0,w._)(this,"value",void 0),(0,w._)(this,"isOwnedEntity",void 0),(0,w._)(this,"isStarredEntity",void 0),this.value=E,this.isOwnedEntity=$,this.isStarredEntity=B}}class Dt{filterEntity(E){var $;const B=($=E.metadata.annotations)===null||$===void 0?void 0:$["backstage.io/orphan"];return B!==void 0&&this.value.toString()===B}constructor(E){(0,w._)(this,"value",void 0),this.value=E}}class _e{filterEntity(E){var $,B,ce;const ie=((ce=E)===null||ce===void 0||(B=ce.status)===null||B===void 0||($=B.items)===null||$===void 0?void 0:$.length)>0;return ie!==void 0&&this.value===ie}constructor(E){(0,w._)(this,"value",void 0),this.value=E}}var yt=n(96641),ft=n(76635),Je=n(19126),Ft=n.n(Je),$t=n(73557),Mt=n(69294),Se=n(48760),Be=n(90736);const Ge=(0,P.createContext)(void 0),et=y=>{const E=(0,Be.default)(),$=(0,p.h_)(V),[B,ce]=(0,P.useState)({}),ie=(0,$t.TH)();var z;const he=(0,P.useMemo)(()=>(z=Ft().parse(ie.search,{ignoreQueryPrefix:!0}).filters)!==null&&z!==void 0?z:{},[ie]),[Ae,Pe]=(0,P.useState)(()=>({appliedFilters:{},entities:[],backendEntities:[]})),[{loading:We,error:Ue},Ve]=(0,Mt.default)(async()=>{const De=(0,ft.compact)(Object.values(B)),Xe=(0,F.Gz)(De),Ct=(0,F.wq)(De),Qt=(0,F.wq)((0,ft.compact)(Object.values(Ae.appliedFilters))),jn=Object.keys(B).reduce((Lt,en)=>{var En;const vr=B[en];return!((En=vr)===null||En===void 0)&&En.toQueryValue&&(Lt[en]=vr.toQueryValue()),Lt},{});if((0,ft.isEqual)(Qt,Ct))Pe({appliedFilters:B,backendEntities:Ae.backendEntities,entities:Ae.backendEntities.filter(Xe)});else{const Lt=await $.getEntities({filter:Ct});Pe({appliedFilters:B,backendEntities:Lt.items,entities:Lt.items.filter(Xe)})}if(E()){var Pt;const Lt=Ft().parse(ie.search,{ignoreQueryPrefix:!0}),en=Ft().stringify({...Lt,filters:jn},{addQueryPrefix:!0,arrayFormat:"repeat"}),En=`${window.location.pathname}${en}`;(Pt=window.history)===null||Pt===void 0||Pt.replaceState(null,document.title,En)}},[$,he,B,Ae],{loading:!0});(0,Se.Z)(Ve,10,[B]);const lt=(0,P.useCallback)(De=>{ce(Xe=>{const Ct=typeof De=="function"?De(Xe):De;return{...Xe,...Ct}})},[]),St=(0,P.useMemo)(()=>({filters:Ae.appliedFilters,entities:Ae.entities,backendEntities:Ae.backendEntities,updateFilters:lt,queryParameters:he,loading:We,error:Ue}),[Ae,lt,he,We,Ue]);return(0,h.jsx)(Ge.Provider,{value:St,children:y.children})};function at(){const y=(0,P.useContext)(Ge);if(!y)throw new Error("useEntityList must be used within EntityListProvider");return y}var Tt=n(64279),pt=n(18149),xe=n.n(pt),G=n(829),pe=n.n(G);function Ee(){var y;const E=(0,p.h_)(V),{filters:{kind:$,type:B},queryParameters:{type:ce},updateFilters:ie}=at(),z=(0,P.useMemo)(()=>[ce].flat().filter(Boolean),[ce]);var he;const[Ae,Pe]=(0,P.useState)(z.length?z:(he=(y=B)===null||y===void 0?void 0:y.getTypes())!==null&&he!==void 0?he:[]);(0,P.useEffect)(()=>{z.length&&Pe(z)},[z]);const[We,Ue]=(0,P.useState)([]),Ve=(0,P.useMemo)(()=>{var Ct;return(Ct=$)===null||Ct===void 0?void 0:Ct.value},[$]),{error:lt,loading:St,value:De}=(0,Tt.default)(async()=>Ve?await E.getEntityFacets({filter:{kind:Ve},facets:["spec.type"]}).then(Qt=>Qt.facets["spec.type"]||[]):[],[Ve,E]),Xe=(0,P.useRef)(De);return(0,P.useEffect)(()=>{const Ct=Xe.current;if(Xe.current=De,St||!Ve||Ct===De||!De)return;const Qt=[...new Set(pe()(De,Pt=>-Pt.count).map(Pt=>Pt.value.toLocaleLowerCase("en-US")))];Ue(Qt);const jn=Ae.filter(Pt=>Qt.includes(Pt));xe()(Ae,jn)||Pe(jn)},[St,Ve,Ae,Pe,De]),(0,P.useEffect)(()=>{ie({type:Ae.length?new be(Ae):void 0})},[Ae,ie]),{loading:St,error:lt,availableTypes:We,selectedTypes:Ae,setSelectedTypes:Pe}}function He(y,E){var $,B,ce,ie;const z=(B=E)===null||B===void 0||($=B.type)===null||$===void 0?void 0:$.toLocaleLowerCase("en-US"),he=(ie=E)===null||ie===void 0||(ce=ie.kind)===null||ce===void 0?void 0:ce.toLocaleLowerCase("en-US"),Ae=(0,p.h_)(V),{loading:Pe,value:We,error:Ue}=(0,Tt.default)(async()=>{var Ve,lt;const St=(Ve=y.relations)===null||Ve===void 0?void 0:Ve.filter(Xe=>(!z||Xe.type.toLocaleLowerCase("en-US")===z)&&(!he||(0,R.of)(Xe.targetRef).kind===he));if(!(!((lt=St)===null||lt===void 0)&<.length))return[];const{items:De}=await Ae.getEntitiesByRefs({entityRefs:St.map(Xe=>Xe.targetRef)});return De.filter(Xe=>Boolean(Xe))},[y,z,he]);return{entities:We,loading:Pe,error:Ue}}var gt=n(72164);function Qe(y){return typeof y=="string"?y:(0,R.eE)(y)}function jt(){const y=(0,p.h_)(f),E=(0,gt.Z)(y.starredEntitie$(),new Set),$=(0,P.useCallback)(ce=>E.has(Qe(ce)),[E]),B=(0,P.useCallback)(ce=>y.toggleStarred(Qe(ce)).then(),[y]);return{starredEntities:E,toggleStarredEntity:B,isStarredEntity:$}}function an(y){return typeof y=="string"?y:(0,R.eE)(y)}function tn(y){const E=(0,p.h_)(f),[$,B]=(0,P.useState)(!1);return(0,P.useEffect)(()=>{const ie=E.starredEntitie$().subscribe({next(z){B(z.has(an(y)))}});return()=>{ie.unsubscribe()}},[y,E]),{toggleStarredEntity:(0,P.useCallback)(()=>E.toggleStarred(an(y)).then(),[y,E]),isStarredEntity:$}}var ln=n(75435);function fn(){const y=(0,p.h_)(p.$4),{loading:E,value:$}=(0,Tt.default)(async()=>{const{ownershipEntityRefs:ce}=await y.getBackstageIdentity();return ce},[]),B=(0,P.useMemo)(()=>{const ce=new Set($!=null?$:[]);return ie=>{const z=(0,ln.h)(ie,R.S4).map(R.eE);for(const he of z)if(ce.has(he))return!0;return!1}},[$]);return(0,P.useMemo)(()=>({loading:E,isOwnedEntity:B}),[E,B])}function dn(){const y=(0,p.h_)(V),{error:E,loading:$,value:B}=(0,Tt.default)(async()=>await y.getEntityFacets({facets:["kind"]}).then(ie=>{var z;return((z=ie.facets.kind)===null||z===void 0?void 0:z.map(he=>he.value).sort())||[]}),[y]);return{loading:$,error:E,allKinds:B!=null?B:[]}}function Bn(y,E,$){let B=y;return E&&(B=B.filter(ie=>E.some(z=>z.toLocaleLowerCase("en-US")===ie.toLocaleLowerCase("en-US")))),$&&!y.some(ie=>ie.toLocaleLowerCase("en-US")===$.toLocaleLowerCase("en-US"))&&(B=B.concat([$])),B.sort().reduce((ie,z)=>(ie[z.toLocaleLowerCase("en-US")]=z,ie),{})}function Fn(y){var E;const{filters:$,queryParameters:{kind:B},updateFilters:ce}=at(),ie=(0,P.useMemo)(()=>[B].flat()[0],[B]);var z;const[he,Ae]=(0,P.useState)((z=ie!=null?ie:(E=$.kind)===null||E===void 0?void 0:E.value)!==null&&z!==void 0?z:y.initialFilter);(0,P.useEffect)(()=>{ie&&Ae(ie)},[ie]),(0,P.useEffect)(()=>{var Ve;if(!((Ve=$.kind)===null||Ve===void 0)&&Ve.value){var lt;Ae((lt=$.kind)===null||lt===void 0?void 0:lt.value)}},[$.kind]),(0,P.useEffect)(()=>{ce({kind:he?new ve(he):void 0})},[he,ce]);const{allKinds:Pe,loading:We,error:Ue}=dn();return{loading:We,error:Ue,allKinds:Pe!=null?Pe:[],selectedKind:he,setSelectedKind:Ae}}const ot=y=>{const{allowedKinds:E,hidden:$,initialFilter:B="component"}=y,ce=(0,p.h_)(p.$v),{error:ie,allKinds:z,selectedKind:he,setSelectedKind:Ae}=Fn({initialFilter:B});if((0,P.useEffect)(()=>{ie&&ce.post({message:"Failed to load entity kinds",severity:"error"})},[ie,ce]),ie)return null;const Pe=Bn(z,E,he),We=Object.keys(Pe).map(Ue=>({value:Ue,label:Pe[Ue]}));return $?null:(0,h.jsx)(Z.Z,{pb:1,pt:1,children:(0,h.jsx)(T.Ph,{label:"Kind",items:We,selected:he.toLocaleLowerCase("en-US"),onChange:Ue=>Ae(String(Ue))})})};var on=n(79692),Vt=n(38016),st=n(88013),Sn=n(21324),qt=n(5806),Cn=n(19996),yn=n(25505);const Hn=(0,h.jsx)(yn.Z,{fontSize:"small"}),fr=(0,h.jsx)(Cn.Z,{fontSize:"small"});function $n({selected:y}){return(0,h.jsx)(Sn.Z,{icon:Hn,checkedIcon:fr,checked:y})}const _n=(0,P.memo)(y=>{var E;const{selected:$,value:B,availableOptions:ce,showCounts:ie}=y,z=ie?`${B} (${(E=ce)===null||E===void 0?void 0:E[B]})`:B;return(0,h.jsx)(qt.Z,{control:(0,h.jsx)($n,{selected:$}),label:z,onClick:he=>he.preventDefault()})});var Zn=n(86619),Cr=n(72779),Gn=n.n(Cr);const Re=(0,on.Z)({input:{}},{name:"CatalogReactEntityAutocompletePickerInput"});function ne(y){const E=Re();return(0,h.jsx)(Zn.Z,{variant:"outlined",...y,className:Gn()(E.input,y.className)})}function Te(y){var E;const{label:$,name:B,path:ce,showCounts:ie,Filter:z,InputProps:he,initialSelectedOptions:Ae=[]}=y,{updateFilters:Pe,filters:We,queryParameters:{[B]:Ue}}=at(),Ve=(0,p.h_)(V),{value:lt}=(0,Tt.default)(async()=>{var Lt;const en=ce,{facets:En}=await Ve.getEntityFacets({facets:[en],filter:(Lt=We.kind)===null||Lt===void 0?void 0:Lt.getCatalogFilters()});return Object.fromEntries(En[en].map(({value:vr,count:$r})=>[vr,$r]))},[We.kind]),St=(0,P.useMemo)(()=>[Ue].flat().filter(Boolean),[Ue]);var De;const[Xe,Ct]=(0,P.useState)(St.length?St:(De=(E=We[B])===null||E===void 0?void 0:E.values)!==null&&De!==void 0?De:Ae);(0,P.useEffect)(()=>{St.length&&Ct(St)},[St]);const Qt=Object.keys(lt!=null?lt:{}),jn=Xe.length&&Qt.length;(0,P.useEffect)(()=>{Pe({[B]:jn?new z(Xe):void 0})},[B,jn,Xe,z,Pe]);const Pt=We[B];return Pt&&typeof Pt=="object"&&!("values"in Pt)||!Qt.length||Qt.length<=1?null:(0,h.jsx)(Z.Z,{pb:1,pt:1,children:(0,h.jsxs)(j.Z,{variant:"button",component:"label",children:[$,(0,h.jsx)(st.ZP,{multiple:!0,disableCloseOnSelect:!0,options:Qt,value:Xe,onChange:(Lt,en)=>Ct(en),renderOption:(Lt,{selected:en})=>(0,h.jsx)(_n,{selected:en,value:Lt,availableOptions:lt,showCounts:!!ie}),size:"small",popupIcon:(0,h.jsx)(Vt.Z,{"data-testid":`${String(B)}-picker-expand`}),renderInput:Lt=>(0,h.jsx)(ne,{...Lt,...he})})]})})}const ze=(0,on.Z)({input:{}},{name:"CatalogReactEntityLifecyclePicker"}),ct=y=>{const{initialFilter:E=[]}=y,$=ze();return(0,h.jsx)(Te,{label:"Lifecycle",name:"lifecycles",path:"spec.lifecycle",Filter:Nt,InputProps:{className:$.input},initialSelectedOptions:E})};var Rt=n(6232),Ht=n(98685),nn=n(62367),gn=n(72579),sn=n.n(gn);function hn(y,E){var $,B;const ce=($=E)===null||$===void 0?void 0:$.defaultKind;let ie,z,he;if("metadata"in y?(ie=y.kind,z=y.metadata.namespace,he=y.metadata.name):(ie=y.kind,z=y.namespace,he=y.name),(z===void 0||z==="")&&(z=R.zG),((B=E)===null||B===void 0?void 0:B.defaultNamespace)!==void 0){var Ae;((Ae=E)===null||Ae===void 0?void 0:Ae.defaultNamespace)===z&&(z=void 0)}else z===R.zG&&(z=void 0);return ie=ie.toLocaleLowerCase("en-US"),ie=ce&&ce.toLocaleLowerCase("en-US")===ie?void 0:ie,`${ie?`${ie}:`:""}${z?`${z}/`:""}${he}`}function le(y,E){for(const $ of["spec.profile.displayName","metadata.title"]){const B=sn()(y,$);if(B&&typeof B=="string")return B}return E}function de({enabled:y}){const E=(0,p.h_)(V),[$]=(0,P.useState)(async()=>{if(!y)return[];const B="relations.ownedBy";return E.getEntityFacets({facets:[B]}).then(ce=>ce.facets[B].map(ie=>ie.value).map(ie=>{const{kind:z,name:he,namespace:Ae}=(0,R.of)(ie);return{apiVersion:"backstage.io/v1beta1",kind:z,metadata:{name:he,namespace:Ae}}}).sort((ie,z)=>(ie.metadata.namespace||"").localeCompare(z.metadata.namespace||"","en-US")||ie.metadata.name.localeCompare(z.metadata.name,"en-US")||ie.kind.localeCompare(z.kind,"en-US"))).catch(()=>[])});return(0,Mt.default)(async(B,ce)=>{var ie;const z=await $;if(!z)return{items:[]};var he;const Ae=(he=(ie=ce)===null||ie===void 0?void 0:ie.limit)!==null&&he!==void 0?he:20,{text:Pe,start:We}=Y(B),Ue=z.filter(lt=>M(Pe,lt)),Ve=We+Ae;return{items:Ue.slice(0,Ve),...L({entities:Ue,limit:Ve,payload:{text:Pe,start:Ve}})}},[$],{loading:!0,value:{items:[]}})}function Y(y){return v(y)&&y.cursor?JSON.parse(atob(y.cursor)):{text:y.text||"",start:0}}function v(y){return!!y.cursor}function L({entities:y,limit:E,payload:$}){return y.length>E?{cursor:btoa(JSON.stringify($))}:{}}function M(y,E){var $;const B=y.trim();return E.kind.includes(B)||(($=E.metadata.namespace)===null||$===void 0?void 0:$.includes(B))||E.metadata.name.includes(B)}function W(){const y=(0,p.h_)(V);return(0,Mt.default)(async(E,$)=>{var B;const ce=E,ie=E;var z;const he=(z=(B=$)===null||B===void 0?void 0:B.limit)!==null&&z!==void 0?z:20;if(ie.cursor){const Pe=await y.queryEntities({cursor:ie.cursor,limit:he});return{cursor:Pe.pageInfo.nextCursor,items:[...ie.items,...Pe.items]}}const Ae=await y.queryEntities({fullTextFilter:{term:ce.text||"",fields:["metadata.name","kind","spec.profile.displayname","metadata.title"]},filter:{kind:["User","Group"]},orderFields:[{field:"metadata.name",order:"asc"}],limit:he});return{cursor:Ae.pageInfo.nextCursor,items:Ae.items}},[],{loading:!0})}var ue=n(21638);function Ce({mode:y,initialSelectedOwnersRefs:E}){const $=y==="owners-only",B=W(),ce=de({enabled:$}),[ie,z]=$?ce:B;return[ie,z,Oe({enabled:!$,initialSelectedOwnersRefs:E})]}function Oe({enabled:y,initialSelectedOwnersRefs:E}){const $=(0,P.useRef)({}),B=(0,p.h_)(V),[,ce]=(0,Mt.default)(async()=>{(await B.getEntitiesByRefs({entityRefs:E})).items.forEach(z=>{z&&($.current[(0,R.eE)(z)]=z)})},[]);return(0,ue.n)(()=>{y&&E.length>0&&ce()}),{getEntity:ie=>$.current[ie],setEntity:ie=>{$.current[(0,R.eE)(ie)]=ie}}}const tt=(0,on.Z)({input:{}},{name:"CatalogReactEntityOwnerPicker"}),nt=(0,h.jsx)(yn.Z,{fontSize:"small"}),mt=(0,h.jsx)(Cn.Z,{fontSize:"small"}),xt=y=>{var E,$,B;const ce=tt(),{mode:ie="owners-only"}=y||{},{updateFilters:z,filters:he,queryParameters:{owners:Ae}}=at(),[Pe,We]=(0,P.useState)(""),Ue=(0,P.useMemo)(()=>[Ae].flat().filter(Boolean),[Ae]);var Ve;const[lt,St]=(0,P.useState)(Ue.length?Ue:(Ve=(E=he.owners)===null||E===void 0?void 0:E.values)!==null&&Ve!==void 0?Ve:[]),[{value:De,loading:Xe},Ct,Qt]=Ce({mode:ie,initialSelectedOwnersRefs:lt});(0,Rt.b)(()=>Ct({text:Pe}),[Pe,Ct],250);const jn=(($=De)===null||$===void 0?void 0:$.items)||[];return(0,P.useEffect)(()=>{if(Ue.length){const Pt=new ht(Ue);St(Pt.values)}},[Ue]),(0,P.useEffect)(()=>{z({owners:lt.length?new ht(lt):void 0})},[lt,z]),["user","group"].includes(((B=he.kind)===null||B===void 0?void 0:B.value.toLocaleLowerCase("en-US"))||"")?null:(0,h.jsx)(Z.Z,{pb:1,pt:1,children:(0,h.jsxs)(j.Z,{variant:"button",component:"label",children:["Owner",(0,h.jsx)(st.ZP,{multiple:!0,disableCloseOnSelect:!0,loading:Xe,options:jn,value:lt,getOptionSelected:(Pt,Lt)=>typeof Lt=="string"?(0,R.eE)(Pt)===Lt:Pt===Lt,getOptionLabel:Pt=>{const Lt=typeof Pt=="string"?Qt.getEntity(Pt)||(0,R.of)(Pt,{defaultKind:"group",defaultNamespace:"default"}):Pt;return le(Lt,hn(Lt))},onChange:(Pt,Lt)=>{We(""),St(Lt.map(en=>{const En=typeof en=="string"?en:(0,R.eE)(en);return typeof en!="string"&&Qt.setEntity(en),En}))},filterOptions:Pt=>Pt,renderOption:(Pt,{selected:Lt})=>{const en=Pt.kind.toLocaleLowerCase("en-US")==="group";return(0,h.jsx)(qt.Z,{control:(0,h.jsx)(Sn.Z,{icon:nt,checkedIcon:mt,checked:Lt}),onClick:En=>En.preventDefault(),label:(0,h.jsxs)(Z.Z,{display:"flex",flexWrap:"wrap",alignItems:"center",children:[en?(0,h.jsx)(nn.Z,{fontSize:"small"}):(0,h.jsx)(Ht.Z,{fontSize:"small"}),"\xA0",le(Pt,hn(Pt,{defaultKind:Pt.kind}))]})})},size:"small",popupIcon:(0,h.jsx)(Vt.Z,{"data-testid":"owner-picker-expand"}),renderInput:Pt=>(0,h.jsx)(Zn.Z,{...Pt,className:ce.input,onChange:Lt=>{We(Lt.currentTarget.value)},variant:"outlined"}),ListboxProps:{onScroll:Pt=>{var Lt;const en=Pt.currentTarget;Math.abs(en.scrollHeight-en.clientHeight-en.scrollTop)<1&&(!((Lt=De)===null||Lt===void 0)&&Lt.cursor)&&Ct({items:De.items,cursor:De.cursor})},"data-testid":"owner-picker-listbox"}})]})})};var it=n(51837);const $e=(0,it.uW)("catalog:entity-route-ref",()=>(0,p.NT)({id:"catalog:entity",params:["namespace","kind","name"]}));function vt(y){var E,$;return{kind:y.kind.toLocaleLowerCase("en-US"),namespace:($=(E=y.metadata.namespace)===null||E===void 0?void 0:E.toLocaleLowerCase("en-US"))!==null&&$!==void 0?$:DEFAULT_NAMESPACE,name:y.metadata.name}}var Xt=n(80030);const Et=(0,P.forwardRef)((y,E)=>{var $;const{entityRef:B,defaultKind:ce,title:ie,children:z,...he}=y,Ae=(0,p.tg)($e);let Pe,We,Ue;if(typeof B=="string"){const Xe=(0,R.of)(B);Pe=Xe.kind,We=Xe.namespace,Ue=Xe.name}else"metadata"in B?(Pe=B.kind,We=B.metadata.namespace,Ue=B.metadata.name):(Pe=B.kind,We=B.namespace,Ue=B.name);Pe=Pe.toLocaleLowerCase("en-US");var Ve;We=(Ve=($=We)===null||$===void 0?void 0:$.toLocaleLowerCase("en-US"))!==null&&Ve!==void 0?Ve:R.zG;const lt={kind:Pe,namespace:We,name:Ue},St=hn({kind:Pe,namespace:We,name:Ue},{defaultKind:ce}),De=(0,h.jsxs)(T.rU,{...he,ref:E,to:Ae(lt),children:[z,!z&&(ie!=null?ie:St)]});return ie?(0,h.jsx)(Xt.ZP,{title:St,children:De}):De});function Zt(y){const{entityRefs:E,defaultKind:$,getTitle:B,...ce}=y,ie=(0,p.h_)(V),{value:z=new Array,loading:he,error:Ae}=(0,Tt.default)(async()=>{const Pe=E.reduce((Ue,Ve)=>typeof Ve=="object"&&"metadata"in Ve?Ue:[...Ue,(0,R.of)(Ve)],new Array),We=E.filter(Ue=>typeof Ue=="object"&&"metadata"in Ue);return Pe.length>0?[...(await ie.getEntities({filter:Pe.map(Ue=>({kind:Ue.kind,"metadata.namespace":Ue.namespace,"metadata.name":Ue.name}))})).items,...We]:We},[E]);return he?(0,h.jsx)(T.Ex,{}):Ae?(0,h.jsx)(T.yu,{error:Ae}):(0,h.jsx)(h.Fragment,{children:z.map((Pe,We)=>(0,h.jsxs)(P.Fragment,{children:[We>0&&", ",(0,h.jsx)(Et,{...ce,defaultKind:$,entityRef:Pe,title:B(Pe)})]},We))})}function _t(y){const{entityRefs:E,defaultKind:$,fetchEntities:B,getTitle:ce,...ie}=y;return B?(0,h.jsx)(Zt,{...ie,defaultKind:$,entityRefs:E,getTitle:ce}):(0,h.jsx)(h.Fragment,{children:E.map((z,he)=>(0,h.jsxs)(P.Fragment,{children:[he>0&&", ",(0,h.jsx)(Et,{...ie,defaultKind:$,entityRef:z,title:ce?ce(z):void 0})]},he))})}const wn=y=>{const E=useRouteRef(entityRouteRef);return _jsx(IconButton,{component:Link,"aria-label":"Show",title:"Show details",to:E(getCompoundEntityRef(y.entity)),children:_jsx(InfoIcon,{})})},Kt=y=>_jsx(IconButton,{component:Link,"aria-label":"Email",title:`Email ${y.email}`,to:`mailto:${y.email}`,children:_jsx(EmailIcon,{})}),bt=y=>{var E;const $=(E=y.entity.spec.profile)===null||E===void 0?void 0:E.email;return $?_jsx(EmailCardAction,{email:$}):null},It=y=>{var E;const $=(E=y.entity.spec.profile)===null||E===void 0?void 0:E.email;return $?_jsx(EmailCardAction,{email:$}):null},Yt=(0,on.Z)(()=>({popoverPaper:{width:"30em"},descriptionTypography:{overflow:"hidden",textOverflow:"ellipsis",display:"-webkit-box",WebkitLineClamp:2,WebkitBoxOrient:"vertical"}})),zt=4,gr=y=>{var E,$,B;const{entityRef:ce,children:ie,delayTime:z=500}=y,he=Yt(),Ae=useApiHolder(),Pe=usePopupState({variant:"popover",popupId:"entity-peek-ahead"}),[We,Ue]=useState(!1),Ve=useMemo(()=>debounce(()=>Ue(!0),z),[z]),[{loading:lt,error:St,value:De},Xe]=useAsyncFn(async()=>{const Qt=Ae.get(catalogApiRef);if(Qt){const jn=await Qt.getEntityByRef(ce);if(!jn)throw new Error(`${ce} not found`);return jn}},[Ae,ce]),Ct=()=>{Ue(!1),Ve.cancel()};return useEffect(()=>{Pe.isOpen&&!De&&!St&&!lt&&Xe()},[Pe.isOpen,Xe,De,St,lt]),_jsxs(_Fragment,{children:[_jsx(Typography,{component:"span",onMouseEnter:Ve,children:_jsx(Typography,{component:"span","data-testid":"trigger",...bindHover(Pe),children:ie})}),We&&_jsx(HoverPopover,{PaperProps:{className:he.popoverPaper},...bindPopover(Pe),anchorOrigin:{vertical:"bottom",horizontal:"center"},transformOrigin:{vertical:"top",horizontal:"center"},onMouseLeave:Ct,children:_jsxs(Card,{children:[_jsxs(CardContent,{children:[St&&_jsx(ResponseErrorPanel,{error:St}),lt&&_jsx(Progress,{}),De&&_jsxs(_Fragment,{children:[_jsx(Typography,{color:"textSecondary",children:De.metadata.namespace}),_jsx(Typography,{variant:"h5",component:"div",children:De.metadata.name}),_jsx(Typography,{color:"textSecondary",gutterBottom:!0,children:De.kind}),De.metadata.description&&_jsx(Typography,{className:he.descriptionTypography,paragraph:!0,children:De.metadata.description}),_jsx(Typography,{children:(E=De.spec)===null||E===void 0?void 0:E.type}),_jsxs(Box,{marginTop:"0.5em",children:[(De.metadata.tags||[]).slice(0,zt).map(Qt=>_jsx(Chip,{size:"small",label:Qt},Qt)),(($=De.metadata.tags)===null||$===void 0?void 0:$.length)&&((B=De.metadata.tags)===null||B===void 0?void 0:B.length)>zt&&_jsx(Tooltip,{title:"Drill into the entity to see all of the tags.",children:_jsx(Chip,{size:"small",label:"..."},"other-tags")})]})]})]}),!St&&De&&_jsx(CardActions,{children:_jsxs(_Fragment,{children:[isUserEntity(De)&&_jsx(UserCardActions,{entity:De}),isGroupEntity(De)&&_jsx(GroupCardActions,{entity:De}),_jsx(EntityCardActions,{entity:De})]})})]})})]})},er=(0,on.Z)(y=>({searchToolbar:{paddingLeft:0,paddingRight:0},input:{}}),{name:"CatalogReactEntitySearchBar"}),ir=()=>{var y;const E=er(),{filters:$,updateFilters:B}=useEntityList();var ce;const[ie,z]=useState((ce=(y=$.text)===null||y===void 0?void 0:y.value)!==null&&ce!==void 0?ce:"");return useDebounce(()=>{B({text:ie.length?new EntityTextFilter(ie):void 0})},250,[ie,B]),_jsx(Toolbar,{className:E.searchToolbar,children:_jsx(FormControl,{children:_jsx(Input,{"aria-label":"search",id:"input-with-icon-adornment",className:E.input,placeholder:"Search",autoComplete:"off",onChange:he=>z(he.target.value),value:ie,startAdornment:_jsx(InputAdornment,{position:"start",children:_jsx(Search,{})}),endAdornment:_jsx(InputAdornment,{position:"end",children:_jsx(IconButton,{"aria-label":"clear search",onClick:()=>z(""),edge:"end",disabled:ie.length===0,children:_jsx(Clear,{})})})})})})},bn=Object.freeze({createEntityRefColumn(y){const{defaultKind:E}=y;function $(B){var ce;return((ce=B.metadata)===null||ce===void 0?void 0:ce.title)||hn(B,{defaultKind:E})}return{title:"Name",highlight:!0,customFilterAndSearch(B,ce){return $(ce).includes(B)},customSort(B,ce){return $(B).localeCompare($(ce))},render:B=>{var ce;return(0,h.jsx)(Et,{entityRef:B,defaultKind:E,title:(ce=B.metadata)===null||ce===void 0?void 0:ce.title})}}},createEntityRelationColumn(y){const{title:E,relation:$,defaultKind:B,filter:ce}=y;function ie(he){return(0,F.hF)(he,$,ce)}function z(he){return ie(he).map(Ae=>hn(Ae,{defaultKind:B})).join(", ")}return{title:E,customFilterAndSearch(he,Ae){return z(Ae).includes(he)},customSort(he,Ae){return z(he).localeCompare(z(Ae))},render:he=>(0,h.jsx)(_t,{entityRefs:ie(he),defaultKind:B})}},createOwnerColumn(){return this.createEntityRelationColumn({title:"Owner",relation:R.S4,defaultKind:"group"})},createDomainColumn(){return this.createEntityRelationColumn({title:"Domain",relation:R.cz,defaultKind:"domain",filter:{kind:"domain"}})},createSystemColumn(){return this.createEntityRelationColumn({title:"System",relation:R.cz,defaultKind:"system",filter:{kind:"system"}})},createMetadataDescriptionColumn(){return{title:"Description",field:"metadata.description",render:y=>(0,h.jsx)(T.Or,{text:y.metadata.description,placement:"bottom-start",line:2})}},createSpecLifecycleColumn(){return{title:"Lifecycle",field:"spec.lifecycle"}},createSpecTypeColumn(){return{title:"Type",field:"spec.type"}}}),ar=[bn.createEntityRefColumn({defaultKind:"system"}),bn.createDomainColumn(),bn.createOwnerColumn(),bn.createMetadataDescriptionColumn()],Kn=[bn.createEntityRefColumn({defaultKind:"component"}),bn.createSystemColumn(),bn.createOwnerColumn(),bn.createSpecTypeColumn(),bn.createSpecLifecycleColumn(),bn.createMetadataDescriptionColumn()],zr=(0,on.Z)(y=>({empty:{padding:y.spacing(2),display:"flex",justifyContent:"center"}})),tr=y=>{const{entities:E,title:$,emptyContent:B,variant:ce="gridItem",columns:ie,tableOptions:z={}}=y,he=zr(),Ae={minWidth:"0",width:"100%"};return ce==="gridItem"&&(Ae.height="calc(100% - 10px)"),(0,h.jsx)(T.iA,{columns:ie,title:$,style:Ae,emptyContent:B&&(0,h.jsx)("div",{className:he.empty,children:B}),options:{search:!1,paging:!1,actionsColumnIndex:-1,padding:"dense",draggable:!1,...z},data:E})};tr.columns=bn,tr.systemEntityColumns=ar,tr.componentEntityColumns=Kn;const Gr=(0,on.Z)({input:{}},{name:"CatalogReactEntityTagPicker"}),Or=y=>{const E=Gr();return(0,h.jsx)(Te,{label:"Tags",name:"tags",path:"metadata.tags",Filter:k,showCounts:y.showCounts,InputProps:{className:E.input}})},S=y=>{const{hidden:E,initialFilter:$}=y,B=(0,p.h_)(p.$v),{error:ce,availableTypes:ie,selectedTypes:z,setSelectedTypes:he}=Ee();if((0,P.useEffect)(()=>{ce&&B.post({message:"Failed to load entity types",severity:"error"}),$&&he([$])},[ce,B,$,he]),ie.length===0||ce)return null;const Ae=[{value:"all",label:"all"},...ie.map(We=>({value:We,label:We}))];var Pe;return E?null:(0,h.jsx)(Z.Z,{pb:1,pt:1,children:(0,h.jsx)(T.Ph,{label:"Type",items:Ae,selected:(Pe=Ae.length>1?z[0]:void 0)!==null&&Pe!==void 0?Pe:"all",onChange:We=>he(We==="all"?[]:[String(We)])})})};var d=n(15459),C=n(61837),A=n(11640),K=n(28347);const ye=(0,d.Z)({root:{color:"#f3ba37"}})(A.Z),we=y=>{const{toggleStarredEntity:E,isStarredEntity:$}=tn(y.entity);return(0,h.jsx)(C.Z,{"aria-label":"favorite",color:"inherit",...y,onClick:()=>E(),children:(0,h.jsx)(Xt.ZP,{title:$?"Remove from favorites":"Add to favorites",children:$?(0,h.jsx)(ye,{}):(0,h.jsx)(K.Z,{})})})};var Ze=n(8629),qe=n(79249),Jt=n(38724),cn=n(99152),pn=n(6487),In=n(49429),Wt=n(55999),un=n(39412);const lr=un.Z;function cr(y,E){if(y)return y.toLocaleLowerCase("en-US");if(E)try{return(0,R.of)(E).kind.toLocaleLowerCase("en-US")}catch{return}}function wr(y,E){const $=(0,p.qD)(),B=cr(y,E);return B&&$.getSystemIcon(`kind:${B}`)||lr}function Yn(y){const{kind:E,entityRef:$,...B}=y,ce=wr(E,$);return(0,h.jsx)(ce,{...B})}const jo=(0,on.Z)(y=>({node:{fill:y.palette.grey[300],stroke:y.palette.grey[300],"&.primary":{fill:y.palette.primary.light,stroke:y.palette.primary.light},"&.secondary":{fill:y.palette.secondary.light,stroke:y.palette.secondary.light}},text:{fill:y.palette.getContrastText(y.palette.grey[300]),"&.primary":{fill:y.palette.primary.contrastText},"&.secondary":{fill:y.palette.secondary.contrastText},"&.focused":{fontWeight:"bold"}},clickable:{cursor:"pointer"}}));function Vo(y){var E,$;const B=(0,p.h_)(V),ce=(0,R.eE)(y),{loading:ie,error:z,value:he}=(0,Tt.default)(async()=>{const Ae=await B.getEntityAncestors({entityRef:ce}),Pe=new Array,We=new Array;for(const Ue of Ae.items){const Ve=(0,R.eE)(Ue.entity),lt=Ve===Ae.rootEntityRef;Pe.push({id:Ve,root:lt,...Ue.entity});for(const St of Ue.parentEntityRefs)We.push({from:Ve,to:St})}return{nodes:Pe,edges:We}},[ce]);return{loading:ie,error:z,nodes:((E=he)===null||E===void 0?void 0:E.nodes)||[],edges:(($=he)===null||$===void 0?void 0:$.edges)||[]}}function Ho({node:y}){const E=jo(),$=(0,$t.s0)(),B=(0,p.tg)($e),[ce,ie]=(0,P.useState)(0),[z,he]=(0,P.useState)(0),Ae=(0,P.useRef)(null);(0,P.useLayoutEffect)(()=>{if(Ae.current){let{height:Xe,width:Ct}=Ae.current.getBBox();Xe=Math.round(Xe),Ct=Math.round(Ct),(Xe!==z||Ct!==ce)&&(ie(Ct),he(Xe))}},[ce,z]);const Pe=10,We=z,Ue=We+Pe,Ve=Ue+ce+Pe*2,lt=z+Pe*2,St=y.metadata.title||(y.kind&&y.metadata.name&&y.metadata.namespace?hn({kind:y.kind,name:y.metadata.name,namespace:y.metadata.namespace||""}):y.id),De=()=>{$(B({kind:y.kind,namespace:y.metadata.namespace||R.zG,name:y.metadata.name}))};return(0,h.jsxs)("g",{onClick:De,className:E.clickable,children:[(0,h.jsx)("rect",{className:Gn()(E.node,y.root?"secondary":"primary"),width:Ve,height:lt,rx:10}),(0,h.jsx)(Yn,{kind:y.kind,y:Pe,x:Pe,width:We,height:We,className:Gn()(E.text,y.root?"secondary":"primary")}),(0,h.jsx)("text",{ref:Ae,className:Gn()(E.text,y.root?"secondary":"primary"),y:lt/2,x:Ue+(ce+Pe*2)/2,textAnchor:"middle",alignmentBaseline:"middle",children:St})]})}function _r(y){const{loading:E,error:$,nodes:B,edges:ce}=Vo(y.entity);return E?(0,h.jsx)(T.Ex,{}):$?(0,h.jsx)(T.Gk,{error:$}):(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(Wt.Z,{variant:"h2",children:"Ancestry"}),(0,h.jsxs)(Wt.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,h.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,h.jsx)(Z.Z,{mt:4,children:(0,h.jsx)(T.mn,{nodes:B,edges:ce,renderNode:Ho,direction:T.NX.Direction.BOTTOM_TOP,zoom:"enable-on-click"})})]})}var kr=n(11776),mr=n(38402),Kr=n(86136),eo=n(99688),Eo=n(49378),Go=n(54506),to=n(94339),Ko=n(24579),Ao=n(27685);const Pn=(0,on.Z)(y=>({root:{display:"flex",flexDirection:"column"},marginTop:{marginTop:y.spacing(2)},helpIcon:{marginLeft:y.spacing(1),color:y.palette.text.disabled},monospace:{fontFamily:"monospace"}}));function nr(y){const E=Pn();return(0,h.jsx)(Eo.Z,{...y,primaryTypographyProps:{className:E.monospace},secondaryTypographyProps:{className:E.monospace}})}function no(y){const E=Pn();return(0,h.jsx)(Go.Z,{className:E.monospace,children:y.children})}function ro(y){return(0,h.jsx)(Z.Z,{mt:2,children:(0,h.jsx)(to.Z,{variant:"outlined",children:(0,h.jsxs)(Ko.Z,{children:[(0,h.jsxs)(j.Z,{variant:"h6",gutterBottom:!0,children:[y.title,y.helpLink&&(0,h.jsx)(go,{to:y.helpLink})]}),y.children]})})})}function Yo(y){if(y.match(/^url:https?:\/\//))return y.slice(4);if(y.match(/^https?:\/\//))return y}function fo(y){const[E,$]=y.entry,B=Yo($);return(0,h.jsxs)(mr.Z,{children:[y.indent&&(0,h.jsx)(Kr.Z,{}),(0,h.jsx)(nr,{primary:E,secondary:B?(0,h.jsx)(T.rU,{to:B,children:$}):$})]})}function go(y){const E=Pn();return(0,h.jsx)(T.rU,{to:y.to,className:E.helpIcon,children:(0,h.jsx)(Ao.Z,{fontSize:"inherit"})})}const To=(0,on.Z)({root:{display:"flex",flexDirection:"column"}});function Ro(y){var E,$,B;const ce=(0,p.h_)(V),ie=(0,R.eE)(y),z=(E=y.metadata.annotations)===null||E===void 0?void 0:E[R.P1],he=($=y.metadata.annotations)===null||$===void 0?void 0:$[R.q1],{loading:Ae,error:Pe,value:We}=(0,Tt.default)(async()=>!z&&!he?[]:(await ce.getEntities({filter:[...z?[{[`metadata.annotations.${R.P1}`]:z}]:[],...he?[{[`metadata.annotations.${R.q1}`]:he}]:[]]})).items,[z,he]);return{loading:Ae,error:Pe,location:z,originLocation:he,colocatedEntities:(B=We)===null||B===void 0?void 0:B.filter(Ue=>(0,R.eE)(Ue)!==ie)}}function rr(y){return(0,h.jsxs)(kr.Z,{dense:!0,children:[y.header&&(0,h.jsx)(fo,{entry:y.header},"header"),y.entities.map(E=>(0,h.jsxs)(mr.Z,{children:[(0,h.jsx)(Kr.Z,{children:(0,h.jsx)(Yn,{kind:E.kind})}),(0,h.jsx)(nr,{primary:(0,h.jsx)(Et,{entityRef:E})})]},(0,R.eE)(E)))]})}function js(y){var E;const{entity:$}=y,{loading:B,error:ce,location:ie,originLocation:z,colocatedEntities:he}=Ro($);if(B)return(0,h.jsx)(T.Ex,{});if(ce)return(0,h.jsx)(T.Gk,{error:ce});if(!ie&&!z)return(0,h.jsx)(eo.Z,{severity:"warning",children:"Entity had no location information."});if(!(!((E=he)===null||E===void 0)&&E.length))return(0,h.jsx)(eo.Z,{severity:"info",children:"There were no other entities on this location."});if(ie===z)return(0,h.jsx)(rr,{entities:he});const Ae=he.filter(We=>{var Ue;return((Ue=We.metadata.annotations)===null||Ue===void 0?void 0:Ue[R.P1])===ie}),Pe=he.filter(We=>{var Ue;return((Ue=We.metadata.annotations)===null||Ue===void 0?void 0:Ue[R.q1])===z});return(0,h.jsxs)(h.Fragment,{children:[Ae.length>0&&(0,h.jsx)(rr,{entities:Ae,header:["At the same location",ie]}),Pe.length>0&&(0,h.jsx)(rr,{entities:Pe,header:["At the same origin",z]})]})}function Io(y){const E=To();return(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(Wt.Z,{variant:"h2",children:"Colocated"}),(0,h.jsx)(Wt.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,h.jsx)("div",{className:E.root,children:(0,h.jsx)(js,{entity:y.entity})})]})}function mo(y){return Object.fromEntries([...Object.entries(y)].sort((E,$)=>E[0]<$[0]?-1:1))}function Jo(y){return(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(Wt.Z,{variant:"h2",children:"Entity as JSON"}),(0,h.jsx)(Wt.Z,{children:"This is the raw entity data as received from the catalog, on JSON form."}),(0,h.jsx)(Wt.Z,{children:(0,h.jsx)("div",{style:{fontSize:"75%"},"data-testid":"code-snippet",children:(0,h.jsx)(T.Oi,{text:JSON.stringify(mo(y.entity),void 0,2),language:"json",showCopyCodeButton:!0})})})]})}var Es=n(3440),vo=n.n(Es);const Qo=(0,on.Z)({root:{display:"flex",flexDirection:"column"}});function As(y){var E,$,B;const ce=Qo(),{apiVersion:ie,kind:z,metadata:he,spec:Ae,relations:Pe=[],status:We={}}=y.entity,Ue=vo()(pe()(Pe,Ve=>Ve.targetRef),"type");return(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(Wt.Z,{variant:"h2",children:"Overview"}),(0,h.jsxs)("div",{className:ce.root,children:[(0,h.jsx)(ro,{title:"Identity",children:(0,h.jsxs)(kr.Z,{dense:!0,children:[(0,h.jsx)(mr.Z,{children:(0,h.jsx)(nr,{primary:"apiVersion",secondary:ie})}),(0,h.jsx)(mr.Z,{children:(0,h.jsx)(nr,{primary:"kind",secondary:z})}),((E=Ae)===null||E===void 0?void 0:E.type)&&(0,h.jsx)(mr.Z,{children:(0,h.jsx)(nr,{primary:"spec.type",secondary:Ae.type})}),he.uid&&(0,h.jsx)(mr.Z,{children:(0,h.jsx)(nr,{primary:"uid",secondary:he.uid})}),he.etag&&(0,h.jsx)(mr.Z,{children:(0,h.jsx)(nr,{primary:"etag",secondary:he.etag})})]})}),(0,h.jsxs)(ro,{title:"Metadata",children:[!!Object.keys(he.annotations||{}).length&&(0,h.jsx)(kr.Z,{dense:!0,subheader:(0,h.jsxs)(no,{children:["Annotations",(0,h.jsx)(go,{to:"https://backstage.io/docs/features/software-catalog/well-known-annotations"})]}),children:Object.entries(he.annotations).map(Ve=>(0,h.jsx)(fo,{indent:!0,entry:Ve},Ve[0]))}),!!Object.keys(he.labels||{}).length&&(0,h.jsx)(kr.Z,{dense:!0,subheader:(0,h.jsx)(no,{children:"Labels"}),children:Object.entries(he.labels).map(Ve=>(0,h.jsx)(fo,{indent:!0,entry:Ve},Ve[0]))}),!!(!(($=he.tags)===null||$===void 0)&&$.length)&&(0,h.jsx)(kr.Z,{dense:!0,subheader:(0,h.jsx)(no,{children:"Tags"}),children:he.tags.map((Ve,lt)=>(0,h.jsxs)(mr.Z,{children:[(0,h.jsx)(Kr.Z,{}),(0,h.jsx)(nr,{primary:Ve})]},`${Ve}-${lt}`))})]}),!!Pe.length&&(0,h.jsx)(ro,{title:"Relations",helpLink:"https://backstage.io/docs/features/software-catalog/well-known-relations",children:Object.entries(Ue).map(([Ve,lt],St)=>(0,h.jsx)("div",{children:(0,h.jsx)(kr.Z,{dense:!0,subheader:(0,h.jsx)(no,{children:Ve}),children:lt.map(De=>(0,h.jsxs)(mr.Z,{children:[(0,h.jsx)(Kr.Z,{children:(0,h.jsx)(Yn,{entityRef:De.targetRef})}),(0,h.jsx)(nr,{primary:(0,h.jsx)(Et,{entityRef:De.targetRef})})]},De.targetRef))})},St))}),!!(!((B=We.items)===null||B===void 0)&&B.length)&&(0,h.jsx)(ro,{title:"Status",helpLink:"https://backstage.io/docs/features/software-catalog/well-known-statuses",children:We.items.map((Ve,lt)=>(0,h.jsxs)("div",{children:[(0,h.jsxs)(j.Z,{children:[Ve.level,": ",Ve.type]}),(0,h.jsx)(Z.Z,{ml:2,children:Ve.message})]},lt))})]})]})}var Xo=n(10921);function yo(y){return(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(Wt.Z,{variant:"h2",children:"Entity as YAML"}),(0,h.jsx)(Wt.Z,{children:"This is the raw entity data as received from the catalog, on YAML form."}),(0,h.jsx)(Wt.Z,{children:(0,h.jsx)("div",{style:{fontSize:"75%"},"data-testid":"code-snippet",children:(0,h.jsx)(T.Oi,{text:Xo.ZP.stringify(mo(y.entity)),language:"yaml",showCopyCodeButton:!0})})})]})}const oo=(0,on.Z)(y=>({fullHeightDialog:{height:"calc(100% - 64px)"},root:{display:"flex",flexGrow:1,width:"100%",backgroundColor:y.palette.background.paper},tabs:{borderRight:`1px solid ${y.palette.divider}`,flexShrink:0},tabContents:{flexGrow:1,overflowX:"auto"}}));function Yr(y){const{children:E,value:$,index:B,...ce}=y,ie=oo();return(0,h.jsx)("div",{role:"tabpanel",hidden:$!==B,id:`vertical-tabpanel-${B}`,"aria-labelledby":`vertical-tab-${B}`,className:ie.tabContents,...ce,children:$===B&&(0,h.jsx)(Z.Z,{pl:3,pr:3,children:E})})}function Wr(y){return{id:`vertical-tab-${y}`,"aria-controls":`vertical-tabpanel-${y}`}}function Jr(y){const E=oo(),[$,B]=P.useState(0);return(0,P.useEffect)(()=>{B(0)},[y.open]),y.entity?(0,h.jsxs)(Ze.Z,{fullWidth:!0,maxWidth:"xl",open:y.open,onClose:y.onClose,"aria-labelledby":"entity-inspector-dialog-title",PaperProps:{className:E.fullHeightDialog},children:[(0,h.jsx)(qe.Z,{id:"entity-inspector-dialog-title",children:"Entity Inspector"}),(0,h.jsx)(Jt.Z,{dividers:!0,children:(0,h.jsxs)("div",{className:E.root,children:[(0,h.jsxs)(cn.Z,{orientation:"vertical",variant:"scrollable",value:$,onChange:(ce,ie)=>B(ie),"aria-label":"Inspector options",className:E.tabs,children:[(0,h.jsx)(pn.Z,{label:"Overview",...Wr(0)}),(0,h.jsx)(pn.Z,{label:"Ancestry",...Wr(1)}),(0,h.jsx)(pn.Z,{label:"Colocated",...Wr(2)}),(0,h.jsx)(pn.Z,{label:"Raw JSON",...Wr(3)}),(0,h.jsx)(pn.Z,{label:"Raw YAML",...Wr(4)})]}),(0,h.jsx)(Yr,{value:$,index:0,children:(0,h.jsx)(As,{entity:y.entity})}),(0,h.jsx)(Yr,{value:$,index:1,children:(0,h.jsx)(_r,{entity:y.entity})}),(0,h.jsx)(Yr,{value:$,index:2,children:(0,h.jsx)(Io,{entity:y.entity})}),(0,h.jsx)(Yr,{value:$,index:3,children:(0,h.jsx)(Jo,{entity:y.entity})}),(0,h.jsx)(Yr,{value:$,index:4,children:(0,h.jsx)(yo,{entity:y.entity})})]})}),(0,h.jsx)(In.Z,{children:(0,h.jsx)(Q.Z,{onClick:y.onClose,color:"primary",children:"Close"})})]}):null}var Po=n(85256);function xn(y){var E;const $=(0,p.h_)(V),B=(E=y.metadata.annotations)===null||E===void 0?void 0:E[R.q1],ce=y.metadata.uid,ie=B==="bootstrap:bootstrap",z=(0,Tt.default)(async()=>{const St=$.getLocationByRef(B);let De;if(!B)De=Promise.resolve([]);else{const Xe=`metadata.annotations.${R.q1}`;De=$.getEntities({filter:{[Xe]:B},fields:["kind","metadata.uid","metadata.name","metadata.namespace"]}).then(Ct=>Ct.items)}return Promise.all([St,De]).then(([Xe,Ct])=>({location:Xe,colocatedEntities:Ct}))},[$,y]),he=(0,P.useCallback)(async function(){const{location:De}=z.value;await $.removeLocationById(De.id)},[$,z]),Ae=(0,P.useCallback)(async function(){await $.removeEntityByUid(ce)},[$,ce]);if(ie)return{type:"bootstrap",location:B,deleteEntity:Ae};const{loading:Pe,error:We,value:Ue}=z;if(Pe)return{type:"loading"};if(We)return{type:"error",error:We};const{location:Ve,colocatedEntities:lt}=Ue;return Ve?{type:"unregister",location:B,colocatedEntities:lt.map(R.iB),unregisterLocation:he,deleteEntity:Ae}:{type:"only-delete",deleteEntity:Ae}}var Lo=n(23054);const qo=(0,on.Z)({advancedButton:{fontSize:"0.7em"},dialogActions:{display:"inline-block"}}),di=({entity:y,onConfirm:E,onClose:$})=>{const B=(0,p.h_)(p.$v),ce=(0,p.h_)(p.Ds),ie=qo(),z=xn(y),[he,Ae]=(0,P.useState)(!1),[Pe,We]=(0,P.useState)(!1);var Ue;const Ve=(Ue=ce.getOptionalString("app.title"))!==null&&Ue!==void 0?Ue:"Backstage",lt=(0,P.useCallback)(async function(){if("unregisterLocation"in z){We(!0);try{await z.unregisterLocation(),E()}catch(Ct){(0,Lo.BD)(Ct),B.post({message:Ct.message})}finally{We(!1)}}},[B,E,z]),St=(0,P.useCallback)(async function(){if("deleteEntity"in z){We(!0);try{await z.deleteEntity();var Ct;const Qt=(Ct=y.metadata.title)!==null&&Ct!==void 0?Ct:y.metadata.name;E(),B.post({message:`Removed entity ${Qt}`,severity:"success",display:"transient"})}catch(Qt){(0,Lo.BD)(Qt),B.post({message:Qt.message})}finally{We(!1)}}},[B,E,z,y]),De=()=>(0,h.jsx)(In.Z,{className:ie.dialogActions,children:(0,h.jsx)(Q.Z,{onClick:$,color:"primary",children:"Cancel"})});return z.type==="loading"?(0,h.jsx)(T.Ex,{}):z.type==="error"?(0,h.jsx)(T.Gk,{error:z.error}):z.type==="bootstrap"?(0,h.jsxs)(h.Fragment,{children:[(0,h.jsxs)(eo.Z,{severity:"info",children:['You cannot unregister this entity, since it originates from a protected Backstage configuration (location "',z.location,'"). If you believe this is in error, please contact the ',Ve," ","integrator."]}),(0,h.jsxs)(Z.Z,{marginTop:2,children:[!he&&(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(Q.Z,{variant:"text",size:"small",color:"primary",className:ie.advancedButton,onClick:()=>Ae(!0),children:"Advanced Options"}),(0,h.jsx)(De,{})]}),he&&(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(Wt.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,h.jsx)(Q.Z,{variant:"contained",color:"secondary",disabled:Pe,onClick:St,children:"Delete Entity"}),(0,h.jsx)(De,{})]})]})]}):z.type==="only-delete"?(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(Wt.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,h.jsx)(Q.Z,{variant:"contained",color:"secondary",disabled:Pe,onClick:St,children:"Delete Entity"}),(0,h.jsx)(De,{})]}):z.type==="unregister"?(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(Wt.Z,{children:"This action will unregister the following entities:"}),(0,h.jsx)(Wt.Z,{component:"ul",children:z.colocatedEntities.map(Xe=>(0,h.jsx)("li",{children:(0,h.jsx)(Et,{entityRef:Xe})},`${Xe.kind}:${Xe.namespace}/${Xe.name}`))}),(0,h.jsx)(Wt.Z,{children:"Located at the following location:"}),(0,h.jsx)(Wt.Z,{component:"ul",children:(0,h.jsx)("li",{children:z.location})}),(0,h.jsxs)(Wt.Z,{children:["To undo, just re-register the entity in ",Ve,"."]}),(0,h.jsxs)(Z.Z,{marginTop:2,children:[(0,h.jsx)(Q.Z,{variant:"contained",color:"secondary",disabled:Pe,onClick:lt,children:"Unregister Location"}),!he&&(0,h.jsx)(Z.Z,{component:"span",marginLeft:2,children:(0,h.jsx)(Q.Z,{variant:"text",size:"small",color:"primary",className:ie.advancedButton,onClick:()=>Ae(!0),children:"Advanced Options"})})]}),he&&(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(Z.Z,{paddingTop:4,paddingBottom:4,children:(0,h.jsx)(Po.Z,{})}),(0,h.jsx)(Wt.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,h.jsx)(Q.Z,{variant:"contained",color:"secondary",disabled:Pe,onClick:St,children:"Delete Entity"})]})]}):(0,h.jsx)(eo.Z,{severity:"error",children:"Internal error: Unknown state"})},Ts=y=>{const{open:E,onConfirm:$,onClose:B,entity:ce}=y;return(0,h.jsxs)(Ze.Z,{open:E,onClose:B,children:[(0,h.jsx)(qe.Z,{id:"responsive-dialog-title",children:"Are you sure you want to unregister this entity?"}),(0,h.jsx)(Jt.Z,{children:(0,h.jsx)(di,{entity:ce,onConfirm:$,onClose:B})})]})};var Rs=n(12231),ui=n(9520),Is=n(47603);const Br=(0,on.Z)(y=>({root:{backgroundColor:"rgba(0, 0, 0, .11)",boxShadow:"none",margin:y.spacing(1,0,1,0)},title:{margin:y.spacing(1,0,0,1),textTransform:"uppercase",fontSize:12,fontWeight:"bold"},listIcon:{minWidth:30,color:y.palette.text.primary},menuItem:{minHeight:y.spacing(6)},groupWrapper:{margin:y.spacing(1,1,2,1)}}),{name:"CatalogReactUserListPicker"});function _o(y){return[{name:"Personal",items:[{id:"owned",label:"Owned",icon:Is.Z},{id:"starred",label:"Starred",icon:A.Z}]},{name:y!=null?y:"Company",items:[{id:"all",label:"All"}]}]}const Oo=y=>{const{initialFilter:E,availableFilters:$}=y,B=Br(),ce=(0,p.h_)(p.Ds);var ie;const z=(ie=ce.getOptionalString("organization.name"))!==null&&ie!==void 0?ie:"Company",{filters:he,updateFilters:Ae,backendEntities:Pe,queryParameters:{kind:We,user:Ue},loading:Ve}=at(),lt=["starred","all"],St=_o(z).map(Un=>({...Un,items:Un.items.filter(({id:Jn})=>["group","user"].some(jr=>jr===We)?lt.includes(Jn):!$||$.includes(Jn))})).filter(({items:Un})=>!!Un.length),{isStarredEntity:De}=jt(),{isOwnedEntity:Xe,loading:Ct}=fn(),Qt=Ve||Ct,jn=(0,P.useMemo)(()=>new Bt("owned",Xe,De),[Xe,De]),Pt=(0,P.useMemo)(()=>new Bt("starred",Xe,De),[Xe,De]),Lt=(0,P.useMemo)(()=>[Ue].flat()[0],[Ue]),[en,En]=(0,P.useState)(Lt!=null?Lt:E),vr=(0,P.useMemo)(()=>Pe.filter((0,F.Gz)((0,ft.compact)(Object.values({...he,user:void 0})))),[he,Pe]),$r=(0,P.useMemo)(()=>({all:vr.length,starred:vr.filter(Un=>Pt.filterEntity(Un)).length,owned:vr.filter(Un=>jn.filterEntity(Un)).length}),[vr,Pt,jn]);(0,P.useEffect)(()=>{Lt&&En(Lt)},[Lt]),(0,P.useEffect)(()=>{!Qt&&en&&en!=="all"&&$r[en]===0&&En("all")},[Qt,$r,en,En]),(0,P.useEffect)(()=>{Ae({user:en?new Bt(en,Xe,De):void 0})},[en,Xe,De,Ae]);var io;return(0,h.jsx)(to.Z,{className:B.root,children:St.map(Un=>(0,h.jsxs)(P.Fragment,{children:[(0,h.jsx)(j.Z,{variant:"subtitle2",component:"span",className:B.title,children:Un.name}),(0,h.jsx)(to.Z,{className:B.groupWrapper,children:(0,h.jsx)(kr.Z,{disablePadding:!0,dense:!0,role:"menu","aria-label":Un.name,children:Un.items.map(Jn=>{var jr;return(0,h.jsxs)(Rs.Z,{role:"none presentation",button:!0,divider:!0,onClick:()=>En(Jn.id),selected:Jn.id===((jr=he.user)===null||jr===void 0?void 0:jr.value),className:B.menuItem,disabled:$r[Jn.id]===0,"data-testid":`user-picker-${Jn.id}`,tabIndex:0,ContainerProps:{role:"menuitem"},children:[Jn.icon&&(0,h.jsx)(Kr.Z,{className:B.listIcon,children:(0,h.jsx)(Jn.icon,{fontSize:"small"})}),(0,h.jsx)(Eo.Z,{children:(0,h.jsxs)(j.Z,{variant:"body1",children:[Jn.label," "]})}),(0,h.jsx)(ui.Z,{children:(io=$r[Jn.id])!==null&&io!==void 0?io:"-"})]},Jn.id)})})})]},Un.name))})},xo=(0,on.Z)({input:{}},{name:"CatalogReactEntityProcessingStatusPickerPicker"}),so=(0,h.jsx)(yn.Z,{fontSize:"small"}),Ps=(0,h.jsx)(Cn.Z,{fontSize:"small"}),es=()=>{const y=xo(),{updateFilters:E}=at(),[$,B]=(0,P.useState)([]);function ce(he){E({orphan:he?new Dt(he):void 0})}function ie(he){E({error:he?new _e(he):void 0})}const z=["Is Orphan","Has Error"];return(0,h.jsx)(Z.Z,{pb:1,pt:1,children:(0,h.jsxs)(j.Z,{variant:"button",component:"label",children:["Processing Status",(0,h.jsx)(st.ZP,{multiple:!0,disableCloseOnSelect:!0,options:z,value:$,onChange:(he,Ae)=>{B(Ae),ce(Ae.includes("Is Orphan")),ie(Ae.includes("Has Error"))},renderOption:(he,{selected:Ae})=>(0,h.jsx)(qt.Z,{control:(0,h.jsx)(Sn.Z,{icon:so,checkedIcon:Ps,checked:Ae}),onClick:Pe=>Pe.preventDefault(),label:he}),size:"small",popupIcon:(0,h.jsx)(Vt.Z,{"data-testid":"processing-status-picker-expand"}),renderInput:he=>(0,h.jsx)(Zn.Z,{...he,className:y.input,variant:"outlined"})})]})})},ts=(0,on.Z)({input:{}},{name:"CatalogReactEntityNamespacePicker"}),ns=()=>{const y=ts();return(0,h.jsx)(Te,{label:"Namespace",name:"namespace",path:"metadata.namespace",Filter:Ut,InputProps:{className:y.input}})};function ko(y){var E;const{children:$,value:B}=y;var ce;const[ie,z]=useState((ce=(E=B)===null||E===void 0?void 0:E.filters)!==null&&ce!==void 0?ce:{}),he=useCallback(De=>{z(Xe=>{const Ct=typeof De=="function"?De(Xe):De;return{...Xe,...Ct}})},[]),Ae=useMemo(()=>({entities:[],backendEntities:[],queryParameters:{}}),[]);var Pe,We,Ue,Ve,lt;const St=useMemo(()=>{var De,Xe,Ct,Qt,jn,Pt;return{entities:(Pe=(De=B)===null||De===void 0?void 0:De.entities)!==null&&Pe!==void 0?Pe:Ae.entities,backendEntities:(We=(Xe=B)===null||Xe===void 0?void 0:Xe.backendEntities)!==null&&We!==void 0?We:Ae.backendEntities,updateFilters:(Ue=(Ct=B)===null||Ct===void 0?void 0:Ct.updateFilters)!==null&&Ue!==void 0?Ue:he,filters:ie,loading:(Ve=(Qt=B)===null||Qt===void 0?void 0:Qt.loading)!==null&&Ve!==void 0?Ve:!1,queryParameters:(lt=(jn=B)===null||jn===void 0?void 0:jn.queryParameters)!==null&<!==void 0?lt:Ae.queryParameters,error:(Pt=B)===null||Pt===void 0?void 0:Pt.error}},[B,Ae,ie,he]);return _jsx(EntityListContext.Provider,{value:St,children:$})}},75435:function(wt,Ie,n){"use strict";n.d(Ie,{h:function(){return p}});var r=n(25271);function p(V,f,H){var m,h,P;let q=((h=V)===null||h===void 0||(m=h.relations)===null||m===void 0?void 0:m.filter(_=>_.type===f).map(_=>(0,r.of)(_.targetRef)))||[];return!((P=H)===null||P===void 0)&&P.kind&&(q=q.filter(_=>_.kind.toLocaleLowerCase("en-US")===H.kind.toLocaleLowerCase("en-US"))),q}},49280:function(wt,Ie,n){"use strict";n.d(Ie,{hF:function(){return V.h},CV:function(){return H},wq:function(){return r},Gz:function(){return p}});function r(h){return h.reduce((P,q)=>({...P,...q.getCatalogFilters?q.getCatalogFilters():{}}),{})}function p(h){return P=>h.every(q=>!q.filterEntity||q.filterEntity(P))}var V=n(75435),f=n(25271);function H(h,P){var q;const _=(q=h.metadata.annotations)===null||q===void 0?void 0:q[f.M6];if(_)try{var Q;const se=(0,f.Ou)(_),Z=P.byUrl(se.target);return{locationTargetUrl:se.target,integrationType:(Q=Z)===null||Q===void 0?void 0:Q.type}}catch{return}}function m(h,P){const q=new Set([...getEntityRelations(h,RELATION_MEMBER_OF,{kind:"group"}),...h?[getCompoundEntityRef(h)]:[]].map(stringifyEntityRef)),_=getEntityRelations(P,RELATION_OWNED_BY).map(stringifyEntityRef);for(const Q of _)if(q.has(Q))return!0;return!1}},8799:function(wt,Ie,n){"use strict";n.r(Ie),n.d(Ie,{AboutCard:function(){return ft},AboutContent:function(){return F},AboutField:function(){return U}});var r=n(52322),p=n(25271),V=n(79692),f=n(94339),H=n(32552),m=n(61837),h=n(85256),P=n(24579),q=n(53974),_=n(2784),Q=n(32838),se=n(97456),Z=n(39709),j=n(19625),re=n(60905),ae=n(7089),oe=n(90436);const ee=(0,V.Z)(Je=>({value:{fontWeight:"bold",overflow:"hidden",lineHeight:"24px",wordBreak:"break-word"},label:{color:Je.palette.text.secondary,textTransform:"uppercase",fontSize:"10px",fontWeight:"bold",letterSpacing:.5,overflow:"hidden",whiteSpace:"nowrap"}}));function U(Je){const{label:Ft,value:$t,gridSizes:Mt,children:Se}=Je,Be=ee(),Ge=(0,se.vJ)(Se,at=>at.getElements()),et=Ge.length>0?Ge:(0,r.jsx)(oe.Z,{variant:"body2",className:Be.value,children:$t||"unknown"});return(0,r.jsxs)(re.Z,{item:!0,...Mt,children:[(0,r.jsx)(oe.Z,{variant:"h2",className:Be.label,children:Ft}),et]})}var T=n(24851);const w=(0,V.Z)({description:{wordBreak:"break-word"}});function R(Je,Ft,$t){if(Ft==="url"||Je.includes("://"))return Je;const Mt=$t.type==="file"?`file://${$t.target}`:$t.target;return Ft==="file"||$t.type==="file"?new URL(Je,Mt).href:Mt}function F(Je){var Ft,$t,Mt,Se,Be,Ge,et,at,Tt,pt,xe,G,pe,Ee,He,gt;const{entity:Qe}=Je,jt=w(),an=Qe.kind.toLocaleLowerCase("en-US")==="system",tn=Qe.kind.toLocaleLowerCase("en-US")==="resource",ln=Qe.kind.toLocaleLowerCase("en-US")==="component",fn=Qe.kind.toLocaleLowerCase("en-US")==="api",dn=Qe.kind.toLocaleLowerCase("en-US")==="template",Bn=Qe.kind.toLocaleLowerCase("en-US")==="location",Fn=Qe.kind.toLocaleLowerCase("en-US")==="group",ot=(0,Z.hF)(Qe,p.cz,{kind:"system"}),on=(0,Z.hF)(Qe,p.cz,{kind:"component"}),Vt=(0,Z.hF)(Qe,p.cz,{kind:"domain"}),st=(0,Z.hF)(Qe,p.S4);let Sn;try{Sn=(0,p.CV)(Qe)}catch{Sn=void 0}return(0,r.jsxs)(re.Z,{container:!0,children:[(0,r.jsx)(U,{label:"Description",gridSizes:{xs:12},children:(0,r.jsx)(q.SA,{className:jt.description,content:(($t=Qe)===null||$t===void 0||(Ft=$t.metadata)===null||Ft===void 0?void 0:Ft.description)||"No description"})}),(0,r.jsx)(U,{label:"Owner",value:"No Owner",gridSizes:{xs:12,sm:6,lg:4},children:st.length>0&&(0,r.jsx)(Z.rI,{entityRefs:st,defaultKind:"group"})}),(an||Vt.length>0)&&(0,r.jsx)(U,{label:"Domain",value:"No Domain",gridSizes:{xs:12,sm:6,lg:4},children:Vt.length>0&&(0,r.jsx)(Z.rI,{entityRefs:Vt,defaultKind:"domain"})}),(fn||ln||tn||ot.length>0)&&(0,r.jsx)(U,{label:"System",value:"No System",gridSizes:{xs:12,sm:6,lg:4},children:ot.length>0&&(0,r.jsx)(Z.rI,{entityRefs:ot,defaultKind:"system"})}),ln&&on.length>0&&(0,r.jsx)(U,{label:"Parent Component",value:"No Parent Component",gridSizes:{xs:12,sm:6,lg:4},children:(0,r.jsx)(Z.rI,{entityRefs:on,defaultKind:"component"})}),(fn||ln||tn||dn||Fn||Bn||typeof((Se=Qe)===null||Se===void 0||(Mt=Se.spec)===null||Mt===void 0?void 0:Mt.type)=="string")&&(0,r.jsx)(U,{label:"Type",value:(Ge=Qe)===null||Ge===void 0||(Be=Ge.spec)===null||Be===void 0?void 0:Be.type,gridSizes:{xs:12,sm:6,lg:4}}),(fn||ln||typeof((at=Qe)===null||at===void 0||(et=at.spec)===null||et===void 0?void 0:et.lifecycle)=="string")&&(0,r.jsx)(U,{label:"Lifecycle",value:(pt=Qe)===null||pt===void 0||(Tt=pt.spec)===null||Tt===void 0?void 0:Tt.lifecycle,gridSizes:{xs:12,sm:6,lg:4}}),(0,r.jsx)(U,{label:"Tags",value:"No Tags",gridSizes:{xs:12,sm:6,lg:4},children:(((G=Qe)===null||G===void 0||(xe=G.metadata)===null||xe===void 0?void 0:xe.tags)||[]).map(qt=>(0,r.jsx)(ae.Z,{size:"small",label:qt},qt))}),Bn&&(((Ee=Qe)===null||Ee===void 0||(pe=Ee.spec)===null||pe===void 0?void 0:pe.targets)||((gt=Qe)===null||gt===void 0||(He=gt.spec)===null||He===void 0?void 0:He.target))&&(0,r.jsx)(U,{label:"Targets",gridSizes:{xs:12},children:(0,r.jsx)(T.s,{cols:1,items:(Qe.spec.targets||[Qe.spec.target]).map(qt=>qt).map(qt=>{var Cn,yn;return{text:qt,href:R(qt,((yn=Qe)===null||yn===void 0||(Cn=yn.spec)===null||Cn===void 0?void 0:Cn.type)||"unknown",Sn)}})})})]})}var ve=n(52866),be=n(88188),k=n(30254),rt=n(27604),ht=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 Nt=(0,p.wI)(ht),Ut={async check(Je){return Nt(Je)===Je}},Bt=Je=>Je.apiVersion==="scaffolder.backstage.io/v1beta3"&&Je.kind==="Template",Dt="backstage.io/techdocs-ref",_e="backstage.io/techdocs-entity",yt=(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 ft(Je){var Ft,$t,Mt,Se,Be,Ge,et,at,Tt;const{variant:pt}=Je,xe=(0,se.qD)(),G=yt(),{entity:pe}=(0,Z.X2)(),Ee=(0,se.h_)(Q.q3),He=(0,se.h_)(Z.Ah),gt=(0,se.h_)(se.$v),Qe=(0,se.h_)(se.VE),jt=(0,se.tg)(j.jU),an=(0,se.tg)(j.ql),tn=(0,Z.CV)(pe,Ee),ln=(Ft=pe.metadata.annotations)===null||Ft===void 0?void 0:Ft[p.Tf];let fn;if(!(($t=pe.metadata.annotations)===null||$t===void 0)&&$t[_e])try{var dn;fn=(0,p.of)((dn=pe.metadata.annotations)===null||dn===void 0?void 0:dn[_e])}catch{fn=void 0}const Bn={label:"View Source",disabled:!tn,icon:(0,r.jsx)(Q.nW,{type:(Mt=tn)===null||Mt===void 0?void 0:Mt.integrationType}),href:(Se=tn)===null||Se===void 0?void 0:Se.locationTargetUrl},Fn={label:"View TechDocs",disabled:!(!((Be=pe.metadata.annotations)===null||Be===void 0)&&Be[Dt]||!((Ge=pe.metadata.annotations)===null||Ge===void 0)&&Ge[_e])||!jt,icon:(0,r.jsx)(k.Z,{}),href:jt&&jt(fn?{namespace:fn.namespace||p.zG,kind:fn.kind,name:fn.name}:{namespace:pe.metadata.namespace||p.zG,kind:pe.kind,name:pe.metadata.name})},ot=[Bn,Fn];if(Bt(pe)){var on;const yn=(on=xe.getSystemIcon("scaffolder"))!==null&&on!==void 0?on:be.Z,Hn={label:"Launch Template",icon:(0,r.jsx)(yn,{}),disabled:!an,href:an&&an({templateName:pe.metadata.name,namespace:pe.metadata.namespace||p.zG})};ot.push(Hn)}let Vt="";pt==="gridItem"?Vt=G.gridItemCard:pt==="fullHeight"&&(Vt=G.fullHeightCard);let st="";pt==="gridItem"?st=G.gridItemCardContent:pt==="fullHeight"&&(st=G.fullHeightCardContent);const Sn=(et=pe.metadata.annotations)===null||et===void 0?void 0:et[p.P1],qt=((at=Sn)===null||at===void 0?void 0:at.startsWith("url:"))||((Tt=Sn)===null||Tt===void 0?void 0:Tt.startsWith("file:")),Cn=(0,_.useCallback)(async()=>{try{await He.refreshEntity((0,p.eE)(pe)),gt.post({message:"Refresh scheduled",severity:"info",display:"transient"})}catch(yn){Qe.post(yn)}},[He,gt,Qe,pe]);return(0,r.jsxs)(f.Z,{className:Vt,children:[(0,r.jsx)(H.Z,{title:"About",action:(0,r.jsxs)(r.Fragment,{children:[qt&&(0,r.jsx)(m.Z,{"aria-label":"Refresh",title:"Schedule entity refresh",onClick:Cn,children:(0,r.jsx)(ve.Z,{})}),(0,r.jsx)(m.Z,{component:q.rU,"aria-label":"Edit",disabled:!ln,title:"Edit Metadata",to:ln!=null?ln:"#",children:(0,r.jsx)(rt.Z,{})})]}),subheader:(0,r.jsx)(q.M6,{links:ot})}),(0,r.jsx)(h.Z,{}),(0,r.jsx)(P.Z,{className:st,children:(0,r.jsx)(F,{entity:pe})})]})}},86359:function(wt,Ie,n){"use strict";n.d(Ie,{E:function(){return U}});var r=n(52322),p=n(25271),V=n(53974),f=n(39709),H=n(90436),m=n(15459),h=n(27604),P=n(2997),q=n(11640),_=n(28347),Q=n(76635),se=n(2784),Z=n(7089);const j=Object.freeze({createNameColumn(T){function w(R){var F,ve;return((F=R.metadata)===null||F===void 0?void 0:F.title)||(0,f.$3)(R,{defaultKind:(ve=T)===null||ve===void 0?void 0:ve.defaultKind})}return{title:"Name",field:"resolved.name",highlight:!0,customSort({entity:R},{entity:F}){return w(R).localeCompare(w(F))},render:({entity:R})=>{var F,ve;return(0,r.jsx)(f.dx,{entityRef:R,defaultKind:((F=T)===null||F===void 0?void 0:F.defaultKind)||"Component",title:(ve=R.metadata)===null||ve===void 0?void 0:ve.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 w,R,F,ve;return(0,r.jsx)(r.Fragment,{children:(((R=T)===null||R===void 0||(w=R.spec)===null||w===void 0?void 0:w.targets)||((ve=T)===null||ve===void 0||(F=ve.spec)===null||F===void 0?void 0:F.target))&&(0,r.jsx)(V.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)(V.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(w=>(0,r.jsx)(Z.Z,{label:w,size:"small",variant:"outlined",style:{marginBottom:"0px"}},w))}),width:"auto"}},createTitleColumn(T){var w;return{title:"Title",field:"entity.metadata.title",hidden:(w=T)===null||w===void 0?void 0:w.hidden,searchable:!0}},createLabelColumn(T,w){var R;return{title:((R=w)===null||R===void 0?void 0:R.title)||"Label",field:"entity.metadata.labels",cellStyle:{padding:"0px 16px 0px 20px"},render:({entity:F})=>{var ve,be;const k=(ve=F.metadata)===null||ve===void 0?void 0:ve.labels,rt=k&&k[T]||((be=w)===null||be===void 0?void 0:be.defaultValue);return(0,r.jsx)(r.Fragment,{children:rt&&(0,r.jsx)(Z.Z,{label:rt,size:"small",variant:"outlined"},rt)})},width:"auto"}},createNamespaceColumn(){return{title:"Namespace",field:"entity.metadata.namespace",width:"auto"}}});var re=n(19928),ae=n.n(re);const oe=(0,m.Z)({root:{color:"#f3ba37"}})(q.Z),ee=(T,w)=>{const R=F=>F.metadata.title||(0,f.$3)(F,{defaultKind:"Component"});return R(T).localeCompare(R(w))},U=T=>{var w,R,F,ve;const{columns:be,actions:k,tableOptions:rt,subtitle:ht,emptyContent:Nt}=T,{isStarredEntity:Ut,toggleStarredEntity:Bt}=(0,f.CR)(),{loading:Dt,error:_e,entities:yt,filters:ft}=(0,f.wp)(),Je=(0,se.useMemo)(()=>{var xe;return[j.createTitleColumn({hidden:!0}),j.createNameColumn({defaultKind:(xe=ft.kind)===null||xe===void 0?void 0:xe.value}),...G(),j.createMetadataDescriptionColumn(),j.createTagsColumn()];function G(){var pe;const Ee=[j.createSystemColumn(),j.createOwnerColumn(),j.createSpecTypeColumn(),j.createSpecLifecycleColumn()];switch((pe=ft.kind)===null||pe===void 0?void 0:pe.value){case"user":return[];case"domain":case"system":return[j.createOwnerColumn()];case"group":case"template":return[j.createSpecTypeColumn()];case"location":return[j.createSpecTypeColumn(),j.createSpecTargetsColumn()];default:return yt.every(He=>He.metadata.namespace==="default")?Ee:[...Ee,j.createNamespaceColumn()]}}},[(w=ft.kind)===null||w===void 0?void 0:w.value,yt]),Ft=ft.type===void 0;var $t;const Mt=(0,Q.capitalize)(($t=(R=ft.user)===null||R===void 0?void 0:R.value)!==null&&$t!==void 0?$t:"all");if(_e)return(0,r.jsx)("div",{children:(0,r.jsx)(V.GB,{severity:"error",title:"Could not fetch catalog entities.",children:(0,r.jsx)(V.Oi,{language:"text",text:_e.toString()})})});const Se=[({entity:xe})=>{var G;const pe=(G=xe.metadata.annotations)===null||G===void 0?void 0:G[p.l2],Ee="View";return{icon:()=>(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(H.Z,{variant:"srOnly",children:Ee}),(0,r.jsx)(P.Z,{fontSize:"small"})]}),tooltip:Ee,disabled:!pe,onClick:()=>{pe&&window.open(pe,"_blank")}}},({entity:xe})=>{var G;const pe=(G=xe.metadata.annotations)===null||G===void 0?void 0:G[p.Tf],Ee="Edit";return{icon:()=>(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(H.Z,{variant:"srOnly",children:Ee}),(0,r.jsx)(h.Z,{fontSize:"small"})]}),tooltip:Ee,disabled:!pe,onClick:()=>{pe&&window.open(pe,"_blank")}}},({entity:xe})=>{const G=Ut(xe),pe=G?"Remove from favorites":"Add to favorites";return{cellStyle:{paddingLeft:"1em"},icon:()=>(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(H.Z,{variant:"srOnly",children:pe}),G?(0,r.jsx)(oe,{}):(0,r.jsx)(_.Z,{})]}),tooltip:pe,onClick:()=>Bt(xe)}}],Be=yt.sort(ee).map(xe=>{const G=(0,f.hF)(xe,p.cz,{kind:"system"}),pe=(0,f.hF)(xe,p.S4);return{entity:xe,resolved:{name:(0,f.$3)(xe,{defaultKind:"Component"}),ownedByRelationsTitle:pe.map(Ee=>(0,f.$3)(Ee,{defaultKind:"group"})).join(", "),ownedByRelations:pe,partOfSystemRelationTitle:G.map(Ee=>(0,f.$3)(Ee,{defaultKind:"system"})).join(", "),partOfSystemRelations:G}}}),Ge=(be||Je).find(xe=>xe.title==="Type");Ge&&(Ge.hidden=!Ft);const et=Be.length>20,at=((F=ft.kind)===null||F===void 0?void 0:F.value)||"",Tt=((ve=ft.type)===null||ve===void 0?void 0:ve.value)||"",pt=[Mt,Tt,ae()(at)].filter(xe=>xe).join(" ");return(0,r.jsx)(V.iA,{isLoading:Dt,columns:be||Je,options:{paging:et,pageSize:20,actionsColumnIndex:-1,loadingType:"linear",showEmptyDataSourceMessage:!Dt,padding:"dense",pageSizeOptions:[20,50,100],...rt},title:`${pt} (${yt.length})`,data:Be,actions:k||Se,subtitle:ht,emptyContent:Nt})};U.columns=j},85877:function(wt,Ie,n){"use strict";n.r(Ie),n.d(Ie,{EntityLabelsCard:function(){return se},hasLabels:function(){return Z}});var r=n(52322),p=n(39709),V=n(2784),f=n(53974),H=n(79692),m=n(90436),h=n(77277);const P=`metadata:
|
|
34
|
+
name: example
|
|
35
|
+
labels:
|
|
36
|
+
javaVersion: 1.2.3`,q=(0,H.Z)(j=>({code:{borderRadius:6,margin:j.spacing(2,0),background:j.palette.type==="dark"?"#444":j.palette.common.white}}),{name:"PluginCatalogEntityLabelsEmptyState"});function _(){const j=q();return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(m.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:j.code,children:(0,r.jsx)(f.Oi,{text:P,language:"yaml",showLineNumbers:!0,highlightedNumbers:[3,4,5,6],customStyle:{background:"inherit",fontSize:"115%"}})}),(0,r.jsx)(h.Z,{variant:"contained",color:"primary",target:"_blank",href:"https://backstage.io/docs/features/software-catalog/descriptor-format#labels-optional",children:"Read more"})]})}const Q=(0,H.Z)(j=>({key:{fontWeight:"bold"}})),se=j=>{var re,ae;const{variant:oe,title:ee}=j,{entity:U}=(0,p.X2)(),T=Q(),w=[{render:F=>(0,r.jsx)(m.Z,{className:T.key,variant:"body2",children:F.key})},{field:"value"}],R=(ae=U)===null||ae===void 0||(re=ae.metadata)===null||re===void 0?void 0:re.labels;return(0,r.jsx)(f.rJ,{title:ee||"Labels",variant:oe,children:!R||Object.keys(R).length===0?(0,r.jsx)(_,{}):(0,r.jsx)(f.iA,{columns:w,data:Object.keys(R).map(F=>({key:F,value:R[F]})),options:{search:!1,showTitle:!0,loadingType:"linear",header:!1,padding:"dense",pageSize:5,toolbar:!1,paging:Object.keys(R).length>5}})})};function Z(j){var re,ae,oe,ee;return!((ae=j)===null||ae===void 0||(re=ae.metadata)===null||re===void 0)&&re.labels?Object.keys((ee=j)===null||ee===void 0||(oe=ee.metadata)===null||oe===void 0?void 0:oe.labels).some(Boolean):!1}},24851:function(wt,Ie,n){"use strict";n.d(Ie,{s:function(){return re}});var r=n(52322),p=n(90348),V=n(11861),f=n(2784),H=n(79692),m=n(95544),h=n(90436),P=n(52160),q=n(53974);const _=(0,H.Z)({svgIcon:{display:"inline-block","& svg":{display:"inline-block",fontSize:"inherit",verticalAlign:"baseline"}}});function Q(ae){const{href:oe,text:ee,Icon:U}=ae,T=_();return(0,r.jsxs)(m.Z,{display:"flex",children:[(0,r.jsx)(m.Z,{mr:1,className:T.svgIcon,children:(0,r.jsx)(h.Z,{component:"div",children:U?(0,r.jsx)(U,{}):(0,r.jsx)(P.Z,{})})}),(0,r.jsx)(m.Z,{flexGrow:"1",children:(0,r.jsx)(q.rU,{to:oe,target:"_blank",rel:"noopener",children:ee||oe})})]})}var se=n(41156);const Z={xs:1,sm:1,md:1,lg:2,xl:3};function j(ae){const oe=[(0,se.Z)(R=>R.breakpoints.up("xl"))?"xl":null,(0,se.Z)(R=>R.breakpoints.up("lg"))?"lg":null,(0,se.Z)(R=>R.breakpoints.up("md"))?"md":null,(0,se.Z)(R=>R.breakpoints.up("sm"))?"sm":null,(0,se.Z)(R=>R.breakpoints.up("xs"))?"xs":null];let ee=1;if(typeof ae=="number")ee=ae;else{var U,T;const R=(T=oe.find(F=>F!==null))!==null&&T!==void 0?T:"xs";var w;ee=(w=(U=ae)===null||U===void 0?void 0:U[R])!==null&&w!==void 0?w:Z[R]}return ee}function re(ae){const{items:oe,cols:ee=void 0}=ae,U=j(ee);return(0,r.jsx)(p.Z,{rowHeight:"auto",cols:U,children:oe.map(({text:T,href:w,Icon:R},F)=>(0,r.jsx)(V.Z,{children:(0,r.jsx)(Q,{href:w,text:T!=null?T:w,Icon:R})},F))})}},19625:function(wt,Ie,n){"use strict";n.d(Ie,{_Z:function(){return H},jU:function(){return V},ql:function(){return f},yw:function(){return p}});var r=n(97456);const p=(0,r.x8)({id:"create-component",optional:!0}),V=(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"]}),H=(0,r.NT)({id:"catalog"})},15096:function(wt,Ie,n){"use strict";n.d(Ie,{FA:function(){return q},qO:function(){return Je},Nd:function(){return k},E5:function(){return gn},Rx:function(){return w}});var r=n(97456);const p=(0,r.T0)({id:"plugin.search.queryservice"});class V{query(){return Promise.resolve(this.mockedResults||{results:[]})}constructor(de){_define_property(this,"mockedResults",void 0),this.mockedResults=de}}var f=n(52322),H=n(2784),m=n(38402),h=n(79692);const P=(0,h.Z)(()=>({highlight:{}}),{name:"BackstageHighlightedSearchResultText"}),q=le=>{const{text:de,preTag:Y,postTag:v}=le,L=P(),M=(0,H.useMemo)(()=>de.split(new RegExp(`(${Y}.+?${v})`)),[v,Y,de]);return(0,f.jsx)(f.Fragment,{children:M.map((W,ue)=>W.includes(Y)?(0,f.jsx)("mark",{className:L.highlight,children:W.replace(new RegExp(`${Y}|${v}`,"g"),"")},ue):W)})};var _=n(50581),Q=n(61837),se=n(86619),Z=n(77277),j=n(21853),re=n(48760),ae=n(76635),oe=n(64279),ee=n(1849),U=n(51837);const T=(0,U.CT)("search-context"),w=()=>{const le=(0,H.useContext)(T);if(!le)throw new Error("useSearch must be used within a SearchContextProvider");const de=le.atVersion(1);if(!de)throw new Error("No SearchContext v1 found");return de},R=()=>(0,H.useContext)(T)!==void 0,F={term:"",types:[],filters:{},pageLimit:void 0,pageCursor:void 0},ve=(le=F)=>{var de,Y,v,L;const M=(0,r.h_)(p),[W,ue]=(0,H.useState)(le.term),[Ce,Oe]=(0,H.useState)(le.types),[tt,nt]=(0,H.useState)(le.filters),[mt,xt]=(0,H.useState)(le.pageLimit),[it,$e]=(0,H.useState)(le.pageCursor),vt=(0,ee.Z)(W),Xt=(0,ee.Z)(tt),Et=(0,oe.default)(()=>M.query({term:W,types:Ce,filters:tt,pageLimit:mt,pageCursor:it}),[W,Ce,tt,mt,it]),Zt=!Et.loading&&!Et.error&&((de=Et.value)===null||de===void 0?void 0:de.nextPageCursor),_t=!Et.loading&&!Et.error&&((Y=Et.value)===null||Y===void 0?void 0:Y.previousPageCursor),wn=(0,H.useCallback)(()=>{var It;$e((It=Et.value)===null||It===void 0?void 0:It.nextPageCursor)},[(v=Et.value)===null||v===void 0?void 0:v.nextPageCursor]),Kt=(0,H.useCallback)(()=>{var It;$e((It=Et.value)===null||It===void 0?void 0:It.previousPageCursor)},[(L=Et.value)===null||L===void 0?void 0:L.previousPageCursor]);return(0,H.useEffect)(()=>{vt!==void 0&&W!==vt&&$e(void 0)},[W,vt,$e]),(0,H.useEffect)(()=>{Xt!==void 0&&!(0,ae.isEqual)(tt,Xt)&&$e(void 0)},[tt,Xt,$e]),{result:Et,term:W,setTerm:ue,types:Ce,setTypes:Oe,filters:tt,setFilters:nt,pageLimit:mt,setPageLimit:xt,pageCursor:it,setPageCursor:$e,fetchNextPage:Zt?wn:void 0,fetchPreviousPage:_t?Kt:void 0}},be=le=>{const{initialState:de,children:Y}=le,v=ve(de);return(0,f.jsx)(r.fC,{attributes:{searchTypes:v.types.sort().join(",")},children:(0,f.jsx)(T.Provider,{value:(0,U.EI)({1:v}),children:Y})})},k=le=>{const{initialState:de,inheritParentContextIfAvailable:Y,children:v}=le,L=R(),M=(0,r.h_)(r.Ds),W=de!=null?de:{},ue=M.has("search.query.pageLimit")?{pageLimit:M.getNumber("search.query.pageLimit")}:{},Ce={...F,...W,...ue};return L&&Y?(0,f.jsx)(f.Fragment,{children:v}):(0,f.jsx)(be,{initialState:Ce,children:v})},rt=({children:le})=>{var de;const Y=tt=>(0,ee.Z)(tt)!==tt,v=(0,r.z$)(),{term:L,result:M}=w();var W;const ue=(W=(de=M.value)===null||de===void 0?void 0:de.numberOfResults)!==null&&W!==void 0?W:void 0,Oe=Y(M.loading)&&!M.loading;return(0,H.useEffect)(()=>{L&&Oe&&v.captureEvent("search",L,{value:ue})},[v,L,ue,Oe]),(0,f.jsx)(f.Fragment,{children:le})};function ht(le){return(0,H.forwardRef)((de,Y)=>(0,f.jsx)(k,{inheritParentContextIfAvailable:!0,children:(0,f.jsx)(le,{...de,ref:Y})}))}const Nt=ht((0,H.forwardRef)((le,de)=>{const{onChange:Y,onKeyDown:v=()=>{},onClear:L=()=>{},onSubmit:M=()=>{},debounceTime:W=200,clearButton:ue=!0,fullWidth:Ce=!0,value:Oe,label:tt,placeholder:nt,inputProps:mt={},InputProps:xt={},endAdornment:it,...$e}=le,vt=(0,r.h_)(r.Ds),[Xt,Et]=(0,H.useState)("");(0,H.useEffect)(()=>{Et(zt=>zt!==Oe?String(Oe):zt)},[Oe]),(0,re.Z)(()=>Y(Xt),W,[Xt]);const Zt=(0,H.useCallback)(zt=>{Et(zt.target.value)},[Et]),_t=(0,H.useCallback)(zt=>{v&&v(zt),M&&zt.key==="Enter"&&M()},[v,M]),wn=(0,H.useCallback)(()=>{Y(""),L&&L()},[Y,L]),Kt=tt?void 0:"Search",bt=nt!=null?nt:`Search in ${vt.getOptionalString("app.title")||"Backstage"}`,It=(0,f.jsx)(_.Z,{position:"start",children:(0,f.jsx)(Q.Z,{"aria-label":"Query",size:"small",disabled:!0,children:(0,f.jsx)(j.Z,{})})}),Yt=(0,f.jsx)(_.Z,{position:"end",children:(0,f.jsx)(Z.Z,{"aria-label":"Clear",size:"small",onClick:wn,onKeyDown:zt=>{zt.key==="Enter"&&zt.stopPropagation()},children:"Clear"})});return(0,f.jsx)(rt,{children:(0,f.jsx)(se.Z,{id:"search-bar-text-field","data-testid":"search-bar-next",variant:"outlined",margin:"normal",inputRef:de,value:Xt,label:tt,placeholder:bt,InputProps:{startAdornment:It,endAdornment:ue?Yt:it,...xt},inputProps:{"aria-label":Kt,...mt},fullWidth:Ce,onChange:Zt,onKeyDown:_t,...$e})})})),Ut=ht((0,H.forwardRef)((le,de)=>{const{value:Y="",onChange:v,...L}=le,{term:M,setTerm:W}=w();(0,H.useEffect)(()=>{Y&&W(String(Y))},[Y,W]);const ue=(0,H.useCallback)(Ce=>{v?v(Ce):W(Ce)},[v,W]);return(0,f.jsx)(r.fC,{attributes:{pluginId:"search",extension:"SearchBar"},children:(0,f.jsx)(Nt,{...L,ref:de,value:M,onChange:ue})})}));var Bt=n(4614),Dt=n(88013);const _e=(0,h.Z)(le=>({loading:{right:le.spacing(1),position:"absolute"}})),yt=le=>de=>(0,f.jsx)(k,{inheritParentContextIfAvailable:!0,children:(0,f.jsx)(le,{...de})}),ft=()=>{const le=_e();return(0,f.jsx)(Bt.Z,{className:le.loading,"data-testid":"search-autocomplete-progressbar",color:"inherit",size:20})},Je=yt(function(de){const{loading:Y,value:v,onChange:L=()=>{},options:M=[],getOptionLabel:W=Zt=>String(Zt),inputPlaceholder:ue,inputDebounceTime:Ce,freeSolo:Oe=!0,fullWidth:tt=!0,clearOnBlur:nt=!1,"data-testid":mt="search-autocomplete",...xt}=de,{setTerm:it}=w(),$e=(0,H.useCallback)(Zt=>Zt?typeof Zt=="string"?Zt:W(Zt):"",[W]),vt=(0,H.useMemo)(()=>$e(v),[v,$e]),Xt=(0,H.useCallback)((Zt,_t,wn,Kt)=>{it($e(_t)),L(Zt,_t,wn,Kt)},[$e,it,L]),Et=(0,H.useCallback)(({InputProps:{ref:Zt,className:_t,endAdornment:wn},InputLabelProps:Kt,...bt})=>(0,f.jsx)(Ut,{...bt,ref:Zt,clearButton:!1,value:vt,placeholder:ue,debounceTime:Ce,endAdornment:Y?(0,f.jsx)(ft,{}):wn,InputProps:{className:_t}}),[Y,vt,ue,Ce]);return(0,f.jsx)(Dt.ZP,{...xt,"data-testid":mt,value:v,onChange:Xt,options:M,getOptionLabel:W,renderInput:Et,freeSolo:Oe,fullWidth:tt,clearOnBlur:nt})}),Ft=le=>{const{icon:de,primaryText:Y,primaryTextTypographyProps:v,secondaryText:L,secondaryTextTypographyProps:M,disableTextTypography:W}=le;return _jsxs(_Fragment,{children:[de?_jsx(ListItemIcon,{children:de}):null,_jsx(ListItemText,{primary:Y,primaryTypographyProps:v,secondary:L,secondaryTypographyProps:M,disableTypography:W})]})};var $t=n(42494),Mt=n(84899),Se=n(5806),Be=n(21324),Ge=n(56939),et=n(73698),at=n(12231),Tt=n(90436),pt=n(7089),xe=n(69294);const G=(le,de,Y=[],v=250)=>{const L=(0,H.useRef)({}),M=le||(()=>Promise.resolve([])),[W,ue]=(0,xe.default)(M,[de],{loading:!0});if((0,re.Z)(()=>{L.current[de]===void 0&&(L.current[de]=ue(de).then(Oe=>(L.current[de]=Oe,Oe)))},v,[ue,de]),Y.length)return{loading:!1,value:Y};const Ce=L.current[de];return Array.isArray(Ce)?{loading:!1,value:Ce}:W},pe=(le,de)=>{const{setFilters:Y}=w();(0,H.useEffect)(()=>{de&&[de].flat().length>0&&Y(v=>({...v,[le]:de}))},[])},Ee=le=>{const{className:de,defaultValue:Y,name:v,values:L,valuesDebounceMs:M,label:W,filterSelectedOptions:ue,limitTags:Ce,multiple:Oe}=le,[tt,nt]=(0,H.useState)("");pe(v,Y);const mt=typeof L=="function"?L:void 0,xt=typeof L=="function"?void 0:L,{value:it,loading:$e}=G(mt,tt,xt,M),{filters:vt,setFilters:Xt}=w(),Et=vt[v]||(Oe?[]:null),Zt=(Kt,bt)=>{Xt(It=>{const{[v]:Yt,...zt}=It;return bt?{...zt,[v]:bt}:{...zt}})},_t=Kt=>(0,f.jsx)(se.Z,{...Kt,name:"search",variant:"outlined",label:W,fullWidth:!0}),wn=(Kt,bt)=>Kt.map((It,Yt)=>(0,f.jsx)(pt.Z,{label:It,color:"primary",...bt({index:Yt})}));return(0,f.jsx)(Dt.ZP,{filterSelectedOptions:ue,limitTags:Ce,multiple:Oe,className:de,id:`${Oe?"multi-":""}select-filter-${v}--select`,options:it||[],loading:$e,value:Et,onChange:Zt,onInputChange:(Kt,bt)=>nt(bt),renderInput:_t,renderTags:wn})},He=(0,h.Z)({label:{textTransform:"capitalize"},checkboxWrapper:{display:"flex",alignItems:"center",width:"100%"},textWrapper:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}}),gt=le=>{const{className:de,defaultValue:Y,label:v,name:L,values:M=[],valuesDebounceMs:W}=le,ue=He(),{filters:Ce,setFilters:Oe}=w();pe(L,Y);const tt=typeof M=="function"?M:void 0,nt=typeof M=="function"?void 0:M,{value:mt=[],loading:xt}=G(tt,"",nt,W),it=vt=>{const{target:{value:Xt,checked:Et}}=vt;Oe(Zt=>{const{[L]:_t,...wn}=Zt,Kt=(_t||[]).filter(It=>It!==Xt),bt=Et?[...Kt,Xt]:Kt;return bt.length?{...wn,[L]:bt}:wn})};var $e;return(0,f.jsxs)($t.Z,{className:de,disabled:xt,fullWidth:!0,"data-testid":"search-checkboxfilter-next",children:[v?(0,f.jsx)(Mt.Z,{className:ue.label,children:v}):null,mt.map(vt=>(0,f.jsx)(Se.Z,{classes:{root:ue.checkboxWrapper,label:ue.textWrapper},label:vt,control:(0,f.jsx)(Be.Z,{color:"primary",inputProps:{"aria-labelledby":vt},value:vt,name:vt,onChange:it,checked:(($e=Ce[L])!==null&&$e!==void 0?$e:[]).includes(vt)})},vt))]})},Qe=le=>{const{className:de,defaultValue:Y,label:v,name:L,values:M,valuesDebounceMs:W}=le,ue=He();pe(L,Y);const Ce=typeof M=="function"?M:void 0,Oe=typeof M=="function"?void 0:M,{value:tt=[],loading:nt}=G(Ce,"",Oe,W),{filters:mt,setFilters:xt}=w(),it=$e=>{const{target:{value:vt}}=$e;xt(Xt=>{const{[L]:Et,...Zt}=Xt;return vt?{...Zt,[L]:vt}:Zt})};return(0,f.jsxs)($t.Z,{disabled:nt,className:de,variant:"filled",fullWidth:!0,"data-testid":"search-selectfilter-next",children:[v?(0,f.jsx)(Ge.Z,{className:ue.label,margin:"dense",children:v}):null,(0,f.jsxs)(et.Z,{variant:"outlined",value:mt[L]||"",onChange:it,children:[(0,f.jsx)(at.Z,{value:"",children:(0,f.jsx)("em",{children:"All"})}),tt.map($e=>(0,f.jsx)(at.Z,{value:$e,children:(0,f.jsx)(Tt.Z,{variant:"inherit",noWrap:!0,children:$e})},$e))]})]})},jt=le=>{const{component:de,...Y}=le;return(0,f.jsx)(de,{...Y})};jt.Checkbox=le=>(0,f.jsx)(jt,{...le,component:gt}),jt.Select=le=>(0,f.jsx)(jt,{...le,component:Qe}),jt.Autocomplete=le=>(0,f.jsx)(jt,{...le,component:Ee});var an=n(48834).lW;const tn=le=>an.from(le.toString(),"utf-8").toString("base64"),ln=le=>le?Number(an.from(le,"base64").toString("utf-8")):0,fn=le=>{const{total:de=-1,cursor:Y,hasNextPage:v,onCursorChange:L,limit:M=25,limitLabel:W="Results per page:",limitText:ue=({from:it,to:$e})=>de>0?`of ${de}`:`${it}-${$e}`,limitOptions:Ce,onLimitChange:Oe,...tt}=le,nt=useMemo(()=>ln(Y),[Y]),mt=useCallback((it,$e)=>{var vt;(vt=L)===null||vt===void 0||vt(tn($e))},[L]),xt=useCallback(it=>{var $e;const vt=it.target.value;($e=Oe)===null||$e===void 0||$e(parseInt(vt,10))},[Oe]);return _jsx(TablePagination,{...tt,component:"div",count:de,page:nt,nextIconButtonProps:{...v!==void 0&&{disabled:!v}},onPageChange:mt,rowsPerPage:M,labelRowsPerPage:W,labelDisplayedRows:ue,rowsPerPageOptions:Ce,onRowsPerPageChange:xt})},dn=le=>{const{pageLimit:de,setPageLimit:Y,pageCursor:v,setPageCursor:L,fetchNextPage:M}=useSearch(),W=useCallback(ue=>{Y(ue),L(void 0)},[Y,L]);return _jsx(fn,{...le,hasNextPage:!!M,limit:de,onLimitChange:W,cursor:v,onCursorChange:L})};var Bn=n(53974);const Fn=le=>{const{children:de}=le,Y=useSearch(),{result:v,...L}=Y;return de(v,L)},ot=le=>{const{query:de,children:Y}=le,v=useApi(searchApiRef),L=useAsync(()=>{const{term:M="",types:W=[],filters:ue={},...Ce}=de;return v.query({...Ce,term:M,types:W,filters:ue})},[de]);return Y(L,de)},on=le=>{const{query:de,children:Y}=le;return de?_jsx(ot,{query:de,children:Y}):_jsx(Fn,{children:Y})},Vt=le=>{const{query:de,children:Y,noResultsComponent:v=_jsx(EmptyState,{missing:"data",title:"Sorry, no results were found"}),...L}=le;return _jsx(on,{query:de,children:({loading:M,error:W,value:ue})=>{var Ce;return M?_jsx(Progress,{}):W?_jsx(ResponseErrorPanel,{title:"Error encountered while fetching search results",error:W}):!((Ce=ue)===null||Ce===void 0)&&Ce.results.length?isFunction(Y)?Y(ue):_jsx(SearchResultListItemExtensions,{...L,results:ue.results,children:Y}):v}})},st=le=>_jsx(AnalyticsContext,{attributes:{pluginId:"search",extension:"SearchResult"},children:_jsx(Vt,{...le})}),Sn=({result:le,highlight:de,icon:Y,secondaryAction:v,lineClamp:L=5})=>{var M,W,ue,Ce,Oe;return le?_jsxs(_Fragment,{children:[Y&&_jsx(ListItemIcon,{children:Y}),_jsx(ListItemText,{primaryTypographyProps:{variant:"h6"},primary:_jsx(Link,{noTrack:!0,to:le.location,children:!((M=de)===null||M===void 0)&&M.fields.title?_jsx(HighlightedSearchResultText,{text:((W=de)===null||W===void 0?void 0:W.fields.title)||"",preTag:((ue=de)===null||ue===void 0?void 0:ue.preTag)||"",postTag:((Ce=de)===null||Ce===void 0?void 0:Ce.postTag)||""}):le.title}),secondary:_jsx(Typography,{component:"span",style:{display:"-webkit-box",WebkitBoxOrient:"vertical",WebkitLineClamp:L,overflow:"hidden"},color:"textSecondary",variant:"body2",children:!((Oe=de)===null||Oe===void 0)&&Oe.fields.text?_jsx(HighlightedSearchResultText,{text:de.fields.text,preTag:de.preTag,postTag:de.postTag}):le.text})}),v&&_jsx(Box,{alignItems:"flex-end",children:v})]}):null},qt=le=>_jsx(AnalyticsContext,{attributes:{pluginId:"search",extension:"DefaultResultListItem"},children:_jsx(Sn,{...le})}),Cn=le=>{var de;const{error:Y,loading:v,resultItems:L,renderResultItem:M=Oe=>_jsx(DefaultResultListItem,{result:Oe.document},Oe.document.location),disableRenderingWithNoResults:W,noResultsComponent:ue=W?null:_jsx(EmptyState,{missing:"data",title:"Sorry, no results were found"}),...Ce}=le;return v?_jsx(Progress,{}):Y?_jsx(ResponseErrorPanel,{title:"Error encountered while fetching search results",error:Y}):!((de=L)===null||de===void 0)&&de.length?_jsx(List,{...Ce,children:L.map(M)}):_jsx(_Fragment,{children:ue})},yn=le=>{const{query:de,renderResultItem:Y,children:v,...L}=le,M=useSearchResultListItemExtensions(v);return _jsx(AnalyticsContext,{attributes:{pluginId:"search",extension:"SearchResultList"},children:_jsx(SearchResultState,{query:de,children:({loading:W,error:ue,value:Ce})=>{var Oe;return _jsx(Cn,{...L,error:ue,loading:W,resultItems:(Oe=Ce)===null||Oe===void 0?void 0:Oe.results,renderResultItem:Y!=null?Y:M})}})})};var Hn=n(19126);const fr=(0,h.Z)(le=>({listSubheader:{display:"flex",alignItems:"center"},listSubheaderName:{marginLeft:le.spacing(1),textTransform:"uppercase"},listSubheaderChip:{color:le.palette.text.secondary,margin:le.spacing(0,0,0,1.5)},listSubheaderFilter:{display:"flex",color:le.palette.text.secondary,margin:le.spacing(0,0,0,1.5)},listSubheaderLink:{marginLeft:"auto",display:"flex",alignItems:"center"},listSubheaderLinkIcon:{fontSize:"inherit",marginLeft:le.spacing(.5)}})),$n=le=>{const de=fr(),{label:Y,children:v,...L}=le;return _jsx(Chip,{...L,className:de.listSubheaderFilter,variant:"outlined",label:_jsxs(_Fragment,{children:[Y,": ",v]})})},_n=()=>null,Zn=(0,h.Z)(le=>({root:{fontSize:"inherit","&:focus":{outline:"none",background:le.palette.common.white},"&:not(:focus)":{cursor:"pointer",color:le.palette.primary.main,"&:hover":{textDecoration:"underline"}}}})),Cr=le=>{const de=Zn(),{label:Y,value:v="None",onChange:L,onDelete:M}=le,W=useCallback(ue=>{L(ue.target.value)},[L]);return _jsx($n,{label:Y,onDelete:M,children:_jsx(Typography,{role:"textbox",component:"span",className:de.root,onChange:W,contentEditable:!0,suppressContentEditableWarning:!0,children:v})})},Gn=(0,h.Z)(le=>({root:{fontSize:"inherit","&:not(:focus)":{cursor:"pointer",color:le.palette.primary.main,"&:hover":{textDecoration:"underline"}},"&:focus":{outline:"none"},"&>div:first-child":{padding:0}}})),Re=le=>{const de=Gn(),{label:Y,value:v="none",onChange:L,onDelete:M,children:W}=le,ue=useCallback(Ce=>{L(Ce.target.value)},[L]);return _jsx($n,{label:Y,onDelete:M,children:_jsxs(Select,{className:de.root,value:v,onChange:ue,input:_jsx(InputBase,{}),IconComponent:_n,children:[_jsx(MenuItem,{value:"none",children:"None"}),W]})})};function ne(le){var de,Y;const v=fr(),[L,M]=useState(null),{error:W,loading:ue,icon:Ce,title:Oe,titleProps:tt={},link:nt=_jsxs(_Fragment,{children:["See all",_jsx(ArrowRightIcon,{className:v.listSubheaderLinkIcon})]}),linkProps:mt={},filterOptions:xt,renderFilterOption:it=Yt=>_jsx(MenuItem,{value:String(Yt),children:Yt},String(Yt)),filterFields:$e,renderFilterField:vt,resultItems:Xt,renderResultItem:Et=Yt=>_jsx(DefaultResultListItem,{result:Yt.document},Yt.document.location),disableRenderingWithNoResults:Zt,noResultsComponent:_t=Zt?null:_jsx(EmptyState,{missing:"data",title:"Sorry, no results were found"}),...wn}=le,Kt=useCallback(Yt=>{M(Yt.currentTarget)},[]),bt=useCallback(()=>{M(null)},[]);if(ue)return _jsx(Progress,{});if(W)return _jsx(ResponseErrorPanel,{title:"Error encountered while fetching search results",error:W});if(!(!((de=Xt)===null||de===void 0)&&de.length))return _jsx(_Fragment,{children:_t});var It;return _jsxs(List,{...wn,children:[_jsxs(ListSubheader,{className:v.listSubheader,children:[Ce,_jsx(Typography,{className:v.listSubheaderName,component:"strong",...tt,children:Oe}),xt?_jsx(Chip,{className:v.listSubheaderChip,component:"button",icon:_jsx(AddIcon,{}),variant:"outlined",label:"Add filter","aria-controls":"filters-menu","aria-haspopup":"true",onClick:Kt}):null,xt?_jsx(Menu,{id:"filters-menu",anchorEl:L,open:Boolean(L),onClose:bt,onClick:bt,keepMounted:!0,children:xt.map(it)}):null,(Y=$e)===null||Y===void 0?void 0:Y.map(Yt=>{var zt;return(It=(zt=vt)===null||zt===void 0?void 0:zt(Yt))!==null&&It!==void 0?It:null}),_jsx(Link,{className:v.listSubheaderLink,to:"/search",...mt,children:nt})]}),Xt.map(Et)]})}function Te(le){const{query:de,children:Y,renderResultItem:v,linkProps:L={},...M}=le,W=useSearchResultListItemExtensions(Y);return _jsx(AnalyticsContext,{attributes:{pluginId:"search",extension:"SearchResultGroup"},children:_jsx(SearchResultState,{query:de,children:({loading:ue,error:Ce,value:Oe},{term:tt,types:nt,pageCursor:mt,filters:xt={}})=>{var it;const $e=`/search?${qs.stringify({term:tt,types:nt,filters:xt,pageCursor:mt,query:tt},{arrayFormat:"brackets"})}`;return _jsx(ne,{...M,error:Ce,loading:ue,linkProps:{to:$e,...L},filterFields:Object.keys(xt),resultItems:(it=Oe)===null||it===void 0?void 0:it.results,renderResultItem:v!=null?v:W})}})})}const ze=(0,h.Z)(le=>({root:{display:"flex",justifyContent:"space-between",gap:le.spacing(2),margin:le.spacing(2,0)}})),ct=()=>{const{fetchNextPage:le,fetchPreviousPage:de}=useSearch(),Y=ze();return!le&&!de?_jsx(_Fragment,{}):_jsxs("nav",{"aria-label":"pagination navigation",className:Y.root,children:[_jsx(Button,{"aria-label":"previous page",disabled:!de,onClick:de,startIcon:_jsx(ArrowBackIosIcon,{}),children:"Previous"}),_jsx(Button,{"aria-label":"next page",disabled:!le,onClick:le,endIcon:_jsx(ArrowForwardIosIcon,{}),children:"Next"})]})},Rt="search.results.list.items.extensions.v1",Ht=(le,de)=>{for(const v of le){var Y;if(!(!isValidElement(v)||!(!((Y=getComponentData(v,Rt))===null||Y===void 0)&&Y(de))))return cloneElement(v,{rank:de.rank,highlight:de.highlight,result:de.document,...v.props})}return null},nn=le=>{const{rank:de,result:Y,noTrack:v,children:L,alignItems:M="flex-start",...W}=le,ue=(0,r.z$)(),Ce=(0,H.useCallback)(()=>{v||Y&&ue.captureEvent("discover",Y.title,{attributes:{to:Y.location},value:de})},[de,Y,v,ue]);return(0,f.jsx)(m.Z,{divider:!0,alignItems:M,onClickCapture:Ce,...W,children:L})},gn=le=>{const{name:de,component:Y,predicate:v=()=>!0}=le;return(0,r.YO)({name:de,component:{lazy:()=>Y().then(L=>M=>(0,f.jsx)(nn,{rank:M.rank,result:M.result,noTrack:M.noTrack,children:(0,H.createElement)(L,M)}))},data:{[Rt]:v}})},sn=le=>{const de=useElementFilter(le,Y=>Y.selectByComponentData({key:Rt}).getElements(),[le]);return useCallback((Y,v)=>{const L=Ht(de,Y);return _jsx(Fragment,{children:L!=null?L:_jsx(nn,{rank:Y.rank,result:Y.document,children:_jsx(DefaultResultListItem,{rank:Y.rank,highlight:Y.highlight,result:Y.document})})},v)},[de])},hn=le=>{const{results:de,children:Y,...v}=le,L=sn(Y);return _jsx(List,{...v,children:de.map(L)})}},61886:function(wt,Ie,n){"use strict";n.d(Ie,{Ox:function(){return Bt},jM:function(){return H},Zz:function(){return m},oZ:function(){return k},DR:function(){return h},ZS:function(){return ve},VA:function(){return yt},KY:function(){return q},gT:function(){return j},Dl:function(){return re},ux:function(){return _e},$L:function(){return Z},x1:function(){return be}});var r=n(52322),p=n(2784),V=n(73557),f=n(97456);const H="techdocs.addons.addon.v1",m="techdocs.addons.wrapper.v1",h=()=>null;(0,f.R5)(h,m,!0);const P=Se=>`${H}.${Se.toLocaleLowerCase("en-US")}`;function q(Se){const{name:Be,component:Ge}=Se;return(0,f.YO)({name:Be,component:{sync:et=>(0,r.jsx)(Ge,{...et})},data:{[H]:Se,[P(Be)]:!0}})}const _=(Se,Be)=>Se.selectByComponentData({key:Be}).getElements()[0],Q=Se=>Se.selectByComponentData({key:m}).selectByComponentData({key:H}),se=Se=>Se.selectByComponentData({key:m}).findComponentData({key:H}),Z=()=>{const Se=(0,V.pC)(),Be=(0,f.vJ)(Se,Q),Ge=(0,f.vJ)(Se,se),et=(0,p.useCallback)(pt=>{if(!Be||!pt)return null;const xe=P(pt.name);var G;return(G=_(Be,xe))!==null&&G!==void 0?G:null},[Be]),at=(0,p.useCallback)(pt=>{const xe=Ge.find(G=>G.name===pt);return xe?et(xe):null},[Ge,et]),Tt=(0,p.useCallback)(pt=>{const xe=Ge.filter(G=>G.location===pt);return xe.length?xe.map(et):null},[Ge,et]);return{renderComponentByName:at,renderComponentsByLocation:Tt}},j=(0,f.T0)({id:"plugin.techdocs.service"}),re=(0,f.T0)({id:"plugin.techdocs.storageservice"});var ae=n(64279),oe=n(77446),ee=n(25271),U=n(51837);function T(Se,Be){return Be.getOptionalBoolean("techdocs.legacyUseCaseSensitiveTripletPaths")||(Se.kind=Se.kind.toLocaleLowerCase(),Se.name=Se.name.toLocaleLowerCase(),Se.namespace=Se.namespace.toLocaleLowerCase()),Se}const w=(Se,Be)=>(0,ee.eE)(Se)===(0,ee.eE)(Be),R={title:"",subtitle:"",setTitle:()=>{},setSubtitle:()=>{},setShadowRoot:()=>{},metadata:{loading:!0},entityMetadata:{loading:!0},entityRef:{kind:"",name:"",namespace:""}},F=(0,U.CT)("techdocs-reader-page-context"),ve=(0,p.memo)(Se=>{const{entityRef:Be,children:Ge}=Se,et=(0,f.h_)(j),at=(0,f.h_)(f.Ds),Tt=(0,ae.default)(async()=>et.getEntityMetadata(Be),[Be]),pt=(0,oe.Z)(async()=>et.getTechDocsMetadata(Be),[Be]),[xe,G]=(0,p.useState)(R.title),[pe,Ee]=(0,p.useState)(R.subtitle),[He,gt]=(0,p.useState)(R.shadowRoot);(0,p.useEffect)(()=>{He&&!pt.value&&!pt.loading&&pt.retry()},[pt.value,pt.loading,He,pt.retry,pt]);const Qe={metadata:pt,entityRef:T(Be,at),entityMetadata:Tt,shadowRoot:He,setShadowRoot:gt,title:xe,setTitle:G,subtitle:pe,setSubtitle:Ee},jt=(0,U.EI)({1:Qe});return(0,r.jsx)(f.fC,{attributes:{entityRef:(0,ee.eE)(Be)},children:(0,r.jsx)(F.Provider,{value:jt,children:Ge instanceof Function?Ge(Qe):Ge})})},(Se,Be)=>w(Se.entityRef,Be.entityRef)),be=()=>{const Se=(0,p.useContext)(F);if(Se===void 0)return R;const Be=Se.atVersion(1);if(Be===void 0)throw new Error("No context found for version 1.");return Be},k=Object.freeze({Header:"Header",Subheader:"Subheader",Settings:"Settings",PrimarySidebar:"PrimarySidebar",SecondarySidebar:"SecondarySidebar",Content:"Content"});var rt=n(70882),ht=n(50236),Nt=n(19219),Ut=n(53974);const Bt="TECH_DOCS_SHADOW_DOM_STYLE_LOAD",Dt=Se=>{(0,p.useEffect)(()=>{var Be,Ge;if(!Se)return()=>{};const et=Se.querySelectorAll('head > link[rel="stylesheet"]');var at;let Tt=(at=(Be=et)===null||Be===void 0?void 0:Be.length)!==null&&at!==void 0?at:0;const pt=new CustomEvent(Bt);if(!Tt)return Se.dispatchEvent(pt),()=>{};const xe=()=>{--Tt===0&&Se.dispatchEvent(pt)};return(Ge=et)===null||Ge===void 0||Ge.forEach(G=>{G.addEventListener("load",xe)}),()=>{var G;(G=et)===null||G===void 0||G.forEach(pe=>{pe.removeEventListener("load",xe)})}},[Se])},_e=Se=>{const[Be,Ge]=(0,p.useState)(!1);return(0,p.useEffect)(()=>{if(!Se)return()=>{};Ge(!0);const et=Se.style;et.setProperty("opacity","0");const at=()=>{Ge(!1),et.setProperty("opacity","1")};return Se.addEventListener(Bt,at),()=>{Se.removeEventListener(Bt,at)}},[Se]),Be},yt=Se=>{const{element:Be,onAppend:Ge,children:et}=Se,[at,Tt]=(0,p.useState)((0,rt.Ue)({...(0,ht.Z)(),insertionPoint:void 0}));Dt(Be);const pt=_e(Be),xe=(0,p.useCallback)(G=>{if(!Be||!G)return;Tt((0,rt.Ue)({...(0,ht.Z)(),insertionPoint:Be.querySelector("head")||void 0}));let pe=G.shadowRoot;pe||(pe=G.attachShadow({mode:"open"})),pe.replaceChildren(Be),typeof Ge=="function"&&Ge(pe)},[Be,Ge]);return(0,r.jsxs)(r.Fragment,{children:[pt&&(0,r.jsx)(Ut.Ex,{}),(0,r.jsxs)(Nt.ZP,{jss:at,sheetsManager:new Map,children:[(0,r.jsx)("div",{ref:xe,"data-testid":"techdocs-native-shadowroot"}),et]})]})};var ft=n(54073);const Je=()=>{const{shadowRoot:Se}=useTechDocsReaderPage();return Se},Ft=Se=>{const Be=Je();return Be?Se.map(Ge=>{var et;return(et=Be)===null||et===void 0?void 0:et.querySelectorAll(Ge)}).filter(Ge=>Ge.length).map(Ge=>Array.from(Ge)).flat():[]},$t=Se=>Se.toString()&&Se.rangeCount&&Se.getRangeAt(0).getBoundingClientRect().top,Mt=(Se=0)=>{const Be=Je(),[Ge,et]=useState(null),at=useMemo(()=>debounce(()=>{const Tt=Be,pt=Tt.getSelection?Tt.getSelection():document.getSelection();pt&&$t(pt)?et(pt):et(null)},Se),[Be,et,Se]);return useEffect(()=>(window.document.addEventListener("selectionchange",at),()=>{at.cancel(),window.document.removeEventListener("selectionchange",at)}),[at]),Ge}},52943:function(wt,Ie,n){"use strict";n.r(Ie),n.d(Ie,{EmbeddedDocsRouter:function(){return ee},Router:function(){return oe},isTechDocsAvailable:function(){return ae}});var r=n(52322),p=n(2784),V=n(73557),f=n(25271),H=n(89258),m=n(86317),h=n(65124);const P="backstage.io/techdocs-entity",q=({entity:U})=>{var T;let w=(0,f.iB)(U);if(!((T=U.metadata.annotations)===null||T===void 0)&&T[P])try{var R;w=(0,f.of)((R=U.metadata.annotations)===null||R===void 0?void 0:R[P])}catch{}return(0,r.jsxs)(H.I6,{entityRef:w,children:[(0,r.jsx)(h.b,{}),(0,r.jsx)(m.F,{withSearch:!1})]})};var _=n(53974),Q=n(18662),se=n(7476),Z=n(39709);const j="backstage.io/techdocs-ref",re="backstage.io/techdocs-entity",ae=U=>{var T,w,R,F,ve,be;return Boolean((R=U)===null||R===void 0||(w=R.metadata)===null||w===void 0||(T=w.annotations)===null||T===void 0?void 0:T[j])||Boolean((be=U)===null||be===void 0||(ve=be.metadata)===null||ve===void 0||(F=ve.annotations)===null||F===void 0?void 0:F[re])},oe=()=>(0,r.jsxs)(V.Z5,{children:[(0,r.jsx)(V.AW,{path:"/",element:(0,r.jsx)(Q.TechDocsIndexPage,{})}),(0,r.jsx)(V.AW,{path:"/:namespace/:kind/:name/*",element:(0,r.jsx)(se.TechDocsReaderPage,{})})]}),ee=U=>{var T,w;const{children:R}=U,{entity:F}=(0,Z.X2)(),ve=(0,V.V$)([{path:"/*",element:(0,r.jsx)(q,{entity:F}),children:[{path:"*",element:R}]}]);return((T=F.metadata.annotations)===null||T===void 0?void 0:T[j])||((w=F.metadata.annotations)===null||w===void 0?void 0:w[re])?ve:(0,r.jsx)(_.sk,{annotation:[j]})}},92077:function(wt,Ie,n){"use strict";n.d(Ie,{k:function(){return m},p:function(){return H}});var r=n(87612),p=n(23054),V=n(54847),f=n.n(V);class H{async getApiOrigin(){return await this.discoveryApi.getBaseUrl("techdocs")}async getTechDocsMetadata(P){const{kind:q,namespace:_,name:Q}=P,Z=`${await this.getApiOrigin()}/metadata/techdocs/${_}/${q}/${Q}`,j=await this.fetchApi.fetch(`${Z}`);if(!j.ok)throw await p.VL.fromResponse(j);return await j.json()}async getEntityMetadata(P){const{kind:q,namespace:_,name:Q}=P,Z=`${await this.getApiOrigin()}/metadata/entity/${_}/${q}/${Q}`,j=await this.fetchApi.fetch(`${Z}`);if(!j.ok)throw await p.VL.fromResponse(j);return await j.json()}constructor(P){(0,r._)(this,"configApi",void 0),(0,r._)(this,"discoveryApi",void 0),(0,r._)(this,"fetchApi",void 0),this.configApi=P.configApi,this.discoveryApi=P.discoveryApi,this.fetchApi=P.fetchApi}}class m{async getApiOrigin(){return await this.discoveryApi.getBaseUrl("techdocs")}async getStorageUrl(){var P;return(P=this.configApi.getOptionalString("techdocs.storageUrl"))!==null&&P!==void 0?P:`${await this.discoveryApi.getBaseUrl("techdocs")}/static/docs`}async getBuilder(){return this.configApi.getString("techdocs.builder")}async getEntityDocs(P,q){const{kind:_,namespace:Q,name:se}=P,j=`${await this.getStorageUrl()}/${Q}/${_}/${se}/${q}`,re=await this.fetchApi.fetch(`${j.endsWith("/")?j:`${j}/`}index.html`);let ae="";switch(re.status){case 404:throw ae="Page not found. ",q||(ae+="This could be because there is no index.md file in the root of the docs directory of this repository."),new p.dR(ae);case 500:throw ae="Could not generate documentation or an error in the TechDocs backend. ",new Error(ae);default:break}return re.text()}async syncEntityDocs(P,q=()=>{}){const{kind:_,namespace:Q,name:se}=P,j=`${await this.getApiOrigin()}/sync/${Q}/${_}/${se}`,{token:re}=await this.identityApi.getCredentials();return new Promise((ae,oe)=>{const ee=new V.EventSourcePolyfill(j,{withCredentials:!0,headers:re?{Authorization:`Bearer ${re}`}:{}});ee.addEventListener("log",U=>{U.data&&q(JSON.parse(U.data))}),ee.addEventListener("finish",U=>{let T=!1;U.data&&({updated:T}=JSON.parse(U.data)),ae(T?"updated":"cached")}),ee.onerror=U=>{switch(ee.close(),U.status){case 404:oe(new p.dR(U.message));return;default:oe(new Error(U.data));return}}})}async getBaseUrl(P,q,_){const{kind:Q,namespace:se,name:Z}=q,re=`${await this.getApiOrigin()}/static/docs/${se}/${Q}/${Z}/${_}`;return new URL(P,re.endsWith("/")?re:`${re}/`).toString()}constructor(P){(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=P.configApi,this.discoveryApi=P.discoveryApi,this.identityApi=P.identityApi,this.fetchApi=P.fetchApi}}},51953:function(wt,Ie,n){"use strict";n.d(Ie,{D:function(){return r}});function r(p,V){return V.getOptionalBoolean("techdocs.legacyUseCaseSensitiveTripletPaths")?p:p.toLocaleLowerCase("en-US")}},3482:function(wt,Ie,n){"use strict";n.d(Ie,{u:function(){return P}});var r=n(52322),p=n(2784),V=n(53974),f=n(39709),H=n(42081),m=n(48431),h=n(68435);const P=q=>{const{initialFilter:_="owned",columns:Q,actions:se}=q;return(0,r.jsx)(H.j,{children:(0,r.jsxs)(V.VY,{children:[(0,r.jsx)(V.yW,{title:"",children:(0,r.jsx)(V.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)(m.f,{}),(0,r.jsx)(f.EW,{initialFilter:_}),(0,r.jsx)(f.dq,{}),(0,r.jsx)(f.xE,{})]}),(0,r.jsx)(f._i.Content,{children:(0,r.jsx)(h.n,{actions:se,columns:Q})})]})})]})})}},85478:function(wt,Ie,n){"use strict";n.d(Ie,{f:function(){return Q}});var r=n(52322),p=n(95573),V=n(51953),f=n(97456),H=n(53974),m=n(94339),h=n(16111),P=n(24579),q=n(14503),_=n(2784);const Q=ae=>{var oe;const{entities:ee}=ae,U=(0,f.tg)(p.Fw),T=(0,f.h_)(f.Ds);if(!ee)return null;var w,R;return(0,r.jsx)(H.Oh,{"data-testid":"docs-explore",children:!((oe=ee)===null||oe===void 0)&&oe.length?ee.map((F,ve)=>(0,r.jsxs)(m.Z,{children:[(0,r.jsx)(h.Z,{children:(0,r.jsx)(H.hu,{title:(w=F.metadata.title)!==null&&w!==void 0?w:F.metadata.name})}),(0,r.jsx)(P.Z,{children:F.metadata.description}),(0,r.jsx)(q.Z,{children:(0,r.jsx)(H.Qj,{to:U({namespace:(0,V.D)((R=F.metadata.namespace)!==null&&R!==void 0?R:"default",T),kind:(0,V.D)(F.kind,T),name:(0,V.D)(F.metadata.name,T)}),color:"primary","data-testid":"read_docs",children:"Read Docs"})})]},ve)):null})};var se=n(39709);const Z={title:"All Documentation",filterPredicate:()=>!0},j=ae=>{const{entities:oe,group:ee}=ae,{loading:U,isOwnedEntity:T}=useEntityOwnership(),w=oe.filter(F=>ee.filterPredicate==="ownedByUser"?U?!1:T(F):typeof ee.filterPredicate=="function"&&ee.filterPredicate(F)),R=(()=>typeof ee.title=="string"?_jsx(ContentHeader,{title:ee.title}):ee.title)();return w.length===0?null:_jsxs(Content,{children:[R,_jsx(DocsCardGrid,{entities:w})]})},re=ae=>{const{loading:oe,error:ee,entities:U}=useEntityList();if(ee)return _jsx(WarningPanel,{severity:"error",title:"Could not load available documentation.",children:_jsx(CodeSnippet,{language:"text",text:ee.toString()})});if(oe)return _jsx(Progress,{});if(U.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,w;return U.sort((R,F)=>((T=R.metadata.title)!==null&&T!==void 0?T:R.metadata.name).localeCompare((w=F.metadata.title)!==null&&w!==void 0?w:F.metadata.name)),_jsx(Content,{children:(ae.groups||[Z]).map((R,F)=>_jsx(j,{entities:U,group:R},`${R.title}-${F}`))})}},68435:function(wt,Ie,n){"use strict";n.d(Ie,{H:function(){return U},n:function(){return T}});var r=n(52322),p=n(2784),V=n(95074),f=n(76635),H=n(53974),m=n(39709),h=n(97456),P=n(25271),q=n(95573),_=n(39981),Q=n(2337),se=n(11640),Z=n(28347);const j=(0,Q.Z)({root:{color:"#f3ba37"}})(se.Z),re={createCopyDocsUrlAction(w){return R=>({icon:()=>(0,r.jsx)(_.Z,{fontSize:"small"}),tooltip:"Click to copy documentation link to clipboard",onClick:()=>w(`${window.location.origin}${R.resolved.docsUrl}`)})},createStarEntityAction(w,R){return F=>{const ve=F.entity,be=w(ve);return{cellStyle:{paddingLeft:"1em"},icon:()=>be?(0,r.jsx)(j,{}):(0,r.jsx)(Z.Z,{}),tooltip:be?"Remove from favorites":"Add to favorites",onClick:()=>R(ve)}}}};function ae(w){return w.metadata.title||w.metadata.name}const oe={createNameColumn(){return{title:"Document",field:"entity.metadata.name",highlight:!0,render:w=>(0,r.jsx)(H.uw,{value:(0,r.jsx)(H.rU,{to:w.resolved.docsUrl,children:ae(w.entity)}),subvalue:w.entity.metadata.description})}},createOwnerColumn(){return{title:"Owner",field:"resolved.ownedByRelationsTitle",render:({resolved:w})=>(0,r.jsx)(m.rI,{entityRefs:w.ownedByRelations,defaultKind:"group"})}},createTypeColumn(){return{title:"Type",field:"entity.spec.type"}}};var ee=n(51953);const U=w=>{const{entities:R,title:F,loading:ve,columns:be,actions:k,options:rt}=w,[,ht]=(0,V.Z)(),Nt=(0,h.tg)(q.Fw),Ut=(0,h.h_)(h.Ds);if(!R)return null;const Bt=R.map(yt=>{const ft=(0,m.hF)(yt,P.S4);var Je;return{entity:yt,resolved:{docsUrl:Nt({namespace:(0,ee.D)((Je=yt.metadata.namespace)!==null&&Je!==void 0?Je:"default",Ut),kind:(0,ee.D)(yt.kind,Ut),name:(0,ee.D)(yt.metadata.name,Ut)}),ownedByRelations:ft,ownedByRelationsTitle:ft.map(Ft=>(0,m.$3)(Ft,{defaultKind:"group"})).join(", ")}}}),Dt=[oe.createNameColumn(),oe.createOwnerColumn(),oe.createTypeColumn()],_e=[re.createCopyDocsUrlAction(ht)];return(0,r.jsx)(r.Fragment,{children:ve||Bt&&Bt.length>0?(0,r.jsx)(H.iA,{isLoading:ve,options:{paging:!0,pageSize:20,search:!0,actionsColumnIndex:-1,...rt},data:Bt,columns:be||Dt,actions:k||_e,title:F?`${F} (${Bt.length})`:`All (${Bt.length})`}):(0,r.jsx)(H.ub,{missing:"data",title:"No documents to show",description:"Create your own document. Check out our Getting Started Information",action:(0,r.jsx)(H.Qj,{color:"primary",to:"https://backstage.io/docs/features/techdocs/getting-started",variant:"contained",children:"DOCS"})})})};U.columns=oe,U.actions=re;const T=w=>{var R;const{columns:F,actions:ve,options:be}=w,{loading:k,error:rt,entities:ht,filters:Nt}=(0,m.wp)(),{isStarredEntity:Ut,toggleStarredEntity:Bt}=(0,m.CR)(),[,Dt]=(0,V.Z)();var _e;const yt=(0,f.capitalize)((_e=(R=Nt.user)===null||R===void 0?void 0:R.value)!==null&&_e!==void 0?_e:"all"),ft=[re.createCopyDocsUrlAction(Dt),re.createStarEntityAction(Ut,Bt)];return rt?(0,r.jsx)(H.GB,{severity:"error",title:"Could not load available documentation.",children:(0,r.jsx)(H.Oi,{language:"text",text:rt.toString()})}):(0,r.jsx)(U,{title:yt,entities:ht,loading:k,actions:ve||ft,columns:F,options:be})};T.columns=oe,T.actions=re},18662:function(wt,Ie,n){"use strict";n.r(Ie),n.d(Ie,{TechDocsIndexPage:function(){return H}});var r=n(52322),p=n(2784),V=n(73557),f=n(3482);const H=m=>(0,V.pC)()||(0,r.jsx)(f.u,{...m})},42081:function(wt,Ie,n){"use strict";n.d(Ie,{j:function(){return H}});var r=n(52322),p=n(2784),V=n(53974),f=n(97456);const H=m=>{const{children:h}=m,P=(0,f.h_)(f.Ds);var q;const _=`Documentation available in ${(q=P.getOptionalString("organization.name"))!==null&&q!==void 0?q:"Backstage"}`;return(0,r.jsx)(V.g9,{title:"Documentation",subtitle:_,themeId:"documentation",children:h})}},48431:function(wt,Ie,n){"use strict";n.d(Ie,{f:function(){return f}});var r=n(2784),p=n(39709);class V{getCatalogFilters(){return{"metadata.annotations.backstage.io/techdocs-ref":p.n3}}}const f=()=>{const{updateFilters:H}=(0,p.wp)();return(0,r.useEffect)(()=>{H({techdocs:new V})},[H]),null}},89258:function(wt,Ie,n){"use strict";n.d(Ie,{I6:function(){return Q},Jl:function(){return _},s4:function(){return m}});var r=n(61886),p=n(92077),V=n(95573),f=n(97456),H=n(15096);const m=(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:Z,discoveryApi:j,identityApi:re,fetchApi:ae})=>new p.k({configApi:Z,discoveryApi:j,identityApi:re,fetchApi:ae})}),(0,f.ni)({api:r.gT,deps:{configApi:f.Ds,discoveryApi:f.NW,fetchApi:f.gP},factory:({configApi:Z,discoveryApi:j,fetchApi:re})=>new p.p({configApi:Z,discoveryApi:j,fetchApi:re})})],routes:{root:V._Z,docRoot:V.Fw,entityContent:V.pd}}),h=m.provide((0,f.P4)({name:"TechdocsPage",component:()=>Promise.resolve().then(n.bind(n,52943)).then(Z=>Z.Router),mountPoint:V._Z})),P=m.provide((0,f.P4)({name:"EntityTechdocsContent",component:()=>Promise.resolve().then(n.bind(n,52943)).then(Z=>Z.EmbeddedDocsRouter),mountPoint:V.pd})),q=m.provide((0,f.P4)({name:"TechDocsCustomHome",component:()=>n.e(7560).then(n.bind(n,27560)).then(Z=>Z.TechDocsCustomHome),mountPoint:V._Z})),_=m.provide((0,f.P4)({name:"TechDocsIndexPage",component:()=>Promise.resolve().then(n.bind(n,18662)).then(Z=>Z.TechDocsIndexPage),mountPoint:V._Z})),Q=m.provide((0,f.P4)({name:"TechDocsReaderPage",component:()=>Promise.resolve().then(n.bind(n,7476)).then(Z=>Z.TechDocsReaderPage),mountPoint:V.Fw})),se=m.provide((0,H.E5)({name:"TechDocsSearchResultListItem",component:()=>Promise.resolve().then(n.bind(n,55511)).then(Z=>Z.TechDocsSearchResultListItem),predicate:Z=>Z.type==="techdocs"}))},7476:function(wt,Ie,n){"use strict";n.r(Ie),n.d(Ie,{TechDocsReaderLayout:function(){return Q},TechDocsReaderPage:function(){return se}});var r=n(52322),p=n(2784),V=n(73557),f=n(53974),H=n(61886),m=n(86317),h=n(93225),P=n(65124),q=n(95573),_=n(97456);const Q=Z=>{const{withSearch:j,withHeader:re=!0}=Z;return(0,r.jsxs)(f.T3,{themeId:"documentation",children:[re&&(0,r.jsx)(h.S,{}),(0,r.jsx)(P.b,{}),(0,r.jsx)(m.F,{withSearch:j})]})},se=Z=>{const{kind:j,name:re,namespace:ae}=(0,_.Oi)(q.Fw),{children:oe,entityRef:ee={kind:j,name:re,namespace:ae}}=Z,U=(0,V.pC)();if(!oe){const w=U?p.Children.toArray(U.props.children):[];var T;const F=w.flatMap(ve=>{var be,k;return(T=(k=ve)===null||k===void 0||(be=k.props)===null||be===void 0?void 0:be.children)!==null&&T!==void 0?T:[]}).find(ve=>!(0,_.IY)(ve,H.Zz)&&!(0,_.IY)(ve,H.jM));return(0,r.jsx)(H.ZS,{entityRef:ee,children:F||(0,r.jsx)(Q,{})})}return(0,r.jsx)(H.ZS,{entityRef:ee,children:({metadata:w,entityMetadata:R,onReady:F})=>(0,r.jsx)("div",{className:"techdocs-reader-page",children:(0,r.jsx)(f.T3,{themeId:"documentation",children:oe instanceof Function?oe({entityRef:ee,techdocsMetadataValue:w.value,entityMetadataValue:R.value,onReady:F}):oe})})})}},86317:function(wt,Ie,n){"use strict";n.d(Ie,{F:function(){return de}});var r=n(52322),p=n(2784),V=n(79692),f=n(60905),H=n(61886),m=n(53974),h=n(22478),P=n(4614),q=n(77277),_=n(99688),Q=n(12420),se=n(90436),Z=n(61837),j=n(4190),re=n(87685);const ae=(0,V.Z)(v=>(0,Q.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}})),oe=({buildLog:v,onClose:L})=>{const M=ae(),W=v.length===0?"Waiting for logs...":v.join(`
|
|
37
|
+
`);return(0,r.jsxs)(f.Z,{container:!0,direction:"column",className:M.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)(se.Z,{variant:"h5",children:"Build Details"}),(0,r.jsx)(Z.Z,{title:"Close the drawer",onClick:L,color:"inherit",children:(0,r.jsx)(re.Z,{})},"dismiss")]}),(0,r.jsx)(f.Z,{item:!0,xs:!0,children:(0,r.jsx)(m.nU,{text:W,classes:{root:M.logs}})})]})},ee=({buildLog:v})=>{const L=ae(),[M,W]=(0,p.useState)(!1);return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(q.Z,{color:"inherit",onClick:()=>W(!0),children:"Show Build Logs"}),(0,r.jsx)(j.ZP,{classes:{paper:L.paper},anchor:"right",open:M,onClose:()=>W(!1),children:(0,r.jsx)(oe,{buildLog:v,onClose:()=>W(!1)})})]})};var U=n(97456);const T=({errorMessage:v})=>{const L=(0,U.h_)(U.Ds).getOptionalString("techdocs.builder");let M="";return L!=="local"&&(M="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)(m.mf,{status:"404",statusMessage:v||"Documentation not found",additionalInfo:M})};var w=n(95481);const R=(0,V.Z)(v=>({root:{marginBottom:v.spacing(2)},message:{wordBreak:"break-word",overflowWrap:"anywhere"}})),F=()=>{let v=null;const L=R(),{state:M,contentReload:W,contentErrorMessage:ue,syncErrorMessage:Ce,buildLog:Oe}=(0,w.DK)();return M==="INITIAL_BUILD"&&(v=(0,r.jsx)(_.Z,{classes:{root:L.root},variant:"outlined",severity:"info",icon:(0,r.jsx)(P.Z,{size:"24px"}),action:(0,r.jsx)(ee,{buildLog:Oe}),children:"Documentation is accessed for the first time and is being prepared. The subsequent loads are much faster."})),M==="CONTENT_STALE_REFRESHING"&&(v=(0,r.jsx)(_.Z,{variant:"outlined",severity:"info",icon:(0,r.jsx)(P.Z,{size:"24px"}),action:(0,r.jsx)(ee,{buildLog:Oe}),classes:{root:L.root},children:"A newer version of this documentation is being prepared and will be available shortly."})),M==="CONTENT_STALE_READY"&&(v=(0,r.jsx)(_.Z,{variant:"outlined",severity:"success",action:(0,r.jsx)(q.Z,{color:"inherit",onClick:()=>W(),children:"Refresh"}),classes:{root:L.root},children:"A newer version of this documentation is now available, please refresh to view."})),M==="CONTENT_STALE_ERROR"&&(v=(0,r.jsxs)(_.Z,{variant:"outlined",severity:"error",action:(0,r.jsx)(ee,{buildLog:Oe}),classes:{root:L.root,message:L.message},children:["Building a newer version of this documentation failed."," ",Ce]})),M==="CONTENT_NOT_FOUND"&&(v=(0,r.jsxs)(r.Fragment,{children:[Ce&&(0,r.jsxs)(_.Z,{variant:"outlined",severity:"error",action:(0,r.jsx)(ee,{buildLog:Oe}),classes:{root:L.root,message:L.message},children:["Building a newer version of this documentation failed."," ",Ce]}),(0,r.jsx)(T,{errorMessage:ue})]})),v};var ve=n(60364),be=n(41156),k=n(32838),rt=n(35368),ht=n.n(rt);const Nt=/main\.[A-Fa-f0-9]{8}\.min\.css$/,Ut=/^https:\/\/fonts\.googleapis\.com/,Bt=/^https:\/\/fonts\.gstatic\.com/,Dt=v=>v.nodeName==="LINK",_e=v=>{var L;const M=((L=v)===null||L===void 0?void 0:L.getAttribute("href"))||"",W=M.match(Nt),ue=M.match(Ut),Ce=M.match(Bt);return W||ue||Ce},yt=v=>(Dt(v)&&!_e(v)&&v.remove(),v),ft=v=>v.nodeName==="IFRAME",Je=(v,L)=>{const M=v.getAttribute("src")||"";try{const{host:W}=new URL(M);return L.includes(W)}catch{return!1}},Ft=v=>L=>(ft(L)&&!Je(L,v)&&L.remove(),L),$t=()=>{const v=(0,U.h_)(U.Ds);return(0,p.useMemo)(()=>v.getOptionalConfig("techdocs.sanitizer"),[v])},Mt=()=>{const v=$t();return(0,p.useCallback)(async L=>{var M;const W=(M=v)===null||M===void 0?void 0:M.getOptionalStringArray("allowedIframeHosts");ht().addHook("beforeSanitizeElements",yt);const ue=["link"];return W&&(ue.push("iframe"),ht().addHook("beforeSanitizeElements",Ft(W))),ht().sanitize(L.outerHTML,{ADD_TAGS:ue,FORBID_TAGS:["style"],WHOLE_DOCUMENT:!0,RETURN_DOM:!0})},[v])};var Se=n(41128),Be=({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,Se.$n)(v.palette.text.secondary,.7)};
|
|
49
|
+
--md-default-fg-color--lightest: ${(0,Se.$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,Se.$n)(v.palette.background.paper,.7)};
|
|
55
|
+
--md-default-bg-color--lightest: ${(0,Se.$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,Se.$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,Se.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,Se.Fq)(v.palette.error.dark,.5):(0,Se.Fq)(v.palette.error.light,.5)};
|
|
128
|
+
--md-typeset-ins-color: ${v.palette.type==="dark"?(0,Se.Fq)(v.palette.success.dark,.5):(0,Se.Fq)(v.palette.success.light,.5)};
|
|
129
|
+
--md-typeset-mark-color: ${v.palette.type==="dark"?(0,Se.Fq)(v.palette.warning.dark,.5):(0,Se.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
|
+
`,Ge=({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 et="224px";var at=({theme:v,sidebar:L})=>`
|
|
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, .md-footer__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: ${L.isPinned?`calc(-12.1rem + ${et})`:"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 Tt=["h1","h2","h3","h4","h5","h6"];var pt=({theme:v})=>`
|
|
375
|
+
/*================== Typeset ==================*/
|
|
376
|
+
|
|
377
|
+
.md-typeset {
|
|
378
|
+
font-size: var(--md-typeset-font-size);
|
|
379
|
+
}
|
|
380
|
+
|
|
381
|
+
${Tt.reduce((L,M)=>{var W;const ue=(W=v.typography.htmlFontSize)!==null&&W!==void 0?W:16,Ce=v.typography[M],{lineHeight:Oe,fontFamily:tt,fontWeight:nt,fontSize:mt}=Ce,xt=it=>{let $e=1;return typeof it=="number"&&($e=it/ue*.6),typeof it=="string"&&($e=it.replace("rem","")),`calc(${$e} * var(--md-typeset-font-size))`};return L.concat(`
|
|
382
|
+
.md-typeset ${M} {
|
|
383
|
+
color: var(--md-default-fg-color);
|
|
384
|
+
line-height: ${Oe};
|
|
385
|
+
font-family: ${tt};
|
|
386
|
+
font-weight: ${nt};
|
|
387
|
+
font-size: ${xt(mt)};
|
|
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
|
+
`,xe=()=>`
|
|
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
|
+
`,G=({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 pe=[Be,Ge,at,pt,xe,G],Ee=()=>(0,m.Pf)(),He=()=>{const v=Ee(),L=(0,ve.Z)();return(0,p.useMemo)(()=>{const M={theme:L,sidebar:v};return pe.reduce((W,ue)=>W+ue(M),"")},[L,v])},gt=()=>{const v=He();return(0,p.useCallback)(L=>(L.getElementsByTagName("head")[0].insertAdjacentHTML("beforeend",`<style>${v}</style>`),L),[v])},Qe=(v,L,M)=>{const W=v==="src"&&L.endsWith(".svg"),ue=!L.match(/^([a-z]*:)?\/\//i),Ce=L.startsWith(M);return W&&(ue||Ce)},jt=({techdocsStorageApi:v,entityId:L,path:M})=>async W=>{const ue=await v.getApiOrigin(),Ce=async(Oe,tt)=>{for(const nt of Oe)if(nt.hasAttribute(tt)){const mt=nt.getAttribute(tt);if(!mt)return;const xt=await v.getBaseUrl(mt,L,M);if(Qe(tt,mt,ue))try{const $e=await(await fetch(xt,{credentials:"include"})).text();nt.setAttribute(tt,`data:image/svg+xml;base64,${btoa(unescape(encodeURIComponent($e)))}`)}catch{nt.setAttribute("alt",`Error: ${mt}`)}else nt.setAttribute(tt,xt)}};return await Promise.all([Ce(W.querySelectorAll("img"),"src"),Ce(W.querySelectorAll("script"),"src"),Ce(W.querySelectorAll("source"),"src"),Ce(W.querySelectorAll("link"),"href"),Ce(W.querySelectorAll("a[download]"),"href")]),W};var an=n(40556),tn=n(67097),ln=n(28316),fn=n(82717),dn=n.n(fn);const Bn=v=>L=>{var M,W,ue,Ce,Oe,tt;const nt=L.querySelector('[title="Edit this page"]');if(!nt||!nt.href)return L;const mt=new URL(nt.href),xt=v.byUrl(mt);if(((M=xt)===null||M===void 0?void 0:M.type)!=="github"&&((W=xt)===null||W===void 0?void 0:W.type)!=="gitlab")return L;const it=((ue=L.querySelector("article>h1"))===null||ue===void 0?void 0:ue.childNodes[0].textContent)||"",$e=encodeURIComponent(`Documentation Feedback: ${it}`),vt=encodeURIComponent(`Page source:
|
|
518
|
+
${nt.href}
|
|
519
|
+
|
|
520
|
+
Feedback:`),Xt=((Ce=xt)===null||Ce===void 0?void 0:Ce.type)==="github"?(0,an.BT)(mt.href,"blob"):mt.href,Et=dn()(Xt),Zt=`/${Et.organization}/${Et.name}`,_t=nt.cloneNode();switch((Oe=xt)===null||Oe===void 0?void 0:Oe.type){case"gitlab":_t.href=`${mt.origin}${Zt}/issues/new?issue[title]=${$e}&issue[description]=${vt}`;break;case"github":_t.href=`${mt.origin}${Zt}/issues/new?title=${$e}&body=${vt}`;break;default:return L}return ln.render(p.createElement(tn.Z),_t),_t.style.paddingLeft="5px",_t.title="Leave feedback for this page",_t.id="git-feedback-link",(tt=nt)===null||tt===void 0||tt.insertAdjacentElement("beforebegin",_t),L};var Fn=n(44882);const ot=()=>v=>{var L;const M=v.querySelector('.md-header label[for="__drawer"]'),W=v.querySelector("article");if(!M||!W)return v;const ue=M.cloneNode();return ln.render(p.createElement(Fn.Z),ue),ue.id="toggle-sidebar",ue.title="Toggle Sidebar",ue.classList.add("md-content__button"),ue.style.setProperty("padding","0 0 0 5px"),ue.style.setProperty("margin","0.4rem 0 0.4rem 0.4rem"),(L=W)===null||L===void 0||L.prepend(ue),v},on=()=>v=>(((M,W)=>{Array.from(M).filter(ue=>ue.hasAttribute(W)).forEach(ue=>{const Ce=ue.getAttribute(W);if(Ce){Ce.match(/^https?:\/\//i)&&ue.setAttribute("target","_blank");try{const Oe=Vt(window.location.href);ue.setAttribute(W,new URL(Ce,Oe).toString())}catch{ue.replaceWith(ue.textContent||Ce)}}})})(Array.from(v.getElementsByTagName("a")),"href"),v);function Vt(v){const L=new URL(v);return!L.pathname.endsWith("/")&&!L.pathname.endsWith(".html")&&(L.pathname+="/"),L.toString()}const st=({baseUrl:v,onClick:L})=>M=>(Array.from(M.getElementsByTagName("a")).forEach(W=>{W.addEventListener("click",ue=>{const Oe=W.getAttribute("href");Oe&&Oe.startsWith(v)&&!W.hasAttribute("download")&&(ue.preventDefault(),L(ue,Oe))})}),M);var Sn=n(15459),qt=n(80030),Cn=n(72379),yn=n(41547),Hn=n(95074);const fr=(0,Sn.Z)(v=>({tooltip:{fontSize:"inherit",color:v.palette.text.primary,margin:0,padding:v.spacing(.5),backgroundColor:"transparent",boxShadow:"none"}}))(qt.ZP),$n=()=>(0,r.jsx)(Cn.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"})}),_n=({text:v})=>{const[L,M]=(0,p.useState)(!1),[,W]=(0,Hn.Z)(),ue=(0,p.useCallback)(()=>{W(v),M(!0)},[v,W]),Ce=(0,p.useCallback)(()=>{M(!1)},[M]);return(0,r.jsx)(fr,{title:"Copied to clipboard",placement:"left",open:L,onClose:Ce,leaveDelay:1e3,children:(0,r.jsx)(Z.Z,{style:{color:"inherit"},className:"md-clipboard md-icon",onClick:ue,children:(0,r.jsx)($n,{})})})},Zn=v=>L=>{const M=L.querySelectorAll("pre > code");for(const Ce of M){var W,ue;const Oe=Ce.textContent||"",tt=document.createElement("div");(ue=Ce)===null||ue===void 0||(W=ue.parentElement)===null||W===void 0||W.prepend(tt),ln.render((0,r.jsx)(yn.Z,{theme:v,children:(0,r.jsx)(_n,{text:Oe})}),tt)}return L},Cr=()=>v=>{var L;return(L=v.querySelector(".md-header"))===null||L===void 0||L.remove(),v},Gn=()=>v=>{var L,M;return(L=v.querySelector(".md-footer .md-copyright"))===null||L===void 0||L.remove(),(M=v.querySelector(".md-footer-copyright"))===null||M===void 0||M.remove(),v},Re=({onLoading:v,onLoaded:L})=>M=>(v(),M.addEventListener(H.Ox,function W(){L(),M.removeEventListener(H.Ox,W)}),M),ne=()=>v=>(v.addEventListener(H.Ox,function L(){if(window.location.hash){var M,W;const ue=window.location.hash.slice(1);(W=v)===null||W===void 0||(M=W.querySelector(`[id="${ue}"]`))===null||M===void 0||M.scrollIntoView()}v.removeEventListener(H.Ox,L)}),v),Te=()=>v=>(setTimeout(()=>{var L;const M=(L=v)===null||L===void 0?void 0:L.querySelectorAll("li.md-nav__item--active");M.length!==0&&(M.forEach(ue=>{var Ce,Oe;const tt=(Ce=ue)===null||Ce===void 0?void 0:Ce.querySelector("input");if(!(!((Oe=tt)===null||Oe===void 0)&&Oe.checked)){var nt;(nt=tt)===null||nt===void 0||nt.click()}}),M[M.length-1].scrollIntoView())},200),v),ze=async(v,L)=>{let M;if(typeof v=="string")M=new DOMParser().parseFromString(v,"text/html").documentElement;else if(v instanceof Element)M=v;else throw new Error("dom is not a recognized type");for(const W of L)M=await W(M);return M};var ct=n(73557);function Rt(v,L){const M=new URL(L),W=`${M.origin}${M.pathname.replace(/\/$/,"")}`,ue=v.replace(W,"").replace(/^\/+/,""),Ce=new URL(`http://localhost/${ue}`);return`${Ce.pathname}${Ce.search}${Ce.hash}`}function Ht(){const v=(0,ct.s0)(),M=(0,U.h_)(U.Ds).getOptionalString("app.baseUrl");return(0,p.useCallback)(ue=>{let Ce=ue;if(M)try{Ce=Rt(ue,M)}catch{}v(Ce)},[v,M])}const nn="screen and (max-width: 76.1875em)",gn=v=>{const L=Ht(),M=(0,ve.Z)(),W=(0,be.Z)(nn),ue=Mt(),Ce=gt(),Oe=(0,U.z$)(),tt=(0,U.h_)(H.Dl),nt=(0,U.h_)(k.q3),{state:mt,path:xt,content:it}=(0,w.DK)(),[$e,vt]=(0,p.useState)(null),Xt=(0,H.ux)($e),Et=(0,p.useCallback)(()=>{if(!$e)return;$e.querySelectorAll(".md-sidebar").forEach(bt=>{if(W)bt.style.top="0px";else{var It,Yt,zt;const bn=(It=document)===null||It===void 0?void 0:It.querySelector(".techdocs-reader-page");var gr;const ar=(gr=(Yt=bn)===null||Yt===void 0?void 0:Yt.getBoundingClientRect().top)!==null&&gr!==void 0?gr:0;var er;let Kn=(er=$e.getBoundingClientRect().top)!==null&&er!==void 0?er:0;const zr=$e.querySelector(".md-container > .md-tabs");var ir;const tr=(ir=(zt=zr)===null||zt===void 0?void 0:zt.getBoundingClientRect().height)!==null&&ir!==void 0?ir:0;Kn<ar&&(Kn=ar),bt.style.top=`${Math.max(Kn,0)+tr}px`}bt.style.setProperty("opacity","1")})},[$e,W]);(0,p.useEffect)(()=>(window.addEventListener("resize",Et),window.addEventListener("scroll",Et,!0),()=>{window.removeEventListener("resize",Et),window.removeEventListener("scroll",Et,!0)}),[$e,Et]);const Zt=(0,p.useCallback)(()=>{if(!$e)return;const Kt=$e.querySelector(".md-footer");Kt&&(Kt.style.width=`${$e.getBoundingClientRect().width}px`)},[$e]);(0,p.useEffect)(()=>(window.addEventListener("resize",Zt),()=>{window.removeEventListener("resize",Zt)}),[$e,Zt]),(0,p.useEffect)(()=>{Xt||(Zt(),Et())},[mt,Xt,Zt,Et]);const _t=(0,p.useCallback)((Kt,bt)=>ze(Kt,[ue,jt({techdocsStorageApi:tt,entityId:v,path:bt}),on(),ot(),Cr(),Gn(),Bn(nt),Ce]),[v,nt,tt,ue,Ce]),wn=(0,p.useCallback)(async Kt=>ze(Kt,[ne(),Te(),Zn(M),st({baseUrl:window.location.origin,onClick:(bt,It)=>{var Yt;const zt=bt.ctrlKey||bt.metaKey,gr=new URL(It),er=((Yt=bt.target)===null||Yt===void 0?void 0:Yt.innerText)||It,ir=It.replace(window.location.origin,"");if(Oe.captureEvent("click",er,{attributes:{to:ir}}),gr.hash)if(zt)window.open(It,"_blank");else{var bn,ar;L(It),(ar=Kt)===null||ar===void 0||(bn=ar.querySelector(`[id="${gr.hash.slice(1)}"]`))===null||bn===void 0||bn.scrollIntoView()}else zt?window.open(It,"_blank"):L(It)}}),Re({onLoading:()=>{},onLoaded:()=>{var bt;(bt=Kt.querySelector(".md-nav__title"))===null||bt===void 0||bt.removeAttribute("for")}}),Re({onLoading:()=>{Array.from(Kt.querySelectorAll(".md-sidebar")).forEach(It=>{It.style.setProperty("opacity","0")})},onLoaded:()=>{}})]),[M,L,Oe]);return(0,p.useEffect)(()=>{if(!it)return()=>{};let Kt=!0;return _t(it,xt).then(async bt=>{var It;if(!(!((It=bt)===null||It===void 0)&&It.innerHTML)||!Kt)return;window.scroll({top:0});const Yt=await wn(bt);vt(Yt)}),()=>{Kt=!1}},[it,xt,_t,wn]),$e};var sn=n(8560);const hn=()=>{var v,L,M,W,ue;const Ce=(0,H.$L)(),{shadowRoot:Oe}=(0,H.x1)(),tt=(v=Oe)===null||v===void 0?void 0:v.querySelector('[data-md-component="content"]'),nt=(L=Oe)===null||L===void 0?void 0:L.querySelector('div[data-md-component="sidebar"][data-md-type="navigation"], div[data-md-component="navigation"]');let mt=(M=nt)===null||M===void 0?void 0:M.querySelector('[data-techdocs-addons-location="primary sidebar"]');if(!mt){var xt;mt=document.createElement("div"),mt.setAttribute("data-techdocs-addons-location","primary sidebar"),(xt=nt)===null||xt===void 0||xt.prepend(mt)}const it=(W=Oe)===null||W===void 0?void 0:W.querySelector('div[data-md-component="sidebar"][data-md-type="toc"], div[data-md-component="toc"]');let $e=(ue=it)===null||ue===void 0?void 0:ue.querySelector('[data-techdocs-addons-location="secondary sidebar"]');if(!$e){var vt;$e=document.createElement("div"),$e.setAttribute("data-techdocs-addons-location","secondary sidebar"),(vt=it)===null||vt===void 0||vt.prepend($e)}return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(sn.Z,{container:mt,children:Ce.renderComponentsByLocation(H.oZ.PrimarySidebar)}),(0,r.jsx)(sn.Z,{container:tt,children:Ce.renderComponentsByLocation(H.oZ.Content)}),(0,r.jsx)(sn.Z,{container:$e,children:Ce.renderComponentsByLocation(H.oZ.SecondarySidebar)})]})},le=(0,V.Z)({search:{width:"100%","@media (min-width: 76.1875em)":{width:"calc(100% - 34.4rem)",margin:"0 auto"},"@media print":{display:"none"}}}),de=(0,w.m1)(v=>{var L,M;const{withSearch:W=!0,onReady:ue}=v,Ce=le(),{entityMetadata:{value:Oe,loading:tt},entityRef:nt,setShadowRoot:mt}=(0,H.x1)(),xt=gn(nt),it=(0,p.useCallback)($e=>{mt($e),ue instanceof Function&&ue()},[mt,ue]);return tt===!1&&!Oe?(0,r.jsx)(m.mf,{status:"404",statusMessage:"PAGE NOT FOUND"}):xt?(0,r.jsx)(m.VY,{children:(0,r.jsxs)(f.Z,{container:!0,children:[(0,r.jsx)(f.Z,{xs:12,item:!0,children:(0,r.jsx)(F,{})}),W&&(0,r.jsx)(f.Z,{className:Ce.search,xs:"auto",item:!0,children:(0,r.jsx)(h.S,{entityId:nt,entityTitle:(M=Oe)===null||M===void 0||(L=M.metadata)===null||L===void 0?void 0:L.title})}),(0,r.jsx)(f.Z,{xs:12,item:!0,children:(0,r.jsx)(H.VA,{element:xt,onAppend:it,children:(0,r.jsx)(hn,{})})})]})}):(0,r.jsx)(m.VY,{children:(0,r.jsx)(f.Z,{container:!0,children:(0,r.jsx)(f.Z,{xs:12,item:!0,children:(0,r.jsx)(F,{})})})})}),Y=null},93225:function(wt,Ie,n){"use strict";n.d(Ie,{S:function(){return ae}});var r=n(52322),p=n(2784),V=n(18671),f=n(60905),H=n(98069),m=n(60364),h=n(73250),P=n(61886),q=n(39709),_=n(25271),Q=n(53974),se=n(97456),Z=n(76635),j=n(95573);const re=(0,r.jsx)(H.Z,{animation:"wave",variant:"text",height:40}),ae=oe=>{var ee,U,T;const{palette:{common:{white:w}}}=(0,m.Z)(),{children:R}=oe,F=(0,P.$L)(),ve=(0,se.h_)(se.Ds),{title:be,setTitle:k,subtitle:rt,setSubtitle:ht,entityRef:Nt,metadata:{value:Ut,loading:Bt},entityMetadata:{value:Dt,loading:_e}}=(0,P.x1)();(0,p.useEffect)(()=>{Ut&&(k(Ut.site_name),ht(()=>{let{site_description:at}=Ut;return(!at||at==="None")&&(at=""),at}))},[Ut,k,ht]);const yt=ve.getOptional("app.title")||"Backstage",ft=[be,rt,yt].filter(Boolean).join(" | "),{locationMetadata:Je,spec:Ft}=Dt||{},$t=(ee=Ft)===null||ee===void 0?void 0:ee.lifecycle,Mt=Dt?(0,q.hF)(Dt,_.S4):[],Se=(0,se.tg)(j._Z)(),Be=(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(Q.i9,{label:(0,Z.capitalize)(((U=Dt)===null||U===void 0?void 0:U.kind)||"entity"),value:(0,r.jsx)(q.dx,{color:"inherit",entityRef:Nt,title:(T=Dt)===null||T===void 0?void 0:T.metadata.title,defaultKind:"Component"})}),Mt.length>0&&(0,r.jsx)(Q.i9,{label:"Owner",value:(0,r.jsx)(q.rI,{color:"inherit",entityRefs:Mt,defaultKind:"group"})}),$t?(0,r.jsx)(Q.i9,{label:"Lifecycle",value:$t}):null,Je&&Je.type!=="dir"&&Je.type!=="file"?(0,r.jsx)(Q.i9,{label:"",value:(0,r.jsxs)(f.Z,{container:!0,direction:"column",alignItems:"center",style:{color:w},children:[(0,r.jsx)(f.Z,{style:{padding:0},item:!0,children:(0,r.jsx)(h.Z,{style:{marginTop:"-25px"}})}),(0,r.jsx)(f.Z,{style:{padding:0},item:!0,children:"Source"})]}),url:Je.target}):null]});return!_e&&Dt===void 0||!Bt&&Ut===void 0?null:(0,r.jsxs)(Q.h4,{type:"Documentation",typeLink:Se,title:be||re,subtitle:rt===""?void 0:rt||re,children:[(0,r.jsx)(V.Z,{titleTemplate:"%s",children:(0,r.jsx)("title",{children:ft})}),Be,R,F.renderComponentsByLocation(P.oZ.Header)]})}},65124:function(wt,Ie,n){"use strict";n.d(Ie,{b:function(){return se}});var r=n(52322),p=n(2784),V=n(79692),f=n(15223),H=n(95544),m=n(80030),h=n(61837),P=n(48348),q=n(47603),_=n(61886);const Q=(0,V.Z)(Z=>({root:{gridArea:"pageSubheader",flexDirection:"column",minHeight:"auto",padding:Z.spacing(3,3,0),"@media print":{display:"none"}}})),se=Z=>{const j=Q(),[re,ae]=(0,p.useState)(null),oe=(0,p.useCallback)(ve=>{ae(ve.currentTarget)},[]),ee=(0,p.useCallback)(()=>{ae(null)},[]),{entityMetadata:{value:U,loading:T}}=(0,_.x1)(),w=(0,_.$L)(),R=w.renderComponentsByLocation(_.oZ.Subheader),F=w.renderComponentsByLocation(_.oZ.Settings);return!R&&!F||T===!1&&!U?null:(0,r.jsx)(f.Z,{classes:j,...Z.toolbarProps,children:(0,r.jsxs)(H.Z,{display:"flex",justifyContent:"flex-end",width:"100%",flexWrap:"wrap",children:[R,F?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(m.ZP,{title:"Settings",children:(0,r.jsx)(h.Z,{"aria-controls":"tech-docs-reader-page-settings","aria-haspopup":"true",onClick:oe,children:(0,r.jsx)(q.Z,{})})}),(0,r.jsx)(P.Z,{id:"tech-docs-reader-page-settings",getContentAnchorEl:null,anchorEl:re,anchorOrigin:{vertical:"bottom",horizontal:"right"},open:Boolean(re),onClose:ee,keepMounted:!0,children:(0,r.jsx)("div",{children:F})})]}):null]})})}},95481:function(wt,Ie,n){"use strict";n.d(Ie,{DK:function(){return se},m1:function(){return j}});var r=n(52322),p=n(2784),V=n(73557),f=n(61886),H=n(97456),m=n(64279),h=n(77446);function P({contentLoading:re,content:ae,activeSyncState:oe}){return re||oe==="BUILD_READY_RELOAD"||!ae&&oe==="CHECKING"?"CHECKING":!ae&&oe==="BUILDING"?"INITIAL_BUILD":ae?oe==="BUILDING"?"CONTENT_STALE_REFRESHING":oe==="BUILD_READY"?"CONTENT_STALE_READY":oe==="ERROR"?"CONTENT_STALE_ERROR":"CONTENT_FRESH":"CONTENT_NOT_FOUND"}function q(re,ae){const oe={...re};switch(ae.type){case"sync":ae.state==="CHECKING"&&(oe.buildLog=[]),oe.activeSyncState=ae.state,oe.syncError=ae.syncError;break;case"contentLoading":oe.contentLoading=!0,oe.contentError=void 0;break;case"content":typeof ae.path=="string"&&(oe.path=ae.path),oe.contentLoading=!1,oe.content=ae.content,oe.contentError=ae.contentError;break;case"buildLog":oe.buildLog=oe.buildLog.concat(ae.log);break;default:throw new Error}return["BUILD_READY","BUILD_READY_RELOAD"].includes(oe.activeSyncState)&&["contentLoading","content"].includes(ae.type)&&(oe.activeSyncState="UP_TO_DATE",oe.buildLog=[]),oe}function _(re,ae,oe,ee){var U,T;const[w,R]=(0,p.useReducer)(q,{activeSyncState:"CHECKING",path:ee,contentLoading:!0,buildLog:[]}),F=(0,H.h_)(f.Dl),{retry:ve}=(0,h.Z)(async()=>{R({type:"contentLoading"});try{const rt=await F.getEntityDocs({kind:re,namespace:ae,name:oe},ee);return R({type:"content",content:rt,path:ee}),rt}catch(rt){R({type:"content",contentError:rt,path:ee})}},[F,re,ae,oe,ee]),be=(0,p.useRef)({content:void 0,reload:()=>{}});return be.current={content:w.content,reload:ve},(0,m.default)(async()=>{R({type:"sync",state:"CHECKING"});const rt=setTimeout(()=>{R({type:"sync",state:"BUILDING"})},1e3);try{switch(await F.syncEntityDocs({kind:re,namespace:ae,name:oe},Nt=>{R({type:"buildLog",log:Nt})})){case"updated":be.current.content?R({type:"sync",state:"BUILD_READY"}):(be.current.reload(),R({type:"sync",state:"BUILD_READY_RELOAD"}));break;case"cached":R({type:"sync",state:"UP_TO_DATE"});break;default:R({type:"sync",state:"ERROR",syncError:new Error("Unexpected return state")});break}}catch(ht){R({type:"sync",state:"ERROR",syncError:ht})}finally{clearTimeout(rt)}},[re,oe,ae,F,R,be]),{state:(0,p.useMemo)(()=>P({activeSyncState:w.activeSyncState,contentLoading:w.contentLoading,content:w.content}),[w.activeSyncState,w.content,w.contentLoading]),contentReload:ve,path:w.path,content:w.content,contentErrorMessage:(U=w.contentError)===null||U===void 0?void 0:U.toString(),syncErrorMessage:(T=w.syncError)===null||T===void 0?void 0:T.toString(),buildLog:w.buildLog}}const Q=(0,p.createContext)({}),se=()=>(0,p.useContext)(Q),Z=re=>{const{children:ae}=re,{"*":oe=""}=(0,V.UO)(),{entityRef:ee}=(0,f.x1)(),{kind:U,namespace:T,name:w}=ee,R=_(U,T,w,oe);return(0,r.jsx)(Q.Provider,{value:R,children:ae instanceof Function?ae(R):ae})},j=re=>ae=>(0,r.jsx)(Z,{children:(0,r.jsx)(re,{...ae})})},95573:function(wt,Ie,n){"use strict";n.d(Ie,{Fw:function(){return V},_Z:function(){return p},pd:function(){return f}});var r=n(97456);const p=(0,r.NT)({id:"techdocs:index-page"}),V=(0,r.NT)({id:"techdocs:reader-page",params:["namespace","kind","name"]}),f=(0,r.NT)({id:"techdocs:catalog-reader-view"})},55511:function(wt,Ie,n){"use strict";n.r(Ie),n.d(Ie,{TechDocsSearchResultListItem:function(){return _}});var r=n(52322),p=n(2784),V=n(79692),f=n(49378),H=n(86136),m=n(90436),h=n(53974),P=n(15096);const q=(0,V.Z)({flexContainer:{flexWrap:"wrap"},itemText:{width:"100%",marginBottom:"1rem"}}),_=Q=>{const{result:se,highlight:Z,lineClamp:j=5,asListItem:re=!0,asLink:ae=!0,title:oe,icon:ee}=Q,U=q(),T=({children:F})=>ae?(0,r.jsx)(h.rU,{noTrack:!0,to:se.location,children:F}):(0,r.jsx)(r.Fragment,{children:F}),w=()=>{var F,ve,be,k;const rt=!((F=Z)===null||F===void 0)&&F.fields.title?(0,r.jsx)(P.FA,{text:Z.fields.title,preTag:Z.preTag,postTag:Z.postTag}):se.title,ht=!((ve=Z)===null||ve===void 0)&&ve.fields.entityTitle?(0,r.jsx)(P.FA,{text:Z.fields.entityTitle,preTag:Z.preTag,postTag:Z.postTag}):se.entityTitle,Nt=!((be=Z)===null||be===void 0)&&be.fields.name?(0,r.jsx)(P.FA,{text:Z.fields.name,preTag:Z.preTag,postTag:Z.postTag}):se.name;return se?(0,r.jsx)(f.Z,{className:U.itemText,primaryTypographyProps:{variant:"h6"},primary:(0,r.jsx)(T,{children:oe||(0,r.jsxs)(r.Fragment,{children:[rt," | ",ht!=null?ht:Nt," docs"]})}),secondary:(0,r.jsx)(m.Z,{component:"span",style:{display:"-webkit-box",WebkitBoxOrient:"vertical",WebkitLineClamp:j,overflow:"hidden"},color:"textSecondary",variant:"body2",children:!((k=Z)===null||k===void 0)&&k.fields.text?(0,r.jsx)(P.FA,{text:Z.fields.text,preTag:Z.preTag,postTag:Z.postTag}):se.text})}):null},R=({children:F})=>re?(0,r.jsxs)(r.Fragment,{children:[ee&&(0,r.jsx)(H.Z,{children:typeof ee=="function"?ee(se):ee}),(0,r.jsx)("div",{className:U.flexContainer,children:F})]}):(0,r.jsx)(r.Fragment,{children:F});return(0,r.jsx)(R,{children:(0,r.jsx)(w,{})})}},22478:function(wt,Ie,n){"use strict";n.d(Ie,{S:function(){return P}});var r=n(52322),p=n(15096),V=n(2784),f=n(73557),H=n(55511);const m=q=>{var _;return(_=q)===null||_===void 0?void 0:_.document},h=q=>{const{entityId:_,entityTitle:Q,debounceTime:se=150}=q,[Z,j]=(0,V.useState)(!1),re=(0,f.s0)(),{setFilters:ae,result:{loading:oe,value:ee}}=(0,p.Rx)(),[U,T]=(0,V.useState)([]);(0,V.useEffect)(()=>{let be=!0;if(be&&ee){const k=ee.results.slice(0,10);T(k)}return()=>{be=!1}},[oe,ee]);const{kind:w,name:R,namespace:F}=_;(0,V.useEffect)(()=>{ae(be=>({...be,kind:w,namespace:F,name:R}))},[w,F,R,ae]);const ve=(be,k)=>{if(m(k)){const{location:rt}=k.document;re(rt)}};return(0,r.jsx)(p.qO,{"data-testid":"techdocs-search-bar",size:"small",open:Z,getOptionLabel:()=>"",filterOptions:be=>be,onClose:()=>{j(!1)},onFocus:()=>{j(!0)},onChange:ve,blurOnSelect:!0,noOptionsText:"No results found",value:null,options:U,renderOption:({document:be,highlight:k})=>(0,r.jsx)(H.TechDocsSearchResultListItem,{result:be,lineClamp:3,asListItem:!1,asLink:!1,title:be.title,highlight:k}),loading:oe,inputDebounceTime:se,inputPlaceholder:`Search ${Q||_.name} docs`,freeSolo:!1})},P=q=>{const _={term:"",types:["techdocs"],pageCursor:"",filters:q.entityId};return(0,r.jsx)(p.Nd,{initialState:_,children:(0,r.jsx)(h,{...q})})}},53260:function(){}},function(wt){var Ie=function(r){return wt(wt.s=r)};wt.O(0,[2370,6202,9284,9035,2126,7012,2194,1410,427,242,5109,6816,1213,5218,4736],function(){return Ie(72171)});var n=wt.O()}]);})();
|
|
521
|
+
|
|
522
|
+
//# sourceMappingURL=main.2d4c0606.js.map
|