@techdocs/cli 1.4.1-next.3 → 1.4.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +12 -0
- package/dist/embedded-app/index.html +1 -1
- package/dist/embedded-app/static/{1032.94c986d1.chunk.js → 1032.16924053.chunk.js} +2 -2
- package/dist/embedded-app/static/{1032.94c986d1.chunk.js.map → 1032.16924053.chunk.js.map} +1 -1
- package/dist/embedded-app/static/1049.dd1f0d99.chunk.js +7 -0
- package/dist/embedded-app/static/1049.dd1f0d99.chunk.js.map +1 -0
- package/dist/embedded-app/static/{1105.facb65a8.chunk.js → 1105.0b45e765.chunk.js} +2 -2
- package/dist/embedded-app/static/{1105.facb65a8.chunk.js.map → 1105.0b45e765.chunk.js.map} +1 -1
- package/dist/embedded-app/static/{184.c1c44877.chunk.js → 184.90489ed7.chunk.js} +2 -2
- package/dist/embedded-app/static/{184.c1c44877.chunk.js.map → 184.90489ed7.chunk.js.map} +1 -1
- package/dist/embedded-app/static/{2440.e147b5dc.chunk.js → 2440.fa0c12ae.chunk.js} +2 -2
- package/dist/embedded-app/static/{2440.e147b5dc.chunk.js.map → 2440.fa0c12ae.chunk.js.map} +1 -1
- package/dist/embedded-app/static/{5458.742cd271.chunk.js → 5458.fe2a0a6d.chunk.js} +2 -2
- package/dist/embedded-app/static/{5458.742cd271.chunk.js.map → 5458.fe2a0a6d.chunk.js.map} +1 -1
- package/dist/embedded-app/static/6051.56a76749.chunk.js +4 -0
- package/dist/embedded-app/static/6051.56a76749.chunk.js.map +1 -0
- package/dist/embedded-app/static/{732.b2dac5c3.chunk.js → 732.e935fc39.chunk.js} +2 -2
- package/dist/embedded-app/static/{732.b2dac5c3.chunk.js.map → 732.e935fc39.chunk.js.map} +1 -1
- package/dist/embedded-app/static/{7560.4cfb6ad7.chunk.js → 7560.bb8f0386.chunk.js} +2 -2
- package/dist/embedded-app/static/{7560.4cfb6ad7.chunk.js.map → 7560.bb8f0386.chunk.js.map} +1 -1
- package/dist/embedded-app/static/{7670.d2126c9e.chunk.js → 7670.ae73207b.chunk.js} +2 -2
- package/dist/embedded-app/static/{7670.d2126c9e.chunk.js.map → 7670.ae73207b.chunk.js.map} +1 -1
- package/dist/embedded-app/static/{7750.7cd64666.chunk.js → 7750.6fd0ac0b.chunk.js} +2 -2
- package/dist/embedded-app/static/{7750.7cd64666.chunk.js.map → 7750.6fd0ac0b.chunk.js.map} +1 -1
- package/dist/embedded-app/static/{9323.0aa3540d.chunk.js → 9323.4703a3d8.chunk.js} +2 -2
- package/dist/embedded-app/static/{9323.0aa3540d.chunk.js.map → 9323.4703a3d8.chunk.js.map} +1 -1
- package/dist/embedded-app/static/{9545.fab4c42c.chunk.js → 9545.b25a5c55.chunk.js} +2 -2
- package/dist/embedded-app/static/{9545.fab4c42c.chunk.js.map → 9545.b25a5c55.chunk.js.map} +1 -1
- package/dist/embedded-app/static/{9770.b5b411d2.chunk.js → 9770.d2ae96e3.chunk.js} +2 -2
- package/dist/embedded-app/static/{9770.b5b411d2.chunk.js.map → 9770.d2ae96e3.chunk.js.map} +1 -1
- package/dist/embedded-app/static/main.7f000815.js +508 -0
- package/dist/embedded-app/static/main.7f000815.js.map +1 -0
- package/dist/embedded-app/static/module-luxon.ee277e4b.js +3 -0
- package/dist/embedded-app/static/module-luxon.ee277e4b.js.map +1 -0
- package/dist/embedded-app/static/{module-material-ui.1f3c23cb.js → module-material-ui.821488a0.js} +1 -1
- package/dist/embedded-app/static/{module-material-ui.1f3c23cb.js.map → module-material-ui.821488a0.js.map} +1 -1
- package/dist/embedded-app/static/{runtime.0f1c16cc.js → runtime.7f000815.js} +2 -2
- package/dist/embedded-app/static/{runtime.0f1c16cc.js.map → runtime.7f000815.js.map} +1 -1
- package/dist/embedded-app/static/{vendor.0f1c16cc.js → vendor.7f000815.js} +44 -44
- package/dist/embedded-app/static/vendor.7f000815.js.map +1 -0
- package/dist/index.cjs.js +1 -1
- package/package.json +5 -5
- package/dist/embedded-app/static/6051.bd9f4d48.chunk.js +0 -4
- package/dist/embedded-app/static/6051.bd9f4d48.chunk.js.map +0 -1
- package/dist/embedded-app/static/6174.55ddb654.chunk.js +0 -3
- package/dist/embedded-app/static/6174.55ddb654.chunk.js.map +0 -1
- package/dist/embedded-app/static/main.0f1c16cc.js +0 -508
- package/dist/embedded-app/static/main.0f1c16cc.js.map +0 -1
- package/dist/embedded-app/static/module-luxon.f096b58d.js +0 -3
- package/dist/embedded-app/static/module-luxon.f096b58d.js.map +0 -1
- package/dist/embedded-app/static/vendor.0f1c16cc.js.map +0 -1
|
@@ -0,0 +1,508 @@
|
|
|
1
|
+
(()=>{(self.webpackChunktechdocs_cli_embedded_app=self.webpackChunktechdocs_cli_embedded_app||[]).push([[179],{4791:function(Ct,Be,r){"use strict";r.d(Be,{n3:function(){return g},MS:function(){return ye}});var t=r(87612),h=r(25271),H=r(23054),f=r(96279),W=r.n(f);const g=Symbol.for("CATALOG_FILTER_EXISTS_0e15b590c0b343a2bae3e787e84c2111");function d(ue){return!ue.cursor}function B(ue){return!d(ue)}class ye{async getEntityAncestors(V,J){const{kind:I,namespace:C,name:oe}=(0,h.of)(V.entityRef);return await this.requestRequired("GET",`/entities/by-name/${encodeURIComponent(I)}/${encodeURIComponent(C)}/${encodeURIComponent(oe)}/ancestry`,J)}async getLocationById(V,J){return await this.requestOptional("GET",`/locations/${encodeURIComponent(V)}`,J)}async getEntities(V,J){const{filter:I=[],fields:C=[],order:oe,offset:ee,limit:ne,after:$}=V!=null?V:{},T=this.getParams(I);if(C.length&&T.push(`fields=${C.map(encodeURIComponent).join(",")}`),oe)for(const re of[oe].flat())re&&T.push(`order=${encodeURIComponent(re.order)}:${encodeURIComponent(re.field)}`);ee!==void 0&&T.push(`offset=${ee}`),ne!==void 0&&T.push(`limit=${ne}`),$!==void 0&&T.push(`after=${encodeURIComponent($)}`);const P=T.length?`?${T.join("&")}`:"",L=await this.requestRequired("GET",`/entities${P}`,J),O=(re,Pe)=>{var We,z;if(((We=re.metadata)===null||We===void 0?void 0:We.name)===void 0||re.kind===void 0||((z=Pe.metadata)===null||z===void 0?void 0:z.name)===void 0||Pe.kind===void 0)return 0;const xt=(0,h.eE)(re),st=(0,h.eE)(Pe);return xt<st?-1:xt>st?1:0};return{items:L.sort(O)}}async getEntitiesByRefs(V,J){var I;const C={entityRefs:V.entityRefs};!((I=V.fields)===null||I===void 0)&&I.length&&(C.fields=V.fields);const ee=`${await this.discoveryApi.getBaseUrl("catalog")}/entities/by-refs`,ne=await this.fetchApi.fetch(ee,{headers:{"Content-Type":"application/json",...(J==null?void 0:J.token)&&{Authorization:`Bearer ${J==null?void 0:J.token}`}},method:"POST",body:JSON.stringify(C)});if(!ne.ok)throw await H.VL.fromResponse(ne);const{items:$}=await ne.json();return{items:$.map(T=>T!=null?T:void 0)}}async queryEntities(V={},J){const I=[];if(d(V)){var C,oe;const{fields:ne=[],filter:$,limit:T,orderFields:P,fullTextFilter:L}=V;I.push(...this.getParams($)),T!==void 0&&I.push(`limit=${T}`),P!==void 0&&(Array.isArray(P)?P:[P]).forEach(({field:re,order:Pe})=>I.push(`orderField=${re},${Pe}`)),ne.length&&I.push(`fields=${ne.map(encodeURIComponent).join(",")}`);const O=L==null||(C=L.term)===null||C===void 0?void 0:C.trim();O&&I.push(`fullTextFilterTerm=${O}`),!(L==null||(oe=L.fields)===null||oe===void 0)&&oe.length&&I.push(`fullTextFilterFields=${L.fields.join(",")}`)}else{const{fields:ne=[],limit:$,cursor:T}=V;I.push(`cursor=${T}`),$!==void 0&&I.push(`limit=${$}`),ne.length&&I.push(`fields=${ne.map(encodeURIComponent).join(",")}`)}const ee=I.length?`?${I.join("&")}`:"";return this.requestRequired("GET",`/entities/by-query${ee}`,J)}async getEntityByRef(V,J){const{kind:I,namespace:C,name:oe}=(0,h.of)(V);return this.requestOptional("GET",`/entities/by-name/${encodeURIComponent(I)}/${encodeURIComponent(C)}/${encodeURIComponent(oe)}`,J)}async getEntityByName(V,J){const{kind:I,namespace:C="default",name:oe}=V;return this.requestOptional("GET",`/entities/by-name/${encodeURIComponent(I)}/${encodeURIComponent(C)}/${encodeURIComponent(oe)}`,J)}async refreshEntity(V,J){const I=await this.fetchApi.fetch(`${await this.discoveryApi.getBaseUrl("catalog")}/refresh`,{headers:{"Content-Type":"application/json",...(J==null?void 0:J.token)&&{Authorization:`Bearer ${J==null?void 0:J.token}`}},method:"POST",body:JSON.stringify({entityRef:V})});if(I.status!==200)throw new Error(await I.text())}async getEntityFacets(V,J){const{filter:I=[],facets:C}=V,oe=this.getParams(I);for(const ne of C)oe.push(`facet=${encodeURIComponent(ne)}`);const ee=oe.length?`?${oe.join("&")}`:"";return await this.requestOptional("GET",`/entity-facets${ee}`,J)}async addLocation(V,J){const{type:I="url",target:C,dryRun:oe}=V,ee=await this.fetchApi.fetch(`${await this.discoveryApi.getBaseUrl("catalog")}/locations${oe?"?dryRun=true":""}`,{headers:{"Content-Type":"application/json",...(J==null?void 0:J.token)&&{Authorization:`Bearer ${J==null?void 0:J.token}`}},method:"POST",body:JSON.stringify({type:I,target:C})});if(ee.status!==201)throw new Error(await ee.text());const{location:ne,entities:$,exists:T}=await ee.json();if(!ne)throw new Error(`Location wasn't added: ${C}`);return{location:ne,entities:$,exists:T}}async getLocationByRef(V,J){return(await this.requestRequired("GET","/locations",J)).map(C=>C.data).find(C=>V===(0,h.NZ)(C))}async removeLocationById(V,J){await this.requestIgnored("DELETE",`/locations/${encodeURIComponent(V)}`,J)}async removeEntityByUid(V,J){await this.requestIgnored("DELETE",`/entities/by-uid/${encodeURIComponent(V)}`,J)}async validateEntity(V,J,I){const C=await this.fetchApi.fetch(`${await this.discoveryApi.getBaseUrl("catalog")}/validate-entity`,{headers:{"Content-Type":"application/json",...(I==null?void 0:I.token)&&{Authorization:`Bearer ${I==null?void 0:I.token}`}},method:"POST",body:JSON.stringify({entity:V,location:J})});if(C.ok)return{valid:!0};if(C.status!==400)throw await H.VL.fromResponse(C);const{errors:oe=[]}=await C.json();return{valid:!1,errors:oe}}async requestIgnored(V,J,I){const C=`${await this.discoveryApi.getBaseUrl("catalog")}${J}`,oe=I!=null&&I.token?{Authorization:`Bearer ${I.token}`}:{},ee=await this.fetchApi.fetch(C,{method:V,headers:oe});if(!ee.ok)throw await H.VL.fromResponse(ee)}async requestRequired(V,J,I){const C=`${await this.discoveryApi.getBaseUrl("catalog")}${J}`,oe=I!=null&&I.token?{Authorization:`Bearer ${I.token}`}:{},ee=await this.fetchApi.fetch(C,{method:V,headers:oe});if(!ee.ok)throw await H.VL.fromResponse(ee);return ee.json()}async requestOptional(V,J,I){const C=`${await this.discoveryApi.getBaseUrl("catalog")}${J}`,oe=I!=null&&I.token?{Authorization:`Bearer ${I.token}`}:{},ee=await this.fetchApi.fetch(C,{method:V,headers:oe});if(!ee.ok){if(ee.status===404)return;throw await H.VL.fromResponse(ee)}return await ee.json()}getParams(V=[]){const J=[];for(const I of[V].flat()){const C=[];for(const[oe,ee]of Object.entries(I))for(const ne of[ee].flat())ne===g?C.push(encodeURIComponent(oe)):typeof ne=="string"&&C.push(`${encodeURIComponent(oe)}=${encodeURIComponent(ne)}`);C.length&&J.push(`filter=${C.join(",")}`)}return J}constructor(V){(0,t._)(this,"discoveryApi",void 0),(0,t._)(this,"fetchApi",void 0),this.discoveryApi=V.discoveryApi,this.fetchApi=V.fetchApi||{fetch:W()}}}},25271:function(Ct,Be,r){"use strict";r.d(Be,{Tf:function(){return H},P1:function(){return an},q1:function(){return Yn},M6:function(){return je},l2:function(){return h},zG:function(){return t},w$:function(){return $n},nP:function(){return xn},aS:function(){return _t},S4:function(){return kt},cz:function(){return ut},iB:function(){return bt},CV:function(){return qe},of:function(){return St},Ou:function(){return Oe},eE:function(){return pt},NZ:function(){return Ue}});const t="default",h="backstage.io/view-url",H="backstage.io/edit-url",f="kubernetes.io/api-server",W="kubernetes.io/api-server-certificate-authority",g="kubernetes.io/auth-provider";var d=r(76635),B=r.n(d);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 ue{static isValidPrefixAndOrSuffix(N,ve,$e,et){if(typeof N!="string")return!1;const at=N.split(ve);return at.length===1?et(at[0]):at.length===2?$e(at[0])&&et(at[1]):!1}static isJsonSafe(N){try{return B().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(ue.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 ve;return typeof N=="string"&&((ve=N==null?void 0:N.trim())===null||ve===void 0?void 0:ve.length)>=1}static isNonEmptyString(N){var ve;return typeof N=="string"&&((ve=N==null?void 0:N.trim())===null||ve===void 0?void 0:ve.length)>=1}}var V=JSON.parse('{"$schema":"http://json-schema.org/draft-07/schema","$id":"EntityEnvelope","description":"The envelope skeleton parts of an entity - whatever is necessary to be able to give it a ref and pass to further validation / policy checking.","examples":[{"apiVersion":"backstage.io/v1alpha1","kind":"Component","metadata":{"name":"LoremService"}}],"type":"object","required":["apiVersion","kind","metadata"],"additionalProperties":true,"properties":{"apiVersion":{"type":"string","description":"The version of specification format for this particular entity that this is written against.","minLength":1,"examples":["backstage.io/v1alpha1","my-company.net/v1","1.0"]},"kind":{"type":"string","description":"The high level entity type being described.","minLength":1,"examples":["API","Component","Domain","Group","Location","Resource","System","Template","User"]},"metadata":{"type":"object","required":["name"],"additionalProperties":true,"properties":{"name":{"type":"string","description":"The name of the entity. Must be unique within the catalog at any given point in time, for any given namespace + kind pair.","examples":["metadata-proxy"],"minLength":1},"namespace":{"type":"string","description":"The namespace that the entity belongs to.","default":"default","examples":["default","admin"],"minLength":1}}}}}'),J=r(27991),I=r.n(J),C=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"}}}`),oe=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}}}}}}'),ee=JSON.parse('{"$schema":"http://json-schema.org/draft-07/schema","$id":"common","type":"object","description":"Common definitions to import from other schemas","definitions":{"reference":{"$id":"#reference","type":"object","description":"A reference by name to another entity.","required":["kind","namespace","name"],"additionalProperties":false,"properties":{"kind":{"type":"string","description":"The kind field of the entity.","minLength":1},"namespace":{"type":"string","description":"The metadata.namespace field of the entity.","minLength":1},"name":{"type":"string","description":"The metadata.name field of the entity.","minLength":1}}},"relation":{"$id":"#relation","type":"object","description":"A directed relation from one entity to another.","required":["type","target"],"additionalProperties":false,"properties":{"type":{"type":"string","minLength":1,"pattern":"^\\\\w+$","description":"The type of relation."},"target":{"$ref":"#reference"},"targetRef":{"type":"string","minLength":1,"description":"The entity ref of the target of this relation."}}},"status":{"$id":"#status","type":"object","description":"The current status of the entity, as claimed by various sources.","required":[],"additionalProperties":true,"properties":{"items":{"type":"array","items":{"$ref":"#statusItem"}}}},"statusItem":{"$id":"#statusItem","type":"object","description":"A specific status item on a well known format.","required":["type","level","message"],"additionalProperties":true,"properties":{"type":{"type":"string","minLength":1},"level":{"$ref":"#statusLevel","description":"The status level / severity of the status item."},"message":{"type":"string","description":"A brief message describing the status, intended for human consumption."},"error":{"$ref":"#error","description":"An optional serialized error object related to the status."}}},"statusLevel":{"$id":"#statusLevel","type":"string","description":"A status level / severity.","enum":["info","warning","error"]},"error":{"$id":"#error","type":"object","description":"A serialized error object.","required":["name","message"],"additionalProperties":true,"properties":{"name":{"type":"string","examples":["Error","InputError"],"description":"The type name of the error","minLength":1},"message":{"type":"string","description":"The message of the error"},"code":{"type":"string","description":"An error code associated with the error"},"stack":{"type":"string","description":"An error stack trace"}}}}}');const ne=new Map,$=[V,C,oe,ee];function T(_){if(!(_!=null&&_.length))throw new TypeError("Unknown error");const N=_[0];throw new TypeError(`${N.instancePath||"<root>"} ${N.message}${N.params?` - ${Object.entries(N.params).map(([ve,$e])=>`${ve}: ${$e}`).join(", ")}`:""}`)}function P(_,N={}){var ve;const $e=(ve=N==null?void 0:N.disableCache)!==null&&ve!==void 0?ve:!1,et=$e?"":JSON.stringify(_);if(!$e){const tn=ne.get(et);if(tn)return tn}const at=L(_),It=new(I())({allowUnionTypes:!0,allErrors:!0,validateSchema:!0});at.length&&It.addSchema(at,void 0,void 0,!0);const Bt=It.compile(_);return $e||ne.set(et,Bt),Bt}function L(_){if(typeof _!="object")return[];const N=new Set;_.$id&&N.add(_.$id);const ve=new Array,$e=[_];for(;$e.length;){const et=$e.pop();for(const at of O(et))if(!N.has(at)){N.add(at);const It=$.find(Bt=>Bt.$id===at);It&&(ve.push(It),$e.push(It))}}return ve}function*O(_){const N=[_];for(;N.length;){const ve=N.pop();if(typeof ve=="object"&&ve)for(const[$e,et]of Object.entries(ve))$e==="$ref"&&typeof et=="string"?yield et.split("#")[0]:N.push(et)}}function re(_){const N=compileAjvSchema(_||entityEnvelopeSchema);return ve=>{if(N(ve)===!0)return ve;throw throwAjvError(N.errors)}}function Pe(_){const N=P(_);return ve=>{var $e;if(N(ve)===!0)return ve;const at=($e=N.errors)===null||$e===void 0?void 0:$e.filter(It=>["/kind","/apiVersion"].includes(It.instancePath));if(at!=null&&at.length&&at.every(It=>It.keyword==="enum"))return!1;throw T(N.errors)}}function We(_){const N=compileAjvSchema(_||entitySchema);return ve=>{if(N(ve)===!0)return ve;throw throwAjvError(N.errors)}}class z{static isValidApiVersion(N){return ue.isValidPrefixAndOrSuffix(N,"/",ue.isValidDnsSubdomain,ve=>ve.length>=1&&ve.length<=63&&/^[a-z0-9A-Z]+$/.test(ve))}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 ue.isValidDnsLabel(N)}static isValidLabelKey(N){return ue.isValidPrefixAndOrSuffix(N,"/",ue.isValidDnsSubdomain,z.isValidObjectName)}static isValidLabelValue(N){return N===""||z.isValidObjectName(N)}static isValidAnnotationKey(N){return ue.isValidPrefixAndOrSuffix(N,"/",ue.isValidDnsSubdomain,z.isValidObjectName)}static isValidAnnotationValue(N){return typeof N=="string"}}const xt={isValidApiVersion:z.isValidApiVersion,isValidKind:z.isValidKind,isValidEntityName:z.isValidObjectName,isValidNamespace:z.isValidNamespace,isValidLabelKey:z.isValidLabelKey,isValidLabelValue:z.isValidLabelValue,isValidAnnotationKey:z.isValidAnnotationKey,isValidAnnotationValue:z.isValidAnnotationValue,isValidTag:_=>typeof _=="string"&&_.length>=1&&_.length<=63&&/^[a-z0-9:+#]+(\-[a-z0-9:+#]+)*$/.test(_)};function st(_={}){return{...xt,..._}}class Ke{async enforce(N){function ve(ce,y,Z){if(y==null)throw new Error(`${ce} must have a value`);let q;try{q=Z(y)}catch(Y){throw new Error(`${ce} could not be validated, ${Y}`)}if(!q){let Y;switch(Z.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 Ce=Y?` expected ${Y} but found "${y}".`:"";throw new Error(`"${ce}" is not valid;${Ce} 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 $e(ce,y,Z){return y===void 0||ve(ce,y,Z)}ve("apiVersion",N.apiVersion,this.validators.isValidApiVersion),ve("kind",N.kind,this.validators.isValidKind),ve("metadata.name",N.metadata.name,this.validators.isValidEntityName),$e("metadata.namespace",N.metadata.namespace,this.validators.isValidNamespace);var et;for(const[ce,y]of Object.entries((et=N.metadata.labels)!==null&&et!==void 0?et:[]))ve(`labels.${ce}`,ce,this.validators.isValidLabelKey),ve(`labels.${ce}`,y,this.validators.isValidLabelValue);var at;for(const[ce,y]of Object.entries((at=N.metadata.annotations)!==null&&at!==void 0?at:[]))ve(`annotations.${ce}`,ce,this.validators.isValidAnnotationKey),ve(`annotations.${ce}`,y,this.validators.isValidAnnotationValue);var It;const Bt=(It=N.metadata.tags)!==null&&It!==void 0?It:[];for(let ce=0;ce<Bt.length;++ce)ve(`tags.${ce}`,Bt[ce],this.validators.isValidTag);var tn;const X=(tn=N.metadata.links)!==null&&tn!==void 0?tn:[];for(let ce=0;ce<X.length;++ce){var K,se,pe;ve(`links.${ce}.url`,(K=X[ce])===null||K===void 0?void 0:K.url,CommonValidatorFunctions.isValidUrl),$e(`links.${ce}.title`,(se=X[ce])===null||se===void 0?void 0:se.title,CommonValidatorFunctions.isNonEmptyString),$e(`links.${ce}.icon`,(pe=X[ce])===null||pe===void 0?void 0:pe.icon,KubernetesValidatorFunctions.isValidObjectName)}return N}constructor(N=makeValidator()){_define_property(this,"validators",void 0),this.validators=N}}class it{async enforce(N){if(!this.validate){const et=new Ajv({allowUnionTypes:!0});this.validate=et.addSchema([commonSchema,entityMetaSchema],void 0,void 0,!0).compile(entitySchema)}if(this.validate(N)===!0)return N;const[$e]=this.validate.errors||[];throw $e?new Error(`Malformed envelope, ${$e.instancePath||"<root>"} ${$e.message}`):new Error("Malformed envelope, Unknown error")}constructor(){_define_property(this,"validate",void 0)}}function nt(_){let N=_.indexOf(":");const ve=_.indexOf("/");ve!==-1&&ve<N&&(N=-1);const $e=N===-1?void 0:_.slice(0,N),et=ve===-1?void 0:_.slice(N+1,ve),at=_.slice(Math.max(N+1,ve+1));if($e===""||et===""||at==="")throw new TypeError(`Entity reference "${_}" was not on the form [<kind>:][<namespace>/]<name>`);return{kind:$e,namespace:et,name:at}}function bt(_){return{kind:_.kind,namespace:_.metadata.namespace||t,name:_.metadata.name}}function St(_,N){if(!_)throw new Error("Entity reference must not be empty");const ve=N==null?void 0:N.defaultKind,$e=(N==null?void 0:N.defaultNamespace)||t;let et,at,It;if(typeof _=="string"){const se=nt(_);var Bt;et=(Bt=se.kind)!==null&&Bt!==void 0?Bt:ve;var tn;at=(tn=se.namespace)!==null&&tn!==void 0?tn:$e,It=se.name}else{var X;et=(X=_.kind)!==null&&X!==void 0?X:ve;var K;at=(K=_.namespace)!==null&&K!==void 0?K:$e,It=_.name}if(et)if(at){if(!It){const se=JSON.stringify(_);throw new Error(`Entity reference ${se} had missing or empty name`)}}else{const se=JSON.stringify(_);throw new Error(`Entity reference ${se} had missing or empty namespace`)}else{const se=JSON.stringify(_);throw new Error(`Entity reference ${se} had missing or empty kind (e.g. did not start with "component:" or similar)`)}return{kind:et,namespace:at,name:It}}function pt(_){let N,ve,$e;if("metadata"in _){N=_.kind;var et;ve=(et=_.metadata.namespace)!==null&&et!==void 0?et:t,$e=_.metadata.name}else{N=_.kind;var at;ve=(at=_.namespace)!==null&&at!==void 0?at:t,$e=_.name}return`${N.toLocaleLowerCase("en-US")}:${ve.toLocaleLowerCase("en-US")}/${$e.toLocaleLowerCase("en-US")}`}var ft=r(87612);class wt{async enforce(N){let ve=N;for(const $e of this.policies){const et=await $e.enforce(ve);if(!et)throw new Error(`Policy ${$e.constructor.name} did not return a result`);ve=et}return ve}constructor(N){(0,ft._)(this,"policies",void 0),this.policies=N}}class $t{async enforce(N){for(const ve of this.policies){const $e=await ve.enforce(N);if($e)return $e}throw new Error("The entity did not match any known policy")}constructor(N){(0,ft._)(this,"policies",void 0),this.policies=N}}const Ve={allOf(_){return new wt(_)},oneOf(_){return new $t(_)}};var qt=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 ge(_){let N;return{async check(ve){return N||(N=Pe(_)),N(ve)===ve}}}const be=ge(qt);var Fe=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 Je=ge(Fe);var vt=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 Ot=ge(vt);var ht=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 Rt=ge(ht);var Ft=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 Yt=ge(Ft),kt="ownedBy",dn="ownerOf",Kt="consumesApi",un="apiConsumedBy",Mn="providesApi",Bn="apiProvidedBy",xn="dependsOn",$n="dependencyOf",Dn="parentOf",on="childOf",wn="memberOf",zn="hasMember",ut="partOf",_t="hasPart";var Wt=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 dt=ge(Wt);var bn=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 Vt=ge(bn);var hn=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 jn=ge(hn),an="backstage.io/managed-by-location",Yn="backstage.io/managed-by-origin-location",je="backstage.io/source-location",le=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*\:/i;function Oe(_){if(typeof _!="string")throw new TypeError(`Unable to parse location ref '${_}', unexpected argument ${typeof _}`);const N=_.indexOf(":");if(N<0)throw new TypeError(`Unable to parse location ref '${_}', expected '<type>:<target>', e.g. 'url:https://host/path'`);const ve=_.substring(0,N).trim(),$e=_.substring(N+1).trim();if(!ve||!$e)throw new TypeError(`Unable to parse location ref '${_}', expected '<type>:<target>', e.g. 'url:https://host/path'`);if(ve==="http"||ve==="https")throw new TypeError(`Invalid location ref '${_}', please prefix it with 'url:', e.g. 'url:${_}'`);if(le.test($e))throw new TypeError(`Invalid location ref '${_}', target is a javascript: URL`);return{type:ve,target:$e}}function Ue(_){const{type:N,target:ve}=_;if(N){if(!ve)throw new TypeError("Unable to stringify location ref, empty target")}else throw new TypeError("Unable to stringify location ref, empty type");if(le.test(ve))throw new TypeError(`Invalid location ref '${N}:${ve}', target is a javascript: URL`);return`${N}:${ve}`}function qe(_){var N,ve,$e,et,at;const It=(at=(N=_.metadata)===null||N===void 0||(ve=N.annotations)===null||ve===void 0?void 0:ve[je])!==null&&at!==void 0?at:($e=_.metadata)===null||$e===void 0||(et=$e.annotations)===null||et===void 0?void 0:et[an];if(!It)throw new Error(`Entity '${pt(_)}' is missing location`);return Oe(It)}},15332:function(Ct,Be,r){"use strict";r.d(Be,{r:function(){return L}});var t=r(52322),h=r(60871),H=r(86689),f=r(79692),W=r(90436),g=r(72779),d=r.n(g),B=r(76635),ye=r(2784),ue=r(73557),V=r(71597);function J(){const[O]=(0,ue.is)((0,t.jsx)(ue.AW,{index:!0,element:(0,t.jsx)("div",{})}));return!O.index}const I=(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"}),C=O=>/^([a-z+.-]+):/.test(O),oe=/^[\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,ee=window.open;if(ee&&!ee.__backstage){const O=function(...Pe){const We=String(Pe[0]);if(oe.test(We))throw new Error("Rejected window.open() with a javascript: URL as a security precaution");return ee.apply(this,Pe)};O.__backstage=!0,window.open=O}const ne=()=>{try{return(0,h.h_)(h.Ds).getOptionalString("app.baseUrl")}catch{return}},$=()=>{const O="http://sample.dev";var re;const Pe=(re=ne())!==null&&re!==void 0?re:"/",{pathname:We}=new URL(Pe,O);return(0,B.trimEnd)(We,"/")},T=O=>{let re=String(O);const Pe=$(),We=C(re),z=re.startsWith(Pe);return!We&&!z&&(re=Pe.concat(re)),re},P=O=>{if(O instanceof Array)return O.map(P).join(" ").trim();if(typeof O=="object"&&O){var re;return P(O==null||(re=O.props)===null||re===void 0?void 0:re.children)}return["string","number"].includes(typeof O)?String(O):""},L=ye.forwardRef(({onClick:O,noTrack:re,...Pe},We)=>{const z=I(),xt=(0,h.z$)(),st=J()?T(Pe.to):Pe.to,Ke=P(Pe.children)||st,it=C(st),nt=it&&!!/^https?:/.exec(st);if(oe.test(st))throw new Error("Link component rejected javascript: URL as a security precaution");const bt=St=>{O==null||O(St),re||xt.captureEvent("click",Ke,{attributes:{to:st}})};return it?(0,t.jsxs)(H.Z,{...nt?{target:"_blank",rel:"noopener"}:{},...Pe,ref:We,href:st,onClick:bt,className:d()(z.externalLink,Pe.className),children:[Pe.children,(0,t.jsx)(W.Z,{component:"span",className:z.visuallyHidden,children:", Opens in a new window"})]}):(0,t.jsx)(H.Z,{...Pe,ref:We,component:V.rU,to:st,onClick:bt})})},53974:function(Ct,Be,r){"use strict";r.d(Be,{Oi:function(){return Pe},VY:function(){return Ns},yW:function(){return Wa},XF:function(){return st},mn:function(){return $n},NX:function(){return wt},ub:function(){return le},mf:function(){return Ya},yu:function(){return lt},h4:function(){return va},M6:function(){return c},i9:function(){return sl},aR:function(){return a},rJ:function(){return Sr},Oh:function(){return ul},hu:function(){return ll},rU:function(){return ue.r},Qj:function(){return J},nU:function(){return mr},SA:function(){return Qn},sk:function(){return at},Or:function(){return $r},T3:function(){return ya},g9:function(){return fl},Ex:function(){return Dr},Gk:function(){return Ut},tn:function(){return A},Ph:function(){return de},YE:function(){return pi},v7:function(){return bi},R6:function(){return $s},tR:function(){return Vi},uw:function(){return Le},qt:function(){return ei},iA:function(){return ma},GB:function(){return tt},po:function(){return hr},mZ:function(){return zo},Pf:function(){return Wo}});var t=r(52322),h=r(60871),H=r(19928),f=r(2784);function W(e){const[o,l]=useState([]),u=useApi(alertApiRef),{anchorOrigin:m={vertical:"top",horizontal:"center"},transientTimeoutMs:v}=e,w=v!=null?v:5e3;useEffect(()=>{const F=u.alert$().subscribe(fe=>l(he=>he.concat(fe)));return()=>{F.unsubscribe()}},[u]);const[M]=o;if(useEffect(()=>{if(M&&M.display==="transient"){const F=setTimeout(()=>{l(fe=>{const he=fe.filter(Ee=>Ee!==M);return he.length===fe.length?fe:he})},w);return()=>clearTimeout(F)}},[M,w]),o.length===0)return null;const G=()=>{l(F=>F.filter(fe=>fe!==M))};return _jsx(Snackbar,{open:!0,anchorOrigin:m,children:_jsx(Alert,{action:_jsx(IconButton,{color:"inherit",size:"small",onClick:G,"data-testid":"error-button-close",children:_jsx(CloseIcon,{})}),severity:M.severity,children:_jsxs(Typography,{component:"span",children:[String(M.message),o.length>1&&_jsx("em",{children:` (${o.length-1} older ${pluralize("message",o.length-1)})`})]})})})}var g=r(79692);const d=(0,g.Z)(e=>({avatar:{width:"4rem",height:"4rem",color:e.palette.common.white},avatarText:{fontWeight:e.typography.fontWeightBold,letterSpacing:"1px",textTransform:"uppercase"}}),{name:"BackstageAvatar"});function B(e){const{displayName:o,picture:l,customStyles:u}=e,m=d();let v={...u};const w={fontFamily:v.fontFamily,fontSize:v.fontSize,fontWeight:v.fontWeight};return l||(v={backgroundColor:stringToColor(o||""),...u}),_jsx(MaterialAvatar,{alt:o,src:l,className:m.avatar,style:v,children:o&&_jsx(Typography,{variant:"h6",component:"span",className:m.avatarText,style:w,children:extractInitials(o)})})}var ye=r(77277),ue=r(15332);const V=f.forwardRef((e,o)=>(0,t.jsx)(ue.r,{ref:o,...e,color:"initial"})),J=f.forwardRef((e,o)=>(0,t.jsx)(ye.Z,{ref:o,component:V,...e})),I=null;var C=r(95544),oe=r(60364),ee=r(83229),ne=r(26639),$=r(39595),T=r(61837),P=r(80030),L=r(19353),O=r(95074);function re(e){const{text:o,tooltipDelay:l=1e3,tooltipText:u="Text copied to clipboard","aria-label":m="Copy text"}=e,v=(0,h.h_)(h.VE),[w,M]=(0,f.useState)(!1),[{error:G},F]=(0,O.Z)();(0,f.useEffect)(()=>{G&&v.post(G)},[G,v]);const fe=he=>{he.stopPropagation(),M(!0),F(o)};return(0,t.jsx)(t.Fragment,{children:(0,t.jsx)(P.ZP,{id:"copy-test-tooltip",title:u,placement:"top",leaveDelay:l,onClose:()=>M(!1),open:w,children:(0,t.jsx)(T.Z,{onClick:fe,"aria-label":m,children:(0,t.jsx)(L.Z,{})})})})}function Pe(e){const{text:o,language:l,showLineNumbers:u=!1,highlightedNumbers:m,customStyle:v,showCopyCodeButton:w=!1}=e,M=(0,oe.Z)(),G=M.palette.type==="dark"?ne.Z:$.Z,F=M.palette.type==="dark"?"#256bf3":"#e6ffed";return(0,t.jsxs)(C.Z,{position:"relative",children:[(0,t.jsx)(ee.Z,{customStyle:v,language:l,style:G,showLineNumbers:u,wrapLines:!0,lineNumberStyle:{color:M.palette.textVerySubtle},lineProps:fe=>m!=null&&m.includes(fe)?{style:{backgroundColor:F}}:{},children:o}),w&&(0,t.jsx)(C.Z,{position:"absolute",top:0,right:0,children:(0,t.jsx)(re,{text:o})})]})}var We=r(41156),z=r(71597),xt=r(88188);function st(e){const{title:o,to:l}=e,u=(0,We.Z)(m=>m.breakpoints.down("xs"));return l?u?(0,t.jsx)(T.Z,{component:z.rU,color:"primary",title:o,size:"small",to:l,children:(0,t.jsx)(xt.Z,{})}):(0,t.jsx)(ye.Z,{component:z.rU,variant:"contained",color:"primary",to:l,children:o}):null}var Ke=r(27397),it=r(11105),nt=r(97963),bt=r(46506),St=r.n(bt),pt=r(54073),ft=r.n(pt),wt;(function(e){let o;(function(v){v.TOP_BOTTOM="TB",v.BOTTOM_TOP="BT",v.LEFT_RIGHT="LR",v.RIGHT_LEFT="RL"})(o=e.Direction||(e.Direction={}));let l;(function(v){v.UP_LEFT="UL",v.UP_RIGHT="UR",v.DOWN_LEFT="DL",v.DOWN_RIGHT="DR"})(l=e.Alignment||(e.Alignment={}));let u;(function(v){v.NETWORK_SIMPLEX="network-simplex",v.TIGHT_TREE="tight-tree",v.LONGEST_PATH="longest-path"})(u=e.Ranker||(e.Ranker={}));let m;(function(v){v.LEFT="l",v.RIGHT="r",v.CENTER="c"})(m=e.LabelPosition||(e.LabelPosition={}))})(wt||(wt={}));var $t=r(10368);const Ve=(0,g.Z)(e=>({node:{fill:e.palette.primary.light,stroke:e.palette.primary.light},text:{fill:e.palette.primary.contrastText}}),{name:"BackstageDependencyGraphDefaultNode"});function qt({node:{id:e}}){const o=Ve(),[l,u]=f.useState(0),[m,v]=f.useState(0),w=f.useRef(null);f.useLayoutEffect(()=>{if(w.current){let{height:fe,width:he}=w.current.getBBox();fe=Math.round(fe),he=Math.round(he),(fe!==m||he!==l)&&(u(he),v(fe))}},[l,m]);const M=10,G=l+M*2,F=m+M*2;return(0,t.jsxs)("g",{children:[(0,t.jsx)("rect",{className:o.node,width:G,height:F,rx:10}),(0,t.jsx)("text",{ref:w,className:o.text,y:F/2,x:G/2,textAnchor:"middle",alignmentBaseline:"middle",children:e})]})}const ge="arrow-marker",be="node",Fe="edge",Je="label",vt=(0,$t.Z)(e=>({node:{transition:`${e.transitions.duration.shortest}ms`}}),{name:"BackstageDependencyGraphNode"}),Ot=e=>(0,t.jsx)(qt,{...e});function ht({render:e=Ot,setNode:o,node:l}){const{width:u,height:m,x:v=0,y:w=0}=l,M=l,G=vt(),F=f.useRef(null);return f.useLayoutEffect(()=>{if(F.current){let{height:fe,width:he}=F.current.getBBox();fe=Math.round(fe),he=Math.round(he),(fe!==m||he!==u)&&o(l.id,{...l,height:fe,width:he})}},[l,u,m,o]),(0,t.jsx)("g",{ref:F,"data-testid":be,className:G.node,transform:`translate(${v-u/2},${w-m/2})`,children:e({node:M})})}var Rt=r(76985),Ft=r(39829),Yt=r(19574),kt=r.n(Yt);const dn=(0,$t.Z)(e=>({text:{fill:e.palette.textContrast}}),{name:"BackstageDependencyGraphDefaultLabel"});function Kt({edge:{label:e}}){const o=dn();return(0,t.jsx)("text",{className:o.text,textAnchor:"middle",children:e})}const un=(0,$t.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"}),Mn=e=>(0,t.jsx)(Kt,{...e});function Bn({render:e=Mn,setEdge:o,id:l,edge:u,curve:m}){const{x:v=0,y:w=0,width:M,height:G,points:F}=u,fe=u,he=un(),Ee=f.useRef(null);f.useLayoutEffect(()=>{if(Ee.current){let{height:_e,width:Zt}=Ee.current.getBBox();_e=Math.round(_e),Zt=Math.round(Zt),(_e!==G||Zt!==M)&&o(l,{...u,height:_e,width:Zt})}},[u,G,M,o,l]);let Ie="";const Me=f.useMemo(()=>Rt.Z().x(_e=>_e.x).y(_e=>_e.y).curve(Ft[m]),[m]);if(F){const _e=F.filter(Zt=>kt()(Zt.x)&&kt()(Zt.y));Ie=Me(_e)||""}return(0,t.jsxs)(t.Fragment,{children:[Ie&&(0,t.jsx)("path",{"data-testid":Fe,className:he.path,d:Ie}),fe.label?(0,t.jsx)("g",{ref:Ee,"data-testid":Je,className:he.label,transform:`translate(${v},${w})`,children:e({edge:fe})}):null]})}const xn="workspace";function $n(e){var o,l;const{edges:u,nodes:m,renderNode:v,direction:w=wt.Direction.TOP_BOTTOM,align:M,nodeMargin:G=50,edgeMargin:F=10,rankMargin:fe=50,paddingX:he=0,paddingY:Ee=0,acyclicer:Ie,ranker:Me=wt.Ranker.NETWORK_SIMPLEX,labelPosition:_e=wt.LabelPosition.RIGHT,labelOffset:Zt=10,edgeRanks:pn=1,edgeWeight:kn=1,renderLabel:nr,defs:Nt,zoom:fn="enabled",curve:mn="curveMonotoneX",fit:Tr="grow",...Rr}=e,Ir=(0,nt.Z)(),[Pr,Li]=f.useState(100),[Wr,Oi]=f.useState(100),rn=f.useRef(new(St()).graphlib.Graph),[bo,Fs]=f.useState(((o=rn.current.graph())===null||o===void 0?void 0:o.width)||0),[Vr,ki]=f.useState(((l=rn.current.graph())===null||l===void 0?void 0:l.height)||0),[Fn,Cr]=f.useState([]),[Xr,qr]=f.useState([]),vn=Math.max(bo,Pr),Cn=Math.max(Vr,Wr),So=Math.min(Vr,Wr),_r=Tr==="grow"?Cn:So,qo=f.useMemo(()=>ft()(Sn=>{if(!Sn)return;const Un=it.Z(Sn),yn=it.Z(Sn.getElementById(xn));function fr(){Un.call(Ke.sP().scaleExtent([1,10]).on("zoom",Lr=>{Lr.transform.x=Math.min(0,Math.max(Lr.transform.x,vn-vn*Lr.transform.k)),Lr.transform.y=Math.min(0,Math.max(Lr.transform.y,Cn-Cn*Lr.transform.k)),yn.attr("transform",Lr.transform)}))}fn==="enabled"?fr():fn==="enable-on-click"&&Un.on("click",()=>fr());const{width:gr,height:Us}=Sn.getBoundingClientRect();Pr!==gr&&Li(gr),Wr!==Us&&Oi(Us)},100),[Wr,Pr,vn,Cn,fn]),Ea=f.useCallback(()=>{const Sn=rn.current.nodes(),Un=rn.current.edges();Sn.forEach(yn=>{m.some(gr=>gr.id===yn)||rn.current.removeNode(yn)}),Un.forEach(yn=>{u.some(gr=>gr.from===yn.v&&gr.to===yn.w)||rn.current.removeEdge(yn.v,yn.w)}),m.forEach(yn=>{const fr=rn.current.nodes().find(gr=>yn.id===gr);if(fr&&rn.current.node(fr)){const{width:gr,height:Us,x:Lr,y:kl}=rn.current.node(fr);rn.current.setNode(fr,{...yn,width:gr,height:Us,x:Lr,y:kl})}else rn.current.setNode(yn.id,{...yn,width:0,height:0})}),u.forEach(yn=>{rn.current.setEdge(yn.from,yn.to,{...yn,label:yn.label,width:0,height:0,labelpos:_e,labeloffset:Zt,weight:kn,minlen:pn})})},[u,m,_e,Zt,kn,pn]),_o=f.useMemo(()=>ft()(()=>{St().layout(rn.current);const{height:Sn,width:Un}=rn.current.graph(),yn=Math.max(0,Sn||0),fr=Math.max(0,Un||0);Fs(fr),ki(yn),Cr(rn.current.nodes()),qr(rn.current.edges())},250,{leading:!0}),[]);f.useEffect(()=>(rn.current.setGraph({rankdir:w,align:M,nodesep:G,edgesep:F,ranksep:fe,marginx:he,marginy:Ee,acyclicer:Ie,ranker:Me}),Ea(),_o(),_o.cancel),[Ie,M,w,F,he,Ee,G,fe,Me,Ea,_o]);function Ll(Sn,Un){return rn.current.setNode(Sn,Un),_o(),rn.current}function Ol(Sn,Un){return rn.current.setEdge(Sn,Un),_o(),rn.current}return(0,t.jsxs)("svg",{ref:qo,...Rr,width:"100%",height:_r,viewBox:`0 0 ${vn} ${Cn}`,children:[(0,t.jsxs)("defs",{children:[(0,t.jsx)("marker",{id:ge,viewBox:"0 0 24 24",markerWidth:"14",markerHeight:"14",refX:"16",refY:"12",orient:"auto",markerUnits:"strokeWidth",children:(0,t.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"})}),Nt]}),(0,t.jsx)("g",{id:xn,children:(0,t.jsxs)("svg",{width:bo,height:Vr,y:Cn/2-Vr/2,x:vn/2-bo/2,viewBox:`0 0 ${bo} ${Vr}`,children:[Xr.map(Sn=>{const Un=rn.current.edge(Sn);return Un?(0,t.jsx)(Bn,{id:Sn,setEdge:Ol,render:nr,edge:Un,curve:mn},`${Sn.v}-${Sn.w}`):null}),Fn.map(Sn=>{const Un=rn.current.node(Sn);return Un?(0,t.jsx)(ht,{setNode:Ll,render:v,node:Un},Sn):null})]})})]})}var Dn=r(72779),on=r.n(Dn),wn,zn;const ut=(0,g.Z)(e=>({root:{padding:e.spacing(0),marginBottom:e.spacing(0),marginTop:e.spacing(0),display:"flex",flexFlow:"row nowrap"},topPosition:{position:"relative",marginBottom:e.spacing(6),marginTop:-e.spacing(3),zIndex:"unset"},icon:{fontSize:e.typography.h6.fontSize},content:{width:"100%",maxWidth:"inherit",flexWrap:"nowrap",color:e.palette.banner.text},message:{display:"flex",alignItems:"center","& a":{color:e.palette.banner.link}},button:{color:(wn=e.palette.banner.closeButtonColor)!==null&&wn!==void 0?wn:"inherit"},info:{backgroundColor:e.palette.banner.info},error:{backgroundColor:e.palette.banner.error},warning:{backgroundColor:(zn=e.palette.banner.warning)!==null&&zn!==void 0?zn:e.palette.banner.error}}),{name:"BackstageDismissableBanner"}),_t=e=>{const{variant:o,message:l,id:u,fixed:m=!1}=e,v=ut(),M=useApi(storageApiRef).forBucket("notifications");var G;const F=(G=M.snapshot("dismissedBanners").value)!==null&&G!==void 0?G:[],[fe,he]=useState(new Set(F)),Ee=useObservable(M.observe$("dismissedBanners"));useEffect(()=>{if(Ee!=null&&Ee.value){var Me;const _e=(Me=Ee==null?void 0:Ee.value)!==null&&Me!==void 0?Me:[];he(new Set(_e))}},[Ee==null?void 0:Ee.value]);const Ie=()=>{M.set("dismissedBanners",[...fe,u])};return _jsx(Snackbar,{anchorOrigin:m?{vertical:"bottom",horizontal:"center"}:{vertical:"top",horizontal:"center"},open:!fe.has(u),classes:{root:classNames(v.root,!m&&v.topPosition)},children:_jsx(SnackbarContent,{classes:{root:classNames(v.content,v[o]),message:v.message},message:l,action:[_jsx(IconButton,{title:"Permanently dismiss this message",className:v.button,onClick:Ie,children:_jsx(Close,{className:v.icon})},"dismiss")]})})};var Wt=r(60905),dt=r(90436),bn=r.p+"static/missingAnnotation.67f79e98..svg",Vt=r.p+"static/noInformation.4b426325..svg",hn=r.p+"static/createComponent.975d1e1e..svg",jn=r.p+"static/noBuild.1715fa71..svg";const an=(0,g.Z)({generalImg:{width:"95%",zIndex:2,position:"relative",left:"50%",top:"50%",transform:"translate(-50%, 15%)"}},{name:"BackstageEmptyStateImage"}),Yn=({missing:e})=>{const o=an();switch(e){case"field":return(0,t.jsx)("img",{src:bn,className:o.generalImg,alt:"annotation is missing"});case"info":return(0,t.jsx)("img",{src:Vt,alt:"no Information",className:o.generalImg});case"content":return(0,t.jsx)("img",{src:hn,alt:"create Component",className:o.generalImg});case"data":return(0,t.jsx)("img",{src:jn,alt:"no Build",className:o.generalImg});default:return null}},je=(0,g.Z)(e=>({root:{backgroundColor:e.palette.background.default,padding:e.spacing(2,0,0,0)},action:{marginTop:e.spacing(2)},imageContainer:{position:"relative"}}),{name:"BackstageEmptyState"});function le(e){const{title:o,description:l,missing:u,action:m}=e,v=je();return(0,t.jsxs)(Wt.Z,{container:!0,direction:"row",justifyContent:"space-around",alignItems:"flex-start",className:v.root,spacing:2,children:[(0,t.jsx)(Wt.Z,{item:!0,xs:12,md:6,children:(0,t.jsxs)(Wt.Z,{container:!0,direction:"column",children:[(0,t.jsx)(Wt.Z,{item:!0,xs:!0,children:(0,t.jsx)(dt.Z,{variant:"h5",children:o})}),(0,t.jsx)(Wt.Z,{item:!0,xs:!0,children:(0,t.jsx)(dt.Z,{variant:"body1",children:l})}),(0,t.jsx)(Wt.Z,{item:!0,xs:!0,className:v.action,children:m})]})}),(0,t.jsx)(Wt.Z,{item:!0,xs:12,md:6,className:v.imageContainer,children:typeof u=="string"?(0,t.jsx)(Yn,{missing:u}):u.customImage})]})}const Oe=`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`,Ue=/^.*ANNOTATION.*$/m,qe=Oe.match(Ue)[0],_=Oe.split(`
|
|
12
|
+
`).findIndex(e=>Ue.test(e)),N=(0,g.Z)(e=>({code:{borderRadius:6,margin:`${e.spacing(2)}px 0px`,background:e.palette.type==="dark"?"#444":e.palette.common.white}}),{name:"BackstageMissingAnnotationEmptyState"});function ve(e){return Array.from(Array(e+1).keys(),o=>o+_)}function $e(e){const o=e.map(l=>qe.replace("ANNOTATION",l)).join(`
|
|
13
|
+
`);return Oe.replace(qe,o)}function et(e){const o=e.length<=1;return(0,t.jsxs)(t.Fragment,{children:["The ",o?"annotation":"annotations"," ",e.map(l=>(0,t.jsx)("code",{children:l})).reduce((l,u)=>(0,t.jsxs)(t.Fragment,{children:[l,", ",u]}))," ",o?"is":"are"," missing. You need to add the"," ",o?"annotation":"annotations"," to your component if you want to enable this tool."]})}function at(e){const{annotation:o,readMoreUrl:l}=e,u=Array.isArray(o)?o:[o],m=l||"https://backstage.io/docs/features/software-catalog/well-known-annotations",v=N();return(0,t.jsx)(le,{missing:"field",title:"Missing Annotation",description:et(u),action:(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(dt.Z,{variant:"body1",children:"Add the annotation to your component YAML as shown in the highlighted example below:"}),(0,t.jsx)(C.Z,{className:v.code,children:(0,t.jsx)(Pe,{text:$e(u),language:"yaml",showLineNumbers:!0,highlightedNumbers:ve(u.length),customStyle:{background:"inherit",fontSize:"115%"}})}),(0,t.jsx)(ye.Z,{color:"primary",component:ue.r,to:m,children:"Read more"})]})})}var It=r(11776),Bt=r(38402),tn=r(49378),X=r(41128),K=r(27616),se=r(8284),pe=r(70660),ce=r(91750),y=r(38016);const Z=(e,o)=>(o.palette.type==="light"?X._j:X.$n)(o.palette[e].light,.6),q=(e,o)=>(o.palette.type==="light"?X.$n:X._j)(o.palette[e].light,.9),Y=(0,g.Z)(e=>({root:{marginRight:e.spacing(1),fill:({severity:o})=>Z(o,e)}})),Ce=({severity:e})=>{const o=Y({severity:e});return(0,t.jsx)(ce.Z,{classes:o})},Re=({severity:e})=>{const o=Y({severity:e});return(0,t.jsx)(y.Z,{classes:o})},Qe=(0,g.Z)(e=>({panel:{backgroundColor:({severity:o})=>q(o,e),color:({severity:o})=>Z(o,e),verticalAlign:"middle"},summary:{display:"flex",flexDirection:"row"},summaryText:{color:({severity:o})=>Z(o,e),fontWeight:e.typography.fontWeightBold},message:{width:"100%",display:"block",color:({severity:o})=>Z(o,e),backgroundColor:({severity:o})=>q(o,e)},details:{width:"100%",display:"block",color:e.palette.textContrast,backgroundColor:e.palette.background.default,border:`1px solid ${e.palette.border}`,padding:e.spacing(2),fontFamily:"sans-serif"}}),{name:"BackstageWarningPanel"}),Et=e=>e.charAt(0).toLocaleUpperCase("en-US")+e.slice(1);function tt(e){const{severity:o="warning",title:l,message:u,children:m,defaultExpanded:v}=e,w=Qe({severity:o}),M=Et(o)+(l?`: ${l}`:"");return(0,t.jsxs)(K.Z,{defaultExpanded:v!=null?v:!1,className:w.panel,role:"alert",children:[(0,t.jsxs)(se.Z,{expandIcon:(0,t.jsx)(Re,{severity:o}),className:w.summary,children:[(0,t.jsx)(Ce,{severity:o}),(0,t.jsx)(dt.Z,{className:w.summaryText,variant:"subtitle1",children:M})]}),(u||m)&&(0,t.jsx)(pe.Z,{children:(0,t.jsxs)(Wt.Z,{container:!0,children:[u&&(0,t.jsx)(Wt.Z,{item:!0,xs:12,children:(0,t.jsx)(dt.Z,{className:w.message,variant:"body1",children:u})}),m&&(0,t.jsx)(Wt.Z,{item:!0,xs:12,className:w.details,children:m})]})})]})}const yt=(0,g.Z)(e=>({text:{fontFamily:"monospace",whiteSpace:"pre",overflowX:"auto",marginRight:e.spacing(2)},divider:{margin:e.spacing(2)}}),{name:"BackstageErrorPanel"}),He=({error:e,message:o,stack:l,children:u})=>{const m=yt();return(0,t.jsxs)(It.Z,{dense:!0,children:[(0,t.jsxs)(Bt.Z,{alignItems:"flex-start",children:[(0,t.jsx)(tn.Z,{classes:{secondary:m.text},primary:"Error",secondary:e}),(0,t.jsx)(re,{text:e})]}),(0,t.jsxs)(Bt.Z,{alignItems:"flex-start",children:[(0,t.jsx)(tn.Z,{classes:{secondary:m.text},primary:"Message",secondary:o}),(0,t.jsx)(re,{text:o})]}),l&&(0,t.jsxs)(Bt.Z,{alignItems:"flex-start",children:[(0,t.jsx)(tn.Z,{classes:{secondary:m.text},primary:"Stack Trace",secondary:l}),(0,t.jsx)(re,{text:l})]}),u]})};function lt(e){const{title:o,error:l,defaultExpanded:u,children:m}=e;return(0,t.jsx)(tt,{severity:"error",title:o!=null?o:l.message,defaultExpanded:u,children:(0,t.jsx)(He,{error:l.name,message:l.message,stack:l.stack,children:m})})}var ot=r(85256);const Ht=(0,g.Z)(e=>({text:{fontFamily:"monospace",whiteSpace:"pre",overflowX:"auto",marginRight:e.spacing(2)},divider:{margin:e.spacing(2)}}),{name:"BackstageResponseErrorPanel"});function Ut(e){var o;const{title:l,error:u,defaultExpanded:m}=e,v=Ht();if(u.name!=="ResponseError")return(0,t.jsx)(lt,{title:l!=null?l:u.message,defaultExpanded:m,error:u});const{body:w,cause:M}=u,{request:G,response:F}=w,fe=`${F.statusCode}: ${M.name}`,he=G&&`${G.method} ${G.url}`,Ee=M.message.replace(/\\n/g,`
|
|
14
|
+
`),Ie=(o=M.stack)===null||o===void 0?void 0:o.replace(/\\n/g,`
|
|
15
|
+
`),Me=JSON.stringify(w,void 0,2);return(0,t.jsxs)(lt,{title:l!=null?l:u.message,defaultExpanded:m,error:{name:fe,message:Ee,stack:Ie},children:[he&&(0,t.jsxs)(Bt.Z,{alignItems:"flex-start",children:[(0,t.jsx)(tn.Z,{classes:{secondary:v.text},primary:"Request",secondary:G?`${he}`:void 0}),(0,t.jsx)(re,{text:he})]}),(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(ot.Z,{component:"li",className:v.divider}),(0,t.jsx)(Bt.Z,{alignItems:"flex-start",children:(0,t.jsx)(tn.Z,{classes:{secondary:v.text},primary:"Full Error as JSON"})}),(0,t.jsx)(Pe,{language:"json",text:Me,showCopyCodeButton:!0})]})]})}var Jt=r(28316);function en(e){const o=document.createElement("div");return o.setAttribute("id",e),o}function Dt(e){document.body.insertBefore(e,document.body.lastElementChild.nextElementSibling)}function At(e){const o=useRef(null);useEffect(function(){const m=document.querySelector(`#${e}`),v=m||en(e);return m||Dt(v),v.appendChild(o.current),function(){o.current.remove(),v.childNodes.length===-1&&v.remove()}},[e]);function l(){return o.current||(o.current=document.createElement("div")),o.current}return l()}var Pt=null;const Lt="core.calloutSeen";function nn(){const[e,o]=useState(()=>{const u=localStorage.getItem(Lt);return u?JSON.parse(u):{}}),l=useCallback((u,m)=>{const v=localStorage.getItem(Lt),M={...v?JSON.parse(v):{},[u]:m};o(M),localStorage.setItem(Lt,JSON.stringify(M))},[]);return{states:e,setState:l}}function En(e){const{states:o,setState:l}=nn(),u=useCallback(()=>{l(e,!0)},[l,e]);return{seen:o[e]===!0,markSeen:u}}function Wn(e){const{seen:o,markSeen:l}=En(e);return{show:o===!1,hide:l}}const Jn=(0,g.Z)(e=>({"@keyframes pulsateSlightly":{"0%":{transform:"scale(1.0)"},"100%":{transform:"scale(1.1)"}},"@keyframes pulsateAndFade":{"0%":{transform:"scale(1.0)",opacity:.9},"100%":{transform:"scale(1.5)",opacity:0}},featureWrapper:{position:"relative"},backdrop:{zIndex:2e3,position:"fixed",overflow:"hidden",left:0,right:0,top:0,bottom:0},dot:{position:"absolute",backgroundColor:"transparent",borderRadius:"100%",border:"1px solid rgba(103, 146, 180, 0.98)",boxShadow:"0px 0px 0px 20000px rgba(0, 0, 0, 0.5)",zIndex:2001,transformOrigin:"center center",animation:"$pulsateSlightly 1744ms 1.2s cubic-bezier(0.4, 0, 0.2, 1) alternate infinite"},pulseCircle:{width:"100%",height:"100%",backgroundColor:"transparent",borderRadius:"100%",border:`2px solid ${e.palette.common.white}`,zIndex:2001,transformOrigin:"center center",animation:"$pulsateAndFade 872ms 1.2s cubic-bezier(0.4, 0, 0.2, 1) infinite"},text:{position:"absolute",color:e.palette.common.white,zIndex:2003}}),{name:"BackstageFeatureCalloutCircular"});function lr(e){const{featureId:o,title:l,description:u,children:m}=e,{show:v,hide:w}=useShowCallout(o),M=usePortal("core.callout"),G=useRef(null),[F,fe]=useState(),he=Jn(),Ee=useCallback(()=>{if(G.current){const Ie=G.current.getBoundingClientRect(),Me=Math.max(Ie.width,Ie.height),_e=800,Zt=Ie.x-(Me-Ie.width)/2-_e,pn=Ie.y-(Me-Ie.height)/2-_e,kn=Me+2*_e,nr=450,Nt=Ie.x+Ie.width/2-nr,fn=Ie.y-(Me-Ie.height)/2+Me+20;fe({dotLeft:Zt,dotTop:pn,dotSize:kn,borderWidth:_e,textTop:fn,textLeft:Nt,textWidth:nr})}},[]);return useEffect(()=>(window.addEventListener("resize",Ee),window.addEventListener("scroll",Ee),()=>{window.removeEventListener("resize",Ee),window.removeEventListener("scroll",Ee)}),[Ee]),useLayoutEffect(Ee,[G.current,Ee]),v?_jsxs(_Fragment,{children:[_jsx(Box,{className:he.featureWrapper,ref:G,children:m}),createPortal(_jsx(Box,{className:he.backdrop,children:_jsx(ClickAwayListener,{onClickAway:w,children:_jsxs(_Fragment,{children:[_jsx(Box,{className:he.dot,"data-testid":"dot",style:{left:F==null?void 0:F.dotLeft,top:F==null?void 0:F.dotTop,width:F==null?void 0:F.dotSize,height:F==null?void 0:F.dotSize,borderWidth:F==null?void 0:F.borderWidth},onClick:w,onKeyDown:w,role:"button",tabIndex:0,children:_jsx(Box,{className:he.pulseCircle})}),_jsxs(Box,{className:he.text,"data-testid":"text",style:{left:F==null?void 0:F.textLeft,top:F==null?void 0:F.textTop,width:F==null?void 0:F.textWidth},children:[_jsx(Typography,{variant:"h2",paragraph:!0,children:l}),_jsx(Typography,{children:u})]})]})})}),M)]}):_jsx(_Fragment,{children:m})}var An=r(35292);const Rn=(0,g.Z)(e=>({link:{display:"grid",justifyItems:"center",gridGap:4,textAlign:"center"},disabled:{color:e.palette.text.secondary,cursor:"default"},primary:{color:e.palette.primary.main},secondary:{color:e.palette.secondary.main},label:{textTransform:"uppercase",fontWeight:e.typography.fontWeightBold,letterSpacing:1.2}}),{name:"BackstageIconLinkVertical"});function rr({color:e="primary",disabled:o=!1,href:l="#",icon:u=(0,t.jsx)(An.Z,{}),label:m,onClick:v,title:w}){const M=Rn();return o?(0,t.jsxs)(C.Z,{title:w,className:on()(M.link,M.disabled),children:[u,(0,t.jsx)(dt.Z,{variant:"caption",component:"span",className:M.label,children:m})]}):(0,t.jsxs)(ue.r,{title:w,className:on()(M.link,M[e]),to:l,onClick:v,children:[u,(0,t.jsx)(dt.Z,{variant:"caption",component:"span",className:M.label,children:m})]})}const S=(0,g.Z)(e=>({links:{margin:e.spacing(2,0),display:"grid",gridAutoFlow:"column",gridAutoColumns:"min-content",gridGap:e.spacing(3)}}),{name:"BackstageHeaderIconLinkRow"});function c(e){const{links:o}=e,l=S();return(0,t.jsx)("nav",{className:l.links,children:o.map((u,m)=>(0,t.jsx)(rr,{...u},m+1))})}const x=e=>{const o=e==="dark"?"16%":"97%";return`
|
|
16
|
+
hsl(0, 0%, ${o}) 0%,
|
|
17
|
+
hsla(0, 0%, ${o}, 0.987) 8.1%,
|
|
18
|
+
hsla(0, 0%, ${o}, 0.951) 15.5%,
|
|
19
|
+
hsla(0, 0%, ${o}, 0.896) 22.5%,
|
|
20
|
+
hsla(0, 0%, ${o}, 0.825) 29%,
|
|
21
|
+
hsla(0, 0%, ${o}, 0.741) 35.3%,
|
|
22
|
+
hsla(0, 0%, ${o}, 0.648) 41.2%,
|
|
23
|
+
hsla(0, 0%, ${o}, 0.55) 47.1%,
|
|
24
|
+
hsla(0, 0%, ${o}, 0.45) 52.9%,
|
|
25
|
+
hsla(0, 0%, ${o}, 0.352) 58.8%,
|
|
26
|
+
hsla(0, 0%, ${o}, 0.259) 64.7%,
|
|
27
|
+
hsla(0, 0%, ${o}, 0.175) 71%,
|
|
28
|
+
hsla(0, 0%, ${o}, 0.104) 77.5%,
|
|
29
|
+
hsla(0, 0%, ${o}, 0.049) 84.5%,
|
|
30
|
+
hsla(0, 0%, ${o}, 0.013) 91.9%,
|
|
31
|
+
hsla(0, 0%, ${o}, 0) 100%
|
|
32
|
+
`},j=100,Q=10,Se=(0,g.Z)(e=>({root:{position:"relative",display:"flex",flexFlow:"row nowrap",alignItems:"center"},container:{overflow:"auto",scrollbarWidth:0,"&::-webkit-scrollbar":{display:"none"}},fade:{position:"absolute",width:j,height:`calc(100% + ${Q}px)`,transition:"opacity 300ms",pointerEvents:"none"},fadeLeft:{left:-Q,background:`linear-gradient(90deg, ${x(e.palette.type)})`},fadeRight:{right:-Q,background:`linear-gradient(270deg, ${x(e.palette.type)})`},fadeHidden:{opacity:0},button:{position:"absolute"},buttonLeft:{left:-e.spacing(2)},buttonRight:{right:-e.spacing(2)}}),{name:"BackstageHorizontalScrollGrid"});function we(e){const[[o,l],u]=React.useState([0,0]);return React.useLayoutEffect(()=>{const m=e.current;if(!m){u([0,0]);return}const v=()=>{const w=m.scrollLeft,M=m.scrollWidth-m.offsetWidth-m.scrollLeft;u([w,M])};return v(),m.addEventListener("scroll",v),window.addEventListener("resize",v),()=>{m.removeEventListener("scroll",v),window.removeEventListener("resize",v)}},[e]),[o,l]}function Ze(e,o,l){const[u,m]=React.useState(0);return React.useLayoutEffect(()=>{if(u===0)return;const v=window.performance.now(),w=requestAnimationFrame(M=>{if(!e.current)return;const G=M-v,F=Math.abs(u)*G/o,he=Math.max(l,F)*Math.sign(u);e.current.scrollBy({left:he});const Ee=u-he;Math.sign(u)!==Math.sign(Ee)?m(0):m(Ee)});return()=>cancelAnimationFrame(w)},[e,u,o,l]),m}function Ge(e){const{scrollStep:o=100,scrollSpeed:l=50,minScrollDistance:u=5,children:m,...v}=e,w=Se(e),M=React.useRef(),[G,F]=we(M),fe=Ze(M,l,u),he=Ee=>{M.current&&fe(Ee?o:-o)};return _jsxs(Box,{...v,className:w.root,children:[_jsx(Grid,{container:!0,direction:"row",wrap:"nowrap",className:w.container,ref:M,children:m}),_jsx(Box,{className:classNames(w.fade,w.fadeLeft,{[w.fadeHidden]:G===0})}),_jsx(Box,{className:classNames(w.fade,w.fadeRight,{[w.fadeHidden]:F===0})}),G>0&&_jsx(IconButton,{title:"Scroll Left",onClick:()=>he(!1),className:classNames(w.button,w.buttonLeft,{}),children:_jsx(ChevronLeftIcon,{})}),F>0&&_jsx(IconButton,{title:"Scroll Right",onClick:()=>he(!0),className:classNames(w.button,w.buttonRight,{}),children:_jsx(ChevronRightIcon,{})})]})}const Gt=(0,g.Z)(e=>({alpha:{color:e.palette.common.white,fontFamily:"serif",fontWeight:"normal",fontStyle:"italic"},beta:{color:"#4d65cc",fontFamily:"serif",fontWeight:"normal",fontStyle:"italic"}}),{name:"BackstageLifecycle"});function gn(e){const o=Gt(e),{shorthand:l,alpha:u}=e;return l?_jsx(Typography,{component:"span",className:o[u?"alpha":"beta"],style:{fontSize:"120%"},children:u?_jsx(_Fragment,{children:"\u03B1"}):_jsx(_Fragment,{children:"\u03B2"})}):_jsx(Typography,{component:"span",className:o[u?"alpha":"beta"],children:u?"Alpha":"Beta"})}const Vn=(0,f.lazy)(()=>Promise.all([r.e(1049),r.e(6051)]).then(r.bind(r,76051)).then(e=>({default:e.RealLogViewer})));function mr(e){const{Progress:o}=(0,h.qD)().getComponents();return(0,t.jsx)(f.Suspense,{fallback:(0,t.jsx)(o,{}),children:(0,t.jsx)(Vn,{...e})})}var vr=r(28865),eo=r(60251);const Co=(0,g.Z)(e=>({markdown:{"& table":{borderCollapse:"collapse",border:`1px solid ${e.palette.border}`},"& th, & td":{border:`1px solid ${e.palette.border}`,padding:e.spacing(1)},"& td":{wordBreak:"break-word",overflow:"hidden",verticalAlign:"middle",lineHeight:"1",margin:0,padding:e.spacing(3,2,3,2.5),borderBottom:0},"& th":{backgroundColor:e.palette.background.paper},"& tr":{backgroundColor:e.palette.background.paper},"& tr:nth-child(odd)":{backgroundColor:e.palette.background.default},"& a":{color:e.palette.link},"& img":{maxWidth:"100%"}}}),{name:"BackstageMarkdownContent"}),to=(e,o)=>o?typeof o=="string"?e+o:f.Children.toArray(o.props.children).reduce(to,e):e,yr=({level:e,children:o})=>{const m=f.Children.toArray(o).reduce(to,"").toLocaleLowerCase("en-US").replace(/\W/g,"-");return f.createElement(`h${e}`,{id:m},o)},Hn={code:({inline:e,className:o,children:l,...u})=>{const m=String(l).replace(/\n+$/,""),v=/language-(\w+)/.exec(o||"");return!e&&v?(0,t.jsx)(Pe,{language:v[1],text:m}):(0,t.jsx)("code",{className:o,...u,children:l})},h1:yr,h2:yr,h3:yr,h4:yr,h5:yr,h6:yr};function Qn(e){const{content:o,dialect:l="gfm",linkTarget:u,transformLinkUri:m,transformImageUri:v,className:w}=e,M=Co();return(0,t.jsx)(vr.D,{remarkPlugins:l==="gfm"?[eo.Z]:[],className:`${M.markdown} ${w}`,children:o,components:Hn,linkTarget:u,transformLinkUri:m,transformImageUri:v})}var xr=r(23054);const Or=(0,g.Z)(e=>({root:{paddingLeft:e.spacing(3)}}),{name:"BackstageLoginRequestListItem"}),kr=({request:e,busy:o,setBusy:l})=>{const u=Or(),[m,v]=useState(),w=async()=>{l(!0);try{await e.trigger()}catch(G){v(isError(G)?G.message:"An unspecified error occurred")}finally{l(!1)}},M=e.provider.icon;return _jsxs(ListItem,{disabled:o,classes:{root:u.root},children:[_jsx(ListItemAvatar,{children:_jsx(M,{fontSize:"large"})}),_jsx(ListItemText,{primary:e.provider.title,secondary:m&&_jsx(Typography,{color:"error",children:m})}),_jsx(Button,{color:"primary",variant:"contained",onClick:w,children:"Log in"})]})};var es=null;const Hr=(0,g.Z)(e=>({dialog:{paddingTop:e.spacing(1)},title:{minWidth:0},titleHeading:{fontSize:e.typography.h6.fontSize},contentList:{padding:0},actionButtons:{padding:e.spacing(2,0)}}),{name:"OAuthRequestDialog"});function ts(e){const o=Hr(),[l,u]=useState(!1),m=useApi(oauthRequestApiRef),v=useApi(configApiRef);var w;const M=(w=v.getOptionalBoolean("enableExperimentalRedirectFlow"))!==null&&w!==void 0?w:!1,G=useObservable(useMemo(()=>m.authRequest$(),[m]),[]),F=()=>{G.forEach(fe=>fe.reject())};return _jsxs(Dialog,{open:Boolean(G.length),fullWidth:!0,maxWidth:"xs",classes:{paper:o.dialog},"aria-labelledby":"oauth-req-dialog-title",children:[_jsxs("main",{children:[_jsxs(DialogTitle,{classes:{root:o.title},id:"oauth-req-dialog-title",children:[_jsx(Typography,{className:o.titleHeading,variant:"h1",children:"Login Required"}),M?_jsx(Typography,{children:"This will trigger a http redirect to OAuth Login."}):null]}),_jsx(DialogContent,{dividers:!0,classes:{root:o.contentList},children:_jsx(List,{children:G.map(fe=>_jsx(LoginRequestListItem,{request:fe,busy:l,setBusy:u},fe.provider.title))})})]}),_jsx(DialogActions,{classes:{root:o.actionButtons},children:_jsx(Button,{onClick:F,children:"Reject All"})})]})}var wo=r(15277),Gr=r.n(wo),_n=r(29862);const Br=(0,g.Z)({container:{overflow:"visible !important"}},{name:"BackstageOverflowTooltip"});function $r(e){const[o,l]=(0,f.useState)(!1),u=(0,_n.t)(),m=Br(),v=M=>{u()&&l(M)};var w;return(0,t.jsx)(P.ZP,{title:(w=e.title)!==null&&w!==void 0?w:e.text||"",placement:e.placement,disableHoverListener:!o,children:(0,t.jsx)(Gr(),{text:e.text,line:e.line,onToggled:v,containerClassName:m.container})})}var jo=r(67358);function Dr(e){const o=(0,oe.Z)(),[l,u]=(0,f.useState)(!1);return(0,f.useEffect)(()=>{const m=setTimeout(()=>u(!0),o.transitions.duration.short);return()=>clearTimeout(m)},[o.transitions.duration.short]),l?(0,t.jsx)(jo.Z,{...e,"data-testid":"progress"}):(0,t.jsx)(C.Z,{display:"none"})}var Zr=r(94339),no=r(14503),Eo=r(24579),Nr=r(32552),In=r(15459),ro=r(27597);const Kr=(0,g.Z)(e=>({root:{maxWidth:"fit-content",padding:e.spacing(2,2,2,2.5)},boxTitle:{margin:0,color:e.palette.textSubtle},arrow:{color:e.palette.textSubtle}}),{name:"BackstageBottomLink"});function Ao(e){const{link:o,title:l,onClick:u}=e,m=Kr();return(0,t.jsxs)(C.Z,{children:[(0,t.jsx)(ot.Z,{}),(0,t.jsx)(ue.r,{to:o,onClick:u,underline:"none",children:(0,t.jsxs)(C.Z,{display:"flex",alignItems:"center",className:m.root,children:[(0,t.jsx)(C.Z,{className:m.boxTitle,fontWeight:"fontWeightBold",m:1,children:(0,t.jsx)(dt.Z,{children:(0,t.jsx)("strong",{children:l})})}),(0,t.jsx)(ro.Z,{className:m.arrow})]})})]})}const br=e=>{const{slackChannel:o}=e;if(o){if(typeof o=="string")return(0,t.jsxs)(dt.Z,{children:["Please contact ",o," for help."]});if(!o.href)return(0,t.jsxs)(dt.Z,{children:["Please contact ",o.name," for help."]})}else return null;return(0,t.jsx)(J,{to:o.href,variant:"contained",children:o.name})},To=class extends f.Component{componentDidCatch(o,l){console.error(`ErrorBoundary, error: ${o}, info: ${l}`),this.setState({error:o,errorInfo:l})}render(){const{slackChannel:o,children:l}=this.props,{error:u}=this.state;return u?(0,t.jsx)(lt,{title:"Something Went Wrong",error:u,children:(0,t.jsx)(br,{slackChannel:o})}):l}constructor(o){super(o),this.state={error:void 0,errorInfo:void 0}}},oo=(0,g.Z)(e=>({noPadding:{padding:0,"&:last-child":{paddingBottom:0}},header:{padding:e.spacing(2,2,2,2.5)},headerTitle:{fontWeight:e.typography.fontWeightBold},headerSubheader:{paddingTop:e.spacing(1)},headerAvatar:{},headerAction:{},headerContent:{},subheader:{display:"flex"}}),{name:"BackstageInfoCard"}),Ro=(0,In.Z)(e=>({root:{display:"inline-block",padding:e.spacing(8,8,0,0),float:"right"}}),{name:"BackstageInfoCardCardActionsTopRight"})(no.Z),so={card:{flex:{display:"flex",flexDirection:"column"},fullHeight:{display:"flex",flexDirection:"column",height:"100%"},gridItem:{display:"flex",flexDirection:"column",height:"calc(100% - 10px)",marginBottom:"10px"}},cardContent:{fullHeight:{flex:1},gridItem:{flex:1}}};function Sr(e){const{title:o,subheader:l,divider:u=!0,deepLink:m,slackChannel:v,errorBoundaryProps:w,variant:M,children:G,headerStyle:F,headerProps:fe,icon:he,action:Ee,actionsClassName:Ie,actions:Me,cardClassName:_e,actionsTopRight:Zt,className:pn,noPadding:kn,titleTypographyProps:nr}=e,Nt=oo();let fn={},mn={};M&&M.split(/[\s]+/g).forEach(Pr=>{fn={...fn,...so.card[Pr]},mn={...mn,...so.cardContent[Pr]}});const Tr=()=>!l&&!he?null:(0,t.jsxs)("div",{className:Nt.headerSubheader,"data-testid":"info-card-subheader",children:[l&&(0,t.jsx)("div",{className:Nt.subheader,children:l}),he]}),Rr=w||(v?{slackChannel:v}:{});return(0,t.jsx)(Zr.Z,{style:fn,className:pn,children:(0,t.jsxs)(To,{...Rr,children:[o&&(0,t.jsx)(Nr.Z,{classes:{root:Nt.header,title:Nt.headerTitle,subheader:Nt.headerSubheader,avatar:Nt.headerAvatar,action:Nt.headerAction,content:Nt.headerContent},title:o,subheader:Tr(),action:Ee,style:{...F},titleTypographyProps:nr,...fe}),Zt&&(0,t.jsx)(Ro,{children:Zt}),u&&(0,t.jsx)(ot.Z,{}),(0,t.jsx)(Eo.Z,{className:on()(_e,{[Nt.noPadding]:kn}),style:mn,children:G}),Me&&(0,t.jsx)(no.Z,{className:Ie,children:Me}),m&&(0,t.jsx)(Ao,{...m})]})})}var Io=r(39307);const wr=(0,g.Z)(e=>({root:{position:"relative",lineHeight:0},overlay:{position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -60%)",fontSize:e.typography.pxToRem(45),fontWeight:e.typography.fontWeightBold,color:e.palette.textContrast},description:{fontSize:"100%",top:"50%",left:"50%",transform:"translate(-50%, -50%)",position:"absolute",wordBreak:"break-all",display:"inline-block"},circle:{width:"80%",transform:"translate(10%, 0)"},colorUnknown:{}}),{name:"BackstageGauge"}),cr={fractional:!0,inverse:!1,unit:"%",max:100},Po=({palette:e,value:o,inverse:l,max:u})=>{if(isNaN(o))return"#ddd";const m=u||cr.max,v=l?m-o:o;return v<m/3?e.status.error:v<m*(2/3)?e.status.warning:e.status.ok};function Lo(e){const[o,l]=useState(null),{getColor:u=Po}=e,m=wr(e),{palette:v}=useTheme(),{value:w,fractional:M,inverse:G,unit:F,max:fe,description:he}={...cr,...e},Ee=M?Math.round(w*fe):w,Ie=fe!==100?Math.round(w):Ee,[Me,_e]=useState(!1);return useEffect(()=>{const Zt=o,pn=()=>_e(!0),kn=()=>_e(!1);return Zt&&he?(Zt.addEventListener("mouseenter",pn),Zt.addEventListener("mouseleave",kn),()=>{Zt.removeEventListener("mouseenter",pn),Zt.removeEventListener("mouseleave",kn)}):()=>{_e(!1)}},[he,o]),_jsxs(Box,{ref:l,className:m.root,children:[_jsx(Circle,{strokeLinecap:"butt",percent:Ee,strokeWidth:12,trailWidth:12,strokeColor:u({palette:v,value:Ie,inverse:G,max:fe}),className:m.circle}),he&&Me?_jsx(Box,{className:m.description,children:he}):_jsx(Box,{className:m.overlay,children:isNaN(w)?"N/A":`${Ie}${F}`})]})}const Xn=(0,g.Z)({root:{height:"100%",width:250}},{name:"BackstageGaugeCard"});function ns(e){const o=Xn(e),{title:l,subheader:u,progress:m,inverse:v,deepLink:w,description:M,icon:G,variant:F,getColor:fe}=e,he={inverse:v,description:M,getColor:fe,value:m};return _jsx(Box,{className:o.root,children:_jsx(InfoCard,{title:l,subheader:u,deepLink:w,variant:F,icon:G,children:_jsx(Gauge,{...he})})})}function rs(e){const{value:o,getColor:l=getProgressColor}=e,{palette:u}=useTheme();if(isNaN(o))return null;let m=Math.round(o*100*100)/100;m>100&&(m=100);const v=l({palette:u,value:m,inverse:!1,max:100});return _jsx(Tooltip,{title:`${m}%`,children:_jsx(Typography,{component:"span",children:_jsx(Line,{percent:m,strokeWidth:4,trailWidth:4,strokeColor:v})})})}var os=r(21324),ss=r(7089),is=r(1292),io=r(42494),as=r(74603),dr=r(56939),ao=r(12231),Oo=r(73698),Gn=r(12420),lo=r(72379);const Fr=(0,g.Z)(e=>(0,Gn.Z)({icon:{position:"absolute",right:e.spacing(.5),pointerEvents:"none"}}),{name:"BackstageClosedDropdown"});var cs=()=>{const e=Fr();return(0,t.jsx)(lo.Z,{className:e.icon,fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,t.jsx)("path",{d:"M7.5 8L6 9.5L12.0703 15.5703L18.1406 9.5L16.6406 8L12.0703 12.5703L7.5 8Z",fill:"#616161"})})};const b=(0,g.Z)(e=>(0,Gn.Z)({icon:{position:"absolute",right:e.spacing(.5),pointerEvents:"none"}}),{name:"BackstageOpenedDropdown"});var R=()=>{const e=b();return(0,t.jsx)(lo.Z,{className:e.icon,fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,t.jsx)("path",{d:"M16.5 16L18 14.5L11.9297 8.42969L5.85938 14.5L7.35938 16L11.9297 11.4297L16.5 16Z",fill:"#616161"})})};const D=(0,In.Z)(e=>(0,Gn.Z)({root:{"label + &":{marginTop:e.spacing(3)}},input:{borderRadius:e.shape.borderRadius,position:"relative",backgroundColor:e.palette.background.paper,border:"1px solid #ced4da",fontSize:e.typography.body1.fontSize,padding:e.spacing(1.25,3.25,1.25,1.5),transition:e.transitions.create(["border-color","box-shadow"]),fontFamily:"Helvetica Neue","&:focus":{background:e.palette.background.paper,borderRadius:e.shape.borderRadius}}}),{name:"BackstageSelectInputBase"})(as.Z),te=(0,g.Z)(e=>(0,Gn.Z)({formControl:{margin:`${e.spacing(1)} 0px`,maxWidth:300},label:{transform:"initial",fontWeight:"bold",fontSize:e.typography.body2.fontSize,fontFamily:e.typography.fontFamily,color:e.palette.text.primary,"&.Mui-focused":{color:e.palette.text.primary}},formLabel:{transform:"initial",fontWeight:"bold",fontSize:e.typography.body2.fontSize,fontFamily:e.typography.fontFamily,color:e.palette.text.primary,"&.Mui-focused":{color:e.palette.text.primary}},chips:{display:"flex",flexWrap:"wrap"},chip:{margin:2},checkbox:{},root:{display:"flex",flexDirection:"column"}}),{name:"BackstageSelect"});function de(e){const{multiple:o,items:l,label:u,placeholder:m,selected:v,onChange:w,triggerReset:M,native:G=!1,disabled:F=!1,margin:fe}=e,he=te(),[Ee,Ie]=(0,f.useState)(v||(o?[]:"")),[Me,_e]=(0,f.useState)(!1);(0,f.useEffect)(()=>{Ie(o?[]:"")},[M,o]),(0,f.useEffect)(()=>{Ie(v||(o?[]:""))},[v,o]);const Zt=Nt=>{Ie(Nt.target.value),w(Nt.target.value)},pn=Nt=>{if(F){Nt.preventDefault();return}_e(fn=>o&&!(Nt.target instanceof HTMLElement)?!0:!fn)},kn=()=>{_e(!1)},nr=Nt=>()=>{const fn=Ee.filter(mn=>mn!==Nt);Ie(fn),w(fn)};return(0,t.jsx)(C.Z,{className:he.root,children:(0,t.jsx)(is.Z,{onClickAway:kn,children:(0,t.jsxs)(io.Z,{className:he.formControl,children:[(0,t.jsx)(dr.Z,{className:he.formLabel,children:u}),(0,t.jsxs)(Oo.Z,{"aria-label":u,value:Ee,native:G,disabled:F,"data-testid":"select",displayEmpty:!0,multiple:o,margin:fe,onChange:Zt,onClick:pn,open:Me,input:(0,t.jsx)(D,{}),label:u,tabIndex:0,renderValue:Nt=>{var fn;return o&&Ee.length!==0?(0,t.jsx)(C.Z,{className:he.chips,children:Nt.map(mn=>{var Tr,Rr;return(0,t.jsx)(ss.Z,{label:(Tr=l.find(Ir=>Ir.value===mn))===null||Tr===void 0?void 0:Tr.label,clickable:!0,onDelete:nr(mn),className:he.chip},(Rr=l.find(Ir=>Ir.value===mn))===null||Rr===void 0?void 0:Rr.value)})}):(0,t.jsx)(dt.Z,{children:Ee.length===0?m||"":(fn=l.find(mn=>mn.value===Nt))===null||fn===void 0?void 0:fn.label})},IconComponent:()=>Me?(0,t.jsx)(R,{}):(0,t.jsx)(cs,{}),MenuProps:{anchorOrigin:{vertical:"bottom",horizontal:"left"},transformOrigin:{vertical:"top",horizontal:"left"},getContentAnchorEl:null},children:[m&&!o&&(0,t.jsx)(ao.Z,{value:[],children:m}),G?l&&l.map(Nt=>(0,t.jsx)("option",{value:Nt.value,children:Nt.label},Nt.value)):l&&l.map(Nt=>(0,t.jsxs)(ao.Z,{value:Nt.value,children:[o&&(0,t.jsx)(os.Z,{color:"primary",checked:Ee.includes(Nt.value)||!1,className:he.checkbox}),Nt.label]},Nt.value))]})]})})})}const ae=()=>{},xe=f.createContext({stepperLength:0,stepIndex:0,setStepIndex:ae,stepHistory:[],setStepHistory:ae,onStepChange:ae});function Te(e){const{children:o,elevated:l,onStepChange:u,activeStep:m=0}=e,[v,w]=useState(m),[M,G]=useState([0]);useEffect(()=>{w(m)},[m]);const F=[];let fe;return Children.forEach(o,he=>{isValidElement(he)&&(he.props.end?fe=he:F.push(he))}),_jsxs(_Fragment,{children:[_jsx(xe.Provider,{value:{stepIndex:v,setStepIndex:w,stepHistory:M,setStepHistory:G,onStepChange:u,stepperLength:Children.count(o)},children:_jsx(MuiStepper,{activeStep:v,orientation:"vertical",elevation:l?2:0,children:F})}),v>=Children.count(o)-1&&fe]})}const me=(0,g.Z)(e=>({root:{marginTop:e.spacing(3),"& button":{marginRight:e.spacing(1)}}}),{name:"BackstageSimpleStepperFooter"}),De=({text:e,handleClick:o})=>_jsx(Button,{onClick:o,children:e||"Reset"}),Ne=({text:e,handleClick:o,disabled:l,last:u,stepIndex:m})=>_jsx(Button,{variant:"contained",color:"primary",disabled:l,"data-testid":`nextButton-${m}`,onClick:o,children:e||(u?"Finish":"Next")}),rt=({text:e,handleClick:o,disabled:l,stepIndex:u})=>_jsx(Button,{variant:"outlined",color:"primary",disabled:l,"data-testid":`skipButton-${u}`,onClick:o,children:e||"Skip"}),ct=({text:e,handleClick:o,disabled:l,stepIndex:u})=>_jsx(Button,{onClick:o,"data-testid":`backButton-${u}`,disabled:l,children:e||"Back"}),Ye=({actions:e={},children:o})=>{const l=me(),{stepperLength:u,stepIndex:m,setStepIndex:v,stepHistory:w,setStepHistory:M,onStepChange:G}=useContext(VerticalStepperContext),F=(Ie,Me)=>{Me&&Me(),G&&G(m,Ie),v(Ie)},fe=()=>{const Ie=e.nextStep?e.nextStep(m,u-1):m+1;F(Ie,e.onNext),M([...w,Ie])},he=()=>{w.pop(),F(w[w.length-1],e.onBack),M([...w])},Ee=()=>{F(0,e.onRestart),M([0])};return _jsxs(Box,{className:l.root,children:[[void 0,!0].includes(e.showBack)&&m!==0&&_jsx(ct,{text:e.backText,handleClick:he,disabled:m===0,stepIndex:m}),e.showSkip&&_jsx(rt,{text:e.skipText,handleClick:fe,disabled:!!u&&m>=u||!!e.canSkip&&!e.canSkip(),stepIndex:m}),[void 0,!0].includes(e.showNext)&&_jsx(Ne,{text:e.nextText,handleClick:fe,disabled:!!u&&m>=u||!!e.canNext&&!e.canNext(),stepIndex:m}),e.showRestart&&m!==0&&_jsx(De,{text:e.restartText,handleClick:Ee,stepIndex:m}),o]})},ke=(0,g.Z)(e=>({end:{padding:e.spacing(3)}}),{name:"SimpleStepperStep"});function Xe(e){const{title:o,children:l,end:u,actions:m,...v}=e,w=ke();return u?_jsxs(Box,{className:w.end,children:[_jsx(Typography,{variant:"h6",children:o}),l,_jsx(SimpleStepperFooter,{actions:{...m||{},showNext:!1}})]}):_jsxs(MuiStep,{...v,children:[_jsx(StepLabel,{children:_jsx(Typography,{variant:"h6",children:o})}),_jsxs(StepContent,{children:[l,_jsx(SimpleStepperFooter,{actions:m})]})]})}const gt=(0,g.Z)(e=>({status:{fontWeight:e.typography.fontWeightMedium,"&::before":{width:"0.7em",height:"0.7em",display:"inline-block",marginRight:e.spacing(1),borderRadius:"50%",content:'""'}},ok:{"&::before":{backgroundColor:e.palette.status.ok}},warning:{"&::before":{backgroundColor:e.palette.status.warning}},error:{"&::before":{backgroundColor:e.palette.status.error}},pending:{"&::before":{backgroundColor:e.palette.status.pending}},running:{"&::before":{backgroundColor:e.palette.status.running}},aborted:{"&::before":{backgroundColor:e.palette.status.aborted}}}),{name:"BackstageStatus"});function ln(e){const o=gt(e);return _jsx(Typography,{component:"span",className:classNames(o.status,o.ok),"aria-label":"Status ok","aria-hidden":"true",...e})}function Qt(e){const o=gt(e);return _jsx(Typography,{component:"span",className:classNames(o.status,o.warning),"aria-label":"Status warning","aria-hidden":"true",...e})}function sn(e){const o=gt(e);return _jsx(Typography,{component:"span",className:classNames(o.status,o.error),"aria-label":"Status error","aria-hidden":"true",...e})}function cn(e){const o=gt(e);return _jsx(Typography,{component:"span",className:classNames(o.status,o.pending),"aria-label":"Status pending","aria-hidden":"true",...e})}function Pn(e){const o=gt(e);return _jsx(Typography,{component:"span",className:classNames(o.status,o.running),"aria-label":"Status running","aria-hidden":"true",...e})}function Zn(e){const o=gt(e);return _jsx(Typography,{component:"span",className:classNames(o.status,o.aborted),"aria-label":"Status aborted","aria-hidden":"true",...e})}var jr=r(74600),Er=r(15584);const Yr=e=>(0,Gn.Z)({root:{fontWeight:e.typography.fontWeightBold,whiteSpace:"nowrap",paddingRight:e.spacing(4),border:"0",verticalAlign:"top"}}),Ln={root:{border:"0",verticalAlign:"top"}},Nn=e=>(0,Gn.Z)({root:{margin:e.spacing(0,0,-1,0)}}),Ar=e=>(0,Gn.Z)({root:{padding:e.spacing(0,0,1,0)},random:{}}),Ms=(0,In.Z)(Yr,{name:"BackstageMetadataTableTitleCell"})(Er.Z),zs=(0,In.Z)(Ln,{name:"BackstageMetadataTableCell"})(Er.Z),Ws=({dense:e,children:o})=>_jsx(Table,{size:e?"small":"medium",children:_jsx(TableBody,{children:o})}),Vs=({title:e,children:o,...l})=>_jsxs(TableRow,{children:[e&&_jsx(Ms,{children:e}),_jsx(zs,{colSpan:e?1:2,...l,children:o})]}),ds=(0,In.Z)(Nn,{name:"BackstageMetadataTableList"})(({classes:e,children:o})=>(0,t.jsx)(It.Z,{disablePadding:!0,className:e.root,children:o})),Bi=(0,In.Z)(Ar,{name:"BackstageMetadataTableListItem"})(({classes:e,children:o})=>(0,t.jsx)(Bt.Z,{className:e.root,children:o})),us=(0,Gn.Z)({root:{margin:"0 0",listStyleType:"none"}}),hs=e=>(0,Gn.Z)({root:{...us.root,paddingLeft:e.spacing(1)}}),er=(0,In.Z)(us,{name:"BackstageStructuredMetadataTableList"})(({classes:e,children:o})=>(0,t.jsx)(ds,{classes:e,children:o})),tr=(0,In.Z)(hs,{name:"BackstageStructuredMetadataTableNestedList"})(({classes:e,children:o})=>(0,t.jsx)(ds,{classes:e,children:o}));function or(e,o){const l=e.map((u,m)=>_jsx(MetadataListItem,{children:Bo(u)},m));return o?_jsx(tr,{children:l}):_jsx(er,{children:l})}function ko(e,o,l){const u=Object.keys(e).map(m=>{const v=Bo(e[m],!0),w=l&&l.titleFormat?l.titleFormat(m):startCase(m);return _jsxs(MetadataListItem,{children:[_jsx(Typography,{variant:"body2",component:"span",children:`${w}: `}),v]},m)});return o?_jsx(tr,{children:u}):_jsx(er,{children:u})}function Bo(e,o,l){return React.isValidElement(e)?_jsx(Fragment,{children:e}):typeof e=="object"&&!Array.isArray(e)?ko(e,o,l):Array.isArray(e)?or(e,l):typeof e=="boolean"?_jsx(Fragment,{children:e?"\u2705":"\u274C"}):_jsx(Typography,{variant:"body2",component:"span",children:e})}const Hs=({value:e,options:o})=>_jsx(Fragment,{children:Bo(e,o)}),Gs=({title:e,value:o,options:l})=>_jsx(MetadataTableItem,{title:l&&l.titleFormat?l.titleFormat(e):startCase(e),children:_jsx(Hs,{value:o,options:l})});function Ks(e,o){return Object.keys(e).map(l=>_jsx(Gs,{title:l,value:e[l],options:o},l))}function Ys(e){const{metadata:o,dense:l=!0,options:u}=e,m=Ks(o,u||{});return _jsx(MetadataTable,{dense:l,children:m})}var ps=r(49429),Js=r(86136),fs=r(79784),Jr=r(76635),Qs=r(19126),$o=r.n(Qs);function gs(e){return qs.stringify(e,{strictNullHandling:!0})}function ms(e){return qs.parse(e,{ignoreQueryPrefix:!0,strictNullHandling:!0})}function vs(e,o){return ms(e)[o]}function co(e,o,l){const u={...ms(e),[o]:l};return gs(u)}function Xs(e,o=250){const[l,u]=useSearchParams(),m=l.toString(),[v,w]=useState(vs(m,e));return useEffect(()=>{const M=vs(m,e);w(G=>isEqual(M,G)?G:M)},[m,w,e]),useDebouncedEffect(()=>{const M=co(m,e,v);m!==M&&u(M,{replace:!0})},[u,v,m,e],o),[v,w]}const _s={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 ys(){const o=(0,h.I_)().get(h.Ds),l=o==null?void 0:o.getOptionalConfig("app.support");if(!l)return _s;var u;return{url:l.getString("url"),items:l.getConfigArray("items").flatMap(m=>({title:m.getString("title"),icon:m.getOptionalString("icon"),links:((u=m.getOptionalConfigArray("links"))!==null&&u!==void 0?u:[]).flatMap(v=>({url:v.getString("url"),title:v.getString("title")}))}))}}var $i=r(80079);function Tn(e,o){const u=(0,h.qD)().getSystemIcon(e);return u?(0,t.jsx)(u,{...o}):(0,t.jsx)($i.Z,{...o})}function Di(e){return Tn("brokenImage",e)}function Kn(e){return Tn("catalog",e)}function Aa(e){return Tn("chat",e)}function Ta(e){return Tn("dashboard",e)}function Ra(e){return Tn("docs",e)}function Zi(e){return Tn("email",e)}function Ia(e){return Tn("github",e)}function Pa(e){return Tn("group",e)}function Ur(e){return Tn("help",e)}function Ni(e){return Tn("user",e)}function Do(e){return Tn("warning",e)}const uo=(0,g.Z)({popoverList:{minWidth:260,maxWidth:400}},{name:"BackstageSupportButton"}),ho=({icon:e})=>{const o=(0,h.qD)();var l;const u=e&&(l=o.getSystemIcon(e))!==null&&l!==void 0?l:Ur;return(0,t.jsx)(u,{})};var Zo;const xs=({link:e})=>(0,t.jsx)(ue.r,{to:e.url,children:(Zo=e.title)!==null&&Zo!==void 0?Zo:e.url}),bs=({item:e})=>{var o;return(0,t.jsxs)(Bt.Z,{children:[(0,t.jsx)(Js.Z,{children:(0,t.jsx)(ho,{icon:e.icon})}),(0,t.jsx)(tn.Z,{primary:e.title,secondary:(o=e.links)===null||o===void 0?void 0:o.reduce((l,u,m)=>[...l,m>0&&(0,t.jsx)("br",{},m),(0,t.jsx)(xs,{link:u},u.url)],[])})]})};function ei(e){const{title:o,items:l,children:u}=e,{items:m}=ys(),[v,w]=(0,f.useState)(!1),[M,G]=(0,f.useState)(null),F=uo(),fe=(0,We.Z)(Ie=>Ie.breakpoints.down("sm")),he=Ie=>{G(Ie.currentTarget),w(!0)},Ee=()=>{w(!1)};return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(C.Z,{display:"flex",ml:1,children:fe?(0,t.jsx)(T.Z,{color:"primary",size:"small",onClick:he,"data-testid":"support-button","aria-label":"Support",children:(0,t.jsx)(Ur,{})}):(0,t.jsx)(ye.Z,{"data-testid":"support-button","aria-label":"Support",color:"primary",onClick:he,startIcon:(0,t.jsx)(Ur,{}),children:"Support"})}),(0,t.jsxs)(fs.ZP,{"data-testid":"support-button-popover",open:v,anchorEl:M,anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"},onClose:Ee,children:[(0,t.jsxs)(It.Z,{className:F.popoverList,children:[o&&(0,t.jsx)(Bt.Z,{alignItems:"flex-start",children:(0,t.jsx)(dt.Z,{variant:"subtitle1",children:o})}),f.Children.map(u,(Ie,Me)=>(0,t.jsx)(Bt.Z,{alignItems:"flex-start",children:Ie},`child-${Me}`)),(l!=null?l:m).map((Ie,Me)=>(0,t.jsx)(bs,{item:Ie},`item-${Me}`))]}),(0,t.jsx)(ps.Z,{children:(0,t.jsx)(ye.Z,{color:"primary",onClick:Ee,"aria-label":"Close",children:"Close"})})]})]})}var No=r(18671),ur=r(73557),Fo=r(84800);const po=72,ti=24,Ss=18,hr={drawerWidthClosed:po,drawerWidthOpen:224,defaultOpenDelayMs:100,defaultCloseDelayMs:0,defaultFadeDuration:200,logoHeight:32,iconContainerWidth:po,iconSize:po-ti*2,iconPadding:ti,selectedIndicatorWidth:3,userBadgePadding:Ss,userBadgeDiameter:po-Ss*2,mobileSidebarHeight:56},Uo=e=>({...hr,...e,iconContainerWidth:hr.drawerWidthClosed,iconSize:hr.drawerWidthClosed-hr.iconPadding*2,userBadgeDiameter:hr.drawerWidthClosed-hr.userBadgePadding*2}),Cs={drawerWidthClosed:0,drawerWidthOpen:202,defaultOpenDelayMs:hr.defaultOpenDelayMs+200},ni=e=>({...Cs,...e}),ri="@backstage/core/sidebar-intro-dismissed",sr=(0,f.createContext)({sidebarConfig:hr,submenuConfig:Cs}),ws=(0,f.createContext)({isHoveredOn:!1,setIsHoveredOn:()=>{}});var oi=r(50023),si=r(4190),Fi=r(87685),ii=r(44882),fo=r(51837);const js={isOpen:!1,setOpen:()=>{}},Es=(0,f.createContext)(js),Mo=(0,fo.CT)("sidebar-open-state-context");function go(e){const{children:o,value:l}=e;return(0,t.jsx)(Es.Provider,{value:l,children:(0,t.jsx)(Mo.Provider,{value:(0,fo.EI)({1:l}),children:o})})}const zo=()=>{const e=(0,f.useContext)(Mo),o=(0,f.useContext)(Es);if(e===void 0)return o||js;const l=e.atVersion(1);if(l===void 0)throw new Error("No context found for version 1.");return l};var ai=r(57998);const As={isPinned:!0,toggleSidebarPinState:()=>{},isMobile:!1},Ts=(0,f.createContext)(As),li=(0,fo.CT)("sidebar-pin-state-context");function mo(e){const{children:o,value:l}=e;return(0,t.jsx)(Ts.Provider,{value:l,children:(0,t.jsx)(li.Provider,{value:(0,fo.EI)({1:l}),children:o})})}const Wo=()=>{const e=(0,f.useContext)(li),o=(0,f.useContext)(Ts);if(e===void 0)return o||As;const l=e.atVersion(1);if(l===void 0)throw new Error("No context found for version 1.");return l},Ui=(0,g.Z)(e=>({root:{flexGrow:0,margin:e.spacing(0,2),color:e.palette.navigation.color},selected:o=>({color:`${e.palette.navigation.selectedColor}!important`,borderTop:`solid ${o.sidebarConfig.selectedIndicatorWidth}px ${e.palette.navigation.indicator}`,marginTop:"-1px"}),label:{display:"none"}})),ci=e=>{const{to:o,label:l,icon:u,value:m}=e,{sidebarConfig:v}=(0,f.useContext)(sr),w=Ui({sidebarConfig:v}),M=(0,ur.TH)(),{selectedMenuItemIndex:G,setSelectedMenuItemIndex:F}=(0,f.useContext)(Ho),fe=(Ee,Ie)=>{F(Ie===G?-1:Ie)},he=m===G&&G>=0||m!==G&&!(G>=0)&&o===M.pathname;return(0,t.jsx)(ai.Z,{"aria-label":l,label:l,icon:u,component:ue.r,to:o||M.pathname,onChange:fe,value:m,selected:he,classes:w})},Rs=e=>{const{children:o,to:l,label:u,icon:m,value:v}=e,{isMobile:w}=Wo();return w?(0,t.jsx)(ci,{to:l,label:u,icon:m,value:v}):(0,t.jsx)(t.Fragment,{children:o})},Vo=(0,g.Z)(e=>({root:{position:"fixed",backgroundColor:e.palette.navigation.background,color:e.palette.navigation.color,bottom:0,left:0,right:0,zIndex:e.zIndex.snackbar,borderTop:"1px solid #383838"},overlay:o=>({background:e.palette.navigation.background,width:"100%",bottom:`${o.sidebarConfig.mobileSidebarHeight}px`,height:`calc(100% - ${o.sidebarConfig.mobileSidebarHeight}px)`,flex:"0 1 auto",overflow:"auto"}),overlayHeader:{display:"flex",color:e.palette.text.primary,alignItems:"center",justifyContent:"space-between",padding:e.spacing(2,3)},overlayHeaderClose:{color:e.palette.text.primary},marginMobileSidebar:o=>({marginBottom:`${o.sidebarConfig.mobileSidebarHeight}px`})})),Mi=e=>(0,Jr.orderBy)(e,({props:{priority:o}})=>Number.isInteger(o)?o:-1,"desc"),zi=f.createElement(Rs).type,Is=({children:e,label:o="Menu",open:l,onClose:u})=>{const{sidebarConfig:m}=(0,f.useContext)(sr),v=Vo({sidebarConfig:m});return(0,t.jsxs)(si.ZP,{anchor:"bottom",open:l,onClose:u,ModalProps:{BackdropProps:{classes:{root:v.marginMobileSidebar}}},classes:{root:v.marginMobileSidebar,paperAnchorBottom:v.overlay},children:[(0,t.jsxs)(C.Z,{className:v.overlayHeader,children:[(0,t.jsx)(dt.Z,{variant:"h3",children:o}),(0,t.jsx)(T.Z,{onClick:u,classes:{root:v.overlayHeaderClose},children:(0,t.jsx)(Fi.Z,{})})]}),(0,t.jsx)(C.Z,{component:"nav",children:e})]})},Ho=(0,f.createContext)({selectedMenuItemIndex:-1,setSelectedMenuItemIndex:()=>{}}),di=e=>{const{sidebarConfig:o}=(0,f.useContext)(sr),{children:l}=e,u=Vo({sidebarConfig:o}),m=(0,ur.TH)(),[v,w]=(0,f.useState)(-1);(0,f.useEffect)(()=>{w(-1)},[m.pathname]);let M=(0,h.vJ)(l,F=>F.getElements().filter(fe=>fe.type===zi));if(l)M.length?M=Mi(M):M.push((0,t.jsx)(Rs,{icon:(0,t.jsx)(ii.Z,{}),children:l},"default_menu"));else return null;const G=v>=0&&!M[v].props.to;return(0,t.jsx)(go,{value:{isOpen:!0,setOpen:()=>{}},children:(0,t.jsxs)(Ho.Provider,{value:{selectedMenuItemIndex:v,setSelectedMenuItemIndex:w},children:[(0,t.jsx)(Is,{label:M[v]&&M[v].props.label,open:G,onClose:()=>w(-1),children:M[v]&&M[v].props.children}),(0,t.jsx)(oi.Z,{className:u.root,"data-testid":"mobile-sidebar-root",component:"nav",children:M})]})})};var vo;(function(e){e.SIDEBAR_PIN_STATE="sidebarPinState"})(vo||(vo={}));const Qr={getSidebarPinState(){let e;try{e=JSON.parse(window.localStorage.getItem(vo.SIDEBAR_PIN_STATE)||"true")}catch{return!0}return!!e},setSidebarPinState(e){return window.localStorage.setItem(vo.SIDEBAR_PIN_STATE,JSON.stringify(e))}},Wi=(0,g.Z)(e=>({root:{width:"100%",transition:"padding-left 0.1s ease-out",isolation:"isolate",[e.breakpoints.up("sm")]:{paddingLeft:o=>o.isPinned?o.sidebarConfig.drawerWidthOpen:o.sidebarConfig.drawerWidthClosed},[e.breakpoints.down("xs")]:{paddingBottom:o=>o.sidebarConfig.mobileSidebarHeight}},content:{zIndex:0,isolation:"isolate","&:focus":{outline:0}}}),{name:"BackstageSidebarPage"}),ui=(0,f.createContext)({content:{contentRef:void 0}});function Vi(e){const[o,l]=(0,f.useState)(()=>Qr.getSidebarPinState()),{sidebarConfig:u}=(0,f.useContext)(sr),m=(0,f.useRef)(null),v=(0,f.useMemo)(()=>({content:{contentRef:m}}),[m]);(0,f.useEffect)(()=>{Qr.setSidebarPinState(o)},[o]);const w=(0,We.Z)(F=>F.breakpoints.down("xs"),{noSsr:!0}),M=()=>l(!o),G=Wi({isPinned:o,sidebarConfig:u});return(0,t.jsx)(mo,{value:{isPinned:o,toggleSidebarPinState:M,isMobile:w},children:(0,t.jsx)(ui.Provider,{value:v,children:(0,t.jsx)(C.Z,{className:G.root,children:e.children})})})}function hi(){const{content:e}=(0,f.useContext)(ui);return{focusContent:(0,f.useCallback)(()=>{var l,u;e==null||(l=e.contentRef)===null||l===void 0||(u=l.current)===null||u===void 0||u.focus()},[e]),contentRef:e==null?void 0:e.contentRef}}const Ps=(0,g.Z)(e=>({drawer:{display:"flex",flexFlow:"column nowrap",alignItems:"flex-start",position:"fixed",left:0,top:0,bottom:0,zIndex:e.zIndex.appBar,background:e.palette.navigation.background,overflowX:"hidden",msOverflowStyle:"none",scrollbarWidth:"none",transition:e.transitions.create("width",{easing:e.transitions.easing.sharp,duration:e.transitions.duration.shortest}),"& > *":{flexShrink:0},"&::-webkit-scrollbar":{display:"none"}},drawerWidth:o=>({width:o.sidebarConfig.drawerWidthClosed}),drawerOpen:o=>({width:o.sidebarConfig.drawerWidthOpen,transition:e.transitions.create("width",{easing:e.transitions.easing.sharp,duration:e.transitions.duration.shorter})}),visuallyHidden:{top:0,position:"absolute",zIndex:1e3,transform:"translateY(-200%)","&:focus":{transform:"translateY(5px)"}}}),{name:"BackstageSidebar"});var Xt;(function(e){e[e.Closed=0]="Closed",e[e.Idle=1]="Idle",e[e.Open=2]="Open"})(Xt||(Xt={}));const Hi=e=>{const{sidebarConfig:o}=(0,f.useContext)(sr),{openDelayMs:l=o.defaultOpenDelayMs,closeDelayMs:u=o.defaultCloseDelayMs,disableExpandOnHover:m,children:v}=e,w=Ps({sidebarConfig:o}),M=(0,We.Z)(pn=>pn.breakpoints.down("md"),{noSsr:!0}),[G,F]=(0,f.useState)(Xt.Closed),fe=(0,f.useRef)(),{isPinned:he,toggleSidebarPinState:Ee}=Wo(),Ie=()=>{he||m||(fe.current&&(clearTimeout(fe.current),fe.current=void 0),G!==Xt.Open&&!M&&(fe.current=window.setTimeout(()=>{fe.current=void 0,F(Xt.Open)},l),F(Xt.Idle)))},Me=()=>{he||m||(fe.current&&(clearTimeout(fe.current),fe.current=void 0),G===Xt.Idle?F(Xt.Closed):G===Xt.Open&&(fe.current=window.setTimeout(()=>{fe.current=void 0,F(Xt.Closed)},u)))},_e=G===Xt.Open&&!M||he,Zt=pn=>{pn?(F(Xt.Open),Ee()):(F(Xt.Closed),Ee())};return(0,t.jsxs)("nav",{style:{},"aria-label":"sidebar nav",children:[(0,t.jsx)(Gi,{}),(0,t.jsx)(go,{value:{isOpen:_e,setOpen:Zt},children:(0,t.jsx)(C.Z,{className:w.root,"data-testid":"sidebar-root",onMouseEnter:m?()=>{}:Ie,onFocus:m?()=>{}:Ie,onMouseLeave:m?()=>{}:Me,onBlur:m?()=>{}:Me,children:(0,t.jsx)(C.Z,{className:on()(w.drawer,w.drawerWidth,{[w.drawerOpen]:_e}),children:v})})})]})},pi=e=>{var o;const l=Uo((o=e.sidebarOptions)!==null&&o!==void 0?o:{});var u;const m=ni((u=e.submenuOptions)!==null&&u!==void 0?u:{}),{children:v,disableExpandOnHover:w,openDelayMs:M,closeDelayMs:G}=e,{isMobile:F}=Wo();return F?(0,t.jsx)(di,{children:v}):(0,t.jsx)(sr.Provider,{value:{sidebarConfig:l,submenuConfig:m},children:(0,t.jsx)(Hi,{openDelayMs:M,closeDelayMs:G,disableExpandOnHover:w,children:v})})};function Gi(){const{sidebarConfig:e}=(0,f.useContext)(sr),{focusContent:o,contentRef:l}=hi(),u=Ps({sidebarConfig:e});return l!=null&&l.current?(0,t.jsx)(ye.Z,{onClick:o,variant:"contained",className:on()(u.visuallyHidden),children:"Skip to content"}):null}function fi(e,o){const l=new URLSearchParams(o.search).toString(),u=$o().parse(l),m=new URLSearchParams(e.search).toString(),v=$o().parse(m);return(0,Jr.isEqual)(o.pathname,e.pathname)&&(0,Jr.isMatch)(v,u)}const Ki=(0,g.Z)(e=>{var o,l;return{item:{height:48,width:"100%","&:hover":{background:((o=e.palette.navigation.navItem)===null||o===void 0?void 0:o.hoverBackground)||"#6f6f6f",color:e.palette.navigation.selectedColor},display:"flex",alignItems:"center",color:e.palette.navigation.color,padding:e.spacing(2.5),cursor:"pointer",position:"relative",background:"none",border:"none"},itemContainer:{width:"100%"},selected:{background:"#6f6f6f",color:e.palette.common.white},label:{margin:e.spacing(1.75),marginLeft:e.spacing(1),fontSize:e.typography.body2.fontSize,whiteSpace:"nowrap",overflow:"hidden","text-overflow":"ellipsis",lineHeight:1},subtitle:{fontSize:10,whiteSpace:"nowrap",overflow:"hidden","text-overflow":"ellipsis"},dropdownArrow:{position:"absolute",right:21},dropdown:{display:"flex",flexDirection:"column",alignItems:"end"},dropdownItem:{width:"100%",padding:"10px 0 10px 0","&:hover":{background:((l=e.palette.navigation.navItem)===null||l===void 0?void 0:l.hoverBackground)||"#6f6f6f",color:e.palette.navigation.selectedColor}},textContent:{color:e.palette.navigation.color,paddingLeft:e.spacing(4),paddingRight:e.spacing(1),fontSize:e.typography.body2.fontSize,whiteSpace:"nowrap",overflow:"hidden","text-overflow":"ellipsis"}}},{name:"BackstageSidebarSubmenuItem"}),La=e=>{const{title:o,subtitle:l,to:u,icon:m,dropdownItems:v}=e,w=Ki(),{setIsHoveredOn:M}=useContext(SidebarItemWithSubmenuContext),G=()=>{M(!1)},F=useResolvedPath(u!=null?u:""),fe=useLocation();let he=isLocationMatch(fe,F);const[Ee,Ie]=useState(!1),Me=()=>{Ie(!Ee)};return v!==void 0?(v.some(_e=>{const Zt=resolvePath(_e.to);return he=isLocationMatch(fe,Zt),he}),_jsxs(Box,{className:w.itemContainer,children:[_jsx(Tooltip,{title:o,enterDelay:500,enterNextDelay:500,children:_jsxs(Button,{role:"button",onClick:Me,onTouchStart:_e=>_e.stopPropagation(),className:classnames(w.item,he?w.selected:void 0),children:[m&&_jsx(m,{fontSize:"small"}),_jsxs(Typography,{variant:"subtitle1",className:w.label,children:[o,_jsx("br",{}),l&&_jsx(Typography,{variant:"caption",className:w.subtitle,children:l})]}),Ee?_jsx(ArrowDropUpIcon,{className:w.dropdownArrow}):_jsx(ArrowDropDownIcon,{className:w.dropdownArrow})]})}),v&&Ee&&_jsx(Box,{className:w.dropdown,children:v.map((_e,Zt)=>_jsx(Tooltip,{title:_e.title,enterDelay:500,enterNextDelay:500,children:_jsx(Link,{to:_e.to,underline:"none",className:w.dropdownItem,onClick:G,onTouchStart:pn=>pn.stopPropagation(),children:_jsx(Typography,{className:w.textContent,children:_e.title})})},Zt))})]})):_jsx(Box,{className:w.itemContainer,children:_jsx(Tooltip,{title:o,enterDelay:500,enterNextDelay:500,children:_jsxs(Link,{to:u,underline:"none",className:classnames(w.item,he?w.selected:void 0),onClick:G,onTouchStart:_e=>_e.stopPropagation(),children:[m&&_jsx(m,{fontSize:"small"}),_jsxs(Typography,{variant:"subtitle1",className:w.label,children:[o,_jsx("br",{}),l&&_jsx(Typography,{variant:"caption",className:w.subtitle,children:l})]})]})})})};var Ls;const Yi=(0,g.Z)(e=>({root:{zIndex:1e3,position:"relative",overflow:"visible",width:e.spacing(7)+1},drawer:o=>{var l;return{display:"flex",flexFlow:"column nowrap",alignItems:"flex-start",position:"fixed",[e.breakpoints.up("sm")]:{marginLeft:o.left,transition:e.transitions.create("margin-left",{easing:e.transitions.easing.sharp,duration:e.transitions.duration.shortest})},top:0,bottom:0,padding:0,background:(Ls=(l=e.palette.navigation.submenu)===null||l===void 0?void 0:l.background)!==null&&Ls!==void 0?Ls:"#404040",overflowX:"hidden",msOverflowStyle:"none",scrollbarWidth:"none",cursor:"default",width:o.submenuConfig.drawerWidthClosed,transitionDelay:`${o.submenuConfig.defaultOpenDelayMs}ms`,"& > *":{flexShrink:0},"&::-webkit-scrollbar":{display:"none"}}},drawerOpen:o=>({width:o.submenuConfig.drawerWidthOpen,[e.breakpoints.down("xs")]:{width:"100%",position:"relative",paddingLeft:e.spacing(3),left:0,top:0}}),title:{fontSize:e.typography.h5.fontSize,fontWeight:e.typography.fontWeightMedium,color:e.palette.common.white,padding:e.spacing(2.5),[e.breakpoints.down("xs")]:{display:"none"}}}),{name:"BackstageSidebarSubmenu"}),Ji=e=>{const{isOpen:o}=zo(),{sidebarConfig:l,submenuConfig:u}=(0,f.useContext)(sr),m=o?l.drawerWidthOpen:l.drawerWidthClosed,v=Yi({left:m,submenuConfig:u}),{isHoveredOn:w}=(0,f.useContext)(ws),[M,G]=(0,f.useState)(!1);return(0,f.useEffect)(()=>{G(w)},[w]),(0,t.jsxs)(C.Z,{className:on()(v.drawer,{[v.drawerOpen]:M}),children:[(0,t.jsx)(dt.Z,{variant:"h5",className:v.title,children:e.title}),e.children]})};var Qi=r(26739),Go=r(76600),Xi=r(83543),qi=r(59797),gi=r(98989);const Os=(0,g.Z)({iconContainer:{display:"flex",position:"relative",width:"100%"},arrow1:{right:"6px",position:"absolute"}}),_i=()=>{const e=Os();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 ea=null;const mi=(0,g.Z)({iconContainer:{display:"flex",position:"relative",width:"100%"},arrow1:{right:"6px",position:"absolute"}}),ta=()=>{const e=mi();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 na=null,Ko,Yo;const vi=e=>(0,g.Z)(o=>{var l,u;return{root:{color:o.palette.navigation.color,display:"flex",flexFlow:"row nowrap",alignItems:"center",height:48,cursor:"pointer"},buttonItem:{background:"none",border:"none",width:"100%",margin:0,padding:0,textAlign:"inherit",font:"inherit",textTransform:"none"},closed:{width:e.drawerWidthClosed,justifyContent:"center"},open:{[o.breakpoints.up("sm")]:{width:e.drawerWidthOpen}},highlightable:{"&:hover":{background:(Ko=(l=o.palette.navigation.navItem)===null||l===void 0?void 0:l.hoverBackground)!==null&&Ko!==void 0?Ko:"#404040"}},highlighted:{background:(Yo=(u=o.palette.navigation.navItem)===null||u===void 0?void 0:u.hoverBackground)!==null&&Yo!==void 0?Yo:"#404040"},label:{fontWeight:"bold",whiteSpace:"nowrap",lineHeight:"auto",flex:"3 1 auto",width:"110px",overflow:"hidden","text-overflow":"ellipsis"},iconContainer:{boxSizing:"border-box",height:"100%",width:e.iconContainerWidth,marginRight:-o.spacing(2),display:"flex",alignItems:"center",justifyContent:"center",lineHeight:"0"},searchRoot:{marginBottom:12},searchField:{color:"#b5b5b5",fontWeight:o.typography.fontWeightBold,fontSize:o.typography.fontSize},searchFieldHTMLInput:{padding:o.spacing(2,0,2)},searchContainer:{width:e.drawerWidthOpen-e.iconContainerWidth},secondaryAction:{width:o.spacing(6),textAlign:"center",marginRight:o.spacing(1)},closedItemIcon:{width:"100%",justifyContent:"center"},submenuArrow:{display:"flex"},expandButton:{background:"none",border:"none",color:o.palette.navigation.color,width:"100%",cursor:"pointer",position:"relative",height:48},arrows:{position:"absolute",right:10},selected:{"&$root":{borderLeft:`solid ${e.selectedIndicatorWidth}px ${o.palette.navigation.indicator}`,color:o.palette.navigation.selectedColor},"&$closed":{width:e.drawerWidthClosed},"& $closedItemIcon":{paddingRight:e.selectedIndicatorWidth},"& $iconContainer":{marginLeft:-e.selectedIndicatorWidth}}}},{name:"BackstageSidebarItem"});function yo(e){return(0,f.useMemo)(()=>vi(e),[e])()}const ra=(e,o)=>(0,h.vJ)(e.props.children,l=>{let u=!1;return l.getElements().forEach(({props:{to:m,dropdownItems:v}})=>{if(!u){if(v!=null&&v.length){v.forEach(({to:w})=>u=u||fi(o,(0,Fo.i3)(w)));return}m&&(u=fi(o,(0,Fo.i3)(m)))}}),u},[o.pathname]);function ks(e){return e.to===void 0}const yi=f.createElement(Ji).type,oa=f.forwardRef(function({to:o,end:l,style:u,className:m,activeStyle:v,caseSensitive:w,activeClassName:M="active","aria-current":G="page",...F},fe){let{pathname:he}=(0,ur.TH)(),{pathname:Ee}=(0,ur.WU)(o);w||(he=he.toLocaleLowerCase("en-US"),Ee=Ee.toLocaleLowerCase("en-US"));let Ie=he===Ee;!Ie&&!l&&(Ie=he.startsWith(`${Ee}/`));const Me=Ie?G:void 0;return(0,t.jsx)(z.rU,{...F,to:o,ref:fe,"aria-current":Me,style:{...u,...Ie?v:void 0},className:on()([m,Ie?M:void 0])})}),Bs=(0,f.forwardRef)((e,o)=>{const{icon:l,text:u,hasNotifications:m=!1,hasSubmenu:v=!1,disableHighlight:w=!1,onClick:M,children:G,className:F,...fe}=e,{sidebarConfig:he}=(0,f.useContext)(sr),Ee=yo(he),{isOpen:Ie}=zo(),Me=!Ie&&v?{display:"flex",marginLeft:"20px"}:{lineHeight:"0"},_e=(0,t.jsxs)(C.Z,{style:Me,children:[(0,t.jsx)(l,{fontSize:"small"}),!Ie&&v?(0,t.jsx)(gi.Z,{fontSize:"small"}):(0,t.jsx)(t.Fragment,{})]}),Zt=(0,t.jsx)(Qi.Z,{color:"secondary",variant:"dot",overlap:"circular",invisible:!m,className:on()({[Ee.closedItemIcon]:!Ie}),children:_e}),pn=(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(C.Z,{"data-testid":"login-button",className:Ee.iconContainer,children:Zt}),u&&(0,t.jsx)(dt.Z,{variant:"subtitle2",className:Ee.label,children:u}),(0,t.jsx)("div",{className:Ee.secondaryAction,children:G})]}),kn=Ie?pn:Zt,nr={onClick:M,className:on()(F,Ee.root,Ie?Ee.open:Ee.closed,ks(e)&&Ee.buttonItem,{[Ee.highlightable]:!w})};return ks(e)?(0,t.jsx)(ye.Z,{role:"button","aria-label":u,...nr,ref:o,children:kn}):(0,t.jsx)(oa,{...nr,activeClassName:Ee.selected,to:e.to?e.to:"",ref:o,"aria-label":u||e.to,...fe,children:kn})}),xi=({children:e,...o})=>{const{sidebarConfig:l}=(0,f.useContext)(sr),u=yo(l),[m,v]=(0,f.useState)(!1),w=(0,ur.TH)(),M=ra(e,w),G=(0,We.Z)(Ee=>Ee.breakpoints.down("sm")),F=()=>{v(!0)},fe=()=>{v(!1)},he=()=>G?m?(0,t.jsx)(qi.Z,{fontSize:"small",className:u.submenuArrow}):(0,t.jsx)(Xi.Z,{fontSize:"small",className:u.submenuArrow}):!m&&(0,t.jsx)(gi.Z,{fontSize:"small",className:u.submenuArrow});return(0,t.jsx)(ws.Provider,{value:{isHoveredOn:m,setIsHoveredOn:v},children:(0,t.jsxs)("div",{"data-testid":"item-with-submenu",onMouseLeave:fe,onTouchStart:m?fe:F,onMouseEnter:F,className:on()(m&&u.highlighted),children:[(0,t.jsx)(Bs,{hasSubmenu:!0,className:M?u.selected:"",...o,children:he()}),m&&e]})})},$s=(0,f.forwardRef)((e,o)=>{const[l]=(0,h.vJ)(e.children,u=>u.getElements().filter(m=>m.type===yi));return l?(0,t.jsx)(xi,{...e,children:l}):(0,t.jsx)(Bs,{...e,ref:o})});function sa(e){const{sidebarConfig:o}=useContext(SidebarConfigContext),[l,u]=useState(""),m=yo(o),v=e.icon?e.icon:SearchIcon,w=()=>{e.onSearch(l),u("")},M=he=>{he.key==="Enter"&&(he.preventDefault(),w())},G=he=>{u(he.target.value)},F=he=>{he.preventDefault(),he.stopPropagation()},fe=he=>{w(),he.preventDefault()};return _jsx(Box,{className:m.searchRoot,children:_jsx($s,{icon:v,to:e.to,onClick:fe,disableHighlight:!0,children:_jsx(TextField,{placeholder:"Search",value:l,onClick:F,onChange:G,onKeyDown:M,className:m.searchContainer,InputProps:{disableUnderline:!0,className:m.searchField},inputProps:{className:m.searchFieldHTMLInput}})})})}const ia=(0,Go.Z)("div")({flex:1},{name:"BackstageSidebarSpace"}),aa=(0,Go.Z)("div")({height:8},{name:"BackstageSidebarSpacer"}),bi=(0,Go.Z)("hr")(({theme:e})=>({height:1,width:"100%",background:"#383838",border:"none",margin:e.spacing(1.2,0)}),{name:"BackstageSidebarDivider"}),ir=e=>({overflowY:"auto","&::-webkit-scrollbar":{backgroundColor:e.palette.background.default,width:"5px",borderRadius:"5px"},"&::-webkit-scrollbar-thumb":{backgroundColor:e.palette.text.hint,borderRadius:"5px"}}),la=(0,Go.Z)("div")(({theme:e})=>{const o=ir(e);return{flex:"0 1 auto",overflowX:"hidden",width:"calc(100% - 5px)",minHeight:"48px",overflowY:"hidden","@media (hover: none)":o,"&:hover":o}}),ca=()=>{const{sidebarConfig:e}=useContext(SidebarConfigContext),o=yo(e),{isOpen:l,setOpen:u}=useSidebarOpenState();if(useMediaQuery(w=>w.breakpoints.down("md"),{noSsr:!0}))return null;const v=()=>{u(!l)};return _jsx(Button,{role:"button",onClick:v,className:o.expandButton,"aria-label":"Expand Sidebar","data-testid":"sidebar-expand-button",children:_jsx(Box,{className:o.arrows,children:l?_jsx(DoubleArrowLeft,{}):_jsx(DoubleArrowRight,{})})})},Si=(0,g.Z)(e=>({introCard:o=>({color:"#b5b5b5",fontSize:12,width:o.sidebarConfig.drawerWidthOpen,marginTop:e.spacing(2.25),marginBottom:e.spacing(1.5),paddingLeft:o.sidebarConfig.iconPadding,paddingRight:o.sidebarConfig.iconPadding}),introDismiss:{display:"flex",justifyContent:"flex-end",alignItems:"center",marginTop:e.spacing(1.5)},introDismissLink:{color:"#dddddd",display:"flex",alignItems:"center",marginBottom:e.spacing(.5),"&:hover":{color:e.palette.linkHover,transition:e.transitions.create("color",{easing:e.transitions.easing.sharp,duration:e.transitions.duration.shortest})}},introDismissText:{fontSize:"0.7rem",fontWeight:"bold",textTransform:"uppercase",letterSpacing:1},introDismissIcon:{width:18,height:18,marginRight:e.spacing(1.5)}}),{name:"BackstageSidebarIntro"});function Ds(e){const{sidebarConfig:o}=useContext(SidebarConfigContext),l=Si({sidebarConfig:o}),{text:u,onClose:m}=e,v=()=>m();return _jsxs(Box,{className:l.introCard,children:[_jsx(Typography,{variant:"subtitle2",children:u}),_jsx(Box,{className:l.introDismiss,children:_jsxs(IconButton,{onClick:v,className:l.introDismissLink,children:[_jsx(CloseIcon,{className:l.introDismissIcon}),_jsx(Typography,{component:"span",className:l.introDismissText,children:"Dismiss"})]})})]})}const Zs=e=>{const{text:o,onDismiss:l}=e,[u,m]=useState(!1),v=()=>{m(!0)};return _jsx(Collapse,{in:!u,onExited:l,children:_jsx(Ds,{text:o,onClose:v})})},Ci=null,wi="And your recently viewed plugins will pop up here!";function da(e){const{isOpen:o}=useSidebarOpenState(),l={starredItemsDismissed:!1,recentlyViewedItemsDismissed:!1},{value:u,set:m}=useLocalStorageValue(SIDEBAR_INTRO_LOCAL_STORAGE),{starredItemsDismissed:v,recentlyViewedItemsDismissed:w}=u!=null?u:{},M=()=>{m(F=>({...l,...F,starredItemsDismissed:!0}))},G=()=>{m(F=>({...l,...F,recentlyViewedItemsDismissed:!0}))};return o?_jsxs(_Fragment,{children:[!v&&_jsxs(_Fragment,{children:[_jsx(Zs,{text:Ci,onDismiss:M}),_jsx(SidebarDivider,{})]}),!w&&_jsx(Zs,{text:wi,onDismiss:G})]}):null}const ua=(0,g.Z)(e=>({root:{gridArea:"pageContent",minWidth:0,paddingTop:e.spacing(3),paddingBottom:e.spacing(3),paddingLeft:e.spacing(2),paddingRight:e.spacing(2),[e.breakpoints.up("sm")]:{paddingLeft:e.spacing(3),paddingRight:e.spacing(3)}},stretch:{display:"flex",flexDirection:"column",flexGrow:1},noPadding:{padding:0}}),{name:"BackstageContent"});function Ns(e){const{className:o,stretch:l,noPadding:u,children:m,...v}=e,{contentRef:w}=hi(),M=ua();return(0,t.jsx)("article",{ref:w,tabIndex:-1,...v,className:on()(M.root,o,{[M.stretch]:l,[M.noPadding]:u}),children:m})}var i=r(6487),n=r(99152);const s=(0,g.Z)(e=>({tabsWrapper:{gridArea:"pageSubheader",backgroundColor:e.palette.background.paper,paddingLeft:e.spacing(3),minWidth:0},defaultTab:{...e.typography.caption,padding:e.spacing(3,3),textTransform:"uppercase",fontWeight:e.typography.fontWeightBold,color:e.palette.text.secondary},selected:{color:e.palette.text.primary},tabRoot:{"&:hover":{backgroundColor:e.palette.background.default,color:e.palette.text.primary}}}),{name:"BackstageHeaderTabs"});function a(e){const{tabs:o,onChange:l,selectedIndex:u}=e,[m,v]=(0,f.useState)(u!=null?u:0),w=s(),M=(0,f.useCallback)((G,F)=>{u===void 0&&v(F),l&&u!==F&&l(F)},[u,l]);return(0,f.useEffect)(()=>{u!==void 0&&v(u)},[u]),(0,t.jsx)(C.Z,{className:w.tabsWrapper,children:(0,t.jsx)(n.Z,{selectionFollowsFocus:!0,indicatorColor:"primary",textColor:"inherit",variant:"scrollable",scrollButtons:"auto","aria-label":"tabs",onChange:M,value:m,children:o.map((G,F)=>(0,f.createElement)(i.Z,{...G.tabProps,"data-testid":`header-tab-${F}`,label:G.label,key:G.id,value:F,className:w.defaultTab,classes:{selected:w.selected,root:w.tabRoot}}))})})}function p(e){const o=(0,ur.UO)(),u=e.map(({path:Ee,children:Ie})=>({caseSensitive:!1,path:`${Ee}/*`,element:Ie})).sort((Ee,Ie)=>Ie.path.replace(/\/\*$/,"").localeCompare(Ee.path.replace(/\/\*$/,"")));var m;const v=(m=(0,ur.V$)(u))!==null&&m!==void 0?m:e[0].children;var w;let M=(w=o["*"])!==null&&w!==void 0?w:"";M.startsWith("/")||(M=`/${M}`);var G;const[F]=(G=(0,Fo.fp)(u,M))!==null&&G!==void 0?G:[],fe=F?e.findIndex(Ee=>`${Ee.path}/*`===F.route.path):0;var he;return{index:fe===-1?0:fe,element:v,route:(he=e[fe])!==null&&he!==void 0?he:e[0]}}function A(e){const{routes:o}=e,l=(0,ur.s0)(),{index:u,route:m,element:v}=p(o),w=(0,f.useMemo)(()=>o.map(G=>({id:G.path,label:G.title,tabProps:G.tabProps})),[o]),M=G=>{let{path:F}=o[G];F=F.replace(/\/\*$/,""),F=F.replace(/^\//,""),l(F)};return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(a,{tabs:w,selectedIndex:u,onChange:M}),(0,t.jsxs)(Ns,{children:[(0,t.jsx)(No.q,{title:m.title}),v]})]})}const k=()=>null;(0,h.R5)(k,"core.gatherMountPoints",!0);function U(e){const o=(0,t.jsx)(k,{path:"",title:"",children:(0,t.jsx)("div",{})}).type;return f.Children.toArray(e).flatMap(l=>{if(!(0,f.isValidElement)(l))return[];if(l.type===f.Fragment)return U(l.props.children);if(l.type!==o)throw new Error("Child of TabbedLayout must be an TabbedLayout.Route");const{path:u,title:m,children:v,tabProps:w}=l.props;return[{path:u,title:m,children:v,tabProps:w}]})}function ie(e){const o=U(e.children);return(0,t.jsx)(A,{routes:o})}ie.Route=k;const Ae=(0,g.Z)(e=>({value:{marginBottom:e.spacing(.75)},subvalue:{color:e.palette.textSubtle,fontWeight:"normal"}}),{name:"BackstageSubvalueCell"});function Le(e){const{value:o,subvalue:l}=e,u=Ae();return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(C.Z,{className:u.value,children:o}),(0,t.jsx)(C.Z,{className:u.subvalue,children:l})]})}var ze=r(67222),mt=r(21070),jt=r(90324),Tt=r(98281),zt=r(48049),Mt=r(51209),On=r(33375),ar=r(44233),pr=r(27604),Mr=r(36444),ji=r(37971),Ei=r(59709),Jo=r(17373),Ai=r(3702),zr=r(93111);const Oa=(0,g.Z)(e=>({root:{height:"100%",width:"315px",display:"flex",flexDirection:"column",marginRight:e.spacing(3)},value:{fontWeight:"bold",fontSize:18},header:{display:"flex",alignItems:"center",height:e.spacing(7.5),justifyContent:"space-between",borderBottom:`1px solid ${e.palette.grey[500]}`},filters:{display:"flex",flexDirection:"column","& > *":{marginTop:e.spacing(2)}}}),{name:"BackstageTableFilters"}),ka=e=>{var o;const l=Oa(),{onChangeFilters:u}=e,[m,v]=(0,f.useState)({...e.selectedFilters}),[w,M]=(0,f.useState)(!1),G=()=>{v({}),M(F=>!F)};return(0,f.useEffect)(()=>{u(m)},[m,u]),(0,t.jsxs)(C.Z,{className:l.root,children:[(0,t.jsxs)(C.Z,{className:l.header,children:[(0,t.jsx)(C.Z,{className:l.value,children:"Filters"}),(0,t.jsx)(ye.Z,{color:"primary",onClick:G,children:"Clear all"})]}),(0,t.jsx)(C.Z,{className:l.filters,children:((o=e.filters)===null||o===void 0?void 0:o.length)&&e.filters.map(F=>(0,t.jsx)(de,{triggerReset:w,...F.element,selected:m[F.element.label],onChange:fe=>v({...m,[F.element.label]:fe})},F.element.label))})]})},ha={Add:(0,f.forwardRef)((e,o)=>(0,t.jsx)(mt.Z,{...e,ref:o})),Check:(0,f.forwardRef)((e,o)=>(0,t.jsx)(Tt.Z,{...e,ref:o})),Clear:(0,f.forwardRef)((e,o)=>(0,t.jsx)(On.Z,{...e,ref:o})),Delete:(0,f.forwardRef)((e,o)=>(0,t.jsx)(ar.Z,{...e,ref:o})),DetailPanel:(0,f.forwardRef)((e,o)=>(0,t.jsx)(Mt.Z,{...e,ref:o})),Edit:(0,f.forwardRef)((e,o)=>(0,t.jsx)(pr.Z,{...e,ref:o})),Export:(0,f.forwardRef)((e,o)=>(0,t.jsx)(Ai.Z,{...e,ref:o})),Filter:(0,f.forwardRef)((e,o)=>(0,t.jsx)(Mr.Z,{...e,ref:o})),FirstPage:(0,f.forwardRef)((e,o)=>(0,t.jsx)(ji.Z,{...e,ref:o})),LastPage:(0,f.forwardRef)((e,o)=>(0,t.jsx)(Ei.Z,{...e,ref:o})),NextPage:(0,f.forwardRef)((e,o)=>(0,t.jsx)(Mt.Z,{...e,ref:o})),PreviousPage:(0,f.forwardRef)((e,o)=>(0,t.jsx)(zt.Z,{...e,ref:o})),ResetSearch:(0,f.forwardRef)((e,o)=>(0,t.jsx)(On.Z,{...e,ref:o})),Search:(0,f.forwardRef)((e,o)=>(0,t.jsx)(Mr.Z,{...e,ref:o})),SortArrow:(0,f.forwardRef)((e,o)=>(0,t.jsx)(jt.Z,{...e,ref:o})),ThirdStateCheck:(0,f.forwardRef)((e,o)=>(0,t.jsx)(Jo.Z,{...e,ref:o})),ViewColumn:(0,f.forwardRef)((e,o)=>(0,t.jsx)(zr.Z,{...e,ref:o}))};function pa(e,o){const l=o.split(".");let u=e[l[0]];for(let m=1;m<l.length;++m){if(u===void 0)return u;const v=l[m];u=u[v]}return u}const Ba=(0,In.Z)(e=>({header:{padding:e.spacing(1,2,1,2.5),borderTop:`1px solid ${e.palette.grey.A100}`,borderBottom:`1px solid ${e.palette.grey.A100}`,color:e.palette.textSubtle,fontWeight:e.typography.fontWeightBold,position:"static",wordBreak:"normal"}}),{name:"BackstageTableHeader"})(ze.W$),fa=(0,In.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"})(ze.UW),$a=(0,g.Z)(e=>({root:{display:"flex",alignItems:"center",justifyContent:"space-between"},title:{fontWeight:e.typography.fontWeightBold,fontSize:18,whiteSpace:"nowrap"}}),{name:"BackstageTableFiltersContainer"}),Da=(0,g.Z)(()=>({root:{display:"flex",alignItems:"start"}}),{name:"BackstageTable"});function Za(e,o){return e.map(l=>{var u;const m=(u=l.headerStyle)!==null&&u!==void 0?u:{};let v=l.cellStyle||{};if(l.highlight)if(m.color=o.palette.textContrast,typeof v=="object")v.fontWeight=o.typography.fontWeightBold;else{const w=v;v=(M,G,F)=>({...w(M,G,F),fontWeight:o.typography.fontWeightBold})}return{...l,headerStyle:m,cellStyle:v}})}function Na(e,o){return(0,Jr.transform)(e,(l,u,m)=>{(0,Jr.isEqual)(u,o[m])||(l[m]=u)})}const ga={search:"",filtersOpen:!1,filters:{}};function Fa(e){const{toolbarRef:o,setSearch:l,hasFilters:u,selectedFiltersLength:m,toggleFilters:v}=e,w=$a(),M=(0,f.useCallback)(G=>{e.onSearchChanged(G),l(G)},[e,l]);return u?(0,t.jsxs)(C.Z,{className:w.root,children:[(0,t.jsxs)(C.Z,{className:w.root,children:[(0,t.jsx)(T.Z,{onClick:v,"aria-label":"filter list",children:(0,t.jsx)(Mr.Z,{})}),(0,t.jsxs)(dt.Z,{className:w.title,children:["Filters (",m,")"]})]}),(0,t.jsx)(fa,{...e,ref:o,onSearchChanged:M})]}):(0,t.jsx)(fa,{...e,ref:o,onSearchChanged:M})}function ma(e){const{data:o,columns:l,options:u,title:m,subtitle:v,filters:w,initialState:M,emptyContent:G,onStateChange:F,components:fe,...he}=e,Ee=Da(),Ie=(0,oe.Z)(),Me={...ga,...M},[_e,Zt]=(0,f.useState)(Me.filtersOpen),pn=(0,f.useCallback)(()=>Zt(Fn=>!Fn),[Zt]),[kn,nr]=(0,f.useState)(0),[Nt,fn]=(0,f.useState)(o),[mn,Tr]=(0,f.useState)(Me.filters),Rr=Za(l,Ie),[Ir,Pr]=(0,f.useState)(Me.search);(0,f.useEffect)(()=>{if(F){const Fn=Na({search:Ir,filtersOpen:_e,filters:mn},ga);F(Fn)}},[Ir,_e,mn,F]);const Li={headerStyle:{textTransform:"uppercase"}},Wr=(0,f.useCallback)(Fn=>{var Cr;return(Cr=l.find(Xr=>Xr.title===Fn))===null||Cr===void 0?void 0:Cr.field},[l]);(0,f.useEffect)(()=>{if(typeof o=="function")return;if(!mn){fn(o);return}const Fn=Object.values(mn);if(o&&Fn.flat().length){const Cr=o.filter(Xr=>!!Object.entries(mn).filter(([,qr])=>!!qr.length).every(([qr,vn])=>{const Cn=pa(Xr,Wr(qr));return Array.isArray(Cn)&&Array.isArray(vn)?Cn.some(So=>vn.includes(So)):Array.isArray(Cn)?Cn.includes(vn):Array.isArray(vn)?vn.includes(Cn):Cn===vn}));fn(Cr)}else fn(o);nr(Fn.flat().length)},[o,mn,Wr]);const Oi=(Fn,Cr)=>{const Xr=vn=>{const Cn=new Set,So=_r=>{_r!=null&&Cn.add(_r)};return Cr&&Cr.forEach(_r=>{const qo=pa(_r,Wr(vn));Array.isArray(qo)?qo.forEach(So):So(qo)}),Cn},qr=vn=>({placeholder:"All results",label:vn.column,multiple:vn.type==="multiple-select",items:[...Xr(vn.column)].sort().map(Cn=>({label:Cn,value:Cn}))});return Fn.map(vn=>({type:vn.type,element:qr(vn)}))},rn=!!(w!=null&&w.length),bo=(0,f.useCallback)(Fn=>(0,t.jsx)(Fa,{setSearch:Pr,hasFilters:rn,selectedFiltersLength:kn,toggleFilters:pn,...Fn}),[pn,rn,kn,Pr]),Fs=typeof o!="function"&&o.length===0,Vr=l.length,ki=(0,f.useCallback)(Fn=>G&&Fs?(0,t.jsx)("tbody",{children:(0,t.jsx)("tr",{children:(0,t.jsx)("td",{colSpan:Vr,children:G})})}):(0,t.jsx)(ze.os,{...Fn}),[Fs,G,Vr]);return(0,t.jsxs)(C.Z,{className:Ee.root,children:[_e&&o&&typeof o!="function"&&(w==null?void 0:w.length)&&(0,t.jsx)(ka,{filters:Oi(w,o),selectedFilters:mn,onChangeFilters:Tr}),(0,t.jsx)(ze.ZP,{components:{Header:Ba,Toolbar:bo,Body:ki,...fe},options:{...Li,...u},columns:Rr,icons:ha,title:(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(dt.Z,{variant:"h5",component:"h2",children:m}),v&&(0,t.jsx)(dt.Z,{color:"textSecondary",variant:"body1",children:v})]}),data:typeof o=="function"?o:Nt,style:{width:"100%"},localization:{toolbar:{searchPlaceholder:"Filter",searchTooltip:"Filter"}},...he})]})}ma.icons=Object.freeze(ha);var Bl=r(44311);function Ua(e,o){const l=e[e.length-1];if(l)return l>=.9?o.palette.status.ok:l>=.5?o.palette.status.warning:o.palette.status.error}function $l(e){const o=useTheme();if(!e.data)return null;var l;return _jsxs(Sparklines,{width:120,height:30,min:0,max:1,...e,children:[e.title&&_jsx("title",{children:e.title}),_jsx(SparklinesLine,{color:(l=e.color)!==null&&l!==void 0?l:Ua(e.data,o)})]})}const Ma=e=>(0,g.Z)(o=>({container:{width:"100%",display:"flex",flexDirection:"row",flexWrap:"wrap",justifyContent:"flex-end",alignItems:"center",marginBottom:o.spacing(2),textAlign:e.textAlign},leftItemsBox:{flex:"1 1 auto",minWidth:0,overflow:"visible"},rightItemsBox:{flex:"0 1 auto",display:"flex",flexDirection:"row",flexWrap:"wrap",alignItems:"center",marginLeft:o.spacing(1),minWidth:0,overflow:"visible"},description:{},title:{display:"inline-flex",marginBottom:0}}),{name:"BackstageContentHeader"}),za=({title:e="Unknown page",className:o})=>(0,t.jsx)(dt.Z,{variant:"h4",component:"h2",className:o,"data-testid":"header-title",children:e});function Wa(e){const{description:o,title:l,titleComponent:u=void 0,children:m,textAlign:v="left"}=e,w=Ma({textAlign:v})(),M=u||(0,t.jsx)(za,{title:l,className:w.title});return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(No.q,{title:l}),(0,t.jsxs)(C.Z,{className:w.container,children:[(0,t.jsxs)(C.Z,{className:w.leftItemsBox,children:[M,o&&(0,t.jsx)(dt.Z,{className:w.description,variant:"body2",children:o})]}),(0,t.jsx)(C.Z,{className:w.rightItemsBox,children:m})]})]})}var Va=r.p+"static/mic-drop.fe3ef4d0..svg";const Ha=(0,g.Z)(e=>({micDrop:{maxWidth:"60%",bottom:e.spacing(2),right:e.spacing(2),[e.breakpoints.down("xs")]:{maxWidth:"96%",bottom:"unset",right:"unset",margin:`${e.spacing(10)}px auto ${e.spacing(4)}px`}}}),{name:"BackstageErrorPageMicDrop"}),Ga=()=>{const e=Ha();return(0,t.jsx)("img",{src:Va,className:e.micDrop,alt:"Girl dropping mic from her hands"})},Ka=(0,g.Z)(e=>({container:{padding:e.spacing(8),[e.breakpoints.down("xs")]:{padding:e.spacing(2)}},title:{paddingBottom:e.spacing(5),[e.breakpoints.down("xs")]:{paddingBottom:e.spacing(4),fontSize:e.typography.h3.fontSize}},subtitle:{color:e.palette.textSubtle}}),{name:"BackstageErrorPage"});function Ya(e){const{status:o,statusMessage:l,additionalInfo:u,supportUrl:m}=e,v=Ka(),w=(0,ur.s0)(),M=ys();return(0,t.jsxs)(Wt.Z,{container:!0,spacing:0,className:v.container,children:[(0,t.jsxs)(Wt.Z,{item:!0,xs:12,sm:8,md:4,children:[(0,t.jsxs)(dt.Z,{"data-testid":"error",variant:"body1",className:v.subtitle,children:["ERROR ",o,": ",l]}),(0,t.jsx)(dt.Z,{variant:"body1",className:v.subtitle,children:u}),(0,t.jsx)(dt.Z,{variant:"h2",className:v.title,children:"Looks like someone dropped the mic!"}),(0,t.jsxs)(dt.Z,{variant:"h6",children:[(0,t.jsx)(ue.r,{to:"#","data-testid":"go-back-link",onClick:()=>w(-1),children:"Go back"}),"... or please"," ",(0,t.jsx)(ue.r,{to:m||M.url,children:"contact support"})," if you think this is a bug."]})]}),(0,t.jsx)(Ga,{})]})}var Ja=r(16173);const Qa=(0,In.Z)({root:{textDecoration:"underline",cursor:"pointer"}},{name:"BackstageBreadcrumbsClickableText"})(dt.Z),Ti=(0,In.Z)({root:{textDecoration:"underline",color:"inherit"}},{name:"BackstageBreadcrumbsStyledBox"})(C.Z);function Xa(e){const{children:o,...l}=e,[u,m]=f.useState(null),v=f.Children.toArray(o),[w,M,...G]=v,F=G.length?G.pop():v[v.length-1],fe=v.length>3,he=Me=>{m(Me.currentTarget)},Ee=()=>{m(null)},Ie=Boolean(u);return(0,t.jsxs)(f.Fragment,{children:[(0,t.jsxs)(Ja.Z,{"aria-label":"breadcrumb",...l,children:[v.length>1&&(0,t.jsx)(Ti,{clone:!0,children:w}),v.length>2&&(0,t.jsx)(Ti,{clone:!0,children:M}),fe&&(0,t.jsx)(Qa,{onClick:he,children:"..."}),(0,t.jsx)(C.Z,{style:{fontStyle:"italic"},children:F})]}),(0,t.jsx)(fs.ZP,{open:Ie,anchorEl:u,onClose:Ee,anchorOrigin:{vertical:"bottom",horizontal:"left"},transformOrigin:{vertical:"top",horizontal:"left"},children:(0,t.jsx)(It.Z,{children:G.map((Me,_e)=>(0,t.jsx)(Bt.Z,{button:!0,children:(0,t.jsx)(Ti,{clone:!0,children:Me})},_e))})})]})}const qa=(0,g.Z)(e=>({header:{gridArea:"pageHeader",padding:e.spacing(3),width:"100%",boxShadow:e.shadows[4],position:"relative",zIndex:100,display:"flex",flexDirection:"row",alignItems:"center",backgroundImage:e.page.backgroundImage,backgroundPosition:"center",backgroundSize:"cover",[e.breakpoints.down("sm")]:{flexWrap:"wrap"}},leftItemsBox:{maxWidth:"100%",flexGrow:1},rightItemsBox:{width:"auto",alignItems:"center"},title:{color:e.page.fontColor,wordBreak:"break-word",fontSize:e.typography.h3.fontSize,marginBottom:0},subtitle:{color:e.page.fontColor,opacity:.8,display:"inline-block",marginTop:e.spacing(1),maxWidth:"75ch"},type:{textTransform:"uppercase",fontSize:11,opacity:.8,marginBottom:e.spacing(1),color:e.page.fontColor},breadcrumb:{color:e.page.fontColor},breadcrumbType:{fontSize:"inherit",opacity:.7,marginRight:-e.spacing(.3),marginBottom:e.spacing(.3)},breadcrumbTitle:{fontSize:"inherit",marginLeft:-e.spacing(.3),marginBottom:e.spacing(.3)}}),{name:"BackstageHeader"}),_a=({type:e,typeLink:o,classes:l,pageTitle:u})=>e?o?(0,t.jsxs)(Xa,{className:l.breadcrumb,children:[(0,t.jsx)(ue.r,{to:o,children:e}),(0,t.jsx)(dt.Z,{children:u})]}):(0,t.jsx)(dt.Z,{className:l.type,children:e}):null,el=({pageTitle:e,classes:o,tooltip:l})=>{const u=(0,t.jsx)(dt.Z,{className:o.title,variant:"h1",children:e});return l?(0,t.jsx)(P.ZP,{title:l,placement:"top-start",children:u}):u},tl=({classes:e,subtitle:o})=>o?typeof o!="string"?(0,t.jsx)(t.Fragment,{children:o}):(0,t.jsx)(dt.Z,{className:e.subtitle,variant:"subtitle2",component:"span",children:o}):null;function va(e){const{children:o,pageTitleOverride:l,style:u,subtitle:m,title:v,tooltip:w,type:M,typeLink:G}=e,F=qa(),he=(0,h.h_)(h.Ds).getOptionalString("app.title")||"Backstage",Ee=l||v,Ie=v||l,Me=`${Ee} | %s | ${he}`,_e=`${Ee} | ${he}`;return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(No.q,{titleTemplate:Me,defaultTitle:_e}),(0,t.jsxs)("header",{style:u,className:F.header,children:[(0,t.jsxs)(C.Z,{className:F.leftItemsBox,children:[(0,t.jsx)(_a,{classes:F,type:M,typeLink:G,pageTitle:Ie}),(0,t.jsx)(el,{classes:F,pageTitle:Ie,tooltip:w}),(0,t.jsx)(tl,{classes:F,subtitle:m})]}),(0,t.jsx)(Wt.Z,{container:!0,className:F.rightItemsBox,spacing:4,children:o})]})]})}const nl=({label:e,secondaryLabel:o,icon:l,disabled:u=!1,onClick:m})=>_jsx(Fragment,{children:_jsxs(ListItem,{"data-testid":"header-action-item",disabled:u,button:!0,onClick:v=>{m&&m(v)},children:[l&&_jsx(ListItemIcon,{children:l}),_jsx(ListItemText,{primary:e,secondary:o})]})});function Dl(e){const{palette:{common:{white:o}}}=useTheme(),{actionItems:l}=e,[u,m]=React.useState(!1),v=React.useRef(null);return _jsxs(Fragment,{children:[_jsx(IconButton,{onClick:()=>m(!0),"data-testid":"header-action-menu",ref:v,style:{color:o,height:56,width:56,marginRight:-4,padding:0},children:_jsx(MoreVert,{})}),_jsx(Popover,{open:u,anchorEl:v.current,anchorOrigin:{horizontal:"right",vertical:"bottom"},transformOrigin:{horizontal:"right",vertical:"top"},onClose:()=>m(!1),children:_jsx(List,{children:l.map((w,M)=>_jsx(nl,{...w},`header-action-menu-${M}`))})})]})}const rl=(0,g.Z)(e=>({root:{textAlign:"left"},label:{color:e.page.fontColor,fontWeight:e.typography.fontWeightBold,letterSpacing:0,fontSize:e.typography.fontSize,marginBottom:e.spacing(1)/2,lineHeight:1},value:{color:(0,X.Fq)(e.page.fontColor,.8),fontSize:e.typography.fontSize,lineHeight:1}}),{name:"BackstageHeaderLabel"}),ol=({value:e,className:o})=>(0,t.jsx)(dt.Z,{component:typeof e=="string"?"p":"span",className:o,children:e});function sl(e){const{label:o,value:l,url:u}=e,m=rl(),v=(0,t.jsx)(ol,{className:m.value,value:l||"<Unknown>"});return(0,t.jsx)(Wt.Z,{item:!0,children:(0,t.jsxs)(dt.Z,{component:"span",className:m.root,children:[(0,t.jsx)(dt.Z,{className:m.label,children:o}),u?(0,t.jsx)(ue.r,{to:u,children:v}):v]})})}const il=e=>(0,Gn.Z)({root:{color:e.palette.common.white,padding:e.spacing(2,2,3),backgroundImage:e.getPageTheme({themeId:"card"}).backgroundImage,backgroundPosition:0,backgroundSize:"inherit"}}),al=(0,g.Z)(il,{name:"BackstageItemCardHeader"});function ll(e){const{title:o,subtitle:l,children:u}=e,m=al(e);return(0,t.jsxs)(C.Z,{className:m.root,children:[l&&(0,t.jsx)(dt.Z,{variant:"subtitle2",component:"h3",children:l}),o&&(0,t.jsx)(dt.Z,{variant:"h6",component:"h4",children:o}),u]})}function Zl(e){const{description:o,tags:l,title:u,type:m,subtitle:v,label:w,onClick:M,href:G}=e;return _jsxs(Card,{children:[_jsx(CardMedia,{children:_jsx(ItemCardHeader,{title:u,subtitle:v||m})}),_jsxs(CardContent,{children:[l!=null&&l.length?_jsx(Box,{children:l.map((F,fe)=>_jsx(Chip,{size:"small",label:F},fe))}):null,o]}),_jsxs(CardActions,{children:[!G&&_jsx(LinkButton,{to:"#",onClick:M,color:"primary",children:w}),G&&_jsx(LinkButton,{to:G,color:"primary",children:w})]})]})}const cl=e=>(0,Gn.Z)({root:{display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(22em, 1fr))",gridAutoRows:"1fr",gridGap:e.spacing(2)}}),dl=(0,g.Z)(cl,{name:"BackstageItemCardGrid"});function ul(e){const{children:o,...l}=e,u=dl(l);return(0,t.jsx)(C.Z,{className:u.root,...l,children:o})}var hl=r(41547);const pl=(0,g.Z)(e=>({root:{display:"grid",gridTemplateAreas:"'pageHeader pageHeader pageHeader' 'pageSubheader pageSubheader pageSubheader' 'pageNav pageContent pageSidebar'",gridTemplateRows:"max-content auto 1fr",gridTemplateColumns:"auto 1fr auto",overflowY:"auto",height:"100vh",[e.breakpoints.down("xs")]:{height:"100%"}}}),{name:"BackstagePage"});function ya(e){const{themeId:o,children:l}=e,u=pl();return(0,t.jsx)(hl.Z,{theme:m=>({...m,page:m.getPageTheme({themeId:o})}),children:(0,t.jsx)("main",{className:u.root,children:l})})}function fl(e){const{themeId:o,children:l,...u}=e;return(0,t.jsxs)(ya,{themeId:o,children:[(0,t.jsx)(va,{...u}),l]})}var qn=r(30195);const Nl=qn.z.object({providerInfo:qn.z.object({}).catchall(qn.z.unknown()).optional(),profile:qn.z.object({email:qn.z.string().optional(),displayName:qn.z.string().optional(),picture:qn.z.string().optional()}),backstageIdentity:qn.z.object({token:qn.z.string(),identity:qn.z.object({type:qn.z.literal("user"),userEntityRef:qn.z.string(),ownershipEntityRefs:qn.z.array(qn.z.string())})})}),xa={defaultTokenExpiryMillis:5*60*1e3,tokenExpiryMarginMillis:5*60*1e3};function gl(e){const o=new Date(Date.now()+xa.defaultTokenExpiryMillis);if(!e)return o;const[l,u,m]=e.split("."),v=JSON.parse(window.atob(u));return typeof v.exp!="number"?o:new Date(v.exp*1e3-xa.tokenExpiryMarginMillis)}class Fl{async start(){await this.getSessionAsync()}getUserId(){const{backstageIdentity:o}=this.getSessionSync(),l=o.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 o=this.state.type==="active"?this.state.session:void 0,l=this.fetchSession().then(u=>(this.state={type:"active",session:u,expiresAt:gl(u.backstageIdentity.token)},u),u=>{throw this.state={type:"failed",error:u},u});return this.state={type:"fetching",promise:l,previous:o},l}async fetchSession(){const o=await this.options.discoveryApi.getBaseUrl("auth"),l=typeof this.options.headers=="function"?await this.options.headers():this.options.headers,u=new Headers(l);u.set("X-Requested-With","XMLHttpRequest");const m=await fetch(`${o}/${this.options.provider}/refresh`,{signal:this.abortController.signal,headers:u,credentials:"include"});if(!m.ok)throw await ResponseError.fromResponse(m);return proxiedSessionSchema.parse(await m.json())}constructor(o){_define_property(this,"options",void 0),_define_property(this,"abortController",void 0),_define_property(this,"state",void 0),this.options=o,this.abortController=new AbortController,this.state={type:"empty"}}}const Ul=e=>{const o=useApi(discoveryApiRef),[{status:l,error:u},{execute:m}]=useAsync(async()=>{const v=new ProxiedSignInIdentity({provider:e.provider,discoveryApi:o,headers:e.headers});await v.start(),e.onSignInSuccess(v)});return useMountEffect(m),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},ml=(0,g.Z)({container:{padding:0,listStyle:"none"},item:{display:"flex",flexDirection:"column",width:"100%",maxWidth:"400px",margin:0,padding:0}},{name:"BackstageSignInPage"}),Ri=({children:e})=>{const o=ml();return(0,t.jsx)(Wt.Z,{component:"li",item:!0,classes:o,children:e})};var Qo=r(87612);class Ii{getUserId(){return"guest"}async getIdToken(){}getProfile(){return{email:"guest@example.com",displayName:"Guest"}}async getProfileInfo(){return{email:"guest@example.com",displayName:"Guest"}}async getBackstageIdentity(){const o="user:default/guest";return{type:"user",userEntityRef:o,ownershipEntityRefs:[o]}}async getCredentials(){return{}}async signOut(){}}function vl(e){const[o,l,u]=e.split(".");return JSON.parse(window.atob(l))}class Pi{getUserId(){return this.result.userId}static fromResult(o){return new Pi(o)}async getIdToken(){var o,l;return(l=(o=this.result).getIdToken)===null||l===void 0?void 0:l.call(o)}getProfile(){return this.result.profile}async getProfileInfo(){return this.result.profile}async getBackstageIdentity(){const o=await this.getIdToken();if(!o){const m=`user:default/${this.getUserId()}`;return{type:"user",userEntityRef:m,ownershipEntityRefs:[m]}}const{sub:l,ent:u}=vl(o);return{type:"user",userEntityRef:l,ownershipEntityRefs:u!=null?u:[]}}async getCredentials(){var o,l;return{token:await((l=(o=this.result).getIdToken)===null||l===void 0?void 0:l.call(o))}}async signOut(){var o,l;return(l=(o=this.result).signOut)===null||l===void 0?void 0:l.call(o)}constructor(o){(0,Qo._)(this,"result",void 0),this.result=o}}class Xo{static createGuest(){return new Ii}static fromLegacy(o){return Pi.fromResult(o)}static create(o){return new Xo(o.identity,o.authApi,o.profile)}getUserId(){const o=this.identity.userEntityRef,l=/^([^:/]+:)?([^:/]+\/)?([^:/]+)$/.exec(o);if(!l)throw new TypeError(`Invalid user entity reference "${o}"`);return l[3]}async getIdToken(){return(await this.authApi.getBackstageIdentity()).token}getProfile(){if(!this.profile)throw new Error("The identity API does not implement synchronous profile fetching, use getProfileInfo() instead");return this.profile}async getProfileInfo(){if(this.profilePromise)return await this.profilePromise;try{return this.profilePromise=this.authApi.getProfile(),await this.profilePromise}catch(o){throw this.profilePromise=void 0,o}}async getBackstageIdentity(){return this.identity}async getCredentials(){return{token:(await this.authApi.getBackstageIdentity()).token}}async signOut(){return this.authApi.signOut()}constructor(o,l,u){(0,Qo._)(this,"identity",void 0),(0,Qo._)(this,"authApi",void 0),(0,Qo._)(this,"profile",void 0),(0,Qo._)(this,"profilePromise",void 0),this.identity=o,this.authApi=l,this.profile=u}}const yl={Component:({config:e,onSignInStarted:o,onSignInSuccess:l,onSignInFailure:u})=>{const{apiRef:m,title:v,message:w}=e,M=(0,h.h_)(m),G=(0,h.h_)(h.VE),F=async()=>{try{o();const fe=await M.getBackstageIdentity({instantPopup:!0});if(!fe)throw u(),new Error(`The ${v} provider is not configured to support sign-in`);const he=await M.getProfile();l(Xo.create({identity:fe.identity,profile:he,authApi:M}))}catch(fe){u(),G.post(new xr.SP("Login failed",fe))}};return(0,t.jsx)(Ri,{children:(0,t.jsx)(Sr,{variant:"fullHeight",title:v,actions:(0,t.jsx)(ye.Z,{color:"primary",variant:"outlined",onClick:F,children:"Sign In"}),children:(0,t.jsx)(dt.Z,{variant:"body1",children:w})})})},loader:async(e,o)=>{const l=e.get(o),u=await l.getBackstageIdentity({optional:!0});if(!u)return;const m=await l.getProfile();return Xo.create({identity:u.identity,profile:m,authApi:l})}},xl={Component:({onSignInStarted:e,onSignInSuccess:o})=>(0,t.jsx)(Ri,{children:(0,t.jsx)(Sr,{title:"Guest",variant:"fullHeight",actions:(0,t.jsx)(ye.Z,{color:"primary",variant:"outlined",onClick:()=>{e(),o(new Ii)},children:"Enter"}),children:(0,t.jsxs)(dt.Z,{variant:"body1",children:["Enter as a Guest User.",(0,t.jsx)("br",{}),"You will not have a verified identity,",(0,t.jsx)("br",{}),"meaning some features might be unavailable."]})})}),loader:async()=>new Ii};var bl=r(63955),ba=r(86619),Sa=r(74828),Sl=r(45455),Cl=r.n(Sl);const wl=/^[a-z0-9_\-]+\.[a-z0-9_\-]+\.[a-z0-9_\-]+$/i,jl=(0,g.Z)(e=>({form:{display:"flex",flexFlow:"column nowrap"},button:{alignSelf:"center",marginTop:e.spacing(2)}}),{name:"BackstageCustomProvider"}),Ca=e=>{const{ref:o,...l}=e;return{inputRef:o,...l}},El={Component:({onSignInStarted:e,onSignInSuccess:o})=>{const l=jl(),{register:u,handleSubmit:m,formState:v}=(0,bl.cI)({mode:"onChange"}),{errors:w}=v,M=({userId:G,idToken:F})=>{e(),o(Xo.fromLegacy({userId:G,getIdToken:F!==void 0?async()=>F:void 0,profile:{email:`${G}@example.com`}}))};return(0,t.jsx)(Ri,{children:(0,t.jsxs)(Sr,{title:"Custom User",variant:"fullHeight",children:[(0,t.jsxs)(dt.Z,{variant:"body1",children:["Enter your own User ID and credentials.",(0,t.jsx)("br",{}),"This selection will not be stored."]}),(0,t.jsxs)("form",{className:l.form,onSubmit:m(M),children:[(0,t.jsxs)(io.Z,{children:[(0,t.jsx)(ba.Z,{...Ca(u("userId",{required:!0})),label:"User ID",margin:"normal",error:Boolean(w.userId)}),w.userId&&(0,t.jsx)(Sa.Z,{error:!0,children:w.userId.message})]}),(0,t.jsxs)(io.Z,{children:[(0,t.jsx)(ba.Z,{...Ca(u("idToken",{required:!1,validate:G=>!G||wl.test(G)||"Token is not a valid OpenID Connect JWT Token"})),label:"ID Token (optional)",margin:"normal",autoComplete:"off",error:Boolean(w.idToken)}),w.idToken&&(0,t.jsx)(Sa.Z,{error:!0,children:w.idToken.message})]}),(0,t.jsx)(ye.Z,{type:"submit",color:"primary",variant:"outlined",className:l.button,disabled:!(v!=null&&v.isDirty)||!Cl()(w),children:"Continue"})]})]})})},loader:async()=>{}},xo="@backstage/core:SignInPage:provider",wa={guest:xl,custom:El,common:yl};function ja(e,o){if(e in o)throw new Error(`"${e}" ID is duplicated. IDs of identity providers have to be unique.`)}function Kl(e){return e.reduce((l,u)=>{if(typeof u=="string")return ja(u,l),l[u]={components:wa[u],id:u},l;const{id:m}=u;return ja(m,l),l[m]={components:wa.common,id:m,config:u},l},{})}const Yl=(e,o)=>{const l=useApi(errorApiRef),u=useApiHolder(),[m,v]=useState(!0),w=useCallback(G=>{o(IdentityApiSignOutProxy.from({identityApi:G,signOut:async()=>{var F;localStorage.removeItem(xo),await((F=G.signOut)===null||F===void 0?void 0:F.call(G))}}))},[o]);useLayoutEffect(()=>{var G;if(!m)return;const F=localStorage.getItem(xo);if(F===null){v(!1);return}const fe=e[F];if(!fe){v(!1);return}let he=!1;return fe.components.loader(u,(G=fe.config)===null||G===void 0?void 0:G.apiRef).then(Ee=>{if(he){localStorage.removeItem(xo);return}Ee?w(Ee):v(!1)}).catch(Ee=>{localStorage.removeItem(xo),!he&&(l.post(Ee),v(!1))}),()=>{he=!0}},[m,l,o,u,e,w]);const M=useMemo(()=>Object.keys(e).map(G=>{const F=e[G],{Component:fe}=F.components,he=Me=>{w(Me)},Ee=()=>{var Me;localStorage.setItem(xo,(F==null||(Me=F.config)===null||Me===void 0?void 0:Me.id)||F.id)},Ie=()=>{localStorage.removeItem(xo)};return _jsx(fe,{config:F.config,onSignInStarted:Ee,onSignInSuccess:he,onSignInFailure:Ie},F.id)}),[e,w]);return[m,M]},Al=({onSignInSuccess:e,providers:o=[],title:l,align:u="left"})=>{const m=useApi(configApiRef),v=useStyles(),w=getSignInProviders(o),[M,G]=useSignInProviders(w,e);return M?_jsx(Progress,{}):_jsxs(Page,{themeId:"home",children:[_jsx(Header,{title:m.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:v,children:G})]})]})},Tl=({provider:e,auto:o,onSignInSuccess:l})=>{const u=useStyles(),m=useApi(e.apiRef),v=useApi(configApiRef),[w,M]=useState(),[G,F]=useState(!1),fe=async({checkExisting:he,showPopup:Ee})=>{try{let Ie;if(he&&(Ie=await m.getBackstageIdentity({optional:!0})),!Ie&&(Ee||o)&&(F(!0),Ie=await m.getBackstageIdentity({instantPopup:!0}),!Ie))throw new Error(`The ${e.title} provider is not configured to support sign-in`);if(!Ie){F(!0);return}const Me=await m.getProfile();l(UserIdentity.create({identity:Ie.identity,authApi:m,profile:Me}))}catch(Ie){M(Ie),F(!0)}};return useMountEffect(()=>fe({checkExisting:!0})),G?_jsxs(Page,{themeId:"home",children:[_jsx(Header,{title:v.getString("app.title")}),_jsx(Content,{children:_jsx(Grid,{container:!0,justifyContent:"center",spacing:2,component:"ul",classes:u,children:_jsx(GridItem,{children:_jsxs(InfoCard,{variant:"fullHeight",title:e.title,actions:_jsx(Button,{color:"primary",variant:"outlined",onClick:()=>{fe({showPopup:!0})},children:"Sign In"}),children:[_jsx(Typography,{variant:"body1",children:e.message}),w&&w.name!=="PopupRejectedError"&&_jsx(Typography,{variant:"body1",color:"error",children:w.message})]})})})})]}):_jsx(Progress,{})};function Jl(e){return"provider"in e?_jsx(Tl,{...e}):_jsx(Al,{...e})}const Rl=(0,g.Z)(e=>({root:{padding:e.spacing(0,2,0,2.5),minHeight:e.spacing(3)},indicator:{backgroundColor:e.palette.info.main,height:e.spacing(.3)}}),{name:"BackstageTabbedCard"}),Il=(0,In.Z)(e=>({root:{padding:e.spacing(2,2,2,2.5),display:"inline-block"},title:{fontWeight:700},subheader:{paddingTop:e.spacing(1)}}),{name:"BackstageTabbedCardBoldHeader"})(Nr.Z);function Ql(e){const{slackChannel:o,errorBoundaryProps:l,children:u,title:m,deepLink:v,value:w,onChange:M}=e,G=Rl(),[F,fe]=useState(0),he=M||((Me,_e)=>fe(_e));let Ee;w?React.Children.map(u,Me=>{if(React.isValidElement(Me)&&(Me==null?void 0:Me.props.value)===w){var _e;Ee=Me==null||(_e=Me.props)===null||_e===void 0?void 0:_e.children}}):React.Children.map(u,(Me,_e)=>{React.isValidElement(Me)&&_e===F&&(Ee=Me==null?void 0:Me.props.children)});const Ie=l||(o?{slackChannel:o}:{});return _jsx(Card,{children:_jsxs(ErrorBoundary,{...Ie,children:[m&&_jsx(Il,{title:m}),_jsx(Tabs,{selectionFollowsFocus:!0,classes:G,value:w||F,onChange:he,children:u}),_jsx(Divider,{}),_jsx(CardContent,{children:Ee}),v&&_jsx(BottomLink,{...v})]})})}const Pl=(0,g.Z)(e=>({root:{minWidth:e.spacing(6),minHeight:e.spacing(3),margin:e.spacing(0,2,0,0),padding:e.spacing(.5,0,.5,0),textTransform:"none","&:hover":{opacity:1,backgroundColor:"transparent",color:e.palette.text.primary}},selected:{fontWeight:e.typography.fontWeightBold}}),{name:"BackstageCardTab"});function Xl(e){const{children:o,...l}=e,u=Pl();return _jsx(Tab,{disableRipple:!0,classes:u,...l})}},60871:function(Ct,Be,r){"use strict";r.d(Be,{fC:function(){return g},CL:function(){return nt},sM:function(){return oe},$v:function(){return We},v_:function(){return z},hg:function(){return xt},uB:function(){return Pe},R5:function(){return Je},bq:function(){return O},Km:function(){return re},Ds:function(){return st},ni:function(){return C},T0:function(){return I},CO:function(){return dt},x8:function(){return Dn},rx:function(){return Yn},YO:function(){return bn},P4:function(){return Wt},NT:function(){return Yt},NW:function(){return Ke},VE:function(){return it},W0:function(){return bt},gP:function(){return St},IY:function(){return vt},F4:function(){return ne},ux:function(){return T},Kp:function(){return ee},$4:function(){return pt},p_:function(){return P},ZM:function(){return ft},D:function(){return $},gW:function(){return L},E6:function(){return wt},z$:function(){return qt},h_:function(){return ye},I_:function(){return B},qD:function(){return ge},vJ:function(){return jn},tg:function(){return wn},Oi:function(){return zn}});var t=r(52322),h=r(51837),H=r(2784);const f=(0,h.CT)("analytics-context"),W=()=>{const je=(0,H.useContext)(f);if(je===void 0)return{routeRef:"unknown",pluginId:"root",extension:"App"};const le=je.atVersion(1);if(le===void 0)throw new Error("No context found for version 1.");return le},g=je=>{const{attributes:le,children:Oe}=je,qe={...W(),...le},_=(0,h.EI)({1:qe});return(0,t.jsx)(f.Provider,{value:_,children:Oe})};function d(je,le){const Oe=Ue=>_jsx(g,{attributes:le,children:_jsx(je,{...Ue})});return Oe.displayName=`WithAnalyticsContext(${je.displayName||je.name||"Component"})`,Oe}function B(){const je=(0,h.Vt)("api-context");if(!je)throw new Error("API context is not available");const le=je.atVersion(1);if(!le)throw new Error("ApiContext v1 not available");return le}function ye(je){const Oe=B().get(je);if(!Oe)throw new Error(`No implementation available for ${je}`);return Oe}function ue(je){return function(Oe){const Ue=_=>{const N=B(),ve={};for(const $e in je)if(je.hasOwnProperty($e)){const et=je[$e],at=N.get(et);if(!at)throw new Error(`No implementation available for ${et}`);ve[$e]=at}return _jsx(Oe,{..._,...ve})},qe=Oe.displayName||Oe.name||"Component";return Ue.displayName=`withApis(${qe})`,Ue}}var V=r(87612);class J{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(le){if((0,V._)(this,"config",void 0),this.config=le,!le.id.split(".").flatMap(Ue=>Ue.split("-")).every(Ue=>Ue.match(/^[a-z][a-z0-9]*$/)))throw new Error(`API id must only contain period separated lowercase alphanum tokens with dashes, got '${le.id}'`)}}function I(je){return new J(je)}function C(je,le){return"id"in je?{api:je,deps:{},factory:()=>le}:je}var oe;(function(je){je.SignedIn="SignedIn",je.SignedOut="SignedOut"})(oe||(oe={}));const ee=I({id:"core.auth.google"}),ne=I({id:"core.auth.github"}),$=I({id:"core.auth.okta"}),T=I({id:"core.auth.gitlab"}),P=I({id:"core.auth.microsoft"}),L=I({id:"core.auth.onelogin"}),O=I({id:"core.auth.bitbucket"}),re=I({id:"core.auth.bitbucket-server"}),Pe=I({id:"core.auth.atlassian"}),We=I({id:"core.alert"}),z=I({id:"core.analytics"}),xt=I({id:"core.apptheme"}),st=I({id:"core.config"}),Ke=I({id:"core.discovery"}),it=I({id:"core.error"});var nt;(function(je){je[je.None=0]="None",je[je.Active=1]="Active"})(nt||(nt={}));const bt=I({id:"core.featureflags"}),St=I({id:"core.fetch"}),pt=I({id:"core.identity"}),ft=I({id:"core.oauthrequest"}),wt=I({id:"core.storage"});class $t{setContext(le){this.context=le}captureEvent(le,Oe,{value:Ue,attributes:qe}={}){try{this.analyticsApi.captureEvent({action:le,subject:Oe,value:Ue,attributes:qe,context:this.context})}catch(_){console.warn("Error during analytics event capture. %o",_)}}constructor(le,Oe={routeRef:"unknown",pluginId:"root",extension:"App"}){(0,V._)(this,"analyticsApi",void 0),(0,V._)(this,"context",void 0),this.analyticsApi=le,this.context=Oe}}function Ve(){try{return ye(z)}catch{return{captureEvent:()=>{}}}}function qt(){const je=(0,H.useRef)(null),le=W(),Oe=Ve();function Ue(){return je.current===null&&(je.current=new $t(Oe)),je.current}const qe=Ue();return qe.setContext(le),qe}const ge=()=>{const je=(0,h.Vt)("app-context");if(!je)throw new Error("App context is not available");const le=je.atVersion(1);if(!le)throw new Error("AppContext v1 not available");return le},be=(0,h.uW)("component-data-store",()=>new WeakMap),Fe="__backstage_data";function Je(je,le,Oe){const Ue=je;var qe;let _=(qe=Ue[Fe])!==null&&qe!==void 0?qe:be.get(je);if(_||(_={map:new Map},Object.defineProperty(Ue,Fe,{enumerable:!1,configurable:!0,writable:!1,value:_}),be.set(je,_)),_.map.has(le)){const N=je.displayName||je.name;throw new Error(`Attempted to attach duplicate data "${le}" to component "${N}"`)}_.map.set(le,Oe)}function vt(je,le){if(!je)return;const Oe=je.type;if(!Oe)return;var Ue;const qe=(Ue=Oe[Fe])!==null&&Ue!==void 0?Ue:be.get(Oe);if(qe)return qe.map.get(le)}const Ot=(0,h.uW)("route-ref-type",()=>Symbol("route-ref-type"));let ht=Ot,Rt=ht;class Ft{get title(){return this.id}toString(){return`routeRef{type=absolute,id=${this.id}}`}constructor(le,Oe){(0,V._)(this,"id",void 0),(0,V._)(this,"params",void 0),(0,V._)(this,Rt,void 0),this.id=le,this.params=Oe,this[ht]="absolute"}}function Yt(je){var le;return new Ft(je.id,(le=je.params)!==null&&le!==void 0?le:[])}const kt=/^\w+$/;let dn=null,Kt=null;class un{toString(){return`routeRef{type=sub,id=${this.id}}`}constructor(le,Oe,Ue,qe){_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,Kt,void 0),this.id=le,this.path=Oe,this.parent=Ue,this.params=qe,this[dn]="sub"}}function Mn(je){const{id:le,path:Oe,parent:Ue}=je,qe=Oe.split("/").filter(ve=>ve.startsWith(":")).map(ve=>ve.substring(1)),_=[...Ue.params,...qe];if(Ue.params.some(ve=>qe.includes(ve)))throw new Error("SubRouteRef may not have params that overlap with its parent");if(!Oe.startsWith("/"))throw new Error(`SubRouteRef path must start with '/', got '${Oe}'`);if(Oe.endsWith("/"))throw new Error(`SubRouteRef path must not end with '/', got '${Oe}'`);for(const ve of qe)if(!kt.test(ve))throw new Error(`SubRouteRef path has invalid param, got '${ve}'`);return new un(le,Oe,Ue,_)}let Bn=Ot,xn=Bn;class $n{toString(){return`routeRef{type=external,id=${this.id}}`}constructor(le,Oe,Ue){(0,V._)(this,"id",void 0),(0,V._)(this,"params",void 0),(0,V._)(this,"optional",void 0),(0,V._)(this,xn,void 0),this.id=le,this.params=Oe,this.optional=Ue,this[Bn]="external"}}function Dn(je){var le;return new $n(je.id,(le=je.params)!==null&&le!==void 0?le:[],Boolean(je.optional))}var on=r(73557);function wn(je){const{pathname:le}=(0,on.TH)(),Oe=(0,h.Vt)("routing-context");if(!Oe)throw new Error("Routing context is not available");const Ue=Oe.atVersion(1),qe=(0,H.useMemo)(()=>Ue&&Ue.resolve(je,{pathname:le}),[Ue,je,le]);if(!Oe)throw new Error("useRouteRef used outside of routing context");if(!Ue)throw new Error("RoutingContext v1 not available");const _="optional"in je&&je.optional;if(!qe&&!_)throw new Error(`No path for ${je}`);return qe}function zn(je){return(0,on.UO)()}class ut extends H.Component{static getDerivedStateFromError(le){return{error:le}}render(){const{error:le}=this.state,{app:Oe,plugin:Ue}=this.props,{ErrorBoundaryFallback:qe}=Oe.getComponents();return le?(0,t.jsx)(qe,{error:le,resetError:this.handleErrorReset,plugin:Ue}):this.props.children}constructor(...le){super(...le),(0,V._)(this,"state",{error:void 0}),(0,V._)(this,"handleErrorReset",()=>{this.setState({error:void 0})})}}var _t=r(64355);function Wt(je){const{component:le,mountPoint:Oe,name:Ue}=je;return bn({component:{lazy:()=>le().then(qe=>{const _=ve=>{try{wn(Oe)}catch($e){if(typeof $e=="object"&&$e!==null){const{message:et}=$e;if(typeof et=="string"&&et.startsWith("No path for "))throw new Error(`Routable extension component with mount point ${Oe} 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 $e}return(0,t.jsx)(qe,{...ve})},N=Ue||qe.displayName||qe.name||"LazyComponent";return _.displayName=`RoutableExtension(${N})`,_},qe=>N=>{const ve=ge(),{BootErrorPage:$e}=ve.getComponents();return(0,t.jsx)($e,{step:"load-chunk",error:qe})})},data:{"core.mountPoint":Oe},name:Ue})}function dt(je){const{component:le,name:Oe}=je;return bn({component:le,name:Oe})}function bn(je){const{data:le={},name:Oe}=je;Oe||console.warn("Declaring extensions without name is DEPRECATED. Make sure that all usages of createReactExtension, createComponentExtension and createRoutableExtension provide a name.");let Ue;if("lazy"in je.component){const _=je.component.lazy;Ue=(0,H.lazy)(()=>_().then(N=>({default:N})))}else Ue=je.component.sync;const qe=Oe||Ue.displayName||Ue.name||"Component";return{expose(_){const N=ve=>{const $e=ge(),{Progress:et}=$e.getComponents(),at=le==null?void 0:le["core.mountPoint"];return(0,t.jsx)(H.Suspense,{fallback:(0,t.jsx)(et,{}),children:(0,t.jsx)(ut,{app:$e,plugin:_,children:(0,t.jsx)(g,{attributes:{pluginId:_.getId(),...Oe&&{extension:Oe},...at&&{routeRef:at.id}},children:(0,t.jsx)(_t.o,{plugin:_,children:(0,t.jsx)(Ue,{...ve})})})})})};Je(N,"core.plugin",_),Je(N,"core.extensionName",Oe);for(const[ve,$e]of Object.entries(le))Je(N,ve,$e);return N.displayName=`Extension(${qe})`,N}}}function Vt(je,le,Oe,Ue){return H.Children.toArray(je).flatMap(qe=>{if(!(0,H.isValidElement)(qe))return[];if(qe.type===H.Fragment)return Vt(qe.props.children,le,Oe,Ue);if(vt(qe,"core.featureFlagged")){const _=qe.props;return("with"in _?le.isActive(_.with):!le.isActive(_.without))?Vt(qe.props.children,le,Oe,Ue):[]}if(Oe===void 0||Oe(qe))return[qe];if(Ue)throw new Error(Ue);return Vt(qe.props.children,le,Oe,Ue)})}class hn{selectByComponentData(le){const Oe=Vt(this.node,this.featureFlagsApi,Ue=>vt(Ue,le.key)!==void 0,le.withStrictError);return new hn(Oe,this.featureFlagsApi)}findComponentData(le){return Vt(this.node,this.featureFlagsApi,Ue=>vt(Ue,le.key)!==void 0).map(Ue=>vt(Ue,le.key)).filter(Ue=>Ue!==void 0)}getElements(){return Vt(this.node,this.featureFlagsApi)}constructor(le,Oe){(0,V._)(this,"node",void 0),(0,V._)(this,"featureFlagsApi",void 0),this.node=le,this.featureFlagsApi=Oe}}function jn(je,le,Oe=[]){const Ue=ye(bt),qe=new hn(je,Ue);return(0,H.useMemo)(()=>le(qe),[je,...Oe])}class an{getId(){return this.config.id}getApis(){var le;return(le=this.config.apis)!==null&&le!==void 0?le:[]}getFeatureFlags(){var le,Oe;return(Oe=(le=this.config.featureFlags)===null||le===void 0?void 0:le.slice())!==null&&Oe!==void 0?Oe:[]}get routes(){var le;return(le=this.config.routes)!==null&&le!==void 0?le:{}}get externalRoutes(){var le;return(le=this.config.externalRoutes)!==null&&le!==void 0?le:{}}provide(le){return le.expose(this)}__experimentalReconfigure(le){this.config.__experimentalConfigure&&(this.options=this.config.__experimentalConfigure(le))}getPluginOptions(){this.config.__experimentalConfigure&&!this.options&&(this.options=this.config.__experimentalConfigure());var le;return(le=this.options)!==null&&le!==void 0?le:{}}toString(){return`plugin{${this.config.id}}`}constructor(le){(0,V._)(this,"config",void 0),(0,V._)(this,"options",void 0),this.config=le,this.options=void 0}}function Yn(je){return new an(je)}},64355:function(Ct,Be,r){"use strict";r.d(Be,{o:function(){return W},y:function(){return g}});var t=r(52322),h=r(51837),H=r(2784);const f="plugin-context",W=d=>{const{children:B,plugin:ye}=d,{Provider:ue}=(0,h.CT)(f);return(0,t.jsx)(ue,{value:(0,h.EI)({1:{plugin:ye}}),children:B})};function g(){const d=(0,h.Vt)(f);if(!d)throw new Error("Plugin Options context is not available");const B=d.atVersion(1);if(!B)throw new Error("Plugin Options v1 is not available");return B.plugin.getPluginOptions()}},23054:function(Ct,Be,r){"use strict";r.d(Be,{SP:function(){return ee},dR:function(){return J},VL:function(){return $},BD:function(){return h}});function t(T){if(typeof T!="object"||T===null||Array.isArray(T))return!1;const P=T;return!(typeof P.name!="string"||P.name===""||typeof P.message!="string")}function h(T){if(typeof T!="object"||T===null||Array.isArray(T))throw new Error(`Encountered invalid error, not an object, got '${T}'`);const P=T;if(typeof P.name!="string"||P.name==="")throw new Error(`Encountered error object without a name, got '${T}'`);if(typeof P.message!="string")throw new Error(`Encountered error object without a message, got '${T}'`)}var H=r(87612),f=r(24852);function W(T,P){const O={name:"Unknown",message:"<no reason given>",...serializeErrorInternal(T)};return P!=null&&P.includeStack||delete O.stack,O}function g(T){const P=(0,f.deserializeError)(T);return T.stack||(P.stack=void 0),P}function d(T){if(t(T)){const P=String(T);return P!=="[object Object]"?P:`${T.name}: ${T.message}`}return`unknown error '${T}'`}class B extends Error{constructor(P,L){var O;let re=P;if(L!==void 0){const Pe=d(L);re?re+=`; caused by ${Pe}`:re=`caused by ${Pe}`}super(re),(0,H._)(this,"cause",void 0),(O=Error.captureStackTrace)===null||O===void 0||O.call(Error,this,this.constructor),this.name=this.constructor.name,this.cause=t(L)?L:void 0}}class ye extends null{}class ue extends null{}class V extends null{}class J extends B{}class I extends null{}class C extends null{}class oe extends null{}class ee extends B{constructor(P,L){super(P,L),this.name=t(L)?L.name:"Error"}}async function ne(T){try{const L=await T.text();if(L){var P;if(!((P=T.headers.get("content-type"))===null||P===void 0)&&P.startsWith("application/json"))try{const O=JSON.parse(L);if(O.error&&O.response)return O}catch{}return{error:{name:"Error",message:`Request failed with status ${T.status} ${T.statusText}, ${L}`},response:{statusCode:T.status}}}}catch{}return{error:{name:"Error",message:`Request failed with status ${T.status} ${T.statusText}`},response:{statusCode:T.status}}}class $ extends Error{static async fromResponse(P){const L=await ne(P),O=L.response.statusCode||P.status,re=L.error.name||P.statusText,Pe=`Request failed with ${O} ${re}`,We=g(L.error);return new $({message:Pe,response:P,data:L,cause:We})}constructor(P){super(P.message),(0,H._)(this,"response",void 0),(0,H._)(this,"body",void 0),(0,H._)(this,"cause",void 0),this.name="ResponseError",this.response=P.response,this.body=P.data,this.cause=P.cause}}},32838:function(Ct,Be,r){"use strict";r.d(Be,{nW:function(){return ee},ae:function(){return V},q3:function(){return J}});var t=r(60871);const h=(0,t.T0)({id:"core.scmauth"});var H=new WeakMap;class f{async getCredentials($){const T=new URL($.url),P=_class_private_field_get(this,H).find(L=>L.isUrlSupported(T));if(!P)throw new Error(`No auth provider available for '${$.url}', see https://backstage.io/link?scm-auth`);return P.getCredentials($)}constructor($){_class_private_field_init(this,H,{writable:!0,value:void 0}),_class_private_field_set(this,H,$)}}var W=new WeakMap,g=new WeakMap,d=new WeakMap,B=new WeakMap;class ye{static createDefaultApiFactory(){return createApiFactory({api:scmAuthApiRef,deps:{github:githubAuthApiRef,gitlab:gitlabAuthApiRef,azure:microsoftAuthApiRef,bitbucket:bitbucketAuthApiRef},factory:({github:$,gitlab:T,azure:P,bitbucket:L})=>ye.merge(ye.forGithub($),ye.forGitlab(T),ye.forAzure(P),ye.forBitbucket(L))})}static forAuthApi($,T){return new ye("generic",$,T.host,T.scopeMapping)}static forGithub($,T){var P;const L=(P=T==null?void 0:T.host)!==null&&P!==void 0?P:"github.com";return new ye("github",$,L,{default:["repo","read:org","read:user"],repoWrite:["gist"]})}static forGitlab($,T){var P;const L=(P=T==null?void 0:T.host)!==null&&P!==void 0?P:"gitlab.com";return new ye("gitlab",$,L,{default:["read_user","read_api","read_repository"],repoWrite:["write_repository","api"]})}static forAzure($,T){var P;const L=(P=T==null?void 0:T.host)!==null&&P!==void 0?P:"dev.azure.com";return new ye("azure",$,L,{default:["vso.build","vso.code","vso.graph","vso.project","vso.profile"],repoWrite:["vso.code_manage"]})}static forBitbucket($,T){var P;const L=(P=T==null?void 0:T.host)!==null&&P!==void 0?P:"bitbucket.org";return new ye("bitbucket",$,L,{default:["account","team","pullrequest","snippet","issue"],repoWrite:["pullrequest:write","snippet:write","issue:write"]})}static merge(...$){return new f($)}isUrlSupported($){return $.host===_class_private_field_get(this,g)}getAdditionalScopesForProvider($){var T;if(!($!=null&&$.customScopes)||_class_private_field_get(this,B)==="generic")return[];var P;return(P=(T=$.customScopes)===null||T===void 0?void 0:T[_class_private_field_get(this,B)])!==null&&P!==void 0?P:[]}async getCredentials($){const{url:T,additionalScope:P,...L}=$,O=_class_private_field_get(this,d).default.slice();P!=null&&P.repoWrite&&O.push(..._class_private_field_get(this,d).repoWrite);const re=this.getAdditionalScopesForProvider(P);re.length&&O.push(...re);const Pe=[...new Set(O)],We=await _class_private_field_get(this,W).getAccessToken(Pe,L);return{token:We,headers:{Authorization:`Bearer ${We}`}}}constructor($,T,P,L){_class_private_field_init(this,W,{writable:!0,value:void 0}),_class_private_field_init(this,g,{writable:!0,value:void 0}),_class_private_field_init(this,d,{writable:!0,value:void 0}),_class_private_field_init(this,B,{writable:!0,value:void 0}),_class_private_field_set(this,W,T),_class_private_field_set(this,g,P),_class_private_field_set(this,d,L),_class_private_field_set(this,B,$)}}var ue=r(79158);class V{static fromConfig($){return ue.Lx.fromConfig($)}}const J=(0,t.T0)({id:"integration.scmintegrations"});var I=r(52322),C=r(73250),oe=r(2784);const ee=ne=>{const{type:$}=ne,T=(0,t.qD)(),P=C.Z;var L;const O=$&&(L=T.getSystemIcon($))!==null&&L!==void 0?L:P;return(0,I.jsx)(O,{})}},79158:function(Ct,Be,r){"use strict";r.d(Be,{Lx:function(){return rr},BT:function(){return lt}});var t=r(87612),h=r(82717),H=r.n(h),f=r(76635);function W(S){const c=new URL("http://example.com");return c.host=S,c.host===S}function g(S){try{return new URL(S),!0}catch{return!1}}function d(S,c){return{list(){return S},byUrl(x){try{const j=typeof x=="string"?new URL(x):x;return S.find(Q=>c(Q)===j.host)}catch{return}},byHost(x){return S.find(j=>c(j)===x)}}}function B(S){const{url:c,base:x,lineNumber:j}=S;try{return new URL(c),c}catch{}let Q;if(c.startsWith("/")){const{filepath:Se}=H()(x);Q=new URL(x);const we=(0,f.trimEnd)(Q.pathname.substring(0,Q.pathname.length-Se.length),"/");Q.pathname=`${we}${c}`}else Q=new URL(c,x);return Q.search=new URL(x).search,j&&(Q.hash=`L${j}`),Q.toString()}function ye(S){beforeAll(()=>S.listen({onUnhandledRequest:"error"})),afterAll(()=>S.close()),afterEach(()=>S.resetHandlers())}const ue="amazonaws.com";function V(S){const c=S.getOptionalString("endpoint");var x;const j=(x=S.getOptionalBoolean("s3ForcePathStyle"))!==null&&x!==void 0?x:!1;let Q,Se;if(c){try{const gn=new URL(c);Q=gn.host,Se=gn.pathname}catch{throw new Error(`invalid awsS3 integration config, endpoint '${c}' is not a valid URL`)}if(Se!=="/")throw new Error(`invalid awsS3 integration config, endpoints cannot contain path, got '${c}'`)}else Q=ue;const we=S.getOptionalString("accessKeyId"),Ze=S.getOptionalString("secretAccessKey"),Ge=S.getOptionalString("roleArn"),Gt=S.getOptionalString("externalId");return{host:Q,endpoint:c,s3ForcePathStyle:j,accessKeyId:we,secretAccessKey:Ze,roleArn:Ge,externalId:Gt}}function J(S){const c=S.map(V);return c.some(x=>x.host===ue)||c.push({host:ue}),c}class I{get type(){return"awsS3"}get title(){return this.integrationConfig.host}get config(){return this.integrationConfig}resolveUrl(c){return B(c)}resolveEditUrl(c){return c}constructor(c){(0,t._)(this,"integrationConfig",void 0),this.integrationConfig=c}}(0,t._)(I,"factory",({config:S})=>{var c;const x=J((c=S.getOptionalConfigArray("integrations.awsS3"))!==null&&c!==void 0?c:[]);return d(x.map(j=>new I(j)),j=>j.config.host)});var C=r(88412),oe=r(50629),ee=r(80956);const ne="GB";var $=new WeakMap,T=new WeakMap,P=new WeakMap,L=new WeakMap,O=new WeakMap,re=new WeakMap,Pe=new WeakMap;class We{static fromRepoUrl(c){const x=new URL(c);let j,Q,Se;const we=x.pathname.split("/").map(Vn=>decodeURIComponent(Vn));if(we[2]==="_git"?(j=we[1],Q=Se=we[3]):we[3]==="_git"?(j=we[1],Q=we[2],Se=we[4]):we[4]==="_git"&&(j=`${we[1]}/${we[2]}`,Q=we[3],Se=we[5]),!j||!Q||!Se)throw new Error("Azure URL must point to a git repository");var Ze;const Ge=(Ze=x.searchParams.get("path"))!==null&&Ze!==void 0?Ze:void 0;let Gt;const gn=x.searchParams.get("version");if(gn){if(gn.slice(0,2)!=="GB")throw new Error("Azure URL version must point to a git branch");Gt=gn.slice(2)}return new We(x.origin,j,Q,Se,Ge,Gt)}toRepoUrl(){let c;return(0,C._)(this,P)===(0,C._)(this,L)?c=(0,C._)(this,Pe).call(this,(0,C._)(this,T),"_git",(0,C._)(this,L)):c=(0,C._)(this,Pe).call(this,(0,C._)(this,T),(0,C._)(this,P),"_git",(0,C._)(this,L)),(0,C._)(this,O)&&c.searchParams.set("path",(0,C._)(this,O)),(0,C._)(this,re)&&c.searchParams.set("version",ne+(0,C._)(this,re)),c.toString()}toFileUrl(){if(!(0,C._)(this,O))throw new Error("Azure URL must point to a specific path to be able to download a file");const c=(0,C._)(this,Pe).call(this,(0,C._)(this,T),(0,C._)(this,P),"_apis","git","repositories",(0,C._)(this,L),"items");return c.searchParams.set("api-version","6.0"),c.searchParams.set("path",(0,C._)(this,O)),(0,C._)(this,re)&&c.searchParams.set("version",(0,C._)(this,re)),c.toString()}toArchiveUrl(){const c=(0,C._)(this,Pe).call(this,(0,C._)(this,T),(0,C._)(this,P),"_apis","git","repositories",(0,C._)(this,L),"items");return c.searchParams.set("recursionLevel","full"),c.searchParams.set("download","true"),c.searchParams.set("api-version","6.0"),(0,C._)(this,O)&&c.searchParams.set("scopePath",(0,C._)(this,O)),(0,C._)(this,re)&&c.searchParams.set("version",(0,C._)(this,re)),c.toString()}toCommitsUrl(){const c=(0,C._)(this,Pe).call(this,(0,C._)(this,T),(0,C._)(this,P),"_apis","git","repositories",(0,C._)(this,L),"commits");return c.searchParams.set("api-version","6.0"),(0,C._)(this,re)&&c.searchParams.set("searchCriteria.itemVersion.version",(0,C._)(this,re)),c.toString()}getOwner(){return(0,C._)(this,T)}getProject(){return(0,C._)(this,P)}getRepo(){return(0,C._)(this,L)}getPath(){return(0,C._)(this,O)}getRef(){return(0,C._)(this,re)}constructor(c,x,j,Q,Se,we){(0,oe._)(this,$,{writable:!0,value:void 0}),(0,oe._)(this,T,{writable:!0,value:void 0}),(0,oe._)(this,P,{writable:!0,value:void 0}),(0,oe._)(this,L,{writable:!0,value:void 0}),(0,oe._)(this,O,{writable:!0,value:void 0}),(0,oe._)(this,re,{writable:!0,value:void 0}),(0,oe._)(this,Pe,{writable:!0,value:(...Ze)=>{const Ge=new URL((0,C._)(this,$));return Ge.pathname=Ze.map(Gt=>encodeURIComponent(Gt)).join("/"),Ge}}),(0,ee._)(this,$,c),(0,ee._)(this,T,x),(0,ee._)(this,P,j),(0,ee._)(this,L,Q),(0,ee._)(this,O,Se),(0,ee._)(this,re,we)}}const z="dev.azure.com";function xt(S){var c;const x=(c=S.getOptionalString("host"))!==null&&c!==void 0?c:z,j=S.getOptionalString("token");if(!W(x))throw new Error(`Invalid Azure integration config, '${x}' is not a valid host`);return{host:x,token:j}}function st(S){const c=S.map(xt);return c.some(x=>x.host===z)||c.push({host:z}),c}class Ke{get type(){return"azure"}get title(){return this.integrationConfig.host}get config(){return this.integrationConfig}resolveUrl(c){const{url:x,base:j}=c;if(g(x))return x;try{const Se=We.fromRepoUrl(j),we=new URL(j);var Q;const Ze=new URL(`https://a.com${(Q=Se.getPath())!==null&&Q!==void 0?Q:""}`),Ge=new URL(x,Ze).pathname;return we.searchParams.set("path",Ge),c.lineNumber&&(we.searchParams.set("line",String(c.lineNumber)),we.searchParams.set("lineEnd",String(c.lineNumber+1)),we.searchParams.set("lineStartColumn","1"),we.searchParams.set("lineEndColumn","1")),we.toString()}catch{return new URL(x,j).toString()}}resolveEditUrl(c){return c}constructor(c){(0,t._)(this,"integrationConfig",void 0),this.integrationConfig=c}}(0,t._)(Ke,"factory",({config:S})=>{var c;const x=st((c=S.getOptionalConfigArray("integrations.azure"))!==null&&c!==void 0?c:[]);return d(x.map(j=>new Ke(j)),j=>j.config.host)});var it=r(48834).lW;function nt(S){return AzureUrl.fromRepoUrl(S).toFileUrl()}function bt(S){return AzureUrl.fromRepoUrl(S).toArchiveUrl()}function St(S){return AzureUrl.fromRepoUrl(S).toCommitsUrl()}function pt(S,c){const x=c?{...c}:{};if(S.token){const j=it.from(`:${S.token}`,"utf8");x.Authorization=`Basic ${j.toString("base64")}`}return{headers:x}}const ft="bitbucket.org",wt="https://api.bitbucket.org/2.0";function $t(S){var c;const x=(c=S.getOptionalString("host"))!==null&&c!==void 0?c:ft;let j=S.getOptionalString("apiBaseUrl");const Q=S.getOptionalString("token"),Se=S.getOptionalString("username"),we=S.getOptionalString("appPassword");if(!W(x))throw new Error(`Invalid Bitbucket integration config, '${x}' is not a valid host`);return j?j=(0,f.trimEnd)(j,"/"):x===ft?j=wt:j=`https://${x}/rest/api/1.0`,{host:x,apiBaseUrl:j,token:Q,username:Se,appPassword:we}}function Ve(S){const c=S.map($t);return c.some(x=>x.host===ft)||c.push({host:ft,apiBaseUrl:wt}),c}class qt{get type(){return"bitbucket"}get title(){return this.integrationConfig.host}get config(){return this.integrationConfig}resolveUrl(c){const x=B(c);if(!c.lineNumber)return x;const j=new URL(x);return this.integrationConfig.host==="bitbucket.org"?j.hash=`lines-${c.lineNumber}`:j.hash=`${c.lineNumber}`,j.toString()}resolveEditUrl(c){const x=H()(c),j=new URL(c);return j.searchParams.set("mode","edit"),j.searchParams.set("spa","0"),j.searchParams.set("at",x.ref),j.toString()}constructor(c){(0,t._)(this,"integrationConfig",void 0),this.integrationConfig=c}}(0,t._)(qt,"factory",({config:S})=>{var c,x,j;const Q=Ve((j=S.getOptionalConfigArray("integrations.bitbucket"))!==null&&j!==void 0?j:[...(c=S.getOptionalConfigArray("integrations.bitbucketCloud"))!==null&&c!==void 0?c:[],...(x=S.getOptionalConfigArray("integrations.bitbucketServer"))!==null&&x!==void 0?x:[]]);return d(Q.map(Se=>new qt(Se)),Se=>Se.config.host)});var ge=r(96279),be=r(48834).lW;async function Fe(S,c){const{name:x,owner:j,resource:Q}=parseGitUrl(S),Se=Q==="bitbucket.org";let we=Se?`${c.apiBaseUrl}/repositories/${j}/${x}`:`${c.apiBaseUrl}/projects/${j}/repos/${x}/default-branch`,Ze=await fetch(we,Ot(c));if(Ze.status===404&&!Se&&(we=`${c.apiBaseUrl}/projects/${j}/repos/${x}/branches/default`,Ze=await fetch(we,Ot(c))),!Ze.ok){const Gt=`Failed to retrieve default branch from ${we}, ${Ze.status} ${Ze.statusText}`;throw new Error(Gt)}let Ge;if(Se)Ge=(await Ze.json()).mainbranch.name;else{const{displayId:Gt}=await Ze.json();Ge=Gt}if(!Ge)throw new Error(`Failed to read default branch from ${we}. Response ${Ze.status} ${Ze.json()}`);return Ge}async function Je(S,c){const{name:x,owner:j,ref:Q,protocol:Se,resource:we,filepath:Ze}=parseGitUrl(S),Ge=we==="bitbucket.org";let Gt=Q;Gt||(Gt=await Fe(S,c));const gn=Ze?`&path=${encodeURIComponent(decodeURIComponent(Ze))}`:"";return Ge?`${Se}://${we}/${j}/${x}/get/${Gt}.tar.gz`:`${c.apiBaseUrl}/projects/${j}/repos/${x}/archive?format=tgz&at=${Gt}&prefix=${j}-${x}${gn}`}function vt(S,c){try{const{owner:x,name:j,ref:Q,filepathtype:Se,filepath:we}=parseGitUrl(S);if(!x||!j||Se!=="browse"&&Se!=="raw"&&Se!=="src")throw new Error("Invalid Bitbucket URL or file path");const Ze=we.replace(/^\//,"");if(c.host==="bitbucket.org"){if(!Q)throw new Error("Invalid Bitbucket URL or file path");return`${c.apiBaseUrl}/repositories/${x}/${j}/src/${Q}/${Ze}`}return`${c.apiBaseUrl}/projects/${x}/repos/${j}/raw/${Ze}?at=${Q}`}catch(x){throw new Error(`Incorrect URL: ${S}, ${x}`)}}function Ot(S){const c={};if(S.token)c.Authorization=`Bearer ${S.token}`;else if(S.username&&S.appPassword){const x=be.from(`${S.username}:${S.appPassword}`,"utf8");c.Authorization=`Basic ${x.toString("base64")}`}return{headers:c}}const ht="bitbucket.org",Rt="https://api.bitbucket.org/2.0";function Ft(S){const c=ht,x=Rt,j=S.getString("username"),Q=S.getString("appPassword");return{host:c,apiBaseUrl:x,username:j,appPassword:Q}}function Yt(S){const c=S.map(Ft);return c.length===0&&c.push({host:ht,apiBaseUrl:Rt}),c}class kt{get type(){return"bitbucketCloud"}get title(){return this.integrationConfig.host}get config(){return this.integrationConfig}resolveUrl(c){const x=B(c);if(c.lineNumber){const j=new URL(x);return j.hash=`lines-${c.lineNumber}`,j.toString()}return x}resolveEditUrl(c){const x=H()(c),j=new URL(c);return j.searchParams.set("mode","edit"),j.searchParams.set("at",x.ref),j.toString()}constructor(c){(0,t._)(this,"integrationConfig",void 0),this.integrationConfig=c}}(0,t._)(kt,"factory",({config:S})=>{var c;const x=Yt((c=S.getOptionalConfigArray("integrations.bitbucketCloud"))!==null&&c!==void 0?c:[]);return d(x.map(j=>new kt(j)),j=>j.config.host)});var dn=r(48834).lW;async function Kt(S,c){const{name:x,owner:j}=parseGitUrl(S),Q=`${c.apiBaseUrl}/repositories/${j}/${x}`,Se=await fetch(Q,Bn(c));if(!Se.ok){const Ge=`Failed to retrieve default branch from ${Q}, ${Se.status} ${Se.statusText}`;throw new Error(Ge)}const Ze=(await Se.json()).mainbranch.name;if(!Ze)throw new Error(`Failed to read default branch from ${Q}. Response ${Se.status} ${Se.json()}`);return Ze}async function un(S,c){const{name:x,owner:j,ref:Q,protocol:Se,resource:we}=parseGitUrl(S);let Ze=Q;return Ze||(Ze=await Kt(S,c)),`${Se}://${we}/${j}/${x}/get/${Ze}.tar.gz`}function Mn(S,c){try{const{owner:x,name:j,ref:Q,filepathtype:Se,filepath:we}=parseGitUrl(S);if(!x||!j||Se!=="src"&&Se!=="raw")throw new Error("Invalid Bitbucket Cloud URL or file path");const Ze=we.replace(/^\//,"");if(!Q)throw new Error("Invalid Bitbucket Cloud URL or file path");return`${c.apiBaseUrl}/repositories/${x}/${j}/src/${Q}/${Ze}`}catch(x){throw new Error(`Incorrect URL: ${S}, ${x}`)}}function Bn(S){const c={};if(S.username&&S.appPassword){const x=dn.from(`${S.username}:${S.appPassword}`,"utf8");c.Authorization=`Basic ${x.toString("base64")}`}return{headers:c}}function xn(S){const c=S.getString("host");let x=S.getOptionalString("apiBaseUrl");const j=S.getOptionalString("token"),Q=S.getOptionalString("username"),Se=S.getOptionalString("password");if(!W(c))throw new Error(`Invalid Bitbucket Server integration config, '${c}' is not a valid host`);return x?x=(0,f.trimEnd)(x,"/"):x=`https://${c}/rest/api/1.0`,{host:c,apiBaseUrl:x,token:j,username:Q,password:Se}}function $n(S){return S.map(xn)}class Dn{get type(){return"bitbucketServer"}get title(){return this.integrationConfig.host}get config(){return this.integrationConfig}resolveUrl(c){const x=B(c);if(c.lineNumber){const j=new URL(x);return j.hash=c.lineNumber.toString(),j.toString()}return x}resolveEditUrl(c){return c.includes("?")?c.substring(0,c.indexOf("?")):c}constructor(c){(0,t._)(this,"integrationConfig",void 0),this.integrationConfig=c}}(0,t._)(Dn,"factory",({config:S})=>{var c;const x=$n((c=S.getOptionalConfigArray("integrations.bitbucketServer"))!==null&&c!==void 0?c:[]);return d(x.map(j=>new Dn(j)),j=>j.config.host)});var on=r(48834).lW;async function wn(S,c){const{name:x,owner:j}=parseGitUrl(S);let Q=`${c.apiBaseUrl}/projects/${j}/repos/${x}/default-branch`,Se=await fetch(Q,_t(c));if(Se.status===404&&(Q=`${c.apiBaseUrl}/projects/${j}/repos/${x}/branches/default`,Se=await fetch(Q,_t(c))),!Se.ok){const Ge=`Failed to retrieve default branch from ${Q}, ${Se.status} ${Se.statusText}`;throw new Error(Ge)}const{displayId:we}=await Se.json(),Ze=we;if(!Ze)throw new Error(`Failed to read default branch from ${Q}. Response ${Se.status} ${Se.json()}`);return Ze}async function zn(S,c){const{name:x,owner:j,ref:Q,filepath:Se}=parseGitUrl(S);let we=Q;we||(we=await wn(S,c));const Ze=Se?`&path=${encodeURIComponent(decodeURIComponent(Se))}`:"";return`${c.apiBaseUrl}/projects/${j}/repos/${x}/archive?format=tgz&at=${we}&prefix=${j}-${x}${Ze}`}function ut(S,c){try{const{owner:x,name:j,ref:Q,filepathtype:Se,filepath:we}=parseGitUrl(S);if(!x||!j||Se!=="browse"&&Se!=="raw"&&Se!=="src")throw new Error("Invalid Bitbucket Server URL or file path");const Ze=we.replace(/^\//,"");return`${c.apiBaseUrl}/projects/${x}/repos/${j}/raw/${Ze}?at=${Q}`}catch(x){throw new Error(`Incorrect URL: ${S}, ${x}`)}}function _t(S){const c={};if(S.token)c.Authorization=`Bearer ${S.token}`;else if(S.username&&S.password){const x=on.from(`${S.username}:${S.password}`,"utf8");c.Authorization=`Basic ${x.toString("base64")}`}return{headers:c}}function Wt(S){const c=S.getString("host");let x=S.getOptionalString("baseUrl"),j=S.getOptionalString("cloneUrl"),Q=S.getOptionalString("gitilesBaseUrl");const Se=S.getOptionalString("username"),we=S.getOptionalString("password");if(W(c)){if(x&&!g(x))throw new Error(`Invalid Gerrit integration config, '${x}' is not a valid baseUrl`);if(j&&!g(j))throw new Error(`Invalid Gerrit integration config, '${j}' is not a valid cloneUrl`);if(Q&&!g(Q))throw new Error(`Invalid Gerrit integration config, '${Q}' is not a valid gitilesBaseUrl`)}else throw new Error(`Invalid Gerrit integration config, '${c}' is not a valid host`);return x?x=(0,f.trimEnd)(x,"/"):x=`https://${c}`,Q?Q=(0,f.trimEnd)(Q,"/"):Q=`https://${c}`,j?j=(0,f.trimEnd)(j,"/"):j=x,{host:c,baseUrl:x,cloneUrl:j,gitilesBaseUrl:Q,username:Se,password:we}}function dt(S){return S.map(Wt)}var bn=r(48834).lW;const Vt=")]}'";function hn(S,c){const j=c.replace(S.gitilesBaseUrl,"").split("/").filter(Gt=>!!Gt),Q=j.indexOf("+");if(Q<=0)throw new Error(`Unable to parse project from url: ${c}`);const Se=(0,f.trimStart)(j.slice(0,Q).join("/"),"/"),we=j.indexOf("heads");if(we<=0)throw new Error(`Unable to parse branch from url: ${c}`);const Ze=j[we+1],Ge=j.slice(we+2).join("/");return{branch:Ze,filePath:Ge===""?"/":Ge,project:Se}}function jn(S,c,x,j){return`${S.gitilesBaseUrl}/${c}/+/refs/heads/${x}/${(0,f.trimStart)(j,"/")}`}function an(S){return S.password?"/a/":"/"}function Yn(S,c){const{branch:x,project:j}=hn(S,c);return`${S.baseUrl}${an(S)}projects/${encodeURIComponent(j)}/branches/${x}`}function je(S,c){const{project:x}=hn(S,c);return`${S.cloneUrl}${an(S)}${x}`}function le(S,c){const{branch:x,filePath:j,project:Q}=hn(S,c);return`${S.baseUrl}${an(S)}projects/${encodeURIComponent(Q)}/branches/${x}/files/${encodeURIComponent(j)}/content`}function Oe(S){return`${S.baseUrl}${an(S)}projects/`}function Ue(S){const c={};if(!S.password)return c;const x=bn.from(`${S.username}:${S.password}`,"utf8");return c.Authorization=`Basic ${x.toString("base64")}`,{headers:c}}async function qe(S){const c=await S.text();if(c.startsWith(Vt))try{return JSON.parse(c.slice(Vt.length))}catch(x){throw new Error(`Invalid response from Gerrit: ${c.slice(0,10)} - ${x}`)}throw new Error(`Gerrit JSON body prefix missing. Found: ${c.slice(0,10)}`)}class _{get type(){return"gerrit"}get title(){return this.integrationConfig.host}get config(){return this.integrationConfig}resolveUrl(c){const{url:x,base:j,lineNumber:Q}=c;let Se;if(x.startsWith("/")){const{branch:we,project:Ze}=hn(this.config,j);return jn(this.config,Ze,we,x)}return x?Se=new URL(x,j):Se=new URL(j),Q&&(Se.hash=Q.toString()),Se.toString()}resolveEditUrl(c){return c}constructor(c){(0,t._)(this,"integrationConfig",void 0),this.integrationConfig=c}}(0,t._)(_,"factory",({config:S})=>{var c;const x=dt((c=S.getOptionalConfigArray("integrations.gerrit"))!==null&&c!==void 0?c:[]);return d(x.map(j=>new _(j)),j=>j.config.host)});function N(S){const c=S.getString("host");let x=S.getOptionalString("baseUrl");const j=S.getOptionalString("username"),Q=S.getOptionalString("password");if(!W(c))throw new Error(`Invalid Gitea integration config, '${c}' is not a valid host`);return x?x=(0,f.trimEnd)(x,"/"):x=`https://${c}`,{host:c,baseUrl:x,username:j,password:Q}}var ve=r(48834).lW;function $e(S,c){try{var x;const j=(x=S.baseUrl)!==null&&x!==void 0?x:`https://${S.host}`,[Q,Se,we,Ze,Ge,Gt,...gn]=c.replace(j,"").split("/"),Vn=gn.join("/").replace(/^\//,"");return`${j}/${Se}/${we}/_edit/${Gt}/${Vn}`}catch(j){throw new Error(`Incorrect URL: ${c}, ${j}`)}}function et(S,c){try{var x;const j=(x=S.baseUrl)!==null&&x!==void 0?x:`https://${S.host}`,[Q,Se,we,Ze,Ge,Gt,...gn]=c.replace(j,"").split("/"),Vn=gn.join("/").replace(/^\//,"");return`${j}/api/v1/repos/${Se}/${we}/contents/${Vn}?ref=${Gt}`}catch(j){throw new Error(`Incorrect URL: ${c}, ${j}`)}}function at(S){const c={},{username:x,password:j}=S;return j?(x?c.Authorization=`basic ${ve.from(`${x}:${j}`).toString("base64")}`:c.Authorization=`token ${j}`,{headers:c}):c}class It{get type(){return"gitea"}get title(){return this.config.host}resolveUrl(c){return B(c)}resolveEditUrl(c){return $e(this.config,c)}constructor(c){(0,t._)(this,"config",void 0),this.config=c}}(0,t._)(It,"factory",({config:S})=>{var c;const j=((c=S.getOptionalConfigArray("integrations.gitea"))!==null&&c!==void 0?c:[]).map(Q=>N(Q));return d(j.map(Q=>new It(Q)),Q=>Q.config.host)});const Bt="github.com",tn="https://api.github.com",X="https://raw.githubusercontent.com";function K(S){var c,x;const j=(x=S.getOptionalString("host"))!==null&&x!==void 0?x:Bt;let Q=S.getOptionalString("apiBaseUrl"),Se=S.getOptionalString("rawBaseUrl");const we=S.getOptionalString("token"),Ze=(c=S.getOptionalConfigArray("apps"))===null||c===void 0?void 0:c.map(Ge=>({appId:Ge.getNumber("appId"),clientId:Ge.getString("clientId"),clientSecret:Ge.getString("clientSecret"),webhookSecret:Ge.getString("webhookSecret"),privateKey:Ge.getString("privateKey"),allowedInstallationOwners:Ge.getOptionalStringArray("allowedInstallationOwners")}));if(!W(j))throw new Error(`Invalid GitHub integration config, '${j}' is not a valid host`);return Q?Q=(0,f.trimEnd)(Q,"/"):j===Bt&&(Q=tn),Se?Se=(0,f.trimEnd)(Se,"/"):j===Bt&&(Se=X),{host:j,apiBaseUrl:Q,rawBaseUrl:Se,token:we,apps:Ze}}function se(S){const c=S.map(K);return c.some(x=>x.host===Bt)||c.push({host:Bt,apiBaseUrl:tn,rawBaseUrl:X}),c}function pe(S,c,x){try{const{owner:j,name:Q,ref:Se,filepathtype:we,filepath:Ze}=parseGitUrl(S);if(!j||!Q||!Se||we!=="blob"&&we!=="raw"&&we!=="tree")throw new Error("Invalid GitHub URL or file path");const Ge=Ze.replace(/^\//,"");return y(c,x)==="api"?`${c.apiBaseUrl}/repos/${j}/${Q}/contents/${Ge}?ref=${Se}`:`${c.rawBaseUrl}/${j}/${Q}/${Se}/${Ge}`}catch(j){throw new Error(`Incorrect URL: ${S}, ${j}`)}}function ce(S,c){const x={};return y(S,c)==="api"&&(x.Accept="application/vnd.github.v3.raw"),c.token&&(x.Authorization=`token ${c.token}`),{headers:x}}function y(S,c){return S.apiBaseUrl&&(c.token||!S.rawBaseUrl)?"api":"raw"}var Z=r(42822),q=r(89393),Y=r(26228);class Ce{async getOrCreateToken(c,x,j){let Q=this.tokenCache.get(c);if((!Q||this.isExpired(Q.expiresAt))&&(Q=await j(),Q.expiresAt=Q.expiresAt.minus({minutes:10}),this.tokenCache.set(c,Q)),!this.appliesToRepo(Q,x))throw new Error(`The Backstage GitHub application used in the ${c} organization does not have access to a repository with the name ${x}`);return{accessToken:Q.token}}appliesToRepo(c,x){return x===void 0?!0:c.repositories!==void 0?c.repositories.includes(x):!0}constructor(){(0,t._)(this,"tokenCache",new Map),(0,t._)(this,"isExpired",c=>Y.ou.local()>c)}}const Re={Accept:"application/vnd.github.machine-man-preview+json"};class Qe{async getInstallationCredentials(c,x){if(this.allowedInstallationOwners){var j;if(!(!((j=this.allowedInstallationOwners)===null||j===void 0)&&j.includes(c)))return{accessToken:void 0}}return this.cache.getOrCreateToken(c,x,async()=>{const{installationId:Q,suspended:Se}=await this.getInstallationData(c);if(Se)throw new Error(`The GitHub application for ${c} is suspended`);const we=await this.appClient.apps.createInstallationAccessToken({installation_id:Q,headers:Re});let Ze;if(we.data.repository_selection==="selected"){const Gt=new q.v({baseUrl:this.baseUrl,auth:we.data.token}),gn=await Gt.paginate(Gt.apps.listReposAccessibleToInstallation);var Ge;Ze=((Ge=gn.repositories)!==null&&Ge!==void 0?Ge:gn).map(mr=>mr.name)}return{token:we.data.token,expiresAt:Y.ou.fromISO(we.data.expires_at),repositories:Ze}})}getInstallations(){return this.appClient.paginate(this.appClient.apps.listInstallations)}async getInstallationData(c){const j=(await this.getInstallations()).find(Se=>{var we,Ze;return((we=Se.account)===null||we===void 0||(Ze=we.login)===null||Ze===void 0?void 0:Ze.toLocaleLowerCase("en-US"))===c.toLocaleLowerCase("en-US")});if(j)return{installationId:j.id,suspended:Boolean(j.suspended_by)};const Q=new Error(`No app installation found for ${c} in ${this.baseAuthConfig.appId}`);throw Q.name="NotFoundError",Q}constructor(c,x){(0,t._)(this,"appClient",void 0),(0,t._)(this,"baseUrl",void 0),(0,t._)(this,"baseAuthConfig",void 0),(0,t._)(this,"cache",new Ce),(0,t._)(this,"allowedInstallationOwners",void 0),this.allowedInstallationOwners=c.allowedInstallationOwners,this.baseUrl=x,this.baseAuthConfig={appId:c.appId,privateKey:c.privateKey.replace(/\\n/gm,`
|
|
33
|
+
`)},this.appClient=new q.v({baseUrl:x,headers:Re,authStrategy:Z.i,auth:this.baseAuthConfig})}}class Et{async getAllInstallations(){return this.apps.length?(await Promise.all(this.apps.map(x=>x.getInstallations()))).flat():[]}async getAppToken(c,x){if(this.apps.length===0)return;const j=await Promise.all(this.apps.map(Ze=>Ze.getInstallationCredentials(c,x).then(Ge=>({credentials:Ge,error:void 0}),Ge=>({credentials:void 0,error:Ge})))),Q=j.find(Ze=>Ze.credentials);if(Q)return Q.credentials.accessToken;const we=j.map(Ze=>Ze.error).find(Ze=>Ze.name!=="NotFoundError");if(we)throw we}constructor(c){var x;(0,t._)(this,"apps",void 0);var j;this.apps=(j=(x=c.apps)===null||x===void 0?void 0:x.map(Q=>new Qe(Q,c.apiBaseUrl)))!==null&&j!==void 0?j:[]}}class tt{async getCredentials(c){const x=H()(c.url),j=x.owner||x.name,Q=x.owner?x.name:void 0;let Se="app",we=await this.githubAppCredentialsMux.getAppToken(j,Q);return we||(Se="token",we=this.token),{headers:we?{Authorization:`Bearer ${we}`}:void 0,token:we,type:Se}}constructor(c,x){(0,t._)(this,"githubAppCredentialsMux",void 0),(0,t._)(this,"token",void 0),this.githubAppCredentialsMux=c,this.token=x}}(0,t._)(tt,"create",S=>new tt(new Et(S),S.token));class yt{static fromIntegrations(c){const x=new Map;return c.github.list().forEach(j=>{const Q=SingleInstanceGithubCredentialsProvider.create(j.config);x.set(j.config.host,Q)}),new yt(x)}async getCredentials(c){const x=new URL(c.url),j=this.providers.get(x.host);if(!j)throw new Error(`There is no GitHub integration that matches ${c.url}. Please add a configuration for an integration.`);return j.getCredentials(c)}constructor(c){_define_property(this,"providers",void 0),this.providers=c}}class He{get type(){return"github"}get title(){return this.integrationConfig.host}get config(){return this.integrationConfig}resolveUrl(c){return lt(B(c),"tree")}resolveEditUrl(c){return lt(c,"edit")}constructor(c){(0,t._)(this,"integrationConfig",void 0),this.integrationConfig=c}}(0,t._)(He,"factory",({config:S})=>{var c;const x=se((c=S.getOptionalConfigArray("integrations.github"))!==null&&c!==void 0?c:[]);return d(x.map(j=>new He(j)),j=>j.config.host)});function lt(S,c){return S.replace(/\/\/([^/]+)\/([^/]+)\/([^/]+)\/(blob|tree|edit)\//,(x,j,Q,Se)=>`//${j}/${Q}/${Se}/${c}/`)}const ot=null;class Ht extends He{get config(){return super.config}constructor(c){super(c)}}(0,t._)(Ht,"factory",He.factory);const Ut=null,Jt=null,en=null,Dt="gitlab.com",At="https://gitlab.com/api/v4";function Pt(S){const c=S.getString("host");let x=S.getOptionalString("apiBaseUrl");const j=S.getOptionalString("token");let Q=S.getOptionalString("baseUrl");if(x?x=(0,f.trimEnd)(x,"/"):c===Dt&&(x=At),Q?Q=(0,f.trimEnd)(Q,"/"):Q=`https://${c}`,W(c)){if(!x||!g(x))throw new Error(`Invalid GitLab integration config, '${x}' is not a valid apiBaseUrl`);if(!g(Q))throw new Error(`Invalid GitLab integration config, '${Q}' is not a valid baseUrl`)}else throw new Error(`Invalid GitLab integration config, '${c}' is not a valid host`);return{host:c,token:j,apiBaseUrl:x,baseUrl:Q}}function Lt(S){const c=S.map(Pt);return c.some(x=>x.host===Dt)||c.push({host:Dt,apiBaseUrl:At,baseUrl:`https://${Dt}`}),c}function nn(S){let c="";return S.host!==Dt&&(c=new URL(S.baseUrl).pathname),trimEnd(c,"/")}async function En(S,c){const x=await lr(S,c);return Jn(S,x,c).toString()}function Wn(S){const{token:c=""}=S;return{headers:{"PRIVATE-TOKEN":c}}}function Jn(S,c,x){try{const j=new URL(S),Q=j.pathname.split("/blob/").slice(1).join("/blob/"),[Se,...we]=Q.split("/"),Ze=getGitLabIntegrationRelativePath(x);return j.pathname=[...Ze?[Ze]:[],"api/v4/projects",c,"repository/files",encodeURIComponent(decodeURIComponent(we.join("/"))),"raw"].join("/"),j.search=`?ref=${Se}`,j}catch(j){throw new Error(`Incorrect url: ${S}, ${j}`)}}async function lr(S,c){const x=new URL(S);if(!x.pathname.includes("/blob/"))throw new Error("Please provide full path to yaml file from GitLab");try{let j=x.pathname.split("/-/blob/")[0].split("/blob/")[0];const Q=getGitLabIntegrationRelativePath(c);Q&&(j=j.replace(Q,""));const Se=new URL(`${x.origin}${Q}/api/v4/projects/${encodeURIComponent(j.replace(/^\//,""))}`),we=await fetch(Se.toString(),Wn(c)),Ze=await we.json();if(!we.ok)throw new Error(`GitLab Error '${Ze.error}', ${Ze.error_description}`);return Number(Ze.id)}catch(j){throw new Error(`Could not get GitLab project ID for: ${S}, ${j}`)}}class An{get type(){return"gitlab"}get title(){return this.integrationConfig.host}get config(){return this.integrationConfig}resolveUrl(c){return B(c)}resolveEditUrl(c){return Rn(c,"edit")}constructor(c){(0,t._)(this,"integrationConfig",void 0),this.integrationConfig=c}}(0,t._)(An,"factory",({config:S})=>{var c;const x=Lt((c=S.getOptionalConfigArray("integrations.gitlab"))!==null&&c!==void 0?c:[]);return d(x.map(j=>new An(j)),j=>j.config.host)});function Rn(S,c){return S.replace(/\/\-\/(blob|tree|edit)\//,`/-/${c}/`)}class rr{static fromConfig(c){return new rr({awsS3:I.factory({config:c}),azure:Ke.factory({config:c}),bitbucket:qt.factory({config:c}),bitbucketCloud:kt.factory({config:c}),bitbucketServer:Dn.factory({config:c}),gerrit:_.factory({config:c}),github:He.factory({config:c}),gitlab:An.factory({config:c}),gitea:It.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 x=Object.values(this.byType).map(j=>j.byUrl(c)).filter(Boolean);if(x.length>1){const j=x.filter(Q=>!(Q instanceof qt));j.length!==0&&(x=j)}return x[0]}byHost(c){return Object.values(this.byType).map(x=>x.byHost(c)).find(Boolean)}resolveUrl(c){const x=this.byUrl(c.base);return x?x.resolveUrl(c):B(c)}resolveEditUrl(c){const x=this.byUrl(c);return x?x.resolveEditUrl(c):c}constructor(c){(0,t._)(this,"byType",void 0),this.byType=c}}},6290:function(Ct,Be,r){"use strict";var t={};r.r(t),r.d(t,{TechDocsPlugin:function(){return L.s4}});var h=r(52322),H=r(2784),f=r(28316),W=r(73557),g=r(60871);const d=(0,g.T0)({id:"plugin.techdocs.storageservice"}),B=(0,g.T0)({id:"plugin.techdocs.service"});var ye=r(92077),ue=r(95481),V=r(7476),J=r(93225),I=r(86317),C=r(65124),oe=r(22478),ee=r(85478),ne=r(68435),$=r(3482),T=r(42081),P=r(48431),L=r(89258),O=r(52943),re=r(61886),Pe=r(13980),We=r.n(Pe),z=r(87612);class xt{get(n){for(const s of this.holders){const a=s.get(n);if(a)return a}}constructor(...n){(0,z._)(this,"holders",void 0),this.holders=n}}var st=r(51837);const Ke=(0,st.CT)("api-context"),it=i=>{var n;const{apis:s,children:a}=i,p=(n=(0,H.useContext)(Ke))===null||n===void 0?void 0:n.atVersion(1),A=p?new xt(s,p):s;return(0,h.jsx)(Ke.Provider,{value:(0,st.EI)({1:A}),children:a})};it.propTypes={apis:We().shape({get:We().func.isRequired}).isRequired,children:We().node};class nt{static validateFactories(n,s){for(const a of s){const p=[a],A=new Set;for(;p.length;){const k=p.shift(),U=n.get(k);if(U)for(const ie of Object.values(U.deps)){if(ie.id===a.id)throw new Error(`Circular dependency of api factory for ${a}`);A.has(ie)||(A.add(ie),p.push(ie))}}}}get(n){return this.load(n)}load(n,s=[]){const a=this.apis.get(n.id);if(a)return a;const p=this.factories.get(n);if(!p)return;if(s.includes(p.api))throw new Error(`Circular dependency of api factory for ${p.api}`);const A=this.loadDeps(n,p.deps,[...s,p.api]),k=p.factory(A);return this.apis.set(n.id,k),k}loadDeps(n,s,a){const p={};for(const A in s)if(s.hasOwnProperty(A)){const k=s[A],U=this.load(k,a);if(!U)throw new Error(`No API factory available for dependency ${k} of dependent ${n}`);p[A]=U}return p}constructor(n){(0,z._)(this,"factories",void 0),(0,z._)(this,"apis",void 0),this.factories=n,this.apis=new Map}}var bt;(function(i){i[i.default=10]="default",i[i.app=50]="app",i[i.static=100]="static"})(bt||(bt={}));class St{register(n,s){const a=bt[n],p=this.factories.get(s.api.id);return p&&p.priority>=a?!1:(this.factories.set(s.api.id,{priority:a,factory:s}),!0)}get(n){const s=this.factories.get(n.id);if(s)return s.factory}getAllApis(){const n=new Set;for(const{factory:s}of this.factories.values())n.add(s.api);return n}constructor(){(0,z._)(this,"factories",new Map)}}function pt(i){return new Promise((n,s)=>{const a=i.width||500,p=i.height||700,A=window.screen.width/2-a/2,k=window.screen.height/2-p/2,U=window.open(i.url,i.name,`menubar=no,location=no,resizable=no,scrollbars=no,status=no,width=${a},height=${p},top=${k},left=${A}`);let ie="";if(!U||typeof U.closed=="undefined"||U.closed){const mt=new Error("Failed to open auth popup.");mt.name="PopupRejectedError",s(mt);return}const Ae=mt=>{if(mt.source!==U||mt.origin!==i.origin)return;const{data:jt}=mt;if(jt.type==="config_info"){ie=jt.targetOrigin;return}if(jt.type!=="authorization_response")return;const Tt=jt;if("error"in Tt){const zt=new Error(Tt.error.message);zt.name=Tt.error.name,s(zt)}else n(Tt.response);ze()},Le=setInterval(()=>{if(U.closed){const mt=`Login failed, ${ie&&ie!==window.location.origin?`Incorrect app origin, expected ${ie}`:"popup was closed"}`,jt=new Error(mt);jt.name="PopupClosedError",s(jt),ze()}},100);function ze(){window.removeEventListener("message",Ae),clearInterval(Le)}window.addEventListener("message",Ae)})}let ft=!1;function wt(i){return[...i].join(" ")}class $t{async createSession(n){return n.instantPopup?this.enableExperimentalRedirectFlow?this.executeRedirect(n.scopes):this.showPopup(n.scopes):this.authRequester(n.scopes)}async refreshSession(n){const s=await fetch(await this.buildUrl("/refresh",{optional:!0,...n&&{scope:this.joinScopesFunc(n)}}),{headers:{"x-requested-with":"XMLHttpRequest"},credentials:"include"}).catch(p=>{throw new Error(`Auth refresh request failed, ${p}`)});if(!s.ok){const p=new Error(`Auth refresh request failed, ${s.statusText}`);throw p.status=s.status,p}const a=await s.json();if(a.error){const p=new Error(a.error.message);throw a.error.name&&(p.name=a.error.name),p}return await this.sessionTransform(a)}async removeSession(){const n=await fetch(await this.buildUrl("/logout"),{method:"POST",headers:{"x-requested-with":"XMLHttpRequest"},credentials:"include"}).catch(s=>{throw new Error(`Logout request failed, ${s}`)});if(!n.ok){const s=new Error(`Logout request failed, ${n.statusText}`);throw s.status=n.status,s}}async showPopup(n){const s=this.joinScopesFunc(n),a=await this.buildUrl("/start",{scope:s,origin:window.location.origin,flow:"popup"}),p=await pt({url:a,name:`${this.provider.title} Login`,origin:new URL(a).origin,width:450,height:730});return await this.sessionTransform(p)}async executeRedirect(n){const s=this.joinScopesFunc(n);return window.location.href=await this.buildUrl("/start",{scope:s,origin:window.location.origin,redirectUrl:window.location.href,flow:"redirect"}),new Promise(()=>{})}async buildUrl(n,s){const a=await this.discoveryApi.getBaseUrl("auth"),p=this.buildQueryString({...s,env:this.environment});return`${a}/${this.provider.id}${n}${p}`}buildQueryString(n){if(!n)return"";const s=Object.entries(n).map(([a,p])=>{if(typeof p=="string")return`${encodeURIComponent(a)}=${encodeURIComponent(p)}`;if(p)return encodeURIComponent(a)}).filter(Boolean).join("&");return s?`?${s}`:""}constructor(n){(0,z._)(this,"discoveryApi",void 0),(0,z._)(this,"environment",void 0),(0,z._)(this,"provider",void 0),(0,z._)(this,"joinScopesFunc",void 0),(0,z._)(this,"authRequester",void 0),(0,z._)(this,"sessionTransform",void 0),(0,z._)(this,"enableExperimentalRedirectFlow",void 0);const{configApi:s,discoveryApi:a,environment:p,provider:A,joinScopes:k=wt,oauthRequestApi:U,sessionTransform:ie=Le=>Le}=n;!ft&&!s&&(console.warn("DEPRECATION WARNING: Authentication providers require a configApi instance to configure the authentication flow. Please provide one to the authentication provider constructor."),ft=!0);var Ae;this.enableExperimentalRedirectFlow=s&&(Ae=s.getOptionalBoolean("enableExperimentalRedirectFlow"))!==null&&Ae!==void 0?Ae:!1,this.authRequester=U.createAuthRequester({provider:A,onAuthRequest:async Le=>this.enableExperimentalRedirectFlow?this.executeRedirect(Le):this.showPopup(Le)}),this.discoveryApi=a,this.environment=p,this.provider=A,this.joinScopesFunc=k,this.sessionTransform=ie}}function Ve(i,n){for(const s of n)if(!i.has(s))return!1;return!0}class qt{sessionExistsAndHasScope(n,s){if(!n)return!1;if(!s||this.options.sessionScopes===void 0)return!0;const a=this.options.sessionScopes(n);return Ve(a,s)}getExtendedScope(n,s){const a=new Set(this.options.defaultScopes);if(n&&this.options.sessionScopes!==void 0){const p=this.options.sessionScopes(n);for(const A of p)a.add(A)}if(s)for(const p of s)a.add(p);return a}constructor(n){(0,z._)(this,"options",void 0),this.options=n}}var ge=r(82394),be=r.n(ge);let Fe=Symbol.observable;class Je{[Fe](){return this}get closed(){return this.isClosed}next(n){if(this.isClosed)throw new Error("PublishSubject is closed");this.subscribers.forEach(s=>s.next(n))}error(n){if(this.isClosed)throw new Error("PublishSubject is closed");this.isClosed=!0,this.terminatingError=n,this.subscribers.forEach(s=>s.error(n))}complete(){if(this.isClosed)throw new Error("PublishSubject is closed");this.isClosed=!0,this.subscribers.forEach(n=>n.complete())}subscribe(n,s,a){const p=typeof n=="function"?{next:n,error:s,complete:a}:n;return this.observable.subscribe(p)}constructor(){(0,z._)(this,"isClosed",!1),(0,z._)(this,"terminatingError",void 0),(0,z._)(this,"observable",new(be())(n=>this.isClosed?(this.terminatingError?n.error(this.terminatingError):n.complete(),()=>{}):(this.subscribers.add(n),()=>{this.subscribers.delete(n)}))),(0,z._)(this,"subscribers",new Set)}}let vt=Symbol.observable;class Ot{[vt](){return this}get closed(){return this.isClosed}next(n){if(this.isClosed)throw new Error("BehaviorSubject is closed");this.currentValue=n,this.subscribers.forEach(s=>s.next(n))}error(n){if(this.isClosed)throw new Error("BehaviorSubject is closed");this.isClosed=!0,this.terminatingError=n,this.subscribers.forEach(s=>s.error(n))}complete(){if(this.isClosed)throw new Error("BehaviorSubject is closed");this.isClosed=!0,this.subscribers.forEach(n=>n.complete())}subscribe(n,s,a){const p=typeof n=="function"?{next:n,error:s,complete:a}:n;return this.observable.subscribe(p)}constructor(n){(0,z._)(this,"isClosed",void 0),(0,z._)(this,"currentValue",void 0),(0,z._)(this,"terminatingError",void 0),(0,z._)(this,"observable",void 0),(0,z._)(this,"subscribers",new Set),this.isClosed=!1,this.currentValue=n,this.terminatingError=void 0,this.observable=new(be())(s=>this.isClosed?(this.terminatingError?s.error(this.terminatingError):s.complete(),()=>{}):(s.next(this.currentValue),this.subscribers.add(s),()=>{this.subscribers.delete(s)}))}}class ht{setIsSignedIn(n){this.signedIn!==n&&(this.signedIn=n,this.subject.next(this.signedIn?g.sM.SignedIn:g.sM.SignedOut))}sessionState$(){return this.subject}constructor(){(0,z._)(this,"subject",new Ot(g.sM.SignedOut)),(0,z._)(this,"signedIn",!1)}}class Rt{async getSession(n){if(this.helper.sessionExistsAndHasScope(this.currentSession,n.scopes)){if(!this.sessionShouldRefreshFunc(this.currentSession))return this.currentSession;try{const a=await this.collapsedSessionRefresh(n.scopes),p=this.sessionScopesFunc(this.currentSession),A=this.sessionScopesFunc(a);return Ve(A,p)&&(this.currentSession=a),a}catch(a){if(n.optional)return;throw a}}if(!this.currentSession&&!n.instantPopup)try{const s=await this.collapsedSessionRefresh(n.scopes);return this.currentSession=s,this.getSession(n)}catch{}if(!n.optional)return this.currentSession=await this.connector.createSession({...n,scopes:this.helper.getExtendedScope(this.currentSession,n.scopes)}),this.stateTracker.setIsSignedIn(!0),this.currentSession}async removeSession(){this.currentSession=void 0,await this.connector.removeSession(),this.stateTracker.setIsSignedIn(!1)}sessionState$(){return this.stateTracker.sessionState$()}async collapsedSessionRefresh(n){if(this.refreshPromise)return this.refreshPromise;this.refreshPromise=this.connector.refreshSession(n);try{const s=await this.refreshPromise;return this.stateTracker.setIsSignedIn(!0),s}finally{delete this.refreshPromise}}constructor(n){(0,z._)(this,"connector",void 0),(0,z._)(this,"helper",void 0),(0,z._)(this,"sessionScopesFunc",void 0),(0,z._)(this,"sessionShouldRefreshFunc",void 0),(0,z._)(this,"stateTracker",new ht),(0,z._)(this,"refreshPromise",void 0),(0,z._)(this,"currentSession",void 0);const{connector:s,defaultScopes:a=new Set,sessionScopes:p,sessionShouldRefresh:A}=n;this.connector=s,this.sessionScopesFunc=p,this.sessionShouldRefreshFunc=A,this.helper=new qt({sessionScopes:p,defaultScopes:a})}}class Ft{setSession(n){this.currentSession=n,this.stateTracker.setIsSignedIn(Boolean(n))}async getSession(n){if(this.helper.sessionExistsAndHasScope(this.currentSession,n.scopes))return this.currentSession;if(!n.optional)return this.currentSession=await this.connector.createSession({...n,scopes:this.helper.getExtendedScope(this.currentSession,n.scopes)}),this.stateTracker.setIsSignedIn(!0),this.currentSession}async removeSession(){this.currentSession=void 0,this.stateTracker.setIsSignedIn(!1)}sessionState$(){return this.stateTracker.sessionState$()}constructor(n){_define_property(this,"connector",void 0),_define_property(this,"helper",void 0),_define_property(this,"stateTracker",new SessionStateTracker),_define_property(this,"currentSession",void 0);const{connector:s,defaultScopes:a=new Set,sessionScopes:p}=n;this.connector=s,this.helper=new SessionScopeHelper({sessionScopes:p,defaultScopes:a})}}const Yt={id:"oauth2",title:"Your Identity Provider",icon:()=>null};class kt{static create(n){const{configApi:s,discoveryApi:a,environment:p="development",provider:A=Yt,oauthRequestApi:k,defaultScopes:U=[],scopeTransform:ie=ze=>ze}=n,Ae=new $t({configApi:s,discoveryApi:a,environment:p,provider:A,oauthRequestApi:k,sessionTransform(ze){return{...ze,providerInfo:{idToken:ze.providerInfo.idToken,accessToken:ze.providerInfo.accessToken,scopes:kt.normalizeScopes(ie,ze.providerInfo.scope),expiresAt:new Date(Date.now()+ze.providerInfo.expiresInSeconds*1e3)}}}}),Le=new Rt({connector:Ae,defaultScopes:new Set(U),sessionScopes:ze=>ze.providerInfo.scopes,sessionShouldRefresh:ze=>(ze.providerInfo.expiresAt.getTime()-Date.now())/1e3<60*5});return new kt({sessionManager:Le,scopeTransform:ie})}async signIn(){await this.getAccessToken()}async signOut(){await this.sessionManager.removeSession()}sessionState$(){return this.sessionManager.sessionState$()}async getAccessToken(n,s){const a=kt.normalizeScopes(this.scopeTransform,n),p=await this.sessionManager.getSession({...s,scopes:a});var A;return(A=p==null?void 0:p.providerInfo.accessToken)!==null&&A!==void 0?A:""}async getIdToken(n={}){const s=await this.sessionManager.getSession({...n,scopes:new Set(["openid"])});var a;return(a=s==null?void 0:s.providerInfo.idToken)!==null&&a!==void 0?a:""}async getBackstageIdentity(n={}){const s=await this.sessionManager.getSession(n);return s==null?void 0:s.backstageIdentity}async getProfile(n={}){const s=await this.sessionManager.getSession(n);return s==null?void 0:s.profile}static normalizeScopes(n,s){if(!s)return new Set;const a=Array.isArray(s)?s:s.split(/[\s|,]/).filter(Boolean);return new Set(n(a))}constructor(n){(0,z._)(this,"sessionManager",void 0),(0,z._)(this,"scopeTransform",void 0),this.sessionManager=n.sessionManager,this.scopeTransform=n.scopeTransform}}const dn={id:"github",title:"GitHub",icon:()=>null};class Kt{static create(n){const{configApi:s,discoveryApi:a,environment:p="development",provider:A=dn,oauthRequestApi:k,defaultScopes:U=["read:user"]}=n;return kt.create({configApi:s,discoveryApi:a,oauthRequestApi:k,provider:A,environment:p,defaultScopes:U})}}const un={id:"gitlab",title:"GitLab",icon:()=>null};class Mn{static create(n){const{configApi:s,discoveryApi:a,environment:p="development",provider:A=un,oauthRequestApi:k,defaultScopes:U=["read_user"]}=n;return kt.create({configApi:s,discoveryApi:a,oauthRequestApi:k,provider:A,environment:p,defaultScopes:U})}}const Bn={id:"google",title:"Google",icon:()=>null},xn="https://www.googleapis.com/auth/";class $n{static create(n){const{configApi:s,discoveryApi:a,oauthRequestApi:p,environment:A="development",provider:k=Bn,defaultScopes:U=["openid",`${xn}userinfo.email`,`${xn}userinfo.profile`]}=n;return kt.create({configApi:s,discoveryApi:a,oauthRequestApi:p,provider:k,environment:A,defaultScopes:U,scopeTransform(ie){return ie.map(Ae=>Ae==="openid"?Ae:Ae==="profile"||Ae==="email"?`${xn}userinfo.${Ae}`:Ae.startsWith(xn)?Ae:`${xn}${Ae}`)}})}}const Dn={id:"okta",title:"Okta",icon:()=>null},on=new Set(["openid","profile","email","phone","address","groups","offline_access"]),wn="okta.";class zn{static create(n){const{configApi:s,discoveryApi:a,environment:p="development",provider:A=Dn,oauthRequestApi:k,defaultScopes:U=["openid","email","profile","offline_access"]}=n;return kt.create({configApi:s,discoveryApi:a,oauthRequestApi:k,provider:A,environment:p,defaultScopes:U,scopeTransform(ie){return ie.map(Ae=>on.has(Ae)||Ae.startsWith(wn)?Ae:`${wn}${Ae}`)}})}}var ut=r(30195);const _t=ut.z.object({profile:ut.z.object({email:ut.z.string().optional(),displayName:ut.z.string().optional(),picture:ut.z.string().optional()}),backstageIdentity:ut.z.object({token:ut.z.string(),identity:ut.z.object({type:ut.z.literal("user"),userEntityRef:ut.z.string(),ownershipEntityRefs:ut.z.array(ut.z.string())})})}),Wt={id:"saml",title:"SAML",icon:()=>null};class dt{static create(n){const{discoveryApi:s,environment:a="development",provider:p=Wt}=n,A=new DirectAuthConnector({discoveryApi:s,environment:a,provider:p}),k=new StaticAuthSessionManager({connector:A}),U=new AuthSessionStore({manager:k,storageKey:`${p.id}Session`,schema:samlSessionSchema});return new dt(U)}sessionState$(){return this.sessionManager.sessionState$()}async signIn(){await this.getBackstageIdentity({})}async signOut(){await this.sessionManager.removeSession()}async getBackstageIdentity(n={}){const s=await this.sessionManager.getSession(n);return s==null?void 0:s.backstageIdentity}async getProfile(n={}){const s=await this.sessionManager.getSession(n);return s==null?void 0:s.profile}constructor(n){_define_property(this,"sessionManager",void 0),this.sessionManager=n}}const bn={id:"microsoft",title:"Microsoft",icon:()=>null};class Vt{static create(n){return new Vt(n)}microsoftGraph(){return this.oauth2[Vt.MicrosoftGraphID]}static resourceForScopes(n){const s=n.split(" ").map(Vt.resourceForScope).filter(A=>A!=="openid");if(s.length>1)return Promise.reject(new Error(`Requested access token with scopes from multiple Azure resources: ${s.join(", ")}. Access tokens can only have a single audience.`));var a;const p=(a=s[0])!==null&&a!==void 0?a:Vt.MicrosoftGraphID;return Promise.resolve(p)}static resourceForScope(n){var s;const a=(s=n.match(RegExp("^(?<resourceURI>.*)\\/(?<scp>[^\\/]*)$")))===null||s===void 0?void 0:s.groups;if(a){const{resourceURI:p}=a;return p.replace(/^api:\/\//,"")}switch(n){case"email":case"openid":case"offline_access":case"profile":return"openid";default:return Vt.MicrosoftGraphID}}async getAccessToken(n,s){const a=n===void 0?Vt.MicrosoftGraphID:await Vt.resourceForScopes(Array.isArray(n)?n.join(" "):n);return a in this.oauth2||(this.oauth2[a]=kt.create({configApi:this.configApi,discoveryApi:this.discoveryApi,oauthRequestApi:this.oauthRequestApi,provider:this.provider,environment:this.environment,scopeTransform:this.scopeTransform})),this.oauth2[a].getAccessToken(n,s)}getIdToken(n){return this.microsoftGraph().getIdToken(n)}getProfile(n){return this.microsoftGraph().getProfile(n)}getBackstageIdentity(n){return this.microsoftGraph().getBackstageIdentity(n)}signIn(){return this.microsoftGraph().signIn()}signOut(){return this.microsoftGraph().signOut()}sessionState$(){return this.microsoftGraph().sessionState$()}constructor(n){(0,z._)(this,"oauth2",void 0),(0,z._)(this,"configApi",void 0),(0,z._)(this,"environment",void 0),(0,z._)(this,"provider",void 0),(0,z._)(this,"oauthRequestApi",void 0),(0,z._)(this,"discoveryApi",void 0),(0,z._)(this,"scopeTransform",void 0);const{configApi:s,environment:a="development",provider:p=bn,oauthRequestApi:A,discoveryApi:k,defaultScopes:U=["openid","offline_access","profile","email","User.Read"],scopeTransform:ie=Ae=>Ae.concat("offline_access")}=n;this.configApi=s,this.environment=a,this.provider=p,this.oauthRequestApi=A,this.discoveryApi=k,this.scopeTransform=ie,this.oauth2={[Vt.MicrosoftGraphID]:kt.create({configApi:this.configApi,discoveryApi:this.discoveryApi,oauthRequestApi:this.oauthRequestApi,provider:this.provider,environment:this.environment,scopeTransform:this.scopeTransform,defaultScopes:U})}}}(0,z._)(Vt,"MicrosoftGraphID","00000003-0000-0000-c000-000000000000");const hn={id:"onelogin",title:"onelogin",icon:()=>null},jn=new Set(["openid","profile","email","phone","address","groups","offline_access"]),an="onelogin.";class Yn{static create(n){const{configApi:s,discoveryApi:a,environment:p="development",provider:A=hn,oauthRequestApi:k}=n;return kt.create({configApi:s,discoveryApi:a,oauthRequestApi:k,provider:A,environment:p,defaultScopes:["openid","email","profile","offline_access"],scopeTransform(U){return U.map(ie=>jn.has(ie)||ie.startsWith(an)?ie:`${an}${ie}`)}})}}const je={id:"bitbucket",title:"Bitbucket",icon:()=>null};class le{static create(n){const{configApi:s,discoveryApi:a,environment:p="development",provider:A=je,oauthRequestApi:k,defaultScopes:U=["team"]}=n;return kt.create({configApi:s,discoveryApi:a,oauthRequestApi:k,provider:A,environment:p,defaultScopes:U})}}const Oe={id:"bitbucketServer",title:"Bitbucket Server",icon:()=>null};class Ue{static create(n){const{configApi:s,discoveryApi:a,environment:p="development",provider:A=Oe,oauthRequestApi:k,defaultScopes:U=["PROJECT_ADMIN"]}=n;return kt.create({configApi:s,discoveryApi:a,oauthRequestApi:k,provider:A,environment:p,defaultScopes:U})}}const qe={id:"atlassian",title:"Atlassian",icon:()=>null};class _{static create(n){const{configApi:s,discoveryApi:a,environment:p="development",provider:A=qe,oauthRequestApi:k}=n;return kt.create({configApi:s,discoveryApi:a,oauthRequestApi:k,provider:A,environment:p})}}class N{post(n){this.subject.next(n)}alert$(){return this.subject}constructor(){(0,z._)(this,"subject",new Je)}}class ve{captureEvent(n){}}const $e="theme";class et{static createWithStorage(n){const s=new et(n);if(!window.localStorage)return s;var a;const p=(a=window.localStorage.getItem($e))!==null&&a!==void 0?a:void 0;return s.setActiveThemeId(p),s.activeThemeId$().subscribe(A=>{A?window.localStorage.setItem($e,A):window.localStorage.removeItem($e)}),window.addEventListener("storage",A=>{if(A.key===$e){var k;const U=(k=localStorage.getItem($e))!==null&&k!==void 0?k:void 0;s.setActiveThemeId(U)}}),s}getInstalledThemes(){return this.themes.slice()}activeThemeId$(){return this.subject}getActiveThemeId(){return this.activeThemeId}setActiveThemeId(n){this.activeThemeId=n,this.subject.next(n)}constructor(n){(0,z._)(this,"themes",void 0),(0,z._)(this,"activeThemeId",void 0),(0,z._)(this,"subject",void 0),this.themes=n,this.subject=new Ot(void 0)}}var at=r(9850),It=r.n(at),Bt=r(12782),tn=r.n(Bt);const X=/^[a-z][a-z0-9]*(?:[-_][a-z][a-z0-9]*)*$/i;function K(i){return typeof i=="object"&&i!==null&&!Array.isArray(i)}function se(i){if(i===null)return"null";if(Array.isArray(i))return"array";const n=typeof i;return n==="number"&&isNaN(i)?"nan":n==="string"&&i===""?"empty-string":n}const pe={type(i,n,s,a){return`Invalid type in config for key '${i}' in '${n}', got ${s}, wanted ${a}`},missing(i){return`Missing required config value at '${i}'`},convert(i,n,s){return`Unable to convert config value for key '${i}' in '${n}' to a ${s}`}};class ce{static fromConfigs(n){return n.length===0?new ce(void 0):n.reduce((s,{data:a,context:p,filteredKeys:A,deprecatedKeys:k})=>{const U=new ce(a,p,s);if(U.filteredKeys=A,k)for(const{key:ie,description:Ae}of k)console.warn(`The configuration key '${ie}' of ${p} is deprecated and may be removed soon. ${Ae||""}`);return U},void 0)}has(n){var s;if(this.readValue(n)!==void 0)return!0;var p;return(p=(s=this.fallback)===null||s===void 0?void 0:s.has(n))!==null&&p!==void 0?p:!1}keys(){var n;const s=this.data?Object.keys(this.data):[];var a;const p=(a=(n=this.fallback)===null||n===void 0?void 0:n.keys())!==null&&a!==void 0?a:[];return[...new Set([...s,...p])]}get(n){const s=this.getOptional(n);if(s===void 0)throw new Error(pe.missing(this.fullKey(n!=null?n:"")));return s}getOptional(n){var s;const a=It()(this.readValue(n)),p=(s=this.fallback)===null||s===void 0?void 0:s.getOptional(n);if(a===void 0){if(!1)var A;return p}else if(p===void 0)return a;return tn()({},{value:p},{value:a},(k,U)=>!K(U)||!K(k)?U:void 0).value}getConfig(n){const s=this.getOptionalConfig(n);if(s===void 0)throw new Error(pe.missing(this.fullKey(n)));return s}getOptionalConfig(n){var s;const a=this.readValue(n),p=(s=this.fallback)===null||s===void 0?void 0:s.getOptionalConfig(n);if(K(a))return this.copy(a,n,p);if(a!==void 0)throw new TypeError(pe.type(this.fullKey(n),this.context,se(a),"object"));return p}getConfigArray(n){const s=this.getOptionalConfigArray(n);if(s===void 0)throw new Error(pe.missing(this.fullKey(n)));return s}getOptionalConfigArray(n){const s=this.readConfigValue(n,p=>{if(!Array.isArray(p))return{expected:"object-array"};for(const[A,k]of p.entries())if(!K(k))return{expected:"object-array",value:k,key:`${n}[${A}]`};return!0});if(!s){if(!1)var a;return}return s.map((p,A)=>this.copy(p,`${n}[${A}]`))}getNumber(n){const s=this.getOptionalNumber(n);if(s===void 0)throw new Error(pe.missing(this.fullKey(n)));return s}getOptionalNumber(n){const s=this.readConfigValue(n,p=>typeof p=="number"||typeof p=="string"||{expected:"number"});if(typeof s=="number"||s===void 0)return s;const a=Number(s);if(!Number.isFinite(a))throw new Error(pe.convert(this.fullKey(n),this.context,"number"));return a}getBoolean(n){const s=this.getOptionalBoolean(n);if(s===void 0)throw new Error(pe.missing(this.fullKey(n)));return s}getOptionalBoolean(n){const s=this.readConfigValue(n,p=>typeof p=="boolean"||typeof p=="number"||typeof p=="string"||{expected:"boolean"});if(typeof s=="boolean"||s===void 0)return s;const a=String(s).trim();if(/^(?:y|yes|true|1|on)$/i.test(a))return!0;if(/^(?:n|no|false|0|off)$/i.test(a))return!1;throw new Error(pe.convert(this.fullKey(n),this.context,"boolean"))}getString(n){const s=this.getOptionalString(n);if(s===void 0)throw new Error(pe.missing(this.fullKey(n)));return s}getOptionalString(n){return this.readConfigValue(n,s=>typeof s=="string"&&s!==""||{expected:"string"})}getStringArray(n){const s=this.getOptionalStringArray(n);if(s===void 0)throw new Error(pe.missing(this.fullKey(n)));return s}getOptionalStringArray(n){return this.readConfigValue(n,s=>{if(!Array.isArray(s))return{expected:"string-array"};for(const[a,p]of s.entries())if(typeof p!="string"||p==="")return{expected:"string-array",value:p,key:`${n}[${a}]`};return!0})}fullKey(n){return`${this.prefix}${this.prefix?".":""}${n}`}copy(n,s,a){const p=new ce(n,this.context,a,this.fullKey(s));return p.filteredKeys=this.filteredKeys,p}readConfigValue(n,s){const a=this.readValue(n);if(a===void 0){var p;if(!1)var A;return(p=this.fallback)===null||p===void 0?void 0:p.readConfigValue(n,s)}const k=s(a);if(k!==!0){const{key:U=n,value:ie=a,expected:Ae}=k;throw new TypeError(pe.type(this.fullKey(U),this.context,se(ie),Ae))}return a}readValue(n){const s=n?n.split("."):[];for(const p of s)if(!X.test(p))throw new TypeError(`Invalid config key '${n}'`);if(this.data===void 0)return;let a=this.data;for(const[p,A]of s.entries())if(K(a))a=a[A];else if(a!==void 0){const k=this.fullKey(s.slice(0,p).join("."));throw new TypeError(pe.type(k,this.context,se(a),"object"))}return a}constructor(n,s="mock-config",a,p=""){(0,z._)(this,"data",void 0),(0,z._)(this,"context",void 0),(0,z._)(this,"fallback",void 0),(0,z._)(this,"prefix",void 0),(0,z._)(this,"filteredKeys",void 0),(0,z._)(this,"notifiedFilteredKeys",void 0),this.data=n,this.context=s,this.fallback=a,this.prefix=p,this.notifiedFilteredKeys=new Set}}const y="Invalid discovery URL pattern,";class Z{static compile(n){const s=n.split(/\{\{\s*pluginId\s*\}\}/),a=s.join("pluginId");let p;try{p=new URL(a)}catch{throw new Error(`${y} URL '${a}' is invalid`)}if(p.hash)throw new Error(`${y} URL must not have a hash`);if(p.search)throw new Error(`${y} URL must not have a query`);if(a.endsWith("/"))throw new Error(`${y} URL must not end with a slash`);return new Z(s)}async getBaseUrl(n){return this.parts.join(n)}constructor(n){(0,z._)(this,"parts",void 0),this.parts=n}}class q{post(n,s){return s!=null&&s.hidden||this.alertApi.post({message:n.message,severity:"error"}),this.errorApi.post(n,s)}error$(){return this.errorApi.error$()}constructor(n,s){(0,z._)(this,"alertApi",void 0),(0,z._)(this,"errorApi",void 0),this.alertApi=n,this.errorApi=s}}class Y{post(n,s){this.subject.next({error:n,context:s})}error$(){return this.subject}constructor(){(0,z._)(this,"subject",new Je)}}class Ce{static forward(n,s){window.addEventListener("unhandledrejection",a=>{n.post(a.reason,s)})}}function Re(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 Qe{registerFlag(n){Re(n.name),this.registeredFeatureFlags.push(n)}getRegisteredFlags(){return this.registeredFeatureFlags.slice()}isActive(n){return this.flags||(this.flags=this.load()),this.flags.get(n)===g.CL.Active}save(n){this.flags||(this.flags=this.load()),n.merge||this.flags.clear();for(const[a,p]of Object.entries(n.states))this.flags.set(a,p);const s=Array.from(this.flags.entries()).filter(([,a])=>a===g.CL.Active);window.localStorage.setItem("featureFlags",JSON.stringify(Object.fromEntries(s)))}load(){try{const n=window.localStorage.getItem("featureFlags");if(!n)return new Map;const s=JSON.parse(n);if(typeof s!="object"||s===null||Array.isArray(s))return new Map;const a=Object.entries(s).filter(([p,A])=>(Re(p),A===g.CL.Active));return new Map(a)}catch{return new Map}}constructor(){(0,z._)(this,"registeredFeatureFlags",[]),(0,z._)(this,"flags",void 0)}}function Et(i){let n=i.baseImplementation||r.g.fetch;var s;const a=[(s=i.middleware)!==null&&s!==void 0?s:[]].flat().reverse();for(const p of a)n=p.apply(n);return{fetch:n}}class tt{static create(n){var s,a;const p=yt(n),A=((s=n.header)===null||s===void 0?void 0:s.name)||"authorization",k=((a=n.header)===null||a===void 0?void 0:a.value)||(U=>`Bearer ${U}`);return new tt(n.identityApi,p,A,k)}apply(n){return async(s,a)=>{const p=new Request(s,a),{token:A}=await this.identityApi.getCredentials();return p.headers.get(this.headerName)||typeof A!="string"||!A||!this.allowUrl(p.url)?n(s,a):(p.headers.set(this.headerName,this.headerValue(A)),n(p))}}constructor(n,s,a,p){(0,z._)(this,"identityApi",void 0),(0,z._)(this,"allowUrl",void 0),(0,z._)(this,"headerName",void 0),(0,z._)(this,"headerValue",void 0),this.identityApi=n,this.allowUrl=s,this.headerName=a,this.headerValue=p}}function yt(i){return i.allowUrl?i.allowUrl:i.urlPrefixAllowlist?He(i.urlPrefixAllowlist):i.config?He([i.config.getString("backend.baseUrl")]):()=>!1}function He(i){const n=i.map(s=>s.replace(/\/$/,""));return s=>n.some(a=>s===a||s.startsWith(`${a}/`))}function lt(i,n){return!n||n==="/"?i:`${i.replace(/\/$/,"")}/${n.replace(/^\//,"")}`}class ot{apply(n){return async(s,a)=>{const p=new Request(s,a),A="plugin://";if(!p.url.startsWith(A))return n(s,a);const{hostname:k,pathname:U,search:ie,hash:Ae,username:Le,password:ze}=new URL(`http://${p.url.substring(A.length)}`);let mt=await this.discoveryApi.getBaseUrl(k);if(Le||ze){const Tt=new URL(mt),zt=`${Le}${ze?`:${ze}`:""}@`;mt=`${Tt.protocol}//${zt}${Tt.host}${Tt.pathname}`}const jt=`${lt(mt,U)}${ie}${Ae}`;return n(jt,typeof s=="string"||Ht(s)?a:s)}}constructor(n){(0,z._)(this,"discoveryApi",void 0),this.discoveryApi=n}}function Ht(i){return typeof i=="object"&&(i==null?void 0:i.constructor)===URL}class Ut{static resolvePluginProtocol(n){return new ot(n.discoveryApi)}static injectIdentityAuth(n){return tt.create(n)}constructor(){}}function Jt(i,n){for(const s of n)if(!i.has(s))return!1;return!0}function en(i,...n){const s=new Set(i);for(const a of n)for(const p of a)s.add(p);return s}class Dt{request(n){return new Promise((s,a)=>{this.requests.push({scopes:n,resolve:s,reject:a}),this.subject.next(this.getCurrentPending())})}resolve(n,s){this.requests=this.requests.filter(a=>Jt(n,a.scopes)?(a.resolve(s),!1):!0),this.subject.next(this.getCurrentPending())}reject(n){this.requests.forEach(s=>s.reject(n)),this.requests=[],this.subject.next(this.getCurrentPending())}pending(){return this.subject}getCurrentPending(){const n=this.requests.length===0?void 0:this.requests.slice(1).reduce((s,a)=>en(s,a.scopes),this.requests[0].scopes);return{scopes:n,resolve:s=>{n&&this.resolve(n,s)},reject:s=>{n&&this.reject(s)}}}constructor(){(0,z._)(this,"requests",[]),(0,z._)(this,"subject",new Ot(this.getCurrentPending()))}}class At{createAuthRequester(n){const s=new Dt,a=this.handlerCount;return this.handlerCount++,s.pending().subscribe({next:p=>{const A=this.currentRequests.slice(),k=this.makeAuthRequest(p,n);k?A[a]=k:delete A[a],this.currentRequests=A,this.subject.next(A.filter(Boolean))}}),p=>s.request(p)}makeAuthRequest(n,s){const{scopes:a}=n;if(a)return{provider:s.provider,trigger:async()=>{const p=await s.onAuthRequest(a);n.resolve(p)},reject:()=>{const p=new Error("Login failed, rejected by user");p.name="RejectedError",n.reject(p)}}}authRequest$(){return this.subject}constructor(){(0,z._)(this,"subject",new Ot([])),(0,z._)(this,"currentRequests",[]),(0,z._)(this,"handlerCount",0)}}const Pt=new Map;class Lt{static create(n){var s;return new Lt((s=n.namespace)!==null&&s!==void 0?s:"",n.errorApi)}static addStorageEventListener(){window.addEventListener("storage",n=>{for(const[a,p]of Pt.entries()){var s;!((s=n.key)===null||s===void 0)&&s.startsWith(a)&&p.handleStorageChange(n.key)}})}get(n){return this.snapshot(n).value}snapshot(n){let s,a="absent";try{const p=localStorage.getItem(this.getKeyName(n));p&&(s=JSON.parse(p,(A,k)=>(typeof k=="object"&&k!==null&&Object.freeze(k),k)),a="present")}catch{this.errorApi.post(new Error(`Error when parsing JSON config from storage for: ${n}`))}return{key:n,value:s,presence:a}}forBucket(n){const s=`${this.namespace}/${n}`;return Pt.has(s)||Pt.set(s,new Lt(s,this.errorApi)),Pt.get(s)}async set(n,s){localStorage.setItem(this.getKeyName(n),JSON.stringify(s)),this.notifyChanges(n)}async remove(n){localStorage.removeItem(this.getKeyName(n)),this.notifyChanges(n)}observe$(n){return Lt.hasSubscribed||(Lt.addStorageEventListener(),Lt.hasSubscribed=!0),this.observable.filter(({key:s})=>s===n)}handleStorageChange(n){if(!(n!=null&&n.startsWith(this.namespace)))return;const s=n==null?void 0:n.slice(`${this.namespace}/`.length);s.includes("/")||this.notifyChanges(decodeURIComponent(s))}getKeyName(n){return`${this.namespace}/${encodeURIComponent(n)}`}notifyChanges(n){const s=this.snapshot(n);for(const a of this.subscribers)a.next(s)}constructor(n,s){(0,z._)(this,"namespace",void 0),(0,z._)(this,"errorApi",void 0),(0,z._)(this,"subscribers",void 0),(0,z._)(this,"observable",void 0),this.namespace=n,this.errorApi=s,this.subscribers=new Set,this.observable=new(be())(a=>(this.subscribers.add(a),()=>{this.subscribers.delete(a)}))}}(0,z._)(Lt,"hasSubscribed",!1);const nn=(0,H.createContext)(void 0);function En(){const[i]=(0,W.is)((0,h.jsx)(W.AW,{index:!0,element:(0,h.jsx)("div",{})}));return!i.index}var Wn=r(84800);const Jn=(i,n)=>{try{var s,a;const p=(0,Wn.fp)(n,{pathname:i}),A=(s=p==null?void 0:p.filter(U=>{var ie;return((ie=U==null?void 0:U.route.routeRefs)===null||ie===void 0?void 0:ie.size)>0}).pop())===null||s===void 0?void 0:s.route;if(!A)return{};let k;return A.routeRefs.size===1&&(k=A.routeRefs.values().next().value),{extension:"App",pluginId:((a=A.plugin)===null||a===void 0?void 0:a.getId())||"root",...k?{routeRef:k.id}:{}}}catch{return{}}},lr=({pathname:i,search:n,hash:s})=>{const a=(0,g.z$)();return(0,H.useEffect)(()=>{a.captureEvent("navigate",`${i}${n}${s}`)},[a,i,n,s]),null},An=({routeObjects:i})=>{const{pathname:n,search:s,hash:a}=(0,W.TH)();return(0,h.jsx)(g.fC,{attributes:Jn(n,i),children:(0,h.jsx)(lr,{pathname:n,search:s,hash:a})})};function Rn(i){return En()?rr(i):""}function rr(i){var n;let{pathname:s}=new URL((n=i.getOptionalString("app.baseUrl"))!==null&&n!==void 0?n:"/","http://sample.dev");return s=s.replace(/\/*$/,""),s}function S({component:i,appIdentityProxy:n,children:s}){const[a,p]=(0,H.useState)(),A=(0,g.h_)(g.Ds),k=Rn(A);return a?(n.setTarget(a,{signOutTargetUrl:k||"/"}),(0,h.jsx)(h.Fragment,{children:s})):(0,h.jsx)(i,{onSignInSuccess:p})}function c(i){const{Router:n,SignInPage:s}=(0,g.qD)().getComponents(),a=(0,g.h_)(g.Ds),p=rr(a),A=`${p}/*`,k=(0,H.useContext)(nn);if(!k)throw new Error("AppRouter must be rendered within the AppProvider");const{routeObjects:U,appIdentityProxy:ie}=k;return s?En()?(0,h.jsxs)(n,{children:[(0,h.jsx)(An,{routeObjects:U}),(0,h.jsx)(S,{component:s,appIdentityProxy:ie,children:(0,h.jsx)(W.Z5,{children:(0,h.jsx)(W.AW,{path:A,element:(0,h.jsx)(h.Fragment,{children:i.children})})})})]}):(0,h.jsxs)(n,{basename:p,children:[(0,h.jsx)(An,{routeObjects:U}),(0,h.jsx)(S,{component:s,appIdentityProxy:ie,children:i.children})]}):(ie.setTarget({getUserId:()=>"guest",getIdToken:async()=>{},getProfile:()=>({email:"guest@example.com",displayName:"Guest"}),getProfileInfo:async()=>({email:"guest@example.com",displayName:"Guest"}),getBackstageIdentity:async()=>({type:"user",userEntityRef:"user:default/guest",ownershipEntityRefs:["user:default/guest"]}),getCredentials:async()=>({}),signOut:async()=>{}},{signOutTargetUrl:p||"/"}),En()?(0,h.jsxs)(n,{children:[(0,h.jsx)(An,{routeObjects:U}),(0,h.jsx)(W.Z5,{children:(0,h.jsx)(W.AW,{path:A,element:(0,h.jsx)(h.Fragment,{children:i.children})})})]}):(0,h.jsxs)(n,{basename:p,children:[(0,h.jsx)(An,{routeObjects:U}),i.children]}))}var x=r(88412),j=r(50629),Q=r(80956),Se=r(64279);function we(i){const n={};for(const a in i.collectors)i.collectors.hasOwnProperty(a)&&(n[a]=i.collectors[a]());const s=[{node:H.Children.toArray(i.root),parent:void 0,contexts:{}}];for(;s.length!==0;){const{node:a,parent:p,contexts:A}=s.shift();H.Children.forEach(a,k=>{if(!(0,H.isValidElement)(k))return;const U={};for(const ie in n)if(n.hasOwnProperty(ie)){const Ae=n[ie];U[ie]=Ae.visit(Ae.accumulator,k,p,A[ie])}for(const ie of i.discoverers){const Ae=ie(k);Ae&&s.push({node:Ae,parent:k,contexts:U})}})}return Object.fromEntries(Object.entries(n).map(([a,p])=>[a,p.accumulator]))}function Ze(i,n){return()=>({accumulator:i(),visit:n})}function Ge(i){var n;return(n=i.props)===null||n===void 0?void 0:n.children}function Gt(i){var n,s;if(!((n=i.props)===null||n===void 0)&&n.path&&(!((s=i.props)===null||s===void 0)&&s.element)){var a;return(a=i.props)===null||a===void 0?void 0:a.element}}const gn=Ze(()=>new Set,(i,n)=>{const s=(0,g.IY)(n,"core.plugin");s&&i.add(s)}),Vn=i=>{const{children:n}=i,s=(0,g.h_)(g.W0),a="with"in i?s.isActive(i.with):!s.isActive(i.without);return(0,h.jsx)(h.Fragment,{children:a?n:null})};(0,g.R5)(Vn,"core.featureFlagged",!0);const mr={caseSensitive:!1,path:"*",element:"match-all",routeRefs:new Set};function vr(i){const n=i;if(n!=null&&n.type){var s,a;return(a=(s=n.type.displayName)!==null&&s!==void 0?s:n.type.name)!==null&&a!==void 0?a:String(n.type)}return String(n)}function eo(i,n=new Array){return H.Children.forEach(i,s=>{if(!(0,H.isValidElement)(s))return;const a=(0,g.IY)(s,"core.mountPoint");if(a){const p=(0,g.IY)(s,"core.plugin");n.push({routeRef:a,plugin:p})}eo(s.props.children,n)}),n}const Co=Ze(()=>({paths:new Map,parents:new Map,objects:new Array}),(i,n,s,a)=>{var p,A;if(a!=null&&a.isElementAncestor)return a;if((s==null?void 0:s.props.element)===n)return{...a,isElementAncestor:!0};const k=(p=n.props)===null||p===void 0?void 0:p.path,U=(0,g.IY)(n,"core.mountPoint");if(U&&k)throw new Error(`Path property may not be set directly on a routable extension "${vr(n)}"`);var ie;const Ae=(ie=a==null||(A=a.obj)===null||A===void 0?void 0:A.children)!==null&&ie!==void 0?ie:i.objects;if(k!==void 0){if(typeof k!="string")throw new Error(`Element path must be a string at "${vr(n)}"`);const jt=k.startsWith("/")?k.slice(1):k,Tt=n.props.element;if((0,g.IY)(n,"core.gatherMountPoints")){var Le;if(Tt)throw new Error(`Mount point gatherers may not have an element prop "${vr(n)}"`);const zt={path:jt,element:"gathered",routeRefs:new Set,caseSensitive:Boolean((Le=n.props)===null||Le===void 0?void 0:Le.caseSensitive),children:[mr],plugin:void 0};return Ae.push(zt),{obj:zt,gatherPath:jt,routeRef:a==null?void 0:a.routeRef,gatherRouteRef:a==null?void 0:a.routeRef}}if(Tt){var ze;const[zt,...Mt]=eo(Tt);if(Mt.length>0)throw new Error(`Route element with path "${k}" may not contain multiple routable extensions`);if(!zt)return a;const{routeRef:On,plugin:ar}=zt,pr={path:jt,element:"mounted",routeRefs:new Set([On]),caseSensitive:Boolean((ze=n.props)===null||ze===void 0?void 0:ze.caseSensitive),children:[mr],plugin:ar};return Ae.push(pr),i.paths.set(On,jt),i.parents.set(On,a==null?void 0:a.routeRef),{obj:pr,routeRef:On!=null?On:a==null?void 0:a.routeRef,gatherPath:jt,gatherRouteRef:a==null?void 0:a.gatherRouteRef}}}if(U){var mt;if((a==null?void 0:a.gatherPath)===void 0)throw new Error(`Routable extension "${vr(n)}" with mount point "${U}" must be assigned a path`);return a==null||(mt=a.obj)===null||mt===void 0||mt.routeRefs.add(U),i.paths.set(U,a.gatherPath),i.parents.set(U,a==null?void 0:a.gatherRouteRef),{...a,routeRef:U}}return a}),to=Ze(()=>({paths:new Map,parents:new Map,objects:new Array}),(i,n,s,a)=>{var p,A,k;if((s==null?void 0:s.props.element)===n)return a;let U=a==null?void 0:a.obj,ie=a==null?void 0:a.routeRef,Ae=a==null?void 0:a.sticky;const Le=(p=n.props)===null||p===void 0?void 0:p.path;var ze;const mt=(ze=U==null?void 0:U.children)!==null&&ze!==void 0?ze:i.objects,jt=Boolean((A=n.props)===null||A===void 0?void 0:A.caseSensitive);let Tt=a==null?void 0:a.path;if((0,g.IY)(n,"core.gatherMountPoints")){if(!Le)throw new Error("Mount point gatherer must have a path");Tt=Le}const zt=(k=n.props)===null||k===void 0?void 0:k.element;let Mt=(0,g.IY)(n,"core.mountPoint");if(!Mt&&(0,H.isValidElement)(zt)&&(Mt=(0,g.IY)(zt,"core.mountPoint")),Mt){let pr=Le;if(Tt&&(pr?Tt=void 0:pr=Tt),!pr)throw new Error("Mounted routable extension must have a path");i.paths.set(Mt,pr),ie&&Ae?(i.parents.set(Mt,ie),Le&&(ie=Mt,Ae=!1)):(i.parents.set(Mt,ie),ie=Mt),Le?(U={caseSensitive:jt,path:Le,element:"mounted",routeRefs:new Set([Mt]),children:[mr],plugin:(0,g.IY)(n.props.element,"core.plugin")},mt.push(U)):U==null||U.routeRefs.add(Mt)}if((0,g.IY)(n,"core.gatherMountPoints")&&(Ae=!0),(0,g.IY)(n,"core.gatherMountPoints")){if(!Le)throw new Error("Mount point gatherer must have a path");if(!Mt){var ar;U={caseSensitive:jt,path:Le,element:"gathered",routeRefs:new Set,children:[mr],plugin:a==null||(ar=a.obj)===null||ar===void 0?void 0:ar.plugin},mt.push(U)}}return{obj:U,path:Tt,routeRef:ie,sticky:Ae}}),yr=Ze(()=>new Set,(i,n)=>{if(n.type===Vn){const s=n.props;i.add("with"in s?s.with:s.without)}}),Hn=(0,st.uW)("route-ref-type",()=>Symbol("route-ref-type"));function Qn(i){return i[Hn]==="absolute"}function xr(i){return i[Hn]==="sub"}function Or(i){return i[Hn]==="external"}function kr(...i){const n=i.join("/").replace(/\/\/+/g,"/");return n!=="/"&&n.endsWith("/")?n.slice(0,-1):n}function es(i,n,s){let a,p="";if(Qn(i))a=i;else if(xr(i))a=i.parent,p=i.path;else if(Or(i)){const U=s.get(i);if(!U)return[void 0,""];if(Qn(U))a=U;else if(xr(U))a=U.parent,p=U.path;else throw new Error(`ExternalRouteRef was bound to invalid target, ${U}`)}else throw i[Hn]?new Error(`Unknown or invalid route ref type, ${i[Hn]}`):new Error(`Unknown object passed to useRouteRef, got ${i}`);if(!a)return[void 0,""];const A=n.get(a);if(A===void 0)return[void 0,""];const k=kr(A,p);return[a,k]}function Hr(i,n,s,a,p){var A;const k=(A=(0,Wn.fp)(p,n))!==null&&A!==void 0?A:[],U=Array();let ie=-1;for(let ze=i;ze&&(ie=k.findIndex(mt=>mt.route.routeRefs.has(ze)),ie===-1);ze=a.get(ze))U.unshift(ze);U.length===0&&(ie-=1);const Ae=ie===-1?"":k[ie].pathname,Le=U.slice(0,-1).map(ze=>{const mt=s.get(ze);if(mt===void 0)throw new Error(`No path for ${ze}`);if(mt.includes(":"))throw new Error(`Cannot route to ${i} with parent ${ze} as it has parameters`);return mt});return`${kr(Ae,...Le)}/`}class ts{resolve(n,s){const[a,p]=es(n,this.routePaths,this.routeBindings);if(!a)return;let A;typeof s=="string"?A=this.trimPath(s):s.pathname?A={...s,pathname:this.trimPath(s.pathname)}:A=s;const k=this.appBasePath+Hr(a,A,this.routePaths,this.routeParents,this.routeObjects);return(...[ie])=>kr(k,(0,Wn.Gn)(p,ie))}trimPath(n){return n&&(n.startsWith(this.appBasePath)?n.slice(this.appBasePath.length):n)}constructor(n,s,a,p,A){(0,z._)(this,"routePaths",void 0),(0,z._)(this,"routeParents",void 0),(0,z._)(this,"routeObjects",void 0),(0,z._)(this,"routeBindings",void 0),(0,z._)(this,"appBasePath",void 0),this.routePaths=n,this.routeParents=s,this.routeObjects=a,this.routeBindings=p,this.appBasePath=A}}const wo=(0,st.CT)("routing-context"),Gr=({routePaths:i,routeParents:n,routeObjects:s,routeBindings:a,basePath:p="",children:A})=>{const k=new ts(i,n,s,a,p),U=(0,st.EI)({1:k});return(0,h.jsx)(wo.Provider,{value:U,children:A})};function _n(i,n){const s=new Set(n.values());s.delete(void 0);for(const a of n.keys()){if(s.has(a))continue;let p=a,A="";for(;p;){const U=i.get(p);if(U===void 0)throw new Error(`No path for ${p}`);A=kr(U,A),p=n.get(p)}const k=A.match(/:(\w+)/g);if(k){for(let U=0;U<k.length;U++)for(let ie=U+1;ie<k.length;ie++)if(k[ie]===k[U])throw new Error(`Parameter ${k[ie]} is duplicated in path ${A}`)}}}function Br(i,n){for(const s of n)if(s.externalRoutes){for(const[a,p]of Object.entries(s.externalRoutes))if(!p.optional&&!i.has(p))throw new Error(`External route '${a}' of the '${s.getId()}' plugin must be bound to a target route. See https://backstage.io/link?bind-routes for details.`)}}const $r=(0,st.CT)("app-context"),jo=({appContext:i,children:n})=>{const s=(0,st.EI)({1:i});return(0,h.jsx)($r.Provider,{value:s,children:n})};function Dr(i){return new Error(`Tried to access IdentityApi ${i} before app was loaded`)}function Zr(i){console.warn(`WARNING: Call to ${i} is deprecated and will break in the future`)}class no{setTarget(n,s){this.target=n,this.signOutTargetUrl=s.signOutTargetUrl,this.resolveTarget(n)}getUserId(){if(!this.target)throw Dr("getUserId");if(!this.target.getUserId)throw new Error("IdentityApi does not implement getUserId");return Zr("getUserId"),this.target.getUserId()}getProfile(){if(!this.target)throw Dr("getProfile");if(!this.target.getProfile)throw new Error("IdentityApi does not implement getProfile");return Zr("getProfile"),this.target.getProfile()}async getProfileInfo(){return this.waitForTarget.then(n=>n.getProfileInfo())}async getBackstageIdentity(){const n=await this.waitForTarget.then(s=>s.getBackstageIdentity());return n.userEntityRef.match(/^.*:.*\/.*$/)||console.warn(`WARNING: The App IdentityApi provided an invalid userEntityRef, '${n.userEntityRef}'. It must be a full Entity Reference of the form '<kind>:<namespace>/<name>'.`),n}async getCredentials(){return this.waitForTarget.then(n=>n.getCredentials())}async getIdToken(){return this.waitForTarget.then(n=>{if(!n.getIdToken)throw new Error("IdentityApi does not implement getIdToken");return Zr("getIdToken"),n.getIdToken()})}async signOut(){await this.waitForTarget.then(n=>n.signOut()),window.location.href=this.signOutTargetUrl}constructor(){(0,z._)(this,"target",void 0),(0,z._)(this,"waitForTarget",void 0),(0,z._)(this,"resolveTarget",()=>{}),(0,z._)(this,"signOutTargetUrl","/"),this.waitForTarget=new Promise(n=>{this.resolveTarget=n})}}var Eo=r(72164);function Nr(i,n,s){if(i!==void 0){const p=s.find(A=>A.id===i);if(p)return p}if(n){const p=s.find(A=>A.variant==="dark");if(p)return p}const a=s.find(p=>p.variant==="light");return a||s[0]}const In=()=>{const i=(0,H.useMemo)(()=>window.matchMedia("(prefers-color-scheme: dark)"),[]),[n,s]=(0,H.useState)(i.matches);return(0,H.useEffect)(()=>{const a=p=>{s(p.matches)};return i.addListener(a),()=>{i.removeListener(a)}},[i]),n};function ro({children:i}){const n=(0,g.h_)(g.hg),s=(0,Eo.Z)(n.activeThemeId$(),n.getActiveThemeId()),a=Boolean(window.matchMedia)?In():!1,p=Nr(s,a,n.getInstalledThemes());if(!p)throw new Error("App has no themes");return(0,h.jsx)(p.Provider,{children:i})}const Kr=async(i="__APP_INJECTED_RUNTIME_CONFIG__")=>{const n=[{context:"app-config.yaml",data:{app:{title:"Techdocs Preview App",baseUrl:"http://localhost:3000"},backend:{baseUrl:"http://localhost:3000"},techdocs:{builder:"external"}}}];if(!n)throw new Error("No static configuration provided");if(!Array.isArray(n))throw new Error("Static configuration has invalid format");const s=n.slice();if(i!=="__app_injected_runtime_config__".toLocaleUpperCase("en-US"))try{const p=JSON.parse(i);Array.isArray(p)?s.push(...p):s.push({data:p,context:"env"})}catch(p){throw new Error(`Failed to load runtime configuration, ${p}`)}const a=window.__APP_CONFIG__;return a&&s.push({context:"window",data:a}),s};class Ao{add(n,s){return this.apis.push([n.id,s]),s}build(){return new br(new Map(this.apis))}constructor(){(0,z._)(this,"apis",[])}}class br{static builder(){return new Ao}static from(n){return new br(new Map(n.map(([s,a])=>[s.id,a])))}static with(n,s){return new br(new Map([[n.id,s]]))}with(n,s){return new br(new Map([...this.apis,[n.id,s]]))}get(n){return this.apis.get(n.id)}constructor(n){(0,z._)(this,"apis",void 0),this.apis=n}}function To(i){const n=new Map;return i&&i({bind:(a,p)=>{for(const[A,k]of Object.entries(p)){const U=a[A];if(!U)throw new Error(`Key ${A} is not an existing external route`);if(!k&&!U.optional)throw new Error(`External route ${A} is required but was undefined`);k&&n.set(U,k)}}}),n}function oo(i){const n=new URL(i);return n.protocol=document.location.protocol,n.hostname=document.location.hostname,n.port=document.location.port,n.toString().replace(/\/$/,"")}function Ro(i,n,s){var a;const p=Boolean(i),A=(0,Se.default)(i||(()=>Promise.resolve([])));let k;if(p&&A.loading){const{Progress:Ae}=n;k=(0,h.jsx)(Ae,{})}else if(A.error){const{BootErrorPage:Ae}=n;k=(0,h.jsx)(Ae,{step:"load-config",error:A.error})}const{ThemeProvider:U=ro}=n;if(k)return{node:(0,h.jsx)(it,{apis:br.with(g.hg,s),children:(0,h.jsx)(U,{children:k})})};let ie;if(!((a=A.value)===null||a===void 0)&&a.length){const Ae=ce.fromConfigs(A.value),Le=Ae.getOptionalString("app.baseUrl"),ze=Ae.getOptionalString("backend.baseUrl");let mt=A.value;const jt={data:{},context:"relative-resolver"};if(Le&&ze){const Tt=new URL(Le).origin,zt=new URL(ze).origin;if(Tt===zt){const Mt=oo(ze);ze!==Mt&&(jt.data.backend={baseUrl:Mt})}}if(Le){const Tt=oo(Le);Le!==Tt&&(jt.data.app={baseUrl:Tt})}Object.keys(jt.data).length&&(mt=mt.concat([jt])),ie=ce.fromConfigs(mt)}else ie=ce.fromConfigs([]);return{api:ie}}class so{getPlugins(){return this.app.getPlugins()}getSystemIcon(n){return this.app.getSystemIcon(n)}getSystemIcons(){return this.app.getSystemIcons()}getComponents(){return this.app.getComponents()}constructor(n){(0,z._)(this,"app",void 0),this.app=n}}var Sr=new WeakMap;class Io{getPlugins(){return Array.from(this.plugins)}getSystemIcon(n){return this.icons[n]}getSystemIcons(){return this.icons}getComponents(){return this.components}createRoot(n){const s=this.getProvider();return()=>(0,h.jsx)(s,{children:n})}getProvider(){if((0,x._)(this,Sr))throw new Error("app.getProvider() or app.createRoot() has already been called, and can only be called once");(0,Q._)(this,Sr,!0);const n=new so(this);let s=!1;return({children:p})=>{const A=(0,H.useRef)(!0),k=(0,H.useMemo)(()=>et.createWithStorage(this.themes),[]),{routing:U,featureFlags:ie,routeBindings:Ae}=(0,H.useMemo)(()=>{const jt=we({root:p,discoverers:[Ge,Gt],collectors:{routing:En()?to:Co,collectedPlugins:gn,featureFlags:yr}});return jt.collectedPlugins.forEach(Tt=>this.plugins.add(Tt)),this.verifyPlugins(this.plugins),this.getApiHolder(),{...jt,routeBindings:To(this.bindRoutes)}},[p]);s||(s=!0,_n(U.paths,U.parents),Br(Ae,this.plugins));const Le=Ro(this.configLoader,this.components,k),ze="api"in Le;if(ze){const{api:jt}=Le;this.configApi=jt}if("node"in Le)return Le.node;if(ze&&A.current){A.current=!1;const jt=this.getApiHolder().get(g.W0);if(jt){for(const Mt of this.featureFlags)jt.registerFlag({...Mt,pluginId:""});for(const Mt of this.plugins.values())if("getFeatureFlags"in Mt)for(const On of Mt.getFeatureFlags())jt.registerFlag({name:On.name,pluginId:Mt.getId()});else for(const On of Mt.output())On.type==="feature-flag"&&jt.registerFlag({name:On.name,pluginId:Mt.getId()});const Tt=jt.getRegisteredFlags(),zt=new Set(Tt.map(Mt=>Mt.name));for(const Mt of ie)zt.has(Mt)||jt.registerFlag({name:Mt,pluginId:""})}}const{ThemeProvider:mt=ro}=this.components;return(0,h.jsx)(it,{apis:this.getApiHolder(),children:(0,h.jsx)(jo,{appContext:n,children:(0,h.jsx)(mt,{children:(0,h.jsx)(Gr,{routePaths:U.paths,routeParents:U.parents,routeObjects:U.objects,routeBindings:Ae,basePath:Rn(Le.api),children:(0,h.jsx)(nn.Provider,{value:{routeObjects:U.objects,appIdentityProxy:this.appIdentityProxy},children:p})})})})})}}getRouter(){return c}getApiHolder(){if(this.apiHolder){for(const n of this.plugins)for(const s of n.getApis())this.apiFactoryRegistry.get(s.api)||this.apiFactoryRegistry.register("default",s);return nt.validateFactories(this.apiFactoryRegistry,this.apiFactoryRegistry.getAllApis()),this.apiHolder}this.apiFactoryRegistry.register("static",{api:g.hg,deps:{},factory:()=>et.createWithStorage(this.themes)}),this.apiFactoryRegistry.register("static",{api:g.Ds,deps:{},factory:()=>{if(!this.configApi)throw new Error("Tried to access config API before config was loaded");return this.configApi}}),this.apiFactoryRegistry.register("static",{api:g.$4,deps:{},factory:()=>this.appIdentityProxy}),this.apiFactoryRegistry.register("default",{api:g.W0,deps:{},factory:()=>new Qe});for(const n of this.defaultApis)this.apiFactoryRegistry.register("default",n);for(const n of this.plugins)for(const s of n.getApis())if(!this.apiFactoryRegistry.register("default",s))throw new Error(`Plugin ${n.getId()} tried to register duplicate or forbidden API factory for ${s.api}`);for(const n of this.apis)if(!this.apiFactoryRegistry.register("app",n))throw new Error(`Duplicate or forbidden API factory for ${n.api} in app`);return nt.validateFactories(this.apiFactoryRegistry,this.apiFactoryRegistry.getAllApis()),this.apiHolder=new nt(this.apiFactoryRegistry),this.apiHolder}verifyPlugins(n){const s=new Set;for(const a of n){const p=a.getId();if(s.has(p))throw new Error(`Duplicate plugin found '${p}'`);s.add(p)}}constructor(n){(0,z._)(this,"apiHolder",void 0),(0,z._)(this,"configApi",void 0),(0,z._)(this,"apis",void 0),(0,z._)(this,"icons",void 0),(0,z._)(this,"plugins",void 0),(0,z._)(this,"featureFlags",void 0),(0,z._)(this,"components",void 0),(0,z._)(this,"themes",void 0),(0,z._)(this,"configLoader",void 0),(0,z._)(this,"defaultApis",void 0),(0,z._)(this,"bindRoutes",void 0),(0,z._)(this,"appIdentityProxy",new no),(0,z._)(this,"apiFactoryRegistry",void 0),(0,j._)(this,Sr,{writable:!0,value:!1});var s;this.apis=(s=n.apis)!==null&&s!==void 0?s:[],this.icons=n.icons;var a;this.plugins=new Set((a=n.plugins)!==null&&a!==void 0?a:[]);var p;this.featureFlags=(p=n.featureFlags)!==null&&p!==void 0?p:[],this.components=n.components,this.themes=n.themes;var A;this.configLoader=(A=n.configLoader)!==null&&A!==void 0?A:Kr;var k;this.defaultApis=(k=n.defaultApis)!==null&&k!==void 0?k:[],this.bindRoutes=n.bindRoutes,this.apiFactoryRegistry=new St}}function wr(i){return new Io(i)}let cr=!1;const Po=i=>{const n=(0,g.qD)(),{NotFoundErrorPage:s}=n.getComponents(),a=(0,H.useMemo)(()=>En(),[]),A=[...(0,g.vJ)(i.children,k=>k.getElements().flatMap(U=>{let ie=U.props.path;if(ie==="")return[];var Ae;ie=(Ae=ie==null?void 0:ie.replace(/\/\*$/,""))!==null&&Ae!==void 0?Ae:"/";let Le=a?U:U.props.element;return!a&&!Le&&(Le=U,cr||(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] />} />."),cr=!0)),[{path:ie,element:Le,children:U.props.children?[{path:ie==="/"?"/":"*",element:U.props.children}]:void 0}]}).sort((U,ie)=>ie.path.localeCompare(U.path)).map(U=>({...U,path:U.path==="/"?"/":`${U.path}/*`}))),{path:"*",element:(0,h.jsx)(s,{})}];return(0,W.V$)(A)},Lo=(0,g.T0)({id:"plugin.permission.api"});var Xn;(function(i){i.DENY="DENY",i.ALLOW="ALLOW",i.CONDITIONAL="CONDITIONAL"})(Xn||(Xn={}));function ns(i,n){return i.name===n.name}function rs(i,n){return"resourceType"in i?!n||i.resourceType===n:!1}function os(i){return i.attributes.action==="create"}function ss(i){return i.attributes.action==="read"}function is(i){return i.attributes.action==="update"}function io(i){return i.attributes.action==="delete"}function as(i){return{authorize:async(n,s)=>await i.authorize(n,s),authorizeConditional(n,s){const a=n;return i.authorize(a,s)}}}function dr({name:i,attributes:n,resourceType:s}){return s?{type:"resource",name:i,attributes:n,resourceType:s}:{type:"basic",name:i,attributes:n}}var ao=r(23054),Oo=r(96279),Gn=r.n(Oo),lo=r(9571);const Fr=ut.z.lazy(()=>ut.z.object({rule:ut.z.string(),resourceType:ut.z.string(),params:ut.z.record(ut.z.any()).optional()}).or(ut.z.object({anyOf:ut.z.array(Fr).nonempty()})).or(ut.z.object({allOf:ut.z.array(Fr).nonempty()})).or(ut.z.object({not:Fr}))),ls=ut.z.object({result:ut.z.literal(Xn.ALLOW).or(ut.z.literal(Xn.DENY))}),cs=ut.z.union([ut.z.object({result:ut.z.literal(Xn.ALLOW).or(ut.z.literal(Xn.DENY))}),ut.z.object({result:ut.z.literal(Xn.CONDITIONAL),pluginId:ut.z.string(),resourceType:ut.z.string(),conditions:Fr})]),b=(i,n)=>ut.z.object({items:ut.z.array(ut.z.intersection(ut.z.object({id:ut.z.string()}),i)).refine(s=>s.length===n.size&&s.every(({id:a})=>n.has(a)),{message:"Items in response do not match request"})});class E{async authorize(n,s){return this.makeRequest(n,ls,s)}async authorizeConditional(n,s){return this.makeRequest(n,cs,s)}async makeRequest(n,s,a){if(!this.enabled)return n.map(Le=>({result:Xn.ALLOW}));const p={items:n.map(Le=>({id:lo.Z(),...Le}))},A=await this.discovery.getBaseUrl("permission"),k=await Gn()(`${A}/authorize`,{method:"POST",body:JSON.stringify(p),headers:{...this.getAuthorizationHeader(a==null?void 0:a.token),"content-type":"application/json"}});if(!k.ok)throw await ao.VL.fromResponse(k);const U=await k.json(),Ae=b(s,new Set(p.items.map(({id:Le})=>Le))).parse(U).items.reduce((Le,ze)=>(Le[ze.id]=ze,Le),{});return p.items.map(Le=>Ae[Le.id])}getAuthorizationHeader(n){return n?{Authorization:`Bearer ${n}`}:{}}constructor(n){(0,z._)(this,"enabled",void 0),(0,z._)(this,"discovery",void 0),this.discovery=n.discovery;var s;this.enabled=(s=n.config.getOptionalBoolean("permission.enabled"))!==null&&s!==void 0?s:!1}}class R{static create(n){const{config:s,discovery:a,identity:p}=n,A=new E({discovery:a,config:s});return new R(A,p)}async authorize(n){return(await this.permissionClient.authorize([n],await this.identityApi.getCredentials()))[0]}constructor(n,s){(0,z._)(this,"permissionClient",void 0),(0,z._)(this,"identityApi",void 0),this.permissionClient=n,this.identityApi=s}}var D=r(69984);function te(i){const n=(0,g.h_)(Lo),{data:s,error:a}=(0,D.ZP)(i,async p=>{if(rs(p.permission)&&!p.resourceRef)return Xn.DENY;const{result:A}=await n.authorize(p);return A});return a?{error:a,loading:!1,allowed:!1}:s===void 0?{loading:!0,allowed:!1}:{loading:!1,allowed:s===Xn.ALLOW}}const de=i=>{const{permission:n,resourceRef:s,errorComponent:a,...p}=i,A=usePermission(isResourcePermission(n)?{permission:n,resourceRef:s}:{permission:n}),k=useApp(),{NotFoundErrorPage:U}=k.getComponents();let ie=a===void 0?_jsx(U,{}):a;return A.loading?ie=null:A.allowed&&(ie=i.element),_jsx(Route,{...p,element:ie})};function ae(i){const{permission:n,resourceRef:s}=i,a=usePermission(isResourcePermission(n)?{permission:n,resourceRef:s}:{permission:n}),p=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:A}=p.getComponents();return _jsx(A,{})}const xe=[(0,g.ni)({api:g.NW,deps:{configApi:g.Ds},factory:({configApi:i})=>Z.compile(`${i.getString("backend.baseUrl")}/api/{{ pluginId }}`)}),(0,g.ni)({api:g.$v,deps:{},factory:()=>new N}),(0,g.ni)({api:g.v_,deps:{},factory:()=>new ve}),(0,g.ni)({api:g.VE,deps:{alertApi:g.$v},factory:({alertApi:i})=>{const n=new q(i,new Y);return Ce.forward(n,{hidden:!1}),n}}),(0,g.ni)({api:g.E6,deps:{errorApi:g.VE},factory:({errorApi:i})=>Lt.create({errorApi:i})}),(0,g.ni)({api:g.gP,deps:{configApi:g.Ds,identityApi:g.$4,discoveryApi:g.NW},factory:({configApi:i,identityApi:n,discoveryApi:s})=>Et({middleware:[Ut.resolvePluginProtocol({discoveryApi:s}),Ut.injectIdentityAuth({identityApi:n,config:i})]})}),(0,g.ni)({api:g.ZM,deps:{},factory:()=>new At}),(0,g.ni)({api:g.Kp,deps:{discoveryApi:g.NW,oauthRequestApi:g.ZM,configApi:g.Ds},factory:({discoveryApi:i,oauthRequestApi:n,configApi:s})=>$n.create({configApi:s,discoveryApi:i,oauthRequestApi:n,environment:s.getOptionalString("auth.environment")})}),(0,g.ni)({api:g.p_,deps:{discoveryApi:g.NW,oauthRequestApi:g.ZM,configApi:g.Ds},factory:({discoveryApi:i,oauthRequestApi:n,configApi:s})=>Vt.create({configApi:s,discoveryApi:i,oauthRequestApi:n,environment:s.getOptionalString("auth.environment")})}),(0,g.ni)({api:g.F4,deps:{discoveryApi:g.NW,oauthRequestApi:g.ZM,configApi:g.Ds},factory:({discoveryApi:i,oauthRequestApi:n,configApi:s})=>Kt.create({configApi:s,discoveryApi:i,oauthRequestApi:n,defaultScopes:["read:user"],environment:s.getOptionalString("auth.environment")})}),(0,g.ni)({api:g.D,deps:{discoveryApi:g.NW,oauthRequestApi:g.ZM,configApi:g.Ds},factory:({discoveryApi:i,oauthRequestApi:n,configApi:s})=>zn.create({configApi:s,discoveryApi:i,oauthRequestApi:n,environment:s.getOptionalString("auth.environment")})}),(0,g.ni)({api:g.ux,deps:{discoveryApi:g.NW,oauthRequestApi:g.ZM,configApi:g.Ds},factory:({discoveryApi:i,oauthRequestApi:n,configApi:s})=>Mn.create({configApi:s,discoveryApi:i,oauthRequestApi:n,environment:s.getOptionalString("auth.environment")})}),(0,g.ni)({api:g.gW,deps:{discoveryApi:g.NW,oauthRequestApi:g.ZM,configApi:g.Ds},factory:({discoveryApi:i,oauthRequestApi:n,configApi:s})=>Yn.create({configApi:s,discoveryApi:i,oauthRequestApi:n,environment:s.getOptionalString("auth.environment")})}),(0,g.ni)({api:g.bq,deps:{discoveryApi:g.NW,oauthRequestApi:g.ZM,configApi:g.Ds},factory:({discoveryApi:i,oauthRequestApi:n,configApi:s})=>le.create({configApi:s,discoveryApi:i,oauthRequestApi:n,defaultScopes:["team"],environment:s.getOptionalString("auth.environment")})}),(0,g.ni)({api:g.Km,deps:{discoveryApi:g.NW,oauthRequestApi:g.ZM,configApi:g.Ds},factory:({discoveryApi:i,oauthRequestApi:n,configApi:s})=>Ue.create({configApi:s,discoveryApi:i,oauthRequestApi:n,defaultScopes:["REPO_READ"]})}),(0,g.ni)({api:g.uB,deps:{discoveryApi:g.NW,oauthRequestApi:g.ZM,configApi:g.Ds},factory:({discoveryApi:i,oauthRequestApi:n,configApi:s})=>_.create({configApi:s,discoveryApi:i,oauthRequestApi:n,environment:s.getOptionalString("auth.environment")})}),(0,g.ni)({api:Lo,deps:{discovery:g.NW,identity:g.$4,config:g.Ds},factory:({config:i,discovery:n,identity:s})=>R.create({config:i,discovery:n,identity:s})})];var Te=r(77277),me=r(53974),De=r(71597);function Ne({children:i}){return(0,W.GV)()?(0,h.jsx)(h.Fragment,{children:i}):(0,h.jsx)(W.VA,{children:i})}const rt=()=>(0,h.jsx)(me.mf,{status:"404",statusMessage:"PAGE NOT FOUND"}),ct=({step:i,error:n})=>{let s="";return i==="load-config"?s=`The configuration failed to load, someone should have a look at this error: ${n.message}`:i==="load-chunk"&&(s=`Lazy loaded chunk failed to load, try to reload the page: ${n.message}`),(0,h.jsx)(Ne,{children:(0,h.jsx)(me.mf,{status:"501",statusMessage:s})})},Ye=({error:i,resetError:n,plugin:s})=>(0,h.jsx)(me.yu,{title:`Error in ${s==null?void 0:s.getId()}`,defaultExpanded:!0,error:i,children:(0,h.jsx)(Te.Z,{variant:"outlined",onClick:n,children:"Retry"})}),ke={Progress:me.Ex,Router:De.VK,NotFoundErrorPage:rt,BootErrorPage:ct,ErrorBoundaryFallback:Ye};var Xe=r(43642),gt=r(80079),ln=r(90941),Qt=r(32915),sn=r(40562),cn=r(21853),Pn=r(60744),Zn=r(66569),jr=r(30254),Er=r(13384),Yr=r(15933),Ln=r(58838),Nn=r(86737),Ar=r(4989),Ms=r(44407),zs=r(18628),Ws=r(84219),Vs=r(98685),ds=r(39781);const Bi={brokenImage:gt.Z,catalog:zs.Z,scaffolder:Qt.Z,techdocs:sn.Z,search:cn.Z,chat:Pn.Z,dashboard:Zn.Z,docs:jr.Z,email:Er.Z,github:Ln.Z,group:Ws.Z,help:Nn.Z,"kind:api":Yr.Z,"kind:component":Ms.Z,"kind:domain":Xe.Z,"kind:group":Ws.Z,"kind:location":Ar.Z,"kind:system":ln.Z,"kind:user":Vs.Z,user:Vs.Z,warning:ds.Z};var us=r(73689),hs=r(48032);const er={wave:`url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='1368' height='400' fill='none'%3e%3cmask id='a' width='1368' height='401' x='0' y='0' maskUnits='userSpaceOnUse'%3e%3cpath fill='url(%23paint0_linear)' d='M437 116C223 116 112 0 112 0h1256v400c-82 0-225-21-282-109-112-175-436-175-649-175z'/%3e%3cpath fill='url(%23paint1_linear)' d='M1368 400V282C891-29 788 40 711 161 608 324 121 372 0 361v39h1368z'/%3e%3cpath fill='url(%23paint2_linear)' d='M1368 244v156H0V94c92-24 198-46 375 0l135 41c176 51 195 109 858 109z'/%3e%3cpath fill='url(%23paint3_linear)' d='M1252 400h116c-14-7-35-14-116-16-663-14-837-128-1013-258l-85-61C98 28 46 8 0 0v400h1252z'/%3e%3c/mask%3e%3cg mask='url(%23a)'%3e%3cpath fill='white' d='M-172-98h1671v601H-172z'/%3e%3c/g%3e%3cdefs%3e%3clinearGradient id='paint0_linear' x1='602' x2='1093.5' y1='-960.5' y2='272' gradientUnits='userSpaceOnUse'%3e%3cstop stop-color='white'/%3e%3cstop offset='1' stop-color='white' stop-opacity='0'/%3e%3c/linearGradient%3e%3clinearGradient id='paint1_linear' x1='482' x2='480' y1='1058.5' y2='70.5' gradientUnits='userSpaceOnUse'%3e%3cstop stop-color='white'/%3e%3cstop offset='1' stop-color='white' stop-opacity='0'/%3e%3c/linearGradient%3e%3clinearGradient id='paint2_linear' x1='424' x2='446.1' y1='-587.5' y2='274.6' gradientUnits='userSpaceOnUse'%3e%3cstop stop-color='white'/%3e%3cstop offset='1' stop-color='white' stop-opacity='0'/%3e%3c/linearGradient%3e%3clinearGradient id='paint3_linear' x1='587' x2='349' y1='-1120.5' y2='341' gradientUnits='userSpaceOnUse'%3e%3cstop stop-color='white'/%3e%3cstop offset='1' stop-color='white' stop-opacity='0'/%3e%3c/linearGradient%3e%3c/defs%3e%3c/svg%3e")`,wave2:`url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='1368' height='400' fill='none'%3e%3cmask id='a' width='1764' height='479' x='-229' y='-6' maskUnits='userSpaceOnUse'%3e%3cpath fill='url(%23paint0_linear)' d='M0 400h1350C1321 336 525 33 179-2c-345-34-395 236-408 402H0z'/%3e%3cpath fill='url(%23paint1_linear)' d='M1378 177v223H0V217s219 75 327 52C436 246 717-35 965 45s254 144 413 132z'/%3e%3cpath fill='url(%23paint2_linear)' d='M26 400l-78-16c-170 205-44-6-137-30l-4-1 4 1 137 30c37-45 89-110 159-201 399-514-45 238 1176-50 275-65 354-39 91 267H26z'/%3e%3c/mask%3e%3cg mask='url(%23a)'%3e%3cpath fill='white' d='M0 0h1368v400H0z'/%3e%3c/g%3e%3cdefs%3e%3clinearGradient id='paint0_linear' x1='431' x2='397.3' y1='-599' y2='372.8' gradientUnits='userSpaceOnUse'%3e%3cstop stop-color='white'/%3e%3cstop offset='1' stop-color='white' stop-opacity='0'/%3e%3c/linearGradient%3e%3clinearGradient id='paint1_linear' x1='236.5' x2='446.6' y1='-586' y2='381.5' gradientUnits='userSpaceOnUse'%3e%3cstop stop-color='white'/%3e%3cstop offset='1' stop-color='white' stop-opacity='0'/%3e%3c/linearGradient%3e%3clinearGradient id='paint2_linear' x1='851.8' x2='640.4' y1='-867.2' y2='363.7' gradientUnits='userSpaceOnUse'%3e%3cstop stop-color='white'/%3e%3cstop offset='1' stop-color='white' stop-opacity='0'/%3e%3c/linearGradient%3e%3c/defs%3e%3c/svg%3e")`,round:`url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='1368' height='400' fill='none'%3e%3cmask id='a' width='2269' height='1408' x='-610' y='-509' maskUnits='userSpaceOnUse'%3e%3ccircle cx='1212.8' cy='74.8' r='317.5' fill='url(%23paint0_linear)' transform='rotate(-52 1213 75)'/%3e%3ccircle cx='737.8' cy='445.8' r='317.5' fill='url(%23paint1_linear)' transform='rotate(-116 738 446)'/%3e%3ccircle cx='601.8' cy='52.8' r='418.6' fill='url(%23paint2_linear)' transform='rotate(-117 602 53)'/%3e%3ccircle cx='999.8' cy='364' r='389.1' fill='url(%23paint3_linear)' transform='rotate(31 1000 364)'/%3e%3cellipse cx='-109.2' cy='263.5' fill='url(%23paint4_linear)' rx='429.2' ry='465.8' transform='rotate(-85 -109 264)'/%3e%3c/mask%3e%3cg mask='url(%23a)'%3e%3cpath fill='white' d='M0 0h1368v400H0z'/%3e%3c/g%3e%3cdefs%3e%3clinearGradient id='paint0_linear' x1='1301.2' x2='161.4' y1='-1879.7' y2='-969.6' gradientUnits='userSpaceOnUse'%3e%3cstop stop-color='white'/%3e%3cstop offset='1' stop-color='white' stop-opacity='0'/%3e%3c/linearGradient%3e%3clinearGradient id='paint1_linear' x1='826.2' x2='-313.6' y1='-1508.7' y2='-598.6' gradientUnits='userSpaceOnUse'%3e%3cstop stop-color='white'/%3e%3cstop offset='1' stop-color='white' stop-opacity='0'/%3e%3c/linearGradient%3e%3clinearGradient id='paint2_linear' x1='718.4' x2='-784.3' y1='-2524' y2='-1324.2' gradientUnits='userSpaceOnUse'%3e%3cstop stop-color='white'/%3e%3cstop offset='1' stop-color='white' stop-opacity='0'/%3e%3c/linearGradient%3e%3clinearGradient id='paint3_linear' x1='1108.2' x2='-288.6' y1='-2031.1' y2='-915.9' gradientUnits='userSpaceOnUse'%3e%3cstop stop-color='white'/%3e%3cstop offset='1' stop-color='white' stop-opacity='0'/%3e%3c/linearGradient%3e%3clinearGradient id='paint4_linear' x1='10.4' x2='-1626.5' y1='-2603.8' y2='-1399.5' gradientUnits='userSpaceOnUse'%3e%3cstop stop-color='white'/%3e%3cstop offset='1' stop-color='white' stop-opacity='0'/%3e%3c/linearGradient%3e%3c/defs%3e%3c/svg%3e")`},tr={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 or(i){const{colors:n,shape:s,options:a}=i,A=`linear-gradient(90deg, ${(n.length===1?[n[0],n[0]]:n).join(", ")})`,k=`${s}, ${A}`;var U;const ie=(U=a==null?void 0:a.fontColor)!==null&&U!==void 0?U:"#FFFFFF";return{colors:n,shape:s,backgroundImage:k,fontColor:ie}}const ko={home:or({colors:tr.teal,shape:er.wave}),documentation:or({colors:tr.pinkSea,shape:er.wave2}),tool:or({colors:tr.purpleSky,shape:er.round}),service:or({colors:tr.marineBlue,shape:er.wave}),website:or({colors:tr.veryBlue,shape:er.wave}),library:or({colors:tr.rubyRed,shape:er.wave}),other:or({colors:tr.darkGrey,shape:er.wave}),app:or({colors:tr.toastyOrange,shape:er.wave}),apis:or({colors:tr.teal,shape:er.wave2}),card:or({colors:tr.greens,shape:er.wave})},Bo=16,Hs='"Helvetica Neue", Helvetica, Roboto, Arial, sans-serif';function Gs(i){const{palette:n,htmlFontSize:s=Bo,fontFamily:a=Hs,defaultPageTheme:p,pageTheme:A=ko}=i;if(!A[p])throw new Error(`${p} is not defined in pageTheme.`);var k;return{palette:n,props:{MuiGrid:{spacing:2},MuiSwitch:{color:"primary"}},typography:{htmlFontSize:s,fontFamily:a,h6:{fontWeight:700,fontSize:20,marginBottom:2},h5:{fontWeight:700,fontSize:24,marginBottom:4},h4:{fontWeight:700,fontSize:28,marginBottom:6},h3:{fontSize:32,fontWeight:700,marginBottom:6},h2:{fontSize:40,fontWeight:700,marginBottom:8},h1:{fontSize:54,fontWeight:700,marginBottom:10}},page:A[p],getPageTheme:({themeId:U})=>(k=A[U])!==null&&k!==void 0?k:A[p]}}function Ks(i){return{MuiCssBaseline:{"@global":{html:{height:"100%",fontFamily:i.typography.fontFamily},body:{height:"100%",fontFamily:i.typography.fontFamily,"overscroll-behavior-y":"none"},a:{color:"inherit",textDecoration:"none"}}},MuiTableRow:{root:{"&:nth-of-type(odd)":{backgroundColor:i.palette.background.default}},hover:{"&:hover":{cursor:"pointer"}},head:{"&:nth-of-type(odd)":{backgroundColor:i.palette.background.paper}}},MuiTableCell:{root:{wordBreak:"break-word",overflow:"hidden",verticalAlign:"middle",lineHeight:"1",margin:0,padding:i.spacing(3,2,3,2.5),borderBottom:0},sizeSmall:{padding:i.spacing(1.5,2,1.5,2.5)},head:{wordBreak:"break-word",overflow:"hidden",color:i.palette.textSubtle,fontWeight:"normal",lineHeight:"1"}},MuiTabs:{root:{minHeight:24}},MuiTab:{root:{color:i.palette.link,minHeight:24,textTransform:"initial",letterSpacing:"0.07em","&:hover":{color:(0,hs.darken)(i.palette.link,.3),background:(0,hs.lighten)(i.palette.link,.95)},[i.breakpoints.up("md")]:{minWidth:120,fontSize:i.typography.pxToRem(14),fontWeight:500}},textColorPrimary:{color:i.palette.link}},MuiTableSortLabel:{root:{color:"inherit","&:hover":{color:"inherit"},"&:focus":{color:"inherit"}},active:{fontWeight:"bold",color:"inherit"}},MuiListItemText:{dense:{whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"}},MuiButton:{text:{padding:void 0}},MuiChip:{root:{backgroundColor:"#D9D9D9",marginRight:i.spacing(1),marginBottom:i.spacing(1),color:i.palette.grey[900]},outlined:{color:i.palette.text.primary},label:{lineHeight:`${i.spacing(2.5)}px`,fontWeight:i.typography.fontWeightMedium,fontSize:`${i.spacing(1.75)}px`},labelSmall:{fontSize:`${i.spacing(1.5)}px`},deleteIcon:{color:i.palette.grey[500],width:`${i.spacing(3)}px`,height:`${i.spacing(3)}px`,margin:`0 ${i.spacing(.75)}px 0 -${i.spacing(.75)}px`},deleteIconSmall:{width:`${i.spacing(2)}px`,height:`${i.spacing(2)}px`,margin:`0 ${i.spacing(.5)}px 0 -${i.spacing(.5)}px`}},MuiCard:{root:{display:"flex",flexDirection:"column"}},MuiCardHeader:{root:{paddingBottom:0}},MuiCardContent:{root:{flexGrow:1,"&:last-child":{paddingBottom:void 0}}},MuiCardActions:{root:{justifyContent:"flex-end"}}}}function Ys(i){const n=Gs(i),s=(0,us.Z)(n),a=Ks(s);return{...s,overrides:a}}var ps=r(34505);const Js=Ys({palette:{type:"light",background:{default:"#F8F8F8"},status:{ok:"#1DB954",warning:"#FF9800",error:"#E22134",running:"#2E77D0",pending:"#FFED51",aborted:"#757575"},bursts:{fontColor:"#FEFEFE",slackChannelText:"#ddd",backgroundColor:{default:"#7C3699"},gradient:{linear:"linear-gradient(-137deg, #4BB8A5 0%, #187656 100%)"}},primary:{main:"#2E77D0"},banner:{info:"#2E77D0",error:"#E22134",text:"#FFFFFF",link:"#000000",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:ps.Z.A700,navigation:{background:"#171717",indicator:"#9BF0E1",color:"#b5b5b5",selectedColor:"#FFF",navItem:{hoverBackground:"#404040"},submenu:{background:"#404040"}},pinSidebarButton:{icon:"#181818",background:"#BDBDBD"},tabbar:{indicator:"#9BF0E1"}},defaultPageTheme:"home",pageTheme:ko}),fs=Ys({palette:{type:"dark",background:{default:"#333333"},status:{ok:"#71CF88",warning:"#FFB84D",error:"#F84C55",running:"#3488E3",pending:"#FEF071",aborted:"#9E9E9E"},bursts:{fontColor:"#FEFEFE",slackChannelText:"#ddd",backgroundColor:{default:"#7C3699"},gradient:{linear:"linear-gradient(-137deg, #4BB8A5 0%, #187656 100%)"}},primary:{main:"#9CC9FF",dark:"#82BAFD"},secondary:{main:"#FF88B2"},banner:{info:"#2E77D0",error:"#E22134",text:"#FFFFFF",link:"#000000",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:ps.Z.A700,navigation:{background:"#424242",indicator:"#9BF0E1",color:"#b5b5b5",selectedColor:"#FFF",navItem:{hoverBackground:"#404040"},submenu:{background:"#404040"}},pinSidebarButton:{icon:"#404040",background:"#BDBDBD"},tabbar:{indicator:"#9BF0E1"}},defaultPageTheme:"home",pageTheme:ko});var Jr=r(98192),Qs=r(15222),$o=r(41547),gs=r(87561);const ms=[{id:"light",title:"Light Theme",variant:"light",icon:(0,h.jsx)(Qs.Z,{}),Provider:({children:i})=>(0,h.jsx)($o.Z,{theme:Js,children:(0,h.jsx)(gs.ZP,{children:i})})},{id:"dark",title:"Dark Theme",variant:"dark",icon:(0,h.jsx)(Jr.Z,{}),Provider:({children:i})=>(0,h.jsx)($o.Z,{theme:fs,children:(0,h.jsx)(gs.ZP,{children:i})})}];function vs(i){var n,s,a,p;return wr({...i,apis:(n=i==null?void 0:i.apis)!==null&&n!==void 0?n:[],bindRoutes:i==null?void 0:i.bindRoutes,components:{...ke,...i==null?void 0:i.components},configLoader:i==null?void 0:i.configLoader,defaultApis:xe,icons:{...Bi,...i==null?void 0:i.icons},plugins:(s=i==null?void 0:i.plugins)!==null&&s!==void 0?s:[],featureFlags:(a=i==null?void 0:i.featureFlags)!==null&&a!==void 0?a:[],themes:(p=i==null?void 0:i.themes)!==null&&p!==void 0?p:ms})}var co=r(25271),Xs=r(76635);async function _s({storageApi:i}){const n=i.forBucket("settings"),s=i.forBucket("starredEntities"),a=n.snapshot("starredEntities").value;if(!(0,Xs.isArray)(a))return;var p;const A=new Set((p=s.snapshot("entityRefs").value)!==null&&p!==void 0?p:[]);a.filter(Xs.isString).map(k=>k.split(":")).filter(k=>k.length===4&&k[0]==="entity").map(([k,U,ie,Ae])=>(0,co.eE)({kind:U,namespace:ie,name:Ae})).forEach(k=>A.add(k)),await s.set("entityRefs",Array.from(A)),await n.remove("starredEntities")}class ys{async toggleStarred(n){this.starredEntities.has(n)?this.starredEntities.delete(n):this.starredEntities.add(n),await this.settingsStore.set("entityRefs",Array.from(this.starredEntities))}starredEntitie$(){return this.observable}notifyChanges(){for(const n of this.subscribers)n.next(new Set(this.starredEntities))}constructor(n){(0,z._)(this,"settingsStore",void 0),(0,z._)(this,"starredEntities",void 0),(0,z._)(this,"subscribers",new Set),(0,z._)(this,"observable",new(be())(a=>(a.next(new Set(this.starredEntities)),this.subscribers.add(a),()=>{this.subscribers.delete(a)}))),_s(n).then(),this.settingsStore=n.storageApi.forBucket("starredEntities");var s;this.starredEntities=new Set((s=this.settingsStore.snapshot("entityRefs").value)!==null&&s!==void 0?s:[]),this.settingsStore.observe$("entityRefs").subscribe({next:a=>{var p;this.starredEntities=new Set((p=a.value)!==null&&p!==void 0?p:[]),this.notifyChanges()}})}}var $i=r(33414),Tn=r(79692),Di=r(12420),Kn=r(40303),Aa=r(19928);function Ta(){const i=useApi(catalogApiRef),{error:n,loading:s,value:a}=useAsync(async()=>await i.getEntityFacets({facets:["kind"]}).then(A=>{var k;return((k=A.facets.kind)===null||k===void 0?void 0:k.map(U=>U.value).sort())||[]}),[i]);return{loading:s,error:n,allKinds:a!=null?a:[]}}function Ra(i,n,s){let a=i;return n&&(a=a.filter(A=>n.some(k=>k.toLocaleLowerCase("en-US")===A.toLocaleLowerCase("en-US")))),s&&!i.some(A=>A.toLocaleLowerCase("en-US")===s.toLocaleLowerCase("en-US"))&&(a=a.concat([s])),a.sort().reduce((A,k)=>(A[k.toLocaleLowerCase("en-US")]=k,A),{})}const Zi=(0,Tn.Z)(i=>(0,Di.Z)({root:{...i.typography.h4}}));function Ia(i){var n;const{initialFilter:s="component",allowedKinds:a}=i,p=Zi(),{allKinds:A}=useAllKinds(),{filters:k,updateFilters:U,queryParameters:{kind:ie}}=useEntityList(),Ae=useMemo(()=>[ie].flat()[0],[ie]);var Le;const[ze,mt]=useState((Le=Ae!=null?Ae:(n=k.kind)===null||n===void 0?void 0:n.value)!==null&&Le!==void 0?Le:s);useEffect(()=>{Ae&&mt(Ae)},[Ae]),useEffect(()=>{var Tt;if(!((Tt=k.kind)===null||Tt===void 0)&&Tt.value){var zt;mt((zt=k.kind)===null||zt===void 0?void 0:zt.value)}},[k.kind]),useEffect(()=>{U({kind:ze?new EntityKindFilter(ze):void 0})},[ze,U]);const jt=filterKinds(A,a,ze);return _jsx(Select,{input:_jsx(InputBase,{}),value:ze.toLocaleLowerCase("en-US"),onChange:Tt=>mt(Tt.target.value),classes:p,children:Object.keys(jt).map(Tt=>_jsx(MenuItem,{value:Tt,children:`${pluralize(jt[Tt])}`},Tt))})}var Pa=r(86359),Ur=r(95544),Ni=r(99688),Do=r(12231),uo=r(86136),ho=r(49378),Zo=r(85256),xs=r(80030),bs=r(61837),ei=r(79784),No=r(50758),ur=r(31654),Fo=r(43054),po=r(65759),ti=r(49280),Ss=r(96641);function hr(i){const{entity:n,loading:s,error:a}=(0,Ss.ce)(),{allowed:p,loading:A,error:k}=te({permission:i,resourceRef:n?(0,co.eE)(n):void 0});return s||A?{loading:!0,allowed:!1}:a?{loading:!1,allowed:!1,error:a}:{loading:!1,allowed:p,error:k}}const Uo="catalog-entity",Cs=dr({name:"catalog.entity.read",attributes:{action:"read"},resourceType:Uo}),ni=dr({name:"catalog.entity.create",attributes:{action:"create"}}),ri=dr({name:"catalog.entity.delete",attributes:{action:"delete"},resourceType:Uo}),sr=dr({name:"catalog.entity.refresh",attributes:{action:"update"},resourceType:Uo}),ws=dr({name:"catalog.location.read",attributes:{action:"read"}}),oi=dr({name:"catalog.location.create",attributes:{action:"create"}}),si=dr({name:"catalog.location.delete",attributes:{action:"delete"}}),Fi=[Cs,ni,ri,sr,ws,oi,si];var ii=r(49166);function fo(i){const{unregisterEntityOptions:n,isUnregisterAllowed:s,onUnregisterEntity:a,onClose:p}=i,A=typeof(n==null?void 0:n.disableUnregister)=="boolean";var k;const U=(k=!s||(A?!!(n!=null&&n.disableUnregister):(n==null?void 0:n.disableUnregister)==="disable"))!==null&&k!==void 0?k:!1;let ie=(0,h.jsx)(h.Fragment,{});return(n==null?void 0:n.disableUnregister)!=="hidden"&&(ie=(0,h.jsxs)(Do.Z,{onClick:()=>{p(),a()},disabled:U,children:[(0,h.jsx)(uo.Z,{children:(0,h.jsx)(ii.Z,{fontSize:"small"})}),(0,h.jsx)(ho.Z,{primary:"Unregister entity"})]})),(0,h.jsx)(h.Fragment,{children:ie})}const js=(0,Tn.Z)(i=>({button:{color:i.page.fontColor}}),{name:"PluginCatalogEntityContextMenu"});function Es(i){const{UNSTABLE_extraContextMenuItems:n,UNSTABLE_contextMenuOptions:s,onUnregisterEntity:a,onInspectEntity:p}=i,[A,k]=(0,H.useState)(),U=js(),Ae=hr(ri).allowed,Le=zt=>{k(zt.currentTarget)},ze=()=>{k(void 0)},mt=(0,g.h_)(g.$v),jt=(0,H.useCallback)(()=>{window.navigator.clipboard.writeText(window.location.toString()).then(()=>mt.post({message:"Copied!",severity:"info",display:"transient"}))},[mt]),Tt=n&&[...n.map(zt=>(0,h.jsxs)(Do.Z,{onClick:()=>{ze(),zt.onClick()},children:[(0,h.jsx)(uo.Z,{children:(0,h.jsx)(zt.Icon,{fontSize:"small"})}),(0,h.jsx)(ho.Z,{primary:zt.title})]},zt.title)),(0,h.jsx)(Zo.Z,{},"the divider is here!")];return(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(xs.ZP,{title:"More",arrow:!0,children:(0,h.jsx)(bs.Z,{"aria-label":"more","aria-controls":"long-menu","aria-haspopup":"true","aria-expanded":!!A,role:"button",onClick:Le,"data-testid":"menu-button",className:U.button,id:"long-menu",children:(0,h.jsx)(Fo.Z,{})})}),(0,h.jsx)(ei.ZP,{open:Boolean(A),onClose:ze,anchorEl:A,anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"},"aria-labelledby":"long-menu",children:(0,h.jsxs)(No.Z,{children:[Tt,(0,h.jsx)(fo,{unregisterEntityOptions:s,isUnregisterAllowed:Ae,onUnregisterEntity:a,onClose:ze}),(0,h.jsxs)(Do.Z,{onClick:()=>{ze(),p()},children:[(0,h.jsx)(uo.Z,{children:(0,h.jsx)(ur.Z,{fontSize:"small"})}),(0,h.jsx)(ho.Z,{primary:"Inspect entity"})]}),(0,h.jsxs)(Do.Z,{onClick:()=>{ze(),jt()},children:[(0,h.jsx)(uo.Z,{children:(0,h.jsx)(po.Z,{fontSize:"small"})}),(0,h.jsx)(ho.Z,{primary:"Copy entity URL"})]})]})})]})}const Mo="plugin.catalog.entityLayoutRoute",go=()=>null;(0,g.R5)(go,Mo,!0),(0,g.R5)(go,"core.gatherMountPoints",!0);function zo(i){const{entity:n,title:s}=i;return(0,h.jsxs)(Ur.Z,{display:"inline-flex",alignItems:"center",height:"1em",maxWidth:"100%",children:[(0,h.jsx)(Ur.Z,{component:"span",textOverflow:"ellipsis",whiteSpace:"nowrap",overflow:"hidden",children:s}),n&&(0,h.jsx)(Kn.LH,{entity:n})]})}function ai(i,n,s,a){var p;const A=(p=i!=null?i:a==null?void 0:a.kind)!==null&&p!==void 0?p:"";var k;const U=(k=n!=null?n:a==null?void 0:a.metadata.namespace)!==null&&k!==void 0?k:"";var ie,Ae,Le;return{headerTitle:`${(Le=(Ae=(ie=a==null?void 0:a.metadata.title)!==null&&ie!==void 0?ie:s)!==null&&Ae!==void 0?Ae:a==null?void 0:a.metadata.name)!==null&&Le!==void 0?Le:""}${U&&U!==co.zG?` in ${U}`:""}`,headerType:(()=>{let mt=A.toLocaleLowerCase("en-US");return a&&a.spec&&"type"in a.spec&&(mt+=" \u2014 ",mt+=a.spec.type.toLocaleLowerCase("en-US")),mt})()}}function As(i){var n;const{entity:s}=i,a=(0,Kn.hF)(s,co.S4);return(0,h.jsxs)(h.Fragment,{children:[a.length>0&&(0,h.jsx)(me.i9,{label:"Owner",value:(0,h.jsx)(Kn.rI,{entityRefs:a,defaultKind:"Group",color:"inherit"})}),((n=s.spec)===null||n===void 0?void 0:n.lifecycle)&&(0,h.jsx)(me.i9,{label:"Lifecycle",value:s.spec.lifecycle})]})}const Ts=i=>{var n,s;const{UNSTABLE_extraContextMenuItems:a,UNSTABLE_contextMenuOptions:p,children:A,NotFoundComponent:k}=i,{kind:U,namespace:ie,name:Ae}=(0,g.Oi)(Kn.wi),{entity:Le,loading:ze,error:mt}=(0,Kn.ce)(),jt=(0,W.TH)(),Tt=(0,g.vJ)(A,Ai=>Ai.selectByComponentData({key:Mo,withStrictError:"Child of EntityLayout must be an EntityLayout.Route"}).getElements().flatMap(({props:zr})=>{if(Le){if(zr.if&&!zr.if(Le))return[]}else return[];return[{path:zr.path,title:zr.title,children:zr.children,tabProps:zr.tabProps}]}),[Le]),{headerTitle:zt,headerType:Mt}=ai(U,ie,Ae,Le),[On,ar]=(0,H.useState)(!1),[pr,Mr]=(0,H.useState)(!1),ji=(0,W.s0)(),Ei=async()=>{ar(!1),Mr(!1),ji("/")};(0,H.useEffect)(()=>{ar(!1),Mr(!1)},[jt.pathname]);var Jo;return(0,h.jsxs)(me.T3,{themeId:(Jo=Le==null||(n=Le.spec)===null||n===void 0||(s=n.type)===null||s===void 0?void 0:s.toString())!==null&&Jo!==void 0?Jo:"home",children:[(0,h.jsx)(me.h4,{title:(0,h.jsx)(zo,{title:zt,entity:Le}),pageTitleOverride:zt,type:Mt,children:Le&&(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(As,{entity:Le}),(0,h.jsx)(Es,{UNSTABLE_extraContextMenuItems:a,UNSTABLE_contextMenuOptions:p,onUnregisterEntity:()=>ar(!0),onInspectEntity:()=>Mr(!0)})]})}),ze&&(0,h.jsx)(me.Ex,{}),Le&&(0,h.jsx)(me.tn,{routes:Tt}),mt&&(0,h.jsx)(me.VY,{children:(0,h.jsx)(Ni.Z,{severity:"error",children:mt.toString()})}),!ze&&!mt&&!Le&&(0,h.jsx)(me.VY,{children:k||(0,h.jsxs)(me.GB,{title:"Entity not found",children:["There is no ",U," with the requested"," ",(0,h.jsx)(me.rU,{to:"https://backstage.io/docs/features/software-catalog/references",children:"kind, namespace, and name"}),"."]})}),(0,h.jsx)(Kn.pp,{open:On,entity:Le,onConfirm:Ei,onClose:()=>ar(!1)}),(0,h.jsx)(Kn.U_,{open:pr,entity:Le,onClose:()=>Mr(!1)})]})};Ts.Route=go;function li(i){const{open:n,onClose:s,onConfirm:a,entity:p}=i,[A,k]=useState(!1),U=useApi(catalogApiRef),ie=useApi(alertApiRef),Ae=async()=>{k(!0);try{const Le=p.metadata.uid;await U.removeEntityByUid(Le),a()}catch(Le){assertError(Le),ie.post({message:Le.message})}finally{k(!1)}};return _jsxs(Dialog,{open:n,onClose:s,children:[_jsx(DialogTitle,{id:"responsive-dialog-title",children:"Are you sure you want to delete this entity?"}),_jsxs(DialogActions,{children:[_jsx(Button,{variant:"contained",color:"secondary",disabled:A,onClick:Ae,children:"Delete"}),_jsx(Button,{onClick:s,color:"primary",children:"Cancel"})]})]})}var mo=r(19625);function Wo(i){var n,s;return(i==null||(n=i.metadata)===null||n===void 0||(s=n.annotations)===null||s===void 0?void 0:s["backstage.io/orphan"])==="true"}function Ui(){const i=useNavigate(),n=useRouteRef(rootRouteRef),[s,a]=useState(!1),{entity:p}=useEntity(),A=async()=>{a(!1),i(n())};return _jsxs(_Fragment,{children:[_jsx(Alert,{severity:"warning",onClick:()=>a(!0),children:"This entity is not referenced by any location and is therefore not receiving updates. Click here to delete."}),_jsx(DeleteEntityDialog,{open:s,entity:p,onConfirm:A,onClose:()=>a(!1)})]})}var ci=r(4791);const Rs=i=>i.error&&i.level==="error"&&i.type===ENTITY_STATUS_CATALOG_PROCESSING_TYPE;async function Vo(i,n){return{items:(await n.getEntityAncestors({entityRef:i})).items.map(p=>{var A,k;return{errors:((k=(A=p.entity.status)===null||A===void 0?void 0:A.items)!==null&&k!==void 0?k:[]).filter(Rs).map(Ae=>Ae.error).filter(Ae=>Boolean(Ae)),entity:p.entity}}).filter(p=>p.errors.length>0)}}async function Mi(i,n){const s=n.apis.get(catalogApiRef);if(!s)throw new Error(`No implementation available for ${catalogApiRef}`);return(await Vo(stringifyEntityRef(i),s)).items.length>0}function zi(){const{entity:i}=useEntity(),n=stringifyEntityRef(i),s=useApi(catalogApiRef),{loading:a,error:p,value:A}=useAsync(async()=>Vo(n,s),[n,s]);return p?_jsx(Box,{mb:1,children:_jsx(ResponseErrorPanel,{error:p})}):a||!A?null:_jsx(_Fragment,{children:A.items.map((k,U)=>_jsxs(Box,{mb:1,children:[stringifyEntityRef(i)!==stringifyEntityRef(k.entity)&&_jsxs(Box,{p:1,children:["The error below originates from"," ",_jsx(EntityRefLink,{entityRef:k.entity})]}),k.errors.map((ie,Ae)=>_jsx(ResponseErrorPanel,{error:ie},Ae))]},U))})}const Is="core.backstage.entitySwitch",Ho=i=>null;(0,g.R5)(Ho,Is,!0);const di=i=>{var n;const{entity:s,loading:a}=(0,Kn.ce)(),p=(0,g.I_)(),A=(0,g.vJ)(i.children,ie=>ie.selectByComponentData({key:Is,withStrictError:"Child of EntitySwitch is not an EntitySwitch.Case"}).getElements().flatMap(Ae=>{if(a)return[];const{if:Le,children:ze}=Ae.props;return s?[{if:Le==null?void 0:Le(s,{apis:p}),children:ze}]:[{if:Le===void 0,children:ze}]}),[p,s,a]);if(A.some(ie=>typeof ie.if=="object"&&"then"in ie.if))return(0,h.jsx)(vo,{results:A,renderMultipleMatches:i.renderMultipleMatches});if(i.renderMultipleMatches==="all"){const ie=A.filter(Ae=>Ae.if).map(Ae=>Ae.children);return ie.length===0?Qr(A):(0,h.jsx)(h.Fragment,{children:ie})}var U;return(U=(n=A.find(ie=>ie.if))===null||n===void 0?void 0:n.children)!==null&&U!==void 0?U:Qr(A)};function vo({results:i,renderMultipleMatches:n}){const{loading:s,value:a}=(0,Se.default)(async()=>{const p=i.map(async({if:k,children:U})=>{try{if(await k)return U}catch{}return null});if(n==="all"){const k=(await Promise.all(p)).filter(Boolean);return k.length===0?Qr(i):(0,h.jsx)(h.Fragment,{children:k})}var A;return(A=(await Promise.all(p)).find(Boolean))!==null&&A!==void 0?A:Qr(i)},[i]);return s||!a?null:a}function Qr(i){var n,s;return(s=(n=i.filter(a=>a.if===void 0)[0])===null||n===void 0?void 0:n.children)!==null&&s!==void 0?s:null}di.Case=Ho;const Wi=null,ui=Kn._i.Filters,Vi=Kn._i.Content;var hi=r(85877),Ps=r(15096);const Xt=(0,g.rx)({id:"catalog",apis:[(0,g.ni)({api:Kn.Ah,deps:{discoveryApi:g.NW,fetchApi:g.gP},factory:({discoveryApi:i,fetchApi:n})=>new ci.MS({discoveryApi:i,fetchApi:n})}),(0,g.ni)({api:Kn.p3,deps:{storageApi:g.E6},factory:({storageApi:i})=>new ys({storageApi:i})})],routes:{catalogIndex:mo._Z,catalogEntity:Kn.wi},externalRoutes:{createComponent:mo.yw,viewTechDoc:mo.jU},__experimentalConfigure(i){return{...{createButtonTitle:"Create"},...i}}}),Hi=Xt.provide((0,g.P4)({name:"CatalogIndexPage",component:()=>r.e(9323).then(r.bind(r,89323)).then(i=>i.CatalogPage),mountPoint:mo._Z})),pi=Xt.provide((0,g.P4)({name:"CatalogEntityPage",component:()=>r.e(8951).then(r.bind(r,78951)).then(i=>i.CatalogEntityPage),mountPoint:Kn.wi})),Gi=Xt.provide((0,g.CO)({name:"EntityAboutCard",component:{lazy:()=>Promise.resolve().then(r.bind(r,33414)).then(i=>i.AboutCard)}})),fi=Xt.provide((0,g.CO)({name:"EntityLinksCard",component:{lazy:()=>r.e(7750).then(r.bind(r,17750)).then(i=>i.EntityLinksCard)}})),Ki=Xt.provide((0,g.CO)({name:"EntityLabelsCard",component:{lazy:()=>Promise.resolve().then(r.bind(r,85877)).then(i=>i.EntityLabelsCard)}})),La=Xt.provide((0,g.CO)({name:"EntityHasSystemsCard",component:{lazy:()=>r.e(5458).then(r.bind(r,5458)).then(i=>i.HasSystemsCard)}})),Ls=Xt.provide((0,g.CO)({name:"EntityHasComponentsCard",component:{lazy:()=>r.e(1105).then(r.bind(r,1105)).then(i=>i.HasComponentsCard)}})),Yi=Xt.provide((0,g.CO)({name:"EntityHasSubcomponentsCard",component:{lazy:()=>r.e(2440).then(r.bind(r,82440)).then(i=>i.HasSubcomponentsCard)}})),Ji=Xt.provide((0,g.CO)({name:"EntityHasResourcesCard",component:{lazy:()=>r.e(9770).then(r.bind(r,79770)).then(i=>i.HasResourcesCard)}})),Qi=Xt.provide((0,g.CO)({name:"EntityDependsOnComponentsCard",component:{lazy:()=>r.e(9545).then(r.bind(r,19545)).then(i=>i.DependsOnComponentsCard)}})),Go=Xt.provide((0,g.CO)({name:"EntityDependencyOfComponentsCard",component:{lazy:()=>r.e(184).then(r.bind(r,40184)).then(i=>i.DependencyOfComponentsCard)}})),Xi=Xt.provide((0,g.CO)({name:"EntityDependsOnResourcesCard",component:{lazy:()=>r.e(1032).then(r.bind(r,81032)).then(i=>i.DependsOnResourcesCard)}})),qi=Xt.provide((0,g.CO)({name:"RelatedEntitiesCard",component:{lazy:()=>r.e(732).then(r.bind(r,732)).then(i=>i.RelatedEntitiesCard)}})),gi=Xt.provide((0,Ps.E5)({name:"CatalogSearchResultListItem",component:()=>r.e(7670).then(r.bind(r,27670)).then(i=>i.CatalogSearchResultListItem),predicate:i=>i.type==="software-catalog"}));var Os=r(32838);class _i{async getApiOrigin(){return await this.discoveryApi.getBaseUrl("techdocs")}async getStorageUrl(){return`${await this.discoveryApi.getBaseUrl("techdocs")}/static/docs`}async getBuilder(){return this.configApi.getString("techdocs.builder")}async getEntityDocs(n,s){const p=`${await this.getApiOrigin()}/${s}`,A=await fetch(`${p.endsWith("/")?p:`${p}/`}index.html`);if(A.status===404)throw new Error("Page not found");return A.text()}async syncEntityDocs(n){return"cached"}async getBaseUrl(n,s,a){const p=await this.getApiOrigin();return new URL(n,`${p}/${a}`).toString()}constructor({configApi:n,discoveryApi:s,identityApi:a}){(0,z._)(this,"configApi",void 0),(0,z._)(this,"discoveryApi",void 0),(0,z._)(this,"identityApi",void 0),this.configApi=n,this.discoveryApi=s,this.identityApi=a}}class ea{async getApiOrigin(){return await this.discoveryApi.getBaseUrl("techdocs")}async getEntityMetadata(n){return{apiVersion:"backstage.io/v1alpha1",kind:"Component",metadata:{name:"local"},spec:{owner:"test",lifecycle:"experimental"}}}async getTechDocsMetadata(n){return{site_name:"Live preview environment",site_description:""}}constructor({configApi:n,discoveryApi:s,identityApi:a}){(0,z._)(this,"configApi",void 0),(0,z._)(this,"discoveryApi",void 0),(0,z._)(this,"identityApi",void 0),this.configApi=n,this.discoveryApi=s,this.identityApi=a}}const mi=[(0,g.ni)({api:re.Dl,deps:{configApi:g.Ds,discoveryApi:g.NW,identityApi:g.$4},factory:({configApi:i,discoveryApi:n,identityApi:s})=>new _i({configApi:i,discoveryApi:n,identityApi:s})}),(0,g.ni)({api:re.gT,deps:{configApi:g.Ds,discoveryApi:g.NW,identityApi:g.$4},factory:({configApi:i,discoveryApi:n,identityApi:s})=>new ea({configApi:i,discoveryApi:n,identityApi:s})}),(0,g.ni)({api:Os.q3,deps:{configApi:g.Ds},factory:({configApi:i})=>Os.ae.fromConfig(i)})],ta={backend:{baseUrl:"http://localhost:3000"},techdocs:{builder:"external"}},na={backend:{baseUrl:"http://localhost:7007"},techdocs:{builder:"external"}};async function Ko(){const i=await fetch("/.detect");return i.ok?(await i.text()).trim()==="techdocs-cli-server":!1}async function Yo(){const i=await Kr(),n=await Ko();return[...i,{context:"detected",data:n?ta:na}]}var vi=r(58845);const yo=(0,Tn.Z)({svg:{width:"auto",height:30},path:{fill:"#7df3e1"}});var ks=()=>{const i=yo();return(0,h.jsx)("svg",{className:i.svg,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 2079.95 456.05",children:(0,h.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 yi=(0,Tn.Z)({svg:{width:"auto",height:28},path:{fill:"#7df3e1"}});var Bs=()=>{const i=yi();return(0,h.jsx)("svg",{className:i.svg,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 337.46 428.5",children:(0,h.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 xi=(0,Tn.Z)({root:{width:me.po.drawerWidthClosed,height:3*me.po.logoHeight,display:"flex",flexFlow:"row nowrap",alignItems:"center",marginBottom:-14},link:{width:me.po.drawerWidthClosed,marginLeft:24}}),$s=()=>{const i=xi(),{isOpen:n}=(0,me.mZ)();return(0,h.jsx)("div",{className:i.root,children:(0,h.jsx)(me.rU,{to:"/docs/default/component/local/",underline:"none",className:i.link,children:n?(0,h.jsx)(ks,{}):(0,h.jsx)(Bs,{})})})},sa=({children:i})=>(0,h.jsxs)(me.tR,{children:[(0,h.jsxs)(me.YE,{children:[(0,h.jsx)($s,{}),(0,h.jsx)(me.v7,{}),(0,h.jsx)(me.R6,{icon:vi.Z,to:"/docs/default/component/local",text:"Docs Preview"})]}),i]});var ia=r(32388),aa=r(4142);const bi=(0,Tn.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 la=()=>{const i=(0,g.h_)(g.hg),n=bi(),[s,a]=(0,H.useState)(i.getActiveThemeId()===ir.DARK?ir.DARK:ir.LIGHT),p={[ir.LIGHT]:{icon:aa.Z,title:"Dark theme"},[ir.DARK]:{icon:ia.Z,title:"Light theme"}},{title:A,icon:k}=p[s],U=()=>{a(ie=>{const Ae=ie===ir.LIGHT?ir.DARK:ir.LIGHT;return i.setActiveThemeId(Ae),Ae})};return(0,h.jsx)(Ur.Z,{display:"flex",alignItems:"center",mr:2,children:(0,h.jsx)(xs.ZP,{title:A,arrow:!0,children:(0,h.jsx)(bs.Z,{size:"small",onClick:U,children:(0,h.jsx)(k,{className:n.headerIcon})})})})},ca=()=>(0,h.jsxs)(L.I6,{children:[(0,h.jsx)(J.S,{}),(0,h.jsx)(I.F,{withSearch:!1})]}),Si=(0,h.jsx)(ca,{}),Ds=vs({apis:mi,configLoader:Yo,plugins:Object.values(t)}),Zs=Ds.getProvider(),Ci=Ds.getRouter(),wi=L.s4.provide((0,re.KY)({name:"ThemeToggleAddon",component:la,location:re.oZ.Header})),da=(0,h.jsxs)(Po,{children:[(0,h.jsx)(W.Fg,{to:"/docs/default/component/local/"},"/"),(0,h.jsx)(W.AW,{path:"/catalog/:namespace/:kind/:name",element:(0,h.jsx)(pi,{})}),(0,h.jsx)(W.AW,{path:"/docs",element:(0,h.jsx)(L.Jl,{}),children:(0,h.jsx)($.u,{})}),(0,h.jsxs)(W.AW,{path:"/docs/:namespace/:kind/:name/*",element:(0,h.jsx)(L.I6,{}),children:[Si,(0,h.jsx)(re.DR,{children:(0,h.jsx)(wi,{})})]})]});var Ns=()=>(0,h.jsx)(Zs,{children:(0,h.jsx)(Ci,{children:(0,h.jsx)(sa,{children:da})})});f.render((0,h.jsx)(Ns,{}),document.getElementById("root"))},51837:function(Ct,Be,r){"use strict";r.d(Be,{CT:function(){return g},EI:function(){return ye},uW:function(){return f},Vt:function(){return d}});function t(){return typeof window!="undefined"&&window.Math===Math?window:typeof self!="undefined"&&self.Math===Math?self:Function("return this")()}const h=t(),H=ue=>`__@backstage/${ue}__`;function f(ue,V){const J=H(ue);let I=h[J];return I||(I=V(),h[J]=I,I)}var W=r(2784);function g(ue){return f(ue,()=>(0,W.createContext)(void 0))}function d(ue){return(0,W.useContext)(g(ue))}function B(ue){return{set(V){globalThis[`__@backstage/${ue}__`]=createContext(createVersionedValueMap(V))},reset(){delete globalThis[`__@backstage/${ue}__`]}}}function ye(ue){Object.freeze(ue);const V={atVersion(J){return ue[J]}};return Object.defineProperty(V,"$map",{configurable:!0,enumerable:!0,get(){return ue}}),V}},96641:function(Ct,Be,r){"use strict";r.d(Be,{X2:function(){return ye},ce:function(){return ue},h$:function(){return d}});var t=r(52322),h=r(25271),H=r(60871),f=r(51837),W=r(2784);const g=(0,f.CT)("entity-context"),d=V=>{const{children:J,entity:I,loading:C,error:oe,refresh:ee}=V,ne={entity:I,loading:C,error:oe,refresh:ee};return(0,t.jsx)(g.Provider,{value:(0,f.EI)({1:ne}),children:(0,t.jsx)(H.fC,{attributes:{...I?{entityRef:(0,h.eE)(I)}:void 0},children:J})})},B=V=>_jsx(d,{entity:V.entity,loading:!Boolean(V.entity),error:void 0,refresh:void 0,children:V.children});function ye(){const V=(0,f.Vt)("entity-context");if(!V)throw new Error("Entity context is not available");const J=V.atVersion(1);if(!J)throw new Error("EntityContext v1 not available");if(!J.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:J.entity}}function ue(){const V=(0,f.Vt)("entity-context");if(!V)throw new Error("Entity context is not available");const J=V.atVersion(1);if(!J)throw new Error("EntityContext v1 not available");const{entity:I,loading:C,error:oe,refresh:ee}=J;return{entity:I,loading:C,error:oe,refresh:ee}}},40303:function(Ct,Be,r){"use strict";r.d(Be,{h$:function(){return St.h$},n3:function(){return t.n3},_i:function(){return T},tW:function(){return ut},df:function(){return Oe},UO:function(){return Fe},dq:function(){return at},nl:function(){return ls},dx:function(){return K},rI:function(){return pe},u3:function(){return ot},xE:function(){return Wn},sL:function(){return Jn},LH:function(){return c},U_:function(){return Po},pp:function(){return ss},EW:function(){return Oo},Ah:function(){return H},wi:function(){return Bt},hF:function(){return re.hF},CV:function(){return re.CV},$3:function(){return _},p3:function(){return f},ce:function(){return St.ce},X2:function(){return St.X2},wp:function(){return Je},ZW:function(){return Dn},eK:function(){return dn},CR:function(){return Mn}});var t=r(4791),h=r(60871);const H=(0,h.T0)({id:"plugin.catalog.service"}),f=(0,h.T0)({id:"catalog-react.starred-entities"});var W=r(82394);class g{async toggleStarred(E){this.starredEntities.delete(E)||this.starredEntities.add(E);for(const R of this.subscribers)R.next(new Set(this.starredEntities))}starredEntitie$(){return this.observable}constructor(){_define_property(this,"starredEntities",new Set),_define_property(this,"subscribers",new Set),_define_property(this,"observable",new ObservableImpl(E=>(E.next(new Set(this.starredEntities)),this.subscribers.add(E),()=>{this.subscribers.delete(E)})))}}var d=r(52322),B=r(2784),ye=r(41156),ue=r(60364),V=r(77277),J=r(4190),I=r(95544),C=r(90436),oe=r(60905),ee=r(36444);const ne=b=>{const E=(0,ye.Z)(de=>de.breakpoints.down("md")),R=(0,ue.Z)(),[D,te]=(0,B.useState)(!1);return E?(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(V.Z,{style:{marginTop:R.spacing(1),marginLeft:R.spacing(1)},onClick:()=>te(!0),startIcon:(0,d.jsx)(ee.Z,{}),children:"Filters"}),(0,d.jsx)(J.ZP,{open:D,onClose:()=>te(!1),anchor:"left",disableAutoFocus:!0,keepMounted:!0,variant:"temporary",children:(0,d.jsxs)(I.Z,{m:2,children:[(0,d.jsx)(C.Z,{variant:"h6",component:"h2",style:{marginBottom:R.spacing(1)},children:"Filters"}),b.children]})})]}):(0,d.jsx)(oe.Z,{item:!0,lg:2,children:b.children})},$=b=>(0,d.jsx)(oe.Z,{item:!0,xs:12,lg:10,children:b.children}),T=b=>(0,d.jsx)(oe.Z,{container:!0,style:{position:"relative"},children:b.children});T.Filters=ne,T.Content=$;var P=r(53974),L=r(87612),O=r(25271),re=r(49280);class Pe{getCatalogFilters(){return{kind:this.value}}toQueryValue(){return this.value}constructor(E){(0,L._)(this,"value",void 0),this.value=E}}class We{getTypes(){return Array.isArray(this.value)?this.value:[this.value]}getCatalogFilters(){return{"spec.type":this.getTypes()}}toQueryValue(){return this.getTypes()}constructor(E){(0,L._)(this,"value",void 0),this.value=E}}class z{filterEntity(E){var R;return this.values.every(D=>((R=E.metadata.tags)!==null&&R!==void 0?R:[]).includes(D))}toQueryValue(){return this.values}constructor(E){(0,L._)(this,"values",void 0),this.values=E}}class xt{filterEntity(E){const R=this.toUpperArray(this.value.split(/\s/)),D=this.toUpperArray([E.metadata.tags]),te=this.toUpperArray([E.metadata.name,E.metadata.title]);for(const de of R)if(D.every(ae=>ae!==de)&&te.every(ae=>!ae.includes(de)))return!1;return!0}toUpperArray(E){return E.flat().filter(R=>Boolean(R)).map(R=>R.toLocaleUpperCase("en-US"))}constructor(E){_define_property(this,"value",void 0),this.value=E}}class st{filterEntity(E){return this.values.some(R=>(0,re.hF)(E,O.S4).some(D=>(0,O.eE)(D)===R))}toQueryValue(){return this.values}constructor(E){(0,L._)(this,"values",void 0),this.values=E.reduce((R,D)=>{try{return R.push((0,O.eE)((0,O.of)(D,{defaultKind:"Group"}))),R}catch{return R}},[])}}class Ke{filterEntity(E){return this.values.some(R=>{var D;return((D=E.spec)===null||D===void 0?void 0:D.lifecycle)===R})}toQueryValue(){return this.values}constructor(E){(0,L._)(this,"values",void 0),this.values=E}}class it{filterEntity(E){switch(this.value){case"owned":return this.isOwnedEntity(E);case"starred":return this.isStarredEntity(E);default:return!0}}toQueryValue(){return this.value}constructor(E,R,D){(0,L._)(this,"value",void 0),(0,L._)(this,"isOwnedEntity",void 0),(0,L._)(this,"isStarredEntity",void 0),this.value=E,this.isOwnedEntity=R,this.isStarredEntity=D}}class nt{filterEntity(E){var R;const D=(R=E.metadata.annotations)===null||R===void 0?void 0:R["backstage.io/orphan"];return D!==void 0&&this.value.toString()===D}constructor(E){(0,L._)(this,"value",void 0),this.value=E}}class bt{filterEntity(E){var R,D;const te=(E==null||(R=E.status)===null||R===void 0||(D=R.items)===null||D===void 0?void 0:D.length)>0;return te!==void 0&&this.value===te}constructor(E){(0,L._)(this,"value",void 0),this.value=E}}var St=r(96641),pt=r(76635),ft=r(19126),wt=r.n(ft),$t=r(73557),Ve=r(69294),qt=r(48760),ge=r(90736);const be=(0,B.createContext)(void 0),Fe=b=>{const E=(0,ge.default)(),R=(0,h.h_)(H),[D,te]=(0,B.useState)({}),de=(0,$t.TH)();var ae;const xe=(0,B.useMemo)(()=>(ae=wt().parse(de.search,{ignoreQueryPrefix:!0}).filters)!==null&&ae!==void 0?ae:{},[de]),[Te,me]=(0,B.useState)(()=>({appliedFilters:{},entities:[],backendEntities:[]})),[{loading:De,error:Ne},rt]=(0,Ve.default)(async()=>{const ke=(0,pt.compact)(Object.values(D)),Xe=(0,re.Gz)(ke),gt=(0,re.wq)(ke),ln=(0,re.wq)((0,pt.compact)(Object.values(Te.appliedFilters))),Qt=Object.keys(D).reduce((cn,Pn)=>{const Zn=D[Pn];return Zn!=null&&Zn.toQueryValue&&(cn[Pn]=Zn.toQueryValue()),cn},{});if((0,pt.isEqual)(ln,gt))me({appliedFilters:D,backendEntities:Te.backendEntities,entities:Te.backendEntities.filter(Xe)});else{const cn=await R.getEntities({filter:gt});me({appliedFilters:D,backendEntities:cn.items,entities:cn.items.filter(Xe)})}if(E()){var sn;const cn=wt().parse(de.search,{ignoreQueryPrefix:!0}),Pn=wt().stringify({...cn,filters:Qt},{addQueryPrefix:!0,arrayFormat:"repeat"}),Zn=`${window.location.pathname}${Pn}`;(sn=window.history)===null||sn===void 0||sn.replaceState(null,document.title,Zn)}},[R,xe,D,Te],{loading:!0});(0,qt.Z)(rt,10,[D]);const ct=(0,B.useCallback)(ke=>{te(Xe=>{const gt=typeof ke=="function"?ke(Xe):ke;return{...Xe,...gt}})},[]),Ye=(0,B.useMemo)(()=>({filters:Te.appliedFilters,entities:Te.entities,backendEntities:Te.backendEntities,updateFilters:ct,queryParameters:xe,loading:De,error:Ne}),[Te,ct,xe,De,Ne]);return(0,d.jsx)(be.Provider,{value:Ye,children:b.children})};function Je(){const b=(0,B.useContext)(be);if(!b)throw new Error("useEntityList must be used within EntityListProvider");return b}var vt=r(64279),Ot=r(18149),ht=r.n(Ot),Rt=r(829),Ft=r.n(Rt);function Yt(){const b=(0,h.h_)(H),{filters:{kind:E,type:R},queryParameters:{type:D},updateFilters:te}=Je(),de=(0,B.useMemo)(()=>[D].flat().filter(Boolean),[D]);var ae;const[xe,Te]=(0,B.useState)(de.length?de:(ae=R==null?void 0:R.getTypes())!==null&&ae!==void 0?ae:[]);(0,B.useEffect)(()=>{de.length&&Te(de)},[de]);const[me,De]=(0,B.useState)([]),Ne=(0,B.useMemo)(()=>E==null?void 0:E.value,[E]),{error:rt,loading:ct,value:Ye}=(0,vt.default)(async()=>Ne?await b.getEntityFacets({filter:{kind:Ne},facets:["spec.type"]}).then(gt=>gt.facets["spec.type"]||[]):[],[Ne,b]),ke=(0,B.useRef)(Ye);return(0,B.useEffect)(()=>{const Xe=ke.current;if(ke.current=Ye,ct||!Ne||Xe===Ye||!Ye)return;const gt=[...new Set(Ft()(Ye,Qt=>-Qt.count).map(Qt=>Qt.value.toLocaleLowerCase("en-US")))];De(gt);const ln=xe.filter(Qt=>gt.includes(Qt));ht()(xe,ln)||Te(ln)},[ct,Ne,xe,Te,Ye]),(0,B.useEffect)(()=>{te({type:xe.length?new We(xe):void 0})},[xe,te]),{loading:ct,error:rt,availableTypes:me,selectedTypes:xe,setSelectedTypes:Te}}const kt=20;function dn(b,E){var R,D;const te=E==null||(R=E.type)===null||R===void 0?void 0:R.toLocaleLowerCase("en-US"),de=E==null||(D=E.kind)===null||D===void 0?void 0:D.toLocaleLowerCase("en-US"),ae=(0,h.h_)(H),{loading:xe,value:Te,error:me}=(0,vt.default)(async()=>{var De;const Ne=(De=b.relations)===null||De===void 0?void 0:De.map(ke=>({type:ke.type,target:(0,O.of)(ke.targetRef)})).filter(ke=>(!te||ke.type.toLocaleLowerCase("en-US")===te)&&(!de||ke.target.kind===de));if(!Ne)return[];const rt=Object.values((0,pt.groupBy)(Ne,({target:ke})=>`${ke.kind}:${ke.namespace}`.toLocaleLowerCase("en-US"))),ct=[];for(const ke of rt)ct.push({kind:ke[0].target.kind,namespace:ke[0].target.namespace,nameBatches:(0,pt.chunk)(ke.map(Xe=>Xe.target.name),kt)});return(await Promise.all(ct.flatMap(ke=>ke.nameBatches.map(Xe=>ae.getEntities({filter:{kind:ke.kind,"metadata.namespace":ke.namespace,"metadata.name":Xe}}))))).flatMap(ke=>ke.items)},[b,te,de]);return{entities:Te,loading:xe,error:me}}var Kt=r(72164);function un(b){return typeof b=="string"?b:(0,O.eE)(b)}function Mn(){const b=(0,h.h_)(f),E=(0,Kt.Z)(b.starredEntitie$(),new Set),R=(0,B.useCallback)(te=>E.has(un(te)),[E]),D=(0,B.useCallback)(te=>b.toggleStarred(un(te)).then(),[b]);return{starredEntities:E,toggleStarredEntity:D,isStarredEntity:R}}function Bn(b){return typeof b=="string"?b:(0,O.eE)(b)}function xn(b){const E=(0,h.h_)(f),[R,D]=(0,B.useState)(!1);return(0,B.useEffect)(()=>{const de=E.starredEntitie$().subscribe({next(ae){D(ae.has(Bn(b)))}});return()=>{de.unsubscribe()}},[b,E]),{toggleStarredEntity:(0,B.useCallback)(()=>E.toggleStarred(Bn(b)).then(),[b,E]),isStarredEntity:R}}var $n=r(75435);function Dn(){const b=(0,h.h_)(h.$4),{loading:E,value:R}=(0,vt.default)(async()=>{const{ownershipEntityRefs:te}=await b.getBackstageIdentity();return te},[]),D=(0,B.useMemo)(()=>{const te=new Set(R!=null?R:[]);return de=>{const ae=(0,$n.h)(de,O.S4).map(O.eE);for(const xe of ae)if(te.has(xe))return!0;return!1}},[R]);return(0,B.useMemo)(()=>({loading:E,isOwnedEntity:D}),[E,D])}function on(){const b=(0,h.h_)(H),{error:E,loading:R,value:D}=(0,vt.default)(async()=>await b.getEntityFacets({facets:["kind"]}).then(de=>{var ae;return((ae=de.facets.kind)===null||ae===void 0?void 0:ae.map(xe=>xe.value).sort())||[]}),[b]);return{loading:R,error:E,allKinds:D!=null?D:[]}}function wn(b,E,R){let D=b;return E&&(D=D.filter(de=>E.some(ae=>ae.toLocaleLowerCase("en-US")===de.toLocaleLowerCase("en-US")))),R&&!b.some(de=>de.toLocaleLowerCase("en-US")===R.toLocaleLowerCase("en-US"))&&(D=D.concat([R])),D.sort().reduce((de,ae)=>(de[ae.toLocaleLowerCase("en-US")]=ae,de),{})}function zn(b){var E;const{filters:R,queryParameters:{kind:D},updateFilters:te}=Je(),de=(0,B.useMemo)(()=>[D].flat()[0],[D]);var ae;const[xe,Te]=(0,B.useState)((ae=de!=null?de:(E=R.kind)===null||E===void 0?void 0:E.value)!==null&&ae!==void 0?ae:b.initialFilter);(0,B.useEffect)(()=>{de&&Te(de)},[de]),(0,B.useEffect)(()=>{var rt;if(!((rt=R.kind)===null||rt===void 0)&&rt.value){var ct;Te((ct=R.kind)===null||ct===void 0?void 0:ct.value)}},[R.kind]),(0,B.useEffect)(()=>{te({kind:xe?new Pe(xe):void 0})},[xe,te]);const{allKinds:me,loading:De,error:Ne}=on();return{loading:De,error:Ne,allKinds:me!=null?me:[],selectedKind:xe,setSelectedKind:Te}}const ut=b=>{const{allowedKinds:E,hidden:R,initialFilter:D="component"}=b,te=(0,h.h_)(h.$v),{error:de,allKinds:ae,selectedKind:xe,setSelectedKind:Te}=zn({initialFilter:D});if((0,B.useEffect)(()=>{de&&te.post({message:"Failed to load entity kinds",severity:"error"})},[de,te]),de)return null;const me=wn(ae,E,xe),De=Object.keys(me).map(Ne=>({value:Ne,label:me[Ne]}));return R?null:(0,d.jsx)(I.Z,{pb:1,pt:1,children:(0,d.jsx)(P.Ph,{label:"Kind",items:De,selected:xe.toLocaleLowerCase("en-US"),onChange:Ne=>Te(String(Ne))})})};var _t=r(79692),Wt=r(5806),dt=r(21324),bn=r(86619),Vt=r(19996),hn=r(25505),jn=r(38016),an=r(88013);const Yn=(0,_t.Z)({input:{}},{name:"CatalogReactEntityLifecyclePicker"}),je=(0,d.jsx)(hn.Z,{fontSize:"small"}),le=(0,d.jsx)(Vt.Z,{fontSize:"small"}),Oe=b=>{var E;const{initialFilter:R=[]}=b,D=Yn(),{updateFilters:te,backendEntities:de,filters:ae,queryParameters:{lifecycles:xe}}=Je(),Te=(0,B.useMemo)(()=>[xe].flat().filter(Boolean),[xe]);var me;const[De,Ne]=(0,B.useState)(Te.length?Te:(me=(E=ae.lifecycles)===null||E===void 0?void 0:E.values)!==null&&me!==void 0?me:R);(0,B.useEffect)(()=>{Te.length&&Ne(Te)},[Te]);const rt=(0,B.useMemo)(()=>[...new Set(de.map(ct=>{var Ye;return(Ye=ct.spec)===null||Ye===void 0?void 0:Ye.lifecycle}).filter(Boolean))].sort(),[de]);return(0,B.useEffect)(()=>{te({lifecycles:De.length&&rt.length?new Ke(De):void 0})},[De,te,rt]),rt.length?(0,d.jsx)(I.Z,{pb:1,pt:1,children:(0,d.jsxs)(C.Z,{variant:"button",component:"label",children:["Lifecycle",(0,d.jsx)(an.ZP,{multiple:!0,disableCloseOnSelect:!0,options:rt,value:De,onChange:(ct,Ye)=>Ne(Ye),renderOption:(ct,{selected:Ye})=>(0,d.jsx)(Wt.Z,{control:(0,d.jsx)(dt.Z,{icon:je,checkedIcon:le,checked:Ye}),onClick:ke=>ke.preventDefault(),label:ct}),size:"small",popupIcon:(0,d.jsx)(jn.Z,{"data-testid":"lifecycle-picker-expand"}),renderInput:ct=>(0,d.jsx)(bn.Z,{...ct,className:D.input,variant:"outlined"})})]})}):null};var Ue=r(72579),qe=r.n(Ue);function _(b,E){const R=E==null?void 0:E.defaultKind;let D,te,de;return"metadata"in b?(D=b.kind,te=b.metadata.namespace,de=b.metadata.name):(D=b.kind,te=b.namespace,de=b.name),(te===void 0||te==="")&&(te=O.zG),(E==null?void 0:E.defaultNamespace)!==void 0?(E==null?void 0:E.defaultNamespace)===te&&(te=void 0):te===O.zG&&(te=void 0),D=D.toLocaleLowerCase("en-US"),D=R&&R.toLocaleLowerCase("en-US")===D?void 0:D,`${D?`${D}:`:""}${te?`${te}/`:""}${de}`}function N(b,E){for(const R of["spec.profile.displayName","metadata.title"]){const D=qe()(b,R);if(D&&typeof D=="string")return D}return _(b,E)}const ve=(0,_t.Z)({input:{}},{name:"CatalogReactEntityOwnerPicker"}),$e=(0,d.jsx)(hn.Z,{fontSize:"small"}),et=(0,d.jsx)(Vt.Z,{fontSize:"small"}),at=()=>{var b;const E=ve(),{updateFilters:R,backendEntities:D,filters:te,queryParameters:{owners:de}}=Je(),ae=(0,h.h_)(H),xe=(0,h.h_)(h.VE),Te=(0,B.useMemo)(()=>[de].flat().filter(Boolean),[de]);var me;const[De,Ne]=(0,B.useState)(Te.length?new st(Te).values:(me=(b=te.owners)===null||b===void 0?void 0:b.values)!==null&&me!==void 0?me:[]),{loading:rt,error:ct,value:Ye}=(0,vt.default)(async()=>{const Xe=[...new Set(D.flatMap(Qt=>(0,re.hF)(Qt,O.S4).map(sn=>(0,O.eE)(sn))).filter(Boolean))],{items:gt}=await ae.getEntitiesByRefs({entityRefs:Xe,fields:["kind","metadata.name","metadata.title","metadata.namespace","spec.profile.displayName"]});return gt.map((Qt,sn)=>Qt?{label:N(Qt,{defaultKind:"Group"}),entityRef:(0,O.eE)(Qt)}:{label:_((0,O.of)(Xe[sn]),{defaultKind:"group"}),entityRef:Xe[sn]}).sort((Qt,sn)=>Qt.label.localeCompare(sn.label,"en-US",{ignorePunctuation:!0,caseFirst:"upper"}))},[D]);if((0,B.useEffect)(()=>{ct&&xe.post({...ct,message:`EntityOwnerPicker failed to initialize: ${ct.message}`},{})},[ct,xe]),(0,B.useEffect)(()=>{if(Te.length){const Xe=new st(Te);Ne(Xe.values)}},[Te]),(0,B.useEffect)(()=>{!rt&&Ye&&R({owners:De.length&&Ye.length?new st(De):void 0})},[De,R,Ye,rt]),!rt&&!(Ye!=null&&Ye.length))return null;var ke;return(0,d.jsx)(I.Z,{pb:1,pt:1,children:(0,d.jsxs)(C.Z,{variant:"button",component:"label",children:["Owner",(0,d.jsx)(an.ZP,{multiple:!0,disableCloseOnSelect:!0,loading:rt,options:Ye||[],value:(ke=Ye==null?void 0:Ye.filter(Xe=>De.some(gt=>gt===Xe.entityRef)))!==null&&ke!==void 0?ke:[],onChange:(Xe,gt)=>Ne(gt.map(ln=>ln.entityRef)),getOptionLabel:Xe=>Xe.label,renderOption:(Xe,{selected:gt})=>(0,d.jsx)(Wt.Z,{control:(0,d.jsx)(dt.Z,{icon:$e,checkedIcon:et,checked:gt}),onClick:ln=>ln.preventDefault(),label:Xe.label}),size:"small",popupIcon:(0,d.jsx)(jn.Z,{"data-testid":"owner-picker-expand"}),renderInput:Xe=>(0,d.jsx)(bn.Z,{...Xe,className:E.input,variant:"outlined"})})]})})};var It=r(51837);const Bt=(0,It.uW)("catalog:entity-route-ref",()=>(0,h.NT)({id:"catalog:entity",params:["namespace","kind","name"]}));function tn(b){var E,R;return{kind:b.kind.toLocaleLowerCase("en-US"),namespace:(R=(E=b.metadata.namespace)===null||E===void 0?void 0:E.toLocaleLowerCase("en-US"))!==null&&R!==void 0?R:DEFAULT_NAMESPACE,name:b.metadata.name}}var X=r(80030);const K=(0,B.forwardRef)((b,E)=>{const{entityRef:R,defaultKind:D,title:te,children:de,...ae}=b,xe=(0,h.tg)(Bt);let Te,me,De;if(typeof R=="string"){const ke=(0,O.of)(R);Te=ke.kind,me=ke.namespace,De=ke.name}else"metadata"in R?(Te=R.kind,me=R.metadata.namespace,De=R.metadata.name):(Te=R.kind,me=R.namespace,De=R.name);Te=Te.toLocaleLowerCase("en-US");var Ne;me=(Ne=me==null?void 0:me.toLocaleLowerCase("en-US"))!==null&&Ne!==void 0?Ne:O.zG;const rt={kind:Te,namespace:me,name:De},ct=_({kind:Te,namespace:me,name:De},{defaultKind:D}),Ye=(0,d.jsxs)(P.rU,{...ae,ref:E,to:xe(rt),children:[de,!de&&(te!=null?te:ct)]});return te?(0,d.jsx)(X.ZP,{title:ct,children:Ye}):Ye});function se(b){const{entityRefs:E,defaultKind:R,getTitle:D,...te}=b,de=(0,h.h_)(H),{value:ae=new Array,loading:xe,error:Te}=(0,vt.default)(async()=>{const me=E.reduce((Ne,rt)=>typeof rt=="object"&&"metadata"in rt?Ne:[...Ne,(0,O.of)(rt)],new Array),De=E.filter(Ne=>typeof Ne=="object"&&"metadata"in Ne);return me.length>0?[...(await de.getEntities({filter:me.map(Ne=>({kind:Ne.kind,"metadata.namespace":Ne.namespace,"metadata.name":Ne.name}))})).items,...De]:De},[E]);return xe?(0,d.jsx)(P.Ex,{}):Te?(0,d.jsx)(P.yu,{error:Te}):(0,d.jsx)(d.Fragment,{children:ae.map((me,De)=>(0,d.jsxs)(B.Fragment,{children:[De>0&&", ",(0,d.jsx)(K,{...te,defaultKind:R,entityRef:me,title:D(me)})]},De))})}function pe(b){const{entityRefs:E,defaultKind:R,fetchEntities:D,getTitle:te,...de}=b;return D?(0,d.jsx)(se,{...de,defaultKind:R,entityRefs:E,getTitle:te}):(0,d.jsx)(d.Fragment,{children:E.map((ae,xe)=>(0,d.jsxs)(B.Fragment,{children:[xe>0&&", ",(0,d.jsx)(K,{...de,defaultKind:R,entityRef:ae,title:te?te(ae):void 0})]},xe))})}const ce=b=>{const E=useRouteRef(entityRouteRef);return _jsx(IconButton,{component:Link,"aria-label":"Show",title:"Show details",to:E(getCompoundEntityRef(b.entity)),children:_jsx(InfoIcon,{})})},y=b=>_jsx(IconButton,{component:Link,"aria-label":"Email",title:`Email ${b.email}`,to:`mailto:${b.email}`,children:_jsx(EmailIcon,{})}),Z=b=>{var E;const R=(E=b.entity.spec.profile)===null||E===void 0?void 0:E.email;return R?_jsx(EmailCardAction,{email:R}):null},q=b=>{var E;const R=(E=b.entity.spec.profile)===null||E===void 0?void 0:E.email;return R?_jsx(EmailCardAction,{email:R}):null},Y=(0,_t.Z)(()=>({popoverPaper:{width:"30em"},descriptionTypography:{overflow:"hidden",textOverflow:"ellipsis",display:"-webkit-box",WebkitLineClamp:2,WebkitBoxOrient:"vertical"}})),Ce=4,Re=b=>{var E,R,D;const{entityRef:te,children:de,delayTime:ae=500}=b,xe=Y(),Te=useApiHolder(),me=usePopupState({variant:"popover",popupId:"entity-peek-ahead"}),[De,Ne]=useState(!1),rt=useMemo(()=>debounce(()=>Ne(!0),ae),[ae]),[{loading:ct,error:Ye,value:ke},Xe]=useAsyncFn(async()=>{const ln=Te.get(catalogApiRef);if(ln){const Qt=await ln.getEntityByRef(te);if(!Qt)throw new Error(`${te} not found`);return Qt}},[Te,te]),gt=()=>{Ne(!1),rt.cancel()};return useEffect(()=>{me.isOpen&&!ke&&!Ye&&!ct&&Xe()},[me.isOpen,Xe,ke,Ye,ct]),_jsxs(_Fragment,{children:[_jsx(Typography,{component:"span",onMouseEnter:rt,children:_jsx(Typography,{component:"span","data-testid":"trigger",...bindHover(me),children:de})}),De&&_jsx(HoverPopover,{PaperProps:{className:xe.popoverPaper},...bindPopover(me),anchorOrigin:{vertical:"bottom",horizontal:"center"},transformOrigin:{vertical:"top",horizontal:"center"},onMouseLeave:gt,children:_jsxs(Card,{children:[_jsxs(CardContent,{children:[Ye&&_jsx(ResponseErrorPanel,{error:Ye}),ct&&_jsx(Progress,{}),ke&&_jsxs(_Fragment,{children:[_jsx(Typography,{color:"textSecondary",children:ke.metadata.namespace}),_jsx(Typography,{variant:"h5",component:"div",children:ke.metadata.name}),_jsx(Typography,{color:"textSecondary",gutterBottom:!0,children:ke.kind}),ke.metadata.description&&_jsx(Typography,{className:xe.descriptionTypography,paragraph:!0,children:ke.metadata.description}),_jsx(Typography,{children:(E=ke.spec)===null||E===void 0?void 0:E.type}),_jsxs(Box,{marginTop:"0.5em",children:[(ke.metadata.tags||[]).slice(0,Ce).map(ln=>_jsx(Chip,{size:"small",label:ln},ln)),((R=ke.metadata.tags)===null||R===void 0?void 0:R.length)&&((D=ke.metadata.tags)===null||D===void 0?void 0:D.length)>Ce&&_jsx(Tooltip,{title:"Drill into the entity to see all of the tags.",children:_jsx(Chip,{size:"small",label:"..."},"other-tags")})]})]})]}),!Ye&&ke&&_jsx(CardActions,{children:_jsxs(_Fragment,{children:[isUserEntity(ke)&&_jsx(UserCardActions,{entity:ke}),isGroupEntity(ke)&&_jsx(GroupCardActions,{entity:ke}),_jsx(EntityCardActions,{entity:ke})]})})]})})]})},Qe=(0,_t.Z)(b=>({searchToolbar:{paddingLeft:0,paddingRight:0},input:{}}),{name:"CatalogReactEntitySearchBar"}),Et=()=>{var b;const E=Qe(),{filters:R,updateFilters:D}=useEntityList();var te;const[de,ae]=useState((te=(b=R.text)===null||b===void 0?void 0:b.value)!==null&&te!==void 0?te:"");return useDebounce(()=>{D({text:de.length?new EntityTextFilter(de):void 0})},250,[de,D]),_jsx(Toolbar,{className:E.searchToolbar,children:_jsx(FormControl,{children:_jsx(Input,{"aria-label":"search",id:"input-with-icon-adornment",className:E.input,placeholder:"Search",autoComplete:"off",onChange:xe=>ae(xe.target.value),value:de,startAdornment:_jsx(InputAdornment,{position:"start",children:_jsx(Search,{})}),endAdornment:_jsx(InputAdornment,{position:"end",children:_jsx(IconButton,{"aria-label":"clear search",onClick:()=>ae(""),edge:"end",disabled:de.length===0,children:_jsx(Clear,{})})})})})})},tt=Object.freeze({createEntityRefColumn(b){const{defaultKind:E}=b;function R(D){var te;return((te=D.metadata)===null||te===void 0?void 0:te.title)||_(D,{defaultKind:E})}return{title:"Name",highlight:!0,customFilterAndSearch(D,te){return R(te).includes(D)},customSort(D,te){return R(D).localeCompare(R(te))},render:D=>{var te;return(0,d.jsx)(K,{entityRef:D,defaultKind:E,title:(te=D.metadata)===null||te===void 0?void 0:te.title})}}},createEntityRelationColumn(b){const{title:E,relation:R,defaultKind:D,filter:te}=b;function de(xe){return(0,re.hF)(xe,R,te)}function ae(xe){return de(xe).map(Te=>_(Te,{defaultKind:D})).join(", ")}return{title:E,customFilterAndSearch(xe,Te){return ae(Te).includes(xe)},customSort(xe,Te){return ae(xe).localeCompare(ae(Te))},render:xe=>(0,d.jsx)(pe,{entityRefs:de(xe),defaultKind:D})}},createOwnerColumn(){return this.createEntityRelationColumn({title:"Owner",relation:O.S4,defaultKind:"group"})},createDomainColumn(){return this.createEntityRelationColumn({title:"Domain",relation:O.cz,defaultKind:"domain",filter:{kind:"domain"}})},createSystemColumn(){return this.createEntityRelationColumn({title:"System",relation:O.cz,defaultKind:"system",filter:{kind:"system"}})},createMetadataDescriptionColumn(){return{title:"Description",field:"metadata.description",render:b=>(0,d.jsx)(P.Or,{text:b.metadata.description,placement:"bottom-start",line:2})}},createSpecLifecycleColumn(){return{title:"Lifecycle",field:"spec.lifecycle"}},createSpecTypeColumn(){return{title:"Type",field:"spec.type"}}}),yt=[tt.createEntityRefColumn({defaultKind:"system"}),tt.createDomainColumn(),tt.createOwnerColumn(),tt.createMetadataDescriptionColumn()],He=[tt.createEntityRefColumn({defaultKind:"component"}),tt.createSystemColumn(),tt.createOwnerColumn(),tt.createSpecTypeColumn(),tt.createSpecLifecycleColumn(),tt.createMetadataDescriptionColumn()],lt=(0,_t.Z)(b=>({empty:{padding:b.spacing(2),display:"flex",justifyContent:"center"}})),ot=b=>{const{entities:E,title:R,emptyContent:D,variant:te="gridItem",columns:de}=b,ae=lt(),xe={minWidth:"0",width:"100%"};return te==="gridItem"&&(xe.height="calc(100% - 10px)"),(0,d.jsx)(P.iA,{columns:de,title:R,style:xe,emptyContent:D&&(0,d.jsx)("div",{className:ae.empty,children:D}),options:{search:!1,paging:!1,actionsColumnIndex:-1,padding:"dense",draggable:!1},data:E})};ot.columns=tt,ot.systemEntityColumns=yt,ot.componentEntityColumns=He;const Ht=(0,d.jsx)(hn.Z,{fontSize:"small"}),Ut=(0,d.jsx)(Vt.Z,{fontSize:"small"});function Jt({selected:b}){return(0,d.jsx)(dt.Z,{icon:Ht,checkedIcon:Ut,checked:b})}const en=(0,B.memo)(b=>{const{selected:E,value:R,availableOptions:D,showCounts:te}=b,de=te?`${R} (${D==null?void 0:D[R]})`:R;return(0,d.jsx)(Wt.Z,{control:(0,d.jsx)(Jt,{selected:E}),label:de,onClick:ae=>ae.preventDefault()})});var Dt=r(72779),At=r.n(Dt);const Pt=(0,_t.Z)({input:{}},{name:"CatalogReactEntityAutocompletePickerInput"});function Lt(b){const E=Pt();return(0,d.jsx)(bn.Z,{variant:"outlined",...b,className:At()(E.input,b.className)})}function nn(b){var E;const{label:R,name:D,path:te,showCounts:de,Filter:ae,InputProps:xe}=b,{updateFilters:Te,filters:me,queryParameters:{[D]:De}}=Je(),Ne=(0,h.h_)(H),{value:rt}=(0,vt.default)(async()=>{var sn;const cn=te,{facets:Pn}=await Ne.getEntityFacets({facets:[cn],filter:(sn=me.kind)===null||sn===void 0?void 0:sn.getCatalogFilters()});return Object.fromEntries(Pn[cn].map(({value:Zn,count:jr})=>[Zn,jr]))},[me.kind]),ct=(0,B.useMemo)(()=>[De].flat().filter(Boolean),[De]);var Ye;const[ke,Xe]=(0,B.useState)(ct.length?ct:(Ye=(E=me[D])===null||E===void 0?void 0:E.values)!==null&&Ye!==void 0?Ye:[]);(0,B.useEffect)(()=>{ct.length&&Xe(ct)},[ct]);const gt=Object.keys(rt!=null?rt:{}),ln=ke.length&>.length;(0,B.useEffect)(()=>{Te({[D]:ln?new ae(ke):void 0})},[D,ln,ke,ae,Te]);const Qt=me[D];return Qt&&typeof Qt=="object"&&!("values"in Qt)||!gt.length?null:(0,d.jsx)(I.Z,{pb:1,pt:1,children:(0,d.jsxs)(C.Z,{variant:"button",component:"label",children:[R,(0,d.jsx)(an.ZP,{multiple:!0,disableCloseOnSelect:!0,options:gt,value:ke,onChange:(sn,cn)=>Xe(cn),renderOption:(sn,{selected:cn})=>(0,d.jsx)(en,{selected:cn,value:sn,availableOptions:rt,showCounts:!!de}),size:"small",popupIcon:(0,d.jsx)(jn.Z,{"data-testid":`${String(D)}-picker-expand`}),renderInput:sn=>(0,d.jsx)(Lt,{...sn,...xe})})]})})}const En=(0,_t.Z)({input:{}},{name:"CatalogReactEntityTagPicker"}),Wn=b=>{const E=En();return(0,d.jsx)(nn,{label:"Tags",name:"tags",path:"metadata.tags",Filter:z,showCounts:b.showCounts,InputProps:{className:E.input}})},Jn=b=>{const{hidden:E,initialFilter:R}=b,D=(0,h.h_)(h.$v),{error:te,availableTypes:de,selectedTypes:ae,setSelectedTypes:xe}=Yt();if((0,B.useEffect)(()=>{te&&D.post({message:"Failed to load entity types",severity:"error"}),R&&xe([R])},[te,D,R,xe]),de.length===0||te)return null;const Te=[{value:"all",label:"all"},...de.map(De=>({value:De,label:De}))];var me;return E?null:(0,d.jsx)(I.Z,{pb:1,pt:1,children:(0,d.jsx)(P.Ph,{label:"Type",items:Te,selected:(me=Te.length>1?ae[0]:void 0)!==null&&me!==void 0?me:"all",onChange:De=>xe(De==="all"?[]:[String(De)])})})};var lr=r(15459),An=r(61837),Rn=r(11640),rr=r(28347);const S=(0,lr.Z)({root:{color:"#f3ba37"}})(Rn.Z),c=b=>{const{toggleStarredEntity:E,isStarredEntity:R}=xn(b.entity);return(0,d.jsx)(An.Z,{"aria-label":"favorite",color:"inherit",...b,onClick:()=>E(),children:(0,d.jsx)(X.ZP,{title:R?"Remove from favorites":"Add to favorites",children:R?(0,d.jsx)(S,{}):(0,d.jsx)(rr.Z,{})})})};var x=r(8629),j=r(79249),Q=r(38724),Se=r(99152),we=r(6487),Ze=r(49429),Ge=r(55999),Gt=r(39412);const gn=Gt.Z;function Vn(b,E){if(b)return b.toLocaleLowerCase("en-US");if(E)try{return(0,O.of)(E).kind.toLocaleLowerCase("en-US")}catch{return}}function mr(b,E){const R=(0,h.qD)(),D=Vn(b,E);return D&&R.getSystemIcon(`kind:${D}`)||gn}function vr(b){const{kind:E,entityRef:R,...D}=b,te=mr(E,R);return(0,d.jsx)(te,{...D})}const eo=(0,_t.Z)(b=>({node:{fill:b.palette.grey[300],stroke:b.palette.grey[300],"&.primary":{fill:b.palette.primary.light,stroke:b.palette.primary.light},"&.secondary":{fill:b.palette.secondary.light,stroke:b.palette.secondary.light}},text:{fill:b.palette.getContrastText(b.palette.grey[300]),"&.primary":{fill:b.palette.primary.contrastText},"&.secondary":{fill:b.palette.secondary.contrastText},"&.focused":{fontWeight:"bold"}},clickable:{cursor:"pointer"}}));function Co(b){const E=(0,h.h_)(H),R=(0,O.eE)(b),{loading:D,error:te,value:de}=(0,vt.default)(async()=>{const ae=await E.getEntityAncestors({entityRef:R}),xe=new Array,Te=new Array;for(const me of ae.items){const De=(0,O.eE)(me.entity),Ne=De===ae.rootEntityRef;xe.push({id:De,root:Ne,...me.entity});for(const rt of me.parentEntityRefs)Te.push({from:De,to:rt})}return{nodes:xe,edges:Te}},[R]);return{loading:D,error:te,nodes:(de==null?void 0:de.nodes)||[],edges:(de==null?void 0:de.edges)||[]}}function to({node:b}){const E=eo(),R=(0,$t.s0)(),D=(0,h.tg)(Bt),[te,de]=(0,B.useState)(0),[ae,xe]=(0,B.useState)(0),Te=(0,B.useRef)(null);(0,B.useLayoutEffect)(()=>{if(Te.current){let{height:Xe,width:gt}=Te.current.getBBox();Xe=Math.round(Xe),gt=Math.round(gt),(Xe!==ae||gt!==te)&&(de(gt),xe(Xe))}},[te,ae]);const me=10,De=ae,Ne=De+me,rt=Ne+te+me*2,ct=ae+me*2,Ye=b.metadata.title||(b.kind&&b.metadata.name&&b.metadata.namespace?_({kind:b.kind,name:b.metadata.name,namespace:b.metadata.namespace||""}):b.id),ke=()=>{R(D({kind:b.kind,namespace:b.metadata.namespace||O.zG,name:b.metadata.name}))};return(0,d.jsxs)("g",{onClick:ke,className:E.clickable,children:[(0,d.jsx)("rect",{className:At()(E.node,b.root?"secondary":"primary"),width:rt,height:ct,rx:10}),(0,d.jsx)(vr,{kind:b.kind,y:me,x:me,width:De,height:De,className:At()(E.text,b.root?"secondary":"primary")}),(0,d.jsx)("text",{ref:Te,className:At()(E.text,b.root?"secondary":"primary"),y:ct/2,x:Ne+(te+me*2)/2,textAnchor:"middle",alignmentBaseline:"middle",children:Ye})]})}function yr(b){const{loading:E,error:R,nodes:D,edges:te}=Co(b.entity);return E?(0,d.jsx)(P.Ex,{}):R?(0,d.jsx)(P.Gk,{error:R}):(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(Ge.Z,{variant:"h2",children:"Ancestry"}),(0,d.jsxs)(Ge.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,d.jsx)(P.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,d.jsx)(I.Z,{mt:4,children:(0,d.jsx)(P.mn,{nodes:D,edges:te,renderNode:to,direction:P.NX.Direction.BOTTOM_TOP,zoom:"enable-on-click"})})]})}var Hn=r(11776),Qn=r(38402),xr=r(86136),Or=r(99688),kr=r(49378),es=r(54506),Hr=r(94339),ts=r(24579),wo=r(27685);const Gr=(0,_t.Z)(b=>({root:{display:"flex",flexDirection:"column"},marginTop:{marginTop:b.spacing(2)},helpIcon:{marginLeft:b.spacing(1),color:b.palette.text.disabled},monospace:{fontFamily:"monospace"}}));function _n(b){const E=Gr();return(0,d.jsx)(kr.Z,{...b,primaryTypographyProps:{className:E.monospace},secondaryTypographyProps:{className:E.monospace}})}function Br(b){const E=Gr();return(0,d.jsx)(es.Z,{className:E.monospace,children:b.children})}function $r(b){return(0,d.jsx)(I.Z,{mt:2,children:(0,d.jsx)(Hr.Z,{variant:"outlined",children:(0,d.jsxs)(ts.Z,{children:[(0,d.jsxs)(C.Z,{variant:"h6",gutterBottom:!0,children:[b.title,b.helpLink&&(0,d.jsx)(Zr,{to:b.helpLink})]}),b.children]})})})}function jo(b){if(b.match(/^url:https?:\/\//))return b.slice(4);if(b.match(/^https?:\/\//))return b}function Dr(b){const[E,R]=b.entry,D=jo(R);return(0,d.jsxs)(Qn.Z,{children:[b.indent&&(0,d.jsx)(xr.Z,{}),(0,d.jsx)(_n,{primary:E,secondary:D?(0,d.jsx)(P.rU,{to:D,children:R}):R})]})}function Zr(b){const E=Gr();return(0,d.jsx)(P.rU,{to:b.to,className:E.helpIcon,children:(0,d.jsx)(wo.Z,{fontSize:"inherit"})})}const no=(0,_t.Z)({root:{display:"flex",flexDirection:"column"}});function Eo(b){var E,R;const D=(0,h.h_)(H),te=(0,O.eE)(b),de=(E=b.metadata.annotations)===null||E===void 0?void 0:E[O.P1],ae=(R=b.metadata.annotations)===null||R===void 0?void 0:R[O.q1],{loading:xe,error:Te,value:me}=(0,vt.default)(async()=>!de&&!ae?[]:(await D.getEntities({filter:[...de?[{[`metadata.annotations.${O.P1}`]:de}]:[],...ae?[{[`metadata.annotations.${O.q1}`]:ae}]:[]]})).items,[de,ae]);return{loading:xe,error:Te,location:de,originLocation:ae,colocatedEntities:me==null?void 0:me.filter(De=>(0,O.eE)(De)!==te)}}function Nr(b){return(0,d.jsxs)(Hn.Z,{dense:!0,children:[b.header&&(0,d.jsx)(Dr,{entry:b.header},"header"),b.entities.map(E=>(0,d.jsxs)(Qn.Z,{children:[(0,d.jsx)(xr.Z,{children:(0,d.jsx)(vr,{kind:E.kind})}),(0,d.jsx)(_n,{primary:(0,d.jsx)(K,{entityRef:E})})]},(0,O.eE)(E)))]})}function In(b){const{entity:E}=b,{loading:R,error:D,location:te,originLocation:de,colocatedEntities:ae}=Eo(E);if(R)return(0,d.jsx)(P.Ex,{});if(D)return(0,d.jsx)(P.Gk,{error:D});if(!te&&!de)return(0,d.jsx)(Or.Z,{severity:"warning",children:"Entity had no location information."});if(!(ae!=null&&ae.length))return(0,d.jsx)(Or.Z,{severity:"info",children:"There were no other entities on this location."});if(te===de)return(0,d.jsx)(Nr,{entities:ae});const xe=ae.filter(me=>{var De;return((De=me.metadata.annotations)===null||De===void 0?void 0:De[O.P1])===te}),Te=ae.filter(me=>{var De;return((De=me.metadata.annotations)===null||De===void 0?void 0:De[O.q1])===de});return(0,d.jsxs)(d.Fragment,{children:[xe.length>0&&(0,d.jsx)(Nr,{entities:xe,header:["At the same location",te]}),Te.length>0&&(0,d.jsx)(Nr,{entities:Te,header:["At the same origin",de]})]})}function ro(b){const E=no();return(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(Ge.Z,{variant:"h2",children:"Colocated"}),(0,d.jsx)(Ge.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,d.jsx)("div",{className:E.root,children:(0,d.jsx)(In,{entity:b.entity})})]})}function Kr(b){return Object.fromEntries([...Object.entries(b)].sort((E,R)=>E[0]<R[0]?-1:1))}function Ao(b){return(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(Ge.Z,{variant:"h2",children:"Entity as JSON"}),(0,d.jsx)(Ge.Z,{children:"This is the raw entity data as received from the catalog, on JSON form."}),(0,d.jsx)(Ge.Z,{children:(0,d.jsx)("div",{style:{fontSize:"75%"},"data-testid":"code-snippet",children:(0,d.jsx)(P.Oi,{text:JSON.stringify(Kr(b.entity),void 0,2),language:"json",showCopyCodeButton:!0})})})]})}var br=r(3440),To=r.n(br);const oo=(0,_t.Z)({root:{display:"flex",flexDirection:"column"}});function Ro(b){var E,R;const D=oo(),{apiVersion:te,kind:de,metadata:ae,spec:xe,relations:Te=[],status:me={}}=b.entity,De=To()(Ft()(Te,Ne=>Ne.targetRef),"type");return(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(Ge.Z,{variant:"h2",children:"Overview"}),(0,d.jsxs)("div",{className:D.root,children:[(0,d.jsx)($r,{title:"Identity",children:(0,d.jsxs)(Hn.Z,{dense:!0,children:[(0,d.jsx)(Qn.Z,{children:(0,d.jsx)(_n,{primary:"apiVersion",secondary:te})}),(0,d.jsx)(Qn.Z,{children:(0,d.jsx)(_n,{primary:"kind",secondary:de})}),(xe==null?void 0:xe.type)&&(0,d.jsx)(Qn.Z,{children:(0,d.jsx)(_n,{primary:"spec.type",secondary:xe.type})}),ae.uid&&(0,d.jsx)(Qn.Z,{children:(0,d.jsx)(_n,{primary:"uid",secondary:ae.uid})}),ae.etag&&(0,d.jsx)(Qn.Z,{children:(0,d.jsx)(_n,{primary:"etag",secondary:ae.etag})})]})}),(0,d.jsxs)($r,{title:"Metadata",children:[!!Object.keys(ae.annotations||{}).length&&(0,d.jsx)(Hn.Z,{dense:!0,subheader:(0,d.jsxs)(Br,{children:["Annotations",(0,d.jsx)(Zr,{to:"https://backstage.io/docs/features/software-catalog/well-known-annotations"})]}),children:Object.entries(ae.annotations).map(Ne=>(0,d.jsx)(Dr,{indent:!0,entry:Ne},Ne[0]))}),!!Object.keys(ae.labels||{}).length&&(0,d.jsx)(Hn.Z,{dense:!0,subheader:(0,d.jsx)(Br,{children:"Labels"}),children:Object.entries(ae.labels).map(Ne=>(0,d.jsx)(Dr,{indent:!0,entry:Ne},Ne[0]))}),!!(!((E=ae.tags)===null||E===void 0)&&E.length)&&(0,d.jsx)(Hn.Z,{dense:!0,subheader:(0,d.jsx)(Br,{children:"Tags"}),children:ae.tags.map((Ne,rt)=>(0,d.jsxs)(Qn.Z,{children:[(0,d.jsx)(xr.Z,{}),(0,d.jsx)(_n,{primary:Ne})]},`${Ne}-${rt}`))})]}),!!Te.length&&(0,d.jsx)($r,{title:"Relations",helpLink:"https://backstage.io/docs/features/software-catalog/well-known-relations",children:Object.entries(De).map(([Ne,rt],ct)=>(0,d.jsx)("div",{children:(0,d.jsx)(Hn.Z,{dense:!0,subheader:(0,d.jsx)(Br,{children:Ne}),children:rt.map(Ye=>(0,d.jsxs)(Qn.Z,{children:[(0,d.jsx)(xr.Z,{children:(0,d.jsx)(vr,{entityRef:Ye.targetRef})}),(0,d.jsx)(_n,{primary:(0,d.jsx)(K,{entityRef:Ye.targetRef})})]},Ye.targetRef))})},ct))}),!!(!((R=me.items)===null||R===void 0)&&R.length)&&(0,d.jsx)($r,{title:"Status",helpLink:"https://backstage.io/docs/features/software-catalog/well-known-statuses",children:me.items.map((Ne,rt)=>(0,d.jsxs)("div",{children:[(0,d.jsxs)(C.Z,{children:[Ne.level,": ",Ne.type]}),(0,d.jsx)(I.Z,{ml:2,children:Ne.message})]},rt))})]})]})}var so=r(72847);function Sr(b){return(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(Ge.Z,{variant:"h2",children:"Entity as YAML"}),(0,d.jsx)(Ge.Z,{children:"This is the raw entity data as received from the catalog, on YAML form."}),(0,d.jsx)(Ge.Z,{children:(0,d.jsx)("div",{style:{fontSize:"75%"},"data-testid":"code-snippet",children:(0,d.jsx)(P.Oi,{text:so.ZP.stringify(Kr(b.entity)),language:"yaml",showCopyCodeButton:!0})})})]})}const Io=(0,_t.Z)(b=>({fullHeightDialog:{height:"calc(100% - 64px)"},root:{display:"flex",flexGrow:1,width:"100%",backgroundColor:b.palette.background.paper},tabs:{borderRight:`1px solid ${b.palette.divider}`,flexShrink:0},tabContents:{flexGrow:1,overflowX:"auto"}}));function wr(b){const{children:E,value:R,index:D,...te}=b,de=Io();return(0,d.jsx)("div",{role:"tabpanel",hidden:R!==D,id:`vertical-tabpanel-${D}`,"aria-labelledby":`vertical-tab-${D}`,className:de.tabContents,...te,children:R===D&&(0,d.jsx)(I.Z,{pl:3,pr:3,children:E})})}function cr(b){return{id:`vertical-tab-${b}`,"aria-controls":`vertical-tabpanel-${b}`}}function Po(b){const E=Io(),[R,D]=B.useState(0);return(0,B.useEffect)(()=>{D(0)},[b.open]),b.entity?(0,d.jsxs)(x.Z,{fullWidth:!0,maxWidth:"xl",open:b.open,onClose:b.onClose,"aria-labelledby":"entity-inspector-dialog-title",PaperProps:{className:E.fullHeightDialog},children:[(0,d.jsx)(j.Z,{id:"entity-inspector-dialog-title",children:"Entity Inspector"}),(0,d.jsx)(Q.Z,{dividers:!0,children:(0,d.jsxs)("div",{className:E.root,children:[(0,d.jsxs)(Se.Z,{orientation:"vertical",variant:"scrollable",value:R,onChange:(te,de)=>D(de),"aria-label":"Inspector options",className:E.tabs,children:[(0,d.jsx)(we.Z,{label:"Overview",...cr(0)}),(0,d.jsx)(we.Z,{label:"Ancestry",...cr(1)}),(0,d.jsx)(we.Z,{label:"Colocated",...cr(2)}),(0,d.jsx)(we.Z,{label:"Raw JSON",...cr(3)}),(0,d.jsx)(we.Z,{label:"Raw YAML",...cr(4)})]}),(0,d.jsx)(wr,{value:R,index:0,children:(0,d.jsx)(Ro,{entity:b.entity})}),(0,d.jsx)(wr,{value:R,index:1,children:(0,d.jsx)(yr,{entity:b.entity})}),(0,d.jsx)(wr,{value:R,index:2,children:(0,d.jsx)(ro,{entity:b.entity})}),(0,d.jsx)(wr,{value:R,index:3,children:(0,d.jsx)(Ao,{entity:b.entity})}),(0,d.jsx)(wr,{value:R,index:4,children:(0,d.jsx)(Sr,{entity:b.entity})})]})}),(0,d.jsx)(Ze.Z,{children:(0,d.jsx)(V.Z,{onClick:b.onClose,color:"primary",children:"Close"})})]}):null}var Lo=r(85256);function Xn(b){var E;const R=(0,h.h_)(H),D=(E=b.metadata.annotations)===null||E===void 0?void 0:E[O.q1],te=b.metadata.uid,de=D==="bootstrap:bootstrap",ae=(0,vt.default)(async()=>{const Ye=R.getLocationByRef(D);let ke;if(!D)ke=Promise.resolve([]);else{const Xe=`metadata.annotations.${O.q1}`;ke=R.getEntities({filter:{[Xe]:D},fields:["kind","metadata.uid","metadata.name","metadata.namespace"]}).then(gt=>gt.items)}return Promise.all([Ye,ke]).then(([Xe,gt])=>({location:Xe,colocatedEntities:gt}))},[R,b]),xe=(0,B.useCallback)(async function(){const{location:ke}=ae.value;await R.removeLocationById(ke.id)},[R,ae]),Te=(0,B.useCallback)(async function(){await R.removeEntityByUid(te)},[R,te]);if(de)return{type:"bootstrap",location:D,deleteEntity:Te};const{loading:me,error:De,value:Ne}=ae;if(me)return{type:"loading"};if(De)return{type:"error",error:De};const{location:rt,colocatedEntities:ct}=Ne;return rt?{type:"unregister",location:D,colocatedEntities:ct.map(O.iB),unregisterLocation:xe,deleteEntity:Te}:{type:"only-delete",deleteEntity:Te}}var ns=r(23054);const rs=(0,_t.Z)({advancedButton:{fontSize:"0.7em"},dialogActions:{display:"inline-block"}}),os=({entity:b,onConfirm:E,onClose:R})=>{const D=(0,h.h_)(h.$v),te=(0,h.h_)(h.Ds),de=rs(),ae=Xn(b),[xe,Te]=(0,B.useState)(!1),[me,De]=(0,B.useState)(!1);var Ne;const rt=(Ne=te.getOptionalString("app.title"))!==null&&Ne!==void 0?Ne:"Backstage",ct=(0,B.useCallback)(async function(){if("unregisterLocation"in ae){De(!0);try{await ae.unregisterLocation(),E()}catch(gt){(0,ns.BD)(gt),D.post({message:gt.message})}finally{De(!1)}}},[D,E,ae]),Ye=(0,B.useCallback)(async function(){if("deleteEntity"in ae){De(!0);try{await ae.deleteEntity(),E()}catch(gt){(0,ns.BD)(gt),D.post({message:gt.message})}finally{De(!1)}}},[D,E,ae]),ke=()=>(0,d.jsx)(Ze.Z,{className:de.dialogActions,children:(0,d.jsx)(V.Z,{onClick:R,color:"primary",children:"Cancel"})});return ae.type==="loading"?(0,d.jsx)(P.Ex,{}):ae.type==="error"?(0,d.jsx)(P.Gk,{error:ae.error}):ae.type==="bootstrap"?(0,d.jsxs)(d.Fragment,{children:[(0,d.jsxs)(Or.Z,{severity:"info",children:['You cannot unregister this entity, since it originates from a protected Backstage configuration (location "',ae.location,'"). If you believe this is in error, please contact the ',rt," ","integrator."]}),(0,d.jsxs)(I.Z,{marginTop:2,children:[!xe&&(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(V.Z,{variant:"text",size:"small",color:"primary",className:de.advancedButton,onClick:()=>Te(!0),children:"Advanced Options"}),(0,d.jsx)(ke,{})]}),xe&&(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(Ge.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,d.jsx)(V.Z,{variant:"contained",color:"secondary",disabled:me,onClick:Ye,children:"Delete Entity"}),(0,d.jsx)(ke,{})]})]})]}):ae.type==="only-delete"?(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(Ge.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,d.jsx)(V.Z,{variant:"contained",color:"secondary",disabled:me,onClick:Ye,children:"Delete Entity"}),(0,d.jsx)(ke,{})]}):ae.type==="unregister"?(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(Ge.Z,{children:"This action will unregister the following entities:"}),(0,d.jsx)(Ge.Z,{component:"ul",children:ae.colocatedEntities.map(Xe=>(0,d.jsx)("li",{children:(0,d.jsx)(K,{entityRef:Xe})},`${Xe.kind}:${Xe.namespace}/${Xe.name}`))}),(0,d.jsx)(Ge.Z,{children:"Located at the following location:"}),(0,d.jsx)(Ge.Z,{component:"ul",children:(0,d.jsx)("li",{children:ae.location})}),(0,d.jsxs)(Ge.Z,{children:["To undo, just re-register the entity in ",rt,"."]}),(0,d.jsxs)(I.Z,{marginTop:2,children:[(0,d.jsx)(V.Z,{variant:"contained",color:"secondary",disabled:me,onClick:ct,children:"Unregister Location"}),!xe&&(0,d.jsx)(I.Z,{component:"span",marginLeft:2,children:(0,d.jsx)(V.Z,{variant:"text",size:"small",color:"primary",className:de.advancedButton,onClick:()=>Te(!0),children:"Advanced Options"})})]}),xe&&(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(I.Z,{paddingTop:4,paddingBottom:4,children:(0,d.jsx)(Lo.Z,{})}),(0,d.jsx)(Ge.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,d.jsx)(V.Z,{variant:"contained",color:"secondary",disabled:me,onClick:Ye,children:"Delete Entity"})]})]}):(0,d.jsx)(Or.Z,{severity:"error",children:"Internal error: Unknown state"})},ss=b=>{const{open:E,onConfirm:R,onClose:D,entity:te}=b;return(0,d.jsxs)(x.Z,{open:E,onClose:D,children:[(0,d.jsx)(j.Z,{id:"responsive-dialog-title",children:"Are you sure you want to unregister this entity?"}),(0,d.jsx)(Q.Z,{children:(0,d.jsx)(os,{entity:te,onConfirm:R,onClose:D})})]})};var is=r(12231),io=r(9520),as=r(47603);const dr=(0,_t.Z)(b=>({root:{backgroundColor:"rgba(0, 0, 0, .11)",boxShadow:"none",margin:b.spacing(1,0,1,0)},title:{margin:b.spacing(1,0,0,1),textTransform:"uppercase",fontSize:12,fontWeight:"bold"},listIcon:{minWidth:30,color:b.palette.text.primary},menuItem:{minHeight:b.spacing(6)},groupWrapper:{margin:b.spacing(1,1,2,1)}}),{name:"CatalogReactUserListPicker"});function ao(b){return[{name:"Personal",items:[{id:"owned",label:"Owned",icon:as.Z},{id:"starred",label:"Starred",icon:Rn.Z}]},{name:b!=null?b:"Company",items:[{id:"all",label:"All"}]}]}const Oo=b=>{const{initialFilter:E,availableFilters:R}=b,D=dr(),te=(0,h.h_)(h.Ds);var de;const ae=(de=te.getOptionalString("organization.name"))!==null&&de!==void 0?de:"Company",{filters:xe,updateFilters:Te,backendEntities:me,queryParameters:{kind:De,user:Ne},loading:rt}=Je(),ct=["starred","all"],Ye=ao(ae).map(Ln=>({...Ln,items:Ln.items.filter(({id:Nn})=>["group","user"].some(Ar=>Ar===De)?ct.includes(Nn):!R||R.includes(Nn))})).filter(({items:Ln})=>!!Ln.length),{isStarredEntity:ke}=Mn(),{isOwnedEntity:Xe,loading:gt}=Dn(),ln=rt||gt,Qt=(0,B.useMemo)(()=>new it("owned",Xe,ke),[Xe,ke]),sn=(0,B.useMemo)(()=>new it("starred",Xe,ke),[Xe,ke]),cn=(0,B.useMemo)(()=>[Ne].flat()[0],[Ne]),[Pn,Zn]=(0,B.useState)(cn!=null?cn:E),jr=(0,B.useMemo)(()=>me.filter((0,re.Gz)((0,pt.compact)(Object.values({...xe,user:void 0})))),[xe,me]),Er=(0,B.useMemo)(()=>({all:jr.length,starred:jr.filter(Ln=>sn.filterEntity(Ln)).length,owned:jr.filter(Ln=>Qt.filterEntity(Ln)).length}),[jr,sn,Qt]);(0,B.useEffect)(()=>{cn&&Zn(cn)},[cn]),(0,B.useEffect)(()=>{!ln&&Pn&&Pn!=="all"&&Er[Pn]===0&&Zn("all")},[ln,Er,Pn,Zn]),(0,B.useEffect)(()=>{Te({user:Pn?new it(Pn,Xe,ke):void 0})},[Pn,Xe,ke,Te]);var Yr;return(0,d.jsx)(Hr.Z,{className:D.root,children:Ye.map(Ln=>(0,d.jsxs)(B.Fragment,{children:[(0,d.jsx)(C.Z,{variant:"subtitle2",component:"span",className:D.title,children:Ln.name}),(0,d.jsx)(Hr.Z,{className:D.groupWrapper,children:(0,d.jsx)(Hn.Z,{disablePadding:!0,dense:!0,role:"menu","aria-label":Ln.name,children:Ln.items.map(Nn=>{var Ar;return(0,d.jsxs)(is.Z,{role:"none presentation",button:!0,divider:!0,onClick:()=>Zn(Nn.id),selected:Nn.id===((Ar=xe.user)===null||Ar===void 0?void 0:Ar.value),className:D.menuItem,disabled:Er[Nn.id]===0,"data-testid":`user-picker-${Nn.id}`,tabIndex:0,ContainerProps:{role:"menuitem"},children:[Nn.icon&&(0,d.jsx)(xr.Z,{className:D.listIcon,children:(0,d.jsx)(Nn.icon,{fontSize:"small"})}),(0,d.jsx)(kr.Z,{children:(0,d.jsxs)(C.Z,{variant:"body1",children:[Nn.label," "]})}),(0,d.jsx)(io.Z,{children:(Yr=Er[Nn.id])!==null&&Yr!==void 0?Yr:"-"})]},Nn.id)})})})]},Ln.name))})},Gn=(0,_t.Z)({input:{}},{name:"CatalogReactEntityProcessingStatusPickerPicker"}),lo=(0,d.jsx)(hn.Z,{fontSize:"small"}),Fr=(0,d.jsx)(Vt.Z,{fontSize:"small"}),ls=()=>{const b=Gn(),{updateFilters:E}=Je(),[R,D]=(0,B.useState)([]);function te(xe){E({orphan:xe?new nt(xe):void 0})}function de(xe){E({error:xe?new bt(xe):void 0})}const ae=["Is Orphan","Has Error"];return(0,d.jsx)(I.Z,{pb:1,pt:1,children:(0,d.jsxs)(C.Z,{variant:"button",component:"label",children:["Processing Status",(0,d.jsx)(an.ZP,{multiple:!0,disableCloseOnSelect:!0,options:ae,value:R,onChange:(xe,Te)=>{D(Te),te(Te.includes("Is Orphan")),de(Te.includes("Has Error"))},renderOption:(xe,{selected:Te})=>(0,d.jsx)(Wt.Z,{control:(0,d.jsx)(dt.Z,{icon:lo,checkedIcon:Fr,checked:Te}),onClick:me=>me.preventDefault(),label:xe}),size:"small",popupIcon:(0,d.jsx)(jn.Z,{"data-testid":"processing-status-picker-expand"}),renderInput:xe=>(0,d.jsx)(bn.Z,{...xe,className:b.input,variant:"outlined"})})]})})};function cs(b){const{children:E,value:R}=b;var D;const[te,de]=useState((D=R==null?void 0:R.filters)!==null&&D!==void 0?D:{}),ae=useCallback(Ye=>{de(ke=>{const Xe=typeof Ye=="function"?Ye(ke):Ye;return{...ke,...Xe}})},[]),xe=useMemo(()=>({entities:[],backendEntities:[],queryParameters:{}}),[]);var Te,me,De,Ne,rt;const ct=useMemo(()=>({entities:(Te=R==null?void 0:R.entities)!==null&&Te!==void 0?Te:xe.entities,backendEntities:(me=R==null?void 0:R.backendEntities)!==null&&me!==void 0?me:xe.backendEntities,updateFilters:(De=R==null?void 0:R.updateFilters)!==null&&De!==void 0?De:ae,filters:te,loading:(Ne=R==null?void 0:R.loading)!==null&&Ne!==void 0?Ne:!1,queryParameters:(rt=R==null?void 0:R.queryParameters)!==null&&rt!==void 0?rt:xe.queryParameters,error:R==null?void 0:R.error}),[R,xe,te,ae]);return _jsx(EntityListContext.Provider,{value:ct,children:E})}},75435:function(Ct,Be,r){"use strict";r.d(Be,{h:function(){return h}});var t=r(25271);function h(H,f,W){var g;let d=(H==null||(g=H.relations)===null||g===void 0?void 0:g.filter(B=>B.type===f).map(B=>(0,t.of)(B.targetRef)))||[];return W!=null&&W.kind&&(d=d.filter(B=>B.kind.toLocaleLowerCase("en-US")===W.kind.toLocaleLowerCase("en-US"))),d}},49280:function(Ct,Be,r){"use strict";r.d(Be,{hF:function(){return H.h},CV:function(){return W},wq:function(){return t},Gz:function(){return h}});function t(d){return d.reduce((B,ye)=>({...B,...ye.getCatalogFilters?ye.getCatalogFilters():{}}),{})}function h(d){return B=>d.every(ye=>!ye.filterEntity||ye.filterEntity(B))}var H=r(75435),f=r(25271);function W(d,B){var ye;const ue=(ye=d.metadata.annotations)===null||ye===void 0?void 0:ye[f.M6];if(ue)try{const V=(0,f.Ou)(ue),J=B.byUrl(V.target);return{locationTargetUrl:V.target,integrationType:J==null?void 0:J.type}}catch{return}}function g(d,B){const ye=new Set([...getEntityRelations(d,RELATION_MEMBER_OF,{kind:"group"}),...d?[getCompoundEntityRef(d)]:[]].map(stringifyEntityRef)),ue=getEntityRelations(B,RELATION_OWNED_BY).map(stringifyEntityRef);for(const V of ue)if(ye.has(V))return!0;return!1}},33414:function(Ct,Be,r){"use strict";r.r(Be),r.d(Be,{AboutCard:function(){return st},AboutContent:function(){return z},AboutField:function(){return O}});var t=r(52322),h=r(25271),H=r(53974),f=r(60871),W=r(32838),g=r(40303),d=r(79692),B=r(94339),ye=r(32552),ue=r(61837),V=r(85256),J=r(24579),I=r(52866),C=r(30254),oe=r(27604),ee=r(2784),ne=r(19625),$=r(60905),T=r(7089),P=r(90436);const L=(0,d.Z)(Ke=>({value:{fontWeight:"bold",overflow:"hidden",lineHeight:"24px",wordBreak:"break-word"},label:{color:Ke.palette.text.secondary,textTransform:"uppercase",fontSize:"10px",fontWeight:"bold",letterSpacing:.5,overflow:"hidden",whiteSpace:"nowrap"}}));function O(Ke){const{label:it,value:nt,gridSizes:bt,children:St}=Ke,pt=L(),ft=(0,f.vJ)(St,$t=>$t.getElements()),wt=ft.length>0?ft:(0,t.jsx)(P.Z,{variant:"body2",className:pt.value,children:nt||"unknown"});return(0,t.jsxs)($.Z,{item:!0,...bt,children:[(0,t.jsx)(P.Z,{variant:"h2",className:pt.label,children:it}),wt]})}var re=r(24851);const Pe=(0,d.Z)({description:{wordBreak:"break-word"}});function We(Ke,it,nt){if(it==="url"||Ke.includes("://"))return Ke;const bt=nt.type==="file"?`file://${nt.target}`:nt.target;return it==="file"||nt.type==="file"?new URL(Ke,bt).href:bt}function z(Ke){var it,nt,bt,St,pt,ft,wt,$t;const{entity:Ve}=Ke,qt=Pe(),ge=Ve.kind.toLocaleLowerCase("en-US")==="system",be=Ve.kind.toLocaleLowerCase("en-US")==="resource",Fe=Ve.kind.toLocaleLowerCase("en-US")==="component",Je=Ve.kind.toLocaleLowerCase("en-US")==="api",vt=Ve.kind.toLocaleLowerCase("en-US")==="template",Ot=Ve.kind.toLocaleLowerCase("en-US")==="location",ht=Ve.kind.toLocaleLowerCase("en-US")==="group",Rt=(0,g.hF)(Ve,h.cz,{kind:"system"}),Ft=(0,g.hF)(Ve,h.cz,{kind:"component"}),Yt=(0,g.hF)(Ve,h.cz,{kind:"domain"}),kt=(0,g.hF)(Ve,h.S4);let dn;try{dn=(0,h.CV)(Ve)}catch{dn=void 0}return(0,t.jsxs)($.Z,{container:!0,children:[(0,t.jsx)(O,{label:"Description",gridSizes:{xs:12},children:(0,t.jsx)(H.SA,{className:qt.description,content:(Ve==null||(it=Ve.metadata)===null||it===void 0?void 0:it.description)||"No description"})}),(0,t.jsx)(O,{label:"Owner",value:"No Owner",gridSizes:{xs:12,sm:6,lg:4},children:kt.length>0&&(0,t.jsx)(g.rI,{entityRefs:kt,defaultKind:"group"})}),(ge||Yt.length>0)&&(0,t.jsx)(O,{label:"Domain",value:"No Domain",gridSizes:{xs:12,sm:6,lg:4},children:Yt.length>0&&(0,t.jsx)(g.rI,{entityRefs:Yt,defaultKind:"domain"})}),(Je||Fe||be||Rt.length>0)&&(0,t.jsx)(O,{label:"System",value:"No System",gridSizes:{xs:12,sm:6,lg:4},children:Rt.length>0&&(0,t.jsx)(g.rI,{entityRefs:Rt,defaultKind:"system"})}),Fe&&Ft.length>0&&(0,t.jsx)(O,{label:"Parent Component",value:"No Parent Component",gridSizes:{xs:12,sm:6,lg:4},children:(0,t.jsx)(g.rI,{entityRefs:Ft,defaultKind:"component"})}),(Je||Fe||be||vt||ht||Ot||typeof(Ve==null||(nt=Ve.spec)===null||nt===void 0?void 0:nt.type)=="string")&&(0,t.jsx)(O,{label:"Type",value:Ve==null||(bt=Ve.spec)===null||bt===void 0?void 0:bt.type,gridSizes:{xs:12,sm:6,lg:4}}),(Je||Fe||typeof(Ve==null||(St=Ve.spec)===null||St===void 0?void 0:St.lifecycle)=="string")&&(0,t.jsx)(O,{label:"Lifecycle",value:Ve==null||(pt=Ve.spec)===null||pt===void 0?void 0:pt.lifecycle,gridSizes:{xs:12,sm:6,lg:4}}),(0,t.jsx)(O,{label:"Tags",value:"No Tags",gridSizes:{xs:12,sm:6,lg:4},children:((Ve==null||(ft=Ve.metadata)===null||ft===void 0?void 0:ft.tags)||[]).map(Kt=>(0,t.jsx)(T.Z,{size:"small",label:Kt},Kt))}),Ot&&((Ve==null||(wt=Ve.spec)===null||wt===void 0?void 0:wt.targets)||(Ve==null||($t=Ve.spec)===null||$t===void 0?void 0:$t.target))&&(0,t.jsx)(O,{label:"Targets",gridSizes:{xs:12},children:(0,t.jsx)(re.s,{cols:1,items:(Ve.spec.targets||[Ve.spec.target]).map(Kt=>Kt).map(Kt=>{var un;return{text:Kt,href:We(Kt,(Ve==null||(un=Ve.spec)===null||un===void 0?void 0:un.type)||"unknown",dn)}})})})]})}const xt=(0,d.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 st(Ke){var it,nt,bt;const{variant:St}=Ke,pt=xt(),{entity:ft}=(0,g.X2)(),wt=(0,f.h_)(W.q3),$t=(0,f.h_)(g.Ah),Ve=(0,f.h_)(f.$v),qt=(0,f.h_)(f.VE),ge=(0,f.tg)(ne.jU),be=(0,g.CV)(ft,wt),Fe=(it=ft.metadata.annotations)===null||it===void 0?void 0:it[h.Tf],Je={label:"View Source",disabled:!be,icon:(0,t.jsx)(W.nW,{type:be==null?void 0:be.integrationType}),href:be==null?void 0:be.locationTargetUrl},vt={label:"View TechDocs",disabled:!(!((nt=ft.metadata.annotations)===null||nt===void 0)&&nt["backstage.io/techdocs-ref"])||!ge,icon:(0,t.jsx)(C.Z,{}),href:ge&&ge({namespace:ft.metadata.namespace||h.zG,kind:ft.kind,name:ft.metadata.name})};let Ot="";St==="gridItem"?Ot=pt.gridItemCard:St==="fullHeight"&&(Ot=pt.fullHeightCard);let ht="";St==="gridItem"?ht=pt.gridItemCardContent:St==="fullHeight"&&(ht=pt.fullHeightCardContent);const Rt=(bt=ft.metadata.annotations)===null||bt===void 0?void 0:bt[h.P1],Ft=(Rt==null?void 0:Rt.startsWith("url:"))||(Rt==null?void 0:Rt.startsWith("file:")),Yt=(0,ee.useCallback)(async()=>{try{await $t.refreshEntity((0,h.eE)(ft)),Ve.post({message:"Refresh scheduled",severity:"info"})}catch(kt){qt.post(kt)}},[$t,Ve,qt,ft]);return(0,t.jsxs)(B.Z,{className:Ot,children:[(0,t.jsx)(ye.Z,{title:"About",action:(0,t.jsxs)(t.Fragment,{children:[Ft&&(0,t.jsx)(ue.Z,{"aria-label":"Refresh",title:"Schedule entity refresh",onClick:Yt,children:(0,t.jsx)(I.Z,{})}),(0,t.jsx)(ue.Z,{component:H.rU,"aria-label":"Edit",disabled:!Fe,title:"Edit Metadata",to:Fe!=null?Fe:"#",children:(0,t.jsx)(oe.Z,{})})]}),subheader:(0,t.jsx)(H.M6,{links:[Je,vt]})}),(0,t.jsx)(V.Z,{}),(0,t.jsx)(J.Z,{className:ht,children:(0,t.jsx)(z,{entity:ft})})]})}},86359:function(Ct,Be,r){"use strict";r.d(Be,{E:function(){return ne}});var t=r(52322),h=r(25271),H=r(53974),f=r(40303),W=r(90436),g=r(15459),d=r(27604),B=r(2997),ye=r(11640),ue=r(28347),V=r(76635),J=r(2784),I=r(7089);const C=Object.freeze({createNameColumn($){function T(P){var L;return((L=P.metadata)===null||L===void 0?void 0:L.title)||(0,f.$3)(P,{defaultKind:$==null?void 0:$.defaultKind})}return{title:"Name",field:"resolved.name",highlight:!0,customSort({entity:P},{entity:L}){return T(P).localeCompare(T(L))},render:({entity:P})=>{var L;return(0,t.jsx)(f.dx,{entityRef:P,defaultKind:($==null?void 0:$.defaultKind)||"Component",title:(L=P.metadata)===null||L===void 0?void 0:L.title})}}},createSystemColumn(){return{title:"System",field:"resolved.partOfSystemRelationTitle",render:({resolved:$})=>(0,t.jsx)(f.rI,{entityRefs:$.partOfSystemRelations,defaultKind:"system"})}},createOwnerColumn(){return{title:"Owner",field:"resolved.ownedByRelationsTitle",render:({resolved:$})=>(0,t.jsx)(f.rI,{entityRefs:$.ownedByRelations,defaultKind:"group"})}},createSpecTargetsColumn(){return{title:"Targets",field:"entity.spec.targets",render:({entity:$})=>{var T,P;return(0,t.jsx)(t.Fragment,{children:(($==null||(T=$.spec)===null||T===void 0?void 0:T.targets)||($==null||(P=$.spec)===null||P===void 0?void 0:P.target))&&(0,t.jsx)(H.Or,{text:($.spec.targets||[$.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:$})=>(0,t.jsx)(H.Or,{text:$.metadata.description,placement:"bottom-start"}),width:"auto"}},createTagsColumn(){return{title:"Tags",field:"entity.metadata.tags",cellStyle:{padding:"0px 16px 0px 20px"},render:({entity:$})=>(0,t.jsx)(t.Fragment,{children:$.metadata.tags&&$.metadata.tags.map(T=>(0,t.jsx)(I.Z,{label:T,size:"small",variant:"outlined",style:{marginBottom:"0px"}},T))}),width:"auto"}},createTitleColumn($){return{title:"Title",field:"entity.metadata.title",hidden:$==null?void 0:$.hidden,searchable:!0}},createLabelColumn($,T){return{title:(T==null?void 0:T.title)||"Label",field:"entity.metadata.labels",cellStyle:{padding:"0px 16px 0px 20px"},render:({entity:P})=>{var L;const O=(L=P.metadata)===null||L===void 0?void 0:L.labels,re=O&&O[$]||(T==null?void 0:T.defaultValue);return(0,t.jsx)(t.Fragment,{children:re&&(0,t.jsx)(I.Z,{label:re,size:"small",variant:"outlined"},re)})},width:"auto"}}}),oe=(0,g.Z)({root:{color:"#f3ba37"}})(ye.Z),ee=($,T)=>{const P=L=>L.metadata.title||(0,f.$3)(L,{defaultKind:"Component"});return P($).localeCompare(P(T))},ne=$=>{var T,P;const{columns:L,actions:O,tableOptions:re,subtitle:Pe,emptyContent:We}=$,{isStarredEntity:z,toggleStarredEntity:xt}=(0,f.CR)(),{loading:st,error:Ke,entities:it,filters:nt}=(0,f.wp)(),bt=(0,J.useMemo)(()=>{var ge;return[C.createTitleColumn({hidden:!0}),C.createNameColumn({defaultKind:(ge=nt.kind)===null||ge===void 0?void 0:ge.value}),...be(),C.createMetadataDescriptionColumn(),C.createTagsColumn()];function be(){var Fe;switch((Fe=nt.kind)===null||Fe===void 0?void 0:Fe.value){case"user":return[];case"domain":case"system":return[C.createOwnerColumn()];case"group":case"template":return[C.createSpecTypeColumn()];case"location":return[C.createSpecTypeColumn(),C.createSpecTargetsColumn()];default:return[C.createSystemColumn(),C.createOwnerColumn(),C.createSpecTypeColumn(),C.createSpecLifecycleColumn()]}}},[(T=nt.kind)===null||T===void 0?void 0:T.value]),St=nt.type===void 0;var pt;const ft=(0,V.capitalize)((pt=(P=nt.user)===null||P===void 0?void 0:P.value)!==null&&pt!==void 0?pt:"all");if(Ke)return(0,t.jsx)("div",{children:(0,t.jsx)(H.GB,{severity:"error",title:"Could not fetch catalog entities.",children:(0,t.jsx)(H.Oi,{language:"text",text:Ke.toString()})})});const wt=[({entity:ge})=>{var be;const Fe=(be=ge.metadata.annotations)===null||be===void 0?void 0:be[h.l2],Je="View";return{icon:()=>(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(W.Z,{variant:"srOnly",children:Je}),(0,t.jsx)(B.Z,{fontSize:"small"})]}),tooltip:Je,disabled:!Fe,onClick:()=>{Fe&&window.open(Fe,"_blank")}}},({entity:ge})=>{var be;const Fe=(be=ge.metadata.annotations)===null||be===void 0?void 0:be[h.Tf],Je="Edit";return{icon:()=>(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(W.Z,{variant:"srOnly",children:Je}),(0,t.jsx)(d.Z,{fontSize:"small"})]}),tooltip:Je,disabled:!Fe,onClick:()=>{Fe&&window.open(Fe,"_blank")}}},({entity:ge})=>{const be=z(ge),Fe=be?"Remove from favorites":"Add to favorites";return{cellStyle:{paddingLeft:"1em"},icon:()=>(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(W.Z,{variant:"srOnly",children:Fe}),be?(0,t.jsx)(oe,{}):(0,t.jsx)(ue.Z,{})]}),tooltip:Fe,onClick:()=>xt(ge)}}],$t=it.sort(ee).map(ge=>{const be=(0,f.hF)(ge,h.cz,{kind:"system"}),Fe=(0,f.hF)(ge,h.S4);return{entity:ge,resolved:{name:(0,f.$3)(ge,{defaultKind:"Component"}),ownedByRelationsTitle:Fe.map(Je=>(0,f.$3)(Je,{defaultKind:"group"})).join(", "),ownedByRelations:Fe,partOfSystemRelationTitle:be.map(Je=>(0,f.$3)(Je,{defaultKind:"system"})).join(", "),partOfSystemRelations:be}}}),Ve=(L||bt).find(ge=>ge.title==="Type");Ve&&(Ve.hidden=!St);const qt=$t.length>20;return(0,t.jsx)(H.iA,{isLoading:st,columns:L||bt,options:{paging:qt,pageSize:20,actionsColumnIndex:-1,loadingType:"linear",showEmptyDataSourceMessage:!st,padding:"dense",pageSizeOptions:[20,50,100],...re},title:`${ft} (${it.length})`,data:$t,actions:O||wt,subtitle:Pe,emptyContent:We})};ne.columns=C},85877:function(Ct,Be,r){"use strict";r.r(Be),r.d(Be,{EntityLabelsCard:function(){return J},hasLabels:function(){return I}});var t=r(52322),h=r(40303),H=r(2784),f=r(53974),W=r(79692),g=r(90436),d=r(77277);const B=`metadata:
|
|
34
|
+
name: example
|
|
35
|
+
labels:
|
|
36
|
+
javaVersion: 1.2.3`,ye=(0,W.Z)(C=>({code:{borderRadius:6,margin:`${C.spacing(2)}px 0px`,background:C.palette.type==="dark"?"#444":C.palette.common.white}}),{name:"PluginCatalogEntityLabelsEmptyState"});function ue(){const C=ye();return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(g.Z,{variant:"body1",children:"No labels defined for this entity. You can add labels to your entity YAML as shown in the highlighted example below:"}),(0,t.jsx)("div",{className:C.code,children:(0,t.jsx)(f.Oi,{text:B,language:"yaml",showLineNumbers:!0,highlightedNumbers:[3,4,5,6],customStyle:{background:"inherit",fontSize:"115%"}})}),(0,t.jsx)(d.Z,{variant:"contained",color:"primary",target:"_blank",href:"https://backstage.io/docs/features/software-catalog/descriptor-format#labels-optional",children:"Read more"})]})}const V=(0,W.Z)(C=>({key:{fontWeight:"bold"}})),J=C=>{var oe;const{variant:ee,title:ne}=C,{entity:$}=(0,h.X2)(),T=V(),P=[{render:O=>(0,t.jsx)(g.Z,{className:T.key,variant:"body2",children:O.key})},{field:"value"}],L=$==null||(oe=$.metadata)===null||oe===void 0?void 0:oe.labels;return(0,t.jsx)(f.rJ,{title:ne||"Labels",variant:ee,children:!L||Object.keys(L).length===0?(0,t.jsx)(ue,{}):(0,t.jsx)(f.iA,{columns:P,data:Object.keys(L).map(O=>({key:O,value:L[O]})),options:{search:!1,showTitle:!0,loadingType:"linear",header:!1,padding:"dense",pageSize:5,toolbar:!1,paging:Object.keys(L).length>5}})})};function I(C){var oe,ee;return!(C==null||(oe=C.metadata)===null||oe===void 0)&&oe.labels?Object.keys(C==null||(ee=C.metadata)===null||ee===void 0?void 0:ee.labels).some(Boolean):!1}},24851:function(Ct,Be,r){"use strict";r.d(Be,{s:function(){return oe}});var t=r(52322),h=r(90348),H=r(11861),f=r(2784),W=r(79692),g=r(95544),d=r(90436),B=r(52160),ye=r(53974);const ue=(0,W.Z)({svgIcon:{display:"inline-block","& svg":{display:"inline-block",fontSize:"inherit",verticalAlign:"baseline"}}});function V(ee){const{href:ne,text:$,Icon:T}=ee,P=ue();return(0,t.jsxs)(g.Z,{display:"flex",children:[(0,t.jsx)(g.Z,{mr:1,className:P.svgIcon,children:(0,t.jsx)(d.Z,{component:"div",children:T?(0,t.jsx)(T,{}):(0,t.jsx)(B.Z,{})})}),(0,t.jsx)(g.Z,{flexGrow:"1",children:(0,t.jsx)(ye.rU,{to:ne,target:"_blank",rel:"noopener",children:$||ne})})]})}var J=r(41156);const I={xs:1,sm:1,md:1,lg:2,xl:3};function C(ee){const ne=[(0,J.Z)(L=>L.breakpoints.up("xl"))?"xl":null,(0,J.Z)(L=>L.breakpoints.up("lg"))?"lg":null,(0,J.Z)(L=>L.breakpoints.up("md"))?"md":null,(0,J.Z)(L=>L.breakpoints.up("sm"))?"sm":null,(0,J.Z)(L=>L.breakpoints.up("xs"))?"xs":null];let $=1;if(typeof ee=="number")$=ee;else{var T;const L=(T=ne.find(O=>O!==null))!==null&&T!==void 0?T:"xs";var P;$=(P=ee==null?void 0:ee[L])!==null&&P!==void 0?P:I[L]}return $}function oe(ee){const{items:ne,cols:$=void 0}=ee,T=C($);return(0,t.jsx)(h.Z,{rowHeight:"auto",cols:T,children:ne.map(({text:P,href:L,Icon:O},re)=>(0,t.jsx)(H.Z,{children:(0,t.jsx)(V,{href:L,text:P!=null?P:L,Icon:O})},re))})}},19625:function(Ct,Be,r){"use strict";r.d(Be,{_Z:function(){return f},jU:function(){return H},yw:function(){return h}});var t=r(60871);const h=(0,t.x8)({id:"create-component",optional:!0}),H=(0,t.x8)({id:"view-techdoc",optional:!0,params:["namespace","kind","name"]}),f=(0,t.NT)({id:"catalog"})},15096:function(Ct,Be,r){"use strict";r.d(Be,{FA:function(){return ye},qO:function(){return pt},Nd:function(){return z},E5:function(){return It},Rx:function(){return L}});var t=r(60871);const h=(0,t.T0)({id:"plugin.search.queryservice"});class H{query(){return Promise.resolve(this.mockedResults||{results:[]})}constructor(K){_define_property(this,"mockedResults",void 0),this.mockedResults=K}}var f=r(52322),W=r(2784),g=r(38402),d=r(79692);const B=(0,d.Z)(()=>({highlight:{}}),{name:"BackstageHighlightedSearchResultText"}),ye=X=>{const{text:K,preTag:se,postTag:pe}=X,ce=B(),y=(0,W.useMemo)(()=>K.split(new RegExp(`(${se}.+?${pe})`)),[pe,se,K]);return(0,f.jsx)(f.Fragment,{children:y.map((Z,q)=>Z.includes(se)?(0,f.jsx)("mark",{className:ce.highlight,children:Z.replace(new RegExp(`${se}|${pe}`,"g"),"")},q):Z)})};var ue=r(48760),V=r(50581),J=r(61837),I=r(74603),C=r(21853),oe=r(33375),ee=r(76635),ne=r(64279),$=r(1849),T=r(51837);const P=(0,T.CT)("search-context"),L=()=>{const X=(0,W.useContext)(P);if(!X)throw new Error("useSearch must be used within a SearchContextProvider");const K=X.atVersion(1);if(!K)throw new Error("No SearchContext v1 found");return K},O=()=>(0,W.useContext)(P)!==void 0,re={term:"",types:[],filters:{},pageLimit:void 0,pageCursor:void 0},Pe=(X=re)=>{var K,se,pe,ce;const y=(0,t.h_)(h),[Z,q]=(0,W.useState)(X.term),[Y,Ce]=(0,W.useState)(X.types),[Re,Qe]=(0,W.useState)(X.filters),[Et,tt]=(0,W.useState)(X.pageLimit),[yt,He]=(0,W.useState)(X.pageCursor),lt=(0,$.Z)(Z),ot=(0,$.Z)(Re),Ht=(0,ne.default)(()=>y.query({term:Z,types:Y,filters:Re,pageLimit:Et,pageCursor:yt}),[Z,Y,Re,Et,yt]),Ut=!Ht.loading&&!Ht.error&&((K=Ht.value)===null||K===void 0?void 0:K.nextPageCursor),Jt=!Ht.loading&&!Ht.error&&((se=Ht.value)===null||se===void 0?void 0:se.previousPageCursor),en=(0,W.useCallback)(()=>{var Pt;He((Pt=Ht.value)===null||Pt===void 0?void 0:Pt.nextPageCursor)},[(pe=Ht.value)===null||pe===void 0?void 0:pe.nextPageCursor]),Dt=(0,W.useCallback)(()=>{var Pt;He((Pt=Ht.value)===null||Pt===void 0?void 0:Pt.previousPageCursor)},[(ce=Ht.value)===null||ce===void 0?void 0:ce.previousPageCursor]);return(0,W.useEffect)(()=>{lt!==void 0&&Z!==lt&&He(void 0)},[Z,lt,He]),(0,W.useEffect)(()=>{ot!==void 0&&!(0,ee.isEqual)(Re,ot)&&He(void 0)},[Re,ot,He]),{result:Ht,term:Z,setTerm:q,types:Y,setTypes:Ce,filters:Re,setFilters:Qe,pageLimit:Et,setPageLimit:tt,pageCursor:yt,setPageCursor:He,fetchNextPage:Ut?en:void 0,fetchPreviousPage:Jt?Dt:void 0}},We=X=>{const{initialState:K,children:se}=X,pe=Pe(K);return(0,f.jsx)(t.fC,{attributes:{searchTypes:pe.types.sort().join(",")},children:(0,f.jsx)(P.Provider,{value:(0,T.EI)({1:pe}),children:se})})},z=X=>{const{initialState:K,inheritParentContextIfAvailable:se,children:pe}=X;return O()&&se?(0,f.jsx)(f.Fragment,{children:pe}):(0,f.jsx)(We,{initialState:K,children:pe})},xt=({children:X})=>{var K;const se=Re=>(0,$.Z)(Re)!==Re,pe=(0,t.z$)(),{term:ce,result:y}=L();var Z;const q=(Z=(K=y.value)===null||K===void 0?void 0:K.numberOfResults)!==null&&Z!==void 0?Z:void 0,Ce=se(y.loading)&&!y.loading;return(0,W.useEffect)(()=>{ce&&Ce&&pe.captureEvent("search",ce,{value:q})},[pe,ce,q,Ce]),(0,f.jsx)(f.Fragment,{children:X})};function st(X){return(0,W.forwardRef)((K,se)=>(0,f.jsx)(z,{inheritParentContextIfAvailable:!0,children:(0,f.jsx)(X,{...K,ref:se})}))}const Ke=st((0,W.forwardRef)((X,K)=>{const{onChange:se,onKeyDown:pe=()=>{},onClear:ce=()=>{},onSubmit:y=()=>{},debounceTime:Z=200,clearButton:q=!0,fullWidth:Y=!0,value:Ce,placeholder:Re,inputProps:Qe={},endAdornment:Et,...tt}=X,yt=(0,t.h_)(t.Ds),[He,lt]=(0,W.useState)("");(0,W.useEffect)(()=>{lt(At=>At!==Ce?String(Ce):At)},[Ce]),(0,ue.Z)(()=>se(He),Z,[He]);const ot=(0,W.useCallback)(At=>{lt(At.target.value)},[lt]),Ht=(0,W.useCallback)(At=>{pe&&pe(At),y&&At.key==="Enter"&&y()},[pe,y]),Ut=(0,W.useCallback)(()=>{se(""),ce&&ce()},[se,ce]),Jt=Re!=null?Re:`Search in ${yt.getOptionalString("app.title")||"Backstage"}`,en=(0,f.jsx)(V.Z,{position:"start",children:(0,f.jsx)(J.Z,{"aria-label":"Query",size:"small",disabled:!0,children:(0,f.jsx)(C.Z,{})})}),Dt=(0,f.jsx)(V.Z,{position:"end",children:(0,f.jsx)(J.Z,{"aria-label":"Clear",size:"small",onClick:Ut,children:(0,f.jsx)(oe.Z,{})})});return(0,f.jsx)(xt,{children:(0,f.jsx)(I.Z,{"data-testid":"search-bar-next",ref:K,value:He,placeholder:Jt,startAdornment:en,endAdornment:q?Dt:Et,inputProps:{"aria-label":"Search",...Qe},fullWidth:Y,onChange:ot,onKeyDown:Ht,...tt})})})),it=st((0,W.forwardRef)((X,K)=>{const{value:se="",onChange:pe,...ce}=X,{term:y,setTerm:Z}=L();(0,W.useEffect)(()=>{se&&Z(String(se))},[se,Z]);const q=(0,W.useCallback)(Y=>{pe?pe(Y):Z(Y)},[pe,Z]);return(0,f.jsx)(t.fC,{attributes:{pluginId:"search",extension:"SearchBar"},children:(0,f.jsx)(Ke,{...ce,ref:K,value:y,onChange:q})})}));var nt=r(4614),bt=r(88013);const pt=(X=>K=>(0,f.jsx)(z,{inheritParentContextIfAvailable:!0,children:(0,f.jsx)(X,{...K})}))(function(K){const{loading:se,value:pe,onChange:ce=()=>{},options:y=[],getOptionLabel:Z=Ut=>String(Ut),inputPlaceholder:q,inputDebounceTime:Y,freeSolo:Ce=!0,fullWidth:Re=!0,clearOnBlur:Qe=!1,"data-testid":Et="search-autocomplete",...tt}=K,{setTerm:yt}=L(),He=(0,W.useCallback)(Ut=>Ut?typeof Ut=="string"?Ut:Z(Ut):"",[Z]),lt=(0,W.useMemo)(()=>He(pe),[pe,He]),ot=(0,W.useCallback)((Ut,Jt,en,Dt)=>{yt(He(Jt)),ce(Ut,Jt,en,Dt)},[He,yt,ce]),Ht=(0,W.useCallback)(({InputProps:{ref:Ut,endAdornment:Jt},InputLabelProps:en,...Dt})=>(0,f.jsx)(it,{...Dt,ref:Ut,clearButton:!1,value:lt,placeholder:q,debounceTime:Y,endAdornment:se?(0,f.jsx)(nt.Z,{"data-testid":"search-autocomplete-progressbar",color:"inherit",size:20}):Jt}),[se,lt,q,Y]);return(0,f.jsx)(bt.ZP,{...tt,"data-testid":Et,value:pe,onChange:ot,options:y,getOptionLabel:Z,renderInput:Ht,freeSolo:Ce,fullWidth:Re,clearOnBlur:Qe})}),ft=X=>{const{icon:K,primaryText:se,primaryTextTypographyProps:pe,secondaryText:ce,secondaryTextTypographyProps:y,disableTextTypography:Z}=X;return _jsxs(_Fragment,{children:[K?_jsx(ListItemIcon,{children:K}):null,_jsx(ListItemText,{primary:se,primaryTypographyProps:pe,secondary:ce,secondaryTypographyProps:y,disableTypography:Z})]})};var wt=r(42494),$t=r(84899),Ve=r(5806),qt=r(21324),ge=r(56939),be=r(73698),Fe=r(12231),Je=r(86619),vt=r(7089),Ot=r(69294);const ht=(X,K,se=[],pe=250)=>{const ce=(0,W.useRef)({}),y=X||(()=>Promise.resolve([])),[Z,q]=(0,Ot.default)(y,[K],{loading:!0});if((0,ue.Z)(()=>{ce.current[K]===void 0&&(ce.current[K]=q(K).then(Ce=>(ce.current[K]=Ce,Ce)))},pe,[q,K]),se.length)return{loading:!1,value:se};const Y=ce.current[K];return Array.isArray(Y)?{loading:!1,value:Y}:Z},Rt=(X,K)=>{const{setFilters:se}=L();(0,W.useEffect)(()=>{K&&[K].flat().length>0&&se(pe=>({...pe,[X]:K}))},[])},Ft=X=>{const{className:K,defaultValue:se,name:pe,values:ce,valuesDebounceMs:y,label:Z,filterSelectedOptions:q,limitTags:Y,multiple:Ce}=X,[Re,Qe]=(0,W.useState)("");Rt(pe,se);const Et=typeof ce=="function"?ce:void 0,tt=typeof ce=="function"?void 0:ce,{value:yt,loading:He}=ht(Et,Re,tt,y),{filters:lt,setFilters:ot}=L(),Ht=lt[pe]||(Ce?[]:null),Ut=(Dt,At)=>{ot(Pt=>{const{[pe]:Lt,...nn}=Pt;return At?{...nn,[pe]:At}:{...nn}})},Jt=Dt=>(0,f.jsx)(Je.Z,{...Dt,name:"search",variant:"outlined",label:Z,fullWidth:!0}),en=(Dt,At)=>Dt.map((Pt,Lt)=>(0,f.jsx)(vt.Z,{label:Pt,color:"primary",...At({index:Lt})}));return(0,f.jsx)(bt.ZP,{filterSelectedOptions:q,limitTags:Y,multiple:Ce,className:K,id:`${Ce?"multi-":""}select-filter-${pe}--select`,options:yt||[],loading:He,value:Ht,onChange:Ut,onInputChange:(Dt,At)=>Qe(At),renderInput:Jt,renderTags:en})},Yt=(0,d.Z)({label:{textTransform:"capitalize"}}),kt=X=>{const{className:K,defaultValue:se,label:pe,name:ce,values:y=[],valuesDebounceMs:Z}=X,q=Yt(),{filters:Y,setFilters:Ce}=L();Rt(ce,se);const Re=typeof y=="function"?y:void 0,Qe=typeof y=="function"?void 0:y,{value:Et=[],loading:tt}=ht(Re,"",Qe,Z),yt=lt=>{const{target:{value:ot,checked:Ht}}=lt;Ce(Ut=>{const{[ce]:Jt,...en}=Ut,Dt=(Jt||[]).filter(Pt=>Pt!==ot),At=Ht?[...Dt,ot]:Dt;return At.length?{...en,[ce]:At}:en})};var He;return(0,f.jsxs)(wt.Z,{className:K,disabled:tt,fullWidth:!0,"data-testid":"search-checkboxfilter-next",children:[pe?(0,f.jsx)($t.Z,{className:q.label,children:pe}):null,Et.map(lt=>(0,f.jsx)(Ve.Z,{control:(0,f.jsx)(qt.Z,{color:"primary",tabIndex:-1,inputProps:{"aria-labelledby":lt},value:lt,name:lt,onChange:yt,checked:((He=Y[ce])!==null&&He!==void 0?He:[]).includes(lt)}),label:lt},lt))]})},dn=X=>{const{className:K,defaultValue:se,label:pe,name:ce,values:y,valuesDebounceMs:Z}=X,q=Yt();Rt(ce,se);const Y=typeof y=="function"?y:void 0,Ce=typeof y=="function"?void 0:y,{value:Re=[],loading:Qe}=ht(Y,"",Ce,Z),{filters:Et,setFilters:tt}=L(),yt=He=>{const{target:{value:lt}}=He;tt(ot=>{const{[ce]:Ht,...Ut}=ot;return lt?{...Ut,[ce]:lt}:Ut})};return(0,f.jsxs)(wt.Z,{disabled:Qe,className:K,variant:"filled",fullWidth:!0,"data-testid":"search-selectfilter-next",children:[pe?(0,f.jsx)(ge.Z,{className:q.label,margin:"dense",children:pe}):null,(0,f.jsxs)(be.Z,{variant:"outlined",value:Et[ce]||"",onChange:yt,children:[(0,f.jsx)(Fe.Z,{value:"",children:(0,f.jsx)("em",{children:"All"})}),Re.map(He=>(0,f.jsx)(Fe.Z,{value:He,children:He},He))]})]})},Kt=X=>{const{component:K,...se}=X;return(0,f.jsx)(K,{...se})};Kt.Checkbox=X=>(0,f.jsx)(Kt,{...X,component:kt}),Kt.Select=X=>(0,f.jsx)(Kt,{...X,component:dn}),Kt.Autocomplete=X=>(0,f.jsx)(Kt,{...X,component:Ft});var un=r(48834).lW;const Mn=X=>un.from(X.toString(),"utf-8").toString("base64"),Bn=X=>X?Number(un.from(X,"base64").toString("utf-8")):0,xn=X=>{const{total:K=-1,cursor:se,hasNextPage:pe,onCursorChange:ce,limit:y=25,limitLabel:Z="Results per page:",limitText:q=({from:yt,to:He})=>K>0?`of ${K}`:`${yt}-${He}`,limitOptions:Y,onLimitChange:Ce,...Re}=X,Qe=useMemo(()=>Bn(se),[se]),Et=useCallback((yt,He)=>{ce==null||ce(Mn(He))},[ce]),tt=useCallback(yt=>{const He=yt.target.value;Ce==null||Ce(parseInt(He,10))},[Ce]);return _jsx(TablePagination,{...Re,component:"div",count:K,page:Qe,nextIconButtonProps:{...pe!==void 0&&{disabled:!pe}},onPageChange:Et,rowsPerPage:y,labelRowsPerPage:Z,labelDisplayedRows:q,rowsPerPageOptions:Y,onRowsPerPageChange:tt})},$n=X=>{const{pageLimit:K,setPageLimit:se,pageCursor:pe,setPageCursor:ce,fetchNextPage:y}=useSearch();return _jsx(xn,{...X,hasNextPage:!!y,limit:K,onLimitChange:se,cursor:pe,onCursorChange:ce})};var Dn=r(53974);const on=X=>{const{children:K}=X,se=useSearch(),{result:pe,...ce}=se;return K(pe,ce)},wn=X=>{const{query:K,children:se}=X,pe=useApi(searchApiRef),ce=useAsync(()=>{const{term:y="",types:Z=[],filters:q={},...Y}=K;return pe.query({...Y,term:y,types:Z,filters:q})},[K]);return se(ce,K)},zn=X=>{const{query:K,children:se}=X;return K?_jsx(wn,{query:K,children:se}):_jsx(on,{children:se})},ut=X=>{const{query:K,children:se,noResultsComponent:pe=_jsx(EmptyState,{missing:"data",title:"Sorry, no results were found"}),...ce}=X;return _jsx(zn,{query:K,children:({loading:y,error:Z,value:q})=>y?_jsx(Progress,{}):Z?_jsx(ResponseErrorPanel,{title:"Error encountered while fetching search results",error:Z}):q!=null&&q.results.length?isFunction(se)?se(q):_jsx(SearchResultListItemExtensions,{...ce,results:q.results,children:se}):pe})},_t=X=>_jsx(AnalyticsContext,{attributes:{pluginId:"search",extension:"SearchResult"},children:_jsx(ut,{...X})}),Wt=({result:X,highlight:K,icon:se,secondaryAction:pe,lineClamp:ce=5})=>X?_jsxs(_Fragment,{children:[se&&_jsx(ListItemIcon,{children:se}),_jsx(ListItemText,{primaryTypographyProps:{variant:"h6"},primary:_jsx(Link,{noTrack:!0,to:X.location,children:K!=null&&K.fields.title?_jsx(HighlightedSearchResultText,{text:(K==null?void 0:K.fields.title)||"",preTag:(K==null?void 0:K.preTag)||"",postTag:(K==null?void 0:K.postTag)||""}):X.title}),secondary:_jsx(Typography,{component:"span",style:{display:"-webkit-box",WebkitBoxOrient:"vertical",WebkitLineClamp:ce,overflow:"hidden"},color:"textSecondary",variant:"body2",children:K!=null&&K.fields.text?_jsx(HighlightedSearchResultText,{text:K.fields.text,preTag:K.preTag,postTag:K.postTag}):X.text})}),pe&&_jsx(Box,{alignItems:"flex-end",children:pe})]}):null,dt=X=>_jsx(AnalyticsContext,{attributes:{pluginId:"search",extension:"DefaultResultListItem"},children:_jsx(Wt,{...X})}),bn=X=>{const{error:K,loading:se,resultItems:pe,renderResultItem:ce=Y=>_jsx(DefaultResultListItem,{result:Y.document},Y.document.location),disableRenderingWithNoResults:y,noResultsComponent:Z=y?null:_jsx(EmptyState,{missing:"data",title:"Sorry, no results were found"}),...q}=X;return se?_jsx(Progress,{}):K?_jsx(ResponseErrorPanel,{title:"Error encountered while fetching search results",error:K}):pe!=null&&pe.length?_jsx(List,{...q,children:pe.map(ce)}):_jsx(_Fragment,{children:Z})},Vt=X=>{const{query:K,renderResultItem:se,children:pe,...ce}=X,y=useSearchResultListItemExtensions(pe);return _jsx(AnalyticsContext,{attributes:{pluginId:"search",extension:"SearchResultList"},children:_jsx(SearchResultState,{query:K,children:({loading:Z,error:q,value:Y})=>_jsx(bn,{...ce,error:q,loading:Z,resultItems:Y==null?void 0:Y.results,renderResultItem:se!=null?se:y})})})};var hn=r(19126);const jn=(0,d.Z)(X=>({listSubheader:{display:"flex",alignItems:"center"},listSubheaderName:{marginLeft:X.spacing(1),textTransform:"uppercase"},listSubheaderChip:{color:X.palette.text.secondary,margin:X.spacing(0,0,0,1.5)},listSubheaderFilter:{display:"flex",color:X.palette.text.secondary,margin:X.spacing(0,0,0,1.5)},listSubheaderLink:{marginLeft:"auto",display:"flex",alignItems:"center"},listSubheaderLinkIcon:{fontSize:"inherit",marginLeft:X.spacing(.5)}})),an=X=>{const K=jn(),{label:se,children:pe,...ce}=X;return _jsx(Chip,{...ce,className:K.listSubheaderFilter,variant:"outlined",label:_jsxs(_Fragment,{children:[se,": ",pe]})})},Yn=()=>null,je=(0,d.Z)(X=>({root:{fontSize:"inherit","&:focus":{outline:"none",background:X.palette.common.white},"&:not(:focus)":{cursor:"pointer",color:X.palette.primary.main,"&:hover":{textDecoration:"underline"}}}})),le=X=>{const K=je(),{label:se,value:pe="None",onChange:ce,onDelete:y}=X,Z=useCallback(q=>{ce(q.target.value)},[ce]);return _jsx(an,{label:se,onDelete:y,children:_jsx(Typography,{role:"textbox",component:"span",className:K.root,onChange:Z,contentEditable:!0,suppressContentEditableWarning:!0,children:pe})})},Oe=(0,d.Z)(X=>({root:{fontSize:"inherit","&:not(:focus)":{cursor:"pointer",color:X.palette.primary.main,"&:hover":{textDecoration:"underline"}},"&:focus":{outline:"none"},"&>div:first-child":{padding:0}}})),Ue=X=>{const K=Oe(),{label:se,value:pe="none",onChange:ce,onDelete:y,children:Z}=X,q=useCallback(Y=>{ce(Y.target.value)},[ce]);return _jsx(an,{label:se,onDelete:y,children:_jsxs(Select,{className:K.root,value:pe,onChange:q,input:_jsx(InputBase,{}),IconComponent:Yn,children:[_jsx(MenuItem,{value:"none",children:"None"}),Z]})})};function qe(X){const K=jn(),[se,pe]=useState(null),{error:ce,loading:y,icon:Z,title:q,titleProps:Y={},link:Ce=_jsxs(_Fragment,{children:["See all",_jsx(ArrowRightIcon,{className:K.listSubheaderLinkIcon})]}),linkProps:Re={},filterOptions:Qe,renderFilterOption:Et=At=>_jsx(MenuItem,{value:String(At),children:At},String(At)),filterFields:tt,renderFilterField:yt,resultItems:He,renderResultItem:lt=At=>_jsx(DefaultResultListItem,{result:At.document},At.document.location),disableRenderingWithNoResults:ot,noResultsComponent:Ht=ot?null:_jsx(EmptyState,{missing:"data",title:"Sorry, no results were found"}),...Ut}=X,Jt=useCallback(At=>{pe(At.currentTarget)},[]),en=useCallback(()=>{pe(null)},[]);if(y)return _jsx(Progress,{});if(ce)return _jsx(ResponseErrorPanel,{title:"Error encountered while fetching search results",error:ce});if(!(He!=null&&He.length))return _jsx(_Fragment,{children:Ht});var Dt;return _jsxs(List,{...Ut,children:[_jsxs(ListSubheader,{className:K.listSubheader,children:[Z,_jsx(Typography,{className:K.listSubheaderName,component:"strong",...Y,children:q}),Qe?_jsx(Chip,{className:K.listSubheaderChip,component:"button",icon:_jsx(AddIcon,{}),variant:"outlined",label:"Add filter","aria-controls":"filters-menu","aria-haspopup":"true",onClick:Jt}):null,Qe?_jsx(Menu,{id:"filters-menu",anchorEl:se,open:Boolean(se),onClose:en,onClick:en,keepMounted:!0,children:Qe.map(Et)}):null,tt==null?void 0:tt.map(At=>(Dt=yt==null?void 0:yt(At))!==null&&Dt!==void 0?Dt:null),_jsx(Link,{className:K.listSubheaderLink,to:"/search",...Re,children:Ce})]}),He.map(lt)]})}function _(X){const{query:K,children:se,renderResultItem:pe,linkProps:ce={},...y}=X,Z=useSearchResultListItemExtensions(se);return _jsx(AnalyticsContext,{attributes:{pluginId:"search",extension:"SearchResultGroup"},children:_jsx(SearchResultState,{query:K,children:({loading:q,error:Y,value:Ce},{term:Re,types:Qe,pageCursor:Et,filters:tt={}})=>{const yt=`/search?${qs.stringify({term:Re,types:Qe,filters:tt,pageCursor:Et,query:Re},{arrayFormat:"brackets"})}`;return _jsx(qe,{...y,error:Y,loading:q,linkProps:{to:yt,...ce},filterFields:Object.keys(tt),resultItems:Ce==null?void 0:Ce.results,renderResultItem:pe!=null?pe:Z})}})})}const N=(0,d.Z)(X=>({root:{display:"flex",justifyContent:"space-between",gap:X.spacing(2),margin:X.spacing(2,0)}})),ve=()=>{const{fetchNextPage:X,fetchPreviousPage:K}=useSearch(),se=N();return!X&&!K?_jsx(_Fragment,{}):_jsxs("nav",{"aria-label":"pagination navigation",className:se.root,children:[_jsx(Button,{"aria-label":"previous page",disabled:!K,onClick:K,startIcon:_jsx(ArrowBackIosIcon,{}),children:"Previous"}),_jsx(Button,{"aria-label":"next page",disabled:!X,onClick:X,endIcon:_jsx(ArrowForwardIosIcon,{}),children:"Next"})]})},$e="search.results.list.items.extensions.v1",et=(X,K)=>{for(const se of X){if(!isValidElement(se))continue;const pe=getComponentData(se,$e);if(pe!=null&&pe(K))return cloneElement(se,{rank:K.rank,highlight:K.highlight,result:K.document,...se.props})}return null},at=X=>{const{rank:K,result:se,noTrack:pe,children:ce,alignItems:y="flex-start",...Z}=X,q=(0,t.z$)(),Y=(0,W.useCallback)(()=>{pe||se&&q.captureEvent("discover",se.title,{attributes:{to:se.location},value:K})},[K,se,pe,q]);return(0,f.jsx)(g.Z,{divider:!0,alignItems:y,onClickCapture:Y,...Z,children:ce})},It=X=>{const{name:K,component:se,predicate:pe=()=>!0}=X;return(0,t.YO)({name:K,component:{lazy:()=>se().then(ce=>y=>(0,f.jsx)(at,{rank:y.rank,result:y.result,noTrack:y.noTrack,children:(0,W.createElement)(ce,y)}))},data:{[$e]:pe}})},Bt=X=>{const K=useElementFilter(X,se=>se.selectByComponentData({key:$e}).getElements(),[X]);return useCallback((se,pe)=>{const ce=et(K,se);return _jsx(Fragment,{children:ce!=null?ce:_jsx(at,{rank:se.rank,result:se.document,children:_jsx(DefaultResultListItem,{rank:se.rank,highlight:se.highlight,result:se.document})})},pe)},[K])},tn=X=>{const{results:K,children:se,...pe}=X,ce=Bt(se);return _jsx(List,{...pe,children:K.map(ce)})}},61886:function(Ct,Be,r){"use strict";r.d(Be,{Ox:function(){return nt},jM:function(){return W},Zz:function(){return g},oZ:function(){return z},DR:function(){return d},ZS:function(){return Pe},VA:function(){return pt},KY:function(){return ye},gT:function(){return C},Dl:function(){return oe},ux:function(){return St},$L:function(){return I},x1:function(){return We}});var t=r(52322),h=r(2784),H=r(73557),f=r(60871);const W="techdocs.addons.addon.v1",g="techdocs.addons.wrapper.v1",d=()=>null;(0,f.R5)(d,g,!0);const B=ge=>`${W}.${ge.toLocaleLowerCase("en-US")}`;function ye(ge){const{name:be,component:Fe}=ge;return(0,f.YO)({name:be,component:{sync:Je=>(0,t.jsx)(Fe,{...Je})},data:{[W]:ge,[B(be)]:!0}})}const ue=(ge,be)=>ge.selectByComponentData({key:be}).getElements()[0],V=ge=>ge.selectByComponentData({key:g}).selectByComponentData({key:W}),J=ge=>ge.selectByComponentData({key:g}).findComponentData({key:W}),I=()=>{const ge=(0,H.pC)(),be=(0,f.vJ)(ge,V),Fe=(0,f.vJ)(ge,J),Je=(0,h.useCallback)(ht=>{if(!be||!ht)return null;const Rt=B(ht.name);var Ft;return(Ft=ue(be,Rt))!==null&&Ft!==void 0?Ft:null},[be]),vt=(0,h.useCallback)(ht=>{const Rt=Fe.find(Ft=>Ft.name===ht);return Rt?Je(Rt):null},[Fe,Je]),Ot=(0,h.useCallback)(ht=>{const Rt=Fe.filter(Ft=>Ft.location===ht);return Rt.length?Rt.map(Je):null},[Fe,Je]);return{renderComponentByName:vt,renderComponentsByLocation:Ot}},C=(0,f.T0)({id:"plugin.techdocs.service"}),oe=(0,f.T0)({id:"plugin.techdocs.storageservice"});var ee=r(64279),ne=r(77446),$=r(25271),T=r(51837);function P(ge,be){return be.getOptionalBoolean("techdocs.legacyUseCaseSensitiveTripletPaths")||(ge.kind=ge.kind.toLocaleLowerCase(),ge.name=ge.name.toLocaleLowerCase(),ge.namespace=ge.namespace.toLocaleLowerCase()),ge}const L=(ge,be)=>(0,$.eE)(ge)===(0,$.eE)(be),O={title:"",subtitle:"",setTitle:()=>{},setSubtitle:()=>{},setShadowRoot:()=>{},metadata:{loading:!0},entityMetadata:{loading:!0},entityRef:{kind:"",name:"",namespace:""}},re=(0,T.CT)("techdocs-reader-page-context"),Pe=(0,h.memo)(ge=>{const{entityRef:be,children:Fe}=ge,Je=(0,f.h_)(C),vt=(0,f.h_)(f.Ds),Ot=(0,ee.default)(async()=>Je.getEntityMetadata(be),[be]),ht=(0,ne.Z)(async()=>Je.getTechDocsMetadata(be),[be]),[Rt,Ft]=(0,h.useState)(O.title),[Yt,kt]=(0,h.useState)(O.subtitle),[dn,Kt]=(0,h.useState)(O.shadowRoot);(0,h.useEffect)(()=>{dn&&!ht.value&&!ht.loading&&ht.retry()},[ht.value,ht.loading,dn,ht.retry,ht]);const un={metadata:ht,entityRef:P(be,vt),entityMetadata:Ot,shadowRoot:dn,setShadowRoot:Kt,title:Rt,setTitle:Ft,subtitle:Yt,setSubtitle:kt},Mn=(0,T.EI)({1:un});return(0,t.jsx)(f.fC,{attributes:{entityRef:(0,$.eE)(be)},children:(0,t.jsx)(re.Provider,{value:Mn,children:Fe instanceof Function?Fe(un):Fe})})},(ge,be)=>L(ge.entityRef,be.entityRef)),We=()=>{const ge=(0,h.useContext)(re);if(ge===void 0)return O;const be=ge.atVersion(1);if(be===void 0)throw new Error("No context found for version 1.");return be},z=Object.freeze({Header:"Header",Subheader:"Subheader",Settings:"Settings",PrimarySidebar:"PrimarySidebar",SecondarySidebar:"SecondarySidebar",Content:"Content"});var xt=r(70882),st=r(50236),Ke=r(19219),it=r(53974);const nt="TECH_DOCS_SHADOW_DOM_STYLE_LOAD",bt=ge=>{(0,h.useEffect)(()=>{if(!ge)return()=>{};const be=ge.querySelectorAll('head > link[rel="stylesheet"]');var Fe;let Je=(Fe=be==null?void 0:be.length)!==null&&Fe!==void 0?Fe:0;const vt=new CustomEvent(nt);if(!Je)return ge.dispatchEvent(vt),()=>{};const Ot=()=>{--Je===0&&ge.dispatchEvent(vt)};return be==null||be.forEach(ht=>{ht.addEventListener("load",Ot)}),()=>{be==null||be.forEach(ht=>{ht.removeEventListener("load",Ot)})}},[ge])},St=ge=>{const[be,Fe]=(0,h.useState)(!1);return(0,h.useEffect)(()=>{if(!ge)return()=>{};Fe(!0);const Je=ge.style;Je.setProperty("opacity","0");const vt=()=>{Fe(!1),Je.setProperty("opacity","1")};return ge.addEventListener(nt,vt),()=>{ge.removeEventListener(nt,vt)}},[ge]),be},pt=ge=>{const{element:be,onAppend:Fe,children:Je}=ge,[vt,Ot]=(0,h.useState)((0,xt.Ue)({...(0,st.Z)(),insertionPoint:void 0}));bt(be);const ht=St(be),Rt=(0,h.useCallback)(Ft=>{if(!be||!Ft)return;Ot((0,xt.Ue)({...(0,st.Z)(),insertionPoint:be.querySelector("head")||void 0}));let Yt=Ft.shadowRoot;Yt||(Yt=Ft.attachShadow({mode:"open"})),Yt.replaceChildren(be),typeof Fe=="function"&&Fe(Yt)},[be,Fe]);return(0,t.jsxs)(t.Fragment,{children:[ht&&(0,t.jsx)(it.Ex,{}),(0,t.jsxs)(Ke.ZP,{jss:vt,sheetsManager:new Map,children:[(0,t.jsx)("div",{ref:Rt,"data-testid":"techdocs-native-shadowroot"}),Je]})]})};var ft=r(54073);const wt=()=>{const{shadowRoot:ge}=useTechDocsReaderPage();return ge},$t=ge=>{const be=wt();return be?ge.map(Fe=>be==null?void 0:be.querySelectorAll(Fe)).filter(Fe=>Fe.length).map(Fe=>Array.from(Fe)).flat():[]},Ve=ge=>ge.toString()&&ge.rangeCount&&ge.getRangeAt(0).getBoundingClientRect().top,qt=(ge=0)=>{const be=wt(),[Fe,Je]=useState(null),vt=useMemo(()=>debounce(()=>{const Ot=be,ht=Ot.getSelection?Ot.getSelection():document.getSelection();ht&&Ve(ht)?Je(ht):Je(null)},ge),[be,Je,ge]);return useEffect(()=>(window.document.addEventListener("selectionchange",vt),()=>{vt.cancel(),window.document.removeEventListener("selectionchange",vt)}),[vt]),Fe}},52943:function(Ct,Be,r){"use strict";r.r(Be),r.d(Be,{EmbeddedDocsRouter:function(){return ee},Router:function(){return oe},isTechDocsAvailable:function(){return C}});var t=r(52322),h=r(2784),H=r(73557),f=r(40303),W=r(53974),g=r(25271),d=r(89258),B=r(65124),ye=r(86317);const ue=({entity:ne})=>{const $=(0,g.iB)(ne);return(0,t.jsxs)(d.I6,{entityRef:$,children:[(0,t.jsx)(B.b,{}),(0,t.jsx)(ye.F,{withSearch:!1})]})};var V=r(18662),J=r(7476);const I="backstage.io/techdocs-ref",C=ne=>{var $,T;return Boolean(ne==null||($=ne.metadata)===null||$===void 0||(T=$.annotations)===null||T===void 0?void 0:T[I])},oe=()=>(0,t.jsxs)(H.Z5,{children:[(0,t.jsx)(H.AW,{path:"/",element:(0,t.jsx)(V.TechDocsIndexPage,{})}),(0,t.jsx)(H.AW,{path:"/:namespace/:kind/:name/*",element:(0,t.jsx)(J.TechDocsReaderPage,{})})]}),ee=ne=>{var $;const{children:T}=ne,{entity:P}=(0,f.X2)(),L=(0,H.V$)([{path:"/*",element:(0,t.jsx)(ue,{entity:P}),children:[{path:"*",element:T}]}]);return(($=P.metadata.annotations)===null||$===void 0?void 0:$[I])?L:(0,t.jsx)(W.sk,{annotation:I})}},92077:function(Ct,Be,r){"use strict";r.d(Be,{k:function(){return g},p:function(){return W}});var t=r(87612),h=r(23054),H=r(76372),f=r.n(H);class W{async getApiOrigin(){return await this.discoveryApi.getBaseUrl("techdocs")}async getTechDocsMetadata(B){const{kind:ye,namespace:ue,name:V}=B,I=`${await this.getApiOrigin()}/metadata/techdocs/${ue}/${ye}/${V}`,C=await this.fetchApi.fetch(`${I}`);if(!C.ok)throw await h.VL.fromResponse(C);return await C.json()}async getEntityMetadata(B){const{kind:ye,namespace:ue,name:V}=B,I=`${await this.getApiOrigin()}/metadata/entity/${ue}/${ye}/${V}`,C=await this.fetchApi.fetch(`${I}`);if(!C.ok)throw await h.VL.fromResponse(C);return await C.json()}constructor(B){(0,t._)(this,"configApi",void 0),(0,t._)(this,"discoveryApi",void 0),(0,t._)(this,"fetchApi",void 0),this.configApi=B.configApi,this.discoveryApi=B.discoveryApi,this.fetchApi=B.fetchApi}}class g{async getApiOrigin(){return await this.discoveryApi.getBaseUrl("techdocs")}async getStorageUrl(){var B;return(B=this.configApi.getOptionalString("techdocs.storageUrl"))!==null&&B!==void 0?B:`${await this.discoveryApi.getBaseUrl("techdocs")}/static/docs`}async getBuilder(){return this.configApi.getString("techdocs.builder")}async getEntityDocs(B,ye){const{kind:ue,namespace:V,name:J}=B,C=`${await this.getStorageUrl()}/${V}/${ue}/${J}/${ye}`,oe=await this.fetchApi.fetch(`${C.endsWith("/")?C:`${C}/`}index.html`);let ee="";switch(oe.status){case 404:throw ee="Page not found. ",ye||(ee+="This could be because there is no index.md file in the root of the docs directory of this repository."),new h.dR(ee);case 500:throw ee="Could not generate documentation or an error in the TechDocs backend. ",new Error(ee);default:break}return oe.text()}async syncEntityDocs(B,ye=()=>{}){const{kind:ue,namespace:V,name:J}=B,C=`${await this.getApiOrigin()}/sync/${V}/${ue}/${J}`,{token:oe}=await this.identityApi.getCredentials();return new Promise((ee,ne)=>{const $=new H.EventSourcePolyfill(C,{withCredentials:!0,headers:oe?{Authorization:`Bearer ${oe}`}:{}});$.addEventListener("log",T=>{T.data&&ye(JSON.parse(T.data))}),$.addEventListener("finish",T=>{let P=!1;T.data&&({updated:P}=JSON.parse(T.data)),ee(P?"updated":"cached")}),$.onerror=T=>{switch($.close(),T.status){case 404:ne(new h.dR(T.message));return;default:ne(new Error(T.data));return}}})}async getBaseUrl(B,ye,ue){const{kind:V,namespace:J,name:I}=ye,oe=`${await this.getApiOrigin()}/static/docs/${J}/${V}/${I}/${ue}`;return new URL(B,oe.endsWith("/")?oe:`${oe}/`).toString()}constructor(B){(0,t._)(this,"configApi",void 0),(0,t._)(this,"discoveryApi",void 0),(0,t._)(this,"identityApi",void 0),(0,t._)(this,"fetchApi",void 0),this.configApi=B.configApi,this.discoveryApi=B.discoveryApi,this.identityApi=B.identityApi,this.fetchApi=B.fetchApi}}},51953:function(Ct,Be,r){"use strict";r.d(Be,{D:function(){return t}});function t(h,H){return H.getOptionalBoolean("techdocs.legacyUseCaseSensitiveTripletPaths")?h:h.toLocaleLowerCase("en-US")}},3482:function(Ct,Be,r){"use strict";r.d(Be,{u:function(){return B}});var t=r(52322),h=r(2784),H=r(53974),f=r(40303),W=r(42081),g=r(48431),d=r(68435);const B=ye=>{const{initialFilter:ue="owned",columns:V,actions:J}=ye;return(0,t.jsx)(W.j,{children:(0,t.jsxs)(H.VY,{children:[(0,t.jsx)(H.yW,{title:"",children:(0,t.jsx)(H.qt,{children:"Discover documentation in your ecosystem."})}),(0,t.jsx)(f.UO,{children:(0,t.jsxs)(f._i,{children:[(0,t.jsxs)(f._i.Filters,{children:[(0,t.jsx)(g.f,{}),(0,t.jsx)(f.EW,{initialFilter:ue}),(0,t.jsx)(f.dq,{}),(0,t.jsx)(f.xE,{})]}),(0,t.jsx)(f._i.Content,{children:(0,t.jsx)(d.n,{actions:J,columns:V})})]})})]})})}},85478:function(Ct,Be,r){"use strict";r.d(Be,{f:function(){return V}});var t=r(52322),h=r(95573),H=r(51953),f=r(60871),W=r(53974),g=r(94339),d=r(16111),B=r(24579),ye=r(14503),ue=r(2784);const V=ee=>{const{entities:ne}=ee,$=(0,f.tg)(h.Fw),T=(0,f.h_)(f.Ds);if(!ne)return null;var P,L;return(0,t.jsx)(W.Oh,{"data-testid":"docs-explore",children:ne!=null&&ne.length?ne.map((O,re)=>(0,t.jsxs)(g.Z,{children:[(0,t.jsx)(d.Z,{children:(0,t.jsx)(W.hu,{title:(P=O.metadata.title)!==null&&P!==void 0?P:O.metadata.name})}),(0,t.jsx)(B.Z,{children:O.metadata.description}),(0,t.jsx)(ye.Z,{children:(0,t.jsx)(W.Qj,{to:$({namespace:(0,H.D)((L=O.metadata.namespace)!==null&&L!==void 0?L:"default",T),kind:(0,H.D)(O.kind,T),name:(0,H.D)(O.metadata.name,T)}),color:"primary","data-testid":"read_docs",children:"Read Docs"})})]},re)):null})};var J=r(40303);const I={title:"All Documentation",filterPredicate:()=>!0},C=ee=>{const{entities:ne,group:$}=ee,{loading:T,isOwnedEntity:P}=useEntityOwnership(),L=ne.filter(re=>$.filterPredicate==="ownedByUser"?T?!1:P(re):typeof $.filterPredicate=="function"&&$.filterPredicate(re)),O=(()=>typeof $.title=="string"?_jsx(ContentHeader,{title:$.title}):$.title)();return L.length===0?null:_jsxs(Content,{children:[O,_jsx(DocsCardGrid,{entities:L})]})},oe=ee=>{const{loading:ne,error:$,entities:T}=useEntityList();if($)return _jsx(WarningPanel,{severity:"error",title:"Could not load available documentation.",children:_jsx(CodeSnippet,{language:"text",text:$.toString()})});if(ne)return _jsx(Progress,{});if(T.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 P,L;return T.sort((O,re)=>((P=O.metadata.title)!==null&&P!==void 0?P:O.metadata.name).localeCompare((L=re.metadata.title)!==null&&L!==void 0?L:re.metadata.name)),_jsx(Content,{children:(ee.groups||[I]).map((O,re)=>_jsx(C,{entities:T,group:O},`${O.title}-${re}`))})}},68435:function(Ct,Be,r){"use strict";r.d(Be,{H:function(){return T},n:function(){return P}});var t=r(52322),h=r(2784),H=r(95074),f=r(76635),W=r(53974),g=r(40303),d=r(60871),B=r(25271),ye=r(95573),ue=r(39981),V=r(2337),J=r(11640),I=r(28347);const C=(0,V.Z)({root:{color:"#f3ba37"}})(J.Z),oe={createCopyDocsUrlAction(L){return O=>({icon:()=>(0,t.jsx)(ue.Z,{fontSize:"small"}),tooltip:"Click to copy documentation link to clipboard",onClick:()=>L(`${window.location.origin}${O.resolved.docsUrl}`)})},createStarEntityAction(L,O){return re=>{const Pe=re.entity,We=L(Pe);return{cellStyle:{paddingLeft:"1em"},icon:()=>We?(0,t.jsx)(C,{}):(0,t.jsx)(I.Z,{}),tooltip:We?"Remove from favorites":"Add to favorites",onClick:()=>O(Pe)}}}};function ee(L){return L.metadata.title||L.metadata.name}const ne={createNameColumn(){return{title:"Document",field:"entity.metadata.name",highlight:!0,render:L=>(0,t.jsx)(W.uw,{value:(0,t.jsx)(W.rU,{to:L.resolved.docsUrl,children:ee(L.entity)}),subvalue:L.entity.metadata.description})}},createOwnerColumn(){return{title:"Owner",field:"resolved.ownedByRelationsTitle",render:({resolved:L})=>(0,t.jsx)(g.rI,{entityRefs:L.ownedByRelations,defaultKind:"group"})}},createTypeColumn(){return{title:"Type",field:"entity.spec.type"}}};var $=r(51953);const T=L=>{const{entities:O,title:re,loading:Pe,columns:We,actions:z,options:xt}=L,[,st]=(0,H.Z)(),Ke=(0,d.tg)(ye.Fw),it=(0,d.h_)(d.Ds);if(!O)return null;const nt=O.map(pt=>{const ft=(0,g.hF)(pt,B.S4);var wt;return{entity:pt,resolved:{docsUrl:Ke({namespace:(0,$.D)((wt=pt.metadata.namespace)!==null&&wt!==void 0?wt:"default",it),kind:(0,$.D)(pt.kind,it),name:(0,$.D)(pt.metadata.name,it)}),ownedByRelations:ft,ownedByRelationsTitle:ft.map($t=>(0,g.$3)($t,{defaultKind:"group"})).join(", ")}}}),bt=[ne.createNameColumn(),ne.createOwnerColumn(),ne.createTypeColumn()],St=[oe.createCopyDocsUrlAction(st)];return(0,t.jsx)(t.Fragment,{children:Pe||nt&&nt.length>0?(0,t.jsx)(W.iA,{isLoading:Pe,options:{paging:!0,pageSize:20,search:!0,actionsColumnIndex:-1,...xt},data:nt,columns:We||bt,actions:z||St,title:re?`${re} (${nt.length})`:`All (${nt.length})`}):(0,t.jsx)(W.ub,{missing:"data",title:"No documents to show",description:"Create your own document. Check out our Getting Started Information",action:(0,t.jsx)(W.Qj,{color:"primary",to:"https://backstage.io/docs/features/techdocs/getting-started",variant:"contained",children:"DOCS"})})})};T.columns=ne,T.actions=oe;const P=L=>{var O;const{columns:re,actions:Pe,options:We}=L,{loading:z,error:xt,entities:st,filters:Ke}=(0,g.wp)(),{isStarredEntity:it,toggleStarredEntity:nt}=(0,g.CR)(),[,bt]=(0,H.Z)();var St;const pt=(0,f.capitalize)((St=(O=Ke.user)===null||O===void 0?void 0:O.value)!==null&&St!==void 0?St:"all"),ft=[oe.createCopyDocsUrlAction(bt),oe.createStarEntityAction(it,nt)];return xt?(0,t.jsx)(W.GB,{severity:"error",title:"Could not load available documentation.",children:(0,t.jsx)(W.Oi,{language:"text",text:xt.toString()})}):(0,t.jsx)(T,{title:pt,entities:st,loading:z,actions:Pe||ft,columns:re,options:We})};P.columns=ne,P.actions=oe},18662:function(Ct,Be,r){"use strict";r.r(Be),r.d(Be,{TechDocsIndexPage:function(){return W}});var t=r(52322),h=r(2784),H=r(73557),f=r(3482);const W=g=>(0,H.pC)()||(0,t.jsx)(f.u,{...g})},42081:function(Ct,Be,r){"use strict";r.d(Be,{j:function(){return W}});var t=r(52322),h=r(2784),H=r(53974),f=r(60871);const W=g=>{const{children:d}=g,B=(0,f.h_)(f.Ds);var ye;const ue=`Documentation available in ${(ye=B.getOptionalString("organization.name"))!==null&&ye!==void 0?ye:"Backstage"}`;return(0,t.jsx)(H.g9,{title:"Documentation",subtitle:ue,themeId:"documentation",children:d})}},48431:function(Ct,Be,r){"use strict";r.d(Be,{f:function(){return f}});var t=r(2784),h=r(40303);class H{getCatalogFilters(){return{"metadata.annotations.backstage.io/techdocs-ref":h.n3}}}const f=()=>{const{updateFilters:W}=(0,h.wp)();return(0,t.useEffect)(()=>{W({techdocs:new H})},[W]),null}},89258:function(Ct,Be,r){"use strict";r.d(Be,{I6:function(){return V},Jl:function(){return ue},s4:function(){return g}});var t=r(61886),h=r(92077),H=r(95573),f=r(60871),W=r(15096);const g=(0,f.rx)({id:"techdocs",apis:[(0,f.ni)({api:t.Dl,deps:{configApi:f.Ds,discoveryApi:f.NW,identityApi:f.$4,fetchApi:f.gP},factory:({configApi:I,discoveryApi:C,identityApi:oe,fetchApi:ee})=>new h.k({configApi:I,discoveryApi:C,identityApi:oe,fetchApi:ee})}),(0,f.ni)({api:t.gT,deps:{configApi:f.Ds,discoveryApi:f.NW,fetchApi:f.gP},factory:({configApi:I,discoveryApi:C,fetchApi:oe})=>new h.p({configApi:I,discoveryApi:C,fetchApi:oe})})],routes:{root:H._Z,docRoot:H.Fw,entityContent:H.pd}}),d=g.provide((0,f.P4)({name:"TechdocsPage",component:()=>Promise.resolve().then(r.bind(r,52943)).then(I=>I.Router),mountPoint:H._Z})),B=g.provide((0,f.P4)({name:"EntityTechdocsContent",component:()=>Promise.resolve().then(r.bind(r,52943)).then(I=>I.EmbeddedDocsRouter),mountPoint:H.pd})),ye=g.provide((0,f.P4)({name:"TechDocsCustomHome",component:()=>r.e(7560).then(r.bind(r,27560)).then(I=>I.TechDocsCustomHome),mountPoint:H._Z})),ue=g.provide((0,f.P4)({name:"TechDocsIndexPage",component:()=>Promise.resolve().then(r.bind(r,18662)).then(I=>I.TechDocsIndexPage),mountPoint:H._Z})),V=g.provide((0,f.P4)({name:"TechDocsReaderPage",component:()=>Promise.resolve().then(r.bind(r,7476)).then(I=>I.TechDocsReaderPage),mountPoint:H.Fw})),J=g.provide((0,W.E5)({name:"TechDocsSearchResultListItem",component:()=>Promise.resolve().then(r.bind(r,55511)).then(I=>I.TechDocsSearchResultListItem),predicate:I=>I.type==="techdocs"}))},7476:function(Ct,Be,r){"use strict";r.r(Be),r.d(Be,{TechDocsReaderLayout:function(){return V},TechDocsReaderPage:function(){return J}});var t=r(52322),h=r(2784),H=r(73557),f=r(53974),W=r(61886),g=r(86317),d=r(93225),B=r(65124),ye=r(95573),ue=r(60871);const V=I=>{const{withSearch:C,withHeader:oe=!0}=I;return(0,t.jsxs)(f.T3,{themeId:"documentation",children:[oe&&(0,t.jsx)(d.S,{}),(0,t.jsx)(B.b,{}),(0,t.jsx)(g.F,{withSearch:C})]})},J=I=>{const{kind:C,name:oe,namespace:ee}=(0,ue.Oi)(ye.Fw),{children:ne,entityRef:$={kind:C,name:oe,namespace:ee}}=I,T=(0,H.pC)();if(!ne){const L=T?h.Children.toArray(T.props.children):[];var P;const re=L.flatMap(Pe=>{var We;return(P=Pe==null||(We=Pe.props)===null||We===void 0?void 0:We.children)!==null&&P!==void 0?P:[]}).find(Pe=>!(0,ue.IY)(Pe,W.Zz)&&!(0,ue.IY)(Pe,W.jM));return(0,t.jsx)(W.ZS,{entityRef:$,children:re||(0,t.jsx)(V,{})})}return(0,t.jsx)(W.ZS,{entityRef:$,children:({metadata:L,entityMetadata:O,onReady:re})=>(0,t.jsx)("div",{className:"techdocs-reader-page",children:(0,t.jsx)(f.T3,{themeId:"documentation",children:ne instanceof Function?ne({entityRef:$,techdocsMetadataValue:L.value,entityMetadataValue:O.value,onReady:re}):ne})})})}},86317:function(Ct,Be,r){"use strict";r.d(Be,{F:function(){return pe}});var t=r(52322),h=r(2784),H=r(79692),f=r(60905),W=r(61886),g=r(53974),d=r(22478),B=r(4614),ye=r(77277),ue=r(99688),V=r(12420),J=r(90436),I=r(61837),C=r(4190),oe=r(87685);const ee=(0,H.Z)(y=>(0,V.Z)({paper:{width:"100%",[y.breakpoints.up("sm")]:{width:"75%"},[y.breakpoints.up("md")]:{width:"50%"},padding:y.spacing(2.5)},root:{height:"100%",overflow:"hidden"},logs:{background:y.palette.background.default}})),ne=({buildLog:y,onClose:Z})=>{const q=ee(),Y=y.length===0?"Waiting for logs...":y.join(`
|
|
37
|
+
`);return(0,t.jsxs)(f.Z,{container:!0,direction:"column",className:q.root,spacing:0,wrap:"nowrap",children:[(0,t.jsxs)(f.Z,{item:!0,container:!0,justifyContent:"space-between",alignItems:"center",spacing:0,wrap:"nowrap",children:[(0,t.jsx)(J.Z,{variant:"h5",children:"Build Details"}),(0,t.jsx)(I.Z,{title:"Close the drawer",onClick:Z,color:"inherit",children:(0,t.jsx)(oe.Z,{})},"dismiss")]}),(0,t.jsx)(f.Z,{item:!0,xs:!0,children:(0,t.jsx)(g.nU,{text:Y,classes:{root:q.logs}})})]})},$=({buildLog:y})=>{const Z=ee(),[q,Y]=(0,h.useState)(!1);return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(ye.Z,{color:"inherit",onClick:()=>Y(!0),children:"Show Build Logs"}),(0,t.jsx)(C.ZP,{classes:{paper:Z.paper},anchor:"right",open:q,onClose:()=>Y(!1),children:(0,t.jsx)(ne,{buildLog:y,onClose:()=>Y(!1)})})]})};var T=r(60871);const P=({errorMessage:y})=>{const Z=(0,T.h_)(T.Ds).getOptionalString("techdocs.builder");let q="";return Z!=="local"&&(q="Note that techdocs.builder is not set to 'local' in your config, which means this Backstage app will not generate docs if they are not found. Make sure the project's docs are generated and published by some external process (e.g. CI/CD pipeline). Or change techdocs.builder to 'local' to generate docs from this Backstage instance."),(0,t.jsx)(g.mf,{status:"404",statusMessage:y||"Documentation not found",additionalInfo:q})};var L=r(95481);const O=(0,H.Z)(y=>({root:{marginBottom:y.spacing(2)},message:{wordBreak:"break-word",overflowWrap:"anywhere"}})),re=()=>{let y=null;const Z=O(),{state:q,contentReload:Y,contentErrorMessage:Ce,syncErrorMessage:Re,buildLog:Qe}=(0,L.DK)();return q==="INITIAL_BUILD"&&(y=(0,t.jsx)(ue.Z,{classes:{root:Z.root},variant:"outlined",severity:"info",icon:(0,t.jsx)(B.Z,{size:"24px"}),action:(0,t.jsx)($,{buildLog:Qe}),children:"Documentation is accessed for the first time and is being prepared. The subsequent loads are much faster."})),q==="CONTENT_STALE_REFRESHING"&&(y=(0,t.jsx)(ue.Z,{variant:"outlined",severity:"info",icon:(0,t.jsx)(B.Z,{size:"24px"}),action:(0,t.jsx)($,{buildLog:Qe}),classes:{root:Z.root},children:"A newer version of this documentation is being prepared and will be available shortly."})),q==="CONTENT_STALE_READY"&&(y=(0,t.jsx)(ue.Z,{variant:"outlined",severity:"success",action:(0,t.jsx)(ye.Z,{color:"inherit",onClick:()=>Y(),children:"Refresh"}),classes:{root:Z.root},children:"A newer version of this documentation is now available, please refresh to view."})),q==="CONTENT_STALE_ERROR"&&(y=(0,t.jsxs)(ue.Z,{variant:"outlined",severity:"error",action:(0,t.jsx)($,{buildLog:Qe}),classes:{root:Z.root,message:Z.message},children:["Building a newer version of this documentation failed."," ",Re]})),q==="CONTENT_NOT_FOUND"&&(y=(0,t.jsxs)(t.Fragment,{children:[Re&&(0,t.jsxs)(ue.Z,{variant:"outlined",severity:"error",action:(0,t.jsx)($,{buildLog:Qe}),classes:{root:Z.root,message:Z.message},children:["Building a newer version of this documentation failed."," ",Re]}),(0,t.jsx)(P,{errorMessage:Ce})]})),y};var Pe=r(60364),We=r(41156),z=r(32838),xt=r(35368),st=r.n(xt);const Ke=/main\.[A-Fa-f0-9]{8}\.min\.css$/,it=/^https:\/\/fonts\.googleapis\.com/,nt=/^https:\/\/fonts\.gstatic\.com/,bt=y=>y.nodeName==="LINK",St=y=>{const Z=(y==null?void 0:y.getAttribute("href"))||"",q=Z.match(Ke),Y=Z.match(it),Ce=Z.match(nt);return q||Y||Ce},pt=y=>(bt(y)&&!St(y)&&y.remove(),y),ft=y=>y.nodeName==="IFRAME",wt=(y,Z)=>{const q=y.getAttribute("src")||"";try{const{host:Y}=new URL(q);return Z.includes(Y)}catch{return!1}},$t=y=>Z=>(ft(Z)&&!wt(Z,y)&&Z.remove(),Z),Ve=()=>{const y=(0,T.h_)(T.Ds);return(0,h.useMemo)(()=>y.getOptionalConfig("techdocs.sanitizer"),[y])},qt=()=>{const y=Ve();return(0,h.useCallback)(async Z=>{const q=y==null?void 0:y.getOptionalStringArray("allowedIframeHosts");st().addHook("beforeSanitizeElements",pt);const Y=["link"];return q&&(Y.push("iframe"),st().addHook("beforeSanitizeElements",$t(q))),st().sanitize(Z.outerHTML,{ADD_TAGS:Y,FORBID_TAGS:["style"],WHOLE_DOCUMENT:!0,RETURN_DOM:!0})},[y])};var ge=r(41128),be=({theme:y})=>`
|
|
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: ${y.palette.text.primary};
|
|
47
|
+
--md-default-fg-color--light: ${y.palette.text.secondary};
|
|
48
|
+
--md-default-fg-color--lighter: ${(0,ge.$n)(y.palette.text.secondary,.7)};
|
|
49
|
+
--md-default-fg-color--lightest: ${(0,ge.$n)(y.palette.text.secondary,.3)};
|
|
50
|
+
|
|
51
|
+
/* BACKGROUND */
|
|
52
|
+
--md-default-bg-color:${y.palette.background.default};
|
|
53
|
+
--md-default-bg-color--light: ${y.palette.background.paper};
|
|
54
|
+
--md-default-bg-color--lighter: ${(0,ge.$n)(y.palette.background.paper,.7)};
|
|
55
|
+
--md-default-bg-color--lightest: ${(0,ge.$n)(y.palette.background.paper,.3)};
|
|
56
|
+
|
|
57
|
+
/* PRIMARY */
|
|
58
|
+
--md-primary-fg-color: ${y.palette.primary.main};
|
|
59
|
+
--md-primary-fg-color--light: ${y.palette.primary.light};
|
|
60
|
+
--md-primary-fg-color--dark: ${y.palette.primary.dark};
|
|
61
|
+
--md-primary-bg-color: ${y.palette.primary.contrastText};
|
|
62
|
+
--md-primary-bg-color--light: ${(0,ge.$n)(y.palette.primary.contrastText,.7)};
|
|
63
|
+
|
|
64
|
+
/* ACCENT */
|
|
65
|
+
--md-accent-fg-color: var(--md-primary-fg-color);
|
|
66
|
+
|
|
67
|
+
/* SHADOW */
|
|
68
|
+
--md-shadow-z1: ${y.shadows[1]};
|
|
69
|
+
--md-shadow-z2: ${y.shadows[2]};
|
|
70
|
+
--md-shadow-z3: ${y.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: ${y.palette.text.primary};
|
|
107
|
+
--md-code-bg-color: ${y.palette.background.paper};
|
|
108
|
+
--md-code-hl-color: ${(0,ge.Fq)(y.palette.warning.main,.5)};
|
|
109
|
+
--md-code-hl-keyword-color: ${y.palette.type==="dark"?y.palette.primary.light:y.palette.primary.dark};
|
|
110
|
+
--md-code-hl-function-color: ${y.palette.type==="dark"?y.palette.secondary.light:y.palette.secondary.dark};
|
|
111
|
+
--md-code-hl-string-color: ${y.palette.type==="dark"?y.palette.success.light:y.palette.success.dark};
|
|
112
|
+
--md-code-hl-number-color: ${y.palette.type==="dark"?y.palette.error.light:y.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: ${y.palette.link};
|
|
126
|
+
--md-typeset-table-color: ${y.palette.text.primary};
|
|
127
|
+
--md-typeset-del-color: ${y.palette.type==="dark"?(0,ge.Fq)(y.palette.error.dark,.5):(0,ge.Fq)(y.palette.error.light,.5)};
|
|
128
|
+
--md-typeset-ins-color: ${y.palette.type==="dark"?(0,ge.Fq)(y.palette.success.dark,.5):(0,ge.Fq)(y.palette.success.light,.5)};
|
|
129
|
+
--md-typeset-mark-color: ${y.palette.type==="dark"?(0,ge.Fq)(y.palette.warning.dark,.5):(0,ge.Fq)(y.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
|
+
`,Fe=({theme:y})=>`
|
|
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: ${y.typography.fontFamily};
|
|
152
|
+
font-family: var(--md-text-font-family);
|
|
153
|
+
background-color: unset;
|
|
154
|
+
}
|
|
155
|
+
`;const Je="224px";var vt=({theme:y,sidebar:Z})=>`
|
|
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:${y.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: ${y.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: ${Z.isPinned?`calc(-12.1rem + ${Je})`:"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
|
+
`;const Ot=["h1","h2","h3","h4","h5","h6"];var ht=({theme:y})=>`
|
|
361
|
+
/*================== Typeset ==================*/
|
|
362
|
+
|
|
363
|
+
.md-typeset {
|
|
364
|
+
font-size: var(--md-typeset-font-size);
|
|
365
|
+
}
|
|
366
|
+
|
|
367
|
+
${Ot.reduce((Z,q)=>{var Y;const Ce=(Y=y.typography.htmlFontSize)!==null&&Y!==void 0?Y:16,Re=y.typography[q],{lineHeight:Qe,fontFamily:Et,fontWeight:tt,fontSize:yt}=Re,He=lt=>{let ot=1;return typeof lt=="number"&&(ot=lt/Ce*.6),typeof lt=="string"&&(ot=lt.replace("rem","")),`calc(${ot} * var(--md-typeset-font-size))`};return Z.concat(`
|
|
368
|
+
.md-typeset ${q} {
|
|
369
|
+
color: var(--md-default-fg-color);
|
|
370
|
+
line-height: ${Qe};
|
|
371
|
+
font-family: ${Et};
|
|
372
|
+
font-weight: ${tt};
|
|
373
|
+
font-size: ${He(yt)};
|
|
374
|
+
}
|
|
375
|
+
`)},"")}
|
|
376
|
+
|
|
377
|
+
.md-typeset .md-content__button {
|
|
378
|
+
color: var(--md-default-fg-color);
|
|
379
|
+
}
|
|
380
|
+
|
|
381
|
+
.md-typeset hr {
|
|
382
|
+
border-bottom: 0.05rem dotted ${y.palette.divider};
|
|
383
|
+
}
|
|
384
|
+
|
|
385
|
+
.md-typeset details {
|
|
386
|
+
font-size: var(--md-typeset-font-size) !important;
|
|
387
|
+
}
|
|
388
|
+
.md-typeset details summary {
|
|
389
|
+
padding-left: 2.5rem !important;
|
|
390
|
+
}
|
|
391
|
+
.md-typeset details summary:before,
|
|
392
|
+
.md-typeset details summary:after {
|
|
393
|
+
top: 50% !important;
|
|
394
|
+
width: 20px !important;
|
|
395
|
+
height: 20px !important;
|
|
396
|
+
transform: rotate(0deg) translateY(-50%) !important;
|
|
397
|
+
}
|
|
398
|
+
.md-typeset details[open] > summary:after {
|
|
399
|
+
transform: rotate(90deg) translateX(-50%) !important;
|
|
400
|
+
}
|
|
401
|
+
|
|
402
|
+
.md-typeset blockquote {
|
|
403
|
+
color: var(--md-default-fg-color--light);
|
|
404
|
+
border-left: 0.2rem solid var(--md-default-fg-color--light);
|
|
405
|
+
}
|
|
406
|
+
|
|
407
|
+
.md-typeset table:not([class]) {
|
|
408
|
+
font-size: var(--md-typeset-font-size);
|
|
409
|
+
border: 1px solid var(--md-default-fg-color);
|
|
410
|
+
border-bottom: none;
|
|
411
|
+
border-collapse: collapse;
|
|
412
|
+
}
|
|
413
|
+
.md-typeset table:not([class]) th {
|
|
414
|
+
font-weight: bold;
|
|
415
|
+
}
|
|
416
|
+
.md-typeset table:not([class]) td, .md-typeset table:not([class]) th {
|
|
417
|
+
border-bottom: 1px solid var(--md-default-fg-color);
|
|
418
|
+
}
|
|
419
|
+
|
|
420
|
+
.md-typeset pre > code::-webkit-scrollbar-thumb {
|
|
421
|
+
background-color: hsla(0, 0%, 0%, 0.32);
|
|
422
|
+
}
|
|
423
|
+
.md-typeset pre > code::-webkit-scrollbar-thumb:hover {
|
|
424
|
+
background-color: hsla(0, 0%, 0%, 0.87);
|
|
425
|
+
}
|
|
426
|
+
`,Rt=()=>`
|
|
427
|
+
/*================== Animations ==================*/
|
|
428
|
+
/*
|
|
429
|
+
Disable CSS animations on link colors as they lead to issues in dark mode.
|
|
430
|
+
The dark mode color theme is applied later and theirfore there is always an animation from light to dark mode when navigation between pages.
|
|
431
|
+
*/
|
|
432
|
+
.md-dialog, .md-nav__link, .md-footer__link, .md-typeset a, .md-typeset a::before, .md-typeset .headerlink {
|
|
433
|
+
transition: none;
|
|
434
|
+
}
|
|
435
|
+
`,Ft=({theme:y})=>`
|
|
436
|
+
/*================== Extensions ==================*/
|
|
437
|
+
|
|
438
|
+
/* HIGHLIGHT */
|
|
439
|
+
.highlight .md-clipboard:after {
|
|
440
|
+
content: unset;
|
|
441
|
+
}
|
|
442
|
+
|
|
443
|
+
.highlight .nx {
|
|
444
|
+
color: ${y.palette.type==="dark"?"#ff53a3":"#ec407a"};
|
|
445
|
+
}
|
|
446
|
+
|
|
447
|
+
/* CODE HILITE */
|
|
448
|
+
.codehilite .gd {
|
|
449
|
+
background-color: ${y.palette.type==="dark"?"rgba(248,81,73,0.65)":"#fdd"};
|
|
450
|
+
}
|
|
451
|
+
|
|
452
|
+
.codehilite .gi {
|
|
453
|
+
background-color: ${y.palette.type==="dark"?"rgba(46,160,67,0.65)":"#dfd"};
|
|
454
|
+
}
|
|
455
|
+
|
|
456
|
+
/* TABBED */
|
|
457
|
+
.tabbed-set>input:nth-child(1):checked~.tabbed-labels>:nth-child(1),
|
|
458
|
+
.tabbed-set>input:nth-child(2):checked~.tabbed-labels>:nth-child(2),
|
|
459
|
+
.tabbed-set>input:nth-child(3):checked~.tabbed-labels>:nth-child(3),
|
|
460
|
+
.tabbed-set>input:nth-child(4):checked~.tabbed-labels>:nth-child(4),
|
|
461
|
+
.tabbed-set>input:nth-child(5):checked~.tabbed-labels>:nth-child(5),
|
|
462
|
+
.tabbed-set>input:nth-child(6):checked~.tabbed-labels>:nth-child(6),
|
|
463
|
+
.tabbed-set>input:nth-child(7):checked~.tabbed-labels>:nth-child(7),
|
|
464
|
+
.tabbed-set>input:nth-child(8):checked~.tabbed-labels>:nth-child(8),
|
|
465
|
+
.tabbed-set>input:nth-child(9):checked~.tabbed-labels>:nth-child(9),
|
|
466
|
+
.tabbed-set>input:nth-child(10):checked~.tabbed-labels>:nth-child(10),
|
|
467
|
+
.tabbed-set>input:nth-child(11):checked~.tabbed-labels>:nth-child(11),
|
|
468
|
+
.tabbed-set>input:nth-child(12):checked~.tabbed-labels>:nth-child(12),
|
|
469
|
+
.tabbed-set>input:nth-child(13):checked~.tabbed-labels>:nth-child(13),
|
|
470
|
+
.tabbed-set>input:nth-child(14):checked~.tabbed-labels>:nth-child(14),
|
|
471
|
+
.tabbed-set>input:nth-child(15):checked~.tabbed-labels>:nth-child(15),
|
|
472
|
+
.tabbed-set>input:nth-child(16):checked~.tabbed-labels>:nth-child(16),
|
|
473
|
+
.tabbed-set>input:nth-child(17):checked~.tabbed-labels>:nth-child(17),
|
|
474
|
+
.tabbed-set>input:nth-child(18):checked~.tabbed-labels>:nth-child(18),
|
|
475
|
+
.tabbed-set>input:nth-child(19):checked~.tabbed-labels>:nth-child(19),
|
|
476
|
+
.tabbed-set>input:nth-child(20):checked~.tabbed-labels>:nth-child(20) {
|
|
477
|
+
color: var(--md-accent-fg-color);
|
|
478
|
+
border-color: var(--md-accent-fg-color);
|
|
479
|
+
}
|
|
480
|
+
|
|
481
|
+
/* TASK-LIST */
|
|
482
|
+
.task-list-control .task-list-indicator::before {
|
|
483
|
+
background-color: ${y.palette.action.disabledBackground};
|
|
484
|
+
}
|
|
485
|
+
.task-list-control [type="checkbox"]:checked + .task-list-indicator:before {
|
|
486
|
+
background-color: ${y.palette.success.main};
|
|
487
|
+
}
|
|
488
|
+
|
|
489
|
+
/* ADMONITION */
|
|
490
|
+
.admonition {
|
|
491
|
+
font-size: var(--md-typeset-font-size) !important;
|
|
492
|
+
}
|
|
493
|
+
.admonition .admonition-title {
|
|
494
|
+
padding-left: 2.5rem !important;
|
|
495
|
+
}
|
|
496
|
+
|
|
497
|
+
.admonition .admonition-title:before {
|
|
498
|
+
top: 50% !important;
|
|
499
|
+
width: 20px !important;
|
|
500
|
+
height: 20px !important;
|
|
501
|
+
transform: translateY(-50%) !important;
|
|
502
|
+
}
|
|
503
|
+
`;const Yt=[be,Fe,vt,ht,Rt,Ft],kt=()=>(0,g.Pf)(),dn=()=>{const y=kt(),Z=(0,Pe.Z)();return(0,h.useMemo)(()=>{const q={theme:Z,sidebar:y};return Yt.reduce((Y,Ce)=>Y+Ce(q),"")},[Z,y])},Kt=()=>{const y=dn();return(0,h.useCallback)(Z=>(Z.getElementsByTagName("head")[0].insertAdjacentHTML("beforeend",`<style>${y}</style>`),Z),[y])},un=(y,Z,q)=>{const Y=y==="src"&&Z.endsWith(".svg"),Ce=!Z.match(/^([a-z]*:)?\/\//i),Re=Z.startsWith(q);return Y&&(Ce||Re)},Mn=({techdocsStorageApi:y,entityId:Z,path:q})=>async Y=>{const Ce=await y.getApiOrigin(),Re=async(Qe,Et)=>{for(const tt of Qe)if(tt.hasAttribute(Et)){const yt=tt.getAttribute(Et);if(!yt)return;const He=await y.getBaseUrl(yt,Z,q);if(un(Et,yt,Ce))try{const ot=await(await fetch(He,{credentials:"include"})).text();tt.setAttribute(Et,`data:image/svg+xml;base64,${btoa(unescape(encodeURIComponent(ot)))}`)}catch{tt.setAttribute("alt",`Error: ${yt}`)}else tt.setAttribute(Et,He)}};return await Promise.all([Re(Y.querySelectorAll("img"),"src"),Re(Y.querySelectorAll("script"),"src"),Re(Y.querySelectorAll("source"),"src"),Re(Y.querySelectorAll("link"),"href"),Re(Y.querySelectorAll("a[download]"),"href")]),Y};var Bn=r(79158),xn=r(67097),$n=r(28316),Dn=r(82717),on=r.n(Dn);const wn=y=>Z=>{var q;const Y=Z.querySelector('[title="Edit this page"]');if(!Y||!Y.href)return Z;const Ce=new URL(Y.href),Re=y.byUrl(Ce);if((Re==null?void 0:Re.type)!=="github"&&(Re==null?void 0:Re.type)!=="gitlab")return Z;const Qe=((q=Z.querySelector("article>h1"))===null||q===void 0?void 0:q.childNodes[0].textContent)||"",Et=encodeURIComponent(`Documentation Feedback: ${Qe}`),tt=encodeURIComponent(`Page source:
|
|
504
|
+
${Y.href}
|
|
505
|
+
|
|
506
|
+
Feedback:`),yt=(Re==null?void 0:Re.type)==="github"?(0,Bn.BT)(Ce.href,"blob"):Ce.href,He=on()(yt),lt=`/${He.organization}/${He.name}`,ot=Y.cloneNode();switch(Re==null?void 0:Re.type){case"gitlab":ot.href=`${Ce.origin}${lt}/issues/new?issue[title]=${Et}&issue[description]=${tt}`;break;case"github":ot.href=`${Ce.origin}${lt}/issues/new?title=${Et}&body=${tt}`;break;default:return Z}return $n.render(h.createElement(xn.Z),ot),ot.style.paddingLeft="5px",ot.title="Leave feedback for this page",ot.id="git-feedback-link",Y==null||Y.insertAdjacentElement("beforebegin",ot),Z};var zn=r(44882);const ut=()=>y=>{const Z=y.querySelector('.md-header label[for="__drawer"]'),q=y.querySelector("article");if(!Z||!q)return y;const Y=Z.cloneNode();return $n.render(h.createElement(zn.Z),Y),Y.id="toggle-sidebar",Y.title="Toggle Sidebar",Y.classList.add("md-content__button"),Y.style.setProperty("padding","0 0 0 5px"),Y.style.setProperty("margin","0.4rem 0 0.4rem 0.4rem"),q==null||q.prepend(Y),y},_t=()=>y=>(((q,Y)=>{Array.from(q).filter(Ce=>Ce.hasAttribute(Y)).forEach(Ce=>{const Re=Ce.getAttribute(Y);if(Re){Re.match(/^https?:\/\//i)&&Ce.setAttribute("target","_blank");try{const Qe=Wt(window.location.href);Ce.setAttribute(Y,new URL(Re,Qe).toString())}catch{Ce.replaceWith(Ce.textContent||Re)}}})})(Array.from(y.getElementsByTagName("a")),"href"),y);function Wt(y){const Z=new URL(y);return!Z.pathname.endsWith("/")&&!Z.pathname.endsWith(".html")&&(Z.pathname+="/"),Z.toString()}const dt=({baseUrl:y,onClick:Z})=>q=>(Array.from(q.getElementsByTagName("a")).forEach(Y=>{Y.addEventListener("click",Ce=>{const Qe=Y.getAttribute("href");Qe&&Qe.startsWith(y)&&!Y.hasAttribute("download")&&(Ce.preventDefault(),Z(Ce,Qe))})}),q);var bn=r(15459),Vt=r(80030),hn=r(72379),jn=r(41547),an=r(95074);const Yn=(0,bn.Z)(y=>({tooltip:{fontSize:"inherit",color:y.palette.text.primary,margin:0,padding:y.spacing(.5),backgroundColor:"transparent",boxShadow:"none"}}))(Vt.ZP),je=()=>(0,t.jsx)(hn.Z,{children:(0,t.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"})}),le=({text:y})=>{const[Z,q]=(0,h.useState)(!1),[,Y]=(0,an.Z)(),Ce=(0,h.useCallback)(()=>{Y(y),q(!0)},[y,Y]),Re=(0,h.useCallback)(()=>{q(!1)},[q]);return(0,t.jsx)(Yn,{title:"Copied to clipboard",placement:"left",open:Z,onClose:Re,leaveDelay:1e3,children:(0,t.jsx)(I.Z,{style:{color:"inherit"},className:"md-clipboard md-icon",onClick:Ce,children:(0,t.jsx)(je,{})})})},Oe=y=>Z=>{const q=Z.querySelectorAll("pre > code");for(const Ce of q){var Y;const Re=Ce.textContent||"",Qe=document.createElement("div");Ce==null||(Y=Ce.parentElement)===null||Y===void 0||Y.prepend(Qe),$n.render((0,t.jsx)(jn.Z,{theme:y,children:(0,t.jsx)(le,{text:Re})}),Qe)}return Z},Ue=()=>y=>{var Z;return(Z=y.querySelector(".md-header"))===null||Z===void 0||Z.remove(),y},qe=()=>y=>{var Z,q;return(Z=y.querySelector(".md-footer .md-copyright"))===null||Z===void 0||Z.remove(),(q=y.querySelector(".md-footer-copyright"))===null||q===void 0||q.remove(),y},_=({onLoading:y,onLoaded:Z})=>q=>(y(),q.addEventListener(W.Ox,function Y(){Z(),q.removeEventListener(W.Ox,Y)}),q),N=()=>y=>(y.addEventListener(W.Ox,function Z(){if(window.location.hash){var q;const Y=window.location.hash.slice(1);(q=y==null?void 0:y.querySelector(`[id="${Y}"]`))===null||q===void 0||q.scrollIntoView()}y.removeEventListener(W.Ox,Z)}),y),ve=()=>y=>(setTimeout(()=>{const Z=y==null?void 0:y.querySelectorAll("li.md-nav__item--active");Z.length!==0&&(Z.forEach(Y=>{const Ce=Y==null?void 0:Y.querySelector("input");Ce!=null&&Ce.checked||Ce==null||Ce.click()}),Z[Z.length-1].scrollIntoView())},200),y),$e=async(y,Z)=>{let q;if(typeof y=="string")q=new DOMParser().parseFromString(y,"text/html").documentElement;else if(y instanceof Element)q=y;else throw new Error("dom is not a recognized type");for(const Y of Z)q=await Y(q);return q};var et=r(73557);function at(y,Z){const q=new URL(Z),Y=`${q.origin}${q.pathname.replace(/\/$/,"")}`,Ce=y.replace(Y,"").replace(/\/+$/,"").replace(/^\/+/,""),Re=new URL(`http://localhost/${Ce}`);return`${Re.pathname}${Re.search}${Re.hash}`}function It(){const y=(0,et.s0)(),q=(0,T.h_)(T.Ds).getOptionalString("app.baseUrl");return(0,h.useCallback)(Ce=>{let Re=Ce;if(q)try{Re=at(Ce,q)}catch{}y(Re)},[y,q])}const Bt="screen and (max-width: 76.1875em)",tn=y=>{const Z=It(),q=(0,Pe.Z)(),Y=(0,We.Z)(Bt),Ce=qt(),Re=Kt(),Qe=(0,T.z$)(),Et=(0,T.h_)(W.Dl),tt=(0,T.h_)(z.q3),{state:yt,path:He,content:lt}=(0,L.DK)(),[ot,Ht]=(0,h.useState)(null),Ut=(0,W.ux)(ot),Jt=(0,h.useCallback)(()=>{if(!ot)return;ot.querySelectorAll(".md-sidebar").forEach(Lt=>{if(Y)Lt.style.top="0px";else{const Jn=document==null?void 0:document.querySelector(".techdocs-reader-page");var nn;const lr=(nn=Jn==null?void 0:Jn.getBoundingClientRect().top)!==null&&nn!==void 0?nn:0;var En;let An=(En=ot.getBoundingClientRect().top)!==null&&En!==void 0?En:0;const Rn=ot.querySelector(".md-container > .md-tabs");var Wn;const rr=(Wn=Rn==null?void 0:Rn.getBoundingClientRect().height)!==null&&Wn!==void 0?Wn:0;An<lr&&(An=lr),Lt.style.top=`${Math.max(An,0)+rr}px`}Lt.style.setProperty("opacity","1")})},[ot,Y]);(0,h.useEffect)(()=>(window.addEventListener("resize",Jt),window.addEventListener("scroll",Jt,!0),()=>{window.removeEventListener("resize",Jt),window.removeEventListener("scroll",Jt,!0)}),[ot,Jt]);const en=(0,h.useCallback)(()=>{if(!ot)return;const Pt=ot.querySelector(".md-footer");Pt&&(Pt.style.width=`${ot.getBoundingClientRect().width}px`)},[ot]);(0,h.useEffect)(()=>(window.addEventListener("resize",en),()=>{window.removeEventListener("resize",en)}),[ot,en]),(0,h.useEffect)(()=>{Ut||(en(),Jt())},[yt,Ut,en,Jt]);const Dt=(0,h.useCallback)((Pt,Lt)=>$e(Pt,[Ce,Mn({techdocsStorageApi:Et,entityId:y,path:Lt}),_t(),ut(),Ue(),qe(),wn(tt),Re]),[y,tt,Et,Ce,Re]),At=(0,h.useCallback)(async Pt=>$e(Pt,[N(),ve(),Oe(q),dt({baseUrl:window.location.origin,onClick:(Lt,nn)=>{var En;const Wn=Lt.ctrlKey||Lt.metaKey,Jn=new URL(nn),lr=((En=Lt.target)===null||En===void 0?void 0:En.innerText)||nn,An=nn.replace(window.location.origin,"");if(Qe.captureEvent("click",lr,{attributes:{to:An}}),Jn.hash)if(Wn)window.open(nn,"_blank");else{var Rn;Z(nn),(Rn=Pt==null?void 0:Pt.querySelector(`[id="${Jn.hash.slice(1)}"]`))===null||Rn===void 0||Rn.scrollIntoView()}else Wn?window.open(nn,"_blank"):Z(nn)}}),_({onLoading:()=>{},onLoaded:()=>{var Lt;(Lt=Pt.querySelector(".md-nav__title"))===null||Lt===void 0||Lt.removeAttribute("for")}}),_({onLoading:()=>{Array.from(Pt.querySelectorAll(".md-sidebar")).forEach(nn=>{nn.style.setProperty("opacity","0")})},onLoaded:()=>{}})]),[q,Z,Qe]);return(0,h.useEffect)(()=>{if(!lt)return()=>{};let Pt=!0;return Dt(lt,He).then(async Lt=>{if(!(Lt!=null&&Lt.innerHTML)||!Pt)return;window.scroll({top:0});const nn=await At(Lt);Ht(nn)}),()=>{Pt=!1}},[lt,He,Dt,At]),ot};var X=r(8560);const K=()=>{const y=(0,W.$L)(),{shadowRoot:Z}=(0,W.x1)(),q=Z==null?void 0:Z.querySelector('[data-md-component="content"]'),Y=Z==null?void 0:Z.querySelector('div[data-md-component="sidebar"][data-md-type="navigation"], div[data-md-component="navigation"]');let Ce=Y==null?void 0:Y.querySelector('[data-techdocs-addons-location="primary sidebar"]');Ce||(Ce=document.createElement("div"),Ce.setAttribute("data-techdocs-addons-location","primary sidebar"),Y==null||Y.prepend(Ce));const Re=Z==null?void 0:Z.querySelector('div[data-md-component="sidebar"][data-md-type="toc"], div[data-md-component="toc"]');let Qe=Re==null?void 0:Re.querySelector('[data-techdocs-addons-location="secondary sidebar"]');return Qe||(Qe=document.createElement("div"),Qe.setAttribute("data-techdocs-addons-location","secondary sidebar"),Re==null||Re.prepend(Qe)),(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(X.Z,{container:Ce,children:y.renderComponentsByLocation(W.oZ.PrimarySidebar)}),(0,t.jsx)(X.Z,{container:q,children:y.renderComponentsByLocation(W.oZ.Content)}),(0,t.jsx)(X.Z,{container:Qe,children:y.renderComponentsByLocation(W.oZ.SecondarySidebar)})]})},se=(0,H.Z)({search:{width:"100%","@media (min-width: 76.1875em)":{width:"calc(100% - 34.4rem)",margin:"0 auto"}}}),pe=(0,L.m1)(y=>{var Z;const{withSearch:q=!0,onReady:Y}=y,Ce=se(),{entityMetadata:{value:Re,loading:Qe},entityRef:Et,setShadowRoot:tt}=(0,W.x1)(),yt=tn(Et),He=(0,h.useCallback)(lt=>{tt(lt),Y instanceof Function&&Y()},[tt,Y]);return Qe===!1&&!Re?(0,t.jsx)(g.mf,{status:"404",statusMessage:"PAGE NOT FOUND"}):yt?(0,t.jsx)(g.VY,{children:(0,t.jsxs)(f.Z,{container:!0,children:[(0,t.jsx)(f.Z,{xs:12,item:!0,children:(0,t.jsx)(re,{})}),q&&(0,t.jsx)(f.Z,{className:Ce.search,xs:"auto",item:!0,children:(0,t.jsx)(d.S,{entityId:Et,entityTitle:Re==null||(Z=Re.metadata)===null||Z===void 0?void 0:Z.title})}),(0,t.jsx)(f.Z,{xs:12,item:!0,children:(0,t.jsx)(W.VA,{element:yt,onAppend:He,children:(0,t.jsx)(K,{})})})]})}):(0,t.jsx)(g.VY,{children:(0,t.jsx)(f.Z,{container:!0,children:(0,t.jsx)(f.Z,{xs:12,item:!0,children:(0,t.jsx)(re,{})})})})}),ce=null},93225:function(Ct,Be,r){"use strict";r.d(Be,{S:function(){return ee}});var t=r(52322),h=r(2784),H=r(18671),f=r(60905),W=r(98069),g=r(60364),d=r(73250),B=r(61886),ye=r(40303),ue=r(25271),V=r(53974),J=r(60871),I=r(76635),C=r(95573);const oe=(0,t.jsx)(W.Z,{animation:"wave",variant:"text",height:40}),ee=ne=>{const{palette:{common:{white:$}}}=(0,g.Z)(),{children:T}=ne,P=(0,B.$L)(),L=(0,J.h_)(J.Ds),{title:O,setTitle:re,subtitle:Pe,setSubtitle:We,entityRef:z,metadata:{value:xt,loading:st},entityMetadata:{value:Ke,loading:it}}=(0,B.x1)();(0,h.useEffect)(()=>{xt&&(re(xt.site_name),We(()=>{let{site_description:be}=xt;return(!be||be==="None")&&(be=""),be}))},[xt,re,We]);const nt=L.getOptional("app.title")||"Backstage",bt=[O,Pe,nt].filter(Boolean).join(" | "),{locationMetadata:St,spec:pt}=Ke||{},ft=pt==null?void 0:pt.lifecycle,wt=Ke?(0,ye.hF)(Ke,ue.S4):[],$t=(0,J.tg)(C._Z)(),Ve=(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(V.i9,{label:(0,I.capitalize)((Ke==null?void 0:Ke.kind)||"entity"),value:(0,t.jsx)(ye.dx,{color:"inherit",entityRef:z,title:Ke==null?void 0:Ke.metadata.title,defaultKind:"Component"})}),wt.length>0&&(0,t.jsx)(V.i9,{label:"Owner",value:(0,t.jsx)(ye.rI,{color:"inherit",entityRefs:wt,defaultKind:"group"})}),ft?(0,t.jsx)(V.i9,{label:"Lifecycle",value:ft}):null,St&&St.type!=="dir"&&St.type!=="file"?(0,t.jsx)(V.i9,{label:"",value:(0,t.jsxs)(f.Z,{container:!0,direction:"column",alignItems:"center",style:{color:$},children:[(0,t.jsx)(f.Z,{style:{padding:0},item:!0,children:(0,t.jsx)(d.Z,{style:{marginTop:"-25px"}})}),(0,t.jsx)(f.Z,{style:{padding:0},item:!0,children:"Source"})]}),url:St.target}):null]});return!it&&Ke===void 0||!st&&xt===void 0?null:(0,t.jsxs)(V.h4,{type:"Documentation",typeLink:$t,title:O||oe,subtitle:Pe===""?void 0:Pe||oe,children:[(0,t.jsx)(H.Z,{titleTemplate:"%s",children:(0,t.jsx)("title",{children:bt})}),Ve,T,P.renderComponentsByLocation(B.oZ.Header)]})}},65124:function(Ct,Be,r){"use strict";r.d(Be,{b:function(){return J}});var t=r(52322),h=r(2784),H=r(79692),f=r(15223),W=r(95544),g=r(80030),d=r(61837),B=r(48348),ye=r(47603),ue=r(61886);const V=(0,H.Z)(I=>({root:{gridArea:"pageSubheader",flexDirection:"column",minHeight:"auto",padding:I.spacing(3,3,0)}})),J=I=>{const C=V(),[oe,ee]=(0,h.useState)(null),ne=(0,h.useCallback)(Pe=>{ee(Pe.currentTarget)},[]),$=(0,h.useCallback)(()=>{ee(null)},[]),{entityMetadata:{value:T,loading:P}}=(0,ue.x1)(),L=(0,ue.$L)(),O=L.renderComponentsByLocation(ue.oZ.Subheader),re=L.renderComponentsByLocation(ue.oZ.Settings);return!O&&!re||P===!1&&!T?null:(0,t.jsx)(f.Z,{classes:C,...I.toolbarProps,children:(0,t.jsxs)(W.Z,{display:"flex",justifyContent:"flex-end",width:"100%",flexWrap:"wrap",children:[O,re?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(g.ZP,{title:"Settings",children:(0,t.jsx)(d.Z,{"aria-controls":"tech-docs-reader-page-settings","aria-haspopup":"true",onClick:ne,children:(0,t.jsx)(ye.Z,{})})}),(0,t.jsx)(B.Z,{id:"tech-docs-reader-page-settings",getContentAnchorEl:null,anchorEl:oe,anchorOrigin:{vertical:"bottom",horizontal:"right"},open:Boolean(oe),onClose:$,keepMounted:!0,children:(0,t.jsx)("div",{children:re})})]}):null]})})}},95481:function(Ct,Be,r){"use strict";r.d(Be,{DK:function(){return J},m1:function(){return C}});var t=r(52322),h=r(2784),H=r(73557),f=r(61886),W=r(60871),g=r(64279),d=r(77446);function B({contentLoading:oe,content:ee,activeSyncState:ne}){return oe||ne==="BUILD_READY_RELOAD"||!ee&&ne==="CHECKING"?"CHECKING":!ee&&ne==="BUILDING"?"INITIAL_BUILD":ee?ne==="BUILDING"?"CONTENT_STALE_REFRESHING":ne==="BUILD_READY"?"CONTENT_STALE_READY":ne==="ERROR"?"CONTENT_STALE_ERROR":"CONTENT_FRESH":"CONTENT_NOT_FOUND"}function ye(oe,ee){const ne={...oe};switch(ee.type){case"sync":ee.state==="CHECKING"&&(ne.buildLog=[]),ne.activeSyncState=ee.state,ne.syncError=ee.syncError;break;case"contentLoading":ne.contentLoading=!0,ne.contentError=void 0;break;case"content":typeof ee.path=="string"&&(ne.path=ee.path),ne.contentLoading=!1,ne.content=ee.content,ne.contentError=ee.contentError;break;case"buildLog":ne.buildLog=ne.buildLog.concat(ee.log);break;default:throw new Error}return["BUILD_READY","BUILD_READY_RELOAD"].includes(ne.activeSyncState)&&["contentLoading","content"].includes(ee.type)&&(ne.activeSyncState="UP_TO_DATE",ne.buildLog=[]),ne}function ue(oe,ee,ne,$){var T,P;const[L,O]=(0,h.useReducer)(ye,{activeSyncState:"CHECKING",path:$,contentLoading:!0,buildLog:[]}),re=(0,W.h_)(f.Dl),{retry:Pe}=(0,d.Z)(async()=>{O({type:"contentLoading"});try{const xt=await re.getEntityDocs({kind:oe,namespace:ee,name:ne},$);return O({type:"content",content:xt,path:$}),xt}catch(xt){O({type:"content",contentError:xt,path:$})}},[re,oe,ee,ne,$]),We=(0,h.useRef)({content:void 0,reload:()=>{}});return We.current={content:L.content,reload:Pe},(0,g.default)(async()=>{O({type:"sync",state:"CHECKING"});const xt=setTimeout(()=>{O({type:"sync",state:"BUILDING"})},1e3);try{switch(await re.syncEntityDocs({kind:oe,namespace:ee,name:ne},Ke=>{O({type:"buildLog",log:Ke})})){case"updated":We.current.content?O({type:"sync",state:"BUILD_READY"}):(We.current.reload(),O({type:"sync",state:"BUILD_READY_RELOAD"}));break;case"cached":O({type:"sync",state:"UP_TO_DATE"});break;default:O({type:"sync",state:"ERROR",syncError:new Error("Unexpected return state")});break}}catch(st){O({type:"sync",state:"ERROR",syncError:st})}finally{clearTimeout(xt)}},[oe,ne,ee,re,O,We]),{state:(0,h.useMemo)(()=>B({activeSyncState:L.activeSyncState,contentLoading:L.contentLoading,content:L.content}),[L.activeSyncState,L.content,L.contentLoading]),contentReload:Pe,path:L.path,content:L.content,contentErrorMessage:(T=L.contentError)===null||T===void 0?void 0:T.toString(),syncErrorMessage:(P=L.syncError)===null||P===void 0?void 0:P.toString(),buildLog:L.buildLog}}const V=(0,h.createContext)({}),J=()=>(0,h.useContext)(V),I=oe=>{const{children:ee}=oe,{"*":ne=""}=(0,H.UO)(),{entityRef:$}=(0,f.x1)(),{kind:T,namespace:P,name:L}=$,O=ue(T,P,L,ne);return(0,t.jsx)(V.Provider,{value:O,children:ee instanceof Function?ee(O):ee})},C=oe=>ee=>(0,t.jsx)(I,{children:(0,t.jsx)(oe,{...ee})})},95573:function(Ct,Be,r){"use strict";r.d(Be,{Fw:function(){return H},_Z:function(){return h},pd:function(){return f}});var t=r(60871);const h=(0,t.NT)({id:"techdocs:index-page"}),H=(0,t.NT)({id:"techdocs:reader-page",params:["namespace","kind","name"]}),f=(0,t.NT)({id:"techdocs:catalog-reader-view"})},55511:function(Ct,Be,r){"use strict";r.r(Be),r.d(Be,{TechDocsSearchResultListItem:function(){return ue}});var t=r(52322),h=r(2784),H=r(79692),f=r(49378),W=r(86136),g=r(90436),d=r(53974),B=r(15096);const ye=(0,H.Z)({flexContainer:{flexWrap:"wrap"},itemText:{width:"100%",marginBottom:"1rem"}}),ue=V=>{const{result:J,highlight:I,lineClamp:C=5,asListItem:oe=!0,asLink:ee=!0,title:ne,icon:$}=V,T=ye(),P=({children:re})=>ee?(0,t.jsx)(d.rU,{noTrack:!0,to:J.location,children:re}):(0,t.jsx)(t.Fragment,{children:re}),L=()=>{const re=I!=null&&I.fields.title?(0,t.jsx)(B.FA,{text:I.fields.title,preTag:I.preTag,postTag:I.postTag}):J.title,Pe=I!=null&&I.fields.entityTitle?(0,t.jsx)(B.FA,{text:I.fields.entityTitle,preTag:I.preTag,postTag:I.postTag}):J.entityTitle,We=I!=null&&I.fields.name?(0,t.jsx)(B.FA,{text:I.fields.name,preTag:I.preTag,postTag:I.postTag}):J.name;return J?(0,t.jsx)(f.Z,{className:T.itemText,primaryTypographyProps:{variant:"h6"},primary:(0,t.jsx)(P,{children:ne||(0,t.jsxs)(t.Fragment,{children:[re," | ",Pe!=null?Pe:We," docs"]})}),secondary:(0,t.jsx)(g.Z,{component:"span",style:{display:"-webkit-box",WebkitBoxOrient:"vertical",WebkitLineClamp:C,overflow:"hidden"},color:"textSecondary",variant:"body2",children:I!=null&&I.fields.text?(0,t.jsx)(B.FA,{text:I.fields.text,preTag:I.preTag,postTag:I.postTag}):J.text})}):null},O=({children:re})=>oe?(0,t.jsxs)(t.Fragment,{children:[$&&(0,t.jsx)(W.Z,{children:typeof $=="function"?$(J):$}),(0,t.jsx)("div",{className:T.flexContainer,children:re})]}):(0,t.jsx)(t.Fragment,{children:re});return(0,t.jsx)(O,{children:(0,t.jsx)(L,{})})}},22478:function(Ct,Be,r){"use strict";r.d(Be,{S:function(){return V}});var t=r(52322),h=r(15096),H=r(79692),f=r(27556),W=r(2784),g=r(73557),d=r(55511);const B=(0,H.Z)(J=>({root:{width:"100%"},bar:{padding:J.spacing(1)}})),ye=J=>J==null?void 0:J.document,ue=J=>{const{entityId:I,entityTitle:C,debounceTime:oe=150}=J,[ee,ne]=(0,W.useState)(!1),$=(0,g.s0)(),{setFilters:T,result:{loading:P,value:L}}=(0,h.Rx)(),O=B(),[re,Pe]=(0,W.useState)([]);(0,W.useEffect)(()=>{let Ke=!0;if(Ke&&L){const it=L.results.slice(0,10);Pe(it)}return()=>{Ke=!1}},[P,L]);const{kind:We,name:z,namespace:xt}=I;(0,W.useEffect)(()=>{T(Ke=>({...Ke,kind:We,namespace:xt,name:z}))},[We,xt,z,T]);const st=(Ke,it)=>{if(ye(it)){const{location:nt}=it.document;$(nt)}};return(0,t.jsx)(f.Z,{className:O.bar,variant:"outlined",children:(0,t.jsx)(h.qO,{classes:{root:O.root},"data-testid":"techdocs-search-bar",size:"small",open:ee,getOptionLabel:()=>"",filterOptions:Ke=>Ke,onClose:()=>{ne(!1)},onFocus:()=>{ne(!0)},onChange:st,blurOnSelect:!0,noOptionsText:"No results found",value:null,options:re,renderOption:({document:Ke,highlight:it})=>(0,t.jsx)(d.TechDocsSearchResultListItem,{result:Ke,lineClamp:3,asListItem:!1,asLink:!1,title:Ke.title,highlight:it}),loading:P,inputDebounceTime:oe,inputPlaceholder:`Search ${C||I.name} docs`,freeSolo:!1})})},V=J=>{const I={term:"",types:["techdocs"],pageCursor:"",filters:J.entityId};return(0,t.jsx)(h.Nd,{initialState:I,children:(0,t.jsx)(ue,{...J})})}},53260:function(){}},function(Ct){var Be=function(t){return Ct(Ct.s=t)};Ct.O(0,[2370,6202,9284,9035,2126,7012,2194,1410,427,242,5109,6816,5218,4736],function(){return Be(6290)});var r=Ct.O()}]);})();
|
|
507
|
+
|
|
508
|
+
//# sourceMappingURL=main.7f000815.js.map
|