@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
|
@@ -1,522 +0,0 @@
|
|
|
1
|
-
(()=>{(self.webpackChunktechdocs_cli_embedded_app=self.webpackChunktechdocs_cli_embedded_app||[]).push([[179],{4791:function(Lt,Le,n){"use strict";n.d(Le,{n3:function(){return m},MS:function(){return ye}});var r=n(87612),p=n(25271),W=n(23054),f=n(96279),V=n.n(f);const m=Symbol.for("CATALOG_FILTER_EXISTS_0e15b590c0b343a2bae3e787e84c2111");function h(le){return!le.cursor}function F(le){return!h(le)}class ye{async getEntityAncestors(z,de){const{kind:D,namespace:E,name:se}=(0,p.of)(z.entityRef);return await this.requestRequired("GET",`/entities/by-name/${encodeURIComponent(D)}/${encodeURIComponent(E)}/${encodeURIComponent(se)}/ancestry`,de)}async getLocationById(z,de){return await this.requestOptional("GET",`/locations/${encodeURIComponent(z)}`,de)}async getEntities(z,de){const{filter:D=[],fields:E=[],order:se,offset:ie,limit:ne,after:X}=z!=null?z:{},K=this.getParams(D);if(E.length&&K.push(`fields=${E.map(encodeURIComponent).join(",")}`),se)for(const U of[se].flat())U&&K.push(`order=${encodeURIComponent(U.order)}:${encodeURIComponent(U.field)}`);ie!==void 0&&K.push(`offset=${ie}`),ne!==void 0&&K.push(`limit=${ne}`),X!==void 0&&K.push(`after=${encodeURIComponent(X)}`);const R=K.length?`?${K.join("&")}`:"",w=await this.requestRequired("GET",`/entities${R}`,de),I=(U,xe)=>{var Se,k;if(((Se=U.metadata)===null||Se===void 0?void 0:Se.name)===void 0||U.kind===void 0||((k=xe.metadata)===null||k===void 0?void 0:k.name)===void 0||xe.kind===void 0)return 0;const Ke=(0,p.eE)(U),yt=(0,p.eE)(xe);return Ke<yt?-1:Ke>yt?1:0};return{items:w.sort(I)}}async getEntitiesByRefs(z,de){var D,E,se;const ie={entityRefs:z.entityRefs};!((D=z.fields)===null||D===void 0)&&D.length&&(ie.fields=z.fields);const X=`${await this.discoveryApi.getBaseUrl("catalog")}/entities/by-refs`,K=await this.fetchApi.fetch(X,{headers:{"Content-Type":"application/json",...((E=de)===null||E===void 0?void 0:E.token)&&{Authorization:`Bearer ${(se=de)===null||se===void 0?void 0:se.token}`}},method:"POST",body:JSON.stringify(ie)});if(!K.ok)throw await W.VL.fromResponse(K);const{items:R}=await K.json();return{items:R.map(w=>w!=null?w:void 0)}}async queryEntities(z={},de){const D=[];if(h(z)){var E,se,ie,ne;const{fields:K=[],filter:R,limit:w,orderFields:I,fullTextFilter:U}=z;D.push(...this.getParams(R)),w!==void 0&&D.push(`limit=${w}`),I!==void 0&&(Array.isArray(I)?I:[I]).forEach(({field:Se,order:k})=>D.push(`orderField=${Se},${k}`)),K.length&&D.push(`fields=${K.map(encodeURIComponent).join(",")}`);const xe=(se=U)===null||se===void 0||(E=se.term)===null||E===void 0?void 0:E.trim();xe&&D.push(`fullTextFilterTerm=${xe}`),!((ne=U)===null||ne===void 0||(ie=ne.fields)===null||ie===void 0)&&ie.length&&D.push(`fullTextFilterFields=${U.fields.join(",")}`)}else{const{fields:K=[],limit:R,cursor:w}=z;D.push(`cursor=${w}`),R!==void 0&&D.push(`limit=${R}`),K.length&&D.push(`fields=${K.map(encodeURIComponent).join(",")}`)}const X=D.length?`?${D.join("&")}`:"";return this.requestRequired("GET",`/entities/by-query${X}`,de)}async getEntityByRef(z,de){const{kind:D,namespace:E,name:se}=(0,p.of)(z);return this.requestOptional("GET",`/entities/by-name/${encodeURIComponent(D)}/${encodeURIComponent(E)}/${encodeURIComponent(se)}`,de)}async getEntityByName(z,de){const{kind:D,namespace:E="default",name:se}=z;return this.requestOptional("GET",`/entities/by-name/${encodeURIComponent(D)}/${encodeURIComponent(E)}/${encodeURIComponent(se)}`,de)}async refreshEntity(z,de){var D,E;const se=await this.fetchApi.fetch(`${await this.discoveryApi.getBaseUrl("catalog")}/refresh`,{headers:{"Content-Type":"application/json",...((D=de)===null||D===void 0?void 0:D.token)&&{Authorization:`Bearer ${(E=de)===null||E===void 0?void 0:E.token}`}},method:"POST",body:JSON.stringify({entityRef:z})});if(se.status!==200)throw new Error(await se.text())}async getEntityFacets(z,de){const{filter:D=[],facets:E}=z,se=this.getParams(D);for(const ne of E)se.push(`facet=${encodeURIComponent(ne)}`);const ie=se.length?`?${se.join("&")}`:"";return await this.requestOptional("GET",`/entity-facets${ie}`,de)}async addLocation(z,de){var D,E;const{type:se="url",target:ie,dryRun:ne}=z,X=await this.fetchApi.fetch(`${await this.discoveryApi.getBaseUrl("catalog")}/locations${ne?"?dryRun=true":""}`,{headers:{"Content-Type":"application/json",...((D=de)===null||D===void 0?void 0:D.token)&&{Authorization:`Bearer ${(E=de)===null||E===void 0?void 0:E.token}`}},method:"POST",body:JSON.stringify({type:se,target:ie})});if(X.status!==201)throw new Error(await X.text());const{location:K,entities:R,exists:w}=await X.json();if(!K)throw new Error(`Location wasn't added: ${ie}`);return{location:K,entities:R,exists:w}}async getLocationByRef(z,de){return(await this.requestRequired("GET","/locations",de)).map(E=>E.data).find(E=>z===(0,p.NZ)(E))}async removeLocationById(z,de){await this.requestIgnored("DELETE",`/locations/${encodeURIComponent(z)}`,de)}async removeEntityByUid(z,de){await this.requestIgnored("DELETE",`/entities/by-uid/${encodeURIComponent(z)}`,de)}async validateEntity(z,de,D){var E,se;const ie=await this.fetchApi.fetch(`${await this.discoveryApi.getBaseUrl("catalog")}/validate-entity`,{headers:{"Content-Type":"application/json",...((E=D)===null||E===void 0?void 0:E.token)&&{Authorization:`Bearer ${(se=D)===null||se===void 0?void 0:se.token}`}},method:"POST",body:JSON.stringify({entity:z,location:de})});if(ie.ok)return{valid:!0};if(ie.status!==400)throw await W.VL.fromResponse(ie);const{errors:ne=[]}=await ie.json();return{valid:!1,errors:ne}}async requestIgnored(z,de,D){var E;const se=`${await this.discoveryApi.getBaseUrl("catalog")}${de}`,ie=!((E=D)===null||E===void 0)&&E.token?{Authorization:`Bearer ${D.token}`}:{},ne=await this.fetchApi.fetch(se,{method:z,headers:ie});if(!ne.ok)throw await W.VL.fromResponse(ne)}async requestRequired(z,de,D){var E;const se=`${await this.discoveryApi.getBaseUrl("catalog")}${de}`,ie=!((E=D)===null||E===void 0)&&E.token?{Authorization:`Bearer ${D.token}`}:{},ne=await this.fetchApi.fetch(se,{method:z,headers:ie});if(!ne.ok)throw await W.VL.fromResponse(ne);return ne.json()}async requestOptional(z,de,D){var E;const se=`${await this.discoveryApi.getBaseUrl("catalog")}${de}`,ie=!((E=D)===null||E===void 0)&&E.token?{Authorization:`Bearer ${D.token}`}:{},ne=await this.fetchApi.fetch(se,{method:z,headers:ie});if(!ne.ok){if(ne.status===404)return;throw await W.VL.fromResponse(ne)}return await ne.json()}getParams(z=[]){const de=[];for(const D of[z].flat()){const E=[];for(const[se,ie]of Object.entries(D))for(const ne of[ie].flat())ne===m?E.push(encodeURIComponent(se)):typeof ne=="string"&&E.push(`${encodeURIComponent(se)}=${encodeURIComponent(ne)}`);E.length&&de.push(`filter=${E.join(",")}`)}return de}constructor(z){(0,r._)(this,"discoveryApi",void 0),(0,r._)(this,"fetchApi",void 0),this.discoveryApi=z.discoveryApi,this.fetchApi=z.fetchApi||{fetch:V()}}}},25271:function(Lt,Le,n){"use strict";n.d(Le,{Tf:function(){return W},P1:function(){return Pn},q1:function(){return Gn},M6:function(){return Kn},l2:function(){return p},zG:function(){return r},w$:function(){return xn},nP:function(){return pn},aS:function(){return Jt},S4:function(){return gt},cz:function(){return _e},wI:function(){return xe},iB:function(){return Dt},CV:function(){return Ie},of:function(){return Yt},Ou:function(){return be},eE:function(){return ct},NZ:function(){return pe}});const r="default",p="backstage.io/view-url",W="backstage.io/edit-url",f="kubernetes.io/api-server",V="kubernetes.io/api-server-certificate-authority",m="kubernetes.io/auth-provider";var h=n(76635),F=n.n(h);class ye{async enforce(N){return N.metadata.namespace?N:lodash.merge({metadata:{namespace:this.namespace}},N)}constructor(N=DEFAULT_NAMESPACE){_define_property(this,"namespace",void 0),this.namespace=N}}class le{static isValidPrefixAndOrSuffix(N,ce,Ae,$e){if(typeof N!="string")return!1;const qe=N.split(ce);return qe.length===1?$e(qe[0]):qe.length===2?Ae(qe[0])&&$e(qe[1]):!1}static isJsonSafe(N){try{return F().isEqual(N,JSON.parse(JSON.stringify(N)))}catch{return!1}}static isValidDnsSubdomain(N){return typeof N=="string"&&N.length>=1&&N.length<=253&&N.split(".").every(le.isValidDnsLabel)}static isValidDnsLabel(N){return typeof N=="string"&&N.length>=1&&N.length<=63&&/^[a-z0-9]+(?:\-+[a-z0-9]+)*$/.test(N)}static isValidTag(N){return typeof N=="string"&&N.length>=1&&N.length<=63&&/^[a-z0-9+#]+(\-[a-z0-9+#]+)*$/.test(N)}static isValidUrl(N){if(typeof N!="string")return!1;try{return new URL(N),!0}catch{return!1}}static isValidString(N){var ce,Ae;return typeof N=="string"&&((Ae=N)===null||Ae===void 0||(ce=Ae.trim())===null||ce===void 0?void 0:ce.length)>=1}static isNonEmptyString(N){var ce,Ae;return typeof N=="string"&&((Ae=N)===null||Ae===void 0||(ce=Ae.trim())===null||ce===void 0?void 0:ce.length)>=1}}var z=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}}}}}'),de=n(27991),D=n.n(de),E=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"}}}`),se=JSON.parse('{"$schema":"http://json-schema.org/draft-07/schema","$id":"EntityMeta","description":"Metadata fields common to all versions/kinds of entity.","examples":[{"uid":"e01199ab-08cc-44c2-8e19-5c29ded82521","etag":"lsndfkjsndfkjnsdfkjnsd==","name":"my-component-yay","namespace":"the-namespace","labels":{"backstage.io/custom":"ValueStuff"},"annotations":{"example.com/bindings":"are-secret"},"tags":["java","data"]}],"type":"object","required":["name"],"additionalProperties":true,"properties":{"uid":{"type":"string","description":"A globally unique ID for the entity. This field can not be set by the user at creation time, and the server will reject an attempt to do so. The field will be populated in read operations. The field can (optionally) be specified when performing update or delete operations, but the server is free to reject requests that do so in such a way that it breaks semantics.","examples":["e01199ab-08cc-44c2-8e19-5c29ded82521"],"minLength":1},"etag":{"type":"string","description":"An opaque string that changes for each update operation to any part of the entity, including metadata. This field can not be set by the user at creation time, and the server will reject an attempt to do so. The field will be populated in read operations. The field can (optionally) be specified when performing update or delete operations, and the server will then reject the operation if it does not match the current stored value.","examples":["lsndfkjsndfkjnsdfkjnsd=="],"minLength":1},"name":{"type":"string","description":"The name of the entity. Must be unique within the catalog at any given point in time, for any given namespace + kind pair.","examples":["metadata-proxy"],"minLength":1},"namespace":{"type":"string","description":"The namespace that the entity belongs to.","default":"default","examples":["default","admin"],"minLength":1},"title":{"type":"string","description":"A display name of the entity, to be presented in user interfaces instead of the name property, when available.","examples":["React SSR Template"],"minLength":1},"description":{"type":"string","description":"A short (typically relatively few words, on one line) description of the entity."},"labels":{"type":"object","description":"Key/value pairs of identifying information attached to the entity.","additionalProperties":true,"patternProperties":{"^.+$":{"type":"string"}}},"annotations":{"type":"object","description":"Key/value pairs of non-identifying auxiliary information attached to the entity.","additionalProperties":true,"patternProperties":{"^.+$":{"type":"string"}}},"tags":{"type":"array","description":"A list of single-valued strings, to for example classify catalog entities in various ways.","items":{"type":"string","minLength":1}},"links":{"type":"array","description":"A list of external hyperlinks related to the entity. Links can provide additional contextual information that may be located outside of Backstage itself. For example, an admin dashboard or external CMS page.","items":{"type":"object","required":["url"],"properties":{"url":{"type":"string","description":"A url in a standard uri format.","examples":["https://admin.example-org.com"],"minLength":1},"title":{"type":"string","description":"A user friendly display name for the link.","examples":["Admin Dashboard"],"minLength":1},"icon":{"type":"string","description":"A key representing a visual icon to be displayed in the UI.","examples":["dashboard"],"minLength":1},"type":{"type":"string","description":"An optional value to categorize links into specific groups.","examples":["runbook","documentation","logs","dashboard"],"minLength":1}}}}}}'),ie=JSON.parse('{"$schema":"http://json-schema.org/draft-07/schema","$id":"common","type":"object","description":"Common definitions to import from other schemas","definitions":{"reference":{"$id":"#reference","type":"object","description":"A reference by name to another entity.","required":["kind","namespace","name"],"additionalProperties":false,"properties":{"kind":{"type":"string","description":"The kind field of the entity.","minLength":1},"namespace":{"type":"string","description":"The metadata.namespace field of the entity.","minLength":1},"name":{"type":"string","description":"The metadata.name field of the entity.","minLength":1}}},"relation":{"$id":"#relation","type":"object","description":"A directed relation from one entity to another.","required":["type","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 ne=new Map,X=[z,E,se,ie];function K(H){var N;if(!(!((N=H)===null||N===void 0)&&N.length))throw new TypeError("Unknown error");const ce=H[0];throw new TypeError(`${ce.instancePath||"<root>"} ${ce.message}${ce.params?` - ${Object.entries(ce.params).map(([Ae,$e])=>`${Ae}: ${$e}`).join(", ")}`:""}`)}function R(H,N={}){var ce,Ae;const $e=(Ae=(ce=N)===null||ce===void 0?void 0:ce.disableCache)!==null&&Ae!==void 0?Ae:!1,qe=$e?"":JSON.stringify(H);if(!$e){const ln=ne.get(qe);if(ln)return ln}const It=w(H),Bt=new(D())({allowUnionTypes:!0,allErrors:!0,validateSchema:!0});It.length&&Bt.addSchema(It,void 0,void 0,!0);const nn=Bt.compile(H);return $e||ne.set(qe,nn),nn}function w(H){if(typeof H!="object")return[];const N=new Set;H.$id&&N.add(H.$id);const ce=new Array,Ae=[H];for(;Ae.length;){const $e=Ae.pop();for(const qe of I($e))if(!N.has(qe)){N.add(qe);const It=X.find(Bt=>Bt.$id===qe);It&&(ce.push(It),Ae.push(It))}}return ce}function*I(H){const N=[H];for(;N.length;){const ce=N.pop();if(typeof ce=="object"&&ce)for(const[Ae,$e]of Object.entries(ce))Ae==="$ref"&&typeof $e=="string"?yield $e.split("#")[0]:N.push($e)}}function U(H){const N=compileAjvSchema(H||entityEnvelopeSchema);return ce=>{if(N(ce)===!0)return ce;throw throwAjvError(N.errors)}}function xe(H){const N=R(H);return ce=>{var Ae,$e;if(N(ce)===!0)return ce;const It=(Ae=N.errors)===null||Ae===void 0?void 0:Ae.filter(Bt=>["/kind","/apiVersion"].includes(Bt.instancePath));if(!(($e=It)===null||$e===void 0)&&$e.length&&It.every(Bt=>Bt.keyword==="enum"))return!1;throw K(N.errors)}}function Se(H){const N=compileAjvSchema(H||entitySchema);return ce=>{if(N(ce)===!0)return ce;throw throwAjvError(N.errors)}}class k{static isValidApiVersion(N){return le.isValidPrefixAndOrSuffix(N,"/",le.isValidDnsSubdomain,ce=>ce.length>=1&&ce.length<=63&&/^[a-z0-9A-Z]+$/.test(ce))}static isValidKind(N){return typeof N=="string"&&N.length>=1&&N.length<=63&&/^[a-zA-Z][a-z0-9A-Z]*$/.test(N)}static isValidObjectName(N){return typeof N=="string"&&N.length>=1&&N.length<=63&&/^([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9]$/.test(N)}static isValidNamespace(N){return le.isValidDnsLabel(N)}static isValidLabelKey(N){return le.isValidPrefixAndOrSuffix(N,"/",le.isValidDnsSubdomain,k.isValidObjectName)}static isValidLabelValue(N){return N===""||k.isValidObjectName(N)}static isValidAnnotationKey(N){return le.isValidPrefixAndOrSuffix(N,"/",le.isValidDnsSubdomain,k.isValidObjectName)}static isValidAnnotationValue(N){return typeof N=="string"}}const Ke={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:H=>typeof H=="string"&&H.length>=1&&H.length<=63&&/^[a-z0-9:+#]+(\-[a-z0-9:+#]+)*$/.test(H)};function yt(H={}){return{...Ke,...H}}class $t{async enforce(N){function ce(G,v,O){if(v==null)throw new Error(`${G} must have a value`);let M;try{M=O(v)}catch(Y){throw new Error(`${G} could not be validated, ${Y}`)}if(!M){let Y;switch(O.name){case"isValidLabelValue":case"isValidObjectName":Y="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":Y="a valid prefix and/or suffix";break;case"isValidNamespace":case"isValidDnsLabel":Y="a string that is sequences of [a-z0-9] separated by [-], at most 63 characters in total";break;case"isValidTag":Y="a string that is sequences of [a-z0-9+#] separated by [-], at most 63 characters in total";break;case"isValidAnnotationValue":Y="a string";break;case"isValidKind":Y="a string that is a sequence of [a-zA-Z][a-z0-9A-Z], at most 63 characters in total";break;case"isValidUrl":Y="a string that is a valid url";break;case"isValidString":case"isNonEmptyString":Y="a non empty string";break;default:Y=void 0;break}const he=Y?` expected ${Y} but found "${v}".`:"";throw new Error(`"${G}" is not valid;${he} To learn more about catalog file format, visit: https://github.com/backstage/backstage/blob/master/docs/architecture-decisions/adr002-default-catalog-file-format.md`)}}function Ae(G,v,O){return v===void 0||ce(G,v,O)}ce("apiVersion",N.apiVersion,this.validators.isValidApiVersion),ce("kind",N.kind,this.validators.isValidKind),ce("metadata.name",N.metadata.name,this.validators.isValidEntityName),Ae("metadata.namespace",N.metadata.namespace,this.validators.isValidNamespace);var $e;for(const[G,v]of Object.entries(($e=N.metadata.labels)!==null&&$e!==void 0?$e:[]))ce(`labels.${G}`,G,this.validators.isValidLabelKey),ce(`labels.${G}`,v,this.validators.isValidLabelValue);var qe;for(const[G,v]of Object.entries((qe=N.metadata.annotations)!==null&&qe!==void 0?qe:[]))ce(`annotations.${G}`,G,this.validators.isValidAnnotationKey),ce(`annotations.${G}`,v,this.validators.isValidAnnotationValue);var It;const Bt=(It=N.metadata.tags)!==null&&It!==void 0?It:[];for(let G=0;G<Bt.length;++G)ce(`tags.${G}`,Bt[G],this.validators.isValidTag);var nn;const ln=(nn=N.metadata.links)!==null&&nn!==void 0?nn:[];for(let G=0;G<ln.length;++G){var rn,ee,te;ce(`links.${G}.url`,(rn=ln[G])===null||rn===void 0?void 0:rn.url,CommonValidatorFunctions.isValidUrl),Ae(`links.${G}.title`,(ee=ln[G])===null||ee===void 0?void 0:ee.title,CommonValidatorFunctions.isNonEmptyString),Ae(`links.${G}.icon`,(te=ln[G])===null||te===void 0?void 0:te.icon,KubernetesValidatorFunctions.isValidObjectName)}return N}constructor(N=makeValidator()){_define_property(this,"validators",void 0),this.validators=N}}class zt{async enforce(N){if(!this.validate){const $e=new Ajv({allowUnionTypes:!0});this.validate=$e.addSchema([commonSchema,entityMetaSchema],void 0,void 0,!0).compile(entitySchema)}if(this.validate(N)===!0)return N;const[Ae]=this.validate.errors||[];throw Ae?new Error(`Malformed envelope, ${Ae.instancePath||"<root>"} ${Ae.message}`):new Error("Malformed envelope, Unknown error")}constructor(){_define_property(this,"validate",void 0)}}function Rt(H){let N=H.indexOf(":");const ce=H.indexOf("/");ce!==-1&&ce<N&&(N=-1);const Ae=N===-1?void 0:H.slice(0,N),$e=ce===-1?void 0:H.slice(N+1,ce),qe=H.slice(Math.max(N+1,ce+1));if(Ae===""||$e===""||qe==="")throw new TypeError(`Entity reference "${H}" was not on the form [<kind>:][<namespace>/]<name>`);return{kind:Ae,namespace:$e,name:qe}}function Dt(H){return{kind:H.kind,namespace:H.metadata.namespace||r,name:H.metadata.name}}function Yt(H,N){var ce,Ae;if(!H)throw new Error("Entity reference must not be empty");const $e=(ce=N)===null||ce===void 0?void 0:ce.defaultKind,qe=((Ae=N)===null||Ae===void 0?void 0:Ae.defaultNamespace)||r;let It,Bt,nn;if(typeof H=="string"){const G=Rt(H);var ln;It=(ln=G.kind)!==null&&ln!==void 0?ln:$e;var rn;Bt=(rn=G.namespace)!==null&&rn!==void 0?rn:qe,nn=G.name}else{var ee;It=(ee=H.kind)!==null&&ee!==void 0?ee:$e;var te;Bt=(te=H.namespace)!==null&&te!==void 0?te:qe,nn=H.name}if(It)if(Bt){if(!nn){const G=JSON.stringify(H);throw new Error(`Entity reference ${G} had missing or empty name`)}}else{const G=JSON.stringify(H);throw new Error(`Entity reference ${G} had missing or empty namespace`)}else{const G=JSON.stringify(H);throw new Error(`Entity reference ${G} had missing or empty kind (e.g. did not start with "component:" or similar)`)}return{kind:It,namespace:Bt,name:nn}}function ct(H){let N,ce,Ae;if("metadata"in H){N=H.kind;var $e;ce=($e=H.metadata.namespace)!==null&&$e!==void 0?$e:r,Ae=H.metadata.name}else{N=H.kind;var qe;ce=(qe=H.namespace)!==null&&qe!==void 0?qe:r,Ae=H.name}return`${N.toLocaleLowerCase("en-US")}:${ce.toLocaleLowerCase("en-US")}/${Ae.toLocaleLowerCase("en-US")}`}var ut=n(87612);class St{async enforce(N){let ce=N;for(const Ae of this.policies){const $e=await Ae.enforce(ce);if(!$e)throw new Error(`Policy ${Ae.constructor.name} did not return a result`);ce=$e}return ce}constructor(N){(0,ut._)(this,"policies",void 0),this.policies=N}}class lt{async enforce(N){for(const ce of this.policies){const Ae=await ce.enforce(N);if(Ae)return Ae}throw new Error("The entity did not match any known policy")}constructor(N){(0,ut._)(this,"policies",void 0),this.policies=N}}const Zt={allOf(H){return new St(H)},oneOf(H){return new lt(H)}};var Gt=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 Ce(H){let N;return{async check(ce){return N||(N=xe(H)),N(ce)===ce}}}const Ne=Ce(Gt);var Ye=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 ht=Ce(Ye);var rt=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 et=Ce(rt);var vt=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 ot=Ce(vt);var Qe=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 ft=Ce(Qe),gt="ownedBy",Ct="ownerOf",yn="consumesApi",hn="apiConsumedBy",cn="providesApi",Sn="apiProvidedBy",pn="dependsOn",xn="dependencyOf",Cn="parentOf",on="childOf",fn="memberOf",wn="hasMember",_e="partOf",Jt="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 Je=Ce(Vt);var Rn=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 sn=Ce(Rn);var Nn=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 In=Ce(Nn),Pn="backstage.io/managed-by-location",Gn="backstage.io/managed-by-origin-location",Kn="backstage.io/source-location",Ln=/^[\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 be(H){if(typeof H!="string")throw new TypeError(`Unable to parse location ref '${H}', unexpected argument ${typeof H}`);const N=H.indexOf(":");if(N<0)throw new TypeError(`Unable to parse location ref '${H}', expected '<type>:<target>', e.g. 'url:https://host/path'`);const ce=H.substring(0,N).trim(),Ae=H.substring(N+1).trim();if(!ce||!Ae)throw new TypeError(`Unable to parse location ref '${H}', expected '<type>:<target>', e.g. 'url:https://host/path'`);if(ce==="http"||ce==="https")throw new TypeError(`Invalid location ref '${H}', please prefix it with 'url:', e.g. 'url:${H}'`);if(Ln.test(Ae))throw new TypeError(`Invalid location ref '${H}', target is a javascript: URL`);return{type:ce,target:Ae}}function pe(H){const{type:N,target:ce}=H;if(N){if(!ce)throw new TypeError("Unable to stringify location ref, empty target")}else throw new TypeError("Unable to stringify location ref, empty type");if(Ln.test(ce))throw new TypeError(`Invalid location ref '${N}:${ce}', target is a javascript: URL`);return`${N}:${ce}`}function Ie(H){var N,ce,Ae,$e,qe;const It=(qe=(ce=H.metadata)===null||ce===void 0||(N=ce.annotations)===null||N===void 0?void 0:N[Kn])!==null&&qe!==void 0?qe:($e=H.metadata)===null||$e===void 0||(Ae=$e.annotations)===null||Ae===void 0?void 0:Ae[Pn];if(!It)throw new Error(`Entity '${ct(H)}' is missing location`);return be(It)}},98864:function(Lt,Le,n){"use strict";n.d(Le,{rU:function(){return I}});var r=n(52322),p=n(60871),W=n(86689),f=n(79692),V=n(90436),m=n(72779),h=n.n(m),F=n(76635),ye=n.n(F),le=n(2784),z=n(73557),de=n(71597);function D(){const[U]=(0,z.is)((0,r.jsx)(z.AW,{index:!0,element:(0,r.jsx)("div",{})}));return!U.index}const E=(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"}),se=U=>/^([a-z+.-]+):/.test(U),ie=/^[\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,ne=window.open;if(ne&&!ne.__backstage){const U=function(...Se){const k=String(Se[0]);if(ie.test(k))throw new Error("Rejected window.open() with a javascript: URL as a security precaution");return ne.apply(this,Se)};U.__backstage=!0,window.open=U}const X=()=>{try{return(0,p.h_)(p.Ds).getOptionalString("app.baseUrl")}catch{return}},K=()=>{const U="http://sample.dev";var xe;const Se=(xe=X())!==null&&xe!==void 0?xe:"/",{pathname:k}=new URL(Se,U);return(0,F.trimEnd)(k,"/")},R=U=>{let xe=String(U);const Se=K(),k=se(xe),Ke=xe.startsWith(Se);return!k&&!Ke&&(xe=Se.concat(xe)),xe},w=U=>{if(U instanceof Array)return U.map(w).join(" ").trim();if(typeof U=="object"&&U){var xe,Se;return w((Se=U)===null||Se===void 0||(xe=Se.props)===null||xe===void 0?void 0:xe.children)}return["string","number"].includes(typeof U)?String(U):""},I=le.forwardRef(({onClick:U,noTrack:xe,...Se},k)=>{const Ke=E(),yt=(0,p.z$)(),$t=D()?R(Se.to):Se.to,zt=w(Se.children)||$t,Rt=se($t),Dt=Rt&&!!/^https?:/.exec($t);if(ie.test($t))throw new Error("Link component rejected javascript: URL as a security precaution");const Yt=ct=>{var ut;(ut=U)===null||ut===void 0||ut(ct),xe||yt.captureEvent("click",zt,{attributes:{to:$t}})};return Rt?(0,r.jsxs)(W.Z,{...Dt?{target:"_blank",rel:"noopener"}:{},...Se,...Se["aria-label"]?{"aria-label":`${Se["aria-label"]}, Opens in a new window`}:{},ref:k,href:$t,onClick:Yt,className:h()(Ke.externalLink,Se.className),children:[Se.children,(0,r.jsx)(V.Z,{component:"span",className:Ke.visuallyHidden,children:", Opens in a new window"})]}):(0,r.jsx)(W.Z,{...Se,ref:k,component:de.rU,to:$t,onClick:Yt})})},43909:function(Lt,Le,n){"use strict";n.d(Le,{r:function(){return r.rU}});var r=n(98864)},53974:function(Lt,Le,n){"use strict";n.d(Le,{Oi:function(){return xe},VY:function(){return Ds},yW:function(){return Ui},XF:function(){return yt},mn:function(){return xn},NX:function(){return St},ub:function(){return Ln},mf:function(){return Ws},yu:function(){return dt},h4:function(){return vs},M6:function(){return wr},i9:function(){return ll},aR:function(){return Wn},rJ:function(){return Zr},Oh:function(){return fl},hu:function(){return ul},rU:function(){return le.r},Qj:function(){return de},nU:function(){return je},SA:function(){return Wr},sk:function(){return qe},Or:function(){return Hr},T3:function(){return _a},g9:function(){return vl},Ex:function(){return wo},Gk:function(){return Ut},tn:function(){return wi},Ph:function(){return Oo},YE:function(){return ia},v7:function(){return Ur},R6:function(){return st},tR:function(){return ra},uw:function(){return ss},qt:function(){return bi},iA:function(){return zs},GB:function(){return tt},po:function(){return vr},mZ:function(){return Ks},Pf:function(){return gs}});var r=n(52322),p=n(60871),W=n(19928),f=n(2784);function V(e){const[s,l]=useState([]),u=useApi(alertApiRef),{anchorOrigin:g={vertical:"top",horizontal:"center"},transientTimeoutMs:x}=e,T=x!=null?x:5e3;useEffect(()=>{const Q=u.alert$().subscribe(fe=>l(ge=>ge.concat(fe)));return()=>{Q.unsubscribe()}},[u]);const[$]=s;if(useEffect(()=>{if($&&$.display==="transient"){const Q=setTimeout(()=>{l(fe=>{const ge=fe.filter(Ue=>Ue!==$);return ge.length===fe.length?fe:ge})},T);return()=>clearTimeout(Q)}},[$,T]),s.length===0)return null;const q=()=>{l(Q=>Q.filter(fe=>fe!==$))};return _jsx(Snackbar,{open:!0,anchorOrigin:g,children:_jsx(Alert,{action:_jsx(IconButton,{color:"inherit",size:"small",onClick:q,"data-testid":"error-button-close",children:_jsx(CloseIcon,{})}),severity:$.severity,children:_jsxs(Typography,{component:"span",children:[String($.message),s.length>1&&_jsx("em",{children:` (${s.length-1} older ${pluralize("message",s.length-1)})`})]})})})}var 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 F(e){const{displayName:s,picture:l,customStyles:u}=e,g=h();let x={...u};const T={fontFamily:x.fontFamily,fontSize:x.fontSize,fontWeight:x.fontWeight};return l||(x={backgroundColor:stringToColor(s||""),...u}),_jsx(MaterialAvatar,{alt:s,src:l,className:g.avatar,style:x,children:s&&_jsx(Typography,{variant:"h6",component:"span",className:g.avatarText,style:T,children:extractInitials(s)})})}var ye=n(77277),le=n(43909);const z=f.forwardRef((e,s)=>(0,r.jsx)(le.r,{ref:s,...e,color:"initial"})),de=f.forwardRef((e,s)=>(0,r.jsx)(ye.Z,{ref:s,component:z,...e})),D=null;var E=n(95544),se=n(60364),ie=n(83229),ne=n(26639),X=n(39595),K=n(61837),R=n(80030),w=n(19353),I=n(95074);function U(e){const{text:s,tooltipDelay:l=1e3,tooltipText:u="Text copied to clipboard","aria-label":g="Copy text"}=e,x=(0,p.h_)(p.VE),[T,$]=(0,f.useState)(!1),[{error:q},Q]=(0,I.Z)();(0,f.useEffect)(()=>{q&&x.post(q)},[q,x]);const fe=ge=>{ge.stopPropagation(),$(!0),Q(s)};return(0,r.jsx)(r.Fragment,{children:(0,r.jsx)(R.ZP,{id:"copy-test-tooltip",title:u,placement:"top",leaveDelay:l,onClose:()=>$(!1),open:T,children:(0,r.jsx)(K.Z,{onClick:fe,"aria-label":g,children:(0,r.jsx)(w.Z,{})})})})}function xe(e){const{text:s,language:l,showLineNumbers:u=!1,highlightedNumbers:g,customStyle:x,showCopyCodeButton:T=!1}=e,$=(0,se.Z)(),q=$.palette.type==="dark"?ne.Z:X.Z,Q=$.palette.type==="dark"?"#256bf3":"#e6ffed";return(0,r.jsxs)(E.Z,{position:"relative",children:[(0,r.jsx)(ie.Z,{customStyle:x,language:l,style:q,showLineNumbers:u,wrapLines:!0,lineNumberStyle:{color:$.palette.textVerySubtle},lineProps:fe=>{var ge;return!((ge=g)===null||ge===void 0)&&ge.includes(fe)?{style:{backgroundColor:Q}}:{}},children:s}),T&&(0,r.jsx)(E.Z,{position:"absolute",top:0,right:0,children:(0,r.jsx)(U,{text:s})})]})}var Se=n(41156),k=n(71597),Ke=n(88188);function yt(e){const{title:s,to:l}=e,u=(0,Se.Z)(g=>g.breakpoints.down("xs"));return l?u?(0,r.jsx)(K.Z,{component:k.rU,color:"primary",title:s,size:"small",to:l,children:(0,r.jsx)(Ke.Z,{})}):(0,r.jsx)(ye.Z,{component:k.rU,variant:"contained",color:"primary",to:l,children:s}):null}var $t=n(27397),zt=n(11105),Rt=n(97963),Dt=n(46506),Yt=n.n(Dt),ct=n(54073),ut=n.n(ct),St;(function(e){let s;(function(x){x.TOP_BOTTOM="TB",x.BOTTOM_TOP="BT",x.LEFT_RIGHT="LR",x.RIGHT_LEFT="RL"})(s=e.Direction||(e.Direction={}));let l;(function(x){x.UP_LEFT="UL",x.UP_RIGHT="UR",x.DOWN_LEFT="DL",x.DOWN_RIGHT="DR"})(l=e.Alignment||(e.Alignment={}));let u;(function(x){x.NETWORK_SIMPLEX="network-simplex",x.TIGHT_TREE="tight-tree",x.LONGEST_PATH="longest-path"})(u=e.Ranker||(e.Ranker={}));let g;(function(x){x.LEFT="l",x.RIGHT="r",x.CENTER="c"})(g=e.LabelPosition||(e.LabelPosition={}))})(St||(St={}));var lt=n(10368);const Zt=(0,m.Z)(e=>({node:{fill:e.palette.primary.light,stroke:e.palette.primary.light},text:{fill:e.palette.primary.contrastText}}),{name:"BackstageDependencyGraphDefaultNode"});function Gt({node:{id:e}}){const s=Zt(),[l,u]=f.useState(0),[g,x]=f.useState(0),T=f.useRef(null);f.useLayoutEffect(()=>{if(T.current){let{height:fe,width:ge}=T.current.getBBox();fe=Math.round(fe),ge=Math.round(ge),(fe!==g||ge!==l)&&(u(ge),x(fe))}},[l,g]);const $=10,q=l+$*2,Q=g+$*2;return(0,r.jsxs)("g",{children:[(0,r.jsx)("rect",{className:s.node,width:q,height:Q,rx:10}),(0,r.jsx)("text",{ref:T,className:s.text,y:Q/2,x:q/2,textAnchor:"middle",alignmentBaseline:"middle",children:e})]})}const Ce="arrow-marker",Ne="node",Ye="edge",ht="label",rt=(0,lt.Z)(e=>({node:{transition:`${e.transitions.duration.shortest}ms`}}),{name:"BackstageDependencyGraphNode"}),et=e=>(0,r.jsx)(Gt,{...e});function vt({render:e=et,setNode:s,node:l}){const{width:u,height:g,x=0,y:T=0}=l,$=l,q=rt(),Q=f.useRef(null);return f.useLayoutEffect(()=>{if(Q.current){let{height:fe,width:ge}=Q.current.getBBox();fe=Math.round(fe),ge=Math.round(ge),(fe!==g||ge!==u)&&s(l.id,{...l,height:fe,width:ge})}},[l,u,g,s]),(0,r.jsx)("g",{ref:Q,"data-testid":Ne,className:q.node,transform:`translate(${x-u/2},${T-g/2})`,children:e({node:$})})}var ot=n(76985),Qe=n(39829),ft=n(19574),gt=n.n(ft);const Ct=(0,lt.Z)(e=>({text:{fill:e.palette.textContrast}}),{name:"BackstageDependencyGraphDefaultLabel"});function yn({edge:{label:e}}){const s=Ct();return(0,r.jsx)("text",{className:s.text,textAnchor:"middle",children:e})}const hn=(0,lt.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"}),cn=e=>(0,r.jsx)(yn,{...e});function Sn({render:e=cn,setEdge:s,id:l,edge:u,curve:g}){const{x=0,y:T=0,width:$,height:q,points:Q}=u,fe=u,ge=hn(),Ue=f.useRef(null);f.useLayoutEffect(()=>{if(Ue.current){let{height:pt,width:at}=Ue.current.getBBox();pt=Math.round(pt),at=Math.round(at),(pt!==q||at!==$)&&s(l,{...u,height:pt,width:at})}},[u,q,$,s,l]);let Pe="";const Ve=f.useMemo(()=>ot.Z().x(pt=>pt.x).y(pt=>pt.y).curve(Qe[g]),[g]);if(Q){const pt=Q.filter(at=>gt()(at.x)&>()(at.y));Pe=Ve(pt)||""}return(0,r.jsxs)(r.Fragment,{children:[Pe&&(0,r.jsx)("path",{"data-testid":Ye,className:ge.path,d:Pe}),fe.label?(0,r.jsx)("g",{ref:Ue,"data-testid":ht,className:ge.label,transform:`translate(${x},${T})`,children:e({edge:fe})}):null]})}const pn="workspace";function xn(e){var s,l;const{edges:u,nodes:g,renderNode:x,direction:T=St.Direction.TOP_BOTTOM,align:$,nodeMargin:q=50,edgeMargin:Q=10,rankMargin:fe=50,paddingX:ge=0,paddingY:Ue=0,acyclicer:Pe,ranker:Ve=St.Ranker.NETWORK_SIMPLEX,labelPosition:pt=St.LabelPosition.RIGHT,labelOffset:at=10,edgeRanks:Wt=1,edgeWeight:$n=1,renderLabel:Vn,defs:kt,zoom:en="enabled",curve:vn="curveMonotoneX",fit:Un="grow",...Mn}=e,ir=(0,Rt.Z)(),[br,Qr]=f.useState(100),[kr,bs]=f.useState(100),un=f.useRef(new(Yt()).graphlib.Graph),[zo,si]=f.useState(((s=un.current.graph())===null||s===void 0?void 0:s.width)||0),[So,ii]=f.useState(((l=un.current.graph())===null||l===void 0?void 0:l.height)||0),[ai,ya]=f.useState([]),[Qn,Mr]=f.useState([]),Br=Math.max(zo,br),Sr=Math.max(So,kr),Hn=Math.min(So,kr),ar=Un==="grow"?Sr:Hn,Wo=f.useMemo(()=>ut()(Dn=>{if(!Dn)return;const Xn=zt.Z(Dn),kn=zt.Z(Dn.getElementById(pn));function $r(){Xn.call($t.sP().scaleExtent([1,1/0]).on("zoom",_r=>{_r.transform.x=Math.min(0,Math.max(_r.transform.x,Br-Br*_r.transform.k)),_r.transform.y=Math.min(0,Math.max(_r.transform.y,Sr-Sr*_r.transform.k)),kn.attr("transform",_r.transform)}))}en==="enabled"?$r():en==="enable-on-click"&&Xn.on("click",()=>$r());const{width:Dr,height:li}=Dn.getBoundingClientRect();br!==Dr&&Qr(Dr),kr!==li&&bs(li)},100),[kr,br,Br,Sr,en]),ao=f.useCallback(()=>{const Dn=un.current.nodes(),Xn=un.current.edges();Dn.forEach(kn=>{g.some(Dr=>Dr.id===kn)||un.current.removeNode(kn)}),Xn.forEach(kn=>{u.some(Dr=>Dr.from===kn.v&&Dr.to===kn.w)||un.current.removeEdge(kn.v,kn.w)}),g.forEach(kn=>{const $r=un.current.nodes().find(Dr=>kn.id===Dr);if($r&&un.current.node($r)){const{width:Dr,height:li,x:_r,y:Dl}=un.current.node($r);un.current.setNode($r,{...kn,width:Dr,height:li,x:_r,y:Dl})}else un.current.setNode(kn.id,{...kn,width:0,height:0})}),u.forEach(kn=>{un.current.setEdge(kn.from,kn.to,{...kn,label:kn.label,width:0,height:0,labelpos:pt,labeloffset:at,weight:$n,minlen:Wt})})},[u,g,pt,at,$n,Wt]),Xr=f.useMemo(()=>ut()(()=>{Yt().layout(un.current);const{height:Dn,width:Xn}=un.current.graph(),kn=Math.max(0,Dn||0),$r=Math.max(0,Xn||0);si($r),ii(kn),ya(un.current.nodes()),Mr(un.current.edges())},250,{leading:!0}),[]);f.useEffect(()=>(un.current.setGraph({rankdir:T,align:$,nodesep:q,edgesep:Q,ranksep:fe,marginx:ge,marginy:Ue,acyclicer:Pe,ranker:Ve}),ao(),Xr(),Xr.cancel),[Pe,$,T,Q,ge,Ue,q,fe,Ve,ao,Xr]);function Bl(Dn,Xn){return un.current.setNode(Dn,Xn),Xr(),un.current}function $l(Dn,Xn){return un.current.setEdge(Dn,Xn),Xr(),un.current}return(0,r.jsxs)("svg",{ref:Wo,...Mn,width:"100%",height:ar,viewBox:`0 0 ${Br} ${Sr}`,children:[(0,r.jsxs)("defs",{children:[(0,r.jsx)("marker",{id:Ce,viewBox:"0 0 24 24",markerWidth:"14",markerHeight:"14",refX:"16",refY:"12",orient:"auto",markerUnits:"strokeWidth",children:(0,r.jsx)("path",{fill:ir.palette.textSubtle,d:"M8.59 16.59L13.17 12 8.59 7.41 10 6l6 6-6 6-1.41-1.41z"})}),kt]}),(0,r.jsx)("g",{id:pn,children:(0,r.jsxs)("svg",{width:zo,height:So,y:Sr/2-So/2,x:Br/2-zo/2,viewBox:`0 0 ${zo} ${So}`,children:[Qn.map(Dn=>{const Xn=un.current.edge(Dn);return Xn?(0,r.jsx)(Sn,{id:Dn,setEdge:$l,render:Vn,edge:Xn,curve:vn},`${Dn.v}-${Dn.w}`):null}),ai.map(Dn=>{const Xn=un.current.node(Dn);return Xn?(0,r.jsx)(vt,{setNode:Bl,render:x,node:Xn},Dn):null})]})})]})}var Cn=n(72779),on=n.n(Cn),fn,wn;const _e=(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:(fn=e.palette.banner.closeButtonColor)!==null&&fn!==void 0?fn:"inherit"},info:{backgroundColor:e.palette.banner.info},error:{backgroundColor:e.palette.banner.error},warning:{backgroundColor:(wn=e.palette.banner.warning)!==null&&wn!==void 0?wn:e.palette.banner.error}}),{name:"BackstageDismissableBanner"}),Jt=e=>{var s;const{variant:l,message:u,id:g,fixed:x=!1}=e,T=_e(),q=useApi(storageApiRef).forBucket("notifications");var Q;const fe=(Q=q.snapshot("dismissedBanners").value)!==null&&Q!==void 0?Q:[],[ge,Ue]=useState(new Set(fe)),Pe=useObservable(q.observe$("dismissedBanners"));useEffect(()=>{var pt;if(!((pt=Pe)===null||pt===void 0)&&pt.value){var at,Wt;const $n=(Wt=(at=Pe)===null||at===void 0?void 0:at.value)!==null&&Wt!==void 0?Wt:[];Ue(new Set($n))}},[(s=Pe)===null||s===void 0?void 0:s.value]);const Ve=()=>{q.set("dismissedBanners",[...ge,g])};return _jsx(Snackbar,{anchorOrigin:x?{vertical:"bottom",horizontal:"center"}:{vertical:"top",horizontal:"center"},open:!ge.has(g),classes:{root:classNames(T.root,!x&&T.topPosition)},children:_jsx(SnackbarContent,{classes:{root:classNames(T.content,T[l]),message:T.message},message:u,action:[_jsx(IconButton,{title:"Permanently dismiss this message",className:T.button,onClick:Ve,children:_jsx(Close,{className:T.icon})},"dismiss")]})})};var Vt=n(60905),Je=n(90436),Rn=n.p+"static/missingAnnotation.67f79e98..svg",sn=n.p+"static/noInformation.4b426325..svg",Nn=n.p+"static/createComponent.975d1e1e..svg",In=n.p+"static/noBuild.1715fa71..svg";const Pn=(0,m.Z)({generalImg:{width:"95%",zIndex:2,position:"relative",left:"50%",top:"50%",transform:"translate(-50%, 15%)"}},{name:"BackstageEmptyStateImage"}),Gn=({missing:e})=>{const s=Pn();switch(e){case"field":return(0,r.jsx)("img",{src:Rn,className:s.generalImg,alt:"annotation is missing"});case"info":return(0,r.jsx)("img",{src:sn,alt:"no Information",className:s.generalImg});case"content":return(0,r.jsx)("img",{src:Nn,alt:"create Component",className:s.generalImg});case"data":return(0,r.jsx)("img",{src:In,alt:"no Build",className:s.generalImg});default:return null}},Kn=(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 Ln(e){const{title:s,description:l,missing:u,action:g}=e,x=Kn();return(0,r.jsxs)(Vt.Z,{container:!0,direction:"row",justifyContent:"space-around",alignItems:"flex-start",className:x.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)(Je.Z,{variant:"h5",children:s})}),(0,r.jsx)(Vt.Z,{item:!0,xs:!0,children:(0,r.jsx)(Je.Z,{variant:"body1",children:l})}),(0,r.jsx)(Vt.Z,{item:!0,xs:!0,className:x.action,children:g})]})}),(0,r.jsx)(Vt.Z,{item:!0,xs:12,md:6,className:x.imageContainer,children:typeof u=="string"?(0,r.jsx)(Gn,{missing:u}):u.customImage})]})}const be=`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`,pe=/^.*ANNOTATION.*$/m,Ie=be.match(pe)[0],H=be.split(`
|
|
12
|
-
`).findIndex(e=>pe.test(e)),N=(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 ce(e){return Array.from(Array(e+1).keys(),s=>s+H)}function Ae(e){const s=e.map(l=>Ie.replace("ANNOTATION",l)).join(`
|
|
13
|
-
`);return be.replace(Ie,s)}function $e(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 qe(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",x=N();return(0,r.jsx)(Ln,{missing:"field",title:"Missing Annotation",description:$e(u),action:(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(Je.Z,{variant:"body1",children:"Add the annotation to your component YAML as shown in the highlighted example below:"}),(0,r.jsx)(E.Z,{className:x.code,children:(0,r.jsx)(xe,{text:Ae(u),language:"yaml",showLineNumbers:!0,highlightedNumbers:ce(u.length),customStyle:{background:"inherit",fontSize:"115%"}})}),(0,r.jsx)(ye.Z,{color:"primary",component:le.r,to:g,children:"Read more"})]})})}var It=n(11776),Bt=n(38402),nn=n(49378),ln=n(41128),rn=n(27616),ee=n(8284),te=n(70660),G=n(91750),v=n(38016);const O=(e,s)=>(s.palette.type==="light"?ln._j:ln.$n)(s.palette[e].light,.6),M=(e,s)=>(s.palette.type==="light"?ln.$n:ln._j)(s.palette[e].light,.9),Y=(0,m.Z)(e=>({root:{marginRight:e.spacing(1),fill:({severity:s})=>O(s,e)}})),he=({severity:e})=>{const s=Y({severity:e});return(0,r.jsx)(G.Z,{classes:s})},we=({severity:e})=>{const s=Y({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})=>O(s,e),verticalAlign:"middle"},summary:{display:"flex",flexDirection:"row"},summaryText:{color:({severity:s})=>O(s,e),fontWeight:e.typography.fontWeightBold},message:{width:"100%",display:"block",color:({severity:s})=>O(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"}),Xe=e=>e.charAt(0).toLocaleUpperCase("en-US")+e.slice(1);function tt(e){const{severity:s="warning",title:l,message:u,children:g,defaultExpanded:x}=e,T=Oe({severity:s}),$=Xe(s)+(l?`: ${l}`:"");return(0,r.jsxs)(rn.Z,{defaultExpanded:x!=null?x:!1,className:T.panel,role:"alert",children:[(0,r.jsxs)(ee.Z,{expandIcon:(0,r.jsx)(we,{severity:s}),className:T.summary,children:[(0,r.jsx)(he,{severity:s}),(0,r.jsx)(Je.Z,{className:T.summaryText,variant:"subtitle1",children:$})]}),(u||g)&&(0,r.jsx)(te.Z,{children:(0,r.jsxs)(Vt.Z,{container:!0,children:[u&&(0,r.jsx)(Vt.Z,{item:!0,xs:12,children:(0,r.jsx)(Je.Z,{className:T.message,variant:"body1",children:u})}),g&&(0,r.jsx)(Vt.Z,{item:!0,xs:12,className:T.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"}),wt=({error:e,message:s,stack:l,children:u})=>{const g=mt();return(0,r.jsxs)(It.Z,{dense:!0,children:[(0,r.jsxs)(Bt.Z,{alignItems:"flex-start",children:[(0,r.jsx)(nn.Z,{classes:{secondary:g.text},primary:"Error",secondary:e}),(0,r.jsx)(U,{text:e})]}),(0,r.jsxs)(Bt.Z,{alignItems:"flex-start",children:[(0,r.jsx)(nn.Z,{classes:{secondary:g.text},primary:"Message",secondary:s}),(0,r.jsx)(U,{text:s})]}),l&&(0,r.jsxs)(Bt.Z,{alignItems:"flex-start",children:[(0,r.jsx)(nn.Z,{classes:{secondary:g.text},primary:"Stack Trace",secondary:l}),(0,r.jsx)(U,{text:l})]}),u]})};function dt(e){const{title:s,error:l,defaultExpanded:u,children:g}=e;return(0,r.jsx)(tt,{severity:"error",title:s!=null?s:l.message,defaultExpanded:u,children:(0,r.jsx)(wt,{error:l.name,message:l.message,stack:l.stack,children:g})})}var Be=n(85256);const At=(0,m.Z)(e=>({text:{fontFamily:"monospace",whiteSpace:"pre",overflowX:"auto",marginRight:e.spacing(2)},divider:{margin:e.spacing(2)}}),{name:"BackstageResponseErrorPanel"});function Ut(e){var s;const{title:l,error:u,defaultExpanded:g}=e,x=At();if(u.name!=="ResponseError")return(0,r.jsx)(dt,{title:l!=null?l:u.message,defaultExpanded:g,error:u});const{body:T,cause:$}=u,{request:q,response:Q}=T,fe=`${Q.statusCode}: ${$.name}`,ge=q&&`${q.method} ${q.url}`,Ue=$.message.replace(/\\n/g,`
|
|
14
|
-
`),Pe=(s=$.stack)===null||s===void 0?void 0:s.replace(/\\n/g,`
|
|
15
|
-
`),Ve=JSON.stringify(T,void 0,2);return(0,r.jsxs)(dt,{title:l!=null?l:u.message,defaultExpanded:g,error:{name:fe,message:Ue,stack:Pe},children:[ge&&(0,r.jsxs)(Bt.Z,{alignItems:"flex-start",children:[(0,r.jsx)(nn.Z,{classes:{secondary:x.text},primary:"Request",secondary:q?`${ge}`:void 0}),(0,r.jsx)(U,{text:ge})]}),(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(Be.Z,{component:"li",className:x.divider}),(0,r.jsx)(Bt.Z,{alignItems:"flex-start",children:(0,r.jsx)(nn.Z,{classes:{secondary:x.text},primary:"Full Error as JSON"})}),(0,r.jsx)(xe,{language:"json",text:Ve,showCopyCodeButton:!0})]})]})}var xt=n(28316);function Nt(e){const s=document.createElement("div");return s.setAttribute("id",e),s}function Qt(e){document.body.insertBefore(e,document.body.lastElementChild.nextElementSibling)}function jn(e){const s=useRef(null);useEffect(function(){const g=document.querySelector(`#${e}`),x=g||Nt(e);return g||Qt(x),x.appendChild(s.current),function(){s.current.remove(),x.childNodes.length===-1&&x.remove()}},[e]);function l(){return s.current||(s.current=document.createElement("div")),s.current}return l()}var Ft=null;const bt="core.calloutSeen";function jt(){const[e,s]=useState(()=>{const u=localStorage.getItem(bt);return u?JSON.parse(u):{}}),l=useCallback((u,g)=>{const x=localStorage.getItem(bt),$={...x?JSON.parse(x):{},[u]:g};s($),localStorage.setItem(bt,JSON.stringify($))},[]);return{states:e,setState:l}}function Mt(e){const{states:s,setState:l}=jt(),u=useCallback(()=>{l(e,!0)},[l,e]);return{seen:s[e]===!0,markSeen:u}}function Xt(e){const{seen:s,markSeen:l}=Mt(e);return{show:s===!1,hide:l}}const lr=(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 Cr(e){var s,l,u,g,x,T,$,q;const{featureId:Q,title:fe,description:ge,children:Ue}=e,{show:Pe,hide:Ve}=useShowCallout(Q),pt=usePortal("core.callout"),at=useRef(null),[Wt,$n]=useState(),Vn=lr(),kt=useCallback(()=>{if(at.current){const en=at.current.getBoundingClientRect(),vn=Math.max(en.width,en.height),Un=800,Mn=en.x-(vn-en.width)/2-Un,ir=en.y-(vn-en.height)/2-Un,br=vn+2*Un,Qr=450,kr=en.x+en.width/2-Qr,bs=en.y-(vn-en.height)/2+vn+20;$n({dotLeft:Mn,dotTop:ir,dotSize:br,borderWidth:Un,textTop:bs,textLeft:kr,textWidth:Qr})}},[]);return useEffect(()=>(window.addEventListener("resize",kt),window.addEventListener("scroll",kt),()=>{window.removeEventListener("resize",kt),window.removeEventListener("scroll",kt)}),[kt]),useLayoutEffect(kt,[at.current,kt]),Pe?_jsxs(_Fragment,{children:[_jsx(Box,{className:Vn.featureWrapper,ref:at,children:Ue}),createPortal(_jsx(Box,{className:Vn.backdrop,children:_jsx(ClickAwayListener,{onClickAway:Ve,children:_jsxs(_Fragment,{children:[_jsx(Box,{className:Vn.dot,"data-testid":"dot",style:{left:(s=Wt)===null||s===void 0?void 0:s.dotLeft,top:(l=Wt)===null||l===void 0?void 0:l.dotTop,width:(u=Wt)===null||u===void 0?void 0:u.dotSize,height:(g=Wt)===null||g===void 0?void 0:g.dotSize,borderWidth:(x=Wt)===null||x===void 0?void 0:x.borderWidth},onClick:Ve,onKeyDown:Ve,role:"button",tabIndex:0,children:_jsx(Box,{className:Vn.pulseCircle})}),_jsxs(Box,{className:Vn.text,"data-testid":"text",style:{left:(T=Wt)===null||T===void 0?void 0:T.textLeft,top:($=Wt)===null||$===void 0?void 0:$.textTop,width:(q=Wt)===null||q===void 0?void 0:q.textWidth},children:[_jsx(Typography,{variant:"h2",paragraph:!0,children:fe}),_jsx(Typography,{children:ge})]})]})})}),pt)]}):_jsx(_Fragment,{children:Ue})}var rr=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 _n({color:e="primary",disabled:s=!1,href:l="#",icon:u=(0,r.jsx)(rr.Z,{}),label:g,onClick:x,title:T}){const $=bn();return s?(0,r.jsxs)(E.Z,{title:T,className:on()($.link,$.disabled),children:[u,(0,r.jsx)(Je.Z,{variant:"caption",component:"span",className:$.label,children:g})]}):(0,r.jsxs)(le.r,{title:T,className:on()($.link,$[e]),to:l,onClick:x,children:[u,(0,r.jsx)(Je.Z,{variant:"caption",component:"span",className:$.label,children:g})]})}const fr=(0,m.Z)(e=>({links:{margin:e.spacing(2,0),display:"grid",gridAutoFlow:"column",gridAutoColumns:"min-content",gridGap:e.spacing(3)}}),{name:"BackstageHeaderIconLinkRow"});function wr(e){const{links:s}=e,l=fr();return(0,r.jsx)("nav",{className:l.links,children:s.map((u,g)=>(0,r.jsx)(_n,{...u},g+1))})}const Yn=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
|
-
`},zr=100,jr=10,Nr=(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:zr,height:`calc(100% + ${jr}px)`,transition:"opacity 300ms",pointerEvents:"none"},fadeLeft:{left:-jr,background:`linear-gradient(90deg, ${Yn(e.palette.type)})`},fadeRight:{right:-jr,background:`linear-gradient(270deg, ${Yn(e.palette.type)})`},fadeHidden:{opacity:0},button:{position:"absolute"},buttonLeft:{left:-e.spacing(2)},buttonRight:{right:-e.spacing(2)}}),{name:"BackstageHorizontalScrollGrid"});function C(e){const[[s,l],u]=React.useState([0,0]);return React.useLayoutEffect(()=>{const g=e.current;if(!g){u([0,0]);return}const x=()=>{const T=g.scrollLeft,$=g.scrollWidth-g.offsetWidth-g.scrollLeft;u([T,$])};return x(),g.addEventListener("scroll",x),window.addEventListener("resize",x),()=>{g.removeEventListener("scroll",x),window.removeEventListener("resize",x)}},[e]),[s,l]}function c(e,s,l){const[u,g]=React.useState(0);return React.useLayoutEffect(()=>{if(u===0)return;const x=window.performance.now(),T=requestAnimationFrame($=>{if(!e.current)return;const q=$-x,Q=Math.abs(u)*q/s,ge=Math.max(l,Q)*Math.sign(u);e.current.scrollBy({left:ge});const Ue=u-ge;Math.sign(u)!==Math.sign(Ue)?g(0):g(Ue)});return()=>cancelAnimationFrame(T)},[e,u,s,l]),g}function b(e){const{scrollStep:s=100,scrollSpeed:l=50,minScrollDistance:u=5,children:g,...x}=e,T=Nr(e),$=React.useRef(),[q,Q]=C($),fe=c($,l,u),ge=Ue=>{$.current&&fe(Ue?s:-s)};return _jsxs(Box,{...x,className:T.root,children:[_jsx(Grid,{container:!0,direction:"row",wrap:"nowrap",className:T.container,ref:$,children:g}),_jsx(Box,{className:classNames(T.fade,T.fadeLeft,{[T.fadeHidden]:q===0})}),_jsx(Box,{className:classNames(T.fade,T.fadeRight,{[T.fadeHidden]:Q===0})}),q>0&&_jsx(IconButton,{title:"Scroll Left",onClick:()=>ge(!1),className:classNames(T.button,T.buttonLeft,{}),children:_jsx(ChevronLeftIcon,{})}),Q>0&&_jsx(IconButton,{title:"Scroll Right",onClick:()=>ge(!0),className:classNames(T.button,T.buttonRight,{}),children:_jsx(ChevronRightIcon,{})})]})}const A=(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 J(e){const s=A(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 ve=(0,f.lazy)(()=>Promise.all([n.e(1049),n.e(6051)]).then(n.bind(n,76051)).then(e=>({default:e.RealLogViewer})));function je(e){const{Progress:s}=(0,p.qD)().getComponents();return(0,r.jsx)(f.Suspense,{fallback:(0,r.jsx)(s,{}),children:(0,r.jsx)(ve,{...e})})}var ke=n(28865),nt=n(60251);const _t=(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"}),an=(e,s)=>s?typeof s=="string"?e+s:f.Children.toArray(s.props.children).reduce(an,e):e,En=({level:e,children:s})=>{const g=f.Children.toArray(s).reduce(an,"").toLocaleLowerCase("en-US").replace(/\W/g,"-");return f.createElement(`h${e}`,{id:g},s)},gn={code:({inline:e,className:s,children:l,...u})=>{const g=String(l).replace(/\n+$/,""),x=/language-(\w+)/.exec(s||"");return!e&&x?(0,r.jsx)(xe,{language:x[1],text:g}):(0,r.jsx)("code",{className:s,...u,children:l})},h1:En,h2:En,h3:En,h4:En,h5:En,h6:En};function Wr(e){const{content:s,dialect:l="gfm",linkTarget:u,transformLinkUri:g,transformImageUri:x,className:T}=e,$=_t();return(0,r.jsx)(ke.D,{remarkPlugins:l==="gfm"?[nt.Z]:[],className:`${$.markdown} ${T}`,children:s,components:gn,linkTarget:u,transformLinkUri:g,transformImageUri:x})}var lo=n(23054);const Co=(0,m.Z)(e=>({root:{paddingLeft:e.spacing(3)}}),{name:"BackstageLoginRequestListItem"}),Ss=({request:e,busy:s,setBusy:l})=>{const u=Co(),[g,x]=useState(),T=async()=>{l(!0);try{await e.trigger()}catch(q){x(isError(q)?q.message:"An unspecified error occurred")}finally{l(!1)}},$=e.provider.icon;return _jsxs(ListItem,{disabled:s,classes:{root:u.root},children:[_jsx(ListItemAvatar,{children:_jsx($,{fontSize:"large"})}),_jsx(ListItemText,{primary:e.provider.title,secondary:g&&_jsx(Typography,{color:"error",children:g})}),_jsx(Button,{color:"primary",variant:"contained",onClick:T,children:"Log in"})]})};var Vr=null;const Vo=(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 Cs(e){const s=Vo(),[l,u]=useState(!1),g=useApi(oauthRequestApiRef),x=useApi(configApiRef);var T;const $=(T=x.getOptionalBoolean("enableExperimentalRedirectFlow"))!==null&&T!==void 0?T:!1,q=useObservable(useMemo(()=>g.authRequest$(),[g]),[]),Q=()=>{q.forEach(fe=>fe.reject())};return _jsxs(Dialog,{open:Boolean(q.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"}),$?_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:q.map(fe=>_jsx(LoginRequestListItem,{request:fe,busy:l,setBusy:u},fe.provider.title))})})]}),_jsx(DialogActions,{classes:{root:s.actionButtons},children:_jsx(Button,{onClick:Q,children:"Reject All"})})]})}var Ho=n(15277),Go=n.n(Ho),Er=n(29862);const cr=(0,m.Z)({container:{overflow:"visible !important"}},{name:"BackstageOverflowTooltip"});function Hr(e){const[s,l]=(0,f.useState)(!1),u=(0,Er.t)(),g=cr(),x=$=>{u()&&l($)};var T;return(0,r.jsx)(R.ZP,{title:(T=e.title)!==null&&T!==void 0?T:e.text||"",placement:e.placement,disableHoverListener:!s,children:(0,r.jsx)(Go(),{text:e.text,line:e.line,onToggled:x,containerClassName:g.container})})}var qr=n(67358);function wo(e){const s=(0,se.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)(qr.Z,{...e,"data-testid":"progress"}):(0,r.jsx)(E.Z,{display:"none"})}var jo=n(94339),Fr=n(14503),Ko=n(24579),Eo=n(32552),Fn=n(15459),dr=n(27597);const Gr=(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 Kr(e){const{link:s,title:l,onClick:u}=e,g=Gr();return(0,r.jsxs)(E.Z,{children:[(0,r.jsx)(Be.Z,{}),(0,r.jsx)(le.r,{to:s,onClick:u,underline:"none",children:(0,r.jsxs)(E.Z,{display:"flex",alignItems:"center",className:g.root,children:[(0,r.jsx)(E.Z,{className:g.boxTitle,fontWeight:"fontWeightBold",m:1,children:(0,r.jsx)(Je.Z,{children:(0,r.jsx)("strong",{children:l})})}),(0,r.jsx)(dr.Z,{className:g.arrow})]})})]})}const Yo=e=>{const{slackChannel:s}=e;if(s){if(typeof s=="string")return(0,r.jsxs)(Je.Z,{children:["Please contact ",s," for help."]});if(!s.href)return(0,r.jsxs)(Je.Z,{children:["Please contact ",s.name," for help."]})}else return null;return(0,r.jsx)(de,{to:s.href,variant:"contained",children:s.name})},gr=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)(dt,{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}}},Ao=(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,Fn.Z)(e=>({root:{display:"inline-block",padding:e.spacing(8,8,0,0),float:"right"}}),{name:"BackstageInfoCardCardActionsTopRight"})(Fr.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 Zr(e){const{title:s,subheader:l,divider:u=!0,deepLink:g,slackChannel:x,errorBoundaryProps:T,variant:$,children:q,headerStyle:Q,headerProps:fe,icon:ge,action:Ue,actionsClassName:Pe,actions:Ve,cardClassName:pt,actionsTopRight:at,className:Wt,noPadding:$n,titleTypographyProps:Vn}=e,kt=Ao();let en={},vn={};$&&$.split(/[\s]+/g).forEach(br=>{en={...en,...Ro.card[br]},vn={...vn,...Ro.cardContent[br]}});const Un=()=>!l&&!ge?null:(0,r.jsxs)("div",{className:kt.headerSubheader,"data-testid":"info-card-subheader",children:[l&&(0,r.jsx)("div",{className:kt.subheader,children:l}),ge]}),Mn=T||(x?{slackChannel:x}:{});return(0,r.jsx)(jo.Z,{style:en,className:Wt,children:(0,r.jsxs)(gr,{...Mn,children:[s&&(0,r.jsx)(Eo.Z,{classes:{root:kt.header,title:kt.headerTitle,subheader:kt.headerSubheader,avatar:kt.headerAvatar,action:kt.headerAction,content:kt.headerContent},title:s,subheader:Un(),action:Ue,style:{...Q},titleTypographyProps:Vn,...fe}),at&&(0,r.jsx)(To,{children:at}),u&&(0,r.jsx)(Be.Z,{}),(0,r.jsx)(Ko.Z,{className:on()(pt,{[kt.noPadding]:$n}),style:vn,children:q}),Ve&&(0,r.jsx)(Fr.Z,{className:Pe,children:Ve}),g&&(0,r.jsx)(Kr,{...g})]})})}var Io=n(39307);const Jo=(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"}),co={fractional:!0,inverse:!1,unit:"%",max:100},Po=({palette:e,value:s,inverse:l,max:u})=>{if(isNaN(s))return"#ddd";const g=u||co.max,x=l?g-s:s;return x<g/3?e.status.error:x<g*(2/3)?e.status.warning:e.status.ok};function ws(e){const[s,l]=useState(null),{getColor:u=Po}=e,g=Jo(e),{palette:x}=useTheme(),{value:T,fractional:$,inverse:q,unit:Q,max:fe,description:ge}={...co,...e},Ue=$?Math.round(T*fe):T,Pe=fe!==100?Math.round(T):Ue,[Ve,pt]=useState(!1);return useEffect(()=>{const at=s,Wt=()=>pt(!0),$n=()=>pt(!1);return at&&ge?(at.addEventListener("mouseenter",Wt),at.addEventListener("mouseleave",$n),()=>{at.removeEventListener("mouseenter",Wt),at.removeEventListener("mouseleave",$n)}):()=>{pt(!1)}},[ge,s]),_jsxs(Box,{ref:l,className:g.root,children:[_jsx(Circle,{strokeLinecap:"butt",percent:Ue,strokeWidth:12,trailWidth:12,strokeColor:u({palette:x,value:Pe,inverse:q,max:fe}),className:g.circle}),ge&&Ve?_jsx(Box,{className:g.description,children:ge}):_jsx(Box,{className:g.overlay,children:isNaN(T)?"N/A":`${Pe}${Q}`})]})}const Lo=(0,m.Z)({root:{height:"100%",width:250}},{name:"BackstageGaugeCard"});function ur(e){const s=Lo(e),{title:l,subheader:u,progress:g,inverse:x,deepLink:T,description:$,icon:q,variant:Q,getColor:fe}=e,ge={inverse:x,description:$,getColor:fe,value:g};return _jsx(Box,{className:s.root,children:_jsx(InfoCard,{title:l,subheader:u,deepLink:T,variant:Q,icon:q,children:_jsx(Gauge,{...ge})})})}function ci(e){const{value:s,getColor:l=getProgressColor,width:u="thick"}=e,{palette:g}=useTheme();if(isNaN(s))return null;let x=Math.round(s*100*100)/100;x>100&&(x=100);const T=u==="thick"?4:1,$=l({palette:g,value:x,inverse:!1,max:100});return _jsx(Tooltip,{title:`${x}%`,children:_jsx(Typography,{component:"span",children:_jsx(Line,{percent:x,strokeWidth:T,trailWidth:T,strokeColor:$})})})}var Qo=n(21324),js=n(7089),uo=n(42494),eo=n(74603),to=n(56939),no=n(12231),Ar=n(73698),qn=n(12420),ho=n(72379);const Xo=(0,m.Z)(e=>(0,qn.Z)({icon:{position:"absolute",right:e.spacing(.5),pointerEvents:"none"}}),{name:"BackstageClosedDropdown"});var ro=()=>{const e=Xo();return(0,r.jsx)(ho.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 _o=(0,m.Z)(e=>(0,qn.Z)({icon:{position:"absolute",right:e.spacing(.5),pointerEvents:"none"}}),{name:"BackstageOpenedDropdown"});var qo=()=>{const e=_o();return(0,r.jsx)(ho.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 es=(0,Fn.Z)(e=>(0,qn.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"})(eo.Z),po=(0,m.Z)(e=>(0,qn.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:x,onChange:T,triggerReset:$,native:q=!1,disabled:Q=!1,margin:fe}=e,ge=po(),[Ue,Pe]=(0,f.useState)(x||(s?[]:"")),[Ve,pt]=(0,f.useState)(!1);(0,f.useEffect)(()=>{Pe(s?[]:"")},[$,s]),(0,f.useEffect)(()=>{Pe(x||(s?[]:""))},[x,s]);const at=kt=>{Pe(kt.target.value),T(kt.target.value)},Wt=kt=>{if(Q){kt.preventDefault();return}pt(en=>s&&!(kt.target instanceof HTMLElement)?!0:!en)},$n=()=>{pt(!1)},Vn=kt=>()=>{const en=Ue.filter(vn=>vn!==kt);Pe(en),T(en)};return(0,r.jsx)(E.Z,{className:ge.root,children:(0,r.jsxs)(uo.Z,{className:ge.formControl,children:[(0,r.jsx)(to.Z,{className:ge.formLabel,children:u}),(0,r.jsxs)(Ar.Z,{"aria-label":u,value:Ue,native:q,disabled:Q,"data-testid":"select",displayEmpty:!0,multiple:s,margin:fe,onChange:at,open:Ve,onOpen:Wt,onClose:$n,input:(0,r.jsx)(es,{}),label:u,renderValue:kt=>{var en;return s&&Ue.length!==0?(0,r.jsx)(E.Z,{className:ge.chips,children:kt.map(vn=>{var Un,Mn;return(0,r.jsx)(js.Z,{label:(Un=l.find(ir=>ir.value===vn))===null||Un===void 0?void 0:Un.label,clickable:!0,onDelete:Vn(vn),className:ge.chip},(Mn=l.find(ir=>ir.value===vn))===null||Mn===void 0?void 0:Mn.value)})}):(0,r.jsx)(Je.Z,{children:Ue.length===0?g||"":(en=l.find(vn=>vn.value===kt))===null||en===void 0?void 0:en.label})},IconComponent:()=>Ve?(0,r.jsx)(qo,{}):(0,r.jsx)(ro,{}),MenuProps:{anchorOrigin:{vertical:"bottom",horizontal:"left"},transformOrigin:{vertical:"top",horizontal:"left"},getContentAnchorEl:null},children:[g&&!s&&(0,r.jsx)(no.Z,{value:[],children:g}),q?l&&l.map(kt=>(0,r.jsx)("option",{value:kt.value,children:kt.label},kt.value)):l&&l.map(kt=>(0,r.jsxs)(no.Z,{value:kt.value,children:[s&&(0,r.jsx)(Qo.Z,{color:"primary",checked:Ue.includes(kt.value)||!1,className:ge.checkbox}),kt.label]},kt.value))]})]})})}const fo=()=>{},Ts=f.createContext({stepperLength:0,stepIndex:0,setStepIndex:fo,stepHistory:[],setStepHistory:fo,onStepChange:fo});function di(e){const{children:s,elevated:l,onStepChange:u,activeStep:g=0}=e,[x,T]=useState(g),[$,q]=useState([0]);useEffect(()=>{T(g)},[g]);const Q=[];let fe;return Children.forEach(s,ge=>{isValidElement(ge)&&(ge.props.end?fe=ge:Q.push(ge))}),_jsxs(_Fragment,{children:[_jsx(Ts.Provider,{value:{stepIndex:x,setStepIndex:T,stepHistory:$,setStepHistory:q,onStepChange:u,stepperLength:Children.count(s)},children:_jsx(MuiStepper,{activeStep:x,orientation:"vertical",elevation:l?2:0,children:Q})}),x>=Children.count(s)-1&&fe]})}const ts=(0,m.Z)(e=>({root:{marginTop:e.spacing(3),"& button":{marginRight:e.spacing(1)}}}),{name:"BackstageSimpleStepperFooter"}),ns=({text:e,handleClick:s})=>_jsx(Button,{onClick:s,children:e||"Reset"}),dn=({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")}),Rs=({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"}),j=({actions:e={},children:s})=>{const l=ts(),{stepperLength:u,stepIndex:g,setStepIndex:x,stepHistory:T,setStepHistory:$,onStepChange:q}=useContext(VerticalStepperContext),Q=(Pe,Ve)=>{Ve&&Ve(),q&&q(g,Pe),x(Pe)},fe=()=>{const Pe=e.nextStep?e.nextStep(g,u-1):g+1;Q(Pe,e.onNext),$([...T,Pe])},ge=()=>{T.pop(),Q(T[T.length-1],e.onBack),$([...T])},Ue=()=>{Q(0,e.onRestart),$([0])};return _jsxs(Box,{className:l.root,children:[[void 0,!0].includes(e.showBack)&&g!==0&&_jsx(y,{text:e.backText,handleClick:ge,disabled:g===0,stepIndex:g}),e.showSkip&&_jsx(Rs,{text:e.skipText,handleClick:fe,disabled:!!u&&g>=u||!!e.canSkip&&!e.canSkip(),stepIndex:g}),[void 0,!0].includes(e.showNext)&&_jsx(dn,{text:e.nextText,handleClick:fe,disabled:!!u&&g>=u||!!e.canNext&&!e.canNext(),stepIndex:g}),e.showRestart&&g!==0&&_jsx(ns,{text:e.restartText,handleClick:Ue,stepIndex:g}),s]})},L=(0,m.Z)(e=>({end:{padding:e.spacing(3)}}),{name:"SimpleStepperStep"});function P(e){const{title:s,children:l,end:u,actions:g,...x}=e,T=L();return u?_jsxs(Box,{className:T.end,children:[_jsx(Typography,{variant:"h6",children:s}),l,_jsx(SimpleStepperFooter,{actions:{...g||{},showNext:!1}})]}):_jsxs(MuiStep,{...x,children:[_jsx(StepLabel,{children:_jsx(Typography,{variant:"h6",children:s})}),_jsxs(StepContent,{children:[l,_jsx(SimpleStepperFooter,{actions:g})]})]})}const ae=(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 re(e){const s=ae(e);return _jsx(Typography,{component:"span",className:classNames(s.status,s.ok),"aria-label":"Status ok","aria-hidden":"true",...e})}function _(e){const s=ae(e);return _jsx(Typography,{component:"span",className:classNames(s.status,s.warning),"aria-label":"Status warning","aria-hidden":"true",...e})}function ue(e){const s=ae(e);return _jsx(Typography,{component:"span",className:classNames(s.status,s.error),"aria-label":"Status error","aria-hidden":"true",...e})}function Ee(e){const s=ae(e);return _jsx(Typography,{component:"span",className:classNames(s.status,s.pending),"aria-label":"Status pending","aria-hidden":"true",...e})}function Re(e){const s=ae(e);return _jsx(Typography,{component:"span",className:classNames(s.status,s.running),"aria-label":"Status running","aria-hidden":"true",...e})}function ze(e){const s=ae(e);return _jsx(Typography,{component:"span",className:classNames(s.status,s.aborted),"aria-label":"Status aborted","aria-hidden":"true",...e})}var Fe=n(74600),We=n(15584);const it=e=>(0,qn.Z)({root:{fontWeight:e.typography.fontWeightBold,whiteSpace:"nowrap",paddingRight:e.spacing(4),border:"0",verticalAlign:"top"}}),Et={root:{border:"0",verticalAlign:"top"}},De=e=>(0,qn.Z)({root:{margin:e.spacing(0,0,-1,0)}}),He=e=>(0,qn.Z)({root:{padding:e.spacing(0,0,1,0)},random:{}}),Tt=(0,Fn.Z)(it,{name:"BackstageMetadataTableTitleCell"})(We.Z),tn=(0,Fn.Z)(Et,{name:"BackstageMetadataTableCell"})(We.Z),An=({dense:e,children:s})=>_jsx(Table,{size:e?"small":"medium",children:_jsx(TableBody,{children:s})}),Ot=({title:e,children:s,...l})=>_jsxs(TableRow,{children:[e&&_jsx(Tt,{children:e}),_jsx(tn,{colSpan:e?1:2,...l,children:s})]}),Pt=(0,Fn.Z)(De,{name:"BackstageMetadataTableList"})(({classes:e,children:s})=>(0,r.jsx)(It.Z,{disablePadding:!0,className:e.root,children:s})),Kt=(0,Fn.Z)(He,{name:"BackstageMetadataTableListItem"})(({classes:e,children:s})=>(0,r.jsx)(Bt.Z,{className:e.root,children:s})),Tn=(0,qn.Z)({root:{margin:"0 0",listStyleType:"none"}}),hr=e=>(0,qn.Z)({root:{...Tn.root,paddingLeft:e.spacing(1)}}),Tr=(0,Fn.Z)(Tn,{name:"BackstageStructuredMetadataTableList"})(({classes:e,children:s})=>(0,r.jsx)(Pt,{classes:e,children:s})),Yr=(0,Fn.Z)(hr,{name:"BackstageStructuredMetadataTableNestedList"})(({classes:e,children:s})=>(0,r.jsx)(Pt,{classes:e,children:s}));function zn(e,s){const l=e.map((u,g)=>_jsx(MetadataListItem,{children:Bn(u)},g));return s?_jsx(Yr,{children:l}):_jsx(Tr,{children:l})}function mn(e,s,l){const u=Object.keys(e).map(g=>{const x=Bn(e[g],!0),T=l&&l.titleFormat?l.titleFormat(g):startCase(g);return _jsxs(MetadataListItem,{children:[_jsx(Typography,{variant:"body2",component:"span",children:`${T}: `}),x]},g)});return s?_jsx(Yr,{children:u}):_jsx(Tr,{children:u})}function Bn(e,s,l){return React.isValidElement(e)?_jsx(Fragment,{children:e}):typeof e=="object"&&!Array.isArray(e)?mn(e,s,l):Array.isArray(e)?zn(e,l):typeof e=="boolean"?_jsx(Fragment,{children:e?"\u2705":"\u274C"}):_jsx(Typography,{variant:"body2",component:"span",children:e})}const mr=({value:e,options:s})=>_jsx(Fragment,{children:Bn(e,s)}),ui=({title:e,value:s,options:l})=>_jsx(MetadataTableItem,{title:l&&l.titleFormat?l.titleFormat(e):startCase(e),children:_jsx(mr,{value:s,options:l})});function hi(e,s){return Object.keys(e).map(l=>_jsx(ui,{title:l,value:e[l],options:s},l))}function xa(e){const{metadata:s,dense:l=!0,options:u}=e,g=hi(s,u||{});return _jsx(MetadataTable,{dense:l,children:g})}var pi=n(49429),Is=n(86136),Ps=n(50758),go=n(79784),oo=n(76635),fi=n(19126),Ls=n.n(fi);function gi(e){return qs.stringify(e,{strictNullHandling:!0})}function Os(e){return qs.parse(e,{ignoreQueryPrefix:!0,strictNullHandling:!0})}function rs(e,s){return Os(e)[s]}function mo(e,s,l){const u={...Os(e),[s]:l};return gi(u)}function mi(e,s=250){const[l,u]=useSearchParams(),g=l.toString(),[x,T]=useState(rs(g,e));return useEffect(()=>{const $=rs(g,e);T(q=>isEqual($,q)?q:$)},[g,T,e]),useDebouncedEffect(()=>{const $=mo(g,e,x);g!==$&&u($,{replace:!0})},[u,x,g,e],s),[x,T]}const ks={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 vi(){var e;const u=(e=(0,p.I_)().get(p.Ds))===null||e===void 0?void 0:e.getOptionalConfig("app.support");if(!u)return ks;var g;return{url:u.getString("url"),items:u.getConfigArray("items").flatMap(x=>({title:x.getString("title"),icon:x.getOptionalString("icon"),links:((g=x.getOptionalConfigArray("links"))!==null&&g!==void 0?g:[]).flatMap(T=>({url:T.getString("url"),title:T.getString("title")}))}))}}var ko=n(80079);function or(e,s){const u=(0,p.qD)().getSystemIcon(e);return u?(0,r.jsx)(u,{...s}):(0,r.jsx)(ko.Z,{...s})}function ba(e){return or("brokenImage",e)}function Sa(e){return or("catalog",e)}function Ca(e){return or("chat",e)}function wa(e){return or("dashboard",e)}function ja(e){return or("docs",e)}function Ea(e){return or("email",e)}function Aa(e){return or("github",e)}function Ta(e){return or("group",e)}function vo(e){return or("help",e)}function Ra(e){return or("user",e)}function Ia(e){return or("warning",e)}const Bs=(0,m.Z)({popoverList:{minWidth:260,maxWidth:400}},{name:"BackstageSupportButton"}),Pa=({icon:e})=>{const s=(0,p.qD)();var l;const u=e&&(l=s.getSystemIcon(e))!==null&&l!==void 0?l:vo;return(0,r.jsx)(u,{})};var $s;const yi=({link:e})=>(0,r.jsx)(le.r,{to:e.url,children:($s=e.title)!==null&&$s!==void 0?$s:e.url}),xi=({item:e})=>{var s;return(0,r.jsxs)(no.Z,{children:[(0,r.jsx)(Is.Z,{children:(0,r.jsx)(Pa,{icon:e.icon})}),(0,r.jsx)(nn.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)(yi,{link:u},u.url)],[])})]})};function bi(e){const{title:s,items:l,children:u}=e,{items:g}=vi(),[x,T]=(0,f.useState)(!1),[$,q]=(0,f.useState)(null),Q=Bs(),fe=(0,Se.Z)(Pe=>Pe.breakpoints.down("sm")),ge=Pe=>{q(Pe.currentTarget),T(!0)},Ue=()=>{T(!1)};return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(E.Z,{display:"flex",ml:1,children:fe?(0,r.jsx)(K.Z,{color:"primary",size:"small",onClick:ge,"data-testid":"support-button","aria-label":"Support",children:(0,r.jsx)(vo,{})}):(0,r.jsx)(ye.Z,{"data-testid":"support-button","aria-label":"Support",color:"primary",onClick:ge,startIcon:(0,r.jsx)(vo,{}),children:"Support"})}),(0,r.jsxs)(go.ZP,{"data-testid":"support-button-popover",open:x,anchorEl:$,anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"},onClose:Ue,children:[(0,r.jsxs)(Ps.Z,{className:Q.popoverList,autoFocusItem:Boolean($),children:[s&&(0,r.jsx)(no.Z,{alignItems:"flex-start",children:(0,r.jsx)(Je.Z,{variant:"subtitle1",children:s})}),f.Children.map(u,(Pe,Ve)=>(0,r.jsx)(no.Z,{alignItems:"flex-start",children:Pe},`child-${Ve}`)),(l!=null?l:g).map((Pe,Ve)=>(0,r.jsx)(xi,{item:Pe},`item-${Ve}`))]}),(0,r.jsx)(pi.Z,{children:(0,r.jsx)(ye.Z,{color:"primary",onClick:Ue,"aria-label":"Close",children:"Close"})})]})]})}var os=n(18671),er=n(73557),Bo=n(84800);const Si=(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 Ds(e){const{className:s,stretch:l,noPadding:u,children:g,...x}=e,T=Si();return(0,r.jsx)("article",{...x,className:on()(T.root,s,{[T.stretch]:l,[T.noPadding]:u}),children:g})}var La=n(6487),so=n(99152);const Ci=(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 Wn(e){const{tabs:s,onChange:l,selectedIndex:u}=e,[g,x]=(0,f.useState)(u!=null?u:0),T=Ci(),$=(0,f.useCallback)((q,Q)=>{u===void 0&&x(Q),l&&u!==Q&&l(Q)},[u,l]);return(0,f.useEffect)(()=>{u!==void 0&&x(u)},[u]),(0,r.jsx)(E.Z,{className:T.tabsWrapper,children:(0,r.jsx)(so.Z,{selectionFollowsFocus:!0,indicatorColor:"primary",textColor:"inherit",variant:"scrollable",scrollButtons:"auto","aria-label":"tabs",onChange:$,value:g,children:s.map((q,Q)=>(0,f.createElement)(La.Z,{...q.tabProps,"data-testid":`header-tab-${Q}`,label:q.label,key:q.id,value:Q,className:T.defaultTab,classes:{selected:T.selected,root:T.tabRoot}}))})})}function Oa(e){const s=(0,er.UO)(),u=e.map(({path:Ue,children:Pe})=>({caseSensitive:!1,path:`${Ue}/*`,element:Pe})).sort((Ue,Pe)=>Pe.path.replace(/\/\*$/,"").localeCompare(Ue.path.replace(/\/\*$/,"")));var g;const x=(g=(0,er.V$)(u))!==null&&g!==void 0?g:e[0].children;var T;let $=(T=s["*"])!==null&&T!==void 0?T:"";$.startsWith("/")||($=`/${$}`);var q;const[Q]=(q=(0,Bo.fp)(u,$))!==null&&q!==void 0?q:[],fe=Q?e.findIndex(Ue=>`${Ue.path}/*`===Q.route.path):0;var ge;return{index:fe===-1?0:fe,element:x,route:(ge=e[fe])!==null&&ge!==void 0?ge:e[0]}}function wi(e){const{routes:s}=e,l=(0,er.s0)(),{index:u,route:g,element:x}=Oa(s),T=(0,f.useMemo)(()=>s.map(q=>({id:q.path,label:q.title,tabProps:q.tabProps})),[s]),$=q=>{let{path:Q}=s[q];Q=Q.replace(/\/\*$/,""),Q=Q.replace(/^\//,""),l(Q)};return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(Wn,{tabs:T,selectedIndex:u,onChange:$}),(0,r.jsxs)(Ds,{children:[(0,r.jsx)(os.q,{title:g.title}),x]})]})}const Ns=()=>null;(0,p.R5)(Ns,"core.gatherMountPoints",!0);function Fs(e){const s=(0,r.jsx)(Ns,{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 Fs(l.props.children);if(l.type!==s)throw new Error("Child of TabbedLayout must be an TabbedLayout.Route");const{path:u,title:g,children:x,tabProps:T}=l.props;return[{path:u,title:g,children:x,tabProps:T}]})}function ka(e){const s=Fs(e.children);return(0,r.jsx)(wi,{routes:s})}ka.Route=Ns;const Ba=(0,m.Z)(e=>({value:{marginBottom:e.spacing(.75)},subvalue:{color:e.palette.textSubtle,fontWeight:"normal"}}),{name:"BackstageSubvalueCell"});function ss(e){const{value:s,subvalue:l}=e,u=Ba();return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(E.Z,{className:u.value,children:s}),(0,r.jsx)(E.Z,{className:u.subvalue,children:l})]})}var $o=n(67222),Do=n(21070),No=n(90324),Fo=n(98281),ji=n(48049),is=n(51209),as=n(33375),Ei=n(44233),Ai=n(27604),ls=n(36444),Ti=n(37971),Ri=n(59709),$a=n(17373),Ii=n(3702),Pi=n(93111);const cs=(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"}),Li=e=>{var s;const l=cs(),{onChangeFilters:u}=e,[g,x]=(0,f.useState)({...e.selectedFilters}),[T,$]=(0,f.useState)(!1),q=()=>{x({}),$(Q=>!Q)};return(0,f.useEffect)(()=>{u(g)},[g,u]),(0,r.jsxs)(E.Z,{className:l.root,children:[(0,r.jsxs)(E.Z,{className:l.header,children:[(0,r.jsx)(E.Z,{className:l.value,children:"Filters"}),(0,r.jsx)(ye.Z,{color:"primary",onClick:q,children:"Clear all"})]}),(0,r.jsx)(E.Z,{className:l.filters,children:((s=e.filters)===null||s===void 0?void 0:s.length)&&e.filters.map(Q=>(0,r.jsx)(Oo,{triggerReset:T,...Q.element,selected:g[Q.element.label],onChange:fe=>x({...g,[Q.element.label]:fe})},Q.element.label))})]})},Zs={Add:(0,f.forwardRef)((e,s)=>(0,r.jsx)(Do.Z,{...e,ref:s})),Check:(0,f.forwardRef)((e,s)=>(0,r.jsx)(Fo.Z,{...e,ref:s})),Clear:(0,f.forwardRef)((e,s)=>(0,r.jsx)(as.Z,{...e,ref:s})),Delete:(0,f.forwardRef)((e,s)=>(0,r.jsx)(Ei.Z,{...e,ref:s})),DetailPanel:(0,f.forwardRef)((e,s)=>(0,r.jsx)(is.Z,{...e,ref:s})),Edit:(0,f.forwardRef)((e,s)=>(0,r.jsx)(Ai.Z,{...e,ref:s})),Export:(0,f.forwardRef)((e,s)=>(0,r.jsx)(Ii.Z,{...e,ref:s})),Filter:(0,f.forwardRef)((e,s)=>(0,r.jsx)(ls.Z,{...e,ref:s})),FirstPage:(0,f.forwardRef)((e,s)=>(0,r.jsx)(Ti.Z,{...e,ref:s})),LastPage:(0,f.forwardRef)((e,s)=>(0,r.jsx)(Ri.Z,{...e,ref:s})),NextPage:(0,f.forwardRef)((e,s)=>(0,r.jsx)(is.Z,{...e,ref:s})),PreviousPage:(0,f.forwardRef)((e,s)=>(0,r.jsx)(ji.Z,{...e,ref:s})),ResetSearch:(0,f.forwardRef)((e,s)=>(0,r.jsx)(as.Z,{...e,ref:s})),Search:(0,f.forwardRef)((e,s)=>(0,r.jsx)(ls.Z,{...e,ref:s})),SortArrow:(0,f.forwardRef)((e,s)=>(0,r.jsx)(No.Z,{...e,ref:s})),ThirdStateCheck:(0,f.forwardRef)((e,s)=>(0,r.jsx)($a.Z,{...e,ref:s})),ViewColumn:(0,f.forwardRef)((e,s)=>(0,r.jsx)(Pi.Z,{...e,ref:s}))};function ds(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 x=l[g];u=u[x]}return u}const Oi=(0,Fn.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"})($o.W$),Us=(0,Fn.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"})($o.UW),ki=(0,m.Z)(e=>({root:{display:"flex",alignItems:"center",justifyContent:"space-between"},title:{fontWeight:e.typography.fontWeightBold,fontSize:18,whiteSpace:"nowrap"}}),{name:"BackstageTableFiltersContainer"}),Bi=(0,m.Z)(()=>({root:{display:"flex",alignItems:"start"}}),{name:"BackstageTable"});function Da(e,s){return e.map(l=>{var u;const g=(u=l.headerStyle)!==null&&u!==void 0?u:{};let x=l.cellStyle||{};if(l.highlight)if(g.color=s.palette.textContrast,typeof x=="object")x.fontWeight=s.typography.fontWeightBold;else{const T=x;x=($,q,Q)=>({...T($,q,Q),fontWeight:s.typography.fontWeightBold})}return{...l,headerStyle:g,cellStyle:x}})}function $i(e,s){return(0,oo.transform)(e,(l,u,g)=>{(0,oo.isEqual)(u,s[g])||(l[g]=u)})}const Ms={search:"",filtersOpen:!1,filters:{}};function Di(e){const{toolbarRef:s,setSearch:l,hasFilters:u,selectedFiltersLength:g,toggleFilters:x}=e,T=ki(),$=(0,f.useCallback)(q=>{e.onSearchChanged(q),l(q)},[e,l]);return u?(0,r.jsxs)(E.Z,{className:T.root,children:[(0,r.jsxs)(E.Z,{className:T.root,children:[(0,r.jsx)(K.Z,{onClick:x,"aria-label":"filter list",children:(0,r.jsx)(ls.Z,{})}),(0,r.jsxs)(Je.Z,{className:T.title,children:["Filters (",g,")"]})]}),(0,r.jsx)(Us,{...e,ref:s,onSearchChanged:$})]}):(0,r.jsx)(Us,{...e,ref:s,onSearchChanged:$})}function zs(e){var s,l;const{data:u,columns:g,options:x,title:T,subtitle:$,filters:q,initialState:Q,emptyContent:fe,onStateChange:ge,components:Ue,...Pe}=e,Ve=Bi(),pt=(0,se.Z)(),at={...Ms,...Q},[Wt,$n]=(0,f.useState)(at.filtersOpen),Vn=(0,f.useCallback)(()=>$n(Qn=>!Qn),[$n]),[kt,en]=(0,f.useState)(0),[vn,Un]=(0,f.useState)(u),[Mn,ir]=(0,f.useState)(at.filters),br=Da(g,pt),[Qr,kr]=(0,f.useState)(at.search);(0,f.useEffect)(()=>{if(ge){const Qn=$i({search:Qr,filtersOpen:Wt,filters:Mn},Ms);ge(Qn)}},[Qr,Wt,Mn,ge]);const bs={headerStyle:{textTransform:"uppercase"}},un=(0,f.useCallback)(Qn=>{var Mr;return(Mr=g.find(Br=>Br.title===Qn))===null||Mr===void 0?void 0:Mr.field},[g]);(0,f.useEffect)(()=>{if(typeof u=="function")return;if(!Mn){Un(u);return}const Qn=Object.values(Mn);if(u&&Qn.flat().length){const Mr=u.filter(Br=>!!Object.entries(Mn).filter(([,Sr])=>!!Sr.length).every(([Sr,Hn])=>{const ar=ds(Br,un(Sr));return Array.isArray(ar)&&Array.isArray(Hn)?ar.some(Wo=>Hn.includes(Wo)):Array.isArray(ar)?ar.includes(Hn):Array.isArray(Hn)?Hn.includes(ar):ar===Hn}));Un(Mr)}else Un(u);en(Qn.flat().length)},[u,Mn,un]);const zo=(Qn,Mr)=>{const Br=Hn=>{const ar=new Set,Wo=ao=>{ao!=null&&ar.add(ao)};return Mr&&Mr.forEach(ao=>{const Xr=ds(ao,un(Hn));Array.isArray(Xr)?Xr.forEach(Wo):Wo(Xr)}),ar},Sr=Hn=>({placeholder:"All results",label:Hn.column,multiple:Hn.type==="multiple-select",items:[...Br(Hn.column)].sort().map(ar=>({label:ar,value:ar}))});return Qn.map(Hn=>({type:Hn.type,element:Sr(Hn)}))},si=!!(!((s=q)===null||s===void 0)&&s.length),So=(0,f.useCallback)(Qn=>(0,r.jsx)(Di,{setSearch:kr,hasFilters:si,selectedFiltersLength:kt,toggleFilters:Vn,...Qn}),[Vn,si,kt,kr]),ii=typeof u!="function"&&u.length===0,ai=g.length,ya=(0,f.useCallback)(Qn=>fe&&ii?(0,r.jsx)("tbody",{children:(0,r.jsx)("tr",{children:(0,r.jsx)("td",{colSpan:ai,children:fe})})}):(0,r.jsx)($o.os,{...Qn}),[ii,fe,ai]);return(0,r.jsxs)(E.Z,{className:Ve.root,children:[Wt&&u&&typeof u!="function"&&((l=q)===null||l===void 0?void 0:l.length)&&(0,r.jsx)(Li,{filters:zo(q,u),selectedFilters:Mn,onChangeFilters:ir}),(0,r.jsx)($o.ZP,{components:{Header:Oi,Toolbar:So,Body:ya,...Ue},options:{...bs,...x},columns:br,icons:Zs,title:(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(Je.Z,{variant:"h5",component:"h2",children:T}),$&&(0,r.jsx)(Je.Z,{color:"textSecondary",variant:"body1",children:$})]}),data:typeof u=="function"?u:vn,style:{width:"100%"},localization:{toolbar:{searchPlaceholder:"Filter",searchTooltip:"Filter"}},...Pe})]})}zs.icons=Object.freeze(Zs);var Ni=n(44311);function us(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 Na(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:us(e.data,s)})]})}const Fi=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"}),Zi=({title:e="Unknown page",className:s})=>(0,r.jsx)(Je.Z,{variant:"h4",component:"h2",className:s,"data-testid":"header-title",children:e});function Ui(e){const{description:s,title:l,titleComponent:u=void 0,children:g,textAlign:x="left"}=e,T=Fi({textAlign:x})(),$=u||(0,r.jsx)(Zi,{title:l,className:T.title});return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(os.q,{title:l}),(0,r.jsxs)(E.Z,{className:T.container,children:[(0,r.jsxs)(E.Z,{className:T.leftItemsBox,children:[$,s&&(0,r.jsx)(Je.Z,{className:T.description,variant:"body2",children:s})]}),(0,r.jsx)(E.Z,{className:T.rightItemsBox,children:g})]})]})}var Fa=n.p+"static/mic-drop.fe3ef4d0..svg";const yo=(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"}),Za=()=>{const e=yo();return(0,r.jsx)("img",{src:Fa,className:e.micDrop,alt:"Girl dropping mic from her hands"})},Ua=(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 Ws(e){const{status:s,statusMessage:l,additionalInfo:u,supportUrl:g}=e,x=Ua(),T=(0,er.s0)(),$=vi();return(0,r.jsxs)(Vt.Z,{container:!0,spacing:0,className:x.container,children:[(0,r.jsxs)(Vt.Z,{item:!0,xs:12,sm:8,md:4,children:[(0,r.jsxs)(Je.Z,{"data-testid":"error",variant:"body1",className:x.subtitle,children:["ERROR ",s,": ",l]}),(0,r.jsx)(Je.Z,{variant:"body1",className:x.subtitle,children:u}),(0,r.jsx)(Je.Z,{variant:"h2",className:x.title,children:"Looks like someone dropped the mic!"}),(0,r.jsxs)(Je.Z,{variant:"h6",children:[(0,r.jsx)(le.r,{to:"#","data-testid":"go-back-link",onClick:()=>T(-1),children:"Go back"}),"... or please"," ",(0,r.jsx)(le.r,{to:g||$.url,children:"contact support"})," if you think this is a bug."]})]}),(0,r.jsx)(Za,{})]})}var Ma=n(16173);const za=(0,Fn.Z)({root:{textDecoration:"underline",cursor:"pointer"}},{name:"BackstageBreadcrumbsClickableText"})(Je.Z),hs=(0,Fn.Z)({root:{textDecoration:"underline",color:"inherit"}},{name:"BackstageBreadcrumbsStyledBox"})(E.Z);function Mi(e){const{children:s,...l}=e,[u,g]=f.useState(null),x=f.Children.toArray(s),[T,$,...q]=x,Q=q.length?q.pop():x[x.length-1],fe=x.length>3,ge=Ve=>{g(Ve.currentTarget)},Ue=()=>{g(null)},Pe=Boolean(u);return(0,r.jsxs)(f.Fragment,{children:[(0,r.jsxs)(Ma.Z,{"aria-label":"breadcrumb",...l,children:[x.length>1&&(0,r.jsx)(hs,{clone:!0,children:T}),x.length>2&&(0,r.jsx)(hs,{clone:!0,children:$}),fe&&(0,r.jsx)(za,{onClick:ge,children:"..."}),(0,r.jsx)(E.Z,{style:{fontStyle:"italic"},children:Q})]}),(0,r.jsx)(go.ZP,{open:Pe,anchorEl:u,onClose:Ue,anchorOrigin:{vertical:"bottom",horizontal:"left"},transformOrigin:{vertical:"top",horizontal:"left"},children:(0,r.jsx)(It.Z,{children:q.map((Ve,pt)=>(0,r.jsx)(Bt.Z,{button:!0,children:(0,r.jsx)(hs,{clone:!0,children:Ve})},pt))})})]})}const xo=72,zi=24,Wi=18,vr={drawerWidthClosed:xo,drawerWidthOpen:224,defaultOpenDelayMs:100,defaultCloseDelayMs:0,defaultFadeDuration:200,logoHeight:32,iconContainerWidth:xo,iconSize:xo-zi*2,iconPadding:zi,selectedIndicatorWidth:3,userBadgePadding:Wi,userBadgeDiameter:xo-Wi*2,mobileSidebarHeight:56},Vs=e=>({...vr,...e,iconContainerWidth:vr.drawerWidthClosed,iconSize:vr.drawerWidthClosed-vr.iconPadding*2,userBadgeDiameter:vr.drawerWidthClosed-vr.userBadgePadding*2}),Hs={drawerWidthClosed:0,drawerWidthOpen:202,defaultOpenDelayMs:vr.defaultOpenDelayMs+200},Vi=e=>({...Hs,...e}),ps="@backstage/core/sidebar-intro-dismissed",Rr=(0,f.createContext)({sidebarConfig:vr,submenuConfig:Hs}),Hi=(0,f.createContext)({isHoveredOn:!1,setIsHoveredOn:()=>{}});var Wa=n(50023),Va=n(4190),Gi=n(87685),Jn=n(44882),fs=n(51837);const Gs={isOpen:!1,setOpen:()=>{}},Ki=(0,f.createContext)(Gs),Yi=(0,fs.CT)("sidebar-open-state-context");function Ji(e){const{children:s,value:l}=e;return(0,r.jsx)(Ki.Provider,{value:l,children:(0,r.jsx)(Yi.Provider,{value:(0,fs.EI)({1:l}),children:s})})}const Ks=()=>{const e=(0,f.useContext)(Yi),s=(0,f.useContext)(Ki);if(e===void 0)return s||Gs;const l=e.atVersion(1);if(l===void 0)throw new Error("No context found for version 1.");return l};var Ha=n(57998),Ga=n(98864);const Qi={isPinned:!0,toggleSidebarPinState:()=>{},isMobile:!1},Xi=(0,f.createContext)(Qi),_i=(0,fs.CT)("sidebar-pin-state-context");function Ka(e){const{children:s,value:l}=e;return(0,r.jsx)(Xi.Provider,{value:l,children:(0,r.jsx)(_i.Provider,{value:(0,fs.EI)({1:l}),children:s})})}const gs=()=>{const e=(0,f.useContext)(_i),s=(0,f.useContext)(Xi);if(e===void 0)return s||Qi;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"}})),Ys=e=>{const{to:s,label:l,icon:u,value:g}=e,{sidebarConfig:x}=(0,f.useContext)(Rr),T=Ya({sidebarConfig:x}),$=(0,er.TH)(),{selectedMenuItemIndex:q,setSelectedMenuItemIndex:Q}=(0,f.useContext)(Xs),fe=(Ue,Pe)=>{Q(Pe===q?-1:Pe)},ge=g===q&&q>=0||g!==q&&!(q>=0)&&s===$.pathname;return(0,r.jsx)(Ha.Z,{"aria-label":l,label:l,icon:u,component:Ga.rU,to:s||$.pathname,onChange:fe,value:g,selected:ge,classes:T})},Js=e=>{const{children:s,to:l,label:u,icon:g,value:x}=e,{isMobile:T}=gs();return T?(0,r.jsx)(Ys,{to:l,label:u,icon:g,value:x}):(0,r.jsx)(r.Fragment,{children:s})},Qs=(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`})})),qi=e=>(0,oo.orderBy)(e,({props:{priority:s}})=>Number.isInteger(s)?s:-1,"desc"),ea=f.createElement(Js).type,ta=({children:e,label:s="Menu",open:l,onClose:u})=>{const{sidebarConfig:g}=(0,f.useContext)(Rr),x=Qs({sidebarConfig:g});return(0,r.jsxs)(Va.ZP,{anchor:"bottom",open:l,onClose:u,ModalProps:{BackdropProps:{classes:{root:x.marginMobileSidebar}}},classes:{root:x.marginMobileSidebar,paperAnchorBottom:x.overlay},children:[(0,r.jsxs)(E.Z,{className:x.overlayHeader,children:[(0,r.jsx)(Je.Z,{variant:"h3",children:s}),(0,r.jsx)(K.Z,{onClick:u,classes:{root:x.overlayHeaderClose},children:(0,r.jsx)(Gi.Z,{})})]}),(0,r.jsx)(E.Z,{component:"nav",children:e})]})},Xs=(0,f.createContext)({selectedMenuItemIndex:-1,setSelectedMenuItemIndex:()=>{}}),na=e=>{const{sidebarConfig:s}=(0,f.useContext)(Rr),{children:l}=e,u=Qs({sidebarConfig:s}),g=(0,er.TH)(),[x,T]=(0,f.useState)(-1);(0,f.useEffect)(()=>{T(-1)},[g.pathname]);let $=(0,p.vJ)(l,Q=>Q.getElements().filter(fe=>fe.type===ea));if(l)$.length?$=qi($):$.push((0,r.jsx)(Js,{icon:(0,r.jsx)(Jn.Z,{}),children:l},"default_menu"));else return null;const q=x>=0&&!$[x].props.to;return(0,r.jsx)(Ji,{value:{isOpen:!0,setOpen:()=>{}},children:(0,r.jsxs)(Xs.Provider,{value:{selectedMenuItemIndex:x,setSelectedMenuItemIndex:T},children:[(0,r.jsx)(ta,{label:$[x]&&$[x].props.label,open:q,onClose:()=>T(-1),children:$[x]&&$[x].props.children}),(0,r.jsx)(Wa.Z,{className:u.root,"data-testid":"mobile-sidebar-root",component:"nav",children:$})]})})};var Zo;(function(e){e.SIDEBAR_PIN_STATE="sidebarPinState"})(Zo||(Zo={}));const _s={getSidebarPinState(){let e;try{e=JSON.parse(window.localStorage.getItem(Zo.SIDEBAR_PIN_STATE)||"true")}catch{return!0}return!!e},setSidebarPinState(e){return window.localStorage.setItem(Zo.SIDEBAR_PIN_STATE,JSON.stringify(e))}},Ja=(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"}),ei=(0,f.createContext)({content:{contentRef:void 0}});function ra(e){const[s,l]=(0,f.useState)(()=>_s.getSidebarPinState()),{sidebarConfig:u}=(0,f.useContext)(Rr),g=(0,f.useRef)(null),x=(0,f.useMemo)(()=>({content:{contentRef:g}}),[g]);(0,f.useEffect)(()=>{_s.setSidebarPinState(s)},[s]);const T=(0,Se.Z)(Q=>Q.breakpoints.down("xs"),{noSsr:!0}),$=()=>l(!s),q=Ja({isPinned:s,sidebarConfig:u});return(0,r.jsx)(Ka,{value:{isPinned:s,toggleSidebarPinState:$,isMobile:T},children:(0,r.jsx)(ei.Provider,{value:x,children:(0,r.jsx)(E.Z,{className:q.root,children:e.children})})})}function oa(){var e;const{content:s}=(0,f.useContext)(ei);return{focusContent:(0,f.useCallback)(()=>{var u,g,x;(x=s)===null||x===void 0||(g=x.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 ti=(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 tr;(function(e){e[e.Closed=0]="Closed",e[e.Idle=1]="Idle",e[e.Open=2]="Open"})(tr||(tr={}));const sa=e=>{const{sidebarConfig:s}=(0,f.useContext)(Rr),{openDelayMs:l=s.defaultOpenDelayMs,closeDelayMs:u=s.defaultCloseDelayMs,disableExpandOnHover:g,children:x}=e,T=ti({sidebarConfig:s}),$=(0,Se.Z)(Wt=>Wt.breakpoints.down("md"),{noSsr:!0}),[q,Q]=(0,f.useState)(tr.Closed),fe=(0,f.useRef)(),{isPinned:ge,toggleSidebarPinState:Ue}=gs(),Pe=()=>{ge||g||(fe.current&&(clearTimeout(fe.current),fe.current=void 0),q!==tr.Open&&!$&&(fe.current=window.setTimeout(()=>{fe.current=void 0,Q(tr.Open)},l),Q(tr.Idle)))},Ve=()=>{ge||g||(fe.current&&(clearTimeout(fe.current),fe.current=void 0),q===tr.Idle?Q(tr.Closed):q===tr.Open&&(fe.current=window.setTimeout(()=>{fe.current=void 0,Q(tr.Closed)},u)))},pt=q===tr.Open&&!$||ge,at=Wt=>{Wt?(Q(tr.Open),Ue()):(Q(tr.Closed),Ue())};return(0,r.jsxs)("nav",{style:{},"aria-label":"sidebar nav",children:[(0,r.jsx)(aa,{}),(0,r.jsx)(Ji,{value:{isOpen:pt,setOpen:at},children:(0,r.jsx)(E.Z,{className:T.root,"data-testid":"sidebar-root",onMouseEnter:g?()=>{}:Pe,onFocus:g?()=>{}:Pe,onMouseLeave:g?()=>{}:Ve,onBlur:g?()=>{}:Ve,children:(0,r.jsx)(E.Z,{className:on()(T.drawer,T.drawerWidth,{[T.drawerOpen]:pt}),children:x})})})]})},ia=e=>{var s;const l=Vs((s=e.sidebarOptions)!==null&&s!==void 0?s:{});var u;const g=Vi((u=e.submenuOptions)!==null&&u!==void 0?u:{}),{children:x,disableExpandOnHover:T,openDelayMs:$,closeDelayMs:q}=e,{isMobile:Q}=gs();return Q?(0,r.jsx)(na,{children:x}):(0,r.jsx)(Rr.Provider,{value:{sidebarConfig:l,submenuConfig:g},children:(0,r.jsx)(sa,{openDelayMs:$,closeDelayMs:q,disableExpandOnHover:T,children:x})})};function aa(){var e;const{sidebarConfig:s}=(0,f.useContext)(Rr),{focusContent:l,contentRef:u}=oa(),g=ti({sidebarConfig:s});return!((e=u)===null||e===void 0)&&e.current?(0,r.jsx)(ye.Z,{onClick:l,variant:"contained",className:on()(g.visuallyHidden),children:"Skip to content"}):null}function ni(e,s,l=!1){const u=new URLSearchParams(s.search).toString(),g=Ls().parse(u),x=new URLSearchParams(e.search).toString(),T=Ls().parse(x),$=l?oo.isEqual:oo.isMatch;return(0,oo.isEqual)(s.pathname,e.pathname)&&$(T,g)}const la=(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"}),Ir=e=>{const{title:s,subtitle:l,to:u,icon:g,dropdownItems:x,exact:T}=e,$=la(),{setIsHoveredOn:q}=useContext(SidebarItemWithSubmenuContext),Q=()=>{q(!1)},fe=useResolvedPath(u!=null?u:""),ge=useLocation();let Ue=isLocationMatch(ge,fe,T);const[Pe,Ve]=useState(!1),pt=()=>{Ve(!Pe)};return x!==void 0?(x.some(at=>{const Wt=resolvePath(at.to);return Ue=isLocationMatch(ge,Wt,T),Ue}),_jsxs(Box,{className:$.itemContainer,children:[_jsx(Tooltip,{title:s,enterDelay:500,enterNextDelay:500,children:_jsxs(Button,{role:"button",onClick:pt,onTouchStart:at=>at.stopPropagation(),className:classnames($.item,Ue?$.selected:void 0),children:[g&&_jsx(g,{fontSize:"small"}),_jsxs(Typography,{variant:"subtitle1",component:"span",className:$.label,children:[s,_jsx("br",{}),l&&_jsx(Typography,{variant:"caption",component:"span",className:$.subtitle,children:l})]}),Pe?_jsx(ArrowDropUpIcon,{className:$.dropdownArrow}):_jsx(ArrowDropDownIcon,{className:$.dropdownArrow})]})}),x&&Pe&&_jsx(Box,{className:$.dropdown,children:x.map((at,Wt)=>_jsx(Tooltip,{title:at.title,enterDelay:500,enterNextDelay:500,children:_jsx(Link,{to:at.to,underline:"none",className:$.dropdownItem,onClick:Q,onTouchStart:$n=>$n.stopPropagation(),children:_jsx(Typography,{component:"span",className:$.textContent,children:at.title})})},Wt))})]})):_jsx(Box,{className:$.itemContainer,children:_jsx(Tooltip,{title:s,enterDelay:500,enterNextDelay:500,children:_jsxs(Link,{to:u,underline:"none",className:classnames($.item,Ue?$.selected:void 0),onClick:Q,onTouchStart:at=>at.stopPropagation(),children:[g&&_jsx(g,{fontSize:"small"}),_jsxs(Typography,{variant:"subtitle1",component:"span",className:$.label,children:[s,_jsx("br",{}),l&&_jsx(Typography,{variant:"caption",component:"span",className:$.subtitle,children:l})]})]})})})};var ms;const ca=(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:(ms=(l=e.palette.navigation.submenu)===null||l===void 0?void 0:l.background)!==null&&ms!==void 0?ms:"#404040",overflowX:"hidden",msOverflowStyle:"none",scrollbarWidth:"none",cursor:"default",width: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"}),da=e=>{const{isOpen:s}=Ks(),{sidebarConfig:l,submenuConfig:u}=(0,f.useContext)(Rr),g=s?l.drawerWidthOpen:l.drawerWidthClosed,x=ca({left:g,submenuConfig:u}),{isHoveredOn:T}=(0,f.useContext)(Hi),[$,q]=(0,f.useState)(!1);return(0,f.useEffect)(()=>{q(T)},[T]),(0,r.jsxs)(E.Z,{className:on()(x.drawer,{[x.drawerOpen]:$}),children:[(0,r.jsx)(Je.Z,{variant:"h5",component:"span",className:x.title,children:e.title}),e.children]})};var ri=n(26739),Uo=n(76600),ua=n(83543),ha=n(59797),oi=n(98989);const Qa=(0,m.Z)({iconContainer:{display:"flex",position:"relative",width:"100%"},arrow1:{right:"6px",position:"absolute"}}),Xa=()=>{const e=Qa();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 i=null;const t=(0,m.Z)({iconContainer:{display:"flex",position:"relative",width:"100%"},arrow1:{right:"6px",position:"absolute"}}),o=()=>{const e=t();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 a=null,d,S;const B=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:(d=(l=s.palette.navigation.navItem)===null||l===void 0?void 0:l.hoverBackground)!==null&&d!==void 0?d:"#404040"}},highlighted:{background:(S=(u=s.palette.navigation.navItem)===null||u===void 0?void 0:u.hoverBackground)!==null&&S!==void 0?S:"#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 Z(e){return(0,f.useMemo)(()=>B(e),[e])()}const oe=(e,s)=>(0,p.vJ)(e.props.children,l=>{let u=!1;return l.getElements().forEach(({props:{to:g,dropdownItems:x}})=>{if(!u){var T;if(!((T=x)===null||T===void 0)&&T.length){x.forEach(({to:$})=>u=u||ni(s,(0,Bo.i3)($)));return}g&&(u=ni(s,(0,Bo.i3)(g)))}}),u},[s.pathname]);function me(e){return e.to===void 0}const Me=f.createElement(da).type,Te=f.forwardRef(function({to:s,end:l,style:u,className:g,activeStyle:x,caseSensitive:T,activeClassName:$="active","aria-current":q="page",...Q},fe){let{pathname:ge}=(0,er.TH)(),{pathname:Ue}=(0,er.WU)(s);T||(ge=ge.toLocaleLowerCase("en-US"),Ue=Ue.toLocaleLowerCase("en-US"));let Pe=ge===Ue;!Pe&&!l&&(Pe=ge.startsWith(`${Ue}/`));const Ve=Pe?q:void 0;return(0,r.jsx)(k.rU,{...Q,to:s,ref:fe,"aria-current":Ve,style:{...u,...Pe?x:void 0},className:on()([g,Pe?$:void 0])})}),Ze=(0,f.forwardRef)((e,s)=>{const{icon:l,text:u,hasNotifications:g=!1,hasSubmenu:x=!1,disableHighlight:T=!1,onClick:$,noTrack:q,children:Q,className:fe,...ge}=e,{sidebarConfig:Ue}=(0,f.useContext)(Rr),Pe=Z(Ue),{isOpen:Ve}=Ks(),pt=!Ve&&x?{display:"flex",marginLeft:"20px"}:{lineHeight:"0"},at=(0,r.jsxs)(E.Z,{style:pt,children:[(0,r.jsx)(l,{fontSize:"small"}),!Ve&&x?(0,r.jsx)(oi.Z,{fontSize:"small"}):(0,r.jsx)(r.Fragment,{})]}),Wt=(0,r.jsx)(ri.Z,{color:"secondary",variant:"dot",overlap:"circular",invisible:!g,className:on()({[Pe.closedItemIcon]:!Ve}),children:at}),$n=(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(E.Z,{"data-testid":"login-button",className:Pe.iconContainer,children:Wt}),u&&(0,r.jsx)(Je.Z,{variant:"subtitle2",component:"span",className:Pe.label,children:u}),(0,r.jsx)("div",{className:Pe.secondaryAction,children:Q})]}),Vn=Ve?$n:Wt,kt={onClick:$,className:on()(fe,Pe.root,Ve?Pe.open:Pe.closed,me(e)&&Pe.buttonItem,{[Pe.highlightable]:!T})},en=(0,p.z$)(),{pathname:vn}=(0,er.WU)(!me(e)&&e.to?e.to:""),Un=(0,f.useCallback)(Mn=>{var ir;if(!q){const br="click",Qr=u!=null?u:"Sidebar Item",kr=vn?{attributes:{to:vn}}:void 0;en.captureEvent(br,Qr,kr)}(ir=$)===null||ir===void 0||ir(Mn)},[en,u,vn,q,$]);return me(e)?(0,r.jsx)(ye.Z,{role:"button","aria-label":u,...kt,ref:s,onClick:Un,children:Vn}):(0,r.jsx)(Te,{...kt,activeClassName:Pe.selected,to:e.to?e.to:"",ref:s,"aria-label":u||e.to,...ge,onClick:Un,children:Vn})}),Ge=({children:e,...s})=>{const{sidebarConfig:l}=(0,f.useContext)(Rr),u=Z(l),[g,x]=(0,f.useState)(!1),T=(0,er.TH)(),$=oe(e,T),q=(0,Se.Z)(Ue=>Ue.breakpoints.down("sm")),Q=()=>{x(!0)},fe=()=>{x(!1)},ge=()=>q?g?(0,r.jsx)(ha.Z,{fontSize:"small",className:u.submenuArrow}):(0,r.jsx)(ua.Z,{fontSize:"small",className:u.submenuArrow}):!g&&(0,r.jsx)(oi.Z,{fontSize:"small",className:u.submenuArrow});return(0,r.jsx)(Hi.Provider,{value:{isHoveredOn:g,setIsHoveredOn:x},children:(0,r.jsxs)("div",{"data-testid":"item-with-submenu",onMouseLeave:fe,onTouchStart:g?fe:Q,onMouseEnter:Q,className:on()(g&&u.highlighted),children:[(0,r.jsx)(Ze,{hasSubmenu:!0,className:$?u.selected:"",...s,children:ge()}),g&&e]})})},st=(0,f.forwardRef)((e,s)=>{const[l]=(0,p.vJ)(e.children,u=>u.getElements().filter(g=>g.type===Me));return l?(0,r.jsx)(Ge,{...e,children:l}):(0,r.jsx)(Ze,{...e,ref:s})});function qt(e){const{sidebarConfig:s}=useContext(SidebarConfigContext),[l,u]=useState(""),g=Z(s),x=e.icon?e.icon:SearchIcon,T=()=>{e.onSearch(l),u("")},$=ge=>{ge.key==="Enter"&&(ge.preventDefault(),T())},q=ge=>{u(ge.target.value)},Q=ge=>{ge.preventDefault(),ge.stopPropagation()},fe=ge=>{T(),ge.preventDefault()};return _jsx(Box,{className:g.searchRoot,children:_jsx(st,{icon:x,to:e.to,onClick:fe,disableHighlight:!0,children:_jsx(TextField,{placeholder:"Search",value:l,onClick:Q,onChange:q,onKeyDown:$,className:g.searchContainer,InputProps:{disableUnderline:!0,className:g.searchField},inputProps:{className:g.searchFieldHTMLInput}})})})}const Ht=(0,Uo.Z)("div")({flex:1},{name:"BackstageSidebarSpace"}),nr=(0,Uo.Z)("div")({height:8},{name:"BackstageSidebarSpacer"}),Ur=(0,Uo.Z)("hr")(({theme:e})=>({height:1,width:"100%",background:"#383838",border:"none",margin:e.spacing(1.2,0)}),{name:"BackstageSidebarDivider"}),pr=e=>({overflowY:"auto","&::-webkit-scrollbar":{backgroundColor:e.palette.background.default,width:"5px",borderRadius:"5px"},"&::-webkit-scrollbar-thumb":{backgroundColor:e.palette.text.secondary,borderRadius:"5px"}}),yr=(0,Uo.Z)("div")(({theme:e})=>{const s=pr(e);return{flex:"0 1 auto",overflowX:"hidden",width:"calc(100% - 5px)",minHeight:"48px",overflowY:"hidden","@media (hover: none)":s,"&:hover":s}}),xr=()=>{const{sidebarConfig:e}=useContext(SidebarConfigContext),s=Z(e),{isOpen:l,setOpen:u}=useSidebarOpenState();if(useMediaQuery(T=>T.breakpoints.down("md"),{noSsr:!0}))return null;const x=()=>{u(!l)};return _jsx(Button,{role:"button",onClick:x,className:s.expandButton,"aria-label":"Expand Sidebar","data-testid":"sidebar-expand-button",children:_jsx(Box,{className:s.arrows,children:l?_jsx(DoubleArrowLeft,{}):_jsx(DoubleArrowRight,{})})})},Zn=(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 Pr(e){const{sidebarConfig:s}=useContext(SidebarConfigContext),l=Zn({sidebarConfig:s}),{text:u,onClose:g}=e,x=()=>g();return _jsxs(Box,{className:l.introCard,children:[_jsx(Typography,{variant:"subtitle2",children:u}),_jsx(Box,{className:l.introDismiss,children:_jsxs(IconButton,{onClick:x,className:l.introDismissLink,children:[_jsx(CloseIcon,{className:l.introDismissIcon}),_jsx(Typography,{component:"span",className:l.introDismissText,children:"Dismiss"})]})})]})}const Lr=e=>{const{text:s,onDismiss:l}=e,[u,g]=useState(!1),x=()=>{g(!0)};return _jsx(Collapse,{in:!u,onExited:l,children:_jsx(Pr,{text:s,onClose:x})})},Or=null,On="And your recently viewed plugins will pop up here!";function Jr(e){const{isOpen:s}=useSidebarOpenState(),l={starredItemsDismissed:!1,recentlyViewedItemsDismissed:!1},{value:u,set:g}=useLocalStorageValue(SIDEBAR_INTRO_LOCAL_STORAGE),{starredItemsDismissed:x,recentlyViewedItemsDismissed:T}=u!=null?u:{},$=()=>{g(Q=>({...l,...Q,starredItemsDismissed:!0}))},q=()=>{g(Q=>({...l,...Q,recentlyViewedItemsDismissed:!0}))};return s?_jsxs(_Fragment,{children:[!x&&_jsxs(_Fragment,{children:[_jsx(Lr,{text:Or,onDismiss:$}),_jsx(SidebarDivider,{})]}),!T&&_jsx(Lr,{text:On,onDismiss:q})]}):null}const bo=(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"}),pa=({type:e,typeLink:s,classes:l,pageTitle:u})=>e?s?(0,r.jsxs)(Mi,{className:l.breadcrumb,children:[(0,r.jsx)(le.r,{to:s,children:e}),(0,r.jsx)(Je.Z,{children:u})]}):(0,r.jsx)(Je.Z,{className:l.type,children:e}):null,io=({pageTitle:e,classes:s,tooltip:l})=>{const{contentRef:u}=oa(),g=(0,r.jsx)(Je.Z,{ref:u,tabIndex:-1,className:s.title,variant:"h1",children:e});return l?(0,r.jsx)(R.ZP,{title:l,placement:"top-start",children:g}):g},fa=({classes:e,subtitle:s})=>s?typeof s!="string"?(0,r.jsx)(r.Fragment,{children:s}):(0,r.jsx)(Je.Z,{className:e.subtitle,variant:"subtitle2",component:"span",children:s}):null;function vs(e){const{children:s,pageTitleOverride:l,style:u,subtitle:g,title:x,tooltip:T,type:$,typeLink:q}=e,Q=bo(),ge=(0,p.h_)(p.Ds).getOptionalString("app.title")||"Backstage",Ue=l||x,Pe=x||l,Ve=`${Ue} | %s | ${ge}`,pt=`${Ue} | ${ge}`;return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(os.q,{titleTemplate:Ve,defaultTitle:pt}),(0,r.jsxs)("header",{style:u,className:Q.header,children:[(0,r.jsxs)(E.Z,{className:Q.leftItemsBox,children:[(0,r.jsx)(pa,{classes:Q,type:$,typeLink:q,pageTitle:Pe}),(0,r.jsx)(io,{classes:Q,pageTitle:Pe,tooltip:T}),(0,r.jsx)(fa,{classes:Q,subtitle:g})]}),(0,r.jsx)(Vt.Z,{container:!0,className:Q.rightItemsBox,spacing:4,children:s})]})]})}const sl=({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:x=>{g&&g(x)},children:[l&&_jsx(ListItemIcon,{children:l}),_jsx(ListItemText,{primary:e,secondary:s})]})});function Nl(e){const{palette:{common:{white:s}}}=useTheme(),{actionItems:l}=e,[u,g]=React.useState(!1),x=React.useRef(null);return _jsxs(Fragment,{children:[_jsx(IconButton,{onClick:()=>g(!0),"data-testid":"header-action-menu",ref:x,style:{color:s,height:56,width:56,marginRight:-4,padding:0},children:_jsx(MoreVert,{})}),_jsx(Popover,{open:u,anchorEl:x.current,anchorOrigin:{horizontal:"right",vertical:"bottom"},transformOrigin:{horizontal:"right",vertical:"top"},onClose:()=>g(!1),children:_jsx(List,{children:l.map((T,$)=>_jsx(sl,{...T},`header-action-menu-${$}`))})})]})}const il=(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,ln.Fq)(e.page.fontColor,.8),fontSize:e.typography.fontSize,lineHeight:1}}),{name:"BackstageHeaderLabel"}),al=({value:e,className:s})=>(0,r.jsx)(Je.Z,{component:typeof e=="string"?"p":"span",className:s,children:e});function ll(e){const{label:s,value:l,url:u}=e,g=il(),x=(0,r.jsx)(al,{className:g.value,value:l||"<Unknown>"});return(0,r.jsx)(Vt.Z,{item:!0,children:(0,r.jsxs)(Je.Z,{component:"span",className:g.root,children:[(0,r.jsx)(Je.Z,{className:g.label,children:s}),u?(0,r.jsx)(le.r,{to:u,children:x}):x]})})}const cl=e=>(0,qn.Z)({root:{color:e.palette.common.white,padding:e.spacing(2,2,3),backgroundImage:e.getPageTheme({themeId:"card"}).backgroundImage,backgroundPosition:0,backgroundSize:"inherit"}}),dl=(0,m.Z)(cl,{name:"BackstageItemCardHeader"});function ul(e){const{title:s,subtitle:l,children:u}=e,g=dl(e);return(0,r.jsxs)(E.Z,{className:g.root,children:[l&&(0,r.jsx)(Je.Z,{variant:"subtitle2",component:"h3",children:l}),s&&(0,r.jsx)(Je.Z,{variant:"h6",component:"h4",children:s}),u]})}function Fl(e){var s;const{description:l,tags:u,title:g,type:x,subtitle:T,label:$,onClick:q,href:Q}=e;return _jsxs(Card,{children:[_jsx(CardMedia,{children:_jsx(ItemCardHeader,{title:g,subtitle:T||x})}),_jsxs(CardContent,{children:[!((s=u)===null||s===void 0)&&s.length?_jsx(Box,{children:u.map((fe,ge)=>_jsx(Chip,{size:"small",label:fe},ge))}):null,l]}),_jsxs(CardActions,{children:[!Q&&_jsx(LinkButton,{to:"#",onClick:q,color:"primary",children:$}),Q&&_jsx(LinkButton,{to:Q,color:"primary",children:$})]})]})}const hl=e=>(0,qn.Z)({root:{display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(22em, 1fr))",gridAutoRows:"1fr",gridGap:e.spacing(2)}}),pl=(0,m.Z)(hl,{name:"BackstageItemCardGrid"});function fl(e){const{children:s,...l}=e,u=pl(l);return(0,r.jsx)(E.Z,{className:u.root,...l,children:s})}var gl=n(41547);const ml=(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 _a(e){const{themeId:s,children:l}=e,u=ml();return(0,r.jsx)(gl.Z,{theme:g=>({...g,page:g.getPageTheme({themeId:s})}),children:(0,r.jsx)("main",{className:u.root,children:l})})}function vl(e){const{themeId:s,children:l,...u}=e;return(0,r.jsxs)(_a,{themeId:s,children:[(0,r.jsx)(vs,{...u}),l]})}var sr=n(30195);const Zl=sr.z.object({providerInfo:sr.z.object({}).catchall(sr.z.unknown()).optional(),profile:sr.z.object({email:sr.z.string().optional(),displayName:sr.z.string().optional(),picture:sr.z.string().optional()}),backstageIdentity:sr.z.object({token:sr.z.string(),identity:sr.z.object({type:sr.z.literal("user"),userEntityRef:sr.z.string(),ownershipEntityRefs:sr.z.array(sr.z.string())})})}),qa={defaultTokenExpiryMillis:5*60*1e3,tokenExpiryMarginMillis:5*60*1e3};function yl(e){const s=new Date(Date.now()+qa.defaultTokenExpiryMillis);if(!e)return s;const[l,u,g]=e.split("."),x=JSON.parse(window.atob(u));return typeof x.exp!="number"?s:new Date(x.exp*1e3-qa.tokenExpiryMarginMillis)}class Ul{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:yl(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 Ml=e=>{const s=useApi(discoveryApiRef),[{status:l,error:u},{execute:g}]=useAsync(async()=>{const x=new ProxiedSignInIdentity({provider:e.provider,discoveryApi:s,headers:e.headers});await x.start(),e.onSignInSuccess(x)});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},xl=(0,m.Z)({container:{padding:0,listStyle:"none"},item:{display:"flex",flexDirection:"column",width:"100%",maxWidth:"400px",margin:0,padding:0}},{name:"BackstageSignInPage"}),ga=({children:e})=>{const s=xl();return(0,r.jsx)(Vt.Z,{component:"li",item:!0,classes:s,children:e})};var ys=n(87612);class ma{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 bl(e){const[s,l,u]=e.split(".");return JSON.parse(window.atob(l))}class va{getUserId(){return this.result.userId}static fromResult(s){return new va(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}=bl(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,ys._)(this,"result",void 0),this.result=s}}class xs{static createGuest(){return new ma}static fromLegacy(s){return va.fromResult(s)}static create(s){return new xs(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,ys._)(this,"identity",void 0),(0,ys._)(this,"authApi",void 0),(0,ys._)(this,"profile",void 0),(0,ys._)(this,"profilePromise",void 0),this.identity=s,this.authApi=l,this.profile=u}}const Sl={Component:({config:e,onSignInStarted:s,onSignInSuccess:l,onSignInFailure:u})=>{const{apiRef:g,title:x,message:T}=e,$=(0,p.h_)(g),q=(0,p.h_)(p.VE),Q=async()=>{try{s();const fe=await $.getBackstageIdentity({instantPopup:!0});if(!fe)throw u(),new Error(`The ${x} provider is not configured to support sign-in`);const ge=await $.getProfile();l(xs.create({identity:fe.identity,profile:ge,authApi:$}))}catch(fe){u(),q.post(new lo.SP("Login failed",fe))}};return(0,r.jsx)(ga,{children:(0,r.jsx)(Zr,{variant:"fullHeight",title:x,actions:(0,r.jsx)(ye.Z,{color:"primary",variant:"outlined",onClick:Q,children:"Sign In"}),children:(0,r.jsx)(Je.Z,{variant:"body1",children:T})})})},loader:async(e,s)=>{const l=e.get(s),u=await l.getBackstageIdentity({optional:!0});if(!u)return;const g=await l.getProfile();return xs.create({identity:u.identity,profile:g,authApi:l})}},Cl={Component:({onSignInStarted:e,onSignInSuccess:s})=>(0,r.jsx)(ga,{children:(0,r.jsx)(Zr,{title:"Guest",variant:"fullHeight",actions:(0,r.jsx)(ye.Z,{color:"primary",variant:"outlined",onClick:()=>{e(),s(new ma)},children:"Enter"}),children:(0,r.jsxs)(Je.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 ma};var wl=n(63955),el=n(86619),tl=n(74828),jl=n(45455),El=n.n(jl);const Al=/^[a-z0-9_\-]+\.[a-z0-9_\-]+\.[a-z0-9_\-]+$/i,Tl=(0,m.Z)(e=>({form:{display:"flex",flexFlow:"column nowrap"},button:{alignSelf:"center",marginTop:e.spacing(2)}}),{name:"BackstageCustomProvider"}),nl=e=>{const{ref:s,...l}=e;return{inputRef:s,...l}},Rl={Component:({onSignInStarted:e,onSignInSuccess:s})=>{var l;const u=Tl(),{register:g,handleSubmit:x,formState:T}=(0,wl.cI)({mode:"onChange"}),{errors:$}=T,q=({userId:Q,idToken:fe})=>{e(),s(xs.fromLegacy({userId:Q,getIdToken:fe!==void 0?async()=>fe:void 0,profile:{email:`${Q}@example.com`}}))};return(0,r.jsx)(ga,{children:(0,r.jsxs)(Zr,{title:"Custom User",variant:"fullHeight",children:[(0,r.jsxs)(Je.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:x(q),children:[(0,r.jsxs)(uo.Z,{children:[(0,r.jsx)(el.Z,{...nl(g("userId",{required:!0})),label:"User ID",margin:"normal",error:Boolean($.userId)}),$.userId&&(0,r.jsx)(tl.Z,{error:!0,children:$.userId.message})]}),(0,r.jsxs)(uo.Z,{children:[(0,r.jsx)(el.Z,{...nl(g("idToken",{required:!1,validate:Q=>!Q||Al.test(Q)||"Token is not a valid OpenID Connect JWT Token"})),label:"ID Token (optional)",margin:"normal",autoComplete:"off",error:Boolean($.idToken)}),$.idToken&&(0,r.jsx)(tl.Z,{error:!0,children:$.idToken.message})]}),(0,r.jsx)(ye.Z,{type:"submit",color:"primary",variant:"outlined",className:u.button,disabled:!(!((l=T)===null||l===void 0)&&l.isDirty)||!El()($),children:"Continue"})]})]})})},loader:async()=>{}},Mo="@backstage/core:SignInPage:provider",rl={guest:Cl,custom:Rl,common:Sl};function ol(e,s){if(e in s)throw new Error(`"${e}" ID is duplicated. IDs of identity providers have to be unique.`)}function Yl(e){return e.reduce((l,u)=>{if(typeof u=="string")return ol(u,l),l[u]={components:rl[u],id:u},l;const{id:g}=u;return ol(g,l),l[g]={components:rl.common,id:g,config:u},l},{})}const Jl=(e,s)=>{const l=useApi(errorApiRef),u=useApiHolder(),[g,x]=useState(!0),T=useCallback(q=>{s(IdentityApiSignOutProxy.from({identityApi:q,signOut:async()=>{var Q,fe;localStorage.removeItem(Mo),await((Q=(fe=q).signOut)===null||Q===void 0?void 0:Q.call(fe))}}))},[s]);useLayoutEffect(()=>{var q;if(!g)return;const Q=localStorage.getItem(Mo);if(Q===null){x(!1);return}const fe=e[Q];if(!fe){x(!1);return}let ge=!1;return fe.components.loader(u,(q=fe.config)===null||q===void 0?void 0:q.apiRef).then(Ue=>{if(ge){localStorage.removeItem(Mo);return}Ue?T(Ue):x(!1)}).catch(Ue=>{localStorage.removeItem(Mo),!ge&&(l.post(Ue),x(!1))}),()=>{ge=!0}},[g,l,s,u,e,T]);const $=useMemo(()=>Object.keys(e).map(q=>{const Q=e[q],{Component:fe}=Q.components,ge=Ve=>{T(Ve)},Ue=()=>{var Ve,pt;localStorage.setItem(Mo,((pt=Q)===null||pt===void 0||(Ve=pt.config)===null||Ve===void 0?void 0:Ve.id)||Q.id)},Pe=()=>{localStorage.removeItem(Mo)};return _jsx(fe,{config:Q.config,onSignInStarted:Ue,onSignInSuccess:ge,onSignInFailure:Pe},Q.id)}),[e,T]);return[g,$]},Il=({onSignInSuccess:e,providers:s=[],title:l,align:u="left"})=>{const g=useApi(configApiRef),x=useStyles(),T=getSignInProviders(s),[$,q]=useSignInProviders(T,e);return $?_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:x,children:q})]})]})},Pl=({provider:e,auto:s,onSignInSuccess:l})=>{const u=useStyles(),g=useApi(e.apiRef),x=useApi(configApiRef),[T,$]=useState(),[q,Q]=useState(!1),fe=async({checkExisting:ge,showPopup:Ue})=>{try{let Pe;if(ge&&(Pe=await g.getBackstageIdentity({optional:!0})),!Pe&&(Ue||s)&&(Q(!0),Pe=await g.getBackstageIdentity({instantPopup:!0}),!Pe))throw new Error(`The ${e.title} provider is not configured to support sign-in`);if(!Pe){Q(!0);return}const Ve=await g.getProfile();l(UserIdentity.create({identity:Pe.identity,authApi:g,profile:Ve}))}catch(Pe){$(Pe),Q(!0)}};return useMountEffect(()=>fe({checkExisting:!0})),q?_jsxs(Page,{themeId:"home",children:[_jsx(Header,{title:x.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:()=>{fe({showPopup:!0})},children:"Sign In"}),children:[_jsx(Typography,{variant:"body1",children:e.message}),T&&T.name!=="PopupRejectedError"&&_jsx(Typography,{variant:"body1",color:"error",children:T.message})]})})})})]}):_jsx(Progress,{})};function Ql(e){return"provider"in e?_jsx(Pl,{...e}):_jsx(Il,{...e})}const Ll=(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"}),Ol=(0,Fn.Z)(e=>({root:{padding:e.spacing(2,2,2,2.5),display:"inline-block"},title:{fontWeight:700},subheader:{paddingTop:e.spacing(1)}}),{name:"BackstageTabbedCardBoldHeader"})(Eo.Z);function Xl(e){const{slackChannel:s,errorBoundaryProps:l,children:u,title:g,deepLink:x,value:T,onChange:$}=e,q=Ll(),[Q,fe]=useState(0),ge=$||((Ve,pt)=>fe(pt));let Ue;T?React.Children.map(u,Ve=>{var pt;if(React.isValidElement(Ve)&&((pt=Ve)===null||pt===void 0?void 0:pt.props.value)===T){var at;Ue=(at=Ve)===null||at===void 0?void 0:at.props.children}}):React.Children.map(u,(Ve,pt)=>{if(React.isValidElement(Ve)&&pt===Q){var at;Ue=(at=Ve)===null||at===void 0?void 0:at.props.children}});const Pe=l||(s?{slackChannel:s}:{});return _jsx(Card,{children:_jsxs(ErrorBoundary,{...Pe,children:[g&&_jsx(Ol,{title:g}),_jsx(Tabs,{selectionFollowsFocus:!0,classes:q,value:T||Q,onChange:ge,children:u}),_jsx(Divider,{}),_jsx(CardContent,{children:Ue}),x&&_jsx(BottomLink,{...x})]})})}const kl=(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=kl();return _jsx(Tab,{disableRipple:!0,classes:u,...l})}},60871:function(Lt,Le,n){"use strict";n.d(Le,{fC:function(){return m},CL:function(){return Rt},sM:function(){return se},$v:function(){return Se},v_:function(){return k},hg:function(){return Ke},uB:function(){return xe},R5:function(){return et},bq:function(){return I},Km:function(){return U},Ds:function(){return yt},ni:function(){return E},T0:function(){return D},CO:function(){return sn},x8:function(){return fn},rx:function(){return Ln},YO:function(){return Nn},P4:function(){return Rn},NT:function(){return Ct},NW:function(){return $t},VE:function(){return zt},W0:function(){return Dt},gP:function(){return Yt},IY:function(){return vt},F4:function(){return ne},ux:function(){return K},Kp:function(){return ie},$4:function(){return ct},p_:function(){return R},ZM:function(){return ut},D:function(){return X},gW:function(){return w},E6:function(){return St},z$:function(){return Ne},h_:function(){return ye},I_:function(){return F},qD:function(){return Ye},vJ:function(){return Gn},tg:function(){return _e},Oi:function(){return Jt}});var r=n(52322),p=n(51837),W=n(2784);const f=(0,p.CT)("analytics-context"),V=()=>{const be=(0,W.useContext)(f);if(be===void 0)return{routeRef:"unknown",pluginId:"root",extension:"App"};const pe=be.atVersion(1);if(pe===void 0)throw new Error("No context found for version 1.");return pe},m=be=>{const{attributes:pe,children:Ie}=be,N={...V(),...pe},ce=(0,p.EI)({1:N});return(0,r.jsx)(f.Provider,{value:ce,children:Ie})};function h(be,pe){const Ie=H=>_jsx(m,{attributes:pe,children:_jsx(be,{...H})});return Ie.displayName=`WithAnalyticsContext(${be.displayName||be.name||"Component"})`,Ie}function F(){const be=(0,p.Vt)("api-context");if(!be)throw new Error("API context is not available");const pe=be.atVersion(1);if(!pe)throw new Error("ApiContext v1 not available");return pe}function ye(be){const Ie=F().get(be);if(!Ie)throw new Error(`No implementation available for ${be}`);return Ie}function le(be){return function(Ie){const H=ce=>{const Ae=F(),$e={};for(const qe in be)if(be.hasOwnProperty(qe)){const It=be[qe],Bt=Ae.get(It);if(!Bt)throw new Error(`No implementation available for ${It}`);$e[qe]=Bt}return _jsx(Ie,{...ce,...$e})},N=Ie.displayName||Ie.name||"Component";return H.displayName=`withApis(${N})`,H}}var z=n(87612);class de{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(pe){if((0,z._)(this,"config",void 0),this.config=pe,!pe.id.split(".").flatMap(H=>H.split("-")).every(H=>H.match(/^[a-z][a-z0-9]*$/)))throw new Error(`API id must only contain period separated lowercase alphanum tokens with dashes, got '${pe.id}'`)}}function D(be){return new de(be)}function E(be,pe){return"id"in be?{api:be,deps:{},factory:()=>pe}:be}var se;(function(be){be.SignedIn="SignedIn",be.SignedOut="SignedOut"})(se||(se={}));const ie=D({id:"core.auth.google"}),ne=D({id:"core.auth.github"}),X=D({id:"core.auth.okta"}),K=D({id:"core.auth.gitlab"}),R=D({id:"core.auth.microsoft"}),w=D({id:"core.auth.onelogin"}),I=D({id:"core.auth.bitbucket"}),U=D({id:"core.auth.bitbucket-server"}),xe=D({id:"core.auth.atlassian"}),Se=D({id:"core.alert"}),k=D({id:"core.analytics"}),Ke=D({id:"core.apptheme"}),yt=D({id:"core.config"}),$t=D({id:"core.discovery"}),zt=D({id:"core.error"});var Rt;(function(be){be[be.None=0]="None",be[be.Active=1]="Active"})(Rt||(Rt={}));const Dt=D({id:"core.featureflags"}),Yt=D({id:"core.fetch"}),ct=D({id:"core.identity"}),ut=D({id:"core.oauthrequest"}),St=D({id:"core.storage"}),lt=(0,p.uW)("core-plugin-api:analytics-tracker-events",()=>({mostRecentGatheredNavigation:void 0,mostRecentRoutableExtensionRender:void 0,beforeUnloadRegistered:!1})),Zt="_ROUTABLE-EXTENSION-RENDERED";class Gt{setContext(pe){this.context=pe}captureEvent(pe,Ie,{value:H,attributes:N}={}){const{_routeNodeType:ce,...Ae}=this.context;if(pe===Zt){lt.mostRecentGatheredNavigation&&(lt.mostRecentRoutableExtensionRender={context:{...Ae,extension:"App"}});return}if(lt.mostRecentGatheredNavigation){try{this.analyticsApi.captureEvent({...lt.mostRecentGatheredNavigation,...lt.mostRecentRoutableExtensionRender})}catch($e){console.warn("Error during analytics event capture. %o",$e)}lt.mostRecentGatheredNavigation=void 0,lt.mostRecentRoutableExtensionRender=void 0}if(pe==="navigate"&&ce==="gathered"&&Ae.pluginId==="root"){lt.mostRecentGatheredNavigation={action:pe,subject:Ie,value:H,attributes:N,context:Ae};return}try{this.analyticsApi.captureEvent({action:pe,subject:Ie,value:H,attributes:N,context:Ae})}catch($e){console.warn("Error during analytics event capture. %o",$e)}}constructor(pe,Ie={routeRef:"unknown",pluginId:"root",extension:"App"}){(0,z._)(this,"analyticsApi",void 0),(0,z._)(this,"context",void 0),this.analyticsApi=pe,this.context=Ie,lt.beforeUnloadRegistered||(addEventListener("beforeunload",()=>{lt.mostRecentGatheredNavigation&&(this.analyticsApi.captureEvent({...lt.mostRecentGatheredNavigation,...lt.mostRecentRoutableExtensionRender}),lt.mostRecentGatheredNavigation=void 0,lt.mostRecentRoutableExtensionRender=void 0)},{once:!0,passive:!0}),lt.beforeUnloadRegistered=!0)}}function Ce(){try{return ye(k)}catch{return{captureEvent:()=>{}}}}function Ne(){const be=(0,W.useRef)(null),pe=V(),Ie=Ce();function H(){return be.current===null&&(be.current=new Gt(Ie)),be.current}const N=H();return N.setContext(pe),N}const Ye=()=>{const be=(0,p.Vt)("app-context");if(!be)throw new Error("App context is not available");const pe=be.atVersion(1);if(!pe)throw new Error("AppContext v1 not available");return pe},ht=(0,p.uW)("component-data-store",()=>new WeakMap),rt="__backstage_data";function et(be,pe,Ie){const H=be;var N;let ce=(N=H[rt])!==null&&N!==void 0?N:ht.get(be);if(ce||(ce={map:new Map},Object.defineProperty(H,rt,{enumerable:!1,configurable:!0,writable:!1,value:ce}),ht.set(be,ce)),ce.map.has(pe)){const Ae=be.displayName||be.name;throw new Error(`Attempted to attach duplicate data "${pe}" to component "${Ae}"`)}ce.map.set(pe,Ie)}function vt(be,pe){if(!be)return;const Ie=be.type;if(!Ie)return;var H;const N=(H=Ie[rt])!==null&&H!==void 0?H:ht.get(Ie);if(N)return N.map.get(pe)}const ot=(0,p.uW)("route-ref-type",()=>Symbol("route-ref-type"));let Qe=ot,ft=Qe;class gt{get title(){return this.id}toString(){return`routeRef{type=absolute,id=${this.id}}`}constructor(pe,Ie){(0,z._)(this,"id",void 0),(0,z._)(this,"params",void 0),(0,z._)(this,ft,void 0),this.id=pe,this.params=Ie,this[Qe]="absolute"}}function Ct(be){var pe;return new gt(be.id,(pe=be.params)!==null&&pe!==void 0?pe:[])}const yn=/^\w+$/;let hn=null,cn=null;class Sn{toString(){return`routeRef{type=sub,id=${this.id}}`}constructor(pe,Ie,H,N){_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,cn,void 0),this.id=pe,this.path=Ie,this.parent=H,this.params=N,this[hn]="sub"}}function pn(be){const{id:pe,path:Ie,parent:H}=be,N=Ie.split("/").filter($e=>$e.startsWith(":")).map($e=>$e.substring(1)),ce=[...H.params,...N];if(H.params.some($e=>N.includes($e)))throw new Error("SubRouteRef may not have params that overlap with its parent");if(!Ie.startsWith("/"))throw new Error(`SubRouteRef path must start with '/', got '${Ie}'`);if(Ie.endsWith("/"))throw new Error(`SubRouteRef path must not end with '/', got '${Ie}'`);for(const $e of N)if(!yn.test($e))throw new Error(`SubRouteRef path has invalid param, got '${$e}'`);return new Sn(pe,Ie,H,ce)}let xn=ot,Cn=xn;class on{toString(){return`routeRef{type=external,id=${this.id}}`}constructor(pe,Ie,H){(0,z._)(this,"id",void 0),(0,z._)(this,"params",void 0),(0,z._)(this,"optional",void 0),(0,z._)(this,Cn,void 0),this.id=pe,this.params=Ie,this.optional=H,this[xn]="external"}}function fn(be){var pe;return new on(be.id,(pe=be.params)!==null&&pe!==void 0?pe:[],Boolean(be.optional))}var wn=n(73557);function _e(be){const{pathname:pe}=(0,wn.TH)(),Ie=(0,p.Vt)("routing-context");if(!Ie)throw new Error("Routing context is not available");const H=Ie.atVersion(1),N=(0,W.useMemo)(()=>H&&H.resolve(be,{pathname:pe}),[H,be,pe]);if(!Ie)throw new Error("useRouteRef used outside of routing context");if(!H)throw new Error("RoutingContext v1 not available");const ce="optional"in be&&be.optional;if(!N&&!ce)throw new Error(`No path for ${be}`);return N}function Jt(be){return(0,wn.UO)()}class Vt extends W.Component{static getDerivedStateFromError(pe){return{error:pe}}render(){const{error:pe}=this.state,{app:Ie,plugin:H}=this.props,{ErrorBoundaryFallback:N}=Ie.getComponents();return pe?(0,r.jsx)(N,{error:pe,resetError:this.handleErrorReset,plugin:H}):this.props.children}constructor(...pe){super(...pe),(0,z._)(this,"state",{error:void 0}),(0,z._)(this,"handleErrorReset",()=>{this.setState({error:void 0})})}}var Je=n(64355);function Rn(be){const{component:pe,mountPoint:Ie,name:H}=be;return Nn({component:{lazy:()=>pe().then(N=>{const ce=$e=>{const qe=Ne();try{_e(Ie)}catch(It){if(typeof It=="object"&&It!==null){const{message:Bt}=It;if(typeof Bt=="string"&&Bt.startsWith("No path for "))throw new Error(`Routable extension component with mount point ${Ie} was not discovered in the app element tree. Routable extension components may not be rendered by other components and must be directly available as an element within the App provider component.`)}throw It}return(0,W.useEffect)(()=>{qe.captureEvent(Zt,"")},[qe]),(0,r.jsx)(N,{...$e})},Ae=H||N.displayName||N.name||"LazyComponent";return ce.displayName=`RoutableExtension(${Ae})`,ce},N=>Ae=>{const $e=Ye(),{BootErrorPage:qe}=$e.getComponents();return(0,r.jsx)(qe,{step:"load-chunk",error:N})})},data:{"core.mountPoint":Ie},name:H})}function sn(be){const{component:pe,name:Ie}=be;return Nn({component:pe,name:Ie})}function Nn(be){const{data:pe={},name:Ie}=be;Ie||console.warn("Declaring extensions without name is DEPRECATED. Make sure that all usages of createReactExtension, createComponentExtension and createRoutableExtension provide a name.");let H;if("lazy"in be.component){const ce=be.component.lazy;H=(0,W.lazy)(()=>ce().then(Ae=>({default:Ae})))}else H=be.component.sync;const N=Ie||H.displayName||H.name||"Component";return{expose(ce){const Ae=$e=>{var qe;const It=Ye(),{Progress:Bt}=It.getComponents(),nn=(qe=pe)===null||qe===void 0?void 0:qe["core.mountPoint"];return(0,r.jsx)(W.Suspense,{fallback:(0,r.jsx)(Bt,{}),children:(0,r.jsx)(Vt,{app:It,plugin:ce,children:(0,r.jsx)(m,{attributes:{pluginId:ce.getId(),...Ie&&{extension:Ie},...nn&&{routeRef:nn.id}},children:(0,r.jsx)(Je.o,{plugin:ce,children:(0,r.jsx)(H,{...$e})})})})})};et(Ae,"core.plugin",ce),et(Ae,"core.extensionName",Ie);for(const[$e,qe]of Object.entries(pe))et(Ae,$e,qe);return Ae.displayName=`Extension(${N})`,Ae}}}function In(be,pe,Ie,H){return W.Children.toArray(be).flatMap(N=>{if(!(0,W.isValidElement)(N))return[];if(N.type===W.Fragment)return In(N.props.children,pe,Ie,H);if(vt(N,"core.featureFlagged")){const ce=N.props;return("with"in ce?pe.isActive(ce.with):!pe.isActive(ce.without))?In(N.props.children,pe,Ie,H):[]}if(Ie===void 0||Ie(N))return[N];if(H)throw new Error(H);return In(N.props.children,pe,Ie,H)})}class Pn{selectByComponentData(pe){const Ie=In(this.node,this.featureFlagsApi,H=>vt(H,pe.key)!==void 0,pe.withStrictError);return new Pn(Ie,this.featureFlagsApi)}findComponentData(pe){return In(this.node,this.featureFlagsApi,H=>vt(H,pe.key)!==void 0).map(H=>vt(H,pe.key)).filter(H=>H!==void 0)}getElements(){return In(this.node,this.featureFlagsApi)}constructor(pe,Ie){(0,z._)(this,"node",void 0),(0,z._)(this,"featureFlagsApi",void 0),this.node=pe,this.featureFlagsApi=Ie}}function Gn(be,pe,Ie=[]){const H=ye(Dt),N=new Pn(be,H);return(0,W.useMemo)(()=>pe(N),[be,...Ie])}class Kn{getId(){return this.config.id}getApis(){var pe;return(pe=this.config.apis)!==null&&pe!==void 0?pe:[]}getFeatureFlags(){var pe,Ie;return(Ie=(pe=this.config.featureFlags)===null||pe===void 0?void 0:pe.slice())!==null&&Ie!==void 0?Ie:[]}get routes(){var pe;return(pe=this.config.routes)!==null&&pe!==void 0?pe:{}}get externalRoutes(){var pe;return(pe=this.config.externalRoutes)!==null&&pe!==void 0?pe:{}}provide(pe){return pe.expose(this)}__experimentalReconfigure(pe){this.config.__experimentalConfigure&&(this.options=this.config.__experimentalConfigure(pe))}getPluginOptions(){this.config.__experimentalConfigure&&!this.options&&(this.options=this.config.__experimentalConfigure());var pe;return(pe=this.options)!==null&&pe!==void 0?pe:{}}toString(){return`plugin{${this.config.id}}`}constructor(pe){(0,z._)(this,"config",void 0),(0,z._)(this,"options",void 0),this.config=pe,this.options=void 0}}function Ln(be){return new Kn(be)}},64355:function(Lt,Le,n){"use strict";n.d(Le,{o:function(){return V},y:function(){return m}});var r=n(52322),p=n(51837),W=n(2784);const f="plugin-context",V=h=>{const{children:F,plugin:ye}=h,{Provider:le}=(0,p.CT)(f);return(0,r.jsx)(le,{value:(0,p.EI)({1:{plugin:ye}}),children:F})};function m(){const h=(0,p.Vt)(f);if(!h)throw new Error("Plugin Options context is not available");const F=h.atVersion(1);if(!F)throw new Error("Plugin Options v1 is not available");return F.plugin.getPluginOptions()}},23054:function(Lt,Le,n){"use strict";n.d(Le,{SP:function(){return ne},dR:function(){return de},VL:function(){return K},BD:function(){return p}});function r(R){if(typeof R!="object"||R===null||Array.isArray(R))return!1;const w=R;return!(typeof w.name!="string"||w.name===""||typeof w.message!="string")}function p(R){if(typeof R!="object"||R===null||Array.isArray(R))throw new Error(`Encountered invalid error, not an object, got '${R}'`);const w=R;if(typeof w.name!="string"||w.name==="")throw new Error(`Encountered error object without a name, got '${R}'`);if(typeof w.message!="string")throw new Error(`Encountered error object without a message, got '${R}'`)}var W=n(87612),f=n(24852);function V(R,w){var I;const xe={name:"Unknown",message:"<no reason given>",...serializeErrorInternal(R)};return!((I=w)===null||I===void 0)&&I.includeStack||delete xe.stack,xe}function m(R){const w=(0,f.deserializeError)(R);return R.stack||(w.stack=void 0),w}function h(R){if(r(R)){const w=String(R);return w!=="[object Object]"?w:`${R.name}: ${R.message}`}return`unknown error '${R}'`}class F extends Error{constructor(w,I){var U,xe;let Se=w;if(I!==void 0){const k=h(I);Se?Se+=`; caused by ${k}`:Se=`caused by ${k}`}super(Se),(0,W._)(this,"cause",void 0),(U=(xe=Error).captureStackTrace)===null||U===void 0||U.call(xe,this,this.constructor),(!this.name||this.name==="Error")&&this.constructor.name!=="Error"&&(this.name=this.constructor.name),this.cause=r(I)?I:void 0}}class ye extends null{constructor(...w){super(...w),_define_property(this,"name","InputError")}}class le extends null{constructor(...w){super(...w),_define_property(this,"name","AuthenticationError")}}class z extends null{constructor(...w){super(...w),_define_property(this,"name","NotAllowedError")}}class de extends F{constructor(...w){super(...w),(0,W._)(this,"name","NotFoundError")}}class D extends null{constructor(...w){super(...w),_define_property(this,"name","ConflictError")}}class E extends null{constructor(...w){super(...w),_define_property(this,"name","NotModifiedError")}}class se extends null{constructor(...w){super(...w),_define_property(this,"name","NotImplementedError")}}class ie extends null{}class ne extends F{constructor(w,I){super(w,I),this.name=r(I)?I.name:"Error"}}async function X(R){try{const I=await R.text();if(I){var w;if(!((w=R.headers.get("content-type"))===null||w===void 0)&&w.startsWith("application/json"))try{const U=JSON.parse(I);if(U.error&&U.response)return U}catch{}return{error:{name:"Error",message:`Request failed with status ${R.status} ${R.statusText}, ${I}`},response:{statusCode:R.status}}}}catch{}return{error:{name:"Error",message:`Request failed with status ${R.status} ${R.statusText}`},response:{statusCode:R.status}}}class K extends Error{static async fromResponse(w){const I=await X(w),U=I.response.statusCode||w.status,xe=I.error.name||w.statusText,Se=`Request failed with ${U} ${xe}`,k=m(I.error);return new K({message:Se,response:w,data:I,cause:k})}constructor(w){super(w.message),(0,W._)(this,"response",void 0),(0,W._)(this,"body",void 0),(0,W._)(this,"cause",void 0),this.name="ResponseError",this.response=w.response,this.body=w.data,this.cause=w.cause}}},32838:function(Lt,Le,n){"use strict";n.d(Le,{nW:function(){return ie},ae:function(){return z},q3:function(){return de}});var r=n(60871);const p=(0,r.T0)({id:"core.scmauth"});var W=new WeakMap;class f{async getCredentials(X){const K=new URL(X.url),R=_class_private_field_get(this,W).find(w=>w.isUrlSupported(K));if(!R)throw new Error(`No auth provider available for '${X.url}', see https://backstage.io/link?scm-auth`);return R.getCredentials(X)}constructor(X){_class_private_field_init(this,W,{writable:!0,value:void 0}),_class_private_field_set(this,W,X)}}var V=new WeakMap,m=new WeakMap,h=new WeakMap,F=new WeakMap;class ye{static createDefaultApiFactory(){return createApiFactory({api:scmAuthApiRef,deps:{github:githubAuthApiRef,gitlab:gitlabAuthApiRef,azure:microsoftAuthApiRef,bitbucket:bitbucketAuthApiRef},factory:({github:X,gitlab:K,azure:R,bitbucket:w})=>ye.merge(ye.forGithub(X),ye.forGitlab(K),ye.forAzure(R),ye.forBitbucket(w))})}static forAuthApi(X,K){return new ye("generic",X,K.host,K.scopeMapping)}static forGithub(X,K){var R,w;const I=(w=(R=K)===null||R===void 0?void 0:R.host)!==null&&w!==void 0?w:"github.com";return new ye("github",X,I,{default:["repo","read:org","read:user"],repoWrite:["gist"]})}static forGitlab(X,K){var R,w;const I=(w=(R=K)===null||R===void 0?void 0:R.host)!==null&&w!==void 0?w:"gitlab.com";return new ye("gitlab",X,I,{default:["read_user","read_api","read_repository"],repoWrite:["write_repository","api"]})}static forAzure(X,K){var R,w;const I=(w=(R=K)===null||R===void 0?void 0:R.host)!==null&&w!==void 0?w:"dev.azure.com";return new ye("azure",X,I,{default:["vso.build","vso.code","vso.graph","vso.project","vso.profile"],repoWrite:["vso.code_manage"]})}static forBitbucket(X,K){var R,w;const I=(w=(R=K)===null||R===void 0?void 0:R.host)!==null&&w!==void 0?w:"bitbucket.org";return new ye("bitbucket",X,I,{default:["account","team","pullrequest","snippet","issue"],repoWrite:["pullrequest:write","snippet:write","issue:write"]})}static merge(...X){return new f(X)}isUrlSupported(X){return X.host===_class_private_field_get(this,m)}getAdditionalScopesForProvider(X){var K,R;if(!(!((K=X)===null||K===void 0)&&K.customScopes)||_class_private_field_get(this,F)==="generic")return[];var w;return(w=(R=X.customScopes)===null||R===void 0?void 0:R[_class_private_field_get(this,F)])!==null&&w!==void 0?w:[]}async getCredentials(X){var K;const{url:R,additionalScope:w,...I}=X,U=_class_private_field_get(this,h).default.slice();!((K=w)===null||K===void 0)&&K.repoWrite&&U.push(..._class_private_field_get(this,h).repoWrite);const xe=this.getAdditionalScopesForProvider(w);xe.length&&U.push(...xe);const Se=[...new Set(U)],k=await _class_private_field_get(this,V).getAccessToken(Se,I);return{token:k,headers:{Authorization:`Bearer ${k}`}}}constructor(X,K,R,w){_class_private_field_init(this,V,{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,F,{writable:!0,value:void 0}),_class_private_field_set(this,V,K),_class_private_field_set(this,m,R),_class_private_field_set(this,h,w),_class_private_field_set(this,F,X)}}var le=n(40556);class z{static fromConfig(X){return le.Lx.fromConfig(X)}}const de=(0,r.T0)({id:"integration.scmintegrations"});var D=n(52322),E=n(73250),se=n(2784);const ie=ne=>{const{type:X}=ne,K=(0,r.qD)(),R=E.Z;var w;const I=X&&(w=K.getSystemIcon(X))!==null&&w!==void 0?w:R;return(0,D.jsx)(I,{})}},40556:function(Lt,Le,n){"use strict";n.d(Le,{Lx:function(){return Nr},BT:function(){return xt}});var r=n(87612),p=n(82717),W=n.n(p),f=n(76635);function V(C){const c=new URL("http://example.com");return c.host=C,c.host===C}function m(C){try{return new URL(C),!0}catch{return!1}}function h(C,c){return{list(){return C},byUrl(b){try{const A=typeof b=="string"?new URL(b):b;return C.find(J=>c(J)===A.host)}catch{return}},byHost(b){return C.find(A=>c(A)===b)}}}function F(C){const{url:c,base:b,lineNumber:A}=C;try{return new URL(c),c}catch{}let J;if(c.startsWith("/")){const{filepath:ve}=W()(b);J=new URL(b);const je=(0,f.trimEnd)(J.pathname.substring(0,J.pathname.length-ve.length),"/");J.pathname=`${je}${c}`}else J=new URL(c,b);return J.search=new URL(b).search,A&&(J.hash=`L${A}`),J.toString()}function ye(C){beforeAll(()=>C.listen({onUnhandledRequest:"error"})),afterAll(()=>C.close()),afterEach(()=>C.resetHandlers())}const le="amazonaws.com";function z(C){const c=C.getOptionalString("endpoint");var b;const A=(b=C.getOptionalBoolean("s3ForcePathStyle"))!==null&&b!==void 0?b:!1;let J,ve;if(c){try{const an=new URL(c);J=an.host,ve=an.pathname}catch{throw new Error(`invalid awsS3 integration config, endpoint '${c}' is not a valid URL`)}if(ve!=="/")throw new Error(`invalid awsS3 integration config, endpoints cannot contain path, got '${c}'`)}else J=le;const je=C.getOptionalString("accessKeyId"),ke=C.getOptionalString("secretAccessKey"),nt=C.getOptionalString("roleArn"),_t=C.getOptionalString("externalId");return{host:J,endpoint:c,s3ForcePathStyle:A,accessKeyId:je,secretAccessKey:ke,roleArn:nt,externalId:_t}}function de(C){const c=C.map(z);return c.some(b=>b.host===le)||c.push({host:le}),c}class D{get type(){return"awsS3"}get title(){return this.integrationConfig.host}get config(){return this.integrationConfig}resolveUrl(c){return F(c)}resolveEditUrl(c){return c}constructor(c){(0,r._)(this,"integrationConfig",void 0),this.integrationConfig=c}}(0,r._)(D,"factory",({config:C})=>{var c;const b=de((c=C.getOptionalConfigArray("integrations.awsS3"))!==null&&c!==void 0?c:[]);return h(b.map(A=>new D(A)),A=>A.config.host)});var E=n(88412),se=n(50629),ie=n(80956);const ne="GB";var X=new WeakMap,K=new WeakMap,R=new WeakMap,w=new WeakMap,I=new WeakMap,U=new WeakMap,xe=new WeakMap;class Se{static fromRepoUrl(c){const b=new URL(c);let A,J,ve;const je=b.pathname.split("/").map(En=>decodeURIComponent(En));if(je[2]==="_git"?(A=je[1],J=ve=je[3]):je[3]==="_git"?(A=je[1],J=je[2],ve=je[4]):je[4]==="_git"&&(A=`${je[1]}/${je[2]}`,J=je[3],ve=je[5]),!A||!J||!ve)throw new Error("Azure URL must point to a git repository");var ke;const nt=(ke=b.searchParams.get("path"))!==null&&ke!==void 0?ke:void 0;let _t;const an=b.searchParams.get("version");if(an){if(an.slice(0,2)!=="GB")throw new Error("Azure URL version must point to a git branch");_t=an.slice(2)}return new Se(b.origin,A,J,ve,nt,_t)}toRepoUrl(){let c;return(0,E._)(this,R)===(0,E._)(this,w)?c=(0,E._)(this,xe).call(this,(0,E._)(this,K),"_git",(0,E._)(this,w)):c=(0,E._)(this,xe).call(this,(0,E._)(this,K),(0,E._)(this,R),"_git",(0,E._)(this,w)),(0,E._)(this,I)&&c.searchParams.set("path",(0,E._)(this,I)),(0,E._)(this,U)&&c.searchParams.set("version",ne+(0,E._)(this,U)),c.toString()}toFileUrl(){if(!(0,E._)(this,I))throw new Error("Azure URL must point to a specific path to be able to download a file");const c=(0,E._)(this,xe).call(this,(0,E._)(this,K),(0,E._)(this,R),"_apis","git","repositories",(0,E._)(this,w),"items");return c.searchParams.set("api-version","6.0"),c.searchParams.set("path",(0,E._)(this,I)),(0,E._)(this,U)&&c.searchParams.set("version",(0,E._)(this,U)),c.toString()}toArchiveUrl(){const c=(0,E._)(this,xe).call(this,(0,E._)(this,K),(0,E._)(this,R),"_apis","git","repositories",(0,E._)(this,w),"items");return c.searchParams.set("recursionLevel","full"),c.searchParams.set("download","true"),c.searchParams.set("api-version","6.0"),(0,E._)(this,I)&&c.searchParams.set("scopePath",(0,E._)(this,I)),(0,E._)(this,U)&&c.searchParams.set("version",(0,E._)(this,U)),c.toString()}toCommitsUrl(){const c=(0,E._)(this,xe).call(this,(0,E._)(this,K),(0,E._)(this,R),"_apis","git","repositories",(0,E._)(this,w),"commits");return c.searchParams.set("api-version","6.0"),(0,E._)(this,U)&&c.searchParams.set("searchCriteria.itemVersion.version",(0,E._)(this,U)),c.toString()}getOwner(){return(0,E._)(this,K)}getProject(){return(0,E._)(this,R)}getRepo(){return(0,E._)(this,w)}getPath(){return(0,E._)(this,I)}getRef(){return(0,E._)(this,U)}constructor(c,b,A,J,ve,je){(0,se._)(this,X,{writable:!0,value:void 0}),(0,se._)(this,K,{writable:!0,value:void 0}),(0,se._)(this,R,{writable:!0,value:void 0}),(0,se._)(this,w,{writable:!0,value:void 0}),(0,se._)(this,I,{writable:!0,value:void 0}),(0,se._)(this,U,{writable:!0,value:void 0}),(0,se._)(this,xe,{writable:!0,value:(...ke)=>{const nt=new URL((0,E._)(this,X));return nt.pathname=ke.map(_t=>encodeURIComponent(_t)).join("/"),nt}}),(0,ie._)(this,X,c),(0,ie._)(this,K,b),(0,ie._)(this,R,A),(0,ie._)(this,w,J),(0,ie._)(this,I,ve),(0,ie._)(this,U,je)}}const k="dev.azure.com",Ke=C=>{const c=C;return Object.keys(C).length===3&&c.clientId!==void 0&&c.clientSecret!==void 0&&c.tenantId!==void 0},yt=C=>Object.keys(C).length===1&&C.clientId!==void 0;function $t(C){var c;const b=(c=C.getOptionalString("host"))!==null&&c!==void 0?c:k,A=C.getOptionalString("token"),J=C.getOptional("credential")?{tenantId:C.getOptionalString("credential.tenantId"),clientId:C.getOptionalString("credential.clientId"),clientSecret:C.getOptionalString("credential.clientSecret")}:void 0;if(!V(b))throw new Error(`Invalid Azure integration config, '${b}' is not a valid host`);if(J&&!Ke(J)&&!yt(J))throw new Error("Invalid Azure integration config, credential is not valid");if(J&&b!==k)throw new Error(`Invalid Azure integration config, credential can only be used with ${k}`);if(J&&A)throw new Error("Invalid Azure integration config, specify either a token or a credential but not both");return{host:b,token:A,credential:J}}function zt(C){const c=C.map($t);return c.some(b=>b.host===k)||c.push({host:k}),c}class Rt{get type(){return"azure"}get title(){return this.integrationConfig.host}get config(){return this.integrationConfig}resolveUrl(c){const{url:b,base:A}=c;if(m(b))return b;try{const ve=Se.fromRepoUrl(A),je=new URL(A);var J;const ke=new URL(`https://a.com${(J=ve.getPath())!==null&&J!==void 0?J:""}`),nt=new URL(b,ke).pathname;return je.searchParams.set("path",nt),c.lineNumber&&(je.searchParams.set("line",String(c.lineNumber)),je.searchParams.set("lineEnd",String(c.lineNumber+1)),je.searchParams.set("lineStartColumn","1"),je.searchParams.set("lineEndColumn","1")),je.toString()}catch{return new URL(b,A).toString()}}resolveEditUrl(c){return c}constructor(c){(0,r._)(this,"integrationConfig",void 0),this.integrationConfig=c}}(0,r._)(Rt,"factory",({config:C})=>{var c;const b=zt((c=C.getOptionalConfigArray("integrations.azure"))!==null&&c!==void 0?c:[]);return h(b.map(A=>new Rt(A)),A=>A.config.host)});var Dt=n(48834).lW;function Yt(C){return AzureUrl.fromRepoUrl(C).toFileUrl()}function ct(C){return AzureUrl.fromRepoUrl(C).toArchiveUrl()}function ut(C){return AzureUrl.fromRepoUrl(C).toCommitsUrl()}async function St(C,c){const b="499b84ac-1321-427f-aa17-267ca6975798/.default",A=c?{...c}:{},{token:J,credential:ve}=C;if(ve){if(isAzureClientSecretCredential(ve)){const ke=await new ClientSecretCredential(ve.tenantId,ve.clientId,ve.clientSecret).getToken(b);A.Authorization=`Bearer ${ke.token}`}else if(isAzureManagedIdentityCredential(ve)){const ke=await new ManagedIdentityCredential(ve.clientId).getToken(b);A.Authorization=`Bearer ${ke.token}`}}else if(J){const je=Dt.from(`:${C.token}`,"utf8");A.Authorization=`Basic ${je.toString("base64")}`}return{headers:A}}const lt="bitbucket.org",Zt="https://api.bitbucket.org/2.0";function Gt(C){var c;const b=(c=C.getOptionalString("host"))!==null&&c!==void 0?c:lt;let A=C.getOptionalString("apiBaseUrl");const J=C.getOptionalString("token"),ve=C.getOptionalString("username"),je=C.getOptionalString("appPassword");if(!V(b))throw new Error(`Invalid Bitbucket integration config, '${b}' is not a valid host`);return A?A=(0,f.trimEnd)(A,"/"):b===lt?A=Zt:A=`https://${b}/rest/api/1.0`,{host:b,apiBaseUrl:A,token:J,username:ve,appPassword:je}}function Ce(C){const c=C.map(Gt);return c.some(b=>b.host===lt)||c.push({host:lt,apiBaseUrl:Zt}),c}class Ne{get type(){return"bitbucket"}get title(){return this.integrationConfig.host}get config(){return this.integrationConfig}resolveUrl(c){const b=F(c);if(!c.lineNumber)return b;const A=new URL(b);return this.integrationConfig.host==="bitbucket.org"?A.hash=`lines-${c.lineNumber}`:A.hash=`${c.lineNumber}`,A.toString()}resolveEditUrl(c){const b=W()(c),A=new URL(c);return A.searchParams.set("mode","edit"),A.searchParams.set("spa","0"),A.searchParams.set("at",b.ref),A.toString()}constructor(c){(0,r._)(this,"integrationConfig",void 0),this.integrationConfig=c}}(0,r._)(Ne,"factory",({config:C})=>{var c,b,A;const J=Ce((A=C.getOptionalConfigArray("integrations.bitbucket"))!==null&&A!==void 0?A:[...(c=C.getOptionalConfigArray("integrations.bitbucketCloud"))!==null&&c!==void 0?c:[],...(b=C.getOptionalConfigArray("integrations.bitbucketServer"))!==null&&b!==void 0?b:[]]);return h(J.map(ve=>new Ne(ve)),ve=>ve.config.host)});var Ye=n(96279),ht=n(48834).lW;async function rt(C,c){const{name:b,owner:A,resource:J}=parseGitUrl(C),ve=J==="bitbucket.org";let je=ve?`${c.apiBaseUrl}/repositories/${A}/${b}`:`${c.apiBaseUrl}/projects/${A}/repos/${b}/default-branch`,ke=await fetch(je,ot(c));if(ke.status===404&&!ve&&(je=`${c.apiBaseUrl}/projects/${A}/repos/${b}/branches/default`,ke=await fetch(je,ot(c))),!ke.ok){const _t=`Failed to retrieve default branch from ${je}, ${ke.status} ${ke.statusText}`;throw new Error(_t)}let nt;if(ve)nt=(await ke.json()).mainbranch.name;else{const{displayId:_t}=await ke.json();nt=_t}if(!nt)throw new Error(`Failed to read default branch from ${je}. Response ${ke.status} ${ke.json()}`);return nt}async function et(C,c){const{name:b,owner:A,ref:J,protocol:ve,resource:je,filepath:ke}=parseGitUrl(C),nt=je==="bitbucket.org";let _t=J;_t||(_t=await rt(C,c));const an=ke?`&path=${encodeURIComponent(decodeURIComponent(ke))}`:"";return nt?`${ve}://${je}/${A}/${b}/get/${_t}.tar.gz`:`${c.apiBaseUrl}/projects/${A}/repos/${b}/archive?format=tgz&at=${_t}&prefix=${A}-${b}${an}`}function vt(C,c){try{const{owner:b,name:A,ref:J,filepathtype:ve,filepath:je}=parseGitUrl(C);if(!b||!A||ve!=="browse"&&ve!=="raw"&&ve!=="src")throw new Error("Invalid Bitbucket URL or file path");const ke=je.replace(/^\//,"");if(c.host==="bitbucket.org"){if(!J)throw new Error("Invalid Bitbucket URL or file path");return`${c.apiBaseUrl}/repositories/${b}/${A}/src/${J}/${ke}`}return`${c.apiBaseUrl}/projects/${b}/repos/${A}/raw/${ke}?at=${J}`}catch(b){throw new Error(`Incorrect URL: ${C}, ${b}`)}}function ot(C){const c={};if(C.token)c.Authorization=`Bearer ${C.token}`;else if(C.username&&C.appPassword){const b=ht.from(`${C.username}:${C.appPassword}`,"utf8");c.Authorization=`Basic ${b.toString("base64")}`}return{headers:c}}const Qe="bitbucket.org",ft="https://api.bitbucket.org/2.0";function gt(C){const c=Qe,b=ft,A=C.getString("username"),J=C.getString("appPassword");return{host:c,apiBaseUrl:b,username:A,appPassword:J}}function Ct(C){const c=C.map(gt);return c.length===0&&c.push({host:Qe,apiBaseUrl:ft}),c}class yn{get type(){return"bitbucketCloud"}get title(){return this.integrationConfig.host}get config(){return this.integrationConfig}resolveUrl(c){const b=F(c);if(c.lineNumber){const A=new URL(b);return A.hash=`lines-${c.lineNumber}`,A.toString()}return b}resolveEditUrl(c){const b=W()(c),A=new URL(c);return A.searchParams.set("mode","edit"),A.searchParams.set("at",b.ref),A.toString()}constructor(c){(0,r._)(this,"integrationConfig",void 0),this.integrationConfig=c}}(0,r._)(yn,"factory",({config:C})=>{var c;const b=Ct((c=C.getOptionalConfigArray("integrations.bitbucketCloud"))!==null&&c!==void 0?c:[]);return h(b.map(A=>new yn(A)),A=>A.config.host)});var hn=n(48834).lW;async function cn(C,c){const{name:b,owner:A}=parseGitUrl(C),J=`${c.apiBaseUrl}/repositories/${A}/${b}`,ve=await fetch(J,xn(c));if(!ve.ok){const nt=`Failed to retrieve default branch from ${J}, ${ve.status} ${ve.statusText}`;throw new Error(nt)}const ke=(await ve.json()).mainbranch.name;if(!ke)throw new Error(`Failed to read default branch from ${J}. Response ${ve.status} ${ve.json()}`);return ke}async function Sn(C,c){const{name:b,owner:A,ref:J,protocol:ve,resource:je}=parseGitUrl(C);let ke=J;return ke||(ke=await cn(C,c)),`${ve}://${je}/${A}/${b}/get/${ke}.tar.gz`}function pn(C,c){try{const{owner:b,name:A,ref:J,filepathtype:ve,filepath:je}=parseGitUrl(C);if(!b||!A||ve!=="src"&&ve!=="raw")throw new Error("Invalid Bitbucket Cloud URL or file path");const ke=je.replace(/^\//,"");if(!J)throw new Error("Invalid Bitbucket Cloud URL or file path");return`${c.apiBaseUrl}/repositories/${b}/${A}/src/${J}/${ke}`}catch(b){throw new Error(`Incorrect URL: ${C}, ${b}`)}}function xn(C){const c={};if(C.username&&C.appPassword){const b=hn.from(`${C.username}:${C.appPassword}`,"utf8");c.Authorization=`Basic ${b.toString("base64")}`}return{headers:c}}function Cn(C){const c=C.getString("host");let b=C.getOptionalString("apiBaseUrl");const A=C.getOptionalString("token"),J=C.getOptionalString("username"),ve=C.getOptionalString("password");if(!V(c))throw new Error(`Invalid Bitbucket Server integration config, '${c}' is not a valid host`);return b?b=(0,f.trimEnd)(b,"/"):b=`https://${c}/rest/api/1.0`,{host:c,apiBaseUrl:b,token:A,username:J,password:ve}}function on(C){return C.map(Cn)}class fn{get type(){return"bitbucketServer"}get title(){return this.integrationConfig.host}get config(){return this.integrationConfig}resolveUrl(c){const b=F(c);if(c.lineNumber){const A=new URL(b);return A.hash=c.lineNumber.toString(),A.toString()}return b}resolveEditUrl(c){return c.includes("?")?c.substring(0,c.indexOf("?")):c}constructor(c){(0,r._)(this,"integrationConfig",void 0),this.integrationConfig=c}}(0,r._)(fn,"factory",({config:C})=>{var c;const b=on((c=C.getOptionalConfigArray("integrations.bitbucketServer"))!==null&&c!==void 0?c:[]);return h(b.map(A=>new fn(A)),A=>A.config.host)});var wn=n(48834).lW;async function _e(C,c){const{name:b,owner:A}=parseGitUrl(C);let J=`${c.apiBaseUrl}/projects/${A}/repos/${b}/default-branch`,ve=await fetch(J,Je(c));if(ve.status===404&&(J=`${c.apiBaseUrl}/projects/${A}/repos/${b}/branches/default`,ve=await fetch(J,Je(c))),!ve.ok){const nt=`Failed to retrieve default branch from ${J}, ${ve.status} ${ve.statusText}`;throw new Error(nt)}const{displayId:je}=await ve.json(),ke=je;if(!ke)throw new Error(`Failed to read default branch from ${J}. Response ${ve.status} ${ve.json()}`);return ke}async function Jt(C,c){const{name:b,owner:A,ref:J,filepath:ve}=parseGitUrl(C);let je=J;je||(je=await _e(C,c));const ke=ve?`&path=${encodeURIComponent(decodeURIComponent(ve))}`:"";return`${c.apiBaseUrl}/projects/${A}/repos/${b}/archive?format=tgz&at=${je}&prefix=${A}-${b}${ke}`}function Vt(C,c){try{const{owner:b,name:A,ref:J,filepathtype:ve,filepath:je}=parseGitUrl(C);if(!b||!A||ve!=="browse"&&ve!=="raw"&&ve!=="src")throw new Error("Invalid Bitbucket Server URL or file path");const ke=je.replace(/^\//,"");return`${c.apiBaseUrl}/projects/${b}/repos/${A}/raw/${ke}?at=${J}`}catch(b){throw new Error(`Incorrect URL: ${C}, ${b}`)}}function Je(C){const c={};if(C.token)c.Authorization=`Bearer ${C.token}`;else if(C.username&&C.password){const b=wn.from(`${C.username}:${C.password}`,"utf8");c.Authorization=`Basic ${b.toString("base64")}`}return{headers:c}}function Rn(C){const c=C.getString("host");let b=C.getOptionalString("baseUrl"),A=C.getOptionalString("cloneUrl"),J=C.getOptionalString("gitilesBaseUrl");const ve=C.getOptionalString("username"),je=C.getOptionalString("password");if(V(c)){if(b&&!m(b))throw new Error(`Invalid Gerrit integration config, '${b}' is not a valid baseUrl`);if(A&&!m(A))throw new Error(`Invalid Gerrit integration config, '${A}' is not a valid cloneUrl`);if(J&&!m(J))throw new Error(`Invalid Gerrit integration config, '${J}' is not a valid gitilesBaseUrl`)}else throw new Error(`Invalid Gerrit integration config, '${c}' is not a valid host`);return b?b=(0,f.trimEnd)(b,"/"):b=`https://${c}`,J?J=(0,f.trimEnd)(J,"/"):J=`https://${c}`,A?A=(0,f.trimEnd)(A,"/"):A=b,{host:c,baseUrl:b,cloneUrl:A,gitilesBaseUrl:J,username:ve,password:je}}function sn(C){return C.map(Rn)}var Nn=n(48834).lW;const In=")]}'";function Pn(C,c){const b=new URL(C.gitilesBaseUrl),A=new URL(c),ve=A.pathname.substring(A.pathname.startsWith("/a/")?2:0).replace(b.pathname,"").split("/").filter(En=>!!En),je=ve.indexOf("+");if(je<=0)throw new Error(`Unable to parse project from url: ${c}`);const ke=(0,f.trimStart)(ve.slice(0,je).join("/"),"/"),nt=ve.indexOf("heads");if(nt<=0)throw new Error(`Unable to parse branch from url: ${c}`);const _t=ve[nt+1],an=ve.slice(nt+2).join("/");return{branch:_t,filePath:an===""?"/":an,project:ke}}function Gn(C,c,b,A){return`${C.gitilesBaseUrl}/${c}/+/refs/heads/${b}/${(0,f.trimStart)(A,"/")}`}function Kn(C,c,b,A){const J=A==="/"||A===""?".tar.gz":`/${A}.tar.gz`;return`${be(C)}/${c}/+archive/refs/heads/${b}${J}`}function Ln(C){return C.password?"/a/":"/"}function be(C){if(!C.baseUrl||!C.gitilesBaseUrl)throw new Error("Unexpected Gerrit config values. baseUrl or gitilesBaseUrl not set.");if(C.gitilesBaseUrl.startsWith(C.baseUrl))return C.gitilesBaseUrl.replace(C.baseUrl.concat("/"),C.baseUrl.concat(Ln(C)));if(C.password)throw new Error("Since the baseUrl (Gerrit) is not part of the gitilesBaseUrl, an authentication URL could not be constructed.");return C.gitilesBaseUrl}function pe(C,c){const{branch:b,project:A}=Pn(C,c);return`${C.baseUrl}${Ln(C)}projects/${encodeURIComponent(A)}/branches/${b}`}function Ie(C,c){const{project:b}=Pn(C,c);return`${C.cloneUrl}${Ln(C)}${b}`}function H(C,c){const{branch:b,filePath:A,project:J}=Pn(C,c);return`${C.baseUrl}${Ln(C)}projects/${encodeURIComponent(J)}/branches/${b}/files/${encodeURIComponent(A)}/content`}function N(C){return`${C.baseUrl}${Ln(C)}projects/`}function ce(C){const c={};if(!C.password)return c;const b=Nn.from(`${C.username}:${C.password}`,"utf8");return c.Authorization=`Basic ${b.toString("base64")}`,{headers:c}}async function Ae(C){const c=await C.text();if(c.startsWith(In))try{return JSON.parse(c.slice(In.length))}catch(b){throw new Error(`Invalid response from Gerrit: ${c.slice(0,10)} - ${b}`)}throw new Error(`Gerrit JSON body prefix missing. Found: ${c.slice(0,10)}`)}class $e{get type(){return"gerrit"}get title(){return this.integrationConfig.host}get config(){return this.integrationConfig}resolveUrl(c){const{url:b,base:A,lineNumber:J}=c;let ve;if(b.startsWith("/")){const{branch:je,project:ke}=Pn(this.config,A);return Gn(this.config,ke,je,b)}return b?ve=new URL(b,A):ve=new URL(A),J&&(ve.hash=J.toString()),ve.toString()}resolveEditUrl(c){return c}constructor(c){(0,r._)(this,"integrationConfig",void 0),this.integrationConfig=c}}(0,r._)($e,"factory",({config:C})=>{var c;const b=sn((c=C.getOptionalConfigArray("integrations.gerrit"))!==null&&c!==void 0?c:[]);return h(b.map(A=>new $e(A)),A=>A.config.host)});function qe(C){const c=C.getString("host");let b=C.getOptionalString("baseUrl");const A=C.getOptionalString("username"),J=C.getOptionalString("password");if(!V(c))throw new Error(`Invalid Gitea integration config, '${c}' is not a valid host`);return b?b=(0,f.trimEnd)(b,"/"):b=`https://${c}`,{host:c,baseUrl:b,username:A,password:J}}var It=n(48834).lW;function Bt(C,c){try{var b;const A=(b=C.baseUrl)!==null&&b!==void 0?b:`https://${C.host}`,[J,ve,je,ke,nt,_t,...an]=c.replace(A,"").split("/"),En=an.join("/").replace(/^\//,"");return`${A}/${ve}/${je}/_edit/${_t}/${En}`}catch(A){throw new Error(`Incorrect URL: ${c}, ${A}`)}}function nn(C,c){try{var b;const A=(b=C.baseUrl)!==null&&b!==void 0?b:`https://${C.host}`,[J,ve,je,ke,nt,_t,...an]=c.replace(A,"").split("/"),En=an.join("/").replace(/^\//,"");return`${A}/api/v1/repos/${ve}/${je}/contents/${En}?ref=${_t}`}catch(A){throw new Error(`Incorrect URL: ${c}, ${A}`)}}function ln(C){const c={},{username:b,password:A}=C;return A?(b?c.Authorization=`basic ${It.from(`${b}:${A}`).toString("base64")}`:c.Authorization=`token ${A}`,{headers:c}):c}class rn{get type(){return"gitea"}get title(){return this.config.host}resolveUrl(c){return F(c)}resolveEditUrl(c){return Bt(this.config,c)}constructor(c){(0,r._)(this,"config",void 0),this.config=c}}(0,r._)(rn,"factory",({config:C})=>{var c;const A=((c=C.getOptionalConfigArray("integrations.gitea"))!==null&&c!==void 0?c:[]).map(J=>qe(J));return h(A.map(J=>new rn(J)),J=>J.config.host)});const ee="github.com",te="https://api.github.com",G="https://raw.githubusercontent.com";function v(C){var c,b;const A=(b=C.getOptionalString("host"))!==null&&b!==void 0?b:ee;let J=C.getOptionalString("apiBaseUrl"),ve=C.getOptionalString("rawBaseUrl");const je=C.getOptionalString("token"),ke=(c=C.getOptionalConfigArray("apps"))===null||c===void 0?void 0:c.map(nt=>({appId:nt.getNumber("appId"),clientId:nt.getString("clientId"),clientSecret:nt.getString("clientSecret"),webhookSecret:nt.getString("webhookSecret"),privateKey:nt.getString("privateKey"),allowedInstallationOwners:nt.getOptionalStringArray("allowedInstallationOwners")}));if(!V(A))throw new Error(`Invalid GitHub integration config, '${A}' is not a valid host`);return J?J=(0,f.trimEnd)(J,"/"):A===ee&&(J=te),ve?ve=(0,f.trimEnd)(ve,"/"):A===ee&&(ve=G),{host:A,apiBaseUrl:J,rawBaseUrl:ve,token:je,apps:ke}}function O(C){const c=C.map(v);return c.some(b=>b.host===ee)||c.push({host:ee,apiBaseUrl:te,rawBaseUrl:G}),c}function M(C,c,b){try{const{owner:A,name:J,ref:ve,filepathtype:je,filepath:ke}=parseGitUrl(C);if(!A||!J||!ve||je!=="blob"&&je!=="raw"&&je!=="tree")throw new Error("Invalid GitHub URL or file path");const nt=ke.replace(/^\//,"");return he(c,b)==="api"?`${c.apiBaseUrl}/repos/${A}/${J}/contents/${nt}?ref=${ve}`:`${c.rawBaseUrl}/${A}/${J}/${ve}/${nt}`}catch(A){throw new Error(`Incorrect URL: ${C}, ${A}`)}}function Y(C,c){const b={};return he(C,c)==="api"&&(b.Accept="application/vnd.github.v3.raw"),c.token&&(b.Authorization=`token ${c.token}`),{headers:b}}function he(C,c){return C.apiBaseUrl&&(c.token||!C.rawBaseUrl)?"api":"raw"}var we=n(35355),Oe=n(89393),Xe=n(26228);class tt{async getOrCreateToken(c,b,A){let J=this.tokenCache.get(c);if((!J||this.isExpired(J.expiresAt))&&(J=await A(),J.expiresAt=J.expiresAt.minus({minutes:10}),this.tokenCache.set(c,J)),!this.appliesToRepo(J,b))throw new Error(`The Backstage GitHub application used in the ${c} organization does not have access to a repository with the name ${b}`);return{accessToken:J.token}}appliesToRepo(c,b){return b===void 0?!0:c.repositories!==void 0?c.repositories.includes(b):!0}constructor(){(0,r._)(this,"tokenCache",new Map),(0,r._)(this,"isExpired",c=>Xe.ou.local()>c)}}const mt={Accept:"application/vnd.github.machine-man-preview+json"};class wt{async getInstallationCredentials(c,b){if(this.allowedInstallationOwners){var A;if(!(!((A=this.allowedInstallationOwners)===null||A===void 0)&&A.includes(c)))return{accessToken:void 0}}return this.cache.getOrCreateToken(c,b,async()=>{const{installationId:J,suspended:ve}=await this.getInstallationData(c);if(ve)throw new Error(`The GitHub application for ${c} is suspended`);const je=await this.appClient.apps.createInstallationAccessToken({installation_id:J,headers:mt});let ke;if(je.data.repository_selection==="selected"){const _t=new Oe.v({baseUrl:this.baseUrl,auth:je.data.token}),an=await _t.paginate(_t.apps.listReposAccessibleToInstallation);var nt;ke=((nt=an.repositories)!==null&&nt!==void 0?nt:an).map(gn=>gn.name)}return{token:je.data.token,expiresAt:Xe.ou.fromISO(je.data.expires_at),repositories:ke}})}getInstallations(){return this.appClient.paginate(this.appClient.apps.listInstallations)}async getInstallationData(c){const A=(await this.getInstallations()).find(ve=>{var je;return ve.account&&"login"in ve.account&&((je=ve.account.login)===null||je===void 0?void 0:je.toLocaleLowerCase("en-US"))===c.toLocaleLowerCase("en-US")});if(A)return{installationId:A.id,suspended:Boolean(A.suspended_by)};const J=new Error(`No app installation found for ${c} in ${this.baseAuthConfig.appId}`);throw J.name="NotFoundError",J}constructor(c,b){(0,r._)(this,"appClient",void 0),(0,r._)(this,"baseUrl",void 0),(0,r._)(this,"baseAuthConfig",void 0),(0,r._)(this,"cache",new tt),(0,r._)(this,"allowedInstallationOwners",void 0),this.allowedInstallationOwners=c.allowedInstallationOwners,this.baseUrl=b,this.baseAuthConfig={appId:c.appId,privateKey:c.privateKey.replace(/\\n/gm,`
|
|
33
|
-
`)},this.appClient=new Oe.v({baseUrl:b,headers:mt,authStrategy:we.i,auth:this.baseAuthConfig})}}class dt{async getAllInstallations(){return this.apps.length?(await Promise.all(this.apps.map(b=>b.getInstallations()))).flat():[]}async getAppToken(c,b){if(this.apps.length===0)return;const A=await Promise.all(this.apps.map(ke=>ke.getInstallationCredentials(c,b).then(nt=>({credentials:nt,error:void 0}),nt=>({credentials:void 0,error:nt})))),J=A.find(ke=>{var nt;return(nt=ke.credentials)===null||nt===void 0?void 0:nt.accessToken});if(J)return J.credentials.accessToken;const je=A.map(ke=>ke.error).find(ke=>{var nt;return((nt=ke)===null||nt===void 0?void 0:nt.name)!=="NotFoundError"});if(je)throw je}constructor(c){var b;(0,r._)(this,"apps",void 0);var A;this.apps=(A=(b=c.apps)===null||b===void 0?void 0:b.map(J=>new wt(J,c.apiBaseUrl)))!==null&&A!==void 0?A:[]}}class Be{async getCredentials(c){const b=W()(c.url),A=b.owner||b.name,J=b.owner?b.name:void 0;let ve="app",je=await this.githubAppCredentialsMux.getAppToken(A,J);return je||(ve="token",je=this.token),{headers:je?{Authorization:`Bearer ${je}`}:void 0,token:je,type:ve}}constructor(c,b){(0,r._)(this,"githubAppCredentialsMux",void 0),(0,r._)(this,"token",void 0),this.githubAppCredentialsMux=c,this.token=b}}(0,r._)(Be,"create",C=>new Be(new dt(C),C.token));class At{static fromIntegrations(c){const b=new Map;return c.github.list().forEach(A=>{const J=SingleInstanceGithubCredentialsProvider.create(A.config);b.set(A.config.host,J)}),new At(b)}async getCredentials(c){const b=new URL(c.url),A=this.providers.get(b.host);if(!A)throw new Error(`There is no GitHub integration that matches ${c.url}. Please add a configuration for an integration.`);return A.getCredentials(c)}constructor(c){_define_property(this,"providers",void 0),this.providers=c}}class Ut{get type(){return"github"}get title(){return this.integrationConfig.host}get config(){return this.integrationConfig}resolveUrl(c){return xt(F(c),"tree")}resolveEditUrl(c){return xt(c,"edit")}constructor(c){(0,r._)(this,"integrationConfig",void 0),this.integrationConfig=c}}(0,r._)(Ut,"factory",({config:C})=>{var c;const b=O((c=C.getOptionalConfigArray("integrations.github"))!==null&&c!==void 0?c:[]);return h(b.map(A=>new Ut(A)),A=>A.config.host)});function xt(C,c){return C.replace(/\/\/([^/]+)\/([^/]+)\/([^/]+)\/(blob|tree|edit)\//,(b,A,J,ve)=>`//${A}/${J}/${ve}/${c}/`)}const Nt=null;class Qt extends Ut{get config(){return super.config}constructor(c){super(c)}}(0,r._)(Qt,"factory",Ut.factory);const jn=null,Ft=null,bt=null,jt="gitlab.com",Mt="https://gitlab.com/api/v4";function Xt(C){const c=C.getString("host");let b=C.getOptionalString("apiBaseUrl");const A=C.getOptionalString("token");let J=C.getOptionalString("baseUrl");if(b?b=(0,f.trimEnd)(b,"/"):c===jt&&(b=Mt),J?J=(0,f.trimEnd)(J,"/"):J=`https://${c}`,V(c)){if(!b||!m(b))throw new Error(`Invalid GitLab integration config, '${b}' is not a valid apiBaseUrl`);if(!m(J))throw new Error(`Invalid GitLab integration config, '${J}' is not a valid baseUrl`)}else throw new Error(`Invalid GitLab integration config, '${c}' is not a valid host`);return{host:c,token:A,apiBaseUrl:b,baseUrl:J}}function lr(C){const c=C.map(Xt);return c.some(b=>b.host===jt)||c.push({host:jt,apiBaseUrl:Mt,baseUrl:`https://${jt}`}),c}function Cr(C){let c="";return C.host!==jt&&(c=new URL(C.baseUrl).pathname),trimEnd(c,"/")}async function rr(C,c){const b=await fr(C,c);return _n(C,b,c).toString()}function bn(C){const{token:c=""}=C;return{headers:{"PRIVATE-TOKEN":c}}}function _n(C,c,b){try{const A=new URL(C),J=A.pathname.split("/blob/").slice(1).join("/blob/"),[ve,...je]=J.split("/"),ke=getGitLabIntegrationRelativePath(b);return A.pathname=[...ke?[ke]:[],"api/v4/projects",c,"repository/files",encodeURIComponent(decodeURIComponent(je.join("/"))),"raw"].join("/"),A.search=`?ref=${ve}`,A}catch(A){throw new Error(`Incorrect url: ${C}, ${A}`)}}async function fr(C,c){const b=new URL(C);if(!b.pathname.includes("/blob/"))throw new Error("Please provide full path to yaml file from GitLab");try{let A=b.pathname.split("/-/blob/")[0].split("/blob/")[0];const J=getGitLabIntegrationRelativePath(c);J&&(A=A.replace(J,""));const ve=new URL(`${b.origin}${J}/api/v4/projects/${encodeURIComponent(A.replace(/^\//,""))}`),je=await fetch(ve.toString(),bn(c)),ke=await je.json();if(!je.ok)throw new Error(`GitLab Error '${ke.error}', ${ke.error_description}`);return Number(ke.id)}catch(A){throw new Error(`Could not get GitLab project ID for: ${C}, ${A}`)}}class wr{get type(){return"gitlab"}get title(){return this.integrationConfig.host}get config(){return this.integrationConfig}resolveUrl(c){return F(c)}resolveEditUrl(c){return Yn(c,"edit")}constructor(c){(0,r._)(this,"integrationConfig",void 0),this.integrationConfig=c}}(0,r._)(wr,"factory",({config:C})=>{var c;const b=lr((c=C.getOptionalConfigArray("integrations.gitlab"))!==null&&c!==void 0?c:[]);return h(b.map(A=>new wr(A)),A=>A.config.host)});function Yn(C,c){return C.replace(/\/\-\/(blob|tree|edit)\//,`/-/${c}/`)}class zr{async getCredentials(c){return this.token?{headers:{Authorization:`Bearer ${this.token}`},token:this.token}:{}}constructor(c){(0,r._)(this,"token",void 0),this.token=c}}(0,r._)(zr,"create",C=>new zr(C.token));class jr{static fromIntegrations(c){const b=new Map;return c.gitlab.list().forEach(A=>{const J=SingleInstanceGitlabCredentialsProvider.create(A.config);b.set(A.config.host,J)}),new jr(b)}async getCredentials(c){const b=new URL(c.url),A=this.providers.get(b.host);if(!A)throw new Error(`There is no GitLab integration that matches ${c.url}. Please add a configuration for an integration.`);return A.getCredentials(c)}constructor(c){_define_property(this,"providers",void 0),this.providers=c}}class Nr{static fromConfig(c){return new Nr({awsS3:D.factory({config:c}),azure:Rt.factory({config:c}),bitbucket:Ne.factory({config:c}),bitbucketCloud:yn.factory({config:c}),bitbucketServer:fn.factory({config:c}),gerrit:$e.factory({config:c}),github:Ut.factory({config:c}),gitlab:wr.factory({config:c}),gitea:rn.factory({config:c})})}get awsS3(){return this.byType.awsS3}get azure(){return this.byType.azure}get bitbucket(){return this.byType.bitbucket}get bitbucketCloud(){return this.byType.bitbucketCloud}get bitbucketServer(){return this.byType.bitbucketServer}get gerrit(){return this.byType.gerrit}get github(){return this.byType.github}get gitlab(){return this.byType.gitlab}get gitea(){return this.byType.gitea}list(){return Object.values(this.byType).flatMap(c=>c.list())}byUrl(c){let b=Object.values(this.byType).map(A=>A.byUrl(c)).filter(Boolean);if(b.length>1){const A=b.filter(J=>!(J instanceof Ne));A.length!==0&&(b=A)}return b[0]}byHost(c){return Object.values(this.byType).map(b=>b.byHost(c)).find(Boolean)}resolveUrl(c){const b=this.byUrl(c.base);return b?b.resolveUrl(c):F(c)}resolveEditUrl(c){const b=this.byUrl(c);return b?b.resolveEditUrl(c):c}constructor(c){(0,r._)(this,"byType",void 0),this.byType=c}}},48514:function(Lt,Le,n){"use strict";var r={};n.r(r),n.d(r,{TechDocsPlugin:function(){return w.s4}});var p=n(52322),W=n(2784),f=n(28316),V=n(73557),m=n(60871);const h=(0,m.T0)({id:"plugin.techdocs.storageservice"}),F=(0,m.T0)({id:"plugin.techdocs.service"});var ye=n(92077),le=n(95481),z=n(7476),de=n(93225),D=n(86317),E=n(65124),se=n(22478),ie=n(85478),ne=n(68435),X=n(3482),K=n(42081),R=n(48431),w=n(89258),I=n(52943),U=n(61886),xe=n(13980),Se=n.n(xe),k=n(87612);class Ke{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 yt=n(51837);const $t=(0,yt.CT)("api-context"),zt=i=>{var t;const{apis:o,children:a}=i,d=(t=(0,W.useContext)($t))===null||t===void 0?void 0:t.atVersion(1),S=d?new Ke(o,d):o;return(0,p.jsx)($t.Provider,{value:(0,yt.EI)({1:S}),children:a})};zt.propTypes={apis:Se().shape({get:Se().func.isRequired}).isRequired,children:Se().node};class Rt{static validateFactories(t,o){for(const a of o){const d=[a],S=new Set;for(;d.length;){const B=d.shift(),Z=t.get(B);if(Z)for(const oe of Object.values(Z.deps)){if(oe.id===a.id)throw new Error(`Circular dependency of api factory for ${a}`);S.has(oe)||(S.add(oe),d.push(oe))}}}}get(t){return this.load(t)}load(t,o=[]){const a=this.apis.get(t.id);if(a)return a;const d=this.factories.get(t);if(!d)return;if(o.includes(d.api))throw new Error(`Circular dependency of api factory for ${d.api}`);const S=this.loadDeps(t,d.deps,[...o,d.api]),B=d.factory(S);return this.apis.set(t.id,B),B}loadDeps(t,o,a){const d={};for(const S in o)if(o.hasOwnProperty(S)){const B=o[S],Z=this.load(B,a);if(!Z)throw new Error(`No API factory available for dependency ${B} of dependent ${t}`);d[S]=Z}return d}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 Yt{register(t,o){const a=Dt[t],d=this.factories.get(o.api.id);return d&&d.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 ct(i){return new Promise((t,o)=>{const a=i.width||500,d=i.height||700,S=window.screen.width/2-a/2,B=window.screen.height/2-d/2,Z=window.open(i.url,i.name,`menubar=no,location=no,resizable=no,scrollbars=no,status=no,width=${a},height=${d},top=${B},left=${S}`);let oe="";if(!Z||typeof Z.closed=="undefined"||Z.closed){const Ze=new Error("Failed to open auth popup.");Ze.name="PopupRejectedError",o(Ze);return}const me=Ze=>{if(Ze.source!==Z||Ze.origin!==i.origin)return;const{data:Ge}=Ze;if(Ge.type==="config_info"){oe=Ge.targetOrigin;return}if(Ge.type!=="authorization_response")return;const st=Ge;if("error"in st){const qt=new Error(st.error.message);qt.name=st.error.name,o(qt)}else t(st.response);Te()},Me=setInterval(()=>{if(Z.closed){const Ze=`Login failed, ${oe&&oe!==window.location.origin?`Incorrect app origin, expected ${oe}`:"popup was closed"}`,Ge=new Error(Ze);Ge.name="PopupClosedError",o(Ge),Te()}},100);function Te(){window.removeEventListener("message",me),clearInterval(Me)}window.addEventListener("message",me)})}let ut=!1;function St(i){return[...i].join(" ")}class lt{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(d=>{throw new Error(`Auth refresh request failed, ${d}`)});if(!o.ok){const d=new Error(`Auth refresh request failed, ${o.statusText}`);throw d.status=o.status,d}const a=await o.json();if(a.error){const d=new Error(a.error.message);throw a.error.name&&(d.name=a.error.name),d}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,d,S,B,Z,oe,me;const Me=this.joinScopesFunc(t),Te=await this.buildUrl("/start",{scope:Me,origin:window.location.origin,flow:"popup"}),Ze=!((a=this.popupOptions)===null||a===void 0||(o=a.size)===null||o===void 0)&&o.fullscreen?window.screen.width:((S=this.popupOptions)===null||S===void 0||(d=S.size)===null||d===void 0?void 0:d.width)||450,Ge=!((Z=this.popupOptions)===null||Z===void 0||(B=Z.size)===null||B===void 0)&&B.fullscreen?window.screen.height:((me=this.popupOptions)===null||me===void 0||(oe=me.size)===null||oe===void 0?void 0:oe.height)||730,st=await ct({url:Te,name:`${this.provider.title} Login`,origin:new URL(Te).origin,width:Ze,height:Ge});return await this.sessionTransform(st)}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"),d=this.buildQueryString({...o,env:this.environment});return`${a}/${this.provider.id}${t}${d}`}buildQueryString(t){if(!t)return"";const o=Object.entries(t).map(([a,d])=>{if(typeof d=="string")return`${encodeURIComponent(a)}=${encodeURIComponent(d)}`;if(d)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:d,provider:S,joinScopes:B=St,oauthRequestApi:Z,sessionTransform:oe=Te=>Te,popupOptions:me}=t;!ut&&!o&&(console.warn("DEPRECATION WARNING: Authentication providers require a configApi instance to configure the authentication flow. Please provide one to the authentication provider constructor."),ut=!0);var Me;this.enableExperimentalRedirectFlow=o&&(Me=o.getOptionalBoolean("enableExperimentalRedirectFlow"))!==null&&Me!==void 0?Me:!1,this.authRequester=Z.createAuthRequester({provider:S,onAuthRequest:async Te=>this.enableExperimentalRedirectFlow?this.executeRedirect(Te):this.showPopup(Te)}),this.discoveryApi=a,this.environment=d,this.provider=S,this.joinScopesFunc=B,this.sessionTransform=oe,this.popupOptions=me}}function Zt(i,t){for(const o of t)if(!i.has(o))return!1;return!0}class Gt{sessionExistsAndHasScope(t,o){if(!t)return!1;if(!o||this.options.sessionScopes===void 0)return!0;const a=this.options.sessionScopes(t);return Zt(a,o)}getExtendedScope(t,o){const a=new Set(this.options.defaultScopes);if(t&&this.options.sessionScopes!==void 0){const d=this.options.sessionScopes(t);for(const S of d)a.add(S)}if(o)for(const d of o)a.add(d);return a}constructor(t){(0,k._)(this,"options",void 0),this.options=t}}var Ce=n(82394),Ne=n.n(Ce);let Ye=Symbol.observable;class ht{[Ye](){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 d=typeof t=="function"?{next:t,error:o,complete:a}:t;return this.observable.subscribe(d)}constructor(){(0,k._)(this,"isClosed",!1),(0,k._)(this,"terminatingError",void 0),(0,k._)(this,"observable",new(Ne())(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 rt=Symbol.observable;class et{[rt](){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 d=typeof t=="function"?{next:t,error:o,complete:a}:t;return this.observable.subscribe(d)}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(Ne())(o=>this.isClosed?(this.terminatingError?o.error(this.terminatingError):o.complete(),()=>{}):(o.next(this.currentValue),this.subscribers.add(o),()=>{this.subscribers.delete(o)}))}}class vt{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 et(m.sM.SignedOut)),(0,k._)(this,"signedIn",!1)}}class ot{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),d=this.sessionScopesFunc(this.currentSession),S=this.sessionScopesFunc(a);return Zt(S,d)&&(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 vt),(0,k._)(this,"refreshPromise",void 0),(0,k._)(this,"currentSession",void 0);const{connector:o,defaultScopes:a=new Set,sessionScopes:d,sessionShouldRefresh:S}=t;this.connector=o,this.sessionScopesFunc=d,this.sessionShouldRefreshFunc=S,this.helper=new Gt({sessionScopes:d,defaultScopes:a})}}class Qe{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:d}=t;this.connector=o,this.helper=new SessionScopeHelper({sessionScopes:d,defaultScopes:a})}}const ft={id:"oauth2",title:"Your Identity Provider",icon:()=>null};class gt{static create(t){const{configApi:o,discoveryApi:a,environment:d="development",provider:S=ft,oauthRequestApi:B,defaultScopes:Z=[],scopeTransform:oe=Ze=>Ze,popupOptions:me}=t,Me=new lt({configApi:o,discoveryApi:a,environment:d,provider:S,oauthRequestApi:B,sessionTransform(Ze){return{...Ze,providerInfo:{idToken:Ze.providerInfo.idToken,accessToken:Ze.providerInfo.accessToken,scopes:gt.normalizeScopes(oe,Ze.providerInfo.scope),expiresAt:new Date(Date.now()+Ze.providerInfo.expiresInSeconds*1e3)}}},popupOptions:me}),Te=new ot({connector:Me,defaultScopes:new Set(Z),sessionScopes:Ze=>Ze.providerInfo.scopes,sessionShouldRefresh:Ze=>(Ze.providerInfo.expiresAt.getTime()-Date.now())/1e3<60*5});return new gt({sessionManager:Te,scopeTransform:oe})}async signIn(){await this.getAccessToken()}async signOut(){await this.sessionManager.removeSession()}sessionState$(){return this.sessionManager.sessionState$()}async getAccessToken(t,o){var a;const d=gt.normalizeScopes(this.scopeTransform,t),S=await this.sessionManager.getSession({...o,scopes:d});var B;return(B=(a=S)===null||a===void 0?void 0:a.providerInfo.accessToken)!==null&&B!==void 0?B:""}async getIdToken(t={}){var o;const a=await this.sessionManager.getSession({...t,scopes:new Set(["openid"])});var d;return(d=(o=a)===null||o===void 0?void 0:o.providerInfo.idToken)!==null&&d!==void 0?d:""}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 Ct={id:"github",title:"GitHub",icon:()=>null};class yn{static create(t){const{configApi:o,discoveryApi:a,environment:d="development",provider:S=Ct,oauthRequestApi:B,defaultScopes:Z=["read:user"]}=t;return gt.create({configApi:o,discoveryApi:a,oauthRequestApi:B,provider:S,environment:d,defaultScopes:Z})}}const hn={id:"gitlab",title:"GitLab",icon:()=>null};class cn{static create(t){const{configApi:o,discoveryApi:a,environment:d="development",provider:S=hn,oauthRequestApi:B,defaultScopes:Z=["read_user"]}=t;return gt.create({configApi:o,discoveryApi:a,oauthRequestApi:B,provider:S,environment:d,defaultScopes:Z})}}const Sn={id:"google",title:"Google",icon:()=>null},pn="https://www.googleapis.com/auth/";class xn{static create(t){const{configApi:o,discoveryApi:a,oauthRequestApi:d,environment:S="development",provider:B=Sn,defaultScopes:Z=["openid",`${pn}userinfo.email`,`${pn}userinfo.profile`]}=t;return gt.create({configApi:o,discoveryApi:a,oauthRequestApi:d,provider:B,environment:S,defaultScopes:Z,scopeTransform(oe){return oe.map(me=>me==="openid"?me:me==="profile"||me==="email"?`${pn}userinfo.${me}`:me.startsWith(pn)?me:`${pn}${me}`)}})}}const Cn={id:"okta",title:"Okta",icon:()=>null},on=new Set(["openid","profile","email","phone","address","groups","offline_access"]),fn="okta.";class wn{static create(t){const{configApi:o,discoveryApi:a,environment:d="development",provider:S=Cn,oauthRequestApi:B,defaultScopes:Z=["openid","email","profile","offline_access"]}=t;return gt.create({configApi:o,discoveryApi:a,oauthRequestApi:B,provider:S,environment:d,defaultScopes:Z,scopeTransform(oe){return oe.map(me=>on.has(me)||me.startsWith(fn)?me:`${fn}${me}`)}})}}var _e=n(30195);const Jt=_e.z.object({profile:_e.z.object({email:_e.z.string().optional(),displayName:_e.z.string().optional(),picture:_e.z.string().optional()}),backstageIdentity:_e.z.object({token:_e.z.string(),identity:_e.z.object({type:_e.z.literal("user"),userEntityRef:_e.z.string(),ownershipEntityRefs:_e.z.array(_e.z.string())})})}),Vt={id:"saml",title:"SAML",icon:()=>null};class Je{static create(t){const{discoveryApi:o,environment:a="development",provider:d=Vt}=t,S=new DirectAuthConnector({discoveryApi:o,environment:a,provider:d}),B=new StaticAuthSessionManager({connector:S}),Z=new AuthSessionStore({manager:B,storageKey:`${d.id}Session`,schema:samlSessionSchema});return new Je(Z)}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 Rn={id:"microsoft",title:"Microsoft",icon:()=>null};class sn{static create(t){return new sn(t)}microsoftGraph(){return this.oauth2[sn.MicrosoftGraphID]}static resourceForScopes(t){const o=[...new Set(t.split(" ").map(sn.resourceForScope).filter(S=>S!=="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 d=(a=o[0])!==null&&a!==void 0?a:sn.MicrosoftGraphID;return Promise.resolve(d)}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:d}=a;return d.replace(/^api:\/\//,"")}switch(t){case"email":case"openid":case"offline_access":case"profile":return"openid";default:return sn.MicrosoftGraphID}}async getAccessToken(t,o){const a=t===void 0?sn.MicrosoftGraphID:await sn.resourceForScopes(Array.isArray(t)?t.join(" "):t);return a in this.oauth2||(this.oauth2[a]=gt.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:d=Rn,oauthRequestApi:S,discoveryApi:B,defaultScopes:Z=["openid","offline_access","profile","email","User.Read"],scopeTransform:oe=me=>me.concat("offline_access")}=t;this.configApi=o,this.environment=a,this.provider=d,this.oauthRequestApi=S,this.discoveryApi=B,this.scopeTransform=oe,this.oauth2={[sn.MicrosoftGraphID]:gt.create({configApi:this.configApi,discoveryApi:this.discoveryApi,oauthRequestApi:this.oauthRequestApi,provider:this.provider,environment:this.environment,scopeTransform:this.scopeTransform,defaultScopes:Z})}}}(0,k._)(sn,"MicrosoftGraphID","00000003-0000-0000-c000-000000000000");const Nn={id:"onelogin",title:"onelogin",icon:()=>null},In=new Set(["openid","profile","email","phone","address","groups","offline_access"]),Pn="onelogin.";class Gn{static create(t){const{configApi:o,discoveryApi:a,environment:d="development",provider:S=Nn,oauthRequestApi:B}=t;return gt.create({configApi:o,discoveryApi:a,oauthRequestApi:B,provider:S,environment:d,defaultScopes:["openid","email","profile","offline_access"],scopeTransform(Z){return Z.map(oe=>In.has(oe)||oe.startsWith(Pn)?oe:`${Pn}${oe}`)}})}}const Kn={id:"bitbucket",title:"Bitbucket",icon:()=>null};class Ln{static create(t){const{configApi:o,discoveryApi:a,environment:d="development",provider:S=Kn,oauthRequestApi:B,defaultScopes:Z=["team"]}=t;return gt.create({configApi:o,discoveryApi:a,oauthRequestApi:B,provider:S,environment:d,defaultScopes:Z})}}const be={id:"bitbucketServer",title:"Bitbucket Server",icon:()=>null};class pe{static create(t){const{configApi:o,discoveryApi:a,environment:d="development",provider:S=be,oauthRequestApi:B,defaultScopes:Z=["PROJECT_ADMIN"]}=t;return gt.create({configApi:o,discoveryApi:a,oauthRequestApi:B,provider:S,environment:d,defaultScopes:Z})}}const Ie={id:"atlassian",title:"Atlassian",icon:()=>null};class H{static create(t){const{configApi:o,discoveryApi:a,environment:d="development",provider:S=Ie,oauthRequestApi:B}=t;return gt.create({configApi:o,discoveryApi:a,oauthRequestApi:B,provider:S,environment:d})}}class N{post(t){this.subject.next(t)}alert$(){return this.subject}constructor(){(0,k._)(this,"subject",new ht)}}class ce{captureEvent(t){}}const Ae="theme";class $e{static createWithStorage(t){const o=new $e(t);if(!window.localStorage)return o;var a;const d=(a=window.localStorage.getItem(Ae))!==null&&a!==void 0?a:void 0;return o.setActiveThemeId(d),o.activeThemeId$().subscribe(S=>{S?window.localStorage.setItem(Ae,S):window.localStorage.removeItem(Ae)}),window.addEventListener("storage",S=>{if(S.key===Ae){var B;const Z=(B=localStorage.getItem(Ae))!==null&&B!==void 0?B:void 0;o.setActiveThemeId(Z)}}),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 et(void 0)}}var qe=n(9850),It=n.n(qe),Bt=n(12782),nn=n.n(Bt);const ln=/^[a-z][a-z0-9]*(?:[-_][a-z][a-z0-9]*)*$/i;function rn(i){return typeof i=="object"&&i!==null&&!Array.isArray(i)}function ee(i){if(i===null)return"null";if(Array.isArray(i))return"array";const t=typeof i;return t==="number"&&isNaN(i)?"nan":t==="string"&&i===""?"empty-string":t}const te={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 G{static fromConfigs(t){return t.length===0?new G(void 0):t.reduce((o,{data:a,context:d,filteredKeys:S,deprecatedKeys:B})=>{const Z=new G(a,d,o);if(Z.filteredKeys=S,B)for(const{key:oe,description:me}of B)console.warn(`The configuration key '${oe}' of ${d} is deprecated and may be removed soon. ${me||""}`);return Z},void 0)}has(t){var o;if(this.readValue(t)!==void 0)return!0;var d;return(d=(o=this.fallback)===null||o===void 0?void 0:o.has(t))!==null&&d!==void 0?d:!1}keys(){var t;const o=this.data?Object.keys(this.data):[];var a;const d=(a=(t=this.fallback)===null||t===void 0?void 0:t.keys())!==null&&a!==void 0?a:[];return[...new Set([...o,...d])]}get(t){const o=this.getOptional(t);if(o===void 0)throw new Error(te.missing(this.fullKey(t!=null?t:"")));return o}getOptional(t){var o;const a=It()(this.readValue(t)),d=(o=this.fallback)===null||o===void 0?void 0:o.getOptional(t);if(a===void 0){if(!1)var S;return d}else if(d===void 0)return a;return nn()({},{value:d},{value:a},(B,Z)=>!rn(Z)||!rn(B)?Z:void 0).value}getConfig(t){const o=this.getOptionalConfig(t);if(o===void 0)throw new Error(te.missing(this.fullKey(t)));return o}getOptionalConfig(t){var o;const a=this.readValue(t),d=(o=this.fallback)===null||o===void 0?void 0:o.getOptionalConfig(t);if(rn(a))return this.copy(a,t,d);if(a!==void 0)throw new TypeError(te.type(this.fullKey(t),this.context,ee(a),"object"));return d}getConfigArray(t){const o=this.getOptionalConfigArray(t);if(o===void 0)throw new Error(te.missing(this.fullKey(t)));return o}getOptionalConfigArray(t){const o=this.readConfigValue(t,d=>{if(!Array.isArray(d))return{expected:"object-array"};for(const[S,B]of d.entries())if(!rn(B))return{expected:"object-array",value:B,key:`${t}[${S}]`};return!0});if(!o){if(!1)var a;return}return o.map((d,S)=>this.copy(d,`${t}[${S}]`))}getNumber(t){const o=this.getOptionalNumber(t);if(o===void 0)throw new Error(te.missing(this.fullKey(t)));return o}getOptionalNumber(t){const o=this.readConfigValue(t,d=>typeof d=="number"||typeof d=="string"||{expected:"number"});if(typeof o=="number"||o===void 0)return o;const a=Number(o);if(!Number.isFinite(a))throw new Error(te.convert(this.fullKey(t),this.context,"number"));return a}getBoolean(t){const o=this.getOptionalBoolean(t);if(o===void 0)throw new Error(te.missing(this.fullKey(t)));return o}getOptionalBoolean(t){const o=this.readConfigValue(t,d=>typeof d=="boolean"||typeof d=="number"||typeof d=="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(te.convert(this.fullKey(t),this.context,"boolean"))}getString(t){const o=this.getOptionalString(t);if(o===void 0)throw new Error(te.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(te.missing(this.fullKey(t)));return o}getOptionalStringArray(t){return this.readConfigValue(t,o=>{if(!Array.isArray(o))return{expected:"string-array"};for(const[a,d]of o.entries())if(typeof d!="string"||d==="")return{expected:"string-array",value:d,key:`${t}[${a}]`};return!0})}fullKey(t){return`${this.prefix}${this.prefix?".":""}${t}`}copy(t,o,a){const d=new G(t,this.context,a,this.fullKey(o));return d.filteredKeys=this.filteredKeys,d}readConfigValue(t,o){const a=this.readValue(t);if(a===void 0){var d;if(!1)var S;return(d=this.fallback)===null||d===void 0?void 0:d.readConfigValue(t,o)}const B=o(a);if(B!==!0){const{key:Z=t,value:oe=a,expected:me}=B;throw new TypeError(te.type(this.fullKey(Z),this.context,ee(oe),me))}return a}readValue(t){const o=t?t.split("."):[];for(const d of o)if(!ln.test(d))throw new TypeError(`Invalid config key '${t}'`);if(this.data===void 0)return;let a=this.data;for(const[d,S]of o.entries())if(rn(a))a=a[S];else if(a!==void 0){const B=this.fullKey(o.slice(0,d).join("."));throw new TypeError(te.type(B,this.context,ee(a),"object"))}return a}constructor(t,o="mock-config",a,d=""){(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=d,this.notifiedFilteredKeys=new Set}}const v="Invalid discovery URL pattern,";class O{static compile(t){const o=t.split(/\{\{\s*pluginId\s*\}\}/),a=o.join("pluginId");let d;try{d=new URL(a)}catch{throw new Error(`${v} URL '${a}' is invalid`)}if(d.hash)throw new Error(`${v} URL must not have a hash`);if(d.search)throw new Error(`${v} URL must not have a query`);if(a.endsWith("/"))throw new Error(`${v} URL must not end with a slash`);return new O(o)}async getBaseUrl(t){return this.parts.join(encodeURIComponent(t))}constructor(t){(0,k._)(this,"parts",void 0),this.parts=t}}class M{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 Y{post(t,o){this.subject.next({error:t,context:o})}error$(){return this.subject}constructor(){(0,k._)(this,"subject",new ht)}}class he{static forward(t,o){window.addEventListener("unhandledrejection",a=>{t.post(a.reason,o)})}}function we(i){if(i.length<3)throw new Error(`The '${i}' feature flag must have a minimum length of three characters.`);if(i.length>150)throw new Error(`The '${i}' feature flag must not exceed 150 characters.`);if(!i.match(/^[a-z]+[a-z0-9-]+$/))throw new Error(`The '${i}' feature flag must start with a lowercase letter and only contain lowercase letters, numbers and hyphens. Examples: feature-flag-one, alpha, release-2020`)}class Oe{registerFlag(t){we(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,d]of Object.entries(t.states))this.flags.set(a,d);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(([d,S])=>(we(d),S===m.CL.Active));return new Map(a)}catch{return new Map}}constructor(){(0,k._)(this,"registeredFeatureFlags",[]),(0,k._)(this,"flags",void 0)}}function Xe(i){let t=i.baseImplementation||n.g.fetch;var o;const a=[(o=i.middleware)!==null&&o!==void 0?o:[]].flat().reverse();for(const d of a)t=d.apply(t);return{fetch:t}}class tt{static create(t){var o,a;const d=mt(t),S=((o=t.header)===null||o===void 0?void 0:o.name)||"authorization",B=((a=t.header)===null||a===void 0?void 0:a.value)||(Z=>`Bearer ${Z}`);return new tt(t.identityApi,d,S,B)}apply(t){return async(o,a)=>{const d=new Request(o,a),{token:S}=await this.identityApi.getCredentials();return d.headers.get(this.headerName)||typeof S!="string"||!S||!this.allowUrl(d.url)?t(o,a):(d.headers.set(this.headerName,this.headerValue(S)),t(d))}}constructor(t,o,a,d){(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=d}}function mt(i){return i.allowUrl?i.allowUrl:i.urlPrefixAllowlist?wt(i.urlPrefixAllowlist):i.config?wt([i.config.getString("backend.baseUrl")]):()=>!1}function wt(i){const t=i.map(o=>o.replace(/\/$/,""));return o=>t.some(a=>o===a||o.startsWith(`${a}/`))}function dt(i,t){return!t||t==="/"?i:`${i.replace(/\/$/,"")}/${t.replace(/^\//,"")}`}class Be{apply(t){return async(o,a)=>{const d=new Request(o,a),S="plugin://";if(!d.url.startsWith(S))return t(o,a);const{hostname:B,pathname:Z,search:oe,hash:me,username:Me,password:Te}=new URL(`http://${d.url.substring(S.length)}`);let Ze=await this.discoveryApi.getBaseUrl(B);if(Me||Te){const st=new URL(Ze),qt=`${Me}${Te?`:${Te}`:""}@`;Ze=`${st.protocol}//${qt}${st.host}${st.pathname}`}const Ge=`${dt(Ze,Z)}${oe}${me}`;return t(Ge,typeof o=="string"||At(o)?a:o)}}constructor(t){(0,k._)(this,"discoveryApi",void 0),this.discoveryApi=t}}function At(i){var t;return typeof i=="object"&&((t=i)===null||t===void 0?void 0:t.constructor)===URL}class Ut{static resolvePluginProtocol(t){return new Be(t.discoveryApi)}static injectIdentityAuth(t){return tt.create(t)}constructor(){}}function xt(i,t){for(const o of t)if(!i.has(o))return!1;return!0}function Nt(i,...t){const o=new Set(i);for(const a of t)for(const d of a)o.add(d);return o}class Qt{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=>xt(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)=>Nt(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 et(this.getCurrentPending()))}}class jn{createAuthRequester(t){const o=new Qt,a=this.handlerCount;return this.handlerCount++,o.pending().subscribe({next:d=>{const S=this.currentRequests.slice(),B=this.makeAuthRequest(d,t);B?S[a]=B:delete S[a],this.currentRequests=S,this.subject.next(S.filter(Boolean))}}),d=>o.request(d)}makeAuthRequest(t,o){const{scopes:a}=t;if(a)return{provider:o.provider,trigger:async()=>{const d=await o.onAuthRequest(a);t.resolve(d)},reject:()=>{const d=new Error("Login failed, rejected by user");d.name="RejectedError",t.reject(d)}}}authRequest$(){return this.subject}constructor(){(0,k._)(this,"subject",new et([])),(0,k._)(this,"currentRequests",[]),(0,k._)(this,"handlerCount",0)}}const Ft=new Map;class bt{static create(t){var o;return new bt((o=t.namespace)!==null&&o!==void 0?o:"",t.errorApi)}static addStorageEventListener(){window.addEventListener("storage",t=>{for(const[a,d]of Ft.entries()){var o;!((o=t.key)===null||o===void 0)&&o.startsWith(a)&&d.handleStorageChange(t.key)}})}get(t){return this.snapshot(t).value}snapshot(t){let o,a="absent";try{const d=localStorage.getItem(this.getKeyName(t));d&&(o=JSON.parse(d,(S,B)=>(typeof B=="object"&&B!==null&&Object.freeze(B),B)),a="present")}catch{this.errorApi.post(new Error(`Error when parsing JSON config from storage for: ${t}`))}return{key:t,value:o,presence:a}}forBucket(t){const o=`${this.namespace}/${t}`;return Ft.has(o)||Ft.set(o,new bt(o,this.errorApi)),Ft.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 bt.hasSubscribed||(bt.addStorageEventListener(),bt.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 d=(a=t)===null||a===void 0?void 0:a.slice(`${this.namespace}/`.length);d.includes("/")||this.notifyChanges(decodeURIComponent(d))}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(Ne())(a=>(this.subscribers.add(a),()=>{this.subscribers.delete(a)}))}}(0,k._)(bt,"hasSubscribed",!1);const jt=(0,W.createContext)(void 0);function Mt(){const[i]=(0,V.is)((0,p.jsx)(V.AW,{index:!0,element:(0,p.jsx)("div",{})}));return!i.index}var Xt=n(84800);const lr=(i,t)=>{try{var o,a,d,S;const Z=(o=(0,Xt.fp)(t,{pathname:i}))===null||o===void 0?void 0:o.filter(Ze=>{var Ge,st;return((st=Ze)===null||st===void 0||(Ge=st.route.routeRefs)===null||Ge===void 0?void 0:Ge.size)>0}).pop(),oe=(a=Z)===null||a===void 0?void 0:a.route;if(!oe||oe.path===""&&i!=="/")return;let me;oe.routeRefs.size===1&&(me=oe.routeRefs.values().next().value);let Me;oe.plugins.size===1&&(Me=oe.plugins.values().next().value);const Te=Object.entries(((d=Z)===null||d===void 0?void 0:d.params)||{}).reduce((Ze,[Ge,st])=>(st!==void 0&&Ge!=="*"&&(Ze[Ge]=st),Ze),{});return{extension:"App",pluginId:((S=Me)===null||S===void 0?void 0:S.getId())||"root",...me?{routeRef:me.id}:{},_routeNodeType:oe.element,params:Te}}catch{return}},Cr=({pathname:i,search:t,hash:o,attributes:a})=>{const d=(0,m.z$)();return(0,W.useEffect)(()=>{d.captureEvent("navigate",`${i}${t}${o}`,{attributes:a})},[d,i,t,o,a]),null},rr=({routeObjects:i})=>{const{pathname:t,search:o,hash:a}=(0,V.TH)(),{params:d,...S}=lr(t,i)||{params:{}};return(0,p.jsx)(m.fC,{attributes:S,children:(0,p.jsx)(Cr,{pathname:t,search:o,hash:a,attributes:d})})};function bn(i){return Mt()?_n(i):""}function _n(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 fr({component:i,appIdentityProxy:t,children:o}){const[a,d]=(0,W.useState)(),S=(0,m.h_)(m.Ds),B=bn(S);return a?(t.setTarget(a,{signOutTargetUrl:B||"/"}),(0,p.jsx)(p.Fragment,{children:o})):(0,p.jsx)(i,{onSignInSuccess:d})}function wr(i){const{Router:t,SignInPage:o}=(0,m.qD)().getComponents(),a=(0,m.h_)(m.Ds),d=_n(a),S=`${d}/*`,B=(0,W.useContext)(jt);if(!B)throw new Error("AppRouter must be rendered within the AppProvider");const{routeObjects:Z,appIdentityProxy:oe}=B;return o?Mt()?(0,p.jsxs)(t,{children:[(0,p.jsx)(rr,{routeObjects:Z}),(0,p.jsx)(fr,{component:o,appIdentityProxy:oe,children:(0,p.jsx)(V.Z5,{children:(0,p.jsx)(V.AW,{path:S,element:(0,p.jsx)(p.Fragment,{children:i.children})})})})]}):(0,p.jsxs)(t,{basename:d,children:[(0,p.jsx)(rr,{routeObjects:Z}),(0,p.jsx)(fr,{component:o,appIdentityProxy:oe,children:i.children})]}):(oe.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:d||"/"}),Mt()?(0,p.jsxs)(t,{children:[(0,p.jsx)(rr,{routeObjects:Z}),(0,p.jsx)(V.Z5,{children:(0,p.jsx)(V.AW,{path:S,element:(0,p.jsx)(p.Fragment,{children:i.children})})})]}):(0,p.jsxs)(t,{basename:d,children:[(0,p.jsx)(rr,{routeObjects:Z}),i.children]}))}var Yn=n(88412),zr=n(50629),jr=n(80956),Nr=n(64279);function C(i){const t={};for(const a in i.collectors)i.collectors.hasOwnProperty(a)&&(t[a]=i.collectors[a]());const o=[{node:W.Children.toArray(i.root),parent:void 0,contexts:{}}];for(;o.length!==0;){const{node:a,parent:d,contexts:S}=o.shift();W.Children.forEach(a,B=>{if(!(0,W.isValidElement)(B))return;const Z={};for(const oe in t)if(t.hasOwnProperty(oe)){const me=t[oe];Z[oe]=me.visit(me.accumulator,B,d,S[oe])}for(const oe of i.discoverers){const me=oe(B);me&&o.push({node:me,parent:B,contexts:Z})}})}return Object.fromEntries(Object.entries(t).map(([a,d])=>[a,d.accumulator]))}function c(i,t){return()=>({accumulator:i(),visit:t})}function b(i){var t;return(t=i.props)===null||t===void 0?void 0:t.children}function A(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 J=c(()=>new Set,(i,t)=>{const o=(0,m.IY)(t,"core.plugin");o&&i.add(o)}),ve=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)(ve,"core.featureFlagged",!0);const je={caseSensitive:!1,path:"*",element:"match-all",routeRefs:new Set,plugins:new Set};function ke(i){var t;const o=i;if(!((t=o)===null||t===void 0)&&t.type){var a,d;return(d=(a=o.type.displayName)!==null&&a!==void 0?a:o.type.name)!==null&&d!==void 0?d:String(o.type)}return String(o)}const nt=i=>{const t=new Set;return i&&t.add(i),t};function _t(i,t=new Array){return W.Children.forEach(i,o=>{if(!(0,W.isValidElement)(o))return;const a=(0,m.IY)(o,"core.mountPoint");if(a){const d=(0,m.IY)(o,"core.plugin");t.push({routeRef:a,plugin:d})}_t(o.props.children,t)}),t}const an=c(()=>({paths:new Map,parents:new Map,objects:new Array}),(i,t,o,a)=>{var d,S,B,Z,oe;if(!((d=a)===null||d===void 0)&&d.isElementAncestor)return a;if(((S=o)===null||S===void 0?void 0:S.props.element)===t)return{...a,isElementAncestor:!0};const me=(B=t.props)===null||B===void 0?void 0:B.path,Me=(0,m.IY)(t,"core.mountPoint");if(Me&&me)throw new Error(`Path property may not be set directly on a routable extension "${ke(t)}"`);var Te;const Ze=(Te=(oe=a)===null||oe===void 0||(Z=oe.obj)===null||Z===void 0?void 0:Z.children)!==null&&Te!==void 0?Te:i.objects;if(me!==void 0){if(typeof me!="string")throw new Error(`Element path must be a string at "${ke(t)}"`);const On=me.startsWith("/")?me.slice(1):me,Jr=t.props.element;if((0,m.IY)(t,"core.gatherMountPoints")){var Ge,st,qt;if(Jr)throw new Error(`Mount point gatherers may not have an element prop "${ke(t)}"`);const bo={path:On,element:"gathered",routeRefs:new Set,caseSensitive:Boolean((Ge=t.props)===null||Ge===void 0?void 0:Ge.caseSensitive),children:[je],plugins:new Set};return Ze.push(bo),{obj:bo,gatherPath:On,routeRef:(st=a)===null||st===void 0?void 0:st.routeRef,gatherRouteRef:(qt=a)===null||qt===void 0?void 0:qt.routeRef}}if(Jr){var Ht,nr,Ur,pr;const[bo,...pa]=_t(Jr);if(pa.length>0)throw new Error(`Route element with path "${me}" may not contain multiple routable extensions`);if(!bo)return a;const{routeRef:io,plugin:fa}=bo,vs={path:On,element:"mounted",routeRefs:new Set([io]),caseSensitive:Boolean((Ht=t.props)===null||Ht===void 0?void 0:Ht.caseSensitive),children:[je],plugins:nt(fa)};return Ze.push(vs),i.paths.set(io,On),i.parents.set(io,(nr=a)===null||nr===void 0?void 0:nr.routeRef),{obj:vs,routeRef:io!=null?io:(Ur=a)===null||Ur===void 0?void 0:Ur.routeRef,gatherPath:On,gatherRouteRef:(pr=a)===null||pr===void 0?void 0:pr.gatherRouteRef}}}if(Me){var yr,xr,Zn,Pr;if(((yr=a)===null||yr===void 0?void 0:yr.gatherPath)===void 0)throw new Error(`Routable extension "${ke(t)}" with mount point "${Me}" must be assigned a path`);(Zn=a)===null||Zn===void 0||(xr=Zn.obj)===null||xr===void 0||xr.routeRefs.add(Me);const On=(0,m.IY)(t,"core.plugin");if(On){var Lr,Or;(Or=a)===null||Or===void 0||(Lr=Or.obj)===null||Lr===void 0||Lr.plugins.add(On)}return i.paths.set(Me,a.gatherPath),i.parents.set(Me,(Pr=a)===null||Pr===void 0?void 0:Pr.gatherRouteRef),{...a,routeRef:Me}}return a}),En=c(()=>({paths:new Map,parents:new Map,objects:new Array}),(i,t,o,a)=>{var d,S,B,Z,oe,me,Me,Te,Ze;if(((d=o)===null||d===void 0?void 0:d.props.element)===t)return a;let Ge=(S=a)===null||S===void 0?void 0:S.obj,st=(B=a)===null||B===void 0?void 0:B.routeRef,qt=(Z=a)===null||Z===void 0?void 0:Z.sticky;const Ht=(oe=t.props)===null||oe===void 0?void 0:oe.path;var nr;const Ur=(nr=(me=Ge)===null||me===void 0?void 0:me.children)!==null&&nr!==void 0?nr:i.objects,pr=Boolean((Me=t.props)===null||Me===void 0?void 0:Me.caseSensitive);let yr=(Te=a)===null||Te===void 0?void 0:Te.path;if((0,m.IY)(t,"core.gatherMountPoints")){if(!Ht)throw new Error("Mount point gatherer must have a path");yr=Ht}const xr=(Ze=t.props)===null||Ze===void 0?void 0:Ze.element;let Zn=(0,m.IY)(t,"core.mountPoint");if(!Zn&&(0,W.isValidElement)(xr)&&(Zn=(0,m.IY)(xr,"core.mountPoint")),Zn){let Jr=Ht;if(yr&&(Jr?yr=void 0:Jr=yr),!Jr)throw new Error("Mounted routable extension must have a path");if(i.paths.set(Zn,Jr),st&&qt?(i.parents.set(Zn,st),Ht&&(st=Zn,qt=!1)):(i.parents.set(Zn,st),st=Zn),Ht)Ge={caseSensitive:pr,path:Ht,element:"mounted",routeRefs:new Set([Zn]),children:[je],plugins:nt((0,m.IY)(t.props.element,"core.plugin"))},Ur.push(Ge);else{var Pr;(Pr=Ge)===null||Pr===void 0||Pr.routeRefs.add(Zn)}}if((0,m.IY)(t,"core.gatherMountPoints")&&(qt=!0),(0,m.IY)(t,"core.gatherMountPoints")){if(!Ht)throw new Error("Mount point gatherer must have a path");if(!Zn){var Or,On;Ge={caseSensitive:pr,path:Ht,element:"gathered",routeRefs:new Set,children:[je],plugins:((On=a)===null||On===void 0||(Or=On.obj)===null||Or===void 0?void 0:Or.plugins)||new Set},Ur.push(Ge)}}return{obj:Ge,path:yr,routeRef:st,sticky:qt}}),gn=c(()=>new Set,(i,t)=>{if(t.type===ve){const o=t.props;i.add("with"in o?o.with:o.without)}}),Wr=(0,yt.uW)("route-ref-type",()=>Symbol("route-ref-type"));function lo(i){return i[Wr]==="absolute"}function Co(i){return i[Wr]==="sub"}function Ss(i){return i[Wr]==="external"}function Vr(...i){const t=i.join("/").replace(/\/\/+/g,"/");return t!=="/"&&t.endsWith("/")?t.slice(0,-1):t}function Vo(i,t,o){let a,d="";if(lo(i))a=i;else if(Co(i))a=i.parent,d=i.path;else if(Ss(i)){const Z=o.get(i);if(!Z)return[void 0,""];if(lo(Z))a=Z;else if(Co(Z))a=Z.parent,d=Z.path;else throw new Error(`ExternalRouteRef was bound to invalid target, ${Z}`)}else throw i[Wr]?new Error(`Unknown or invalid route ref type, ${i[Wr]}`):new Error(`Unknown object passed to useRouteRef, got ${i}`);if(!a)return[void 0,""];const S=t.get(a);if(S===void 0)return[void 0,""];const B=Vr(S,d);return[a,B]}function Cs(i,t,o,a,d){var S;const B=(S=(0,Xt.fp)(d,t))!==null&&S!==void 0?S:[],Z=Array();let oe=-1;for(let Te=i;Te&&(oe=B.findIndex(Ze=>Ze.route.routeRefs.has(Te)),oe===-1);Te=a.get(Te))Z.unshift(Te);Z.length===0&&(oe-=1);const me=oe===-1?"":B[oe].pathname,Me=Z.slice(0,-1).map(Te=>{const Ze=o.get(Te);if(Ze===void 0)throw new Error(`No path for ${Te}`);if(Ze.includes(":"))throw new Error(`Cannot route to ${i} with parent ${Te} as it has parameters`);return Ze});return`${Vr(me,...Me)}/`}class Ho{resolve(t,o){const[a,d]=Vo(t,this.routePaths,this.routeBindings);if(!a)return;let S;typeof o=="string"?S=this.trimPath(o):o.pathname?S={...o,pathname:this.trimPath(o.pathname)}:S=o;const B=this.appBasePath+Cs(a,S,this.routePaths,this.routeParents,this.routeObjects);return(...[oe])=>Vr(B,(0,Xt.Gn)(d,oe))}trimPath(t){return t&&(t.startsWith(this.appBasePath)?t.slice(this.appBasePath.length):t)}constructor(t,o,a,d,S){(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=d,this.appBasePath=S}}const Go=(0,yt.CT)("routing-context"),Er=({routePaths:i,routeParents:t,routeObjects:o,routeBindings:a,basePath:d="",children:S})=>{const B=new Ho(i,t,o,a,d),Z=(0,yt.EI)({1:B});return(0,p.jsx)(Go.Provider,{value:Z,children:S})};function cr(i,t){const o=new Set(t.values());o.delete(void 0);for(const a of t.keys()){if(o.has(a))continue;let d=a,S="";for(;d;){const Z=i.get(d);if(Z===void 0)throw new Error(`No path for ${d}`);S=Vr(Z,S),d=t.get(d)}const B=S.match(/:(\w+)/g);if(B){for(let Z=0;Z<B.length;Z++)for(let oe=Z+1;oe<B.length;oe++)if(B[oe]===B[Z])throw new Error(`Parameter ${B[oe]} is duplicated in path ${S}`)}}}function Hr(i,t){for(const o of t)if(o.externalRoutes){for(const[a,d]of Object.entries(o.externalRoutes))if(!d.optional&&!i.has(d))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 qr=(0,yt.CT)("app-context"),wo=({appContext:i,children:t})=>{const o=(0,yt.EI)({1:i});return(0,p.jsx)(qr.Provider,{value:o,children:t})};function jo(i){return new Error(`Tried to access IdentityApi ${i} before app was loaded`)}function Fr(i){console.warn(`WARNING: Call to ${i} is deprecated and will break in the future`)}class Ko{setTarget(t,o){this.target=t,this.signOutTargetUrl=o.signOutTargetUrl,this.resolveTarget(t)}getUserId(){if(!this.target)throw jo("getUserId");if(!this.target.getUserId)throw new Error("IdentityApi does not implement getUserId");return Fr("getUserId"),this.target.getUserId()}getProfile(){if(!this.target)throw jo("getProfile");if(!this.target.getProfile)throw new Error("IdentityApi does not implement getProfile");return Fr("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 Fr("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 Eo=n(72164);function Fn(i,t,o){if(i!==void 0){const d=o.find(S=>S.id===i);if(d)return d}if(t){const d=o.find(S=>S.variant==="dark");if(d)return d}const a=o.find(d=>d.variant==="light");return a||o[0]}const dr=()=>{const i=(0,W.useMemo)(()=>window.matchMedia("(prefers-color-scheme: dark)"),[]),[t,o]=(0,W.useState)(i.matches);return(0,W.useEffect)(()=>{const a=d=>{o(d.matches)};return i.addListener(a),()=>{i.removeListener(a)}},[i]),t};function Gr({children:i}){const t=(0,m.h_)(m.hg),o=(0,Eo.Z)(t.activeThemeId$(),t.getActiveThemeId()),a=Boolean(window.matchMedia)?dr():!1,d=Fn(o,a,t.getInstalledThemes());if(!d)throw new Error("App has no themes");return(0,p.jsx)(d.Provider,{children:i})}const Kr=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 d=JSON.parse(i);Array.isArray(d)?o.push(...d):o.push({data:d,context:"env"})}catch(d){throw new Error(`Failed to load runtime configuration, ${d}`)}const a=window.__APP_CONFIG__;return a&&o.push({context:"window",data:a}),o};class Yo{add(t,o){return this.apis.push([t.id,o]),o}build(){return new gr(new Map(this.apis))}constructor(){(0,k._)(this,"apis",[])}}class gr{static builder(){return new Yo}static from(t){return new gr(new Map(t.map(([o,a])=>[o.id,a])))}static with(t,o){return new gr(new Map([[t.id,o]]))}with(t,o){return new gr(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 Ao(i){const t=new Map;return i&&i({bind:(a,d)=>{for(const[S,B]of Object.entries(d)){const Z=a[S];if(!Z)throw new Error(`Key ${S} is not an existing external route`);if(!B&&!Z.optional)throw new Error(`External route ${S} is required but was undefined`);B&&t.set(Z,B)}}}),t}function To(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 Ro(i,t,o){var a;const d=Boolean(i),S=(0,Nr.default)(i||(()=>Promise.resolve([])));let B;if(d&&S.loading){const{Progress:me}=t;B=(0,p.jsx)(me,{})}else if(S.error){const{BootErrorPage:me}=t;B=(0,p.jsx)(me,{step:"load-config",error:S.error})}const{ThemeProvider:Z=Gr}=t;if(B)return{node:(0,p.jsx)(zt,{apis:gr.with(m.hg,o),children:(0,p.jsx)(Z,{children:B})})};let oe;if(!((a=S.value)===null||a===void 0)&&a.length){const me=G.fromConfigs(S.value),Me=me.getOptionalString("app.baseUrl"),Te=me.getOptionalString("backend.baseUrl");let Ze=S.value;const Ge={data:{},context:"relative-resolver"};if(Me&&Te){const st=new URL(Me).origin,qt=new URL(Te).origin;if(st===qt){const Ht=To(Te);Te!==Ht&&(Ge.data.backend={baseUrl:Ht})}}if(Me){const st=To(Me);Me!==st&&(Ge.data.app={baseUrl:st})}Object.keys(Ge.data).length&&(Ze=Ze.concat([Ge])),oe=G.fromConfigs(Ze)}else oe=G.fromConfigs([]);return{api:oe}}class Zr{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 Io=new WeakMap;class Jo{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,Yn._)(this,Io))throw new Error("app.getProvider() or app.createRoot() has already been called, and can only be called once");(0,jr._)(this,Io,!0);const t=new Zr(this);let o=!1;return({children:d})=>{const S=(0,W.useRef)(!0),B=(0,W.useMemo)(()=>$e.createWithStorage(this.themes),[]),{routing:Z,featureFlags:oe,routeBindings:me}=(0,W.useMemo)(()=>{const Ge=C({root:d,discoverers:[b,A],collectors:{routing:Mt()?En:an,collectedPlugins:J,featureFlags:gn}});return Ge.collectedPlugins.forEach(st=>this.plugins.add(st)),this.verifyPlugins(this.plugins),this.getApiHolder(),{...Ge,routeBindings:Ao(this.bindRoutes)}},[d]);o||(o=!0,cr(Z.paths,Z.parents),Hr(me,this.plugins));const Me=Ro(this.configLoader,this.components,B),Te="api"in Me;if(Te){const{api:Ge}=Me;this.configApi=Ge}if("node"in Me)return Me.node;if(Te&&S.current){S.current=!1;const Ge=this.getApiHolder().get(m.W0);if(Ge){for(const Ht of this.featureFlags)Ge.registerFlag({...Ht,pluginId:""});for(const Ht of this.plugins.values())if("getFeatureFlags"in Ht)for(const nr of Ht.getFeatureFlags())Ge.registerFlag({name:nr.name,pluginId:Ht.getId()});else for(const nr of Ht.output())nr.type==="feature-flag"&&Ge.registerFlag({name:nr.name,pluginId:Ht.getId()});const st=Ge.getRegisteredFlags(),qt=new Set(st.map(Ht=>Ht.name));for(const Ht of oe)qt.has(Ht)||Ge.registerFlag({name:Ht,pluginId:""})}}const{ThemeProvider:Ze=Gr}=this.components;return(0,p.jsx)(zt,{apis:this.getApiHolder(),children:(0,p.jsx)(wo,{appContext:t,children:(0,p.jsx)(Ze,{children:(0,p.jsx)(Er,{routePaths:Z.paths,routeParents:Z.parents,routeObjects:Z.objects,routeBindings:me,basePath:bn(Me.api),children:(0,p.jsx)(jt.Provider,{value:{routeObjects:Z.objects,appIdentityProxy:this.appIdentityProxy},children:d})})})})})}}getRouter(){return wr}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 Rt.validateFactories(this.apiFactoryRegistry,this.apiFactoryRegistry.getAllApis()),this.apiHolder}this.apiFactoryRegistry.register("static",{api:m.hg,deps:{},factory:()=>$e.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("default",{api:m.W0,deps:{},factory:()=>new Oe});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 Rt.validateFactories(this.apiFactoryRegistry,this.apiFactoryRegistry.getAllApis()),this.apiHolder=new Rt(this.apiFactoryRegistry),this.apiHolder}verifyPlugins(t){const o=new Set;for(const a of t){const d=a.getId();if(o.has(d))throw new Error(`Duplicate plugin found '${d}'`);o.add(d)}}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,"appIdentityProxy",new Ko),(0,k._)(this,"apiFactoryRegistry",void 0),(0,zr._)(this,Io,{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 d;this.featureFlags=(d=t.featureFlags)!==null&&d!==void 0?d:[],this.components=t.components,this.themes=t.themes;var S;this.configLoader=(S=t.configLoader)!==null&&S!==void 0?S:Kr;var B;this.defaultApis=(B=t.defaultApis)!==null&&B!==void 0?B:[],this.bindRoutes=t.bindRoutes,this.apiFactoryRegistry=new Yt}}function co(i){return new Jo(i)}let Po=!1;const ws=i=>{const t=(0,m.qD)(),{NotFoundErrorPage:o}=t.getComponents(),a=(0,W.useMemo)(()=>Mt(),[]),S=[...(0,m.vJ)(i.children,B=>B.getElements().flatMap(Z=>{var oe;let me=Z.props.path;if(me==="")return[];var Me;me=(Me=(oe=me)===null||oe===void 0?void 0:oe.replace(/\/\*$/,""))!==null&&Me!==void 0?Me:"/";let Te=a?Z:Z.props.element;return!a&&!Te&&(Te=Z,Po||(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] />} />."),Po=!0)),[{path:me,element:Te,children:Z.props.children?[{path:me==="/"?"/":"*",element:Z.props.children}]:void 0}]}).sort((Z,oe)=>oe.path.localeCompare(Z.path)).map(Z=>({...Z,path:Z.path==="/"?"/":`${Z.path}/*`}))),{path:"*",element:(0,p.jsx)(o,{})}];return(0,V.V$)(S)},Lo=(0,m.T0)({id:"plugin.permission.api"});var ur;(function(i){i.DENY="DENY",i.ALLOW="ALLOW",i.CONDITIONAL="CONDITIONAL"})(ur||(ur={}));function ci(i,t){return i.name===t.name}function Qo(i,t){return"resourceType"in i?!t||i.resourceType===t:!1}function js(i){return i.attributes.action==="create"}function uo(i){return i.attributes.action==="read"}function eo(i){return i.attributes.action==="update"}function to(i){return i.attributes.action==="delete"}function no(i){return{authorize:async(t,o)=>await i.authorize(t,o),authorizeConditional(t,o){const a=t;return i.authorize(a,o)}}}function Ar({name:i,attributes:t,resourceType:o}){return o?{type:"resource",name:i,attributes:t,resourceType:o}:{type:"basic",name:i,attributes:t}}var qn=n(23054),ho=n(96279),Xo=n.n(ho),Es=n(9571);const ro=_e.z.lazy(()=>_e.z.object({rule:_e.z.string(),resourceType:_e.z.string(),params:_e.z.record(_e.z.any()).optional()}).or(_e.z.object({anyOf:_e.z.array(ro).nonempty()})).or(_e.z.object({allOf:_e.z.array(ro).nonempty()})).or(_e.z.object({not:ro}))),_o=_e.z.object({result:_e.z.literal(ur.ALLOW).or(_e.z.literal(ur.DENY))}),As=_e.z.union([_e.z.object({result:_e.z.literal(ur.ALLOW).or(_e.z.literal(ur.DENY))}),_e.z.object({result:_e.z.literal(ur.CONDITIONAL),pluginId:_e.z.string(),resourceType:_e.z.string(),conditions:ro})]),qo=(i,t)=>_e.z.object({items:_e.z.array(_e.z.intersection(_e.z.object({id:_e.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 es{async authorize(t,o){return this.makeRequest(t,_o,o)}async authorizeConditional(t,o){return this.makeRequest(t,As,o)}async makeRequest(t,o,a){var d;if(!this.enabled)return t.map(Te=>({result:ur.ALLOW}));const S={items:t.map(Te=>({id:Es.Z(),...Te}))},B=await this.discovery.getBaseUrl("permission"),Z=await Xo()(`${B}/authorize`,{method:"POST",body:JSON.stringify(S),headers:{...this.getAuthorizationHeader((d=a)===null||d===void 0?void 0:d.token),"content-type":"application/json"}});if(!Z.ok)throw await qn.VL.fromResponse(Z);const oe=await Z.json(),Me=qo(o,new Set(S.items.map(({id:Te})=>Te))).parse(oe).items.reduce((Te,Ze)=>(Te[Ze.id]=Ze,Te),{});return S.items.map(Te=>Me[Te.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 po{static create(t){const{config:o,discovery:a,identity:d}=t,S=new es({discovery:a,config:o});return new po(S,d)}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 Oo=n(69984);function fo(i){const t=(0,m.h_)(Lo),{data:o,error:a}=(0,Oo.ZP)(i,async d=>{if(Qo(d.permission)&&!d.resourceRef)return ur.DENY;const{result:S}=await t.authorize(d);return S});return a?{error:a,loading:!1,allowed:!1}:o===void 0?{loading:!0,allowed:!1}:{loading:!1,allowed:o===ur.ALLOW}}const Ts=i=>{const{permission:t,resourceRef:o,errorComponent:a,...d}=i,S=usePermission(isResourcePermission(t)?{permission:t,resourceRef:o}:{permission:t}),B=useApp(),{NotFoundErrorPage:Z}=B.getComponents();let oe=a===void 0?_jsx(Z,{}):a;return S.loading?oe=null:S.allowed&&(oe=i.element),_jsx(Route,{...d,element:oe})};function di(i){const{permission:t,resourceRef:o}=i,a=usePermission(isResourcePermission(t)?{permission:t,resourceRef:o}:{permission:t}),d=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:S}=d.getComponents();return _jsx(S,{})}const ts=[(0,m.ni)({api:m.NW,deps:{configApi:m.Ds},factory:({configApi:i})=>O.compile(`${i.getString("backend.baseUrl")}/api/{{ pluginId }}`)}),(0,m.ni)({api:m.$v,deps:{},factory:()=>new N}),(0,m.ni)({api:m.v_,deps:{},factory:()=>new ce}),(0,m.ni)({api:m.VE,deps:{alertApi:m.$v},factory:({alertApi:i})=>{const t=new M(i,new Y);return he.forward(t,{hidden:!1}),t}}),(0,m.ni)({api:m.E6,deps:{errorApi:m.VE},factory:({errorApi:i})=>bt.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})=>Xe({middleware:[Ut.resolvePluginProtocol({discoveryApi:o}),Ut.injectIdentityAuth({identityApi:t,config:i})]})}),(0,m.ni)({api:m.ZM,deps:{},factory:()=>new jn}),(0,m.ni)({api:m.Kp,deps:{discoveryApi:m.NW,oauthRequestApi:m.ZM,configApi:m.Ds},factory:({discoveryApi:i,oauthRequestApi:t,configApi:o})=>xn.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})=>sn.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})=>yn.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})=>wn.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})=>cn.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})=>Gn.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})=>Ln.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})=>pe.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})=>H.create({configApi:o,discoveryApi:i,oauthRequestApi:t,environment:o.getOptionalString("auth.environment")})}),(0,m.ni)({api:Lo,deps:{discovery:m.NW,identity:m.$4,config:m.Ds},factory:({config:i,discovery:t,identity:o})=>po.create({config:i,discovery:t,identity:o})})];var ns=n(77277),dn=n(53974),Rs=n(71597);function y({children:i}){return(0,V.GV)()?(0,p.jsx)(p.Fragment,{children:i}):(0,p.jsx)(V.VA,{children:i})}const j=()=>(0,p.jsx)(dn.mf,{status:"404",statusMessage:"PAGE NOT FOUND"}),L=({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)(y,{children:(0,p.jsx)(dn.mf,{status:"501",statusMessage:o})})},P=({error:i,resetError:t,plugin:o})=>{var a;return(0,p.jsx)(dn.yu,{title:`Error in ${(a=o)===null||a===void 0?void 0:a.getId()}`,defaultExpanded:!0,error:i,children:(0,p.jsx)(ns.Z,{variant:"outlined",onClick:t,children:"Retry"})})},ae={Progress:dn.Ex,Router:Rs.VK,NotFoundErrorPage:j,BootErrorPage:L,ErrorBoundaryFallback:P};var re=n(43642),_=n(80079),ue=n(90941),Ee=n(32915),Re=n(40562),ze=n(21853),Fe=n(60744),We=n(66569),it=n(30254),Et=n(13384),De=n(15933),He=n(58838),Tt=n(86737),tn=n(4989),An=n(44407),Ot=n(18628),Pt=n(84219),Kt=n(98685),Tn=n(39781),hr=n(39412);const Tr={brokenImage:_.Z,catalog:Ot.Z,scaffolder:Ee.Z,techdocs:Re.Z,search:ze.Z,chat:Fe.Z,dashboard:We.Z,docs:it.Z,email:Et.Z,github:He.Z,group:Pt.Z,help:Tt.Z,"kind:api":De.Z,"kind:component":An.Z,"kind:domain":re.Z,"kind:group":Pt.Z,"kind:location":tn.Z,"kind:system":ue.Z,"kind:user":Kt.Z,"kind:resource":hr.Z,user:Kt.Z,warning:Tn.Z};var Yr=n(73689),zn=n(77349);const mn={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")`},Bn={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 mr(i){var t;const{colors:o,shape:a,options:d}=i,B=`linear-gradient(90deg, ${(o.length===1?[o[0],o[0]]:o).join(", ")})`,Z=`${a}, ${B}`;var oe;const me=(oe=(t=d)===null||t===void 0?void 0:t.fontColor)!==null&&oe!==void 0?oe:"#FFFFFF";return{colors:o,shape:a,backgroundImage:Z,fontColor:me}}const ui={home:mr({colors:Bn.teal,shape:mn.wave}),documentation:mr({colors:Bn.pinkSea,shape:mn.wave2}),tool:mr({colors:Bn.purpleSky,shape:mn.round}),service:mr({colors:Bn.marineBlue,shape:mn.wave}),website:mr({colors:Bn.veryBlue,shape:mn.wave}),library:mr({colors:Bn.rubyRed,shape:mn.wave}),other:mr({colors:Bn.darkGrey,shape:mn.wave}),app:mr({colors:Bn.toastyOrange,shape:mn.wave}),apis:mr({colors:Bn.teal,shape:mn.wave2}),card:mr({colors:Bn.greens,shape:mn.wave})},hi=16,xa='"Helvetica Neue", Helvetica, Roboto, Arial, sans-serif',pi="home";function Is(i){const{palette:t,htmlFontSize:o=hi,fontFamily:a=xa,defaultPageTheme:d=pi,pageTheme:S=ui,typography:B}=i;if(!S[d])throw new Error(`${d} is not defined in pageTheme.`);const Z={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 oe;return{palette:t,typography:B!=null?B:Z,page:S[d],getPageTheme:({themeId:me})=>(oe=S[me])!==null&&oe!==void 0?oe:S[d]}}var Ps=n(47591);const go={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,Ps._j)(i.palette.link,.3),background:(0,Ps.$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"}}},oo=i=>(...t)=>{const o=t.length===0?[1]:t,a=(d,S)=>typeof d=="string"?d:S*d;return o.map(d=>{const S=a(d,i);return typeof S=="number"?`${S}px`:S}).join(" ")};function fi(i,t){if(!t||typeof t=="string")return;const o=typeof t=="function"?t(i):t;if(o)return{"@global":o}}function Ls(i,t){if(!(!t||typeof t=="string")){if(typeof t=="object"){const o={...i},a=i.spacing(1);return typeof a=="number"&&(o.spacing=oo(a)),Object.fromEntries(Object.entries(t).map(([d,S])=>typeof S=="function"?[d,S({theme:o})]:[d,S]))}return t}}const gi=/^&.Mui-([\w-]+)$/;function Os(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 d of Object.keys(a)){const S=d,B=S.match(gi);if(B){const[,Z]=B,{[S]:oe,...me}=a;oe&&(t={...t,[o]:me,[Z]:oe})}}}return t}function rs(i,t={}){const o={},a={};for(const d of Object.keys(t)){const S=t[d];S&&("styleOverrides"in S&&(d==="MuiCssBaseline"?o[d]=fi(i,S.styleOverrides):o[d]=Os(Ls(i,S.styleOverrides))),"defaultProps"in S&&(a[d]=S.defaultProps))}return{overrides:o,props:a}}var mo=new WeakMap;class mi{getTheme(t){return(0,Yn._)(this,mo).get(t)}constructor(t,o){(0,zr._)(this,mo,{writable:!0,value:new Map}),(0,jr._)(this,mo,new Map),t&&(0,Yn._)(this,mo).set("v4",t),o&&(0,Yn._)(this,mo).set("v5",o)}}function ks(i){const t=Is(i),o={...go,...i.components},a=(0,zn.Z)({...t,components:o}),d=rs(a,o),S={...(0,Yr.Z)(t),...d};return new mi(S,a)}function vi(i){const t=adaptV4Theme(i),o=createTheme(i);return new mi(o,t)}const ko={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"}}},or={light:ks({palette:ko.light}),dark:ks({palette:ko.dark})};var ba=n(68542);ba.Z.configure(i=>`v5-${i}`);var Sa=n(87561),Ca=n(12536),wa=n(19219),ja=n(41547),Ea=n(3493),Aa=n(81887);const Ta=(0,Ca.Z)({productionPrefix:"jss4-"});function vo(i){const{children:t,theme:o,noCssBaseline:a=!1}=i,d=o.getTheme("v4"),S=o.getTheme("v5");let B;a||(B=(0,p.jsx)(Sa.ZP,{}));let Z=(0,p.jsxs)(p.Fragment,{children:[B,t]});return d&&(Z=(0,p.jsx)(wa.ZP,{generateClassName:Ta,children:(0,p.jsx)(ja.Z,{theme:d,children:Z})})),S&&(Z=(0,p.jsx)(Ea.Z,{injectFirst:!0,children:(0,p.jsx)(Aa.Z,{theme:S,children:Z})})),Z}function Ra(i){var t,o,a,d;return{props:{MuiGrid:(o=go)===null||o===void 0||(t=o.MuiGrid)===null||t===void 0?void 0:t.defaultProps,MuiSwitch:(d=go)===null||d===void 0||(a=d.MuiSwitch)===null||a===void 0?void 0:a.defaultProps},...Is(i)}}function Ia(i){return rs(i,go).overrides}function Bs(i){const t=Ra(i),o=(0,Yr.Z)(t),a=Ia(o);return{...o,overrides:a}}const Pa=Bs({palette:ko.light}),$s=Bs({palette:ko.dark});var yi=n(98192),xi=n(15222);const bi=[{id:"light",title:"Light Theme",variant:"light",icon:(0,p.jsx)(xi.Z,{}),Provider:({children:i})=>(0,p.jsx)(vo,{theme:or.light,children:i})},{id:"dark",title:"Dark Theme",variant:"dark",icon:(0,p.jsx)(yi.Z,{}),Provider:({children:i})=>(0,p.jsx)(vo,{theme:or.dark,children:i})}];function os(i){var t,o,a,d,S,B,Z,oe,me,Me,Te,Ze;return co({...i,apis:(me=(t=i)===null||t===void 0?void 0:t.apis)!==null&&me!==void 0?me:[],bindRoutes:(o=i)===null||o===void 0?void 0:o.bindRoutes,components:{...ae,...(a=i)===null||a===void 0?void 0:a.components},configLoader:(d=i)===null||d===void 0?void 0:d.configLoader,defaultApis:ts,icons:{...Tr,...(S=i)===null||S===void 0?void 0:S.icons},plugins:(Me=(B=i)===null||B===void 0?void 0:B.plugins)!==null&&Me!==void 0?Me:[],featureFlags:(Te=(Z=i)===null||Z===void 0?void 0:Z.featureFlags)!==null&&Te!==void 0?Te:[],themes:(Ze=(oe=i)===null||oe===void 0?void 0:oe.themes)!==null&&Ze!==void 0?Ze:bi})}var er=n(25271),Bo=n(76635);async function Si({storageApi:i}){const t=i.forBucket("settings"),o=i.forBucket("starredEntities"),a=t.snapshot("starredEntities").value;if(!(0,Bo.isArray)(a))return;var d;const S=new Set((d=o.snapshot("entityRefs").value)!==null&&d!==void 0?d:[]);a.filter(Bo.isString).map(B=>B.split(":")).filter(B=>B.length===4&&B[0]==="entity").map(([B,Z,oe,me])=>(0,er.eE)({kind:Z,namespace:oe,name:me})).forEach(B=>S.add(B)),await o.set("entityRefs",Array.from(S)),await t.remove("starredEntities")}class Ds{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(Ne())(a=>(a.next(new Set(this.starredEntities)),this.subscribers.add(a),()=>{this.subscribers.delete(a)}))),Si(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 d;this.starredEntities=new Set((d=a.value)!==null&&d!==void 0?d:[]),this.notifyChanges()}})}}var La=n(8799),so=n(79692),Ci=n(12420),Wn=n(39709),Oa=n(19928);function wi(){const i=useApi(catalogApiRef),{error:t,loading:o,value:a}=useAsync(async()=>await i.getEntityFacets({facets:["kind"]}).then(S=>{var B;return((B=S.facets.kind)===null||B===void 0?void 0:B.map(Z=>Z.value).sort())||[]}),[i]);return{loading:o,error:t,allKinds:a!=null?a:[]}}function Ns(i,t,o){let a=i;return t&&(a=a.filter(S=>t.some(B=>B.toLocaleLowerCase("en-US")===S.toLocaleLowerCase("en-US")))),o&&!i.some(S=>S.toLocaleLowerCase("en-US")===o.toLocaleLowerCase("en-US"))&&(a=a.concat([o])),a.sort().reduce((S,B)=>(S[B.toLocaleLowerCase("en-US")]=B,S),{})}const Fs=(0,so.Z)(i=>(0,Ci.Z)({root:{...i.typography.h4}}));function ka(i){var t;const{initialFilter:o="component",allowedKinds:a}=i,d=Fs(),{allKinds:S}=useAllKinds(),{filters:B,updateFilters:Z,queryParameters:{kind:oe}}=useEntityList(),me=useMemo(()=>[oe].flat()[0],[oe]);var Me;const[Te,Ze]=useState((Me=me!=null?me:(t=B.kind)===null||t===void 0?void 0:t.value)!==null&&Me!==void 0?Me:o);useEffect(()=>{me&&Ze(me)},[me]),useEffect(()=>{var st;if(!((st=B.kind)===null||st===void 0)&&st.value){var qt;Ze((qt=B.kind)===null||qt===void 0?void 0:qt.value)}},[B.kind]),useEffect(()=>{Z({kind:Te?new EntityKindFilter(Te):void 0})},[Te,Z]);const Ge=filterKinds(S,a,Te);return _jsx(Select,{input:_jsx(InputBase,{}),value:Te.toLocaleLowerCase("en-US"),onChange:st=>Ze(st.target.value),classes:d,children:Object.keys(Ge).map(st=>_jsx(MenuItem,{value:st,children:`${pluralize(Ge[st])}`},st))})}var Ba=n(86359),ss=n(95544),$o=n(99688),Do=n(12231),No=n(86136),Fo=n(49378),ji=n(85256),is=n(80030),as=n(61837),Ei=n(79784),Ai=n(50758),ls=n(31654),Ti=n(43054),Ri=n(65759),$a=n(49280),Ii=n(96641);function Pi(i){const{entity:t,loading:o,error:a}=(0,Ii.ce)(),{allowed:d,loading:S,error:B}=fo({permission:i,resourceRef:t?(0,er.eE)(t):void 0});return o||S?{loading:!0,allowed:!1}:a?{loading:!1,allowed:!1,error:a}:{loading:!1,allowed:d,error:B}}const cs="catalog-entity",Li=Ar({name:"catalog.entity.read",attributes:{action:"read"},resourceType:cs}),Zs=Ar({name:"catalog.entity.create",attributes:{action:"create"}}),ds=Ar({name:"catalog.entity.delete",attributes:{action:"delete"},resourceType:cs}),Oi=Ar({name:"catalog.entity.refresh",attributes:{action:"update"},resourceType:cs}),Us=Ar({name:"catalog.location.read",attributes:{action:"read"}}),ki=Ar({name:"catalog.location.create",attributes:{action:"create"}}),Bi=Ar({name:"catalog.location.delete",attributes:{action:"delete"}}),Da=[Li,Zs,ds,Oi,Us,ki,Bi];var $i=n(49166);function Ms(i){var t,o,a,d;const{unregisterEntityOptions:S,isUnregisterAllowed:B,onUnregisterEntity:Z,onClose:oe}=i,me=typeof((t=S)===null||t===void 0?void 0:t.disableUnregister)=="boolean";var Me;const Te=(Me=!B||(me?!!(!((o=S)===null||o===void 0)&&o.disableUnregister):((a=S)===null||a===void 0?void 0:a.disableUnregister)==="disable"))!==null&&Me!==void 0?Me:!1;let Ze=(0,p.jsx)(p.Fragment,{});return((d=S)===null||d===void 0?void 0:d.disableUnregister)!=="hidden"&&(Ze=(0,p.jsxs)(Do.Z,{onClick:()=>{oe(),Z()},disabled:Te,children:[(0,p.jsx)(No.Z,{children:(0,p.jsx)($i.Z,{fontSize:"small"})}),(0,p.jsx)(Fo.Z,{primary:"Unregister entity"})]})),(0,p.jsx)(p.Fragment,{children:Ze})}const Di=(0,so.Z)(i=>({button:{color:i.page.fontColor}}),{name:"PluginCatalogEntityContextMenu"});function zs(i){const{UNSTABLE_extraContextMenuItems:t,UNSTABLE_contextMenuOptions:o,onUnregisterEntity:a,onInspectEntity:d}=i,[S,B]=(0,W.useState)(),Z=Di(),me=Pi(ds).allowed,Me=qt=>{B(qt.currentTarget)},Te=()=>{B(void 0)},Ze=(0,m.h_)(m.$v),Ge=(0,W.useCallback)(()=>{window.navigator.clipboard.writeText(window.location.toString()).then(()=>Ze.post({message:"Copied!",severity:"info",display:"transient"}))},[Ze]),st=t&&[...t.map(qt=>(0,p.jsxs)(Do.Z,{onClick:()=>{Te(),qt.onClick()},children:[(0,p.jsx)(No.Z,{children:(0,p.jsx)(qt.Icon,{fontSize:"small"})}),(0,p.jsx)(Fo.Z,{primary:qt.title})]},qt.title)),(0,p.jsx)(ji.Z,{},"the divider is here!")];return(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)(is.ZP,{title:"More",arrow:!0,children:(0,p.jsx)(as.Z,{"aria-label":"more","aria-controls":"long-menu","aria-haspopup":"true","aria-expanded":!!S,role:"button",onClick:Me,"data-testid":"menu-button",className:Z.button,id:"long-menu",children:(0,p.jsx)(Ti.Z,{})})}),(0,p.jsx)(Ei.ZP,{open:Boolean(S),onClose:Te,anchorEl:S,anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"},"aria-labelledby":"long-menu",children:(0,p.jsxs)(Ai.Z,{autoFocusItem:Boolean(S),children:[st,(0,p.jsx)(Ms,{unregisterEntityOptions:o,isUnregisterAllowed:me,onUnregisterEntity:a,onClose:Te}),(0,p.jsxs)(Do.Z,{onClick:()=>{Te(),d()},children:[(0,p.jsx)(No.Z,{children:(0,p.jsx)(ls.Z,{fontSize:"small"})}),(0,p.jsx)(Fo.Z,{primary:"Inspect entity"})]}),(0,p.jsxs)(Do.Z,{onClick:()=>{Te(),Ge()},children:[(0,p.jsx)(No.Z,{children:(0,p.jsx)(Ri.Z,{fontSize:"small"})}),(0,p.jsx)(Fo.Z,{primary:"Copy entity URL"})]})]})})]})}const Ni="plugin.catalog.entityLayoutRoute",us=()=>null;(0,m.R5)(us,Ni,!0),(0,m.R5)(us,"core.gatherMountPoints",!0);function Na(i){const{entity:t,title:o}=i;return(0,p.jsxs)(ss.Z,{display:"inline-flex",alignItems:"center",height:"1em",maxWidth:"100%",children:[(0,p.jsx)(ss.Z,{component:"span",textOverflow:"ellipsis",whiteSpace:"nowrap",overflow:"hidden",children:o}),t&&(0,p.jsx)(Wn.LH,{entity:t})]})}function Fi(i,t,o,a){var d,S,B,Z,oe;const me=(oe=i!=null?i:(d=a)===null||d===void 0?void 0:d.kind)!==null&&oe!==void 0?oe:"";var Me;const Te=(Me=t!=null?t:(S=a)===null||S===void 0?void 0:S.metadata.namespace)!==null&&Me!==void 0?Me:"";var Ze,Ge,st;return{headerTitle:`${(st=(Ge=(Ze=(B=a)===null||B===void 0?void 0:B.metadata.title)!==null&&Ze!==void 0?Ze:o)!==null&&Ge!==void 0?Ge:(Z=a)===null||Z===void 0?void 0:Z.metadata.name)!==null&&st!==void 0?st:""}${Te&&Te!==er.zG?` in ${Te}`:""}`,headerType:(()=>{let Ht=me.toLocaleLowerCase("en-US");return a&&a.spec&&"type"in a.spec&&(Ht+=" \u2014 ",Ht+=a.spec.type.toLocaleLowerCase("en-US")),Ht})()}}function Zi(i){var t;const{entity:o}=i,a=(0,Wn.hF)(o,er.S4);return(0,p.jsxs)(p.Fragment,{children:[a.length>0&&(0,p.jsx)(dn.i9,{label:"Owner",value:(0,p.jsx)(Wn.rI,{entityRefs:a,defaultKind:"Group",color:"inherit"})}),((t=o.spec)===null||t===void 0?void 0:t.lifecycle)&&(0,p.jsx)(dn.i9,{label:"Lifecycle",value:o.spec.lifecycle})]})}const Ui=i=>{var t,o,a;const{UNSTABLE_extraContextMenuItems:d,UNSTABLE_contextMenuOptions:S,children:B,NotFoundComponent:Z}=i,{kind:oe,namespace:me,name:Me}=(0,m.Oi)(Wn.wi),{entity:Te,loading:Ze,error:Ge}=(0,Wn.ce)(),st=(0,V.TH)(),qt=(0,m.vJ)(B,Or=>Or.selectByComponentData({key:Ni,withStrictError:"Child of EntityLayout must be an EntityLayout.Route"}).getElements().flatMap(({props:On})=>{if(Te){if(On.if&&!On.if(Te))return[]}else return[];return[{path:On.path,title:On.title,children:On.children,tabProps:On.tabProps}]}),[Te]),{headerTitle:Ht,headerType:nr}=Fi(oe,me,Me,Te),[Ur,pr]=(0,W.useState)(!1),[yr,xr]=(0,W.useState)(!1),Zn=(0,V.s0)(),Pr=async()=>{pr(!1),xr(!1),Zn("/")};(0,W.useEffect)(()=>{pr(!1),xr(!1)},[st.pathname]);var Lr;return(0,p.jsxs)(dn.T3,{themeId:(Lr=(a=Te)===null||a===void 0||(o=a.spec)===null||o===void 0||(t=o.type)===null||t===void 0?void 0:t.toString())!==null&&Lr!==void 0?Lr:"home",children:[(0,p.jsx)(dn.h4,{title:(0,p.jsx)(Na,{title:Ht,entity:Te}),pageTitleOverride:Ht,type:nr,children:Te&&(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)(Zi,{entity:Te}),(0,p.jsx)(zs,{UNSTABLE_extraContextMenuItems:d,UNSTABLE_contextMenuOptions:S,onUnregisterEntity:()=>pr(!0),onInspectEntity:()=>xr(!0)})]})}),Ze&&(0,p.jsx)(dn.Ex,{}),Te&&(0,p.jsx)(dn.tn,{routes:qt}),Ge&&(0,p.jsx)(dn.VY,{children:(0,p.jsx)($o.Z,{severity:"error",children:Ge.toString()})}),!Ze&&!Ge&&!Te&&(0,p.jsx)(dn.VY,{children:Z||(0,p.jsxs)(dn.GB,{title:"Entity not found",children:["There is no ",oe," with the requested"," ",(0,p.jsx)(dn.rU,{to:"https://backstage.io/docs/features/software-catalog/references",children:"kind, namespace, and name"}),"."]})}),(0,p.jsx)(Wn.pp,{open:Ur,entity:Te,onConfirm:Pr,onClose:()=>pr(!1)}),(0,p.jsx)(Wn.U_,{open:yr,entity:Te,onClose:()=>xr(!1)})]})};Ui.Route=us;function Fa(i){const{open:t,onClose:o,onConfirm:a,entity:d}=i,[S,B]=useState(!1),Z=useApi(catalogApiRef),oe=useApi(alertApiRef),me=async()=>{B(!0);try{const Me=d.metadata.uid;await Z.removeEntityByUid(Me),a()}catch(Me){assertError(Me),oe.post({message:Me.message})}finally{B(!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:S,onClick:me,children:"Delete"}),_jsx(Button,{onClick:o,color:"primary",children:"Cancel"})]})]})}var yo=n(19625);function Za(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 Ua(){const i=useNavigate(),t=useRouteRef(rootRouteRef),[o,a]=useState(!1),{entity:d}=useEntity(),S=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:d,onConfirm:S,onClose:()=>a(!1)})]})}async function Ws(i,t){var o,a;const d=(o=i.relations)===null||o===void 0?void 0:o.map(B=>B.targetRef);if(!d||((a=d)===null||a===void 0?void 0:a.length)<1||d.length>1e3)return[];const S=await t.getEntitiesByRefs({entityRefs:d,fields:["kind","metadata.name","metadata.namespace"]});return d.filter((B,Z)=>S.items[Z]===void 0)}async function Ma(i,t){const o=t.apis.get(catalogApiRef);if(!o)throw new Error(`No implementation available for ${catalogApiRef}`);return(await Ws(i,o)).length>0}function za(){const{entity:i}=useEntity(),t=useApi(catalogApiRef),{loading:o,error:a,value:d}=useAsync(async()=>Ws(i,t),[i,t]);return a?_jsx(Box,{mb:1,children:_jsx(ResponseErrorPanel,{error:a})}):o||!d||d.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: ",d.join(", ")]})})}var hs=n(4791);const Mi=i=>i.error&&i.level==="error"&&i.type===ENTITY_STATUS_CATALOG_PROCESSING_TYPE;async function xo(i,t){return{items:(await t.getEntityAncestors({entityRef:i})).items.map(d=>{var S,B;return{errors:((B=(S=d.entity.status)===null||S===void 0?void 0:S.items)!==null&&B!==void 0?B:[]).filter(Mi).map(me=>me.error).filter(me=>Boolean(me)),entity:d.entity}}).filter(d=>d.errors.length>0)}}async function zi(i,t){const o=t.apis.get(catalogApiRef);if(!o)throw new Error(`No implementation available for ${catalogApiRef}`);return(await xo(stringifyEntityRef(i),o)).items.length>0}function Wi(){const{entity:i}=useEntity(),t=stringifyEntityRef(i),o=useApi(catalogApiRef),{loading:a,error:d,value:S}=useAsync(async()=>xo(t,o),[t,o]);return d?_jsx(Box,{mb:1,children:_jsx(ResponseErrorPanel,{error:d})}):a||!S?null:_jsx(_Fragment,{children:S.items.map((B,Z)=>_jsxs(Box,{mb:1,children:[stringifyEntityRef(i)!==stringifyEntityRef(B.entity)&&_jsxs(Box,{p:1,children:["The error below originates from"," ",_jsx(EntityRefLink,{entityRef:B.entity})]}),B.errors.map((oe,me)=>_jsx(ResponseErrorPanel,{error:oe},me))]},Z))})}const vr="core.backstage.entitySwitch",Vs=i=>null;(0,m.R5)(Vs,vr,!0);const Hs=i=>{var t;const{entity:o,loading:a}=(0,Wn.ce)(),d=(0,m.I_)(),S=(0,m.vJ)(i.children,oe=>oe.selectByComponentData({key:vr,withStrictError:"Child of EntitySwitch is not an EntitySwitch.Case"}).getElements().flatMap(me=>{var Me;if(a&&!o)return[];const{if:Te,children:Ze}=me.props;return o?[{if:(Me=Te)===null||Me===void 0?void 0:Me(o,{apis:d}),children:Ze}]:[{if:Te===void 0,children:Ze}]}),[d,o,a]);if(S.some(oe=>typeof oe.if=="object"&&"then"in oe.if))return(0,p.jsx)(Vi,{results:S,renderMultipleMatches:i.renderMultipleMatches});if(i.renderMultipleMatches==="all"){const oe=S.filter(me=>me.if).map(me=>me.children);return oe.length===0?ps(S):(0,p.jsx)(p.Fragment,{children:oe})}var Z;return(Z=(t=S.find(oe=>oe.if))===null||t===void 0?void 0:t.children)!==null&&Z!==void 0?Z:ps(S)};function Vi({results:i,renderMultipleMatches:t}){const{loading:o,value:a}=(0,Nr.default)(async()=>{const d=i.map(async({if:B,children:Z})=>{try{if(await B)return Z}catch{}return null});if(t==="all"){const B=(await Promise.all(d)).filter(Boolean);return B.length===0?ps(i):(0,p.jsx)(p.Fragment,{children:B})}var S;return(S=(await Promise.all(d)).find(Boolean))!==null&&S!==void 0?S:ps(i)},[i]);return o||!a?null:a}function ps(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}Hs.Case=Vs;const Rr=null,Hi=Wn._i.Filters,Wa=Wn._i.Content;var Va=n(85877),Gi=n(15096);const Jn=(0,m.rx)({id:"catalog",apis:[(0,m.ni)({api:Wn.Ah,deps:{discoveryApi:m.NW,fetchApi:m.gP},factory:({discoveryApi:i,fetchApi:t})=>new hs.MS({discoveryApi:i,fetchApi:t})}),(0,m.ni)({api:Wn.p3,deps:{storageApi:m.E6},factory:({storageApi:i})=>new Ds({storageApi:i})})],routes:{catalogIndex:yo._Z,catalogEntity:Wn.wi},externalRoutes:{createComponent:yo.yw,viewTechDoc:yo.jU,createFromTemplate:yo.ql},__experimentalConfigure(i){return{...{createButtonTitle:"Create"},...i}}}),fs=Jn.provide((0,m.P4)({name:"CatalogIndexPage",component:()=>n.e(9323).then(n.bind(n,89323)).then(i=>i.CatalogPage),mountPoint:yo._Z})),Gs=Jn.provide((0,m.P4)({name:"CatalogEntityPage",component:()=>n.e(8951).then(n.bind(n,78951)).then(i=>i.CatalogEntityPage),mountPoint:Wn.wi})),Ki=Jn.provide((0,m.CO)({name:"EntityAboutCard",component:{lazy:()=>Promise.resolve().then(n.bind(n,8799)).then(i=>i.AboutCard)}})),Yi=Jn.provide((0,m.CO)({name:"EntityLinksCard",component:{lazy:()=>n.e(7750).then(n.bind(n,17750)).then(i=>i.EntityLinksCard)}})),Ji=Jn.provide((0,m.CO)({name:"EntityLabelsCard",component:{lazy:()=>Promise.resolve().then(n.bind(n,85877)).then(i=>i.EntityLabelsCard)}})),Ks=Jn.provide((0,m.CO)({name:"EntityHasSystemsCard",component:{lazy:()=>n.e(5458).then(n.bind(n,5458)).then(i=>i.HasSystemsCard)}})),Ha=Jn.provide((0,m.CO)({name:"EntityHasComponentsCard",component:{lazy:()=>n.e(1105).then(n.bind(n,1105)).then(i=>i.HasComponentsCard)}})),Ga=Jn.provide((0,m.CO)({name:"EntityHasSubcomponentsCard",component:{lazy:()=>n.e(2440).then(n.bind(n,82440)).then(i=>i.HasSubcomponentsCard)}})),Qi=Jn.provide((0,m.CO)({name:"EntityHasResourcesCard",component:{lazy:()=>n.e(9770).then(n.bind(n,79770)).then(i=>i.HasResourcesCard)}})),Xi=Jn.provide((0,m.CO)({name:"EntityDependsOnComponentsCard",component:{lazy:()=>n.e(9545).then(n.bind(n,19545)).then(i=>i.DependsOnComponentsCard)}})),_i=Jn.provide((0,m.CO)({name:"EntityDependencyOfComponentsCard",component:{lazy:()=>n.e(184).then(n.bind(n,40184)).then(i=>i.DependencyOfComponentsCard)}})),Ka=Jn.provide((0,m.CO)({name:"EntityDependsOnResourcesCard",component:{lazy:()=>n.e(1032).then(n.bind(n,81032)).then(i=>i.DependsOnResourcesCard)}})),gs=Jn.provide((0,m.CO)({name:"RelatedEntitiesCard",component:{lazy:()=>n.e(732).then(n.bind(n,732)).then(i=>i.RelatedEntitiesCard)}})),Ya=Jn.provide((0,Gi.E5)({name:"CatalogSearchResultListItem",component:()=>n.e(7670).then(n.bind(n,27670)).then(i=>i.CatalogSearchResultListItem),predicate:i=>i.type==="software-catalog"}));var Ys=n(32838);class Js{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 d=`${await this.getApiOrigin()}/${o}`,S=await fetch(`${d.endsWith("/")?d:`${d}/`}index.html`);if(S.status===404)throw new Error("Page not found");return S.text()}async syncEntityDocs(t){return"cached"}async getBaseUrl(t,o,a){const d=await this.getApiOrigin();return new URL(t,`${d}/${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 Qs{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 qi=[(0,m.ni)({api:U.Dl,deps:{configApi:m.Ds,discoveryApi:m.NW,identityApi:m.$4},factory:({configApi:i,discoveryApi:t,identityApi:o})=>new Js({configApi:i,discoveryApi:t,identityApi:o})}),(0,m.ni)({api:U.gT,deps:{configApi:m.Ds,discoveryApi:m.NW,identityApi:m.$4},factory:({configApi:i,discoveryApi:t,identityApi:o})=>new Qs({configApi:i,discoveryApi:t,identityApi:o})}),(0,m.ni)({api:Ys.q3,deps:{configApi:m.Ds},factory:({configApi:i})=>Ys.ae.fromConfig(i)})],ea={backend:{baseUrl:"http://localhost:3000"},techdocs:{builder:"external"}},ta={backend:{baseUrl:"http://localhost:7007"},techdocs:{builder:"external"}};async function Xs(){const i=await fetch("/.detect");return i.ok?(await i.text()).trim()==="techdocs-cli-server":!1}async function na(){const i=await Kr(),t=await Xs();return[...i,{context:"detected",data:t?ea:ta}]}var Zo=n(58845);const _s=(0,so.Z)({svg:{width:"auto",height:30},path:{fill:"#7df3e1"}});var ei=()=>{const i=_s();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 ra=(0,so.Z)({svg:{width:"auto",height:28},path:{fill:"#7df3e1"}});var ti=()=>{const i=ra();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 tr=(0,so.Z)({root:{width:dn.po.drawerWidthClosed,height:3*dn.po.logoHeight,display:"flex",flexFlow:"row nowrap",alignItems:"center",marginBottom:-14},link:{width:dn.po.drawerWidthClosed,marginLeft:24}}),sa=()=>{const i=tr(),{isOpen:t}=(0,dn.mZ)();return(0,p.jsx)("div",{className:i.root,children:(0,p.jsx)(dn.rU,{to:"/docs/default/component/local/",underline:"none",className:i.link,children:t?(0,p.jsx)(ei,{}):(0,p.jsx)(ti,{})})})},ia=({children:i})=>(0,p.jsxs)(dn.tR,{children:[(0,p.jsxs)(dn.YE,{children:[(0,p.jsx)(sa,{}),(0,p.jsx)(dn.v7,{}),(0,p.jsx)(dn.R6,{icon:Zo.Z,to:"/docs/default/component/local",text:"Docs Preview"})]}),i]});var aa=n(32388),ni=n(4142);const la=(0,so.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 Ir;(function(i){i.LIGHT="light",i.DARK="dark"})(Ir||(Ir={}));const ms=()=>{const i=(0,m.h_)(m.hg),t=la(),[o,a]=(0,W.useState)(i.getActiveThemeId()===Ir.DARK?Ir.DARK:Ir.LIGHT),d={[Ir.LIGHT]:{icon:ni.Z,title:"Dark theme"},[Ir.DARK]:{icon:aa.Z,title:"Light theme"}},{title:S,icon:B}=d[o],Z=()=>{a(oe=>{const me=oe===Ir.LIGHT?Ir.DARK:Ir.LIGHT;return i.setActiveThemeId(me),me})};return(0,p.jsx)(ss.Z,{display:"flex",alignItems:"center",mr:2,children:(0,p.jsx)(is.ZP,{title:S,arrow:!0,children:(0,p.jsx)(as.Z,{size:"small",onClick:Z,children:(0,p.jsx)(B,{className:t.headerIcon})})})})},ca=()=>(0,p.jsxs)(w.I6,{children:[(0,p.jsx)(de.S,{}),(0,p.jsx)(D.F,{withSearch:!1})]}),da=(0,p.jsx)(ca,{}),ri=os({apis:qi,configLoader:na,plugins:Object.values(r)}),Uo=ri.getProvider(),ua=ri.getRouter(),ha=w.s4.provide((0,U.KY)({name:"ThemeToggleAddon",component:ms,location:U.oZ.Header})),oi=(0,p.jsxs)(ws,{children:[(0,p.jsx)(V.Fg,{to:"/docs/default/component/local/"},"/"),(0,p.jsx)(V.AW,{path:"/catalog/:namespace/:kind/:name",element:(0,p.jsx)(Gs,{})}),(0,p.jsx)(V.AW,{path:"/docs",element:(0,p.jsx)(w.Jl,{}),children:(0,p.jsx)(X.u,{})}),(0,p.jsxs)(V.AW,{path:"/docs/:namespace/:kind/:name/*",element:(0,p.jsx)(w.I6,{}),children:[da,(0,p.jsx)(U.DR,{children:(0,p.jsx)(ha,{})})]})]});var Xa=()=>(0,p.jsx)(Uo,{children:(0,p.jsx)(ua,{children:(0,p.jsx)(ia,{children:oi})})});f.render((0,p.jsx)(Xa,{}),document.getElementById("root"))},51837:function(Lt,Le,n){"use strict";n.d(Le,{CT:function(){return m},EI:function(){return ye},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(),W=le=>`__@backstage/${le}__`;function f(le,z){const de=W(le);let D=p[de];return D||(D=z(),p[de]=D,D)}var V=n(2784);function m(le){return f(le,()=>(0,V.createContext)(void 0))}function h(le){return(0,V.useContext)(m(le))}function F(le){return{set(z){globalThis[`__@backstage/${le}__`]=createContext(createVersionedValueMap(z))},reset(){delete globalThis[`__@backstage/${le}__`]}}}function ye(le){Object.freeze(le);const z={atVersion(de){return le[de]}};return Object.defineProperty(z,"$map",{configurable:!0,enumerable:!0,get(){return le}}),z}},96641:function(Lt,Le,n){"use strict";n.d(Le,{X2:function(){return ye},ce:function(){return le},h$:function(){return h}});var r=n(52322),p=n(25271),W=n(60871),f=n(51837),V=n(2784);const m=(0,f.CT)("entity-context"),h=z=>{const{children:de,entity:D,loading:E,error:se,refresh:ie}=z,ne={entity:D,loading:E,error:se,refresh:ie};return(0,r.jsx)(m.Provider,{value:(0,f.EI)({1:ne}),children:(0,r.jsx)(W.fC,{attributes:{...D?{entityRef:(0,p.eE)(D)}:void 0},children:de})})},F=z=>_jsx(h,{entity:z.entity,loading:!Boolean(z.entity),error:void 0,refresh:void 0,children:z.children});function ye(){const z=(0,f.Vt)("entity-context");if(!z)throw new Error("Entity context is not available");const de=z.atVersion(1);if(!de)throw new Error("EntityContext v1 not available");if(!de.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:de.entity}}function le(){const z=(0,f.Vt)("entity-context");if(!z)throw new Error("Entity context is not available");const de=z.atVersion(1);if(!de)throw new Error("EntityContext v1 not available");const{entity:D,loading:E,error:se,refresh:ie}=de;return{entity:D,loading:E,error:se,refresh:ie}}},39709:function(Lt,Le,n){"use strict";n.d(Le,{h$:function(){return ct.h$},n3:function(){return r.n3},_i:function(){return K},tW:function(){return _e},df:function(){return $e},UO:function(){return ht},ph:function(){return dn},dq:function(){return wt},nl:function(){return ts},dx:function(){return xt},rI:function(){return Qt},u3:function(){return Yn},xE:function(){return jr},sL:function(){return Nr},LH:function(){return ve},U_:function(){return no},pp:function(){return ro},EW:function(){return Oo},Ah:function(){return W},wi:function(){return Be},hF:function(){return U.hF},CV:function(){return U.CV},$3:function(){return rn},p3:function(){return f},ce:function(){return ct.ce},X2:function(){return ct.X2},wp:function(){return rt},ZW:function(){return Cn},eK:function(){return Ct},CR:function(){return cn}});var r=n(4791),p=n(60871);const W=(0,p.T0)({id:"plugin.catalog.service"}),f=(0,p.T0)({id:"catalog-react.starred-entities"});var V=n(82394);class m{async toggleStarred(j){this.starredEntities.delete(j)||this.starredEntities.add(j);for(const L of this.subscribers)L.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(j=>(j.next(new Set(this.starredEntities)),this.subscribers.add(j),()=>{this.subscribers.delete(j)})))}}var h=n(52322),F=n(2784),ye=n(41156),le=n(60364),z=n(77277),de=n(4190),D=n(95544),E=n(90436),se=n(60905),ie=n(36444);const ne=y=>{var j,L;const P=(0,ye.Z)(Ee=>{var Re;return Ee.breakpoints.down((L=(Re=y.options)===null||Re===void 0?void 0:Re.drawerBreakpoint)!==null&&L!==void 0?L:"md")}),ae=(0,le.Z)(),[re,_]=(0,F.useState)(!1);var ue;return P?(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(z.Z,{style:{marginTop:ae.spacing(1),marginLeft:ae.spacing(1)},onClick:()=>_(!0),startIcon:(0,h.jsx)(ie.Z,{}),children:"Filters"}),(0,h.jsx)(de.ZP,{open:re,onClose:()=>_(!1),anchor:(ue=(j=y.options)===null||j===void 0?void 0:j.drawerAnchor)!==null&&ue!==void 0?ue:"left",disableAutoFocus:!0,keepMounted:!0,variant:"temporary",children:(0,h.jsxs)(D.Z,{m:2,children:[(0,h.jsx)(E.Z,{variant:"h6",component:"h2",style:{marginBottom:ae.spacing(1)},children:"Filters"}),y.children]})})]}):(0,h.jsx)(se.Z,{item:!0,lg:2,children:y.children})},X=y=>(0,h.jsx)(se.Z,{item:!0,xs:12,lg:10,children:y.children}),K=y=>(0,h.jsx)(se.Z,{container:!0,style:{position:"relative"},children:y.children});K.Filters=ne,K.Content=X;var R=n(53974),w=n(87612),I=n(25271),U=n(49280);class xe{getCatalogFilters(){return{kind:this.value}}toQueryValue(){return this.value}constructor(j){(0,w._)(this,"value",void 0),this.value=j}}class Se{getTypes(){return Array.isArray(this.value)?this.value:[this.value]}getCatalogFilters(){return{"spec.type":this.getTypes()}}toQueryValue(){return this.getTypes()}constructor(j){(0,w._)(this,"value",void 0),this.value=j}}class k{filterEntity(j){var L;return this.values.every(P=>((L=j.metadata.tags)!==null&&L!==void 0?L:[]).includes(P))}toQueryValue(){return this.values}constructor(j){(0,w._)(this,"values",void 0),this.values=j}}class Ke{filterEntity(j){const L=this.toUpperArray(this.value.split(/\s/)),P=this.toUpperArray([j.metadata.tags]),ae=this.toUpperArray([j.metadata.name,j.metadata.title]);for(const re of L)if(P.every(_=>_!==re)&&ae.every(_=>!_.includes(re)))return!1;return!0}toUpperArray(j){return j.flat().filter(L=>Boolean(L)).map(L=>L.toLocaleUpperCase("en-US"))}constructor(j){_define_property(this,"value",void 0),this.value=j}}class yt{filterEntity(j){return this.values.some(L=>(0,U.hF)(j,I.S4).some(P=>(0,I.eE)(P)===L))}toQueryValue(){return this.values}constructor(j){(0,w._)(this,"values",void 0),this.values=j.reduce((L,P)=>{try{return L.push((0,I.eE)((0,I.of)(P,{defaultKind:"Group"}))),L}catch{return L}},[])}}class $t{filterEntity(j){return this.values.some(L=>{var P;return((P=j.spec)===null||P===void 0?void 0:P.lifecycle)===L})}toQueryValue(){return this.values}constructor(j){(0,w._)(this,"values",void 0),this.values=j}}class zt{filterEntity(j){return this.values.some(L=>j.metadata.namespace===L)}toQueryValue(){return this.values}constructor(j){(0,w._)(this,"values",void 0),this.values=j}}class Rt{filterEntity(j){switch(this.value){case"owned":return this.isOwnedEntity(j);case"starred":return this.isStarredEntity(j);default:return!0}}toQueryValue(){return this.value}constructor(j,L,P){(0,w._)(this,"value",void 0),(0,w._)(this,"isOwnedEntity",void 0),(0,w._)(this,"isStarredEntity",void 0),this.value=j,this.isOwnedEntity=L,this.isStarredEntity=P}}class Dt{filterEntity(j){var L;const P=(L=j.metadata.annotations)===null||L===void 0?void 0:L["backstage.io/orphan"];return P!==void 0&&this.value.toString()===P}constructor(j){(0,w._)(this,"value",void 0),this.value=j}}class Yt{filterEntity(j){var L,P,ae;const re=((ae=j)===null||ae===void 0||(P=ae.status)===null||P===void 0||(L=P.items)===null||L===void 0?void 0:L.length)>0;return re!==void 0&&this.value===re}constructor(j){(0,w._)(this,"value",void 0),this.value=j}}var ct=n(96641),ut=n(76635),St=n(19126),lt=n.n(St),Zt=n(73557),Gt=n(69294),Ce=n(48760),Ne=n(90736);const Ye=(0,F.createContext)(void 0),ht=y=>{const j=(0,Ne.default)(),L=(0,p.h_)(W),[P,ae]=(0,F.useState)({}),re=(0,Zt.TH)();var _;const ue=(0,F.useMemo)(()=>(_=lt().parse(re.search,{ignoreQueryPrefix:!0}).filters)!==null&&_!==void 0?_:{},[re]),[Ee,Re]=(0,F.useState)(()=>({appliedFilters:{},entities:[],backendEntities:[]})),[{loading:ze,error:Fe},We]=(0,Gt.default)(async()=>{const De=(0,ut.compact)(Object.values(P)),He=(0,U.Gz)(De),Tt=(0,U.wq)(De),tn=(0,U.wq)((0,ut.compact)(Object.values(Ee.appliedFilters))),An=Object.keys(P).reduce((Pt,Kt)=>{var Tn;const hr=P[Kt];return!((Tn=hr)===null||Tn===void 0)&&Tn.toQueryValue&&(Pt[Kt]=hr.toQueryValue()),Pt},{});if((0,ut.isEqual)(tn,Tt))Re({appliedFilters:P,backendEntities:Ee.backendEntities,entities:Ee.backendEntities.filter(He)});else{const Pt=await L.getEntities({filter:Tt});Re({appliedFilters:P,backendEntities:Pt.items,entities:Pt.items.filter(He)})}if(j()){var Ot;const Pt=lt().parse(re.search,{ignoreQueryPrefix:!0}),Kt=lt().stringify({...Pt,filters:An},{addQueryPrefix:!0,arrayFormat:"repeat"}),Tn=`${window.location.pathname}${Kt}`;(Ot=window.history)===null||Ot===void 0||Ot.replaceState(null,document.title,Tn)}},[L,ue,P,Ee],{loading:!0});(0,Ce.Z)(We,10,[P]);const it=(0,F.useCallback)(De=>{ae(He=>{const Tt=typeof De=="function"?De(He):De;return{...He,...Tt}})},[]),Et=(0,F.useMemo)(()=>({filters:Ee.appliedFilters,entities:Ee.entities,backendEntities:Ee.backendEntities,updateFilters:it,queryParameters:ue,loading:ze,error:Fe}),[Ee,it,ue,ze,Fe]);return(0,h.jsx)(Ye.Provider,{value:Et,children:y.children})};function rt(){const y=(0,F.useContext)(Ye);if(!y)throw new Error("useEntityList must be used within EntityListProvider");return y}var et=n(64279),vt=n(18149),ot=n.n(vt),Qe=n(829),ft=n.n(Qe);function gt(){var y;const j=(0,p.h_)(W),{filters:{kind:L,type:P},queryParameters:{type:ae},updateFilters:re}=rt(),_=(0,F.useMemo)(()=>[ae].flat().filter(Boolean),[ae]);var ue;const[Ee,Re]=(0,F.useState)(_.length?_:(ue=(y=P)===null||y===void 0?void 0:y.getTypes())!==null&&ue!==void 0?ue:[]);(0,F.useEffect)(()=>{_.length&&Re(_)},[_]);const[ze,Fe]=(0,F.useState)([]),We=(0,F.useMemo)(()=>{var Tt;return(Tt=L)===null||Tt===void 0?void 0:Tt.value},[L]),{error:it,loading:Et,value:De}=(0,et.default)(async()=>We?await j.getEntityFacets({filter:{kind:We},facets:["spec.type"]}).then(tn=>tn.facets["spec.type"]||[]):[],[We,j]),He=(0,F.useRef)(De);return(0,F.useEffect)(()=>{const Tt=He.current;if(He.current=De,Et||!We||Tt===De||!De)return;const tn=[...new Set(ft()(De,Ot=>-Ot.count).map(Ot=>Ot.value.toLocaleLowerCase("en-US")))];Fe(tn);const An=Ee.filter(Ot=>tn.includes(Ot));ot()(Ee,An)||Re(An)},[Et,We,Ee,Re,De]),(0,F.useEffect)(()=>{re({type:Ee.length?new Se(Ee):void 0})},[Ee,re]),{loading:Et,error:it,availableTypes:ze,selectedTypes:Ee,setSelectedTypes:Re}}function Ct(y,j){var L,P,ae,re;const _=(P=j)===null||P===void 0||(L=P.type)===null||L===void 0?void 0:L.toLocaleLowerCase("en-US"),ue=(re=j)===null||re===void 0||(ae=re.kind)===null||ae===void 0?void 0:ae.toLocaleLowerCase("en-US"),Ee=(0,p.h_)(W),{loading:Re,value:ze,error:Fe}=(0,et.default)(async()=>{var We,it;const Et=(We=y.relations)===null||We===void 0?void 0:We.filter(He=>(!_||He.type.toLocaleLowerCase("en-US")===_)&&(!ue||(0,I.of)(He.targetRef).kind===ue));if(!(!((it=Et)===null||it===void 0)&&it.length))return[];const{items:De}=await Ee.getEntitiesByRefs({entityRefs:Et.map(He=>He.targetRef)});return De.filter(He=>Boolean(He))},[y,_,ue]);return{entities:ze,loading:Re,error:Fe}}var yn=n(72164);function hn(y){return typeof y=="string"?y:(0,I.eE)(y)}function cn(){const y=(0,p.h_)(f),j=(0,yn.Z)(y.starredEntitie$(),new Set),L=(0,F.useCallback)(ae=>j.has(hn(ae)),[j]),P=(0,F.useCallback)(ae=>y.toggleStarred(hn(ae)).then(),[y]);return{starredEntities:j,toggleStarredEntity:P,isStarredEntity:L}}function Sn(y){return typeof y=="string"?y:(0,I.eE)(y)}function pn(y){const j=(0,p.h_)(f),[L,P]=(0,F.useState)(!1);return(0,F.useEffect)(()=>{const re=j.starredEntitie$().subscribe({next(_){P(_.has(Sn(y)))}});return()=>{re.unsubscribe()}},[y,j]),{toggleStarredEntity:(0,F.useCallback)(()=>j.toggleStarred(Sn(y)).then(),[y,j]),isStarredEntity:L}}var xn=n(75435);function Cn(){const y=(0,p.h_)(p.$4),{loading:j,value:L}=(0,et.default)(async()=>{const{ownershipEntityRefs:ae}=await y.getBackstageIdentity();return ae},[]),P=(0,F.useMemo)(()=>{const ae=new Set(L!=null?L:[]);return re=>{const _=(0,xn.h)(re,I.S4).map(I.eE);for(const ue of _)if(ae.has(ue))return!0;return!1}},[L]);return(0,F.useMemo)(()=>({loading:j,isOwnedEntity:P}),[j,P])}function on(){const y=(0,p.h_)(W),{error:j,loading:L,value:P}=(0,et.default)(async()=>await y.getEntityFacets({facets:["kind"]}).then(re=>{var _;return((_=re.facets.kind)===null||_===void 0?void 0:_.map(ue=>ue.value).sort())||[]}),[y]);return{loading:L,error:j,allKinds:P!=null?P:[]}}function fn(y,j,L){let P=y;return j&&(P=P.filter(re=>j.some(_=>_.toLocaleLowerCase("en-US")===re.toLocaleLowerCase("en-US")))),L&&!y.some(re=>re.toLocaleLowerCase("en-US")===L.toLocaleLowerCase("en-US"))&&(P=P.concat([L])),P.sort().reduce((re,_)=>(re[_.toLocaleLowerCase("en-US")]=_,re),{})}function wn(y){var j;const{filters:L,queryParameters:{kind:P},updateFilters:ae}=rt(),re=(0,F.useMemo)(()=>[P].flat()[0],[P]);var _;const[ue,Ee]=(0,F.useState)((_=re!=null?re:(j=L.kind)===null||j===void 0?void 0:j.value)!==null&&_!==void 0?_:y.initialFilter);(0,F.useEffect)(()=>{re&&Ee(re)},[re]),(0,F.useEffect)(()=>{var We;if(!((We=L.kind)===null||We===void 0)&&We.value){var it;Ee((it=L.kind)===null||it===void 0?void 0:it.value)}},[L.kind]),(0,F.useEffect)(()=>{ae({kind:ue?new xe(ue):void 0})},[ue,ae]);const{allKinds:Re,loading:ze,error:Fe}=on();return{loading:ze,error:Fe,allKinds:Re!=null?Re:[],selectedKind:ue,setSelectedKind:Ee}}const _e=y=>{const{allowedKinds:j,hidden:L,initialFilter:P="component"}=y,ae=(0,p.h_)(p.$v),{error:re,allKinds:_,selectedKind:ue,setSelectedKind:Ee}=wn({initialFilter:P});if((0,F.useEffect)(()=>{re&&ae.post({message:"Failed to load entity kinds",severity:"error"})},[re,ae]),re)return null;const Re=fn(_,j,ue),ze=Object.keys(Re).map(Fe=>({value:Fe,label:Re[Fe]}));return L?null:(0,h.jsx)(D.Z,{pb:1,pt:1,children:(0,h.jsx)(R.Ph,{label:"Kind",items:ze,selected:ue.toLocaleLowerCase("en-US"),onChange:Fe=>Ee(String(Fe))})})};var Jt=n(79692),Vt=n(38016),Je=n(88013),Rn=n(21324),sn=n(5806),Nn=n(19996),In=n(25505);const Pn=(0,h.jsx)(In.Z,{fontSize:"small"}),Gn=(0,h.jsx)(Nn.Z,{fontSize:"small"});function Kn({selected:y}){return(0,h.jsx)(Rn.Z,{icon:Pn,checkedIcon:Gn,checked:y})}const Ln=(0,F.memo)(y=>{var j;const{selected:L,value:P,availableOptions:ae,showCounts:re}=y,_=re?`${P} (${(j=ae)===null||j===void 0?void 0:j[P]})`:P;return(0,h.jsx)(sn.Z,{control:(0,h.jsx)(Kn,{selected:L}),label:_,onClick:ue=>ue.preventDefault()})});var be=n(86619),pe=n(72779),Ie=n.n(pe);const H=(0,Jt.Z)({input:{}},{name:"CatalogReactEntityAutocompletePickerInput"});function N(y){const j=H();return(0,h.jsx)(be.Z,{variant:"outlined",...y,className:Ie()(j.input,y.className)})}function ce(y){var j;const{label:L,name:P,path:ae,showCounts:re,Filter:_,InputProps:ue,initialSelectedOptions:Ee=[]}=y,{updateFilters:Re,filters:ze,queryParameters:{[P]:Fe}}=rt(),We=(0,p.h_)(W),{value:it}=(0,et.default)(async()=>{var Pt;const Kt=ae,{facets:Tn}=await We.getEntityFacets({facets:[Kt],filter:(Pt=ze.kind)===null||Pt===void 0?void 0:Pt.getCatalogFilters()});return Object.fromEntries(Tn[Kt].map(({value:hr,count:Tr})=>[hr,Tr]))},[ze.kind]),Et=(0,F.useMemo)(()=>[Fe].flat().filter(Boolean),[Fe]);var De;const[He,Tt]=(0,F.useState)(Et.length?Et:(De=(j=ze[P])===null||j===void 0?void 0:j.values)!==null&&De!==void 0?De:Ee);(0,F.useEffect)(()=>{Et.length&&Tt(Et)},[Et]);const tn=Object.keys(it!=null?it:{}),An=He.length&&tn.length;(0,F.useEffect)(()=>{Re({[P]:An?new _(He):void 0})},[P,An,He,_,Re]);const Ot=ze[P];return Ot&&typeof Ot=="object"&&!("values"in Ot)||!tn.length||tn.length<=1?null:(0,h.jsx)(D.Z,{pb:1,pt:1,children:(0,h.jsxs)(E.Z,{variant:"button",component:"label",children:[L,(0,h.jsx)(Je.ZP,{multiple:!0,disableCloseOnSelect:!0,options:tn,value:He,onChange:(Pt,Kt)=>Tt(Kt),renderOption:(Pt,{selected:Kt})=>(0,h.jsx)(Ln,{selected:Kt,value:Pt,availableOptions:it,showCounts:!!re}),size:"small",popupIcon:(0,h.jsx)(Vt.Z,{"data-testid":`${String(P)}-picker-expand`}),renderInput:Pt=>(0,h.jsx)(N,{...Pt,...ue})})]})})}const Ae=(0,Jt.Z)({input:{}},{name:"CatalogReactEntityLifecyclePicker"}),$e=y=>{const{initialFilter:j=[]}=y,L=Ae();return(0,h.jsx)(ce,{label:"Lifecycle",name:"lifecycles",path:"spec.lifecycle",Filter:$t,InputProps:{className:L.input},initialSelectedOptions:j})};var qe=n(6232),It=n(98685),Bt=n(62367),nn=n(72579),ln=n.n(nn);function rn(y,j){var L,P;const ae=(L=j)===null||L===void 0?void 0:L.defaultKind;let re,_,ue;if("metadata"in y?(re=y.kind,_=y.metadata.namespace,ue=y.metadata.name):(re=y.kind,_=y.namespace,ue=y.name),(_===void 0||_==="")&&(_=I.zG),((P=j)===null||P===void 0?void 0:P.defaultNamespace)!==void 0){var Ee;((Ee=j)===null||Ee===void 0?void 0:Ee.defaultNamespace)===_&&(_=void 0)}else _===I.zG&&(_=void 0);return re=re.toLocaleLowerCase("en-US"),re=ae&&ae.toLocaleLowerCase("en-US")===re?void 0:re,`${re?`${re}:`:""}${_?`${_}/`:""}${ue}`}function ee(y,j){for(const L of["spec.profile.displayName","metadata.title"]){const P=ln()(y,L);if(P&&typeof P=="string")return P}return j}function te({enabled:y}){const j=(0,p.h_)(W),[L]=(0,F.useState)(async()=>{if(!y)return[];const P="relations.ownedBy";return j.getEntityFacets({facets:[P]}).then(ae=>ae.facets[P].map(re=>re.value).map(re=>{const{kind:_,name:ue,namespace:Ee}=(0,I.of)(re);return{apiVersion:"backstage.io/v1beta1",kind:_,metadata:{name:ue,namespace:Ee}}}).sort((re,_)=>(re.metadata.namespace||"").localeCompare(_.metadata.namespace||"","en-US")||re.metadata.name.localeCompare(_.metadata.name,"en-US")||re.kind.localeCompare(_.kind,"en-US"))).catch(()=>[])});return(0,Gt.default)(async(P,ae)=>{var re;const _=await L;if(!_)return{items:[]};var ue;const Ee=(ue=(re=ae)===null||re===void 0?void 0:re.limit)!==null&&ue!==void 0?ue:20,{text:Re,start:ze}=G(P),Fe=_.filter(it=>M(Re,it)),We=ze+Ee;return{items:Fe.slice(0,We),...O({entities:Fe,limit:We,payload:{text:Re,start:We}})}},[L],{loading:!0,value:{items:[]}})}function G(y){return v(y)&&y.cursor?JSON.parse(atob(y.cursor)):{text:y.text||"",start:0}}function v(y){return!!y.cursor}function O({entities:y,limit:j,payload:L}){return y.length>j?{cursor:btoa(JSON.stringify(L))}:{}}function M(y,j){var L;const P=y.trim();return j.kind.includes(P)||((L=j.metadata.namespace)===null||L===void 0?void 0:L.includes(P))||j.metadata.name.includes(P)}function Y(){const y=(0,p.h_)(W);return(0,Gt.default)(async(j,L)=>{var P;const ae=j,re=j;var _;const ue=(_=(P=L)===null||P===void 0?void 0:P.limit)!==null&&_!==void 0?_:20;if(re.cursor){const Re=await y.queryEntities({cursor:re.cursor,limit:ue});return{cursor:Re.pageInfo.nextCursor,items:[...re.items,...Re.items]}}const Ee=await y.queryEntities({fullTextFilter:{term:ae.text||"",fields:["metadata.name","kind","spec.profile.displayname","metadata.title"]},filter:{kind:["User","Group"]},orderFields:[{field:"metadata.name",order:"asc"}],limit:ue});return{cursor:Ee.pageInfo.nextCursor,items:Ee.items}},[],{loading:!0})}var he=n(21638);function we({mode:y,initialSelectedOwnersRefs:j}){const L=y==="owners-only",P=Y(),ae=te({enabled:L}),[re,_]=L?ae:P;return[re,_,Oe({enabled:!L,initialSelectedOwnersRefs:j})]}function Oe({enabled:y,initialSelectedOwnersRefs:j}){const L=(0,F.useRef)({}),P=(0,p.h_)(W),[,ae]=(0,Gt.default)(async()=>{(await P.getEntitiesByRefs({entityRefs:j})).items.forEach(_=>{_&&(L.current[(0,I.eE)(_)]=_)})},[]);return(0,he.n)(()=>{y&&j.length>0&&ae()}),{getEntity:re=>L.current[re],setEntity:re=>{L.current[(0,I.eE)(re)]=re}}}const Xe=(0,Jt.Z)({input:{}},{name:"CatalogReactEntityOwnerPicker"}),tt=(0,h.jsx)(In.Z,{fontSize:"small"}),mt=(0,h.jsx)(Nn.Z,{fontSize:"small"}),wt=y=>{var j,L,P;const ae=Xe(),{mode:re="owners-only"}=y||{},{updateFilters:_,filters:ue,queryParameters:{owners:Ee}}=rt(),[Re,ze]=(0,F.useState)(""),Fe=(0,F.useMemo)(()=>[Ee].flat().filter(Boolean),[Ee]);var We;const[it,Et]=(0,F.useState)(Fe.length?Fe:(We=(j=ue.owners)===null||j===void 0?void 0:j.values)!==null&&We!==void 0?We:[]),[{value:De,loading:He},Tt,tn]=we({mode:re,initialSelectedOwnersRefs:it});(0,qe.b)(()=>Tt({text:Re}),[Re,Tt],250);const An=((L=De)===null||L===void 0?void 0:L.items)||[];return(0,F.useEffect)(()=>{if(Fe.length){const Ot=new yt(Fe);Et(Ot.values)}},[Fe]),(0,F.useEffect)(()=>{_({owners:it.length?new yt(it):void 0})},[it,_]),["user","group"].includes(((P=ue.kind)===null||P===void 0?void 0:P.value.toLocaleLowerCase("en-US"))||"")?null:(0,h.jsx)(D.Z,{pb:1,pt:1,children:(0,h.jsxs)(E.Z,{variant:"button",component:"label",children:["Owner",(0,h.jsx)(Je.ZP,{multiple:!0,disableCloseOnSelect:!0,loading:He,options:An,value:it,getOptionSelected:(Ot,Pt)=>typeof Pt=="string"?(0,I.eE)(Ot)===Pt:Ot===Pt,getOptionLabel:Ot=>{const Pt=typeof Ot=="string"?tn.getEntity(Ot)||(0,I.of)(Ot,{defaultKind:"group",defaultNamespace:"default"}):Ot;return ee(Pt,rn(Pt))},onChange:(Ot,Pt)=>{ze(""),Et(Pt.map(Kt=>{const Tn=typeof Kt=="string"?Kt:(0,I.eE)(Kt);return typeof Kt!="string"&&tn.setEntity(Kt),Tn}))},filterOptions:Ot=>Ot,renderOption:(Ot,{selected:Pt})=>{const Kt=Ot.kind.toLocaleLowerCase("en-US")==="group";return(0,h.jsx)(sn.Z,{control:(0,h.jsx)(Rn.Z,{icon:tt,checkedIcon:mt,checked:Pt}),onClick:Tn=>Tn.preventDefault(),label:(0,h.jsxs)(D.Z,{display:"flex",flexWrap:"wrap",alignItems:"center",children:[Kt?(0,h.jsx)(Bt.Z,{fontSize:"small"}):(0,h.jsx)(It.Z,{fontSize:"small"}),"\xA0",ee(Ot,rn(Ot,{defaultKind:Ot.kind}))]})})},size:"small",popupIcon:(0,h.jsx)(Vt.Z,{"data-testid":"owner-picker-expand"}),renderInput:Ot=>(0,h.jsx)(be.Z,{...Ot,className:ae.input,onChange:Pt=>{ze(Pt.currentTarget.value)},variant:"outlined"}),ListboxProps:{onScroll:Ot=>{var Pt;const Kt=Ot.currentTarget;Math.abs(Kt.scrollHeight-Kt.clientHeight-Kt.scrollTop)<1&&(!((Pt=De)===null||Pt===void 0)&&Pt.cursor)&&Tt({items:De.items,cursor:De.cursor})},"data-testid":"owner-picker-listbox"}})]})})};var dt=n(51837);const Be=(0,dt.uW)("catalog:entity-route-ref",()=>(0,p.NT)({id:"catalog:entity",params:["namespace","kind","name"]}));function At(y){var j,L;return{kind:y.kind.toLocaleLowerCase("en-US"),namespace:(L=(j=y.metadata.namespace)===null||j===void 0?void 0:j.toLocaleLowerCase("en-US"))!==null&&L!==void 0?L:DEFAULT_NAMESPACE,name:y.metadata.name}}var Ut=n(80030);const xt=(0,F.forwardRef)((y,j)=>{var L;const{entityRef:P,defaultKind:ae,title:re,children:_,...ue}=y,Ee=(0,p.tg)(Be);let Re,ze,Fe;if(typeof P=="string"){const He=(0,I.of)(P);Re=He.kind,ze=He.namespace,Fe=He.name}else"metadata"in P?(Re=P.kind,ze=P.metadata.namespace,Fe=P.metadata.name):(Re=P.kind,ze=P.namespace,Fe=P.name);Re=Re.toLocaleLowerCase("en-US");var We;ze=(We=(L=ze)===null||L===void 0?void 0:L.toLocaleLowerCase("en-US"))!==null&&We!==void 0?We:I.zG;const it={kind:Re,namespace:ze,name:Fe},Et=rn({kind:Re,namespace:ze,name:Fe},{defaultKind:ae}),De=(0,h.jsxs)(R.rU,{...ue,ref:j,to:Ee(it),children:[_,!_&&(re!=null?re:Et)]});return re?(0,h.jsx)(Ut.ZP,{title:Et,children:De}):De});function Nt(y){const{entityRefs:j,defaultKind:L,getTitle:P,...ae}=y,re=(0,p.h_)(W),{value:_=new Array,loading:ue,error:Ee}=(0,et.default)(async()=>{const Re=j.reduce((Fe,We)=>typeof We=="object"&&"metadata"in We?Fe:[...Fe,(0,I.of)(We)],new Array),ze=j.filter(Fe=>typeof Fe=="object"&&"metadata"in Fe);return Re.length>0?[...(await re.getEntities({filter:Re.map(Fe=>({kind:Fe.kind,"metadata.namespace":Fe.namespace,"metadata.name":Fe.name}))})).items,...ze]:ze},[j]);return ue?(0,h.jsx)(R.Ex,{}):Ee?(0,h.jsx)(R.yu,{error:Ee}):(0,h.jsx)(h.Fragment,{children:_.map((Re,ze)=>(0,h.jsxs)(F.Fragment,{children:[ze>0&&", ",(0,h.jsx)(xt,{...ae,defaultKind:L,entityRef:Re,title:P(Re)})]},ze))})}function Qt(y){const{entityRefs:j,defaultKind:L,fetchEntities:P,getTitle:ae,...re}=y;return P?(0,h.jsx)(Nt,{...re,defaultKind:L,entityRefs:j,getTitle:ae}):(0,h.jsx)(h.Fragment,{children:j.map((_,ue)=>(0,h.jsxs)(F.Fragment,{children:[ue>0&&", ",(0,h.jsx)(xt,{...re,defaultKind:L,entityRef:_,title:ae?ae(_):void 0})]},ue))})}const jn=y=>{const j=useRouteRef(entityRouteRef);return _jsx(IconButton,{component:Link,"aria-label":"Show",title:"Show details",to:j(getCompoundEntityRef(y.entity)),children:_jsx(InfoIcon,{})})},Ft=y=>_jsx(IconButton,{component:Link,"aria-label":"Email",title:`Email ${y.email}`,to:`mailto:${y.email}`,children:_jsx(EmailIcon,{})}),bt=y=>{var j;const L=(j=y.entity.spec.profile)===null||j===void 0?void 0:j.email;return L?_jsx(EmailCardAction,{email:L}):null},jt=y=>{var j;const L=(j=y.entity.spec.profile)===null||j===void 0?void 0:j.email;return L?_jsx(EmailCardAction,{email:L}):null},Mt=(0,Jt.Z)(()=>({popoverPaper:{width:"30em"},descriptionTypography:{overflow:"hidden",textOverflow:"ellipsis",display:"-webkit-box",WebkitLineClamp:2,WebkitBoxOrient:"vertical"}})),Xt=4,lr=y=>{var j,L,P;const{entityRef:ae,children:re,delayTime:_=500}=y,ue=Mt(),Ee=useApiHolder(),Re=usePopupState({variant:"popover",popupId:"entity-peek-ahead"}),[ze,Fe]=useState(!1),We=useMemo(()=>debounce(()=>Fe(!0),_),[_]),[{loading:it,error:Et,value:De},He]=useAsyncFn(async()=>{const tn=Ee.get(catalogApiRef);if(tn){const An=await tn.getEntityByRef(ae);if(!An)throw new Error(`${ae} not found`);return An}},[Ee,ae]),Tt=()=>{Fe(!1),We.cancel()};return useEffect(()=>{Re.isOpen&&!De&&!Et&&!it&&He()},[Re.isOpen,He,De,Et,it]),_jsxs(_Fragment,{children:[_jsx(Typography,{component:"span",onMouseEnter:We,children:_jsx(Typography,{component:"span","data-testid":"trigger",...bindHover(Re),children:re})}),ze&&_jsx(HoverPopover,{PaperProps:{className:ue.popoverPaper},...bindPopover(Re),anchorOrigin:{vertical:"bottom",horizontal:"center"},transformOrigin:{vertical:"top",horizontal:"center"},onMouseLeave:Tt,children:_jsxs(Card,{children:[_jsxs(CardContent,{children:[Et&&_jsx(ResponseErrorPanel,{error:Et}),it&&_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:ue.descriptionTypography,paragraph:!0,children:De.metadata.description}),_jsx(Typography,{children:(j=De.spec)===null||j===void 0?void 0:j.type}),_jsxs(Box,{marginTop:"0.5em",children:[(De.metadata.tags||[]).slice(0,Xt).map(tn=>_jsx(Chip,{size:"small",label:tn},tn)),((L=De.metadata.tags)===null||L===void 0?void 0:L.length)&&((P=De.metadata.tags)===null||P===void 0?void 0:P.length)>Xt&&_jsx(Tooltip,{title:"Drill into the entity to see all of the tags.",children:_jsx(Chip,{size:"small",label:"..."},"other-tags")})]})]})]}),!Et&&De&&_jsx(CardActions,{children:_jsxs(_Fragment,{children:[isUserEntity(De)&&_jsx(UserCardActions,{entity:De}),isGroupEntity(De)&&_jsx(GroupCardActions,{entity:De}),_jsx(EntityCardActions,{entity:De})]})})]})})]})},Cr=(0,Jt.Z)(y=>({searchToolbar:{paddingLeft:0,paddingRight:0},input:{}}),{name:"CatalogReactEntitySearchBar"}),rr=()=>{var y;const j=Cr(),{filters:L,updateFilters:P}=useEntityList();var ae;const[re,_]=useState((ae=(y=L.text)===null||y===void 0?void 0:y.value)!==null&&ae!==void 0?ae:"");return useDebounce(()=>{P({text:re.length?new EntityTextFilter(re):void 0})},250,[re,P]),_jsx(Toolbar,{className:j.searchToolbar,children:_jsx(FormControl,{children:_jsx(Input,{"aria-label":"search",id:"input-with-icon-adornment",className:j.input,placeholder:"Search",autoComplete:"off",onChange:ue=>_(ue.target.value),value:re,startAdornment:_jsx(InputAdornment,{position:"start",children:_jsx(Search,{})}),endAdornment:_jsx(InputAdornment,{position:"end",children:_jsx(IconButton,{"aria-label":"clear search",onClick:()=>_(""),edge:"end",disabled:re.length===0,children:_jsx(Clear,{})})})})})})},bn=Object.freeze({createEntityRefColumn(y){const{defaultKind:j}=y;function L(P){var ae;return((ae=P.metadata)===null||ae===void 0?void 0:ae.title)||rn(P,{defaultKind:j})}return{title:"Name",highlight:!0,customFilterAndSearch(P,ae){return L(ae).includes(P)},customSort(P,ae){return L(P).localeCompare(L(ae))},render:P=>{var ae;return(0,h.jsx)(xt,{entityRef:P,defaultKind:j,title:(ae=P.metadata)===null||ae===void 0?void 0:ae.title})}}},createEntityRelationColumn(y){const{title:j,relation:L,defaultKind:P,filter:ae}=y;function re(ue){return(0,U.hF)(ue,L,ae)}function _(ue){return re(ue).map(Ee=>rn(Ee,{defaultKind:P})).join(", ")}return{title:j,customFilterAndSearch(ue,Ee){return _(Ee).includes(ue)},customSort(ue,Ee){return _(ue).localeCompare(_(Ee))},render:ue=>(0,h.jsx)(Qt,{entityRefs:re(ue),defaultKind:P})}},createOwnerColumn(){return this.createEntityRelationColumn({title:"Owner",relation:I.S4,defaultKind:"group"})},createDomainColumn(){return this.createEntityRelationColumn({title:"Domain",relation:I.cz,defaultKind:"domain",filter:{kind:"domain"}})},createSystemColumn(){return this.createEntityRelationColumn({title:"System",relation:I.cz,defaultKind:"system",filter:{kind:"system"}})},createMetadataDescriptionColumn(){return{title:"Description",field:"metadata.description",render:y=>(0,h.jsx)(R.Or,{text:y.metadata.description,placement:"bottom-start",line:2})}},createSpecLifecycleColumn(){return{title:"Lifecycle",field:"spec.lifecycle"}},createSpecTypeColumn(){return{title:"Type",field:"spec.type"}}}),_n=[bn.createEntityRefColumn({defaultKind:"system"}),bn.createDomainColumn(),bn.createOwnerColumn(),bn.createMetadataDescriptionColumn()],fr=[bn.createEntityRefColumn({defaultKind:"component"}),bn.createSystemColumn(),bn.createOwnerColumn(),bn.createSpecTypeColumn(),bn.createSpecLifecycleColumn(),bn.createMetadataDescriptionColumn()],wr=(0,Jt.Z)(y=>({empty:{padding:y.spacing(2),display:"flex",justifyContent:"center"}})),Yn=y=>{const{entities:j,title:L,emptyContent:P,variant:ae="gridItem",columns:re,tableOptions:_={}}=y,ue=wr(),Ee={minWidth:"0",width:"100%"};return ae==="gridItem"&&(Ee.height="calc(100% - 10px)"),(0,h.jsx)(R.iA,{columns:re,title:L,style:Ee,emptyContent:P&&(0,h.jsx)("div",{className:ue.empty,children:P}),options:{search:!1,paging:!1,actionsColumnIndex:-1,padding:"dense",draggable:!1,..._},data:j})};Yn.columns=bn,Yn.systemEntityColumns=_n,Yn.componentEntityColumns=fr;const zr=(0,Jt.Z)({input:{}},{name:"CatalogReactEntityTagPicker"}),jr=y=>{const j=zr();return(0,h.jsx)(ce,{label:"Tags",name:"tags",path:"metadata.tags",Filter:k,showCounts:y.showCounts,InputProps:{className:j.input}})},Nr=y=>{const{hidden:j,initialFilter:L}=y,P=(0,p.h_)(p.$v),{error:ae,availableTypes:re,selectedTypes:_,setSelectedTypes:ue}=gt();if((0,F.useEffect)(()=>{ae&&P.post({message:"Failed to load entity types",severity:"error"}),L&&ue([L])},[ae,P,L,ue]),re.length===0||ae)return null;const Ee=[{value:"all",label:"all"},...re.map(ze=>({value:ze,label:ze}))];var Re;return j?null:(0,h.jsx)(D.Z,{pb:1,pt:1,children:(0,h.jsx)(R.Ph,{label:"Type",items:Ee,selected:(Re=Ee.length>1?_[0]:void 0)!==null&&Re!==void 0?Re:"all",onChange:ze=>ue(ze==="all"?[]:[String(ze)])})})};var C=n(15459),c=n(61837),b=n(11640),A=n(28347);const J=(0,C.Z)({root:{color:"#f3ba37"}})(b.Z),ve=y=>{const{toggleStarredEntity:j,isStarredEntity:L}=pn(y.entity);return(0,h.jsx)(c.Z,{"aria-label":"favorite",color:"inherit",...y,onClick:()=>j(),children:(0,h.jsx)(Ut.ZP,{title:L?"Remove from favorites":"Add to favorites",children:L?(0,h.jsx)(J,{}):(0,h.jsx)(A.Z,{})})})};var je=n(8629),ke=n(79249),nt=n(38724),_t=n(99152),an=n(6487),En=n(49429),gn=n(55999),Wr=n(39412);const lo=Wr.Z;function Co(y,j){if(y)return y.toLocaleLowerCase("en-US");if(j)try{return(0,I.of)(j).kind.toLocaleLowerCase("en-US")}catch{return}}function Ss(y,j){const L=(0,p.qD)(),P=Co(y,j);return P&&L.getSystemIcon(`kind:${P}`)||lo}function Vr(y){const{kind:j,entityRef:L,...P}=y,ae=Ss(j,L);return(0,h.jsx)(ae,{...P})}const Vo=(0,Jt.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 Cs(y){var j,L;const P=(0,p.h_)(W),ae=(0,I.eE)(y),{loading:re,error:_,value:ue}=(0,et.default)(async()=>{const Ee=await P.getEntityAncestors({entityRef:ae}),Re=new Array,ze=new Array;for(const Fe of Ee.items){const We=(0,I.eE)(Fe.entity),it=We===Ee.rootEntityRef;Re.push({id:We,root:it,...Fe.entity});for(const Et of Fe.parentEntityRefs)ze.push({from:We,to:Et})}return{nodes:Re,edges:ze}},[ae]);return{loading:re,error:_,nodes:((j=ue)===null||j===void 0?void 0:j.nodes)||[],edges:((L=ue)===null||L===void 0?void 0:L.edges)||[]}}function Ho({node:y}){const j=Vo(),L=(0,Zt.s0)(),P=(0,p.tg)(Be),[ae,re]=(0,F.useState)(0),[_,ue]=(0,F.useState)(0),Ee=(0,F.useRef)(null);(0,F.useLayoutEffect)(()=>{if(Ee.current){let{height:He,width:Tt}=Ee.current.getBBox();He=Math.round(He),Tt=Math.round(Tt),(He!==_||Tt!==ae)&&(re(Tt),ue(He))}},[ae,_]);const Re=10,ze=_,Fe=ze+Re,We=Fe+ae+Re*2,it=_+Re*2,Et=y.metadata.title||(y.kind&&y.metadata.name&&y.metadata.namespace?rn({kind:y.kind,name:y.metadata.name,namespace:y.metadata.namespace||""}):y.id),De=()=>{L(P({kind:y.kind,namespace:y.metadata.namespace||I.zG,name:y.metadata.name}))};return(0,h.jsxs)("g",{onClick:De,className:j.clickable,children:[(0,h.jsx)("rect",{className:Ie()(j.node,y.root?"secondary":"primary"),width:We,height:it,rx:10}),(0,h.jsx)(Vr,{kind:y.kind,y:Re,x:Re,width:ze,height:ze,className:Ie()(j.text,y.root?"secondary":"primary")}),(0,h.jsx)("text",{ref:Ee,className:Ie()(j.text,y.root?"secondary":"primary"),y:it/2,x:Fe+(ae+Re*2)/2,textAnchor:"middle",alignmentBaseline:"middle",children:Et})]})}function Go(y){const{loading:j,error:L,nodes:P,edges:ae}=Cs(y.entity);return j?(0,h.jsx)(R.Ex,{}):L?(0,h.jsx)(R.Gk,{error:L}):(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(gn.Z,{variant:"h2",children:"Ancestry"}),(0,h.jsxs)(gn.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)(R.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)(D.Z,{mt:4,children:(0,h.jsx)(R.mn,{nodes:P,edges:ae,renderNode:Ho,direction:R.NX.Direction.BOTTOM_TOP,zoom:"enable-on-click"})})]})}var Er=n(11776),cr=n(38402),Hr=n(86136),qr=n(99688),wo=n(49378),jo=n(54506),Fr=n(94339),Ko=n(24579),Eo=n(27685);const Fn=(0,Jt.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 dr(y){const j=Fn();return(0,h.jsx)(wo.Z,{...y,primaryTypographyProps:{className:j.monospace},secondaryTypographyProps:{className:j.monospace}})}function Gr(y){const j=Fn();return(0,h.jsx)(jo.Z,{className:j.monospace,children:y.children})}function Kr(y){return(0,h.jsx)(D.Z,{mt:2,children:(0,h.jsx)(Fr.Z,{variant:"outlined",children:(0,h.jsxs)(Ko.Z,{children:[(0,h.jsxs)(E.Z,{variant:"h6",gutterBottom:!0,children:[y.title,y.helpLink&&(0,h.jsx)(Ao,{to:y.helpLink})]}),y.children]})})})}function Yo(y){if(y.match(/^url:https?:\/\//))return y.slice(4);if(y.match(/^https?:\/\//))return y}function gr(y){const[j,L]=y.entry,P=Yo(L);return(0,h.jsxs)(cr.Z,{children:[y.indent&&(0,h.jsx)(Hr.Z,{}),(0,h.jsx)(dr,{primary:j,secondary:P?(0,h.jsx)(R.rU,{to:P,children:L}):L})]})}function Ao(y){const j=Fn();return(0,h.jsx)(R.rU,{to:y.to,className:j.helpIcon,children:(0,h.jsx)(Eo.Z,{fontSize:"inherit"})})}const To=(0,Jt.Z)({root:{display:"flex",flexDirection:"column"}});function Ro(y){var j,L,P;const ae=(0,p.h_)(W),re=(0,I.eE)(y),_=(j=y.metadata.annotations)===null||j===void 0?void 0:j[I.P1],ue=(L=y.metadata.annotations)===null||L===void 0?void 0:L[I.q1],{loading:Ee,error:Re,value:ze}=(0,et.default)(async()=>!_&&!ue?[]:(await ae.getEntities({filter:[..._?[{[`metadata.annotations.${I.P1}`]:_}]:[],...ue?[{[`metadata.annotations.${I.q1}`]:ue}]:[]]})).items,[_,ue]);return{loading:Ee,error:Re,location:_,originLocation:ue,colocatedEntities:(P=ze)===null||P===void 0?void 0:P.filter(Fe=>(0,I.eE)(Fe)!==re)}}function Zr(y){return(0,h.jsxs)(Er.Z,{dense:!0,children:[y.header&&(0,h.jsx)(gr,{entry:y.header},"header"),y.entities.map(j=>(0,h.jsxs)(cr.Z,{children:[(0,h.jsx)(Hr.Z,{children:(0,h.jsx)(Vr,{kind:j.kind})}),(0,h.jsx)(dr,{primary:(0,h.jsx)(xt,{entityRef:j})})]},(0,I.eE)(j)))]})}function Io(y){var j;const{entity:L}=y,{loading:P,error:ae,location:re,originLocation:_,colocatedEntities:ue}=Ro(L);if(P)return(0,h.jsx)(R.Ex,{});if(ae)return(0,h.jsx)(R.Gk,{error:ae});if(!re&&!_)return(0,h.jsx)(qr.Z,{severity:"warning",children:"Entity had no location information."});if(!(!((j=ue)===null||j===void 0)&&j.length))return(0,h.jsx)(qr.Z,{severity:"info",children:"There were no other entities on this location."});if(re===_)return(0,h.jsx)(Zr,{entities:ue});const Ee=ue.filter(ze=>{var Fe;return((Fe=ze.metadata.annotations)===null||Fe===void 0?void 0:Fe[I.P1])===re}),Re=ue.filter(ze=>{var Fe;return((Fe=ze.metadata.annotations)===null||Fe===void 0?void 0:Fe[I.q1])===_});return(0,h.jsxs)(h.Fragment,{children:[Ee.length>0&&(0,h.jsx)(Zr,{entities:Ee,header:["At the same location",re]}),Re.length>0&&(0,h.jsx)(Zr,{entities:Re,header:["At the same origin",_]})]})}function Jo(y){const j=To();return(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(gn.Z,{variant:"h2",children:"Colocated"}),(0,h.jsx)(gn.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:j.root,children:(0,h.jsx)(Io,{entity:y.entity})})]})}function co(y){return Object.fromEntries([...Object.entries(y)].sort((j,L)=>j[0]<L[0]?-1:1))}function Po(y){return(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(gn.Z,{variant:"h2",children:"Entity as JSON"}),(0,h.jsx)(gn.Z,{children:"This is the raw entity data as received from the catalog, on JSON form."}),(0,h.jsx)(gn.Z,{children:(0,h.jsx)("div",{style:{fontSize:"75%"},"data-testid":"code-snippet",children:(0,h.jsx)(R.Oi,{text:JSON.stringify(co(y.entity),void 0,2),language:"json",showCopyCodeButton:!0})})})]})}var ws=n(3440),Lo=n.n(ws);const ur=(0,Jt.Z)({root:{display:"flex",flexDirection:"column"}});function ci(y){var j,L,P;const ae=ur(),{apiVersion:re,kind:_,metadata:ue,spec:Ee,relations:Re=[],status:ze={}}=y.entity,Fe=Lo()(ft()(Re,We=>We.targetRef),"type");return(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(gn.Z,{variant:"h2",children:"Overview"}),(0,h.jsxs)("div",{className:ae.root,children:[(0,h.jsx)(Kr,{title:"Identity",children:(0,h.jsxs)(Er.Z,{dense:!0,children:[(0,h.jsx)(cr.Z,{children:(0,h.jsx)(dr,{primary:"apiVersion",secondary:re})}),(0,h.jsx)(cr.Z,{children:(0,h.jsx)(dr,{primary:"kind",secondary:_})}),((j=Ee)===null||j===void 0?void 0:j.type)&&(0,h.jsx)(cr.Z,{children:(0,h.jsx)(dr,{primary:"spec.type",secondary:Ee.type})}),ue.uid&&(0,h.jsx)(cr.Z,{children:(0,h.jsx)(dr,{primary:"uid",secondary:ue.uid})}),ue.etag&&(0,h.jsx)(cr.Z,{children:(0,h.jsx)(dr,{primary:"etag",secondary:ue.etag})})]})}),(0,h.jsxs)(Kr,{title:"Metadata",children:[!!Object.keys(ue.annotations||{}).length&&(0,h.jsx)(Er.Z,{dense:!0,subheader:(0,h.jsxs)(Gr,{children:["Annotations",(0,h.jsx)(Ao,{to:"https://backstage.io/docs/features/software-catalog/well-known-annotations"})]}),children:Object.entries(ue.annotations).map(We=>(0,h.jsx)(gr,{indent:!0,entry:We},We[0]))}),!!Object.keys(ue.labels||{}).length&&(0,h.jsx)(Er.Z,{dense:!0,subheader:(0,h.jsx)(Gr,{children:"Labels"}),children:Object.entries(ue.labels).map(We=>(0,h.jsx)(gr,{indent:!0,entry:We},We[0]))}),!!(!((L=ue.tags)===null||L===void 0)&&L.length)&&(0,h.jsx)(Er.Z,{dense:!0,subheader:(0,h.jsx)(Gr,{children:"Tags"}),children:ue.tags.map((We,it)=>(0,h.jsxs)(cr.Z,{children:[(0,h.jsx)(Hr.Z,{}),(0,h.jsx)(dr,{primary:We})]},`${We}-${it}`))})]}),!!Re.length&&(0,h.jsx)(Kr,{title:"Relations",helpLink:"https://backstage.io/docs/features/software-catalog/well-known-relations",children:Object.entries(Fe).map(([We,it],Et)=>(0,h.jsx)("div",{children:(0,h.jsx)(Er.Z,{dense:!0,subheader:(0,h.jsx)(Gr,{children:We}),children:it.map(De=>(0,h.jsxs)(cr.Z,{children:[(0,h.jsx)(Hr.Z,{children:(0,h.jsx)(Vr,{entityRef:De.targetRef})}),(0,h.jsx)(dr,{primary:(0,h.jsx)(xt,{entityRef:De.targetRef})})]},De.targetRef))})},Et))}),!!(!((P=ze.items)===null||P===void 0)&&P.length)&&(0,h.jsx)(Kr,{title:"Status",helpLink:"https://backstage.io/docs/features/software-catalog/well-known-statuses",children:ze.items.map((We,it)=>(0,h.jsxs)("div",{children:[(0,h.jsxs)(E.Z,{children:[We.level,": ",We.type]}),(0,h.jsx)(D.Z,{ml:2,children:We.message})]},it))})]})]})}var Qo=n(10921);function js(y){return(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(gn.Z,{variant:"h2",children:"Entity as YAML"}),(0,h.jsx)(gn.Z,{children:"This is the raw entity data as received from the catalog, on YAML form."}),(0,h.jsx)(gn.Z,{children:(0,h.jsx)("div",{style:{fontSize:"75%"},"data-testid":"code-snippet",children:(0,h.jsx)(R.Oi,{text:Qo.ZP.stringify(co(y.entity)),language:"yaml",showCopyCodeButton:!0})})})]})}const uo=(0,Jt.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 eo(y){const{children:j,value:L,index:P,...ae}=y,re=uo();return(0,h.jsx)("div",{role:"tabpanel",hidden:L!==P,id:`vertical-tabpanel-${P}`,"aria-labelledby":`vertical-tab-${P}`,className:re.tabContents,...ae,children:L===P&&(0,h.jsx)(D.Z,{pl:3,pr:3,children:j})})}function to(y){return{id:`vertical-tab-${y}`,"aria-controls":`vertical-tabpanel-${y}`}}function no(y){const j=uo(),[L,P]=F.useState(0);return(0,F.useEffect)(()=>{P(0)},[y.open]),y.entity?(0,h.jsxs)(je.Z,{fullWidth:!0,maxWidth:"xl",open:y.open,onClose:y.onClose,"aria-labelledby":"entity-inspector-dialog-title",PaperProps:{className:j.fullHeightDialog},children:[(0,h.jsx)(ke.Z,{id:"entity-inspector-dialog-title",children:"Entity Inspector"}),(0,h.jsx)(nt.Z,{dividers:!0,children:(0,h.jsxs)("div",{className:j.root,children:[(0,h.jsxs)(_t.Z,{orientation:"vertical",variant:"scrollable",value:L,onChange:(ae,re)=>P(re),"aria-label":"Inspector options",className:j.tabs,children:[(0,h.jsx)(an.Z,{label:"Overview",...to(0)}),(0,h.jsx)(an.Z,{label:"Ancestry",...to(1)}),(0,h.jsx)(an.Z,{label:"Colocated",...to(2)}),(0,h.jsx)(an.Z,{label:"Raw JSON",...to(3)}),(0,h.jsx)(an.Z,{label:"Raw YAML",...to(4)})]}),(0,h.jsx)(eo,{value:L,index:0,children:(0,h.jsx)(ci,{entity:y.entity})}),(0,h.jsx)(eo,{value:L,index:1,children:(0,h.jsx)(Go,{entity:y.entity})}),(0,h.jsx)(eo,{value:L,index:2,children:(0,h.jsx)(Jo,{entity:y.entity})}),(0,h.jsx)(eo,{value:L,index:3,children:(0,h.jsx)(Po,{entity:y.entity})}),(0,h.jsx)(eo,{value:L,index:4,children:(0,h.jsx)(js,{entity:y.entity})})]})}),(0,h.jsx)(En.Z,{children:(0,h.jsx)(z.Z,{onClick:y.onClose,color:"primary",children:"Close"})})]}):null}var Ar=n(85256);function qn(y){var j;const L=(0,p.h_)(W),P=(j=y.metadata.annotations)===null||j===void 0?void 0:j[I.q1],ae=y.metadata.uid,re=P==="bootstrap:bootstrap",_=(0,et.default)(async()=>{const Et=L.getLocationByRef(P);let De;if(!P)De=Promise.resolve([]);else{const He=`metadata.annotations.${I.q1}`;De=L.getEntities({filter:{[He]:P},fields:["kind","metadata.uid","metadata.name","metadata.namespace"]}).then(Tt=>Tt.items)}return Promise.all([Et,De]).then(([He,Tt])=>({location:He,colocatedEntities:Tt}))},[L,y]),ue=(0,F.useCallback)(async function(){const{location:De}=_.value;await L.removeLocationById(De.id)},[L,_]),Ee=(0,F.useCallback)(async function(){await L.removeEntityByUid(ae)},[L,ae]);if(re)return{type:"bootstrap",location:P,deleteEntity:Ee};const{loading:Re,error:ze,value:Fe}=_;if(Re)return{type:"loading"};if(ze)return{type:"error",error:ze};const{location:We,colocatedEntities:it}=Fe;return We?{type:"unregister",location:P,colocatedEntities:it.map(I.iB),unregisterLocation:ue,deleteEntity:Ee}:{type:"only-delete",deleteEntity:Ee}}var ho=n(23054);const Xo=(0,Jt.Z)({advancedButton:{fontSize:"0.7em"},dialogActions:{display:"inline-block"}}),Es=({entity:y,onConfirm:j,onClose:L})=>{const P=(0,p.h_)(p.$v),ae=(0,p.h_)(p.Ds),re=Xo(),_=qn(y),[ue,Ee]=(0,F.useState)(!1),[Re,ze]=(0,F.useState)(!1);var Fe;const We=(Fe=ae.getOptionalString("app.title"))!==null&&Fe!==void 0?Fe:"Backstage",it=(0,F.useCallback)(async function(){if("unregisterLocation"in _){ze(!0);try{await _.unregisterLocation(),j()}catch(Tt){(0,ho.BD)(Tt),P.post({message:Tt.message})}finally{ze(!1)}}},[P,j,_]),Et=(0,F.useCallback)(async function(){if("deleteEntity"in _){ze(!0);try{await _.deleteEntity(),j()}catch(Tt){(0,ho.BD)(Tt),P.post({message:Tt.message})}finally{ze(!1)}}},[P,j,_]),De=()=>(0,h.jsx)(En.Z,{className:re.dialogActions,children:(0,h.jsx)(z.Z,{onClick:L,color:"primary",children:"Cancel"})});return _.type==="loading"?(0,h.jsx)(R.Ex,{}):_.type==="error"?(0,h.jsx)(R.Gk,{error:_.error}):_.type==="bootstrap"?(0,h.jsxs)(h.Fragment,{children:[(0,h.jsxs)(qr.Z,{severity:"info",children:['You cannot unregister this entity, since it originates from a protected Backstage configuration (location "',_.location,'"). If you believe this is in error, please contact the ',We," ","integrator."]}),(0,h.jsxs)(D.Z,{marginTop:2,children:[!ue&&(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(z.Z,{variant:"text",size:"small",color:"primary",className:re.advancedButton,onClick:()=>Ee(!0),children:"Advanced Options"}),(0,h.jsx)(De,{})]}),ue&&(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(gn.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)(z.Z,{variant:"contained",color:"secondary",disabled:Re,onClick:Et,children:"Delete Entity"}),(0,h.jsx)(De,{})]})]})]}):_.type==="only-delete"?(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(gn.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)(z.Z,{variant:"contained",color:"secondary",disabled:Re,onClick:Et,children:"Delete Entity"}),(0,h.jsx)(De,{})]}):_.type==="unregister"?(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(gn.Z,{children:"This action will unregister the following entities:"}),(0,h.jsx)(gn.Z,{component:"ul",children:_.colocatedEntities.map(He=>(0,h.jsx)("li",{children:(0,h.jsx)(xt,{entityRef:He})},`${He.kind}:${He.namespace}/${He.name}`))}),(0,h.jsx)(gn.Z,{children:"Located at the following location:"}),(0,h.jsx)(gn.Z,{component:"ul",children:(0,h.jsx)("li",{children:_.location})}),(0,h.jsxs)(gn.Z,{children:["To undo, just re-register the entity in ",We,"."]}),(0,h.jsxs)(D.Z,{marginTop:2,children:[(0,h.jsx)(z.Z,{variant:"contained",color:"secondary",disabled:Re,onClick:it,children:"Unregister Location"}),!ue&&(0,h.jsx)(D.Z,{component:"span",marginLeft:2,children:(0,h.jsx)(z.Z,{variant:"text",size:"small",color:"primary",className:re.advancedButton,onClick:()=>Ee(!0),children:"Advanced Options"})})]}),ue&&(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(D.Z,{paddingTop:4,paddingBottom:4,children:(0,h.jsx)(Ar.Z,{})}),(0,h.jsx)(gn.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)(z.Z,{variant:"contained",color:"secondary",disabled:Re,onClick:Et,children:"Delete Entity"})]})]}):(0,h.jsx)(qr.Z,{severity:"error",children:"Internal error: Unknown state"})},ro=y=>{const{open:j,onConfirm:L,onClose:P,entity:ae}=y;return(0,h.jsxs)(je.Z,{open:j,onClose:P,children:[(0,h.jsx)(ke.Z,{id:"responsive-dialog-title",children:"Are you sure you want to unregister this entity?"}),(0,h.jsx)(nt.Z,{children:(0,h.jsx)(Es,{entity:ae,onConfirm:L,onClose:P})})]})};var _o=n(12231),As=n(9520),qo=n(47603);const es=(0,Jt.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 po(y){return[{name:"Personal",items:[{id:"owned",label:"Owned",icon:qo.Z},{id:"starred",label:"Starred",icon:b.Z}]},{name:y!=null?y:"Company",items:[{id:"all",label:"All"}]}]}const Oo=y=>{const{initialFilter:j,availableFilters:L}=y,P=es(),ae=(0,p.h_)(p.Ds);var re;const _=(re=ae.getOptionalString("organization.name"))!==null&&re!==void 0?re:"Company",{filters:ue,updateFilters:Ee,backendEntities:Re,queryParameters:{kind:ze,user:Fe},loading:We}=rt(),it=["starred","all"],Et=po(_).map(zn=>({...zn,items:zn.items.filter(({id:mn})=>["group","user"].some(Bn=>Bn===ze)?it.includes(mn):!L||L.includes(mn))})).filter(({items:zn})=>!!zn.length),{isStarredEntity:De}=cn(),{isOwnedEntity:He,loading:Tt}=Cn(),tn=We||Tt,An=(0,F.useMemo)(()=>new Rt("owned",He,De),[He,De]),Ot=(0,F.useMemo)(()=>new Rt("starred",He,De),[He,De]),Pt=(0,F.useMemo)(()=>[Fe].flat()[0],[Fe]),[Kt,Tn]=(0,F.useState)(Pt!=null?Pt:j),hr=(0,F.useMemo)(()=>Re.filter((0,U.Gz)((0,ut.compact)(Object.values({...ue,user:void 0})))),[ue,Re]),Tr=(0,F.useMemo)(()=>({all:hr.length,starred:hr.filter(zn=>Ot.filterEntity(zn)).length,owned:hr.filter(zn=>An.filterEntity(zn)).length}),[hr,Ot,An]);(0,F.useEffect)(()=>{Pt&&Tn(Pt)},[Pt]),(0,F.useEffect)(()=>{!tn&&Kt&&Kt!=="all"&&Tr[Kt]===0&&Tn("all")},[tn,Tr,Kt,Tn]),(0,F.useEffect)(()=>{Ee({user:Kt?new Rt(Kt,He,De):void 0})},[Kt,He,De,Ee]);var Yr;return(0,h.jsx)(Fr.Z,{className:P.root,children:Et.map(zn=>(0,h.jsxs)(F.Fragment,{children:[(0,h.jsx)(E.Z,{variant:"subtitle2",component:"span",className:P.title,children:zn.name}),(0,h.jsx)(Fr.Z,{className:P.groupWrapper,children:(0,h.jsx)(Er.Z,{disablePadding:!0,dense:!0,role:"menu","aria-label":zn.name,children:zn.items.map(mn=>{var Bn;return(0,h.jsxs)(_o.Z,{role:"none presentation",button:!0,divider:!0,onClick:()=>Tn(mn.id),selected:mn.id===((Bn=ue.user)===null||Bn===void 0?void 0:Bn.value),className:P.menuItem,disabled:Tr[mn.id]===0,"data-testid":`user-picker-${mn.id}`,tabIndex:0,ContainerProps:{role:"menuitem"},children:[mn.icon&&(0,h.jsx)(Hr.Z,{className:P.listIcon,children:(0,h.jsx)(mn.icon,{fontSize:"small"})}),(0,h.jsx)(wo.Z,{children:(0,h.jsxs)(E.Z,{variant:"body1",children:[mn.label," "]})}),(0,h.jsx)(As.Z,{children:(Yr=Tr[mn.id])!==null&&Yr!==void 0?Yr:"-"})]},mn.id)})})})]},zn.name))})},fo=(0,Jt.Z)({input:{}},{name:"CatalogReactEntityProcessingStatusPickerPicker"}),Ts=(0,h.jsx)(In.Z,{fontSize:"small"}),di=(0,h.jsx)(Nn.Z,{fontSize:"small"}),ts=()=>{const y=fo(),{updateFilters:j}=rt(),[L,P]=(0,F.useState)([]);function ae(ue){j({orphan:ue?new Dt(ue):void 0})}function re(ue){j({error:ue?new Yt(ue):void 0})}const _=["Is Orphan","Has Error"];return(0,h.jsx)(D.Z,{pb:1,pt:1,children:(0,h.jsxs)(E.Z,{variant:"button",component:"label",children:["Processing Status",(0,h.jsx)(Je.ZP,{multiple:!0,disableCloseOnSelect:!0,options:_,value:L,onChange:(ue,Ee)=>{P(Ee),ae(Ee.includes("Is Orphan")),re(Ee.includes("Has Error"))},renderOption:(ue,{selected:Ee})=>(0,h.jsx)(sn.Z,{control:(0,h.jsx)(Rn.Z,{icon:Ts,checkedIcon:di,checked:Ee}),onClick:Re=>Re.preventDefault(),label:ue}),size:"small",popupIcon:(0,h.jsx)(Vt.Z,{"data-testid":"processing-status-picker-expand"}),renderInput:ue=>(0,h.jsx)(be.Z,{...ue,className:y.input,variant:"outlined"})})]})})},ns=(0,Jt.Z)({input:{}},{name:"CatalogReactEntityNamespacePicker"}),dn=()=>{const y=ns();return(0,h.jsx)(ce,{label:"Namespace",name:"namespace",path:"metadata.namespace",Filter:zt,InputProps:{className:y.input}})};function Rs(y){var j;const{children:L,value:P}=y;var ae;const[re,_]=useState((ae=(j=P)===null||j===void 0?void 0:j.filters)!==null&&ae!==void 0?ae:{}),ue=useCallback(De=>{_(He=>{const Tt=typeof De=="function"?De(He):De;return{...He,...Tt}})},[]),Ee=useMemo(()=>({entities:[],backendEntities:[],queryParameters:{}}),[]);var Re,ze,Fe,We,it;const Et=useMemo(()=>{var De,He,Tt,tn,An,Ot;return{entities:(Re=(De=P)===null||De===void 0?void 0:De.entities)!==null&&Re!==void 0?Re:Ee.entities,backendEntities:(ze=(He=P)===null||He===void 0?void 0:He.backendEntities)!==null&&ze!==void 0?ze:Ee.backendEntities,updateFilters:(Fe=(Tt=P)===null||Tt===void 0?void 0:Tt.updateFilters)!==null&&Fe!==void 0?Fe:ue,filters:re,loading:(We=(tn=P)===null||tn===void 0?void 0:tn.loading)!==null&&We!==void 0?We:!1,queryParameters:(it=(An=P)===null||An===void 0?void 0:An.queryParameters)!==null&&it!==void 0?it:Ee.queryParameters,error:(Ot=P)===null||Ot===void 0?void 0:Ot.error}},[P,Ee,re,ue]);return _jsx(EntityListContext.Provider,{value:Et,children:L})}},75435:function(Lt,Le,n){"use strict";n.d(Le,{h:function(){return p}});var r=n(25271);function p(W,f,V){var m,h,F;let ye=((h=W)===null||h===void 0||(m=h.relations)===null||m===void 0?void 0:m.filter(le=>le.type===f).map(le=>(0,r.of)(le.targetRef)))||[];return!((F=V)===null||F===void 0)&&F.kind&&(ye=ye.filter(le=>le.kind.toLocaleLowerCase("en-US")===V.kind.toLocaleLowerCase("en-US"))),ye}},49280:function(Lt,Le,n){"use strict";n.d(Le,{hF:function(){return W.h},CV:function(){return V},wq:function(){return r},Gz:function(){return p}});function r(h){return h.reduce((F,ye)=>({...F,...ye.getCatalogFilters?ye.getCatalogFilters():{}}),{})}function p(h){return F=>h.every(ye=>!ye.filterEntity||ye.filterEntity(F))}var W=n(75435),f=n(25271);function V(h,F){var ye;const le=(ye=h.metadata.annotations)===null||ye===void 0?void 0:ye[f.M6];if(le)try{var z;const de=(0,f.Ou)(le),D=F.byUrl(de.target);return{locationTargetUrl:de.target,integrationType:(z=D)===null||z===void 0?void 0:z.type}}catch{return}}function m(h,F){const ye=new Set([...getEntityRelations(h,RELATION_MEMBER_OF,{kind:"group"}),...h?[getCompoundEntityRef(h)]:[]].map(stringifyEntityRef)),le=getEntityRelations(F,RELATION_OWNED_BY).map(stringifyEntityRef);for(const z of le)if(ye.has(z))return!0;return!1}},8799:function(Lt,Le,n){"use strict";n.r(Le),n.d(Le,{AboutCard:function(){return Yt},AboutContent:function(){return Rt},AboutField:function(){return Ke}});var r=n(52322),p=n(25271),W=n(53974),f=n(60871),V=n(32838),m=n(39709),h=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 F=(0,p.wI)(h),ye={async check(ct){return F(ct)===ct}},le=ct=>ct.apiVersion==="scaffolder.backstage.io/v1beta3"&&ct.kind==="Template";var z=n(79692),de=n(94339),D=n(32552),E=n(61837),se=n(85256),ie=n(24579),ne=n(88188),X=n(52866),K=n(30254),R=n(27604),w=n(2784),I=n(19625),U=n(60905),xe=n(7089),Se=n(90436);const k=(0,z.Z)(ct=>({value:{fontWeight:"bold",overflow:"hidden",lineHeight:"24px",wordBreak:"break-word"},label:{color:ct.palette.text.secondary,textTransform:"uppercase",fontSize:"10px",fontWeight:"bold",letterSpacing:.5,overflow:"hidden",whiteSpace:"nowrap"}}));function Ke(ct){const{label:ut,value:St,gridSizes:lt,children:Zt}=ct,Gt=k(),Ce=(0,f.vJ)(Zt,Ye=>Ye.getElements()),Ne=Ce.length>0?Ce:(0,r.jsx)(Se.Z,{variant:"body2",className:Gt.value,children:St||"unknown"});return(0,r.jsxs)(U.Z,{item:!0,...lt,children:[(0,r.jsx)(Se.Z,{variant:"h2",className:Gt.label,children:ut}),Ne]})}var yt=n(24851);const $t=(0,z.Z)({description:{wordBreak:"break-word"}});function zt(ct,ut,St){if(ut==="url"||ct.includes("://"))return ct;const lt=St.type==="file"?`file://${St.target}`:St.target;return ut==="file"||St.type==="file"?new URL(ct,lt).href:lt}function Rt(ct){var ut,St,lt,Zt,Gt,Ce,Ne,Ye,ht,rt,et,vt,ot,Qe,ft,gt;const{entity:Ct}=ct,yn=$t(),hn=Ct.kind.toLocaleLowerCase("en-US")==="system",cn=Ct.kind.toLocaleLowerCase("en-US")==="resource",Sn=Ct.kind.toLocaleLowerCase("en-US")==="component",pn=Ct.kind.toLocaleLowerCase("en-US")==="api",xn=Ct.kind.toLocaleLowerCase("en-US")==="template",Cn=Ct.kind.toLocaleLowerCase("en-US")==="location",on=Ct.kind.toLocaleLowerCase("en-US")==="group",fn=(0,m.hF)(Ct,p.cz,{kind:"system"}),wn=(0,m.hF)(Ct,p.cz,{kind:"component"}),_e=(0,m.hF)(Ct,p.cz,{kind:"domain"}),Jt=(0,m.hF)(Ct,p.S4);let Vt;try{Vt=(0,p.CV)(Ct)}catch{Vt=void 0}return(0,r.jsxs)(U.Z,{container:!0,children:[(0,r.jsx)(Ke,{label:"Description",gridSizes:{xs:12},children:(0,r.jsx)(W.SA,{className:yn.description,content:((St=Ct)===null||St===void 0||(ut=St.metadata)===null||ut===void 0?void 0:ut.description)||"No description"})}),(0,r.jsx)(Ke,{label:"Owner",value:"No Owner",gridSizes:{xs:12,sm:6,lg:4},children:Jt.length>0&&(0,r.jsx)(m.rI,{entityRefs:Jt,defaultKind:"group"})}),(hn||_e.length>0)&&(0,r.jsx)(Ke,{label:"Domain",value:"No Domain",gridSizes:{xs:12,sm:6,lg:4},children:_e.length>0&&(0,r.jsx)(m.rI,{entityRefs:_e,defaultKind:"domain"})}),(pn||Sn||cn||fn.length>0)&&(0,r.jsx)(Ke,{label:"System",value:"No System",gridSizes:{xs:12,sm:6,lg:4},children:fn.length>0&&(0,r.jsx)(m.rI,{entityRefs:fn,defaultKind:"system"})}),Sn&&wn.length>0&&(0,r.jsx)(Ke,{label:"Parent Component",value:"No Parent Component",gridSizes:{xs:12,sm:6,lg:4},children:(0,r.jsx)(m.rI,{entityRefs:wn,defaultKind:"component"})}),(pn||Sn||cn||xn||on||Cn||typeof((Zt=Ct)===null||Zt===void 0||(lt=Zt.spec)===null||lt===void 0?void 0:lt.type)=="string")&&(0,r.jsx)(Ke,{label:"Type",value:(Ce=Ct)===null||Ce===void 0||(Gt=Ce.spec)===null||Gt===void 0?void 0:Gt.type,gridSizes:{xs:12,sm:6,lg:4}}),(pn||Sn||typeof((Ye=Ct)===null||Ye===void 0||(Ne=Ye.spec)===null||Ne===void 0?void 0:Ne.lifecycle)=="string")&&(0,r.jsx)(Ke,{label:"Lifecycle",value:(rt=Ct)===null||rt===void 0||(ht=rt.spec)===null||ht===void 0?void 0:ht.lifecycle,gridSizes:{xs:12,sm:6,lg:4}}),(0,r.jsx)(Ke,{label:"Tags",value:"No Tags",gridSizes:{xs:12,sm:6,lg:4},children:(((vt=Ct)===null||vt===void 0||(et=vt.metadata)===null||et===void 0?void 0:et.tags)||[]).map(Je=>(0,r.jsx)(xe.Z,{size:"small",label:Je},Je))}),Cn&&(((Qe=Ct)===null||Qe===void 0||(ot=Qe.spec)===null||ot===void 0?void 0:ot.targets)||((gt=Ct)===null||gt===void 0||(ft=gt.spec)===null||ft===void 0?void 0:ft.target))&&(0,r.jsx)(Ke,{label:"Targets",gridSizes:{xs:12},children:(0,r.jsx)(yt.s,{cols:1,items:(Ct.spec.targets||[Ct.spec.target]).map(Je=>Je).map(Je=>{var Rn,sn;return{text:Je,href:zt(Je,((sn=Ct)===null||sn===void 0||(Rn=sn.spec)===null||Rn===void 0?void 0:Rn.type)||"unknown",Vt)}})})})]})}const Dt=(0,z.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 Yt(ct){var ut,St,lt,Zt,Gt,Ce,Ne;const{variant:Ye}=ct,ht=(0,f.qD)(),rt=Dt(),{entity:et}=(0,m.X2)(),vt=(0,f.h_)(V.q3),ot=(0,f.h_)(m.Ah),Qe=(0,f.h_)(f.$v),ft=(0,f.h_)(f.VE),gt=(0,f.tg)(I.jU),Ct=(0,f.tg)(I.ql),yn=(0,m.CV)(et,vt),hn=(ut=et.metadata.annotations)===null||ut===void 0?void 0:ut[p.Tf],cn={label:"View Source",disabled:!yn,icon:(0,r.jsx)(V.nW,{type:(St=yn)===null||St===void 0?void 0:St.integrationType}),href:(lt=yn)===null||lt===void 0?void 0:lt.locationTargetUrl},Sn={label:"View TechDocs",disabled:!(!((Zt=et.metadata.annotations)===null||Zt===void 0)&&Zt["backstage.io/techdocs-ref"])||!gt,icon:(0,r.jsx)(K.Z,{}),href:gt&>({namespace:et.metadata.namespace||p.zG,kind:et.kind,name:et.metadata.name})},pn=[cn,Sn];if(le(et)){var xn;const Jt=(xn=ht.getSystemIcon("scaffolder"))!==null&&xn!==void 0?xn:ne.Z,Vt={label:"Launch Template",icon:(0,r.jsx)(Jt,{}),disabled:!Ct,href:Ct&&Ct({templateName:et.metadata.name,namespace:et.metadata.namespace||p.zG})};pn.push(Vt)}let Cn="";Ye==="gridItem"?Cn=rt.gridItemCard:Ye==="fullHeight"&&(Cn=rt.fullHeightCard);let on="";Ye==="gridItem"?on=rt.gridItemCardContent:Ye==="fullHeight"&&(on=rt.fullHeightCardContent);const fn=(Gt=et.metadata.annotations)===null||Gt===void 0?void 0:Gt[p.P1],wn=((Ce=fn)===null||Ce===void 0?void 0:Ce.startsWith("url:"))||((Ne=fn)===null||Ne===void 0?void 0:Ne.startsWith("file:")),_e=(0,w.useCallback)(async()=>{try{await ot.refreshEntity((0,p.eE)(et)),Qe.post({message:"Refresh scheduled",severity:"info",display:"transient"})}catch(Jt){ft.post(Jt)}},[ot,Qe,ft,et]);return(0,r.jsxs)(de.Z,{className:Cn,children:[(0,r.jsx)(D.Z,{title:"About",action:(0,r.jsxs)(r.Fragment,{children:[wn&&(0,r.jsx)(E.Z,{"aria-label":"Refresh",title:"Schedule entity refresh",onClick:_e,children:(0,r.jsx)(X.Z,{})}),(0,r.jsx)(E.Z,{component:W.rU,"aria-label":"Edit",disabled:!hn,title:"Edit Metadata",to:hn!=null?hn:"#",children:(0,r.jsx)(R.Z,{})})]}),subheader:(0,r.jsx)(W.M6,{links:pn})}),(0,r.jsx)(se.Z,{}),(0,r.jsx)(ie.Z,{className:on,children:(0,r.jsx)(Rt,{entity:et})})]})}},86359:function(Lt,Le,n){"use strict";n.d(Le,{E:function(){return K}});var r=n(52322),p=n(25271),W=n(53974),f=n(39709),V=n(90436),m=n(15459),h=n(27604),F=n(2997),ye=n(11640),le=n(28347),z=n(76635),de=n(2784),D=n(7089);const E=Object.freeze({createNameColumn(R){function w(I){var U,xe;return((U=I.metadata)===null||U===void 0?void 0:U.title)||(0,f.$3)(I,{defaultKind:(xe=R)===null||xe===void 0?void 0:xe.defaultKind})}return{title:"Name",field:"resolved.name",highlight:!0,customSort({entity:I},{entity:U}){return w(I).localeCompare(w(U))},render:({entity:I})=>{var U,xe;return(0,r.jsx)(f.dx,{entityRef:I,defaultKind:((U=R)===null||U===void 0?void 0:U.defaultKind)||"Component",title:(xe=I.metadata)===null||xe===void 0?void 0:xe.title})}}},createSystemColumn(){return{title:"System",field:"resolved.partOfSystemRelationTitle",render:({resolved:R})=>(0,r.jsx)(f.rI,{entityRefs:R.partOfSystemRelations,defaultKind:"system"})}},createOwnerColumn(){return{title:"Owner",field:"resolved.ownedByRelationsTitle",render:({resolved:R})=>(0,r.jsx)(f.rI,{entityRefs:R.ownedByRelations,defaultKind:"group"})}},createSpecTargetsColumn(){return{title:"Targets",field:"entity.spec.targets",render:({entity:R})=>{var w,I,U,xe;return(0,r.jsx)(r.Fragment,{children:(((I=R)===null||I===void 0||(w=I.spec)===null||w===void 0?void 0:w.targets)||((xe=R)===null||xe===void 0||(U=xe.spec)===null||U===void 0?void 0:U.target))&&(0,r.jsx)(W.Or,{text:(R.spec.targets||[R.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:R})=>(0,r.jsx)(W.Or,{text:R.metadata.description,placement:"bottom-start"}),width:"auto"}},createTagsColumn(){return{title:"Tags",field:"entity.metadata.tags",cellStyle:{padding:"0px 16px 0px 20px"},render:({entity:R})=>(0,r.jsx)(r.Fragment,{children:R.metadata.tags&&R.metadata.tags.map(w=>(0,r.jsx)(D.Z,{label:w,size:"small",variant:"outlined",style:{marginBottom:"0px"}},w))}),width:"auto"}},createTitleColumn(R){var w;return{title:"Title",field:"entity.metadata.title",hidden:(w=R)===null||w===void 0?void 0:w.hidden,searchable:!0}},createLabelColumn(R,w){var I;return{title:((I=w)===null||I===void 0?void 0:I.title)||"Label",field:"entity.metadata.labels",cellStyle:{padding:"0px 16px 0px 20px"},render:({entity:U})=>{var xe,Se;const k=(xe=U.metadata)===null||xe===void 0?void 0:xe.labels,Ke=k&&k[R]||((Se=w)===null||Se===void 0?void 0:Se.defaultValue);return(0,r.jsx)(r.Fragment,{children:Ke&&(0,r.jsx)(D.Z,{label:Ke,size:"small",variant:"outlined"},Ke)})},width:"auto"}},createNamespaceColumn(){return{title:"Namespace",field:"entity.metadata.namespace",width:"auto"}}});var se=n(19928),ie=n.n(se);const ne=(0,m.Z)({root:{color:"#f3ba37"}})(ye.Z),X=(R,w)=>{const I=U=>U.metadata.title||(0,f.$3)(U,{defaultKind:"Component"});return I(R).localeCompare(I(w))},K=R=>{var w,I,U,xe;const{columns:Se,actions:k,tableOptions:Ke,subtitle:yt,emptyContent:$t}=R,{isStarredEntity:zt,toggleStarredEntity:Rt}=(0,f.CR)(),{loading:Dt,error:Yt,entities:ct,filters:ut}=(0,f.wp)(),St=(0,de.useMemo)(()=>{var ot;return[E.createTitleColumn({hidden:!0}),E.createNameColumn({defaultKind:(ot=ut.kind)===null||ot===void 0?void 0:ot.value}),...Qe(),E.createMetadataDescriptionColumn(),E.createTagsColumn()];function Qe(){var ft;const gt=[E.createSystemColumn(),E.createOwnerColumn(),E.createSpecTypeColumn(),E.createSpecLifecycleColumn()];switch((ft=ut.kind)===null||ft===void 0?void 0:ft.value){case"user":return[];case"domain":case"system":return[E.createOwnerColumn()];case"group":case"template":return[E.createSpecTypeColumn()];case"location":return[E.createSpecTypeColumn(),E.createSpecTargetsColumn()];default:return ct.every(Ct=>Ct.metadata.namespace==="default")?gt:[...gt,E.createNamespaceColumn()]}}},[(w=ut.kind)===null||w===void 0?void 0:w.value,ct]),lt=ut.type===void 0;var Zt;const Gt=(0,z.capitalize)((Zt=(I=ut.user)===null||I===void 0?void 0:I.value)!==null&&Zt!==void 0?Zt:"all");if(Yt)return(0,r.jsx)("div",{children:(0,r.jsx)(W.GB,{severity:"error",title:"Could not fetch catalog entities.",children:(0,r.jsx)(W.Oi,{language:"text",text:Yt.toString()})})});const Ce=[({entity:ot})=>{var Qe;const ft=(Qe=ot.metadata.annotations)===null||Qe===void 0?void 0:Qe[p.l2],gt="View";return{icon:()=>(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(V.Z,{variant:"srOnly",children:gt}),(0,r.jsx)(F.Z,{fontSize:"small"})]}),tooltip:gt,disabled:!ft,onClick:()=>{ft&&window.open(ft,"_blank")}}},({entity:ot})=>{var Qe;const ft=(Qe=ot.metadata.annotations)===null||Qe===void 0?void 0:Qe[p.Tf],gt="Edit";return{icon:()=>(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(V.Z,{variant:"srOnly",children:gt}),(0,r.jsx)(h.Z,{fontSize:"small"})]}),tooltip:gt,disabled:!ft,onClick:()=>{ft&&window.open(ft,"_blank")}}},({entity:ot})=>{const Qe=zt(ot),ft=Qe?"Remove from favorites":"Add to favorites";return{cellStyle:{paddingLeft:"1em"},icon:()=>(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(V.Z,{variant:"srOnly",children:ft}),Qe?(0,r.jsx)(ne,{}):(0,r.jsx)(le.Z,{})]}),tooltip:ft,onClick:()=>Rt(ot)}}],Ne=ct.sort(X).map(ot=>{const Qe=(0,f.hF)(ot,p.cz,{kind:"system"}),ft=(0,f.hF)(ot,p.S4);return{entity:ot,resolved:{name:(0,f.$3)(ot,{defaultKind:"Component"}),ownedByRelationsTitle:ft.map(gt=>(0,f.$3)(gt,{defaultKind:"group"})).join(", "),ownedByRelations:ft,partOfSystemRelationTitle:Qe.map(gt=>(0,f.$3)(gt,{defaultKind:"system"})).join(", "),partOfSystemRelations:Qe}}}),Ye=(Se||St).find(ot=>ot.title==="Type");Ye&&(Ye.hidden=!lt);const ht=Ne.length>20,rt=((U=ut.kind)===null||U===void 0?void 0:U.value)||"",et=((xe=ut.type)===null||xe===void 0?void 0:xe.value)||"",vt=[Gt,et,ie()(rt)].filter(ot=>ot).join(" ");return(0,r.jsx)(W.iA,{isLoading:Dt,columns:Se||St,options:{paging:ht,pageSize:20,actionsColumnIndex:-1,loadingType:"linear",showEmptyDataSourceMessage:!Dt,padding:"dense",pageSizeOptions:[20,50,100],...Ke},title:`${vt} (${ct.length})`,data:Ne,actions:k||Ce,subtitle:yt,emptyContent:$t})};K.columns=E},85877:function(Lt,Le,n){"use strict";n.r(Le),n.d(Le,{EntityLabelsCard:function(){return de},hasLabels:function(){return D}});var r=n(52322),p=n(39709),W=n(2784),f=n(53974),V=n(79692),m=n(90436),h=n(77277);const F=`metadata:
|
|
34
|
-
name: example
|
|
35
|
-
labels:
|
|
36
|
-
javaVersion: 1.2.3`,ye=(0,V.Z)(E=>({code:{borderRadius:6,margin:E.spacing(2,0),background:E.palette.type==="dark"?"#444":E.palette.common.white}}),{name:"PluginCatalogEntityLabelsEmptyState"});function le(){const E=ye();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:E.code,children:(0,r.jsx)(f.Oi,{text:F,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 z=(0,V.Z)(E=>({key:{fontWeight:"bold"}})),de=E=>{var se,ie;const{variant:ne,title:X}=E,{entity:K}=(0,p.X2)(),R=z(),w=[{render:U=>(0,r.jsx)(m.Z,{className:R.key,variant:"body2",children:U.key})},{field:"value"}],I=(ie=K)===null||ie===void 0||(se=ie.metadata)===null||se===void 0?void 0:se.labels;return(0,r.jsx)(f.rJ,{title:X||"Labels",variant:ne,children:!I||Object.keys(I).length===0?(0,r.jsx)(le,{}):(0,r.jsx)(f.iA,{columns:w,data:Object.keys(I).map(U=>({key:U,value:I[U]})),options:{search:!1,showTitle:!0,loadingType:"linear",header:!1,padding:"dense",pageSize:5,toolbar:!1,paging:Object.keys(I).length>5}})})};function D(E){var se,ie,ne,X;return!((ie=E)===null||ie===void 0||(se=ie.metadata)===null||se===void 0)&&se.labels?Object.keys((X=E)===null||X===void 0||(ne=X.metadata)===null||ne===void 0?void 0:ne.labels).some(Boolean):!1}},24851:function(Lt,Le,n){"use strict";n.d(Le,{s:function(){return se}});var r=n(52322),p=n(90348),W=n(11861),f=n(2784),V=n(79692),m=n(95544),h=n(90436),F=n(52160),ye=n(53974);const le=(0,V.Z)({svgIcon:{display:"inline-block","& svg":{display:"inline-block",fontSize:"inherit",verticalAlign:"baseline"}}});function z(ie){const{href:ne,text:X,Icon:K}=ie,R=le();return(0,r.jsxs)(m.Z,{display:"flex",children:[(0,r.jsx)(m.Z,{mr:1,className:R.svgIcon,children:(0,r.jsx)(h.Z,{component:"div",children:K?(0,r.jsx)(K,{}):(0,r.jsx)(F.Z,{})})}),(0,r.jsx)(m.Z,{flexGrow:"1",children:(0,r.jsx)(ye.rU,{to:ne,target:"_blank",rel:"noopener",children:X||ne})})]})}var de=n(41156);const D={xs:1,sm:1,md:1,lg:2,xl:3};function E(ie){const ne=[(0,de.Z)(I=>I.breakpoints.up("xl"))?"xl":null,(0,de.Z)(I=>I.breakpoints.up("lg"))?"lg":null,(0,de.Z)(I=>I.breakpoints.up("md"))?"md":null,(0,de.Z)(I=>I.breakpoints.up("sm"))?"sm":null,(0,de.Z)(I=>I.breakpoints.up("xs"))?"xs":null];let X=1;if(typeof ie=="number")X=ie;else{var K,R;const I=(R=ne.find(U=>U!==null))!==null&&R!==void 0?R:"xs";var w;X=(w=(K=ie)===null||K===void 0?void 0:K[I])!==null&&w!==void 0?w:D[I]}return X}function se(ie){const{items:ne,cols:X=void 0}=ie,K=E(X);return(0,r.jsx)(p.Z,{rowHeight:"auto",cols:K,children:ne.map(({text:R,href:w,Icon:I},U)=>(0,r.jsx)(W.Z,{children:(0,r.jsx)(z,{href:w,text:R!=null?R:w,Icon:I})},U))})}},19625:function(Lt,Le,n){"use strict";n.d(Le,{_Z:function(){return V},jU:function(){return W},ql:function(){return f},yw:function(){return p}});var r=n(60871);const p=(0,r.x8)({id:"create-component",optional:!0}),W=(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"]}),V=(0,r.NT)({id:"catalog"})},15096:function(Lt,Le,n){"use strict";n.d(Le,{FA:function(){return ye},qO:function(){return St},Nd:function(){return k},E5:function(){return nn},Rx:function(){return w}});var r=n(60871);const p=(0,r.T0)({id:"plugin.search.queryservice"});class W{query(){return Promise.resolve(this.mockedResults||{results:[]})}constructor(te){_define_property(this,"mockedResults",void 0),this.mockedResults=te}}var f=n(52322),V=n(2784),m=n(38402),h=n(79692);const F=(0,h.Z)(()=>({highlight:{}}),{name:"BackstageHighlightedSearchResultText"}),ye=ee=>{const{text:te,preTag:G,postTag:v}=ee,O=F(),M=(0,V.useMemo)(()=>te.split(new RegExp(`(${G}.+?${v})`)),[v,G,te]);return(0,f.jsx)(f.Fragment,{children:M.map((Y,he)=>Y.includes(G)?(0,f.jsx)("mark",{className:O.highlight,children:Y.replace(new RegExp(`${G}|${v}`,"g"),"")},he):Y)})};var le=n(50581),z=n(61837),de=n(86619),D=n(77277),E=n(21853),se=n(48760),ie=n(76635),ne=n(64279),X=n(1849),K=n(51837);const R=(0,K.CT)("search-context"),w=()=>{const ee=(0,V.useContext)(R);if(!ee)throw new Error("useSearch must be used within a SearchContextProvider");const te=ee.atVersion(1);if(!te)throw new Error("No SearchContext v1 found");return te},I=()=>(0,V.useContext)(R)!==void 0,U={term:"",types:[],filters:{},pageLimit:void 0,pageCursor:void 0},xe=(ee=U)=>{var te,G,v,O;const M=(0,r.h_)(p),[Y,he]=(0,V.useState)(ee.term),[we,Oe]=(0,V.useState)(ee.types),[Xe,tt]=(0,V.useState)(ee.filters),[mt,wt]=(0,V.useState)(ee.pageLimit),[dt,Be]=(0,V.useState)(ee.pageCursor),At=(0,X.Z)(Y),Ut=(0,X.Z)(Xe),xt=(0,ne.default)(()=>M.query({term:Y,types:we,filters:Xe,pageLimit:mt,pageCursor:dt}),[Y,we,Xe,mt,dt]),Nt=!xt.loading&&!xt.error&&((te=xt.value)===null||te===void 0?void 0:te.nextPageCursor),Qt=!xt.loading&&!xt.error&&((G=xt.value)===null||G===void 0?void 0:G.previousPageCursor),jn=(0,V.useCallback)(()=>{var jt;Be((jt=xt.value)===null||jt===void 0?void 0:jt.nextPageCursor)},[(v=xt.value)===null||v===void 0?void 0:v.nextPageCursor]),Ft=(0,V.useCallback)(()=>{var jt;Be((jt=xt.value)===null||jt===void 0?void 0:jt.previousPageCursor)},[(O=xt.value)===null||O===void 0?void 0:O.previousPageCursor]);return(0,V.useEffect)(()=>{At!==void 0&&Y!==At&&Be(void 0)},[Y,At,Be]),(0,V.useEffect)(()=>{Ut!==void 0&&!(0,ie.isEqual)(Xe,Ut)&&Be(void 0)},[Xe,Ut,Be]),{result:xt,term:Y,setTerm:he,types:we,setTypes:Oe,filters:Xe,setFilters:tt,pageLimit:mt,setPageLimit:wt,pageCursor:dt,setPageCursor:Be,fetchNextPage:Nt?jn:void 0,fetchPreviousPage:Qt?Ft:void 0}},Se=ee=>{const{initialState:te,children:G}=ee,v=xe(te);return(0,f.jsx)(r.fC,{attributes:{searchTypes:v.types.sort().join(",")},children:(0,f.jsx)(R.Provider,{value:(0,K.EI)({1:v}),children:G})})},k=ee=>{const{initialState:te,inheritParentContextIfAvailable:G,children:v}=ee;return I()&&G?(0,f.jsx)(f.Fragment,{children:v}):(0,f.jsx)(Se,{initialState:te,children:v})},Ke=({children:ee})=>{var te;const G=Xe=>(0,X.Z)(Xe)!==Xe,v=(0,r.z$)(),{term:O,result:M}=w();var Y;const he=(Y=(te=M.value)===null||te===void 0?void 0:te.numberOfResults)!==null&&Y!==void 0?Y:void 0,Oe=G(M.loading)&&!M.loading;return(0,V.useEffect)(()=>{O&&Oe&&v.captureEvent("search",O,{value:he})},[v,O,he,Oe]),(0,f.jsx)(f.Fragment,{children:ee})};function yt(ee){return(0,V.forwardRef)((te,G)=>(0,f.jsx)(k,{inheritParentContextIfAvailable:!0,children:(0,f.jsx)(ee,{...te,ref:G})}))}const $t=yt((0,V.forwardRef)((ee,te)=>{const{onChange:G,onKeyDown:v=()=>{},onClear:O=()=>{},onSubmit:M=()=>{},debounceTime:Y=200,clearButton:he=!0,fullWidth:we=!0,value:Oe,label:Xe,placeholder:tt,inputProps:mt={},InputProps:wt={},endAdornment:dt,...Be}=ee,At=(0,r.h_)(r.Ds),[Ut,xt]=(0,V.useState)("");(0,V.useEffect)(()=>{xt(Xt=>Xt!==Oe?String(Oe):Xt)},[Oe]),(0,se.Z)(()=>G(Ut),Y,[Ut]);const Nt=(0,V.useCallback)(Xt=>{xt(Xt.target.value)},[xt]),Qt=(0,V.useCallback)(Xt=>{v&&v(Xt),M&&Xt.key==="Enter"&&M()},[v,M]),jn=(0,V.useCallback)(()=>{G(""),O&&O()},[G,O]),Ft=Xe?void 0:"Search",bt=tt!=null?tt:`Search in ${At.getOptionalString("app.title")||"Backstage"}`,jt=(0,f.jsx)(le.Z,{position:"start",children:(0,f.jsx)(z.Z,{"aria-label":"Query",size:"small",disabled:!0,children:(0,f.jsx)(E.Z,{})})}),Mt=(0,f.jsx)(le.Z,{position:"end",children:(0,f.jsx)(D.Z,{"aria-label":"Clear",size:"small",onClick:jn,onKeyDown:Xt=>{Xt.key==="Enter"&&Xt.stopPropagation()},children:"Clear"})});return(0,f.jsx)(Ke,{children:(0,f.jsx)(de.Z,{id:"search-bar-text-field","data-testid":"search-bar-next",variant:"outlined",margin:"normal",inputRef:te,value:Ut,label:Xe,placeholder:bt,InputProps:{startAdornment:jt,endAdornment:he?Mt:dt,...wt},inputProps:{"aria-label":Ft,...mt},fullWidth:we,onChange:Nt,onKeyDown:Qt,...Be})})})),zt=yt((0,V.forwardRef)((ee,te)=>{const{value:G="",onChange:v,...O}=ee,{term:M,setTerm:Y}=w();(0,V.useEffect)(()=>{G&&Y(String(G))},[G,Y]);const he=(0,V.useCallback)(we=>{v?v(we):Y(we)},[v,Y]);return(0,f.jsx)(r.fC,{attributes:{pluginId:"search",extension:"SearchBar"},children:(0,f.jsx)($t,{...O,ref:te,value:M,onChange:he})})}));var Rt=n(4614),Dt=n(88013);const Yt=(0,h.Z)(ee=>({loading:{right:ee.spacing(1),position:"absolute"}})),ct=ee=>te=>(0,f.jsx)(k,{inheritParentContextIfAvailable:!0,children:(0,f.jsx)(ee,{...te})}),ut=()=>{const ee=Yt();return(0,f.jsx)(Rt.Z,{className:ee.loading,"data-testid":"search-autocomplete-progressbar",color:"inherit",size:20})},St=ct(function(te){const{loading:G,value:v,onChange:O=()=>{},options:M=[],getOptionLabel:Y=Nt=>String(Nt),inputPlaceholder:he,inputDebounceTime:we,freeSolo:Oe=!0,fullWidth:Xe=!0,clearOnBlur:tt=!1,"data-testid":mt="search-autocomplete",...wt}=te,{setTerm:dt}=w(),Be=(0,V.useCallback)(Nt=>Nt?typeof Nt=="string"?Nt:Y(Nt):"",[Y]),At=(0,V.useMemo)(()=>Be(v),[v,Be]),Ut=(0,V.useCallback)((Nt,Qt,jn,Ft)=>{dt(Be(Qt)),O(Nt,Qt,jn,Ft)},[Be,dt,O]),xt=(0,V.useCallback)(({InputProps:{ref:Nt,className:Qt,endAdornment:jn},InputLabelProps:Ft,...bt})=>(0,f.jsx)(zt,{...bt,ref:Nt,clearButton:!1,value:At,placeholder:he,debounceTime:we,endAdornment:G?(0,f.jsx)(ut,{}):jn,InputProps:{className:Qt}}),[G,At,he,we]);return(0,f.jsx)(Dt.ZP,{...wt,"data-testid":mt,value:v,onChange:Ut,options:M,getOptionLabel:Y,renderInput:xt,freeSolo:Oe,fullWidth:Xe,clearOnBlur:tt})}),lt=ee=>{const{icon:te,primaryText:G,primaryTextTypographyProps:v,secondaryText:O,secondaryTextTypographyProps:M,disableTextTypography:Y}=ee;return _jsxs(_Fragment,{children:[te?_jsx(ListItemIcon,{children:te}):null,_jsx(ListItemText,{primary:G,primaryTypographyProps:v,secondary:O,secondaryTypographyProps:M,disableTypography:Y})]})};var Zt=n(42494),Gt=n(84899),Ce=n(5806),Ne=n(21324),Ye=n(56939),ht=n(73698),rt=n(12231),et=n(90436),vt=n(7089),ot=n(69294);const Qe=(ee,te,G=[],v=250)=>{const O=(0,V.useRef)({}),M=ee||(()=>Promise.resolve([])),[Y,he]=(0,ot.default)(M,[te],{loading:!0});if((0,se.Z)(()=>{O.current[te]===void 0&&(O.current[te]=he(te).then(Oe=>(O.current[te]=Oe,Oe)))},v,[he,te]),G.length)return{loading:!1,value:G};const we=O.current[te];return Array.isArray(we)?{loading:!1,value:we}:Y},ft=(ee,te)=>{const{setFilters:G}=w();(0,V.useEffect)(()=>{te&&[te].flat().length>0&&G(v=>({...v,[ee]:te}))},[])},gt=ee=>{const{className:te,defaultValue:G,name:v,values:O,valuesDebounceMs:M,label:Y,filterSelectedOptions:he,limitTags:we,multiple:Oe}=ee,[Xe,tt]=(0,V.useState)("");ft(v,G);const mt=typeof O=="function"?O:void 0,wt=typeof O=="function"?void 0:O,{value:dt,loading:Be}=Qe(mt,Xe,wt,M),{filters:At,setFilters:Ut}=w(),xt=At[v]||(Oe?[]:null),Nt=(Ft,bt)=>{Ut(jt=>{const{[v]:Mt,...Xt}=jt;return bt?{...Xt,[v]:bt}:{...Xt}})},Qt=Ft=>(0,f.jsx)(de.Z,{...Ft,name:"search",variant:"outlined",label:Y,fullWidth:!0}),jn=(Ft,bt)=>Ft.map((jt,Mt)=>(0,f.jsx)(vt.Z,{label:jt,color:"primary",...bt({index:Mt})}));return(0,f.jsx)(Dt.ZP,{filterSelectedOptions:he,limitTags:we,multiple:Oe,className:te,id:`${Oe?"multi-":""}select-filter-${v}--select`,options:dt||[],loading:Be,value:xt,onChange:Nt,onInputChange:(Ft,bt)=>tt(bt),renderInput:Qt,renderTags:jn})},Ct=(0,h.Z)({label:{textTransform:"capitalize"},checkboxWrapper:{display:"flex",alignItems:"center",width:"100%"},textWrapper:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}}),yn=ee=>{const{className:te,defaultValue:G,label:v,name:O,values:M=[],valuesDebounceMs:Y}=ee,he=Ct(),{filters:we,setFilters:Oe}=w();ft(O,G);const Xe=typeof M=="function"?M:void 0,tt=typeof M=="function"?void 0:M,{value:mt=[],loading:wt}=Qe(Xe,"",tt,Y),dt=At=>{const{target:{value:Ut,checked:xt}}=At;Oe(Nt=>{const{[O]:Qt,...jn}=Nt,Ft=(Qt||[]).filter(jt=>jt!==Ut),bt=xt?[...Ft,Ut]:Ft;return bt.length?{...jn,[O]:bt}:jn})};var Be;return(0,f.jsxs)(Zt.Z,{className:te,disabled:wt,fullWidth:!0,"data-testid":"search-checkboxfilter-next",children:[v?(0,f.jsx)(Gt.Z,{className:he.label,children:v}):null,mt.map(At=>(0,f.jsx)(Ce.Z,{classes:{root:he.checkboxWrapper,label:he.textWrapper},label:At,control:(0,f.jsx)(Ne.Z,{color:"primary",inputProps:{"aria-labelledby":At},value:At,name:At,onChange:dt,checked:((Be=we[O])!==null&&Be!==void 0?Be:[]).includes(At)})},At))]})},hn=ee=>{const{className:te,defaultValue:G,label:v,name:O,values:M,valuesDebounceMs:Y}=ee,he=Ct();ft(O,G);const we=typeof M=="function"?M:void 0,Oe=typeof M=="function"?void 0:M,{value:Xe=[],loading:tt}=Qe(we,"",Oe,Y),{filters:mt,setFilters:wt}=w(),dt=Be=>{const{target:{value:At}}=Be;wt(Ut=>{const{[O]:xt,...Nt}=Ut;return At?{...Nt,[O]:At}:Nt})};return(0,f.jsxs)(Zt.Z,{disabled:tt,className:te,variant:"filled",fullWidth:!0,"data-testid":"search-selectfilter-next",children:[v?(0,f.jsx)(Ye.Z,{className:he.label,margin:"dense",children:v}):null,(0,f.jsxs)(ht.Z,{variant:"outlined",value:mt[O]||"",onChange:dt,children:[(0,f.jsx)(rt.Z,{value:"",children:(0,f.jsx)("em",{children:"All"})}),Xe.map(Be=>(0,f.jsx)(rt.Z,{value:Be,children:(0,f.jsx)(et.Z,{variant:"inherit",noWrap:!0,children:Be})},Be))]})]})},cn=ee=>{const{component:te,...G}=ee;return(0,f.jsx)(te,{...G})};cn.Checkbox=ee=>(0,f.jsx)(cn,{...ee,component:yn}),cn.Select=ee=>(0,f.jsx)(cn,{...ee,component:hn}),cn.Autocomplete=ee=>(0,f.jsx)(cn,{...ee,component:gt});var Sn=n(48834).lW;const pn=ee=>Sn.from(ee.toString(),"utf-8").toString("base64"),xn=ee=>ee?Number(Sn.from(ee,"base64").toString("utf-8")):0,Cn=ee=>{const{total:te=-1,cursor:G,hasNextPage:v,onCursorChange:O,limit:M=25,limitLabel:Y="Results per page:",limitText:he=({from:dt,to:Be})=>te>0?`of ${te}`:`${dt}-${Be}`,limitOptions:we,onLimitChange:Oe,...Xe}=ee,tt=useMemo(()=>xn(G),[G]),mt=useCallback((dt,Be)=>{var At;(At=O)===null||At===void 0||At(pn(Be))},[O]),wt=useCallback(dt=>{var Be;const At=dt.target.value;(Be=Oe)===null||Be===void 0||Be(parseInt(At,10))},[Oe]);return _jsx(TablePagination,{...Xe,component:"div",count:te,page:tt,nextIconButtonProps:{...v!==void 0&&{disabled:!v}},onPageChange:mt,rowsPerPage:M,labelRowsPerPage:Y,labelDisplayedRows:he,rowsPerPageOptions:we,onRowsPerPageChange:wt})},on=ee=>{const{pageLimit:te,setPageLimit:G,pageCursor:v,setPageCursor:O,fetchNextPage:M}=useSearch(),Y=useCallback(he=>{G(he),O(void 0)},[G,O]);return _jsx(Cn,{...ee,hasNextPage:!!M,limit:te,onLimitChange:Y,cursor:v,onCursorChange:O})};var fn=n(53974);const wn=ee=>{const{children:te}=ee,G=useSearch(),{result:v,...O}=G;return te(v,O)},_e=ee=>{const{query:te,children:G}=ee,v=useApi(searchApiRef),O=useAsync(()=>{const{term:M="",types:Y=[],filters:he={},...we}=te;return v.query({...we,term:M,types:Y,filters:he})},[te]);return G(O,te)},Jt=ee=>{const{query:te,children:G}=ee;return te?_jsx(_e,{query:te,children:G}):_jsx(wn,{children:G})},Vt=ee=>{const{query:te,children:G,noResultsComponent:v=_jsx(EmptyState,{missing:"data",title:"Sorry, no results were found"}),...O}=ee;return _jsx(Jt,{query:te,children:({loading:M,error:Y,value:he})=>{var we;return M?_jsx(Progress,{}):Y?_jsx(ResponseErrorPanel,{title:"Error encountered while fetching search results",error:Y}):!((we=he)===null||we===void 0)&&we.results.length?isFunction(G)?G(he):_jsx(SearchResultListItemExtensions,{...O,results:he.results,children:G}):v}})},Je=ee=>_jsx(AnalyticsContext,{attributes:{pluginId:"search",extension:"SearchResult"},children:_jsx(Vt,{...ee})}),Rn=({result:ee,highlight:te,icon:G,secondaryAction:v,lineClamp:O=5})=>{var M,Y,he,we,Oe;return ee?_jsxs(_Fragment,{children:[G&&_jsx(ListItemIcon,{children:G}),_jsx(ListItemText,{primaryTypographyProps:{variant:"h6"},primary:_jsx(Link,{noTrack:!0,to:ee.location,children:!((M=te)===null||M===void 0)&&M.fields.title?_jsx(HighlightedSearchResultText,{text:((Y=te)===null||Y===void 0?void 0:Y.fields.title)||"",preTag:((he=te)===null||he===void 0?void 0:he.preTag)||"",postTag:((we=te)===null||we===void 0?void 0:we.postTag)||""}):ee.title}),secondary:_jsx(Typography,{component:"span",style:{display:"-webkit-box",WebkitBoxOrient:"vertical",WebkitLineClamp:O,overflow:"hidden"},color:"textSecondary",variant:"body2",children:!((Oe=te)===null||Oe===void 0)&&Oe.fields.text?_jsx(HighlightedSearchResultText,{text:te.fields.text,preTag:te.preTag,postTag:te.postTag}):ee.text})}),v&&_jsx(Box,{alignItems:"flex-end",children:v})]}):null},sn=ee=>_jsx(AnalyticsContext,{attributes:{pluginId:"search",extension:"DefaultResultListItem"},children:_jsx(Rn,{...ee})}),Nn=ee=>{var te;const{error:G,loading:v,resultItems:O,renderResultItem:M=Oe=>_jsx(DefaultResultListItem,{result:Oe.document},Oe.document.location),disableRenderingWithNoResults:Y,noResultsComponent:he=Y?null:_jsx(EmptyState,{missing:"data",title:"Sorry, no results were found"}),...we}=ee;return v?_jsx(Progress,{}):G?_jsx(ResponseErrorPanel,{title:"Error encountered while fetching search results",error:G}):!((te=O)===null||te===void 0)&&te.length?_jsx(List,{...we,children:O.map(M)}):_jsx(_Fragment,{children:he})},In=ee=>{const{query:te,renderResultItem:G,children:v,...O}=ee,M=useSearchResultListItemExtensions(v);return _jsx(AnalyticsContext,{attributes:{pluginId:"search",extension:"SearchResultList"},children:_jsx(SearchResultState,{query:te,children:({loading:Y,error:he,value:we})=>{var Oe;return _jsx(Nn,{...O,error:he,loading:Y,resultItems:(Oe=we)===null||Oe===void 0?void 0:Oe.results,renderResultItem:G!=null?G:M})}})})};var Pn=n(19126);const Gn=(0,h.Z)(ee=>({listSubheader:{display:"flex",alignItems:"center"},listSubheaderName:{marginLeft:ee.spacing(1),textTransform:"uppercase"},listSubheaderChip:{color:ee.palette.text.secondary,margin:ee.spacing(0,0,0,1.5)},listSubheaderFilter:{display:"flex",color:ee.palette.text.secondary,margin:ee.spacing(0,0,0,1.5)},listSubheaderLink:{marginLeft:"auto",display:"flex",alignItems:"center"},listSubheaderLinkIcon:{fontSize:"inherit",marginLeft:ee.spacing(.5)}})),Kn=ee=>{const te=Gn(),{label:G,children:v,...O}=ee;return _jsx(Chip,{...O,className:te.listSubheaderFilter,variant:"outlined",label:_jsxs(_Fragment,{children:[G,": ",v]})})},Ln=()=>null,be=(0,h.Z)(ee=>({root:{fontSize:"inherit","&:focus":{outline:"none",background:ee.palette.common.white},"&:not(:focus)":{cursor:"pointer",color:ee.palette.primary.main,"&:hover":{textDecoration:"underline"}}}})),pe=ee=>{const te=be(),{label:G,value:v="None",onChange:O,onDelete:M}=ee,Y=useCallback(he=>{O(he.target.value)},[O]);return _jsx(Kn,{label:G,onDelete:M,children:_jsx(Typography,{role:"textbox",component:"span",className:te.root,onChange:Y,contentEditable:!0,suppressContentEditableWarning:!0,children:v})})},Ie=(0,h.Z)(ee=>({root:{fontSize:"inherit","&:not(:focus)":{cursor:"pointer",color:ee.palette.primary.main,"&:hover":{textDecoration:"underline"}},"&:focus":{outline:"none"},"&>div:first-child":{padding:0}}})),H=ee=>{const te=Ie(),{label:G,value:v="none",onChange:O,onDelete:M,children:Y}=ee,he=useCallback(we=>{O(we.target.value)},[O]);return _jsx(Kn,{label:G,onDelete:M,children:_jsxs(Select,{className:te.root,value:v,onChange:he,input:_jsx(InputBase,{}),IconComponent:Ln,children:[_jsx(MenuItem,{value:"none",children:"None"}),Y]})})};function N(ee){var te,G;const v=Gn(),[O,M]=useState(null),{error:Y,loading:he,icon:we,title:Oe,titleProps:Xe={},link:tt=_jsxs(_Fragment,{children:["See all",_jsx(ArrowRightIcon,{className:v.listSubheaderLinkIcon})]}),linkProps:mt={},filterOptions:wt,renderFilterOption:dt=Mt=>_jsx(MenuItem,{value:String(Mt),children:Mt},String(Mt)),filterFields:Be,renderFilterField:At,resultItems:Ut,renderResultItem:xt=Mt=>_jsx(DefaultResultListItem,{result:Mt.document},Mt.document.location),disableRenderingWithNoResults:Nt,noResultsComponent:Qt=Nt?null:_jsx(EmptyState,{missing:"data",title:"Sorry, no results were found"}),...jn}=ee,Ft=useCallback(Mt=>{M(Mt.currentTarget)},[]),bt=useCallback(()=>{M(null)},[]);if(he)return _jsx(Progress,{});if(Y)return _jsx(ResponseErrorPanel,{title:"Error encountered while fetching search results",error:Y});if(!(!((te=Ut)===null||te===void 0)&&te.length))return _jsx(_Fragment,{children:Qt});var jt;return _jsxs(List,{...jn,children:[_jsxs(ListSubheader,{className:v.listSubheader,children:[we,_jsx(Typography,{className:v.listSubheaderName,component:"strong",...Xe,children:Oe}),wt?_jsx(Chip,{className:v.listSubheaderChip,component:"button",icon:_jsx(AddIcon,{}),variant:"outlined",label:"Add filter","aria-controls":"filters-menu","aria-haspopup":"true",onClick:Ft}):null,wt?_jsx(Menu,{id:"filters-menu",anchorEl:O,open:Boolean(O),onClose:bt,onClick:bt,keepMounted:!0,children:wt.map(dt)}):null,(G=Be)===null||G===void 0?void 0:G.map(Mt=>{var Xt;return(jt=(Xt=At)===null||Xt===void 0?void 0:Xt(Mt))!==null&&jt!==void 0?jt:null}),_jsx(Link,{className:v.listSubheaderLink,to:"/search",...mt,children:tt})]}),Ut.map(xt)]})}function ce(ee){const{query:te,children:G,renderResultItem:v,linkProps:O={},...M}=ee,Y=useSearchResultListItemExtensions(G);return _jsx(AnalyticsContext,{attributes:{pluginId:"search",extension:"SearchResultGroup"},children:_jsx(SearchResultState,{query:te,children:({loading:he,error:we,value:Oe},{term:Xe,types:tt,pageCursor:mt,filters:wt={}})=>{var dt;const Be=`/search?${qs.stringify({term:Xe,types:tt,filters:wt,pageCursor:mt,query:Xe},{arrayFormat:"brackets"})}`;return _jsx(N,{...M,error:we,loading:he,linkProps:{to:Be,...O},filterFields:Object.keys(wt),resultItems:(dt=Oe)===null||dt===void 0?void 0:dt.results,renderResultItem:v!=null?v:Y})}})})}const Ae=(0,h.Z)(ee=>({root:{display:"flex",justifyContent:"space-between",gap:ee.spacing(2),margin:ee.spacing(2,0)}})),$e=()=>{const{fetchNextPage:ee,fetchPreviousPage:te}=useSearch(),G=Ae();return!ee&&!te?_jsx(_Fragment,{}):_jsxs("nav",{"aria-label":"pagination navigation",className:G.root,children:[_jsx(Button,{"aria-label":"previous page",disabled:!te,onClick:te,startIcon:_jsx(ArrowBackIosIcon,{}),children:"Previous"}),_jsx(Button,{"aria-label":"next page",disabled:!ee,onClick:ee,endIcon:_jsx(ArrowForwardIosIcon,{}),children:"Next"})]})},qe="search.results.list.items.extensions.v1",It=(ee,te)=>{for(const v of ee){var G;if(!(!isValidElement(v)||!(!((G=getComponentData(v,qe))===null||G===void 0)&&G(te))))return cloneElement(v,{rank:te.rank,highlight:te.highlight,result:te.document,...v.props})}return null},Bt=ee=>{const{rank:te,result:G,noTrack:v,children:O,alignItems:M="flex-start",...Y}=ee,he=(0,r.z$)(),we=(0,V.useCallback)(()=>{v||G&&he.captureEvent("discover",G.title,{attributes:{to:G.location},value:te})},[te,G,v,he]);return(0,f.jsx)(m.Z,{divider:!0,alignItems:M,onClickCapture:we,...Y,children:O})},nn=ee=>{const{name:te,component:G,predicate:v=()=>!0}=ee;return(0,r.YO)({name:te,component:{lazy:()=>G().then(O=>M=>(0,f.jsx)(Bt,{rank:M.rank,result:M.result,noTrack:M.noTrack,children:(0,V.createElement)(O,M)}))},data:{[qe]:v}})},ln=ee=>{const te=useElementFilter(ee,G=>G.selectByComponentData({key:qe}).getElements(),[ee]);return useCallback((G,v)=>{const O=It(te,G);return _jsx(Fragment,{children:O!=null?O:_jsx(Bt,{rank:G.rank,result:G.document,children:_jsx(DefaultResultListItem,{rank:G.rank,highlight:G.highlight,result:G.document})})},v)},[te])},rn=ee=>{const{results:te,children:G,...v}=ee,O=ln(G);return _jsx(List,{...v,children:te.map(O)})}},61886:function(Lt,Le,n){"use strict";n.d(Le,{Ox:function(){return Rt},jM:function(){return V},Zz:function(){return m},oZ:function(){return k},DR:function(){return h},ZS:function(){return xe},VA:function(){return ct},KY:function(){return ye},gT:function(){return E},Dl:function(){return se},ux:function(){return Yt},$L:function(){return D},x1:function(){return Se}});var r=n(52322),p=n(2784),W=n(73557),f=n(60871);const V="techdocs.addons.addon.v1",m="techdocs.addons.wrapper.v1",h=()=>null;(0,f.R5)(h,m,!0);const F=Ce=>`${V}.${Ce.toLocaleLowerCase("en-US")}`;function ye(Ce){const{name:Ne,component:Ye}=Ce;return(0,f.YO)({name:Ne,component:{sync:ht=>(0,r.jsx)(Ye,{...ht})},data:{[V]:Ce,[F(Ne)]:!0}})}const le=(Ce,Ne)=>Ce.selectByComponentData({key:Ne}).getElements()[0],z=Ce=>Ce.selectByComponentData({key:m}).selectByComponentData({key:V}),de=Ce=>Ce.selectByComponentData({key:m}).findComponentData({key:V}),D=()=>{const Ce=(0,W.pC)(),Ne=(0,f.vJ)(Ce,z),Ye=(0,f.vJ)(Ce,de),ht=(0,p.useCallback)(vt=>{if(!Ne||!vt)return null;const ot=F(vt.name);var Qe;return(Qe=le(Ne,ot))!==null&&Qe!==void 0?Qe:null},[Ne]),rt=(0,p.useCallback)(vt=>{const ot=Ye.find(Qe=>Qe.name===vt);return ot?ht(ot):null},[Ye,ht]),et=(0,p.useCallback)(vt=>{const ot=Ye.filter(Qe=>Qe.location===vt);return ot.length?ot.map(ht):null},[Ye,ht]);return{renderComponentByName:rt,renderComponentsByLocation:et}},E=(0,f.T0)({id:"plugin.techdocs.service"}),se=(0,f.T0)({id:"plugin.techdocs.storageservice"});var ie=n(64279),ne=n(77446),X=n(25271),K=n(51837);function R(Ce,Ne){return Ne.getOptionalBoolean("techdocs.legacyUseCaseSensitiveTripletPaths")||(Ce.kind=Ce.kind.toLocaleLowerCase(),Ce.name=Ce.name.toLocaleLowerCase(),Ce.namespace=Ce.namespace.toLocaleLowerCase()),Ce}const w=(Ce,Ne)=>(0,X.eE)(Ce)===(0,X.eE)(Ne),I={title:"",subtitle:"",setTitle:()=>{},setSubtitle:()=>{},setShadowRoot:()=>{},metadata:{loading:!0},entityMetadata:{loading:!0},entityRef:{kind:"",name:"",namespace:""}},U=(0,K.CT)("techdocs-reader-page-context"),xe=(0,p.memo)(Ce=>{const{entityRef:Ne,children:Ye}=Ce,ht=(0,f.h_)(E),rt=(0,f.h_)(f.Ds),et=(0,ie.default)(async()=>ht.getEntityMetadata(Ne),[Ne]),vt=(0,ne.Z)(async()=>ht.getTechDocsMetadata(Ne),[Ne]),[ot,Qe]=(0,p.useState)(I.title),[ft,gt]=(0,p.useState)(I.subtitle),[Ct,yn]=(0,p.useState)(I.shadowRoot);(0,p.useEffect)(()=>{Ct&&!vt.value&&!vt.loading&&vt.retry()},[vt.value,vt.loading,Ct,vt.retry,vt]);const hn={metadata:vt,entityRef:R(Ne,rt),entityMetadata:et,shadowRoot:Ct,setShadowRoot:yn,title:ot,setTitle:Qe,subtitle:ft,setSubtitle:gt},cn=(0,K.EI)({1:hn});return(0,r.jsx)(f.fC,{attributes:{entityRef:(0,X.eE)(Ne)},children:(0,r.jsx)(U.Provider,{value:cn,children:Ye instanceof Function?Ye(hn):Ye})})},(Ce,Ne)=>w(Ce.entityRef,Ne.entityRef)),Se=()=>{const Ce=(0,p.useContext)(U);if(Ce===void 0)return I;const Ne=Ce.atVersion(1);if(Ne===void 0)throw new Error("No context found for version 1.");return Ne},k=Object.freeze({Header:"Header",Subheader:"Subheader",Settings:"Settings",PrimarySidebar:"PrimarySidebar",SecondarySidebar:"SecondarySidebar",Content:"Content"});var Ke=n(70882),yt=n(50236),$t=n(19219),zt=n(53974);const Rt="TECH_DOCS_SHADOW_DOM_STYLE_LOAD",Dt=Ce=>{(0,p.useEffect)(()=>{var Ne,Ye;if(!Ce)return()=>{};const ht=Ce.querySelectorAll('head > link[rel="stylesheet"]');var rt;let et=(rt=(Ne=ht)===null||Ne===void 0?void 0:Ne.length)!==null&&rt!==void 0?rt:0;const vt=new CustomEvent(Rt);if(!et)return Ce.dispatchEvent(vt),()=>{};const ot=()=>{--et===0&&Ce.dispatchEvent(vt)};return(Ye=ht)===null||Ye===void 0||Ye.forEach(Qe=>{Qe.addEventListener("load",ot)}),()=>{var Qe;(Qe=ht)===null||Qe===void 0||Qe.forEach(ft=>{ft.removeEventListener("load",ot)})}},[Ce])},Yt=Ce=>{const[Ne,Ye]=(0,p.useState)(!1);return(0,p.useEffect)(()=>{if(!Ce)return()=>{};Ye(!0);const ht=Ce.style;ht.setProperty("opacity","0");const rt=()=>{Ye(!1),ht.setProperty("opacity","1")};return Ce.addEventListener(Rt,rt),()=>{Ce.removeEventListener(Rt,rt)}},[Ce]),Ne},ct=Ce=>{const{element:Ne,onAppend:Ye,children:ht}=Ce,[rt,et]=(0,p.useState)((0,Ke.Ue)({...(0,yt.Z)(),insertionPoint:void 0}));Dt(Ne);const vt=Yt(Ne),ot=(0,p.useCallback)(Qe=>{if(!Ne||!Qe)return;et((0,Ke.Ue)({...(0,yt.Z)(),insertionPoint:Ne.querySelector("head")||void 0}));let ft=Qe.shadowRoot;ft||(ft=Qe.attachShadow({mode:"open"})),ft.replaceChildren(Ne),typeof Ye=="function"&&Ye(ft)},[Ne,Ye]);return(0,r.jsxs)(r.Fragment,{children:[vt&&(0,r.jsx)(zt.Ex,{}),(0,r.jsxs)($t.ZP,{jss:rt,sheetsManager:new Map,children:[(0,r.jsx)("div",{ref:ot,"data-testid":"techdocs-native-shadowroot"}),ht]})]})};var ut=n(54073);const St=()=>{const{shadowRoot:Ce}=useTechDocsReaderPage();return Ce},lt=Ce=>{const Ne=St();return Ne?Ce.map(Ye=>{var ht;return(ht=Ne)===null||ht===void 0?void 0:ht.querySelectorAll(Ye)}).filter(Ye=>Ye.length).map(Ye=>Array.from(Ye)).flat():[]},Zt=Ce=>Ce.toString()&&Ce.rangeCount&&Ce.getRangeAt(0).getBoundingClientRect().top,Gt=(Ce=0)=>{const Ne=St(),[Ye,ht]=useState(null),rt=useMemo(()=>debounce(()=>{const et=Ne,vt=et.getSelection?et.getSelection():document.getSelection();vt&&Zt(vt)?ht(vt):ht(null)},Ce),[Ne,ht,Ce]);return useEffect(()=>(window.document.addEventListener("selectionchange",rt),()=>{rt.cancel(),window.document.removeEventListener("selectionchange",rt)}),[rt]),Ye}},52943:function(Lt,Le,n){"use strict";n.r(Le),n.d(Le,{EmbeddedDocsRouter:function(){return ie},Router:function(){return se},isTechDocsAvailable:function(){return E}});var r=n(52322),p=n(2784),W=n(73557),f=n(39709),V=n(53974),m=n(25271),h=n(89258),F=n(65124),ye=n(86317);const le=({entity:ne})=>{const X=(0,m.iB)(ne);return(0,r.jsxs)(h.I6,{entityRef:X,children:[(0,r.jsx)(F.b,{}),(0,r.jsx)(ye.F,{withSearch:!1})]})};var z=n(18662),de=n(7476);const D="backstage.io/techdocs-ref",E=ne=>{var X,K,R;return Boolean((R=ne)===null||R===void 0||(K=R.metadata)===null||K===void 0||(X=K.annotations)===null||X===void 0?void 0:X[D])},se=()=>(0,r.jsxs)(W.Z5,{children:[(0,r.jsx)(W.AW,{path:"/",element:(0,r.jsx)(z.TechDocsIndexPage,{})}),(0,r.jsx)(W.AW,{path:"/:namespace/:kind/:name/*",element:(0,r.jsx)(de.TechDocsReaderPage,{})})]}),ie=ne=>{var X;const{children:K}=ne,{entity:R}=(0,f.X2)(),w=(0,W.V$)([{path:"/*",element:(0,r.jsx)(le,{entity:R}),children:[{path:"*",element:K}]}]);return((X=R.metadata.annotations)===null||X===void 0?void 0:X[D])?w:(0,r.jsx)(V.sk,{annotation:D})}},92077:function(Lt,Le,n){"use strict";n.d(Le,{k:function(){return m},p:function(){return V}});var r=n(87612),p=n(23054),W=n(54847),f=n.n(W);class V{async getApiOrigin(){return await this.discoveryApi.getBaseUrl("techdocs")}async getTechDocsMetadata(F){const{kind:ye,namespace:le,name:z}=F,D=`${await this.getApiOrigin()}/metadata/techdocs/${le}/${ye}/${z}`,E=await this.fetchApi.fetch(`${D}`);if(!E.ok)throw await p.VL.fromResponse(E);return await E.json()}async getEntityMetadata(F){const{kind:ye,namespace:le,name:z}=F,D=`${await this.getApiOrigin()}/metadata/entity/${le}/${ye}/${z}`,E=await this.fetchApi.fetch(`${D}`);if(!E.ok)throw await p.VL.fromResponse(E);return await E.json()}constructor(F){(0,r._)(this,"configApi",void 0),(0,r._)(this,"discoveryApi",void 0),(0,r._)(this,"fetchApi",void 0),this.configApi=F.configApi,this.discoveryApi=F.discoveryApi,this.fetchApi=F.fetchApi}}class m{async getApiOrigin(){return await this.discoveryApi.getBaseUrl("techdocs")}async getStorageUrl(){var F;return(F=this.configApi.getOptionalString("techdocs.storageUrl"))!==null&&F!==void 0?F:`${await this.discoveryApi.getBaseUrl("techdocs")}/static/docs`}async getBuilder(){return this.configApi.getString("techdocs.builder")}async getEntityDocs(F,ye){const{kind:le,namespace:z,name:de}=F,E=`${await this.getStorageUrl()}/${z}/${le}/${de}/${ye}`,se=await this.fetchApi.fetch(`${E.endsWith("/")?E:`${E}/`}index.html`);let ie="";switch(se.status){case 404:throw ie="Page not found. ",ye||(ie+="This could be because there is no index.md file in the root of the docs directory of this repository."),new p.dR(ie);case 500:throw ie="Could not generate documentation or an error in the TechDocs backend. ",new Error(ie);default:break}return se.text()}async syncEntityDocs(F,ye=()=>{}){const{kind:le,namespace:z,name:de}=F,E=`${await this.getApiOrigin()}/sync/${z}/${le}/${de}`,{token:se}=await this.identityApi.getCredentials();return new Promise((ie,ne)=>{const X=new W.EventSourcePolyfill(E,{withCredentials:!0,headers:se?{Authorization:`Bearer ${se}`}:{}});X.addEventListener("log",K=>{K.data&&ye(JSON.parse(K.data))}),X.addEventListener("finish",K=>{let R=!1;K.data&&({updated:R}=JSON.parse(K.data)),ie(R?"updated":"cached")}),X.onerror=K=>{switch(X.close(),K.status){case 404:ne(new p.dR(K.message));return;default:ne(new Error(K.data));return}}})}async getBaseUrl(F,ye,le){const{kind:z,namespace:de,name:D}=ye,se=`${await this.getApiOrigin()}/static/docs/${de}/${z}/${D}/${le}`;return new URL(F,se.endsWith("/")?se:`${se}/`).toString()}constructor(F){(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=F.configApi,this.discoveryApi=F.discoveryApi,this.identityApi=F.identityApi,this.fetchApi=F.fetchApi}}},51953:function(Lt,Le,n){"use strict";n.d(Le,{D:function(){return r}});function r(p,W){return W.getOptionalBoolean("techdocs.legacyUseCaseSensitiveTripletPaths")?p:p.toLocaleLowerCase("en-US")}},3482:function(Lt,Le,n){"use strict";n.d(Le,{u:function(){return F}});var r=n(52322),p=n(2784),W=n(53974),f=n(39709),V=n(42081),m=n(48431),h=n(68435);const F=ye=>{const{initialFilter:le="owned",columns:z,actions:de}=ye;return(0,r.jsx)(V.j,{children:(0,r.jsxs)(W.VY,{children:[(0,r.jsx)(W.yW,{title:"",children:(0,r.jsx)(W.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:le}),(0,r.jsx)(f.dq,{}),(0,r.jsx)(f.xE,{})]}),(0,r.jsx)(f._i.Content,{children:(0,r.jsx)(h.n,{actions:de,columns:z})})]})})]})})}},85478:function(Lt,Le,n){"use strict";n.d(Le,{f:function(){return z}});var r=n(52322),p=n(95573),W=n(51953),f=n(60871),V=n(53974),m=n(94339),h=n(16111),F=n(24579),ye=n(14503),le=n(2784);const z=ie=>{var ne;const{entities:X}=ie,K=(0,f.tg)(p.Fw),R=(0,f.h_)(f.Ds);if(!X)return null;var w,I;return(0,r.jsx)(V.Oh,{"data-testid":"docs-explore",children:!((ne=X)===null||ne===void 0)&&ne.length?X.map((U,xe)=>(0,r.jsxs)(m.Z,{children:[(0,r.jsx)(h.Z,{children:(0,r.jsx)(V.hu,{title:(w=U.metadata.title)!==null&&w!==void 0?w:U.metadata.name})}),(0,r.jsx)(F.Z,{children:U.metadata.description}),(0,r.jsx)(ye.Z,{children:(0,r.jsx)(V.Qj,{to:K({namespace:(0,W.D)((I=U.metadata.namespace)!==null&&I!==void 0?I:"default",R),kind:(0,W.D)(U.kind,R),name:(0,W.D)(U.metadata.name,R)}),color:"primary","data-testid":"read_docs",children:"Read Docs"})})]},xe)):null})};var de=n(39709);const D={title:"All Documentation",filterPredicate:()=>!0},E=ie=>{const{entities:ne,group:X}=ie,{loading:K,isOwnedEntity:R}=useEntityOwnership(),w=ne.filter(U=>X.filterPredicate==="ownedByUser"?K?!1:R(U):typeof X.filterPredicate=="function"&&X.filterPredicate(U)),I=(()=>typeof X.title=="string"?_jsx(ContentHeader,{title:X.title}):X.title)();return w.length===0?null:_jsxs(Content,{children:[I,_jsx(DocsCardGrid,{entities:w})]})},se=ie=>{const{loading:ne,error:X,entities:K}=useEntityList();if(X)return _jsx(WarningPanel,{severity:"error",title:"Could not load available documentation.",children:_jsx(CodeSnippet,{language:"text",text:X.toString()})});if(ne)return _jsx(Progress,{});if(K.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 R,w;return K.sort((I,U)=>((R=I.metadata.title)!==null&&R!==void 0?R:I.metadata.name).localeCompare((w=U.metadata.title)!==null&&w!==void 0?w:U.metadata.name)),_jsx(Content,{children:(ie.groups||[D]).map((I,U)=>_jsx(E,{entities:K,group:I},`${I.title}-${U}`))})}},68435:function(Lt,Le,n){"use strict";n.d(Le,{H:function(){return K},n:function(){return R}});var r=n(52322),p=n(2784),W=n(95074),f=n(76635),V=n(53974),m=n(39709),h=n(60871),F=n(25271),ye=n(95573),le=n(39981),z=n(2337),de=n(11640),D=n(28347);const E=(0,z.Z)({root:{color:"#f3ba37"}})(de.Z),se={createCopyDocsUrlAction(w){return I=>({icon:()=>(0,r.jsx)(le.Z,{fontSize:"small"}),tooltip:"Click to copy documentation link to clipboard",onClick:()=>w(`${window.location.origin}${I.resolved.docsUrl}`)})},createStarEntityAction(w,I){return U=>{const xe=U.entity,Se=w(xe);return{cellStyle:{paddingLeft:"1em"},icon:()=>Se?(0,r.jsx)(E,{}):(0,r.jsx)(D.Z,{}),tooltip:Se?"Remove from favorites":"Add to favorites",onClick:()=>I(xe)}}}};function ie(w){return w.metadata.title||w.metadata.name}const ne={createNameColumn(){return{title:"Document",field:"entity.metadata.name",highlight:!0,render:w=>(0,r.jsx)(V.uw,{value:(0,r.jsx)(V.rU,{to:w.resolved.docsUrl,children:ie(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 X=n(51953);const K=w=>{const{entities:I,title:U,loading:xe,columns:Se,actions:k,options:Ke}=w,[,yt]=(0,W.Z)(),$t=(0,h.tg)(ye.Fw),zt=(0,h.h_)(h.Ds);if(!I)return null;const Rt=I.map(ct=>{const ut=(0,m.hF)(ct,F.S4);var St;return{entity:ct,resolved:{docsUrl:$t({namespace:(0,X.D)((St=ct.metadata.namespace)!==null&&St!==void 0?St:"default",zt),kind:(0,X.D)(ct.kind,zt),name:(0,X.D)(ct.metadata.name,zt)}),ownedByRelations:ut,ownedByRelationsTitle:ut.map(lt=>(0,m.$3)(lt,{defaultKind:"group"})).join(", ")}}}),Dt=[ne.createNameColumn(),ne.createOwnerColumn(),ne.createTypeColumn()],Yt=[se.createCopyDocsUrlAction(yt)];return(0,r.jsx)(r.Fragment,{children:xe||Rt&&Rt.length>0?(0,r.jsx)(V.iA,{isLoading:xe,options:{paging:!0,pageSize:20,search:!0,actionsColumnIndex:-1,...Ke},data:Rt,columns:Se||Dt,actions:k||Yt,title:U?`${U} (${Rt.length})`:`All (${Rt.length})`}):(0,r.jsx)(V.ub,{missing:"data",title:"No documents to show",description:"Create your own document. Check out our Getting Started Information",action:(0,r.jsx)(V.Qj,{color:"primary",to:"https://backstage.io/docs/features/techdocs/getting-started",variant:"contained",children:"DOCS"})})})};K.columns=ne,K.actions=se;const R=w=>{var I;const{columns:U,actions:xe,options:Se}=w,{loading:k,error:Ke,entities:yt,filters:$t}=(0,m.wp)(),{isStarredEntity:zt,toggleStarredEntity:Rt}=(0,m.CR)(),[,Dt]=(0,W.Z)();var Yt;const ct=(0,f.capitalize)((Yt=(I=$t.user)===null||I===void 0?void 0:I.value)!==null&&Yt!==void 0?Yt:"all"),ut=[se.createCopyDocsUrlAction(Dt),se.createStarEntityAction(zt,Rt)];return Ke?(0,r.jsx)(V.GB,{severity:"error",title:"Could not load available documentation.",children:(0,r.jsx)(V.Oi,{language:"text",text:Ke.toString()})}):(0,r.jsx)(K,{title:ct,entities:yt,loading:k,actions:xe||ut,columns:U,options:Se})};R.columns=ne,R.actions=se},18662:function(Lt,Le,n){"use strict";n.r(Le),n.d(Le,{TechDocsIndexPage:function(){return V}});var r=n(52322),p=n(2784),W=n(73557),f=n(3482);const V=m=>(0,W.pC)()||(0,r.jsx)(f.u,{...m})},42081:function(Lt,Le,n){"use strict";n.d(Le,{j:function(){return V}});var r=n(52322),p=n(2784),W=n(53974),f=n(60871);const V=m=>{const{children:h}=m,F=(0,f.h_)(f.Ds);var ye;const le=`Documentation available in ${(ye=F.getOptionalString("organization.name"))!==null&&ye!==void 0?ye:"Backstage"}`;return(0,r.jsx)(W.g9,{title:"Documentation",subtitle:le,themeId:"documentation",children:h})}},48431:function(Lt,Le,n){"use strict";n.d(Le,{f:function(){return f}});var r=n(2784),p=n(39709);class W{getCatalogFilters(){return{"metadata.annotations.backstage.io/techdocs-ref":p.n3}}}const f=()=>{const{updateFilters:V}=(0,p.wp)();return(0,r.useEffect)(()=>{V({techdocs:new W})},[V]),null}},89258:function(Lt,Le,n){"use strict";n.d(Le,{I6:function(){return z},Jl:function(){return le},s4:function(){return m}});var r=n(61886),p=n(92077),W=n(95573),f=n(60871),V=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:D,discoveryApi:E,identityApi:se,fetchApi:ie})=>new p.k({configApi:D,discoveryApi:E,identityApi:se,fetchApi:ie})}),(0,f.ni)({api:r.gT,deps:{configApi:f.Ds,discoveryApi:f.NW,fetchApi:f.gP},factory:({configApi:D,discoveryApi:E,fetchApi:se})=>new p.p({configApi:D,discoveryApi:E,fetchApi:se})})],routes:{root:W._Z,docRoot:W.Fw,entityContent:W.pd}}),h=m.provide((0,f.P4)({name:"TechdocsPage",component:()=>Promise.resolve().then(n.bind(n,52943)).then(D=>D.Router),mountPoint:W._Z})),F=m.provide((0,f.P4)({name:"EntityTechdocsContent",component:()=>Promise.resolve().then(n.bind(n,52943)).then(D=>D.EmbeddedDocsRouter),mountPoint:W.pd})),ye=m.provide((0,f.P4)({name:"TechDocsCustomHome",component:()=>n.e(7560).then(n.bind(n,27560)).then(D=>D.TechDocsCustomHome),mountPoint:W._Z})),le=m.provide((0,f.P4)({name:"TechDocsIndexPage",component:()=>Promise.resolve().then(n.bind(n,18662)).then(D=>D.TechDocsIndexPage),mountPoint:W._Z})),z=m.provide((0,f.P4)({name:"TechDocsReaderPage",component:()=>Promise.resolve().then(n.bind(n,7476)).then(D=>D.TechDocsReaderPage),mountPoint:W.Fw})),de=m.provide((0,V.E5)({name:"TechDocsSearchResultListItem",component:()=>Promise.resolve().then(n.bind(n,55511)).then(D=>D.TechDocsSearchResultListItem),predicate:D=>D.type==="techdocs"}))},7476:function(Lt,Le,n){"use strict";n.r(Le),n.d(Le,{TechDocsReaderLayout:function(){return z},TechDocsReaderPage:function(){return de}});var r=n(52322),p=n(2784),W=n(73557),f=n(53974),V=n(61886),m=n(86317),h=n(93225),F=n(65124),ye=n(95573),le=n(60871);const z=D=>{const{withSearch:E,withHeader:se=!0}=D;return(0,r.jsxs)(f.T3,{themeId:"documentation",children:[se&&(0,r.jsx)(h.S,{}),(0,r.jsx)(F.b,{}),(0,r.jsx)(m.F,{withSearch:E})]})},de=D=>{const{kind:E,name:se,namespace:ie}=(0,le.Oi)(ye.Fw),{children:ne,entityRef:X={kind:E,name:se,namespace:ie}}=D,K=(0,W.pC)();if(!ne){const w=K?p.Children.toArray(K.props.children):[];var R;const U=w.flatMap(xe=>{var Se,k;return(R=(k=xe)===null||k===void 0||(Se=k.props)===null||Se===void 0?void 0:Se.children)!==null&&R!==void 0?R:[]}).find(xe=>!(0,le.IY)(xe,V.Zz)&&!(0,le.IY)(xe,V.jM));return(0,r.jsx)(V.ZS,{entityRef:X,children:U||(0,r.jsx)(z,{})})}return(0,r.jsx)(V.ZS,{entityRef:X,children:({metadata:w,entityMetadata:I,onReady:U})=>(0,r.jsx)("div",{className:"techdocs-reader-page",children:(0,r.jsx)(f.T3,{themeId:"documentation",children:ne instanceof Function?ne({entityRef:X,techdocsMetadataValue:w.value,entityMetadataValue:I.value,onReady:U}):ne})})})}},86317:function(Lt,Le,n){"use strict";n.d(Le,{F:function(){return te}});var r=n(52322),p=n(2784),W=n(79692),f=n(60905),V=n(61886),m=n(53974),h=n(22478),F=n(4614),ye=n(77277),le=n(99688),z=n(12420),de=n(90436),D=n(61837),E=n(4190),se=n(87685);const ie=(0,W.Z)(v=>(0,z.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}})),ne=({buildLog:v,onClose:O})=>{const M=ie(),Y=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)(de.Z,{variant:"h5",children:"Build Details"}),(0,r.jsx)(D.Z,{title:"Close the drawer",onClick:O,color:"inherit",children:(0,r.jsx)(se.Z,{})},"dismiss")]}),(0,r.jsx)(f.Z,{item:!0,xs:!0,children:(0,r.jsx)(m.nU,{text:Y,classes:{root:M.logs}})})]})},X=({buildLog:v})=>{const O=ie(),[M,Y]=(0,p.useState)(!1);return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(ye.Z,{color:"inherit",onClick:()=>Y(!0),children:"Show Build Logs"}),(0,r.jsx)(E.ZP,{classes:{paper:O.paper},anchor:"right",open:M,onClose:()=>Y(!1),children:(0,r.jsx)(ne,{buildLog:v,onClose:()=>Y(!1)})})]})};var K=n(60871);const R=({errorMessage:v})=>{const O=(0,K.h_)(K.Ds).getOptionalString("techdocs.builder");let M="";return O!=="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 I=(0,W.Z)(v=>({root:{marginBottom:v.spacing(2)},message:{wordBreak:"break-word",overflowWrap:"anywhere"}})),U=()=>{let v=null;const O=I(),{state:M,contentReload:Y,contentErrorMessage:he,syncErrorMessage:we,buildLog:Oe}=(0,w.DK)();return M==="INITIAL_BUILD"&&(v=(0,r.jsx)(le.Z,{classes:{root:O.root},variant:"outlined",severity:"info",icon:(0,r.jsx)(F.Z,{size:"24px"}),action:(0,r.jsx)(X,{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)(le.Z,{variant:"outlined",severity:"info",icon:(0,r.jsx)(F.Z,{size:"24px"}),action:(0,r.jsx)(X,{buildLog:Oe}),classes:{root:O.root},children:"A newer version of this documentation is being prepared and will be available shortly."})),M==="CONTENT_STALE_READY"&&(v=(0,r.jsx)(le.Z,{variant:"outlined",severity:"success",action:(0,r.jsx)(ye.Z,{color:"inherit",onClick:()=>Y(),children:"Refresh"}),classes:{root:O.root},children:"A newer version of this documentation is now available, please refresh to view."})),M==="CONTENT_STALE_ERROR"&&(v=(0,r.jsxs)(le.Z,{variant:"outlined",severity:"error",action:(0,r.jsx)(X,{buildLog:Oe}),classes:{root:O.root,message:O.message},children:["Building a newer version of this documentation failed."," ",we]})),M==="CONTENT_NOT_FOUND"&&(v=(0,r.jsxs)(r.Fragment,{children:[we&&(0,r.jsxs)(le.Z,{variant:"outlined",severity:"error",action:(0,r.jsx)(X,{buildLog:Oe}),classes:{root:O.root,message:O.message},children:["Building a newer version of this documentation failed."," ",we]}),(0,r.jsx)(R,{errorMessage:he})]})),v};var xe=n(60364),Se=n(41156),k=n(32838),Ke=n(35368),yt=n.n(Ke);const $t=/main\.[A-Fa-f0-9]{8}\.min\.css$/,zt=/^https:\/\/fonts\.googleapis\.com/,Rt=/^https:\/\/fonts\.gstatic\.com/,Dt=v=>v.nodeName==="LINK",Yt=v=>{var O;const M=((O=v)===null||O===void 0?void 0:O.getAttribute("href"))||"",Y=M.match($t),he=M.match(zt),we=M.match(Rt);return Y||he||we},ct=v=>(Dt(v)&&!Yt(v)&&v.remove(),v),ut=v=>v.nodeName==="IFRAME",St=(v,O)=>{const M=v.getAttribute("src")||"";try{const{host:Y}=new URL(M);return O.includes(Y)}catch{return!1}},lt=v=>O=>(ut(O)&&!St(O,v)&&O.remove(),O),Zt=()=>{const v=(0,K.h_)(K.Ds);return(0,p.useMemo)(()=>v.getOptionalConfig("techdocs.sanitizer"),[v])},Gt=()=>{const v=Zt();return(0,p.useCallback)(async O=>{var M;const Y=(M=v)===null||M===void 0?void 0:M.getOptionalStringArray("allowedIframeHosts");yt().addHook("beforeSanitizeElements",ct);const he=["link"];return Y&&(he.push("iframe"),yt().addHook("beforeSanitizeElements",lt(Y))),yt().sanitize(O.outerHTML,{ADD_TAGS:he,FORBID_TAGS:["style"],WHOLE_DOCUMENT:!0,RETURN_DOM:!0})},[v])};var Ce=n(41128),Ne=({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,Ce.$n)(v.palette.text.secondary,.7)};
|
|
49
|
-
--md-default-fg-color--lightest: ${(0,Ce.$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,Ce.$n)(v.palette.background.paper,.7)};
|
|
55
|
-
--md-default-bg-color--lightest: ${(0,Ce.$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,Ce.$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,Ce.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,Ce.Fq)(v.palette.error.dark,.5):(0,Ce.Fq)(v.palette.error.light,.5)};
|
|
128
|
-
--md-typeset-ins-color: ${v.palette.type==="dark"?(0,Ce.Fq)(v.palette.success.dark,.5):(0,Ce.Fq)(v.palette.success.light,.5)};
|
|
129
|
-
--md-typeset-mark-color: ${v.palette.type==="dark"?(0,Ce.Fq)(v.palette.warning.dark,.5):(0,Ce.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
|
-
`,Ye=({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 ht="224px";var rt=({theme:v,sidebar:O})=>`
|
|
156
|
-
/*================== Layout ==================*/
|
|
157
|
-
|
|
158
|
-
/* mkdocs material v9 compat */
|
|
159
|
-
.md-nav__title {
|
|
160
|
-
color: var(--md-default-fg-color);
|
|
161
|
-
}
|
|
162
|
-
|
|
163
|
-
.md-grid {
|
|
164
|
-
max-width: 100%;
|
|
165
|
-
margin: 0;
|
|
166
|
-
}
|
|
167
|
-
|
|
168
|
-
.md-nav {
|
|
169
|
-
font-size: calc(var(--md-typeset-font-size) * 0.9);
|
|
170
|
-
}
|
|
171
|
-
.md-nav__link {
|
|
172
|
-
display: flex;
|
|
173
|
-
align-items: center;
|
|
174
|
-
justify-content: space-between;
|
|
175
|
-
}
|
|
176
|
-
.md-nav__icon {
|
|
177
|
-
height: 20px !important;
|
|
178
|
-
width: 20px !important;
|
|
179
|
-
margin-left:${v.spacing(1)}px;
|
|
180
|
-
}
|
|
181
|
-
.md-nav__icon svg {
|
|
182
|
-
margin: 0;
|
|
183
|
-
width: 20px !important;
|
|
184
|
-
height: 20px !important;
|
|
185
|
-
}
|
|
186
|
-
.md-nav__icon:after {
|
|
187
|
-
width: 20px !important;
|
|
188
|
-
height: 20px !important;
|
|
189
|
-
}
|
|
190
|
-
|
|
191
|
-
.md-nav__item--active > .md-nav__link, a.md-nav__link--active {
|
|
192
|
-
text-decoration: underline;
|
|
193
|
-
color: var(--md-typeset-a-color);
|
|
194
|
-
}
|
|
195
|
-
|
|
196
|
-
.md-main__inner {
|
|
197
|
-
margin-top: 0;
|
|
198
|
-
}
|
|
199
|
-
|
|
200
|
-
.md-sidebar {
|
|
201
|
-
bottom: 75px;
|
|
202
|
-
position: fixed;
|
|
203
|
-
width: 16rem;
|
|
204
|
-
overflow-y: auto;
|
|
205
|
-
overflow-x: hidden;
|
|
206
|
-
scrollbar-color: rgb(193, 193, 193) #eee;
|
|
207
|
-
scrollbar-width: thin;
|
|
208
|
-
}
|
|
209
|
-
.md-sidebar .md-sidebar__scrollwrap {
|
|
210
|
-
width: calc(12.1rem);
|
|
211
|
-
}
|
|
212
|
-
.md-sidebar--secondary {
|
|
213
|
-
right: ${v.spacing(3)}px;
|
|
214
|
-
}
|
|
215
|
-
.md-sidebar::-webkit-scrollbar {
|
|
216
|
-
width: 5px;
|
|
217
|
-
}
|
|
218
|
-
.md-sidebar::-webkit-scrollbar-button {
|
|
219
|
-
width: 5px;
|
|
220
|
-
height: 5px;
|
|
221
|
-
}
|
|
222
|
-
.md-sidebar::-webkit-scrollbar-track {
|
|
223
|
-
background: #eee;
|
|
224
|
-
border: 1 px solid rgb(250, 250, 250);
|
|
225
|
-
box-shadow: 0px 0px 3px #dfdfdf inset;
|
|
226
|
-
border-radius: 3px;
|
|
227
|
-
}
|
|
228
|
-
.md-sidebar::-webkit-scrollbar-thumb {
|
|
229
|
-
width: 5px;
|
|
230
|
-
background: rgb(193, 193, 193);
|
|
231
|
-
border: transparent;
|
|
232
|
-
border-radius: 3px;
|
|
233
|
-
}
|
|
234
|
-
.md-sidebar::-webkit-scrollbar-thumb:hover {
|
|
235
|
-
background: rgb(125, 125, 125);
|
|
236
|
-
}
|
|
237
|
-
|
|
238
|
-
.md-content {
|
|
239
|
-
max-width: calc(100% - 16rem * 2);
|
|
240
|
-
margin-left: 16rem;
|
|
241
|
-
margin-bottom: 50px;
|
|
242
|
-
}
|
|
243
|
-
|
|
244
|
-
.md-footer {
|
|
245
|
-
position: fixed;
|
|
246
|
-
bottom: 0px;
|
|
247
|
-
pointer-events: none;
|
|
248
|
-
}
|
|
249
|
-
|
|
250
|
-
.md-footer-nav__link, .md-footer__link {
|
|
251
|
-
pointer-events: all;
|
|
252
|
-
}
|
|
253
|
-
|
|
254
|
-
.md-footer__title {
|
|
255
|
-
background-color: unset;
|
|
256
|
-
}
|
|
257
|
-
.md-footer-nav__link {
|
|
258
|
-
width: 16rem;
|
|
259
|
-
}
|
|
260
|
-
|
|
261
|
-
.md-dialog {
|
|
262
|
-
background-color: unset;
|
|
263
|
-
}
|
|
264
|
-
|
|
265
|
-
@media screen and (min-width: 76.25em) {
|
|
266
|
-
.md-sidebar {
|
|
267
|
-
height: auto;
|
|
268
|
-
}
|
|
269
|
-
}
|
|
270
|
-
|
|
271
|
-
@media screen and (max-width: 76.1875em) {
|
|
272
|
-
.md-nav {
|
|
273
|
-
transition: none !important;
|
|
274
|
-
background-color: var(--md-default-bg-color)
|
|
275
|
-
}
|
|
276
|
-
.md-nav--primary .md-nav__title {
|
|
277
|
-
cursor: auto;
|
|
278
|
-
color: var(--md-default-fg-color);
|
|
279
|
-
font-weight: 700;
|
|
280
|
-
white-space: normal;
|
|
281
|
-
line-height: 1rem;
|
|
282
|
-
height: auto;
|
|
283
|
-
display: flex;
|
|
284
|
-
flex-flow: column;
|
|
285
|
-
row-gap: 1.6rem;
|
|
286
|
-
padding: 1.2rem .8rem .8rem;
|
|
287
|
-
background-color: var(--md-default-bg-color);
|
|
288
|
-
}
|
|
289
|
-
.md-nav--primary .md-nav__title~.md-nav__list {
|
|
290
|
-
box-shadow: none;
|
|
291
|
-
}
|
|
292
|
-
.md-nav--primary .md-nav__title ~ .md-nav__list > :first-child {
|
|
293
|
-
border-top: none;
|
|
294
|
-
}
|
|
295
|
-
.md-nav--primary .md-nav__title .md-nav__button {
|
|
296
|
-
display: none;
|
|
297
|
-
}
|
|
298
|
-
.md-nav--primary .md-nav__title .md-nav__icon {
|
|
299
|
-
color: var(--md-default-fg-color);
|
|
300
|
-
position: static;
|
|
301
|
-
height: auto;
|
|
302
|
-
margin: 0 0 0 -0.2rem;
|
|
303
|
-
}
|
|
304
|
-
.md-nav--primary > .md-nav__title [for="none"] {
|
|
305
|
-
padding-top: 0;
|
|
306
|
-
}
|
|
307
|
-
.md-nav--primary .md-nav__item {
|
|
308
|
-
border-top: none;
|
|
309
|
-
}
|
|
310
|
-
.md-nav--primary :is(.md-nav__title,.md-nav__item) {
|
|
311
|
-
font-size : var(--md-typeset-font-size);
|
|
312
|
-
}
|
|
313
|
-
.md-nav .md-source {
|
|
314
|
-
display: none;
|
|
315
|
-
}
|
|
316
|
-
|
|
317
|
-
.md-sidebar {
|
|
318
|
-
height: 100%;
|
|
319
|
-
}
|
|
320
|
-
.md-sidebar--primary {
|
|
321
|
-
width: 12.1rem !important;
|
|
322
|
-
z-index: 200;
|
|
323
|
-
left: ${O.isPinned?`calc(-12.1rem + ${ht})`:"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 et=["h1","h2","h3","h4","h5","h6"];var vt=({theme:v})=>`
|
|
375
|
-
/*================== Typeset ==================*/
|
|
376
|
-
|
|
377
|
-
.md-typeset {
|
|
378
|
-
font-size: var(--md-typeset-font-size);
|
|
379
|
-
}
|
|
380
|
-
|
|
381
|
-
${et.reduce((O,M)=>{var Y;const he=(Y=v.typography.htmlFontSize)!==null&&Y!==void 0?Y:16,we=v.typography[M],{lineHeight:Oe,fontFamily:Xe,fontWeight:tt,fontSize:mt}=we,wt=dt=>{let Be=1;return typeof dt=="number"&&(Be=dt/he*.6),typeof dt=="string"&&(Be=dt.replace("rem","")),`calc(${Be} * var(--md-typeset-font-size))`};return O.concat(`
|
|
382
|
-
.md-typeset ${M} {
|
|
383
|
-
color: var(--md-default-fg-color);
|
|
384
|
-
line-height: ${Oe};
|
|
385
|
-
font-family: ${Xe};
|
|
386
|
-
font-weight: ${tt};
|
|
387
|
-
font-size: ${wt(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
|
-
`,ot=()=>`
|
|
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
|
-
`,Qe=({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 ft=[Ne,Ye,rt,vt,ot,Qe],gt=()=>(0,m.Pf)(),Ct=()=>{const v=gt(),O=(0,xe.Z)();return(0,p.useMemo)(()=>{const M={theme:O,sidebar:v};return ft.reduce((Y,he)=>Y+he(M),"")},[O,v])},yn=()=>{const v=Ct();return(0,p.useCallback)(O=>(O.getElementsByTagName("head")[0].insertAdjacentHTML("beforeend",`<style>${v}</style>`),O),[v])},hn=(v,O,M)=>{const Y=v==="src"&&O.endsWith(".svg"),he=!O.match(/^([a-z]*:)?\/\//i),we=O.startsWith(M);return Y&&(he||we)},cn=({techdocsStorageApi:v,entityId:O,path:M})=>async Y=>{const he=await v.getApiOrigin(),we=async(Oe,Xe)=>{for(const tt of Oe)if(tt.hasAttribute(Xe)){const mt=tt.getAttribute(Xe);if(!mt)return;const wt=await v.getBaseUrl(mt,O,M);if(hn(Xe,mt,he))try{const Be=await(await fetch(wt,{credentials:"include"})).text();tt.setAttribute(Xe,`data:image/svg+xml;base64,${btoa(unescape(encodeURIComponent(Be)))}`)}catch{tt.setAttribute("alt",`Error: ${mt}`)}else tt.setAttribute(Xe,wt)}};return await Promise.all([we(Y.querySelectorAll("img"),"src"),we(Y.querySelectorAll("script"),"src"),we(Y.querySelectorAll("source"),"src"),we(Y.querySelectorAll("link"),"href"),we(Y.querySelectorAll("a[download]"),"href")]),Y};var Sn=n(40556),pn=n(67097),xn=n(28316),Cn=n(82717),on=n.n(Cn);const fn=v=>O=>{var M,Y,he,we,Oe,Xe;const tt=O.querySelector('[title="Edit this page"]');if(!tt||!tt.href)return O;const mt=new URL(tt.href),wt=v.byUrl(mt);if(((M=wt)===null||M===void 0?void 0:M.type)!=="github"&&((Y=wt)===null||Y===void 0?void 0:Y.type)!=="gitlab")return O;const dt=((he=O.querySelector("article>h1"))===null||he===void 0?void 0:he.childNodes[0].textContent)||"",Be=encodeURIComponent(`Documentation Feedback: ${dt}`),At=encodeURIComponent(`Page source:
|
|
518
|
-
${tt.href}
|
|
519
|
-
|
|
520
|
-
Feedback:`),Ut=((we=wt)===null||we===void 0?void 0:we.type)==="github"?(0,Sn.BT)(mt.href,"blob"):mt.href,xt=on()(Ut),Nt=`/${xt.organization}/${xt.name}`,Qt=tt.cloneNode();switch((Oe=wt)===null||Oe===void 0?void 0:Oe.type){case"gitlab":Qt.href=`${mt.origin}${Nt}/issues/new?issue[title]=${Be}&issue[description]=${At}`;break;case"github":Qt.href=`${mt.origin}${Nt}/issues/new?title=${Be}&body=${At}`;break;default:return O}return xn.render(p.createElement(pn.Z),Qt),Qt.style.paddingLeft="5px",Qt.title="Leave feedback for this page",Qt.id="git-feedback-link",(Xe=tt)===null||Xe===void 0||Xe.insertAdjacentElement("beforebegin",Qt),O};var wn=n(44882);const _e=()=>v=>{var O;const M=v.querySelector('.md-header label[for="__drawer"]'),Y=v.querySelector("article");if(!M||!Y)return v;const he=M.cloneNode();return xn.render(p.createElement(wn.Z),he),he.id="toggle-sidebar",he.title="Toggle Sidebar",he.classList.add("md-content__button"),he.style.setProperty("padding","0 0 0 5px"),he.style.setProperty("margin","0.4rem 0 0.4rem 0.4rem"),(O=Y)===null||O===void 0||O.prepend(he),v},Jt=()=>v=>(((M,Y)=>{Array.from(M).filter(he=>he.hasAttribute(Y)).forEach(he=>{const we=he.getAttribute(Y);if(we){we.match(/^https?:\/\//i)&&he.setAttribute("target","_blank");try{const Oe=Vt(window.location.href);he.setAttribute(Y,new URL(we,Oe).toString())}catch{he.replaceWith(he.textContent||we)}}})})(Array.from(v.getElementsByTagName("a")),"href"),v);function Vt(v){const O=new URL(v);return!O.pathname.endsWith("/")&&!O.pathname.endsWith(".html")&&(O.pathname+="/"),O.toString()}const Je=({baseUrl:v,onClick:O})=>M=>(Array.from(M.getElementsByTagName("a")).forEach(Y=>{Y.addEventListener("click",he=>{const Oe=Y.getAttribute("href");Oe&&Oe.startsWith(v)&&!Y.hasAttribute("download")&&(he.preventDefault(),O(he,Oe))})}),M);var Rn=n(15459),sn=n(80030),Nn=n(72379),In=n(41547),Pn=n(95074);const Gn=(0,Rn.Z)(v=>({tooltip:{fontSize:"inherit",color:v.palette.text.primary,margin:0,padding:v.spacing(.5),backgroundColor:"transparent",boxShadow:"none"}}))(sn.ZP),Kn=()=>(0,r.jsx)(Nn.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"})}),Ln=({text:v})=>{const[O,M]=(0,p.useState)(!1),[,Y]=(0,Pn.Z)(),he=(0,p.useCallback)(()=>{Y(v),M(!0)},[v,Y]),we=(0,p.useCallback)(()=>{M(!1)},[M]);return(0,r.jsx)(Gn,{title:"Copied to clipboard",placement:"left",open:O,onClose:we,leaveDelay:1e3,children:(0,r.jsx)(D.Z,{style:{color:"inherit"},className:"md-clipboard md-icon",onClick:he,children:(0,r.jsx)(Kn,{})})})},be=v=>O=>{const M=O.querySelectorAll("pre > code");for(const we of M){var Y,he;const Oe=we.textContent||"",Xe=document.createElement("div");(he=we)===null||he===void 0||(Y=he.parentElement)===null||Y===void 0||Y.prepend(Xe),xn.render((0,r.jsx)(In.Z,{theme:v,children:(0,r.jsx)(Ln,{text:Oe})}),Xe)}return O},pe=()=>v=>{var O;return(O=v.querySelector(".md-header"))===null||O===void 0||O.remove(),v},Ie=()=>v=>{var O,M;return(O=v.querySelector(".md-footer .md-copyright"))===null||O===void 0||O.remove(),(M=v.querySelector(".md-footer-copyright"))===null||M===void 0||M.remove(),v},H=({onLoading:v,onLoaded:O})=>M=>(v(),M.addEventListener(V.Ox,function Y(){O(),M.removeEventListener(V.Ox,Y)}),M),N=()=>v=>(v.addEventListener(V.Ox,function O(){if(window.location.hash){var M,Y;const he=window.location.hash.slice(1);(Y=v)===null||Y===void 0||(M=Y.querySelector(`[id="${he}"]`))===null||M===void 0||M.scrollIntoView()}v.removeEventListener(V.Ox,O)}),v),ce=()=>v=>(setTimeout(()=>{var O;const M=(O=v)===null||O===void 0?void 0:O.querySelectorAll("li.md-nav__item--active");M.length!==0&&(M.forEach(he=>{var we,Oe;const Xe=(we=he)===null||we===void 0?void 0:we.querySelector("input");if(!(!((Oe=Xe)===null||Oe===void 0)&&Oe.checked)){var tt;(tt=Xe)===null||tt===void 0||tt.click()}}),M[M.length-1].scrollIntoView())},200),v),Ae=async(v,O)=>{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 Y of O)M=await Y(M);return M};var $e=n(73557);function qe(v,O){const M=new URL(O),Y=`${M.origin}${M.pathname.replace(/\/$/,"")}`,he=v.replace(Y,"").replace(/^\/+/,""),we=new URL(`http://localhost/${he}`);return`${we.pathname}${we.search}${we.hash}`}function It(){const v=(0,$e.s0)(),M=(0,K.h_)(K.Ds).getOptionalString("app.baseUrl");return(0,p.useCallback)(he=>{let we=he;if(M)try{we=qe(he,M)}catch{}v(we)},[v,M])}const Bt="screen and (max-width: 76.1875em)",nn=v=>{const O=It(),M=(0,xe.Z)(),Y=(0,Se.Z)(Bt),he=Gt(),we=yn(),Oe=(0,K.z$)(),Xe=(0,K.h_)(V.Dl),tt=(0,K.h_)(k.q3),{state:mt,path:wt,content:dt}=(0,w.DK)(),[Be,At]=(0,p.useState)(null),Ut=(0,V.ux)(Be),xt=(0,p.useCallback)(()=>{if(!Be)return;Be.querySelectorAll(".md-sidebar").forEach(bt=>{if(Y)bt.style.top="0px";else{var jt,Mt,Xt;const bn=(jt=document)===null||jt===void 0?void 0:jt.querySelector(".techdocs-reader-page");var lr;const _n=(lr=(Mt=bn)===null||Mt===void 0?void 0:Mt.getBoundingClientRect().top)!==null&&lr!==void 0?lr:0;var Cr;let fr=(Cr=Be.getBoundingClientRect().top)!==null&&Cr!==void 0?Cr:0;const wr=Be.querySelector(".md-container > .md-tabs");var rr;const Yn=(rr=(Xt=wr)===null||Xt===void 0?void 0:Xt.getBoundingClientRect().height)!==null&&rr!==void 0?rr:0;fr<_n&&(fr=_n),bt.style.top=`${Math.max(fr,0)+Yn}px`}bt.style.setProperty("opacity","1")})},[Be,Y]);(0,p.useEffect)(()=>(window.addEventListener("resize",xt),window.addEventListener("scroll",xt,!0),()=>{window.removeEventListener("resize",xt),window.removeEventListener("scroll",xt,!0)}),[Be,xt]);const Nt=(0,p.useCallback)(()=>{if(!Be)return;const Ft=Be.querySelector(".md-footer");Ft&&(Ft.style.width=`${Be.getBoundingClientRect().width}px`)},[Be]);(0,p.useEffect)(()=>(window.addEventListener("resize",Nt),()=>{window.removeEventListener("resize",Nt)}),[Be,Nt]),(0,p.useEffect)(()=>{Ut||(Nt(),xt())},[mt,Ut,Nt,xt]);const Qt=(0,p.useCallback)((Ft,bt)=>Ae(Ft,[he,cn({techdocsStorageApi:Xe,entityId:v,path:bt}),Jt(),_e(),pe(),Ie(),fn(tt),we]),[v,tt,Xe,he,we]),jn=(0,p.useCallback)(async Ft=>Ae(Ft,[N(),ce(),be(M),Je({baseUrl:window.location.origin,onClick:(bt,jt)=>{var Mt;const Xt=bt.ctrlKey||bt.metaKey,lr=new URL(jt),Cr=((Mt=bt.target)===null||Mt===void 0?void 0:Mt.innerText)||jt,rr=jt.replace(window.location.origin,"");if(Oe.captureEvent("click",Cr,{attributes:{to:rr}}),lr.hash)if(Xt)window.open(jt,"_blank");else{var bn,_n;O(jt),(_n=Ft)===null||_n===void 0||(bn=_n.querySelector(`[id="${lr.hash.slice(1)}"]`))===null||bn===void 0||bn.scrollIntoView()}else Xt?window.open(jt,"_blank"):O(jt)}}),H({onLoading:()=>{},onLoaded:()=>{var bt;(bt=Ft.querySelector(".md-nav__title"))===null||bt===void 0||bt.removeAttribute("for")}}),H({onLoading:()=>{Array.from(Ft.querySelectorAll(".md-sidebar")).forEach(jt=>{jt.style.setProperty("opacity","0")})},onLoaded:()=>{}})]),[M,O,Oe]);return(0,p.useEffect)(()=>{if(!dt)return()=>{};let Ft=!0;return Qt(dt,wt).then(async bt=>{var jt;if(!(!((jt=bt)===null||jt===void 0)&&jt.innerHTML)||!Ft)return;window.scroll({top:0});const Mt=await jn(bt);At(Mt)}),()=>{Ft=!1}},[dt,wt,Qt,jn]),Be};var ln=n(8560);const rn=()=>{var v,O,M,Y,he;const we=(0,V.$L)(),{shadowRoot:Oe}=(0,V.x1)(),Xe=(v=Oe)===null||v===void 0?void 0:v.querySelector('[data-md-component="content"]'),tt=(O=Oe)===null||O===void 0?void 0:O.querySelector('div[data-md-component="sidebar"][data-md-type="navigation"], div[data-md-component="navigation"]');let mt=(M=tt)===null||M===void 0?void 0:M.querySelector('[data-techdocs-addons-location="primary sidebar"]');if(!mt){var wt;mt=document.createElement("div"),mt.setAttribute("data-techdocs-addons-location","primary sidebar"),(wt=tt)===null||wt===void 0||wt.prepend(mt)}const dt=(Y=Oe)===null||Y===void 0?void 0:Y.querySelector('div[data-md-component="sidebar"][data-md-type="toc"], div[data-md-component="toc"]');let Be=(he=dt)===null||he===void 0?void 0:he.querySelector('[data-techdocs-addons-location="secondary sidebar"]');if(!Be){var At;Be=document.createElement("div"),Be.setAttribute("data-techdocs-addons-location","secondary sidebar"),(At=dt)===null||At===void 0||At.prepend(Be)}return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(ln.Z,{container:mt,children:we.renderComponentsByLocation(V.oZ.PrimarySidebar)}),(0,r.jsx)(ln.Z,{container:Xe,children:we.renderComponentsByLocation(V.oZ.Content)}),(0,r.jsx)(ln.Z,{container:Be,children:we.renderComponentsByLocation(V.oZ.SecondarySidebar)})]})},ee=(0,W.Z)({search:{width:"100%","@media (min-width: 76.1875em)":{width:"calc(100% - 34.4rem)",margin:"0 auto"},"@media print":{display:"none"}}}),te=(0,w.m1)(v=>{var O,M;const{withSearch:Y=!0,onReady:he}=v,we=ee(),{entityMetadata:{value:Oe,loading:Xe},entityRef:tt,setShadowRoot:mt}=(0,V.x1)(),wt=nn(tt),dt=(0,p.useCallback)(Be=>{mt(Be),he instanceof Function&&he()},[mt,he]);return Xe===!1&&!Oe?(0,r.jsx)(m.mf,{status:"404",statusMessage:"PAGE NOT FOUND"}):wt?(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)(U,{})}),Y&&(0,r.jsx)(f.Z,{className:we.search,xs:"auto",item:!0,children:(0,r.jsx)(h.S,{entityId:tt,entityTitle:(M=Oe)===null||M===void 0||(O=M.metadata)===null||O===void 0?void 0:O.title})}),(0,r.jsx)(f.Z,{xs:12,item:!0,children:(0,r.jsx)(V.VA,{element:wt,onAppend:dt,children:(0,r.jsx)(rn,{})})})]})}):(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)(U,{})})})})}),G=null},93225:function(Lt,Le,n){"use strict";n.d(Le,{S:function(){return ie}});var r=n(52322),p=n(2784),W=n(18671),f=n(60905),V=n(98069),m=n(60364),h=n(73250),F=n(61886),ye=n(39709),le=n(25271),z=n(53974),de=n(60871),D=n(76635),E=n(95573);const se=(0,r.jsx)(V.Z,{animation:"wave",variant:"text",height:40}),ie=ne=>{var X,K,R;const{palette:{common:{white:w}}}=(0,m.Z)(),{children:I}=ne,U=(0,F.$L)(),xe=(0,de.h_)(de.Ds),{title:Se,setTitle:k,subtitle:Ke,setSubtitle:yt,entityRef:$t,metadata:{value:zt,loading:Rt},entityMetadata:{value:Dt,loading:Yt}}=(0,F.x1)();(0,p.useEffect)(()=>{zt&&(k(zt.site_name),yt(()=>{let{site_description:rt}=zt;return(!rt||rt==="None")&&(rt=""),rt}))},[zt,k,yt]);const ct=xe.getOptional("app.title")||"Backstage",ut=[Se,Ke,ct].filter(Boolean).join(" | "),{locationMetadata:St,spec:lt}=Dt||{},Zt=(X=lt)===null||X===void 0?void 0:X.lifecycle,Gt=Dt?(0,ye.hF)(Dt,le.S4):[],Ce=(0,de.tg)(E._Z)(),Ne=(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(z.i9,{label:(0,D.capitalize)(((K=Dt)===null||K===void 0?void 0:K.kind)||"entity"),value:(0,r.jsx)(ye.dx,{color:"inherit",entityRef:$t,title:(R=Dt)===null||R===void 0?void 0:R.metadata.title,defaultKind:"Component"})}),Gt.length>0&&(0,r.jsx)(z.i9,{label:"Owner",value:(0,r.jsx)(ye.rI,{color:"inherit",entityRefs:Gt,defaultKind:"group"})}),Zt?(0,r.jsx)(z.i9,{label:"Lifecycle",value:Zt}):null,St&&St.type!=="dir"&&St.type!=="file"?(0,r.jsx)(z.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:St.target}):null]});return!Yt&&Dt===void 0||!Rt&&zt===void 0?null:(0,r.jsxs)(z.h4,{type:"Documentation",typeLink:Ce,title:Se||se,subtitle:Ke===""?void 0:Ke||se,children:[(0,r.jsx)(W.Z,{titleTemplate:"%s",children:(0,r.jsx)("title",{children:ut})}),Ne,I,U.renderComponentsByLocation(F.oZ.Header)]})}},65124:function(Lt,Le,n){"use strict";n.d(Le,{b:function(){return de}});var r=n(52322),p=n(2784),W=n(79692),f=n(15223),V=n(95544),m=n(80030),h=n(61837),F=n(48348),ye=n(47603),le=n(61886);const z=(0,W.Z)(D=>({root:{gridArea:"pageSubheader",flexDirection:"column",minHeight:"auto",padding:D.spacing(3,3,0),"@media print":{display:"none"}}})),de=D=>{const E=z(),[se,ie]=(0,p.useState)(null),ne=(0,p.useCallback)(xe=>{ie(xe.currentTarget)},[]),X=(0,p.useCallback)(()=>{ie(null)},[]),{entityMetadata:{value:K,loading:R}}=(0,le.x1)(),w=(0,le.$L)(),I=w.renderComponentsByLocation(le.oZ.Subheader),U=w.renderComponentsByLocation(le.oZ.Settings);return!I&&!U||R===!1&&!K?null:(0,r.jsx)(f.Z,{classes:E,...D.toolbarProps,children:(0,r.jsxs)(V.Z,{display:"flex",justifyContent:"flex-end",width:"100%",flexWrap:"wrap",children:[I,U?(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:ne,children:(0,r.jsx)(ye.Z,{})})}),(0,r.jsx)(F.Z,{id:"tech-docs-reader-page-settings",getContentAnchorEl:null,anchorEl:se,anchorOrigin:{vertical:"bottom",horizontal:"right"},open:Boolean(se),onClose:X,keepMounted:!0,children:(0,r.jsx)("div",{children:U})})]}):null]})})}},95481:function(Lt,Le,n){"use strict";n.d(Le,{DK:function(){return de},m1:function(){return E}});var r=n(52322),p=n(2784),W=n(73557),f=n(61886),V=n(60871),m=n(64279),h=n(77446);function F({contentLoading:se,content:ie,activeSyncState:ne}){return se||ne==="BUILD_READY_RELOAD"||!ie&&ne==="CHECKING"?"CHECKING":!ie&&ne==="BUILDING"?"INITIAL_BUILD":ie?ne==="BUILDING"?"CONTENT_STALE_REFRESHING":ne==="BUILD_READY"?"CONTENT_STALE_READY":ne==="ERROR"?"CONTENT_STALE_ERROR":"CONTENT_FRESH":"CONTENT_NOT_FOUND"}function ye(se,ie){const ne={...se};switch(ie.type){case"sync":ie.state==="CHECKING"&&(ne.buildLog=[]),ne.activeSyncState=ie.state,ne.syncError=ie.syncError;break;case"contentLoading":ne.contentLoading=!0,ne.contentError=void 0;break;case"content":typeof ie.path=="string"&&(ne.path=ie.path),ne.contentLoading=!1,ne.content=ie.content,ne.contentError=ie.contentError;break;case"buildLog":ne.buildLog=ne.buildLog.concat(ie.log);break;default:throw new Error}return["BUILD_READY","BUILD_READY_RELOAD"].includes(ne.activeSyncState)&&["contentLoading","content"].includes(ie.type)&&(ne.activeSyncState="UP_TO_DATE",ne.buildLog=[]),ne}function le(se,ie,ne,X){var K,R;const[w,I]=(0,p.useReducer)(ye,{activeSyncState:"CHECKING",path:X,contentLoading:!0,buildLog:[]}),U=(0,V.h_)(f.Dl),{retry:xe}=(0,h.Z)(async()=>{I({type:"contentLoading"});try{const Ke=await U.getEntityDocs({kind:se,namespace:ie,name:ne},X);return I({type:"content",content:Ke,path:X}),Ke}catch(Ke){I({type:"content",contentError:Ke,path:X})}},[U,se,ie,ne,X]),Se=(0,p.useRef)({content:void 0,reload:()=>{}});return Se.current={content:w.content,reload:xe},(0,m.default)(async()=>{I({type:"sync",state:"CHECKING"});const Ke=setTimeout(()=>{I({type:"sync",state:"BUILDING"})},1e3);try{switch(await U.syncEntityDocs({kind:se,namespace:ie,name:ne},$t=>{I({type:"buildLog",log:$t})})){case"updated":Se.current.content?I({type:"sync",state:"BUILD_READY"}):(Se.current.reload(),I({type:"sync",state:"BUILD_READY_RELOAD"}));break;case"cached":I({type:"sync",state:"UP_TO_DATE"});break;default:I({type:"sync",state:"ERROR",syncError:new Error("Unexpected return state")});break}}catch(yt){I({type:"sync",state:"ERROR",syncError:yt})}finally{clearTimeout(Ke)}},[se,ne,ie,U,I,Se]),{state:(0,p.useMemo)(()=>F({activeSyncState:w.activeSyncState,contentLoading:w.contentLoading,content:w.content}),[w.activeSyncState,w.content,w.contentLoading]),contentReload:xe,path:w.path,content:w.content,contentErrorMessage:(K=w.contentError)===null||K===void 0?void 0:K.toString(),syncErrorMessage:(R=w.syncError)===null||R===void 0?void 0:R.toString(),buildLog:w.buildLog}}const z=(0,p.createContext)({}),de=()=>(0,p.useContext)(z),D=se=>{const{children:ie}=se,{"*":ne=""}=(0,W.UO)(),{entityRef:X}=(0,f.x1)(),{kind:K,namespace:R,name:w}=X,I=le(K,R,w,ne);return(0,r.jsx)(z.Provider,{value:I,children:ie instanceof Function?ie(I):ie})},E=se=>ie=>(0,r.jsx)(D,{children:(0,r.jsx)(se,{...ie})})},95573:function(Lt,Le,n){"use strict";n.d(Le,{Fw:function(){return W},_Z:function(){return p},pd:function(){return f}});var r=n(60871);const p=(0,r.NT)({id:"techdocs:index-page"}),W=(0,r.NT)({id:"techdocs:reader-page",params:["namespace","kind","name"]}),f=(0,r.NT)({id:"techdocs:catalog-reader-view"})},55511:function(Lt,Le,n){"use strict";n.r(Le),n.d(Le,{TechDocsSearchResultListItem:function(){return le}});var r=n(52322),p=n(2784),W=n(79692),f=n(49378),V=n(86136),m=n(90436),h=n(53974),F=n(15096);const ye=(0,W.Z)({flexContainer:{flexWrap:"wrap"},itemText:{width:"100%",marginBottom:"1rem"}}),le=z=>{const{result:de,highlight:D,lineClamp:E=5,asListItem:se=!0,asLink:ie=!0,title:ne,icon:X}=z,K=ye(),R=({children:U})=>ie?(0,r.jsx)(h.rU,{noTrack:!0,to:de.location,children:U}):(0,r.jsx)(r.Fragment,{children:U}),w=()=>{var U,xe,Se,k;const Ke=!((U=D)===null||U===void 0)&&U.fields.title?(0,r.jsx)(F.FA,{text:D.fields.title,preTag:D.preTag,postTag:D.postTag}):de.title,yt=!((xe=D)===null||xe===void 0)&&xe.fields.entityTitle?(0,r.jsx)(F.FA,{text:D.fields.entityTitle,preTag:D.preTag,postTag:D.postTag}):de.entityTitle,$t=!((Se=D)===null||Se===void 0)&&Se.fields.name?(0,r.jsx)(F.FA,{text:D.fields.name,preTag:D.preTag,postTag:D.postTag}):de.name;return de?(0,r.jsx)(f.Z,{className:K.itemText,primaryTypographyProps:{variant:"h6"},primary:(0,r.jsx)(R,{children:ne||(0,r.jsxs)(r.Fragment,{children:[Ke," | ",yt!=null?yt:$t," docs"]})}),secondary:(0,r.jsx)(m.Z,{component:"span",style:{display:"-webkit-box",WebkitBoxOrient:"vertical",WebkitLineClamp:E,overflow:"hidden"},color:"textSecondary",variant:"body2",children:!((k=D)===null||k===void 0)&&k.fields.text?(0,r.jsx)(F.FA,{text:D.fields.text,preTag:D.preTag,postTag:D.postTag}):de.text})}):null},I=({children:U})=>se?(0,r.jsxs)(r.Fragment,{children:[X&&(0,r.jsx)(V.Z,{children:typeof X=="function"?X(de):X}),(0,r.jsx)("div",{className:K.flexContainer,children:U})]}):(0,r.jsx)(r.Fragment,{children:U});return(0,r.jsx)(I,{children:(0,r.jsx)(w,{})})}},22478:function(Lt,Le,n){"use strict";n.d(Le,{S:function(){return F}});var r=n(52322),p=n(15096),W=n(2784),f=n(73557),V=n(55511);const m=ye=>{var le;return(le=ye)===null||le===void 0?void 0:le.document},h=ye=>{const{entityId:le,entityTitle:z,debounceTime:de=150}=ye,[D,E]=(0,W.useState)(!1),se=(0,f.s0)(),{setFilters:ie,result:{loading:ne,value:X}}=(0,p.Rx)(),[K,R]=(0,W.useState)([]);(0,W.useEffect)(()=>{let Se=!0;if(Se&&X){const k=X.results.slice(0,10);R(k)}return()=>{Se=!1}},[ne,X]);const{kind:w,name:I,namespace:U}=le;(0,W.useEffect)(()=>{ie(Se=>({...Se,kind:w,namespace:U,name:I}))},[w,U,I,ie]);const xe=(Se,k)=>{if(m(k)){const{location:Ke}=k.document;se(Ke)}};return(0,r.jsx)(p.qO,{"data-testid":"techdocs-search-bar",size:"small",open:D,getOptionLabel:()=>"",filterOptions:Se=>Se,onClose:()=>{E(!1)},onFocus:()=>{E(!0)},onChange:xe,blurOnSelect:!0,noOptionsText:"No results found",value:null,options:K,renderOption:({document:Se,highlight:k})=>(0,r.jsx)(V.TechDocsSearchResultListItem,{result:Se,lineClamp:3,asListItem:!1,asLink:!1,title:Se.title,highlight:k}),loading:ne,inputDebounceTime:de,inputPlaceholder:`Search ${z||le.name} docs`,freeSolo:!1})},F=ye=>{const le={term:"",types:["techdocs"],pageCursor:"",filters:ye.entityId};return(0,r.jsx)(p.Nd,{initialState:le,children:(0,r.jsx)(h,{...ye})})}},53260:function(){}},function(Lt){var Le=function(r){return Lt(Lt.s=r)};Lt.O(0,[2370,6202,9284,9035,2126,7012,2194,1410,427,242,5109,6816,5218,4736],function(){return Le(48514)});var n=Lt.O()}]);})();
|
|
521
|
-
|
|
522
|
-
//# sourceMappingURL=main.4b61d1bd.js.map
|